vendor: 5,000 bytes, lines 1-152
1/*! 2 3 handlebars v4.0.5 4 5Copyright (C) 2011-2015 by Yehuda Katz 6 7Permission is hereby granted, free of charge, to any person obtaining a copy 8of this software and associated documentation files (the "Software"), to deal 9in the Software without restriction, including without limitation the rights 10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11copies of the Software, and to permit persons to whom the Software is 12furnished to do so, subject to the following conditions: 13 14The above copyright notice and this permission notice shall be included in 15all copies or substantial portions of the Software. 16 17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23THE SOFTWARE. 24 25@license 26*/ 27(function webpackUniversalModuleDefinition(root, factory) { 28 if (typeof exports === 'object' && typeof module === 'object') 29 module.exports = factory(); 30 else if (typeof define === 'function' && define.amd) 31 define([], factory); 32 else if (typeof exports === 'object') 33 exports["Handlebars"] = factory(); 34 else 35 root["Handlebars"] = factory(); 36})(this, function () { 37 return /******/ (function (modules) { // webpackBootstrap 38 /******/ // The module cache 39 /******/ var installedModules = {}; 40 41 /******/ // The require function 42 /******/ function __webpack_require__(moduleId) { 43 44 /******/ // Check if module is in cache 45 /******/ if (installedModules[moduleId]) 46 /******/ return installedModules[moduleId].exports; 47 48 /******/ // Create a new module (and put it into the cache) 49 /******/ var module = installedModules[moduleId] = { 50 /******/ exports: {}, 51 /******/ id: moduleId, 52 /******/ loaded: false 53 /******/ 54 }; 55 56 /******/ // Execute the module function 57 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 58 59 /******/ // Flag the module as loaded 60 /******/ module.loaded = true; 61 62 /******/ // Return the exports of the module 63 /******/ return module.exports; 64 /******/ 65 } 66 67 68 /******/ // expose the modules object (__webpack_modules__) 69 /******/ __webpack_require__.m = modules; 70 71 /******/ // expose the module cache 72 /******/ __webpack_require__.c = installedModules; 73 74 /******/ // __webpack_public_path__ 75 /******/ __webpack_require__.p = ""; 76 77 /******/ // Load entry module and return exports 78 /******/ return __webpack_require__(0); 79 /******/ 80 }) 81 /************************************************************************/ 82 /******/([ 83 /* 0 */ 84 /***/ function (module, exports, __webpack_require__) { 85 86 'use strict'; 87 88 var _interopRequireDefault = __webpack_require__(1)['default']; 89 90 exports.__esModule = true; 91 92 var _handlebarsRuntime = __webpack_require__(2); 93 94 var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime); 95 96 // Compiler imports 97 98 var _handlebarsCompilerAst = __webpack_require__(21); 99 100 var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst); 101 102 var _handlebarsCompilerBase = __webpack_require__(22); 103 104 var _handlebarsCompilerCompiler = __webpack_require__(27); 105 106 var _handlebarsCompilerJavascriptCompiler = __webpack_require__(28); 107 108 var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler); 109 110 var _handlebarsCompilerVisitor = __webpack_require__(25); 111 112 var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor); 113 114 var _handlebarsNoConflict = __webpack_require__(20); 115 116 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 117 118 var _create = _handlebarsRuntime2['default'].create; 119 function create() { 120 var hb = _create(); 121 122 hb.compile = function (input, options) { 123 return _handlebarsCompilerCompiler.compile(input, options, hb); 124 }; 125 hb.precompile = function (input, options) { 126 return _handlebarsCompilerCompiler.precompile(input, options, hb); 127 }; 128 129 hb.AST = _handlebarsCompilerAst2['default']; 130 hb.Compiler = _handlebarsCompilerCompiler.Compiler; 131 hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default']; 132 hb.Parser = _handlebarsCompilerBase.parser; 133 hb.parse = _handlebarsCompilerBase.parse; 134 135 return hb; 136 } 137 138 var inst = create(); 139 inst.create = create; 140 141 _handlebarsNoConflict2['default'](inst); 142 143 inst.Visitor = _handlebarsCompilerVisitor2['default']; 144 145 inst['default'] = inst; 146 147 exports['default'] = inst; 148 module.exports = exports['default']; 149 150 /***/ 151 }, 152 /* 1 */
vendor: 5,575 bytes, lines 153-369
153 /***/ function (module, exports) { 154 155 "use strict"; 156 157 exports["default"] = function (obj) { 158 return obj && obj.__esModule ? obj : { 159 "default": obj 160 }; 161 }; 162 163 exports.__esModule = true; 164 165 /***/ 166 }, 167 /* 2 */ 168 /***/ function (module, exports, __webpack_require__) { 169 170 'use strict'; 171 172 var _interopRequireWildcard = __webpack_require__(3)['default']; 173 174 var _interopRequireDefault = __webpack_require__(1)['default']; 175 176 exports.__esModule = true; 177 178 var _handlebarsBase = __webpack_require__(4); 179 180 var base = _interopRequireWildcard(_handlebarsBase); 181 182 // Each of these augment the Handlebars object. No need to setup here. 183 // (This is done to easily share code between commonjs and browse envs) 184 185 var _handlebarsSafeString = __webpack_require__(18); 186 187 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); 188 189 var _handlebarsException = __webpack_require__(6); 190 191 var _handlebarsException2 = _interopRequireDefault(_handlebarsException); 192 193 var _handlebarsUtils = __webpack_require__(5); 194 195 var Utils = _interopRequireWildcard(_handlebarsUtils); 196 197 var _handlebarsRuntime = __webpack_require__(19); 198 199 var runtime = _interopRequireWildcard(_handlebarsRuntime); 200 201 var _handlebarsNoConflict = __webpack_require__(20); 202 203 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 204 205 // For compatibility and usage outside of module systems, make the Handlebars object a namespace 206 function create() { 207 var hb = new base.HandlebarsEnvironment(); 208 209 Utils.extend(hb, base); 210 hb.SafeString = _handlebarsSafeString2['default']; 211 hb.Exception = _handlebarsException2['default']; 212 hb.Utils = Utils; 213 hb.escapeExpression = Utils.escapeExpression; 214 215 hb.VM = runtime; 216 hb.template = function (spec) { 217 return runtime.template(spec, hb); 218 }; 219 220 return hb; 221 } 222 223 var inst = create(); 224 inst.create = create; 225 226 _handlebarsNoConflict2['default'](inst); 227 228 inst['default'] = inst; 229 230 exports['default'] = inst; 231 module.exports = exports['default']; 232 233 /***/ 234 }, 235 /* 3 */ 236 /***/ function (module, exports) { 237 238 "use strict"; 239 240 exports["default"] = function (obj) { 241 if (obj && obj.__esModule) { 242 return obj; 243 } else { 244 var newObj = {}; 245 246 if (obj != null) { 247 for (var key in obj) { 248 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 249 } 250 } 251 252 newObj["default"] = obj; 253 return newObj; 254 } 255 }; 256 257 exports.__esModule = true; 258 259 /***/ 260 }, 261 /* 4 */ 262 /***/ function (module, exports, __webpack_require__) { 263 264 'use strict'; 265 266 var _interopRequireDefault = __webpack_require__(1)['default']; 267 268 exports.__esModule = true; 269 exports.HandlebarsEnvironment = HandlebarsEnvironment; 270 271 var _utils = __webpack_require__(5); 272 273 var _exception = __webpack_require__(6); 274 275 var _exception2 = _interopRequireDefault(_exception); 276 277 var _helpers = __webpack_require__(7); 278 279 var _decorators = __webpack_require__(15); 280 281 var _logger = __webpack_require__(17); 282 283 var _logger2 = _interopRequireDefault(_logger); 284 285 var VERSION = '4.0.5'; 286 exports.VERSION = VERSION; 287 var COMPILER_REVISION = 7; 288 289 exports.COMPILER_REVISION = COMPILER_REVISION; 290 var REVISION_CHANGES = { 291 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 292 2: '== 1.0.0-rc.3', 293 3: '== 1.0.0-rc.4', 294 4: '== 1.x.x', 295 5: '== 2.0.0-alpha.x', 296 6: '>= 2.0.0-beta.1', 297 7: '>= 4.0.0' 298 }; 299 300 exports.REVISION_CHANGES = REVISION_CHANGES; 301 var objectType = '[object Object]'; 302 303 function HandlebarsEnvironment(helpers, partials, decorators) { 304 this.helpers = helpers || {}; 305 this.partials = partials || {}; 306 this.decorators = decorators || {}; 307 308 _helpers.registerDefaultHelpers(this); 309 _decorators.registerDefaultDecorators(this); 310 } 311 312 HandlebarsEnvironment.prototype = { 313 constructor: HandlebarsEnvironment, 314 315 logger: _logger2['default'], 316 log: _logger2['default'].log, 317 318 registerHelper: function registerHelper(name, fn) { 319 if (_utils.toString.call(name) === objectType) { 320 if (fn) { 321 throw new _exception2['default']('Arg not supported with multiple helpers'); 322 } 323 _utils.extend(this.helpers, name); 324 } else { 325 this.helpers[name] = fn; 326 } 327 }, 328 unregisterHelper: function unregisterHelper(name) { 329 delete this.helpers[name]; 330 }, 331 332 registerPartial: function registerPartial(name, partial) { 333 if (_utils.toString.call(name) === objectType) { 334 _utils.extend(this.partials, name); 335 } else { 336 if (typeof partial === 'undefined') { 337 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); 338 } 339 this.partials[name] = partial; 340 } 341 }, 342 unregisterPartial: function unregisterPartial(name) { 343 delete this.partials[name]; 344 }, 345 346 registerDecorator: function registerDecorator(name, fn) { 347 if (_utils.toString.call(name) === objectType) { 348 if (fn) { 349 throw new _exception2['default']('Arg not supported with multiple decorators'); 350 } 351 _utils.extend(this.decorators, name); 352 } else { 353 this.decorators[name] = fn; 354 } 355 }, 356 unregisterDecorator: function unregisterDecorator(name) { 357 delete this.decorators[name]; 358 } 359 }; 360 361 var log = _logger2['default'].log; 362 363 exports.log = log; 364 exports.createFrame = _utils.createFrame; 365 exports.logger = _logger2['default']; 366 367 /***/ 368 }, 369 /* 5 */
vendor: 8,352 bytes, lines 370-692
370 /***/ function (module, exports) { 371 372 'use strict'; 373 374 exports.__esModule = true; 375 exports.extend = extend; 376 exports.indexOf = indexOf; 377 exports.escapeExpression = escapeExpression; 378 exports.isEmpty = isEmpty; 379 exports.createFrame = createFrame; 380 exports.blockParams = blockParams; 381 exports.appendContextPath = appendContextPath; 382 var escape = { 383 '&': '&', 384 '<': '<', 385 '>': '>', 386 '"': '"', 387 "'": ''', 388 '`': '`', 389 '=': '=' 390 }; 391 392 var badChars = /[&<>"'`=]/g, 393 possible = /[&<>"'`=]/; 394 395 function escapeChar(chr) { 396 return escape[chr]; 397 } 398 399 function extend(obj /* , ...source */) { 400 for (var i = 1; i < arguments.length; i++) { 401 for (var key in arguments[i]) { 402 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { 403 obj[key] = arguments[i][key]; 404 } 405 } 406 } 407 408 return obj; 409 } 410 411 var toString = Object.prototype.toString; 412 413 exports.toString = toString; 414 // Sourced from lodash 415 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt 416 /* eslint-disable func-style */ 417 var isFunction = function isFunction(value) { 418 return typeof value === 'function'; 419 }; 420 // fallback for older versions of Chrome and Safari 421 /* istanbul ignore next */ 422 if (isFunction(/x/)) { 423 exports.isFunction = isFunction = function (value) { 424 return typeof value === 'function' && toString.call(value) === '[object Function]'; 425 }; 426 } 427 exports.isFunction = isFunction; 428 429 /* eslint-enable func-style */ 430 431 /* istanbul ignore next */ 432 var isArray = Array.isArray || function (value) { 433 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; 434 }; 435 436 exports.isArray = isArray; 437 // Older IE versions do not directly support indexOf so we must implement our own, sadly. 438 439 function indexOf(array, value) { 440 for (var i = 0, len = array.length; i < len; i++) { 441 if (array[i] === value) { 442 return i; 443 } 444 } 445 return -1; 446 } 447 448 function escapeExpression(string) { 449 if (typeof string !== 'string') { 450 // don't escape SafeStrings, since they're already safe 451 if (string && string.toHTML) { 452 return string.toHTML(); 453 } else if (string == null) { 454 return ''; 455 } else if (!string) { 456 return string + ''; 457 } 458 459 // Force a string conversion as this will be done by the append regardless and 460 // the regex test will do this transparently behind the scenes, causing issues if 461 // an object's to string has escaped characters in it. 462 string = '' + string; 463 } 464 465 if (!possible.test(string)) { 466 return string; 467 } 468 return string.replace(badChars, escapeChar); 469 } 470 471 function isEmpty(value) { 472 if (!value && value !== 0) { 473 return true; 474 } else if (isArray(value) && value.length === 0) { 475 return true; 476 } else { 477 return false; 478 } 479 } 480 481 function createFrame(object) { 482 var frame = extend({}, object); 483 frame._parent = object; 484 return frame; 485 } 486 487 function blockParams(params, ids) { 488 params.path = ids; 489 return params; 490 } 491 492 function appendContextPath(contextPath, id) { 493 return (contextPath ? contextPath + '.' : '') + id; 494 } 495 496 /***/ 497 }, 498 /* 6 */ 499 /***/ function (module, exports) { 500 501 'use strict'; 502 503 exports.__esModule = true; 504 505 var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; 506 507 function Exception(message, node) { 508 var loc = node && node.loc, 509 line = undefined, 510 column = undefined; 511 if (loc) { 512 line = loc.start.line; 513 column = loc.start.column; 514 515 message += ' - ' + line + ':' + column; 516 } 517 518 var tmp = Error.prototype.constructor.call(this, message); 519 520 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. 521 for (var idx = 0; idx < errorProps.length; idx++) { 522 this[errorProps[idx]] = tmp[errorProps[idx]]; 523 } 524 525 /* istanbul ignore else */ 526 if (Error.captureStackTrace) { 527 Error.captureStackTrace(this, Exception); 528 } 529 530 if (loc) { 531 this.lineNumber = line; 532 this.column = column; 533 } 534 } 535 536 Exception.prototype = new Error(); 537 538 exports['default'] = Exception; 539 module.exports = exports['default']; 540 541 /***/ 542 }, 543 /* 7 */ 544 /***/ function (module, exports, __webpack_require__) { 545 546 'use strict'; 547 548 var _interopRequireDefault = __webpack_require__(1)['default']; 549 550 exports.__esModule = true; 551 exports.registerDefaultHelpers = registerDefaultHelpers; 552 553 var _helpersBlockHelperMissing = __webpack_require__(8); 554 555 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); 556 557 var _helpersEach = __webpack_require__(9); 558 559 var _helpersEach2 = _interopRequireDefault(_helpersEach); 560 561 var _helpersHelperMissing = __webpack_require__(10); 562 563 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); 564 565 var _helpersIf = __webpack_require__(11); 566 567 var _helpersIf2 = _interopRequireDefault(_helpersIf); 568 569 var _helpersLog = __webpack_require__(12); 570 571 var _helpersLog2 = _interopRequireDefault(_helpersLog); 572 573 var _helpersLookup = __webpack_require__(13); 574 575 var _helpersLookup2 = _interopRequireDefault(_helpersLookup); 576 577 var _helpersWith = __webpack_require__(14); 578 579 var _helpersWith2 = _interopRequireDefault(_helpersWith); 580 581 function registerDefaultHelpers(instance) { 582 _helpersBlockHelperMissing2['default'](instance); 583 _helpersEach2['default'](instance); 584 _helpersHelperMissing2['default'](instance); 585 _helpersIf2['default'](instance); 586 _helpersLog2['default'](instance); 587 _helpersLookup2['default'](instance); 588 _helpersWith2['default'](instance); 589 } 590 591 /***/ 592 }, 593 /* 8 */ 594 /***/ function (module, exports, __webpack_require__) { 595 596 'use strict'; 597 598 exports.__esModule = true; 599 600 var _utils = __webpack_require__(5); 601 602 exports['default'] = function (instance) { 603 instance.registerHelper('blockHelperMissing', function (context, options) { 604 var inverse = options.inverse, 605 fn = options.fn; 606 607 if (context === true) { 608 return fn(this); 609 } else if (context === false || context == null) { 610 return inverse(this); 611 } else if (_utils.isArray(context)) { 612 if (context.length > 0) { 613 if (options.ids) { 614 options.ids = [options.name]; 615 } 616 617 return instance.helpers.each(context, options); 618 } else { 619 return inverse(this); 620 } 621 } else { 622 if (options.data && options.ids) { 623 var data = _utils.createFrame(options.data); 624 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); 625 options = { data: data }; 626 } 627 628 return fn(context, options); 629 } 630 }); 631 }; 632 633 module.exports = exports['default']; 634 635 /***/ 636 }, 637 /* 9 */ 638 /***/ function (module, exports, __webpack_require__) { 639 640 'use strict'; 641 642 var _interopRequireDefault = __webpack_require__(1)['default']; 643 644 exports.__esModule = true; 645 646 var _utils = __webpack_require__(5); 647 648 var _exception = __webpack_require__(6); 649 650 var _exception2 = _interopRequireDefault(_exception); 651 652 exports['default'] = function (instance) { 653 instance.registerHelper('each', function (context, options) { 654 if (!options) { 655 throw new _exception2['default']('Must pass iterator to #each'); 656 } 657 658 var fn = options.fn, 659 inverse = options.inverse, 660 i = 0, 661 ret = '', 662 data = undefined, 663 contextPath = undefined; 664 665 if (options.data && options.ids) { 666 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; 667 } 668 669 if (_utils.isFunction(context)) { 670 context = context.call(this); 671 } 672 673 if (options.data) { 674 data = _utils.createFrame(options.data); 675 } 676 677 function execIteration(field, index, last) { 678 if (data) { 679 data.key = field; 680 data.index = index; 681 data.first = index === 0; 682 data.last = !!last; 683 684 if (contextPath) { 685 data.contextPath = contextPath + field; 686 } 687 } 688 689 ret = ret + fn(context[field], { 690 data: data, 691 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) 692 });
vendor: 4,721 bytes, lines 693-873
693 } 694 695 if (context && typeof context === 'object') { 696 if (_utils.isArray(context)) { 697 for (var j = context.length; i < j; i++) { 698 if (i in context) { 699 execIteration(i, i, i === context.length - 1); 700 } 701 } 702 } else { 703 var priorKey = undefined; 704 705 for (var key in context) { 706 if (context.hasOwnProperty(key)) { 707 // We're running the iterations one step out of sync so we can detect 708 // the last iteration without have to scan the object twice and create 709 // an itermediate keys array. 710 if (priorKey !== undefined) { 711 execIteration(priorKey, i - 1); 712 } 713 priorKey = key; 714 i++; 715 } 716 } 717 if (priorKey !== undefined) { 718 execIteration(priorKey, i - 1, true); 719 } 720 } 721 } 722 723 if (i === 0) { 724 ret = inverse(this); 725 } 726 727 return ret; 728 }); 729 }; 730 731 module.exports = exports['default']; 732 733 /***/ 734 }, 735 /* 10 */ 736 /***/ function (module, exports, __webpack_require__) { 737 738 'use strict'; 739 740 var _interopRequireDefault = __webpack_require__(1)['default']; 741 742 exports.__esModule = true; 743 744 var _exception = __webpack_require__(6); 745 746 var _exception2 = _interopRequireDefault(_exception); 747 748 exports['default'] = function (instance) { 749 instance.registerHelper('helperMissing', function () /* [args, ]options */ { 750 if (arguments.length === 1) { 751 // A missing field in a {{foo}} construct. 752 return undefined; 753 } else { 754 // Someone is actually trying to call something, blow up. 755 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); 756 } 757 }); 758 }; 759 760 module.exports = exports['default']; 761 762 /***/ 763 }, 764 /* 11 */ 765 /***/ function (module, exports, __webpack_require__) { 766 767 'use strict'; 768 769 exports.__esModule = true; 770 771 var _utils = __webpack_require__(5); 772 773 exports['default'] = function (instance) { 774 instance.registerHelper('if', function (conditional, options) { 775 if (_utils.isFunction(conditional)) { 776 conditional = conditional.call(this); 777 } 778 779 // Default behavior is to render the positive path if the value is truthy and not empty. 780 // The `includeZero` option may be set to treat the condtional as purely not empty based on the 781 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. 782 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { 783 return options.inverse(this); 784 } else { 785 return options.fn(this); 786 } 787 }); 788 789 instance.registerHelper('unless', function (conditional, options) { 790 return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); 791 }); 792 }; 793 794 module.exports = exports['default']; 795 796 /***/ 797 }, 798 /* 12 */ 799 /***/ function (module, exports) { 800 801 'use strict'; 802 803 exports.__esModule = true; 804 805 exports['default'] = function (instance) { 806 instance.registerHelper('log', function () /* message, options */ { 807 var args = [undefined], 808 options = arguments[arguments.length - 1]; 809 for (var i = 0; i < arguments.length - 1; i++) { 810 args.push(arguments[i]); 811 } 812 813 var level = 1; 814 if (options.hash.level != null) { 815 level = options.hash.level; 816 } else if (options.data && options.data.level != null) { 817 level = options.data.level; 818 } 819 args[0] = level; 820 821 instance.log.apply(instance, args); 822 }); 823 }; 824 825 module.exports = exports['default']; 826 827 /***/ 828 }, 829 /* 13 */ 830 /***/ function (module, exports) { 831 832 'use strict'; 833 834 exports.__esModule = true; 835 836 exports['default'] = function (instance) { 837 instance.registerHelper('lookup', function (obj, field) { 838 return obj && obj[field]; 839 }); 840 }; 841 842 module.exports = exports['default']; 843 844 /***/ 845 }, 846 /* 14 */ 847 /***/ function (module, exports, __webpack_require__) { 848 849 'use strict'; 850 851 exports.__esModule = true; 852 853 var _utils = __webpack_require__(5); 854 855 exports['default'] = function (instance) { 856 instance.registerHelper('with', function (context, options) { 857 if (_utils.isFunction(context)) { 858 context = context.call(this); 859 } 860 861 var fn = options.fn; 862 863 if (!_utils.isEmpty(context)) { 864 var data = options.data; 865 if (options.data && options.ids) { 866 data = _utils.createFrame(options.data); 867 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); 868 } 869 870 return fn(context, { 871 data: data, 872 blockParams: _utils.blockParams([context], [data && data.contextPath]) 873 });
vendor: 4,494 bytes, lines 874-1045
874 } else { 875 return options.inverse(this); 876 } 877 }); 878 }; 879 880 module.exports = exports['default']; 881 882 /***/ 883 }, 884 /* 15 */ 885 /***/ function (module, exports, __webpack_require__) { 886 887 'use strict'; 888 889 var _interopRequireDefault = __webpack_require__(1)['default']; 890 891 exports.__esModule = true; 892 exports.registerDefaultDecorators = registerDefaultDecorators; 893 894 var _decoratorsInline = __webpack_require__(16); 895 896 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); 897 898 function registerDefaultDecorators(instance) { 899 _decoratorsInline2['default'](instance); 900 } 901 902 /***/ 903 }, 904 /* 16 */ 905 /***/ function (module, exports, __webpack_require__) { 906 907 'use strict'; 908 909 exports.__esModule = true; 910 911 var _utils = __webpack_require__(5); 912 913 exports['default'] = function (instance) { 914 instance.registerDecorator('inline', function (fn, props, container, options) { 915 var ret = fn; 916 if (!props.partials) { 917 props.partials = {}; 918 ret = function (context, options) { 919 // Create a new partials stack frame prior to exec. 920 var original = container.partials; 921 container.partials = _utils.extend({}, original, props.partials); 922 var ret = fn(context, options); 923 container.partials = original; 924 return ret; 925 }; 926 } 927 928 props.partials[options.args[0]] = options.fn; 929 930 return ret; 931 }); 932 }; 933 934 module.exports = exports['default']; 935 936 /***/ 937 }, 938 /* 17 */ 939 /***/ function (module, exports, __webpack_require__) { 940 941 'use strict'; 942 943 exports.__esModule = true; 944 945 var _utils = __webpack_require__(5); 946 947 var logger = { 948 methodMap: ['debug', 'info', 'warn', 'error'], 949 level: 'info', 950 951 // Maps a given level value to the `methodMap` indexes above. 952 lookupLevel: function lookupLevel(level) { 953 if (typeof level === 'string') { 954 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); 955 if (levelMap >= 0) { 956 level = levelMap; 957 } else { 958 level = parseInt(level, 10); 959 } 960 } 961 962 return level; 963 }, 964 965 // Can be overridden in the host environment 966 log: function log(level) { 967 level = logger.lookupLevel(level); 968 969 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { 970 var method = logger.methodMap[level]; 971 if (!console[method]) { 972 // eslint-disable-line no-console 973 method = 'log'; 974 } 975 976 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 977 message[_key - 1] = arguments[_key]; 978 } 979 980 console[method].apply(console, message); // eslint-disable-line no-console 981 } 982 } 983 }; 984 985 exports['default'] = logger; 986 module.exports = exports['default']; 987 988 /***/ 989 }, 990 /* 18 */ 991 /***/ function (module, exports) { 992 993 // Build out our basic SafeString type 994 'use strict'; 995 996 exports.__esModule = true; 997 function SafeString(string) { 998 this.string = string; 999 } 1000 1001 SafeString.prototype.toString = SafeString.prototype.toHTML = function () { 1002 return '' + this.string; 1003 }; 1004 1005 exports['default'] = SafeString; 1006 module.exports = exports['default']; 1007 1008 /***/ 1009 }, 1010 /* 19 */ 1011 /***/ function (module, exports, __webpack_require__) { 1012 1013 'use strict'; 1014 1015 var _interopRequireWildcard = __webpack_require__(3)['default']; 1016 1017 var _interopRequireDefault = __webpack_require__(1)['default']; 1018 1019 exports.__esModule = true; 1020 exports.checkRevision = checkRevision; 1021 exports.template = template; 1022 exports.wrapProgram = wrapProgram; 1023 exports.resolvePartial = resolvePartial; 1024 exports.invokePartial = invokePartial; 1025 exports.noop = noop; 1026 1027 var _utils = __webpack_require__(5); 1028 1029 var Utils = _interopRequireWildcard(_utils); 1030 1031 var _exception = __webpack_require__(6); 1032 1033 var _exception2 = _interopRequireDefault(_exception); 1034 1035 var _base = __webpack_require__(4); 1036 1037 function checkRevision(compilerInfo) { 1038 var compilerRevision = compilerInfo && compilerInfo[0] || 1, 1039 currentRevision = _base.COMPILER_REVISION; 1040 1041 if (compilerRevision !== currentRevision) { 1042 if (compilerRevision < currentRevision) { 1043 var runtimeVersions = _base.REVISION_CHANGES[currentRevision], 1044 compilerVersions = _base.REVISION_CHANGES[compilerRevision]; 1045 throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your prec
vendor: 8,392 bytes, lines 1045-1304
1045ompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); 1046 } else { 1047 // Use the embedded version info since the runtime doesn't know about this revision yet 1048 throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); 1049 } 1050 } 1051 } 1052 1053 function template(templateSpec, env) { 1054 /* istanbul ignore next */ 1055 if (!env) { 1056 throw new _exception2['default']('No environment passed to template'); 1057 } 1058 if (!templateSpec || !templateSpec.main) { 1059 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); 1060 } 1061 1062 templateSpec.main.decorator = templateSpec.main_d; 1063 1064 // Note: Using env.VM references rather than local var references throughout this section to allow 1065 // for external users to override these as psuedo-supported APIs. 1066 env.VM.checkRevision(templateSpec.compiler); 1067 1068 function invokePartialWrapper(partial, context, options) { 1069 if (options.hash) { 1070 context = Utils.extend({}, context, options.hash); 1071 if (options.ids) { 1072 options.ids[0] = true; 1073 } 1074 } 1075 1076 partial = env.VM.resolvePartial.call(this, partial, context, options); 1077 var result = env.VM.invokePartial.call(this, partial, context, options); 1078 1079 if (result == null && env.compile) { 1080 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); 1081 result = options.partials[options.name](context, options); 1082 } 1083 if (result != null) { 1084 if (options.indent) { 1085 var lines = result.split('\n'); 1086 for (var i = 0, l = lines.length; i < l; i++) { 1087 if (!lines[i] && i + 1 === l) { 1088 break; 1089 } 1090 1091 lines[i] = options.indent + lines[i]; 1092 } 1093 result = lines.join('\n'); 1094 } 1095 return result; 1096 } else { 1097 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); 1098 } 1099 } 1100 1101 // Just add water 1102 var container = { 1103 strict: function strict(obj, name) { 1104 if (!(name in obj)) { 1105 throw new _exception2['default']('"' + name + '" not defined in ' + obj); 1106 } 1107 return obj[name]; 1108 }, 1109 lookup: function lookup(depths, name) { 1110 var len = depths.length; 1111 for (var i = 0; i < len; i++) { 1112 if (depths[i] && depths[i][name] != null) { 1113 return depths[i][name]; 1114 } 1115 } 1116 }, 1117 lambda: function lambda(current, context) { 1118 return typeof current === 'function' ? current.call(context) : current; 1119 }, 1120 1121 escapeExpression: Utils.escapeExpression, 1122 invokePartial: invokePartialWrapper, 1123 1124 fn: function fn(i) { 1125 var ret = templateSpec[i]; 1126 ret.decorator = templateSpec[i + '_d']; 1127 return ret; 1128 }, 1129 1130 programs: [], 1131 program: function program(i, data, declaredBlockParams, blockParams, depths) { 1132 var programWrapper = this.programs[i], 1133 fn = this.fn(i); 1134 if (data || depths || blockParams || declaredBlockParams) { 1135 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); 1136 } else if (!programWrapper) { 1137 programWrapper = this.programs[i] = wrapProgram(this, i, fn); 1138 } 1139 return programWrapper; 1140 }, 1141 1142 data: function data(value, depth) { 1143 while (value && depth--) { 1144 value = value._parent; 1145 } 1146 return value; 1147 }, 1148 merge: function merge(param, common) { 1149 var obj = param || common; 1150 1151 if (param && common && param !== common) { 1152 obj = Utils.extend({}, common, param); 1153 } 1154 1155 return obj; 1156 }, 1157 1158 noop: env.VM.noop, 1159 compilerInfo: templateSpec.compiler 1160 }; 1161 1162 function ret(context) { 1163 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 1164 1165 var data = options.data; 1166 1167 ret._setup(options); 1168 if (!options.partial && templateSpec.useData) { 1169 data = initData(context, data); 1170 } 1171 var depths = undefined, 1172 blockParams = templateSpec.useBlockParams ? [] : undefined; 1173 if (templateSpec.useDepths) { 1174 if (options.depths) { 1175 depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths; 1176 } else { 1177 depths = [context]; 1178 } 1179 } 1180 1181 function main(context /*, options*/) { 1182 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); 1183 } 1184 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); 1185 return main(context, options); 1186 } 1187 ret.isTop = true; 1188 1189 ret._setup = function (options) { 1190 if (!options.partial) { 1191 container.helpers = container.merge(options.helpers, env.helpers); 1192 1193 if (templateSpec.usePartial) { 1194 container.partials = container.merge(options.partials, env.partials); 1195 } 1196 if (templateSpec.usePartial || templateSpec.useDecorators) { 1197 container.decorators = container.merge(options.decorators, env.decorators); 1198 } 1199 } else { 1200 container.helpers = options.helpers; 1201 container.partials = options.partials; 1202 container.decorators = options.decorators; 1203 } 1204 }; 1205 1206 ret._child = function (i, data, blockParams, depths) { 1207 if (templateSpec.useBlockParams && !blockParams) { 1208 throw new _exception2['default']('must pass block params'); 1209 } 1210 if (templateSpec.useDepths && !depths) { 1211 throw new _exception2['default']('must pass parent depths'); 1212 } 1213 1214 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); 1215 }; 1216 return ret; 1217 } 1218 1219 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { 1220 function prog(context) { 1221 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 1222 1223 var currentDepths = depths; 1224 if (depths && context !== depths[0]) { 1225 currentDepths = [context].concat(depths); 1226 } 1227 1228 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); 1229 } 1230 1231 prog = executeDecorators(fn, prog, container, depths, data, blockParams); 1232 1233 prog.program = i; 1234 prog.depth = depths ? depths.length : 0; 1235 prog.blockParams = declaredBlockParams || 0; 1236 return prog; 1237 } 1238 1239 function resolvePartial(partial, context, options) { 1240 if (!partial) { 1241 if (options.name === '@partial-block') { 1242 partial = options.data['partial-block']; 1243 } else { 1244 partial = options.partials[options.name]; 1245 } 1246 } else if (!partial.call && !options.name) { 1247 // This is a dynamic partial that returned a string 1248 options.name = partial; 1249 partial = options.partials[partial]; 1250 } 1251 return partial; 1252 } 1253 1254 function invokePartial(partial, context, options) { 1255 options.partial = true; 1256 if (options.ids) { 1257 options.data.contextPath = options.ids[0] || options.data.contextPath; 1258 } 1259 1260 var partialBlock = undefined; 1261 if (options.fn && options.fn !== noop) { 1262 options.data = _base.createFrame(options.data); 1263 partialBlock = options.data['partial-block'] = options.fn; 1264 1265 if (partialBlock.partials) { 1266 options.partials = Utils.extend({}, options.partials, partialBlock.partials); 1267 } 1268 } 1269 1270 if (partial === undefined && partialBlock) { 1271 partial = partialBlock; 1272 } 1273 1274 if (partial === undefined) { 1275 throw new _exception2['default']('The partial ' + options.name + ' could not be found'); 1276 } else if (partial instanceof Function) { 1277 return partial(context, options); 1278 } 1279 } 1280 1281 function noop() { 1282 return ''; 1283 } 1284 1285 function initData(context, data) { 1286 if (!data || !('root' in data)) { 1287 data = data ? _base.createFrame(data) : {}; 1288 data.root = context; 1289 } 1290 return data; 1291 } 1292 1293 function executeDecorators(fn, prog, container, depths, data, blockParams) { 1294 if (fn.decorator) { 1295 var props = {}; 1296 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); 1297 Utils.extend(prog, props); 1298 } 1299 return prog; 1300 } 1301 1302 /***/ 1303 }, 1304 /* 20 */
vendor: 5,272 bytes, lines 1305-1429
1305 /***/ function (module, exports) { 1306 1307 /* WEBPACK VAR INJECTION */(function (global) {/* global window */ 1308 'use strict'; 1309 1310 exports.__esModule = true; 1311 1312 exports['default'] = function (Handlebars) { 1313 /* istanbul ignore next */ 1314 var root = typeof global !== 'undefined' ? global : window, 1315 $Handlebars = root.Handlebars; 1316 /* istanbul ignore next */ 1317 Handlebars.noConflict = function () { 1318 if (root.Handlebars === Handlebars) { 1319 root.Handlebars = $Handlebars; 1320 } 1321 return Handlebars; 1322 }; 1323 }; 1324 1325 module.exports = exports['default']; 1326 /* WEBPACK VAR INJECTION */ 1327 }.call(exports, (function () { return this; }()))) 1328 1329 /***/ 1330 }, 1331 /* 21 */ 1332 /***/ function (module, exports) { 1333 1334 'use strict'; 1335 1336 exports.__esModule = true; 1337 var AST = { 1338 // Public API used to evaluate derived attributes regarding AST nodes 1339 helpers: { 1340 // a mustache is definitely a helper if: 1341 // * it is an eligible helper, and 1342 // * it has at least one parameter or hash segment 1343 helperExpression: function helperExpression(node) { 1344 return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash); 1345 }, 1346 1347 scopedId: function scopedId(path) { 1348 return (/^\.|this\b/.test(path.original) 1349 ); 1350 }, 1351 1352 // an ID is simple if it only has one part, and that part is not 1353 // `..` or `this`. 1354 simpleId: function simpleId(path) { 1355 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; 1356 } 1357 } 1358 }; 1359 1360 // Must be exported as an object rather than the root of the module as the jison lexer 1361 // must modify the object to operate properly. 1362 exports['default'] = AST; 1363 module.exports = exports['default']; 1364 1365 /***/ 1366 }, 1367 /* 22 */ 1368 /***/ function (module, exports, __webpack_require__) { 1369 1370 'use strict'; 1371 1372 var _interopRequireDefault = __webpack_require__(1)['default']; 1373 1374 var _interopRequireWildcard = __webpack_require__(3)['default']; 1375 1376 exports.__esModule = true; 1377 exports.parse = parse; 1378 1379 var _parser = __webpack_require__(23); 1380 1381 var _parser2 = _interopRequireDefault(_parser); 1382 1383 var _whitespaceControl = __webpack_require__(24); 1384 1385 var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl); 1386 1387 var _helpers = __webpack_require__(26); 1388 1389 var Helpers = _interopRequireWildcard(_helpers); 1390 1391 var _utils = __webpack_require__(5); 1392 1393 exports.parser = _parser2['default']; 1394 1395 var yy = {}; 1396 _utils.extend(yy, Helpers); 1397 1398 function parse(input, options) { 1399 // Just return if an already-compiled AST was passed in. 1400 if (input.type === 'Program') { 1401 return input; 1402 } 1403 1404 _parser2['default'].yy = yy; 1405 1406 // Altering the shared object here, but this is ok as parser is a sync operation 1407 yy.locInfo = function (locInfo) { 1408 return new yy.SourceLocation(options && options.srcName, locInfo); 1409 }; 1410 1411 var strip = new _whitespaceControl2['default'](options); 1412 return strip.accept(_parser2['default'].parse(input)); 1413 } 1414 1415 /***/ 1416 }, 1417 /* 23 */ 1418 /***/ function (module, exports) { 1419 1420 /* istanbul ignore next */ 1421 /* Jison generated parser */ 1422 "use strict"; 1423 1424 var handlebars = (function () { 1425 var parser = { 1426 trace: function trace() { }, 1427 yy: {}, 1428 symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 }, 1429 terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT",
vendor: 33,662 bytes, lines 1429-1965
142918: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" }, 1430 productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]], 1431 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$ 1432 /**/) { 1433 1434 var $0 = $$.length - 1; 1435 switch (yystate) { 1436 case 1: 1437 return $$[$0 - 1]; 1438 break; 1439 case 2: 1440 this.$ = yy.prepareProgram($$[$0]); 1441 break; 1442 case 3: 1443 this.$ = $$[$0]; 1444 break; 1445 case 4: 1446 this.$ = $$[$0]; 1447 break; 1448 case 5: 1449 this.$ = $$[$0]; 1450 break; 1451 case 6: 1452 this.$ = $$[$0]; 1453 break; 1454 case 7: 1455 this.$ = $$[$0]; 1456 break; 1457 case 8: 1458 this.$ = $$[$0]; 1459 break; 1460 case 9: 1461 this.$ = { 1462 type: 'CommentStatement', 1463 value: yy.stripComment($$[$0]), 1464 strip: yy.stripFlags($$[$0], $$[$0]), 1465 loc: yy.locInfo(this._$) 1466 }; 1467 1468 break; 1469 case 10: 1470 this.$ = { 1471 type: 'ContentStatement', 1472 original: $$[$0], 1473 value: $$[$0], 1474 loc: yy.locInfo(this._$) 1475 }; 1476 1477 break; 1478 case 11: 1479 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 1480 break; 1481 case 12: 1482 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] }; 1483 break; 1484 case 13: 1485 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$); 1486 break; 1487 case 14: 1488 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$); 1489 break; 1490 case 15: 1491 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 1492 break; 1493 case 16: 1494 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 1495 break; 1496 case 17: 1497 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 1498 break; 1499 case 18: 1500 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] }; 1501 break; 1502 case 19: 1503 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), 1504 program = yy.prepareProgram([inverse], $$[$0 - 1].loc); 1505 program.chained = true; 1506 1507 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true }; 1508 1509 break; 1510 case 20: 1511 this.$ = $$[$0]; 1512 break; 1513 case 21: 1514 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) }; 1515 break; 1516 case 22: 1517 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 1518 break; 1519 case 23: 1520 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 1521 break; 1522 case 24: 1523 this.$ = { 1524 type: 'PartialStatement', 1525 name: $$[$0 - 3], 1526 params: $$[$0 - 2], 1527 hash: $$[$0 - 1], 1528 indent: '', 1529 strip: yy.stripFlags($$[$0 - 4], $$[$0]), 1530 loc: yy.locInfo(this._$) 1531 }; 1532 1533 break; 1534 case 25: 1535 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 1536 break; 1537 case 26: 1538 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) }; 1539 break; 1540 case 27: 1541 this.$ = $$[$0]; 1542 break; 1543 case 28: 1544 this.$ = $$[$0]; 1545 break; 1546 case 29: 1547 this.$ = { 1548 type: 'SubExpression', 1549 path: $$[$0 - 3], 1550 params: $$[$0 - 2], 1551 hash: $$[$0 - 1], 1552 loc: yy.locInfo(this._$) 1553 }; 1554 1555 break; 1556 case 30: 1557 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) }; 1558 break; 1559 case 31: 1560 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) }; 1561 break; 1562 case 32: 1563 this.$ = yy.id($$[$0 - 1]); 1564 break; 1565 case 33: 1566 this.$ = $$[$0]; 1567 break; 1568 case 34: 1569 this.$ = $$[$0]; 1570 break; 1571 case 35: 1572 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) }; 1573 break; 1574 case 36: 1575 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) }; 1576 break; 1577 case 37: 1578 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) }; 1579 break; 1580 case 38: 1581 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) }; 1582 break; 1583 case 39: 1584 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) }; 1585 break; 1586 case 40: 1587 this.$ = $$[$0]; 1588 break; 1589 case 41: 1590 this.$ = $$[$0]; 1591 break; 1592 case 42: 1593 this.$ = yy.preparePath(true, $$[$0], this._$); 1594 break; 1595 case 43: 1596 this.$ = yy.preparePath(false, $$[$0], this._$); 1597 break; 1598 case 44: 1599 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] }); this.$ = $$[$0 - 2]; 1600 break; 1601 case 45: 1602 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }]; 1603 break; 1604 case 46: 1605 this.$ = []; 1606 break; 1607 case 47: 1608 $$[$0 - 1].push($$[$0]); 1609 break; 1610 case 48: 1611 this.$ = [$$[$0]]; 1612 break; 1613 case 49: 1614 $$[$0 - 1].push($$[$0]); 1615 break; 1616 case 50: 1617 this.$ = []; 1618 break; 1619 case 51: 1620 $$[$0 - 1].push($$[$0]); 1621 break; 1622 case 58: 1623 this.$ = []; 1624 break; 1625 case 59: 1626 $$[$0 - 1].push($$[$0]); 1627 break; 1628 case 64: 1629 this.$ = []; 1630 break; 1631 case 65: 1632 $$[$0 - 1].push($$[$0]); 1633 break; 1634 case 70: 1635 this.$ = []; 1636 break; 1637 case 71: 1638 $$[$0 - 1].push($$[$0]); 1639 break; 1640 case 78: 1641 this.$ = []; 1642 break; 1643 case 79: 1644 $$[$0 - 1].push($$[$0]); 1645 break; 1646 case 82: 1647 this.$ = []; 1648 break; 1649 case 83: 1650 $$[$0 - 1].push($$[$0]); 1651 break; 1652 case 86: 1653 this.$ = []; 1654 break; 1655 case 87: 1656 $$[$0 - 1].push($$[$0]); 1657 break; 1658 case 90: 1659 this.$ = []; 1660 break; 1661 case 91: 1662 $$[$0 - 1].push($$[$0]); 1663 break; 1664 case 94: 1665 this.$ = []; 1666 break; 1667 case 95: 1668 $$[$0 - 1].push($$[$0]); 1669 break; 1670 case 98: 1671 this.$ = [$$[$0]]; 1672 break; 1673 case 99: 1674 $$[$0 - 1].push($$[$0]); 1675 break; 1676 case 100: 1677 this.$ = [$$[$0]]; 1678 break; 1679 case 101: 1680 $$[$0 - 1].push($$[$0]); 1681 break; 1682 } 1683 }, 1684 table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }], 1685 defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] }, 1686 parseError: function parseError(str, hash) { 1687 throw new Error(str); 1688 }, 1689 parse: function parse(input) { 1690 var self = this, 1691 stack = [0], 1692 vstack = [null], 1693 lstack = [], 1694 table = this.table, 1695 yytext = "", 1696 yylineno = 0, 1697 yyleng = 0, 1698 recovering = 0, 1699 TERROR = 2, 1700 EOF = 1; 1701 this.lexer.setInput(input); 1702 this.lexer.yy = this.yy; 1703 this.yy.lexer = this.lexer; 1704 this.yy.parser = this; 1705 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; 1706 var yyloc = this.lexer.yylloc; 1707 lstack.push(yyloc); 1708 var ranges = this.lexer.options && this.lexer.options.ranges; 1709 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; 1710 function popStack(n) { 1711 stack.length = stack.length - 2 * n; 1712 vstack.length = vstack.length - n; 1713 lstack.length = lstack.length - n; 1714 } 1715 function lex() { 1716 var token; 1717 token = self.lexer.lex() || 1; 1718 if (typeof token !== "number") { 1719 token = self.symbols_[token] || token; 1720 } 1721 return token; 1722 } 1723 var symbol, 1724 preErrorSymbol, 1725 state, 1726 action, 1727 a, 1728 r, 1729 yyval = {}, 1730 p, 1731 len, 1732 newState, 1733 expected; 1734 while (true) { 1735 state = stack[stack.length - 1]; 1736 if (this.defaultActions[state]) { 1737 action = this.defaultActions[state]; 1738 } else { 1739 if (symbol === null || typeof symbol == "undefined") { 1740 symbol = lex(); 1741 } 1742 action = table[state] && table[state][symbol]; 1743 } 1744 if (typeof action === "undefined" || !action.length || !action[0]) { 1745 var errStr = ""; 1746 if (!recovering) { 1747 expected = []; 1748 for (p in table[state]) if (this.terminals_[p] && p > 2) { 1749 expected.push("'" + this.terminals_[p] + "'"); 1750 } 1751 if (this.lexer.showPosition) { 1752 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; 1753 } else { 1754 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); 1755 } 1756 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); 1757 } 1758 } 1759 if (action[0] instanceof Array && action.length > 1) { 1760 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); 1761 } 1762 switch (action[0]) { 1763 case 1: 1764 stack.push(symbol); 1765 vstack.push(this.lexer.yytext); 1766 lstack.push(this.lexer.yylloc); 1767 stack.push(action[1]); 1768 symbol = null; 1769 if (!preErrorSymbol) { 1770 yyleng = this.lexer.yyleng; 1771 yytext = this.lexer.yytext; 1772 yylineno = this.lexer.yylineno; 1773 yyloc = this.lexer.yylloc; 1774 if (recovering > 0) recovering--; 1775 } else { 1776 symbol = preErrorSymbol; 1777 preErrorSymbol = null; 1778 } 1779 break; 1780 case 2: 1781 len = this.productions_[action[1]][1]; 1782 yyval.$ = vstack[vstack.length - len]; 1783 yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; 1784 if (ranges) { 1785 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; 1786 } 1787 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); 1788 if (typeof r !== "undefined") { 1789 return r; 1790 } 1791 if (len) { 1792 stack = stack.slice(0, -1 * len * 2); 1793 vstack = vstack.slice(0, -1 * len); 1794 lstack = lstack.slice(0, -1 * len); 1795 } 1796 stack.push(this.productions_[action[1]][0]); 1797 vstack.push(yyval.$); 1798 lstack.push(yyval._$); 1799 newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; 1800 stack.push(newState); 1801 break; 1802 case 3: 1803 return true; 1804 } 1805 } 1806 return true; 1807 } 1808 }; 1809 /* Jison generated lexer */ 1810 var lexer = (function () { 1811 var lexer = { 1812 EOF: 1, 1813 parseError: function parseError(str, hash) { 1814 if (this.yy.parser) { 1815 this.yy.parser.parseError(str, hash); 1816 } else { 1817 throw new Error(str); 1818 } 1819 }, 1820 setInput: function setInput(input) { 1821 this._input = input; 1822 this._more = this._less = this.done = false; 1823 this.yylineno = this.yyleng = 0; 1824 this.yytext = this.matched = this.match = ''; 1825 this.conditionStack = ['INITIAL']; 1826 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; 1827 if (this.options.ranges) this.yylloc.range = [0, 0]; 1828 this.offset = 0; 1829 return this; 1830 }, 1831 input: function input() { 1832 var ch = this._input[0]; 1833 this.yytext += ch; 1834 this.yyleng++; 1835 this.offset++; 1836 this.match += ch; 1837 this.matched += ch; 1838 var lines = ch.match(/(?:\r\n?|\n).*/g); 1839 if (lines) { 1840 this.yylineno++; 1841 this.yylloc.last_line++; 1842 } else { 1843 this.yylloc.last_column++; 1844 } 1845 if (this.options.ranges) this.yylloc.range[1]++; 1846 1847 this._input = this._input.slice(1); 1848 return ch; 1849 }, 1850 unput: function unput(ch) { 1851 var len = ch.length; 1852 var lines = ch.split(/(?:\r\n?|\n)/g); 1853 1854 this._input = ch + this._input; 1855 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); 1856 //this.yyleng -= len; 1857 this.offset -= len; 1858 var oldLines = this.match.split(/(?:\r\n?|\n)/g); 1859 this.match = this.match.substr(0, this.match.length - 1); 1860 this.matched = this.matched.substr(0, this.matched.length - 1); 1861 1862 if (lines.length - 1) this.yylineno -= lines.length - 1; 1863 var r = this.yylloc.range; 1864 1865 this.yylloc = { 1866 first_line: this.yylloc.first_line, 1867 last_line: this.yylineno + 1, 1868 first_column: this.yylloc.first_column, 1869 last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len 1870 }; 1871 1872 if (this.options.ranges) { 1873 this.yylloc.range = [r[0], r[0] + this.yyleng - len]; 1874 } 1875 return this; 1876 }, 1877 more: function more() { 1878 this._more = true; 1879 return this; 1880 }, 1881 less: function less(n) { 1882 this.unput(this.match.slice(n)); 1883 }, 1884 pastInput: function pastInput() { 1885 var past = this.matched.substr(0, this.matched.length - this.match.length); 1886 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, ""); 1887 }, 1888 upcomingInput: function upcomingInput() { 1889 var next = this.match; 1890 if (next.length < 20) { 1891 next += this._input.substr(0, 20 - next.length); 1892 } 1893 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); 1894 }, 1895 showPosition: function showPosition() { 1896 var pre = this.pastInput(); 1897 var c = new Array(pre.length + 1).join("-"); 1898 return pre + this.upcomingInput() + "\n" + c + "^"; 1899 }, 1900 next: function next() { 1901 if (this.done) { 1902 return this.EOF; 1903 } 1904 if (!this._input) this.done = true; 1905 1906 var token, match, tempMatch, index, col, lines; 1907 if (!this._more) { 1908 this.yytext = ''; 1909 this.match = ''; 1910 } 1911 var rules = this._currentRules(); 1912 for (var i = 0; i < rules.length; i++) { 1913 tempMatch = this._input.match(this.rules[rules[i]]); 1914 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { 1915 match = tempMatch; 1916 index = i; 1917 if (!this.options.flex) break; 1918 } 1919 } 1920 if (match) { 1921 lines = match[0].match(/(?:\r\n?|\n).*/g); 1922 if (lines) this.yylineno += lines.length; 1923 this.yylloc = { 1924 first_line: this.yylloc.last_line, 1925 last_line: this.yylineno + 1, 1926 first_column: this.yylloc.last_column, 1927 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length 1928 }; 1929 this.yytext += match[0]; 1930 this.match += match[0]; 1931 this.matches = match; 1932 this.yyleng = this.yytext.length; 1933 if (this.options.ranges) { 1934 this.yylloc.range = [this.offset, this.offset += this.yyleng]; 1935 } 1936 this._more = false; 1937 this._input = this._input.slice(match[0].length); 1938 this.matched += match[0]; 1939 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); 1940 if (this.done && this._input) this.done = false; 1941 if (token) return token; else return; 1942 } 1943 if (this._input === "") { 1944 return this.EOF; 1945 } else { 1946 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); 1947 } 1948 }, 1949 lex: function lex() { 1950 var r = this.next(); 1951 if (typeof r !== 'undefined') { 1952 return r; 1953 } else { 1954 return this.lex(); 1955 } 1956 }, 1957 begin: function begin(condition) { 1958 this.conditionStack.push(condition); 1959 }, 1960 popState: function popState() { 1961 return this.conditionStack.pop(); 1962 }, 1963 _currentRules: function _currentRules() { 1964 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; 1965 },
vendor: 6,331 bytes, lines 1966-2188
1966 topState: function topState() { 1967 return this.conditionStack[this.conditionStack.length - 2]; 1968 }, 1969 pushState: function begin(condition) { 1970 this.begin(condition); 1971 } 1972 }; 1973 lexer.options = {}; 1974 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START 1975 /**/) { 1976 1977 function strip(start, end) { 1978 return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end); 1979 } 1980 1981 var YYSTATE = YY_START; 1982 switch ($avoiding_name_collisions) { 1983 case 0: 1984 if (yy_.yytext.slice(-2) === "\\\\") { 1985 strip(0, 1); 1986 this.begin("mu"); 1987 } else if (yy_.yytext.slice(-1) === "\\") { 1988 strip(0, 1); 1989 this.begin("emu"); 1990 } else { 1991 this.begin("mu"); 1992 } 1993 if (yy_.yytext) return 15; 1994 1995 break; 1996 case 1: 1997 return 15; 1998 break; 1999 case 2: 2000 this.popState(); 2001 return 15; 2002 2003 break; 2004 case 3: 2005 this.begin('raw'); return 15; 2006 break; 2007 case 4: 2008 this.popState(); 2009 // Should be using `this.topState()` below, but it currently 2010 // returns the second top instead of the first top. Opened an 2011 // issue about it at https://github.com/zaach/jison/issues/291 2012 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') { 2013 return 15; 2014 } else { 2015 yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9); 2016 return 'END_RAW_BLOCK'; 2017 } 2018 2019 break; 2020 case 5: 2021 return 15; 2022 break; 2023 case 6: 2024 this.popState(); 2025 return 14; 2026 2027 break; 2028 case 7: 2029 return 65; 2030 break; 2031 case 8: 2032 return 68; 2033 break; 2034 case 9: 2035 return 19; 2036 break; 2037 case 10: 2038 this.popState(); 2039 this.begin('raw'); 2040 return 23; 2041 2042 break; 2043 case 11: 2044 return 55; 2045 break; 2046 case 12: 2047 return 60; 2048 break; 2049 case 13: 2050 return 29; 2051 break; 2052 case 14: 2053 return 47; 2054 break; 2055 case 15: 2056 this.popState(); return 44; 2057 break; 2058 case 16: 2059 this.popState(); return 44; 2060 break; 2061 case 17: 2062 return 34; 2063 break; 2064 case 18: 2065 return 39; 2066 break; 2067 case 19: 2068 return 51; 2069 break; 2070 case 20: 2071 return 48; 2072 break; 2073 case 21: 2074 this.unput(yy_.yytext); 2075 this.popState(); 2076 this.begin('com'); 2077 2078 break; 2079 case 22: 2080 this.popState(); 2081 return 14; 2082 2083 break; 2084 case 23: 2085 return 48; 2086 break; 2087 case 24: 2088 return 73; 2089 break; 2090 case 25: 2091 return 72; 2092 break; 2093 case 26: 2094 return 72; 2095 break; 2096 case 27: 2097 return 87; 2098 break; 2099 case 28: 2100 // ignore whitespace 2101 break; 2102 case 29: 2103 this.popState(); return 54; 2104 break; 2105 case 30: 2106 this.popState(); return 33; 2107 break; 2108 case 31: 2109 yy_.yytext = strip(1, 2).replace(/\\"/g, '"'); return 80; 2110 break; 2111 case 32: 2112 yy_.yytext = strip(1, 2).replace(/\\'/g, "'"); return 80; 2113 break; 2114 case 33: 2115 return 85; 2116 break; 2117 case 34: 2118 return 82; 2119 break; 2120 case 35: 2121 return 82; 2122 break; 2123 case 36: 2124 return 83; 2125 break; 2126 case 37: 2127 return 84; 2128 break; 2129 case 38: 2130 return 81; 2131 break; 2132 case 39: 2133 return 75; 2134 break; 2135 case 40: 2136 return 77; 2137 break; 2138 case 41: 2139 return 72; 2140 break; 2141 case 42: 2142 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1'); return 72; 2143 break; 2144 case 43: 2145 return 'INVALID'; 2146 break; 2147 case 44: 2148 return 5; 2149 break; 2150 } 2151 }; 2152 lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/]; 2153 lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } }; 2154 return lexer; 2155 })(); 2156 parser.lexer = lexer; 2157 function Parser() { 2158 this.yy = {}; 2159 } Parser.prototype = parser; parser.Parser = Parser; 2160 return new Parser(); 2161 })(); exports.__esModule = true; 2162 exports['default'] = handlebars; 2163 2164 /***/ 2165 }, 2166 /* 24 */ 2167 /***/ function (module, exports, __webpack_require__) { 2168 2169 'use strict'; 2170 2171 var _interopRequireDefault = __webpack_require__(1)['default']; 2172 2173 exports.__esModule = true; 2174 2175 var _visitor = __webpack_require__(25); 2176 2177 var _visitor2 = _interopRequireDefault(_visitor); 2178 2179 function WhitespaceControl() { 2180 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; 2181 2182 this.options = options; 2183 } 2184 WhitespaceControl.prototype = new _visitor2['default'](); 2185 2186 WhitespaceControl.prototype.Program = function (program) { 2187 var doStandalone = !this.options.ignoreStandalone; 2188
vendor: 5,058 bytes, lines 2189-2356
2189 var isRoot = !this.isRootSeen; 2190 this.isRootSeen = true; 2191 2192 var body = program.body; 2193 for (var i = 0, l = body.length; i < l; i++) { 2194 var current = body[i], 2195 strip = this.accept(current); 2196 2197 if (!strip) { 2198 continue; 2199 } 2200 2201 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), 2202 _isNextWhitespace = isNextWhitespace(body, i, isRoot), 2203 openStandalone = strip.openStandalone && _isPrevWhitespace, 2204 closeStandalone = strip.closeStandalone && _isNextWhitespace, 2205 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; 2206 2207 if (strip.close) { 2208 omitRight(body, i, true); 2209 } 2210 if (strip.open) { 2211 omitLeft(body, i, true); 2212 } 2213 2214 if (doStandalone && inlineStandalone) { 2215 omitRight(body, i); 2216 2217 if (omitLeft(body, i)) { 2218 // If we are on a standalone node, save the indent info for partials 2219 if (current.type === 'PartialStatement') { 2220 // Pull out the whitespace from the final line 2221 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; 2222 } 2223 } 2224 } 2225 if (doStandalone && openStandalone) { 2226 omitRight((current.program || current.inverse).body); 2227 2228 // Strip out the previous content node if it's whitespace only 2229 omitLeft(body, i); 2230 } 2231 if (doStandalone && closeStandalone) { 2232 // Always strip the next node 2233 omitRight(body, i); 2234 2235 omitLeft((current.inverse || current.program).body); 2236 } 2237 } 2238 2239 return program; 2240 }; 2241 2242 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) { 2243 this.accept(block.program); 2244 this.accept(block.inverse); 2245 2246 // Find the inverse program that is involed with whitespace stripping. 2247 var program = block.program || block.inverse, 2248 inverse = block.program && block.inverse, 2249 firstInverse = inverse, 2250 lastInverse = inverse; 2251 2252 if (inverse && inverse.chained) { 2253 firstInverse = inverse.body[0].program; 2254 2255 // Walk the inverse chain to find the last inverse that is actually in the chain. 2256 while (lastInverse.chained) { 2257 lastInverse = lastInverse.body[lastInverse.body.length - 1].program; 2258 } 2259 } 2260 2261 var strip = { 2262 open: block.openStrip.open, 2263 close: block.closeStrip.close, 2264 2265 // Determine the standalone candiacy. Basically flag our content as being possibly standalone 2266 // so our parent can determine if we actually are standalone 2267 openStandalone: isNextWhitespace(program.body), 2268 closeStandalone: isPrevWhitespace((firstInverse || program).body) 2269 }; 2270 2271 if (block.openStrip.close) { 2272 omitRight(program.body, null, true); 2273 } 2274 2275 if (inverse) { 2276 var inverseStrip = block.inverseStrip; 2277 2278 if (inverseStrip.open) { 2279 omitLeft(program.body, null, true); 2280 } 2281 2282 if (inverseStrip.close) { 2283 omitRight(firstInverse.body, null, true); 2284 } 2285 if (block.closeStrip.open) { 2286 omitLeft(lastInverse.body, null, true); 2287 } 2288 2289 // Find standalone else statments 2290 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { 2291 omitLeft(program.body); 2292 omitRight(firstInverse.body); 2293 } 2294 } else if (block.closeStrip.open) { 2295 omitLeft(program.body, null, true); 2296 } 2297 2298 return strip; 2299 }; 2300 2301 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) { 2302 return mustache.strip; 2303 }; 2304 2305 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { 2306 /* istanbul ignore next */ 2307 var strip = node.strip || {}; 2308 return { 2309 inlineStandalone: true, 2310 open: strip.open, 2311 close: strip.close 2312 }; 2313 }; 2314 2315 function isPrevWhitespace(body, i, isRoot) { 2316 if (i === undefined) { 2317 i = body.length; 2318 } 2319 2320 // Nodes that end with newlines are considered whitespace (but are special 2321 // cased for strip operations) 2322 var prev = body[i - 1], 2323 sibling = body[i - 2]; 2324 if (!prev) { 2325 return isRoot; 2326 } 2327 2328 if (prev.type === 'ContentStatement') { 2329 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); 2330 } 2331 } 2332 function isNextWhitespace(body, i, isRoot) { 2333 if (i === undefined) { 2334 i = -1; 2335 } 2336 2337 var next = body[i + 1], 2338 sibling = body[i + 2]; 2339 if (!next) { 2340 return isRoot; 2341 } 2342 2343 if (next.type === 'ContentStatement') { 2344 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); 2345 } 2346 } 2347 2348 // Marks the node to the right of the position as omitted. 2349 // I.e. {{foo}}' ' will mark the ' ' node as omitted. 2350 // 2351 // If i is undefined, then the first child will be marked as such. 2352 // 2353 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 2354 // content is met. 2355 function omitRight(body, i, multiple) { 2356 var current = body[i == null ? 0 : i + 1];
vendor: 14,761 bytes, lines 2357-2909
2357 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { 2358 return; 2359 } 2360 2361 var original = current.value; 2362 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); 2363 current.rightStripped = current.value !== original; 2364 } 2365 2366 // Marks the node to the left of the position as omitted. 2367 // I.e. ' '{{foo}} will mark the ' ' node as omitted. 2368 // 2369 // If i is undefined then the last child will be marked as such. 2370 // 2371 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 2372 // content is met. 2373 function omitLeft(body, i, multiple) { 2374 var current = body[i == null ? body.length - 1 : i - 1]; 2375 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { 2376 return; 2377 } 2378 2379 // We omit the last node if it's whitespace only and not preceeded by a non-content node. 2380 var original = current.value; 2381 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); 2382 current.leftStripped = current.value !== original; 2383 return current.leftStripped; 2384 } 2385 2386 exports['default'] = WhitespaceControl; 2387 module.exports = exports['default']; 2388 2389 /***/ 2390 }, 2391 /* 25 */ 2392 /***/ function (module, exports, __webpack_require__) { 2393 2394 'use strict'; 2395 2396 var _interopRequireDefault = __webpack_require__(1)['default']; 2397 2398 exports.__esModule = true; 2399 2400 var _exception = __webpack_require__(6); 2401 2402 var _exception2 = _interopRequireDefault(_exception); 2403 2404 function Visitor() { 2405 this.parents = []; 2406 } 2407 2408 Visitor.prototype = { 2409 constructor: Visitor, 2410 mutating: false, 2411 2412 // Visits a given value. If mutating, will replace the value if necessary. 2413 acceptKey: function acceptKey(node, name) { 2414 var value = this.accept(node[name]); 2415 if (this.mutating) { 2416 // Hacky sanity check: This may have a few false positives for type for the helper 2417 // methods but will generally do the right thing without a lot of overhead. 2418 if (value && !Visitor.prototype[value.type]) { 2419 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); 2420 } 2421 node[name] = value; 2422 } 2423 }, 2424 2425 // Performs an accept operation with added sanity check to ensure 2426 // required keys are not removed. 2427 acceptRequired: function acceptRequired(node, name) { 2428 this.acceptKey(node, name); 2429 2430 if (!node[name]) { 2431 throw new _exception2['default'](node.type + ' requires ' + name); 2432 } 2433 }, 2434 2435 // Traverses a given array. If mutating, empty respnses will be removed 2436 // for child elements. 2437 acceptArray: function acceptArray(array) { 2438 for (var i = 0, l = array.length; i < l; i++) { 2439 this.acceptKey(array, i); 2440 2441 if (!array[i]) { 2442 array.splice(i, 1); 2443 i--; 2444 l--; 2445 } 2446 } 2447 }, 2448 2449 accept: function accept(object) { 2450 if (!object) { 2451 return; 2452 } 2453 2454 /* istanbul ignore next: Sanity code */ 2455 if (!this[object.type]) { 2456 throw new _exception2['default']('Unknown type: ' + object.type, object); 2457 } 2458 2459 if (this.current) { 2460 this.parents.unshift(this.current); 2461 } 2462 this.current = object; 2463 2464 var ret = this[object.type](object); 2465 2466 this.current = this.parents.shift(); 2467 2468 if (!this.mutating || ret) { 2469 return ret; 2470 } else if (ret !== false) { 2471 return object; 2472 } 2473 }, 2474 2475 Program: function Program(program) { 2476 this.acceptArray(program.body); 2477 }, 2478 2479 MustacheStatement: visitSubExpression, 2480 Decorator: visitSubExpression, 2481 2482 BlockStatement: visitBlock, 2483 DecoratorBlock: visitBlock, 2484 2485 PartialStatement: visitPartial, 2486 PartialBlockStatement: function PartialBlockStatement(partial) { 2487 visitPartial.call(this, partial); 2488 2489 this.acceptKey(partial, 'program'); 2490 }, 2491 2492 ContentStatement: function ContentStatement() /* content */ { }, 2493 CommentStatement: function CommentStatement() /* comment */ { }, 2494 2495 SubExpression: visitSubExpression, 2496 2497 PathExpression: function PathExpression() /* path */ { }, 2498 2499 StringLiteral: function StringLiteral() /* string */ { }, 2500 NumberLiteral: function NumberLiteral() /* number */ { }, 2501 BooleanLiteral: function BooleanLiteral() /* bool */ { }, 2502 UndefinedLiteral: function UndefinedLiteral() /* literal */ { }, 2503 NullLiteral: function NullLiteral() /* literal */ { }, 2504 2505 Hash: function Hash(hash) { 2506 this.acceptArray(hash.pairs); 2507 }, 2508 HashPair: function HashPair(pair) { 2509 this.acceptRequired(pair, 'value'); 2510 } 2511 }; 2512 2513 function visitSubExpression(mustache) { 2514 this.acceptRequired(mustache, 'path'); 2515 this.acceptArray(mustache.params); 2516 this.acceptKey(mustache, 'hash'); 2517 } 2518 function visitBlock(block) { 2519 visitSubExpression.call(this, block); 2520 2521 this.acceptKey(block, 'program'); 2522 this.acceptKey(block, 'inverse'); 2523 } 2524 function visitPartial(partial) { 2525 this.acceptRequired(partial, 'name'); 2526 this.acceptArray(partial.params); 2527 this.acceptKey(partial, 'hash'); 2528 } 2529 2530 exports['default'] = Visitor; 2531 module.exports = exports['default']; 2532 2533 /***/ 2534 }, 2535 /* 26 */ 2536 /***/ function (module, exports, __webpack_require__) { 2537 2538 'use strict'; 2539 2540 var _interopRequireDefault = __webpack_require__(1)['default']; 2541 2542 exports.__esModule = true; 2543 exports.SourceLocation = SourceLocation; 2544 exports.id = id; 2545 exports.stripFlags = stripFlags; 2546 exports.stripComment = stripComment; 2547 exports.preparePath = preparePath; 2548 exports.prepareMustache = prepareMustache; 2549 exports.prepareRawBlock = prepareRawBlock; 2550 exports.prepareBlock = prepareBlock; 2551 exports.prepareProgram = prepareProgram; 2552 exports.preparePartialBlock = preparePartialBlock; 2553 2554 var _exception = __webpack_require__(6); 2555 2556 var _exception2 = _interopRequireDefault(_exception); 2557 2558 function validateClose(open, close) { 2559 close = close.path ? close.path.original : close; 2560 2561 if (open.path.original !== close) { 2562 var errorNode = { loc: open.path.loc }; 2563 2564 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode); 2565 } 2566 } 2567 2568 function SourceLocation(source, locInfo) { 2569 this.source = source; 2570 this.start = { 2571 line: locInfo.first_line, 2572 column: locInfo.first_column 2573 }; 2574 this.end = { 2575 line: locInfo.last_line, 2576 column: locInfo.last_column 2577 }; 2578 } 2579 2580 function id(token) { 2581 if (/^\[.*\]$/.test(token)) { 2582 return token.substr(1, token.length - 2); 2583 } else { 2584 return token; 2585 } 2586 } 2587 2588 function stripFlags(open, close) { 2589 return { 2590 open: open.charAt(2) === '~', 2591 close: close.charAt(close.length - 3) === '~' 2592 }; 2593 } 2594 2595 function stripComment(comment) { 2596 return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, ''); 2597 } 2598 2599 function preparePath(data, parts, loc) { 2600 loc = this.locInfo(loc); 2601 2602 var original = data ? '@' : '', 2603 dig = [], 2604 depth = 0, 2605 depthString = ''; 2606 2607 for (var i = 0, l = parts.length; i < l; i++) { 2608 var part = parts[i].part, 2609 2610 // If we have [] syntax then we do not treat path references as operators, 2611 // i.e. foo.[this] resolves to approximately context.foo['this'] 2612 isLiteral = parts[i].original !== part; 2613 original += (parts[i].separator || '') + part; 2614 2615 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { 2616 if (dig.length > 0) { 2617 throw new _exception2['default']('Invalid path: ' + original, { loc: loc }); 2618 } else if (part === '..') { 2619 depth++; 2620 depthString += '../'; 2621 } 2622 } else { 2623 dig.push(part); 2624 } 2625 } 2626 2627 return { 2628 type: 'PathExpression', 2629 data: data, 2630 depth: depth, 2631 parts: dig, 2632 original: original, 2633 loc: loc 2634 }; 2635 } 2636 2637 function prepareMustache(path, params, hash, open, strip, locInfo) { 2638 // Must use charAt to support IE pre-10 2639 var escapeFlag = open.charAt(3) || open.charAt(2), 2640 escaped = escapeFlag !== '{' && escapeFlag !== '&'; 2641 2642 var decorator = /\*/.test(open); 2643 return { 2644 type: decorator ? 'Decorator' : 'MustacheStatement', 2645 path: path, 2646 params: params, 2647 hash: hash, 2648 escaped: escaped, 2649 strip: strip, 2650 loc: this.locInfo(locInfo) 2651 }; 2652 } 2653 2654 function prepareRawBlock(openRawBlock, contents, close, locInfo) { 2655 validateClose(openRawBlock, close); 2656 2657 locInfo = this.locInfo(locInfo); 2658 var program = { 2659 type: 'Program', 2660 body: contents, 2661 strip: {}, 2662 loc: locInfo 2663 }; 2664 2665 return { 2666 type: 'BlockStatement', 2667 path: openRawBlock.path, 2668 params: openRawBlock.params, 2669 hash: openRawBlock.hash, 2670 program: program, 2671 openStrip: {}, 2672 inverseStrip: {}, 2673 closeStrip: {}, 2674 loc: locInfo 2675 }; 2676 } 2677 2678 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { 2679 if (close && close.path) { 2680 validateClose(openBlock, close); 2681 } 2682 2683 var decorator = /\*/.test(openBlock.open); 2684 2685 program.blockParams = openBlock.blockParams; 2686 2687 var inverse = undefined, 2688 inverseStrip = undefined; 2689 2690 if (inverseAndProgram) { 2691 if (decorator) { 2692 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram); 2693 } 2694 2695 if (inverseAndProgram.chain) { 2696 inverseAndProgram.program.body[0].closeStrip = close.strip; 2697 } 2698 2699 inverseStrip = inverseAndProgram.strip; 2700 inverse = inverseAndProgram.program; 2701 } 2702 2703 if (inverted) { 2704 inverted = inverse; 2705 inverse = program; 2706 program = inverted; 2707 } 2708 2709 return { 2710 type: decorator ? 'DecoratorBlock' : 'BlockStatement', 2711 path: openBlock.path, 2712 params: openBlock.params, 2713 hash: openBlock.hash, 2714 program: program, 2715 inverse: inverse, 2716 openStrip: openBlock.strip, 2717 inverseStrip: inverseStrip, 2718 closeStrip: close && close.strip, 2719 loc: this.locInfo(locInfo) 2720 }; 2721 } 2722 2723 function prepareProgram(statements, loc) { 2724 if (!loc && statements.length) { 2725 var firstLoc = statements[0].loc, 2726 lastLoc = statements[statements.length - 1].loc; 2727 2728 /* istanbul ignore else */ 2729 if (firstLoc && lastLoc) { 2730 loc = { 2731 source: firstLoc.source, 2732 start: { 2733 line: firstLoc.start.line, 2734 column: firstLoc.start.column 2735 }, 2736 end: { 2737 line: lastLoc.end.line, 2738 column: lastLoc.end.column 2739 } 2740 }; 2741 } 2742 } 2743 2744 return { 2745 type: 'Program', 2746 body: statements, 2747 strip: {}, 2748 loc: loc 2749 }; 2750 } 2751 2752 function preparePartialBlock(open, program, close, locInfo) { 2753 validateClose(open, close); 2754 2755 return { 2756 type: 'PartialBlockStatement', 2757 name: open.path, 2758 params: open.params, 2759 hash: open.hash, 2760 program: program, 2761 openStrip: open.strip, 2762 closeStrip: close && close.strip, 2763 loc: this.locInfo(locInfo) 2764 }; 2765 } 2766 2767 /***/ 2768 }, 2769 /* 27 */ 2770 /***/ function (module, exports, __webpack_require__) { 2771 2772 /* eslint-disable new-cap */ 2773 2774 'use strict'; 2775 2776 var _interopRequireDefault = __webpack_require__(1)['default']; 2777 2778 exports.__esModule = true; 2779 exports.Compiler = Compiler; 2780 exports.precompile = precompile; 2781 exports.compile = compile; 2782 2783 var _exception = __webpack_require__(6); 2784 2785 var _exception2 = _interopRequireDefault(_exception); 2786 2787 var _utils = __webpack_require__(5); 2788 2789 var _ast = __webpack_require__(21); 2790 2791 var _ast2 = _interopRequireDefault(_ast); 2792 2793 var slice = [].slice; 2794 2795 function Compiler() { } 2796 2797 // the foundHelper register will disambiguate helper lookup from finding a 2798 // function in a context. This is necessary for mustache compatibility, which 2799 // requires that context functions in blocks are evaluated by blockHelperMissing, 2800 // and then proceed as if the resulting value was provided to blockHelperMissing. 2801 2802 Compiler.prototype = { 2803 compiler: Compiler, 2804 2805 equals: function equals(other) { 2806 var len = this.opcodes.length; 2807 if (other.opcodes.length !== len) { 2808 return false; 2809 } 2810 2811 for (var i = 0; i < len; i++) { 2812 var opcode = this.opcodes[i], 2813 otherOpcode = other.opcodes[i]; 2814 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { 2815 return false; 2816 } 2817 } 2818 2819 // We know that length is the same between the two arrays because they are directly tied 2820 // to the opcode behavior above. 2821 len = this.children.length; 2822 for (var i = 0; i < len; i++) { 2823 if (!this.children[i].equals(other.children[i])) { 2824 return false; 2825 } 2826 } 2827 2828 return true; 2829 }, 2830 2831 guid: 0, 2832 2833 compile: function compile(program, options) { 2834 this.sourceNode = []; 2835 this.opcodes = []; 2836 this.children = []; 2837 this.options = options; 2838 this.stringParams = options.stringParams; 2839 this.trackIds = options.trackIds; 2840 2841 options.blockParams = options.blockParams || []; 2842 2843 // These changes will propagate to the other compiler components 2844 var knownHelpers = options.knownHelpers; 2845 options.knownHelpers = { 2846 'helperMissing': true, 2847 'blockHelperMissing': true, 2848 'each': true, 2849 'if': true, 2850 'unless': true, 2851 'with': true, 2852 'log': true, 2853 'lookup': true 2854 }; 2855 if (knownHelpers) { 2856 for (var _name in knownHelpers) { 2857 /* istanbul ignore else */ 2858 if (_name in knownHelpers) { 2859 options.knownHelpers[_name] = knownHelpers[_name]; 2860 } 2861 } 2862 } 2863 2864 return this.accept(program); 2865 }, 2866 2867 compileProgram: function compileProgram(program) { 2868 var childCompiler = new this.compiler(), 2869 // eslint-disable-line new-cap 2870 result = childCompiler.compile(program, this.options), 2871 guid = this.guid++; 2872 2873 this.usePartial = this.usePartial || result.usePartial; 2874 2875 this.children[guid] = result; 2876 this.useDepths = this.useDepths || result.useDepths; 2877 2878 return guid; 2879 }, 2880 2881 accept: function accept(node) { 2882 /* istanbul ignore next: Sanity code */ 2883 if (!this[node.type]) { 2884 throw new _exception2['default']('Unknown type: ' + node.type, node); 2885 } 2886 2887 this.sourceNode.unshift(node); 2888 var ret = this[node.type](node); 2889 this.sourceNode.shift(); 2890 return ret; 2891 }, 2892 2893 Program: function Program(program) { 2894 this.options.blockParams.unshift(program.blockParams); 2895 2896 var body = program.body, 2897 bodyLength = body.length; 2898 for (var i = 0; i < bodyLength; i++) { 2899 this.accept(body[i]); 2900 } 2901 2902 this.options.blockParams.shift(); 2903 2904 this.isSimple = bodyLength === 1; 2905 this.blockParams = program.blockParams ? program.blockParams.length : 0; 2906 2907 return this; 2908 }, 2909
vendor: 5,629 bytes, lines 2910-3086
2910 BlockStatement: function BlockStatement(block) { 2911 transformLiteralToPath(block); 2912 2913 var program = block.program, 2914 inverse = block.inverse; 2915 2916 program = program && this.compileProgram(program); 2917 inverse = inverse && this.compileProgram(inverse); 2918 2919 var type = this.classifySexpr(block); 2920 2921 if (type === 'helper') { 2922 this.helperSexpr(block, program, inverse); 2923 } else if (type === 'simple') { 2924 this.simpleSexpr(block); 2925 2926 // now that the simple mustache is resolved, we need to 2927 // evaluate it by executing `blockHelperMissing` 2928 this.opcode('pushProgram', program); 2929 this.opcode('pushProgram', inverse); 2930 this.opcode('emptyHash'); 2931 this.opcode('blockValue', block.path.original); 2932 } else { 2933 this.ambiguousSexpr(block, program, inverse); 2934 2935 // now that the simple mustache is resolved, we need to 2936 // evaluate it by executing `blockHelperMissing` 2937 this.opcode('pushProgram', program); 2938 this.opcode('pushProgram', inverse); 2939 this.opcode('emptyHash'); 2940 this.opcode('ambiguousBlockValue'); 2941 } 2942 2943 this.opcode('append'); 2944 }, 2945 2946 DecoratorBlock: function DecoratorBlock(decorator) { 2947 var program = decorator.program && this.compileProgram(decorator.program); 2948 var params = this.setupFullMustacheParams(decorator, program, undefined), 2949 path = decorator.path; 2950 2951 this.useDecorators = true; 2952 this.opcode('registerDecorator', params.length, path.original); 2953 }, 2954 2955 PartialStatement: function PartialStatement(partial) { 2956 this.usePartial = true; 2957 2958 var program = partial.program; 2959 if (program) { 2960 program = this.compileProgram(partial.program); 2961 } 2962 2963 var params = partial.params; 2964 if (params.length > 1) { 2965 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); 2966 } else if (!params.length) { 2967 if (this.options.explicitPartialContext) { 2968 this.opcode('pushLiteral', 'undefined'); 2969 } else { 2970 params.push({ type: 'PathExpression', parts: [], depth: 0 }); 2971 } 2972 } 2973 2974 var partialName = partial.name.original, 2975 isDynamic = partial.name.type === 'SubExpression'; 2976 if (isDynamic) { 2977 this.accept(partial.name); 2978 } 2979 2980 this.setupFullMustacheParams(partial, program, undefined, true); 2981 2982 var indent = partial.indent || ''; 2983 if (this.options.preventIndent && indent) { 2984 this.opcode('appendContent', indent); 2985 indent = ''; 2986 } 2987 2988 this.opcode('invokePartial', isDynamic, partialName, indent); 2989 this.opcode('append'); 2990 }, 2991 PartialBlockStatement: function PartialBlockStatement(partialBlock) { 2992 this.PartialStatement(partialBlock); 2993 }, 2994 2995 MustacheStatement: function MustacheStatement(mustache) { 2996 this.SubExpression(mustache); 2997 2998 if (mustache.escaped && !this.options.noEscape) { 2999 this.opcode('appendEscaped'); 3000 } else { 3001 this.opcode('append'); 3002 } 3003 }, 3004 Decorator: function Decorator(decorator) { 3005 this.DecoratorBlock(decorator); 3006 }, 3007 3008 ContentStatement: function ContentStatement(content) { 3009 if (content.value) { 3010 this.opcode('appendContent', content.value); 3011 } 3012 }, 3013 3014 CommentStatement: function CommentStatement() { }, 3015 3016 SubExpression: function SubExpression(sexpr) { 3017 transformLiteralToPath(sexpr); 3018 var type = this.classifySexpr(sexpr); 3019 3020 if (type === 'simple') { 3021 this.simpleSexpr(sexpr); 3022 } else if (type === 'helper') { 3023 this.helperSexpr(sexpr); 3024 } else { 3025 this.ambiguousSexpr(sexpr); 3026 } 3027 }, 3028 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { 3029 var path = sexpr.path, 3030 name = path.parts[0], 3031 isBlock = program != null || inverse != null; 3032 3033 this.opcode('getContext', path.depth); 3034 3035 this.opcode('pushProgram', program); 3036 this.opcode('pushProgram', inverse); 3037 3038 path.strict = true; 3039 this.accept(path); 3040 3041 this.opcode('invokeAmbiguous', name, isBlock); 3042 }, 3043 3044 simpleSexpr: function simpleSexpr(sexpr) { 3045 var path = sexpr.path; 3046 path.strict = true; 3047 this.accept(path); 3048 this.opcode('resolvePossibleLambda'); 3049 }, 3050 3051 helperSexpr: function helperSexpr(sexpr, program, inverse) { 3052 var params = this.setupFullMustacheParams(sexpr, program, inverse), 3053 path = sexpr.path, 3054 name = path.parts[0]; 3055 3056 if (this.options.knownHelpers[name]) { 3057 this.opcode('invokeKnownHelper', params.length, name); 3058 } else if (this.options.knownHelpersOnly) { 3059 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); 3060 } else { 3061 path.strict = true; 3062 path.falsy = true; 3063 3064 this.accept(path); 3065 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path)); 3066 } 3067 }, 3068 3069 PathExpression: function PathExpression(path) { 3070 this.addDepth(path.depth); 3071 this.opcode('getContext', path.depth); 3072 3073 var name = path.parts[0], 3074 scoped = _ast2['default'].helpers.scopedId(path), 3075 blockParamId = !path.depth && !scoped && this.blockParamIndex(name); 3076 3077 if (blockParamId) { 3078 this.opcode('lookupBlockParam', blockParamId, path.parts); 3079 } else if (!name) { 3080 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` 3081 this.opcode('pushContext'); 3082 } else if (path.data) { 3083 this.options.data = true; 3084 this.opcode('lookupData', path.depth, path.parts, path.strict); 3085 } else { 3086 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
vendor: 8,039 bytes, lines 3087-3375
3087 } 3088 }, 3089 3090 StringLiteral: function StringLiteral(string) { 3091 this.opcode('pushString', string.value); 3092 }, 3093 3094 NumberLiteral: function NumberLiteral(number) { 3095 this.opcode('pushLiteral', number.value); 3096 }, 3097 3098 BooleanLiteral: function BooleanLiteral(bool) { 3099 this.opcode('pushLiteral', bool.value); 3100 }, 3101 3102 UndefinedLiteral: function UndefinedLiteral() { 3103 this.opcode('pushLiteral', 'undefined'); 3104 }, 3105 3106 NullLiteral: function NullLiteral() { 3107 this.opcode('pushLiteral', 'null'); 3108 }, 3109 3110 Hash: function Hash(hash) { 3111 var pairs = hash.pairs, 3112 i = 0, 3113 l = pairs.length; 3114 3115 this.opcode('pushHash'); 3116 3117 for (; i < l; i++) { 3118 this.pushParam(pairs[i].value); 3119 } 3120 while (i--) { 3121 this.opcode('assignToHash', pairs[i].key); 3122 } 3123 this.opcode('popHash'); 3124 }, 3125 3126 // HELPERS 3127 opcode: function opcode(name) { 3128 this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc }); 3129 }, 3130 3131 addDepth: function addDepth(depth) { 3132 if (!depth) { 3133 return; 3134 } 3135 3136 this.useDepths = true; 3137 }, 3138 3139 classifySexpr: function classifySexpr(sexpr) { 3140 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path); 3141 3142 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); 3143 3144 // a mustache is an eligible helper if: 3145 // * its id is simple (a single part, not `this` or `..`) 3146 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr); 3147 3148 // if a mustache is an eligible helper but not a definite 3149 // helper, it is ambiguous, and will be resolved in a later 3150 // pass or at runtime. 3151 var isEligible = !isBlockParam && (isHelper || isSimple); 3152 3153 // if ambiguous, we can possibly resolve the ambiguity now 3154 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. 3155 if (isEligible && !isHelper) { 3156 var _name2 = sexpr.path.parts[0], 3157 options = this.options; 3158 3159 if (options.knownHelpers[_name2]) { 3160 isHelper = true; 3161 } else if (options.knownHelpersOnly) { 3162 isEligible = false; 3163 } 3164 } 3165 3166 if (isHelper) { 3167 return 'helper'; 3168 } else if (isEligible) { 3169 return 'ambiguous'; 3170 } else { 3171 return 'simple'; 3172 } 3173 }, 3174 3175 pushParams: function pushParams(params) { 3176 for (var i = 0, l = params.length; i < l; i++) { 3177 this.pushParam(params[i]); 3178 } 3179 }, 3180 3181 pushParam: function pushParam(val) { 3182 var value = val.value != null ? val.value : val.original || ''; 3183 3184 if (this.stringParams) { 3185 if (value.replace) { 3186 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.'); 3187 } 3188 3189 if (val.depth) { 3190 this.addDepth(val.depth); 3191 } 3192 this.opcode('getContext', val.depth || 0); 3193 this.opcode('pushStringParam', value, val.type); 3194 3195 if (val.type === 'SubExpression') { 3196 // SubExpressions get evaluated and passed in 3197 // in string params mode. 3198 this.accept(val); 3199 } 3200 } else { 3201 if (this.trackIds) { 3202 var blockParamIndex = undefined; 3203 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) { 3204 blockParamIndex = this.blockParamIndex(val.parts[0]); 3205 } 3206 if (blockParamIndex) { 3207 var blockParamChild = val.parts.slice(1).join('.'); 3208 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild); 3209 } else { 3210 value = val.original || value; 3211 if (value.replace) { 3212 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, ''); 3213 } 3214 3215 this.opcode('pushId', val.type, value); 3216 } 3217 } 3218 this.accept(val); 3219 } 3220 }, 3221 3222 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) { 3223 var params = sexpr.params; 3224 this.pushParams(params); 3225 3226 this.opcode('pushProgram', program); 3227 this.opcode('pushProgram', inverse); 3228 3229 if (sexpr.hash) { 3230 this.accept(sexpr.hash); 3231 } else { 3232 this.opcode('emptyHash', omitEmpty); 3233 } 3234 3235 return params; 3236 }, 3237 3238 blockParamIndex: function blockParamIndex(name) { 3239 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) { 3240 var blockParams = this.options.blockParams[depth], 3241 param = blockParams && _utils.indexOf(blockParams, name); 3242 if (blockParams && param >= 0) { 3243 return [depth, param]; 3244 } 3245 } 3246 } 3247 }; 3248 3249 function precompile(input, options, env) { 3250 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 3251 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); 3252 } 3253 3254 options = options || {}; 3255 if (!('data' in options)) { 3256 options.data = true; 3257 } 3258 if (options.compat) { 3259 options.useDepths = true; 3260 } 3261 3262 var ast = env.parse(input, options), 3263 environment = new env.Compiler().compile(ast, options); 3264 return new env.JavaScriptCompiler().compile(environment, options); 3265 } 3266 3267 function compile(input, options, env) { 3268 if (options === undefined) options = {}; 3269 3270 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 3271 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); 3272 } 3273 3274 if (!('data' in options)) { 3275 options.data = true; 3276 } 3277 if (options.compat) { 3278 options.useDepths = true; 3279 } 3280 3281 var compiled = undefined; 3282 3283 function compileInput() { 3284 var ast = env.parse(input, options), 3285 environment = new env.Compiler().compile(ast, options), 3286 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); 3287 return env.template(templateSpec); 3288 } 3289 3290 // Template is only compiled on first use and cached after that point. 3291 function ret(context, execOptions) { 3292 if (!compiled) { 3293 compiled = compileInput(); 3294 } 3295 return compiled.call(this, context, execOptions); 3296 } 3297 ret._setup = function (setupOptions) { 3298 if (!compiled) { 3299 compiled = compileInput(); 3300 } 3301 return compiled._setup(setupOptions); 3302 }; 3303 ret._child = function (i, data, blockParams, depths) { 3304 if (!compiled) { 3305 compiled = compileInput(); 3306 } 3307 return compiled._child(i, data, blockParams, depths); 3308 }; 3309 return ret; 3310 } 3311 3312 function argEquals(a, b) { 3313 if (a === b) { 3314 return true; 3315 } 3316 3317 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { 3318 for (var i = 0; i < a.length; i++) { 3319 if (!argEquals(a[i], b[i])) { 3320 return false; 3321 } 3322 } 3323 return true; 3324 } 3325 } 3326 3327 function transformLiteralToPath(sexpr) { 3328 if (!sexpr.path.parts) { 3329 var literal = sexpr.path; 3330 // Casting to string here to make false and 0 literal values play nicely with the rest 3331 // of the system. 3332 sexpr.path = { 3333 type: 'PathExpression', 3334 data: false, 3335 depth: 0, 3336 parts: [literal.original + ''], 3337 original: literal.original + '', 3338 loc: literal.loc 3339 }; 3340 } 3341 } 3342 3343 /***/ 3344 }, 3345 /* 28 */ 3346 /***/ function (module, exports, __webpack_require__) { 3347 3348 'use strict'; 3349 3350 var _interopRequireDefault = __webpack_require__(1)['default']; 3351 3352 exports.__esModule = true; 3353 3354 var _base = __webpack_require__(4); 3355 3356 var _exception = __webpack_require__(6); 3357 3358 var _exception2 = _interopRequireDefault(_exception); 3359 3360 var _utils = __webpack_require__(5); 3361 3362 var _codeGen = __webpack_require__(29); 3363 3364 var _codeGen2 = _interopRequireDefault(_codeGen); 3365 3366 function Literal(value) { 3367 this.value = value; 3368 } 3369 3370 function JavaScriptCompiler() { } 3371 3372 JavaScriptCompiler.prototype = { 3373 // PUBLIC API: You can override these methods in a subclass to provide 3374 // alternative compiled forms for name lookup and buffering semantics 3375 nameLookup: function nameLookup(parent, name /* , type*/) {
vendor: 6,444 bytes, lines 3376-3580
3376 if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { 3377 return [parent, '.', name]; 3378 } else { 3379 return [parent, '[', JSON.stringify(name), ']']; 3380 } 3381 }, 3382 depthedLookup: function depthedLookup(name) { 3383 return [this.aliasable('container.lookup'), '(depths, "', name, '")']; 3384 }, 3385 3386 compilerInfo: function compilerInfo() { 3387 var revision = _base.COMPILER_REVISION, 3388 versions = _base.REVISION_CHANGES[revision]; 3389 return [revision, versions]; 3390 }, 3391 3392 appendToBuffer: function appendToBuffer(source, location, explicit) { 3393 // Force a source as this simplifies the merge logic. 3394 if (!_utils.isArray(source)) { 3395 source = [source]; 3396 } 3397 source = this.source.wrap(source, location); 3398 3399 if (this.environment.isSimple) { 3400 return ['return ', source, ';']; 3401 } else if (explicit) { 3402 // This is a case where the buffer operation occurs as a child of another 3403 // construct, generally braces. We have to explicitly output these buffer 3404 // operations to ensure that the emitted code goes in the correct location. 3405 return ['buffer += ', source, ';']; 3406 } else { 3407 source.appendToBuffer = true; 3408 return source; 3409 } 3410 }, 3411 3412 initializeBuffer: function initializeBuffer() { 3413 return this.quotedString(''); 3414 }, 3415 // END PUBLIC API 3416 3417 compile: function compile(environment, options, context, asObject) { 3418 this.environment = environment; 3419 this.options = options; 3420 this.stringParams = this.options.stringParams; 3421 this.trackIds = this.options.trackIds; 3422 this.precompile = !asObject; 3423 3424 this.name = this.environment.name; 3425 this.isChild = !!context; 3426 this.context = context || { 3427 decorators: [], 3428 programs: [], 3429 environments: [] 3430 }; 3431 3432 this.preamble(); 3433 3434 this.stackSlot = 0; 3435 this.stackVars = []; 3436 this.aliases = {}; 3437 this.registers = { list: [] }; 3438 this.hashes = []; 3439 this.compileStack = []; 3440 this.inlineStack = []; 3441 this.blockParams = []; 3442 3443 this.compileChildren(environment, options); 3444 3445 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat; 3446 this.useBlockParams = this.useBlockParams || environment.useBlockParams; 3447 3448 var opcodes = environment.opcodes, 3449 opcode = undefined, 3450 firstLoc = undefined, 3451 i = undefined, 3452 l = undefined; 3453 3454 for (i = 0, l = opcodes.length; i < l; i++) { 3455 opcode = opcodes[i]; 3456 3457 this.source.currentLocation = opcode.loc; 3458 firstLoc = firstLoc || opcode.loc; 3459 this[opcode.opcode].apply(this, opcode.args); 3460 } 3461 3462 // Flush any trailing content that might be pending. 3463 this.source.currentLocation = firstLoc; 3464 this.pushSource(''); 3465 3466 /* istanbul ignore next */ 3467 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { 3468 throw new _exception2['default']('Compile completed with content left on stack'); 3469 } 3470 3471 if (!this.decorators.isEmpty()) { 3472 this.useDecorators = true; 3473 3474 this.decorators.prepend('var decorators = container.decorators;\n'); 3475 this.decorators.push('return fn;'); 3476 3477 if (asObject) { 3478 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]); 3479 } else { 3480 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n'); 3481 this.decorators.push('}\n'); 3482 this.decorators = this.decorators.merge(); 3483 } 3484 } else { 3485 this.decorators = undefined; 3486 } 3487 3488 var fn = this.createFunctionContext(asObject); 3489 if (!this.isChild) { 3490 var ret = { 3491 compiler: this.compilerInfo(), 3492 main: fn 3493 }; 3494 3495 if (this.decorators) { 3496 ret.main_d = this.decorators; // eslint-disable-line camelcase 3497 ret.useDecorators = true; 3498 } 3499 3500 var _context = this.context; 3501 var programs = _context.programs; 3502 var decorators = _context.decorators; 3503 3504 for (i = 0, l = programs.length; i < l; i++) { 3505 if (programs[i]) { 3506 ret[i] = programs[i]; 3507 if (decorators[i]) { 3508 ret[i + '_d'] = decorators[i]; 3509 ret.useDecorators = true; 3510 } 3511 } 3512 } 3513 3514 if (this.environment.usePartial) { 3515 ret.usePartial = true; 3516 } 3517 if (this.options.data) { 3518 ret.useData = true; 3519 } 3520 if (this.useDepths) { 3521 ret.useDepths = true; 3522 } 3523 if (this.useBlockParams) { 3524 ret.useBlockParams = true; 3525 } 3526 if (this.options.compat) { 3527 ret.compat = true; 3528 } 3529 3530 if (!asObject) { 3531 ret.compiler = JSON.stringify(ret.compiler); 3532 3533 this.source.currentLocation = { start: { line: 1, column: 0 } }; 3534 ret = this.objectLiteral(ret); 3535 3536 if (options.srcName) { 3537 ret = ret.toStringWithSourceMap({ file: options.destName }); 3538 ret.map = ret.map && ret.map.toString(); 3539 } else { 3540 ret = ret.toString(); 3541 } 3542 } else { 3543 ret.compilerOptions = this.options; 3544 } 3545 3546 return ret; 3547 } else { 3548 return fn; 3549 } 3550 }, 3551 3552 preamble: function preamble() { 3553 // track the last context pushed into place to allow skipping the 3554 // getContext opcode when it would be a noop 3555 this.lastContext = 0; 3556 this.source = new _codeGen2['default'](this.options.srcName); 3557 this.decorators = new _codeGen2['default'](this.options.srcName); 3558 }, 3559 3560 createFunctionContext: function createFunctionContext(asObject) { 3561 var varDeclarations = ''; 3562 3563 var locals = this.stackVars.concat(this.registers.list); 3564 if (locals.length > 0) { 3565 varDeclarations += ', ' + locals.join(', '); 3566 } 3567 3568 // Generate minimizer alias mappings 3569 // 3570 // When using true SourceNodes, this will update all references to the given alias 3571 // as the source nodes are reused in situ. For the non-source node compilation mode, 3572 // aliases will not be used, but this case is already being run on the client and 3573 // we aren't concern about minimizing the template size. 3574 var aliasCount = 0; 3575 for (var alias in this.aliases) { 3576 // eslint-disable-line guard-for-in 3577 var node = this.aliases[alias]; 3578 3579 if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { 3580 varDeclarations += ', alias' + ++aliasCount + '=' + alias;
vendor: 4,511 bytes, lines 3581-3730
3581 node.children[0] = 'alias' + aliasCount; 3582 } 3583 } 3584 3585 var params = ['container', 'depth0', 'helpers', 'partials', 'data']; 3586 3587 if (this.useBlockParams || this.useDepths) { 3588 params.push('blockParams'); 3589 } 3590 if (this.useDepths) { 3591 params.push('depths'); 3592 } 3593 3594 // Perform a second pass over the output to merge content when possible 3595 var source = this.mergeSource(varDeclarations); 3596 3597 if (asObject) { 3598 params.push(source); 3599 3600 return Function.apply(this, params); 3601 } else { 3602 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); 3603 } 3604 }, 3605 mergeSource: function mergeSource(varDeclarations) { 3606 var isSimple = this.environment.isSimple, 3607 appendOnly = !this.forceBuffer, 3608 appendFirst = undefined, 3609 sourceSeen = undefined, 3610 bufferStart = undefined, 3611 bufferEnd = undefined; 3612 this.source.each(function (line) { 3613 if (line.appendToBuffer) { 3614 if (bufferStart) { 3615 line.prepend(' + '); 3616 } else { 3617 bufferStart = line; 3618 } 3619 bufferEnd = line; 3620 } else { 3621 if (bufferStart) { 3622 if (!sourceSeen) { 3623 appendFirst = true; 3624 } else { 3625 bufferStart.prepend('buffer += '); 3626 } 3627 bufferEnd.add(';'); 3628 bufferStart = bufferEnd = undefined; 3629 } 3630 3631 sourceSeen = true; 3632 if (!isSimple) { 3633 appendOnly = false; 3634 } 3635 } 3636 }); 3637 3638 if (appendOnly) { 3639 if (bufferStart) { 3640 bufferStart.prepend('return '); 3641 bufferEnd.add(';'); 3642 } else if (!sourceSeen) { 3643 this.source.push('return "";'); 3644 } 3645 } else { 3646 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); 3647 3648 if (bufferStart) { 3649 bufferStart.prepend('return buffer + '); 3650 bufferEnd.add(';'); 3651 } else { 3652 this.source.push('return buffer;'); 3653 } 3654 } 3655 3656 if (varDeclarations) { 3657 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); 3658 } 3659 3660 return this.source.merge(); 3661 }, 3662 3663 // [blockValue] 3664 // 3665 // On stack, before: hash, inverse, program, value 3666 // On stack, after: return value of blockHelperMissing 3667 // 3668 // The purpose of this opcode is to take a block of the form 3669 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and 3670 // replace it on the stack with the result of properly 3671 // invoking blockHelperMissing. 3672 blockValue: function blockValue(name) { 3673 var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), 3674 params = [this.contextName(0)]; 3675 this.setupHelperArgs(name, 0, params); 3676 3677 var blockName = this.popStack(); 3678 params.splice(1, 0, blockName); 3679 3680 this.push(this.source.functionCall(blockHelperMissing, 'call', params)); 3681 }, 3682 3683 // [ambiguousBlockValue] 3684 // 3685 // On stack, before: hash, inverse, program, value 3686 // Compiler value, before: lastHelper=value of last found helper, if any 3687 // On stack, after, if no lastHelper: same as [blockValue] 3688 // On stack, after, if lastHelper: value 3689 ambiguousBlockValue: function ambiguousBlockValue() { 3690 // We're being a bit cheeky and reusing the options value from the prior exec 3691 var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'), 3692 params = [this.contextName(0)]; 3693 this.setupHelperArgs('', 0, params, true); 3694 3695 this.flushInline(); 3696 3697 var current = this.topStack(); 3698 params.splice(1, 0, current); 3699 3700 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); 3701 }, 3702 3703 // [appendContent] 3704 // 3705 // On stack, before: ... 3706 // On stack, after: ... 3707 // 3708 // Appends the string value of `content` to the current buffer 3709 appendContent: function appendContent(content) { 3710 if (this.pendingContent) { 3711 content = this.pendingContent + content; 3712 } else { 3713 this.pendingLocation = this.source.currentLocation; 3714 } 3715 3716 this.pendingContent = content; 3717 }, 3718 3719 // [append] 3720 // 3721 // On stack, before: value, ... 3722 // On stack, after: ... 3723 // 3724 // Coerces `value` to a String and appends it to the current buffer. 3725 // 3726 // If `value` is truthy, or 0, it is coerced into a string and appended 3727 // Otherwise, the empty string is appended 3728 append: function append() { 3729 if (this.isInline()) { 3730 this.replaceStack(function (current) {
vendor: 16,213 bytes, lines 3731-4254
3731 return [' != null ? ', current, ' : ""']; 3732 }); 3733 3734 this.pushSource(this.appendToBuffer(this.popStack())); 3735 } else { 3736 var local = this.popStack(); 3737 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); 3738 if (this.environment.isSimple) { 3739 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); 3740 } 3741 } 3742 }, 3743 3744 // [appendEscaped] 3745 // 3746 // On stack, before: value, ... 3747 // On stack, after: ... 3748 // 3749 // Escape `value` and append it to the buffer 3750 appendEscaped: function appendEscaped() { 3751 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')'])); 3752 }, 3753 3754 // [getContext] 3755 // 3756 // On stack, before: ... 3757 // On stack, after: ... 3758 // Compiler value, after: lastContext=depth 3759 // 3760 // Set the value of the `lastContext` compiler value to the depth 3761 getContext: function getContext(depth) { 3762 this.lastContext = depth; 3763 }, 3764 3765 // [pushContext] 3766 // 3767 // On stack, before: ... 3768 // On stack, after: currentContext, ... 3769 // 3770 // Pushes the value of the current context onto the stack. 3771 pushContext: function pushContext() { 3772 this.pushStackLiteral(this.contextName(this.lastContext)); 3773 }, 3774 3775 // [lookupOnContext] 3776 // 3777 // On stack, before: ... 3778 // On stack, after: currentContext[name], ... 3779 // 3780 // Looks up the value of `name` on the current context and pushes 3781 // it onto the stack. 3782 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) { 3783 var i = 0; 3784 3785 if (!scoped && this.options.compat && !this.lastContext) { 3786 // The depthed query is expected to handle the undefined logic for the root level that 3787 // is implemented below, so we evaluate that directly in compat mode 3788 this.push(this.depthedLookup(parts[i++])); 3789 } else { 3790 this.pushContext(); 3791 } 3792 3793 this.resolvePath('context', parts, i, falsy, strict); 3794 }, 3795 3796 // [lookupBlockParam] 3797 // 3798 // On stack, before: ... 3799 // On stack, after: blockParam[name], ... 3800 // 3801 // Looks up the value of `parts` on the given block param and pushes 3802 // it onto the stack. 3803 lookupBlockParam: function lookupBlockParam(blockParamId, parts) { 3804 this.useBlockParams = true; 3805 3806 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); 3807 this.resolvePath('context', parts, 1); 3808 }, 3809 3810 // [lookupData] 3811 // 3812 // On stack, before: ... 3813 // On stack, after: data, ... 3814 // 3815 // Push the data lookup operator 3816 lookupData: function lookupData(depth, parts, strict) { 3817 if (!depth) { 3818 this.pushStackLiteral('data'); 3819 } else { 3820 this.pushStackLiteral('container.data(data, ' + depth + ')'); 3821 } 3822 3823 this.resolvePath('data', parts, 0, true, strict); 3824 }, 3825 3826 resolvePath: function resolvePath(type, parts, i, falsy, strict) { 3827 // istanbul ignore next 3828 3829 var _this = this; 3830 3831 if (this.options.strict || this.options.assumeObjects) { 3832 this.push(strictLookup(this.options.strict && strict, this, parts, type)); 3833 return; 3834 } 3835 3836 var len = parts.length; 3837 for (; i < len; i++) { 3838 /* eslint-disable no-loop-func */ 3839 this.replaceStack(function (current) { 3840 var lookup = _this.nameLookup(current, parts[i], type); 3841 // We want to ensure that zero and false are handled properly if the context (falsy flag) 3842 // needs to have the special handling for these values. 3843 if (!falsy) { 3844 return [' != null ? ', lookup, ' : ', current]; 3845 } else { 3846 // Otherwise we can use generic falsy handling 3847 return [' && ', lookup]; 3848 } 3849 }); 3850 /* eslint-enable no-loop-func */ 3851 } 3852 }, 3853 3854 // [resolvePossibleLambda] 3855 // 3856 // On stack, before: value, ... 3857 // On stack, after: resolved value, ... 3858 // 3859 // If the `value` is a lambda, replace it on the stack by 3860 // the return value of the lambda 3861 resolvePossibleLambda: function resolvePossibleLambda() { 3862 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); 3863 }, 3864 3865 // [pushStringParam] 3866 // 3867 // On stack, before: ... 3868 // On stack, after: string, currentContext, ... 3869 // 3870 // This opcode is designed for use in string mode, which 3871 // provides the string value of a parameter along with its 3872 // depth rather than resolving it immediately. 3873 pushStringParam: function pushStringParam(string, type) { 3874 this.pushContext(); 3875 this.pushString(type); 3876 3877 // If it's a subexpression, the string result 3878 // will be pushed after this opcode. 3879 if (type !== 'SubExpression') { 3880 if (typeof string === 'string') { 3881 this.pushString(string); 3882 } else { 3883 this.pushStackLiteral(string); 3884 } 3885 } 3886 }, 3887 3888 emptyHash: function emptyHash(omitEmpty) { 3889 if (this.trackIds) { 3890 this.push('{}'); // hashIds 3891 } 3892 if (this.stringParams) { 3893 this.push('{}'); // hashContexts 3894 this.push('{}'); // hashTypes 3895 } 3896 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); 3897 }, 3898 pushHash: function pushHash() { 3899 if (this.hash) { 3900 this.hashes.push(this.hash); 3901 } 3902 this.hash = { values: [], types: [], contexts: [], ids: [] }; 3903 }, 3904 popHash: function popHash() { 3905 var hash = this.hash; 3906 this.hash = this.hashes.pop(); 3907 3908 if (this.trackIds) { 3909 this.push(this.objectLiteral(hash.ids)); 3910 } 3911 if (this.stringParams) { 3912 this.push(this.objectLiteral(hash.contexts)); 3913 this.push(this.objectLiteral(hash.types)); 3914 } 3915 3916 this.push(this.objectLiteral(hash.values)); 3917 }, 3918 3919 // [pushString] 3920 // 3921 // On stack, before: ... 3922 // On stack, after: quotedString(string), ... 3923 // 3924 // Push a quoted version of `string` onto the stack 3925 pushString: function pushString(string) { 3926 this.pushStackLiteral(this.quotedString(string)); 3927 }, 3928 3929 // [pushLiteral] 3930 // 3931 // On stack, before: ... 3932 // On stack, after: value, ... 3933 // 3934 // Pushes a value onto the stack. This operation prevents 3935 // the compiler from creating a temporary variable to hold 3936 // it. 3937 pushLiteral: function pushLiteral(value) { 3938 this.pushStackLiteral(value); 3939 }, 3940 3941 // [pushProgram] 3942 // 3943 // On stack, before: ... 3944 // On stack, after: program(guid), ... 3945 // 3946 // Push a program expression onto the stack. This takes 3947 // a compile-time guid and converts it into a runtime-accessible 3948 // expression. 3949 pushProgram: function pushProgram(guid) { 3950 if (guid != null) { 3951 this.pushStackLiteral(this.programExpression(guid)); 3952 } else { 3953 this.pushStackLiteral(null); 3954 } 3955 }, 3956 3957 // [registerDecorator] 3958 // 3959 // On stack, before: hash, program, params..., ... 3960 // On stack, after: ... 3961 // 3962 // Pops off the decorator's parameters, invokes the decorator, 3963 // and inserts the decorator into the decorators list. 3964 registerDecorator: function registerDecorator(paramSize, name) { 3965 var foundDecorator = this.nameLookup('decorators', name, 'decorator'), 3966 options = this.setupHelperArgs(name, paramSize); 3967 3968 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']); 3969 }, 3970 3971 // [invokeHelper] 3972 // 3973 // On stack, before: hash, inverse, program, params..., ... 3974 // On stack, after: result of helper invocation 3975 // 3976 // Pops off the helper's parameters, invokes the helper, 3977 // and pushes the helper's return value onto the stack. 3978 // 3979 // If the helper is not found, `helperMissing` is called. 3980 invokeHelper: function invokeHelper(paramSize, name, isSimple) { 3981 var nonHelper = this.popStack(), 3982 helper = this.setupHelper(paramSize, name), 3983 simple = isSimple ? [helper.name, ' || '] : ''; 3984 3985 var lookup = ['('].concat(simple, nonHelper); 3986 if (!this.options.strict) { 3987 lookup.push(' || ', this.aliasable('helpers.helperMissing')); 3988 } 3989 lookup.push(')'); 3990 3991 this.push(this.source.functionCall(lookup, 'call', helper.callParams)); 3992 }, 3993 3994 // [invokeKnownHelper] 3995 // 3996 // On stack, before: hash, inverse, program, params..., ... 3997 // On stack, after: result of helper invocation 3998 // 3999 // This operation is used when the helper is known to exist, 4000 // so a `helperMissing` fallback is not required. 4001 invokeKnownHelper: function invokeKnownHelper(paramSize, name) { 4002 var helper = this.setupHelper(paramSize, name); 4003 this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); 4004 }, 4005 4006 // [invokeAmbiguous] 4007 // 4008 // On stack, before: hash, inverse, program, params..., ... 4009 // On stack, after: result of disambiguation 4010 // 4011 // This operation is used when an expression like `{{foo}}` 4012 // is provided, but we don't know at compile-time whether it 4013 // is a helper or a path. 4014 // 4015 // This operation emits more code than the other options, 4016 // and can be avoided by passing the `knownHelpers` and 4017 // `knownHelpersOnly` flags at compile-time. 4018 invokeAmbiguous: function invokeAmbiguous(name, helperCall) { 4019 this.useRegister('helper'); 4020 4021 var nonHelper = this.popStack(); 4022 4023 this.emptyHash(); 4024 var helper = this.setupHelper(0, name, helperCall); 4025 4026 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); 4027 4028 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; 4029 if (!this.options.strict) { 4030 lookup[0] = '(helper = '; 4031 lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing')); 4032 } 4033 4034 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); 4035 }, 4036 4037 // [invokePartial] 4038 // 4039 // On stack, before: context, ... 4040 // On stack after: result of partial invocation 4041 // 4042 // This operation pops off a context, invokes a partial with that context, 4043 // and pushes the result of the invocation back. 4044 invokePartial: function invokePartial(isDynamic, name, indent) { 4045 var params = [], 4046 options = this.setupParams(name, 1, params); 4047 4048 if (isDynamic) { 4049 name = this.popStack(); 4050 delete options.name; 4051 } 4052 4053 if (indent) { 4054 options.indent = JSON.stringify(indent); 4055 } 4056 options.helpers = 'helpers'; 4057 options.partials = 'partials'; 4058 options.decorators = 'container.decorators'; 4059 4060 if (!isDynamic) { 4061 params.unshift(this.nameLookup('partials', name, 'partial')); 4062 } else { 4063 params.unshift(name); 4064 } 4065 4066 if (this.options.compat) { 4067 options.depths = 'depths'; 4068 } 4069 options = this.objectLiteral(options); 4070 params.push(options); 4071 4072 this.push(this.source.functionCall('container.invokePartial', '', params)); 4073 }, 4074 4075 // [assignToHash] 4076 // 4077 // On stack, before: value, ..., hash, ... 4078 // On stack, after: ..., hash, ... 4079 // 4080 // Pops a value off the stack and assigns it to the current hash 4081 assignToHash: function assignToHash(key) { 4082 var value = this.popStack(), 4083 context = undefined, 4084 type = undefined, 4085 id = undefined; 4086 4087 if (this.trackIds) { 4088 id = this.popStack(); 4089 } 4090 if (this.stringParams) { 4091 type = this.popStack(); 4092 context = this.popStack(); 4093 } 4094 4095 var hash = this.hash; 4096 if (context) { 4097 hash.contexts[key] = context; 4098 } 4099 if (type) { 4100 hash.types[key] = type; 4101 } 4102 if (id) { 4103 hash.ids[key] = id; 4104 } 4105 hash.values[key] = value; 4106 }, 4107 4108 pushId: function pushId(type, name, child) { 4109 if (type === 'BlockParam') { 4110 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); 4111 } else if (type === 'PathExpression') { 4112 this.pushString(name); 4113 } else if (type === 'SubExpression') { 4114 this.pushStackLiteral('true'); 4115 } else { 4116 this.pushStackLiteral('null'); 4117 } 4118 }, 4119 4120 // HELPERS 4121 4122 compiler: JavaScriptCompiler, 4123 4124 compileChildren: function compileChildren(environment, options) { 4125 var children = environment.children, 4126 child = undefined, 4127 compiler = undefined; 4128 4129 for (var i = 0, l = children.length; i < l; i++) { 4130 child = children[i]; 4131 compiler = new this.compiler(); // eslint-disable-line new-cap 4132 4133 var index = this.matchExistingProgram(child); 4134 4135 if (index == null) { 4136 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children 4137 index = this.context.programs.length; 4138 child.index = index; 4139 child.name = 'program' + index; 4140 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); 4141 this.context.decorators[index] = compiler.decorators; 4142 this.context.environments[index] = child; 4143 4144 this.useDepths = this.useDepths || compiler.useDepths; 4145 this.useBlockParams = this.useBlockParams || compiler.useBlockParams; 4146 } else { 4147 child.index = index; 4148 child.name = 'program' + index; 4149 4150 this.useDepths = this.useDepths || child.useDepths; 4151 this.useBlockParams = this.useBlockParams || child.useBlockParams; 4152 } 4153 } 4154 }, 4155 matchExistingProgram: function matchExistingProgram(child) { 4156 for (var i = 0, len = this.context.environments.length; i < len; i++) { 4157 var environment = this.context.environments[i]; 4158 if (environment && environment.equals(child)) { 4159 return i; 4160 } 4161 } 4162 }, 4163 4164 programExpression: function programExpression(guid) { 4165 var child = this.environment.children[guid], 4166 programParams = [child.index, 'data', child.blockParams]; 4167 4168 if (this.useBlockParams || this.useDepths) { 4169 programParams.push('blockParams'); 4170 } 4171 if (this.useDepths) { 4172 programParams.push('depths'); 4173 } 4174 4175 return 'container.program(' + programParams.join(', ') + ')'; 4176 }, 4177 4178 useRegister: function useRegister(name) { 4179 if (!this.registers[name]) { 4180 this.registers[name] = true; 4181 this.registers.list.push(name); 4182 } 4183 }, 4184 4185 push: function push(expr) { 4186 if (!(expr instanceof Literal)) { 4187 expr = this.source.wrap(expr); 4188 } 4189 4190 this.inlineStack.push(expr); 4191 return expr; 4192 }, 4193 4194 pushStackLiteral: function pushStackLiteral(item) { 4195 this.push(new Literal(item)); 4196 }, 4197 4198 pushSource: function pushSource(source) { 4199 if (this.pendingContent) { 4200 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); 4201 this.pendingContent = undefined; 4202 } 4203 4204 if (source) { 4205 this.source.push(source); 4206 } 4207 }, 4208 4209 replaceStack: function replaceStack(callback) { 4210 var prefix = ['('], 4211 stack = undefined, 4212 createdStack = undefined, 4213 usedLiteral = undefined; 4214 4215 /* istanbul ignore next */ 4216 if (!this.isInline()) { 4217 throw new _exception2['default']('replaceStack on non-inline'); 4218 } 4219 4220 // We want to merge the inline statement into the replacement statement via ',' 4221 var top = this.popStack(true); 4222 4223 if (top instanceof Literal) { 4224 // Literals do not need to be inlined 4225 stack = [top.value]; 4226 prefix = ['(', stack]; 4227 usedLiteral = true; 4228 } else { 4229 // Get or create the current stack name for use by the inline 4230 createdStack = true; 4231 var _name = this.incrStack(); 4232 4233 prefix = ['((', this.push(_name), ' = ', top, ')']; 4234 stack = this.topStack(); 4235 } 4236 4237 var item = callback.call(this, stack); 4238 4239 if (!usedLiteral) { 4240 this.popStack(); 4241 } 4242 if (createdStack) { 4243 this.stackSlot--; 4244 } 4245 this.push(prefix.concat(item, ')')); 4246 }, 4247 4248 incrStack: function incrStack() { 4249 this.stackSlot++; 4250 if (this.stackSlot > this.stackVars.length) { 4251 this.stackVars.push('stack' + this.stackSlot); 4252 } 4253 return this.topStackName(); 4254 },
vendor: 5,583 bytes, lines 4255-4445
4255 topStackName: function topStackName() { 4256 return 'stack' + this.stackSlot; 4257 }, 4258 flushInline: function flushInline() { 4259 var inlineStack = this.inlineStack; 4260 this.inlineStack = []; 4261 for (var i = 0, len = inlineStack.length; i < len; i++) { 4262 var entry = inlineStack[i]; 4263 /* istanbul ignore if */ 4264 if (entry instanceof Literal) { 4265 this.compileStack.push(entry); 4266 } else { 4267 var stack = this.incrStack(); 4268 this.pushSource([stack, ' = ', entry, ';']); 4269 this.compileStack.push(stack); 4270 } 4271 } 4272 }, 4273 isInline: function isInline() { 4274 return this.inlineStack.length; 4275 }, 4276 4277 popStack: function popStack(wrapped) { 4278 var inline = this.isInline(), 4279 item = (inline ? this.inlineStack : this.compileStack).pop(); 4280 4281 if (!wrapped && item instanceof Literal) { 4282 return item.value; 4283 } else { 4284 if (!inline) { 4285 /* istanbul ignore next */ 4286 if (!this.stackSlot) { 4287 throw new _exception2['default']('Invalid stack pop'); 4288 } 4289 this.stackSlot--; 4290 } 4291 return item; 4292 } 4293 }, 4294 4295 topStack: function topStack() { 4296 var stack = this.isInline() ? this.inlineStack : this.compileStack, 4297 item = stack[stack.length - 1]; 4298 4299 /* istanbul ignore if */ 4300 if (item instanceof Literal) { 4301 return item.value; 4302 } else { 4303 return item; 4304 } 4305 }, 4306 4307 contextName: function contextName(context) { 4308 if (this.useDepths && context) { 4309 return 'depths[' + context + ']'; 4310 } else { 4311 return 'depth' + context; 4312 } 4313 }, 4314 4315 quotedString: function quotedString(str) { 4316 return this.source.quotedString(str); 4317 }, 4318 4319 objectLiteral: function objectLiteral(obj) { 4320 return this.source.objectLiteral(obj); 4321 }, 4322 4323 aliasable: function aliasable(name) { 4324 var ret = this.aliases[name]; 4325 if (ret) { 4326 ret.referenceCount++; 4327 return ret; 4328 } 4329 4330 ret = this.aliases[name] = this.source.wrap(name); 4331 ret.aliasable = true; 4332 ret.referenceCount = 1; 4333 4334 return ret; 4335 }, 4336 4337 setupHelper: function setupHelper(paramSize, name, blockHelper) { 4338 var params = [], 4339 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); 4340 var foundHelper = this.nameLookup('helpers', name, 'helper'), 4341 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : {}'); 4342 4343 return { 4344 params: params, 4345 paramsInit: paramsInit, 4346 name: foundHelper, 4347 callParams: [callContext].concat(params) 4348 }; 4349 }, 4350 4351 setupParams: function setupParams(helper, paramSize, params) { 4352 var options = {}, 4353 contexts = [], 4354 types = [], 4355 ids = [], 4356 objectArgs = !params, 4357 param = undefined; 4358 4359 if (objectArgs) { 4360 params = []; 4361 } 4362 4363 options.name = this.quotedString(helper); 4364 options.hash = this.popStack(); 4365 4366 if (this.trackIds) { 4367 options.hashIds = this.popStack(); 4368 } 4369 if (this.stringParams) { 4370 options.hashTypes = this.popStack(); 4371 options.hashContexts = this.popStack(); 4372 } 4373 4374 var inverse = this.popStack(), 4375 program = this.popStack(); 4376 4377 // Avoid setting fn and inverse if neither are set. This allows 4378 // helpers to do a check for `if (options.fn)` 4379 if (program || inverse) { 4380 options.fn = program || 'container.noop'; 4381 options.inverse = inverse || 'container.noop'; 4382 } 4383 4384 // The parameters go on to the stack in order (making sure that they are evaluated in order) 4385 // so we need to pop them off the stack in reverse order 4386 var i = paramSize; 4387 while (i--) { 4388 param = this.popStack(); 4389 params[i] = param; 4390 4391 if (this.trackIds) { 4392 ids[i] = this.popStack(); 4393 } 4394 if (this.stringParams) { 4395 types[i] = this.popStack(); 4396 contexts[i] = this.popStack(); 4397 } 4398 } 4399 4400 if (objectArgs) { 4401 options.args = this.source.generateArray(params); 4402 } 4403 4404 if (this.trackIds) { 4405 options.ids = this.source.generateArray(ids); 4406 } 4407 if (this.stringParams) { 4408 options.types = this.source.generateArray(types); 4409 options.contexts = this.source.generateArray(contexts); 4410 } 4411 4412 if (this.options.data) { 4413 options.data = 'data'; 4414 } 4415 if (this.useBlockParams) { 4416 options.blockParams = 'blockParams'; 4417 } 4418 return options; 4419 }, 4420 4421 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { 4422 var options = this.setupParams(helper, paramSize, params); 4423 options = this.objectLiteral(options); 4424 if (useRegister) { 4425 this.useRegister('options'); 4426 params.push('options'); 4427 return ['options=', options]; 4428 } else if (params) { 4429 params.push(options); 4430 return ''; 4431 } else { 4432 return options; 4433 } 4434 } 4435 }; 4436 4437 (function () { 4438 var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' '); 4439 4440 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; 4441 4442 for (var i = 0, l = reservedWords.length; i < l; i++) { 4443 compilerWords[reservedWords[i]] = true; 4444 } 4445 })();
vendor: 4,221 bytes, lines 4446-4599
4446 4447 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) { 4448 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name); 4449 }; 4450 4451 function strictLookup(requireTerminal, compiler, parts, type) { 4452 var stack = compiler.popStack(), 4453 i = 0, 4454 len = parts.length; 4455 if (requireTerminal) { 4456 len--; 4457 } 4458 4459 for (; i < len; i++) { 4460 stack = compiler.nameLookup(stack, parts[i], type); 4461 } 4462 4463 if (requireTerminal) { 4464 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')']; 4465 } else { 4466 return stack; 4467 } 4468 } 4469 4470 exports['default'] = JavaScriptCompiler; 4471 module.exports = exports['default']; 4472 4473 /***/ 4474 }, 4475 /* 29 */ 4476 /***/ function (module, exports, __webpack_require__) { 4477 4478 /* global define */ 4479 'use strict'; 4480 4481 exports.__esModule = true; 4482 4483 var _utils = __webpack_require__(5); 4484 4485 var SourceNode = undefined; 4486 4487 try { 4488 /* istanbul ignore next */ 4489 if (false) { 4490 // We don't support this in AMD environments. For these environments, we asusme that 4491 // they are running on the browser and thus have no need for the source-map library. 4492 var SourceMap = require('source-map'); 4493 SourceNode = SourceMap.SourceNode; 4494 } 4495 } catch (err) { } 4496 /* NOP */ 4497 4498 /* istanbul ignore if: tested but not covered in istanbul due to dist build */ 4499 if (!SourceNode) { 4500 SourceNode = function (line, column, srcFile, chunks) { 4501 this.src = ''; 4502 if (chunks) { 4503 this.add(chunks); 4504 } 4505 }; 4506 /* istanbul ignore next */ 4507 SourceNode.prototype = { 4508 add: function add(chunks) { 4509 if (_utils.isArray(chunks)) { 4510 chunks = chunks.join(''); 4511 } 4512 this.src += chunks; 4513 }, 4514 prepend: function prepend(chunks) { 4515 if (_utils.isArray(chunks)) { 4516 chunks = chunks.join(''); 4517 } 4518 this.src = chunks + this.src; 4519 }, 4520 toStringWithSourceMap: function toStringWithSourceMap() { 4521 return { code: this.toString() }; 4522 }, 4523 toString: function toString() { 4524 return this.src; 4525 } 4526 }; 4527 } 4528 4529 function castChunk(chunk, codeGen, loc) { 4530 if (_utils.isArray(chunk)) { 4531 var ret = []; 4532 4533 for (var i = 0, len = chunk.length; i < len; i++) { 4534 ret.push(codeGen.wrap(chunk[i], loc)); 4535 } 4536 return ret; 4537 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { 4538 // Handle primitives that the SourceNode will throw up on 4539 return chunk + ''; 4540 } 4541 return chunk; 4542 } 4543 4544 function CodeGen(srcFile) { 4545 this.srcFile = srcFile; 4546 this.source = []; 4547 } 4548 4549 CodeGen.prototype = { 4550 isEmpty: function isEmpty() { 4551 return !this.source.length; 4552 }, 4553 prepend: function prepend(source, loc) { 4554 this.source.unshift(this.wrap(source, loc)); 4555 }, 4556 push: function push(source, loc) { 4557 this.source.push(this.wrap(source, loc)); 4558 }, 4559 4560 merge: function merge() { 4561 var source = this.empty(); 4562 this.each(function (line) { 4563 source.add([' ', line, '\n']); 4564 }); 4565 return source; 4566 }, 4567 4568 each: function each(iter) { 4569 for (var i = 0, len = this.source.length; i < len; i++) { 4570 iter(this.source[i]); 4571 } 4572 }, 4573 4574 empty: function empty() { 4575 var loc = this.currentLocation || { start: {} }; 4576 return new SourceNode(loc.start.line, loc.start.column, this.srcFile); 4577 }, 4578 wrap: function wrap(chunk) { 4579 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; 4580 4581 if (chunk instanceof SourceNode) { 4582 return chunk; 4583 } 4584 4585 chunk = castChunk(chunk, this, loc); 4586 4587 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); 4588 }, 4589 4590 functionCall: function functionCall(fn, type, params) { 4591 params = this.generateList(params); 4592 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); 4593 }, 4594 4595 quotedString: function quotedString(str) { 4596 return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 4597 .replace(/\u2029/g, '\\u2029') + '"'; 4598 }, 4599
4600 objectLiteral: function objectLiteral(obj) { 4601 var pairs = []; 4602 4603 for (var key in obj) { 4604 if (obj.hasOwnProperty(key)) { 4605 var value = castChunk(obj[key], this); 4606 if (value !== 'undefined') { 4607 pairs.push([this.quotedString(key), ':', value]); 4608 } 4609 } 4610 } 4611 4612 var ret = this.generateList(pairs); 4613 ret.prepend('{'); 4614 ret.add('}'); 4615 return ret; 4616 }, 4617 4618 generateList: function generateList(entries) { 4619 var ret = this.empty(); 4620 4621 for (var i = 0, len = entries.length; i < len; i++) { 4622 if (i) { 4623 ret.add(','); 4624 } 4625 4626 ret.add(castChunk(entries[i], this)); 4627 } 4628 4629 return ret; 4630 }, 4631 4632 generateArray: function generateArray(entries) { 4633 var ret = this.generateList(entries); 4634 ret.prepend('['); 4635 ret.add(']'); 4636 4637 return ret; 4638 } 4639 }; 4640 4641 exports['default'] = CodeGen; 4642 module.exports = exports['default']; 4643 4644 /***/ 4645 } 4646 /******/]) 4647}); 4648;
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.