vendor: 4,756 bytes, lines 1-159
1/* Copyright 2017 Mozilla Foundation 2 * 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16(function webpackUniversalModuleDefinition(root, factory) { 17 if(typeof exports === 'object' && typeof module === 'object') 18 module.exports = factory(); 19 else if(typeof define === 'function' && define.amd) 20 define("pdfjs-dist/build/pdf.worker", [], factory); 21 else if(typeof exports === 'object') 22 exports["pdfjs-dist/build/pdf.worker"] = factory(); 23 else 24 root["pdfjs-dist/build/pdf.worker"] = root.pdfjsDistBuildPdfWorker = factory(); 25})(this, function() { 26return /******/ (function(modules) { // webpackBootstrap 27/******/ // The module cache 28/******/ var installedModules = {}; 29/******/ 30/******/ // The require function 31/******/ function __w_pdfjs_require__(moduleId) { 32/******/ 33/******/ // Check if module is in cache 34/******/ if(installedModules[moduleId]) 35/******/ return installedModules[moduleId].exports; 36/******/ 37/******/ // Create a new module (and put it into the cache) 38/******/ var module = installedModules[moduleId] = { 39/******/ i: moduleId, 40/******/ l: false, 41/******/ exports: {} 42/******/ }; 43/******/ 44/******/ // Execute the module function 45/******/ modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__); 46/******/ 47/******/ // Flag the module as loaded 48/******/ module.l = true; 49/******/ 50/******/ // Return the exports of the module 51/******/ return module.exports; 52/******/ } 53/******/ 54/******/ 55/******/ // expose the modules object (__webpack_modules__) 56/******/ __w_pdfjs_require__.m = modules; 57/******/ 58/******/ // expose the module cache 59/******/ __w_pdfjs_require__.c = installedModules; 60/******/ 61/******/ // identity function for calling harmony imports with the correct context 62/******/ __w_pdfjs_require__.i = function(value) { return value; }; 63/******/ 64/******/ // define getter function for harmony exports 65/******/ __w_pdfjs_require__.d = function(exports, name, getter) { 66/******/ if(!__w_pdfjs_require__.o(exports, name)) { 67/******/ Object.defineProperty(exports, name, { 68/******/ configurable: false, 69/******/ enumerable: true, 70/******/ get: getter 71/******/ }); 72/******/ } 73/******/ }; 74/******/ 75/******/ // getDefaultExport function for compatibility with non-harmony modules 76/******/ __w_pdfjs_require__.n = function(module) { 77/******/ var getter = module && module.__esModule ? 78/******/ function getDefault() { return module['default']; } : 79/******/ function getModuleExports() { return module; }; 80/******/ __w_pdfjs_require__.d(getter, 'a', getter); 81/******/ return getter; 82/******/ }; 83/******/ 84/******/ // Object.prototype.hasOwnProperty.call 85/******/ __w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 86/******/ 87/******/ // __webpack_public_path__ 88/******/ __w_pdfjs_require__.p = ""; 89/******/ 90/******/ // Load entry module and return exports 91/******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 37); 92/******/ }) 93/************************************************************************/ 94/******/ ([ 95/* 0 */ 96/***/ (function(module, exports, __w_pdfjs_require__) { 97 98"use strict"; 99/* WEBPACK VAR INJECTION */(function(global) { 100var compatibility = __w_pdfjs_require__(36); 101var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this; 102var FONT_IDENTITY_MATRIX = [ 103 0.001, 104 0, 105 0, 106 0.001, 107 0, 108 0 109]; 110var TextRenderingMode = { 111 FILL: 0, 112 STROKE: 1, 113 FILL_STROKE: 2, 114 INVISIBLE: 3, 115 FILL_ADD_TO_PATH: 4, 116 STROKE_ADD_TO_PATH: 5, 117 FILL_STROKE_ADD_TO_PATH: 6, 118 ADD_TO_PATH: 7, 119 FILL_STROKE_MASK: 3, 120 ADD_TO_PATH_FLAG: 4 121}; 122var ImageKind = { 123 GRAYSCALE_1BPP: 1, 124 RGB_24BPP: 2, 125 RGBA_32BPP: 3 126}; 127var AnnotationType = { 128 TEXT: 1, 129 LINK: 2, 130 FREETEXT: 3, 131 LINE: 4, 132 SQUARE: 5, 133 CIRCLE: 6, 134 POLYGON: 7, 135 POLYLINE: 8, 136 HIGHLIGHT: 9, 137 UNDERLINE: 10, 138 SQUIGGLY: 11, 139 STRIKEOUT: 12, 140 STAMP: 13, 141 CARET: 14, 142 INK: 15, 143 POPUP: 16, 144 FILEATTACHMENT: 17, 145 SOUND: 18, 146 MOVIE: 19, 147 WIDGET: 20, 148 SCREEN: 21, 149 PRINTERMARK: 22, 150 TRAPNET: 23, 151 WATERMARK: 24, 152 THREED: 25, 153 REDACT: 26 154}; 155var AnnotationFlag = { 156 INVISIBLE: 0x01, 157 HIDDEN: 0x02, 158 PRINT: 0x04, 159 NOZOOM: 0x08,
160 NOROTATE: 0x10, 161 NOVIEW: 0x20, 162 READONLY: 0x40, 163 LOCKED: 0x80, 164 TOGGLENOVIEW: 0x100, 165 LOCKEDCONTENTS: 0x200 166}; 167var AnnotationFieldFlag = { 168 READONLY: 0x0000001, 169 REQUIRED: 0x0000002, 170 NOEXPORT: 0x0000004, 171 MULTILINE: 0x0001000, 172 PASSWORD: 0x0002000, 173 NOTOGGLETOOFF: 0x0004000, 174 RADIO: 0x0008000, 175 PUSHBUTTON: 0x0010000, 176 COMBO: 0x0020000, 177 EDIT: 0x0040000, 178 SORT: 0x0080000, 179 FILESELECT: 0x0100000, 180 MULTISELECT: 0x0200000, 181 DONOTSPELLCHECK: 0x0400000, 182 DONOTSCROLL: 0x0800000, 183 COMB: 0x1000000, 184 RICHTEXT: 0x2000000, 185 RADIOSINUNISON: 0x2000000, 186 COMMITONSELCHANGE: 0x4000000 187}; 188var AnnotationBorderStyleType = { 189 SOLID: 1, 190 DASHED: 2, 191 BEVELED: 3, 192 INSET: 4, 193 UNDERLINE: 5 194}; 195var StreamType = { 196 UNKNOWN: 0, 197 FLATE: 1, 198 LZW: 2, 199 DCT: 3, 200 JPX: 4, 201 JBIG: 5, 202 A85: 6, 203 AHX: 7, 204 CCF: 8, 205 RL: 9 206}; 207var FontType = { 208 UNKNOWN: 0, 209 TYPE1: 1, 210 TYPE1C: 2, 211 CIDFONTTYPE0: 3, 212 CIDFONTTYPE0C: 4, 213 TRUETYPE: 5, 214 CIDFONTTYPE2: 6, 215 TYPE3: 7, 216 OPENTYPE: 8, 217 TYPE0: 9, 218 MMTYPE1: 10 219}; 220var VERBOSITY_LEVELS = { 221 errors: 0, 222 warnings: 1, 223 infos: 5 224}; 225var CMapCompressionType = { 226 NONE: 0, 227 BINARY: 1, 228 STREAM: 2 229}; 230var OPS = { 231 dependency: 1, 232 setLineWidth: 2, 233 setLineCap: 3, 234 setLineJoin: 4, 235 setMiterLimit: 5, 236 setDash: 6, 237 setRenderingIntent: 7, 238 setFlatness: 8, 239 setGState: 9, 240 save: 10, 241 restore: 11, 242 transform: 12, 243 moveTo: 13, 244 lineTo: 14, 245 curveTo: 15, 246 curveTo2: 16, 247 curveTo3: 17, 248 closePath: 18, 249 rectangle: 19, 250 stroke: 20, 251 closeStroke: 21, 252 fill: 22, 253 eoFill: 23, 254 fillStroke: 24, 255 eoFillStroke: 25, 256 closeFillStroke: 26, 257 closeEOFillStroke: 27, 258 endPath: 28, 259 clip: 29, 260 eoClip: 30, 261 beginText: 31, 262 endText: 32, 263 setCharSpacing: 33, 264 setWordSpacing: 34, 265 setHScale: 35, 266 setLeading: 36, 267 setFont: 37, 268 setTextRenderingMode: 38, 269 setTextRise: 39, 270 moveText: 40, 271 setLeadingMoveText: 41, 272 setTextMatrix: 42, 273 nextLine: 43, 274 showText: 44, 275 showSpacedText: 45, 276 nextLineShowText: 46, 277 nextLineSetSpacingShowText: 47, 278 setCharWidth: 48, 279 setCharWidthAndBounds: 49, 280 setStrokeColorSpace: 50, 281 setFillColorSpace: 51, 282 setStrokeColor: 52, 283 setStrokeColorN: 53, 284 setFillColor: 54, 285 setFillColorN: 55, 286 setStrokeGray: 56, 287 setFillGray: 57, 288 setStrokeRGBColor: 58, 289 setFillRGBColor: 59, 290 setStrokeCMYKColor: 60, 291 setFillCMYKColor: 61, 292 shadingFill: 62, 293 beginInlineImage: 63, 294 beginImageData: 64, 295 endInlineImage: 65, 296 paintXObject: 66, 297 markPoint: 67, 298 markPointProps: 68, 299 beginMarkedContent: 69, 300 beginMarkedContentProps: 70, 301 endMarkedContent: 71, 302 beginCompat: 72, 303 endCompat: 73, 304 paintFormXObjectBegin: 74, 305 paintFormXObjectEnd: 75, 306 beginGroup: 76, 307 endGroup: 77, 308 beginAnnotations: 78, 309 endAnnotations: 79, 310 beginAnnotation: 80, 311 endAnnotation: 81, 312 paintJpegXObject: 82, 313 paintImageMaskXObject: 83, 314 paintImageMaskXObjectGroup: 84, 315 paintImageXObject: 85, 316 paintInlineImageXObject: 86, 317 paintInlineImageXObjectGroup: 87, 318 paintImageXObjectRepeat: 88, 319 paintImageMaskXObjectRepeat: 89, 320 paintSolidColorImageMask: 90, 321 constructPath: 91 322}; 323var verbosity = VERBOSITY_LEVELS.warnings; 324function setVerbosityLevel(level) { 325 verbosity = level; 326} 327function getVerbosityLevel() { 328 return verbosity; 329} 330function info(msg) { 331 if (verbosity >= VERBOSITY_LEVELS.infos) { 332 console.log('Info: ' + msg); 333 } 334} 335function warn(msg) { 336 if (verbosity >= VERBOSITY_LEVELS.warnings) { 337 console.log('Warning: ' + msg); 338 } 339} 340function deprecated(details) { 341 console.log('Deprecated API usage: ' + details); 342} 343function error(msg) { 344 if (verbosity >= VERBOSITY_LEVELS.errors) { 345 console.log('Error: ' + msg); 346 console.log(backtrace()); 347 } 348 throw new Error(msg); 349} 350function backtrace() { 351 try { 352 throw new Error(); 353 } catch (e) { 354 return e.stack ? e.stack.split('\n').slice(2).join('\n') : ''; 355 } 356} 357function assert(cond, msg) { 358 if (!cond) { 359 error(msg); 360 } 361} 362var UNSUPPORTED_FEATURES = { 363 unknown: 'unknown', 364 forms: 'forms', 365 javaScript: 'javaScript', 366 smask: 'smask', 367 shadingPattern: 'shadingPattern', 368 font: 'font' 369}; 370function isSameOrigin(baseUrl, otherUrl) { 371 try { 372 var base = new URL(baseUrl); 373 if (!base.origin || base.origin === 'null') { 374 return false; 375 } 376 } catch (e) { 377 return false; 378 } 379 var other = new URL(otherUrl, base); 380 return base.origin === other.origin; 381} 382function isValidProtocol(url) { 383 if (!url) { 384 return false;
385 } 386 switch (url.protocol) { 387 case 'http:': 388 case 'https:': 389 case 'ftp:': 390 case 'mailto:': 391 case 'tel:': 392 return true; 393 default: 394 return false; 395 } 396} 397function createValidAbsoluteUrl(url, baseUrl) { 398 if (!url) { 399 return null; 400 } 401 try { 402 var absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); 403 if (isValidProtocol(absoluteUrl)) { 404 return absoluteUrl; 405 } 406 } catch (ex) { 407 } 408 return null; 409} 410function shadow(obj, prop, value) { 411 Object.defineProperty(obj, prop, { 412 value: value, 413 enumerable: true, 414 configurable: true, 415 writable: false 416 }); 417 return value; 418} 419function getLookupTableFactory(initializer) { 420 var lookup; 421 return function () { 422 if (initializer) { 423 lookup = Object.create(null); 424 initializer(lookup); 425 initializer = null; 426 } 427 return lookup; 428 }; 429} 430var PasswordResponses = { 431 NEED_PASSWORD: 1, 432 INCORRECT_PASSWORD: 2 433}; 434var PasswordException = function PasswordExceptionClosure() { 435 function PasswordException(msg, code) { 436 this.name = 'PasswordException'; 437 this.message = msg; 438 this.code = code; 439 } 440 PasswordException.prototype = new Error(); 441 PasswordException.constructor = PasswordException; 442 return PasswordException; 443}(); 444var UnknownErrorException = function UnknownErrorExceptionClosure() { 445 function UnknownErrorException(msg, details) { 446 this.name = 'UnknownErrorException'; 447 this.message = msg; 448 this.details = details; 449 } 450 UnknownErrorException.prototype = new Error(); 451 UnknownErrorException.constructor = UnknownErrorException; 452 return UnknownErrorException; 453}(); 454var InvalidPDFException = function InvalidPDFExceptionClosure() { 455 function InvalidPDFException(msg) { 456 this.name = 'InvalidPDFException'; 457 this.message = msg; 458 } 459 InvalidPDFException.prototype = new Error(); 460 InvalidPDFException.constructor = InvalidPDFException; 461 return InvalidPDFException; 462}(); 463var MissingPDFException = function MissingPDFExceptionClosure() { 464 function MissingPDFException(msg) { 465 this.name = 'MissingPDFException'; 466 this.message = msg; 467 } 468 MissingPDFException.prototype = new Error(); 469 MissingPDFException.constructor = MissingPDFException; 470 return MissingPDFException; 471}(); 472var UnexpectedResponseException = function UnexpectedResponseExceptionClosure() { 473 function UnexpectedResponseException(msg, status) { 474 this.name = 'UnexpectedResponseException'; 475 this.message = msg; 476 this.status = status; 477 } 478 UnexpectedResponseException.prototype = new Error(); 479 UnexpectedResponseException.constructor = UnexpectedResponseException; 480 return UnexpectedResponseException; 481}(); 482var NotImplementedException = function NotImplementedExceptionClosure() { 483 function NotImplementedException(msg) { 484 this.message = msg; 485 } 486 NotImplementedException.prototype = new Error(); 487 NotImplementedException.prototype.name = 'NotImplementedException'; 488 NotImplementedException.constructor = NotImplementedException; 489 return NotImplementedException; 490}(); 491var MissingDataException = function MissingDataExceptionClosure() { 492 function MissingDataException(begin, end) { 493 this.begin = begin; 494 this.end = end; 495 this.message = 'Missing data [' + begin + ', ' + end + ')'; 496 } 497 MissingDataException.prototype = new Error(); 498 MissingDataException.prototype.name = 'MissingDataException'; 499 MissingDataException.constructor = MissingDataException; 500 return MissingDataException; 501}(); 502var XRefParseException = function XRefParseExceptionClosure() { 503 function XRefParseException(msg) { 504 this.message = msg; 505 } 506 XRefParseException.prototype = new Error(); 507 XRefParseException.prototype.name = 'XRefParseException'; 508 XRefParseException.constructor = XRefParseException; 509 return XRefParseException; 510}(); 511var NullCharactersRegExp = /\x00/g; 512function removeNullCharacters(str) { 513 if (typeof str !== 'string') { 514 warn('The argument for removeNullCharacters must be a string.'); 515 return str; 516 } 517 return str.replace(NullCharactersRegExp, ''); 518} 519function bytesToString(bytes) { 520 assert(bytes !== null && typeof bytes === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString'); 521 var length = bytes.length; 522 var MAX_ARGUMENT_COUNT = 8192; 523 if (length < MAX_ARGUMENT_COUNT) { 524 return String.fromCharCode.apply(null, bytes); 525 } 526 var strBuf = []; 527 for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { 528 var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); 529 var chunk = bytes.subarray(i, chunkEnd); 530 strBuf.push(String.fromCharCode.apply(null, chunk)); 531 } 532 return strBuf.join(''); 533} 534function stringToBytes(str) { 535 assert(typeof str === 'string', 'Invalid argument for stringToBytes'); 536 var length = str.length; 537 var bytes = new Uint8Array(length); 538 for (var i = 0; i < length; ++i) { 539 bytes[i] = str.charCodeAt(i) & 0xFF; 540 } 541 return bytes; 542} 543function arrayByteLength(arr) { 544 if (arr.length !== undefined) { 545 return arr.length; 546 } 547 assert(arr.byteLength !== undefined); 548 return arr.byteLength; 549} 550function arraysToBytes(arr) { 551 if (arr.length === 1 && arr[0] instanceof Uint8Array) { 552 return arr[0]; 553 } 554 var resultLength = 0; 555 var i, ii = arr.length; 556 var item, itemLength; 557 for (i = 0; i < ii; i++) { 558 item = arr[i]; 559 itemLength = arrayByteLength(item); 560 resultLength += itemLength; 561 } 562 var pos = 0; 563 var data = new Uint8Array(resultLength); 564 for (i = 0; i < ii; i++) { 565 item = arr[i]; 566 if (!(item instanceof Uint8Array)) { 567 if (typeof item === 'string') { 568 item = stringToBytes(item); 569 } else { 570 item = new Uint8Array(item); 571 } 572 } 573 itemLength = item.byteLength; 574 data.set(item, pos); 575 pos += itemLength; 576 } 577 return data; 578} 579function string32(value) { 580 return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); 581} 582function log2(x) { 583 var n = 1, i = 0; 584 while (x > n) { 585 n <<= 1; 586 i++; 587 } 588 return i; 589} 590function readInt8(data, start) { 591 return data[start] << 24 >> 24; 592} 593function readUint16(data, offset) { 594 return data[offset] << 8 | data[offset + 1]; 595} 596function readUint32(data, offset) { 597 return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; 598} 599function isLittleEndian() { 600 var buffer8 = new Uint8Array(2); 601 buffer8[0] = 1; 602 var buffer16 = new Uint16Array(buffer8.buffer); 603 return buffer16[0] === 1; 604} 605function isEvalSupported() { 606 try { 607 new Function(''); 608 return true; 609 } catch (e) { 610 return false;
vendor: 4,585 bytes, lines 611-788
611 } 612} 613var Uint32ArrayView = function Uint32ArrayViewClosure() { 614 function Uint32ArrayView(buffer, length) { 615 this.buffer = buffer; 616 this.byteLength = buffer.length; 617 this.length = length === undefined ? this.byteLength >> 2 : length; 618 ensureUint32ArrayViewProps(this.length); 619 } 620 Uint32ArrayView.prototype = Object.create(null); 621 var uint32ArrayViewSetters = 0; 622 function createUint32ArrayProp(index) { 623 return { 624 get: function () { 625 var buffer = this.buffer, offset = index << 2; 626 return (buffer[offset] | buffer[offset + 1] << 8 | buffer[offset + 2] << 16 | buffer[offset + 3] << 24) >>> 0; 627 }, 628 set: function (value) { 629 var buffer = this.buffer, offset = index << 2; 630 buffer[offset] = value & 255; 631 buffer[offset + 1] = value >> 8 & 255; 632 buffer[offset + 2] = value >> 16 & 255; 633 buffer[offset + 3] = value >>> 24 & 255; 634 } 635 }; 636 } 637 function ensureUint32ArrayViewProps(length) { 638 while (uint32ArrayViewSetters < length) { 639 Object.defineProperty(Uint32ArrayView.prototype, uint32ArrayViewSetters, createUint32ArrayProp(uint32ArrayViewSetters)); 640 uint32ArrayViewSetters++; 641 } 642 } 643 return Uint32ArrayView; 644}(); 645exports.Uint32ArrayView = Uint32ArrayView; 646var IDENTITY_MATRIX = [ 647 1, 648 0, 649 0, 650 1, 651 0, 652 0 653]; 654var Util = function UtilClosure() { 655 function Util() { 656 } 657 var rgbBuf = [ 658 'rgb(', 659 0, 660 ',', 661 0, 662 ',', 663 0, 664 ')' 665 ]; 666 Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { 667 rgbBuf[1] = r; 668 rgbBuf[3] = g; 669 rgbBuf[5] = b; 670 return rgbBuf.join(''); 671 }; 672 Util.transform = function Util_transform(m1, m2) { 673 return [ 674 m1[0] * m2[0] + m1[2] * m2[1], 675 m1[1] * m2[0] + m1[3] * m2[1], 676 m1[0] * m2[2] + m1[2] * m2[3], 677 m1[1] * m2[2] + m1[3] * m2[3], 678 m1[0] * m2[4] + m1[2] * m2[5] + m1[4], 679 m1[1] * m2[4] + m1[3] * m2[5] + m1[5] 680 ]; 681 }; 682 Util.applyTransform = function Util_applyTransform(p, m) { 683 var xt = p[0] * m[0] + p[1] * m[2] + m[4]; 684 var yt = p[0] * m[1] + p[1] * m[3] + m[5]; 685 return [ 686 xt, 687 yt 688 ]; 689 }; 690 Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { 691 var d = m[0] * m[3] - m[1] * m[2]; 692 var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; 693 var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; 694 return [ 695 xt, 696 yt 697 ]; 698 }; 699 Util.getAxialAlignedBoundingBox = function Util_getAxialAlignedBoundingBox(r, m) { 700 var p1 = Util.applyTransform(r, m); 701 var p2 = Util.applyTransform(r.slice(2, 4), m); 702 var p3 = Util.applyTransform([ 703 r[0], 704 r[3] 705 ], m); 706 var p4 = Util.applyTransform([ 707 r[2], 708 r[1] 709 ], m); 710 return [ 711 Math.min(p1[0], p2[0], p3[0], p4[0]), 712 Math.min(p1[1], p2[1], p3[1], p4[1]), 713 Math.max(p1[0], p2[0], p3[0], p4[0]), 714 Math.max(p1[1], p2[1], p3[1], p4[1]) 715 ]; 716 }; 717 Util.inverseTransform = function Util_inverseTransform(m) { 718 var d = m[0] * m[3] - m[1] * m[2]; 719 return [ 720 m[3] / d, 721 -m[1] / d, 722 -m[2] / d, 723 m[0] / d, 724 (m[2] * m[5] - m[4] * m[3]) / d, 725 (m[4] * m[1] - m[5] * m[0]) / d 726 ]; 727 }; 728 Util.apply3dTransform = function Util_apply3dTransform(m, v) { 729 return [ 730 m[0] * v[0] + m[1] * v[1] + m[2] * v[2], 731 m[3] * v[0] + m[4] * v[1] + m[5] * v[2], 732 m[6] * v[0] + m[7] * v[1] + m[8] * v[2] 733 ]; 734 }; 735 Util.singularValueDecompose2dScale = function Util_singularValueDecompose2dScale(m) { 736 var transpose = [ 737 m[0], 738 m[2], 739 m[1], 740 m[3] 741 ]; 742 var a = m[0] * transpose[0] + m[1] * transpose[2]; 743 var b = m[0] * transpose[1] + m[1] * transpose[3]; 744 var c = m[2] * transpose[0] + m[3] * transpose[2]; 745 var d = m[2] * transpose[1] + m[3] * transpose[3]; 746 var first = (a + d) / 2; 747 var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; 748 var sx = first + second || 1; 749 var sy = first - second || 1; 750 return [ 751 Math.sqrt(sx), 752 Math.sqrt(sy) 753 ]; 754 }; 755 Util.normalizeRect = function Util_normalizeRect(rect) { 756 var r = rect.slice(0); 757 if (rect[0] > rect[2]) { 758 r[0] = rect[2]; 759 r[2] = rect[0]; 760 } 761 if (rect[1] > rect[3]) { 762 r[1] = rect[3]; 763 r[3] = rect[1]; 764 } 765 return r; 766 }; 767 Util.intersect = function Util_intersect(rect1, rect2) { 768 function compare(a, b) { 769 return a - b; 770 } 771 var orderedX = [ 772 rect1[0], 773 rect1[2], 774 rect2[0], 775 rect2[2] 776 ].sort(compare), orderedY = [ 777 rect1[1], 778 rect1[3], 779 rect2[1], 780 rect2[3] 781 ].sort(compare), result = []; 782 rect1 = Util.normalizeRect(rect1); 783 rect2 = Util.normalizeRect(rect2); 784 if (orderedX[0] === rect1[0] && orderedX[1] === rect2[0] || orderedX[0] === rect2[0] && orderedX[1] === rect1[0]) { 785 result[0] = orderedX[1]; 786 result[2] = orderedX[2]; 787 } else { 788 return false;
789 } 790 if (orderedY[0] === rect1[1] && orderedY[1] === rect2[1] || orderedY[0] === rect2[1] && orderedY[1] === rect1[1]) { 791 result[1] = orderedY[1]; 792 result[3] = orderedY[2]; 793 } else { 794 return false; 795 } 796 return result; 797 }; 798 Util.sign = function Util_sign(num) { 799 return num < 0 ? -1 : 1; 800 }; 801 var ROMAN_NUMBER_MAP = [ 802 '', 803 'C', 804 'CC', 805 'CCC', 806 'CD', 807 'D', 808 'DC', 809 'DCC', 810 'DCCC', 811 'CM', 812 '', 813 'X', 814 'XX', 815 'XXX', 816 'XL', 817 'L', 818 'LX', 819 'LXX', 820 'LXXX', 821 'XC', 822 '', 823 'I', 824 'II', 825 'III', 826 'IV', 827 'V', 828 'VI', 829 'VII', 830 'VIII', 831 'IX' 832 ]; 833 Util.toRoman = function Util_toRoman(number, lowerCase) { 834 assert(isInt(number) && number > 0, 'The number should be a positive integer.'); 835 var pos, romanBuf = []; 836 while (number >= 1000) { 837 number -= 1000; 838 romanBuf.push('M'); 839 } 840 pos = number / 100 | 0; 841 number %= 100; 842 romanBuf.push(ROMAN_NUMBER_MAP[pos]); 843 pos = number / 10 | 0; 844 number %= 10; 845 romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); 846 romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); 847 var romanStr = romanBuf.join(''); 848 return lowerCase ? romanStr.toLowerCase() : romanStr; 849 }; 850 Util.appendToArray = function Util_appendToArray(arr1, arr2) { 851 Array.prototype.push.apply(arr1, arr2); 852 }; 853 Util.prependToArray = function Util_prependToArray(arr1, arr2) { 854 Array.prototype.unshift.apply(arr1, arr2); 855 }; 856 Util.extendObj = function extendObj(obj1, obj2) { 857 for (var key in obj2) { 858 obj1[key] = obj2[key]; 859 } 860 }; 861 Util.getInheritableProperty = function Util_getInheritableProperty(dict, name, getArray) { 862 while (dict && !dict.has(name)) { 863 dict = dict.get('Parent'); 864 } 865 if (!dict) { 866 return null; 867 } 868 return getArray ? dict.getArray(name) : dict.get(name); 869 }; 870 Util.inherit = function Util_inherit(sub, base, prototype) { 871 sub.prototype = Object.create(base.prototype); 872 sub.prototype.constructor = sub; 873 for (var prop in prototype) { 874 sub.prototype[prop] = prototype[prop]; 875 } 876 }; 877 Util.loadScript = function Util_loadScript(src, callback) { 878 var script = document.createElement('script'); 879 var loaded = false; 880 script.setAttribute('src', src); 881 if (callback) { 882 script.onload = function () { 883 if (!loaded) {
vendor: 4,479 bytes, lines 884-1183
884 callback(); 885 } 886 loaded = true; 887 }; 888 } 889 document.getElementsByTagName('head')[0].appendChild(script); 890 }; 891 return Util; 892}(); 893var PageViewport = function PageViewportClosure() { 894 function PageViewport(viewBox, scale, rotation, offsetX, offsetY, dontFlip) { 895 this.viewBox = viewBox; 896 this.scale = scale; 897 this.rotation = rotation; 898 this.offsetX = offsetX; 899 this.offsetY = offsetY; 900 var centerX = (viewBox[2] + viewBox[0]) / 2; 901 var centerY = (viewBox[3] + viewBox[1]) / 2; 902 var rotateA, rotateB, rotateC, rotateD; 903 rotation = rotation % 360; 904 rotation = rotation < 0 ? rotation + 360 : rotation; 905 switch (rotation) { 906 case 180: 907 rotateA = -1; 908 rotateB = 0; 909 rotateC = 0; 910 rotateD = 1; 911 break; 912 case 90: 913 rotateA = 0; 914 rotateB = 1; 915 rotateC = 1; 916 rotateD = 0; 917 break; 918 case 270: 919 rotateA = 0; 920 rotateB = -1; 921 rotateC = -1; 922 rotateD = 0; 923 break; 924 default: 925 rotateA = 1; 926 rotateB = 0; 927 rotateC = 0; 928 rotateD = -1; 929 break; 930 } 931 if (dontFlip) { 932 rotateC = -rotateC; 933 rotateD = -rotateD; 934 } 935 var offsetCanvasX, offsetCanvasY; 936 var width, height; 937 if (rotateA === 0) { 938 offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; 939 offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; 940 width = Math.abs(viewBox[3] - viewBox[1]) * scale; 941 height = Math.abs(viewBox[2] - viewBox[0]) * scale; 942 } else { 943 offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; 944 offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; 945 width = Math.abs(viewBox[2] - viewBox[0]) * scale; 946 height = Math.abs(viewBox[3] - viewBox[1]) * scale; 947 } 948 this.transform = [ 949 rotateA * scale, 950 rotateB * scale, 951 rotateC * scale, 952 rotateD * scale, 953 offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, 954 offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY 955 ]; 956 this.width = width; 957 this.height = height; 958 this.fontScale = scale; 959 } 960 PageViewport.prototype = { 961 clone: function PageViewPort_clone(args) { 962 args = args || {}; 963 var scale = 'scale' in args ? args.scale : this.scale; 964 var rotation = 'rotation' in args ? args.rotation : this.rotation; 965 return new PageViewport(this.viewBox.slice(), scale, rotation, this.offsetX, this.offsetY, args.dontFlip); 966 }, 967 convertToViewportPoint: function PageViewport_convertToViewportPoint(x, y) { 968 return Util.applyTransform([ 969 x, 970 y 971 ], this.transform); 972 }, 973 convertToViewportRectangle: function PageViewport_convertToViewportRectangle(rect) { 974 var tl = Util.applyTransform([ 975 rect[0], 976 rect[1] 977 ], this.transform); 978 var br = Util.applyTransform([ 979 rect[2], 980 rect[3] 981 ], this.transform); 982 return [ 983 tl[0], 984 tl[1], 985 br[0], 986 br[1] 987 ]; 988 }, 989 convertToPdfPoint: function PageViewport_convertToPdfPoint(x, y) { 990 return Util.applyInverseTransform([ 991 x, 992 y 993 ], this.transform); 994 } 995 }; 996 return PageViewport; 997}(); 998var PDFStringTranslateTable = [ 999 0, 1000 0, 1001 0, 1002 0, 1003 0, 1004 0, 1005 0, 1006 0, 1007 0, 1008 0, 1009 0, 1010 0, 1011 0, 1012 0, 1013 0, 1014 0, 1015 0, 1016 0, 1017 0, 1018 0, 1019 0, 1020 0, 1021 0, 1022 0, 1023 0x2D8, 1024 0x2C7, 1025 0x2C6, 1026 0x2D9, 1027 0x2DD, 1028 0x2DB, 1029 0x2DA, 1030 0x2DC, 1031 0, 1032 0, 1033 0, 1034 0, 1035 0, 1036 0, 1037 0, 1038 0, 1039 0, 1040 0, 1041 0, 1042 0, 1043 0, 1044 0, 1045 0, 1046 0, 1047 0, 1048 0, 1049 0, 1050 0, 1051 0, 1052 0, 1053 0, 1054 0, 1055 0, 1056 0, 1057 0, 1058 0, 1059 0, 1060 0, 1061 0, 1062 0, 1063 0, 1064 0, 1065 0, 1066 0, 1067 0, 1068 0, 1069 0, 1070 0, 1071 0, 1072 0, 1073 0, 1074 0, 1075 0, 1076 0, 1077 0, 1078 0, 1079 0, 1080 0, 1081 0, 1082 0, 1083 0, 1084 0, 1085 0, 1086 0, 1087 0, 1088 0, 1089 0, 1090 0, 1091 0, 1092 0, 1093 0, 1094 0, 1095 0, 1096 0, 1097 0, 1098 0, 1099 0, 1100 0, 1101 0, 1102 0, 1103 0, 1104 0, 1105 0, 1106 0, 1107 0, 1108 0, 1109 0, 1110 0, 1111 0, 1112 0, 1113 0, 1114 0, 1115 0, 1116 0, 1117 0, 1118 0, 1119 0, 1120 0, 1121 0, 1122 0, 1123 0, 1124 0, 1125 0, 1126 0, 1127 0x2022, 1128 0x2020, 1129 0x2021, 1130 0x2026, 1131 0x2014, 1132 0x2013, 1133 0x192, 1134 0x2044, 1135 0x2039, 1136 0x203A, 1137 0x2212, 1138 0x2030, 1139 0x201E, 1140 0x201C, 1141 0x201D, 1142 0x2018, 1143 0x2019, 1144 0x201A, 1145 0x2122, 1146 0xFB01, 1147 0xFB02, 1148 0x141, 1149 0x152, 1150 0x160, 1151 0x178, 1152 0x17D, 1153 0x131, 1154 0x142, 1155 0x153, 1156 0x161, 1157 0x17E, 1158 0, 1159 0x20AC 1160]; 1161function stringToPDFString(str) { 1162 var i, n = str.length, strBuf = []; 1163 if (str[0] === '\xFE' && str[1] === '\xFF') { 1164 for (i = 2; i < n; i += 2) { 1165 strBuf.push(String.fromCharCode(str.charCodeAt(i) << 8 | str.charCodeAt(i + 1))); 1166 } 1167 } else { 1168 for (i = 0; i < n; ++i) { 1169 var code = PDFStringTranslateTable[str.charCodeAt(i)]; 1170 strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); 1171 } 1172 } 1173 return strBuf.join(''); 1174} 1175function stringToUTF8String(str) { 1176 return decodeURIComponent(escape(str)); 1177} 1178function utf8StringToString(str) { 1179 return unescape(encodeURIComponent(str)); 1180} 1181function isEmptyObj(obj) { 1182 for (var key in obj) { 1183 return false;
vendor: 5,560 bytes, lines 1184-1386
1184 } 1185 return true; 1186} 1187function isBool(v) { 1188 return typeof v === 'boolean'; 1189} 1190function isInt(v) { 1191 return typeof v === 'number' && (v | 0) === v; 1192} 1193function isNum(v) { 1194 return typeof v === 'number'; 1195} 1196function isString(v) { 1197 return typeof v === 'string'; 1198} 1199function isArray(v) { 1200 return v instanceof Array; 1201} 1202function isArrayBuffer(v) { 1203 return typeof v === 'object' && v !== null && v.byteLength !== undefined; 1204} 1205function isSpace(ch) { 1206 return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A; 1207} 1208function isNodeJS() { 1209 if (typeof __pdfjsdev_webpack__ === 'undefined') { 1210 return typeof process === 'object' && process + '' === '[object process]'; 1211 } 1212 return false; 1213} 1214function createPromiseCapability() { 1215 var capability = {}; 1216 capability.promise = new Promise(function (resolve, reject) { 1217 capability.resolve = resolve; 1218 capability.reject = reject; 1219 }); 1220 return capability; 1221} 1222var StatTimer = function StatTimerClosure() { 1223 function rpad(str, pad, length) { 1224 while (str.length < length) { 1225 str += pad; 1226 } 1227 return str; 1228 } 1229 function StatTimer() { 1230 this.started = Object.create(null); 1231 this.times = []; 1232 this.enabled = true; 1233 } 1234 StatTimer.prototype = { 1235 time: function StatTimer_time(name) { 1236 if (!this.enabled) { 1237 return; 1238 } 1239 if (name in this.started) { 1240 warn('Timer is already running for ' + name); 1241 } 1242 this.started[name] = Date.now(); 1243 }, 1244 timeEnd: function StatTimer_timeEnd(name) { 1245 if (!this.enabled) { 1246 return; 1247 } 1248 if (!(name in this.started)) { 1249 warn('Timer has not been started for ' + name); 1250 } 1251 this.times.push({ 1252 'name': name, 1253 'start': this.started[name], 1254 'end': Date.now() 1255 }); 1256 delete this.started[name]; 1257 }, 1258 toString: function StatTimer_toString() { 1259 var i, ii; 1260 var times = this.times; 1261 var out = ''; 1262 var longest = 0; 1263 for (i = 0, ii = times.length; i < ii; ++i) { 1264 var name = times[i]['name']; 1265 if (name.length > longest) { 1266 longest = name.length; 1267 } 1268 } 1269 for (i = 0, ii = times.length; i < ii; ++i) { 1270 var span = times[i]; 1271 var duration = span.end - span.start; 1272 out += rpad(span['name'], ' ', longest) + ' ' + duration + 'ms\n'; 1273 } 1274 return out; 1275 } 1276 }; 1277 return StatTimer; 1278}(); 1279var createBlob = function createBlob(data, contentType) { 1280 if (typeof Blob !== 'undefined') { 1281 return new Blob([data], { type: contentType }); 1282 } 1283 warn('The "Blob" constructor is not supported.'); 1284}; 1285var createObjectURL = function createObjectURLClosure() { 1286 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; 1287 return function createObjectURL(data, contentType, forceDataSchema) { 1288 if (!forceDataSchema && typeof URL !== 'undefined' && URL.createObjectURL) { 1289 var blob = createBlob(data, contentType); 1290 return URL.createObjectURL(blob); 1291 } 1292 var buffer = 'data:' + contentType + ';base64,'; 1293 for (var i = 0, ii = data.length; i < ii; i += 3) { 1294 var b1 = data[i] & 0xFF; 1295 var b2 = data[i + 1] & 0xFF; 1296 var b3 = data[i + 2] & 0xFF; 1297 var d1 = b1 >> 2, d2 = (b1 & 3) << 4 | b2 >> 4; 1298 var d3 = i + 1 < ii ? (b2 & 0xF) << 2 | b3 >> 6 : 64; 1299 var d4 = i + 2 < ii ? b3 & 0x3F : 64; 1300 buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; 1301 } 1302 return buffer; 1303 }; 1304}(); 1305function MessageHandler(sourceName, targetName, comObj) { 1306 this.sourceName = sourceName; 1307 this.targetName = targetName; 1308 this.comObj = comObj; 1309 this.callbackIndex = 1; 1310 this.postMessageTransfers = true; 1311 var callbacksCapabilities = this.callbacksCapabilities = Object.create(null); 1312 var ah = this.actionHandler = Object.create(null); 1313 this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) { 1314 var data = event.data; 1315 if (data.targetName !== this.sourceName) { 1316 return; 1317 } 1318 if (data.isReply) { 1319 var callbackId = data.callbackId; 1320 if (data.callbackId in callbacksCapabilities) { 1321 var callback = callbacksCapabilities[callbackId]; 1322 delete callbacksCapabilities[callbackId]; 1323 if ('error' in data) { 1324 callback.reject(data.error); 1325 } else { 1326 callback.resolve(data.data); 1327 } 1328 } else { 1329 error('Cannot resolve callback ' + callbackId); 1330 } 1331 } else if (data.action in ah) { 1332 var action = ah[data.action]; 1333 if (data.callbackId) { 1334 var sourceName = this.sourceName; 1335 var targetName = data.sourceName; 1336 Promise.resolve().then(function () { 1337 return action[0].call(action[1], data.data); 1338 }).then(function (result) { 1339 comObj.postMessage({ 1340 sourceName: sourceName, 1341 targetName: targetName, 1342 isReply: true, 1343 callbackId: data.callbackId, 1344 data: result 1345 }); 1346 }, function (reason) { 1347 if (reason instanceof Error) { 1348 reason = reason + ''; 1349 } 1350 comObj.postMessage({ 1351 sourceName: sourceName, 1352 targetName: targetName, 1353 isReply: true, 1354 callbackId: data.callbackId, 1355 error: reason 1356 }); 1357 }); 1358 } else { 1359 action[0].call(action[1], data.data); 1360 } 1361 } else { 1362 error('Unknown action from worker: ' + data.action); 1363 } 1364 }.bind(this); 1365 comObj.addEventListener('message', this._onComObjOnMessage); 1366} 1367MessageHandler.prototype = { 1368 on: function messageHandlerOn(actionName, handler, scope) { 1369 var ah = this.actionHandler; 1370 if (ah[actionName]) { 1371 error('There is already an actionName called "' + actionName + '"'); 1372 } 1373 ah[actionName] = [ 1374 handler, 1375 scope 1376 ]; 1377 }, 1378 send: function messageHandlerSend(actionName, data, transfers) { 1379 var message = { 1380 sourceName: this.sourceName, 1381 targetName: this.targetName, 1382 action: actionName, 1383 data: data 1384 }; 1385 this.postMessage(message, transfers); 1386 },
1387 sendWithPromise: function messageHandlerSendWithPromise(actionName, data, transfers) { 1388 var callbackId = this.callbackIndex++; 1389 var message = { 1390 sourceName: this.sourceName, 1391 targetName: this.targetName, 1392 action: actionName, 1393 data: data, 1394 callbackId: callbackId 1395 }; 1396 var capability = createPromiseCapability(); 1397 this.callbacksCapabilities[callbackId] = capability; 1398 try { 1399 this.postMessage(message, transfers); 1400 } catch (e) { 1401 capability.reject(e); 1402 } 1403 return capability.promise; 1404 }, 1405 postMessage: function (message, transfers) { 1406 if (transfers && this.postMessageTransfers) { 1407 this.comObj.postMessage(message, transfers); 1408 } else { 1409 this.comObj.postMessage(message); 1410 } 1411 }, 1412 destroy: function () { 1413 this.comObj.removeEventListener('message', this._onComObjOnMessage); 1414 } 1415}; 1416function loadJpegStream(id, imageUrl, objs) { 1417 var img = new Image(); 1418 img.onload = function loadJpegStream_onloadClosure() { 1419 objs.resolve(id, img); 1420 }; 1421 img.onerror = function loadJpegStream_onerrorClosure() { 1422 objs.resolve(id, null); 1423 warn('Error during JPEG image loading'); 1424 }; 1425 img.src = imageUrl; 1426} 1427exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; 1428exports.IDENTITY_MATRIX = IDENTITY_MATRIX; 1429exports.OPS = OPS; 1430exports.VERBOSITY_LEVELS = VERBOSITY_LEVELS; 1431exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; 1432exports.AnnotationBorderStyleType = AnnotationBorderStyleType; 1433exports.AnnotationFieldFlag = AnnotationFieldFlag; 1434exports.AnnotationFlag = AnnotationFlag; 1435exports.AnnotationType = AnnotationType; 1436exports.FontType = FontType; 1437exports.ImageKind = ImageKind; 1438exports.CMapCompressionType = CMapCompressionType; 1439exports.InvalidPDFException = InvalidPDFException; 1440exports.MessageHandler = MessageHandler; 1441exports.MissingDataException = MissingDataException; 1442exports.MissingPDFException = MissingPDFException; 1443exports.NotImplementedException = NotImplementedException; 1444exports.PageViewport = PageViewport; 1445exports.PasswordException = PasswordException; 1446exports.PasswordResponses = PasswordResponses; 1447exports.StatTimer = StatTimer; 1448exports.StreamType = StreamType; 1449exports.TextRenderingMode = TextRenderingMode; 1450exports.UnexpectedResponseException = UnexpectedResponseException; 1451exports.UnknownErrorException = UnknownErrorException; 1452exports.Util = Util; 1453exports.XRefParseException = XRefParseException; 1454exports.arrayByteLength = arrayByteLength; 1455exports.arraysToBytes = arraysToBytes; 1456exports.assert = assert; 1457exports.bytesToString = bytesToString; 1458exports.createBlob = createBlob; 1459exports.createPromiseCapability = createPromiseCapability; 1460exports.createObjectURL = createObjectURL; 1461exports.deprecated = deprecated; 1462exports.error = error; 1463exports.getLookupTableFactory = getLookupTableFactory; 1464exports.getVerbosityLevel = getVerbosityLevel; 1465exports.globalScope = globalScope; 1466exports.info = info; 1467exports.isArray = isArray; 1468exports.isArrayBuffer = isArrayBuffer; 1469exports.isBool = isBool; 1470exports.isEmptyObj = isEmptyObj; 1471exports.isInt = isInt; 1472exports.isNum = isNum; 1473exports.isString = isString; 1474exports.isSpace = isSpace; 1475exports.isNodeJS = isNodeJS; 1476exports.isSameOrigin = isSameOrigin; 1477exports.createValidAbsoluteUrl = createValidAbsoluteUrl; 1478exports.isLittleEndian = isLittleEndian; 1479exports.isEvalSupported = isEvalSupported; 1480exports.loadJpegStream = loadJpegStream; 1481exports.log2 = log2; 1482exports.readInt8 = readInt8; 1483exports.readUint16 = readUint16; 1484exports.readUint32 = readUint32; 1485exports.removeNullCharacters = removeNullCharacters; 1486exports.setVerbosityLevel = setVerbosityLevel; 1487exports.shadow = shadow; 1488exports.string32 = string32; 1489exports.stringToBytes = stringToBytes; 1490exports.stringToPDFString = stringToPDFString; 1491exports.stringToUTF8String = stringToUTF8String; 1492exports.utf8StringToString = utf8StringToString; 1493exports.warn = warn; 1494/* WEBPACK VAR INJECTION */}.call(exports, __w_pdfjs_require__(9))) 1495 1496/***/ }), 1497/* 1 */ 1498/***/ (function(module, exports, __w_pdfjs_require__) { 1499 1500"use strict"; 1501 1502var sharedUtil = __w_pdfjs_require__(0); 1503var isArray = sharedUtil.isArray; 1504var EOF = {}; 1505var Name = function NameClosure() { 1506 function Name(name) { 1507 this.name = name; 1508 } 1509 Name.prototype = {}; 1510 var nameCache = Object.create(null); 1511 Name.get = function Name_get(name) { 1512 var nameValue = nameCache[name]; 1513 return nameValue ? nameValue : nameCache[name] = new Name(name); 1514 }; 1515 return Name; 1516}(); 1517var Cmd = function CmdClosure() { 1518 function Cmd(cmd) { 1519 this.cmd = cmd; 1520 } 1521 Cmd.prototype = {}; 1522 var cmdCache = Object.create(null); 1523 Cmd.get = function Cmd_get(cmd) { 1524 var cmdValue = cmdCache[cmd]; 1525 return cmdValue ? cmdValue : cmdCache[cmd] = new Cmd(cmd); 1526 }; 1527 return Cmd; 1528}(); 1529var Dict = function DictClosure() { 1530 var nonSerializable = function nonSerializableClosure() { 1531 return nonSerializable; 1532 }; 1533 function Dict(xref) { 1534 this.map = Object.create(null); 1535 this.xref = xref; 1536 this.objId = null; 1537 this.suppressEncryption = false;
vendor: 20,460 bytes, lines 1538-2652
1538 this.__nonSerializable__ = nonSerializable; 1539 } 1540 Dict.prototype = { 1541 assignXref: function Dict_assignXref(newXref) { 1542 this.xref = newXref; 1543 }, 1544 get: function Dict_get(key1, key2, key3) { 1545 var value; 1546 var xref = this.xref, suppressEncryption = this.suppressEncryption; 1547 if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { 1548 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1549 } 1550 if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { 1551 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1552 } 1553 value = this.map[key3] || null; 1554 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 1555 }, 1556 getAsync: function Dict_getAsync(key1, key2, key3) { 1557 var value; 1558 var xref = this.xref, suppressEncryption = this.suppressEncryption; 1559 if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map || typeof key2 === 'undefined') { 1560 if (xref) { 1561 return xref.fetchIfRefAsync(value, suppressEncryption); 1562 } 1563 return Promise.resolve(value); 1564 } 1565 if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map || typeof key3 === 'undefined') { 1566 if (xref) { 1567 return xref.fetchIfRefAsync(value, suppressEncryption); 1568 } 1569 return Promise.resolve(value); 1570 } 1571 value = this.map[key3] || null; 1572 if (xref) { 1573 return xref.fetchIfRefAsync(value, suppressEncryption); 1574 } 1575 return Promise.resolve(value); 1576 }, 1577 getArray: function Dict_getArray(key1, key2, key3) { 1578 var value = this.get(key1, key2, key3); 1579 var xref = this.xref, suppressEncryption = this.suppressEncryption; 1580 if (!isArray(value) || !xref) { 1581 return value; 1582 } 1583 value = value.slice(); 1584 for (var i = 0, ii = value.length; i < ii; i++) { 1585 if (!isRef(value[i])) { 1586 continue; 1587 } 1588 value[i] = xref.fetch(value[i], suppressEncryption); 1589 } 1590 return value; 1591 }, 1592 getRaw: function Dict_getRaw(key) { 1593 return this.map[key]; 1594 }, 1595 getKeys: function Dict_getKeys() { 1596 return Object.keys(this.map); 1597 }, 1598 set: function Dict_set(key, value) { 1599 this.map[key] = value; 1600 }, 1601 has: function Dict_has(key) { 1602 return key in this.map; 1603 }, 1604 forEach: function Dict_forEach(callback) { 1605 for (var key in this.map) { 1606 callback(key, this.get(key)); 1607 } 1608 } 1609 }; 1610 Dict.empty = new Dict(null); 1611 Dict.merge = function Dict_merge(xref, dictArray) { 1612 var mergedDict = new Dict(xref); 1613 for (var i = 0, ii = dictArray.length; i < ii; i++) { 1614 var dict = dictArray[i]; 1615 if (!isDict(dict)) { 1616 continue; 1617 } 1618 for (var keyName in dict.map) { 1619 if (mergedDict.map[keyName]) { 1620 continue; 1621 } 1622 mergedDict.map[keyName] = dict.map[keyName]; 1623 } 1624 } 1625 return mergedDict; 1626 }; 1627 return Dict; 1628}(); 1629var Ref = function RefClosure() { 1630 function Ref(num, gen) { 1631 this.num = num; 1632 this.gen = gen; 1633 } 1634 Ref.prototype = { 1635 toString: function Ref_toString() { 1636 var str = this.num + 'R'; 1637 if (this.gen !== 0) { 1638 str += this.gen; 1639 } 1640 return str; 1641 } 1642 }; 1643 return Ref; 1644}(); 1645var RefSet = function RefSetClosure() { 1646 function RefSet() { 1647 this.dict = Object.create(null); 1648 } 1649 RefSet.prototype = { 1650 has: function RefSet_has(ref) { 1651 return ref.toString() in this.dict; 1652 }, 1653 put: function RefSet_put(ref) { 1654 this.dict[ref.toString()] = true; 1655 }, 1656 remove: function RefSet_remove(ref) { 1657 delete this.dict[ref.toString()]; 1658 } 1659 }; 1660 return RefSet; 1661}(); 1662var RefSetCache = function RefSetCacheClosure() { 1663 function RefSetCache() { 1664 this.dict = Object.create(null); 1665 } 1666 RefSetCache.prototype = { 1667 get: function RefSetCache_get(ref) { 1668 return this.dict[ref.toString()]; 1669 }, 1670 has: function RefSetCache_has(ref) { 1671 return ref.toString() in this.dict; 1672 }, 1673 put: function RefSetCache_put(ref, obj) { 1674 this.dict[ref.toString()] = obj; 1675 }, 1676 putAlias: function RefSetCache_putAlias(ref, aliasRef) { 1677 this.dict[ref.toString()] = this.get(aliasRef); 1678 }, 1679 forEach: function RefSetCache_forEach(fn, thisArg) { 1680 for (var i in this.dict) { 1681 fn.call(thisArg, this.dict[i]); 1682 } 1683 }, 1684 clear: function RefSetCache_clear() { 1685 this.dict = Object.create(null); 1686 } 1687 }; 1688 return RefSetCache; 1689}(); 1690function isEOF(v) { 1691 return v === EOF; 1692} 1693function isName(v, name) { 1694 return v instanceof Name && (name === undefined || v.name === name); 1695} 1696function isCmd(v, cmd) { 1697 return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); 1698} 1699function isDict(v, type) { 1700 return v instanceof Dict && (type === undefined || isName(v.get('Type'), type)); 1701} 1702function isRef(v) { 1703 return v instanceof Ref; 1704} 1705function isRefsEqual(v1, v2) { 1706 return v1.num === v2.num && v1.gen === v2.gen; 1707} 1708function isStream(v) { 1709 return typeof v === 'object' && v !== null && v.getBytes !== undefined; 1710} 1711exports.EOF = EOF; 1712exports.Cmd = Cmd; 1713exports.Dict = Dict; 1714exports.Name = Name; 1715exports.Ref = Ref; 1716exports.RefSet = RefSet; 1717exports.RefSetCache = RefSetCache; 1718exports.isEOF = isEOF; 1719exports.isCmd = isCmd; 1720exports.isDict = isDict; 1721exports.isName = isName; 1722exports.isRef = isRef; 1723exports.isRefsEqual = isRefsEqual; 1724exports.isStream = isStream; 1725 1726/***/ }), 1727/* 2 */ 1728/***/ (function(module, exports, __w_pdfjs_require__) { 1729 1730"use strict"; 1731 1732var sharedUtil = __w_pdfjs_require__(0); 1733var corePrimitives = __w_pdfjs_require__(1); 1734var coreJbig2 = __w_pdfjs_require__(28); 1735var coreJpg = __w_pdfjs_require__(29); 1736var coreJpx = __w_pdfjs_require__(15); 1737var Util = sharedUtil.Util; 1738var error = sharedUtil.error; 1739var info = sharedUtil.info; 1740var isInt = sharedUtil.isInt; 1741var isArray = sharedUtil.isArray; 1742var createObjectURL = sharedUtil.createObjectURL; 1743var shadow = sharedUtil.shadow; 1744var isSpace = sharedUtil.isSpace; 1745var Dict = corePrimitives.Dict; 1746var isDict = corePrimitives.isDict; 1747var isStream = corePrimitives.isStream; 1748var Jbig2Image = coreJbig2.Jbig2Image; 1749var JpegImage = coreJpg.JpegImage; 1750var JpxImage = coreJpx.JpxImage; 1751var Stream = function StreamClosure() { 1752 function Stream(arrayBuffer, start, length, dict) { 1753 this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer); 1754 this.start = start || 0; 1755 this.pos = this.start; 1756 this.end = start + length || this.bytes.length; 1757 this.dict = dict; 1758 } 1759 Stream.prototype = { 1760 get length() { 1761 return this.end - this.start; 1762 }, 1763 get isEmpty() { 1764 return this.length === 0; 1765 }, 1766 getByte: function Stream_getByte() { 1767 if (this.pos >= this.end) { 1768 return -1; 1769 } 1770 return this.bytes[this.pos++]; 1771 }, 1772 getUint16: function Stream_getUint16() { 1773 var b0 = this.getByte(); 1774 var b1 = this.getByte(); 1775 if (b0 === -1 || b1 === -1) { 1776 return -1; 1777 } 1778 return (b0 << 8) + b1; 1779 }, 1780 getInt32: function Stream_getInt32() { 1781 var b0 = this.getByte(); 1782 var b1 = this.getByte(); 1783 var b2 = this.getByte(); 1784 var b3 = this.getByte(); 1785 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 1786 }, 1787 getBytes: function Stream_getBytes(length) { 1788 var bytes = this.bytes; 1789 var pos = this.pos; 1790 var strEnd = this.end; 1791 if (!length) { 1792 return bytes.subarray(pos, strEnd); 1793 } 1794 var end = pos + length; 1795 if (end > strEnd) { 1796 end = strEnd; 1797 } 1798 this.pos = end; 1799 return bytes.subarray(pos, end); 1800 }, 1801 peekByte: function Stream_peekByte() { 1802 var peekedByte = this.getByte(); 1803 this.pos--; 1804 return peekedByte; 1805 }, 1806 peekBytes: function Stream_peekBytes(length) { 1807 var bytes = this.getBytes(length); 1808 this.pos -= bytes.length; 1809 return bytes; 1810 }, 1811 skip: function Stream_skip(n) { 1812 if (!n) { 1813 n = 1; 1814 } 1815 this.pos += n; 1816 }, 1817 reset: function Stream_reset() { 1818 this.pos = this.start; 1819 }, 1820 moveStart: function Stream_moveStart() { 1821 this.start = this.pos; 1822 }, 1823 makeSubStream: function Stream_makeSubStream(start, length, dict) { 1824 return new Stream(this.bytes.buffer, start, length, dict); 1825 } 1826 }; 1827 return Stream; 1828}(); 1829var StringStream = function StringStreamClosure() { 1830 function StringStream(str) { 1831 var length = str.length; 1832 var bytes = new Uint8Array(length); 1833 for (var n = 0; n < length; ++n) { 1834 bytes[n] = str.charCodeAt(n); 1835 } 1836 Stream.call(this, bytes); 1837 } 1838 StringStream.prototype = Stream.prototype; 1839 return StringStream; 1840}(); 1841var DecodeStream = function DecodeStreamClosure() { 1842 var emptyBuffer = new Uint8Array(0); 1843 function DecodeStream(maybeMinBufferLength) { 1844 this.pos = 0; 1845 this.bufferLength = 0; 1846 this.eof = false; 1847 this.buffer = emptyBuffer; 1848 this.minBufferLength = 512; 1849 if (maybeMinBufferLength) { 1850 while (this.minBufferLength < maybeMinBufferLength) { 1851 this.minBufferLength *= 2; 1852 } 1853 } 1854 } 1855 DecodeStream.prototype = { 1856 get isEmpty() { 1857 while (!this.eof && this.bufferLength === 0) { 1858 this.readBlock(); 1859 } 1860 return this.bufferLength === 0; 1861 }, 1862 ensureBuffer: function DecodeStream_ensureBuffer(requested) { 1863 var buffer = this.buffer; 1864 if (requested <= buffer.byteLength) { 1865 return buffer; 1866 } 1867 var size = this.minBufferLength; 1868 while (size < requested) { 1869 size *= 2; 1870 } 1871 var buffer2 = new Uint8Array(size); 1872 buffer2.set(buffer); 1873 return this.buffer = buffer2; 1874 }, 1875 getByte: function DecodeStream_getByte() { 1876 var pos = this.pos; 1877 while (this.bufferLength <= pos) { 1878 if (this.eof) { 1879 return -1; 1880 } 1881 this.readBlock(); 1882 } 1883 return this.buffer[this.pos++]; 1884 }, 1885 getUint16: function DecodeStream_getUint16() { 1886 var b0 = this.getByte(); 1887 var b1 = this.getByte(); 1888 if (b0 === -1 || b1 === -1) { 1889 return -1; 1890 } 1891 return (b0 << 8) + b1; 1892 }, 1893 getInt32: function DecodeStream_getInt32() { 1894 var b0 = this.getByte(); 1895 var b1 = this.getByte(); 1896 var b2 = this.getByte(); 1897 var b3 = this.getByte(); 1898 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 1899 }, 1900 getBytes: function DecodeStream_getBytes(length) { 1901 var end, pos = this.pos; 1902 if (length) { 1903 this.ensureBuffer(pos + length); 1904 end = pos + length; 1905 while (!this.eof && this.bufferLength < end) { 1906 this.readBlock(); 1907 } 1908 var bufEnd = this.bufferLength; 1909 if (end > bufEnd) { 1910 end = bufEnd; 1911 } 1912 } else { 1913 while (!this.eof) { 1914 this.readBlock(); 1915 } 1916 end = this.bufferLength; 1917 } 1918 this.pos = end; 1919 return this.buffer.subarray(pos, end); 1920 }, 1921 peekByte: function DecodeStream_peekByte() { 1922 var peekedByte = this.getByte(); 1923 this.pos--; 1924 return peekedByte; 1925 }, 1926 peekBytes: function DecodeStream_peekBytes(length) { 1927 var bytes = this.getBytes(length); 1928 this.pos -= bytes.length; 1929 return bytes; 1930 }, 1931 makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { 1932 var end = start + length; 1933 while (this.bufferLength <= end && !this.eof) { 1934 this.readBlock(); 1935 } 1936 return new Stream(this.buffer, start, length, dict); 1937 }, 1938 skip: function DecodeStream_skip(n) { 1939 if (!n) { 1940 n = 1; 1941 } 1942 this.pos += n; 1943 }, 1944 reset: function DecodeStream_reset() { 1945 this.pos = 0; 1946 }, 1947 getBaseStreams: function DecodeStream_getBaseStreams() { 1948 if (this.str && this.str.getBaseStreams) { 1949 return this.str.getBaseStreams(); 1950 } 1951 return []; 1952 } 1953 }; 1954 return DecodeStream; 1955}(); 1956var StreamsSequenceStream = function StreamsSequenceStreamClosure() { 1957 function StreamsSequenceStream(streams) { 1958 this.streams = streams; 1959 DecodeStream.call(this, null); 1960 } 1961 StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); 1962 StreamsSequenceStream.prototype.readBlock = function streamSequenceStreamReadBlock() { 1963 var streams = this.streams; 1964 if (streams.length === 0) { 1965 this.eof = true; 1966 return; 1967 } 1968 var stream = streams.shift(); 1969 var chunk = stream.getBytes(); 1970 var bufferLength = this.bufferLength; 1971 var newLength = bufferLength + chunk.length; 1972 var buffer = this.ensureBuffer(newLength); 1973 buffer.set(chunk, bufferLength); 1974 this.bufferLength = newLength; 1975 }; 1976 StreamsSequenceStream.prototype.getBaseStreams = function StreamsSequenceStream_getBaseStreams() { 1977 var baseStreams = []; 1978 for (var i = 0, ii = this.streams.length; i < ii; i++) { 1979 var stream = this.streams[i]; 1980 if (stream.getBaseStreams) { 1981 Util.appendToArray(baseStreams, stream.getBaseStreams()); 1982 } 1983 } 1984 return baseStreams; 1985 }; 1986 return StreamsSequenceStream; 1987}(); 1988var FlateStream = function FlateStreamClosure() { 1989 var codeLenCodeMap = new Int32Array([ 1990 16, 1991 17, 1992 18, 1993 0, 1994 8, 1995 7, 1996 9, 1997 6, 1998 10, 1999 5, 2000 11, 2001 4, 2002 12, 2003 3, 2004 13, 2005 2, 2006 14, 2007 1, 2008 15 2009 ]); 2010 var lengthDecode = new Int32Array([ 2011 0x00003, 2012 0x00004, 2013 0x00005, 2014 0x00006, 2015 0x00007, 2016 0x00008, 2017 0x00009, 2018 0x0000a, 2019 0x1000b, 2020 0x1000d, 2021 0x1000f, 2022 0x10011, 2023 0x20013, 2024 0x20017, 2025 0x2001b, 2026 0x2001f, 2027 0x30023, 2028 0x3002b, 2029 0x30033, 2030 0x3003b, 2031 0x40043, 2032 0x40053, 2033 0x40063, 2034 0x40073, 2035 0x50083, 2036 0x500a3, 2037 0x500c3, 2038 0x500e3, 2039 0x00102, 2040 0x00102, 2041 0x00102 2042 ]); 2043 var distDecode = new Int32Array([ 2044 0x00001, 2045 0x00002, 2046 0x00003, 2047 0x00004, 2048 0x10005, 2049 0x10007, 2050 0x20009, 2051 0x2000d, 2052 0x30011, 2053 0x30019, 2054 0x40021, 2055 0x40031, 2056 0x50041, 2057 0x50061, 2058 0x60081, 2059 0x600c1, 2060 0x70101, 2061 0x70181, 2062 0x80201, 2063 0x80301, 2064 0x90401, 2065 0x90601, 2066 0xa0801, 2067 0xa0c01, 2068 0xb1001, 2069 0xb1801, 2070 0xc2001, 2071 0xc3001, 2072 0xd4001, 2073 0xd6001 2074 ]); 2075 var fixedLitCodeTab = [ 2076 new Int32Array([ 2077 0x70100, 2078 0x80050, 2079 0x80010, 2080 0x80118, 2081 0x70110, 2082 0x80070, 2083 0x80030, 2084 0x900c0, 2085 0x70108, 2086 0x80060, 2087 0x80020, 2088 0x900a0, 2089 0x80000, 2090 0x80080, 2091 0x80040, 2092 0x900e0, 2093 0x70104, 2094 0x80058, 2095 0x80018, 2096 0x90090, 2097 0x70114, 2098 0x80078, 2099 0x80038, 2100 0x900d0, 2101 0x7010c, 2102 0x80068, 2103 0x80028, 2104 0x900b0, 2105 0x80008, 2106 0x80088, 2107 0x80048, 2108 0x900f0, 2109 0x70102, 2110 0x80054, 2111 0x80014, 2112 0x8011c, 2113 0x70112, 2114 0x80074, 2115 0x80034, 2116 0x900c8, 2117 0x7010a, 2118 0x80064, 2119 0x80024, 2120 0x900a8, 2121 0x80004, 2122 0x80084, 2123 0x80044, 2124 0x900e8, 2125 0x70106, 2126 0x8005c, 2127 0x8001c, 2128 0x90098, 2129 0x70116, 2130 0x8007c, 2131 0x8003c, 2132 0x900d8, 2133 0x7010e, 2134 0x8006c, 2135 0x8002c, 2136 0x900b8, 2137 0x8000c, 2138 0x8008c, 2139 0x8004c, 2140 0x900f8, 2141 0x70101, 2142 0x80052, 2143 0x80012, 2144 0x8011a, 2145 0x70111, 2146 0x80072, 2147 0x80032, 2148 0x900c4, 2149 0x70109, 2150 0x80062, 2151 0x80022, 2152 0x900a4, 2153 0x80002, 2154 0x80082, 2155 0x80042, 2156 0x900e4, 2157 0x70105, 2158 0x8005a, 2159 0x8001a, 2160 0x90094, 2161 0x70115, 2162 0x8007a, 2163 0x8003a, 2164 0x900d4, 2165 0x7010d, 2166 0x8006a, 2167 0x8002a, 2168 0x900b4, 2169 0x8000a, 2170 0x8008a, 2171 0x8004a, 2172 0x900f4, 2173 0x70103, 2174 0x80056, 2175 0x80016, 2176 0x8011e, 2177 0x70113, 2178 0x80076, 2179 0x80036, 2180 0x900cc, 2181 0x7010b, 2182 0x80066, 2183 0x80026, 2184 0x900ac, 2185 0x80006, 2186 0x80086, 2187 0x80046, 2188 0x900ec, 2189 0x70107, 2190 0x8005e, 2191 0x8001e, 2192 0x9009c, 2193 0x70117, 2194 0x8007e, 2195 0x8003e, 2196 0x900dc, 2197 0x7010f, 2198 0x8006e, 2199 0x8002e, 2200 0x900bc, 2201 0x8000e, 2202 0x8008e, 2203 0x8004e, 2204 0x900fc, 2205 0x70100, 2206 0x80051, 2207 0x80011, 2208 0x80119, 2209 0x70110, 2210 0x80071, 2211 0x80031, 2212 0x900c2, 2213 0x70108, 2214 0x80061, 2215 0x80021, 2216 0x900a2, 2217 0x80001, 2218 0x80081, 2219 0x80041, 2220 0x900e2, 2221 0x70104, 2222 0x80059, 2223 0x80019, 2224 0x90092, 2225 0x70114, 2226 0x80079, 2227 0x80039, 2228 0x900d2, 2229 0x7010c, 2230 0x80069, 2231 0x80029, 2232 0x900b2, 2233 0x80009, 2234 0x80089, 2235 0x80049, 2236 0x900f2, 2237 0x70102, 2238 0x80055, 2239 0x80015, 2240 0x8011d, 2241 0x70112, 2242 0x80075, 2243 0x80035, 2244 0x900ca, 2245 0x7010a, 2246 0x80065, 2247 0x80025, 2248 0x900aa, 2249 0x80005, 2250 0x80085, 2251 0x80045, 2252 0x900ea, 2253 0x70106, 2254 0x8005d, 2255 0x8001d, 2256 0x9009a, 2257 0x70116, 2258 0x8007d, 2259 0x8003d, 2260 0x900da, 2261 0x7010e, 2262 0x8006d, 2263 0x8002d, 2264 0x900ba, 2265 0x8000d, 2266 0x8008d, 2267 0x8004d, 2268 0x900fa, 2269 0x70101, 2270 0x80053, 2271 0x80013, 2272 0x8011b, 2273 0x70111, 2274 0x80073, 2275 0x80033, 2276 0x900c6, 2277 0x70109, 2278 0x80063, 2279 0x80023, 2280 0x900a6, 2281 0x80003, 2282 0x80083, 2283 0x80043, 2284 0x900e6, 2285 0x70105, 2286 0x8005b, 2287 0x8001b, 2288 0x90096, 2289 0x70115, 2290 0x8007b, 2291 0x8003b, 2292 0x900d6, 2293 0x7010d, 2294 0x8006b, 2295 0x8002b, 2296 0x900b6, 2297 0x8000b, 2298 0x8008b, 2299 0x8004b, 2300 0x900f6, 2301 0x70103, 2302 0x80057, 2303 0x80017, 2304 0x8011f, 2305 0x70113, 2306 0x80077, 2307 0x80037, 2308 0x900ce, 2309 0x7010b, 2310 0x80067, 2311 0x80027, 2312 0x900ae, 2313 0x80007, 2314 0x80087, 2315 0x80047, 2316 0x900ee, 2317 0x70107, 2318 0x8005f, 2319 0x8001f, 2320 0x9009e, 2321 0x70117, 2322 0x8007f, 2323 0x8003f, 2324 0x900de, 2325 0x7010f, 2326 0x8006f, 2327 0x8002f, 2328 0x900be, 2329 0x8000f, 2330 0x8008f, 2331 0x8004f, 2332 0x900fe, 2333 0x70100, 2334 0x80050, 2335 0x80010, 2336 0x80118, 2337 0x70110, 2338 0x80070, 2339 0x80030, 2340 0x900c1, 2341 0x70108, 2342 0x80060, 2343 0x80020, 2344 0x900a1, 2345 0x80000, 2346 0x80080, 2347 0x80040, 2348 0x900e1, 2349 0x70104, 2350 0x80058, 2351 0x80018, 2352 0x90091, 2353 0x70114, 2354 0x80078, 2355 0x80038, 2356 0x900d1, 2357 0x7010c, 2358 0x80068, 2359 0x80028, 2360 0x900b1, 2361 0x80008, 2362 0x80088, 2363 0x80048, 2364 0x900f1, 2365 0x70102, 2366 0x80054, 2367 0x80014, 2368 0x8011c, 2369 0x70112, 2370 0x80074, 2371 0x80034, 2372 0x900c9, 2373 0x7010a, 2374 0x80064, 2375 0x80024, 2376 0x900a9, 2377 0x80004, 2378 0x80084, 2379 0x80044, 2380 0x900e9, 2381 0x70106, 2382 0x8005c, 2383 0x8001c, 2384 0x90099, 2385 0x70116, 2386 0x8007c, 2387 0x8003c, 2388 0x900d9, 2389 0x7010e, 2390 0x8006c, 2391 0x8002c, 2392 0x900b9, 2393 0x8000c, 2394 0x8008c, 2395 0x8004c, 2396 0x900f9, 2397 0x70101, 2398 0x80052, 2399 0x80012, 2400 0x8011a, 2401 0x70111, 2402 0x80072, 2403 0x80032, 2404 0x900c5, 2405 0x70109, 2406 0x80062, 2407 0x80022, 2408 0x900a5, 2409 0x80002, 2410 0x80082, 2411 0x80042, 2412 0x900e5, 2413 0x70105, 2414 0x8005a, 2415 0x8001a, 2416 0x90095, 2417 0x70115, 2418 0x8007a, 2419 0x8003a, 2420 0x900d5, 2421 0x7010d, 2422 0x8006a, 2423 0x8002a, 2424 0x900b5, 2425 0x8000a, 2426 0x8008a, 2427 0x8004a, 2428 0x900f5, 2429 0x70103, 2430 0x80056, 2431 0x80016, 2432 0x8011e, 2433 0x70113, 2434 0x80076, 2435 0x80036, 2436 0x900cd, 2437 0x7010b, 2438 0x80066, 2439 0x80026, 2440 0x900ad, 2441 0x80006, 2442 0x80086, 2443 0x80046, 2444 0x900ed, 2445 0x70107, 2446 0x8005e, 2447 0x8001e, 2448 0x9009d, 2449 0x70117, 2450 0x8007e, 2451 0x8003e, 2452 0x900dd, 2453 0x7010f, 2454 0x8006e, 2455 0x8002e, 2456 0x900bd, 2457 0x8000e, 2458 0x8008e, 2459 0x8004e, 2460 0x900fd, 2461 0x70100, 2462 0x80051, 2463 0x80011, 2464 0x80119, 2465 0x70110, 2466 0x80071, 2467 0x80031, 2468 0x900c3, 2469 0x70108, 2470 0x80061, 2471 0x80021, 2472 0x900a3, 2473 0x80001, 2474 0x80081, 2475 0x80041, 2476 0x900e3, 2477 0x70104, 2478 0x80059, 2479 0x80019, 2480 0x90093, 2481 0x70114, 2482 0x80079, 2483 0x80039, 2484 0x900d3, 2485 0x7010c, 2486 0x80069, 2487 0x80029, 2488 0x900b3, 2489 0x80009, 2490 0x80089, 2491 0x80049, 2492 0x900f3, 2493 0x70102, 2494 0x80055, 2495 0x80015, 2496 0x8011d, 2497 0x70112, 2498 0x80075, 2499 0x80035, 2500 0x900cb, 2501 0x7010a, 2502 0x80065, 2503 0x80025, 2504 0x900ab, 2505 0x80005, 2506 0x80085, 2507 0x80045, 2508 0x900eb, 2509 0x70106, 2510 0x8005d, 2511 0x8001d, 2512 0x9009b, 2513 0x70116, 2514 0x8007d, 2515 0x8003d, 2516 0x900db, 2517 0x7010e, 2518 0x8006d, 2519 0x8002d, 2520 0x900bb, 2521 0x8000d, 2522 0x8008d, 2523 0x8004d, 2524 0x900fb, 2525 0x70101, 2526 0x80053, 2527 0x80013, 2528 0x8011b, 2529 0x70111, 2530 0x80073, 2531 0x80033, 2532 0x900c7, 2533 0x70109, 2534 0x80063, 2535 0x80023, 2536 0x900a7, 2537 0x80003, 2538 0x80083, 2539 0x80043, 2540 0x900e7, 2541 0x70105, 2542 0x8005b, 2543 0x8001b, 2544 0x90097, 2545 0x70115, 2546 0x8007b, 2547 0x8003b, 2548 0x900d7, 2549 0x7010d, 2550 0x8006b, 2551 0x8002b, 2552 0x900b7, 2553 0x8000b, 2554 0x8008b, 2555 0x8004b, 2556 0x900f7, 2557 0x70103, 2558 0x80057, 2559 0x80017, 2560 0x8011f, 2561 0x70113, 2562 0x80077, 2563 0x80037, 2564 0x900cf, 2565 0x7010b, 2566 0x80067, 2567 0x80027, 2568 0x900af, 2569 0x80007, 2570 0x80087, 2571 0x80047, 2572 0x900ef, 2573 0x70107, 2574 0x8005f, 2575 0x8001f, 2576 0x9009f, 2577 0x70117, 2578 0x8007f, 2579 0x8003f, 2580 0x900df, 2581 0x7010f, 2582 0x8006f, 2583 0x8002f, 2584 0x900bf, 2585 0x8000f, 2586 0x8008f, 2587 0x8004f, 2588 0x900ff 2589 ]), 2590 9 2591 ]; 2592 var fixedDistCodeTab = [ 2593 new Int32Array([ 2594 0x50000, 2595 0x50010, 2596 0x50008, 2597 0x50018, 2598 0x50004, 2599 0x50014, 2600 0x5000c, 2601 0x5001c, 2602 0x50002, 2603 0x50012, 2604 0x5000a, 2605 0x5001a, 2606 0x50006, 2607 0x50016, 2608 0x5000e, 2609 0x00000, 2610 0x50001, 2611 0x50011, 2612 0x50009, 2613 0x50019, 2614 0x50005, 2615 0x50015, 2616 0x5000d, 2617 0x5001d, 2618 0x50003, 2619 0x50013, 2620 0x5000b, 2621 0x5001b, 2622 0x50007, 2623 0x50017, 2624 0x5000f, 2625 0x00000 2626 ]), 2627 5 2628 ]; 2629 function FlateStream(str, maybeLength) { 2630 this.str = str; 2631 this.dict = str.dict; 2632 var cmf = str.getByte(); 2633 var flg = str.getByte(); 2634 if (cmf === -1 || flg === -1) { 2635 error('Invalid header in flate stream: ' + cmf + ', ' + flg); 2636 } 2637 if ((cmf & 0x0f) !== 0x08) { 2638 error('Unknown compression method in flate stream: ' + cmf + ', ' + flg); 2639 } 2640 if (((cmf << 8) + flg) % 31 !== 0) { 2641 error('Bad FCHECK in flate stream: ' + cmf + ', ' + flg); 2642 } 2643 if (flg & 0x20) { 2644 error('FDICT bit set in flate stream: ' + cmf + ', ' + flg); 2645 } 2646 this.codeSize = 0; 2647 this.codeBuf = 0; 2648 DecodeStream.call(this, maybeLength); 2649 } 2650 FlateStream.prototype = Object.create(DecodeStream.prototype); 2651 FlateStream.prototype.getBits = function FlateStream_getBits(bits) { 2652 var str = this.str;
vendor: 4,891 bytes, lines 2653-2838
2653 var codeSize = this.codeSize; 2654 var codeBuf = this.codeBuf; 2655 var b; 2656 while (codeSize < bits) { 2657 if ((b = str.getByte()) === -1) { 2658 error('Bad encoding in flate stream'); 2659 } 2660 codeBuf |= b << codeSize; 2661 codeSize += 8; 2662 } 2663 b = codeBuf & (1 << bits) - 1; 2664 this.codeBuf = codeBuf >> bits; 2665 this.codeSize = codeSize -= bits; 2666 return b; 2667 }; 2668 FlateStream.prototype.getCode = function FlateStream_getCode(table) { 2669 var str = this.str; 2670 var codes = table[0]; 2671 var maxLen = table[1]; 2672 var codeSize = this.codeSize; 2673 var codeBuf = this.codeBuf; 2674 var b; 2675 while (codeSize < maxLen) { 2676 if ((b = str.getByte()) === -1) { 2677 break; 2678 } 2679 codeBuf |= b << codeSize; 2680 codeSize += 8; 2681 } 2682 var code = codes[codeBuf & (1 << maxLen) - 1]; 2683 var codeLen = code >> 16; 2684 var codeVal = code & 0xffff; 2685 if (codeLen < 1 || codeSize < codeLen) { 2686 error('Bad encoding in flate stream'); 2687 } 2688 this.codeBuf = codeBuf >> codeLen; 2689 this.codeSize = codeSize - codeLen; 2690 return codeVal; 2691 }; 2692 FlateStream.prototype.generateHuffmanTable = function flateStreamGenerateHuffmanTable(lengths) { 2693 var n = lengths.length; 2694 var maxLen = 0; 2695 var i; 2696 for (i = 0; i < n; ++i) { 2697 if (lengths[i] > maxLen) { 2698 maxLen = lengths[i]; 2699 } 2700 } 2701 var size = 1 << maxLen; 2702 var codes = new Int32Array(size); 2703 for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) { 2704 for (var val = 0; val < n; ++val) { 2705 if (lengths[val] === len) { 2706 var code2 = 0; 2707 var t = code; 2708 for (i = 0; i < len; ++i) { 2709 code2 = code2 << 1 | t & 1; 2710 t >>= 1; 2711 } 2712 for (i = code2; i < size; i += skip) { 2713 codes[i] = len << 16 | val; 2714 } 2715 ++code; 2716 } 2717 } 2718 } 2719 return [ 2720 codes, 2721 maxLen 2722 ]; 2723 }; 2724 FlateStream.prototype.readBlock = function FlateStream_readBlock() { 2725 var buffer, len; 2726 var str = this.str; 2727 var hdr = this.getBits(3); 2728 if (hdr & 1) { 2729 this.eof = true; 2730 } 2731 hdr >>= 1; 2732 if (hdr === 0) { 2733 var b; 2734 if ((b = str.getByte()) === -1) { 2735 error('Bad block header in flate stream'); 2736 } 2737 var blockLen = b; 2738 if ((b = str.getByte()) === -1) { 2739 error('Bad block header in flate stream'); 2740 } 2741 blockLen |= b << 8; 2742 if ((b = str.getByte()) === -1) { 2743 error('Bad block header in flate stream'); 2744 } 2745 var check = b; 2746 if ((b = str.getByte()) === -1) { 2747 error('Bad block header in flate stream'); 2748 } 2749 check |= b << 8; 2750 if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { 2751 error('Bad uncompressed block length in flate stream'); 2752 } 2753 this.codeBuf = 0; 2754 this.codeSize = 0; 2755 var bufferLength = this.bufferLength; 2756 buffer = this.ensureBuffer(bufferLength + blockLen); 2757 var end = bufferLength + blockLen; 2758 this.bufferLength = end; 2759 if (blockLen === 0) { 2760 if (str.peekByte() === -1) { 2761 this.eof = true; 2762 } 2763 } else { 2764 for (var n = bufferLength; n < end; ++n) { 2765 if ((b = str.getByte()) === -1) { 2766 this.eof = true; 2767 break; 2768 } 2769 buffer[n] = b; 2770 } 2771 } 2772 return; 2773 } 2774 var litCodeTable; 2775 var distCodeTable; 2776 if (hdr === 1) { 2777 litCodeTable = fixedLitCodeTab; 2778 distCodeTable = fixedDistCodeTab; 2779 } else if (hdr === 2) { 2780 var numLitCodes = this.getBits(5) + 257; 2781 var numDistCodes = this.getBits(5) + 1; 2782 var numCodeLenCodes = this.getBits(4) + 4; 2783 var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); 2784 var i; 2785 for (i = 0; i < numCodeLenCodes; ++i) { 2786 codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); 2787 } 2788 var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); 2789 len = 0; 2790 i = 0; 2791 var codes = numLitCodes + numDistCodes; 2792 var codeLengths = new Uint8Array(codes); 2793 var bitsLength, bitsOffset, what; 2794 while (i < codes) { 2795 var code = this.getCode(codeLenCodeTab); 2796 if (code === 16) { 2797 bitsLength = 2; 2798 bitsOffset = 3; 2799 what = len; 2800 } else if (code === 17) { 2801 bitsLength = 3; 2802 bitsOffset = 3; 2803 what = len = 0; 2804 } else if (code === 18) { 2805 bitsLength = 7; 2806 bitsOffset = 11; 2807 what = len = 0; 2808 } else { 2809 codeLengths[i++] = len = code; 2810 continue; 2811 } 2812 var repeatLength = this.getBits(bitsLength) + bitsOffset; 2813 while (repeatLength-- > 0) { 2814 codeLengths[i++] = what; 2815 } 2816 } 2817 litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); 2818 distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); 2819 } else { 2820 error('Unknown block type in flate stream'); 2821 } 2822 buffer = this.buffer; 2823 var limit = buffer ? buffer.length : 0; 2824 var pos = this.bufferLength; 2825 while (true) { 2826 var code1 = this.getCode(litCodeTable); 2827 if (code1 < 256) { 2828 if (pos + 1 >= limit) { 2829 buffer = this.ensureBuffer(pos + 1); 2830 limit = buffer.length; 2831 } 2832 buffer[pos++] = code1; 2833 continue; 2834 } 2835 if (code1 === 256) { 2836 this.bufferLength = pos; 2837 return; 2838 }
vendor: 16,306 bytes, lines 2839-3470
2839 code1 -= 257; 2840 code1 = lengthDecode[code1]; 2841 var code2 = code1 >> 16; 2842 if (code2 > 0) { 2843 code2 = this.getBits(code2); 2844 } 2845 len = (code1 & 0xffff) + code2; 2846 code1 = this.getCode(distCodeTable); 2847 code1 = distDecode[code1]; 2848 code2 = code1 >> 16; 2849 if (code2 > 0) { 2850 code2 = this.getBits(code2); 2851 } 2852 var dist = (code1 & 0xffff) + code2; 2853 if (pos + len >= limit) { 2854 buffer = this.ensureBuffer(pos + len); 2855 limit = buffer.length; 2856 } 2857 for (var k = 0; k < len; ++k, ++pos) { 2858 buffer[pos] = buffer[pos - dist]; 2859 } 2860 } 2861 }; 2862 return FlateStream; 2863}(); 2864var PredictorStream = function PredictorStreamClosure() { 2865 function PredictorStream(str, maybeLength, params) { 2866 if (!isDict(params)) { 2867 return str; 2868 } 2869 var predictor = this.predictor = params.get('Predictor') || 1; 2870 if (predictor <= 1) { 2871 return str; 2872 } 2873 if (predictor !== 2 && (predictor < 10 || predictor > 15)) { 2874 error('Unsupported predictor: ' + predictor); 2875 } 2876 if (predictor === 2) { 2877 this.readBlock = this.readBlockTiff; 2878 } else { 2879 this.readBlock = this.readBlockPng; 2880 } 2881 this.str = str; 2882 this.dict = str.dict; 2883 var colors = this.colors = params.get('Colors') || 1; 2884 var bits = this.bits = params.get('BitsPerComponent') || 8; 2885 var columns = this.columns = params.get('Columns') || 1; 2886 this.pixBytes = colors * bits + 7 >> 3; 2887 this.rowBytes = columns * colors * bits + 7 >> 3; 2888 DecodeStream.call(this, maybeLength); 2889 return this; 2890 } 2891 PredictorStream.prototype = Object.create(DecodeStream.prototype); 2892 PredictorStream.prototype.readBlockTiff = function predictorStreamReadBlockTiff() { 2893 var rowBytes = this.rowBytes; 2894 var bufferLength = this.bufferLength; 2895 var buffer = this.ensureBuffer(bufferLength + rowBytes); 2896 var bits = this.bits; 2897 var colors = this.colors; 2898 var rawBytes = this.str.getBytes(rowBytes); 2899 this.eof = !rawBytes.length; 2900 if (this.eof) { 2901 return; 2902 } 2903 var inbuf = 0, outbuf = 0; 2904 var inbits = 0, outbits = 0; 2905 var pos = bufferLength; 2906 var i; 2907 if (bits === 1 && colors === 1) { 2908 for (i = 0; i < rowBytes; ++i) { 2909 var c = rawBytes[i] ^ inbuf; 2910 c ^= c >> 1; 2911 c ^= c >> 2; 2912 c ^= c >> 4; 2913 inbuf = (c & 1) << 7; 2914 buffer[pos++] = c; 2915 } 2916 } else if (bits === 8) { 2917 for (i = 0; i < colors; ++i) { 2918 buffer[pos++] = rawBytes[i]; 2919 } 2920 for (; i < rowBytes; ++i) { 2921 buffer[pos] = buffer[pos - colors] + rawBytes[i]; 2922 pos++; 2923 } 2924 } else { 2925 var compArray = new Uint8Array(colors + 1); 2926 var bitMask = (1 << bits) - 1; 2927 var j = 0, k = bufferLength; 2928 var columns = this.columns; 2929 for (i = 0; i < columns; ++i) { 2930 for (var kk = 0; kk < colors; ++kk) { 2931 if (inbits < bits) { 2932 inbuf = inbuf << 8 | rawBytes[j++] & 0xFF; 2933 inbits += 8; 2934 } 2935 compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask; 2936 inbits -= bits; 2937 outbuf = outbuf << bits | compArray[kk]; 2938 outbits += bits; 2939 if (outbits >= 8) { 2940 buffer[k++] = outbuf >> outbits - 8 & 0xFF; 2941 outbits -= 8; 2942 } 2943 } 2944 } 2945 if (outbits > 0) { 2946 buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1); 2947 } 2948 } 2949 this.bufferLength += rowBytes; 2950 }; 2951 PredictorStream.prototype.readBlockPng = function predictorStreamReadBlockPng() { 2952 var rowBytes = this.rowBytes; 2953 var pixBytes = this.pixBytes; 2954 var predictor = this.str.getByte(); 2955 var rawBytes = this.str.getBytes(rowBytes); 2956 this.eof = !rawBytes.length; 2957 if (this.eof) { 2958 return; 2959 } 2960 var bufferLength = this.bufferLength; 2961 var buffer = this.ensureBuffer(bufferLength + rowBytes); 2962 var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); 2963 if (prevRow.length === 0) { 2964 prevRow = new Uint8Array(rowBytes); 2965 } 2966 var i, j = bufferLength, up, c; 2967 switch (predictor) { 2968 case 0: 2969 for (i = 0; i < rowBytes; ++i) { 2970 buffer[j++] = rawBytes[i]; 2971 } 2972 break; 2973 case 1: 2974 for (i = 0; i < pixBytes; ++i) { 2975 buffer[j++] = rawBytes[i]; 2976 } 2977 for (; i < rowBytes; ++i) { 2978 buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xFF; 2979 j++; 2980 } 2981 break; 2982 case 2: 2983 for (i = 0; i < rowBytes; ++i) { 2984 buffer[j++] = prevRow[i] + rawBytes[i] & 0xFF; 2985 } 2986 break; 2987 case 3: 2988 for (i = 0; i < pixBytes; ++i) { 2989 buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; 2990 } 2991 for (; i < rowBytes; ++i) { 2992 buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xFF; 2993 j++; 2994 } 2995 break; 2996 case 4: 2997 for (i = 0; i < pixBytes; ++i) { 2998 up = prevRow[i]; 2999 c = rawBytes[i]; 3000 buffer[j++] = up + c; 3001 } 3002 for (; i < rowBytes; ++i) { 3003 up = prevRow[i]; 3004 var upLeft = prevRow[i - pixBytes]; 3005 var left = buffer[j - pixBytes]; 3006 var p = left + up - upLeft; 3007 var pa = p - left; 3008 if (pa < 0) { 3009 pa = -pa; 3010 } 3011 var pb = p - up; 3012 if (pb < 0) { 3013 pb = -pb; 3014 } 3015 var pc = p - upLeft; 3016 if (pc < 0) { 3017 pc = -pc; 3018 } 3019 c = rawBytes[i]; 3020 if (pa <= pb && pa <= pc) { 3021 buffer[j++] = left + c; 3022 } else if (pb <= pc) { 3023 buffer[j++] = up + c; 3024 } else { 3025 buffer[j++] = upLeft + c; 3026 } 3027 } 3028 break; 3029 default: 3030 error('Unsupported predictor: ' + predictor); 3031 } 3032 this.bufferLength += rowBytes; 3033 }; 3034 return PredictorStream; 3035}(); 3036var JpegStream = function JpegStreamClosure() { 3037 function JpegStream(stream, maybeLength, dict, params) { 3038 var ch; 3039 while ((ch = stream.getByte()) !== -1) { 3040 if (ch === 0xFF) { 3041 stream.skip(-1); 3042 break; 3043 } 3044 } 3045 this.stream = stream; 3046 this.maybeLength = maybeLength; 3047 this.dict = dict; 3048 this.params = params; 3049 DecodeStream.call(this, maybeLength); 3050 } 3051 JpegStream.prototype = Object.create(DecodeStream.prototype); 3052 Object.defineProperty(JpegStream.prototype, 'bytes', { 3053 get: function JpegStream_bytes() { 3054 return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); 3055 }, 3056 configurable: true 3057 }); 3058 JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) { 3059 if (this.bufferLength) { 3060 return; 3061 } 3062 var jpegImage = new JpegImage(); 3063 var decodeArr = this.dict.getArray('Decode', 'D'); 3064 if (this.forceRGB && isArray(decodeArr)) { 3065 var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; 3066 var decodeArrLength = decodeArr.length; 3067 var transform = new Int32Array(decodeArrLength); 3068 var transformNeeded = false; 3069 var maxValue = (1 << bitsPerComponent) - 1; 3070 for (var i = 0; i < decodeArrLength; i += 2) { 3071 transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0; 3072 transform[i + 1] = decodeArr[i] * maxValue | 0; 3073 if (transform[i] !== 256 || transform[i + 1] !== 0) { 3074 transformNeeded = true; 3075 } 3076 } 3077 if (transformNeeded) { 3078 jpegImage.decodeTransform = transform; 3079 } 3080 } 3081 if (isDict(this.params)) { 3082 var colorTransform = this.params.get('ColorTransform'); 3083 if (isInt(colorTransform)) { 3084 jpegImage.colorTransform = colorTransform; 3085 } 3086 } 3087 jpegImage.parse(this.bytes); 3088 var data = jpegImage.getData(this.drawWidth, this.drawHeight, this.forceRGB); 3089 this.buffer = data; 3090 this.bufferLength = data.length; 3091 this.eof = true; 3092 }; 3093 JpegStream.prototype.getBytes = function JpegStream_getBytes(length) { 3094 this.ensureBuffer(); 3095 return this.buffer; 3096 }; 3097 JpegStream.prototype.getIR = function JpegStream_getIR(forceDataSchema) { 3098 return createObjectURL(this.bytes, 'image/jpeg', forceDataSchema); 3099 }; 3100 return JpegStream; 3101}(); 3102var JpxStream = function JpxStreamClosure() { 3103 function JpxStream(stream, maybeLength, dict, params) { 3104 this.stream = stream; 3105 this.maybeLength = maybeLength; 3106 this.dict = dict; 3107 this.params = params; 3108 DecodeStream.call(this, maybeLength); 3109 } 3110 JpxStream.prototype = Object.create(DecodeStream.prototype); 3111 Object.defineProperty(JpxStream.prototype, 'bytes', { 3112 get: function JpxStream_bytes() { 3113 return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); 3114 }, 3115 configurable: true 3116 }); 3117 JpxStream.prototype.ensureBuffer = function JpxStream_ensureBuffer(req) { 3118 if (this.bufferLength) { 3119 return; 3120 } 3121 var jpxImage = new JpxImage(); 3122 jpxImage.parse(this.bytes); 3123 var width = jpxImage.width; 3124 var height = jpxImage.height; 3125 var componentsCount = jpxImage.componentsCount; 3126 var tileCount = jpxImage.tiles.length; 3127 if (tileCount === 1) { 3128 this.buffer = jpxImage.tiles[0].items; 3129 } else { 3130 var data = new Uint8Array(width * height * componentsCount); 3131 for (var k = 0; k < tileCount; k++) { 3132 var tileComponents = jpxImage.tiles[k]; 3133 var tileWidth = tileComponents.width; 3134 var tileHeight = tileComponents.height; 3135 var tileLeft = tileComponents.left; 3136 var tileTop = tileComponents.top; 3137 var src = tileComponents.items; 3138 var srcPosition = 0; 3139 var dataPosition = (width * tileTop + tileLeft) * componentsCount; 3140 var imgRowSize = width * componentsCount; 3141 var tileRowSize = tileWidth * componentsCount; 3142 for (var j = 0; j < tileHeight; j++) { 3143 var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); 3144 data.set(rowBytes, dataPosition); 3145 srcPosition += tileRowSize; 3146 dataPosition += imgRowSize; 3147 } 3148 } 3149 this.buffer = data; 3150 } 3151 this.bufferLength = this.buffer.length; 3152 this.eof = true; 3153 }; 3154 return JpxStream; 3155}(); 3156var Jbig2Stream = function Jbig2StreamClosure() { 3157 function Jbig2Stream(stream, maybeLength, dict, params) { 3158 this.stream = stream; 3159 this.maybeLength = maybeLength; 3160 this.dict = dict; 3161 this.params = params; 3162 DecodeStream.call(this, maybeLength); 3163 } 3164 Jbig2Stream.prototype = Object.create(DecodeStream.prototype); 3165 Object.defineProperty(Jbig2Stream.prototype, 'bytes', { 3166 get: function Jbig2Stream_bytes() { 3167 return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength)); 3168 }, 3169 configurable: true 3170 }); 3171 Jbig2Stream.prototype.ensureBuffer = function Jbig2Stream_ensureBuffer(req) { 3172 if (this.bufferLength) { 3173 return; 3174 } 3175 var jbig2Image = new Jbig2Image(); 3176 var chunks = []; 3177 if (isDict(this.params)) { 3178 var globalsStream = this.params.get('JBIG2Globals'); 3179 if (isStream(globalsStream)) { 3180 var globals = globalsStream.getBytes(); 3181 chunks.push({ 3182 data: globals, 3183 start: 0, 3184 end: globals.length 3185 }); 3186 } 3187 } 3188 chunks.push({ 3189 data: this.bytes, 3190 start: 0, 3191 end: this.bytes.length 3192 }); 3193 var data = jbig2Image.parseChunks(chunks); 3194 var dataLength = data.length; 3195 for (var i = 0; i < dataLength; i++) { 3196 data[i] ^= 0xFF; 3197 } 3198 this.buffer = data; 3199 this.bufferLength = dataLength; 3200 this.eof = true; 3201 }; 3202 return Jbig2Stream; 3203}(); 3204var DecryptStream = function DecryptStreamClosure() { 3205 function DecryptStream(str, maybeLength, decrypt) { 3206 this.str = str; 3207 this.dict = str.dict; 3208 this.decrypt = decrypt; 3209 this.nextChunk = null; 3210 this.initialized = false; 3211 DecodeStream.call(this, maybeLength); 3212 } 3213 var chunkSize = 512; 3214 DecryptStream.prototype = Object.create(DecodeStream.prototype); 3215 DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { 3216 var chunk; 3217 if (this.initialized) { 3218 chunk = this.nextChunk; 3219 } else { 3220 chunk = this.str.getBytes(chunkSize); 3221 this.initialized = true; 3222 } 3223 if (!chunk || chunk.length === 0) { 3224 this.eof = true; 3225 return; 3226 } 3227 this.nextChunk = this.str.getBytes(chunkSize); 3228 var hasMoreData = this.nextChunk && this.nextChunk.length > 0; 3229 var decrypt = this.decrypt; 3230 chunk = decrypt(chunk, !hasMoreData); 3231 var bufferLength = this.bufferLength; 3232 var i, n = chunk.length; 3233 var buffer = this.ensureBuffer(bufferLength + n); 3234 for (i = 0; i < n; i++) { 3235 buffer[bufferLength++] = chunk[i]; 3236 } 3237 this.bufferLength = bufferLength; 3238 }; 3239 return DecryptStream; 3240}(); 3241var Ascii85Stream = function Ascii85StreamClosure() { 3242 function Ascii85Stream(str, maybeLength) { 3243 this.str = str; 3244 this.dict = str.dict; 3245 this.input = new Uint8Array(5); 3246 if (maybeLength) { 3247 maybeLength = 0.8 * maybeLength; 3248 } 3249 DecodeStream.call(this, maybeLength); 3250 } 3251 Ascii85Stream.prototype = Object.create(DecodeStream.prototype); 3252 Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { 3253 var TILDA_CHAR = 0x7E; 3254 var Z_LOWER_CHAR = 0x7A; 3255 var EOF = -1; 3256 var str = this.str; 3257 var c = str.getByte(); 3258 while (isSpace(c)) { 3259 c = str.getByte(); 3260 } 3261 if (c === EOF || c === TILDA_CHAR) { 3262 this.eof = true; 3263 return; 3264 } 3265 var bufferLength = this.bufferLength, buffer; 3266 var i; 3267 if (c === Z_LOWER_CHAR) { 3268 buffer = this.ensureBuffer(bufferLength + 4); 3269 for (i = 0; i < 4; ++i) { 3270 buffer[bufferLength + i] = 0; 3271 } 3272 this.bufferLength += 4; 3273 } else { 3274 var input = this.input; 3275 input[0] = c; 3276 for (i = 1; i < 5; ++i) { 3277 c = str.getByte(); 3278 while (isSpace(c)) { 3279 c = str.getByte(); 3280 } 3281 input[i] = c; 3282 if (c === EOF || c === TILDA_CHAR) { 3283 break; 3284 } 3285 } 3286 buffer = this.ensureBuffer(bufferLength + i - 1); 3287 this.bufferLength += i - 1; 3288 if (i < 5) { 3289 for (; i < 5; ++i) { 3290 input[i] = 0x21 + 84; 3291 } 3292 this.eof = true; 3293 } 3294 var t = 0; 3295 for (i = 0; i < 5; ++i) { 3296 t = t * 85 + (input[i] - 0x21); 3297 } 3298 for (i = 3; i >= 0; --i) { 3299 buffer[bufferLength + i] = t & 0xFF; 3300 t >>= 8; 3301 } 3302 } 3303 }; 3304 return Ascii85Stream; 3305}(); 3306var AsciiHexStream = function AsciiHexStreamClosure() { 3307 function AsciiHexStream(str, maybeLength) { 3308 this.str = str; 3309 this.dict = str.dict; 3310 this.firstDigit = -1; 3311 if (maybeLength) { 3312 maybeLength = 0.5 * maybeLength; 3313 } 3314 DecodeStream.call(this, maybeLength); 3315 } 3316 AsciiHexStream.prototype = Object.create(DecodeStream.prototype); 3317 AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { 3318 var UPSTREAM_BLOCK_SIZE = 8000; 3319 var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); 3320 if (!bytes.length) { 3321 this.eof = true; 3322 return; 3323 } 3324 var maxDecodeLength = bytes.length + 1 >> 1; 3325 var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); 3326 var bufferLength = this.bufferLength; 3327 var firstDigit = this.firstDigit; 3328 for (var i = 0, ii = bytes.length; i < ii; i++) { 3329 var ch = bytes[i], digit; 3330 if (ch >= 0x30 && ch <= 0x39) { 3331 digit = ch & 0x0F; 3332 } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 3333 digit = (ch & 0x0F) + 9; 3334 } else if (ch === 0x3E) { 3335 this.eof = true; 3336 break; 3337 } else { 3338 continue; 3339 } 3340 if (firstDigit < 0) { 3341 firstDigit = digit; 3342 } else { 3343 buffer[bufferLength++] = firstDigit << 4 | digit; 3344 firstDigit = -1; 3345 } 3346 } 3347 if (firstDigit >= 0 && this.eof) { 3348 buffer[bufferLength++] = firstDigit << 4; 3349 firstDigit = -1; 3350 } 3351 this.firstDigit = firstDigit; 3352 this.bufferLength = bufferLength; 3353 }; 3354 return AsciiHexStream; 3355}(); 3356var RunLengthStream = function RunLengthStreamClosure() { 3357 function RunLengthStream(str, maybeLength) { 3358 this.str = str; 3359 this.dict = str.dict; 3360 DecodeStream.call(this, maybeLength); 3361 } 3362 RunLengthStream.prototype = Object.create(DecodeStream.prototype); 3363 RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { 3364 var repeatHeader = this.str.getBytes(2); 3365 if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { 3366 this.eof = true; 3367 return; 3368 } 3369 var buffer; 3370 var bufferLength = this.bufferLength; 3371 var n = repeatHeader[0]; 3372 if (n < 128) { 3373 buffer = this.ensureBuffer(bufferLength + n + 1); 3374 buffer[bufferLength++] = repeatHeader[1]; 3375 if (n > 0) { 3376 var source = this.str.getBytes(n); 3377 buffer.set(source, bufferLength); 3378 bufferLength += n; 3379 } 3380 } else { 3381 n = 257 - n; 3382 var b = repeatHeader[1]; 3383 buffer = this.ensureBuffer(bufferLength + n + 1); 3384 for (var i = 0; i < n; i++) { 3385 buffer[bufferLength++] = b; 3386 } 3387 } 3388 this.bufferLength = bufferLength; 3389 }; 3390 return RunLengthStream; 3391}(); 3392var CCITTFaxStream = function CCITTFaxStreamClosure() { 3393 var ccittEOL = -2; 3394 var ccittEOF = -1; 3395 var twoDimPass = 0; 3396 var twoDimHoriz = 1; 3397 var twoDimVert0 = 2; 3398 var twoDimVertR1 = 3; 3399 var twoDimVertL1 = 4; 3400 var twoDimVertR2 = 5; 3401 var twoDimVertL2 = 6; 3402 var twoDimVertR3 = 7; 3403 var twoDimVertL3 = 8; 3404 var twoDimTable = [ 3405 [ 3406 -1, 3407 -1 3408 ], 3409 [ 3410 -1, 3411 -1 3412 ], 3413 [ 3414 7, 3415 twoDimVertL3 3416 ], 3417 [ 3418 7, 3419 twoDimVertR3 3420 ], 3421 [ 3422 6, 3423 twoDimVertL2 3424 ], 3425 [ 3426 6, 3427 twoDimVertL2 3428 ], 3429 [ 3430 6, 3431 twoDimVertR2 3432 ], 3433 [ 3434 6, 3435 twoDimVertR2 3436 ], 3437 [ 3438 4, 3439 twoDimPass 3440 ], 3441 [ 3442 4, 3443 twoDimPass 3444 ], 3445 [ 3446 4, 3447 twoDimPass 3448 ], 3449 [ 3450 4, 3451 twoDimPass 3452 ], 3453 [ 3454 4, 3455 twoDimPass 3456 ], 3457 [ 3458 4, 3459 twoDimPass 3460 ], 3461 [ 3462 4, 3463 twoDimPass 3464 ], 3465 [ 3466 4, 3467 twoDimPass 3468 ], 3469 [ 3470 3,
3471 twoDimHoriz 3472 ], 3473 [ 3474 3, 3475 twoDimHoriz 3476 ], 3477 [ 3478 3, 3479 twoDimHoriz 3480 ], 3481 [ 3482 3, 3483 twoDimHoriz 3484 ], 3485 [ 3486 3, 3487 twoDimHoriz 3488 ], 3489 [ 3490 3, 3491 twoDimHoriz 3492 ], 3493 [ 3494 3, 3495 twoDimHoriz 3496 ], 3497 [ 3498 3, 3499 twoDimHoriz 3500 ], 3501 [ 3502 3, 3503 twoDimHoriz 3504 ], 3505 [ 3506 3, 3507 twoDimHoriz 3508 ], 3509 [ 3510 3, 3511 twoDimHoriz 3512 ], 3513 [ 3514 3, 3515 twoDimHoriz 3516 ], 3517 [ 3518 3, 3519 twoDimHoriz 3520 ], 3521 [ 3522 3, 3523 twoDimHoriz 3524 ], 3525 [ 3526 3, 3527 twoDimHoriz 3528 ], 3529 [ 3530 3, 3531 twoDimHoriz 3532 ], 3533 [ 3534 3, 3535 twoDimVertL1 3536 ], 3537 [ 3538 3, 3539 twoDimVertL1 3540 ], 3541 [ 3542 3, 3543 twoDimVertL1 3544 ], 3545 [ 3546 3, 3547 twoDimVertL1 3548 ], 3549 [ 3550 3, 3551 twoDimVertL1 3552 ], 3553 [ 3554 3, 3555 twoDimVertL1 3556 ], 3557 [ 3558 3, 3559 twoDimVertL1 3560 ], 3561 [ 3562 3, 3563 twoDimVertL1 3564 ], 3565 [ 3566 3, 3567 twoDimVertL1 3568 ], 3569 [ 3570 3, 3571 twoDimVertL1 3572 ], 3573 [ 3574 3, 3575 twoDimVertL1 3576 ], 3577 [ 3578 3, 3579 twoDimVertL1 3580 ], 3581 [ 3582 3, 3583 twoDimVertL1 3584 ], 3585 [ 3586 3, 3587 twoDimVertL1 3588 ], 3589 [ 3590 3, 3591 twoDimVertL1 3592 ], 3593 [ 3594 3, 3595 twoDimVertL1 3596 ], 3597 [ 3598 3, 3599 twoDimVertR1 3600 ], 3601 [ 3602 3, 3603 twoDimVertR1 3604 ], 3605 [ 3606 3, 3607 twoDimVertR1 3608 ], 3609 [ 3610 3, 3611 twoDimVertR1 3612 ], 3613 [ 3614 3, 3615 twoDimVertR1 3616 ], 3617 [ 3618 3, 3619 twoDimVertR1 3620 ], 3621 [ 3622 3, 3623 twoDimVertR1 3624 ], 3625 [ 3626 3, 3627 twoDimVertR1 3628 ], 3629 [ 3630 3, 3631 twoDimVertR1 3632 ], 3633 [ 3634 3, 3635 twoDimVertR1 3636 ], 3637 [ 3638 3, 3639 twoDimVertR1 3640 ], 3641 [ 3642 3, 3643 twoDimVertR1 3644 ], 3645 [ 3646 3, 3647 twoDimVertR1 3648 ], 3649 [ 3650 3, 3651 twoDimVertR1 3652 ], 3653 [ 3654 3, 3655 twoDimVertR1 3656 ], 3657 [ 3658 3, 3659 twoDimVertR1 3660 ], 3661 [ 3662 1, 3663 twoDimVert0 3664 ], 3665 [ 3666 1, 3667 twoDimVert0 3668 ], 3669 [ 3670 1, 3671 twoDimVert0 3672 ], 3673 [ 3674 1, 3675 twoDimVert0 3676 ], 3677 [ 3678 1, 3679 twoDimVert0 3680 ], 3681 [ 3682 1, 3683 twoDimVert0 3684 ], 3685 [ 3686 1, 3687 twoDimVert0 3688 ], 3689 [ 3690 1, 3691 twoDimVert0 3692 ], 3693 [ 3694 1, 3695 twoDimVert0 3696 ], 3697 [ 3698 1, 3699 twoDimVert0 3700 ], 3701 [ 3702 1, 3703 twoDimVert0 3704 ], 3705 [ 3706 1, 3707 twoDimVert0 3708 ], 3709 [ 3710 1, 3711 twoDimVert0 3712 ], 3713 [ 3714 1, 3715 twoDimVert0 3716 ], 3717 [ 3718 1, 3719 twoDimVert0 3720 ], 3721 [ 3722 1, 3723 twoDimVert0 3724 ], 3725 [ 3726 1, 3727 twoDimVert0 3728 ], 3729 [ 3730 1, 3731 twoDimVert0 3732 ], 3733 [ 3734 1, 3735 twoDimVert0 3736 ], 3737 [ 3738 1, 3739 twoDimVert0 3740 ], 3741 [ 3742 1, 3743 twoDimVert0 3744 ], 3745 [ 3746 1, 3747 twoDimVert0 3748 ], 3749 [ 3750 1, 3751 twoDimVert0 3752 ], 3753 [ 3754 1, 3755 twoDimVert0 3756 ], 3757 [ 3758 1, 3759 twoDimVert0 3760 ], 3761 [ 3762 1, 3763 twoDimVert0 3764 ], 3765 [ 3766 1, 3767 twoDimVert0 3768 ], 3769 [ 3770 1, 3771 twoDimVert0 3772 ], 3773 [ 3774 1, 3775 twoDimVert0 3776 ], 3777 [ 3778 1, 3779 twoDimVert0 3780 ], 3781 [ 3782 1, 3783 twoDimVert0 3784 ], 3785 [ 3786 1, 3787 twoDimVert0 3788 ], 3789 [ 3790 1, 3791 twoDimVert0 3792 ], 3793 [ 3794 1, 3795 twoDimVert0 3796 ], 3797 [ 3798 1, 3799 twoDimVert0 3800 ], 3801 [ 3802 1, 3803 twoDimVert0 3804 ], 3805 [ 3806 1, 3807 twoDimVert0 3808 ], 3809 [ 3810 1, 3811 twoDimVert0 3812 ], 3813 [ 3814 1, 3815 twoDimVert0 3816 ], 3817 [ 3818 1, 3819 twoDimVert0 3820 ], 3821 [ 3822 1, 3823 twoDimVert0 3824 ], 3825 [ 3826 1, 3827 twoDimVert0 3828 ], 3829 [ 3830 1, 3831 twoDimVert0 3832 ], 3833 [ 3834 1, 3835 twoDimVert0 3836 ], 3837 [ 3838 1, 3839 twoDimVert0 3840 ], 3841 [ 3842 1, 3843 twoDimVert0 3844 ], 3845 [ 3846 1, 3847 twoDimVert0 3848 ], 3849 [ 3850 1, 3851 twoDimVert0 3852 ], 3853 [ 3854 1, 3855 twoDimVert0 3856 ], 3857 [ 3858 1, 3859 twoDimVert0 3860 ], 3861 [ 3862 1, 3863 twoDimVert0 3864 ], 3865 [ 3866 1, 3867 twoDimVert0 3868 ], 3869 [ 3870 1, 3871 twoDimVert0 3872 ], 3873 [ 3874 1, 3875 twoDimVert0 3876 ], 3877 [ 3878 1, 3879 twoDimVert0 3880 ], 3881 [ 3882 1, 3883 twoDimVert0 3884 ], 3885 [ 3886 1, 3887 twoDimVert0 3888 ], 3889 [ 3890 1, 3891 twoDimVert0 3892 ], 3893 [ 3894 1, 3895 twoDimVert0 3896 ], 3897 [ 3898 1, 3899 twoDimVert0 3900 ], 3901 [ 3902 1, 3903 twoDimVert0 3904 ], 3905 [ 3906 1, 3907 twoDimVert0 3908 ], 3909 [ 3910 1, 3911 twoDimVert0 3912 ], 3913 [ 3914 1, 3915 twoDimVert0 3916 ] 3917 ]; 3918 var whiteTable1 = [ 3919 [ 3920 -1, 3921 -1 3922 ], 3923 [ 3924 12, 3925 ccittEOL 3926 ], 3927 [ 3928 -1, 3929 -1 3930 ], 3931 [ 3932 -1, 3933 -1 3934 ], 3935 [ 3936 -1, 3937 -1 3938 ], 3939 [ 3940 -1, 3941 -1 3942 ], 3943 [ 3944 -1, 3945 -1 3946 ], 3947 [ 3948 -1, 3949 -1 3950 ], 3951 [ 3952 -1, 3953 -1 3954 ], 3955 [ 3956 -1, 3957 -1 3958 ], 3959 [ 3960 -1, 3961 -1 3962 ], 3963 [ 3964 -1, 3965 -1 3966 ], 3967 [ 3968 -1, 3969 -1 3970 ], 3971 [ 3972 -1, 3973 -1 3974 ], 3975 [ 3976 -1, 3977 -1 3978 ], 3979 [ 3980 -1, 3981 -1 3982 ], 3983 [ 3984 11, 3985 1792 3986 ], 3987 [ 3988 11, 3989 1792 3990 ], 3991 [ 3992 12, 3993 1984 3994 ], 3995 [ 3996 12, 3997 2048 3998 ], 3999 [ 4000 12, 4001 2112 4002 ], 4003 [ 4004 12, 4005 2176 4006 ], 4007 [ 4008 12, 4009 2240 4010 ], 4011 [ 4012 12, 4013 2304 4014 ], 4015 [ 4016 11, 4017 1856 4018 ], 4019 [ 4020 11, 4021 1856 4022 ], 4023 [ 4024 11, 4025 1920 4026 ], 4027 [ 4028 11, 4029 1920 4030 ], 4031 [ 4032 12, 4033 2368 4034 ], 4035 [ 4036 12, 4037 2432 4038 ], 4039 [ 4040 12, 4041 2496 4042 ], 4043 [ 4044 12, 4045 2560 4046 ] 4047 ]; 4048 var whiteTable2 = [ 4049 [ 4050 -1, 4051 -1 4052 ], 4053 [ 4054 -1, 4055 -1 4056 ], 4057 [ 4058 -1, 4059 -1 4060 ], 4061 [ 4062 -1, 4063 -1 4064 ], 4065 [ 4066 8, 4067 29 4068 ], 4069 [ 4070 8, 4071 29 4072 ], 4073 [ 4074 8, 4075 30 4076 ], 4077 [ 4078 8, 4079 30 4080 ], 4081 [ 4082 8, 4083 45 4084 ], 4085 [ 4086 8, 4087 45 4088 ], 4089 [ 4090 8, 4091 46 4092 ], 4093 [ 4094 8, 4095 46 4096 ], 4097 [ 4098 7, 4099 22 4100 ], 4101 [ 4102 7, 4103 22 4104 ], 4105 [ 4106 7, 4107 22 4108 ], 4109 [ 4110 7, 4111 22 4112 ], 4113 [ 4114 7, 4115 23 4116 ], 4117 [ 4118 7, 4119 23 4120 ], 4121 [ 4122 7, 4123 23 4124 ], 4125 [ 4126 7, 4127 23 4128 ], 4129 [ 4130 8, 4131 47 4132 ], 4133 [ 4134 8, 4135 47 4136 ], 4137 [ 4138 8, 4139 48 4140 ], 4141 [ 4142 8, 4143 48 4144 ], 4145 [ 4146 6, 4147 13 4148 ], 4149 [ 4150 6, 4151 13 4152 ], 4153 [ 4154 6, 4155 13 4156 ], 4157 [ 4158 6, 4159 13 4160 ], 4161 [ 4162 6, 4163 13 4164 ], 4165 [ 4166 6, 4167 13 4168 ], 4169 [ 4170 6, 4171 13 4172 ], 4173 [ 4174 6, 4175 13 4176 ], 4177 [ 4178 7, 4179 20 4180 ], 4181 [ 4182 7, 4183 20 4184 ], 4185 [ 4186 7, 4187 20 4188 ], 4189 [ 4190 7, 4191 20 4192 ], 4193 [ 4194 8, 4195 33 4196 ], 4197 [ 4198 8, 4199 33 4200 ], 4201 [ 4202 8, 4203 34 4204 ], 4205 [ 4206 8, 4207 34 4208 ], 4209 [ 4210 8, 4211 35 4212 ], 4213 [ 4214 8, 4215 35 4216 ], 4217 [ 4218 8, 4219 36 4220 ], 4221 [ 4222 8, 4223 36 4224 ], 4225 [ 4226 8, 4227 37 4228 ], 4229 [ 4230 8, 4231 37 4232 ], 4233 [ 4234 8, 4235 38 4236 ], 4237 [ 4238 8, 4239 38 4240 ], 4241 [ 4242 7, 4243 19 4244 ], 4245 [ 4246 7, 4247 19 4248 ], 4249 [ 4250 7, 4251 19 4252 ], 4253 [ 4254 7, 4255 19 4256 ], 4257 [ 4258 8, 4259 31 4260 ], 4261 [ 4262 8, 4263 31 4264 ], 4265 [ 4266 8, 4267 32 4268 ], 4269 [ 4270 8, 4271 32 4272 ], 4273 [ 4274 6, 4275 1 4276 ], 4277 [ 4278 6, 4279 1 4280 ], 4281 [ 4282 6, 4283 1 4284 ], 4285 [ 4286 6, 4287 1 4288 ], 4289 [ 4290 6, 4291 1 4292 ], 4293 [ 4294 6, 4295 1 4296 ], 4297 [ 4298 6, 4299 1 4300 ], 4301 [ 4302 6, 4303 1 4304 ], 4305 [ 4306 6, 4307 12 4308 ], 4309 [ 4310 6, 4311 12 4312 ], 4313 [ 4314 6, 4315 12 4316 ], 4317 [ 4318 6, 4319 12 4320 ], 4321 [ 4322 6, 4323 12 4324 ], 4325 [ 4326 6, 4327 12 4328 ], 4329 [ 4330 6, 4331 12 4332 ], 4333 [ 4334 6, 4335 12 4336 ], 4337 [ 4338 8, 4339 53 4340 ], 4341 [ 4342 8, 4343 53 4344 ], 4345 [ 4346 8, 4347 54 4348 ], 4349 [ 4350 8, 4351 54 4352 ], 4353 [ 4354 7, 4355 26 4356 ], 4357 [ 4358 7, 4359 26 4360 ], 4361 [ 4362 7, 4363 26 4364 ], 4365 [ 4366 7, 4367 26 4368 ], 4369 [ 4370 8, 4371 39 4372 ], 4373 [ 4374 8, 4375 39 4376 ], 4377 [ 4378 8, 4379 40 4380 ], 4381 [ 4382 8, 4383 40 4384 ], 4385 [ 4386 8, 4387 41 4388 ], 4389 [ 4390 8, 4391 41 4392 ], 4393 [ 4394 8, 4395 42 4396 ], 4397 [ 4398 8, 4399 42 4400 ], 4401 [ 4402 8, 4403 43 4404 ], 4405 [ 4406 8, 4407 43 4408 ], 4409 [ 4410 8, 4411 44 4412 ], 4413 [ 4414 8, 4415 44 4416 ], 4417 [ 4418 7, 4419 21 4420 ], 4421 [ 4422 7, 4423 21 4424 ], 4425 [ 4426 7, 4427 21 4428 ], 4429 [ 4430 7, 4431 21 4432 ], 4433 [ 4434 7, 4435 28 4436 ], 4437 [ 4438 7, 4439 28 4440 ], 4441 [ 4442 7, 4443 28 4444 ], 4445 [ 4446 7, 4447 28 4448 ], 4449 [ 4450 8, 4451 61 4452 ], 4453 [ 4454 8, 4455 61 4456 ], 4457 [ 4458 8, 4459 62 4460 ], 4461 [ 4462 8, 4463 62 4464 ], 4465 [ 4466 8, 4467 63 4468 ], 4469 [ 4470 8, 4471 63 4472 ], 4473 [ 4474 8, 4475 0 4476 ], 4477 [ 4478 8, 4479 0 4480 ], 4481 [ 4482 8, 4483 320 4484 ], 4485 [ 4486 8, 4487 320 4488 ], 4489 [ 4490 8, 4491 384 4492 ], 4493 [ 4494 8, 4495 384 4496 ], 4497 [ 4498 5, 4499 10 4500 ], 4501 [ 4502 5, 4503 10 4504 ], 4505 [ 4506 5, 4507 10 4508 ], 4509 [ 4510 5, 4511 10 4512 ], 4513 [ 4514 5, 4515 10 4516 ], 4517 [ 4518 5, 4519 10 4520 ], 4521 [ 4522 5, 4523 10 4524 ], 4525 [ 4526 5, 4527 10 4528 ], 4529 [ 4530 5, 4531 10 4532 ], 4533 [ 4534 5, 4535 10 4536 ], 4537 [ 4538 5, 4539 10 4540 ], 4541 [ 4542 5, 4543 10 4544 ], 4545 [ 4546 5, 4547 10 4548 ], 4549 [ 4550 5, 4551 10 4552 ], 4553 [ 4554 5, 4555 10 4556 ], 4557 [ 4558 5, 4559 10 4560 ], 4561 [ 4562 5, 4563 11 4564 ], 4565 [ 4566 5, 4567 11 4568 ], 4569 [ 4570 5, 4571 11 4572 ], 4573 [ 4574 5, 4575 11 4576 ], 4577 [ 4578 5, 4579 11 4580 ], 4581 [ 4582 5, 4583 11 4584 ], 4585 [ 4586 5, 4587 11 4588 ], 4589 [ 4590 5, 4591 11 4592 ], 4593 [ 4594 5, 4595 11 4596 ], 4597 [ 4598 5, 4599 11 4600 ], 4601 [ 4602 5, 4603 11 4604 ], 4605 [ 4606 5, 4607 11 4608 ], 4609 [ 4610 5, 4611 11 4612 ], 4613 [ 4614 5, 4615 11 4616 ], 4617 [ 4618 5, 4619 11 4620 ], 4621 [ 4622 5, 4623 11 4624 ], 4625 [ 4626 7, 4627 27 4628 ], 4629 [ 4630 7, 4631 27 4632 ], 4633 [ 4634 7, 4635 27 4636 ], 4637 [ 4638 7, 4639 27 4640 ], 4641 [ 4642 8, 4643 59 4644 ], 4645 [ 4646 8, 4647 59 4648 ], 4649 [ 4650 8, 4651 60 4652 ], 4653 [ 4654 8, 4655 60 4656 ], 4657 [ 4658 9, 4659 1472 4660 ], 4661 [ 4662 9, 4663 1536 4664 ], 4665 [ 4666 9, 4667 1600 4668 ], 4669 [ 4670 9, 4671 1728 4672 ], 4673 [ 4674 7, 4675 18 4676 ], 4677 [ 4678 7, 4679 18 4680 ], 4681 [ 4682 7, 4683 18 4684 ], 4685 [ 4686 7, 4687 18 4688 ], 4689 [ 4690 7, 4691 24 4692 ], 4693 [ 4694 7, 4695 24 4696 ], 4697 [ 4698 7, 4699 24 4700 ], 4701 [ 4702 7, 4703 24 4704 ], 4705 [ 4706 8, 4707 49 4708 ], 4709 [ 4710 8, 4711 49 4712 ], 4713 [ 4714 8, 4715 50 4716 ], 4717 [ 4718 8, 4719 50 4720 ], 4721 [ 4722 8, 4723 51 4724 ], 4725 [ 4726 8, 4727 51 4728 ], 4729 [ 4730 8, 4731 52 4732 ], 4733 [ 4734 8, 4735 52 4736 ], 4737 [ 4738 7, 4739 25 4740 ], 4741 [ 4742 7, 4743 25 4744 ], 4745 [ 4746 7, 4747 25 4748 ], 4749 [ 4750 7, 4751 25 4752 ], 4753 [ 4754 8, 4755 55 4756 ], 4757 [ 4758 8, 4759 55 4760 ], 4761 [ 4762 8, 4763 56 4764 ], 4765 [ 4766 8, 4767 56 4768 ], 4769 [ 4770 8, 4771 57 4772 ], 4773 [ 4774 8, 4775 57 4776 ], 4777 [ 4778 8, 4779 58 4780 ], 4781 [ 4782 8, 4783 58 4784 ], 4785 [ 4786 6, 4787 192 4788 ], 4789 [ 4790 6, 4791 192 4792 ], 4793 [ 4794 6, 4795 192 4796 ], 4797 [ 4798 6, 4799 192 4800 ], 4801 [ 4802 6, 4803 192 4804 ], 4805 [ 4806 6, 4807 192 4808 ], 4809 [ 4810 6, 4811 192 4812 ], 4813 [ 4814 6, 4815 192 4816 ], 4817 [ 4818 6, 4819 1664 4820 ], 4821 [ 4822 6, 4823 1664 4824 ], 4825 [ 4826 6, 4827 1664 4828 ], 4829 [ 4830 6, 4831 1664 4832 ], 4833 [ 4834 6, 4835 1664 4836 ], 4837 [ 4838 6, 4839 1664 4840 ], 4841 [ 4842 6, 4843 1664 4844 ], 4845 [ 4846 6, 4847 1664 4848 ], 4849 [ 4850 8, 4851 448 4852 ], 4853 [ 4854 8, 4855 448 4856 ], 4857 [ 4858 8, 4859 512 4860 ], 4861 [ 4862 8, 4863 512 4864 ], 4865 [ 4866 9, 4867 704 4868 ], 4869 [ 4870 9, 4871 768 4872 ], 4873 [ 4874 8, 4875 640 4876 ], 4877 [ 4878 8, 4879 640 4880 ], 4881 [ 4882 8, 4883 576 4884 ], 4885 [ 4886 8, 4887 576 4888 ], 4889 [ 4890 9, 4891 832 4892 ], 4893 [ 4894 9, 4895 896 4896 ], 4897 [ 4898 9, 4899 960 4900 ], 4901 [ 4902 9, 4903 1024 4904 ], 4905 [ 4906 9, 4907 1088 4908 ], 4909 [ 4910 9, 4911 1152 4912 ], 4913 [ 4914 9, 4915 1216 4916 ], 4917 [ 4918 9, 4919 1280 4920 ], 4921 [ 4922 9, 4923 1344 4924 ], 4925 [ 4926 9, 4927 1408 4928 ], 4929 [ 4930 7, 4931 256 4932 ], 4933 [ 4934 7, 4935 256 4936 ], 4937 [ 4938 7, 4939 256 4940 ], 4941 [ 4942 7, 4943 256 4944 ], 4945 [ 4946 4, 4947 2 4948 ], 4949 [ 4950 4, 4951 2 4952 ], 4953 [ 4954 4, 4955 2 4956 ], 4957 [ 4958 4, 4959 2 4960 ], 4961 [ 4962 4, 4963 2 4964 ], 4965 [ 4966 4, 4967 2 4968 ], 4969 [ 4970 4, 4971 2 4972 ], 4973 [ 4974 4, 4975 2 4976 ], 4977 [ 4978 4, 4979 2 4980 ], 4981 [ 4982 4, 4983 2 4984 ], 4985 [ 4986 4, 4987 2 4988 ], 4989 [ 4990 4, 4991 2 4992 ], 4993 [ 4994 4, 4995 2 4996 ], 4997 [ 4998 4, 4999 2 5000 ], 5001 [ 5002 4, 5003 2 5004 ], 5005 [ 5006 4, 5007 2 5008 ], 5009 [ 5010 4, 5011 2 5012 ], 5013 [ 5014 4, 5015 2 5016 ], 5017 [ 5018 4, 5019 2 5020 ], 5021 [ 5022 4, 5023 2 5024 ], 5025 [ 5026 4, 5027 2 5028 ], 5029 [ 5030 4, 5031 2 5032 ], 5033 [ 5034 4, 5035 2 5036 ], 5037 [ 5038 4, 5039 2 5040 ], 5041 [ 5042 4, 5043 2 5044 ], 5045 [ 5046 4, 5047 2 5048 ], 5049 [ 5050 4, 5051 2 5052 ], 5053 [ 5054 4, 5055 2 5056 ], 5057 [ 5058 4, 5059 2 5060 ], 5061 [ 5062 4, 5063 2 5064 ], 5065 [ 5066 4, 5067 2 5068 ], 5069 [ 5070 4, 5071 2 5072 ], 5073 [ 5074 4, 5075 3 5076 ], 5077 [ 5078 4, 5079 3 5080 ], 5081 [ 5082 4, 5083 3 5084 ], 5085 [ 5086 4, 5087 3 5088 ], 5089 [ 5090 4, 5091 3 5092 ], 5093 [ 5094 4, 5095 3 5096 ], 5097 [ 5098 4, 5099 3 5100 ], 5101 [ 5102 4, 5103 3 5104 ], 5105 [ 5106 4, 5107 3 5108 ], 5109 [ 5110 4, 5111 3 5112 ], 5113 [ 5114 4, 5115 3 5116 ], 5117 [ 5118 4, 5119 3 5120 ], 5121 [ 5122 4, 5123 3 5124 ], 5125 [ 5126 4, 5127 3 5128 ], 5129 [ 5130 4, 5131 3 5132 ], 5133 [ 5134 4, 5135 3 5136 ], 5137 [ 5138 4, 5139 3 5140 ], 5141 [ 5142 4, 5143 3 5144 ], 5145 [ 5146 4, 5147 3 5148 ], 5149 [ 5150 4, 5151 3 5152 ], 5153 [ 5154 4, 5155 3 5156 ], 5157 [ 5158 4, 5159 3 5160 ], 5161 [ 5162 4, 5163 3 5164 ], 5165 [ 5166 4, 5167 3 5168 ], 5169 [ 5170 4, 5171 3 5172 ], 5173 [ 5174 4, 5175 3 5176 ], 5177 [ 5178 4, 5179 3 5180 ], 5181 [ 5182 4, 5183 3 5184 ], 5185 [ 5186 4, 5187 3 5188 ], 5189 [ 5190 4, 5191 3 5192 ], 5193 [ 5194 4, 5195 3 5196 ], 5197 [ 5198 4, 5199 3 5200 ], 5201 [ 5202 5, 5203 128 5204 ], 5205 [ 5206 5, 5207 128 5208 ], 5209 [ 5210 5, 5211 128 5212 ], 5213 [ 5214 5, 5215 128 5216 ], 5217 [ 5218 5, 5219 128 5220 ], 5221 [ 5222 5, 5223 128 5224 ], 5225 [ 5226 5, 5227 128 5228 ], 5229 [ 5230 5, 5231 128 5232 ], 5233 [ 5234 5, 5235 128 5236 ], 5237 [ 5238 5, 5239 128 5240 ], 5241 [ 5242 5, 5243 128 5244 ], 5245 [ 5246 5, 5247 128 5248 ], 5249 [ 5250 5, 5251 128 5252 ], 5253 [ 5254 5, 5255 128 5256 ], 5257 [ 5258 5, 5259 128 5260 ], 5261 [ 5262 5, 5263 128 5264 ], 5265 [ 5266 5, 5267 8 5268 ], 5269 [ 5270 5, 5271 8 5272 ], 5273 [ 5274 5, 5275 8 5276 ], 5277 [ 5278 5, 5279 8 5280 ], 5281 [ 5282 5, 5283 8 5284 ], 5285 [ 5286 5, 5287 8 5288 ], 5289 [ 5290 5, 5291 8 5292 ], 5293 [ 5294 5, 5295 8 5296 ], 5297 [ 5298 5, 5299 8 5300 ], 5301 [ 5302 5, 5303 8 5304 ], 5305 [ 5306 5, 5307 8 5308 ], 5309 [ 5310 5, 5311 8 5312 ], 5313 [ 5314 5, 5315 8 5316 ], 5317 [ 5318 5, 5319 8 5320 ], 5321 [ 5322 5, 5323 8 5324 ], 5325 [ 5326 5, 5327 8 5328 ], 5329 [ 5330 5, 5331 9 5332 ], 5333 [ 5334 5, 5335 9 5336 ], 5337 [ 5338 5, 5339 9 5340 ], 5341 [ 5342 5, 5343 9 5344 ], 5345 [ 5346 5, 5347 9 5348 ], 5349 [ 5350 5, 5351 9 5352 ], 5353 [ 5354 5, 5355 9 5356 ], 5357 [ 5358 5, 5359 9 5360 ], 5361 [ 5362 5, 5363 9 5364 ], 5365 [ 5366 5, 5367 9 5368 ], 5369 [ 5370 5, 5371 9 5372 ], 5373 [ 5374 5, 5375 9 5376 ], 5377 [ 5378 5, 5379 9 5380 ], 5381 [ 5382 5, 5383 9 5384 ], 5385 [ 5386 5, 5387 9 5388 ], 5389 [ 5390 5, 5391 9 5392 ], 5393 [ 5394 6, 5395 16 5396 ], 5397 [ 5398 6, 5399 16 5400 ], 5401 [ 5402 6, 5403 16 5404 ], 5405 [ 5406 6, 5407 16 5408 ], 5409 [ 5410 6, 5411 16 5412 ], 5413 [ 5414 6, 5415 16 5416 ], 5417 [ 5418 6, 5419 16 5420 ], 5421 [ 5422 6, 5423 16 5424 ], 5425 [ 5426 6, 5427 17 5428 ], 5429 [ 5430 6, 5431 17 5432 ], 5433 [ 5434 6, 5435 17 5436 ], 5437 [ 5438 6, 5439 17 5440 ], 5441 [ 5442 6, 5443 17 5444 ], 5445 [ 5446 6, 5447 17 5448 ], 5449 [ 5450 6, 5451 17 5452 ], 5453 [ 5454 6, 5455 17 5456 ], 5457 [ 5458 4, 5459 4 5460 ], 5461 [ 5462 4, 5463 4 5464 ], 5465 [ 5466 4, 5467 4 5468 ], 5469 [ 5470 4, 5471 4 5472 ], 5473 [ 5474 4, 5475 4 5476 ], 5477 [ 5478 4, 5479 4 5480 ], 5481 [ 5482 4, 5483 4 5484 ], 5485 [ 5486 4, 5487 4 5488 ], 5489 [ 5490 4, 5491 4 5492 ], 5493 [ 5494 4, 5495 4 5496 ], 5497 [ 5498 4, 5499 4 5500 ], 5501 [ 5502 4, 5503 4 5504 ], 5505 [ 5506 4, 5507 4 5508 ], 5509 [ 5510 4, 5511 4 5512 ], 5513 [ 5514 4, 5515 4 5516 ], 5517 [ 5518 4, 5519 4 5520 ], 5521 [ 5522 4, 5523 4 5524 ], 5525 [ 5526 4, 5527 4 5528 ], 5529 [ 5530 4, 5531 4 5532 ], 5533 [ 5534 4, 5535 4 5536 ], 5537 [ 5538 4, 5539 4 5540 ], 5541 [ 5542 4, 5543 4 5544 ], 5545 [ 5546 4, 5547 4 5548 ], 5549 [ 5550 4, 5551 4 5552 ], 5553 [ 5554 4, 5555 4 5556 ], 5557 [ 5558 4, 5559 4 5560 ], 5561 [ 5562 4, 5563 4 5564 ], 5565 [ 5566 4, 5567 4 5568 ], 5569 [ 5570 4, 5571 4 5572 ], 5573 [ 5574 4, 5575 4 5576 ], 5577 [ 5578 4, 5579 4 5580 ], 5581 [ 5582 4, 5583 4 5584 ], 5585 [ 5586 4, 5587 5 5588 ], 5589 [ 5590 4, 5591 5 5592 ], 5593 [ 5594 4, 5595 5 5596 ], 5597 [ 5598 4, 5599 5 5600 ], 5601 [ 5602 4, 5603 5 5604 ], 5605 [ 5606 4, 5607 5 5608 ], 5609 [ 5610 4, 5611 5 5612 ], 5613 [ 5614 4, 5615 5 5616 ], 5617 [ 5618 4, 5619 5 5620 ], 5621 [ 5622 4, 5623 5 5624 ], 5625 [ 5626 4, 5627 5 5628 ], 5629 [ 5630 4, 5631 5 5632 ], 5633 [ 5634 4, 5635 5 5636 ], 5637 [ 5638 4, 5639 5 5640 ], 5641 [ 5642 4, 5643 5 5644 ], 5645 [ 5646 4, 5647 5 5648 ], 5649 [ 5650 4, 5651 5 5652 ], 5653 [ 5654 4, 5655 5 5656 ], 5657 [ 5658 4, 5659 5 5660 ], 5661 [ 5662 4, 5663 5 5664 ], 5665 [ 5666 4, 5667 5 5668 ], 5669 [ 5670 4, 5671 5 5672 ], 5673 [ 5674 4, 5675 5 5676 ], 5677 [ 5678 4, 5679 5 5680 ], 5681 [ 5682 4, 5683 5 5684 ], 5685 [ 5686 4, 5687 5 5688 ], 5689 [ 5690 4, 5691 5 5692 ], 5693 [ 5694 4, 5695 5 5696 ], 5697 [ 5698 4, 5699 5 5700 ], 5701 [ 5702 4, 5703 5 5704 ], 5705 [ 5706 4, 5707 5 5708 ], 5709 [ 5710 4, 5711 5 5712 ], 5713 [ 5714 6, 5715 14 5716 ], 5717 [ 5718 6, 5719 14 5720 ], 5721 [ 5722 6, 5723 14 5724 ], 5725 [ 5726 6, 5727 14 5728 ], 5729 [ 5730 6, 5731 14 5732 ], 5733 [ 5734 6, 5735 14 5736 ], 5737 [ 5738 6, 5739 14 5740 ], 5741 [ 5742 6, 5743 14 5744 ], 5745 [ 5746 6, 5747 15 5748 ], 5749 [ 5750 6, 5751 15 5752 ], 5753 [ 5754 6, 5755 15 5756 ], 5757 [ 5758 6, 5759 15 5760 ], 5761 [ 5762 6, 5763 15 5764 ], 5765 [ 5766 6, 5767 15 5768 ], 5769 [ 5770 6, 5771 15 5772 ], 5773 [ 5774 6, 5775 15 5776 ], 5777 [ 5778 5, 5779 64 5780 ], 5781 [ 5782 5, 5783 64 5784 ], 5785 [ 5786 5, 5787 64 5788 ], 5789 [ 5790 5, 5791 64 5792 ], 5793 [ 5794 5, 5795 64 5796 ], 5797 [ 5798 5, 5799 64 5800 ], 5801 [ 5802 5, 5803 64 5804 ], 5805 [ 5806 5, 5807 64 5808 ], 5809 [ 5810 5, 5811 64 5812 ], 5813 [ 5814 5, 5815 64 5816 ], 5817 [ 5818 5, 5819 64 5820 ], 5821 [ 5822 5, 5823 64 5824 ], 5825 [ 5826 5, 5827 64 5828 ], 5829 [ 5830 5, 5831 64 5832 ], 5833 [ 5834 5, 5835 64 5836 ], 5837 [ 5838 5, 5839 64 5840 ], 5841 [ 5842 4, 5843 6 5844 ], 5845 [ 5846 4, 5847 6 5848 ], 5849 [ 5850 4, 5851 6 5852 ], 5853 [ 5854 4, 5855 6 5856 ], 5857 [ 5858 4, 5859 6 5860 ], 5861 [ 5862 4, 5863 6 5864 ], 5865 [ 5866 4, 5867 6 5868 ], 5869 [ 5870 4, 5871 6 5872 ], 5873 [ 5874 4, 5875 6 5876 ], 5877 [ 5878 4, 5879 6 5880 ], 5881 [ 5882 4, 5883 6 5884 ], 5885 [ 5886 4, 5887 6 5888 ], 5889 [ 5890 4, 5891 6 5892 ], 5893 [ 5894 4, 5895 6 5896 ], 5897 [ 5898 4, 5899 6 5900 ], 5901 [ 5902 4, 5903 6 5904 ], 5905 [ 5906 4, 5907 6 5908 ], 5909 [ 5910 4, 5911 6 5912 ], 5913 [ 5914 4, 5915 6 5916 ], 5917 [ 5918 4, 5919 6 5920 ], 5921 [ 5922 4, 5923 6 5924 ], 5925 [ 5926 4, 5927 6 5928 ], 5929 [ 5930 4, 5931 6 5932 ], 5933 [ 5934 4, 5935 6 5936 ], 5937 [ 5938 4, 5939 6 5940 ], 5941 [ 5942 4, 5943 6 5944 ], 5945 [ 5946 4, 5947 6 5948 ], 5949 [ 5950 4, 5951 6 5952 ], 5953 [ 5954 4, 5955 6 5956 ], 5957 [ 5958 4, 5959 6 5960 ], 5961 [ 5962 4, 5963 6 5964 ], 5965 [ 5966 4, 5967 6 5968 ], 5969 [ 5970 4, 5971 7 5972 ], 5973 [ 5974 4, 5975 7 5976 ], 5977 [ 5978 4, 5979 7 5980 ], 5981 [ 5982 4, 5983 7 5984 ], 5985 [ 5986 4, 5987 7 5988 ], 5989 [ 5990 4, 5991 7 5992 ], 5993 [ 5994 4, 5995 7 5996 ], 5997 [ 5998 4, 5999 7 6000 ], 6001 [ 6002 4, 6003 7 6004 ], 6005 [ 6006 4, 6007 7 6008 ], 6009 [ 6010 4, 6011 7 6012 ], 6013 [ 6014 4, 6015 7 6016 ], 6017 [ 6018 4, 6019 7 6020 ], 6021 [ 6022 4, 6023 7 6024 ], 6025 [ 6026 4, 6027 7 6028 ], 6029 [ 6030 4, 6031 7 6032 ], 6033 [ 6034 4, 6035 7 6036 ], 6037 [ 6038 4, 6039 7 6040 ], 6041 [ 6042 4, 6043 7 6044 ], 6045 [ 6046 4, 6047 7 6048 ], 6049 [ 6050 4, 6051 7 6052 ], 6053 [ 6054 4, 6055 7 6056 ], 6057 [ 6058 4, 6059 7 6060 ], 6061 [ 6062 4, 6063 7 6064 ], 6065 [ 6066 4, 6067 7 6068 ], 6069 [ 6070 4, 6071 7 6072 ], 6073 [ 6074 4, 6075 7 6076 ], 6077 [ 6078 4, 6079 7 6080 ], 6081 [ 6082 4, 6083 7 6084 ], 6085 [ 6086 4, 6087 7 6088 ], 6089 [ 6090 4, 6091 7 6092 ], 6093 [ 6094 4, 6095 7 6096 ] 6097 ]; 6098 var blackTable1 = [ 6099 [ 6100 -1, 6101 -1 6102 ], 6103 [ 6104 -1, 6105 -1 6106 ], 6107 [ 6108 12, 6109 ccittEOL 6110 ], 6111 [ 6112 12, 6113 ccittEOL 6114 ], 6115 [ 6116 -1, 6117 -1 6118 ], 6119 [ 6120 -1, 6121 -1 6122 ], 6123 [ 6124 -1, 6125 -1 6126 ], 6127 [ 6128 -1, 6129 -1 6130 ], 6131 [ 6132 -1, 6133 -1 6134 ], 6135 [ 6136 -1, 6137 -1 6138 ], 6139 [ 6140 -1, 6141 -1 6142 ], 6143 [ 6144 -1, 6145 -1 6146 ], 6147 [ 6148 -1, 6149 -1 6150 ], 6151 [ 6152 -1, 6153 -1 6154 ], 6155 [ 6156 -1, 6157 -1 6158 ], 6159 [ 6160 -1, 6161 -1 6162 ], 6163 [ 6164 -1, 6165 -1 6166 ], 6167 [ 6168 -1, 6169 -1 6170 ], 6171 [ 6172 -1, 6173 -1 6174 ], 6175 [ 6176 -1, 6177 -1 6178 ], 6179 [ 6180 -1, 6181 -1 6182 ], 6183 [ 6184 -1, 6185 -1 6186 ], 6187 [ 6188 -1, 6189 -1 6190 ], 6191 [ 6192 -1, 6193 -1 6194 ], 6195 [ 6196 -1, 6197 -1 6198 ], 6199 [ 6200 -1, 6201 -1 6202 ], 6203 [ 6204 -1, 6205 -1 6206 ], 6207 [ 6208 -1, 6209 -1 6210 ], 6211 [ 6212 -1, 6213 -1 6214 ], 6215 [ 6216 -1, 6217 -1 6218 ], 6219 [ 6220 -1, 6221 -1 6222 ], 6223 [ 6224 -1, 6225 -1 6226 ], 6227 [ 6228 11, 6229 1792 6230 ], 6231 [ 6232 11, 6233 1792 6234 ], 6235 [ 6236 11, 6237 1792 6238 ], 6239 [ 6240 11, 6241 1792 6242 ], 6243 [ 6244 12, 6245 1984 6246 ], 6247 [ 6248 12, 6249 1984 6250 ], 6251 [ 6252 12, 6253 2048 6254 ], 6255 [ 6256 12, 6257 2048 6258 ], 6259 [ 6260 12, 6261 2112 6262 ], 6263 [ 6264 12, 6265 2112 6266 ], 6267 [ 6268 12, 6269 2176 6270 ], 6271 [ 6272 12, 6273 2176 6274 ], 6275 [ 6276 12, 6277 2240 6278 ], 6279 [ 6280 12, 6281 2240 6282 ], 6283 [ 6284 12, 6285 2304 6286 ], 6287 [ 6288 12, 6289 2304 6290 ], 6291 [ 6292 11, 6293 1856 6294 ], 6295 [ 6296 11, 6297 1856 6298 ], 6299 [ 6300 11, 6301 1856 6302 ], 6303 [ 6304 11, 6305 1856 6306 ], 6307 [ 6308 11, 6309 1920 6310 ], 6311 [ 6312 11, 6313 1920 6314 ], 6315 [ 6316 11, 6317 1920 6318 ], 6319 [ 6320 11, 6321 1920 6322 ], 6323 [ 6324 12, 6325 2368 6326 ], 6327 [ 6328 12, 6329 2368 6330 ], 6331 [ 6332 12, 6333 2432 6334 ], 6335 [ 6336 12, 6337 2432 6338 ], 6339 [ 6340 12, 6341 2496 6342 ], 6343 [ 6344 12, 6345 2496 6346 ], 6347 [ 6348 12, 6349 2560 6350 ], 6351 [ 6352 12, 6353 2560 6354 ], 6355 [ 6356 10, 6357 18 6358 ], 6359 [ 6360 10, 6361 18 6362 ], 6363 [ 6364 10, 6365 18 6366 ], 6367 [ 6368 10, 6369 18 6370 ], 6371 [ 6372 10,
vendor: 8,255 bytes, lines 6373-7685
6373 18 6374 ], 6375 [ 6376 10, 6377 18 6378 ], 6379 [ 6380 10, 6381 18 6382 ], 6383 [ 6384 10, 6385 18 6386 ], 6387 [ 6388 12, 6389 52 6390 ], 6391 [ 6392 12, 6393 52 6394 ], 6395 [ 6396 13, 6397 640 6398 ], 6399 [ 6400 13, 6401 704 6402 ], 6403 [ 6404 13, 6405 768 6406 ], 6407 [ 6408 13, 6409 832 6410 ], 6411 [ 6412 12, 6413 55 6414 ], 6415 [ 6416 12, 6417 55 6418 ], 6419 [ 6420 12, 6421 56 6422 ], 6423 [ 6424 12, 6425 56 6426 ], 6427 [ 6428 13, 6429 1280 6430 ], 6431 [ 6432 13, 6433 1344 6434 ], 6435 [ 6436 13, 6437 1408 6438 ], 6439 [ 6440 13, 6441 1472 6442 ], 6443 [ 6444 12, 6445 59 6446 ], 6447 [ 6448 12, 6449 59 6450 ], 6451 [ 6452 12, 6453 60 6454 ], 6455 [ 6456 12, 6457 60 6458 ], 6459 [ 6460 13, 6461 1536 6462 ], 6463 [ 6464 13, 6465 1600 6466 ], 6467 [ 6468 11, 6469 24 6470 ], 6471 [ 6472 11, 6473 24 6474 ], 6475 [ 6476 11, 6477 24 6478 ], 6479 [ 6480 11, 6481 24 6482 ], 6483 [ 6484 11, 6485 25 6486 ], 6487 [ 6488 11, 6489 25 6490 ], 6491 [ 6492 11, 6493 25 6494 ], 6495 [ 6496 11, 6497 25 6498 ], 6499 [ 6500 13, 6501 1664 6502 ], 6503 [ 6504 13, 6505 1728 6506 ], 6507 [ 6508 12, 6509 320 6510 ], 6511 [ 6512 12, 6513 320 6514 ], 6515 [ 6516 12, 6517 384 6518 ], 6519 [ 6520 12, 6521 384 6522 ], 6523 [ 6524 12, 6525 448 6526 ], 6527 [ 6528 12, 6529 448 6530 ], 6531 [ 6532 13, 6533 512 6534 ], 6535 [ 6536 13, 6537 576 6538 ], 6539 [ 6540 12, 6541 53 6542 ], 6543 [ 6544 12, 6545 53 6546 ], 6547 [ 6548 12, 6549 54 6550 ], 6551 [ 6552 12, 6553 54 6554 ], 6555 [ 6556 13, 6557 896 6558 ], 6559 [ 6560 13, 6561 960 6562 ], 6563 [ 6564 13, 6565 1024 6566 ], 6567 [ 6568 13, 6569 1088 6570 ], 6571 [ 6572 13, 6573 1152 6574 ], 6575 [ 6576 13, 6577 1216 6578 ], 6579 [ 6580 10, 6581 64 6582 ], 6583 [ 6584 10, 6585 64 6586 ], 6587 [ 6588 10, 6589 64 6590 ], 6591 [ 6592 10, 6593 64 6594 ], 6595 [ 6596 10, 6597 64 6598 ], 6599 [ 6600 10, 6601 64 6602 ], 6603 [ 6604 10, 6605 64 6606 ], 6607 [ 6608 10, 6609 64 6610 ] 6611 ]; 6612 var blackTable2 = [ 6613 [ 6614 8, 6615 13 6616 ], 6617 [ 6618 8, 6619 13 6620 ], 6621 [ 6622 8, 6623 13 6624 ], 6625 [ 6626 8, 6627 13 6628 ], 6629 [ 6630 8, 6631 13 6632 ], 6633 [ 6634 8, 6635 13 6636 ], 6637 [ 6638 8, 6639 13 6640 ], 6641 [ 6642 8, 6643 13 6644 ], 6645 [ 6646 8, 6647 13 6648 ], 6649 [ 6650 8, 6651 13 6652 ], 6653 [ 6654 8, 6655 13 6656 ], 6657 [ 6658 8, 6659 13 6660 ], 6661 [ 6662 8, 6663 13 6664 ], 6665 [ 6666 8, 6667 13 6668 ], 6669 [ 6670 8, 6671 13 6672 ], 6673 [ 6674 8, 6675 13 6676 ], 6677 [ 6678 11, 6679 23 6680 ], 6681 [ 6682 11, 6683 23 6684 ], 6685 [ 6686 12, 6687 50 6688 ], 6689 [ 6690 12, 6691 51 6692 ], 6693 [ 6694 12, 6695 44 6696 ], 6697 [ 6698 12, 6699 45 6700 ], 6701 [ 6702 12, 6703 46 6704 ], 6705 [ 6706 12, 6707 47 6708 ], 6709 [ 6710 12, 6711 57 6712 ], 6713 [ 6714 12, 6715 58 6716 ], 6717 [ 6718 12, 6719 61 6720 ], 6721 [ 6722 12, 6723 256 6724 ], 6725 [ 6726 10, 6727 16 6728 ], 6729 [ 6730 10, 6731 16 6732 ], 6733 [ 6734 10, 6735 16 6736 ], 6737 [ 6738 10, 6739 16 6740 ], 6741 [ 6742 10, 6743 17 6744 ], 6745 [ 6746 10, 6747 17 6748 ], 6749 [ 6750 10, 6751 17 6752 ], 6753 [ 6754 10, 6755 17 6756 ], 6757 [ 6758 12, 6759 48 6760 ], 6761 [ 6762 12, 6763 49 6764 ], 6765 [ 6766 12, 6767 62 6768 ], 6769 [ 6770 12, 6771 63 6772 ], 6773 [ 6774 12, 6775 30 6776 ], 6777 [ 6778 12, 6779 31 6780 ], 6781 [ 6782 12, 6783 32 6784 ], 6785 [ 6786 12, 6787 33 6788 ], 6789 [ 6790 12, 6791 40 6792 ], 6793 [ 6794 12, 6795 41 6796 ], 6797 [ 6798 11, 6799 22 6800 ], 6801 [ 6802 11, 6803 22 6804 ], 6805 [ 6806 8, 6807 14 6808 ], 6809 [ 6810 8, 6811 14 6812 ], 6813 [ 6814 8, 6815 14 6816 ], 6817 [ 6818 8, 6819 14 6820 ], 6821 [ 6822 8, 6823 14 6824 ], 6825 [ 6826 8, 6827 14 6828 ], 6829 [ 6830 8, 6831 14 6832 ], 6833 [ 6834 8, 6835 14 6836 ], 6837 [ 6838 8, 6839 14 6840 ], 6841 [ 6842 8, 6843 14 6844 ], 6845 [ 6846 8, 6847 14 6848 ], 6849 [ 6850 8, 6851 14 6852 ], 6853 [ 6854 8, 6855 14 6856 ], 6857 [ 6858 8, 6859 14 6860 ], 6861 [ 6862 8, 6863 14 6864 ], 6865 [ 6866 8, 6867 14 6868 ], 6869 [ 6870 7, 6871 10 6872 ], 6873 [ 6874 7, 6875 10 6876 ], 6877 [ 6878 7, 6879 10 6880 ], 6881 [ 6882 7, 6883 10 6884 ], 6885 [ 6886 7, 6887 10 6888 ], 6889 [ 6890 7, 6891 10 6892 ], 6893 [ 6894 7, 6895 10 6896 ], 6897 [ 6898 7, 6899 10 6900 ], 6901 [ 6902 7, 6903 10 6904 ], 6905 [ 6906 7, 6907 10 6908 ], 6909 [ 6910 7, 6911 10 6912 ], 6913 [ 6914 7, 6915 10 6916 ], 6917 [ 6918 7, 6919 10 6920 ], 6921 [ 6922 7, 6923 10 6924 ], 6925 [ 6926 7, 6927 10 6928 ], 6929 [ 6930 7, 6931 10 6932 ], 6933 [ 6934 7, 6935 10 6936 ], 6937 [ 6938 7, 6939 10 6940 ], 6941 [ 6942 7, 6943 10 6944 ], 6945 [ 6946 7, 6947 10 6948 ], 6949 [ 6950 7, 6951 10 6952 ], 6953 [ 6954 7, 6955 10 6956 ], 6957 [ 6958 7, 6959 10 6960 ], 6961 [ 6962 7, 6963 10 6964 ], 6965 [ 6966 7, 6967 10 6968 ], 6969 [ 6970 7, 6971 10 6972 ], 6973 [ 6974 7, 6975 10 6976 ], 6977 [ 6978 7, 6979 10 6980 ], 6981 [ 6982 7, 6983 10 6984 ], 6985 [ 6986 7, 6987 10 6988 ], 6989 [ 6990 7, 6991 10 6992 ], 6993 [ 6994 7, 6995 10 6996 ], 6997 [ 6998 7, 6999 11 7000 ], 7001 [ 7002 7, 7003 11 7004 ], 7005 [ 7006 7, 7007 11 7008 ], 7009 [ 7010 7, 7011 11 7012 ], 7013 [ 7014 7, 7015 11 7016 ], 7017 [ 7018 7, 7019 11 7020 ], 7021 [ 7022 7, 7023 11 7024 ], 7025 [ 7026 7, 7027 11 7028 ], 7029 [ 7030 7, 7031 11 7032 ], 7033 [ 7034 7, 7035 11 7036 ], 7037 [ 7038 7, 7039 11 7040 ], 7041 [ 7042 7, 7043 11 7044 ], 7045 [ 7046 7, 7047 11 7048 ], 7049 [ 7050 7, 7051 11 7052 ], 7053 [ 7054 7, 7055 11 7056 ], 7057 [ 7058 7, 7059 11 7060 ], 7061 [ 7062 7, 7063 11 7064 ], 7065 [ 7066 7, 7067 11 7068 ], 7069 [ 7070 7, 7071 11 7072 ], 7073 [ 7074 7, 7075 11 7076 ], 7077 [ 7078 7, 7079 11 7080 ], 7081 [ 7082 7, 7083 11 7084 ], 7085 [ 7086 7, 7087 11 7088 ], 7089 [ 7090 7, 7091 11 7092 ], 7093 [ 7094 7, 7095 11 7096 ], 7097 [ 7098 7, 7099 11 7100 ], 7101 [ 7102 7, 7103 11 7104 ], 7105 [ 7106 7, 7107 11 7108 ], 7109 [ 7110 7, 7111 11 7112 ], 7113 [ 7114 7, 7115 11 7116 ], 7117 [ 7118 7, 7119 11 7120 ], 7121 [ 7122 7, 7123 11 7124 ], 7125 [ 7126 9, 7127 15 7128 ], 7129 [ 7130 9, 7131 15 7132 ], 7133 [ 7134 9, 7135 15 7136 ], 7137 [ 7138 9, 7139 15 7140 ], 7141 [ 7142 9, 7143 15 7144 ], 7145 [ 7146 9, 7147 15 7148 ], 7149 [ 7150 9, 7151 15 7152 ], 7153 [ 7154 9, 7155 15 7156 ], 7157 [ 7158 12, 7159 128 7160 ], 7161 [ 7162 12, 7163 192 7164 ], 7165 [ 7166 12, 7167 26 7168 ], 7169 [ 7170 12, 7171 27 7172 ], 7173 [ 7174 12, 7175 28 7176 ], 7177 [ 7178 12, 7179 29 7180 ], 7181 [ 7182 11, 7183 19 7184 ], 7185 [ 7186 11, 7187 19 7188 ], 7189 [ 7190 11, 7191 20 7192 ], 7193 [ 7194 11, 7195 20 7196 ], 7197 [ 7198 12, 7199 34 7200 ], 7201 [ 7202 12, 7203 35 7204 ], 7205 [ 7206 12, 7207 36 7208 ], 7209 [ 7210 12, 7211 37 7212 ], 7213 [ 7214 12, 7215 38 7216 ], 7217 [ 7218 12, 7219 39 7220 ], 7221 [ 7222 11, 7223 21 7224 ], 7225 [ 7226 11, 7227 21 7228 ], 7229 [ 7230 12, 7231 42 7232 ], 7233 [ 7234 12, 7235 43 7236 ], 7237 [ 7238 10, 7239 0 7240 ], 7241 [ 7242 10, 7243 0 7244 ], 7245 [ 7246 10, 7247 0 7248 ], 7249 [ 7250 10, 7251 0 7252 ], 7253 [ 7254 7, 7255 12 7256 ], 7257 [ 7258 7, 7259 12 7260 ], 7261 [ 7262 7, 7263 12 7264 ], 7265 [ 7266 7, 7267 12 7268 ], 7269 [ 7270 7, 7271 12 7272 ], 7273 [ 7274 7, 7275 12 7276 ], 7277 [ 7278 7, 7279 12 7280 ], 7281 [ 7282 7, 7283 12 7284 ], 7285 [ 7286 7, 7287 12 7288 ], 7289 [ 7290 7, 7291 12 7292 ], 7293 [ 7294 7, 7295 12 7296 ], 7297 [ 7298 7, 7299 12 7300 ], 7301 [ 7302 7, 7303 12 7304 ], 7305 [ 7306 7, 7307 12 7308 ], 7309 [ 7310 7, 7311 12 7312 ], 7313 [ 7314 7, 7315 12 7316 ], 7317 [ 7318 7, 7319 12 7320 ], 7321 [ 7322 7, 7323 12 7324 ], 7325 [ 7326 7, 7327 12 7328 ], 7329 [ 7330 7, 7331 12 7332 ], 7333 [ 7334 7, 7335 12 7336 ], 7337 [ 7338 7, 7339 12 7340 ], 7341 [ 7342 7, 7343 12 7344 ], 7345 [ 7346 7, 7347 12 7348 ], 7349 [ 7350 7, 7351 12 7352 ], 7353 [ 7354 7, 7355 12 7356 ], 7357 [ 7358 7, 7359 12 7360 ], 7361 [ 7362 7, 7363 12 7364 ], 7365 [ 7366 7, 7367 12 7368 ], 7369 [ 7370 7, 7371 12 7372 ], 7373 [ 7374 7, 7375 12 7376 ], 7377 [ 7378 7, 7379 12 7380 ] 7381 ]; 7382 var blackTable3 = [ 7383 [ 7384 -1, 7385 -1 7386 ], 7387 [ 7388 -1, 7389 -1 7390 ], 7391 [ 7392 -1, 7393 -1 7394 ], 7395 [ 7396 -1, 7397 -1 7398 ], 7399 [ 7400 6, 7401 9 7402 ], 7403 [ 7404 6, 7405 8 7406 ], 7407 [ 7408 5, 7409 7 7410 ], 7411 [ 7412 5, 7413 7 7414 ], 7415 [ 7416 4, 7417 6 7418 ], 7419 [ 7420 4, 7421 6 7422 ], 7423 [ 7424 4, 7425 6 7426 ], 7427 [ 7428 4, 7429 6 7430 ], 7431 [ 7432 4, 7433 5 7434 ], 7435 [ 7436 4, 7437 5 7438 ], 7439 [ 7440 4, 7441 5 7442 ], 7443 [ 7444 4, 7445 5 7446 ], 7447 [ 7448 3, 7449 1 7450 ], 7451 [ 7452 3, 7453 1 7454 ], 7455 [ 7456 3, 7457 1 7458 ], 7459 [ 7460 3, 7461 1 7462 ], 7463 [ 7464 3, 7465 1 7466 ], 7467 [ 7468 3, 7469 1 7470 ], 7471 [ 7472 3, 7473 1 7474 ], 7475 [ 7476 3, 7477 1 7478 ], 7479 [ 7480 3, 7481 4 7482 ], 7483 [ 7484 3, 7485 4 7486 ], 7487 [ 7488 3, 7489 4 7490 ], 7491 [ 7492 3, 7493 4 7494 ], 7495 [ 7496 3, 7497 4 7498 ], 7499 [ 7500 3, 7501 4 7502 ], 7503 [ 7504 3, 7505 4 7506 ], 7507 [ 7508 3, 7509 4 7510 ], 7511 [ 7512 2, 7513 3 7514 ], 7515 [ 7516 2, 7517 3 7518 ], 7519 [ 7520 2, 7521 3 7522 ], 7523 [ 7524 2, 7525 3 7526 ], 7527 [ 7528 2, 7529 3 7530 ], 7531 [ 7532 2, 7533 3 7534 ], 7535 [ 7536 2, 7537 3 7538 ], 7539 [ 7540 2, 7541 3 7542 ], 7543 [ 7544 2, 7545 3 7546 ], 7547 [ 7548 2, 7549 3 7550 ], 7551 [ 7552 2, 7553 3 7554 ], 7555 [ 7556 2, 7557 3 7558 ], 7559 [ 7560 2, 7561 3 7562 ], 7563 [ 7564 2, 7565 3 7566 ], 7567 [ 7568 2, 7569 3 7570 ], 7571 [ 7572 2, 7573 3 7574 ], 7575 [ 7576 2, 7577 2 7578 ], 7579 [ 7580 2, 7581 2 7582 ], 7583 [ 7584 2, 7585 2 7586 ], 7587 [ 7588 2, 7589 2 7590 ], 7591 [ 7592 2, 7593 2 7594 ], 7595 [ 7596 2, 7597 2 7598 ], 7599 [ 7600 2, 7601 2 7602 ], 7603 [ 7604 2, 7605 2 7606 ], 7607 [ 7608 2, 7609 2 7610 ], 7611 [ 7612 2, 7613 2 7614 ], 7615 [ 7616 2, 7617 2 7618 ], 7619 [ 7620 2, 7621 2 7622 ], 7623 [ 7624 2, 7625 2 7626 ], 7627 [ 7628 2, 7629 2 7630 ], 7631 [ 7632 2, 7633 2 7634 ], 7635 [ 7636 2, 7637 2 7638 ] 7639 ]; 7640 function CCITTFaxStream(str, maybeLength, params) { 7641 this.str = str; 7642 this.dict = str.dict; 7643 params = params || Dict.empty; 7644 this.encoding = params.get('K') || 0; 7645 this.eoline = params.get('EndOfLine') || false; 7646 this.byteAlign = params.get('EncodedByteAlign') || false; 7647 this.columns = params.get('Columns') || 1728; 7648 this.rows = params.get('Rows') || 0; 7649 var eoblock = params.get('EndOfBlock'); 7650 if (eoblock === null || eoblock === undefined) { 7651 eoblock = true; 7652 } 7653 this.eoblock = eoblock; 7654 this.black = params.get('BlackIs1') || false; 7655 this.codingLine = new Uint32Array(this.columns + 1); 7656 this.refLine = new Uint32Array(this.columns + 2); 7657 this.codingLine[0] = this.columns; 7658 this.codingPos = 0; 7659 this.row = 0; 7660 this.nextLine2D = this.encoding < 0; 7661 this.inputBits = 0; 7662 this.inputBuf = 0; 7663 this.outputBits = 0; 7664 var code1; 7665 while ((code1 = this.lookBits(12)) === 0) { 7666 this.eatBits(1); 7667 } 7668 if (code1 === 1) { 7669 this.eatBits(12); 7670 } 7671 if (this.encoding > 0) { 7672 this.nextLine2D = !this.lookBits(1); 7673 this.eatBits(1); 7674 } 7675 DecodeStream.call(this, maybeLength); 7676 } 7677 CCITTFaxStream.prototype = Object.create(DecodeStream.prototype); 7678 CCITTFaxStream.prototype.readBlock = function CCITTFaxStream_readBlock() { 7679 while (!this.eof) { 7680 var c = this.lookChar(); 7681 this.ensureBuffer(this.bufferLength + 1); 7682 this.buffer[this.bufferLength++] = c; 7683 } 7684 }; 7685 CCITTFaxStream.prototype.addPixels = function ccittFaxStreamAddPixels(a1, blackPixels) {
vendor: 4,151 bytes, lines 7686-7830
7686 var codingLine = this.codingLine; 7687 var codingPos = this.codingPos; 7688 if (a1 > codingLine[codingPos]) { 7689 if (a1 > this.columns) { 7690 info('row is wrong length'); 7691 this.err = true; 7692 a1 = this.columns; 7693 } 7694 if (codingPos & 1 ^ blackPixels) { 7695 ++codingPos; 7696 } 7697 codingLine[codingPos] = a1; 7698 } 7699 this.codingPos = codingPos; 7700 }; 7701 CCITTFaxStream.prototype.addPixelsNeg = function ccittFaxStreamAddPixelsNeg(a1, blackPixels) { 7702 var codingLine = this.codingLine; 7703 var codingPos = this.codingPos; 7704 if (a1 > codingLine[codingPos]) { 7705 if (a1 > this.columns) { 7706 info('row is wrong length'); 7707 this.err = true; 7708 a1 = this.columns; 7709 } 7710 if (codingPos & 1 ^ blackPixels) { 7711 ++codingPos; 7712 } 7713 codingLine[codingPos] = a1; 7714 } else if (a1 < codingLine[codingPos]) { 7715 if (a1 < 0) { 7716 info('invalid code'); 7717 this.err = true; 7718 a1 = 0; 7719 } 7720 while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { 7721 --codingPos; 7722 } 7723 codingLine[codingPos] = a1; 7724 } 7725 this.codingPos = codingPos; 7726 }; 7727 CCITTFaxStream.prototype.lookChar = function CCITTFaxStream_lookChar() { 7728 var refLine = this.refLine; 7729 var codingLine = this.codingLine; 7730 var columns = this.columns; 7731 var refPos, blackPixels, bits, i; 7732 if (this.outputBits === 0) { 7733 if (this.eof) { 7734 return null; 7735 } 7736 this.err = false; 7737 var code1, code2, code3; 7738 if (this.nextLine2D) { 7739 for (i = 0; codingLine[i] < columns; ++i) { 7740 refLine[i] = codingLine[i]; 7741 } 7742 refLine[i++] = columns; 7743 refLine[i] = columns; 7744 codingLine[0] = 0; 7745 this.codingPos = 0; 7746 refPos = 0; 7747 blackPixels = 0; 7748 while (codingLine[this.codingPos] < columns) { 7749 code1 = this.getTwoDimCode(); 7750 switch (code1) { 7751 case twoDimPass: 7752 this.addPixels(refLine[refPos + 1], blackPixels); 7753 if (refLine[refPos + 1] < columns) { 7754 refPos += 2; 7755 } 7756 break; 7757 case twoDimHoriz: 7758 code1 = code2 = 0; 7759 if (blackPixels) { 7760 do { 7761 code1 += code3 = this.getBlackCode(); 7762 } while (code3 >= 64); 7763 do { 7764 code2 += code3 = this.getWhiteCode(); 7765 } while (code3 >= 64); 7766 } else { 7767 do { 7768 code1 += code3 = this.getWhiteCode(); 7769 } while (code3 >= 64); 7770 do { 7771 code2 += code3 = this.getBlackCode(); 7772 } while (code3 >= 64); 7773 } 7774 this.addPixels(codingLine[this.codingPos] + code1, blackPixels); 7775 if (codingLine[this.codingPos] < columns) { 7776 this.addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1); 7777 } 7778 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7779 refPos += 2; 7780 } 7781 break; 7782 case twoDimVertR3: 7783 this.addPixels(refLine[refPos] + 3, blackPixels); 7784 blackPixels ^= 1; 7785 if (codingLine[this.codingPos] < columns) { 7786 ++refPos; 7787 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7788 refPos += 2; 7789 } 7790 } 7791 break; 7792 case twoDimVertR2: 7793 this.addPixels(refLine[refPos] + 2, blackPixels); 7794 blackPixels ^= 1; 7795 if (codingLine[this.codingPos] < columns) { 7796 ++refPos; 7797 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7798 refPos += 2; 7799 } 7800 } 7801 break; 7802 case twoDimVertR1: 7803 this.addPixels(refLine[refPos] + 1, blackPixels); 7804 blackPixels ^= 1; 7805 if (codingLine[this.codingPos] < columns) { 7806 ++refPos; 7807 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7808 refPos += 2; 7809 } 7810 } 7811 break; 7812 case twoDimVert0: 7813 this.addPixels(refLine[refPos], blackPixels); 7814 blackPixels ^= 1; 7815 if (codingLine[this.codingPos] < columns) { 7816 ++refPos; 7817 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7818 refPos += 2; 7819 } 7820 } 7821 break; 7822 case twoDimVertL3: 7823 this.addPixelsNeg(refLine[refPos] - 3, blackPixels); 7824 blackPixels ^= 1; 7825 if (codingLine[this.codingPos] < columns) { 7826 if (refPos > 0) { 7827 --refPos; 7828 } else { 7829 ++refPos; 7830 }
vendor: 4,096 bytes, lines 7831-7998
7831 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7832 refPos += 2; 7833 } 7834 } 7835 break; 7836 case twoDimVertL2: 7837 this.addPixelsNeg(refLine[refPos] - 2, blackPixels); 7838 blackPixels ^= 1; 7839 if (codingLine[this.codingPos] < columns) { 7840 if (refPos > 0) { 7841 --refPos; 7842 } else { 7843 ++refPos; 7844 } 7845 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7846 refPos += 2; 7847 } 7848 } 7849 break; 7850 case twoDimVertL1: 7851 this.addPixelsNeg(refLine[refPos] - 1, blackPixels); 7852 blackPixels ^= 1; 7853 if (codingLine[this.codingPos] < columns) { 7854 if (refPos > 0) { 7855 --refPos; 7856 } else { 7857 ++refPos; 7858 } 7859 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 7860 refPos += 2; 7861 } 7862 } 7863 break; 7864 case ccittEOF: 7865 this.addPixels(columns, 0); 7866 this.eof = true; 7867 break; 7868 default: 7869 info('bad 2d code'); 7870 this.addPixels(columns, 0); 7871 this.err = true; 7872 } 7873 } 7874 } else { 7875 codingLine[0] = 0; 7876 this.codingPos = 0; 7877 blackPixels = 0; 7878 while (codingLine[this.codingPos] < columns) { 7879 code1 = 0; 7880 if (blackPixels) { 7881 do { 7882 code1 += code3 = this.getBlackCode(); 7883 } while (code3 >= 64); 7884 } else { 7885 do { 7886 code1 += code3 = this.getWhiteCode(); 7887 } while (code3 >= 64); 7888 } 7889 this.addPixels(codingLine[this.codingPos] + code1, blackPixels); 7890 blackPixels ^= 1; 7891 } 7892 } 7893 var gotEOL = false; 7894 if (this.byteAlign) { 7895 this.inputBits &= ~7; 7896 } 7897 if (!this.eoblock && this.row === this.rows - 1) { 7898 this.eof = true; 7899 } else { 7900 code1 = this.lookBits(12); 7901 if (this.eoline) { 7902 while (code1 !== ccittEOF && code1 !== 1) { 7903 this.eatBits(1); 7904 code1 = this.lookBits(12); 7905 } 7906 } else { 7907 while (code1 === 0) { 7908 this.eatBits(1); 7909 code1 = this.lookBits(12); 7910 } 7911 } 7912 if (code1 === 1) { 7913 this.eatBits(12); 7914 gotEOL = true; 7915 } else if (code1 === ccittEOF) { 7916 this.eof = true; 7917 } 7918 } 7919 if (!this.eof && this.encoding > 0) { 7920 this.nextLine2D = !this.lookBits(1); 7921 this.eatBits(1); 7922 } 7923 if (this.eoblock && gotEOL && this.byteAlign) { 7924 code1 = this.lookBits(12); 7925 if (code1 === 1) { 7926 this.eatBits(12); 7927 if (this.encoding > 0) { 7928 this.lookBits(1); 7929 this.eatBits(1); 7930 } 7931 if (this.encoding >= 0) { 7932 for (i = 0; i < 4; ++i) { 7933 code1 = this.lookBits(12); 7934 if (code1 !== 1) { 7935 info('bad rtc code: ' + code1); 7936 } 7937 this.eatBits(12); 7938 if (this.encoding > 0) { 7939 this.lookBits(1); 7940 this.eatBits(1); 7941 } 7942 } 7943 } 7944 this.eof = true; 7945 } 7946 } else if (this.err && this.eoline) { 7947 while (true) { 7948 code1 = this.lookBits(13); 7949 if (code1 === ccittEOF) { 7950 this.eof = true; 7951 return null; 7952 } 7953 if (code1 >> 1 === 1) { 7954 break; 7955 } 7956 this.eatBits(1); 7957 } 7958 this.eatBits(12); 7959 if (this.encoding > 0) { 7960 this.eatBits(1); 7961 this.nextLine2D = !(code1 & 1); 7962 } 7963 } 7964 if (codingLine[0] > 0) { 7965 this.outputBits = codingLine[this.codingPos = 0]; 7966 } else { 7967 this.outputBits = codingLine[this.codingPos = 1]; 7968 } 7969 this.row++; 7970 } 7971 var c; 7972 if (this.outputBits >= 8) { 7973 c = this.codingPos & 1 ? 0 : 0xFF; 7974 this.outputBits -= 8; 7975 if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { 7976 this.codingPos++; 7977 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 7978 } 7979 } else { 7980 bits = 8; 7981 c = 0; 7982 do { 7983 if (this.outputBits > bits) { 7984 c <<= bits; 7985 if (!(this.codingPos & 1)) { 7986 c |= 0xFF >> 8 - bits; 7987 } 7988 this.outputBits -= bits; 7989 bits = 0; 7990 } else { 7991 c <<= this.outputBits; 7992 if (!(this.codingPos & 1)) { 7993 c |= 0xFF >> 8 - this.outputBits; 7994 } 7995 bits -= this.outputBits; 7996 this.outputBits = 0; 7997 if (codingLine[this.codingPos] < columns) { 7998 this.codingPos++;
vendor: 21,593 bytes, lines 7999-8744
7999 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 8000 } else if (bits > 0) { 8001 c <<= bits; 8002 bits = 0; 8003 } 8004 } 8005 } while (bits); 8006 } 8007 if (this.black) { 8008 c ^= 0xFF; 8009 } 8010 return c; 8011 }; 8012 CCITTFaxStream.prototype.findTableCode = function ccittFaxStreamFindTableCode(start, end, table, limit) { 8013 var limitValue = limit || 0; 8014 for (var i = start; i <= end; ++i) { 8015 var code = this.lookBits(i); 8016 if (code === ccittEOF) { 8017 return [ 8018 true, 8019 1, 8020 false 8021 ]; 8022 } 8023 if (i < end) { 8024 code <<= end - i; 8025 } 8026 if (!limitValue || code >= limitValue) { 8027 var p = table[code - limitValue]; 8028 if (p[0] === i) { 8029 this.eatBits(i); 8030 return [ 8031 true, 8032 p[1], 8033 true 8034 ]; 8035 } 8036 } 8037 } 8038 return [ 8039 false, 8040 0, 8041 false 8042 ]; 8043 }; 8044 CCITTFaxStream.prototype.getTwoDimCode = function ccittFaxStreamGetTwoDimCode() { 8045 var code = 0; 8046 var p; 8047 if (this.eoblock) { 8048 code = this.lookBits(7); 8049 p = twoDimTable[code]; 8050 if (p && p[0] > 0) { 8051 this.eatBits(p[0]); 8052 return p[1]; 8053 } 8054 } else { 8055 var result = this.findTableCode(1, 7, twoDimTable); 8056 if (result[0] && result[2]) { 8057 return result[1]; 8058 } 8059 } 8060 info('Bad two dim code'); 8061 return ccittEOF; 8062 }; 8063 CCITTFaxStream.prototype.getWhiteCode = function ccittFaxStreamGetWhiteCode() { 8064 var code = 0; 8065 var p; 8066 if (this.eoblock) { 8067 code = this.lookBits(12); 8068 if (code === ccittEOF) { 8069 return 1; 8070 } 8071 if (code >> 5 === 0) { 8072 p = whiteTable1[code]; 8073 } else { 8074 p = whiteTable2[code >> 3]; 8075 } 8076 if (p[0] > 0) { 8077 this.eatBits(p[0]); 8078 return p[1]; 8079 } 8080 } else { 8081 var result = this.findTableCode(1, 9, whiteTable2); 8082 if (result[0]) { 8083 return result[1]; 8084 } 8085 result = this.findTableCode(11, 12, whiteTable1); 8086 if (result[0]) { 8087 return result[1]; 8088 } 8089 } 8090 info('bad white code'); 8091 this.eatBits(1); 8092 return 1; 8093 }; 8094 CCITTFaxStream.prototype.getBlackCode = function ccittFaxStreamGetBlackCode() { 8095 var code, p; 8096 if (this.eoblock) { 8097 code = this.lookBits(13); 8098 if (code === ccittEOF) { 8099 return 1; 8100 } 8101 if (code >> 7 === 0) { 8102 p = blackTable1[code]; 8103 } else if (code >> 9 === 0 && code >> 7 !== 0) { 8104 p = blackTable2[(code >> 1) - 64]; 8105 } else { 8106 p = blackTable3[code >> 7]; 8107 } 8108 if (p[0] > 0) { 8109 this.eatBits(p[0]); 8110 return p[1]; 8111 } 8112 } else { 8113 var result = this.findTableCode(2, 6, blackTable3); 8114 if (result[0]) { 8115 return result[1]; 8116 } 8117 result = this.findTableCode(7, 12, blackTable2, 64); 8118 if (result[0]) { 8119 return result[1]; 8120 } 8121 result = this.findTableCode(10, 13, blackTable1); 8122 if (result[0]) { 8123 return result[1]; 8124 } 8125 } 8126 info('bad black code'); 8127 this.eatBits(1); 8128 return 1; 8129 }; 8130 CCITTFaxStream.prototype.lookBits = function CCITTFaxStream_lookBits(n) { 8131 var c; 8132 while (this.inputBits < n) { 8133 if ((c = this.str.getByte()) === -1) { 8134 if (this.inputBits === 0) { 8135 return ccittEOF; 8136 } 8137 return this.inputBuf << n - this.inputBits & 0xFFFF >> 16 - n; 8138 } 8139 this.inputBuf = this.inputBuf << 8 | c; 8140 this.inputBits += 8; 8141 } 8142 return this.inputBuf >> this.inputBits - n & 0xFFFF >> 16 - n; 8143 }; 8144 CCITTFaxStream.prototype.eatBits = function CCITTFaxStream_eatBits(n) { 8145 if ((this.inputBits -= n) < 0) { 8146 this.inputBits = 0; 8147 } 8148 }; 8149 return CCITTFaxStream; 8150}(); 8151var LZWStream = function LZWStreamClosure() { 8152 function LZWStream(str, maybeLength, earlyChange) { 8153 this.str = str; 8154 this.dict = str.dict; 8155 this.cachedData = 0; 8156 this.bitsCached = 0; 8157 var maxLzwDictionarySize = 4096; 8158 var lzwState = { 8159 earlyChange: earlyChange, 8160 codeLength: 9, 8161 nextCode: 258, 8162 dictionaryValues: new Uint8Array(maxLzwDictionarySize), 8163 dictionaryLengths: new Uint16Array(maxLzwDictionarySize), 8164 dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), 8165 currentSequence: new Uint8Array(maxLzwDictionarySize), 8166 currentSequenceLength: 0 8167 }; 8168 for (var i = 0; i < 256; ++i) { 8169 lzwState.dictionaryValues[i] = i; 8170 lzwState.dictionaryLengths[i] = 1; 8171 } 8172 this.lzwState = lzwState; 8173 DecodeStream.call(this, maybeLength); 8174 } 8175 LZWStream.prototype = Object.create(DecodeStream.prototype); 8176 LZWStream.prototype.readBits = function LZWStream_readBits(n) { 8177 var bitsCached = this.bitsCached; 8178 var cachedData = this.cachedData; 8179 while (bitsCached < n) { 8180 var c = this.str.getByte(); 8181 if (c === -1) { 8182 this.eof = true; 8183 return null; 8184 } 8185 cachedData = cachedData << 8 | c; 8186 bitsCached += 8; 8187 } 8188 this.bitsCached = bitsCached -= n; 8189 this.cachedData = cachedData; 8190 this.lastCode = null; 8191 return cachedData >>> bitsCached & (1 << n) - 1; 8192 }; 8193 LZWStream.prototype.readBlock = function LZWStream_readBlock() { 8194 var blockSize = 512; 8195 var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize; 8196 var i, j, q; 8197 var lzwState = this.lzwState; 8198 if (!lzwState) { 8199 return; 8200 } 8201 var earlyChange = lzwState.earlyChange; 8202 var nextCode = lzwState.nextCode; 8203 var dictionaryValues = lzwState.dictionaryValues; 8204 var dictionaryLengths = lzwState.dictionaryLengths; 8205 var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; 8206 var codeLength = lzwState.codeLength; 8207 var prevCode = lzwState.prevCode; 8208 var currentSequence = lzwState.currentSequence; 8209 var currentSequenceLength = lzwState.currentSequenceLength; 8210 var decodedLength = 0; 8211 var currentBufferLength = this.bufferLength; 8212 var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 8213 for (i = 0; i < blockSize; i++) { 8214 var code = this.readBits(codeLength); 8215 var hasPrev = currentSequenceLength > 0; 8216 if (code < 256) { 8217 currentSequence[0] = code; 8218 currentSequenceLength = 1; 8219 } else if (code >= 258) { 8220 if (code < nextCode) { 8221 currentSequenceLength = dictionaryLengths[code]; 8222 for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { 8223 currentSequence[j] = dictionaryValues[q]; 8224 q = dictionaryPrevCodes[q]; 8225 } 8226 } else { 8227 currentSequence[currentSequenceLength++] = currentSequence[0]; 8228 } 8229 } else if (code === 256) { 8230 codeLength = 9; 8231 nextCode = 258; 8232 currentSequenceLength = 0; 8233 continue; 8234 } else { 8235 this.eof = true; 8236 delete this.lzwState; 8237 break; 8238 } 8239 if (hasPrev) { 8240 dictionaryPrevCodes[nextCode] = prevCode; 8241 dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; 8242 dictionaryValues[nextCode] = currentSequence[0]; 8243 nextCode++; 8244 codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0; 8245 } 8246 prevCode = code; 8247 decodedLength += currentSequenceLength; 8248 if (estimatedDecodedSize < decodedLength) { 8249 do { 8250 estimatedDecodedSize += decodedSizeDelta; 8251 } while (estimatedDecodedSize < decodedLength); 8252 buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 8253 } 8254 for (j = 0; j < currentSequenceLength; j++) { 8255 buffer[currentBufferLength++] = currentSequence[j]; 8256 } 8257 } 8258 lzwState.nextCode = nextCode; 8259 lzwState.codeLength = codeLength; 8260 lzwState.prevCode = prevCode; 8261 lzwState.currentSequenceLength = currentSequenceLength; 8262 this.bufferLength = currentBufferLength; 8263 }; 8264 return LZWStream; 8265}(); 8266var NullStream = function NullStreamClosure() { 8267 function NullStream() { 8268 Stream.call(this, new Uint8Array(0)); 8269 } 8270 NullStream.prototype = Stream.prototype; 8271 return NullStream; 8272}(); 8273exports.Ascii85Stream = Ascii85Stream; 8274exports.AsciiHexStream = AsciiHexStream; 8275exports.CCITTFaxStream = CCITTFaxStream; 8276exports.DecryptStream = DecryptStream; 8277exports.DecodeStream = DecodeStream; 8278exports.FlateStream = FlateStream; 8279exports.Jbig2Stream = Jbig2Stream; 8280exports.JpegStream = JpegStream; 8281exports.JpxStream = JpxStream; 8282exports.NullStream = NullStream; 8283exports.PredictorStream = PredictorStream; 8284exports.RunLengthStream = RunLengthStream; 8285exports.Stream = Stream; 8286exports.StreamsSequenceStream = StreamsSequenceStream; 8287exports.StringStream = StringStream; 8288exports.LZWStream = LZWStream; 8289 8290/***/ }), 8291/* 3 */ 8292/***/ (function(module, exports, __w_pdfjs_require__) { 8293 8294"use strict"; 8295 8296var sharedUtil = __w_pdfjs_require__(0); 8297var corePrimitives = __w_pdfjs_require__(1); 8298var coreFunction = __w_pdfjs_require__(6); 8299var error = sharedUtil.error; 8300var info = sharedUtil.info; 8301var isArray = sharedUtil.isArray; 8302var isString = sharedUtil.isString; 8303var shadow = sharedUtil.shadow; 8304var warn = sharedUtil.warn; 8305var isDict = corePrimitives.isDict; 8306var isName = corePrimitives.isName; 8307var isStream = corePrimitives.isStream; 8308var PDFFunction = coreFunction.PDFFunction; 8309var ColorSpace = function ColorSpaceClosure() { 8310 function resizeRgbImage(src, bpc, w1, h1, w2, h2, alpha01, dest) { 8311 var COMPONENTS = 3; 8312 alpha01 = alpha01 !== 1 ? 0 : alpha01; 8313 var xRatio = w1 / w2; 8314 var yRatio = h1 / h2; 8315 var i, j, py, newIndex = 0, oldIndex; 8316 var xScaled = new Uint16Array(w2); 8317 var w1Scanline = w1 * COMPONENTS; 8318 for (i = 0; i < w2; i++) { 8319 xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; 8320 } 8321 for (i = 0; i < h2; i++) { 8322 py = Math.floor(i * yRatio) * w1Scanline; 8323 for (j = 0; j < w2; j++) { 8324 oldIndex = py + xScaled[j]; 8325 dest[newIndex++] = src[oldIndex++]; 8326 dest[newIndex++] = src[oldIndex++]; 8327 dest[newIndex++] = src[oldIndex++]; 8328 newIndex += alpha01; 8329 } 8330 } 8331 } 8332 function ColorSpace() { 8333 error('should not call ColorSpace constructor'); 8334 } 8335 ColorSpace.prototype = { 8336 getRgb: function ColorSpace_getRgb(src, srcOffset) { 8337 var rgb = new Uint8Array(3); 8338 this.getRgbItem(src, srcOffset, rgb, 0); 8339 return rgb; 8340 }, 8341 getRgbItem: function ColorSpace_getRgbItem(src, srcOffset, dest, destOffset) { 8342 error('Should not call ColorSpace.getRgbItem'); 8343 }, 8344 getRgbBuffer: function ColorSpace_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 8345 error('Should not call ColorSpace.getRgbBuffer'); 8346 }, 8347 getOutputLength: function ColorSpace_getOutputLength(inputLength, alpha01) { 8348 error('Should not call ColorSpace.getOutputLength'); 8349 }, 8350 isPassthrough: function ColorSpace_isPassthrough(bits) { 8351 return false; 8352 }, 8353 fillRgb: function ColorSpace_fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { 8354 var count = originalWidth * originalHeight; 8355 var rgbBuf = null; 8356 var numComponentColors = 1 << bpc; 8357 var needsResizing = originalHeight !== height || originalWidth !== width; 8358 var i, ii; 8359 if (this.isPassthrough(bpc)) { 8360 rgbBuf = comps; 8361 } else if (this.numComps === 1 && count > numComponentColors && this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { 8362 var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors); 8363 var key; 8364 for (i = 0; i < numComponentColors; i++) { 8365 allColors[i] = i; 8366 } 8367 var colorMap = new Uint8Array(numComponentColors * 3); 8368 this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); 8369 var destPos, rgbPos; 8370 if (!needsResizing) { 8371 destPos = 0; 8372 for (i = 0; i < count; ++i) { 8373 key = comps[i] * 3; 8374 dest[destPos++] = colorMap[key]; 8375 dest[destPos++] = colorMap[key + 1]; 8376 dest[destPos++] = colorMap[key + 2]; 8377 destPos += alpha01; 8378 } 8379 } else { 8380 rgbBuf = new Uint8Array(count * 3); 8381 rgbPos = 0; 8382 for (i = 0; i < count; ++i) { 8383 key = comps[i] * 3; 8384 rgbBuf[rgbPos++] = colorMap[key]; 8385 rgbBuf[rgbPos++] = colorMap[key + 1]; 8386 rgbBuf[rgbPos++] = colorMap[key + 2]; 8387 } 8388 } 8389 } else { 8390 if (!needsResizing) { 8391 this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); 8392 } else { 8393 rgbBuf = new Uint8Array(count * 3); 8394 this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); 8395 } 8396 } 8397 if (rgbBuf) { 8398 if (needsResizing) { 8399 resizeRgbImage(rgbBuf, bpc, originalWidth, originalHeight, width, height, alpha01, dest); 8400 } else { 8401 rgbPos = 0; 8402 destPos = 0; 8403 for (i = 0, ii = width * actualHeight; i < ii; i++) { 8404 dest[destPos++] = rgbBuf[rgbPos++]; 8405 dest[destPos++] = rgbBuf[rgbPos++]; 8406 dest[destPos++] = rgbBuf[rgbPos++]; 8407 destPos += alpha01; 8408 } 8409 } 8410 } 8411 }, 8412 usesZeroToOneRange: true 8413 }; 8414 ColorSpace.parse = function ColorSpace_parse(cs, xref, res) { 8415 var IR = ColorSpace.parseToIR(cs, xref, res); 8416 if (IR instanceof AlternateCS) { 8417 return IR; 8418 } 8419 return ColorSpace.fromIR(IR); 8420 }; 8421 ColorSpace.fromIR = function ColorSpace_fromIR(IR) { 8422 var name = isArray(IR) ? IR[0] : IR; 8423 var whitePoint, blackPoint, gamma; 8424 switch (name) { 8425 case 'DeviceGrayCS': 8426 return this.singletons.gray; 8427 case 'DeviceRgbCS': 8428 return this.singletons.rgb; 8429 case 'DeviceCmykCS': 8430 return this.singletons.cmyk; 8431 case 'CalGrayCS': 8432 whitePoint = IR[1]; 8433 blackPoint = IR[2]; 8434 gamma = IR[3]; 8435 return new CalGrayCS(whitePoint, blackPoint, gamma); 8436 case 'CalRGBCS': 8437 whitePoint = IR[1]; 8438 blackPoint = IR[2]; 8439 gamma = IR[3]; 8440 var matrix = IR[4]; 8441 return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); 8442 case 'PatternCS': 8443 var basePatternCS = IR[1]; 8444 if (basePatternCS) { 8445 basePatternCS = ColorSpace.fromIR(basePatternCS); 8446 } 8447 return new PatternCS(basePatternCS); 8448 case 'IndexedCS': 8449 var baseIndexedCS = IR[1]; 8450 var hiVal = IR[2]; 8451 var lookup = IR[3]; 8452 return new IndexedCS(ColorSpace.fromIR(baseIndexedCS), hiVal, lookup); 8453 case 'AlternateCS': 8454 var numComps = IR[1]; 8455 var alt = IR[2]; 8456 var tintFnIR = IR[3]; 8457 return new AlternateCS(numComps, ColorSpace.fromIR(alt), PDFFunction.fromIR(tintFnIR)); 8458 case 'LabCS': 8459 whitePoint = IR[1]; 8460 blackPoint = IR[2]; 8461 var range = IR[3]; 8462 return new LabCS(whitePoint, blackPoint, range); 8463 default: 8464 error('Unknown name ' + name); 8465 } 8466 return null; 8467 }; 8468 ColorSpace.parseToIR = function ColorSpace_parseToIR(cs, xref, res) { 8469 if (isName(cs)) { 8470 var colorSpaces = res.get('ColorSpace'); 8471 if (isDict(colorSpaces)) { 8472 var refcs = colorSpaces.get(cs.name); 8473 if (refcs) { 8474 cs = refcs; 8475 } 8476 } 8477 } 8478 cs = xref.fetchIfRef(cs); 8479 if (isName(cs)) { 8480 switch (cs.name) { 8481 case 'DeviceGray': 8482 case 'G': 8483 return 'DeviceGrayCS'; 8484 case 'DeviceRGB': 8485 case 'RGB': 8486 return 'DeviceRgbCS'; 8487 case 'DeviceCMYK': 8488 case 'CMYK': 8489 return 'DeviceCmykCS'; 8490 case 'Pattern': 8491 return [ 8492 'PatternCS', 8493 null 8494 ]; 8495 default: 8496 error('unrecognized colorspace ' + cs.name); 8497 } 8498 } else if (isArray(cs)) { 8499 var mode = xref.fetchIfRef(cs[0]).name; 8500 var numComps, params, alt, whitePoint, blackPoint, gamma; 8501 switch (mode) { 8502 case 'DeviceGray': 8503 case 'G': 8504 return 'DeviceGrayCS'; 8505 case 'DeviceRGB': 8506 case 'RGB': 8507 return 'DeviceRgbCS'; 8508 case 'DeviceCMYK': 8509 case 'CMYK': 8510 return 'DeviceCmykCS'; 8511 case 'CalGray': 8512 params = xref.fetchIfRef(cs[1]); 8513 whitePoint = params.getArray('WhitePoint'); 8514 blackPoint = params.getArray('BlackPoint'); 8515 gamma = params.get('Gamma'); 8516 return [ 8517 'CalGrayCS', 8518 whitePoint, 8519 blackPoint, 8520 gamma 8521 ]; 8522 case 'CalRGB': 8523 params = xref.fetchIfRef(cs[1]); 8524 whitePoint = params.getArray('WhitePoint'); 8525 blackPoint = params.getArray('BlackPoint'); 8526 gamma = params.getArray('Gamma'); 8527 var matrix = params.getArray('Matrix'); 8528 return [ 8529 'CalRGBCS', 8530 whitePoint, 8531 blackPoint, 8532 gamma, 8533 matrix 8534 ]; 8535 case 'ICCBased': 8536 var stream = xref.fetchIfRef(cs[1]); 8537 var dict = stream.dict; 8538 numComps = dict.get('N'); 8539 alt = dict.get('Alternate'); 8540 if (alt) { 8541 var altIR = ColorSpace.parseToIR(alt, xref, res); 8542 var altCS = ColorSpace.fromIR(altIR); 8543 if (altCS.numComps === numComps) { 8544 return altIR; 8545 } 8546 warn('ICCBased color space: Ignoring incorrect /Alternate entry.'); 8547 } 8548 if (numComps === 1) { 8549 return 'DeviceGrayCS'; 8550 } else if (numComps === 3) { 8551 return 'DeviceRgbCS'; 8552 } else if (numComps === 4) { 8553 return 'DeviceCmykCS'; 8554 } 8555 break; 8556 case 'Pattern': 8557 var basePatternCS = cs[1] || null; 8558 if (basePatternCS) { 8559 basePatternCS = ColorSpace.parseToIR(basePatternCS, xref, res); 8560 } 8561 return [ 8562 'PatternCS', 8563 basePatternCS 8564 ]; 8565 case 'Indexed': 8566 case 'I': 8567 var baseIndexedCS = ColorSpace.parseToIR(cs[1], xref, res); 8568 var hiVal = xref.fetchIfRef(cs[2]) + 1; 8569 var lookup = xref.fetchIfRef(cs[3]); 8570 if (isStream(lookup)) { 8571 lookup = lookup.getBytes(); 8572 } 8573 return [ 8574 'IndexedCS', 8575 baseIndexedCS, 8576 hiVal, 8577 lookup 8578 ]; 8579 case 'Separation': 8580 case 'DeviceN': 8581 var name = xref.fetchIfRef(cs[1]); 8582 numComps = isArray(name) ? name.length : 1; 8583 alt = ColorSpace.parseToIR(cs[2], xref, res); 8584 var tintFnIR = PDFFunction.getIR(xref, xref.fetchIfRef(cs[3])); 8585 return [ 8586 'AlternateCS', 8587 numComps, 8588 alt, 8589 tintFnIR 8590 ]; 8591 case 'Lab': 8592 params = xref.fetchIfRef(cs[1]); 8593 whitePoint = params.getArray('WhitePoint'); 8594 blackPoint = params.getArray('BlackPoint'); 8595 var range = params.getArray('Range'); 8596 return [ 8597 'LabCS', 8598 whitePoint, 8599 blackPoint, 8600 range 8601 ]; 8602 default: 8603 error('unimplemented color space object "' + mode + '"'); 8604 } 8605 } else { 8606 error('unrecognized color space object: "' + cs + '"'); 8607 } 8608 return null; 8609 }; 8610 ColorSpace.isDefaultDecode = function ColorSpace_isDefaultDecode(decode, n) { 8611 if (!isArray(decode)) { 8612 return true; 8613 } 8614 if (n * 2 !== decode.length) { 8615 warn('The decode map is not the correct length'); 8616 return true; 8617 } 8618 for (var i = 0, ii = decode.length; i < ii; i += 2) { 8619 if (decode[i] !== 0 || decode[i + 1] !== 1) { 8620 return false; 8621 } 8622 } 8623 return true; 8624 }; 8625 ColorSpace.singletons = { 8626 get gray() { 8627 return shadow(this, 'gray', new DeviceGrayCS()); 8628 }, 8629 get rgb() { 8630 return shadow(this, 'rgb', new DeviceRgbCS()); 8631 }, 8632 get cmyk() { 8633 return shadow(this, 'cmyk', new DeviceCmykCS()); 8634 } 8635 }; 8636 return ColorSpace; 8637}(); 8638var AlternateCS = function AlternateCSClosure() { 8639 function AlternateCS(numComps, base, tintFn) { 8640 this.name = 'Alternate'; 8641 this.numComps = numComps; 8642 this.defaultColor = new Float32Array(numComps); 8643 for (var i = 0; i < numComps; ++i) { 8644 this.defaultColor[i] = 1; 8645 } 8646 this.base = base; 8647 this.tintFn = tintFn; 8648 this.tmpBuf = new Float32Array(base.numComps); 8649 } 8650 AlternateCS.prototype = { 8651 getRgb: ColorSpace.prototype.getRgb, 8652 getRgbItem: function AlternateCS_getRgbItem(src, srcOffset, dest, destOffset) { 8653 var tmpBuf = this.tmpBuf; 8654 this.tintFn(src, srcOffset, tmpBuf, 0); 8655 this.base.getRgbItem(tmpBuf, 0, dest, destOffset); 8656 }, 8657 getRgbBuffer: function AlternateCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 8658 var tintFn = this.tintFn; 8659 var base = this.base; 8660 var scale = 1 / ((1 << bits) - 1); 8661 var baseNumComps = base.numComps; 8662 var usesZeroToOneRange = base.usesZeroToOneRange; 8663 var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; 8664 var pos = isPassthrough ? destOffset : 0; 8665 var baseBuf = isPassthrough ? dest : new Uint8Array(baseNumComps * count); 8666 var numComps = this.numComps; 8667 var scaled = new Float32Array(numComps); 8668 var tinted = new Float32Array(baseNumComps); 8669 var i, j; 8670 for (i = 0; i < count; i++) { 8671 for (j = 0; j < numComps; j++) { 8672 scaled[j] = src[srcOffset++] * scale; 8673 } 8674 tintFn(scaled, 0, tinted, 0); 8675 if (usesZeroToOneRange) { 8676 for (j = 0; j < baseNumComps; j++) { 8677 baseBuf[pos++] = tinted[j] * 255; 8678 } 8679 } else { 8680 base.getRgbItem(tinted, 0, baseBuf, pos); 8681 pos += baseNumComps; 8682 } 8683 } 8684 if (!isPassthrough) { 8685 base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); 8686 } 8687 }, 8688 getOutputLength: function AlternateCS_getOutputLength(inputLength, alpha01) { 8689 return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01); 8690 }, 8691 isPassthrough: ColorSpace.prototype.isPassthrough, 8692 fillRgb: ColorSpace.prototype.fillRgb, 8693 isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { 8694 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 8695 }, 8696 usesZeroToOneRange: true 8697 }; 8698 return AlternateCS; 8699}(); 8700var PatternCS = function PatternCSClosure() { 8701 function PatternCS(baseCS) { 8702 this.name = 'Pattern'; 8703 this.base = baseCS; 8704 } 8705 PatternCS.prototype = {}; 8706 return PatternCS; 8707}(); 8708var IndexedCS = function IndexedCSClosure() { 8709 function IndexedCS(base, highVal, lookup) { 8710 this.name = 'Indexed'; 8711 this.numComps = 1; 8712 this.defaultColor = new Uint8Array(this.numComps); 8713 this.base = base; 8714 this.highVal = highVal; 8715 var baseNumComps = base.numComps; 8716 var length = baseNumComps * highVal; 8717 if (isStream(lookup)) { 8718 this.lookup = new Uint8Array(length); 8719 var bytes = lookup.getBytes(length); 8720 this.lookup.set(bytes); 8721 } else if (isString(lookup)) { 8722 this.lookup = new Uint8Array(length); 8723 for (var i = 0; i < length; ++i) { 8724 this.lookup[i] = lookup.charCodeAt(i); 8725 } 8726 } else if (lookup instanceof Uint8Array || lookup instanceof Array) { 8727 this.lookup = lookup; 8728 } else { 8729 error('Unrecognized lookup table: ' + lookup); 8730 } 8731 } 8732 IndexedCS.prototype = { 8733 getRgb: ColorSpace.prototype.getRgb, 8734 getRgbItem: function IndexedCS_getRgbItem(src, srcOffset, dest, destOffset) { 8735 var numComps = this.base.numComps; 8736 var start = src[srcOffset] * numComps; 8737 this.base.getRgbItem(this.lookup, start, dest, destOffset); 8738 }, 8739 getRgbBuffer: function IndexedCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 8740 var base = this.base; 8741 var numComps = base.numComps; 8742 var outputDelta = base.getOutputLength(numComps, alpha01); 8743 var lookup = this.lookup; 8744 for (var i = 0; i < count; ++i) {
vendor: 4,811 bytes, lines 8745-8851
8745 var lookupPos = src[srcOffset++] * numComps; 8746 base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); 8747 destOffset += outputDelta; 8748 } 8749 }, 8750 getOutputLength: function IndexedCS_getOutputLength(inputLength, alpha01) { 8751 return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); 8752 }, 8753 isPassthrough: ColorSpace.prototype.isPassthrough, 8754 fillRgb: ColorSpace.prototype.fillRgb, 8755 isDefaultDecode: function IndexedCS_isDefaultDecode(decodeMap) { 8756 return true; 8757 }, 8758 usesZeroToOneRange: true 8759 }; 8760 return IndexedCS; 8761}(); 8762var DeviceGrayCS = function DeviceGrayCSClosure() { 8763 function DeviceGrayCS() { 8764 this.name = 'DeviceGray'; 8765 this.numComps = 1; 8766 this.defaultColor = new Float32Array(this.numComps); 8767 } 8768 DeviceGrayCS.prototype = { 8769 getRgb: ColorSpace.prototype.getRgb, 8770 getRgbItem: function DeviceGrayCS_getRgbItem(src, srcOffset, dest, destOffset) { 8771 var c = src[srcOffset] * 255 | 0; 8772 c = c < 0 ? 0 : c > 255 ? 255 : c; 8773 dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; 8774 }, 8775 getRgbBuffer: function DeviceGrayCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 8776 var scale = 255 / ((1 << bits) - 1); 8777 var j = srcOffset, q = destOffset; 8778 for (var i = 0; i < count; ++i) { 8779 var c = scale * src[j++] | 0; 8780 dest[q++] = c; 8781 dest[q++] = c; 8782 dest[q++] = c; 8783 q += alpha01; 8784 } 8785 }, 8786 getOutputLength: function DeviceGrayCS_getOutputLength(inputLength, alpha01) { 8787 return inputLength * (3 + alpha01); 8788 }, 8789 isPassthrough: ColorSpace.prototype.isPassthrough, 8790 fillRgb: ColorSpace.prototype.fillRgb, 8791 isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { 8792 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 8793 }, 8794 usesZeroToOneRange: true 8795 }; 8796 return DeviceGrayCS; 8797}(); 8798var DeviceRgbCS = function DeviceRgbCSClosure() { 8799 function DeviceRgbCS() { 8800 this.name = 'DeviceRGB'; 8801 this.numComps = 3; 8802 this.defaultColor = new Float32Array(this.numComps); 8803 } 8804 DeviceRgbCS.prototype = { 8805 getRgb: ColorSpace.prototype.getRgb, 8806 getRgbItem: function DeviceRgbCS_getRgbItem(src, srcOffset, dest, destOffset) { 8807 var r = src[srcOffset] * 255 | 0; 8808 var g = src[srcOffset + 1] * 255 | 0; 8809 var b = src[srcOffset + 2] * 255 | 0; 8810 dest[destOffset] = r < 0 ? 0 : r > 255 ? 255 : r; 8811 dest[destOffset + 1] = g < 0 ? 0 : g > 255 ? 255 : g; 8812 dest[destOffset + 2] = b < 0 ? 0 : b > 255 ? 255 : b; 8813 }, 8814 getRgbBuffer: function DeviceRgbCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 8815 if (bits === 8 && alpha01 === 0) { 8816 dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); 8817 return; 8818 } 8819 var scale = 255 / ((1 << bits) - 1); 8820 var j = srcOffset, q = destOffset; 8821 for (var i = 0; i < count; ++i) { 8822 dest[q++] = scale * src[j++] | 0; 8823 dest[q++] = scale * src[j++] | 0; 8824 dest[q++] = scale * src[j++] | 0; 8825 q += alpha01; 8826 } 8827 }, 8828 getOutputLength: function DeviceRgbCS_getOutputLength(inputLength, alpha01) { 8829 return inputLength * (3 + alpha01) / 3 | 0; 8830 }, 8831 isPassthrough: function DeviceRgbCS_isPassthrough(bits) { 8832 return bits === 8; 8833 }, 8834 fillRgb: ColorSpace.prototype.fillRgb, 8835 isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { 8836 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 8837 }, 8838 usesZeroToOneRange: true 8839 }; 8840 return DeviceRgbCS; 8841}(); 8842var DeviceCmykCS = function DeviceCmykCSClosure() { 8843 function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { 8844 var c = src[srcOffset + 0] * srcScale; 8845 var m = src[srcOffset + 1] * srcScale; 8846 var y = src[srcOffset + 2] * srcScale; 8847 var k = src[srcOffset + 3] * srcScale; 8848 var r = c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k + -285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y + -17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + k * (-21.86122147463605 * k - 189.48180835922747) + 255 | 0; 8849 var g = c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k + -79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + k * (-20.737325471181034 * k - 187.80453709719578) + 255 | 0; 8850 var b = c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k + -14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k + -193.58209356861505) + k * (-22.33816807309886 * k - 180.12613974708367) + 255 | 0; 8851 dest[destOffset] = r >
vendor: 14,499 bytes, lines 8851-9294
8851 255 ? 255 : r < 0 ? 0 : r; 8852 dest[destOffset + 1] = g > 255 ? 255 : g < 0 ? 0 : g; 8853 dest[destOffset + 2] = b > 255 ? 255 : b < 0 ? 0 : b; 8854 } 8855 function DeviceCmykCS() { 8856 this.name = 'DeviceCMYK'; 8857 this.numComps = 4; 8858 this.defaultColor = new Float32Array(this.numComps); 8859 this.defaultColor[3] = 1; 8860 } 8861 DeviceCmykCS.prototype = { 8862 getRgb: ColorSpace.prototype.getRgb, 8863 getRgbItem: function DeviceCmykCS_getRgbItem(src, srcOffset, dest, destOffset) { 8864 convertToRgb(src, srcOffset, 1, dest, destOffset); 8865 }, 8866 getRgbBuffer: function DeviceCmykCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 8867 var scale = 1 / ((1 << bits) - 1); 8868 for (var i = 0; i < count; i++) { 8869 convertToRgb(src, srcOffset, scale, dest, destOffset); 8870 srcOffset += 4; 8871 destOffset += 3 + alpha01; 8872 } 8873 }, 8874 getOutputLength: function DeviceCmykCS_getOutputLength(inputLength, alpha01) { 8875 return inputLength / 4 * (3 + alpha01) | 0; 8876 }, 8877 isPassthrough: ColorSpace.prototype.isPassthrough, 8878 fillRgb: ColorSpace.prototype.fillRgb, 8879 isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { 8880 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 8881 }, 8882 usesZeroToOneRange: true 8883 }; 8884 return DeviceCmykCS; 8885}(); 8886var CalGrayCS = function CalGrayCSClosure() { 8887 function CalGrayCS(whitePoint, blackPoint, gamma) { 8888 this.name = 'CalGray'; 8889 this.numComps = 1; 8890 this.defaultColor = new Float32Array(this.numComps); 8891 if (!whitePoint) { 8892 error('WhitePoint missing - required for color space CalGray'); 8893 } 8894 blackPoint = blackPoint || [ 8895 0, 8896 0, 8897 0 8898 ]; 8899 gamma = gamma || 1; 8900 this.XW = whitePoint[0]; 8901 this.YW = whitePoint[1]; 8902 this.ZW = whitePoint[2]; 8903 this.XB = blackPoint[0]; 8904 this.YB = blackPoint[1]; 8905 this.ZB = blackPoint[2]; 8906 this.G = gamma; 8907 if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { 8908 error('Invalid WhitePoint components for ' + this.name + ', no fallback available'); 8909 } 8910 if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { 8911 info('Invalid BlackPoint for ' + this.name + ', falling back to default'); 8912 this.XB = this.YB = this.ZB = 0; 8913 } 8914 if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { 8915 warn(this.name + ', BlackPoint: XB: ' + this.XB + ', YB: ' + this.YB + ', ZB: ' + this.ZB + ', only default values are supported.'); 8916 } 8917 if (this.G < 1) { 8918 info('Invalid Gamma: ' + this.G + ' for ' + this.name + ', falling back to default'); 8919 this.G = 1; 8920 } 8921 } 8922 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 8923 var A = src[srcOffset] * scale; 8924 var AG = Math.pow(A, cs.G); 8925 var L = cs.YW * AG; 8926 var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0) | 0; 8927 dest[destOffset] = val; 8928 dest[destOffset + 1] = val; 8929 dest[destOffset + 2] = val; 8930 } 8931 CalGrayCS.prototype = { 8932 getRgb: ColorSpace.prototype.getRgb, 8933 getRgbItem: function CalGrayCS_getRgbItem(src, srcOffset, dest, destOffset) { 8934 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 8935 }, 8936 getRgbBuffer: function CalGrayCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 8937 var scale = 1 / ((1 << bits) - 1); 8938 for (var i = 0; i < count; ++i) { 8939 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 8940 srcOffset += 1; 8941 destOffset += 3 + alpha01; 8942 } 8943 }, 8944 getOutputLength: function CalGrayCS_getOutputLength(inputLength, alpha01) { 8945 return inputLength * (3 + alpha01); 8946 }, 8947 isPassthrough: ColorSpace.prototype.isPassthrough, 8948 fillRgb: ColorSpace.prototype.fillRgb, 8949 isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { 8950 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 8951 }, 8952 usesZeroToOneRange: true 8953 }; 8954 return CalGrayCS; 8955}(); 8956var CalRGBCS = function CalRGBCSClosure() { 8957 var BRADFORD_SCALE_MATRIX = new Float32Array([ 8958 0.8951, 8959 0.2664, 8960 -0.1614, 8961 -0.7502, 8962 1.7135, 8963 0.0367, 8964 0.0389, 8965 -0.0685, 8966 1.0296 8967 ]); 8968 var BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([ 8969 0.9869929, 8970 -0.1470543, 8971 0.1599627, 8972 0.4323053, 8973 0.5183603, 8974 0.0492912, 8975 -0.0085287, 8976 0.0400428, 8977 0.9684867 8978 ]); 8979 var SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([ 8980 3.2404542, 8981 -1.5371385, 8982 -0.4985314, 8983 -0.9692660, 8984 1.8760108, 8985 0.0415560, 8986 0.0556434, 8987 -0.2040259, 8988 1.0572252 8989 ]); 8990 var FLAT_WHITEPOINT_MATRIX = new Float32Array([ 8991 1, 8992 1, 8993 1 8994 ]); 8995 var tempNormalizeMatrix = new Float32Array(3); 8996 var tempConvertMatrix1 = new Float32Array(3); 8997 var tempConvertMatrix2 = new Float32Array(3); 8998 var DECODE_L_CONSTANT = Math.pow((8 + 16) / 116, 3) / 8.0; 8999 function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { 9000 this.name = 'CalRGB'; 9001 this.numComps = 3; 9002 this.defaultColor = new Float32Array(this.numComps); 9003 if (!whitePoint) { 9004 error('WhitePoint missing - required for color space CalRGB'); 9005 } 9006 blackPoint = blackPoint || new Float32Array(3); 9007 gamma = gamma || new Float32Array([ 9008 1, 9009 1, 9010 1 9011 ]); 9012 matrix = matrix || new Float32Array([ 9013 1, 9014 0, 9015 0, 9016 0, 9017 1, 9018 0, 9019 0, 9020 0, 9021 1 9022 ]); 9023 var XW = whitePoint[0]; 9024 var YW = whitePoint[1]; 9025 var ZW = whitePoint[2]; 9026 this.whitePoint = whitePoint; 9027 var XB = blackPoint[0]; 9028 var YB = blackPoint[1]; 9029 var ZB = blackPoint[2]; 9030 this.blackPoint = blackPoint; 9031 this.GR = gamma[0]; 9032 this.GG = gamma[1]; 9033 this.GB = gamma[2]; 9034 this.MXA = matrix[0]; 9035 this.MYA = matrix[1]; 9036 this.MZA = matrix[2]; 9037 this.MXB = matrix[3]; 9038 this.MYB = matrix[4]; 9039 this.MZB = matrix[5]; 9040 this.MXC = matrix[6]; 9041 this.MYC = matrix[7]; 9042 this.MZC = matrix[8]; 9043 if (XW < 0 || ZW < 0 || YW !== 1) { 9044 error('Invalid WhitePoint components for ' + this.name + ', no fallback available'); 9045 } 9046 if (XB < 0 || YB < 0 || ZB < 0) { 9047 info('Invalid BlackPoint for ' + this.name + ' [' + XB + ', ' + YB + ', ' + ZB + '], falling back to default'); 9048 this.blackPoint = new Float32Array(3); 9049 } 9050 if (this.GR < 0 || this.GG < 0 || this.GB < 0) { 9051 info('Invalid Gamma [' + this.GR + ', ' + this.GG + ', ' + this.GB + '] for ' + this.name + ', falling back to default'); 9052 this.GR = this.GG = this.GB = 1; 9053 } 9054 if (this.MXA < 0 || this.MYA < 0 || this.MZA < 0 || this.MXB < 0 || this.MYB < 0 || this.MZB < 0 || this.MXC < 0 || this.MYC < 0 || this.MZC < 0) { 9055 info('Invalid Matrix for ' + this.name + ' [' + this.MXA + ', ' + this.MYA + ', ' + this.MZA + this.MXB + ', ' + this.MYB + ', ' + this.MZB + this.MXC + ', ' + this.MYC + ', ' + this.MZC + '], falling back to default'); 9056 this.MXA = this.MYB = this.MZC = 1; 9057 this.MXB = this.MYA = this.MZA = this.MXC = this.MYC = this.MZB = 0; 9058 } 9059 } 9060 function matrixProduct(a, b, result) { 9061 result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; 9062 result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; 9063 result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; 9064 } 9065 function convertToFlat(sourceWhitePoint, LMS, result) { 9066 result[0] = LMS[0] * 1 / sourceWhitePoint[0]; 9067 result[1] = LMS[1] * 1 / sourceWhitePoint[1]; 9068 result[2] = LMS[2] * 1 / sourceWhitePoint[2]; 9069 } 9070 function convertToD65(sourceWhitePoint, LMS, result) { 9071 var D65X = 0.95047; 9072 var D65Y = 1; 9073 var D65Z = 1.08883; 9074 result[0] = LMS[0] * D65X / sourceWhitePoint[0]; 9075 result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; 9076 result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; 9077 } 9078 function sRGBTransferFunction(color) { 9079 if (color <= 0.0031308) { 9080 return adjustToRange(0, 1, 12.92 * color); 9081 } 9082 return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); 9083 } 9084 function adjustToRange(min, max, value) { 9085 return Math.max(min, Math.min(max, value)); 9086 } 9087 function decodeL(L) { 9088 if (L < 0) { 9089 return -decodeL(-L); 9090 } 9091 if (L > 8.0) { 9092 return Math.pow((L + 16) / 116, 3); 9093 } 9094 return L * DECODE_L_CONSTANT; 9095 } 9096 function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { 9097 if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) { 9098 result[0] = XYZ_Flat[0]; 9099 result[1] = XYZ_Flat[1]; 9100 result[2] = XYZ_Flat[2]; 9101 return; 9102 } 9103 var zeroDecodeL = decodeL(0); 9104 var X_DST = zeroDecodeL; 9105 var X_SRC = decodeL(sourceBlackPoint[0]); 9106 var Y_DST = zeroDecodeL; 9107 var Y_SRC = decodeL(sourceBlackPoint[1]); 9108 var Z_DST = zeroDecodeL; 9109 var Z_SRC = decodeL(sourceBlackPoint[2]); 9110 var X_Scale = (1 - X_DST) / (1 - X_SRC); 9111 var X_Offset = 1 - X_Scale; 9112 var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); 9113 var Y_Offset = 1 - Y_Scale; 9114 var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); 9115 var Z_Offset = 1 - Z_Scale; 9116 result[0] = XYZ_Flat[0] * X_Scale + X_Offset; 9117 result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; 9118 result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; 9119 } 9120 function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { 9121 if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { 9122 result[0] = XYZ_In[0]; 9123 result[1] = XYZ_In[1]; 9124 result[2] = XYZ_In[2]; 9125 return; 9126 } 9127 var LMS = result; 9128 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 9129 var LMS_Flat = tempNormalizeMatrix; 9130 convertToFlat(sourceWhitePoint, LMS, LMS_Flat); 9131 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); 9132 } 9133 function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { 9134 var LMS = result; 9135 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 9136 var LMS_D65 = tempNormalizeMatrix; 9137 convertToD65(sourceWhitePoint, LMS, LMS_D65); 9138 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); 9139 } 9140 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 9141 var A = adjustToRange(0, 1, src[srcOffset] * scale); 9142 var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); 9143 var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); 9144 var AGR = Math.pow(A, cs.GR); 9145 var BGG = Math.pow(B, cs.GG); 9146 var CGB = Math.pow(C, cs.GB); 9147 var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; 9148 var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; 9149 var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; 9150 var XYZ = tempConvertMatrix1; 9151 XYZ[0] = X; 9152 XYZ[1] = Y; 9153 XYZ[2] = Z; 9154 var XYZ_Flat = tempConvertMatrix2; 9155 normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); 9156 var XYZ_Black = tempConvertMatrix1; 9157 compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); 9158 var XYZ_D65 = tempConvertMatrix2; 9159 normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); 9160 var SRGB = tempConvertMatrix1; 9161 matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); 9162 var sR = sRGBTransferFunction(SRGB[0]); 9163 var sG = sRGBTransferFunction(SRGB[1]); 9164 var sB = sRGBTransferFunction(SRGB[2]); 9165 dest[destOffset] = Math.round(sR * 255); 9166 dest[destOffset + 1] = Math.round(sG * 255); 9167 dest[destOffset + 2] = Math.round(sB * 255); 9168 } 9169 CalRGBCS.prototype = { 9170 getRgb: function CalRGBCS_getRgb(src, srcOffset) { 9171 var rgb = new Uint8Array(3); 9172 this.getRgbItem(src, srcOffset, rgb, 0); 9173 return rgb; 9174 }, 9175 getRgbItem: function CalRGBCS_getRgbItem(src, srcOffset, dest, destOffset) { 9176 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 9177 }, 9178 getRgbBuffer: function CalRGBCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 9179 var scale = 1 / ((1 << bits) - 1); 9180 for (var i = 0; i < count; ++i) { 9181 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 9182 srcOffset += 3; 9183 destOffset += 3 + alpha01; 9184 } 9185 }, 9186 getOutputLength: function CalRGBCS_getOutputLength(inputLength, alpha01) { 9187 return inputLength * (3 + alpha01) / 3 | 0; 9188 }, 9189 isPassthrough: ColorSpace.prototype.isPassthrough, 9190 fillRgb: ColorSpace.prototype.fillRgb, 9191 isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { 9192 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 9193 }, 9194 usesZeroToOneRange: true 9195 }; 9196 return CalRGBCS; 9197}(); 9198var LabCS = function LabCSClosure() { 9199 function LabCS(whitePoint, blackPoint, range) { 9200 this.name = 'Lab'; 9201 this.numComps = 3; 9202 this.defaultColor = new Float32Array(this.numComps); 9203 if (!whitePoint) { 9204 error('WhitePoint missing - required for color space Lab'); 9205 } 9206 blackPoint = blackPoint || [ 9207 0, 9208 0, 9209 0 9210 ]; 9211 range = range || [ 9212 -100, 9213 100, 9214 -100, 9215 100 9216 ]; 9217 this.XW = whitePoint[0]; 9218 this.YW = whitePoint[1]; 9219 this.ZW = whitePoint[2]; 9220 this.amin = range[0]; 9221 this.amax = range[1]; 9222 this.bmin = range[2]; 9223 this.bmax = range[3]; 9224 this.XB = blackPoint[0]; 9225 this.YB = blackPoint[1]; 9226 this.ZB = blackPoint[2]; 9227 if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { 9228 error('Invalid WhitePoint components, no fallback available'); 9229 } 9230 if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { 9231 info('Invalid BlackPoint, falling back to default'); 9232 this.XB = this.YB = this.ZB = 0; 9233 } 9234 if (this.amin > this.amax || this.bmin > this.bmax) { 9235 info('Invalid Range, falling back to defaults'); 9236 this.amin = -100; 9237 this.amax = 100; 9238 this.bmin = -100; 9239 this.bmax = 100; 9240 } 9241 } 9242 function fn_g(x) { 9243 var result; 9244 if (x >= 6 / 29) { 9245 result = x * x * x; 9246 } else { 9247 result = 108 / 841 * (x - 4 / 29); 9248 } 9249 return result; 9250 } 9251 function decode(value, high1, low2, high2) { 9252 return low2 + value * (high2 - low2) / high1; 9253 } 9254 function convertToRgb(cs, src, srcOffset, maxVal, dest, destOffset) { 9255 var Ls = src[srcOffset]; 9256 var as = src[srcOffset + 1]; 9257 var bs = src[srcOffset + 2]; 9258 if (maxVal !== false) { 9259 Ls = decode(Ls, maxVal, 0, 100); 9260 as = decode(as, maxVal, cs.amin, cs.amax); 9261 bs = decode(bs, maxVal, cs.bmin, cs.bmax); 9262 } 9263 as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; 9264 bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; 9265 var M = (Ls + 16) / 116; 9266 var L = M + as / 500; 9267 var N = M - bs / 200; 9268 var X = cs.XW * fn_g(L); 9269 var Y = cs.YW * fn_g(M); 9270 var Z = cs.ZW * fn_g(N); 9271 var r, g, b; 9272 if (cs.ZW < 1) { 9273 r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; 9274 g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; 9275 b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; 9276 } else { 9277 r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; 9278 g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; 9279 b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; 9280 } 9281 dest[destOffset] = r <= 0 ? 0 : r >= 1 ? 255 : Math.sqrt(r) * 255 | 0; 9282 dest[destOffset + 1] = g <= 0 ? 0 : g >= 1 ? 255 : Math.sqrt(g) * 255 | 0; 9283 dest[destOffset + 2] = b <= 0 ? 0 : b >= 1 ? 255 : Math.sqrt(b) * 255 | 0; 9284 } 9285 LabCS.prototype = { 9286 getRgb: ColorSpace.prototype.getRgb, 9287 getRgbItem: function LabCS_getRgbItem(src, srcOffset, dest, destOffset) { 9288 convertToRgb(this, src, srcOffset, false, dest, destOffset); 9289 }, 9290 getRgbBuffer: function LabCS_getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 9291 var maxVal = (1 << bits) - 1; 9292 for (var i = 0; i < count; i++) { 9293 convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); 9294 srcOffset += 3;
9295 destOffset += 3 + alpha01; 9296 } 9297 }, 9298 getOutputLength: function LabCS_getOutputLength(inputLength, alpha01) { 9299 return inputLength * (3 + alpha01) / 3 | 0; 9300 }, 9301 isPassthrough: ColorSpace.prototype.isPassthrough, 9302 fillRgb: ColorSpace.prototype.fillRgb, 9303 isDefaultDecode: function LabCS_isDefaultDecode(decodeMap) { 9304 return true; 9305 }, 9306 usesZeroToOneRange: false 9307 }; 9308 return LabCS; 9309}(); 9310exports.ColorSpace = ColorSpace; 9311 9312/***/ }), 9313/* 4 */ 9314/***/ (function(module, exports, __w_pdfjs_require__) { 9315 9316"use strict"; 9317 9318var ExpertEncoding = [ 9319 '', 9320 '', 9321 '', 9322 '', 9323 '', 9324 '', 9325 '', 9326 '', 9327 '', 9328 '', 9329 '', 9330 '', 9331 '', 9332 '', 9333 '', 9334 '', 9335 '', 9336 '', 9337 '', 9338 '', 9339 '', 9340 '', 9341 '', 9342 '', 9343 '', 9344 '', 9345 '', 9346 '', 9347 '', 9348 '', 9349 '', 9350 '', 9351 'space', 9352 'exclamsmall', 9353 'Hungarumlautsmall', 9354 '', 9355 'dollaroldstyle', 9356 'dollarsuperior', 9357 'ampersandsmall', 9358 'Acutesmall', 9359 'parenleftsuperior', 9360 'parenrightsuperior', 9361 'twodotenleader', 9362 'onedotenleader', 9363 'comma', 9364 'hyphen', 9365 'period', 9366 'fraction', 9367 'zerooldstyle', 9368 'oneoldstyle', 9369 'twooldstyle', 9370 'threeoldstyle', 9371 'fouroldstyle', 9372 'fiveoldstyle', 9373 'sixoldstyle', 9374 'sevenoldstyle', 9375 'eightoldstyle', 9376 'nineoldstyle', 9377 'colon', 9378 'semicolon', 9379 'commasuperior', 9380 'threequartersemdash', 9381 'periodsuperior', 9382 'questionsmall', 9383 '', 9384 'asuperior', 9385 'bsuperior', 9386 'centsuperior', 9387 'dsuperior', 9388 'esuperior', 9389 '', 9390 '', 9391 'isuperior', 9392 '', 9393 '', 9394 'lsuperior', 9395 'msuperior', 9396 'nsuperior', 9397 'osuperior', 9398 '', 9399 '', 9400 'rsuperior', 9401 'ssuperior', 9402 'tsuperior', 9403 '', 9404 'ff', 9405 'fi', 9406 'fl', 9407 'ffi', 9408 'ffl', 9409 'parenleftinferior', 9410 '', 9411 'parenrightinferior', 9412 'Circumflexsmall', 9413 'hyphensuperior', 9414 'Gravesmall', 9415 'Asmall', 9416 'Bsmall', 9417 'Csmall', 9418 'Dsmall', 9419 'Esmall', 9420 'Fsmall', 9421 'Gsmall', 9422 'Hsmall', 9423 'Ismall', 9424 'Jsmall', 9425 'Ksmall', 9426 'Lsmall', 9427 'Msmall', 9428 'Nsmall', 9429 'Osmall', 9430 'Psmall', 9431 'Qsmall', 9432 'Rsmall', 9433 'Ssmall', 9434 'Tsmall', 9435 'Usmall', 9436 'Vsmall', 9437 'Wsmall', 9438 'Xsmall', 9439 'Ysmall', 9440 'Zsmall', 9441 'colonmonetary', 9442 'onefitted', 9443 'rupiah', 9444 'Tildesmall', 9445 '', 9446 '', 9447 '', 9448 '', 9449 '', 9450 '', 9451 '', 9452 '', 9453 '', 9454 '', 9455 '', 9456 '', 9457 '', 9458 '', 9459 '', 9460 '', 9461 '', 9462 '', 9463 '', 9464 '', 9465 '', 9466 '', 9467 '', 9468 '', 9469 '', 9470 '', 9471 '', 9472 '', 9473 '', 9474 '', 9475 '', 9476 '', 9477 '', 9478 '', 9479 'exclamdownsmall', 9480 'centoldstyle', 9481 'Lslashsmall', 9482 '', 9483 '', 9484 'Scaronsmall', 9485 'Zcaronsmall', 9486 'Dieresissmall', 9487 'Brevesmall', 9488 'Caronsmall', 9489 '', 9490 'Dotaccentsmall', 9491 '', 9492 '', 9493 'Macronsmall', 9494 '', 9495 '', 9496 'figuredash', 9497 'hypheninferior', 9498 '', 9499 '', 9500 'Ogoneksmall', 9501 'Ringsmall', 9502 'Cedillasmall', 9503 '', 9504 '', 9505 '', 9506 'onequarter', 9507 'onehalf', 9508 'threequarters', 9509 'questiondownsmall', 9510 'oneeighth', 9511 'threeeighths', 9512 'fiveeighths', 9513 'seveneighths', 9514 'onethird', 9515 'twothirds', 9516 '', 9517 '', 9518 'zerosuperior', 9519 'onesuperior', 9520 'twosuperior', 9521 'threesuperior', 9522 'foursuperior', 9523 'fivesuperior', 9524 'sixsuperior', 9525 'sevensuperior', 9526 'eightsuperior', 9527 'ninesuperior', 9528 'zeroinferior', 9529 'oneinferior', 9530 'twoinferior', 9531 'threeinferior', 9532 'fourinferior', 9533 'fiveinferior', 9534 'sixinferior', 9535 'seveninferior', 9536 'eightinferior', 9537 'nineinferior', 9538 'centinferior', 9539 'dollarinferior', 9540 'periodinferior', 9541 'commainferior', 9542 'Agravesmall', 9543 'Aacutesmall', 9544 'Acircumflexsmall', 9545 'Atildesmall', 9546 'Adieresissmall', 9547 'Aringsmall', 9548 'AEsmall', 9549 'Ccedillasmall', 9550 'Egravesmall', 9551 'Eacutesmall', 9552 'Ecircumflexsmall', 9553 'Edieresissmall', 9554 'Igravesmall', 9555 'Iacutesmall', 9556 'Icircumflexsmall', 9557 'Idieresissmall', 9558 'Ethsmall', 9559 'Ntildesmall', 9560 'Ogravesmall', 9561 'Oacutesmall', 9562 'Ocircumflexsmall', 9563 'Otildesmall', 9564 'Odieresissmall', 9565 'OEsmall', 9566 'Oslashsmall', 9567 'Ugravesmall', 9568 'Uacutesmall', 9569 'Ucircumflexsmall', 9570 'Udieresissmall', 9571 'Yacutesmall', 9572 'Thornsmall', 9573 'Ydieresissmall' 9574]; 9575var MacExpertEncoding = [ 9576 '', 9577 '', 9578 '', 9579 '', 9580 '', 9581 '', 9582 '', 9583 '', 9584 '', 9585 '', 9586 '', 9587 '', 9588 '', 9589 '', 9590 '', 9591 '', 9592 '', 9593 '', 9594 '', 9595 '', 9596 '', 9597 '', 9598 '', 9599 '', 9600 '', 9601 '', 9602 '', 9603 '', 9604 '', 9605 '', 9606 '', 9607 '', 9608 'space', 9609 'exclamsmall', 9610 'Hungarumlautsmall', 9611 'centoldstyle', 9612 'dollaroldstyle', 9613 'dollarsuperior', 9614 'ampersandsmall', 9615 'Acutesmall', 9616 'parenleftsuperior', 9617 'parenrightsuperior', 9618 'twodotenleader', 9619 'onedotenleader', 9620 'comma', 9621 'hyphen', 9622 'period', 9623 'fraction', 9624 'zerooldstyle', 9625 'oneoldstyle', 9626 'twooldstyle', 9627 'threeoldstyle', 9628 'fouroldstyle', 9629 'fiveoldstyle', 9630 'sixoldstyle', 9631 'sevenoldstyle', 9632 'eightoldstyle', 9633 'nineoldstyle', 9634 'colon', 9635 'semicolon', 9636 '', 9637 'threequartersemdash', 9638 '', 9639 'questionsmall', 9640 '', 9641 '', 9642 '', 9643 '', 9644 'Ethsmall', 9645 '', 9646 '', 9647 'onequarter', 9648 'onehalf', 9649 'threequarters', 9650 'oneeighth', 9651 'threeeighths', 9652 'fiveeighths', 9653 'seveneighths', 9654 'onethird', 9655 'twothirds', 9656 '', 9657 '', 9658 '', 9659 '', 9660 '', 9661 '', 9662 'ff', 9663 'fi', 9664 'fl', 9665 'ffi', 9666 'ffl', 9667 'parenleftinferior', 9668 '', 9669 'parenrightinferior',
9670 'Circumflexsmall', 9671 'hypheninferior', 9672 'Gravesmall', 9673 'Asmall', 9674 'Bsmall', 9675 'Csmall', 9676 'Dsmall', 9677 'Esmall', 9678 'Fsmall', 9679 'Gsmall', 9680 'Hsmall', 9681 'Ismall', 9682 'Jsmall', 9683 'Ksmall', 9684 'Lsmall', 9685 'Msmall', 9686 'Nsmall', 9687 'Osmall', 9688 'Psmall', 9689 'Qsmall', 9690 'Rsmall', 9691 'Ssmall', 9692 'Tsmall', 9693 'Usmall', 9694 'Vsmall', 9695 'Wsmall', 9696 'Xsmall', 9697 'Ysmall', 9698 'Zsmall', 9699 'colonmonetary', 9700 'onefitted', 9701 'rupiah', 9702 'Tildesmall', 9703 '', 9704 '', 9705 'asuperior', 9706 'centsuperior', 9707 '', 9708 '', 9709 '', 9710 '', 9711 'Aacutesmall', 9712 'Agravesmall', 9713 'Acircumflexsmall', 9714 'Adieresissmall', 9715 'Atildesmall', 9716 'Aringsmall', 9717 'Ccedillasmall', 9718 'Eacutesmall', 9719 'Egravesmall', 9720 'Ecircumflexsmall', 9721 'Edieresissmall', 9722 'Iacutesmall', 9723 'Igravesmall', 9724 'Icircumflexsmall', 9725 'Idieresissmall', 9726 'Ntildesmall', 9727 'Oacutesmall', 9728 'Ogravesmall', 9729 'Ocircumflexsmall', 9730 'Odieresissmall', 9731 'Otildesmall', 9732 'Uacutesmall', 9733 'Ugravesmall', 9734 'Ucircumflexsmall', 9735 'Udieresissmall', 9736 '', 9737 'eightsuperior', 9738 'fourinferior', 9739 'threeinferior', 9740 'sixinferior', 9741 'eightinferior', 9742 'seveninferior', 9743 'Scaronsmall', 9744 '', 9745 'centinferior', 9746 'twoinferior', 9747 '', 9748 'Dieresissmall', 9749 '', 9750 'Caronsmall', 9751 'osuperior', 9752 'fiveinferior', 9753 '', 9754 'commainferior', 9755 'periodinferior', 9756 'Yacutesmall', 9757 '', 9758 'dollarinferior', 9759 '', 9760 'Thornsmall', 9761 '', 9762 'nineinferior', 9763 'zeroinferior', 9764 'Zcaronsmall', 9765 'AEsmall', 9766 'Oslashsmall', 9767 'questiondownsmall', 9768 'oneinferior', 9769 'Lslashsmall', 9770 '', 9771 '', 9772 '', 9773 '', 9774 '', 9775 '', 9776 'Cedillasmall', 9777 '', 9778 '', 9779 '', 9780 '', 9781 '', 9782 'OEsmall', 9783 'figuredash', 9784 'hyphensuperior', 9785 '', 9786 '', 9787 '', 9788 '', 9789 'exclamdownsmall', 9790 '', 9791 'Ydieresissmall', 9792 '', 9793 'onesuperior', 9794 'twosuperior', 9795 'threesuperior', 9796 'foursuperior', 9797 'fivesuperior', 9798 'sixsuperior', 9799 'sevensuperior', 9800 'ninesuperior', 9801 'zerosuperior', 9802 '', 9803 'esuperior', 9804 'rsuperior', 9805 'tsuperior', 9806 '', 9807 '', 9808 'isuperior', 9809 'ssuperior', 9810 'dsuperior', 9811 '', 9812 '', 9813 '', 9814 '', 9815 '', 9816 'lsuperior', 9817 'Ogoneksmall', 9818 'Brevesmall', 9819 'Macronsmall', 9820 'bsuperior', 9821 'nsuperior', 9822 'msuperior', 9823 'commasuperior', 9824 'periodsuperior', 9825 'Dotaccentsmall', 9826 'Ringsmall' 9827]; 9828var MacRomanEncoding = [ 9829 '', 9830 '', 9831 '', 9832 '', 9833 '', 9834 '', 9835 '', 9836 '', 9837 '', 9838 '', 9839 '', 9840 '', 9841 '', 9842 '', 9843 '', 9844 '', 9845 '', 9846 '', 9847 '', 9848 '', 9849 '', 9850 '', 9851 '', 9852 '', 9853 '', 9854 '', 9855 '', 9856 '', 9857 '', 9858 '', 9859 '', 9860 '', 9861 'space', 9862 'exclam', 9863 'quotedbl', 9864 'numbersign', 9865 'dollar', 9866 'percent', 9867 'ampersand', 9868 'quotesingle', 9869 'parenleft', 9870 'parenright', 9871 'asterisk', 9872 'plus', 9873 'comma', 9874 'hyphen', 9875 'period', 9876 'slash', 9877 'zero', 9878 'one', 9879 'two', 9880 'three', 9881 'four', 9882 'five', 9883 'six', 9884 'seven', 9885 'eight', 9886 'nine', 9887 'colon', 9888 'semicolon', 9889 'less', 9890 'equal', 9891 'greater', 9892 'question', 9893 'at', 9894 'A', 9895 'B', 9896 'C', 9897 'D', 9898 'E', 9899 'F', 9900 'G', 9901 'H', 9902 'I', 9903 'J', 9904 'K', 9905 'L', 9906 'M', 9907 'N', 9908 'O', 9909 'P', 9910 'Q', 9911 'R', 9912 'S', 9913 'T', 9914 'U', 9915 'V', 9916 'W', 9917 'X', 9918 'Y', 9919 'Z', 9920 'bracketleft', 9921 'backslash', 9922 'bracketright', 9923 'asciicircum', 9924 'underscore', 9925 'grave', 9926 'a', 9927 'b', 9928 'c', 9929 'd', 9930 'e', 9931 'f', 9932 'g', 9933 'h', 9934 'i', 9935 'j', 9936 'k', 9937 'l', 9938 'm', 9939 'n', 9940 'o', 9941 'p', 9942 'q', 9943 'r', 9944 's', 9945 't', 9946 'u', 9947 'v', 9948 'w', 9949 'x', 9950 'y', 9951 'z', 9952 'braceleft', 9953 'bar', 9954 'braceright', 9955 'asciitilde', 9956 '', 9957 'Adieresis', 9958 'Aring', 9959 'Ccedilla', 9960 'Eacute', 9961 'Ntilde', 9962 'Odieresis', 9963 'Udieresis', 9964 'aacute', 9965 'agrave', 9966 'acircumflex', 9967 'adieresis', 9968 'atilde', 9969 'aring', 9970 'ccedilla', 9971 'eacute', 9972 'egrave', 9973 'ecircumflex', 9974 'edieresis', 9975 'iacute', 9976 'igrave', 9977 'icircumflex', 9978 'idieresis', 9979 'ntilde', 9980 'oacute', 9981 'ograve', 9982 'ocircumflex', 9983 'odieresis', 9984 'otilde', 9985 'uacute', 9986 'ugrave', 9987 'ucircumflex', 9988 'udieresis', 9989 'dagger', 9990 'degree', 9991 'cent', 9992 'sterling', 9993 'section', 9994 'bullet', 9995 'paragraph', 9996 'germandbls', 9997 'registered', 9998 'copyright', 9999 'trademark', 10000 'acute', 10001 'dieresis', 10002 'notequal', 10003 'AE', 10004 'Oslash', 10005 'infinity', 10006 'plusminus', 10007 'lessequal', 10008 'greaterequal', 10009 'yen', 10010 'mu', 10011 'partialdiff', 10012 'summation', 10013 'product', 10014 'pi', 10015 'integral', 10016 'ordfeminine', 10017 'ordmasculine', 10018 'Omega', 10019 'ae', 10020 'oslash', 10021 'questiondown', 10022 'exclamdown', 10023 'logicalnot', 10024 'radical', 10025 'florin', 10026 'approxequal', 10027 'Delta', 10028 'guillemotleft', 10029 'guillemotright', 10030 'ellipsis', 10031 'space', 10032 'Agrave', 10033 'Atilde', 10034 'Otilde', 10035 'OE', 10036 'oe', 10037 'endash', 10038 'emdash', 10039 'quotedblleft', 10040 'quotedblright', 10041 'quoteleft', 10042 'quoteright', 10043 'divide', 10044 'lozenge', 10045 'ydieresis', 10046 'Ydieresis', 10047 'fraction', 10048 'currency', 10049 'guilsinglleft', 10050 'guilsinglright', 10051 'fi', 10052 'fl', 10053 'daggerdbl',
10054 'periodcentered', 10055 'quotesinglbase', 10056 'quotedblbase', 10057 'perthousand', 10058 'Acircumflex', 10059 'Ecircumflex', 10060 'Aacute', 10061 'Edieresis', 10062 'Egrave', 10063 'Iacute', 10064 'Icircumflex', 10065 'Idieresis', 10066 'Igrave', 10067 'Oacute', 10068 'Ocircumflex', 10069 'apple', 10070 'Ograve', 10071 'Uacute', 10072 'Ucircumflex', 10073 'Ugrave', 10074 'dotlessi', 10075 'circumflex', 10076 'tilde', 10077 'macron', 10078 'breve', 10079 'dotaccent', 10080 'ring', 10081 'cedilla', 10082 'hungarumlaut', 10083 'ogonek', 10084 'caron' 10085]; 10086var StandardEncoding = [ 10087 '', 10088 '', 10089 '', 10090 '', 10091 '', 10092 '', 10093 '', 10094 '', 10095 '', 10096 '', 10097 '', 10098 '', 10099 '', 10100 '', 10101 '', 10102 '', 10103 '', 10104 '', 10105 '', 10106 '', 10107 '', 10108 '', 10109 '', 10110 '', 10111 '', 10112 '', 10113 '', 10114 '', 10115 '', 10116 '', 10117 '', 10118 '', 10119 'space', 10120 'exclam', 10121 'quotedbl', 10122 'numbersign', 10123 'dollar', 10124 'percent', 10125 'ampersand', 10126 'quoteright', 10127 'parenleft', 10128 'parenright', 10129 'asterisk', 10130 'plus', 10131 'comma', 10132 'hyphen', 10133 'period', 10134 'slash', 10135 'zero', 10136 'one', 10137 'two', 10138 'three', 10139 'four', 10140 'five', 10141 'six', 10142 'seven', 10143 'eight', 10144 'nine', 10145 'colon', 10146 'semicolon', 10147 'less', 10148 'equal', 10149 'greater', 10150 'question', 10151 'at', 10152 'A', 10153 'B', 10154 'C', 10155 'D', 10156 'E', 10157 'F', 10158 'G', 10159 'H', 10160 'I', 10161 'J', 10162 'K', 10163 'L', 10164 'M', 10165 'N', 10166 'O', 10167 'P', 10168 'Q', 10169 'R', 10170 'S', 10171 'T', 10172 'U', 10173 'V', 10174 'W', 10175 'X', 10176 'Y', 10177 'Z', 10178 'bracketleft', 10179 'backslash', 10180 'bracketright', 10181 'asciicircum', 10182 'underscore', 10183 'quoteleft', 10184 'a', 10185 'b', 10186 'c', 10187 'd', 10188 'e', 10189 'f', 10190 'g', 10191 'h', 10192 'i', 10193 'j', 10194 'k', 10195 'l', 10196 'm', 10197 'n', 10198 'o', 10199 'p', 10200 'q', 10201 'r', 10202 's', 10203 't', 10204 'u', 10205 'v', 10206 'w', 10207 'x', 10208 'y', 10209 'z', 10210 'braceleft', 10211 'bar', 10212 'braceright', 10213 'asciitilde', 10214 '', 10215 '', 10216 '', 10217 '', 10218 '', 10219 '', 10220 '', 10221 '', 10222 '', 10223 '', 10224 '', 10225 '', 10226 '', 10227 '', 10228 '', 10229 '', 10230 '', 10231 '', 10232 '', 10233 '', 10234 '', 10235 '', 10236 '', 10237 '', 10238 '', 10239 '', 10240 '', 10241 '', 10242 '', 10243 '', 10244 '', 10245 '', 10246 '', 10247 '', 10248 'exclamdown', 10249 'cent', 10250 'sterling', 10251 'fraction', 10252 'yen', 10253 'florin', 10254 'section', 10255 'currency', 10256 'quotesingle', 10257 'quotedblleft', 10258 'guillemotleft', 10259 'guilsinglleft', 10260 'guilsinglright', 10261 'fi', 10262 'fl', 10263 '', 10264 'endash', 10265 'dagger', 10266 'daggerdbl', 10267 'periodcentered', 10268 '', 10269 'paragraph', 10270 'bullet', 10271 'quotesinglbase', 10272 'quotedblbase', 10273 'quotedblright', 10274 'guillemotright', 10275 'ellipsis', 10276 'perthousand', 10277 '', 10278 'questiondown', 10279 '', 10280 'grave', 10281 'acute', 10282 'circumflex', 10283 'tilde', 10284 'macron', 10285 'breve', 10286 'dotaccent', 10287 'dieresis', 10288 '', 10289 'ring', 10290 'cedilla', 10291 '', 10292 'hungarumlaut', 10293 'ogonek', 10294 'caron', 10295 'emdash', 10296 '', 10297 '', 10298 '', 10299 '', 10300 '', 10301 '', 10302 '', 10303 '', 10304 '', 10305 '', 10306 '', 10307 '', 10308 '', 10309 '', 10310 '', 10311 '', 10312 'AE', 10313 '', 10314 'ordfeminine', 10315 '', 10316 '', 10317 '', 10318 '', 10319 'Lslash', 10320 'Oslash', 10321 'OE', 10322 'ordmasculine', 10323 '', 10324 '', 10325 '', 10326 '', 10327 '', 10328 'ae', 10329 '', 10330 '', 10331 '', 10332 'dotlessi', 10333 '', 10334 '', 10335 'lslash', 10336 'oslash', 10337 'oe', 10338 'germandbls' 10339]; 10340var WinAnsiEncoding = [ 10341 '', 10342 '', 10343 '', 10344 '', 10345 '', 10346 '', 10347 '', 10348 '', 10349 '', 10350 '', 10351 '', 10352 '', 10353 '', 10354 '', 10355 '', 10356 '', 10357 '', 10358 '', 10359 '', 10360 '', 10361 '', 10362 '', 10363 '', 10364 '', 10365 '', 10366 '', 10367 '', 10368 '', 10369 '', 10370 '', 10371 '', 10372 '', 10373 'space', 10374 'exclam', 10375 'quotedbl', 10376 'numbersign', 10377 'dollar', 10378 'percent', 10379 'ampersand', 10380 'quotesingle', 10381 'parenleft', 10382 'parenright', 10383 'asterisk', 10384 'plus', 10385 'comma', 10386 'hyphen', 10387 'period', 10388 'slash', 10389 'zero', 10390 'one', 10391 'two', 10392 'three', 10393 'four', 10394 'five', 10395 'six', 10396 'seven', 10397 'eight', 10398 'nine', 10399 'colon', 10400 'semicolon', 10401 'less', 10402 'equal', 10403 'greater', 10404 'question', 10405 'at', 10406 'A', 10407 'B', 10408 'C', 10409 'D', 10410 'E', 10411 'F', 10412 'G', 10413 'H', 10414 'I', 10415 'J', 10416 'K', 10417 'L', 10418 'M', 10419 'N', 10420 'O', 10421 'P', 10422 'Q', 10423 'R', 10424 'S', 10425 'T', 10426 'U', 10427 'V', 10428 'W', 10429 'X', 10430 'Y', 10431 'Z', 10432 'bracketleft', 10433 'backslash', 10434 'bracketright', 10435 'asciicircum', 10436 'underscore', 10437 'grave', 10438 'a', 10439 'b', 10440 'c', 10441 'd', 10442 'e', 10443 'f', 10444 'g', 10445 'h', 10446 'i', 10447 'j', 10448 'k', 10449 'l', 10450 'm', 10451 'n', 10452 'o', 10453 'p', 10454 'q', 10455 'r', 10456 's', 10457 't', 10458 'u', 10459 'v', 10460 'w', 10461 'x', 10462 'y', 10463 'z', 10464 'braceleft', 10465 'bar', 10466 'braceright', 10467 'asciitilde', 10468 'bullet', 10469 'Euro', 10470 'bullet', 10471 'quotesinglbase', 10472 'florin', 10473 'quotedblbase', 10474 'ellipsis', 10475 'dagger', 10476 'daggerdbl', 10477 'circumflex', 10478 'perthousand', 10479 'Scaron', 10480 'guilsinglleft', 10481 'OE', 10482 'bullet', 10483 'Zcaron', 10484 'bullet', 10485 'bullet', 10486 'quoteleft', 10487 'quoteright', 10488 'quotedblleft', 10489 'quotedblright', 10490 'bullet', 10491 'endash', 10492 'emdash', 10493 'tilde', 10494 'trademark', 10495 'scaron', 10496 'guilsinglright', 10497 'oe', 10498 'bullet', 10499 'zcaron', 10500 'Ydieresis', 10501 'space', 10502 'exclamdown', 10503 'cent', 10504 'sterling', 10505 'currency', 10506 'yen', 10507 'brokenbar', 10508 'section', 10509 'dieresis', 10510 'copyright', 10511 'ordfeminine', 10512 'guillemotleft', 10513 'logicalnot', 10514 'hyphen', 10515 'registered', 10516 'macron', 10517 'degree', 10518 'plusminus', 10519 'twosuperior', 10520 'threesuperior', 10521 'acute', 10522 'mu', 10523 'paragraph',
10524 'periodcentered', 10525 'cedilla', 10526 'onesuperior', 10527 'ordmasculine', 10528 'guillemotright', 10529 'onequarter', 10530 'onehalf', 10531 'threequarters', 10532 'questiondown', 10533 'Agrave', 10534 'Aacute', 10535 'Acircumflex', 10536 'Atilde', 10537 'Adieresis', 10538 'Aring', 10539 'AE', 10540 'Ccedilla', 10541 'Egrave', 10542 'Eacute', 10543 'Ecircumflex', 10544 'Edieresis', 10545 'Igrave', 10546 'Iacute', 10547 'Icircumflex', 10548 'Idieresis', 10549 'Eth', 10550 'Ntilde', 10551 'Ograve', 10552 'Oacute', 10553 'Ocircumflex', 10554 'Otilde', 10555 'Odieresis', 10556 'multiply', 10557 'Oslash', 10558 'Ugrave', 10559 'Uacute', 10560 'Ucircumflex', 10561 'Udieresis', 10562 'Yacute', 10563 'Thorn', 10564 'germandbls', 10565 'agrave', 10566 'aacute', 10567 'acircumflex', 10568 'atilde', 10569 'adieresis', 10570 'aring', 10571 'ae', 10572 'ccedilla', 10573 'egrave', 10574 'eacute', 10575 'ecircumflex', 10576 'edieresis', 10577 'igrave', 10578 'iacute', 10579 'icircumflex', 10580 'idieresis', 10581 'eth', 10582 'ntilde', 10583 'ograve', 10584 'oacute', 10585 'ocircumflex', 10586 'otilde', 10587 'odieresis', 10588 'divide', 10589 'oslash', 10590 'ugrave', 10591 'uacute', 10592 'ucircumflex', 10593 'udieresis', 10594 'yacute', 10595 'thorn', 10596 'ydieresis' 10597]; 10598var SymbolSetEncoding = [ 10599 '', 10600 '', 10601 '', 10602 '', 10603 '', 10604 '', 10605 '', 10606 '', 10607 '', 10608 '', 10609 '', 10610 '', 10611 '', 10612 '', 10613 '', 10614 '', 10615 '', 10616 '', 10617 '', 10618 '', 10619 '', 10620 '', 10621 '', 10622 '', 10623 '', 10624 '', 10625 '', 10626 '', 10627 '', 10628 '', 10629 '', 10630 '', 10631 'space', 10632 'exclam', 10633 'universal', 10634 'numbersign', 10635 'existential', 10636 'percent', 10637 'ampersand', 10638 'suchthat', 10639 'parenleft', 10640 'parenright', 10641 'asteriskmath', 10642 'plus', 10643 'comma', 10644 'minus', 10645 'period', 10646 'slash', 10647 'zero', 10648 'one', 10649 'two', 10650 'three', 10651 'four', 10652 'five', 10653 'six', 10654 'seven', 10655 'eight', 10656 'nine', 10657 'colon', 10658 'semicolon', 10659 'less', 10660 'equal', 10661 'greater', 10662 'question', 10663 'congruent', 10664 'Alpha', 10665 'Beta', 10666 'Chi', 10667 'Delta', 10668 'Epsilon', 10669 'Phi', 10670 'Gamma', 10671 'Eta', 10672 'Iota', 10673 'theta1', 10674 'Kappa', 10675 'Lambda', 10676 'Mu', 10677 'Nu', 10678 'Omicron', 10679 'Pi', 10680 'Theta', 10681 'Rho', 10682 'Sigma', 10683 'Tau', 10684 'Upsilon', 10685 'sigma1', 10686 'Omega', 10687 'Xi', 10688 'Psi', 10689 'Zeta', 10690 'bracketleft', 10691 'therefore', 10692 'bracketright', 10693 'perpendicular', 10694 'underscore', 10695 'radicalex', 10696 'alpha', 10697 'beta', 10698 'chi', 10699 'delta', 10700 'epsilon', 10701 'phi', 10702 'gamma', 10703 'eta', 10704 'iota', 10705 'phi1', 10706 'kappa', 10707 'lambda', 10708 'mu', 10709 'nu', 10710 'omicron', 10711 'pi', 10712 'theta', 10713 'rho', 10714 'sigma', 10715 'tau', 10716 'upsilon', 10717 'omega1', 10718 'omega', 10719 'xi', 10720 'psi', 10721 'zeta', 10722 'braceleft', 10723 'bar', 10724 'braceright', 10725 'similar', 10726 '', 10727 '', 10728 '', 10729 '', 10730 '', 10731 '', 10732 '', 10733 '', 10734 '', 10735 '', 10736 '', 10737 '', 10738 '', 10739 '', 10740 '', 10741 '', 10742 '', 10743 '', 10744 '', 10745 '', 10746 '', 10747 '', 10748 '', 10749 '', 10750 '', 10751 '', 10752 '', 10753 '', 10754 '', 10755 '', 10756 '', 10757 '', 10758 '', 10759 'Euro', 10760 'Upsilon1', 10761 'minute', 10762 'lessequal', 10763 'fraction', 10764 'infinity', 10765 'florin', 10766 'club', 10767 'diamond', 10768 'heart', 10769 'spade', 10770 'arrowboth', 10771 'arrowleft', 10772 'arrowup', 10773 'arrowright', 10774 'arrowdown', 10775 'degree', 10776 'plusminus', 10777 'second', 10778 'greaterequal', 10779 'multiply', 10780 'proportional', 10781 'partialdiff', 10782 'bullet', 10783 'divide', 10784 'notequal', 10785 'equivalence', 10786 'approxequal', 10787 'ellipsis', 10788 'arrowvertex', 10789 'arrowhorizex', 10790 'carriagereturn', 10791 'aleph', 10792 'Ifraktur', 10793 'Rfraktur', 10794 'weierstrass', 10795 'circlemultiply', 10796 'circleplus', 10797 'emptyset', 10798 'intersection', 10799 'union', 10800 'propersuperset', 10801 'reflexsuperset', 10802 'notsubset', 10803 'propersubset', 10804 'reflexsubset', 10805 'element', 10806 'notelement', 10807 'angle', 10808 'gradient', 10809 'registerserif', 10810 'copyrightserif', 10811 'trademarkserif', 10812 'product', 10813 'radical', 10814 'dotmath', 10815 'logicalnot', 10816 'logicaland', 10817 'logicalor', 10818 'arrowdblboth', 10819 'arrowdblleft', 10820 'arrowdblup', 10821 'arrowdblright', 10822 'arrowdbldown', 10823 'lozenge', 10824 'angleleft', 10825 'registersans', 10826 'copyrightsans', 10827 'trademarksans', 10828 'summation', 10829 'parenlefttp', 10830 'parenleftex', 10831 'parenleftbt', 10832 'bracketlefttp', 10833 'bracketleftex', 10834 'bracketleftbt', 10835 'bracelefttp', 10836 'braceleftmid', 10837 'braceleftbt', 10838 'braceex', 10839 '', 10840 'angleright', 10841 'integral', 10842 'integraltp', 10843 'integralex', 10844 'integralbt', 10845 'parenrighttp', 10846 'parenrightex', 10847 'parenrightbt', 10848 'bracketrighttp', 10849 'bracketrightex', 10850 'bracketrightbt', 10851 'bracerighttp', 10852 'bracerightmid', 10853 'bracerightbt' 10854]; 10855var ZapfDingbatsEncoding = [ 10856 '', 10857 '', 10858 '', 10859 '', 10860 '', 10861 '', 10862 '', 10863 '', 10864 '', 10865 '', 10866 '', 10867 '', 10868 '', 10869 '', 10870 '', 10871 '', 10872 '', 10873 '', 10874 '', 10875 '', 10876 '', 10877 '', 10878 '', 10879 '', 10880 '', 10881 '', 10882 '', 10883 '', 10884 '', 10885 '', 10886 '', 10887 '', 10888 'space', 10889 'a1', 10890 'a2', 10891 'a202', 10892 'a3', 10893 'a4', 10894 'a5', 10895 'a119', 10896 'a118', 10897 'a117', 10898 'a11', 10899 'a12', 10900 'a13', 10901 'a14', 10902 'a15', 10903 'a16', 10904 'a105', 10905 'a17', 10906 'a18', 10907 'a19', 10908 'a20', 10909 'a21', 10910 'a22', 10911 'a23', 10912 'a24', 10913 'a25', 10914 'a26', 10915 'a27', 10916 'a28', 10917 'a6', 10918 'a7', 10919 'a8', 10920 'a9', 10921 'a10', 10922 'a29', 10923 'a30', 10924 'a31', 10925 'a32', 10926 'a33', 10927 'a34', 10928 'a35', 10929 'a36', 10930 'a37', 10931 'a38', 10932 'a39', 10933 'a40', 10934 'a41', 10935 'a42', 10936 'a43', 10937 'a44', 10938 'a45', 10939 'a46', 10940 'a47', 10941 'a48', 10942 'a49', 10943 'a50', 10944 'a51', 10945 'a52', 10946 'a53', 10947 'a54', 10948 'a55', 10949 'a56', 10950 'a57', 10951 'a58', 10952 'a59', 10953 'a60', 10954 'a61', 10955 'a62', 10956 'a63', 10957 'a64', 10958 'a65', 10959 'a66', 10960 'a67', 10961 'a68', 10962 'a69', 10963 'a70', 10964 'a71', 10965 'a72', 10966 'a73', 10967 'a74', 10968 'a203', 10969 'a75', 10970 'a204', 10971 'a76', 10972 'a77', 10973 'a78', 10974 'a79', 10975 'a81', 10976 'a82', 10977 'a83', 10978 'a84', 10979 'a97', 10980 'a98', 10981 'a99', 10982 'a100', 10983 '', 10984 'a89', 10985 'a90', 10986 'a93', 10987 'a94', 10988 'a91', 10989 'a92', 10990 'a205', 10991 'a85', 10992 'a206', 10993 'a86', 10994 'a87', 10995 'a88', 10996 'a95', 10997 'a96', 10998 '', 10999 '', 11000 '', 11001 '', 11002 '', 11003 '', 11004 '', 11005 '', 11006 '', 11007 '', 11008 '', 11009 '', 11010 '', 11011 '', 11012 '', 11013 '', 11014 '', 11015 '', 11016 '', 11017 'a101', 11018 'a102', 11019 'a103', 11020 'a104', 11021 'a106', 11022 'a107', 11023 'a108', 11024 'a112', 11025 'a111', 11026 'a110', 11027 'a109', 11028 'a120', 11029 'a121', 11030 'a122', 11031 'a123', 11032 'a124', 11033 'a125', 11034 'a126', 11035 'a127', 11036 'a128', 11037 'a129', 11038 'a130', 11039 'a131', 11040 'a132', 11041 'a133', 11042 'a134', 11043 'a135', 11044 'a136', 11045 'a137', 11046 'a138', 11047 'a139', 11048 'a140', 11049 'a141', 11050 'a142', 11051 'a143', 11052 'a144', 11053 'a145', 11054 'a146', 11055 'a147', 11056 'a148', 11057 'a149', 11058 'a150', 11059 'a151', 11060 'a152', 11061 'a153', 11062 'a154', 11063 'a155', 11064 'a156', 11065 'a157', 11066 'a158', 11067 'a159', 11068 'a160', 11069 'a161', 11070 'a163', 11071 'a164', 11072 'a196', 11073 'a165', 11074 'a192', 11075 'a166', 11076 'a167', 11077 'a168', 11078 'a169', 11079 'a170', 11080 'a171', 11081 'a172', 11082 'a173', 11083 'a162', 11084 'a174', 11085 'a175', 11086 'a176', 11087 'a177', 11088 'a178', 11089 'a179', 11090 'a193', 11091 'a180', 11092 'a199', 11093 'a181', 11094 'a200', 11095 'a182', 11096 '', 11097 'a201', 11098 'a183', 11099 'a184', 11100 'a197', 11101 'a185', 11102 'a194', 11103 'a198', 11104 'a186', 11105 'a195', 11106 'a187', 11107 'a188', 11108 'a189', 11109 'a190', 11110 'a191' 11111]; 11112function getEncoding(encodingName) { 11113 switch (encodingName) { 11114 case 'WinAnsiEncoding': 11115 return WinAnsiEncoding; 11116 case 'StandardEncoding': 11117 return StandardEncoding; 11118 case 'MacRomanEncoding': 11119 return MacRomanEncoding; 11120 case 'SymbolSetEncoding': 11121 return SymbolSetEncoding; 11122 case 'ZapfDingbatsEncoding': 11123 return ZapfDingbatsEncoding; 11124 case 'ExpertEncoding': 11125 return ExpertEncoding; 11126 case 'MacExpertEncoding': 11127 return MacExpertEncoding; 11128 default: 11129 return null; 11130 } 11131} 11132exports.WinAnsiEncoding = WinAnsiEncoding; 11133exports.StandardEncoding = StandardEncoding; 11134exports.MacRomanEncoding = MacRomanEncoding; 11135exports.SymbolSetEncoding = SymbolSetEncoding; 11136exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding; 11137exports.ExpertEncoding = ExpertEncoding; 11138exports.getEncoding = getEncoding; 11139 11140/***/ }), 11141/* 5 */ 11142/***/ (function(module, exports, __w_pdfjs_require__) { 11143 11144"use strict"; 11145 11146var sharedUtil = __w_pdfjs_require__(0); 11147var corePrimitives = __w_pdfjs_require__(1); 11148var coreStream = __w_pdfjs_require__(2); 11149var MissingDataException = sharedUtil.MissingDataException; 11150var StreamType = sharedUtil.StreamType; 11151var assert = sharedUtil.assert; 11152var error = sharedUtil.error; 11153var info = sharedUtil.info; 11154var isArray = sharedUtil.isArray; 11155var isInt = sharedUtil.isInt; 11156var isNum = sharedUtil.isNum; 11157var isString = sharedUtil.isString; 11158var warn = sharedUtil.warn; 11159var EOF = corePrimitives.EOF; 11160var Cmd = corePrimitives.Cmd; 11161var Dict = corePrimitives.Dict; 11162var Name = corePrimitives.Name; 11163var Ref = corePrimitives.Ref; 11164var isEOF = corePrimitives.isEOF; 11165var isCmd = corePrimitives.isCmd; 11166var isDict = corePrimitives.isDict; 11167var isName = corePrimitives.isName; 11168var Ascii85Stream = coreStream.Ascii85Stream; 11169var AsciiHexStream = coreStream.AsciiHexStream; 11170var CCITTFaxStream = coreStream.CCITTFaxStream; 11171var FlateStream = coreStream.FlateStream; 11172var Jbig2Stream = coreStream.Jbig2Stream; 11173var JpegStream = coreStream.JpegStream; 11174var JpxStream = coreStream.JpxStream; 11175var LZWStream = coreStream.LZWStream; 11176var NullStream = coreStream.NullStream; 11177var PredictorStream = coreStream.PredictorStream; 11178var RunLengthStream = coreStream.RunLengthStream; 11179var MAX_LENGTH_TO_CACHE = 1000; 11180var Parser = function ParserClosure() { 11181 function Parser(lexer, allowStreams, xref, recoveryMode) { 11182 this.lexer = lexer;
vendor: 52,654 bytes, lines 11183-13399
11183 this.allowStreams = allowStreams; 11184 this.xref = xref; 11185 this.recoveryMode = recoveryMode || false; 11186 this.imageCache = Object.create(null); 11187 this.refill(); 11188 } 11189 Parser.prototype = { 11190 refill: function Parser_refill() { 11191 this.buf1 = this.lexer.getObj(); 11192 this.buf2 = this.lexer.getObj(); 11193 }, 11194 shift: function Parser_shift() { 11195 if (isCmd(this.buf2, 'ID')) { 11196 this.buf1 = this.buf2; 11197 this.buf2 = null; 11198 } else { 11199 this.buf1 = this.buf2; 11200 this.buf2 = this.lexer.getObj(); 11201 } 11202 }, 11203 tryShift: function Parser_tryShift() { 11204 try { 11205 this.shift(); 11206 return true; 11207 } catch (e) { 11208 if (e instanceof MissingDataException) { 11209 throw e; 11210 } 11211 return false; 11212 } 11213 }, 11214 getObj: function Parser_getObj(cipherTransform) { 11215 var buf1 = this.buf1; 11216 this.shift(); 11217 if (buf1 instanceof Cmd) { 11218 switch (buf1.cmd) { 11219 case 'BI': 11220 return this.makeInlineImage(cipherTransform); 11221 case '[': 11222 var array = []; 11223 while (!isCmd(this.buf1, ']') && !isEOF(this.buf1)) { 11224 array.push(this.getObj(cipherTransform)); 11225 } 11226 if (isEOF(this.buf1)) { 11227 if (!this.recoveryMode) { 11228 error('End of file inside array'); 11229 } 11230 return array; 11231 } 11232 this.shift(); 11233 return array; 11234 case '<<': 11235 var dict = new Dict(this.xref); 11236 while (!isCmd(this.buf1, '>>') && !isEOF(this.buf1)) { 11237 if (!isName(this.buf1)) { 11238 info('Malformed dictionary: key must be a name object'); 11239 this.shift(); 11240 continue; 11241 } 11242 var key = this.buf1.name; 11243 this.shift(); 11244 if (isEOF(this.buf1)) { 11245 break; 11246 } 11247 dict.set(key, this.getObj(cipherTransform)); 11248 } 11249 if (isEOF(this.buf1)) { 11250 if (!this.recoveryMode) { 11251 error('End of file inside dictionary'); 11252 } 11253 return dict; 11254 } 11255 if (isCmd(this.buf2, 'stream')) { 11256 return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict; 11257 } 11258 this.shift(); 11259 return dict; 11260 default: 11261 return buf1; 11262 } 11263 } 11264 if (isInt(buf1)) { 11265 var num = buf1; 11266 if (isInt(this.buf1) && isCmd(this.buf2, 'R')) { 11267 var ref = new Ref(num, this.buf1); 11268 this.shift(); 11269 this.shift(); 11270 return ref; 11271 } 11272 return num; 11273 } 11274 if (isString(buf1)) { 11275 var str = buf1; 11276 if (cipherTransform) { 11277 str = cipherTransform.decryptString(str); 11278 } 11279 return str; 11280 } 11281 return buf1; 11282 }, 11283 findDefaultInlineStreamEnd: function Parser_findDefaultInlineStreamEnd(stream) { 11284 var E = 0x45, I = 0x49, SPACE = 0x20, LF = 0xA, CR = 0xD; 11285 var startPos = stream.pos, state = 0, ch, i, n, followingBytes; 11286 while ((ch = stream.getByte()) !== -1) { 11287 if (state === 0) { 11288 state = ch === E ? 1 : 0; 11289 } else if (state === 1) { 11290 state = ch === I ? 2 : 0; 11291 } else { 11292 assert(state === 2); 11293 if (ch === SPACE || ch === LF || ch === CR) { 11294 n = 5; 11295 followingBytes = stream.peekBytes(n); 11296 for (i = 0; i < n; i++) { 11297 ch = followingBytes[i]; 11298 if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { 11299 state = 0; 11300 break; 11301 } 11302 } 11303 if (state === 2) { 11304 break; 11305 } 11306 } else { 11307 state = 0; 11308 } 11309 } 11310 } 11311 return stream.pos - 4 - startPos; 11312 }, 11313 findDCTDecodeInlineStreamEnd: function Parser_findDCTDecodeInlineStreamEnd(stream) { 11314 var startPos = stream.pos, foundEOI = false, b, markerLength, length; 11315 while ((b = stream.getByte()) !== -1) { 11316 if (b !== 0xFF) { 11317 continue; 11318 } 11319 switch (stream.getByte()) { 11320 case 0x00: 11321 break; 11322 case 0xFF: 11323 stream.skip(-1); 11324 break; 11325 case 0xD9: 11326 foundEOI = true; 11327 break; 11328 case 0xC0: 11329 case 0xC1: 11330 case 0xC2: 11331 case 0xC3: 11332 case 0xC5: 11333 case 0xC6: 11334 case 0xC7: 11335 case 0xC9: 11336 case 0xCA: 11337 case 0xCB: 11338 case 0xCD: 11339 case 0xCE: 11340 case 0xCF: 11341 case 0xC4: 11342 case 0xCC: 11343 case 0xDA: 11344 case 0xDB: 11345 case 0xDC: 11346 case 0xDD: 11347 case 0xDE: 11348 case 0xDF: 11349 case 0xE0: 11350 case 0xE1: 11351 case 0xE2: 11352 case 0xE3: 11353 case 0xE4: 11354 case 0xE5: 11355 case 0xE6: 11356 case 0xE7: 11357 case 0xE8: 11358 case 0xE9: 11359 case 0xEA: 11360 case 0xEB: 11361 case 0xEC: 11362 case 0xED: 11363 case 0xEE: 11364 case 0xEF: 11365 case 0xFE: 11366 markerLength = stream.getUint16(); 11367 if (markerLength > 2) { 11368 stream.skip(markerLength - 2); 11369 } else { 11370 stream.skip(-2); 11371 } 11372 break; 11373 } 11374 if (foundEOI) { 11375 break; 11376 } 11377 } 11378 length = stream.pos - startPos; 11379 if (b === -1) { 11380 warn('Inline DCTDecode image stream: ' + 'EOI marker not found, searching for /EI/ instead.'); 11381 stream.skip(-length); 11382 return this.findDefaultInlineStreamEnd(stream); 11383 } 11384 this.inlineStreamSkipEI(stream); 11385 return length; 11386 }, 11387 findASCII85DecodeInlineStreamEnd: function Parser_findASCII85DecodeInlineStreamEnd(stream) { 11388 var TILDE = 0x7E, GT = 0x3E; 11389 var startPos = stream.pos, ch, length; 11390 while ((ch = stream.getByte()) !== -1) { 11391 if (ch === TILDE && stream.peekByte() === GT) { 11392 stream.skip(); 11393 break; 11394 } 11395 } 11396 length = stream.pos - startPos; 11397 if (ch === -1) { 11398 warn('Inline ASCII85Decode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 11399 stream.skip(-length); 11400 return this.findDefaultInlineStreamEnd(stream); 11401 } 11402 this.inlineStreamSkipEI(stream); 11403 return length; 11404 }, 11405 findASCIIHexDecodeInlineStreamEnd: function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { 11406 var GT = 0x3E; 11407 var startPos = stream.pos, ch, length; 11408 while ((ch = stream.getByte()) !== -1) { 11409 if (ch === GT) { 11410 break; 11411 } 11412 } 11413 length = stream.pos - startPos; 11414 if (ch === -1) { 11415 warn('Inline ASCIIHexDecode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 11416 stream.skip(-length); 11417 return this.findDefaultInlineStreamEnd(stream); 11418 } 11419 this.inlineStreamSkipEI(stream); 11420 return length; 11421 }, 11422 inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { 11423 var E = 0x45, I = 0x49; 11424 var state = 0, ch; 11425 while ((ch = stream.getByte()) !== -1) { 11426 if (state === 0) { 11427 state = ch === E ? 1 : 0; 11428 } else if (state === 1) { 11429 state = ch === I ? 2 : 0; 11430 } else if (state === 2) { 11431 break; 11432 } 11433 } 11434 }, 11435 makeInlineImage: function Parser_makeInlineImage(cipherTransform) { 11436 var lexer = this.lexer; 11437 var stream = lexer.stream; 11438 var dict = new Dict(this.xref); 11439 while (!isCmd(this.buf1, 'ID') && !isEOF(this.buf1)) { 11440 if (!isName(this.buf1)) { 11441 error('Dictionary key must be a name object'); 11442 } 11443 var key = this.buf1.name; 11444 this.shift(); 11445 if (isEOF(this.buf1)) { 11446 break; 11447 } 11448 dict.set(key, this.getObj(cipherTransform)); 11449 } 11450 var filter = dict.get('Filter', 'F'), filterName; 11451 if (isName(filter)) { 11452 filterName = filter.name; 11453 } else if (isArray(filter)) { 11454 var filterZero = this.xref.fetchIfRef(filter[0]); 11455 if (isName(filterZero)) { 11456 filterName = filterZero.name; 11457 } 11458 } 11459 var startPos = stream.pos, length, i, ii; 11460 if (filterName === 'DCTDecode' || filterName === 'DCT') { 11461 length = this.findDCTDecodeInlineStreamEnd(stream); 11462 } else if (filterName === 'ASCII85Decide' || filterName === 'A85') { 11463 length = this.findASCII85DecodeInlineStreamEnd(stream); 11464 } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { 11465 length = this.findASCIIHexDecodeInlineStreamEnd(stream); 11466 } else { 11467 length = this.findDefaultInlineStreamEnd(stream); 11468 } 11469 var imageStream = stream.makeSubStream(startPos, length, dict); 11470 var adler32; 11471 if (length < MAX_LENGTH_TO_CACHE) { 11472 var imageBytes = imageStream.getBytes(); 11473 imageStream.reset(); 11474 var a = 1; 11475 var b = 0; 11476 for (i = 0, ii = imageBytes.length; i < ii; ++i) { 11477 a += imageBytes[i] & 0xff; 11478 b += a; 11479 } 11480 adler32 = b % 65521 << 16 | a % 65521; 11481 if (this.imageCache.adler32 === adler32) { 11482 this.buf2 = Cmd.get('EI'); 11483 this.shift(); 11484 this.imageCache[adler32].reset(); 11485 return this.imageCache[adler32]; 11486 } 11487 } 11488 if (cipherTransform) { 11489 imageStream = cipherTransform.createStream(imageStream, length); 11490 } 11491 imageStream = this.filter(imageStream, dict, length); 11492 imageStream.dict = dict; 11493 if (adler32 !== undefined) { 11494 imageStream.cacheKey = 'inline_' + length + '_' + adler32; 11495 this.imageCache[adler32] = imageStream; 11496 } 11497 this.buf2 = Cmd.get('EI'); 11498 this.shift(); 11499 return imageStream; 11500 }, 11501 makeStream: function Parser_makeStream(dict, cipherTransform) { 11502 var lexer = this.lexer; 11503 var stream = lexer.stream; 11504 lexer.skipToNextLine(); 11505 var pos = stream.pos - 1; 11506 var length = dict.get('Length'); 11507 if (!isInt(length)) { 11508 info('Bad ' + length + ' attribute in stream'); 11509 length = 0; 11510 } 11511 stream.pos = pos + length; 11512 lexer.nextChar(); 11513 if (this.tryShift() && isCmd(this.buf2, 'endstream')) { 11514 this.shift(); 11515 } else { 11516 stream.pos = pos; 11517 var SCAN_BLOCK_SIZE = 2048; 11518 var ENDSTREAM_SIGNATURE_LENGTH = 9; 11519 var ENDSTREAM_SIGNATURE = [ 11520 0x65, 11521 0x6E, 11522 0x64, 11523 0x73, 11524 0x74, 11525 0x72, 11526 0x65, 11527 0x61, 11528 0x6D 11529 ]; 11530 var skipped = 0, found = false, i, j; 11531 while (stream.pos < stream.end) { 11532 var scanBytes = stream.peekBytes(SCAN_BLOCK_SIZE); 11533 var scanLength = scanBytes.length - ENDSTREAM_SIGNATURE_LENGTH; 11534 if (scanLength <= 0) { 11535 break; 11536 } 11537 found = false; 11538 i = 0; 11539 while (i < scanLength) { 11540 j = 0; 11541 while (j < ENDSTREAM_SIGNATURE_LENGTH && scanBytes[i + j] === ENDSTREAM_SIGNATURE[j]) { 11542 j++; 11543 } 11544 if (j >= ENDSTREAM_SIGNATURE_LENGTH) { 11545 found = true; 11546 break; 11547 } 11548 i++; 11549 } 11550 if (found) { 11551 skipped += i; 11552 stream.pos += i; 11553 break; 11554 } 11555 skipped += scanLength; 11556 stream.pos += scanLength; 11557 } 11558 if (!found) { 11559 error('Missing endstream'); 11560 } 11561 length = skipped; 11562 lexer.nextChar(); 11563 this.shift(); 11564 this.shift(); 11565 } 11566 this.shift(); 11567 stream = stream.makeSubStream(pos, length, dict); 11568 if (cipherTransform) { 11569 stream = cipherTransform.createStream(stream, length); 11570 } 11571 stream = this.filter(stream, dict, length); 11572 stream.dict = dict; 11573 return stream; 11574 }, 11575 filter: function Parser_filter(stream, dict, length) { 11576 var filter = dict.get('Filter', 'F'); 11577 var params = dict.get('DecodeParms', 'DP'); 11578 if (isName(filter)) { 11579 if (isArray(params)) { 11580 params = this.xref.fetchIfRef(params[0]); 11581 } 11582 return this.makeFilter(stream, filter.name, length, params); 11583 } 11584 var maybeLength = length; 11585 if (isArray(filter)) { 11586 var filterArray = filter; 11587 var paramsArray = params; 11588 for (var i = 0, ii = filterArray.length; i < ii; ++i) { 11589 filter = this.xref.fetchIfRef(filterArray[i]); 11590 if (!isName(filter)) { 11591 error('Bad filter name: ' + filter); 11592 } 11593 params = null; 11594 if (isArray(paramsArray) && i in paramsArray) { 11595 params = this.xref.fetchIfRef(paramsArray[i]); 11596 } 11597 stream = this.makeFilter(stream, filter.name, maybeLength, params); 11598 maybeLength = null; 11599 } 11600 } 11601 return stream; 11602 }, 11603 makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { 11604 if (maybeLength === 0) { 11605 warn('Empty "' + name + '" stream.'); 11606 return new NullStream(stream); 11607 } 11608 try { 11609 var xrefStreamStats = this.xref.stats.streamTypes; 11610 if (name === 'FlateDecode' || name === 'Fl') { 11611 xrefStreamStats[StreamType.FLATE] = true; 11612 if (params) { 11613 return new PredictorStream(new FlateStream(stream, maybeLength), maybeLength, params); 11614 } 11615 return new FlateStream(stream, maybeLength); 11616 } 11617 if (name === 'LZWDecode' || name === 'LZW') { 11618 xrefStreamStats[StreamType.LZW] = true; 11619 var earlyChange = 1; 11620 if (params) { 11621 if (params.has('EarlyChange')) { 11622 earlyChange = params.get('EarlyChange'); 11623 } 11624 return new PredictorStream(new LZWStream(stream, maybeLength, earlyChange), maybeLength, params); 11625 } 11626 return new LZWStream(stream, maybeLength, earlyChange); 11627 } 11628 if (name === 'DCTDecode' || name === 'DCT') { 11629 xrefStreamStats[StreamType.DCT] = true; 11630 return new JpegStream(stream, maybeLength, stream.dict, params); 11631 } 11632 if (name === 'JPXDecode' || name === 'JPX') { 11633 xrefStreamStats[StreamType.JPX] = true; 11634 return new JpxStream(stream, maybeLength, stream.dict, params); 11635 } 11636 if (name === 'ASCII85Decode' || name === 'A85') { 11637 xrefStreamStats[StreamType.A85] = true; 11638 return new Ascii85Stream(stream, maybeLength); 11639 } 11640 if (name === 'ASCIIHexDecode' || name === 'AHx') { 11641 xrefStreamStats[StreamType.AHX] = true; 11642 return new AsciiHexStream(stream, maybeLength); 11643 } 11644 if (name === 'CCITTFaxDecode' || name === 'CCF') { 11645 xrefStreamStats[StreamType.CCF] = true; 11646 return new CCITTFaxStream(stream, maybeLength, params); 11647 } 11648 if (name === 'RunLengthDecode' || name === 'RL') { 11649 xrefStreamStats[StreamType.RL] = true; 11650 return new RunLengthStream(stream, maybeLength); 11651 } 11652 if (name === 'JBIG2Decode') { 11653 xrefStreamStats[StreamType.JBIG] = true; 11654 return new Jbig2Stream(stream, maybeLength, stream.dict, params); 11655 } 11656 warn('filter "' + name + '" not supported yet'); 11657 return stream; 11658 } catch (ex) { 11659 if (ex instanceof MissingDataException) { 11660 throw ex; 11661 } 11662 warn('Invalid stream: \"' + ex + '\"'); 11663 return new NullStream(stream); 11664 } 11665 } 11666 }; 11667 return Parser; 11668}(); 11669var Lexer = function LexerClosure() { 11670 function Lexer(stream, knownCommands) { 11671 this.stream = stream; 11672 this.nextChar(); 11673 this.strBuf = []; 11674 this.knownCommands = knownCommands; 11675 } 11676 var specialChars = [ 11677 1, 11678 0, 11679 0, 11680 0, 11681 0, 11682 0, 11683 0, 11684 0, 11685 0, 11686 1, 11687 1, 11688 0, 11689 1, 11690 1, 11691 0, 11692 0, 11693 0, 11694 0, 11695 0, 11696 0, 11697 0, 11698 0, 11699 0, 11700 0, 11701 0, 11702 0, 11703 0, 11704 0, 11705 0, 11706 0, 11707 0, 11708 0, 11709 1, 11710 0, 11711 0, 11712 0, 11713 0, 11714 2, 11715 0, 11716 0, 11717 2, 11718 2, 11719 0, 11720 0, 11721 0, 11722 0, 11723 0, 11724 2, 11725 0, 11726 0, 11727 0, 11728 0, 11729 0, 11730 0, 11731 0, 11732 0, 11733 0, 11734 0, 11735 0, 11736 0, 11737 2, 11738 0, 11739 2, 11740 0, 11741 0, 11742 0, 11743 0, 11744 0, 11745 0, 11746 0, 11747 0, 11748 0, 11749 0, 11750 0, 11751 0, 11752 0, 11753 0, 11754 0, 11755 0, 11756 0, 11757 0, 11758 0, 11759 0, 11760 0, 11761 0, 11762 0, 11763 0, 11764 0, 11765 0, 11766 0, 11767 0, 11768 2, 11769 0, 11770 2, 11771 0, 11772 0, 11773 0, 11774 0, 11775 0, 11776 0, 11777 0, 11778 0, 11779 0, 11780 0, 11781 0, 11782 0, 11783 0, 11784 0, 11785 0, 11786 0, 11787 0, 11788 0, 11789 0, 11790 0, 11791 0, 11792 0, 11793 0, 11794 0, 11795 0, 11796 0, 11797 0, 11798 0, 11799 0, 11800 2, 11801 0, 11802 2, 11803 0, 11804 0, 11805 0, 11806 0, 11807 0, 11808 0, 11809 0, 11810 0, 11811 0, 11812 0, 11813 0, 11814 0, 11815 0, 11816 0, 11817 0, 11818 0, 11819 0, 11820 0, 11821 0, 11822 0, 11823 0, 11824 0, 11825 0, 11826 0, 11827 0, 11828 0, 11829 0, 11830 0, 11831 0, 11832 0, 11833 0, 11834 0, 11835 0, 11836 0, 11837 0, 11838 0, 11839 0, 11840 0, 11841 0, 11842 0, 11843 0, 11844 0, 11845 0, 11846 0, 11847 0, 11848 0, 11849 0, 11850 0, 11851 0, 11852 0, 11853 0, 11854 0, 11855 0, 11856 0, 11857 0, 11858 0, 11859 0, 11860 0, 11861 0, 11862 0, 11863 0, 11864 0, 11865 0, 11866 0, 11867 0, 11868 0, 11869 0, 11870 0, 11871 0, 11872 0, 11873 0, 11874 0, 11875 0, 11876 0, 11877 0, 11878 0, 11879 0, 11880 0, 11881 0, 11882 0, 11883 0, 11884 0, 11885 0, 11886 0, 11887 0, 11888 0, 11889 0, 11890 0, 11891 0, 11892 0, 11893 0, 11894 0, 11895 0, 11896 0, 11897 0, 11898 0, 11899 0, 11900 0, 11901 0, 11902 0, 11903 0, 11904 0, 11905 0, 11906 0, 11907 0, 11908 0, 11909 0, 11910 0, 11911 0, 11912 0, 11913 0, 11914 0, 11915 0, 11916 0, 11917 0, 11918 0, 11919 0, 11920 0, 11921 0, 11922 0, 11923 0, 11924 0, 11925 0, 11926 0, 11927 0, 11928 0, 11929 0, 11930 0, 11931 0, 11932 0 11933 ]; 11934 function toHexDigit(ch) { 11935 if (ch >= 0x30 && ch <= 0x39) { 11936 return ch & 0x0F; 11937 } 11938 if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 11939 return (ch & 0x0F) + 9; 11940 } 11941 return -1; 11942 } 11943 Lexer.prototype = { 11944 nextChar: function Lexer_nextChar() { 11945 return this.currentChar = this.stream.getByte(); 11946 }, 11947 peekChar: function Lexer_peekChar() { 11948 return this.stream.peekByte(); 11949 }, 11950 getNumber: function Lexer_getNumber() { 11951 var ch = this.currentChar; 11952 var eNotation = false; 11953 var divideBy = 0; 11954 var sign = 1; 11955 if (ch === 0x2D) { 11956 sign = -1; 11957 ch = this.nextChar(); 11958 if (ch === 0x2D) { 11959 ch = this.nextChar(); 11960 } 11961 } else if (ch === 0x2B) { 11962 ch = this.nextChar(); 11963 } 11964 if (ch === 0x2E) { 11965 divideBy = 10; 11966 ch = this.nextChar(); 11967 } 11968 if (ch < 0x30 || ch > 0x39) { 11969 error('Invalid number: ' + String.fromCharCode(ch)); 11970 return 0; 11971 } 11972 var baseValue = ch - 0x30; 11973 var powerValue = 0; 11974 var powerValueSign = 1; 11975 while ((ch = this.nextChar()) >= 0) { 11976 if (0x30 <= ch && ch <= 0x39) { 11977 var currentDigit = ch - 0x30; 11978 if (eNotation) { 11979 powerValue = powerValue * 10 + currentDigit; 11980 } else { 11981 if (divideBy !== 0) { 11982 divideBy *= 10; 11983 } 11984 baseValue = baseValue * 10 + currentDigit; 11985 } 11986 } else if (ch === 0x2E) { 11987 if (divideBy === 0) { 11988 divideBy = 1; 11989 } else { 11990 break; 11991 } 11992 } else if (ch === 0x2D) { 11993 warn('Badly formatted number'); 11994 } else if (ch === 0x45 || ch === 0x65) { 11995 ch = this.peekChar(); 11996 if (ch === 0x2B || ch === 0x2D) { 11997 powerValueSign = ch === 0x2D ? -1 : 1; 11998 this.nextChar(); 11999 } else if (ch < 0x30 || ch > 0x39) { 12000 break; 12001 } 12002 eNotation = true; 12003 } else { 12004 break; 12005 } 12006 } 12007 if (divideBy !== 0) { 12008 baseValue /= divideBy; 12009 } 12010 if (eNotation) { 12011 baseValue *= Math.pow(10, powerValueSign * powerValue); 12012 } 12013 return sign * baseValue; 12014 }, 12015 getString: function Lexer_getString() { 12016 var numParen = 1; 12017 var done = false; 12018 var strBuf = this.strBuf; 12019 strBuf.length = 0; 12020 var ch = this.nextChar(); 12021 while (true) { 12022 var charBuffered = false; 12023 switch (ch | 0) { 12024 case -1: 12025 warn('Unterminated string'); 12026 done = true; 12027 break; 12028 case 0x28: 12029 ++numParen; 12030 strBuf.push('('); 12031 break; 12032 case 0x29: 12033 if (--numParen === 0) { 12034 this.nextChar(); 12035 done = true; 12036 } else { 12037 strBuf.push(')'); 12038 } 12039 break; 12040 case 0x5C: 12041 ch = this.nextChar(); 12042 switch (ch) { 12043 case -1: 12044 warn('Unterminated string'); 12045 done = true; 12046 break; 12047 case 0x6E: 12048 strBuf.push('\n'); 12049 break; 12050 case 0x72: 12051 strBuf.push('\r'); 12052 break; 12053 case 0x74: 12054 strBuf.push('\t'); 12055 break; 12056 case 0x62: 12057 strBuf.push('\b'); 12058 break; 12059 case 0x66: 12060 strBuf.push('\f'); 12061 break; 12062 case 0x5C: 12063 case 0x28: 12064 case 0x29: 12065 strBuf.push(String.fromCharCode(ch)); 12066 break; 12067 case 0x30: 12068 case 0x31: 12069 case 0x32: 12070 case 0x33: 12071 case 0x34: 12072 case 0x35: 12073 case 0x36: 12074 case 0x37: 12075 var x = ch & 0x0F; 12076 ch = this.nextChar(); 12077 charBuffered = true; 12078 if (ch >= 0x30 && ch <= 0x37) { 12079 x = (x << 3) + (ch & 0x0F); 12080 ch = this.nextChar(); 12081 if (ch >= 0x30 && ch <= 0x37) { 12082 charBuffered = false; 12083 x = (x << 3) + (ch & 0x0F); 12084 } 12085 } 12086 strBuf.push(String.fromCharCode(x)); 12087 break; 12088 case 0x0D: 12089 if (this.peekChar() === 0x0A) { 12090 this.nextChar(); 12091 } 12092 break; 12093 case 0x0A: 12094 break; 12095 default: 12096 strBuf.push(String.fromCharCode(ch)); 12097 break; 12098 } 12099 break; 12100 default: 12101 strBuf.push(String.fromCharCode(ch)); 12102 break; 12103 } 12104 if (done) { 12105 break; 12106 } 12107 if (!charBuffered) { 12108 ch = this.nextChar(); 12109 } 12110 } 12111 return strBuf.join(''); 12112 }, 12113 getName: function Lexer_getName() { 12114 var ch, previousCh; 12115 var strBuf = this.strBuf; 12116 strBuf.length = 0; 12117 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 12118 if (ch === 0x23) { 12119 ch = this.nextChar(); 12120 if (specialChars[ch]) { 12121 warn('Lexer_getName: ' + 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); 12122 strBuf.push('#'); 12123 break; 12124 } 12125 var x = toHexDigit(ch); 12126 if (x !== -1) { 12127 previousCh = ch; 12128 ch = this.nextChar(); 12129 var x2 = toHexDigit(ch); 12130 if (x2 === -1) { 12131 warn('Lexer_getName: Illegal digit (' + String.fromCharCode(ch) + ') in hexadecimal number.'); 12132 strBuf.push('#', String.fromCharCode(previousCh)); 12133 if (specialChars[ch]) { 12134 break; 12135 } 12136 strBuf.push(String.fromCharCode(ch)); 12137 continue; 12138 } 12139 strBuf.push(String.fromCharCode(x << 4 | x2)); 12140 } else { 12141 strBuf.push('#', String.fromCharCode(ch)); 12142 } 12143 } else { 12144 strBuf.push(String.fromCharCode(ch)); 12145 } 12146 } 12147 if (strBuf.length > 127) { 12148 warn('name token is longer than allowed by the spec: ' + strBuf.length); 12149 } 12150 return Name.get(strBuf.join('')); 12151 }, 12152 getHexString: function Lexer_getHexString() { 12153 var strBuf = this.strBuf; 12154 strBuf.length = 0; 12155 var ch = this.currentChar; 12156 var isFirstHex = true; 12157 var firstDigit; 12158 var secondDigit; 12159 while (true) { 12160 if (ch < 0) { 12161 warn('Unterminated hex string'); 12162 break; 12163 } else if (ch === 0x3E) { 12164 this.nextChar(); 12165 break; 12166 } else if (specialChars[ch] === 1) { 12167 ch = this.nextChar(); 12168 continue; 12169 } else { 12170 if (isFirstHex) { 12171 firstDigit = toHexDigit(ch); 12172 if (firstDigit === -1) { 12173 warn('Ignoring invalid character "' + ch + '" in hex string'); 12174 ch = this.nextChar(); 12175 continue; 12176 } 12177 } else { 12178 secondDigit = toHexDigit(ch); 12179 if (secondDigit === -1) { 12180 warn('Ignoring invalid character "' + ch + '" in hex string'); 12181 ch = this.nextChar(); 12182 continue; 12183 } 12184 strBuf.push(String.fromCharCode(firstDigit << 4 | secondDigit)); 12185 } 12186 isFirstHex = !isFirstHex; 12187 ch = this.nextChar(); 12188 } 12189 } 12190 return strBuf.join(''); 12191 }, 12192 getObj: function Lexer_getObj() { 12193 var comment = false; 12194 var ch = this.currentChar; 12195 while (true) { 12196 if (ch < 0) { 12197 return EOF; 12198 } 12199 if (comment) { 12200 if (ch === 0x0A || ch === 0x0D) { 12201 comment = false; 12202 } 12203 } else if (ch === 0x25) { 12204 comment = true; 12205 } else if (specialChars[ch] !== 1) { 12206 break; 12207 } 12208 ch = this.nextChar(); 12209 } 12210 switch (ch | 0) { 12211 case 0x30: 12212 case 0x31: 12213 case 0x32: 12214 case 0x33: 12215 case 0x34: 12216 case 0x35: 12217 case 0x36: 12218 case 0x37: 12219 case 0x38: 12220 case 0x39: 12221 case 0x2B: 12222 case 0x2D: 12223 case 0x2E: 12224 return this.getNumber(); 12225 case 0x28: 12226 return this.getString(); 12227 case 0x2F: 12228 return this.getName(); 12229 case 0x5B: 12230 this.nextChar(); 12231 return Cmd.get('['); 12232 case 0x5D: 12233 this.nextChar(); 12234 return Cmd.get(']'); 12235 case 0x3C: 12236 ch = this.nextChar(); 12237 if (ch === 0x3C) { 12238 this.nextChar(); 12239 return Cmd.get('<<'); 12240 } 12241 return this.getHexString(); 12242 case 0x3E: 12243 ch = this.nextChar(); 12244 if (ch === 0x3E) { 12245 this.nextChar(); 12246 return Cmd.get('>>'); 12247 } 12248 return Cmd.get('>'); 12249 case 0x7B: 12250 this.nextChar(); 12251 return Cmd.get('{'); 12252 case 0x7D: 12253 this.nextChar(); 12254 return Cmd.get('}'); 12255 case 0x29: 12256 this.nextChar(); 12257 error('Illegal character: ' + ch); 12258 break; 12259 } 12260 var str = String.fromCharCode(ch); 12261 var knownCommands = this.knownCommands; 12262 var knownCommandFound = knownCommands && knownCommands[str] !== undefined; 12263 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 12264 var possibleCommand = str + String.fromCharCode(ch); 12265 if (knownCommandFound && knownCommands[possibleCommand] === undefined) { 12266 break; 12267 } 12268 if (str.length === 128) { 12269 error('Command token too long: ' + str.length); 12270 } 12271 str = possibleCommand; 12272 knownCommandFound = knownCommands && knownCommands[str] !== undefined; 12273 } 12274 if (str === 'true') { 12275 return true; 12276 } 12277 if (str === 'false') { 12278 return false; 12279 } 12280 if (str === 'null') { 12281 return null; 12282 } 12283 return Cmd.get(str); 12284 }, 12285 skipToNextLine: function Lexer_skipToNextLine() { 12286 var ch = this.currentChar; 12287 while (ch >= 0) { 12288 if (ch === 0x0D) { 12289 ch = this.nextChar(); 12290 if (ch === 0x0A) { 12291 this.nextChar(); 12292 } 12293 break; 12294 } else if (ch === 0x0A) { 12295 this.nextChar(); 12296 break; 12297 } 12298 ch = this.nextChar(); 12299 } 12300 } 12301 }; 12302 return Lexer; 12303}(); 12304var Linearization = { 12305 create: function LinearizationCreate(stream) { 12306 function getInt(name, allowZeroValue) { 12307 var obj = linDict.get(name); 12308 if (isInt(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { 12309 return obj; 12310 } 12311 throw new Error('The "' + name + '" parameter in the linearization ' + 'dictionary is invalid.'); 12312 } 12313 function getHints() { 12314 var hints = linDict.get('H'), hintsLength, item; 12315 if (isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) { 12316 for (var index = 0; index < hintsLength; index++) { 12317 if (!(isInt(item = hints[index]) && item > 0)) { 12318 throw new Error('Hint (' + index + ') in the linearization dictionary is invalid.'); 12319 } 12320 } 12321 return hints; 12322 } 12323 throw new Error('Hint array in the linearization dictionary is invalid.'); 12324 } 12325 var parser = new Parser(new Lexer(stream), false, null); 12326 var obj1 = parser.getObj(); 12327 var obj2 = parser.getObj(); 12328 var obj3 = parser.getObj(); 12329 var linDict = parser.getObj(); 12330 var obj, length; 12331 if (!(isInt(obj1) && isInt(obj2) && isCmd(obj3, 'obj') && isDict(linDict) && isNum(obj = linDict.get('Linearized')) && obj > 0)) { 12332 return null; 12333 } else if ((length = getInt('L')) !== stream.length) { 12334 throw new Error('The "L" parameter in the linearization dictionary ' + 'does not equal the stream length.'); 12335 } 12336 return { 12337 length: length, 12338 hints: getHints(), 12339 objectNumberFirst: getInt('O'), 12340 endFirst: getInt('E'), 12341 numPages: getInt('N'), 12342 mainXRefEntriesOffset: getInt('T'), 12343 pageFirst: linDict.has('P') ? getInt('P', true) : 0 12344 }; 12345 } 12346}; 12347exports.Lexer = Lexer; 12348exports.Linearization = Linearization; 12349exports.Parser = Parser; 12350 12351/***/ }), 12352/* 6 */ 12353/***/ (function(module, exports, __w_pdfjs_require__) { 12354 12355"use strict"; 12356 12357var sharedUtil = __w_pdfjs_require__(0); 12358var corePrimitives = __w_pdfjs_require__(1); 12359var corePsParser = __w_pdfjs_require__(34); 12360var error = sharedUtil.error; 12361var info = sharedUtil.info; 12362var isArray = sharedUtil.isArray; 12363var isBool = sharedUtil.isBool; 12364var isDict = corePrimitives.isDict; 12365var isStream = corePrimitives.isStream; 12366var PostScriptLexer = corePsParser.PostScriptLexer; 12367var PostScriptParser = corePsParser.PostScriptParser; 12368var PDFFunction = function PDFFunctionClosure() { 12369 var CONSTRUCT_SAMPLED = 0; 12370 var CONSTRUCT_INTERPOLATED = 2; 12371 var CONSTRUCT_STICHED = 3; 12372 var CONSTRUCT_POSTSCRIPT = 4; 12373 return { 12374 getSampleArray: function PDFFunction_getSampleArray(size, outputSize, bps, str) { 12375 var i, ii; 12376 var length = 1; 12377 for (i = 0, ii = size.length; i < ii; i++) { 12378 length *= size[i]; 12379 } 12380 length *= outputSize; 12381 var array = new Array(length); 12382 var codeSize = 0; 12383 var codeBuf = 0; 12384 var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); 12385 var strBytes = str.getBytes((length * bps + 7) / 8); 12386 var strIdx = 0; 12387 for (i = 0; i < length; i++) { 12388 while (codeSize < bps) { 12389 codeBuf <<= 8; 12390 codeBuf |= strBytes[strIdx++]; 12391 codeSize += 8; 12392 } 12393 codeSize -= bps; 12394 array[i] = (codeBuf >> codeSize) * sampleMul; 12395 codeBuf &= (1 << codeSize) - 1; 12396 } 12397 return array; 12398 }, 12399 getIR: function PDFFunction_getIR(xref, fn) { 12400 var dict = fn.dict; 12401 if (!dict) { 12402 dict = fn; 12403 } 12404 var types = [ 12405 this.constructSampled, 12406 null, 12407 this.constructInterpolated, 12408 this.constructStiched, 12409 this.constructPostScript 12410 ]; 12411 var typeNum = dict.get('FunctionType'); 12412 var typeFn = types[typeNum]; 12413 if (!typeFn) { 12414 error('Unknown type of function'); 12415 } 12416 return typeFn.call(this, fn, dict, xref); 12417 }, 12418 fromIR: function PDFFunction_fromIR(IR) { 12419 var type = IR[0]; 12420 switch (type) { 12421 case CONSTRUCT_SAMPLED: 12422 return this.constructSampledFromIR(IR); 12423 case CONSTRUCT_INTERPOLATED: 12424 return this.constructInterpolatedFromIR(IR); 12425 case CONSTRUCT_STICHED: 12426 return this.constructStichedFromIR(IR); 12427 default: 12428 return this.constructPostScriptFromIR(IR); 12429 } 12430 }, 12431 parse: function PDFFunction_parse(xref, fn) { 12432 var IR = this.getIR(xref, fn); 12433 return this.fromIR(IR); 12434 }, 12435 parseArray: function PDFFunction_parseArray(xref, fnObj) { 12436 if (!isArray(fnObj)) { 12437 return this.parse(xref, fnObj); 12438 } 12439 var fnArray = []; 12440 for (var j = 0, jj = fnObj.length; j < jj; j++) { 12441 var obj = xref.fetchIfRef(fnObj[j]); 12442 fnArray.push(PDFFunction.parse(xref, obj)); 12443 } 12444 return function (src, srcOffset, dest, destOffset) { 12445 for (var i = 0, ii = fnArray.length; i < ii; i++) { 12446 fnArray[i](src, srcOffset, dest, destOffset + i); 12447 } 12448 }; 12449 }, 12450 constructSampled: function PDFFunction_constructSampled(str, dict) { 12451 function toMultiArray(arr) { 12452 var inputLength = arr.length; 12453 var out = []; 12454 var index = 0; 12455 for (var i = 0; i < inputLength; i += 2) { 12456 out[index] = [ 12457 arr[i], 12458 arr[i + 1] 12459 ]; 12460 ++index; 12461 } 12462 return out; 12463 } 12464 var domain = dict.getArray('Domain'); 12465 var range = dict.getArray('Range'); 12466 if (!domain || !range) { 12467 error('No domain or range'); 12468 } 12469 var inputSize = domain.length / 2; 12470 var outputSize = range.length / 2; 12471 domain = toMultiArray(domain); 12472 range = toMultiArray(range); 12473 var size = dict.get('Size'); 12474 var bps = dict.get('BitsPerSample'); 12475 var order = dict.get('Order') || 1; 12476 if (order !== 1) { 12477 info('No support for cubic spline interpolation: ' + order); 12478 } 12479 var encode = dict.getArray('Encode'); 12480 if (!encode) { 12481 encode = []; 12482 for (var i = 0; i < inputSize; ++i) { 12483 encode.push(0); 12484 encode.push(size[i] - 1); 12485 } 12486 } 12487 encode = toMultiArray(encode); 12488 var decode = dict.getArray('Decode'); 12489 if (!decode) { 12490 decode = range; 12491 } else { 12492 decode = toMultiArray(decode); 12493 } 12494 var samples = this.getSampleArray(size, outputSize, bps, str); 12495 return [ 12496 CONSTRUCT_SAMPLED, 12497 inputSize, 12498 domain, 12499 encode, 12500 decode, 12501 samples, 12502 size, 12503 outputSize, 12504 Math.pow(2, bps) - 1, 12505 range 12506 ]; 12507 }, 12508 constructSampledFromIR: function PDFFunction_constructSampledFromIR(IR) { 12509 function interpolate(x, xmin, xmax, ymin, ymax) { 12510 return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); 12511 } 12512 return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { 12513 var m = IR[1]; 12514 var domain = IR[2]; 12515 var encode = IR[3]; 12516 var decode = IR[4]; 12517 var samples = IR[5]; 12518 var size = IR[6]; 12519 var n = IR[7]; 12520 var range = IR[9]; 12521 var cubeVertices = 1 << m; 12522 var cubeN = new Float64Array(cubeVertices); 12523 var cubeVertex = new Uint32Array(cubeVertices); 12524 var i, j; 12525 for (j = 0; j < cubeVertices; j++) { 12526 cubeN[j] = 1; 12527 } 12528 var k = n, pos = 1; 12529 for (i = 0; i < m; ++i) { 12530 var domain_2i = domain[i][0]; 12531 var domain_2i_1 = domain[i][1]; 12532 var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); 12533 var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); 12534 var size_i = size[i]; 12535 e = Math.min(Math.max(e, 0), size_i - 1); 12536 var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; 12537 var n0 = e0 + 1 - e; 12538 var n1 = e - e0; 12539 var offset0 = e0 * k; 12540 var offset1 = offset0 + k; 12541 for (j = 0; j < cubeVertices; j++) { 12542 if (j & pos) { 12543 cubeN[j] *= n1; 12544 cubeVertex[j] += offset1; 12545 } else { 12546 cubeN[j] *= n0; 12547 cubeVertex[j] += offset0; 12548 } 12549 } 12550 k *= size_i; 12551 pos <<= 1; 12552 } 12553 for (j = 0; j < n; ++j) { 12554 var rj = 0; 12555 for (i = 0; i < cubeVertices; i++) { 12556 rj += samples[cubeVertex[i] + j] * cubeN[i]; 12557 } 12558 rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); 12559 dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); 12560 } 12561 }; 12562 }, 12563 constructInterpolated: function PDFFunction_constructInterpolated(str, dict) { 12564 var c0 = dict.getArray('C0') || [0]; 12565 var c1 = dict.getArray('C1') || [1]; 12566 var n = dict.get('N'); 12567 if (!isArray(c0) || !isArray(c1)) { 12568 error('Illegal dictionary for interpolated function'); 12569 } 12570 var length = c0.length; 12571 var diff = []; 12572 for (var i = 0; i < length; ++i) { 12573 diff.push(c1[i] - c0[i]); 12574 } 12575 return [ 12576 CONSTRUCT_INTERPOLATED, 12577 c0, 12578 diff, 12579 n 12580 ]; 12581 }, 12582 constructInterpolatedFromIR: function PDFFunction_constructInterpolatedFromIR(IR) { 12583 var c0 = IR[1]; 12584 var diff = IR[2]; 12585 var n = IR[3]; 12586 var length = diff.length; 12587 return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOffset) { 12588 var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); 12589 for (var j = 0; j < length; ++j) { 12590 dest[destOffset + j] = c0[j] + x * diff[j]; 12591 } 12592 }; 12593 }, 12594 constructStiched: function PDFFunction_constructStiched(fn, dict, xref) { 12595 var domain = dict.getArray('Domain'); 12596 if (!domain) { 12597 error('No domain'); 12598 } 12599 var inputSize = domain.length / 2; 12600 if (inputSize !== 1) { 12601 error('Bad domain for stiched function'); 12602 } 12603 var fnRefs = dict.get('Functions'); 12604 var fns = []; 12605 for (var i = 0, ii = fnRefs.length; i < ii; ++i) { 12606 fns.push(PDFFunction.getIR(xref, xref.fetchIfRef(fnRefs[i]))); 12607 } 12608 var bounds = dict.getArray('Bounds'); 12609 var encode = dict.getArray('Encode'); 12610 return [ 12611 CONSTRUCT_STICHED, 12612 domain, 12613 bounds, 12614 encode, 12615 fns 12616 ]; 12617 }, 12618 constructStichedFromIR: function PDFFunction_constructStichedFromIR(IR) { 12619 var domain = IR[1]; 12620 var bounds = IR[2]; 12621 var encode = IR[3]; 12622 var fnsIR = IR[4]; 12623 var fns = []; 12624 var tmpBuf = new Float32Array(1); 12625 for (var i = 0, ii = fnsIR.length; i < ii; i++) { 12626 fns.push(PDFFunction.fromIR(fnsIR[i])); 12627 } 12628 return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { 12629 var clip = function constructStichedFromIRClip(v, min, max) { 12630 if (v > max) { 12631 v = max; 12632 } else if (v < min) { 12633 v = min; 12634 } 12635 return v; 12636 }; 12637 var v = clip(src[srcOffset], domain[0], domain[1]); 12638 for (var i = 0, ii = bounds.length; i < ii; ++i) { 12639 if (v < bounds[i]) { 12640 break; 12641 } 12642 } 12643 var dmin = domain[0]; 12644 if (i > 0) { 12645 dmin = bounds[i - 1]; 12646 } 12647 var dmax = domain[1]; 12648 if (i < bounds.length) { 12649 dmax = bounds[i]; 12650 } 12651 var rmin = encode[2 * i]; 12652 var rmax = encode[2 * i + 1]; 12653 tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); 12654 fns[i](tmpBuf, 0, dest, destOffset); 12655 }; 12656 }, 12657 constructPostScript: function PDFFunction_constructPostScript(fn, dict, xref) { 12658 var domain = dict.getArray('Domain'); 12659 var range = dict.getArray('Range'); 12660 if (!domain) { 12661 error('No domain.'); 12662 } 12663 if (!range) { 12664 error('No range.'); 12665 } 12666 var lexer = new PostScriptLexer(fn); 12667 var parser = new PostScriptParser(lexer); 12668 var code = parser.parse(); 12669 return [ 12670 CONSTRUCT_POSTSCRIPT, 12671 domain, 12672 range, 12673 code 12674 ]; 12675 }, 12676 constructPostScriptFromIR: function PDFFunction_constructPostScriptFromIR(IR) { 12677 var domain = IR[1]; 12678 var range = IR[2]; 12679 var code = IR[3]; 12680 var compiled = new PostScriptCompiler().compile(code, domain, range); 12681 if (compiled) { 12682 return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); 12683 } 12684 info('Unable to compile PS function'); 12685 var numOutputs = range.length >> 1; 12686 var numInputs = domain.length >> 1; 12687 var evaluator = new PostScriptEvaluator(code); 12688 var cache = Object.create(null); 12689 var MAX_CACHE_SIZE = 2048 * 4; 12690 var cache_available = MAX_CACHE_SIZE; 12691 var tmpBuf = new Float32Array(numInputs); 12692 return function constructPostScriptFromIRResult(src, srcOffset, dest, destOffset) { 12693 var i, value; 12694 var key = ''; 12695 var input = tmpBuf; 12696 for (i = 0; i < numInputs; i++) { 12697 value = src[srcOffset + i]; 12698 input[i] = value; 12699 key += value + '_'; 12700 } 12701 var cachedValue = cache[key]; 12702 if (cachedValue !== undefined) { 12703 dest.set(cachedValue, destOffset); 12704 return; 12705 } 12706 var output = new Float32Array(numOutputs); 12707 var stack = evaluator.execute(input); 12708 var stackIndex = stack.length - numOutputs; 12709 for (i = 0; i < numOutputs; i++) { 12710 value = stack[stackIndex + i]; 12711 var bound = range[i * 2]; 12712 if (value < bound) { 12713 value = bound; 12714 } else { 12715 bound = range[i * 2 + 1]; 12716 if (value > bound) { 12717 value = bound; 12718 } 12719 } 12720 output[i] = value; 12721 } 12722 if (cache_available > 0) { 12723 cache_available--; 12724 cache[key] = output; 12725 } 12726 dest.set(output, destOffset); 12727 }; 12728 } 12729 }; 12730}(); 12731function isPDFFunction(v) { 12732 var fnDict; 12733 if (typeof v !== 'object') { 12734 return false; 12735 } else if (isDict(v)) { 12736 fnDict = v; 12737 } else if (isStream(v)) { 12738 fnDict = v.dict; 12739 } else { 12740 return false; 12741 } 12742 return fnDict.has('FunctionType'); 12743} 12744var PostScriptStack = function PostScriptStackClosure() { 12745 var MAX_STACK_SIZE = 100; 12746 function PostScriptStack(initialStack) { 12747 this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); 12748 } 12749 PostScriptStack.prototype = { 12750 push: function PostScriptStack_push(value) { 12751 if (this.stack.length >= MAX_STACK_SIZE) { 12752 error('PostScript function stack overflow.'); 12753 } 12754 this.stack.push(value); 12755 }, 12756 pop: function PostScriptStack_pop() { 12757 if (this.stack.length <= 0) { 12758 error('PostScript function stack underflow.'); 12759 } 12760 return this.stack.pop(); 12761 }, 12762 copy: function PostScriptStack_copy(n) { 12763 if (this.stack.length + n >= MAX_STACK_SIZE) { 12764 error('PostScript function stack overflow.'); 12765 } 12766 var stack = this.stack; 12767 for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { 12768 stack.push(stack[i]); 12769 } 12770 }, 12771 index: function PostScriptStack_index(n) { 12772 this.push(this.stack[this.stack.length - n - 1]); 12773 }, 12774 roll: function PostScriptStack_roll(n, p) { 12775 var stack = this.stack; 12776 var l = stack.length - n; 12777 var r = stack.length - 1, c = l + (p - Math.floor(p / n) * n), i, j, t; 12778 for (i = l, j = r; i < j; i++, j--) { 12779 t = stack[i]; 12780 stack[i] = stack[j]; 12781 stack[j] = t; 12782 } 12783 for (i = l, j = c - 1; i < j; i++, j--) { 12784 t = stack[i]; 12785 stack[i] = stack[j]; 12786 stack[j] = t; 12787 } 12788 for (i = c, j = r; i < j; i++, j--) { 12789 t = stack[i]; 12790 stack[i] = stack[j]; 12791 stack[j] = t; 12792 } 12793 } 12794 }; 12795 return PostScriptStack; 12796}(); 12797var PostScriptEvaluator = function PostScriptEvaluatorClosure() { 12798 function PostScriptEvaluator(operators) { 12799 this.operators = operators; 12800 } 12801 PostScriptEvaluator.prototype = { 12802 execute: function PostScriptEvaluator_execute(initialStack) { 12803 var stack = new PostScriptStack(initialStack); 12804 var counter = 0; 12805 var operators = this.operators; 12806 var length = operators.length; 12807 var operator, a, b; 12808 while (counter < length) { 12809 operator = operators[counter++]; 12810 if (typeof operator === 'number') { 12811 stack.push(operator); 12812 continue; 12813 } 12814 switch (operator) { 12815 case 'jz': 12816 b = stack.pop(); 12817 a = stack.pop(); 12818 if (!a) { 12819 counter = b; 12820 } 12821 break; 12822 case 'j': 12823 a = stack.pop(); 12824 counter = a; 12825 break; 12826 case 'abs': 12827 a = stack.pop(); 12828 stack.push(Math.abs(a)); 12829 break; 12830 case 'add': 12831 b = stack.pop(); 12832 a = stack.pop(); 12833 stack.push(a + b); 12834 break; 12835 case 'and': 12836 b = stack.pop(); 12837 a = stack.pop(); 12838 if (isBool(a) && isBool(b)) { 12839 stack.push(a && b); 12840 } else { 12841 stack.push(a & b); 12842 } 12843 break; 12844 case 'atan': 12845 a = stack.pop(); 12846 stack.push(Math.atan(a)); 12847 break; 12848 case 'bitshift': 12849 b = stack.pop(); 12850 a = stack.pop(); 12851 if (a > 0) { 12852 stack.push(a << b); 12853 } else { 12854 stack.push(a >> b); 12855 } 12856 break; 12857 case 'ceiling': 12858 a = stack.pop(); 12859 stack.push(Math.ceil(a)); 12860 break; 12861 case 'copy': 12862 a = stack.pop(); 12863 stack.copy(a); 12864 break; 12865 case 'cos': 12866 a = stack.pop(); 12867 stack.push(Math.cos(a)); 12868 break; 12869 case 'cvi': 12870 a = stack.pop() | 0; 12871 stack.push(a); 12872 break; 12873 case 'cvr': 12874 break; 12875 case 'div': 12876 b = stack.pop(); 12877 a = stack.pop(); 12878 stack.push(a / b); 12879 break; 12880 case 'dup': 12881 stack.copy(1); 12882 break; 12883 case 'eq': 12884 b = stack.pop(); 12885 a = stack.pop(); 12886 stack.push(a === b); 12887 break; 12888 case 'exch': 12889 stack.roll(2, 1); 12890 break; 12891 case 'exp': 12892 b = stack.pop(); 12893 a = stack.pop(); 12894 stack.push(Math.pow(a, b)); 12895 break; 12896 case 'false': 12897 stack.push(false); 12898 break; 12899 case 'floor': 12900 a = stack.pop(); 12901 stack.push(Math.floor(a)); 12902 break; 12903 case 'ge': 12904 b = stack.pop(); 12905 a = stack.pop(); 12906 stack.push(a >= b); 12907 break; 12908 case 'gt': 12909 b = stack.pop(); 12910 a = stack.pop(); 12911 stack.push(a > b); 12912 break; 12913 case 'idiv': 12914 b = stack.pop(); 12915 a = stack.pop(); 12916 stack.push(a / b | 0); 12917 break; 12918 case 'index': 12919 a = stack.pop(); 12920 stack.index(a); 12921 break; 12922 case 'le': 12923 b = stack.pop(); 12924 a = stack.pop(); 12925 stack.push(a <= b); 12926 break; 12927 case 'ln': 12928 a = stack.pop(); 12929 stack.push(Math.log(a)); 12930 break; 12931 case 'log': 12932 a = stack.pop(); 12933 stack.push(Math.log(a) / Math.LN10); 12934 break; 12935 case 'lt': 12936 b = stack.pop(); 12937 a = stack.pop(); 12938 stack.push(a < b); 12939 break; 12940 case 'mod': 12941 b = stack.pop(); 12942 a = stack.pop(); 12943 stack.push(a % b); 12944 break; 12945 case 'mul': 12946 b = stack.pop(); 12947 a = stack.pop(); 12948 stack.push(a * b); 12949 break; 12950 case 'ne': 12951 b = stack.pop(); 12952 a = stack.pop(); 12953 stack.push(a !== b); 12954 break; 12955 case 'neg': 12956 a = stack.pop(); 12957 stack.push(-a); 12958 break; 12959 case 'not': 12960 a = stack.pop(); 12961 if (isBool(a)) { 12962 stack.push(!a); 12963 } else { 12964 stack.push(~a); 12965 } 12966 break; 12967 case 'or': 12968 b = stack.pop(); 12969 a = stack.pop(); 12970 if (isBool(a) && isBool(b)) { 12971 stack.push(a || b); 12972 } else { 12973 stack.push(a | b); 12974 } 12975 break; 12976 case 'pop': 12977 stack.pop(); 12978 break; 12979 case 'roll': 12980 b = stack.pop(); 12981 a = stack.pop(); 12982 stack.roll(a, b); 12983 break; 12984 case 'round': 12985 a = stack.pop(); 12986 stack.push(Math.round(a)); 12987 break; 12988 case 'sin': 12989 a = stack.pop(); 12990 stack.push(Math.sin(a)); 12991 break; 12992 case 'sqrt': 12993 a = stack.pop(); 12994 stack.push(Math.sqrt(a)); 12995 break; 12996 case 'sub': 12997 b = stack.pop(); 12998 a = stack.pop(); 12999 stack.push(a - b); 13000 break; 13001 case 'true': 13002 stack.push(true); 13003 break; 13004 case 'truncate': 13005 a = stack.pop(); 13006 a = a < 0 ? Math.ceil(a) : Math.floor(a); 13007 stack.push(a); 13008 break; 13009 case 'xor': 13010 b = stack.pop(); 13011 a = stack.pop(); 13012 if (isBool(a) && isBool(b)) { 13013 stack.push(a !== b); 13014 } else { 13015 stack.push(a ^ b); 13016 } 13017 break; 13018 default: 13019 error('Unknown operator ' + operator); 13020 break; 13021 } 13022 } 13023 return stack.stack; 13024 } 13025 }; 13026 return PostScriptEvaluator; 13027}(); 13028var PostScriptCompiler = function PostScriptCompilerClosure() { 13029 function AstNode(type) { 13030 this.type = type; 13031 } 13032 AstNode.prototype.visit = function (visitor) { 13033 throw new Error('abstract method'); 13034 }; 13035 function AstArgument(index, min, max) { 13036 AstNode.call(this, 'args'); 13037 this.index = index; 13038 this.min = min; 13039 this.max = max; 13040 } 13041 AstArgument.prototype = Object.create(AstNode.prototype); 13042 AstArgument.prototype.visit = function (visitor) { 13043 visitor.visitArgument(this); 13044 }; 13045 function AstLiteral(number) { 13046 AstNode.call(this, 'literal'); 13047 this.number = number; 13048 this.min = number; 13049 this.max = number; 13050 } 13051 AstLiteral.prototype = Object.create(AstNode.prototype); 13052 AstLiteral.prototype.visit = function (visitor) { 13053 visitor.visitLiteral(this); 13054 }; 13055 function AstBinaryOperation(op, arg1, arg2, min, max) { 13056 AstNode.call(this, 'binary'); 13057 this.op = op; 13058 this.arg1 = arg1; 13059 this.arg2 = arg2; 13060 this.min = min; 13061 this.max = max; 13062 } 13063 AstBinaryOperation.prototype = Object.create(AstNode.prototype); 13064 AstBinaryOperation.prototype.visit = function (visitor) { 13065 visitor.visitBinaryOperation(this); 13066 }; 13067 function AstMin(arg, max) { 13068 AstNode.call(this, 'max'); 13069 this.arg = arg; 13070 this.min = arg.min; 13071 this.max = max; 13072 } 13073 AstMin.prototype = Object.create(AstNode.prototype); 13074 AstMin.prototype.visit = function (visitor) { 13075 visitor.visitMin(this); 13076 }; 13077 function AstVariable(index, min, max) { 13078 AstNode.call(this, 'var'); 13079 this.index = index; 13080 this.min = min; 13081 this.max = max; 13082 } 13083 AstVariable.prototype = Object.create(AstNode.prototype); 13084 AstVariable.prototype.visit = function (visitor) { 13085 visitor.visitVariable(this); 13086 }; 13087 function AstVariableDefinition(variable, arg) { 13088 AstNode.call(this, 'definition'); 13089 this.variable = variable; 13090 this.arg = arg; 13091 } 13092 AstVariableDefinition.prototype = Object.create(AstNode.prototype); 13093 AstVariableDefinition.prototype.visit = function (visitor) { 13094 visitor.visitVariableDefinition(this); 13095 }; 13096 function ExpressionBuilderVisitor() { 13097 this.parts = []; 13098 } 13099 ExpressionBuilderVisitor.prototype = { 13100 visitArgument: function (arg) { 13101 this.parts.push('Math.max(', arg.min, ', Math.min(', arg.max, ', src[srcOffset + ', arg.index, ']))'); 13102 }, 13103 visitVariable: function (variable) { 13104 this.parts.push('v', variable.index); 13105 }, 13106 visitLiteral: function (literal) { 13107 this.parts.push(literal.number); 13108 }, 13109 visitBinaryOperation: function (operation) { 13110 this.parts.push('('); 13111 operation.arg1.visit(this); 13112 this.parts.push(' ', operation.op, ' '); 13113 operation.arg2.visit(this); 13114 this.parts.push(')'); 13115 }, 13116 visitVariableDefinition: function (definition) { 13117 this.parts.push('var '); 13118 definition.variable.visit(this); 13119 this.parts.push(' = '); 13120 definition.arg.visit(this); 13121 this.parts.push(';'); 13122 }, 13123 visitMin: function (max) { 13124 this.parts.push('Math.min('); 13125 max.arg.visit(this); 13126 this.parts.push(', ', max.max, ')'); 13127 }, 13128 toString: function () { 13129 return this.parts.join(''); 13130 } 13131 }; 13132 function buildAddOperation(num1, num2) { 13133 if (num2.type === 'literal' && num2.number === 0) { 13134 return num1; 13135 } 13136 if (num1.type === 'literal' && num1.number === 0) { 13137 return num2; 13138 } 13139 if (num2.type === 'literal' && num1.type === 'literal') { 13140 return new AstLiteral(num1.number + num2.number); 13141 } 13142 return new AstBinaryOperation('+', num1, num2, num1.min + num2.min, num1.max + num2.max); 13143 } 13144 function buildMulOperation(num1, num2) { 13145 if (num2.type === 'literal') { 13146 if (num2.number === 0) { 13147 return new AstLiteral(0); 13148 } else if (num2.number === 1) { 13149 return num1; 13150 } else if (num1.type === 'literal') { 13151 return new AstLiteral(num1.number * num2.number); 13152 } 13153 } 13154 if (num1.type === 'literal') { 13155 if (num1.number === 0) { 13156 return new AstLiteral(0); 13157 } else if (num1.number === 1) { 13158 return num2; 13159 } 13160 } 13161 var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 13162 var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 13163 return new AstBinaryOperation('*', num1, num2, min, max); 13164 } 13165 function buildSubOperation(num1, num2) { 13166 if (num2.type === 'literal') { 13167 if (num2.number === 0) { 13168 return num1; 13169 } else if (num1.type === 'literal') { 13170 return new AstLiteral(num1.number - num2.number); 13171 } 13172 } 13173 if (num2.type === 'binary' && num2.op === '-' && num1.type === 'literal' && num1.number === 1 && num2.arg1.type === 'literal' && num2.arg1.number === 1) { 13174 return num2.arg2; 13175 } 13176 return new AstBinaryOperation('-', num1, num2, num1.min - num2.max, num1.max - num2.min); 13177 } 13178 function buildMinOperation(num1, max) { 13179 if (num1.min >= max) { 13180 return new AstLiteral(max); 13181 } else if (num1.max <= max) { 13182 return num1; 13183 } 13184 return new AstMin(num1, max); 13185 } 13186 function PostScriptCompiler() { 13187 } 13188 PostScriptCompiler.prototype = { 13189 compile: function PostScriptCompiler_compile(code, domain, range) { 13190 var stack = []; 13191 var i, ii; 13192 var instructions = []; 13193 var inputSize = domain.length >> 1, outputSize = range.length >> 1; 13194 var lastRegister = 0; 13195 var n, j; 13196 var num1, num2, ast1, ast2, tmpVar, item; 13197 for (i = 0; i < inputSize; i++) { 13198 stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); 13199 } 13200 for (i = 0, ii = code.length; i < ii; i++) { 13201 item = code[i]; 13202 if (typeof item === 'number') { 13203 stack.push(new AstLiteral(item)); 13204 continue; 13205 } 13206 switch (item) { 13207 case 'add': 13208 if (stack.length < 2) { 13209 return null; 13210 } 13211 num2 = stack.pop(); 13212 num1 = stack.pop(); 13213 stack.push(buildAddOperation(num1, num2)); 13214 break; 13215 case 'cvr': 13216 if (stack.length < 1) { 13217 return null; 13218 } 13219 break; 13220 case 'mul': 13221 if (stack.length < 2) { 13222 return null; 13223 } 13224 num2 = stack.pop(); 13225 num1 = stack.pop(); 13226 stack.push(buildMulOperation(num1, num2)); 13227 break; 13228 case 'sub': 13229 if (stack.length < 2) { 13230 return null; 13231 } 13232 num2 = stack.pop(); 13233 num1 = stack.pop(); 13234 stack.push(buildSubOperation(num1, num2)); 13235 break; 13236 case 'exch': 13237 if (stack.length < 2) { 13238 return null; 13239 } 13240 ast1 = stack.pop(); 13241 ast2 = stack.pop(); 13242 stack.push(ast1, ast2); 13243 break; 13244 case 'pop': 13245 if (stack.length < 1) { 13246 return null; 13247 } 13248 stack.pop(); 13249 break; 13250 case 'index': 13251 if (stack.length < 1) { 13252 return null; 13253 } 13254 num1 = stack.pop(); 13255 if (num1.type !== 'literal') { 13256 return null; 13257 } 13258 n = num1.number; 13259 if (n < 0 || (n | 0) !== n || stack.length < n) { 13260 return null; 13261 } 13262 ast1 = stack[stack.length - n - 1]; 13263 if (ast1.type === 'literal' || ast1.type === 'var') { 13264 stack.push(ast1); 13265 break; 13266 } 13267 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 13268 stack[stack.length - n - 1] = tmpVar; 13269 stack.push(tmpVar); 13270 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 13271 break; 13272 case 'dup': 13273 if (stack.length < 1) { 13274 return null; 13275 } 13276 if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && code[i + 3] === i + 7 && code[i + 4] === 'jz' && code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { 13277 num1 = stack.pop(); 13278 stack.push(buildMinOperation(num1, code[i + 1])); 13279 i += 6; 13280 break; 13281 } 13282 ast1 = stack[stack.length - 1]; 13283 if (ast1.type === 'literal' || ast1.type === 'var') { 13284 stack.push(ast1); 13285 break; 13286 } 13287 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 13288 stack[stack.length - 1] = tmpVar; 13289 stack.push(tmpVar); 13290 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 13291 break; 13292 case 'roll': 13293 if (stack.length < 2) { 13294 return null; 13295 } 13296 num2 = stack.pop(); 13297 num1 = stack.pop(); 13298 if (num2.type !== 'literal' || num1.type !== 'literal') { 13299 return null; 13300 } 13301 j = num2.number; 13302 n = num1.number; 13303 if (n <= 0 || (n | 0) !== n || (j | 0) !== j || stack.length < n) { 13304 return null; 13305 } 13306 j = (j % n + n) % n; 13307 if (j === 0) { 13308 break; 13309 } 13310 Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); 13311 break; 13312 default: 13313 return null; 13314 } 13315 } 13316 if (stack.length !== outputSize) { 13317 return null; 13318 } 13319 var result = []; 13320 instructions.forEach(function (instruction) { 13321 var statementBuilder = new ExpressionBuilderVisitor(); 13322 instruction.visit(statementBuilder); 13323 result.push(statementBuilder.toString()); 13324 }); 13325 stack.forEach(function (expr, i) { 13326 var statementBuilder = new ExpressionBuilderVisitor(); 13327 expr.visit(statementBuilder); 13328 var min = range[i * 2], max = range[i * 2 + 1]; 13329 var out = [statementBuilder.toString()]; 13330 if (min > expr.min) { 13331 out.unshift('Math.max(', min, ', '); 13332 out.push(')'); 13333 } 13334 if (max < expr.max) { 13335 out.unshift('Math.min(', max, ', '); 13336 out.push(')'); 13337 } 13338 out.unshift('dest[destOffset + ', i, '] = '); 13339 out.push(';'); 13340 result.push(out.join('')); 13341 }); 13342 return result.join('\n'); 13343 } 13344 }; 13345 return PostScriptCompiler; 13346}(); 13347exports.isPDFFunction = isPDFFunction; 13348exports.PDFFunction = PDFFunction; 13349exports.PostScriptEvaluator = PostScriptEvaluator; 13350exports.PostScriptCompiler = PostScriptCompiler; 13351 13352/***/ }), 13353/* 7 */ 13354/***/ (function(module, exports, __w_pdfjs_require__) { 13355 13356"use strict"; 13357 13358var sharedUtil = __w_pdfjs_require__(0); 13359var getLookupTableFactory = sharedUtil.getLookupTableFactory; 13360var getGlyphsUnicode = getLookupTableFactory(function (t) { 13361 t['A'] = 0x0041; 13362 t['AE'] = 0x00C6; 13363 t['AEacute'] = 0x01FC; 13364 t['AEmacron'] = 0x01E2; 13365 t['AEsmall'] = 0xF7E6; 13366 t['Aacute'] = 0x00C1; 13367 t['Aacutesmall'] = 0xF7E1; 13368 t['Abreve'] = 0x0102; 13369 t['Abreveacute'] = 0x1EAE; 13370 t['Abrevecyrillic'] = 0x04D0; 13371 t['Abrevedotbelow'] = 0x1EB6; 13372 t['Abrevegrave'] = 0x1EB0; 13373 t['Abrevehookabove'] = 0x1EB2; 13374 t['Abrevetilde'] = 0x1EB4; 13375 t['Acaron'] = 0x01CD; 13376 t['Acircle'] = 0x24B6; 13377 t['Acircumflex'] = 0x00C2; 13378 t['Acircumflexacute'] = 0x1EA4; 13379 t['Acircumflexdotbelow'] = 0x1EAC; 13380 t['Acircumflexgrave'] = 0x1EA6; 13381 t['Acircumflexhookabove'] = 0x1EA8; 13382 t['Acircumflexsmall'] = 0xF7E2; 13383 t['Acircumflextilde'] = 0x1EAA; 13384 t['Acute'] = 0xF6C9; 13385 t['Acutesmall'] = 0xF7B4; 13386 t['Acyrillic'] = 0x0410; 13387 t['Adblgrave'] = 0x0200; 13388 t['Adieresis'] = 0x00C4; 13389 t['Adieresiscyrillic'] = 0x04D2; 13390 t['Adieresismacron'] = 0x01DE; 13391 t['Adieresissmall'] = 0xF7E4; 13392 t['Adotbelow'] = 0x1EA0; 13393 t['Adotmacron'] = 0x01E0; 13394 t['Agrave'] = 0x00C0; 13395 t['Agravesmall'] = 0xF7E0; 13396 t['Ahookabove'] = 0x1EA2; 13397 t['Aiecyrillic'] = 0x04D4; 13398 t['Ainvertedbreve'] = 0x0202; 13399 t['Alpha'] = 0x0391;
13400 t['Alphatonos'] = 0x0386; 13401 t['Amacron'] = 0x0100; 13402 t['Amonospace'] = 0xFF21; 13403 t['Aogonek'] = 0x0104; 13404 t['Aring'] = 0x00C5; 13405 t['Aringacute'] = 0x01FA; 13406 t['Aringbelow'] = 0x1E00; 13407 t['Aringsmall'] = 0xF7E5; 13408 t['Asmall'] = 0xF761; 13409 t['Atilde'] = 0x00C3; 13410 t['Atildesmall'] = 0xF7E3; 13411 t['Aybarmenian'] = 0x0531; 13412 t['B'] = 0x0042; 13413 t['Bcircle'] = 0x24B7; 13414 t['Bdotaccent'] = 0x1E02; 13415 t['Bdotbelow'] = 0x1E04; 13416 t['Becyrillic'] = 0x0411; 13417 t['Benarmenian'] = 0x0532; 13418 t['Beta'] = 0x0392; 13419 t['Bhook'] = 0x0181; 13420 t['Blinebelow'] = 0x1E06; 13421 t['Bmonospace'] = 0xFF22; 13422 t['Brevesmall'] = 0xF6F4; 13423 t['Bsmall'] = 0xF762; 13424 t['Btopbar'] = 0x0182; 13425 t['C'] = 0x0043; 13426 t['Caarmenian'] = 0x053E; 13427 t['Cacute'] = 0x0106; 13428 t['Caron'] = 0xF6CA; 13429 t['Caronsmall'] = 0xF6F5; 13430 t['Ccaron'] = 0x010C; 13431 t['Ccedilla'] = 0x00C7; 13432 t['Ccedillaacute'] = 0x1E08; 13433 t['Ccedillasmall'] = 0xF7E7; 13434 t['Ccircle'] = 0x24B8; 13435 t['Ccircumflex'] = 0x0108; 13436 t['Cdot'] = 0x010A; 13437 t['Cdotaccent'] = 0x010A; 13438 t['Cedillasmall'] = 0xF7B8; 13439 t['Chaarmenian'] = 0x0549; 13440 t['Cheabkhasiancyrillic'] = 0x04BC; 13441 t['Checyrillic'] = 0x0427; 13442 t['Chedescenderabkhasiancyrillic'] = 0x04BE; 13443 t['Chedescendercyrillic'] = 0x04B6; 13444 t['Chedieresiscyrillic'] = 0x04F4; 13445 t['Cheharmenian'] = 0x0543; 13446 t['Chekhakassiancyrillic'] = 0x04CB; 13447 t['Cheverticalstrokecyrillic'] = 0x04B8; 13448 t['Chi'] = 0x03A7; 13449 t['Chook'] = 0x0187; 13450 t['Circumflexsmall'] = 0xF6F6; 13451 t['Cmonospace'] = 0xFF23; 13452 t['Coarmenian'] = 0x0551; 13453 t['Csmall'] = 0xF763; 13454 t['D'] = 0x0044; 13455 t['DZ'] = 0x01F1; 13456 t['DZcaron'] = 0x01C4; 13457 t['Daarmenian'] = 0x0534; 13458 t['Dafrican'] = 0x0189; 13459 t['Dcaron'] = 0x010E; 13460 t['Dcedilla'] = 0x1E10; 13461 t['Dcircle'] = 0x24B9; 13462 t['Dcircumflexbelow'] = 0x1E12; 13463 t['Dcroat'] = 0x0110; 13464 t['Ddotaccent'] = 0x1E0A; 13465 t['Ddotbelow'] = 0x1E0C; 13466 t['Decyrillic'] = 0x0414; 13467 t['Deicoptic'] = 0x03EE; 13468 t['Delta'] = 0x2206; 13469 t['Deltagreek'] = 0x0394; 13470 t['Dhook'] = 0x018A; 13471 t['Dieresis'] = 0xF6CB; 13472 t['DieresisAcute'] = 0xF6CC; 13473 t['DieresisGrave'] = 0xF6CD; 13474 t['Dieresissmall'] = 0xF7A8; 13475 t['Digammagreek'] = 0x03DC; 13476 t['Djecyrillic'] = 0x0402; 13477 t['Dlinebelow'] = 0x1E0E; 13478 t['Dmonospace'] = 0xFF24; 13479 t['Dotaccentsmall'] = 0xF6F7; 13480 t['Dslash'] = 0x0110; 13481 t['Dsmall'] = 0xF764; 13482 t['Dtopbar'] = 0x018B; 13483 t['Dz'] = 0x01F2; 13484 t['Dzcaron'] = 0x01C5; 13485 t['Dzeabkhasiancyrillic'] = 0x04E0; 13486 t['Dzecyrillic'] = 0x0405; 13487 t['Dzhecyrillic'] = 0x040F; 13488 t['E'] = 0x0045; 13489 t['Eacute'] = 0x00C9; 13490 t['Eacutesmall'] = 0xF7E9; 13491 t['Ebreve'] = 0x0114; 13492 t['Ecaron'] = 0x011A; 13493 t['Ecedillabreve'] = 0x1E1C; 13494 t['Echarmenian'] = 0x0535; 13495 t['Ecircle'] = 0x24BA; 13496 t['Ecircumflex'] = 0x00CA; 13497 t['Ecircumflexacute'] = 0x1EBE; 13498 t['Ecircumflexbelow'] = 0x1E18; 13499 t['Ecircumflexdotbelow'] = 0x1EC6; 13500 t['Ecircumflexgrave'] = 0x1EC0; 13501 t['Ecircumflexhookabove'] = 0x1EC2; 13502 t['Ecircumflexsmall'] = 0xF7EA; 13503 t['Ecircumflextilde'] = 0x1EC4; 13504 t['Ecyrillic'] = 0x0404; 13505 t['Edblgrave'] = 0x0204; 13506 t['Edieresis'] = 0x00CB; 13507 t['Edieresissmall'] = 0xF7EB; 13508 t['Edot'] = 0x0116; 13509 t['Edotaccent'] = 0x0116; 13510 t['Edotbelow'] = 0x1EB8; 13511 t['Efcyrillic'] = 0x0424; 13512 t['Egrave'] = 0x00C8; 13513 t['Egravesmall'] = 0xF7E8; 13514 t['Eharmenian'] = 0x0537; 13515 t['Ehookabove'] = 0x1EBA; 13516 t['Eightroman'] = 0x2167; 13517 t['Einvertedbreve'] = 0x0206; 13518 t['Eiotifiedcyrillic'] = 0x0464; 13519 t['Elcyrillic'] = 0x041B; 13520 t['Elevenroman'] = 0x216A; 13521 t['Emacron'] = 0x0112; 13522 t['Emacronacute'] = 0x1E16; 13523 t['Emacrongrave'] = 0x1E14; 13524 t['Emcyrillic'] = 0x041C; 13525 t['Emonospace'] = 0xFF25; 13526 t['Encyrillic'] = 0x041D; 13527 t['Endescendercyrillic'] = 0x04A2; 13528 t['Eng'] = 0x014A; 13529 t['Enghecyrillic'] = 0x04A4; 13530 t['Enhookcyrillic'] = 0x04C7; 13531 t['Eogonek'] = 0x0118; 13532 t['Eopen'] = 0x0190; 13533 t['Epsilon'] = 0x0395; 13534 t['Epsilontonos'] = 0x0388; 13535 t['Ercyrillic'] = 0x0420; 13536 t['Ereversed'] = 0x018E; 13537 t['Ereversedcyrillic'] = 0x042D; 13538 t['Escyrillic'] = 0x0421; 13539 t['Esdescendercyrillic'] = 0x04AA; 13540 t['Esh'] = 0x01A9; 13541 t['Esmall'] = 0xF765; 13542 t['Eta'] = 0x0397; 13543 t['Etarmenian'] = 0x0538;
13544 t['Etatonos'] = 0x0389; 13545 t['Eth'] = 0x00D0; 13546 t['Ethsmall'] = 0xF7F0; 13547 t['Etilde'] = 0x1EBC; 13548 t['Etildebelow'] = 0x1E1A; 13549 t['Euro'] = 0x20AC; 13550 t['Ezh'] = 0x01B7; 13551 t['Ezhcaron'] = 0x01EE; 13552 t['Ezhreversed'] = 0x01B8; 13553 t['F'] = 0x0046; 13554 t['Fcircle'] = 0x24BB; 13555 t['Fdotaccent'] = 0x1E1E; 13556 t['Feharmenian'] = 0x0556; 13557 t['Feicoptic'] = 0x03E4; 13558 t['Fhook'] = 0x0191; 13559 t['Fitacyrillic'] = 0x0472; 13560 t['Fiveroman'] = 0x2164; 13561 t['Fmonospace'] = 0xFF26; 13562 t['Fourroman'] = 0x2163; 13563 t['Fsmall'] = 0xF766; 13564 t['G'] = 0x0047; 13565 t['GBsquare'] = 0x3387; 13566 t['Gacute'] = 0x01F4; 13567 t['Gamma'] = 0x0393; 13568 t['Gammaafrican'] = 0x0194; 13569 t['Gangiacoptic'] = 0x03EA; 13570 t['Gbreve'] = 0x011E; 13571 t['Gcaron'] = 0x01E6; 13572 t['Gcedilla'] = 0x0122; 13573 t['Gcircle'] = 0x24BC; 13574 t['Gcircumflex'] = 0x011C; 13575 t['Gcommaaccent'] = 0x0122; 13576 t['Gdot'] = 0x0120; 13577 t['Gdotaccent'] = 0x0120; 13578 t['Gecyrillic'] = 0x0413; 13579 t['Ghadarmenian'] = 0x0542; 13580 t['Ghemiddlehookcyrillic'] = 0x0494; 13581 t['Ghestrokecyrillic'] = 0x0492; 13582 t['Gheupturncyrillic'] = 0x0490; 13583 t['Ghook'] = 0x0193; 13584 t['Gimarmenian'] = 0x0533; 13585 t['Gjecyrillic'] = 0x0403; 13586 t['Gmacron'] = 0x1E20; 13587 t['Gmonospace'] = 0xFF27; 13588 t['Grave'] = 0xF6CE; 13589 t['Gravesmall'] = 0xF760; 13590 t['Gsmall'] = 0xF767; 13591 t['Gsmallhook'] = 0x029B; 13592 t['Gstroke'] = 0x01E4; 13593 t['H'] = 0x0048; 13594 t['H18533'] = 0x25CF; 13595 t['H18543'] = 0x25AA; 13596 t['H18551'] = 0x25AB; 13597 t['H22073'] = 0x25A1; 13598 t['HPsquare'] = 0x33CB; 13599 t['Haabkhasiancyrillic'] = 0x04A8; 13600 t['Hadescendercyrillic'] = 0x04B2; 13601 t['Hardsigncyrillic'] = 0x042A; 13602 t['Hbar'] = 0x0126; 13603 t['Hbrevebelow'] = 0x1E2A; 13604 t['Hcedilla'] = 0x1E28; 13605 t['Hcircle'] = 0x24BD; 13606 t['Hcircumflex'] = 0x0124; 13607 t['Hdieresis'] = 0x1E26; 13608 t['Hdotaccent'] = 0x1E22; 13609 t['Hdotbelow'] = 0x1E24; 13610 t['Hmonospace'] = 0xFF28; 13611 t['Hoarmenian'] = 0x0540; 13612 t['Horicoptic'] = 0x03E8; 13613 t['Hsmall'] = 0xF768; 13614 t['Hungarumlaut'] = 0xF6CF; 13615 t['Hungarumlautsmall'] = 0xF6F8; 13616 t['Hzsquare'] = 0x3390; 13617 t['I'] = 0x0049; 13618 t['IAcyrillic'] = 0x042F; 13619 t['IJ'] = 0x0132; 13620 t['IUcyrillic'] = 0x042E; 13621 t['Iacute'] = 0x00CD; 13622 t['Iacutesmall'] = 0xF7ED; 13623 t['Ibreve'] = 0x012C; 13624 t['Icaron'] = 0x01CF; 13625 t['Icircle'] = 0x24BE; 13626 t['Icircumflex'] = 0x00CE; 13627 t['Icircumflexsmall'] = 0xF7EE; 13628 t['Icyrillic'] = 0x0406; 13629 t['Idblgrave'] = 0x0208; 13630 t['Idieresis'] = 0x00CF; 13631 t['Idieresisacute'] = 0x1E2E; 13632 t['Idieresiscyrillic'] = 0x04E4; 13633 t['Idieresissmall'] = 0xF7EF; 13634 t['Idot'] = 0x0130; 13635 t['Idotaccent'] = 0x0130; 13636 t['Idotbelow'] = 0x1ECA; 13637 t['Iebrevecyrillic'] = 0x04D6; 13638 t['Iecyrillic'] = 0x0415; 13639 t['Ifraktur'] = 0x2111; 13640 t['Igrave'] = 0x00CC; 13641 t['Igravesmall'] = 0xF7EC; 13642 t['Ihookabove'] = 0x1EC8; 13643 t['Iicyrillic'] = 0x0418; 13644 t['Iinvertedbreve'] = 0x020A; 13645 t['Iishortcyrillic'] = 0x0419; 13646 t['Imacron'] = 0x012A; 13647 t['Imacroncyrillic'] = 0x04E2; 13648 t['Imonospace'] = 0xFF29; 13649 t['Iniarmenian'] = 0x053B; 13650 t['Iocyrillic'] = 0x0401; 13651 t['Iogonek'] = 0x012E; 13652 t['Iota'] = 0x0399; 13653 t['Iotaafrican'] = 0x0196; 13654 t['Iotadieresis'] = 0x03AA; 13655 t['Iotatonos'] = 0x038A; 13656 t['Ismall'] = 0xF769; 13657 t['Istroke'] = 0x0197; 13658 t['Itilde'] = 0x0128; 13659 t['Itildebelow'] = 0x1E2C; 13660 t['Izhitsacyrillic'] = 0x0474; 13661 t['Izhitsadblgravecyrillic'] = 0x0476; 13662 t['J'] = 0x004A; 13663 t['Jaarmenian'] = 0x0541; 13664 t['Jcircle'] = 0x24BF; 13665 t['Jcircumflex'] = 0x0134; 13666 t['Jecyrillic'] = 0x0408; 13667 t['Jheharmenian'] = 0x054B; 13668 t['Jmonospace'] = 0xFF2A; 13669 t['Jsmall'] = 0xF76A; 13670 t['K'] = 0x004B; 13671 t['KBsquare'] = 0x3385; 13672 t['KKsquare'] = 0x33CD; 13673 t['Kabashkircyrillic'] = 0x04A0; 13674 t['Kacute'] = 0x1E30; 13675 t['Kacyrillic'] = 0x041A; 13676 t['Kadescendercyrillic'] = 0x049A; 13677 t['Kahookcyrillic'] = 0x04C3;
13678 t['Kappa'] = 0x039A; 13679 t['Kastrokecyrillic'] = 0x049E; 13680 t['Kaverticalstrokecyrillic'] = 0x049C; 13681 t['Kcaron'] = 0x01E8; 13682 t['Kcedilla'] = 0x0136; 13683 t['Kcircle'] = 0x24C0; 13684 t['Kcommaaccent'] = 0x0136; 13685 t['Kdotbelow'] = 0x1E32; 13686 t['Keharmenian'] = 0x0554; 13687 t['Kenarmenian'] = 0x053F; 13688 t['Khacyrillic'] = 0x0425; 13689 t['Kheicoptic'] = 0x03E6; 13690 t['Khook'] = 0x0198; 13691 t['Kjecyrillic'] = 0x040C; 13692 t['Klinebelow'] = 0x1E34; 13693 t['Kmonospace'] = 0xFF2B; 13694 t['Koppacyrillic'] = 0x0480; 13695 t['Koppagreek'] = 0x03DE; 13696 t['Ksicyrillic'] = 0x046E; 13697 t['Ksmall'] = 0xF76B; 13698 t['L'] = 0x004C; 13699 t['LJ'] = 0x01C7; 13700 t['LL'] = 0xF6BF; 13701 t['Lacute'] = 0x0139; 13702 t['Lambda'] = 0x039B; 13703 t['Lcaron'] = 0x013D; 13704 t['Lcedilla'] = 0x013B; 13705 t['Lcircle'] = 0x24C1; 13706 t['Lcircumflexbelow'] = 0x1E3C; 13707 t['Lcommaaccent'] = 0x013B; 13708 t['Ldot'] = 0x013F; 13709 t['Ldotaccent'] = 0x013F; 13710 t['Ldotbelow'] = 0x1E36; 13711 t['Ldotbelowmacron'] = 0x1E38; 13712 t['Liwnarmenian'] = 0x053C; 13713 t['Lj'] = 0x01C8; 13714 t['Ljecyrillic'] = 0x0409; 13715 t['Llinebelow'] = 0x1E3A; 13716 t['Lmonospace'] = 0xFF2C; 13717 t['Lslash'] = 0x0141; 13718 t['Lslashsmall'] = 0xF6F9; 13719 t['Lsmall'] = 0xF76C; 13720 t['M'] = 0x004D; 13721 t['MBsquare'] = 0x3386; 13722 t['Macron'] = 0xF6D0; 13723 t['Macronsmall'] = 0xF7AF; 13724 t['Macute'] = 0x1E3E; 13725 t['Mcircle'] = 0x24C2; 13726 t['Mdotaccent'] = 0x1E40; 13727 t['Mdotbelow'] = 0x1E42; 13728 t['Menarmenian'] = 0x0544; 13729 t['Mmonospace'] = 0xFF2D; 13730 t['Msmall'] = 0xF76D; 13731 t['Mturned'] = 0x019C; 13732 t['Mu'] = 0x039C; 13733 t['N'] = 0x004E; 13734 t['NJ'] = 0x01CA; 13735 t['Nacute'] = 0x0143; 13736 t['Ncaron'] = 0x0147; 13737 t['Ncedilla'] = 0x0145; 13738 t['Ncircle'] = 0x24C3; 13739 t['Ncircumflexbelow'] = 0x1E4A; 13740 t['Ncommaaccent'] = 0x0145; 13741 t['Ndotaccent'] = 0x1E44; 13742 t['Ndotbelow'] = 0x1E46; 13743 t['Nhookleft'] = 0x019D; 13744 t['Nineroman'] = 0x2168; 13745 t['Nj'] = 0x01CB; 13746 t['Njecyrillic'] = 0x040A; 13747 t['Nlinebelow'] = 0x1E48; 13748 t['Nmonospace'] = 0xFF2E; 13749 t['Nowarmenian'] = 0x0546; 13750 t['Nsmall'] = 0xF76E; 13751 t['Ntilde'] = 0x00D1; 13752 t['Ntildesmall'] = 0xF7F1; 13753 t['Nu'] = 0x039D; 13754 t['O'] = 0x004F; 13755 t['OE'] = 0x0152; 13756 t['OEsmall'] = 0xF6FA; 13757 t['Oacute'] = 0x00D3; 13758 t['Oacutesmall'] = 0xF7F3; 13759 t['Obarredcyrillic'] = 0x04E8; 13760 t['Obarreddieresiscyrillic'] = 0x04EA; 13761 t['Obreve'] = 0x014E; 13762 t['Ocaron'] = 0x01D1; 13763 t['Ocenteredtilde'] = 0x019F; 13764 t['Ocircle'] = 0x24C4; 13765 t['Ocircumflex'] = 0x00D4; 13766 t['Ocircumflexacute'] = 0x1ED0; 13767 t['Ocircumflexdotbelow'] = 0x1ED8; 13768 t['Ocircumflexgrave'] = 0x1ED2; 13769 t['Ocircumflexhookabove'] = 0x1ED4; 13770 t['Ocircumflexsmall'] = 0xF7F4; 13771 t['Ocircumflextilde'] = 0x1ED6; 13772 t['Ocyrillic'] = 0x041E; 13773 t['Odblacute'] = 0x0150; 13774 t['Odblgrave'] = 0x020C; 13775 t['Odieresis'] = 0x00D6; 13776 t['Odieresiscyrillic'] = 0x04E6; 13777 t['Odieresissmall'] = 0xF7F6; 13778 t['Odotbelow'] = 0x1ECC; 13779 t['Ogoneksmall'] = 0xF6FB; 13780 t['Ograve'] = 0x00D2; 13781 t['Ogravesmall'] = 0xF7F2; 13782 t['Oharmenian'] = 0x0555; 13783 t['Ohm'] = 0x2126; 13784 t['Ohookabove'] = 0x1ECE; 13785 t['Ohorn'] = 0x01A0; 13786 t['Ohornacute'] = 0x1EDA; 13787 t['Ohorndotbelow'] = 0x1EE2; 13788 t['Ohorngrave'] = 0x1EDC; 13789 t['Ohornhookabove'] = 0x1EDE; 13790 t['Ohorntilde'] = 0x1EE0; 13791 t['Ohungarumlaut'] = 0x0150; 13792 t['Oi'] = 0x01A2; 13793 t['Oinvertedbreve'] = 0x020E; 13794 t['Omacron'] = 0x014C; 13795 t['Omacronacute'] = 0x1E52; 13796 t['Omacrongrave'] = 0x1E50; 13797 t['Omega'] = 0x2126; 13798 t['Omegacyrillic'] = 0x0460; 13799 t['Omegagreek'] = 0x03A9; 13800 t['Omegaroundcyrillic'] = 0x047A; 13801 t['Omegatitlocyrillic'] = 0x047C; 13802 t['Omegatonos'] = 0x038F; 13803 t['Omicron'] = 0x039F; 13804 t['Omicrontonos'] = 0x038C; 13805 t['Omonospace'] = 0xFF2F; 13806 t['Oneroman'] = 0x2160; 13807 t['Oogonek'] = 0x01EA; 13808 t['Oogonekmacron'] = 0x01EC; 13809 t['Oopen'] = 0x0186; 13810 t['Oslash'] = 0x00D8; 13811 t['Oslashacute'] = 0x01FE; 13812 t['Oslashsmall'] = 0xF7F8; 13813 t['Osmall'] = 0xF76F; 13814 t['Ostrokeacute'] = 0x01FE; 13815 t['Otcyrillic'] = 0x047E; 13816 t['Otilde'] = 0x00D5; 13817 t['Otildeacute'] = 0x1E4C; 13818 t['Otildedieresis'] = 0x1E4E; 13819 t['Otildesmall'] = 0xF7F5; 13820 t['P'] = 0x0050; 13821 t['Pacute'] = 0x1E54; 13822 t['Pcircle'] = 0x24C5; 13823 t['Pdotaccent'] = 0x1E56; 13824 t['Pecyrillic'] = 0x041F; 13825 t['Peharmenian'] = 0x054A; 13826 t['Pemiddlehookcyrillic'] = 0x04A6; 13827 t['Phi'] = 0x03A6; 13828 t['Phook'] = 0x01A4; 13829 t['Pi'] = 0x03A0; 13830 t['Piwrarmenian'] = 0x0553; 13831 t['Pmonospace'] = 0xFF30; 13832 t['Psi'] = 0x03A8; 13833 t['Psicyrillic'] = 0x0470; 13834 t['Psmall'] = 0xF770; 13835 t['Q'] = 0x0051; 13836 t['Qcircle'] = 0x24C6; 13837 t['Qmonospace'] = 0xFF31; 13838 t['Qsmall'] = 0xF771; 13839 t['R'] = 0x0052; 13840 t['Raarmenian'] = 0x054C; 13841 t['Racute'] = 0x0154; 13842 t['Rcaron'] = 0x0158; 13843 t['Rcedilla'] = 0x0156; 13844 t['Rcircle'] = 0x24C7; 13845 t['Rcommaaccent'] = 0x0156; 13846 t['Rdblgrave'] = 0x0210; 13847 t['Rdotaccent'] = 0x1E58; 13848 t['Rdotbelow'] = 0x1E5A; 13849 t['Rdotbelowmacron'] = 0x1E5C; 13850 t['Reharmenian'] = 0x0550; 13851 t['Rfraktur'] = 0x211C; 13852 t['Rho'] = 0x03A1; 13853 t['Ringsmall'] = 0xF6FC; 13854 t['Rinvertedbreve'] = 0x0212; 13855 t['Rlinebelow'] = 0x1E5E; 13856 t['Rmonospace'] = 0xFF32; 13857 t['Rsmall'] = 0xF772; 13858 t['Rsmallinverted'] = 0x0281; 13859 t['Rsmallinvertedsuperior'] = 0x02B6; 13860 t['S'] = 0x0053; 13861 t['SF010000'] = 0x250C; 13862 t['SF020000'] = 0x2514; 13863 t['SF030000'] = 0x2510; 13864 t['SF040000'] = 0x2518; 13865 t['SF050000'] = 0x253C; 13866 t['SF060000'] = 0x252C; 13867 t['SF070000'] = 0x2534; 13868 t['SF080000'] = 0x251C; 13869 t['SF090000'] = 0x2524; 13870 t['SF100000'] = 0x2500; 13871 t['SF110000'] = 0x2502; 13872 t['SF190000'] = 0x2561; 13873 t['SF200000'] = 0x2562; 13874 t['SF210000'] = 0x2556; 13875 t['SF220000'] = 0x2555; 13876 t['SF230000'] = 0x2563; 13877 t['SF240000'] = 0x2551; 13878 t['SF250000'] = 0x2557; 13879 t['SF260000'] = 0x255D; 13880 t['SF270000'] = 0x255C; 13881 t['SF280000'] = 0x255B; 13882 t['SF360000'] = 0x255E; 13883 t['SF370000'] = 0x255F; 13884 t['SF380000'] = 0x255A; 13885 t['SF390000'] = 0x2554; 13886 t['SF400000'] = 0x2569; 13887 t['SF410000'] = 0x2566; 13888 t['SF420000'] = 0x2560; 13889 t['SF430000'] = 0x2550; 13890 t['SF440000'] = 0x256C; 13891 t['SF450000'] = 0x2567; 13892 t['SF460000'] = 0x2568; 13893 t['SF470000'] = 0x2564; 13894 t['SF480000'] = 0x2565; 13895 t['SF490000'] = 0x2559; 13896 t['SF500000'] = 0x2558; 13897 t['SF510000'] = 0x2552; 13898 t['SF520000'] = 0x2553; 13899 t['SF530000'] = 0x256B; 13900 t['SF540000'] = 0x256A; 13901 t['Sacute'] = 0x015A; 13902 t['Sacutedotaccent'] = 0x1E64; 13903 t['Sampigreek'] = 0x03E0; 13904 t['Scaron'] = 0x0160; 13905 t['Scarondotaccent'] = 0x1E66; 13906 t['Scaronsmall'] = 0xF6FD; 13907 t['Scedilla'] = 0x015E; 13908 t['Schwa'] = 0x018F; 13909 t['Schwacyrillic'] = 0x04D8; 13910 t['Schwadieresiscyrillic'] = 0x04DA; 13911 t['Scircle'] = 0x24C8; 13912 t['Scircumflex'] = 0x015C; 13913 t['Scommaaccent'] = 0x0218; 13914 t['Sdotaccent'] = 0x1E60; 13915 t['Sdotbelow'] = 0x1E62; 13916 t['Sdotbelowdotaccent'] = 0x1E68; 13917 t['Seharmenian'] = 0x054D; 13918 t['Sevenroman'] = 0x2166; 13919 t['Shaarmenian'] = 0x0547; 13920 t['Shacyrillic'] = 0x0428; 13921 t['Shchacyrillic'] = 0x0429; 13922 t['Sheicoptic'] = 0x03E2; 13923 t['Shhacyrillic'] = 0x04BA; 13924 t['Shimacoptic'] = 0x03EC;
13925 t['Sigma'] = 0x03A3; 13926 t['Sixroman'] = 0x2165; 13927 t['Smonospace'] = 0xFF33; 13928 t['Softsigncyrillic'] = 0x042C; 13929 t['Ssmall'] = 0xF773; 13930 t['Stigmagreek'] = 0x03DA; 13931 t['T'] = 0x0054; 13932 t['Tau'] = 0x03A4; 13933 t['Tbar'] = 0x0166; 13934 t['Tcaron'] = 0x0164; 13935 t['Tcedilla'] = 0x0162; 13936 t['Tcircle'] = 0x24C9; 13937 t['Tcircumflexbelow'] = 0x1E70; 13938 t['Tcommaaccent'] = 0x0162; 13939 t['Tdotaccent'] = 0x1E6A; 13940 t['Tdotbelow'] = 0x1E6C; 13941 t['Tecyrillic'] = 0x0422; 13942 t['Tedescendercyrillic'] = 0x04AC; 13943 t['Tenroman'] = 0x2169; 13944 t['Tetsecyrillic'] = 0x04B4; 13945 t['Theta'] = 0x0398; 13946 t['Thook'] = 0x01AC; 13947 t['Thorn'] = 0x00DE; 13948 t['Thornsmall'] = 0xF7FE; 13949 t['Threeroman'] = 0x2162; 13950 t['Tildesmall'] = 0xF6FE; 13951 t['Tiwnarmenian'] = 0x054F; 13952 t['Tlinebelow'] = 0x1E6E; 13953 t['Tmonospace'] = 0xFF34; 13954 t['Toarmenian'] = 0x0539; 13955 t['Tonefive'] = 0x01BC; 13956 t['Tonesix'] = 0x0184; 13957 t['Tonetwo'] = 0x01A7; 13958 t['Tretroflexhook'] = 0x01AE; 13959 t['Tsecyrillic'] = 0x0426; 13960 t['Tshecyrillic'] = 0x040B; 13961 t['Tsmall'] = 0xF774; 13962 t['Twelveroman'] = 0x216B; 13963 t['Tworoman'] = 0x2161; 13964 t['U'] = 0x0055; 13965 t['Uacute'] = 0x00DA; 13966 t['Uacutesmall'] = 0xF7FA; 13967 t['Ubreve'] = 0x016C; 13968 t['Ucaron'] = 0x01D3; 13969 t['Ucircle'] = 0x24CA; 13970 t['Ucircumflex'] = 0x00DB; 13971 t['Ucircumflexbelow'] = 0x1E76; 13972 t['Ucircumflexsmall'] = 0xF7FB; 13973 t['Ucyrillic'] = 0x0423; 13974 t['Udblacute'] = 0x0170; 13975 t['Udblgrave'] = 0x0214; 13976 t['Udieresis'] = 0x00DC; 13977 t['Udieresisacute'] = 0x01D7; 13978 t['Udieresisbelow'] = 0x1E72; 13979 t['Udieresiscaron'] = 0x01D9; 13980 t['Udieresiscyrillic'] = 0x04F0; 13981 t['Udieresisgrave'] = 0x01DB; 13982 t['Udieresismacron'] = 0x01D5; 13983 t['Udieresissmall'] = 0xF7FC; 13984 t['Udotbelow'] = 0x1EE4; 13985 t['Ugrave'] = 0x00D9; 13986 t['Ugravesmall'] = 0xF7F9; 13987 t['Uhookabove'] = 0x1EE6; 13988 t['Uhorn'] = 0x01AF; 13989 t['Uhornacute'] = 0x1EE8; 13990 t['Uhorndotbelow'] = 0x1EF0; 13991 t['Uhorngrave'] = 0x1EEA; 13992 t['Uhornhookabove'] = 0x1EEC; 13993 t['Uhorntilde'] = 0x1EEE; 13994 t['Uhungarumlaut'] = 0x0170; 13995 t['Uhungarumlautcyrillic'] = 0x04F2; 13996 t['Uinvertedbreve'] = 0x0216; 13997 t['Ukcyrillic'] = 0x0478; 13998 t['Umacron'] = 0x016A; 13999 t['Umacroncyrillic'] = 0x04EE; 14000 t['Umacrondieresis'] = 0x1E7A; 14001 t['Umonospace'] = 0xFF35; 14002 t['Uogonek'] = 0x0172; 14003 t['Upsilon'] = 0x03A5; 14004 t['Upsilon1'] = 0x03D2; 14005 t['Upsilonacutehooksymbolgreek'] = 0x03D3; 14006 t['Upsilonafrican'] = 0x01B1; 14007 t['Upsilondieresis'] = 0x03AB; 14008 t['Upsilondieresishooksymbolgreek'] = 0x03D4; 14009 t['Upsilonhooksymbol'] = 0x03D2; 14010 t['Upsilontonos'] = 0x038E; 14011 t['Uring'] = 0x016E; 14012 t['Ushortcyrillic'] = 0x040E; 14013 t['Usmall'] = 0xF775; 14014 t['Ustraightcyrillic'] = 0x04AE; 14015 t['Ustraightstrokecyrillic'] = 0x04B0; 14016 t['Utilde'] = 0x0168; 14017 t['Utildeacute'] = 0x1E78; 14018 t['Utildebelow'] = 0x1E74; 14019 t['V'] = 0x0056; 14020 t['Vcircle'] = 0x24CB; 14021 t['Vdotbelow'] = 0x1E7E; 14022 t['Vecyrillic'] = 0x0412; 14023 t['Vewarmenian'] = 0x054E; 14024 t['Vhook'] = 0x01B2; 14025 t['Vmonospace'] = 0xFF36; 14026 t['Voarmenian'] = 0x0548; 14027 t['Vsmall'] = 0xF776; 14028 t['Vtilde'] = 0x1E7C; 14029 t['W'] = 0x0057; 14030 t['Wacute'] = 0x1E82; 14031 t['Wcircle'] = 0x24CC; 14032 t['Wcircumflex'] = 0x0174; 14033 t['Wdieresis'] = 0x1E84; 14034 t['Wdotaccent'] = 0x1E86; 14035 t['Wdotbelow'] = 0x1E88; 14036 t['Wgrave'] = 0x1E80; 14037 t['Wmonospace'] = 0xFF37; 14038 t['Wsmall'] = 0xF777; 14039 t['X'] = 0x0058; 14040 t['Xcircle'] = 0x24CD; 14041 t['Xdieresis'] = 0x1E8C; 14042 t['Xdotaccent'] = 0x1E8A; 14043 t['Xeharmenian'] = 0x053D; 14044 t['Xi'] = 0x039E; 14045 t['Xmonospace'] = 0xFF38; 14046 t['Xsmall'] = 0xF778; 14047 t['Y'] = 0x0059; 14048 t['Yacute'] = 0x00DD; 14049 t['Yacutesmall'] = 0xF7FD; 14050 t['Yatcyrillic'] = 0x0462; 14051 t['Ycircle'] = 0x24CE; 14052 t['Ycircumflex'] = 0x0176; 14053 t['Ydieresis'] = 0x0178; 14054 t['Ydieresissmall'] = 0xF7FF; 14055 t['Ydotaccent'] = 0x1E8E; 14056 t['Ydotbelow'] = 0x1EF4; 14057 t['Yericyrillic'] = 0x042B; 14058 t['Yerudieresiscyrillic'] = 0x04F8; 14059 t['Ygrave'] = 0x1EF2; 14060 t['Yhook'] = 0x01B3; 14061 t['Yhookabove'] = 0x1EF6; 14062 t['Yiarmenian'] = 0x0545; 14063 t['Yicyrillic'] = 0x0407; 14064 t['Yiwnarmenian'] = 0x0552; 14065 t['Ymonospace'] = 0xFF39; 14066 t['Ysmall'] = 0xF779; 14067 t['Ytilde'] = 0x1EF8; 14068 t['Yusbigcyrillic'] = 0x046A; 14069 t['Yusbigiotifiedcyrillic'] = 0x046C; 14070 t['Yuslittlecyrillic'] = 0x0466; 14071 t['Yuslittleiotifiedcyrillic'] = 0x0468; 14072 t['Z'] = 0x005A; 14073 t['Zaarmenian'] = 0x0536; 14074 t['Zacute'] = 0x0179; 14075 t['Zcaron'] = 0x017D; 14076 t['Zcaronsmall'] = 0xF6FF; 14077 t['Zcircle'] = 0x24CF; 14078 t['Zcircumflex'] = 0x1E90; 14079 t['Zdot'] = 0x017B; 14080 t['Zdotaccent'] = 0x017B; 14081 t['Zdotbelow'] = 0x1E92; 14082 t['Zecyrillic'] = 0x0417; 14083 t['Zedescendercyrillic'] = 0x0498; 14084 t['Zedieresiscyrillic'] = 0x04DE; 14085 t['Zeta'] = 0x0396; 14086 t['Zhearmenian'] = 0x053A; 14087 t['Zhebrevecyrillic'] = 0x04C1; 14088 t['Zhecyrillic'] = 0x0416; 14089 t['Zhedescendercyrillic'] = 0x0496; 14090 t['Zhedieresiscyrillic'] = 0x04DC; 14091 t['Zlinebelow'] = 0x1E94; 14092 t['Zmonospace'] = 0xFF3A; 14093 t['Zsmall'] = 0xF77A; 14094 t['Zstroke'] = 0x01B5; 14095 t['a'] = 0x0061; 14096 t['aabengali'] = 0x0986; 14097 t['aacute'] = 0x00E1; 14098 t['aadeva'] = 0x0906; 14099 t['aagujarati'] = 0x0A86; 14100 t['aagurmukhi'] = 0x0A06; 14101 t['aamatragurmukhi'] = 0x0A3E; 14102 t['aarusquare'] = 0x3303; 14103 t['aavowelsignbengali'] = 0x09BE; 14104 t['aavowelsigndeva'] = 0x093E; 14105 t['aavowelsigngujarati'] = 0x0ABE; 14106 t['abbreviationmarkarmenian'] = 0x055F; 14107 t['abbreviationsigndeva'] = 0x0970; 14108 t['abengali'] = 0x0985; 14109 t['abopomofo'] = 0x311A; 14110 t['abreve'] = 0x0103; 14111 t['abreveacute'] = 0x1EAF; 14112 t['abrevecyrillic'] = 0x04D1; 14113 t['abrevedotbelow'] = 0x1EB7; 14114 t['abrevegrave'] = 0x1EB1; 14115 t['abrevehookabove'] = 0x1EB3; 14116 t['abrevetilde'] = 0x1EB5; 14117 t['acaron'] = 0x01CE; 14118 t['acircle'] = 0x24D0; 14119 t['acircumflex'] = 0x00E2; 14120 t['acircumflexacute'] = 0x1EA5; 14121 t['acircumflexdotbelow'] = 0x1EAD; 14122 t['acircumflexgrave'] = 0x1EA7; 14123 t['acircumflexhookabove'] = 0x1EA9; 14124 t['acircumflextilde'] = 0x1EAB; 14125 t['acute'] = 0x00B4; 14126 t['acutebelowcmb'] = 0x0317; 14127 t['acutecmb'] = 0x0301; 14128 t['acutecomb'] = 0x0301; 14129 t['acutedeva'] = 0x0954; 14130 t['acutelowmod'] = 0x02CF; 14131 t['acutetonecmb'] = 0x0341; 14132 t['acyrillic'] = 0x0430; 14133 t['adblgrave'] = 0x0201; 14134 t['addakgurmukhi'] = 0x0A71; 14135 t['adeva'] = 0x0905; 14136 t['adieresis'] = 0x00E4; 14137 t['adieresiscyrillic'] = 0x04D3; 14138 t['adieresismacron'] = 0x01DF; 14139 t['adotbelow'] = 0x1EA1; 14140 t['adotmacron'] = 0x01E1; 14141 t['ae'] = 0x00E6; 14142 t['aeacute'] = 0x01FD; 14143 t['aekorean'] = 0x3150; 14144 t['aemacron'] = 0x01E3; 14145 t['afii00208'] = 0x2015; 14146 t['afii08941'] = 0x20A4; 14147 t['afii10017'] = 0x0410; 14148 t['afii10018'] = 0x0411; 14149 t['afii10019'] = 0x0412; 14150 t['afii10020'] = 0x0413;
14151 t['afii10021'] = 0x0414; 14152 t['afii10022'] = 0x0415; 14153 t['afii10023'] = 0x0401; 14154 t['afii10024'] = 0x0416; 14155 t['afii10025'] = 0x0417; 14156 t['afii10026'] = 0x0418; 14157 t['afii10027'] = 0x0419; 14158 t['afii10028'] = 0x041A; 14159 t['afii10029'] = 0x041B; 14160 t['afii10030'] = 0x041C; 14161 t['afii10031'] = 0x041D; 14162 t['afii10032'] = 0x041E; 14163 t['afii10033'] = 0x041F; 14164 t['afii10034'] = 0x0420; 14165 t['afii10035'] = 0x0421; 14166 t['afii10036'] = 0x0422; 14167 t['afii10037'] = 0x0423; 14168 t['afii10038'] = 0x0424; 14169 t['afii10039'] = 0x0425; 14170 t['afii10040'] = 0x0426; 14171 t['afii10041'] = 0x0427; 14172 t['afii10042'] = 0x0428; 14173 t['afii10043'] = 0x0429; 14174 t['afii10044'] = 0x042A; 14175 t['afii10045'] = 0x042B; 14176 t['afii10046'] = 0x042C; 14177 t['afii10047'] = 0x042D; 14178 t['afii10048'] = 0x042E; 14179 t['afii10049'] = 0x042F; 14180 t['afii10050'] = 0x0490; 14181 t['afii10051'] = 0x0402; 14182 t['afii10052'] = 0x0403; 14183 t['afii10053'] = 0x0404; 14184 t['afii10054'] = 0x0405; 14185 t['afii10055'] = 0x0406; 14186 t['afii10056'] = 0x0407; 14187 t['afii10057'] = 0x0408; 14188 t['afii10058'] = 0x0409; 14189 t['afii10059'] = 0x040A; 14190 t['afii10060'] = 0x040B; 14191 t['afii10061'] = 0x040C; 14192 t['afii10062'] = 0x040E; 14193 t['afii10063'] = 0xF6C4; 14194 t['afii10064'] = 0xF6C5; 14195 t['afii10065'] = 0x0430; 14196 t['afii10066'] = 0x0431; 14197 t['afii10067'] = 0x0432; 14198 t['afii10068'] = 0x0433; 14199 t['afii10069'] = 0x0434; 14200 t['afii10070'] = 0x0435; 14201 t['afii10071'] = 0x0451; 14202 t['afii10072'] = 0x0436; 14203 t['afii10073'] = 0x0437; 14204 t['afii10074'] = 0x0438; 14205 t['afii10075'] = 0x0439; 14206 t['afii10076'] = 0x043A; 14207 t['afii10077'] = 0x043B; 14208 t['afii10078'] = 0x043C; 14209 t['afii10079'] = 0x043D; 14210 t['afii10080'] = 0x043E; 14211 t['afii10081'] = 0x043F; 14212 t['afii10082'] = 0x0440; 14213 t['afii10083'] = 0x0441; 14214 t['afii10084'] = 0x0442; 14215 t['afii10085'] = 0x0443; 14216 t['afii10086'] = 0x0444; 14217 t['afii10087'] = 0x0445; 14218 t['afii10088'] = 0x0446; 14219 t['afii10089'] = 0x0447; 14220 t['afii10090'] = 0x0448; 14221 t['afii10091'] = 0x0449; 14222 t['afii10092'] = 0x044A; 14223 t['afii10093'] = 0x044B; 14224 t['afii10094'] = 0x044C; 14225 t['afii10095'] = 0x044D; 14226 t['afii10096'] = 0x044E; 14227 t['afii10097'] = 0x044F; 14228 t['afii10098'] = 0x0491; 14229 t['afii10099'] = 0x0452; 14230 t['afii10100'] = 0x0453; 14231 t['afii10101'] = 0x0454; 14232 t['afii10102'] = 0x0455; 14233 t['afii10103'] = 0x0456; 14234 t['afii10104'] = 0x0457; 14235 t['afii10105'] = 0x0458; 14236 t['afii10106'] = 0x0459; 14237 t['afii10107'] = 0x045A; 14238 t['afii10108'] = 0x045B; 14239 t['afii10109'] = 0x045C; 14240 t['afii10110'] = 0x045E; 14241 t['afii10145'] = 0x040F; 14242 t['afii10146'] = 0x0462; 14243 t['afii10147'] = 0x0472; 14244 t['afii10148'] = 0x0474; 14245 t['afii10192'] = 0xF6C6; 14246 t['afii10193'] = 0x045F; 14247 t['afii10194'] = 0x0463; 14248 t['afii10195'] = 0x0473; 14249 t['afii10196'] = 0x0475; 14250 t['afii10831'] = 0xF6C7; 14251 t['afii10832'] = 0xF6C8; 14252 t['afii10846'] = 0x04D9; 14253 t['afii299'] = 0x200E; 14254 t['afii300'] = 0x200F; 14255 t['afii301'] = 0x200D; 14256 t['afii57381'] = 0x066A; 14257 t['afii57388'] = 0x060C; 14258 t['afii57392'] = 0x0660; 14259 t['afii57393'] = 0x0661; 14260 t['afii57394'] = 0x0662; 14261 t['afii57395'] = 0x0663; 14262 t['afii57396'] = 0x0664; 14263 t['afii57397'] = 0x0665; 14264 t['afii57398'] = 0x0666; 14265 t['afii57399'] = 0x0667; 14266 t['afii57400'] = 0x0668; 14267 t['afii57401'] = 0x0669; 14268 t['afii57403'] = 0x061B; 14269 t['afii57407'] = 0x061F; 14270 t['afii57409'] = 0x0621; 14271 t['afii57410'] = 0x0622; 14272 t['afii57411'] = 0x0623; 14273 t['afii57412'] = 0x0624; 14274 t['afii57413'] = 0x0625; 14275 t['afii57414'] = 0x0626; 14276 t['afii57415'] = 0x0627; 14277 t['afii57416'] = 0x0628; 14278 t['afii57417'] = 0x0629; 14279 t['afii57418'] = 0x062A; 14280 t['afii57419'] = 0x062B; 14281 t['afii57420'] = 0x062C; 14282 t['afii57421'] = 0x062D; 14283 t['afii57422'] = 0x062E; 14284 t['afii57423'] = 0x062F; 14285 t['afii57424'] = 0x0630; 14286 t['afii57425'] = 0x0631; 14287 t['afii57426'] = 0x0632; 14288 t['afii57427'] = 0x0633; 14289 t['afii57428'] = 0x0634; 14290 t['afii57429'] = 0x0635; 14291 t['afii57430'] = 0x0636; 14292 t['afii57431'] = 0x0637; 14293 t['afii57432'] = 0x0638; 14294 t['afii57433'] = 0x0639; 14295 t['afii57434'] = 0x063A; 14296 t['afii57440'] = 0x0640; 14297 t['afii57441'] = 0x0641; 14298 t['afii57442'] = 0x0642; 14299 t['afii57443'] = 0x0643; 14300 t['afii57444'] = 0x0644; 14301 t['afii57445'] = 0x0645; 14302 t['afii57446'] = 0x0646; 14303 t['afii57448'] = 0x0648; 14304 t['afii57449'] = 0x0649; 14305 t['afii57450'] = 0x064A; 14306 t['afii57451'] = 0x064B; 14307 t['afii57452'] = 0x064C; 14308 t['afii57453'] = 0x064D; 14309 t['afii57454'] = 0x064E; 14310 t['afii57455'] = 0x064F; 14311 t['afii57456'] = 0x0650; 14312 t['afii57457'] = 0x0651; 14313 t['afii57458'] = 0x0652; 14314 t['afii57470'] = 0x0647; 14315 t['afii57505'] = 0x06A4; 14316 t['afii57506'] = 0x067E; 14317 t['afii57507'] = 0x0686; 14318 t['afii57508'] = 0x0698; 14319 t['afii57509'] = 0x06AF; 14320 t['afii57511'] = 0x0679; 14321 t['afii57512'] = 0x0688; 14322 t['afii57513'] = 0x0691; 14323 t['afii57514'] = 0x06BA; 14324 t['afii57519'] = 0x06D2; 14325 t['afii57534'] = 0x06D5; 14326 t['afii57636'] = 0x20AA; 14327 t['afii57645'] = 0x05BE; 14328 t['afii57658'] = 0x05C3; 14329 t['afii57664'] = 0x05D0; 14330 t['afii57665'] = 0x05D1; 14331 t['afii57666'] = 0x05D2; 14332 t['afii57667'] = 0x05D3; 14333 t['afii57668'] = 0x05D4; 14334 t['afii57669'] = 0x05D5; 14335 t['afii57670'] = 0x05D6; 14336 t['afii57671'] = 0x05D7; 14337 t['afii57672'] = 0x05D8; 14338 t['afii57673'] = 0x05D9; 14339 t['afii57674'] = 0x05DA; 14340 t['afii57675'] = 0x05DB; 14341 t['afii57676'] = 0x05DC; 14342 t['afii57677'] = 0x05DD; 14343 t['afii57678'] = 0x05DE; 14344 t['afii57679'] = 0x05DF; 14345 t['afii57680'] = 0x05E0; 14346 t['afii57681'] = 0x05E1; 14347 t['afii57682'] = 0x05E2; 14348 t['afii57683'] = 0x05E3; 14349 t['afii57684'] = 0x05E4; 14350 t['afii57685'] = 0x05E5; 14351 t['afii57686'] = 0x05E6; 14352 t['afii57687'] = 0x05E7; 14353 t['afii57688'] = 0x05E8; 14354 t['afii57689'] = 0x05E9; 14355 t['afii57690'] = 0x05EA; 14356 t['afii57694'] = 0xFB2A; 14357 t['afii57695'] = 0xFB2B; 14358 t['afii57700'] = 0xFB4B; 14359 t['afii57705'] = 0xFB1F; 14360 t['afii57716'] = 0x05F0; 14361 t['afii57717'] = 0x05F1; 14362 t['afii57718'] = 0x05F2; 14363 t['afii57723'] = 0xFB35; 14364 t['afii57793'] = 0x05B4; 14365 t['afii57794'] = 0x05B5; 14366 t['afii57795'] = 0x05B6; 14367 t['afii57796'] = 0x05BB; 14368 t['afii57797'] = 0x05B8; 14369 t['afii57798'] = 0x05B7; 14370 t['afii57799'] = 0x05B0; 14371 t['afii57800'] = 0x05B2; 14372 t['afii57801'] = 0x05B1; 14373 t['afii57802'] = 0x05B3; 14374 t['afii57803'] = 0x05C2; 14375 t['afii57804'] = 0x05C1; 14376 t['afii57806'] = 0x05B9; 14377 t['afii57807'] = 0x05BC; 14378 t['afii57839'] = 0x05BD; 14379 t['afii57841'] = 0x05BF; 14380 t['afii57842'] = 0x05C0; 14381 t['afii57929'] = 0x02BC; 14382 t['afii61248'] = 0x2105; 14383 t['afii61289'] = 0x2113; 14384 t['afii61352'] = 0x2116; 14385 t['afii61573'] = 0x202C; 14386 t['afii61574'] = 0x202D; 14387 t['afii61575'] = 0x202E; 14388 t['afii61664'] = 0x200C; 14389 t['afii63167'] = 0x066D; 14390 t['afii64937'] = 0x02BD; 14391 t['agrave'] = 0x00E0; 14392 t['agujarati'] = 0x0A85; 14393 t['agurmukhi'] = 0x0A05; 14394 t['ahiragana'] = 0x3042;
14395 t['ahookabove'] = 0x1EA3; 14396 t['aibengali'] = 0x0990; 14397 t['aibopomofo'] = 0x311E; 14398 t['aideva'] = 0x0910; 14399 t['aiecyrillic'] = 0x04D5; 14400 t['aigujarati'] = 0x0A90; 14401 t['aigurmukhi'] = 0x0A10; 14402 t['aimatragurmukhi'] = 0x0A48; 14403 t['ainarabic'] = 0x0639; 14404 t['ainfinalarabic'] = 0xFECA; 14405 t['aininitialarabic'] = 0xFECB; 14406 t['ainmedialarabic'] = 0xFECC; 14407 t['ainvertedbreve'] = 0x0203; 14408 t['aivowelsignbengali'] = 0x09C8; 14409 t['aivowelsigndeva'] = 0x0948; 14410 t['aivowelsigngujarati'] = 0x0AC8; 14411 t['akatakana'] = 0x30A2; 14412 t['akatakanahalfwidth'] = 0xFF71; 14413 t['akorean'] = 0x314F; 14414 t['alef'] = 0x05D0; 14415 t['alefarabic'] = 0x0627; 14416 t['alefdageshhebrew'] = 0xFB30; 14417 t['aleffinalarabic'] = 0xFE8E; 14418 t['alefhamzaabovearabic'] = 0x0623; 14419 t['alefhamzaabovefinalarabic'] = 0xFE84; 14420 t['alefhamzabelowarabic'] = 0x0625; 14421 t['alefhamzabelowfinalarabic'] = 0xFE88; 14422 t['alefhebrew'] = 0x05D0; 14423 t['aleflamedhebrew'] = 0xFB4F; 14424 t['alefmaddaabovearabic'] = 0x0622; 14425 t['alefmaddaabovefinalarabic'] = 0xFE82; 14426 t['alefmaksuraarabic'] = 0x0649; 14427 t['alefmaksurafinalarabic'] = 0xFEF0; 14428 t['alefmaksurainitialarabic'] = 0xFEF3; 14429 t['alefmaksuramedialarabic'] = 0xFEF4; 14430 t['alefpatahhebrew'] = 0xFB2E; 14431 t['alefqamatshebrew'] = 0xFB2F; 14432 t['aleph'] = 0x2135; 14433 t['allequal'] = 0x224C; 14434 t['alpha'] = 0x03B1; 14435 t['alphatonos'] = 0x03AC; 14436 t['amacron'] = 0x0101; 14437 t['amonospace'] = 0xFF41; 14438 t['ampersand'] = 0x0026; 14439 t['ampersandmonospace'] = 0xFF06; 14440 t['ampersandsmall'] = 0xF726; 14441 t['amsquare'] = 0x33C2; 14442 t['anbopomofo'] = 0x3122; 14443 t['angbopomofo'] = 0x3124; 14444 t['angbracketleft'] = 0x3008; 14445 t['angbracketright'] = 0x3009; 14446 t['angkhankhuthai'] = 0x0E5A; 14447 t['angle'] = 0x2220; 14448 t['anglebracketleft'] = 0x3008; 14449 t['anglebracketleftvertical'] = 0xFE3F; 14450 t['anglebracketright'] = 0x3009; 14451 t['anglebracketrightvertical'] = 0xFE40; 14452 t['angleleft'] = 0x2329; 14453 t['angleright'] = 0x232A; 14454 t['angstrom'] = 0x212B; 14455 t['anoteleia'] = 0x0387; 14456 t['anudattadeva'] = 0x0952; 14457 t['anusvarabengali'] = 0x0982; 14458 t['anusvaradeva'] = 0x0902; 14459 t['anusvaragujarati'] = 0x0A82; 14460 t['aogonek'] = 0x0105; 14461 t['apaatosquare'] = 0x3300; 14462 t['aparen'] = 0x249C; 14463 t['apostrophearmenian'] = 0x055A; 14464 t['apostrophemod'] = 0x02BC; 14465 t['apple'] = 0xF8FF; 14466 t['approaches'] = 0x2250; 14467 t['approxequal'] = 0x2248; 14468 t['approxequalorimage'] = 0x2252; 14469 t['approximatelyequal'] = 0x2245; 14470 t['araeaekorean'] = 0x318E; 14471 t['araeakorean'] = 0x318D; 14472 t['arc'] = 0x2312; 14473 t['arighthalfring'] = 0x1E9A; 14474 t['aring'] = 0x00E5; 14475 t['aringacute'] = 0x01FB; 14476 t['aringbelow'] = 0x1E01; 14477 t['arrowboth'] = 0x2194; 14478 t['arrowdashdown'] = 0x21E3; 14479 t['arrowdashleft'] = 0x21E0; 14480 t['arrowdashright'] = 0x21E2; 14481 t['arrowdashup'] = 0x21E1; 14482 t['arrowdblboth'] = 0x21D4; 14483 t['arrowdbldown'] = 0x21D3; 14484 t['arrowdblleft'] = 0x21D0; 14485 t['arrowdblright'] = 0x21D2; 14486 t['arrowdblup'] = 0x21D1; 14487 t['arrowdown'] = 0x2193; 14488 t['arrowdownleft'] = 0x2199; 14489 t['arrowdownright'] = 0x2198; 14490 t['arrowdownwhite'] = 0x21E9; 14491 t['arrowheaddownmod'] = 0x02C5; 14492 t['arrowheadleftmod'] = 0x02C2; 14493 t['arrowheadrightmod'] = 0x02C3; 14494 t['arrowheadupmod'] = 0x02C4; 14495 t['arrowhorizex'] = 0xF8E7; 14496 t['arrowleft'] = 0x2190; 14497 t['arrowleftdbl'] = 0x21D0; 14498 t['arrowleftdblstroke'] = 0x21CD; 14499 t['arrowleftoverright'] = 0x21C6; 14500 t['arrowleftwhite'] = 0x21E6; 14501 t['arrowright'] = 0x2192; 14502 t['arrowrightdblstroke'] = 0x21CF; 14503 t['arrowrightheavy'] = 0x279E; 14504 t['arrowrightoverleft'] = 0x21C4; 14505 t['arrowrightwhite'] = 0x21E8; 14506 t['arrowtableft'] = 0x21E4; 14507 t['arrowtabright'] = 0x21E5; 14508 t['arrowup'] = 0x2191; 14509 t['arrowupdn'] = 0x2195; 14510 t['arrowupdnbse'] = 0x21A8; 14511 t['arrowupdownbase'] = 0x21A8; 14512 t['arrowupleft'] = 0x2196; 14513 t['arrowupleftofdown'] = 0x21C5; 14514 t['arrowupright'] = 0x2197; 14515 t['arrowupwhite'] = 0x21E7; 14516 t['arrowvertex'] = 0xF8E6; 14517 t['asciicircum'] = 0x005E; 14518 t['asciicircummonospace'] = 0xFF3E; 14519 t['asciitilde'] = 0x007E; 14520 t['asciitildemonospace'] = 0xFF5E; 14521 t['ascript'] = 0x0251; 14522 t['ascriptturned'] = 0x0252; 14523 t['asmallhiragana'] = 0x3041; 14524 t['asmallkatakana'] = 0x30A1; 14525 t['asmallkatakanahalfwidth'] = 0xFF67; 14526 t['asterisk'] = 0x002A; 14527 t['asteriskaltonearabic'] = 0x066D; 14528 t['asteriskarabic'] = 0x066D; 14529 t['asteriskmath'] = 0x2217; 14530 t['asteriskmonospace'] = 0xFF0A; 14531 t['asterisksmall'] = 0xFE61; 14532 t['asterism'] = 0x2042; 14533 t['asuperior'] = 0xF6E9;
14534 t['asymptoticallyequal'] = 0x2243; 14535 t['at'] = 0x0040; 14536 t['atilde'] = 0x00E3; 14537 t['atmonospace'] = 0xFF20; 14538 t['atsmall'] = 0xFE6B; 14539 t['aturned'] = 0x0250; 14540 t['aubengali'] = 0x0994; 14541 t['aubopomofo'] = 0x3120; 14542 t['audeva'] = 0x0914; 14543 t['augujarati'] = 0x0A94; 14544 t['augurmukhi'] = 0x0A14; 14545 t['aulengthmarkbengali'] = 0x09D7; 14546 t['aumatragurmukhi'] = 0x0A4C; 14547 t['auvowelsignbengali'] = 0x09CC; 14548 t['auvowelsigndeva'] = 0x094C; 14549 t['auvowelsigngujarati'] = 0x0ACC; 14550 t['avagrahadeva'] = 0x093D; 14551 t['aybarmenian'] = 0x0561; 14552 t['ayin'] = 0x05E2; 14553 t['ayinaltonehebrew'] = 0xFB20; 14554 t['ayinhebrew'] = 0x05E2; 14555 t['b'] = 0x0062; 14556 t['babengali'] = 0x09AC; 14557 t['backslash'] = 0x005C; 14558 t['backslashmonospace'] = 0xFF3C; 14559 t['badeva'] = 0x092C; 14560 t['bagujarati'] = 0x0AAC; 14561 t['bagurmukhi'] = 0x0A2C; 14562 t['bahiragana'] = 0x3070; 14563 t['bahtthai'] = 0x0E3F; 14564 t['bakatakana'] = 0x30D0; 14565 t['bar'] = 0x007C; 14566 t['barmonospace'] = 0xFF5C; 14567 t['bbopomofo'] = 0x3105; 14568 t['bcircle'] = 0x24D1; 14569 t['bdotaccent'] = 0x1E03; 14570 t['bdotbelow'] = 0x1E05; 14571 t['beamedsixteenthnotes'] = 0x266C; 14572 t['because'] = 0x2235; 14573 t['becyrillic'] = 0x0431; 14574 t['beharabic'] = 0x0628; 14575 t['behfinalarabic'] = 0xFE90; 14576 t['behinitialarabic'] = 0xFE91; 14577 t['behiragana'] = 0x3079; 14578 t['behmedialarabic'] = 0xFE92; 14579 t['behmeeminitialarabic'] = 0xFC9F; 14580 t['behmeemisolatedarabic'] = 0xFC08; 14581 t['behnoonfinalarabic'] = 0xFC6D; 14582 t['bekatakana'] = 0x30D9; 14583 t['benarmenian'] = 0x0562; 14584 t['bet'] = 0x05D1; 14585 t['beta'] = 0x03B2; 14586 t['betasymbolgreek'] = 0x03D0; 14587 t['betdagesh'] = 0xFB31; 14588 t['betdageshhebrew'] = 0xFB31; 14589 t['bethebrew'] = 0x05D1; 14590 t['betrafehebrew'] = 0xFB4C; 14591 t['bhabengali'] = 0x09AD; 14592 t['bhadeva'] = 0x092D; 14593 t['bhagujarati'] = 0x0AAD; 14594 t['bhagurmukhi'] = 0x0A2D; 14595 t['bhook'] = 0x0253; 14596 t['bihiragana'] = 0x3073; 14597 t['bikatakana'] = 0x30D3; 14598 t['bilabialclick'] = 0x0298; 14599 t['bindigurmukhi'] = 0x0A02; 14600 t['birusquare'] = 0x3331; 14601 t['blackcircle'] = 0x25CF; 14602 t['blackdiamond'] = 0x25C6; 14603 t['blackdownpointingtriangle'] = 0x25BC; 14604 t['blackleftpointingpointer'] = 0x25C4; 14605 t['blackleftpointingtriangle'] = 0x25C0; 14606 t['blacklenticularbracketleft'] = 0x3010; 14607 t['blacklenticularbracketleftvertical'] = 0xFE3B; 14608 t['blacklenticularbracketright'] = 0x3011; 14609 t['blacklenticularbracketrightvertical'] = 0xFE3C; 14610 t['blacklowerlefttriangle'] = 0x25E3; 14611 t['blacklowerrighttriangle'] = 0x25E2; 14612 t['blackrectangle'] = 0x25AC; 14613 t['blackrightpointingpointer'] = 0x25BA; 14614 t['blackrightpointingtriangle'] = 0x25B6; 14615 t['blacksmallsquare'] = 0x25AA; 14616 t['blacksmilingface'] = 0x263B; 14617 t['blacksquare'] = 0x25A0; 14618 t['blackstar'] = 0x2605; 14619 t['blackupperlefttriangle'] = 0x25E4; 14620 t['blackupperrighttriangle'] = 0x25E5; 14621 t['blackuppointingsmalltriangle'] = 0x25B4; 14622 t['blackuppointingtriangle'] = 0x25B2; 14623 t['blank'] = 0x2423; 14624 t['blinebelow'] = 0x1E07; 14625 t['block'] = 0x2588; 14626 t['bmonospace'] = 0xFF42; 14627 t['bobaimaithai'] = 0x0E1A; 14628 t['bohiragana'] = 0x307C; 14629 t['bokatakana'] = 0x30DC; 14630 t['bparen'] = 0x249D; 14631 t['bqsquare'] = 0x33C3; 14632 t['braceex'] = 0xF8F4; 14633 t['braceleft'] = 0x007B; 14634 t['braceleftbt'] = 0xF8F3; 14635 t['braceleftmid'] = 0xF8F2; 14636 t['braceleftmonospace'] = 0xFF5B; 14637 t['braceleftsmall'] = 0xFE5B; 14638 t['bracelefttp'] = 0xF8F1; 14639 t['braceleftvertical'] = 0xFE37; 14640 t['braceright'] = 0x007D; 14641 t['bracerightbt'] = 0xF8FE; 14642 t['bracerightmid'] = 0xF8FD; 14643 t['bracerightmonospace'] = 0xFF5D; 14644 t['bracerightsmall'] = 0xFE5C; 14645 t['bracerighttp'] = 0xF8FC; 14646 t['bracerightvertical'] = 0xFE38; 14647 t['bracketleft'] = 0x005B; 14648 t['bracketleftbt'] = 0xF8F0; 14649 t['bracketleftex'] = 0xF8EF; 14650 t['bracketleftmonospace'] = 0xFF3B; 14651 t['bracketlefttp'] = 0xF8EE; 14652 t['bracketright'] = 0x005D; 14653 t['bracketrightbt'] = 0xF8FB; 14654 t['bracketrightex'] = 0xF8FA; 14655 t['bracketrightmonospace'] = 0xFF3D; 14656 t['bracketrighttp'] = 0xF8F9; 14657 t['breve'] = 0x02D8; 14658 t['brevebelowcmb'] = 0x032E; 14659 t['brevecmb'] = 0x0306; 14660 t['breveinvertedbelowcmb'] = 0x032F; 14661 t['breveinvertedcmb'] = 0x0311; 14662 t['breveinverteddoublecmb'] = 0x0361; 14663 t['bridgebelowcmb'] = 0x032A; 14664 t['bridgeinvertedbelowcmb'] = 0x033A; 14665 t['brokenbar'] = 0x00A6; 14666 t['bstroke'] = 0x0180; 14667 t['bsuperior'] = 0xF6EA; 14668 t['btopbar'] = 0x0183; 14669 t['buhiragana'] = 0x3076; 14670 t['bukatakana'] = 0x30D6; 14671 t['bullet'] = 0x2022; 14672 t['bulletinverse'] = 0x25D8; 14673 t['bulletoperator'] = 0x2219; 14674 t['bullseye'] = 0x25CE; 14675 t['c'] = 0x0063; 14676 t['caarmenian'] = 0x056E; 14677 t['cabengali'] = 0x099A; 14678 t['cacute'] = 0x0107; 14679 t['cadeva'] = 0x091A; 14680 t['cagujarati'] = 0x0A9A; 14681 t['cagurmukhi'] = 0x0A1A; 14682 t['calsquare'] = 0x3388; 14683 t['candrabindubengali'] = 0x0981; 14684 t['candrabinducmb'] = 0x0310; 14685 t['candrabindudeva'] = 0x0901; 14686 t['candrabindugujarati'] = 0x0A81;
14687 t['capslock'] = 0x21EA; 14688 t['careof'] = 0x2105; 14689 t['caron'] = 0x02C7; 14690 t['caronbelowcmb'] = 0x032C; 14691 t['caroncmb'] = 0x030C; 14692 t['carriagereturn'] = 0x21B5; 14693 t['cbopomofo'] = 0x3118; 14694 t['ccaron'] = 0x010D; 14695 t['ccedilla'] = 0x00E7; 14696 t['ccedillaacute'] = 0x1E09; 14697 t['ccircle'] = 0x24D2; 14698 t['ccircumflex'] = 0x0109; 14699 t['ccurl'] = 0x0255; 14700 t['cdot'] = 0x010B; 14701 t['cdotaccent'] = 0x010B; 14702 t['cdsquare'] = 0x33C5; 14703 t['cedilla'] = 0x00B8; 14704 t['cedillacmb'] = 0x0327; 14705 t['cent'] = 0x00A2; 14706 t['centigrade'] = 0x2103; 14707 t['centinferior'] = 0xF6DF; 14708 t['centmonospace'] = 0xFFE0; 14709 t['centoldstyle'] = 0xF7A2; 14710 t['centsuperior'] = 0xF6E0; 14711 t['chaarmenian'] = 0x0579; 14712 t['chabengali'] = 0x099B; 14713 t['chadeva'] = 0x091B; 14714 t['chagujarati'] = 0x0A9B; 14715 t['chagurmukhi'] = 0x0A1B; 14716 t['chbopomofo'] = 0x3114; 14717 t['cheabkhasiancyrillic'] = 0x04BD; 14718 t['checkmark'] = 0x2713; 14719 t['checyrillic'] = 0x0447; 14720 t['chedescenderabkhasiancyrillic'] = 0x04BF; 14721 t['chedescendercyrillic'] = 0x04B7; 14722 t['chedieresiscyrillic'] = 0x04F5; 14723 t['cheharmenian'] = 0x0573; 14724 t['chekhakassiancyrillic'] = 0x04CC; 14725 t['cheverticalstrokecyrillic'] = 0x04B9; 14726 t['chi'] = 0x03C7; 14727 t['chieuchacirclekorean'] = 0x3277; 14728 t['chieuchaparenkorean'] = 0x3217; 14729 t['chieuchcirclekorean'] = 0x3269; 14730 t['chieuchkorean'] = 0x314A; 14731 t['chieuchparenkorean'] = 0x3209; 14732 t['chochangthai'] = 0x0E0A; 14733 t['chochanthai'] = 0x0E08; 14734 t['chochingthai'] = 0x0E09; 14735 t['chochoethai'] = 0x0E0C; 14736 t['chook'] = 0x0188; 14737 t['cieucacirclekorean'] = 0x3276; 14738 t['cieucaparenkorean'] = 0x3216; 14739 t['cieuccirclekorean'] = 0x3268; 14740 t['cieuckorean'] = 0x3148; 14741 t['cieucparenkorean'] = 0x3208; 14742 t['cieucuparenkorean'] = 0x321C; 14743 t['circle'] = 0x25CB; 14744 t['circlecopyrt'] = 0x00A9; 14745 t['circlemultiply'] = 0x2297; 14746 t['circleot'] = 0x2299; 14747 t['circleplus'] = 0x2295; 14748 t['circlepostalmark'] = 0x3036; 14749 t['circlewithlefthalfblack'] = 0x25D0; 14750 t['circlewithrighthalfblack'] = 0x25D1; 14751 t['circumflex'] = 0x02C6; 14752 t['circumflexbelowcmb'] = 0x032D; 14753 t['circumflexcmb'] = 0x0302; 14754 t['clear'] = 0x2327; 14755 t['clickalveolar'] = 0x01C2; 14756 t['clickdental'] = 0x01C0; 14757 t['clicklateral'] = 0x01C1; 14758 t['clickretroflex'] = 0x01C3; 14759 t['club'] = 0x2663; 14760 t['clubsuitblack'] = 0x2663; 14761 t['clubsuitwhite'] = 0x2667; 14762 t['cmcubedsquare'] = 0x33A4; 14763 t['cmonospace'] = 0xFF43; 14764 t['cmsquaredsquare'] = 0x33A0; 14765 t['coarmenian'] = 0x0581; 14766 t['colon'] = 0x003A; 14767 t['colonmonetary'] = 0x20A1; 14768 t['colonmonospace'] = 0xFF1A; 14769 t['colonsign'] = 0x20A1; 14770 t['colonsmall'] = 0xFE55; 14771 t['colontriangularhalfmod'] = 0x02D1; 14772 t['colontriangularmod'] = 0x02D0; 14773 t['comma'] = 0x002C; 14774 t['commaabovecmb'] = 0x0313; 14775 t['commaaboverightcmb'] = 0x0315; 14776 t['commaaccent'] = 0xF6C3; 14777 t['commaarabic'] = 0x060C; 14778 t['commaarmenian'] = 0x055D; 14779 t['commainferior'] = 0xF6E1; 14780 t['commamonospace'] = 0xFF0C; 14781 t['commareversedabovecmb'] = 0x0314; 14782 t['commareversedmod'] = 0x02BD; 14783 t['commasmall'] = 0xFE50; 14784 t['commasuperior'] = 0xF6E2; 14785 t['commaturnedabovecmb'] = 0x0312; 14786 t['commaturnedmod'] = 0x02BB; 14787 t['compass'] = 0x263C; 14788 t['congruent'] = 0x2245; 14789 t['contourintegral'] = 0x222E; 14790 t['control'] = 0x2303; 14791 t['controlACK'] = 0x0006; 14792 t['controlBEL'] = 0x0007; 14793 t['controlBS'] = 0x0008; 14794 t['controlCAN'] = 0x0018; 14795 t['controlCR'] = 0x000D; 14796 t['controlDC1'] = 0x0011; 14797 t['controlDC2'] = 0x0012; 14798 t['controlDC3'] = 0x0013; 14799 t['controlDC4'] = 0x0014; 14800 t['controlDEL'] = 0x007F; 14801 t['controlDLE'] = 0x0010; 14802 t['controlEM'] = 0x0019; 14803 t['controlENQ'] = 0x0005; 14804 t['controlEOT'] = 0x0004; 14805 t['controlESC'] = 0x001B; 14806 t['controlETB'] = 0x0017; 14807 t['controlETX'] = 0x0003; 14808 t['controlFF'] = 0x000C; 14809 t['controlFS'] = 0x001C; 14810 t['controlGS'] = 0x001D; 14811 t['controlHT'] = 0x0009; 14812 t['controlLF'] = 0x000A; 14813 t['controlNAK'] = 0x0015; 14814 t['controlNULL'] = 0x0000; 14815 t['controlRS'] = 0x001E; 14816 t['controlSI'] = 0x000F; 14817 t['controlSO'] = 0x000E; 14818 t['controlSOT'] = 0x0002; 14819 t['controlSTX'] = 0x0001; 14820 t['controlSUB'] = 0x001A; 14821 t['controlSYN'] = 0x0016; 14822 t['controlUS'] = 0x001F; 14823 t['controlVT'] = 0x000B; 14824 t['copyright'] = 0x00A9; 14825 t['copyrightsans'] = 0xF8E9; 14826 t['copyrightserif'] = 0xF6D9; 14827 t['cornerbracketleft'] = 0x300C; 14828 t['cornerbracketlefthalfwidth'] = 0xFF62; 14829 t['cornerbracketleftvertical'] = 0xFE41; 14830 t['cornerbracketright'] = 0x300D; 14831 t['cornerbracketrighthalfwidth'] = 0xFF63; 14832 t['cornerbracketrightvertical'] = 0xFE42; 14833 t['corporationsquare'] = 0x337F; 14834 t['cosquare'] = 0x33C7; 14835 t['coverkgsquare'] = 0x33C6; 14836 t['cparen'] = 0x249E; 14837 t['cruzeiro'] = 0x20A2; 14838 t['cstretched'] = 0x0297; 14839 t['curlyand'] = 0x22CF; 14840 t['curlyor'] = 0x22CE; 14841 t['currency'] = 0x00A4; 14842 t['cyrBreve'] = 0xF6D1; 14843 t['cyrFlex'] = 0xF6D2; 14844 t['cyrbreve'] = 0xF6D4; 14845 t['cyrflex'] = 0xF6D5; 14846 t['d'] = 0x0064; 14847 t['daarmenian'] = 0x0564; 14848 t['dabengali'] = 0x09A6; 14849 t['dadarabic'] = 0x0636; 14850 t['dadeva'] = 0x0926; 14851 t['dadfinalarabic'] = 0xFEBE; 14852 t['dadinitialarabic'] = 0xFEBF; 14853 t['dadmedialarabic'] = 0xFEC0; 14854 t['dagesh'] = 0x05BC; 14855 t['dageshhebrew'] = 0x05BC; 14856 t['dagger'] = 0x2020; 14857 t['daggerdbl'] = 0x2021; 14858 t['dagujarati'] = 0x0AA6; 14859 t['dagurmukhi'] = 0x0A26; 14860 t['dahiragana'] = 0x3060; 14861 t['dakatakana'] = 0x30C0; 14862 t['dalarabic'] = 0x062F; 14863 t['dalet'] = 0x05D3; 14864 t['daletdagesh'] = 0xFB33; 14865 t['daletdageshhebrew'] = 0xFB33; 14866 t['dalethebrew'] = 0x05D3; 14867 t['dalfinalarabic'] = 0xFEAA; 14868 t['dammaarabic'] = 0x064F; 14869 t['dammalowarabic'] = 0x064F; 14870 t['dammatanaltonearabic'] = 0x064C; 14871 t['dammatanarabic'] = 0x064C; 14872 t['danda'] = 0x0964; 14873 t['dargahebrew'] = 0x05A7; 14874 t['dargalefthebrew'] = 0x05A7; 14875 t['dasiapneumatacyrilliccmb'] = 0x0485; 14876 t['dblGrave'] = 0xF6D3; 14877 t['dblanglebracketleft'] = 0x300A; 14878 t['dblanglebracketleftvertical'] = 0xFE3D; 14879 t['dblanglebracketright'] = 0x300B; 14880 t['dblanglebracketrightvertical'] = 0xFE3E; 14881 t['dblarchinvertedbelowcmb'] = 0x032B; 14882 t['dblarrowleft'] = 0x21D4; 14883 t['dblarrowright'] = 0x21D2; 14884 t['dbldanda'] = 0x0965; 14885 t['dblgrave'] = 0xF6D6; 14886 t['dblgravecmb'] = 0x030F; 14887 t['dblintegral'] = 0x222C; 14888 t['dbllowline'] = 0x2017; 14889 t['dbllowlinecmb'] = 0x0333; 14890 t['dbloverlinecmb'] = 0x033F; 14891 t['dblprimemod'] = 0x02BA; 14892 t['dblverticalbar'] = 0x2016; 14893 t['dblverticallineabovecmb'] = 0x030E; 14894 t['dbopomofo'] = 0x3109; 14895 t['dbsquare'] = 0x33C8; 14896 t['dcaron'] = 0x010F; 14897 t['dcedilla'] = 0x1E11; 14898 t['dcircle'] = 0x24D3; 14899 t['dcircumflexbelow'] = 0x1E13; 14900 t['dcroat'] = 0x0111; 14901 t['ddabengali'] = 0x09A1; 14902 t['ddadeva'] = 0x0921; 14903 t['ddagujarati'] = 0x0AA1; 14904 t['ddagurmukhi'] = 0x0A21; 14905 t['ddalarabic'] = 0x0688; 14906 t['ddalfinalarabic'] = 0xFB89; 14907 t['dddhadeva'] = 0x095C; 14908 t['ddhabengali'] = 0x09A2; 14909 t['ddhadeva'] = 0x0922; 14910 t['ddhagujarati'] = 0x0AA2; 14911 t['ddhagurmukhi'] = 0x0A22; 14912 t['ddotaccent'] = 0x1E0B; 14913 t['ddotbelow'] = 0x1E0D; 14914 t['decimalseparatorarabic'] = 0x066B; 14915 t['decimalseparatorpersian'] = 0x066B; 14916 t['decyrillic'] = 0x0434; 14917 t['degree'] = 0x00B0; 14918 t['dehihebrew'] = 0x05AD; 14919 t['dehiragana'] = 0x3067; 14920 t['deicoptic'] = 0x03EF; 14921 t['dekatakana'] = 0x30C7; 14922 t['deleteleft'] = 0x232B; 14923 t['deleteright'] = 0x2326; 14924 t['delta'] = 0x03B4; 14925 t['deltaturned'] = 0x018D; 14926 t['denominatorminusonenumeratorbengali'] = 0x09F8; 14927 t['dezh'] = 0x02A4; 14928 t['dhabengali'] = 0x09A7; 14929 t['dhadeva'] = 0x0927; 14930 t['dhagujarati'] = 0x0AA7; 14931 t['dhagurmukhi'] = 0x0A27; 14932 t['dhook'] = 0x0257;
14933 t['dialytikatonos'] = 0x0385; 14934 t['dialytikatonoscmb'] = 0x0344; 14935 t['diamond'] = 0x2666; 14936 t['diamondsuitwhite'] = 0x2662; 14937 t['dieresis'] = 0x00A8; 14938 t['dieresisacute'] = 0xF6D7; 14939 t['dieresisbelowcmb'] = 0x0324; 14940 t['dieresiscmb'] = 0x0308; 14941 t['dieresisgrave'] = 0xF6D8; 14942 t['dieresistonos'] = 0x0385; 14943 t['dihiragana'] = 0x3062; 14944 t['dikatakana'] = 0x30C2; 14945 t['dittomark'] = 0x3003; 14946 t['divide'] = 0x00F7; 14947 t['divides'] = 0x2223; 14948 t['divisionslash'] = 0x2215; 14949 t['djecyrillic'] = 0x0452; 14950 t['dkshade'] = 0x2593; 14951 t['dlinebelow'] = 0x1E0F; 14952 t['dlsquare'] = 0x3397; 14953 t['dmacron'] = 0x0111; 14954 t['dmonospace'] = 0xFF44; 14955 t['dnblock'] = 0x2584; 14956 t['dochadathai'] = 0x0E0E; 14957 t['dodekthai'] = 0x0E14; 14958 t['dohiragana'] = 0x3069; 14959 t['dokatakana'] = 0x30C9; 14960 t['dollar'] = 0x0024; 14961 t['dollarinferior'] = 0xF6E3; 14962 t['dollarmonospace'] = 0xFF04; 14963 t['dollaroldstyle'] = 0xF724; 14964 t['dollarsmall'] = 0xFE69; 14965 t['dollarsuperior'] = 0xF6E4; 14966 t['dong'] = 0x20AB; 14967 t['dorusquare'] = 0x3326; 14968 t['dotaccent'] = 0x02D9; 14969 t['dotaccentcmb'] = 0x0307; 14970 t['dotbelowcmb'] = 0x0323; 14971 t['dotbelowcomb'] = 0x0323; 14972 t['dotkatakana'] = 0x30FB; 14973 t['dotlessi'] = 0x0131; 14974 t['dotlessj'] = 0xF6BE; 14975 t['dotlessjstrokehook'] = 0x0284; 14976 t['dotmath'] = 0x22C5; 14977 t['dottedcircle'] = 0x25CC; 14978 t['doubleyodpatah'] = 0xFB1F; 14979 t['doubleyodpatahhebrew'] = 0xFB1F; 14980 t['downtackbelowcmb'] = 0x031E; 14981 t['downtackmod'] = 0x02D5; 14982 t['dparen'] = 0x249F; 14983 t['dsuperior'] = 0xF6EB; 14984 t['dtail'] = 0x0256; 14985 t['dtopbar'] = 0x018C; 14986 t['duhiragana'] = 0x3065; 14987 t['dukatakana'] = 0x30C5; 14988 t['dz'] = 0x01F3; 14989 t['dzaltone'] = 0x02A3; 14990 t['dzcaron'] = 0x01C6; 14991 t['dzcurl'] = 0x02A5; 14992 t['dzeabkhasiancyrillic'] = 0x04E1; 14993 t['dzecyrillic'] = 0x0455; 14994 t['dzhecyrillic'] = 0x045F; 14995 t['e'] = 0x0065; 14996 t['eacute'] = 0x00E9; 14997 t['earth'] = 0x2641; 14998 t['ebengali'] = 0x098F; 14999 t['ebopomofo'] = 0x311C; 15000 t['ebreve'] = 0x0115; 15001 t['ecandradeva'] = 0x090D; 15002 t['ecandragujarati'] = 0x0A8D; 15003 t['ecandravowelsigndeva'] = 0x0945; 15004 t['ecandravowelsigngujarati'] = 0x0AC5; 15005 t['ecaron'] = 0x011B; 15006 t['ecedillabreve'] = 0x1E1D; 15007 t['echarmenian'] = 0x0565; 15008 t['echyiwnarmenian'] = 0x0587; 15009 t['ecircle'] = 0x24D4; 15010 t['ecircumflex'] = 0x00EA; 15011 t['ecircumflexacute'] = 0x1EBF; 15012 t['ecircumflexbelow'] = 0x1E19; 15013 t['ecircumflexdotbelow'] = 0x1EC7; 15014 t['ecircumflexgrave'] = 0x1EC1; 15015 t['ecircumflexhookabove'] = 0x1EC3; 15016 t['ecircumflextilde'] = 0x1EC5; 15017 t['ecyrillic'] = 0x0454; 15018 t['edblgrave'] = 0x0205; 15019 t['edeva'] = 0x090F; 15020 t['edieresis'] = 0x00EB; 15021 t['edot'] = 0x0117; 15022 t['edotaccent'] = 0x0117; 15023 t['edotbelow'] = 0x1EB9; 15024 t['eegurmukhi'] = 0x0A0F; 15025 t['eematragurmukhi'] = 0x0A47; 15026 t['efcyrillic'] = 0x0444; 15027 t['egrave'] = 0x00E8; 15028 t['egujarati'] = 0x0A8F; 15029 t['eharmenian'] = 0x0567; 15030 t['ehbopomofo'] = 0x311D; 15031 t['ehiragana'] = 0x3048; 15032 t['ehookabove'] = 0x1EBB; 15033 t['eibopomofo'] = 0x311F; 15034 t['eight'] = 0x0038; 15035 t['eightarabic'] = 0x0668; 15036 t['eightbengali'] = 0x09EE; 15037 t['eightcircle'] = 0x2467; 15038 t['eightcircleinversesansserif'] = 0x2791; 15039 t['eightdeva'] = 0x096E; 15040 t['eighteencircle'] = 0x2471; 15041 t['eighteenparen'] = 0x2485; 15042 t['eighteenperiod'] = 0x2499; 15043 t['eightgujarati'] = 0x0AEE; 15044 t['eightgurmukhi'] = 0x0A6E; 15045 t['eighthackarabic'] = 0x0668; 15046 t['eighthangzhou'] = 0x3028; 15047 t['eighthnotebeamed'] = 0x266B; 15048 t['eightideographicparen'] = 0x3227; 15049 t['eightinferior'] = 0x2088; 15050 t['eightmonospace'] = 0xFF18; 15051 t['eightoldstyle'] = 0xF738; 15052 t['eightparen'] = 0x247B; 15053 t['eightperiod'] = 0x248F; 15054 t['eightpersian'] = 0x06F8; 15055 t['eightroman'] = 0x2177; 15056 t['eightsuperior'] = 0x2078; 15057 t['eightthai'] = 0x0E58; 15058 t['einvertedbreve'] = 0x0207; 15059 t['eiotifiedcyrillic'] = 0x0465; 15060 t['ekatakana'] = 0x30A8; 15061 t['ekatakanahalfwidth'] = 0xFF74; 15062 t['ekonkargurmukhi'] = 0x0A74; 15063 t['ekorean'] = 0x3154; 15064 t['elcyrillic'] = 0x043B; 15065 t['element'] = 0x2208; 15066 t['elevencircle'] = 0x246A; 15067 t['elevenparen'] = 0x247E; 15068 t['elevenperiod'] = 0x2492; 15069 t['elevenroman'] = 0x217A; 15070 t['ellipsis'] = 0x2026; 15071 t['ellipsisvertical'] = 0x22EE; 15072 t['emacron'] = 0x0113; 15073 t['emacronacute'] = 0x1E17; 15074 t['emacrongrave'] = 0x1E15; 15075 t['emcyrillic'] = 0x043C; 15076 t['emdash'] = 0x2014; 15077 t['emdashvertical'] = 0xFE31; 15078 t['emonospace'] = 0xFF45; 15079 t['emphasismarkarmenian'] = 0x055B; 15080 t['emptyset'] = 0x2205; 15081 t['enbopomofo'] = 0x3123; 15082 t['encyrillic'] = 0x043D; 15083 t['endash'] = 0x2013; 15084 t['endashvertical'] = 0xFE32; 15085 t['endescendercyrillic'] = 0x04A3; 15086 t['eng'] = 0x014B; 15087 t['engbopomofo'] = 0x3125; 15088 t['enghecyrillic'] = 0x04A5; 15089 t['enhookcyrillic'] = 0x04C8; 15090 t['enspace'] = 0x2002; 15091 t['eogonek'] = 0x0119; 15092 t['eokorean'] = 0x3153; 15093 t['eopen'] = 0x025B; 15094 t['eopenclosed'] = 0x029A; 15095 t['eopenreversed'] = 0x025C; 15096 t['eopenreversedclosed'] = 0x025E; 15097 t['eopenreversedhook'] = 0x025D; 15098 t['eparen'] = 0x24A0; 15099 t['epsilon'] = 0x03B5;
15100 t['epsilontonos'] = 0x03AD; 15101 t['equal'] = 0x003D; 15102 t['equalmonospace'] = 0xFF1D; 15103 t['equalsmall'] = 0xFE66; 15104 t['equalsuperior'] = 0x207C; 15105 t['equivalence'] = 0x2261; 15106 t['erbopomofo'] = 0x3126; 15107 t['ercyrillic'] = 0x0440; 15108 t['ereversed'] = 0x0258; 15109 t['ereversedcyrillic'] = 0x044D; 15110 t['escyrillic'] = 0x0441; 15111 t['esdescendercyrillic'] = 0x04AB; 15112 t['esh'] = 0x0283; 15113 t['eshcurl'] = 0x0286; 15114 t['eshortdeva'] = 0x090E; 15115 t['eshortvowelsigndeva'] = 0x0946; 15116 t['eshreversedloop'] = 0x01AA; 15117 t['eshsquatreversed'] = 0x0285; 15118 t['esmallhiragana'] = 0x3047; 15119 t['esmallkatakana'] = 0x30A7; 15120 t['esmallkatakanahalfwidth'] = 0xFF6A; 15121 t['estimated'] = 0x212E; 15122 t['esuperior'] = 0xF6EC; 15123 t['eta'] = 0x03B7; 15124 t['etarmenian'] = 0x0568; 15125 t['etatonos'] = 0x03AE; 15126 t['eth'] = 0x00F0; 15127 t['etilde'] = 0x1EBD; 15128 t['etildebelow'] = 0x1E1B; 15129 t['etnahtafoukhhebrew'] = 0x0591; 15130 t['etnahtafoukhlefthebrew'] = 0x0591; 15131 t['etnahtahebrew'] = 0x0591; 15132 t['etnahtalefthebrew'] = 0x0591; 15133 t['eturned'] = 0x01DD; 15134 t['eukorean'] = 0x3161; 15135 t['euro'] = 0x20AC; 15136 t['evowelsignbengali'] = 0x09C7; 15137 t['evowelsigndeva'] = 0x0947; 15138 t['evowelsigngujarati'] = 0x0AC7; 15139 t['exclam'] = 0x0021; 15140 t['exclamarmenian'] = 0x055C; 15141 t['exclamdbl'] = 0x203C; 15142 t['exclamdown'] = 0x00A1; 15143 t['exclamdownsmall'] = 0xF7A1; 15144 t['exclammonospace'] = 0xFF01; 15145 t['exclamsmall'] = 0xF721; 15146 t['existential'] = 0x2203; 15147 t['ezh'] = 0x0292; 15148 t['ezhcaron'] = 0x01EF; 15149 t['ezhcurl'] = 0x0293; 15150 t['ezhreversed'] = 0x01B9; 15151 t['ezhtail'] = 0x01BA; 15152 t['f'] = 0x0066; 15153 t['fadeva'] = 0x095E; 15154 t['fagurmukhi'] = 0x0A5E; 15155 t['fahrenheit'] = 0x2109; 15156 t['fathaarabic'] = 0x064E; 15157 t['fathalowarabic'] = 0x064E; 15158 t['fathatanarabic'] = 0x064B; 15159 t['fbopomofo'] = 0x3108; 15160 t['fcircle'] = 0x24D5; 15161 t['fdotaccent'] = 0x1E1F; 15162 t['feharabic'] = 0x0641; 15163 t['feharmenian'] = 0x0586; 15164 t['fehfinalarabic'] = 0xFED2; 15165 t['fehinitialarabic'] = 0xFED3; 15166 t['fehmedialarabic'] = 0xFED4; 15167 t['feicoptic'] = 0x03E5; 15168 t['female'] = 0x2640; 15169 t['ff'] = 0xFB00; 15170 t['ffi'] = 0xFB03; 15171 t['ffl'] = 0xFB04; 15172 t['fi'] = 0xFB01; 15173 t['fifteencircle'] = 0x246E; 15174 t['fifteenparen'] = 0x2482; 15175 t['fifteenperiod'] = 0x2496; 15176 t['figuredash'] = 0x2012; 15177 t['filledbox'] = 0x25A0; 15178 t['filledrect'] = 0x25AC; 15179 t['finalkaf'] = 0x05DA; 15180 t['finalkafdagesh'] = 0xFB3A; 15181 t['finalkafdageshhebrew'] = 0xFB3A; 15182 t['finalkafhebrew'] = 0x05DA; 15183 t['finalmem'] = 0x05DD; 15184 t['finalmemhebrew'] = 0x05DD; 15185 t['finalnun'] = 0x05DF; 15186 t['finalnunhebrew'] = 0x05DF; 15187 t['finalpe'] = 0x05E3; 15188 t['finalpehebrew'] = 0x05E3; 15189 t['finaltsadi'] = 0x05E5; 15190 t['finaltsadihebrew'] = 0x05E5; 15191 t['firsttonechinese'] = 0x02C9; 15192 t['fisheye'] = 0x25C9; 15193 t['fitacyrillic'] = 0x0473; 15194 t['five'] = 0x0035; 15195 t['fivearabic'] = 0x0665; 15196 t['fivebengali'] = 0x09EB; 15197 t['fivecircle'] = 0x2464; 15198 t['fivecircleinversesansserif'] = 0x278E; 15199 t['fivedeva'] = 0x096B; 15200 t['fiveeighths'] = 0x215D; 15201 t['fivegujarati'] = 0x0AEB; 15202 t['fivegurmukhi'] = 0x0A6B; 15203 t['fivehackarabic'] = 0x0665; 15204 t['fivehangzhou'] = 0x3025; 15205 t['fiveideographicparen'] = 0x3224; 15206 t['fiveinferior'] = 0x2085; 15207 t['fivemonospace'] = 0xFF15; 15208 t['fiveoldstyle'] = 0xF735; 15209 t['fiveparen'] = 0x2478; 15210 t['fiveperiod'] = 0x248C; 15211 t['fivepersian'] = 0x06F5; 15212 t['fiveroman'] = 0x2174; 15213 t['fivesuperior'] = 0x2075; 15214 t['fivethai'] = 0x0E55; 15215 t['fl'] = 0xFB02; 15216 t['florin'] = 0x0192; 15217 t['fmonospace'] = 0xFF46; 15218 t['fmsquare'] = 0x3399; 15219 t['fofanthai'] = 0x0E1F; 15220 t['fofathai'] = 0x0E1D; 15221 t['fongmanthai'] = 0x0E4F; 15222 t['forall'] = 0x2200; 15223 t['four'] = 0x0034; 15224 t['fourarabic'] = 0x0664; 15225 t['fourbengali'] = 0x09EA; 15226 t['fourcircle'] = 0x2463; 15227 t['fourcircleinversesansserif'] = 0x278D; 15228 t['fourdeva'] = 0x096A; 15229 t['fourgujarati'] = 0x0AEA; 15230 t['fourgurmukhi'] = 0x0A6A; 15231 t['fourhackarabic'] = 0x0664; 15232 t['fourhangzhou'] = 0x3024; 15233 t['fourideographicparen'] = 0x3223; 15234 t['fourinferior'] = 0x2084; 15235 t['fourmonospace'] = 0xFF14; 15236 t['fournumeratorbengali'] = 0x09F7; 15237 t['fouroldstyle'] = 0xF734; 15238 t['fourparen'] = 0x2477; 15239 t['fourperiod'] = 0x248B; 15240 t['fourpersian'] = 0x06F4; 15241 t['fourroman'] = 0x2173; 15242 t['foursuperior'] = 0x2074; 15243 t['fourteencircle'] = 0x246D; 15244 t['fourteenparen'] = 0x2481; 15245 t['fourteenperiod'] = 0x2495;
15246 t['fourthai'] = 0x0E54; 15247 t['fourthtonechinese'] = 0x02CB; 15248 t['fparen'] = 0x24A1; 15249 t['fraction'] = 0x2044; 15250 t['franc'] = 0x20A3; 15251 t['g'] = 0x0067; 15252 t['gabengali'] = 0x0997; 15253 t['gacute'] = 0x01F5; 15254 t['gadeva'] = 0x0917; 15255 t['gafarabic'] = 0x06AF; 15256 t['gaffinalarabic'] = 0xFB93; 15257 t['gafinitialarabic'] = 0xFB94; 15258 t['gafmedialarabic'] = 0xFB95; 15259 t['gagujarati'] = 0x0A97; 15260 t['gagurmukhi'] = 0x0A17; 15261 t['gahiragana'] = 0x304C; 15262 t['gakatakana'] = 0x30AC; 15263 t['gamma'] = 0x03B3; 15264 t['gammalatinsmall'] = 0x0263; 15265 t['gammasuperior'] = 0x02E0; 15266 t['gangiacoptic'] = 0x03EB; 15267 t['gbopomofo'] = 0x310D; 15268 t['gbreve'] = 0x011F; 15269 t['gcaron'] = 0x01E7; 15270 t['gcedilla'] = 0x0123; 15271 t['gcircle'] = 0x24D6; 15272 t['gcircumflex'] = 0x011D; 15273 t['gcommaaccent'] = 0x0123; 15274 t['gdot'] = 0x0121; 15275 t['gdotaccent'] = 0x0121; 15276 t['gecyrillic'] = 0x0433; 15277 t['gehiragana'] = 0x3052; 15278 t['gekatakana'] = 0x30B2; 15279 t['geometricallyequal'] = 0x2251; 15280 t['gereshaccenthebrew'] = 0x059C; 15281 t['gereshhebrew'] = 0x05F3; 15282 t['gereshmuqdamhebrew'] = 0x059D; 15283 t['germandbls'] = 0x00DF; 15284 t['gershayimaccenthebrew'] = 0x059E; 15285 t['gershayimhebrew'] = 0x05F4; 15286 t['getamark'] = 0x3013; 15287 t['ghabengali'] = 0x0998; 15288 t['ghadarmenian'] = 0x0572; 15289 t['ghadeva'] = 0x0918; 15290 t['ghagujarati'] = 0x0A98; 15291 t['ghagurmukhi'] = 0x0A18; 15292 t['ghainarabic'] = 0x063A; 15293 t['ghainfinalarabic'] = 0xFECE; 15294 t['ghaininitialarabic'] = 0xFECF; 15295 t['ghainmedialarabic'] = 0xFED0; 15296 t['ghemiddlehookcyrillic'] = 0x0495; 15297 t['ghestrokecyrillic'] = 0x0493; 15298 t['gheupturncyrillic'] = 0x0491; 15299 t['ghhadeva'] = 0x095A; 15300 t['ghhagurmukhi'] = 0x0A5A; 15301 t['ghook'] = 0x0260; 15302 t['ghzsquare'] = 0x3393; 15303 t['gihiragana'] = 0x304E; 15304 t['gikatakana'] = 0x30AE; 15305 t['gimarmenian'] = 0x0563; 15306 t['gimel'] = 0x05D2; 15307 t['gimeldagesh'] = 0xFB32; 15308 t['gimeldageshhebrew'] = 0xFB32; 15309 t['gimelhebrew'] = 0x05D2; 15310 t['gjecyrillic'] = 0x0453; 15311 t['glottalinvertedstroke'] = 0x01BE; 15312 t['glottalstop'] = 0x0294; 15313 t['glottalstopinverted'] = 0x0296; 15314 t['glottalstopmod'] = 0x02C0; 15315 t['glottalstopreversed'] = 0x0295; 15316 t['glottalstopreversedmod'] = 0x02C1; 15317 t['glottalstopreversedsuperior'] = 0x02E4; 15318 t['glottalstopstroke'] = 0x02A1; 15319 t['glottalstopstrokereversed'] = 0x02A2; 15320 t['gmacron'] = 0x1E21; 15321 t['gmonospace'] = 0xFF47; 15322 t['gohiragana'] = 0x3054; 15323 t['gokatakana'] = 0x30B4; 15324 t['gparen'] = 0x24A2; 15325 t['gpasquare'] = 0x33AC; 15326 t['gradient'] = 0x2207; 15327 t['grave'] = 0x0060; 15328 t['gravebelowcmb'] = 0x0316; 15329 t['gravecmb'] = 0x0300; 15330 t['gravecomb'] = 0x0300; 15331 t['gravedeva'] = 0x0953; 15332 t['gravelowmod'] = 0x02CE; 15333 t['gravemonospace'] = 0xFF40; 15334 t['gravetonecmb'] = 0x0340; 15335 t['greater'] = 0x003E; 15336 t['greaterequal'] = 0x2265; 15337 t['greaterequalorless'] = 0x22DB; 15338 t['greatermonospace'] = 0xFF1E; 15339 t['greaterorequivalent'] = 0x2273; 15340 t['greaterorless'] = 0x2277; 15341 t['greateroverequal'] = 0x2267; 15342 t['greatersmall'] = 0xFE65; 15343 t['gscript'] = 0x0261; 15344 t['gstroke'] = 0x01E5; 15345 t['guhiragana'] = 0x3050; 15346 t['guillemotleft'] = 0x00AB; 15347 t['guillemotright'] = 0x00BB; 15348 t['guilsinglleft'] = 0x2039; 15349 t['guilsinglright'] = 0x203A; 15350 t['gukatakana'] = 0x30B0; 15351 t['guramusquare'] = 0x3318; 15352 t['gysquare'] = 0x33C9; 15353 t['h'] = 0x0068; 15354 t['haabkhasiancyrillic'] = 0x04A9; 15355 t['haaltonearabic'] = 0x06C1; 15356 t['habengali'] = 0x09B9; 15357 t['hadescendercyrillic'] = 0x04B3; 15358 t['hadeva'] = 0x0939; 15359 t['hagujarati'] = 0x0AB9; 15360 t['hagurmukhi'] = 0x0A39; 15361 t['haharabic'] = 0x062D; 15362 t['hahfinalarabic'] = 0xFEA2; 15363 t['hahinitialarabic'] = 0xFEA3; 15364 t['hahiragana'] = 0x306F; 15365 t['hahmedialarabic'] = 0xFEA4; 15366 t['haitusquare'] = 0x332A; 15367 t['hakatakana'] = 0x30CF; 15368 t['hakatakanahalfwidth'] = 0xFF8A; 15369 t['halantgurmukhi'] = 0x0A4D; 15370 t['hamzaarabic'] = 0x0621; 15371 t['hamzalowarabic'] = 0x0621; 15372 t['hangulfiller'] = 0x3164; 15373 t['hardsigncyrillic'] = 0x044A; 15374 t['harpoonleftbarbup'] = 0x21BC; 15375 t['harpoonrightbarbup'] = 0x21C0; 15376 t['hasquare'] = 0x33CA; 15377 t['hatafpatah'] = 0x05B2; 15378 t['hatafpatah16'] = 0x05B2; 15379 t['hatafpatah23'] = 0x05B2; 15380 t['hatafpatah2f'] = 0x05B2; 15381 t['hatafpatahhebrew'] = 0x05B2; 15382 t['hatafpatahnarrowhebrew'] = 0x05B2; 15383 t['hatafpatahquarterhebrew'] = 0x05B2; 15384 t['hatafpatahwidehebrew'] = 0x05B2; 15385 t['hatafqamats'] = 0x05B3; 15386 t['hatafqamats1b'] = 0x05B3; 15387 t['hatafqamats28'] = 0x05B3; 15388 t['hatafqamats34'] = 0x05B3; 15389 t['hatafqamatshebrew'] = 0x05B3; 15390 t['hatafqamatsnarrowhebrew'] = 0x05B3; 15391 t['hatafqamatsquarterhebrew'] = 0x05B3; 15392 t['hatafqamatswidehebrew'] = 0x05B3; 15393 t['hatafsegol'] = 0x05B1; 15394 t['hatafsegol17'] = 0x05B1; 15395 t['hatafsegol24'] = 0x05B1; 15396 t['hatafsegol30'] = 0x05B1; 15397 t['hatafsegolhebrew'] = 0x05B1; 15398 t['hatafsegolnarrowhebrew'] = 0x05B1; 15399 t['hatafsegolquarterhebrew'] = 0x05B1; 15400 t['hatafsegolwidehebrew'] = 0x05B1; 15401 t['hbar'] = 0x0127; 15402 t['hbopomofo'] = 0x310F; 15403 t['hbrevebelow'] = 0x1E2B; 15404 t['hcedilla'] = 0x1E29; 15405 t['hcircle'] = 0x24D7; 15406 t['hcircumflex'] = 0x0125; 15407 t['hdieresis'] = 0x1E27; 15408 t['hdotaccent'] = 0x1E23; 15409 t['hdotbelow'] = 0x1E25; 15410 t['he'] = 0x05D4; 15411 t['heart'] = 0x2665; 15412 t['heartsuitblack'] = 0x2665; 15413 t['heartsuitwhite'] = 0x2661; 15414 t['hedagesh'] = 0xFB34; 15415 t['hedageshhebrew'] = 0xFB34; 15416 t['hehaltonearabic'] = 0x06C1; 15417 t['heharabic'] = 0x0647; 15418 t['hehebrew'] = 0x05D4; 15419 t['hehfinalaltonearabic'] = 0xFBA7; 15420 t['hehfinalalttwoarabic'] = 0xFEEA; 15421 t['hehfinalarabic'] = 0xFEEA; 15422 t['hehhamzaabovefinalarabic'] = 0xFBA5; 15423 t['hehhamzaaboveisolatedarabic'] = 0xFBA4;
15424 t['hehinitialaltonearabic'] = 0xFBA8; 15425 t['hehinitialarabic'] = 0xFEEB; 15426 t['hehiragana'] = 0x3078; 15427 t['hehmedialaltonearabic'] = 0xFBA9; 15428 t['hehmedialarabic'] = 0xFEEC; 15429 t['heiseierasquare'] = 0x337B; 15430 t['hekatakana'] = 0x30D8; 15431 t['hekatakanahalfwidth'] = 0xFF8D; 15432 t['hekutaarusquare'] = 0x3336; 15433 t['henghook'] = 0x0267; 15434 t['herutusquare'] = 0x3339; 15435 t['het'] = 0x05D7; 15436 t['hethebrew'] = 0x05D7; 15437 t['hhook'] = 0x0266; 15438 t['hhooksuperior'] = 0x02B1; 15439 t['hieuhacirclekorean'] = 0x327B; 15440 t['hieuhaparenkorean'] = 0x321B; 15441 t['hieuhcirclekorean'] = 0x326D; 15442 t['hieuhkorean'] = 0x314E; 15443 t['hieuhparenkorean'] = 0x320D; 15444 t['hihiragana'] = 0x3072; 15445 t['hikatakana'] = 0x30D2; 15446 t['hikatakanahalfwidth'] = 0xFF8B; 15447 t['hiriq'] = 0x05B4; 15448 t['hiriq14'] = 0x05B4; 15449 t['hiriq21'] = 0x05B4; 15450 t['hiriq2d'] = 0x05B4; 15451 t['hiriqhebrew'] = 0x05B4; 15452 t['hiriqnarrowhebrew'] = 0x05B4; 15453 t['hiriqquarterhebrew'] = 0x05B4; 15454 t['hiriqwidehebrew'] = 0x05B4; 15455 t['hlinebelow'] = 0x1E96; 15456 t['hmonospace'] = 0xFF48; 15457 t['hoarmenian'] = 0x0570; 15458 t['hohipthai'] = 0x0E2B; 15459 t['hohiragana'] = 0x307B; 15460 t['hokatakana'] = 0x30DB; 15461 t['hokatakanahalfwidth'] = 0xFF8E; 15462 t['holam'] = 0x05B9; 15463 t['holam19'] = 0x05B9; 15464 t['holam26'] = 0x05B9; 15465 t['holam32'] = 0x05B9; 15466 t['holamhebrew'] = 0x05B9; 15467 t['holamnarrowhebrew'] = 0x05B9; 15468 t['holamquarterhebrew'] = 0x05B9; 15469 t['holamwidehebrew'] = 0x05B9; 15470 t['honokhukthai'] = 0x0E2E; 15471 t['hookabovecomb'] = 0x0309; 15472 t['hookcmb'] = 0x0309; 15473 t['hookpalatalizedbelowcmb'] = 0x0321; 15474 t['hookretroflexbelowcmb'] = 0x0322; 15475 t['hoonsquare'] = 0x3342; 15476 t['horicoptic'] = 0x03E9; 15477 t['horizontalbar'] = 0x2015; 15478 t['horncmb'] = 0x031B; 15479 t['hotsprings'] = 0x2668; 15480 t['house'] = 0x2302; 15481 t['hparen'] = 0x24A3; 15482 t['hsuperior'] = 0x02B0; 15483 t['hturned'] = 0x0265; 15484 t['huhiragana'] = 0x3075; 15485 t['huiitosquare'] = 0x3333; 15486 t['hukatakana'] = 0x30D5; 15487 t['hukatakanahalfwidth'] = 0xFF8C; 15488 t['hungarumlaut'] = 0x02DD; 15489 t['hungarumlautcmb'] = 0x030B; 15490 t['hv'] = 0x0195; 15491 t['hyphen'] = 0x002D; 15492 t['hypheninferior'] = 0xF6E5; 15493 t['hyphenmonospace'] = 0xFF0D; 15494 t['hyphensmall'] = 0xFE63; 15495 t['hyphensuperior'] = 0xF6E6; 15496 t['hyphentwo'] = 0x2010; 15497 t['i'] = 0x0069; 15498 t['iacute'] = 0x00ED; 15499 t['iacyrillic'] = 0x044F; 15500 t['ibengali'] = 0x0987; 15501 t['ibopomofo'] = 0x3127; 15502 t['ibreve'] = 0x012D; 15503 t['icaron'] = 0x01D0; 15504 t['icircle'] = 0x24D8; 15505 t['icircumflex'] = 0x00EE; 15506 t['icyrillic'] = 0x0456; 15507 t['idblgrave'] = 0x0209; 15508 t['ideographearthcircle'] = 0x328F; 15509 t['ideographfirecircle'] = 0x328B; 15510 t['ideographicallianceparen'] = 0x323F; 15511 t['ideographiccallparen'] = 0x323A; 15512 t['ideographiccentrecircle'] = 0x32A5; 15513 t['ideographicclose'] = 0x3006; 15514 t['ideographiccomma'] = 0x3001; 15515 t['ideographiccommaleft'] = 0xFF64; 15516 t['ideographiccongratulationparen'] = 0x3237; 15517 t['ideographiccorrectcircle'] = 0x32A3; 15518 t['ideographicearthparen'] = 0x322F; 15519 t['ideographicenterpriseparen'] = 0x323D; 15520 t['ideographicexcellentcircle'] = 0x329D; 15521 t['ideographicfestivalparen'] = 0x3240; 15522 t['ideographicfinancialcircle'] = 0x3296; 15523 t['ideographicfinancialparen'] = 0x3236; 15524 t['ideographicfireparen'] = 0x322B; 15525 t['ideographichaveparen'] = 0x3232; 15526 t['ideographichighcircle'] = 0x32A4; 15527 t['ideographiciterationmark'] = 0x3005; 15528 t['ideographiclaborcircle'] = 0x3298; 15529 t['ideographiclaborparen'] = 0x3238; 15530 t['ideographicleftcircle'] = 0x32A7; 15531 t['ideographiclowcircle'] = 0x32A6; 15532 t['ideographicmedicinecircle'] = 0x32A9; 15533 t['ideographicmetalparen'] = 0x322E; 15534 t['ideographicmoonparen'] = 0x322A; 15535 t['ideographicnameparen'] = 0x3234; 15536 t['ideographicperiod'] = 0x3002; 15537 t['ideographicprintcircle'] = 0x329E; 15538 t['ideographicreachparen'] = 0x3243; 15539 t['ideographicrepresentparen'] = 0x3239; 15540 t['ideographicresourceparen'] = 0x323E; 15541 t['ideographicrightcircle'] = 0x32A8; 15542 t['ideographicsecretcircle'] = 0x3299; 15543 t['ideographicselfparen'] = 0x3242; 15544 t['ideographicsocietyparen'] = 0x3233; 15545 t['ideographicspace'] = 0x3000; 15546 t['ideographicspecialparen'] = 0x3235; 15547 t['ideographicstockparen'] = 0x3231; 15548 t['ideographicstudyparen'] = 0x323B; 15549 t['ideographicsunparen'] = 0x3230; 15550 t['ideographicsuperviseparen'] = 0x323C; 15551 t['ideographicwaterparen'] = 0x322C; 15552 t['ideographicwoodparen'] = 0x322D; 15553 t['ideographiczero'] = 0x3007; 15554 t['ideographmetalcircle'] = 0x328E; 15555 t['ideographmooncircle'] = 0x328A; 15556 t['ideographnamecircle'] = 0x3294; 15557 t['ideographsuncircle'] = 0x3290; 15558 t['ideographwatercircle'] = 0x328C; 15559 t['ideographwoodcircle'] = 0x328D; 15560 t['ideva'] = 0x0907; 15561 t['idieresis'] = 0x00EF; 15562 t['idieresisacute'] = 0x1E2F; 15563 t['idieresiscyrillic'] = 0x04E5; 15564 t['idotbelow'] = 0x1ECB; 15565 t['iebrevecyrillic'] = 0x04D7; 15566 t['iecyrillic'] = 0x0435; 15567 t['ieungacirclekorean'] = 0x3275; 15568 t['ieungaparenkorean'] = 0x3215; 15569 t['ieungcirclekorean'] = 0x3267; 15570 t['ieungkorean'] = 0x3147; 15571 t['ieungparenkorean'] = 0x3207; 15572 t['igrave'] = 0x00EC; 15573 t['igujarati'] = 0x0A87; 15574 t['igurmukhi'] = 0x0A07; 15575 t['ihiragana'] = 0x3044; 15576 t['ihookabove'] = 0x1EC9; 15577 t['iibengali'] = 0x0988; 15578 t['iicyrillic'] = 0x0438; 15579 t['iideva'] = 0x0908; 15580 t['iigujarati'] = 0x0A88; 15581 t['iigurmukhi'] = 0x0A08; 15582 t['iimatragurmukhi'] = 0x0A40; 15583 t['iinvertedbreve'] = 0x020B; 15584 t['iishortcyrillic'] = 0x0439; 15585 t['iivowelsignbengali'] = 0x09C0; 15586 t['iivowelsigndeva'] = 0x0940; 15587 t['iivowelsigngujarati'] = 0x0AC0; 15588 t['ij'] = 0x0133; 15589 t['ikatakana'] = 0x30A4; 15590 t['ikatakanahalfwidth'] = 0xFF72; 15591 t['ikorean'] = 0x3163; 15592 t['ilde'] = 0x02DC; 15593 t['iluyhebrew'] = 0x05AC; 15594 t['imacron'] = 0x012B; 15595 t['imacroncyrillic'] = 0x04E3; 15596 t['imageorapproximatelyequal'] = 0x2253; 15597 t['imatragurmukhi'] = 0x0A3F; 15598 t['imonospace'] = 0xFF49; 15599 t['increment'] = 0x2206; 15600 t['infinity'] = 0x221E; 15601 t['iniarmenian'] = 0x056B; 15602 t['integral'] = 0x222B; 15603 t['integralbottom'] = 0x2321; 15604 t['integralbt'] = 0x2321; 15605 t['integralex'] = 0xF8F5; 15606 t['integraltop'] = 0x2320; 15607 t['integraltp'] = 0x2320; 15608 t['intersection'] = 0x2229; 15609 t['intisquare'] = 0x3305; 15610 t['invbullet'] = 0x25D8; 15611 t['invcircle'] = 0x25D9; 15612 t['invsmileface'] = 0x263B; 15613 t['iocyrillic'] = 0x0451; 15614 t['iogonek'] = 0x012F; 15615 t['iota'] = 0x03B9; 15616 t['iotadieresis'] = 0x03CA;
15617 t['iotadieresistonos'] = 0x0390; 15618 t['iotalatin'] = 0x0269; 15619 t['iotatonos'] = 0x03AF; 15620 t['iparen'] = 0x24A4; 15621 t['irigurmukhi'] = 0x0A72; 15622 t['ismallhiragana'] = 0x3043; 15623 t['ismallkatakana'] = 0x30A3; 15624 t['ismallkatakanahalfwidth'] = 0xFF68; 15625 t['issharbengali'] = 0x09FA; 15626 t['istroke'] = 0x0268; 15627 t['isuperior'] = 0xF6ED; 15628 t['iterationhiragana'] = 0x309D; 15629 t['iterationkatakana'] = 0x30FD; 15630 t['itilde'] = 0x0129; 15631 t['itildebelow'] = 0x1E2D; 15632 t['iubopomofo'] = 0x3129; 15633 t['iucyrillic'] = 0x044E; 15634 t['ivowelsignbengali'] = 0x09BF; 15635 t['ivowelsigndeva'] = 0x093F; 15636 t['ivowelsigngujarati'] = 0x0ABF; 15637 t['izhitsacyrillic'] = 0x0475; 15638 t['izhitsadblgravecyrillic'] = 0x0477; 15639 t['j'] = 0x006A; 15640 t['jaarmenian'] = 0x0571; 15641 t['jabengali'] = 0x099C; 15642 t['jadeva'] = 0x091C; 15643 t['jagujarati'] = 0x0A9C; 15644 t['jagurmukhi'] = 0x0A1C; 15645 t['jbopomofo'] = 0x3110; 15646 t['jcaron'] = 0x01F0; 15647 t['jcircle'] = 0x24D9; 15648 t['jcircumflex'] = 0x0135; 15649 t['jcrossedtail'] = 0x029D; 15650 t['jdotlessstroke'] = 0x025F; 15651 t['jecyrillic'] = 0x0458; 15652 t['jeemarabic'] = 0x062C; 15653 t['jeemfinalarabic'] = 0xFE9E; 15654 t['jeeminitialarabic'] = 0xFE9F; 15655 t['jeemmedialarabic'] = 0xFEA0; 15656 t['jeharabic'] = 0x0698; 15657 t['jehfinalarabic'] = 0xFB8B; 15658 t['jhabengali'] = 0x099D; 15659 t['jhadeva'] = 0x091D; 15660 t['jhagujarati'] = 0x0A9D; 15661 t['jhagurmukhi'] = 0x0A1D; 15662 t['jheharmenian'] = 0x057B; 15663 t['jis'] = 0x3004; 15664 t['jmonospace'] = 0xFF4A; 15665 t['jparen'] = 0x24A5; 15666 t['jsuperior'] = 0x02B2; 15667 t['k'] = 0x006B; 15668 t['kabashkircyrillic'] = 0x04A1; 15669 t['kabengali'] = 0x0995; 15670 t['kacute'] = 0x1E31; 15671 t['kacyrillic'] = 0x043A; 15672 t['kadescendercyrillic'] = 0x049B; 15673 t['kadeva'] = 0x0915; 15674 t['kaf'] = 0x05DB; 15675 t['kafarabic'] = 0x0643; 15676 t['kafdagesh'] = 0xFB3B; 15677 t['kafdageshhebrew'] = 0xFB3B; 15678 t['kaffinalarabic'] = 0xFEDA; 15679 t['kafhebrew'] = 0x05DB; 15680 t['kafinitialarabic'] = 0xFEDB; 15681 t['kafmedialarabic'] = 0xFEDC; 15682 t['kafrafehebrew'] = 0xFB4D; 15683 t['kagujarati'] = 0x0A95; 15684 t['kagurmukhi'] = 0x0A15; 15685 t['kahiragana'] = 0x304B; 15686 t['kahookcyrillic'] = 0x04C4; 15687 t['kakatakana'] = 0x30AB; 15688 t['kakatakanahalfwidth'] = 0xFF76; 15689 t['kappa'] = 0x03BA; 15690 t['kappasymbolgreek'] = 0x03F0; 15691 t['kapyeounmieumkorean'] = 0x3171; 15692 t['kapyeounphieuphkorean'] = 0x3184; 15693 t['kapyeounpieupkorean'] = 0x3178; 15694 t['kapyeounssangpieupkorean'] = 0x3179; 15695 t['karoriisquare'] = 0x330D; 15696 t['kashidaautoarabic'] = 0x0640; 15697 t['kashidaautonosidebearingarabic'] = 0x0640; 15698 t['kasmallkatakana'] = 0x30F5; 15699 t['kasquare'] = 0x3384; 15700 t['kasraarabic'] = 0x0650; 15701 t['kasratanarabic'] = 0x064D; 15702 t['kastrokecyrillic'] = 0x049F; 15703 t['katahiraprolongmarkhalfwidth'] = 0xFF70; 15704 t['kaverticalstrokecyrillic'] = 0x049D; 15705 t['kbopomofo'] = 0x310E; 15706 t['kcalsquare'] = 0x3389; 15707 t['kcaron'] = 0x01E9; 15708 t['kcedilla'] = 0x0137; 15709 t['kcircle'] = 0x24DA; 15710 t['kcommaaccent'] = 0x0137; 15711 t['kdotbelow'] = 0x1E33; 15712 t['keharmenian'] = 0x0584; 15713 t['kehiragana'] = 0x3051; 15714 t['kekatakana'] = 0x30B1; 15715 t['kekatakanahalfwidth'] = 0xFF79; 15716 t['kenarmenian'] = 0x056F; 15717 t['kesmallkatakana'] = 0x30F6; 15718 t['kgreenlandic'] = 0x0138; 15719 t['khabengali'] = 0x0996; 15720 t['khacyrillic'] = 0x0445; 15721 t['khadeva'] = 0x0916; 15722 t['khagujarati'] = 0x0A96; 15723 t['khagurmukhi'] = 0x0A16; 15724 t['khaharabic'] = 0x062E; 15725 t['khahfinalarabic'] = 0xFEA6; 15726 t['khahinitialarabic'] = 0xFEA7; 15727 t['khahmedialarabic'] = 0xFEA8; 15728 t['kheicoptic'] = 0x03E7; 15729 t['khhadeva'] = 0x0959; 15730 t['khhagurmukhi'] = 0x0A59; 15731 t['khieukhacirclekorean'] = 0x3278; 15732 t['khieukhaparenkorean'] = 0x3218; 15733 t['khieukhcirclekorean'] = 0x326A; 15734 t['khieukhkorean'] = 0x314B; 15735 t['khieukhparenkorean'] = 0x320A; 15736 t['khokhaithai'] = 0x0E02; 15737 t['khokhonthai'] = 0x0E05; 15738 t['khokhuatthai'] = 0x0E03; 15739 t['khokhwaithai'] = 0x0E04; 15740 t['khomutthai'] = 0x0E5B; 15741 t['khook'] = 0x0199; 15742 t['khorakhangthai'] = 0x0E06; 15743 t['khzsquare'] = 0x3391; 15744 t['kihiragana'] = 0x304D; 15745 t['kikatakana'] = 0x30AD; 15746 t['kikatakanahalfwidth'] = 0xFF77; 15747 t['kiroguramusquare'] = 0x3315; 15748 t['kiromeetorusquare'] = 0x3316; 15749 t['kirosquare'] = 0x3314; 15750 t['kiyeokacirclekorean'] = 0x326E; 15751 t['kiyeokaparenkorean'] = 0x320E; 15752 t['kiyeokcirclekorean'] = 0x3260; 15753 t['kiyeokkorean'] = 0x3131; 15754 t['kiyeokparenkorean'] = 0x3200; 15755 t['kiyeoksioskorean'] = 0x3133; 15756 t['kjecyrillic'] = 0x045C; 15757 t['klinebelow'] = 0x1E35; 15758 t['klsquare'] = 0x3398; 15759 t['kmcubedsquare'] = 0x33A6; 15760 t['kmonospace'] = 0xFF4B; 15761 t['kmsquaredsquare'] = 0x33A2; 15762 t['kohiragana'] = 0x3053; 15763 t['kohmsquare'] = 0x33C0; 15764 t['kokaithai'] = 0x0E01; 15765 t['kokatakana'] = 0x30B3; 15766 t['kokatakanahalfwidth'] = 0xFF7A;
15767 t['kooposquare'] = 0x331E; 15768 t['koppacyrillic'] = 0x0481; 15769 t['koreanstandardsymbol'] = 0x327F; 15770 t['koroniscmb'] = 0x0343; 15771 t['kparen'] = 0x24A6; 15772 t['kpasquare'] = 0x33AA; 15773 t['ksicyrillic'] = 0x046F; 15774 t['ktsquare'] = 0x33CF; 15775 t['kturned'] = 0x029E; 15776 t['kuhiragana'] = 0x304F; 15777 t['kukatakana'] = 0x30AF; 15778 t['kukatakanahalfwidth'] = 0xFF78; 15779 t['kvsquare'] = 0x33B8; 15780 t['kwsquare'] = 0x33BE; 15781 t['l'] = 0x006C; 15782 t['labengali'] = 0x09B2; 15783 t['lacute'] = 0x013A; 15784 t['ladeva'] = 0x0932; 15785 t['lagujarati'] = 0x0AB2; 15786 t['lagurmukhi'] = 0x0A32; 15787 t['lakkhangyaothai'] = 0x0E45; 15788 t['lamaleffinalarabic'] = 0xFEFC; 15789 t['lamalefhamzaabovefinalarabic'] = 0xFEF8; 15790 t['lamalefhamzaaboveisolatedarabic'] = 0xFEF7; 15791 t['lamalefhamzabelowfinalarabic'] = 0xFEFA; 15792 t['lamalefhamzabelowisolatedarabic'] = 0xFEF9; 15793 t['lamalefisolatedarabic'] = 0xFEFB; 15794 t['lamalefmaddaabovefinalarabic'] = 0xFEF6; 15795 t['lamalefmaddaaboveisolatedarabic'] = 0xFEF5; 15796 t['lamarabic'] = 0x0644; 15797 t['lambda'] = 0x03BB; 15798 t['lambdastroke'] = 0x019B; 15799 t['lamed'] = 0x05DC; 15800 t['lameddagesh'] = 0xFB3C; 15801 t['lameddageshhebrew'] = 0xFB3C; 15802 t['lamedhebrew'] = 0x05DC; 15803 t['lamfinalarabic'] = 0xFEDE; 15804 t['lamhahinitialarabic'] = 0xFCCA; 15805 t['laminitialarabic'] = 0xFEDF; 15806 t['lamjeeminitialarabic'] = 0xFCC9; 15807 t['lamkhahinitialarabic'] = 0xFCCB; 15808 t['lamlamhehisolatedarabic'] = 0xFDF2; 15809 t['lammedialarabic'] = 0xFEE0; 15810 t['lammeemhahinitialarabic'] = 0xFD88; 15811 t['lammeeminitialarabic'] = 0xFCCC; 15812 t['largecircle'] = 0x25EF; 15813 t['lbar'] = 0x019A; 15814 t['lbelt'] = 0x026C; 15815 t['lbopomofo'] = 0x310C; 15816 t['lcaron'] = 0x013E; 15817 t['lcedilla'] = 0x013C; 15818 t['lcircle'] = 0x24DB; 15819 t['lcircumflexbelow'] = 0x1E3D; 15820 t['lcommaaccent'] = 0x013C; 15821 t['ldot'] = 0x0140; 15822 t['ldotaccent'] = 0x0140; 15823 t['ldotbelow'] = 0x1E37; 15824 t['ldotbelowmacron'] = 0x1E39; 15825 t['leftangleabovecmb'] = 0x031A; 15826 t['lefttackbelowcmb'] = 0x0318; 15827 t['less'] = 0x003C; 15828 t['lessequal'] = 0x2264; 15829 t['lessequalorgreater'] = 0x22DA; 15830 t['lessmonospace'] = 0xFF1C; 15831 t['lessorequivalent'] = 0x2272; 15832 t['lessorgreater'] = 0x2276; 15833 t['lessoverequal'] = 0x2266; 15834 t['lesssmall'] = 0xFE64; 15835 t['lezh'] = 0x026E; 15836 t['lfblock'] = 0x258C; 15837 t['lhookretroflex'] = 0x026D; 15838 t['lira'] = 0x20A4; 15839 t['liwnarmenian'] = 0x056C; 15840 t['lj'] = 0x01C9; 15841 t['ljecyrillic'] = 0x0459; 15842 t['ll'] = 0xF6C0; 15843 t['lladeva'] = 0x0933; 15844 t['llagujarati'] = 0x0AB3; 15845 t['llinebelow'] = 0x1E3B; 15846 t['llladeva'] = 0x0934; 15847 t['llvocalicbengali'] = 0x09E1; 15848 t['llvocalicdeva'] = 0x0961; 15849 t['llvocalicvowelsignbengali'] = 0x09E3; 15850 t['llvocalicvowelsigndeva'] = 0x0963; 15851 t['lmiddletilde'] = 0x026B; 15852 t['lmonospace'] = 0xFF4C; 15853 t['lmsquare'] = 0x33D0; 15854 t['lochulathai'] = 0x0E2C; 15855 t['logicaland'] = 0x2227; 15856 t['logicalnot'] = 0x00AC; 15857 t['logicalnotreversed'] = 0x2310; 15858 t['logicalor'] = 0x2228; 15859 t['lolingthai'] = 0x0E25; 15860 t['longs'] = 0x017F; 15861 t['lowlinecenterline'] = 0xFE4E; 15862 t['lowlinecmb'] = 0x0332; 15863 t['lowlinedashed'] = 0xFE4D; 15864 t['lozenge'] = 0x25CA; 15865 t['lparen'] = 0x24A7; 15866 t['lslash'] = 0x0142; 15867 t['lsquare'] = 0x2113; 15868 t['lsuperior'] = 0xF6EE; 15869 t['ltshade'] = 0x2591; 15870 t['luthai'] = 0x0E26; 15871 t['lvocalicbengali'] = 0x098C; 15872 t['lvocalicdeva'] = 0x090C; 15873 t['lvocalicvowelsignbengali'] = 0x09E2; 15874 t['lvocalicvowelsigndeva'] = 0x0962; 15875 t['lxsquare'] = 0x33D3; 15876 t['m'] = 0x006D; 15877 t['mabengali'] = 0x09AE; 15878 t['macron'] = 0x00AF; 15879 t['macronbelowcmb'] = 0x0331; 15880 t['macroncmb'] = 0x0304; 15881 t['macronlowmod'] = 0x02CD; 15882 t['macronmonospace'] = 0xFFE3; 15883 t['macute'] = 0x1E3F; 15884 t['madeva'] = 0x092E; 15885 t['magujarati'] = 0x0AAE; 15886 t['magurmukhi'] = 0x0A2E; 15887 t['mahapakhhebrew'] = 0x05A4; 15888 t['mahapakhlefthebrew'] = 0x05A4; 15889 t['mahiragana'] = 0x307E; 15890 t['maichattawalowleftthai'] = 0xF895; 15891 t['maichattawalowrightthai'] = 0xF894; 15892 t['maichattawathai'] = 0x0E4B; 15893 t['maichattawaupperleftthai'] = 0xF893; 15894 t['maieklowleftthai'] = 0xF88C; 15895 t['maieklowrightthai'] = 0xF88B; 15896 t['maiekthai'] = 0x0E48; 15897 t['maiekupperleftthai'] = 0xF88A; 15898 t['maihanakatleftthai'] = 0xF884; 15899 t['maihanakatthai'] = 0x0E31; 15900 t['maitaikhuleftthai'] = 0xF889; 15901 t['maitaikhuthai'] = 0x0E47; 15902 t['maitholowleftthai'] = 0xF88F; 15903 t['maitholowrightthai'] = 0xF88E; 15904 t['maithothai'] = 0x0E49;
15905 t['maithoupperleftthai'] = 0xF88D; 15906 t['maitrilowleftthai'] = 0xF892; 15907 t['maitrilowrightthai'] = 0xF891; 15908 t['maitrithai'] = 0x0E4A; 15909 t['maitriupperleftthai'] = 0xF890; 15910 t['maiyamokthai'] = 0x0E46; 15911 t['makatakana'] = 0x30DE; 15912 t['makatakanahalfwidth'] = 0xFF8F; 15913 t['male'] = 0x2642; 15914 t['mansyonsquare'] = 0x3347; 15915 t['maqafhebrew'] = 0x05BE; 15916 t['mars'] = 0x2642; 15917 t['masoracirclehebrew'] = 0x05AF; 15918 t['masquare'] = 0x3383; 15919 t['mbopomofo'] = 0x3107; 15920 t['mbsquare'] = 0x33D4; 15921 t['mcircle'] = 0x24DC; 15922 t['mcubedsquare'] = 0x33A5; 15923 t['mdotaccent'] = 0x1E41; 15924 t['mdotbelow'] = 0x1E43; 15925 t['meemarabic'] = 0x0645; 15926 t['meemfinalarabic'] = 0xFEE2; 15927 t['meeminitialarabic'] = 0xFEE3; 15928 t['meemmedialarabic'] = 0xFEE4; 15929 t['meemmeeminitialarabic'] = 0xFCD1; 15930 t['meemmeemisolatedarabic'] = 0xFC48; 15931 t['meetorusquare'] = 0x334D; 15932 t['mehiragana'] = 0x3081; 15933 t['meizierasquare'] = 0x337E; 15934 t['mekatakana'] = 0x30E1; 15935 t['mekatakanahalfwidth'] = 0xFF92; 15936 t['mem'] = 0x05DE; 15937 t['memdagesh'] = 0xFB3E; 15938 t['memdageshhebrew'] = 0xFB3E; 15939 t['memhebrew'] = 0x05DE; 15940 t['menarmenian'] = 0x0574; 15941 t['merkhahebrew'] = 0x05A5; 15942 t['merkhakefulahebrew'] = 0x05A6; 15943 t['merkhakefulalefthebrew'] = 0x05A6; 15944 t['merkhalefthebrew'] = 0x05A5; 15945 t['mhook'] = 0x0271; 15946 t['mhzsquare'] = 0x3392; 15947 t['middledotkatakanahalfwidth'] = 0xFF65; 15948 t['middot'] = 0x00B7; 15949 t['mieumacirclekorean'] = 0x3272; 15950 t['mieumaparenkorean'] = 0x3212; 15951 t['mieumcirclekorean'] = 0x3264; 15952 t['mieumkorean'] = 0x3141; 15953 t['mieumpansioskorean'] = 0x3170; 15954 t['mieumparenkorean'] = 0x3204; 15955 t['mieumpieupkorean'] = 0x316E; 15956 t['mieumsioskorean'] = 0x316F; 15957 t['mihiragana'] = 0x307F; 15958 t['mikatakana'] = 0x30DF; 15959 t['mikatakanahalfwidth'] = 0xFF90; 15960 t['minus'] = 0x2212; 15961 t['minusbelowcmb'] = 0x0320; 15962 t['minuscircle'] = 0x2296; 15963 t['minusmod'] = 0x02D7; 15964 t['minusplus'] = 0x2213; 15965 t['minute'] = 0x2032; 15966 t['miribaarusquare'] = 0x334A; 15967 t['mirisquare'] = 0x3349; 15968 t['mlonglegturned'] = 0x0270; 15969 t['mlsquare'] = 0x3396; 15970 t['mmcubedsquare'] = 0x33A3; 15971 t['mmonospace'] = 0xFF4D; 15972 t['mmsquaredsquare'] = 0x339F; 15973 t['mohiragana'] = 0x3082; 15974 t['mohmsquare'] = 0x33C1; 15975 t['mokatakana'] = 0x30E2; 15976 t['mokatakanahalfwidth'] = 0xFF93; 15977 t['molsquare'] = 0x33D6; 15978 t['momathai'] = 0x0E21; 15979 t['moverssquare'] = 0x33A7; 15980 t['moverssquaredsquare'] = 0x33A8; 15981 t['mparen'] = 0x24A8; 15982 t['mpasquare'] = 0x33AB; 15983 t['mssquare'] = 0x33B3; 15984 t['msuperior'] = 0xF6EF; 15985 t['mturned'] = 0x026F; 15986 t['mu'] = 0x00B5; 15987 t['mu1'] = 0x00B5; 15988 t['muasquare'] = 0x3382; 15989 t['muchgreater'] = 0x226B; 15990 t['muchless'] = 0x226A; 15991 t['mufsquare'] = 0x338C; 15992 t['mugreek'] = 0x03BC; 15993 t['mugsquare'] = 0x338D; 15994 t['muhiragana'] = 0x3080; 15995 t['mukatakana'] = 0x30E0; 15996 t['mukatakanahalfwidth'] = 0xFF91; 15997 t['mulsquare'] = 0x3395; 15998 t['multiply'] = 0x00D7; 15999 t['mumsquare'] = 0x339B; 16000 t['munahhebrew'] = 0x05A3; 16001 t['munahlefthebrew'] = 0x05A3; 16002 t['musicalnote'] = 0x266A; 16003 t['musicalnotedbl'] = 0x266B; 16004 t['musicflatsign'] = 0x266D; 16005 t['musicsharpsign'] = 0x266F; 16006 t['mussquare'] = 0x33B2; 16007 t['muvsquare'] = 0x33B6; 16008 t['muwsquare'] = 0x33BC; 16009 t['mvmegasquare'] = 0x33B9; 16010 t['mvsquare'] = 0x33B7; 16011 t['mwmegasquare'] = 0x33BF; 16012 t['mwsquare'] = 0x33BD; 16013 t['n'] = 0x006E; 16014 t['nabengali'] = 0x09A8; 16015 t['nabla'] = 0x2207; 16016 t['nacute'] = 0x0144; 16017 t['nadeva'] = 0x0928; 16018 t['nagujarati'] = 0x0AA8; 16019 t['nagurmukhi'] = 0x0A28; 16020 t['nahiragana'] = 0x306A; 16021 t['nakatakana'] = 0x30CA; 16022 t['nakatakanahalfwidth'] = 0xFF85; 16023 t['napostrophe'] = 0x0149; 16024 t['nasquare'] = 0x3381; 16025 t['nbopomofo'] = 0x310B; 16026 t['nbspace'] = 0x00A0; 16027 t['ncaron'] = 0x0148; 16028 t['ncedilla'] = 0x0146; 16029 t['ncircle'] = 0x24DD; 16030 t['ncircumflexbelow'] = 0x1E4B; 16031 t['ncommaaccent'] = 0x0146; 16032 t['ndotaccent'] = 0x1E45; 16033 t['ndotbelow'] = 0x1E47; 16034 t['nehiragana'] = 0x306D; 16035 t['nekatakana'] = 0x30CD; 16036 t['nekatakanahalfwidth'] = 0xFF88; 16037 t['newsheqelsign'] = 0x20AA; 16038 t['nfsquare'] = 0x338B; 16039 t['ngabengali'] = 0x0999; 16040 t['ngadeva'] = 0x0919; 16041 t['ngagujarati'] = 0x0A99; 16042 t['ngagurmukhi'] = 0x0A19; 16043 t['ngonguthai'] = 0x0E07; 16044 t['nhiragana'] = 0x3093; 16045 t['nhookleft'] = 0x0272; 16046 t['nhookretroflex'] = 0x0273; 16047 t['nieunacirclekorean'] = 0x326F; 16048 t['nieunaparenkorean'] = 0x320F; 16049 t['nieuncieuckorean'] = 0x3135; 16050 t['nieuncirclekorean'] = 0x3261; 16051 t['nieunhieuhkorean'] = 0x3136; 16052 t['nieunkorean'] = 0x3134;
16053 t['nieunpansioskorean'] = 0x3168; 16054 t['nieunparenkorean'] = 0x3201; 16055 t['nieunsioskorean'] = 0x3167; 16056 t['nieuntikeutkorean'] = 0x3166; 16057 t['nihiragana'] = 0x306B; 16058 t['nikatakana'] = 0x30CB; 16059 t['nikatakanahalfwidth'] = 0xFF86; 16060 t['nikhahitleftthai'] = 0xF899; 16061 t['nikhahitthai'] = 0x0E4D; 16062 t['nine'] = 0x0039; 16063 t['ninearabic'] = 0x0669; 16064 t['ninebengali'] = 0x09EF; 16065 t['ninecircle'] = 0x2468; 16066 t['ninecircleinversesansserif'] = 0x2792; 16067 t['ninedeva'] = 0x096F; 16068 t['ninegujarati'] = 0x0AEF; 16069 t['ninegurmukhi'] = 0x0A6F; 16070 t['ninehackarabic'] = 0x0669; 16071 t['ninehangzhou'] = 0x3029; 16072 t['nineideographicparen'] = 0x3228; 16073 t['nineinferior'] = 0x2089; 16074 t['ninemonospace'] = 0xFF19; 16075 t['nineoldstyle'] = 0xF739; 16076 t['nineparen'] = 0x247C; 16077 t['nineperiod'] = 0x2490; 16078 t['ninepersian'] = 0x06F9; 16079 t['nineroman'] = 0x2178; 16080 t['ninesuperior'] = 0x2079; 16081 t['nineteencircle'] = 0x2472; 16082 t['nineteenparen'] = 0x2486; 16083 t['nineteenperiod'] = 0x249A; 16084 t['ninethai'] = 0x0E59; 16085 t['nj'] = 0x01CC; 16086 t['njecyrillic'] = 0x045A; 16087 t['nkatakana'] = 0x30F3; 16088 t['nkatakanahalfwidth'] = 0xFF9D; 16089 t['nlegrightlong'] = 0x019E; 16090 t['nlinebelow'] = 0x1E49; 16091 t['nmonospace'] = 0xFF4E; 16092 t['nmsquare'] = 0x339A; 16093 t['nnabengali'] = 0x09A3; 16094 t['nnadeva'] = 0x0923; 16095 t['nnagujarati'] = 0x0AA3; 16096 t['nnagurmukhi'] = 0x0A23; 16097 t['nnnadeva'] = 0x0929; 16098 t['nohiragana'] = 0x306E; 16099 t['nokatakana'] = 0x30CE; 16100 t['nokatakanahalfwidth'] = 0xFF89; 16101 t['nonbreakingspace'] = 0x00A0; 16102 t['nonenthai'] = 0x0E13; 16103 t['nonuthai'] = 0x0E19; 16104 t['noonarabic'] = 0x0646; 16105 t['noonfinalarabic'] = 0xFEE6; 16106 t['noonghunnaarabic'] = 0x06BA; 16107 t['noonghunnafinalarabic'] = 0xFB9F; 16108 t['nooninitialarabic'] = 0xFEE7; 16109 t['noonjeeminitialarabic'] = 0xFCD2; 16110 t['noonjeemisolatedarabic'] = 0xFC4B; 16111 t['noonmedialarabic'] = 0xFEE8; 16112 t['noonmeeminitialarabic'] = 0xFCD5; 16113 t['noonmeemisolatedarabic'] = 0xFC4E; 16114 t['noonnoonfinalarabic'] = 0xFC8D; 16115 t['notcontains'] = 0x220C; 16116 t['notelement'] = 0x2209; 16117 t['notelementof'] = 0x2209; 16118 t['notequal'] = 0x2260; 16119 t['notgreater'] = 0x226F; 16120 t['notgreaternorequal'] = 0x2271; 16121 t['notgreaternorless'] = 0x2279; 16122 t['notidentical'] = 0x2262; 16123 t['notless'] = 0x226E; 16124 t['notlessnorequal'] = 0x2270; 16125 t['notparallel'] = 0x2226; 16126 t['notprecedes'] = 0x2280; 16127 t['notsubset'] = 0x2284; 16128 t['notsucceeds'] = 0x2281; 16129 t['notsuperset'] = 0x2285; 16130 t['nowarmenian'] = 0x0576; 16131 t['nparen'] = 0x24A9; 16132 t['nssquare'] = 0x33B1; 16133 t['nsuperior'] = 0x207F; 16134 t['ntilde'] = 0x00F1; 16135 t['nu'] = 0x03BD; 16136 t['nuhiragana'] = 0x306C; 16137 t['nukatakana'] = 0x30CC; 16138 t['nukatakanahalfwidth'] = 0xFF87; 16139 t['nuktabengali'] = 0x09BC; 16140 t['nuktadeva'] = 0x093C; 16141 t['nuktagujarati'] = 0x0ABC; 16142 t['nuktagurmukhi'] = 0x0A3C; 16143 t['numbersign'] = 0x0023; 16144 t['numbersignmonospace'] = 0xFF03; 16145 t['numbersignsmall'] = 0xFE5F; 16146 t['numeralsigngreek'] = 0x0374; 16147 t['numeralsignlowergreek'] = 0x0375; 16148 t['numero'] = 0x2116; 16149 t['nun'] = 0x05E0; 16150 t['nundagesh'] = 0xFB40; 16151 t['nundageshhebrew'] = 0xFB40; 16152 t['nunhebrew'] = 0x05E0; 16153 t['nvsquare'] = 0x33B5; 16154 t['nwsquare'] = 0x33BB; 16155 t['nyabengali'] = 0x099E; 16156 t['nyadeva'] = 0x091E; 16157 t['nyagujarati'] = 0x0A9E; 16158 t['nyagurmukhi'] = 0x0A1E; 16159 t['o'] = 0x006F; 16160 t['oacute'] = 0x00F3; 16161 t['oangthai'] = 0x0E2D; 16162 t['obarred'] = 0x0275; 16163 t['obarredcyrillic'] = 0x04E9; 16164 t['obarreddieresiscyrillic'] = 0x04EB; 16165 t['obengali'] = 0x0993; 16166 t['obopomofo'] = 0x311B; 16167 t['obreve'] = 0x014F; 16168 t['ocandradeva'] = 0x0911; 16169 t['ocandragujarati'] = 0x0A91; 16170 t['ocandravowelsigndeva'] = 0x0949; 16171 t['ocandravowelsigngujarati'] = 0x0AC9; 16172 t['ocaron'] = 0x01D2; 16173 t['ocircle'] = 0x24DE; 16174 t['ocircumflex'] = 0x00F4; 16175 t['ocircumflexacute'] = 0x1ED1; 16176 t['ocircumflexdotbelow'] = 0x1ED9; 16177 t['ocircumflexgrave'] = 0x1ED3; 16178 t['ocircumflexhookabove'] = 0x1ED5; 16179 t['ocircumflextilde'] = 0x1ED7; 16180 t['ocyrillic'] = 0x043E; 16181 t['odblacute'] = 0x0151; 16182 t['odblgrave'] = 0x020D; 16183 t['odeva'] = 0x0913; 16184 t['odieresis'] = 0x00F6; 16185 t['odieresiscyrillic'] = 0x04E7; 16186 t['odotbelow'] = 0x1ECD; 16187 t['oe'] = 0x0153; 16188 t['oekorean'] = 0x315A; 16189 t['ogonek'] = 0x02DB; 16190 t['ogonekcmb'] = 0x0328; 16191 t['ograve'] = 0x00F2; 16192 t['ogujarati'] = 0x0A93; 16193 t['oharmenian'] = 0x0585; 16194 t['ohiragana'] = 0x304A; 16195 t['ohookabove'] = 0x1ECF; 16196 t['ohorn'] = 0x01A1; 16197 t['ohornacute'] = 0x1EDB; 16198 t['ohorndotbelow'] = 0x1EE3; 16199 t['ohorngrave'] = 0x1EDD; 16200 t['ohornhookabove'] = 0x1EDF; 16201 t['ohorntilde'] = 0x1EE1; 16202 t['ohungarumlaut'] = 0x0151; 16203 t['oi'] = 0x01A3; 16204 t['oinvertedbreve'] = 0x020F; 16205 t['okatakana'] = 0x30AA; 16206 t['okatakanahalfwidth'] = 0xFF75; 16207 t['okorean'] = 0x3157; 16208 t['olehebrew'] = 0x05AB; 16209 t['omacron'] = 0x014D; 16210 t['omacronacute'] = 0x1E53; 16211 t['omacrongrave'] = 0x1E51; 16212 t['omdeva'] = 0x0950; 16213 t['omega'] = 0x03C9; 16214 t['omega1'] = 0x03D6; 16215 t['omegacyrillic'] = 0x0461; 16216 t['omegalatinclosed'] = 0x0277; 16217 t['omegaroundcyrillic'] = 0x047B; 16218 t['omegatitlocyrillic'] = 0x047D;
16219 t['omegatonos'] = 0x03CE; 16220 t['omgujarati'] = 0x0AD0; 16221 t['omicron'] = 0x03BF; 16222 t['omicrontonos'] = 0x03CC; 16223 t['omonospace'] = 0xFF4F; 16224 t['one'] = 0x0031; 16225 t['onearabic'] = 0x0661; 16226 t['onebengali'] = 0x09E7; 16227 t['onecircle'] = 0x2460; 16228 t['onecircleinversesansserif'] = 0x278A; 16229 t['onedeva'] = 0x0967; 16230 t['onedotenleader'] = 0x2024; 16231 t['oneeighth'] = 0x215B; 16232 t['onefitted'] = 0xF6DC; 16233 t['onegujarati'] = 0x0AE7; 16234 t['onegurmukhi'] = 0x0A67; 16235 t['onehackarabic'] = 0x0661; 16236 t['onehalf'] = 0x00BD; 16237 t['onehangzhou'] = 0x3021; 16238 t['oneideographicparen'] = 0x3220; 16239 t['oneinferior'] = 0x2081; 16240 t['onemonospace'] = 0xFF11; 16241 t['onenumeratorbengali'] = 0x09F4; 16242 t['oneoldstyle'] = 0xF731; 16243 t['oneparen'] = 0x2474; 16244 t['oneperiod'] = 0x2488; 16245 t['onepersian'] = 0x06F1; 16246 t['onequarter'] = 0x00BC; 16247 t['oneroman'] = 0x2170; 16248 t['onesuperior'] = 0x00B9; 16249 t['onethai'] = 0x0E51; 16250 t['onethird'] = 0x2153; 16251 t['oogonek'] = 0x01EB; 16252 t['oogonekmacron'] = 0x01ED; 16253 t['oogurmukhi'] = 0x0A13; 16254 t['oomatragurmukhi'] = 0x0A4B; 16255 t['oopen'] = 0x0254; 16256 t['oparen'] = 0x24AA; 16257 t['openbullet'] = 0x25E6; 16258 t['option'] = 0x2325; 16259 t['ordfeminine'] = 0x00AA; 16260 t['ordmasculine'] = 0x00BA; 16261 t['orthogonal'] = 0x221F; 16262 t['oshortdeva'] = 0x0912; 16263 t['oshortvowelsigndeva'] = 0x094A; 16264 t['oslash'] = 0x00F8; 16265 t['oslashacute'] = 0x01FF; 16266 t['osmallhiragana'] = 0x3049; 16267 t['osmallkatakana'] = 0x30A9; 16268 t['osmallkatakanahalfwidth'] = 0xFF6B; 16269 t['ostrokeacute'] = 0x01FF; 16270 t['osuperior'] = 0xF6F0; 16271 t['otcyrillic'] = 0x047F; 16272 t['otilde'] = 0x00F5; 16273 t['otildeacute'] = 0x1E4D; 16274 t['otildedieresis'] = 0x1E4F; 16275 t['oubopomofo'] = 0x3121; 16276 t['overline'] = 0x203E; 16277 t['overlinecenterline'] = 0xFE4A; 16278 t['overlinecmb'] = 0x0305; 16279 t['overlinedashed'] = 0xFE49; 16280 t['overlinedblwavy'] = 0xFE4C; 16281 t['overlinewavy'] = 0xFE4B; 16282 t['overscore'] = 0x00AF; 16283 t['ovowelsignbengali'] = 0x09CB; 16284 t['ovowelsigndeva'] = 0x094B; 16285 t['ovowelsigngujarati'] = 0x0ACB; 16286 t['p'] = 0x0070; 16287 t['paampssquare'] = 0x3380; 16288 t['paasentosquare'] = 0x332B; 16289 t['pabengali'] = 0x09AA; 16290 t['pacute'] = 0x1E55; 16291 t['padeva'] = 0x092A; 16292 t['pagedown'] = 0x21DF; 16293 t['pageup'] = 0x21DE; 16294 t['pagujarati'] = 0x0AAA; 16295 t['pagurmukhi'] = 0x0A2A; 16296 t['pahiragana'] = 0x3071; 16297 t['paiyannoithai'] = 0x0E2F; 16298 t['pakatakana'] = 0x30D1; 16299 t['palatalizationcyrilliccmb'] = 0x0484; 16300 t['palochkacyrillic'] = 0x04C0; 16301 t['pansioskorean'] = 0x317F; 16302 t['paragraph'] = 0x00B6; 16303 t['parallel'] = 0x2225; 16304 t['parenleft'] = 0x0028; 16305 t['parenleftaltonearabic'] = 0xFD3E; 16306 t['parenleftbt'] = 0xF8ED; 16307 t['parenleftex'] = 0xF8EC; 16308 t['parenleftinferior'] = 0x208D; 16309 t['parenleftmonospace'] = 0xFF08; 16310 t['parenleftsmall'] = 0xFE59; 16311 t['parenleftsuperior'] = 0x207D; 16312 t['parenlefttp'] = 0xF8EB; 16313 t['parenleftvertical'] = 0xFE35; 16314 t['parenright'] = 0x0029; 16315 t['parenrightaltonearabic'] = 0xFD3F; 16316 t['parenrightbt'] = 0xF8F8; 16317 t['parenrightex'] = 0xF8F7; 16318 t['parenrightinferior'] = 0x208E; 16319 t['parenrightmonospace'] = 0xFF09; 16320 t['parenrightsmall'] = 0xFE5A; 16321 t['parenrightsuperior'] = 0x207E; 16322 t['parenrighttp'] = 0xF8F6; 16323 t['parenrightvertical'] = 0xFE36; 16324 t['partialdiff'] = 0x2202; 16325 t['paseqhebrew'] = 0x05C0; 16326 t['pashtahebrew'] = 0x0599; 16327 t['pasquare'] = 0x33A9; 16328 t['patah'] = 0x05B7; 16329 t['patah11'] = 0x05B7; 16330 t['patah1d'] = 0x05B7; 16331 t['patah2a'] = 0x05B7; 16332 t['patahhebrew'] = 0x05B7; 16333 t['patahnarrowhebrew'] = 0x05B7; 16334 t['patahquarterhebrew'] = 0x05B7; 16335 t['patahwidehebrew'] = 0x05B7; 16336 t['pazerhebrew'] = 0x05A1; 16337 t['pbopomofo'] = 0x3106; 16338 t['pcircle'] = 0x24DF; 16339 t['pdotaccent'] = 0x1E57; 16340 t['pe'] = 0x05E4; 16341 t['pecyrillic'] = 0x043F; 16342 t['pedagesh'] = 0xFB44; 16343 t['pedageshhebrew'] = 0xFB44; 16344 t['peezisquare'] = 0x333B; 16345 t['pefinaldageshhebrew'] = 0xFB43; 16346 t['peharabic'] = 0x067E; 16347 t['peharmenian'] = 0x057A; 16348 t['pehebrew'] = 0x05E4; 16349 t['pehfinalarabic'] = 0xFB57; 16350 t['pehinitialarabic'] = 0xFB58; 16351 t['pehiragana'] = 0x307A; 16352 t['pehmedialarabic'] = 0xFB59; 16353 t['pekatakana'] = 0x30DA; 16354 t['pemiddlehookcyrillic'] = 0x04A7; 16355 t['perafehebrew'] = 0xFB4E; 16356 t['percent'] = 0x0025; 16357 t['percentarabic'] = 0x066A; 16358 t['percentmonospace'] = 0xFF05; 16359 t['percentsmall'] = 0xFE6A; 16360 t['period'] = 0x002E; 16361 t['periodarmenian'] = 0x0589;
16362 t['periodcentered'] = 0x00B7; 16363 t['periodhalfwidth'] = 0xFF61; 16364 t['periodinferior'] = 0xF6E7; 16365 t['periodmonospace'] = 0xFF0E; 16366 t['periodsmall'] = 0xFE52; 16367 t['periodsuperior'] = 0xF6E8; 16368 t['perispomenigreekcmb'] = 0x0342; 16369 t['perpendicular'] = 0x22A5; 16370 t['perthousand'] = 0x2030; 16371 t['peseta'] = 0x20A7; 16372 t['pfsquare'] = 0x338A; 16373 t['phabengali'] = 0x09AB; 16374 t['phadeva'] = 0x092B; 16375 t['phagujarati'] = 0x0AAB; 16376 t['phagurmukhi'] = 0x0A2B; 16377 t['phi'] = 0x03C6; 16378 t['phi1'] = 0x03D5; 16379 t['phieuphacirclekorean'] = 0x327A; 16380 t['phieuphaparenkorean'] = 0x321A; 16381 t['phieuphcirclekorean'] = 0x326C; 16382 t['phieuphkorean'] = 0x314D; 16383 t['phieuphparenkorean'] = 0x320C; 16384 t['philatin'] = 0x0278; 16385 t['phinthuthai'] = 0x0E3A; 16386 t['phisymbolgreek'] = 0x03D5; 16387 t['phook'] = 0x01A5; 16388 t['phophanthai'] = 0x0E1E; 16389 t['phophungthai'] = 0x0E1C; 16390 t['phosamphaothai'] = 0x0E20; 16391 t['pi'] = 0x03C0; 16392 t['pieupacirclekorean'] = 0x3273; 16393 t['pieupaparenkorean'] = 0x3213; 16394 t['pieupcieuckorean'] = 0x3176; 16395 t['pieupcirclekorean'] = 0x3265; 16396 t['pieupkiyeokkorean'] = 0x3172; 16397 t['pieupkorean'] = 0x3142; 16398 t['pieupparenkorean'] = 0x3205; 16399 t['pieupsioskiyeokkorean'] = 0x3174; 16400 t['pieupsioskorean'] = 0x3144; 16401 t['pieupsiostikeutkorean'] = 0x3175; 16402 t['pieupthieuthkorean'] = 0x3177; 16403 t['pieuptikeutkorean'] = 0x3173; 16404 t['pihiragana'] = 0x3074; 16405 t['pikatakana'] = 0x30D4; 16406 t['pisymbolgreek'] = 0x03D6; 16407 t['piwrarmenian'] = 0x0583; 16408 t['plus'] = 0x002B; 16409 t['plusbelowcmb'] = 0x031F; 16410 t['pluscircle'] = 0x2295; 16411 t['plusminus'] = 0x00B1; 16412 t['plusmod'] = 0x02D6; 16413 t['plusmonospace'] = 0xFF0B; 16414 t['plussmall'] = 0xFE62; 16415 t['plussuperior'] = 0x207A; 16416 t['pmonospace'] = 0xFF50; 16417 t['pmsquare'] = 0x33D8; 16418 t['pohiragana'] = 0x307D; 16419 t['pointingindexdownwhite'] = 0x261F; 16420 t['pointingindexleftwhite'] = 0x261C; 16421 t['pointingindexrightwhite'] = 0x261E; 16422 t['pointingindexupwhite'] = 0x261D; 16423 t['pokatakana'] = 0x30DD; 16424 t['poplathai'] = 0x0E1B; 16425 t['postalmark'] = 0x3012; 16426 t['postalmarkface'] = 0x3020; 16427 t['pparen'] = 0x24AB; 16428 t['precedes'] = 0x227A; 16429 t['prescription'] = 0x211E; 16430 t['primemod'] = 0x02B9; 16431 t['primereversed'] = 0x2035; 16432 t['product'] = 0x220F; 16433 t['projective'] = 0x2305; 16434 t['prolongedkana'] = 0x30FC; 16435 t['propellor'] = 0x2318; 16436 t['propersubset'] = 0x2282; 16437 t['propersuperset'] = 0x2283; 16438 t['proportion'] = 0x2237; 16439 t['proportional'] = 0x221D; 16440 t['psi'] = 0x03C8; 16441 t['psicyrillic'] = 0x0471; 16442 t['psilipneumatacyrilliccmb'] = 0x0486; 16443 t['pssquare'] = 0x33B0; 16444 t['puhiragana'] = 0x3077; 16445 t['pukatakana'] = 0x30D7; 16446 t['pvsquare'] = 0x33B4; 16447 t['pwsquare'] = 0x33BA; 16448 t['q'] = 0x0071; 16449 t['qadeva'] = 0x0958; 16450 t['qadmahebrew'] = 0x05A8; 16451 t['qafarabic'] = 0x0642; 16452 t['qaffinalarabic'] = 0xFED6; 16453 t['qafinitialarabic'] = 0xFED7; 16454 t['qafmedialarabic'] = 0xFED8; 16455 t['qamats'] = 0x05B8; 16456 t['qamats10'] = 0x05B8; 16457 t['qamats1a'] = 0x05B8; 16458 t['qamats1c'] = 0x05B8; 16459 t['qamats27'] = 0x05B8; 16460 t['qamats29'] = 0x05B8; 16461 t['qamats33'] = 0x05B8; 16462 t['qamatsde'] = 0x05B8; 16463 t['qamatshebrew'] = 0x05B8; 16464 t['qamatsnarrowhebrew'] = 0x05B8; 16465 t['qamatsqatanhebrew'] = 0x05B8; 16466 t['qamatsqatannarrowhebrew'] = 0x05B8; 16467 t['qamatsqatanquarterhebrew'] = 0x05B8; 16468 t['qamatsqatanwidehebrew'] = 0x05B8; 16469 t['qamatsquarterhebrew'] = 0x05B8; 16470 t['qamatswidehebrew'] = 0x05B8; 16471 t['qarneyparahebrew'] = 0x059F; 16472 t['qbopomofo'] = 0x3111; 16473 t['qcircle'] = 0x24E0; 16474 t['qhook'] = 0x02A0; 16475 t['qmonospace'] = 0xFF51; 16476 t['qof'] = 0x05E7; 16477 t['qofdagesh'] = 0xFB47; 16478 t['qofdageshhebrew'] = 0xFB47; 16479 t['qofhebrew'] = 0x05E7; 16480 t['qparen'] = 0x24AC; 16481 t['quarternote'] = 0x2669; 16482 t['qubuts'] = 0x05BB; 16483 t['qubuts18'] = 0x05BB; 16484 t['qubuts25'] = 0x05BB; 16485 t['qubuts31'] = 0x05BB; 16486 t['qubutshebrew'] = 0x05BB; 16487 t['qubutsnarrowhebrew'] = 0x05BB; 16488 t['qubutsquarterhebrew'] = 0x05BB; 16489 t['qubutswidehebrew'] = 0x05BB; 16490 t['question'] = 0x003F; 16491 t['questionarabic'] = 0x061F; 16492 t['questionarmenian'] = 0x055E; 16493 t['questiondown'] = 0x00BF; 16494 t['questiondownsmall'] = 0xF7BF; 16495 t['questiongreek'] = 0x037E; 16496 t['questionmonospace'] = 0xFF1F; 16497 t['questionsmall'] = 0xF73F; 16498 t['quotedbl'] = 0x0022; 16499 t['quotedblbase'] = 0x201E; 16500 t['quotedblleft'] = 0x201C; 16501 t['quotedblmonospace'] = 0xFF02; 16502 t['quotedblprime'] = 0x301E; 16503 t['quotedblprimereversed'] = 0x301D; 16504 t['quotedblright'] = 0x201D; 16505 t['quoteleft'] = 0x2018; 16506 t['quoteleftreversed'] = 0x201B; 16507 t['quotereversed'] = 0x201B; 16508 t['quoteright'] = 0x2019; 16509 t['quoterightn'] = 0x0149; 16510 t['quotesinglbase'] = 0x201A; 16511 t['quotesingle'] = 0x0027; 16512 t['quotesinglemonospace'] = 0xFF07; 16513 t['r'] = 0x0072; 16514 t['raarmenian'] = 0x057C; 16515 t['rabengali'] = 0x09B0; 16516 t['racute'] = 0x0155; 16517 t['radeva'] = 0x0930; 16518 t['radical'] = 0x221A;
16519 t['radicalex'] = 0xF8E5; 16520 t['radoverssquare'] = 0x33AE; 16521 t['radoverssquaredsquare'] = 0x33AF; 16522 t['radsquare'] = 0x33AD; 16523 t['rafe'] = 0x05BF; 16524 t['rafehebrew'] = 0x05BF; 16525 t['ragujarati'] = 0x0AB0; 16526 t['ragurmukhi'] = 0x0A30; 16527 t['rahiragana'] = 0x3089; 16528 t['rakatakana'] = 0x30E9; 16529 t['rakatakanahalfwidth'] = 0xFF97; 16530 t['ralowerdiagonalbengali'] = 0x09F1; 16531 t['ramiddlediagonalbengali'] = 0x09F0; 16532 t['ramshorn'] = 0x0264; 16533 t['ratio'] = 0x2236; 16534 t['rbopomofo'] = 0x3116; 16535 t['rcaron'] = 0x0159; 16536 t['rcedilla'] = 0x0157; 16537 t['rcircle'] = 0x24E1; 16538 t['rcommaaccent'] = 0x0157; 16539 t['rdblgrave'] = 0x0211; 16540 t['rdotaccent'] = 0x1E59; 16541 t['rdotbelow'] = 0x1E5B; 16542 t['rdotbelowmacron'] = 0x1E5D; 16543 t['referencemark'] = 0x203B; 16544 t['reflexsubset'] = 0x2286; 16545 t['reflexsuperset'] = 0x2287; 16546 t['registered'] = 0x00AE; 16547 t['registersans'] = 0xF8E8; 16548 t['registerserif'] = 0xF6DA; 16549 t['reharabic'] = 0x0631; 16550 t['reharmenian'] = 0x0580; 16551 t['rehfinalarabic'] = 0xFEAE; 16552 t['rehiragana'] = 0x308C; 16553 t['rekatakana'] = 0x30EC; 16554 t['rekatakanahalfwidth'] = 0xFF9A; 16555 t['resh'] = 0x05E8; 16556 t['reshdageshhebrew'] = 0xFB48; 16557 t['reshhebrew'] = 0x05E8; 16558 t['reversedtilde'] = 0x223D; 16559 t['reviahebrew'] = 0x0597; 16560 t['reviamugrashhebrew'] = 0x0597; 16561 t['revlogicalnot'] = 0x2310; 16562 t['rfishhook'] = 0x027E; 16563 t['rfishhookreversed'] = 0x027F; 16564 t['rhabengali'] = 0x09DD; 16565 t['rhadeva'] = 0x095D; 16566 t['rho'] = 0x03C1; 16567 t['rhook'] = 0x027D; 16568 t['rhookturned'] = 0x027B; 16569 t['rhookturnedsuperior'] = 0x02B5; 16570 t['rhosymbolgreek'] = 0x03F1; 16571 t['rhotichookmod'] = 0x02DE; 16572 t['rieulacirclekorean'] = 0x3271; 16573 t['rieulaparenkorean'] = 0x3211; 16574 t['rieulcirclekorean'] = 0x3263; 16575 t['rieulhieuhkorean'] = 0x3140; 16576 t['rieulkiyeokkorean'] = 0x313A; 16577 t['rieulkiyeoksioskorean'] = 0x3169; 16578 t['rieulkorean'] = 0x3139; 16579 t['rieulmieumkorean'] = 0x313B; 16580 t['rieulpansioskorean'] = 0x316C; 16581 t['rieulparenkorean'] = 0x3203; 16582 t['rieulphieuphkorean'] = 0x313F; 16583 t['rieulpieupkorean'] = 0x313C; 16584 t['rieulpieupsioskorean'] = 0x316B; 16585 t['rieulsioskorean'] = 0x313D; 16586 t['rieulthieuthkorean'] = 0x313E; 16587 t['rieultikeutkorean'] = 0x316A; 16588 t['rieulyeorinhieuhkorean'] = 0x316D; 16589 t['rightangle'] = 0x221F; 16590 t['righttackbelowcmb'] = 0x0319; 16591 t['righttriangle'] = 0x22BF; 16592 t['rihiragana'] = 0x308A; 16593 t['rikatakana'] = 0x30EA; 16594 t['rikatakanahalfwidth'] = 0xFF98; 16595 t['ring'] = 0x02DA; 16596 t['ringbelowcmb'] = 0x0325; 16597 t['ringcmb'] = 0x030A; 16598 t['ringhalfleft'] = 0x02BF; 16599 t['ringhalfleftarmenian'] = 0x0559; 16600 t['ringhalfleftbelowcmb'] = 0x031C; 16601 t['ringhalfleftcentered'] = 0x02D3; 16602 t['ringhalfright'] = 0x02BE; 16603 t['ringhalfrightbelowcmb'] = 0x0339; 16604 t['ringhalfrightcentered'] = 0x02D2; 16605 t['rinvertedbreve'] = 0x0213; 16606 t['rittorusquare'] = 0x3351; 16607 t['rlinebelow'] = 0x1E5F; 16608 t['rlongleg'] = 0x027C; 16609 t['rlonglegturned'] = 0x027A; 16610 t['rmonospace'] = 0xFF52; 16611 t['rohiragana'] = 0x308D; 16612 t['rokatakana'] = 0x30ED; 16613 t['rokatakanahalfwidth'] = 0xFF9B; 16614 t['roruathai'] = 0x0E23; 16615 t['rparen'] = 0x24AD; 16616 t['rrabengali'] = 0x09DC; 16617 t['rradeva'] = 0x0931; 16618 t['rragurmukhi'] = 0x0A5C; 16619 t['rreharabic'] = 0x0691; 16620 t['rrehfinalarabic'] = 0xFB8D; 16621 t['rrvocalicbengali'] = 0x09E0; 16622 t['rrvocalicdeva'] = 0x0960; 16623 t['rrvocalicgujarati'] = 0x0AE0; 16624 t['rrvocalicvowelsignbengali'] = 0x09C4; 16625 t['rrvocalicvowelsigndeva'] = 0x0944; 16626 t['rrvocalicvowelsigngujarati'] = 0x0AC4; 16627 t['rsuperior'] = 0xF6F1; 16628 t['rtblock'] = 0x2590; 16629 t['rturned'] = 0x0279; 16630 t['rturnedsuperior'] = 0x02B4; 16631 t['ruhiragana'] = 0x308B; 16632 t['rukatakana'] = 0x30EB; 16633 t['rukatakanahalfwidth'] = 0xFF99; 16634 t['rupeemarkbengali'] = 0x09F2; 16635 t['rupeesignbengali'] = 0x09F3; 16636 t['rupiah'] = 0xF6DD; 16637 t['ruthai'] = 0x0E24; 16638 t['rvocalicbengali'] = 0x098B; 16639 t['rvocalicdeva'] = 0x090B; 16640 t['rvocalicgujarati'] = 0x0A8B; 16641 t['rvocalicvowelsignbengali'] = 0x09C3; 16642 t['rvocalicvowelsigndeva'] = 0x0943; 16643 t['rvocalicvowelsigngujarati'] = 0x0AC3; 16644 t['s'] = 0x0073; 16645 t['sabengali'] = 0x09B8; 16646 t['sacute'] = 0x015B; 16647 t['sacutedotaccent'] = 0x1E65; 16648 t['sadarabic'] = 0x0635; 16649 t['sadeva'] = 0x0938; 16650 t['sadfinalarabic'] = 0xFEBA; 16651 t['sadinitialarabic'] = 0xFEBB; 16652 t['sadmedialarabic'] = 0xFEBC; 16653 t['sagujarati'] = 0x0AB8; 16654 t['sagurmukhi'] = 0x0A38; 16655 t['sahiragana'] = 0x3055; 16656 t['sakatakana'] = 0x30B5;
16657 t['sakatakanahalfwidth'] = 0xFF7B; 16658 t['sallallahoualayhewasallamarabic'] = 0xFDFA; 16659 t['samekh'] = 0x05E1; 16660 t['samekhdagesh'] = 0xFB41; 16661 t['samekhdageshhebrew'] = 0xFB41; 16662 t['samekhhebrew'] = 0x05E1; 16663 t['saraaathai'] = 0x0E32; 16664 t['saraaethai'] = 0x0E41; 16665 t['saraaimaimalaithai'] = 0x0E44; 16666 t['saraaimaimuanthai'] = 0x0E43; 16667 t['saraamthai'] = 0x0E33; 16668 t['saraathai'] = 0x0E30; 16669 t['saraethai'] = 0x0E40; 16670 t['saraiileftthai'] = 0xF886; 16671 t['saraiithai'] = 0x0E35; 16672 t['saraileftthai'] = 0xF885; 16673 t['saraithai'] = 0x0E34; 16674 t['saraothai'] = 0x0E42; 16675 t['saraueeleftthai'] = 0xF888; 16676 t['saraueethai'] = 0x0E37; 16677 t['saraueleftthai'] = 0xF887; 16678 t['sarauethai'] = 0x0E36; 16679 t['sarauthai'] = 0x0E38; 16680 t['sarauuthai'] = 0x0E39; 16681 t['sbopomofo'] = 0x3119; 16682 t['scaron'] = 0x0161; 16683 t['scarondotaccent'] = 0x1E67; 16684 t['scedilla'] = 0x015F; 16685 t['schwa'] = 0x0259; 16686 t['schwacyrillic'] = 0x04D9; 16687 t['schwadieresiscyrillic'] = 0x04DB; 16688 t['schwahook'] = 0x025A; 16689 t['scircle'] = 0x24E2; 16690 t['scircumflex'] = 0x015D; 16691 t['scommaaccent'] = 0x0219; 16692 t['sdotaccent'] = 0x1E61; 16693 t['sdotbelow'] = 0x1E63; 16694 t['sdotbelowdotaccent'] = 0x1E69; 16695 t['seagullbelowcmb'] = 0x033C; 16696 t['second'] = 0x2033; 16697 t['secondtonechinese'] = 0x02CA; 16698 t['section'] = 0x00A7; 16699 t['seenarabic'] = 0x0633; 16700 t['seenfinalarabic'] = 0xFEB2; 16701 t['seeninitialarabic'] = 0xFEB3; 16702 t['seenmedialarabic'] = 0xFEB4; 16703 t['segol'] = 0x05B6; 16704 t['segol13'] = 0x05B6; 16705 t['segol1f'] = 0x05B6; 16706 t['segol2c'] = 0x05B6; 16707 t['segolhebrew'] = 0x05B6; 16708 t['segolnarrowhebrew'] = 0x05B6; 16709 t['segolquarterhebrew'] = 0x05B6; 16710 t['segoltahebrew'] = 0x0592; 16711 t['segolwidehebrew'] = 0x05B6; 16712 t['seharmenian'] = 0x057D; 16713 t['sehiragana'] = 0x305B; 16714 t['sekatakana'] = 0x30BB; 16715 t['sekatakanahalfwidth'] = 0xFF7E; 16716 t['semicolon'] = 0x003B; 16717 t['semicolonarabic'] = 0x061B; 16718 t['semicolonmonospace'] = 0xFF1B; 16719 t['semicolonsmall'] = 0xFE54; 16720 t['semivoicedmarkkana'] = 0x309C; 16721 t['semivoicedmarkkanahalfwidth'] = 0xFF9F; 16722 t['sentisquare'] = 0x3322; 16723 t['sentosquare'] = 0x3323; 16724 t['seven'] = 0x0037; 16725 t['sevenarabic'] = 0x0667; 16726 t['sevenbengali'] = 0x09ED; 16727 t['sevencircle'] = 0x2466; 16728 t['sevencircleinversesansserif'] = 0x2790; 16729 t['sevendeva'] = 0x096D; 16730 t['seveneighths'] = 0x215E; 16731 t['sevengujarati'] = 0x0AED; 16732 t['sevengurmukhi'] = 0x0A6D; 16733 t['sevenhackarabic'] = 0x0667; 16734 t['sevenhangzhou'] = 0x3027; 16735 t['sevenideographicparen'] = 0x3226; 16736 t['seveninferior'] = 0x2087; 16737 t['sevenmonospace'] = 0xFF17; 16738 t['sevenoldstyle'] = 0xF737; 16739 t['sevenparen'] = 0x247A; 16740 t['sevenperiod'] = 0x248E; 16741 t['sevenpersian'] = 0x06F7; 16742 t['sevenroman'] = 0x2176; 16743 t['sevensuperior'] = 0x2077; 16744 t['seventeencircle'] = 0x2470; 16745 t['seventeenparen'] = 0x2484; 16746 t['seventeenperiod'] = 0x2498; 16747 t['seventhai'] = 0x0E57; 16748 t['sfthyphen'] = 0x00AD; 16749 t['shaarmenian'] = 0x0577; 16750 t['shabengali'] = 0x09B6; 16751 t['shacyrillic'] = 0x0448; 16752 t['shaddaarabic'] = 0x0651; 16753 t['shaddadammaarabic'] = 0xFC61; 16754 t['shaddadammatanarabic'] = 0xFC5E; 16755 t['shaddafathaarabic'] = 0xFC60; 16756 t['shaddakasraarabic'] = 0xFC62; 16757 t['shaddakasratanarabic'] = 0xFC5F; 16758 t['shade'] = 0x2592; 16759 t['shadedark'] = 0x2593; 16760 t['shadelight'] = 0x2591; 16761 t['shademedium'] = 0x2592; 16762 t['shadeva'] = 0x0936; 16763 t['shagujarati'] = 0x0AB6; 16764 t['shagurmukhi'] = 0x0A36; 16765 t['shalshelethebrew'] = 0x0593; 16766 t['shbopomofo'] = 0x3115; 16767 t['shchacyrillic'] = 0x0449; 16768 t['sheenarabic'] = 0x0634; 16769 t['sheenfinalarabic'] = 0xFEB6; 16770 t['sheeninitialarabic'] = 0xFEB7; 16771 t['sheenmedialarabic'] = 0xFEB8; 16772 t['sheicoptic'] = 0x03E3; 16773 t['sheqel'] = 0x20AA; 16774 t['sheqelhebrew'] = 0x20AA; 16775 t['sheva'] = 0x05B0; 16776 t['sheva115'] = 0x05B0; 16777 t['sheva15'] = 0x05B0; 16778 t['sheva22'] = 0x05B0; 16779 t['sheva2e'] = 0x05B0; 16780 t['shevahebrew'] = 0x05B0; 16781 t['shevanarrowhebrew'] = 0x05B0; 16782 t['shevaquarterhebrew'] = 0x05B0; 16783 t['shevawidehebrew'] = 0x05B0; 16784 t['shhacyrillic'] = 0x04BB; 16785 t['shimacoptic'] = 0x03ED; 16786 t['shin'] = 0x05E9; 16787 t['shindagesh'] = 0xFB49; 16788 t['shindageshhebrew'] = 0xFB49; 16789 t['shindageshshindot'] = 0xFB2C; 16790 t['shindageshshindothebrew'] = 0xFB2C; 16791 t['shindageshsindot'] = 0xFB2D; 16792 t['shindageshsindothebrew'] = 0xFB2D; 16793 t['shindothebrew'] = 0x05C1; 16794 t['shinhebrew'] = 0x05E9; 16795 t['shinshindot'] = 0xFB2A; 16796 t['shinshindothebrew'] = 0xFB2A; 16797 t['shinsindot'] = 0xFB2B; 16798 t['shinsindothebrew'] = 0xFB2B; 16799 t['shook'] = 0x0282;
16800 t['sigma'] = 0x03C3; 16801 t['sigma1'] = 0x03C2; 16802 t['sigmafinal'] = 0x03C2; 16803 t['sigmalunatesymbolgreek'] = 0x03F2; 16804 t['sihiragana'] = 0x3057; 16805 t['sikatakana'] = 0x30B7; 16806 t['sikatakanahalfwidth'] = 0xFF7C; 16807 t['siluqhebrew'] = 0x05BD; 16808 t['siluqlefthebrew'] = 0x05BD; 16809 t['similar'] = 0x223C; 16810 t['sindothebrew'] = 0x05C2; 16811 t['siosacirclekorean'] = 0x3274; 16812 t['siosaparenkorean'] = 0x3214; 16813 t['sioscieuckorean'] = 0x317E; 16814 t['sioscirclekorean'] = 0x3266; 16815 t['sioskiyeokkorean'] = 0x317A; 16816 t['sioskorean'] = 0x3145; 16817 t['siosnieunkorean'] = 0x317B; 16818 t['siosparenkorean'] = 0x3206; 16819 t['siospieupkorean'] = 0x317D; 16820 t['siostikeutkorean'] = 0x317C; 16821 t['six'] = 0x0036; 16822 t['sixarabic'] = 0x0666; 16823 t['sixbengali'] = 0x09EC; 16824 t['sixcircle'] = 0x2465; 16825 t['sixcircleinversesansserif'] = 0x278F; 16826 t['sixdeva'] = 0x096C; 16827 t['sixgujarati'] = 0x0AEC; 16828 t['sixgurmukhi'] = 0x0A6C; 16829 t['sixhackarabic'] = 0x0666; 16830 t['sixhangzhou'] = 0x3026; 16831 t['sixideographicparen'] = 0x3225; 16832 t['sixinferior'] = 0x2086; 16833 t['sixmonospace'] = 0xFF16; 16834 t['sixoldstyle'] = 0xF736; 16835 t['sixparen'] = 0x2479; 16836 t['sixperiod'] = 0x248D; 16837 t['sixpersian'] = 0x06F6; 16838 t['sixroman'] = 0x2175; 16839 t['sixsuperior'] = 0x2076; 16840 t['sixteencircle'] = 0x246F; 16841 t['sixteencurrencydenominatorbengali'] = 0x09F9; 16842 t['sixteenparen'] = 0x2483; 16843 t['sixteenperiod'] = 0x2497; 16844 t['sixthai'] = 0x0E56; 16845 t['slash'] = 0x002F; 16846 t['slashmonospace'] = 0xFF0F; 16847 t['slong'] = 0x017F; 16848 t['slongdotaccent'] = 0x1E9B; 16849 t['smileface'] = 0x263A; 16850 t['smonospace'] = 0xFF53; 16851 t['sofpasuqhebrew'] = 0x05C3; 16852 t['softhyphen'] = 0x00AD; 16853 t['softsigncyrillic'] = 0x044C; 16854 t['sohiragana'] = 0x305D; 16855 t['sokatakana'] = 0x30BD; 16856 t['sokatakanahalfwidth'] = 0xFF7F; 16857 t['soliduslongoverlaycmb'] = 0x0338; 16858 t['solidusshortoverlaycmb'] = 0x0337; 16859 t['sorusithai'] = 0x0E29; 16860 t['sosalathai'] = 0x0E28; 16861 t['sosothai'] = 0x0E0B; 16862 t['sosuathai'] = 0x0E2A; 16863 t['space'] = 0x0020; 16864 t['spacehackarabic'] = 0x0020; 16865 t['spade'] = 0x2660; 16866 t['spadesuitblack'] = 0x2660; 16867 t['spadesuitwhite'] = 0x2664; 16868 t['sparen'] = 0x24AE; 16869 t['squarebelowcmb'] = 0x033B; 16870 t['squarecc'] = 0x33C4; 16871 t['squarecm'] = 0x339D; 16872 t['squarediagonalcrosshatchfill'] = 0x25A9; 16873 t['squarehorizontalfill'] = 0x25A4; 16874 t['squarekg'] = 0x338F; 16875 t['squarekm'] = 0x339E; 16876 t['squarekmcapital'] = 0x33CE; 16877 t['squareln'] = 0x33D1; 16878 t['squarelog'] = 0x33D2; 16879 t['squaremg'] = 0x338E; 16880 t['squaremil'] = 0x33D5; 16881 t['squaremm'] = 0x339C; 16882 t['squaremsquared'] = 0x33A1; 16883 t['squareorthogonalcrosshatchfill'] = 0x25A6; 16884 t['squareupperlefttolowerrightfill'] = 0x25A7; 16885 t['squareupperrighttolowerleftfill'] = 0x25A8; 16886 t['squareverticalfill'] = 0x25A5; 16887 t['squarewhitewithsmallblack'] = 0x25A3; 16888 t['srsquare'] = 0x33DB; 16889 t['ssabengali'] = 0x09B7; 16890 t['ssadeva'] = 0x0937; 16891 t['ssagujarati'] = 0x0AB7; 16892 t['ssangcieuckorean'] = 0x3149; 16893 t['ssanghieuhkorean'] = 0x3185; 16894 t['ssangieungkorean'] = 0x3180; 16895 t['ssangkiyeokkorean'] = 0x3132; 16896 t['ssangnieunkorean'] = 0x3165; 16897 t['ssangpieupkorean'] = 0x3143; 16898 t['ssangsioskorean'] = 0x3146; 16899 t['ssangtikeutkorean'] = 0x3138; 16900 t['ssuperior'] = 0xF6F2; 16901 t['sterling'] = 0x00A3; 16902 t['sterlingmonospace'] = 0xFFE1; 16903 t['strokelongoverlaycmb'] = 0x0336; 16904 t['strokeshortoverlaycmb'] = 0x0335; 16905 t['subset'] = 0x2282; 16906 t['subsetnotequal'] = 0x228A; 16907 t['subsetorequal'] = 0x2286; 16908 t['succeeds'] = 0x227B; 16909 t['suchthat'] = 0x220B; 16910 t['suhiragana'] = 0x3059; 16911 t['sukatakana'] = 0x30B9; 16912 t['sukatakanahalfwidth'] = 0xFF7D; 16913 t['sukunarabic'] = 0x0652; 16914 t['summation'] = 0x2211; 16915 t['sun'] = 0x263C; 16916 t['superset'] = 0x2283; 16917 t['supersetnotequal'] = 0x228B; 16918 t['supersetorequal'] = 0x2287; 16919 t['svsquare'] = 0x33DC; 16920 t['syouwaerasquare'] = 0x337C; 16921 t['t'] = 0x0074; 16922 t['tabengali'] = 0x09A4; 16923 t['tackdown'] = 0x22A4; 16924 t['tackleft'] = 0x22A3; 16925 t['tadeva'] = 0x0924; 16926 t['tagujarati'] = 0x0AA4; 16927 t['tagurmukhi'] = 0x0A24; 16928 t['taharabic'] = 0x0637; 16929 t['tahfinalarabic'] = 0xFEC2; 16930 t['tahinitialarabic'] = 0xFEC3; 16931 t['tahiragana'] = 0x305F; 16932 t['tahmedialarabic'] = 0xFEC4; 16933 t['taisyouerasquare'] = 0x337D; 16934 t['takatakana'] = 0x30BF; 16935 t['takatakanahalfwidth'] = 0xFF80; 16936 t['tatweelarabic'] = 0x0640; 16937 t['tau'] = 0x03C4; 16938 t['tav'] = 0x05EA; 16939 t['tavdages'] = 0xFB4A; 16940 t['tavdagesh'] = 0xFB4A; 16941 t['tavdageshhebrew'] = 0xFB4A; 16942 t['tavhebrew'] = 0x05EA; 16943 t['tbar'] = 0x0167; 16944 t['tbopomofo'] = 0x310A; 16945 t['tcaron'] = 0x0165; 16946 t['tccurl'] = 0x02A8; 16947 t['tcedilla'] = 0x0163; 16948 t['tcheharabic'] = 0x0686; 16949 t['tchehfinalarabic'] = 0xFB7B; 16950 t['tchehinitialarabic'] = 0xFB7C; 16951 t['tchehmedialarabic'] = 0xFB7D; 16952 t['tcircle'] = 0x24E3; 16953 t['tcircumflexbelow'] = 0x1E71; 16954 t['tcommaaccent'] = 0x0163; 16955 t['tdieresis'] = 0x1E97; 16956 t['tdotaccent'] = 0x1E6B; 16957 t['tdotbelow'] = 0x1E6D; 16958 t['tecyrillic'] = 0x0442; 16959 t['tedescendercyrillic'] = 0x04AD; 16960 t['teharabic'] = 0x062A; 16961 t['tehfinalarabic'] = 0xFE96; 16962 t['tehhahinitialarabic'] = 0xFCA2; 16963 t['tehhahisolatedarabic'] = 0xFC0C; 16964 t['tehinitialarabic'] = 0xFE97; 16965 t['tehiragana'] = 0x3066; 16966 t['tehjeeminitialarabic'] = 0xFCA1; 16967 t['tehjeemisolatedarabic'] = 0xFC0B; 16968 t['tehmarbutaarabic'] = 0x0629; 16969 t['tehmarbutafinalarabic'] = 0xFE94; 16970 t['tehmedialarabic'] = 0xFE98; 16971 t['tehmeeminitialarabic'] = 0xFCA4; 16972 t['tehmeemisolatedarabic'] = 0xFC0E; 16973 t['tehnoonfinalarabic'] = 0xFC73; 16974 t['tekatakana'] = 0x30C6; 16975 t['tekatakanahalfwidth'] = 0xFF83; 16976 t['telephone'] = 0x2121; 16977 t['telephoneblack'] = 0x260E; 16978 t['telishagedolahebrew'] = 0x05A0; 16979 t['telishaqetanahebrew'] = 0x05A9; 16980 t['tencircle'] = 0x2469; 16981 t['tenideographicparen'] = 0x3229; 16982 t['tenparen'] = 0x247D; 16983 t['tenperiod'] = 0x2491; 16984 t['tenroman'] = 0x2179; 16985 t['tesh'] = 0x02A7; 16986 t['tet'] = 0x05D8; 16987 t['tetdagesh'] = 0xFB38; 16988 t['tetdageshhebrew'] = 0xFB38; 16989 t['tethebrew'] = 0x05D8; 16990 t['tetsecyrillic'] = 0x04B5; 16991 t['tevirhebrew'] = 0x059B; 16992 t['tevirlefthebrew'] = 0x059B; 16993 t['thabengali'] = 0x09A5; 16994 t['thadeva'] = 0x0925; 16995 t['thagujarati'] = 0x0AA5; 16996 t['thagurmukhi'] = 0x0A25; 16997 t['thalarabic'] = 0x0630; 16998 t['thalfinalarabic'] = 0xFEAC;
16999 t['thanthakhatlowleftthai'] = 0xF898; 17000 t['thanthakhatlowrightthai'] = 0xF897; 17001 t['thanthakhatthai'] = 0x0E4C; 17002 t['thanthakhatupperleftthai'] = 0xF896; 17003 t['theharabic'] = 0x062B; 17004 t['thehfinalarabic'] = 0xFE9A; 17005 t['thehinitialarabic'] = 0xFE9B; 17006 t['thehmedialarabic'] = 0xFE9C; 17007 t['thereexists'] = 0x2203; 17008 t['therefore'] = 0x2234; 17009 t['theta'] = 0x03B8; 17010 t['theta1'] = 0x03D1; 17011 t['thetasymbolgreek'] = 0x03D1; 17012 t['thieuthacirclekorean'] = 0x3279; 17013 t['thieuthaparenkorean'] = 0x3219; 17014 t['thieuthcirclekorean'] = 0x326B; 17015 t['thieuthkorean'] = 0x314C; 17016 t['thieuthparenkorean'] = 0x320B; 17017 t['thirteencircle'] = 0x246C; 17018 t['thirteenparen'] = 0x2480; 17019 t['thirteenperiod'] = 0x2494; 17020 t['thonangmonthothai'] = 0x0E11; 17021 t['thook'] = 0x01AD; 17022 t['thophuthaothai'] = 0x0E12; 17023 t['thorn'] = 0x00FE; 17024 t['thothahanthai'] = 0x0E17; 17025 t['thothanthai'] = 0x0E10; 17026 t['thothongthai'] = 0x0E18; 17027 t['thothungthai'] = 0x0E16; 17028 t['thousandcyrillic'] = 0x0482; 17029 t['thousandsseparatorarabic'] = 0x066C; 17030 t['thousandsseparatorpersian'] = 0x066C; 17031 t['three'] = 0x0033; 17032 t['threearabic'] = 0x0663; 17033 t['threebengali'] = 0x09E9; 17034 t['threecircle'] = 0x2462; 17035 t['threecircleinversesansserif'] = 0x278C; 17036 t['threedeva'] = 0x0969; 17037 t['threeeighths'] = 0x215C; 17038 t['threegujarati'] = 0x0AE9; 17039 t['threegurmukhi'] = 0x0A69; 17040 t['threehackarabic'] = 0x0663; 17041 t['threehangzhou'] = 0x3023; 17042 t['threeideographicparen'] = 0x3222; 17043 t['threeinferior'] = 0x2083; 17044 t['threemonospace'] = 0xFF13; 17045 t['threenumeratorbengali'] = 0x09F6; 17046 t['threeoldstyle'] = 0xF733; 17047 t['threeparen'] = 0x2476; 17048 t['threeperiod'] = 0x248A; 17049 t['threepersian'] = 0x06F3; 17050 t['threequarters'] = 0x00BE; 17051 t['threequartersemdash'] = 0xF6DE; 17052 t['threeroman'] = 0x2172; 17053 t['threesuperior'] = 0x00B3; 17054 t['threethai'] = 0x0E53; 17055 t['thzsquare'] = 0x3394; 17056 t['tihiragana'] = 0x3061; 17057 t['tikatakana'] = 0x30C1; 17058 t['tikatakanahalfwidth'] = 0xFF81; 17059 t['tikeutacirclekorean'] = 0x3270; 17060 t['tikeutaparenkorean'] = 0x3210; 17061 t['tikeutcirclekorean'] = 0x3262; 17062 t['tikeutkorean'] = 0x3137; 17063 t['tikeutparenkorean'] = 0x3202; 17064 t['tilde'] = 0x02DC; 17065 t['tildebelowcmb'] = 0x0330; 17066 t['tildecmb'] = 0x0303; 17067 t['tildecomb'] = 0x0303; 17068 t['tildedoublecmb'] = 0x0360; 17069 t['tildeoperator'] = 0x223C; 17070 t['tildeoverlaycmb'] = 0x0334; 17071 t['tildeverticalcmb'] = 0x033E; 17072 t['timescircle'] = 0x2297; 17073 t['tipehahebrew'] = 0x0596; 17074 t['tipehalefthebrew'] = 0x0596; 17075 t['tippigurmukhi'] = 0x0A70; 17076 t['titlocyrilliccmb'] = 0x0483; 17077 t['tiwnarmenian'] = 0x057F; 17078 t['tlinebelow'] = 0x1E6F; 17079 t['tmonospace'] = 0xFF54; 17080 t['toarmenian'] = 0x0569; 17081 t['tohiragana'] = 0x3068; 17082 t['tokatakana'] = 0x30C8; 17083 t['tokatakanahalfwidth'] = 0xFF84; 17084 t['tonebarextrahighmod'] = 0x02E5; 17085 t['tonebarextralowmod'] = 0x02E9; 17086 t['tonebarhighmod'] = 0x02E6; 17087 t['tonebarlowmod'] = 0x02E8; 17088 t['tonebarmidmod'] = 0x02E7; 17089 t['tonefive'] = 0x01BD; 17090 t['tonesix'] = 0x0185; 17091 t['tonetwo'] = 0x01A8; 17092 t['tonos'] = 0x0384; 17093 t['tonsquare'] = 0x3327; 17094 t['topatakthai'] = 0x0E0F; 17095 t['tortoiseshellbracketleft'] = 0x3014; 17096 t['tortoiseshellbracketleftsmall'] = 0xFE5D; 17097 t['tortoiseshellbracketleftvertical'] = 0xFE39; 17098 t['tortoiseshellbracketright'] = 0x3015; 17099 t['tortoiseshellbracketrightsmall'] = 0xFE5E; 17100 t['tortoiseshellbracketrightvertical'] = 0xFE3A; 17101 t['totaothai'] = 0x0E15; 17102 t['tpalatalhook'] = 0x01AB; 17103 t['tparen'] = 0x24AF; 17104 t['trademark'] = 0x2122; 17105 t['trademarksans'] = 0xF8EA; 17106 t['trademarkserif'] = 0xF6DB; 17107 t['tretroflexhook'] = 0x0288; 17108 t['triagdn'] = 0x25BC; 17109 t['triaglf'] = 0x25C4; 17110 t['triagrt'] = 0x25BA; 17111 t['triagup'] = 0x25B2; 17112 t['ts'] = 0x02A6; 17113 t['tsadi'] = 0x05E6; 17114 t['tsadidagesh'] = 0xFB46; 17115 t['tsadidageshhebrew'] = 0xFB46; 17116 t['tsadihebrew'] = 0x05E6; 17117 t['tsecyrillic'] = 0x0446; 17118 t['tsere'] = 0x05B5; 17119 t['tsere12'] = 0x05B5; 17120 t['tsere1e'] = 0x05B5; 17121 t['tsere2b'] = 0x05B5; 17122 t['tserehebrew'] = 0x05B5; 17123 t['tserenarrowhebrew'] = 0x05B5; 17124 t['tserequarterhebrew'] = 0x05B5; 17125 t['tserewidehebrew'] = 0x05B5; 17126 t['tshecyrillic'] = 0x045B; 17127 t['tsuperior'] = 0xF6F3; 17128 t['ttabengali'] = 0x099F; 17129 t['ttadeva'] = 0x091F; 17130 t['ttagujarati'] = 0x0A9F; 17131 t['ttagurmukhi'] = 0x0A1F; 17132 t['tteharabic'] = 0x0679; 17133 t['ttehfinalarabic'] = 0xFB67; 17134 t['ttehinitialarabic'] = 0xFB68; 17135 t['ttehmedialarabic'] = 0xFB69;
17136 t['tthabengali'] = 0x09A0; 17137 t['tthadeva'] = 0x0920; 17138 t['tthagujarati'] = 0x0AA0; 17139 t['tthagurmukhi'] = 0x0A20; 17140 t['tturned'] = 0x0287; 17141 t['tuhiragana'] = 0x3064; 17142 t['tukatakana'] = 0x30C4; 17143 t['tukatakanahalfwidth'] = 0xFF82; 17144 t['tusmallhiragana'] = 0x3063; 17145 t['tusmallkatakana'] = 0x30C3; 17146 t['tusmallkatakanahalfwidth'] = 0xFF6F; 17147 t['twelvecircle'] = 0x246B; 17148 t['twelveparen'] = 0x247F; 17149 t['twelveperiod'] = 0x2493; 17150 t['twelveroman'] = 0x217B; 17151 t['twentycircle'] = 0x2473; 17152 t['twentyhangzhou'] = 0x5344; 17153 t['twentyparen'] = 0x2487; 17154 t['twentyperiod'] = 0x249B; 17155 t['two'] = 0x0032; 17156 t['twoarabic'] = 0x0662; 17157 t['twobengali'] = 0x09E8; 17158 t['twocircle'] = 0x2461; 17159 t['twocircleinversesansserif'] = 0x278B; 17160 t['twodeva'] = 0x0968; 17161 t['twodotenleader'] = 0x2025; 17162 t['twodotleader'] = 0x2025; 17163 t['twodotleadervertical'] = 0xFE30; 17164 t['twogujarati'] = 0x0AE8; 17165 t['twogurmukhi'] = 0x0A68; 17166 t['twohackarabic'] = 0x0662; 17167 t['twohangzhou'] = 0x3022; 17168 t['twoideographicparen'] = 0x3221; 17169 t['twoinferior'] = 0x2082; 17170 t['twomonospace'] = 0xFF12; 17171 t['twonumeratorbengali'] = 0x09F5; 17172 t['twooldstyle'] = 0xF732; 17173 t['twoparen'] = 0x2475; 17174 t['twoperiod'] = 0x2489; 17175 t['twopersian'] = 0x06F2; 17176 t['tworoman'] = 0x2171; 17177 t['twostroke'] = 0x01BB; 17178 t['twosuperior'] = 0x00B2; 17179 t['twothai'] = 0x0E52; 17180 t['twothirds'] = 0x2154; 17181 t['u'] = 0x0075; 17182 t['uacute'] = 0x00FA; 17183 t['ubar'] = 0x0289; 17184 t['ubengali'] = 0x0989; 17185 t['ubopomofo'] = 0x3128; 17186 t['ubreve'] = 0x016D; 17187 t['ucaron'] = 0x01D4; 17188 t['ucircle'] = 0x24E4; 17189 t['ucircumflex'] = 0x00FB; 17190 t['ucircumflexbelow'] = 0x1E77; 17191 t['ucyrillic'] = 0x0443; 17192 t['udattadeva'] = 0x0951; 17193 t['udblacute'] = 0x0171; 17194 t['udblgrave'] = 0x0215; 17195 t['udeva'] = 0x0909; 17196 t['udieresis'] = 0x00FC; 17197 t['udieresisacute'] = 0x01D8; 17198 t['udieresisbelow'] = 0x1E73; 17199 t['udieresiscaron'] = 0x01DA; 17200 t['udieresiscyrillic'] = 0x04F1; 17201 t['udieresisgrave'] = 0x01DC; 17202 t['udieresismacron'] = 0x01D6; 17203 t['udotbelow'] = 0x1EE5; 17204 t['ugrave'] = 0x00F9; 17205 t['ugujarati'] = 0x0A89; 17206 t['ugurmukhi'] = 0x0A09; 17207 t['uhiragana'] = 0x3046; 17208 t['uhookabove'] = 0x1EE7; 17209 t['uhorn'] = 0x01B0; 17210 t['uhornacute'] = 0x1EE9; 17211 t['uhorndotbelow'] = 0x1EF1; 17212 t['uhorngrave'] = 0x1EEB; 17213 t['uhornhookabove'] = 0x1EED; 17214 t['uhorntilde'] = 0x1EEF; 17215 t['uhungarumlaut'] = 0x0171; 17216 t['uhungarumlautcyrillic'] = 0x04F3; 17217 t['uinvertedbreve'] = 0x0217; 17218 t['ukatakana'] = 0x30A6; 17219 t['ukatakanahalfwidth'] = 0xFF73; 17220 t['ukcyrillic'] = 0x0479; 17221 t['ukorean'] = 0x315C; 17222 t['umacron'] = 0x016B; 17223 t['umacroncyrillic'] = 0x04EF; 17224 t['umacrondieresis'] = 0x1E7B; 17225 t['umatragurmukhi'] = 0x0A41; 17226 t['umonospace'] = 0xFF55; 17227 t['underscore'] = 0x005F; 17228 t['underscoredbl'] = 0x2017; 17229 t['underscoremonospace'] = 0xFF3F; 17230 t['underscorevertical'] = 0xFE33; 17231 t['underscorewavy'] = 0xFE4F; 17232 t['union'] = 0x222A; 17233 t['universal'] = 0x2200; 17234 t['uogonek'] = 0x0173; 17235 t['uparen'] = 0x24B0; 17236 t['upblock'] = 0x2580; 17237 t['upperdothebrew'] = 0x05C4; 17238 t['upsilon'] = 0x03C5; 17239 t['upsilondieresis'] = 0x03CB; 17240 t['upsilondieresistonos'] = 0x03B0; 17241 t['upsilonlatin'] = 0x028A; 17242 t['upsilontonos'] = 0x03CD; 17243 t['uptackbelowcmb'] = 0x031D; 17244 t['uptackmod'] = 0x02D4; 17245 t['uragurmukhi'] = 0x0A73; 17246 t['uring'] = 0x016F; 17247 t['ushortcyrillic'] = 0x045E; 17248 t['usmallhiragana'] = 0x3045; 17249 t['usmallkatakana'] = 0x30A5; 17250 t['usmallkatakanahalfwidth'] = 0xFF69; 17251 t['ustraightcyrillic'] = 0x04AF; 17252 t['ustraightstrokecyrillic'] = 0x04B1; 17253 t['utilde'] = 0x0169; 17254 t['utildeacute'] = 0x1E79; 17255 t['utildebelow'] = 0x1E75; 17256 t['uubengali'] = 0x098A; 17257 t['uudeva'] = 0x090A; 17258 t['uugujarati'] = 0x0A8A; 17259 t['uugurmukhi'] = 0x0A0A; 17260 t['uumatragurmukhi'] = 0x0A42; 17261 t['uuvowelsignbengali'] = 0x09C2; 17262 t['uuvowelsigndeva'] = 0x0942; 17263 t['uuvowelsigngujarati'] = 0x0AC2; 17264 t['uvowelsignbengali'] = 0x09C1; 17265 t['uvowelsigndeva'] = 0x0941; 17266 t['uvowelsigngujarati'] = 0x0AC1; 17267 t['v'] = 0x0076; 17268 t['vadeva'] = 0x0935; 17269 t['vagujarati'] = 0x0AB5; 17270 t['vagurmukhi'] = 0x0A35; 17271 t['vakatakana'] = 0x30F7; 17272 t['vav'] = 0x05D5; 17273 t['vavdagesh'] = 0xFB35; 17274 t['vavdagesh65'] = 0xFB35; 17275 t['vavdageshhebrew'] = 0xFB35; 17276 t['vavhebrew'] = 0x05D5; 17277 t['vavholam'] = 0xFB4B; 17278 t['vavholamhebrew'] = 0xFB4B; 17279 t['vavvavhebrew'] = 0x05F0; 17280 t['vavyodhebrew'] = 0x05F1; 17281 t['vcircle'] = 0x24E5; 17282 t['vdotbelow'] = 0x1E7F; 17283 t['vecyrillic'] = 0x0432; 17284 t['veharabic'] = 0x06A4; 17285 t['vehfinalarabic'] = 0xFB6B; 17286 t['vehinitialarabic'] = 0xFB6C; 17287 t['vehmedialarabic'] = 0xFB6D; 17288 t['vekatakana'] = 0x30F9; 17289 t['venus'] = 0x2640; 17290 t['verticalbar'] = 0x007C; 17291 t['verticallineabovecmb'] = 0x030D; 17292 t['verticallinebelowcmb'] = 0x0329; 17293 t['verticallinelowmod'] = 0x02CC; 17294 t['verticallinemod'] = 0x02C8; 17295 t['vewarmenian'] = 0x057E; 17296 t['vhook'] = 0x028B; 17297 t['vikatakana'] = 0x30F8; 17298 t['viramabengali'] = 0x09CD; 17299 t['viramadeva'] = 0x094D; 17300 t['viramagujarati'] = 0x0ACD; 17301 t['visargabengali'] = 0x0983; 17302 t['visargadeva'] = 0x0903; 17303 t['visargagujarati'] = 0x0A83; 17304 t['vmonospace'] = 0xFF56; 17305 t['voarmenian'] = 0x0578; 17306 t['voicediterationhiragana'] = 0x309E; 17307 t['voicediterationkatakana'] = 0x30FE; 17308 t['voicedmarkkana'] = 0x309B; 17309 t['voicedmarkkanahalfwidth'] = 0xFF9E; 17310 t['vokatakana'] = 0x30FA; 17311 t['vparen'] = 0x24B1; 17312 t['vtilde'] = 0x1E7D; 17313 t['vturned'] = 0x028C; 17314 t['vuhiragana'] = 0x3094; 17315 t['vukatakana'] = 0x30F4; 17316 t['w'] = 0x0077; 17317 t['wacute'] = 0x1E83; 17318 t['waekorean'] = 0x3159; 17319 t['wahiragana'] = 0x308F; 17320 t['wakatakana'] = 0x30EF; 17321 t['wakatakanahalfwidth'] = 0xFF9C; 17322 t['wakorean'] = 0x3158; 17323 t['wasmallhiragana'] = 0x308E; 17324 t['wasmallkatakana'] = 0x30EE; 17325 t['wattosquare'] = 0x3357; 17326 t['wavedash'] = 0x301C; 17327 t['wavyunderscorevertical'] = 0xFE34; 17328 t['wawarabic'] = 0x0648; 17329 t['wawfinalarabic'] = 0xFEEE; 17330 t['wawhamzaabovearabic'] = 0x0624; 17331 t['wawhamzaabovefinalarabic'] = 0xFE86; 17332 t['wbsquare'] = 0x33DD; 17333 t['wcircle'] = 0x24E6; 17334 t['wcircumflex'] = 0x0175; 17335 t['wdieresis'] = 0x1E85; 17336 t['wdotaccent'] = 0x1E87; 17337 t['wdotbelow'] = 0x1E89; 17338 t['wehiragana'] = 0x3091; 17339 t['weierstrass'] = 0x2118; 17340 t['wekatakana'] = 0x30F1; 17341 t['wekorean'] = 0x315E; 17342 t['weokorean'] = 0x315D; 17343 t['wgrave'] = 0x1E81; 17344 t['whitebullet'] = 0x25E6; 17345 t['whitecircle'] = 0x25CB; 17346 t['whitecircleinverse'] = 0x25D9; 17347 t['whitecornerbracketleft'] = 0x300E; 17348 t['whitecornerbracketleftvertical'] = 0xFE43; 17349 t['whitecornerbracketright'] = 0x300F; 17350 t['whitecornerbracketrightvertical'] = 0xFE44; 17351 t['whitediamond'] = 0x25C7; 17352 t['whitediamondcontainingblacksmalldiamond'] = 0x25C8;
17353 t['whitedownpointingsmalltriangle'] = 0x25BF; 17354 t['whitedownpointingtriangle'] = 0x25BD; 17355 t['whiteleftpointingsmalltriangle'] = 0x25C3; 17356 t['whiteleftpointingtriangle'] = 0x25C1; 17357 t['whitelenticularbracketleft'] = 0x3016; 17358 t['whitelenticularbracketright'] = 0x3017; 17359 t['whiterightpointingsmalltriangle'] = 0x25B9; 17360 t['whiterightpointingtriangle'] = 0x25B7; 17361 t['whitesmallsquare'] = 0x25AB; 17362 t['whitesmilingface'] = 0x263A; 17363 t['whitesquare'] = 0x25A1; 17364 t['whitestar'] = 0x2606; 17365 t['whitetelephone'] = 0x260F; 17366 t['whitetortoiseshellbracketleft'] = 0x3018; 17367 t['whitetortoiseshellbracketright'] = 0x3019; 17368 t['whiteuppointingsmalltriangle'] = 0x25B5; 17369 t['whiteuppointingtriangle'] = 0x25B3; 17370 t['wihiragana'] = 0x3090; 17371 t['wikatakana'] = 0x30F0; 17372 t['wikorean'] = 0x315F; 17373 t['wmonospace'] = 0xFF57; 17374 t['wohiragana'] = 0x3092; 17375 t['wokatakana'] = 0x30F2; 17376 t['wokatakanahalfwidth'] = 0xFF66; 17377 t['won'] = 0x20A9; 17378 t['wonmonospace'] = 0xFFE6; 17379 t['wowaenthai'] = 0x0E27; 17380 t['wparen'] = 0x24B2; 17381 t['wring'] = 0x1E98; 17382 t['wsuperior'] = 0x02B7; 17383 t['wturned'] = 0x028D; 17384 t['wynn'] = 0x01BF; 17385 t['x'] = 0x0078; 17386 t['xabovecmb'] = 0x033D; 17387 t['xbopomofo'] = 0x3112; 17388 t['xcircle'] = 0x24E7; 17389 t['xdieresis'] = 0x1E8D; 17390 t['xdotaccent'] = 0x1E8B; 17391 t['xeharmenian'] = 0x056D; 17392 t['xi'] = 0x03BE; 17393 t['xmonospace'] = 0xFF58; 17394 t['xparen'] = 0x24B3; 17395 t['xsuperior'] = 0x02E3; 17396 t['y'] = 0x0079; 17397 t['yaadosquare'] = 0x334E; 17398 t['yabengali'] = 0x09AF; 17399 t['yacute'] = 0x00FD; 17400 t['yadeva'] = 0x092F; 17401 t['yaekorean'] = 0x3152; 17402 t['yagujarati'] = 0x0AAF; 17403 t['yagurmukhi'] = 0x0A2F; 17404 t['yahiragana'] = 0x3084; 17405 t['yakatakana'] = 0x30E4; 17406 t['yakatakanahalfwidth'] = 0xFF94; 17407 t['yakorean'] = 0x3151; 17408 t['yamakkanthai'] = 0x0E4E; 17409 t['yasmallhiragana'] = 0x3083; 17410 t['yasmallkatakana'] = 0x30E3; 17411 t['yasmallkatakanahalfwidth'] = 0xFF6C; 17412 t['yatcyrillic'] = 0x0463; 17413 t['ycircle'] = 0x24E8; 17414 t['ycircumflex'] = 0x0177; 17415 t['ydieresis'] = 0x00FF; 17416 t['ydotaccent'] = 0x1E8F; 17417 t['ydotbelow'] = 0x1EF5; 17418 t['yeharabic'] = 0x064A; 17419 t['yehbarreearabic'] = 0x06D2; 17420 t['yehbarreefinalarabic'] = 0xFBAF; 17421 t['yehfinalarabic'] = 0xFEF2; 17422 t['yehhamzaabovearabic'] = 0x0626; 17423 t['yehhamzaabovefinalarabic'] = 0xFE8A; 17424 t['yehhamzaaboveinitialarabic'] = 0xFE8B; 17425 t['yehhamzaabovemedialarabic'] = 0xFE8C; 17426 t['yehinitialarabic'] = 0xFEF3; 17427 t['yehmedialarabic'] = 0xFEF4; 17428 t['yehmeeminitialarabic'] = 0xFCDD; 17429 t['yehmeemisolatedarabic'] = 0xFC58; 17430 t['yehnoonfinalarabic'] = 0xFC94; 17431 t['yehthreedotsbelowarabic'] = 0x06D1; 17432 t['yekorean'] = 0x3156; 17433 t['yen'] = 0x00A5; 17434 t['yenmonospace'] = 0xFFE5; 17435 t['yeokorean'] = 0x3155; 17436 t['yeorinhieuhkorean'] = 0x3186; 17437 t['yerahbenyomohebrew'] = 0x05AA; 17438 t['yerahbenyomolefthebrew'] = 0x05AA; 17439 t['yericyrillic'] = 0x044B; 17440 t['yerudieresiscyrillic'] = 0x04F9; 17441 t['yesieungkorean'] = 0x3181; 17442 t['yesieungpansioskorean'] = 0x3183; 17443 t['yesieungsioskorean'] = 0x3182; 17444 t['yetivhebrew'] = 0x059A; 17445 t['ygrave'] = 0x1EF3; 17446 t['yhook'] = 0x01B4; 17447 t['yhookabove'] = 0x1EF7; 17448 t['yiarmenian'] = 0x0575; 17449 t['yicyrillic'] = 0x0457; 17450 t['yikorean'] = 0x3162; 17451 t['yinyang'] = 0x262F; 17452 t['yiwnarmenian'] = 0x0582; 17453 t['ymonospace'] = 0xFF59; 17454 t['yod'] = 0x05D9; 17455 t['yoddagesh'] = 0xFB39; 17456 t['yoddageshhebrew'] = 0xFB39; 17457 t['yodhebrew'] = 0x05D9; 17458 t['yodyodhebrew'] = 0x05F2; 17459 t['yodyodpatahhebrew'] = 0xFB1F; 17460 t['yohiragana'] = 0x3088; 17461 t['yoikorean'] = 0x3189; 17462 t['yokatakana'] = 0x30E8; 17463 t['yokatakanahalfwidth'] = 0xFF96; 17464 t['yokorean'] = 0x315B; 17465 t['yosmallhiragana'] = 0x3087; 17466 t['yosmallkatakana'] = 0x30E7; 17467 t['yosmallkatakanahalfwidth'] = 0xFF6E; 17468 t['yotgreek'] = 0x03F3; 17469 t['yoyaekorean'] = 0x3188; 17470 t['yoyakorean'] = 0x3187; 17471 t['yoyakthai'] = 0x0E22; 17472 t['yoyingthai'] = 0x0E0D; 17473 t['yparen'] = 0x24B4; 17474 t['ypogegrammeni'] = 0x037A; 17475 t['ypogegrammenigreekcmb'] = 0x0345; 17476 t['yr'] = 0x01A6; 17477 t['yring'] = 0x1E99; 17478 t['ysuperior'] = 0x02B8; 17479 t['ytilde'] = 0x1EF9; 17480 t['yturned'] = 0x028E; 17481 t['yuhiragana'] = 0x3086; 17482 t['yuikorean'] = 0x318C; 17483 t['yukatakana'] = 0x30E6; 17484 t['yukatakanahalfwidth'] = 0xFF95; 17485 t['yukorean'] = 0x3160; 17486 t['yusbigcyrillic'] = 0x046B; 17487 t['yusbigiotifiedcyrillic'] = 0x046D; 17488 t['yuslittlecyrillic'] = 0x0467; 17489 t['yuslittleiotifiedcyrillic'] = 0x0469; 17490 t['yusmallhiragana'] = 0x3085; 17491 t['yusmallkatakana'] = 0x30E5; 17492 t['yusmallkatakanahalfwidth'] = 0xFF6D; 17493 t['yuyekorean'] = 0x318B; 17494 t['yuyeokorean'] = 0x318A; 17495 t['yyabengali'] = 0x09DF; 17496 t['yyadeva'] = 0x095F; 17497 t['z'] = 0x007A; 17498 t['zaarmenian'] = 0x0566; 17499 t['zacute'] = 0x017A; 17500 t['zadeva'] = 0x095B; 17501 t['zagurmukhi'] = 0x0A5B; 17502 t['zaharabic'] = 0x0638; 17503 t['zahfinalarabic'] = 0xFEC6; 17504 t['zahinitialarabic'] = 0xFEC7; 17505 t['zahiragana'] = 0x3056; 17506 t['zahmedialarabic'] = 0xFEC8; 17507 t['zainarabic'] = 0x0632; 17508 t['zainfinalarabic'] = 0xFEB0; 17509 t['zakatakana'] = 0x30B6; 17510 t['zaqefgadolhebrew'] = 0x0595; 17511 t['zaqefqatanhebrew'] = 0x0594; 17512 t['zarqahebrew'] = 0x0598; 17513 t['zayin'] = 0x05D6; 17514 t['zayindagesh'] = 0xFB36; 17515 t['zayindageshhebrew'] = 0xFB36; 17516 t['zayinhebrew'] = 0x05D6; 17517 t['zbopomofo'] = 0x3117; 17518 t['zcaron'] = 0x017E; 17519 t['zcircle'] = 0x24E9; 17520 t['zcircumflex'] = 0x1E91; 17521 t['zcurl'] = 0x0291; 17522 t['zdot'] = 0x017C; 17523 t['zdotaccent'] = 0x017C; 17524 t['zdotbelow'] = 0x1E93; 17525 t['zecyrillic'] = 0x0437; 17526 t['zedescendercyrillic'] = 0x0499; 17527 t['zedieresiscyrillic'] = 0x04DF; 17528 t['zehiragana'] = 0x305C;
17529 t['zekatakana'] = 0x30BC; 17530 t['zero'] = 0x0030; 17531 t['zeroarabic'] = 0x0660; 17532 t['zerobengali'] = 0x09E6; 17533 t['zerodeva'] = 0x0966; 17534 t['zerogujarati'] = 0x0AE6; 17535 t['zerogurmukhi'] = 0x0A66; 17536 t['zerohackarabic'] = 0x0660; 17537 t['zeroinferior'] = 0x2080; 17538 t['zeromonospace'] = 0xFF10; 17539 t['zerooldstyle'] = 0xF730; 17540 t['zeropersian'] = 0x06F0; 17541 t['zerosuperior'] = 0x2070; 17542 t['zerothai'] = 0x0E50; 17543 t['zerowidthjoiner'] = 0xFEFF; 17544 t['zerowidthnonjoiner'] = 0x200C; 17545 t['zerowidthspace'] = 0x200B; 17546 t['zeta'] = 0x03B6; 17547 t['zhbopomofo'] = 0x3113; 17548 t['zhearmenian'] = 0x056A; 17549 t['zhebrevecyrillic'] = 0x04C2; 17550 t['zhecyrillic'] = 0x0436; 17551 t['zhedescendercyrillic'] = 0x0497; 17552 t['zhedieresiscyrillic'] = 0x04DD; 17553 t['zihiragana'] = 0x3058; 17554 t['zikatakana'] = 0x30B8; 17555 t['zinorhebrew'] = 0x05AE; 17556 t['zlinebelow'] = 0x1E95; 17557 t['zmonospace'] = 0xFF5A; 17558 t['zohiragana'] = 0x305E; 17559 t['zokatakana'] = 0x30BE; 17560 t['zparen'] = 0x24B5; 17561 t['zretroflexhook'] = 0x0290; 17562 t['zstroke'] = 0x01B6; 17563 t['zuhiragana'] = 0x305A; 17564 t['zukatakana'] = 0x30BA; 17565 t['.notdef'] = 0x0000; 17566 t['angbracketleftbig'] = 0x2329; 17567 t['angbracketleftBig'] = 0x2329; 17568 t['angbracketleftbigg'] = 0x2329; 17569 t['angbracketleftBigg'] = 0x2329; 17570 t['angbracketrightBig'] = 0x232A; 17571 t['angbracketrightbig'] = 0x232A; 17572 t['angbracketrightBigg'] = 0x232A; 17573 t['angbracketrightbigg'] = 0x232A; 17574 t['arrowhookleft'] = 0x21AA; 17575 t['arrowhookright'] = 0x21A9; 17576 t['arrowlefttophalf'] = 0x21BC; 17577 t['arrowleftbothalf'] = 0x21BD; 17578 t['arrownortheast'] = 0x2197; 17579 t['arrownorthwest'] = 0x2196; 17580 t['arrowrighttophalf'] = 0x21C0; 17581 t['arrowrightbothalf'] = 0x21C1; 17582 t['arrowsoutheast'] = 0x2198; 17583 t['arrowsouthwest'] = 0x2199; 17584 t['backslashbig'] = 0x2216; 17585 t['backslashBig'] = 0x2216; 17586 t['backslashBigg'] = 0x2216; 17587 t['backslashbigg'] = 0x2216; 17588 t['bardbl'] = 0x2016; 17589 t['bracehtipdownleft'] = 0xFE37; 17590 t['bracehtipdownright'] = 0xFE37; 17591 t['bracehtipupleft'] = 0xFE38; 17592 t['bracehtipupright'] = 0xFE38; 17593 t['braceleftBig'] = 0x007B; 17594 t['braceleftbig'] = 0x007B; 17595 t['braceleftbigg'] = 0x007B; 17596 t['braceleftBigg'] = 0x007B; 17597 t['bracerightBig'] = 0x007D; 17598 t['bracerightbig'] = 0x007D; 17599 t['bracerightbigg'] = 0x007D; 17600 t['bracerightBigg'] = 0x007D; 17601 t['bracketleftbig'] = 0x005B; 17602 t['bracketleftBig'] = 0x005B; 17603 t['bracketleftbigg'] = 0x005B; 17604 t['bracketleftBigg'] = 0x005B; 17605 t['bracketrightBig'] = 0x005D; 17606 t['bracketrightbig'] = 0x005D; 17607 t['bracketrightbigg'] = 0x005D; 17608 t['bracketrightBigg'] = 0x005D; 17609 t['ceilingleftbig'] = 0x2308; 17610 t['ceilingleftBig'] = 0x2308; 17611 t['ceilingleftBigg'] = 0x2308; 17612 t['ceilingleftbigg'] = 0x2308; 17613 t['ceilingrightbig'] = 0x2309; 17614 t['ceilingrightBig'] = 0x2309; 17615 t['ceilingrightbigg'] = 0x2309; 17616 t['ceilingrightBigg'] = 0x2309; 17617 t['circledotdisplay'] = 0x2299; 17618 t['circledottext'] = 0x2299; 17619 t['circlemultiplydisplay'] = 0x2297; 17620 t['circlemultiplytext'] = 0x2297; 17621 t['circleplusdisplay'] = 0x2295; 17622 t['circleplustext'] = 0x2295; 17623 t['contintegraldisplay'] = 0x222E; 17624 t['contintegraltext'] = 0x222E; 17625 t['coproductdisplay'] = 0x2210; 17626 t['coproducttext'] = 0x2210; 17627 t['floorleftBig'] = 0x230A; 17628 t['floorleftbig'] = 0x230A; 17629 t['floorleftbigg'] = 0x230A; 17630 t['floorleftBigg'] = 0x230A; 17631 t['floorrightbig'] = 0x230B; 17632 t['floorrightBig'] = 0x230B; 17633 t['floorrightBigg'] = 0x230B; 17634 t['floorrightbigg'] = 0x230B; 17635 t['hatwide'] = 0x0302; 17636 t['hatwider'] = 0x0302; 17637 t['hatwidest'] = 0x0302; 17638 t['intercal'] = 0x1D40; 17639 t['integraldisplay'] = 0x222B; 17640 t['integraltext'] = 0x222B; 17641 t['intersectiondisplay'] = 0x22C2; 17642 t['intersectiontext'] = 0x22C2; 17643 t['logicalanddisplay'] = 0x2227; 17644 t['logicalandtext'] = 0x2227; 17645 t['logicalordisplay'] = 0x2228; 17646 t['logicalortext'] = 0x2228; 17647 t['parenleftBig'] = 0x0028; 17648 t['parenleftbig'] = 0x0028; 17649 t['parenleftBigg'] = 0x0028; 17650 t['parenleftbigg'] = 0x0028; 17651 t['parenrightBig'] = 0x0029; 17652 t['parenrightbig'] = 0x0029; 17653 t['parenrightBigg'] = 0x0029; 17654 t['parenrightbigg'] = 0x0029; 17655 t['prime'] = 0x2032; 17656 t['productdisplay'] = 0x220F; 17657 t['producttext'] = 0x220F; 17658 t['radicalbig'] = 0x221A; 17659 t['radicalBig'] = 0x221A; 17660 t['radicalBigg'] = 0x221A; 17661 t['radicalbigg'] = 0x221A; 17662 t['radicalbt'] = 0x221A; 17663 t['radicaltp'] = 0x221A; 17664 t['radicalvertex'] = 0x221A; 17665 t['slashbig'] = 0x002F; 17666 t['slashBig'] = 0x002F; 17667 t['slashBigg'] = 0x002F; 17668 t['slashbigg'] = 0x002F; 17669 t['summationdisplay'] = 0x2211; 17670 t['summationtext'] = 0x2211; 17671 t['tildewide'] = 0x02DC; 17672 t['tildewider'] = 0x02DC; 17673 t['tildewidest'] = 0x02DC; 17674 t['uniondisplay'] = 0x22C3; 17675 t['unionmultidisplay'] = 0x228E; 17676 t['unionmultitext'] = 0x228E; 17677 t['unionsqdisplay'] = 0x2294; 17678 t['unionsqtext'] = 0x2294; 17679 t['uniontext'] = 0x22C3; 17680 t['vextenddouble'] = 0x2225; 17681 t['vextendsingle'] = 0x2223; 17682}); 17683var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { 17684 t['space'] = 0x0020; 17685 t['a1'] = 0x2701; 17686 t['a2'] = 0x2702; 17687 t['a202'] = 0x2703; 17688 t['a3'] = 0x2704; 17689 t['a4'] = 0x260E; 17690 t['a5'] = 0x2706; 17691 t['a119'] = 0x2707; 17692 t['a118'] = 0x2708; 17693 t['a117'] = 0x2709; 17694 t['a11'] = 0x261B; 17695 t['a12'] = 0x261E; 17696 t['a13'] = 0x270C; 17697 t['a14'] = 0x270D; 17698 t['a15'] = 0x270E; 17699 t['a16'] = 0x270F; 17700 t['a105'] = 0x2710; 17701 t['a17'] = 0x2711; 17702 t['a18'] = 0x2712; 17703 t['a19'] = 0x2713; 17704 t['a20'] = 0x2714; 17705 t['a21'] = 0x2715; 17706 t['a22'] = 0x2716; 17707 t['a23'] = 0x2717; 17708 t['a24'] = 0x2718; 17709 t['a25'] = 0x2719; 17710 t['a26'] = 0x271A; 17711 t['a27'] = 0x271B; 17712 t['a28'] = 0x271C; 17713 t['a6'] = 0x271D; 17714 t['a7'] = 0x271E; 17715 t['a8'] = 0x271F; 17716 t['a9'] = 0x2720; 17717 t['a10'] = 0x2721; 17718 t['a29'] = 0x2722; 17719 t['a30'] = 0x2723; 17720 t['a31'] = 0x2724; 17721 t['a32'] = 0x2725; 17722 t['a33'] = 0x2726; 17723 t['a34'] = 0x2727; 17724 t['a35'] = 0x2605; 17725 t['a36'] = 0x2729; 17726 t['a37'] = 0x272A; 17727 t['a38'] = 0x272B; 17728 t['a39'] = 0x272C; 17729 t['a40'] = 0x272D; 17730 t['a41'] = 0x272E; 17731 t['a42'] = 0x272F; 17732 t['a43'] = 0x2730; 17733 t['a44'] = 0x2731; 17734 t['a45'] = 0x2732; 17735 t['a46'] = 0x2733; 17736 t['a47'] = 0x2734; 17737 t['a48'] = 0x2735; 17738 t['a49'] = 0x2736; 17739 t['a50'] = 0x2737; 17740 t['a51'] = 0x2738; 17741 t['a52'] = 0x2739; 17742 t['a53'] = 0x273A; 17743 t['a54'] = 0x273B; 17744 t['a55'] = 0x273C; 17745 t['a56'] = 0x273D; 17746 t['a57'] = 0x273E; 17747 t['a58'] = 0x273F; 17748 t['a59'] = 0x2740; 17749 t['a60'] = 0x2741; 17750 t['a61'] = 0x2742; 17751 t['a62'] = 0x2743; 17752 t['a63'] = 0x2744; 17753 t['a64'] = 0x2745; 17754 t['a65'] = 0x2746; 17755 t['a66'] = 0x2747; 17756 t['a67'] = 0x2748; 17757 t['a68'] = 0x2749; 17758 t['a69'] = 0x274A; 17759 t['a70'] = 0x274B; 17760 t['a71'] = 0x25CF; 17761 t['a72'] = 0x274D; 17762 t['a73'] = 0x25A0; 17763 t['a74'] = 0x274F; 17764 t['a203'] = 0x2750; 17765 t['a75'] = 0x2751; 17766 t['a204'] = 0x2752; 17767 t['a76'] = 0x25B2; 17768 t['a77'] = 0x25BC; 17769 t['a78'] = 0x25C6; 17770 t['a79'] = 0x2756; 17771 t['a81'] = 0x25D7; 17772 t['a82'] = 0x2758; 17773 t['a83'] = 0x2759; 17774 t['a84'] = 0x275A; 17775 t['a97'] = 0x275B; 17776 t['a98'] = 0x275C; 17777 t['a99'] = 0x275D; 17778 t['a100'] = 0x275E; 17779 t['a101'] = 0x2761; 17780 t['a102'] = 0x2762; 17781 t['a103'] = 0x2763; 17782 t['a104'] = 0x2764; 17783 t['a106'] = 0x2765; 17784 t['a107'] = 0x2766; 17785 t['a108'] = 0x2767; 17786 t['a112'] = 0x2663; 17787 t['a111'] = 0x2666; 17788 t['a110'] = 0x2665; 17789 t['a109'] = 0x2660; 17790 t['a120'] = 0x2460; 17791 t['a121'] = 0x2461; 17792 t['a122'] = 0x2462; 17793 t['a123'] = 0x2463; 17794 t['a124'] = 0x2464; 17795 t['a125'] = 0x2465; 17796 t['a126'] = 0x2466; 17797 t['a127'] = 0x2467; 17798 t['a128'] = 0x2468; 17799 t['a129'] = 0x2469; 17800 t['a130'] = 0x2776; 17801 t['a131'] = 0x2777; 17802 t['a132'] = 0x2778; 17803 t['a133'] = 0x2779; 17804 t['a134'] = 0x277A;
17805 t['a135'] = 0x277B; 17806 t['a136'] = 0x277C; 17807 t['a137'] = 0x277D; 17808 t['a138'] = 0x277E; 17809 t['a139'] = 0x277F; 17810 t['a140'] = 0x2780; 17811 t['a141'] = 0x2781; 17812 t['a142'] = 0x2782; 17813 t['a143'] = 0x2783; 17814 t['a144'] = 0x2784; 17815 t['a145'] = 0x2785; 17816 t['a146'] = 0x2786; 17817 t['a147'] = 0x2787; 17818 t['a148'] = 0x2788; 17819 t['a149'] = 0x2789; 17820 t['a150'] = 0x278A; 17821 t['a151'] = 0x278B; 17822 t['a152'] = 0x278C; 17823 t['a153'] = 0x278D; 17824 t['a154'] = 0x278E; 17825 t['a155'] = 0x278F; 17826 t['a156'] = 0x2790; 17827 t['a157'] = 0x2791; 17828 t['a158'] = 0x2792; 17829 t['a159'] = 0x2793; 17830 t['a160'] = 0x2794; 17831 t['a161'] = 0x2192; 17832 t['a163'] = 0x2194; 17833 t['a164'] = 0x2195; 17834 t['a196'] = 0x2798; 17835 t['a165'] = 0x2799; 17836 t['a192'] = 0x279A; 17837 t['a166'] = 0x279B; 17838 t['a167'] = 0x279C; 17839 t['a168'] = 0x279D; 17840 t['a169'] = 0x279E; 17841 t['a170'] = 0x279F; 17842 t['a171'] = 0x27A0; 17843 t['a172'] = 0x27A1; 17844 t['a173'] = 0x27A2; 17845 t['a162'] = 0x27A3; 17846 t['a174'] = 0x27A4; 17847 t['a175'] = 0x27A5; 17848 t['a176'] = 0x27A6; 17849 t['a177'] = 0x27A7; 17850 t['a178'] = 0x27A8; 17851 t['a179'] = 0x27A9; 17852 t['a193'] = 0x27AA; 17853 t['a180'] = 0x27AB; 17854 t['a199'] = 0x27AC; 17855 t['a181'] = 0x27AD; 17856 t['a200'] = 0x27AE; 17857 t['a182'] = 0x27AF; 17858 t['a201'] = 0x27B1; 17859 t['a183'] = 0x27B2; 17860 t['a184'] = 0x27B3; 17861 t['a197'] = 0x27B4; 17862 t['a185'] = 0x27B5; 17863 t['a194'] = 0x27B6; 17864 t['a198'] = 0x27B7; 17865 t['a186'] = 0x27B8; 17866 t['a195'] = 0x27B9; 17867 t['a187'] = 0x27BA; 17868 t['a188'] = 0x27BB; 17869 t['a189'] = 0x27BC; 17870 t['a190'] = 0x27BD; 17871 t['a191'] = 0x27BE; 17872 t['a89'] = 0x2768; 17873 t['a90'] = 0x2769; 17874 t['a93'] = 0x276A; 17875 t['a94'] = 0x276B; 17876 t['a91'] = 0x276C; 17877 t['a92'] = 0x276D; 17878 t['a205'] = 0x276E; 17879 t['a85'] = 0x276F; 17880 t['a206'] = 0x2770; 17881 t['a86'] = 0x2771; 17882 t['a87'] = 0x2772; 17883 t['a88'] = 0x2773; 17884 t['a95'] = 0x2774; 17885 t['a96'] = 0x2775; 17886 t['.notdef'] = 0x0000; 17887}); 17888exports.getGlyphsUnicode = getGlyphsUnicode; 17889exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; 17890 17891/***/ }), 17892/* 8 */ 17893/***/ (function(module, exports, __w_pdfjs_require__) { 17894 17895"use strict"; 17896 17897var sharedUtil = __w_pdfjs_require__(0); 17898var corePrimitives = __w_pdfjs_require__(1); 17899var corePdfManager = __w_pdfjs_require__(33); 17900var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; 17901var InvalidPDFException = sharedUtil.InvalidPDFException; 17902var MessageHandler = sharedUtil.MessageHandler; 17903var MissingPDFException = sharedUtil.MissingPDFException; 17904var UnexpectedResponseException = sharedUtil.UnexpectedResponseException; 17905var PasswordException = sharedUtil.PasswordException; 17906var UnknownErrorException = sharedUtil.UnknownErrorException; 17907var XRefParseException = sharedUtil.XRefParseException; 17908var arrayByteLength = sharedUtil.arrayByteLength; 17909var arraysToBytes = sharedUtil.arraysToBytes; 17910var assert = sharedUtil.assert; 17911var createPromiseCapability = sharedUtil.createPromiseCapability; 17912var info = sharedUtil.info; 17913var warn = sharedUtil.warn; 17914var setVerbosityLevel = sharedUtil.setVerbosityLevel; 17915var isNodeJS = sharedUtil.isNodeJS; 17916var Ref = corePrimitives.Ref; 17917var LocalPdfManager = corePdfManager.LocalPdfManager; 17918var NetworkPdfManager = corePdfManager.NetworkPdfManager; 17919var WorkerTask = function WorkerTaskClosure() { 17920 function WorkerTask(name) { 17921 this.name = name; 17922 this.terminated = false; 17923 this._capability = createPromiseCapability(); 17924 } 17925 WorkerTask.prototype = { 17926 get finished() { 17927 return this._capability.promise; 17928 }, 17929 finish: function () { 17930 this._capability.resolve(); 17931 }, 17932 terminate: function () { 17933 this.terminated = true; 17934 }, 17935 ensureNotTerminated: function () { 17936 if (this.terminated) { 17937 throw new Error('Worker task was terminated'); 17938 } 17939 } 17940 }; 17941 return WorkerTask; 17942}(); 17943var PDFWorkerStream = function PDFWorkerStreamClosure() { 17944 function PDFWorkerStream(params, msgHandler) { 17945 this._queuedChunks = []; 17946 var initialData = params.initialData; 17947 if (initialData && initialData.length > 0) { 17948 this._queuedChunks.push(initialData); 17949 } 17950 this._msgHandler = msgHandler; 17951 this._isRangeSupported = !params.disableRange; 17952 this._isStreamingSupported = !params.disableStream; 17953 this._contentLength = params.length; 17954 this._fullRequestReader = null; 17955 this._rangeReaders = []; 17956 msgHandler.on('OnDataRange', this._onReceiveData.bind(this));
17957 msgHandler.on('OnDataProgress', this._onProgress.bind(this)); 17958 } 17959 PDFWorkerStream.prototype = { 17960 _onReceiveData: function PDFWorkerStream_onReceiveData(args) { 17961 if (args.begin === undefined) { 17962 if (this._fullRequestReader) { 17963 this._fullRequestReader._enqueue(args.chunk); 17964 } else { 17965 this._queuedChunks.push(args.chunk); 17966 } 17967 } else { 17968 var found = this._rangeReaders.some(function (rangeReader) { 17969 if (rangeReader._begin !== args.begin) { 17970 return false; 17971 } 17972 rangeReader._enqueue(args.chunk); 17973 return true; 17974 }); 17975 assert(found); 17976 } 17977 }, 17978 _onProgress: function PDFWorkerStream_onProgress(evt) { 17979 if (this._rangeReaders.length > 0) { 17980 var firstReader = this._rangeReaders[0]; 17981 if (firstReader.onProgress) { 17982 firstReader.onProgress({ loaded: evt.loaded }); 17983 } 17984 } 17985 }, 17986 _removeRangeReader: function PDFWorkerStream_removeRangeReader(reader) { 17987 var i = this._rangeReaders.indexOf(reader); 17988 if (i >= 0) { 17989 this._rangeReaders.splice(i, 1); 17990 } 17991 }, 17992 getFullReader: function PDFWorkerStream_getFullReader() { 17993 assert(!this._fullRequestReader); 17994 var queuedChunks = this._queuedChunks; 17995 this._queuedChunks = null; 17996 return new PDFWorkerStreamReader(this, queuedChunks); 17997 }, 17998 getRangeReader: function PDFWorkerStream_getRangeReader(begin, end) { 17999 var reader = new PDFWorkerStreamRangeReader(this, begin, end); 18000 this._msgHandler.send('RequestDataRange', { 18001 begin: begin, 18002 end: end 18003 }); 18004 this._rangeReaders.push(reader); 18005 return reader; 18006 }, 18007 cancelAllRequests: function PDFWorkerStream_cancelAllRequests(reason) { 18008 if (this._fullRequestReader) { 18009 this._fullRequestReader.cancel(reason); 18010 } 18011 var readers = this._rangeReaders.slice(0); 18012 readers.forEach(function (rangeReader) { 18013 rangeReader.cancel(reason); 18014 }); 18015 } 18016 }; 18017 function PDFWorkerStreamReader(stream, queuedChunks) { 18018 this._stream = stream; 18019 this._done = false; 18020 this._queuedChunks = queuedChunks || []; 18021 this._requests = []; 18022 this._headersReady = Promise.resolve(); 18023 stream._fullRequestReader = this; 18024 this.onProgress = null; 18025 } 18026 PDFWorkerStreamReader.prototype = { 18027 _enqueue: function PDFWorkerStreamReader_enqueue(chunk) { 18028 if (this._done) { 18029 return; 18030 } 18031 if (this._requests.length > 0) { 18032 var requestCapability = this._requests.shift(); 18033 requestCapability.resolve({ 18034 value: chunk, 18035 done: false 18036 }); 18037 return; 18038 } 18039 this._queuedChunks.push(chunk); 18040 }, 18041 get headersReady() { 18042 return this._headersReady; 18043 }, 18044 get isRangeSupported() { 18045 return this._stream._isRangeSupported; 18046 }, 18047 get isStreamingSupported() { 18048 return this._stream._isStreamingSupported; 18049 }, 18050 get contentLength() { 18051 return this._stream._contentLength; 18052 }, 18053 read: function PDFWorkerStreamReader_read() { 18054 if (this._queuedChunks.length > 0) { 18055 var chunk = this._queuedChunks.shift(); 18056 return Promise.resolve({ 18057 value: chunk, 18058 done: false 18059 }); 18060 } 18061 if (this._done) { 18062 return Promise.resolve({ 18063 value: undefined, 18064 done: true 18065 }); 18066 } 18067 var requestCapability = createPromiseCapability(); 18068 this._requests.push(requestCapability); 18069 return requestCapability.promise; 18070 }, 18071 cancel: function PDFWorkerStreamReader_cancel(reason) { 18072 this._done = true; 18073 this._requests.forEach(function (requestCapability) { 18074 requestCapability.resolve({ 18075 value: undefined, 18076 done: true 18077 }); 18078 }); 18079 this._requests = []; 18080 } 18081 }; 18082 function PDFWorkerStreamRangeReader(stream, begin, end) { 18083 this._stream = stream; 18084 this._begin = begin; 18085 this._end = end; 18086 this._queuedChunk = null; 18087 this._requests = []; 18088 this._done = false; 18089 this.onProgress = null; 18090 } 18091 PDFWorkerStreamRangeReader.prototype = { 18092 _enqueue: function PDFWorkerStreamRangeReader_enqueue(chunk) { 18093 if (this._done) { 18094 return; 18095 } 18096 if (this._requests.length === 0) { 18097 this._queuedChunk = chunk; 18098 } else { 18099 var requestsCapability = this._requests.shift(); 18100 requestsCapability.resolve({ 18101 value: chunk, 18102 done: false 18103 }); 18104 this._requests.forEach(function (requestCapability) { 18105 requestCapability.resolve({ 18106 value: undefined, 18107 done: true 18108 }); 18109 }); 18110 this._requests = []; 18111 } 18112 this._done = true; 18113 this._stream._removeRangeReader(this); 18114 }, 18115 get isStreamingSupported() { 18116 return false;
18117 }, 18118 read: function PDFWorkerStreamRangeReader_read() { 18119 if (this._queuedChunk) { 18120 return Promise.resolve({ 18121 value: this._queuedChunk, 18122 done: false 18123 }); 18124 } 18125 if (this._done) { 18126 return Promise.resolve({ 18127 value: undefined, 18128 done: true 18129 }); 18130 } 18131 var requestCapability = createPromiseCapability(); 18132 this._requests.push(requestCapability); 18133 return requestCapability.promise; 18134 }, 18135 cancel: function PDFWorkerStreamRangeReader_cancel(reason) { 18136 this._done = true; 18137 this._requests.forEach(function (requestCapability) { 18138 requestCapability.resolve({ 18139 value: undefined, 18140 done: true 18141 }); 18142 }); 18143 this._requests = []; 18144 this._stream._removeRangeReader(this); 18145 } 18146 }; 18147 return PDFWorkerStream; 18148}(); 18149var PDFNetworkStream; 18150function setPDFNetworkStreamClass(cls) { 18151 PDFNetworkStream = cls; 18152} 18153var WorkerMessageHandler = { 18154 setup: function wphSetup(handler, port) { 18155 var testMessageProcessed = false; 18156 handler.on('test', function wphSetupTest(data) { 18157 if (testMessageProcessed) { 18158 return; 18159 } 18160 testMessageProcessed = true; 18161 if (!(data instanceof Uint8Array)) { 18162 handler.send('test', 'main', false); 18163 return; 18164 } 18165 var supportTransfers = data[0] === 255; 18166 handler.postMessageTransfers = supportTransfers; 18167 var xhr = new XMLHttpRequest(); 18168 var responseExists = 'response' in xhr; 18169 try { 18170 xhr.responseType; 18171 } catch (e) { 18172 responseExists = false; 18173 } 18174 if (!responseExists) { 18175 handler.send('test', false); 18176 return; 18177 } 18178 handler.send('test', { 18179 supportTypedArray: true, 18180 supportTransfers: supportTransfers 18181 }); 18182 }); 18183 handler.on('configure', function wphConfigure(data) { 18184 setVerbosityLevel(data.verbosity); 18185 }); 18186 handler.on('GetDocRequest', function wphSetupDoc(data) { 18187 return WorkerMessageHandler.createDocumentHandler(data, port); 18188 }); 18189 }, 18190 createDocumentHandler: function wphCreateDocumentHandler(docParams, port) { 18191 var pdfManager; 18192 var terminated = false; 18193 var cancelXHRs = null; 18194 var WorkerTasks = []; 18195 var docId = docParams.docId; 18196 var docBaseUrl = docParams.docBaseUrl; 18197 var workerHandlerName = docParams.docId + '_worker'; 18198 var handler = new MessageHandler(workerHandlerName, docId, port); 18199 handler.postMessageTransfers = docParams.postMessageTransfers; 18200 function ensureNotTerminated() { 18201 if (terminated) { 18202 throw new Error('Worker was terminated'); 18203 } 18204 } 18205 function startWorkerTask(task) { 18206 WorkerTasks.push(task); 18207 } 18208 function finishWorkerTask(task) { 18209 task.finish(); 18210 var i = WorkerTasks.indexOf(task); 18211 WorkerTasks.splice(i, 1); 18212 } 18213 function loadDocument(recoveryMode) { 18214 var loadDocumentCapability = createPromiseCapability(); 18215 var parseSuccess = function parseSuccess() { 18216 var numPagesPromise = pdfManager.ensureDoc('numPages'); 18217 var fingerprintPromise = pdfManager.ensureDoc('fingerprint'); 18218 var encryptedPromise = pdfManager.ensureXRef('encrypt'); 18219 Promise.all([ 18220 numPagesPromise, 18221 fingerprintPromise, 18222 encryptedPromise 18223 ]).then(function onDocReady(results) { 18224 var doc = { 18225 numPages: results[0], 18226 fingerprint: results[1], 18227 encrypted: !!results[2] 18228 }; 18229 loadDocumentCapability.resolve(doc); 18230 }, parseFailure); 18231 }; 18232 var parseFailure = function parseFailure(e) { 18233 loadDocumentCapability.reject(e); 18234 }; 18235 pdfManager.ensureDoc('checkHeader', []).then(function () { 18236 pdfManager.ensureDoc('parseStartXRef', []).then(function () { 18237 pdfManager.ensureDoc('parse', [recoveryMode]).then(parseSuccess, parseFailure); 18238 }, parseFailure); 18239 }, parseFailure); 18240 return loadDocumentCapability.promise; 18241 } 18242 function getPdfManager(data, evaluatorOptions) { 18243 var pdfManagerCapability = createPromiseCapability(); 18244 var pdfManager; 18245 var source = data.source; 18246 if (source.data) { 18247 try { 18248 pdfManager = new LocalPdfManager(docId, source.data, source.password, evaluatorOptions, docBaseUrl); 18249 pdfManagerCapability.resolve(pdfManager); 18250 } catch (ex) { 18251 pdfManagerCapability.reject(ex); 18252 } 18253 return pdfManagerCapability.promise; 18254 } 18255 var pdfStream; 18256 try { 18257 if (source.chunkedViewerLoading) { 18258 pdfStream = new PDFWorkerStream(source, handler); 18259 } else { 18260 assert(PDFNetworkStream, 'pdfjs/core/network module is not loaded'); 18261 pdfStream = new PDFNetworkStream(data); 18262 } 18263 } catch (ex) { 18264 pdfManagerCapability.reject(ex); 18265 return pdfManagerCapability.promise; 18266 } 18267 var fullRequest = pdfStream.getFullReader(); 18268 fullRequest.headersReady.then(function () { 18269 if (!fullRequest.isStreamingSupported || !fullRequest.isRangeSupported) { 18270 fullRequest.onProgress = function (evt) { 18271 handler.send('DocProgress', { 18272 loaded: evt.loaded, 18273 total: evt.total 18274 }); 18275 }; 18276 } 18277 if (!fullRequest.isRangeSupported) { 18278 return; 18279 } 18280 var disableAutoFetch = source.disableAutoFetch || fullRequest.isStreamingSupported; 18281 pdfManager = new NetworkPdfManager(docId, pdfStream, { 18282 msgHandler: handler, 18283 url: source.url, 18284 password: source.password, 18285 length: fullRequest.contentLength, 18286 disableAutoFetch: disableAutoFetch,
18287 rangeChunkSize: source.rangeChunkSize 18288 }, evaluatorOptions, docBaseUrl); 18289 pdfManagerCapability.resolve(pdfManager); 18290 cancelXHRs = null; 18291 }).catch(function (reason) { 18292 pdfManagerCapability.reject(reason); 18293 cancelXHRs = null; 18294 }); 18295 var cachedChunks = [], loaded = 0; 18296 var flushChunks = function () { 18297 var pdfFile = arraysToBytes(cachedChunks); 18298 if (source.length && pdfFile.length !== source.length) { 18299 warn('reported HTTP length is different from actual'); 18300 } 18301 try { 18302 pdfManager = new LocalPdfManager(docId, pdfFile, source.password, evaluatorOptions, docBaseUrl); 18303 pdfManagerCapability.resolve(pdfManager); 18304 } catch (ex) { 18305 pdfManagerCapability.reject(ex); 18306 } 18307 cachedChunks = []; 18308 }; 18309 var readPromise = new Promise(function (resolve, reject) { 18310 var readChunk = function (chunk) { 18311 try { 18312 ensureNotTerminated(); 18313 if (chunk.done) { 18314 if (!pdfManager) { 18315 flushChunks(); 18316 } 18317 cancelXHRs = null; 18318 return; 18319 } 18320 var data = chunk.value; 18321 loaded += arrayByteLength(data); 18322 if (!fullRequest.isStreamingSupported) { 18323 handler.send('DocProgress', { 18324 loaded: loaded, 18325 total: Math.max(loaded, fullRequest.contentLength || 0) 18326 }); 18327 } 18328 if (pdfManager) { 18329 pdfManager.sendProgressiveData(data); 18330 } else { 18331 cachedChunks.push(data); 18332 } 18333 fullRequest.read().then(readChunk, reject); 18334 } catch (e) { 18335 reject(e); 18336 } 18337 }; 18338 fullRequest.read().then(readChunk, reject); 18339 }); 18340 readPromise.catch(function (e) { 18341 pdfManagerCapability.reject(e); 18342 cancelXHRs = null; 18343 }); 18344 cancelXHRs = function () { 18345 pdfStream.cancelAllRequests('abort'); 18346 }; 18347 return pdfManagerCapability.promise; 18348 } 18349 function setupDoc(data) { 18350 function onSuccess(doc) { 18351 ensureNotTerminated(); 18352 handler.send('GetDoc', { pdfInfo: doc }); 18353 } 18354 function onFailure(e) { 18355 if (e instanceof PasswordException) { 18356 var task = new WorkerTask('PasswordException: response ' + e.code); 18357 startWorkerTask(task); 18358 handler.sendWithPromise('PasswordRequest', e).then(function (data) { 18359 finishWorkerTask(task); 18360 pdfManager.updatePassword(data.password); 18361 pdfManagerReady(); 18362 }).catch(function (ex) { 18363 finishWorkerTask(task); 18364 handler.send('PasswordException', ex); 18365 }.bind(null, e)); 18366 } else if (e instanceof InvalidPDFException) { 18367 handler.send('InvalidPDF', e); 18368 } else if (e instanceof MissingPDFException) { 18369 handler.send('MissingPDF', e); 18370 } else if (e instanceof UnexpectedResponseException) { 18371 handler.send('UnexpectedResponse', e); 18372 } else { 18373 handler.send('UnknownError', new UnknownErrorException(e.message, e.toString())); 18374 } 18375 } 18376 function pdfManagerReady() { 18377 ensureNotTerminated(); 18378 loadDocument(false).then(onSuccess, function loadFailure(ex) { 18379 ensureNotTerminated(); 18380 if (!(ex instanceof XRefParseException)) { 18381 onFailure(ex); 18382 return; 18383 } 18384 pdfManager.requestLoadedStream(); 18385 pdfManager.onLoadedStream().then(function () { 18386 ensureNotTerminated(); 18387 loadDocument(true).then(onSuccess, onFailure); 18388 }); 18389 }, onFailure); 18390 } 18391 ensureNotTerminated(); 18392 var evaluatorOptions = { 18393 forceDataSchema: data.disableCreateObjectURL, 18394 maxImageSize: data.maxImageSize === undefined ? -1 : data.maxImageSize, 18395 disableFontFace: data.disableFontFace, 18396 disableNativeImageDecoder: data.disableNativeImageDecoder 18397 }; 18398 getPdfManager(data, evaluatorOptions).then(function (newPdfManager) { 18399 if (terminated) { 18400 newPdfManager.terminate(); 18401 throw new Error('Worker was terminated'); 18402 } 18403 pdfManager = newPdfManager; 18404 handler.send('PDFManagerReady', null); 18405 pdfManager.onLoadedStream().then(function (stream) { 18406 handler.send('DataLoaded', { length: stream.bytes.byteLength }); 18407 }); 18408 }).then(pdfManagerReady, onFailure); 18409 } 18410 handler.on('GetPage', function wphSetupGetPage(data) { 18411 return pdfManager.getPage(data.pageIndex).then(function (page) { 18412 var rotatePromise = pdfManager.ensure(page, 'rotate'); 18413 var refPromise = pdfManager.ensure(page, 'ref'); 18414 var userUnitPromise = pdfManager.ensure(page, 'userUnit'); 18415 var viewPromise = pdfManager.ensure(page, 'view'); 18416 return Promise.all([ 18417 rotatePromise, 18418 refPromise, 18419 userUnitPromise, 18420 viewPromise 18421 ]).then(function (results) { 18422 return { 18423 rotate: results[0], 18424 ref: results[1], 18425 userUnit: results[2], 18426 view: results[3] 18427 }; 18428 }); 18429 }); 18430 }); 18431 handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { 18432 var ref = new Ref(data.ref.num, data.ref.gen); 18433 var catalog = pdfManager.pdfDocument.catalog; 18434 return catalog.getPageIndex(ref); 18435 }); 18436 handler.on('GetDestinations', function wphSetupGetDestinations(data) { 18437 return pdfManager.ensureCatalog('destinations'); 18438 }); 18439 handler.on('GetDestination', function wphSetupGetDestination(data) { 18440 return pdfManager.ensureCatalog('getDestination', [data.id]); 18441 }); 18442 handler.on('GetPageLabels', function wphSetupGetPageLabels(data) { 18443 return pdfManager.ensureCatalog('pageLabels'); 18444 }); 18445 handler.on('GetAttachments', function wphSetupGetAttachments(data) { 18446 return pdfManager.ensureCatalog('attachments'); 18447 }); 18448 handler.on('GetJavaScript', function wphSetupGetJavaScript(data) { 18449 return pdfManager.ensureCatalog('javaScript'); 18450 }); 18451 handler.on('GetOutline', function wphSetupGetOutline(data) { 18452 return pdfManager.ensureCatalog('documentOutline'); 18453 }); 18454 handler.on('GetMetadata', function wphSetupGetMetadata(data) { 18455 return Promise.all([ 18456 pdfManager.ensureDoc('documentInfo'), 18457 pdfManager.ensureCatalog('metadata') 18458 ]); 18459 }); 18460 handler.on('GetData', function wphSetupGetData(data) { 18461 pdfManager.requestLoadedStream(); 18462 return pdfManager.onLoadedStream().then(function (stream) { 18463 return stream.bytes; 18464 }); 18465 }); 18466 handler.on('GetStats', function wphSetupGetStats(data) { 18467 return pdfManager.pdfDocument.xref.stats; 18468 }); 18469 handler.on('GetAnnotations', function wphSetupGetAnnotations(data) { 18470 return pdfManager.getPage(data.pageIndex).then(function (page) { 18471 return pdfManager.ensure(page, 'getAnnotationsData', [data.intent]); 18472 }); 18473 }); 18474 handler.on('RenderPageRequest', function wphSetupRenderPage(data) { 18475 var pageIndex = data.pageIndex; 18476 pdfManager.getPage(pageIndex).then(function (page) { 18477 var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); 18478 startWorkerTask(task); 18479 var pageNum = pageIndex + 1; 18480 var start = Date.now(); 18481 page.getOperatorList(handler, task, data.intent, data.renderInteractiveForms).then(function (operatorList) { 18482 finishWorkerTask(task); 18483 info('page=' + pageNum + ' - getOperatorList: time=' + (Date.now() - start) + 'ms, len=' + operatorList.totalLength); 18484 }, function (e) { 18485 finishWorkerTask(task); 18486 if (task.terminated) { 18487 return; 18488 } 18489 handler.send('UnsupportedFeature', { featureId: UNSUPPORTED_FEATURES.unknown }); 18490 var minimumStackMessage = 'worker.js: while trying to getPage() and getOperatorList()'; 18491 var wrappedException; 18492 if (typeof e === 'string') { 18493 wrappedException = { 18494 message: e, 18495 stack: minimumStackMessage 18496 }; 18497 } else if (typeof e === 'object') { 18498 wrappedException = { 18499 message: e.message || e.toString(), 18500 stack: e.stack || minimumStackMessage 18501 }; 18502 } else { 18503 wrappedException = { 18504 message: 'Unknown exception type: ' + typeof e, 18505 stack: minimumStackMessage 18506 }; 18507 } 18508 handler.send('PageError', { 18509 pageNum: pageNum, 18510 error: wrappedException, 18511 intent: data.intent 18512 }); 18513 }); 18514 }); 18515 }, this); 18516 handler.on('GetTextContent', function wphExtractText(data) { 18517 var pageIndex = data.pageIndex; 18518 var normalizeWhitespace = data.normalizeWhitespace; 18519 var combineTextItems = data.combineTextItems; 18520 return pdfManager.getPage(pageIndex).then(function (page) { 18521 var task = new WorkerTask('GetTextContent: page ' + pageIndex); 18522 startWorkerTask(task); 18523 var pageNum = pageIndex + 1; 18524 var start = Date.now(); 18525 return page.extractTextContent(task, normalizeWhitespace, combineTextItems).then(function (textContent) { 18526 finishWorkerTask(task); 18527 info('text indexing: page=' + pageNum + ' - time=' + (Date.now() - start) + 'ms'); 18528 return textContent; 18529 }, function (reason) { 18530 finishWorkerTask(task); 18531 if (task.terminated) { 18532 return; 18533 } 18534 throw reason; 18535 }); 18536 }); 18537 }); 18538 handler.on('Cleanup', function wphCleanup(data) { 18539 return pdfManager.cleanup(); 18540 }); 18541 handler.on('Terminate', function wphTerminate(data) { 18542 terminated = true; 18543 if (pdfManager) { 18544 pdfManager.terminate(); 18545 pdfManager = null; 18546 } 18547 if (cancelXHRs) { 18548 cancelXHRs(); 18549 } 18550 var waitOn = []; 18551 WorkerTasks.forEach(function (task) { 18552 waitOn.push(task.finished); 18553 task.terminate(); 18554 }); 18555 return Promise.all(waitOn).then(function () { 18556 handler.destroy(); 18557 handler = null; 18558 }); 18559 }); 18560 handler.on('Ready', function wphReady(data) { 18561 setupDoc(docParams); 18562 docParams = null; 18563 }); 18564 return workerHandlerName; 18565 } 18566}; 18567function initializeWorker() { 18568 var handler = new MessageHandler('worker', 'main', self); 18569 WorkerMessageHandler.setup(handler, self); 18570 handler.send('ready', null); 18571} 18572if (typeof window === 'undefined' && !isNodeJS()) { 18573 initializeWorker(); 18574} 18575exports.setPDFNetworkStreamClass = setPDFNetworkStreamClass;
18576exports.WorkerTask = WorkerTask; 18577exports.WorkerMessageHandler = WorkerMessageHandler; 18578 18579/***/ }), 18580/* 9 */ 18581/***/ (function(module, exports) { 18582 18583var g; 18584g = function () { 18585 return this; 18586}(); 18587try { 18588 g = g || Function("return this")() || (1, eval)("this"); 18589} catch (e) { 18590 if (typeof window === "object") 18591 g = window; 18592} 18593module.exports = g; 18594 18595/***/ }), 18596/* 10 */ 18597/***/ (function(module, exports, __w_pdfjs_require__) { 18598 18599"use strict"; 18600 18601var ArithmeticDecoder = function ArithmeticDecoderClosure() { 18602 var QeTable = [ 18603 { 18604 qe: 0x5601, 18605 nmps: 1, 18606 nlps: 1, 18607 switchFlag: 1 18608 }, 18609 { 18610 qe: 0x3401, 18611 nmps: 2, 18612 nlps: 6, 18613 switchFlag: 0 18614 }, 18615 { 18616 qe: 0x1801, 18617 nmps: 3, 18618 nlps: 9, 18619 switchFlag: 0 18620 }, 18621 { 18622 qe: 0x0AC1, 18623 nmps: 4, 18624 nlps: 12, 18625 switchFlag: 0 18626 }, 18627 { 18628 qe: 0x0521, 18629 nmps: 5, 18630 nlps: 29, 18631 switchFlag: 0 18632 }, 18633 { 18634 qe: 0x0221, 18635 nmps: 38, 18636 nlps: 33, 18637 switchFlag: 0 18638 }, 18639 { 18640 qe: 0x5601, 18641 nmps: 7, 18642 nlps: 6, 18643 switchFlag: 1 18644 }, 18645 { 18646 qe: 0x5401, 18647 nmps: 8, 18648 nlps: 14, 18649 switchFlag: 0 18650 }, 18651 { 18652 qe: 0x4801, 18653 nmps: 9, 18654 nlps: 14, 18655 switchFlag: 0 18656 }, 18657 { 18658 qe: 0x3801, 18659 nmps: 10, 18660 nlps: 14, 18661 switchFlag: 0 18662 }, 18663 { 18664 qe: 0x3001, 18665 nmps: 11, 18666 nlps: 17, 18667 switchFlag: 0 18668 }, 18669 { 18670 qe: 0x2401, 18671 nmps: 12, 18672 nlps: 18, 18673 switchFlag: 0 18674 }, 18675 { 18676 qe: 0x1C01, 18677 nmps: 13, 18678 nlps: 20, 18679 switchFlag: 0 18680 }, 18681 { 18682 qe: 0x1601, 18683 nmps: 29, 18684 nlps: 21, 18685 switchFlag: 0 18686 }, 18687 { 18688 qe: 0x5601, 18689 nmps: 15, 18690 nlps: 14, 18691 switchFlag: 1 18692 }, 18693 { 18694 qe: 0x5401, 18695 nmps: 16, 18696 nlps: 14, 18697 switchFlag: 0 18698 }, 18699 { 18700 qe: 0x5101, 18701 nmps: 17, 18702 nlps: 15, 18703 switchFlag: 0 18704 }, 18705 { 18706 qe: 0x4801, 18707 nmps: 18, 18708 nlps: 16, 18709 switchFlag: 0 18710 }, 18711 { 18712 qe: 0x3801, 18713 nmps: 19, 18714 nlps: 17, 18715 switchFlag: 0 18716 }, 18717 { 18718 qe: 0x3401, 18719 nmps: 20, 18720 nlps: 18, 18721 switchFlag: 0 18722 }, 18723 { 18724 qe: 0x3001, 18725 nmps: 21, 18726 nlps: 19, 18727 switchFlag: 0 18728 }, 18729 { 18730 qe: 0x2801, 18731 nmps: 22, 18732 nlps: 19, 18733 switchFlag: 0 18734 }, 18735 { 18736 qe: 0x2401, 18737 nmps: 23, 18738 nlps: 20, 18739 switchFlag: 0 18740 }, 18741 { 18742 qe: 0x2201, 18743 nmps: 24, 18744 nlps: 21, 18745 switchFlag: 0 18746 }, 18747 { 18748 qe: 0x1C01, 18749 nmps: 25, 18750 nlps: 22, 18751 switchFlag: 0 18752 }, 18753 { 18754 qe: 0x1801, 18755 nmps: 26, 18756 nlps: 23, 18757 switchFlag: 0 18758 }, 18759 { 18760 qe: 0x1601, 18761 nmps: 27, 18762 nlps: 24, 18763 switchFlag: 0 18764 }, 18765 { 18766 qe: 0x1401, 18767 nmps: 28, 18768 nlps: 25, 18769 switchFlag: 0 18770 }, 18771 { 18772 qe: 0x1201, 18773 nmps: 29, 18774 nlps: 26, 18775 switchFlag: 0 18776 }, 18777 { 18778 qe: 0x1101, 18779 nmps: 30, 18780 nlps: 27, 18781 switchFlag: 0 18782 }, 18783 { 18784 qe: 0x0AC1, 18785 nmps: 31, 18786 nlps: 28, 18787 switchFlag: 0 18788 }, 18789 { 18790 qe: 0x09C1, 18791 nmps: 32, 18792 nlps: 29, 18793 switchFlag: 0 18794 }, 18795 { 18796 qe: 0x08A1, 18797 nmps: 33, 18798 nlps: 30, 18799 switchFlag: 0 18800 }, 18801 { 18802 qe: 0x0521, 18803 nmps: 34, 18804 nlps: 31, 18805 switchFlag: 0 18806 }, 18807 { 18808 qe: 0x0441, 18809 nmps: 35, 18810 nlps: 32, 18811 switchFlag: 0 18812 }, 18813 { 18814 qe: 0x02A1, 18815 nmps: 36, 18816 nlps: 33, 18817 switchFlag: 0 18818 }, 18819 { 18820 qe: 0x0221, 18821 nmps: 37, 18822 nlps: 34, 18823 switchFlag: 0 18824 }, 18825 { 18826 qe: 0x0141, 18827 nmps: 38, 18828 nlps: 35, 18829 switchFlag: 0 18830 }, 18831 { 18832 qe: 0x0111, 18833 nmps: 39, 18834 nlps: 36, 18835 switchFlag: 0 18836 }, 18837 { 18838 qe: 0x0085, 18839 nmps: 40, 18840 nlps: 37, 18841 switchFlag: 0 18842 }, 18843 { 18844 qe: 0x0049, 18845 nmps: 41, 18846 nlps: 38, 18847 switchFlag: 0 18848 }, 18849 { 18850 qe: 0x0025, 18851 nmps: 42, 18852 nlps: 39, 18853 switchFlag: 0 18854 }, 18855 { 18856 qe: 0x0015, 18857 nmps: 43, 18858 nlps: 40, 18859 switchFlag: 0 18860 }, 18861 { 18862 qe: 0x0009, 18863 nmps: 44, 18864 nlps: 41, 18865 switchFlag: 0 18866 }, 18867 { 18868 qe: 0x0005, 18869 nmps: 45, 18870 nlps: 42, 18871 switchFlag: 0 18872 }, 18873 { 18874 qe: 0x0001, 18875 nmps: 45, 18876 nlps: 43, 18877 switchFlag: 0 18878 }, 18879 { 18880 qe: 0x5601, 18881 nmps: 46, 18882 nlps: 46, 18883 switchFlag: 0 18884 } 18885 ]; 18886 function ArithmeticDecoder(data, start, end) { 18887 this.data = data; 18888 this.bp = start; 18889 this.dataEnd = end; 18890 this.chigh = data[start]; 18891 this.clow = 0; 18892 this.byteIn(); 18893 this.chigh = this.chigh << 7 & 0xFFFF | this.clow >> 9 & 0x7F; 18894 this.clow = this.clow << 7 & 0xFFFF; 18895 this.ct -= 7; 18896 this.a = 0x8000; 18897 } 18898 ArithmeticDecoder.prototype = { 18899 byteIn: function ArithmeticDecoder_byteIn() { 18900 var data = this.data; 18901 var bp = this.bp; 18902 if (data[bp] === 0xFF) { 18903 var b1 = data[bp + 1]; 18904 if (b1 > 0x8F) { 18905 this.clow += 0xFF00; 18906 this.ct = 8; 18907 } else { 18908 bp++; 18909 this.clow += data[bp] << 9; 18910 this.ct = 7; 18911 this.bp = bp; 18912 } 18913 } else { 18914 bp++; 18915 this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xFF00; 18916 this.ct = 8; 18917 this.bp = bp; 18918 } 18919 if (this.clow > 0xFFFF) { 18920 this.chigh += this.clow >> 16; 18921 this.clow &= 0xFFFF; 18922 } 18923 }, 18924 readBit: function ArithmeticDecoder_readBit(contexts, pos) { 18925 var cx_index = contexts[pos] >> 1, cx_mps = contexts[pos] & 1; 18926 var qeTableIcx = QeTable[cx_index]; 18927 var qeIcx = qeTableIcx.qe; 18928 var d; 18929 var a = this.a - qeIcx; 18930 if (this.chigh < qeIcx) { 18931 if (a < qeIcx) { 18932 a = qeIcx; 18933 d = cx_mps; 18934 cx_index = qeTableIcx.nmps; 18935 } else { 18936 a = qeIcx; 18937 d = 1 ^ cx_mps; 18938 if (qeTableIcx.switchFlag === 1) { 18939 cx_mps = d; 18940 } 18941 cx_index = qeTableIcx.nlps; 18942 } 18943 } else { 18944 this.chigh -= qeIcx; 18945 if ((a & 0x8000) !== 0) { 18946 this.a = a; 18947 return cx_mps; 18948 } 18949 if (a < qeIcx) { 18950 d = 1 ^ cx_mps; 18951 if (qeTableIcx.switchFlag === 1) { 18952 cx_mps = d; 18953 } 18954 cx_index = qeTableIcx.nlps; 18955 } else { 18956 d = cx_mps; 18957 cx_index = qeTableIcx.nmps; 18958 } 18959 } 18960 do { 18961 if (this.ct === 0) { 18962 this.byteIn(); 18963 } 18964 a <<= 1;
18965 this.chigh = this.chigh << 1 & 0xFFFF | this.clow >> 15 & 1; 18966 this.clow = this.clow << 1 & 0xFFFF; 18967 this.ct--; 18968 } while ((a & 0x8000) === 0); 18969 this.a = a; 18970 contexts[pos] = cx_index << 1 | cx_mps; 18971 return d; 18972 } 18973 }; 18974 return ArithmeticDecoder; 18975}(); 18976exports.ArithmeticDecoder = ArithmeticDecoder; 18977 18978/***/ }), 18979/* 11 */ 18980/***/ (function(module, exports, __w_pdfjs_require__) { 18981 18982"use strict"; 18983 18984var sharedUtil = __w_pdfjs_require__(0); 18985var coreCharsets = __w_pdfjs_require__(22); 18986var coreEncodings = __w_pdfjs_require__(4); 18987var error = sharedUtil.error; 18988var info = sharedUtil.info; 18989var bytesToString = sharedUtil.bytesToString; 18990var warn = sharedUtil.warn; 18991var isArray = sharedUtil.isArray; 18992var Util = sharedUtil.Util; 18993var stringToBytes = sharedUtil.stringToBytes; 18994var assert = sharedUtil.assert; 18995var ISOAdobeCharset = coreCharsets.ISOAdobeCharset; 18996var ExpertCharset = coreCharsets.ExpertCharset; 18997var ExpertSubsetCharset = coreCharsets.ExpertSubsetCharset; 18998var StandardEncoding = coreEncodings.StandardEncoding; 18999var ExpertEncoding = coreEncodings.ExpertEncoding; 19000var MAX_SUBR_NESTING = 10; 19001var CFFStandardStrings = [ 19002 '.notdef', 19003 'space', 19004 'exclam', 19005 'quotedbl', 19006 'numbersign', 19007 'dollar', 19008 'percent', 19009 'ampersand', 19010 'quoteright', 19011 'parenleft', 19012 'parenright', 19013 'asterisk', 19014 'plus', 19015 'comma', 19016 'hyphen', 19017 'period', 19018 'slash', 19019 'zero', 19020 'one', 19021 'two', 19022 'three', 19023 'four', 19024 'five', 19025 'six', 19026 'seven', 19027 'eight', 19028 'nine', 19029 'colon', 19030 'semicolon', 19031 'less', 19032 'equal', 19033 'greater', 19034 'question', 19035 'at', 19036 'A', 19037 'B', 19038 'C', 19039 'D', 19040 'E', 19041 'F', 19042 'G', 19043 'H', 19044 'I', 19045 'J', 19046 'K', 19047 'L', 19048 'M', 19049 'N', 19050 'O', 19051 'P', 19052 'Q', 19053 'R', 19054 'S', 19055 'T', 19056 'U', 19057 'V', 19058 'W', 19059 'X', 19060 'Y', 19061 'Z', 19062 'bracketleft', 19063 'backslash', 19064 'bracketright', 19065 'asciicircum', 19066 'underscore', 19067 'quoteleft', 19068 'a', 19069 'b', 19070 'c', 19071 'd', 19072 'e', 19073 'f', 19074 'g', 19075 'h', 19076 'i', 19077 'j', 19078 'k', 19079 'l', 19080 'm', 19081 'n', 19082 'o', 19083 'p', 19084 'q', 19085 'r', 19086 's', 19087 't', 19088 'u', 19089 'v', 19090 'w', 19091 'x', 19092 'y', 19093 'z', 19094 'braceleft', 19095 'bar', 19096 'braceright', 19097 'asciitilde', 19098 'exclamdown', 19099 'cent', 19100 'sterling', 19101 'fraction', 19102 'yen', 19103 'florin', 19104 'section', 19105 'currency', 19106 'quotesingle', 19107 'quotedblleft', 19108 'guillemotleft', 19109 'guilsinglleft', 19110 'guilsinglright', 19111 'fi', 19112 'fl', 19113 'endash', 19114 'dagger', 19115 'daggerdbl', 19116 'periodcentered', 19117 'paragraph', 19118 'bullet', 19119 'quotesinglbase', 19120 'quotedblbase', 19121 'quotedblright', 19122 'guillemotright', 19123 'ellipsis', 19124 'perthousand', 19125 'questiondown', 19126 'grave', 19127 'acute', 19128 'circumflex', 19129 'tilde', 19130 'macron', 19131 'breve', 19132 'dotaccent', 19133 'dieresis', 19134 'ring', 19135 'cedilla', 19136 'hungarumlaut', 19137 'ogonek', 19138 'caron', 19139 'emdash', 19140 'AE', 19141 'ordfeminine', 19142 'Lslash', 19143 'Oslash', 19144 'OE', 19145 'ordmasculine', 19146 'ae', 19147 'dotlessi', 19148 'lslash', 19149 'oslash', 19150 'oe', 19151 'germandbls', 19152 'onesuperior', 19153 'logicalnot', 19154 'mu', 19155 'trademark', 19156 'Eth', 19157 'onehalf', 19158 'plusminus', 19159 'Thorn', 19160 'onequarter', 19161 'divide', 19162 'brokenbar', 19163 'degree', 19164 'thorn', 19165 'threequarters', 19166 'twosuperior', 19167 'registered', 19168 'minus', 19169 'eth', 19170 'multiply', 19171 'threesuperior', 19172 'copyright', 19173 'Aacute', 19174 'Acircumflex', 19175 'Adieresis', 19176 'Agrave', 19177 'Aring', 19178 'Atilde', 19179 'Ccedilla', 19180 'Eacute', 19181 'Ecircumflex', 19182 'Edieresis', 19183 'Egrave', 19184 'Iacute', 19185 'Icircumflex', 19186 'Idieresis', 19187 'Igrave', 19188 'Ntilde', 19189 'Oacute', 19190 'Ocircumflex', 19191 'Odieresis', 19192 'Ograve', 19193 'Otilde', 19194 'Scaron', 19195 'Uacute', 19196 'Ucircumflex', 19197 'Udieresis', 19198 'Ugrave', 19199 'Yacute', 19200 'Ydieresis', 19201 'Zcaron', 19202 'aacute', 19203 'acircumflex', 19204 'adieresis', 19205 'agrave', 19206 'aring', 19207 'atilde', 19208 'ccedilla', 19209 'eacute', 19210 'ecircumflex', 19211 'edieresis', 19212 'egrave', 19213 'iacute', 19214 'icircumflex', 19215 'idieresis', 19216 'igrave', 19217 'ntilde', 19218 'oacute', 19219 'ocircumflex', 19220 'odieresis', 19221 'ograve', 19222 'otilde', 19223 'scaron', 19224 'uacute', 19225 'ucircumflex', 19226 'udieresis', 19227 'ugrave', 19228 'yacute', 19229 'ydieresis', 19230 'zcaron', 19231 'exclamsmall', 19232 'Hungarumlautsmall', 19233 'dollaroldstyle', 19234 'dollarsuperior', 19235 'ampersandsmall', 19236 'Acutesmall', 19237 'parenleftsuperior', 19238 'parenrightsuperior', 19239 'twodotenleader', 19240 'onedotenleader', 19241 'zerooldstyle', 19242 'oneoldstyle', 19243 'twooldstyle', 19244 'threeoldstyle', 19245 'fouroldstyle', 19246 'fiveoldstyle', 19247 'sixoldstyle', 19248 'sevenoldstyle', 19249 'eightoldstyle', 19250 'nineoldstyle', 19251 'commasuperior', 19252 'threequartersemdash', 19253 'periodsuperior', 19254 'questionsmall', 19255 'asuperior', 19256 'bsuperior', 19257 'centsuperior', 19258 'dsuperior', 19259 'esuperior', 19260 'isuperior', 19261 'lsuperior', 19262 'msuperior', 19263 'nsuperior', 19264 'osuperior', 19265 'rsuperior', 19266 'ssuperior', 19267 'tsuperior', 19268 'ff', 19269 'ffi', 19270 'ffl', 19271 'parenleftinferior', 19272 'parenrightinferior',
vendor: 10,311 bytes, lines 19273-19831
19273 'Circumflexsmall', 19274 'hyphensuperior', 19275 'Gravesmall', 19276 'Asmall', 19277 'Bsmall', 19278 'Csmall', 19279 'Dsmall', 19280 'Esmall', 19281 'Fsmall', 19282 'Gsmall', 19283 'Hsmall', 19284 'Ismall', 19285 'Jsmall', 19286 'Ksmall', 19287 'Lsmall', 19288 'Msmall', 19289 'Nsmall', 19290 'Osmall', 19291 'Psmall', 19292 'Qsmall', 19293 'Rsmall', 19294 'Ssmall', 19295 'Tsmall', 19296 'Usmall', 19297 'Vsmall', 19298 'Wsmall', 19299 'Xsmall', 19300 'Ysmall', 19301 'Zsmall', 19302 'colonmonetary', 19303 'onefitted', 19304 'rupiah', 19305 'Tildesmall', 19306 'exclamdownsmall', 19307 'centoldstyle', 19308 'Lslashsmall', 19309 'Scaronsmall', 19310 'Zcaronsmall', 19311 'Dieresissmall', 19312 'Brevesmall', 19313 'Caronsmall', 19314 'Dotaccentsmall', 19315 'Macronsmall', 19316 'figuredash', 19317 'hypheninferior', 19318 'Ogoneksmall', 19319 'Ringsmall', 19320 'Cedillasmall', 19321 'questiondownsmall', 19322 'oneeighth', 19323 'threeeighths', 19324 'fiveeighths', 19325 'seveneighths', 19326 'onethird', 19327 'twothirds', 19328 'zerosuperior', 19329 'foursuperior', 19330 'fivesuperior', 19331 'sixsuperior', 19332 'sevensuperior', 19333 'eightsuperior', 19334 'ninesuperior', 19335 'zeroinferior', 19336 'oneinferior', 19337 'twoinferior', 19338 'threeinferior', 19339 'fourinferior', 19340 'fiveinferior', 19341 'sixinferior', 19342 'seveninferior', 19343 'eightinferior', 19344 'nineinferior', 19345 'centinferior', 19346 'dollarinferior', 19347 'periodinferior', 19348 'commainferior', 19349 'Agravesmall', 19350 'Aacutesmall', 19351 'Acircumflexsmall', 19352 'Atildesmall', 19353 'Adieresissmall', 19354 'Aringsmall', 19355 'AEsmall', 19356 'Ccedillasmall', 19357 'Egravesmall', 19358 'Eacutesmall', 19359 'Ecircumflexsmall', 19360 'Edieresissmall', 19361 'Igravesmall', 19362 'Iacutesmall', 19363 'Icircumflexsmall', 19364 'Idieresissmall', 19365 'Ethsmall', 19366 'Ntildesmall', 19367 'Ogravesmall', 19368 'Oacutesmall', 19369 'Ocircumflexsmall', 19370 'Otildesmall', 19371 'Odieresissmall', 19372 'OEsmall', 19373 'Oslashsmall', 19374 'Ugravesmall', 19375 'Uacutesmall', 19376 'Ucircumflexsmall', 19377 'Udieresissmall', 19378 'Yacutesmall', 19379 'Thornsmall', 19380 'Ydieresissmall', 19381 '001.000', 19382 '001.001', 19383 '001.002', 19384 '001.003', 19385 'Black', 19386 'Bold', 19387 'Book', 19388 'Light', 19389 'Medium', 19390 'Regular', 19391 'Roman', 19392 'Semibold' 19393]; 19394var CFFParser = function CFFParserClosure() { 19395 var CharstringValidationData = [ 19396 null, 19397 { 19398 id: 'hstem', 19399 min: 2, 19400 stackClearing: true, 19401 stem: true 19402 }, 19403 null, 19404 { 19405 id: 'vstem', 19406 min: 2, 19407 stackClearing: true, 19408 stem: true 19409 }, 19410 { 19411 id: 'vmoveto', 19412 min: 1, 19413 stackClearing: true 19414 }, 19415 { 19416 id: 'rlineto', 19417 min: 2, 19418 resetStack: true 19419 }, 19420 { 19421 id: 'hlineto', 19422 min: 1, 19423 resetStack: true 19424 }, 19425 { 19426 id: 'vlineto', 19427 min: 1, 19428 resetStack: true 19429 }, 19430 { 19431 id: 'rrcurveto', 19432 min: 6, 19433 resetStack: true 19434 }, 19435 null, 19436 { 19437 id: 'callsubr', 19438 min: 1, 19439 undefStack: true 19440 }, 19441 { 19442 id: 'return', 19443 min: 0, 19444 undefStack: true 19445 }, 19446 null, 19447 null, 19448 { 19449 id: 'endchar', 19450 min: 0, 19451 stackClearing: true 19452 }, 19453 null, 19454 null, 19455 null, 19456 { 19457 id: 'hstemhm', 19458 min: 2, 19459 stackClearing: true, 19460 stem: true 19461 }, 19462 { 19463 id: 'hintmask', 19464 min: 0, 19465 stackClearing: true 19466 }, 19467 { 19468 id: 'cntrmask', 19469 min: 0, 19470 stackClearing: true 19471 }, 19472 { 19473 id: 'rmoveto', 19474 min: 2, 19475 stackClearing: true 19476 }, 19477 { 19478 id: 'hmoveto', 19479 min: 1, 19480 stackClearing: true 19481 }, 19482 { 19483 id: 'vstemhm', 19484 min: 2, 19485 stackClearing: true, 19486 stem: true 19487 }, 19488 { 19489 id: 'rcurveline', 19490 min: 8, 19491 resetStack: true 19492 }, 19493 { 19494 id: 'rlinecurve', 19495 min: 8, 19496 resetStack: true 19497 }, 19498 { 19499 id: 'vvcurveto', 19500 min: 4, 19501 resetStack: true 19502 }, 19503 { 19504 id: 'hhcurveto', 19505 min: 4, 19506 resetStack: true 19507 }, 19508 null, 19509 { 19510 id: 'callgsubr', 19511 min: 1, 19512 undefStack: true 19513 }, 19514 { 19515 id: 'vhcurveto', 19516 min: 4, 19517 resetStack: true 19518 }, 19519 { 19520 id: 'hvcurveto', 19521 min: 4, 19522 resetStack: true 19523 } 19524 ]; 19525 var CharstringValidationData12 = [ 19526 null, 19527 null, 19528 null, 19529 { 19530 id: 'and', 19531 min: 2, 19532 stackDelta: -1 19533 }, 19534 { 19535 id: 'or', 19536 min: 2, 19537 stackDelta: -1 19538 }, 19539 { 19540 id: 'not', 19541 min: 1, 19542 stackDelta: 0 19543 }, 19544 null, 19545 null, 19546 null, 19547 { 19548 id: 'abs', 19549 min: 1, 19550 stackDelta: 0 19551 }, 19552 { 19553 id: 'add', 19554 min: 2, 19555 stackDelta: -1, 19556 stackFn: function stack_div(stack, index) { 19557 stack[index - 2] = stack[index - 2] + stack[index - 1]; 19558 } 19559 }, 19560 { 19561 id: 'sub', 19562 min: 2, 19563 stackDelta: -1, 19564 stackFn: function stack_div(stack, index) { 19565 stack[index - 2] = stack[index - 2] - stack[index - 1]; 19566 } 19567 }, 19568 { 19569 id: 'div', 19570 min: 2, 19571 stackDelta: -1, 19572 stackFn: function stack_div(stack, index) { 19573 stack[index - 2] = stack[index - 2] / stack[index - 1]; 19574 } 19575 }, 19576 null, 19577 { 19578 id: 'neg', 19579 min: 1, 19580 stackDelta: 0, 19581 stackFn: function stack_div(stack, index) { 19582 stack[index - 1] = -stack[index - 1]; 19583 } 19584 }, 19585 { 19586 id: 'eq', 19587 min: 2, 19588 stackDelta: -1 19589 }, 19590 null, 19591 null, 19592 { 19593 id: 'drop', 19594 min: 1, 19595 stackDelta: -1 19596 }, 19597 null, 19598 { 19599 id: 'put', 19600 min: 2, 19601 stackDelta: -2 19602 }, 19603 { 19604 id: 'get', 19605 min: 1, 19606 stackDelta: 0 19607 }, 19608 { 19609 id: 'ifelse', 19610 min: 4, 19611 stackDelta: -3 19612 }, 19613 { 19614 id: 'random', 19615 min: 0, 19616 stackDelta: 1 19617 }, 19618 { 19619 id: 'mul', 19620 min: 2, 19621 stackDelta: -1, 19622 stackFn: function stack_div(stack, index) { 19623 stack[index - 2] = stack[index - 2] * stack[index - 1]; 19624 } 19625 }, 19626 null, 19627 { 19628 id: 'sqrt', 19629 min: 1, 19630 stackDelta: 0 19631 }, 19632 { 19633 id: 'dup', 19634 min: 1, 19635 stackDelta: 1 19636 }, 19637 { 19638 id: 'exch', 19639 min: 2, 19640 stackDelta: 0 19641 }, 19642 { 19643 id: 'index', 19644 min: 2, 19645 stackDelta: 0 19646 }, 19647 { 19648 id: 'roll', 19649 min: 3, 19650 stackDelta: -2 19651 }, 19652 null, 19653 null, 19654 null, 19655 { 19656 id: 'hflex', 19657 min: 7, 19658 resetStack: true 19659 }, 19660 { 19661 id: 'flex', 19662 min: 13, 19663 resetStack: true 19664 }, 19665 { 19666 id: 'hflex1', 19667 min: 9, 19668 resetStack: true 19669 }, 19670 { 19671 id: 'flex1', 19672 min: 11, 19673 resetStack: true 19674 } 19675 ]; 19676 function CFFParser(file, properties, seacAnalysisEnabled) { 19677 this.bytes = file.getBytes(); 19678 this.properties = properties; 19679 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 19680 } 19681 CFFParser.prototype = { 19682 parse: function CFFParser_parse() { 19683 var properties = this.properties; 19684 var cff = new CFF(); 19685 this.cff = cff; 19686 var header = this.parseHeader(); 19687 var nameIndex = this.parseIndex(header.endPos); 19688 var topDictIndex = this.parseIndex(nameIndex.endPos); 19689 var stringIndex = this.parseIndex(topDictIndex.endPos); 19690 var globalSubrIndex = this.parseIndex(stringIndex.endPos); 19691 var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); 19692 var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); 19693 cff.header = header.obj; 19694 cff.names = this.parseNameIndex(nameIndex.obj); 19695 cff.strings = this.parseStringIndex(stringIndex.obj); 19696 cff.topDict = topDict; 19697 cff.globalSubrIndex = globalSubrIndex.obj; 19698 this.parsePrivateDict(cff.topDict); 19699 cff.isCIDFont = topDict.hasName('ROS'); 19700 var charStringOffset = topDict.getByName('CharStrings'); 19701 var charStringIndex = this.parseIndex(charStringOffset).obj; 19702 var fontMatrix = topDict.getByName('FontMatrix'); 19703 if (fontMatrix) { 19704 properties.fontMatrix = fontMatrix; 19705 } 19706 var fontBBox = topDict.getByName('FontBBox'); 19707 if (fontBBox) { 19708 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 19709 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 19710 properties.ascentScaled = true; 19711 } 19712 var charset, encoding; 19713 if (cff.isCIDFont) { 19714 var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; 19715 for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { 19716 var dictRaw = fdArrayIndex.get(i); 19717 var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings); 19718 this.parsePrivateDict(fontDict); 19719 cff.fdArray.push(fontDict); 19720 } 19721 encoding = null; 19722 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, true); 19723 cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), charStringIndex.count); 19724 } else { 19725 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, false); 19726 encoding = this.parseEncoding(topDict.getByName('Encoding'), properties, cff.strings, charset.charset); 19727 } 19728 cff.charset = charset; 19729 cff.encoding = encoding; 19730 var charStringsAndSeacs = this.parseCharStrings(charStringIndex, topDict.privateDict.subrsIndex, globalSubrIndex.obj, cff.fdSelect, cff.fdArray); 19731 cff.charStrings = charStringsAndSeacs.charStrings; 19732 cff.seacs = charStringsAndSeacs.seacs; 19733 cff.widths = charStringsAndSeacs.widths; 19734 return cff; 19735 }, 19736 parseHeader: function CFFParser_parseHeader() { 19737 var bytes = this.bytes; 19738 var bytesLength = bytes.length; 19739 var offset = 0; 19740 while (offset < bytesLength && bytes[offset] !== 1) { 19741 ++offset; 19742 } 19743 if (offset >= bytesLength) { 19744 error('Invalid CFF header'); 19745 } else if (offset !== 0) { 19746 info('cff data is shifted'); 19747 bytes = bytes.subarray(offset); 19748 this.bytes = bytes; 19749 } 19750 var major = bytes[0]; 19751 var minor = bytes[1]; 19752 var hdrSize = bytes[2]; 19753 var offSize = bytes[3]; 19754 var header = new CFFHeader(major, minor, hdrSize, offSize); 19755 return { 19756 obj: header, 19757 endPos: hdrSize 19758 }; 19759 }, 19760 parseDict: function CFFParser_parseDict(dict) { 19761 var pos = 0; 19762 function parseOperand() { 19763 var value = dict[pos++]; 19764 if (value === 30) { 19765 return parseFloatOperand(); 19766 } else if (value === 28) { 19767 value = dict[pos++]; 19768 value = (value << 24 | dict[pos++] << 16) >> 16; 19769 return value; 19770 } else if (value === 29) { 19771 value = dict[pos++]; 19772 value = value << 8 | dict[pos++]; 19773 value = value << 8 | dict[pos++]; 19774 value = value << 8 | dict[pos++]; 19775 return value; 19776 } else if (value >= 32 && value <= 246) { 19777 return value - 139; 19778 } else if (value >= 247 && value <= 250) { 19779 return (value - 247) * 256 + dict[pos++] + 108; 19780 } else if (value >= 251 && value <= 254) { 19781 return -((value - 251) * 256) - dict[pos++] - 108; 19782 } 19783 warn('CFFParser_parseDict: "' + value + '" is a reserved command.'); 19784 return NaN; 19785 } 19786 function parseFloatOperand() { 19787 var str = ''; 19788 var eof = 15; 19789 var lookup = [ 19790 '0', 19791 '1', 19792 '2', 19793 '3', 19794 '4', 19795 '5', 19796 '6', 19797 '7', 19798 '8', 19799 '9', 19800 '.', 19801 'E', 19802 'E-', 19803 null, 19804 '-' 19805 ]; 19806 var length = dict.length; 19807 while (pos < length) { 19808 var b = dict[pos++]; 19809 var b1 = b >> 4; 19810 var b2 = b & 15; 19811 if (b1 === eof) { 19812 break; 19813 } 19814 str += lookup[b1]; 19815 if (b2 === eof) { 19816 break; 19817 } 19818 str += lookup[b2]; 19819 } 19820 return parseFloat(str); 19821 } 19822 var operands = []; 19823 var entries = []; 19824 pos = 0; 19825 var end = dict.length; 19826 while (pos < end) { 19827 var b = dict[pos]; 19828 if (b <= 21) { 19829 if (b === 12) { 19830 b = b << 8 | dict[++pos]; 19831 }
19832 entries.push([ 19833 b, 19834 operands 19835 ]); 19836 operands = []; 19837 ++pos; 19838 } else { 19839 operands.push(parseOperand()); 19840 } 19841 } 19842 return entries; 19843 }, 19844 parseIndex: function CFFParser_parseIndex(pos) { 19845 var cffIndex = new CFFIndex(); 19846 var bytes = this.bytes; 19847 var count = bytes[pos++] << 8 | bytes[pos++]; 19848 var offsets = []; 19849 var end = pos; 19850 var i, ii; 19851 if (count !== 0) { 19852 var offsetSize = bytes[pos++]; 19853 var startPos = pos + (count + 1) * offsetSize - 1; 19854 for (i = 0, ii = count + 1; i < ii; ++i) { 19855 var offset = 0; 19856 for (var j = 0; j < offsetSize; ++j) { 19857 offset <<= 8; 19858 offset += bytes[pos++]; 19859 } 19860 offsets.push(startPos + offset); 19861 } 19862 end = offsets[count]; 19863 } 19864 for (i = 0, ii = offsets.length - 1; i < ii; ++i) { 19865 var offsetStart = offsets[i]; 19866 var offsetEnd = offsets[i + 1]; 19867 cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); 19868 } 19869 return { 19870 obj: cffIndex, 19871 endPos: end 19872 }; 19873 }, 19874 parseNameIndex: function CFFParser_parseNameIndex(index) { 19875 var names = []; 19876 for (var i = 0, ii = index.count; i < ii; ++i) { 19877 var name = index.get(i); 19878 var length = Math.min(name.length, 127); 19879 var data = []; 19880 for (var j = 0; j < length; ++j) { 19881 var c = name[j]; 19882 if (j === 0 && c === 0) { 19883 data[j] = c; 19884 continue; 19885 } 19886 if (c < 33 || c > 126 || c === 91 || c === 93 || c === 40 || c === 41 || c === 123 || c === 125 || c === 60 || c === 62 || c === 47 || c === 37 || c === 35) { 19887 data[j] = 95; 19888 continue; 19889 } 19890 data[j] = c; 19891 } 19892 names.push(bytesToString(data)); 19893 } 19894 return names; 19895 }, 19896 parseStringIndex: function CFFParser_parseStringIndex(index) { 19897 var strings = new CFFStrings(); 19898 for (var i = 0, ii = index.count; i < ii; ++i) { 19899 var data = index.get(i); 19900 strings.add(bytesToString(data)); 19901 } 19902 return strings; 19903 }, 19904 createDict: function CFFParser_createDict(Type, dict, strings) { 19905 var cffDict = new Type(strings); 19906 for (var i = 0, ii = dict.length; i < ii; ++i) { 19907 var pair = dict[i]; 19908 var key = pair[0]; 19909 var value = pair[1]; 19910 cffDict.setByKey(key, value); 19911 } 19912 return cffDict; 19913 }, 19914 parseCharString: function CFFParser_parseCharString(state, data, localSubrIndex, globalSubrIndex) { 19915 if (state.callDepth > MAX_SUBR_NESTING) { 19916 return false; 19917 } 19918 var stackSize = state.stackSize; 19919 var stack = state.stack; 19920 var length = data.length; 19921 for (var j = 0; j < length;) { 19922 var value = data[j++]; 19923 var validationCommand = null; 19924 if (value === 12) { 19925 var q = data[j++]; 19926 if (q === 0) { 19927 data[j - 2] = 139; 19928 data[j - 1] = 22; 19929 stackSize = 0; 19930 } else { 19931 validationCommand = CharstringValidationData12[q]; 19932 } 19933 } else if (value === 28) { 19934 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16; 19935 j += 2; 19936 stackSize++; 19937 } else if (value === 14) { 19938 if (stackSize >= 4) { 19939 stackSize -= 4; 19940 if (this.seacAnalysisEnabled) { 19941 state.seac = stack.slice(stackSize, stackSize + 4); 19942 return false; 19943 } 19944 } 19945 validationCommand = CharstringValidationData[value]; 19946 } else if (value >= 32 && value <= 246) { 19947 stack[stackSize] = value - 139; 19948 stackSize++; 19949 } else if (value >= 247 && value <= 254) { 19950 stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108; 19951 j++; 19952 stackSize++; 19953 } else if (value === 255) { 19954 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536; 19955 j += 4; 19956 stackSize++; 19957 } else if (value === 19 || value === 20) { 19958 state.hints += stackSize >> 1; 19959 j += state.hints + 7 >> 3; 19960 stackSize %= 2; 19961 validationCommand = CharstringValidationData[value]; 19962 } else if (value === 10 || value === 29) { 19963 var subrsIndex; 19964 if (value === 10) { 19965 subrsIndex = localSubrIndex; 19966 } else { 19967 subrsIndex = globalSubrIndex; 19968 } 19969 if (!subrsIndex) { 19970 validationCommand = CharstringValidationData[value]; 19971 warn('Missing subrsIndex for ' + validationCommand.id); 19972 return false;
19973 } 19974 var bias = 32768; 19975 if (subrsIndex.count < 1240) { 19976 bias = 107; 19977 } else if (subrsIndex.count < 33900) { 19978 bias = 1131; 19979 } 19980 var subrNumber = stack[--stackSize] + bias; 19981 if (subrNumber < 0 || subrNumber >= subrsIndex.count) { 19982 validationCommand = CharstringValidationData[value]; 19983 warn('Out of bounds subrIndex for ' + validationCommand.id); 19984 return false; 19985 } 19986 state.stackSize = stackSize; 19987 state.callDepth++; 19988 var valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex); 19989 if (!valid) { 19990 return false; 19991 } 19992 state.callDepth--; 19993 stackSize = state.stackSize; 19994 continue; 19995 } else if (value === 11) { 19996 state.stackSize = stackSize; 19997 return true; 19998 } else { 19999 validationCommand = CharstringValidationData[value]; 20000 } 20001 if (validationCommand) { 20002 if (validationCommand.stem) { 20003 state.hints += stackSize >> 1; 20004 } 20005 if ('min' in validationCommand) { 20006 if (!state.undefStack && stackSize < validationCommand.min) { 20007 warn('Not enough parameters for ' + validationCommand.id + '; actual: ' + stackSize + ', expected: ' + validationCommand.min); 20008 return false; 20009 } 20010 } 20011 if (state.firstStackClearing && validationCommand.stackClearing) { 20012 state.firstStackClearing = false; 20013 stackSize -= validationCommand.min; 20014 if (stackSize >= 2 && validationCommand.stem) { 20015 stackSize %= 2; 20016 } else if (stackSize > 1) { 20017 warn('Found too many parameters for stack-clearing command'); 20018 } 20019 if (stackSize > 0 && stack[stackSize - 1] >= 0) { 20020 state.width = stack[stackSize - 1]; 20021 } 20022 } 20023 if ('stackDelta' in validationCommand) { 20024 if ('stackFn' in validationCommand) { 20025 validationCommand.stackFn(stack, stackSize); 20026 } 20027 stackSize += validationCommand.stackDelta; 20028 } else if (validationCommand.stackClearing) { 20029 stackSize = 0; 20030 } else if (validationCommand.resetStack) { 20031 stackSize = 0; 20032 state.undefStack = false; 20033 } else if (validationCommand.undefStack) { 20034 stackSize = 0; 20035 state.undefStack = true; 20036 state.firstStackClearing = false; 20037 } 20038 } 20039 } 20040 state.stackSize = stackSize; 20041 return true; 20042 }, 20043 parseCharStrings: function CFFParser_parseCharStrings(charStrings, localSubrIndex, globalSubrIndex, fdSelect, fdArray) { 20044 var seacs = []; 20045 var widths = []; 20046 var count = charStrings.count; 20047 for (var i = 0; i < count; i++) { 20048 var charstring = charStrings.get(i); 20049 var state = {
vendor: 4,108 bytes, lines 20050-20186
20050 callDepth: 0, 20051 stackSize: 0, 20052 stack: [], 20053 undefStack: true, 20054 hints: 0, 20055 firstStackClearing: true, 20056 seac: null, 20057 width: null 20058 }; 20059 var valid = true; 20060 var localSubrToUse = null; 20061 if (fdSelect && fdArray.length) { 20062 var fdIndex = fdSelect.getFDIndex(i); 20063 if (fdIndex === -1) { 20064 warn('Glyph index is not in fd select.'); 20065 valid = false; 20066 } 20067 if (fdIndex >= fdArray.length) { 20068 warn('Invalid fd index for glyph index.'); 20069 valid = false; 20070 } 20071 if (valid) { 20072 localSubrToUse = fdArray[fdIndex].privateDict.subrsIndex; 20073 } 20074 } else if (localSubrIndex) { 20075 localSubrToUse = localSubrIndex; 20076 } 20077 if (valid) { 20078 valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex); 20079 } 20080 if (state.width !== null) { 20081 widths[i] = state.width; 20082 } 20083 if (state.seac !== null) { 20084 seacs[i] = state.seac; 20085 } 20086 if (!valid) { 20087 charStrings.set(i, new Uint8Array([14])); 20088 } 20089 } 20090 return { 20091 charStrings: charStrings, 20092 seacs: seacs, 20093 widths: widths 20094 }; 20095 }, 20096 emptyPrivateDictionary: function CFFParser_emptyPrivateDictionary(parentDict) { 20097 var privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); 20098 parentDict.setByKey(18, [ 20099 0, 20100 0 20101 ]); 20102 parentDict.privateDict = privateDict; 20103 }, 20104 parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { 20105 if (!parentDict.hasName('Private')) { 20106 this.emptyPrivateDictionary(parentDict); 20107 return; 20108 } 20109 var privateOffset = parentDict.getByName('Private'); 20110 if (!isArray(privateOffset) || privateOffset.length !== 2) { 20111 parentDict.removeByName('Private'); 20112 return; 20113 } 20114 var size = privateOffset[0]; 20115 var offset = privateOffset[1]; 20116 if (size === 0 || offset >= this.bytes.length) { 20117 this.emptyPrivateDictionary(parentDict); 20118 return; 20119 } 20120 var privateDictEnd = offset + size; 20121 var dictData = this.bytes.subarray(offset, privateDictEnd); 20122 var dict = this.parseDict(dictData); 20123 var privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings); 20124 parentDict.privateDict = privateDict; 20125 if (!privateDict.getByName('Subrs')) { 20126 return; 20127 } 20128 var subrsOffset = privateDict.getByName('Subrs'); 20129 var relativeOffset = offset + subrsOffset; 20130 if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { 20131 this.emptyPrivateDictionary(parentDict); 20132 return; 20133 } 20134 var subrsIndex = this.parseIndex(relativeOffset); 20135 privateDict.subrsIndex = subrsIndex.obj; 20136 }, 20137 parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { 20138 if (pos === 0) { 20139 return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, ISOAdobeCharset); 20140 } else if (pos === 1) { 20141 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, ExpertCharset); 20142 } else if (pos === 2) { 20143 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, ExpertSubsetCharset); 20144 } 20145 var bytes = this.bytes; 20146 var start = pos; 20147 var format = bytes[pos++]; 20148 var charset = ['.notdef']; 20149 var id, count, i; 20150 length -= 1; 20151 switch (format) { 20152 case 0: 20153 for (i = 0; i < length; i++) { 20154 id = bytes[pos++] << 8 | bytes[pos++]; 20155 charset.push(cid ? id : strings.get(id)); 20156 } 20157 break; 20158 case 1: 20159 while (charset.length <= length) { 20160 id = bytes[pos++] << 8 | bytes[pos++]; 20161 count = bytes[pos++]; 20162 for (i = 0; i <= count; i++) { 20163 charset.push(cid ? id++ : strings.get(id++)); 20164 } 20165 } 20166 break; 20167 case 2: 20168 while (charset.length <= length) { 20169 id = bytes[pos++] << 8 | bytes[pos++]; 20170 count = bytes[pos++] << 8 | bytes[pos++]; 20171 for (i = 0; i <= count; i++) { 20172 charset.push(cid ? id++ : strings.get(id++)); 20173 } 20174 } 20175 break; 20176 default: 20177 error('Unknown charset format'); 20178 } 20179 var end = pos; 20180 var raw = bytes.subarray(start, end); 20181 return new CFFCharset(false, format, charset, raw); 20182 }, 20183 parseEncoding: function CFFParser_parseEncoding(pos, properties, strings, charset) { 20184 var encoding = Object.create(null); 20185 var bytes = this.bytes; 20186 var predefined = false;
20187 var format, i, ii; 20188 var raw = null; 20189 function readSupplement() { 20190 var supplementsCount = bytes[pos++]; 20191 for (i = 0; i < supplementsCount; i++) { 20192 var code = bytes[pos++]; 20193 var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); 20194 encoding[code] = charset.indexOf(strings.get(sid)); 20195 } 20196 } 20197 if (pos === 0 || pos === 1) { 20198 predefined = true; 20199 format = pos; 20200 var baseEncoding = pos ? ExpertEncoding : StandardEncoding; 20201 for (i = 0, ii = charset.length; i < ii; i++) { 20202 var index = baseEncoding.indexOf(charset[i]); 20203 if (index !== -1) { 20204 encoding[index] = i; 20205 } 20206 } 20207 } else { 20208 var dataStart = pos; 20209 format = bytes[pos++]; 20210 switch (format & 0x7f) { 20211 case 0: 20212 var glyphsCount = bytes[pos++]; 20213 for (i = 1; i <= glyphsCount; i++) { 20214 encoding[bytes[pos++]] = i; 20215 } 20216 break; 20217 case 1: 20218 var rangesCount = bytes[pos++]; 20219 var gid = 1; 20220 for (i = 0; i < rangesCount; i++) { 20221 var start = bytes[pos++]; 20222 var left = bytes[pos++]; 20223 for (var j = start; j <= start + left; j++) { 20224 encoding[j] = gid++; 20225 } 20226 } 20227 break; 20228 default: 20229 error('Unknown encoding format: ' + format + ' in CFF'); 20230 break; 20231 } 20232 var dataEnd = pos; 20233 if (format & 0x80) { 20234 bytes[dataStart] &= 0x7f; 20235 readSupplement(); 20236 } 20237 raw = bytes.subarray(dataStart, dataEnd); 20238 } 20239 format = format & 0x7f; 20240 return new CFFEncoding(predefined, format, encoding, raw); 20241 }, 20242 parseFDSelect: function CFFParser_parseFDSelect(pos, length) { 20243 var start = pos; 20244 var bytes = this.bytes; 20245 var format = bytes[pos++]; 20246 var fdSelect = [], rawBytes; 20247 var i, invalidFirstGID = false; 20248 switch (format) { 20249 case 0: 20250 for (i = 0; i < length; ++i) { 20251 var id = bytes[pos++]; 20252 fdSelect.push(id); 20253 } 20254 rawBytes = bytes.subarray(start, pos); 20255 break; 20256 case 3: 20257 var rangesCount = bytes[pos++] << 8 | bytes[pos++]; 20258 for (i = 0; i < rangesCount; ++i) { 20259 var first = bytes[pos++] << 8 | bytes[pos++]; 20260 if (i === 0 && first !== 0) { 20261 warn('parseFDSelect: The first range must have a first GID of 0' + ' -- trying to recover.'); 20262 invalidFirstGID = true; 20263 first = 0; 20264 } 20265 var fdIndex = bytes[pos++]; 20266 var next = bytes[pos] << 8 | bytes[pos + 1]; 20267 for (var j = first; j < next; ++j) { 20268 fdSelect.push(fdIndex); 20269 } 20270 } 20271 pos += 2; 20272 rawBytes = bytes.subarray(start, pos); 20273 if (invalidFirstGID) { 20274 rawBytes[3] = rawBytes[4] = 0; 20275 } 20276 break; 20277 default: 20278 error('parseFDSelect: Unknown format "' + format + '".'); 20279 break; 20280 } 20281 assert(fdSelect.length === length, 'parseFDSelect: Invalid font data.'); 20282 return new CFFFDSelect(fdSelect, rawBytes); 20283 } 20284 }; 20285 return CFFParser; 20286}(); 20287var CFF = function CFFClosure() { 20288 function CFF() { 20289 this.header = null; 20290 this.names = []; 20291 this.topDict = null; 20292 this.strings = new CFFStrings(); 20293 this.globalSubrIndex = null; 20294 this.encoding = null; 20295 this.charset = null; 20296 this.charStrings = null; 20297 this.fdArray = []; 20298 this.fdSelect = null; 20299 this.isCIDFont = false; 20300 } 20301 return CFF; 20302}(); 20303var CFFHeader = function CFFHeaderClosure() { 20304 function CFFHeader(major, minor, hdrSize, offSize) { 20305 this.major = major; 20306 this.minor = minor; 20307 this.hdrSize = hdrSize; 20308 this.offSize = offSize; 20309 } 20310 return CFFHeader; 20311}(); 20312var CFFStrings = function CFFStringsClosure() { 20313 function CFFStrings() { 20314 this.strings = []; 20315 } 20316 CFFStrings.prototype = { 20317 get: function CFFStrings_get(index) { 20318 if (index >= 0 && index <= 390) { 20319 return CFFStandardStrings[index]; 20320 } 20321 if (index - 391 <= this.strings.length) { 20322 return this.strings[index - 391]; 20323 } 20324 return CFFStandardStrings[0]; 20325 }, 20326 add: function CFFStrings_add(value) { 20327 this.strings.push(value); 20328 }, 20329 get count() { 20330 return this.strings.length; 20331 } 20332 }; 20333 return CFFStrings; 20334}(); 20335var CFFIndex = function CFFIndexClosure() { 20336 function CFFIndex() { 20337 this.objects = []; 20338 this.length = 0; 20339 } 20340 CFFIndex.prototype = { 20341 add: function CFFIndex_add(data) { 20342 this.length += data.length; 20343 this.objects.push(data); 20344 },
vendor: 26,038 bytes, lines 20345-21535
20345 set: function CFFIndex_set(index, data) { 20346 this.length += data.length - this.objects[index].length; 20347 this.objects[index] = data; 20348 }, 20349 get: function CFFIndex_get(index) { 20350 return this.objects[index]; 20351 }, 20352 get count() { 20353 return this.objects.length; 20354 } 20355 }; 20356 return CFFIndex; 20357}(); 20358var CFFDict = function CFFDictClosure() { 20359 function CFFDict(tables, strings) { 20360 this.keyToNameMap = tables.keyToNameMap; 20361 this.nameToKeyMap = tables.nameToKeyMap; 20362 this.defaults = tables.defaults; 20363 this.types = tables.types; 20364 this.opcodes = tables.opcodes; 20365 this.order = tables.order; 20366 this.strings = strings; 20367 this.values = Object.create(null); 20368 } 20369 CFFDict.prototype = { 20370 setByKey: function CFFDict_setByKey(key, value) { 20371 if (!(key in this.keyToNameMap)) { 20372 return false; 20373 } 20374 var valueLength = value.length; 20375 if (valueLength === 0) { 20376 return true; 20377 } 20378 for (var i = 0; i < valueLength; i++) { 20379 if (isNaN(value[i])) { 20380 warn('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); 20381 return true; 20382 } 20383 } 20384 var type = this.types[key]; 20385 if (type === 'num' || type === 'sid' || type === 'offset') { 20386 value = value[0]; 20387 } 20388 this.values[key] = value; 20389 return true; 20390 }, 20391 setByName: function CFFDict_setByName(name, value) { 20392 if (!(name in this.nameToKeyMap)) { 20393 error('Invalid dictionary name "' + name + '"'); 20394 } 20395 this.values[this.nameToKeyMap[name]] = value; 20396 }, 20397 hasName: function CFFDict_hasName(name) { 20398 return this.nameToKeyMap[name] in this.values; 20399 }, 20400 getByName: function CFFDict_getByName(name) { 20401 if (!(name in this.nameToKeyMap)) { 20402 error('Invalid dictionary name "' + name + '"'); 20403 } 20404 var key = this.nameToKeyMap[name]; 20405 if (!(key in this.values)) { 20406 return this.defaults[key]; 20407 } 20408 return this.values[key]; 20409 }, 20410 removeByName: function CFFDict_removeByName(name) { 20411 delete this.values[this.nameToKeyMap[name]]; 20412 } 20413 }; 20414 CFFDict.createTables = function CFFDict_createTables(layout) { 20415 var tables = { 20416 keyToNameMap: {}, 20417 nameToKeyMap: {}, 20418 defaults: {}, 20419 types: {}, 20420 opcodes: {}, 20421 order: [] 20422 }; 20423 for (var i = 0, ii = layout.length; i < ii; ++i) { 20424 var entry = layout[i]; 20425 var key = isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; 20426 tables.keyToNameMap[key] = entry[1]; 20427 tables.nameToKeyMap[entry[1]] = key; 20428 tables.types[key] = entry[2]; 20429 tables.defaults[key] = entry[3]; 20430 tables.opcodes[key] = isArray(entry[0]) ? entry[0] : [entry[0]]; 20431 tables.order.push(key); 20432 } 20433 return tables; 20434 }; 20435 return CFFDict; 20436}(); 20437var CFFTopDict = function CFFTopDictClosure() { 20438 var layout = [ 20439 [ 20440 [ 20441 12, 20442 30 20443 ], 20444 'ROS', 20445 [ 20446 'sid', 20447 'sid', 20448 'num' 20449 ], 20450 null 20451 ], 20452 [ 20453 [ 20454 12, 20455 20 20456 ], 20457 'SyntheticBase', 20458 'num', 20459 null 20460 ], 20461 [ 20462 0, 20463 'version', 20464 'sid', 20465 null 20466 ], 20467 [ 20468 1, 20469 'Notice', 20470 'sid', 20471 null 20472 ], 20473 [ 20474 [ 20475 12, 20476 0 20477 ], 20478 'Copyright', 20479 'sid', 20480 null 20481 ], 20482 [ 20483 2, 20484 'FullName', 20485 'sid', 20486 null 20487 ], 20488 [ 20489 3, 20490 'FamilyName', 20491 'sid', 20492 null 20493 ], 20494 [ 20495 4, 20496 'Weight', 20497 'sid', 20498 null 20499 ], 20500 [ 20501 [ 20502 12, 20503 1 20504 ], 20505 'isFixedPitch', 20506 'num', 20507 0 20508 ], 20509 [ 20510 [ 20511 12, 20512 2 20513 ], 20514 'ItalicAngle', 20515 'num', 20516 0 20517 ], 20518 [ 20519 [ 20520 12, 20521 3 20522 ], 20523 'UnderlinePosition', 20524 'num', 20525 -100 20526 ], 20527 [ 20528 [ 20529 12, 20530 4 20531 ], 20532 'UnderlineThickness', 20533 'num', 20534 50 20535 ], 20536 [ 20537 [ 20538 12, 20539 5 20540 ], 20541 'PaintType', 20542 'num', 20543 0 20544 ], 20545 [ 20546 [ 20547 12, 20548 6 20549 ], 20550 'CharstringType', 20551 'num', 20552 2 20553 ], 20554 [ 20555 [ 20556 12, 20557 7 20558 ], 20559 'FontMatrix', 20560 [ 20561 'num', 20562 'num', 20563 'num', 20564 'num', 20565 'num', 20566 'num' 20567 ], 20568 [ 20569 0.001, 20570 0, 20571 0, 20572 0.001, 20573 0, 20574 0 20575 ] 20576 ], 20577 [ 20578 13, 20579 'UniqueID', 20580 'num', 20581 null 20582 ], 20583 [ 20584 5, 20585 'FontBBox', 20586 [ 20587 'num', 20588 'num', 20589 'num', 20590 'num' 20591 ], 20592 [ 20593 0, 20594 0, 20595 0, 20596 0 20597 ] 20598 ], 20599 [ 20600 [ 20601 12, 20602 8 20603 ], 20604 'StrokeWidth', 20605 'num', 20606 0 20607 ], 20608 [ 20609 14, 20610 'XUID', 20611 'array', 20612 null 20613 ], 20614 [ 20615 15, 20616 'charset', 20617 'offset', 20618 0 20619 ], 20620 [ 20621 16, 20622 'Encoding', 20623 'offset', 20624 0 20625 ], 20626 [ 20627 17, 20628 'CharStrings', 20629 'offset', 20630 0 20631 ], 20632 [ 20633 18, 20634 'Private', 20635 [ 20636 'offset', 20637 'offset' 20638 ], 20639 null 20640 ], 20641 [ 20642 [ 20643 12, 20644 21 20645 ], 20646 'PostScript', 20647 'sid', 20648 null 20649 ], 20650 [ 20651 [ 20652 12, 20653 22 20654 ], 20655 'BaseFontName', 20656 'sid', 20657 null 20658 ], 20659 [ 20660 [ 20661 12, 20662 23 20663 ], 20664 'BaseFontBlend', 20665 'delta', 20666 null 20667 ], 20668 [ 20669 [ 20670 12, 20671 31 20672 ], 20673 'CIDFontVersion', 20674 'num', 20675 0 20676 ], 20677 [ 20678 [ 20679 12, 20680 32 20681 ], 20682 'CIDFontRevision', 20683 'num', 20684 0 20685 ], 20686 [ 20687 [ 20688 12, 20689 33 20690 ], 20691 'CIDFontType', 20692 'num', 20693 0 20694 ], 20695 [ 20696 [ 20697 12, 20698 34 20699 ], 20700 'CIDCount', 20701 'num', 20702 8720 20703 ], 20704 [ 20705 [ 20706 12, 20707 35 20708 ], 20709 'UIDBase', 20710 'num', 20711 null 20712 ], 20713 [ 20714 [ 20715 12, 20716 37 20717 ], 20718 'FDSelect', 20719 'offset', 20720 null 20721 ], 20722 [ 20723 [ 20724 12, 20725 36 20726 ], 20727 'FDArray', 20728 'offset', 20729 null 20730 ], 20731 [ 20732 [ 20733 12, 20734 38 20735 ], 20736 'FontName', 20737 'sid', 20738 null 20739 ] 20740 ]; 20741 var tables = null; 20742 function CFFTopDict(strings) { 20743 if (tables === null) { 20744 tables = CFFDict.createTables(layout); 20745 } 20746 CFFDict.call(this, tables, strings); 20747 this.privateDict = null; 20748 } 20749 CFFTopDict.prototype = Object.create(CFFDict.prototype); 20750 return CFFTopDict; 20751}(); 20752var CFFPrivateDict = function CFFPrivateDictClosure() { 20753 var layout = [ 20754 [ 20755 6, 20756 'BlueValues', 20757 'delta', 20758 null 20759 ], 20760 [ 20761 7, 20762 'OtherBlues', 20763 'delta', 20764 null 20765 ], 20766 [ 20767 8, 20768 'FamilyBlues', 20769 'delta', 20770 null 20771 ], 20772 [ 20773 9, 20774 'FamilyOtherBlues', 20775 'delta', 20776 null 20777 ], 20778 [ 20779 [ 20780 12, 20781 9 20782 ], 20783 'BlueScale', 20784 'num', 20785 0.039625 20786 ], 20787 [ 20788 [ 20789 12, 20790 10 20791 ], 20792 'BlueShift', 20793 'num', 20794 7 20795 ], 20796 [ 20797 [ 20798 12, 20799 11 20800 ], 20801 'BlueFuzz', 20802 'num', 20803 1 20804 ], 20805 [ 20806 10, 20807 'StdHW', 20808 'num', 20809 null 20810 ], 20811 [ 20812 11, 20813 'StdVW', 20814 'num', 20815 null 20816 ], 20817 [ 20818 [ 20819 12, 20820 12 20821 ], 20822 'StemSnapH', 20823 'delta', 20824 null 20825 ], 20826 [ 20827 [ 20828 12, 20829 13 20830 ], 20831 'StemSnapV', 20832 'delta', 20833 null 20834 ], 20835 [ 20836 [ 20837 12, 20838 14 20839 ], 20840 'ForceBold', 20841 'num', 20842 0 20843 ], 20844 [ 20845 [ 20846 12, 20847 17 20848 ], 20849 'LanguageGroup', 20850 'num', 20851 0 20852 ], 20853 [ 20854 [ 20855 12, 20856 18 20857 ], 20858 'ExpansionFactor', 20859 'num', 20860 0.06 20861 ], 20862 [ 20863 [ 20864 12, 20865 19 20866 ], 20867 'initialRandomSeed', 20868 'num', 20869 0 20870 ], 20871 [ 20872 20, 20873 'defaultWidthX', 20874 'num', 20875 0 20876 ], 20877 [ 20878 21, 20879 'nominalWidthX', 20880 'num', 20881 0 20882 ], 20883 [ 20884 19, 20885 'Subrs', 20886 'offset', 20887 null 20888 ] 20889 ]; 20890 var tables = null; 20891 function CFFPrivateDict(strings) { 20892 if (tables === null) { 20893 tables = CFFDict.createTables(layout); 20894 } 20895 CFFDict.call(this, tables, strings); 20896 this.subrsIndex = null; 20897 } 20898 CFFPrivateDict.prototype = Object.create(CFFDict.prototype); 20899 return CFFPrivateDict; 20900}(); 20901var CFFCharsetPredefinedTypes = { 20902 ISO_ADOBE: 0, 20903 EXPERT: 1, 20904 EXPERT_SUBSET: 2 20905}; 20906var CFFCharset = function CFFCharsetClosure() { 20907 function CFFCharset(predefined, format, charset, raw) { 20908 this.predefined = predefined; 20909 this.format = format; 20910 this.charset = charset; 20911 this.raw = raw; 20912 } 20913 return CFFCharset; 20914}(); 20915var CFFEncoding = function CFFEncodingClosure() { 20916 function CFFEncoding(predefined, format, encoding, raw) { 20917 this.predefined = predefined; 20918 this.format = format; 20919 this.encoding = encoding; 20920 this.raw = raw; 20921 } 20922 return CFFEncoding; 20923}(); 20924var CFFFDSelect = function CFFFDSelectClosure() { 20925 function CFFFDSelect(fdSelect, raw) { 20926 this.fdSelect = fdSelect; 20927 this.raw = raw; 20928 } 20929 CFFFDSelect.prototype = { 20930 getFDIndex: function CFFFDSelect_get(glyphIndex) { 20931 if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { 20932 return -1; 20933 } 20934 return this.fdSelect[glyphIndex]; 20935 } 20936 }; 20937 return CFFFDSelect; 20938}(); 20939var CFFOffsetTracker = function CFFOffsetTrackerClosure() { 20940 function CFFOffsetTracker() { 20941 this.offsets = Object.create(null); 20942 } 20943 CFFOffsetTracker.prototype = { 20944 isTracking: function CFFOffsetTracker_isTracking(key) { 20945 return key in this.offsets; 20946 }, 20947 track: function CFFOffsetTracker_track(key, location) { 20948 if (key in this.offsets) { 20949 error('Already tracking location of ' + key); 20950 } 20951 this.offsets[key] = location; 20952 }, 20953 offset: function CFFOffsetTracker_offset(value) { 20954 for (var key in this.offsets) { 20955 this.offsets[key] += value; 20956 } 20957 }, 20958 setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, values, output) { 20959 if (!(key in this.offsets)) { 20960 error('Not tracking location of ' + key); 20961 } 20962 var data = output.data; 20963 var dataOffset = this.offsets[key]; 20964 var size = 5; 20965 for (var i = 0, ii = values.length; i < ii; ++i) { 20966 var offset0 = i * size + dataOffset; 20967 var offset1 = offset0 + 1; 20968 var offset2 = offset0 + 2; 20969 var offset3 = offset0 + 3; 20970 var offset4 = offset0 + 4; 20971 if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { 20972 error('writing to an offset that is not empty'); 20973 } 20974 var value = values[i]; 20975 data[offset0] = 0x1d; 20976 data[offset1] = value >> 24 & 0xFF; 20977 data[offset2] = value >> 16 & 0xFF; 20978 data[offset3] = value >> 8 & 0xFF; 20979 data[offset4] = value & 0xFF; 20980 } 20981 } 20982 }; 20983 return CFFOffsetTracker; 20984}(); 20985var CFFCompiler = function CFFCompilerClosure() { 20986 function CFFCompiler(cff) { 20987 this.cff = cff; 20988 } 20989 CFFCompiler.prototype = { 20990 compile: function CFFCompiler_compile() { 20991 var cff = this.cff; 20992 var output = { 20993 data: [], 20994 length: 0, 20995 add: function CFFCompiler_add(data) { 20996 this.data = this.data.concat(data); 20997 this.length = this.data.length; 20998 } 20999 }; 21000 var header = this.compileHeader(cff.header); 21001 output.add(header); 21002 var nameIndex = this.compileNameIndex(cff.names); 21003 output.add(nameIndex); 21004 if (cff.isCIDFont) { 21005 if (cff.topDict.hasName('FontMatrix')) { 21006 var base = cff.topDict.getByName('FontMatrix'); 21007 cff.topDict.removeByName('FontMatrix'); 21008 for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { 21009 var subDict = cff.fdArray[i]; 21010 var matrix = base.slice(0); 21011 if (subDict.hasName('FontMatrix')) { 21012 matrix = Util.transform(matrix, subDict.getByName('FontMatrix')); 21013 } 21014 subDict.setByName('FontMatrix', matrix); 21015 } 21016 } 21017 } 21018 var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); 21019 output.add(compiled.output); 21020 var topDictTracker = compiled.trackers[0]; 21021 var stringIndex = this.compileStringIndex(cff.strings.strings); 21022 output.add(stringIndex); 21023 var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); 21024 output.add(globalSubrIndex); 21025 if (cff.encoding && cff.topDict.hasName('Encoding')) { 21026 if (cff.encoding.predefined) { 21027 topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], output); 21028 } else { 21029 var encoding = this.compileEncoding(cff.encoding); 21030 topDictTracker.setEntryLocation('Encoding', [output.length], output); 21031 output.add(encoding); 21032 } 21033 } 21034 if (cff.charset && cff.topDict.hasName('charset')) { 21035 if (cff.charset.predefined) { 21036 topDictTracker.setEntryLocation('charset', [cff.charset.format], output); 21037 } else { 21038 var charset = this.compileCharset(cff.charset); 21039 topDictTracker.setEntryLocation('charset', [output.length], output); 21040 output.add(charset); 21041 } 21042 } 21043 var charStrings = this.compileCharStrings(cff.charStrings); 21044 topDictTracker.setEntryLocation('CharStrings', [output.length], output); 21045 output.add(charStrings); 21046 if (cff.isCIDFont) { 21047 topDictTracker.setEntryLocation('FDSelect', [output.length], output); 21048 var fdSelect = this.compileFDSelect(cff.fdSelect.raw); 21049 output.add(fdSelect); 21050 compiled = this.compileTopDicts(cff.fdArray, output.length, true); 21051 topDictTracker.setEntryLocation('FDArray', [output.length], output); 21052 output.add(compiled.output); 21053 var fontDictTrackers = compiled.trackers; 21054 this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); 21055 } 21056 this.compilePrivateDicts([cff.topDict], [topDictTracker], output); 21057 output.add([0]); 21058 return output.data; 21059 }, 21060 encodeNumber: function CFFCompiler_encodeNumber(value) { 21061 if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { 21062 return this.encodeInteger(value); 21063 } 21064 return this.encodeFloat(value); 21065 }, 21066 encodeFloat: function CFFCompiler_encodeFloat(num) { 21067 var value = num.toString(); 21068 var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); 21069 if (m) { 21070 var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); 21071 value = (Math.round(num * epsilon) / epsilon).toString(); 21072 } 21073 var nibbles = ''; 21074 var i, ii; 21075 for (i = 0, ii = value.length; i < ii; ++i) { 21076 var a = value[i]; 21077 if (a === 'e') { 21078 nibbles += value[++i] === '-' ? 'c' : 'b'; 21079 } else if (a === '.') { 21080 nibbles += 'a'; 21081 } else if (a === '-') { 21082 nibbles += 'e'; 21083 } else { 21084 nibbles += a; 21085 } 21086 } 21087 nibbles += nibbles.length & 1 ? 'f' : 'ff'; 21088 var out = [30]; 21089 for (i = 0, ii = nibbles.length; i < ii; i += 2) { 21090 out.push(parseInt(nibbles.substr(i, 2), 16)); 21091 } 21092 return out; 21093 }, 21094 encodeInteger: function CFFCompiler_encodeInteger(value) { 21095 var code; 21096 if (value >= -107 && value <= 107) { 21097 code = [value + 139]; 21098 } else if (value >= 108 && value <= 1131) { 21099 value = value - 108; 21100 code = [ 21101 (value >> 8) + 247, 21102 value & 0xFF 21103 ]; 21104 } else if (value >= -1131 && value <= -108) { 21105 value = -value - 108; 21106 code = [ 21107 (value >> 8) + 251, 21108 value & 0xFF 21109 ]; 21110 } else if (value >= -32768 && value <= 32767) { 21111 code = [ 21112 0x1c, 21113 value >> 8 & 0xFF, 21114 value & 0xFF 21115 ]; 21116 } else { 21117 code = [ 21118 0x1d, 21119 value >> 24 & 0xFF, 21120 value >> 16 & 0xFF, 21121 value >> 8 & 0xFF, 21122 value & 0xFF 21123 ]; 21124 } 21125 return code; 21126 }, 21127 compileHeader: function CFFCompiler_compileHeader(header) { 21128 return [ 21129 header.major, 21130 header.minor, 21131 header.hdrSize, 21132 header.offSize 21133 ]; 21134 }, 21135 compileNameIndex: function CFFCompiler_compileNameIndex(names) { 21136 var nameIndex = new CFFIndex(); 21137 for (var i = 0, ii = names.length; i < ii; ++i) { 21138 nameIndex.add(stringToBytes(names[i])); 21139 } 21140 return this.compileIndex(nameIndex); 21141 }, 21142 compileTopDicts: function CFFCompiler_compileTopDicts(dicts, length, removeCidKeys) { 21143 var fontDictTrackers = []; 21144 var fdArrayIndex = new CFFIndex(); 21145 for (var i = 0, ii = dicts.length; i < ii; ++i) { 21146 var fontDict = dicts[i]; 21147 if (removeCidKeys) { 21148 fontDict.removeByName('CIDFontVersion'); 21149 fontDict.removeByName('CIDFontRevision'); 21150 fontDict.removeByName('CIDFontType'); 21151 fontDict.removeByName('CIDCount'); 21152 fontDict.removeByName('UIDBase'); 21153 } 21154 var fontDictTracker = new CFFOffsetTracker(); 21155 var fontDictData = this.compileDict(fontDict, fontDictTracker); 21156 fontDictTrackers.push(fontDictTracker); 21157 fdArrayIndex.add(fontDictData); 21158 fontDictTracker.offset(length); 21159 } 21160 fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); 21161 return { 21162 trackers: fontDictTrackers, 21163 output: fdArrayIndex 21164 }; 21165 }, 21166 compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, trackers, output) { 21167 for (var i = 0, ii = dicts.length; i < ii; ++i) { 21168 var fontDict = dicts[i]; 21169 assert(fontDict.privateDict && fontDict.hasName('Private'), 'There must be an private dictionary.'); 21170 var privateDict = fontDict.privateDict; 21171 var privateDictTracker = new CFFOffsetTracker(); 21172 var privateDictData = this.compileDict(privateDict, privateDictTracker); 21173 var outputLength = output.length; 21174 privateDictTracker.offset(outputLength); 21175 if (!privateDictData.length) { 21176 outputLength = 0; 21177 } 21178 trackers[i].setEntryLocation('Private', [ 21179 privateDictData.length, 21180 outputLength 21181 ], output); 21182 output.add(privateDictData); 21183 if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { 21184 var subrs = this.compileIndex(privateDict.subrsIndex); 21185 privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], output); 21186 output.add(subrs); 21187 } 21188 } 21189 }, 21190 compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { 21191 var out = []; 21192 var order = dict.order; 21193 for (var i = 0; i < order.length; ++i) { 21194 var key = order[i]; 21195 if (!(key in dict.values)) { 21196 continue; 21197 } 21198 var values = dict.values[key]; 21199 var types = dict.types[key]; 21200 if (!isArray(types)) { 21201 types = [types]; 21202 } 21203 if (!isArray(values)) { 21204 values = [values]; 21205 } 21206 if (values.length === 0) { 21207 continue; 21208 } 21209 for (var j = 0, jj = types.length; j < jj; ++j) { 21210 var type = types[j]; 21211 var value = values[j]; 21212 switch (type) { 21213 case 'num': 21214 case 'sid': 21215 out = out.concat(this.encodeNumber(value)); 21216 break; 21217 case 'offset': 21218 var name = dict.keyToNameMap[key]; 21219 if (!offsetTracker.isTracking(name)) { 21220 offsetTracker.track(name, out.length); 21221 } 21222 out = out.concat([ 21223 0x1d, 21224 0, 21225 0, 21226 0, 21227 0 21228 ]); 21229 break; 21230 case 'array': 21231 case 'delta': 21232 out = out.concat(this.encodeNumber(value)); 21233 for (var k = 1, kk = values.length; k < kk; ++k) { 21234 out = out.concat(this.encodeNumber(values[k])); 21235 } 21236 break; 21237 default: 21238 error('Unknown data type of ' + type); 21239 break; 21240 } 21241 } 21242 out = out.concat(dict.opcodes[key]); 21243 } 21244 return out; 21245 }, 21246 compileStringIndex: function CFFCompiler_compileStringIndex(strings) { 21247 var stringIndex = new CFFIndex(); 21248 for (var i = 0, ii = strings.length; i < ii; ++i) { 21249 stringIndex.add(stringToBytes(strings[i])); 21250 } 21251 return this.compileIndex(stringIndex); 21252 }, 21253 compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { 21254 var globalSubrIndex = this.cff.globalSubrIndex; 21255 this.out.writeByteArray(this.compileIndex(globalSubrIndex)); 21256 }, 21257 compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { 21258 return this.compileIndex(charStrings); 21259 }, 21260 compileCharset: function CFFCompiler_compileCharset(charset) { 21261 return this.compileTypedArray(charset.raw); 21262 }, 21263 compileEncoding: function CFFCompiler_compileEncoding(encoding) { 21264 return this.compileTypedArray(encoding.raw); 21265 }, 21266 compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { 21267 return this.compileTypedArray(fdSelect); 21268 }, 21269 compileTypedArray: function CFFCompiler_compileTypedArray(data) { 21270 var out = []; 21271 for (var i = 0, ii = data.length; i < ii; ++i) { 21272 out[i] = data[i]; 21273 } 21274 return out; 21275 }, 21276 compileIndex: function CFFCompiler_compileIndex(index, trackers) { 21277 trackers = trackers || []; 21278 var objects = index.objects; 21279 var count = objects.length; 21280 if (count === 0) { 21281 return [ 21282 0, 21283 0, 21284 0 21285 ]; 21286 } 21287 var data = [ 21288 count >> 8 & 0xFF, 21289 count & 0xff 21290 ]; 21291 var lastOffset = 1, i; 21292 for (i = 0; i < count; ++i) { 21293 lastOffset += objects[i].length; 21294 } 21295 var offsetSize; 21296 if (lastOffset < 0x100) { 21297 offsetSize = 1; 21298 } else if (lastOffset < 0x10000) { 21299 offsetSize = 2; 21300 } else if (lastOffset < 0x1000000) { 21301 offsetSize = 3; 21302 } else { 21303 offsetSize = 4; 21304 } 21305 data.push(offsetSize); 21306 var relativeOffset = 1; 21307 for (i = 0; i < count + 1; i++) { 21308 if (offsetSize === 1) { 21309 data.push(relativeOffset & 0xFF); 21310 } else if (offsetSize === 2) { 21311 data.push(relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 21312 } else if (offsetSize === 3) { 21313 data.push(relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 21314 } else { 21315 data.push(relativeOffset >>> 24 & 0xFF, relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 21316 } 21317 if (objects[i]) { 21318 relativeOffset += objects[i].length; 21319 } 21320 } 21321 for (i = 0; i < count; i++) { 21322 if (trackers[i]) { 21323 trackers[i].offset(data.length); 21324 } 21325 for (var j = 0, jj = objects[i].length; j < jj; j++) { 21326 data.push(objects[i][j]); 21327 } 21328 } 21329 return data; 21330 } 21331 }; 21332 return CFFCompiler; 21333}(); 21334exports.CFFStandardStrings = CFFStandardStrings; 21335exports.CFFParser = CFFParser; 21336exports.CFF = CFF; 21337exports.CFFHeader = CFFHeader; 21338exports.CFFStrings = CFFStrings; 21339exports.CFFIndex = CFFIndex; 21340exports.CFFCharset = CFFCharset; 21341exports.CFFTopDict = CFFTopDict; 21342exports.CFFPrivateDict = CFFPrivateDict; 21343exports.CFFCompiler = CFFCompiler; 21344 21345/***/ }), 21346/* 12 */ 21347/***/ (function(module, exports, __w_pdfjs_require__) { 21348 21349"use strict"; 21350 21351var sharedUtil = __w_pdfjs_require__(0); 21352var MissingDataException = sharedUtil.MissingDataException; 21353var arrayByteLength = sharedUtil.arrayByteLength; 21354var arraysToBytes = sharedUtil.arraysToBytes; 21355var assert = sharedUtil.assert; 21356var createPromiseCapability = sharedUtil.createPromiseCapability; 21357var isInt = sharedUtil.isInt; 21358var isEmptyObj = sharedUtil.isEmptyObj; 21359var ChunkedStream = function ChunkedStreamClosure() { 21360 function ChunkedStream(length, chunkSize, manager) { 21361 this.bytes = new Uint8Array(length); 21362 this.start = 0; 21363 this.pos = 0; 21364 this.end = length; 21365 this.chunkSize = chunkSize; 21366 this.loadedChunks = []; 21367 this.numChunksLoaded = 0; 21368 this.numChunks = Math.ceil(length / chunkSize); 21369 this.manager = manager; 21370 this.progressiveDataLength = 0; 21371 this.lastSuccessfulEnsureByteChunk = -1; 21372 } 21373 ChunkedStream.prototype = { 21374 getMissingChunks: function ChunkedStream_getMissingChunks() { 21375 var chunks = []; 21376 for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { 21377 if (!this.loadedChunks[chunk]) { 21378 chunks.push(chunk); 21379 } 21380 } 21381 return chunks; 21382 }, 21383 getBaseStreams: function ChunkedStream_getBaseStreams() { 21384 return [this]; 21385 }, 21386 allChunksLoaded: function ChunkedStream_allChunksLoaded() { 21387 return this.numChunksLoaded === this.numChunks; 21388 }, 21389 onReceiveData: function ChunkedStream_onReceiveData(begin, chunk) { 21390 var end = begin + chunk.byteLength; 21391 assert(begin % this.chunkSize === 0, 'Bad begin offset: ' + begin); 21392 var length = this.bytes.length; 21393 assert(end % this.chunkSize === 0 || end === length, 'Bad end offset: ' + end); 21394 this.bytes.set(new Uint8Array(chunk), begin); 21395 var chunkSize = this.chunkSize; 21396 var beginChunk = Math.floor(begin / chunkSize); 21397 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 21398 var curChunk; 21399 for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 21400 if (!this.loadedChunks[curChunk]) { 21401 this.loadedChunks[curChunk] = true; 21402 ++this.numChunksLoaded; 21403 } 21404 } 21405 }, 21406 onReceiveProgressiveData: function ChunkedStream_onReceiveProgressiveData(data) { 21407 var position = this.progressiveDataLength; 21408 var beginChunk = Math.floor(position / this.chunkSize); 21409 this.bytes.set(new Uint8Array(data), position); 21410 position += data.byteLength; 21411 this.progressiveDataLength = position; 21412 var endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); 21413 var curChunk; 21414 for (curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 21415 if (!this.loadedChunks[curChunk]) { 21416 this.loadedChunks[curChunk] = true; 21417 ++this.numChunksLoaded; 21418 } 21419 } 21420 }, 21421 ensureByte: function ChunkedStream_ensureByte(pos) { 21422 var chunk = Math.floor(pos / this.chunkSize); 21423 if (chunk === this.lastSuccessfulEnsureByteChunk) { 21424 return; 21425 } 21426 if (!this.loadedChunks[chunk]) { 21427 throw new MissingDataException(pos, pos + 1); 21428 } 21429 this.lastSuccessfulEnsureByteChunk = chunk; 21430 }, 21431 ensureRange: function ChunkedStream_ensureRange(begin, end) { 21432 if (begin >= end) { 21433 return; 21434 } 21435 if (end <= this.progressiveDataLength) { 21436 return; 21437 } 21438 var chunkSize = this.chunkSize; 21439 var beginChunk = Math.floor(begin / chunkSize); 21440 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 21441 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 21442 if (!this.loadedChunks[chunk]) { 21443 throw new MissingDataException(begin, end); 21444 } 21445 } 21446 }, 21447 nextEmptyChunk: function ChunkedStream_nextEmptyChunk(beginChunk) { 21448 var chunk, numChunks = this.numChunks; 21449 for (var i = 0; i < numChunks; ++i) { 21450 chunk = (beginChunk + i) % numChunks; 21451 if (!this.loadedChunks[chunk]) { 21452 return chunk; 21453 } 21454 } 21455 return null; 21456 }, 21457 hasChunk: function ChunkedStream_hasChunk(chunk) { 21458 return !!this.loadedChunks[chunk]; 21459 }, 21460 get length() { 21461 return this.end - this.start; 21462 }, 21463 get isEmpty() { 21464 return this.length === 0; 21465 }, 21466 getByte: function ChunkedStream_getByte() { 21467 var pos = this.pos; 21468 if (pos >= this.end) { 21469 return -1; 21470 } 21471 this.ensureByte(pos); 21472 return this.bytes[this.pos++]; 21473 }, 21474 getUint16: function ChunkedStream_getUint16() { 21475 var b0 = this.getByte(); 21476 var b1 = this.getByte(); 21477 if (b0 === -1 || b1 === -1) { 21478 return -1; 21479 } 21480 return (b0 << 8) + b1; 21481 }, 21482 getInt32: function ChunkedStream_getInt32() { 21483 var b0 = this.getByte(); 21484 var b1 = this.getByte(); 21485 var b2 = this.getByte(); 21486 var b3 = this.getByte(); 21487 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 21488 }, 21489 getBytes: function ChunkedStream_getBytes(length) { 21490 var bytes = this.bytes; 21491 var pos = this.pos; 21492 var strEnd = this.end; 21493 if (!length) { 21494 this.ensureRange(pos, strEnd); 21495 return bytes.subarray(pos, strEnd); 21496 } 21497 var end = pos + length; 21498 if (end > strEnd) { 21499 end = strEnd; 21500 } 21501 this.ensureRange(pos, end); 21502 this.pos = end; 21503 return bytes.subarray(pos, end); 21504 }, 21505 peekByte: function ChunkedStream_peekByte() { 21506 var peekedByte = this.getByte(); 21507 this.pos--; 21508 return peekedByte; 21509 }, 21510 peekBytes: function ChunkedStream_peekBytes(length) { 21511 var bytes = this.getBytes(length); 21512 this.pos -= bytes.length; 21513 return bytes; 21514 }, 21515 getByteRange: function ChunkedStream_getBytes(begin, end) { 21516 this.ensureRange(begin, end); 21517 return this.bytes.subarray(begin, end); 21518 }, 21519 skip: function ChunkedStream_skip(n) { 21520 if (!n) { 21521 n = 1; 21522 } 21523 this.pos += n; 21524 }, 21525 reset: function ChunkedStream_reset() { 21526 this.pos = this.start; 21527 }, 21528 moveStart: function ChunkedStream_moveStart() { 21529 this.start = this.pos; 21530 }, 21531 makeSubStream: function ChunkedStream_makeSubStream(start, length, dict) { 21532 this.ensureRange(start, start + length); 21533 function ChunkedStreamSubstream() { 21534 } 21535 ChunkedStreamSubstream.prototype = Object.create(this);
vendor: 1,442 bytes, lines 21536-21576
21536 ChunkedStreamSubstream.prototype.getMissingChunks = function () { 21537 var chunkSize = this.chunkSize; 21538 var beginChunk = Math.floor(this.start / chunkSize); 21539 var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; 21540 var missingChunks = []; 21541 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 21542 if (!this.loadedChunks[chunk]) { 21543 missingChunks.push(chunk); 21544 } 21545 } 21546 return missingChunks; 21547 }; 21548 var subStream = new ChunkedStreamSubstream(); 21549 subStream.pos = subStream.start = start; 21550 subStream.end = start + length || this.end; 21551 subStream.dict = dict; 21552 return subStream; 21553 } 21554 }; 21555 return ChunkedStream; 21556}(); 21557var ChunkedStreamManager = function ChunkedStreamManagerClosure() { 21558 function ChunkedStreamManager(pdfNetworkStream, args) { 21559 var chunkSize = args.rangeChunkSize; 21560 var length = args.length; 21561 this.stream = new ChunkedStream(length, chunkSize, this); 21562 this.length = length; 21563 this.chunkSize = chunkSize; 21564 this.pdfNetworkStream = pdfNetworkStream; 21565 this.url = args.url; 21566 this.disableAutoFetch = args.disableAutoFetch; 21567 this.msgHandler = args.msgHandler; 21568 this.currRequestId = 0; 21569 this.chunksNeededByRequest = Object.create(null); 21570 this.requestsByChunk = Object.create(null); 21571 this.promisesByRequest = Object.create(null); 21572 this.progressiveDataLength = 0; 21573 this.aborted = false; 21574 this._loadedStreamCapability = createPromiseCapability(); 21575 } 21576 ChunkedStreamManager.prototype = {
vendor: 6,813 bytes, lines 21577-21787
21577 onLoadedStream: function ChunkedStreamManager_getLoadedStream() { 21578 return this._loadedStreamCapability.promise; 21579 }, 21580 sendRequest: function ChunkedStreamManager_sendRequest(begin, end) { 21581 var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); 21582 if (!rangeReader.isStreamingSupported) { 21583 rangeReader.onProgress = this.onProgress.bind(this); 21584 } 21585 var chunks = [], loaded = 0; 21586 var manager = this; 21587 var promise = new Promise(function (resolve, reject) { 21588 var readChunk = function (chunk) { 21589 try { 21590 if (!chunk.done) { 21591 var data = chunk.value; 21592 chunks.push(data); 21593 loaded += arrayByteLength(data); 21594 if (rangeReader.isStreamingSupported) { 21595 manager.onProgress({ loaded: loaded }); 21596 } 21597 rangeReader.read().then(readChunk, reject); 21598 return; 21599 } 21600 var chunkData = arraysToBytes(chunks); 21601 chunks = null; 21602 resolve(chunkData); 21603 } catch (e) { 21604 reject(e); 21605 } 21606 }; 21607 rangeReader.read().then(readChunk, reject); 21608 }); 21609 promise.then(function (data) { 21610 if (this.aborted) { 21611 return; 21612 } 21613 this.onReceiveData({ 21614 chunk: data, 21615 begin: begin 21616 }); 21617 }.bind(this)); 21618 }, 21619 requestAllChunks: function ChunkedStreamManager_requestAllChunks() { 21620 var missingChunks = this.stream.getMissingChunks(); 21621 this._requestChunks(missingChunks); 21622 return this._loadedStreamCapability.promise; 21623 }, 21624 _requestChunks: function ChunkedStreamManager_requestChunks(chunks) { 21625 var requestId = this.currRequestId++; 21626 var i, ii; 21627 var chunksNeeded = Object.create(null); 21628 this.chunksNeededByRequest[requestId] = chunksNeeded; 21629 for (i = 0, ii = chunks.length; i < ii; i++) { 21630 if (!this.stream.hasChunk(chunks[i])) { 21631 chunksNeeded[chunks[i]] = true; 21632 } 21633 } 21634 if (isEmptyObj(chunksNeeded)) { 21635 return Promise.resolve(); 21636 } 21637 var capability = createPromiseCapability(); 21638 this.promisesByRequest[requestId] = capability; 21639 var chunksToRequest = []; 21640 for (var chunk in chunksNeeded) { 21641 chunk = chunk | 0; 21642 if (!(chunk in this.requestsByChunk)) { 21643 this.requestsByChunk[chunk] = []; 21644 chunksToRequest.push(chunk); 21645 } 21646 this.requestsByChunk[chunk].push(requestId); 21647 } 21648 if (!chunksToRequest.length) { 21649 return capability.promise; 21650 } 21651 var groupedChunksToRequest = this.groupChunks(chunksToRequest); 21652 for (i = 0; i < groupedChunksToRequest.length; ++i) { 21653 var groupedChunk = groupedChunksToRequest[i]; 21654 var begin = groupedChunk.beginChunk * this.chunkSize; 21655 var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); 21656 this.sendRequest(begin, end); 21657 } 21658 return capability.promise; 21659 }, 21660 getStream: function ChunkedStreamManager_getStream() { 21661 return this.stream; 21662 }, 21663 requestRange: function ChunkedStreamManager_requestRange(begin, end) { 21664 end = Math.min(end, this.length); 21665 var beginChunk = this.getBeginChunk(begin); 21666 var endChunk = this.getEndChunk(end); 21667 var chunks = []; 21668 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 21669 chunks.push(chunk); 21670 } 21671 return this._requestChunks(chunks); 21672 }, 21673 requestRanges: function ChunkedStreamManager_requestRanges(ranges) { 21674 ranges = ranges || []; 21675 var chunksToRequest = []; 21676 for (var i = 0; i < ranges.length; i++) { 21677 var beginChunk = this.getBeginChunk(ranges[i].begin); 21678 var endChunk = this.getEndChunk(ranges[i].end); 21679 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 21680 if (chunksToRequest.indexOf(chunk) < 0) { 21681 chunksToRequest.push(chunk); 21682 } 21683 } 21684 } 21685 chunksToRequest.sort(function (a, b) { 21686 return a - b; 21687 }); 21688 return this._requestChunks(chunksToRequest); 21689 }, 21690 groupChunks: function ChunkedStreamManager_groupChunks(chunks) { 21691 var groupedChunks = []; 21692 var beginChunk = -1; 21693 var prevChunk = -1; 21694 for (var i = 0; i < chunks.length; ++i) { 21695 var chunk = chunks[i]; 21696 if (beginChunk < 0) { 21697 beginChunk = chunk; 21698 } 21699 if (prevChunk >= 0 && prevChunk + 1 !== chunk) { 21700 groupedChunks.push({ 21701 beginChunk: beginChunk, 21702 endChunk: prevChunk + 1 21703 }); 21704 beginChunk = chunk; 21705 } 21706 if (i + 1 === chunks.length) { 21707 groupedChunks.push({ 21708 beginChunk: beginChunk, 21709 endChunk: chunk + 1 21710 }); 21711 } 21712 prevChunk = chunk; 21713 } 21714 return groupedChunks; 21715 }, 21716 onProgress: function ChunkedStreamManager_onProgress(args) { 21717 var bytesLoaded = this.stream.numChunksLoaded * this.chunkSize + args.loaded; 21718 this.msgHandler.send('DocProgress', { 21719 loaded: bytesLoaded, 21720 total: this.length 21721 }); 21722 }, 21723 onReceiveData: function ChunkedStreamManager_onReceiveData(args) { 21724 var chunk = args.chunk; 21725 var isProgressive = args.begin === undefined; 21726 var begin = isProgressive ? this.progressiveDataLength : args.begin; 21727 var end = begin + chunk.byteLength; 21728 var beginChunk = Math.floor(begin / this.chunkSize); 21729 var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize); 21730 if (isProgressive) { 21731 this.stream.onReceiveProgressiveData(chunk); 21732 this.progressiveDataLength = end; 21733 } else { 21734 this.stream.onReceiveData(begin, chunk); 21735 } 21736 if (this.stream.allChunksLoaded()) { 21737 this._loadedStreamCapability.resolve(this.stream); 21738 } 21739 var loadedRequests = []; 21740 var i, requestId; 21741 for (chunk = beginChunk; chunk < endChunk; ++chunk) { 21742 var requestIds = this.requestsByChunk[chunk] || []; 21743 delete this.requestsByChunk[chunk]; 21744 for (i = 0; i < requestIds.length; ++i) { 21745 requestId = requestIds[i]; 21746 var chunksNeeded = this.chunksNeededByRequest[requestId]; 21747 if (chunk in chunksNeeded) { 21748 delete chunksNeeded[chunk]; 21749 } 21750 if (!isEmptyObj(chunksNeeded)) { 21751 continue; 21752 } 21753 loadedRequests.push(requestId); 21754 } 21755 } 21756 if (!this.disableAutoFetch && isEmptyObj(this.requestsByChunk)) { 21757 var nextEmptyChunk; 21758 if (this.stream.numChunksLoaded === 1) { 21759 var lastChunk = this.stream.numChunks - 1; 21760 if (!this.stream.hasChunk(lastChunk)) { 21761 nextEmptyChunk = lastChunk; 21762 } 21763 } else { 21764 nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); 21765 } 21766 if (isInt(nextEmptyChunk)) { 21767 this._requestChunks([nextEmptyChunk]); 21768 } 21769 } 21770 for (i = 0; i < loadedRequests.length; ++i) { 21771 requestId = loadedRequests[i]; 21772 var capability = this.promisesByRequest[requestId]; 21773 delete this.promisesByRequest[requestId]; 21774 capability.resolve(); 21775 } 21776 this.msgHandler.send('DocProgress', { 21777 loaded: this.stream.numChunksLoaded * this.chunkSize, 21778 total: this.length 21779 }); 21780 }, 21781 onError: function ChunkedStreamManager_onError(err) { 21782 this._loadedStreamCapability.reject(err); 21783 }, 21784 getBeginChunk: function ChunkedStreamManager_getBeginChunk(begin) { 21785 var chunk = Math.floor(begin / this.chunkSize); 21786 return chunk; 21787 },
vendor: 7,818 bytes, lines 21788-22164
21788 getEndChunk: function ChunkedStreamManager_getEndChunk(end) { 21789 var chunk = Math.floor((end - 1) / this.chunkSize) + 1; 21790 return chunk; 21791 }, 21792 abort: function ChunkedStreamManager_abort() { 21793 this.aborted = true; 21794 if (this.pdfNetworkStream) { 21795 this.pdfNetworkStream.cancelAllRequests('abort'); 21796 } 21797 for (var requestId in this.promisesByRequest) { 21798 var capability = this.promisesByRequest[requestId]; 21799 capability.reject(new Error('Request was aborted')); 21800 } 21801 } 21802 }; 21803 return ChunkedStreamManager; 21804}(); 21805exports.ChunkedStream = ChunkedStream; 21806exports.ChunkedStreamManager = ChunkedStreamManager; 21807 21808/***/ }), 21809/* 13 */ 21810/***/ (function(module, exports, __w_pdfjs_require__) { 21811 21812"use strict"; 21813 21814var sharedUtil = __w_pdfjs_require__(0); 21815var corePrimitives = __w_pdfjs_require__(1); 21816var coreStream = __w_pdfjs_require__(2); 21817var PasswordException = sharedUtil.PasswordException; 21818var PasswordResponses = sharedUtil.PasswordResponses; 21819var bytesToString = sharedUtil.bytesToString; 21820var warn = sharedUtil.warn; 21821var error = sharedUtil.error; 21822var assert = sharedUtil.assert; 21823var isInt = sharedUtil.isInt; 21824var stringToBytes = sharedUtil.stringToBytes; 21825var utf8StringToString = sharedUtil.utf8StringToString; 21826var Name = corePrimitives.Name; 21827var isName = corePrimitives.isName; 21828var isDict = corePrimitives.isDict; 21829var DecryptStream = coreStream.DecryptStream; 21830var ARCFourCipher = function ARCFourCipherClosure() { 21831 function ARCFourCipher(key) { 21832 this.a = 0; 21833 this.b = 0; 21834 var s = new Uint8Array(256); 21835 var i, j = 0, tmp, keyLength = key.length; 21836 for (i = 0; i < 256; ++i) { 21837 s[i] = i; 21838 } 21839 for (i = 0; i < 256; ++i) { 21840 tmp = s[i]; 21841 j = j + tmp + key[i % keyLength] & 0xFF; 21842 s[i] = s[j]; 21843 s[j] = tmp; 21844 } 21845 this.s = s; 21846 } 21847 ARCFourCipher.prototype = { 21848 encryptBlock: function ARCFourCipher_encryptBlock(data) { 21849 var i, n = data.length, tmp, tmp2; 21850 var a = this.a, b = this.b, s = this.s; 21851 var output = new Uint8Array(n); 21852 for (i = 0; i < n; ++i) { 21853 a = a + 1 & 0xFF; 21854 tmp = s[a]; 21855 b = b + tmp & 0xFF; 21856 tmp2 = s[b]; 21857 s[a] = tmp2; 21858 s[b] = tmp; 21859 output[i] = data[i] ^ s[tmp + tmp2 & 0xFF]; 21860 } 21861 this.a = a; 21862 this.b = b; 21863 return output; 21864 } 21865 }; 21866 ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; 21867 return ARCFourCipher; 21868}(); 21869var calculateMD5 = function calculateMD5Closure() { 21870 var r = new Uint8Array([ 21871 7, 21872 12, 21873 17, 21874 22, 21875 7, 21876 12, 21877 17, 21878 22, 21879 7, 21880 12, 21881 17, 21882 22, 21883 7, 21884 12, 21885 17, 21886 22, 21887 5, 21888 9, 21889 14, 21890 20, 21891 5, 21892 9, 21893 14, 21894 20, 21895 5, 21896 9, 21897 14, 21898 20, 21899 5, 21900 9, 21901 14, 21902 20, 21903 4, 21904 11, 21905 16, 21906 23, 21907 4, 21908 11, 21909 16, 21910 23, 21911 4, 21912 11, 21913 16, 21914 23, 21915 4, 21916 11, 21917 16, 21918 23, 21919 6, 21920 10, 21921 15, 21922 21, 21923 6, 21924 10, 21925 15, 21926 21, 21927 6, 21928 10, 21929 15, 21930 21, 21931 6, 21932 10, 21933 15, 21934 21 21935 ]); 21936 var k = new Int32Array([ 21937 -680876936, 21938 -389564586, 21939 606105819, 21940 -1044525330, 21941 -176418897, 21942 1200080426, 21943 -1473231341, 21944 -45705983, 21945 1770035416, 21946 -1958414417, 21947 -42063, 21948 -1990404162, 21949 1804603682, 21950 -40341101, 21951 -1502002290, 21952 1236535329, 21953 -165796510, 21954 -1069501632, 21955 643717713, 21956 -373897302, 21957 -701558691, 21958 38016083, 21959 -660478335, 21960 -405537848, 21961 568446438, 21962 -1019803690, 21963 -187363961, 21964 1163531501, 21965 -1444681467, 21966 -51403784, 21967 1735328473, 21968 -1926607734, 21969 -378558, 21970 -2022574463, 21971 1839030562, 21972 -35309556, 21973 -1530992060, 21974 1272893353, 21975 -155497632, 21976 -1094730640, 21977 681279174, 21978 -358537222, 21979 -722521979, 21980 76029189, 21981 -640364487, 21982 -421815835, 21983 530742520, 21984 -995338651, 21985 -198630844, 21986 1126891415, 21987 -1416354905, 21988 -57434055, 21989 1700485571, 21990 -1894986606, 21991 -1051523, 21992 -2054922799, 21993 1873313359, 21994 -30611744, 21995 -1560198380, 21996 1309151649, 21997 -145523070, 21998 -1120210379, 21999 718787259, 22000 -343485551 22001 ]); 22002 function hash(data, offset, length) { 22003 var h0 = 1732584193, h1 = -271733879, h2 = -1732584194, h3 = 271733878; 22004 var paddedLength = length + 72 & ~63; 22005 var padded = new Uint8Array(paddedLength); 22006 var i, j, n; 22007 for (i = 0; i < length; ++i) { 22008 padded[i] = data[offset++]; 22009 } 22010 padded[i++] = 0x80; 22011 n = paddedLength - 8; 22012 while (i < n) { 22013 padded[i++] = 0; 22014 } 22015 padded[i++] = length << 3 & 0xFF; 22016 padded[i++] = length >> 5 & 0xFF; 22017 padded[i++] = length >> 13 & 0xFF; 22018 padded[i++] = length >> 21 & 0xFF; 22019 padded[i++] = length >>> 29 & 0xFF; 22020 padded[i++] = 0; 22021 padded[i++] = 0; 22022 padded[i++] = 0; 22023 var w = new Int32Array(16); 22024 for (i = 0; i < paddedLength;) { 22025 for (j = 0; j < 16; ++j, i += 4) { 22026 w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; 22027 } 22028 var a = h0, b = h1, c = h2, d = h3, f, g; 22029 for (j = 0; j < 64; ++j) { 22030 if (j < 16) { 22031 f = b & c | ~b & d; 22032 g = j; 22033 } else if (j < 32) { 22034 f = d & b | ~d & c; 22035 g = 5 * j + 1 & 15; 22036 } else if (j < 48) { 22037 f = b ^ c ^ d; 22038 g = 3 * j + 5 & 15; 22039 } else { 22040 f = c ^ (b | ~d); 22041 g = 7 * j & 15; 22042 } 22043 var tmp = d, rotateArg = a + f + k[j] + w[g] | 0, rotate = r[j]; 22044 d = c; 22045 c = b; 22046 b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; 22047 a = tmp; 22048 } 22049 h0 = h0 + a | 0; 22050 h1 = h1 + b | 0; 22051 h2 = h2 + c | 0; 22052 h3 = h3 + d | 0; 22053 } 22054 return new Uint8Array([ 22055 h0 & 0xFF, 22056 h0 >> 8 & 0xFF, 22057 h0 >> 16 & 0xFF, 22058 h0 >>> 24 & 0xFF, 22059 h1 & 0xFF, 22060 h1 >> 8 & 0xFF, 22061 h1 >> 16 & 0xFF, 22062 h1 >>> 24 & 0xFF, 22063 h2 & 0xFF, 22064 h2 >> 8 & 0xFF, 22065 h2 >> 16 & 0xFF, 22066 h2 >>> 24 & 0xFF, 22067 h3 & 0xFF, 22068 h3 >> 8 & 0xFF, 22069 h3 >> 16 & 0xFF, 22070 h3 >>> 24 & 0xFF 22071 ]); 22072 } 22073 return hash; 22074}(); 22075var Word64 = function Word64Closure() { 22076 function Word64(highInteger, lowInteger) { 22077 this.high = highInteger | 0; 22078 this.low = lowInteger | 0; 22079 } 22080 Word64.prototype = { 22081 and: function Word64_and(word) { 22082 this.high &= word.high; 22083 this.low &= word.low; 22084 }, 22085 xor: function Word64_xor(word) { 22086 this.high ^= word.high; 22087 this.low ^= word.low; 22088 }, 22089 or: function Word64_or(word) { 22090 this.high |= word.high; 22091 this.low |= word.low; 22092 }, 22093 shiftRight: function Word64_shiftRight(places) { 22094 if (places >= 32) { 22095 this.low = this.high >>> places - 32 | 0; 22096 this.high = 0; 22097 } else { 22098 this.low = this.low >>> places | this.high << 32 - places; 22099 this.high = this.high >>> places | 0; 22100 } 22101 }, 22102 shiftLeft: function Word64_shiftLeft(places) { 22103 if (places >= 32) { 22104 this.high = this.low << places - 32; 22105 this.low = 0; 22106 } else { 22107 this.high = this.high << places | this.low >>> 32 - places; 22108 this.low = this.low << places; 22109 } 22110 }, 22111 rotateRight: function Word64_rotateRight(places) { 22112 var low, high; 22113 if (places & 32) { 22114 high = this.low; 22115 low = this.high; 22116 } else { 22117 low = this.low; 22118 high = this.high; 22119 } 22120 places &= 31; 22121 this.low = low >>> places | high << 32 - places; 22122 this.high = high >>> places | low << 32 - places; 22123 }, 22124 not: function Word64_not() { 22125 this.high = ~this.high; 22126 this.low = ~this.low; 22127 }, 22128 add: function Word64_add(word) { 22129 var lowAdd = (this.low >>> 0) + (word.low >>> 0); 22130 var highAdd = (this.high >>> 0) + (word.high >>> 0); 22131 if (lowAdd > 0xFFFFFFFF) { 22132 highAdd += 1; 22133 } 22134 this.low = lowAdd | 0; 22135 this.high = highAdd | 0; 22136 }, 22137 copyTo: function Word64_copyTo(bytes, offset) { 22138 bytes[offset] = this.high >>> 24 & 0xFF; 22139 bytes[offset + 1] = this.high >> 16 & 0xFF; 22140 bytes[offset + 2] = this.high >> 8 & 0xFF; 22141 bytes[offset + 3] = this.high & 0xFF; 22142 bytes[offset + 4] = this.low >>> 24 & 0xFF; 22143 bytes[offset + 5] = this.low >> 16 & 0xFF; 22144 bytes[offset + 6] = this.low >> 8 & 0xFF; 22145 bytes[offset + 7] = this.low & 0xFF; 22146 }, 22147 assign: function Word64_assign(word) { 22148 this.high = word.high; 22149 this.low = word.low; 22150 } 22151 }; 22152 return Word64; 22153}(); 22154var calculateSHA256 = function calculateSHA256Closure() { 22155 function rotr(x, n) { 22156 return x >>> n | x << 32 - n; 22157 } 22158 function ch(x, y, z) { 22159 return x & y ^ ~x & z; 22160 } 22161 function maj(x, y, z) { 22162 return x & y ^ x & z ^ y & z; 22163 } 22164 function sigma(x) {
22165 return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); 22166 } 22167 function sigmaPrime(x) { 22168 return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); 22169 } 22170 function littleSigma(x) { 22171 return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; 22172 } 22173 function littleSigmaPrime(x) { 22174 return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; 22175 } 22176 var k = [ 22177 0x428a2f98, 22178 0x71374491, 22179 0xb5c0fbcf, 22180 0xe9b5dba5, 22181 0x3956c25b, 22182 0x59f111f1, 22183 0x923f82a4, 22184 0xab1c5ed5, 22185 0xd807aa98, 22186 0x12835b01, 22187 0x243185be, 22188 0x550c7dc3, 22189 0x72be5d74, 22190 0x80deb1fe, 22191 0x9bdc06a7, 22192 0xc19bf174, 22193 0xe49b69c1, 22194 0xefbe4786, 22195 0x0fc19dc6, 22196 0x240ca1cc, 22197 0x2de92c6f, 22198 0x4a7484aa, 22199 0x5cb0a9dc, 22200 0x76f988da, 22201 0x983e5152, 22202 0xa831c66d, 22203 0xb00327c8, 22204 0xbf597fc7, 22205 0xc6e00bf3, 22206 0xd5a79147, 22207 0x06ca6351, 22208 0x14292967, 22209 0x27b70a85, 22210 0x2e1b2138, 22211 0x4d2c6dfc, 22212 0x53380d13, 22213 0x650a7354, 22214 0x766a0abb, 22215 0x81c2c92e, 22216 0x92722c85, 22217 0xa2bfe8a1, 22218 0xa81a664b, 22219 0xc24b8b70, 22220 0xc76c51a3, 22221 0xd192e819, 22222 0xd6990624, 22223 0xf40e3585, 22224 0x106aa070, 22225 0x19a4c116, 22226 0x1e376c08, 22227 0x2748774c, 22228 0x34b0bcb5, 22229 0x391c0cb3, 22230 0x4ed8aa4a, 22231 0x5b9cca4f, 22232 0x682e6ff3,
vendor: 4,823 bytes, lines 22233-22426
22233 0x748f82ee, 22234 0x78a5636f, 22235 0x84c87814, 22236 0x8cc70208, 22237 0x90befffa, 22238 0xa4506ceb, 22239 0xbef9a3f7, 22240 0xc67178f2 22241 ]; 22242 function hash(data, offset, length) { 22243 var h0 = 0x6a09e667, h1 = 0xbb67ae85, h2 = 0x3c6ef372, h3 = 0xa54ff53a, h4 = 0x510e527f, h5 = 0x9b05688c, h6 = 0x1f83d9ab, h7 = 0x5be0cd19; 22244 var paddedLength = Math.ceil((length + 9) / 64) * 64; 22245 var padded = new Uint8Array(paddedLength); 22246 var i, j, n; 22247 for (i = 0; i < length; ++i) { 22248 padded[i] = data[offset++]; 22249 } 22250 padded[i++] = 0x80; 22251 n = paddedLength - 8; 22252 while (i < n) { 22253 padded[i++] = 0; 22254 } 22255 padded[i++] = 0; 22256 padded[i++] = 0; 22257 padded[i++] = 0; 22258 padded[i++] = length >>> 29 & 0xFF; 22259 padded[i++] = length >> 21 & 0xFF; 22260 padded[i++] = length >> 13 & 0xFF; 22261 padded[i++] = length >> 5 & 0xFF; 22262 padded[i++] = length << 3 & 0xFF; 22263 var w = new Uint32Array(64); 22264 for (i = 0; i < paddedLength;) { 22265 for (j = 0; j < 16; ++j) { 22266 w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 22267 i += 4; 22268 } 22269 for (j = 16; j < 64; ++j) { 22270 w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0; 22271 } 22272 var a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, t1, t2; 22273 for (j = 0; j < 64; ++j) { 22274 t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; 22275 t2 = sigma(a) + maj(a, b, c); 22276 h = g; 22277 g = f; 22278 f = e; 22279 e = d + t1 | 0; 22280 d = c; 22281 c = b; 22282 b = a; 22283 a = t1 + t2 | 0; 22284 } 22285 h0 = h0 + a | 0; 22286 h1 = h1 + b | 0; 22287 h2 = h2 + c | 0; 22288 h3 = h3 + d | 0; 22289 h4 = h4 + e | 0; 22290 h5 = h5 + f | 0; 22291 h6 = h6 + g | 0; 22292 h7 = h7 + h | 0; 22293 } 22294 return new Uint8Array([ 22295 h0 >> 24 & 0xFF, 22296 h0 >> 16 & 0xFF, 22297 h0 >> 8 & 0xFF, 22298 h0 & 0xFF, 22299 h1 >> 24 & 0xFF, 22300 h1 >> 16 & 0xFF, 22301 h1 >> 8 & 0xFF, 22302 h1 & 0xFF, 22303 h2 >> 24 & 0xFF, 22304 h2 >> 16 & 0xFF, 22305 h2 >> 8 & 0xFF, 22306 h2 & 0xFF, 22307 h3 >> 24 & 0xFF, 22308 h3 >> 16 & 0xFF, 22309 h3 >> 8 & 0xFF, 22310 h3 & 0xFF, 22311 h4 >> 24 & 0xFF, 22312 h4 >> 16 & 0xFF, 22313 h4 >> 8 & 0xFF, 22314 h4 & 0xFF, 22315 h5 >> 24 & 0xFF, 22316 h5 >> 16 & 0xFF, 22317 h5 >> 8 & 0xFF, 22318 h5 & 0xFF, 22319 h6 >> 24 & 0xFF, 22320 h6 >> 16 & 0xFF, 22321 h6 >> 8 & 0xFF, 22322 h6 & 0xFF, 22323 h7 >> 24 & 0xFF, 22324 h7 >> 16 & 0xFF, 22325 h7 >> 8 & 0xFF, 22326 h7 & 0xFF 22327 ]); 22328 } 22329 return hash; 22330}(); 22331var calculateSHA512 = function calculateSHA512Closure() { 22332 function ch(result, x, y, z, tmp) { 22333 result.assign(x); 22334 result.and(y); 22335 tmp.assign(x); 22336 tmp.not(); 22337 tmp.and(z); 22338 result.xor(tmp); 22339 } 22340 function maj(result, x, y, z, tmp) { 22341 result.assign(x); 22342 result.and(y); 22343 tmp.assign(x); 22344 tmp.and(z); 22345 result.xor(tmp); 22346 tmp.assign(y); 22347 tmp.and(z); 22348 result.xor(tmp); 22349 } 22350 function sigma(result, x, tmp) { 22351 result.assign(x); 22352 result.rotateRight(28); 22353 tmp.assign(x); 22354 tmp.rotateRight(34); 22355 result.xor(tmp); 22356 tmp.assign(x); 22357 tmp.rotateRight(39); 22358 result.xor(tmp); 22359 } 22360 function sigmaPrime(result, x, tmp) { 22361 result.assign(x); 22362 result.rotateRight(14); 22363 tmp.assign(x); 22364 tmp.rotateRight(18); 22365 result.xor(tmp); 22366 tmp.assign(x); 22367 tmp.rotateRight(41); 22368 result.xor(tmp); 22369 } 22370 function littleSigma(result, x, tmp) { 22371 result.assign(x); 22372 result.rotateRight(1); 22373 tmp.assign(x); 22374 tmp.rotateRight(8); 22375 result.xor(tmp); 22376 tmp.assign(x); 22377 tmp.shiftRight(7); 22378 result.xor(tmp); 22379 } 22380 function littleSigmaPrime(result, x, tmp) { 22381 result.assign(x); 22382 result.rotateRight(19); 22383 tmp.assign(x); 22384 tmp.rotateRight(61); 22385 result.xor(tmp); 22386 tmp.assign(x); 22387 tmp.shiftRight(6); 22388 result.xor(tmp); 22389 } 22390 var k = [ 22391 new Word64(0x428a2f98, 0xd728ae22), 22392 new Word64(0x71374491, 0x23ef65cd), 22393 new Word64(0xb5c0fbcf, 0xec4d3b2f), 22394 new Word64(0xe9b5dba5, 0x8189dbbc), 22395 new Word64(0x3956c25b, 0xf348b538), 22396 new Word64(0x59f111f1, 0xb605d019), 22397 new Word64(0x923f82a4, 0xaf194f9b), 22398 new Word64(0xab1c5ed5, 0xda6d8118), 22399 new Word64(0xd807aa98, 0xa3030242), 22400 new Word64(0x12835b01, 0x45706fbe), 22401 new Word64(0x243185be, 0x4ee4b28c), 22402 new Word64(0x550c7dc3, 0xd5ffb4e2), 22403 new Word64(0x72be5d74, 0xf27b896f), 22404 new Word64(0x80deb1fe, 0x3b1696b1), 22405 new Word64(0x9bdc06a7, 0x25c71235), 22406 new Word64(0xc19bf174, 0xcf692694), 22407 new Word64(0xe49b69c1, 0x9ef14ad2), 22408 new Word64(0xefbe4786, 0x384f25e3), 22409 new Word64(0x0fc19dc6, 0x8b8cd5b5), 22410 new Word64(0x240ca1cc, 0x77ac9c65), 22411 new Word64(0x2de92c6f, 0x592b0275), 22412 new Word64(0x4a7484aa, 0x6ea6e483), 22413 new Word64(0x5cb0a9dc, 0xbd41fbd4), 22414 new Word64(0x76f988da, 0x831153b5), 22415 new Word64(0x983e5152, 0xee66dfab), 22416 new Word64(0xa831c66d, 0x2db43210), 22417 new Word64(0xb00327c8, 0x98fb213f), 22418 new Word64(0xbf597fc7, 0xbeef0ee4), 22419 new Word64(0xc6e00bf3, 0x3da88fc2), 22420 new Word64(0xd5a79147, 0x930aa725), 22421 new Word64(0x06ca6351, 0xe003826f), 22422 new Word64(0x14292967, 0x0a0e6e70), 22423 new Word64(0x27b70a85, 0x46d22ffc), 22424 new Word64(0x2e1b2138, 0x5c26c926), 22425 new Word64(0x4d2c6dfc, 0x5ac42aed), 22426 new Word64(0x53380d13, 0x9d95b3df),
vendor: 5,731 bytes, lines 22427-22630
22427 new Word64(0x650a7354, 0x8baf63de), 22428 new Word64(0x766a0abb, 0x3c77b2a8), 22429 new Word64(0x81c2c92e, 0x47edaee6), 22430 new Word64(0x92722c85, 0x1482353b), 22431 new Word64(0xa2bfe8a1, 0x4cf10364), 22432 new Word64(0xa81a664b, 0xbc423001), 22433 new Word64(0xc24b8b70, 0xd0f89791), 22434 new Word64(0xc76c51a3, 0x0654be30), 22435 new Word64(0xd192e819, 0xd6ef5218), 22436 new Word64(0xd6990624, 0x5565a910), 22437 new Word64(0xf40e3585, 0x5771202a), 22438 new Word64(0x106aa070, 0x32bbd1b8), 22439 new Word64(0x19a4c116, 0xb8d2d0c8), 22440 new Word64(0x1e376c08, 0x5141ab53), 22441 new Word64(0x2748774c, 0xdf8eeb99), 22442 new Word64(0x34b0bcb5, 0xe19b48a8), 22443 new Word64(0x391c0cb3, 0xc5c95a63), 22444 new Word64(0x4ed8aa4a, 0xe3418acb), 22445 new Word64(0x5b9cca4f, 0x7763e373), 22446 new Word64(0x682e6ff3, 0xd6b2b8a3), 22447 new Word64(0x748f82ee, 0x5defb2fc), 22448 new Word64(0x78a5636f, 0x43172f60), 22449 new Word64(0x84c87814, 0xa1f0ab72), 22450 new Word64(0x8cc70208, 0x1a6439ec), 22451 new Word64(0x90befffa, 0x23631e28), 22452 new Word64(0xa4506ceb, 0xde82bde9), 22453 new Word64(0xbef9a3f7, 0xb2c67915), 22454 new Word64(0xc67178f2, 0xe372532b), 22455 new Word64(0xca273ece, 0xea26619c), 22456 new Word64(0xd186b8c7, 0x21c0c207), 22457 new Word64(0xeada7dd6, 0xcde0eb1e), 22458 new Word64(0xf57d4f7f, 0xee6ed178), 22459 new Word64(0x06f067aa, 0x72176fba), 22460 new Word64(0x0a637dc5, 0xa2c898a6), 22461 new Word64(0x113f9804, 0xbef90dae), 22462 new Word64(0x1b710b35, 0x131c471b), 22463 new Word64(0x28db77f5, 0x23047d84), 22464 new Word64(0x32caab7b, 0x40c72493), 22465 new Word64(0x3c9ebe0a, 0x15c9bebc), 22466 new Word64(0x431d67c4, 0x9c100d4c), 22467 new Word64(0x4cc5d4be, 0xcb3e42b6), 22468 new Word64(0x597f299c, 0xfc657e2a), 22469 new Word64(0x5fcb6fab, 0x3ad6faec), 22470 new Word64(0x6c44198c, 0x4a475817) 22471 ]; 22472 function hash(data, offset, length, mode384) { 22473 mode384 = !!mode384; 22474 var h0, h1, h2, h3, h4, h5, h6, h7; 22475 if (!mode384) { 22476 h0 = new Word64(0x6a09e667, 0xf3bcc908); 22477 h1 = new Word64(0xbb67ae85, 0x84caa73b); 22478 h2 = new Word64(0x3c6ef372, 0xfe94f82b); 22479 h3 = new Word64(0xa54ff53a, 0x5f1d36f1); 22480 h4 = new Word64(0x510e527f, 0xade682d1); 22481 h5 = new Word64(0x9b05688c, 0x2b3e6c1f); 22482 h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); 22483 h7 = new Word64(0x5be0cd19, 0x137e2179); 22484 } else { 22485 h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); 22486 h1 = new Word64(0x629a292a, 0x367cd507); 22487 h2 = new Word64(0x9159015a, 0x3070dd17); 22488 h3 = new Word64(0x152fecd8, 0xf70e5939); 22489 h4 = new Word64(0x67332667, 0xffc00b31); 22490 h5 = new Word64(0x8eb44a87, 0x68581511); 22491 h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); 22492 h7 = new Word64(0x47b5481d, 0xbefa4fa4); 22493 } 22494 var paddedLength = Math.ceil((length + 17) / 128) * 128; 22495 var padded = new Uint8Array(paddedLength); 22496 var i, j, n; 22497 for (i = 0; i < length; ++i) { 22498 padded[i] = data[offset++]; 22499 } 22500 padded[i++] = 0x80; 22501 n = paddedLength - 16; 22502 while (i < n) { 22503 padded[i++] = 0; 22504 } 22505 padded[i++] = 0; 22506 padded[i++] = 0; 22507 padded[i++] = 0; 22508 padded[i++] = 0; 22509 padded[i++] = 0; 22510 padded[i++] = 0; 22511 padded[i++] = 0; 22512 padded[i++] = 0; 22513 padded[i++] = 0; 22514 padded[i++] = 0; 22515 padded[i++] = 0; 22516 padded[i++] = length >>> 29 & 0xFF; 22517 padded[i++] = length >> 21 & 0xFF; 22518 padded[i++] = length >> 13 & 0xFF; 22519 padded[i++] = length >> 5 & 0xFF; 22520 padded[i++] = length << 3 & 0xFF; 22521 var w = new Array(80); 22522 for (i = 0; i < 80; i++) { 22523 w[i] = new Word64(0, 0); 22524 } 22525 var a = new Word64(0, 0), b = new Word64(0, 0), c = new Word64(0, 0); 22526 var d = new Word64(0, 0), e = new Word64(0, 0), f = new Word64(0, 0); 22527 var g = new Word64(0, 0), h = new Word64(0, 0); 22528 var t1 = new Word64(0, 0), t2 = new Word64(0, 0); 22529 var tmp1 = new Word64(0, 0), tmp2 = new Word64(0, 0), tmp3; 22530 for (i = 0; i < paddedLength;) { 22531 for (j = 0; j < 16; ++j) { 22532 w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 22533 w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; 22534 i += 8; 22535 } 22536 for (j = 16; j < 80; ++j) { 22537 tmp3 = w[j]; 22538 littleSigmaPrime(tmp3, w[j - 2], tmp2); 22539 tmp3.add(w[j - 7]); 22540 littleSigma(tmp1, w[j - 15], tmp2); 22541 tmp3.add(tmp1); 22542 tmp3.add(w[j - 16]); 22543 } 22544 a.assign(h0); 22545 b.assign(h1); 22546 c.assign(h2); 22547 d.assign(h3); 22548 e.assign(h4); 22549 f.assign(h5); 22550 g.assign(h6); 22551 h.assign(h7); 22552 for (j = 0; j < 80; ++j) { 22553 t1.assign(h); 22554 sigmaPrime(tmp1, e, tmp2); 22555 t1.add(tmp1); 22556 ch(tmp1, e, f, g, tmp2); 22557 t1.add(tmp1); 22558 t1.add(k[j]); 22559 t1.add(w[j]); 22560 sigma(t2, a, tmp2); 22561 maj(tmp1, a, b, c, tmp2); 22562 t2.add(tmp1); 22563 tmp3 = h; 22564 h = g; 22565 g = f; 22566 f = e; 22567 d.add(t1); 22568 e = d; 22569 d = c; 22570 c = b; 22571 b = a; 22572 tmp3.assign(t1); 22573 tmp3.add(t2); 22574 a = tmp3; 22575 } 22576 h0.add(a); 22577 h1.add(b); 22578 h2.add(c); 22579 h3.add(d); 22580 h4.add(e); 22581 h5.add(f); 22582 h6.add(g); 22583 h7.add(h); 22584 } 22585 var result; 22586 if (!mode384) { 22587 result = new Uint8Array(64); 22588 h0.copyTo(result, 0); 22589 h1.copyTo(result, 8); 22590 h2.copyTo(result, 16); 22591 h3.copyTo(result, 24); 22592 h4.copyTo(result, 32); 22593 h5.copyTo(result, 40); 22594 h6.copyTo(result, 48); 22595 h7.copyTo(result, 56); 22596 } else { 22597 result = new Uint8Array(48); 22598 h0.copyTo(result, 0); 22599 h1.copyTo(result, 8); 22600 h2.copyTo(result, 16); 22601 h3.copyTo(result, 24); 22602 h4.copyTo(result, 32); 22603 h5.copyTo(result, 40); 22604 } 22605 return result; 22606 } 22607 return hash; 22608}(); 22609var calculateSHA384 = function calculateSHA384Closure() { 22610 function hash(data, offset, length) { 22611 return calculateSHA512(data, offset, length, true); 22612 } 22613 return hash; 22614}(); 22615var NullCipher = function NullCipherClosure() { 22616 function NullCipher() { 22617 } 22618 NullCipher.prototype = { 22619 decryptBlock: function NullCipher_decryptBlock(data) { 22620 return data; 22621 } 22622 }; 22623 return NullCipher; 22624}(); 22625var AES128Cipher = function AES128CipherClosure() { 22626 var rcon = new Uint8Array([ 22627 0x8d, 22628 0x01, 22629 0x02, 22630 0x04,
22631 0x08, 22632 0x10, 22633 0x20, 22634 0x40, 22635 0x80, 22636 0x1b, 22637 0x36, 22638 0x6c, 22639 0xd8, 22640 0xab, 22641 0x4d, 22642 0x9a, 22643 0x2f, 22644 0x5e, 22645 0xbc, 22646 0x63, 22647 0xc6, 22648 0x97, 22649 0x35, 22650 0x6a, 22651 0xd4, 22652 0xb3, 22653 0x7d, 22654 0xfa, 22655 0xef, 22656 0xc5, 22657 0x91, 22658 0x39, 22659 0x72, 22660 0xe4, 22661 0xd3, 22662 0xbd, 22663 0x61, 22664 0xc2, 22665 0x9f, 22666 0x25, 22667 0x4a, 22668 0x94, 22669 0x33, 22670 0x66, 22671 0xcc, 22672 0x83, 22673 0x1d, 22674 0x3a, 22675 0x74, 22676 0xe8, 22677 0xcb, 22678 0x8d, 22679 0x01, 22680 0x02, 22681 0x04, 22682 0x08, 22683 0x10, 22684 0x20, 22685 0x40, 22686 0x80, 22687 0x1b, 22688 0x36, 22689 0x6c, 22690 0xd8, 22691 0xab, 22692 0x4d, 22693 0x9a, 22694 0x2f, 22695 0x5e, 22696 0xbc, 22697 0x63, 22698 0xc6, 22699 0x97, 22700 0x35, 22701 0x6a, 22702 0xd4, 22703 0xb3, 22704 0x7d, 22705 0xfa, 22706 0xef, 22707 0xc5, 22708 0x91, 22709 0x39, 22710 0x72, 22711 0xe4, 22712 0xd3, 22713 0xbd, 22714 0x61, 22715 0xc2, 22716 0x9f, 22717 0x25, 22718 0x4a, 22719 0x94, 22720 0x33, 22721 0x66, 22722 0xcc, 22723 0x83, 22724 0x1d, 22725 0x3a, 22726 0x74, 22727 0xe8, 22728 0xcb, 22729 0x8d, 22730 0x01, 22731 0x02, 22732 0x04, 22733 0x08, 22734 0x10, 22735 0x20, 22736 0x40, 22737 0x80, 22738 0x1b, 22739 0x36, 22740 0x6c, 22741 0xd8, 22742 0xab, 22743 0x4d, 22744 0x9a, 22745 0x2f, 22746 0x5e, 22747 0xbc, 22748 0x63, 22749 0xc6, 22750 0x97, 22751 0x35, 22752 0x6a, 22753 0xd4, 22754 0xb3, 22755 0x7d, 22756 0xfa, 22757 0xef, 22758 0xc5, 22759 0x91, 22760 0x39, 22761 0x72, 22762 0xe4, 22763 0xd3, 22764 0xbd, 22765 0x61, 22766 0xc2, 22767 0x9f, 22768 0x25, 22769 0x4a, 22770 0x94, 22771 0x33, 22772 0x66, 22773 0xcc, 22774 0x83, 22775 0x1d, 22776 0x3a, 22777 0x74, 22778 0xe8, 22779 0xcb, 22780 0x8d, 22781 0x01, 22782 0x02, 22783 0x04, 22784 0x08, 22785 0x10, 22786 0x20, 22787 0x40, 22788 0x80, 22789 0x1b, 22790 0x36, 22791 0x6c, 22792 0xd8, 22793 0xab, 22794 0x4d, 22795 0x9a, 22796 0x2f, 22797 0x5e, 22798 0xbc, 22799 0x63, 22800 0xc6, 22801 0x97, 22802 0x35, 22803 0x6a, 22804 0xd4, 22805 0xb3, 22806 0x7d, 22807 0xfa, 22808 0xef, 22809 0xc5, 22810 0x91, 22811 0x39, 22812 0x72, 22813 0xe4, 22814 0xd3, 22815 0xbd, 22816 0x61, 22817 0xc2, 22818 0x9f, 22819 0x25, 22820 0x4a, 22821 0x94, 22822 0x33, 22823 0x66, 22824 0xcc, 22825 0x83, 22826 0x1d, 22827 0x3a, 22828 0x74, 22829 0xe8, 22830 0xcb, 22831 0x8d, 22832 0x01, 22833 0x02, 22834 0x04, 22835 0x08, 22836 0x10, 22837 0x20, 22838 0x40, 22839 0x80, 22840 0x1b, 22841 0x36, 22842 0x6c, 22843 0xd8, 22844 0xab, 22845 0x4d, 22846 0x9a, 22847 0x2f, 22848 0x5e, 22849 0xbc, 22850 0x63, 22851 0xc6, 22852 0x97, 22853 0x35, 22854 0x6a, 22855 0xd4, 22856 0xb3, 22857 0x7d, 22858 0xfa, 22859 0xef, 22860 0xc5, 22861 0x91, 22862 0x39, 22863 0x72, 22864 0xe4, 22865 0xd3, 22866 0xbd, 22867 0x61, 22868 0xc2, 22869 0x9f, 22870 0x25, 22871 0x4a, 22872 0x94, 22873 0x33, 22874 0x66, 22875 0xcc, 22876 0x83, 22877 0x1d, 22878 0x3a, 22879 0x74, 22880 0xe8, 22881 0xcb, 22882 0x8d 22883 ]); 22884 var s = new Uint8Array([ 22885 0x63, 22886 0x7c, 22887 0x77, 22888 0x7b, 22889 0xf2, 22890 0x6b, 22891 0x6f, 22892 0xc5, 22893 0x30, 22894 0x01, 22895 0x67, 22896 0x2b, 22897 0xfe, 22898 0xd7, 22899 0xab, 22900 0x76, 22901 0xca, 22902 0x82, 22903 0xc9, 22904 0x7d, 22905 0xfa, 22906 0x59, 22907 0x47, 22908 0xf0, 22909 0xad, 22910 0xd4, 22911 0xa2, 22912 0xaf, 22913 0x9c, 22914 0xa4, 22915 0x72, 22916 0xc0, 22917 0xb7, 22918 0xfd, 22919 0x93, 22920 0x26, 22921 0x36, 22922 0x3f, 22923 0xf7, 22924 0xcc, 22925 0x34, 22926 0xa5, 22927 0xe5, 22928 0xf1, 22929 0x71, 22930 0xd8, 22931 0x31, 22932 0x15, 22933 0x04, 22934 0xc7, 22935 0x23, 22936 0xc3, 22937 0x18, 22938 0x96, 22939 0x05, 22940 0x9a, 22941 0x07, 22942 0x12, 22943 0x80, 22944 0xe2, 22945 0xeb, 22946 0x27, 22947 0xb2, 22948 0x75, 22949 0x09, 22950 0x83, 22951 0x2c, 22952 0x1a, 22953 0x1b, 22954 0x6e, 22955 0x5a, 22956 0xa0, 22957 0x52, 22958 0x3b, 22959 0xd6, 22960 0xb3, 22961 0x29, 22962 0xe3, 22963 0x2f, 22964 0x84, 22965 0x53, 22966 0xd1, 22967 0x00, 22968 0xed, 22969 0x20, 22970 0xfc, 22971 0xb1, 22972 0x5b, 22973 0x6a, 22974 0xcb, 22975 0xbe, 22976 0x39, 22977 0x4a, 22978 0x4c, 22979 0x58, 22980 0xcf, 22981 0xd0, 22982 0xef, 22983 0xaa, 22984 0xfb, 22985 0x43, 22986 0x4d, 22987 0x33, 22988 0x85, 22989 0x45, 22990 0xf9, 22991 0x02, 22992 0x7f, 22993 0x50, 22994 0x3c, 22995 0x9f, 22996 0xa8, 22997 0x51, 22998 0xa3, 22999 0x40, 23000 0x8f, 23001 0x92, 23002 0x9d, 23003 0x38, 23004 0xf5, 23005 0xbc, 23006 0xb6, 23007 0xda, 23008 0x21, 23009 0x10, 23010 0xff, 23011 0xf3, 23012 0xd2, 23013 0xcd, 23014 0x0c, 23015 0x13, 23016 0xec, 23017 0x5f, 23018 0x97, 23019 0x44, 23020 0x17, 23021 0xc4, 23022 0xa7, 23023 0x7e, 23024 0x3d, 23025 0x64, 23026 0x5d, 23027 0x19, 23028 0x73, 23029 0x60, 23030 0x81, 23031 0x4f, 23032 0xdc, 23033 0x22, 23034 0x2a, 23035 0x90, 23036 0x88, 23037 0x46, 23038 0xee, 23039 0xb8, 23040 0x14, 23041 0xde, 23042 0x5e, 23043 0x0b, 23044 0xdb, 23045 0xe0, 23046 0x32, 23047 0x3a, 23048 0x0a, 23049 0x49, 23050 0x06, 23051 0x24, 23052 0x5c, 23053 0xc2, 23054 0xd3, 23055 0xac, 23056 0x62, 23057 0x91, 23058 0x95, 23059 0xe4, 23060 0x79, 23061 0xe7, 23062 0xc8, 23063 0x37, 23064 0x6d, 23065 0x8d, 23066 0xd5, 23067 0x4e, 23068 0xa9, 23069 0x6c, 23070 0x56, 23071 0xf4, 23072 0xea, 23073 0x65, 23074 0x7a, 23075 0xae, 23076 0x08, 23077 0xba, 23078 0x78, 23079 0x25, 23080 0x2e, 23081 0x1c, 23082 0xa6, 23083 0xb4, 23084 0xc6, 23085 0xe8, 23086 0xdd, 23087 0x74, 23088 0x1f, 23089 0x4b, 23090 0xbd, 23091 0x8b, 23092 0x8a, 23093 0x70, 23094 0x3e, 23095 0xb5, 23096 0x66, 23097 0x48, 23098 0x03, 23099 0xf6, 23100 0x0e, 23101 0x61, 23102 0x35, 23103 0x57, 23104 0xb9, 23105 0x86, 23106 0xc1, 23107 0x1d, 23108 0x9e, 23109 0xe1, 23110 0xf8, 23111 0x98, 23112 0x11, 23113 0x69, 23114 0xd9, 23115 0x8e, 23116 0x94, 23117 0x9b, 23118 0x1e, 23119 0x87, 23120 0xe9, 23121 0xce, 23122 0x55, 23123 0x28, 23124 0xdf, 23125 0x8c, 23126 0xa1, 23127 0x89, 23128 0x0d, 23129 0xbf, 23130 0xe6, 23131 0x42, 23132 0x68, 23133 0x41, 23134 0x99, 23135 0x2d, 23136 0x0f, 23137 0xb0, 23138 0x54, 23139 0xbb, 23140 0x16 23141 ]); 23142 var inv_s = new Uint8Array([ 23143 0x52, 23144 0x09, 23145 0x6a, 23146 0xd5, 23147 0x30, 23148 0x36, 23149 0xa5, 23150 0x38, 23151 0xbf, 23152 0x40, 23153 0xa3, 23154 0x9e, 23155 0x81, 23156 0xf3, 23157 0xd7, 23158 0xfb, 23159 0x7c, 23160 0xe3,
23161 0x39, 23162 0x82, 23163 0x9b, 23164 0x2f, 23165 0xff, 23166 0x87, 23167 0x34, 23168 0x8e, 23169 0x43, 23170 0x44, 23171 0xc4, 23172 0xde, 23173 0xe9, 23174 0xcb, 23175 0x54, 23176 0x7b, 23177 0x94, 23178 0x32, 23179 0xa6, 23180 0xc2, 23181 0x23, 23182 0x3d, 23183 0xee, 23184 0x4c, 23185 0x95, 23186 0x0b, 23187 0x42, 23188 0xfa, 23189 0xc3, 23190 0x4e, 23191 0x08, 23192 0x2e, 23193 0xa1, 23194 0x66, 23195 0x28, 23196 0xd9, 23197 0x24, 23198 0xb2, 23199 0x76, 23200 0x5b, 23201 0xa2, 23202 0x49, 23203 0x6d, 23204 0x8b, 23205 0xd1, 23206 0x25, 23207 0x72, 23208 0xf8, 23209 0xf6, 23210 0x64, 23211 0x86, 23212 0x68, 23213 0x98, 23214 0x16, 23215 0xd4, 23216 0xa4, 23217 0x5c, 23218 0xcc, 23219 0x5d, 23220 0x65, 23221 0xb6, 23222 0x92, 23223 0x6c, 23224 0x70, 23225 0x48, 23226 0x50, 23227 0xfd, 23228 0xed, 23229 0xb9, 23230 0xda, 23231 0x5e, 23232 0x15, 23233 0x46, 23234 0x57, 23235 0xa7, 23236 0x8d, 23237 0x9d, 23238 0x84, 23239 0x90, 23240 0xd8, 23241 0xab, 23242 0x00, 23243 0x8c, 23244 0xbc, 23245 0xd3, 23246 0x0a, 23247 0xf7, 23248 0xe4, 23249 0x58, 23250 0x05, 23251 0xb8, 23252 0xb3, 23253 0x45, 23254 0x06, 23255 0xd0, 23256 0x2c, 23257 0x1e, 23258 0x8f, 23259 0xca, 23260 0x3f, 23261 0x0f, 23262 0x02, 23263 0xc1, 23264 0xaf, 23265 0xbd, 23266 0x03, 23267 0x01, 23268 0x13, 23269 0x8a, 23270 0x6b, 23271 0x3a, 23272 0x91, 23273 0x11, 23274 0x41, 23275 0x4f, 23276 0x67, 23277 0xdc, 23278 0xea, 23279 0x97, 23280 0xf2, 23281 0xcf, 23282 0xce, 23283 0xf0, 23284 0xb4, 23285 0xe6, 23286 0x73, 23287 0x96, 23288 0xac, 23289 0x74, 23290 0x22, 23291 0xe7, 23292 0xad, 23293 0x35, 23294 0x85, 23295 0xe2, 23296 0xf9, 23297 0x37, 23298 0xe8, 23299 0x1c, 23300 0x75, 23301 0xdf, 23302 0x6e, 23303 0x47, 23304 0xf1, 23305 0x1a, 23306 0x71, 23307 0x1d, 23308 0x29, 23309 0xc5, 23310 0x89, 23311 0x6f, 23312 0xb7, 23313 0x62, 23314 0x0e, 23315 0xaa, 23316 0x18, 23317 0xbe, 23318 0x1b, 23319 0xfc, 23320 0x56, 23321 0x3e, 23322 0x4b, 23323 0xc6, 23324 0xd2, 23325 0x79, 23326 0x20, 23327 0x9a, 23328 0xdb, 23329 0xc0, 23330 0xfe, 23331 0x78, 23332 0xcd, 23333 0x5a, 23334 0xf4, 23335 0x1f, 23336 0xdd, 23337 0xa8, 23338 0x33, 23339 0x88, 23340 0x07, 23341 0xc7, 23342 0x31, 23343 0xb1, 23344 0x12, 23345 0x10, 23346 0x59, 23347 0x27, 23348 0x80, 23349 0xec, 23350 0x5f, 23351 0x60, 23352 0x51, 23353 0x7f, 23354 0xa9, 23355 0x19, 23356 0xb5, 23357 0x4a, 23358 0x0d, 23359 0x2d, 23360 0xe5, 23361 0x7a, 23362 0x9f, 23363 0x93, 23364 0xc9, 23365 0x9c, 23366 0xef, 23367 0xa0, 23368 0xe0, 23369 0x3b, 23370 0x4d, 23371 0xae, 23372 0x2a, 23373 0xf5, 23374 0xb0, 23375 0xc8, 23376 0xeb, 23377 0xbb, 23378 0x3c, 23379 0x83, 23380 0x53, 23381 0x99, 23382 0x61, 23383 0x17, 23384 0x2b, 23385 0x04, 23386 0x7e, 23387 0xba, 23388 0x77, 23389 0xd6, 23390 0x26, 23391 0xe1, 23392 0x69, 23393 0x14, 23394 0x63, 23395 0x55, 23396 0x21, 23397 0x0c, 23398 0x7d 23399 ]); 23400 var mixCol = new Uint8Array(256); 23401 for (var i = 0; i < 256; i++) { 23402 if (i < 128) { 23403 mixCol[i] = i << 1; 23404 } else { 23405 mixCol[i] = i << 1 ^ 0x1b; 23406 } 23407 } 23408 var mix = new Uint32Array([ 23409 0x00000000, 23410 0x0e090d0b, 23411 0x1c121a16, 23412 0x121b171d, 23413 0x3824342c, 23414 0x362d3927, 23415 0x24362e3a, 23416 0x2a3f2331, 23417 0x70486858, 23418 0x7e416553, 23419 0x6c5a724e, 23420 0x62537f45, 23421 0x486c5c74, 23422 0x4665517f, 23423 0x547e4662, 23424 0x5a774b69, 23425 0xe090d0b0, 23426 0xee99ddbb, 23427 0xfc82caa6, 23428 0xf28bc7ad, 23429 0xd8b4e49c, 23430 0xd6bde997, 23431 0xc4a6fe8a, 23432 0xcaaff381, 23433 0x90d8b8e8, 23434 0x9ed1b5e3, 23435 0x8ccaa2fe, 23436 0x82c3aff5, 23437 0xa8fc8cc4, 23438 0xa6f581cf, 23439 0xb4ee96d2, 23440 0xbae79bd9, 23441 0xdb3bbb7b, 23442 0xd532b670, 23443 0xc729a16d, 23444 0xc920ac66, 23445 0xe31f8f57, 23446 0xed16825c, 23447 0xff0d9541, 23448 0xf104984a, 23449 0xab73d323, 23450 0xa57ade28, 23451 0xb761c935, 23452 0xb968c43e, 23453 0x9357e70f, 23454 0x9d5eea04, 23455 0x8f45fd19, 23456 0x814cf012, 23457 0x3bab6bcb, 23458 0x35a266c0, 23459 0x27b971dd, 23460 0x29b07cd6, 23461 0x038f5fe7, 23462 0x0d8652ec, 23463 0x1f9d45f1, 23464 0x119448fa, 23465 0x4be30393, 23466 0x45ea0e98, 23467 0x57f11985, 23468 0x59f8148e, 23469 0x73c737bf, 23470 0x7dce3ab4, 23471 0x6fd52da9, 23472 0x61dc20a2, 23473 0xad766df6, 23474 0xa37f60fd, 23475 0xb16477e0, 23476 0xbf6d7aeb, 23477 0x955259da, 23478 0x9b5b54d1, 23479 0x894043cc, 23480 0x87494ec7, 23481 0xdd3e05ae, 23482 0xd33708a5, 23483 0xc12c1fb8, 23484 0xcf2512b3, 23485 0xe51a3182, 23486 0xeb133c89, 23487 0xf9082b94, 23488 0xf701269f, 23489 0x4de6bd46, 23490 0x43efb04d, 23491 0x51f4a750, 23492 0x5ffdaa5b, 23493 0x75c2896a, 23494 0x7bcb8461, 23495 0x69d0937c, 23496 0x67d99e77, 23497 0x3daed51e, 23498 0x33a7d815, 23499 0x21bccf08, 23500 0x2fb5c203, 23501 0x058ae132, 23502 0x0b83ec39, 23503 0x1998fb24, 23504 0x1791f62f, 23505 0x764dd68d, 23506 0x7844db86, 23507 0x6a5fcc9b, 23508 0x6456c190, 23509 0x4e69e2a1, 23510 0x4060efaa, 23511 0x527bf8b7, 23512 0x5c72f5bc, 23513 0x0605bed5, 23514 0x080cb3de, 23515 0x1a17a4c3, 23516 0x141ea9c8, 23517 0x3e218af9, 23518 0x302887f2, 23519 0x223390ef, 23520 0x2c3a9de4, 23521 0x96dd063d, 23522 0x98d40b36, 23523 0x8acf1c2b, 23524 0x84c61120, 23525 0xaef93211, 23526 0xa0f03f1a, 23527 0xb2eb2807, 23528 0xbce2250c, 23529 0xe6956e65, 23530 0xe89c636e, 23531 0xfa877473, 23532 0xf48e7978, 23533 0xdeb15a49, 23534 0xd0b85742, 23535 0xc2a3405f, 23536 0xccaa4d54, 23537 0x41ecdaf7, 23538 0x4fe5d7fc, 23539 0x5dfec0e1, 23540 0x53f7cdea, 23541 0x79c8eedb, 23542 0x77c1e3d0, 23543 0x65daf4cd, 23544 0x6bd3f9c6, 23545 0x31a4b2af, 23546 0x3fadbfa4, 23547 0x2db6a8b9, 23548 0x23bfa5b2, 23549 0x09808683, 23550 0x07898b88, 23551 0x15929c95, 23552 0x1b9b919e, 23553 0xa17c0a47, 23554 0xaf75074c, 23555 0xbd6e1051, 23556 0xb3671d5a, 23557 0x99583e6b, 23558 0x97513360, 23559 0x854a247d, 23560 0x8b432976,
vendor: 11,332 bytes, lines 23561-24338
23561 0xd134621f, 23562 0xdf3d6f14, 23563 0xcd267809, 23564 0xc32f7502, 23565 0xe9105633, 23566 0xe7195b38, 23567 0xf5024c25, 23568 0xfb0b412e, 23569 0x9ad7618c, 23570 0x94de6c87, 23571 0x86c57b9a, 23572 0x88cc7691, 23573 0xa2f355a0, 23574 0xacfa58ab, 23575 0xbee14fb6, 23576 0xb0e842bd, 23577 0xea9f09d4, 23578 0xe49604df, 23579 0xf68d13c2, 23580 0xf8841ec9, 23581 0xd2bb3df8, 23582 0xdcb230f3, 23583 0xcea927ee, 23584 0xc0a02ae5, 23585 0x7a47b13c, 23586 0x744ebc37, 23587 0x6655ab2a, 23588 0x685ca621, 23589 0x42638510, 23590 0x4c6a881b, 23591 0x5e719f06, 23592 0x5078920d, 23593 0x0a0fd964, 23594 0x0406d46f, 23595 0x161dc372, 23596 0x1814ce79, 23597 0x322bed48, 23598 0x3c22e043, 23599 0x2e39f75e, 23600 0x2030fa55, 23601 0xec9ab701, 23602 0xe293ba0a, 23603 0xf088ad17, 23604 0xfe81a01c, 23605 0xd4be832d, 23606 0xdab78e26, 23607 0xc8ac993b, 23608 0xc6a59430, 23609 0x9cd2df59, 23610 0x92dbd252, 23611 0x80c0c54f, 23612 0x8ec9c844, 23613 0xa4f6eb75, 23614 0xaaffe67e, 23615 0xb8e4f163, 23616 0xb6edfc68, 23617 0x0c0a67b1, 23618 0x02036aba, 23619 0x10187da7, 23620 0x1e1170ac, 23621 0x342e539d, 23622 0x3a275e96, 23623 0x283c498b, 23624 0x26354480, 23625 0x7c420fe9, 23626 0x724b02e2, 23627 0x605015ff, 23628 0x6e5918f4, 23629 0x44663bc5, 23630 0x4a6f36ce, 23631 0x587421d3, 23632 0x567d2cd8, 23633 0x37a10c7a, 23634 0x39a80171, 23635 0x2bb3166c, 23636 0x25ba1b67, 23637 0x0f853856, 23638 0x018c355d, 23639 0x13972240, 23640 0x1d9e2f4b, 23641 0x47e96422, 23642 0x49e06929, 23643 0x5bfb7e34, 23644 0x55f2733f, 23645 0x7fcd500e, 23646 0x71c45d05, 23647 0x63df4a18, 23648 0x6dd64713, 23649 0xd731dcca, 23650 0xd938d1c1, 23651 0xcb23c6dc, 23652 0xc52acbd7, 23653 0xef15e8e6, 23654 0xe11ce5ed, 23655 0xf307f2f0, 23656 0xfd0efffb, 23657 0xa779b492, 23658 0xa970b999, 23659 0xbb6bae84, 23660 0xb562a38f, 23661 0x9f5d80be, 23662 0x91548db5, 23663 0x834f9aa8, 23664 0x8d4697a3 23665 ]); 23666 function expandKey128(cipherKey) { 23667 var b = 176, result = new Uint8Array(b); 23668 result.set(cipherKey); 23669 for (var j = 16, i = 1; j < b; ++i) { 23670 var t1 = result[j - 3], t2 = result[j - 2], t3 = result[j - 1], t4 = result[j - 4]; 23671 t1 = s[t1]; 23672 t2 = s[t2]; 23673 t3 = s[t3]; 23674 t4 = s[t4]; 23675 t1 = t1 ^ rcon[i]; 23676 for (var n = 0; n < 4; ++n) { 23677 result[j] = t1 ^= result[j - 16]; 23678 j++; 23679 result[j] = t2 ^= result[j - 16]; 23680 j++; 23681 result[j] = t3 ^= result[j - 16]; 23682 j++; 23683 result[j] = t4 ^= result[j - 16]; 23684 j++; 23685 } 23686 } 23687 return result; 23688 } 23689 function decrypt128(input, key) { 23690 var state = new Uint8Array(16); 23691 state.set(input); 23692 var i, j, k; 23693 var t, u, v; 23694 for (j = 0, k = 160; j < 16; ++j, ++k) { 23695 state[j] ^= key[k]; 23696 } 23697 for (i = 9; i >= 1; --i) { 23698 t = state[13]; 23699 state[13] = state[9]; 23700 state[9] = state[5]; 23701 state[5] = state[1]; 23702 state[1] = t; 23703 t = state[14]; 23704 u = state[10]; 23705 state[14] = state[6]; 23706 state[10] = state[2]; 23707 state[6] = t; 23708 state[2] = u; 23709 t = state[15]; 23710 u = state[11]; 23711 v = state[7]; 23712 state[15] = state[3]; 23713 state[11] = t; 23714 state[7] = u; 23715 state[3] = v; 23716 for (j = 0; j < 16; ++j) { 23717 state[j] = inv_s[state[j]]; 23718 } 23719 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 23720 state[j] ^= key[k]; 23721 } 23722 for (j = 0; j < 16; j += 4) { 23723 var s0 = mix[state[j]], s1 = mix[state[j + 1]], s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; 23724 t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; 23725 state[j] = t >>> 24 & 0xFF; 23726 state[j + 1] = t >> 16 & 0xFF; 23727 state[j + 2] = t >> 8 & 0xFF; 23728 state[j + 3] = t & 0xFF; 23729 } 23730 } 23731 t = state[13]; 23732 state[13] = state[9]; 23733 state[9] = state[5]; 23734 state[5] = state[1]; 23735 state[1] = t; 23736 t = state[14]; 23737 u = state[10]; 23738 state[14] = state[6]; 23739 state[10] = state[2]; 23740 state[6] = t; 23741 state[2] = u; 23742 t = state[15]; 23743 u = state[11]; 23744 v = state[7]; 23745 state[15] = state[3]; 23746 state[11] = t; 23747 state[7] = u; 23748 state[3] = v; 23749 for (j = 0; j < 16; ++j) { 23750 state[j] = inv_s[state[j]]; 23751 state[j] ^= key[j]; 23752 } 23753 return state; 23754 } 23755 function encrypt128(input, key) { 23756 var t, u, v, k; 23757 var state = new Uint8Array(16); 23758 state.set(input); 23759 for (j = 0; j < 16; ++j) { 23760 state[j] ^= key[j]; 23761 } 23762 for (i = 1; i < 10; i++) { 23763 for (j = 0; j < 16; ++j) { 23764 state[j] = s[state[j]]; 23765 } 23766 v = state[1]; 23767 state[1] = state[5]; 23768 state[5] = state[9]; 23769 state[9] = state[13]; 23770 state[13] = v; 23771 v = state[2]; 23772 u = state[6]; 23773 state[2] = state[10]; 23774 state[6] = state[14]; 23775 state[10] = v; 23776 state[14] = u; 23777 v = state[3]; 23778 u = state[7]; 23779 t = state[11]; 23780 state[3] = state[15]; 23781 state[7] = v; 23782 state[11] = u; 23783 state[15] = t; 23784 for (var j = 0; j < 16; j += 4) { 23785 var s0 = state[j + 0], s1 = state[j + 1]; 23786 var s2 = state[j + 2], s3 = state[j + 3]; 23787 t = s0 ^ s1 ^ s2 ^ s3; 23788 state[j + 0] ^= t ^ mixCol[s0 ^ s1]; 23789 state[j + 1] ^= t ^ mixCol[s1 ^ s2]; 23790 state[j + 2] ^= t ^ mixCol[s2 ^ s3]; 23791 state[j + 3] ^= t ^ mixCol[s3 ^ s0]; 23792 } 23793 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 23794 state[j] ^= key[k]; 23795 } 23796 } 23797 for (j = 0; j < 16; ++j) { 23798 state[j] = s[state[j]]; 23799 } 23800 v = state[1]; 23801 state[1] = state[5]; 23802 state[5] = state[9]; 23803 state[9] = state[13]; 23804 state[13] = v; 23805 v = state[2]; 23806 u = state[6]; 23807 state[2] = state[10]; 23808 state[6] = state[14]; 23809 state[10] = v; 23810 state[14] = u; 23811 v = state[3]; 23812 u = state[7]; 23813 t = state[11]; 23814 state[3] = state[15]; 23815 state[7] = v; 23816 state[11] = u; 23817 state[15] = t; 23818 for (j = 0, k = 160; j < 16; ++j, ++k) { 23819 state[j] ^= key[k]; 23820 } 23821 return state; 23822 } 23823 function AES128Cipher(key) { 23824 this.key = expandKey128(key); 23825 this.buffer = new Uint8Array(16); 23826 this.bufferPosition = 0; 23827 } 23828 function decryptBlock2(data, finalize) { 23829 var i, j, ii, sourceLength = data.length, buffer = this.buffer, bufferLength = this.bufferPosition, result = [], iv = this.iv; 23830 for (i = 0; i < sourceLength; ++i) { 23831 buffer[bufferLength] = data[i]; 23832 ++bufferLength; 23833 if (bufferLength < 16) { 23834 continue; 23835 } 23836 var plain = decrypt128(buffer, this.key); 23837 for (j = 0; j < 16; ++j) { 23838 plain[j] ^= iv[j]; 23839 } 23840 iv = buffer; 23841 result.push(plain); 23842 buffer = new Uint8Array(16); 23843 bufferLength = 0; 23844 } 23845 this.buffer = buffer; 23846 this.bufferLength = bufferLength; 23847 this.iv = iv; 23848 if (result.length === 0) { 23849 return new Uint8Array([]); 23850 } 23851 var outputLength = 16 * result.length; 23852 if (finalize) { 23853 var lastBlock = result[result.length - 1]; 23854 var psLen = lastBlock[15]; 23855 if (psLen <= 16) { 23856 for (i = 15, ii = 16 - psLen; i >= ii; --i) { 23857 if (lastBlock[i] !== psLen) { 23858 psLen = 0; 23859 break; 23860 } 23861 } 23862 outputLength -= psLen; 23863 result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); 23864 } 23865 } 23866 var output = new Uint8Array(outputLength); 23867 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 23868 output.set(result[i], j); 23869 } 23870 return output; 23871 } 23872 AES128Cipher.prototype = { 23873 decryptBlock: function AES128Cipher_decryptBlock(data, finalize) { 23874 var i, sourceLength = data.length; 23875 var buffer = this.buffer, bufferLength = this.bufferPosition; 23876 for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { 23877 buffer[bufferLength] = data[i]; 23878 } 23879 if (bufferLength < 16) { 23880 this.bufferLength = bufferLength; 23881 return new Uint8Array([]); 23882 } 23883 this.iv = buffer; 23884 this.buffer = new Uint8Array(16); 23885 this.bufferLength = 0; 23886 this.decryptBlock = decryptBlock2; 23887 return this.decryptBlock(data.subarray(16), finalize); 23888 }, 23889 encrypt: function AES128Cipher_encrypt(data, iv) { 23890 var i, j, ii, sourceLength = data.length, buffer = this.buffer, bufferLength = this.bufferPosition, result = []; 23891 if (!iv) { 23892 iv = new Uint8Array(16); 23893 } 23894 for (i = 0; i < sourceLength; ++i) { 23895 buffer[bufferLength] = data[i]; 23896 ++bufferLength; 23897 if (bufferLength < 16) { 23898 continue; 23899 } 23900 for (j = 0; j < 16; ++j) { 23901 buffer[j] ^= iv[j]; 23902 } 23903 var cipher = encrypt128(buffer, this.key); 23904 iv = cipher; 23905 result.push(cipher); 23906 buffer = new Uint8Array(16); 23907 bufferLength = 0; 23908 } 23909 this.buffer = buffer; 23910 this.bufferLength = bufferLength; 23911 this.iv = iv; 23912 if (result.length === 0) { 23913 return new Uint8Array([]); 23914 } 23915 var outputLength = 16 * result.length; 23916 var output = new Uint8Array(outputLength); 23917 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 23918 output.set(result[i], j); 23919 } 23920 return output; 23921 } 23922 }; 23923 return AES128Cipher; 23924}(); 23925var AES256Cipher = function AES256CipherClosure() { 23926 var s = new Uint8Array([ 23927 0x63, 23928 0x7c, 23929 0x77, 23930 0x7b, 23931 0xf2, 23932 0x6b, 23933 0x6f, 23934 0xc5, 23935 0x30, 23936 0x01, 23937 0x67, 23938 0x2b, 23939 0xfe, 23940 0xd7, 23941 0xab, 23942 0x76, 23943 0xca, 23944 0x82, 23945 0xc9, 23946 0x7d, 23947 0xfa, 23948 0x59, 23949 0x47, 23950 0xf0, 23951 0xad, 23952 0xd4, 23953 0xa2, 23954 0xaf, 23955 0x9c, 23956 0xa4, 23957 0x72, 23958 0xc0, 23959 0xb7, 23960 0xfd, 23961 0x93, 23962 0x26, 23963 0x36, 23964 0x3f, 23965 0xf7, 23966 0xcc, 23967 0x34, 23968 0xa5, 23969 0xe5, 23970 0xf1, 23971 0x71, 23972 0xd8, 23973 0x31, 23974 0x15, 23975 0x04, 23976 0xc7, 23977 0x23, 23978 0xc3, 23979 0x18, 23980 0x96, 23981 0x05, 23982 0x9a, 23983 0x07, 23984 0x12, 23985 0x80, 23986 0xe2, 23987 0xeb, 23988 0x27, 23989 0xb2, 23990 0x75, 23991 0x09, 23992 0x83, 23993 0x2c, 23994 0x1a, 23995 0x1b, 23996 0x6e, 23997 0x5a, 23998 0xa0, 23999 0x52, 24000 0x3b, 24001 0xd6, 24002 0xb3, 24003 0x29, 24004 0xe3, 24005 0x2f, 24006 0x84, 24007 0x53, 24008 0xd1, 24009 0x00, 24010 0xed, 24011 0x20, 24012 0xfc, 24013 0xb1, 24014 0x5b, 24015 0x6a, 24016 0xcb, 24017 0xbe, 24018 0x39, 24019 0x4a, 24020 0x4c, 24021 0x58, 24022 0xcf, 24023 0xd0, 24024 0xef, 24025 0xaa, 24026 0xfb, 24027 0x43, 24028 0x4d, 24029 0x33, 24030 0x85, 24031 0x45, 24032 0xf9, 24033 0x02, 24034 0x7f, 24035 0x50, 24036 0x3c, 24037 0x9f, 24038 0xa8, 24039 0x51, 24040 0xa3, 24041 0x40, 24042 0x8f, 24043 0x92, 24044 0x9d, 24045 0x38, 24046 0xf5, 24047 0xbc, 24048 0xb6, 24049 0xda, 24050 0x21, 24051 0x10, 24052 0xff, 24053 0xf3, 24054 0xd2, 24055 0xcd, 24056 0x0c, 24057 0x13, 24058 0xec, 24059 0x5f, 24060 0x97, 24061 0x44, 24062 0x17, 24063 0xc4, 24064 0xa7, 24065 0x7e, 24066 0x3d, 24067 0x64, 24068 0x5d, 24069 0x19, 24070 0x73, 24071 0x60, 24072 0x81, 24073 0x4f, 24074 0xdc, 24075 0x22, 24076 0x2a, 24077 0x90, 24078 0x88, 24079 0x46, 24080 0xee, 24081 0xb8, 24082 0x14, 24083 0xde, 24084 0x5e, 24085 0x0b, 24086 0xdb, 24087 0xe0, 24088 0x32, 24089 0x3a, 24090 0x0a, 24091 0x49, 24092 0x06, 24093 0x24, 24094 0x5c, 24095 0xc2, 24096 0xd3, 24097 0xac, 24098 0x62, 24099 0x91, 24100 0x95, 24101 0xe4, 24102 0x79, 24103 0xe7, 24104 0xc8, 24105 0x37, 24106 0x6d, 24107 0x8d, 24108 0xd5, 24109 0x4e, 24110 0xa9, 24111 0x6c, 24112 0x56, 24113 0xf4, 24114 0xea, 24115 0x65, 24116 0x7a, 24117 0xae, 24118 0x08, 24119 0xba, 24120 0x78, 24121 0x25, 24122 0x2e, 24123 0x1c, 24124 0xa6, 24125 0xb4, 24126 0xc6, 24127 0xe8, 24128 0xdd, 24129 0x74, 24130 0x1f, 24131 0x4b, 24132 0xbd, 24133 0x8b, 24134 0x8a, 24135 0x70, 24136 0x3e, 24137 0xb5, 24138 0x66, 24139 0x48, 24140 0x03, 24141 0xf6, 24142 0x0e, 24143 0x61, 24144 0x35, 24145 0x57, 24146 0xb9, 24147 0x86, 24148 0xc1, 24149 0x1d, 24150 0x9e, 24151 0xe1, 24152 0xf8, 24153 0x98, 24154 0x11, 24155 0x69, 24156 0xd9, 24157 0x8e, 24158 0x94, 24159 0x9b, 24160 0x1e, 24161 0x87, 24162 0xe9, 24163 0xce, 24164 0x55, 24165 0x28, 24166 0xdf, 24167 0x8c, 24168 0xa1, 24169 0x89, 24170 0x0d, 24171 0xbf, 24172 0xe6, 24173 0x42, 24174 0x68, 24175 0x41, 24176 0x99, 24177 0x2d, 24178 0x0f, 24179 0xb0, 24180 0x54, 24181 0xbb, 24182 0x16 24183 ]); 24184 var inv_s = new Uint8Array([ 24185 0x52, 24186 0x09, 24187 0x6a, 24188 0xd5, 24189 0x30, 24190 0x36, 24191 0xa5, 24192 0x38, 24193 0xbf, 24194 0x40, 24195 0xa3, 24196 0x9e, 24197 0x81, 24198 0xf3, 24199 0xd7, 24200 0xfb, 24201 0x7c, 24202 0xe3, 24203 0x39, 24204 0x82, 24205 0x9b, 24206 0x2f, 24207 0xff, 24208 0x87, 24209 0x34, 24210 0x8e, 24211 0x43, 24212 0x44, 24213 0xc4, 24214 0xde, 24215 0xe9, 24216 0xcb, 24217 0x54, 24218 0x7b, 24219 0x94, 24220 0x32, 24221 0xa6, 24222 0xc2, 24223 0x23, 24224 0x3d, 24225 0xee, 24226 0x4c, 24227 0x95, 24228 0x0b, 24229 0x42, 24230 0xfa, 24231 0xc3, 24232 0x4e, 24233 0x08, 24234 0x2e, 24235 0xa1, 24236 0x66, 24237 0x28, 24238 0xd9, 24239 0x24, 24240 0xb2, 24241 0x76, 24242 0x5b, 24243 0xa2, 24244 0x49, 24245 0x6d, 24246 0x8b, 24247 0xd1, 24248 0x25, 24249 0x72, 24250 0xf8, 24251 0xf6, 24252 0x64, 24253 0x86, 24254 0x68, 24255 0x98, 24256 0x16, 24257 0xd4, 24258 0xa4, 24259 0x5c, 24260 0xcc, 24261 0x5d, 24262 0x65, 24263 0xb6, 24264 0x92, 24265 0x6c, 24266 0x70, 24267 0x48, 24268 0x50, 24269 0xfd, 24270 0xed, 24271 0xb9, 24272 0xda, 24273 0x5e, 24274 0x15, 24275 0x46, 24276 0x57, 24277 0xa7, 24278 0x8d, 24279 0x9d, 24280 0x84, 24281 0x90, 24282 0xd8, 24283 0xab, 24284 0x00, 24285 0x8c, 24286 0xbc, 24287 0xd3, 24288 0x0a, 24289 0xf7, 24290 0xe4, 24291 0x58, 24292 0x05, 24293 0xb8, 24294 0xb3, 24295 0x45, 24296 0x06, 24297 0xd0, 24298 0x2c, 24299 0x1e, 24300 0x8f, 24301 0xca, 24302 0x3f, 24303 0x0f, 24304 0x02, 24305 0xc1, 24306 0xaf, 24307 0xbd, 24308 0x03, 24309 0x01, 24310 0x13, 24311 0x8a, 24312 0x6b, 24313 0x3a, 24314 0x91, 24315 0x11, 24316 0x41, 24317 0x4f, 24318 0x67, 24319 0xdc, 24320 0xea, 24321 0x97, 24322 0xf2, 24323 0xcf, 24324 0xce, 24325 0xf0, 24326 0xb4, 24327 0xe6, 24328 0x73, 24329 0x96, 24330 0xac, 24331 0x74, 24332 0x22, 24333 0xe7, 24334 0xad, 24335 0x35, 24336 0x85, 24337 0xe2, 24338 0xf9,
24339 0x37, 24340 0xe8, 24341 0x1c, 24342 0x75, 24343 0xdf, 24344 0x6e, 24345 0x47, 24346 0xf1, 24347 0x1a, 24348 0x71, 24349 0x1d, 24350 0x29, 24351 0xc5, 24352 0x89, 24353 0x6f, 24354 0xb7, 24355 0x62, 24356 0x0e, 24357 0xaa, 24358 0x18, 24359 0xbe, 24360 0x1b, 24361 0xfc, 24362 0x56, 24363 0x3e, 24364 0x4b, 24365 0xc6, 24366 0xd2, 24367 0x79, 24368 0x20, 24369 0x9a, 24370 0xdb, 24371 0xc0, 24372 0xfe, 24373 0x78, 24374 0xcd, 24375 0x5a, 24376 0xf4, 24377 0x1f, 24378 0xdd, 24379 0xa8, 24380 0x33, 24381 0x88, 24382 0x07, 24383 0xc7, 24384 0x31, 24385 0xb1, 24386 0x12, 24387 0x10, 24388 0x59, 24389 0x27, 24390 0x80, 24391 0xec, 24392 0x5f, 24393 0x60, 24394 0x51, 24395 0x7f, 24396 0xa9, 24397 0x19, 24398 0xb5, 24399 0x4a, 24400 0x0d, 24401 0x2d, 24402 0xe5, 24403 0x7a, 24404 0x9f, 24405 0x93, 24406 0xc9, 24407 0x9c, 24408 0xef, 24409 0xa0, 24410 0xe0, 24411 0x3b, 24412 0x4d, 24413 0xae, 24414 0x2a, 24415 0xf5, 24416 0xb0, 24417 0xc8, 24418 0xeb, 24419 0xbb, 24420 0x3c, 24421 0x83, 24422 0x53, 24423 0x99, 24424 0x61, 24425 0x17, 24426 0x2b, 24427 0x04, 24428 0x7e, 24429 0xba, 24430 0x77, 24431 0xd6, 24432 0x26, 24433 0xe1, 24434 0x69, 24435 0x14, 24436 0x63, 24437 0x55, 24438 0x21, 24439 0x0c, 24440 0x7d 24441 ]); 24442 var mixCol = new Uint8Array(256); 24443 for (var i = 0; i < 256; i++) { 24444 if (i < 128) { 24445 mixCol[i] = i << 1; 24446 } else { 24447 mixCol[i] = i << 1 ^ 0x1b; 24448 } 24449 } 24450 var mix = new Uint32Array([ 24451 0x00000000, 24452 0x0e090d0b, 24453 0x1c121a16, 24454 0x121b171d, 24455 0x3824342c, 24456 0x362d3927, 24457 0x24362e3a, 24458 0x2a3f2331, 24459 0x70486858, 24460 0x7e416553, 24461 0x6c5a724e, 24462 0x62537f45, 24463 0x486c5c74, 24464 0x4665517f, 24465 0x547e4662, 24466 0x5a774b69, 24467 0xe090d0b0, 24468 0xee99ddbb, 24469 0xfc82caa6, 24470 0xf28bc7ad, 24471 0xd8b4e49c, 24472 0xd6bde997, 24473 0xc4a6fe8a, 24474 0xcaaff381, 24475 0x90d8b8e8, 24476 0x9ed1b5e3, 24477 0x8ccaa2fe, 24478 0x82c3aff5, 24479 0xa8fc8cc4, 24480 0xa6f581cf, 24481 0xb4ee96d2, 24482 0xbae79bd9, 24483 0xdb3bbb7b, 24484 0xd532b670, 24485 0xc729a16d, 24486 0xc920ac66, 24487 0xe31f8f57, 24488 0xed16825c, 24489 0xff0d9541, 24490 0xf104984a, 24491 0xab73d323, 24492 0xa57ade28, 24493 0xb761c935, 24494 0xb968c43e, 24495 0x9357e70f, 24496 0x9d5eea04, 24497 0x8f45fd19, 24498 0x814cf012, 24499 0x3bab6bcb, 24500 0x35a266c0, 24501 0x27b971dd, 24502 0x29b07cd6, 24503 0x038f5fe7, 24504 0x0d8652ec, 24505 0x1f9d45f1, 24506 0x119448fa, 24507 0x4be30393, 24508 0x45ea0e98, 24509 0x57f11985, 24510 0x59f8148e, 24511 0x73c737bf, 24512 0x7dce3ab4, 24513 0x6fd52da9, 24514 0x61dc20a2, 24515 0xad766df6, 24516 0xa37f60fd, 24517 0xb16477e0, 24518 0xbf6d7aeb, 24519 0x955259da, 24520 0x9b5b54d1, 24521 0x894043cc, 24522 0x87494ec7, 24523 0xdd3e05ae, 24524 0xd33708a5, 24525 0xc12c1fb8, 24526 0xcf2512b3, 24527 0xe51a3182, 24528 0xeb133c89, 24529 0xf9082b94, 24530 0xf701269f, 24531 0x4de6bd46, 24532 0x43efb04d, 24533 0x51f4a750, 24534 0x5ffdaa5b, 24535 0x75c2896a, 24536 0x7bcb8461, 24537 0x69d0937c, 24538 0x67d99e77, 24539 0x3daed51e, 24540 0x33a7d815, 24541 0x21bccf08, 24542 0x2fb5c203, 24543 0x058ae132, 24544 0x0b83ec39, 24545 0x1998fb24, 24546 0x1791f62f, 24547 0x764dd68d, 24548 0x7844db86, 24549 0x6a5fcc9b, 24550 0x6456c190, 24551 0x4e69e2a1, 24552 0x4060efaa, 24553 0x527bf8b7, 24554 0x5c72f5bc, 24555 0x0605bed5, 24556 0x080cb3de, 24557 0x1a17a4c3, 24558 0x141ea9c8, 24559 0x3e218af9, 24560 0x302887f2, 24561 0x223390ef, 24562 0x2c3a9de4, 24563 0x96dd063d, 24564 0x98d40b36, 24565 0x8acf1c2b, 24566 0x84c61120, 24567 0xaef93211, 24568 0xa0f03f1a, 24569 0xb2eb2807, 24570 0xbce2250c, 24571 0xe6956e65, 24572 0xe89c636e, 24573 0xfa877473, 24574 0xf48e7978, 24575 0xdeb15a49, 24576 0xd0b85742, 24577 0xc2a3405f, 24578 0xccaa4d54, 24579 0x41ecdaf7, 24580 0x4fe5d7fc, 24581 0x5dfec0e1, 24582 0x53f7cdea, 24583 0x79c8eedb, 24584 0x77c1e3d0, 24585 0x65daf4cd, 24586 0x6bd3f9c6, 24587 0x31a4b2af, 24588 0x3fadbfa4, 24589 0x2db6a8b9, 24590 0x23bfa5b2, 24591 0x09808683, 24592 0x07898b88, 24593 0x15929c95, 24594 0x1b9b919e, 24595 0xa17c0a47, 24596 0xaf75074c, 24597 0xbd6e1051, 24598 0xb3671d5a, 24599 0x99583e6b, 24600 0x97513360, 24601 0x854a247d, 24602 0x8b432976, 24603 0xd134621f, 24604 0xdf3d6f14, 24605 0xcd267809, 24606 0xc32f7502, 24607 0xe9105633, 24608 0xe7195b38, 24609 0xf5024c25, 24610 0xfb0b412e, 24611 0x9ad7618c, 24612 0x94de6c87, 24613 0x86c57b9a, 24614 0x88cc7691, 24615 0xa2f355a0, 24616 0xacfa58ab, 24617 0xbee14fb6, 24618 0xb0e842bd, 24619 0xea9f09d4, 24620 0xe49604df, 24621 0xf68d13c2, 24622 0xf8841ec9, 24623 0xd2bb3df8, 24624 0xdcb230f3, 24625 0xcea927ee, 24626 0xc0a02ae5, 24627 0x7a47b13c, 24628 0x744ebc37, 24629 0x6655ab2a, 24630 0x685ca621, 24631 0x42638510, 24632 0x4c6a881b, 24633 0x5e719f06, 24634 0x5078920d, 24635 0x0a0fd964, 24636 0x0406d46f, 24637 0x161dc372, 24638 0x1814ce79, 24639 0x322bed48, 24640 0x3c22e043, 24641 0x2e39f75e, 24642 0x2030fa55, 24643 0xec9ab701, 24644 0xe293ba0a, 24645 0xf088ad17, 24646 0xfe81a01c, 24647 0xd4be832d, 24648 0xdab78e26, 24649 0xc8ac993b, 24650 0xc6a59430, 24651 0x9cd2df59, 24652 0x92dbd252, 24653 0x80c0c54f, 24654 0x8ec9c844, 24655 0xa4f6eb75, 24656 0xaaffe67e, 24657 0xb8e4f163, 24658 0xb6edfc68, 24659 0x0c0a67b1, 24660 0x02036aba, 24661 0x10187da7, 24662 0x1e1170ac, 24663 0x342e539d, 24664 0x3a275e96, 24665 0x283c498b, 24666 0x26354480, 24667 0x7c420fe9, 24668 0x724b02e2, 24669 0x605015ff, 24670 0x6e5918f4, 24671 0x44663bc5, 24672 0x4a6f36ce, 24673 0x587421d3, 24674 0x567d2cd8, 24675 0x37a10c7a, 24676 0x39a80171, 24677 0x2bb3166c, 24678 0x25ba1b67, 24679 0x0f853856,
vendor: 21,909 bytes, lines 24680-25413
24680 0x018c355d, 24681 0x13972240, 24682 0x1d9e2f4b, 24683 0x47e96422, 24684 0x49e06929, 24685 0x5bfb7e34, 24686 0x55f2733f, 24687 0x7fcd500e, 24688 0x71c45d05, 24689 0x63df4a18, 24690 0x6dd64713, 24691 0xd731dcca, 24692 0xd938d1c1, 24693 0xcb23c6dc, 24694 0xc52acbd7, 24695 0xef15e8e6, 24696 0xe11ce5ed, 24697 0xf307f2f0, 24698 0xfd0efffb, 24699 0xa779b492, 24700 0xa970b999, 24701 0xbb6bae84, 24702 0xb562a38f, 24703 0x9f5d80be, 24704 0x91548db5, 24705 0x834f9aa8, 24706 0x8d4697a3 24707 ]); 24708 function expandKey256(cipherKey) { 24709 var b = 240, result = new Uint8Array(b); 24710 var r = 1; 24711 result.set(cipherKey); 24712 for (var j = 32, i = 1; j < b; ++i) { 24713 if (j % 32 === 16) { 24714 t1 = s[t1]; 24715 t2 = s[t2]; 24716 t3 = s[t3]; 24717 t4 = s[t4]; 24718 } else if (j % 32 === 0) { 24719 var t1 = result[j - 3], t2 = result[j - 2], t3 = result[j - 1], t4 = result[j - 4]; 24720 t1 = s[t1]; 24721 t2 = s[t2]; 24722 t3 = s[t3]; 24723 t4 = s[t4]; 24724 t1 = t1 ^ r; 24725 if ((r <<= 1) >= 256) { 24726 r = (r ^ 0x1b) & 0xFF; 24727 } 24728 } 24729 for (var n = 0; n < 4; ++n) { 24730 result[j] = t1 ^= result[j - 32]; 24731 j++; 24732 result[j] = t2 ^= result[j - 32]; 24733 j++; 24734 result[j] = t3 ^= result[j - 32]; 24735 j++; 24736 result[j] = t4 ^= result[j - 32]; 24737 j++; 24738 } 24739 } 24740 return result; 24741 } 24742 function decrypt256(input, key) { 24743 var state = new Uint8Array(16); 24744 state.set(input); 24745 var i, j, k; 24746 var t, u, v; 24747 for (j = 0, k = 224; j < 16; ++j, ++k) { 24748 state[j] ^= key[k]; 24749 } 24750 for (i = 13; i >= 1; --i) { 24751 t = state[13]; 24752 state[13] = state[9]; 24753 state[9] = state[5]; 24754 state[5] = state[1]; 24755 state[1] = t; 24756 t = state[14]; 24757 u = state[10]; 24758 state[14] = state[6]; 24759 state[10] = state[2]; 24760 state[6] = t; 24761 state[2] = u; 24762 t = state[15]; 24763 u = state[11]; 24764 v = state[7]; 24765 state[15] = state[3]; 24766 state[11] = t; 24767 state[7] = u; 24768 state[3] = v; 24769 for (j = 0; j < 16; ++j) { 24770 state[j] = inv_s[state[j]]; 24771 } 24772 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 24773 state[j] ^= key[k]; 24774 } 24775 for (j = 0; j < 16; j += 4) { 24776 var s0 = mix[state[j]], s1 = mix[state[j + 1]], s2 = mix[state[j + 2]], s3 = mix[state[j + 3]]; 24777 t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; 24778 state[j] = t >>> 24 & 0xFF; 24779 state[j + 1] = t >> 16 & 0xFF; 24780 state[j + 2] = t >> 8 & 0xFF; 24781 state[j + 3] = t & 0xFF; 24782 } 24783 } 24784 t = state[13]; 24785 state[13] = state[9]; 24786 state[9] = state[5]; 24787 state[5] = state[1]; 24788 state[1] = t; 24789 t = state[14]; 24790 u = state[10]; 24791 state[14] = state[6]; 24792 state[10] = state[2]; 24793 state[6] = t; 24794 state[2] = u; 24795 t = state[15]; 24796 u = state[11]; 24797 v = state[7]; 24798 state[15] = state[3]; 24799 state[11] = t; 24800 state[7] = u; 24801 state[3] = v; 24802 for (j = 0; j < 16; ++j) { 24803 state[j] = inv_s[state[j]]; 24804 state[j] ^= key[j]; 24805 } 24806 return state; 24807 } 24808 function encrypt256(input, key) { 24809 var t, u, v, k; 24810 var state = new Uint8Array(16); 24811 state.set(input); 24812 for (j = 0; j < 16; ++j) { 24813 state[j] ^= key[j]; 24814 } 24815 for (i = 1; i < 14; i++) { 24816 for (j = 0; j < 16; ++j) { 24817 state[j] = s[state[j]]; 24818 } 24819 v = state[1]; 24820 state[1] = state[5]; 24821 state[5] = state[9]; 24822 state[9] = state[13]; 24823 state[13] = v; 24824 v = state[2]; 24825 u = state[6]; 24826 state[2] = state[10]; 24827 state[6] = state[14]; 24828 state[10] = v; 24829 state[14] = u; 24830 v = state[3]; 24831 u = state[7]; 24832 t = state[11]; 24833 state[3] = state[15]; 24834 state[7] = v; 24835 state[11] = u; 24836 state[15] = t; 24837 for (var j = 0; j < 16; j += 4) { 24838 var s0 = state[j + 0], s1 = state[j + 1]; 24839 var s2 = state[j + 2], s3 = state[j + 3]; 24840 t = s0 ^ s1 ^ s2 ^ s3; 24841 state[j + 0] ^= t ^ mixCol[s0 ^ s1]; 24842 state[j + 1] ^= t ^ mixCol[s1 ^ s2]; 24843 state[j + 2] ^= t ^ mixCol[s2 ^ s3]; 24844 state[j + 3] ^= t ^ mixCol[s3 ^ s0]; 24845 } 24846 for (j = 0, k = i * 16; j < 16; ++j, ++k) { 24847 state[j] ^= key[k]; 24848 } 24849 } 24850 for (j = 0; j < 16; ++j) { 24851 state[j] = s[state[j]]; 24852 } 24853 v = state[1]; 24854 state[1] = state[5]; 24855 state[5] = state[9]; 24856 state[9] = state[13]; 24857 state[13] = v; 24858 v = state[2]; 24859 u = state[6]; 24860 state[2] = state[10]; 24861 state[6] = state[14]; 24862 state[10] = v; 24863 state[14] = u; 24864 v = state[3]; 24865 u = state[7]; 24866 t = state[11]; 24867 state[3] = state[15]; 24868 state[7] = v; 24869 state[11] = u; 24870 state[15] = t; 24871 for (j = 0, k = 224; j < 16; ++j, ++k) { 24872 state[j] ^= key[k]; 24873 } 24874 return state; 24875 } 24876 function AES256Cipher(key) { 24877 this.key = expandKey256(key); 24878 this.buffer = new Uint8Array(16); 24879 this.bufferPosition = 0; 24880 } 24881 function decryptBlock2(data, finalize) { 24882 var i, j, ii, sourceLength = data.length, buffer = this.buffer, bufferLength = this.bufferPosition, result = [], iv = this.iv; 24883 for (i = 0; i < sourceLength; ++i) { 24884 buffer[bufferLength] = data[i]; 24885 ++bufferLength; 24886 if (bufferLength < 16) { 24887 continue; 24888 } 24889 var plain = decrypt256(buffer, this.key); 24890 for (j = 0; j < 16; ++j) { 24891 plain[j] ^= iv[j]; 24892 } 24893 iv = buffer; 24894 result.push(plain); 24895 buffer = new Uint8Array(16); 24896 bufferLength = 0; 24897 } 24898 this.buffer = buffer; 24899 this.bufferLength = bufferLength; 24900 this.iv = iv; 24901 if (result.length === 0) { 24902 return new Uint8Array([]); 24903 } 24904 var outputLength = 16 * result.length; 24905 if (finalize) { 24906 var lastBlock = result[result.length - 1]; 24907 var psLen = lastBlock[15]; 24908 if (psLen <= 16) { 24909 for (i = 15, ii = 16 - psLen; i >= ii; --i) { 24910 if (lastBlock[i] !== psLen) { 24911 psLen = 0; 24912 break; 24913 } 24914 } 24915 outputLength -= psLen; 24916 result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); 24917 } 24918 } 24919 var output = new Uint8Array(outputLength); 24920 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 24921 output.set(result[i], j); 24922 } 24923 return output; 24924 } 24925 AES256Cipher.prototype = { 24926 decryptBlock: function AES256Cipher_decryptBlock(data, finalize, iv) { 24927 var i, sourceLength = data.length; 24928 var buffer = this.buffer, bufferLength = this.bufferPosition; 24929 if (iv) { 24930 this.iv = iv; 24931 } else { 24932 for (i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { 24933 buffer[bufferLength] = data[i]; 24934 } 24935 if (bufferLength < 16) { 24936 this.bufferLength = bufferLength; 24937 return new Uint8Array([]); 24938 } 24939 this.iv = buffer; 24940 data = data.subarray(16); 24941 } 24942 this.buffer = new Uint8Array(16); 24943 this.bufferLength = 0; 24944 this.decryptBlock = decryptBlock2; 24945 return this.decryptBlock(data, finalize); 24946 }, 24947 encrypt: function AES256Cipher_encrypt(data, iv) { 24948 var i, j, ii, sourceLength = data.length, buffer = this.buffer, bufferLength = this.bufferPosition, result = []; 24949 if (!iv) { 24950 iv = new Uint8Array(16); 24951 } 24952 for (i = 0; i < sourceLength; ++i) { 24953 buffer[bufferLength] = data[i]; 24954 ++bufferLength; 24955 if (bufferLength < 16) { 24956 continue; 24957 } 24958 for (j = 0; j < 16; ++j) { 24959 buffer[j] ^= iv[j]; 24960 } 24961 var cipher = encrypt256(buffer, this.key); 24962 this.iv = cipher; 24963 result.push(cipher); 24964 buffer = new Uint8Array(16); 24965 bufferLength = 0; 24966 } 24967 this.buffer = buffer; 24968 this.bufferLength = bufferLength; 24969 this.iv = iv; 24970 if (result.length === 0) { 24971 return new Uint8Array([]); 24972 } 24973 var outputLength = 16 * result.length; 24974 var output = new Uint8Array(outputLength); 24975 for (i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { 24976 output.set(result[i], j); 24977 } 24978 return output; 24979 } 24980 }; 24981 return AES256Cipher; 24982}(); 24983var PDF17 = function PDF17Closure() { 24984 function compareByteArrays(array1, array2) { 24985 if (array1.length !== array2.length) { 24986 return false; 24987 } 24988 for (var i = 0; i < array1.length; i++) { 24989 if (array1[i] !== array2[i]) { 24990 return false; 24991 } 24992 } 24993 return true; 24994 } 24995 function PDF17() { 24996 } 24997 PDF17.prototype = { 24998 checkOwnerPassword: function PDF17_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 24999 var hashData = new Uint8Array(password.length + 56); 25000 hashData.set(password, 0); 25001 hashData.set(ownerValidationSalt, password.length); 25002 hashData.set(userBytes, password.length + ownerValidationSalt.length); 25003 var result = calculateSHA256(hashData, 0, hashData.length); 25004 return compareByteArrays(result, ownerPassword); 25005 }, 25006 checkUserPassword: function PDF17_checkUserPassword(password, userValidationSalt, userPassword) { 25007 var hashData = new Uint8Array(password.length + 8); 25008 hashData.set(password, 0); 25009 hashData.set(userValidationSalt, password.length); 25010 var result = calculateSHA256(hashData, 0, hashData.length); 25011 return compareByteArrays(result, userPassword); 25012 }, 25013 getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 25014 var hashData = new Uint8Array(password.length + 56); 25015 hashData.set(password, 0); 25016 hashData.set(ownerKeySalt, password.length); 25017 hashData.set(userBytes, password.length + ownerKeySalt.length); 25018 var key = calculateSHA256(hashData, 0, hashData.length); 25019 var cipher = new AES256Cipher(key); 25020 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 25021 }, 25022 getUserKey: function PDF17_getUserKey(password, userKeySalt, userEncryption) { 25023 var hashData = new Uint8Array(password.length + 8); 25024 hashData.set(password, 0); 25025 hashData.set(userKeySalt, password.length); 25026 var key = calculateSHA256(hashData, 0, hashData.length); 25027 var cipher = new AES256Cipher(key); 25028 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 25029 } 25030 }; 25031 return PDF17; 25032}(); 25033var PDF20 = function PDF20Closure() { 25034 function concatArrays(array1, array2) { 25035 var t = new Uint8Array(array1.length + array2.length); 25036 t.set(array1, 0); 25037 t.set(array2, array1.length); 25038 return t; 25039 } 25040 function calculatePDF20Hash(password, input, userBytes) { 25041 var k = calculateSHA256(input, 0, input.length).subarray(0, 32); 25042 var e = [0]; 25043 var i = 0; 25044 while (i < 64 || e[e.length - 1] > i - 32) { 25045 var arrayLength = password.length + k.length + userBytes.length; 25046 var k1 = new Uint8Array(arrayLength * 64); 25047 var array = concatArrays(password, k); 25048 array = concatArrays(array, userBytes); 25049 for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { 25050 k1.set(array, pos); 25051 } 25052 var cipher = new AES128Cipher(k.subarray(0, 16)); 25053 e = cipher.encrypt(k1, k.subarray(16, 32)); 25054 var remainder = 0; 25055 for (var z = 0; z < 16; z++) { 25056 remainder *= 256 % 3; 25057 remainder %= 3; 25058 remainder += (e[z] >>> 0) % 3; 25059 remainder %= 3; 25060 } 25061 if (remainder === 0) { 25062 k = calculateSHA256(e, 0, e.length); 25063 } else if (remainder === 1) { 25064 k = calculateSHA384(e, 0, e.length); 25065 } else if (remainder === 2) { 25066 k = calculateSHA512(e, 0, e.length); 25067 } 25068 i++; 25069 } 25070 return k.subarray(0, 32); 25071 } 25072 function PDF20() { 25073 } 25074 function compareByteArrays(array1, array2) { 25075 if (array1.length !== array2.length) { 25076 return false; 25077 } 25078 for (var i = 0; i < array1.length; i++) { 25079 if (array1[i] !== array2[i]) { 25080 return false; 25081 } 25082 } 25083 return true; 25084 } 25085 PDF20.prototype = { 25086 hash: function PDF20_hash(password, concatBytes, userBytes) { 25087 return calculatePDF20Hash(password, concatBytes, userBytes); 25088 }, 25089 checkOwnerPassword: function PDF20_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 25090 var hashData = new Uint8Array(password.length + 56); 25091 hashData.set(password, 0); 25092 hashData.set(ownerValidationSalt, password.length); 25093 hashData.set(userBytes, password.length + ownerValidationSalt.length); 25094 var result = calculatePDF20Hash(password, hashData, userBytes); 25095 return compareByteArrays(result, ownerPassword); 25096 }, 25097 checkUserPassword: function PDF20_checkUserPassword(password, userValidationSalt, userPassword) { 25098 var hashData = new Uint8Array(password.length + 8); 25099 hashData.set(password, 0); 25100 hashData.set(userValidationSalt, password.length); 25101 var result = calculatePDF20Hash(password, hashData, []); 25102 return compareByteArrays(result, userPassword); 25103 }, 25104 getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 25105 var hashData = new Uint8Array(password.length + 56); 25106 hashData.set(password, 0); 25107 hashData.set(ownerKeySalt, password.length); 25108 hashData.set(userBytes, password.length + ownerKeySalt.length); 25109 var key = calculatePDF20Hash(password, hashData, userBytes); 25110 var cipher = new AES256Cipher(key); 25111 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 25112 }, 25113 getUserKey: function PDF20_getUserKey(password, userKeySalt, userEncryption) { 25114 var hashData = new Uint8Array(password.length + 8); 25115 hashData.set(password, 0); 25116 hashData.set(userKeySalt, password.length); 25117 var key = calculatePDF20Hash(password, hashData, []); 25118 var cipher = new AES256Cipher(key); 25119 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 25120 } 25121 }; 25122 return PDF20; 25123}(); 25124var CipherTransform = function CipherTransformClosure() { 25125 function CipherTransform(stringCipherConstructor, streamCipherConstructor) { 25126 this.StringCipherConstructor = stringCipherConstructor; 25127 this.StreamCipherConstructor = streamCipherConstructor; 25128 } 25129 CipherTransform.prototype = { 25130 createStream: function CipherTransform_createStream(stream, length) { 25131 var cipher = new this.StreamCipherConstructor(); 25132 return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { 25133 return cipher.decryptBlock(data, finalize); 25134 }); 25135 }, 25136 decryptString: function CipherTransform_decryptString(s) { 25137 var cipher = new this.StringCipherConstructor(); 25138 var data = stringToBytes(s); 25139 data = cipher.decryptBlock(data, true); 25140 return bytesToString(data); 25141 } 25142 }; 25143 return CipherTransform; 25144}(); 25145var CipherTransformFactory = function CipherTransformFactoryClosure() { 25146 var defaultPasswordBytes = new Uint8Array([ 25147 0x28, 25148 0xBF, 25149 0x4E, 25150 0x5E, 25151 0x4E, 25152 0x75, 25153 0x8A, 25154 0x41, 25155 0x64, 25156 0x00, 25157 0x4E, 25158 0x56, 25159 0xFF, 25160 0xFA, 25161 0x01, 25162 0x08, 25163 0x2E, 25164 0x2E, 25165 0x00, 25166 0xB6, 25167 0xD0, 25168 0x68, 25169 0x3E, 25170 0x80, 25171 0x2F, 25172 0x0C, 25173 0xA9, 25174 0xFE, 25175 0x64, 25176 0x53, 25177 0x69, 25178 0x7A 25179 ]); 25180 function createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { 25181 if (password) { 25182 var passwordLength = Math.min(127, password.length); 25183 password = password.subarray(0, passwordLength); 25184 } else { 25185 password = []; 25186 } 25187 var pdfAlgorithm; 25188 if (revision === 6) { 25189 pdfAlgorithm = new PDF20(); 25190 } else { 25191 pdfAlgorithm = new PDF17(); 25192 } 25193 if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { 25194 return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); 25195 } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) { 25196 return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); 25197 } 25198 return null; 25199 } 25200 function prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { 25201 var hashDataSize = 40 + ownerPassword.length + fileId.length; 25202 var hashData = new Uint8Array(hashDataSize), i = 0, j, n; 25203 if (password) { 25204 n = Math.min(32, password.length); 25205 for (; i < n; ++i) { 25206 hashData[i] = password[i]; 25207 } 25208 } 25209 j = 0; 25210 while (i < 32) { 25211 hashData[i++] = defaultPasswordBytes[j++]; 25212 } 25213 for (j = 0, n = ownerPassword.length; j < n; ++j) { 25214 hashData[i++] = ownerPassword[j]; 25215 } 25216 hashData[i++] = flags & 0xFF; 25217 hashData[i++] = flags >> 8 & 0xFF; 25218 hashData[i++] = flags >> 16 & 0xFF; 25219 hashData[i++] = flags >>> 24 & 0xFF; 25220 for (j = 0, n = fileId.length; j < n; ++j) { 25221 hashData[i++] = fileId[j]; 25222 } 25223 if (revision >= 4 && !encryptMetadata) { 25224 hashData[i++] = 0xFF; 25225 hashData[i++] = 0xFF; 25226 hashData[i++] = 0xFF; 25227 hashData[i++] = 0xFF; 25228 } 25229 var hash = calculateMD5(hashData, 0, i); 25230 var keyLengthInBytes = keyLength >> 3; 25231 if (revision >= 3) { 25232 for (j = 0; j < 50; ++j) { 25233 hash = calculateMD5(hash, 0, keyLengthInBytes); 25234 } 25235 } 25236 var encryptionKey = hash.subarray(0, keyLengthInBytes); 25237 var cipher, checkData; 25238 if (revision >= 3) { 25239 for (i = 0; i < 32; ++i) { 25240 hashData[i] = defaultPasswordBytes[i]; 25241 } 25242 for (j = 0, n = fileId.length; j < n; ++j) { 25243 hashData[i++] = fileId[j]; 25244 } 25245 cipher = new ARCFourCipher(encryptionKey); 25246 checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); 25247 n = encryptionKey.length; 25248 var derivedKey = new Uint8Array(n), k; 25249 for (j = 1; j <= 19; ++j) { 25250 for (k = 0; k < n; ++k) { 25251 derivedKey[k] = encryptionKey[k] ^ j; 25252 } 25253 cipher = new ARCFourCipher(derivedKey); 25254 checkData = cipher.encryptBlock(checkData); 25255 } 25256 for (j = 0, n = checkData.length; j < n; ++j) { 25257 if (userPassword[j] !== checkData[j]) { 25258 return null; 25259 } 25260 } 25261 } else { 25262 cipher = new ARCFourCipher(encryptionKey); 25263 checkData = cipher.encryptBlock(defaultPasswordBytes); 25264 for (j = 0, n = checkData.length; j < n; ++j) { 25265 if (userPassword[j] !== checkData[j]) { 25266 return null; 25267 } 25268 } 25269 } 25270 return encryptionKey; 25271 } 25272 function decodeUserPassword(password, ownerPassword, revision, keyLength) { 25273 var hashData = new Uint8Array(32), i = 0, j, n; 25274 n = Math.min(32, password.length); 25275 for (; i < n; ++i) { 25276 hashData[i] = password[i]; 25277 } 25278 j = 0; 25279 while (i < 32) { 25280 hashData[i++] = defaultPasswordBytes[j++]; 25281 } 25282 var hash = calculateMD5(hashData, 0, i); 25283 var keyLengthInBytes = keyLength >> 3; 25284 if (revision >= 3) { 25285 for (j = 0; j < 50; ++j) { 25286 hash = calculateMD5(hash, 0, hash.length); 25287 } 25288 } 25289 var cipher, userPassword; 25290 if (revision >= 3) { 25291 userPassword = ownerPassword; 25292 var derivedKey = new Uint8Array(keyLengthInBytes), k; 25293 for (j = 19; j >= 0; j--) { 25294 for (k = 0; k < keyLengthInBytes; ++k) { 25295 derivedKey[k] = hash[k] ^ j; 25296 } 25297 cipher = new ARCFourCipher(derivedKey); 25298 userPassword = cipher.encryptBlock(userPassword); 25299 } 25300 } else { 25301 cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); 25302 userPassword = cipher.encryptBlock(ownerPassword); 25303 } 25304 return userPassword; 25305 } 25306 var identityName = Name.get('Identity'); 25307 function CipherTransformFactory(dict, fileId, password) { 25308 var filter = dict.get('Filter'); 25309 if (!isName(filter, 'Standard')) { 25310 error('unknown encryption method'); 25311 } 25312 this.dict = dict; 25313 var algorithm = dict.get('V'); 25314 if (!isInt(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { 25315 error('unsupported encryption algorithm'); 25316 } 25317 this.algorithm = algorithm; 25318 var keyLength = dict.get('Length'); 25319 if (!keyLength) { 25320 if (algorithm <= 3) { 25321 keyLength = 40; 25322 } else { 25323 var cfDict = dict.get('CF'); 25324 var streamCryptoName = dict.get('StmF'); 25325 if (isDict(cfDict) && isName(streamCryptoName)) { 25326 cfDict.suppressEncryption = true; 25327 var handlerDict = cfDict.get(streamCryptoName.name); 25328 keyLength = handlerDict && handlerDict.get('Length') || 128; 25329 if (keyLength < 40) { 25330 keyLength <<= 3; 25331 } 25332 } 25333 } 25334 } 25335 if (!isInt(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { 25336 error('invalid key length'); 25337 } 25338 var ownerPassword = stringToBytes(dict.get('O')).subarray(0, 32); 25339 var userPassword = stringToBytes(dict.get('U')).subarray(0, 32); 25340 var flags = dict.get('P'); 25341 var revision = dict.get('R'); 25342 var encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get('EncryptMetadata') !== false; 25343 this.encryptMetadata = encryptMetadata; 25344 var fileIdBytes = stringToBytes(fileId); 25345 var passwordBytes; 25346 if (password) { 25347 if (revision === 6) { 25348 try { 25349 password = utf8StringToString(password); 25350 } catch (ex) { 25351 warn('CipherTransformFactory: ' + 'Unable to convert UTF8 encoded password.'); 25352 } 25353 } 25354 passwordBytes = stringToBytes(password); 25355 } 25356 var encryptionKey; 25357 if (algorithm !== 5) { 25358 encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 25359 } else { 25360 var ownerValidationSalt = stringToBytes(dict.get('O')).subarray(32, 40); 25361 var ownerKeySalt = stringToBytes(dict.get('O')).subarray(40, 48); 25362 var uBytes = stringToBytes(dict.get('U')).subarray(0, 48); 25363 var userValidationSalt = stringToBytes(dict.get('U')).subarray(32, 40); 25364 var userKeySalt = stringToBytes(dict.get('U')).subarray(40, 48); 25365 var ownerEncryption = stringToBytes(dict.get('OE')); 25366 var userEncryption = stringToBytes(dict.get('UE')); 25367 var perms = stringToBytes(dict.get('Perms')); 25368 encryptionKey = createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); 25369 } 25370 if (!encryptionKey && !password) { 25371 throw new PasswordException('No password given', PasswordResponses.NEED_PASSWORD); 25372 } else if (!encryptionKey && password) { 25373 var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); 25374 encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 25375 } 25376 if (!encryptionKey) { 25377 throw new PasswordException('Incorrect Password', PasswordResponses.INCORRECT_PASSWORD); 25378 } 25379 this.encryptionKey = encryptionKey; 25380 if (algorithm >= 4) { 25381 var cf = dict.get('CF'); 25382 if (isDict(cf)) { 25383 cf.suppressEncryption = true; 25384 } 25385 this.cf = cf; 25386 this.stmf = dict.get('StmF') || identityName; 25387 this.strf = dict.get('StrF') || identityName; 25388 this.eff = dict.get('EFF') || this.stmf; 25389 } 25390 } 25391 function buildObjectKey(num, gen, encryptionKey, isAes) { 25392 var key = new Uint8Array(encryptionKey.length + 9), i, n; 25393 for (i = 0, n = encryptionKey.length; i < n; ++i) { 25394 key[i] = encryptionKey[i]; 25395 } 25396 key[i++] = num & 0xFF; 25397 key[i++] = num >> 8 & 0xFF; 25398 key[i++] = num >> 16 & 0xFF; 25399 key[i++] = gen & 0xFF; 25400 key[i++] = gen >> 8 & 0xFF; 25401 if (isAes) { 25402 key[i++] = 0x73; 25403 key[i++] = 0x41; 25404 key[i++] = 0x6C; 25405 key[i++] = 0x54; 25406 } 25407 var hash = calculateMD5(key, 0, i); 25408 return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); 25409 } 25410 function buildCipherConstructor(cf, name, num, gen, key) { 25411 assert(isName(name), 'Invalid crypt filter name.'); 25412 var cryptFilter = cf.get(name.name); 25413 var cfm;
25414 if (cryptFilter !== null && cryptFilter !== undefined) { 25415 cfm = cryptFilter.get('CFM'); 25416 } 25417 if (!cfm || cfm.name === 'None') { 25418 return function cipherTransformFactoryBuildCipherConstructorNone() { 25419 return new NullCipher(); 25420 }; 25421 } 25422 if (cfm.name === 'V2') { 25423 return function cipherTransformFactoryBuildCipherConstructorV2() { 25424 return new ARCFourCipher(buildObjectKey(num, gen, key, false)); 25425 }; 25426 } 25427 if (cfm.name === 'AESV2') { 25428 return function cipherTransformFactoryBuildCipherConstructorAESV2() { 25429 return new AES128Cipher(buildObjectKey(num, gen, key, true)); 25430 }; 25431 } 25432 if (cfm.name === 'AESV3') { 25433 return function cipherTransformFactoryBuildCipherConstructorAESV3() { 25434 return new AES256Cipher(key); 25435 }; 25436 } 25437 error('Unknown crypto method'); 25438 } 25439 CipherTransformFactory.prototype = { 25440 createCipherTransform: function CipherTransformFactory_createCipherTransform(num, gen) { 25441 if (this.algorithm === 4 || this.algorithm === 5) { 25442 return new CipherTransform(buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey), buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey)); 25443 } 25444 var key = buildObjectKey(num, gen, this.encryptionKey, false); 25445 var cipherConstructor = function buildCipherCipherConstructor() { 25446 return new ARCFourCipher(key); 25447 }; 25448 return new CipherTransform(cipherConstructor, cipherConstructor); 25449 } 25450 }; 25451 return CipherTransformFactory; 25452}(); 25453exports.AES128Cipher = AES128Cipher; 25454exports.AES256Cipher = AES256Cipher; 25455exports.ARCFourCipher = ARCFourCipher; 25456exports.CipherTransformFactory = CipherTransformFactory; 25457exports.PDF17 = PDF17; 25458exports.PDF20 = PDF20; 25459exports.calculateMD5 = calculateMD5; 25460exports.calculateSHA256 = calculateSHA256; 25461exports.calculateSHA384 = calculateSHA384; 25462exports.calculateSHA512 = calculateSHA512; 25463 25464/***/ }), 25465/* 14 */ 25466/***/ (function(module, exports, __w_pdfjs_require__) { 25467 25468"use strict"; 25469 25470var sharedUtil = __w_pdfjs_require__(0); 25471var corePrimitives = __w_pdfjs_require__(1); 25472var coreStream = __w_pdfjs_require__(2); 25473var coreParser = __w_pdfjs_require__(5); 25474var coreImage = __w_pdfjs_require__(27); 25475var coreColorSpace = __w_pdfjs_require__(3); 25476var coreMurmurHash3 = __w_pdfjs_require__(31); 25477var coreFonts = __w_pdfjs_require__(26); 25478var coreFunction = __w_pdfjs_require__(6); 25479var corePattern = __w_pdfjs_require__(32); 25480var coreCMap = __w_pdfjs_require__(23); 25481var coreMetrics = __w_pdfjs_require__(30); 25482var coreBidi = __w_pdfjs_require__(21); 25483var coreEncodings = __w_pdfjs_require__(4); 25484var coreStandardFonts = __w_pdfjs_require__(17); 25485var coreUnicode = __w_pdfjs_require__(18); 25486var coreGlyphList = __w_pdfjs_require__(7); 25487var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; 25488var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX; 25489var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; 25490var ImageKind = sharedUtil.ImageKind; 25491var OPS = sharedUtil.OPS; 25492var TextRenderingMode = sharedUtil.TextRenderingMode; 25493var CMapCompressionType = sharedUtil.CMapCompressionType; 25494var Util = sharedUtil.Util; 25495var assert = sharedUtil.assert; 25496var createPromiseCapability = sharedUtil.createPromiseCapability; 25497var error = sharedUtil.error; 25498var info = sharedUtil.info; 25499var isArray = sharedUtil.isArray; 25500var isNum = sharedUtil.isNum; 25501var isString = sharedUtil.isString; 25502var getLookupTableFactory = sharedUtil.getLookupTableFactory; 25503var warn = sharedUtil.warn; 25504var Dict = corePrimitives.Dict; 25505var Name = corePrimitives.Name; 25506var isEOF = corePrimitives.isEOF; 25507var isCmd = corePrimitives.isCmd; 25508var isDict = corePrimitives.isDict; 25509var isName = corePrimitives.isName; 25510var isRef = corePrimitives.isRef; 25511var isStream = corePrimitives.isStream; 25512var DecodeStream = coreStream.DecodeStream; 25513var JpegStream = coreStream.JpegStream; 25514var Stream = coreStream.Stream; 25515var Lexer = coreParser.Lexer; 25516var Parser = coreParser.Parser; 25517var PDFImage = coreImage.PDFImage; 25518var ColorSpace = coreColorSpace.ColorSpace; 25519var MurmurHash3_64 = coreMurmurHash3.MurmurHash3_64; 25520var ErrorFont = coreFonts.ErrorFont; 25521var FontFlags = coreFonts.FontFlags; 25522var Font = coreFonts.Font; 25523var IdentityToUnicodeMap = coreFonts.IdentityToUnicodeMap; 25524var ToUnicodeMap = coreFonts.ToUnicodeMap; 25525var getFontType = coreFonts.getFontType; 25526var isPDFFunction = coreFunction.isPDFFunction; 25527var PDFFunction = coreFunction.PDFFunction; 25528var Pattern = corePattern.Pattern; 25529var getTilingPatternIR = corePattern.getTilingPatternIR; 25530var CMapFactory = coreCMap.CMapFactory; 25531var IdentityCMap = coreCMap.IdentityCMap; 25532var getMetrics = coreMetrics.getMetrics; 25533var bidi = coreBidi.bidi; 25534var WinAnsiEncoding = coreEncodings.WinAnsiEncoding; 25535var StandardEncoding = coreEncodings.StandardEncoding; 25536var MacRomanEncoding = coreEncodings.MacRomanEncoding; 25537var SymbolSetEncoding = coreEncodings.SymbolSetEncoding; 25538var ZapfDingbatsEncoding = coreEncodings.ZapfDingbatsEncoding; 25539var getEncoding = coreEncodings.getEncoding; 25540var getStdFontMap = coreStandardFonts.getStdFontMap; 25541var getSerifFonts = coreStandardFonts.getSerifFonts; 25542var getSymbolsFonts = coreStandardFonts.getSymbolsFonts; 25543var getNormalizedUnicodes = coreUnicode.getNormalizedUnicodes; 25544var reverseIfRtl = coreUnicode.reverseIfRtl; 25545var getUnicodeForGlyph = coreUnicode.getUnicodeForGlyph; 25546var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode; 25547var PartialEvaluator = function PartialEvaluatorClosure() { 25548 var DefaultPartialEvaluatorOptions = { 25549 forceDataSchema: false, 25550 maxImageSize: -1, 25551 disableFontFace: false, 25552 disableNativeImageDecoder: false 25553 }; 25554 function NativeImageDecoder(xref, resources, handler, forceDataSchema) { 25555 this.xref = xref; 25556 this.resources = resources; 25557 this.handler = handler; 25558 this.forceDataSchema = forceDataSchema; 25559 } 25560 NativeImageDecoder.prototype = { 25561 canDecode: function (image) { 25562 return image instanceof JpegStream && NativeImageDecoder.isDecodable(image, this.xref, this.resources); 25563 }, 25564 decode: function (image) { 25565 var dict = image.dict; 25566 var colorSpace = dict.get('ColorSpace', 'CS'); 25567 colorSpace = ColorSpace.parse(colorSpace, this.xref, this.resources); 25568 var numComps = colorSpace.numComps;
25569 var decodePromise = this.handler.sendWithPromise('JpegDecode', [ 25570 image.getIR(this.forceDataSchema), 25571 numComps 25572 ]); 25573 return decodePromise.then(function (message) { 25574 var data = message.data; 25575 return new Stream(data, 0, data.length, image.dict); 25576 }); 25577 } 25578 }; 25579 NativeImageDecoder.isSupported = function NativeImageDecoder_isSupported(image, xref, res) { 25580 var dict = image.dict; 25581 if (dict.has('DecodeParms') || dict.has('DP')) { 25582 return false; 25583 } 25584 var cs = ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res); 25585 return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && cs.isDefaultDecode(dict.getArray('Decode', 'D')); 25586 }; 25587 NativeImageDecoder.isDecodable = function NativeImageDecoder_isDecodable(image, xref, res) { 25588 var dict = image.dict; 25589 if (dict.has('DecodeParms') || dict.has('DP')) { 25590 return false; 25591 } 25592 var cs = ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res); 25593 return (cs.numComps === 1 || cs.numComps === 3) && cs.isDefaultDecode(dict.getArray('Decode', 'D')); 25594 }; 25595 function PartialEvaluator(pdfManager, xref, handler, pageIndex, idFactory, fontCache, builtInCMapCache, options) { 25596 this.pdfManager = pdfManager; 25597 this.xref = xref; 25598 this.handler = handler; 25599 this.pageIndex = pageIndex; 25600 this.idFactory = idFactory; 25601 this.fontCache = fontCache; 25602 this.builtInCMapCache = builtInCMapCache; 25603 this.options = options || DefaultPartialEvaluatorOptions; 25604 this.fetchBuiltInCMap = function (name) { 25605 var cachedCMap = builtInCMapCache[name]; 25606 if (cachedCMap) { 25607 return Promise.resolve(cachedCMap); 25608 } 25609 return handler.sendWithPromise('FetchBuiltInCMap', { name: name }).then(function (data) { 25610 if (data.compressionType !== CMapCompressionType.NONE) { 25611 builtInCMapCache[name] = data; 25612 } 25613 return data; 25614 }); 25615 }; 25616 } 25617 var TIME_SLOT_DURATION_MS = 20; 25618 var CHECK_TIME_EVERY = 100; 25619 function TimeSlotManager() { 25620 this.reset(); 25621 } 25622 TimeSlotManager.prototype = { 25623 check: function TimeSlotManager_check() { 25624 if (++this.checked < CHECK_TIME_EVERY) { 25625 return false; 25626 } 25627 this.checked = 0; 25628 return this.endTime <= Date.now(); 25629 }, 25630 reset: function TimeSlotManager_reset() { 25631 this.endTime = Date.now() + TIME_SLOT_DURATION_MS; 25632 this.checked = 0; 25633 } 25634 }; 25635 var deferred = Promise.resolve(); 25636 var TILING_PATTERN = 1, SHADING_PATTERN = 2; 25637 PartialEvaluator.prototype = { 25638 hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { 25639 if (!isDict(resources)) { 25640 return false; 25641 } 25642 var processed = Object.create(null); 25643 if (resources.objId) { 25644 processed[resources.objId] = true; 25645 } 25646 var nodes = [resources], xref = this.xref; 25647 while (nodes.length) { 25648 var key, i, ii; 25649 var node = nodes.shift(); 25650 var graphicStates = node.get('ExtGState'); 25651 if (isDict(graphicStates)) { 25652 var graphicStatesKeys = graphicStates.getKeys(); 25653 for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { 25654 key = graphicStatesKeys[i]; 25655 var graphicState = graphicStates.get(key); 25656 var bm = graphicState.get('BM'); 25657 if (isName(bm) && bm.name !== 'Normal') { 25658 return true; 25659 } 25660 } 25661 } 25662 var xObjects = node.get('XObject'); 25663 if (!isDict(xObjects)) { 25664 continue; 25665 } 25666 var xObjectsKeys = xObjects.getKeys(); 25667 for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { 25668 key = xObjectsKeys[i]; 25669 var xObject = xObjects.getRaw(key); 25670 if (isRef(xObject)) { 25671 if (processed[xObject.toString()]) { 25672 continue; 25673 } 25674 xObject = xref.fetch(xObject); 25675 } 25676 if (!isStream(xObject)) { 25677 continue; 25678 } 25679 if (xObject.dict.objId) { 25680 if (processed[xObject.dict.objId]) { 25681 continue; 25682 } 25683 processed[xObject.dict.objId] = true; 25684 } 25685 var xResources = xObject.dict.get('Resources'); 25686 if (isDict(xResources) && (!xResources.objId || !processed[xResources.objId])) { 25687 nodes.push(xResources); 25688 if (xResources.objId) { 25689 processed[xResources.objId] = true; 25690 } 25691 } 25692 } 25693 } 25694 return false; 25695 }, 25696 buildFormXObject: function PartialEvaluator_buildFormXObject(resources, xobj, smask, operatorList, task, initialState) { 25697 var matrix = xobj.dict.getArray('Matrix'); 25698 var bbox = xobj.dict.getArray('BBox'); 25699 var group = xobj.dict.get('Group'); 25700 if (group) { 25701 var groupOptions = { 25702 matrix: matrix, 25703 bbox: bbox, 25704 smask: smask, 25705 isolated: false, 25706 knockout: false 25707 }; 25708 var groupSubtype = group.get('S'); 25709 var colorSpace; 25710 if (isName(groupSubtype, 'Transparency')) { 25711 groupOptions.isolated = group.get('I') || false; 25712 groupOptions.knockout = group.get('K') || false; 25713 colorSpace = group.has('CS') ? ColorSpace.parse(group.get('CS'), this.xref, resources) : null; 25714 } 25715 if (smask && smask.backdrop) { 25716 colorSpace = colorSpace || ColorSpace.singletons.rgb; 25717 smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); 25718 } 25719 operatorList.addOp(OPS.beginGroup, [groupOptions]); 25720 } 25721 operatorList.addOp(OPS.paintFormXObjectBegin, [ 25722 matrix, 25723 bbox 25724 ]); 25725 return this.getOperatorList(xobj, task, xobj.dict.get('Resources') || resources, operatorList, initialState).then(function () { 25726 operatorList.addOp(OPS.paintFormXObjectEnd, []); 25727 if (group) { 25728 operatorList.addOp(OPS.endGroup, [groupOptions]); 25729 } 25730 }); 25731 }, 25732 buildPaintImageXObject: function PartialEvaluator_buildPaintImageXObject(resources, image, inline, operatorList, cacheKey, imageCache) { 25733 var self = this; 25734 var dict = image.dict; 25735 var w = dict.get('Width', 'W'); 25736 var h = dict.get('Height', 'H'); 25737 if (!(w && isNum(w)) || !(h && isNum(h))) { 25738 warn('Image dimensions are missing, or not numbers.'); 25739 return; 25740 } 25741 var maxImageSize = this.options.maxImageSize; 25742 if (maxImageSize !== -1 && w * h > maxImageSize) { 25743 warn('Image exceeded maximum allowed size and was removed.'); 25744 return; 25745 } 25746 var imageMask = dict.get('ImageMask', 'IM') || false; 25747 var imgData, args; 25748 if (imageMask) { 25749 var width = dict.get('Width', 'W'); 25750 var height = dict.get('Height', 'H'); 25751 var bitStrideLength = width + 7 >> 3; 25752 var imgArray = image.getBytes(bitStrideLength * height); 25753 var decode = dict.getArray('Decode', 'D'); 25754 var inverseDecode = !!decode && decode[0] > 0; 25755 imgData = PDFImage.createMask(imgArray, width, height, image instanceof DecodeStream, inverseDecode); 25756 imgData.cached = true; 25757 args = [imgData]; 25758 operatorList.addOp(OPS.paintImageMaskXObject, args); 25759 if (cacheKey) { 25760 imageCache[cacheKey] = { 25761 fn: OPS.paintImageMaskXObject, 25762 args: args 25763 }; 25764 } 25765 return; 25766 }
25767 var softMask = dict.get('SMask', 'SM') || false; 25768 var mask = dict.get('Mask') || false; 25769 var SMALL_IMAGE_DIMENSIONS = 200; 25770 if (inline && !softMask && !mask && !(image instanceof JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) { 25771 var imageObj = new PDFImage(this.xref, resources, image, inline, null, null); 25772 imgData = imageObj.createImageData(true); 25773 operatorList.addOp(OPS.paintInlineImageXObject, [imgData]); 25774 return; 25775 } 25776 var useNativeImageDecoder = !this.options.disableNativeImageDecoder; 25777 var objId = 'img_' + this.idFactory.createObjId(); 25778 operatorList.addDependency(objId); 25779 args = [ 25780 objId, 25781 w, 25782 h 25783 ]; 25784 if (useNativeImageDecoder && !softMask && !mask && image instanceof JpegStream && NativeImageDecoder.isSupported(image, this.xref, resources)) { 25785 operatorList.addOp(OPS.paintJpegXObject, args); 25786 this.handler.send('obj', [ 25787 objId, 25788 this.pageIndex, 25789 'JpegStream', 25790 image.getIR(this.options.forceDataSchema) 25791 ]); 25792 return; 25793 } 25794 var nativeImageDecoder = null; 25795 if (useNativeImageDecoder && (image instanceof JpegStream || mask instanceof JpegStream || softMask instanceof JpegStream)) { 25796 nativeImageDecoder = new NativeImageDecoder(self.xref, resources, self.handler, self.options.forceDataSchema); 25797 } 25798 PDFImage.buildImage(self.handler, self.xref, resources, image, inline, nativeImageDecoder).then(function (imageObj) { 25799 var imgData = imageObj.createImageData(false); 25800 self.handler.send('obj', [ 25801 objId, 25802 self.pageIndex, 25803 'Image', 25804 imgData 25805 ], [imgData.data.buffer]); 25806 }).then(undefined, function (reason) { 25807 warn('Unable to decode image: ' + reason); 25808 self.handler.send('obj', [ 25809 objId, 25810 self.pageIndex, 25811 'Image', 25812 null 25813 ]); 25814 }); 25815 operatorList.addOp(OPS.paintImageXObject, args); 25816 if (cacheKey) { 25817 imageCache[cacheKey] = { 25818 fn: OPS.paintImageXObject, 25819 args: args 25820 }; 25821 } 25822 }, 25823 handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) { 25824 var smaskContent = smask.get('G'); 25825 var smaskOptions = { 25826 subtype: smask.get('S').name, 25827 backdrop: smask.get('BC') 25828 }; 25829 var transferObj = smask.get('TR'); 25830 if (isPDFFunction(transferObj)) { 25831 var transferFn = PDFFunction.parse(this.xref, transferObj); 25832 var transferMap = new Uint8Array(256); 25833 var tmp = new Float32Array(1); 25834 for (var i = 0; i < 256; i++) { 25835 tmp[0] = i / 255; 25836 transferFn(tmp, 0, tmp, 0); 25837 transferMap[i] = tmp[0] * 255 | 0; 25838 } 25839 smaskOptions.transferMap = transferMap; 25840 } 25841 return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone()); 25842 }, 25843 handleTilingType: function PartialEvaluator_handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { 25844 var tilingOpList = new OperatorList(); 25845 var resourcesArray = [ 25846 patternDict.get('Resources'), 25847 resources 25848 ]; 25849 var patternResources = Dict.merge(this.xref, resourcesArray); 25850 return this.getOperatorList(pattern, task, patternResources, tilingOpList).then(function () { 25851 operatorList.addDependencies(tilingOpList.dependencies); 25852 operatorList.addOp(fn, getTilingPatternIR({ 25853 fnArray: tilingOpList.fnArray, 25854 argsArray: tilingOpList.argsArray 25855 }, patternDict, args)); 25856 }); 25857 }, 25858 handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { 25859 var fontName; 25860 if (fontArgs) { 25861 fontArgs = fontArgs.slice(); 25862 fontName = fontArgs[0].name; 25863 } 25864 var self = this; 25865 return this.loadFont(fontName, fontRef, this.xref, resources).then(function (translated) { 25866 if (!translated.font.isType3Font) { 25867 return translated; 25868 } 25869 return translated.loadType3Data(self, resources, operatorList, task).then(function () { 25870 return translated; 25871 }, function (reason) { 25872 self.handler.send('UnsupportedFeature', { featureId: UNSUPPORTED_FEATURES.font }); 25873 return new TranslatedFont('g_font_error', new ErrorFont('Type3 font load error: ' + reason), translated.font); 25874 }); 25875 }).then(function (translated) { 25876 state.font = translated.font; 25877 translated.send(self.handler); 25878 return translated.loadedName; 25879 }); 25880 },
vendor: 4,225 bytes, lines 25881-26044
25881 handleText: function PartialEvaluator_handleText(chars, state) { 25882 var font = state.font; 25883 var glyphs = font.charsToGlyphs(chars); 25884 var isAddToPathSet = !!(state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); 25885 if (font.data && (isAddToPathSet || this.options.disableFontFace)) { 25886 var buildPath = function (fontChar) { 25887 if (!font.renderer.hasBuiltPath(fontChar)) { 25888 var path = font.renderer.getPathJs(fontChar); 25889 this.handler.send('commonobj', [ 25890 font.loadedName + '_path_' + fontChar, 25891 'FontPath', 25892 path 25893 ]); 25894 } 25895 }.bind(this); 25896 for (var i = 0, ii = glyphs.length; i < ii; i++) { 25897 var glyph = glyphs[i]; 25898 buildPath(glyph.fontChar); 25899 var accent = glyph.accent; 25900 if (accent && accent.fontChar) { 25901 buildPath(accent.fontChar); 25902 } 25903 } 25904 } 25905 return glyphs; 25906 }, 25907 setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, xref, stateManager) { 25908 var gStateObj = []; 25909 var gStateKeys = gState.getKeys(); 25910 var self = this; 25911 var promise = Promise.resolve(); 25912 for (var i = 0, ii = gStateKeys.length; i < ii; i++) { 25913 var key = gStateKeys[i]; 25914 var value = gState.get(key); 25915 switch (key) { 25916 case 'Type': 25917 break; 25918 case 'LW': 25919 case 'LC': 25920 case 'LJ': 25921 case 'ML': 25922 case 'D': 25923 case 'RI': 25924 case 'FL': 25925 case 'CA': 25926 case 'ca': 25927 gStateObj.push([ 25928 key, 25929 value 25930 ]); 25931 break; 25932 case 'Font': 25933 promise = promise.then(function () { 25934 return self.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { 25935 operatorList.addDependency(loadedName); 25936 gStateObj.push([ 25937 key, 25938 [ 25939 loadedName, 25940 value[1] 25941 ] 25942 ]); 25943 }); 25944 }); 25945 break; 25946 case 'BM': 25947 gStateObj.push([ 25948 key, 25949 value 25950 ]); 25951 break; 25952 case 'SMask': 25953 if (isName(value, 'None')) { 25954 gStateObj.push([ 25955 key, 25956 false 25957 ]); 25958 break; 25959 } 25960 if (isDict(value)) { 25961 promise = promise.then(function (dict) { 25962 return self.handleSMask(dict, resources, operatorList, task, stateManager); 25963 }.bind(this, value)); 25964 gStateObj.push([ 25965 key, 25966 true 25967 ]); 25968 } else { 25969 warn('Unsupported SMask type'); 25970 } 25971 break; 25972 case 'OP': 25973 case 'op': 25974 case 'OPM': 25975 case 'BG': 25976 case 'BG2': 25977 case 'UCR': 25978 case 'UCR2': 25979 case 'TR': 25980 case 'TR2': 25981 case 'HT': 25982 case 'SM': 25983 case 'SA': 25984 case 'AIS': 25985 case 'TK': 25986 info('graphic state operator ' + key); 25987 break; 25988 default: 25989 info('Unknown graphic state operator ' + key); 25990 break; 25991 } 25992 } 25993 return promise.then(function () { 25994 if (gStateObj.length > 0) { 25995 operatorList.addOp(OPS.setGState, [gStateObj]); 25996 } 25997 }); 25998 }, 25999 loadFont: function PartialEvaluator_loadFont(fontName, font, xref, resources) { 26000 function errorFont() { 26001 return Promise.resolve(new TranslatedFont('g_font_error', new ErrorFont('Font ' + fontName + ' is not available'), font)); 26002 } 26003 var fontRef; 26004 if (font) { 26005 assert(isRef(font)); 26006 fontRef = font; 26007 } else { 26008 var fontRes = resources.get('Font'); 26009 if (fontRes) { 26010 fontRef = fontRes.getRaw(fontName); 26011 } else { 26012 warn('fontRes not available'); 26013 return errorFont(); 26014 } 26015 } 26016 if (!fontRef) { 26017 warn('fontRef not available'); 26018 return errorFont(); 26019 } 26020 if (this.fontCache.has(fontRef)) { 26021 return this.fontCache.get(fontRef); 26022 } 26023 font = xref.fetchIfRef(fontRef); 26024 if (!isDict(font)) { 26025 return errorFont(); 26026 } 26027 if (font.translated) { 26028 return font.translated; 26029 } 26030 var fontCapability = createPromiseCapability(); 26031 var preEvaluatedFont = this.preEvaluateFont(font, xref); 26032 var descriptor = preEvaluatedFont.descriptor; 26033 var fontRefIsRef = isRef(fontRef), fontID; 26034 if (fontRefIsRef) { 26035 fontID = fontRef.toString(); 26036 } 26037 if (isDict(descriptor)) { 26038 if (!descriptor.fontAliases) { 26039 descriptor.fontAliases = Object.create(null); 26040 } 26041 var fontAliases = descriptor.fontAliases; 26042 var hash = preEvaluatedFont.hash; 26043 if (fontAliases[hash]) { 26044 var aliasFontRef = fontAliases[hash].aliasRef;
26045 if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { 26046 this.fontCache.putAlias(fontRef, aliasFontRef); 26047 return this.fontCache.get(fontRef); 26048 } 26049 } else { 26050 fontAliases[hash] = { fontID: Font.getFontID() }; 26051 } 26052 if (fontRefIsRef) { 26053 fontAliases[hash].aliasRef = fontRef; 26054 } 26055 fontID = fontAliases[hash].fontID; 26056 } 26057 if (fontRefIsRef) { 26058 this.fontCache.put(fontRef, fontCapability.promise); 26059 } else { 26060 if (!fontID) { 26061 fontID = this.idFactory.createObjId(); 26062 } 26063 this.fontCache.put('id_' + fontID, fontCapability.promise); 26064 } 26065 assert(fontID, 'The "fontID" must be defined.'); 26066 font.loadedName = 'g_' + this.pdfManager.docId + '_f' + fontID; 26067 font.translated = fontCapability.promise; 26068 var translatedPromise; 26069 try { 26070 translatedPromise = this.translateFont(preEvaluatedFont, xref); 26071 } catch (e) { 26072 translatedPromise = Promise.reject(e); 26073 } 26074 var self = this; 26075 translatedPromise.then(function (translatedFont) { 26076 if (translatedFont.fontType !== undefined) { 26077 var xrefFontStats = xref.stats.fontTypes; 26078 xrefFontStats[translatedFont.fontType] = true; 26079 } 26080 fontCapability.resolve(new TranslatedFont(font.loadedName, translatedFont, font)); 26081 }, function (reason) { 26082 self.handler.send('UnsupportedFeature', { featureId: UNSUPPORTED_FEATURES.font }); 26083 try { 26084 var descriptor = preEvaluatedFont.descriptor; 26085 var fontFile3 = descriptor && descriptor.get('FontFile3'); 26086 var subtype = fontFile3 && fontFile3.get('Subtype'); 26087 var fontType = getFontType(preEvaluatedFont.type, subtype && subtype.name); 26088 var xrefFontStats = xref.stats.fontTypes; 26089 xrefFontStats[fontType] = true; 26090 } catch (ex) { 26091 } 26092 fontCapability.resolve(new TranslatedFont(font.loadedName, new ErrorFont(reason instanceof Error ? reason.message : reason), font)); 26093 }); 26094 return fontCapability.promise; 26095 }, 26096 buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { 26097 var lastIndex = operatorList.length - 1; 26098 if (!args) { 26099 args = []; 26100 } 26101 if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== OPS.constructPath) { 26102 operatorList.addOp(OPS.constructPath, [ 26103 [fn], 26104 args 26105 ]); 26106 } else { 26107 var opArgs = operatorList.argsArray[lastIndex]; 26108 opArgs[0].push(fn); 26109 Array.prototype.push.apply(opArgs[1], args); 26110 } 26111 }, 26112 handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task, xref) { 26113 var patternName = args[args.length - 1]; 26114 var pattern; 26115 if (isName(patternName) && (pattern = patterns.get(patternName.name))) { 26116 var dict = isStream(pattern) ? pattern.dict : pattern; 26117 var typeNum = dict.get('PatternType'); 26118 if (typeNum === TILING_PATTERN) { 26119 var color = cs.base ? cs.base.getRgb(args, 0) : null; 26120 return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); 26121 } else if (typeNum === SHADING_PATTERN) { 26122 var shading = dict.get('Shading'); 26123 var matrix = dict.getArray('Matrix'); 26124 pattern = Pattern.parseShading(shading, matrix, xref, resources, this.handler); 26125 operatorList.addOp(fn, pattern.getIR()); 26126 return Promise.resolve(); 26127 } 26128 return Promise.reject('Unknown PatternType: ' + typeNum); 26129 } 26130 operatorList.addOp(fn, args); 26131 return Promise.resolve(); 26132 }, 26133 getOperatorList: function PartialEvaluator_getOperatorList(stream, task, resources, operatorList, initialState) { 26134 var self = this; 26135 var xref = this.xref; 26136 var imageCache = Object.create(null); 26137 assert(operatorList); 26138 resources = resources || Dict.empty; 26139 var xobjs = resources.get('XObject') || Dict.empty; 26140 var patterns = resources.get('Pattern') || Dict.empty; 26141 var stateManager = new StateManager(initialState || new EvalState()); 26142 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 26143 var timeSlotManager = new TimeSlotManager(); 26144 return new Promise(function promiseBody(resolve, reject) { 26145 var next = function (promise) { 26146 promise.then(function () { 26147 try { 26148 promiseBody(resolve, reject); 26149 } catch (ex) { 26150 reject(ex); 26151 } 26152 }, reject); 26153 }; 26154 task.ensureNotTerminated(); 26155 timeSlotManager.reset(); 26156 var stop, operation = {}, i, ii, cs; 26157 while (!(stop = timeSlotManager.check())) { 26158 operation.args = null; 26159 if (!preprocessor.read(operation)) { 26160 break; 26161 } 26162 var args = operation.args; 26163 var fn = operation.fn; 26164 switch (fn | 0) {
vendor: 6,573 bytes, lines 26165-26351
26165 case OPS.paintXObject: 26166 if (args[0].code) { 26167 break; 26168 } 26169 var name = args[0].name; 26170 if (!name) { 26171 warn('XObject must be referred to by name.'); 26172 continue; 26173 } 26174 if (imageCache[name] !== undefined) { 26175 operatorList.addOp(imageCache[name].fn, imageCache[name].args); 26176 args = null; 26177 continue; 26178 } 26179 var xobj = xobjs.get(name); 26180 if (xobj) { 26181 assert(isStream(xobj), 'XObject should be a stream'); 26182 var type = xobj.dict.get('Subtype'); 26183 assert(isName(type), 'XObject should have a Name subtype'); 26184 if (type.name === 'Form') { 26185 stateManager.save(); 26186 next(self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone()).then(function () { 26187 stateManager.restore(); 26188 })); 26189 return; 26190 } else if (type.name === 'Image') { 26191 self.buildPaintImageXObject(resources, xobj, false, operatorList, name, imageCache); 26192 args = null; 26193 continue; 26194 } else if (type.name === 'PS') { 26195 info('Ignored XObject subtype PS'); 26196 continue; 26197 } else { 26198 error('Unhandled XObject subtype ' + type.name); 26199 } 26200 } 26201 break; 26202 case OPS.setFont: 26203 var fontSize = args[1]; 26204 next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { 26205 operatorList.addDependency(loadedName); 26206 operatorList.addOp(OPS.setFont, [ 26207 loadedName, 26208 fontSize 26209 ]); 26210 })); 26211 return; 26212 case OPS.endInlineImage: 26213 var cacheKey = args[0].cacheKey; 26214 if (cacheKey) { 26215 var cacheEntry = imageCache[cacheKey]; 26216 if (cacheEntry !== undefined) { 26217 operatorList.addOp(cacheEntry.fn, cacheEntry.args); 26218 args = null; 26219 continue; 26220 } 26221 } 26222 self.buildPaintImageXObject(resources, args[0], true, operatorList, cacheKey, imageCache); 26223 args = null; 26224 continue; 26225 case OPS.showText: 26226 args[0] = self.handleText(args[0], stateManager.state); 26227 break; 26228 case OPS.showSpacedText: 26229 var arr = args[0]; 26230 var combinedGlyphs = []; 26231 var arrLength = arr.length; 26232 var state = stateManager.state; 26233 for (i = 0; i < arrLength; ++i) { 26234 var arrItem = arr[i]; 26235 if (isString(arrItem)) { 26236 Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); 26237 } else if (isNum(arrItem)) { 26238 combinedGlyphs.push(arrItem); 26239 } 26240 } 26241 args[0] = combinedGlyphs; 26242 fn = OPS.showText; 26243 break; 26244 case OPS.nextLineShowText: 26245 operatorList.addOp(OPS.nextLine); 26246 args[0] = self.handleText(args[0], stateManager.state); 26247 fn = OPS.showText; 26248 break; 26249 case OPS.nextLineSetSpacingShowText: 26250 operatorList.addOp(OPS.nextLine); 26251 operatorList.addOp(OPS.setWordSpacing, [args.shift()]); 26252 operatorList.addOp(OPS.setCharSpacing, [args.shift()]); 26253 args[0] = self.handleText(args[0], stateManager.state); 26254 fn = OPS.showText; 26255 break; 26256 case OPS.setTextRenderingMode: 26257 stateManager.state.textRenderingMode = args[0]; 26258 break; 26259 case OPS.setFillColorSpace: 26260 stateManager.state.fillColorSpace = ColorSpace.parse(args[0], xref, resources); 26261 continue; 26262 case OPS.setStrokeColorSpace: 26263 stateManager.state.strokeColorSpace = ColorSpace.parse(args[0], xref, resources); 26264 continue; 26265 case OPS.setFillColor: 26266 cs = stateManager.state.fillColorSpace; 26267 args = cs.getRgb(args, 0); 26268 fn = OPS.setFillRGBColor; 26269 break; 26270 case OPS.setStrokeColor: 26271 cs = stateManager.state.strokeColorSpace; 26272 args = cs.getRgb(args, 0); 26273 fn = OPS.setStrokeRGBColor; 26274 break; 26275 case OPS.setFillGray: 26276 stateManager.state.fillColorSpace = ColorSpace.singletons.gray; 26277 args = ColorSpace.singletons.gray.getRgb(args, 0); 26278 fn = OPS.setFillRGBColor; 26279 break; 26280 case OPS.setStrokeGray: 26281 stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; 26282 args = ColorSpace.singletons.gray.getRgb(args, 0); 26283 fn = OPS.setStrokeRGBColor; 26284 break; 26285 case OPS.setFillCMYKColor: 26286 stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; 26287 args = ColorSpace.singletons.cmyk.getRgb(args, 0); 26288 fn = OPS.setFillRGBColor; 26289 break; 26290 case OPS.setStrokeCMYKColor: 26291 stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; 26292 args = ColorSpace.singletons.cmyk.getRgb(args, 0); 26293 fn = OPS.setStrokeRGBColor; 26294 break; 26295 case OPS.setFillRGBColor: 26296 stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; 26297 args = ColorSpace.singletons.rgb.getRgb(args, 0); 26298 break; 26299 case OPS.setStrokeRGBColor: 26300 stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; 26301 args = ColorSpace.singletons.rgb.getRgb(args, 0); 26302 break; 26303 case OPS.setFillColorN: 26304 cs = stateManager.state.fillColorSpace; 26305 if (cs.name === 'Pattern') { 26306 next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, xref)); 26307 return; 26308 } 26309 args = cs.getRgb(args, 0); 26310 fn = OPS.setFillRGBColor; 26311 break; 26312 case OPS.setStrokeColorN: 26313 cs = stateManager.state.strokeColorSpace; 26314 if (cs.name === 'Pattern') { 26315 next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, xref)); 26316 return; 26317 } 26318 args = cs.getRgb(args, 0); 26319 fn = OPS.setStrokeRGBColor; 26320 break; 26321 case OPS.shadingFill: 26322 var shadingRes = resources.get('Shading'); 26323 if (!shadingRes) { 26324 error('No shading resource found'); 26325 } 26326 var shading = shadingRes.get(args[0].name); 26327 if (!shading) { 26328 error('No shading object found'); 26329 } 26330 var shadingFill = Pattern.parseShading(shading, null, xref, resources, self.handler); 26331 var patternIR = shadingFill.getIR(); 26332 args = [patternIR]; 26333 fn = OPS.shadingFill; 26334 break; 26335 case OPS.setGState: 26336 var dictName = args[0]; 26337 var extGState = resources.get('ExtGState'); 26338 if (!isDict(extGState) || !extGState.has(dictName.name)) { 26339 break; 26340 } 26341 var gState = extGState.get(dictName.name); 26342 next(self.setGState(resources, gState, operatorList, task, xref, stateManager)); 26343 return; 26344 case OPS.moveTo: 26345 case OPS.lineTo: 26346 case OPS.curveTo: 26347 case OPS.curveTo2: 26348 case OPS.curveTo3: 26349 case OPS.closePath: 26350 self.buildPath(operatorList, fn, args); 26351 continue;
26352 case OPS.rectangle: 26353 self.buildPath(operatorList, fn, args); 26354 continue; 26355 case OPS.markPoint: 26356 case OPS.markPointProps: 26357 case OPS.beginMarkedContent: 26358 case OPS.beginMarkedContentProps: 26359 case OPS.endMarkedContent: 26360 case OPS.beginCompat: 26361 case OPS.endCompat: 26362 continue; 26363 default: 26364 if (args !== null) { 26365 for (i = 0, ii = args.length; i < ii; i++) { 26366 if (args[i] instanceof Dict) { 26367 break; 26368 } 26369 } 26370 if (i < ii) { 26371 warn('getOperatorList - ignoring operator: ' + fn); 26372 continue; 26373 } 26374 } 26375 } 26376 operatorList.addOp(fn, args); 26377 } 26378 if (stop) { 26379 next(deferred); 26380 return; 26381 } 26382 for (i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { 26383 operatorList.addOp(OPS.restore, []); 26384 } 26385 resolve(); 26386 }); 26387 }, 26388 getTextContent: function PartialEvaluator_getTextContent(stream, task, resources, stateManager, normalizeWhitespace, combineTextItems) { 26389 stateManager = stateManager || new StateManager(new TextState()); 26390 var WhitespaceRegexp = /\s/g; 26391 var textContent = { 26392 items: [], 26393 styles: Object.create(null) 26394 }; 26395 var textContentItem = { 26396 initialized: false, 26397 str: [], 26398 width: 0, 26399 height: 0, 26400 vertical: false, 26401 lastAdvanceWidth: 0, 26402 lastAdvanceHeight: 0, 26403 textAdvanceScale: 0, 26404 spaceWidth: 0, 26405 fakeSpaceMin: Infinity, 26406 fakeMultiSpaceMin: Infinity, 26407 fakeMultiSpaceMax: -0, 26408 textRunBreakAllowed: false, 26409 transform: null, 26410 fontName: null 26411 }; 26412 var SPACE_FACTOR = 0.3; 26413 var MULTI_SPACE_FACTOR = 1.5; 26414 var MULTI_SPACE_FACTOR_MAX = 4; 26415 var self = this; 26416 var xref = this.xref; 26417 resources = xref.fetchIfRef(resources) || Dict.empty; 26418 var xobjs = null; 26419 var xobjsCache = Object.create(null); 26420 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 26421 var textState; 26422 function ensureTextContentItem() { 26423 if (textContentItem.initialized) { 26424 return textContentItem; 26425 } 26426 var font = textState.font; 26427 if (!(font.loadedName in textContent.styles)) { 26428 textContent.styles[font.loadedName] = { 26429 fontFamily: font.fallbackName, 26430 ascent: font.ascent, 26431 descent: font.descent, 26432 vertical: font.vertical 26433 }; 26434 } 26435 textContentItem.fontName = font.loadedName; 26436 var tsm = [ 26437 textState.fontSize * textState.textHScale, 26438 0, 26439 0, 26440 textState.fontSize, 26441 0, 26442 textState.textRise 26443 ]; 26444 if (font.isType3Font && textState.fontMatrix !== FONT_IDENTITY_MATRIX && textState.fontSize === 1) { 26445 var glyphHeight = font.bbox[3] - font.bbox[1]; 26446 if (glyphHeight > 0) { 26447 glyphHeight = glyphHeight * textState.fontMatrix[3]; 26448 tsm[3] *= glyphHeight; 26449 } 26450 } 26451 var trm = Util.transform(textState.ctm, Util.transform(textState.textMatrix, tsm)); 26452 textContentItem.transform = trm; 26453 if (!font.vertical) { 26454 textContentItem.width = 0; 26455 textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); 26456 textContentItem.vertical = false;
26457 } else { 26458 textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); 26459 textContentItem.height = 0; 26460 textContentItem.vertical = true; 26461 } 26462 var a = textState.textLineMatrix[0]; 26463 var b = textState.textLineMatrix[1]; 26464 var scaleLineX = Math.sqrt(a * a + b * b); 26465 a = textState.ctm[0]; 26466 b = textState.ctm[1]; 26467 var scaleCtmX = Math.sqrt(a * a + b * b); 26468 textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; 26469 textContentItem.lastAdvanceWidth = 0; 26470 textContentItem.lastAdvanceHeight = 0; 26471 var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; 26472 if (spaceWidth) { 26473 textContentItem.spaceWidth = spaceWidth; 26474 textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; 26475 textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; 26476 textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; 26477 textContentItem.textRunBreakAllowed = !font.isMonospace; 26478 } else { 26479 textContentItem.spaceWidth = 0; 26480 textContentItem.fakeSpaceMin = Infinity; 26481 textContentItem.fakeMultiSpaceMin = Infinity; 26482 textContentItem.fakeMultiSpaceMax = 0; 26483 textContentItem.textRunBreakAllowed = false; 26484 } 26485 textContentItem.initialized = true; 26486 return textContentItem; 26487 } 26488 function replaceWhitespace(str) { 26489 var i = 0, ii = str.length, code; 26490 while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { 26491 i++; 26492 } 26493 return i < ii ? str.replace(WhitespaceRegexp, ' ') : str; 26494 } 26495 function runBidiTransform(textChunk) { 26496 var str = textChunk.str.join(''); 26497 var bidiResult = bidi(str, -1, textChunk.vertical); 26498 return { 26499 str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, 26500 dir: bidiResult.dir, 26501 width: textChunk.width, 26502 height: textChunk.height, 26503 transform: textChunk.transform, 26504 fontName: textChunk.fontName 26505 }; 26506 } 26507 function handleSetFont(fontName, fontRef) { 26508 return self.loadFont(fontName, fontRef, xref, resources).then(function (translated) { 26509 textState.font = translated.font; 26510 textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX; 26511 }); 26512 } 26513 function buildTextContentItem(chars) { 26514 var font = textState.font; 26515 var textChunk = ensureTextContentItem(); 26516 var width = 0; 26517 var height = 0; 26518 var glyphs = font.charsToGlyphs(chars); 26519 for (var i = 0; i < glyphs.length; i++) { 26520 var glyph = glyphs[i]; 26521 var glyphWidth = null; 26522 if (font.vertical && glyph.vmetric) { 26523 glyphWidth = glyph.vmetric[0]; 26524 } else { 26525 glyphWidth = glyph.width; 26526 } 26527 var glyphUnicode = glyph.unicode; 26528 var NormalizedUnicodes = getNormalizedUnicodes(); 26529 if (NormalizedUnicodes[glyphUnicode] !== undefined) { 26530 glyphUnicode = NormalizedUnicodes[glyphUnicode]; 26531 } 26532 glyphUnicode = reverseIfRtl(glyphUnicode); 26533 var charSpacing = textState.charSpacing; 26534 if (glyph.isSpace) { 26535 var wordSpacing = textState.wordSpacing; 26536 charSpacing += wordSpacing; 26537 if (wordSpacing > 0) { 26538 addFakeSpaces(wordSpacing, textChunk.str); 26539 } 26540 } 26541 var tx = 0; 26542 var ty = 0; 26543 if (!font.vertical) { 26544 var w0 = glyphWidth * textState.fontMatrix[0]; 26545 tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; 26546 width += tx; 26547 } else { 26548 var w1 = glyphWidth * textState.fontMatrix[0]; 26549 ty = w1 * textState.fontSize + charSpacing; 26550 height += ty; 26551 } 26552 textState.translateTextMatrix(tx, ty); 26553 textChunk.str.push(glyphUnicode); 26554 } 26555 if (!font.vertical) { 26556 textChunk.lastAdvanceWidth = width; 26557 textChunk.width += width; 26558 } else { 26559 textChunk.lastAdvanceHeight = height; 26560 textChunk.height += Math.abs(height); 26561 } 26562 return textChunk; 26563 } 26564 function addFakeSpaces(width, strBuf) { 26565 if (width < textContentItem.fakeSpaceMin) { 26566 return; 26567 } 26568 if (width < textContentItem.fakeMultiSpaceMin) { 26569 strBuf.push(' '); 26570 return; 26571 } 26572 var fakeSpaces = Math.round(width / textContentItem.spaceWidth); 26573 while (fakeSpaces-- > 0) { 26574 strBuf.push(' '); 26575 } 26576 } 26577 function flushTextContentItem() { 26578 if (!textContentItem.initialized) { 26579 return; 26580 } 26581 textContentItem.width *= textContentItem.textAdvanceScale; 26582 textContentItem.height *= textContentItem.textAdvanceScale; 26583 textContent.items.push(runBidiTransform(textContentItem)); 26584 textContentItem.initialized = false;
vendor: 3,855 bytes, lines 26585-26681
26585 textContentItem.str.length = 0; 26586 } 26587 var timeSlotManager = new TimeSlotManager(); 26588 return new Promise(function promiseBody(resolve, reject) { 26589 var next = function (promise) { 26590 promise.then(function () { 26591 try { 26592 promiseBody(resolve, reject); 26593 } catch (ex) { 26594 reject(ex); 26595 } 26596 }, reject); 26597 }; 26598 task.ensureNotTerminated(); 26599 timeSlotManager.reset(); 26600 var stop, operation = {}, args = []; 26601 while (!(stop = timeSlotManager.check())) { 26602 args.length = 0; 26603 operation.args = args; 26604 if (!preprocessor.read(operation)) { 26605 break; 26606 } 26607 textState = stateManager.state; 26608 var fn = operation.fn; 26609 args = operation.args; 26610 var advance, diff; 26611 switch (fn | 0) { 26612 case OPS.setFont: 26613 var fontNameArg = args[0].name, fontSizeArg = args[1]; 26614 if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { 26615 break; 26616 } 26617 flushTextContentItem(); 26618 textState.fontName = fontNameArg; 26619 textState.fontSize = fontSizeArg; 26620 next(handleSetFont(fontNameArg, null)); 26621 return; 26622 case OPS.setTextRise: 26623 flushTextContentItem(); 26624 textState.textRise = args[0]; 26625 break; 26626 case OPS.setHScale: 26627 flushTextContentItem(); 26628 textState.textHScale = args[0] / 100; 26629 break; 26630 case OPS.setLeading: 26631 flushTextContentItem(); 26632 textState.leading = args[0]; 26633 break; 26634 case OPS.moveText: 26635 var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; 26636 advance = args[0] - args[1]; 26637 if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { 26638 textState.translateTextLineMatrix(args[0], args[1]); 26639 textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; 26640 textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; 26641 diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); 26642 addFakeSpaces(diff, textContentItem.str); 26643 break; 26644 } 26645 flushTextContentItem(); 26646 textState.translateTextLineMatrix(args[0], args[1]); 26647 textState.textMatrix = textState.textLineMatrix.slice(); 26648 break; 26649 case OPS.setLeadingMoveText: 26650 flushTextContentItem(); 26651 textState.leading = -args[1]; 26652 textState.translateTextLineMatrix(args[0], args[1]); 26653 textState.textMatrix = textState.textLineMatrix.slice(); 26654 break; 26655 case OPS.nextLine: 26656 flushTextContentItem(); 26657 textState.carriageReturn(); 26658 break; 26659 case OPS.setTextMatrix: 26660 advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); 26661 if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { 26662 textState.translateTextLineMatrix(advance.width, advance.height); 26663 textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; 26664 textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; 26665 diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); 26666 addFakeSpaces(diff, textContentItem.str); 26667 break; 26668 } 26669 flushTextContentItem(); 26670 textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 26671 textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 26672 break; 26673 case OPS.setCharSpacing: 26674 textState.charSpacing = args[0]; 26675 break; 26676 case OPS.setWordSpacing: 26677 textState.wordSpacing = args[0]; 26678 break; 26679 case OPS.beginText: 26680 flushTextContentItem(); 26681 textState.textMatrix = IDENTITY_MATRIX.slice();
26682 textState.textLineMatrix = IDENTITY_MATRIX.slice(); 26683 break; 26684 case OPS.showSpacedText: 26685 var items = args[0]; 26686 var offset; 26687 for (var j = 0, jj = items.length; j < jj; j++) { 26688 if (typeof items[j] === 'string') { 26689 buildTextContentItem(items[j]); 26690 } else if (isNum(items[j])) { 26691 ensureTextContentItem(); 26692 advance = items[j] * textState.fontSize / 1000; 26693 var breakTextRun = false; 26694 if (textState.font.vertical) { 26695 offset = advance; 26696 textState.translateTextMatrix(0, offset); 26697 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 26698 if (!breakTextRun) { 26699 textContentItem.height += offset; 26700 } 26701 } else { 26702 advance = -advance; 26703 offset = advance * textState.textHScale; 26704 textState.translateTextMatrix(offset, 0); 26705 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 26706 if (!breakTextRun) { 26707 textContentItem.width += offset; 26708 } 26709 } 26710 if (breakTextRun) { 26711 flushTextContentItem(); 26712 } else if (advance > 0) { 26713 addFakeSpaces(advance, textContentItem.str); 26714 } 26715 } 26716 } 26717 break; 26718 case OPS.showText: 26719 buildTextContentItem(args[0]); 26720 break; 26721 case OPS.nextLineShowText: 26722 flushTextContentItem(); 26723 textState.carriageReturn(); 26724 buildTextContentItem(args[0]); 26725 break; 26726 case OPS.nextLineSetSpacingShowText: 26727 flushTextContentItem(); 26728 textState.wordSpacing = args[0]; 26729 textState.charSpacing = args[1]; 26730 textState.carriageReturn(); 26731 buildTextContentItem(args[2]); 26732 break; 26733 case OPS.paintXObject: 26734 flushTextContentItem(); 26735 if (args[0].code) { 26736 break; 26737 } 26738 if (!xobjs) { 26739 xobjs = resources.get('XObject') || Dict.empty; 26740 } 26741 var name = args[0].name; 26742 if (xobjsCache.key === name) { 26743 if (xobjsCache.texts) { 26744 Util.appendToArray(textContent.items, xobjsCache.texts.items); 26745 Util.extendObj(textContent.styles, xobjsCache.texts.styles); 26746 } 26747 break; 26748 } 26749 var xobj = xobjs.get(name); 26750 if (!xobj) { 26751 break; 26752 } 26753 assert(isStream(xobj), 'XObject should be a stream'); 26754 var type = xobj.dict.get('Subtype'); 26755 assert(isName(type), 'XObject should have a Name subtype'); 26756 if ('Form' !== type.name) { 26757 xobjsCache.key = name; 26758 xobjsCache.texts = null; 26759 break; 26760 } 26761 stateManager.save(); 26762 var matrix = xobj.dict.getArray('Matrix'); 26763 if (isArray(matrix) && matrix.length === 6) { 26764 stateManager.transform(matrix); 26765 } 26766 next(self.getTextContent(xobj, task, xobj.dict.get('Resources') || resources, stateManager, normalizeWhitespace, combineTextItems).then(function (formTextContent) { 26767 Util.appendToArray(textContent.items, formTextContent.items); 26768 Util.extendObj(textContent.styles, formTextContent.styles); 26769 stateManager.restore(); 26770 xobjsCache.key = name; 26771 xobjsCache.texts = formTextContent; 26772 })); 26773 return; 26774 case OPS.setGState: 26775 flushTextContentItem(); 26776 var dictName = args[0]; 26777 var extGState = resources.get('ExtGState'); 26778 if (!isDict(extGState) || !isName(dictName)) { 26779 break; 26780 } 26781 var gState = extGState.get(dictName.name); 26782 if (!isDict(gState)) { 26783 break; 26784 } 26785 var gStateFont = gState.get('Font'); 26786 if (gStateFont) { 26787 textState.fontName = null; 26788 textState.fontSize = gStateFont[1]; 26789 next(handleSetFont(null, gStateFont[0])); 26790 return; 26791 } 26792 break; 26793 } 26794 } 26795 if (stop) { 26796 next(deferred); 26797 return; 26798 } 26799 flushTextContentItem(); 26800 resolve(textContent); 26801 }); 26802 }, 26803 extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, xref, properties) { 26804 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 26805 var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); 26806 if (properties.composite) { 26807 var cidSystemInfo = dict.get('CIDSystemInfo'); 26808 if (isDict(cidSystemInfo)) { 26809 properties.cidSystemInfo = { 26810 registry: cidSystemInfo.get('Registry'), 26811 ordering: cidSystemInfo.get('Ordering'), 26812 supplement: cidSystemInfo.get('Supplement') 26813 }; 26814 } 26815 var cidToGidMap = dict.get('CIDToGIDMap'); 26816 if (isStream(cidToGidMap)) { 26817 properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); 26818 } 26819 } 26820 var differences = []; 26821 var baseEncodingName = null; 26822 var encoding; 26823 if (dict.has('Encoding')) { 26824 encoding = dict.get('Encoding'); 26825 if (isDict(encoding)) { 26826 baseEncodingName = encoding.get('BaseEncoding'); 26827 baseEncodingName = isName(baseEncodingName) ? baseEncodingName.name : null; 26828 if (encoding.has('Differences')) { 26829 var diffEncoding = encoding.get('Differences'); 26830 var index = 0; 26831 for (var j = 0, jj = diffEncoding.length; j < jj; j++) { 26832 var data = xref.fetchIfRef(diffEncoding[j]); 26833 if (isNum(data)) { 26834 index = data; 26835 } else if (isName(data)) { 26836 differences[index++] = data.name; 26837 } else { 26838 error('Invalid entry in \'Differences\' array: ' + data); 26839 } 26840 } 26841 } 26842 } else if (isName(encoding)) { 26843 baseEncodingName = encoding.name; 26844 } else { 26845 error('Encoding is not a Name nor a Dict'); 26846 } 26847 if (baseEncodingName !== 'MacRomanEncoding' && baseEncodingName !== 'MacExpertEncoding' && baseEncodingName !== 'WinAnsiEncoding') { 26848 baseEncodingName = null; 26849 } 26850 } 26851 if (baseEncodingName) { 26852 properties.defaultEncoding = getEncoding(baseEncodingName).slice(); 26853 } else { 26854 var isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 26855 var isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic); 26856 encoding = StandardEncoding; 26857 if (properties.type === 'TrueType' && !isNonsymbolicFont) { 26858 encoding = WinAnsiEncoding; 26859 } 26860 if (isSymbolicFont) { 26861 encoding = MacRomanEncoding; 26862 if (!properties.file) { 26863 if (/Symbol/i.test(properties.name)) { 26864 encoding = SymbolSetEncoding; 26865 } else if (/Dingbats/i.test(properties.name)) { 26866 encoding = ZapfDingbatsEncoding; 26867 } 26868 } 26869 } 26870 properties.defaultEncoding = encoding; 26871 } 26872 properties.differences = differences; 26873 properties.baseEncodingName = baseEncodingName; 26874 properties.hasEncoding = !!baseEncodingName || differences.length > 0; 26875 properties.dict = dict; 26876 return toUnicodePromise.then(function (toUnicode) { 26877 properties.toUnicode = toUnicode; 26878 return this.buildToUnicode(properties); 26879 }.bind(this)).then(function (toUnicode) { 26880 properties.toUnicode = toUnicode; 26881 return properties; 26882 }); 26883 }, 26884 buildToUnicode: function PartialEvaluator_buildToUnicode(properties) { 26885 properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; 26886 if (properties.hasIncludedToUnicodeMap) { 26887 return Promise.resolve(properties.toUnicode); 26888 } 26889 var toUnicode, charcode, glyphName; 26890 if (!properties.composite) { 26891 toUnicode = []; 26892 var encoding = properties.defaultEncoding.slice(); 26893 var baseEncodingName = properties.baseEncodingName; 26894 var differences = properties.differences; 26895 for (charcode in differences) { 26896 glyphName = differences[charcode]; 26897 if (glyphName === '.notdef') { 26898 continue; 26899 } 26900 encoding[charcode] = glyphName; 26901 } 26902 var glyphsUnicodeMap = getGlyphsUnicode(); 26903 for (charcode in encoding) { 26904 glyphName = encoding[charcode]; 26905 if (glyphName === '') { 26906 continue; 26907 } else if (glyphsUnicodeMap[glyphName] === undefined) { 26908 var code = 0; 26909 switch (glyphName[0]) { 26910 case 'G': 26911 if (glyphName.length === 3) { 26912 code = parseInt(glyphName.substr(1), 16); 26913 } 26914 break; 26915 case 'g': 26916 if (glyphName.length === 5) { 26917 code = parseInt(glyphName.substr(1), 16); 26918 } 26919 break; 26920 case 'C': 26921 case 'c': 26922 if (glyphName.length >= 3) { 26923 code = +glyphName.substr(1); 26924 } 26925 break; 26926 default: 26927 var unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); 26928 if (unicode !== -1) { 26929 code = unicode; 26930 } 26931 } 26932 if (code) { 26933 if (baseEncodingName && code === +charcode) { 26934 var baseEncoding = getEncoding(baseEncodingName); 26935 if (baseEncoding && (glyphName = baseEncoding[charcode])) { 26936 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 26937 continue; 26938 } 26939 } 26940 toUnicode[charcode] = String.fromCharCode(code); 26941 } 26942 continue; 26943 } 26944 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 26945 } 26946 return Promise.resolve(new ToUnicodeMap(toUnicode)); 26947 } 26948 if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof IdentityCMap) || properties.cidSystemInfo.registry === 'Adobe' && (properties.cidSystemInfo.ordering === 'GB1' || properties.cidSystemInfo.ordering === 'CNS1' || properties.cidSystemInfo.ordering === 'Japan1' || properties.cidSystemInfo.ordering === 'Korea1'))) { 26949 var registry = properties.cidSystemInfo.registry; 26950 var ordering = properties.cidSystemInfo.ordering; 26951 var ucs2CMapName = Name.get(registry + '-' + ordering + '-UCS2'); 26952 return CMapFactory.create({ 26953 encoding: ucs2CMapName, 26954 fetchBuiltInCMap: this.fetchBuiltInCMap, 26955 useCMap: null 26956 }).then(function (ucs2CMap) { 26957 var cMap = properties.cMap; 26958 toUnicode = [];
26959 cMap.forEach(function (charcode, cid) { 26960 assert(cid <= 0xffff, 'Max size of CID is 65,535'); 26961 var ucs2 = ucs2CMap.lookup(cid); 26962 if (ucs2) { 26963 toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); 26964 } 26965 }); 26966 return new ToUnicodeMap(toUnicode); 26967 }); 26968 } 26969 return Promise.resolve(new IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); 26970 }, 26971 readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { 26972 var cmapObj = toUnicode; 26973 if (isName(cmapObj)) { 26974 return CMapFactory.create({ 26975 encoding: cmapObj, 26976 fetchBuiltInCMap: this.fetchBuiltInCMap, 26977 useCMap: null 26978 }).then(function (cmap) { 26979 if (cmap instanceof IdentityCMap) { 26980 return new IdentityToUnicodeMap(0, 0xFFFF); 26981 } 26982 return new ToUnicodeMap(cmap.getMap()); 26983 }); 26984 } else if (isStream(cmapObj)) { 26985 return CMapFactory.create({ 26986 encoding: cmapObj, 26987 fetchBuiltInCMap: this.fetchBuiltInCMap, 26988 useCMap: null 26989 }).then(function (cmap) { 26990 if (cmap instanceof IdentityCMap) { 26991 return new IdentityToUnicodeMap(0, 0xFFFF); 26992 } 26993 var map = new Array(cmap.length); 26994 cmap.forEach(function (charCode, token) { 26995 var str = []; 26996 for (var k = 0; k < token.length; k += 2) {
26997 var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 26998 if ((w1 & 0xF800) !== 0xD800) { 26999 str.push(w1); 27000 continue; 27001 } 27002 k += 2; 27003 var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 27004 str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); 27005 } 27006 map[charCode] = String.fromCharCode.apply(String, str); 27007 }); 27008 return new ToUnicodeMap(map); 27009 }); 27010 } 27011 return Promise.resolve(null); 27012 }, 27013 readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { 27014 var glyphsData = cidToGidStream.getBytes(); 27015 var result = []; 27016 for (var j = 0, jj = glyphsData.length; j < jj; j++) { 27017 var glyphID = glyphsData[j++] << 8 | glyphsData[j]; 27018 if (glyphID === 0) { 27019 continue; 27020 } 27021 var code = j >> 1; 27022 result[code] = glyphID; 27023 } 27024 return result; 27025 }, 27026 extractWidths: function PartialEvaluator_extractWidths(dict, xref, descriptor, properties) { 27027 var glyphsWidths = []; 27028 var defaultWidth = 0; 27029 var glyphsVMetrics = []; 27030 var defaultVMetrics; 27031 var i, ii, j, jj, start, code, widths; 27032 if (properties.composite) { 27033 defaultWidth = dict.get('DW') || 1000; 27034 widths = dict.get('W'); 27035 if (widths) { 27036 for (i = 0, ii = widths.length; i < ii; i++) { 27037 start = xref.fetchIfRef(widths[i++]); 27038 code = xref.fetchIfRef(widths[i]); 27039 if (isArray(code)) { 27040 for (j = 0, jj = code.length; j < jj; j++) { 27041 glyphsWidths[start++] = xref.fetchIfRef(code[j]); 27042 } 27043 } else { 27044 var width = xref.fetchIfRef(widths[++i]); 27045 for (j = start; j <= code; j++) { 27046 glyphsWidths[j] = width; 27047 } 27048 } 27049 } 27050 } 27051 if (properties.vertical) { 27052 var vmetrics = dict.getArray('DW2') || [ 27053 880, 27054 -1000 27055 ]; 27056 defaultVMetrics = [ 27057 vmetrics[1], 27058 defaultWidth * 0.5, 27059 vmetrics[0] 27060 ]; 27061 vmetrics = dict.get('W2'); 27062 if (vmetrics) { 27063 for (i = 0, ii = vmetrics.length; i < ii; i++) { 27064 start = xref.fetchIfRef(vmetrics[i++]); 27065 code = xref.fetchIfRef(vmetrics[i]); 27066 if (isArray(code)) { 27067 for (j = 0, jj = code.length; j < jj; j++) { 27068 glyphsVMetrics[start++] = [ 27069 xref.fetchIfRef(code[j++]), 27070 xref.fetchIfRef(code[j++]), 27071 xref.fetchIfRef(code[j]) 27072 ]; 27073 } 27074 } else { 27075 var vmetric = [ 27076 xref.fetchIfRef(vmetrics[++i]), 27077 xref.fetchIfRef(vmetrics[++i]), 27078 xref.fetchIfRef(vmetrics[++i]) 27079 ]; 27080 for (j = start; j <= code; j++) { 27081 glyphsVMetrics[j] = vmetric; 27082 } 27083 } 27084 } 27085 } 27086 } 27087 } else { 27088 var firstChar = properties.firstChar; 27089 widths = dict.get('Widths'); 27090 if (widths) { 27091 j = firstChar; 27092 for (i = 0, ii = widths.length; i < ii; i++) { 27093 glyphsWidths[j++] = xref.fetchIfRef(widths[i]); 27094 } 27095 defaultWidth = parseFloat(descriptor.get('MissingWidth')) || 0; 27096 } else { 27097 var baseFontName = dict.get('BaseFont'); 27098 if (isName(baseFontName)) { 27099 var metrics = this.getBaseFontMetrics(baseFontName.name); 27100 glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); 27101 defaultWidth = metrics.defaultWidth; 27102 } 27103 } 27104 } 27105 var isMonospace = true; 27106 var firstWidth = defaultWidth; 27107 for (var glyph in glyphsWidths) { 27108 var glyphWidth = glyphsWidths[glyph]; 27109 if (!glyphWidth) { 27110 continue; 27111 } 27112 if (!firstWidth) { 27113 firstWidth = glyphWidth; 27114 continue; 27115 } 27116 if (firstWidth !== glyphWidth) { 27117 isMonospace = false; 27118 break; 27119 } 27120 } 27121 if (isMonospace) { 27122 properties.flags |= FontFlags.FixedPitch; 27123 } 27124 properties.defaultWidth = defaultWidth; 27125 properties.widths = glyphsWidths; 27126 properties.defaultVMetrics = defaultVMetrics; 27127 properties.vmetrics = glyphsVMetrics; 27128 }, 27129 isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { 27130 var fontNameWoStyle = baseFontName.split('-')[0]; 27131 return fontNameWoStyle in getSerifFonts() || fontNameWoStyle.search(/serif/gi) !== -1; 27132 }, 27133 getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { 27134 var defaultWidth = 0; 27135 var widths = []; 27136 var monospace = false;
vendor: 4,594 bytes, lines 27137-27266
27137 var stdFontMap = getStdFontMap(); 27138 var lookupName = stdFontMap[name] || name; 27139 var Metrics = getMetrics(); 27140 if (!(lookupName in Metrics)) { 27141 if (this.isSerifFont(name)) { 27142 lookupName = 'Times-Roman'; 27143 } else { 27144 lookupName = 'Helvetica'; 27145 } 27146 } 27147 var glyphWidths = Metrics[lookupName]; 27148 if (isNum(glyphWidths)) { 27149 defaultWidth = glyphWidths; 27150 monospace = true; 27151 } else { 27152 widths = glyphWidths(); 27153 } 27154 return { 27155 defaultWidth: defaultWidth, 27156 monospace: monospace, 27157 widths: widths 27158 }; 27159 }, 27160 buildCharCodeToWidth: function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, properties) { 27161 var widths = Object.create(null); 27162 var differences = properties.differences; 27163 var encoding = properties.defaultEncoding; 27164 for (var charCode = 0; charCode < 256; charCode++) { 27165 if (charCode in differences && widthsByGlyphName[differences[charCode]]) { 27166 widths[charCode] = widthsByGlyphName[differences[charCode]]; 27167 continue; 27168 } 27169 if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { 27170 widths[charCode] = widthsByGlyphName[encoding[charCode]]; 27171 continue; 27172 } 27173 } 27174 return widths; 27175 }, 27176 preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict, xref) { 27177 var baseDict = dict; 27178 var type = dict.get('Subtype'); 27179 assert(isName(type), 'invalid font Subtype'); 27180 var composite = false; 27181 var uint8array; 27182 if (type.name === 'Type0') { 27183 var df = dict.get('DescendantFonts'); 27184 if (!df) { 27185 error('Descendant fonts are not specified'); 27186 } 27187 dict = isArray(df) ? xref.fetchIfRef(df[0]) : df; 27188 type = dict.get('Subtype'); 27189 assert(isName(type), 'invalid font Subtype'); 27190 composite = true; 27191 } 27192 var descriptor = dict.get('FontDescriptor'); 27193 if (descriptor) { 27194 var hash = new MurmurHash3_64(); 27195 var encoding = baseDict.getRaw('Encoding'); 27196 if (isName(encoding)) { 27197 hash.update(encoding.name); 27198 } else if (isRef(encoding)) { 27199 hash.update(encoding.toString()); 27200 } else if (isDict(encoding)) { 27201 var keys = encoding.getKeys(); 27202 for (var i = 0, ii = keys.length; i < ii; i++) { 27203 var entry = encoding.getRaw(keys[i]); 27204 if (isName(entry)) { 27205 hash.update(entry.name); 27206 } else if (isRef(entry)) { 27207 hash.update(entry.toString()); 27208 } else if (isArray(entry)) { 27209 var diffLength = entry.length, diffBuf = new Array(diffLength); 27210 for (var j = 0; j < diffLength; j++) { 27211 var diffEntry = entry[j]; 27212 if (isName(diffEntry)) { 27213 diffBuf[j] = diffEntry.name; 27214 } else if (isNum(diffEntry) || isRef(diffEntry)) { 27215 diffBuf[j] = diffEntry.toString(); 27216 } 27217 } 27218 hash.update(diffBuf.join()); 27219 } 27220 } 27221 } 27222 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 27223 if (isStream(toUnicode)) { 27224 var stream = toUnicode.str || toUnicode; 27225 uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); 27226 hash.update(uint8array); 27227 } else if (isName(toUnicode)) { 27228 hash.update(toUnicode.name); 27229 } 27230 var widths = dict.get('Widths') || baseDict.get('Widths'); 27231 if (widths) { 27232 uint8array = new Uint8Array(new Uint32Array(widths).buffer); 27233 hash.update(uint8array); 27234 } 27235 } 27236 return { 27237 descriptor: descriptor, 27238 dict: dict, 27239 baseDict: baseDict, 27240 composite: composite, 27241 type: type.name, 27242 hash: hash ? hash.hexdigest() : '' 27243 }; 27244 }, 27245 translateFont: function PartialEvaluator_translateFont(preEvaluatedFont, xref) { 27246 var baseDict = preEvaluatedFont.baseDict; 27247 var dict = preEvaluatedFont.dict; 27248 var composite = preEvaluatedFont.composite; 27249 var descriptor = preEvaluatedFont.descriptor; 27250 var type = preEvaluatedFont.type; 27251 var maxCharIndex = composite ? 0xFFFF : 0xFF; 27252 var properties; 27253 if (!descriptor) { 27254 if (type === 'Type3') { 27255 descriptor = new Dict(null); 27256 descriptor.set('FontName', Name.get(type)); 27257 descriptor.set('FontBBox', dict.getArray('FontBBox')); 27258 } else { 27259 var baseFontName = dict.get('BaseFont'); 27260 if (!isName(baseFontName)) { 27261 error('Base font is not specified'); 27262 } 27263 baseFontName = baseFontName.name.replace(/[,_]/g, '-'); 27264 var metrics = this.getBaseFontMetrics(baseFontName); 27265 var fontNameWoStyle = baseFontName.split('-')[0]; 27266 var flags = (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | (metrics.monospace ? FontFlags.FixedPitch : 0) | (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic
27266: FontFlags.Nonsymbolic); 27267 properties = { 27268 type: type, 27269 name: baseFontName, 27270 widths: metrics.widths, 27271 defaultWidth: metrics.defaultWidth, 27272 flags: flags, 27273 firstChar: 0, 27274 lastChar: maxCharIndex 27275 }; 27276 return this.extractDataStructures(dict, dict, xref, properties).then(function (properties) { 27277 properties.widths = this.buildCharCodeToWidth(metrics.widths, properties); 27278 return new Font(baseFontName, null, properties); 27279 }.bind(this)); 27280 } 27281 } 27282 var firstChar = dict.get('FirstChar') || 0; 27283 var lastChar = dict.get('LastChar') || maxCharIndex; 27284 var fontName = descriptor.get('FontName'); 27285 var baseFont = dict.get('BaseFont'); 27286 if (isString(fontName)) { 27287 fontName = Name.get(fontName); 27288 } 27289 if (isString(baseFont)) { 27290 baseFont = Name.get(baseFont); 27291 } 27292 if (type !== 'Type3') { 27293 var fontNameStr = fontName && fontName.name; 27294 var baseFontStr = baseFont && baseFont.name; 27295 if (fontNameStr !== baseFontStr) { 27296 info('The FontDescriptor\'s FontName is "' + fontNameStr + '" but should be the same as the Font\'s BaseFont "' + baseFontStr + '"'); 27297 if (fontNameStr && baseFontStr && baseFontStr.indexOf(fontNameStr) === 0) { 27298 fontName = baseFont; 27299 } 27300 } 27301 } 27302 fontName = fontName || baseFont; 27303 assert(isName(fontName), 'invalid font name'); 27304 var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); 27305 if (fontFile) { 27306 if (fontFile.dict) { 27307 var subtype = fontFile.dict.get('Subtype'); 27308 if (subtype) { 27309 subtype = subtype.name; 27310 } 27311 var length1 = fontFile.dict.get('Length1'); 27312 var length2 = fontFile.dict.get('Length2'); 27313 var length3 = fontFile.dict.get('Length3'); 27314 } 27315 } 27316 properties = { 27317 type: type, 27318 name: fontName.name, 27319 subtype: subtype, 27320 file: fontFile, 27321 length1: length1, 27322 length2: length2, 27323 length3: length3, 27324 loadedName: baseDict.loadedName, 27325 composite: composite, 27326 wideChars: composite, 27327 fixedPitch: false, 27328 fontMatrix: dict.getArray('FontMatrix') || FONT_IDENTITY_MATRIX, 27329 firstChar: firstChar || 0, 27330 lastChar: lastChar || maxCharIndex, 27331 bbox: descriptor.getArray('FontBBox'), 27332 ascent: descriptor.get('Ascent'), 27333 descent: descriptor.get('Descent'), 27334 xHeight: descriptor.get('XHeight'), 27335 capHeight: descriptor.get('CapHeight'), 27336 flags: descriptor.get('Flags'), 27337 italicAngle: descriptor.get('ItalicAngle'), 27338 coded: false 27339 }; 27340 var cMapPromise; 27341 if (composite) { 27342 var cidEncoding = baseDict.get('Encoding'); 27343 if (isName(cidEncoding)) { 27344 properties.cidEncoding = cidEncoding.name; 27345 } 27346 cMapPromise = CMapFactory.create({ 27347 encoding: cidEncoding, 27348 fetchBuiltInCMap: this.fetchBuiltInCMap, 27349 useCMap: null 27350 }).then(function (cMap) { 27351 properties.cMap = cMap; 27352 properties.vertical = properties.cMap.vertical; 27353 }); 27354 } else { 27355 cMapPromise = Promise.resolve(undefined); 27356 } 27357 return cMapPromise.then(function () { 27358 return this.extractDataStructures(dict, baseDict, xref, properties); 27359 }.bind(this)).then(function (properties) { 27360 this.extractWidths(dict, xref, descriptor, properties); 27361 if (type === 'Type3') { 27362 properties.isType3Font = true; 27363 } 27364 return new Font(fontName.name, fontFile, properties); 27365 }.bind(this)); 27366 } 27367 }; 27368 return PartialEvaluator; 27369}(); 27370var TranslatedFont = function TranslatedFontClosure() { 27371 function TranslatedFont(loadedName, font, dict) { 27372 this.loadedName = loadedName; 27373 this.font = font; 27374 this.dict = dict; 27375 this.type3Loaded = null; 27376 this.sent = false; 27377 } 27378 TranslatedFont.prototype = { 27379 send: function (handler) { 27380 if (this.sent) { 27381 return; 27382 } 27383 var fontData = this.font.exportData(); 27384 handler.send('commonobj', [ 27385 this.loadedName, 27386 'Font', 27387 fontData 27388 ]); 27389 this.sent = true; 27390 }, 27391 loadType3Data: function (evaluator, resources, parentOperatorList, task) { 27392 assert(this.font.isType3Font); 27393 if (this.type3Loaded) { 27394 return this.type3Loaded; 27395 } 27396 var translatedFont = this.font; 27397 var loadCharProcsPromise = Promise.resolve(); 27398 var charProcs = this.dict.get('CharProcs'); 27399 var fontResources = this.dict.get('Resources') || resources; 27400 var charProcKeys = charProcs.getKeys(); 27401 var charProcOperatorList = Object.create(null); 27402 for (var i = 0, n = charProcKeys.length; i < n; ++i) { 27403 loadCharProcsPromise = loadCharProcsPromise.then(function (key) { 27404 var glyphStream = charProcs.get(key); 27405 var operatorList = new OperatorList(); 27406 return evaluator.getOperatorList(glyphStream, task, fontResources, operatorList).then(function () { 27407 charProcOperatorList[key] = operatorList.getIR(); 27408 parentOperatorList.addDependencies(operatorList.dependencies); 27409 }, function (reason) { 27410 warn('Type3 font resource \"' + key + '\" is not available'); 27411 var operatorList = new OperatorList(); 27412 charProcOperatorList[key] = operatorList.getIR(); 27413 }); 27414 }.bind(this, charProcKeys[i])); 27415 } 27416 this.type3Loaded = loadCharProcsPromise.then(function () { 27417 translatedFont.charProcOperatorList = charProcOperatorList; 27418 }); 27419 return this.type3Loaded; 27420 } 27421 }; 27422 return TranslatedFont; 27423}(); 27424var OperatorList = function OperatorListClosure() { 27425 var CHUNK_SIZE = 1000;
vendor: 3,281 bytes, lines 27426-27550
27426 var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; 27427 function getTransfers(queue) { 27428 var transfers = []; 27429 var fnArray = queue.fnArray, argsArray = queue.argsArray; 27430 for (var i = 0, ii = queue.length; i < ii; i++) { 27431 switch (fnArray[i]) { 27432 case OPS.paintInlineImageXObject: 27433 case OPS.paintInlineImageXObjectGroup: 27434 case OPS.paintImageMaskXObject: 27435 var arg = argsArray[i][0]; 27436 if (!arg.cached) { 27437 transfers.push(arg.data.buffer); 27438 } 27439 break; 27440 } 27441 } 27442 return transfers; 27443 } 27444 function OperatorList(intent, messageHandler, pageIndex) { 27445 this.messageHandler = messageHandler; 27446 this.fnArray = []; 27447 this.argsArray = []; 27448 this.dependencies = Object.create(null); 27449 this._totalLength = 0; 27450 this.pageIndex = pageIndex; 27451 this.intent = intent; 27452 } 27453 OperatorList.prototype = { 27454 get length() { 27455 return this.argsArray.length; 27456 }, 27457 get totalLength() { 27458 return this._totalLength + this.length; 27459 }, 27460 addOp: function (fn, args) { 27461 this.fnArray.push(fn); 27462 this.argsArray.push(args); 27463 if (this.messageHandler) { 27464 if (this.fnArray.length >= CHUNK_SIZE) { 27465 this.flush(); 27466 } else if (this.fnArray.length >= CHUNK_SIZE_ABOUT && (fn === OPS.restore || fn === OPS.endText)) { 27467 this.flush(); 27468 } 27469 } 27470 }, 27471 addDependency: function (dependency) { 27472 if (dependency in this.dependencies) { 27473 return; 27474 } 27475 this.dependencies[dependency] = true; 27476 this.addOp(OPS.dependency, [dependency]); 27477 }, 27478 addDependencies: function (dependencies) { 27479 for (var key in dependencies) { 27480 this.addDependency(key); 27481 } 27482 }, 27483 addOpList: function (opList) { 27484 Util.extendObj(this.dependencies, opList.dependencies); 27485 for (var i = 0, ii = opList.length; i < ii; i++) { 27486 this.addOp(opList.fnArray[i], opList.argsArray[i]); 27487 } 27488 }, 27489 getIR: function () { 27490 return { 27491 fnArray: this.fnArray, 27492 argsArray: this.argsArray, 27493 length: this.length 27494 }; 27495 }, 27496 flush: function (lastChunk) { 27497 if (this.intent !== 'oplist') { 27498 new QueueOptimizer().optimize(this); 27499 } 27500 var transfers = getTransfers(this); 27501 var length = this.length; 27502 this._totalLength += length; 27503 this.messageHandler.send('RenderPageChunk', { 27504 operatorList: { 27505 fnArray: this.fnArray, 27506 argsArray: this.argsArray, 27507 lastChunk: lastChunk, 27508 length: length 27509 }, 27510 pageIndex: this.pageIndex, 27511 intent: this.intent 27512 }, transfers); 27513 this.dependencies = Object.create(null); 27514 this.fnArray.length = 0; 27515 this.argsArray.length = 0; 27516 } 27517 }; 27518 return OperatorList; 27519}(); 27520var StateManager = function StateManagerClosure() { 27521 function StateManager(initialState) { 27522 this.state = initialState; 27523 this.stateStack = []; 27524 } 27525 StateManager.prototype = { 27526 save: function () { 27527 var old = this.state; 27528 this.stateStack.push(this.state); 27529 this.state = old.clone(); 27530 }, 27531 restore: function () { 27532 var prev = this.stateStack.pop(); 27533 if (prev) { 27534 this.state = prev; 27535 } 27536 }, 27537 transform: function (args) { 27538 this.state.ctm = Util.transform(this.state.ctm, args); 27539 } 27540 }; 27541 return StateManager; 27542}(); 27543var TextState = function TextStateClosure() { 27544 function TextState() { 27545 this.ctm = new Float32Array(IDENTITY_MATRIX); 27546 this.fontName = null; 27547 this.fontSize = 0; 27548 this.font = null; 27549 this.fontMatrix = FONT_IDENTITY_MATRIX; 27550 this.textMatrix = IDENTITY_MATRIX.slice();
27551 this.textLineMatrix = IDENTITY_MATRIX.slice(); 27552 this.charSpacing = 0; 27553 this.wordSpacing = 0; 27554 this.leading = 0; 27555 this.textHScale = 1; 27556 this.textRise = 0; 27557 } 27558 TextState.prototype = { 27559 setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { 27560 var m = this.textMatrix; 27561 m[0] = a; 27562 m[1] = b; 27563 m[2] = c; 27564 m[3] = d; 27565 m[4] = e; 27566 m[5] = f; 27567 }, 27568 setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { 27569 var m = this.textLineMatrix; 27570 m[0] = a; 27571 m[1] = b; 27572 m[2] = c; 27573 m[3] = d; 27574 m[4] = e; 27575 m[5] = f; 27576 }, 27577 translateTextMatrix: function TextState_translateTextMatrix(x, y) { 27578 var m = this.textMatrix; 27579 m[4] = m[0] * x + m[2] * y + m[4]; 27580 m[5] = m[1] * x + m[3] * y + m[5]; 27581 }, 27582 translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { 27583 var m = this.textLineMatrix; 27584 m[4] = m[0] * x + m[2] * y + m[4]; 27585 m[5] = m[1] * x + m[3] * y + m[5]; 27586 }, 27587 calcTextLineMatrixAdvance: function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) { 27588 var font = this.font; 27589 if (!font) { 27590 return null; 27591 }
27592 var m = this.textLineMatrix; 27593 if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { 27594 return null; 27595 } 27596 var txDiff = e - m[4], tyDiff = f - m[5]; 27597 if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { 27598 return null; 27599 } 27600 var tx, ty, denominator = a * d - b * c; 27601 if (font.vertical) { 27602 tx = -tyDiff * c / denominator; 27603 ty = tyDiff * a / denominator; 27604 } else { 27605 tx = txDiff * d / denominator; 27606 ty = -txDiff * b / denominator; 27607 } 27608 return { 27609 width: tx, 27610 height: ty, 27611 value: font.vertical ? ty : tx 27612 }; 27613 }, 27614 calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { 27615 var tsm = [ 27616 this.fontSize * this.textHScale, 27617 0, 27618 0, 27619 this.fontSize, 27620 0, 27621 this.textRise 27622 ]; 27623 return Util.transform(ctm, Util.transform(this.textMatrix, tsm)); 27624 }, 27625 carriageReturn: function TextState_carriageReturn() { 27626 this.translateTextLineMatrix(0, -this.leading); 27627 this.textMatrix = this.textLineMatrix.slice(); 27628 }, 27629 clone: function TextState_clone() { 27630 var clone = Object.create(this); 27631 clone.textMatrix = this.textMatrix.slice();
vendor: 4,712 bytes, lines 27632-27905
27632 clone.textLineMatrix = this.textLineMatrix.slice(); 27633 clone.fontMatrix = this.fontMatrix.slice(); 27634 return clone; 27635 } 27636 }; 27637 return TextState; 27638}(); 27639var EvalState = function EvalStateClosure() { 27640 function EvalState() { 27641 this.ctm = new Float32Array(IDENTITY_MATRIX); 27642 this.font = null; 27643 this.textRenderingMode = TextRenderingMode.FILL; 27644 this.fillColorSpace = ColorSpace.singletons.gray; 27645 this.strokeColorSpace = ColorSpace.singletons.gray; 27646 } 27647 EvalState.prototype = { 27648 clone: function CanvasExtraState_clone() { 27649 return Object.create(this); 27650 } 27651 }; 27652 return EvalState; 27653}(); 27654var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { 27655 var getOPMap = getLookupTableFactory(function (t) { 27656 t['w'] = { 27657 id: OPS.setLineWidth, 27658 numArgs: 1, 27659 variableArgs: false 27660 }; 27661 t['J'] = { 27662 id: OPS.setLineCap, 27663 numArgs: 1, 27664 variableArgs: false 27665 }; 27666 t['j'] = { 27667 id: OPS.setLineJoin, 27668 numArgs: 1, 27669 variableArgs: false 27670 }; 27671 t['M'] = { 27672 id: OPS.setMiterLimit, 27673 numArgs: 1, 27674 variableArgs: false 27675 }; 27676 t['d'] = { 27677 id: OPS.setDash, 27678 numArgs: 2, 27679 variableArgs: false 27680 }; 27681 t['ri'] = { 27682 id: OPS.setRenderingIntent, 27683 numArgs: 1, 27684 variableArgs: false 27685 }; 27686 t['i'] = { 27687 id: OPS.setFlatness, 27688 numArgs: 1, 27689 variableArgs: false 27690 }; 27691 t['gs'] = { 27692 id: OPS.setGState, 27693 numArgs: 1, 27694 variableArgs: false 27695 }; 27696 t['q'] = { 27697 id: OPS.save, 27698 numArgs: 0, 27699 variableArgs: false 27700 }; 27701 t['Q'] = { 27702 id: OPS.restore, 27703 numArgs: 0, 27704 variableArgs: false 27705 }; 27706 t['cm'] = { 27707 id: OPS.transform, 27708 numArgs: 6, 27709 variableArgs: false 27710 }; 27711 t['m'] = { 27712 id: OPS.moveTo, 27713 numArgs: 2, 27714 variableArgs: false 27715 }; 27716 t['l'] = { 27717 id: OPS.lineTo, 27718 numArgs: 2, 27719 variableArgs: false 27720 }; 27721 t['c'] = { 27722 id: OPS.curveTo, 27723 numArgs: 6, 27724 variableArgs: false 27725 }; 27726 t['v'] = { 27727 id: OPS.curveTo2, 27728 numArgs: 4, 27729 variableArgs: false 27730 }; 27731 t['y'] = { 27732 id: OPS.curveTo3, 27733 numArgs: 4, 27734 variableArgs: false 27735 }; 27736 t['h'] = { 27737 id: OPS.closePath, 27738 numArgs: 0, 27739 variableArgs: false 27740 }; 27741 t['re'] = { 27742 id: OPS.rectangle, 27743 numArgs: 4, 27744 variableArgs: false 27745 }; 27746 t['S'] = { 27747 id: OPS.stroke, 27748 numArgs: 0, 27749 variableArgs: false 27750 }; 27751 t['s'] = { 27752 id: OPS.closeStroke, 27753 numArgs: 0, 27754 variableArgs: false 27755 }; 27756 t['f'] = { 27757 id: OPS.fill, 27758 numArgs: 0, 27759 variableArgs: false 27760 }; 27761 t['F'] = { 27762 id: OPS.fill, 27763 numArgs: 0, 27764 variableArgs: false 27765 }; 27766 t['f*'] = { 27767 id: OPS.eoFill, 27768 numArgs: 0, 27769 variableArgs: false 27770 }; 27771 t['B'] = { 27772 id: OPS.fillStroke, 27773 numArgs: 0, 27774 variableArgs: false 27775 }; 27776 t['B*'] = { 27777 id: OPS.eoFillStroke, 27778 numArgs: 0, 27779 variableArgs: false 27780 }; 27781 t['b'] = { 27782 id: OPS.closeFillStroke, 27783 numArgs: 0, 27784 variableArgs: false 27785 }; 27786 t['b*'] = { 27787 id: OPS.closeEOFillStroke, 27788 numArgs: 0, 27789 variableArgs: false 27790 }; 27791 t['n'] = { 27792 id: OPS.endPath, 27793 numArgs: 0, 27794 variableArgs: false 27795 }; 27796 t['W'] = { 27797 id: OPS.clip, 27798 numArgs: 0, 27799 variableArgs: false 27800 }; 27801 t['W*'] = { 27802 id: OPS.eoClip, 27803 numArgs: 0, 27804 variableArgs: false 27805 }; 27806 t['BT'] = { 27807 id: OPS.beginText, 27808 numArgs: 0, 27809 variableArgs: false 27810 }; 27811 t['ET'] = { 27812 id: OPS.endText, 27813 numArgs: 0, 27814 variableArgs: false 27815 }; 27816 t['Tc'] = { 27817 id: OPS.setCharSpacing, 27818 numArgs: 1, 27819 variableArgs: false 27820 }; 27821 t['Tw'] = { 27822 id: OPS.setWordSpacing, 27823 numArgs: 1, 27824 variableArgs: false 27825 }; 27826 t['Tz'] = { 27827 id: OPS.setHScale, 27828 numArgs: 1, 27829 variableArgs: false 27830 }; 27831 t['TL'] = { 27832 id: OPS.setLeading, 27833 numArgs: 1, 27834 variableArgs: false 27835 }; 27836 t['Tf'] = { 27837 id: OPS.setFont, 27838 numArgs: 2, 27839 variableArgs: false 27840 }; 27841 t['Tr'] = { 27842 id: OPS.setTextRenderingMode, 27843 numArgs: 1, 27844 variableArgs: false 27845 }; 27846 t['Ts'] = { 27847 id: OPS.setTextRise, 27848 numArgs: 1, 27849 variableArgs: false 27850 }; 27851 t['Td'] = { 27852 id: OPS.moveText, 27853 numArgs: 2, 27854 variableArgs: false 27855 }; 27856 t['TD'] = { 27857 id: OPS.setLeadingMoveText, 27858 numArgs: 2, 27859 variableArgs: false 27860 }; 27861 t['Tm'] = { 27862 id: OPS.setTextMatrix, 27863 numArgs: 6, 27864 variableArgs: false 27865 }; 27866 t['T*'] = { 27867 id: OPS.nextLine, 27868 numArgs: 0, 27869 variableArgs: false 27870 }; 27871 t['Tj'] = { 27872 id: OPS.showText, 27873 numArgs: 1, 27874 variableArgs: false 27875 }; 27876 t['TJ'] = { 27877 id: OPS.showSpacedText, 27878 numArgs: 1, 27879 variableArgs: false 27880 }; 27881 t['\''] = { 27882 id: OPS.nextLineShowText, 27883 numArgs: 1, 27884 variableArgs: false 27885 }; 27886 t['"'] = { 27887 id: OPS.nextLineSetSpacingShowText, 27888 numArgs: 3, 27889 variableArgs: false 27890 }; 27891 t['d0'] = { 27892 id: OPS.setCharWidth, 27893 numArgs: 2, 27894 variableArgs: false 27895 }; 27896 t['d1'] = { 27897 id: OPS.setCharWidthAndBounds, 27898 numArgs: 6, 27899 variableArgs: false 27900 }; 27901 t['CS'] = { 27902 id: OPS.setStrokeColorSpace, 27903 numArgs: 1, 27904 variableArgs: false 27905 };
27906 t['cs'] = { 27907 id: OPS.setFillColorSpace, 27908 numArgs: 1, 27909 variableArgs: false 27910 }; 27911 t['SC'] = { 27912 id: OPS.setStrokeColor, 27913 numArgs: 4, 27914 variableArgs: true 27915 }; 27916 t['SCN'] = { 27917 id: OPS.setStrokeColorN, 27918 numArgs: 33, 27919 variableArgs: true 27920 }; 27921 t['sc'] = { 27922 id: OPS.setFillColor, 27923 numArgs: 4, 27924 variableArgs: true 27925 }; 27926 t['scn'] = { 27927 id: OPS.setFillColorN, 27928 numArgs: 33, 27929 variableArgs: true 27930 }; 27931 t['G'] = { 27932 id: OPS.setStrokeGray, 27933 numArgs: 1, 27934 variableArgs: false 27935 }; 27936 t['g'] = { 27937 id: OPS.setFillGray, 27938 numArgs: 1, 27939 variableArgs: false 27940 }; 27941 t['RG'] = { 27942 id: OPS.setStrokeRGBColor, 27943 numArgs: 3, 27944 variableArgs: false 27945 }; 27946 t['rg'] = { 27947 id: OPS.setFillRGBColor, 27948 numArgs: 3, 27949 variableArgs: false 27950 }; 27951 t['K'] = { 27952 id: OPS.setStrokeCMYKColor, 27953 numArgs: 4, 27954 variableArgs: false 27955 }; 27956 t['k'] = { 27957 id: OPS.setFillCMYKColor, 27958 numArgs: 4, 27959 variableArgs: false 27960 }; 27961 t['sh'] = { 27962 id: OPS.shadingFill, 27963 numArgs: 1, 27964 variableArgs: false 27965 }; 27966 t['BI'] = { 27967 id: OPS.beginInlineImage, 27968 numArgs: 0, 27969 variableArgs: false 27970 }; 27971 t['ID'] = { 27972 id: OPS.beginImageData, 27973 numArgs: 0, 27974 variableArgs: false 27975 }; 27976 t['EI'] = { 27977 id: OPS.endInlineImage, 27978 numArgs: 1, 27979 variableArgs: false 27980 }; 27981 t['Do'] = { 27982 id: OPS.paintXObject, 27983 numArgs: 1, 27984 variableArgs: false 27985 }; 27986 t['MP'] = { 27987 id: OPS.markPoint, 27988 numArgs: 1, 27989 variableArgs: false 27990 }; 27991 t['DP'] = { 27992 id: OPS.markPointProps, 27993 numArgs: 2, 27994 variableArgs: false 27995 }; 27996 t['BMC'] = { 27997 id: OPS.beginMarkedContent, 27998 numArgs: 1, 27999 variableArgs: false 28000 }; 28001 t['BDC'] = { 28002 id: OPS.beginMarkedContentProps, 28003 numArgs: 2, 28004 variableArgs: false 28005 }; 28006 t['EMC'] = { 28007 id: OPS.endMarkedContent, 28008 numArgs: 0, 28009 variableArgs: false 28010 }; 28011 t['BX'] = { 28012 id: OPS.beginCompat, 28013 numArgs: 0, 28014 variableArgs: false 28015 }; 28016 t['EX'] = { 28017 id: OPS.endCompat, 28018 numArgs: 0, 28019 variableArgs: false 28020 }; 28021 t['BM'] = null; 28022 t['BD'] = null; 28023 t['true'] = null; 28024 t['fa'] = null; 28025 t['fal'] = null; 28026 t['fals'] = null; 28027 t['false'] = null; 28028 t['nu'] = null; 28029 t['nul'] = null; 28030 t['null'] = null; 28031 }); 28032 function EvaluatorPreprocessor(stream, xref, stateManager) { 28033 this.opMap = getOPMap(); 28034 this.parser = new Parser(new Lexer(stream, this.opMap), false, xref); 28035 this.stateManager = stateManager; 28036 this.nonProcessedArgs = []; 28037 } 28038 EvaluatorPreprocessor.prototype = { 28039 get savedStatesDepth() { 28040 return this.stateManager.stateStack.length; 28041 }, 28042 read: function EvaluatorPreprocessor_read(operation) { 28043 var args = operation.args; 28044 while (true) { 28045 var obj = this.parser.getObj(); 28046 if (isCmd(obj)) { 28047 var cmd = obj.cmd; 28048 var opSpec = this.opMap[cmd]; 28049 if (!opSpec) { 28050 warn('Unknown command "' + cmd + '"'); 28051 continue; 28052 } 28053 var fn = opSpec.id; 28054 var numArgs = opSpec.numArgs; 28055 var argsLength = args !== null ? args.length : 0; 28056 if (!opSpec.variableArgs) { 28057 if (argsLength !== numArgs) { 28058 var nonProcessedArgs = this.nonProcessedArgs; 28059 while (argsLength > numArgs) { 28060 nonProcessedArgs.push(args.shift()); 28061 argsLength--; 28062 } 28063 while (argsLength < numArgs && nonProcessedArgs.length !== 0) { 28064 if (args === null) { 28065 args = []; 28066 } 28067 args.unshift(nonProcessedArgs.pop()); 28068 argsLength++; 28069 } 28070 } 28071 if (argsLength < numArgs) { 28072 warn('Skipping command ' + fn + ': expected ' + numArgs + ' args, but received ' + argsLength + ' args.'); 28073 if (args !== null) { 28074 args.length = 0; 28075 } 28076 continue; 28077 } 28078 } else if (argsLength > numArgs) { 28079 info('Command ' + fn + ': expected [0,' + numArgs + '] args, but received ' + argsLength + ' args.'); 28080 } 28081 this.preprocessCommand(fn, args); 28082 operation.fn = fn; 28083 operation.args = args; 28084 return true; 28085 } 28086 if (isEOF(obj)) { 28087 return false; 28088 } 28089 if (obj !== null) { 28090 if (args === null) { 28091 args = []; 28092 } 28093 args.push(obj); 28094 assert(args.length <= 33, 'Too many arguments'); 28095 } 28096 } 28097 }, 28098 preprocessCommand: function EvaluatorPreprocessor_preprocessCommand(fn, args) { 28099 switch (fn | 0) { 28100 case OPS.save: 28101 this.stateManager.save(); 28102 break; 28103 case OPS.restore:
vendor: 74,920 bytes, lines 28104-30530
28104 this.stateManager.restore(); 28105 break; 28106 case OPS.transform: 28107 this.stateManager.transform(args); 28108 break; 28109 } 28110 } 28111 }; 28112 return EvaluatorPreprocessor; 28113}(); 28114var QueueOptimizer = function QueueOptimizerClosure() { 28115 function addState(parentState, pattern, fn) { 28116 var state = parentState; 28117 for (var i = 0, ii = pattern.length - 1; i < ii; i++) { 28118 var item = pattern[i]; 28119 state = state[item] || (state[item] = []); 28120 } 28121 state[pattern[pattern.length - 1]] = fn; 28122 } 28123 function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray) { 28124 var iFirstPIMXO = iFirstSave + 2; 28125 for (var i = 0; i < count; i++) { 28126 var arg = argsArray[iFirstPIMXO + 4 * i]; 28127 var imageMask = arg.length === 1 && arg[0]; 28128 if (imageMask && imageMask.width === 1 && imageMask.height === 1 && (!imageMask.data.length || imageMask.data.length === 1 && imageMask.data[0] === 0)) { 28129 fnArray[iFirstPIMXO + 4 * i] = OPS.paintSolidColorImageMask; 28130 continue; 28131 } 28132 break; 28133 } 28134 return count - i; 28135 } 28136 var InitialState = []; 28137 addState(InitialState, [ 28138 OPS.save, 28139 OPS.transform, 28140 OPS.paintInlineImageXObject, 28141 OPS.restore 28142 ], function foundInlineImageGroup(context) { 28143 var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; 28144 var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; 28145 var MAX_WIDTH = 1000; 28146 var IMAGE_PADDING = 1; 28147 var fnArray = context.fnArray, argsArray = context.argsArray; 28148 var curr = context.iCurr; 28149 var iFirstSave = curr - 3; 28150 var iFirstTransform = curr - 2; 28151 var iFirstPIIXO = curr - 1; 28152 var i = iFirstSave + 4; 28153 var ii = fnArray.length; 28154 while (i + 3 < ii) { 28155 if (fnArray[i] !== OPS.save || fnArray[i + 1] !== OPS.transform || fnArray[i + 2] !== OPS.paintInlineImageXObject || fnArray[i + 3] !== OPS.restore) { 28156 break; 28157 } 28158 i += 4; 28159 } 28160 var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); 28161 if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { 28162 return i; 28163 } 28164 var maxX = 0; 28165 var map = [], maxLineHeight = 0; 28166 var currentX = IMAGE_PADDING, currentY = IMAGE_PADDING; 28167 var q; 28168 for (q = 0; q < count; q++) { 28169 var transform = argsArray[iFirstTransform + (q << 2)]; 28170 var img = argsArray[iFirstPIIXO + (q << 2)][0]; 28171 if (currentX + img.width > MAX_WIDTH) { 28172 maxX = Math.max(maxX, currentX); 28173 currentY += maxLineHeight + 2 * IMAGE_PADDING; 28174 currentX = 0; 28175 maxLineHeight = 0; 28176 } 28177 map.push({ 28178 transform: transform, 28179 x: currentX, 28180 y: currentY, 28181 w: img.width, 28182 h: img.height 28183 }); 28184 currentX += img.width + 2 * IMAGE_PADDING; 28185 maxLineHeight = Math.max(maxLineHeight, img.height); 28186 } 28187 var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; 28188 var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; 28189 var imgData = new Uint8Array(imgWidth * imgHeight * 4); 28190 var imgRowSize = imgWidth << 2; 28191 for (q = 0; q < count; q++) { 28192 var data = argsArray[iFirstPIIXO + (q << 2)][0].data; 28193 var rowSize = map[q].w << 2; 28194 var dataOffset = 0; 28195 var offset = map[q].x + map[q].y * imgWidth << 2; 28196 imgData.set(data.subarray(0, rowSize), offset - imgRowSize); 28197 for (var k = 0, kk = map[q].h; k < kk; k++) { 28198 imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); 28199 dataOffset += rowSize; 28200 offset += imgRowSize; 28201 } 28202 imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); 28203 while (offset >= 0) { 28204 data[offset - 4] = data[offset]; 28205 data[offset - 3] = data[offset + 1]; 28206 data[offset - 2] = data[offset + 2]; 28207 data[offset - 1] = data[offset + 3]; 28208 data[offset + rowSize] = data[offset + rowSize - 4]; 28209 data[offset + rowSize + 1] = data[offset + rowSize - 3]; 28210 data[offset + rowSize + 2] = data[offset + rowSize - 2]; 28211 data[offset + rowSize + 3] = data[offset + rowSize - 1]; 28212 offset -= imgRowSize; 28213 } 28214 } 28215 fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); 28216 argsArray.splice(iFirstSave, count * 4, [ 28217 { 28218 width: imgWidth, 28219 height: imgHeight, 28220 kind: ImageKind.RGBA_32BPP, 28221 data: imgData 28222 }, 28223 map 28224 ]); 28225 return iFirstSave + 1; 28226 }); 28227 addState(InitialState, [ 28228 OPS.save, 28229 OPS.transform, 28230 OPS.paintImageMaskXObject, 28231 OPS.restore 28232 ], function foundImageMaskGroup(context) { 28233 var MIN_IMAGES_IN_MASKS_BLOCK = 10; 28234 var MAX_IMAGES_IN_MASKS_BLOCK = 100; 28235 var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; 28236 var fnArray = context.fnArray, argsArray = context.argsArray; 28237 var curr = context.iCurr; 28238 var iFirstSave = curr - 3; 28239 var iFirstTransform = curr - 2; 28240 var iFirstPIMXO = curr - 1; 28241 var i = iFirstSave + 4; 28242 var ii = fnArray.length; 28243 while (i + 3 < ii) { 28244 if (fnArray[i] !== OPS.save || fnArray[i + 1] !== OPS.transform || fnArray[i + 2] !== OPS.paintImageMaskXObject || fnArray[i + 3] !== OPS.restore) { 28245 break; 28246 } 28247 i += 4; 28248 } 28249 var count = (i - iFirstSave) / 4; 28250 count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray); 28251 if (count < MIN_IMAGES_IN_MASKS_BLOCK) { 28252 return i; 28253 } 28254 var q; 28255 var isSameImage = false; 28256 var iTransform, transformArgs; 28257 var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; 28258 if (argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0) { 28259 isSameImage = true; 28260 var firstTransformArg0 = argsArray[iFirstTransform][0]; 28261 var firstTransformArg3 = argsArray[iFirstTransform][3]; 28262 iTransform = iFirstTransform + 4; 28263 var iPIMXO = iFirstPIMXO + 4; 28264 for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { 28265 transformArgs = argsArray[iTransform]; 28266 if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== 0 || transformArgs[2] !== 0 || transformArgs[3] !== firstTransformArg3) { 28267 if (q < MIN_IMAGES_IN_MASKS_BLOCK) { 28268 isSameImage = false; 28269 } else { 28270 count = q; 28271 } 28272 break; 28273 } 28274 } 28275 } 28276 if (isSameImage) { 28277 count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); 28278 var positions = new Float32Array(count * 2); 28279 iTransform = iFirstTransform; 28280 for (q = 0; q < count; q++, iTransform += 4) { 28281 transformArgs = argsArray[iTransform]; 28282 positions[q << 1] = transformArgs[4]; 28283 positions[(q << 1) + 1] = transformArgs[5]; 28284 } 28285 fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); 28286 argsArray.splice(iFirstSave, count * 4, [ 28287 firstPIMXOArg0, 28288 firstTransformArg0, 28289 firstTransformArg3, 28290 positions 28291 ]); 28292 } else { 28293 count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); 28294 var images = []; 28295 for (q = 0; q < count; q++) { 28296 transformArgs = argsArray[iFirstTransform + (q << 2)]; 28297 var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; 28298 images.push({ 28299 data: maskParams.data, 28300 width: maskParams.width, 28301 height: maskParams.height, 28302 transform: transformArgs 28303 }); 28304 } 28305 fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); 28306 argsArray.splice(iFirstSave, count * 4, [images]); 28307 } 28308 return iFirstSave + 1; 28309 }); 28310 addState(InitialState, [ 28311 OPS.save, 28312 OPS.transform, 28313 OPS.paintImageXObject, 28314 OPS.restore 28315 ], function (context) { 28316 var MIN_IMAGES_IN_BLOCK = 3; 28317 var MAX_IMAGES_IN_BLOCK = 1000; 28318 var fnArray = context.fnArray, argsArray = context.argsArray; 28319 var curr = context.iCurr; 28320 var iFirstSave = curr - 3; 28321 var iFirstTransform = curr - 2; 28322 var iFirstPIXO = curr - 1; 28323 var iFirstRestore = curr; 28324 if (argsArray[iFirstTransform][1] !== 0 || argsArray[iFirstTransform][2] !== 0) { 28325 return iFirstRestore + 1; 28326 } 28327 var firstPIXOArg0 = argsArray[iFirstPIXO][0]; 28328 var firstTransformArg0 = argsArray[iFirstTransform][0]; 28329 var firstTransformArg3 = argsArray[iFirstTransform][3]; 28330 var i = iFirstSave + 4; 28331 var ii = fnArray.length; 28332 while (i + 3 < ii) { 28333 if (fnArray[i] !== OPS.save || fnArray[i + 1] !== OPS.transform || fnArray[i + 2] !== OPS.paintImageXObject || fnArray[i + 3] !== OPS.restore) { 28334 break; 28335 } 28336 if (argsArray[i + 1][0] !== firstTransformArg0 || argsArray[i + 1][1] !== 0 || argsArray[i + 1][2] !== 0 || argsArray[i + 1][3] !== firstTransformArg3) { 28337 break; 28338 } 28339 if (argsArray[i + 2][0] !== firstPIXOArg0) { 28340 break; 28341 } 28342 i += 4; 28343 } 28344 var count = Math.min((i - iFirstSave) / 4, MAX_IMAGES_IN_BLOCK); 28345 if (count < MIN_IMAGES_IN_BLOCK) { 28346 return i; 28347 } 28348 var positions = new Float32Array(count * 2); 28349 var iTransform = iFirstTransform; 28350 for (var q = 0; q < count; q++, iTransform += 4) { 28351 var transformArgs = argsArray[iTransform]; 28352 positions[q << 1] = transformArgs[4]; 28353 positions[(q << 1) + 1] = transformArgs[5]; 28354 } 28355 var args = [ 28356 firstPIXOArg0, 28357 firstTransformArg0, 28358 firstTransformArg3, 28359 positions 28360 ]; 28361 fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); 28362 argsArray.splice(iFirstSave, count * 4, args); 28363 return iFirstSave + 1; 28364 }); 28365 addState(InitialState, [ 28366 OPS.beginText, 28367 OPS.setFont, 28368 OPS.setTextMatrix, 28369 OPS.showText, 28370 OPS.endText 28371 ], function (context) { 28372 var MIN_CHARS_IN_BLOCK = 3; 28373 var MAX_CHARS_IN_BLOCK = 1000; 28374 var fnArray = context.fnArray, argsArray = context.argsArray; 28375 var curr = context.iCurr; 28376 var iFirstBeginText = curr - 4; 28377 var iFirstSetFont = curr - 3; 28378 var iFirstSetTextMatrix = curr - 2; 28379 var iFirstShowText = curr - 1; 28380 var iFirstEndText = curr; 28381 var firstSetFontArg0 = argsArray[iFirstSetFont][0]; 28382 var firstSetFontArg1 = argsArray[iFirstSetFont][1]; 28383 var i = iFirstBeginText + 5; 28384 var ii = fnArray.length; 28385 while (i + 4 < ii) { 28386 if (fnArray[i] !== OPS.beginText || fnArray[i + 1] !== OPS.setFont || fnArray[i + 2] !== OPS.setTextMatrix || fnArray[i + 3] !== OPS.showText || fnArray[i + 4] !== OPS.endText) { 28387 break; 28388 } 28389 if (argsArray[i + 1][0] !== firstSetFontArg0 || argsArray[i + 1][1] !== firstSetFontArg1) { 28390 break; 28391 } 28392 i += 5; 28393 } 28394 var count = Math.min((i - iFirstBeginText) / 5, MAX_CHARS_IN_BLOCK); 28395 if (count < MIN_CHARS_IN_BLOCK) { 28396 return i; 28397 } 28398 var iFirst = iFirstBeginText; 28399 if (iFirstBeginText >= 4 && fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { 28400 count++; 28401 iFirst -= 5; 28402 } 28403 var iEndText = iFirst + 4; 28404 for (var q = 1; q < count; q++) { 28405 fnArray.splice(iEndText, 3); 28406 argsArray.splice(iEndText, 3); 28407 iEndText += 2; 28408 } 28409 return iEndText + 1; 28410 }); 28411 function QueueOptimizer() { 28412 } 28413 QueueOptimizer.prototype = { 28414 optimize: function QueueOptimizer_optimize(queue) { 28415 var fnArray = queue.fnArray, argsArray = queue.argsArray; 28416 var context = { 28417 iCurr: 0, 28418 fnArray: fnArray, 28419 argsArray: argsArray 28420 }; 28421 var state; 28422 var i = 0, ii = fnArray.length; 28423 while (i < ii) { 28424 state = (state || InitialState)[fnArray[i]]; 28425 if (typeof state === 'function') { 28426 context.iCurr = i; 28427 i = state(context); 28428 state = undefined; 28429 ii = context.fnArray.length; 28430 } else { 28431 i++; 28432 } 28433 } 28434 } 28435 }; 28436 return QueueOptimizer; 28437}(); 28438exports.OperatorList = OperatorList; 28439exports.PartialEvaluator = PartialEvaluator; 28440 28441/***/ }), 28442/* 15 */ 28443/***/ (function(module, exports, __w_pdfjs_require__) { 28444 28445"use strict"; 28446 28447var sharedUtil = __w_pdfjs_require__(0); 28448var coreArithmeticDecoder = __w_pdfjs_require__(10); 28449var info = sharedUtil.info; 28450var warn = sharedUtil.warn; 28451var error = sharedUtil.error; 28452var log2 = sharedUtil.log2; 28453var readUint16 = sharedUtil.readUint16; 28454var readUint32 = sharedUtil.readUint32; 28455var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder; 28456var JpxImage = function JpxImageClosure() { 28457 var SubbandsGainLog2 = { 28458 'LL': 0, 28459 'LH': 1, 28460 'HL': 1, 28461 'HH': 2 28462 }; 28463 function JpxImage() { 28464 this.failOnCorruptedImage = false; 28465 } 28466 JpxImage.prototype = { 28467 parse: function JpxImage_parse(data) { 28468 var head = readUint16(data, 0); 28469 if (head === 0xFF4F) { 28470 this.parseCodestream(data, 0, data.length); 28471 return; 28472 } 28473 var position = 0, length = data.length; 28474 while (position < length) { 28475 var headerSize = 8; 28476 var lbox = readUint32(data, position); 28477 var tbox = readUint32(data, position + 4); 28478 position += headerSize; 28479 if (lbox === 1) { 28480 lbox = readUint32(data, position) * 4294967296 + readUint32(data, position + 4); 28481 position += 8; 28482 headerSize += 8; 28483 } 28484 if (lbox === 0) { 28485 lbox = length - position + headerSize; 28486 } 28487 if (lbox < headerSize) { 28488 error('JPX Error: Invalid box field size'); 28489 } 28490 var dataLength = lbox - headerSize; 28491 var jumpDataLength = true; 28492 switch (tbox) { 28493 case 0x6A703268: 28494 jumpDataLength = false; 28495 break; 28496 case 0x636F6C72: 28497 var method = data[position]; 28498 if (method === 1) { 28499 var colorspace = readUint32(data, position + 3); 28500 switch (colorspace) { 28501 case 16: 28502 case 17: 28503 case 18: 28504 break; 28505 default: 28506 warn('Unknown colorspace ' + colorspace); 28507 break; 28508 } 28509 } else if (method === 2) { 28510 info('ICC profile not supported'); 28511 } 28512 break; 28513 case 0x6A703263: 28514 this.parseCodestream(data, position, position + dataLength); 28515 break; 28516 case 0x6A502020: 28517 if (0x0d0a870a !== readUint32(data, position)) { 28518 warn('Invalid JP2 signature'); 28519 } 28520 break; 28521 case 0x6A501A1A: 28522 case 0x66747970: 28523 case 0x72726571: 28524 case 0x72657320: 28525 case 0x69686472: 28526 break; 28527 default: 28528 var headerType = String.fromCharCode(tbox >> 24 & 0xFF, tbox >> 16 & 0xFF, tbox >> 8 & 0xFF, tbox & 0xFF); 28529 warn('Unsupported header type ' + tbox + ' (' + headerType + ')'); 28530 break; 28531 } 28532 if (jumpDataLength) { 28533 position += dataLength; 28534 } 28535 } 28536 }, 28537 parseImageProperties: function JpxImage_parseImageProperties(stream) { 28538 var newByte = stream.getByte(); 28539 while (newByte >= 0) { 28540 var oldByte = newByte; 28541 newByte = stream.getByte(); 28542 var code = oldByte << 8 | newByte; 28543 if (code === 0xFF51) { 28544 stream.skip(4); 28545 var Xsiz = stream.getInt32() >>> 0; 28546 var Ysiz = stream.getInt32() >>> 0; 28547 var XOsiz = stream.getInt32() >>> 0; 28548 var YOsiz = stream.getInt32() >>> 0; 28549 stream.skip(16); 28550 var Csiz = stream.getUint16(); 28551 this.width = Xsiz - XOsiz; 28552 this.height = Ysiz - YOsiz; 28553 this.componentsCount = Csiz; 28554 this.bitsPerComponent = 8; 28555 return; 28556 } 28557 } 28558 error('JPX Error: No size marker found in JPX stream'); 28559 }, 28560 parseCodestream: function JpxImage_parseCodestream(data, start, end) { 28561 var context = {}; 28562 var doNotRecover = false; 28563 try { 28564 var position = start; 28565 while (position + 1 < end) { 28566 var code = readUint16(data, position); 28567 position += 2; 28568 var length = 0, j, sqcd, spqcds, spqcdSize, scalarExpounded, tile; 28569 switch (code) { 28570 case 0xFF4F: 28571 context.mainHeader = true; 28572 break; 28573 case 0xFFD9: 28574 break; 28575 case 0xFF51: 28576 length = readUint16(data, position); 28577 var siz = {}; 28578 siz.Xsiz = readUint32(data, position + 4); 28579 siz.Ysiz = readUint32(data, position + 8); 28580 siz.XOsiz = readUint32(data, position + 12); 28581 siz.YOsiz = readUint32(data, position + 16); 28582 siz.XTsiz = readUint32(data, position + 20); 28583 siz.YTsiz = readUint32(data, position + 24); 28584 siz.XTOsiz = readUint32(data, position + 28); 28585 siz.YTOsiz = readUint32(data, position + 32); 28586 var componentsCount = readUint16(data, position + 36); 28587 siz.Csiz = componentsCount; 28588 var components = []; 28589 j = position + 38; 28590 for (var i = 0; i < componentsCount; i++) { 28591 var component = { 28592 precision: (data[j] & 0x7F) + 1, 28593 isSigned: !!(data[j] & 0x80), 28594 XRsiz: data[j + 1], 28595 YRsiz: data[j + 1] 28596 }; 28597 calculateComponentDimensions(component, siz); 28598 components.push(component); 28599 } 28600 context.SIZ = siz; 28601 context.components = components; 28602 calculateTileGrids(context, components); 28603 context.QCC = []; 28604 context.COC = []; 28605 break; 28606 case 0xFF5C: 28607 length = readUint16(data, position); 28608 var qcd = {}; 28609 j = position + 2; 28610 sqcd = data[j++]; 28611 switch (sqcd & 0x1F) { 28612 case 0: 28613 spqcdSize = 8; 28614 scalarExpounded = true; 28615 break; 28616 case 1: 28617 spqcdSize = 16; 28618 scalarExpounded = false; 28619 break; 28620 case 2: 28621 spqcdSize = 16; 28622 scalarExpounded = true; 28623 break; 28624 default: 28625 throw new Error('Invalid SQcd value ' + sqcd); 28626 } 28627 qcd.noQuantization = spqcdSize === 8; 28628 qcd.scalarExpounded = scalarExpounded; 28629 qcd.guardBits = sqcd >> 5; 28630 spqcds = []; 28631 while (j < length + position) { 28632 var spqcd = {}; 28633 if (spqcdSize === 8) { 28634 spqcd.epsilon = data[j++] >> 3; 28635 spqcd.mu = 0; 28636 } else { 28637 spqcd.epsilon = data[j] >> 3; 28638 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; 28639 j += 2; 28640 } 28641 spqcds.push(spqcd); 28642 } 28643 qcd.SPqcds = spqcds; 28644 if (context.mainHeader) { 28645 context.QCD = qcd; 28646 } else { 28647 context.currentTile.QCD = qcd; 28648 context.currentTile.QCC = []; 28649 } 28650 break; 28651 case 0xFF5D: 28652 length = readUint16(data, position); 28653 var qcc = {}; 28654 j = position + 2; 28655 var cqcc; 28656 if (context.SIZ.Csiz < 257) { 28657 cqcc = data[j++]; 28658 } else { 28659 cqcc = readUint16(data, j); 28660 j += 2; 28661 } 28662 sqcd = data[j++]; 28663 switch (sqcd & 0x1F) { 28664 case 0: 28665 spqcdSize = 8; 28666 scalarExpounded = true; 28667 break; 28668 case 1: 28669 spqcdSize = 16; 28670 scalarExpounded = false; 28671 break; 28672 case 2: 28673 spqcdSize = 16; 28674 scalarExpounded = true; 28675 break; 28676 default: 28677 throw new Error('Invalid SQcd value ' + sqcd); 28678 } 28679 qcc.noQuantization = spqcdSize === 8; 28680 qcc.scalarExpounded = scalarExpounded; 28681 qcc.guardBits = sqcd >> 5; 28682 spqcds = []; 28683 while (j < length + position) { 28684 spqcd = {}; 28685 if (spqcdSize === 8) { 28686 spqcd.epsilon = data[j++] >> 3; 28687 spqcd.mu = 0; 28688 } else { 28689 spqcd.epsilon = data[j] >> 3; 28690 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; 28691 j += 2; 28692 } 28693 spqcds.push(spqcd); 28694 } 28695 qcc.SPqcds = spqcds; 28696 if (context.mainHeader) { 28697 context.QCC[cqcc] = qcc; 28698 } else { 28699 context.currentTile.QCC[cqcc] = qcc; 28700 } 28701 break; 28702 case 0xFF52: 28703 length = readUint16(data, position); 28704 var cod = {}; 28705 j = position + 2; 28706 var scod = data[j++]; 28707 cod.entropyCoderWithCustomPrecincts = !!(scod & 1); 28708 cod.sopMarkerUsed = !!(scod & 2); 28709 cod.ephMarkerUsed = !!(scod & 4); 28710 cod.progressionOrder = data[j++]; 28711 cod.layersCount = readUint16(data, j); 28712 j += 2; 28713 cod.multipleComponentTransform = data[j++]; 28714 cod.decompositionLevelsCount = data[j++]; 28715 cod.xcb = (data[j++] & 0xF) + 2; 28716 cod.ycb = (data[j++] & 0xF) + 2; 28717 var blockStyle = data[j++]; 28718 cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); 28719 cod.resetContextProbabilities = !!(blockStyle & 2); 28720 cod.terminationOnEachCodingPass = !!(blockStyle & 4); 28721 cod.verticalyStripe = !!(blockStyle & 8); 28722 cod.predictableTermination = !!(blockStyle & 16); 28723 cod.segmentationSymbolUsed = !!(blockStyle & 32); 28724 cod.reversibleTransformation = data[j++]; 28725 if (cod.entropyCoderWithCustomPrecincts) { 28726 var precinctsSizes = []; 28727 while (j < length + position) { 28728 var precinctsSize = data[j++]; 28729 precinctsSizes.push({ 28730 PPx: precinctsSize & 0xF, 28731 PPy: precinctsSize >> 4 28732 }); 28733 } 28734 cod.precinctsSizes = precinctsSizes; 28735 } 28736 var unsupported = []; 28737 if (cod.selectiveArithmeticCodingBypass) { 28738 unsupported.push('selectiveArithmeticCodingBypass'); 28739 } 28740 if (cod.resetContextProbabilities) { 28741 unsupported.push('resetContextProbabilities'); 28742 } 28743 if (cod.terminationOnEachCodingPass) { 28744 unsupported.push('terminationOnEachCodingPass'); 28745 } 28746 if (cod.verticalyStripe) { 28747 unsupported.push('verticalyStripe'); 28748 } 28749 if (cod.predictableTermination) { 28750 unsupported.push('predictableTermination'); 28751 } 28752 if (unsupported.length > 0) { 28753 doNotRecover = true; 28754 throw new Error('Unsupported COD options (' + unsupported.join(', ') + ')'); 28755 } 28756 if (context.mainHeader) { 28757 context.COD = cod; 28758 } else { 28759 context.currentTile.COD = cod; 28760 context.currentTile.COC = []; 28761 } 28762 break; 28763 case 0xFF90: 28764 length = readUint16(data, position); 28765 tile = {}; 28766 tile.index = readUint16(data, position + 2); 28767 tile.length = readUint32(data, position + 4); 28768 tile.dataEnd = tile.length + position - 2; 28769 tile.partIndex = data[position + 8]; 28770 tile.partsCount = data[position + 9]; 28771 context.mainHeader = false; 28772 if (tile.partIndex === 0) { 28773 tile.COD = context.COD; 28774 tile.COC = context.COC.slice(0); 28775 tile.QCD = context.QCD; 28776 tile.QCC = context.QCC.slice(0); 28777 } 28778 context.currentTile = tile; 28779 break; 28780 case 0xFF93: 28781 tile = context.currentTile; 28782 if (tile.partIndex === 0) { 28783 initializeTile(context, tile.index); 28784 buildPackets(context); 28785 } 28786 length = tile.dataEnd - position; 28787 parseTilePackets(context, data, position, length); 28788 break; 28789 case 0xFF55: 28790 case 0xFF57: 28791 case 0xFF58: 28792 case 0xFF64: 28793 length = readUint16(data, position); 28794 break; 28795 case 0xFF53: 28796 throw new Error('Codestream code 0xFF53 (COC) is ' + 'not implemented'); 28797 default: 28798 throw new Error('Unknown codestream code: ' + code.toString(16)); 28799 } 28800 position += length; 28801 } 28802 } catch (e) { 28803 if (doNotRecover || this.failOnCorruptedImage) { 28804 error('JPX Error: ' + e.message); 28805 } else { 28806 warn('JPX: Trying to recover from: ' + e.message); 28807 } 28808 } 28809 this.tiles = transformComponents(context); 28810 this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; 28811 this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; 28812 this.componentsCount = context.SIZ.Csiz; 28813 } 28814 }; 28815 function calculateComponentDimensions(component, siz) { 28816 component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); 28817 component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); 28818 component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); 28819 component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); 28820 component.width = component.x1 - component.x0; 28821 component.height = component.y1 - component.y0; 28822 } 28823 function calculateTileGrids(context, components) { 28824 var siz = context.SIZ; 28825 var tile, tiles = []; 28826 var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); 28827 var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); 28828 for (var q = 0; q < numYtiles; q++) { 28829 for (var p = 0; p < numXtiles; p++) { 28830 tile = {}; 28831 tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); 28832 tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); 28833 tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); 28834 tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); 28835 tile.width = tile.tx1 - tile.tx0; 28836 tile.height = tile.ty1 - tile.ty0; 28837 tile.components = []; 28838 tiles.push(tile); 28839 } 28840 } 28841 context.tiles = tiles; 28842 var componentsCount = siz.Csiz; 28843 for (var i = 0, ii = componentsCount; i < ii; i++) { 28844 var component = components[i]; 28845 for (var j = 0, jj = tiles.length; j < jj; j++) { 28846 var tileComponent = {}; 28847 tile = tiles[j]; 28848 tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); 28849 tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); 28850 tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); 28851 tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); 28852 tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; 28853 tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; 28854 tile.components[i] = tileComponent; 28855 } 28856 } 28857 } 28858 function getBlocksDimensions(context, component, r) { 28859 var codOrCoc = component.codingStyleParameters; 28860 var result = {}; 28861 if (!codOrCoc.entropyCoderWithCustomPrecincts) { 28862 result.PPx = 15; 28863 result.PPy = 15; 28864 } else { 28865 result.PPx = codOrCoc.precinctsSizes[r].PPx; 28866 result.PPy = codOrCoc.precinctsSizes[r].PPy; 28867 } 28868 result.xcb_ = r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : Math.min(codOrCoc.xcb, result.PPx); 28869 result.ycb_ = r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : Math.min(codOrCoc.ycb, result.PPy); 28870 return result; 28871 } 28872 function buildPrecincts(context, resolution, dimensions) { 28873 var precinctWidth = 1 << dimensions.PPx; 28874 var precinctHeight = 1 << dimensions.PPy; 28875 var isZeroRes = resolution.resLevel === 0; 28876 var precinctWidthInSubband = 1 << dimensions.PPx + (isZeroRes ? 0 : -1); 28877 var precinctHeightInSubband = 1 << dimensions.PPy + (isZeroRes ? 0 : -1); 28878 var numprecinctswide = resolution.trx1 > resolution.trx0 ? Math.ceil(resolution.trx1 / precinctWidth) - Math.floor(resolution.trx0 / precinctWidth) : 0; 28879 var numprecinctshigh = resolution.try1 > resolution.try0 ? Math.ceil(resolution.try1 / precinctHeight) - Math.floor(resolution.try0 / precinctHeight) : 0; 28880 var numprecincts = numprecinctswide * numprecinctshigh; 28881 resolution.precinctParameters = { 28882 precinctWidth: precinctWidth, 28883 precinctHeight: precinctHeight, 28884 numprecinctswide: numprecinctswide, 28885 numprecinctshigh: numprecinctshigh, 28886 numprecincts: numprecincts, 28887 precinctWidthInSubband: precinctWidthInSubband, 28888 precinctHeightInSubband: precinctHeightInSubband 28889 }; 28890 } 28891 function buildCodeblocks(context, subband, dimensions) { 28892 var xcb_ = dimensions.xcb_; 28893 var ycb_ = dimensions.ycb_; 28894 var codeblockWidth = 1 << xcb_; 28895 var codeblockHeight = 1 << ycb_; 28896 var cbx0 = subband.tbx0 >> xcb_; 28897 var cby0 = subband.tby0 >> ycb_; 28898 var cbx1 = subband.tbx1 + codeblockWidth - 1 >> xcb_; 28899 var cby1 = subband.tby1 + codeblockHeight - 1 >> ycb_; 28900 var precinctParameters = subband.resolution.precinctParameters; 28901 var codeblocks = []; 28902 var precincts = []; 28903 var i, j, codeblock, precinctNumber; 28904 for (j = cby0; j < cby1; j++) { 28905 for (i = cbx0; i < cbx1; i++) { 28906 codeblock = { 28907 cbx: i, 28908 cby: j, 28909 tbx0: codeblockWidth * i, 28910 tby0: codeblockHeight * j, 28911 tbx1: codeblockWidth * (i + 1), 28912 tby1: codeblockHeight * (j + 1) 28913 }; 28914 codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); 28915 codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); 28916 codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); 28917 codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); 28918 var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / precinctParameters.precinctWidthInSubband); 28919 var pj = Math.floor((codeblock.tby0_ - subband.tby0) / precinctParameters.precinctHeightInSubband); 28920 precinctNumber = pi + pj * precinctParameters.numprecinctswide; 28921 codeblock.precinctNumber = precinctNumber; 28922 codeblock.subbandType = subband.type; 28923 codeblock.Lblock = 3; 28924 if (codeblock.tbx1_ <= codeblock.tbx0_ || codeblock.tby1_ <= codeblock.tby0_) { 28925 continue; 28926 } 28927 codeblocks.push(codeblock); 28928 var precinct = precincts[precinctNumber]; 28929 if (precinct !== undefined) { 28930 if (i < precinct.cbxMin) { 28931 precinct.cbxMin = i; 28932 } else if (i > precinct.cbxMax) { 28933 precinct.cbxMax = i; 28934 } 28935 if (j < precinct.cbyMin) { 28936 precinct.cbxMin = j; 28937 } else if (j > precinct.cbyMax) { 28938 precinct.cbyMax = j; 28939 } 28940 } else { 28941 precincts[precinctNumber] = precinct = { 28942 cbxMin: i, 28943 cbyMin: j, 28944 cbxMax: i, 28945 cbyMax: j 28946 }; 28947 } 28948 codeblock.precinct = precinct; 28949 } 28950 } 28951 subband.codeblockParameters = { 28952 codeblockWidth: xcb_, 28953 codeblockHeight: ycb_, 28954 numcodeblockwide: cbx1 - cbx0 + 1, 28955 numcodeblockhigh: cby1 - cby0 + 1 28956 }; 28957 subband.codeblocks = codeblocks; 28958 subband.precincts = precincts; 28959 } 28960 function createPacket(resolution, precinctNumber, layerNumber) { 28961 var precinctCodeblocks = []; 28962 var subbands = resolution.subbands; 28963 for (var i = 0, ii = subbands.length; i < ii; i++) { 28964 var subband = subbands[i]; 28965 var codeblocks = subband.codeblocks; 28966 for (var j = 0, jj = codeblocks.length; j < jj; j++) { 28967 var codeblock = codeblocks[j]; 28968 if (codeblock.precinctNumber !== precinctNumber) { 28969 continue; 28970 } 28971 precinctCodeblocks.push(codeblock); 28972 } 28973 } 28974 return { 28975 layerNumber: layerNumber, 28976 codeblocks: precinctCodeblocks 28977 }; 28978 } 28979 function LayerResolutionComponentPositionIterator(context) { 28980 var siz = context.SIZ; 28981 var tileIndex = context.currentTile.index; 28982 var tile = context.tiles[tileIndex]; 28983 var layersCount = tile.codingStyleDefaultParameters.layersCount; 28984 var componentsCount = siz.Csiz; 28985 var maxDecompositionLevelsCount = 0; 28986 for (var q = 0; q < componentsCount; q++) { 28987 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 28988 } 28989 var l = 0, r = 0, i = 0, k = 0; 28990 this.nextPacket = function JpxImage_nextPacket() { 28991 for (; l < layersCount; l++) { 28992 for (; r <= maxDecompositionLevelsCount; r++) { 28993 for (; i < componentsCount; i++) { 28994 var component = tile.components[i]; 28995 if (r > component.codingStyleParameters.decompositionLevelsCount) { 28996 continue; 28997 } 28998 var resolution = component.resolutions[r]; 28999 var numprecincts = resolution.precinctParameters.numprecincts; 29000 for (; k < numprecincts;) { 29001 var packet = createPacket(resolution, k, l); 29002 k++; 29003 return packet; 29004 } 29005 k = 0; 29006 } 29007 i = 0; 29008 } 29009 r = 0; 29010 } 29011 error('JPX Error: Out of packets'); 29012 }; 29013 } 29014 function ResolutionLayerComponentPositionIterator(context) { 29015 var siz = context.SIZ; 29016 var tileIndex = context.currentTile.index; 29017 var tile = context.tiles[tileIndex]; 29018 var layersCount = tile.codingStyleDefaultParameters.layersCount; 29019 var componentsCount = siz.Csiz; 29020 var maxDecompositionLevelsCount = 0; 29021 for (var q = 0; q < componentsCount; q++) { 29022 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 29023 } 29024 var r = 0, l = 0, i = 0, k = 0; 29025 this.nextPacket = function JpxImage_nextPacket() { 29026 for (; r <= maxDecompositionLevelsCount; r++) { 29027 for (; l < layersCount; l++) { 29028 for (; i < componentsCount; i++) { 29029 var component = tile.components[i]; 29030 if (r > component.codingStyleParameters.decompositionLevelsCount) { 29031 continue; 29032 } 29033 var resolution = component.resolutions[r]; 29034 var numprecincts = resolution.precinctParameters.numprecincts; 29035 for (; k < numprecincts;) { 29036 var packet = createPacket(resolution, k, l); 29037 k++; 29038 return packet; 29039 } 29040 k = 0; 29041 } 29042 i = 0; 29043 } 29044 l = 0; 29045 } 29046 error('JPX Error: Out of packets'); 29047 }; 29048 } 29049 function ResolutionPositionComponentLayerIterator(context) { 29050 var siz = context.SIZ; 29051 var tileIndex = context.currentTile.index; 29052 var tile = context.tiles[tileIndex]; 29053 var layersCount = tile.codingStyleDefaultParameters.layersCount; 29054 var componentsCount = siz.Csiz; 29055 var l, r, c, p; 29056 var maxDecompositionLevelsCount = 0; 29057 for (c = 0; c < componentsCount; c++) { 29058 var component = tile.components[c]; 29059 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, component.codingStyleParameters.decompositionLevelsCount); 29060 } 29061 var maxNumPrecinctsInLevel = new Int32Array(maxDecompositionLevelsCount + 1); 29062 for (r = 0; r <= maxDecompositionLevelsCount; ++r) { 29063 var maxNumPrecincts = 0; 29064 for (c = 0; c < componentsCount; ++c) { 29065 var resolutions = tile.components[c].resolutions; 29066 if (r < resolutions.length) { 29067 maxNumPrecincts = Math.max(maxNumPrecincts, resolutions[r].precinctParameters.numprecincts); 29068 } 29069 } 29070 maxNumPrecinctsInLevel[r] = maxNumPrecincts; 29071 } 29072 l = 0; 29073 r = 0; 29074 c = 0; 29075 p = 0; 29076 this.nextPacket = function JpxImage_nextPacket() { 29077 for (; r <= maxDecompositionLevelsCount; r++) { 29078 for (; p < maxNumPrecinctsInLevel[r]; p++) { 29079 for (; c < componentsCount; c++) { 29080 var component = tile.components[c]; 29081 if (r > component.codingStyleParameters.decompositionLevelsCount) { 29082 continue; 29083 } 29084 var resolution = component.resolutions[r]; 29085 var numprecincts = resolution.precinctParameters.numprecincts; 29086 if (p >= numprecincts) { 29087 continue; 29088 } 29089 for (; l < layersCount;) { 29090 var packet = createPacket(resolution, p, l); 29091 l++; 29092 return packet; 29093 } 29094 l = 0; 29095 } 29096 c = 0; 29097 } 29098 p = 0; 29099 } 29100 error('JPX Error: Out of packets'); 29101 }; 29102 } 29103 function PositionComponentResolutionLayerIterator(context) { 29104 var siz = context.SIZ; 29105 var tileIndex = context.currentTile.index; 29106 var tile = context.tiles[tileIndex]; 29107 var layersCount = tile.codingStyleDefaultParameters.layersCount; 29108 var componentsCount = siz.Csiz; 29109 var precinctsSizes = getPrecinctSizesInImageScale(tile); 29110 var precinctsIterationSizes = precinctsSizes; 29111 var l = 0, r = 0, c = 0, px = 0, py = 0; 29112 this.nextPacket = function JpxImage_nextPacket() { 29113 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 29114 for (; px < precinctsIterationSizes.maxNumWide; px++) { 29115 for (; c < componentsCount; c++) { 29116 var component = tile.components[c]; 29117 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 29118 for (; r <= decompositionLevelsCount; r++) { 29119 var resolution = component.resolutions[r]; 29120 var sizeInImageScale = precinctsSizes.components[c].resolutions[r]; 29121 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 29122 if (k === null) { 29123 continue; 29124 } 29125 for (; l < layersCount;) { 29126 var packet = createPacket(resolution, k, l); 29127 l++; 29128 return packet; 29129 } 29130 l = 0; 29131 } 29132 r = 0; 29133 } 29134 c = 0; 29135 } 29136 px = 0; 29137 } 29138 error('JPX Error: Out of packets'); 29139 }; 29140 } 29141 function ComponentPositionResolutionLayerIterator(context) { 29142 var siz = context.SIZ; 29143 var tileIndex = context.currentTile.index; 29144 var tile = context.tiles[tileIndex]; 29145 var layersCount = tile.codingStyleDefaultParameters.layersCount; 29146 var componentsCount = siz.Csiz; 29147 var precinctsSizes = getPrecinctSizesInImageScale(tile); 29148 var l = 0, r = 0, c = 0, px = 0, py = 0; 29149 this.nextPacket = function JpxImage_nextPacket() { 29150 for (; c < componentsCount; ++c) { 29151 var component = tile.components[c]; 29152 var precinctsIterationSizes = precinctsSizes.components[c]; 29153 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 29154 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 29155 for (; px < precinctsIterationSizes.maxNumWide; px++) { 29156 for (; r <= decompositionLevelsCount; r++) { 29157 var resolution = component.resolutions[r]; 29158 var sizeInImageScale = precinctsIterationSizes.resolutions[r]; 29159 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 29160 if (k === null) { 29161 continue; 29162 } 29163 for (; l < layersCount;) { 29164 var packet = createPacket(resolution, k, l); 29165 l++; 29166 return packet; 29167 } 29168 l = 0; 29169 } 29170 r = 0; 29171 } 29172 px = 0; 29173 } 29174 py = 0; 29175 } 29176 error('JPX Error: Out of packets'); 29177 }; 29178 } 29179 function getPrecinctIndexIfExist(pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { 29180 var posX = pxIndex * precinctIterationSizes.minWidth; 29181 var posY = pyIndex * precinctIterationSizes.minHeight; 29182 if (posX % sizeInImageScale.width !== 0 || posY % sizeInImageScale.height !== 0) { 29183 return null; 29184 } 29185 var startPrecinctRowIndex = posY / sizeInImageScale.width * resolution.precinctParameters.numprecinctswide; 29186 return posX / sizeInImageScale.height + startPrecinctRowIndex; 29187 } 29188 function getPrecinctSizesInImageScale(tile) { 29189 var componentsCount = tile.components.length; 29190 var minWidth = Number.MAX_VALUE; 29191 var minHeight = Number.MAX_VALUE; 29192 var maxNumWide = 0; 29193 var maxNumHigh = 0; 29194 var sizePerComponent = new Array(componentsCount); 29195 for (var c = 0; c < componentsCount; c++) { 29196 var component = tile.components[c]; 29197 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 29198 var sizePerResolution = new Array(decompositionLevelsCount + 1); 29199 var minWidthCurrentComponent = Number.MAX_VALUE; 29200 var minHeightCurrentComponent = Number.MAX_VALUE; 29201 var maxNumWideCurrentComponent = 0; 29202 var maxNumHighCurrentComponent = 0; 29203 var scale = 1; 29204 for (var r = decompositionLevelsCount; r >= 0; --r) { 29205 var resolution = component.resolutions[r]; 29206 var widthCurrentResolution = scale * resolution.precinctParameters.precinctWidth; 29207 var heightCurrentResolution = scale * resolution.precinctParameters.precinctHeight; 29208 minWidthCurrentComponent = Math.min(minWidthCurrentComponent, widthCurrentResolution); 29209 minHeightCurrentComponent = Math.min(minHeightCurrentComponent, heightCurrentResolution); 29210 maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, resolution.precinctParameters.numprecinctswide); 29211 maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, resolution.precinctParameters.numprecinctshigh); 29212 sizePerResolution[r] = { 29213 width: widthCurrentResolution, 29214 height: heightCurrentResolution 29215 }; 29216 scale <<= 1; 29217 } 29218 minWidth = Math.min(minWidth, minWidthCurrentComponent); 29219 minHeight = Math.min(minHeight, minHeightCurrentComponent); 29220 maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); 29221 maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); 29222 sizePerComponent[c] = { 29223 resolutions: sizePerResolution, 29224 minWidth: minWidthCurrentComponent, 29225 minHeight: minHeightCurrentComponent, 29226 maxNumWide: maxNumWideCurrentComponent, 29227 maxNumHigh: maxNumHighCurrentComponent 29228 }; 29229 } 29230 return { 29231 components: sizePerComponent, 29232 minWidth: minWidth, 29233 minHeight: minHeight, 29234 maxNumWide: maxNumWide, 29235 maxNumHigh: maxNumHigh 29236 }; 29237 } 29238 function buildPackets(context) { 29239 var siz = context.SIZ; 29240 var tileIndex = context.currentTile.index; 29241 var tile = context.tiles[tileIndex]; 29242 var componentsCount = siz.Csiz; 29243 for (var c = 0; c < componentsCount; c++) { 29244 var component = tile.components[c]; 29245 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 29246 var resolutions = []; 29247 var subbands = []; 29248 for (var r = 0; r <= decompositionLevelsCount; r++) { 29249 var blocksDimensions = getBlocksDimensions(context, component, r); 29250 var resolution = {}; 29251 var scale = 1 << decompositionLevelsCount - r; 29252 resolution.trx0 = Math.ceil(component.tcx0 / scale); 29253 resolution.try0 = Math.ceil(component.tcy0 / scale); 29254 resolution.trx1 = Math.ceil(component.tcx1 / scale); 29255 resolution.try1 = Math.ceil(component.tcy1 / scale); 29256 resolution.resLevel = r; 29257 buildPrecincts(context, resolution, blocksDimensions); 29258 resolutions.push(resolution); 29259 var subband; 29260 if (r === 0) { 29261 subband = {}; 29262 subband.type = 'LL'; 29263 subband.tbx0 = Math.ceil(component.tcx0 / scale); 29264 subband.tby0 = Math.ceil(component.tcy0 / scale); 29265 subband.tbx1 = Math.ceil(component.tcx1 / scale); 29266 subband.tby1 = Math.ceil(component.tcy1 / scale); 29267 subband.resolution = resolution; 29268 buildCodeblocks(context, subband, blocksDimensions); 29269 subbands.push(subband); 29270 resolution.subbands = [subband]; 29271 } else { 29272 var bscale = 1 << decompositionLevelsCount - r + 1; 29273 var resolutionSubbands = []; 29274 subband = {}; 29275 subband.type = 'HL'; 29276 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 29277 subband.tby0 = Math.ceil(component.tcy0 / bscale); 29278 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 29279 subband.tby1 = Math.ceil(component.tcy1 / bscale); 29280 subband.resolution = resolution; 29281 buildCodeblocks(context, subband, blocksDimensions); 29282 subbands.push(subband); 29283 resolutionSubbands.push(subband); 29284 subband = {}; 29285 subband.type = 'LH'; 29286 subband.tbx0 = Math.ceil(component.tcx0 / bscale); 29287 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 29288 subband.tbx1 = Math.ceil(component.tcx1 / bscale); 29289 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 29290 subband.resolution = resolution; 29291 buildCodeblocks(context, subband, blocksDimensions); 29292 subbands.push(subband); 29293 resolutionSubbands.push(subband); 29294 subband = {}; 29295 subband.type = 'HH'; 29296 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 29297 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 29298 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 29299 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 29300 subband.resolution = resolution; 29301 buildCodeblocks(context, subband, blocksDimensions); 29302 subbands.push(subband); 29303 resolutionSubbands.push(subband); 29304 resolution.subbands = resolutionSubbands; 29305 } 29306 } 29307 component.resolutions = resolutions; 29308 component.subbands = subbands; 29309 } 29310 var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; 29311 switch (progressionOrder) { 29312 case 0: 29313 tile.packetsIterator = new LayerResolutionComponentPositionIterator(context); 29314 break; 29315 case 1: 29316 tile.packetsIterator = new ResolutionLayerComponentPositionIterator(context); 29317 break; 29318 case 2: 29319 tile.packetsIterator = new ResolutionPositionComponentLayerIterator(context); 29320 break; 29321 case 3: 29322 tile.packetsIterator = new PositionComponentResolutionLayerIterator(context); 29323 break; 29324 case 4: 29325 tile.packetsIterator = new ComponentPositionResolutionLayerIterator(context); 29326 break; 29327 default: 29328 error('JPX Error: Unsupported progression order ' + progressionOrder); 29329 } 29330 } 29331 function parseTilePackets(context, data, offset, dataLength) { 29332 var position = 0; 29333 var buffer, bufferSize = 0, skipNextBit = false; 29334 function readBits(count) { 29335 while (bufferSize < count) { 29336 var b = data[offset + position]; 29337 position++; 29338 if (skipNextBit) { 29339 buffer = buffer << 7 | b; 29340 bufferSize += 7; 29341 skipNextBit = false; 29342 } else { 29343 buffer = buffer << 8 | b; 29344 bufferSize += 8; 29345 } 29346 if (b === 0xFF) { 29347 skipNextBit = true; 29348 } 29349 } 29350 bufferSize -= count; 29351 return buffer >>> bufferSize & (1 << count) - 1; 29352 } 29353 function skipMarkerIfEqual(value) { 29354 if (data[offset + position - 1] === 0xFF && data[offset + position] === value) { 29355 skipBytes(1); 29356 return true; 29357 } else if (data[offset + position] === 0xFF && data[offset + position + 1] === value) { 29358 skipBytes(2); 29359 return true; 29360 } 29361 return false; 29362 } 29363 function skipBytes(count) { 29364 position += count; 29365 } 29366 function alignToByte() { 29367 bufferSize = 0; 29368 if (skipNextBit) { 29369 position++; 29370 skipNextBit = false; 29371 } 29372 } 29373 function readCodingpasses() { 29374 if (readBits(1) === 0) { 29375 return 1; 29376 } 29377 if (readBits(1) === 0) { 29378 return 2; 29379 } 29380 var value = readBits(2); 29381 if (value < 3) { 29382 return value + 3; 29383 } 29384 value = readBits(5); 29385 if (value < 31) { 29386 return value + 6; 29387 } 29388 value = readBits(7); 29389 return value + 37; 29390 } 29391 var tileIndex = context.currentTile.index; 29392 var tile = context.tiles[tileIndex]; 29393 var sopMarkerUsed = context.COD.sopMarkerUsed; 29394 var ephMarkerUsed = context.COD.ephMarkerUsed; 29395 var packetsIterator = tile.packetsIterator; 29396 while (position < dataLength) { 29397 alignToByte(); 29398 if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { 29399 skipBytes(4); 29400 } 29401 var packet = packetsIterator.nextPacket(); 29402 if (!readBits(1)) { 29403 continue; 29404 } 29405 var layerNumber = packet.layerNumber; 29406 var queue = [], codeblock; 29407 for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { 29408 codeblock = packet.codeblocks[i]; 29409 var precinct = codeblock.precinct; 29410 var codeblockColumn = codeblock.cbx - precinct.cbxMin; 29411 var codeblockRow = codeblock.cby - precinct.cbyMin; 29412 var codeblockIncluded = false; 29413 var firstTimeInclusion = false; 29414 var valueReady; 29415 if (codeblock['included'] !== undefined) { 29416 codeblockIncluded = !!readBits(1); 29417 } else { 29418 precinct = codeblock.precinct; 29419 var inclusionTree, zeroBitPlanesTree; 29420 if (precinct['inclusionTree'] !== undefined) { 29421 inclusionTree = precinct.inclusionTree; 29422 } else { 29423 var width = precinct.cbxMax - precinct.cbxMin + 1; 29424 var height = precinct.cbyMax - precinct.cbyMin + 1; 29425 inclusionTree = new InclusionTree(width, height, layerNumber); 29426 zeroBitPlanesTree = new TagTree(width, height); 29427 precinct.inclusionTree = inclusionTree; 29428 precinct.zeroBitPlanesTree = zeroBitPlanesTree; 29429 } 29430 if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { 29431 while (true) { 29432 if (readBits(1)) { 29433 valueReady = !inclusionTree.nextLevel(); 29434 if (valueReady) { 29435 codeblock.included = true; 29436 codeblockIncluded = firstTimeInclusion = true; 29437 break; 29438 } 29439 } else { 29440 inclusionTree.incrementValue(layerNumber); 29441 break; 29442 } 29443 } 29444 } 29445 } 29446 if (!codeblockIncluded) { 29447 continue; 29448 } 29449 if (firstTimeInclusion) { 29450 zeroBitPlanesTree = precinct.zeroBitPlanesTree; 29451 zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); 29452 while (true) { 29453 if (readBits(1)) { 29454 valueReady = !zeroBitPlanesTree.nextLevel(); 29455 if (valueReady) { 29456 break; 29457 } 29458 } else { 29459 zeroBitPlanesTree.incrementValue(); 29460 } 29461 } 29462 codeblock.zeroBitPlanes = zeroBitPlanesTree.value; 29463 } 29464 var codingpasses = readCodingpasses(); 29465 while (readBits(1)) { 29466 codeblock.Lblock++; 29467 } 29468 var codingpassesLog2 = log2(codingpasses); 29469 var bits = (codingpasses < 1 << codingpassesLog2 ? codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; 29470 var codedDataLength = readBits(bits); 29471 queue.push({ 29472 codeblock: codeblock, 29473 codingpasses: codingpasses, 29474 dataLength: codedDataLength 29475 }); 29476 } 29477 alignToByte(); 29478 if (ephMarkerUsed) { 29479 skipMarkerIfEqual(0x92); 29480 } 29481 while (queue.length > 0) { 29482 var packetItem = queue.shift(); 29483 codeblock = packetItem.codeblock; 29484 if (codeblock['data'] === undefined) { 29485 codeblock.data = []; 29486 } 29487 codeblock.data.push({ 29488 data: data, 29489 start: offset + position, 29490 end: offset + position + packetItem.dataLength, 29491 codingpasses: packetItem.codingpasses 29492 }); 29493 position += packetItem.dataLength; 29494 } 29495 } 29496 return position; 29497 } 29498 function copyCoefficients(coefficients, levelWidth, levelHeight, subband, delta, mb, reversible, segmentationSymbolUsed) { 29499 var x0 = subband.tbx0; 29500 var y0 = subband.tby0; 29501 var width = subband.tbx1 - subband.tbx0; 29502 var codeblocks = subband.codeblocks; 29503 var right = subband.type.charAt(0) === 'H' ? 1 : 0; 29504 var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; 29505 for (var i = 0, ii = codeblocks.length; i < ii; ++i) { 29506 var codeblock = codeblocks[i]; 29507 var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; 29508 var blockHeight = codeblock.tby1_ - codeblock.tby0_; 29509 if (blockWidth === 0 || blockHeight === 0) { 29510 continue; 29511 } 29512 if (codeblock['data'] === undefined) { 29513 continue; 29514 } 29515 var bitModel, currentCodingpassType; 29516 bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, codeblock.zeroBitPlanes, mb); 29517 currentCodingpassType = 2; 29518 var data = codeblock.data, totalLength = 0, codingpasses = 0; 29519 var j, jj, dataItem; 29520 for (j = 0, jj = data.length; j < jj; j++) { 29521 dataItem = data[j]; 29522 totalLength += dataItem.end - dataItem.start; 29523 codingpasses += dataItem.codingpasses; 29524 } 29525 var encodedData = new Uint8Array(totalLength); 29526 var position = 0; 29527 for (j = 0, jj = data.length; j < jj; j++) { 29528 dataItem = data[j]; 29529 var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); 29530 encodedData.set(chunk, position); 29531 position += chunk.length; 29532 } 29533 var decoder = new ArithmeticDecoder(encodedData, 0, totalLength); 29534 bitModel.setDecoder(decoder); 29535 for (j = 0; j < codingpasses; j++) { 29536 switch (currentCodingpassType) { 29537 case 0: 29538 bitModel.runSignificancePropagationPass(); 29539 break; 29540 case 1: 29541 bitModel.runMagnitudeRefinementPass(); 29542 break; 29543 case 2: 29544 bitModel.runCleanupPass(); 29545 if (segmentationSymbolUsed) { 29546 bitModel.checkSegmentationSymbol(); 29547 } 29548 break; 29549 } 29550 currentCodingpassType = (currentCodingpassType + 1) % 3; 29551 } 29552 var offset = codeblock.tbx0_ - x0 + (codeblock.tby0_ - y0) * width; 29553 var sign = bitModel.coefficentsSign; 29554 var magnitude = bitModel.coefficentsMagnitude; 29555 var bitsDecoded = bitModel.bitsDecoded; 29556 var magnitudeCorrection = reversible ? 0 : 0.5; 29557 var k, n, nb; 29558 position = 0; 29559 var interleave = subband.type !== 'LL'; 29560 for (j = 0; j < blockHeight; j++) { 29561 var row = offset / width | 0; 29562 var levelOffset = 2 * row * (levelWidth - width) + right + bottom; 29563 for (k = 0; k < blockWidth; k++) { 29564 n = magnitude[position]; 29565 if (n !== 0) { 29566 n = (n + magnitudeCorrection) * delta; 29567 if (sign[position] !== 0) { 29568 n = -n; 29569 } 29570 nb = bitsDecoded[position]; 29571 var pos = interleave ? levelOffset + (offset << 1) : offset; 29572 if (reversible && nb >= mb) { 29573 coefficients[pos] = n; 29574 } else { 29575 coefficients[pos] = n * (1 << mb - nb); 29576 } 29577 } 29578 offset++; 29579 position++; 29580 } 29581 offset += width - blockWidth; 29582 } 29583 } 29584 } 29585 function transformTile(context, tile, c) { 29586 var component = tile.components[c]; 29587 var codingStyleParameters = component.codingStyleParameters; 29588 var quantizationParameters = component.quantizationParameters; 29589 var decompositionLevelsCount = codingStyleParameters.decompositionLevelsCount; 29590 var spqcds = quantizationParameters.SPqcds; 29591 var scalarExpounded = quantizationParameters.scalarExpounded; 29592 var guardBits = quantizationParameters.guardBits; 29593 var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; 29594 var precision = context.components[c].precision; 29595 var reversible = codingStyleParameters.reversibleTransformation; 29596 var transform = reversible ? new ReversibleTransform() : new IrreversibleTransform(); 29597 var subbandCoefficients = []; 29598 var b = 0; 29599 for (var i = 0; i <= decompositionLevelsCount; i++) { 29600 var resolution = component.resolutions[i]; 29601 var width = resolution.trx1 - resolution.trx0; 29602 var height = resolution.try1 - resolution.try0; 29603 var coefficients = new Float32Array(width * height); 29604 for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { 29605 var mu, epsilon; 29606 if (!scalarExpounded) { 29607 mu = spqcds[0].mu; 29608 epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); 29609 } else { 29610 mu = spqcds[b].mu; 29611 epsilon = spqcds[b].epsilon; 29612 b++; 29613 } 29614 var subband = resolution.subbands[j]; 29615 var gainLog2 = SubbandsGainLog2[subband.type]; 29616 var delta = reversible ? 1 : Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048); 29617 var mb = guardBits + epsilon - 1; 29618 copyCoefficients(coefficients, width, height, subband, delta, mb, reversible, segmentationSymbolUsed); 29619 } 29620 subbandCoefficients.push({ 29621 width: width, 29622 height: height, 29623 items: coefficients 29624 }); 29625 } 29626 var result = transform.calculate(subbandCoefficients, component.tcx0, component.tcy0); 29627 return { 29628 left: component.tcx0, 29629 top: component.tcy0, 29630 width: result.width, 29631 height: result.height, 29632 items: result.items 29633 }; 29634 } 29635 function transformComponents(context) { 29636 var siz = context.SIZ; 29637 var components = context.components; 29638 var componentsCount = siz.Csiz; 29639 var resultImages = []; 29640 for (var i = 0, ii = context.tiles.length; i < ii; i++) { 29641 var tile = context.tiles[i]; 29642 var transformedTiles = []; 29643 var c; 29644 for (c = 0; c < componentsCount; c++) { 29645 transformedTiles[c] = transformTile(context, tile, c); 29646 } 29647 var tile0 = transformedTiles[0]; 29648 var out = new Uint8Array(tile0.items.length * componentsCount); 29649 var result = { 29650 left: tile0.left, 29651 top: tile0.top, 29652 width: tile0.width, 29653 height: tile0.height, 29654 items: out 29655 }; 29656 var shift, offset, max, min, maxK; 29657 var pos = 0, j, jj, y0, y1, y2, r, g, b, k, val; 29658 if (tile.codingStyleDefaultParameters.multipleComponentTransform) { 29659 var fourComponents = componentsCount === 4; 29660 var y0items = transformedTiles[0].items; 29661 var y1items = transformedTiles[1].items; 29662 var y2items = transformedTiles[2].items; 29663 var y3items = fourComponents ? transformedTiles[3].items : null; 29664 shift = components[0].precision - 8; 29665 offset = (128 << shift) + 0.5; 29666 max = 255 * (1 << shift); 29667 maxK = max * 0.5; 29668 min = -maxK; 29669 var component0 = tile.components[0]; 29670 var alpha01 = componentsCount - 3; 29671 jj = y0items.length; 29672 if (!component0.codingStyleParameters.reversibleTransformation) { 29673 for (j = 0; j < jj; j++, pos += alpha01) { 29674 y0 = y0items[j] + offset; 29675 y1 = y1items[j]; 29676 y2 = y2items[j]; 29677 r = y0 + 1.402 * y2; 29678 g = y0 - 0.34413 * y1 - 0.71414 * y2; 29679 b = y0 + 1.772 * y1; 29680 out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; 29681 out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; 29682 out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; 29683 } 29684 } else { 29685 for (j = 0; j < jj; j++, pos += alpha01) { 29686 y0 = y0items[j] + offset; 29687 y1 = y1items[j]; 29688 y2 = y2items[j]; 29689 g = y0 - (y2 + y1 >> 2); 29690 r = g + y2; 29691 b = g + y1; 29692 out[pos++] = r <= 0 ? 0 : r >= max ? 255 : r >> shift; 29693 out[pos++] = g <= 0 ? 0 : g >= max ? 255 : g >> shift; 29694 out[pos++] = b <= 0 ? 0 : b >= max ? 255 : b >> shift; 29695 } 29696 } 29697 if (fourComponents) { 29698 for (j = 0, pos = 3; j < jj; j++, pos += 4) { 29699 k = y3items[j]; 29700 out[pos] = k <= min ? 0 : k >= maxK ? 255 : k + offset >> shift; 29701 } 29702 } 29703 } else { 29704 for (c = 0; c < componentsCount; c++) { 29705 var items = transformedTiles[c].items; 29706 shift = components[c].precision - 8; 29707 offset = (128 << shift) + 0.5; 29708 max = 127.5 * (1 << shift); 29709 min = -max; 29710 for (pos = c, j = 0, jj = items.length; j < jj; j++) { 29711 val = items[j]; 29712 out[pos] = val <= min ? 0 : val >= max ? 255 : val + offset >> shift; 29713 pos += componentsCount; 29714 } 29715 } 29716 } 29717 resultImages.push(result); 29718 } 29719 return resultImages; 29720 } 29721 function initializeTile(context, tileIndex) { 29722 var siz = context.SIZ; 29723 var componentsCount = siz.Csiz; 29724 var tile = context.tiles[tileIndex]; 29725 for (var c = 0; c < componentsCount; c++) { 29726 var component = tile.components[c]; 29727 var qcdOrQcc = context.currentTile.QCC[c] !== undefined ? context.currentTile.QCC[c] : context.currentTile.QCD; 29728 component.quantizationParameters = qcdOrQcc; 29729 var codOrCoc = context.currentTile.COC[c] !== undefined ? context.currentTile.COC[c] : context.currentTile.COD; 29730 component.codingStyleParameters = codOrCoc; 29731 } 29732 tile.codingStyleDefaultParameters = context.currentTile.COD; 29733 } 29734 var TagTree = function TagTreeClosure() { 29735 function TagTree(width, height) { 29736 var levelsLength = log2(Math.max(width, height)) + 1; 29737 this.levels = []; 29738 for (var i = 0; i < levelsLength; i++) { 29739 var level = { 29740 width: width, 29741 height: height, 29742 items: [] 29743 }; 29744 this.levels.push(level); 29745 width = Math.ceil(width / 2); 29746 height = Math.ceil(height / 2); 29747 } 29748 } 29749 TagTree.prototype = { 29750 reset: function TagTree_reset(i, j) { 29751 var currentLevel = 0, value = 0, level; 29752 while (currentLevel < this.levels.length) { 29753 level = this.levels[currentLevel]; 29754 var index = i + j * level.width; 29755 if (level.items[index] !== undefined) { 29756 value = level.items[index]; 29757 break; 29758 } 29759 level.index = index; 29760 i >>= 1; 29761 j >>= 1; 29762 currentLevel++; 29763 } 29764 currentLevel--; 29765 level = this.levels[currentLevel]; 29766 level.items[level.index] = value; 29767 this.currentLevel = currentLevel; 29768 delete this.value; 29769 }, 29770 incrementValue: function TagTree_incrementValue() { 29771 var level = this.levels[this.currentLevel]; 29772 level.items[level.index]++; 29773 }, 29774 nextLevel: function TagTree_nextLevel() { 29775 var currentLevel = this.currentLevel; 29776 var level = this.levels[currentLevel]; 29777 var value = level.items[level.index]; 29778 currentLevel--; 29779 if (currentLevel < 0) { 29780 this.value = value; 29781 return false; 29782 } 29783 this.currentLevel = currentLevel; 29784 level = this.levels[currentLevel]; 29785 level.items[level.index] = value; 29786 return true; 29787 } 29788 }; 29789 return TagTree; 29790 }(); 29791 var InclusionTree = function InclusionTreeClosure() { 29792 function InclusionTree(width, height, defaultValue) { 29793 var levelsLength = log2(Math.max(width, height)) + 1; 29794 this.levels = []; 29795 for (var i = 0; i < levelsLength; i++) { 29796 var items = new Uint8Array(width * height); 29797 for (var j = 0, jj = items.length; j < jj; j++) { 29798 items[j] = defaultValue; 29799 } 29800 var level = { 29801 width: width, 29802 height: height, 29803 items: items 29804 }; 29805 this.levels.push(level); 29806 width = Math.ceil(width / 2); 29807 height = Math.ceil(height / 2); 29808 } 29809 } 29810 InclusionTree.prototype = { 29811 reset: function InclusionTree_reset(i, j, stopValue) { 29812 var currentLevel = 0; 29813 while (currentLevel < this.levels.length) { 29814 var level = this.levels[currentLevel]; 29815 var index = i + j * level.width; 29816 level.index = index; 29817 var value = level.items[index]; 29818 if (value === 0xFF) { 29819 break; 29820 } 29821 if (value > stopValue) { 29822 this.currentLevel = currentLevel; 29823 this.propagateValues(); 29824 return false; 29825 } 29826 i >>= 1; 29827 j >>= 1; 29828 currentLevel++; 29829 } 29830 this.currentLevel = currentLevel - 1; 29831 return true; 29832 }, 29833 incrementValue: function InclusionTree_incrementValue(stopValue) { 29834 var level = this.levels[this.currentLevel]; 29835 level.items[level.index] = stopValue + 1; 29836 this.propagateValues(); 29837 }, 29838 propagateValues: function InclusionTree_propagateValues() { 29839 var levelIndex = this.currentLevel; 29840 var level = this.levels[levelIndex]; 29841 var currentValue = level.items[level.index]; 29842 while (--levelIndex >= 0) { 29843 level = this.levels[levelIndex]; 29844 level.items[level.index] = currentValue; 29845 } 29846 }, 29847 nextLevel: function InclusionTree_nextLevel() { 29848 var currentLevel = this.currentLevel; 29849 var level = this.levels[currentLevel]; 29850 var value = level.items[level.index]; 29851 level.items[level.index] = 0xFF; 29852 currentLevel--; 29853 if (currentLevel < 0) { 29854 return false; 29855 } 29856 this.currentLevel = currentLevel; 29857 level = this.levels[currentLevel]; 29858 level.items[level.index] = value; 29859 return true; 29860 } 29861 }; 29862 return InclusionTree; 29863 }(); 29864 var BitModel = function BitModelClosure() { 29865 var UNIFORM_CONTEXT = 17; 29866 var RUNLENGTH_CONTEXT = 18; 29867 var LLAndLHContextsLabel = new Uint8Array([ 29868 0, 29869 5, 29870 8, 29871 0, 29872 3, 29873 7, 29874 8, 29875 0, 29876 4, 29877 7, 29878 8, 29879 0, 29880 0, 29881 0, 29882 0, 29883 0, 29884 1, 29885 6, 29886 8, 29887 0, 29888 3, 29889 7, 29890 8, 29891 0, 29892 4, 29893 7, 29894 8, 29895 0, 29896 0, 29897 0, 29898 0, 29899 0, 29900 2, 29901 6, 29902 8, 29903 0, 29904 3, 29905 7, 29906 8, 29907 0, 29908 4, 29909 7, 29910 8, 29911 0, 29912 0, 29913 0, 29914 0, 29915 0, 29916 2, 29917 6, 29918 8, 29919 0, 29920 3, 29921 7, 29922 8, 29923 0, 29924 4, 29925 7, 29926 8, 29927 0, 29928 0, 29929 0, 29930 0, 29931 0, 29932 2, 29933 6, 29934 8, 29935 0, 29936 3, 29937 7, 29938 8, 29939 0, 29940 4, 29941 7, 29942 8 29943 ]); 29944 var HLContextLabel = new Uint8Array([ 29945 0, 29946 3, 29947 4, 29948 0, 29949 5, 29950 7, 29951 7, 29952 0, 29953 8, 29954 8, 29955 8, 29956 0, 29957 0, 29958 0, 29959 0, 29960 0, 29961 1, 29962 3, 29963 4, 29964 0, 29965 6, 29966 7, 29967 7, 29968 0, 29969 8, 29970 8, 29971 8, 29972 0, 29973 0, 29974 0, 29975 0, 29976 0, 29977 2, 29978 3, 29979 4, 29980 0, 29981 6, 29982 7, 29983 7, 29984 0, 29985 8, 29986 8, 29987 8, 29988 0, 29989 0, 29990 0, 29991 0, 29992 0, 29993 2, 29994 3, 29995 4, 29996 0, 29997 6, 29998 7, 29999 7, 30000 0, 30001 8, 30002 8, 30003 8, 30004 0, 30005 0, 30006 0, 30007 0, 30008 0, 30009 2, 30010 3, 30011 4, 30012 0, 30013 6, 30014 7, 30015 7, 30016 0, 30017 8, 30018 8, 30019 8 30020 ]); 30021 var HHContextLabel = new Uint8Array([ 30022 0, 30023 1, 30024 2, 30025 0, 30026 1, 30027 2, 30028 2, 30029 0, 30030 2, 30031 2, 30032 2, 30033 0, 30034 0, 30035 0, 30036 0, 30037 0, 30038 3, 30039 4, 30040 5, 30041 0, 30042 4, 30043 5, 30044 5, 30045 0, 30046 5, 30047 5, 30048 5, 30049 0, 30050 0, 30051 0, 30052 0, 30053 0, 30054 6, 30055 7, 30056 7, 30057 0, 30058 7, 30059 7, 30060 7, 30061 0, 30062 7, 30063 7, 30064 7, 30065 0, 30066 0, 30067 0, 30068 0, 30069 0, 30070 8, 30071 8, 30072 8, 30073 0, 30074 8, 30075 8, 30076 8, 30077 0, 30078 8, 30079 8, 30080 8, 30081 0, 30082 0, 30083 0, 30084 0, 30085 0, 30086 8, 30087 8, 30088 8, 30089 0, 30090 8, 30091 8, 30092 8, 30093 0, 30094 8, 30095 8, 30096 8 30097 ]); 30098 function BitModel(width, height, subband, zeroBitPlanes, mb) { 30099 this.width = width; 30100 this.height = height; 30101 this.contextLabelTable = subband === 'HH' ? HHContextLabel : subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel; 30102 var coefficientCount = width * height; 30103 this.neighborsSignificance = new Uint8Array(coefficientCount); 30104 this.coefficentsSign = new Uint8Array(coefficientCount); 30105 this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : mb > 6 ? new Uint16Array(coefficientCount) : new Uint8Array(coefficientCount); 30106 this.processingFlags = new Uint8Array(coefficientCount); 30107 var bitsDecoded = new Uint8Array(coefficientCount); 30108 if (zeroBitPlanes !== 0) { 30109 for (var i = 0; i < coefficientCount; i++) { 30110 bitsDecoded[i] = zeroBitPlanes; 30111 } 30112 } 30113 this.bitsDecoded = bitsDecoded; 30114 this.reset(); 30115 } 30116 BitModel.prototype = { 30117 setDecoder: function BitModel_setDecoder(decoder) { 30118 this.decoder = decoder; 30119 }, 30120 reset: function BitModel_reset() { 30121 this.contexts = new Int8Array(19); 30122 this.contexts[0] = 4 << 1 | 0; 30123 this.contexts[UNIFORM_CONTEXT] = 46 << 1 | 0; 30124 this.contexts[RUNLENGTH_CONTEXT] = 3 << 1 | 0; 30125 }, 30126 setNeighborsSignificance: function BitModel_setNeighborsSignificance(row, column, index) { 30127 var neighborsSignificance = this.neighborsSignificance; 30128 var width = this.width, height = this.height; 30129 var left = column > 0; 30130 var right = column + 1 < width; 30131 var i; 30132 if (row > 0) { 30133 i = index - width; 30134 if (left) { 30135 neighborsSignificance[i - 1] += 0x10; 30136 } 30137 if (right) { 30138 neighborsSignificance[i + 1] += 0x10; 30139 } 30140 neighborsSignificance[i] += 0x04; 30141 } 30142 if (row + 1 < height) { 30143 i = index + width; 30144 if (left) { 30145 neighborsSignificance[i - 1] += 0x10; 30146 } 30147 if (right) { 30148 neighborsSignificance[i + 1] += 0x10; 30149 } 30150 neighborsSignificance[i] += 0x04; 30151 } 30152 if (left) { 30153 neighborsSignificance[index - 1] += 0x01; 30154 } 30155 if (right) { 30156 neighborsSignificance[index + 1] += 0x01; 30157 } 30158 neighborsSignificance[index] |= 0x80; 30159 }, 30160 runSignificancePropagationPass: function BitModel_runSignificancePropagationPass() { 30161 var decoder = this.decoder; 30162 var width = this.width, height = this.height; 30163 var coefficentsMagnitude = this.coefficentsMagnitude; 30164 var coefficentsSign = this.coefficentsSign; 30165 var neighborsSignificance = this.neighborsSignificance; 30166 var processingFlags = this.processingFlags; 30167 var contexts = this.contexts; 30168 var labels = this.contextLabelTable; 30169 var bitsDecoded = this.bitsDecoded; 30170 var processedInverseMask = ~1; 30171 var processedMask = 1; 30172 var firstMagnitudeBitMask = 2; 30173 for (var i0 = 0; i0 < height; i0 += 4) { 30174 for (var j = 0; j < width; j++) { 30175 var index = i0 * width + j; 30176 for (var i1 = 0; i1 < 4; i1++, index += width) { 30177 var i = i0 + i1; 30178 if (i >= height) { 30179 break; 30180 } 30181 processingFlags[index] &= processedInverseMask; 30182 if (coefficentsMagnitude[index] || !neighborsSignificance[index]) { 30183 continue; 30184 } 30185 var contextLabel = labels[neighborsSignificance[index]]; 30186 var decision = decoder.readBit(contexts, contextLabel); 30187 if (decision) { 30188 var sign = this.decodeSignBit(i, j, index); 30189 coefficentsSign[index] = sign; 30190 coefficentsMagnitude[index] = 1; 30191 this.setNeighborsSignificance(i, j, index); 30192 processingFlags[index] |= firstMagnitudeBitMask; 30193 } 30194 bitsDecoded[index]++; 30195 processingFlags[index] |= processedMask; 30196 } 30197 } 30198 } 30199 }, 30200 decodeSignBit: function BitModel_decodeSignBit(row, column, index) { 30201 var width = this.width, height = this.height; 30202 var coefficentsMagnitude = this.coefficentsMagnitude; 30203 var coefficentsSign = this.coefficentsSign; 30204 var contribution, sign0, sign1, significance1; 30205 var contextLabel, decoded; 30206 significance1 = column > 0 && coefficentsMagnitude[index - 1] !== 0; 30207 if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { 30208 sign1 = coefficentsSign[index + 1]; 30209 if (significance1) { 30210 sign0 = coefficentsSign[index - 1]; 30211 contribution = 1 - sign1 - sign0; 30212 } else { 30213 contribution = 1 - sign1 - sign1; 30214 } 30215 } else if (significance1) { 30216 sign0 = coefficentsSign[index - 1]; 30217 contribution = 1 - sign0 - sign0; 30218 } else { 30219 contribution = 0; 30220 } 30221 var horizontalContribution = 3 * contribution; 30222 significance1 = row > 0 && coefficentsMagnitude[index - width] !== 0; 30223 if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { 30224 sign1 = coefficentsSign[index + width]; 30225 if (significance1) { 30226 sign0 = coefficentsSign[index - width]; 30227 contribution = 1 - sign1 - sign0 + horizontalContribution; 30228 } else { 30229 contribution = 1 - sign1 - sign1 + horizontalContribution; 30230 } 30231 } else if (significance1) { 30232 sign0 = coefficentsSign[index - width]; 30233 contribution = 1 - sign0 - sign0 + horizontalContribution; 30234 } else { 30235 contribution = horizontalContribution; 30236 } 30237 if (contribution >= 0) { 30238 contextLabel = 9 + contribution; 30239 decoded = this.decoder.readBit(this.contexts, contextLabel); 30240 } else { 30241 contextLabel = 9 - contribution; 30242 decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; 30243 } 30244 return decoded; 30245 }, 30246 runMagnitudeRefinementPass: function BitModel_runMagnitudeRefinementPass() { 30247 var decoder = this.decoder; 30248 var width = this.width, height = this.height; 30249 var coefficentsMagnitude = this.coefficentsMagnitude; 30250 var neighborsSignificance = this.neighborsSignificance; 30251 var contexts = this.contexts; 30252 var bitsDecoded = this.bitsDecoded; 30253 var processingFlags = this.processingFlags; 30254 var processedMask = 1; 30255 var firstMagnitudeBitMask = 2; 30256 var length = width * height; 30257 var width4 = width * 4; 30258 for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { 30259 indexNext = Math.min(length, index0 + width4); 30260 for (var j = 0; j < width; j++) { 30261 for (var index = index0 + j; index < indexNext; index += width) { 30262 if (!coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 30263 continue; 30264 } 30265 var contextLabel = 16; 30266 if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { 30267 processingFlags[index] ^= firstMagnitudeBitMask; 30268 var significance = neighborsSignificance[index] & 127; 30269 contextLabel = significance === 0 ? 15 : 14; 30270 } 30271 var bit = decoder.readBit(contexts, contextLabel); 30272 coefficentsMagnitude[index] = coefficentsMagnitude[index] << 1 | bit; 30273 bitsDecoded[index]++; 30274 processingFlags[index] |= processedMask; 30275 } 30276 } 30277 } 30278 }, 30279 runCleanupPass: function BitModel_runCleanupPass() { 30280 var decoder = this.decoder; 30281 var width = this.width, height = this.height; 30282 var neighborsSignificance = this.neighborsSignificance; 30283 var coefficentsMagnitude = this.coefficentsMagnitude; 30284 var coefficentsSign = this.coefficentsSign; 30285 var contexts = this.contexts; 30286 var labels = this.contextLabelTable; 30287 var bitsDecoded = this.bitsDecoded; 30288 var processingFlags = this.processingFlags; 30289 var processedMask = 1; 30290 var firstMagnitudeBitMask = 2; 30291 var oneRowDown = width; 30292 var twoRowsDown = width * 2; 30293 var threeRowsDown = width * 3; 30294 var iNext; 30295 for (var i0 = 0; i0 < height; i0 = iNext) { 30296 iNext = Math.min(i0 + 4, height); 30297 var indexBase = i0 * width; 30298 var checkAllEmpty = i0 + 3 < height; 30299 for (var j = 0; j < width; j++) { 30300 var index0 = indexBase + j; 30301 var allEmpty = checkAllEmpty && processingFlags[index0] === 0 && processingFlags[index0 + oneRowDown] === 0 && processingFlags[index0 + twoRowsDown] === 0 && processingFlags[index0 + threeRowsDown] === 0 && neighborsSignificance[index0] === 0 && neighborsSignificance[index0 + oneRowDown] === 0 && neighborsSignificance[index0 + twoRowsDown] === 0 && neighborsSignificance[index0 + threeRowsDown] === 0; 30302 var i1 = 0, index = index0; 30303 var i = i0, sign; 30304 if (allEmpty) { 30305 var hasSignificantCoefficent = decoder.readBit(contexts, RUNLENGTH_CONTEXT); 30306 if (!hasSignificantCoefficent) { 30307 bitsDecoded[index0]++; 30308 bitsDecoded[index0 + oneRowDown]++; 30309 bitsDecoded[index0 + twoRowsDown]++; 30310 bitsDecoded[index0 + threeRowsDown]++; 30311 continue; 30312 } 30313 i1 = decoder.readBit(contexts, UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, UNIFORM_CONTEXT); 30314 if (i1 !== 0) { 30315 i = i0 + i1; 30316 index += i1 * width; 30317 } 30318 sign = this.decodeSignBit(i, j, index); 30319 coefficentsSign[index] = sign; 30320 coefficentsMagnitude[index] = 1; 30321 this.setNeighborsSignificance(i, j, index); 30322 processingFlags[index] |= firstMagnitudeBitMask; 30323 index = index0; 30324 for (var i2 = i0; i2 <= i; i2++, index += width) { 30325 bitsDecoded[index]++; 30326 } 30327 i1++; 30328 } 30329 for (i = i0 + i1; i < iNext; i++, index += width) { 30330 if (coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 30331 continue; 30332 } 30333 var contextLabel = labels[neighborsSignificance[index]]; 30334 var decision = decoder.readBit(contexts, contextLabel); 30335 if (decision === 1) { 30336 sign = this.decodeSignBit(i, j, index); 30337 coefficentsSign[index] = sign; 30338 coefficentsMagnitude[index] = 1; 30339 this.setNeighborsSignificance(i, j, index); 30340 processingFlags[index] |= firstMagnitudeBitMask; 30341 } 30342 bitsDecoded[index]++; 30343 } 30344 } 30345 } 30346 }, 30347 checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { 30348 var decoder = this.decoder; 30349 var contexts = this.contexts; 30350 var symbol = decoder.readBit(contexts, UNIFORM_CONTEXT) << 3 | decoder.readBit(contexts, UNIFORM_CONTEXT) << 2 | decoder.readBit(contexts, UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, UNIFORM_CONTEXT); 30351 if (symbol !== 0xA) { 30352 error('JPX Error: Invalid segmentation symbol'); 30353 } 30354 } 30355 }; 30356 return BitModel; 30357 }(); 30358 var Transform = function TransformClosure() { 30359 function Transform() { 30360 } 30361 Transform.prototype.calculate = function transformCalculate(subbands, u0, v0) { 30362 var ll = subbands[0]; 30363 for (var i = 1, ii = subbands.length; i < ii; i++) { 30364 ll = this.iterate(ll, subbands[i], u0, v0); 30365 } 30366 return ll; 30367 }; 30368 Transform.prototype.extend = function extend(buffer, offset, size) { 30369 var i1 = offset - 1, j1 = offset + 1; 30370 var i2 = offset + size - 2, j2 = offset + size; 30371 buffer[i1--] = buffer[j1++]; 30372 buffer[j2++] = buffer[i2--]; 30373 buffer[i1--] = buffer[j1++]; 30374 buffer[j2++] = buffer[i2--]; 30375 buffer[i1--] = buffer[j1++]; 30376 buffer[j2++] = buffer[i2--]; 30377 buffer[i1] = buffer[j1]; 30378 buffer[j2] = buffer[i2]; 30379 }; 30380 Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, u0, v0) { 30381 var llWidth = ll.width, llHeight = ll.height, llItems = ll.items; 30382 var width = hl_lh_hh.width; 30383 var height = hl_lh_hh.height; 30384 var items = hl_lh_hh.items; 30385 var i, j, k, l, u, v; 30386 for (k = 0, i = 0; i < llHeight; i++) { 30387 l = i * 2 * width; 30388 for (j = 0; j < llWidth; j++, k++, l += 2) { 30389 items[l] = llItems[k]; 30390 } 30391 } 30392 llItems = ll.items = null; 30393 var bufferPadding = 4; 30394 var rowBuffer = new Float32Array(width + 2 * bufferPadding); 30395 if (width === 1) { 30396 if ((u0 & 1) !== 0) { 30397 for (v = 0, k = 0; v < height; v++, k += width) { 30398 items[k] *= 0.5; 30399 } 30400 } 30401 } else { 30402 for (v = 0, k = 0; v < height; v++, k += width) { 30403 rowBuffer.set(items.subarray(k, k + width), bufferPadding); 30404 this.extend(rowBuffer, bufferPadding, width); 30405 this.filter(rowBuffer, bufferPadding, width); 30406 items.set(rowBuffer.subarray(bufferPadding, bufferPadding + width), k); 30407 } 30408 } 30409 var numBuffers = 16; 30410 var colBuffers = []; 30411 for (i = 0; i < numBuffers; i++) { 30412 colBuffers.push(new Float32Array(height + 2 * bufferPadding)); 30413 } 30414 var b, currentBuffer = 0; 30415 ll = bufferPadding + height; 30416 if (height === 1) { 30417 if ((v0 & 1) !== 0) { 30418 for (u = 0; u < width; u++) { 30419 items[u] *= 0.5; 30420 } 30421 } 30422 } else { 30423 for (u = 0; u < width; u++) { 30424 if (currentBuffer === 0) { 30425 numBuffers = Math.min(width - u, numBuffers); 30426 for (k = u, l = bufferPadding; l < ll; k += width, l++) { 30427 for (b = 0; b < numBuffers; b++) { 30428 colBuffers[b][l] = items[k + b]; 30429 } 30430 } 30431 currentBuffer = numBuffers; 30432 } 30433 currentBuffer--; 30434 var buffer = colBuffers[currentBuffer]; 30435 this.extend(buffer, bufferPadding, height); 30436 this.filter(buffer, bufferPadding, height); 30437 if (currentBuffer === 0) { 30438 k = u - numBuffers + 1; 30439 for (l = bufferPadding; l < ll; k += width, l++) { 30440 for (b = 0; b < numBuffers; b++) { 30441 items[k + b] = colBuffers[b][l]; 30442 } 30443 } 30444 } 30445 } 30446 } 30447 return { 30448 width: width, 30449 height: height, 30450 items: items 30451 }; 30452 }; 30453 return Transform; 30454 }(); 30455 var IrreversibleTransform = function IrreversibleTransformClosure() { 30456 function IrreversibleTransform() { 30457 Transform.call(this); 30458 } 30459 IrreversibleTransform.prototype = Object.create(Transform.prototype); 30460 IrreversibleTransform.prototype.filter = function irreversibleTransformFilter(x, offset, length) { 30461 var len = length >> 1; 30462 offset = offset | 0; 30463 var j, n, current, next; 30464 var alpha = -1.586134342059924; 30465 var beta = -0.052980118572961; 30466 var gamma = 0.882911075530934; 30467 var delta = 0.443506852043971; 30468 var K = 1.230174104914001; 30469 var K_ = 1 / K; 30470 j = offset - 3; 30471 for (n = len + 4; n--; j += 2) { 30472 x[j] *= K_; 30473 } 30474 j = offset - 2; 30475 current = delta * x[j - 1]; 30476 for (n = len + 3; n--; j += 2) { 30477 next = delta * x[j + 1]; 30478 x[j] = K * x[j] - current - next; 30479 if (n--) { 30480 j += 2; 30481 current = delta * x[j + 1]; 30482 x[j] = K * x[j] - current - next; 30483 } else { 30484 break; 30485 } 30486 } 30487 j = offset - 1; 30488 current = gamma * x[j - 1]; 30489 for (n = len + 2; n--; j += 2) { 30490 next = gamma * x[j + 1]; 30491 x[j] -= current + next; 30492 if (n--) { 30493 j += 2; 30494 current = gamma * x[j + 1]; 30495 x[j] -= current + next; 30496 } else { 30497 break; 30498 } 30499 } 30500 j = offset; 30501 current = beta * x[j - 1]; 30502 for (n = len + 1; n--; j += 2) { 30503 next = beta * x[j + 1]; 30504 x[j] -= current + next; 30505 if (n--) { 30506 j += 2; 30507 current = beta * x[j + 1]; 30508 x[j] -= current + next; 30509 } else { 30510 break; 30511 } 30512 } 30513 if (len !== 0) { 30514 j = offset + 1; 30515 current = alpha * x[j - 1]; 30516 for (n = len; n--; j += 2) { 30517 next = alpha * x[j + 1]; 30518 x[j] -= current + next; 30519 if (n--) { 30520 j += 2; 30521 current = alpha * x[j + 1]; 30522 x[j] -= current + next; 30523 } else { 30524 break; 30525 } 30526 } 30527 } 30528 }; 30529 return IrreversibleTransform; 30530 }();
30531 var ReversibleTransform = function ReversibleTransformClosure() { 30532 function ReversibleTransform() { 30533 Transform.call(this); 30534 } 30535 ReversibleTransform.prototype = Object.create(Transform.prototype); 30536 ReversibleTransform.prototype.filter = function reversibleTransformFilter(x, offset, length) { 30537 var len = length >> 1; 30538 offset = offset | 0; 30539 var j, n; 30540 for (j = offset, n = len + 1; n--; j += 2) { 30541 x[j] -= x[j - 1] + x[j + 1] + 2 >> 2; 30542 } 30543 for (j = offset + 1, n = len; n--; j += 2) { 30544 x[j] += x[j - 1] + x[j + 1] >> 1; 30545 } 30546 }; 30547 return ReversibleTransform; 30548 }(); 30549 return JpxImage; 30550}(); 30551exports.JpxImage = JpxImage; 30552 30553/***/ }), 30554/* 16 */ 30555/***/ (function(module, exports, __w_pdfjs_require__) { 30556 30557"use strict"; 30558 30559var sharedUtil = __w_pdfjs_require__(0); 30560var corePrimitives = __w_pdfjs_require__(1); 30561var coreCrypto = __w_pdfjs_require__(13); 30562var coreParser = __w_pdfjs_require__(5); 30563var coreChunkedStream = __w_pdfjs_require__(12); 30564var coreColorSpace = __w_pdfjs_require__(3); 30565var InvalidPDFException = sharedUtil.InvalidPDFException; 30566var MissingDataException = sharedUtil.MissingDataException; 30567var XRefParseException = sharedUtil.XRefParseException; 30568var assert = sharedUtil.assert; 30569var bytesToString = sharedUtil.bytesToString; 30570var createPromiseCapability = sharedUtil.createPromiseCapability; 30571var error = sharedUtil.error; 30572var info = sharedUtil.info; 30573var isArray = sharedUtil.isArray; 30574var isBool = sharedUtil.isBool; 30575var isInt = sharedUtil.isInt; 30576var isString = sharedUtil.isString; 30577var shadow = sharedUtil.shadow; 30578var stringToPDFString = sharedUtil.stringToPDFString; 30579var stringToUTF8String = sharedUtil.stringToUTF8String; 30580var warn = sharedUtil.warn; 30581var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl; 30582var Util = sharedUtil.Util; 30583var Ref = corePrimitives.Ref; 30584var RefSet = corePrimitives.RefSet; 30585var RefSetCache = corePrimitives.RefSetCache; 30586var isName = corePrimitives.isName; 30587var isCmd = corePrimitives.isCmd; 30588var isDict = corePrimitives.isDict; 30589var isRef = corePrimitives.isRef; 30590var isRefsEqual = corePrimitives.isRefsEqual; 30591var isStream = corePrimitives.isStream; 30592var CipherTransformFactory = coreCrypto.CipherTransformFactory; 30593var Lexer = coreParser.Lexer; 30594var Parser = coreParser.Parser; 30595var ChunkedStream = coreChunkedStream.ChunkedStream; 30596var ColorSpace = coreColorSpace.ColorSpace; 30597var Catalog = function CatalogClosure() { 30598 function Catalog(pdfManager, xref, pageFactory) { 30599 this.pdfManager = pdfManager; 30600 this.xref = xref; 30601 this.catDict = xref.getCatalogObj(); 30602 this.fontCache = new RefSetCache(); 30603 this.builtInCMapCache = Object.create(null); 30604 assert(isDict(this.catDict), 'catalog object is not a dictionary'); 30605 this.pageFactory = pageFactory; 30606 this.pagePromises = []; 30607 } 30608 Catalog.prototype = { 30609 get metadata() { 30610 var streamRef = this.catDict.getRaw('Metadata'); 30611 if (!isRef(streamRef)) { 30612 return shadow(this, 'metadata', null); 30613 } 30614 var encryptMetadata = !this.xref.encrypt ? false : this.xref.encrypt.encryptMetadata; 30615 var stream = this.xref.fetch(streamRef, !encryptMetadata); 30616 var metadata; 30617 if (stream && isDict(stream.dict)) { 30618 var type = stream.dict.get('Type'); 30619 var subtype = stream.dict.get('Subtype'); 30620 if (isName(type, 'Metadata') && isName(subtype, 'XML')) { 30621 try { 30622 metadata = stringToUTF8String(bytesToString(stream.getBytes())); 30623 } catch (e) { 30624 info('Skipping invalid metadata.'); 30625 } 30626 } 30627 } 30628 return shadow(this, 'metadata', metadata); 30629 }, 30630 get toplevelPagesDict() { 30631 var pagesObj = this.catDict.get('Pages'); 30632 assert(isDict(pagesObj), 'invalid top-level pages dictionary'); 30633 return shadow(this, 'toplevelPagesDict', pagesObj); 30634 }, 30635 get documentOutline() { 30636 var obj = null; 30637 try { 30638 obj = this.readDocumentOutline(); 30639 } catch (ex) { 30640 if (ex instanceof MissingDataException) { 30641 throw ex; 30642 } 30643 warn('Unable to read document outline'); 30644 } 30645 return shadow(this, 'documentOutline', obj); 30646 }, 30647 readDocumentOutline: function Catalog_readDocumentOutline() { 30648 var obj = this.catDict.get('Outlines'); 30649 if (!isDict(obj)) { 30650 return null; 30651 } 30652 obj = obj.getRaw('First'); 30653 if (!isRef(obj)) { 30654 return null; 30655 } 30656 var root = { items: [] }; 30657 var queue = [{ 30658 obj: obj, 30659 parent: root 30660 }]; 30661 var processed = new RefSet(); 30662 processed.put(obj); 30663 var xref = this.xref, blackColor = new Uint8Array(3); 30664 while (queue.length > 0) { 30665 var i = queue.shift(); 30666 var outlineDict = xref.fetchIfRef(i.obj); 30667 if (outlineDict === null) { 30668 continue; 30669 } 30670 assert(outlineDict.has('Title'), 'Invalid outline item'); 30671 var data = { 30672 url: null, 30673 dest: null 30674 }; 30675 Catalog.parseDestDictionary({ 30676 destDict: outlineDict, 30677 resultObj: data, 30678 docBaseUrl: this.pdfManager.docBaseUrl 30679 }); 30680 var title = outlineDict.get('Title'); 30681 var flags = outlineDict.get('F') || 0; 30682 var color = outlineDict.getArray('C'), rgbColor = blackColor; 30683 if (isArray(color) && color.length === 3 && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { 30684 rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0); 30685 } 30686 var outlineItem = { 30687 dest: data.dest, 30688 url: data.url, 30689 unsafeUrl: data.unsafeUrl, 30690 newWindow: data.newWindow, 30691 title: stringToPDFString(title), 30692 color: rgbColor, 30693 count: outlineDict.get('Count'), 30694 bold: !!(flags & 2), 30695 italic: !!(flags & 1), 30696 items: [] 30697 }; 30698 i.parent.items.push(outlineItem); 30699 obj = outlineDict.getRaw('First'); 30700 if (isRef(obj) && !processed.has(obj)) { 30701 queue.push({ 30702 obj: obj, 30703 parent: outlineItem 30704 }); 30705 processed.put(obj); 30706 } 30707 obj = outlineDict.getRaw('Next'); 30708 if (isRef(obj) && !processed.has(obj)) { 30709 queue.push({ 30710 obj: obj, 30711 parent: i.parent 30712 }); 30713 processed.put(obj); 30714 } 30715 } 30716 return root.items.length > 0 ? root.items : null; 30717 }, 30718 get numPages() { 30719 var obj = this.toplevelPagesDict.get('Count');
30720 assert(isInt(obj), 'page count in top level pages object is not an integer'); 30721 return shadow(this, 'num', obj); 30722 }, 30723 get destinations() { 30724 function fetchDestination(dest) { 30725 return isDict(dest) ? dest.get('D') : dest; 30726 } 30727 var xref = this.xref; 30728 var dests = {}, nameTreeRef, nameDictionaryRef; 30729 var obj = this.catDict.get('Names'); 30730 if (obj && obj.has('Dests')) { 30731 nameTreeRef = obj.getRaw('Dests'); 30732 } else if (this.catDict.has('Dests')) { 30733 nameDictionaryRef = this.catDict.get('Dests'); 30734 } 30735 if (nameDictionaryRef) { 30736 obj = nameDictionaryRef; 30737 obj.forEach(function catalogForEach(key, value) { 30738 if (!value) { 30739 return; 30740 } 30741 dests[key] = fetchDestination(value); 30742 }); 30743 } 30744 if (nameTreeRef) { 30745 var nameTree = new NameTree(nameTreeRef, xref); 30746 var names = nameTree.getAll(); 30747 for (var name in names) { 30748 dests[name] = fetchDestination(names[name]); 30749 } 30750 } 30751 return shadow(this, 'destinations', dests); 30752 }, 30753 getDestination: function Catalog_getDestination(destinationId) { 30754 function fetchDestination(dest) { 30755 return isDict(dest) ? dest.get('D') : dest; 30756 } 30757 var xref = this.xref; 30758 var dest = null, nameTreeRef, nameDictionaryRef; 30759 var obj = this.catDict.get('Names'); 30760 if (obj && obj.has('Dests')) { 30761 nameTreeRef = obj.getRaw('Dests'); 30762 } else if (this.catDict.has('Dests')) { 30763 nameDictionaryRef = this.catDict.get('Dests'); 30764 } 30765 if (nameDictionaryRef) { 30766 var value = nameDictionaryRef.get(destinationId); 30767 if (value) { 30768 dest = fetchDestination(value); 30769 } 30770 } 30771 if (nameTreeRef) { 30772 var nameTree = new NameTree(nameTreeRef, xref); 30773 dest = fetchDestination(nameTree.get(destinationId)); 30774 } 30775 return dest; 30776 }, 30777 get pageLabels() { 30778 var obj = null; 30779 try { 30780 obj = this.readPageLabels(); 30781 } catch (ex) { 30782 if (ex instanceof MissingDataException) { 30783 throw ex; 30784 } 30785 warn('Unable to read page labels.'); 30786 } 30787 return shadow(this, 'pageLabels', obj); 30788 }, 30789 readPageLabels: function Catalog_readPageLabels() { 30790 var obj = this.catDict.getRaw('PageLabels'); 30791 if (!obj) { 30792 return null; 30793 } 30794 var pageLabels = new Array(this.numPages); 30795 var style = null; 30796 var prefix = ''; 30797 var numberTree = new NumberTree(obj, this.xref); 30798 var nums = numberTree.getAll(); 30799 var currentLabel = '', currentIndex = 1; 30800 for (var i = 0, ii = this.numPages; i < ii; i++) { 30801 if (i in nums) { 30802 var labelDict = nums[i]; 30803 assert(isDict(labelDict), 'The PageLabel is not a dictionary.'); 30804 var type = labelDict.get('Type'); 30805 assert(!type || isName(type, 'PageLabel'), 'Invalid type in PageLabel dictionary.'); 30806 var s = labelDict.get('S'); 30807 assert(!s || isName(s), 'Invalid style in PageLabel dictionary.'); 30808 style = s ? s.name : null; 30809 var p = labelDict.get('P'); 30810 assert(!p || isString(p), 'Invalid prefix in PageLabel dictionary.'); 30811 prefix = p ? stringToPDFString(p) : ''; 30812 var st = labelDict.get('St'); 30813 assert(!st || isInt(st) && st >= 1, 'Invalid start in PageLabel dictionary.'); 30814 currentIndex = st || 1; 30815 } 30816 switch (style) { 30817 case 'D': 30818 currentLabel = currentIndex; 30819 break; 30820 case 'R': 30821 case 'r': 30822 currentLabel = Util.toRoman(currentIndex, style === 'r'); 30823 break; 30824 case 'A': 30825 case 'a': 30826 var LIMIT = 26; 30827 var A_UPPER_CASE = 0x41, A_LOWER_CASE = 0x61; 30828 var baseCharCode = style === 'a' ? A_LOWER_CASE : A_UPPER_CASE; 30829 var letterIndex = currentIndex - 1; 30830 var character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); 30831 var charBuf = []; 30832 for (var j = 0, jj = letterIndex / LIMIT | 0; j <= jj; j++) { 30833 charBuf.push(character); 30834 } 30835 currentLabel = charBuf.join(''); 30836 break; 30837 default: 30838 assert(!style, 'Invalid style "' + style + '" in PageLabel dictionary.'); 30839 } 30840 pageLabels[i] = prefix + currentLabel; 30841 currentLabel = ''; 30842 currentIndex++; 30843 } 30844 return pageLabels; 30845 }, 30846 get attachments() { 30847 var xref = this.xref; 30848 var attachments = null, nameTreeRef; 30849 var obj = this.catDict.get('Names'); 30850 if (obj) { 30851 nameTreeRef = obj.getRaw('EmbeddedFiles'); 30852 } 30853 if (nameTreeRef) {
30854 var nameTree = new NameTree(nameTreeRef, xref); 30855 var names = nameTree.getAll(); 30856 for (var name in names) { 30857 var fs = new FileSpec(names[name], xref); 30858 if (!attachments) { 30859 attachments = Object.create(null); 30860 } 30861 attachments[stringToPDFString(name)] = fs.serializable; 30862 } 30863 } 30864 return shadow(this, 'attachments', attachments); 30865 }, 30866 get javaScript() { 30867 var xref = this.xref; 30868 var obj = this.catDict.get('Names'); 30869 var javaScript = []; 30870 function appendIfJavaScriptDict(jsDict) { 30871 var type = jsDict.get('S'); 30872 if (!isName(type, 'JavaScript')) { 30873 return; 30874 } 30875 var js = jsDict.get('JS'); 30876 if (isStream(js)) { 30877 js = bytesToString(js.getBytes()); 30878 } else if (!isString(js)) { 30879 return; 30880 } 30881 javaScript.push(stringToPDFString(js)); 30882 } 30883 if (obj && obj.has('JavaScript')) { 30884 var nameTree = new NameTree(obj.getRaw('JavaScript'), xref); 30885 var names = nameTree.getAll(); 30886 for (var name in names) { 30887 var jsDict = names[name]; 30888 if (isDict(jsDict)) { 30889 appendIfJavaScriptDict(jsDict); 30890 } 30891 } 30892 } 30893 var openactionDict = this.catDict.get('OpenAction'); 30894 if (isDict(openactionDict, 'Action')) { 30895 var actionType = openactionDict.get('S'); 30896 if (isName(actionType, 'Named')) { 30897 var action = openactionDict.get('N'); 30898 if (isName(action, 'Print')) { 30899 javaScript.push('print({});'); 30900 } 30901 } else { 30902 appendIfJavaScriptDict(openactionDict); 30903 } 30904 } 30905 return shadow(this, 'javaScript', javaScript); 30906 }, 30907 cleanup: function Catalog_cleanup() { 30908 var promises = []; 30909 this.fontCache.forEach(function (promise) { 30910 promises.push(promise); 30911 }); 30912 return Promise.all(promises).then(function (translatedFonts) { 30913 for (var i = 0, ii = translatedFonts.length; i < ii; i++) { 30914 var font = translatedFonts[i].dict; 30915 delete font.translated; 30916 } 30917 this.fontCache.clear(); 30918 this.builtInCMapCache = Object.create(null); 30919 }.bind(this)); 30920 }, 30921 getPage: function Catalog_getPage(pageIndex) { 30922 if (!(pageIndex in this.pagePromises)) { 30923 this.pagePromises[pageIndex] = this.getPageDict(pageIndex).then(function (a) { 30924 var dict = a[0]; 30925 var ref = a[1]; 30926 return this.pageFactory.createPage(pageIndex, dict, ref, this.fontCache, this.builtInCMapCache); 30927 }.bind(this)); 30928 } 30929 return this.pagePromises[pageIndex]; 30930 }, 30931 getPageDict: function Catalog_getPageDict(pageIndex) { 30932 var capability = createPromiseCapability(); 30933 var nodesToVisit = [this.catDict.getRaw('Pages')]; 30934 var currentPageIndex = 0; 30935 var xref = this.xref; 30936 function next() { 30937 while (nodesToVisit.length) { 30938 var currentNode = nodesToVisit.pop(); 30939 if (isRef(currentNode)) { 30940 xref.fetchAsync(currentNode).then(function (obj) { 30941 if (isDict(obj, 'Page') || isDict(obj) && !obj.has('Kids')) { 30942 if (pageIndex === currentPageIndex) { 30943 capability.resolve([ 30944 obj, 30945 currentNode 30946 ]); 30947 } else { 30948 currentPageIndex++; 30949 next(); 30950 } 30951 return; 30952 } 30953 nodesToVisit.push(obj); 30954 next(); 30955 }, capability.reject); 30956 return; 30957 } 30958 assert(isDict(currentNode), 'page dictionary kid reference points to wrong type of object'); 30959 var count = currentNode.get('Count'); 30960 if (currentPageIndex + count <= pageIndex) { 30961 currentPageIndex += count; 30962 continue; 30963 } 30964 var kids = currentNode.get('Kids'); 30965 assert(isArray(kids), 'page dictionary kids object is not an array'); 30966 for (var last = kids.length - 1; last >= 0; last--) { 30967 nodesToVisit.push(kids[last]); 30968 } 30969 } 30970 capability.reject('Page index ' + pageIndex + ' not found.'); 30971 } 30972 next(); 30973 return capability.promise; 30974 }, 30975 getPageIndex: function Catalog_getPageIndex(pageRef) { 30976 var xref = this.xref; 30977 function pagesBeforeRef(kidRef) { 30978 var total = 0; 30979 var parentRef; 30980 return xref.fetchAsync(kidRef).then(function (node) { 30981 if (isRefsEqual(kidRef, pageRef) && !isDict(node, 'Page') && !(isDict(node) && !node.has('Type') && node.has('Contents'))) { 30982 throw new Error('The reference does not point to a /Page Dict.'); 30983 } 30984 if (!node) { 30985 return null; 30986 } 30987 assert(isDict(node), 'node must be a Dict.'); 30988 parentRef = node.getRaw('Parent'); 30989 return node.getAsync('Parent'); 30990 }).then(function (parent) { 30991 if (!parent) { 30992 return null; 30993 } 30994 assert(isDict(parent), 'parent must be a Dict.'); 30995 return parent.getAsync('Kids'); 30996 }).then(function (kids) { 30997 if (!kids) { 30998 return null; 30999 } 31000 var kidPromises = []; 31001 var found = false;
31002 for (var i = 0; i < kids.length; i++) { 31003 var kid = kids[i]; 31004 assert(isRef(kid), 'kid must be a Ref.'); 31005 if (kid.num === kidRef.num) { 31006 found = true; 31007 break; 31008 } 31009 kidPromises.push(xref.fetchAsync(kid).then(function (kid) { 31010 if (kid.has('Count')) { 31011 var count = kid.get('Count'); 31012 total += count; 31013 } else { 31014 total++; 31015 } 31016 })); 31017 } 31018 if (!found) { 31019 error('kid ref not found in parents kids'); 31020 } 31021 return Promise.all(kidPromises).then(function () { 31022 return [ 31023 total, 31024 parentRef 31025 ]; 31026 }); 31027 }); 31028 } 31029 var total = 0; 31030 function next(ref) { 31031 return pagesBeforeRef(ref).then(function (args) { 31032 if (!args) { 31033 return total; 31034 } 31035 var count = args[0]; 31036 var parentRef = args[1]; 31037 total += count; 31038 return next(parentRef); 31039 }); 31040 } 31041 return next(pageRef); 31042 } 31043 }; 31044 Catalog.parseDestDictionary = function Catalog_parseDestDictionary(params) { 31045 function addDefaultProtocolToUrl(url) { 31046 if (url.indexOf('www.') === 0) { 31047 return 'http://' + url; 31048 } 31049 return url; 31050 } 31051 function tryConvertUrlEncoding(url) { 31052 try { 31053 return stringToUTF8String(url); 31054 } catch (e) { 31055 return url; 31056 } 31057 } 31058 var destDict = params.destDict; 31059 if (!isDict(destDict)) { 31060 warn('Catalog_parseDestDictionary: "destDict" must be a dictionary.'); 31061 return; 31062 } 31063 var resultObj = params.resultObj; 31064 if (typeof resultObj !== 'object') { 31065 warn('Catalog_parseDestDictionary: "resultObj" must be an object.'); 31066 return; 31067 } 31068 var docBaseUrl = params.docBaseUrl || null; 31069 var action = destDict.get('A'), url, dest; 31070 if (isDict(action)) { 31071 var linkType = action.get('S').name; 31072 switch (linkType) { 31073 case 'URI': 31074 url = action.get('URI'); 31075 if (isName(url)) { 31076 url = '/' + url.name; 31077 } else if (isString(url)) { 31078 url = addDefaultProtocolToUrl(url); 31079 } 31080 break; 31081 case 'GoTo': 31082 dest = action.get('D'); 31083 break; 31084 case 'Launch': 31085 case 'GoToR': 31086 var urlDict = action.get('F'); 31087 if (isDict(urlDict)) { 31088 url = urlDict.get('F') || null; 31089 } else if (isString(urlDict)) { 31090 url = urlDict; 31091 } 31092 var remoteDest = action.get('D'); 31093 if (remoteDest) { 31094 if (isName(remoteDest)) { 31095 remoteDest = remoteDest.name; 31096 } 31097 if (isString(url)) { 31098 var baseUrl = url.split('#')[0]; 31099 if (isString(remoteDest)) { 31100 url = baseUrl + '#' + (/^\d+$/.test(remoteDest) ? 'nameddest=' : '') + remoteDest; 31101 } else if (isArray(remoteDest)) { 31102 url = baseUrl + '#' + JSON.stringify(remoteDest); 31103 } 31104 } 31105 } 31106 var newWindow = action.get('NewWindow'); 31107 if (isBool(newWindow)) { 31108 resultObj.newWindow = newWindow; 31109 } 31110 break; 31111 case 'Named': 31112 var namedAction = action.get('N'); 31113 if (isName(namedAction)) { 31114 resultObj.action = namedAction.name; 31115 } 31116 break; 31117 case 'JavaScript': 31118 var jsAction = action.get('JS'), js; 31119 if (isStream(jsAction)) { 31120 js = bytesToString(jsAction.getBytes()); 31121 } else if (isString(jsAction)) { 31122 js = jsAction; 31123 } 31124 if (js) { 31125 var URL_OPEN_METHODS = [ 31126 'app.launchURL', 31127 'window.open' 31128 ]; 31129 var regex = new RegExp('^\\s*(' + URL_OPEN_METHODS.join('|').split('.').join('\\.') + ')\\((?:\'|\")([^\'\"]*)(?:\'|\")(?:,\\s*(\\w+)\\)|\\))', 'i'); 31130 var jsUrl = regex.exec(stringToPDFString(js)); 31131 if (jsUrl && jsUrl[2]) { 31132 url = jsUrl[2]; 31133 if (jsUrl[3] === 'true' && jsUrl[1] === 'app.launchURL') { 31134 resultObj.newWindow = true; 31135 } 31136 break; 31137 } 31138 } 31139 default: 31140 warn('Catalog_parseDestDictionary: Unrecognized link type "' + linkType + '".'); 31141 break; 31142 } 31143 } else if (destDict.has('Dest')) { 31144 dest = destDict.get('Dest'); 31145 } 31146 if (isString(url)) { 31147 url = tryConvertUrlEncoding(url); 31148 var absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl); 31149 if (absoluteUrl) { 31150 resultObj.url = absoluteUrl.href; 31151 } 31152 resultObj.unsafeUrl = url; 31153 } 31154 if (dest) { 31155 if (isName(dest)) { 31156 dest = dest.name; 31157 } 31158 if (isString(dest) || isArray(dest)) { 31159 resultObj.dest = dest; 31160 } 31161 } 31162 }; 31163 return Catalog; 31164}(); 31165var XRef = function XRefClosure() { 31166 function XRef(stream, pdfManager) { 31167 this.stream = stream; 31168 this.pdfManager = pdfManager; 31169 this.entries = []; 31170 this.xrefstms = Object.create(null); 31171 this.cache = []; 31172 this.stats = { 31173 streamTypes: [], 31174 fontTypes: [] 31175 }; 31176 } 31177 XRef.prototype = { 31178 setStartXRef: function XRef_setStartXRef(startXRef) { 31179 this.startXRefQueue = [startXRef]; 31180 }, 31181 parse: function XRef_parse(recoveryMode) { 31182 var trailerDict; 31183 if (!recoveryMode) { 31184 trailerDict = this.readXRef(); 31185 } else { 31186 warn('Indexing all PDF objects'); 31187 trailerDict = this.indexObjects(); 31188 } 31189 trailerDict.assignXref(this); 31190 this.trailer = trailerDict; 31191 var encrypt = trailerDict.get('Encrypt'); 31192 if (isDict(encrypt)) { 31193 var ids = trailerDict.get('ID'); 31194 var fileId = ids && ids.length ? ids[0] : ''; 31195 encrypt.suppressEncryption = true; 31196 this.encrypt = new CipherTransformFactory(encrypt, fileId, this.pdfManager.password); 31197 } 31198 if (!(this.root = trailerDict.get('Root'))) { 31199 error('Invalid root reference'); 31200 } 31201 }, 31202 processXRefTable: function XRef_processXRefTable(parser) { 31203 if (!('tableState' in this)) { 31204 this.tableState = { 31205 entryNum: 0, 31206 streamPos: parser.lexer.stream.pos, 31207 parserBuf1: parser.buf1, 31208 parserBuf2: parser.buf2 31209 }; 31210 } 31211 var obj = this.readXRefTable(parser); 31212 if (!isCmd(obj, 'trailer')) { 31213 error('Invalid XRef table: could not find trailer dictionary'); 31214 } 31215 var dict = parser.getObj(); 31216 if (!isDict(dict) && dict.dict) { 31217 dict = dict.dict; 31218 } 31219 if (!isDict(dict)) { 31220 error('Invalid XRef table: could not parse trailer dictionary'); 31221 } 31222 delete this.tableState; 31223 return dict; 31224 }, 31225 readXRefTable: function XRef_readXRefTable(parser) { 31226 var stream = parser.lexer.stream; 31227 var tableState = this.tableState; 31228 stream.pos = tableState.streamPos; 31229 parser.buf1 = tableState.parserBuf1; 31230 parser.buf2 = tableState.parserBuf2; 31231 var obj; 31232 while (true) { 31233 if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { 31234 if (isCmd(obj = parser.getObj(), 'trailer')) { 31235 break; 31236 } 31237 tableState.firstEntryNum = obj; 31238 tableState.entryCount = parser.getObj(); 31239 } 31240 var first = tableState.firstEntryNum; 31241 var count = tableState.entryCount; 31242 if (!isInt(first) || !isInt(count)) { 31243 error('Invalid XRef table: wrong types in subsection header'); 31244 } 31245 for (var i = tableState.entryNum; i < count; i++) { 31246 tableState.streamPos = stream.pos; 31247 tableState.entryNum = i; 31248 tableState.parserBuf1 = parser.buf1; 31249 tableState.parserBuf2 = parser.buf2; 31250 var entry = {}; 31251 entry.offset = parser.getObj(); 31252 entry.gen = parser.getObj(); 31253 var type = parser.getObj(); 31254 if (isCmd(type, 'f')) { 31255 entry.free = true; 31256 } else if (isCmd(type, 'n')) { 31257 entry.uncompressed = true; 31258 } 31259 if (!isInt(entry.offset) || !isInt(entry.gen) || !(entry.free || entry.uncompressed)) { 31260 error('Invalid entry in XRef subsection: ' + first + ', ' + count); 31261 } 31262 if (i === 0 && entry.free && first === 1) { 31263 first = 0; 31264 } 31265 if (!this.entries[i + first]) { 31266 this.entries[i + first] = entry; 31267 } 31268 } 31269 tableState.entryNum = 0; 31270 tableState.streamPos = stream.pos; 31271 tableState.parserBuf1 = parser.buf1; 31272 tableState.parserBuf2 = parser.buf2; 31273 delete tableState.firstEntryNum; 31274 delete tableState.entryCount; 31275 } 31276 if (this.entries[0] && !this.entries[0].free) { 31277 error('Invalid XRef table: unexpected first object'); 31278 } 31279 return obj; 31280 }, 31281 processXRefStream: function XRef_processXRefStream(stream) { 31282 if (!('streamState' in this)) { 31283 var streamParameters = stream.dict;
vendor: 10,031 bytes, lines 31284-31644
31284 var byteWidths = streamParameters.get('W'); 31285 var range = streamParameters.get('Index'); 31286 if (!range) { 31287 range = [ 31288 0, 31289 streamParameters.get('Size') 31290 ]; 31291 } 31292 this.streamState = { 31293 entryRanges: range, 31294 byteWidths: byteWidths, 31295 entryNum: 0, 31296 streamPos: stream.pos 31297 }; 31298 } 31299 this.readXRefStream(stream); 31300 delete this.streamState; 31301 return stream.dict; 31302 }, 31303 readXRefStream: function XRef_readXRefStream(stream) { 31304 var i, j; 31305 var streamState = this.streamState; 31306 stream.pos = streamState.streamPos; 31307 var byteWidths = streamState.byteWidths; 31308 var typeFieldWidth = byteWidths[0]; 31309 var offsetFieldWidth = byteWidths[1]; 31310 var generationFieldWidth = byteWidths[2]; 31311 var entryRanges = streamState.entryRanges; 31312 while (entryRanges.length > 0) { 31313 var first = entryRanges[0]; 31314 var n = entryRanges[1]; 31315 if (!isInt(first) || !isInt(n)) { 31316 error('Invalid XRef range fields: ' + first + ', ' + n); 31317 } 31318 if (!isInt(typeFieldWidth) || !isInt(offsetFieldWidth) || !isInt(generationFieldWidth)) { 31319 error('Invalid XRef entry fields length: ' + first + ', ' + n); 31320 } 31321 for (i = streamState.entryNum; i < n; ++i) { 31322 streamState.entryNum = i; 31323 streamState.streamPos = stream.pos; 31324 var type = 0, offset = 0, generation = 0; 31325 for (j = 0; j < typeFieldWidth; ++j) { 31326 type = type << 8 | stream.getByte(); 31327 } 31328 if (typeFieldWidth === 0) { 31329 type = 1; 31330 } 31331 for (j = 0; j < offsetFieldWidth; ++j) { 31332 offset = offset << 8 | stream.getByte(); 31333 } 31334 for (j = 0; j < generationFieldWidth; ++j) { 31335 generation = generation << 8 | stream.getByte(); 31336 } 31337 var entry = {}; 31338 entry.offset = offset; 31339 entry.gen = generation; 31340 switch (type) { 31341 case 0: 31342 entry.free = true; 31343 break; 31344 case 1: 31345 entry.uncompressed = true; 31346 break; 31347 case 2: 31348 break; 31349 default: 31350 error('Invalid XRef entry type: ' + type); 31351 } 31352 if (!this.entries[first + i]) { 31353 this.entries[first + i] = entry; 31354 } 31355 } 31356 streamState.entryNum = 0; 31357 streamState.streamPos = stream.pos; 31358 entryRanges.splice(0, 2); 31359 } 31360 }, 31361 indexObjects: function XRef_indexObjects() { 31362 var TAB = 0x9, LF = 0xA, CR = 0xD, SPACE = 0x20; 31363 var PERCENT = 0x25, LT = 0x3C; 31364 function readToken(data, offset) { 31365 var token = '', ch = data[offset]; 31366 while (ch !== LF && ch !== CR && ch !== LT) { 31367 if (++offset >= data.length) { 31368 break; 31369 } 31370 token += String.fromCharCode(ch); 31371 ch = data[offset]; 31372 } 31373 return token; 31374 } 31375 function skipUntil(data, offset, what) { 31376 var length = what.length, dataLength = data.length; 31377 var skipped = 0; 31378 while (offset < dataLength) { 31379 var i = 0; 31380 while (i < length && data[offset + i] === what[i]) { 31381 ++i; 31382 } 31383 if (i >= length) { 31384 break; 31385 } 31386 offset++; 31387 skipped++; 31388 } 31389 return skipped; 31390 } 31391 var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; 31392 var trailerBytes = new Uint8Array([ 31393 116, 31394 114, 31395 97, 31396 105, 31397 108, 31398 101, 31399 114 31400 ]); 31401 var startxrefBytes = new Uint8Array([ 31402 115, 31403 116, 31404 97, 31405 114, 31406 116, 31407 120, 31408 114, 31409 101, 31410 102 31411 ]); 31412 var endobjBytes = new Uint8Array([ 31413 101, 31414 110, 31415 100, 31416 111, 31417 98, 31418 106 31419 ]); 31420 var xrefBytes = new Uint8Array([ 31421 47, 31422 88, 31423 82, 31424 101, 31425 102 31426 ]); 31427 this.entries.length = 0; 31428 var stream = this.stream; 31429 stream.pos = 0; 31430 var buffer = stream.getBytes(); 31431 var position = stream.start, length = buffer.length; 31432 var trailers = [], xrefStms = []; 31433 while (position < length) { 31434 var ch = buffer[position]; 31435 if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { 31436 ++position; 31437 continue; 31438 } 31439 if (ch === PERCENT) { 31440 do { 31441 ++position; 31442 if (position >= length) { 31443 break; 31444 } 31445 ch = buffer[position]; 31446 } while (ch !== LF && ch !== CR); 31447 continue; 31448 } 31449 var token = readToken(buffer, position); 31450 var m; 31451 if (token.indexOf('xref') === 0 && (token.length === 4 || /\s/.test(token[4]))) { 31452 position += skipUntil(buffer, position, trailerBytes); 31453 trailers.push(position); 31454 position += skipUntil(buffer, position, startxrefBytes); 31455 } else if (m = objRegExp.exec(token)) { 31456 if (typeof this.entries[m[1]] === 'undefined') { 31457 this.entries[m[1]] = { 31458 offset: position - stream.start, 31459 gen: m[2] | 0, 31460 uncompressed: true 31461 }; 31462 } 31463 var contentLength = skipUntil(buffer, position, endobjBytes) + 7; 31464 var content = buffer.subarray(position, position + contentLength); 31465 var xrefTagOffset = skipUntil(content, 0, xrefBytes); 31466 if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { 31467 xrefStms.push(position - stream.start); 31468 this.xrefstms[position - stream.start] = 1; 31469 } 31470 position += contentLength; 31471 } else if (token.indexOf('trailer') === 0 && (token.length === 7 || /\s/.test(token[7]))) { 31472 trailers.push(position); 31473 position += skipUntil(buffer, position, startxrefBytes); 31474 } else { 31475 position += token.length + 1; 31476 } 31477 } 31478 var i, ii; 31479 for (i = 0, ii = xrefStms.length; i < ii; ++i) { 31480 this.startXRefQueue.push(xrefStms[i]); 31481 this.readXRef(true); 31482 } 31483 var dict; 31484 for (i = 0, ii = trailers.length; i < ii; ++i) { 31485 stream.pos = trailers[i]; 31486 var parser = new Parser(new Lexer(stream), true, this, true); 31487 var obj = parser.getObj(); 31488 if (!isCmd(obj, 'trailer')) { 31489 continue; 31490 } 31491 dict = parser.getObj(); 31492 if (!isDict(dict)) { 31493 continue; 31494 } 31495 if (dict.has('ID')) { 31496 return dict; 31497 } 31498 } 31499 if (dict) { 31500 return dict; 31501 } 31502 throw new InvalidPDFException('Invalid PDF structure'); 31503 }, 31504 readXRef: function XRef_readXRef(recoveryMode) { 31505 var stream = this.stream; 31506 try { 31507 while (this.startXRefQueue.length) { 31508 var startXRef = this.startXRefQueue[0]; 31509 stream.pos = startXRef + stream.start; 31510 var parser = new Parser(new Lexer(stream), true, this); 31511 var obj = parser.getObj(); 31512 var dict; 31513 if (isCmd(obj, 'xref')) { 31514 dict = this.processXRefTable(parser); 31515 if (!this.topDict) { 31516 this.topDict = dict; 31517 } 31518 obj = dict.get('XRefStm'); 31519 if (isInt(obj)) { 31520 var pos = obj; 31521 if (!(pos in this.xrefstms)) { 31522 this.xrefstms[pos] = 1; 31523 this.startXRefQueue.push(pos); 31524 } 31525 } 31526 } else if (isInt(obj)) { 31527 if (!isInt(parser.getObj()) || !isCmd(parser.getObj(), 'obj') || !isStream(obj = parser.getObj())) { 31528 error('Invalid XRef stream'); 31529 } 31530 dict = this.processXRefStream(obj); 31531 if (!this.topDict) { 31532 this.topDict = dict; 31533 } 31534 if (!dict) { 31535 error('Failed to read XRef stream'); 31536 } 31537 } else { 31538 error('Invalid XRef stream header'); 31539 } 31540 obj = dict.get('Prev'); 31541 if (isInt(obj)) { 31542 this.startXRefQueue.push(obj); 31543 } else if (isRef(obj)) { 31544 this.startXRefQueue.push(obj.num); 31545 } 31546 this.startXRefQueue.shift(); 31547 } 31548 return this.topDict; 31549 } catch (e) { 31550 if (e instanceof MissingDataException) { 31551 throw e; 31552 } 31553 info('(while reading XRef): ' + e); 31554 } 31555 if (recoveryMode) { 31556 return; 31557 } 31558 throw new XRefParseException(); 31559 }, 31560 getEntry: function XRef_getEntry(i) { 31561 var xrefEntry = this.entries[i]; 31562 if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { 31563 return xrefEntry; 31564 } 31565 return null; 31566 }, 31567 fetchIfRef: function XRef_fetchIfRef(obj, suppressEncryption) { 31568 if (!isRef(obj)) { 31569 return obj; 31570 } 31571 return this.fetch(obj, suppressEncryption); 31572 }, 31573 fetch: function XRef_fetch(ref, suppressEncryption) { 31574 assert(isRef(ref), 'ref object is not a reference'); 31575 var num = ref.num; 31576 if (num in this.cache) { 31577 var cacheEntry = this.cache[num]; 31578 if (isDict(cacheEntry) && !cacheEntry.objId) { 31579 cacheEntry.objId = ref.toString(); 31580 } 31581 return cacheEntry; 31582 } 31583 var xrefEntry = this.getEntry(num); 31584 if (xrefEntry === null) { 31585 return this.cache[num] = null; 31586 } 31587 if (xrefEntry.uncompressed) { 31588 xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); 31589 } else { 31590 xrefEntry = this.fetchCompressed(xrefEntry, suppressEncryption); 31591 } 31592 if (isDict(xrefEntry)) { 31593 xrefEntry.objId = ref.toString(); 31594 } else if (isStream(xrefEntry)) { 31595 xrefEntry.dict.objId = ref.toString(); 31596 } 31597 return xrefEntry; 31598 }, 31599 fetchUncompressed: function XRef_fetchUncompressed(ref, xrefEntry, suppressEncryption) { 31600 var gen = ref.gen; 31601 var num = ref.num; 31602 if (xrefEntry.gen !== gen) { 31603 error('inconsistent generation in XRef'); 31604 } 31605 var stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); 31606 var parser = new Parser(new Lexer(stream), true, this); 31607 var obj1 = parser.getObj(); 31608 var obj2 = parser.getObj(); 31609 var obj3 = parser.getObj(); 31610 if (!isInt(obj1) || parseInt(obj1, 10) !== num || !isInt(obj2) || parseInt(obj2, 10) !== gen || !isCmd(obj3)) { 31611 error('bad XRef entry'); 31612 } 31613 if (!isCmd(obj3, 'obj')) { 31614 if (obj3.cmd.indexOf('obj') === 0) { 31615 num = parseInt(obj3.cmd.substring(3), 10); 31616 if (!isNaN(num)) { 31617 return num; 31618 } 31619 } 31620 error('bad XRef entry'); 31621 } 31622 if (this.encrypt && !suppressEncryption) { 31623 xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); 31624 } else { 31625 xrefEntry = parser.getObj(); 31626 } 31627 if (!isStream(xrefEntry)) { 31628 this.cache[num] = xrefEntry; 31629 } 31630 return xrefEntry; 31631 }, 31632 fetchCompressed: function XRef_fetchCompressed(xrefEntry, suppressEncryption) { 31633 var tableOffset = xrefEntry.offset; 31634 var stream = this.fetch(new Ref(tableOffset, 0)); 31635 if (!isStream(stream)) { 31636 error('bad ObjStm stream'); 31637 } 31638 var first = stream.dict.get('First'); 31639 var n = stream.dict.get('N'); 31640 if (!isInt(first) || !isInt(n)) { 31641 error('invalid first and n parameters for ObjStm stream'); 31642 } 31643 var parser = new Parser(new Lexer(stream), false, this); 31644 parser.allowStreams = true;
31645 var i, entries = [], num, nums = []; 31646 for (i = 0; i < n; ++i) { 31647 num = parser.getObj(); 31648 if (!isInt(num)) { 31649 error('invalid object number in the ObjStm stream: ' + num); 31650 } 31651 nums.push(num); 31652 var offset = parser.getObj(); 31653 if (!isInt(offset)) { 31654 error('invalid object offset in the ObjStm stream: ' + offset); 31655 } 31656 } 31657 for (i = 0; i < n; ++i) { 31658 entries.push(parser.getObj()); 31659 if (isCmd(parser.buf1, 'endobj')) { 31660 parser.shift(); 31661 } 31662 num = nums[i]; 31663 var entry = this.entries[num]; 31664 if (entry && entry.offset === tableOffset && entry.gen === i) { 31665 this.cache[num] = entries[i]; 31666 } 31667 } 31668 xrefEntry = entries[xrefEntry.gen]; 31669 if (xrefEntry === undefined) { 31670 error('bad XRef entry for compressed object'); 31671 } 31672 return xrefEntry; 31673 }, 31674 fetchIfRefAsync: function XRef_fetchIfRefAsync(obj, suppressEncryption) { 31675 if (!isRef(obj)) { 31676 return Promise.resolve(obj); 31677 } 31678 return this.fetchAsync(obj, suppressEncryption); 31679 }, 31680 fetchAsync: function XRef_fetchAsync(ref, suppressEncryption) { 31681 var streamManager = this.stream.manager; 31682 var xref = this; 31683 return new Promise(function tryFetch(resolve, reject) { 31684 try { 31685 resolve(xref.fetch(ref, suppressEncryption)); 31686 } catch (e) { 31687 if (e instanceof MissingDataException) { 31688 streamManager.requestRange(e.begin, e.end).then(function () { 31689 tryFetch(resolve, reject); 31690 }, reject); 31691 return; 31692 } 31693 reject(e); 31694 } 31695 }); 31696 }, 31697 getCatalogObj: function XRef_getCatalogObj() { 31698 return this.root; 31699 } 31700 }; 31701 return XRef; 31702}(); 31703var NameOrNumberTree = function NameOrNumberTreeClosure() { 31704 function NameOrNumberTree(root, xref) { 31705 throw new Error('Cannot initialize NameOrNumberTree.'); 31706 } 31707 NameOrNumberTree.prototype = { 31708 getAll: function NameOrNumberTree_getAll() { 31709 var dict = Object.create(null); 31710 if (!this.root) { 31711 return dict; 31712 } 31713 var xref = this.xref; 31714 var processed = new RefSet(); 31715 processed.put(this.root); 31716 var queue = [this.root]; 31717 while (queue.length > 0) { 31718 var i, n; 31719 var obj = xref.fetchIfRef(queue.shift()); 31720 if (!isDict(obj)) { 31721 continue; 31722 } 31723 if (obj.has('Kids')) { 31724 var kids = obj.get('Kids'); 31725 for (i = 0, n = kids.length; i < n; i++) { 31726 var kid = kids[i]; 31727 assert(!processed.has(kid), 'Duplicate entry in "' + this._type + '" tree.'); 31728 queue.push(kid); 31729 processed.put(kid); 31730 } 31731 continue; 31732 } 31733 var entries = obj.get(this._type); 31734 if (isArray(entries)) { 31735 for (i = 0, n = entries.length; i < n; i += 2) { 31736 dict[xref.fetchIfRef(entries[i])] = xref.fetchIfRef(entries[i + 1]); 31737 } 31738 } 31739 } 31740 return dict; 31741 }, 31742 get: function NameOrNumberTree_get(key) { 31743 if (!this.root) { 31744 return null; 31745 } 31746 var xref = this.xref; 31747 var kidsOrEntries = xref.fetchIfRef(this.root); 31748 var loopCount = 0; 31749 var MAX_LEVELS = 10; 31750 var l, r, m; 31751 while (kidsOrEntries.has('Kids')) { 31752 if (++loopCount > MAX_LEVELS) { 31753 warn('Search depth limit reached for "' + this._type + '" tree.'); 31754 return null; 31755 } 31756 var kids = kidsOrEntries.get('Kids'); 31757 if (!isArray(kids)) { 31758 return null; 31759 } 31760 l = 0; 31761 r = kids.length - 1; 31762 while (l <= r) { 31763 m = l + r >> 1; 31764 var kid = xref.fetchIfRef(kids[m]); 31765 var limits = kid.get('Limits'); 31766 if (key < xref.fetchIfRef(limits[0])) { 31767 r = m - 1; 31768 } else if (key > xref.fetchIfRef(limits[1])) { 31769 l = m + 1; 31770 } else { 31771 kidsOrEntries = xref.fetchIfRef(kids[m]); 31772 break; 31773 } 31774 } 31775 if (l > r) { 31776 return null; 31777 } 31778 } 31779 var entries = kidsOrEntries.get(this._type); 31780 if (isArray(entries)) { 31781 l = 0; 31782 r = entries.length - 2; 31783 while (l <= r) { 31784 m = l + r & ~1; 31785 var currentKey = xref.fetchIfRef(entries[m]); 31786 if (key < currentKey) { 31787 r = m - 2; 31788 } else if (key > currentKey) { 31789 l = m + 2; 31790 } else { 31791 return xref.fetchIfRef(entries[m + 1]); 31792 } 31793 } 31794 } 31795 return null; 31796 } 31797 }; 31798 return NameOrNumberTree; 31799}(); 31800var NameTree = function NameTreeClosure() { 31801 function NameTree(root, xref) { 31802 this.root = root; 31803 this.xref = xref; 31804 this._type = 'Names'; 31805 } 31806 Util.inherit(NameTree, NameOrNumberTree, {}); 31807 return NameTree; 31808}(); 31809var NumberTree = function NumberTreeClosure() { 31810 function NumberTree(root, xref) { 31811 this.root = root; 31812 this.xref = xref; 31813 this._type = 'Nums'; 31814 } 31815 Util.inherit(NumberTree, NameOrNumberTree, {}); 31816 return NumberTree; 31817}(); 31818var FileSpec = function FileSpecClosure() { 31819 function FileSpec(root, xref) { 31820 if (!root || !isDict(root)) { 31821 return; 31822 } 31823 this.xref = xref; 31824 this.root = root; 31825 if (root.has('FS')) { 31826 this.fs = root.get('FS'); 31827 } 31828 this.description = root.has('Desc') ? stringToPDFString(root.get('Desc')) : ''; 31829 if (root.has('RF')) { 31830 warn('Related file specifications are not supported'); 31831 } 31832 this.contentAvailable = true; 31833 if (!root.has('EF')) { 31834 this.contentAvailable = false;
vendor: 5,016 bytes, lines 31835-32020
31835 warn('Non-embedded file specifications are not supported'); 31836 } 31837 } 31838 function pickPlatformItem(dict) { 31839 if (dict.has('UF')) { 31840 return dict.get('UF'); 31841 } else if (dict.has('F')) { 31842 return dict.get('F'); 31843 } else if (dict.has('Unix')) { 31844 return dict.get('Unix'); 31845 } else if (dict.has('Mac')) { 31846 return dict.get('Mac'); 31847 } else if (dict.has('DOS')) { 31848 return dict.get('DOS'); 31849 } 31850 return null; 31851 } 31852 FileSpec.prototype = { 31853 get filename() { 31854 if (!this._filename && this.root) { 31855 var filename = pickPlatformItem(this.root) || 'unnamed'; 31856 this._filename = stringToPDFString(filename).replace(/\\\\/g, '\\').replace(/\\\//g, '/').replace(/\\/g, '/'); 31857 } 31858 return this._filename; 31859 }, 31860 get content() { 31861 if (!this.contentAvailable) { 31862 return null; 31863 } 31864 if (!this.contentRef && this.root) { 31865 this.contentRef = pickPlatformItem(this.root.get('EF')); 31866 } 31867 var content = null; 31868 if (this.contentRef) { 31869 var xref = this.xref; 31870 var fileObj = xref.fetchIfRef(this.contentRef); 31871 if (fileObj && isStream(fileObj)) { 31872 content = fileObj.getBytes(); 31873 } else { 31874 warn('Embedded file specification points to non-existing/invalid ' + 'content'); 31875 } 31876 } else { 31877 warn('Embedded file specification does not have a content'); 31878 } 31879 return content; 31880 }, 31881 get serializable() { 31882 return { 31883 filename: this.filename, 31884 content: this.content 31885 }; 31886 } 31887 }; 31888 return FileSpec; 31889}(); 31890var ObjectLoader = function () { 31891 function mayHaveChildren(value) { 31892 return isRef(value) || isDict(value) || isArray(value) || isStream(value); 31893 } 31894 function addChildren(node, nodesToVisit) { 31895 var value; 31896 if (isDict(node) || isStream(node)) { 31897 var map; 31898 if (isDict(node)) { 31899 map = node.map; 31900 } else { 31901 map = node.dict.map; 31902 } 31903 for (var key in map) { 31904 value = map[key]; 31905 if (mayHaveChildren(value)) { 31906 nodesToVisit.push(value); 31907 } 31908 } 31909 } else if (isArray(node)) { 31910 for (var i = 0, ii = node.length; i < ii; i++) { 31911 value = node[i]; 31912 if (mayHaveChildren(value)) { 31913 nodesToVisit.push(value); 31914 } 31915 } 31916 } 31917 } 31918 function ObjectLoader(obj, keys, xref) { 31919 this.obj = obj; 31920 this.keys = keys; 31921 this.xref = xref; 31922 this.refSet = null; 31923 this.capability = null; 31924 } 31925 ObjectLoader.prototype = { 31926 load: function ObjectLoader_load() { 31927 var keys = this.keys; 31928 this.capability = createPromiseCapability(); 31929 if (!(this.xref.stream instanceof ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) { 31930 this.capability.resolve(); 31931 return this.capability.promise; 31932 } 31933 this.refSet = new RefSet(); 31934 var nodesToVisit = []; 31935 for (var i = 0; i < keys.length; i++) { 31936 nodesToVisit.push(this.obj[keys[i]]); 31937 } 31938 this._walk(nodesToVisit); 31939 return this.capability.promise; 31940 }, 31941 _walk: function ObjectLoader_walk(nodesToVisit) { 31942 var nodesToRevisit = []; 31943 var pendingRequests = []; 31944 while (nodesToVisit.length) { 31945 var currentNode = nodesToVisit.pop(); 31946 if (isRef(currentNode)) { 31947 if (this.refSet.has(currentNode)) { 31948 continue; 31949 } 31950 try { 31951 var ref = currentNode; 31952 this.refSet.put(ref); 31953 currentNode = this.xref.fetch(currentNode); 31954 } catch (e) { 31955 if (!(e instanceof MissingDataException)) { 31956 throw e; 31957 } 31958 nodesToRevisit.push(currentNode); 31959 pendingRequests.push({ 31960 begin: e.begin, 31961 end: e.end 31962 }); 31963 } 31964 } 31965 if (currentNode && currentNode.getBaseStreams) { 31966 var baseStreams = currentNode.getBaseStreams(); 31967 var foundMissingData = false; 31968 for (var i = 0; i < baseStreams.length; i++) { 31969 var stream = baseStreams[i]; 31970 if (stream.getMissingChunks && stream.getMissingChunks().length) { 31971 foundMissingData = true; 31972 pendingRequests.push({ 31973 begin: stream.start, 31974 end: stream.end 31975 }); 31976 } 31977 } 31978 if (foundMissingData) { 31979 nodesToRevisit.push(currentNode); 31980 } 31981 } 31982 addChildren(currentNode, nodesToVisit); 31983 } 31984 if (pendingRequests.length) { 31985 this.xref.stream.manager.requestRanges(pendingRequests).then(function pendingRequestCallback() { 31986 nodesToVisit = nodesToRevisit; 31987 for (var i = 0; i < nodesToRevisit.length; i++) { 31988 var node = nodesToRevisit[i]; 31989 if (isRef(node)) { 31990 this.refSet.remove(node); 31991 } 31992 } 31993 this._walk(nodesToVisit); 31994 }.bind(this), this.capability.reject); 31995 return; 31996 } 31997 this.refSet = null; 31998 this.capability.resolve(); 31999 } 32000 }; 32001 return ObjectLoader; 32002}(); 32003exports.Catalog = Catalog; 32004exports.ObjectLoader = ObjectLoader; 32005exports.XRef = XRef; 32006exports.FileSpec = FileSpec; 32007 32008/***/ }), 32009/* 17 */ 32010/***/ (function(module, exports, __w_pdfjs_require__) { 32011 32012"use strict"; 32013 32014var sharedUtil = __w_pdfjs_require__(0); 32015var getLookupTableFactory = sharedUtil.getLookupTableFactory; 32016var getStdFontMap = getLookupTableFactory(function (t) { 32017 t['ArialNarrow'] = 'Helvetica'; 32018 t['ArialNarrow-Bold'] = 'Helvetica-Bold'; 32019 t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique'; 32020 t['ArialNarrow-Italic'] = 'Helvetica-Oblique';
32021 t['ArialBlack'] = 'Helvetica'; 32022 t['ArialBlack-Bold'] = 'Helvetica-Bold'; 32023 t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique'; 32024 t['ArialBlack-Italic'] = 'Helvetica-Oblique'; 32025 t['Arial-Black'] = 'Helvetica'; 32026 t['Arial-Black-Bold'] = 'Helvetica-Bold'; 32027 t['Arial-Black-BoldItalic'] = 'Helvetica-BoldOblique'; 32028 t['Arial-Black-Italic'] = 'Helvetica-Oblique'; 32029 t['Arial'] = 'Helvetica'; 32030 t['Arial-Bold'] = 'Helvetica-Bold'; 32031 t['Arial-BoldItalic'] = 'Helvetica-BoldOblique'; 32032 t['Arial-Italic'] = 'Helvetica-Oblique'; 32033 t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique'; 32034 t['Arial-BoldMT'] = 'Helvetica-Bold'; 32035 t['Arial-ItalicMT'] = 'Helvetica-Oblique'; 32036 t['ArialMT'] = 'Helvetica'; 32037 t['Courier-Bold'] = 'Courier-Bold'; 32038 t['Courier-BoldItalic'] = 'Courier-BoldOblique'; 32039 t['Courier-Italic'] = 'Courier-Oblique'; 32040 t['CourierNew'] = 'Courier'; 32041 t['CourierNew-Bold'] = 'Courier-Bold'; 32042 t['CourierNew-BoldItalic'] = 'Courier-BoldOblique'; 32043 t['CourierNew-Italic'] = 'Courier-Oblique'; 32044 t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique'; 32045 t['CourierNewPS-BoldMT'] = 'Courier-Bold'; 32046 t['CourierNewPS-ItalicMT'] = 'Courier-Oblique'; 32047 t['CourierNewPSMT'] = 'Courier'; 32048 t['Helvetica'] = 'Helvetica'; 32049 t['Helvetica-Bold'] = 'Helvetica-Bold'; 32050 t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique'; 32051 t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique'; 32052 t['Helvetica-Italic'] = 'Helvetica-Oblique'; 32053 t['Helvetica-Oblique'] = 'Helvetica-Oblique'; 32054 t['Symbol-Bold'] = 'Symbol'; 32055 t['Symbol-BoldItalic'] = 'Symbol'; 32056 t['Symbol-Italic'] = 'Symbol'; 32057 t['TimesNewRoman'] = 'Times-Roman'; 32058 t['TimesNewRoman-Bold'] = 'Times-Bold'; 32059 t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic'; 32060 t['TimesNewRoman-Italic'] = 'Times-Italic'; 32061 t['TimesNewRomanPS'] = 'Times-Roman'; 32062 t['TimesNewRomanPS-Bold'] = 'Times-Bold'; 32063 t['TimesNewRomanPS-BoldItalic'] = 'Times-BoldItalic'; 32064 t['TimesNewRomanPS-BoldItalicMT'] = 'Times-BoldItalic'; 32065 t['TimesNewRomanPS-BoldMT'] = 'Times-Bold'; 32066 t['TimesNewRomanPS-Italic'] = 'Times-Italic'; 32067 t['TimesNewRomanPS-ItalicMT'] = 'Times-Italic'; 32068 t['TimesNewRomanPSMT'] = 'Times-Roman'; 32069 t['TimesNewRomanPSMT-Bold'] = 'Times-Bold'; 32070 t['TimesNewRomanPSMT-BoldItalic'] = 'Times-BoldItalic'; 32071 t['TimesNewRomanPSMT-Italic'] = 'Times-Italic'; 32072}); 32073var getNonStdFontMap = getLookupTableFactory(function (t) { 32074 t['CenturyGothic'] = 'Helvetica'; 32075 t['CenturyGothic-Bold'] = 'Helvetica-Bold'; 32076 t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique'; 32077 t['CenturyGothic-Italic'] = 'Helvetica-Oblique'; 32078 t['ComicSansMS'] = 'Comic Sans MS'; 32079 t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold'; 32080 t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic'; 32081 t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic'; 32082 t['LucidaConsole'] = 'Courier'; 32083 t['LucidaConsole-Bold'] = 'Courier-Bold'; 32084 t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique'; 32085 t['LucidaConsole-Italic'] = 'Courier-Oblique'; 32086 t['MS-Gothic'] = 'MS Gothic'; 32087 t['MS-Gothic-Bold'] = 'MS Gothic-Bold'; 32088 t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic'; 32089 t['MS-Gothic-Italic'] = 'MS Gothic-Italic'; 32090 t['MS-Mincho'] = 'MS Mincho'; 32091 t['MS-Mincho-Bold'] = 'MS Mincho-Bold'; 32092 t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic'; 32093 t['MS-Mincho-Italic'] = 'MS Mincho-Italic'; 32094 t['MS-PGothic'] = 'MS PGothic'; 32095 t['MS-PGothic-Bold'] = 'MS PGothic-Bold'; 32096 t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic'; 32097 t['MS-PGothic-Italic'] = 'MS PGothic-Italic'; 32098 t['MS-PMincho'] = 'MS PMincho'; 32099 t['MS-PMincho-Bold'] = 'MS PMincho-Bold'; 32100 t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic'; 32101 t['MS-PMincho-Italic'] = 'MS PMincho-Italic'; 32102 t['NuptialScript'] = 'Times-Italic'; 32103 t['Wingdings'] = 'ZapfDingbats'; 32104}); 32105var getSerifFonts = getLookupTableFactory(function (t) { 32106 t['Adobe Jenson'] = true; 32107 t['Adobe Text'] = true; 32108 t['Albertus'] = true; 32109 t['Aldus'] = true; 32110 t['Alexandria'] = true; 32111 t['Algerian'] = true; 32112 t['American Typewriter'] = true; 32113 t['Antiqua'] = true; 32114 t['Apex'] = true; 32115 t['Arno'] = true; 32116 t['Aster'] = true; 32117 t['Aurora'] = true; 32118 t['Baskerville'] = true; 32119 t['Bell'] = true; 32120 t['Bembo'] = true; 32121 t['Bembo Schoolbook'] = true; 32122 t['Benguiat'] = true; 32123 t['Berkeley Old Style'] = true; 32124 t['Bernhard Modern'] = true; 32125 t['Berthold City'] = true; 32126 t['Bodoni'] = true; 32127 t['Bauer Bodoni'] = true; 32128 t['Book Antiqua'] = true; 32129 t['Bookman'] = true; 32130 t['Bordeaux Roman'] = true; 32131 t['Californian FB'] = true; 32132 t['Calisto'] = true; 32133 t['Calvert'] = true; 32134 t['Capitals'] = true; 32135 t['Cambria'] = true; 32136 t['Cartier'] = true; 32137 t['Caslon'] = true; 32138 t['Catull'] = true; 32139 t['Centaur'] = true; 32140 t['Century Old Style'] = true; 32141 t['Century Schoolbook'] = true; 32142 t['Chaparral'] = true; 32143 t['Charis SIL'] = true; 32144 t['Cheltenham'] = true; 32145 t['Cholla Slab'] = true; 32146 t['Clarendon'] = true; 32147 t['Clearface'] = true; 32148 t['Cochin'] = true; 32149 t['Colonna'] = true; 32150 t['Computer Modern'] = true; 32151 t['Concrete Roman'] = true; 32152 t['Constantia'] = true;
32153 t['Cooper Black'] = true; 32154 t['Corona'] = true; 32155 t['Ecotype'] = true; 32156 t['Egyptienne'] = true; 32157 t['Elephant'] = true; 32158 t['Excelsior'] = true; 32159 t['Fairfield'] = true; 32160 t['FF Scala'] = true; 32161 t['Folkard'] = true; 32162 t['Footlight'] = true; 32163 t['FreeSerif'] = true; 32164 t['Friz Quadrata'] = true; 32165 t['Garamond'] = true; 32166 t['Gentium'] = true; 32167 t['Georgia'] = true; 32168 t['Gloucester'] = true; 32169 t['Goudy Old Style'] = true; 32170 t['Goudy Schoolbook'] = true; 32171 t['Goudy Pro Font'] = true; 32172 t['Granjon'] = true; 32173 t['Guardian Egyptian'] = true; 32174 t['Heather'] = true; 32175 t['Hercules'] = true; 32176 t['High Tower Text'] = true; 32177 t['Hiroshige'] = true; 32178 t['Hoefler Text'] = true; 32179 t['Humana Serif'] = true; 32180 t['Imprint'] = true; 32181 t['Ionic No. 5'] = true; 32182 t['Janson'] = true; 32183 t['Joanna'] = true; 32184 t['Korinna'] = true; 32185 t['Lexicon'] = true; 32186 t['Liberation Serif'] = true; 32187 t['Linux Libertine'] = true; 32188 t['Literaturnaya'] = true; 32189 t['Lucida'] = true; 32190 t['Lucida Bright'] = true; 32191 t['Melior'] = true; 32192 t['Memphis'] = true; 32193 t['Miller'] = true; 32194 t['Minion'] = true; 32195 t['Modern'] = true; 32196 t['Mona Lisa'] = true; 32197 t['Mrs Eaves'] = true; 32198 t['MS Serif'] = true; 32199 t['Museo Slab'] = true; 32200 t['New York'] = true; 32201 t['Nimbus Roman'] = true; 32202 t['NPS Rawlinson Roadway'] = true; 32203 t['NuptialScript'] = true; 32204 t['Palatino'] = true; 32205 t['Perpetua'] = true; 32206 t['Plantin'] = true; 32207 t['Plantin Schoolbook'] = true; 32208 t['Playbill'] = true; 32209 t['Poor Richard'] = true; 32210 t['Rawlinson Roadway'] = true; 32211 t['Renault'] = true; 32212 t['Requiem'] = true; 32213 t['Rockwell'] = true; 32214 t['Roman'] = true; 32215 t['Rotis Serif'] = true; 32216 t['Sabon'] = true; 32217 t['Scala'] = true; 32218 t['Seagull'] = true; 32219 t['Sistina'] = true; 32220 t['Souvenir'] = true; 32221 t['STIX'] = true; 32222 t['Stone Informal'] = true; 32223 t['Stone Serif'] = true; 32224 t['Sylfaen'] = true; 32225 t['Times'] = true; 32226 t['Trajan'] = true; 32227 t['Trinité'] = true; 32228 t['Trump Mediaeval'] = true; 32229 t['Utopia'] = true; 32230 t['Vale Type'] = true; 32231 t['Bitstream Vera'] = true; 32232 t['Vera Serif'] = true; 32233 t['Versailles'] = true;
32234 t['Wanted'] = true; 32235 t['Weiss'] = true; 32236 t['Wide Latin'] = true; 32237 t['Windsor'] = true; 32238 t['XITS'] = true; 32239}); 32240var getSymbolsFonts = getLookupTableFactory(function (t) { 32241 t['Dingbats'] = true; 32242 t['Symbol'] = true; 32243 t['ZapfDingbats'] = true; 32244}); 32245var getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { 32246 t[2] = 10; 32247 t[3] = 32; 32248 t[4] = 33; 32249 t[5] = 34; 32250 t[6] = 35; 32251 t[7] = 36; 32252 t[8] = 37; 32253 t[9] = 38; 32254 t[10] = 39; 32255 t[11] = 40; 32256 t[12] = 41; 32257 t[13] = 42; 32258 t[14] = 43; 32259 t[15] = 44; 32260 t[16] = 45; 32261 t[17] = 46; 32262 t[18] = 47; 32263 t[19] = 48; 32264 t[20] = 49; 32265 t[21] = 50; 32266 t[22] = 51; 32267 t[23] = 52; 32268 t[24] = 53; 32269 t[25] = 54; 32270 t[26] = 55; 32271 t[27] = 56; 32272 t[28] = 57; 32273 t[29] = 58; 32274 t[30] = 894; 32275 t[31] = 60; 32276 t[32] = 61; 32277 t[33] = 62; 32278 t[34] = 63; 32279 t[35] = 64; 32280 t[36] = 65; 32281 t[37] = 66; 32282 t[38] = 67; 32283 t[39] = 68; 32284 t[40] = 69; 32285 t[41] = 70; 32286 t[42] = 71; 32287 t[43] = 72; 32288 t[44] = 73; 32289 t[45] = 74; 32290 t[46] = 75; 32291 t[47] = 76; 32292 t[48] = 77; 32293 t[49] = 78; 32294 t[50] = 79; 32295 t[51] = 80; 32296 t[52] = 81; 32297 t[53] = 82; 32298 t[54] = 83; 32299 t[55] = 84; 32300 t[56] = 85; 32301 t[57] = 86; 32302 t[58] = 87; 32303 t[59] = 88; 32304 t[60] = 89; 32305 t[61] = 90; 32306 t[62] = 91; 32307 t[63] = 92; 32308 t[64] = 93; 32309 t[65] = 94; 32310 t[66] = 95; 32311 t[67] = 96; 32312 t[68] = 97; 32313 t[69] = 98; 32314 t[70] = 99; 32315 t[71] = 100; 32316 t[72] = 101; 32317 t[73] = 102; 32318 t[74] = 103; 32319 t[75] = 104; 32320 t[76] = 105; 32321 t[77] = 106; 32322 t[78] = 107; 32323 t[79] = 108; 32324 t[80] = 109; 32325 t[81] = 110; 32326 t[82] = 111; 32327 t[83] = 112; 32328 t[84] = 113; 32329 t[85] = 114; 32330 t[86] = 115; 32331 t[87] = 116; 32332 t[88] = 117; 32333 t[89] = 118; 32334 t[90] = 119; 32335 t[91] = 120; 32336 t[92] = 121; 32337 t[93] = 122; 32338 t[94] = 123; 32339 t[95] = 124; 32340 t[96] = 125; 32341 t[97] = 126; 32342 t[98] = 196; 32343 t[99] = 197; 32344 t[100] = 199; 32345 t[101] = 201; 32346 t[102] = 209; 32347 t[103] = 214; 32348 t[104] = 220; 32349 t[105] = 225; 32350 t[106] = 224; 32351 t[107] = 226; 32352 t[108] = 228; 32353 t[109] = 227; 32354 t[110] = 229; 32355 t[111] = 231; 32356 t[112] = 233; 32357 t[113] = 232; 32358 t[114] = 234; 32359 t[115] = 235; 32360 t[116] = 237; 32361 t[117] = 236; 32362 t[118] = 238; 32363 t[119] = 239; 32364 t[120] = 241; 32365 t[121] = 243; 32366 t[122] = 242; 32367 t[123] = 244; 32368 t[124] = 246; 32369 t[125] = 245; 32370 t[126] = 250; 32371 t[127] = 249; 32372 t[128] = 251; 32373 t[129] = 252; 32374 t[130] = 8224; 32375 t[131] = 176; 32376 t[132] = 162; 32377 t[133] = 163; 32378 t[134] = 167; 32379 t[135] = 8226; 32380 t[136] = 182; 32381 t[137] = 223; 32382 t[138] = 174; 32383 t[139] = 169; 32384 t[140] = 8482; 32385 t[141] = 180; 32386 t[142] = 168; 32387 t[143] = 8800; 32388 t[144] = 198; 32389 t[145] = 216; 32390 t[146] = 8734; 32391 t[147] = 177; 32392 t[148] = 8804; 32393 t[149] = 8805; 32394 t[150] = 165; 32395 t[151] = 181; 32396 t[152] = 8706; 32397 t[153] = 8721; 32398 t[154] = 8719; 32399 t[156] = 8747; 32400 t[157] = 170; 32401 t[158] = 186; 32402 t[159] = 8486; 32403 t[160] = 230; 32404 t[161] = 248; 32405 t[162] = 191; 32406 t[163] = 161; 32407 t[164] = 172; 32408 t[165] = 8730; 32409 t[166] = 402; 32410 t[167] = 8776; 32411 t[168] = 8710; 32412 t[169] = 171; 32413 t[170] = 187; 32414 t[171] = 8230; 32415 t[210] = 218; 32416 t[223] = 711; 32417 t[224] = 321; 32418 t[225] = 322; 32419 t[227] = 353; 32420 t[229] = 382; 32421 t[234] = 253; 32422 t[252] = 263; 32423 t[253] = 268; 32424 t[254] = 269; 32425 t[258] = 258; 32426 t[260] = 260; 32427 t[261] = 261; 32428 t[265] = 280; 32429 t[266] = 281; 32430 t[268] = 283; 32431 t[269] = 313; 32432 t[275] = 323; 32433 t[276] = 324; 32434 t[278] = 328; 32435 t[284] = 345; 32436 t[285] = 346; 32437 t[286] = 347; 32438 t[292] = 367;
32439 t[295] = 377; 32440 t[296] = 378; 32441 t[298] = 380; 32442 t[305] = 963; 32443 t[306] = 964; 32444 t[307] = 966; 32445 t[308] = 8215; 32446 t[309] = 8252; 32447 t[310] = 8319; 32448 t[311] = 8359; 32449 t[312] = 8592; 32450 t[313] = 8593; 32451 t[337] = 9552; 32452 t[493] = 1039; 32453 t[494] = 1040; 32454 t[705] = 1524; 32455 t[706] = 8362; 32456 t[710] = 64288; 32457 t[711] = 64298; 32458 t[759] = 1617; 32459 t[761] = 1776; 32460 t[763] = 1778; 32461 t[775] = 1652; 32462 t[777] = 1764; 32463 t[778] = 1780; 32464 t[779] = 1781; 32465 t[780] = 1782; 32466 t[782] = 771; 32467 t[783] = 64726; 32468 t[786] = 8363; 32469 t[788] = 8532; 32470 t[790] = 768; 32471 t[791] = 769; 32472 t[792] = 768; 32473 t[795] = 803; 32474 t[797] = 64336; 32475 t[798] = 64337; 32476 t[799] = 64342; 32477 t[800] = 64343; 32478 t[801] = 64344; 32479 t[802] = 64345; 32480 t[803] = 64362; 32481 t[804] = 64363; 32482 t[805] = 64364; 32483 t[2424] = 7821; 32484 t[2425] = 7822; 32485 t[2426] = 7823; 32486 t[2427] = 7824; 32487 t[2428] = 7825; 32488 t[2429] = 7826; 32489 t[2430] = 7827; 32490 t[2433] = 7682; 32491 t[2678] = 8045; 32492 t[2679] = 8046; 32493 t[2830] = 1552; 32494 t[2838] = 686; 32495 t[2840] = 751; 32496 t[2842] = 753; 32497 t[2843] = 754; 32498 t[2844] = 755; 32499 t[2846] = 757; 32500 t[2856] = 767; 32501 t[2857] = 848; 32502 t[2858] = 849; 32503 t[2862] = 853; 32504 t[2863] = 854; 32505 t[2864] = 855; 32506 t[2865] = 861; 32507 t[2866] = 862; 32508 t[2906] = 7460; 32509 t[2908] = 7462; 32510 t[2909] = 7463; 32511 t[2910] = 7464; 32512 t[2912] = 7466; 32513 t[2913] = 7467; 32514 t[2914] = 7468; 32515 t[2916] = 7470; 32516 t[2917] = 7471; 32517 t[2918] = 7472; 32518 t[2920] = 7474; 32519 t[2921] = 7475; 32520 t[2922] = 7476; 32521 t[2924] = 7478; 32522 t[2925] = 7479; 32523 t[2926] = 7480; 32524 t[2928] = 7482;
32525 t[2929] = 7483; 32526 t[2930] = 7484; 32527 t[2932] = 7486; 32528 t[2933] = 7487; 32529 t[2934] = 7488; 32530 t[2936] = 7490; 32531 t[2937] = 7491; 32532 t[2938] = 7492; 32533 t[2940] = 7494; 32534 t[2941] = 7495; 32535 t[2942] = 7496; 32536 t[2944] = 7498; 32537 t[2946] = 7500; 32538 t[2948] = 7502; 32539 t[2950] = 7504; 32540 t[2951] = 7505; 32541 t[2952] = 7506; 32542 t[2954] = 7508; 32543 t[2955] = 7509; 32544 t[2956] = 7510; 32545 t[2958] = 7512; 32546 t[2959] = 7513; 32547 t[2960] = 7514; 32548 t[2962] = 7516; 32549 t[2963] = 7517; 32550 t[2964] = 7518; 32551 t[2966] = 7520; 32552 t[2967] = 7521; 32553 t[2968] = 7522; 32554 t[2970] = 7524; 32555 t[2971] = 7525; 32556 t[2972] = 7526; 32557 t[2974] = 7528; 32558 t[2975] = 7529; 32559 t[2976] = 7530; 32560 t[2978] = 1537; 32561 t[2979] = 1538; 32562 t[2980] = 1539; 32563 t[2982] = 1549; 32564 t[2983] = 1551; 32565 t[2984] = 1552; 32566 t[2986] = 1554; 32567 t[2987] = 1555; 32568 t[2988] = 1556; 32569 t[2990] = 1623; 32570 t[2991] = 1624; 32571 t[2995] = 1775; 32572 t[2999] = 1791; 32573 t[3002] = 64290; 32574 t[3003] = 64291; 32575 t[3004] = 64292; 32576 t[3006] = 64294; 32577 t[3007] = 64295; 32578 t[3008] = 64296; 32579 t[3011] = 1900; 32580 t[3014] = 8223; 32581 t[3015] = 8244; 32582 t[3017] = 7532; 32583 t[3018] = 7533; 32584 t[3019] = 7534; 32585 t[3075] = 7590; 32586 t[3076] = 7591; 32587 t[3079] = 7594; 32588 t[3080] = 7595; 32589 t[3083] = 7598; 32590 t[3084] = 7599; 32591 t[3087] = 7602; 32592 t[3088] = 7603; 32593 t[3091] = 7606; 32594 t[3092] = 7607; 32595 t[3095] = 7610; 32596 t[3096] = 7611; 32597 t[3099] = 7614; 32598 t[3100] = 7615; 32599 t[3103] = 7618; 32600 t[3104] = 7619; 32601 t[3107] = 8337; 32602 t[3108] = 8338; 32603 t[3116] = 1884; 32604 t[3119] = 1885; 32605 t[3120] = 1885; 32606 t[3123] = 1886; 32607 t[3124] = 1886; 32608 t[3127] = 1887; 32609 t[3128] = 1887; 32610 t[3131] = 1888; 32611 t[3132] = 1888; 32612 t[3135] = 1889; 32613 t[3136] = 1889; 32614 t[3139] = 1890; 32615 t[3140] = 1890; 32616 t[3143] = 1891; 32617 t[3144] = 1891; 32618 t[3147] = 1892; 32619 t[3148] = 1892; 32620 t[3153] = 580; 32621 t[3154] = 581; 32622 t[3157] = 584; 32623 t[3158] = 585; 32624 t[3161] = 588; 32625 t[3162] = 589; 32626 t[3165] = 891; 32627 t[3166] = 892; 32628 t[3169] = 1274; 32629 t[3170] = 1275; 32630 t[3173] = 1278; 32631 t[3174] = 1279; 32632 t[3181] = 7622; 32633 t[3182] = 7623; 32634 t[3282] = 11799; 32635 t[3316] = 578; 32636 t[3379] = 42785; 32637 t[3393] = 1159; 32638 t[3416] = 8377; 32639}); 32640var getSupplementalGlyphMapForArialBlack = getLookupTableFactory(function (t) { 32641 t[227] = 322; 32642 t[264] = 261; 32643 t[291] = 346; 32644}); 32645exports.getStdFontMap = getStdFontMap; 32646exports.getNonStdFontMap = getNonStdFontMap; 32647exports.getSerifFonts = getSerifFonts; 32648exports.getSymbolsFonts = getSymbolsFonts; 32649exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts; 32650exports.getSupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack; 32651 32652/***/ }), 32653/* 18 */ 32654/***/ (function(module, exports, __w_pdfjs_require__) { 32655 32656"use strict"; 32657 32658var sharedUtil = __w_pdfjs_require__(0); 32659var getLookupTableFactory = sharedUtil.getLookupTableFactory;
32660var getSpecialPUASymbols = getLookupTableFactory(function (t) { 32661 t[63721] = 0x00A9; 32662 t[63193] = 0x00A9; 32663 t[63720] = 0x00AE; 32664 t[63194] = 0x00AE; 32665 t[63722] = 0x2122; 32666 t[63195] = 0x2122; 32667 t[63729] = 0x23A7; 32668 t[63730] = 0x23A8; 32669 t[63731] = 0x23A9; 32670 t[63740] = 0x23AB; 32671 t[63741] = 0x23AC; 32672 t[63742] = 0x23AD; 32673 t[63726] = 0x23A1; 32674 t[63727] = 0x23A2; 32675 t[63728] = 0x23A3; 32676 t[63737] = 0x23A4; 32677 t[63738] = 0x23A5; 32678 t[63739] = 0x23A6; 32679 t[63723] = 0x239B; 32680 t[63724] = 0x239C; 32681 t[63725] = 0x239D; 32682 t[63734] = 0x239E; 32683 t[63735] = 0x239F; 32684 t[63736] = 0x23A0; 32685}); 32686function mapSpecialUnicodeValues(code) { 32687 if (code >= 0xFFF0 && code <= 0xFFFF) { 32688 return 0; 32689 } else if (code >= 0xF600 && code <= 0xF8FF) { 32690 return getSpecialPUASymbols()[code] || code; 32691 } 32692 return code; 32693} 32694function getUnicodeForGlyph(name, glyphsUnicodeMap) { 32695 var unicode = glyphsUnicodeMap[name]; 32696 if (unicode !== undefined) { 32697 return unicode; 32698 } 32699 if (!name) { 32700 return -1; 32701 } 32702 if (name[0] === 'u') { 32703 var nameLen = name.length, hexStr; 32704 if (nameLen === 7 && name[1] === 'n' && name[2] === 'i') { 32705 hexStr = name.substr(3); 32706 } else if (nameLen >= 5 && nameLen <= 7) { 32707 hexStr = name.substr(1); 32708 } else { 32709 return -1; 32710 } 32711 if (hexStr === hexStr.toUpperCase()) { 32712 unicode = parseInt(hexStr, 16); 32713 if (unicode >= 0) { 32714 return unicode; 32715 } 32716 } 32717 } 32718 return -1; 32719} 32720var UnicodeRanges = [ 32721 { 32722 'begin': 0x0000, 32723 'end': 0x007F 32724 }, 32725 { 32726 'begin': 0x0080, 32727 'end': 0x00FF 32728 }, 32729 { 32730 'begin': 0x0100, 32731 'end': 0x017F 32732 }, 32733 { 32734 'begin': 0x0180, 32735 'end': 0x024F 32736 }, 32737 { 32738 'begin': 0x0250, 32739 'end': 0x02AF 32740 }, 32741 { 32742 'begin': 0x02B0, 32743 'end': 0x02FF 32744 }, 32745 { 32746 'begin': 0x0300, 32747 'end': 0x036F 32748 }, 32749 { 32750 'begin': 0x0370, 32751 'end': 0x03FF 32752 }, 32753 { 32754 'begin': 0x2C80, 32755 'end': 0x2CFF 32756 }, 32757 { 32758 'begin': 0x0400, 32759 'end': 0x04FF 32760 }, 32761 { 32762 'begin': 0x0530, 32763 'end': 0x058F 32764 }, 32765 { 32766 'begin': 0x0590, 32767 'end': 0x05FF 32768 }, 32769 { 32770 'begin': 0xA500, 32771 'end': 0xA63F 32772 }, 32773 { 32774 'begin': 0x0600, 32775 'end': 0x06FF 32776 }, 32777 { 32778 'begin': 0x07C0, 32779 'end': 0x07FF 32780 }, 32781 { 32782 'begin': 0x0900, 32783 'end': 0x097F 32784 }, 32785 { 32786 'begin': 0x0980, 32787 'end': 0x09FF 32788 }, 32789 { 32790 'begin': 0x0A00, 32791 'end': 0x0A7F 32792 }, 32793 { 32794 'begin': 0x0A80, 32795 'end': 0x0AFF 32796 }, 32797 { 32798 'begin': 0x0B00, 32799 'end': 0x0B7F 32800 }, 32801 { 32802 'begin': 0x0B80, 32803 'end': 0x0BFF 32804 }, 32805 { 32806 'begin': 0x0C00, 32807 'end': 0x0C7F 32808 }, 32809 { 32810 'begin': 0x0C80, 32811 'end': 0x0CFF 32812 }, 32813 { 32814 'begin': 0x0D00, 32815 'end': 0x0D7F 32816 }, 32817 { 32818 'begin': 0x0E00, 32819 'end': 0x0E7F 32820 }, 32821 { 32822 'begin': 0x0E80, 32823 'end': 0x0EFF 32824 }, 32825 { 32826 'begin': 0x10A0, 32827 'end': 0x10FF 32828 }, 32829 { 32830 'begin': 0x1B00, 32831 'end': 0x1B7F 32832 }, 32833 { 32834 'begin': 0x1100, 32835 'end': 0x11FF 32836 }, 32837 { 32838 'begin': 0x1E00, 32839 'end': 0x1EFF 32840 }, 32841 { 32842 'begin': 0x1F00, 32843 'end': 0x1FFF 32844 }, 32845 { 32846 'begin': 0x2000, 32847 'end': 0x206F 32848 }, 32849 { 32850 'begin': 0x2070, 32851 'end': 0x209F 32852 }, 32853 { 32854 'begin': 0x20A0, 32855 'end': 0x20CF 32856 }, 32857 { 32858 'begin': 0x20D0, 32859 'end': 0x20FF 32860 }, 32861 { 32862 'begin': 0x2100, 32863 'end': 0x214F 32864 }, 32865 { 32866 'begin': 0x2150, 32867 'end': 0x218F 32868 }, 32869 { 32870 'begin': 0x2190, 32871 'end': 0x21FF 32872 }, 32873 { 32874 'begin': 0x2200, 32875 'end': 0x22FF 32876 }, 32877 { 32878 'begin': 0x2300, 32879 'end': 0x23FF 32880 }, 32881 { 32882 'begin': 0x2400, 32883 'end': 0x243F 32884 }, 32885 { 32886 'begin': 0x2440, 32887 'end': 0x245F 32888 }, 32889 { 32890 'begin': 0x2460, 32891 'end': 0x24FF 32892 }, 32893 { 32894 'begin': 0x2500, 32895 'end': 0x257F 32896 }, 32897 { 32898 'begin': 0x2580, 32899 'end': 0x259F 32900 }, 32901 { 32902 'begin': 0x25A0, 32903 'end': 0x25FF 32904 }, 32905 { 32906 'begin': 0x2600, 32907 'end': 0x26FF 32908 }, 32909 { 32910 'begin': 0x2700, 32911 'end': 0x27BF 32912 }, 32913 { 32914 'begin': 0x3000, 32915 'end': 0x303F 32916 }, 32917 { 32918 'begin': 0x3040, 32919 'end': 0x309F 32920 }, 32921 { 32922 'begin': 0x30A0, 32923 'end': 0x30FF 32924 }, 32925 { 32926 'begin': 0x3100, 32927 'end': 0x312F 32928 }, 32929 { 32930 'begin': 0x3130, 32931 'end': 0x318F 32932 }, 32933 { 32934 'begin': 0xA840, 32935 'end': 0xA87F 32936 }, 32937 { 32938 'begin': 0x3200, 32939 'end': 0x32FF 32940 }, 32941 { 32942 'begin': 0x3300, 32943 'end': 0x33FF 32944 }, 32945 { 32946 'begin': 0xAC00, 32947 'end': 0xD7AF 32948 }, 32949 { 32950 'begin': 0xD800, 32951 'end': 0xDFFF 32952 }, 32953 { 32954 'begin': 0x10900, 32955 'end': 0x1091F 32956 }, 32957 { 32958 'begin': 0x4E00, 32959 'end': 0x9FFF 32960 }, 32961 { 32962 'begin': 0xE000, 32963 'end': 0xF8FF 32964 }, 32965 { 32966 'begin': 0x31C0, 32967 'end': 0x31EF 32968 }, 32969 { 32970 'begin': 0xFB00, 32971 'end': 0xFB4F 32972 }, 32973 { 32974 'begin': 0xFB50, 32975 'end': 0xFDFF 32976 }, 32977 { 32978 'begin': 0xFE20, 32979 'end': 0xFE2F 32980 }, 32981 { 32982 'begin': 0xFE10, 32983 'end': 0xFE1F 32984 }, 32985 { 32986 'begin': 0xFE50, 32987 'end': 0xFE6F 32988 }, 32989 { 32990 'begin': 0xFE70, 32991 'end': 0xFEFF 32992 }, 32993 { 32994 'begin': 0xFF00, 32995 'end': 0xFFEF 32996 }, 32997 { 32998 'begin': 0xFFF0, 32999 'end': 0xFFFF 33000 },
33001 { 33002 'begin': 0x0F00, 33003 'end': 0x0FFF 33004 }, 33005 { 33006 'begin': 0x0700, 33007 'end': 0x074F 33008 }, 33009 { 33010 'begin': 0x0780, 33011 'end': 0x07BF 33012 }, 33013 { 33014 'begin': 0x0D80, 33015 'end': 0x0DFF 33016 }, 33017 { 33018 'begin': 0x1000, 33019 'end': 0x109F 33020 }, 33021 { 33022 'begin': 0x1200, 33023 'end': 0x137F 33024 }, 33025 { 33026 'begin': 0x13A0, 33027 'end': 0x13FF 33028 }, 33029 { 33030 'begin': 0x1400, 33031 'end': 0x167F 33032 }, 33033 { 33034 'begin': 0x1680, 33035 'end': 0x169F 33036 }, 33037 { 33038 'begin': 0x16A0, 33039 'end': 0x16FF 33040 }, 33041 { 33042 'begin': 0x1780, 33043 'end': 0x17FF 33044 }, 33045 { 33046 'begin': 0x1800, 33047 'end': 0x18AF 33048 }, 33049 { 33050 'begin': 0x2800, 33051 'end': 0x28FF 33052 }, 33053 { 33054 'begin': 0xA000, 33055 'end': 0xA48F 33056 }, 33057 { 33058 'begin': 0x1700, 33059 'end': 0x171F 33060 }, 33061 { 33062 'begin': 0x10300, 33063 'end': 0x1032F 33064 }, 33065 { 33066 'begin': 0x10330, 33067 'end': 0x1034F 33068 }, 33069 { 33070 'begin': 0x10400, 33071 'end': 0x1044F 33072 }, 33073 { 33074 'begin': 0x1D000, 33075 'end': 0x1D0FF 33076 }, 33077 { 33078 'begin': 0x1D400, 33079 'end': 0x1D7FF 33080 }, 33081 { 33082 'begin': 0xFF000, 33083 'end': 0xFFFFD 33084 }, 33085 { 33086 'begin': 0xFE00, 33087 'end': 0xFE0F 33088 }, 33089 { 33090 'begin': 0xE0000, 33091 'end': 0xE007F 33092 }, 33093 { 33094 'begin': 0x1900, 33095 'end': 0x194F 33096 }, 33097 { 33098 'begin': 0x1950, 33099 'end': 0x197F 33100 }, 33101 { 33102 'begin': 0x1980, 33103 'end': 0x19DF 33104 }, 33105 { 33106 'begin': 0x1A00, 33107 'end': 0x1A1F 33108 }, 33109 { 33110 'begin': 0x2C00, 33111 'end': 0x2C5F 33112 }, 33113 { 33114 'begin': 0x2D30, 33115 'end': 0x2D7F 33116 }, 33117 { 33118 'begin': 0x4DC0, 33119 'end': 0x4DFF 33120 }, 33121 { 33122 'begin': 0xA800, 33123 'end': 0xA82F 33124 }, 33125 { 33126 'begin': 0x10000, 33127 'end': 0x1007F 33128 }, 33129 { 33130 'begin': 0x10140, 33131 'end': 0x1018F 33132 }, 33133 { 33134 'begin': 0x10380, 33135 'end': 0x1039F 33136 }, 33137 { 33138 'begin': 0x103A0, 33139 'end': 0x103DF 33140 }, 33141 { 33142 'begin': 0x10450, 33143 'end': 0x1047F 33144 }, 33145 { 33146 'begin': 0x10480, 33147 'end': 0x104AF 33148 }, 33149 { 33150 'begin': 0x10800, 33151 'end': 0x1083F 33152 }, 33153 { 33154 'begin': 0x10A00, 33155 'end': 0x10A5F 33156 }, 33157 { 33158 'begin': 0x1D300, 33159 'end': 0x1D35F 33160 }, 33161 { 33162 'begin': 0x12000, 33163 'end': 0x123FF 33164 }, 33165 { 33166 'begin': 0x1D360, 33167 'end': 0x1D37F 33168 }, 33169 { 33170 'begin': 0x1B80, 33171 'end': 0x1BBF 33172 }, 33173 { 33174 'begin': 0x1C00, 33175 'end': 0x1C4F 33176 }, 33177 { 33178 'begin': 0x1C50, 33179 'end': 0x1C7F 33180 }, 33181 { 33182 'begin': 0xA880, 33183 'end': 0xA8DF 33184 }, 33185 { 33186 'begin': 0xA900, 33187 'end': 0xA92F 33188 }, 33189 { 33190 'begin': 0xA930, 33191 'end': 0xA95F 33192 }, 33193 { 33194 'begin': 0xAA00, 33195 'end': 0xAA5F 33196 }, 33197 { 33198 'begin': 0x10190, 33199 'end': 0x101CF 33200 }, 33201 { 33202 'begin': 0x101D0, 33203 'end': 0x101FF 33204 }, 33205 { 33206 'begin': 0x102A0, 33207 'end': 0x102DF 33208 }, 33209 { 33210 'begin': 0x1F030, 33211 'end': 0x1F09F 33212 } 33213]; 33214function getUnicodeRangeFor(value) { 33215 for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { 33216 var range = UnicodeRanges[i]; 33217 if (value >= range.begin && value < range.end) { 33218 return i; 33219 } 33220 } 33221 return -1; 33222} 33223function isRTLRangeFor(value) { 33224 var range = UnicodeRanges[13]; 33225 if (value >= range.begin && value < range.end) { 33226 return true; 33227 } 33228 range = UnicodeRanges[11]; 33229 if (value >= range.begin && value < range.end) { 33230 return true; 33231 } 33232 return false; 33233} 33234var getNormalizedUnicodes = getLookupTableFactory(function (t) { 33235 t['\u00A8'] = '\u0020\u0308'; 33236 t['\u00AF'] = '\u0020\u0304'; 33237 t['\u00B4'] = '\u0020\u0301'; 33238 t['\u00B5'] = '\u03BC'; 33239 t['\u00B8'] = '\u0020\u0327'; 33240 t['\u0132'] = '\u0049\u004A'; 33241 t['\u0133'] = '\u0069\u006A'; 33242 t['\u013F'] = '\u004C\u00B7'; 33243 t['\u0140'] = '\u006C\u00B7'; 33244 t['\u0149'] = '\u02BC\u006E'; 33245 t['\u017F'] = '\u0073'; 33246 t['\u01C4'] = '\u0044\u017D'; 33247 t['\u01C5'] = '\u0044\u017E'; 33248 t['\u01C6'] = '\u0064\u017E'; 33249 t['\u01C7'] = '\u004C\u004A'; 33250 t['\u01C8'] = '\u004C\u006A'; 33251 t['\u01C9'] = '\u006C\u006A'; 33252 t['\u01CA'] = '\u004E\u004A'; 33253 t['\u01CB'] = '\u004E\u006A'; 33254 t['\u01CC'] = '\u006E\u006A'; 33255 t['\u01F1'] = '\u0044\u005A'; 33256 t['\u01F2'] = '\u0044\u007A'; 33257 t['\u01F3'] = '\u0064\u007A'; 33258 t['\u02D8'] = '\u0020\u0306'; 33259 t['\u02D9'] = '\u0020\u0307'; 33260 t['\u02DA'] = '\u0020\u030A'; 33261 t['\u02DB'] = '\u0020\u0328'; 33262 t['\u02DC'] = '\u0020\u0303'; 33263 t['\u02DD'] = '\u0020\u030B'; 33264 t['\u037A'] = '\u0020\u0345'; 33265 t['\u0384'] = '\u0020\u0301'; 33266 t['\u03D0'] = '\u03B2'; 33267 t['\u03D1'] = '\u03B8'; 33268 t['\u03D2'] = '\u03A5'; 33269 t['\u03D5'] = '\u03C6'; 33270 t['\u03D6'] = '\u03C0'; 33271 t['\u03F0'] = '\u03BA'; 33272 t['\u03F1'] = '\u03C1'; 33273 t['\u03F2'] = '\u03C2'; 33274 t['\u03F4'] = '\u0398'; 33275 t['\u03F5'] = '\u03B5'; 33276 t['\u03F9'] = '\u03A3'; 33277 t['\u0587'] = '\u0565\u0582'; 33278 t['\u0675'] = '\u0627\u0674'; 33279 t['\u0676'] = '\u0648\u0674';
33280 t['\u0677'] = '\u06C7\u0674'; 33281 t['\u0678'] = '\u064A\u0674'; 33282 t['\u0E33'] = '\u0E4D\u0E32'; 33283 t['\u0EB3'] = '\u0ECD\u0EB2'; 33284 t['\u0EDC'] = '\u0EAB\u0E99'; 33285 t['\u0EDD'] = '\u0EAB\u0EA1'; 33286 t['\u0F77'] = '\u0FB2\u0F81'; 33287 t['\u0F79'] = '\u0FB3\u0F81'; 33288 t['\u1E9A'] = '\u0061\u02BE'; 33289 t['\u1FBD'] = '\u0020\u0313'; 33290 t['\u1FBF'] = '\u0020\u0313'; 33291 t['\u1FC0'] = '\u0020\u0342'; 33292 t['\u1FFE'] = '\u0020\u0314'; 33293 t['\u2002'] = '\u0020'; 33294 t['\u2003'] = '\u0020'; 33295 t['\u2004'] = '\u0020'; 33296 t['\u2005'] = '\u0020'; 33297 t['\u2006'] = '\u0020'; 33298 t['\u2008'] = '\u0020'; 33299 t['\u2009'] = '\u0020'; 33300 t['\u200A'] = '\u0020'; 33301 t['\u2017'] = '\u0020\u0333'; 33302 t['\u2024'] = '\u002E'; 33303 t['\u2025'] = '\u002E\u002E'; 33304 t['\u2026'] = '\u002E\u002E\u002E'; 33305 t['\u2033'] = '\u2032\u2032'; 33306 t['\u2034'] = '\u2032\u2032\u2032'; 33307 t['\u2036'] = '\u2035\u2035'; 33308 t['\u2037'] = '\u2035\u2035\u2035'; 33309 t['\u203C'] = '\u0021\u0021'; 33310 t['\u203E'] = '\u0020\u0305'; 33311 t['\u2047'] = '\u003F\u003F'; 33312 t['\u2048'] = '\u003F\u0021'; 33313 t['\u2049'] = '\u0021\u003F'; 33314 t['\u2057'] = '\u2032\u2032\u2032\u2032'; 33315 t['\u205F'] = '\u0020'; 33316 t['\u20A8'] = '\u0052\u0073'; 33317 t['\u2100'] = '\u0061\u002F\u0063'; 33318 t['\u2101'] = '\u0061\u002F\u0073'; 33319 t['\u2103'] = '\u00B0\u0043'; 33320 t['\u2105'] = '\u0063\u002F\u006F'; 33321 t['\u2106'] = '\u0063\u002F\u0075'; 33322 t['\u2107'] = '\u0190'; 33323 t['\u2109'] = '\u00B0\u0046'; 33324 t['\u2116'] = '\u004E\u006F'; 33325 t['\u2121'] = '\u0054\u0045\u004C'; 33326 t['\u2135'] = '\u05D0'; 33327 t['\u2136'] = '\u05D1'; 33328 t['\u2137'] = '\u05D2'; 33329 t['\u2138'] = '\u05D3'; 33330 t['\u213B'] = '\u0046\u0041\u0058'; 33331 t['\u2160'] = '\u0049'; 33332 t['\u2161'] = '\u0049\u0049'; 33333 t['\u2162'] = '\u0049\u0049\u0049'; 33334 t['\u2163'] = '\u0049\u0056'; 33335 t['\u2164'] = '\u0056'; 33336 t['\u2165'] = '\u0056\u0049'; 33337 t['\u2166'] = '\u0056\u0049\u0049'; 33338 t['\u2167'] = '\u0056\u0049\u0049\u0049'; 33339 t['\u2168'] = '\u0049\u0058'; 33340 t['\u2169'] = '\u0058'; 33341 t['\u216A'] = '\u0058\u0049'; 33342 t['\u216B'] = '\u0058\u0049\u0049'; 33343 t['\u216C'] = '\u004C'; 33344 t['\u216D'] = '\u0043'; 33345 t['\u216E'] = '\u0044'; 33346 t['\u216F'] = '\u004D'; 33347 t['\u2170'] = '\u0069'; 33348 t['\u2171'] = '\u0069\u0069'; 33349 t['\u2172'] = '\u0069\u0069\u0069'; 33350 t['\u2173'] = '\u0069\u0076'; 33351 t['\u2174'] = '\u0076'; 33352 t['\u2175'] = '\u0076\u0069'; 33353 t['\u2176'] = '\u0076\u0069\u0069'; 33354 t['\u2177'] = '\u0076\u0069\u0069\u0069'; 33355 t['\u2178'] = '\u0069\u0078'; 33356 t['\u2179'] = '\u0078'; 33357 t['\u217A'] = '\u0078\u0069'; 33358 t['\u217B'] = '\u0078\u0069\u0069'; 33359 t['\u217C'] = '\u006C'; 33360 t['\u217D'] = '\u0063'; 33361 t['\u217E'] = '\u0064'; 33362 t['\u217F'] = '\u006D'; 33363 t['\u222C'] = '\u222B\u222B'; 33364 t['\u222D'] = '\u222B\u222B\u222B'; 33365 t['\u222F'] = '\u222E\u222E'; 33366 t['\u2230'] = '\u222E\u222E\u222E'; 33367 t['\u2474'] = '\u0028\u0031\u0029'; 33368 t['\u2475'] = '\u0028\u0032\u0029'; 33369 t['\u2476'] = '\u0028\u0033\u0029'; 33370 t['\u2477'] = '\u0028\u0034\u0029'; 33371 t['\u2478'] = '\u0028\u0035\u0029'; 33372 t['\u2479'] = '\u0028\u0036\u0029'; 33373 t['\u247A'] = '\u0028\u0037\u0029'; 33374 t['\u247B'] = '\u0028\u0038\u0029'; 33375 t['\u247C'] = '\u0028\u0039\u0029'; 33376 t['\u247D'] = '\u0028\u0031\u0030\u0029'; 33377 t['\u247E'] = '\u0028\u0031\u0031\u0029'; 33378 t['\u247F'] = '\u0028\u0031\u0032\u0029'; 33379 t['\u2480'] = '\u0028\u0031\u0033\u0029'; 33380 t['\u2481'] = '\u0028\u0031\u0034\u0029'; 33381 t['\u2482'] = '\u0028\u0031\u0035\u0029'; 33382 t['\u2483'] = '\u0028\u0031\u0036\u0029'; 33383 t['\u2484'] = '\u0028\u0031\u0037\u0029'; 33384 t['\u2485'] = '\u0028\u0031\u0038\u0029'; 33385 t['\u2486'] = '\u0028\u0031\u0039\u0029'; 33386 t['\u2487'] = '\u0028\u0032\u0030\u0029'; 33387 t['\u2488'] = '\u0031\u002E'; 33388 t['\u2489'] = '\u0032\u002E'; 33389 t['\u248A'] = '\u0033\u002E'; 33390 t['\u248B'] = '\u0034\u002E'; 33391 t['\u248C'] = '\u0035\u002E'; 33392 t['\u248D'] = '\u0036\u002E'; 33393 t['\u248E'] = '\u0037\u002E'; 33394 t['\u248F'] = '\u0038\u002E'; 33395 t['\u2490'] = '\u0039\u002E'; 33396 t['\u2491'] = '\u0031\u0030\u002E'; 33397 t['\u2492'] = '\u0031\u0031\u002E'; 33398 t['\u2493'] = '\u0031\u0032\u002E'; 33399 t['\u2494'] = '\u0031\u0033\u002E'; 33400 t['\u2495'] = '\u0031\u0034\u002E'; 33401 t['\u2496'] = '\u0031\u0035\u002E'; 33402 t['\u2497'] = '\u0031\u0036\u002E'; 33403 t['\u2498'] = '\u0031\u0037\u002E'; 33404 t['\u2499'] = '\u0031\u0038\u002E'; 33405 t['\u249A'] = '\u0031\u0039\u002E'; 33406 t['\u249B'] = '\u0032\u0030\u002E'; 33407 t['\u249C'] = '\u0028\u0061\u0029'; 33408 t['\u249D'] = '\u0028\u0062\u0029'; 33409 t['\u249E'] = '\u0028\u0063\u0029'; 33410 t['\u249F'] = '\u0028\u0064\u0029'; 33411 t['\u24A0'] = '\u0028\u0065\u0029'; 33412 t['\u24A1'] = '\u0028\u0066\u0029'; 33413 t['\u24A2'] = '\u0028\u0067\u0029'; 33414 t['\u24A3'] = '\u0028\u0068\u0029'; 33415 t['\u24A4'] = '\u0028\u0069\u0029'; 33416 t['\u24A5'] = '\u0028\u006A\u0029'; 33417 t['\u24A6'] = '\u0028\u006B\u0029'; 33418 t['\u24A7'] = '\u0028\u006C\u0029'; 33419 t['\u24A8'] = '\u0028\u006D\u0029'; 33420 t['\u24A9'] = '\u0028\u006E\u0029'; 33421 t['\u24AA'] = '\u0028\u006F\u0029'; 33422 t['\u24AB'] = '\u0028\u0070\u0029'; 33423 t['\u24AC'] = '\u0028\u0071\u0029';
33424 t['\u24AD'] = '\u0028\u0072\u0029'; 33425 t['\u24AE'] = '\u0028\u0073\u0029'; 33426 t['\u24AF'] = '\u0028\u0074\u0029'; 33427 t['\u24B0'] = '\u0028\u0075\u0029'; 33428 t['\u24B1'] = '\u0028\u0076\u0029'; 33429 t['\u24B2'] = '\u0028\u0077\u0029'; 33430 t['\u24B3'] = '\u0028\u0078\u0029'; 33431 t['\u24B4'] = '\u0028\u0079\u0029'; 33432 t['\u24B5'] = '\u0028\u007A\u0029'; 33433 t['\u2A0C'] = '\u222B\u222B\u222B\u222B'; 33434 t['\u2A74'] = '\u003A\u003A\u003D'; 33435 t['\u2A75'] = '\u003D\u003D'; 33436 t['\u2A76'] = '\u003D\u003D\u003D'; 33437 t['\u2E9F'] = '\u6BCD'; 33438 t['\u2EF3'] = '\u9F9F'; 33439 t['\u2F00'] = '\u4E00'; 33440 t['\u2F01'] = '\u4E28'; 33441 t['\u2F02'] = '\u4E36'; 33442 t['\u2F03'] = '\u4E3F'; 33443 t['\u2F04'] = '\u4E59'; 33444 t['\u2F05'] = '\u4E85'; 33445 t['\u2F06'] = '\u4E8C'; 33446 t['\u2F07'] = '\u4EA0'; 33447 t['\u2F08'] = '\u4EBA'; 33448 t['\u2F09'] = '\u513F'; 33449 t['\u2F0A'] = '\u5165'; 33450 t['\u2F0B'] = '\u516B'; 33451 t['\u2F0C'] = '\u5182'; 33452 t['\u2F0D'] = '\u5196'; 33453 t['\u2F0E'] = '\u51AB'; 33454 t['\u2F0F'] = '\u51E0'; 33455 t['\u2F10'] = '\u51F5'; 33456 t['\u2F11'] = '\u5200'; 33457 t['\u2F12'] = '\u529B'; 33458 t['\u2F13'] = '\u52F9'; 33459 t['\u2F14'] = '\u5315'; 33460 t['\u2F15'] = '\u531A'; 33461 t['\u2F16'] = '\u5338'; 33462 t['\u2F17'] = '\u5341'; 33463 t['\u2F18'] = '\u535C'; 33464 t['\u2F19'] = '\u5369'; 33465 t['\u2F1A'] = '\u5382'; 33466 t['\u2F1B'] = '\u53B6'; 33467 t['\u2F1C'] = '\u53C8'; 33468 t['\u2F1D'] = '\u53E3'; 33469 t['\u2F1E'] = '\u56D7'; 33470 t['\u2F1F'] = '\u571F'; 33471 t['\u2F20'] = '\u58EB'; 33472 t['\u2F21'] = '\u5902'; 33473 t['\u2F22'] = '\u590A'; 33474 t['\u2F23'] = '\u5915'; 33475 t['\u2F24'] = '\u5927'; 33476 t['\u2F25'] = '\u5973'; 33477 t['\u2F26'] = '\u5B50'; 33478 t['\u2F27'] = '\u5B80'; 33479 t['\u2F28'] = '\u5BF8'; 33480 t['\u2F29'] = '\u5C0F'; 33481 t['\u2F2A'] = '\u5C22'; 33482 t['\u2F2B'] = '\u5C38'; 33483 t['\u2F2C'] = '\u5C6E'; 33484 t['\u2F2D'] = '\u5C71'; 33485 t['\u2F2E'] = '\u5DDB'; 33486 t['\u2F2F'] = '\u5DE5'; 33487 t['\u2F30'] = '\u5DF1'; 33488 t['\u2F31'] = '\u5DFE'; 33489 t['\u2F32'] = '\u5E72'; 33490 t['\u2F33'] = '\u5E7A'; 33491 t['\u2F34'] = '\u5E7F'; 33492 t['\u2F35'] = '\u5EF4'; 33493 t['\u2F36'] = '\u5EFE'; 33494 t['\u2F37'] = '\u5F0B'; 33495 t['\u2F38'] = '\u5F13'; 33496 t['\u2F39'] = '\u5F50'; 33497 t['\u2F3A'] = '\u5F61'; 33498 t['\u2F3B'] = '\u5F73'; 33499 t['\u2F3C'] = '\u5FC3'; 33500 t['\u2F3D'] = '\u6208'; 33501 t['\u2F3E'] = '\u6236'; 33502 t['\u2F3F'] = '\u624B'; 33503 t['\u2F40'] = '\u652F'; 33504 t['\u2F41'] = '\u6534'; 33505 t['\u2F42'] = '\u6587'; 33506 t['\u2F43'] = '\u6597'; 33507 t['\u2F44'] = '\u65A4'; 33508 t['\u2F45'] = '\u65B9'; 33509 t['\u2F46'] = '\u65E0'; 33510 t['\u2F47'] = '\u65E5'; 33511 t['\u2F48'] = '\u66F0'; 33512 t['\u2F49'] = '\u6708'; 33513 t['\u2F4A'] = '\u6728'; 33514 t['\u2F4B'] = '\u6B20'; 33515 t['\u2F4C'] = '\u6B62'; 33516 t['\u2F4D'] = '\u6B79'; 33517 t['\u2F4E'] = '\u6BB3'; 33518 t['\u2F4F'] = '\u6BCB'; 33519 t['\u2F50'] = '\u6BD4'; 33520 t['\u2F51'] = '\u6BDB'; 33521 t['\u2F52'] = '\u6C0F'; 33522 t['\u2F53'] = '\u6C14'; 33523 t['\u2F54'] = '\u6C34'; 33524 t['\u2F55'] = '\u706B'; 33525 t['\u2F56'] = '\u722A'; 33526 t['\u2F57'] = '\u7236'; 33527 t['\u2F58'] = '\u723B'; 33528 t['\u2F59'] = '\u723F'; 33529 t['\u2F5A'] = '\u7247'; 33530 t['\u2F5B'] = '\u7259'; 33531 t['\u2F5C'] = '\u725B'; 33532 t['\u2F5D'] = '\u72AC'; 33533 t['\u2F5E'] = '\u7384'; 33534 t['\u2F5F'] = '\u7389'; 33535 t['\u2F60'] = '\u74DC'; 33536 t['\u2F61'] = '\u74E6'; 33537 t['\u2F62'] = '\u7518'; 33538 t['\u2F63'] = '\u751F'; 33539 t['\u2F64'] = '\u7528'; 33540 t['\u2F65'] = '\u7530'; 33541 t['\u2F66'] = '\u758B'; 33542 t['\u2F67'] = '\u7592'; 33543 t['\u2F68'] = '\u7676'; 33544 t['\u2F69'] = '\u767D'; 33545 t['\u2F6A'] = '\u76AE'; 33546 t['\u2F6B'] = '\u76BF'; 33547 t['\u2F6C'] = '\u76EE'; 33548 t['\u2F6D'] = '\u77DB'; 33549 t['\u2F6E'] = '\u77E2'; 33550 t['\u2F6F'] = '\u77F3'; 33551 t['\u2F70'] = '\u793A'; 33552 t['\u2F71'] = '\u79B8'; 33553 t['\u2F72'] = '\u79BE'; 33554 t['\u2F73'] = '\u7A74'; 33555 t['\u2F74'] = '\u7ACB'; 33556 t['\u2F75'] = '\u7AF9'; 33557 t['\u2F76'] = '\u7C73'; 33558 t['\u2F77'] = '\u7CF8'; 33559 t['\u2F78'] = '\u7F36'; 33560 t['\u2F79'] = '\u7F51'; 33561 t['\u2F7A'] = '\u7F8A'; 33562 t['\u2F7B'] = '\u7FBD'; 33563 t['\u2F7C'] = '\u8001'; 33564 t['\u2F7D'] = '\u800C'; 33565 t['\u2F7E'] = '\u8012'; 33566 t['\u2F7F'] = '\u8033'; 33567 t['\u2F80'] = '\u807F'; 33568 t['\u2F81'] = '\u8089'; 33569 t['\u2F82'] = '\u81E3'; 33570 t['\u2F83'] = '\u81EA'; 33571 t['\u2F84'] = '\u81F3'; 33572 t['\u2F85'] = '\u81FC'; 33573 t['\u2F86'] = '\u820C'; 33574 t['\u2F87'] = '\u821B'; 33575 t['\u2F88'] = '\u821F'; 33576 t['\u2F89'] = '\u826E'; 33577 t['\u2F8A'] = '\u8272'; 33578 t['\u2F8B'] = '\u8278'; 33579 t['\u2F8C'] = '\u864D'; 33580 t['\u2F8D'] = '\u866B'; 33581 t['\u2F8E'] = '\u8840';
33582 t['\u2F8F'] = '\u884C'; 33583 t['\u2F90'] = '\u8863'; 33584 t['\u2F91'] = '\u897E'; 33585 t['\u2F92'] = '\u898B'; 33586 t['\u2F93'] = '\u89D2'; 33587 t['\u2F94'] = '\u8A00'; 33588 t['\u2F95'] = '\u8C37'; 33589 t['\u2F96'] = '\u8C46'; 33590 t['\u2F97'] = '\u8C55'; 33591 t['\u2F98'] = '\u8C78'; 33592 t['\u2F99'] = '\u8C9D'; 33593 t['\u2F9A'] = '\u8D64'; 33594 t['\u2F9B'] = '\u8D70'; 33595 t['\u2F9C'] = '\u8DB3'; 33596 t['\u2F9D'] = '\u8EAB'; 33597 t['\u2F9E'] = '\u8ECA'; 33598 t['\u2F9F'] = '\u8F9B'; 33599 t['\u2FA0'] = '\u8FB0'; 33600 t['\u2FA1'] = '\u8FB5'; 33601 t['\u2FA2'] = '\u9091'; 33602 t['\u2FA3'] = '\u9149'; 33603 t['\u2FA4'] = '\u91C6'; 33604 t['\u2FA5'] = '\u91CC'; 33605 t['\u2FA6'] = '\u91D1'; 33606 t['\u2FA7'] = '\u9577'; 33607 t['\u2FA8'] = '\u9580'; 33608 t['\u2FA9'] = '\u961C'; 33609 t['\u2FAA'] = '\u96B6'; 33610 t['\u2FAB'] = '\u96B9'; 33611 t['\u2FAC'] = '\u96E8'; 33612 t['\u2FAD'] = '\u9751'; 33613 t['\u2FAE'] = '\u975E'; 33614 t['\u2FAF'] = '\u9762'; 33615 t['\u2FB0'] = '\u9769'; 33616 t['\u2FB1'] = '\u97CB'; 33617 t['\u2FB2'] = '\u97ED'; 33618 t['\u2FB3'] = '\u97F3'; 33619 t['\u2FB4'] = '\u9801'; 33620 t['\u2FB5'] = '\u98A8'; 33621 t['\u2FB6'] = '\u98DB'; 33622 t['\u2FB7'] = '\u98DF'; 33623 t['\u2FB8'] = '\u9996'; 33624 t['\u2FB9'] = '\u9999'; 33625 t['\u2FBA'] = '\u99AC'; 33626 t['\u2FBB'] = '\u9AA8'; 33627 t['\u2FBC'] = '\u9AD8'; 33628 t['\u2FBD'] = '\u9ADF'; 33629 t['\u2FBE'] = '\u9B25'; 33630 t['\u2FBF'] = '\u9B2F'; 33631 t['\u2FC0'] = '\u9B32'; 33632 t['\u2FC1'] = '\u9B3C'; 33633 t['\u2FC2'] = '\u9B5A'; 33634 t['\u2FC3'] = '\u9CE5'; 33635 t['\u2FC4'] = '\u9E75'; 33636 t['\u2FC5'] = '\u9E7F'; 33637 t['\u2FC6'] = '\u9EA5'; 33638 t['\u2FC7'] = '\u9EBB'; 33639 t['\u2FC8'] = '\u9EC3'; 33640 t['\u2FC9'] = '\u9ECD'; 33641 t['\u2FCA'] = '\u9ED1'; 33642 t['\u2FCB'] = '\u9EF9'; 33643 t['\u2FCC'] = '\u9EFD'; 33644 t['\u2FCD'] = '\u9F0E'; 33645 t['\u2FCE'] = '\u9F13'; 33646 t['\u2FCF'] = '\u9F20'; 33647 t['\u2FD0'] = '\u9F3B'; 33648 t['\u2FD1'] = '\u9F4A'; 33649 t['\u2FD2'] = '\u9F52'; 33650 t['\u2FD3'] = '\u9F8D'; 33651 t['\u2FD4'] = '\u9F9C'; 33652 t['\u2FD5'] = '\u9FA0'; 33653 t['\u3036'] = '\u3012'; 33654 t['\u3038'] = '\u5341'; 33655 t['\u3039'] = '\u5344'; 33656 t['\u303A'] = '\u5345'; 33657 t['\u309B'] = '\u0020\u3099'; 33658 t['\u309C'] = '\u0020\u309A'; 33659 t['\u3131'] = '\u1100'; 33660 t['\u3132'] = '\u1101'; 33661 t['\u3133'] = '\u11AA'; 33662 t['\u3134'] = '\u1102'; 33663 t['\u3135'] = '\u11AC'; 33664 t['\u3136'] = '\u11AD'; 33665 t['\u3137'] = '\u1103'; 33666 t['\u3138'] = '\u1104'; 33667 t['\u3139'] = '\u1105'; 33668 t['\u313A'] = '\u11B0'; 33669 t['\u313B'] = '\u11B1'; 33670 t['\u313C'] = '\u11B2'; 33671 t['\u313D'] = '\u11B3'; 33672 t['\u313E'] = '\u11B4'; 33673 t['\u313F'] = '\u11B5'; 33674 t['\u3140'] = '\u111A'; 33675 t['\u3141'] = '\u1106'; 33676 t['\u3142'] = '\u1107'; 33677 t['\u3143'] = '\u1108'; 33678 t['\u3144'] = '\u1121'; 33679 t['\u3145'] = '\u1109'; 33680 t['\u3146'] = '\u110A'; 33681 t['\u3147'] = '\u110B'; 33682 t['\u3148'] = '\u110C'; 33683 t['\u3149'] = '\u110D'; 33684 t['\u314A'] = '\u110E'; 33685 t['\u314B'] = '\u110F'; 33686 t['\u314C'] = '\u1110'; 33687 t['\u314D'] = '\u1111'; 33688 t['\u314E'] = '\u1112'; 33689 t['\u314F'] = '\u1161'; 33690 t['\u3150'] = '\u1162'; 33691 t['\u3151'] = '\u1163'; 33692 t['\u3152'] = '\u1164'; 33693 t['\u3153'] = '\u1165'; 33694 t['\u3154'] = '\u1166'; 33695 t['\u3155'] = '\u1167'; 33696 t['\u3156'] = '\u1168'; 33697 t['\u3157'] = '\u1169'; 33698 t['\u3158'] = '\u116A'; 33699 t['\u3159'] = '\u116B'; 33700 t['\u315A'] = '\u116C'; 33701 t['\u315B'] = '\u116D'; 33702 t['\u315C'] = '\u116E'; 33703 t['\u315D'] = '\u116F'; 33704 t['\u315E'] = '\u1170'; 33705 t['\u315F'] = '\u1171'; 33706 t['\u3160'] = '\u1172'; 33707 t['\u3161'] = '\u1173'; 33708 t['\u3162'] = '\u1174'; 33709 t['\u3163'] = '\u1175'; 33710 t['\u3164'] = '\u1160'; 33711 t['\u3165'] = '\u1114'; 33712 t['\u3166'] = '\u1115'; 33713 t['\u3167'] = '\u11C7'; 33714 t['\u3168'] = '\u11C8'; 33715 t['\u3169'] = '\u11CC'; 33716 t['\u316A'] = '\u11CE'; 33717 t['\u316B'] = '\u11D3'; 33718 t['\u316C'] = '\u11D7'; 33719 t['\u316D'] = '\u11D9'; 33720 t['\u316E'] = '\u111C'; 33721 t['\u316F'] = '\u11DD'; 33722 t['\u3170'] = '\u11DF'; 33723 t['\u3171'] = '\u111D'; 33724 t['\u3172'] = '\u111E'; 33725 t['\u3173'] = '\u1120'; 33726 t['\u3174'] = '\u1122'; 33727 t['\u3175'] = '\u1123'; 33728 t['\u3176'] = '\u1127'; 33729 t['\u3177'] = '\u1129'; 33730 t['\u3178'] = '\u112B'; 33731 t['\u3179'] = '\u112C'; 33732 t['\u317A'] = '\u112D'; 33733 t['\u317B'] = '\u112E'; 33734 t['\u317C'] = '\u112F'; 33735 t['\u317D'] = '\u1132'; 33736 t['\u317E'] = '\u1136'; 33737 t['\u317F'] = '\u1140'; 33738 t['\u3180'] = '\u1147'; 33739 t['\u3181'] = '\u114C'; 33740 t['\u3182'] = '\u11F1'; 33741 t['\u3183'] = '\u11F2'; 33742 t['\u3184'] = '\u1157'; 33743 t['\u3185'] = '\u1158'; 33744 t['\u3186'] = '\u1159'; 33745 t['\u3187'] = '\u1184'; 33746 t['\u3188'] = '\u1185'; 33747 t['\u3189'] = '\u1188'; 33748 t['\u318A'] = '\u1191'; 33749 t['\u318B'] = '\u1192'; 33750 t['\u318C'] = '\u1194'; 33751 t['\u318D'] = '\u119E'; 33752 t['\u318E'] = '\u11A1'; 33753 t['\u3200'] = '\u0028\u1100\u0029'; 33754 t['\u3201'] = '\u0028\u1102\u0029'; 33755 t['\u3202'] = '\u0028\u1103\u0029'; 33756 t['\u3203'] = '\u0028\u1105\u0029'; 33757 t['\u3204'] = '\u0028\u1106\u0029'; 33758 t['\u3205'] = '\u0028\u1107\u0029'; 33759 t['\u3206'] = '\u0028\u1109\u0029'; 33760 t['\u3207'] = '\u0028\u110B\u0029'; 33761 t['\u3208'] = '\u0028\u110C\u0029'; 33762 t['\u3209'] = '\u0028\u110E\u0029'; 33763 t['\u320A'] = '\u0028\u110F\u0029'; 33764 t['\u320B'] = '\u0028\u1110\u0029'; 33765 t['\u320C'] = '\u0028\u1111\u0029'; 33766 t['\u320D'] = '\u0028\u1112\u0029'; 33767 t['\u320E'] = '\u0028\u1100\u1161\u0029'; 33768 t['\u320F'] = '\u0028\u1102\u1161\u0029'; 33769 t['\u3210'] = '\u0028\u1103\u1161\u0029'; 33770 t['\u3211'] = '\u0028\u1105\u1161\u0029'; 33771 t['\u3212'] = '\u0028\u1106\u1161\u0029'; 33772 t['\u3213'] = '\u0028\u1107\u1161\u0029'; 33773 t['\u3214'] = '\u0028\u1109\u1161\u0029'; 33774 t['\u3215'] = '\u0028\u110B\u1161\u0029'; 33775 t['\u3216'] = '\u0028\u110C\u1161\u0029'; 33776 t['\u3217'] = '\u0028\u110E\u1161\u0029'; 33777 t['\u3218'] = '\u0028\u110F\u1161\u0029'; 33778 t['\u3219'] = '\u0028\u1110\u1161\u0029'; 33779 t['\u321A'] = '\u0028\u1111\u1161\u0029'; 33780 t['\u321B'] = '\u0028\u1112\u1161\u0029'; 33781 t['\u321C'] = '\u0028\u110C\u116E\u0029'; 33782 t['\u321D'] = '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029'; 33783 t['\u321E'] = '\u0028\u110B\u1169\u1112\u116E\u0029'; 33784 t['\u3220'] = '\u0028\u4E00\u0029'; 33785 t['\u3221'] = '\u0028\u4E8C\u0029'; 33786 t['\u3222'] = '\u0028\u4E09\u0029'; 33787 t['\u3223'] = '\u0028\u56DB\u0029'; 33788 t['\u3224'] = '\u0028\u4E94\u0029'; 33789 t['\u3225'] = '\u0028\u516D\u0029'; 33790 t['\u3226'] = '\u0028\u4E03\u0029'; 33791 t['\u3227'] = '\u0028\u516B\u0029'; 33792 t['\u3228'] = '\u0028\u4E5D\u0029'; 33793 t['\u3229'] = '\u0028\u5341\u0029'; 33794 t['\u322A'] = '\u0028\u6708\u0029'; 33795 t['\u322B'] = '\u0028\u706B\u0029'; 33796 t['\u322C'] = '\u0028\u6C34\u0029'; 33797 t['\u322D'] = '\u0028\u6728\u0029'; 33798 t['\u322E'] = '\u0028\u91D1\u0029';
33799 t['\u322F'] = '\u0028\u571F\u0029'; 33800 t['\u3230'] = '\u0028\u65E5\u0029'; 33801 t['\u3231'] = '\u0028\u682A\u0029'; 33802 t['\u3232'] = '\u0028\u6709\u0029'; 33803 t['\u3233'] = '\u0028\u793E\u0029'; 33804 t['\u3234'] = '\u0028\u540D\u0029'; 33805 t['\u3235'] = '\u0028\u7279\u0029'; 33806 t['\u3236'] = '\u0028\u8CA1\u0029'; 33807 t['\u3237'] = '\u0028\u795D\u0029'; 33808 t['\u3238'] = '\u0028\u52B4\u0029'; 33809 t['\u3239'] = '\u0028\u4EE3\u0029'; 33810 t['\u323A'] = '\u0028\u547C\u0029'; 33811 t['\u323B'] = '\u0028\u5B66\u0029'; 33812 t['\u323C'] = '\u0028\u76E3\u0029'; 33813 t['\u323D'] = '\u0028\u4F01\u0029'; 33814 t['\u323E'] = '\u0028\u8CC7\u0029'; 33815 t['\u323F'] = '\u0028\u5354\u0029'; 33816 t['\u3240'] = '\u0028\u796D\u0029'; 33817 t['\u3241'] = '\u0028\u4F11\u0029'; 33818 t['\u3242'] = '\u0028\u81EA\u0029'; 33819 t['\u3243'] = '\u0028\u81F3\u0029'; 33820 t['\u32C0'] = '\u0031\u6708'; 33821 t['\u32C1'] = '\u0032\u6708'; 33822 t['\u32C2'] = '\u0033\u6708'; 33823 t['\u32C3'] = '\u0034\u6708'; 33824 t['\u32C4'] = '\u0035\u6708'; 33825 t['\u32C5'] = '\u0036\u6708'; 33826 t['\u32C6'] = '\u0037\u6708'; 33827 t['\u32C7'] = '\u0038\u6708'; 33828 t['\u32C8'] = '\u0039\u6708'; 33829 t['\u32C9'] = '\u0031\u0030\u6708'; 33830 t['\u32CA'] = '\u0031\u0031\u6708'; 33831 t['\u32CB'] = '\u0031\u0032\u6708'; 33832 t['\u3358'] = '\u0030\u70B9'; 33833 t['\u3359'] = '\u0031\u70B9'; 33834 t['\u335A'] = '\u0032\u70B9'; 33835 t['\u335B'] = '\u0033\u70B9'; 33836 t['\u335C'] = '\u0034\u70B9'; 33837 t['\u335D'] = '\u0035\u70B9'; 33838 t['\u335E'] = '\u0036\u70B9'; 33839 t['\u335F'] = '\u0037\u70B9'; 33840 t['\u3360'] = '\u0038\u70B9'; 33841 t['\u3361'] = '\u0039\u70B9'; 33842 t['\u3362'] = '\u0031\u0030\u70B9'; 33843 t['\u3363'] = '\u0031\u0031\u70B9'; 33844 t['\u3364'] = '\u0031\u0032\u70B9'; 33845 t['\u3365'] = '\u0031\u0033\u70B9'; 33846 t['\u3366'] = '\u0031\u0034\u70B9'; 33847 t['\u3367'] = '\u0031\u0035\u70B9'; 33848 t['\u3368'] = '\u0031\u0036\u70B9'; 33849 t['\u3369'] = '\u0031\u0037\u70B9'; 33850 t['\u336A'] = '\u0031\u0038\u70B9'; 33851 t['\u336B'] = '\u0031\u0039\u70B9'; 33852 t['\u336C'] = '\u0032\u0030\u70B9'; 33853 t['\u336D'] = '\u0032\u0031\u70B9'; 33854 t['\u336E'] = '\u0032\u0032\u70B9'; 33855 t['\u336F'] = '\u0032\u0033\u70B9'; 33856 t['\u3370'] = '\u0032\u0034\u70B9'; 33857 t['\u33E0'] = '\u0031\u65E5'; 33858 t['\u33E1'] = '\u0032\u65E5'; 33859 t['\u33E2'] = '\u0033\u65E5'; 33860 t['\u33E3'] = '\u0034\u65E5'; 33861 t['\u33E4'] = '\u0035\u65E5'; 33862 t['\u33E5'] = '\u0036\u65E5'; 33863 t['\u33E6'] = '\u0037\u65E5'; 33864 t['\u33E7'] = '\u0038\u65E5'; 33865 t['\u33E8'] = '\u0039\u65E5'; 33866 t['\u33E9'] = '\u0031\u0030\u65E5'; 33867 t['\u33EA'] = '\u0031\u0031\u65E5'; 33868 t['\u33EB'] = '\u0031\u0032\u65E5'; 33869 t['\u33EC'] = '\u0031\u0033\u65E5'; 33870 t['\u33ED'] = '\u0031\u0034\u65E5'; 33871 t['\u33EE'] = '\u0031\u0035\u65E5'; 33872 t['\u33EF'] = '\u0031\u0036\u65E5'; 33873 t['\u33F0'] = '\u0031\u0037\u65E5'; 33874 t['\u33F1'] = '\u0031\u0038\u65E5'; 33875 t['\u33F2'] = '\u0031\u0039\u65E5'; 33876 t['\u33F3'] = '\u0032\u0030\u65E5'; 33877 t['\u33F4'] = '\u0032\u0031\u65E5'; 33878 t['\u33F5'] = '\u0032\u0032\u65E5'; 33879 t['\u33F6'] = '\u0032\u0033\u65E5'; 33880 t['\u33F7'] = '\u0032\u0034\u65E5'; 33881 t['\u33F8'] = '\u0032\u0035\u65E5'; 33882 t['\u33F9'] = '\u0032\u0036\u65E5'; 33883 t['\u33FA'] = '\u0032\u0037\u65E5'; 33884 t['\u33FB'] = '\u0032\u0038\u65E5'; 33885 t['\u33FC'] = '\u0032\u0039\u65E5'; 33886 t['\u33FD'] = '\u0033\u0030\u65E5'; 33887 t['\u33FE'] = '\u0033\u0031\u65E5'; 33888 t['\uFB00'] = '\u0066\u0066'; 33889 t['\uFB01'] = '\u0066\u0069'; 33890 t['\uFB02'] = '\u0066\u006C'; 33891 t['\uFB03'] = '\u0066\u0066\u0069'; 33892 t['\uFB04'] = '\u0066\u0066\u006C'; 33893 t['\uFB05'] = '\u017F\u0074'; 33894 t['\uFB06'] = '\u0073\u0074'; 33895 t['\uFB13'] = '\u0574\u0576'; 33896 t['\uFB14'] = '\u0574\u0565'; 33897 t['\uFB15'] = '\u0574\u056B'; 33898 t['\uFB16'] = '\u057E\u0576'; 33899 t['\uFB17'] = '\u0574\u056D'; 33900 t['\uFB4F'] = '\u05D0\u05DC'; 33901 t['\uFB50'] = '\u0671'; 33902 t['\uFB51'] = '\u0671'; 33903 t['\uFB52'] = '\u067B'; 33904 t['\uFB53'] = '\u067B'; 33905 t['\uFB54'] = '\u067B'; 33906 t['\uFB55'] = '\u067B'; 33907 t['\uFB56'] = '\u067E'; 33908 t['\uFB57'] = '\u067E'; 33909 t['\uFB58'] = '\u067E'; 33910 t['\uFB59'] = '\u067E'; 33911 t['\uFB5A'] = '\u0680'; 33912 t['\uFB5B'] = '\u0680'; 33913 t['\uFB5C'] = '\u0680'; 33914 t['\uFB5D'] = '\u0680'; 33915 t['\uFB5E'] = '\u067A'; 33916 t['\uFB5F'] = '\u067A'; 33917 t['\uFB60'] = '\u067A'; 33918 t['\uFB61'] = '\u067A'; 33919 t['\uFB62'] = '\u067F'; 33920 t['\uFB63'] = '\u067F'; 33921 t['\uFB64'] = '\u067F'; 33922 t['\uFB65'] = '\u067F'; 33923 t['\uFB66'] = '\u0679'; 33924 t['\uFB67'] = '\u0679'; 33925 t['\uFB68'] = '\u0679'; 33926 t['\uFB69'] = '\u0679'; 33927 t['\uFB6A'] = '\u06A4'; 33928 t['\uFB6B'] = '\u06A4'; 33929 t['\uFB6C'] = '\u06A4'; 33930 t['\uFB6D'] = '\u06A4'; 33931 t['\uFB6E'] = '\u06A6'; 33932 t['\uFB6F'] = '\u06A6'; 33933 t['\uFB70'] = '\u06A6'; 33934 t['\uFB71'] = '\u06A6'; 33935 t['\uFB72'] = '\u0684'; 33936 t['\uFB73'] = '\u0684'; 33937 t['\uFB74'] = '\u0684'; 33938 t['\uFB75'] = '\u0684'; 33939 t['\uFB76'] = '\u0683'; 33940 t['\uFB77'] = '\u0683'; 33941 t['\uFB78'] = '\u0683'; 33942 t['\uFB79'] = '\u0683'; 33943 t['\uFB7A'] = '\u0686'; 33944 t['\uFB7B'] = '\u0686'; 33945 t['\uFB7C'] = '\u0686'; 33946 t['\uFB7D'] = '\u0686'; 33947 t['\uFB7E'] = '\u0687'; 33948 t['\uFB7F'] = '\u0687'; 33949 t['\uFB80'] = '\u0687'; 33950 t['\uFB81'] = '\u0687'; 33951 t['\uFB82'] = '\u068D'; 33952 t['\uFB83'] = '\u068D'; 33953 t['\uFB84'] = '\u068C'; 33954 t['\uFB85'] = '\u068C'; 33955 t['\uFB86'] = '\u068E'; 33956 t['\uFB87'] = '\u068E'; 33957 t['\uFB88'] = '\u0688'; 33958 t['\uFB89'] = '\u0688'; 33959 t['\uFB8A'] = '\u0698'; 33960 t['\uFB8B'] = '\u0698'; 33961 t['\uFB8C'] = '\u0691'; 33962 t['\uFB8D'] = '\u0691'; 33963 t['\uFB8E'] = '\u06A9';
33964 t['\uFB8F'] = '\u06A9'; 33965 t['\uFB90'] = '\u06A9'; 33966 t['\uFB91'] = '\u06A9'; 33967 t['\uFB92'] = '\u06AF'; 33968 t['\uFB93'] = '\u06AF'; 33969 t['\uFB94'] = '\u06AF'; 33970 t['\uFB95'] = '\u06AF'; 33971 t['\uFB96'] = '\u06B3'; 33972 t['\uFB97'] = '\u06B3'; 33973 t['\uFB98'] = '\u06B3'; 33974 t['\uFB99'] = '\u06B3'; 33975 t['\uFB9A'] = '\u06B1'; 33976 t['\uFB9B'] = '\u06B1'; 33977 t['\uFB9C'] = '\u06B1'; 33978 t['\uFB9D'] = '\u06B1'; 33979 t['\uFB9E'] = '\u06BA'; 33980 t['\uFB9F'] = '\u06BA'; 33981 t['\uFBA0'] = '\u06BB'; 33982 t['\uFBA1'] = '\u06BB'; 33983 t['\uFBA2'] = '\u06BB'; 33984 t['\uFBA3'] = '\u06BB'; 33985 t['\uFBA4'] = '\u06C0'; 33986 t['\uFBA5'] = '\u06C0'; 33987 t['\uFBA6'] = '\u06C1'; 33988 t['\uFBA7'] = '\u06C1'; 33989 t['\uFBA8'] = '\u06C1'; 33990 t['\uFBA9'] = '\u06C1'; 33991 t['\uFBAA'] = '\u06BE'; 33992 t['\uFBAB'] = '\u06BE'; 33993 t['\uFBAC'] = '\u06BE'; 33994 t['\uFBAD'] = '\u06BE'; 33995 t['\uFBAE'] = '\u06D2'; 33996 t['\uFBAF'] = '\u06D2'; 33997 t['\uFBB0'] = '\u06D3'; 33998 t['\uFBB1'] = '\u06D3'; 33999 t['\uFBD3'] = '\u06AD'; 34000 t['\uFBD4'] = '\u06AD'; 34001 t['\uFBD5'] = '\u06AD'; 34002 t['\uFBD6'] = '\u06AD'; 34003 t['\uFBD7'] = '\u06C7'; 34004 t['\uFBD8'] = '\u06C7'; 34005 t['\uFBD9'] = '\u06C6'; 34006 t['\uFBDA'] = '\u06C6'; 34007 t['\uFBDB'] = '\u06C8'; 34008 t['\uFBDC'] = '\u06C8'; 34009 t['\uFBDD'] = '\u0677'; 34010 t['\uFBDE'] = '\u06CB'; 34011 t['\uFBDF'] = '\u06CB'; 34012 t['\uFBE0'] = '\u06C5'; 34013 t['\uFBE1'] = '\u06C5'; 34014 t['\uFBE2'] = '\u06C9'; 34015 t['\uFBE3'] = '\u06C9'; 34016 t['\uFBE4'] = '\u06D0'; 34017 t['\uFBE5'] = '\u06D0'; 34018 t['\uFBE6'] = '\u06D0'; 34019 t['\uFBE7'] = '\u06D0'; 34020 t['\uFBE8'] = '\u0649'; 34021 t['\uFBE9'] = '\u0649'; 34022 t['\uFBEA'] = '\u0626\u0627'; 34023 t['\uFBEB'] = '\u0626\u0627'; 34024 t['\uFBEC'] = '\u0626\u06D5'; 34025 t['\uFBED'] = '\u0626\u06D5'; 34026 t['\uFBEE'] = '\u0626\u0648'; 34027 t['\uFBEF'] = '\u0626\u0648'; 34028 t['\uFBF0'] = '\u0626\u06C7'; 34029 t['\uFBF1'] = '\u0626\u06C7'; 34030 t['\uFBF2'] = '\u0626\u06C6'; 34031 t['\uFBF3'] = '\u0626\u06C6'; 34032 t['\uFBF4'] = '\u0626\u06C8'; 34033 t['\uFBF5'] = '\u0626\u06C8'; 34034 t['\uFBF6'] = '\u0626\u06D0'; 34035 t['\uFBF7'] = '\u0626\u06D0'; 34036 t['\uFBF8'] = '\u0626\u06D0'; 34037 t['\uFBF9'] = '\u0626\u0649'; 34038 t['\uFBFA'] = '\u0626\u0649'; 34039 t['\uFBFB'] = '\u0626\u0649'; 34040 t['\uFBFC'] = '\u06CC'; 34041 t['\uFBFD'] = '\u06CC'; 34042 t['\uFBFE'] = '\u06CC'; 34043 t['\uFBFF'] = '\u06CC'; 34044 t['\uFC00'] = '\u0626\u062C'; 34045 t['\uFC01'] = '\u0626\u062D'; 34046 t['\uFC02'] = '\u0626\u0645'; 34047 t['\uFC03'] = '\u0626\u0649'; 34048 t['\uFC04'] = '\u0626\u064A'; 34049 t['\uFC05'] = '\u0628\u062C'; 34050 t['\uFC06'] = '\u0628\u062D'; 34051 t['\uFC07'] = '\u0628\u062E'; 34052 t['\uFC08'] = '\u0628\u0645'; 34053 t['\uFC09'] = '\u0628\u0649'; 34054 t['\uFC0A'] = '\u0628\u064A'; 34055 t['\uFC0B'] = '\u062A\u062C'; 34056 t['\uFC0C'] = '\u062A\u062D'; 34057 t['\uFC0D'] = '\u062A\u062E'; 34058 t['\uFC0E'] = '\u062A\u0645'; 34059 t['\uFC0F'] = '\u062A\u0649'; 34060 t['\uFC10'] = '\u062A\u064A'; 34061 t['\uFC11'] = '\u062B\u062C'; 34062 t['\uFC12'] = '\u062B\u0645'; 34063 t['\uFC13'] = '\u062B\u0649'; 34064 t['\uFC14'] = '\u062B\u064A'; 34065 t['\uFC15'] = '\u062C\u062D'; 34066 t['\uFC16'] = '\u062C\u0645'; 34067 t['\uFC17'] = '\u062D\u062C'; 34068 t['\uFC18'] = '\u062D\u0645'; 34069 t['\uFC19'] = '\u062E\u062C'; 34070 t['\uFC1A'] = '\u062E\u062D'; 34071 t['\uFC1B'] = '\u062E\u0645'; 34072 t['\uFC1C'] = '\u0633\u062C'; 34073 t['\uFC1D'] = '\u0633\u062D'; 34074 t['\uFC1E'] = '\u0633\u062E'; 34075 t['\uFC1F'] = '\u0633\u0645'; 34076 t['\uFC20'] = '\u0635\u062D'; 34077 t['\uFC21'] = '\u0635\u0645'; 34078 t['\uFC22'] = '\u0636\u062C'; 34079 t['\uFC23'] = '\u0636\u062D'; 34080 t['\uFC24'] = '\u0636\u062E'; 34081 t['\uFC25'] = '\u0636\u0645'; 34082 t['\uFC26'] = '\u0637\u062D'; 34083 t['\uFC27'] = '\u0637\u0645'; 34084 t['\uFC28'] = '\u0638\u0645'; 34085 t['\uFC29'] = '\u0639\u062C'; 34086 t['\uFC2A'] = '\u0639\u0645'; 34087 t['\uFC2B'] = '\u063A\u062C'; 34088 t['\uFC2C'] = '\u063A\u0645'; 34089 t['\uFC2D'] = '\u0641\u062C'; 34090 t['\uFC2E'] = '\u0641\u062D'; 34091 t['\uFC2F'] = '\u0641\u062E'; 34092 t['\uFC30'] = '\u0641\u0645'; 34093 t['\uFC31'] = '\u0641\u0649'; 34094 t['\uFC32'] = '\u0641\u064A'; 34095 t['\uFC33'] = '\u0642\u062D'; 34096 t['\uFC34'] = '\u0642\u0645'; 34097 t['\uFC35'] = '\u0642\u0649'; 34098 t['\uFC36'] = '\u0642\u064A'; 34099 t['\uFC37'] = '\u0643\u0627'; 34100 t['\uFC38'] = '\u0643\u062C'; 34101 t['\uFC39'] = '\u0643\u062D'; 34102 t['\uFC3A'] = '\u0643\u062E'; 34103 t['\uFC3B'] = '\u0643\u0644'; 34104 t['\uFC3C'] = '\u0643\u0645'; 34105 t['\uFC3D'] = '\u0643\u0649'; 34106 t['\uFC3E'] = '\u0643\u064A'; 34107 t['\uFC3F'] = '\u0644\u062C'; 34108 t['\uFC40'] = '\u0644\u062D'; 34109 t['\uFC41'] = '\u0644\u062E'; 34110 t['\uFC42'] = '\u0644\u0645'; 34111 t['\uFC43'] = '\u0644\u0649'; 34112 t['\uFC44'] = '\u0644\u064A'; 34113 t['\uFC45'] = '\u0645\u062C';
34114 t['\uFC46'] = '\u0645\u062D'; 34115 t['\uFC47'] = '\u0645\u062E'; 34116 t['\uFC48'] = '\u0645\u0645'; 34117 t['\uFC49'] = '\u0645\u0649'; 34118 t['\uFC4A'] = '\u0645\u064A'; 34119 t['\uFC4B'] = '\u0646\u062C'; 34120 t['\uFC4C'] = '\u0646\u062D'; 34121 t['\uFC4D'] = '\u0646\u062E'; 34122 t['\uFC4E'] = '\u0646\u0645'; 34123 t['\uFC4F'] = '\u0646\u0649'; 34124 t['\uFC50'] = '\u0646\u064A'; 34125 t['\uFC51'] = '\u0647\u062C'; 34126 t['\uFC52'] = '\u0647\u0645'; 34127 t['\uFC53'] = '\u0647\u0649'; 34128 t['\uFC54'] = '\u0647\u064A'; 34129 t['\uFC55'] = '\u064A\u062C'; 34130 t['\uFC56'] = '\u064A\u062D'; 34131 t['\uFC57'] = '\u064A\u062E'; 34132 t['\uFC58'] = '\u064A\u0645'; 34133 t['\uFC59'] = '\u064A\u0649'; 34134 t['\uFC5A'] = '\u064A\u064A'; 34135 t['\uFC5B'] = '\u0630\u0670'; 34136 t['\uFC5C'] = '\u0631\u0670'; 34137 t['\uFC5D'] = '\u0649\u0670'; 34138 t['\uFC5E'] = '\u0020\u064C\u0651'; 34139 t['\uFC5F'] = '\u0020\u064D\u0651'; 34140 t['\uFC60'] = '\u0020\u064E\u0651'; 34141 t['\uFC61'] = '\u0020\u064F\u0651'; 34142 t['\uFC62'] = '\u0020\u0650\u0651'; 34143 t['\uFC63'] = '\u0020\u0651\u0670'; 34144 t['\uFC64'] = '\u0626\u0631'; 34145 t['\uFC65'] = '\u0626\u0632'; 34146 t['\uFC66'] = '\u0626\u0645'; 34147 t['\uFC67'] = '\u0626\u0646'; 34148 t['\uFC68'] = '\u0626\u0649'; 34149 t['\uFC69'] = '\u0626\u064A'; 34150 t['\uFC6A'] = '\u0628\u0631'; 34151 t['\uFC6B'] = '\u0628\u0632'; 34152 t['\uFC6C'] = '\u0628\u0645'; 34153 t['\uFC6D'] = '\u0628\u0646'; 34154 t['\uFC6E'] = '\u0628\u0649'; 34155 t['\uFC6F'] = '\u0628\u064A'; 34156 t['\uFC70'] = '\u062A\u0631'; 34157 t['\uFC71'] = '\u062A\u0632'; 34158 t['\uFC72'] = '\u062A\u0645'; 34159 t['\uFC73'] = '\u062A\u0646'; 34160 t['\uFC74'] = '\u062A\u0649'; 34161 t['\uFC75'] = '\u062A\u064A'; 34162 t['\uFC76'] = '\u062B\u0631'; 34163 t['\uFC77'] = '\u062B\u0632'; 34164 t['\uFC78'] = '\u062B\u0645'; 34165 t['\uFC79'] = '\u062B\u0646'; 34166 t['\uFC7A'] = '\u062B\u0649'; 34167 t['\uFC7B'] = '\u062B\u064A'; 34168 t['\uFC7C'] = '\u0641\u0649'; 34169 t['\uFC7D'] = '\u0641\u064A'; 34170 t['\uFC7E'] = '\u0642\u0649'; 34171 t['\uFC7F'] = '\u0642\u064A'; 34172 t['\uFC80'] = '\u0643\u0627'; 34173 t['\uFC81'] = '\u0643\u0644'; 34174 t['\uFC82'] = '\u0643\u0645'; 34175 t['\uFC83'] = '\u0643\u0649'; 34176 t['\uFC84'] = '\u0643\u064A'; 34177 t['\uFC85'] = '\u0644\u0645'; 34178 t['\uFC86'] = '\u0644\u0649'; 34179 t['\uFC87'] = '\u0644\u064A'; 34180 t['\uFC88'] = '\u0645\u0627'; 34181 t['\uFC89'] = '\u0645\u0645'; 34182 t['\uFC8A'] = '\u0646\u0631'; 34183 t['\uFC8B'] = '\u0646\u0632'; 34184 t['\uFC8C'] = '\u0646\u0645'; 34185 t['\uFC8D'] = '\u0646\u0646'; 34186 t['\uFC8E'] = '\u0646\u0649'; 34187 t['\uFC8F'] = '\u0646\u064A'; 34188 t['\uFC90'] = '\u0649\u0670'; 34189 t['\uFC91'] = '\u064A\u0631'; 34190 t['\uFC92'] = '\u064A\u0632'; 34191 t['\uFC93'] = '\u064A\u0645'; 34192 t['\uFC94'] = '\u064A\u0646'; 34193 t['\uFC95'] = '\u064A\u0649'; 34194 t['\uFC96'] = '\u064A\u064A'; 34195 t['\uFC97'] = '\u0626\u062C'; 34196 t['\uFC98'] = '\u0626\u062D'; 34197 t['\uFC99'] = '\u0626\u062E'; 34198 t['\uFC9A'] = '\u0626\u0645'; 34199 t['\uFC9B'] = '\u0626\u0647'; 34200 t['\uFC9C'] = '\u0628\u062C'; 34201 t['\uFC9D'] = '\u0628\u062D'; 34202 t['\uFC9E'] = '\u0628\u062E'; 34203 t['\uFC9F'] = '\u0628\u0645'; 34204 t['\uFCA0'] = '\u0628\u0647'; 34205 t['\uFCA1'] = '\u062A\u062C'; 34206 t['\uFCA2'] = '\u062A\u062D'; 34207 t['\uFCA3'] = '\u062A\u062E'; 34208 t['\uFCA4'] = '\u062A\u0645'; 34209 t['\uFCA5'] = '\u062A\u0647'; 34210 t['\uFCA6'] = '\u062B\u0645'; 34211 t['\uFCA7'] = '\u062C\u062D'; 34212 t['\uFCA8'] = '\u062C\u0645'; 34213 t['\uFCA9'] = '\u062D\u062C'; 34214 t['\uFCAA'] = '\u062D\u0645'; 34215 t['\uFCAB'] = '\u062E\u062C'; 34216 t['\uFCAC'] = '\u062E\u0645'; 34217 t['\uFCAD'] = '\u0633\u062C'; 34218 t['\uFCAE'] = '\u0633\u062D'; 34219 t['\uFCAF'] = '\u0633\u062E'; 34220 t['\uFCB0'] = '\u0633\u0645'; 34221 t['\uFCB1'] = '\u0635\u062D'; 34222 t['\uFCB2'] = '\u0635\u062E'; 34223 t['\uFCB3'] = '\u0635\u0645'; 34224 t['\uFCB4'] = '\u0636\u062C'; 34225 t['\uFCB5'] = '\u0636\u062D'; 34226 t['\uFCB6'] = '\u0636\u062E'; 34227 t['\uFCB7'] = '\u0636\u0645'; 34228 t['\uFCB8'] = '\u0637\u062D'; 34229 t['\uFCB9'] = '\u0638\u0645'; 34230 t['\uFCBA'] = '\u0639\u062C'; 34231 t['\uFCBB'] = '\u0639\u0645'; 34232 t['\uFCBC'] = '\u063A\u062C'; 34233 t['\uFCBD'] = '\u063A\u0645'; 34234 t['\uFCBE'] = '\u0641\u062C'; 34235 t['\uFCBF'] = '\u0641\u062D'; 34236 t['\uFCC0'] = '\u0641\u062E'; 34237 t['\uFCC1'] = '\u0641\u0645'; 34238 t['\uFCC2'] = '\u0642\u062D'; 34239 t['\uFCC3'] = '\u0642\u0645'; 34240 t['\uFCC4'] = '\u0643\u062C'; 34241 t['\uFCC5'] = '\u0643\u062D'; 34242 t['\uFCC6'] = '\u0643\u062E'; 34243 t['\uFCC7'] = '\u0643\u0644'; 34244 t['\uFCC8'] = '\u0643\u0645'; 34245 t['\uFCC9'] = '\u0644\u062C'; 34246 t['\uFCCA'] = '\u0644\u062D'; 34247 t['\uFCCB'] = '\u0644\u062E'; 34248 t['\uFCCC'] = '\u0644\u0645'; 34249 t['\uFCCD'] = '\u0644\u0647'; 34250 t['\uFCCE'] = '\u0645\u062C'; 34251 t['\uFCCF'] = '\u0645\u062D'; 34252 t['\uFCD0'] = '\u0645\u062E'; 34253 t['\uFCD1'] = '\u0645\u0645'; 34254 t['\uFCD2'] = '\u0646\u062C'; 34255 t['\uFCD3'] = '\u0646\u062D'; 34256 t['\uFCD4'] = '\u0646\u062E'; 34257 t['\uFCD5'] = '\u0646\u0645'; 34258 t['\uFCD6'] = '\u0646\u0647'; 34259 t['\uFCD7'] = '\u0647\u062C'; 34260 t['\uFCD8'] = '\u0647\u0645'; 34261 t['\uFCD9'] = '\u0647\u0670'; 34262 t['\uFCDA'] = '\u064A\u062C'; 34263 t['\uFCDB'] = '\u064A\u062D'; 34264 t['\uFCDC'] = '\u064A\u062E'; 34265 t['\uFCDD'] = '\u064A\u0645'; 34266 t['\uFCDE'] = '\u064A\u0647'; 34267 t['\uFCDF'] = '\u0626\u0645';
34268 t['\uFCE0'] = '\u0626\u0647'; 34269 t['\uFCE1'] = '\u0628\u0645'; 34270 t['\uFCE2'] = '\u0628\u0647'; 34271 t['\uFCE3'] = '\u062A\u0645'; 34272 t['\uFCE4'] = '\u062A\u0647'; 34273 t['\uFCE5'] = '\u062B\u0645'; 34274 t['\uFCE6'] = '\u062B\u0647'; 34275 t['\uFCE7'] = '\u0633\u0645'; 34276 t['\uFCE8'] = '\u0633\u0647'; 34277 t['\uFCE9'] = '\u0634\u0645'; 34278 t['\uFCEA'] = '\u0634\u0647'; 34279 t['\uFCEB'] = '\u0643\u0644'; 34280 t['\uFCEC'] = '\u0643\u0645'; 34281 t['\uFCED'] = '\u0644\u0645'; 34282 t['\uFCEE'] = '\u0646\u0645'; 34283 t['\uFCEF'] = '\u0646\u0647'; 34284 t['\uFCF0'] = '\u064A\u0645'; 34285 t['\uFCF1'] = '\u064A\u0647'; 34286 t['\uFCF2'] = '\u0640\u064E\u0651'; 34287 t['\uFCF3'] = '\u0640\u064F\u0651'; 34288 t['\uFCF4'] = '\u0640\u0650\u0651'; 34289 t['\uFCF5'] = '\u0637\u0649'; 34290 t['\uFCF6'] = '\u0637\u064A'; 34291 t['\uFCF7'] = '\u0639\u0649'; 34292 t['\uFCF8'] = '\u0639\u064A'; 34293 t['\uFCF9'] = '\u063A\u0649'; 34294 t['\uFCFA'] = '\u063A\u064A'; 34295 t['\uFCFB'] = '\u0633\u0649'; 34296 t['\uFCFC'] = '\u0633\u064A'; 34297 t['\uFCFD'] = '\u0634\u0649'; 34298 t['\uFCFE'] = '\u0634\u064A'; 34299 t['\uFCFF'] = '\u062D\u0649'; 34300 t['\uFD00'] = '\u062D\u064A'; 34301 t['\uFD01'] = '\u062C\u0649'; 34302 t['\uFD02'] = '\u062C\u064A'; 34303 t['\uFD03'] = '\u062E\u0649'; 34304 t['\uFD04'] = '\u062E\u064A'; 34305 t['\uFD05'] = '\u0635\u0649'; 34306 t['\uFD06'] = '\u0635\u064A'; 34307 t['\uFD07'] = '\u0636\u0649'; 34308 t['\uFD08'] = '\u0636\u064A'; 34309 t['\uFD09'] = '\u0634\u062C'; 34310 t['\uFD0A'] = '\u0634\u062D'; 34311 t['\uFD0B'] = '\u0634\u062E'; 34312 t['\uFD0C'] = '\u0634\u0645'; 34313 t['\uFD0D'] = '\u0634\u0631'; 34314 t['\uFD0E'] = '\u0633\u0631'; 34315 t['\uFD0F'] = '\u0635\u0631'; 34316 t['\uFD10'] = '\u0636\u0631'; 34317 t['\uFD11'] = '\u0637\u0649'; 34318 t['\uFD12'] = '\u0637\u064A'; 34319 t['\uFD13'] = '\u0639\u0649'; 34320 t['\uFD14'] = '\u0639\u064A'; 34321 t['\uFD15'] = '\u063A\u0649'; 34322 t['\uFD16'] = '\u063A\u064A'; 34323 t['\uFD17'] = '\u0633\u0649'; 34324 t['\uFD18'] = '\u0633\u064A'; 34325 t['\uFD19'] = '\u0634\u0649'; 34326 t['\uFD1A'] = '\u0634\u064A'; 34327 t['\uFD1B'] = '\u062D\u0649'; 34328 t['\uFD1C'] = '\u062D\u064A'; 34329 t['\uFD1D'] = '\u062C\u0649'; 34330 t['\uFD1E'] = '\u062C\u064A'; 34331 t['\uFD1F'] = '\u062E\u0649'; 34332 t['\uFD20'] = '\u062E\u064A'; 34333 t['\uFD21'] = '\u0635\u0649'; 34334 t['\uFD22'] = '\u0635\u064A'; 34335 t['\uFD23'] = '\u0636\u0649'; 34336 t['\uFD24'] = '\u0636\u064A'; 34337 t['\uFD25'] = '\u0634\u062C'; 34338 t['\uFD26'] = '\u0634\u062D'; 34339 t['\uFD27'] = '\u0634\u062E'; 34340 t['\uFD28'] = '\u0634\u0645'; 34341 t['\uFD29'] = '\u0634\u0631'; 34342 t['\uFD2A'] = '\u0633\u0631'; 34343 t['\uFD2B'] = '\u0635\u0631'; 34344 t['\uFD2C'] = '\u0636\u0631'; 34345 t['\uFD2D'] = '\u0634\u062C'; 34346 t['\uFD2E'] = '\u0634\u062D'; 34347 t['\uFD2F'] = '\u0634\u062E'; 34348 t['\uFD30'] = '\u0634\u0645'; 34349 t['\uFD31'] = '\u0633\u0647'; 34350 t['\uFD32'] = '\u0634\u0647'; 34351 t['\uFD33'] = '\u0637\u0645'; 34352 t['\uFD34'] = '\u0633\u062C'; 34353 t['\uFD35'] = '\u0633\u062D'; 34354 t['\uFD36'] = '\u0633\u062E'; 34355 t['\uFD37'] = '\u0634\u062C'; 34356 t['\uFD38'] = '\u0634\u062D'; 34357 t['\uFD39'] = '\u0634\u062E'; 34358 t['\uFD3A'] = '\u0637\u0645'; 34359 t['\uFD3B'] = '\u0638\u0645'; 34360 t['\uFD3C'] = '\u0627\u064B'; 34361 t['\uFD3D'] = '\u0627\u064B'; 34362 t['\uFD50'] = '\u062A\u062C\u0645'; 34363 t['\uFD51'] = '\u062A\u062D\u062C'; 34364 t['\uFD52'] = '\u062A\u062D\u062C'; 34365 t['\uFD53'] = '\u062A\u062D\u0645'; 34366 t['\uFD54'] = '\u062A\u062E\u0645'; 34367 t['\uFD55'] = '\u062A\u0645\u062C'; 34368 t['\uFD56'] = '\u062A\u0645\u062D'; 34369 t['\uFD57'] = '\u062A\u0645\u062E'; 34370 t['\uFD58'] = '\u062C\u0645\u062D'; 34371 t['\uFD59'] = '\u062C\u0645\u062D'; 34372 t['\uFD5A'] = '\u062D\u0645\u064A'; 34373 t['\uFD5B'] = '\u062D\u0645\u0649'; 34374 t['\uFD5C'] = '\u0633\u062D\u062C'; 34375 t['\uFD5D'] = '\u0633\u062C\u062D'; 34376 t['\uFD5E'] = '\u0633\u062C\u0649'; 34377 t['\uFD5F'] = '\u0633\u0645\u062D'; 34378 t['\uFD60'] = '\u0633\u0645\u062D'; 34379 t['\uFD61'] = '\u0633\u0645\u062C'; 34380 t['\uFD62'] = '\u0633\u0645\u0645'; 34381 t['\uFD63'] = '\u0633\u0645\u0645'; 34382 t['\uFD64'] = '\u0635\u062D\u062D'; 34383 t['\uFD65'] = '\u0635\u062D\u062D'; 34384 t['\uFD66'] = '\u0635\u0645\u0645'; 34385 t['\uFD67'] = '\u0634\u062D\u0645'; 34386 t['\uFD68'] = '\u0634\u062D\u0645'; 34387 t['\uFD69'] = '\u0634\u062C\u064A'; 34388 t['\uFD6A'] = '\u0634\u0645\u062E'; 34389 t['\uFD6B'] = '\u0634\u0645\u062E'; 34390 t['\uFD6C'] = '\u0634\u0645\u0645'; 34391 t['\uFD6D'] = '\u0634\u0645\u0645'; 34392 t['\uFD6E'] = '\u0636\u062D\u0649'; 34393 t['\uFD6F'] = '\u0636\u062E\u0645'; 34394 t['\uFD70'] = '\u0636\u062E\u0645'; 34395 t['\uFD71'] = '\u0637\u0645\u062D'; 34396 t['\uFD72'] = '\u0637\u0645\u062D'; 34397 t['\uFD73'] = '\u0637\u0645\u0645'; 34398 t['\uFD74'] = '\u0637\u0645\u064A'; 34399 t['\uFD75'] = '\u0639\u062C\u0645'; 34400 t['\uFD76'] = '\u0639\u0645\u0645'; 34401 t['\uFD77'] = '\u0639\u0645\u0645'; 34402 t['\uFD78'] = '\u0639\u0645\u0649'; 34403 t['\uFD79'] = '\u063A\u0645\u0645'; 34404 t['\uFD7A'] = '\u063A\u0645\u064A'; 34405 t['\uFD7B'] = '\u063A\u0645\u0649'; 34406 t['\uFD7C'] = '\u0641\u062E\u0645'; 34407 t['\uFD7D'] = '\u0641\u062E\u0645'; 34408 t['\uFD7E'] = '\u0642\u0645\u062D'; 34409 t['\uFD7F'] = '\u0642\u0645\u0645'; 34410 t['\uFD80'] = '\u0644\u062D\u0645'; 34411 t['\uFD81'] = '\u0644\u062D\u064A'; 34412 t['\uFD82'] = '\u0644\u062D\u0649'; 34413 t['\uFD83'] = '\u0644\u062C\u062C'; 34414 t['\uFD84'] = '\u0644\u062C\u062C'; 34415 t['\uFD85'] = '\u0644\u062E\u0645'; 34416 t['\uFD86'] = '\u0644\u062E\u0645'; 34417 t['\uFD87'] = '\u0644\u0645\u062D'; 34418 t['\uFD88'] = '\u0644\u0645\u062D'; 34419 t['\uFD89'] = '\u0645\u062D\u062C'; 34420 t['\uFD8A'] = '\u0645\u062D\u0645'; 34421 t['\uFD8B'] = '\u0645\u062D\u064A'; 34422 t['\uFD8C'] = '\u0645\u062C\u062D'; 34423 t['\uFD8D'] = '\u0645\u062C\u0645'; 34424 t['\uFD8E'] = '\u0645\u062E\u062C'; 34425 t['\uFD8F'] = '\u0645\u062E\u0645'; 34426 t['\uFD92'] = '\u0645\u062C\u062E'; 34427 t['\uFD93'] = '\u0647\u0645\u062C'; 34428 t['\uFD94'] = '\u0647\u0645\u0645'; 34429 t['\uFD95'] = '\u0646\u062D\u0645'; 34430 t['\uFD96'] = '\u0646\u062D\u0649'; 34431 t['\uFD97'] = '\u0646\u062C\u0645'; 34432 t['\uFD98'] = '\u0646\u062C\u0645'; 34433 t['\uFD99'] = '\u0646\u062C\u0649'; 34434 t['\uFD9A'] = '\u0646\u0645\u064A'; 34435 t['\uFD9B'] = '\u0646\u0645\u0649'; 34436 t['\uFD9C'] = '\u064A\u0645\u0645'; 34437 t['\uFD9D'] = '\u064A\u0645\u0645'; 34438 t['\uFD9E'] = '\u0628\u062E\u064A'; 34439 t['\uFD9F'] = '\u062A\u062C\u064A'; 34440 t['\uFDA0'] = '\u062A\u062C\u0649'; 34441 t['\uFDA1'] = '\u062A\u062E\u064A'; 34442 t['\uFDA2'] = '\u062A\u062E\u0649'; 34443 t['\uFDA3'] = '\u062A\u0645\u064A'; 34444 t['\uFDA4'] = '\u062A\u0645\u0649'; 34445 t['\uFDA5'] = '\u062C\u0645\u064A'; 34446 t['\uFDA6'] = '\u062C\u062D\u0649'; 34447 t['\uFDA7'] = '\u062C\u0645\u0649'; 34448 t['\uFDA8'] = '\u0633\u062E\u0649'; 34449 t['\uFDA9'] = '\u0635\u062D\u064A'; 34450 t['\uFDAA'] = '\u0634\u062D\u064A'; 34451 t['\uFDAB'] = '\u0636\u062D\u064A'; 34452 t['\uFDAC'] = '\u0644\u062C\u064A'; 34453 t['\uFDAD'] = '\u0644\u0645\u064A'; 34454 t['\uFDAE'] = '\u064A\u062D\u064A'; 34455 t['\uFDAF'] = '\u064A\u062C\u064A'; 34456 t['\uFDB0'] = '\u064A\u0645\u064A'; 34457 t['\uFDB1'] = '\u0645\u0645\u064A'; 34458 t['\uFDB2'] = '\u0642\u0645\u064A'; 34459 t['\uFDB3'] = '\u0646\u062D\u064A'; 34460 t['\uFDB4'] = '\u0642\u0645\u062D'; 34461 t['\uFDB5'] = '\u0644\u062D\u0645'; 34462 t['\uFDB6'] = '\u0639\u0645\u064A'; 34463 t['\uFDB7'] = '\u0643\u0645\u064A'; 34464 t['\uFDB8'] = '\u0646\u062C\u062D'; 34465 t['\uFDB9'] = '\u0645\u062E\u064A'; 34466 t['\uFDBA'] = '\u0644\u062C\u0645'; 34467 t['\uFDBB'] = '\u0643\u0645\u0645'; 34468 t['\uFDBC'] = '\u0644\u062C\u0645'; 34469 t['\uFDBD'] = '\u0646\u062C\u062D'; 34470 t['\uFDBE'] = '\u062C\u062D\u064A'; 34471 t['\uFDBF'] = '\u062D\u062C\u064A'; 34472 t['\uFDC0'] = '\u0645\u062C\u064A'; 34473 t['\uFDC1'] = '\u0641\u0645\u064A'; 34474 t['\uFDC2'] = '\u0628\u062D\u064A'; 34475 t['\uFDC3'] = '\u0643\u0645\u0645'; 34476 t['\uFDC4'] = '\u0639\u062C\u0645'; 34477 t['\uFDC5'] = '\u0635\u0645\u0645'; 34478 t['\uFDC6'] = '\u0633\u062E\u064A'; 34479 t['\uFDC7'] = '\u0646\u062C\u064A'; 34480 t['\uFE49'] = '\u203E'; 34481 t['\uFE4A'] = '\u203E';
34482 t['\uFE4B'] = '\u203E'; 34483 t['\uFE4C'] = '\u203E'; 34484 t['\uFE4D'] = '\u005F'; 34485 t['\uFE4E'] = '\u005F'; 34486 t['\uFE4F'] = '\u005F'; 34487 t['\uFE80'] = '\u0621'; 34488 t['\uFE81'] = '\u0622'; 34489 t['\uFE82'] = '\u0622'; 34490 t['\uFE83'] = '\u0623'; 34491 t['\uFE84'] = '\u0623'; 34492 t['\uFE85'] = '\u0624'; 34493 t['\uFE86'] = '\u0624'; 34494 t['\uFE87'] = '\u0625'; 34495 t['\uFE88'] = '\u0625'; 34496 t['\uFE89'] = '\u0626'; 34497 t['\uFE8A'] = '\u0626'; 34498 t['\uFE8B'] = '\u0626'; 34499 t['\uFE8C'] = '\u0626'; 34500 t['\uFE8D'] = '\u0627'; 34501 t['\uFE8E'] = '\u0627'; 34502 t['\uFE8F'] = '\u0628'; 34503 t['\uFE90'] = '\u0628'; 34504 t['\uFE91'] = '\u0628'; 34505 t['\uFE92'] = '\u0628'; 34506 t['\uFE93'] = '\u0629'; 34507 t['\uFE94'] = '\u0629'; 34508 t['\uFE95'] = '\u062A'; 34509 t['\uFE96'] = '\u062A'; 34510 t['\uFE97'] = '\u062A'; 34511 t['\uFE98'] = '\u062A'; 34512 t['\uFE99'] = '\u062B'; 34513 t['\uFE9A'] = '\u062B'; 34514 t['\uFE9B'] = '\u062B'; 34515 t['\uFE9C'] = '\u062B'; 34516 t['\uFE9D'] = '\u062C'; 34517 t['\uFE9E'] = '\u062C'; 34518 t['\uFE9F'] = '\u062C'; 34519 t['\uFEA0'] = '\u062C'; 34520 t['\uFEA1'] = '\u062D'; 34521 t['\uFEA2'] = '\u062D'; 34522 t['\uFEA3'] = '\u062D'; 34523 t['\uFEA4'] = '\u062D'; 34524 t['\uFEA5'] = '\u062E'; 34525 t['\uFEA6'] = '\u062E'; 34526 t['\uFEA7'] = '\u062E'; 34527 t['\uFEA8'] = '\u062E'; 34528 t['\uFEA9'] = '\u062F'; 34529 t['\uFEAA'] = '\u062F'; 34530 t['\uFEAB'] = '\u0630'; 34531 t['\uFEAC'] = '\u0630'; 34532 t['\uFEAD'] = '\u0631'; 34533 t['\uFEAE'] = '\u0631'; 34534 t['\uFEAF'] = '\u0632'; 34535 t['\uFEB0'] = '\u0632'; 34536 t['\uFEB1'] = '\u0633'; 34537 t['\uFEB2'] = '\u0633'; 34538 t['\uFEB3'] = '\u0633'; 34539 t['\uFEB4'] = '\u0633'; 34540 t['\uFEB5'] = '\u0634'; 34541 t['\uFEB6'] = '\u0634'; 34542 t['\uFEB7'] = '\u0634'; 34543 t['\uFEB8'] = '\u0634'; 34544 t['\uFEB9'] = '\u0635'; 34545 t['\uFEBA'] = '\u0635'; 34546 t['\uFEBB'] = '\u0635'; 34547 t['\uFEBC'] = '\u0635'; 34548 t['\uFEBD'] = '\u0636'; 34549 t['\uFEBE'] = '\u0636'; 34550 t['\uFEBF'] = '\u0636'; 34551 t['\uFEC0'] = '\u0636'; 34552 t['\uFEC1'] = '\u0637'; 34553 t['\uFEC2'] = '\u0637'; 34554 t['\uFEC3'] = '\u0637'; 34555 t['\uFEC4'] = '\u0637'; 34556 t['\uFEC5'] = '\u0638'; 34557 t['\uFEC6'] = '\u0638'; 34558 t['\uFEC7'] = '\u0638'; 34559 t['\uFEC8'] = '\u0638'; 34560 t['\uFEC9'] = '\u0639'; 34561 t['\uFECA'] = '\u0639'; 34562 t['\uFECB'] = '\u0639'; 34563 t['\uFECC'] = '\u0639'; 34564 t['\uFECD'] = '\u063A'; 34565 t['\uFECE'] = '\u063A'; 34566 t['\uFECF'] = '\u063A'; 34567 t['\uFED0'] = '\u063A'; 34568 t['\uFED1'] = '\u0641'; 34569 t['\uFED2'] = '\u0641'; 34570 t['\uFED3'] = '\u0641'; 34571 t['\uFED4'] = '\u0641'; 34572 t['\uFED5'] = '\u0642'; 34573 t['\uFED6'] = '\u0642'; 34574 t['\uFED7'] = '\u0642'; 34575 t['\uFED8'] = '\u0642'; 34576 t['\uFED9'] = '\u0643'; 34577 t['\uFEDA'] = '\u0643'; 34578 t['\uFEDB'] = '\u0643'; 34579 t['\uFEDC'] = '\u0643'; 34580 t['\uFEDD'] = '\u0644'; 34581 t['\uFEDE'] = '\u0644'; 34582 t['\uFEDF'] = '\u0644'; 34583 t['\uFEE0'] = '\u0644'; 34584 t['\uFEE1'] = '\u0645'; 34585 t['\uFEE2'] = '\u0645'; 34586 t['\uFEE3'] = '\u0645'; 34587 t['\uFEE4'] = '\u0645'; 34588 t['\uFEE5'] = '\u0646'; 34589 t['\uFEE6'] = '\u0646'; 34590 t['\uFEE7'] = '\u0646'; 34591 t['\uFEE8'] = '\u0646'; 34592 t['\uFEE9'] = '\u0647'; 34593 t['\uFEEA'] = '\u0647'; 34594 t['\uFEEB'] = '\u0647'; 34595 t['\uFEEC'] = '\u0647'; 34596 t['\uFEED'] = '\u0648'; 34597 t['\uFEEE'] = '\u0648'; 34598 t['\uFEEF'] = '\u0649'; 34599 t['\uFEF0'] = '\u0649'; 34600 t['\uFEF1'] = '\u064A'; 34601 t['\uFEF2'] = '\u064A'; 34602 t['\uFEF3'] = '\u064A'; 34603 t['\uFEF4'] = '\u064A'; 34604 t['\uFEF5'] = '\u0644\u0622'; 34605 t['\uFEF6'] = '\u0644\u0622'; 34606 t['\uFEF7'] = '\u0644\u0623'; 34607 t['\uFEF8'] = '\u0644\u0623'; 34608 t['\uFEF9'] = '\u0644\u0625'; 34609 t['\uFEFA'] = '\u0644\u0625'; 34610 t['\uFEFB'] = '\u0644\u0627'; 34611 t['\uFEFC'] = '\u0644\u0627'; 34612}); 34613function reverseIfRtl(chars) { 34614 var charsLength = chars.length; 34615 if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { 34616 return chars; 34617 } 34618 var s = ''; 34619 for (var ii = charsLength - 1; ii >= 0; ii--) { 34620 s += chars[ii]; 34621 } 34622 return s; 34623} 34624exports.mapSpecialUnicodeValues = mapSpecialUnicodeValues; 34625exports.reverseIfRtl = reverseIfRtl; 34626exports.getUnicodeRangeFor = getUnicodeRangeFor; 34627exports.getNormalizedUnicodes = getNormalizedUnicodes; 34628exports.getUnicodeForGlyph = getUnicodeForGlyph; 34629 34630/***/ }), 34631/* 19 */ 34632/***/ (function(module, exports, __w_pdfjs_require__) { 34633 34634"use strict"; 34635 34636var sharedUtil = __w_pdfjs_require__(0); 34637var coreWorker = __w_pdfjs_require__(8); 34638var globalScope = sharedUtil.globalScope; 34639var OK_RESPONSE = 200; 34640var PARTIAL_CONTENT_RESPONSE = 206; 34641function NetworkManager(url, args) { 34642 this.url = url; 34643 args = args || {}; 34644 this.isHttp = /^https?:/i.test(url); 34645 this.httpHeaders = this.isHttp && args.httpHeaders || {}; 34646 this.withCredentials = args.withCredentials || false; 34647 this.getXhr = args.getXhr || function NetworkManager_getXhr() { 34648 return new XMLHttpRequest(); 34649 }; 34650 this.currXhrId = 0; 34651 this.pendingRequests = Object.create(null); 34652 this.loadedRequests = Object.create(null); 34653} 34654function getArrayBuffer(xhr) { 34655 var data = xhr.response; 34656 if (typeof data !== 'string') { 34657 return data; 34658 } 34659 var length = data.length; 34660 var array = new Uint8Array(length); 34661 for (var i = 0; i < length; i++) { 34662 array[i] = data.charCodeAt(i) & 0xFF; 34663 } 34664 return array.buffer; 34665}
vendor: 4,200 bytes, lines 34666-34802
34666var supportsMozChunked = function supportsMozChunkedClosure() { 34667 try { 34668 var x = new XMLHttpRequest(); 34669 x.open('GET', globalScope.location.href); 34670 x.responseType = 'moz-chunked-arraybuffer'; 34671 return x.responseType === 'moz-chunked-arraybuffer'; 34672 } catch (e) { 34673 return false; 34674 } 34675}(); 34676NetworkManager.prototype = { 34677 requestRange: function NetworkManager_requestRange(begin, end, listeners) { 34678 var args = { 34679 begin: begin, 34680 end: end 34681 }; 34682 for (var prop in listeners) { 34683 args[prop] = listeners[prop]; 34684 } 34685 return this.request(args); 34686 }, 34687 requestFull: function NetworkManager_requestFull(listeners) { 34688 return this.request(listeners); 34689 }, 34690 request: function NetworkManager_request(args) { 34691 var xhr = this.getXhr(); 34692 var xhrId = this.currXhrId++; 34693 var pendingRequest = this.pendingRequests[xhrId] = { xhr: xhr }; 34694 xhr.open('GET', this.url); 34695 xhr.withCredentials = this.withCredentials; 34696 for (var property in this.httpHeaders) { 34697 var value = this.httpHeaders[property]; 34698 if (typeof value === 'undefined') { 34699 continue; 34700 } 34701 xhr.setRequestHeader(property, value); 34702 } 34703 if (this.isHttp && 'begin' in args && 'end' in args) { 34704 var rangeStr = args.begin + '-' + (args.end - 1); 34705 xhr.setRequestHeader('Range', 'bytes=' + rangeStr); 34706 pendingRequest.expectedStatus = 206; 34707 } else { 34708 pendingRequest.expectedStatus = 200; 34709 } 34710 var useMozChunkedLoading = supportsMozChunked && !!args.onProgressiveData; 34711 if (useMozChunkedLoading) { 34712 xhr.responseType = 'moz-chunked-arraybuffer'; 34713 pendingRequest.onProgressiveData = args.onProgressiveData; 34714 pendingRequest.mozChunked = true; 34715 } else { 34716 xhr.responseType = 'arraybuffer'; 34717 } 34718 if (args.onError) { 34719 xhr.onerror = function (evt) { 34720 args.onError(xhr.status); 34721 }; 34722 } 34723 xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); 34724 xhr.onprogress = this.onProgress.bind(this, xhrId); 34725 pendingRequest.onHeadersReceived = args.onHeadersReceived; 34726 pendingRequest.onDone = args.onDone; 34727 pendingRequest.onError = args.onError; 34728 pendingRequest.onProgress = args.onProgress; 34729 xhr.send(null); 34730 return xhrId; 34731 }, 34732 onProgress: function NetworkManager_onProgress(xhrId, evt) { 34733 var pendingRequest = this.pendingRequests[xhrId]; 34734 if (!pendingRequest) { 34735 return; 34736 } 34737 if (pendingRequest.mozChunked) { 34738 var chunk = getArrayBuffer(pendingRequest.xhr); 34739 pendingRequest.onProgressiveData(chunk); 34740 } 34741 var onProgress = pendingRequest.onProgress; 34742 if (onProgress) { 34743 onProgress(evt); 34744 } 34745 }, 34746 onStateChange: function NetworkManager_onStateChange(xhrId, evt) { 34747 var pendingRequest = this.pendingRequests[xhrId]; 34748 if (!pendingRequest) { 34749 return; 34750 } 34751 var xhr = pendingRequest.xhr; 34752 if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { 34753 pendingRequest.onHeadersReceived(); 34754 delete pendingRequest.onHeadersReceived; 34755 } 34756 if (xhr.readyState !== 4) { 34757 return; 34758 } 34759 if (!(xhrId in this.pendingRequests)) { 34760 return; 34761 } 34762 delete this.pendingRequests[xhrId]; 34763 if (xhr.status === 0 && this.isHttp) { 34764 if (pendingRequest.onError) { 34765 pendingRequest.onError(xhr.status); 34766 } 34767 return; 34768 } 34769 var xhrStatus = xhr.status || OK_RESPONSE; 34770 var ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; 34771 if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) { 34772 if (pendingRequest.onError) { 34773 pendingRequest.onError(xhr.status); 34774 } 34775 return; 34776 } 34777 this.loadedRequests[xhrId] = true; 34778 var chunk = getArrayBuffer(xhr); 34779 if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { 34780 var rangeHeader = xhr.getResponseHeader('Content-Range'); 34781 var matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); 34782 var begin = parseInt(matches[1], 10); 34783 pendingRequest.onDone({ 34784 begin: begin, 34785 chunk: chunk 34786 }); 34787 } else if (pendingRequest.onProgressiveData) { 34788 pendingRequest.onDone(null); 34789 } else if (chunk) { 34790 pendingRequest.onDone({ 34791 begin: 0, 34792 chunk: chunk 34793 }); 34794 } else if (pendingRequest.onError) { 34795 pendingRequest.onError(xhr.status); 34796 } 34797 }, 34798 hasPendingRequests: function NetworkManager_hasPendingRequests() { 34799 for (var xhrId in this.pendingRequests) { 34800 return true; 34801 } 34802 return false;
34803 }, 34804 getRequestXhr: function NetworkManager_getXhr(xhrId) { 34805 return this.pendingRequests[xhrId].xhr; 34806 }, 34807 isStreamingRequest: function NetworkManager_isStreamingRequest(xhrId) { 34808 return !!this.pendingRequests[xhrId].onProgressiveData; 34809 }, 34810 isPendingRequest: function NetworkManager_isPendingRequest(xhrId) { 34811 return xhrId in this.pendingRequests; 34812 }, 34813 isLoadedRequest: function NetworkManager_isLoadedRequest(xhrId) { 34814 return xhrId in this.loadedRequests; 34815 }, 34816 abortAllRequests: function NetworkManager_abortAllRequests() { 34817 for (var xhrId in this.pendingRequests) { 34818 this.abortRequest(xhrId | 0); 34819 } 34820 }, 34821 abortRequest: function NetworkManager_abortRequest(xhrId) { 34822 var xhr = this.pendingRequests[xhrId].xhr; 34823 delete this.pendingRequests[xhrId]; 34824 xhr.abort(); 34825 } 34826}; 34827var assert = sharedUtil.assert; 34828var createPromiseCapability = sharedUtil.createPromiseCapability; 34829var isInt = sharedUtil.isInt; 34830var MissingPDFException = sharedUtil.MissingPDFException; 34831var UnexpectedResponseException = sharedUtil.UnexpectedResponseException; 34832function PDFNetworkStream(options) { 34833 this._options = options; 34834 var source = options.source; 34835 this._manager = new NetworkManager(source.url, { 34836 httpHeaders: source.httpHeaders, 34837 withCredentials: source.withCredentials 34838 }); 34839 this._rangeChunkSize = source.rangeChunkSize; 34840 this._fullRequestReader = null; 34841 this._rangeRequestReaders = []; 34842} 34843PDFNetworkStream.prototype = { 34844 _onRangeRequestReaderClosed: function PDFNetworkStream_onRangeRequestReaderClosed(reader) { 34845 var i = this._rangeRequestReaders.indexOf(reader); 34846 if (i >= 0) { 34847 this._rangeRequestReaders.splice(i, 1); 34848 } 34849 }, 34850 getFullReader: function PDFNetworkStream_getFullReader() { 34851 assert(!this._fullRequestReader); 34852 this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._options); 34853 return this._fullRequestReader; 34854 }, 34855 getRangeReader: function PDFNetworkStream_getRangeReader(begin, end) { 34856 var reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end); 34857 reader.onClosed = this._onRangeRequestReaderClosed.bind(this); 34858 this._rangeRequestReaders.push(reader); 34859 return reader; 34860 }, 34861 cancelAllRequests: function PDFNetworkStream_cancelAllRequests(reason) { 34862 if (this._fullRequestReader) { 34863 this._fullRequestReader.cancel(reason); 34864 } 34865 var readers = this._rangeRequestReaders.slice(0); 34866 readers.forEach(function (reader) { 34867 reader.cancel(reason); 34868 }); 34869 } 34870}; 34871function PDFNetworkStreamFullRequestReader(manager, options) { 34872 this._manager = manager; 34873 var source = options.source; 34874 var args = { 34875 onHeadersReceived: this._onHeadersReceived.bind(this), 34876 onProgressiveData: source.disableStream ? null : this._onProgressiveData.bind(this), 34877 onDone: this._onDone.bind(this), 34878 onError: this._onError.bind(this), 34879 onProgress: this._onProgress.bind(this) 34880 }; 34881 this._url = source.url; 34882 this._fullRequestId = manager.requestFull(args); 34883 this._headersReceivedCapability = createPromiseCapability(); 34884 this._disableRange = options.disableRange || false; 34885 this._contentLength = source.length; 34886 this._rangeChunkSize = source.rangeChunkSize; 34887 if (!this._rangeChunkSize && !this._disableRange) { 34888 this._disableRange = true; 34889 } 34890 this._isStreamingSupported = false; 34891 this._isRangeSupported = false; 34892 this._cachedChunks = []; 34893 this._requests = []; 34894 this._done = false; 34895 this._storedError = undefined; 34896 this.onProgress = null; 34897} 34898PDFNetworkStreamFullRequestReader.prototype = { 34899 _validateRangeRequestCapabilities: function PDFNetworkStreamFullRequestReader_validateRangeRequestCapabilities() { 34900 if (this._disableRange) { 34901 return false; 34902 } 34903 var networkManager = this._manager; 34904 if (!networkManager.isHttp) { 34905 return false; 34906 } 34907 var fullRequestXhrId = this._fullRequestId; 34908 var fullRequestXhr = networkManager.getRequestXhr(fullRequestXhrId); 34909 if (fullRequestXhr.getResponseHeader('Accept-Ranges') !== 'bytes') { 34910 return false; 34911 } 34912 var contentEncoding = fullRequestXhr.getResponseHeader('Content-Encoding') || 'identity'; 34913 if (contentEncoding !== 'identity') { 34914 return false; 34915 } 34916 var length = fullRequestXhr.getResponseHeader('Content-Length'); 34917 length = parseInt(length, 10); 34918 if (!isInt(length)) { 34919 return false;
34920 } 34921 this._contentLength = length; 34922 if (length <= 2 * this._rangeChunkSize) { 34923 return false; 34924 } 34925 return true; 34926 }, 34927 _onHeadersReceived: function PDFNetworkStreamFullRequestReader_onHeadersReceived() { 34928 if (this._validateRangeRequestCapabilities()) { 34929 this._isRangeSupported = true; 34930 } 34931 var networkManager = this._manager; 34932 var fullRequestXhrId = this._fullRequestId; 34933 if (networkManager.isStreamingRequest(fullRequestXhrId)) { 34934 this._isStreamingSupported = true; 34935 } else if (this._isRangeSupported) { 34936 networkManager.abortRequest(fullRequestXhrId); 34937 } 34938 this._headersReceivedCapability.resolve(); 34939 }, 34940 _onProgressiveData: function PDFNetworkStreamFullRequestReader_onProgressiveData(chunk) { 34941 if (this._requests.length > 0) { 34942 var requestCapability = this._requests.shift(); 34943 requestCapability.resolve({ 34944 value: chunk, 34945 done: false 34946 }); 34947 } else { 34948 this._cachedChunks.push(chunk); 34949 } 34950 }, 34951 _onDone: function PDFNetworkStreamFullRequestReader_onDone(args) { 34952 if (args) { 34953 this._onProgressiveData(args.chunk); 34954 } 34955 this._done = true; 34956 if (this._cachedChunks.length > 0) { 34957 return; 34958 } 34959 this._requests.forEach(function (requestCapability) { 34960 requestCapability.resolve({ 34961 value: undefined, 34962 done: true 34963 }); 34964 }); 34965 this._requests = []; 34966 }, 34967 _onError: function PDFNetworkStreamFullRequestReader_onError(status) { 34968 var url = this._url; 34969 var exception; 34970 if (status === 404 || status === 0 && /^file:/.test(url)) { 34971 exception = new MissingPDFException('Missing PDF "' + url + '".'); 34972 } else { 34973 exception = new UnexpectedResponseException('Unexpected server response (' + status + ') while retrieving PDF "' + url + '".', status); 34974 } 34975 this._storedError = exception; 34976 this._headersReceivedCapability.reject(exception); 34977 this._requests.forEach(function (requestCapability) { 34978 requestCapability.reject(exception); 34979 }); 34980 this._requests = []; 34981 this._cachedChunks = []; 34982 }, 34983 _onProgress: function PDFNetworkStreamFullRequestReader_onProgress(data) { 34984 if (this.onProgress) { 34985 this.onProgress({ 34986 loaded: data.loaded, 34987 total: data.lengthComputable ? data.total : this._contentLength 34988 }); 34989 } 34990 }, 34991 get isRangeSupported() { 34992 return this._isRangeSupported; 34993 }, 34994 get isStreamingSupported() { 34995 return this._isStreamingSupported; 34996 }, 34997 get contentLength() { 34998 return this._contentLength; 34999 }, 35000 get headersReady() { 35001 return this._headersReceivedCapability.promise; 35002 }, 35003 read: function PDFNetworkStreamFullRequestReader_read() { 35004 if (this._storedError) { 35005 return Promise.reject(this._storedError); 35006 } 35007 if (this._cachedChunks.length > 0) { 35008 var chunk = this._cachedChunks.shift(); 35009 return Promise.resolve(chunk); 35010 } 35011 if (this._done) { 35012 return Promise.resolve({ 35013 value: undefined, 35014 done: true 35015 }); 35016 } 35017 var requestCapability = createPromiseCapability(); 35018 this._requests.push(requestCapability); 35019 return requestCapability.promise; 35020 }, 35021 cancel: function PDFNetworkStreamFullRequestReader_cancel(reason) { 35022 this._done = true; 35023 this._headersReceivedCapability.reject(reason); 35024 this._requests.forEach(function (requestCapability) { 35025 requestCapability.resolve({ 35026 value: undefined, 35027 done: true 35028 }); 35029 }); 35030 this._requests = []; 35031 if (this._manager.isPendingRequest(this._fullRequestId)) { 35032 this._manager.abortRequest(this._fullRequestId); 35033 } 35034 this._fullRequestReader = null; 35035 } 35036}; 35037function PDFNetworkStreamRangeRequestReader(manager, begin, end) { 35038 this._manager = manager; 35039 var args = { 35040 onDone: this._onDone.bind(this), 35041 onProgress: this._onProgress.bind(this) 35042 }; 35043 this._requestId = manager.requestRange(begin, end, args); 35044 this._requests = []; 35045 this._queuedChunk = null; 35046 this._done = false; 35047 this.onProgress = null; 35048 this.onClosed = null; 35049} 35050PDFNetworkStreamRangeRequestReader.prototype = { 35051 _close: function PDFNetworkStreamRangeRequestReader_close() { 35052 if (this.onClosed) { 35053 this.onClosed(this); 35054 } 35055 }, 35056 _onDone: function PDFNetworkStreamRangeRequestReader_onDone(data) { 35057 var chunk = data.chunk; 35058 if (this._requests.length > 0) { 35059 var requestCapability = this._requests.shift(); 35060 requestCapability.resolve({ 35061 value: chunk, 35062 done: false 35063 }); 35064 } else { 35065 this._queuedChunk = chunk; 35066 } 35067 this._done = true;
35068 this._requests.forEach(function (requestCapability) { 35069 requestCapability.resolve({ 35070 value: undefined, 35071 done: true 35072 }); 35073 }); 35074 this._requests = []; 35075 this._close(); 35076 }, 35077 _onProgress: function PDFNetworkStreamRangeRequestReader_onProgress(evt) { 35078 if (!this.isStreamingSupported && this.onProgress) { 35079 this.onProgress({ loaded: evt.loaded }); 35080 } 35081 }, 35082 get isStreamingSupported() { 35083 return false; 35084 }, 35085 read: function PDFNetworkStreamRangeRequestReader_read() { 35086 if (this._queuedChunk !== null) { 35087 var chunk = this._queuedChunk; 35088 this._queuedChunk = null; 35089 return Promise.resolve({ 35090 value: chunk, 35091 done: false 35092 }); 35093 } 35094 if (this._done) { 35095 return Promise.resolve({ 35096 value: undefined, 35097 done: true 35098 }); 35099 } 35100 var requestCapability = createPromiseCapability(); 35101 this._requests.push(requestCapability); 35102 return requestCapability.promise; 35103 }, 35104 cancel: function PDFNetworkStreamRangeRequestReader_cancel(reason) { 35105 this._done = true; 35106 this._requests.forEach(function (requestCapability) { 35107 requestCapability.resolve({ 35108 value: undefined, 35109 done: true 35110 }); 35111 }); 35112 this._requests = []; 35113 if (this._manager.isPendingRequest(this._requestId)) { 35114 this._manager.abortRequest(this._requestId); 35115 } 35116 this._close(); 35117 } 35118}; 35119coreWorker.setPDFNetworkStreamClass(PDFNetworkStream); 35120exports.PDFNetworkStream = PDFNetworkStream; 35121exports.NetworkManager = NetworkManager; 35122 35123/***/ }), 35124/* 20 */ 35125/***/ (function(module, exports, __w_pdfjs_require__) { 35126 35127"use strict"; 35128 35129var sharedUtil = __w_pdfjs_require__(0); 35130var corePrimitives = __w_pdfjs_require__(1); 35131var coreStream = __w_pdfjs_require__(2); 35132var coreColorSpace = __w_pdfjs_require__(3); 35133var coreObj = __w_pdfjs_require__(16); 35134var coreEvaluator = __w_pdfjs_require__(14); 35135var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType; 35136var AnnotationFieldFlag = sharedUtil.AnnotationFieldFlag; 35137var AnnotationFlag = sharedUtil.AnnotationFlag; 35138var AnnotationType = sharedUtil.AnnotationType; 35139var OPS = sharedUtil.OPS; 35140var Util = sharedUtil.Util; 35141var isArray = sharedUtil.isArray; 35142var isInt = sharedUtil.isInt; 35143var stringToBytes = sharedUtil.stringToBytes; 35144var stringToPDFString = sharedUtil.stringToPDFString; 35145var warn = sharedUtil.warn; 35146var Dict = corePrimitives.Dict; 35147var isDict = corePrimitives.isDict; 35148var isName = corePrimitives.isName; 35149var isRef = corePrimitives.isRef; 35150var isStream = corePrimitives.isStream; 35151var Stream = coreStream.Stream; 35152var ColorSpace = coreColorSpace.ColorSpace; 35153var Catalog = coreObj.Catalog; 35154var ObjectLoader = coreObj.ObjectLoader; 35155var FileSpec = coreObj.FileSpec; 35156var OperatorList = coreEvaluator.OperatorList; 35157function AnnotationFactory() { 35158} 35159AnnotationFactory.prototype = { 35160 create: function AnnotationFactory_create(xref, ref, pdfManager, idFactory) { 35161 var dict = xref.fetchIfRef(ref); 35162 if (!isDict(dict)) { 35163 return; 35164 } 35165 var id = isRef(ref) ? ref.toString() : 'annot_' + idFactory.createObjId(); 35166 var subtype = dict.get('Subtype'); 35167 subtype = isName(subtype) ? subtype.name : null; 35168 var parameters = { 35169 xref: xref, 35170 dict: dict, 35171 ref: isRef(ref) ? ref : null, 35172 subtype: subtype, 35173 id: id, 35174 pdfManager: pdfManager 35175 }; 35176 switch (subtype) { 35177 case 'Link': 35178 return new LinkAnnotation(parameters); 35179 case 'Text': 35180 return new TextAnnotation(parameters); 35181 case 'Widget': 35182 var fieldType = Util.getInheritableProperty(dict, 'FT'); 35183 fieldType = isName(fieldType) ? fieldType.name : null; 35184 switch (fieldType) { 35185 case 'Tx': 35186 return new TextWidgetAnnotation(parameters); 35187 case 'Btn': 35188 return new ButtonWidgetAnnotation(parameters); 35189 case 'Ch': 35190 return new ChoiceWidgetAnnotation(parameters); 35191 } 35192 warn('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.'); 35193 return new WidgetAnnotation(parameters); 35194 case 'Popup': 35195 return new PopupAnnotation(parameters); 35196 case 'Highlight': 35197 return new HighlightAnnotation(parameters); 35198 case 'Underline': 35199 return new UnderlineAnnotation(parameters); 35200 case 'Squiggly': 35201 return new SquigglyAnnotation(parameters); 35202 case 'StrikeOut': 35203 return new StrikeOutAnnotation(parameters); 35204 case 'FileAttachment': 35205 return new FileAttachmentAnnotation(parameters); 35206 default: 35207 if (!subtype) { 35208 warn('Annotation is missing the required /Subtype.'); 35209 } else { 35210 warn('Unimplemented annotation type "' + subtype + '", ' + 'falling back to base annotation.'); 35211 } 35212 return new Annotation(parameters); 35213 } 35214 } 35215}; 35216var Annotation = function AnnotationClosure() { 35217 function getTransformMatrix(rect, bbox, matrix) { 35218 var bounds = Util.getAxialAlignedBoundingBox(bbox, matrix); 35219 var minX = bounds[0]; 35220 var minY = bounds[1]; 35221 var maxX = bounds[2]; 35222 var maxY = bounds[3]; 35223 if (minX === maxX || minY === maxY) { 35224 return [ 35225 1, 35226 0, 35227 0, 35228 1, 35229 rect[0], 35230 rect[1] 35231 ]; 35232 } 35233 var xRatio = (rect[2] - rect[0]) / (maxX - minX); 35234 var yRatio = (rect[3] - rect[1]) / (maxY - minY); 35235 return [ 35236 xRatio, 35237 0, 35238 0, 35239 yRatio, 35240 rect[0] - minX * xRatio, 35241 rect[1] - minY * yRatio 35242 ]; 35243 } 35244 function Annotation(params) { 35245 var dict = params.dict; 35246 this.setFlags(dict.get('F')); 35247 this.setRectangle(dict.getArray('Rect')); 35248 this.setColor(dict.getArray('C')); 35249 this.setBorderStyle(dict); 35250 this.setAppearance(dict); 35251 this.data = {}; 35252 this.data.id = params.id; 35253 this.data.subtype = params.subtype; 35254 this.data.annotationFlags = this.flags; 35255 this.data.rect = this.rectangle; 35256 this.data.color = this.color; 35257 this.data.borderStyle = this.borderStyle; 35258 this.data.hasAppearance = !!this.appearance; 35259 } 35260 Annotation.prototype = { 35261 _hasFlag: function Annotation_hasFlag(flags, flag) { 35262 return !!(flags & flag); 35263 }, 35264 _isViewable: function Annotation_isViewable(flags) { 35265 return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.HIDDEN) && !this._hasFlag(flags, AnnotationFlag.NOVIEW); 35266 }, 35267 _isPrintable: function AnnotationFlag_isPrintable(flags) { 35268 return this._hasFlag(flags, AnnotationFlag.PRINT) && !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.HIDDEN); 35269 }, 35270 get viewable() { 35271 if (this.flags === 0) { 35272 return true; 35273 } 35274 return this._isViewable(this.flags); 35275 }, 35276 get printable() { 35277 if (this.flags === 0) { 35278 return false;
35279 } 35280 return this._isPrintable(this.flags); 35281 }, 35282 setFlags: function Annotation_setFlags(flags) { 35283 this.flags = isInt(flags) && flags > 0 ? flags : 0; 35284 }, 35285 hasFlag: function Annotation_hasFlag(flag) { 35286 return this._hasFlag(this.flags, flag); 35287 }, 35288 setRectangle: function Annotation_setRectangle(rectangle) { 35289 if (isArray(rectangle) && rectangle.length === 4) { 35290 this.rectangle = Util.normalizeRect(rectangle); 35291 } else { 35292 this.rectangle = [ 35293 0, 35294 0, 35295 0, 35296 0 35297 ]; 35298 } 35299 }, 35300 setColor: function Annotation_setColor(color) { 35301 var rgbColor = new Uint8Array(3); 35302 if (!isArray(color)) { 35303 this.color = rgbColor; 35304 return; 35305 } 35306 switch (color.length) { 35307 case 0: 35308 this.color = null; 35309 break; 35310 case 1: 35311 ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); 35312 this.color = rgbColor; 35313 break; 35314 case 3: 35315 ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); 35316 this.color = rgbColor; 35317 break; 35318 case 4: 35319 ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); 35320 this.color = rgbColor; 35321 break; 35322 default: 35323 this.color = rgbColor; 35324 break; 35325 } 35326 }, 35327 setBorderStyle: function Annotation_setBorderStyle(borderStyle) { 35328 this.borderStyle = new AnnotationBorderStyle(); 35329 if (!isDict(borderStyle)) { 35330 return; 35331 } 35332 if (borderStyle.has('BS')) { 35333 var dict = borderStyle.get('BS'); 35334 var dictType = dict.get('Type'); 35335 if (!dictType || isName(dictType, 'Border')) { 35336 this.borderStyle.setWidth(dict.get('W')); 35337 this.borderStyle.setStyle(dict.get('S')); 35338 this.borderStyle.setDashArray(dict.getArray('D')); 35339 } 35340 } else if (borderStyle.has('Border')) { 35341 var array = borderStyle.getArray('Border'); 35342 if (isArray(array) && array.length >= 3) { 35343 this.borderStyle.setHorizontalCornerRadius(array[0]); 35344 this.borderStyle.setVerticalCornerRadius(array[1]); 35345 this.borderStyle.setWidth(array[2]); 35346 if (array.length === 4) { 35347 this.borderStyle.setDashArray(array[3]); 35348 } 35349 } 35350 } else { 35351 this.borderStyle.setWidth(0); 35352 } 35353 }, 35354 setAppearance: function Annotation_setAppearance(dict) { 35355 this.appearance = null; 35356 var appearanceStates = dict.get('AP'); 35357 if (!isDict(appearanceStates)) { 35358 return; 35359 } 35360 var normalAppearanceState = appearanceStates.get('N'); 35361 if (isStream(normalAppearanceState)) { 35362 this.appearance = normalAppearanceState; 35363 return; 35364 } 35365 if (!isDict(normalAppearanceState)) { 35366 return; 35367 } 35368 var as = dict.get('AS'); 35369 if (!isName(as) || !normalAppearanceState.has(as.name)) { 35370 return; 35371 } 35372 this.appearance = normalAppearanceState.get(as.name); 35373 }, 35374 _preparePopup: function Annotation_preparePopup(dict) { 35375 if (!dict.has('C')) { 35376 this.data.color = null; 35377 } 35378 this.data.hasPopup = dict.has('Popup'); 35379 this.data.title = stringToPDFString(dict.get('T') || ''); 35380 this.data.contents = stringToPDFString(dict.get('Contents') || ''); 35381 }, 35382 loadResources: function Annotation_loadResources(keys) { 35383 return new Promise(function (resolve, reject) { 35384 this.appearance.dict.getAsync('Resources').then(function (resources) { 35385 if (!resources) { 35386 resolve(); 35387 return; 35388 } 35389 var objectLoader = new ObjectLoader(resources.map, keys, resources.xref); 35390 objectLoader.load().then(function () { 35391 resolve(resources); 35392 }, reject); 35393 }, reject); 35394 }.bind(this)); 35395 }, 35396 getOperatorList: function Annotation_getOperatorList(evaluator, task, renderForms) { 35397 if (!this.appearance) { 35398 return Promise.resolve(new OperatorList()); 35399 } 35400 var data = this.data; 35401 var appearanceDict = this.appearance.dict; 35402 var resourcesPromise = this.loadResources([ 35403 'ExtGState', 35404 'ColorSpace', 35405 'Pattern', 35406 'Shading', 35407 'XObject', 35408 'Font' 35409 ]); 35410 var bbox = appearanceDict.getArray('BBox') || [ 35411 0, 35412 0, 35413 1, 35414 1 35415 ]; 35416 var matrix = appearanceDict.getArray('Matrix') || [ 35417 1, 35418 0, 35419 0, 35420 1, 35421 0, 35422 0 35423 ]; 35424 var transform = getTransformMatrix(data.rect, bbox, matrix); 35425 var self = this; 35426 return resourcesPromise.then(function (resources) { 35427 var opList = new OperatorList(); 35428 opList.addOp(OPS.beginAnnotation, [ 35429 data.rect, 35430 transform, 35431 matrix 35432 ]); 35433 return evaluator.getOperatorList(self.appearance, task, resources, opList).then(function () { 35434 opList.addOp(OPS.endAnnotation, []); 35435 self.appearance.reset(); 35436 return opList; 35437 }); 35438 }); 35439 } 35440 }; 35441 return Annotation; 35442}(); 35443var AnnotationBorderStyle = function AnnotationBorderStyleClosure() { 35444 function AnnotationBorderStyle() { 35445 this.width = 1; 35446 this.style = AnnotationBorderStyleType.SOLID; 35447 this.dashArray = [3]; 35448 this.horizontalCornerRadius = 0; 35449 this.verticalCornerRadius = 0; 35450 } 35451 AnnotationBorderStyle.prototype = {
35452 setWidth: function AnnotationBorderStyle_setWidth(width) { 35453 if (width === (width | 0)) { 35454 this.width = width; 35455 } 35456 }, 35457 setStyle: function AnnotationBorderStyle_setStyle(style) { 35458 if (!style) { 35459 return; 35460 } 35461 switch (style.name) { 35462 case 'S': 35463 this.style = AnnotationBorderStyleType.SOLID; 35464 break; 35465 case 'D': 35466 this.style = AnnotationBorderStyleType.DASHED; 35467 break; 35468 case 'B': 35469 this.style = AnnotationBorderStyleType.BEVELED; 35470 break; 35471 case 'I': 35472 this.style = AnnotationBorderStyleType.INSET; 35473 break; 35474 case 'U': 35475 this.style = AnnotationBorderStyleType.UNDERLINE; 35476 break; 35477 default: 35478 break; 35479 } 35480 }, 35481 setDashArray: function AnnotationBorderStyle_setDashArray(dashArray) { 35482 if (isArray(dashArray) && dashArray.length > 0) { 35483 var isValid = true; 35484 var allZeros = true; 35485 for (var i = 0, len = dashArray.length; i < len; i++) { 35486 var element = dashArray[i]; 35487 var validNumber = +element >= 0; 35488 if (!validNumber) { 35489 isValid = false; 35490 break; 35491 } else if (element > 0) { 35492 allZeros = false; 35493 } 35494 } 35495 if (isValid && !allZeros) { 35496 this.dashArray = dashArray; 35497 } else { 35498 this.width = 0; 35499 } 35500 } else if (dashArray) { 35501 this.width = 0; 35502 } 35503 }, 35504 setHorizontalCornerRadius: function AnnotationBorderStyle_setHorizontalCornerRadius(radius) { 35505 if (radius === (radius | 0)) { 35506 this.horizontalCornerRadius = radius; 35507 } 35508 }, 35509 setVerticalCornerRadius: function AnnotationBorderStyle_setVerticalCornerRadius(radius) { 35510 if (radius === (radius | 0)) { 35511 this.verticalCornerRadius = radius; 35512 } 35513 } 35514 }; 35515 return AnnotationBorderStyle; 35516}(); 35517var WidgetAnnotation = function WidgetAnnotationClosure() { 35518 function WidgetAnnotation(params) { 35519 Annotation.call(this, params); 35520 var dict = params.dict; 35521 var data = this.data; 35522 data.annotationType = AnnotationType.WIDGET; 35523 data.fieldName = this._constructFieldName(dict); 35524 data.fieldValue = Util.getInheritableProperty(dict, 'V', true); 35525 data.alternativeText = stringToPDFString(dict.get('TU') || ''); 35526 data.defaultAppearance = Util.getInheritableProperty(dict, 'DA') || ''; 35527 var fieldType = Util.getInheritableProperty(dict, 'FT'); 35528 data.fieldType = isName(fieldType) ? fieldType.name : null; 35529 this.fieldResources = Util.getInheritableProperty(dict, 'DR') || Dict.empty; 35530 data.fieldFlags = Util.getInheritableProperty(dict, 'Ff'); 35531 if (!isInt(data.fieldFlags) || data.fieldFlags < 0) { 35532 data.fieldFlags = 0; 35533 } 35534 data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); 35535 if (data.fieldType === 'Sig') { 35536 this.setFlags(AnnotationFlag.HIDDEN); 35537 } 35538 } 35539 Util.inherit(WidgetAnnotation, Annotation, { 35540 _constructFieldName: function WidgetAnnotation_constructFieldName(dict) { 35541 if (!dict.has('T') && !dict.has('Parent')) { 35542 warn('Unknown field name, falling back to empty field name.'); 35543 return ''; 35544 } 35545 if (!dict.has('Parent')) { 35546 return stringToPDFString(dict.get('T')); 35547 } 35548 var fieldName = []; 35549 if (dict.has('T')) { 35550 fieldName.unshift(stringToPDFString(dict.get('T'))); 35551 } 35552 var loopDict = dict; 35553 while (loopDict.has('Parent')) { 35554 loopDict = loopDict.get('Parent'); 35555 if (loopDict.has('T')) { 35556 fieldName.unshift(stringToPDFString(loopDict.get('T'))); 35557 } 35558 } 35559 return fieldName.join('.'); 35560 }, 35561 hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) { 35562 return !!(this.data.fieldFlags & flag); 35563 } 35564 }); 35565 return WidgetAnnotation; 35566}(); 35567var TextWidgetAnnotation = function TextWidgetAnnotationClosure() { 35568 function TextWidgetAnnotation(params) { 35569 WidgetAnnotation.call(this, params); 35570 this.data.fieldValue = stringToPDFString(this.data.fieldValue || ''); 35571 var alignment = Util.getInheritableProperty(params.dict, 'Q'); 35572 if (!isInt(alignment) || alignment < 0 || alignment > 2) { 35573 alignment = null; 35574 } 35575 this.data.textAlignment = alignment; 35576 var maximumLength = Util.getInheritableProperty(params.dict, 'MaxLen'); 35577 if (!isInt(maximumLength) || maximumLength < 0) { 35578 maximumLength = null; 35579 } 35580 this.data.maxLen = maximumLength; 35581 this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); 35582 this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== null; 35583 } 35584 Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { 35585 getOperatorList: function TextWidgetAnnotation_getOperatorList(evaluator, task, renderForms) { 35586 var operatorList = new OperatorList(); 35587 if (renderForms) { 35588 return Promise.resolve(operatorList); 35589 } 35590 if (this.appearance) { 35591 return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms); 35592 } 35593 if (!this.data.defaultAppearance) { 35594 return Promise.resolve(operatorList); 35595 } 35596 var stream = new Stream(stringToBytes(this.data.defaultAppearance)); 35597 return evaluator.getOperatorList(stream, task, this.fieldResources, operatorList).then(function () { 35598 return operatorList; 35599 }); 35600 } 35601 }); 35602 return TextWidgetAnnotation; 35603}(); 35604var ButtonWidgetAnnotation = function ButtonWidgetAnnotationClosure() { 35605 function ButtonWidgetAnnotation(params) { 35606 WidgetAnnotation.call(this, params); 35607 this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); 35608 if (this.data.checkBox) { 35609 if (!isName(this.data.fieldValue)) { 35610 return; 35611 } 35612 this.data.fieldValue = this.data.fieldValue.name; 35613 } 35614 this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); 35615 if (this.data.radioButton) { 35616 this.data.fieldValue = this.data.buttonValue = null; 35617 var fieldParent = params.dict.get('Parent'); 35618 if (isDict(fieldParent) && fieldParent.has('V')) { 35619 var fieldParentValue = fieldParent.get('V'); 35620 if (isName(fieldParentValue)) { 35621 this.data.fieldValue = fieldParentValue.name; 35622 } 35623 } 35624 var appearanceStates = params.dict.get('AP'); 35625 if (!isDict(appearanceStates)) { 35626 return; 35627 } 35628 var normalAppearanceState = appearanceStates.get('N'); 35629 if (!isDict(normalAppearanceState)) { 35630 return; 35631 } 35632 var keys = normalAppearanceState.getKeys(); 35633 for (var i = 0, ii = keys.length; i < ii; i++) { 35634 if (keys[i] !== 'Off') { 35635 this.data.buttonValue = keys[i]; 35636 break; 35637 } 35638 } 35639 } 35640 } 35641 Util.inherit(ButtonWidgetAnnotation, WidgetAnnotation, { 35642 getOperatorList: function ButtonWidgetAnnotation_getOperatorList(evaluator, task, renderForms) { 35643 var operatorList = new OperatorList(); 35644 if (renderForms) { 35645 return Promise.resolve(operatorList); 35646 } 35647 if (this.appearance) { 35648 return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms); 35649 } 35650 return Promise.resolve(operatorList); 35651 } 35652 }); 35653 return ButtonWidgetAnnotation; 35654}(); 35655var ChoiceWidgetAnnotation = function ChoiceWidgetAnnotationClosure() { 35656 function ChoiceWidgetAnnotation(params) { 35657 WidgetAnnotation.call(this, params); 35658 this.data.options = [];
35659 var options = Util.getInheritableProperty(params.dict, 'Opt'); 35660 if (isArray(options)) { 35661 var xref = params.xref; 35662 for (var i = 0, ii = options.length; i < ii; i++) { 35663 var option = xref.fetchIfRef(options[i]); 35664 var isOptionArray = isArray(option); 35665 this.data.options[i] = { 35666 exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option, 35667 displayValue: isOptionArray ? xref.fetchIfRef(option[1]) : option 35668 }; 35669 } 35670 } 35671 if (!isArray(this.data.fieldValue)) { 35672 this.data.fieldValue = [this.data.fieldValue]; 35673 } 35674 this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO); 35675 this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT); 35676 } 35677 Util.inherit(ChoiceWidgetAnnotation, WidgetAnnotation, { 35678 getOperatorList: function ChoiceWidgetAnnotation_getOperatorList(evaluator, task, renderForms) { 35679 var operatorList = new OperatorList(); 35680 if (renderForms) { 35681 return Promise.resolve(operatorList); 35682 } 35683 return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms); 35684 } 35685 }); 35686 return ChoiceWidgetAnnotation; 35687}(); 35688var TextAnnotation = function TextAnnotationClosure() { 35689 var DEFAULT_ICON_SIZE = 22; 35690 function TextAnnotation(parameters) { 35691 Annotation.call(this, parameters); 35692 this.data.annotationType = AnnotationType.TEXT; 35693 if (this.data.hasAppearance) { 35694 this.data.name = 'NoIcon'; 35695 } else { 35696 this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; 35697 this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; 35698 this.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note'; 35699 } 35700 this._preparePopup(parameters.dict); 35701 } 35702 Util.inherit(TextAnnotation, Annotation, {}); 35703 return TextAnnotation; 35704}(); 35705var LinkAnnotation = function LinkAnnotationClosure() { 35706 function LinkAnnotation(params) { 35707 Annotation.call(this, params); 35708 var data = this.data; 35709 data.annotationType = AnnotationType.LINK; 35710 Catalog.parseDestDictionary({ 35711 destDict: params.dict, 35712 resultObj: data, 35713 docBaseUrl: params.pdfManager.docBaseUrl 35714 }); 35715 } 35716 Util.inherit(LinkAnnotation, Annotation, {}); 35717 return LinkAnnotation; 35718}(); 35719var PopupAnnotation = function PopupAnnotationClosure() { 35720 function PopupAnnotation(parameters) { 35721 Annotation.call(this, parameters); 35722 this.data.annotationType = AnnotationType.POPUP; 35723 var dict = parameters.dict; 35724 var parentItem = dict.get('Parent'); 35725 if (!parentItem) { 35726 warn('Popup annotation has a missing or invalid parent annotation.'); 35727 return; 35728 } 35729 this.data.parentId = dict.getRaw('Parent').toString(); 35730 this.data.title = stringToPDFString(parentItem.get('T') || ''); 35731 this.data.contents = stringToPDFString(parentItem.get('Contents') || ''); 35732 if (!parentItem.has('C')) { 35733 this.data.color = null; 35734 } else { 35735 this.setColor(parentItem.getArray('C')); 35736 this.data.color = this.color; 35737 } 35738 if (!this.viewable) { 35739 var parentFlags = parentItem.get('F'); 35740 if (this._isViewable(parentFlags)) { 35741 this.setFlags(parentFlags); 35742 } 35743 } 35744 } 35745 Util.inherit(PopupAnnotation, Annotation, {}); 35746 return PopupAnnotation; 35747}(); 35748var HighlightAnnotation = function HighlightAnnotationClosure() { 35749 function HighlightAnnotation(parameters) { 35750 Annotation.call(this, parameters); 35751 this.data.annotationType = AnnotationType.HIGHLIGHT; 35752 this._preparePopup(parameters.dict); 35753 this.data.borderStyle.setWidth(0); 35754 } 35755 Util.inherit(HighlightAnnotation, Annotation, {}); 35756 return HighlightAnnotation; 35757}(); 35758var UnderlineAnnotation = function UnderlineAnnotationClosure() { 35759 function UnderlineAnnotation(parameters) { 35760 Annotation.call(this, parameters); 35761 this.data.annotationType = AnnotationType.UNDERLINE; 35762 this._preparePopup(parameters.dict); 35763 this.data.borderStyle.setWidth(0); 35764 } 35765 Util.inherit(UnderlineAnnotation, Annotation, {}); 35766 return UnderlineAnnotation; 35767}(); 35768var SquigglyAnnotation = function SquigglyAnnotationClosure() { 35769 function SquigglyAnnotation(parameters) { 35770 Annotation.call(this, parameters); 35771 this.data.annotationType = AnnotationType.SQUIGGLY; 35772 this._preparePopup(parameters.dict); 35773 this.data.borderStyle.setWidth(0); 35774 } 35775 Util.inherit(SquigglyAnnotation, Annotation, {}); 35776 return SquigglyAnnotation; 35777}(); 35778var StrikeOutAnnotation = function StrikeOutAnnotationClosure() { 35779 function StrikeOutAnnotation(parameters) { 35780 Annotation.call(this, parameters); 35781 this.data.annotationType = AnnotationType.STRIKEOUT; 35782 this._preparePopup(parameters.dict); 35783 this.data.borderStyle.setWidth(0); 35784 } 35785 Util.inherit(StrikeOutAnnotation, Annotation, {}); 35786 return StrikeOutAnnotation; 35787}(); 35788var FileAttachmentAnnotation = function FileAttachmentAnnotationClosure() { 35789 function FileAttachmentAnnotation(parameters) { 35790 Annotation.call(this, parameters); 35791 var file = new FileSpec(parameters.dict.get('FS'), parameters.xref); 35792 this.data.annotationType = AnnotationType.FILEATTACHMENT; 35793 this.data.file = file.serializable; 35794 this._preparePopup(parameters.dict); 35795 } 35796 Util.inherit(FileAttachmentAnnotation, Annotation, {}); 35797 return FileAttachmentAnnotation; 35798}(); 35799exports.Annotation = Annotation; 35800exports.AnnotationBorderStyle = AnnotationBorderStyle; 35801exports.AnnotationFactory = AnnotationFactory; 35802 35803/***/ }), 35804/* 21 */ 35805/***/ (function(module, exports, __w_pdfjs_require__) { 35806 35807"use strict"; 35808 35809var sharedUtil = __w_pdfjs_require__(0); 35810var warn = sharedUtil.warn; 35811var baseTypes = [ 35812 'BN', 35813 'BN', 35814 'BN', 35815 'BN', 35816 'BN', 35817 'BN', 35818 'BN', 35819 'BN', 35820 'BN', 35821 'S', 35822 'B', 35823 'S', 35824 'WS', 35825 'B', 35826 'BN', 35827 'BN', 35828 'BN', 35829 'BN', 35830 'BN', 35831 'BN', 35832 'BN', 35833 'BN', 35834 'BN', 35835 'BN', 35836 'BN', 35837 'BN', 35838 'BN', 35839 'BN', 35840 'B', 35841 'B', 35842 'B', 35843 'S', 35844 'WS', 35845 'ON', 35846 'ON', 35847 'ET', 35848 'ET', 35849 'ET', 35850 'ON', 35851 'ON', 35852 'ON', 35853 'ON', 35854 'ON', 35855 'ES', 35856 'CS', 35857 'ES', 35858 'CS', 35859 'CS', 35860 'EN', 35861 'EN', 35862 'EN', 35863 'EN', 35864 'EN', 35865 'EN', 35866 'EN', 35867 'EN', 35868 'EN', 35869 'EN', 35870 'CS', 35871 'ON', 35872 'ON', 35873 'ON', 35874 'ON', 35875 'ON', 35876 'ON', 35877 'L', 35878 'L', 35879 'L', 35880 'L', 35881 'L', 35882 'L', 35883 'L', 35884 'L', 35885 'L', 35886 'L', 35887 'L', 35888 'L', 35889 'L', 35890 'L', 35891 'L', 35892 'L', 35893 'L', 35894 'L', 35895 'L', 35896 'L', 35897 'L', 35898 'L', 35899 'L', 35900 'L', 35901 'L', 35902 'L', 35903 'ON', 35904 'ON', 35905 'ON', 35906 'ON', 35907 'ON', 35908 'ON', 35909 'L', 35910 'L', 35911 'L', 35912 'L', 35913 'L', 35914 'L', 35915 'L', 35916 'L', 35917 'L', 35918 'L', 35919 'L', 35920 'L', 35921 'L', 35922 'L', 35923 'L', 35924 'L', 35925 'L', 35926 'L', 35927 'L', 35928 'L', 35929 'L', 35930 'L', 35931 'L', 35932 'L', 35933 'L', 35934 'L', 35935 'ON', 35936 'ON', 35937 'ON', 35938 'ON', 35939 'BN', 35940 'BN', 35941 'BN', 35942 'BN', 35943 'BN', 35944 'BN', 35945 'B', 35946 'BN', 35947 'BN', 35948 'BN', 35949 'BN', 35950 'BN', 35951 'BN', 35952 'BN', 35953 'BN', 35954 'BN', 35955 'BN', 35956 'BN', 35957 'BN', 35958 'BN', 35959 'BN', 35960 'BN', 35961 'BN', 35962 'BN', 35963 'BN', 35964 'BN', 35965 'BN', 35966 'BN', 35967 'BN', 35968 'BN', 35969 'BN', 35970 'BN', 35971 'BN', 35972 'CS', 35973 'ON', 35974 'ET', 35975 'ET', 35976 'ET', 35977 'ET', 35978 'ON', 35979 'ON', 35980 'ON', 35981 'ON', 35982 'L', 35983 'ON', 35984 'ON', 35985 'BN', 35986 'ON', 35987 'ON', 35988 'ET', 35989 'ET', 35990 'EN', 35991 'EN', 35992 'ON', 35993 'L', 35994 'ON', 35995 'ON', 35996 'ON', 35997 'EN', 35998 'L', 35999 'ON', 36000 'ON', 36001 'ON', 36002 'ON', 36003 'ON', 36004 'L', 36005 'L', 36006 'L', 36007 'L', 36008 'L', 36009 'L', 36010 'L', 36011 'L', 36012 'L', 36013 'L', 36014 'L', 36015 'L', 36016 'L', 36017 'L', 36018 'L', 36019 'L', 36020 'L', 36021 'L', 36022 'L', 36023 'L', 36024 'L', 36025 'L', 36026 'L', 36027 'ON', 36028 'L', 36029 'L', 36030 'L', 36031 'L', 36032 'L', 36033 'L', 36034 'L', 36035 'L', 36036 'L', 36037 'L', 36038 'L', 36039 'L', 36040 'L', 36041 'L', 36042 'L', 36043 'L', 36044 'L', 36045 'L', 36046 'L', 36047 'L', 36048 'L', 36049 'L', 36050 'L', 36051 'L', 36052 'L', 36053 'L', 36054 'L', 36055 'L', 36056 'L', 36057 'L', 36058 'L', 36059 'ON', 36060 'L', 36061 'L', 36062 'L', 36063 'L', 36064 'L', 36065 'L', 36066 'L', 36067 'L' 36068]; 36069var arabicTypes = [ 36070 'AN', 36071 'AN', 36072 'AN', 36073 'AN', 36074 'AN', 36075 'AN', 36076 'ON', 36077 'ON', 36078 'AL', 36079 'ET', 36080 'ET', 36081 'AL', 36082 'CS', 36083 'AL', 36084 'ON', 36085 'ON', 36086 'NSM', 36087 'NSM', 36088 'NSM', 36089 'NSM', 36090 'NSM', 36091 'NSM', 36092 'NSM', 36093 'NSM', 36094 'NSM', 36095 'NSM', 36096 'NSM', 36097 'AL', 36098 'AL', 36099 '', 36100 'AL', 36101 'AL', 36102 'AL', 36103 'AL', 36104 'AL', 36105 'AL', 36106 'AL', 36107 'AL', 36108 'AL', 36109 'AL', 36110 'AL', 36111 'AL', 36112 'AL', 36113 'AL', 36114 'AL', 36115 'AL', 36116 'AL', 36117 'AL', 36118 'AL', 36119 'AL', 36120 'AL', 36121 'AL', 36122 'AL', 36123 'AL', 36124 'AL', 36125 'AL', 36126 'AL', 36127 'AL', 36128 'AL', 36129 'AL', 36130 'AL', 36131 'AL', 36132 'AL', 36133 'AL', 36134 'AL', 36135 'AL', 36136 'AL', 36137 'AL', 36138 'AL', 36139 'AL', 36140 'AL', 36141 'AL', 36142 'AL', 36143 'AL', 36144 'AL', 36145 'NSM', 36146 'NSM', 36147 'NSM', 36148 'NSM', 36149 'NSM', 36150 'NSM', 36151 'NSM', 36152 'NSM', 36153 'NSM', 36154 'NSM', 36155 'NSM', 36156 'NSM', 36157 'NSM', 36158 'NSM', 36159 'NSM', 36160 'NSM', 36161 'NSM', 36162 'NSM', 36163 'NSM', 36164 'NSM', 36165 'NSM', 36166 'AN', 36167 'AN', 36168 'AN', 36169 'AN', 36170 'AN', 36171 'AN', 36172 'AN', 36173 'AN', 36174 'AN', 36175 'AN', 36176 'ET', 36177 'AN', 36178 'AN', 36179 'AL', 36180 'AL', 36181 'AL', 36182 'NSM', 36183 'AL', 36184 'AL', 36185 'AL', 36186 'AL', 36187 'AL', 36188 'AL', 36189 'AL', 36190 'AL', 36191 'AL', 36192 'AL', 36193 'AL', 36194 'AL', 36195 'AL', 36196 'AL', 36197 'AL', 36198 'AL', 36199 'AL', 36200 'AL', 36201 'AL', 36202 'AL', 36203 'AL', 36204 'AL', 36205 'AL', 36206 'AL', 36207 'AL', 36208 'AL', 36209 'AL', 36210 'AL', 36211 'AL', 36212 'AL', 36213 'AL', 36214 'AL', 36215 'AL', 36216 'AL', 36217 'AL', 36218 'AL', 36219 'AL', 36220 'AL', 36221 'AL', 36222 'AL', 36223 'AL', 36224 'AL', 36225 'AL', 36226 'AL', 36227 'AL', 36228 'AL', 36229 'AL', 36230 'AL', 36231 'AL', 36232 'AL', 36233 'AL', 36234 'AL', 36235 'AL', 36236 'AL', 36237 'AL', 36238 'AL', 36239 'AL', 36240 'AL', 36241 'AL', 36242 'AL', 36243 'AL', 36244 'AL', 36245 'AL', 36246 'AL', 36247 'AL', 36248 'AL', 36249 'AL', 36250 'AL', 36251 'AL', 36252 'AL', 36253 'AL', 36254 'AL', 36255 'AL', 36256 'AL', 36257 'AL', 36258 'AL', 36259 'AL', 36260 'AL', 36261 'AL', 36262 'AL', 36263 'AL', 36264 'AL', 36265 'AL', 36266 'AL', 36267 'AL', 36268 'AL', 36269 'AL', 36270 'AL', 36271 'AL', 36272 'AL', 36273 'AL', 36274 'AL', 36275 'AL', 36276 'AL', 36277 'AL', 36278 'AL', 36279 'AL', 36280 'AL', 36281 'AL', 36282 'AL', 36283 'AL', 36284 'NSM', 36285 'NSM', 36286 'NSM', 36287 'NSM', 36288 'NSM', 36289 'NSM', 36290 'NSM', 36291 'AN', 36292 'ON', 36293 'NSM', 36294 'NSM', 36295 'NSM', 36296 'NSM', 36297 'NSM', 36298 'NSM', 36299 'AL', 36300 'AL', 36301 'NSM', 36302 'NSM', 36303 'ON', 36304 'NSM', 36305 'NSM', 36306 'NSM', 36307 'NSM', 36308 'AL', 36309 'AL', 36310 'EN', 36311 'EN', 36312 'EN', 36313 'EN', 36314 'EN', 36315 'EN', 36316 'EN', 36317 'EN', 36318 'EN', 36319 'EN', 36320 'AL', 36321 'AL', 36322 'AL', 36323 'AL', 36324 'AL', 36325 'AL' 36326]; 36327function isOdd(i) { 36328 return (i & 1) !== 0; 36329} 36330function isEven(i) { 36331 return (i & 1) === 0; 36332} 36333function findUnequal(arr, start, value) { 36334 for (var j = start, jj = arr.length; j < jj; ++j) { 36335 if (arr[j] !== value) { 36336 return j; 36337 } 36338 } 36339 return j; 36340} 36341function setValues(arr, start, end, value) { 36342 for (var j = start; j < end; ++j) { 36343 arr[j] = value; 36344 } 36345} 36346function reverseValues(arr, start, end) { 36347 for (var i = start, j = end - 1; i < j; ++i, --j) { 36348 var temp = arr[i]; 36349 arr[i] = arr[j]; 36350 arr[j] = temp; 36351 } 36352} 36353function createBidiText(str, isLTR, vertical) { 36354 return { 36355 str: str, 36356 dir: vertical ? 'ttb' : isLTR ? 'ltr' : 'rtl' 36357 }; 36358} 36359var chars = []; 36360var types = []; 36361function bidi(str, startLevel, vertical) { 36362 var isLTR = true; 36363 var strLength = str.length; 36364 if (strLength === 0 || vertical) { 36365 return createBidiText(str, isLTR, vertical); 36366 } 36367 chars.length = strLength; 36368 types.length = strLength; 36369 var numBidi = 0; 36370 var i, ii; 36371 for (i = 0; i < strLength; ++i) { 36372 chars[i] = str.charAt(i);
vendor: 5,177 bytes, lines 36373-36676
36373 var charCode = str.charCodeAt(i); 36374 var charType = 'L'; 36375 if (charCode <= 0x00ff) { 36376 charType = baseTypes[charCode]; 36377 } else if (0x0590 <= charCode && charCode <= 0x05f4) { 36378 charType = 'R'; 36379 } else if (0x0600 <= charCode && charCode <= 0x06ff) { 36380 charType = arabicTypes[charCode & 0xff]; 36381 if (!charType) { 36382 warn('Bidi: invalid Unicode character ' + charCode.toString(16)); 36383 } 36384 } else if (0x0700 <= charCode && charCode <= 0x08AC) { 36385 charType = 'AL'; 36386 } 36387 if (charType === 'R' || charType === 'AL' || charType === 'AN') { 36388 numBidi++; 36389 } 36390 types[i] = charType; 36391 } 36392 if (numBidi === 0) { 36393 isLTR = true; 36394 return createBidiText(str, isLTR); 36395 } 36396 if (startLevel === -1) { 36397 if (numBidi / strLength < 0.3) { 36398 isLTR = true; 36399 startLevel = 0; 36400 } else { 36401 isLTR = false; 36402 startLevel = 1; 36403 } 36404 } 36405 var levels = []; 36406 for (i = 0; i < strLength; ++i) { 36407 levels[i] = startLevel; 36408 } 36409 var e = isOdd(startLevel) ? 'R' : 'L'; 36410 var sor = e; 36411 var eor = sor; 36412 var lastType = sor; 36413 for (i = 0; i < strLength; ++i) { 36414 if (types[i] === 'NSM') { 36415 types[i] = lastType; 36416 } else { 36417 lastType = types[i]; 36418 } 36419 } 36420 lastType = sor; 36421 var t; 36422 for (i = 0; i < strLength; ++i) { 36423 t = types[i]; 36424 if (t === 'EN') { 36425 types[i] = lastType === 'AL' ? 'AN' : 'EN'; 36426 } else if (t === 'R' || t === 'L' || t === 'AL') { 36427 lastType = t; 36428 } 36429 } 36430 for (i = 0; i < strLength; ++i) { 36431 t = types[i]; 36432 if (t === 'AL') { 36433 types[i] = 'R'; 36434 } 36435 } 36436 for (i = 1; i < strLength - 1; ++i) { 36437 if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { 36438 types[i] = 'EN'; 36439 } 36440 if (types[i] === 'CS' && (types[i - 1] === 'EN' || types[i - 1] === 'AN') && types[i + 1] === types[i - 1]) { 36441 types[i] = types[i - 1]; 36442 } 36443 } 36444 for (i = 0; i < strLength; ++i) { 36445 if (types[i] === 'EN') { 36446 var j; 36447 for (j = i - 1; j >= 0; --j) { 36448 if (types[j] !== 'ET') { 36449 break; 36450 } 36451 types[j] = 'EN'; 36452 } 36453 for (j = i + 1; j < strLength; ++j) { 36454 if (types[j] !== 'ET') { 36455 break; 36456 } 36457 types[j] = 'EN'; 36458 } 36459 } 36460 } 36461 for (i = 0; i < strLength; ++i) { 36462 t = types[i]; 36463 if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { 36464 types[i] = 'ON'; 36465 } 36466 } 36467 lastType = sor; 36468 for (i = 0; i < strLength; ++i) { 36469 t = types[i]; 36470 if (t === 'EN') { 36471 types[i] = lastType === 'L' ? 'L' : 'EN'; 36472 } else if (t === 'R' || t === 'L') { 36473 lastType = t; 36474 } 36475 } 36476 for (i = 0; i < strLength; ++i) { 36477 if (types[i] === 'ON') { 36478 var end = findUnequal(types, i + 1, 'ON'); 36479 var before = sor; 36480 if (i > 0) { 36481 before = types[i - 1]; 36482 } 36483 var after = eor; 36484 if (end + 1 < strLength) { 36485 after = types[end + 1]; 36486 } 36487 if (before !== 'L') { 36488 before = 'R'; 36489 } 36490 if (after !== 'L') { 36491 after = 'R'; 36492 } 36493 if (before === after) { 36494 setValues(types, i, end, before); 36495 } 36496 i = end - 1; 36497 } 36498 } 36499 for (i = 0; i < strLength; ++i) { 36500 if (types[i] === 'ON') { 36501 types[i] = e; 36502 } 36503 } 36504 for (i = 0; i < strLength; ++i) { 36505 t = types[i]; 36506 if (isEven(levels[i])) { 36507 if (t === 'R') { 36508 levels[i] += 1; 36509 } else if (t === 'AN' || t === 'EN') { 36510 levels[i] += 2; 36511 } 36512 } else { 36513 if (t === 'L' || t === 'AN' || t === 'EN') { 36514 levels[i] += 1; 36515 } 36516 } 36517 } 36518 var highestLevel = -1; 36519 var lowestOddLevel = 99; 36520 var level; 36521 for (i = 0, ii = levels.length; i < ii; ++i) { 36522 level = levels[i]; 36523 if (highestLevel < level) { 36524 highestLevel = level; 36525 } 36526 if (lowestOddLevel > level && isOdd(level)) { 36527 lowestOddLevel = level; 36528 } 36529 } 36530 for (level = highestLevel; level >= lowestOddLevel; --level) { 36531 var start = -1; 36532 for (i = 0, ii = levels.length; i < ii; ++i) { 36533 if (levels[i] < level) { 36534 if (start >= 0) { 36535 reverseValues(chars, start, i); 36536 start = -1; 36537 } 36538 } else if (start < 0) { 36539 start = i; 36540 } 36541 } 36542 if (start >= 0) { 36543 reverseValues(chars, start, levels.length); 36544 } 36545 } 36546 for (i = 0, ii = chars.length; i < ii; ++i) { 36547 var ch = chars[i]; 36548 if (ch === '<' || ch === '>') { 36549 chars[i] = ''; 36550 } 36551 } 36552 return createBidiText(chars.join(''), isLTR); 36553} 36554exports.bidi = bidi; 36555 36556/***/ }), 36557/* 22 */ 36558/***/ (function(module, exports, __w_pdfjs_require__) { 36559 36560"use strict"; 36561 36562var ISOAdobeCharset = [ 36563 '.notdef', 36564 'space', 36565 'exclam', 36566 'quotedbl', 36567 'numbersign', 36568 'dollar', 36569 'percent', 36570 'ampersand', 36571 'quoteright', 36572 'parenleft', 36573 'parenright', 36574 'asterisk', 36575 'plus', 36576 'comma', 36577 'hyphen', 36578 'period', 36579 'slash', 36580 'zero', 36581 'one', 36582 'two', 36583 'three', 36584 'four', 36585 'five', 36586 'six', 36587 'seven', 36588 'eight', 36589 'nine', 36590 'colon', 36591 'semicolon', 36592 'less', 36593 'equal', 36594 'greater', 36595 'question', 36596 'at', 36597 'A', 36598 'B', 36599 'C', 36600 'D', 36601 'E', 36602 'F', 36603 'G', 36604 'H', 36605 'I', 36606 'J', 36607 'K', 36608 'L', 36609 'M', 36610 'N', 36611 'O', 36612 'P', 36613 'Q', 36614 'R', 36615 'S', 36616 'T', 36617 'U', 36618 'V', 36619 'W', 36620 'X', 36621 'Y', 36622 'Z', 36623 'bracketleft', 36624 'backslash', 36625 'bracketright', 36626 'asciicircum', 36627 'underscore', 36628 'quoteleft', 36629 'a', 36630 'b', 36631 'c', 36632 'd', 36633 'e', 36634 'f', 36635 'g', 36636 'h', 36637 'i', 36638 'j', 36639 'k', 36640 'l', 36641 'm', 36642 'n', 36643 'o', 36644 'p', 36645 'q', 36646 'r', 36647 's', 36648 't', 36649 'u', 36650 'v', 36651 'w', 36652 'x', 36653 'y', 36654 'z', 36655 'braceleft', 36656 'bar', 36657 'braceright', 36658 'asciitilde', 36659 'exclamdown', 36660 'cent', 36661 'sterling', 36662 'fraction', 36663 'yen', 36664 'florin', 36665 'section', 36666 'currency', 36667 'quotesingle', 36668 'quotedblleft', 36669 'guillemotleft', 36670 'guilsinglleft', 36671 'guilsinglright', 36672 'fi', 36673 'fl', 36674 'endash', 36675 'dagger', 36676 'daggerdbl',
36677 'periodcentered', 36678 'paragraph', 36679 'bullet', 36680 'quotesinglbase', 36681 'quotedblbase', 36682 'quotedblright', 36683 'guillemotright', 36684 'ellipsis', 36685 'perthousand', 36686 'questiondown', 36687 'grave', 36688 'acute', 36689 'circumflex', 36690 'tilde', 36691 'macron', 36692 'breve', 36693 'dotaccent', 36694 'dieresis', 36695 'ring', 36696 'cedilla', 36697 'hungarumlaut', 36698 'ogonek', 36699 'caron', 36700 'emdash', 36701 'AE', 36702 'ordfeminine', 36703 'Lslash', 36704 'Oslash', 36705 'OE', 36706 'ordmasculine', 36707 'ae', 36708 'dotlessi', 36709 'lslash', 36710 'oslash', 36711 'oe', 36712 'germandbls', 36713 'onesuperior', 36714 'logicalnot', 36715 'mu', 36716 'trademark', 36717 'Eth', 36718 'onehalf', 36719 'plusminus', 36720 'Thorn', 36721 'onequarter', 36722 'divide', 36723 'brokenbar', 36724 'degree', 36725 'thorn', 36726 'threequarters', 36727 'twosuperior', 36728 'registered', 36729 'minus', 36730 'eth', 36731 'multiply', 36732 'threesuperior', 36733 'copyright', 36734 'Aacute', 36735 'Acircumflex', 36736 'Adieresis', 36737 'Agrave', 36738 'Aring', 36739 'Atilde', 36740 'Ccedilla', 36741 'Eacute', 36742 'Ecircumflex', 36743 'Edieresis', 36744 'Egrave', 36745 'Iacute', 36746 'Icircumflex', 36747 'Idieresis', 36748 'Igrave', 36749 'Ntilde', 36750 'Oacute', 36751 'Ocircumflex', 36752 'Odieresis', 36753 'Ograve', 36754 'Otilde', 36755 'Scaron', 36756 'Uacute', 36757 'Ucircumflex', 36758 'Udieresis', 36759 'Ugrave', 36760 'Yacute', 36761 'Ydieresis', 36762 'Zcaron', 36763 'aacute', 36764 'acircumflex', 36765 'adieresis', 36766 'agrave', 36767 'aring', 36768 'atilde', 36769 'ccedilla', 36770 'eacute', 36771 'ecircumflex', 36772 'edieresis', 36773 'egrave', 36774 'iacute', 36775 'icircumflex', 36776 'idieresis', 36777 'igrave', 36778 'ntilde', 36779 'oacute', 36780 'ocircumflex', 36781 'odieresis', 36782 'ograve', 36783 'otilde', 36784 'scaron', 36785 'uacute', 36786 'ucircumflex', 36787 'udieresis', 36788 'ugrave', 36789 'yacute', 36790 'ydieresis', 36791 'zcaron' 36792]; 36793var ExpertCharset = [ 36794 '.notdef', 36795 'space', 36796 'exclamsmall', 36797 'Hungarumlautsmall', 36798 'dollaroldstyle', 36799 'dollarsuperior', 36800 'ampersandsmall', 36801 'Acutesmall', 36802 'parenleftsuperior', 36803 'parenrightsuperior', 36804 'twodotenleader', 36805 'onedotenleader', 36806 'comma', 36807 'hyphen', 36808 'period', 36809 'fraction', 36810 'zerooldstyle', 36811 'oneoldstyle', 36812 'twooldstyle', 36813 'threeoldstyle', 36814 'fouroldstyle', 36815 'fiveoldstyle', 36816 'sixoldstyle', 36817 'sevenoldstyle', 36818 'eightoldstyle', 36819 'nineoldstyle', 36820 'colon', 36821 'semicolon', 36822 'commasuperior', 36823 'threequartersemdash', 36824 'periodsuperior', 36825 'questionsmall', 36826 'asuperior', 36827 'bsuperior', 36828 'centsuperior', 36829 'dsuperior', 36830 'esuperior', 36831 'isuperior', 36832 'lsuperior', 36833 'msuperior', 36834 'nsuperior', 36835 'osuperior', 36836 'rsuperior', 36837 'ssuperior', 36838 'tsuperior', 36839 'ff', 36840 'fi', 36841 'fl', 36842 'ffi', 36843 'ffl', 36844 'parenleftinferior', 36845 'parenrightinferior', 36846 'Circumflexsmall', 36847 'hyphensuperior', 36848 'Gravesmall', 36849 'Asmall', 36850 'Bsmall', 36851 'Csmall', 36852 'Dsmall', 36853 'Esmall', 36854 'Fsmall', 36855 'Gsmall', 36856 'Hsmall', 36857 'Ismall', 36858 'Jsmall', 36859 'Ksmall', 36860 'Lsmall', 36861 'Msmall', 36862 'Nsmall', 36863 'Osmall', 36864 'Psmall', 36865 'Qsmall', 36866 'Rsmall', 36867 'Ssmall', 36868 'Tsmall', 36869 'Usmall', 36870 'Vsmall', 36871 'Wsmall', 36872 'Xsmall', 36873 'Ysmall', 36874 'Zsmall', 36875 'colonmonetary', 36876 'onefitted', 36877 'rupiah', 36878 'Tildesmall', 36879 'exclamdownsmall', 36880 'centoldstyle', 36881 'Lslashsmall', 36882 'Scaronsmall', 36883 'Zcaronsmall', 36884 'Dieresissmall', 36885 'Brevesmall', 36886 'Caronsmall', 36887 'Dotaccentsmall', 36888 'Macronsmall', 36889 'figuredash', 36890 'hypheninferior', 36891 'Ogoneksmall', 36892 'Ringsmall', 36893 'Cedillasmall', 36894 'onequarter', 36895 'onehalf', 36896 'threequarters', 36897 'questiondownsmall', 36898 'oneeighth', 36899 'threeeighths', 36900 'fiveeighths', 36901 'seveneighths', 36902 'onethird', 36903 'twothirds', 36904 'zerosuperior', 36905 'onesuperior', 36906 'twosuperior', 36907 'threesuperior', 36908 'foursuperior', 36909 'fivesuperior', 36910 'sixsuperior', 36911 'sevensuperior', 36912 'eightsuperior', 36913 'ninesuperior', 36914 'zeroinferior', 36915 'oneinferior', 36916 'twoinferior', 36917 'threeinferior', 36918 'fourinferior', 36919 'fiveinferior', 36920 'sixinferior', 36921 'seveninferior', 36922 'eightinferior', 36923 'nineinferior', 36924 'centinferior', 36925 'dollarinferior', 36926 'periodinferior', 36927 'commainferior', 36928 'Agravesmall', 36929 'Aacutesmall', 36930 'Acircumflexsmall', 36931 'Atildesmall', 36932 'Adieresissmall', 36933 'Aringsmall', 36934 'AEsmall', 36935 'Ccedillasmall', 36936 'Egravesmall', 36937 'Eacutesmall', 36938 'Ecircumflexsmall', 36939 'Edieresissmall', 36940 'Igravesmall', 36941 'Iacutesmall', 36942 'Icircumflexsmall', 36943 'Idieresissmall', 36944 'Ethsmall', 36945 'Ntildesmall', 36946 'Ogravesmall', 36947 'Oacutesmall', 36948 'Ocircumflexsmall', 36949 'Otildesmall', 36950 'Odieresissmall', 36951 'OEsmall', 36952 'Oslashsmall', 36953 'Ugravesmall', 36954 'Uacutesmall', 36955 'Ucircumflexsmall', 36956 'Udieresissmall', 36957 'Yacutesmall', 36958 'Thornsmall', 36959 'Ydieresissmall' 36960]; 36961var ExpertSubsetCharset = [ 36962 '.notdef', 36963 'space', 36964 'dollaroldstyle', 36965 'dollarsuperior', 36966 'parenleftsuperior', 36967 'parenrightsuperior',
36968 'twodotenleader', 36969 'onedotenleader', 36970 'comma', 36971 'hyphen', 36972 'period', 36973 'fraction', 36974 'zerooldstyle', 36975 'oneoldstyle', 36976 'twooldstyle', 36977 'threeoldstyle', 36978 'fouroldstyle', 36979 'fiveoldstyle', 36980 'sixoldstyle', 36981 'sevenoldstyle', 36982 'eightoldstyle', 36983 'nineoldstyle', 36984 'colon', 36985 'semicolon', 36986 'commasuperior', 36987 'threequartersemdash', 36988 'periodsuperior', 36989 'asuperior', 36990 'bsuperior', 36991 'centsuperior', 36992 'dsuperior', 36993 'esuperior', 36994 'isuperior', 36995 'lsuperior', 36996 'msuperior', 36997 'nsuperior', 36998 'osuperior', 36999 'rsuperior', 37000 'ssuperior', 37001 'tsuperior', 37002 'ff', 37003 'fi', 37004 'fl', 37005 'ffi', 37006 'ffl', 37007 'parenleftinferior', 37008 'parenrightinferior', 37009 'hyphensuperior', 37010 'colonmonetary', 37011 'onefitted', 37012 'rupiah', 37013 'centoldstyle', 37014 'figuredash', 37015 'hypheninferior', 37016 'onequarter', 37017 'onehalf', 37018 'threequarters', 37019 'oneeighth', 37020 'threeeighths', 37021 'fiveeighths', 37022 'seveneighths', 37023 'onethird', 37024 'twothirds', 37025 'zerosuperior', 37026 'onesuperior', 37027 'twosuperior', 37028 'threesuperior', 37029 'foursuperior', 37030 'fivesuperior', 37031 'sixsuperior', 37032 'sevensuperior', 37033 'eightsuperior', 37034 'ninesuperior', 37035 'zeroinferior', 37036 'oneinferior', 37037 'twoinferior', 37038 'threeinferior', 37039 'fourinferior', 37040 'fiveinferior', 37041 'sixinferior', 37042 'seveninferior', 37043 'eightinferior', 37044 'nineinferior', 37045 'centinferior', 37046 'dollarinferior', 37047 'periodinferior', 37048 'commainferior' 37049]; 37050exports.ISOAdobeCharset = ISOAdobeCharset; 37051exports.ExpertCharset = ExpertCharset; 37052exports.ExpertSubsetCharset = ExpertSubsetCharset; 37053 37054/***/ }), 37055/* 23 */ 37056/***/ (function(module, exports, __w_pdfjs_require__) { 37057 37058"use strict"; 37059 37060var sharedUtil = __w_pdfjs_require__(0); 37061var corePrimitives = __w_pdfjs_require__(1); 37062var coreStream = __w_pdfjs_require__(2); 37063var coreParser = __w_pdfjs_require__(5); 37064var Util = sharedUtil.Util; 37065var assert = sharedUtil.assert; 37066var warn = sharedUtil.warn; 37067var error = sharedUtil.error; 37068var isInt = sharedUtil.isInt; 37069var isString = sharedUtil.isString; 37070var MissingDataException = sharedUtil.MissingDataException; 37071var CMapCompressionType = sharedUtil.CMapCompressionType; 37072var isEOF = corePrimitives.isEOF; 37073var isName = corePrimitives.isName; 37074var isCmd = corePrimitives.isCmd; 37075var isStream = corePrimitives.isStream; 37076var Stream = coreStream.Stream; 37077var Lexer = coreParser.Lexer; 37078var BUILT_IN_CMAPS = [ 37079 'Adobe-GB1-UCS2', 37080 'Adobe-CNS1-UCS2', 37081 'Adobe-Japan1-UCS2', 37082 'Adobe-Korea1-UCS2', 37083 '78-EUC-H', 37084 '78-EUC-V', 37085 '78-H', 37086 '78-RKSJ-H', 37087 '78-RKSJ-V', 37088 '78-V', 37089 '78ms-RKSJ-H', 37090 '78ms-RKSJ-V', 37091 '83pv-RKSJ-H', 37092 '90ms-RKSJ-H', 37093 '90ms-RKSJ-V', 37094 '90msp-RKSJ-H', 37095 '90msp-RKSJ-V', 37096 '90pv-RKSJ-H', 37097 '90pv-RKSJ-V', 37098 'Add-H', 37099 'Add-RKSJ-H', 37100 'Add-RKSJ-V', 37101 'Add-V', 37102 'Adobe-CNS1-0', 37103 'Adobe-CNS1-1', 37104 'Adobe-CNS1-2', 37105 'Adobe-CNS1-3', 37106 'Adobe-CNS1-4', 37107 'Adobe-CNS1-5', 37108 'Adobe-CNS1-6', 37109 'Adobe-GB1-0', 37110 'Adobe-GB1-1', 37111 'Adobe-GB1-2', 37112 'Adobe-GB1-3', 37113 'Adobe-GB1-4', 37114 'Adobe-GB1-5', 37115 'Adobe-Japan1-0', 37116 'Adobe-Japan1-1', 37117 'Adobe-Japan1-2', 37118 'Adobe-Japan1-3', 37119 'Adobe-Japan1-4', 37120 'Adobe-Japan1-5', 37121 'Adobe-Japan1-6', 37122 'Adobe-Korea1-0', 37123 'Adobe-Korea1-1', 37124 'Adobe-Korea1-2', 37125 'B5-H', 37126 'B5-V', 37127 'B5pc-H', 37128 'B5pc-V', 37129 'CNS-EUC-H', 37130 'CNS-EUC-V', 37131 'CNS1-H', 37132 'CNS1-V', 37133 'CNS2-H', 37134 'CNS2-V', 37135 'ETHK-B5-H', 37136 'ETHK-B5-V', 37137 'ETen-B5-H', 37138 'ETen-B5-V', 37139 'ETenms-B5-H', 37140 'ETenms-B5-V', 37141 'EUC-H', 37142 'EUC-V', 37143 'Ext-H', 37144 'Ext-RKSJ-H', 37145 'Ext-RKSJ-V', 37146 'Ext-V', 37147 'GB-EUC-H', 37148 'GB-EUC-V', 37149 'GB-H', 37150 'GB-V', 37151 'GBK-EUC-H', 37152 'GBK-EUC-V', 37153 'GBK2K-H', 37154 'GBK2K-V', 37155 'GBKp-EUC-H', 37156 'GBKp-EUC-V', 37157 'GBT-EUC-H', 37158 'GBT-EUC-V', 37159 'GBT-H', 37160 'GBT-V', 37161 'GBTpc-EUC-H', 37162 'GBTpc-EUC-V', 37163 'GBpc-EUC-H', 37164 'GBpc-EUC-V', 37165 'H', 37166 'HKdla-B5-H', 37167 'HKdla-B5-V', 37168 'HKdlb-B5-H', 37169 'HKdlb-B5-V', 37170 'HKgccs-B5-H', 37171 'HKgccs-B5-V', 37172 'HKm314-B5-H', 37173 'HKm314-B5-V', 37174 'HKm471-B5-H', 37175 'HKm471-B5-V', 37176 'HKscs-B5-H', 37177 'HKscs-B5-V', 37178 'Hankaku', 37179 'Hiragana', 37180 'KSC-EUC-H', 37181 'KSC-EUC-V', 37182 'KSC-H', 37183 'KSC-Johab-H', 37184 'KSC-Johab-V', 37185 'KSC-V', 37186 'KSCms-UHC-H', 37187 'KSCms-UHC-HW-H', 37188 'KSCms-UHC-HW-V', 37189 'KSCms-UHC-V', 37190 'KSCpc-EUC-H', 37191 'KSCpc-EUC-V', 37192 'Katakana', 37193 'NWP-H', 37194 'NWP-V', 37195 'RKSJ-H', 37196 'RKSJ-V', 37197 'Roman', 37198 'UniCNS-UCS2-H', 37199 'UniCNS-UCS2-V', 37200 'UniCNS-UTF16-H', 37201 'UniCNS-UTF16-V', 37202 'UniCNS-UTF32-H', 37203 'UniCNS-UTF32-V', 37204 'UniCNS-UTF8-H', 37205 'UniCNS-UTF8-V', 37206 'UniGB-UCS2-H', 37207 'UniGB-UCS2-V', 37208 'UniGB-UTF16-H', 37209 'UniGB-UTF16-V', 37210 'UniGB-UTF32-H', 37211 'UniGB-UTF32-V', 37212 'UniGB-UTF8-H', 37213 'UniGB-UTF8-V', 37214 'UniJIS-UCS2-H', 37215 'UniJIS-UCS2-HW-H', 37216 'UniJIS-UCS2-HW-V', 37217 'UniJIS-UCS2-V', 37218 'UniJIS-UTF16-H', 37219 'UniJIS-UTF16-V', 37220 'UniJIS-UTF32-H', 37221 'UniJIS-UTF32-V', 37222 'UniJIS-UTF8-H', 37223 'UniJIS-UTF8-V', 37224 'UniJIS2004-UTF16-H', 37225 'UniJIS2004-UTF16-V', 37226 'UniJIS2004-UTF32-H', 37227 'UniJIS2004-UTF32-V', 37228 'UniJIS2004-UTF8-H', 37229 'UniJIS2004-UTF8-V', 37230 'UniJISPro-UCS2-HW-V', 37231 'UniJISPro-UCS2-V', 37232 'UniJISPro-UTF8-V', 37233 'UniJISX0213-UTF32-H', 37234 'UniJISX0213-UTF32-V', 37235 'UniJISX02132004-UTF32-H', 37236 'UniJISX02132004-UTF32-V', 37237 'UniKS-UCS2-H', 37238 'UniKS-UCS2-V', 37239 'UniKS-UTF16-H', 37240 'UniKS-UTF16-V', 37241 'UniKS-UTF32-H', 37242 'UniKS-UTF32-V', 37243 'UniKS-UTF8-H', 37244 'UniKS-UTF8-V', 37245 'V', 37246 'WP-Symbol' 37247]; 37248var CMap = function CMapClosure() { 37249 function CMap(builtInCMap) { 37250 this.codespaceRanges = [ 37251 [], 37252 [],
vendor: 14,335 bytes, lines 37253-37818
37253 [], 37254 [] 37255 ]; 37256 this.numCodespaceRanges = 0; 37257 this._map = []; 37258 this.name = ''; 37259 this.vertical = false; 37260 this.useCMap = null; 37261 this.builtInCMap = builtInCMap; 37262 } 37263 CMap.prototype = { 37264 addCodespaceRange: function (n, low, high) { 37265 this.codespaceRanges[n - 1].push(low, high); 37266 this.numCodespaceRanges++; 37267 }, 37268 mapCidRange: function (low, high, dstLow) { 37269 while (low <= high) { 37270 this._map[low++] = dstLow++; 37271 } 37272 }, 37273 mapBfRange: function (low, high, dstLow) { 37274 var lastByte = dstLow.length - 1; 37275 while (low <= high) { 37276 this._map[low++] = dstLow; 37277 dstLow = dstLow.substr(0, lastByte) + String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); 37278 } 37279 }, 37280 mapBfRangeToArray: function (low, high, array) { 37281 var i = 0, ii = array.length; 37282 while (low <= high && i < ii) { 37283 this._map[low] = array[i++]; 37284 ++low; 37285 } 37286 }, 37287 mapOne: function (src, dst) { 37288 this._map[src] = dst; 37289 }, 37290 lookup: function (code) { 37291 return this._map[code]; 37292 }, 37293 contains: function (code) { 37294 return this._map[code] !== undefined; 37295 }, 37296 forEach: function (callback) { 37297 var map = this._map; 37298 var length = map.length; 37299 var i; 37300 if (length <= 0x10000) { 37301 for (i = 0; i < length; i++) { 37302 if (map[i] !== undefined) { 37303 callback(i, map[i]); 37304 } 37305 } 37306 } else { 37307 for (i in this._map) { 37308 callback(i, map[i]); 37309 } 37310 } 37311 }, 37312 charCodeOf: function (value) { 37313 return this._map.indexOf(value); 37314 }, 37315 getMap: function () { 37316 return this._map; 37317 }, 37318 readCharCode: function (str, offset, out) { 37319 var c = 0; 37320 var codespaceRanges = this.codespaceRanges; 37321 var codespaceRangesLen = this.codespaceRanges.length; 37322 for (var n = 0; n < codespaceRangesLen; n++) { 37323 c = (c << 8 | str.charCodeAt(offset + n)) >>> 0; 37324 var codespaceRange = codespaceRanges[n]; 37325 for (var k = 0, kk = codespaceRange.length; k < kk;) { 37326 var low = codespaceRange[k++]; 37327 var high = codespaceRange[k++]; 37328 if (c >= low && c <= high) { 37329 out.charcode = c; 37330 out.length = n + 1; 37331 return; 37332 } 37333 } 37334 } 37335 out.charcode = 0; 37336 out.length = 1; 37337 }, 37338 get length() { 37339 return this._map.length; 37340 }, 37341 get isIdentityCMap() { 37342 if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { 37343 return false; 37344 } 37345 if (this._map.length !== 0x10000) { 37346 return false; 37347 } 37348 for (var i = 0; i < 0x10000; i++) { 37349 if (this._map[i] !== i) { 37350 return false; 37351 } 37352 } 37353 return true; 37354 } 37355 }; 37356 return CMap; 37357}(); 37358var IdentityCMap = function IdentityCMapClosure() { 37359 function IdentityCMap(vertical, n) { 37360 CMap.call(this); 37361 this.vertical = vertical; 37362 this.addCodespaceRange(n, 0, 0xffff); 37363 } 37364 Util.inherit(IdentityCMap, CMap, {}); 37365 IdentityCMap.prototype = { 37366 addCodespaceRange: CMap.prototype.addCodespaceRange, 37367 mapCidRange: function (low, high, dstLow) { 37368 error('should not call mapCidRange'); 37369 }, 37370 mapBfRange: function (low, high, dstLow) { 37371 error('should not call mapBfRange'); 37372 }, 37373 mapBfRangeToArray: function (low, high, array) { 37374 error('should not call mapBfRangeToArray'); 37375 }, 37376 mapOne: function (src, dst) { 37377 error('should not call mapCidOne'); 37378 }, 37379 lookup: function (code) { 37380 return isInt(code) && code <= 0xffff ? code : undefined; 37381 }, 37382 contains: function (code) { 37383 return isInt(code) && code <= 0xffff; 37384 }, 37385 forEach: function (callback) { 37386 for (var i = 0; i <= 0xffff; i++) { 37387 callback(i, i); 37388 } 37389 }, 37390 charCodeOf: function (value) { 37391 return isInt(value) && value <= 0xffff ? value : -1; 37392 }, 37393 getMap: function () { 37394 var map = new Array(0x10000); 37395 for (var i = 0; i <= 0xffff; i++) { 37396 map[i] = i; 37397 } 37398 return map; 37399 }, 37400 readCharCode: CMap.prototype.readCharCode, 37401 get length() { 37402 return 0x10000; 37403 }, 37404 get isIdentityCMap() { 37405 error('should not access .isIdentityCMap'); 37406 } 37407 }; 37408 return IdentityCMap; 37409}(); 37410var BinaryCMapReader = function BinaryCMapReaderClosure() { 37411 function hexToInt(a, size) { 37412 var n = 0; 37413 for (var i = 0; i <= size; i++) { 37414 n = n << 8 | a[i]; 37415 } 37416 return n >>> 0; 37417 } 37418 function hexToStr(a, size) { 37419 if (size === 1) { 37420 return String.fromCharCode(a[0], a[1]); 37421 } 37422 if (size === 3) { 37423 return String.fromCharCode(a[0], a[1], a[2], a[3]); 37424 } 37425 return String.fromCharCode.apply(null, a.subarray(0, size + 1)); 37426 } 37427 function addHex(a, b, size) { 37428 var c = 0; 37429 for (var i = size; i >= 0; i--) { 37430 c += a[i] + b[i]; 37431 a[i] = c & 255; 37432 c >>= 8; 37433 } 37434 } 37435 function incHex(a, size) { 37436 var c = 1; 37437 for (var i = size; i >= 0 && c > 0; i--) { 37438 c += a[i]; 37439 a[i] = c & 255; 37440 c >>= 8; 37441 } 37442 } 37443 var MAX_NUM_SIZE = 16; 37444 var MAX_ENCODED_NUM_SIZE = 19; 37445 function BinaryCMapStream(data) { 37446 this.buffer = data; 37447 this.pos = 0; 37448 this.end = data.length; 37449 this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); 37450 } 37451 BinaryCMapStream.prototype = { 37452 readByte: function () { 37453 if (this.pos >= this.end) { 37454 return -1; 37455 } 37456 return this.buffer[this.pos++]; 37457 }, 37458 readNumber: function () { 37459 var n = 0; 37460 var last; 37461 do { 37462 var b = this.readByte(); 37463 if (b < 0) { 37464 error('unexpected EOF in bcmap'); 37465 } 37466 last = !(b & 0x80); 37467 n = n << 7 | b & 0x7F; 37468 } while (!last); 37469 return n; 37470 }, 37471 readSigned: function () { 37472 var n = this.readNumber(); 37473 return n & 1 ? ~(n >>> 1) : n >>> 1; 37474 }, 37475 readHex: function (num, size) { 37476 num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); 37477 this.pos += size + 1; 37478 }, 37479 readHexNumber: function (num, size) { 37480 var last; 37481 var stack = this.tmpBuf, sp = 0; 37482 do { 37483 var b = this.readByte(); 37484 if (b < 0) { 37485 error('unexpected EOF in bcmap'); 37486 } 37487 last = !(b & 0x80); 37488 stack[sp++] = b & 0x7F; 37489 } while (!last); 37490 var i = size, buffer = 0, bufferSize = 0; 37491 while (i >= 0) { 37492 while (bufferSize < 8 && stack.length > 0) { 37493 buffer = stack[--sp] << bufferSize | buffer; 37494 bufferSize += 7; 37495 } 37496 num[i] = buffer & 255; 37497 i--; 37498 buffer >>= 8; 37499 bufferSize -= 8; 37500 } 37501 }, 37502 readHexSigned: function (num, size) { 37503 this.readHexNumber(num, size); 37504 var sign = num[size] & 1 ? 255 : 0; 37505 var c = 0; 37506 for (var i = 0; i <= size; i++) { 37507 c = (c & 1) << 8 | num[i]; 37508 num[i] = c >> 1 ^ sign; 37509 } 37510 }, 37511 readString: function () { 37512 var len = this.readNumber(); 37513 var s = ''; 37514 for (var i = 0; i < len; i++) { 37515 s += String.fromCharCode(this.readNumber()); 37516 } 37517 return s; 37518 } 37519 }; 37520 function processBinaryCMap(data, cMap, extend) { 37521 return new Promise(function (resolve, reject) { 37522 var stream = new BinaryCMapStream(data); 37523 var header = stream.readByte(); 37524 cMap.vertical = !!(header & 1); 37525 var useCMap = null; 37526 var start = new Uint8Array(MAX_NUM_SIZE); 37527 var end = new Uint8Array(MAX_NUM_SIZE); 37528 var char = new Uint8Array(MAX_NUM_SIZE); 37529 var charCode = new Uint8Array(MAX_NUM_SIZE); 37530 var tmp = new Uint8Array(MAX_NUM_SIZE); 37531 var code; 37532 var b; 37533 while ((b = stream.readByte()) >= 0) { 37534 var type = b >> 5; 37535 if (type === 7) { 37536 switch (b & 0x1F) { 37537 case 0: 37538 stream.readString(); 37539 break; 37540 case 1: 37541 useCMap = stream.readString(); 37542 break; 37543 } 37544 continue; 37545 } 37546 var sequence = !!(b & 0x10); 37547 var dataSize = b & 15; 37548 assert(dataSize + 1 <= MAX_NUM_SIZE); 37549 var ucs2DataSize = 1; 37550 var subitemsCount = stream.readNumber(); 37551 var i; 37552 switch (type) { 37553 case 0: 37554 stream.readHex(start, dataSize); 37555 stream.readHexNumber(end, dataSize); 37556 addHex(end, start, dataSize); 37557 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 37558 for (i = 1; i < subitemsCount; i++) { 37559 incHex(end, dataSize); 37560 stream.readHexNumber(start, dataSize); 37561 addHex(start, end, dataSize); 37562 stream.readHexNumber(end, dataSize); 37563 addHex(end, start, dataSize); 37564 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 37565 } 37566 break; 37567 case 1: 37568 stream.readHex(start, dataSize); 37569 stream.readHexNumber(end, dataSize); 37570 addHex(end, start, dataSize); 37571 code = stream.readNumber(); 37572 for (i = 1; i < subitemsCount; i++) { 37573 incHex(end, dataSize); 37574 stream.readHexNumber(start, dataSize); 37575 addHex(start, end, dataSize); 37576 stream.readHexNumber(end, dataSize); 37577 addHex(end, start, dataSize); 37578 code = stream.readNumber(); 37579 } 37580 break; 37581 case 2: 37582 stream.readHex(char, dataSize); 37583 code = stream.readNumber(); 37584 cMap.mapOne(hexToInt(char, dataSize), code); 37585 for (i = 1; i < subitemsCount; i++) { 37586 incHex(char, dataSize); 37587 if (!sequence) { 37588 stream.readHexNumber(tmp, dataSize); 37589 addHex(char, tmp, dataSize); 37590 } 37591 code = stream.readSigned() + (code + 1); 37592 cMap.mapOne(hexToInt(char, dataSize), code); 37593 } 37594 break; 37595 case 3: 37596 stream.readHex(start, dataSize); 37597 stream.readHexNumber(end, dataSize); 37598 addHex(end, start, dataSize); 37599 code = stream.readNumber(); 37600 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 37601 for (i = 1; i < subitemsCount; i++) { 37602 incHex(end, dataSize); 37603 if (!sequence) { 37604 stream.readHexNumber(start, dataSize); 37605 addHex(start, end, dataSize); 37606 } else { 37607 start.set(end); 37608 } 37609 stream.readHexNumber(end, dataSize); 37610 addHex(end, start, dataSize); 37611 code = stream.readNumber(); 37612 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 37613 } 37614 break; 37615 case 4: 37616 stream.readHex(char, ucs2DataSize); 37617 stream.readHex(charCode, dataSize); 37618 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 37619 for (i = 1; i < subitemsCount; i++) { 37620 incHex(char, ucs2DataSize); 37621 if (!sequence) { 37622 stream.readHexNumber(tmp, ucs2DataSize); 37623 addHex(char, tmp, ucs2DataSize); 37624 } 37625 incHex(charCode, dataSize); 37626 stream.readHexSigned(tmp, dataSize); 37627 addHex(charCode, tmp, dataSize); 37628 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 37629 } 37630 break; 37631 case 5: 37632 stream.readHex(start, ucs2DataSize); 37633 stream.readHexNumber(end, ucs2DataSize); 37634 addHex(end, start, ucs2DataSize); 37635 stream.readHex(charCode, dataSize); 37636 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 37637 for (i = 1; i < subitemsCount; i++) { 37638 incHex(end, ucs2DataSize); 37639 if (!sequence) { 37640 stream.readHexNumber(start, ucs2DataSize); 37641 addHex(start, end, ucs2DataSize); 37642 } else { 37643 start.set(end); 37644 } 37645 stream.readHexNumber(end, ucs2DataSize); 37646 addHex(end, start, ucs2DataSize); 37647 stream.readHex(charCode, dataSize); 37648 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 37649 } 37650 break; 37651 default: 37652 reject(new Error('processBinaryCMap: Unknown type: ' + type)); 37653 return; 37654 } 37655 } 37656 if (useCMap) { 37657 resolve(extend(useCMap)); 37658 return; 37659 } 37660 resolve(cMap); 37661 }); 37662 } 37663 function BinaryCMapReader() { 37664 } 37665 BinaryCMapReader.prototype = { process: processBinaryCMap }; 37666 return BinaryCMapReader; 37667}(); 37668var CMapFactory = function CMapFactoryClosure() { 37669 function strToInt(str) { 37670 var a = 0; 37671 for (var i = 0; i < str.length; i++) { 37672 a = a << 8 | str.charCodeAt(i); 37673 } 37674 return a >>> 0; 37675 } 37676 function expectString(obj) { 37677 if (!isString(obj)) { 37678 error('Malformed CMap: expected string.'); 37679 } 37680 } 37681 function expectInt(obj) { 37682 if (!isInt(obj)) { 37683 error('Malformed CMap: expected int.'); 37684 } 37685 } 37686 function parseBfChar(cMap, lexer) { 37687 while (true) { 37688 var obj = lexer.getObj(); 37689 if (isEOF(obj)) { 37690 break; 37691 } 37692 if (isCmd(obj, 'endbfchar')) { 37693 return; 37694 } 37695 expectString(obj); 37696 var src = strToInt(obj); 37697 obj = lexer.getObj(); 37698 expectString(obj); 37699 var dst = obj; 37700 cMap.mapOne(src, dst); 37701 } 37702 } 37703 function parseBfRange(cMap, lexer) { 37704 while (true) { 37705 var obj = lexer.getObj(); 37706 if (isEOF(obj)) { 37707 break; 37708 } 37709 if (isCmd(obj, 'endbfrange')) { 37710 return; 37711 } 37712 expectString(obj); 37713 var low = strToInt(obj); 37714 obj = lexer.getObj(); 37715 expectString(obj); 37716 var high = strToInt(obj); 37717 obj = lexer.getObj(); 37718 if (isInt(obj) || isString(obj)) { 37719 var dstLow = isInt(obj) ? String.fromCharCode(obj) : obj; 37720 cMap.mapBfRange(low, high, dstLow); 37721 } else if (isCmd(obj, '[')) { 37722 obj = lexer.getObj(); 37723 var array = []; 37724 while (!isCmd(obj, ']') && !isEOF(obj)) { 37725 array.push(obj); 37726 obj = lexer.getObj(); 37727 } 37728 cMap.mapBfRangeToArray(low, high, array); 37729 } else { 37730 break; 37731 } 37732 } 37733 error('Invalid bf range.'); 37734 } 37735 function parseCidChar(cMap, lexer) { 37736 while (true) { 37737 var obj = lexer.getObj(); 37738 if (isEOF(obj)) { 37739 break; 37740 } 37741 if (isCmd(obj, 'endcidchar')) { 37742 return; 37743 } 37744 expectString(obj); 37745 var src = strToInt(obj); 37746 obj = lexer.getObj(); 37747 expectInt(obj); 37748 var dst = obj; 37749 cMap.mapOne(src, dst); 37750 } 37751 } 37752 function parseCidRange(cMap, lexer) { 37753 while (true) { 37754 var obj = lexer.getObj(); 37755 if (isEOF(obj)) { 37756 break; 37757 } 37758 if (isCmd(obj, 'endcidrange')) { 37759 return; 37760 } 37761 expectString(obj); 37762 var low = strToInt(obj); 37763 obj = lexer.getObj(); 37764 expectString(obj); 37765 var high = strToInt(obj); 37766 obj = lexer.getObj(); 37767 expectInt(obj); 37768 var dstLow = obj; 37769 cMap.mapCidRange(low, high, dstLow); 37770 } 37771 } 37772 function parseCodespaceRange(cMap, lexer) { 37773 while (true) { 37774 var obj = lexer.getObj(); 37775 if (isEOF(obj)) { 37776 break; 37777 } 37778 if (isCmd(obj, 'endcodespacerange')) { 37779 return; 37780 } 37781 if (!isString(obj)) { 37782 break; 37783 } 37784 var low = strToInt(obj); 37785 obj = lexer.getObj(); 37786 if (!isString(obj)) { 37787 break; 37788 } 37789 var high = strToInt(obj); 37790 cMap.addCodespaceRange(obj.length, low, high); 37791 } 37792 error('Invalid codespace range.'); 37793 } 37794 function parseWMode(cMap, lexer) { 37795 var obj = lexer.getObj(); 37796 if (isInt(obj)) { 37797 cMap.vertical = !!obj; 37798 } 37799 } 37800 function parseCMapName(cMap, lexer) { 37801 var obj = lexer.getObj(); 37802 if (isName(obj) && isString(obj.name)) { 37803 cMap.name = obj.name; 37804 } 37805 } 37806 function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { 37807 var previous; 37808 var embededUseCMap; 37809 objLoop: 37810 while (true) { 37811 try { 37812 var obj = lexer.getObj(); 37813 if (isEOF(obj)) { 37814 break; 37815 } else if (isName(obj)) { 37816 if (obj.name === 'WMode') { 37817 parseWMode(cMap, lexer); 37818 } else if (obj.name === 'CMapName') {
37819 parseCMapName(cMap, lexer); 37820 } 37821 previous = obj; 37822 } else if (isCmd(obj)) { 37823 switch (obj.cmd) { 37824 case 'endcmap': 37825 break objLoop; 37826 case 'usecmap': 37827 if (isName(previous)) { 37828 embededUseCMap = previous.name; 37829 } 37830 break; 37831 case 'begincodespacerange': 37832 parseCodespaceRange(cMap, lexer); 37833 break; 37834 case 'beginbfchar': 37835 parseBfChar(cMap, lexer); 37836 break; 37837 case 'begincidchar': 37838 parseCidChar(cMap, lexer); 37839 break; 37840 case 'beginbfrange': 37841 parseBfRange(cMap, lexer); 37842 break; 37843 case 'begincidrange': 37844 parseCidRange(cMap, lexer); 37845 break; 37846 } 37847 } 37848 } catch (ex) { 37849 if (ex instanceof MissingDataException) { 37850 throw ex; 37851 } 37852 warn('Invalid cMap data: ' + ex); 37853 continue; 37854 } 37855 } 37856 if (!useCMap && embededUseCMap) { 37857 useCMap = embededUseCMap; 37858 } 37859 if (useCMap) { 37860 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 37861 } 37862 return Promise.resolve(cMap); 37863 } 37864 function extendCMap(cMap, fetchBuiltInCMap, useCMap) { 37865 return createBuiltInCMap(useCMap, fetchBuiltInCMap).then(function (newCMap) { 37866 cMap.useCMap = newCMap; 37867 if (cMap.numCodespaceRanges === 0) { 37868 var useCodespaceRanges = cMap.useCMap.codespaceRanges; 37869 for (var i = 0; i < useCodespaceRanges.length; i++) { 37870 cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); 37871 } 37872 cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; 37873 } 37874 cMap.useCMap.forEach(function (key, value) { 37875 if (!cMap.contains(key)) { 37876 cMap.mapOne(key, cMap.useCMap.lookup(key)); 37877 } 37878 }); 37879 return cMap; 37880 }); 37881 } 37882 function createBuiltInCMap(name, fetchBuiltInCMap) { 37883 if (name === 'Identity-H') { 37884 return Promise.resolve(new IdentityCMap(false, 2)); 37885 } else if (name === 'Identity-V') { 37886 return Promise.resolve(new IdentityCMap(true, 2)); 37887 } 37888 if (BUILT_IN_CMAPS.indexOf(name) === -1) { 37889 return Promise.reject(new Error('Unknown cMap name: ' + name)); 37890 } 37891 assert(fetchBuiltInCMap, 'Built-in CMap parameters are not provided.'); 37892 return fetchBuiltInCMap(name).then(function (data) { 37893 var cMapData = data.cMapData, compressionType = data.compressionType; 37894 var cMap = new CMap(true); 37895 if (compressionType === CMapCompressionType.BINARY) { 37896 return new BinaryCMapReader().process(cMapData, cMap, function (useCMap) { 37897 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 37898 }); 37899 } 37900 assert(compressionType === CMapCompressionType.NONE, 'TODO: Only BINARY/NONE CMap compression is currently supported.'); 37901 var lexer = new Lexer(new Stream(cMapData)); 37902 return parseCMap(cMap, lexer, fetchBuiltInCMap, null); 37903 }); 37904 } 37905 return { 37906 create: function (params) { 37907 var encoding = params.encoding; 37908 var fetchBuiltInCMap = params.fetchBuiltInCMap; 37909 var useCMap = params.useCMap; 37910 if (isName(encoding)) { 37911 return createBuiltInCMap(encoding.name, fetchBuiltInCMap); 37912 } else if (isStream(encoding)) { 37913 var cMap = new CMap(); 37914 var lexer = new Lexer(encoding); 37915 return parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap).then(function (parsedCMap) { 37916 if (parsedCMap.isIdentityCMap) { 37917 return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); 37918 } 37919 return parsedCMap; 37920 }); 37921 } 37922 return Promise.reject(new Error('Encoding required.')); 37923 } 37924 }; 37925}(); 37926exports.CMap = CMap; 37927exports.CMapFactory = CMapFactory; 37928exports.IdentityCMap = IdentityCMap; 37929 37930/***/ }), 37931/* 24 */ 37932/***/ (function(module, exports, __w_pdfjs_require__) { 37933 37934"use strict"; 37935 37936var sharedUtil = __w_pdfjs_require__(0); 37937var corePrimitives = __w_pdfjs_require__(1); 37938var coreStream = __w_pdfjs_require__(2); 37939var coreObj = __w_pdfjs_require__(16); 37940var coreParser = __w_pdfjs_require__(5); 37941var coreCrypto = __w_pdfjs_require__(13); 37942var coreEvaluator = __w_pdfjs_require__(14); 37943var coreAnnotation = __w_pdfjs_require__(20); 37944var OPS = sharedUtil.OPS; 37945var MissingDataException = sharedUtil.MissingDataException; 37946var Util = sharedUtil.Util; 37947var assert = sharedUtil.assert; 37948var error = sharedUtil.error; 37949var info = sharedUtil.info; 37950var isArray = sharedUtil.isArray; 37951var isArrayBuffer = sharedUtil.isArrayBuffer; 37952var isNum = sharedUtil.isNum; 37953var isString = sharedUtil.isString; 37954var shadow = sharedUtil.shadow; 37955var stringToBytes = sharedUtil.stringToBytes; 37956var stringToPDFString = sharedUtil.stringToPDFString; 37957var warn = sharedUtil.warn; 37958var isSpace = sharedUtil.isSpace; 37959var Dict = corePrimitives.Dict; 37960var isDict = corePrimitives.isDict; 37961var isName = corePrimitives.isName; 37962var isStream = corePrimitives.isStream; 37963var NullStream = coreStream.NullStream; 37964var Stream = coreStream.Stream; 37965var StreamsSequenceStream = coreStream.StreamsSequenceStream;
37966var Catalog = coreObj.Catalog; 37967var ObjectLoader = coreObj.ObjectLoader; 37968var XRef = coreObj.XRef; 37969var Linearization = coreParser.Linearization; 37970var calculateMD5 = coreCrypto.calculateMD5; 37971var OperatorList = coreEvaluator.OperatorList; 37972var PartialEvaluator = coreEvaluator.PartialEvaluator; 37973var AnnotationFactory = coreAnnotation.AnnotationFactory; 37974var Page = function PageClosure() { 37975 var DEFAULT_USER_UNIT = 1.0; 37976 var LETTER_SIZE_MEDIABOX = [ 37977 0, 37978 0, 37979 612, 37980 792 37981 ]; 37982 function isAnnotationRenderable(annotation, intent) { 37983 return intent === 'display' && annotation.viewable || intent === 'print' && annotation.printable; 37984 } 37985 function Page(pdfManager, xref, pageIndex, pageDict, ref, fontCache, builtInCMapCache) { 37986 this.pdfManager = pdfManager; 37987 this.pageIndex = pageIndex; 37988 this.pageDict = pageDict; 37989 this.xref = xref; 37990 this.ref = ref; 37991 this.fontCache = fontCache; 37992 this.builtInCMapCache = builtInCMapCache; 37993 this.evaluatorOptions = pdfManager.evaluatorOptions; 37994 this.resourcesPromise = null; 37995 var uniquePrefix = 'p' + this.pageIndex + '_'; 37996 var idCounters = { obj: 0 }; 37997 this.idFactory = { 37998 createObjId: function () { 37999 return uniquePrefix + ++idCounters.obj; 38000 } 38001 }; 38002 } 38003 Page.prototype = { 38004 getPageProp: function Page_getPageProp(key) { 38005 return this.pageDict.get(key); 38006 }, 38007 getInheritedPageProp: function Page_getInheritedPageProp(key, getArray) { 38008 var dict = this.pageDict, valueArray = null, loopCount = 0; 38009 var MAX_LOOP_COUNT = 100; 38010 getArray = getArray || false; 38011 while (dict) { 38012 var value = getArray ? dict.getArray(key) : dict.get(key); 38013 if (value !== undefined) { 38014 if (!valueArray) { 38015 valueArray = []; 38016 } 38017 valueArray.push(value); 38018 } 38019 if (++loopCount > MAX_LOOP_COUNT) { 38020 warn('getInheritedPageProp: maximum loop count exceeded for ' + key); 38021 return valueArray ? valueArray[0] : undefined; 38022 } 38023 dict = dict.get('Parent'); 38024 } 38025 if (!valueArray) { 38026 return undefined; 38027 } 38028 if (valueArray.length === 1 || !isDict(valueArray[0])) { 38029 return valueArray[0]; 38030 } 38031 return Dict.merge(this.xref, valueArray); 38032 }, 38033 get content() { 38034 return this.getPageProp('Contents'); 38035 }, 38036 get resources() { 38037 return shadow(this, 'resources', this.getInheritedPageProp('Resources') || Dict.empty); 38038 }, 38039 get mediaBox() { 38040 var mediaBox = this.getInheritedPageProp('MediaBox', true); 38041 if (!isArray(mediaBox) || mediaBox.length !== 4) { 38042 return shadow(this, 'mediaBox', LETTER_SIZE_MEDIABOX); 38043 } 38044 return shadow(this, 'mediaBox', mediaBox); 38045 }, 38046 get cropBox() { 38047 var cropBox = this.getInheritedPageProp('CropBox', true); 38048 if (!isArray(cropBox) || cropBox.length !== 4) { 38049 return shadow(this, 'cropBox', this.mediaBox); 38050 } 38051 return shadow(this, 'cropBox', cropBox); 38052 }, 38053 get userUnit() { 38054 var obj = this.getPageProp('UserUnit'); 38055 if (!isNum(obj) || obj <= 0) { 38056 obj = DEFAULT_USER_UNIT; 38057 } 38058 return shadow(this, 'userUnit', obj); 38059 }, 38060 get view() { 38061 var mediaBox = this.mediaBox, cropBox = this.cropBox; 38062 if (mediaBox === cropBox) { 38063 return shadow(this, 'view', mediaBox); 38064 } 38065 var intersection = Util.intersect(cropBox, mediaBox); 38066 return shadow(this, 'view', intersection || mediaBox); 38067 }, 38068 get rotate() { 38069 var rotate = this.getInheritedPageProp('Rotate') || 0; 38070 if (rotate % 90 !== 0) { 38071 rotate = 0; 38072 } else if (rotate >= 360) { 38073 rotate = rotate % 360; 38074 } else if (rotate < 0) { 38075 rotate = (rotate % 360 + 360) % 360; 38076 } 38077 return shadow(this, 'rotate', rotate); 38078 }, 38079 getContentStream: function Page_getContentStream() { 38080 var content = this.content; 38081 var stream; 38082 if (isArray(content)) { 38083 var xref = this.xref; 38084 var i, n = content.length; 38085 var streams = []; 38086 for (i = 0; i < n; ++i) { 38087 streams.push(xref.fetchIfRef(content[i])); 38088 } 38089 stream = new StreamsSequenceStream(streams); 38090 } else if (isStream(content)) { 38091 stream = content; 38092 } else { 38093 stream = new NullStream(); 38094 } 38095 return stream; 38096 }, 38097 loadResources: function Page_loadResources(keys) { 38098 if (!this.resourcesPromise) { 38099 this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); 38100 } 38101 return this.resourcesPromise.then(function resourceSuccess() { 38102 var objectLoader = new ObjectLoader(this.resources.map, keys, this.xref); 38103 return objectLoader.load(); 38104 }.bind(this)); 38105 }, 38106 getOperatorList: function Page_getOperatorList(handler, task, intent, renderInteractiveForms) { 38107 var self = this; 38108 var pdfManager = this.pdfManager; 38109 var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); 38110 var resourcesPromise = this.loadResources([ 38111 'ExtGState', 38112 'ColorSpace', 38113 'Pattern', 38114 'Shading', 38115 'XObject', 38116 'Font' 38117 ]); 38118 var partialEvaluator = new PartialEvaluator(pdfManager, this.xref, handler, this.pageIndex, this.idFactory, this.fontCache, this.builtInCMapCache, this.evaluatorOptions); 38119 var dataPromises = Promise.all([ 38120 contentStreamPromise, 38121 resourcesPromise 38122 ]); 38123 var pageListPromise = dataPromises.then(function (data) { 38124 var contentStream = data[0]; 38125 var opList = new OperatorList(intent, handler, self.pageIndex); 38126 handler.send('StartRenderPage', { 38127 transparency: partialEvaluator.hasBlendModes(self.resources), 38128 pageIndex: self.pageIndex, 38129 intent: intent 38130 }); 38131 return partialEvaluator.getOperatorList(contentStream, task, self.resources, opList).then(function () { 38132 return opList; 38133 }); 38134 });
vendor: 13,084 bytes, lines 38135-38560
38135 var annotationsPromise = pdfManager.ensure(this, 'annotations'); 38136 return Promise.all([ 38137 pageListPromise, 38138 annotationsPromise 38139 ]).then(function (datas) { 38140 var pageOpList = datas[0]; 38141 var annotations = datas[1]; 38142 if (annotations.length === 0) { 38143 pageOpList.flush(true); 38144 return pageOpList; 38145 } 38146 var i, ii, opListPromises = []; 38147 for (i = 0, ii = annotations.length; i < ii; i++) { 38148 if (isAnnotationRenderable(annotations[i], intent)) { 38149 opListPromises.push(annotations[i].getOperatorList(partialEvaluator, task, renderInteractiveForms)); 38150 } 38151 } 38152 return Promise.all(opListPromises).then(function (opLists) { 38153 pageOpList.addOp(OPS.beginAnnotations, []); 38154 for (i = 0, ii = opLists.length; i < ii; i++) { 38155 pageOpList.addOpList(opLists[i]); 38156 } 38157 pageOpList.addOp(OPS.endAnnotations, []); 38158 pageOpList.flush(true); 38159 return pageOpList; 38160 }); 38161 }); 38162 }, 38163 extractTextContent: function Page_extractTextContent(task, normalizeWhitespace, combineTextItems) { 38164 var handler = { 38165 on: function nullHandlerOn() { 38166 }, 38167 send: function nullHandlerSend() { 38168 } 38169 }; 38170 var self = this; 38171 var pdfManager = this.pdfManager; 38172 var contentStreamPromise = pdfManager.ensure(this, 'getContentStream', []); 38173 var resourcesPromise = this.loadResources([ 38174 'ExtGState', 38175 'XObject', 38176 'Font' 38177 ]); 38178 var dataPromises = Promise.all([ 38179 contentStreamPromise, 38180 resourcesPromise 38181 ]); 38182 return dataPromises.then(function (data) { 38183 var contentStream = data[0]; 38184 var partialEvaluator = new PartialEvaluator(pdfManager, self.xref, handler, self.pageIndex, self.idFactory, self.fontCache, self.builtInCMapCache, self.evaluatorOptions); 38185 return partialEvaluator.getTextContent(contentStream, task, self.resources, null, normalizeWhitespace, combineTextItems); 38186 }); 38187 }, 38188 getAnnotationsData: function Page_getAnnotationsData(intent) { 38189 var annotations = this.annotations; 38190 var annotationsData = []; 38191 for (var i = 0, n = annotations.length; i < n; ++i) { 38192 if (!intent || isAnnotationRenderable(annotations[i], intent)) { 38193 annotationsData.push(annotations[i].data); 38194 } 38195 } 38196 return annotationsData; 38197 }, 38198 get annotations() { 38199 var annotations = []; 38200 var annotationRefs = this.getInheritedPageProp('Annots') || []; 38201 var annotationFactory = new AnnotationFactory(); 38202 for (var i = 0, n = annotationRefs.length; i < n; ++i) { 38203 var annotationRef = annotationRefs[i]; 38204 var annotation = annotationFactory.create(this.xref, annotationRef, this.pdfManager, this.idFactory); 38205 if (annotation) { 38206 annotations.push(annotation); 38207 } 38208 } 38209 return shadow(this, 'annotations', annotations); 38210 } 38211 }; 38212 return Page; 38213}(); 38214var PDFDocument = function PDFDocumentClosure() { 38215 var FINGERPRINT_FIRST_BYTES = 1024; 38216 var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; 38217 function PDFDocument(pdfManager, arg) { 38218 var stream; 38219 if (isStream(arg)) { 38220 stream = arg; 38221 } else if (isArrayBuffer(arg)) { 38222 stream = new Stream(arg); 38223 } else { 38224 error('PDFDocument: Unknown argument type'); 38225 } 38226 assert(stream.length > 0, 'stream must have data'); 38227 this.pdfManager = pdfManager; 38228 this.stream = stream; 38229 this.xref = new XRef(stream, pdfManager); 38230 } 38231 function find(stream, needle, limit, backwards) { 38232 var pos = stream.pos; 38233 var end = stream.end; 38234 var strBuf = []; 38235 if (pos + limit > end) { 38236 limit = end - pos; 38237 } 38238 for (var n = 0; n < limit; ++n) { 38239 strBuf.push(String.fromCharCode(stream.getByte())); 38240 } 38241 var str = strBuf.join(''); 38242 stream.pos = pos; 38243 var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); 38244 if (index === -1) { 38245 return false; 38246 } 38247 stream.pos += index; 38248 return true; 38249 } 38250 var DocumentInfoValidators = { 38251 get entries() { 38252 return shadow(this, 'entries', { 38253 Title: isString, 38254 Author: isString, 38255 Subject: isString, 38256 Keywords: isString, 38257 Creator: isString, 38258 Producer: isString, 38259 CreationDate: isString, 38260 ModDate: isString, 38261 Trapped: isName 38262 }); 38263 } 38264 }; 38265 PDFDocument.prototype = { 38266 parse: function PDFDocument_parse(recoveryMode) { 38267 this.setup(recoveryMode); 38268 var version = this.catalog.catDict.get('Version'); 38269 if (isName(version)) { 38270 this.pdfFormatVersion = version.name; 38271 } 38272 try { 38273 this.acroForm = this.catalog.catDict.get('AcroForm'); 38274 if (this.acroForm) { 38275 this.xfa = this.acroForm.get('XFA'); 38276 var fields = this.acroForm.get('Fields'); 38277 if ((!fields || !isArray(fields) || fields.length === 0) && !this.xfa) { 38278 this.acroForm = null; 38279 } 38280 } 38281 } catch (ex) { 38282 info('Something wrong with AcroForm entry'); 38283 this.acroForm = null; 38284 } 38285 }, 38286 get linearization() { 38287 var linearization = null; 38288 if (this.stream.length) { 38289 try { 38290 linearization = Linearization.create(this.stream); 38291 } catch (err) { 38292 if (err instanceof MissingDataException) { 38293 throw err; 38294 } 38295 info(err); 38296 } 38297 } 38298 return shadow(this, 'linearization', linearization); 38299 }, 38300 get startXRef() { 38301 var stream = this.stream; 38302 var startXRef = 0; 38303 var linearization = this.linearization; 38304 if (linearization) { 38305 stream.reset(); 38306 if (find(stream, 'endobj', 1024)) { 38307 startXRef = stream.pos + 6; 38308 } 38309 } else { 38310 var step = 1024; 38311 var found = false, pos = stream.end; 38312 while (!found && pos > 0) { 38313 pos -= step - 'startxref'.length; 38314 if (pos < 0) { 38315 pos = 0; 38316 } 38317 stream.pos = pos; 38318 found = find(stream, 'startxref', step, true); 38319 } 38320 if (found) { 38321 stream.skip(9); 38322 var ch; 38323 do { 38324 ch = stream.getByte(); 38325 } while (isSpace(ch)); 38326 var str = ''; 38327 while (ch >= 0x20 && ch <= 0x39) { 38328 str += String.fromCharCode(ch); 38329 ch = stream.getByte(); 38330 } 38331 startXRef = parseInt(str, 10); 38332 if (isNaN(startXRef)) { 38333 startXRef = 0; 38334 } 38335 } 38336 } 38337 return shadow(this, 'startXRef', startXRef); 38338 }, 38339 get mainXRefEntriesOffset() { 38340 var mainXRefEntriesOffset = 0; 38341 var linearization = this.linearization; 38342 if (linearization) { 38343 mainXRefEntriesOffset = linearization.mainXRefEntriesOffset; 38344 } 38345 return shadow(this, 'mainXRefEntriesOffset', mainXRefEntriesOffset); 38346 }, 38347 checkHeader: function PDFDocument_checkHeader() { 38348 var stream = this.stream; 38349 stream.reset(); 38350 if (find(stream, '%PDF-', 1024)) { 38351 stream.moveStart(); 38352 var MAX_VERSION_LENGTH = 12; 38353 var version = '', ch; 38354 while ((ch = stream.getByte()) > 0x20) { 38355 if (version.length >= MAX_VERSION_LENGTH) { 38356 break; 38357 } 38358 version += String.fromCharCode(ch); 38359 } 38360 if (!this.pdfFormatVersion) { 38361 this.pdfFormatVersion = version.substring(5); 38362 } 38363 return; 38364 } 38365 }, 38366 parseStartXRef: function PDFDocument_parseStartXRef() { 38367 var startXRef = this.startXRef; 38368 this.xref.setStartXRef(startXRef); 38369 }, 38370 setup: function PDFDocument_setup(recoveryMode) { 38371 this.xref.parse(recoveryMode); 38372 var self = this; 38373 var pageFactory = { 38374 createPage: function (pageIndex, dict, ref, fontCache, builtInCMapCache) { 38375 return new Page(self.pdfManager, self.xref, pageIndex, dict, ref, fontCache, builtInCMapCache); 38376 } 38377 }; 38378 this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory); 38379 }, 38380 get numPages() { 38381 var linearization = this.linearization; 38382 var num = linearization ? linearization.numPages : this.catalog.numPages; 38383 return shadow(this, 'numPages', num); 38384 }, 38385 get documentInfo() { 38386 var docInfo = { 38387 PDFFormatVersion: this.pdfFormatVersion, 38388 IsAcroFormPresent: !!this.acroForm, 38389 IsXFAPresent: !!this.xfa 38390 }; 38391 var infoDict; 38392 try { 38393 infoDict = this.xref.trailer.get('Info'); 38394 } catch (err) { 38395 info('The document information dictionary is invalid.'); 38396 } 38397 if (infoDict) { 38398 var validEntries = DocumentInfoValidators.entries; 38399 for (var key in validEntries) { 38400 if (infoDict.has(key)) { 38401 var value = infoDict.get(key); 38402 if (validEntries[key](value)) { 38403 docInfo[key] = typeof value !== 'string' ? value : stringToPDFString(value); 38404 } else { 38405 info('Bad value in document info for "' + key + '"'); 38406 } 38407 } 38408 } 38409 } 38410 return shadow(this, 'documentInfo', docInfo); 38411 }, 38412 get fingerprint() { 38413 var xref = this.xref, hash, fileID = ''; 38414 var idArray = xref.trailer.get('ID'); 38415 if (idArray && isArray(idArray) && idArray[0] && isString(idArray[0]) && idArray[0] !== EMPTY_FINGERPRINT) { 38416 hash = stringToBytes(idArray[0]); 38417 } else { 38418 if (this.stream.ensureRange) { 38419 this.stream.ensureRange(0, Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); 38420 } 38421 hash = calculateMD5(this.stream.bytes.subarray(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); 38422 } 38423 for (var i = 0, n = hash.length; i < n; i++) { 38424 var hex = hash[i].toString(16); 38425 fileID += hex.length === 1 ? '0' + hex : hex; 38426 } 38427 return shadow(this, 'fingerprint', fileID); 38428 }, 38429 getPage: function PDFDocument_getPage(pageIndex) { 38430 return this.catalog.getPage(pageIndex); 38431 }, 38432 cleanup: function PDFDocument_cleanup() { 38433 return this.catalog.cleanup(); 38434 } 38435 }; 38436 return PDFDocument; 38437}(); 38438exports.Page = Page; 38439exports.PDFDocument = PDFDocument; 38440 38441/***/ }), 38442/* 25 */ 38443/***/ (function(module, exports, __w_pdfjs_require__) { 38444 38445"use strict"; 38446 38447var sharedUtil = __w_pdfjs_require__(0); 38448var coreStream = __w_pdfjs_require__(2); 38449var coreGlyphList = __w_pdfjs_require__(7); 38450var coreEncodings = __w_pdfjs_require__(4); 38451var coreCFFParser = __w_pdfjs_require__(11); 38452var Util = sharedUtil.Util; 38453var bytesToString = sharedUtil.bytesToString; 38454var error = sharedUtil.error; 38455var Stream = coreStream.Stream; 38456var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode; 38457var StandardEncoding = coreEncodings.StandardEncoding; 38458var CFFParser = coreCFFParser.CFFParser; 38459var FontRendererFactory = function FontRendererFactoryClosure() { 38460 function getLong(data, offset) { 38461 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 38462 } 38463 function getUshort(data, offset) { 38464 return data[offset] << 8 | data[offset + 1]; 38465 } 38466 function parseCmap(data, start, end) { 38467 var offset = getUshort(data, start + 2) === 1 ? getLong(data, start + 8) : getLong(data, start + 16); 38468 var format = getUshort(data, start + offset); 38469 var ranges, p, i; 38470 if (format === 4) { 38471 getUshort(data, start + offset + 2); 38472 var segCount = getUshort(data, start + offset + 6) >> 1; 38473 p = start + offset + 14; 38474 ranges = []; 38475 for (i = 0; i < segCount; i++, p += 2) { 38476 ranges[i] = { end: getUshort(data, p) }; 38477 } 38478 p += 2; 38479 for (i = 0; i < segCount; i++, p += 2) { 38480 ranges[i].start = getUshort(data, p); 38481 } 38482 for (i = 0; i < segCount; i++, p += 2) { 38483 ranges[i].idDelta = getUshort(data, p); 38484 } 38485 for (i = 0; i < segCount; i++, p += 2) { 38486 var idOffset = getUshort(data, p); 38487 if (idOffset === 0) { 38488 continue; 38489 } 38490 ranges[i].ids = []; 38491 for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { 38492 ranges[i].ids[j] = getUshort(data, p + idOffset); 38493 idOffset += 2; 38494 } 38495 } 38496 return ranges; 38497 } else if (format === 12) { 38498 getLong(data, start + offset + 4); 38499 var groups = getLong(data, start + offset + 12); 38500 p = start + offset + 16; 38501 ranges = []; 38502 for (i = 0; i < groups; i++) { 38503 ranges.push({ 38504 start: getLong(data, p), 38505 end: getLong(data, p + 4), 38506 idDelta: getLong(data, p + 8) - getLong(data, p) 38507 }); 38508 p += 12; 38509 } 38510 return ranges; 38511 } 38512 error('not supported cmap: ' + format); 38513 } 38514 function parseCff(data, start, end, seacAnalysisEnabled) { 38515 var properties = {}; 38516 var parser = new CFFParser(new Stream(data, start, end - start), properties, seacAnalysisEnabled); 38517 var cff = parser.parse(); 38518 return { 38519 glyphs: cff.charStrings.objects, 38520 subrs: cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && cff.topDict.privateDict.subrsIndex.objects, 38521 gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects 38522 }; 38523 } 38524 function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { 38525 var itemSize, itemDecode; 38526 if (isGlyphLocationsLong) { 38527 itemSize = 4; 38528 itemDecode = function fontItemDecodeLong(data, offset) { 38529 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 38530 }; 38531 } else { 38532 itemSize = 2; 38533 itemDecode = function fontItemDecode(data, offset) { 38534 return data[offset] << 9 | data[offset + 1] << 1; 38535 }; 38536 } 38537 var glyphs = []; 38538 var startOffset = itemDecode(loca, 0); 38539 for (var j = itemSize; j < loca.length; j += itemSize) { 38540 var endOffset = itemDecode(loca, j); 38541 glyphs.push(glyf.subarray(startOffset, endOffset)); 38542 startOffset = endOffset; 38543 } 38544 return glyphs; 38545 } 38546 function lookupCmap(ranges, unicode) { 38547 var code = unicode.charCodeAt(0), gid = 0; 38548 var l = 0, r = ranges.length - 1; 38549 while (l < r) { 38550 var c = l + r + 1 >> 1; 38551 if (code < ranges[c].start) { 38552 r = c - 1; 38553 } else { 38554 l = c; 38555 } 38556 } 38557 if (ranges[l].start <= code && code <= ranges[l].end) { 38558 gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xFFFF; 38559 } 38560 return {
38561 charCode: code, 38562 glyphId: gid 38563 }; 38564 } 38565 function compileGlyf(code, cmds, font) { 38566 function moveTo(x, y) { 38567 cmds.push({ 38568 cmd: 'moveTo', 38569 args: [ 38570 x, 38571 y 38572 ] 38573 }); 38574 } 38575 function lineTo(x, y) { 38576 cmds.push({ 38577 cmd: 'lineTo', 38578 args: [ 38579 x, 38580 y 38581 ] 38582 }); 38583 } 38584 function quadraticCurveTo(xa, ya, x, y) { 38585 cmds.push({ 38586 cmd: 'quadraticCurveTo', 38587 args: [ 38588 xa, 38589 ya, 38590 x, 38591 y 38592 ] 38593 }); 38594 } 38595 var i = 0; 38596 var numberOfContours = (code[i] << 24 | code[i + 1] << 16) >> 16; 38597 var flags; 38598 var x = 0, y = 0; 38599 i += 10; 38600 if (numberOfContours < 0) { 38601 do { 38602 flags = code[i] << 8 | code[i + 1]; 38603 var glyphIndex = code[i + 2] << 8 | code[i + 3]; 38604 i += 4; 38605 var arg1, arg2; 38606 if (flags & 0x01) { 38607 arg1 = (code[i] << 24 | code[i + 1] << 16) >> 16; 38608 arg2 = (code[i + 2] << 24 | code[i + 3] << 16) >> 16; 38609 i += 4; 38610 } else { 38611 arg1 = code[i++]; 38612 arg2 = code[i++]; 38613 } 38614 if (flags & 0x02) { 38615 x = arg1; 38616 y = arg2; 38617 } else { 38618 x = 0; 38619 y = 0; 38620 } 38621 var scaleX = 1, scaleY = 1, scale01 = 0, scale10 = 0; 38622 if (flags & 0x08) { 38623 scaleX = scaleY = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38624 i += 2; 38625 } else if (flags & 0x40) { 38626 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38627 scaleY = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 38628 i += 4; 38629 } else if (flags & 0x80) { 38630 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 38631 scale01 = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 38632 scale10 = (code[i + 4] << 24 | code[i + 5] << 16) / 1073741824; 38633 scaleY = (code[i + 6] << 24 | code[i + 7] << 16) / 1073741824; 38634 i += 8; 38635 } 38636 var subglyph = font.glyphs[glyphIndex]; 38637 if (subglyph) { 38638 cmds.push({ cmd: 'save' }); 38639 cmds.push({ 38640 cmd: 'transform', 38641 args: [ 38642 scaleX, 38643 scale01, 38644 scale10, 38645 scaleY, 38646 x, 38647 y 38648 ] 38649 }); 38650 compileGlyf(subglyph, cmds, font); 38651 cmds.push({ cmd: 'restore' }); 38652 } 38653 } while (flags & 0x20); 38654 } else { 38655 var endPtsOfContours = []; 38656 var j, jj; 38657 for (j = 0; j < numberOfContours; j++) { 38658 endPtsOfContours.push(code[i] << 8 | code[i + 1]); 38659 i += 2; 38660 } 38661 var instructionLength = code[i] << 8 | code[i + 1]; 38662 i += 2 + instructionLength; 38663 var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; 38664 var points = []; 38665 while (points.length < numberOfPoints) { 38666 flags = code[i++]; 38667 var repeat = 1; 38668 if (flags & 0x08) { 38669 repeat += code[i++]; 38670 } 38671 while (repeat-- > 0) { 38672 points.push({ flags: flags }); 38673 } 38674 } 38675 for (j = 0; j < numberOfPoints; j++) { 38676 switch (points[j].flags & 0x12) { 38677 case 0x00: 38678 x += (code[i] << 24 | code[i + 1] << 16) >> 16; 38679 i += 2; 38680 break; 38681 case 0x02: 38682 x -= code[i++]; 38683 break; 38684 case 0x12: 38685 x += code[i++]; 38686 break; 38687 } 38688 points[j].x = x; 38689 } 38690 for (j = 0; j < numberOfPoints; j++) { 38691 switch (points[j].flags & 0x24) { 38692 case 0x00: 38693 y += (code[i] << 24 | code[i + 1] << 16) >> 16; 38694 i += 2; 38695 break; 38696 case 0x04: 38697 y -= code[i++]; 38698 break; 38699 case 0x24: 38700 y += code[i++]; 38701 break; 38702 } 38703 points[j].y = y; 38704 } 38705 var startPoint = 0; 38706 for (i = 0; i < numberOfContours; i++) { 38707 var endPoint = endPtsOfContours[i]; 38708 var contour = points.slice(startPoint, endPoint + 1); 38709 if (contour[0].flags & 1) { 38710 contour.push(contour[0]); 38711 } else if (contour[contour.length - 1].flags & 1) { 38712 contour.unshift(contour[contour.length - 1]); 38713 } else { 38714 var p = { 38715 flags: 1, 38716 x: (contour[0].x + contour[contour.length - 1].x) / 2, 38717 y: (contour[0].y + contour[contour.length - 1].y) / 2 38718 }; 38719 contour.unshift(p); 38720 contour.push(p); 38721 } 38722 moveTo(contour[0].x, contour[0].y); 38723 for (j = 1, jj = contour.length; j < jj; j++) { 38724 if (contour[j].flags & 1) { 38725 lineTo(contour[j].x, contour[j].y); 38726 } else if (contour[j + 1].flags & 1) { 38727 quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y); 38728 j++; 38729 } else { 38730 quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2); 38731 } 38732 } 38733 startPoint = endPoint + 1; 38734 } 38735 } 38736 } 38737 function compileCharString(code, cmds, font) { 38738 var stack = []; 38739 var x = 0, y = 0; 38740 var stems = 0; 38741 function moveTo(x, y) { 38742 cmds.push({ 38743 cmd: 'moveTo', 38744 args: [ 38745 x, 38746 y 38747 ] 38748 }); 38749 } 38750 function lineTo(x, y) { 38751 cmds.push({ 38752 cmd: 'lineTo', 38753 args: [ 38754 x, 38755 y 38756 ] 38757 }); 38758 } 38759 function bezierCurveTo(x1, y1, x2, y2, x, y) { 38760 cmds.push({ 38761 cmd: 'bezierCurveTo', 38762 args: [ 38763 x1, 38764 y1, 38765 x2, 38766 y2, 38767 x, 38768 y 38769 ] 38770 }); 38771 } 38772 function parse(code) { 38773 var i = 0; 38774 while (i < code.length) { 38775 var stackClean = false;
vendor: 7,552 bytes, lines 38776-39078
38776 var v = code[i++]; 38777 var xa, xb, ya, yb, y1, y2, y3, n, subrCode; 38778 switch (v) { 38779 case 1: 38780 stems += stack.length >> 1; 38781 stackClean = true; 38782 break; 38783 case 3: 38784 stems += stack.length >> 1; 38785 stackClean = true; 38786 break; 38787 case 4: 38788 y += stack.pop(); 38789 moveTo(x, y); 38790 stackClean = true; 38791 break; 38792 case 5: 38793 while (stack.length > 0) { 38794 x += stack.shift(); 38795 y += stack.shift(); 38796 lineTo(x, y); 38797 } 38798 break; 38799 case 6: 38800 while (stack.length > 0) { 38801 x += stack.shift(); 38802 lineTo(x, y); 38803 if (stack.length === 0) { 38804 break; 38805 } 38806 y += stack.shift(); 38807 lineTo(x, y); 38808 } 38809 break; 38810 case 7: 38811 while (stack.length > 0) { 38812 y += stack.shift(); 38813 lineTo(x, y); 38814 if (stack.length === 0) { 38815 break; 38816 } 38817 x += stack.shift(); 38818 lineTo(x, y); 38819 } 38820 break; 38821 case 8: 38822 while (stack.length > 0) { 38823 xa = x + stack.shift(); 38824 ya = y + stack.shift(); 38825 xb = xa + stack.shift(); 38826 yb = ya + stack.shift(); 38827 x = xb + stack.shift(); 38828 y = yb + stack.shift(); 38829 bezierCurveTo(xa, ya, xb, yb, x, y); 38830 } 38831 break; 38832 case 10: 38833 n = stack.pop() + font.subrsBias; 38834 subrCode = font.subrs[n]; 38835 if (subrCode) { 38836 parse(subrCode); 38837 } 38838 break; 38839 case 11: 38840 return; 38841 case 12: 38842 v = code[i++]; 38843 switch (v) { 38844 case 34: 38845 xa = x + stack.shift(); 38846 xb = xa + stack.shift(); 38847 y1 = y + stack.shift(); 38848 x = xb + stack.shift(); 38849 bezierCurveTo(xa, y, xb, y1, x, y1); 38850 xa = x + stack.shift(); 38851 xb = xa + stack.shift(); 38852 x = xb + stack.shift(); 38853 bezierCurveTo(xa, y1, xb, y, x, y); 38854 break; 38855 case 35: 38856 xa = x + stack.shift(); 38857 ya = y + stack.shift(); 38858 xb = xa + stack.shift(); 38859 yb = ya + stack.shift(); 38860 x = xb + stack.shift(); 38861 y = yb + stack.shift(); 38862 bezierCurveTo(xa, ya, xb, yb, x, y); 38863 xa = x + stack.shift(); 38864 ya = y + stack.shift(); 38865 xb = xa + stack.shift(); 38866 yb = ya + stack.shift(); 38867 x = xb + stack.shift(); 38868 y = yb + stack.shift(); 38869 bezierCurveTo(xa, ya, xb, yb, x, y); 38870 stack.pop(); 38871 break; 38872 case 36: 38873 xa = x + stack.shift(); 38874 y1 = y + stack.shift(); 38875 xb = xa + stack.shift(); 38876 y2 = y1 + stack.shift(); 38877 x = xb + stack.shift(); 38878 bezierCurveTo(xa, y1, xb, y2, x, y2); 38879 xa = x + stack.shift(); 38880 xb = xa + stack.shift(); 38881 y3 = y2 + stack.shift(); 38882 x = xb + stack.shift(); 38883 bezierCurveTo(xa, y2, xb, y3, x, y); 38884 break; 38885 case 37: 38886 var x0 = x, y0 = y; 38887 xa = x + stack.shift(); 38888 ya = y + stack.shift(); 38889 xb = xa + stack.shift(); 38890 yb = ya + stack.shift(); 38891 x = xb + stack.shift(); 38892 y = yb + stack.shift(); 38893 bezierCurveTo(xa, ya, xb, yb, x, y); 38894 xa = x + stack.shift(); 38895 ya = y + stack.shift(); 38896 xb = xa + stack.shift(); 38897 yb = ya + stack.shift(); 38898 x = xb; 38899 y = yb; 38900 if (Math.abs(x - x0) > Math.abs(y - y0)) { 38901 x += stack.shift(); 38902 } else { 38903 y += stack.shift(); 38904 } 38905 bezierCurveTo(xa, ya, xb, yb, x, y); 38906 break; 38907 default: 38908 error('unknown operator: 12 ' + v); 38909 } 38910 break; 38911 case 14: 38912 if (stack.length >= 4) { 38913 var achar = stack.pop(); 38914 var bchar = stack.pop(); 38915 y = stack.pop(); 38916 x = stack.pop(); 38917 cmds.push({ cmd: 'save' }); 38918 cmds.push({ 38919 cmd: 'translate', 38920 args: [ 38921 x, 38922 y 38923 ] 38924 }); 38925 var cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]])); 38926 compileCharString(font.glyphs[cmap.glyphId], cmds, font); 38927 cmds.push({ cmd: 'restore' }); 38928 cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]])); 38929 compileCharString(font.glyphs[cmap.glyphId], cmds, font); 38930 } 38931 return; 38932 case 18: 38933 stems += stack.length >> 1; 38934 stackClean = true; 38935 break; 38936 case 19: 38937 stems += stack.length >> 1; 38938 i += stems + 7 >> 3; 38939 stackClean = true; 38940 break; 38941 case 20: 38942 stems += stack.length >> 1; 38943 i += stems + 7 >> 3; 38944 stackClean = true; 38945 break; 38946 case 21: 38947 y += stack.pop(); 38948 x += stack.pop(); 38949 moveTo(x, y); 38950 stackClean = true; 38951 break; 38952 case 22: 38953 x += stack.pop(); 38954 moveTo(x, y); 38955 stackClean = true; 38956 break; 38957 case 23: 38958 stems += stack.length >> 1; 38959 stackClean = true; 38960 break; 38961 case 24: 38962 while (stack.length > 2) { 38963 xa = x + stack.shift(); 38964 ya = y + stack.shift(); 38965 xb = xa + stack.shift(); 38966 yb = ya + stack.shift(); 38967 x = xb + stack.shift(); 38968 y = yb + stack.shift(); 38969 bezierCurveTo(xa, ya, xb, yb, x, y); 38970 } 38971 x += stack.shift(); 38972 y += stack.shift(); 38973 lineTo(x, y); 38974 break; 38975 case 25: 38976 while (stack.length > 6) { 38977 x += stack.shift(); 38978 y += stack.shift(); 38979 lineTo(x, y); 38980 } 38981 xa = x + stack.shift(); 38982 ya = y + stack.shift(); 38983 xb = xa + stack.shift(); 38984 yb = ya + stack.shift(); 38985 x = xb + stack.shift(); 38986 y = yb + stack.shift(); 38987 bezierCurveTo(xa, ya, xb, yb, x, y); 38988 break; 38989 case 26: 38990 if (stack.length % 2) { 38991 x += stack.shift(); 38992 } 38993 while (stack.length > 0) { 38994 xa = x; 38995 ya = y + stack.shift(); 38996 xb = xa + stack.shift(); 38997 yb = ya + stack.shift(); 38998 x = xb; 38999 y = yb + stack.shift(); 39000 bezierCurveTo(xa, ya, xb, yb, x, y); 39001 } 39002 break; 39003 case 27: 39004 if (stack.length % 2) { 39005 y += stack.shift(); 39006 } 39007 while (stack.length > 0) { 39008 xa = x + stack.shift(); 39009 ya = y; 39010 xb = xa + stack.shift(); 39011 yb = ya + stack.shift(); 39012 x = xb + stack.shift(); 39013 y = yb; 39014 bezierCurveTo(xa, ya, xb, yb, x, y); 39015 } 39016 break; 39017 case 28: 39018 stack.push((code[i] << 24 | code[i + 1] << 16) >> 16); 39019 i += 2; 39020 break; 39021 case 29: 39022 n = stack.pop() + font.gsubrsBias; 39023 subrCode = font.gsubrs[n]; 39024 if (subrCode) { 39025 parse(subrCode); 39026 } 39027 break; 39028 case 30: 39029 while (stack.length > 0) { 39030 xa = x; 39031 ya = y + stack.shift(); 39032 xb = xa + stack.shift(); 39033 yb = ya + stack.shift(); 39034 x = xb + stack.shift(); 39035 y = yb + (stack.length === 1 ? stack.shift() : 0); 39036 bezierCurveTo(xa, ya, xb, yb, x, y); 39037 if (stack.length === 0) { 39038 break; 39039 } 39040 xa = x + stack.shift(); 39041 ya = y; 39042 xb = xa + stack.shift(); 39043 yb = ya + stack.shift(); 39044 y = yb + stack.shift(); 39045 x = xb + (stack.length === 1 ? stack.shift() : 0); 39046 bezierCurveTo(xa, ya, xb, yb, x, y); 39047 } 39048 break; 39049 case 31: 39050 while (stack.length > 0) { 39051 xa = x + stack.shift(); 39052 ya = y; 39053 xb = xa + stack.shift(); 39054 yb = ya + stack.shift(); 39055 y = yb + stack.shift(); 39056 x = xb + (stack.length === 1 ? stack.shift() : 0); 39057 bezierCurveTo(xa, ya, xb, yb, x, y); 39058 if (stack.length === 0) { 39059 break; 39060 } 39061 xa = x; 39062 ya = y + stack.shift(); 39063 xb = xa + stack.shift(); 39064 yb = ya + stack.shift(); 39065 x = xb + stack.shift(); 39066 y = yb + (stack.length === 1 ? stack.shift() : 0); 39067 bezierCurveTo(xa, ya, xb, yb, x, y); 39068 } 39069 break; 39070 default: 39071 if (v < 32) { 39072 error('unknown operator: ' + v); 39073 } 39074 if (v < 247) { 39075 stack.push(v - 139); 39076 } else if (v < 251) { 39077 stack.push((v - 247) * 256 + code[i++] + 108); 39078 } else if (v < 255) {
39079 stack.push(-(v - 251) * 256 - code[i++] - 108); 39080 } else { 39081 stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536); 39082 i += 4; 39083 } 39084 break; 39085 } 39086 if (stackClean) { 39087 stack.length = 0; 39088 } 39089 } 39090 } 39091 parse(code); 39092 } 39093 var noop = ''; 39094 function CompiledFont(fontMatrix) { 39095 this.compiledGlyphs = Object.create(null); 39096 this.compiledCharCodeToGlyphId = Object.create(null); 39097 this.fontMatrix = fontMatrix; 39098 } 39099 CompiledFont.prototype = { 39100 getPathJs: function (unicode) { 39101 var cmap = lookupCmap(this.cmap, unicode); 39102 var fn = this.compiledGlyphs[cmap.glyphId]; 39103 if (!fn) { 39104 fn = this.compileGlyph(this.glyphs[cmap.glyphId]); 39105 this.compiledGlyphs[cmap.glyphId] = fn; 39106 } 39107 if (this.compiledCharCodeToGlyphId[cmap.charCode] === undefined) { 39108 this.compiledCharCodeToGlyphId[cmap.charCode] = cmap.glyphId; 39109 } 39110 return fn; 39111 }, 39112 compileGlyph: function (code) { 39113 if (!code || code.length === 0 || code[0] === 14) { 39114 return noop; 39115 } 39116 var cmds = []; 39117 cmds.push({ cmd: 'save' }); 39118 cmds.push({ 39119 cmd: 'transform', 39120 args: this.fontMatrix.slice() 39121 }); 39122 cmds.push({ 39123 cmd: 'scale', 39124 args: [ 39125 'size', 39126 '-size' 39127 ] 39128 }); 39129 this.compileGlyphImpl(code, cmds); 39130 cmds.push({ cmd: 'restore' }); 39131 return cmds; 39132 }, 39133 compileGlyphImpl: function () { 39134 error('Children classes should implement this.'); 39135 }, 39136 hasBuiltPath: function (unicode) { 39137 var cmap = lookupCmap(this.cmap, unicode); 39138 return this.compiledGlyphs[cmap.glyphId] !== undefined && this.compiledCharCodeToGlyphId[cmap.charCo
39138de] !== undefined; 39139 } 39140 }; 39141 function TrueTypeCompiled(glyphs, cmap, fontMatrix) { 39142 fontMatrix = fontMatrix || [ 39143 0.000488, 39144 0, 39145 0, 39146 0.000488, 39147 0, 39148 0 39149 ]; 39150 CompiledFont.call(this, fontMatrix); 39151 this.glyphs = glyphs; 39152 this.cmap = cmap; 39153 } 39154 Util.inherit(TrueTypeCompiled, CompiledFont, { 39155 compileGlyphImpl: function (code, cmds) { 39156 compileGlyf(code, cmds, this); 39157 } 39158 }); 39159 function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { 39160 fontMatrix = fontMatrix || [ 39161 0.001, 39162 0, 39163 0, 39164 0.001, 39165 0, 39166 0 39167 ]; 39168 CompiledFont.call(this, fontMatrix); 39169 this.glyphs = cffInfo.glyphs; 39170 this.gsubrs = cffInfo.gsubrs || []; 39171 this.subrs = cffInfo.subrs || []; 39172 this.cmap = cmap; 39173 this.glyphNameMap = glyphNameMap || getGlyphsUnicode(); 39174 this.gsubrsBias = this.gsubrs.length < 1240 ? 107 : this.gsubrs.length < 33900 ? 1131 : 32768; 39175 this.subrsBias = this.subrs.length < 1240 ? 107 : this.subrs.length < 33900 ? 1131 : 32768; 39176 } 39177 Util.inherit(Type2Compiled, CompiledFont, { 39178 compileGlyphImpl: function (code, cmds) { 39179 compileCharString(code, cmds, this); 39180 } 39181 }); 39182 return { 39183 create: function FontRendererFactory_create(font, seacAnalysisEnabled) { 39184 var data = new Uint8Array(font.data); 39185 var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; 39186 var numTables = getUshort(data, 4); 39187 for (var i = 0, p = 12; i < numTables; i++, p += 16) { 39188 var tag = bytesToString(data.subarray(p, p + 4)); 39189 var offset = getLong(data, p + 8); 39190 var length = getLong(data, p + 12); 39191 switch (tag) { 39192 case 'cmap': 39193 cmap = parseCmap(data, offset, offset + length); 39194 break; 39195 case 'glyf': 39196 glyf = data.subarray(offset, offset + length); 39197 break; 39198 case 'loca': 39199 loca = data.subarray(offset, offset + length); 39200 break; 39201 case 'head': 39202 unitsPerEm = getUshort(data, offset + 18); 39203 indexToLocFormat = getUshort(data, offset + 50); 39204 break; 39205 case 'CFF ': 39206 cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); 39207 break; 39208 } 39209 } 39210 if (glyf) { 39211 var fontMatrix = !unitsPerEm ? font.fontMatrix : [ 39212 1 / unitsPerEm, 39213 0, 39214 0, 39215 1 / unitsPerEm, 39216 0, 39217 0 39218 ]; 39219 return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); 39220 } 39221 return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); 39222 } 39223 }; 39224}(); 39225exports.FontRendererFactory = FontRendererFactory; 39226 39227/***/ }), 39228/* 26 */ 39229/***/ (function(module, exports, __w_pdfjs_require__) { 39230 39231"use strict"; 39232 39233var sharedUtil = __w_pdfjs_require__(0); 39234var corePrimitives = __w_pdfjs_require__(1); 39235var coreStream = __w_pdfjs_require__(2); 39236var coreGlyphList = __w_pdfjs_require__(7); 39237var coreFontRenderer = __w_pdfjs_require__(25); 39238var coreEncodings = __w_pdfjs_require__(4); 39239var coreStandardFonts = __w_pdfjs_require__(17); 39240var coreUnicode = __w_pdfjs_require__(18); 39241var coreType1Parser = __w_pdfjs_require__(35); 39242var coreCFFParser = __w_pdfjs_require__(11); 39243var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX; 39244var FontType = sharedUtil.FontType; 39245var assert = sharedUtil.assert; 39246var bytesToString = sharedUtil.bytesToString; 39247var error = sharedUtil.error; 39248var info = sharedUtil.info; 39249var isArray = sharedUtil.isArray; 39250var isInt = sharedUtil.isInt; 39251var isNum = sharedUtil.isNum; 39252var readUint32 = sharedUtil.readUint32; 39253var shadow = sharedUtil.shadow; 39254var string32 = sharedUtil.string32; 39255var warn = sharedUtil.warn; 39256var MissingDataException = sharedUtil.MissingDataException; 39257var isSpace = sharedUtil.isSpace; 39258var Stream = coreStream.Stream; 39259var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode; 39260var getDingbatsGlyphsUnicode = coreGlyphList.getDingbatsGlyphsUnicode; 39261var FontRendererFactory = coreFontRenderer.FontRendererFactory; 39262var StandardEncoding = coreEncodings.StandardEncoding; 39263var MacRomanEncoding = coreEncodings.MacRomanEncoding; 39264var SymbolSetEncoding = coreEncodings.SymbolSetEncoding; 39265var ZapfDingbatsEncoding = coreEncodings.ZapfDingbatsEncoding; 39266var getEncoding = coreEncodings.getEncoding; 39267var getStdFontMap = coreStandardFonts.getStdFontMap; 39268var getNonStdFontMap = coreStandardFonts.getNonStdFontMap; 39269var getGlyphMapForStandardFonts = coreStandardFonts.getGlyphMapForStandardFonts; 39270var getSupplementalGlyphMapForArialBlack = coreStandardFonts.getSupplementalGlyphMapForArialBlack; 39271var getUnicodeRangeFor = coreUnicode.getUnicodeRangeFor; 39272var mapSpecialUnicodeValues = coreUnicode.mapSpecialUnicodeValues; 39273var getUnicodeForGlyph = coreUnicode.getUnicodeForGlyph; 39274var Type1Parser = coreType1Parser.Type1Parser; 39275var CFFStandardStrings = coreCFFParser.CFFStandardStrings; 39276var CFFParser = coreCFFParser.CFFParser; 39277var CFFCompiler = coreCFFParser.CFFCompiler; 39278var CFF = coreCFFParser.CFF; 39279var CFFHeader = coreCFFParser.CFFHeader; 39280var CFFTopDict = coreCFFParser.CFFTopDict;
39281var CFFPrivateDict = coreCFFParser.CFFPrivateDict; 39282var CFFStrings = coreCFFParser.CFFStrings; 39283var CFFIndex = coreCFFParser.CFFIndex; 39284var CFFCharset = coreCFFParser.CFFCharset; 39285var PRIVATE_USE_OFFSET_START = 0xE000; 39286var PRIVATE_USE_OFFSET_END = 0xF8FF; 39287var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false; 39288var PDF_GLYPH_SPACE_UNITS = 1000; 39289var SEAC_ANALYSIS_ENABLED = false; 39290var FontFlags = { 39291 FixedPitch: 1, 39292 Serif: 2, 39293 Symbolic: 4, 39294 Script: 8, 39295 Nonsymbolic: 32, 39296 Italic: 64, 39297 AllCap: 65536, 39298 SmallCap: 131072, 39299 ForceBold: 262144 39300}; 39301var MacStandardGlyphOrdering = [ 39302 '.notdef', 39303 '.null', 39304 'nonmarkingreturn', 39305 'space', 39306 'exclam', 39307 'quotedbl', 39308 'numbersign', 39309 'dollar', 39310 'percent', 39311 'ampersand', 39312 'quotesingle', 39313 'parenleft', 39314 'parenright', 39315 'asterisk', 39316 'plus', 39317 'comma', 39318 'hyphen', 39319 'period', 39320 'slash', 39321 'zero', 39322 'one', 39323 'two', 39324 'three', 39325 'four', 39326 'five', 39327 'six', 39328 'seven', 39329 'eight', 39330 'nine', 39331 'colon', 39332 'semicolon', 39333 'less', 39334 'equal', 39335 'greater', 39336 'question', 39337 'at', 39338 'A', 39339 'B', 39340 'C', 39341 'D', 39342 'E', 39343 'F', 39344 'G', 39345 'H', 39346 'I', 39347 'J', 39348 'K', 39349 'L', 39350 'M', 39351 'N', 39352 'O', 39353 'P', 39354 'Q', 39355 'R', 39356 'S', 39357 'T', 39358 'U', 39359 'V', 39360 'W', 39361 'X', 39362 'Y', 39363 'Z', 39364 'bracketleft', 39365 'backslash', 39366 'bracketright', 39367 'asciicircum', 39368 'underscore', 39369 'grave', 39370 'a', 39371 'b', 39372 'c', 39373 'd', 39374 'e', 39375 'f', 39376 'g', 39377 'h', 39378 'i', 39379 'j', 39380 'k', 39381 'l', 39382 'm', 39383 'n', 39384 'o', 39385 'p', 39386 'q', 39387 'r', 39388 's', 39389 't', 39390 'u', 39391 'v', 39392 'w', 39393 'x', 39394 'y', 39395 'z', 39396 'braceleft', 39397 'bar', 39398 'braceright', 39399 'asciitilde', 39400 'Adieresis', 39401 'Aring', 39402 'Ccedilla', 39403 'Eacute', 39404 'Ntilde', 39405 'Odieresis', 39406 'Udieresis', 39407 'aacute', 39408 'agrave', 39409 'acircumflex', 39410 'adieresis', 39411 'atilde', 39412 'aring', 39413 'ccedilla', 39414 'eacute', 39415 'egrave', 39416 'ecircumflex', 39417 'edieresis', 39418 'iacute', 39419 'igrave', 39420 'icircumflex', 39421 'idieresis', 39422 'ntilde', 39423 'oacute', 39424 'ograve', 39425 'ocircumflex', 39426 'odieresis', 39427 'otilde', 39428 'uacute', 39429 'ugrave', 39430 'ucircumflex', 39431 'udieresis', 39432 'dagger', 39433 'degree', 39434 'cent', 39435 'sterling', 39436 'section', 39437 'bullet', 39438 'paragraph', 39439 'germandbls', 39440 'registered', 39441 'copyright', 39442 'trademark', 39443 'acute', 39444 'dieresis', 39445 'notequal', 39446 'AE', 39447 'Oslash', 39448 'infinity', 39449 'plusminus', 39450 'lessequal', 39451 'greaterequal', 39452 'yen', 39453 'mu', 39454 'partialdiff', 39455 'summation', 39456 'product', 39457 'pi', 39458 'integral', 39459 'ordfeminine', 39460 'ordmasculine', 39461 'Omega', 39462 'ae', 39463 'oslash', 39464 'questiondown', 39465 'exclamdown', 39466 'logicalnot', 39467 'radical', 39468 'florin', 39469 'approxequal', 39470 'Delta', 39471 'guillemotleft', 39472 'guillemotright', 39473 'ellipsis', 39474 'nonbreakingspace', 39475 'Agrave', 39476 'Atilde', 39477 'Otilde', 39478 'OE', 39479 'oe', 39480 'endash', 39481 'emdash', 39482 'quotedblleft', 39483 'quotedblright', 39484 'quoteleft', 39485 'quoteright', 39486 'divide', 39487 'lozenge', 39488 'ydieresis', 39489 'Ydieresis', 39490 'fraction', 39491 'currency', 39492 'guilsinglleft', 39493 'guilsinglright', 39494 'fi', 39495 'fl', 39496 'daggerdbl', 39497 'periodcentered', 39498 'quotesinglbase', 39499 'quotedblbase', 39500 'perthousand', 39501 'Acircumflex', 39502 'Ecircumflex', 39503 'Aacute', 39504 'Edieresis', 39505 'Egrave', 39506 'Iacute', 39507 'Icircumflex', 39508 'Idieresis', 39509 'Igrave', 39510 'Oacute', 39511 'Ocircumflex', 39512 'apple', 39513 'Ograve', 39514 'Uacute', 39515 'Ucircumflex', 39516 'Ugrave', 39517 'dotlessi', 39518 'circumflex', 39519 'tilde', 39520 'macron', 39521 'breve', 39522 'dotaccent', 39523 'ring', 39524 'cedilla', 39525 'hungarumlaut', 39526 'ogonek', 39527 'caron', 39528 'Lslash', 39529 'lslash', 39530 'Scaron', 39531 'scaron', 39532 'Zcaron', 39533 'zcaron', 39534 'brokenbar', 39535 'Eth', 39536 'eth', 39537 'Yacute', 39538 'yacute', 39539 'Thorn', 39540 'thorn', 39541 'minus', 39542 'multiply', 39543 'onesuperior', 39544 'twosuperior', 39545 'threesuperior', 39546 'onehalf', 39547 'onequarter', 39548 'threequarters', 39549 'franc', 39550 'Gbreve', 39551 'gbreve', 39552 'Idotaccent', 39553 'Scedilla', 39554 'scedilla', 39555 'Cacute', 39556 'cacute', 39557 'Ccaron', 39558 'ccaron', 39559 'dcroat' 39560]; 39561function adjustWidths(properties) { 39562 if (!properties.fontMatrix) { 39563 return; 39564 } 39565 if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { 39566 return; 39567 } 39568 var scale = 0.001 / properties.fontMatrix[0]; 39569 var glyphsWidths = properties.widths; 39570 for (var glyph in glyphsWidths) { 39571 glyphsWidths[glyph] *= scale; 39572 } 39573 properties.defaultWidth *= scale; 39574} 39575function adjustToUnicode(properties, builtInEncoding) { 39576 if (properties.hasIncludedToUnicodeMap) { 39577 return; 39578 } 39579 if (properties.hasEncoding) { 39580 return; 39581 } 39582 if (builtInEncoding === properties.defaultEncoding) { 39583 return; 39584 } 39585 if (properties.toUnicode instanceof IdentityToUnicodeMap) { 39586 return; 39587 } 39588 var toUnicode = [], glyphsUnicodeMap = getGlyphsUnicode();
39589 for (var charCode in builtInEncoding) { 39590 var glyphName = builtInEncoding[charCode]; 39591 var unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); 39592 if (unicode !== -1) { 39593 toUnicode[charCode] = String.fromCharCode(unicode); 39594 } 39595 } 39596 properties.toUnicode.amend(toUnicode); 39597} 39598function getFontType(type, subtype) { 39599 switch (type) { 39600 case 'Type1': 39601 return subtype === 'Type1C' ? FontType.TYPE1C : FontType.TYPE1; 39602 case 'CIDFontType0': 39603 return subtype === 'CIDFontType0C' ? FontType.CIDFONTTYPE0C : FontType.CIDFONTTYPE0; 39604 case 'OpenType': 39605 return FontType.OPENTYPE; 39606 case 'TrueType': 39607 return FontType.TRUETYPE; 39608 case 'CIDFontType2': 39609 return FontType.CIDFONTTYPE2; 39610 case 'MMType1': 39611 return FontType.MMTYPE1; 39612 case 'Type0': 39613 return FontType.TYPE0; 39614 default: 39615 return FontType.UNKNOWN; 39616 } 39617} 39618function recoverGlyphName(name, glyphsUnicodeMap) { 39619 if (glyphsUnicodeMap[name] !== undefined) { 39620 return name; 39621 } 39622 var unicode = getUnicodeForGlyph(name, glyphsUnicodeMap); 39623 if (unicode !== -1) { 39624 for (var key in glyphsUnicodeMap) { 39625 if (glyphsUnicodeMap[key] === unicode) { 39626 return key; 39627 } 39628 } 39629 } 39630 info('Unable to recover a standard glyph name for: ' + name); 39631 return name; 39632} 39633var Glyph = function GlyphClosure() { 39634 function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 39635 this.fontChar = fontChar; 39636 this.unicode = unicode; 39637 this.accent = accent; 39638 this.width = width; 39639 this.vmetric = vmetric; 39640 this.operatorListId = operatorListId; 39641 this.isSpace = isSpace; 39642 this.isInFont = isInFont; 39643 } 39644 Glyph.prototype.matchesForCache = function (fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 39645 return this.fontChar === fontChar && this.unicode === unicode && this.accent === accent && this.width === width && this.vmetric === vmetric && this.operatorListId === operatorListId && this.isSpace === isSpace && this.isInFont === isInFont; 39646 }; 39647 return Glyph; 39648}(); 39649var ToUnicodeMap = function ToUnicodeMapClosure() { 39650 function ToUnicodeMap(cmap) { 39651 this._map = cmap; 39652 } 39653 ToUnicodeMap.prototype = { 39654 get length() { 39655 return this._map.length; 39656 }, 39657 forEach: function (callback) { 39658 for (var charCode in this._map) { 39659 callback(charCode, this._map[charCode].charCodeAt(0)); 39660 } 39661 }, 39662 has: function (i) { 39663 return this._map[i] !== undefined; 39664 }, 39665 get: function (i) { 39666 return this._map[i]; 39667 }, 39668 charCodeOf: function (v) { 39669 return this._map.indexOf(v); 39670 }, 39671 amend: function (map) { 39672 for (var charCode in map) { 39673 this._map[charCode] = map[charCode]; 39674 } 39675 } 39676 }; 39677 return ToUnicodeMap; 39678}(); 39679var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() { 39680 function IdentityToUnicodeMap(firstChar, lastChar) { 39681 this.firstChar = firstChar; 39682 this.lastChar = lastChar; 39683 } 39684 IdentityToUnicodeMap.prototype = { 39685 get length() { 39686 return this.lastChar + 1 - this.firstChar; 39687 }, 39688 forEach: function (callback) { 39689 for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { 39690 callback(i, i); 39691 } 39692 }, 39693 has: function (i) { 39694 return this.firstChar <= i && i <= this.lastChar; 39695 }, 39696 get: function (i) { 39697 if (this.firstChar <= i && i <= this.lastChar) { 39698 return String.fromCharCode(i); 39699 } 39700 return undefined; 39701 }, 39702 charCodeOf: function (v) { 39703 return isInt(v) && v >= this.firstChar && v <= this.lastChar ? v : -1; 39704 }, 39705 amend: function (map) { 39706 error('Should not call amend()'); 39707 } 39708 }; 39709 return IdentityToUnicodeMap; 39710}(); 39711var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() { 39712 function writeInt16(dest, offset, num) { 39713 dest[offset] = num >> 8 & 0xFF; 39714 dest[offset + 1] = num & 0xFF; 39715 } 39716 function writeInt32(dest, offset, num) { 39717 dest[offset] = num >> 24 & 0xFF; 39718 dest[offset + 1] = num >> 16 & 0xFF; 39719 dest[offset + 2] = num >> 8 & 0xFF; 39720 dest[offset + 3] = num & 0xFF; 39721 } 39722 function writeData(dest, offset, data) { 39723 var i, ii; 39724 if (data instanceof Uint8Array) { 39725 dest.set(data, offset); 39726 } else if (typeof data === 'string') { 39727 for (i = 0, ii = data.length; i < ii; i++) { 39728 dest[offset++] = data.charCodeAt(i) & 0xFF; 39729 } 39730 } else { 39731 for (i = 0, ii = data.length; i < ii; i++) { 39732 dest[offset++] = data[i] & 0xFF; 39733 } 39734 } 39735 } 39736 function OpenTypeFileBuilder(sfnt) { 39737 this.sfnt = sfnt; 39738 this.tables = Object.create(null); 39739 } 39740 OpenTypeFileBuilder.getSearchParams = function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { 39741 var maxPower2 = 1, log2 = 0; 39742 while ((maxPower2 ^ entriesCount) > maxPower2) { 39743 maxPower2 <<= 1; 39744 log2++; 39745 } 39746 var searchRange = maxPower2 * entrySize; 39747 return {
vendor: 5,225 bytes, lines 39748-39906
39748 range: searchRange, 39749 entry: log2, 39750 rangeShift: entrySize * entriesCount - searchRange 39751 }; 39752 }; 39753 var OTF_HEADER_SIZE = 12; 39754 var OTF_TABLE_ENTRY_SIZE = 16; 39755 OpenTypeFileBuilder.prototype = { 39756 toArray: function OpenTypeFileBuilder_toArray() { 39757 var sfnt = this.sfnt; 39758 var tables = this.tables; 39759 var tablesNames = Object.keys(tables); 39760 tablesNames.sort(); 39761 var numTables = tablesNames.length; 39762 var i, j, jj, table, tableName; 39763 var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; 39764 var tableOffsets = [offset]; 39765 for (i = 0; i < numTables; i++) { 39766 table = tables[tablesNames[i]]; 39767 var paddedLength = (table.length + 3 & ~3) >>> 0; 39768 offset += paddedLength; 39769 tableOffsets.push(offset); 39770 } 39771 var file = new Uint8Array(offset); 39772 for (i = 0; i < numTables; i++) { 39773 table = tables[tablesNames[i]]; 39774 writeData(file, tableOffsets[i], table); 39775 } 39776 if (sfnt === 'true') { 39777 sfnt = string32(0x00010000); 39778 } 39779 file[0] = sfnt.charCodeAt(0) & 0xFF; 39780 file[1] = sfnt.charCodeAt(1) & 0xFF; 39781 file[2] = sfnt.charCodeAt(2) & 0xFF; 39782 file[3] = sfnt.charCodeAt(3) & 0xFF; 39783 writeInt16(file, 4, numTables); 39784 var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); 39785 writeInt16(file, 6, searchParams.range); 39786 writeInt16(file, 8, searchParams.entry); 39787 writeInt16(file, 10, searchParams.rangeShift); 39788 offset = OTF_HEADER_SIZE; 39789 for (i = 0; i < numTables; i++) { 39790 tableName = tablesNames[i]; 39791 file[offset] = tableName.charCodeAt(0) & 0xFF; 39792 file[offset + 1] = tableName.charCodeAt(1) & 0xFF; 39793 file[offset + 2] = tableName.charCodeAt(2) & 0xFF; 39794 file[offset + 3] = tableName.charCodeAt(3) & 0xFF; 39795 var checksum = 0; 39796 for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { 39797 var quad = readUint32(file, j); 39798 checksum = checksum + quad >>> 0; 39799 } 39800 writeInt32(file, offset + 4, checksum); 39801 writeInt32(file, offset + 8, tableOffsets[i]); 39802 writeInt32(file, offset + 12, tables[tableName].length); 39803 offset += OTF_TABLE_ENTRY_SIZE; 39804 } 39805 return file; 39806 }, 39807 addTable: function OpenTypeFileBuilder_addTable(tag, data) { 39808 if (tag in this.tables) { 39809 throw new Error('Table ' + tag + ' already exists'); 39810 } 39811 this.tables[tag] = data; 39812 } 39813 }; 39814 return OpenTypeFileBuilder; 39815}(); 39816var ProblematicCharRanges = new Int32Array([ 39817 0x0000, 39818 0x0020, 39819 0x007F, 39820 0x00A1, 39821 0x00AD, 39822 0x00AE, 39823 0x0600, 39824 0x0780, 39825 0x08A0, 39826 0x10A0, 39827 0x1780, 39828 0x1800, 39829 0x1C00, 39830 0x1C50, 39831 0x2000, 39832 0x2010, 39833 0x2011, 39834 0x2012, 39835 0x2028, 39836 0x2030, 39837 0x205F, 39838 0x2070, 39839 0x25CC, 39840 0x25CD, 39841 0x3000, 39842 0x3001, 39843 0xAA60, 39844 0xAA80, 39845 0xFFF0, 39846 0x10000 39847]); 39848var Font = function FontClosure() { 39849 function Font(name, file, properties) { 39850 var charCode, glyphName, unicode; 39851 this.name = name; 39852 this.loadedName = properties.loadedName; 39853 this.isType3Font = properties.isType3Font; 39854 this.sizes = []; 39855 this.missingFile = false; 39856 this.glyphCache = Object.create(null); 39857 this.isSerifFont = !!(properties.flags & FontFlags.Serif); 39858 this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 39859 this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); 39860 var type = properties.type; 39861 var subtype = properties.subtype; 39862 this.type = type; 39863 this.fallbackName = this.isMonospace ? 'monospace' : this.isSerifFont ? 'serif' : 'sans-serif'; 39864 this.differences = properties.differences; 39865 this.widths = properties.widths; 39866 this.defaultWidth = properties.defaultWidth; 39867 this.composite = properties.composite; 39868 this.wideChars = properties.wideChars; 39869 this.cMap = properties.cMap; 39870 this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; 39871 this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; 39872 this.fontMatrix = properties.fontMatrix; 39873 this.bbox = properties.bbox; 39874 this.toUnicode = properties.toUnicode; 39875 this.toFontChar = []; 39876 if (properties.type === 'Type3') { 39877 for (charCode = 0; charCode < 256; charCode++) { 39878 this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode]; 39879 } 39880 this.fontType = FontType.TYPE3; 39881 return; 39882 } 39883 this.cidEncoding = properties.cidEncoding; 39884 this.vertical = properties.vertical; 39885 if (this.vertical) { 39886 this.vmetrics = properties.vmetrics; 39887 this.defaultVMetrics = properties.defaultVMetrics; 39888 } 39889 var glyphsUnicodeMap; 39890 if (!file || file.isEmpty) { 39891 if (file) { 39892 warn('Font file is empty in "' + name + '" (' + this.loadedName + ')'); 39893 } 39894 this.missingFile = true; 39895 var fontName = name.replace(/[,_]/g, '-'); 39896 var stdFontMap = getStdFontMap(), nonStdFontMap = getNonStdFontMap(); 39897 var isStandardFont = !!stdFontMap[fontName] || !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); 39898 fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; 39899 this.bold = fontName.search(/bold/gi) !== -1; 39900 this.italic = fontName.search(/oblique/gi) !== -1 || fontName.search(/italic/gi) !== -1; 39901 this.black = name.search(/Black/g) !== -1; 39902 this.remeasure = Object.keys(this.widths).length > 0; 39903 if (isStandardFont && type === 'CIDFontType2' && properties.cidEncoding.indexOf('Identity-') === 0) { 39904 var GlyphMapForStandardFonts = getGlyphMapForStandardFonts(); 39905 var map = []; 39906 for (charCode in GlyphMapForStandardFonts) {
39907 map[+charCode] = GlyphMapForStandardFonts[charCode]; 39908 } 39909 if (/Arial-?Black/i.test(name)) { 39910 var SupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack(); 39911 for (charCode in SupplementalGlyphMapForArialBlack) { 39912 map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; 39913 } 39914 } 39915 var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; 39916 if (!isIdentityUnicode) { 39917 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 39918 map[+charCode] = unicodeCharCode; 39919 }); 39920 } 39921 this.toFontChar = map; 39922 this.toUnicode = new ToUnicodeMap(map); 39923 } else if (/Symbol/i.test(fontName)) { 39924 this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), properties.differences); 39925 } else if (/Dingbats/i.test(fontName)) { 39926 if (/Wingdings/i.test(name)) { 39927 warn('Non-embedded Wingdings font, falling back to ZapfDingbats.'); 39928 } 39929 this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, getDingbatsGlyphsUnicode(), properties.differences); 39930 } else if (isStandardFont) { 39931 this.toFontChar = buildToFontChar(properties.defaultEncoding, getGlyphsUnicode(), properties.differences); 39932 } else { 39933 glyphsUnicodeMap = getGlyphsUnicode(); 39934 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 39935 if (!this.composite) { 39936 glyphName = properties.differences[charCode] || properties.defaultEncoding[charCode]; 39937 unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); 39938 if (unicode !== -1) { 39939 unicodeCharCode = unicode; 39940 } 39941 } 39942 this.toFontChar[charCode] = unicodeCharCode; 39943 }.bind(this)); 39944 } 39945 this.loadedName = fontName.split('-')[0]; 39946 this.loading = false; 39947 this.fontType = getFontType(type, subtype); 39948 return; 39949 } 39950 if (subtype === 'Type1C') { 39951 if (type !== 'Type1' && type !== 'MMType1') { 39952 if (isTrueTypeFile(file)) { 39953 subtype = 'TrueType'; 39954 } else { 39955 type = 'Type1'; 39956 } 39957 } else if (isOpenTypeFile(file)) { 39958 type = subtype = 'OpenType'; 39959 } 39960 } 39961 if (subtype === 'CIDFontType0C' && type !== 'CIDFontType0') { 39962 type = 'CIDFontType0'; 39963 } 39964 if (subtype === 'OpenType') { 39965 type = 'OpenType'; 39966 } 39967 if (type === 'CIDFontType0') { 39968 if (isType1File(file)) { 39969 subtype = 'CIDFontType0'; 39970 } else if (isOpenTypeFile(file)) { 39971 type = subtype = 'OpenType'; 39972 } else { 39973 subtype = 'CIDFontType0C'; 39974 } 39975 } 39976 var data; 39977 switch (type) { 39978 case 'MMType1': 39979 info('MMType1 font (' + name + '), falling back to Type1.'); 39980 case 'Type1': 39981 case 'CIDFontType0': 39982 this.mimetype = 'font/opentype'; 39983 var cff = subtype === 'Type1C' || subtype === 'CIDFontType0C' ? new CFFFont(file, properties) : new Type1Font(name, file, properties); 39984 adjustWidths(properties); 39985 data = this.convert(name, cff, properties); 39986 break; 39987 case 'OpenType': 39988 case 'TrueType': 39989 case 'CIDFontType2': 39990 this.mimetype = 'font/opentype'; 39991 data = this.checkAndRepair(name, file, properties); 39992 if (this.isOpenType) { 39993 adjustWidths(properties); 39994 type = 'OpenType'; 39995 } 39996 break; 39997 default: 39998 error('Font ' + type + ' is not supported'); 39999 break; 40000 } 40001 this.data = data; 40002 this.fontType = getFontType(type, subtype); 40003 this.fontMatrix = properties.fontMatrix; 40004 this.widths = properties.widths; 40005 this.defaultWidth = properties.defaultWidth; 40006 this.toUnicode = properties.toUnicode; 40007 this.encoding = properties.baseEncoding; 40008 this.seacMap = properties.seacMap; 40009 this.loading = true; 40010 } 40011 Font.getFontID = function () { 40012 var ID = 1; 40013 return function Font_getFontID() { 40014 return String(ID++); 40015 }; 40016 }(); 40017 function int16(b0, b1) { 40018 return (b0 << 8) + b1; 40019 } 40020 function signedInt16(b0, b1) { 40021 var value = (b0 << 8) + b1; 40022 return value & 1 << 15 ? value - 0x10000 : value; 40023 } 40024 function int32(b0, b1, b2, b3) { 40025 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 40026 } 40027 function string16(value) { 40028 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 40029 } 40030 function safeString16(value) { 40031 value = value > 0x7FFF ? 0x7FFF : value < -0x8000 ? -0x8000 : value; 40032 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 40033 } 40034 function isTrueTypeFile(file) { 40035 var header = file.peekBytes(4); 40036 return readUint32(header, 0) === 0x00010000; 40037 } 40038 function isOpenTypeFile(file) { 40039 var header = file.peekBytes(4); 40040 return bytesToString(header) === 'OTTO'; 40041 } 40042 function isType1File(file) { 40043 var header = file.peekBytes(2); 40044 if (header[0] === 0x25 && header[1] === 0x21) { 40045 return true; 40046 } 40047 if (header[0] === 0x80 && header[1] === 0x01) { 40048 return true; 40049 } 40050 return false;
vendor: 34,487 bytes, lines 40051-41290
40051 } 40052 function buildToFontChar(encoding, glyphsUnicodeMap, differences) { 40053 var toFontChar = [], unicode; 40054 for (var i = 0, ii = encoding.length; i < ii; i++) { 40055 unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); 40056 if (unicode !== -1) { 40057 toFontChar[i] = unicode; 40058 } 40059 } 40060 for (var charCode in differences) { 40061 unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); 40062 if (unicode !== -1) { 40063 toFontChar[+charCode] = unicode; 40064 } 40065 } 40066 return toFontChar; 40067 } 40068 function isProblematicUnicodeLocation(code) { 40069 var i = 0, j = ProblematicCharRanges.length - 1; 40070 while (i < j) { 40071 var c = i + j + 1 >> 1; 40072 if (code < ProblematicCharRanges[c]) { 40073 j = c - 1; 40074 } else { 40075 i = c; 40076 } 40077 } 40078 return !(i & 1); 40079 } 40080 function adjustMapping(charCodeToGlyphId, properties) { 40081 var toUnicode = properties.toUnicode; 40082 var isSymbolic = !!(properties.flags & FontFlags.Symbolic); 40083 var isIdentityUnicode = properties.toUnicode instanceof IdentityToUnicodeMap; 40084 var newMap = Object.create(null); 40085 var toFontChar = []; 40086 var usedFontCharCodes = []; 40087 var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START; 40088 for (var originalCharCode in charCodeToGlyphId) { 40089 originalCharCode |= 0; 40090 var glyphId = charCodeToGlyphId[originalCharCode]; 40091 var fontCharCode = originalCharCode; 40092 var hasUnicodeValue = false; 40093 if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { 40094 hasUnicodeValue = true; 40095 var unicode = toUnicode.get(fontCharCode); 40096 if (unicode.length === 1) { 40097 fontCharCode = unicode.charCodeAt(0); 40098 } 40099 } 40100 if ((usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || isSymbolic && !hasUnicodeValue) && nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { 40101 do { 40102 fontCharCode = nextAvailableFontCharCode++; 40103 if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) { 40104 fontCharCode = 0xF020; 40105 nextAvailableFontCharCode = fontCharCode + 1; 40106 } 40107 } while (usedFontCharCodes[fontCharCode] !== undefined && nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END); 40108 } 40109 newMap[fontCharCode] = glyphId; 40110 toFontChar[originalCharCode] = fontCharCode; 40111 usedFontCharCodes[fontCharCode] = true; 40112 } 40113 return { 40114 toFontChar: toFontChar, 40115 charCodeToGlyphId: newMap, 40116 nextAvailableFontCharCode: nextAvailableFontCharCode 40117 }; 40118 } 40119 function getRanges(glyphs, numGlyphs) { 40120 var codes = []; 40121 for (var charCode in glyphs) { 40122 if (glyphs[charCode] >= numGlyphs) { 40123 continue; 40124 } 40125 codes.push({ 40126 fontCharCode: charCode | 0, 40127 glyphId: glyphs[charCode] 40128 }); 40129 } 40130 codes.sort(function fontGetRangesSort(a, b) { 40131 return a.fontCharCode - b.fontCharCode; 40132 }); 40133 var ranges = []; 40134 var length = codes.length; 40135 for (var n = 0; n < length;) { 40136 var start = codes[n].fontCharCode; 40137 var codeIndices = [codes[n].glyphId]; 40138 ++n; 40139 var end = start; 40140 while (n < length && end + 1 === codes[n].fontCharCode) { 40141 codeIndices.push(codes[n].glyphId); 40142 ++end; 40143 ++n; 40144 if (end === 0xFFFF) { 40145 break; 40146 } 40147 } 40148 ranges.push([ 40149 start, 40150 end, 40151 codeIndices 40152 ]); 40153 } 40154 return ranges; 40155 } 40156 function createCmapTable(glyphs, numGlyphs) { 40157 var ranges = getRanges(glyphs, numGlyphs); 40158 var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; 40159 var cmap = '\x00\x00' + string16(numTables) + '\x00\x03' + '\x00\x01' + string32(4 + numTables * 8); 40160 var i, ii, j, jj; 40161 for (i = ranges.length - 1; i >= 0; --i) { 40162 if (ranges[i][0] <= 0xFFFF) { 40163 break; 40164 } 40165 } 40166 var bmpLength = i + 1; 40167 if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { 40168 ranges[i][1] = 0xFFFE; 40169 } 40170 var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; 40171 var segCount = bmpLength + trailingRangesCount; 40172 var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); 40173 var startCount = ''; 40174 var endCount = ''; 40175 var idDeltas = ''; 40176 var idRangeOffsets = ''; 40177 var glyphsIds = ''; 40178 var bias = 0; 40179 var range, start, end, codes; 40180 for (i = 0, ii = bmpLength; i < ii; i++) { 40181 range = ranges[i]; 40182 start = range[0]; 40183 end = range[1]; 40184 startCount += string16(start); 40185 endCount += string16(end); 40186 codes = range[2]; 40187 var contiguous = true; 40188 for (j = 1, jj = codes.length; j < jj; ++j) { 40189 if (codes[j] !== codes[j - 1] + 1) { 40190 contiguous = false; 40191 break; 40192 } 40193 } 40194 if (!contiguous) { 40195 var offset = (segCount - i) * 2 + bias * 2; 40196 bias += end - start + 1; 40197 idDeltas += string16(0); 40198 idRangeOffsets += string16(offset); 40199 for (j = 0, jj = codes.length; j < jj; ++j) { 40200 glyphsIds += string16(codes[j]); 40201 } 40202 } else { 40203 var startCode = codes[0]; 40204 idDeltas += string16(startCode - start & 0xFFFF); 40205 idRangeOffsets += string16(0); 40206 } 40207 } 40208 if (trailingRangesCount > 0) { 40209 endCount += '\xFF\xFF'; 40210 startCount += '\xFF\xFF'; 40211 idDeltas += '\x00\x01'; 40212 idRangeOffsets += '\x00\x00'; 40213 } 40214 var format314 = '\x00\x00' + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + '\x00\x00' + startCount + idDeltas + idRangeOffsets + glyphsIds; 40215 var format31012 = ''; 40216 var header31012 = ''; 40217 if (numTables > 1) { 40218 cmap += '\x00\x03' + '\x00\x0A' + string32(4 + numTables * 8 + 4 + format314.length); 40219 format31012 = ''; 40220 for (i = 0, ii = ranges.length; i < ii; i++) { 40221 range = ranges[i]; 40222 start = range[0]; 40223 codes = range[2]; 40224 var code = codes[0]; 40225 for (j = 1, jj = codes.length; j < jj; ++j) { 40226 if (codes[j] !== codes[j - 1] + 1) { 40227 end = range[0] + j - 1; 40228 format31012 += string32(start) + string32(end) + string32(code); 40229 start = end + 1; 40230 code = codes[j]; 40231 } 40232 } 40233 format31012 += string32(start) + string32(range[1]) + string32(code); 40234 } 40235 header31012 = '\x00\x0C' + '\x00\x00' + string32(format31012.length + 16) + '\x00\x00\x00\x00' + string32(format31012.length / 12); 40236 } 40237 return cmap + '\x00\x04' + string16(format314.length + 4) + format314 + header31012 + format31012; 40238 } 40239 function validateOS2Table(os2) { 40240 var stream = new Stream(os2.data); 40241 var version = stream.getUint16(); 40242 stream.getBytes(60); 40243 var selection = stream.getUint16(); 40244 if (version < 4 && selection & 0x0300) { 40245 return false; 40246 } 40247 var firstChar = stream.getUint16(); 40248 var lastChar = stream.getUint16(); 40249 if (firstChar > lastChar) { 40250 return false; 40251 } 40252 stream.getBytes(6); 40253 var usWinAscent = stream.getUint16(); 40254 if (usWinAscent === 0) { 40255 return false; 40256 } 40257 os2.data[8] = os2.data[9] = 0; 40258 return true; 40259 } 40260 function createOS2Table(properties, charstrings, override) { 40261 override = override || { 40262 unitsPerEm: 0, 40263 yMax: 0, 40264 yMin: 0, 40265 ascent: 0, 40266 descent: 0 40267 }; 40268 var ulUnicodeRange1 = 0; 40269 var ulUnicodeRange2 = 0; 40270 var ulUnicodeRange3 = 0; 40271 var ulUnicodeRange4 = 0; 40272 var firstCharIndex = null; 40273 var lastCharIndex = 0; 40274 if (charstrings) { 40275 for (var code in charstrings) { 40276 code |= 0; 40277 if (firstCharIndex > code || !firstCharIndex) { 40278 firstCharIndex = code; 40279 } 40280 if (lastCharIndex < code) { 40281 lastCharIndex = code; 40282 } 40283 var position = getUnicodeRangeFor(code); 40284 if (position < 32) { 40285 ulUnicodeRange1 |= 1 << position; 40286 } else if (position < 64) { 40287 ulUnicodeRange2 |= 1 << position - 32; 40288 } else if (position < 96) { 40289 ulUnicodeRange3 |= 1 << position - 64; 40290 } else if (position < 123) { 40291 ulUnicodeRange4 |= 1 << position - 96; 40292 } else { 40293 error('Unicode ranges Bits > 123 are reserved for internal usage'); 40294 } 40295 } 40296 } else { 40297 firstCharIndex = 0; 40298 lastCharIndex = 255; 40299 } 40300 var bbox = properties.bbox || [ 40301 0, 40302 0, 40303 0, 40304 0 40305 ]; 40306 var unitsPerEm = override.unitsPerEm || 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; 40307 var scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS; 40308 var typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3])); 40309 var typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1])); 40310 if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { 40311 typoDescent = -typoDescent; 40312 } 40313 var winAscent = override.yMax || typoAscent; 40314 var winDescent = -override.yMin || -typoDescent; 40315 return '\x00\x03' + '\x02\x24' + '\x01\xF4' + '\x00\x05' + '\x00\x00' + '\x02\x8A' + '\x02\xBB' + '\x00\x00' + '\x00\x8C' + '\x02\x8A' + '\x02\xBB' + '\x00\x00' + '\x01\xDF' + '\x00\x31' + '\x01\x02' + '\x00\x00' + '\x00\x00\x06' + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + '\x00\x00\x00\x00\x00\x00' + string32(ulUnicodeRange1) + string32(ulUnicodeRange2) + string32(ulUnicodeRange3) + string32(ulUnicodeRange4) + '\x2A\x32\x31\x2A' + string16(properties.italicAngle ? 1 : 0) + string16(firstCharIndex || properties.firstChar) + string16(lastCharIndex || properties.lastChar) + string16(typoAscent) + string16(typoDescent) + '\x00\x64' + string16(winAscent) + string16(winDescent) + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + string16(properties.xHeight) + string16(properties.capHeight) + string16(0) + string16(firstCharIndex || properties.firstChar) + '\x00\x03'; 40316 } 40317 function createPostTable(properties) { 40318 var angle = Math.floor(properties.italicAngle * Math.pow(2, 16)); 40319 return '\x00\x03\x00\x00' + string32(angle) + '\x00\x00' + '\x00\x00' + string32(properties.fixedPitch) + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + '\x00\x00\x00\x00'; 40320 } 40321 function createNameTable(name, proto) { 40322 if (!proto) { 40323 proto = [ 40324 [], 40325 [] 40326 ]; 40327 } 40328 var strings = [ 40329 proto[0][0] || 'Original licence', 40330 proto[0][1] || name, 40331 proto[0][2] || 'Unknown', 40332 proto[0][3] || 'uniqueID', 40333 proto[0][4] || name, 40334 proto[0][5] || 'Version 0.11', 40335 proto[0][6] || '', 40336 proto[0][7] || 'Unknown', 40337 proto[0][8] || 'Unknown', 40338 proto[0][9] || 'Unknown' 40339 ]; 40340 var stringsUnicode = []; 40341 var i, ii, j, jj, str; 40342 for (i = 0, ii = strings.length; i < ii; i++) { 40343 str = proto[1][i] || strings[i]; 40344 var strBufUnicode = []; 40345 for (j = 0, jj = str.length; j < jj; j++) { 40346 strBufUnicode.push(string16(str.charCodeAt(j))); 40347 } 40348 stringsUnicode.push(strBufUnicode.join('')); 40349 } 40350 var names = [ 40351 strings, 40352 stringsUnicode 40353 ]; 40354 var platforms = [ 40355 '\x00\x01', 40356 '\x00\x03' 40357 ]; 40358 var encodings = [ 40359 '\x00\x00', 40360 '\x00\x01' 40361 ]; 40362 var languages = [ 40363 '\x00\x00', 40364 '\x04\x09' 40365 ]; 40366 var namesRecordCount = strings.length * platforms.length; 40367 var nameTable = '\x00\x00' + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6); 40368 var strOffset = 0; 40369 for (i = 0, ii = platforms.length; i < ii; i++) { 40370 var strs = names[i]; 40371 for (j = 0, jj = strs.length; j < jj; j++) { 40372 str = strs[j]; 40373 var nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset); 40374 nameTable += nameRecord; 40375 strOffset += str.length; 40376 } 40377 } 40378 nameTable += strings.join('') + stringsUnicode.join(''); 40379 return nameTable; 40380 } 40381 Font.prototype = { 40382 name: null, 40383 font: null, 40384 mimetype: null, 40385 encoding: null, 40386 get renderer() { 40387 var renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); 40388 return shadow(this, 'renderer', renderer); 40389 }, 40390 exportData: function Font_exportData() { 40391 var data = {}; 40392 for (var i in this) { 40393 if (this.hasOwnProperty(i)) { 40394 data[i] = this[i]; 40395 } 40396 } 40397 return data; 40398 }, 40399 checkAndRepair: function Font_checkAndRepair(name, font, properties) { 40400 function readTableEntry(file) { 40401 var tag = bytesToString(file.getBytes(4)); 40402 var checksum = file.getInt32() >>> 0; 40403 var offset = file.getInt32() >>> 0; 40404 var length = file.getInt32() >>> 0; 40405 var previousPosition = file.pos; 40406 file.pos = file.start ? file.start : 0; 40407 file.skip(offset); 40408 var data = file.getBytes(length); 40409 file.pos = previousPosition; 40410 if (tag === 'head') { 40411 data[8] = data[9] = data[10] = data[11] = 0; 40412 data[17] |= 0x20; 40413 } 40414 return { 40415 tag: tag, 40416 checksum: checksum, 40417 length: length, 40418 offset: offset, 40419 data: data 40420 }; 40421 } 40422 function readOpenTypeHeader(ttf) { 40423 return { 40424 version: bytesToString(ttf.getBytes(4)), 40425 numTables: ttf.getUint16(), 40426 searchRange: ttf.getUint16(), 40427 entrySelector: ttf.getUint16(), 40428 rangeShift: ttf.getUint16() 40429 }; 40430 } 40431 function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { 40432 if (!cmap) { 40433 warn('No cmap table available.'); 40434 return { 40435 platformId: -1, 40436 encodingId: -1, 40437 mappings: [], 40438 hasShortCmap: false 40439 }; 40440 } 40441 var segment; 40442 var start = (font.start ? font.start : 0) + cmap.offset; 40443 font.pos = start; 40444 font.getUint16(); 40445 var numTables = font.getUint16(); 40446 var potentialTable; 40447 var canBreak = false; 40448 for (var i = 0; i < numTables; i++) { 40449 var platformId = font.getUint16(); 40450 var encodingId = font.getUint16(); 40451 var offset = font.getInt32() >>> 0; 40452 var useTable = false; 40453 if (platformId === 0 && encodingId === 0) { 40454 useTable = true; 40455 } else if (platformId === 1 && encodingId === 0) { 40456 useTable = true; 40457 } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) { 40458 useTable = true; 40459 if (!isSymbolicFont) { 40460 canBreak = true; 40461 } 40462 } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { 40463 useTable = true; 40464 canBreak = true; 40465 } 40466 if (useTable) { 40467 potentialTable = { 40468 platformId: platformId, 40469 encodingId: encodingId, 40470 offset: offset 40471 }; 40472 } 40473 if (canBreak) { 40474 break; 40475 } 40476 } 40477 if (potentialTable) { 40478 font.pos = start + potentialTable.offset; 40479 } 40480 if (!potentialTable || font.peekByte() === -1) { 40481 warn('Could not find a preferred cmap table.'); 40482 return { 40483 platformId: -1, 40484 encodingId: -1, 40485 mappings: [], 40486 hasShortCmap: false 40487 }; 40488 } 40489 var format = font.getUint16(); 40490 font.getUint16(); 40491 font.getUint16(); 40492 var hasShortCmap = false; 40493 var mappings = []; 40494 var j, glyphId; 40495 if (format === 0) { 40496 for (j = 0; j < 256; j++) { 40497 var index = font.getByte(); 40498 if (!index) { 40499 continue; 40500 } 40501 mappings.push({ 40502 charCode: j, 40503 glyphId: index 40504 }); 40505 } 40506 hasShortCmap = true; 40507 } else if (format === 4) { 40508 var segCount = font.getUint16() >> 1; 40509 font.getBytes(6); 40510 var segIndex, segments = []; 40511 for (segIndex = 0; segIndex < segCount; segIndex++) { 40512 segments.push({ end: font.getUint16() }); 40513 } 40514 font.getUint16(); 40515 for (segIndex = 0; segIndex < segCount; segIndex++) { 40516 segments[segIndex].start = font.getUint16(); 40517 } 40518 for (segIndex = 0; segIndex < segCount; segIndex++) { 40519 segments[segIndex].delta = font.getUint16(); 40520 } 40521 var offsetsCount = 0; 40522 for (segIndex = 0; segIndex < segCount; segIndex++) { 40523 segment = segments[segIndex]; 40524 var rangeOffset = font.getUint16(); 40525 if (!rangeOffset) { 40526 segment.offsetIndex = -1; 40527 continue; 40528 } 40529 var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); 40530 segment.offsetIndex = offsetIndex; 40531 offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1); 40532 } 40533 var offsets = []; 40534 for (j = 0; j < offsetsCount; j++) { 40535 offsets.push(font.getUint16()); 40536 } 40537 for (segIndex = 0; segIndex < segCount; segIndex++) { 40538 segment = segments[segIndex]; 40539 start = segment.start; 40540 var end = segment.end; 40541 var delta = segment.delta; 40542 offsetIndex = segment.offsetIndex; 40543 for (j = start; j <= end; j++) { 40544 if (j === 0xFFFF) { 40545 continue; 40546 } 40547 glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; 40548 glyphId = glyphId + delta & 0xFFFF; 40549 if (glyphId === 0) { 40550 continue; 40551 } 40552 mappings.push({ 40553 charCode: j, 40554 glyphId: glyphId 40555 }); 40556 } 40557 } 40558 } else if (format === 6) { 40559 var firstCode = font.getUint16(); 40560 var entryCount = font.getUint16(); 40561 for (j = 0; j < entryCount; j++) { 40562 glyphId = font.getUint16(); 40563 var charCode = firstCode + j; 40564 mappings.push({ 40565 charCode: charCode, 40566 glyphId: glyphId 40567 }); 40568 } 40569 } else { 40570 warn('cmap table has unsupported format: ' + format); 40571 return { 40572 platformId: -1, 40573 encodingId: -1, 40574 mappings: [], 40575 hasShortCmap: false 40576 }; 40577 } 40578 mappings.sort(function (a, b) { 40579 return a.charCode - b.charCode; 40580 }); 40581 for (i = 1; i < mappings.length; i++) { 40582 if (mappings[i - 1].charCode === mappings[i].charCode) { 40583 mappings.splice(i, 1); 40584 i--; 40585 } 40586 } 40587 return { 40588 platformId: potentialTable.platformId, 40589 encodingId: potentialTable.encodingId, 40590 mappings: mappings, 40591 hasShortCmap: hasShortCmap 40592 }; 40593 } 40594 function sanitizeMetrics(font, header, metrics, numGlyphs) { 40595 if (!header) { 40596 if (metrics) { 40597 metrics.data = null; 40598 } 40599 return; 40600 } 40601 font.pos = (font.start ? font.start : 0) + header.offset; 40602 font.pos += header.length - 2; 40603 var numOfMetrics = font.getUint16(); 40604 if (numOfMetrics > numGlyphs) { 40605 info('The numOfMetrics (' + numOfMetrics + ') should not be ' + 'greater than the numGlyphs (' + numGlyphs + ')'); 40606 numOfMetrics = numGlyphs; 40607 header.data[34] = (numOfMetrics & 0xff00) >> 8; 40608 header.data[35] = numOfMetrics & 0x00ff; 40609 } 40610 var numOfSidebearings = numGlyphs - numOfMetrics; 40611 var numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1); 40612 if (numMissing > 0) { 40613 var entries = new Uint8Array(metrics.length + numMissing * 2); 40614 entries.set(metrics.data); 40615 metrics.data = entries; 40616 } 40617 } 40618 function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { 40619 if (sourceEnd - sourceStart <= 12) { 40620 return 0; 40621 } 40622 var glyf = source.subarray(sourceStart, sourceEnd); 40623 var contoursCount = glyf[0] << 8 | glyf[1]; 40624 if (contoursCount & 0x8000) { 40625 dest.set(glyf, destStart); 40626 return glyf.length; 40627 } 40628 var i, j = 10, flagsCount = 0; 40629 for (i = 0; i < contoursCount; i++) { 40630 var endPoint = glyf[j] << 8 | glyf[j + 1]; 40631 flagsCount = endPoint + 1; 40632 j += 2; 40633 } 40634 var instructionsStart = j; 40635 var instructionsLength = glyf[j] << 8 | glyf[j + 1]; 40636 j += 2 + instructionsLength; 40637 var instructionsEnd = j; 40638 var coordinatesLength = 0; 40639 for (i = 0; i < flagsCount; i++) { 40640 var flag = glyf[j++]; 40641 if (flag & 0xC0) { 40642 glyf[j - 1] = flag & 0x3F; 40643 } 40644 var xyLength = (flag & 2 ? 1 : flag & 16 ? 0 : 2) + (flag & 4 ? 1 : flag & 32 ? 0 : 2); 40645 coordinatesLength += xyLength; 40646 if (flag & 8) { 40647 var repeat = glyf[j++]; 40648 i += repeat; 40649 coordinatesLength += repeat * xyLength; 40650 } 40651 } 40652 if (coordinatesLength === 0) { 40653 return 0; 40654 } 40655 var glyphDataLength = j + coordinatesLength; 40656 if (glyphDataLength > glyf.length) { 40657 return 0; 40658 } 40659 if (!hintsValid && instructionsLength > 0) { 40660 dest.set(glyf.subarray(0, instructionsStart), destStart); 40661 dest.set([ 40662 0, 40663 0 40664 ], destStart + instructionsStart); 40665 dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2); 40666 glyphDataLength -= instructionsLength; 40667 if (glyf.length - glyphDataLength > 3) { 40668 glyphDataLength = glyphDataLength + 3 & ~3; 40669 } 40670 return glyphDataLength; 40671 } 40672 if (glyf.length - glyphDataLength > 3) { 40673 glyphDataLength = glyphDataLength + 3 & ~3; 40674 dest.set(glyf.subarray(0, glyphDataLength), destStart); 40675 return glyphDataLength; 40676 } 40677 dest.set(glyf, destStart); 40678 return glyf.length; 40679 } 40680 function sanitizeHead(head, numGlyphs, locaLength) { 40681 var data = head.data; 40682 var version = int32(data[0], data[1], data[2], data[3]); 40683 if (version >> 16 !== 1) { 40684 info('Attempting to fix invalid version in head table: ' + version); 40685 data[0] = 0; 40686 data[1] = 1; 40687 data[2] = 0; 40688 data[3] = 0; 40689 } 40690 var indexToLocFormat = int16(data[50], data[51]); 40691 if (indexToLocFormat < 0 || indexToLocFormat > 1) { 40692 info('Attempting to fix invalid indexToLocFormat in head table: ' + indexToLocFormat); 40693 var numGlyphsPlusOne = numGlyphs + 1; 40694 if (locaLength === numGlyphsPlusOne << 1) { 40695 data[50] = 0; 40696 data[51] = 0; 40697 } else if (locaLength === numGlyphsPlusOne << 2) { 40698 data[50] = 0; 40699 data[51] = 1; 40700 } else { 40701 warn('Could not fix indexToLocFormat: ' + indexToLocFormat); 40702 } 40703 } 40704 } 40705 function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry) { 40706 var itemSize, itemDecode, itemEncode; 40707 if (isGlyphLocationsLong) { 40708 itemSize = 4; 40709 itemDecode = function fontItemDecodeLong(data, offset) { 40710 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 40711 }; 40712 itemEncode = function fontItemEncodeLong(data, offset, value) { 40713 data[offset] = value >>> 24 & 0xFF; 40714 data[offset + 1] = value >> 16 & 0xFF; 40715 data[offset + 2] = value >> 8 & 0xFF; 40716 data[offset + 3] = value & 0xFF; 40717 }; 40718 } else { 40719 itemSize = 2; 40720 itemDecode = function fontItemDecode(data, offset) { 40721 return data[offset] << 9 | data[offset + 1] << 1; 40722 }; 40723 itemEncode = function fontItemEncode(data, offset, value) { 40724 data[offset] = value >> 9 & 0xFF; 40725 data[offset + 1] = value >> 1 & 0xFF; 40726 }; 40727 } 40728 var locaData = loca.data; 40729 var locaDataSize = itemSize * (1 + numGlyphs); 40730 if (locaData.length !== locaDataSize) { 40731 locaData = new Uint8Array(locaDataSize); 40732 locaData.set(loca.data.subarray(0, locaDataSize)); 40733 loca.data = locaData; 40734 } 40735 var oldGlyfData = glyf.data; 40736 var oldGlyfDataLength = oldGlyfData.length; 40737 var newGlyfData = new Uint8Array(oldGlyfDataLength); 40738 var startOffset = itemDecode(locaData, 0); 40739 var writeOffset = 0; 40740 var missingGlyphData = Object.create(null); 40741 itemEncode(locaData, 0, writeOffset); 40742 var i, j; 40743 for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { 40744 var endOffset = itemDecode(locaData, j); 40745 if (endOffset > oldGlyfDataLength && (oldGlyfDataLength + 3 & ~3) === endOffset) { 40746 endOffset = oldGlyfDataLength; 40747 } 40748 if (endOffset > oldGlyfDataLength) { 40749 itemEncode(locaData, j, writeOffset); 40750 startOffset = endOffset; 40751 continue; 40752 } 40753 if (startOffset === endOffset) { 40754 missingGlyphData[i] = true; 40755 } 40756 var newLength = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); 40757 writeOffset += newLength; 40758 itemEncode(locaData, j, writeOffset); 40759 startOffset = endOffset; 40760 } 40761 if (writeOffset === 0) { 40762 var simpleGlyph = new Uint8Array([ 40763 0, 40764 1, 40765 0, 40766 0, 40767 0, 40768 0, 40769 0, 40770 0, 40771 0, 40772 0, 40773 0, 40774 0, 40775 0, 40776 0, 40777 49, 40778 0 40779 ]); 40780 for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { 40781 itemEncode(locaData, j, simpleGlyph.length); 40782 } 40783 glyf.data = simpleGlyph; 40784 return missingGlyphData; 40785 } 40786 if (dupFirstEntry) { 40787 var firstEntryLength = itemDecode(locaData, itemSize); 40788 if (newGlyfData.length > firstEntryLength + writeOffset) { 40789 glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); 40790 } else { 40791 glyf.data = new Uint8Array(firstEntryLength + writeOffset); 40792 glyf.data.set(newGlyfData.subarray(0, writeOffset)); 40793 } 40794 glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); 40795 itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength); 40796 } else { 40797 glyf.data = newGlyfData.subarray(0, writeOffset); 40798 } 40799 return missingGlyphData; 40800 } 40801 function readPostScriptTable(post, properties, maxpNumGlyphs) { 40802 var start = (font.start ? font.start : 0) + post.offset; 40803 font.pos = start; 40804 var length = post.length, end = start + length; 40805 var version = font.getInt32(); 40806 font.getBytes(28); 40807 var glyphNames; 40808 var valid = true; 40809 var i; 40810 switch (version) { 40811 case 0x00010000: 40812 glyphNames = MacStandardGlyphOrdering; 40813 break; 40814 case 0x00020000: 40815 var numGlyphs = font.getUint16(); 40816 if (numGlyphs !== maxpNumGlyphs) { 40817 valid = false; 40818 break; 40819 } 40820 var glyphNameIndexes = []; 40821 for (i = 0; i < numGlyphs; ++i) { 40822 var index = font.getUint16(); 40823 if (index >= 32768) { 40824 valid = false; 40825 break; 40826 } 40827 glyphNameIndexes.push(index); 40828 } 40829 if (!valid) { 40830 break; 40831 } 40832 var customNames = []; 40833 var strBuf = []; 40834 while (font.pos < end) { 40835 var stringLength = font.getByte(); 40836 strBuf.length = stringLength; 40837 for (i = 0; i < stringLength; ++i) { 40838 strBuf[i] = String.fromCharCode(font.getByte()); 40839 } 40840 customNames.push(strBuf.join('')); 40841 } 40842 glyphNames = []; 40843 for (i = 0; i < numGlyphs; ++i) { 40844 var j = glyphNameIndexes[i]; 40845 if (j < 258) { 40846 glyphNames.push(MacStandardGlyphOrdering[j]); 40847 continue; 40848 } 40849 glyphNames.push(customNames[j - 258]); 40850 } 40851 break; 40852 case 0x00030000: 40853 break; 40854 default: 40855 warn('Unknown/unsupported post table version ' + version); 40856 valid = false; 40857 if (properties.defaultEncoding) { 40858 glyphNames = properties.defaultEncoding; 40859 } 40860 break; 40861 } 40862 properties.glyphNames = glyphNames; 40863 return valid; 40864 } 40865 function readNameTable(nameTable) { 40866 var start = (font.start ? font.start : 0) + nameTable.offset; 40867 font.pos = start; 40868 var names = [ 40869 [], 40870 [] 40871 ]; 40872 var length = nameTable.length, end = start + length; 40873 var format = font.getUint16(); 40874 var FORMAT_0_HEADER_LENGTH = 6; 40875 if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { 40876 return names; 40877 } 40878 var numRecords = font.getUint16(); 40879 var stringsStart = font.getUint16(); 40880 var records = []; 40881 var NAME_RECORD_LENGTH = 12; 40882 var i, ii; 40883 for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { 40884 var r = { 40885 platform: font.getUint16(), 40886 encoding: font.getUint16(), 40887 language: font.getUint16(), 40888 name: font.getUint16(), 40889 length: font.getUint16(), 40890 offset: font.getUint16() 40891 }; 40892 if (r.platform === 1 && r.encoding === 0 && r.language === 0 || r.platform === 3 && r.encoding === 1 && r.language === 0x409) { 40893 records.push(r); 40894 } 40895 } 40896 for (i = 0, ii = records.length; i < ii; i++) { 40897 var record = records[i]; 40898 if (record.length <= 0) { 40899 continue; 40900 } 40901 var pos = start + stringsStart + record.offset; 40902 if (pos + record.length > end) { 40903 continue; 40904 } 40905 font.pos = pos; 40906 var nameIndex = record.name; 40907 if (record.encoding) { 40908 var str = ''; 40909 for (var j = 0, jj = record.length; j < jj; j += 2) { 40910 str += String.fromCharCode(font.getUint16()); 40911 } 40912 names[1][nameIndex] = str; 40913 } else { 40914 names[0][nameIndex] = bytesToString(font.getBytes(record.length)); 40915 } 40916 } 40917 return names; 40918 } 40919 var TTOpsStackDeltas = [ 40920 0, 40921 0, 40922 0, 40923 0, 40924 0, 40925 0, 40926 0, 40927 0, 40928 -2, 40929 -2, 40930 -2, 40931 -2, 40932 0, 40933 0, 40934 -2, 40935 -5, 40936 -1, 40937 -1, 40938 -1, 40939 -1, 40940 -1, 40941 -1, 40942 -1, 40943 -1, 40944 0, 40945 0, 40946 -1, 40947 0, 40948 -1, 40949 -1, 40950 -1, 40951 -1, 40952 1, 40953 -1, 40954 -999, 40955 0, 40956 1, 40957 0, 40958 -1, 40959 -2, 40960 0, 40961 -1, 40962 -2, 40963 -1, 40964 -1, 40965 0, 40966 -1, 40967 -1, 40968 0, 40969 0, 40970 -999, 40971 -999, 40972 -1, 40973 -1, 40974 -1, 40975 -1, 40976 -2, 40977 -999, 40978 -2, 40979 -2, 40980 -999, 40981 0, 40982 -2, 40983 -2, 40984 0, 40985 0, 40986 -2, 40987 0, 40988 -2, 40989 0, 40990 0, 40991 0, 40992 -2, 40993 -1, 40994 -1, 40995 1, 40996 1, 40997 0, 40998 0, 40999 -1, 41000 -1, 41001 -1, 41002 -1, 41003 -1, 41004 -1, 41005 -1, 41006 0, 41007 0, 41008 -1, 41009 0, 41010 -1, 41011 -1, 41012 0, 41013 -999, 41014 -1, 41015 -1, 41016 -1, 41017 -1, 41018 -1, 41019 -1, 41020 0, 41021 0, 41022 0, 41023 0, 41024 0, 41025 0, 41026 0, 41027 0, 41028 0, 41029 0, 41030 0, 41031 0, 41032 -2, 41033 -999, 41034 -999, 41035 -999, 41036 -999, 41037 -999, 41038 -1, 41039 -1, 41040 -2, 41041 -2, 41042 0, 41043 0, 41044 0, 41045 0, 41046 -1, 41047 -1, 41048 -999, 41049 -2, 41050 -2, 41051 0, 41052 0, 41053 -1, 41054 -2, 41055 -2, 41056 0, 41057 0, 41058 0, 41059 -1, 41060 -1, 41061 -1, 41062 -2 41063 ]; 41064 function sanitizeTTProgram(table, ttContext) { 41065 var data = table.data; 41066 var i = 0, j, n, b, funcId, pc, lastEndf = 0, lastDeff = 0; 41067 var stack = []; 41068 var callstack = []; 41069 var functionsCalled = []; 41070 var tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; 41071 var inFDEF = false, ifLevel = 0, inELSE = 0; 41072 for (var ii = data.length; i < ii;) { 41073 var op = data[i++]; 41074 if (op === 0x40) { 41075 n = data[i++]; 41076 if (inFDEF || inELSE) { 41077 i += n; 41078 } else { 41079 for (j = 0; j < n; j++) { 41080 stack.push(data[i++]); 41081 } 41082 } 41083 } else if (op === 0x41) { 41084 n = data[i++]; 41085 if (inFDEF || inELSE) { 41086 i += n * 2; 41087 } else { 41088 for (j = 0; j < n; j++) { 41089 b = data[i++]; 41090 stack.push(b << 8 | data[i++]); 41091 } 41092 } 41093 } else if ((op & 0xF8) === 0xB0) { 41094 n = op - 0xB0 + 1; 41095 if (inFDEF || inELSE) { 41096 i += n; 41097 } else { 41098 for (j = 0; j < n; j++) { 41099 stack.push(data[i++]); 41100 } 41101 } 41102 } else if ((op & 0xF8) === 0xB8) { 41103 n = op - 0xB8 + 1; 41104 if (inFDEF || inELSE) { 41105 i += n * 2; 41106 } else { 41107 for (j = 0; j < n; j++) { 41108 b = data[i++]; 41109 stack.push(b << 8 | data[i++]); 41110 } 41111 } 41112 } else if (op === 0x2B && !tooComplexToFollowFunctions) { 41113 if (!inFDEF && !inELSE) { 41114 funcId = stack[stack.length - 1]; 41115 ttContext.functionsUsed[funcId] = true; 41116 if (funcId in ttContext.functionsStackDeltas) { 41117 stack.length += ttContext.functionsStackDeltas[funcId]; 41118 } else if (funcId in ttContext.functionsDefined && functionsCalled.indexOf(funcId) < 0) { 41119 callstack.push({ 41120 data: data, 41121 i: i, 41122 stackTop: stack.length - 1 41123 }); 41124 functionsCalled.push(funcId); 41125 pc = ttContext.functionsDefined[funcId]; 41126 if (!pc) { 41127 warn('TT: CALL non-existent function'); 41128 ttContext.hintsValid = false; 41129 return; 41130 } 41131 data = pc.data; 41132 i = pc.i; 41133 } 41134 } 41135 } else if (op === 0x2C && !tooComplexToFollowFunctions) { 41136 if (inFDEF || inELSE) { 41137 warn('TT: nested FDEFs not allowed'); 41138 tooComplexToFollowFunctions = true; 41139 } 41140 inFDEF = true; 41141 lastDeff = i; 41142 funcId = stack.pop(); 41143 ttContext.functionsDefined[funcId] = { 41144 data: data, 41145 i: i 41146 }; 41147 } else if (op === 0x2D) { 41148 if (inFDEF) { 41149 inFDEF = false; 41150 lastEndf = i; 41151 } else { 41152 pc = callstack.pop(); 41153 if (!pc) { 41154 warn('TT: ENDF bad stack'); 41155 ttContext.hintsValid = false; 41156 return; 41157 } 41158 funcId = functionsCalled.pop(); 41159 data = pc.data; 41160 i = pc.i; 41161 ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; 41162 } 41163 } else if (op === 0x89) { 41164 if (inFDEF || inELSE) { 41165 warn('TT: nested IDEFs not allowed'); 41166 tooComplexToFollowFunctions = true; 41167 } 41168 inFDEF = true; 41169 lastDeff = i; 41170 } else if (op === 0x58) { 41171 ++ifLevel; 41172 } else if (op === 0x1B) { 41173 inELSE = ifLevel; 41174 } else if (op === 0x59) { 41175 if (inELSE === ifLevel) { 41176 inELSE = 0; 41177 } 41178 --ifLevel; 41179 } else if (op === 0x1C) { 41180 if (!inFDEF && !inELSE) { 41181 var offset = stack[stack.length - 1]; 41182 if (offset > 0) { 41183 i += offset - 1; 41184 } 41185 } 41186 } 41187 if (!inFDEF && !inELSE) { 41188 var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; 41189 if (op >= 0x71 && op <= 0x75) { 41190 n = stack.pop(); 41191 if (!isNaN(n)) { 41192 stackDelta = -n * 2; 41193 } 41194 } 41195 while (stackDelta < 0 && stack.length > 0) { 41196 stack.pop(); 41197 stackDelta++; 41198 } 41199 while (stackDelta > 0) { 41200 stack.push(NaN); 41201 stackDelta--; 41202 } 41203 } 41204 } 41205 ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; 41206 var content = [data]; 41207 if (i > data.length) { 41208 content.push(new Uint8Array(i - data.length)); 41209 } 41210 if (lastDeff > lastEndf) { 41211 warn('TT: complementing a missing function tail'); 41212 content.push(new Uint8Array([ 41213 0x22, 41214 0x2D 41215 ])); 41216 } 41217 foldTTTable(table, content); 41218 } 41219 function checkInvalidFunctions(ttContext, maxFunctionDefs) { 41220 if (ttContext.tooComplexToFollowFunctions) { 41221 return; 41222 } 41223 if (ttContext.functionsDefined.length > maxFunctionDefs) { 41224 warn('TT: more functions defined than expected'); 41225 ttContext.hintsValid = false; 41226 return; 41227 } 41228 for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { 41229 if (j > maxFunctionDefs) { 41230 warn('TT: invalid function id: ' + j); 41231 ttContext.hintsValid = false; 41232 return; 41233 } 41234 if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { 41235 warn('TT: undefined function: ' + j); 41236 ttContext.hintsValid = false; 41237 return; 41238 } 41239 } 41240 } 41241 function foldTTTable(table, content) { 41242 if (content.length > 1) { 41243 var newLength = 0; 41244 var j, jj; 41245 for (j = 0, jj = content.length; j < jj; j++) { 41246 newLength += content[j].length; 41247 } 41248 newLength = newLength + 3 & ~3; 41249 var result = new Uint8Array(newLength); 41250 var pos = 0; 41251 for (j = 0, jj = content.length; j < jj; j++) { 41252 result.set(content[j], pos); 41253 pos += content[j].length; 41254 } 41255 table.data = result; 41256 table.length = newLength; 41257 } 41258 } 41259 function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { 41260 var ttContext = { 41261 functionsDefined: [], 41262 functionsUsed: [], 41263 functionsStackDeltas: [], 41264 tooComplexToFollowFunctions: false, 41265 hintsValid: true 41266 }; 41267 if (fpgm) { 41268 sanitizeTTProgram(fpgm, ttContext); 41269 } 41270 if (prep) { 41271 sanitizeTTProgram(prep, ttContext); 41272 } 41273 if (fpgm) { 41274 checkInvalidFunctions(ttContext, maxFunctionDefs); 41275 } 41276 if (cvt && cvt.length & 1) { 41277 var cvtData = new Uint8Array(cvt.length + 1); 41278 cvtData.set(cvt.data); 41279 cvt.data = cvtData; 41280 } 41281 return ttContext.hintsValid; 41282 } 41283 font = new Stream(new Uint8Array(font.getBytes())); 41284 var VALID_TABLES = [ 41285 'OS/2', 41286 'cmap', 41287 'head', 41288 'hhea', 41289 'hmtx', 41290 'maxp',
41291 'name', 41292 'post', 41293 'loca', 41294 'glyf', 41295 'fpgm', 41296 'prep', 41297 'cvt ', 41298 'CFF ' 41299 ]; 41300 var header = readOpenTypeHeader(font); 41301 var numTables = header.numTables; 41302 var cff, cffFile; 41303 var tables = Object.create(null); 41304 tables['OS/2'] = null; 41305 tables['cmap'] = null; 41306 tables['head'] = null; 41307 tables['hhea'] = null; 41308 tables['hmtx'] = null; 41309 tables['maxp'] = null; 41310 tables['name'] = null; 41311 tables['post'] = null; 41312 var table; 41313 for (var i = 0; i < numTables; i++) { 41314 table = readTableEntry(font); 41315 if (VALID_TABLES.indexOf(table.tag) < 0) { 41316 continue; 41317 } 41318 if (table.length === 0) { 41319 continue; 41320 } 41321 tables[table.tag] = table; 41322 } 41323 var isTrueType = !tables['CFF ']; 41324 if (!isTrueType) { 41325 if (header.version === 'OTTO' && !properties.composite || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) { 41326 cffFile = new Stream(tables['CFF '].data); 41327 cff = new CFFFont(cffFile, properties); 41328 adjustWidths(properties); 41329 return this.convert(name, cff, properties); 41330 } 41331 delete tables['glyf']; 41332 delete tables['loca']; 41333 delete tables['fpgm']; 41334 delete tables['prep']; 41335 delete tables['cvt ']; 41336 this.isOpenType = true; 41337 } else { 41338 if (!tables['loca']) { 41339 error('Required "loca" table is not found'); 41340 } 41341 if (!tables['glyf']) { 41342 warn('Required "glyf" table is not found -- trying to recover.'); 41343 tables['glyf'] = { 41344 tag: 'glyf', 41345 data: new Uint8Array(0) 41346 }; 41347 } 41348 this.isOpenType = false;
41349 } 41350 if (!tables['maxp']) { 41351 error('Required "maxp" table is not found'); 41352 } 41353 font.pos = (font.start || 0) + tables['maxp'].offset; 41354 var version = font.getInt32(); 41355 var numGlyphs = font.getUint16(); 41356 var maxFunctionDefs = 0; 41357 if (version >= 0x00010000 && tables['maxp'].length >= 22) { 41358 font.pos += 8; 41359 var maxZones = font.getUint16(); 41360 if (maxZones > 2) { 41361 tables['maxp'].data[14] = 0; 41362 tables['maxp'].data[15] = 2; 41363 } 41364 font.pos += 4; 41365 maxFunctionDefs = font.getUint16(); 41366 } 41367 var dupFirstEntry = false; 41368 if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\u0000') { 41369 dupFirstEntry = true; 41370 numGlyphs++; 41371 tables['maxp'].data[4] = numGlyphs >> 8; 41372 tables['maxp'].data[5] = numGlyphs & 255; 41373 } 41374 var hintsValid = sanitizeTTPrograms(tables['fpgm'], tables['prep'], tables['cvt '], maxFunctionDefs); 41375 if (!hintsValid) { 41376 delete tables['fpgm']; 41377 delete tables['prep']; 41378 delete tables['cvt ']; 41379 } 41380 sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphs); 41381 if (!tables['head']) { 41382 error('Required "head" table is not found'); 41383 } 41384 sanitizeHead(tables['head'], numGlyphs, isTrueType ? tables['loca'].length : 0); 41385 var missingGlyphs = Object.create(null); 41386 if (isTrueType) { 41387 var isGlyphLocationsLong = int16(tables['head'].data[50], tables['head'].data[51]); 41388 missingGlyphs = sanitizeGlyphLocations(tables['loca'], tables['glyf'], numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry); 41389 } 41390 if (!tables['hhea']) { 41391 error('Required "hhea" table is not found'); 41392 } 41393 if (tables['hhea'].data[10] === 0 && tables['hhea'].data[11] === 0) { 41394 tables['hhea'].data[10] = 0xFF; 41395 tables['hhea'].data[11] = 0xFF; 41396 } 41397 var metricsOverride = { 41398 unitsPerEm: int16(tables['head'].data[18], tables['head'].data[19]), 41399 yMax: int16(tables['head'].data[42], tables['head'].data[43]), 41400 yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]), 41401 ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]), 41402 descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7]) 41403 }; 41404 this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; 41405 this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; 41406 if (tables['post']) { 41407 var valid = readPostScriptTable(tables['post'], properties, numGlyphs); 41408 if (!valid) { 41409 tables['post'] = null; 41410 } 41411 } 41412 var charCodeToGlyphId = [], charCode; 41413 var toUnicode = properties.toUnicode, widths = properties.widths; 41414 var skipToUnicode = toUnicode instanceof IdentityToUnicodeMap || toUnicode.length === 0x10000; 41415 function hasGlyph(glyphId, charCode, widthCode) { 41416 if (!missingGlyphs[glyphId]) { 41417 return true; 41418 } 41419 if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) { 41420 return true; 41421 } 41422 if (widths && widthCode >= 0 && isNum(widths[widthCode])) { 41423 return true; 41424 } 41425 return false; 41426 } 41427 if (properties.composite) { 41428 var cidToGidMap = properties.cidToGidMap || []; 41429 var isCidToGidMapEmpty = cidToGidMap.length === 0; 41430 properties.cMap.forEach(function (charCode, cid) { 41431 assert(cid <= 0xffff, 'Max size of CID is 65,535'); 41432 var glyphId = -1; 41433 if (isCidToGidMapEmpty) { 41434 glyphId = cid; 41435 } else if (cidToGidMap[cid] !== undefined) { 41436 glyphId = cidToGidMap[cid]; 41437 } 41438 if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId, charCode, cid)) { 41439 charCodeToGlyphId[charCode] = glyphId; 41440 } 41441 }); 41442 if (dupFirstEntry && (isCidToGidMapEmpty || !charCodeToGlyphId[0])) {
41443 charCodeToGlyphId[0] = numGlyphs - 1; 41444 } 41445 } else { 41446 var cmapTable = readCmapTable(tables['cmap'], font, this.isSymbolicFont, properties.hasEncoding); 41447 var cmapPlatformId = cmapTable.platformId; 41448 var cmapEncodingId = cmapTable.encodingId; 41449 var cmapMappings = cmapTable.mappings; 41450 var cmapMappingsLength = cmapMappings.length; 41451 if (properties.hasEncoding && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0) || cmapPlatformId === -1 && cmapEncodingId === -1 && !!getEncoding(properties.baseEncodingName)) { 41452 var baseEncoding = []; 41453 if (properties.baseEncodingName === 'MacRomanEncoding' || properties.baseEncodingName === 'WinAnsiEncoding') { 41454 baseEncoding = getEncoding(properties.baseEncodingName); 41455 } 41456 var glyphsUnicodeMap = getGlyphsUnicode(); 41457 for (charCode = 0; charCode < 256; charCode++) { 41458 var glyphName, standardGlyphName; 41459 if (this.differences && charCode in this.differences) { 41460 glyphName = this.differences[charCode]; 41461 } else if (charCode in baseEncoding && baseEncoding[charCode] !== '') { 41462 glyphName = baseEncoding[charCode]; 41463 } else { 41464 glyphName = StandardEncoding[charCode]; 41465 } 41466 if (!glyphName) { 41467 continue; 41468 } 41469 standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 41470 var unicodeOrCharCode, isUnicode = false; 41471 if (cmapPlatformId === 3 && cmapEncodingId === 1) { 41472 unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; 41473 isUnicode = true; 41474 } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { 41475 unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName); 41476 } 41477 var found = false; 41478 for (i = 0; i < cmapMappingsLength; ++i) { 41479 if (cmapMappings[i].charCode !== unicodeOrCharCode) { 41480 continue; 41481 } 41482 var code = isUnicode ? charCode : unicodeOrCharCode; 41483 if (hasGlyph(cmapMappings[i].glyphId, code, -1)) { 41484 charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; 41485 found = true; 41486 break; 41487 } 41488 } 41489 if (!found && properties.glyphNames) { 41490 var glyphId = properties.glyphNames.indexOf(glyphName); 41491 if (glyphId === -1 && standardGlyphName !== glyphName) { 41492 glyphId = properties.glyphNames.indexOf(standardGlyphName); 41493 } 41494 if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) { 41495 charCodeToGlyphId[charCode] = glyphId; 41496 found = true; 41497 } 41498 } 41499 if (!found) { 41500 charCodeToGlyphId[charCode] = 0; 41501 } 41502 } 41503 } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { 41504 for (i = 0; i < cmapMappingsLength; ++i) { 41505 charCodeToGlyphId[cmapMappings[i].charCode] = cmapMappings[i].glyphId; 41506 } 41507 } else { 41508 for (i = 0; i < cmapMappingsLength; ++i) { 41509 charCode = cmapMappings[i].charCode & 0xFF; 41510 charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; 41511 } 41512 } 41513 } 41514 if (charCodeToGlyphId.length === 0) { 41515 charCodeToGlyphId[0] = 0; 41516 } 41517 var newMapping = adjustMapping(charCodeToGlyphId, properties); 41518 this.toFontChar = newMapping.toFontChar; 41519 tables['cmap'] = { 41520 tag: 'cmap', 41521 data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) 41522 }; 41523 if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { 41524 tables['OS/2'] = { 41525 tag: 'OS/2', 41526 data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride) 41527 }; 41528 } 41529 if (!tables['post']) { 41530 tables['post'] = { 41531 tag: 'post', 41532 data: createPostTable(properties) 41533 }; 41534 } 41535 if (!isTrueType) { 41536 try { 41537 cffFile = new Stream(tables['CFF '].data); 41538 var parser = new CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED); 41539 cff = parser.parse(); 41540 var compiler = new CFFCompiler(cff); 41541 tables['CFF '].data = compiler.compile(); 41542 } catch (e) { 41543 warn('Failed to compile font ' + properties.loadedName); 41544 } 41545 } 41546 if (!tables['name']) { 41547 tables['name'] = { 41548 tag: 'name', 41549 data: createNameTable(this.name) 41550 }; 41551 } else { 41552 var namePrototype = readNameTable(tables['name']); 41553 tables['name'].data = createNameTable(name, namePrototype); 41554 } 41555 var builder = new OpenTypeFileBuilder(header.version); 41556 for (var tableTag in tables) { 41557 builder.addTable(tableTag, tables[tableTag].data); 41558 } 41559 return builder.toArray(); 41560 }, 41561 convert: function Font_convert(fontName, font, properties) { 41562 properties.fixedPitch = false;
vendor: 5,337 bytes, lines 41563-41698
41563 if (properties.builtInEncoding) { 41564 adjustToUnicode(properties, properties.builtInEncoding); 41565 } 41566 var mapping = font.getGlyphMapping(properties); 41567 var newMapping = adjustMapping(mapping, properties); 41568 this.toFontChar = newMapping.toFontChar; 41569 var numGlyphs = font.numGlyphs; 41570 function getCharCodes(charCodeToGlyphId, glyphId) { 41571 var charCodes = null; 41572 for (var charCode in charCodeToGlyphId) { 41573 if (glyphId === charCodeToGlyphId[charCode]) { 41574 if (!charCodes) { 41575 charCodes = []; 41576 } 41577 charCodes.push(charCode | 0); 41578 } 41579 } 41580 return charCodes; 41581 } 41582 function createCharCode(charCodeToGlyphId, glyphId) { 41583 for (var charCode in charCodeToGlyphId) { 41584 if (glyphId === charCodeToGlyphId[charCode]) { 41585 return charCode | 0; 41586 } 41587 } 41588 newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId; 41589 return newMapping.nextAvailableFontCharCode++; 41590 } 41591 var seacs = font.seacs; 41592 if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { 41593 var matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; 41594 var charset = font.getCharset(); 41595 var seacMap = Object.create(null); 41596 for (var glyphId in seacs) { 41597 glyphId |= 0; 41598 var seac = seacs[glyphId]; 41599 var baseGlyphName = StandardEncoding[seac[2]]; 41600 var accentGlyphName = StandardEncoding[seac[3]]; 41601 var baseGlyphId = charset.indexOf(baseGlyphName); 41602 var accentGlyphId = charset.indexOf(accentGlyphName); 41603 if (baseGlyphId < 0 || accentGlyphId < 0) { 41604 continue; 41605 } 41606 var accentOffset = { 41607 x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], 41608 y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] 41609 }; 41610 var charCodes = getCharCodes(mapping, glyphId); 41611 if (!charCodes) { 41612 continue; 41613 } 41614 for (var i = 0, ii = charCodes.length; i < ii; i++) { 41615 var charCode = charCodes[i]; 41616 var charCodeToGlyphId = newMapping.charCodeToGlyphId; 41617 var baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId); 41618 var accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId); 41619 seacMap[charCode] = { 41620 baseFontCharCode: baseFontCharCode, 41621 accentFontCharCode: accentFontCharCode, 41622 accentOffset: accentOffset 41623 }; 41624 } 41625 } 41626 properties.seacMap = seacMap; 41627 } 41628 var unitsPerEm = 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; 41629 var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); 41630 builder.addTable('CFF ', font.data); 41631 builder.addTable('OS/2', createOS2Table(properties, newMapping.charCodeToGlyphId)); 41632 builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, numGlyphs)); 41633 builder.addTable('head', '\x00\x01\x00\x00' + '\x00\x00\x10\x00' + '\x00\x00\x00\x00' + '\x5F\x0F\x3C\xF5' + '\x00\x00' + safeString16(unitsPerEm) + '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + '\x00\x00' + safeString16(properties.descent) + '\x0F\xFF' + safeString16(properties.ascent) + string16(properties.italicAngle ? 2 : 0) + '\x00\x11' + '\x00\x00' + '\x00\x00' + '\x00\x00'); 41634 builder.addTable('hhea', '\x00\x01\x00\x00' + safeString16(properties.ascent) + safeString16(properties.descent) + '\x00\x00' + '\xFF\xFF' + '\x00\x00' + '\x00\x00' + '\x00\x00' + safeString16(properties.capHeight) + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + string16(numGlyphs)); 41635 builder.addTable('hmtx', function fontFieldsHmtx() { 41636 var charstrings = font.charstrings; 41637 var cffWidths = font.cff ? font.cff.widths : null; 41638 var hmtx = '\x00\x00\x00\x00'; 41639 for (var i = 1, ii = numGlyphs; i < ii; i++) { 41640 var width = 0; 41641 if (charstrings) { 41642 var charstring = charstrings[i - 1]; 41643 width = 'width' in charstring ? charstring.width : 0; 41644 } else if (cffWidths) { 41645 width = Math.ceil(cffWidths[i] || 0); 41646 } 41647 hmtx += string16(width) + string16(0); 41648 } 41649 return hmtx; 41650 }()); 41651 builder.addTable('maxp', '\x00\x00\x50\x00' + string16(numGlyphs)); 41652 builder.addTable('name', createNameTable(fontName)); 41653 builder.addTable('post', createPostTable(properties)); 41654 return builder.toArray(); 41655 }, 41656 get spaceWidth() { 41657 if ('_shadowWidth' in this) { 41658 return this._shadowWidth; 41659 } 41660 var possibleSpaceReplacements = [ 41661 'space', 41662 'minus', 41663 'one', 41664 'i', 41665 'I' 41666 ]; 41667 var width; 41668 for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { 41669 var glyphName = possibleSpaceReplacements[i]; 41670 if (glyphName in this.widths) { 41671 width = this.widths[glyphName]; 41672 break; 41673 } 41674 var glyphsUnicodeMap = getGlyphsUnicode(); 41675 var glyphUnicode = glyphsUnicodeMap[glyphName]; 41676 var charcode = 0; 41677 if (this.composite) { 41678 if (this.cMap.contains(glyphUnicode)) { 41679 charcode = this.cMap.lookup(glyphUnicode); 41680 } 41681 } 41682 if (!charcode && this.toUnicode) { 41683 charcode = this.toUnicode.charCodeOf(glyphUnicode); 41684 } 41685 if (charcode <= 0) { 41686 charcode = glyphUnicode; 41687 } 41688 width = this.widths[charcode]; 41689 if (width) { 41690 break; 41691 } 41692 } 41693 width = width || this.defaultWidth; 41694 this._shadowWidth = width; 41695 return width; 41696 }, 41697 charToGlyph: function Font_charToGlyph(charcode, isSpace) { 41698 var fontCharCode, width, operatorListId;
41699 var widthCode = charcode; 41700 if (this.cMap && this.cMap.contains(charcode)) { 41701 widthCode = this.cMap.lookup(charcode); 41702 } 41703 width = this.widths[widthCode]; 41704 width = isNum(width) ? width : this.defaultWidth; 41705 var vmetric = this.vmetrics && this.vmetrics[widthCode]; 41706 var unicode = this.toUnicode.get(charcode) || charcode; 41707 if (typeof unicode === 'number') { 41708 unicode = String.fromCharCode(unicode); 41709 } 41710 var isInFont = charcode in this.toFontChar; 41711 fontCharCode = this.toFontChar[charcode] || charcode; 41712 if (this.missingFile) { 41713 fontCharCode = mapSpecialUnicodeValues(fontCharCode); 41714 } 41715 if (this.isType3Font) { 41716 operatorListId = fontCharCode; 41717 } 41718 var accent = null; 41719 if (this.seacMap && this.seacMap[charcode]) { 41720 isInFont = true; 41721 var seac = this.seacMap[charcode]; 41722 fontCharCode = seac.baseFontCharCode; 41723 accent = { 41724 fontChar: String.fromCharCode(seac.accentFontCharCode), 41725 offset: seac.accentOffset 41726 }; 41727 } 41728 var fontChar = String.fromCharCode(fontCharCode); 41729 var glyph = this.glyphCache[charcode]; 41730 if (!glyph || !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont)) { 41731 glyph = new Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont); 41732 this.glyphCache[charcode] = glyph; 41733 } 41734 return glyph; 41735 }, 41736 charsToGlyphs: function Font_charsToGlyphs(chars) { 41737 var charsCache = this.charsCache; 41738 var glyphs, glyph, charcode; 41739 if (charsCache) { 41740 glyphs = charsCache[chars]; 41741 if (glyphs) { 41742 return glyphs; 41743 } 41744 } 41745 if (!charsCache) { 41746 charsCache = this.charsCache = Object.create(null); 41747 } 41748 glyphs = []; 41749 var charsCacheKey = chars; 41750 var i = 0, ii; 41751 if (this.cMap) { 41752 var c = Object.create(null); 41753 while (i < chars.length) { 41754 this.cMap.readCharCode(chars, i, c); 41755 charcode = c.charcode; 41756 var length = c.length; 41757 i += length; 41758 var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; 41759 glyph = this.charToGlyph(charcode, isSpace); 41760 glyphs.push(glyph); 41761 } 41762 } else { 41763 for (i = 0, ii = chars.length; i < ii; ++i) { 41764 charcode = chars.charCodeAt(i); 41765 glyph = this.charToGlyph(charcode, charcode === 0x20); 41766 glyphs.push(glyph); 41767 } 41768 } 41769 return charsCache[charsCacheKey] = glyphs; 41770 } 41771 }; 41772 return Font; 41773}(); 41774var ErrorFont = function ErrorFontClosure() { 41775 function ErrorFont(error) { 41776 this.error = error; 41777 this.loadedName = 'g_font_error'; 41778 this.loading = false; 41779 } 41780 ErrorFont.prototype = { 41781 charsToGlyphs: function ErrorFont_charsToGlyphs() { 41782 return []; 41783 }, 41784 exportData: function ErrorFont_exportData() { 41785 return { error: this.error }; 41786 } 41787 }; 41788 return ErrorFont; 41789}(); 41790function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { 41791 var charCodeToGlyphId = Object.create(null); 41792 var glyphId, charCode, baseEncoding; 41793 var isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 41794 if (properties.baseEncodingName) { 41795 baseEncoding = getEncoding(properties.baseEncodingName); 41796 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 41797 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 41798 if (glyphId >= 0) { 41799 charCodeToGlyphId[charCode] = glyphId; 41800 } else { 41801 charCodeToGlyphId[charCode] = 0; 41802 } 41803 } 41804 } else if (isSymbolicFont) { 41805 for (charCode in builtInEncoding) { 41806 charCodeToGlyphId[charCode] = builtInEncoding[charCode]; 41807 } 41808 } else { 41809 baseEncoding = StandardEncoding; 41810 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 41811 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 41812 if (glyphId >= 0) { 41813 charCodeToGlyphId[charCode] = glyphId; 41814 } else { 41815 charCodeToGlyphId[charCode] = 0; 41816 } 41817 } 41818 } 41819 var differences = properties.differences, glyphsUnicodeMap; 41820 if (differences) { 41821 for (charCode in differences) { 41822 var glyphName = differences[charCode]; 41823 glyphId = glyphNames.indexOf(glyphName); 41824 if (glyphId === -1) { 41825 if (!glyphsUnicodeMap) { 41826 glyphsUnicodeMap = getGlyphsUnicode(); 41827 } 41828 var standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 41829 if (standardGlyphName !== glyphName) { 41830 glyphId = glyphNames.indexOf(standardGlyphName); 41831 } 41832 } 41833 if (glyphId >= 0) {
41834 charCodeToGlyphId[charCode] = glyphId; 41835 } else { 41836 charCodeToGlyphId[charCode] = 0; 41837 } 41838 } 41839 } 41840 return charCodeToGlyphId; 41841} 41842var Type1Font = function Type1FontClosure() { 41843 function findBlock(streamBytes, signature, startIndex) { 41844 var streamBytesLength = streamBytes.length; 41845 var signatureLength = signature.length; 41846 var scanLength = streamBytesLength - signatureLength; 41847 var i = startIndex, j, found = false; 41848 while (i < scanLength) { 41849 j = 0; 41850 while (j < signatureLength && streamBytes[i + j] === signature[j]) { 41851 j++; 41852 } 41853 if (j >= signatureLength) { 41854 i += j; 41855 while (i < streamBytesLength && isSpace(streamBytes[i])) { 41856 i++; 41857 } 41858 found = true; 41859 break; 41860 } 41861 i++; 41862 } 41863 return { 41864 found: found, 41865 length: i 41866 }; 41867 } 41868 function getHeaderBlock(stream, suggestedLength) { 41869 var EEXEC_SIGNATURE = [ 41870 0x65, 41871 0x65, 41872 0x78, 41873 0x65, 41874 0x63 41875 ]; 41876 var streamStartPos = stream.pos; 41877 var headerBytes, headerBytesLength, block; 41878 try { 41879 headerBytes = stream.getBytes(suggestedLength); 41880 headerBytesLength = headerBytes.length; 41881 } catch (ex) { 41882 if (ex instanceof MissingDataException) { 41883 throw ex; 41884 } 41885 } 41886 if (headerBytesLength === suggestedLength) { 41887 block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length); 41888 if (block.found && block.length === suggestedLength) { 41889 return { 41890 stream: new Stream(headerBytes), 41891 length: suggestedLength 41892 }; 41893 } 41894 } 41895 warn('Invalid "Length1" property in Type1 font -- trying to recover.'); 41896 stream.pos = streamStartPos; 41897 var SCAN_BLOCK_LENGTH = 2048; 41898 var actualLength; 41899 while (true) { 41900 var scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); 41901 block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); 41902 if (block.length === 0) { 41903 break; 41904 } 41905 stream.pos += block.length; 41906 if (block.found) { 41907 actualLength = stream.pos - streamStartPos; 41908 break; 41909 } 41910 } 41911 stream.pos = streamStartPos; 41912 if (actualLength) { 41913 return { 41914 stream: new Stream(stream.getBytes(actualLength)), 41915 length: actualLength 41916 }; 41917 } 41918 warn('Unable to recover "Length1" property in Type1 font -- using as is.'); 41919 return { 41920 stream: new Stream(stream.getBytes(suggestedLength)), 41921 length: suggestedLength 41922 }; 41923 } 41924 function getEexecBlock(stream, suggestedLength) { 41925 var eexecBytes = stream.getBytes(); 41926 return { 41927 stream: new Stream(eexecBytes), 41928 length: eexecBytes.length 41929 }; 41930 } 41931 function Type1Font(name, file, properties) { 41932 var PFB_HEADER_SIZE = 6; 41933 var headerBlockLength = properties.length1; 41934 var eexecBlockLength = properties.length2; 41935 var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); 41936 var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; 41937 if (pfbHeaderPresent) { 41938 file.skip(PFB_HEADER_SIZE); 41939 headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 41940 } 41941 var headerBlock = getHeaderBlock(file, headerBlockLength); 41942 headerBlockLength = headerBlock.length; 41943 var headerBlockParser = new Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED); 41944 headerBlockParser.extractFontHeader(properties); 41945 if (pfbHeaderPresent) { 41946 pfbHeader = file.getBytes(PFB_HEADER_SIZE); 41947 eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 41948 } 41949 var eexecBlock = getEexecBlock(file, eexecBlockLength); 41950 eexecBlockLength = eexecBlock.length; 41951 var eexecBlockParser = new Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED); 41952 var data = eexecBlockParser.extractFontProgram(); 41953 for (var info in data.properties) { 41954 properties[info] = data.properties[info]; 41955 } 41956 var charstrings = data.charstrings; 41957 var type2Charstrings = this.getType2Charstrings(charstrings); 41958 var subrs = this.getType2Subrs(data.subrs); 41959 this.charstrings = charstrings; 41960 this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties); 41961 this.seacs = this.getSeacs(data.charstrings); 41962 } 41963 Type1Font.prototype = { 41964 get numGlyphs() { 41965 return this.charstrings.length + 1; 41966 }, 41967 getCharset: function Type1Font_getCharset() { 41968 var charset = ['.notdef']; 41969 var charstrings = this.charstrings; 41970 for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { 41971 charset.push(charstrings[glyphId].glyphName); 41972 } 41973 return charset; 41974 }, 41975 getGlyphMapping: function Type1Font_getGlyphMapping(properties) { 41976 var charstrings = this.charstrings; 41977 var glyphNames = ['.notdef'], glyphId; 41978 for (glyphId = 0; glyphId < charstrings.length; glyphId++) { 41979 glyphNames.push(charstrings[glyphId].glyphName); 41980 } 41981 var encoding = properties.builtInEncoding; 41982 if (encoding) { 41983 var builtInEncoding = Object.create(null);
vendor: 4,408 bytes, lines 41984-42144
41984 for (var charCode in encoding) { 41985 glyphId = glyphNames.indexOf(encoding[charCode]); 41986 if (glyphId >= 0) { 41987 builtInEncoding[charCode] = glyphId; 41988 } 41989 } 41990 } 41991 return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); 41992 }, 41993 getSeacs: function Type1Font_getSeacs(charstrings) { 41994 var i, ii; 41995 var seacMap = []; 41996 for (i = 0, ii = charstrings.length; i < ii; i++) { 41997 var charstring = charstrings[i]; 41998 if (charstring.seac) { 41999 seacMap[i + 1] = charstring.seac; 42000 } 42001 } 42002 return seacMap; 42003 }, 42004 getType2Charstrings: function Type1Font_getType2Charstrings(type1Charstrings) { 42005 var type2Charstrings = []; 42006 for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { 42007 type2Charstrings.push(type1Charstrings[i].charstring); 42008 } 42009 return type2Charstrings; 42010 }, 42011 getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { 42012 var bias = 0; 42013 var count = type1Subrs.length; 42014 if (count < 1133) { 42015 bias = 107; 42016 } else if (count < 33769) { 42017 bias = 1131; 42018 } else { 42019 bias = 32768; 42020 } 42021 var type2Subrs = []; 42022 var i; 42023 for (i = 0; i < bias; i++) { 42024 type2Subrs.push([0x0B]); 42025 } 42026 for (i = 0; i < count; i++) { 42027 type2Subrs.push(type1Subrs[i]); 42028 } 42029 return type2Subrs; 42030 }, 42031 wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) { 42032 var cff = new CFF(); 42033 cff.header = new CFFHeader(1, 0, 4, 4); 42034 cff.names = [name]; 42035 var topDict = new CFFTopDict(); 42036 topDict.setByName('version', 391); 42037 topDict.setByName('Notice', 392); 42038 topDict.setByName('FullName', 393); 42039 topDict.setByName('FamilyName', 394); 42040 topDict.setByName('Weight', 395); 42041 topDict.setByName('Encoding', null); 42042 topDict.setByName('FontMatrix', properties.fontMatrix); 42043 topDict.setByName('FontBBox', properties.bbox); 42044 topDict.setByName('charset', null); 42045 topDict.setByName('CharStrings', null); 42046 topDict.setByName('Private', null); 42047 cff.topDict = topDict; 42048 var strings = new CFFStrings(); 42049 strings.add('Version 0.11'); 42050 strings.add('See original notice'); 42051 strings.add(name); 42052 strings.add(name); 42053 strings.add('Medium'); 42054 cff.strings = strings; 42055 cff.globalSubrIndex = new CFFIndex(); 42056 var count = glyphs.length; 42057 var charsetArray = [0]; 42058 var i, ii; 42059 for (i = 0; i < count; i++) { 42060 var index = CFFStandardStrings.indexOf(charstrings[i].glyphName); 42061 if (index === -1) { 42062 index = 0; 42063 } 42064 charsetArray.push(index >> 8 & 0xff, index & 0xff); 42065 } 42066 cff.charset = new CFFCharset(false, 0, [], charsetArray); 42067 var charStringsIndex = new CFFIndex(); 42068 charStringsIndex.add([ 42069 0x8B, 42070 0x0E 42071 ]); 42072 for (i = 0; i < count; i++) { 42073 var glyph = glyphs[i]; 42074 if (glyph.length === 0) { 42075 charStringsIndex.add([ 42076 0x8B, 42077 0x0E 42078 ]); 42079 continue; 42080 } 42081 charStringsIndex.add(glyph); 42082 } 42083 cff.charStrings = charStringsIndex; 42084 var privateDict = new CFFPrivateDict(); 42085 privateDict.setByName('Subrs', null); 42086 var fields = [ 42087 'BlueValues', 42088 'OtherBlues', 42089 'FamilyBlues', 42090 'FamilyOtherBlues', 42091 'StemSnapH', 42092 'StemSnapV', 42093 'BlueShift', 42094 'BlueFuzz', 42095 'BlueScale', 42096 'LanguageGroup', 42097 'ExpansionFactor', 42098 'ForceBold', 42099 'StdHW', 42100 'StdVW' 42101 ]; 42102 for (i = 0, ii = fields.length; i < ii; i++) { 42103 var field = fields[i]; 42104 if (!(field in properties.privateData)) { 42105 continue; 42106 } 42107 var value = properties.privateData[field]; 42108 if (isArray(value)) { 42109 for (var j = value.length - 1; j > 0; j--) { 42110 value[j] -= value[j - 1]; 42111 } 42112 } 42113 privateDict.setByName(field, value); 42114 } 42115 cff.topDict.privateDict = privateDict; 42116 var subrIndex = new CFFIndex(); 42117 for (i = 0, ii = subrs.length; i < ii; i++) { 42118 subrIndex.add(subrs[i]); 42119 } 42120 privateDict.subrsIndex = subrIndex; 42121 var compiler = new CFFCompiler(cff); 42122 return compiler.compile(); 42123 } 42124 }; 42125 return Type1Font; 42126}(); 42127var CFFFont = function CFFFontClosure() { 42128 function CFFFont(file, properties) { 42129 this.properties = properties; 42130 var parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); 42131 this.cff = parser.parse(); 42132 var compiler = new CFFCompiler(this.cff); 42133 this.seacs = this.cff.seacs; 42134 try { 42135 this.data = compiler.compile(); 42136 } catch (e) { 42137 warn('Failed to compile font ' + properties.loadedName); 42138 this.data = file; 42139 } 42140 } 42141 CFFFont.prototype = { 42142 get numGlyphs() { 42143 return this.cff.charStrings.count; 42144 },
42145 getCharset: function CFFFont_getCharset() { 42146 return this.cff.charset.charset; 42147 }, 42148 getGlyphMapping: function CFFFont_getGlyphMapping() { 42149 var cff = this.cff; 42150 var properties = this.properties; 42151 var charsets = cff.charset.charset; 42152 var charCodeToGlyphId; 42153 var glyphId; 42154 if (properties.composite) { 42155 charCodeToGlyphId = Object.create(null); 42156 if (cff.isCIDFont) { 42157 for (glyphId = 0; glyphId < charsets.length; glyphId++) { 42158 var cid = charsets[glyphId]; 42159 var charCode = properties.cMap.charCodeOf(cid); 42160 charCodeToGlyphId[charCode] = glyphId; 42161 } 42162 } else { 42163 for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { 42164 charCodeToGlyphId[glyphId] = glyphId; 42165 } 42166 } 42167 return charCodeToGlyphId; 42168 } 42169 var encoding = cff.encoding ? cff.encoding.encoding : null; 42170 charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); 42171 return charCodeToGlyphId; 42172 } 42173 }; 42174 return CFFFont; 42175}(); 42176(function checkSeacSupport() { 42177 if (typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent)) { 42178 SEAC_ANALYSIS_ENABLED = true; 42179 } 42180}()); 42181(function checkChromeWindows() { 42182 if (typeof navigator !== 'undefined' && /Windows.*Chrome/.test(navigator.userAgent)) { 42183 SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true; 42184 } 42185}()); 42186exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED; 42187exports.PRIVATE_USE_OFFSET_START = PRIVATE_USE_OFFSET_START; 42188exports.PRIVATE_USE_OFFSET_END = PRIVATE_USE_OFFSET_END; 42189exports.ErrorFont = ErrorFont; 42190exports.Font = Font; 42191exports.FontFlags = FontFlags; 42192exports.IdentityToUnicodeMap = IdentityToUnicodeMap; 42193exports.ProblematicCharRanges = ProblematicCharRanges; 42194exports.ToUnicodeMap = ToUnicodeMap; 42195exports.getFontType = getFontType; 42196 42197/***/ }), 42198/* 27 */ 42199/***/ (function(module, exports, __w_pdfjs_require__) { 42200 42201"use strict"; 42202 42203var sharedUtil = __w_pdfjs_require__(0); 42204var corePrimitives = __w_pdfjs_require__(1); 42205var coreColorSpace = __w_pdfjs_require__(3); 42206var coreStream = __w_pdfjs_require__(2); 42207var coreJpx = __w_pdfjs_require__(15); 42208var ImageKind = sharedUtil.ImageKind; 42209var assert = sharedUtil.assert; 42210var error = sharedUtil.error; 42211var info = sharedUtil.info; 42212var isArray = sharedUtil.isArray; 42213var warn = sharedUtil.warn; 42214var Name = corePrimitives.Name; 42215var isStream = corePrimitives.isStream; 42216var ColorSpace = coreColorSpace.ColorSpace; 42217var DecodeStream = coreStream.DecodeStream; 42218var JpegStream = coreStream.JpegStream; 42219var JpxImage = coreJpx.JpxImage; 42220var PDFImage = function PDFImageClosure() { 42221 function handleImageData(image, nativeDecoder) { 42222 if (nativeDecoder && nativeDecoder.canDecode(image)) { 42223 return nativeDecoder.decode(image); 42224 } 42225 return Promise.resolve(image); 42226 } 42227 function decodeAndClamp(value, addend, coefficient, max) { 42228 value = addend + value * coefficient; 42229 return value < 0 ? 0 : value > max ? max : value; 42230 } 42231 function resizeImageMask(src, bpc, w1, h1, w2, h2) { 42232 var length = w2 * h2; 42233 var dest = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 42234 var xRatio = w1 / w2; 42235 var yRatio = h1 / h2; 42236 var i, j, py, newIndex = 0, oldIndex; 42237 var xScaled = new Uint16Array(w2); 42238 var w1Scanline = w1; 42239 for (i = 0; i < w2; i++) { 42240 xScaled[i] = Math.floor(i * xRatio); 42241 } 42242 for (i = 0; i < h2; i++) { 42243 py = Math.floor(i * yRatio) * w1Scanline; 42244 for (j = 0; j < w2; j++) { 42245 oldIndex = py + xScaled[j]; 42246 dest[newIndex++] = src[oldIndex]; 42247 } 42248 } 42249 return dest; 42250 } 42251 function PDFImage(xref, res, image, inline, smask, mask, isMask) { 42252 this.image = image; 42253 var dict = image.dict; 42254 if (dict.has('Filter')) { 42255 var filter = dict.get('Filter').name; 42256 if (filter === 'JPXDecode') { 42257 var jpxImage = new JpxImage(); 42258 jpxImage.parseImageProperties(image.stream); 42259 image.stream.reset(); 42260 image.bitsPerComponent = jpxImage.bitsPerComponent; 42261 image.numComps = jpxImage.componentsCount; 42262 } else if (filter === 'JBIG2Decode') { 42263 image.bitsPerComponent = 1; 42264 image.numComps = 1; 42265 } 42266 } 42267 this.width = dict.get('Width', 'W'); 42268 this.height = dict.get('Height', 'H'); 42269 if (this.width < 1 || this.height < 1) { 42270 error('Invalid image width: ' + this.width + ' or height: ' + this.height); 42271 } 42272 this.interpolate = dict.get('Interpolate', 'I') || false; 42273 this.imageMask = dict.get('ImageMask', 'IM') || false; 42274 this.matte = dict.get('Matte') || false; 42275 var bitsPerComponent = image.bitsPerComponent; 42276 if (!bitsPerComponent) {
vendor: 10,911 bytes, lines 42277-42623
42277 bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); 42278 if (!bitsPerComponent) { 42279 if (this.imageMask) { 42280 bitsPerComponent = 1; 42281 } else { 42282 error('Bits per component missing in image: ' + this.imageMask); 42283 } 42284 } 42285 } 42286 this.bpc = bitsPerComponent; 42287 if (!this.imageMask) { 42288 var colorSpace = dict.get('ColorSpace', 'CS'); 42289 if (!colorSpace) { 42290 info('JPX images (which do not require color spaces)'); 42291 switch (image.numComps) { 42292 case 1: 42293 colorSpace = Name.get('DeviceGray'); 42294 break; 42295 case 3: 42296 colorSpace = Name.get('DeviceRGB'); 42297 break; 42298 case 4: 42299 colorSpace = Name.get('DeviceCMYK'); 42300 break; 42301 default: 42302 error('JPX images with ' + this.numComps + ' color components not supported.'); 42303 } 42304 } 42305 this.colorSpace = ColorSpace.parse(colorSpace, xref, res); 42306 this.numComps = this.colorSpace.numComps; 42307 } 42308 this.decode = dict.getArray('Decode', 'D'); 42309 this.needsDecode = false; 42310 if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode) || isMask && !ColorSpace.isDefaultDecode(this.decode, 1))) { 42311 this.needsDecode = true; 42312 var max = (1 << bitsPerComponent) - 1; 42313 this.decodeCoefficients = []; 42314 this.decodeAddends = []; 42315 for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { 42316 var dmin = this.decode[i]; 42317 var dmax = this.decode[i + 1]; 42318 this.decodeCoefficients[j] = dmax - dmin; 42319 this.decodeAddends[j] = max * dmin; 42320 } 42321 } 42322 if (smask) { 42323 this.smask = new PDFImage(xref, res, smask, false); 42324 } else if (mask) { 42325 if (isStream(mask)) { 42326 var maskDict = mask.dict, imageMask = maskDict.get('ImageMask', 'IM'); 42327 if (!imageMask) { 42328 warn('Ignoring /Mask in image without /ImageMask.'); 42329 } else { 42330 this.mask = new PDFImage(xref, res, mask, false, null, null, true); 42331 } 42332 } else { 42333 this.mask = mask; 42334 } 42335 } 42336 } 42337 PDFImage.buildImage = function PDFImage_buildImage(handler, xref, res, image, inline, nativeDecoder) { 42338 var imagePromise = handleImageData(image, nativeDecoder); 42339 var smaskPromise; 42340 var maskPromise; 42341 var smask = image.dict.get('SMask'); 42342 var mask = image.dict.get('Mask'); 42343 if (smask) { 42344 smaskPromise = handleImageData(smask, nativeDecoder); 42345 maskPromise = Promise.resolve(null); 42346 } else { 42347 smaskPromise = Promise.resolve(null); 42348 if (mask) { 42349 if (isStream(mask)) { 42350 maskPromise = handleImageData(mask, nativeDecoder); 42351 } else if (isArray(mask)) { 42352 maskPromise = Promise.resolve(mask); 42353 } else { 42354 warn('Unsupported mask format.'); 42355 maskPromise = Promise.resolve(null); 42356 } 42357 } else { 42358 maskPromise = Promise.resolve(null); 42359 } 42360 } 42361 return Promise.all([ 42362 imagePromise, 42363 smaskPromise, 42364 maskPromise 42365 ]).then(function (results) { 42366 var imageData = results[0]; 42367 var smaskData = results[1]; 42368 var maskData = results[2]; 42369 return new PDFImage(xref, res, imageData, inline, smaskData, maskData); 42370 }); 42371 }; 42372 PDFImage.createMask = function PDFImage_createMask(imgArray, width, height, imageIsFromDecodeStream, inverseDecode) { 42373 var computedLength = (width + 7 >> 3) * height; 42374 var actualLength = imgArray.byteLength; 42375 var haveFullData = computedLength === actualLength; 42376 var data, i; 42377 if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { 42378 data = imgArray; 42379 } else if (!inverseDecode) { 42380 data = new Uint8Array(actualLength); 42381 data.set(imgArray); 42382 } else { 42383 data = new Uint8Array(computedLength); 42384 data.set(imgArray); 42385 for (i = actualLength; i < computedLength; i++) { 42386 data[i] = 0xff; 42387 } 42388 } 42389 if (inverseDecode) { 42390 for (i = 0; i < actualLength; i++) { 42391 data[i] = ~data[i]; 42392 } 42393 } 42394 return { 42395 data: data, 42396 width: width, 42397 height: height 42398 }; 42399 }; 42400 PDFImage.prototype = { 42401 get drawWidth() { 42402 return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); 42403 }, 42404 get drawHeight() { 42405 return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); 42406 }, 42407 decodeBuffer: function PDFImage_decodeBuffer(buffer) { 42408 var bpc = this.bpc; 42409 var numComps = this.numComps; 42410 var decodeAddends = this.decodeAddends; 42411 var decodeCoefficients = this.decodeCoefficients; 42412 var max = (1 << bpc) - 1; 42413 var i, ii; 42414 if (bpc === 1) { 42415 for (i = 0, ii = buffer.length; i < ii; i++) { 42416 buffer[i] = +!buffer[i]; 42417 } 42418 return; 42419 } 42420 var index = 0; 42421 for (i = 0, ii = this.width * this.height; i < ii; i++) { 42422 for (var j = 0; j < numComps; j++) { 42423 buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); 42424 index++; 42425 } 42426 } 42427 }, 42428 getComponents: function PDFImage_getComponents(buffer) { 42429 var bpc = this.bpc; 42430 if (bpc === 8) { 42431 return buffer; 42432 } 42433 var width = this.width; 42434 var height = this.height; 42435 var numComps = this.numComps; 42436 var length = width * height * numComps; 42437 var bufferPos = 0; 42438 var output = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 42439 var rowComps = width * numComps; 42440 var max = (1 << bpc) - 1; 42441 var i = 0, ii, buf; 42442 if (bpc === 1) { 42443 var mask, loop1End, loop2End; 42444 for (var j = 0; j < height; j++) { 42445 loop1End = i + (rowComps & ~7); 42446 loop2End = i + rowComps; 42447 while (i < loop1End) { 42448 buf = buffer[bufferPos++]; 42449 output[i] = buf >> 7 & 1; 42450 output[i + 1] = buf >> 6 & 1; 42451 output[i + 2] = buf >> 5 & 1; 42452 output[i + 3] = buf >> 4 & 1; 42453 output[i + 4] = buf >> 3 & 1; 42454 output[i + 5] = buf >> 2 & 1; 42455 output[i + 6] = buf >> 1 & 1; 42456 output[i + 7] = buf & 1; 42457 i += 8; 42458 } 42459 if (i < loop2End) { 42460 buf = buffer[bufferPos++]; 42461 mask = 128; 42462 while (i < loop2End) { 42463 output[i++] = +!!(buf & mask); 42464 mask >>= 1; 42465 } 42466 } 42467 } 42468 } else { 42469 var bits = 0; 42470 buf = 0; 42471 for (i = 0, ii = length; i < ii; ++i) { 42472 if (i % rowComps === 0) { 42473 buf = 0; 42474 bits = 0; 42475 } 42476 while (bits < bpc) { 42477 buf = buf << 8 | buffer[bufferPos++]; 42478 bits += 8; 42479 } 42480 var remainingBits = bits - bpc; 42481 var value = buf >> remainingBits; 42482 output[i] = value < 0 ? 0 : value > max ? max : value; 42483 buf = buf & (1 << remainingBits) - 1; 42484 bits = remainingBits; 42485 } 42486 } 42487 return output; 42488 }, 42489 fillOpacity: function PDFImage_fillOpacity(rgbaBuf, width, height, actualHeight, image) { 42490 var smask = this.smask; 42491 var mask = this.mask; 42492 var alphaBuf, sw, sh, i, ii, j; 42493 if (smask) { 42494 sw = smask.width; 42495 sh = smask.height; 42496 alphaBuf = new Uint8Array(sw * sh); 42497 smask.fillGrayBuffer(alphaBuf); 42498 if (sw !== width || sh !== height) { 42499 alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); 42500 } 42501 } else if (mask) { 42502 if (mask instanceof PDFImage) { 42503 sw = mask.width; 42504 sh = mask.height; 42505 alphaBuf = new Uint8Array(sw * sh); 42506 mask.numComps = 1; 42507 mask.fillGrayBuffer(alphaBuf); 42508 for (i = 0, ii = sw * sh; i < ii; ++i) { 42509 alphaBuf[i] = 255 - alphaBuf[i]; 42510 } 42511 if (sw !== width || sh !== height) { 42512 alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); 42513 } 42514 } else if (isArray(mask)) { 42515 alphaBuf = new Uint8Array(width * height); 42516 var numComps = this.numComps; 42517 for (i = 0, ii = width * height; i < ii; ++i) { 42518 var opacity = 0; 42519 var imageOffset = i * numComps; 42520 for (j = 0; j < numComps; ++j) { 42521 var color = image[imageOffset + j]; 42522 var maskOffset = j * 2; 42523 if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { 42524 opacity = 255; 42525 break; 42526 } 42527 } 42528 alphaBuf[i] = opacity; 42529 } 42530 } else { 42531 error('Unknown mask format.'); 42532 } 42533 } 42534 if (alphaBuf) { 42535 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 42536 rgbaBuf[j] = alphaBuf[i]; 42537 } 42538 } else { 42539 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 42540 rgbaBuf[j] = 255; 42541 } 42542 } 42543 }, 42544 undoPreblend: function PDFImage_undoPreblend(buffer, width, height) { 42545 var matte = this.smask && this.smask.matte; 42546 if (!matte) { 42547 return; 42548 } 42549 var matteRgb = this.colorSpace.getRgb(matte, 0); 42550 var matteR = matteRgb[0]; 42551 var matteG = matteRgb[1]; 42552 var matteB = matteRgb[2]; 42553 var length = width * height * 4; 42554 var r, g, b; 42555 for (var i = 0; i < length; i += 4) { 42556 var alpha = buffer[i + 3]; 42557 if (alpha === 0) { 42558 buffer[i] = 255; 42559 buffer[i + 1] = 255; 42560 buffer[i + 2] = 255; 42561 continue; 42562 } 42563 var k = 255 / alpha; 42564 r = (buffer[i] - matteR) * k + matteR; 42565 g = (buffer[i + 1] - matteG) * k + matteG; 42566 b = (buffer[i + 2] - matteB) * k + matteB; 42567 buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; 42568 buffer[i + 1] = g <= 0 ? 0 : g >= 255 ? 255 : g | 0; 42569 buffer[i + 2] = b <= 0 ? 0 : b >= 255 ? 255 : b | 0; 42570 } 42571 }, 42572 createImageData: function PDFImage_createImageData(forceRGBA) { 42573 var drawWidth = this.drawWidth; 42574 var drawHeight = this.drawHeight; 42575 var imgData = { 42576 width: drawWidth, 42577 height: drawHeight 42578 }; 42579 var numComps = this.numComps; 42580 var originalWidth = this.width; 42581 var originalHeight = this.height; 42582 var bpc = this.bpc; 42583 var rowBytes = originalWidth * numComps * bpc + 7 >> 3; 42584 var imgArray; 42585 if (!forceRGBA) { 42586 var kind; 42587 if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { 42588 kind = ImageKind.GRAYSCALE_1BPP; 42589 } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && !this.needsDecode) { 42590 kind = ImageKind.RGB_24BPP; 42591 } 42592 if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { 42593 imgData.kind = kind; 42594 imgArray = this.getImageBytes(originalHeight * rowBytes); 42595 if (this.image instanceof DecodeStream) { 42596 imgData.data = imgArray; 42597 } else { 42598 var newArray = new Uint8Array(imgArray.length); 42599 newArray.set(imgArray); 42600 imgData.data = newArray; 42601 } 42602 if (this.needsDecode) { 42603 assert(kind === ImageKind.GRAYSCALE_1BPP); 42604 var buffer = imgData.data; 42605 for (var i = 0, ii = buffer.length; i < ii; i++) { 42606 buffer[i] ^= 0xff; 42607 } 42608 } 42609 return imgData; 42610 } 42611 if (this.image instanceof JpegStream && !this.smask && !this.mask && (this.colorSpace.name === 'DeviceGray' || this.colorSpace.name === 'DeviceRGB' || this.colorSpace.name === 'DeviceCMYK')) { 42612 imgData.kind = ImageKind.RGB_24BPP; 42613 imgData.data = this.getImageBytes(originalHeight * rowBytes, drawWidth, drawHeight, true); 42614 return imgData; 42615 } 42616 } 42617 imgArray = this.getImageBytes(originalHeight * rowBytes); 42618 var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; 42619 var comps = this.getComponents(imgArray); 42620 var alpha01, maybeUndoPreblend; 42621 if (!forceRGBA && !this.smask && !this.mask) { 42622 imgData.kind = ImageKind.RGB_24BPP; 42623 imgData.data = new Uint8Array(drawWidth * drawHeight * 3);
42624 alpha01 = 0; 42625 maybeUndoPreblend = false; 42626 } else { 42627 imgData.kind = ImageKind.RGBA_32BPP; 42628 imgData.data = new Uint8Array(drawWidth * drawHeight * 4); 42629 alpha01 = 1; 42630 maybeUndoPreblend = true; 42631 this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); 42632 } 42633 if (this.needsDecode) { 42634 this.decodeBuffer(comps); 42635 } 42636 this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); 42637 if (maybeUndoPreblend) { 42638 this.undoPreblend(imgData.data, drawWidth, actualHeight); 42639 } 42640 return imgData; 42641 }, 42642 fillGrayBuffer: function PDFImage_fillGrayBuffer(buffer) { 42643 var numComps = this.numComps; 42644 if (numComps !== 1) { 42645 error('Reading gray scale from a color image: ' + numComps); 42646 } 42647 var width = this.width; 42648 var height = this.height; 42649 var bpc = this.bpc; 42650 var rowBytes = width * numComps * bpc + 7 >> 3; 42651 var imgArray = this.getImageBytes(height * rowBytes); 42652 var comps = this.getComponents(imgArray); 42653 var i, length; 42654 if (bpc === 1) { 42655 length = width * height; 42656 if (this.needsDecode) { 42657 for (i = 0; i < length; ++i) { 42658 buffer[i] = comps[i] - 1 & 255; 42659 } 42660 } else { 42661 for (i = 0; i < length; ++i) { 42662 buffer[i] = -comps[i] & 255; 42663 } 42664 } 42665 return; 42666 } 42667 if (this.needsDecode) { 42668 this.decodeBuffer(comps); 42669 } 42670 length = width * height; 42671 var scale = 255 / ((1 << bpc) - 1); 42672 for (i = 0; i < length; ++i) { 42673 buffer[i] = scale * comps[i] | 0; 42674 } 42675 }, 42676 getImageBytes: function PDFImage_getImageBytes(length, drawWidth, drawHeight, forceRGB) { 42677 this.image.reset(); 42678 this.image.drawWidth = drawWidth || this.width; 42679 this.image.drawHeight = drawHeight || this.height; 42680 this.image.forceRGB = !!forceRGB; 42681 return this.image.getBytes(length); 42682 } 42683 }; 42684 return PDFImage; 42685}(); 42686exports.PDFImage = PDFImage; 42687 42688/***/ }), 42689/* 28 */ 42690/***/ (function(module, exports, __w_pdfjs_require__) { 42691 42692"use strict"; 42693 42694var sharedUtil = __w_pdfjs_require__(0); 42695var coreArithmeticDecoder = __w_pdfjs_require__(10); 42696var error = sharedUtil.error; 42697var log2 = sharedUtil.log2; 42698var readInt8 = sharedUtil.readInt8; 42699var readUint16 = sharedUtil.readUint16; 42700var readUint32 = sharedUtil.readUint32; 42701var shadow = sharedUtil.shadow; 42702var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder; 42703var Jbig2Image = function Jbig2ImageClosure() { 42704 function ContextCache() { 42705 } 42706 ContextCache.prototype = { 42707 getContexts: function (id) { 42708 if (id in this) { 42709 return this[id]; 42710 } 42711 return this[id] = new Int8Array(1 << 16); 42712 } 42713 }; 42714 function DecodingContext(data, start, end) { 42715 this.data = data; 42716 this.start = start; 42717 this.end = end; 42718 } 42719 DecodingContext.prototype = { 42720 get decoder() { 42721 var decoder = new ArithmeticDecoder(this.data, this.start, this.end); 42722 return shadow(this, 'decoder', decoder); 42723 }, 42724 get contextCache() { 42725 var cache = new ContextCache(); 42726 return shadow(this, 'contextCache', cache); 42727 } 42728 }; 42729 function decodeInteger(contextCache, procedure, decoder) { 42730 var contexts = contextCache.getContexts(procedure); 42731 var prev = 1; 42732 function readBits(length) { 42733 var v = 0; 42734 for (var i = 0; i < length; i++) { 42735 var bit = decoder.readBit(contexts, prev); 42736 prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256; 42737 v = v << 1 | bit; 42738 } 42739 return v >>> 0; 42740 } 42741 var sign = readBits(1); 42742 var value = readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(32) + 4436 : readBits(12) + 340 : readBits(8) + 84 : readBits(6) + 20 : readBits(4) + 4 : readBits(2); 42743 return sign === 0 ? value : value > 0 ? -value : null; 42744 } 42745 function decodeIAID(contextCache, decoder, codeLength) { 42746 var contexts = contextCache.getContexts('IAID'); 42747 var prev = 1; 42748 for (var i = 0; i < codeLength; i++) { 42749 var bit = decoder.readBit(contexts, prev); 42750 prev = prev << 1 | bit; 42751 } 42752 if (codeLength < 31) { 42753 return prev & (1 << codeLength) - 1; 42754 } 42755 return prev & 0x7FFFFFFF; 42756 } 42757 var SegmentTypes = [ 42758 'SymbolDictionary', 42759 null, 42760 null, 42761 null, 42762 'IntermediateTextRegion', 42763 null, 42764 'ImmediateTextRegion', 42765 'ImmediateLosslessTextRegion', 42766 null, 42767 null, 42768 null, 42769 null, 42770 null, 42771 null, 42772 null, 42773 null, 42774 'patternDictionary', 42775 null, 42776 null, 42777 null, 42778 'IntermediateHalftoneRegion', 42779 null, 42780 'ImmediateHalftoneRegion', 42781 'ImmediateLosslessHalftoneRegion', 42782 null, 42783 null, 42784 null, 42785 null, 42786 null, 42787 null, 42788 null, 42789 null, 42790 null, 42791 null, 42792 null, 42793 null, 42794 'IntermediateGenericRegion', 42795 null, 42796 'ImmediateGenericRegion', 42797 'ImmediateLosslessGenericRegion', 42798 'IntermediateGenericRefinementRegion', 42799 null, 42800 'ImmediateGenericRefinementRegion', 42801 'ImmediateLosslessGenericRefinementRegion', 42802 null, 42803 null, 42804 null, 42805 null, 42806 'PageInformation', 42807 'EndOfPage', 42808 'EndOfStripe', 42809 'EndOfFile', 42810 'Profiles', 42811 'Tables', 42812 null, 42813 null, 42814 null, 42815 null, 42816 null, 42817 null, 42818 null, 42819 null, 42820 'Extension' 42821 ];
vendor: 5,896 bytes, lines 42822-43194
42822 var CodingTemplates = [ 42823 [ 42824 { 42825 x: -1, 42826 y: -2 42827 }, 42828 { 42829 x: 0, 42830 y: -2 42831 }, 42832 { 42833 x: 1, 42834 y: -2 42835 }, 42836 { 42837 x: -2, 42838 y: -1 42839 }, 42840 { 42841 x: -1, 42842 y: -1 42843 }, 42844 { 42845 x: 0, 42846 y: -1 42847 }, 42848 { 42849 x: 1, 42850 y: -1 42851 }, 42852 { 42853 x: 2, 42854 y: -1 42855 }, 42856 { 42857 x: -4, 42858 y: 0 42859 }, 42860 { 42861 x: -3, 42862 y: 0 42863 }, 42864 { 42865 x: -2, 42866 y: 0 42867 }, 42868 { 42869 x: -1, 42870 y: 0 42871 } 42872 ], 42873 [ 42874 { 42875 x: -1, 42876 y: -2 42877 }, 42878 { 42879 x: 0, 42880 y: -2 42881 }, 42882 { 42883 x: 1, 42884 y: -2 42885 }, 42886 { 42887 x: 2, 42888 y: -2 42889 }, 42890 { 42891 x: -2, 42892 y: -1 42893 }, 42894 { 42895 x: -1, 42896 y: -1 42897 }, 42898 { 42899 x: 0, 42900 y: -1 42901 }, 42902 { 42903 x: 1, 42904 y: -1 42905 }, 42906 { 42907 x: 2, 42908 y: -1 42909 }, 42910 { 42911 x: -3, 42912 y: 0 42913 }, 42914 { 42915 x: -2, 42916 y: 0 42917 }, 42918 { 42919 x: -1, 42920 y: 0 42921 } 42922 ], 42923 [ 42924 { 42925 x: -1, 42926 y: -2 42927 }, 42928 { 42929 x: 0, 42930 y: -2 42931 }, 42932 { 42933 x: 1, 42934 y: -2 42935 }, 42936 { 42937 x: -2, 42938 y: -1 42939 }, 42940 { 42941 x: -1, 42942 y: -1 42943 }, 42944 { 42945 x: 0, 42946 y: -1 42947 }, 42948 { 42949 x: 1, 42950 y: -1 42951 }, 42952 { 42953 x: -2, 42954 y: 0 42955 }, 42956 { 42957 x: -1, 42958 y: 0 42959 } 42960 ], 42961 [ 42962 { 42963 x: -3, 42964 y: -1 42965 }, 42966 { 42967 x: -2, 42968 y: -1 42969 }, 42970 { 42971 x: -1, 42972 y: -1 42973 }, 42974 { 42975 x: 0, 42976 y: -1 42977 }, 42978 { 42979 x: 1, 42980 y: -1 42981 }, 42982 { 42983 x: -4, 42984 y: 0 42985 }, 42986 { 42987 x: -3, 42988 y: 0 42989 }, 42990 { 42991 x: -2, 42992 y: 0 42993 }, 42994 { 42995 x: -1, 42996 y: 0 42997 } 42998 ] 42999 ]; 43000 var RefinementTemplates = [ 43001 { 43002 coding: [ 43003 { 43004 x: 0, 43005 y: -1 43006 }, 43007 { 43008 x: 1, 43009 y: -1 43010 }, 43011 { 43012 x: -1, 43013 y: 0 43014 } 43015 ], 43016 reference: [ 43017 { 43018 x: 0, 43019 y: -1 43020 }, 43021 { 43022 x: 1, 43023 y: -1 43024 }, 43025 { 43026 x: -1, 43027 y: 0 43028 }, 43029 { 43030 x: 0, 43031 y: 0 43032 }, 43033 { 43034 x: 1, 43035 y: 0 43036 }, 43037 { 43038 x: -1, 43039 y: 1 43040 }, 43041 { 43042 x: 0, 43043 y: 1 43044 }, 43045 { 43046 x: 1, 43047 y: 1 43048 } 43049 ] 43050 }, 43051 { 43052 coding: [ 43053 { 43054 x: -1, 43055 y: -1 43056 }, 43057 { 43058 x: 0, 43059 y: -1 43060 }, 43061 { 43062 x: 1, 43063 y: -1 43064 }, 43065 { 43066 x: -1, 43067 y: 0 43068 } 43069 ], 43070 reference: [ 43071 { 43072 x: 0, 43073 y: -1 43074 }, 43075 { 43076 x: -1, 43077 y: 0 43078 }, 43079 { 43080 x: 0, 43081 y: 0 43082 }, 43083 { 43084 x: 1, 43085 y: 0 43086 }, 43087 { 43088 x: 0, 43089 y: 1 43090 }, 43091 { 43092 x: 1, 43093 y: 1 43094 } 43095 ] 43096 } 43097 ]; 43098 var ReusedContexts = [ 43099 0x9B25, 43100 0x0795, 43101 0x00E5, 43102 0x0195 43103 ]; 43104 var RefinementReusedContexts = [ 43105 0x0020, 43106 0x0008 43107 ]; 43108 function decodeBitmapTemplate0(width, height, decodingContext) { 43109 var decoder = decodingContext.decoder; 43110 var contexts = decodingContext.contextCache.getContexts('GB'); 43111 var contextLabel, i, j, pixel, row, row1, row2, bitmap = []; 43112 var OLD_PIXEL_MASK = 0x7BF7; 43113 for (i = 0; i < height; i++) { 43114 row = bitmap[i] = new Uint8Array(width); 43115 row1 = i < 1 ? row : bitmap[i - 1]; 43116 row2 = i < 2 ? row : bitmap[i - 2]; 43117 contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4; 43118 for (j = 0; j < width; j++) { 43119 row[j] = pixel = decoder.readBit(contexts, contextLabel); 43120 contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; 43121 } 43122 } 43123 return bitmap; 43124 } 43125 function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) { 43126 if (mmr) { 43127 error('JBIG2 error: MMR encoding is not supported'); 43128 } 43129 if (templateIndex === 0 && !skip && !prediction && at.length === 4 && at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { 43130 return decodeBitmapTemplate0(width, height, decodingContext); 43131 } 43132 var useskip = !!skip; 43133 var template = CodingTemplates[templateIndex].concat(at); 43134 template.sort(function (a, b) { 43135 return a.y - b.y || a.x - b.x; 43136 }); 43137 var templateLength = template.length; 43138 var templateX = new Int8Array(templateLength); 43139 var templateY = new Int8Array(templateLength); 43140 var changingTemplateEntries = []; 43141 var reuseMask = 0, minX = 0, maxX = 0, minY = 0; 43142 var c, k; 43143 for (k = 0; k < templateLength; k++) { 43144 templateX[k] = template[k].x; 43145 templateY[k] = template[k].y; 43146 minX = Math.min(minX, template[k].x); 43147 maxX = Math.max(maxX, template[k].x); 43148 minY = Math.min(minY, template[k].y); 43149 if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) { 43150 reuseMask |= 1 << templateLength - 1 - k; 43151 } else { 43152 changingTemplateEntries.push(k); 43153 } 43154 } 43155 var changingEntriesLength = changingTemplateEntries.length; 43156 var changingTemplateX = new Int8Array(changingEntriesLength); 43157 var changingTemplateY = new Int8Array(changingEntriesLength); 43158 var changingTemplateBit = new Uint16Array(changingEntriesLength); 43159 for (c = 0; c < changingEntriesLength; c++) { 43160 k = changingTemplateEntries[c]; 43161 changingTemplateX[c] = template[k].x; 43162 changingTemplateY[c] = template[k].y; 43163 changingTemplateBit[c] = 1 << templateLength - 1 - k; 43164 } 43165 var sbb_left = -minX; 43166 var sbb_top = -minY; 43167 var sbb_right = width - maxX; 43168 var pseudoPixelContext = ReusedContexts[templateIndex]; 43169 var row = new Uint8Array(width); 43170 var bitmap = []; 43171 var decoder = decodingContext.decoder; 43172 var contexts = decodingContext.contextCache.getContexts('GB'); 43173 var ltp = 0, j, i0, j0, contextLabel = 0, bit, shift; 43174 for (var i = 0; i < height; i++) { 43175 if (prediction) { 43176 var sltp = decoder.readBit(contexts, pseudoPixelContext); 43177 ltp ^= sltp; 43178 if (ltp) { 43179 bitmap.push(row); 43180 continue; 43181 } 43182 } 43183 row = new Uint8Array(row); 43184 bitmap.push(row); 43185 for (j = 0; j < width; j++) { 43186 if (useskip && skip[i][j]) { 43187 row[j] = 0; 43188 continue; 43189 } 43190 if (j >= sbb_left && j < sbb_right && i >= sbb_top) { 43191 contextLabel = contextLabel << 1 & reuseMask; 43192 for (k = 0; k < changingEntriesLength; k++) { 43193 i0 = i + changingTemplateY[k]; 43194 j0 = j + changingTemplateX[k];
vendor: 5,008 bytes, lines 43195-43329
43195 bit = bitmap[i0][j0]; 43196 if (bit) { 43197 bit = changingTemplateBit[k]; 43198 contextLabel |= bit; 43199 } 43200 } 43201 } else { 43202 contextLabel = 0; 43203 shift = templateLength - 1; 43204 for (k = 0; k < templateLength; k++, shift--) { 43205 j0 = j + templateX[k]; 43206 if (j0 >= 0 && j0 < width) { 43207 i0 = i + templateY[k]; 43208 if (i0 >= 0) { 43209 bit = bitmap[i0][j0]; 43210 if (bit) { 43211 contextLabel |= bit << shift; 43212 } 43213 } 43214 } 43215 } 43216 } 43217 var pixel = decoder.readBit(contexts, contextLabel); 43218 row[j] = pixel; 43219 } 43220 } 43221 return bitmap; 43222 } 43223 function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) { 43224 var codingTemplate = RefinementTemplates[templateIndex].coding; 43225 if (templateIndex === 0) { 43226 codingTemplate = codingTemplate.concat([at[0]]); 43227 } 43228 var codingTemplateLength = codingTemplate.length; 43229 var codingTemplateX = new Int32Array(codingTemplateLength); 43230 var codingTemplateY = new Int32Array(codingTemplateLength); 43231 var k; 43232 for (k = 0; k < codingTemplateLength; k++) { 43233 codingTemplateX[k] = codingTemplate[k].x; 43234 codingTemplateY[k] = codingTemplate[k].y; 43235 } 43236 var referenceTemplate = RefinementTemplates[templateIndex].reference; 43237 if (templateIndex === 0) { 43238 referenceTemplate = referenceTemplate.concat([at[1]]); 43239 } 43240 var referenceTemplateLength = referenceTemplate.length; 43241 var referenceTemplateX = new Int32Array(referenceTemplateLength); 43242 var referenceTemplateY = new Int32Array(referenceTemplateLength); 43243 for (k = 0; k < referenceTemplateLength; k++) { 43244 referenceTemplateX[k] = referenceTemplate[k].x; 43245 referenceTemplateY[k] = referenceTemplate[k].y; 43246 } 43247 var referenceWidth = referenceBitmap[0].length; 43248 var referenceHeight = referenceBitmap.length; 43249 var pseudoPixelContext = RefinementReusedContexts[templateIndex]; 43250 var bitmap = []; 43251 var decoder = decodingContext.decoder; 43252 var contexts = decodingContext.contextCache.getContexts('GR'); 43253 var ltp = 0; 43254 for (var i = 0; i < height; i++) { 43255 if (prediction) { 43256 var sltp = decoder.readBit(contexts, pseudoPixelContext); 43257 ltp ^= sltp; 43258 if (ltp) { 43259 error('JBIG2 error: prediction is not supported'); 43260 } 43261 } 43262 var row = new Uint8Array(width); 43263 bitmap.push(row); 43264 for (var j = 0; j < width; j++) { 43265 var i0, j0; 43266 var contextLabel = 0; 43267 for (k = 0; k < codingTemplateLength; k++) { 43268 i0 = i + codingTemplateY[k]; 43269 j0 = j + codingTemplateX[k]; 43270 if (i0 < 0 || j0 < 0 || j0 >= width) { 43271 contextLabel <<= 1; 43272 } else { 43273 contextLabel = contextLabel << 1 | bitmap[i0][j0]; 43274 } 43275 } 43276 for (k = 0; k < referenceTemplateLength; k++) { 43277 i0 = i + referenceTemplateY[k] + offsetY; 43278 j0 = j + referenceTemplateX[k] + offsetX; 43279 if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { 43280 contextLabel <<= 1; 43281 } else { 43282 contextLabel = contextLabel << 1 | referenceBitmap[i0][j0]; 43283 } 43284 } 43285 var pixel = decoder.readBit(contexts, contextLabel); 43286 row[j] = pixel; 43287 } 43288 } 43289 return bitmap; 43290 } 43291 function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext) { 43292 if (huffman) { 43293 error('JBIG2 error: huffman is not supported'); 43294 } 43295 var newSymbols = []; 43296 var currentHeight = 0; 43297 var symbolCodeLength = log2(symbols.length + numberOfNewSymbols); 43298 var decoder = decodingContext.decoder; 43299 var contextCache = decodingContext.contextCache; 43300 while (newSymbols.length < numberOfNewSymbols) { 43301 var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); 43302 currentHeight += deltaHeight; 43303 var currentWidth = 0; 43304 while (true) { 43305 var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); 43306 if (deltaWidth === null) { 43307 break; 43308 } 43309 currentWidth += deltaWidth; 43310 var bitmap; 43311 if (refinement) { 43312 var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); 43313 if (numberOfInstances > 1) { 43314 bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext); 43315 } else { 43316 var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); 43317 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 43318 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 43319 var symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length]; 43320 bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext); 43321 } 43322 } else { 43323 bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext); 43324 } 43325 newSymbols.push(bitmap); 43326 } 43327 } 43328 var exportedSymbols = []; 43329 var flags = [], currentFlag = false;
vendor: 1,895 bytes, lines 43330-43381
43330 var totalSymbolsLength = symbols.length + numberOfNewSymbols; 43331 while (flags.length < totalSymbolsLength) { 43332 var runLength = decodeInteger(contextCache, 'IAEX', decoder); 43333 while (runLength--) { 43334 flags.push(currentFlag); 43335 } 43336 currentFlag = !currentFlag; 43337 } 43338 for (var i = 0, ii = symbols.length; i < ii; i++) { 43339 if (flags[i]) { 43340 exportedSymbols.push(symbols[i]); 43341 } 43342 } 43343 for (var j = 0; j < numberOfNewSymbols; i++, j++) { 43344 if (flags[i]) { 43345 exportedSymbols.push(newSymbols[j]); 43346 } 43347 } 43348 return exportedSymbols; 43349 } 43350 function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext) { 43351 if (huffman) { 43352 error('JBIG2 error: huffman is not supported'); 43353 } 43354 var bitmap = []; 43355 var i, row; 43356 for (i = 0; i < height; i++) { 43357 row = new Uint8Array(width); 43358 if (defaultPixelValue) { 43359 for (var j = 0; j < width; j++) { 43360 row[j] = defaultPixelValue; 43361 } 43362 } 43363 bitmap.push(row); 43364 } 43365 var decoder = decodingContext.decoder; 43366 var contextCache = decodingContext.contextCache; 43367 var stripT = -decodeInteger(contextCache, 'IADT', decoder); 43368 var firstS = 0; 43369 i = 0; 43370 while (i < numberOfSymbolInstances) { 43371 var deltaT = decodeInteger(contextCache, 'IADT', decoder); 43372 stripT += deltaT; 43373 var deltaFirstS = decodeInteger(contextCache, 'IAFS', decoder); 43374 firstS += deltaFirstS; 43375 var currentS = firstS; 43376 do { 43377 var currentT = stripSize === 1 ? 0 : decodeInteger(contextCache, 'IAIT', decoder); 43378 var t = stripSize * stripT + currentT; 43379 var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); 43380 var applyRefinement = refinement && decodeInteger(contextCache, 'IARI', decoder); 43381 var symbolBitmap = inputSymbols[symbolId];
vendor: 27,351 bytes, lines 43382-44319
43382 var symbolWidth = symbolBitmap[0].length; 43383 var symbolHeight = symbolBitmap.length; 43384 if (applyRefinement) { 43385 var rdw = decodeInteger(contextCache, 'IARDW', decoder); 43386 var rdh = decodeInteger(contextCache, 'IARDH', decoder); 43387 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 43388 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 43389 symbolWidth += rdw; 43390 symbolHeight += rdh; 43391 symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext); 43392 } 43393 var offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight); 43394 var offsetS = currentS - (referenceCorner & 2 ? symbolWidth : 0); 43395 var s2, t2, symbolRow; 43396 if (transposed) { 43397 for (s2 = 0; s2 < symbolHeight; s2++) { 43398 row = bitmap[offsetS + s2]; 43399 if (!row) { 43400 continue; 43401 } 43402 symbolRow = symbolBitmap[s2]; 43403 var maxWidth = Math.min(width - offsetT, symbolWidth); 43404 switch (combinationOperator) { 43405 case 0: 43406 for (t2 = 0; t2 < maxWidth; t2++) { 43407 row[offsetT + t2] |= symbolRow[t2]; 43408 } 43409 break; 43410 case 2: 43411 for (t2 = 0; t2 < maxWidth; t2++) { 43412 row[offsetT + t2] ^= symbolRow[t2]; 43413 } 43414 break; 43415 default: 43416 error('JBIG2 error: operator ' + combinationOperator + ' is not supported'); 43417 } 43418 } 43419 currentS += symbolHeight - 1; 43420 } else { 43421 for (t2 = 0; t2 < symbolHeight; t2++) { 43422 row = bitmap[offsetT + t2]; 43423 if (!row) { 43424 continue; 43425 } 43426 symbolRow = symbolBitmap[t2]; 43427 switch (combinationOperator) { 43428 case 0: 43429 for (s2 = 0; s2 < symbolWidth; s2++) { 43430 row[offsetS + s2] |= symbolRow[s2]; 43431 } 43432 break; 43433 case 2: 43434 for (s2 = 0; s2 < symbolWidth; s2++) { 43435 row[offsetS + s2] ^= symbolRow[s2]; 43436 } 43437 break; 43438 default: 43439 error('JBIG2 error: operator ' + combinationOperator + ' is not supported'); 43440 } 43441 } 43442 currentS += symbolWidth - 1; 43443 } 43444 i++; 43445 var deltaS = decodeInteger(contextCache, 'IADS', decoder); 43446 if (deltaS === null) { 43447 break; 43448 } 43449 currentS += deltaS + dsOffset; 43450 } while (true); 43451 } 43452 return bitmap; 43453 } 43454 function readSegmentHeader(data, start) { 43455 var segmentHeader = {}; 43456 segmentHeader.number = readUint32(data, start); 43457 var flags = data[start + 4]; 43458 var segmentType = flags & 0x3F; 43459 if (!SegmentTypes[segmentType]) { 43460 error('JBIG2 error: invalid segment type: ' + segmentType); 43461 } 43462 segmentHeader.type = segmentType; 43463 segmentHeader.typeName = SegmentTypes[segmentType]; 43464 segmentHeader.deferredNonRetain = !!(flags & 0x80); 43465 var pageAssociationFieldSize = !!(flags & 0x40); 43466 var referredFlags = data[start + 5]; 43467 var referredToCount = referredFlags >> 5 & 7; 43468 var retainBits = [referredFlags & 31]; 43469 var position = start + 6; 43470 if (referredFlags === 7) { 43471 referredToCount = readUint32(data, position - 1) & 0x1FFFFFFF; 43472 position += 3; 43473 var bytes = referredToCount + 7 >> 3; 43474 retainBits[0] = data[position++]; 43475 while (--bytes > 0) { 43476 retainBits.push(data[position++]); 43477 } 43478 } else if (referredFlags === 5 || referredFlags === 6) { 43479 error('JBIG2 error: invalid referred-to flags'); 43480 } 43481 segmentHeader.retainBits = retainBits; 43482 var referredToSegmentNumberSize = segmentHeader.number <= 256 ? 1 : segmentHeader.number <= 65536 ? 2 : 4; 43483 var referredTo = []; 43484 var i, ii; 43485 for (i = 0; i < referredToCount; i++) { 43486 var number = referredToSegmentNumberSize === 1 ? data[position] : referredToSegmentNumberSize === 2 ? readUint16(data, position) : readUint32(data, position); 43487 referredTo.push(number); 43488 position += referredToSegmentNumberSize; 43489 } 43490 segmentHeader.referredTo = referredTo; 43491 if (!pageAssociationFieldSize) { 43492 segmentHeader.pageAssociation = data[position++]; 43493 } else { 43494 segmentHeader.pageAssociation = readUint32(data, position); 43495 position += 4; 43496 } 43497 segmentHeader.length = readUint32(data, position); 43498 position += 4; 43499 if (segmentHeader.length === 0xFFFFFFFF) { 43500 if (segmentType === 38) { 43501 var genericRegionInfo = readRegionSegmentInformation(data, position); 43502 var genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength]; 43503 var genericRegionMmr = !!(genericRegionSegmentFlags & 1); 43504 var searchPatternLength = 6; 43505 var searchPattern = new Uint8Array(searchPatternLength); 43506 if (!genericRegionMmr) { 43507 searchPattern[0] = 0xFF; 43508 searchPattern[1] = 0xAC; 43509 } 43510 searchPattern[2] = genericRegionInfo.height >>> 24 & 0xFF; 43511 searchPattern[3] = genericRegionInfo.height >> 16 & 0xFF; 43512 searchPattern[4] = genericRegionInfo.height >> 8 & 0xFF; 43513 searchPattern[5] = genericRegionInfo.height & 0xFF; 43514 for (i = position, ii = data.length; i < ii; i++) { 43515 var j = 0; 43516 while (j < searchPatternLength && searchPattern[j] === data[i + j]) { 43517 j++; 43518 } 43519 if (j === searchPatternLength) { 43520 segmentHeader.length = i + searchPatternLength; 43521 break; 43522 } 43523 } 43524 if (segmentHeader.length === 0xFFFFFFFF) { 43525 error('JBIG2 error: segment end was not found'); 43526 } 43527 } else { 43528 error('JBIG2 error: invalid unknown segment length'); 43529 } 43530 } 43531 segmentHeader.headerEnd = position; 43532 return segmentHeader; 43533 } 43534 function readSegments(header, data, start, end) { 43535 var segments = []; 43536 var position = start; 43537 while (position < end) { 43538 var segmentHeader = readSegmentHeader(data, position); 43539 position = segmentHeader.headerEnd; 43540 var segment = { 43541 header: segmentHeader, 43542 data: data 43543 }; 43544 if (!header.randomAccess) { 43545 segment.start = position; 43546 position += segmentHeader.length; 43547 segment.end = position; 43548 } 43549 segments.push(segment); 43550 if (segmentHeader.type === 51) { 43551 break; 43552 } 43553 } 43554 if (header.randomAccess) { 43555 for (var i = 0, ii = segments.length; i < ii; i++) { 43556 segments[i].start = position; 43557 position += segments[i].header.length; 43558 segments[i].end = position; 43559 } 43560 } 43561 return segments; 43562 } 43563 function readRegionSegmentInformation(data, start) { 43564 return { 43565 width: readUint32(data, start), 43566 height: readUint32(data, start + 4), 43567 x: readUint32(data, start + 8), 43568 y: readUint32(data, start + 12), 43569 combinationOperator: data[start + 16] & 7 43570 }; 43571 } 43572 var RegionSegmentInformationFieldLength = 17; 43573 function processSegment(segment, visitor) { 43574 var header = segment.header; 43575 var data = segment.data, position = segment.start, end = segment.end; 43576 var args, at, i, atLength; 43577 switch (header.type) { 43578 case 0: 43579 var dictionary = {}; 43580 var dictionaryFlags = readUint16(data, position); 43581 dictionary.huffman = !!(dictionaryFlags & 1); 43582 dictionary.refinement = !!(dictionaryFlags & 2); 43583 dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3; 43584 dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3; 43585 dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1; 43586 dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1; 43587 dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); 43588 dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); 43589 dictionary.template = dictionaryFlags >> 10 & 3; 43590 dictionary.refinementTemplate = dictionaryFlags >> 12 & 1; 43591 position += 2; 43592 if (!dictionary.huffman) { 43593 atLength = dictionary.template === 0 ? 4 : 1; 43594 at = []; 43595 for (i = 0; i < atLength; i++) { 43596 at.push({ 43597 x: readInt8(data, position), 43598 y: readInt8(data, position + 1) 43599 }); 43600 position += 2; 43601 } 43602 dictionary.at = at; 43603 } 43604 if (dictionary.refinement && !dictionary.refinementTemplate) { 43605 at = []; 43606 for (i = 0; i < 2; i++) { 43607 at.push({ 43608 x: readInt8(data, position), 43609 y: readInt8(data, position + 1) 43610 }); 43611 position += 2; 43612 } 43613 dictionary.refinementAt = at; 43614 } 43615 dictionary.numberOfExportedSymbols = readUint32(data, position); 43616 position += 4; 43617 dictionary.numberOfNewSymbols = readUint32(data, position); 43618 position += 4; 43619 args = [ 43620 dictionary, 43621 header.number, 43622 header.referredTo, 43623 data, 43624 position, 43625 end 43626 ]; 43627 break; 43628 case 6: 43629 case 7: 43630 var textRegion = {}; 43631 textRegion.info = readRegionSegmentInformation(data, position); 43632 position += RegionSegmentInformationFieldLength; 43633 var textRegionSegmentFlags = readUint16(data, position); 43634 position += 2; 43635 textRegion.huffman = !!(textRegionSegmentFlags & 1); 43636 textRegion.refinement = !!(textRegionSegmentFlags & 2); 43637 textRegion.stripSize = 1 << (textRegionSegmentFlags >> 2 & 3); 43638 textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3; 43639 textRegion.transposed = !!(textRegionSegmentFlags & 64); 43640 textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3; 43641 textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1; 43642 textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27; 43643 textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1; 43644 if (textRegion.huffman) { 43645 var textRegionHuffmanFlags = readUint16(data, position); 43646 position += 2; 43647 textRegion.huffmanFS = textRegionHuffmanFlags & 3; 43648 textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3; 43649 textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3; 43650 textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3; 43651 textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3; 43652 textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3; 43653 textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3; 43654 textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 14); 43655 } 43656 if (textRegion.refinement && !textRegion.refinementTemplate) { 43657 at = []; 43658 for (i = 0; i < 2; i++) { 43659 at.push({ 43660 x: readInt8(data, position), 43661 y: readInt8(data, position + 1) 43662 }); 43663 position += 2; 43664 } 43665 textRegion.refinementAt = at; 43666 } 43667 textRegion.numberOfSymbolInstances = readUint32(data, position); 43668 position += 4; 43669 if (textRegion.huffman) { 43670 error('JBIG2 error: huffman is not supported'); 43671 } 43672 args = [ 43673 textRegion, 43674 header.referredTo, 43675 data, 43676 position, 43677 end 43678 ]; 43679 break; 43680 case 38: 43681 case 39: 43682 var genericRegion = {}; 43683 genericRegion.info = readRegionSegmentInformation(data, position); 43684 position += RegionSegmentInformationFieldLength; 43685 var genericRegionSegmentFlags = data[position++]; 43686 genericRegion.mmr = !!(genericRegionSegmentFlags & 1); 43687 genericRegion.template = genericRegionSegmentFlags >> 1 & 3; 43688 genericRegion.prediction = !!(genericRegionSegmentFlags & 8); 43689 if (!genericRegion.mmr) { 43690 atLength = genericRegion.template === 0 ? 4 : 1; 43691 at = []; 43692 for (i = 0; i < atLength; i++) { 43693 at.push({ 43694 x: readInt8(data, position), 43695 y: readInt8(data, position + 1) 43696 }); 43697 position += 2; 43698 } 43699 genericRegion.at = at; 43700 } 43701 args = [ 43702 genericRegion, 43703 data, 43704 position, 43705 end 43706 ]; 43707 break; 43708 case 48: 43709 var pageInfo = { 43710 width: readUint32(data, position), 43711 height: readUint32(data, position + 4), 43712 resolutionX: readUint32(data, position + 8), 43713 resolutionY: readUint32(data, position + 12) 43714 }; 43715 if (pageInfo.height === 0xFFFFFFFF) { 43716 delete pageInfo.height; 43717 } 43718 var pageSegmentFlags = data[position + 16]; 43719 readUint16(data, position + 17); 43720 pageInfo.lossless = !!(pageSegmentFlags & 1); 43721 pageInfo.refinement = !!(pageSegmentFlags & 2); 43722 pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1; 43723 pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3; 43724 pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); 43725 pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); 43726 args = [pageInfo]; 43727 break; 43728 case 49: 43729 break; 43730 case 50: 43731 break; 43732 case 51: 43733 break; 43734 case 62: 43735 break; 43736 default: 43737 error('JBIG2 error: segment type ' + header.typeName + '(' + header.type + ') is not implemented'); 43738 } 43739 var callbackName = 'on' + header.typeName; 43740 if (callbackName in visitor) { 43741 visitor[callbackName].apply(visitor, args); 43742 } 43743 } 43744 function processSegments(segments, visitor) { 43745 for (var i = 0, ii = segments.length; i < ii; i++) { 43746 processSegment(segments[i], visitor); 43747 } 43748 } 43749 function parseJbig2(data, start, end) { 43750 var position = start; 43751 if (data[position] !== 0x97 || data[position + 1] !== 0x4A || data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) { 43752 error('JBIG2 error: invalid header'); 43753 } 43754 var header = {}; 43755 position += 8; 43756 var flags = data[position++]; 43757 header.randomAccess = !(flags & 1); 43758 if (!(flags & 2)) { 43759 header.numberOfPages = readUint32(data, position); 43760 position += 4; 43761 } 43762 readSegments(header, data, position, end); 43763 error('Not implemented'); 43764 } 43765 function parseJbig2Chunks(chunks) { 43766 var visitor = new SimpleSegmentVisitor(); 43767 for (var i = 0, ii = chunks.length; i < ii; i++) { 43768 var chunk = chunks[i]; 43769 var segments = readSegments({}, chunk.data, chunk.start, chunk.end); 43770 processSegments(segments, visitor); 43771 } 43772 return visitor.buffer; 43773 } 43774 function SimpleSegmentVisitor() { 43775 } 43776 SimpleSegmentVisitor.prototype = { 43777 onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { 43778 this.currentPageInfo = info; 43779 var rowSize = info.width + 7 >> 3; 43780 var buffer = new Uint8Array(rowSize * info.height); 43781 if (info.defaultPixelValue) { 43782 for (var i = 0, ii = buffer.length; i < ii; i++) { 43783 buffer[i] = 0xFF; 43784 } 43785 } 43786 this.buffer = buffer; 43787 }, 43788 drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { 43789 var pageInfo = this.currentPageInfo; 43790 var width = regionInfo.width, height = regionInfo.height; 43791 var rowSize = pageInfo.width + 7 >> 3; 43792 var combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator; 43793 var buffer = this.buffer; 43794 var mask0 = 128 >> (regionInfo.x & 7); 43795 var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); 43796 var i, j, mask, offset; 43797 switch (combinationOperator) { 43798 case 0: 43799 for (i = 0; i < height; i++) { 43800 mask = mask0; 43801 offset = offset0; 43802 for (j = 0; j < width; j++) { 43803 if (bitmap[i][j]) { 43804 buffer[offset] |= mask; 43805 } 43806 mask >>= 1; 43807 if (!mask) { 43808 mask = 128; 43809 offset++; 43810 } 43811 } 43812 offset0 += rowSize; 43813 } 43814 break; 43815 case 2: 43816 for (i = 0; i < height; i++) { 43817 mask = mask0; 43818 offset = offset0; 43819 for (j = 0; j < width; j++) { 43820 if (bitmap[i][j]) { 43821 buffer[offset] ^= mask; 43822 } 43823 mask >>= 1; 43824 if (!mask) { 43825 mask = 128; 43826 offset++; 43827 } 43828 } 43829 offset0 += rowSize; 43830 } 43831 break; 43832 default: 43833 error('JBIG2 error: operator ' + combinationOperator + ' is not supported'); 43834 } 43835 }, 43836 onImmediateGenericRegion: function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, start, end) { 43837 var regionInfo = region.info; 43838 var decodingContext = new DecodingContext(data, start, end); 43839 var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext); 43840 this.drawBitmap(regionInfo, bitmap); 43841 }, 43842 onImmediateLosslessGenericRegion: function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { 43843 this.onImmediateGenericRegion.apply(this, arguments); 43844 }, 43845 onSymbolDictionary: function SimpleSegmentVisitor_onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) { 43846 var huffmanTables; 43847 if (dictionary.huffman) { 43848 error('JBIG2 error: huffman is not supported'); 43849 } 43850 var symbols = this.symbols; 43851 if (!symbols) { 43852 this.symbols = symbols = {}; 43853 } 43854 var inputSymbols = []; 43855 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 43856 inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); 43857 } 43858 var decodingContext = new DecodingContext(data, start, end); 43859 symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext); 43860 }, 43861 onImmediateTextRegion: function SimpleSegmentVisitor_onImmediateTextRegion(region, referredSegments, data, start, end) { 43862 var regionInfo = region.info; 43863 var huffmanTables; 43864 var symbols = this.symbols; 43865 var inputSymbols = []; 43866 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 43867 inputSymbols = inputSymbols.concat(symbols[referredSegments[i]]); 43868 } 43869 var symbolCodeLength = log2(inputSymbols.length); 43870 var decodingContext = new DecodingContext(data, start, end); 43871 var bitmap = decodeTextRegion(region.huffman, region.refinement, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.numberOfSymbolInstances, region.stripSize, inputSymbols, symbolCodeLength, region.transposed, region.dsOffset, region.referenceCorner, region.combinationOperator, huffmanTables, region.refinementTemplate, region.refinementAt, decodingContext); 43872 this.drawBitmap(regionInfo, bitmap); 43873 }, 43874 onImmediateLosslessTextRegion: function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { 43875 this.onImmediateTextRegion.apply(this, arguments); 43876 } 43877 }; 43878 function Jbig2Image() { 43879 } 43880 Jbig2Image.prototype = { 43881 parseChunks: function Jbig2Image_parseChunks(chunks) { 43882 return parseJbig2Chunks(chunks); 43883 } 43884 }; 43885 return Jbig2Image; 43886}(); 43887exports.Jbig2Image = Jbig2Image; 43888 43889/***/ }), 43890/* 29 */ 43891/***/ (function(module, exports, __w_pdfjs_require__) { 43892 43893"use strict"; 43894 43895var sharedUtil = __w_pdfjs_require__(0); 43896var error = sharedUtil.error; 43897var JpegImage = function JpegImageClosure() { 43898 var dctZigZag = new Uint8Array([ 43899 0, 43900 1, 43901 8, 43902 16, 43903 9, 43904 2, 43905 3, 43906 10, 43907 17, 43908 24, 43909 32, 43910 25, 43911 18, 43912 11, 43913 4, 43914 5, 43915 12, 43916 19, 43917 26, 43918 33, 43919 40, 43920 48, 43921 41, 43922 34, 43923 27, 43924 20, 43925 13, 43926 6, 43927 7, 43928 14, 43929 21, 43930 28, 43931 35, 43932 42, 43933 49, 43934 56, 43935 57, 43936 50, 43937 43, 43938 36, 43939 29, 43940 22, 43941 15, 43942 23, 43943 30, 43944 37, 43945 44, 43946 51, 43947 58, 43948 59, 43949 52, 43950 45, 43951 38, 43952 31, 43953 39, 43954 46, 43955 53, 43956 60, 43957 61, 43958 54, 43959 47, 43960 55, 43961 62, 43962 63 43963 ]); 43964 var dctCos1 = 4017; 43965 var dctSin1 = 799; 43966 var dctCos3 = 3406; 43967 var dctSin3 = 2276; 43968 var dctCos6 = 1567; 43969 var dctSin6 = 3784; 43970 var dctSqrt2 = 5793; 43971 var dctSqrt1d2 = 2896; 43972 function JpegImage() { 43973 this.decodeTransform = null; 43974 this.colorTransform = -1; 43975 } 43976 function buildHuffmanTable(codeLengths, values) { 43977 var k = 0, code = [], i, j, length = 16; 43978 while (length > 0 && !codeLengths[length - 1]) { 43979 length--; 43980 } 43981 code.push({ 43982 children: [], 43983 index: 0 43984 }); 43985 var p = code[0], q; 43986 for (i = 0; i < length; i++) { 43987 for (j = 0; j < codeLengths[i]; j++) { 43988 p = code.pop(); 43989 p.children[p.index] = values[k]; 43990 while (p.index > 0) { 43991 p = code.pop(); 43992 } 43993 p.index++; 43994 code.push(p); 43995 while (code.length <= i) { 43996 code.push(q = { 43997 children: [], 43998 index: 0 43999 }); 44000 p.children[p.index] = q.children; 44001 p = q; 44002 } 44003 k++; 44004 } 44005 if (i + 1 < length) { 44006 code.push(q = { 44007 children: [], 44008 index: 0 44009 }); 44010 p.children[p.index] = q.children; 44011 p = q; 44012 } 44013 } 44014 return code[0].children; 44015 } 44016 function getBlockBufferOffset(component, row, col) { 44017 return 64 * ((component.blocksPerLine + 1) * row + col); 44018 } 44019 function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive) { 44020 var mcusPerLine = frame.mcusPerLine; 44021 var progressive = frame.progressive; 44022 var startOffset = offset, bitsData = 0, bitsCount = 0; 44023 function readBit() { 44024 if (bitsCount > 0) { 44025 bitsCount--; 44026 return bitsData >> bitsCount & 1; 44027 } 44028 bitsData = data[offset++]; 44029 if (bitsData === 0xFF) { 44030 var nextByte = data[offset++]; 44031 if (nextByte) { 44032 error('JPEG error: unexpected marker ' + (bitsData << 8 | nextByte).toString(16)); 44033 } 44034 } 44035 bitsCount = 7; 44036 return bitsData >>> 7; 44037 } 44038 function decodeHuffman(tree) { 44039 var node = tree; 44040 while (true) { 44041 node = node[readBit()]; 44042 if (typeof node === 'number') { 44043 return node; 44044 } 44045 if (typeof node !== 'object') { 44046 error('JPEG error: invalid huffman sequence'); 44047 } 44048 } 44049 } 44050 function receive(length) { 44051 var n = 0; 44052 while (length > 0) { 44053 n = n << 1 | readBit(); 44054 length--; 44055 } 44056 return n; 44057 } 44058 function receiveAndExtend(length) { 44059 if (length === 1) { 44060 return readBit() === 1 ? 1 : -1; 44061 } 44062 var n = receive(length); 44063 if (n >= 1 << length - 1) { 44064 return n; 44065 } 44066 return n + (-1 << length) + 1; 44067 } 44068 function decodeBaseline(component, offset) { 44069 var t = decodeHuffman(component.huffmanTableDC); 44070 var diff = t === 0 ? 0 : receiveAndExtend(t); 44071 component.blockData[offset] = component.pred += diff; 44072 var k = 1; 44073 while (k < 64) { 44074 var rs = decodeHuffman(component.huffmanTableAC); 44075 var s = rs & 15, r = rs >> 4; 44076 if (s === 0) { 44077 if (r < 15) { 44078 break; 44079 } 44080 k += 16; 44081 continue; 44082 } 44083 k += r; 44084 var z = dctZigZag[k]; 44085 component.blockData[offset + z] = receiveAndExtend(s); 44086 k++; 44087 } 44088 } 44089 function decodeDCFirst(component, offset) { 44090 var t = decodeHuffman(component.huffmanTableDC); 44091 var diff = t === 0 ? 0 : receiveAndExtend(t) << successive; 44092 component.blockData[offset] = component.pred += diff; 44093 } 44094 function decodeDCSuccessive(component, offset) { 44095 component.blockData[offset] |= readBit() << successive; 44096 } 44097 var eobrun = 0; 44098 function decodeACFirst(component, offset) { 44099 if (eobrun > 0) { 44100 eobrun--; 44101 return; 44102 } 44103 var k = spectralStart, e = spectralEnd; 44104 while (k <= e) { 44105 var rs = decodeHuffman(component.huffmanTableAC); 44106 var s = rs & 15, r = rs >> 4; 44107 if (s === 0) { 44108 if (r < 15) { 44109 eobrun = receive(r) + (1 << r) - 1; 44110 break; 44111 } 44112 k += 16; 44113 continue; 44114 } 44115 k += r; 44116 var z = dctZigZag[k]; 44117 component.blockData[offset + z] = receiveAndExtend(s) * (1 << successive); 44118 k++; 44119 } 44120 } 44121 var successiveACState = 0, successiveACNextValue; 44122 function decodeACSuccessive(component, offset) { 44123 var k = spectralStart; 44124 var e = spectralEnd; 44125 var r = 0; 44126 var s; 44127 var rs; 44128 while (k <= e) { 44129 var z = dctZigZag[k]; 44130 switch (successiveACState) { 44131 case 0: 44132 rs = decodeHuffman(component.huffmanTableAC); 44133 s = rs & 15; 44134 r = rs >> 4; 44135 if (s === 0) { 44136 if (r < 15) { 44137 eobrun = receive(r) + (1 << r); 44138 successiveACState = 4; 44139 } else { 44140 r = 16; 44141 successiveACState = 1; 44142 } 44143 } else { 44144 if (s !== 1) { 44145 error('JPEG error: invalid ACn encoding'); 44146 } 44147 successiveACNextValue = receiveAndExtend(s); 44148 successiveACState = r ? 2 : 3; 44149 } 44150 continue; 44151 case 1: 44152 case 2: 44153 if (component.blockData[offset + z]) { 44154 component.blockData[offset + z] += readBit() << successive; 44155 } else { 44156 r--; 44157 if (r === 0) { 44158 successiveACState = successiveACState === 2 ? 3 : 0; 44159 } 44160 } 44161 break; 44162 case 3: 44163 if (component.blockData[offset + z]) { 44164 component.blockData[offset + z] += readBit() << successive; 44165 } else { 44166 component.blockData[offset + z] = successiveACNextValue << successive; 44167 successiveACState = 0; 44168 } 44169 break; 44170 case 4: 44171 if (component.blockData[offset + z]) { 44172 component.blockData[offset + z] += readBit() << successive; 44173 } 44174 break; 44175 } 44176 k++; 44177 } 44178 if (successiveACState === 4) { 44179 eobrun--; 44180 if (eobrun === 0) { 44181 successiveACState = 0; 44182 } 44183 } 44184 } 44185 function decodeMcu(component, decode, mcu, row, col) { 44186 var mcuRow = mcu / mcusPerLine | 0; 44187 var mcuCol = mcu % mcusPerLine; 44188 var blockRow = mcuRow * component.v + row; 44189 var blockCol = mcuCol * component.h + col; 44190 var offset = getBlockBufferOffset(component, blockRow, blockCol); 44191 decode(component, offset); 44192 } 44193 function decodeBlock(component, decode, mcu) { 44194 var blockRow = mcu / component.blocksPerLine | 0; 44195 var blockCol = mcu % component.blocksPerLine; 44196 var offset = getBlockBufferOffset(component, blockRow, blockCol); 44197 decode(component, offset); 44198 } 44199 var componentsLength = components.length; 44200 var component, i, j, k, n; 44201 var decodeFn; 44202 if (progressive) { 44203 if (spectralStart === 0) { 44204 decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; 44205 } else { 44206 decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; 44207 } 44208 } else { 44209 decodeFn = decodeBaseline; 44210 } 44211 var mcu = 0, marker; 44212 var mcuExpected; 44213 if (componentsLength === 1) { 44214 mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; 44215 } else { 44216 mcuExpected = mcusPerLine * frame.mcusPerColumn; 44217 } 44218 if (!resetInterval) { 44219 resetInterval = mcuExpected; 44220 } 44221 var h, v; 44222 while (mcu < mcuExpected) { 44223 for (i = 0; i < componentsLength; i++) { 44224 components[i].pred = 0; 44225 } 44226 eobrun = 0; 44227 if (componentsLength === 1) { 44228 component = components[0]; 44229 for (n = 0; n < resetInterval; n++) { 44230 decodeBlock(component, decodeFn, mcu); 44231 mcu++; 44232 } 44233 } else { 44234 for (n = 0; n < resetInterval; n++) { 44235 for (i = 0; i < componentsLength; i++) { 44236 component = components[i]; 44237 h = component.h; 44238 v = component.v; 44239 for (j = 0; j < v; j++) { 44240 for (k = 0; k < h; k++) { 44241 decodeMcu(component, decodeFn, mcu, j, k); 44242 } 44243 } 44244 } 44245 mcu++; 44246 } 44247 } 44248 bitsCount = 0; 44249 marker = data[offset] << 8 | data[offset + 1]; 44250 while (data[offset] === 0x00 && offset < data.length - 1) { 44251 offset++; 44252 marker = data[offset] << 8 | data[offset + 1]; 44253 } 44254 if (marker <= 0xFF00) { 44255 error('JPEG error: marker was not found'); 44256 } 44257 if (marker >= 0xFFD0 && marker <= 0xFFD7) { 44258 offset += 2; 44259 } else { 44260 break; 44261 } 44262 } 44263 return offset - startOffset; 44264 } 44265 function quantizeAndInverse(component, blockBufferOffset, p) { 44266 var qt = component.quantizationTable, blockData = component.blockData; 44267 var v0, v1, v2, v3, v4, v5, v6, v7; 44268 var p0, p1, p2, p3, p4, p5, p6, p7; 44269 var t; 44270 if (!qt) { 44271 error('JPEG error: missing required Quantization Table.'); 44272 } 44273 for (var row = 0; row < 64; row += 8) { 44274 p0 = blockData[blockBufferOffset + row]; 44275 p1 = blockData[blockBufferOffset + row + 1]; 44276 p2 = blockData[blockBufferOffset + row + 2]; 44277 p3 = blockData[blockBufferOffset + row + 3]; 44278 p4 = blockData[blockBufferOffset + row + 4]; 44279 p5 = blockData[blockBufferOffset + row + 5]; 44280 p6 = blockData[blockBufferOffset + row + 6]; 44281 p7 = blockData[blockBufferOffset + row + 7]; 44282 p0 *= qt[row]; 44283 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 44284 t = dctSqrt2 * p0 + 512 >> 10; 44285 p[row] = t; 44286 p[row + 1] = t; 44287 p[row + 2] = t; 44288 p[row + 3] = t; 44289 p[row + 4] = t; 44290 p[row + 5] = t; 44291 p[row + 6] = t; 44292 p[row + 7] = t; 44293 continue; 44294 } 44295 p1 *= qt[row + 1]; 44296 p2 *= qt[row + 2]; 44297 p3 *= qt[row + 3]; 44298 p4 *= qt[row + 4]; 44299 p5 *= qt[row + 5]; 44300 p6 *= qt[row + 6]; 44301 p7 *= qt[row + 7]; 44302 v0 = dctSqrt2 * p0 + 128 >> 8; 44303 v1 = dctSqrt2 * p4 + 128 >> 8; 44304 v2 = p2; 44305 v3 = p6; 44306 v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8; 44307 v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8; 44308 v5 = p3 << 4; 44309 v6 = p5 << 4; 44310 v0 = v0 + v1 + 1 >> 1; 44311 v1 = v0 - v1; 44312 t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8; 44313 v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8; 44314 v3 = t; 44315 v4 = v4 + v6 + 1 >> 1; 44316 v6 = v4 - v6; 44317 v7 = v7 + v5 + 1 >> 1; 44318 v5 = v7 - v5; 44319 v0 = v0 + v3 + 1 >> 1;
vendor: 1,817 bytes, lines 44320-44381
44320 v3 = v0 - v3; 44321 v1 = v1 + v2 + 1 >> 1; 44322 v2 = v1 - v2; 44323 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; 44324 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 44325 v7 = t; 44326 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 44327 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 44328 v6 = t; 44329 p[row] = v0 + v7; 44330 p[row + 7] = v0 - v7; 44331 p[row + 1] = v1 + v6; 44332 p[row + 6] = v1 - v6; 44333 p[row + 2] = v2 + v5; 44334 p[row + 5] = v2 - v5; 44335 p[row + 3] = v3 + v4; 44336 p[row + 4] = v3 - v4; 44337 } 44338 for (var col = 0; col < 8; ++col) { 44339 p0 = p[col]; 44340 p1 = p[col + 8]; 44341 p2 = p[col + 16]; 44342 p3 = p[col + 24]; 44343 p4 = p[col + 32]; 44344 p5 = p[col + 40]; 44345 p6 = p[col + 48]; 44346 p7 = p[col + 56]; 44347 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 44348 t = dctSqrt2 * p0 + 8192 >> 14; 44349 t = t < -2040 ? 0 : t >= 2024 ? 255 : t + 2056 >> 4; 44350 blockData[blockBufferOffset + col] = t; 44351 blockData[blockBufferOffset + col + 8] = t; 44352 blockData[blockBufferOffset + col + 16] = t; 44353 blockData[blockBufferOffset + col + 24] = t; 44354 blockData[blockBufferOffset + col + 32] = t; 44355 blockData[blockBufferOffset + col + 40] = t; 44356 blockData[blockBufferOffset + col + 48] = t; 44357 blockData[blockBufferOffset + col + 56] = t; 44358 continue; 44359 } 44360 v0 = dctSqrt2 * p0 + 2048 >> 12; 44361 v1 = dctSqrt2 * p4 + 2048 >> 12; 44362 v2 = p2; 44363 v3 = p6; 44364 v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12; 44365 v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12; 44366 v5 = p3; 44367 v6 = p5; 44368 v0 = (v0 + v1 + 1 >> 1) + 4112; 44369 v1 = v0 - v1; 44370 t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12; 44371 v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12; 44372 v3 = t; 44373 v4 = v4 + v6 + 1 >> 1; 44374 v6 = v4 - v6; 44375 v7 = v7 + v5 + 1 >> 1; 44376 v5 = v7 - v5; 44377 v0 = v0 + v3 + 1 >> 1; 44378 v3 = v0 - v3; 44379 v1 = v1 + v2 + 1 >> 1; 44380 v2 = v1 - v2; 44381 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >>
vendor: 13,985 bytes, lines 44381-44762
44381 12; 44382 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 44383 v7 = t; 44384 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 44385 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 44386 v6 = t; 44387 p0 = v0 + v7; 44388 p7 = v0 - v7; 44389 p1 = v1 + v6; 44390 p6 = v1 - v6; 44391 p2 = v2 + v5; 44392 p5 = v2 - v5; 44393 p3 = v3 + v4; 44394 p4 = v3 - v4; 44395 p0 = p0 < 16 ? 0 : p0 >= 4080 ? 255 : p0 >> 4; 44396 p1 = p1 < 16 ? 0 : p1 >= 4080 ? 255 : p1 >> 4; 44397 p2 = p2 < 16 ? 0 : p2 >= 4080 ? 255 : p2 >> 4; 44398 p3 = p3 < 16 ? 0 : p3 >= 4080 ? 255 : p3 >> 4; 44399 p4 = p4 < 16 ? 0 : p4 >= 4080 ? 255 : p4 >> 4; 44400 p5 = p5 < 16 ? 0 : p5 >= 4080 ? 255 : p5 >> 4; 44401 p6 = p6 < 16 ? 0 : p6 >= 4080 ? 255 : p6 >> 4; 44402 p7 = p7 < 16 ? 0 : p7 >= 4080 ? 255 : p7 >> 4; 44403 blockData[blockBufferOffset + col] = p0; 44404 blockData[blockBufferOffset + col + 8] = p1; 44405 blockData[blockBufferOffset + col + 16] = p2; 44406 blockData[blockBufferOffset + col + 24] = p3; 44407 blockData[blockBufferOffset + col + 32] = p4; 44408 blockData[blockBufferOffset + col + 40] = p5; 44409 blockData[blockBufferOffset + col + 48] = p6; 44410 blockData[blockBufferOffset + col + 56] = p7; 44411 } 44412 } 44413 function buildComponentData(frame, component) { 44414 var blocksPerLine = component.blocksPerLine; 44415 var blocksPerColumn = component.blocksPerColumn; 44416 var computationBuffer = new Int16Array(64); 44417 for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { 44418 for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { 44419 var offset = getBlockBufferOffset(component, blockRow, blockCol); 44420 quantizeAndInverse(component, offset, computationBuffer); 44421 } 44422 } 44423 return component.blockData; 44424 } 44425 function clamp0to255(a) { 44426 return a <= 0 ? 0 : a >= 255 ? 255 : a; 44427 } 44428 JpegImage.prototype = { 44429 parse: function parse(data) { 44430 function readUint16() { 44431 var value = data[offset] << 8 | data[offset + 1]; 44432 offset += 2; 44433 return value; 44434 } 44435 function readDataBlock() { 44436 var length = readUint16(); 44437 var array = data.subarray(offset, offset + length - 2); 44438 offset += array.length; 44439 return array; 44440 } 44441 function prepareComponents(frame) { 44442 var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); 44443 var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); 44444 for (var i = 0; i < frame.components.length; i++) { 44445 component = frame.components[i]; 44446 var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); 44447 var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV); 44448 var blocksPerLineForMcu = mcusPerLine * component.h; 44449 var blocksPerColumnForMcu = mcusPerColumn * component.v; 44450 var blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); 44451 component.blockData = new Int16Array(blocksBufferSize); 44452 component.blocksPerLine = blocksPerLine; 44453 component.blocksPerColumn = blocksPerColumn; 44454 } 44455 frame.mcusPerLine = mcusPerLine; 44456 frame.mcusPerColumn = mcusPerColumn; 44457 } 44458 var offset = 0; 44459 var jfif = null; 44460 var adobe = null; 44461 var frame, resetInterval; 44462 var quantizationTables = []; 44463 var huffmanTablesAC = [], huffmanTablesDC = []; 44464 var fileMarker = readUint16(); 44465 if (fileMarker !== 0xFFD8) { 44466 error('JPEG error: SOI not found'); 44467 } 44468 fileMarker = readUint16(); 44469 while (fileMarker !== 0xFFD9) { 44470 var i, j, l; 44471 switch (fileMarker) { 44472 case 0xFFE0: 44473 case 0xFFE1: 44474 case 0xFFE2: 44475 case 0xFFE3: 44476 case 0xFFE4: 44477 case 0xFFE5: 44478 case 0xFFE6: 44479 case 0xFFE7: 44480 case 0xFFE8: 44481 case 0xFFE9: 44482 case 0xFFEA: 44483 case 0xFFEB: 44484 case 0xFFEC: 44485 case 0xFFED: 44486 case 0xFFEE: 44487 case 0xFFEF: 44488 case 0xFFFE: 44489 var appData = readDataBlock(); 44490 if (fileMarker === 0xFFE0) { 44491 if (appData[0] === 0x4A && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) { 44492 jfif = { 44493 version: { 44494 major: appData[5], 44495 minor: appData[6] 44496 }, 44497 densityUnits: appData[7], 44498 xDensity: appData[8] << 8 | appData[9], 44499 yDensity: appData[10] << 8 | appData[11], 44500 thumbWidth: appData[12], 44501 thumbHeight: appData[13], 44502 thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) 44503 }; 44504 } 44505 } 44506 if (fileMarker === 0xFFEE) { 44507 if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6F && appData[3] === 0x62 && appData[4] === 0x65) { 44508 adobe = { 44509 version: appData[5] << 8 | appData[6], 44510 flags0: appData[7] << 8 | appData[8], 44511 flags1: appData[9] << 8 | appData[10], 44512 transformCode: appData[11] 44513 }; 44514 } 44515 } 44516 break; 44517 case 0xFFDB: 44518 var quantizationTablesLength = readUint16(); 44519 var quantizationTablesEnd = quantizationTablesLength + offset - 2; 44520 var z; 44521 while (offset < quantizationTablesEnd) { 44522 var quantizationTableSpec = data[offset++]; 44523 var tableData = new Uint16Array(64); 44524 if (quantizationTableSpec >> 4 === 0) { 44525 for (j = 0; j < 64; j++) { 44526 z = dctZigZag[j]; 44527 tableData[z] = data[offset++]; 44528 } 44529 } else if (quantizationTableSpec >> 4 === 1) { 44530 for (j = 0; j < 64; j++) { 44531 z = dctZigZag[j]; 44532 tableData[z] = readUint16(); 44533 } 44534 } else { 44535 error('JPEG error: DQT - invalid table spec'); 44536 } 44537 quantizationTables[quantizationTableSpec & 15] = tableData; 44538 } 44539 break; 44540 case 0xFFC0: 44541 case 0xFFC1: 44542 case 0xFFC2: 44543 if (frame) { 44544 error('JPEG error: Only single frame JPEGs supported'); 44545 } 44546 readUint16(); 44547 frame = {}; 44548 frame.extended = fileMarker === 0xFFC1; 44549 frame.progressive = fileMarker === 0xFFC2; 44550 frame.precision = data[offset++]; 44551 frame.scanLines = readUint16(); 44552 frame.samplesPerLine = readUint16(); 44553 frame.components = []; 44554 frame.componentIds = {}; 44555 var componentsCount = data[offset++], componentId; 44556 var maxH = 0, maxV = 0; 44557 for (i = 0; i < componentsCount; i++) { 44558 componentId = data[offset]; 44559 var h = data[offset + 1] >> 4; 44560 var v = data[offset + 1] & 15; 44561 if (maxH < h) { 44562 maxH = h; 44563 } 44564 if (maxV < v) { 44565 maxV = v; 44566 } 44567 var qId = data[offset + 2]; 44568 l = frame.components.push({ 44569 h: h, 44570 v: v, 44571 quantizationId: qId, 44572 quantizationTable: null 44573 }); 44574 frame.componentIds[componentId] = l - 1; 44575 offset += 3; 44576 } 44577 frame.maxH = maxH; 44578 frame.maxV = maxV; 44579 prepareComponents(frame); 44580 break; 44581 case 0xFFC4: 44582 var huffmanLength = readUint16(); 44583 for (i = 2; i < huffmanLength;) { 44584 var huffmanTableSpec = data[offset++]; 44585 var codeLengths = new Uint8Array(16); 44586 var codeLengthSum = 0; 44587 for (j = 0; j < 16; j++, offset++) { 44588 codeLengthSum += codeLengths[j] = data[offset]; 44589 } 44590 var huffmanValues = new Uint8Array(codeLengthSum); 44591 for (j = 0; j < codeLengthSum; j++, offset++) { 44592 huffmanValues[j] = data[offset]; 44593 } 44594 i += 17 + codeLengthSum; 44595 (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues); 44596 } 44597 break; 44598 case 0xFFDD: 44599 readUint16(); 44600 resetInterval = readUint16(); 44601 break; 44602 case 0xFFDA: 44603 readUint16(); 44604 var selectorsCount = data[offset++]; 44605 var components = [], component; 44606 for (i = 0; i < selectorsCount; i++) { 44607 var componentIndex = frame.componentIds[data[offset++]]; 44608 component = frame.components[componentIndex]; 44609 var tableSpec = data[offset++]; 44610 component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; 44611 component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; 44612 components.push(component); 44613 } 44614 var spectralStart = data[offset++]; 44615 var spectralEnd = data[offset++]; 44616 var successiveApproximation = data[offset++]; 44617 var processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15); 44618 offset += processed; 44619 break; 44620 case 0xFFFF: 44621 if (data[offset] !== 0xFF) { 44622 offset--; 44623 } 44624 break; 44625 default: 44626 if (data[offset - 3] === 0xFF && data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { 44627 offset -= 3; 44628 break; 44629 } 44630 error('JPEG error: unknown marker ' + fileMarker.toString(16)); 44631 } 44632 fileMarker = readUint16(); 44633 } 44634 this.width = frame.samplesPerLine; 44635 this.height = frame.scanLines; 44636 this.jfif = jfif; 44637 this.adobe = adobe; 44638 this.components = []; 44639 for (i = 0; i < frame.components.length; i++) { 44640 component = frame.components[i]; 44641 var quantizationTable = quantizationTables[component.quantizationId]; 44642 if (quantizationTable) { 44643 component.quantizationTable = quantizationTable; 44644 } 44645 this.components.push({ 44646 output: buildComponentData(frame, component), 44647 scaleX: component.h / frame.maxH, 44648 scaleY: component.v / frame.maxV, 44649 blocksPerLine: component.blocksPerLine, 44650 blocksPerColumn: component.blocksPerColumn 44651 }); 44652 } 44653 this.numComponents = this.components.length; 44654 }, 44655 _getLinearizedBlockData: function getLinearizedBlockData(width, height) { 44656 var scaleX = this.width / width, scaleY = this.height / height; 44657 var component, componentScaleX, componentScaleY, blocksPerScanline; 44658 var x, y, i, j, k; 44659 var index; 44660 var offset = 0; 44661 var output; 44662 var numComponents = this.components.length; 44663 var dataLength = width * height * numComponents; 44664 var data = new Uint8Array(dataLength); 44665 var xScaleBlockOffset = new Uint32Array(width); 44666 var mask3LSB = 0xfffffff8; 44667 for (i = 0; i < numComponents; i++) { 44668 component = this.components[i]; 44669 componentScaleX = component.scaleX * scaleX; 44670 componentScaleY = component.scaleY * scaleY; 44671 offset = i; 44672 output = component.output; 44673 blocksPerScanline = component.blocksPerLine + 1 << 3; 44674 for (x = 0; x < width; x++) { 44675 j = 0 | x * componentScaleX; 44676 xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7; 44677 } 44678 for (y = 0; y < height; y++) { 44679 j = 0 | y * componentScaleY; 44680 index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3; 44681 for (x = 0; x < width; x++) { 44682 data[offset] = output[index + xScaleBlockOffset[x]]; 44683 offset += numComponents; 44684 } 44685 } 44686 } 44687 var transform = this.decodeTransform; 44688 if (transform) { 44689 for (i = 0; i < dataLength;) { 44690 for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { 44691 data[i] = (data[i] * transform[k] >> 8) + transform[k + 1]; 44692 } 44693 } 44694 } 44695 return data; 44696 }, 44697 _isColorConversionNeeded: function isColorConversionNeeded() { 44698 if (this.adobe && this.adobe.transformCode) { 44699 return true; 44700 } else if (this.numComponents === 3) { 44701 if (!this.adobe && this.colorTransform === 0) { 44702 return false; 44703 } 44704 return true; 44705 } 44706 if (!this.adobe && this.colorTransform === 1) { 44707 return true; 44708 } 44709 return false; 44710 }, 44711 _convertYccToRgb: function convertYccToRgb(data) { 44712 var Y, Cb, Cr; 44713 for (var i = 0, length = data.length; i < length; i += 3) { 44714 Y = data[i]; 44715 Cb = data[i + 1]; 44716 Cr = data[i + 2]; 44717 data[i] = clamp0to255(Y - 179.456 + 1.402 * Cr); 44718 data[i + 1] = clamp0to255(Y + 135.459 - 0.344 * Cb - 0.714 * Cr); 44719 data[i + 2] = clamp0to255(Y - 226.816 + 1.772 * Cb); 44720 } 44721 return data; 44722 }, 44723 _convertYcckToRgb: function convertYcckToRgb(data) { 44724 var Y, Cb, Cr, k; 44725 var offset = 0; 44726 for (var i = 0, length = data.length; i < length; i += 4) { 44727 Y = data[i]; 44728 Cb = data[i + 1]; 44729 Cr = data[i + 2]; 44730 k = data[i + 3]; 44731 var r = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); 44732 var g = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); 44733 var b = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); 44734 data[offset++] = clamp0to255(r); 44735 data[offset++] = clamp0to255(g); 44736 data[offset++] = clamp0to255(b); 44737 } 44738 return data; 44739 }, 44740 _convertYcckToCmyk: function convertYcckToCmyk(data) { 44741 var Y, Cb, Cr; 44742 for (var i = 0, length = data.length; i < length; i += 4) { 44743 Y = data[i]; 44744 Cb = data[i + 1]; 44745 Cr = data[i + 2]; 44746 data[i] = clamp0to255(434.456 - Y - 1.402 * Cr); 44747 data[i + 1] = clamp0to255(119.541 - Y + 0.344 * Cb + 0.714 * Cr); 44748 data[i + 2] = clamp0to255(481.816 - Y - 1.772 * Cb); 44749 } 44750 return data; 44751 }, 44752 _convertCmykToRgb: function convertCmykToRgb(data) { 44753 var c, m, y, k; 44754 var offset = 0; 44755 var min = -255 * 255 * 255; 44756 var scale = 1 / 255 / 255; 44757 for (var i = 0, length = data.length; i < length; i += 4) { 44758 c = data[i]; 44759 m = data[i + 1]; 44760 y = data[i + 2]; 44761 k = data[i + 3]; 44762 var r = c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k - 72734.4411664936) + m * (1.7149763477362134 * m - 5.6096736904047315 * y - 17.873870861415444 * k - 1401.7366389350734) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 4465.541406466231) - k * (21.86122147463605 * k + 48317.86113160301);
44763 var g = c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k - 20220.756542821975) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 48691.05921601825) + y * (4.444339102852739 * y + 9.8632861493405 * k - 6341.191035517494) - k * (20.737325471181034 * k + 47890.15695978492); 44764 var b = c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k - 3616.812083916688) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 28620.90484698408) + y * (0.03296041114873217 * y + 115.60384449646641 * k - 49363.43385999684) - k * (22.33816807309886 * k + 45932.16563550634); 44765 data[offset++] = r >= 0 ? 255 : r <= min ? 0 : 255 + r * scale | 0; 44766 data[offset++] = g >= 0 ? 255 : g <= min ? 0 : 255 + g * scale | 0; 44767 data[offset++] = b >= 0 ? 255 : b <= min ? 0 : 255 + b * scale | 0; 44768 } 44769 return data; 44770 }, 44771 getData: function getData(width, height, forceRGBoutput) { 44772 if (this.numComponents > 4) { 44773 error('JPEG error: Unsupported color mode'); 44774 } 44775 var data = this._getLinearizedBlockData(width, height); 44776 if (this.numComponents === 1 && forceRGBoutput) { 44777 var dataLength = data.length; 44778 var rgbData = new Uint8Array(dataLength * 3); 44779 var offset = 0; 44780 for (var i = 0; i < dataLength; i++) { 44781 var grayColor = data[i]; 44782 rgbData[offset++] = grayColor; 44783 rgbData[offset++] = grayColor; 44784 rgbData[offset++] = grayColor; 44785 } 44786 return rgbData; 44787 } else if (this.numComponents === 3 && this._isColorConversionNeeded()) { 44788 return this._convertYccToRgb(data); 44789 } else if (this.numComponents === 4) { 44790 if (this._isColorConversionNeeded()) { 44791 if (forceRGBoutput) { 44792 return this._convertYcckToRgb(data); 44793 } 44794 return this._convertYcckToCmyk(data); 44795 } else if (forceRGBoutput) { 44796 return this._convertCmykToRgb(data); 44797 } 44798 } 44799 return data; 44800 } 44801 }; 44802 return JpegImage; 44803}(); 44804exports.JpegImage = JpegImage; 44805 44806/***/ }), 44807/* 30 */ 44808/***/ (function(module, exports, __w_pdfjs_require__) { 44809 44810"use strict"; 44811 44812var sharedUtil = __w_pdfjs_require__(0); 44813var getLookupTableFactory = sharedUtil.getLookupTableFactory; 44814var getMetrics = getLookupTableFactory(function (t) { 44815 t['Courier'] = 600; 44816 t['Courier-Bold'] = 600; 44817 t['Courier-BoldOblique'] = 600; 44818 t['Courier-Oblique'] = 600; 44819 t['Helvetica'] = getLookupTableFactory(function (t) { 44820 t['space'] = 278; 44821 t['exclam'] = 278; 44822 t['quotedbl'] = 355; 44823 t['numbersign'] = 556; 44824 t['dollar'] = 556; 44825 t['percent'] = 889; 44826 t['ampersand'] = 667; 44827 t['quoteright'] = 222; 44828 t['parenleft'] = 333; 44829 t['parenright'] = 333; 44830 t['asterisk'] = 389; 44831 t['plus'] = 584; 44832 t['comma'] = 278; 44833 t['hyphen'] = 333; 44834 t['period'] = 278; 44835 t['slash'] = 278; 44836 t['zero'] = 556; 44837 t['one'] = 556; 44838 t['two'] = 556; 44839 t['three'] = 556; 44840 t['four'] = 556; 44841 t['five'] = 556; 44842 t['six'] = 556; 44843 t['seven'] = 556; 44844 t['eight'] = 556; 44845 t['nine'] = 556; 44846 t['colon'] = 278; 44847 t['semicolon'] = 278; 44848 t['less'] = 584; 44849 t['equal'] = 584; 44850 t['greater'] = 584; 44851 t['question'] = 556; 44852 t['at'] = 1015; 44853 t['A'] = 667; 44854 t['B'] = 667; 44855 t['C'] = 722; 44856 t['D'] = 722; 44857 t['E'] = 667; 44858 t['F'] = 611; 44859 t['G'] = 778; 44860 t['H'] = 722; 44861 t['I'] = 278; 44862 t['J'] = 500; 44863 t['K'] = 667; 44864 t['L'] = 556; 44865 t['M'] = 833; 44866 t['N'] = 722; 44867 t['O'] = 778; 44868 t['P'] = 667; 44869 t['Q'] = 778; 44870 t['R'] = 722; 44871 t['S'] = 667; 44872 t['T'] = 611; 44873 t['U'] = 722; 44874 t['V'] = 667; 44875 t['W'] = 944; 44876 t['X'] = 667; 44877 t['Y'] = 667; 44878 t['Z'] = 611; 44879 t['bracketleft'] = 278; 44880 t['backslash'] = 278; 44881 t['bracketright'] = 278; 44882 t['asciicircum'] = 469; 44883 t['underscore'] = 556; 44884 t['quoteleft'] = 222; 44885 t['a'] = 556; 44886 t['b'] = 556; 44887 t['c'] = 500; 44888 t['d'] = 556; 44889 t['e'] = 556; 44890 t['f'] = 278; 44891 t['g'] = 556; 44892 t['h'] = 556; 44893 t['i'] = 222; 44894 t['j'] = 222; 44895 t['k'] = 500; 44896 t['l'] = 222; 44897 t['m'] = 833; 44898 t['n'] = 556; 44899 t['o'] = 556; 44900 t['p'] = 556; 44901 t['q'] = 556; 44902 t['r'] = 333; 44903 t['s'] = 500; 44904 t['t'] = 278; 44905 t['u'] = 556; 44906 t['v'] = 500; 44907 t['w'] = 722; 44908 t['x'] = 500; 44909 t['y'] = 500; 44910 t['z'] = 500; 44911 t['braceleft'] = 334; 44912 t['bar'] = 260; 44913 t['braceright'] = 334; 44914 t['asciitilde'] = 584; 44915 t['exclamdown'] = 333; 44916 t['cent'] = 556; 44917 t['sterling'] = 556; 44918 t['fraction'] = 167; 44919 t['yen'] = 556; 44920 t['florin'] = 556; 44921 t['section'] = 556; 44922 t['currency'] = 556; 44923 t['quotesingle'] = 191; 44924 t['quotedblleft'] = 333; 44925 t['guillemotleft'] = 556; 44926 t['guilsinglleft'] = 333; 44927 t['guilsinglright'] = 333; 44928 t['fi'] = 500; 44929 t['fl'] = 500; 44930 t['endash'] = 556; 44931 t['dagger'] = 556; 44932 t['daggerdbl'] = 556;
44933 t['periodcentered'] = 278; 44934 t['paragraph'] = 537; 44935 t['bullet'] = 350; 44936 t['quotesinglbase'] = 222; 44937 t['quotedblbase'] = 333; 44938 t['quotedblright'] = 333; 44939 t['guillemotright'] = 556; 44940 t['ellipsis'] = 1000; 44941 t['perthousand'] = 1000; 44942 t['questiondown'] = 611; 44943 t['grave'] = 333; 44944 t['acute'] = 333; 44945 t['circumflex'] = 333; 44946 t['tilde'] = 333; 44947 t['macron'] = 333; 44948 t['breve'] = 333; 44949 t['dotaccent'] = 333; 44950 t['dieresis'] = 333; 44951 t['ring'] = 333; 44952 t['cedilla'] = 333; 44953 t['hungarumlaut'] = 333; 44954 t['ogonek'] = 333; 44955 t['caron'] = 333; 44956 t['emdash'] = 1000; 44957 t['AE'] = 1000; 44958 t['ordfeminine'] = 370; 44959 t['Lslash'] = 556; 44960 t['Oslash'] = 778; 44961 t['OE'] = 1000; 44962 t['ordmasculine'] = 365; 44963 t['ae'] = 889; 44964 t['dotlessi'] = 278; 44965 t['lslash'] = 222; 44966 t['oslash'] = 611; 44967 t['oe'] = 944; 44968 t['germandbls'] = 611; 44969 t['Idieresis'] = 278; 44970 t['eacute'] = 556; 44971 t['abreve'] = 556; 44972 t['uhungarumlaut'] = 556; 44973 t['ecaron'] = 556; 44974 t['Ydieresis'] = 667; 44975 t['divide'] = 584; 44976 t['Yacute'] = 667; 44977 t['Acircumflex'] = 667; 44978 t['aacute'] = 556; 44979 t['Ucircumflex'] = 722; 44980 t['yacute'] = 500; 44981 t['scommaaccent'] = 500; 44982 t['ecircumflex'] = 556; 44983 t['Uring'] = 722; 44984 t['Udieresis'] = 722; 44985 t['aogonek'] = 556; 44986 t['Uacute'] = 722; 44987 t['uogonek'] = 556; 44988 t['Edieresis'] = 667; 44989 t['Dcroat'] = 722; 44990 t['commaaccent'] = 250; 44991 t['copyright'] = 737; 44992 t['Emacron'] = 667; 44993 t['ccaron'] = 500; 44994 t['aring'] = 556; 44995 t['Ncommaaccent'] = 722; 44996 t['lacute'] = 222; 44997 t['agrave'] = 556; 44998 t['Tcommaaccent'] = 611; 44999 t['Cacute'] = 722; 45000 t['atilde'] = 556; 45001 t['Edotaccent'] = 667; 45002 t['scaron'] = 500; 45003 t['scedilla'] = 500; 45004 t['iacute'] = 278; 45005 t['lozenge'] = 471; 45006 t['Rcaron'] = 722; 45007 t['Gcommaaccent'] = 778; 45008 t['ucircumflex'] = 556; 45009 t['acircumflex'] = 556; 45010 t['Amacron'] = 667; 45011 t['rcaron'] = 333; 45012 t['ccedilla'] = 500; 45013 t['Zdotaccent'] = 611; 45014 t['Thorn'] = 667; 45015 t['Omacron'] = 778; 45016 t['Racute'] = 722; 45017 t['Sacute'] = 667; 45018 t['dcaron'] = 643; 45019 t['Umacron'] = 722; 45020 t['uring'] = 556; 45021 t['threesuperior'] = 333; 45022 t['Ograve'] = 778; 45023 t['Agrave'] = 667; 45024 t['Abreve'] = 667; 45025 t['multiply'] = 584; 45026 t['uacute'] = 556; 45027 t['Tcaron'] = 611; 45028 t['partialdiff'] = 476; 45029 t['ydieresis'] = 500; 45030 t['Nacute'] = 722; 45031 t['icircumflex'] = 278; 45032 t['Ecircumflex'] = 667; 45033 t['adieresis'] = 556; 45034 t['edieresis'] = 556; 45035 t['cacute'] = 500; 45036 t['nacute'] = 556; 45037 t['umacron'] = 556; 45038 t['Ncaron'] = 722; 45039 t['Iacute'] = 278; 45040 t['plusminus'] = 584; 45041 t['brokenbar'] = 260; 45042 t['registered'] = 737; 45043 t['Gbreve'] = 778; 45044 t['Idotaccent'] = 278; 45045 t['summation'] = 600; 45046 t['Egrave'] = 667; 45047 t['racute'] = 333; 45048 t['omacron'] = 556; 45049 t['Zacute'] = 611; 45050 t['Zcaron'] = 611; 45051 t['greaterequal'] = 549; 45052 t['Eth'] = 722; 45053 t['Ccedilla'] = 722; 45054 t['lcommaaccent'] = 222; 45055 t['tcaron'] = 317; 45056 t['eogonek'] = 556; 45057 t['Uogonek'] = 722; 45058 t['Aacute'] = 667; 45059 t['Adieresis'] = 667; 45060 t['egrave'] = 556; 45061 t['zacute'] = 500; 45062 t['iogonek'] = 222; 45063 t['Oacute'] = 778; 45064 t['oacute'] = 556; 45065 t['amacron'] = 556; 45066 t['sacute'] = 500; 45067 t['idieresis'] = 278; 45068 t['Ocircumflex'] = 778; 45069 t['Ugrave'] = 722; 45070 t['Delta'] = 612; 45071 t['thorn'] = 556; 45072 t['twosuperior'] = 333; 45073 t['Odieresis'] = 778; 45074 t['mu'] = 556; 45075 t['igrave'] = 278; 45076 t['ohungarumlaut'] = 556; 45077 t['Eogonek'] = 667; 45078 t['dcroat'] = 556; 45079 t['threequarters'] = 834; 45080 t['Scedilla'] = 667; 45081 t['lcaron'] = 299; 45082 t['Kcommaaccent'] = 667; 45083 t['Lacute'] = 556; 45084 t['trademark'] = 1000; 45085 t['edotaccent'] = 556; 45086 t['Igrave'] = 278; 45087 t['Imacron'] = 278; 45088 t['Lcaron'] = 556; 45089 t['onehalf'] = 834; 45090 t['lessequal'] = 549; 45091 t['ocircumflex'] = 556; 45092 t['ntilde'] = 556; 45093 t['Uhungarumlaut'] = 722; 45094 t['Eacute'] = 667; 45095 t['emacron'] = 556; 45096 t['gbreve'] = 556; 45097 t['onequarter'] = 834; 45098 t['Scaron'] = 667; 45099 t['Scommaaccent'] = 667; 45100 t['Ohungarumlaut'] = 778; 45101 t['degree'] = 400; 45102 t['ograve'] = 556; 45103 t['Ccaron'] = 722; 45104 t['ugrave'] = 556; 45105 t['radical'] = 453; 45106 t['Dcaron'] = 722; 45107 t['rcommaaccent'] = 333; 45108 t['Ntilde'] = 722; 45109 t['otilde'] = 556; 45110 t['Rcommaaccent'] = 722; 45111 t['Lcommaaccent'] = 556; 45112 t['Atilde'] = 667; 45113 t['Aogonek'] = 667; 45114 t['Aring'] = 667; 45115 t['Otilde'] = 778; 45116 t['zdotaccent'] = 500; 45117 t['Ecaron'] = 667; 45118 t['Iogonek'] = 278; 45119 t['kcommaaccent'] = 500; 45120 t['minus'] = 584; 45121 t['Icircumflex'] = 278; 45122 t['ncaron'] = 556; 45123 t['tcommaaccent'] = 278; 45124 t['logicalnot'] = 584; 45125 t['odieresis'] = 556; 45126 t['udieresis'] = 556; 45127 t['notequal'] = 549; 45128 t['gcommaaccent'] = 556; 45129 t['eth'] = 556; 45130 t['zcaron'] = 500; 45131 t['ncommaaccent'] = 556; 45132 t['onesuperior'] = 333; 45133 t['imacron'] = 278; 45134 t['Euro'] = 556; 45135 }); 45136 t['Helvetica-Bold'] = getLookupTableFactory(function (t) { 45137 t['space'] = 278; 45138 t['exclam'] = 333; 45139 t['quotedbl'] = 474; 45140 t['numbersign'] = 556; 45141 t['dollar'] = 556; 45142 t['percent'] = 889; 45143 t['ampersand'] = 722; 45144 t['quoteright'] = 278; 45145 t['parenleft'] = 333; 45146 t['parenright'] = 333; 45147 t['asterisk'] = 389; 45148 t['plus'] = 584; 45149 t['comma'] = 278; 45150 t['hyphen'] = 333; 45151 t['period'] = 278; 45152 t['slash'] = 278; 45153 t['zero'] = 556; 45154 t['one'] = 556; 45155 t['two'] = 556; 45156 t['three'] = 556; 45157 t['four'] = 556; 45158 t['five'] = 556; 45159 t['six'] = 556; 45160 t['seven'] = 556; 45161 t['eight'] = 556; 45162 t['nine'] = 556; 45163 t['colon'] = 333; 45164 t['semicolon'] = 333; 45165 t['less'] = 584; 45166 t['equal'] = 584; 45167 t['greater'] = 584; 45168 t['question'] = 611; 45169 t['at'] = 975; 45170 t['A'] = 722; 45171 t['B'] = 722; 45172 t['C'] = 722; 45173 t['D'] = 722; 45174 t['E'] = 667; 45175 t['F'] = 611; 45176 t['G'] = 778; 45177 t['H'] = 722; 45178 t['I'] = 278; 45179 t['J'] = 556; 45180 t['K'] = 722; 45181 t['L'] = 611; 45182 t['M'] = 833; 45183 t['N'] = 722; 45184 t['O'] = 778; 45185 t['P'] = 667; 45186 t['Q'] = 778; 45187 t['R'] = 722; 45188 t['S'] = 667; 45189 t['T'] = 611; 45190 t['U'] = 722; 45191 t['V'] = 667; 45192 t['W'] = 944; 45193 t['X'] = 667; 45194 t['Y'] = 667; 45195 t['Z'] = 611; 45196 t['bracketleft'] = 333; 45197 t['backslash'] = 278; 45198 t['bracketright'] = 333; 45199 t['asciicircum'] = 584; 45200 t['underscore'] = 556; 45201 t['quoteleft'] = 278; 45202 t['a'] = 556; 45203 t['b'] = 611; 45204 t['c'] = 556; 45205 t['d'] = 611; 45206 t['e'] = 556; 45207 t['f'] = 333; 45208 t['g'] = 611; 45209 t['h'] = 611;
45210 t['i'] = 278; 45211 t['j'] = 278; 45212 t['k'] = 556; 45213 t['l'] = 278; 45214 t['m'] = 889; 45215 t['n'] = 611; 45216 t['o'] = 611; 45217 t['p'] = 611; 45218 t['q'] = 611; 45219 t['r'] = 389; 45220 t['s'] = 556; 45221 t['t'] = 333; 45222 t['u'] = 611; 45223 t['v'] = 556; 45224 t['w'] = 778; 45225 t['x'] = 556; 45226 t['y'] = 556; 45227 t['z'] = 500; 45228 t['braceleft'] = 389; 45229 t['bar'] = 280; 45230 t['braceright'] = 389; 45231 t['asciitilde'] = 584; 45232 t['exclamdown'] = 333; 45233 t['cent'] = 556; 45234 t['sterling'] = 556; 45235 t['fraction'] = 167; 45236 t['yen'] = 556; 45237 t['florin'] = 556; 45238 t['section'] = 556; 45239 t['currency'] = 556; 45240 t['quotesingle'] = 238; 45241 t['quotedblleft'] = 500; 45242 t['guillemotleft'] = 556; 45243 t['guilsinglleft'] = 333; 45244 t['guilsinglright'] = 333; 45245 t['fi'] = 611; 45246 t['fl'] = 611; 45247 t['endash'] = 556; 45248 t['dagger'] = 556; 45249 t['daggerdbl'] = 556; 45250 t['periodcentered'] = 278; 45251 t['paragraph'] = 556; 45252 t['bullet'] = 350; 45253 t['quotesinglbase'] = 278; 45254 t['quotedblbase'] = 500; 45255 t['quotedblright'] = 500; 45256 t['guillemotright'] = 556; 45257 t['ellipsis'] = 1000; 45258 t['perthousand'] = 1000; 45259 t['questiondown'] = 611; 45260 t['grave'] = 333; 45261 t['acute'] = 333; 45262 t['circumflex'] = 333; 45263 t['tilde'] = 333; 45264 t['macron'] = 333; 45265 t['breve'] = 333; 45266 t['dotaccent'] = 333; 45267 t['dieresis'] = 333; 45268 t['ring'] = 333; 45269 t['cedilla'] = 333; 45270 t['hungarumlaut'] = 333; 45271 t['ogonek'] = 333; 45272 t['caron'] = 333; 45273 t['emdash'] = 1000; 45274 t['AE'] = 1000; 45275 t['ordfeminine'] = 370; 45276 t['Lslash'] = 611; 45277 t['Oslash'] = 778; 45278 t['OE'] = 1000; 45279 t['ordmasculine'] = 365; 45280 t['ae'] = 889; 45281 t['dotlessi'] = 278; 45282 t['lslash'] = 278; 45283 t['oslash'] = 611; 45284 t['oe'] = 944; 45285 t['germandbls'] = 611; 45286 t['Idieresis'] = 278; 45287 t['eacute'] = 556; 45288 t['abreve'] = 556; 45289 t['uhungarumlaut'] = 611; 45290 t['ecaron'] = 556; 45291 t['Ydieresis'] = 667; 45292 t['divide'] = 584; 45293 t['Yacute'] = 667; 45294 t['Acircumflex'] = 722; 45295 t['aacute'] = 556; 45296 t['Ucircumflex'] = 722; 45297 t['yacute'] = 556; 45298 t['scommaaccent'] = 556; 45299 t['ecircumflex'] = 556; 45300 t['Uring'] = 722; 45301 t['Udieresis'] = 722; 45302 t['aogonek'] = 556; 45303 t['Uacute'] = 722; 45304 t['uogonek'] = 611; 45305 t['Edieresis'] = 667; 45306 t['Dcroat'] = 722; 45307 t['commaaccent'] = 250; 45308 t['copyright'] = 737; 45309 t['Emacron'] = 667; 45310 t['ccaron'] = 556; 45311 t['aring'] = 556; 45312 t['Ncommaaccent'] = 722; 45313 t['lacute'] = 278; 45314 t['agrave'] = 556; 45315 t['Tcommaaccent'] = 611; 45316 t['Cacute'] = 722; 45317 t['atilde'] = 556; 45318 t['Edotaccent'] = 667; 45319 t['scaron'] = 556; 45320 t['scedilla'] = 556; 45321 t['iacute'] = 278; 45322 t['lozenge'] = 494; 45323 t['Rcaron'] = 722; 45324 t['Gcommaaccent'] = 778; 45325 t['ucircumflex'] = 611; 45326 t['acircumflex'] = 556; 45327 t['Amacron'] = 722; 45328 t['rcaron'] = 389; 45329 t['ccedilla'] = 556; 45330 t['Zdotaccent'] = 611; 45331 t['Thorn'] = 667; 45332 t['Omacron'] = 778; 45333 t['Racute'] = 722; 45334 t['Sacute'] = 667; 45335 t['dcaron'] = 743; 45336 t['Umacron'] = 722; 45337 t['uring'] = 611; 45338 t['threesuperior'] = 333; 45339 t['Ograve'] = 778; 45340 t['Agrave'] = 722; 45341 t['Abreve'] = 722; 45342 t['multiply'] = 584; 45343 t['uacute'] = 611; 45344 t['Tcaron'] = 611; 45345 t['partialdiff'] = 494; 45346 t['ydieresis'] = 556; 45347 t['Nacute'] = 722; 45348 t['icircumflex'] = 278; 45349 t['Ecircumflex'] = 667; 45350 t['adieresis'] = 556; 45351 t['edieresis'] = 556; 45352 t['cacute'] = 556; 45353 t['nacute'] = 611; 45354 t['umacron'] = 611; 45355 t['Ncaron'] = 722; 45356 t['Iacute'] = 278; 45357 t['plusminus'] = 584; 45358 t['brokenbar'] = 280; 45359 t['registered'] = 737; 45360 t['Gbreve'] = 778; 45361 t['Idotaccent'] = 278; 45362 t['summation'] = 600; 45363 t['Egrave'] = 667; 45364 t['racute'] = 389; 45365 t['omacron'] = 611; 45366 t['Zacute'] = 611; 45367 t['Zcaron'] = 611; 45368 t['greaterequal'] = 549; 45369 t['Eth'] = 722; 45370 t['Ccedilla'] = 722; 45371 t['lcommaaccent'] = 278; 45372 t['tcaron'] = 389; 45373 t['eogonek'] = 556; 45374 t['Uogonek'] = 722; 45375 t['Aacute'] = 722; 45376 t['Adieresis'] = 722; 45377 t['egrave'] = 556; 45378 t['zacute'] = 500; 45379 t['iogonek'] = 278; 45380 t['Oacute'] = 778; 45381 t['oacute'] = 611; 45382 t['amacron'] = 556; 45383 t['sacute'] = 556; 45384 t['idieresis'] = 278; 45385 t['Ocircumflex'] = 778; 45386 t['Ugrave'] = 722; 45387 t['Delta'] = 612; 45388 t['thorn'] = 611; 45389 t['twosuperior'] = 333; 45390 t['Odieresis'] = 778; 45391 t['mu'] = 611; 45392 t['igrave'] = 278; 45393 t['ohungarumlaut'] = 611; 45394 t['Eogonek'] = 667; 45395 t['dcroat'] = 611; 45396 t['threequarters'] = 834; 45397 t['Scedilla'] = 667; 45398 t['lcaron'] = 400; 45399 t['Kcommaaccent'] = 722; 45400 t['Lacute'] = 611; 45401 t['trademark'] = 1000; 45402 t['edotaccent'] = 556; 45403 t['Igrave'] = 278; 45404 t['Imacron'] = 278; 45405 t['Lcaron'] = 611; 45406 t['onehalf'] = 834; 45407 t['lessequal'] = 549; 45408 t['ocircumflex'] = 611; 45409 t['ntilde'] = 611; 45410 t['Uhungarumlaut'] = 722; 45411 t['Eacute'] = 667; 45412 t['emacron'] = 556; 45413 t['gbreve'] = 611; 45414 t['onequarter'] = 834; 45415 t['Scaron'] = 667; 45416 t['Scommaaccent'] = 667; 45417 t['Ohungarumlaut'] = 778; 45418 t['degree'] = 400; 45419 t['ograve'] = 611; 45420 t['Ccaron'] = 722; 45421 t['ugrave'] = 611; 45422 t['radical'] = 549; 45423 t['Dcaron'] = 722; 45424 t['rcommaaccent'] = 389; 45425 t['Ntilde'] = 722; 45426 t['otilde'] = 611; 45427 t['Rcommaaccent'] = 722; 45428 t['Lcommaaccent'] = 611; 45429 t['Atilde'] = 722; 45430 t['Aogonek'] = 722; 45431 t['Aring'] = 722; 45432 t['Otilde'] = 778; 45433 t['zdotaccent'] = 500; 45434 t['Ecaron'] = 667; 45435 t['Iogonek'] = 278; 45436 t['kcommaaccent'] = 556; 45437 t['minus'] = 584; 45438 t['Icircumflex'] = 278; 45439 t['ncaron'] = 611; 45440 t['tcommaaccent'] = 333; 45441 t['logicalnot'] = 584; 45442 t['odieresis'] = 611; 45443 t['udieresis'] = 611; 45444 t['notequal'] = 549; 45445 t['gcommaaccent'] = 611; 45446 t['eth'] = 611; 45447 t['zcaron'] = 500; 45448 t['ncommaaccent'] = 611; 45449 t['onesuperior'] = 333; 45450 t['imacron'] = 278; 45451 t['Euro'] = 556; 45452 }); 45453 t['Helvetica-BoldOblique'] = getLookupTableFactory(function (t) { 45454 t['space'] = 278; 45455 t['exclam'] = 333; 45456 t['quotedbl'] = 474; 45457 t['numbersign'] = 556; 45458 t['dollar'] = 556; 45459 t['percent'] = 889; 45460 t['ampersand'] = 722; 45461 t['quoteright'] = 278; 45462 t['parenleft'] = 333; 45463 t['parenright'] = 333; 45464 t['asterisk'] = 389; 45465 t['plus'] = 584; 45466 t['comma'] = 278; 45467 t['hyphen'] = 333; 45468 t['period'] = 278; 45469 t['slash'] = 278; 45470 t['zero'] = 556; 45471 t['one'] = 556; 45472 t['two'] = 556; 45473 t['three'] = 556; 45474 t['four'] = 556; 45475 t['five'] = 556; 45476 t['six'] = 556; 45477 t['seven'] = 556; 45478 t['eight'] = 556; 45479 t['nine'] = 556; 45480 t['colon'] = 333; 45481 t['semicolon'] = 333; 45482 t['less'] = 584; 45483 t['equal'] = 584; 45484 t['greater'] = 584; 45485 t['question'] = 611; 45486 t['at'] = 975; 45487 t['A'] = 722; 45488 t['B'] = 722; 45489 t['C'] = 722; 45490 t['D'] = 722; 45491 t['E'] = 667; 45492 t['F'] = 611; 45493 t['G'] = 778; 45494 t['H'] = 722; 45495 t['I'] = 278; 45496 t['J'] = 556; 45497 t['K'] = 722; 45498 t['L'] = 611; 45499 t['M'] = 833; 45500 t['N'] = 722; 45501 t['O'] = 778; 45502 t['P'] = 667; 45503 t['Q'] = 778; 45504 t['R'] = 722; 45505 t['S'] = 667; 45506 t['T'] = 611; 45507 t['U'] = 722; 45508 t['V'] = 667; 45509 t['W'] = 944; 45510 t['X'] = 667; 45511 t['Y'] = 667; 45512 t['Z'] = 611; 45513 t['bracketleft'] = 333; 45514 t['backslash'] = 278; 45515 t['bracketright'] = 333; 45516 t['asciicircum'] = 584; 45517 t['underscore'] = 556; 45518 t['quoteleft'] = 278; 45519 t['a'] = 556; 45520 t['b'] = 611; 45521 t['c'] = 556; 45522 t['d'] = 611; 45523 t['e'] = 556; 45524 t['f'] = 333; 45525 t['g'] = 611; 45526 t['h'] = 611;
45527 t['i'] = 278; 45528 t['j'] = 278; 45529 t['k'] = 556; 45530 t['l'] = 278; 45531 t['m'] = 889; 45532 t['n'] = 611; 45533 t['o'] = 611; 45534 t['p'] = 611; 45535 t['q'] = 611; 45536 t['r'] = 389; 45537 t['s'] = 556; 45538 t['t'] = 333; 45539 t['u'] = 611; 45540 t['v'] = 556; 45541 t['w'] = 778; 45542 t['x'] = 556; 45543 t['y'] = 556; 45544 t['z'] = 500; 45545 t['braceleft'] = 389; 45546 t['bar'] = 280; 45547 t['braceright'] = 389; 45548 t['asciitilde'] = 584; 45549 t['exclamdown'] = 333; 45550 t['cent'] = 556; 45551 t['sterling'] = 556; 45552 t['fraction'] = 167; 45553 t['yen'] = 556; 45554 t['florin'] = 556; 45555 t['section'] = 556; 45556 t['currency'] = 556; 45557 t['quotesingle'] = 238; 45558 t['quotedblleft'] = 500; 45559 t['guillemotleft'] = 556; 45560 t['guilsinglleft'] = 333; 45561 t['guilsinglright'] = 333; 45562 t['fi'] = 611; 45563 t['fl'] = 611; 45564 t['endash'] = 556; 45565 t['dagger'] = 556; 45566 t['daggerdbl'] = 556; 45567 t['periodcentered'] = 278; 45568 t['paragraph'] = 556; 45569 t['bullet'] = 350; 45570 t['quotesinglbase'] = 278; 45571 t['quotedblbase'] = 500; 45572 t['quotedblright'] = 500; 45573 t['guillemotright'] = 556; 45574 t['ellipsis'] = 1000; 45575 t['perthousand'] = 1000; 45576 t['questiondown'] = 611; 45577 t['grave'] = 333; 45578 t['acute'] = 333; 45579 t['circumflex'] = 333; 45580 t['tilde'] = 333; 45581 t['macron'] = 333; 45582 t['breve'] = 333; 45583 t['dotaccent'] = 333; 45584 t['dieresis'] = 333; 45585 t['ring'] = 333; 45586 t['cedilla'] = 333; 45587 t['hungarumlaut'] = 333; 45588 t['ogonek'] = 333; 45589 t['caron'] = 333; 45590 t['emdash'] = 1000; 45591 t['AE'] = 1000; 45592 t['ordfeminine'] = 370; 45593 t['Lslash'] = 611; 45594 t['Oslash'] = 778; 45595 t['OE'] = 1000; 45596 t['ordmasculine'] = 365; 45597 t['ae'] = 889; 45598 t['dotlessi'] = 278; 45599 t['lslash'] = 278; 45600 t['oslash'] = 611; 45601 t['oe'] = 944; 45602 t['germandbls'] = 611; 45603 t['Idieresis'] = 278; 45604 t['eacute'] = 556; 45605 t['abreve'] = 556; 45606 t['uhungarumlaut'] = 611; 45607 t['ecaron'] = 556; 45608 t['Ydieresis'] = 667; 45609 t['divide'] = 584; 45610 t['Yacute'] = 667; 45611 t['Acircumflex'] = 722; 45612 t['aacute'] = 556; 45613 t['Ucircumflex'] = 722; 45614 t['yacute'] = 556; 45615 t['scommaaccent'] = 556; 45616 t['ecircumflex'] = 556; 45617 t['Uring'] = 722; 45618 t['Udieresis'] = 722; 45619 t['aogonek'] = 556; 45620 t['Uacute'] = 722; 45621 t['uogonek'] = 611; 45622 t['Edieresis'] = 667; 45623 t['Dcroat'] = 722; 45624 t['commaaccent'] = 250; 45625 t['copyright'] = 737; 45626 t['Emacron'] = 667; 45627 t['ccaron'] = 556; 45628 t['aring'] = 556; 45629 t['Ncommaaccent'] = 722; 45630 t['lacute'] = 278; 45631 t['agrave'] = 556; 45632 t['Tcommaaccent'] = 611; 45633 t['Cacute'] = 722; 45634 t['atilde'] = 556; 45635 t['Edotaccent'] = 667; 45636 t['scaron'] = 556; 45637 t['scedilla'] = 556; 45638 t['iacute'] = 278; 45639 t['lozenge'] = 494; 45640 t['Rcaron'] = 722; 45641 t['Gcommaaccent'] = 778; 45642 t['ucircumflex'] = 611; 45643 t['acircumflex'] = 556; 45644 t['Amacron'] = 722; 45645 t['rcaron'] = 389; 45646 t['ccedilla'] = 556; 45647 t['Zdotaccent'] = 611; 45648 t['Thorn'] = 667; 45649 t['Omacron'] = 778; 45650 t['Racute'] = 722; 45651 t['Sacute'] = 667; 45652 t['dcaron'] = 743; 45653 t['Umacron'] = 722; 45654 t['uring'] = 611; 45655 t['threesuperior'] = 333; 45656 t['Ograve'] = 778; 45657 t['Agrave'] = 722; 45658 t['Abreve'] = 722; 45659 t['multiply'] = 584; 45660 t['uacute'] = 611; 45661 t['Tcaron'] = 611; 45662 t['partialdiff'] = 494; 45663 t['ydieresis'] = 556; 45664 t['Nacute'] = 722; 45665 t['icircumflex'] = 278; 45666 t['Ecircumflex'] = 667; 45667 t['adieresis'] = 556; 45668 t['edieresis'] = 556; 45669 t['cacute'] = 556; 45670 t['nacute'] = 611; 45671 t['umacron'] = 611; 45672 t['Ncaron'] = 722; 45673 t['Iacute'] = 278; 45674 t['plusminus'] = 584; 45675 t['brokenbar'] = 280; 45676 t['registered'] = 737; 45677 t['Gbreve'] = 778; 45678 t['Idotaccent'] = 278; 45679 t['summation'] = 600; 45680 t['Egrave'] = 667; 45681 t['racute'] = 389; 45682 t['omacron'] = 611; 45683 t['Zacute'] = 611; 45684 t['Zcaron'] = 611; 45685 t['greaterequal'] = 549; 45686 t['Eth'] = 722; 45687 t['Ccedilla'] = 722; 45688 t['lcommaaccent'] = 278; 45689 t['tcaron'] = 389; 45690 t['eogonek'] = 556; 45691 t['Uogonek'] = 722; 45692 t['Aacute'] = 722; 45693 t['Adieresis'] = 722; 45694 t['egrave'] = 556; 45695 t['zacute'] = 500; 45696 t['iogonek'] = 278; 45697 t['Oacute'] = 778; 45698 t['oacute'] = 611; 45699 t['amacron'] = 556; 45700 t['sacute'] = 556; 45701 t['idieresis'] = 278; 45702 t['Ocircumflex'] = 778; 45703 t['Ugrave'] = 722; 45704 t['Delta'] = 612; 45705 t['thorn'] = 611; 45706 t['twosuperior'] = 333; 45707 t['Odieresis'] = 778; 45708 t['mu'] = 611; 45709 t['igrave'] = 278; 45710 t['ohungarumlaut'] = 611; 45711 t['Eogonek'] = 667; 45712 t['dcroat'] = 611; 45713 t['threequarters'] = 834; 45714 t['Scedilla'] = 667; 45715 t['lcaron'] = 400; 45716 t['Kcommaaccent'] = 722; 45717 t['Lacute'] = 611; 45718 t['trademark'] = 1000; 45719 t['edotaccent'] = 556; 45720 t['Igrave'] = 278; 45721 t['Imacron'] = 278; 45722 t['Lcaron'] = 611; 45723 t['onehalf'] = 834; 45724 t['lessequal'] = 549; 45725 t['ocircumflex'] = 611; 45726 t['ntilde'] = 611; 45727 t['Uhungarumlaut'] = 722; 45728 t['Eacute'] = 667; 45729 t['emacron'] = 556; 45730 t['gbreve'] = 611; 45731 t['onequarter'] = 834; 45732 t['Scaron'] = 667; 45733 t['Scommaaccent'] = 667; 45734 t['Ohungarumlaut'] = 778; 45735 t['degree'] = 400; 45736 t['ograve'] = 611; 45737 t['Ccaron'] = 722; 45738 t['ugrave'] = 611; 45739 t['radical'] = 549; 45740 t['Dcaron'] = 722; 45741 t['rcommaaccent'] = 389; 45742 t['Ntilde'] = 722; 45743 t['otilde'] = 611; 45744 t['Rcommaaccent'] = 722; 45745 t['Lcommaaccent'] = 611; 45746 t['Atilde'] = 722; 45747 t['Aogonek'] = 722; 45748 t['Aring'] = 722; 45749 t['Otilde'] = 778; 45750 t['zdotaccent'] = 500; 45751 t['Ecaron'] = 667; 45752 t['Iogonek'] = 278; 45753 t['kcommaaccent'] = 556; 45754 t['minus'] = 584; 45755 t['Icircumflex'] = 278; 45756 t['ncaron'] = 611; 45757 t['tcommaaccent'] = 333; 45758 t['logicalnot'] = 584; 45759 t['odieresis'] = 611; 45760 t['udieresis'] = 611; 45761 t['notequal'] = 549; 45762 t['gcommaaccent'] = 611; 45763 t['eth'] = 611; 45764 t['zcaron'] = 500; 45765 t['ncommaaccent'] = 611; 45766 t['onesuperior'] = 333; 45767 t['imacron'] = 278; 45768 t['Euro'] = 556; 45769 }); 45770 t['Helvetica-Oblique'] = getLookupTableFactory(function (t) { 45771 t['space'] = 278; 45772 t['exclam'] = 278; 45773 t['quotedbl'] = 355; 45774 t['numbersign'] = 556; 45775 t['dollar'] = 556; 45776 t['percent'] = 889; 45777 t['ampersand'] = 667; 45778 t['quoteright'] = 222; 45779 t['parenleft'] = 333; 45780 t['parenright'] = 333; 45781 t['asterisk'] = 389; 45782 t['plus'] = 584; 45783 t['comma'] = 278; 45784 t['hyphen'] = 333; 45785 t['period'] = 278; 45786 t['slash'] = 278; 45787 t['zero'] = 556; 45788 t['one'] = 556; 45789 t['two'] = 556; 45790 t['three'] = 556; 45791 t['four'] = 556; 45792 t['five'] = 556; 45793 t['six'] = 556; 45794 t['seven'] = 556; 45795 t['eight'] = 556; 45796 t['nine'] = 556; 45797 t['colon'] = 278; 45798 t['semicolon'] = 278; 45799 t['less'] = 584; 45800 t['equal'] = 584; 45801 t['greater'] = 584; 45802 t['question'] = 556; 45803 t['at'] = 1015; 45804 t['A'] = 667; 45805 t['B'] = 667; 45806 t['C'] = 722; 45807 t['D'] = 722; 45808 t['E'] = 667; 45809 t['F'] = 611; 45810 t['G'] = 778; 45811 t['H'] = 722; 45812 t['I'] = 278; 45813 t['J'] = 500; 45814 t['K'] = 667; 45815 t['L'] = 556; 45816 t['M'] = 833; 45817 t['N'] = 722; 45818 t['O'] = 778; 45819 t['P'] = 667; 45820 t['Q'] = 778; 45821 t['R'] = 722; 45822 t['S'] = 667; 45823 t['T'] = 611; 45824 t['U'] = 722; 45825 t['V'] = 667; 45826 t['W'] = 944; 45827 t['X'] = 667; 45828 t['Y'] = 667; 45829 t['Z'] = 611; 45830 t['bracketleft'] = 278; 45831 t['backslash'] = 278; 45832 t['bracketright'] = 278; 45833 t['asciicircum'] = 469; 45834 t['underscore'] = 556; 45835 t['quoteleft'] = 222; 45836 t['a'] = 556; 45837 t['b'] = 556; 45838 t['c'] = 500; 45839 t['d'] = 556; 45840 t['e'] = 556; 45841 t['f'] = 278; 45842 t['g'] = 556; 45843 t['h'] = 556;
45844 t['i'] = 222; 45845 t['j'] = 222; 45846 t['k'] = 500; 45847 t['l'] = 222; 45848 t['m'] = 833; 45849 t['n'] = 556; 45850 t['o'] = 556; 45851 t['p'] = 556; 45852 t['q'] = 556; 45853 t['r'] = 333; 45854 t['s'] = 500; 45855 t['t'] = 278; 45856 t['u'] = 556; 45857 t['v'] = 500; 45858 t['w'] = 722; 45859 t['x'] = 500; 45860 t['y'] = 500; 45861 t['z'] = 500; 45862 t['braceleft'] = 334; 45863 t['bar'] = 260; 45864 t['braceright'] = 334; 45865 t['asciitilde'] = 584; 45866 t['exclamdown'] = 333; 45867 t['cent'] = 556; 45868 t['sterling'] = 556; 45869 t['fraction'] = 167; 45870 t['yen'] = 556; 45871 t['florin'] = 556; 45872 t['section'] = 556; 45873 t['currency'] = 556; 45874 t['quotesingle'] = 191; 45875 t['quotedblleft'] = 333; 45876 t['guillemotleft'] = 556; 45877 t['guilsinglleft'] = 333; 45878 t['guilsinglright'] = 333; 45879 t['fi'] = 500; 45880 t['fl'] = 500; 45881 t['endash'] = 556; 45882 t['dagger'] = 556; 45883 t['daggerdbl'] = 556; 45884 t['periodcentered'] = 278; 45885 t['paragraph'] = 537; 45886 t['bullet'] = 350; 45887 t['quotesinglbase'] = 222; 45888 t['quotedblbase'] = 333; 45889 t['quotedblright'] = 333; 45890 t['guillemotright'] = 556; 45891 t['ellipsis'] = 1000; 45892 t['perthousand'] = 1000; 45893 t['questiondown'] = 611; 45894 t['grave'] = 333; 45895 t['acute'] = 333; 45896 t['circumflex'] = 333; 45897 t['tilde'] = 333; 45898 t['macron'] = 333; 45899 t['breve'] = 333; 45900 t['dotaccent'] = 333; 45901 t['dieresis'] = 333; 45902 t['ring'] = 333; 45903 t['cedilla'] = 333; 45904 t['hungarumlaut'] = 333; 45905 t['ogonek'] = 333; 45906 t['caron'] = 333; 45907 t['emdash'] = 1000; 45908 t['AE'] = 1000; 45909 t['ordfeminine'] = 370; 45910 t['Lslash'] = 556; 45911 t['Oslash'] = 778; 45912 t['OE'] = 1000; 45913 t['ordmasculine'] = 365; 45914 t['ae'] = 889; 45915 t['dotlessi'] = 278; 45916 t['lslash'] = 222; 45917 t['oslash'] = 611; 45918 t['oe'] = 944; 45919 t['germandbls'] = 611; 45920 t['Idieresis'] = 278; 45921 t['eacute'] = 556; 45922 t['abreve'] = 556; 45923 t['uhungarumlaut'] = 556; 45924 t['ecaron'] = 556; 45925 t['Ydieresis'] = 667; 45926 t['divide'] = 584; 45927 t['Yacute'] = 667; 45928 t['Acircumflex'] = 667; 45929 t['aacute'] = 556; 45930 t['Ucircumflex'] = 722; 45931 t['yacute'] = 500; 45932 t['scommaaccent'] = 500; 45933 t['ecircumflex'] = 556; 45934 t['Uring'] = 722; 45935 t['Udieresis'] = 722; 45936 t['aogonek'] = 556; 45937 t['Uacute'] = 722; 45938 t['uogonek'] = 556; 45939 t['Edieresis'] = 667; 45940 t['Dcroat'] = 722; 45941 t['commaaccent'] = 250; 45942 t['copyright'] = 737; 45943 t['Emacron'] = 667; 45944 t['ccaron'] = 500; 45945 t['aring'] = 556; 45946 t['Ncommaaccent'] = 722; 45947 t['lacute'] = 222; 45948 t['agrave'] = 556; 45949 t['Tcommaaccent'] = 611; 45950 t['Cacute'] = 722; 45951 t['atilde'] = 556; 45952 t['Edotaccent'] = 667; 45953 t['scaron'] = 500; 45954 t['scedilla'] = 500; 45955 t['iacute'] = 278; 45956 t['lozenge'] = 471; 45957 t['Rcaron'] = 722; 45958 t['Gcommaaccent'] = 778; 45959 t['ucircumflex'] = 556; 45960 t['acircumflex'] = 556; 45961 t['Amacron'] = 667; 45962 t['rcaron'] = 333; 45963 t['ccedilla'] = 500; 45964 t['Zdotaccent'] = 611; 45965 t['Thorn'] = 667; 45966 t['Omacron'] = 778; 45967 t['Racute'] = 722; 45968 t['Sacute'] = 667; 45969 t['dcaron'] = 643; 45970 t['Umacron'] = 722; 45971 t['uring'] = 556; 45972 t['threesuperior'] = 333; 45973 t['Ograve'] = 778; 45974 t['Agrave'] = 667; 45975 t['Abreve'] = 667; 45976 t['multiply'] = 584; 45977 t['uacute'] = 556; 45978 t['Tcaron'] = 611; 45979 t['partialdiff'] = 476; 45980 t['ydieresis'] = 500; 45981 t['Nacute'] = 722; 45982 t['icircumflex'] = 278; 45983 t['Ecircumflex'] = 667; 45984 t['adieresis'] = 556; 45985 t['edieresis'] = 556; 45986 t['cacute'] = 500; 45987 t['nacute'] = 556; 45988 t['umacron'] = 556; 45989 t['Ncaron'] = 722; 45990 t['Iacute'] = 278; 45991 t['plusminus'] = 584; 45992 t['brokenbar'] = 260; 45993 t['registered'] = 737; 45994 t['Gbreve'] = 778; 45995 t['Idotaccent'] = 278; 45996 t['summation'] = 600; 45997 t['Egrave'] = 667; 45998 t['racute'] = 333; 45999 t['omacron'] = 556; 46000 t['Zacute'] = 611; 46001 t['Zcaron'] = 611; 46002 t['greaterequal'] = 549; 46003 t['Eth'] = 722; 46004 t['Ccedilla'] = 722; 46005 t['lcommaaccent'] = 222; 46006 t['tcaron'] = 317; 46007 t['eogonek'] = 556; 46008 t['Uogonek'] = 722; 46009 t['Aacute'] = 667; 46010 t['Adieresis'] = 667; 46011 t['egrave'] = 556; 46012 t['zacute'] = 500; 46013 t['iogonek'] = 222; 46014 t['Oacute'] = 778; 46015 t['oacute'] = 556; 46016 t['amacron'] = 556; 46017 t['sacute'] = 500; 46018 t['idieresis'] = 278; 46019 t['Ocircumflex'] = 778; 46020 t['Ugrave'] = 722; 46021 t['Delta'] = 612; 46022 t['thorn'] = 556; 46023 t['twosuperior'] = 333; 46024 t['Odieresis'] = 778; 46025 t['mu'] = 556; 46026 t['igrave'] = 278; 46027 t['ohungarumlaut'] = 556; 46028 t['Eogonek'] = 667; 46029 t['dcroat'] = 556; 46030 t['threequarters'] = 834; 46031 t['Scedilla'] = 667; 46032 t['lcaron'] = 299; 46033 t['Kcommaaccent'] = 667; 46034 t['Lacute'] = 556; 46035 t['trademark'] = 1000; 46036 t['edotaccent'] = 556; 46037 t['Igrave'] = 278; 46038 t['Imacron'] = 278; 46039 t['Lcaron'] = 556; 46040 t['onehalf'] = 834; 46041 t['lessequal'] = 549; 46042 t['ocircumflex'] = 556; 46043 t['ntilde'] = 556; 46044 t['Uhungarumlaut'] = 722; 46045 t['Eacute'] = 667; 46046 t['emacron'] = 556; 46047 t['gbreve'] = 556; 46048 t['onequarter'] = 834; 46049 t['Scaron'] = 667; 46050 t['Scommaaccent'] = 667; 46051 t['Ohungarumlaut'] = 778; 46052 t['degree'] = 400; 46053 t['ograve'] = 556; 46054 t['Ccaron'] = 722; 46055 t['ugrave'] = 556; 46056 t['radical'] = 453; 46057 t['Dcaron'] = 722; 46058 t['rcommaaccent'] = 333; 46059 t['Ntilde'] = 722; 46060 t['otilde'] = 556; 46061 t['Rcommaaccent'] = 722; 46062 t['Lcommaaccent'] = 556; 46063 t['Atilde'] = 667; 46064 t['Aogonek'] = 667; 46065 t['Aring'] = 667; 46066 t['Otilde'] = 778; 46067 t['zdotaccent'] = 500; 46068 t['Ecaron'] = 667; 46069 t['Iogonek'] = 278; 46070 t['kcommaaccent'] = 500; 46071 t['minus'] = 584; 46072 t['Icircumflex'] = 278; 46073 t['ncaron'] = 556; 46074 t['tcommaaccent'] = 278; 46075 t['logicalnot'] = 584; 46076 t['odieresis'] = 556; 46077 t['udieresis'] = 556; 46078 t['notequal'] = 549; 46079 t['gcommaaccent'] = 556; 46080 t['eth'] = 556; 46081 t['zcaron'] = 500; 46082 t['ncommaaccent'] = 556; 46083 t['onesuperior'] = 333; 46084 t['imacron'] = 278; 46085 t['Euro'] = 556; 46086 }); 46087 t['Symbol'] = getLookupTableFactory(function (t) { 46088 t['space'] = 250; 46089 t['exclam'] = 333; 46090 t['universal'] = 713; 46091 t['numbersign'] = 500; 46092 t['existential'] = 549; 46093 t['percent'] = 833; 46094 t['ampersand'] = 778; 46095 t['suchthat'] = 439; 46096 t['parenleft'] = 333; 46097 t['parenright'] = 333; 46098 t['asteriskmath'] = 500; 46099 t['plus'] = 549; 46100 t['comma'] = 250; 46101 t['minus'] = 549; 46102 t['period'] = 250; 46103 t['slash'] = 278; 46104 t['zero'] = 500; 46105 t['one'] = 500; 46106 t['two'] = 500; 46107 t['three'] = 500; 46108 t['four'] = 500; 46109 t['five'] = 500; 46110 t['six'] = 500; 46111 t['seven'] = 500; 46112 t['eight'] = 500; 46113 t['nine'] = 500; 46114 t['colon'] = 278; 46115 t['semicolon'] = 278; 46116 t['less'] = 549; 46117 t['equal'] = 549; 46118 t['greater'] = 549; 46119 t['question'] = 444; 46120 t['congruent'] = 549; 46121 t['Alpha'] = 722; 46122 t['Beta'] = 667; 46123 t['Chi'] = 722; 46124 t['Delta'] = 612; 46125 t['Epsilon'] = 611; 46126 t['Phi'] = 763; 46127 t['Gamma'] = 603; 46128 t['Eta'] = 722; 46129 t['Iota'] = 333; 46130 t['theta1'] = 631; 46131 t['Kappa'] = 722; 46132 t['Lambda'] = 686; 46133 t['Mu'] = 889; 46134 t['Nu'] = 722; 46135 t['Omicron'] = 722; 46136 t['Pi'] = 768; 46137 t['Theta'] = 741; 46138 t['Rho'] = 556;
46139 t['Sigma'] = 592; 46140 t['Tau'] = 611; 46141 t['Upsilon'] = 690; 46142 t['sigma1'] = 439; 46143 t['Omega'] = 768; 46144 t['Xi'] = 645; 46145 t['Psi'] = 795; 46146 t['Zeta'] = 611; 46147 t['bracketleft'] = 333; 46148 t['therefore'] = 863; 46149 t['bracketright'] = 333; 46150 t['perpendicular'] = 658; 46151 t['underscore'] = 500; 46152 t['radicalex'] = 500; 46153 t['alpha'] = 631; 46154 t['beta'] = 549; 46155 t['chi'] = 549; 46156 t['delta'] = 494; 46157 t['epsilon'] = 439; 46158 t['phi'] = 521; 46159 t['gamma'] = 411; 46160 t['eta'] = 603; 46161 t['iota'] = 329; 46162 t['phi1'] = 603; 46163 t['kappa'] = 549; 46164 t['lambda'] = 549; 46165 t['mu'] = 576; 46166 t['nu'] = 521; 46167 t['omicron'] = 549; 46168 t['pi'] = 549; 46169 t['theta'] = 521; 46170 t['rho'] = 549; 46171 t['sigma'] = 603; 46172 t['tau'] = 439; 46173 t['upsilon'] = 576; 46174 t['omega1'] = 713; 46175 t['omega'] = 686; 46176 t['xi'] = 493; 46177 t['psi'] = 686; 46178 t['zeta'] = 494; 46179 t['braceleft'] = 480; 46180 t['bar'] = 200; 46181 t['braceright'] = 480; 46182 t['similar'] = 549; 46183 t['Euro'] = 750; 46184 t['Upsilon1'] = 620; 46185 t['minute'] = 247; 46186 t['lessequal'] = 549; 46187 t['fraction'] = 167; 46188 t['infinity'] = 713; 46189 t['florin'] = 500; 46190 t['club'] = 753; 46191 t['diamond'] = 753; 46192 t['heart'] = 753; 46193 t['spade'] = 753; 46194 t['arrowboth'] = 1042; 46195 t['arrowleft'] = 987; 46196 t['arrowup'] = 603; 46197 t['arrowright'] = 987; 46198 t['arrowdown'] = 603; 46199 t['degree'] = 400; 46200 t['plusminus'] = 549; 46201 t['second'] = 411; 46202 t['greaterequal'] = 549; 46203 t['multiply'] = 549; 46204 t['proportional'] = 713; 46205 t['partialdiff'] = 494; 46206 t['bullet'] = 460; 46207 t['divide'] = 549; 46208 t['notequal'] = 549; 46209 t['equivalence'] = 549; 46210 t['approxequal'] = 549; 46211 t['ellipsis'] = 1000; 46212 t['arrowvertex'] = 603; 46213 t['arrowhorizex'] = 1000; 46214 t['carriagereturn'] = 658; 46215 t['aleph'] = 823; 46216 t['Ifraktur'] = 686; 46217 t['Rfraktur'] = 795; 46218 t['weierstrass'] = 987; 46219 t['circlemultiply'] = 768; 46220 t['circleplus'] = 768; 46221 t['emptyset'] = 823; 46222 t['intersection'] = 768; 46223 t['union'] = 768; 46224 t['propersuperset'] = 713; 46225 t['reflexsuperset'] = 713; 46226 t['notsubset'] = 713; 46227 t['propersubset'] = 713; 46228 t['reflexsubset'] = 713; 46229 t['element'] = 713; 46230 t['notelement'] = 713; 46231 t['angle'] = 768; 46232 t['gradient'] = 713; 46233 t['registerserif'] = 790; 46234 t['copyrightserif'] = 790; 46235 t['trademarkserif'] = 890; 46236 t['product'] = 823; 46237 t['radical'] = 549; 46238 t['dotmath'] = 250; 46239 t['logicalnot'] = 713; 46240 t['logicaland'] = 603; 46241 t['logicalor'] = 603; 46242 t['arrowdblboth'] = 1042; 46243 t['arrowdblleft'] = 987; 46244 t['arrowdblup'] = 603; 46245 t['arrowdblright'] = 987; 46246 t['arrowdbldown'] = 603; 46247 t['lozenge'] = 494; 46248 t['angleleft'] = 329; 46249 t['registersans'] = 790; 46250 t['copyrightsans'] = 790; 46251 t['trademarksans'] = 786; 46252 t['summation'] = 713; 46253 t['parenlefttp'] = 384; 46254 t['parenleftex'] = 384; 46255 t['parenleftbt'] = 384; 46256 t['bracketlefttp'] = 384; 46257 t['bracketleftex'] = 384; 46258 t['bracketleftbt'] = 384; 46259 t['bracelefttp'] = 494; 46260 t['braceleftmid'] = 494; 46261 t['braceleftbt'] = 494; 46262 t['braceex'] = 494; 46263 t['angleright'] = 329; 46264 t['integral'] = 274; 46265 t['integraltp'] = 686; 46266 t['integralex'] = 686; 46267 t['integralbt'] = 686; 46268 t['parenrighttp'] = 384; 46269 t['parenrightex'] = 384; 46270 t['parenrightbt'] = 384; 46271 t['bracketrighttp'] = 384; 46272 t['bracketrightex'] = 384; 46273 t['bracketrightbt'] = 384; 46274 t['bracerighttp'] = 494; 46275 t['bracerightmid'] = 494; 46276 t['bracerightbt'] = 494; 46277 t['apple'] = 790; 46278 }); 46279 t['Times-Roman'] = getLookupTableFactory(function (t) { 46280 t['space'] = 250; 46281 t['exclam'] = 333; 46282 t['quotedbl'] = 408; 46283 t['numbersign'] = 500; 46284 t['dollar'] = 500; 46285 t['percent'] = 833; 46286 t['ampersand'] = 778; 46287 t['quoteright'] = 333; 46288 t['parenleft'] = 333; 46289 t['parenright'] = 333; 46290 t['asterisk'] = 500; 46291 t['plus'] = 564; 46292 t['comma'] = 250; 46293 t['hyphen'] = 333; 46294 t['period'] = 250; 46295 t['slash'] = 278; 46296 t['zero'] = 500; 46297 t['one'] = 500; 46298 t['two'] = 500; 46299 t['three'] = 500; 46300 t['four'] = 500; 46301 t['five'] = 500; 46302 t['six'] = 500; 46303 t['seven'] = 500; 46304 t['eight'] = 500; 46305 t['nine'] = 500; 46306 t['colon'] = 278; 46307 t['semicolon'] = 278; 46308 t['less'] = 564; 46309 t['equal'] = 564; 46310 t['greater'] = 564; 46311 t['question'] = 444; 46312 t['at'] = 921; 46313 t['A'] = 722; 46314 t['B'] = 667; 46315 t['C'] = 667; 46316 t['D'] = 722; 46317 t['E'] = 611; 46318 t['F'] = 556; 46319 t['G'] = 722; 46320 t['H'] = 722; 46321 t['I'] = 333; 46322 t['J'] = 389; 46323 t['K'] = 722; 46324 t['L'] = 611; 46325 t['M'] = 889; 46326 t['N'] = 722; 46327 t['O'] = 722; 46328 t['P'] = 556; 46329 t['Q'] = 722; 46330 t['R'] = 667; 46331 t['S'] = 556; 46332 t['T'] = 611; 46333 t['U'] = 722; 46334 t['V'] = 722; 46335 t['W'] = 944; 46336 t['X'] = 722; 46337 t['Y'] = 722; 46338 t['Z'] = 611; 46339 t['bracketleft'] = 333; 46340 t['backslash'] = 278; 46341 t['bracketright'] = 333; 46342 t['asciicircum'] = 469; 46343 t['underscore'] = 500; 46344 t['quoteleft'] = 333; 46345 t['a'] = 444; 46346 t['b'] = 500; 46347 t['c'] = 444; 46348 t['d'] = 500; 46349 t['e'] = 444; 46350 t['f'] = 333; 46351 t['g'] = 500; 46352 t['h'] = 500;
46353 t['i'] = 278; 46354 t['j'] = 278; 46355 t['k'] = 500; 46356 t['l'] = 278; 46357 t['m'] = 778; 46358 t['n'] = 500; 46359 t['o'] = 500; 46360 t['p'] = 500; 46361 t['q'] = 500; 46362 t['r'] = 333; 46363 t['s'] = 389; 46364 t['t'] = 278; 46365 t['u'] = 500; 46366 t['v'] = 500; 46367 t['w'] = 722; 46368 t['x'] = 500; 46369 t['y'] = 500; 46370 t['z'] = 444; 46371 t['braceleft'] = 480; 46372 t['bar'] = 200; 46373 t['braceright'] = 480; 46374 t['asciitilde'] = 541; 46375 t['exclamdown'] = 333; 46376 t['cent'] = 500; 46377 t['sterling'] = 500; 46378 t['fraction'] = 167; 46379 t['yen'] = 500; 46380 t['florin'] = 500; 46381 t['section'] = 500; 46382 t['currency'] = 500; 46383 t['quotesingle'] = 180; 46384 t['quotedblleft'] = 444; 46385 t['guillemotleft'] = 500; 46386 t['guilsinglleft'] = 333; 46387 t['guilsinglright'] = 333; 46388 t['fi'] = 556; 46389 t['fl'] = 556; 46390 t['endash'] = 500; 46391 t['dagger'] = 500; 46392 t['daggerdbl'] = 500; 46393 t['periodcentered'] = 250; 46394 t['paragraph'] = 453; 46395 t['bullet'] = 350; 46396 t['quotesinglbase'] = 333; 46397 t['quotedblbase'] = 444; 46398 t['quotedblright'] = 444; 46399 t['guillemotright'] = 500; 46400 t['ellipsis'] = 1000; 46401 t['perthousand'] = 1000; 46402 t['questiondown'] = 444; 46403 t['grave'] = 333; 46404 t['acute'] = 333; 46405 t['circumflex'] = 333; 46406 t['tilde'] = 333; 46407 t['macron'] = 333; 46408 t['breve'] = 333; 46409 t['dotaccent'] = 333; 46410 t['dieresis'] = 333; 46411 t['ring'] = 333; 46412 t['cedilla'] = 333; 46413 t['hungarumlaut'] = 333; 46414 t['ogonek'] = 333; 46415 t['caron'] = 333; 46416 t['emdash'] = 1000; 46417 t['AE'] = 889; 46418 t['ordfeminine'] = 276; 46419 t['Lslash'] = 611; 46420 t['Oslash'] = 722; 46421 t['OE'] = 889; 46422 t['ordmasculine'] = 310; 46423 t['ae'] = 667; 46424 t['dotlessi'] = 278; 46425 t['lslash'] = 278; 46426 t['oslash'] = 500; 46427 t['oe'] = 722; 46428 t['germandbls'] = 500; 46429 t['Idieresis'] = 333; 46430 t['eacute'] = 444; 46431 t['abreve'] = 444; 46432 t['uhungarumlaut'] = 500; 46433 t['ecaron'] = 444; 46434 t['Ydieresis'] = 722; 46435 t['divide'] = 564; 46436 t['Yacute'] = 722; 46437 t['Acircumflex'] = 722; 46438 t['aacute'] = 444; 46439 t['Ucircumflex'] = 722; 46440 t['yacute'] = 500; 46441 t['scommaaccent'] = 389; 46442 t['ecircumflex'] = 444; 46443 t['Uring'] = 722; 46444 t['Udieresis'] = 722; 46445 t['aogonek'] = 444; 46446 t['Uacute'] = 722; 46447 t['uogonek'] = 500; 46448 t['Edieresis'] = 611; 46449 t['Dcroat'] = 722; 46450 t['commaaccent'] = 250; 46451 t['copyright'] = 760; 46452 t['Emacron'] = 611; 46453 t['ccaron'] = 444; 46454 t['aring'] = 444; 46455 t['Ncommaaccent'] = 722; 46456 t['lacute'] = 278; 46457 t['agrave'] = 444; 46458 t['Tcommaaccent'] = 611; 46459 t['Cacute'] = 667; 46460 t['atilde'] = 444; 46461 t['Edotaccent'] = 611; 46462 t['scaron'] = 389; 46463 t['scedilla'] = 389; 46464 t['iacute'] = 278; 46465 t['lozenge'] = 471; 46466 t['Rcaron'] = 667; 46467 t['Gcommaaccent'] = 722; 46468 t['ucircumflex'] = 500; 46469 t['acircumflex'] = 444; 46470 t['Amacron'] = 722; 46471 t['rcaron'] = 333; 46472 t['ccedilla'] = 444; 46473 t['Zdotaccent'] = 611; 46474 t['Thorn'] = 556; 46475 t['Omacron'] = 722; 46476 t['Racute'] = 667; 46477 t['Sacute'] = 556; 46478 t['dcaron'] = 588; 46479 t['Umacron'] = 722; 46480 t['uring'] = 500; 46481 t['threesuperior'] = 300; 46482 t['Ograve'] = 722; 46483 t['Agrave'] = 722; 46484 t['Abreve'] = 722; 46485 t['multiply'] = 564; 46486 t['uacute'] = 500; 46487 t['Tcaron'] = 611; 46488 t['partialdiff'] = 476; 46489 t['ydieresis'] = 500; 46490 t['Nacute'] = 722; 46491 t['icircumflex'] = 278; 46492 t['Ecircumflex'] = 611; 46493 t['adieresis'] = 444; 46494 t['edieresis'] = 444; 46495 t['cacute'] = 444; 46496 t['nacute'] = 500; 46497 t['umacron'] = 500; 46498 t['Ncaron'] = 722; 46499 t['Iacute'] = 333; 46500 t['plusminus'] = 564; 46501 t['brokenbar'] = 200; 46502 t['registered'] = 760; 46503 t['Gbreve'] = 722; 46504 t['Idotaccent'] = 333; 46505 t['summation'] = 600; 46506 t['Egrave'] = 611; 46507 t['racute'] = 333; 46508 t['omacron'] = 500; 46509 t['Zacute'] = 611; 46510 t['Zcaron'] = 611; 46511 t['greaterequal'] = 549; 46512 t['Eth'] = 722; 46513 t['Ccedilla'] = 667; 46514 t['lcommaaccent'] = 278; 46515 t['tcaron'] = 326; 46516 t['eogonek'] = 444; 46517 t['Uogonek'] = 722; 46518 t['Aacute'] = 722; 46519 t['Adieresis'] = 722; 46520 t['egrave'] = 444; 46521 t['zacute'] = 444; 46522 t['iogonek'] = 278; 46523 t['Oacute'] = 722; 46524 t['oacute'] = 500; 46525 t['amacron'] = 444; 46526 t['sacute'] = 389; 46527 t['idieresis'] = 278; 46528 t['Ocircumflex'] = 722; 46529 t['Ugrave'] = 722; 46530 t['Delta'] = 612; 46531 t['thorn'] = 500; 46532 t['twosuperior'] = 300; 46533 t['Odieresis'] = 722; 46534 t['mu'] = 500; 46535 t['igrave'] = 278; 46536 t['ohungarumlaut'] = 500; 46537 t['Eogonek'] = 611; 46538 t['dcroat'] = 500; 46539 t['threequarters'] = 750; 46540 t['Scedilla'] = 556; 46541 t['lcaron'] = 344; 46542 t['Kcommaaccent'] = 722; 46543 t['Lacute'] = 611; 46544 t['trademark'] = 980; 46545 t['edotaccent'] = 444; 46546 t['Igrave'] = 333; 46547 t['Imacron'] = 333; 46548 t['Lcaron'] = 611; 46549 t['onehalf'] = 750; 46550 t['lessequal'] = 549; 46551 t['ocircumflex'] = 500; 46552 t['ntilde'] = 500; 46553 t['Uhungarumlaut'] = 722; 46554 t['Eacute'] = 611; 46555 t['emacron'] = 444; 46556 t['gbreve'] = 500; 46557 t['onequarter'] = 750; 46558 t['Scaron'] = 556; 46559 t['Scommaaccent'] = 556; 46560 t['Ohungarumlaut'] = 722; 46561 t['degree'] = 400; 46562 t['ograve'] = 500; 46563 t['Ccaron'] = 667; 46564 t['ugrave'] = 500; 46565 t['radical'] = 453; 46566 t['Dcaron'] = 722; 46567 t['rcommaaccent'] = 333; 46568 t['Ntilde'] = 722; 46569 t['otilde'] = 500; 46570 t['Rcommaaccent'] = 667; 46571 t['Lcommaaccent'] = 611; 46572 t['Atilde'] = 722; 46573 t['Aogonek'] = 722; 46574 t['Aring'] = 722; 46575 t['Otilde'] = 722; 46576 t['zdotaccent'] = 444; 46577 t['Ecaron'] = 611; 46578 t['Iogonek'] = 333; 46579 t['kcommaaccent'] = 500; 46580 t['minus'] = 564; 46581 t['Icircumflex'] = 333; 46582 t['ncaron'] = 500; 46583 t['tcommaaccent'] = 278; 46584 t['logicalnot'] = 564; 46585 t['odieresis'] = 500; 46586 t['udieresis'] = 500; 46587 t['notequal'] = 549; 46588 t['gcommaaccent'] = 500; 46589 t['eth'] = 500; 46590 t['zcaron'] = 444; 46591 t['ncommaaccent'] = 500; 46592 t['onesuperior'] = 300;
46593 t['imacron'] = 278; 46594 t['Euro'] = 500; 46595 }); 46596 t['Times-Bold'] = getLookupTableFactory(function (t) { 46597 t['space'] = 250; 46598 t['exclam'] = 333; 46599 t['quotedbl'] = 555; 46600 t['numbersign'] = 500; 46601 t['dollar'] = 500; 46602 t['percent'] = 1000; 46603 t['ampersand'] = 833; 46604 t['quoteright'] = 333; 46605 t['parenleft'] = 333; 46606 t['parenright'] = 333; 46607 t['asterisk'] = 500; 46608 t['plus'] = 570; 46609 t['comma'] = 250; 46610 t['hyphen'] = 333; 46611 t['period'] = 250; 46612 t['slash'] = 278; 46613 t['zero'] = 500; 46614 t['one'] = 500; 46615 t['two'] = 500; 46616 t['three'] = 500; 46617 t['four'] = 500; 46618 t['five'] = 500; 46619 t['six'] = 500; 46620 t['seven'] = 500; 46621 t['eight'] = 500; 46622 t['nine'] = 500; 46623 t['colon'] = 333; 46624 t['semicolon'] = 333; 46625 t['less'] = 570; 46626 t['equal'] = 570; 46627 t['greater'] = 570; 46628 t['question'] = 500; 46629 t['at'] = 930; 46630 t['A'] = 722; 46631 t['B'] = 667; 46632 t['C'] = 722; 46633 t['D'] = 722; 46634 t['E'] = 667; 46635 t['F'] = 611; 46636 t['G'] = 778; 46637 t['H'] = 778; 46638 t['I'] = 389; 46639 t['J'] = 500; 46640 t['K'] = 778; 46641 t['L'] = 667; 46642 t['M'] = 944; 46643 t['N'] = 722; 46644 t['O'] = 778; 46645 t['P'] = 611; 46646 t['Q'] = 778; 46647 t['R'] = 722; 46648 t['S'] = 556; 46649 t['T'] = 667; 46650 t['U'] = 722; 46651 t['V'] = 722; 46652 t['W'] = 1000; 46653 t['X'] = 722; 46654 t['Y'] = 722; 46655 t['Z'] = 667; 46656 t['bracketleft'] = 333; 46657 t['backslash'] = 278; 46658 t['bracketright'] = 333; 46659 t['asciicircum'] = 581; 46660 t['underscore'] = 500; 46661 t['quoteleft'] = 333; 46662 t['a'] = 500; 46663 t['b'] = 556; 46664 t['c'] = 444; 46665 t['d'] = 556; 46666 t['e'] = 444; 46667 t['f'] = 333; 46668 t['g'] = 500; 46669 t['h'] = 556; 46670 t['i'] = 278; 46671 t['j'] = 333; 46672 t['k'] = 556; 46673 t['l'] = 278; 46674 t['m'] = 833; 46675 t['n'] = 556; 46676 t['o'] = 500; 46677 t['p'] = 556; 46678 t['q'] = 556; 46679 t['r'] = 444; 46680 t['s'] = 389; 46681 t['t'] = 333; 46682 t['u'] = 556; 46683 t['v'] = 500; 46684 t['w'] = 722; 46685 t['x'] = 500; 46686 t['y'] = 500; 46687 t['z'] = 444; 46688 t['braceleft'] = 394; 46689 t['bar'] = 220; 46690 t['braceright'] = 394; 46691 t['asciitilde'] = 520; 46692 t['exclamdown'] = 333; 46693 t['cent'] = 500; 46694 t['sterling'] = 500; 46695 t['fraction'] = 167; 46696 t['yen'] = 500; 46697 t['florin'] = 500; 46698 t['section'] = 500; 46699 t['currency'] = 500; 46700 t['quotesingle'] = 278; 46701 t['quotedblleft'] = 500; 46702 t['guillemotleft'] = 500; 46703 t['guilsinglleft'] = 333; 46704 t['guilsinglright'] = 333; 46705 t['fi'] = 556; 46706 t['fl'] = 556; 46707 t['endash'] = 500; 46708 t['dagger'] = 500; 46709 t['daggerdbl'] = 500; 46710 t['periodcentered'] = 250; 46711 t['paragraph'] = 540; 46712 t['bullet'] = 350; 46713 t['quotesinglbase'] = 333; 46714 t['quotedblbase'] = 500; 46715 t['quotedblright'] = 500; 46716 t['guillemotright'] = 500; 46717 t['ellipsis'] = 1000; 46718 t['perthousand'] = 1000; 46719 t['questiondown'] = 500; 46720 t['grave'] = 333; 46721 t['acute'] = 333; 46722 t['circumflex'] = 333; 46723 t['tilde'] = 333; 46724 t['macron'] = 333; 46725 t['breve'] = 333; 46726 t['dotaccent'] = 333; 46727 t['dieresis'] = 333; 46728 t['ring'] = 333; 46729 t['cedilla'] = 333; 46730 t['hungarumlaut'] = 333; 46731 t['ogonek'] = 333; 46732 t['caron'] = 333; 46733 t['emdash'] = 1000; 46734 t['AE'] = 1000; 46735 t['ordfeminine'] = 300; 46736 t['Lslash'] = 667; 46737 t['Oslash'] = 778; 46738 t['OE'] = 1000; 46739 t['ordmasculine'] = 330; 46740 t['ae'] = 722; 46741 t['dotlessi'] = 278; 46742 t['lslash'] = 278; 46743 t['oslash'] = 500; 46744 t['oe'] = 722; 46745 t['germandbls'] = 556; 46746 t['Idieresis'] = 389; 46747 t['eacute'] = 444; 46748 t['abreve'] = 500; 46749 t['uhungarumlaut'] = 556; 46750 t['ecaron'] = 444; 46751 t['Ydieresis'] = 722; 46752 t['divide'] = 570; 46753 t['Yacute'] = 722; 46754 t['Acircumflex'] = 722; 46755 t['aacute'] = 500; 46756 t['Ucircumflex'] = 722; 46757 t['yacute'] = 500; 46758 t['scommaaccent'] = 389; 46759 t['ecircumflex'] = 444; 46760 t['Uring'] = 722; 46761 t['Udieresis'] = 722; 46762 t['aogonek'] = 500; 46763 t['Uacute'] = 722; 46764 t['uogonek'] = 556; 46765 t['Edieresis'] = 667; 46766 t['Dcroat'] = 722; 46767 t['commaaccent'] = 250; 46768 t['copyright'] = 747; 46769 t['Emacron'] = 667; 46770 t['ccaron'] = 444; 46771 t['aring'] = 500; 46772 t['Ncommaaccent'] = 722; 46773 t['lacute'] = 278; 46774 t['agrave'] = 500; 46775 t['Tcommaaccent'] = 667; 46776 t['Cacute'] = 722; 46777 t['atilde'] = 500; 46778 t['Edotaccent'] = 667; 46779 t['scaron'] = 389; 46780 t['scedilla'] = 389; 46781 t['iacute'] = 278; 46782 t['lozenge'] = 494; 46783 t['Rcaron'] = 722; 46784 t['Gcommaaccent'] = 778; 46785 t['ucircumflex'] = 556; 46786 t['acircumflex'] = 500; 46787 t['Amacron'] = 722; 46788 t['rcaron'] = 444; 46789 t['ccedilla'] = 444; 46790 t['Zdotaccent'] = 667; 46791 t['Thorn'] = 611; 46792 t['Omacron'] = 778; 46793 t['Racute'] = 722; 46794 t['Sacute'] = 556; 46795 t['dcaron'] = 672; 46796 t['Umacron'] = 722; 46797 t['uring'] = 556; 46798 t['threesuperior'] = 300; 46799 t['Ograve'] = 778; 46800 t['Agrave'] = 722; 46801 t['Abreve'] = 722; 46802 t['multiply'] = 570; 46803 t['uacute'] = 556; 46804 t['Tcaron'] = 667; 46805 t['partialdiff'] = 494; 46806 t['ydieresis'] = 500; 46807 t['Nacute'] = 722; 46808 t['icircumflex'] = 278; 46809 t['Ecircumflex'] = 667; 46810 t['adieresis'] = 500; 46811 t['edieresis'] = 444; 46812 t['cacute'] = 444; 46813 t['nacute'] = 556; 46814 t['umacron'] = 556; 46815 t['Ncaron'] = 722; 46816 t['Iacute'] = 389; 46817 t['plusminus'] = 570; 46818 t['brokenbar'] = 220; 46819 t['registered'] = 747; 46820 t['Gbreve'] = 778; 46821 t['Idotaccent'] = 389; 46822 t['summation'] = 600; 46823 t['Egrave'] = 667; 46824 t['racute'] = 444; 46825 t['omacron'] = 500; 46826 t['Zacute'] = 667; 46827 t['Zcaron'] = 667; 46828 t['greaterequal'] = 549; 46829 t['Eth'] = 722; 46830 t['Ccedilla'] = 722; 46831 t['lcommaaccent'] = 278; 46832 t['tcaron'] = 416; 46833 t['eogonek'] = 444; 46834 t['Uogonek'] = 722; 46835 t['Aacute'] = 722; 46836 t['Adieresis'] = 722; 46837 t['egrave'] = 444; 46838 t['zacute'] = 444; 46839 t['iogonek'] = 278; 46840 t['Oacute'] = 778; 46841 t['oacute'] = 500; 46842 t['amacron'] = 500; 46843 t['sacute'] = 389; 46844 t['idieresis'] = 278; 46845 t['Ocircumflex'] = 778; 46846 t['Ugrave'] = 722; 46847 t['Delta'] = 612; 46848 t['thorn'] = 556; 46849 t['twosuperior'] = 300; 46850 t['Odieresis'] = 778; 46851 t['mu'] = 556;
46852 t['igrave'] = 278; 46853 t['ohungarumlaut'] = 500; 46854 t['Eogonek'] = 667; 46855 t['dcroat'] = 556; 46856 t['threequarters'] = 750; 46857 t['Scedilla'] = 556; 46858 t['lcaron'] = 394; 46859 t['Kcommaaccent'] = 778; 46860 t['Lacute'] = 667; 46861 t['trademark'] = 1000; 46862 t['edotaccent'] = 444; 46863 t['Igrave'] = 389; 46864 t['Imacron'] = 389; 46865 t['Lcaron'] = 667; 46866 t['onehalf'] = 750; 46867 t['lessequal'] = 549; 46868 t['ocircumflex'] = 500; 46869 t['ntilde'] = 556; 46870 t['Uhungarumlaut'] = 722; 46871 t['Eacute'] = 667; 46872 t['emacron'] = 444; 46873 t['gbreve'] = 500; 46874 t['onequarter'] = 750; 46875 t['Scaron'] = 556; 46876 t['Scommaaccent'] = 556; 46877 t['Ohungarumlaut'] = 778; 46878 t['degree'] = 400; 46879 t['ograve'] = 500; 46880 t['Ccaron'] = 722; 46881 t['ugrave'] = 556; 46882 t['radical'] = 549; 46883 t['Dcaron'] = 722; 46884 t['rcommaaccent'] = 444; 46885 t['Ntilde'] = 722; 46886 t['otilde'] = 500; 46887 t['Rcommaaccent'] = 722; 46888 t['Lcommaaccent'] = 667; 46889 t['Atilde'] = 722; 46890 t['Aogonek'] = 722; 46891 t['Aring'] = 722; 46892 t['Otilde'] = 778; 46893 t['zdotaccent'] = 444; 46894 t['Ecaron'] = 667; 46895 t['Iogonek'] = 389; 46896 t['kcommaaccent'] = 556; 46897 t['minus'] = 570; 46898 t['Icircumflex'] = 389; 46899 t['ncaron'] = 556; 46900 t['tcommaaccent'] = 333; 46901 t['logicalnot'] = 570; 46902 t['odieresis'] = 500; 46903 t['udieresis'] = 556; 46904 t['notequal'] = 549; 46905 t['gcommaaccent'] = 500; 46906 t['eth'] = 500; 46907 t['zcaron'] = 444; 46908 t['ncommaaccent'] = 556; 46909 t['onesuperior'] = 300;
46910 t['imacron'] = 278; 46911 t['Euro'] = 500; 46912 }); 46913 t['Times-BoldItalic'] = getLookupTableFactory(function (t) { 46914 t['space'] = 250; 46915 t['exclam'] = 389; 46916 t['quotedbl'] = 555; 46917 t['numbersign'] = 500; 46918 t['dollar'] = 500; 46919 t['percent'] = 833; 46920 t['ampersand'] = 778; 46921 t['quoteright'] = 333; 46922 t['parenleft'] = 333; 46923 t['parenright'] = 333; 46924 t['asterisk'] = 500; 46925 t['plus'] = 570; 46926 t['comma'] = 250; 46927 t['hyphen'] = 333; 46928 t['period'] = 250; 46929 t['slash'] = 278; 46930 t['zero'] = 500; 46931 t['one'] = 500; 46932 t['two'] = 500; 46933 t['three'] = 500; 46934 t['four'] = 500; 46935 t['five'] = 500; 46936 t['six'] = 500; 46937 t['seven'] = 500; 46938 t['eight'] = 500; 46939 t['nine'] = 500; 46940 t['colon'] = 333; 46941 t['semicolon'] = 333; 46942 t['less'] = 570; 46943 t['equal'] = 570; 46944 t['greater'] = 570; 46945 t['question'] = 500; 46946 t['at'] = 832; 46947 t['A'] = 667; 46948 t['B'] = 667; 46949 t['C'] = 667; 46950 t['D'] = 722; 46951 t['E'] = 667; 46952 t['F'] = 667; 46953 t['G'] = 722; 46954 t['H'] = 778; 46955 t['I'] = 389; 46956 t['J'] = 500; 46957 t['K'] = 667; 46958 t['L'] = 611; 46959 t['M'] = 889; 46960 t['N'] = 722; 46961 t['O'] = 722; 46962 t['P'] = 611; 46963 t['Q'] = 722; 46964 t['R'] = 667; 46965 t['S'] = 556; 46966 t['T'] = 611; 46967 t['U'] = 722; 46968 t['V'] = 667; 46969 t['W'] = 889; 46970 t['X'] = 667; 46971 t['Y'] = 611; 46972 t['Z'] = 611; 46973 t['bracketleft'] = 333; 46974 t['backslash'] = 278; 46975 t['bracketright'] = 333; 46976 t['asciicircum'] = 570; 46977 t['underscore'] = 500; 46978 t['quoteleft'] = 333; 46979 t['a'] = 500; 46980 t['b'] = 500; 46981 t['c'] = 444; 46982 t['d'] = 500; 46983 t['e'] = 444; 46984 t['f'] = 333; 46985 t['g'] = 500; 46986 t['h'] = 556; 46987 t['i'] = 278; 46988 t['j'] = 278; 46989 t['k'] = 500; 46990 t['l'] = 278; 46991 t['m'] = 778; 46992 t['n'] = 556; 46993 t['o'] = 500; 46994 t['p'] = 500; 46995 t['q'] = 500; 46996 t['r'] = 389; 46997 t['s'] = 389; 46998 t['t'] = 278; 46999 t['u'] = 556; 47000 t['v'] = 444; 47001 t['w'] = 667; 47002 t['x'] = 500; 47003 t['y'] = 444; 47004 t['z'] = 389; 47005 t['braceleft'] = 348; 47006 t['bar'] = 220; 47007 t['braceright'] = 348; 47008 t['asciitilde'] = 570; 47009 t['exclamdown'] = 389; 47010 t['cent'] = 500; 47011 t['sterling'] = 500; 47012 t['fraction'] = 167; 47013 t['yen'] = 500; 47014 t['florin'] = 500; 47015 t['section'] = 500; 47016 t['currency'] = 500; 47017 t['quotesingle'] = 278; 47018 t['quotedblleft'] = 500; 47019 t['guillemotleft'] = 500; 47020 t['guilsinglleft'] = 333; 47021 t['guilsinglright'] = 333; 47022 t['fi'] = 556; 47023 t['fl'] = 556; 47024 t['endash'] = 500; 47025 t['dagger'] = 500; 47026 t['daggerdbl'] = 500; 47027 t['periodcentered'] = 250; 47028 t['paragraph'] = 500; 47029 t['bullet'] = 350; 47030 t['quotesinglbase'] = 333; 47031 t['quotedblbase'] = 500; 47032 t['quotedblright'] = 500; 47033 t['guillemotright'] = 500; 47034 t['ellipsis'] = 1000; 47035 t['perthousand'] = 1000; 47036 t['questiondown'] = 500; 47037 t['grave'] = 333; 47038 t['acute'] = 333; 47039 t['circumflex'] = 333; 47040 t['tilde'] = 333; 47041 t['macron'] = 333; 47042 t['breve'] = 333; 47043 t['dotaccent'] = 333; 47044 t['dieresis'] = 333; 47045 t['ring'] = 333; 47046 t['cedilla'] = 333; 47047 t['hungarumlaut'] = 333; 47048 t['ogonek'] = 333; 47049 t['caron'] = 333; 47050 t['emdash'] = 1000; 47051 t['AE'] = 944; 47052 t['ordfeminine'] = 266; 47053 t['Lslash'] = 611; 47054 t['Oslash'] = 722; 47055 t['OE'] = 944; 47056 t['ordmasculine'] = 300; 47057 t['ae'] = 722; 47058 t['dotlessi'] = 278; 47059 t['lslash'] = 278; 47060 t['oslash'] = 500; 47061 t['oe'] = 722; 47062 t['germandbls'] = 500; 47063 t['Idieresis'] = 389; 47064 t['eacute'] = 444; 47065 t['abreve'] = 500; 47066 t['uhungarumlaut'] = 556; 47067 t['ecaron'] = 444; 47068 t['Ydieresis'] = 611; 47069 t['divide'] = 570; 47070 t['Yacute'] = 611; 47071 t['Acircumflex'] = 667; 47072 t['aacute'] = 500; 47073 t['Ucircumflex'] = 722; 47074 t['yacute'] = 444; 47075 t['scommaaccent'] = 389; 47076 t['ecircumflex'] = 444; 47077 t['Uring'] = 722; 47078 t['Udieresis'] = 722; 47079 t['aogonek'] = 500; 47080 t['Uacute'] = 722; 47081 t['uogonek'] = 556; 47082 t['Edieresis'] = 667; 47083 t['Dcroat'] = 722; 47084 t['commaaccent'] = 250; 47085 t['copyright'] = 747; 47086 t['Emacron'] = 667; 47087 t['ccaron'] = 444; 47088 t['aring'] = 500; 47089 t['Ncommaaccent'] = 722; 47090 t['lacute'] = 278; 47091 t['agrave'] = 500; 47092 t['Tcommaaccent'] = 611; 47093 t['Cacute'] = 667; 47094 t['atilde'] = 500; 47095 t['Edotaccent'] = 667; 47096 t['scaron'] = 389; 47097 t['scedilla'] = 389; 47098 t['iacute'] = 278; 47099 t['lozenge'] = 494; 47100 t['Rcaron'] = 667; 47101 t['Gcommaaccent'] = 722; 47102 t['ucircumflex'] = 556; 47103 t['acircumflex'] = 500; 47104 t['Amacron'] = 667; 47105 t['rcaron'] = 389; 47106 t['ccedilla'] = 444; 47107 t['Zdotaccent'] = 611; 47108 t['Thorn'] = 611; 47109 t['Omacron'] = 722; 47110 t['Racute'] = 667; 47111 t['Sacute'] = 556; 47112 t['dcaron'] = 608; 47113 t['Umacron'] = 722; 47114 t['uring'] = 556; 47115 t['threesuperior'] = 300; 47116 t['Ograve'] = 722; 47117 t['Agrave'] = 667; 47118 t['Abreve'] = 667; 47119 t['multiply'] = 570; 47120 t['uacute'] = 556; 47121 t['Tcaron'] = 611; 47122 t['partialdiff'] = 494; 47123 t['ydieresis'] = 444; 47124 t['Nacute'] = 722; 47125 t['icircumflex'] = 278; 47126 t['Ecircumflex'] = 667; 47127 t['adieresis'] = 500; 47128 t['edieresis'] = 444; 47129 t['cacute'] = 444; 47130 t['nacute'] = 556; 47131 t['umacron'] = 556; 47132 t['Ncaron'] = 722; 47133 t['Iacute'] = 389; 47134 t['plusminus'] = 570; 47135 t['brokenbar'] = 220; 47136 t['registered'] = 747; 47137 t['Gbreve'] = 722; 47138 t['Idotaccent'] = 389; 47139 t['summation'] = 600; 47140 t['Egrave'] = 667; 47141 t['racute'] = 389; 47142 t['omacron'] = 500; 47143 t['Zacute'] = 611; 47144 t['Zcaron'] = 611; 47145 t['greaterequal'] = 549; 47146 t['Eth'] = 722; 47147 t['Ccedilla'] = 667; 47148 t['lcommaaccent'] = 278; 47149 t['tcaron'] = 366; 47150 t['eogonek'] = 444; 47151 t['Uogonek'] = 722; 47152 t['Aacute'] = 667; 47153 t['Adieresis'] = 667; 47154 t['egrave'] = 444; 47155 t['zacute'] = 389; 47156 t['iogonek'] = 278; 47157 t['Oacute'] = 722; 47158 t['oacute'] = 500; 47159 t['amacron'] = 500; 47160 t['sacute'] = 389; 47161 t['idieresis'] = 278; 47162 t['Ocircumflex'] = 722; 47163 t['Ugrave'] = 722; 47164 t['Delta'] = 612; 47165 t['thorn'] = 500; 47166 t['twosuperior'] = 300; 47167 t['Odieresis'] = 722; 47168 t['mu'] = 576;
47169 t['igrave'] = 278; 47170 t['ohungarumlaut'] = 500; 47171 t['Eogonek'] = 667; 47172 t['dcroat'] = 500; 47173 t['threequarters'] = 750; 47174 t['Scedilla'] = 556; 47175 t['lcaron'] = 382; 47176 t['Kcommaaccent'] = 667; 47177 t['Lacute'] = 611; 47178 t['trademark'] = 1000; 47179 t['edotaccent'] = 444; 47180 t['Igrave'] = 389; 47181 t['Imacron'] = 389; 47182 t['Lcaron'] = 611; 47183 t['onehalf'] = 750; 47184 t['lessequal'] = 549; 47185 t['ocircumflex'] = 500; 47186 t['ntilde'] = 556; 47187 t['Uhungarumlaut'] = 722; 47188 t['Eacute'] = 667; 47189 t['emacron'] = 444; 47190 t['gbreve'] = 500; 47191 t['onequarter'] = 750; 47192 t['Scaron'] = 556; 47193 t['Scommaaccent'] = 556; 47194 t['Ohungarumlaut'] = 722; 47195 t['degree'] = 400; 47196 t['ograve'] = 500; 47197 t['Ccaron'] = 667; 47198 t['ugrave'] = 556; 47199 t['radical'] = 549; 47200 t['Dcaron'] = 722; 47201 t['rcommaaccent'] = 389; 47202 t['Ntilde'] = 722; 47203 t['otilde'] = 500; 47204 t['Rcommaaccent'] = 667; 47205 t['Lcommaaccent'] = 611; 47206 t['Atilde'] = 667; 47207 t['Aogonek'] = 667; 47208 t['Aring'] = 667; 47209 t['Otilde'] = 722; 47210 t['zdotaccent'] = 389; 47211 t['Ecaron'] = 667; 47212 t['Iogonek'] = 389; 47213 t['kcommaaccent'] = 500; 47214 t['minus'] = 606; 47215 t['Icircumflex'] = 389; 47216 t['ncaron'] = 556; 47217 t['tcommaaccent'] = 278; 47218 t['logicalnot'] = 606; 47219 t['odieresis'] = 500; 47220 t['udieresis'] = 556; 47221 t['notequal'] = 549; 47222 t['gcommaaccent'] = 500; 47223 t['eth'] = 500; 47224 t['zcaron'] = 389; 47225 t['ncommaaccent'] = 556; 47226 t['onesuperior'] = 300;
47227 t['imacron'] = 278; 47228 t['Euro'] = 500; 47229 }); 47230 t['Times-Italic'] = getLookupTableFactory(function (t) { 47231 t['space'] = 250; 47232 t['exclam'] = 333; 47233 t['quotedbl'] = 420; 47234 t['numbersign'] = 500; 47235 t['dollar'] = 500; 47236 t['percent'] = 833; 47237 t['ampersand'] = 778; 47238 t['quoteright'] = 333; 47239 t['parenleft'] = 333; 47240 t['parenright'] = 333; 47241 t['asterisk'] = 500; 47242 t['plus'] = 675; 47243 t['comma'] = 250; 47244 t['hyphen'] = 333; 47245 t['period'] = 250; 47246 t['slash'] = 278; 47247 t['zero'] = 500; 47248 t['one'] = 500; 47249 t['two'] = 500; 47250 t['three'] = 500; 47251 t['four'] = 500; 47252 t['five'] = 500; 47253 t['six'] = 500; 47254 t['seven'] = 500; 47255 t['eight'] = 500; 47256 t['nine'] = 500; 47257 t['colon'] = 333; 47258 t['semicolon'] = 333; 47259 t['less'] = 675; 47260 t['equal'] = 675; 47261 t['greater'] = 675; 47262 t['question'] = 500; 47263 t['at'] = 920; 47264 t['A'] = 611; 47265 t['B'] = 611; 47266 t['C'] = 667; 47267 t['D'] = 722; 47268 t['E'] = 611; 47269 t['F'] = 611; 47270 t['G'] = 722; 47271 t['H'] = 722; 47272 t['I'] = 333; 47273 t['J'] = 444; 47274 t['K'] = 667; 47275 t['L'] = 556; 47276 t['M'] = 833; 47277 t['N'] = 667; 47278 t['O'] = 722; 47279 t['P'] = 611; 47280 t['Q'] = 722; 47281 t['R'] = 611; 47282 t['S'] = 500; 47283 t['T'] = 556; 47284 t['U'] = 722; 47285 t['V'] = 611; 47286 t['W'] = 833; 47287 t['X'] = 611; 47288 t['Y'] = 556; 47289 t['Z'] = 556; 47290 t['bracketleft'] = 389; 47291 t['backslash'] = 278; 47292 t['bracketright'] = 389; 47293 t['asciicircum'] = 422; 47294 t['underscore'] = 500; 47295 t['quoteleft'] = 333; 47296 t['a'] = 500; 47297 t['b'] = 500; 47298 t['c'] = 444; 47299 t['d'] = 500; 47300 t['e'] = 444; 47301 t['f'] = 278; 47302 t['g'] = 500; 47303 t['h'] = 500; 47304 t['i'] = 278; 47305 t['j'] = 278; 47306 t['k'] = 444; 47307 t['l'] = 278; 47308 t['m'] = 722; 47309 t['n'] = 500; 47310 t['o'] = 500; 47311 t['p'] = 500; 47312 t['q'] = 500; 47313 t['r'] = 389; 47314 t['s'] = 389; 47315 t['t'] = 278; 47316 t['u'] = 500; 47317 t['v'] = 444; 47318 t['w'] = 667; 47319 t['x'] = 444; 47320 t['y'] = 444; 47321 t['z'] = 389; 47322 t['braceleft'] = 400; 47323 t['bar'] = 275; 47324 t['braceright'] = 400; 47325 t['asciitilde'] = 541; 47326 t['exclamdown'] = 389; 47327 t['cent'] = 500; 47328 t['sterling'] = 500; 47329 t['fraction'] = 167; 47330 t['yen'] = 500; 47331 t['florin'] = 500; 47332 t['section'] = 500; 47333 t['currency'] = 500; 47334 t['quotesingle'] = 214; 47335 t['quotedblleft'] = 556; 47336 t['guillemotleft'] = 500; 47337 t['guilsinglleft'] = 333; 47338 t['guilsinglright'] = 333; 47339 t['fi'] = 500; 47340 t['fl'] = 500; 47341 t['endash'] = 500; 47342 t['dagger'] = 500; 47343 t['daggerdbl'] = 500; 47344 t['periodcentered'] = 250; 47345 t['paragraph'] = 523; 47346 t['bullet'] = 350; 47347 t['quotesinglbase'] = 333; 47348 t['quotedblbase'] = 556; 47349 t['quotedblright'] = 556; 47350 t['guillemotright'] = 500; 47351 t['ellipsis'] = 889; 47352 t['perthousand'] = 1000; 47353 t['questiondown'] = 500; 47354 t['grave'] = 333; 47355 t['acute'] = 333; 47356 t['circumflex'] = 333; 47357 t['tilde'] = 333; 47358 t['macron'] = 333; 47359 t['breve'] = 333; 47360 t['dotaccent'] = 333; 47361 t['dieresis'] = 333; 47362 t['ring'] = 333; 47363 t['cedilla'] = 333; 47364 t['hungarumlaut'] = 333; 47365 t['ogonek'] = 333; 47366 t['caron'] = 333; 47367 t['emdash'] = 889; 47368 t['AE'] = 889; 47369 t['ordfeminine'] = 276; 47370 t['Lslash'] = 556; 47371 t['Oslash'] = 722; 47372 t['OE'] = 944; 47373 t['ordmasculine'] = 310; 47374 t['ae'] = 667; 47375 t['dotlessi'] = 278; 47376 t['lslash'] = 278; 47377 t['oslash'] = 500; 47378 t['oe'] = 667; 47379 t['germandbls'] = 500; 47380 t['Idieresis'] = 333; 47381 t['eacute'] = 444; 47382 t['abreve'] = 500; 47383 t['uhungarumlaut'] = 500; 47384 t['ecaron'] = 444; 47385 t['Ydieresis'] = 556; 47386 t['divide'] = 675; 47387 t['Yacute'] = 556; 47388 t['Acircumflex'] = 611; 47389 t['aacute'] = 500; 47390 t['Ucircumflex'] = 722; 47391 t['yacute'] = 444; 47392 t['scommaaccent'] = 389; 47393 t['ecircumflex'] = 444; 47394 t['Uring'] = 722; 47395 t['Udieresis'] = 722; 47396 t['aogonek'] = 500; 47397 t['Uacute'] = 722; 47398 t['uogonek'] = 500; 47399 t['Edieresis'] = 611; 47400 t['Dcroat'] = 722; 47401 t['commaaccent'] = 250; 47402 t['copyright'] = 760; 47403 t['Emacron'] = 611; 47404 t['ccaron'] = 444; 47405 t['aring'] = 500; 47406 t['Ncommaaccent'] = 667; 47407 t['lacute'] = 278; 47408 t['agrave'] = 500; 47409 t['Tcommaaccent'] = 556; 47410 t['Cacute'] = 667; 47411 t['atilde'] = 500; 47412 t['Edotaccent'] = 611; 47413 t['scaron'] = 389; 47414 t['scedilla'] = 389; 47415 t['iacute'] = 278; 47416 t['lozenge'] = 471; 47417 t['Rcaron'] = 611; 47418 t['Gcommaaccent'] = 722; 47419 t['ucircumflex'] = 500; 47420 t['acircumflex'] = 500; 47421 t['Amacron'] = 611; 47422 t['rcaron'] = 389; 47423 t['ccedilla'] = 444; 47424 t['Zdotaccent'] = 556; 47425 t['Thorn'] = 611; 47426 t['Omacron'] = 722; 47427 t['Racute'] = 611; 47428 t['Sacute'] = 500; 47429 t['dcaron'] = 544; 47430 t['Umacron'] = 722; 47431 t['uring'] = 500; 47432 t['threesuperior'] = 300; 47433 t['Ograve'] = 722; 47434 t['Agrave'] = 611; 47435 t['Abreve'] = 611; 47436 t['multiply'] = 675; 47437 t['uacute'] = 500; 47438 t['Tcaron'] = 556; 47439 t['partialdiff'] = 476; 47440 t['ydieresis'] = 444; 47441 t['Nacute'] = 667; 47442 t['icircumflex'] = 278; 47443 t['Ecircumflex'] = 611; 47444 t['adieresis'] = 500; 47445 t['edieresis'] = 444; 47446 t['cacute'] = 444; 47447 t['nacute'] = 500; 47448 t['umacron'] = 500; 47449 t['Ncaron'] = 667; 47450 t['Iacute'] = 333; 47451 t['plusminus'] = 675; 47452 t['brokenbar'] = 275; 47453 t['registered'] = 760; 47454 t['Gbreve'] = 722; 47455 t['Idotaccent'] = 333; 47456 t['summation'] = 600; 47457 t['Egrave'] = 611; 47458 t['racute'] = 389; 47459 t['omacron'] = 500; 47460 t['Zacute'] = 556; 47461 t['Zcaron'] = 556; 47462 t['greaterequal'] = 549; 47463 t['Eth'] = 722; 47464 t['Ccedilla'] = 667; 47465 t['lcommaaccent'] = 278; 47466 t['tcaron'] = 300; 47467 t['eogonek'] = 444; 47468 t['Uogonek'] = 722; 47469 t['Aacute'] = 611; 47470 t['Adieresis'] = 611; 47471 t['egrave'] = 444; 47472 t['zacute'] = 389; 47473 t['iogonek'] = 278; 47474 t['Oacute'] = 722; 47475 t['oacute'] = 500; 47476 t['amacron'] = 500; 47477 t['sacute'] = 389; 47478 t['idieresis'] = 278; 47479 t['Ocircumflex'] = 722; 47480 t['Ugrave'] = 722; 47481 t['Delta'] = 612; 47482 t['thorn'] = 500; 47483 t['twosuperior'] = 300; 47484 t['Odieresis'] = 722; 47485 t['mu'] = 500;
47486 t['igrave'] = 278; 47487 t['ohungarumlaut'] = 500; 47488 t['Eogonek'] = 611; 47489 t['dcroat'] = 500; 47490 t['threequarters'] = 750; 47491 t['Scedilla'] = 500; 47492 t['lcaron'] = 300; 47493 t['Kcommaaccent'] = 667; 47494 t['Lacute'] = 556; 47495 t['trademark'] = 980; 47496 t['edotaccent'] = 444; 47497 t['Igrave'] = 333; 47498 t['Imacron'] = 333; 47499 t['Lcaron'] = 611; 47500 t['onehalf'] = 750; 47501 t['lessequal'] = 549; 47502 t['ocircumflex'] = 500; 47503 t['ntilde'] = 500; 47504 t['Uhungarumlaut'] = 722; 47505 t['Eacute'] = 611; 47506 t['emacron'] = 444; 47507 t['gbreve'] = 500; 47508 t['onequarter'] = 750; 47509 t['Scaron'] = 500; 47510 t['Scommaaccent'] = 500; 47511 t['Ohungarumlaut'] = 722; 47512 t['degree'] = 400; 47513 t['ograve'] = 500; 47514 t['Ccaron'] = 667; 47515 t['ugrave'] = 500; 47516 t['radical'] = 453; 47517 t['Dcaron'] = 722; 47518 t['rcommaaccent'] = 389; 47519 t['Ntilde'] = 667; 47520 t['otilde'] = 500; 47521 t['Rcommaaccent'] = 611; 47522 t['Lcommaaccent'] = 556; 47523 t['Atilde'] = 611; 47524 t['Aogonek'] = 611; 47525 t['Aring'] = 611; 47526 t['Otilde'] = 722; 47527 t['zdotaccent'] = 389; 47528 t['Ecaron'] = 611; 47529 t['Iogonek'] = 333; 47530 t['kcommaaccent'] = 444; 47531 t['minus'] = 675; 47532 t['Icircumflex'] = 333; 47533 t['ncaron'] = 500; 47534 t['tcommaaccent'] = 278; 47535 t['logicalnot'] = 675; 47536 t['odieresis'] = 500; 47537 t['udieresis'] = 500; 47538 t['notequal'] = 549; 47539 t['gcommaaccent'] = 500; 47540 t['eth'] = 500; 47541 t['zcaron'] = 389; 47542 t['ncommaaccent'] = 500; 47543 t['onesuperior'] = 300;
47544 t['imacron'] = 278; 47545 t['Euro'] = 500; 47546 }); 47547 t['ZapfDingbats'] = getLookupTableFactory(function (t) { 47548 t['space'] = 278; 47549 t['a1'] = 974; 47550 t['a2'] = 961; 47551 t['a202'] = 974; 47552 t['a3'] = 980; 47553 t['a4'] = 719; 47554 t['a5'] = 789; 47555 t['a119'] = 790; 47556 t['a118'] = 791; 47557 t['a117'] = 690; 47558 t['a11'] = 960; 47559 t['a12'] = 939; 47560 t['a13'] = 549; 47561 t['a14'] = 855; 47562 t['a15'] = 911; 47563 t['a16'] = 933; 47564 t['a105'] = 911; 47565 t['a17'] = 945; 47566 t['a18'] = 974; 47567 t['a19'] = 755; 47568 t['a20'] = 846; 47569 t['a21'] = 762; 47570 t['a22'] = 761; 47571 t['a23'] = 571; 47572 t['a24'] = 677; 47573 t['a25'] = 763; 47574 t['a26'] = 760; 47575 t['a27'] = 759; 47576 t['a28'] = 754; 47577 t['a6'] = 494; 47578 t['a7'] = 552; 47579 t['a8'] = 537; 47580 t['a9'] = 577; 47581 t['a10'] = 692; 47582 t['a29'] = 786; 47583 t['a30'] = 788; 47584 t['a31'] = 788; 47585 t['a32'] = 790; 47586 t['a33'] = 793; 47587 t['a34'] = 794; 47588 t['a35'] = 816; 47589 t['a36'] = 823; 47590 t['a37'] = 789; 47591 t['a38'] = 841; 47592 t['a39'] = 823; 47593 t['a40'] = 833; 47594 t['a41'] = 816; 47595 t['a42'] = 831; 47596 t['a43'] = 923; 47597 t['a44'] = 744; 47598 t['a45'] = 723; 47599 t['a46'] = 749; 47600 t['a47'] = 790; 47601 t['a48'] = 792; 47602 t['a49'] = 695; 47603 t['a50'] = 776; 47604 t['a51'] = 768; 47605 t['a52'] = 792; 47606 t['a53'] = 759; 47607 t['a54'] = 707; 47608 t['a55'] = 708; 47609 t['a56'] = 682; 47610 t['a57'] = 701; 47611 t['a58'] = 826; 47612 t['a59'] = 815; 47613 t['a60'] = 789; 47614 t['a61'] = 789; 47615 t['a62'] = 707; 47616 t['a63'] = 687; 47617 t['a64'] = 696; 47618 t['a65'] = 689; 47619 t['a66'] = 786; 47620 t['a67'] = 787; 47621 t['a68'] = 713; 47622 t['a69'] = 791; 47623 t['a70'] = 785; 47624 t['a71'] = 791; 47625 t['a72'] = 873; 47626 t['a73'] = 761; 47627 t['a74'] = 762; 47628 t['a203'] = 762; 47629 t['a75'] = 759; 47630 t['a204'] = 759; 47631 t['a76'] = 892; 47632 t['a77'] = 892; 47633 t['a78'] = 788; 47634 t['a79'] = 784; 47635 t['a81'] = 438; 47636 t['a82'] = 138; 47637 t['a83'] = 277; 47638 t['a84'] = 415; 47639 t['a97'] = 392; 47640 t['a98'] = 392; 47641 t['a99'] = 668; 47642 t['a100'] = 668; 47643 t['a89'] = 390; 47644 t['a90'] = 390; 47645 t['a93'] = 317; 47646 t['a94'] = 317; 47647 t['a91'] = 276; 47648 t['a92'] = 276; 47649 t['a205'] = 509; 47650 t['a85'] = 509; 47651 t['a206'] = 410; 47652 t['a86'] = 410; 47653 t['a87'] = 234; 47654 t['a88'] = 234; 47655 t['a95'] = 334; 47656 t['a96'] = 334; 47657 t['a101'] = 732; 47658 t['a102'] = 544; 47659 t['a103'] = 544; 47660 t['a104'] = 910; 47661 t['a106'] = 667; 47662 t['a107'] = 760; 47663 t['a108'] = 760; 47664 t['a112'] = 776; 47665 t['a111'] = 595; 47666 t['a110'] = 694; 47667 t['a109'] = 626; 47668 t['a120'] = 788; 47669 t['a121'] = 788; 47670 t['a122'] = 788; 47671 t['a123'] = 788; 47672 t['a124'] = 788; 47673 t['a125'] = 788; 47674 t['a126'] = 788; 47675 t['a127'] = 788; 47676 t['a128'] = 788; 47677 t['a129'] = 788; 47678 t['a130'] = 788; 47679 t['a131'] = 788; 47680 t['a132'] = 788; 47681 t['a133'] = 788; 47682 t['a134'] = 788; 47683 t['a135'] = 788; 47684 t['a136'] = 788; 47685 t['a137'] = 788; 47686 t['a138'] = 788; 47687 t['a139'] = 788; 47688 t['a140'] = 788; 47689 t['a141'] = 788; 47690 t['a142'] = 788; 47691 t['a143'] = 788; 47692 t['a144'] = 788; 47693 t['a145'] = 788; 47694 t['a146'] = 788; 47695 t['a147'] = 788; 47696 t['a148'] = 788; 47697 t['a149'] = 788; 47698 t['a150'] = 788; 47699 t['a151'] = 788; 47700 t['a152'] = 788; 47701 t['a153'] = 788; 47702 t['a154'] = 788; 47703 t['a155'] = 788; 47704 t['a156'] = 788; 47705 t['a157'] = 788; 47706 t['a158'] = 788; 47707 t['a159'] = 788; 47708 t['a160'] = 894; 47709 t['a161'] = 838; 47710 t['a163'] = 1016; 47711 t['a164'] = 458; 47712 t['a196'] = 748; 47713 t['a165'] = 924; 47714 t['a192'] = 748; 47715 t['a166'] = 918; 47716 t['a167'] = 927; 47717 t['a168'] = 928; 47718 t['a169'] = 928; 47719 t['a170'] = 834; 47720 t['a171'] = 873; 47721 t['a172'] = 828; 47722 t['a173'] = 924; 47723 t['a162'] = 924; 47724 t['a174'] = 917; 47725 t['a175'] = 930; 47726 t['a176'] = 931; 47727 t['a177'] = 463; 47728 t['a178'] = 883; 47729 t['a179'] = 836; 47730 t['a193'] = 836; 47731 t['a180'] = 867; 47732 t['a199'] = 867; 47733 t['a181'] = 696; 47734 t['a200'] = 696; 47735 t['a182'] = 874; 47736 t['a201'] = 874; 47737 t['a183'] = 760; 47738 t['a184'] = 946; 47739 t['a197'] = 771; 47740 t['a185'] = 865; 47741 t['a194'] = 771; 47742 t['a198'] = 888; 47743 t['a186'] = 967; 47744 t['a195'] = 888; 47745 t['a187'] = 831; 47746 t['a188'] = 873; 47747 t['a189'] = 927; 47748 t['a190'] = 970; 47749 t['a191'] = 918; 47750 }); 47751}); 47752exports.getMetrics = getMetrics; 47753 47754/***/ }), 47755/* 31 */ 47756/***/ (function(module, exports, __w_pdfjs_require__) { 47757 47758"use strict"; 47759 47760var sharedUtil = __w_pdfjs_require__(0); 47761var Uint32ArrayView = sharedUtil.Uint32ArrayView; 47762var MurmurHash3_64 = function MurmurHash3_64Closure(seed) { 47763 var MASK_HIGH = 0xffff0000; 47764 var MASK_LOW = 0xffff; 47765 function MurmurHash3_64(seed) { 47766 var SEED = 0xc3d2e1f0; 47767 this.h1 = seed ? seed & 0xffffffff : SEED; 47768 this.h2 = seed ? seed & 0xffffffff : SEED; 47769 } 47770 var alwaysUseUint32ArrayView = false;
vendor: 51,433 bytes, lines 47771-49562
47771 try { 47772 new Uint32Array(new Uint8Array(5).buffer, 0, 1); 47773 } catch (e) { 47774 alwaysUseUint32ArrayView = true; 47775 } 47776 MurmurHash3_64.prototype = { 47777 update: function MurmurHash3_64_update(input) { 47778 var useUint32ArrayView = alwaysUseUint32ArrayView; 47779 var i; 47780 if (typeof input === 'string') { 47781 var data = new Uint8Array(input.length * 2); 47782 var length = 0; 47783 for (i = 0; i < input.length; i++) { 47784 var code = input.charCodeAt(i); 47785 if (code <= 0xff) { 47786 data[length++] = code; 47787 } else { 47788 data[length++] = code >>> 8; 47789 data[length++] = code & 0xff; 47790 } 47791 } 47792 } else if (input instanceof Uint8Array) { 47793 data = input; 47794 length = data.length; 47795 } else if (typeof input === 'object' && 'length' in input) { 47796 data = input; 47797 length = data.length; 47798 useUint32ArrayView = true; 47799 } else { 47800 throw new Error('Wrong data format in MurmurHash3_64_update. ' + 'Input must be a string or array.'); 47801 } 47802 var blockCounts = length >> 2; 47803 var tailLength = length - blockCounts * 4; 47804 var dataUint32 = useUint32ArrayView ? new Uint32ArrayView(data, blockCounts) : new Uint32Array(data.buffer, 0, blockCounts); 47805 var k1 = 0; 47806 var k2 = 0; 47807 var h1 = this.h1; 47808 var h2 = this.h2; 47809 var C1 = 0xcc9e2d51; 47810 var C2 = 0x1b873593; 47811 var C1_LOW = C1 & MASK_LOW; 47812 var C2_LOW = C2 & MASK_LOW; 47813 for (i = 0; i < blockCounts; i++) { 47814 if (i & 1) { 47815 k1 = dataUint32[i]; 47816 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 47817 k1 = k1 << 15 | k1 >>> 17; 47818 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 47819 h1 ^= k1; 47820 h1 = h1 << 13 | h1 >>> 19; 47821 h1 = h1 * 5 + 0xe6546b64; 47822 } else { 47823 k2 = dataUint32[i]; 47824 k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; 47825 k2 = k2 << 15 | k2 >>> 17; 47826 k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; 47827 h2 ^= k2; 47828 h2 = h2 << 13 | h2 >>> 19; 47829 h2 = h2 * 5 + 0xe6546b64; 47830 } 47831 } 47832 k1 = 0; 47833 switch (tailLength) { 47834 case 3: 47835 k1 ^= data[blockCounts * 4 + 2] << 16; 47836 case 2: 47837 k1 ^= data[blockCounts * 4 + 1] << 8; 47838 case 1: 47839 k1 ^= data[blockCounts * 4]; 47840 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 47841 k1 = k1 << 15 | k1 >>> 17; 47842 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 47843 if (blockCounts & 1) { 47844 h1 ^= k1; 47845 } else { 47846 h2 ^= k1; 47847 } 47848 } 47849 this.h1 = h1; 47850 this.h2 = h2; 47851 return this; 47852 }, 47853 hexdigest: function MurmurHash3_64_hexdigest() { 47854 var h1 = this.h1; 47855 var h2 = this.h2; 47856 h1 ^= h2 >>> 1; 47857 h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; 47858 h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; 47859 h1 ^= h2 >>> 1; 47860 h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; 47861 h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; 47862 h1 ^= h2 >>> 1; 47863 for (var i = 0, arr = [ 47864 h1, 47865 h2 47866 ], str = ''; i < arr.length; i++) { 47867 var hex = (arr[i] >>> 0).toString(16); 47868 while (hex.length < 8) { 47869 hex = '0' + hex; 47870 } 47871 str += hex; 47872 } 47873 return str; 47874 } 47875 }; 47876 return MurmurHash3_64; 47877}(); 47878exports.MurmurHash3_64 = MurmurHash3_64; 47879 47880/***/ }), 47881/* 32 */ 47882/***/ (function(module, exports, __w_pdfjs_require__) { 47883 47884"use strict"; 47885 47886var sharedUtil = __w_pdfjs_require__(0); 47887var corePrimitives = __w_pdfjs_require__(1); 47888var coreFunction = __w_pdfjs_require__(6); 47889var coreColorSpace = __w_pdfjs_require__(3); 47890var UNSUPPORTED_FEATURES = sharedUtil.UNSUPPORTED_FEATURES; 47891var MissingDataException = sharedUtil.MissingDataException; 47892var Util = sharedUtil.Util; 47893var assert = sharedUtil.assert; 47894var error = sharedUtil.error; 47895var info = sharedUtil.info; 47896var warn = sharedUtil.warn; 47897var isStream = corePrimitives.isStream; 47898var PDFFunction = coreFunction.PDFFunction; 47899var ColorSpace = coreColorSpace.ColorSpace; 47900var ShadingType = { 47901 FUNCTION_BASED: 1, 47902 AXIAL: 2, 47903 RADIAL: 3, 47904 FREE_FORM_MESH: 4, 47905 LATTICE_FORM_MESH: 5, 47906 COONS_PATCH_MESH: 6, 47907 TENSOR_PATCH_MESH: 7 47908}; 47909var Pattern = function PatternClosure() { 47910 function Pattern() { 47911 error('should not call Pattern constructor'); 47912 } 47913 Pattern.prototype = { 47914 getPattern: function Pattern_getPattern(ctx) { 47915 error('Should not call Pattern.getStyle: ' + ctx); 47916 } 47917 }; 47918 Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref, res, handler) { 47919 var dict = isStream(shading) ? shading.dict : shading; 47920 var type = dict.get('ShadingType'); 47921 try { 47922 switch (type) { 47923 case ShadingType.AXIAL: 47924 case ShadingType.RADIAL: 47925 return new Shadings.RadialAxial(dict, matrix, xref, res); 47926 case ShadingType.FREE_FORM_MESH: 47927 case ShadingType.LATTICE_FORM_MESH: 47928 case ShadingType.COONS_PATCH_MESH: 47929 case ShadingType.TENSOR_PATCH_MESH: 47930 return new Shadings.Mesh(shading, matrix, xref, res); 47931 default: 47932 throw new Error('Unsupported ShadingType: ' + type); 47933 } 47934 } catch (ex) { 47935 if (ex instanceof MissingDataException) { 47936 throw ex; 47937 } 47938 handler.send('UnsupportedFeature', { featureId: UNSUPPORTED_FEATURES.shadingPattern }); 47939 warn(ex); 47940 return new Shadings.Dummy(); 47941 } 47942 }; 47943 return Pattern; 47944}(); 47945var Shadings = {}; 47946Shadings.SMALL_NUMBER = 1e-6; 47947Shadings.RadialAxial = function RadialAxialClosure() { 47948 function RadialAxial(dict, matrix, xref, res) { 47949 this.matrix = matrix; 47950 this.coordsArr = dict.getArray('Coords'); 47951 this.shadingType = dict.get('ShadingType'); 47952 this.type = 'Pattern'; 47953 var cs = dict.get('ColorSpace', 'CS'); 47954 cs = ColorSpace.parse(cs, xref, res); 47955 this.cs = cs; 47956 var t0 = 0.0, t1 = 1.0; 47957 if (dict.has('Domain')) { 47958 var domainArr = dict.getArray('Domain'); 47959 t0 = domainArr[0]; 47960 t1 = domainArr[1]; 47961 } 47962 var extendStart = false, extendEnd = false; 47963 if (dict.has('Extend')) { 47964 var extendArr = dict.getArray('Extend'); 47965 extendStart = extendArr[0]; 47966 extendEnd = extendArr[1]; 47967 } 47968 if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) { 47969 var x1 = this.coordsArr[0]; 47970 var y1 = this.coordsArr[1]; 47971 var r1 = this.coordsArr[2]; 47972 var x2 = this.coordsArr[3]; 47973 var y2 = this.coordsArr[4]; 47974 var r2 = this.coordsArr[5]; 47975 var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); 47976 if (r1 <= r2 + distance && r2 <= r1 + distance) { 47977 warn('Unsupported radial gradient.'); 47978 } 47979 } 47980 this.extendStart = extendStart; 47981 this.extendEnd = extendEnd; 47982 var fnObj = dict.get('Function'); 47983 var fn = PDFFunction.parseArray(xref, fnObj); 47984 var diff = t1 - t0; 47985 var step = diff / 10; 47986 var colorStops = this.colorStops = []; 47987 if (t0 >= t1 || step <= 0) { 47988 info('Bad shading domain.'); 47989 return; 47990 } 47991 var color = new Float32Array(cs.numComps), ratio = new Float32Array(1); 47992 var rgbColor; 47993 for (var i = t0; i <= t1; i += step) { 47994 ratio[0] = i; 47995 fn(ratio, 0, color, 0); 47996 rgbColor = cs.getRgb(color, 0); 47997 var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 47998 colorStops.push([ 47999 (i - t0) / diff, 48000 cssColor 48001 ]); 48002 } 48003 var background = 'transparent'; 48004 if (dict.has('Background')) { 48005 rgbColor = cs.getRgb(dict.get('Background'), 0); 48006 background = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 48007 } 48008 if (!extendStart) { 48009 colorStops.unshift([ 48010 0, 48011 background 48012 ]); 48013 colorStops[1][0] += Shadings.SMALL_NUMBER; 48014 } 48015 if (!extendEnd) { 48016 colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; 48017 colorStops.push([ 48018 1, 48019 background 48020 ]); 48021 } 48022 this.colorStops = colorStops; 48023 } 48024 RadialAxial.prototype = { 48025 getIR: function RadialAxial_getIR() { 48026 var coordsArr = this.coordsArr; 48027 var shadingType = this.shadingType; 48028 var type, p0, p1, r0, r1; 48029 if (shadingType === ShadingType.AXIAL) { 48030 p0 = [ 48031 coordsArr[0], 48032 coordsArr[1] 48033 ]; 48034 p1 = [ 48035 coordsArr[2], 48036 coordsArr[3] 48037 ]; 48038 r0 = null; 48039 r1 = null; 48040 type = 'axial'; 48041 } else if (shadingType === ShadingType.RADIAL) { 48042 p0 = [ 48043 coordsArr[0], 48044 coordsArr[1] 48045 ]; 48046 p1 = [ 48047 coordsArr[3], 48048 coordsArr[4] 48049 ]; 48050 r0 = coordsArr[2]; 48051 r1 = coordsArr[5]; 48052 type = 'radial'; 48053 } else { 48054 error('getPattern type unknown: ' + shadingType); 48055 } 48056 var matrix = this.matrix; 48057 if (matrix) { 48058 p0 = Util.applyTransform(p0, matrix); 48059 p1 = Util.applyTransform(p1, matrix); 48060 if (shadingType === ShadingType.RADIAL) { 48061 var scale = Util.singularValueDecompose2dScale(matrix); 48062 r0 *= scale[0]; 48063 r1 *= scale[1]; 48064 } 48065 } 48066 return [ 48067 'RadialAxial', 48068 type, 48069 this.colorStops, 48070 p0, 48071 p1, 48072 r0, 48073 r1 48074 ]; 48075 } 48076 }; 48077 return RadialAxial; 48078}(); 48079Shadings.Mesh = function MeshClosure() { 48080 function MeshStreamReader(stream, context) { 48081 this.stream = stream; 48082 this.context = context; 48083 this.buffer = 0; 48084 this.bufferLength = 0; 48085 var numComps = context.numComps; 48086 this.tmpCompsBuf = new Float32Array(numComps); 48087 var csNumComps = context.colorSpace.numComps; 48088 this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf; 48089 } 48090 MeshStreamReader.prototype = { 48091 get hasData() { 48092 if (this.stream.end) { 48093 return this.stream.pos < this.stream.end; 48094 } 48095 if (this.bufferLength > 0) { 48096 return true; 48097 } 48098 var nextByte = this.stream.getByte(); 48099 if (nextByte < 0) { 48100 return false; 48101 } 48102 this.buffer = nextByte; 48103 this.bufferLength = 8; 48104 return true; 48105 }, 48106 readBits: function MeshStreamReader_readBits(n) { 48107 var buffer = this.buffer; 48108 var bufferLength = this.bufferLength; 48109 if (n === 32) { 48110 if (bufferLength === 0) { 48111 return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0; 48112 } 48113 buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte(); 48114 var nextByte = this.stream.getByte(); 48115 this.buffer = nextByte & (1 << bufferLength) - 1; 48116 return (buffer << 8 - bufferLength | (nextByte & 0xFF) >> bufferLength) >>> 0; 48117 } 48118 if (n === 8 && bufferLength === 0) { 48119 return this.stream.getByte(); 48120 } 48121 while (bufferLength < n) { 48122 buffer = buffer << 8 | this.stream.getByte(); 48123 bufferLength += 8; 48124 } 48125 bufferLength -= n; 48126 this.bufferLength = bufferLength; 48127 this.buffer = buffer & (1 << bufferLength) - 1; 48128 return buffer >> bufferLength; 48129 }, 48130 align: function MeshStreamReader_align() { 48131 this.buffer = 0; 48132 this.bufferLength = 0; 48133 }, 48134 readFlag: function MeshStreamReader_readFlag() { 48135 return this.readBits(this.context.bitsPerFlag); 48136 }, 48137 readCoordinate: function MeshStreamReader_readCoordinate() { 48138 var bitsPerCoordinate = this.context.bitsPerCoordinate; 48139 var xi = this.readBits(bitsPerCoordinate); 48140 var yi = this.readBits(bitsPerCoordinate); 48141 var decode = this.context.decode; 48142 var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10; 48143 return [ 48144 xi * scale * (decode[1] - decode[0]) + decode[0], 48145 yi * scale * (decode[3] - decode[2]) + decode[2] 48146 ]; 48147 }, 48148 readComponents: function MeshStreamReader_readComponents() { 48149 var numComps = this.context.numComps; 48150 var bitsPerComponent = this.context.bitsPerComponent; 48151 var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10; 48152 var decode = this.context.decode; 48153 var components = this.tmpCompsBuf; 48154 for (var i = 0, j = 4; i < numComps; i++, j += 2) { 48155 var ci = this.readBits(bitsPerComponent); 48156 components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; 48157 } 48158 var color = this.tmpCsCompsBuf; 48159 if (this.context.colorFn) { 48160 this.context.colorFn(components, 0, color, 0); 48161 } 48162 return this.context.colorSpace.getRgb(color, 0); 48163 } 48164 }; 48165 function decodeType4Shading(mesh, reader) { 48166 var coords = mesh.coords; 48167 var colors = mesh.colors; 48168 var operators = []; 48169 var ps = []; 48170 var verticesLeft = 0; 48171 while (reader.hasData) { 48172 var f = reader.readFlag(); 48173 var coord = reader.readCoordinate(); 48174 var color = reader.readComponents(); 48175 if (verticesLeft === 0) { 48176 assert(0 <= f && f <= 2, 'Unknown type4 flag'); 48177 switch (f) { 48178 case 0: 48179 verticesLeft = 3; 48180 break; 48181 case 1: 48182 ps.push(ps[ps.length - 2], ps[ps.length - 1]); 48183 verticesLeft = 1; 48184 break; 48185 case 2: 48186 ps.push(ps[ps.length - 3], ps[ps.length - 1]); 48187 verticesLeft = 1; 48188 break; 48189 } 48190 operators.push(f); 48191 } 48192 ps.push(coords.length); 48193 coords.push(coord); 48194 colors.push(color); 48195 verticesLeft--; 48196 reader.align(); 48197 } 48198 mesh.figures.push({ 48199 type: 'triangles', 48200 coords: new Int32Array(ps), 48201 colors: new Int32Array(ps) 48202 }); 48203 } 48204 function decodeType5Shading(mesh, reader, verticesPerRow) { 48205 var coords = mesh.coords; 48206 var colors = mesh.colors; 48207 var ps = []; 48208 while (reader.hasData) { 48209 var coord = reader.readCoordinate(); 48210 var color = reader.readComponents(); 48211 ps.push(coords.length); 48212 coords.push(coord); 48213 colors.push(color); 48214 } 48215 mesh.figures.push({ 48216 type: 'lattice', 48217 coords: new Int32Array(ps), 48218 colors: new Int32Array(ps), 48219 verticesPerRow: verticesPerRow 48220 }); 48221 } 48222 var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; 48223 var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; 48224 var TRIANGLE_DENSITY = 20; 48225 var getB = function getBClosure() { 48226 function buildB(count) { 48227 var lut = []; 48228 for (var i = 0; i <= count; i++) { 48229 var t = i / count, t_ = 1 - t; 48230 lut.push(new Float32Array([ 48231 t_ * t_ * t_, 48232 3 * t * t_ * t_, 48233 3 * t * t * t_, 48234 t * t * t 48235 ])); 48236 } 48237 return lut; 48238 } 48239 var cache = []; 48240 return function getB(count) { 48241 if (!cache[count]) { 48242 cache[count] = buildB(count); 48243 } 48244 return cache[count]; 48245 }; 48246 }(); 48247 function buildFigureFromPatch(mesh, index) { 48248 var figure = mesh.figures[index]; 48249 assert(figure.type === 'patch', 'Unexpected patch mesh figure'); 48250 var coords = mesh.coords, colors = mesh.colors; 48251 var pi = figure.coords; 48252 var ci = figure.colors; 48253 var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 48254 var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 48255 var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 48256 var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 48257 var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / (mesh.bounds[2] - mesh.bounds[0])); 48258 splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); 48259 var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / (mesh.bounds[3] - mesh.bounds[1])); 48260 splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); 48261 var verticesPerRow = splitXBy + 1; 48262 var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); 48263 var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); 48264 var k = 0; 48265 var cl = new Uint8Array(3), cr = new Uint8Array(3); 48266 var c0 = colors[ci[0]], c1 = colors[ci[1]], c2 = colors[ci[2]], c3 = colors[ci[3]]; 48267 var bRow = getB(splitYBy), bCol = getB(splitXBy); 48268 for (var row = 0; row <= splitYBy; row++) { 48269 cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0; 48270 cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0; 48271 cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0; 48272 cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0; 48273 cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0; 48274 cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0; 48275 for (var col = 0; col <= splitXBy; col++, k++) { 48276 if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) { 48277 continue; 48278 } 48279 var x = 0, y = 0; 48280 var q = 0; 48281 for (var i = 0; i <= 3; i++) { 48282 for (var j = 0; j <= 3; j++, q++) { 48283 var m = bRow[row][i] * bCol[col][j]; 48284 x += coords[pi[q]][0] * m; 48285 y += coords[pi[q]][1] * m; 48286 } 48287 } 48288 figureCoords[k] = coords.length; 48289 coords.push([ 48290 x, 48291 y 48292 ]); 48293 figureColors[k] = colors.length; 48294 var newColor = new Uint8Array(3); 48295 newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0; 48296 newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0; 48297 newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0; 48298 colors.push(newColor); 48299 } 48300 } 48301 figureCoords[0] = pi[0]; 48302 figureColors[0] = ci[0]; 48303 figureCoords[splitXBy] = pi[3]; 48304 figureColors[splitXBy] = ci[1]; 48305 figureCoords[verticesPerRow * splitYBy] = pi[12]; 48306 figureColors[verticesPerRow * splitYBy] = ci[2]; 48307 figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; 48308 figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; 48309 mesh.figures[index] = { 48310 type: 'lattice', 48311 coords: figureCoords, 48312 colors: figureColors, 48313 verticesPerRow: verticesPerRow 48314 }; 48315 } 48316 function decodeType6Shading(mesh, reader) { 48317 var coords = mesh.coords; 48318 var colors = mesh.colors; 48319 var ps = new Int32Array(16); 48320 var cs = new Int32Array(4); 48321 while (reader.hasData) { 48322 var f = reader.readFlag(); 48323 assert(0 <= f && f <= 3, 'Unknown type6 flag'); 48324 var i, ii; 48325 var pi = coords.length; 48326 for (i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { 48327 coords.push(reader.readCoordinate()); 48328 } 48329 var ci = colors.length; 48330 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 48331 colors.push(reader.readComponents()); 48332 } 48333 var tmp1, tmp2, tmp3, tmp4; 48334 switch (f) { 48335 case 0: 48336 ps[12] = pi + 3; 48337 ps[13] = pi + 4; 48338 ps[14] = pi + 5; 48339 ps[15] = pi + 6; 48340 ps[8] = pi + 2; 48341 ps[11] = pi + 7; 48342 ps[4] = pi + 1; 48343 ps[7] = pi + 8; 48344 ps[0] = pi; 48345 ps[1] = pi + 11; 48346 ps[2] = pi + 10; 48347 ps[3] = pi + 9; 48348 cs[2] = ci + 1; 48349 cs[3] = ci + 2; 48350 cs[0] = ci; 48351 cs[1] = ci + 3; 48352 break; 48353 case 1: 48354 tmp1 = ps[12]; 48355 tmp2 = ps[13]; 48356 tmp3 = ps[14]; 48357 tmp4 = ps[15]; 48358 ps[12] = tmp4; 48359 ps[13] = pi + 0; 48360 ps[14] = pi + 1; 48361 ps[15] = pi + 2; 48362 ps[8] = tmp3; 48363 ps[11] = pi + 3; 48364 ps[4] = tmp2; 48365 ps[7] = pi + 4; 48366 ps[0] = tmp1; 48367 ps[1] = pi + 7; 48368 ps[2] = pi + 6; 48369 ps[3] = pi + 5; 48370 tmp1 = cs[2]; 48371 tmp2 = cs[3]; 48372 cs[2] = tmp2; 48373 cs[3] = ci; 48374 cs[0] = tmp1; 48375 cs[1] = ci + 1; 48376 break; 48377 case 2: 48378 tmp1 = ps[15]; 48379 tmp2 = ps[11]; 48380 ps[12] = ps[3]; 48381 ps[13] = pi + 0; 48382 ps[14] = pi + 1; 48383 ps[15] = pi + 2; 48384 ps[8] = ps[7]; 48385 ps[11] = pi + 3; 48386 ps[4] = tmp2; 48387 ps[7] = pi + 4; 48388 ps[0] = tmp1; 48389 ps[1] = pi + 7; 48390 ps[2] = pi + 6; 48391 ps[3] = pi + 5; 48392 tmp1 = cs[3]; 48393 cs[2] = cs[1]; 48394 cs[3] = ci; 48395 cs[0] = tmp1; 48396 cs[1] = ci + 1; 48397 break; 48398 case 3: 48399 ps[12] = ps[0]; 48400 ps[13] = pi + 0; 48401 ps[14] = pi + 1; 48402 ps[15] = pi + 2; 48403 ps[8] = ps[1]; 48404 ps[11] = pi + 3; 48405 ps[4] = ps[2]; 48406 ps[7] = pi + 4; 48407 ps[0] = ps[3]; 48408 ps[1] = pi + 7; 48409 ps[2] = pi + 6; 48410 ps[3] = pi + 5; 48411 cs[2] = cs[0]; 48412 cs[3] = ci; 48413 cs[0] = cs[1]; 48414 cs[1] = ci + 1; 48415 break; 48416 } 48417 ps[5] = coords.length; 48418 coords.push([ 48419 (-4 * coords[ps[0]][0] - coords[ps[15]][0] + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, 48420 (-4 * coords[ps[0]][1] - coords[ps[15]][1] + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9 48421 ]); 48422 ps[6] = coords.length; 48423 coords.push([ 48424 (-4 * coords[ps[3]][0] - coords[ps[12]][0] + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, 48425 (-4 * coords[ps[3]][1] - coords[ps[12]][1] + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9 48426 ]); 48427 ps[9] = coords.length; 48428 coords.push([ 48429 (-4 * coords[ps[12]][0] - coords[ps[3]][0] + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, 48430 (-4 * coords[ps[12]][1] - coords[ps[3]][1] + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9 48431 ]); 48432 ps[10] = coords.length; 48433 coords.push([ 48434 (-4 * coords[ps[15]][0] - coords[ps[0]][0] + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, 48435 (-4 * coords[ps[15]][1] - coords[ps[0]][1] + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9 48436 ]); 48437 mesh.figures.push({ 48438 type: 'patch', 48439 coords: new Int32Array(ps), 48440 colors: new Int32Array(cs) 48441 }); 48442 } 48443 } 48444 function decodeType7Shading(mesh, reader) { 48445 var coords = mesh.coords; 48446 var colors = mesh.colors; 48447 var ps = new Int32Array(16); 48448 var cs = new Int32Array(4); 48449 while (reader.hasData) { 48450 var f = reader.readFlag(); 48451 assert(0 <= f && f <= 3, 'Unknown type7 flag'); 48452 var i, ii; 48453 var pi = coords.length; 48454 for (i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { 48455 coords.push(reader.readCoordinate()); 48456 } 48457 var ci = colors.length; 48458 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 48459 colors.push(reader.readComponents()); 48460 } 48461 var tmp1, tmp2, tmp3, tmp4; 48462 switch (f) { 48463 case 0: 48464 ps[12] = pi + 3; 48465 ps[13] = pi + 4; 48466 ps[14] = pi + 5; 48467 ps[15] = pi + 6; 48468 ps[8] = pi + 2; 48469 ps[9] = pi + 13; 48470 ps[10] = pi + 14; 48471 ps[11] = pi + 7; 48472 ps[4] = pi + 1; 48473 ps[5] = pi + 12; 48474 ps[6] = pi + 15; 48475 ps[7] = pi + 8; 48476 ps[0] = pi; 48477 ps[1] = pi + 11; 48478 ps[2] = pi + 10; 48479 ps[3] = pi + 9; 48480 cs[2] = ci + 1; 48481 cs[3] = ci + 2; 48482 cs[0] = ci; 48483 cs[1] = ci + 3; 48484 break; 48485 case 1: 48486 tmp1 = ps[12]; 48487 tmp2 = ps[13]; 48488 tmp3 = ps[14]; 48489 tmp4 = ps[15]; 48490 ps[12] = tmp4; 48491 ps[13] = pi + 0; 48492 ps[14] = pi + 1; 48493 ps[15] = pi + 2; 48494 ps[8] = tmp3; 48495 ps[9] = pi + 9; 48496 ps[10] = pi + 10; 48497 ps[11] = pi + 3; 48498 ps[4] = tmp2; 48499 ps[5] = pi + 8; 48500 ps[6] = pi + 11; 48501 ps[7] = pi + 4; 48502 ps[0] = tmp1; 48503 ps[1] = pi + 7; 48504 ps[2] = pi + 6; 48505 ps[3] = pi + 5; 48506 tmp1 = cs[2]; 48507 tmp2 = cs[3]; 48508 cs[2] = tmp2; 48509 cs[3] = ci; 48510 cs[0] = tmp1; 48511 cs[1] = ci + 1; 48512 break; 48513 case 2: 48514 tmp1 = ps[15]; 48515 tmp2 = ps[11]; 48516 ps[12] = ps[3]; 48517 ps[13] = pi + 0; 48518 ps[14] = pi + 1; 48519 ps[15] = pi + 2; 48520 ps[8] = ps[7]; 48521 ps[9] = pi + 9; 48522 ps[10] = pi + 10; 48523 ps[11] = pi + 3; 48524 ps[4] = tmp2; 48525 ps[5] = pi + 8; 48526 ps[6] = pi + 11; 48527 ps[7] = pi + 4; 48528 ps[0] = tmp1; 48529 ps[1] = pi + 7; 48530 ps[2] = pi + 6; 48531 ps[3] = pi + 5; 48532 tmp1 = cs[3]; 48533 cs[2] = cs[1]; 48534 cs[3] = ci; 48535 cs[0] = tmp1; 48536 cs[1] = ci + 1; 48537 break; 48538 case 3: 48539 ps[12] = ps[0]; 48540 ps[13] = pi + 0; 48541 ps[14] = pi + 1; 48542 ps[15] = pi + 2; 48543 ps[8] = ps[1]; 48544 ps[9] = pi + 9; 48545 ps[10] = pi + 10; 48546 ps[11] = pi + 3; 48547 ps[4] = ps[2]; 48548 ps[5] = pi + 8; 48549 ps[6] = pi + 11; 48550 ps[7] = pi + 4; 48551 ps[0] = ps[3]; 48552 ps[1] = pi + 7; 48553 ps[2] = pi + 6; 48554 ps[3] = pi + 5; 48555 cs[2] = cs[0]; 48556 cs[3] = ci; 48557 cs[0] = cs[1]; 48558 cs[1] = ci + 1; 48559 break; 48560 } 48561 mesh.figures.push({ 48562 type: 'patch', 48563 coords: new Int32Array(ps), 48564 colors: new Int32Array(cs) 48565 }); 48566 } 48567 } 48568 function updateBounds(mesh) { 48569 var minX = mesh.coords[0][0], minY = mesh.coords[0][1], maxX = minX, maxY = minY; 48570 for (var i = 1, ii = mesh.coords.length; i < ii; i++) { 48571 var x = mesh.coords[i][0], y = mesh.coords[i][1]; 48572 minX = minX > x ? x : minX; 48573 minY = minY > y ? y : minY; 48574 maxX = maxX < x ? x : maxX; 48575 maxY = maxY < y ? y : maxY; 48576 } 48577 mesh.bounds = [ 48578 minX, 48579 minY, 48580 maxX, 48581 maxY 48582 ]; 48583 } 48584 function packData(mesh) { 48585 var i, ii, j, jj; 48586 var coords = mesh.coords; 48587 var coordsPacked = new Float32Array(coords.length * 2); 48588 for (i = 0, j = 0, ii = coords.length; i < ii; i++) { 48589 var xy = coords[i]; 48590 coordsPacked[j++] = xy[0]; 48591 coordsPacked[j++] = xy[1]; 48592 } 48593 mesh.coords = coordsPacked; 48594 var colors = mesh.colors; 48595 var colorsPacked = new Uint8Array(colors.length * 3); 48596 for (i = 0, j = 0, ii = colors.length; i < ii; i++) { 48597 var c = colors[i]; 48598 colorsPacked[j++] = c[0]; 48599 colorsPacked[j++] = c[1]; 48600 colorsPacked[j++] = c[2]; 48601 } 48602 mesh.colors = colorsPacked; 48603 var figures = mesh.figures; 48604 for (i = 0, ii = figures.length; i < ii; i++) { 48605 var figure = figures[i], ps = figure.coords, cs = figure.colors; 48606 for (j = 0, jj = ps.length; j < jj; j++) { 48607 ps[j] *= 2; 48608 cs[j] *= 3; 48609 } 48610 } 48611 } 48612 function Mesh(stream, matrix, xref, res) { 48613 assert(isStream(stream), 'Mesh data is not a stream'); 48614 var dict = stream.dict; 48615 this.matrix = matrix; 48616 this.shadingType = dict.get('ShadingType'); 48617 this.type = 'Pattern'; 48618 this.bbox = dict.getArray('BBox'); 48619 var cs = dict.get('ColorSpace', 'CS'); 48620 cs = ColorSpace.parse(cs, xref, res); 48621 this.cs = cs; 48622 this.background = dict.has('Background') ? cs.getRgb(dict.get('Background'), 0) : null; 48623 var fnObj = dict.get('Function'); 48624 var fn = fnObj ? PDFFunction.parseArray(xref, fnObj) : null; 48625 this.coords = []; 48626 this.colors = []; 48627 this.figures = []; 48628 var decodeContext = { 48629 bitsPerCoordinate: dict.get('BitsPerCoordinate'), 48630 bitsPerComponent: dict.get('BitsPerComponent'), 48631 bitsPerFlag: dict.get('BitsPerFlag'), 48632 decode: dict.getArray('Decode'), 48633 colorFn: fn, 48634 colorSpace: cs, 48635 numComps: fn ? 1 : cs.numComps 48636 }; 48637 var reader = new MeshStreamReader(stream, decodeContext); 48638 var patchMesh = false; 48639 switch (this.shadingType) { 48640 case ShadingType.FREE_FORM_MESH: 48641 decodeType4Shading(this, reader); 48642 break; 48643 case ShadingType.LATTICE_FORM_MESH: 48644 var verticesPerRow = dict.get('VerticesPerRow') | 0; 48645 assert(verticesPerRow >= 2, 'Invalid VerticesPerRow'); 48646 decodeType5Shading(this, reader, verticesPerRow); 48647 break; 48648 case ShadingType.COONS_PATCH_MESH: 48649 decodeType6Shading(this, reader); 48650 patchMesh = true; 48651 break; 48652 case ShadingType.TENSOR_PATCH_MESH: 48653 decodeType7Shading(this, reader); 48654 patchMesh = true; 48655 break; 48656 default: 48657 error('Unsupported mesh type.'); 48658 break; 48659 } 48660 if (patchMesh) { 48661 updateBounds(this); 48662 for (var i = 0, ii = this.figures.length; i < ii; i++) { 48663 buildFigureFromPatch(this, i); 48664 } 48665 } 48666 updateBounds(this); 48667 packData(this); 48668 } 48669 Mesh.prototype = { 48670 getIR: function Mesh_getIR() { 48671 return [ 48672 'Mesh', 48673 this.shadingType, 48674 this.coords, 48675 this.colors, 48676 this.figures, 48677 this.bounds, 48678 this.matrix, 48679 this.bbox, 48680 this.background 48681 ]; 48682 } 48683 }; 48684 return Mesh; 48685}(); 48686Shadings.Dummy = function DummyClosure() { 48687 function Dummy() { 48688 this.type = 'Pattern'; 48689 } 48690 Dummy.prototype = { 48691 getIR: function Dummy_getIR() { 48692 return ['Dummy']; 48693 } 48694 }; 48695 return Dummy; 48696}(); 48697function getTilingPatternIR(operatorList, dict, args) { 48698 var matrix = dict.getArray('Matrix'); 48699 var bbox = dict.getArray('BBox'); 48700 var xstep = dict.get('XStep'); 48701 var ystep = dict.get('YStep'); 48702 var paintType = dict.get('PaintType'); 48703 var tilingType = dict.get('TilingType'); 48704 return [ 48705 'TilingPattern', 48706 args, 48707 operatorList, 48708 matrix, 48709 bbox, 48710 xstep, 48711 ystep, 48712 paintType, 48713 tilingType 48714 ]; 48715} 48716exports.Pattern = Pattern; 48717exports.getTilingPatternIR = getTilingPatternIR; 48718 48719/***/ }), 48720/* 33 */ 48721/***/ (function(module, exports, __w_pdfjs_require__) { 48722 48723"use strict"; 48724 48725var sharedUtil = __w_pdfjs_require__(0); 48726var coreStream = __w_pdfjs_require__(2); 48727var coreChunkedStream = __w_pdfjs_require__(12); 48728var coreDocument = __w_pdfjs_require__(24); 48729var warn = sharedUtil.warn; 48730var createValidAbsoluteUrl = sharedUtil.createValidAbsoluteUrl; 48731var shadow = sharedUtil.shadow; 48732var NotImplementedException = sharedUtil.NotImplementedException; 48733var MissingDataException = sharedUtil.MissingDataException; 48734var createPromiseCapability = sharedUtil.createPromiseCapability; 48735var Util = sharedUtil.Util; 48736var Stream = coreStream.Stream; 48737var ChunkedStreamManager = coreChunkedStream.ChunkedStreamManager; 48738var PDFDocument = coreDocument.PDFDocument; 48739var BasePdfManager = function BasePdfManagerClosure() { 48740 function BasePdfManager() { 48741 throw new Error('Cannot initialize BaseManagerManager'); 48742 } 48743 BasePdfManager.prototype = { 48744 get docId() { 48745 return this._docId; 48746 }, 48747 get password() { 48748 return this._password; 48749 }, 48750 get docBaseUrl() { 48751 var docBaseUrl = null; 48752 if (this._docBaseUrl) { 48753 var absoluteUrl = createValidAbsoluteUrl(this._docBaseUrl); 48754 if (absoluteUrl) { 48755 docBaseUrl = absoluteUrl.href; 48756 } else { 48757 warn('Invalid absolute docBaseUrl: "' + this._docBaseUrl + '".'); 48758 } 48759 } 48760 return shadow(this, 'docBaseUrl', docBaseUrl); 48761 }, 48762 onLoadedStream: function BasePdfManager_onLoadedStream() { 48763 throw new NotImplementedException(); 48764 }, 48765 ensureDoc: function BasePdfManager_ensureDoc(prop, args) { 48766 return this.ensure(this.pdfDocument, prop, args); 48767 }, 48768 ensureXRef: function BasePdfManager_ensureXRef(prop, args) { 48769 return this.ensure(this.pdfDocument.xref, prop, args); 48770 }, 48771 ensureCatalog: function BasePdfManager_ensureCatalog(prop, args) { 48772 return this.ensure(this.pdfDocument.catalog, prop, args); 48773 }, 48774 getPage: function BasePdfManager_getPage(pageIndex) { 48775 return this.pdfDocument.getPage(pageIndex); 48776 }, 48777 cleanup: function BasePdfManager_cleanup() { 48778 return this.pdfDocument.cleanup(); 48779 }, 48780 ensure: function BasePdfManager_ensure(obj, prop, args) { 48781 return new NotImplementedException(); 48782 }, 48783 requestRange: function BasePdfManager_requestRange(begin, end) { 48784 return new NotImplementedException(); 48785 }, 48786 requestLoadedStream: function BasePdfManager_requestLoadedStream() { 48787 return new NotImplementedException(); 48788 }, 48789 sendProgressiveData: function BasePdfManager_sendProgressiveData(chunk) { 48790 return new NotImplementedException(); 48791 }, 48792 updatePassword: function BasePdfManager_updatePassword(password) { 48793 this._password = password; 48794 }, 48795 terminate: function BasePdfManager_terminate() { 48796 return new NotImplementedException(); 48797 } 48798 }; 48799 return BasePdfManager; 48800}(); 48801var LocalPdfManager = function LocalPdfManagerClosure() { 48802 function LocalPdfManager(docId, data, password, evaluatorOptions, docBaseUrl) { 48803 this._docId = docId; 48804 this._password = password; 48805 this._docBaseUrl = docBaseUrl; 48806 this.evaluatorOptions = evaluatorOptions; 48807 var stream = new Stream(data); 48808 this.pdfDocument = new PDFDocument(this, stream); 48809 this._loadedStreamCapability = createPromiseCapability(); 48810 this._loadedStreamCapability.resolve(stream); 48811 } 48812 Util.inherit(LocalPdfManager, BasePdfManager, { 48813 ensure: function LocalPdfManager_ensure(obj, prop, args) { 48814 return new Promise(function (resolve, reject) { 48815 try { 48816 var value = obj[prop]; 48817 var result; 48818 if (typeof value === 'function') { 48819 result = value.apply(obj, args); 48820 } else { 48821 result = value; 48822 } 48823 resolve(result); 48824 } catch (e) { 48825 reject(e); 48826 } 48827 }); 48828 }, 48829 requestRange: function LocalPdfManager_requestRange(begin, end) { 48830 return Promise.resolve(); 48831 }, 48832 requestLoadedStream: function LocalPdfManager_requestLoadedStream() { 48833 }, 48834 onLoadedStream: function LocalPdfManager_onLoadedStream() { 48835 return this._loadedStreamCapability.promise; 48836 }, 48837 terminate: function LocalPdfManager_terminate() { 48838 } 48839 }); 48840 return LocalPdfManager; 48841}(); 48842var NetworkPdfManager = function NetworkPdfManagerClosure() { 48843 function NetworkPdfManager(docId, pdfNetworkStream, args, evaluatorOptions, docBaseUrl) { 48844 this._docId = docId; 48845 this._password = args.password; 48846 this._docBaseUrl = docBaseUrl; 48847 this.msgHandler = args.msgHandler; 48848 this.evaluatorOptions = evaluatorOptions; 48849 var params = { 48850 msgHandler: args.msgHandler, 48851 url: args.url, 48852 length: args.length, 48853 disableAutoFetch: args.disableAutoFetch, 48854 rangeChunkSize: args.rangeChunkSize 48855 }; 48856 this.streamManager = new ChunkedStreamManager(pdfNetworkStream, params); 48857 this.pdfDocument = new PDFDocument(this, this.streamManager.getStream()); 48858 } 48859 Util.inherit(NetworkPdfManager, BasePdfManager, { 48860 ensure: function NetworkPdfManager_ensure(obj, prop, args) { 48861 var pdfManager = this; 48862 return new Promise(function (resolve, reject) { 48863 function ensureHelper() { 48864 try { 48865 var result; 48866 var value = obj[prop]; 48867 if (typeof value === 'function') { 48868 result = value.apply(obj, args); 48869 } else { 48870 result = value; 48871 } 48872 resolve(result); 48873 } catch (e) { 48874 if (!(e instanceof MissingDataException)) { 48875 reject(e); 48876 return; 48877 } 48878 pdfManager.streamManager.requestRange(e.begin, e.end).then(ensureHelper, reject); 48879 } 48880 } 48881 ensureHelper(); 48882 }); 48883 }, 48884 requestRange: function NetworkPdfManager_requestRange(begin, end) { 48885 return this.streamManager.requestRange(begin, end); 48886 }, 48887 requestLoadedStream: function NetworkPdfManager_requestLoadedStream() { 48888 this.streamManager.requestAllChunks(); 48889 }, 48890 sendProgressiveData: function NetworkPdfManager_sendProgressiveData(chunk) { 48891 this.streamManager.onReceiveData({ chunk: chunk }); 48892 }, 48893 onLoadedStream: function NetworkPdfManager_onLoadedStream() { 48894 return this.streamManager.onLoadedStream(); 48895 }, 48896 terminate: function NetworkPdfManager_terminate() { 48897 this.streamManager.abort(); 48898 } 48899 }); 48900 return NetworkPdfManager; 48901}(); 48902exports.LocalPdfManager = LocalPdfManager; 48903exports.NetworkPdfManager = NetworkPdfManager; 48904 48905/***/ }), 48906/* 34 */ 48907/***/ (function(module, exports, __w_pdfjs_require__) { 48908 48909"use strict"; 48910 48911var sharedUtil = __w_pdfjs_require__(0); 48912var corePrimitives = __w_pdfjs_require__(1); 48913var error = sharedUtil.error; 48914var isSpace = sharedUtil.isSpace; 48915var EOF = corePrimitives.EOF; 48916var PostScriptParser = function PostScriptParserClosure() { 48917 function PostScriptParser(lexer) { 48918 this.lexer = lexer; 48919 this.operators = []; 48920 this.token = null; 48921 this.prev = null; 48922 } 48923 PostScriptParser.prototype = { 48924 nextToken: function PostScriptParser_nextToken() { 48925 this.prev = this.token; 48926 this.token = this.lexer.getToken(); 48927 }, 48928 accept: function PostScriptParser_accept(type) { 48929 if (this.token.type === type) { 48930 this.nextToken(); 48931 return true; 48932 } 48933 return false; 48934 }, 48935 expect: function PostScriptParser_expect(type) { 48936 if (this.accept(type)) { 48937 return true; 48938 } 48939 error('Unexpected symbol: found ' + this.token.type + ' expected ' + type + '.'); 48940 }, 48941 parse: function PostScriptParser_parse() { 48942 this.nextToken(); 48943 this.expect(PostScriptTokenTypes.LBRACE); 48944 this.parseBlock(); 48945 this.expect(PostScriptTokenTypes.RBRACE); 48946 return this.operators; 48947 }, 48948 parseBlock: function PostScriptParser_parseBlock() { 48949 while (true) { 48950 if (this.accept(PostScriptTokenTypes.NUMBER)) { 48951 this.operators.push(this.prev.value); 48952 } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { 48953 this.operators.push(this.prev.value); 48954 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 48955 this.parseCondition(); 48956 } else { 48957 return; 48958 } 48959 } 48960 }, 48961 parseCondition: function PostScriptParser_parseCondition() { 48962 var conditionLocation = this.operators.length; 48963 this.operators.push(null, null); 48964 this.parseBlock(); 48965 this.expect(PostScriptTokenTypes.RBRACE); 48966 if (this.accept(PostScriptTokenTypes.IF)) { 48967 this.operators[conditionLocation] = this.operators.length; 48968 this.operators[conditionLocation + 1] = 'jz'; 48969 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 48970 var jumpLocation = this.operators.length; 48971 this.operators.push(null, null); 48972 var endOfTrue = this.operators.length; 48973 this.parseBlock(); 48974 this.expect(PostScriptTokenTypes.RBRACE); 48975 this.expect(PostScriptTokenTypes.IFELSE); 48976 this.operators[jumpLocation] = this.operators.length; 48977 this.operators[jumpLocation + 1] = 'j'; 48978 this.operators[conditionLocation] = endOfTrue; 48979 this.operators[conditionLocation + 1] = 'jz'; 48980 } else { 48981 error('PS Function: error parsing conditional.'); 48982 } 48983 } 48984 }; 48985 return PostScriptParser; 48986}(); 48987var PostScriptTokenTypes = { 48988 LBRACE: 0, 48989 RBRACE: 1, 48990 NUMBER: 2, 48991 OPERATOR: 3, 48992 IF: 4, 48993 IFELSE: 5 48994}; 48995var PostScriptToken = function PostScriptTokenClosure() { 48996 function PostScriptToken(type, value) { 48997 this.type = type; 48998 this.value = value; 48999 } 49000 var opCache = Object.create(null); 49001 PostScriptToken.getOperator = function PostScriptToken_getOperator(op) { 49002 var opValue = opCache[op]; 49003 if (opValue) { 49004 return opValue; 49005 } 49006 return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); 49007 }; 49008 PostScriptToken.LBRACE = new PostScriptToken(PostScriptTokenTypes.LBRACE, '{'); 49009 PostScriptToken.RBRACE = new PostScriptToken(PostScriptTokenTypes.RBRACE, '}'); 49010 PostScriptToken.IF = new PostScriptToken(PostScriptTokenTypes.IF, 'IF'); 49011 PostScriptToken.IFELSE = new PostScriptToken(PostScriptTokenTypes.IFELSE, 'IFELSE'); 49012 return PostScriptToken; 49013}(); 49014var PostScriptLexer = function PostScriptLexerClosure() { 49015 function PostScriptLexer(stream) { 49016 this.stream = stream; 49017 this.nextChar(); 49018 this.strBuf = []; 49019 } 49020 PostScriptLexer.prototype = { 49021 nextChar: function PostScriptLexer_nextChar() { 49022 return this.currentChar = this.stream.getByte(); 49023 }, 49024 getToken: function PostScriptLexer_getToken() { 49025 var comment = false; 49026 var ch = this.currentChar; 49027 while (true) { 49028 if (ch < 0) { 49029 return EOF; 49030 } 49031 if (comment) { 49032 if (ch === 0x0A || ch === 0x0D) { 49033 comment = false; 49034 } 49035 } else if (ch === 0x25) { 49036 comment = true; 49037 } else if (!isSpace(ch)) { 49038 break; 49039 } 49040 ch = this.nextChar(); 49041 } 49042 switch (ch | 0) { 49043 case 0x30: 49044 case 0x31: 49045 case 0x32: 49046 case 0x33: 49047 case 0x34: 49048 case 0x35: 49049 case 0x36: 49050 case 0x37: 49051 case 0x38: 49052 case 0x39: 49053 case 0x2B: 49054 case 0x2D: 49055 case 0x2E: 49056 return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); 49057 case 0x7B: 49058 this.nextChar(); 49059 return PostScriptToken.LBRACE; 49060 case 0x7D: 49061 this.nextChar(); 49062 return PostScriptToken.RBRACE; 49063 } 49064 var strBuf = this.strBuf; 49065 strBuf.length = 0; 49066 strBuf[0] = String.fromCharCode(ch); 49067 while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5A || ch >= 0x61 && ch <= 0x7A)) { 49068 strBuf.push(String.fromCharCode(ch)); 49069 } 49070 var str = strBuf.join(''); 49071 switch (str.toLowerCase()) { 49072 case 'if': 49073 return PostScriptToken.IF; 49074 case 'ifelse': 49075 return PostScriptToken.IFELSE; 49076 default: 49077 return PostScriptToken.getOperator(str); 49078 } 49079 }, 49080 getNumber: function PostScriptLexer_getNumber() { 49081 var ch = this.currentChar; 49082 var strBuf = this.strBuf; 49083 strBuf.length = 0; 49084 strBuf[0] = String.fromCharCode(ch); 49085 while ((ch = this.nextChar()) >= 0) { 49086 if (ch >= 0x30 && ch <= 0x39 || ch === 0x2D || ch === 0x2E) { 49087 strBuf.push(String.fromCharCode(ch)); 49088 } else { 49089 break; 49090 } 49091 } 49092 var value = parseFloat(strBuf.join('')); 49093 if (isNaN(value)) { 49094 error('Invalid floating point number: ' + value); 49095 } 49096 return value; 49097 } 49098 }; 49099 return PostScriptLexer; 49100}(); 49101exports.PostScriptLexer = PostScriptLexer; 49102exports.PostScriptParser = PostScriptParser; 49103 49104/***/ }), 49105/* 35 */ 49106/***/ (function(module, exports, __w_pdfjs_require__) { 49107 49108"use strict"; 49109 49110var sharedUtil = __w_pdfjs_require__(0); 49111var coreStream = __w_pdfjs_require__(2); 49112var coreEncodings = __w_pdfjs_require__(4); 49113var warn = sharedUtil.warn; 49114var isSpace = sharedUtil.isSpace; 49115var Stream = coreStream.Stream; 49116var getEncoding = coreEncodings.getEncoding; 49117var HINTING_ENABLED = false; 49118var Type1CharString = function Type1CharStringClosure() { 49119 var COMMAND_MAP = { 49120 'hstem': [1], 49121 'vstem': [3], 49122 'vmoveto': [4], 49123 'rlineto': [5], 49124 'hlineto': [6], 49125 'vlineto': [7], 49126 'rrcurveto': [8], 49127 'callsubr': [10], 49128 'flex': [ 49129 12, 49130 35 49131 ], 49132 'drop': [ 49133 12, 49134 18 49135 ], 49136 'endchar': [14], 49137 'rmoveto': [21], 49138 'hmoveto': [22], 49139 'vhcurveto': [30], 49140 'hvcurveto': [31] 49141 }; 49142 function Type1CharString() { 49143 this.width = 0; 49144 this.lsb = 0; 49145 this.flexing = false; 49146 this.output = []; 49147 this.stack = []; 49148 } 49149 Type1CharString.prototype = { 49150 convert: function Type1CharString_convert(encoded, subrs, seacAnalysisEnabled) { 49151 var count = encoded.length; 49152 var error = false; 49153 var wx, sbx, subrNumber; 49154 for (var i = 0; i < count; i++) { 49155 var value = encoded[i]; 49156 if (value < 32) { 49157 if (value === 12) { 49158 value = (value << 8) + encoded[++i]; 49159 } 49160 switch (value) { 49161 case 1: 49162 if (!HINTING_ENABLED) { 49163 this.stack = []; 49164 break; 49165 } 49166 error = this.executeCommand(2, COMMAND_MAP.hstem); 49167 break; 49168 case 3: 49169 if (!HINTING_ENABLED) { 49170 this.stack = []; 49171 break; 49172 } 49173 error = this.executeCommand(2, COMMAND_MAP.vstem); 49174 break; 49175 case 4: 49176 if (this.flexing) { 49177 if (this.stack.length < 1) { 49178 error = true; 49179 break; 49180 } 49181 var dy = this.stack.pop(); 49182 this.stack.push(0, dy); 49183 break; 49184 } 49185 error = this.executeCommand(1, COMMAND_MAP.vmoveto); 49186 break; 49187 case 5: 49188 error = this.executeCommand(2, COMMAND_MAP.rlineto); 49189 break; 49190 case 6: 49191 error = this.executeCommand(1, COMMAND_MAP.hlineto); 49192 break; 49193 case 7: 49194 error = this.executeCommand(1, COMMAND_MAP.vlineto); 49195 break; 49196 case 8: 49197 error = this.executeCommand(6, COMMAND_MAP.rrcurveto); 49198 break; 49199 case 9: 49200 this.stack = []; 49201 break; 49202 case 10: 49203 if (this.stack.length < 1) { 49204 error = true; 49205 break; 49206 } 49207 subrNumber = this.stack.pop(); 49208 error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); 49209 break; 49210 case 11: 49211 return error; 49212 case 13: 49213 if (this.stack.length < 2) { 49214 error = true; 49215 break; 49216 } 49217 wx = this.stack.pop(); 49218 sbx = this.stack.pop(); 49219 this.lsb = sbx; 49220 this.width = wx; 49221 this.stack.push(wx, sbx); 49222 error = this.executeCommand(2, COMMAND_MAP.hmoveto); 49223 break; 49224 case 14: 49225 this.output.push(COMMAND_MAP.endchar[0]); 49226 break; 49227 case 21: 49228 if (this.flexing) { 49229 break; 49230 } 49231 error = this.executeCommand(2, COMMAND_MAP.rmoveto); 49232 break; 49233 case 22: 49234 if (this.flexing) { 49235 this.stack.push(0); 49236 break; 49237 } 49238 error = this.executeCommand(1, COMMAND_MAP.hmoveto); 49239 break; 49240 case 30: 49241 error = this.executeCommand(4, COMMAND_MAP.vhcurveto); 49242 break; 49243 case 31: 49244 error = this.executeCommand(4, COMMAND_MAP.hvcurveto); 49245 break; 49246 case (12 << 8) + 0: 49247 this.stack = []; 49248 break; 49249 case (12 << 8) + 1: 49250 if (!HINTING_ENABLED) { 49251 this.stack = []; 49252 break; 49253 } 49254 error = this.executeCommand(2, COMMAND_MAP.vstem); 49255 break; 49256 case (12 << 8) + 2: 49257 if (!HINTING_ENABLED) { 49258 this.stack = []; 49259 break; 49260 } 49261 error = this.executeCommand(2, COMMAND_MAP.hstem); 49262 break; 49263 case (12 << 8) + 6: 49264 if (seacAnalysisEnabled) { 49265 this.seac = this.stack.splice(-4, 4); 49266 error = this.executeCommand(0, COMMAND_MAP.endchar); 49267 } else { 49268 error = this.executeCommand(4, COMMAND_MAP.endchar); 49269 } 49270 break; 49271 case (12 << 8) + 7: 49272 if (this.stack.length < 4) { 49273 error = true; 49274 break; 49275 } 49276 this.stack.pop(); 49277 wx = this.stack.pop(); 49278 var sby = this.stack.pop(); 49279 sbx = this.stack.pop(); 49280 this.lsb = sbx; 49281 this.width = wx; 49282 this.stack.push(wx, sbx, sby); 49283 error = this.executeCommand(3, COMMAND_MAP.rmoveto); 49284 break; 49285 case (12 << 8) + 12: 49286 if (this.stack.length < 2) { 49287 error = true; 49288 break; 49289 } 49290 var num2 = this.stack.pop(); 49291 var num1 = this.stack.pop(); 49292 this.stack.push(num1 / num2); 49293 break; 49294 case (12 << 8) + 16: 49295 if (this.stack.length < 2) { 49296 error = true; 49297 break; 49298 } 49299 subrNumber = this.stack.pop(); 49300 var numArgs = this.stack.pop(); 49301 if (subrNumber === 0 && numArgs === 3) { 49302 var flexArgs = this.stack.splice(this.stack.length - 17, 17); 49303 this.stack.push(flexArgs[2] + flexArgs[0], flexArgs[3] + flexArgs[1], flexArgs[4], flexArgs[5], flexArgs[6], flexArgs[7], flexArgs[8], flexArgs[9], flexArgs[10], flexArgs[11], flexArgs[12], flexArgs[13], flexArgs[14]); 49304 error = this.executeCommand(13, COMMAND_MAP.flex, true); 49305 this.flexing = false; 49306 this.stack.push(flexArgs[15], flexArgs[16]); 49307 } else if (subrNumber === 1 && numArgs === 0) { 49308 this.flexing = true; 49309 } 49310 break; 49311 case (12 << 8) + 17: 49312 break; 49313 case (12 << 8) + 33: 49314 this.stack = []; 49315 break; 49316 default: 49317 warn('Unknown type 1 charstring command of "' + value + '"'); 49318 break; 49319 } 49320 if (error) { 49321 break; 49322 } 49323 continue; 49324 } else if (value <= 246) { 49325 value = value - 139; 49326 } else if (value <= 250) { 49327 value = (value - 247) * 256 + encoded[++i] + 108; 49328 } else if (value <= 254) { 49329 value = -((value - 251) * 256) - encoded[++i] - 108; 49330 } else { 49331 value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; 49332 } 49333 this.stack.push(value); 49334 } 49335 return error; 49336 }, 49337 executeCommand: function (howManyArgs, command, keepStack) { 49338 var stackLength = this.stack.length; 49339 if (howManyArgs > stackLength) { 49340 return true; 49341 } 49342 var start = stackLength - howManyArgs; 49343 for (var i = start; i < stackLength; i++) { 49344 var value = this.stack[i]; 49345 if (value === (value | 0)) { 49346 this.output.push(28, value >> 8 & 0xff, value & 0xff); 49347 } else { 49348 value = 65536 * value | 0; 49349 this.output.push(255, value >> 24 & 0xFF, value >> 16 & 0xFF, value >> 8 & 0xFF, value & 0xFF); 49350 } 49351 } 49352 this.output.push.apply(this.output, command); 49353 if (keepStack) { 49354 this.stack.splice(start, howManyArgs); 49355 } else { 49356 this.stack.length = 0; 49357 } 49358 return false; 49359 } 49360 }; 49361 return Type1CharString; 49362}(); 49363var Type1Parser = function Type1ParserClosure() { 49364 var EEXEC_ENCRYPT_KEY = 55665; 49365 var CHAR_STRS_ENCRYPT_KEY = 4330; 49366 function isHexDigit(code) { 49367 return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102; 49368 } 49369 function decrypt(data, key, discardNumber) { 49370 if (discardNumber >= data.length) { 49371 return new Uint8Array(0); 49372 } 49373 var r = key | 0, c1 = 52845, c2 = 22719, i, j; 49374 for (i = 0; i < discardNumber; i++) { 49375 r = (data[i] + r) * c1 + c2 & (1 << 16) - 1; 49376 } 49377 var count = data.length - discardNumber; 49378 var decrypted = new Uint8Array(count); 49379 for (i = discardNumber, j = 0; j < count; i++, j++) { 49380 var value = data[i]; 49381 decrypted[j] = value ^ r >> 8; 49382 r = (value + r) * c1 + c2 & (1 << 16) - 1; 49383 } 49384 return decrypted; 49385 } 49386 function decryptAscii(data, key, discardNumber) { 49387 var r = key | 0, c1 = 52845, c2 = 22719; 49388 var count = data.length, maybeLength = count >>> 1; 49389 var decrypted = new Uint8Array(maybeLength); 49390 var i, j; 49391 for (i = 0, j = 0; i < count; i++) { 49392 var digit1 = data[i]; 49393 if (!isHexDigit(digit1)) { 49394 continue; 49395 } 49396 i++; 49397 var digit2; 49398 while (i < count && !isHexDigit(digit2 = data[i])) { 49399 i++; 49400 } 49401 if (i < count) { 49402 var value = parseInt(String.fromCharCode(digit1, digit2), 16); 49403 decrypted[j++] = value ^ r >> 8; 49404 r = (value + r) * c1 + c2 & (1 << 16) - 1; 49405 } 49406 } 49407 return Array.prototype.slice.call(decrypted, discardNumber, j); 49408 } 49409 function isSpecial(c) { 49410 return c === 0x2F || c === 0x5B || c === 0x5D || c === 0x7B || c === 0x7D || c === 0x28 || c === 0x29; 49411 } 49412 function Type1Parser(stream, encrypted, seacAnalysisEnabled) { 49413 if (encrypted) { 49414 var data = stream.getBytes(); 49415 var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3])); 49416 stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); 49417 } 49418 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 49419 this.stream = stream; 49420 this.nextChar(); 49421 } 49422 Type1Parser.prototype = { 49423 readNumberArray: function Type1Parser_readNumberArray() { 49424 this.getToken(); 49425 var array = []; 49426 while (true) { 49427 var token = this.getToken(); 49428 if (token === null || token === ']' || token === '}') { 49429 break; 49430 } 49431 array.push(parseFloat(token || 0)); 49432 } 49433 return array; 49434 }, 49435 readNumber: function Type1Parser_readNumber() { 49436 var token = this.getToken(); 49437 return parseFloat(token || 0); 49438 }, 49439 readInt: function Type1Parser_readInt() { 49440 var token = this.getToken(); 49441 return parseInt(token || 0, 10) | 0; 49442 }, 49443 readBoolean: function Type1Parser_readBoolean() { 49444 var token = this.getToken(); 49445 return token === 'true' ? 1 : 0; 49446 }, 49447 nextChar: function Type1_nextChar() { 49448 return this.currentChar = this.stream.getByte(); 49449 }, 49450 getToken: function Type1Parser_getToken() { 49451 var comment = false; 49452 var ch = this.currentChar; 49453 while (true) { 49454 if (ch === -1) { 49455 return null; 49456 } 49457 if (comment) { 49458 if (ch === 0x0A || ch === 0x0D) { 49459 comment = false; 49460 } 49461 } else if (ch === 0x25) { 49462 comment = true; 49463 } else if (!isSpace(ch)) { 49464 break; 49465 } 49466 ch = this.nextChar(); 49467 } 49468 if (isSpecial(ch)) { 49469 this.nextChar(); 49470 return String.fromCharCode(ch); 49471 } 49472 var token = ''; 49473 do { 49474 token += String.fromCharCode(ch); 49475 ch = this.nextChar(); 49476 } while (ch >= 0 && !isSpace(ch) && !isSpecial(ch)); 49477 return token; 49478 }, 49479 extractFontProgram: function Type1Parser_extractFontProgram() { 49480 var stream = this.stream; 49481 var subrs = [], charstrings = []; 49482 var privateData = Object.create(null); 49483 privateData['lenIV'] = 4; 49484 var program = { 49485 subrs: [], 49486 charstrings: [], 49487 properties: { 'privateData': privateData } 49488 }; 49489 var token, length, data, lenIV, encoded; 49490 while ((token = this.getToken()) !== null) { 49491 if (token !== '/') { 49492 continue; 49493 } 49494 token = this.getToken(); 49495 switch (token) { 49496 case 'CharStrings': 49497 this.getToken(); 49498 this.getToken(); 49499 this.getToken(); 49500 this.getToken(); 49501 while (true) { 49502 token = this.getToken(); 49503 if (token === null || token === 'end') { 49504 break; 49505 } 49506 if (token !== '/') { 49507 continue; 49508 } 49509 var glyph = this.getToken(); 49510 length = this.readInt(); 49511 this.getToken(); 49512 data = stream.makeSubStream(stream.pos, length); 49513 lenIV = program.properties.privateData['lenIV']; 49514 encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); 49515 stream.skip(length); 49516 this.nextChar(); 49517 token = this.getToken(); 49518 if (token === 'noaccess') { 49519 this.getToken(); 49520 } 49521 charstrings.push({ 49522 glyph: glyph, 49523 encoded: encoded 49524 }); 49525 } 49526 break; 49527 case 'Subrs': 49528 this.readInt(); 49529 this.getToken(); 49530 while ((token = this.getToken()) === 'dup') { 49531 var index = this.readInt(); 49532 length = this.readInt(); 49533 this.getToken(); 49534 data = stream.makeSubStream(stream.pos, length); 49535 lenIV = program.properties.privateData['lenIV']; 49536 encoded = decrypt(data.getBytes(), CHAR_STRS_ENCRYPT_KEY, lenIV); 49537 stream.skip(length); 49538 this.nextChar(); 49539 token = this.getToken(); 49540 if (token === 'noaccess') { 49541 this.getToken(); 49542 } 49543 subrs[index] = encoded; 49544 } 49545 break; 49546 case 'BlueValues': 49547 case 'OtherBlues': 49548 case 'FamilyBlues': 49549 case 'FamilyOtherBlues': 49550 var blueArray = this.readNumberArray(); 49551 if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) { 49552 program.properties.privateData[token] = blueArray; 49553 } 49554 break; 49555 case 'StemSnapH': 49556 case 'StemSnapV': 49557 program.properties.privateData[token] = this.readNumberArray(); 49558 break; 49559 case 'StdHW': 49560 case 'StdVW': 49561 program.properties.privateData[token] = this.readNumberArray()[0]; 49562 break;
49563 case 'BlueShift': 49564 case 'lenIV': 49565 case 'BlueFuzz': 49566 case 'BlueScale': 49567 case 'LanguageGroup': 49568 case 'ExpansionFactor': 49569 program.properties.privateData[token] = this.readNumber(); 49570 break; 49571 case 'ForceBold': 49572 program.properties.privateData[token] = this.readBoolean(); 49573 break; 49574 } 49575 } 49576 for (var i = 0; i < charstrings.length; i++) { 49577 glyph = charstrings[i].glyph; 49578 encoded = charstrings[i].encoded; 49579 var charString = new Type1CharString(); 49580 var error = charString.convert(encoded, subrs, this.seacAnalysisEnabled); 49581 var output = charString.output; 49582 if (error) { 49583 output = [14]; 49584 } 49585 program.charstrings.push({ 49586 glyphName: glyph, 49587 charstring: output, 49588 width: charString.width, 49589 lsb: charString.lsb, 49590 seac: charString.seac 49591 }); 49592 } 49593 return program; 49594 }, 49595 extractFontHeader: function Type1Parser_extractFontHeader(properties) { 49596 var token; 49597 while ((token = this.getToken()) !== null) { 49598 if (token !== '/') { 49599 continue; 49600 } 49601 token = this.getToken(); 49602 switch (token) { 49603 case 'FontMatrix': 49604 var matrix = this.readNumberArray(); 49605 properties.fontMatrix = matrix; 49606 break; 49607 case 'Encoding': 49608 var encodingArg = this.getToken(); 49609 var encoding; 49610 if (!/^\d+$/.test(encodingArg)) { 49611 encoding = getEncoding(encodingArg); 49612 } else { 49613 encoding = []; 49614 var size = parseInt(encodingArg, 10) | 0; 49615 this.getToken(); 49616 for (var j = 0; j < size; j++) { 49617 token = this.getToken(); 49618 while (token !== 'dup' && token !== 'def') { 49619 token = this.getToken(); 49620 if (token === null) { 49621 return; 49622 } 49623 } 49624 if (token === 'def') { 49625 break; 49626 } 49627 var index = this.readInt(); 49628 this.getToken(); 49629 var glyph = this.getToken(); 49630 encoding[index] = glyph; 49631 this.getToken(); 49632 } 49633 } 49634 properties.builtInEncoding = encoding; 49635 break; 49636 case 'FontBBox': 49637 var fontBBox = this.readNumberArray(); 49638 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 49639 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 49640 properties.ascentScaled = true; 49641 break; 49642 } 49643 } 49644 } 49645 }; 49646 return Type1Parser; 49647}(); 49648exports.Type1Parser = Type1Parser; 49649 49650/***/ }), 49651/* 36 */ 49652/***/ (function(module, exports, __w_pdfjs_require__) { 49653 49654"use strict"; 49655/* WEBPACK VAR INJECTION */(function(global) { 49656if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) { 49657 var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : this; 49658 var userAgent = typeof navigator !== 'undefined' && navigator.userAgent || ''; 49659 var isAndroid = /Android/.test(userAgent); 49660 var isAndroidPre3 = /Android\s[0-2][^\d]/.test(userAgent); 49661 var isAndroidPre5 = /Android\s[0-4][^\d]/.test(userAgent); 49662 var isChrome = userAgent.indexOf('Chrom') >= 0; 49663 var isChromeWithRangeBug = /Chrome\/(39|40)\./.test(userAgent); 49664 var isIOSChrome = userAgent.indexOf('CriOS') >= 0; 49665 var isIE = userAgent.indexOf('Trident') >= 0; 49666 var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent); 49667 var isOpera = userAgent.indexOf('Opera') >= 0; 49668 var isSafari = /Safari\//.test(userAgent) && !/(Chrome\/|Android\s)/.test(userAgent); 49669 var hasDOM = typeof window === 'object' && typeof document === 'object'; 49670 if (typeof PDFJS === 'undefined') { 49671 globalScope.PDFJS = {}; 49672 } 49673 PDFJS.compatibilityChecked = true; 49674 (function checkTypedArrayCompatibility() { 49675 if (typeof Uint8Array !== 'undefined') { 49676 if (typeof Uint8Array.prototype.subarray === 'undefined') { 49677 Uint8Array.prototype.subarray = function subarray(start, end) { 49678 return new Uint8Array(this.slice(start, end)); 49679 }; 49680 Float32Array.prototype.subarray = function subarray(start, end) { 49681 return new Float32Array(this.slice(start, end)); 49682 }; 49683 } 49684 if (typeof Float64Array === 'undefined') { 49685 globalScope.Float64Array = Float32Array; 49686 } 49687 return; 49688 } 49689 function subarray(start, end) { 49690 return new TypedArray(this.slice(start, end)); 49691 } 49692 function setArrayOffset(array, offset) {
vendor: 4,158 bytes, lines 49693-49844
49693 if (arguments.length < 2) { 49694 offset = 0; 49695 } 49696 for (var i = 0, n = array.length; i < n; ++i, ++offset) { 49697 this[offset] = array[i] & 0xFF; 49698 } 49699 } 49700 function TypedArray(arg1) { 49701 var result, i, n; 49702 if (typeof arg1 === 'number') { 49703 result = []; 49704 for (i = 0; i < arg1; ++i) { 49705 result[i] = 0; 49706 } 49707 } else if ('slice' in arg1) { 49708 result = arg1.slice(0); 49709 } else { 49710 result = []; 49711 for (i = 0, n = arg1.length; i < n; ++i) { 49712 result[i] = arg1[i]; 49713 } 49714 } 49715 result.subarray = subarray; 49716 result.buffer = result; 49717 result.byteLength = result.length; 49718 result.set = setArrayOffset; 49719 if (typeof arg1 === 'object' && arg1.buffer) { 49720 result.buffer = arg1.buffer; 49721 } 49722 return result; 49723 } 49724 globalScope.Uint8Array = TypedArray; 49725 globalScope.Int8Array = TypedArray; 49726 globalScope.Uint32Array = TypedArray; 49727 globalScope.Int32Array = TypedArray; 49728 globalScope.Uint16Array = TypedArray; 49729 globalScope.Float32Array = TypedArray; 49730 globalScope.Float64Array = TypedArray; 49731 }()); 49732 (function normalizeURLObject() { 49733 if (!globalScope.URL) { 49734 globalScope.URL = globalScope.webkitURL; 49735 } 49736 }()); 49737 (function checkObjectDefinePropertyCompatibility() { 49738 if (typeof Object.defineProperty !== 'undefined') { 49739 var definePropertyPossible = true; 49740 try { 49741 if (hasDOM) { 49742 Object.defineProperty(new Image(), 'id', { value: 'test' }); 49743 } 49744 var Test = function Test() { 49745 }; 49746 Test.prototype = { 49747 get id() { 49748 } 49749 }; 49750 Object.defineProperty(new Test(), 'id', { 49751 value: '', 49752 configurable: true, 49753 enumerable: true, 49754 writable: false 49755 }); 49756 } catch (e) { 49757 definePropertyPossible = false; 49758 } 49759 if (definePropertyPossible) { 49760 return; 49761 } 49762 } 49763 Object.defineProperty = function objectDefineProperty(obj, name, def) { 49764 delete obj[name]; 49765 if ('get' in def) { 49766 obj.__defineGetter__(name, def['get']); 49767 } 49768 if ('set' in def) { 49769 obj.__defineSetter__(name, def['set']); 49770 } 49771 if ('value' in def) { 49772 obj.__defineSetter__(name, function objectDefinePropertySetter(value) { 49773 this.__defineGetter__(name, function objectDefinePropertyGetter() { 49774 return value; 49775 }); 49776 return value; 49777 }); 49778 obj[name] = def.value; 49779 } 49780 }; 49781 }()); 49782 (function checkXMLHttpRequestResponseCompatibility() { 49783 if (typeof XMLHttpRequest === 'undefined') { 49784 return; 49785 } 49786 var xhrPrototype = XMLHttpRequest.prototype; 49787 var xhr = new XMLHttpRequest(); 49788 if (!('overrideMimeType' in xhr)) { 49789 Object.defineProperty(xhrPrototype, 'overrideMimeType', { 49790 value: function xmlHttpRequestOverrideMimeType(mimeType) { 49791 } 49792 }); 49793 } 49794 if ('responseType' in xhr) { 49795 return; 49796 } 49797 Object.defineProperty(xhrPrototype, 'responseType', { 49798 get: function xmlHttpRequestGetResponseType() { 49799 return this._responseType || 'text'; 49800 }, 49801 set: function xmlHttpRequestSetResponseType(value) { 49802 if (value === 'text' || value === 'arraybuffer') { 49803 this._responseType = value; 49804 if (value === 'arraybuffer' && typeof this.overrideMimeType === 'function') { 49805 this.overrideMimeType('text/plain; charset=x-user-defined'); 49806 } 49807 } 49808 } 49809 }); 49810 if (typeof VBArray !== 'undefined') { 49811 Object.defineProperty(xhrPrototype, 'response', { 49812 get: function xmlHttpRequestResponseGet() { 49813 if (this.responseType === 'arraybuffer') { 49814 return new Uint8Array(new VBArray(this.responseBody).toArray()); 49815 } 49816 return this.responseText; 49817 } 49818 }); 49819 return; 49820 } 49821 Object.defineProperty(xhrPrototype, 'response', { 49822 get: function xmlHttpRequestResponseGet() { 49823 if (this.responseType !== 'arraybuffer') { 49824 return this.responseText; 49825 } 49826 var text = this.responseText; 49827 var i, n = text.length; 49828 var result = new Uint8Array(n); 49829 for (i = 0; i < n; ++i) { 49830 result[i] = text.charCodeAt(i) & 0xFF; 49831 } 49832 return result.buffer; 49833 } 49834 }); 49835 }()); 49836 (function checkWindowBtoaCompatibility() { 49837 if ('btoa' in globalScope) { 49838 return; 49839 } 49840 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; 49841 globalScope.btoa = function (chars) { 49842 var buffer = ''; 49843 var i, n; 49844 for (i = 0, n = chars.length; i < n; i += 3) {
49845 var b1 = chars.charCodeAt(i) & 0xFF; 49846 var b2 = chars.charCodeAt(i + 1) & 0xFF; 49847 var b3 = chars.charCodeAt(i + 2) & 0xFF; 49848 var d1 = b1 >> 2, d2 = (b1 & 3) << 4 | b2 >> 4; 49849 var d3 = i + 1 < n ? (b2 & 0xF) << 2 | b3 >> 6 : 64; 49850 var d4 = i + 2 < n ? b3 & 0x3F : 64; 49851 buffer += digits.charAt(d1) + digits.charAt(d2) + digits.charAt(d3) + digits.charAt(d4); 49852 } 49853 return buffer; 49854 }; 49855 }()); 49856 (function checkWindowAtobCompatibility() { 49857 if ('atob' in globalScope) { 49858 return; 49859 } 49860 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; 49861 globalScope.atob = function (input) { 49862 input = input.replace(/=+$/, ''); 49863 if (input.length % 4 === 1) { 49864 throw new Error('bad atob input'); 49865 } 49866 for (var bc = 0, bs, buffer, idx = 0, output = ''; buffer = input.charAt(idx++); ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0) { 49867 buffer = digits.indexOf(buffer); 49868 } 49869 return output; 49870 }; 49871 }()); 49872 (function checkFunctionPrototypeBindCompatibility() { 49873 if (typeof Function.prototype.bind !== 'undefined') { 49874 return; 49875 } 49876 Function.prototype.bind = function functionPrototypeBind(obj) { 49877 var fn = this, headArgs = Array.prototype.slice.call(arguments, 1); 49878 var bound = function functionPrototypeBindBound() { 49879 var args = headArgs.concat(Array.prototype.slice.call(arguments)); 49880 return fn.apply(obj, args); 49881 }; 49882 return bound; 49883 }; 49884 }()); 49885 (function checkDatasetProperty() { 49886 if (!hasDOM) { 49887 return; 49888 } 49889 var div = document.createElement('div'); 49890 if ('dataset' in div) { 49891 return; 49892 } 49893 Object.defineProperty(HTMLElement.prototype, 'dataset', { 49894 get: function () { 49895 if (this._dataset) { 49896 return this._dataset; 49897 } 49898 var dataset = {}; 49899 for (var j = 0, jj = this.attributes.length; j < jj; j++) { 49900 var attribute = this.attributes[j]; 49901 if (attribute.name.substring(0, 5) !== 'data-') { 49902 continue; 49903 } 49904 var key = attribute.name.substring(5).replace(/\-([a-z])/g, function (all, ch) { 49905 return ch.toUpperCase(); 49906 }); 49907 dataset[key] = attribute.value; 49908 } 49909 Object.defineProperty(this, '_dataset', { 49910 value: dataset, 49911 writable: false, 49912 enumerable: false 49913 }); 49914 return dataset; 49915 }, 49916 enumerable: true 49917 }); 49918 }()); 49919 (function checkClassListProperty() { 49920 function changeList(element, itemName, add, remove) { 49921 var s = element.className || ''; 49922 var list = s.split(/\s+/g); 49923 if (list[0] === '') { 49924 list.shift(); 49925 } 49926 var index = list.indexOf(itemName); 49927 if (index < 0 && add) { 49928 list.push(itemName); 49929 } 49930 if (index >= 0 && remove) { 49931 list.splice(index, 1); 49932 } 49933 element.className = list.join(' '); 49934 return index >= 0; 49935 } 49936 if (!hasDOM) { 49937 return; 49938 } 49939 var div = document.createElement('div'); 49940 if ('classList' in div) { 49941 return; 49942 } 49943 var classListPrototype = { 49944 add: function (name) { 49945 changeList(this.element, name, true, false); 49946 }, 49947 contains: function (name) { 49948 return changeList(this.element, name, false, false); 49949 }, 49950 remove: function (name) { 49951 changeList(this.element, name, false, true); 49952 }, 49953 toggle: function (name) { 49954 changeList(this.element, name, true, true); 49955 } 49956 }; 49957 Object.defineProperty(HTMLElement.prototype, 'classList', { 49958 get: function () { 49959 if (this._classList) { 49960 return this._classList; 49961 } 49962 var classList = Object.create(classListPrototype, { 49963 element: { 49964 value: this, 49965 writable: false, 49966 enumerable: true 49967 } 49968 }); 49969 Object.defineProperty(this, '_classList', { 49970 value: classList, 49971 writable: false, 49972 enumerable: false 49973 }); 49974 return classList; 49975 }, 49976 enumerable: true 49977 }); 49978 }()); 49979 (function checkWorkerConsoleCompatibility() { 49980 if (typeof importScripts === 'undefined' || 'console' in globalScope) { 49981 return; 49982 } 49983 var consoleTimer = {}; 49984 var workerConsole = { 49985 log: function log() { 49986 var args = Array.prototype.slice.call(arguments); 49987 globalScope.postMessage({ 49988 targetName: 'main', 49989 action: 'console_log', 49990 data: args 49991 }); 49992 }, 49993 error: function error() { 49994 var args = Array.prototype.slice.call(arguments); 49995 globalScope.postMessage({ 49996 targetName: 'main', 49997 action: 'console_error', 49998 data: args 49999 }); 50000 }, 50001 time: function time(name) { 50002 consoleTimer[name] = Date.now(); 50003 }, 50004 timeEnd: function timeEnd(name) { 50005 var time = consoleTimer[name]; 50006 if (!time) { 50007 throw new Error('Unknown timer name ' + name); 50008 } 50009 this.log('Timer:', name, Date.now() - time); 50010 } 50011 }; 50012 globalScope.console = workerConsole; 50013 }()); 50014 (function checkConsoleCompatibility() { 50015 if (!hasDOM) { 50016 return; 50017 } 50018 if (!('console' in window)) { 50019 window.console = { 50020 log: function () { 50021 }, 50022 error: function () { 50023 }, 50024 warn: function () { 50025 } 50026 }; 50027 return; 50028 } 50029 if (!('bind' in console.log)) { 50030 console.log = function (fn) { 50031 return function (msg) { 50032 return fn(msg); 50033 }; 50034 }(console.log); 50035 console.error = function (fn) { 50036 return function (msg) { 50037 return fn(msg); 50038 }; 50039 }(console.error); 50040 console.warn = function (fn) { 50041 return function (msg) { 50042 return fn(msg); 50043 }; 50044 }(console.warn); 50045 return; 50046 } 50047 }()); 50048 (function checkOnClickCompatibility() { 50049 function ignoreIfTargetDisabled(event) { 50050 if (isDisabled(event.target)) { 50051 event.stopPropagation(); 50052 } 50053 } 50054 function isDisabled(node) { 50055 return node.disabled || node.parentNode && isDisabled(node.parentNode); 50056 } 50057 if (isOpera) { 50058 document.addEventListener('click', ignoreIfTargetDisabled, true); 50059 } 50060 }()); 50061 (function checkOnBlobSupport() { 50062 if (isIE || isIOSChrome) { 50063 PDFJS.disableCreateObjectURL = true; 50064 } 50065 }()); 50066 (function checkNavigatorLanguage() { 50067 if (typeof navigator === 'undefined') { 50068 return; 50069 } 50070 if ('language' in navigator) { 50071 return; 50072 } 50073 PDFJS.locale = navigator.userLanguage || 'en-US'; 50074 }()); 50075 (function checkRangeRequests() {
50076 if (isSafari || isAndroidPre3 || isChromeWithRangeBug || isIOS) { 50077 PDFJS.disableRange = true; 50078 PDFJS.disableStream = true; 50079 } 50080 }()); 50081 (function checkHistoryManipulation() { 50082 if (!hasDOM) { 50083 return; 50084 } 50085 if (!history.pushState || isAndroidPre3) { 50086 PDFJS.disableHistory = true; 50087 } 50088 }()); 50089 (function checkSetPresenceInImageData() { 50090 if (!hasDOM) { 50091 return; 50092 } 50093 if (window.CanvasPixelArray) { 50094 if (typeof window.CanvasPixelArray.prototype.set !== 'function') { 50095 window.CanvasPixelArray.prototype.set = function (arr) { 50096 for (var i = 0, ii = this.length; i < ii; i++) { 50097 this[i] = arr[i]; 50098 } 50099 }; 50100 } 50101 } else { 50102 var polyfill = false, versionMatch; 50103 if (isChrome) { 50104 versionMatch = userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); 50105 polyfill = versionMatch && parseInt(versionMatch[2]) < 21; 50106 } else if (isAndroid) { 50107 polyfill = isAndroidPre5; 50108 } else if (isSafari) { 50109 versionMatch = userAgent.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//); 50110 polyfill = versionMatch && parseInt(versionMatch[1]) < 6; 50111 } 50112 if (polyfill) { 50113 var contextPrototype = window.CanvasRenderingContext2D.prototype; 50114 var createImageData = contextPrototype.createImageData; 50115 contextPrototype.createImageData = function (w, h) { 50116 var imageData = createImageData.call(this, w, h); 50117 imageData.data.set = function (arr) { 50118 for (var i = 0, ii = this.length; i < ii; i++) { 50119 this[i] = arr[i]; 50120 } 50121 }; 50122 return imageData; 50123 }; 50124 contextPrototype = null; 50125 } 50126 } 50127 }()); 50128 (function checkRequestAnimationFrame() { 50129 function fakeRequestAnimationFrame(callback) { 50130 window.setTimeout(callback, 20); 50131 } 50132 if (!hasDOM) { 50133 return; 50134 } 50135 if (isIOS) { 50136 window.requestAnimationFrame = fakeRequestAnimationFrame; 50137 return; 50138 } 50139 if ('requestAnimationFrame' in window) { 50140 return; 50141 } 50142 window.requestAnimationFrame = window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || fakeRequestAnimationFrame; 50143 }()); 50144 (function checkCanvasSizeLimitation() { 50145 if (isIOS || isAndroid) { 50146 PDFJS.maxCanvasPixels = 5242880; 50147 } 50148 }()); 50149 (function checkFullscreenSupport() { 50150 if (!hasDOM) { 50151 return; 50152 } 50153 if (isIE && window.parent !== window) { 50154 PDFJS.disableFullscreen = true; 50155 } 50156 }()); 50157 (function checkCurrentScript() { 50158 if (!hasDOM) { 50159 return; 50160 } 50161 if ('currentScript' in document) { 50162 return; 50163 } 50164 Object.defineProperty(document, 'currentScript', { 50165 get: function () { 50166 var scripts = document.getElementsByTagName('script'); 50167 return scripts[scripts.length - 1]; 50168 }, 50169 enumerable: true, 50170 configurable: true 50171 }); 50172 }()); 50173 (function checkInputTypeNumberAssign() { 50174 if (!hasDOM) { 50175 return; 50176 } 50177 var el = document.createElement('input'); 50178 try { 50179 el.type = 'number'; 50180 } catch (ex) { 50181 var inputProto = el.constructor.prototype; 50182 var typeProperty = Object.getOwnPropertyDescriptor(inputProto, 'type'); 50183 Object.defineProperty(inputProto, 'type', { 50184 get: function () { 50185 return typeProperty.get.call(this); 50186 }, 50187 set: function (value) { 50188 typeProperty.set.call(this, value === 'number' ? 'text' : value); 50189 }, 50190 enumerable: true, 50191 configurable: true 50192 }); 50193 } 50194 }()); 50195 (function checkDocumentReadyState() { 50196 if (!hasDOM) { 50197 return; 50198 } 50199 if (!document.attachEvent) { 50200 return; 50201 } 50202 var documentProto = document.constructor.prototype; 50203 var readyStateProto = Object.getOwnPropertyDescriptor(documentProto, 'readyState'); 50204 Object.defineProperty(documentProto, 'readyState', { 50205 get: function () { 50206 var value = readyStateProto.get.call(this); 50207 return value === 'interactive' ? 'loading' : value; 50208 }, 50209 set: function (value) { 50210 readyStateProto.set.call(this, value); 50211 }, 50212 enumerable: true, 50213 configurable: true 50214 }); 50215 }()); 50216 (function checkChildNodeRemove() { 50217 if (!hasDOM) { 50218 return; 50219 } 50220 if (typeof Element.prototype.remove !== 'undefined') { 50221 return; 50222 } 50223 Element.prototype.remove = function () { 50224 if (this.parentNode) { 50225 this.parentNode.removeChild(this); 50226 } 50227 }; 50228 }()); 50229 (function checkPromise() { 50230 if (globalScope.Promise) { 50231 if (typeof globalScope.Promise.all !== 'function') { 50232 globalScope.Promise.all = function (iterable) { 50233 var count = 0, results = [], resolve, reject; 50234 var promise = new globalScope.Promise(function (resolve_, reject_) { 50235 resolve = resolve_; 50236 reject = reject_; 50237 }); 50238 iterable.forEach(function (p, i) { 50239 count++; 50240 p.then(function (result) { 50241 results[i] = result; 50242 count--; 50243 if (count === 0) { 50244 resolve(results); 50245 } 50246 }, reject); 50247 }); 50248 if (count === 0) { 50249 resolve(results); 50250 } 50251 return promise; 50252 }; 50253 } 50254 if (typeof globalScope.Promise.resolve !== 'function') { 50255 globalScope.Promise.resolve = function (value) { 50256 return new globalScope.Promise(function (resolve) { 50257 resolve(value); 50258 }); 50259 }; 50260 } 50261 if (typeof globalScope.Promise.reject !== 'function') { 50262 globalScope.Promise.reject = function (reason) { 50263 return new globalScope.Promise(function (resolve, reject) { 50264 reject(reason); 50265 }); 50266 }; 50267 } 50268 if (typeof globalScope.Promise.prototype.catch !== 'function') { 50269 globalScope.Promise.prototype.catch = function (onReject) { 50270 return globalScope.Promise.prototype.then(undefined, onReject); 50271 }; 50272 } 50273 return; 50274 } 50275 var STATUS_PENDING = 0; 50276 var STATUS_RESOLVED = 1; 50277 var STATUS_REJECTED = 2; 50278 var REJECTION_TIMEOUT = 500; 50279 var HandlerManager = { 50280 handlers: [], 50281 running: false, 50282 unhandledRejections: [],
vendor: 5,794 bytes, lines 50283-50479
50283 pendingRejectionCheck: false, 50284 scheduleHandlers: function scheduleHandlers(promise) { 50285 if (promise._status === STATUS_PENDING) { 50286 return; 50287 } 50288 this.handlers = this.handlers.concat(promise._handlers); 50289 promise._handlers = []; 50290 if (this.running) { 50291 return; 50292 } 50293 this.running = true; 50294 setTimeout(this.runHandlers.bind(this), 0); 50295 }, 50296 runHandlers: function runHandlers() { 50297 var RUN_TIMEOUT = 1; 50298 var timeoutAt = Date.now() + RUN_TIMEOUT; 50299 while (this.handlers.length > 0) { 50300 var handler = this.handlers.shift(); 50301 var nextStatus = handler.thisPromise._status; 50302 var nextValue = handler.thisPromise._value; 50303 try { 50304 if (nextStatus === STATUS_RESOLVED) { 50305 if (typeof handler.onResolve === 'function') { 50306 nextValue = handler.onResolve(nextValue); 50307 } 50308 } else if (typeof handler.onReject === 'function') { 50309 nextValue = handler.onReject(nextValue); 50310 nextStatus = STATUS_RESOLVED; 50311 if (handler.thisPromise._unhandledRejection) { 50312 this.removeUnhandeledRejection(handler.thisPromise); 50313 } 50314 } 50315 } catch (ex) { 50316 nextStatus = STATUS_REJECTED; 50317 nextValue = ex; 50318 } 50319 handler.nextPromise._updateStatus(nextStatus, nextValue); 50320 if (Date.now() >= timeoutAt) { 50321 break; 50322 } 50323 } 50324 if (this.handlers.length > 0) { 50325 setTimeout(this.runHandlers.bind(this), 0); 50326 return; 50327 } 50328 this.running = false; 50329 }, 50330 addUnhandledRejection: function addUnhandledRejection(promise) { 50331 this.unhandledRejections.push({ 50332 promise: promise, 50333 time: Date.now() 50334 }); 50335 this.scheduleRejectionCheck(); 50336 }, 50337 removeUnhandeledRejection: function removeUnhandeledRejection(promise) { 50338 promise._unhandledRejection = false; 50339 for (var i = 0; i < this.unhandledRejections.length; i++) { 50340 if (this.unhandledRejections[i].promise === promise) { 50341 this.unhandledRejections.splice(i); 50342 i--; 50343 } 50344 } 50345 }, 50346 scheduleRejectionCheck: function scheduleRejectionCheck() { 50347 if (this.pendingRejectionCheck) { 50348 return; 50349 } 50350 this.pendingRejectionCheck = true; 50351 setTimeout(function rejectionCheck() { 50352 this.pendingRejectionCheck = false; 50353 var now = Date.now(); 50354 for (var i = 0; i < this.unhandledRejections.length; i++) { 50355 if (now - this.unhandledRejections[i].time > REJECTION_TIMEOUT) { 50356 var unhandled = this.unhandledRejections[i].promise._value; 50357 var msg = 'Unhandled rejection: ' + unhandled; 50358 if (unhandled.stack) { 50359 msg += '\n' + unhandled.stack; 50360 } 50361 try { 50362 throw new Error(msg); 50363 } catch (_) { 50364 console.warn(msg); 50365 } 50366 this.unhandledRejections.splice(i); 50367 i--; 50368 } 50369 } 50370 if (this.unhandledRejections.length) { 50371 this.scheduleRejectionCheck(); 50372 } 50373 }.bind(this), REJECTION_TIMEOUT); 50374 } 50375 }; 50376 var Promise = function Promise(resolver) { 50377 this._status = STATUS_PENDING; 50378 this._handlers = []; 50379 try { 50380 resolver.call(this, this._resolve.bind(this), this._reject.bind(this)); 50381 } catch (e) { 50382 this._reject(e); 50383 } 50384 }; 50385 Promise.all = function Promise_all(promises) { 50386 var resolveAll, rejectAll; 50387 var deferred = new Promise(function (resolve, reject) { 50388 resolveAll = resolve; 50389 rejectAll = reject; 50390 }); 50391 var unresolved = promises.length; 50392 var results = []; 50393 if (unresolved === 0) { 50394 resolveAll(results); 50395 return deferred; 50396 } 50397 function reject(reason) { 50398 if (deferred._status === STATUS_REJECTED) { 50399 return; 50400 } 50401 results = []; 50402 rejectAll(reason); 50403 } 50404 for (var i = 0, ii = promises.length; i < ii; ++i) { 50405 var promise = promises[i]; 50406 var resolve = function (i) { 50407 return function (value) { 50408 if (deferred._status === STATUS_REJECTED) { 50409 return; 50410 } 50411 results[i] = value; 50412 unresolved--; 50413 if (unresolved === 0) { 50414 resolveAll(results); 50415 } 50416 }; 50417 }(i); 50418 if (Promise.isPromise(promise)) { 50419 promise.then(resolve, reject); 50420 } else { 50421 resolve(promise); 50422 } 50423 } 50424 return deferred; 50425 }; 50426 Promise.isPromise = function Promise_isPromise(value) { 50427 return value && typeof value.then === 'function'; 50428 }; 50429 Promise.resolve = function Promise_resolve(value) { 50430 return new Promise(function (resolve) { 50431 resolve(value); 50432 }); 50433 }; 50434 Promise.reject = function Promise_reject(reason) { 50435 return new Promise(function (resolve, reject) { 50436 reject(reason); 50437 }); 50438 }; 50439 Promise.prototype = { 50440 _status: null, 50441 _value: null, 50442 _handlers: null, 50443 _unhandledRejection: null, 50444 _updateStatus: function Promise__updateStatus(status, value) { 50445 if (this._status === STATUS_RESOLVED || this._status === STATUS_REJECTED) { 50446 return; 50447 } 50448 if (status === STATUS_RESOLVED && Promise.isPromise(value)) { 50449 value.then(this._updateStatus.bind(this, STATUS_RESOLVED), this._updateStatus.bind(this, STATUS_REJECTED)); 50450 return; 50451 } 50452 this._status = status; 50453 this._value = value; 50454 if (status === STATUS_REJECTED && this._handlers.length === 0) { 50455 this._unhandledRejection = true; 50456 HandlerManager.addUnhandledRejection(this); 50457 } 50458 HandlerManager.scheduleHandlers(this); 50459 }, 50460 _resolve: function Promise_resolve(value) { 50461 this._updateStatus(STATUS_RESOLVED, value); 50462 }, 50463 _reject: function Promise_reject(reason) { 50464 this._updateStatus(STATUS_REJECTED, reason); 50465 }, 50466 then: function Promise_then(onResolve, onReject) { 50467 var nextPromise = new Promise(function (resolve, reject) { 50468 this.resolve = resolve; 50469 this.reject = reject; 50470 }); 50471 this._handlers.push({ 50472 thisPromise: this, 50473 onResolve: onResolve, 50474 onReject: onReject, 50475 nextPromise: nextPromise 50476 }); 50477 HandlerManager.scheduleHandlers(this); 50478 return nextPromise; 50479 },
50480 catch: function Promise_catch(onReject) { 50481 return this.then(undefined, onReject); 50482 } 50483 }; 50484 globalScope.Promise = Promise; 50485 }()); 50486 (function checkWeakMap() { 50487 if (globalScope.WeakMap) { 50488 return; 50489 } 50490 var id = 0; 50491 function WeakMap() { 50492 this.id = '$weakmap' + id++; 50493 } 50494 WeakMap.prototype = { 50495 has: function (obj) { 50496 return !!Object.getOwnPropertyDescriptor(obj, this.id); 50497 }, 50498 get: function (obj, defaultValue) { 50499 return this.has(obj) ? obj[this.id] : defaultValue; 50500 }, 50501 set: function (obj, value) { 50502 Object.defineProperty(obj, this.id, { 50503 value: value, 50504 enumerable: false, 50505 configurable: true 50506 }); 50507 }, 50508 delete: function (obj) { 50509 delete obj[this.id]; 50510 } 50511 }; 50512 globalScope.WeakMap = WeakMap; 50513 }()); 50514 (function checkURLConstructor() { 50515 var hasWorkingUrl = false; 50516 try { 50517 if (typeof URL === 'function' && typeof URL.prototype === 'object' && 'origin' in URL.prototype) { 50518 var u = new URL('b', 'http://a'); 50519 u.pathname = 'c%20d'; 50520 hasWorkingUrl = u.href === 'http://a/c%20d'; 50521 } 50522 } catch (e) { 50523 } 50524 if (hasWorkingUrl) { 50525 return; 50526 } 50527 var relative = Object.create(null); 50528 relative['ftp'] = 21; 50529 relative['file'] = 0; 50530 relative['gopher'] = 70; 50531 relative['http'] = 80; 50532 relative['https'] = 443; 50533 relative['ws'] = 80; 50534 relative['wss'] = 443; 50535 var relativePathDotMapping = Object.create(null); 50536 relativePathDotMapping['%2e'] = '.'; 50537 relativePathDotMapping['.%2e'] = '..'; 50538 relativePathDotMapping['%2e.'] = '..'; 50539 relativePathDotMapping['%2e%2e'] = '..'; 50540 function isRelativeScheme(scheme) { 50541 return relative[scheme] !== undefined; 50542 }
50543 function invalid() { 50544 clear.call(this); 50545 this._isInvalid = true; 50546 } 50547 function IDNAToASCII(h) { 50548 if (h === '') { 50549 invalid.call(this); 50550 } 50551 return h.toLowerCase(); 50552 } 50553 function percentEscape(c) { 50554 var unicode = c.charCodeAt(0); 50555 if (unicode > 0x20 && unicode < 0x7F && [ 50556 0x22, 50557 0x23, 50558 0x3C, 50559 0x3E, 50560 0x3F, 50561 0x60 50562 ].indexOf(unicode) === -1) { 50563 return c; 50564 } 50565 return encodeURIComponent(c); 50566 } 50567 function percentEscapeQuery(c) { 50568 var unicode = c.charCodeAt(0); 50569 if (unicode > 0x20 && unicode < 0x7F && [ 50570 0x22, 50571 0x23, 50572 0x3C, 50573 0x3E, 50574 0x60 50575 ].indexOf(unicode) === -1) { 50576 return c; 50577 } 50578 return encodeURIComponent(c); 50579 } 50580 var EOF, ALPHA = /[a-zA-Z]/, ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; 50581 function parse(input, stateOverride, base) { 50582 function err(message) { 50583 errors.push(message); 50584 } 50585 var state = stateOverride || 'scheme start', cursor = 0, buffer = '', seenAt = false, seenBracket = false, errors = []; 50586 loop: 50587 while ((input[cursor - 1] !== EOF || cursor === 0) && !this._isInvalid) { 50588 var c = input[cursor]; 50589 switch (state) { 50590 case 'scheme start': 50591 if (c && ALPHA.test(c)) { 50592 buffer += c.toLowerCase(); 50593 state = 'scheme'; 50594 } else if (!stateOverride) { 50595 buffer = ''; 50596 state = 'no scheme'; 50597 continue; 50598 } else { 50599 err('Invalid scheme.'); 50600 break loop; 50601 } 50602 break; 50603 case 'scheme': 50604 if (c && ALPHANUMERIC.test(c)) { 50605 buffer += c.toLowerCase(); 50606 } else if (c === ':') { 50607 this._scheme = buffer; 50608 buffer = ''; 50609 if (stateOverride) { 50610 break loop; 50611 } 50612 if (isRelativeScheme(this._scheme)) { 50613 this._isRelative = true; 50614 } 50615 if (this._scheme === 'file') { 50616 state = 'relative'; 50617 } else if (this._isRelative && base && base._scheme === this._scheme) { 50618 state = 'relative or authority'; 50619 } else if (this._isRelative) { 50620 state = 'authority first slash'; 50621 } else { 50622 state = 'scheme data'; 50623 } 50624 } else if (!stateOverride) { 50625 buffer = ''; 50626 cursor = 0; 50627 state = 'no scheme'; 50628 continue; 50629 } else if (EOF === c) { 50630 break loop; 50631 } else { 50632 err('Code point not allowed in scheme: ' + c); 50633 break loop; 50634 } 50635 break; 50636 case 'scheme data': 50637 if (c === '?') { 50638 this._query = '?'; 50639 state = 'query'; 50640 } else if (c === '#') { 50641 this._fragment = '#'; 50642 state = 'fragment'; 50643 } else { 50644 if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { 50645 this._schemeData += percentEscape(c); 50646 } 50647 } 50648 break; 50649 case 'no scheme': 50650 if (!base || !isRelativeScheme(base._scheme)) { 50651 err('Missing scheme.'); 50652 invalid.call(this); 50653 } else { 50654 state = 'relative'; 50655 continue; 50656 } 50657 break; 50658 case 'relative or authority': 50659 if (c === '/' && input[cursor + 1] === '/') { 50660 state = 'authority ignore slashes'; 50661 } else { 50662 err('Expected /, got: ' + c); 50663 state = 'relative'; 50664 continue; 50665 } 50666 break; 50667 case 'relative': 50668 this._isRelative = true; 50669 if ('file' !== this._scheme) { 50670 this._scheme = base._scheme; 50671 } 50672 if (EOF === c) { 50673 this._host = base._host; 50674 this._port = base._port; 50675 this._path = base._path.slice(); 50676 this._query = base._query; 50677 this._username = base._username; 50678 this._password = base._password; 50679 break loop; 50680 } else if (c === '/' || c === '\\') { 50681 if (c === '\\') { 50682 err('\\ is an invalid code point.'); 50683 } 50684 state = 'relative slash'; 50685 } else if (c === '?') { 50686 this._host = base._host; 50687 this._port = base._port; 50688 this._path = base._path.slice(); 50689 this._query = '?'; 50690 this._username = base._username; 50691 this._password = base._password; 50692 state = 'query'; 50693 } else if (c === '#') { 50694 this._host = base._host; 50695 this._port = base._port; 50696 this._path = base._path.slice(); 50697 this._query = base._query; 50698 this._fragment = '#'; 50699 this._username = base._username; 50700 this._password = base._password; 50701 state = 'fragment'; 50702 } else { 50703 var nextC = input[cursor + 1]; 50704 var nextNextC = input[cursor + 2]; 50705 if ('file' !== this._scheme || !ALPHA.test(c) || nextC !== ':' && nextC !== '|' || EOF !== nextNextC && '/' !== nextNextC && '\\' !== nextNextC && '?' !== nextNextC && '#' !== nextNextC) { 50706 this._host = base._host; 50707 this._port = base._port; 50708 this._username = base._username; 50709 this._password = base._password; 50710 this._path = base._path.slice(); 50711 this._path.pop(); 50712 } 50713 state = 'relative path'; 50714 continue; 50715 } 50716 break; 50717 case 'relative slash': 50718 if (c === '/' || c === '\\') { 50719 if (c === '\\') {
50720 err('\\ is an invalid code point.'); 50721 } 50722 if (this._scheme === 'file') { 50723 state = 'file host'; 50724 } else { 50725 state = 'authority ignore slashes'; 50726 } 50727 } else { 50728 if ('file' !== this._scheme) { 50729 this._host = base._host; 50730 this._port = base._port; 50731 this._username = base._username; 50732 this._password = base._password; 50733 } 50734 state = 'relative path'; 50735 continue; 50736 } 50737 break; 50738 case 'authority first slash': 50739 if (c === '/') { 50740 state = 'authority second slash'; 50741 } else { 50742 err('Expected \'/\', got: ' + c); 50743 state = 'authority ignore slashes'; 50744 continue; 50745 } 50746 break; 50747 case 'authority second slash': 50748 state = 'authority ignore slashes'; 50749 if ('/' !== c) { 50750 err('Expected \'/\', got: ' + c); 50751 continue; 50752 } 50753 break; 50754 case 'authority ignore slashes': 50755 if ('/' !== c && '\\' !== c) { 50756 state = 'authority'; 50757 continue; 50758 } else { 50759 err('Expected authority, got: ' + c); 50760 } 50761 break; 50762 case 'authority': 50763 if (c === '@') { 50764 if (seenAt) { 50765 err('@ already seen.'); 50766 buffer += '%40'; 50767 } 50768 seenAt = true; 50769 for (var i = 0; i < buffer.length; i++) { 50770 var cp = buffer[i]; 50771 if (cp === '\t' || cp === '\n' || cp === '\r') { 50772 err('Invalid whitespace in authority.'); 50773 continue; 50774 } 50775 if (cp === ':' && this._password === null) { 50776 this._password = ''; 50777 continue; 50778 } 50779 var tempC = percentEscape(cp); 50780 if (null !== this._password) { 50781 this._password += tempC; 50782 } else { 50783 this._username += tempC; 50784 } 50785 } 50786 buffer = ''; 50787 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 50788 cursor -= buffer.length; 50789 buffer = ''; 50790 state = 'host'; 50791 continue; 50792 } else { 50793 buffer += c; 50794 } 50795 break; 50796 case 'file host': 50797 if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 50798 if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) { 50799 state = 'relative path'; 50800 } else if (buffer.length === 0) { 50801 state = 'relative path start'; 50802 } else { 50803 this._host = IDNAToASCII.call(this, buffer); 50804 buffer = ''; 50805 state = 'relative path start'; 50806 } 50807 continue; 50808 } else if (c === '\t' || c === '\n' || c === '\r') { 50809 err('Invalid whitespace in file host.'); 50810 } else { 50811 buffer += c; 50812 } 50813 break; 50814 case 'host': 50815 case 'hostname': 50816 if (c === ':' && !seenBracket) { 50817 this._host = IDNAToASCII.call(this, buffer); 50818 buffer = ''; 50819 state = 'port'; 50820 if (stateOverride === 'hostname') { 50821 break loop; 50822 } 50823 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 50824 this._host = IDNAToASCII.call(this, buffer); 50825 buffer = ''; 50826 state = 'relative path start'; 50827 if (stateOverride) { 50828 break loop; 50829 } 50830 continue; 50831 } else if ('\t' !== c && '\n' !== c && '\r' !== c) { 50832 if (c === '[') { 50833 seenBracket = true; 50834 } else if (c === ']') { 50835 seenBracket = false; 50836 } 50837 buffer += c; 50838 } else { 50839 err('Invalid code point in host/hostname: ' + c); 50840 } 50841 break; 50842 case 'port': 50843 if (/[0-9]/.test(c)) { 50844 buffer += c; 50845 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#' || stateOverride) { 50846 if ('' !== buffer) { 50847 var temp = parseInt(buffer, 10); 50848 if (temp !== relative[this._scheme]) { 50849 this._port = temp + ''; 50850 } 50851 buffer = ''; 50852 } 50853 if (stateOverride) { 50854 break loop; 50855 } 50856 state = 'relative path start'; 50857 continue; 50858 } else if (c === '\t' || c === '\n' || c === '\r') { 50859 err('Invalid code point in port: ' + c); 50860 } else { 50861 invalid.call(this); 50862 } 50863 break; 50864 case 'relative path start': 50865 if (c === '\\') { 50866 err('\'\\\' not allowed in path.'); 50867 } 50868 state = 'relative path'; 50869 if ('/' !== c && '\\' !== c) { 50870 continue; 50871 } 50872 break; 50873 case 'relative path': 50874 if (c === EOF || c === '/' || c === '\\' || !stateOverride && (c === '?' || c === '#')) { 50875 if (c === '\\') { 50876 err('\\ not allowed in relative path.'); 50877 } 50878 var tmp; 50879 if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { 50880 buffer = tmp; 50881 } 50882 if (buffer === '..') { 50883 this._path.pop(); 50884 if ('/' !== c && '\\' !== c) { 50885 this._path.push(''); 50886 } 50887 } else if (buffer === '.' && '/' !== c && '\\' !== c) { 50888 this._path.push(''); 50889 } else if ('.' !== buffer) { 50890 if (this._scheme === 'file' && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') { 50891 buffer = buffer[0] + ':'; 50892 } 50893 this._path.push(buffer); 50894 } 50895 buffer = ''; 50896 if (c === '?') { 50897 this._query = '?'; 50898 state = 'query'; 50899 } else if (c === '#') { 50900 this._fragment = '#'; 50901 state = 'fragment'; 50902 } 50903 } else if ('\t' !== c && '\n' !== c && '\r' !== c) { 50904 buffer += percentEscape(c); 50905 } 50906 break; 50907 case 'query': 50908 if (!stateOverride && c === '#') { 50909 this._fragment = '#'; 50910 state = 'fragment'; 50911 }
50911 else if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { 50912 this._query += percentEscapeQuery(c); 50913 } 50914 break; 50915 case 'fragment': 50916 if (EOF !== c && '\t' !== c && '\n' !== c && '\r' !== c) { 50917 this._fragment += c; 50918 } 50919 break; 50920 } 50921 cursor++; 50922 } 50923 } 50924 function clear() { 50925 this._scheme = ''; 50926 this._schemeData = ''; 50927 this._username = ''; 50928 this._password = null; 50929 this._host = ''; 50930 this._port = ''; 50931 this._path = []; 50932 this._query = ''; 50933 this._fragment = ''; 50934 this._isInvalid = false; 50935 this._isRelative = false; 50936 } 50937 function JURL(url, base) { 50938 if (base !== undefined && !(base instanceof JURL)) { 50939 base = new JURL(String(base)); 50940 } 50941 this._url = url; 50942 clear.call(this); 50943 var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); 50944 parse.call(this, input, null, base); 50945 } 50946 JURL.prototype = { 50947 toString: function () { 50948 return this.href; 50949 }, 50950 get href() { 50951 if (this._isInvalid) { 50952 return this._url; 50953 } 50954 var authority = ''; 50955 if ('' !== this._username || null !== this._password) { 50956 authority = this._username + (null !== this._password ? ':' + this._password : '') + '@'; 50957 } 50958 return this.protocol + (this._isRelative ? '//' + authority + this.host : '') + this.pathname + this._query + this._fragment; 50959 }, 50960 set href(href) { 50961 clear.call(this); 50962 parse.call(this, href); 50963 }, 50964 get protocol() { 50965 return this._scheme + ':'; 50966 }, 50967 set protocol(protocol) { 50968 if (this._isInvalid) { 50969 return; 50970 } 50971 parse.call(this, protocol + ':', 'scheme start'); 50972 }, 50973 get host() { 50974 return this._isInvalid ? '' : this._port ? this._host + ':' + this._port : this._host; 50975 }, 50976 set host(host) { 50977 if (this._isInvalid || !this._isRelative) { 50978 return; 50979 } 50980 parse.call(this, host, 'host'); 50981 }, 50982 get hostname() { 50983 return this._host; 50984 }, 50985 set hostname(hostname) { 50986 if (this._isInvalid || !this._isRelative) { 50987 return; 50988 } 50989 parse.call(this, hostname, 'hostname'); 50990 }, 50991 get port() { 50992 return this._port; 50993 }, 50994 set port(port) { 50995 if (this._isInvalid || !this._isRelative) { 50996 return; 50997 } 50998 parse.call(this, port, 'port'); 50999 }, 51000 get pathname() { 51001 return this._isInvalid ? '' : this._isRelative ? '/' + this._path.join('/') : this._schemeData; 51002 }, 51003 set pathname(pathname) { 51004 if (this._isInvalid || !this._isRelative) { 51005 return; 51006 } 51007 this._path = []; 51008 parse.call(this, pathname, 'relative path start'); 51009 }, 51010 get search() { 51011 return this._isInvalid || !this._query || this._query === '?' ? '' : this._query; 51012 }, 51013 set search(search) { 51014 if (this._isInvalid || !this._isRelative) { 51015 return; 51016 } 51017 this._query = '?'; 51018 if (search[0] === '?') { 51019 search = search.slice(1); 51020 } 51021 parse.call(this, search, 'query'); 51022 }, 51023 get hash() { 51024 return this._isInvalid || !this._fragment || this._fragment === '#' ? '' : this._fragment; 51025 }, 51026 set hash(hash) { 51027 if (this._isInvalid) { 51028 return; 51029 } 51030 this._fragment = '#'; 51031 if (hash[0] === '#') { 51032 hash = hash.slice(1); 51033 } 51034 parse.call(this, hash, 'fragment'); 51035 }, 51036 get origin() { 51037 var host; 51038 if (this._isInvalid || !this._scheme) { 51039 return ''; 51040 } 51041 switch (this._scheme) { 51042 case 'data': 51043 case 'file': 51044 case 'javascript': 51045 case 'mailto': 51046 return 'null'; 51047 } 51048 host = this.host; 51049 if (!host) { 51050 return ''; 51051 } 51052 return this._scheme + '://' + host; 51053 } 51054 }; 51055 var OriginalURL = globalScope.URL; 51056 if (OriginalURL) { 51057 JURL.createObjectURL = function (blob) { 51058 return OriginalURL.createObjectURL.apply(OriginalURL, arguments); 51059 }; 51060 JURL.revokeObjectURL = function (url) { 51061 OriginalURL.revokeObjectURL(url); 51062 }; 51063 } 51064 globalScope.URL = JURL; 51065 }()); 51066} 51067/* WEBPACK VAR INJECTION */}.call(exports, __w_pdfjs_require__(9))) 51068 51069/***/ }), 51070/* 37 */ 51071/***/ (function(module, exports, __w_pdfjs_require__) { 51072 51073"use strict"; 51074 51075var pdfjsVersion = '1.7.354'; 51076var pdfjsBuild = '0f7548ba'; 51077var pdfjsCoreWorker = __w_pdfjs_require__(8); 51078{ 51079 __w_pdfjs_require__(19); 51080} 51081exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; 51082 51083/***/ }) 51084/******/ ]); 51085});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.