1"use strict"; 2 3var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; 4 5(function e(t, n, r) { 6 function s(o, u) { 7 if (!n[o]) { 8 if (!t[o]) { 9 var a = typeof require == "function" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);throw new Error("Cannot find module '" + o + "'"); 10 }var f = n[o] = { exports: {} };t[o][0].call(f.exports, function (e) { 11 var n = t[o][1][e];return s(n ? n : e); 12 }, f, f.exports, e, t, n, r); 13 }return n[o].exports; 14 }var i = typeof require == "function" && require;for (var o = 0; o < r.length; o++) { 15 s(r[o]); 16 }return s; 17})({ 1: [function (require, module, exports) { 18 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 19 var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 20 21 ;(function (exports) { 22 'use strict'; 23 24 var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; 25 26 var PLUS = '+'.charCodeAt(0); 27 var SLASH = '/'.charCodeAt(0); 28 var NUMBER = '0'.charCodeAt(0); 29 var LOWER = 'a'.charCodeAt(0); 30 var UPPER = 'A'.charCodeAt(0); 31 var PLUS_URL_SAFE = '-'.charCodeAt(0); 32 var SLASH_URL_SAFE = '_'.charCodeAt(0); 33 34 function decode(elt) { 35 var code = elt.charCodeAt(0); 36 if (code === PLUS || code === PLUS_URL_SAFE) return 62; // '+' 37 if (code === SLASH || code === SLASH_URL_SAFE) return 63; // '/' 38 if (code < NUMBER) return -1; //no match 39 if (code < NUMBER + 10) return code - NUMBER + 26 + 26; 40 if (code < UPPER + 26) return code - UPPER; 41 if (code < LOWER + 26) return code - LOWER + 26; 42 } 43 44 function b64ToByteArray(b64) { 45 var i, j, l, tmp, placeHolders, arr; 46 47 if (b64.length % 4 > 0) { 48 throw new Error('Invalid string. Length must be a multiple of 4'); 49 } 50 51 // the number of equal signs (place holders) 52 // if there are two placeholders, than the two characters before it 53 // represent one byte 54 // if there is only one, then the three characters before it represent 2 bytes 55 // this is just a cheap hack to not do indexOf twice 56 var len = b64.length; 57 placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0; 58 59 // base64 is 4/3 + up to two characters of the original data 60 arr = new Arr(b64.length * 3 / 4 - placeHolders); 61 62 // if there are placeholders, only get up to the last complete 4 chars 63 l = placeHolders > 0 ? b64.length - 4 : b64.length; 64 65 var L = 0; 66 67 function push(v) { 68 arr[L++] = v; 69 } 70 71 for (i = 0, j = 0; i < l; i += 4, j += 3) { 72 tmp = decode(b64.charAt(i)) << 18 | decode(b64.charAt(i + 1)) << 12 | decode(b64.charAt(i + 2)) << 6 | decode(b64.charAt(i + 3)); 73 push((tmp & 0xFF0000) >> 16); 74 push((tmp & 0xFF00) >> 8); 75 push(tmp & 0xFF); 76 } 77 78 if (placeHolders === 2) { 79 tmp = decode(b64.charAt(i)) << 2 | decode(b64.charAt(i + 1)) >> 4; 80 push(tmp & 0xFF); 81 } else if (placeHolders === 1) { 82 tmp = decode(b64.charAt(i)) << 10 | decode(b64.charAt(i + 1)) << 4 | decode(b64.charAt(i + 2)) >> 2; 83 push(tmp >> 8 & 0xFF); 84 push(tmp & 0xFF); 85 } 86 87 return arr; 88 } 89 90 function uint8ToBase64(uint8) { 91 var i, 92 extraBytes = uint8.length % 3, 93 // if we have 1 byte left, pad 2 bytes 94 output = "", 95 temp, 96 length; 97 98 function encode(num) { 99 return lookup.charAt(num); 100 } 101 102 function tripletToBase64(num) { 103 return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F); 104 } 105 106 // go through the array every three bytes, we'll deal with trailing stuff later 107 for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { 108 temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2]; 109 output += tripletToBase64(temp); 110 } 111 112 // pad the end with zeros, but make sure to not forget the extra bytes 113 switch (extraBytes) { 114 case 1: 115 temp = uint8[uint8.length - 1]; 116 output += encode(temp >> 2); 117 output += encode(temp << 4 & 0x3F); 118 output += '=='; 119 break; 120 case 2: 121 temp = (uint8[uint8.length - 2] << 8) + uint8[uint8.length - 1]; 122 output += encode(temp >> 10); 123 output += encode(temp >> 4 & 0x3F); 124 output += encode(temp << 2 & 0x3F); 125 output += '='; 126 break; 127 } 128 129 return output; 130 } 131 132 exports.toByteArray = b64ToByteArray; 133 exports.fromByteArray = uint8ToBase64; 134 })(typeof exports === 'undefined' ? this.base64js = {} : exports); 135 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/../../node_modules/base64-js/lib/b64.js", "/../../node_modules/base64-js/lib"); 136 }, { "buffer": 2, "rH1JPG": 4 }
136], 2: [function (require, module, exports) { 137 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 138 /*! 139 * The buffer module from node.js, for the browser. 140 * 141 * @author Feross Aboukhadijeh <[email protected]> <http://feross.org> 142 * @license MIT 143 */ 144 145 var base64 = require('base64-js'); 146 var ieee754 = require('ieee754'); 147 148 exports.Buffer = Buffer; 149 exports.SlowBuffer = Buffer; 150 exports.INSPECT_MAX_BYTES = 50; 151 Buffer.poolSize = 8192; 152 153 /** 154 * If `Buffer._useTypedArrays`: 155 * === true Use Uint8Array implementation (fastest) 156 * === false Use Object implementation (compatible down to IE6) 157 */ 158 Buffer._useTypedArrays = function () { 159 // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+, 160 // Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding 161 // properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support 162 // because we need to be able to add all the node Buffer API methods. This is an issue 163 // in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438 164 try { 165 var buf = new ArrayBuffer(0); 166 var arr = new Uint8Array(buf); 167 arr.foo = function () { 168 return 42; 169 }; 170 return 42 === arr.foo() && typeof arr.subarray === 'function'; // Chrome 9-10 lack `subarray` 171 } catch (e) { 172 return false; 173 } 174 }(); 175 176 /** 177 * Class: Buffer 178 * ============= 179 * 180 * The Buffer constructor returns instances of `Uint8Array` that are augmented 181 * with function properties for all the node `Buffer` API functions. We use 182 * `Uint8Array` so that square bracket notation works as expected -- it returns 183 * a single octet. 184 * 185 * By augmenting the instances, we can avoid modifying the `Uint8Array` 186 * prototype. 187 */ 188 function Buffer(subject, encoding, noZero) { 189 if (!(this instanceof Buffer)) return new Buffer(subject, encoding, noZero); 190 191 var type = typeof subject === "undefined" ? "undefined" : _typeof(subject); 192 193 // Workaround: node's base64 implementation allows for non-padded strings 194 // while base64-js does not. 195 if (encoding === 'base64' && type === 'string') { 196 subject = stringtrim(subject); 197 while (subject.length % 4 !== 0) { 198 subject = subject + '='; 199 } 200 } 201 202 // Find the length 203 var length; 204 if (type === 'number') length = coerce(subject);else if (type === 'string') length = Buffer.byteLength(subject, encoding);else if (type === 'object') length = coerce(subject.length); // assume that object is array-like 205 else throw new Error('First argument needs to be a number, array or string.'); 206 207 var buf; 208 if (Buffer._useTypedArrays) { 209 // Preferred: Return an augmented `Uint8Array` instance for best performance 210 buf = Buffer._augment(new Uint8Array(length)); 211 } else { 212 // Fallback: Return THIS instance of Buffer (created by `new`) 213 buf = this; 214 buf.length = length; 215 buf._isBuffer = true; 216 } 217 218 var i; 219 if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') { 220 // Speed optimization -- use set if we're copying from a typed array 221 buf._set(subject); 222 } else if (isArrayish(subject)) { 223 // Treat array-ish objects as a byte array 224 for (i = 0; i < length; i++) { 225 if (Buffer.isBuffer(subject)) buf[i] = subject.readUInt8(i);else buf[i] = subject[i]; 226 } 227 } else if (type === 'string') { 228 buf.write(subject, 0, encoding); 229 } else if (type === 'number' && !Buffer._useTypedArrays && !noZero) { 230 for (i = 0; i < length; i++) { 231 buf[i] = 0; 232 } 233 } 234 235 return buf; 236 } 237 238 // STATIC METHODS 239 // ============== 240 241 Buffer.isEncoding = function (encoding) { 242 switch (String(encoding).toLowerCase()) { 243 case 'hex': 244 case 'utf8': 245 case 'utf-8': 246 case 'ascii': 247 case 'binary': 248 case 'base64': 249 case 'raw': 250 case 'ucs2': 251 case 'ucs-2': 252 case 'utf16le': 253 case 'utf-16le': 254 return true; 255 default: 256 return false;
257 } 258 }; 259 260 Buffer.isBuffer = function (b) { 261 return !!(b !== null && b !== undefined && b._isBuffer); 262 }; 263 264 Buffer.byteLength = function (str, encoding) { 265 var ret; 266 str = str + ''; 267 switch (encoding || 'utf8') { 268 case 'hex': 269 ret = str.length / 2; 270 break; 271 case 'utf8': 272 case 'utf-8': 273 ret = utf8ToBytes(str).length; 274 break; 275 case 'ascii': 276 case 'binary': 277 case 'raw': 278 ret = str.length; 279 break; 280 case 'base64': 281 ret = base64ToBytes(str).length; 282 break; 283 case 'ucs2': 284 case 'ucs-2': 285 case 'utf16le': 286 case 'utf-16le': 287 ret = str.length * 2; 288 break; 289 default: 290 throw new Error('Unknown encoding'); 291 } 292 return ret; 293 }; 294 295 Buffer.concat = function (list, totalLength) { 296 assert(isArray(list), 'Usage: Buffer.concat(list, [totalLength])\n' + 'list should be an Array.'); 297 298 if (list.length === 0) { 299 return new Buffer(0); 300 } else if (list.length === 1) { 301 return list[0]; 302 } 303 304 var i; 305 if (typeof totalLength !== 'number') { 306 totalLength = 0; 307 for (i = 0; i < list.length; i++) { 308 totalLength += list[i].length; 309 } 310 } 311 312 var buf = new Buffer(totalLength); 313 var pos = 0; 314 for (i = 0; i < list.length; i++) { 315 var item = list[i]; 316 item.copy(buf, pos); 317 pos += item.length; 318 } 319 return buf; 320 }; 321 322 // BUFFER INSTANCE METHODS 323 // ======================= 324 325 function _hexWrite(buf, string, offset, length) { 326 offset = Number(offset) || 0; 327 var remaining = buf.length - offset; 328 if (!length) { 329 length = remaining; 330 } else { 331 length = Number(length); 332 if (length > remaining) { 333 length = remaining; 334 } 335 } 336 337 // must be an even number of digits 338 var strLen = string.length; 339 assert(strLen % 2 === 0, 'Invalid hex string'); 340 341 if (length > strLen / 2) { 342 length = strLen / 2; 343 } 344 for (var i = 0; i < length; i++) { 345 var byte = parseInt(string.substr(i * 2, 2), 16); 346 assert(!isNaN(byte), 'Invalid hex string'); 347 buf[offset + i] = byte; 348 } 349 Buffer._charsWritten = i * 2; 350 return i; 351 } 352 353 function _utf8Write(buf, string, offset, length) { 354 var charsWritten = Buffer._charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length); 355 return charsWritten; 356 } 357 358 function _asciiWrite(buf, string, offset, length) { 359 var charsWritten = Buffer._charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length); 360 return charsWritten; 361 } 362 363 function _binaryWrite(buf, string, offset, length) { 364 return _asciiWrite(buf, string, offset, length); 365 } 366 367 function _base64Write(buf, string, offset, length) { 368 var charsWritten = Buffer._charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length); 369 return charsWritten; 370 } 371 372 function _utf16leWrite(buf, string, offset, length) { 373 var charsWritten = Buffer._charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length); 374 return charsWritten; 375 } 376 377 Buffer.prototype.write = function (string, offset, length, encoding) { 378 // Support both (string, offset, length, encoding) 379 // and the legacy (string, encoding, offset, length) 380 if (isFinite(offset)) { 381 if (!isFinite(length)) { 382 encoding = length; 383 length = undefined; 384 } 385 } else { 386 // legacy 387 var swap = encoding; 388 encoding = offset; 389 offset = length; 390 length = swap; 391 } 392 393 offset = Number(offset) || 0; 394 var remaining = this.length - offset; 395 if (!length) { 396 length = remaining; 397 } else { 398 length = Number(length); 399 if (length > remaining) { 400 length = remaining; 401 } 402 } 403 encoding = String(encoding || 'utf8').toLowerCase(); 404 405 var ret; 406 switch (encoding) { 407 case 'hex': 408 ret = _hexWrite(this, string, offset, length); 409 break; 410 case 'utf8': 411 case 'utf-8': 412 ret = _utf8Write(this, string, offset, length); 413 break; 414 case 'ascii': 415 ret = _asciiWrite(this, string, offset, length); 416 break; 417 case 'binary': 418 ret = _binaryWrite(this, string, offset, length); 419 break; 420 case 'base64': 421 ret = _base64Write(this, string, offset, length); 422 break; 423 case 'ucs2': 424 case 'ucs-2': 425 case 'utf16le': 426 case 'utf-16le': 427 ret = _utf16leWrite(this, string, offset, length); 428 break; 429 default: 430 throw new Error('Unknown encoding'); 431 } 432 return ret; 433 }; 434 435 Buffer.prototype.toString = function (encoding, start, end) { 436 var self = this; 437 438 encoding = String(encoding || 'utf8').toLowerCase(); 439 start = Number(start) || 0; 440 end = end !== undefined ? Number(end) : end = self.length; 441 442 // Fastpath empty strings 443 if (end === start) return ''; 444 445 var ret; 446 switch (encoding) { 447 case 'hex': 448 ret = _hexSlice(self, start, end); 449 break; 450 case 'utf8': 451 case 'utf-8': 452 ret = _utf8Slice(self, start, end); 453 break; 454 case 'ascii': 455 ret = _asciiSlice(self, start, end); 456 break; 457 case 'binary': 458 ret = _binarySlice(self, start, end); 459 break; 460 case 'base64': 461 ret = _base64Slice(self, start, end); 462 break; 463 case 'ucs2': 464 case 'ucs-2': 465 case 'utf16le': 466 case 'utf-16le': 467 ret = _utf16leSlice(self, start, end); 468 break; 469 default: 470 throw new Error('Unknown encoding'); 471 } 472 return ret; 473 }; 474 475 Buffer.prototype.toJSON = function () { 476 return { 477 type: 'Buffer', 478 data: Array.prototype.slice.call(this._arr || this, 0) 479 }; 480 }; 481 482 // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) 483 Buffer.prototype.copy = function (target, target_start, start, end) { 484 var source = this; 485 486 if (!start) start = 0; 487 if (!end && end !== 0) end = this.length; 488 if (!target_start) target_start = 0; 489 490 // Copy 0 bytes; we're done 491 if (end === start) return; 492 if (target.length === 0 || source.length === 0) return; 493 494 // Fatal error conditions 495 assert(end >= start, 'sourceEnd < sourceStart'); 496 assert(target_start >= 0 && target_start < target.length, 'targetStart out of bounds'); 497 assert(start >= 0 && start < source.length, 'sourceStart out of bounds'); 498 assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds'); 499 500 // Are we oob? 501 if (end > this.length) end = this.length; 502 if (target.length - target_start < end - start) end = target.length - target_start + start; 503 504 var len = end - start; 505 506 if (len < 100 || !Buffer._useTypedArrays) { 507 for (var i = 0; i < len; i++) { 508 target[i + target_start] = this[i + start]; 509 } 510 } else { 511 target._set(this.subarray(start, start + len), target_start); 512 } 513 }; 514 515 function _base64Slice(buf, start, end) { 516 if (start === 0 && end === buf.length) { 517 return base64.fromByteArray(buf); 518 } else { 519 return base64.fromByteArray(buf.slice(start, end)); 520 } 521 } 522 523 function _utf8Slice(buf, start, end) { 524 var res = ''; 525 var tmp = ''; 526 end = Math.min(buf.length, end); 527 528 for (var i = start; i < end; i++) { 529 if (buf[i] <= 0x7F) {
530 res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]); 531 tmp = ''; 532 } else { 533 tmp += '%' + buf[i].toString(16); 534 } 535 } 536 537 return res + decodeUtf8Char(tmp); 538 } 539 540 function _asciiSlice(buf, start, end) { 541 var ret = ''; 542 end = Math.min(buf.length, end); 543 544 for (var i = start; i < end; i++) { 545 ret += String.fromCharCode(buf[i]); 546 }return ret; 547 } 548 549 function _binarySlice(buf, start, end) { 550 return _asciiSlice(buf, start, end); 551 } 552 553 function _hexSlice(buf, start, end) { 554 var len = buf.length; 555 556 if (!start || start < 0) start = 0; 557 if (!end || end < 0 || end > len) end = len; 558 559 var out = ''; 560 for (var i = start; i < end; i++) { 561 out += toHex(buf[i]); 562 } 563 return out; 564 } 565 566 function _utf16leSlice(buf, start, end) { 567 var bytes = buf.slice(start, end); 568 var res = ''; 569 for (var i = 0; i < bytes.length; i += 2) { 570 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); 571 } 572 return res; 573 } 574 575 Buffer.prototype.slice = function (start, end) { 576 var len = this.length; 577 start = clamp(start, len, 0); 578 end = clamp(end, len, len); 579 580 if (Buffer._useTypedArrays) { 581 return Buffer._augment(this.subarray(start, end)); 582 } else { 583 var sliceLen = end - start; 584 var newBuf = new Buffer(sliceLen, undefined, true); 585 for (var i = 0; i < sliceLen; i++) { 586 newBuf[i] = this[i + start]; 587 } 588 return newBuf; 589 } 590 }; 591 592 // `get` will be removed in Node 0.13+ 593 Buffer.prototype.get = function (offset) { 594 console.log('.get() is deprecated. Access using array indexes instead.'); 595 return this.readUInt8(offset); 596 }; 597 598 // `set` will be removed in Node 0.13+ 599 Buffer.prototype.set = function (v, offset) { 600 console.log('.set() is deprecated. Access using array indexes instead.'); 601 return this.writeUInt8(v, offset); 602 }; 603 604 Buffer.prototype.readUInt8 = function (offset, noAssert) { 605 if (!noAssert) { 606 assert(offset !== undefined && offset !== null, 'missing offset'); 607 assert(offset < this.length, 'Trying to read beyond buffer length'); 608 } 609 610 if (offset >= this.length) return; 611 612 return this[offset]; 613 }; 614 615 function _readUInt16(buf, offset, littleEndian, noAssert) { 616 if (!noAssert) { 617 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 618 assert(offset !== undefined && offset !== null, 'missing offset'); 619 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length'); 620 } 621 622 var len = buf.length; 623 if (offset >= len) return; 624 625 var val; 626 if (littleEndian) { 627 val = buf[offset]; 628 if (offset + 1 < len) val |= buf[offset + 1] << 8; 629 } else { 630 val = buf[offset] << 8; 631 if (offset + 1 < len) val |= buf[offset + 1]; 632 } 633 return val; 634 } 635 636 Buffer.prototype.readUInt16LE = function (offset, noAssert) { 637 return _readUInt16(this, offset, true, noAssert); 638 }; 639 640 Buffer.prototype.readUInt16BE = function (offset, noAssert) { 641 return _readUInt16(this, offset, false, noAssert); 642 }; 643 644 function _readUInt32(buf, offset, littleEndian, noAssert) { 645 if (!noAssert) { 646 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 647 assert(offset !== undefined && offset !== null, 'missing offset'); 648 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length'); 649 } 650 651 var len = buf.length; 652 if (offset >= len) return; 653 654 var val; 655 if (littleEndian) { 656 if (offset + 2 < len) val = buf[offset + 2] << 16; 657 if (offset + 1 < len) val |= buf[offset + 1] << 8; 658 val |= buf[offset]; 659 if (offset + 3 < len) val = val + (buf[offset + 3] << 24 >>> 0); 660 } else { 661 if (offset + 1 < len) val = buf[offset + 1] << 16; 662 if (offset + 2 < len) val |= buf[offset + 2] << 8; 663 if (offset + 3 < len) val |= buf[offset + 3]; 664 val = val + (buf[offset] << 24 >>> 0); 665 } 666 return val; 667 } 668 669 Buffer.prototype.readUInt32LE = function (offset, noAssert) { 670 return _readUInt32(this, offset, true, noAssert); 671 }; 672 673 Buffer.prototype.readUInt32BE = function (offset, noAssert) { 674 return _readUInt32(this, offset, false, noAssert); 675 }; 676 677 Buffer.prototype.readInt8 = function (offset, noAssert) { 678 if (!noAssert) { 679 assert(offset !== undefined && offset !== null, 'missing offset'); 680 assert(offset < this.length, 'Trying to read beyond buffer length'); 681 } 682 683 if (offset >= this.length) return; 684 685 var neg = this[offset] & 0x80; 686 if (neg) return (0xff - this[offset] + 1) * -1;else return this[offset]; 687 }; 688 689 function _readInt16(buf, offset, littleEndian, noAssert) { 690 if (!noAssert) { 691 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 692 assert(offset !== undefined && offset !== null, 'missing offset'); 693 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length'); 694 } 695 696 var len = buf.length; 697 if (offset >= len) return; 698 699 var val = _readUInt16(buf, offset, littleEndian, true); 700 var neg = val & 0x8000; 701 if (neg) return (0xffff - val + 1) * -1;else return val; 702 } 703 704 Buffer.prototype.readInt16LE = function (offset, noAssert) { 705 return _readInt16(this, offset, true, noAssert); 706 }; 707 708 Buffer.prototype.readInt16BE = function (offset, noAssert) { 709 return _readInt16(this, offset, false, noAssert); 710 }; 711 712 function _readInt32(buf, offset, littleEndian, noAssert) { 713 if (!noAssert) { 714 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 715 assert(offset !== undefined && offset !== null, 'missing offset'); 716 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length'); 717 } 718 719 var len = buf.length; 720 if (offset >= len) return; 721 722 var val = _readUInt32(buf, offset, littleEndian, true); 723 var neg = val & 0x80000000; 724 if (neg) return (0xffffffff - val + 1) * -1;else return val; 725 } 726 727 Buffer.prototype.readInt32LE = function (offset, noAssert) { 728 return _readInt32(this, offset, true, noAssert); 729 }; 730 731 Buffer.prototype.readInt32BE = function (offset, noAssert) { 732 return _readInt32(this, offset, false, noAssert); 733 }; 734 735 function _readFloat(buf, offset, littleEndian, noAssert) { 736 if (!noAssert) { 737 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 738 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length'); 739 } 740 741 return ieee754.read(buf, offset, littleEndian, 23, 4); 742 } 743 744 Buffer.prototype.readFloatLE = function (offset, noAssert) { 745 return _readFloat(this, offset, true, noAssert); 746 }; 747 748 Buffer.prototype.readFloatBE = function (offset, noAssert) { 749 return _readFloat(this, offset, false, noAssert); 750 }; 751 752 function _readDouble(buf, offset, littleEndian, noAssert) { 753 if (!noAssert) { 754 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 755 assert(offset + 7 < buf.length, 'Trying to read beyond buffer length'); 756 } 757 758 return ieee754.read(buf, offset, littleEndian, 52, 8); 759 } 760 761 Buffer.prototype.readDoubleLE = function (offset, noAssert) { 762 return _readDouble(this, offset, true, noAssert); 763 }; 764 765 Buffer.prototype.readDoubleBE = function (offset, noAssert) { 766 return _readDouble(this, offset, false, noAssert); 767 }; 768 769 Buffer.prototype.writeUInt8 = function (value, offset, noAssert) { 770 if (!noAssert) { 771 assert(value !== undefined && value !== null, 'missing value'); 772 assert(offset !== undefined && offset !== null, 'missing offset'); 773 assert(offset < this.length, 'trying to write beyond buffer length'); 774 verifuint(value, 0xff); 775 } 776 777 if (offset >= this.length) return; 778 779 this[offset] = value; 780 }; 781 782 function _writeUInt16(buf, value, offset, littleEndian, noAssert) { 783 if (!noAssert) { 784 assert(value !== undefined && value !== null, 'missing value'); 785 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 786 assert(offset !== undefined && offset !== null, 'missing offset'); 787 assert(offset + 1 < buf.length, 'trying to write beyond buffer length'); 788 verifuint(value, 0xffff); 789 } 790 791 var len = buf.length; 792 if (offset >= len) return; 793 794 for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) { 795 buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8; 796 } 797 } 798 799 Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) { 800 _writeUInt16(this, value, offset, true, noAssert); 801 }; 802 803 Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) { 804 _writeUInt16(this, value, offset, false, noAssert); 805 }; 806 807 function _writeUInt32(buf, value, offset, littleEndian, noAssert) { 808 if (!noAssert) { 809 assert(value !== undefined && value !== null, 'missing value'); 810 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 811 assert(offset !== undefined && offset !== null, 'missing offset'); 812 assert(offset + 3 < buf.length, 'trying to write beyond buffer length'); 813 verifuint(value, 0xffffffff); 814 } 815 816 var len = buf.length; 817 if (offset >= len) return; 818 819 for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) { 820 buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff; 821 } 822 } 823 824 Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) { 825 _writeUInt32(this, value, offset, true, noAssert); 826 }; 827 828 Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) { 829 _writeUInt32(this, value, offset, false, noAssert); 830 }; 831 832 Buffer.prototype.writeInt8 = function (value, offset, noAssert) { 833 if (!noAssert) { 834 assert(value !== undefined && value !== null, 'missing value'); 835 assert(offset !== undefined && offset !== null, 'missing offset'); 836 assert(offset < this.length, 'Trying to write beyond buffer length'); 837 verifsint(value, 0x7f, -0x80); 838 } 839 840 if (offset >= this.length) return; 841 842 if (value >= 0) this.writeUInt8(value, offset, noAssert);else this.writeUInt8(0xff + value + 1, offset, noAssert); 843 }; 844 845 function _writeInt16(buf, value, offset, littleEndian, noAssert) { 846 if (!noAssert) { 847 assert(value !== undefined && value !== null, 'missing value'); 848 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 849 assert(offset !== undefined && offset !== null, 'missing offset'); 850 assert(offset + 1 < buf.length, 'Trying to write beyond buffer length'); 851 verifsint(value, 0x7fff, -0x8000); 852 } 853 854 var len = buf.length; 855 if (offset >= len) return; 856 857 if (value >= 0) _writeUInt16(buf, value, offset, littleEndian, noAssert);else _writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert); 858 } 859
860 Buffer.prototype.writeInt16LE = function (value, offset, noAssert) { 861 _writeInt16(this, value, offset, true, noAssert); 862 }; 863 864 Buffer.prototype.writeInt16BE = function (value, offset, noAssert) { 865 _writeInt16(this, value, offset, false, noAssert); 866 }; 867 868 function _writeInt32(buf, value, offset, littleEndian, noAssert) { 869 if (!noAssert) { 870 assert(value !== undefined && value !== null, 'missing value'); 871 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 872 assert(offset !== undefined && offset !== null, 'missing offset'); 873 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length'); 874 verifsint(value, 0x7fffffff, -0x80000000); 875 } 876 877 var len = buf.length; 878 if (offset >= len) return; 879 880 if (value >= 0) _writeUInt32(buf, value, offset, littleEndian, noAssert);else _writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert); 881 } 882 883 Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { 884 _writeInt32(this, value, offset, true, noAssert); 885 }; 886 887 Buffer.prototype.writeInt32BE = function (value, offset, noAssert) { 888 _writeInt32(this, value, offset, false, noAssert); 889 }; 890 891 function _writeFloat(buf, value, offset, littleEndian, noAssert) { 892 if (!noAssert) { 893 assert(value !== undefined && value !== null, 'missing value'); 894 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 895 assert(offset !== undefined && offset !== null, 'missing offset'); 896 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length'); 897 verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); 898 } 899 900 var len = buf.length; 901 if (offset >= len) return; 902 903 ieee754.write(buf, value, offset, littleEndian, 23, 4); 904 } 905 906 Buffer.prototype.writeFloatLE = function (value, offset, noAssert) { 907 _writeFloat(this, value, offset, true, noAssert); 908 }; 909 910 Buffer.prototype.writeFloatBE = function (value, offset, noAssert) { 911 _writeFloat(this, value, offset, false, noAssert); 912 }; 913 914 function _writeDouble(buf, value, offset, littleEndian, noAssert) { 915 if (!noAssert) { 916 assert(value !== undefined && value !== null, 'missing value'); 917 assert(typeof littleEndian === 'boolean', 'missing or invalid endian'); 918 assert(offset !== undefined && offset !== null, 'missing offset'); 919 assert(offset + 7 < buf.length, 'Trying to write beyond buffer length'); 920 verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); 921 } 922 923 var len = buf.length; 924 if (offset >= len) return; 925 926 ieee754.write(buf, value, offset, littleEndian, 52, 8); 927 } 928 929 Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) { 930 _writeDouble(this, value, offset, true, noAssert); 931 }; 932 933 Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) { 934 _writeDouble(this, value, offset, false, noAssert); 935 }; 936 937 // fill(value, start=0, end=buffer.length) 938 Buffer.prototype.fill = function (value, start, end) { 939 if (!value) value = 0; 940 if (!start) start = 0; 941 if (!end) end = this.length; 942 943 if (typeof value === 'string') { 944 value = value.charCodeAt(0); 945 } 946 947 assert(typeof value === 'number' && !isNaN(value), 'value is not a number'); 948 assert(end >= start, 'end < start'); 949 950 // Fill 0 bytes; we're done 951 if (end === start) return; 952 if (this.length === 0) return; 953 954 assert(start >= 0 && start < this.length, 'start out of bounds'); 955 assert(end >= 0 && end <= this.length, 'end out of bounds'); 956 957 for (var i = start; i < end; i++) { 958 this[i] = value; 959 } 960 }; 961 962 Buffer.prototype.inspect = function () { 963 var out = []; 964 var len = this.length; 965 for (var i = 0; i < len; i++) { 966 out[i] = toHex(this[i]); 967 if (i === exports.INSPECT_MAX_BYTES) { 968 out[i + 1] = '...'; 969 break; 970 } 971 } 972 return '<Buffer ' + out.join(' ') + '>'; 973 }; 974 975 /** 976 * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. 977 * Added in Node 0.12. Only available in browsers that support ArrayBuffer. 978 */ 979 Buffer.prototype.toArrayBuffer = function () { 980 if (typeof Uint8Array !== 'undefined') { 981 if (Buffer._useTypedArrays) { 982 return new Buffer(this).buffer; 983 } else { 984 var buf = new Uint8Array(this.length); 985 for (var i = 0, len = buf.length; i < len; i += 1) { 986 buf[i] = this[i]; 987 }return buf.buffer; 988 } 989 } else { 990 throw new Error('Buffer.toArrayBuffer not supported in this browser'); 991 } 992 }; 993 994 // HELPER FUNCTIONS 995 // ================ 996 997 function stringtrim(str) { 998 if (str.trim) return str.trim(); 999 return str.replace(/^\s+|\s+$/g, ''); 1000 } 1001 1002 var BP = Buffer.prototype; 1003 1004 /** 1005 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods 1006 */ 1007 Buffer._augment = function (arr) { 1008 arr._isBuffer = true; 1009 1010 // save reference to original Uint8Array get/set methods before overwriting 1011 arr._get = arr.get; 1012 arr._set = arr.set; 1013 1014 // deprecated, will be removed in node 0.13+ 1015 arr.get = BP.get; 1016 arr.set = BP.set; 1017 1018 arr.write = BP.write; 1019 arr.toString = BP.toString;
1020 arr.toLocaleString = BP.toString; 1021 arr.toJSON = BP.toJSON; 1022 arr.copy = BP.copy; 1023 arr.slice = BP.slice; 1024 arr.readUInt8 = BP.readUInt8; 1025 arr.readUInt16LE = BP.readUInt16LE; 1026 arr.readUInt16BE = BP.readUInt16BE; 1027 arr.readUInt32LE = BP.readUInt32LE; 1028 arr.readUInt32BE = BP.readUInt32BE; 1029 arr.readInt8 = BP.readInt8; 1030 arr.readInt16LE = BP.readInt16LE; 1031 arr.readInt16BE = BP.readInt16BE; 1032 arr.readInt32LE = BP.readInt32LE; 1033 arr.readInt32BE = BP.readInt32BE; 1034 arr.readFloatLE = BP.readFloatLE; 1035 arr.readFloatBE = BP.readFloatBE; 1036 arr.readDoubleLE = BP.readDoubleLE; 1037 arr.readDoubleBE = BP.readDoubleBE; 1038 arr.writeUInt8 = BP.writeUInt8; 1039 arr.writeUInt16LE = BP.writeUInt16LE; 1040 arr.writeUInt16BE = BP.writeUInt16BE; 1041 arr.writeUInt32LE = BP.writeUInt32LE; 1042 arr.writeUInt32BE = BP.writeUInt32BE; 1043 arr.writeInt8 = BP.writeInt8; 1044 arr.writeInt16LE = BP.writeInt16LE; 1045 arr.writeInt16BE = BP.writeInt16BE; 1046 arr.writeInt32LE = BP.writeInt32LE; 1047 arr.writeInt32BE = BP.writeInt32BE; 1048 arr.writeFloatLE = BP.writeFloatLE; 1049 arr.writeFloatBE = BP.writeFloatBE; 1050 arr.writeDoubleLE = BP.writeDoubleLE; 1051 arr.writeDoubleBE = BP.writeDoubleBE; 1052 arr.fill = BP.fill; 1053 arr.inspect = BP.inspect; 1054 arr.toArrayBuffer = BP.toArrayBuffer; 1055 1056 return arr; 1057 }; 1058 1059 // slice(start, end) 1060 function clamp(index, len, defaultValue) { 1061 if (typeof index !== 'number') return defaultValue; 1062 index = ~~index; // Coerce to integer. 1063 if (index >= len) return len; 1064 if (index >= 0) return index; 1065 index += len; 1066 if (index >= 0) return index; 1067 return 0; 1068 } 1069 1070 function coerce(length) { 1071 // Coerce length to a number (possibly NaN), round up 1072 // in case it's fractional (e.g. 123.456) then do a 1073 // double negate to coerce a NaN to 0. Easy, right? 1074 length = ~~Math.ceil(+length); 1075 return length < 0 ? 0 : length; 1076 } 1077 1078 function isArray(subject) { 1079 return (Array.isArray || function (subject) { 1080 return Object.prototype.toString.call(subject) === '[object Array]'; 1081 })(subject); 1082 } 1083 1084 function isArrayish(subject) { 1085 return isArray(subject) || Buffer.isBuffer(subject) || subject && (typeof subject === "undefined" ? "undefined" : _typeof(subject)) === 'object' && typeof subject.length === 'number'; 1086 } 1087 1088 function toHex(n) { 1089 if (n < 16) return '0' + n.toString(16); 1090 return n.toString(16); 1091 } 1092 1093 function utf8ToBytes(str) { 1094 var byteArray = []; 1095 for (var i = 0; i < str.length; i++) { 1096 var b = str.charCodeAt(i); 1097 if (b <= 0x7F) byteArray.push(str.charCodeAt(i));else { 1098 var start = i; 1099 if (b >= 0xD800 && b <= 0xDFFF) i++; 1100 var h = encodeURIComponent(str.slice(start, i + 1)).substr(1).split('%'); 1101 for (var j = 0; j < h.length; j++) { 1102 byteArray.push(parseInt(h[j], 16)); 1103 } 1104 } 1105 } 1106 return byteArray; 1107 } 1108 1109 function asciiToBytes(str) { 1110 var byteArray = []; 1111 for (var i = 0; i < str.length; i++) { 1112 // Node's code seems to be doing this and not & 0x7F.. 1113 byteArray.push(str.charCodeAt(i) & 0xFF); 1114 } 1115 return byteArray; 1116 } 1117 1118 function utf16leToBytes(str) { 1119 var c, hi, lo; 1120 var byteArray = []; 1121 for (var i = 0; i < str.length; i++) { 1122 c = str.charCodeAt(i); 1123 hi = c >> 8; 1124 lo = c % 256; 1125 byteArray.push(lo); 1126 byteArray.push(hi); 1127 } 1128 1129 return byteArray; 1130 } 1131 1132 function base64ToBytes(str) { 1133 return base64.toByteArray(str); 1134 } 1135 1136 function blitBuffer(src, dst, offset, length) { 1137 var pos; 1138 for (var i = 0; i < length; i++) { 1139 if (i + offset >= dst.length || i >= src.length) break; 1140 dst[i + offset] = src[i]; 1141 } 1142 return i; 1143 } 1144
1145 function decodeUtf8Char(str) { 1146 try { 1147 return decodeURIComponent(str); 1148 } catch (err) { 1149 return String.fromCharCode(0xFFFD); // UTF 8 invalid char 1150 } 1151 } 1152 1153 /* 1154 * We have to make sure that the value is a valid integer. This means that it 1155 * is non-negative. It has no fractional component and that it does not 1156 * exceed the maximum allowed value. 1157 */ 1158 function verifuint(value, max) { 1159 assert(typeof value === 'number', 'cannot write a non-number as a number'); 1160 assert(value >= 0, 'specified a negative value for writing an unsigned value'); 1161 assert(value <= max, 'value is larger than maximum value for type'); 1162 assert(Math.floor(value) === value, 'value has a fractional component'); 1163 } 1164 1165 function verifsint(value, max, min) { 1166 assert(typeof value === 'number', 'cannot write a non-number as a number'); 1167 assert(value <= max, 'value larger than maximum allowed value'); 1168 assert(value >= min, 'value smaller than minimum allowed value'); 1169 assert(Math.floor(value) === value, 'value has a fractional component'); 1170 } 1171 1172 function verifIEEE754(value, max, min) { 1173 assert(typeof value === 'number', 'cannot write a non-number as a number'); 1174 assert(value <= max, 'value larger than maximum allowed value'); 1175 assert(value >= min, 'value smaller than minimum allowed value'); 1176 } 1177 1178 function assert(test, message) { 1179 if (!test) throw new Error(message || 'Failed assertion'); 1180 } 1181 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/../../node_modules/buffer/index.js", "/../../node_modules/buffer"); 1182 }, { "base64-js": 1, "buffer": 2, "ieee754": 3, "rH1JPG": 4 }], 3: [function (require, module, exports) { 1183 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1184 exports.read = function (buffer, offset, isLE, mLen, nBytes) { 1185 var e, m; 1186 var eLen = nBytes * 8 - mLen - 1; 1187 var eMax = (1 << eLen) - 1; 1188 var eBias = eMax >> 1; 1189 var nBits = -7; 1190 var i = isLE ? nBytes - 1 : 0; 1191 var d = isLE ? -1 : 1; 1192 var s = buffer[offset + i]; 1193 1194 i += d; 1195 1196 e = s & (1 << -nBits) - 1; 1197 s >>= -nBits; 1198 nBits += eLen; 1199 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} 1200 1201 m = e & (1 << -nBits) - 1; 1202 e >>= -nBits; 1203 nBits += mLen; 1204 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} 1205 1206 if (e === 0) { 1207 e = 1 - eBias; 1208 } else if (e === eMax) { 1209 return m ? NaN : (s ? -1 : 1) * Infinity; 1210 } else { 1211 m = m + Math.pow(2, mLen); 1212 e = e - eBias; 1213 } 1214 return (s ? -1 : 1) * m * Math.pow(2, e - mLen); 1215 }; 1216 1217 exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { 1218 var e, m, c; 1219 var eLen = nBytes * 8 - mLen - 1; 1220 var eMax = (1 << eLen) - 1; 1221 var eBias = eMax >> 1; 1222 var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; 1223 var i = isLE ? 0 : nBytes - 1; 1224 var d = isLE ? 1 : -1; 1225 var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; 1226 1227 value = Math.abs(value); 1228 1229 if (isNaN(value) || value === Infinity) { 1230 m = isNaN(value) ? 1 : 0; 1231 e = eMax; 1232 } else { 1233 e = Math.floor(Math.log(value) / Math.LN2); 1234 if (value * (c = Math.pow(2, -e)) < 1) { 1235 e--; 1236 c *= 2; 1237 } 1238 if (e + eBias >= 1) { 1239 value += rt / c; 1240 } else { 1241 value += rt * Math.pow(2, 1 - eBias); 1242 } 1243 if (value * c >= 2) { 1244 e++; 1245 c /= 2; 1246 } 1247 1248 if (e + eBias >= eMax) { 1249 m = 0; 1250 e = eMax; 1251 } else if (e + eBias >= 1) { 1252 m = (value * c - 1) * Math.pow(2, mLen); 1253 e = e + eBias; 1254 } else { 1255 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); 1256 e = 0; 1257 } 1258 } 1259 1260 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} 1261 1262 e = e << mLen | m; 1263 eLen += mLen; 1264 for (; eLen > 0;
1264 buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} 1265 1266 buffer[offset + i - d] |= s * 128; 1267 }; 1268 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/../../node_modules/ieee754/index.js", "/../../node_modules/ieee754"); 1269 }, { "buffer": 2, "rH1JPG": 4 }], 4: [function (require, module, exports) { 1270 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1271 // shim for using process in browser 1272 1273 var process = module.exports = {}; 1274 1275 process.nextTick = function () { 1276 var canSetImmediate = typeof window !== 'undefined' && window.setImmediate; 1277 var canPost = typeof window !== 'undefined' && window.postMessage && window.addEventListener; 1278 1279 if (canSetImmediate) { 1280 return function (f) { 1281 return window.setImmediate(f); 1282 }; 1283 } 1284 1285 if (canPost) { 1286 var queue = []; 1287 window.addEventListener('message', function (ev) { 1288 var source = ev.source; 1289 if ((source === window || source === null) && ev.data === 'process-tick') { 1290 ev.stopPropagation(); 1291 if (queue.length > 0) { 1292 var fn = queue.shift(); 1293 fn(); 1294 } 1295 } 1296 }, true); 1297 1298 return function nextTick(fn) { 1299 queue.push(fn); 1300 window.postMessage('process-tick', '*'); 1301 }; 1302 } 1303 1304 return function nextTick(fn) { 1305 setTimeout(fn, 0); 1306 }; 1307 }(); 1308 1309 process.title = 'browser'; 1310 process.browser = true; 1311 process.env = {}; 1312 process.argv = []; 1313 1314 function noop() {} 1315 1316 process.on = noop; 1317 process.addListener = noop; 1318 process.once = noop; 1319 process.off = noop; 1320 process.removeListener = noop; 1321 process.removeAllListeners = noop; 1322 process.emit = noop; 1323 1324 process.binding = function (name) { 1325 throw new Error('process.binding is not supported'); 1326 }; 1327 1328 // TODO(shtylman) 1329 process.cwd = function () { 1330 return '/'; 1331 }; 1332 process.chdir = function (dir) { 1333 throw new Error('process.chdir is not supported'); 1334 }; 1335 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/../../node_modules/process/browser.js", "/../../node_modules/process"); 1336 }, { "buffer": 2, "rH1JPG": 4 }], 5: [function (require, module, exports) { 1337 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1338 var Util = require('./modules/utils'); 1339 var Theme = require('./modules/theme'); 1340 var InfiniteScroll = require('./modules/infinite-scroll'); 1341 var MobileMenu = require('./modules/mobile-menu'); 1342 var InViewClass = require('./modules/in-view-class'); 1343 var Accordion = require('./modules/accordion'); 1344 var Shortcuts = require('./modules/shortcuts'); 1345 1346 jQuery(document).ready(function ($) { 1347 1348 Util.detectBrowser(); // Adds Browser Version and OS as a class to HTML 1349 1350 Theme.init(); 1351 1352 InifiteScroll.init(); 1353 1354 MobileMenu.init(); 1355 1356 InViewClass.init('.row,.column-item'); 1357 1358 $('[data-accordion]').accordion(); 1359 $('[data-accordion-toggle]').accordionToggle(); 1360 1361 Shortcuts.init(); 1362 }); 1363 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/fake_21eefde7.js", "/"); 1364 }, { "./modules/accordion": 6, "./modules/in-view-class": 7, "./modules/infinite-scroll": 8, "./modules/mobile-menu": 9, "./modules/shortcuts": 10, "./modules/theme": 11, "./modules/utils": 12, "buffer": 2, "rH1JPG": 4 }], 6: [function (require, module, exports) { 1365 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1366 (function ($) { 1367 1368 // Original Accordion 1369 $.fn.accordion = function () { 1370 1371 this.find('.title').on('click', function () { 1372 1373 $(this).parent().find('.body').slideToggle(); 1374 $(this).parent().toggleClass('-open'); 1375 }); 1376 }; 1377 1378 // Toggle Class 1379 $.fn.accordionToggle = function () { 1380 1381 this.find('[data-accordion-id]').on('click', function (e) { 1382 e.preventDefault(); 1383 1384 // Get Id 1385 var id = $(this).data('accordionId'); 1386 1387 // Remove All Active 1388 $(this).parent().parent().find('.-active').removeClass('-active'); 1389 1390 // Set Active 1391 $('[data-accordion-target="' + id + '"]').addClass('-active'); 1392 $(this).addClass('-active'); 1393 setTimeout(function () { 1394 $('[data-accordion-target="' + id + '"] .body-wrap').addClass('-active'); 1395 }, 50); 1396 }); 1397 }; 1398 })(jQuery); 1399 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/modules/accordion.js", "/modules"); 1400 }, { "buffer": 2, "rH1JPG": 4 }
1400], 7: [function (require, module, exports) { 1401 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1402 // ------------------------------------ 1403 // 1404 // In View Class 1405 // 1406 // ------------------------------------ 1407 1408 //posts-loop 1409 (function ($) { 1410 1411 if (typeof window.InViewClass == 'undefined') window.InViewClass = {}; 1412 1413 InViewClass = { 1414 1415 selector: null, 1416 1417 className: 'in-view', 1418 1419 // ------------------------------------ 1420 // Init 1421 // ------------------------------------ 1422 1423 init: function init(selector) { 1424 1425 if (!selector) return; 1426 if ($(selector).length < 1) return; 1427 1428 // Save the selector 1429 this.selector = selector; 1430 1431 // Set Up Scroll 1432 this.scroll(); 1433 1434 // Set Initial State 1435 InViewClass.look(); 1436 }, 1437 1438 // ------------------------------------ 1439 // Scroll 1440 // ------------------------------------ 1441 1442 scroll: function scroll() { 1443 1444 $(window).scroll(function () { 1445 1446 InViewClass.look(); 1447 1448 if ($(window).scrollTop() > 20) { 1449 $('html').addClass('-scrolling'); 1450 } else { 1451 $('html').removeClass('-scrolling'); 1452 } 1453 }); 1454 }, 1455 1456 // ------------------------------------ 1457 // Validate 1458 // ------------------------------------ 1459 1460 look: function look() { 1461 1462 $(InViewClass.selector).each(function () { 1463 1464 if (InViewClass.isVisible($(this)) === true) $(this).addClass(InViewClass.className); 1465 }); 1466 }, 1467 1468 // ------------------------------------ 1469 // Visible 1470 // ------------------------------------ 1471 1472 isVisible: function isVisible($elem) { 1473 1474 var docViewTop = $(window).scrollTop(); 1475 var docViewBottom = docViewTop + $(window).height(); 1476 1477 var elemTop = $elem.offset().top; 1478 var elemBottom = elemTop + $elem.height(); 1479 1480 return elemTop <= docViewBottom; 1481 } 1482 1483 }; 1484 1485 module.exports = InViewClass; 1486 })(jQuery); 1487 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/modules/in-view-class.js", "/modules"); 1488 }, { "buffer": 2, "rH1JPG": 4 }], 8: [function (require, module, exports) { 1489 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1490 // ------------------------------------ 1491 // 1492 // Infinate Scroll 1493 // 1494 // ------------------------------------ 1495 1496 //posts-loop 1497 (function ($) { 1498 1499 if (typeof window.InifiteScroll == 'undefined') window.InifiteScroll = {}; 1500 1501 InifiteScroll = { 1502 1503 ready: false, 1504 1505 button_text: null, 1506 1507 // ------------------------------------ 1508 // Init 1509 // ------------------------------------ 1510 1511 init: function init() { 1512 1513 if ($('.posts-loop').length <= 0) { 1514 return; 1515 } 1516 1517 this.ready = true; 1518 1519 this.setup(); 1520 }, 1521 1522 // ------------------------------------ 1523 // Setup 1524 // ------------------------------------ 1525 1526 setup: function setup() { 1527 console.log("SETUP"); 1528 // Scroll Events 1529 $(document).on('scroll', function (e) { 1530 if (InifiteScroll.ready == true) { 1531 if (InifiteScroll.is_in_view('.posts-loop-pagination')) { 1532 InifiteScroll.ready = false; 1533 InifiteScroll.load($('.pagination-next')); 1534 } 1535 } 1536 }); 1537 1538 // Button Click 1539 $('.pagination-next').on('click', function (e) { 1540 1541 e.preventDefault(); 1542 1543 if (InifiteScroll.ready == true) { 1544 InifiteScroll.load($(this)); 1545 } 1546 }); 1547 }, 1548 1549 // ------------------------------------ 1550 // Load 1551 // ------------------------------------ 1552 1553 load: function load(a) { 1554 1555 if (InifiteScroll.button_text == null) { 1556 InifiteScroll.button_text = a.html(); 1557 } 1558 1559 a.html("Loading..."); 1560 1561 var $posts = $("<div class=\"load-container\"></div>"); 1562 1563 $posts.load(a.attr('href') + " .posts-loop-row", function () { 1564 1565 // Get Parts 1566 var $cards = $posts.find('.card'); 1567 var $next = $posts.find('.pagination-next'); 1568 1569 // Animate In 1570 var i = 0; 1571 $cards.each(function (index) { 1572 1573 var $card = $(this); 1574 $card.addClass('animate-in'); 1575 $card.appendTo('.posts-loop'); 1576 setTimeout(function () { 1577 $card.removeClass('animate-in'); 1578 }, 100 * i); 1579 i++; 1580 }); 1581 1582 // Replace Pagination Link 1583 if ($next.length <= 0) { 1584 a.remove(); 1585 } else { 1586 a.html(InifiteScroll.button_text); 1587 a.attr('href', $next.attr('href')); 1588 } 1589 1590 InifiteScroll.ready = true; 1591 }); 1592 }, 1593 1594 // ------------------------------------
1595 // Is In View 1596 // ------------------------------------ 1597 1598 is_in_view: function is_in_view(elem) { 1599 1600 var $elem = $(elem); 1601 if ($elem.length != 1) { 1602 return; 1603 } 1604 var $window = $(window); 1605 1606 var docViewTop = $window.scrollTop(); 1607 var docViewBottom = docViewTop + $window.height(); 1608 1609 var elemTop = $elem.offset().top; 1610 var elemBottom = elemTop + $elem.height(); 1611 1612 return elemBottom <= docViewBottom && elemTop >= docViewTop; 1613 } 1614 1615 }; 1616 1617 module.exports = InifiteScroll; 1618 })(jQuery); 1619 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/modules/infinite-scroll.js", "/modules"); 1620 }, { "buffer": 2, "rH1JPG": 4 }], 9: [function (require, module, exports) { 1621 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1622 // ---------------------------------- 1623 // 1624 // Mobile Menu Component 1625 // 1626 // ---------------------------------- 1627 1628 (function ($) { 1629 1630 if (typeof window.MobileMenu == 'undefined') window.MobileMenu = {}; 1631 1632 MobileMenu = { 1633 1634 state: 'closed', 1635 1636 // ------------------------------------ 1637 // Init 1638 // ------------------------------------ 1639 1640 init: function init() { 1641 1642 // Open & Close 1643 $('.menu-mobile-handle-container').click(function (e) { 1644 1645 MobileMenu.toggle_menu(); 1646 }); 1647 1648 // Link Click 1649 1650 // $('.menu-mobile .menu-item-has-children > a').click(function(e){ 1651 1652 // var $this = $(this); 1653 1654 // if(!$this.parent().hasClass('open') && !$this.parent().hasClass('no-dropdown')) 1655 // { 1656 // //-- Stop The LInk 1657 // e.preventDefault(); 1658 1659 // //-- Add The Class 1660 // $this.parent().addClass('open'); 1661 1662 // //-- Toggle Submenu 1663 // var $submenu = $this.parent().find('.sub-menu'); 1664 // $submenu.slideToggle(300); 1665 // } else { 1666 1667 // setTimeout(MobileMenu.toggle_menu,1500); 1668 // console.log("CLOSE MENU"); 1669 1670 // } 1671 1672 1673 // }); 1674 1675 // TODO: Close Nav on Link Click. 1676 $('.menu-mobile a').click(function (e) { 1677 1678 var $this = $(this); 1679 if ($this.parent().hasClass('menu-item-has-children')) { 1680 1681 if (!$this.parent().hasClass('open') && !$this.parent().hasClass('no-dropdown')) { 1682 //-- Stop The LInk 1683 e.preventDefault(); 1684 1685 //-- Add The Class 1686 $this.parent().addClass('open'); 1687 1688 //-- Toggle Submenu 1689 var $submenu = $this.parent().find('.sub-menu'); 1690 $submenu.slideToggle(300); 1691 } else { 1692 1693 setTimeout(MobileMenu.toggle_menu, 1500); 1694 console.log("CLOSE MENU"); 1695 } 1696 } else { 1697 1698 setTimeout(MobileMenu.toggle_menu, 1500); 1699 } 1700 console.log("A LINK WAS CLICK"); 1701 }); 1702 }, 1703 1704 // ------------------------------------ 1705 // Toggle Menu 1706 // ------------------------------------ 1707 1708 toggle_menu: function toggle_menu() { 1709 1710 console.log("TOGGLE MENU"); 1711 1712 if (MobileMenu.state == 'closed') { 1713 console.log("OPEN"); 1714 1715 $('.menu-mobile').css('display', 'block'); 1716 1717 setTimeout(function () { 1718 1719 $('nav.mobile').addClass('open'); 1720 $('.menu-mobile').addClass('open'); 1721 $('.top-bar').addClass('open'); 1722 }, 5); 1723 1724 MobileMenu.state = 'open'; 1725 } else { 1726 1727 console.log("CLOSE"); 1728 $('.menu-mobile a').removeClass('on'); 1729 1730 $('nav.mobile').removeClass('open'); 1731 $('.menu-mobile').removeClass('open'); 1732 $('.top-bar').removeClass('open'); 1733 MobileMenu.state = 'closed'; 1734 setTimeout(function () { 1735 $('.menu-mobile').css('display', 'none'); 1736 }, 300); 1737 } 1738 } 1739 }; 1740 1741 module.exports = MobileMenu; 1742 })(jQuery); 1743 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/modules/mobile-menu.js", "/modules"); 1744 }, { "buffer": 2, "rH1JPG": 4 }
1744], 10: [function (require, module, exports) { 1745 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1746 // ------------------------------------ 1747 // 1748 // Shortcuts 1749 // 1750 // ------------------------------------ 1751 1752 //posts-loop 1753 (function ($) { 1754 1755 if (typeof window.Shortcuts == 'undefined') window.Shortcuts = {}; 1756 1757 Shortcuts = { 1758 1759 // ------------------------------------ 1760 // Init 1761 // ------------------------------------ 1762 1763 init: function init() { 1764 1765 // Guard 1766 if ($('.thechurchco-shortcut').length <= 0) return; 1767 1768 $('.row .row-title, .shortcut-trigger').click(function (e) { 1769 1770 // Guard Clicking Children 1771 var $item = $(this); 1772 if (!$item.hasClass('.row')) $item = $(this).closest('.row'); 1773 1774 $item.toggleClass('-open'); 1775 1776 // Scroll To 1777 $('html, body').animate({ scrollTop: $item.offset().top + 'px' }, 'fast'); 1778 }).children().click(function (e) { 1779 return false; 1780 }); 1781 } 1782 1783 }; 1784 1785 module.exports = Shortcuts; 1786 })(jQuery); 1787 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/modules/shortcuts.js", "/modules"); 1788 }, { "buffer": 2, "rH1JPG": 4 }], 11: [function (require, module, exports) { 1789 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1790 // ------------------------------------ 1791 // 1792 // Theme 1793 // 1794 // ------------------------------------ 1795 1796 (function ($) { 1797 1798 if (typeof window.Theme == 'undefined') window.Theme = {}; 1799 1800 Theme = { 1801 1802 settings: {}, 1803 1804 /* 1805 * Theme init 1806 */ 1807 1808 init: function init() { 1809 1810 // Share 1811 // this.share(); 1812 1813 // Header Carousel 1814 this.carouselHeader(); 1815 1816 // Header Video 1817 this.headerVideo(); 1818 1819 // Social Feeds 1820 // this.social(); 1821 1822 // Cookie Policy 1823 this.cookiePolicy(); 1824 }, 1825 1826 // ------------------------------------ 1827 // Header Video 1828 // ------------------------------------ 1829 1830 headerVideo: function headerVideo() { 1831 1832 // Original Removed Video From All Touch Devices 1833 // if($('.touch').length > 0) { 1834 // $('header iframe').remove(); 1835 // $('.header-video').remove(); 1836 // } 1837 1838 // New Let's Admin Decide 1839 if ($('.touch .hide-video-mobile').length > 0) { 1840 $('header iframe').remove(); 1841 $('.header-video').remove(); 1842 } else { 1843 // Hide Youtube Videos 1844 if ($('.touch header iframe').length > 0) { 1845 var src = $('header iframe').attr('src'); 1846 if (src.indexOf('youtube') > -1) { 1847 $('header iframe').remove(); 1848 $('.header-video').remove(); 1849 } 1850 } 1851 } 1852 }, 1853 1854 // ------------------------------------ 1855 // Share JS 1856 // ------------------------------------ 1857 1858 share: function share() { 1859 1860 // Setup 1861 1862 $("a[data-share]").share({ 1863 counts: false 1864 }); 1865 }, 1866 1867 // ------------------------------------ 1868 // Social 1869 // ------------------------------------ 1870 1871 social: function social() { 1872 1873 $('[data-social="instagram"]').socialFeed({ 1874 // callbackSuccess:Theme.instagramFeed, 1875 1876 }); 1877 }, 1878 1879 // ------------------------------------ 1880 // Instagram Feed 1881 // ------------------------------------ 1882 1883 instagramFeed: function instagramFeed(data) { 1884 1885 // alert("Instgram Feed Callback"); 1886 console.log(data); 1887 $element.addClass('-success'); 1888 }, 1889 1890 // ------------------------------------ 1891 // Carousel Header 1892 // ------------------------------------ 1893 1894 // Carousel Header 1895 carouselHeader: function carouselHeader() { 1896 1897 // Simple Carousel
1898 if ($('.header-carousel').length <= 0) return; 1899 1900 var active = 1; 1901 var $items = $('.header-carousel-image'); 1902 1903 setInterval(function () { 1904 1905 $('.header-carousel-image').removeClass('active'); 1906 $('.header-carousel-image').eq(active).addClass('active'); 1907 active++; 1908 1909 if (active >= $items.length) active = 0; 1910 }, 5000); 1911 }, 1912 1913 cookiePolicy: function cookiePolicy() { 1914 1915 // Guard 1916 if (Util.getCookie('cookie_policy_accepted')) return; 1917 1918 // Display Banner 1919 $('.cookie-policy-banner').addClass('-active'); 1920 1921 // Add Clock 1922 $('.cookie-policy-banner .close').on('click', function (e) { 1923 e.preventDefault(); 1924 $('.cookie-policy-banner').removeClass('-active'); 1925 Util.setCookie('cookie_policy_accepted', true, 365); 1926 }); 1927 } 1928 1929 }; 1930 1931 module.exports = Theme; 1932 })(jQuery); 1933 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/modules/theme.js", "/modules"); 1934 }, { "buffer": 2, "rH1JPG": 4 }], 12: [function (require, module, exports) { 1935 (function (process, global, Buffer, __argument0, __argument1, __argument2, __argument3, __filename, __dirname) { 1936 // ------------------------------------ 1937 // 1938 // Utilities 1939 // 1940 // ------------------------------------ 1941 1942 (function ($) { 1943 1944 if (typeof window.Util == 'undefined') window.Util = {}; 1945 1946 Util = { 1947 1948 // ------------------------------------ 1949 // Util Init 1950 // ------------------------------------ 1951 1952 init: function init() { 1953 1954 // console.log('Util::init()'); 1955 1956 }, 1957 1958 // ------------------------------------ 1959 // Check if element exists 1960 // ------------------------------------ 1961 1962 exists: function exists(item) { 1963 1964 return $(item).length > 0 ? true : false; 1965 }, 1966 1967 // ------------------------------------ 1968 // CSS Helpers 1969 // ------------------------------------ 1970 1971 detectBrowser: function detectBrowser() { 1972 1973 // Browser Isn't available anymore 1974 // console.log($.browser,"HERE") 1975 // Firefox 1976 // if ($.browser.mozilla) { $('html').addClass('firefox'); } 1977 // 1978 // // Chrome 1979 // if ($.browser.chrome) { $('html').addClass('chrome'); } 1980 // 1981 // // Safari 1982 // if ($.browser.safari) { $('html').addClass('safari'); } 1983 // 1984 // // IE 1985 // if ($.browser.msie) { $('html').addClass('ie'); } 1986 if (!!navigator.userAgent.match(/Trident\/7\./)) { 1987 $('html').addClass('ie'); 1988 } 1989 1990 // OS 1991 var os = window.navigator.platform.toLowerCase(); 1992
1993 // Windows 1994 if (os.indexOf('win') >= 0) { 1995 $('html').addClass('windows'); 1996 } else if (os.indexOf('mac') >= 0) { 1997 $('html').addClass('mac'); 1998 } 1999 2000 // IOS 2001 if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) { 2002 $('html').addClass('ios'); 2003 } 2004 2005 // IE Version 2006 var ua = window.navigator.userAgent; 2007 var msie = ua.indexOf('MSIE '); 2008 if (msie > 0) { 2009 // IE 10 or older => return version number 2010 var version = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); 2011 $('html').addClass('ie' + version); 2012 } 2013 2014 var trident = ua.indexOf('Trident/'); 2015 if (trident > 0) { 2016 // IE 11 => return version number 2017 var rv = ua.indexOf('rv:'); 2018 var version = parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); 2019 $('html').addClass('ie' + version); 2020 } 2021 2022 var edge = ua.indexOf('Edge/'); 2023 if (edge > 0) { 2024 // Edge (IE 12+) => return version number 2025 var version = parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); 2026 $('html').addClass('ie' + version); 2027 } 2028 }, 2029 2030 // ------------------------------------ 2031 // Get Querystring 2032 // ------------------------------------ 2033 2034 querystring: function querystring() { 2035 2036 var vars = [], 2037 hash; 2038 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); 2039 for (var i = 0; i < hashes.length; i++) { 2040 hash = hashes[i].split('='); 2041 vars.push(hash[0]); 2042 vars[hash[0]] = hash[1]; 2043 } 2044 return vars; 2045 }, 2046 2047 // ------------------------------------ 2048 // Set Cookie 2049 // ------------------------------------ 2050 2051 setCookie: function setCookie(c_name, value, exdays) { 2052 var exdate = new Date(); 2053 exdate.setDate(exdate.getDate() + exdays); 2054 var c_value = escape(value) + (exdays == null ? "" : "; expires=" + exdate.toUTCString() + "; path=/"); 2055 document.cookie = c_name + "=" + c_value; 2056 }, 2057 2058 // ------------------------------------ 2059 // Get Cookie 2060 // ------------------------------------ 2061 2062 getCookie: function getCookie(c_name) { 2063 var i, 2064 x, 2065 y, 2066 ARRcookies = document.cookie.split(";"); 2067 for (i = 0; i < ARRcookies.length; i++) { 2068 x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); 2069 y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); 2070 x = x.replace(/^\s+|\s+$/g, ""); 2071 if (x == c_name) { 2072 return unescape(y); 2073 } 2074 } 2075 } 2076 2077 }; 2078 2079 module.exports = Util; 2080 })(jQuery); 2081 }).call(this, require("rH1JPG"), typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer, arguments[3], arguments[4], arguments[5], arguments[6], "/modules/utils.js", "/modules"); 2082 }, { "buffer": 2, "rH1JPG": 4 }] }, {}, [5]); 2083//# sourceMappingURL=site.js.map
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.