6 Copyright (C) 2011-2016 by Yehuda Katz
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32 Copyright (C) 2011-2016 by Yehuda Katz
34 Permission is hereby granted, free of charge, to any person obtaining a copy
35 of this software and associated documentation files (the "Software"), to deal
36 in the Software without restriction, including without limitation the rights
37 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
38 copies of the Software, and to permit persons to whom the Software is
39 furnished to do so, subject to the following conditions:
41 The above copyright notice and this permission notice shall be included in
42 all copies or substantial portions of the Software.
44 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
47 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
48 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
49 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
58 Copyright (C) 2011-2016 by Yehuda Katz
60 Permission is hereby granted, free of charge, to any person obtaining a copy
61 of this software and associated documentation files (the "Software"), to deal
62 in the Software without restriction, including without limitation the rights
63 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
64 copies of the Software, and to permit persons to whom the Software is
65 furnished to do so, subject to the following conditions:
67 The above copyright notice and this permission notice shall be included in
68 all copies or substantial portions of the Software.
70 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
71 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
73 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
74 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
75 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
79 (function webpackUniversalModuleDefinition(root, factory) {
80 if(typeof exports === 'object' && typeof module === 'object')
81 module.exports = factory();
82 else if(typeof define === 'function' && define.amd)
84 else if(typeof exports === 'object')
85 exports["Handlebars"] = factory();
87 root["Handlebars"] = factory();
89 return /******/ (function(modules) { // webpackBootstrap
90 /******/ // The module cache
91 /******/ var installedModules = {};
93 /******/ // The require function
94 /******/ function __webpack_require__(moduleId) {
96 /******/ // Check if module is in cache
97 /******/ if(installedModules[moduleId])
98 /******/ return installedModules[moduleId].exports;
100 /******/ // Create a new module (and put it into the cache)
101 /******/ var module = installedModules[moduleId] = {
102 /******/ exports: {},
103 /******/ id: moduleId,
104 /******/ loaded: false
107 /******/ // Execute the module function
108 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
110 /******/ // Flag the module as loaded
111 /******/ module.loaded = true;
113 /******/ // Return the exports of the module
114 /******/ return module.exports;
118 /******/ // expose the modules object (__webpack_modules__)
119 /******/ __webpack_require__.m = modules;
121 /******/ // expose the module cache
122 /******/ __webpack_require__.c = installedModules;
124 /******/ // __webpack_public_path__
125 /******/ __webpack_require__.p = "";
127 /******/ // Load entry module and return exports
128 /******/ return __webpack_require__(0);
130 /************************************************************************/
133 /***/ function(module, exports, __webpack_require__) {
137 var _interopRequireDefault = __webpack_require__(1)['default'];
139 exports.__esModule = true;
141 var _handlebarsRuntime = __webpack_require__(2);
143 var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
147 var _handlebarsCompilerAst = __webpack_require__(24);
149 var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
151 var _handlebarsCompilerBase = __webpack_require__(25);
153 var _handlebarsCompilerCompiler = __webpack_require__(30);
155 var _handlebarsCompilerJavascriptCompiler = __webpack_require__(31);
157 var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
159 var _handlebarsCompilerVisitor = __webpack_require__(28);
161 var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
163 var _handlebarsNoConflict = __webpack_require__(23);
165 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
167 var _create = _handlebarsRuntime2['default'].create;
171 hb.compile = function (input, options) {
172 return _handlebarsCompilerCompiler.compile(input, options, hb);
174 hb.precompile = function (input, options) {
175 return _handlebarsCompilerCompiler.precompile(input, options, hb);
178 hb.AST = _handlebarsCompilerAst2['default'];
179 hb.Compiler = _handlebarsCompilerCompiler.Compiler;
180 hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default'];
181 hb.Parser = _handlebarsCompilerBase.parser;
182 hb.parse = _handlebarsCompilerBase.parse;
188 inst.create = create;
190 _handlebarsNoConflict2['default'](inst);
192 inst.Visitor = _handlebarsCompilerVisitor2['default'];
194 inst['default'] = inst;
196 exports['default'] = inst;
197 module.exports = exports['default'];
201 /***/ function(module, exports) {
205 exports["default"] = function (obj) {
206 return obj && obj.__esModule ? obj : {
211 exports.__esModule = true;
215 /***/ function(module, exports, __webpack_require__) {
219 var _interopRequireWildcard = __webpack_require__(3)['default'];
221 var _interopRequireDefault = __webpack_require__(1)['default'];
223 exports.__esModule = true;
225 var _handlebarsBase = __webpack_require__(4);
227 var base = _interopRequireWildcard(_handlebarsBase);
229 // Each of these augment the Handlebars object. No need to setup here.
230 // (This is done to easily share code between commonjs and browse envs)
232 var _handlebarsSafeString = __webpack_require__(21);
234 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
236 var _handlebarsException = __webpack_require__(6);
238 var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
240 var _handlebarsUtils = __webpack_require__(5);
242 var Utils = _interopRequireWildcard(_handlebarsUtils);
244 var _handlebarsRuntime = __webpack_require__(22);
246 var runtime = _interopRequireWildcard(_handlebarsRuntime);
248 var _handlebarsNoConflict = __webpack_require__(23);
250 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
252 // For compatibility and usage outside of module systems, make the Handlebars object a namespace
254 var hb = new base.HandlebarsEnvironment();
256 Utils.extend(hb, base);
257 hb.SafeString = _handlebarsSafeString2['default'];
258 hb.Exception = _handlebarsException2['default'];
260 hb.escapeExpression = Utils.escapeExpression;
263 hb.template = function (spec) {
264 return runtime.template(spec, hb);
271 inst.create = create;
273 _handlebarsNoConflict2['default'](inst);
275 inst['default'] = inst;
277 exports['default'] = inst;
278 module.exports = exports['default'];
282 /***/ function(module, exports) {
286 exports["default"] = function (obj) {
287 if (obj && obj.__esModule) {
293 for (var key in obj) {
294 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
298 newObj["default"] = obj;
303 exports.__esModule = true;
307 /***/ function(module, exports, __webpack_require__) {
311 var _interopRequireDefault = __webpack_require__(1)['default'];
313 exports.__esModule = true;
314 exports.HandlebarsEnvironment = HandlebarsEnvironment;
316 var _utils = __webpack_require__(5);
318 var _exception = __webpack_require__(6);
320 var _exception2 = _interopRequireDefault(_exception);
322 var _helpers = __webpack_require__(10);
324 var _decorators = __webpack_require__(18);
326 var _logger = __webpack_require__(20);
328 var _logger2 = _interopRequireDefault(_logger);
330 var VERSION = '4.0.5';
331 exports.VERSION = VERSION;
332 var COMPILER_REVISION = 7;
334 exports.COMPILER_REVISION = COMPILER_REVISION;
335 var REVISION_CHANGES = {
336 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
340 5: '== 2.0.0-alpha.x',
341 6: '>= 2.0.0-beta.1',
345 exports.REVISION_CHANGES = REVISION_CHANGES;
346 var objectType = '[object Object]';
348 function HandlebarsEnvironment(helpers, partials, decorators) {
349 this.helpers = helpers || {};
350 this.partials = partials || {};
351 this.decorators = decorators || {};
353 _helpers.registerDefaultHelpers(this);
354 _decorators.registerDefaultDecorators(this);
357 HandlebarsEnvironment.prototype = {
358 constructor: HandlebarsEnvironment,
360 logger: _logger2['default'],
361 log: _logger2['default'].log,
363 registerHelper: function registerHelper(name, fn) {
364 if (_utils.toString.call(name) === objectType) {
366 throw new _exception2['default']('Arg not supported with multiple helpers');
368 _utils.extend(this.helpers, name);
370 this.helpers[name] = fn;
373 unregisterHelper: function unregisterHelper(name) {
374 delete this.helpers[name];
377 registerPartial: function registerPartial(name, partial) {
378 if (_utils.toString.call(name) === objectType) {
379 _utils.extend(this.partials, name);
381 if (typeof partial === 'undefined') {
382 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
384 this.partials[name] = partial;
387 unregisterPartial: function unregisterPartial(name) {
388 delete this.partials[name];
391 registerDecorator: function registerDecorator(name, fn) {
392 if (_utils.toString.call(name) === objectType) {
394 throw new _exception2['default']('Arg not supported with multiple decorators');
396 _utils.extend(this.decorators, name);
398 this.decorators[name] = fn;
401 unregisterDecorator: function unregisterDecorator(name) {
402 delete this.decorators[name];
406 var log = _logger2['default'].log;
409 exports.createFrame = _utils.createFrame;
410 exports.logger = _logger2['default'];
414 /***/ function(module, exports) {
418 exports.__esModule = true;
419 exports.extend = extend;
420 exports.indexOf = indexOf;
421 exports.escapeExpression = escapeExpression;
422 exports.isEmpty = isEmpty;
423 exports.createFrame = createFrame;
424 exports.blockParams = blockParams;
425 exports.appendContextPath = appendContextPath;
436 var badChars = /[&<>"'`=]/g,
437 possible = /[&<>"'`=]/;
439 function escapeChar(chr) {
443 function extend(obj /* , ...source */) {
444 for (var i = 1; i < arguments.length; i++) {
445 for (var key in arguments[i]) {
446 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
447 obj[key] = arguments[i][key];
455 var toString = Object.prototype.toString;
457 exports.toString = toString;
458 // Sourced from lodash
459 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
460 /* eslint-disable func-style */
461 var isFunction = function isFunction(value) {
462 return typeof value === 'function';
464 // fallback for older versions of Chrome and Safari
465 /* istanbul ignore next */
466 if (isFunction(/x/)) {
467 exports.isFunction = isFunction = function (value) {
468 return typeof value === 'function' && toString.call(value) === '[object Function]';
471 exports.isFunction = isFunction;
473 /* eslint-enable func-style */
475 /* istanbul ignore next */
476 var isArray = Array.isArray || function (value) {
477 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
480 exports.isArray = isArray;
481 // Older IE versions do not directly support indexOf so we must implement our own, sadly.
483 function indexOf(array, value) {
484 for (var i = 0, len = array.length; i < len; i++) {
485 if (array[i] === value) {
492 function escapeExpression(string) {
493 if (typeof string !== 'string') {
494 // don't escape SafeStrings, since they're already safe
495 if (string && string.toHTML) {
496 return string.toHTML();
497 } else if (string == null) {
499 } else if (!string) {
503 // Force a string conversion as this will be done by the append regardless and
504 // the regex test will do this transparently behind the scenes, causing issues if
505 // an object's to string has escaped characters in it.
506 string = '' + string;
509 if (!possible.test(string)) {
512 return string.replace(badChars, escapeChar);
515 function isEmpty(value) {
516 if (!value && value !== 0) {
518 } else if (isArray(value) && value.length === 0) {
525 function createFrame(object) {
526 var frame = extend({}, object);
527 frame._parent = object;
531 function blockParams(params, ids) {
536 function appendContextPath(contextPath, id) {
537 return (contextPath ? contextPath + '.' : '') + id;
542 /***/ function(module, exports, __webpack_require__) {
546 var _Object$defineProperty = __webpack_require__(7)['default'];
548 exports.__esModule = true;
550 var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
552 function Exception(message, node) {
553 var loc = node && node.loc,
557 line = loc.start.line;
558 column = loc.start.column;
560 message += ' - ' + line + ':' + column;
563 var tmp = Error.prototype.constructor.call(this, message);
565 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
566 for (var idx = 0; idx < errorProps.length; idx++) {
567 this[errorProps[idx]] = tmp[errorProps[idx]];
570 /* istanbul ignore else */
571 if (Error.captureStackTrace) {
572 Error.captureStackTrace(this, Exception);
577 this.lineNumber = line;
579 // Work around issue under safari where we can't directly set the column value
580 /* istanbul ignore next */
581 if (_Object$defineProperty) {
582 Object.defineProperty(this, 'column', { value: column });
584 this.column = column;
588 /* Ignore if the browser is very particular */
592 Exception.prototype = new Error();
594 exports['default'] = Exception;
595 module.exports = exports['default'];
599 /***/ function(module, exports, __webpack_require__) {
601 module.exports = { "default": __webpack_require__(8), __esModule: true };
605 /***/ function(module, exports, __webpack_require__) {
607 var $ = __webpack_require__(9);
608 module.exports = function defineProperty(it, key, desc){
609 return $.setDesc(it, key, desc);
614 /***/ function(module, exports) {
616 var $Object = Object;
618 create: $Object.create,
619 getProto: $Object.getPrototypeOf,
620 isEnum: {}.propertyIsEnumerable,
621 getDesc: $Object.getOwnPropertyDescriptor,
622 setDesc: $Object.defineProperty,
623 setDescs: $Object.defineProperties,
624 getKeys: $Object.keys,
625 getNames: $Object.getOwnPropertyNames,
626 getSymbols: $Object.getOwnPropertySymbols,
632 /***/ function(module, exports, __webpack_require__) {
636 var _interopRequireDefault = __webpack_require__(1)['default'];
638 exports.__esModule = true;
639 exports.registerDefaultHelpers = registerDefaultHelpers;
641 var _helpersBlockHelperMissing = __webpack_require__(11);
643 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
645 var _helpersEach = __webpack_require__(12);
647 var _helpersEach2 = _interopRequireDefault(_helpersEach);
649 var _helpersHelperMissing = __webpack_require__(13);
651 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
653 var _helpersIf = __webpack_require__(14);
655 var _helpersIf2 = _interopRequireDefault(_helpersIf);
657 var _helpersLog = __webpack_require__(15);
659 var _helpersLog2 = _interopRequireDefault(_helpersLog);
661 var _helpersLookup = __webpack_require__(16);
663 var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
665 var _helpersWith = __webpack_require__(17);
667 var _helpersWith2 = _interopRequireDefault(_helpersWith);
669 function registerDefaultHelpers(instance) {
670 _helpersBlockHelperMissing2['default'](instance);
671 _helpersEach2['default'](instance);
672 _helpersHelperMissing2['default'](instance);
673 _helpersIf2['default'](instance);
674 _helpersLog2['default'](instance);
675 _helpersLookup2['default'](instance);
676 _helpersWith2['default'](instance);
681 /***/ function(module, exports, __webpack_require__) {
685 exports.__esModule = true;
687 var _utils = __webpack_require__(5);
689 exports['default'] = function (instance) {
690 instance.registerHelper('blockHelperMissing', function (context, options) {
691 var inverse = options.inverse,
694 if (context === true) {
696 } else if (context === false || context == null) {
697 return inverse(this);
698 } else if (_utils.isArray(context)) {
699 if (context.length > 0) {
701 options.ids = [options.name];
704 return instance.helpers.each(context, options);
706 return inverse(this);
709 if (options.data && options.ids) {
710 var data = _utils.createFrame(options.data);
711 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
712 options = { data: data };
715 return fn(context, options);
720 module.exports = exports['default'];
724 /***/ function(module, exports, __webpack_require__) {
728 var _interopRequireDefault = __webpack_require__(1)['default'];
730 exports.__esModule = true;
732 var _utils = __webpack_require__(5);
734 var _exception = __webpack_require__(6);
736 var _exception2 = _interopRequireDefault(_exception);
738 exports['default'] = function (instance) {
739 instance.registerHelper('each', function (context, options) {
741 throw new _exception2['default']('Must pass iterator to #each');
745 inverse = options.inverse,
749 contextPath = undefined;
751 if (options.data && options.ids) {
752 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
755 if (_utils.isFunction(context)) {
756 context = context.call(this);
760 data = _utils.createFrame(options.data);
763 function execIteration(field, index, last) {
767 data.first = index === 0;
771 data.contextPath = contextPath + field;
775 ret = ret + fn(context[field], {
777 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
781 if (context && typeof context === 'object') {
782 if (_utils.isArray(context)) {
783 for (var j = context.length; i < j; i++) {
785 execIteration(i, i, i === context.length - 1);
789 var priorKey = undefined;
791 for (var key in context) {
792 if (context.hasOwnProperty(key)) {
793 // We're running the iterations one step out of sync so we can detect
794 // the last iteration without have to scan the object twice and create
795 // an itermediate keys array.
796 if (priorKey !== undefined) {
797 execIteration(priorKey, i - 1);
803 if (priorKey !== undefined) {
804 execIteration(priorKey, i - 1, true);
817 module.exports = exports['default'];
821 /***/ function(module, exports, __webpack_require__) {
825 var _interopRequireDefault = __webpack_require__(1)['default'];
827 exports.__esModule = true;
829 var _exception = __webpack_require__(6);
831 var _exception2 = _interopRequireDefault(_exception);
833 exports['default'] = function (instance) {
834 instance.registerHelper('helperMissing', function () /* [args, ]options */{
835 if (arguments.length === 1) {
836 // A missing field in a {{foo}} construct.
839 // Someone is actually trying to call something, blow up.
840 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
845 module.exports = exports['default'];
849 /***/ function(module, exports, __webpack_require__) {
853 exports.__esModule = true;
855 var _utils = __webpack_require__(5);
857 exports['default'] = function (instance) {
858 instance.registerHelper('if', function (conditional, options) {
859 if (_utils.isFunction(conditional)) {
860 conditional = conditional.call(this);
863 // Default behavior is to render the positive path if the value is truthy and not empty.
864 // The `includeZero` option may be set to treat the condtional as purely not empty based on the
865 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
866 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
867 return options.inverse(this);
869 return options.fn(this);
873 instance.registerHelper('unless', function (conditional, options) {
874 return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
878 module.exports = exports['default'];
882 /***/ function(module, exports) {
886 exports.__esModule = true;
888 exports['default'] = function (instance) {
889 instance.registerHelper('log', function () /* message, options */{
890 var args = [undefined],
891 options = arguments[arguments.length - 1];
892 for (var i = 0; i < arguments.length - 1; i++) {
893 args.push(arguments[i]);
897 if (options.hash.level != null) {
898 level = options.hash.level;
899 } else if (options.data && options.data.level != null) {
900 level = options.data.level;
904 instance.log.apply(instance, args);
908 module.exports = exports['default'];
912 /***/ function(module, exports) {
916 exports.__esModule = true;
918 exports['default'] = function (instance) {
919 instance.registerHelper('lookup', function (obj, field) {
920 return obj && obj[field];
924 module.exports = exports['default'];
928 /***/ function(module, exports, __webpack_require__) {
932 exports.__esModule = true;
934 var _utils = __webpack_require__(5);
936 exports['default'] = function (instance) {
937 instance.registerHelper('with', function (context, options) {
938 if (_utils.isFunction(context)) {
939 context = context.call(this);
944 if (!_utils.isEmpty(context)) {
945 var data = options.data;
946 if (options.data && options.ids) {
947 data = _utils.createFrame(options.data);
948 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
953 blockParams: _utils.blockParams([context], [data && data.contextPath])
956 return options.inverse(this);
961 module.exports = exports['default'];
965 /***/ function(module, exports, __webpack_require__) {
969 var _interopRequireDefault = __webpack_require__(1)['default'];
971 exports.__esModule = true;
972 exports.registerDefaultDecorators = registerDefaultDecorators;
974 var _decoratorsInline = __webpack_require__(19);
976 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
978 function registerDefaultDecorators(instance) {
979 _decoratorsInline2['default'](instance);
984 /***/ function(module, exports, __webpack_require__) {
988 exports.__esModule = true;
990 var _utils = __webpack_require__(5);
992 exports['default'] = function (instance) {
993 instance.registerDecorator('inline', function (fn, props, container, options) {
995 if (!props.partials) {
997 ret = function (context, options) {
998 // Create a new partials stack frame prior to exec.
999 var original = container.partials;
1000 container.partials = _utils.extend({}, original, props.partials);
1001 var ret = fn(context, options);
1002 container.partials = original;
1007 props.partials[options.args[0]] = options.fn;
1013 module.exports = exports['default'];
1017 /***/ function(module, exports, __webpack_require__) {
1021 exports.__esModule = true;
1023 var _utils = __webpack_require__(5);
1026 methodMap: ['debug', 'info', 'warn', 'error'],
1029 // Maps a given level value to the `methodMap` indexes above.
1030 lookupLevel: function lookupLevel(level) {
1031 if (typeof level === 'string') {
1032 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
1033 if (levelMap >= 0) {
1036 level = parseInt(level, 10);
1043 // Can be overridden in the host environment
1044 log: function log(level) {
1045 level = logger.lookupLevel(level);
1047 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
1048 var method = logger.methodMap[level];
1049 if (!console[method]) {
1050 // eslint-disable-line no-console
1054 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1055 message[_key - 1] = arguments[_key];
1058 console[method].apply(console, message); // eslint-disable-line no-console
1063 exports['default'] = logger;
1064 module.exports = exports['default'];
1068 /***/ function(module, exports) {
1070 // Build out our basic SafeString type
1073 exports.__esModule = true;
1074 function SafeString(string) {
1075 this.string = string;
1078 SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
1079 return '' + this.string;
1082 exports['default'] = SafeString;
1083 module.exports = exports['default'];
1087 /***/ function(module, exports, __webpack_require__) {
1091 var _interopRequireWildcard = __webpack_require__(3)['default'];
1093 var _interopRequireDefault = __webpack_require__(1)['default'];
1095 exports.__esModule = true;
1096 exports.checkRevision = checkRevision;
1097 exports.template = template;
1098 exports.wrapProgram = wrapProgram;
1099 exports.resolvePartial = resolvePartial;
1100 exports.invokePartial = invokePartial;
1101 exports.noop = noop;
1103 var _utils = __webpack_require__(5);
1105 var Utils = _interopRequireWildcard(_utils);
1107 var _exception = __webpack_require__(6);
1109 var _exception2 = _interopRequireDefault(_exception);
1111 var _base = __webpack_require__(4);
1113 function checkRevision(compilerInfo) {
1114 var compilerRevision = compilerInfo && compilerInfo[0] || 1,
1115 currentRevision = _base.COMPILER_REVISION;
1117 if (compilerRevision !== currentRevision) {
1118 if (compilerRevision < currentRevision) {
1119 var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
1120 compilerVersions = _base.REVISION_CHANGES[compilerRevision];
1121 throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').');
1123 // Use the embedded version info since the runtime doesn't know about this revision yet
1124 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] + ').');
1129 function template(templateSpec, env) {
1130 /* istanbul ignore next */
1132 throw new _exception2['default']('No environment passed to template');
1134 if (!templateSpec || !templateSpec.main) {
1135 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
1138 templateSpec.main.decorator = templateSpec.main_d;
1140 // Note: Using env.VM references rather than local var references throughout this section to allow
1141 // for external users to override these as psuedo-supported APIs.
1142 env.VM.checkRevision(templateSpec.compiler);
1144 function invokePartialWrapper(partial, context, options) {
1146 context = Utils.extend({}, context, options.hash);
1148 options.ids[0] = true;
1152 partial = env.VM.resolvePartial.call(this, partial, context, options);
1153 var result = env.VM.invokePartial.call(this, partial, context, options);
1155 if (result == null && env.compile) {
1156 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1157 result = options.partials[options.name](context, options);
1159 if (result != null) {
1160 if (options.indent) {
1161 var lines = result.split('\n');
1162 for (var i = 0, l = lines.length; i < l; i++) {
1163 if (!lines[i] && i + 1 === l) {
1167 lines[i] = options.indent + lines[i];
1169 result = lines.join('\n');
1173 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1179 strict: function strict(obj, name) {
1180 if (!(name in obj)) {
1181 throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1185 lookup: function lookup(depths, name) {
1186 var len = depths.length;
1187 for (var i = 0; i < len; i++) {
1188 if (depths[i] && depths[i][name] != null) {
1189 return depths[i][name];
1193 lambda: function lambda(current, context) {
1194 return typeof current === 'function' ? current.call(context) : current;
1197 escapeExpression: Utils.escapeExpression,
1198 invokePartial: invokePartialWrapper,
1200 fn: function fn(i) {
1201 var ret = templateSpec[i];
1202 ret.decorator = templateSpec[i + '_d'];
1207 program: function program(i, data, declaredBlockParams, blockParams, depths) {
1208 var programWrapper = this.programs[i],
1210 if (data || depths || blockParams || declaredBlockParams) {
1211 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1212 } else if (!programWrapper) {
1213 programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1215 return programWrapper;
1218 data: function data(value, depth) {
1219 while (value && depth--) {
1220 value = value._parent;
1224 merge: function merge(param, common) {
1225 var obj = param || common;
1227 if (param && common && param !== common) {
1228 obj = Utils.extend({}, common, param);
1235 compilerInfo: templateSpec.compiler
1238 function ret(context) {
1239 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1241 var data = options.data;
1243 ret._setup(options);
1244 if (!options.partial && templateSpec.useData) {
1245 data = initData(context, data);
1247 var depths = undefined,
1248 blockParams = templateSpec.useBlockParams ? [] : undefined;
1249 if (templateSpec.useDepths) {
1250 if (options.depths) {
1251 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
1257 function main(context /*, options*/) {
1258 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1260 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1261 return main(context, options);
1265 ret._setup = function (options) {
1266 if (!options.partial) {
1267 container.helpers = container.merge(options.helpers, env.helpers);
1269 if (templateSpec.usePartial) {
1270 container.partials = container.merge(options.partials, env.partials);
1272 if (templateSpec.usePartial || templateSpec.useDecorators) {
1273 container.decorators = container.merge(options.decorators, env.decorators);
1276 container.helpers = options.helpers;
1277 container.partials = options.partials;
1278 container.decorators = options.decorators;
1282 ret._child = function (i, data, blockParams, depths) {
1283 if (templateSpec.useBlockParams && !blockParams) {
1284 throw new _exception2['default']('must pass block params');
1286 if (templateSpec.useDepths && !depths) {
1287 throw new _exception2['default']('must pass parent depths');
1290 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1295 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1296 function prog(context) {
1297 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1299 var currentDepths = depths;
1300 if (depths && context != depths[0]) {
1301 currentDepths = [context].concat(depths);
1304 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1307 prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1310 prog.depth = depths ? depths.length : 0;
1311 prog.blockParams = declaredBlockParams || 0;
1315 function resolvePartial(partial, context, options) {
1317 if (options.name === '@partial-block') {
1318 var data = options.data;
1319 while (data['partial-block'] === noop) {
1320 data = data._parent;
1322 partial = data['partial-block'];
1323 data['partial-block'] = noop;
1325 partial = options.partials[options.name];
1327 } else if (!partial.call && !options.name) {
1328 // This is a dynamic partial that returned a string
1329 options.name = partial;
1330 partial = options.partials[partial];
1335 function invokePartial(partial, context, options) {
1336 options.partial = true;
1338 options.data.contextPath = options.ids[0] || options.data.contextPath;
1341 var partialBlock = undefined;
1342 if (options.fn && options.fn !== noop) {
1343 options.data = _base.createFrame(options.data);
1344 partialBlock = options.data['partial-block'] = options.fn;
1346 if (partialBlock.partials) {
1347 options.partials = Utils.extend({}, options.partials, partialBlock.partials);
1351 if (partial === undefined && partialBlock) {
1352 partial = partialBlock;
1355 if (partial === undefined) {
1356 throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1357 } else if (partial instanceof Function) {
1358 return partial(context, options);
1366 function initData(context, data) {
1367 if (!data || !('root' in data)) {
1368 data = data ? _base.createFrame(data) : {};
1369 data.root = context;
1374 function executeDecorators(fn, prog, container, depths, data, blockParams) {
1377 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1378 Utils.extend(prog, props);
1385 /***/ function(module, exports) {
1387 /* WEBPACK VAR INJECTION */(function(global) {/* global window */
1390 exports.__esModule = true;
1392 exports['default'] = function (Handlebars) {
1393 /* istanbul ignore next */
1394 var root = typeof global !== 'undefined' ? global : window,
1395 $Handlebars = root.Handlebars;
1396 /* istanbul ignore next */
1397 Handlebars.noConflict = function () {
1398 if (root.Handlebars === Handlebars) {
1399 root.Handlebars = $Handlebars;
1405 module.exports = exports['default'];
1406 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1410 /***/ function(module, exports) {
1414 exports.__esModule = true;
1416 // Public API used to evaluate derived attributes regarding AST nodes
1418 // a mustache is definitely a helper if:
1419 // * it is an eligible helper, and
1420 // * it has at least one parameter or hash segment
1421 helperExpression: function helperExpression(node) {
1422 return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash);
1425 scopedId: function scopedId(path) {
1426 return (/^\.|this\b/.test(path.original)
1430 // an ID is simple if it only has one part, and that part is not
1432 simpleId: function simpleId(path) {
1433 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth;
1438 // Must be exported as an object rather than the root of the module as the jison lexer
1439 // must modify the object to operate properly.
1440 exports['default'] = AST;
1441 module.exports = exports['default'];
1445 /***/ function(module, exports, __webpack_require__) {
1449 var _interopRequireDefault = __webpack_require__(1)['default'];
1451 var _interopRequireWildcard = __webpack_require__(3)['default'];
1453 exports.__esModule = true;
1454 exports.parse = parse;
1456 var _parser = __webpack_require__(26);
1458 var _parser2 = _interopRequireDefault(_parser);
1460 var _whitespaceControl = __webpack_require__(27);
1462 var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
1464 var _helpers = __webpack_require__(29);
1466 var Helpers = _interopRequireWildcard(_helpers);
1468 var _utils = __webpack_require__(5);
1470 exports.parser = _parser2['default'];
1473 _utils.extend(yy, Helpers);
1475 function parse(input, options) {
1476 // Just return if an already-compiled AST was passed in.
1477 if (input.type === 'Program') {
1481 _parser2['default'].yy = yy;
1483 // Altering the shared object here, but this is ok as parser is a sync operation
1484 yy.locInfo = function (locInfo) {
1485 return new yy.SourceLocation(options && options.srcName, locInfo);
1488 var strip = new _whitespaceControl2['default'](options);
1489 return strip.accept(_parser2['default'].parse(input));
1494 /***/ function(module, exports) {
1496 /* istanbul ignore next */
1497 /* Jison generated parser */
1500 var handlebars = (function () {
1501 var parser = { trace: function trace() {},
1503 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 },
1504 terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT", 18: "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" },
1505 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]],
1506 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$
1509 var $0 = $$.length - 1;
1515 this.$ = yy.prepareProgram($$[$0]);
1537 type: 'CommentStatement',
1538 value: yy.stripComment($$[$0]),
1539 strip: yy.stripFlags($$[$0], $$[$0]),
1540 loc: yy.locInfo(this._$)
1546 type: 'ContentStatement',
1549 loc: yy.locInfo(this._$)
1554 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1557 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] };
1560 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
1563 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
1566 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1569 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1572 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) };
1575 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] };
1578 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
1579 program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
1580 program.chained = true;
1582 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true };
1589 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) };
1592 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1595 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
1599 type: 'PartialStatement',
1604 strip: yy.stripFlags($$[$0 - 4], $$[$0]),
1605 loc: yy.locInfo(this._$)
1610 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
1613 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) };
1623 type: 'SubExpression',
1627 loc: yy.locInfo(this._$)
1632 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) };
1635 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) };
1638 this.$ = yy.id($$[$0 - 1]);
1647 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) };
1650 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) };
1653 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) };
1656 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) };
1659 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) };
1668 this.$ = yy.preparePath(true, $$[$0], this._$);
1671 this.$ = yy.preparePath(false, $$[$0], this._$);
1674 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2];
1677 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }];
1683 $$[$0 - 1].push($$[$0]);
1689 $$[$0 - 1].push($$[$0]);
1695 $$[$0 - 1].push($$[$0]);
1701 $$[$0 - 1].push($$[$0]);
1707 $$[$0 - 1].push($$[$0]);
1713 $$[$0 - 1].push($$[$0]);
1719 $$[$0 - 1].push($$[$0]);
1725 $$[$0 - 1].push($$[$0]);
1731 $$[$0 - 1].push($$[$0]);
1737 $$[$0 - 1].push($$[$0]);
1743 $$[$0 - 1].push($$[$0]);
1749 $$[$0 - 1].push($$[$0]);
1755 $$[$0 - 1].push($$[$0]);
1759 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] }],
1760 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] },
1761 parseError: function parseError(str, hash) {
1762 throw new Error(str);
1764 parse: function parse(input) {
1776 this.lexer.setInput(input);
1777 this.lexer.yy = this.yy;
1778 this.yy.lexer = this.lexer;
1779 this.yy.parser = this;
1780 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
1781 var yyloc = this.lexer.yylloc;
1783 var ranges = this.lexer.options && this.lexer.options.ranges;
1784 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;
1785 function popStack(n) {
1786 stack.length = stack.length - 2 * n;
1787 vstack.length = vstack.length - n;
1788 lstack.length = lstack.length - n;
1792 token = self.lexer.lex() || 1;
1793 if (typeof token !== "number") {
1794 token = self.symbols_[token] || token;
1810 state = stack[stack.length - 1];
1811 if (this.defaultActions[state]) {
1812 action = this.defaultActions[state];
1814 if (symbol === null || typeof symbol == "undefined") {
1817 action = table[state] && table[state][symbol];
1819 if (typeof action === "undefined" || !action.length || !action[0]) {
1823 for (p in table[state]) if (this.terminals_[p] && p > 2) {
1824 expected.push("'" + this.terminals_[p] + "'");
1826 if (this.lexer.showPosition) {
1827 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
1829 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
1831 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected });
1834 if (action[0] instanceof Array && action.length > 1) {
1835 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
1837 switch (action[0]) {
1840 vstack.push(this.lexer.yytext);
1841 lstack.push(this.lexer.yylloc);
1842 stack.push(action[1]);
1844 if (!preErrorSymbol) {
1845 yyleng = this.lexer.yyleng;
1846 yytext = this.lexer.yytext;
1847 yylineno = this.lexer.yylineno;
1848 yyloc = this.lexer.yylloc;
1849 if (recovering > 0) recovering--;
1851 symbol = preErrorSymbol;
1852 preErrorSymbol = null;
1856 len = this.productions_[action[1]][1];
1857 yyval.$ = vstack[vstack.length - len];
1858 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 };
1860 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]];
1862 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
1863 if (typeof r !== "undefined") {
1867 stack = stack.slice(0, -1 * len * 2);
1868 vstack = vstack.slice(0, -1 * len);
1869 lstack = lstack.slice(0, -1 * len);
1871 stack.push(this.productions_[action[1]][0]);
1872 vstack.push(yyval.$);
1873 lstack.push(yyval._$);
1874 newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
1875 stack.push(newState);
1884 /* Jison generated lexer */
1885 var lexer = (function () {
1886 var lexer = { EOF: 1,
1887 parseError: function parseError(str, hash) {
1888 if (this.yy.parser) {
1889 this.yy.parser.parseError(str, hash);
1891 throw new Error(str);
1894 setInput: function setInput(input) {
1895 this._input = input;
1896 this._more = this._less = this.done = false;
1897 this.yylineno = this.yyleng = 0;
1898 this.yytext = this.matched = this.match = '';
1899 this.conditionStack = ['INITIAL'];
1900 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 };
1901 if (this.options.ranges) this.yylloc.range = [0, 0];
1905 input: function input() {
1906 var ch = this._input[0];
1912 var lines = ch.match(/(?:\r\n?|\n).*/g);
1915 this.yylloc.last_line++;
1917 this.yylloc.last_column++;
1919 if (this.options.ranges) this.yylloc.range[1]++;
1921 this._input = this._input.slice(1);
1924 unput: function unput(ch) {
1925 var len = ch.length;
1926 var lines = ch.split(/(?:\r\n?|\n)/g);
1928 this._input = ch + this._input;
1929 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
1930 //this.yyleng -= len;
1932 var oldLines = this.match.split(/(?:\r\n?|\n)/g);
1933 this.match = this.match.substr(0, this.match.length - 1);
1934 this.matched = this.matched.substr(0, this.matched.length - 1);
1936 if (lines.length - 1) this.yylineno -= lines.length - 1;
1937 var r = this.yylloc.range;
1939 this.yylloc = { first_line: this.yylloc.first_line,
1940 last_line: this.yylineno + 1,
1941 first_column: this.yylloc.first_column,
1942 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
1945 if (this.options.ranges) {
1946 this.yylloc.range = [r[0], r[0] + this.yyleng - len];
1950 more: function more() {
1954 less: function less(n) {
1955 this.unput(this.match.slice(n));
1957 pastInput: function pastInput() {
1958 var past = this.matched.substr(0, this.matched.length - this.match.length);
1959 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, "");
1961 upcomingInput: function upcomingInput() {
1962 var next = this.match;
1963 if (next.length < 20) {
1964 next += this._input.substr(0, 20 - next.length);
1966 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, "");
1968 showPosition: function showPosition() {
1969 var pre = this.pastInput();
1970 var c = new Array(pre.length + 1).join("-");
1971 return pre + this.upcomingInput() + "\n" + c + "^";
1973 next: function next() {
1977 if (!this._input) this.done = true;
1979 var token, match, tempMatch, index, col, lines;
1984 var rules = this._currentRules();
1985 for (var i = 0; i < rules.length; i++) {
1986 tempMatch = this._input.match(this.rules[rules[i]]);
1987 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
1990 if (!this.options.flex) break;
1994 lines = match[0].match(/(?:\r\n?|\n).*/g);
1995 if (lines) this.yylineno += lines.length;
1996 this.yylloc = { first_line: this.yylloc.last_line,
1997 last_line: this.yylineno + 1,
1998 first_column: this.yylloc.last_column,
1999 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length };
2000 this.yytext += match[0];
2001 this.match += match[0];
2002 this.matches = match;
2003 this.yyleng = this.yytext.length;
2004 if (this.options.ranges) {
2005 this.yylloc.range = [this.offset, this.offset += this.yyleng];
2008 this._input = this._input.slice(match[0].length);
2009 this.matched += match[0];
2010 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
2011 if (this.done && this._input) this.done = false;
2012 if (token) return token;else return;
2014 if (this._input === "") {
2017 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno });
2020 lex: function lex() {
2021 var r = this.next();
2022 if (typeof r !== 'undefined') {
2028 begin: function begin(condition) {
2029 this.conditionStack.push(condition);
2031 popState: function popState() {
2032 return this.conditionStack.pop();
2034 _currentRules: function _currentRules() {
2035 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
2037 topState: function topState() {
2038 return this.conditionStack[this.conditionStack.length - 2];
2040 pushState: function begin(condition) {
2041 this.begin(condition);
2044 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START
2047 function strip(start, end) {
2048 return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end);
2051 var YYSTATE = YY_START;
2052 switch ($avoiding_name_collisions) {
2054 if (yy_.yytext.slice(-2) === "\\\\") {
2057 } else if (yy_.yytext.slice(-1) === "\\") {
2063 if (yy_.yytext) return 15;
2075 this.begin('raw');return 15;
2079 // Should be using `this.topState()` below, but it currently
2080 // returns the second top instead of the first top. Opened an
2081 // issue about it at https://github.com/zaach/jison/issues/291
2082 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') {
2085 yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
2086 return 'END_RAW_BLOCK';
2126 this.popState();return 44;
2129 this.popState();return 44;
2144 this.unput(yy_.yytext);
2170 // ignore whitespace
2173 this.popState();return 54;
2176 this.popState();return 33;
2179 yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80;
2182 yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80;
2212 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72;
2222 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\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2223 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 } };
2226 parser.lexer = lexer;
2229 }Parser.prototype = parser;parser.Parser = Parser;
2230 return new Parser();
2231 })();exports.__esModule = true;
2232 exports['default'] = handlebars;
2236 /***/ function(module, exports, __webpack_require__) {
2240 var _interopRequireDefault = __webpack_require__(1)['default'];
2242 exports.__esModule = true;
2244 var _visitor = __webpack_require__(28);
2246 var _visitor2 = _interopRequireDefault(_visitor);
2248 function WhitespaceControl() {
2249 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
2251 this.options = options;
2253 WhitespaceControl.prototype = new _visitor2['default']();
2255 WhitespaceControl.prototype.Program = function (program) {
2256 var doStandalone = !this.options.ignoreStandalone;
2258 var isRoot = !this.isRootSeen;
2259 this.isRootSeen = true;
2261 var body = program.body;
2262 for (var i = 0, l = body.length; i < l; i++) {
2263 var current = body[i],
2264 strip = this.accept(current);
2270 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
2271 _isNextWhitespace = isNextWhitespace(body, i, isRoot),
2272 openStandalone = strip.openStandalone && _isPrevWhitespace,
2273 closeStandalone = strip.closeStandalone && _isNextWhitespace,
2274 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
2277 omitRight(body, i, true);
2280 omitLeft(body, i, true);
2283 if (doStandalone && inlineStandalone) {
2286 if (omitLeft(body, i)) {
2287 // If we are on a standalone node, save the indent info for partials
2288 if (current.type === 'PartialStatement') {
2289 // Pull out the whitespace from the final line
2290 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
2294 if (doStandalone && openStandalone) {
2295 omitRight((current.program || current.inverse).body);
2297 // Strip out the previous content node if it's whitespace only
2300 if (doStandalone && closeStandalone) {
2301 // Always strip the next node
2304 omitLeft((current.inverse || current.program).body);
2311 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) {
2312 this.accept(block.program);
2313 this.accept(block.inverse);
2315 // Find the inverse program that is involed with whitespace stripping.
2316 var program = block.program || block.inverse,
2317 inverse = block.program && block.inverse,
2318 firstInverse = inverse,
2319 lastInverse = inverse;
2321 if (inverse && inverse.chained) {
2322 firstInverse = inverse.body[0].program;
2324 // Walk the inverse chain to find the last inverse that is actually in the chain.
2325 while (lastInverse.chained) {
2326 lastInverse = lastInverse.body[lastInverse.body.length - 1].program;
2331 open: block.openStrip.open,
2332 close: block.closeStrip.close,
2334 // Determine the standalone candiacy. Basically flag our content as being possibly standalone
2335 // so our parent can determine if we actually are standalone
2336 openStandalone: isNextWhitespace(program.body),
2337 closeStandalone: isPrevWhitespace((firstInverse || program).body)
2340 if (block.openStrip.close) {
2341 omitRight(program.body, null, true);
2345 var inverseStrip = block.inverseStrip;
2347 if (inverseStrip.open) {
2348 omitLeft(program.body, null, true);
2351 if (inverseStrip.close) {
2352 omitRight(firstInverse.body, null, true);
2354 if (block.closeStrip.open) {
2355 omitLeft(lastInverse.body, null, true);
2358 // Find standalone else statments
2359 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
2360 omitLeft(program.body);
2361 omitRight(firstInverse.body);
2363 } else if (block.closeStrip.open) {
2364 omitLeft(program.body, null, true);
2370 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) {
2371 return mustache.strip;
2374 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) {
2375 /* istanbul ignore next */
2376 var strip = node.strip || {};
2378 inlineStandalone: true,
2384 function isPrevWhitespace(body, i, isRoot) {
2385 if (i === undefined) {
2389 // Nodes that end with newlines are considered whitespace (but are special
2390 // cased for strip operations)
2391 var prev = body[i - 1],
2392 sibling = body[i - 2];
2397 if (prev.type === 'ContentStatement') {
2398 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
2401 function isNextWhitespace(body, i, isRoot) {
2402 if (i === undefined) {
2406 var next = body[i + 1],
2407 sibling = body[i + 2];
2412 if (next.type === 'ContentStatement') {
2413 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original);
2417 // Marks the node to the right of the position as omitted.
2418 // I.e. {{foo}}' ' will mark the ' ' node as omitted.
2420 // If i is undefined, then the first child will be marked as such.
2422 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2424 function omitRight(body, i, multiple) {
2425 var current = body[i == null ? 0 : i + 1];
2426 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) {
2430 var original = current.value;
2431 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, '');
2432 current.rightStripped = current.value !== original;
2435 // Marks the node to the left of the position as omitted.
2436 // I.e. ' '{{foo}} will mark the ' ' node as omitted.
2438 // If i is undefined then the last child will be marked as such.
2440 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace
2442 function omitLeft(body, i, multiple) {
2443 var current = body[i == null ? body.length - 1 : i - 1];
2444 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) {
2448 // We omit the last node if it's whitespace only and not preceeded by a non-content node.
2449 var original = current.value;
2450 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, '');
2451 current.leftStripped = current.value !== original;
2452 return current.leftStripped;
2455 exports['default'] = WhitespaceControl;
2456 module.exports = exports['default'];
2460 /***/ function(module, exports, __webpack_require__) {
2464 var _interopRequireDefault = __webpack_require__(1)['default'];
2466 exports.__esModule = true;
2468 var _exception = __webpack_require__(6);
2470 var _exception2 = _interopRequireDefault(_exception);
2472 function Visitor() {
2476 Visitor.prototype = {
2477 constructor: Visitor,
2480 // Visits a given value. If mutating, will replace the value if necessary.
2481 acceptKey: function acceptKey(node, name) {
2482 var value = this.accept(node[name]);
2483 if (this.mutating) {
2484 // Hacky sanity check: This may have a few false positives for type for the helper
2485 // methods but will generally do the right thing without a lot of overhead.
2486 if (value && !Visitor.prototype[value.type]) {
2487 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type);
2493 // Performs an accept operation with added sanity check to ensure
2494 // required keys are not removed.
2495 acceptRequired: function acceptRequired(node, name) {
2496 this.acceptKey(node, name);
2499 throw new _exception2['default'](node.type + ' requires ' + name);
2503 // Traverses a given array. If mutating, empty respnses will be removed
2504 // for child elements.
2505 acceptArray: function acceptArray(array) {
2506 for (var i = 0, l = array.length; i < l; i++) {
2507 this.acceptKey(array, i);
2517 accept: function accept(object) {
2522 /* istanbul ignore next: Sanity code */
2523 if (!this[object.type]) {
2524 throw new _exception2['default']('Unknown type: ' + object.type, object);
2528 this.parents.unshift(this.current);
2530 this.current = object;
2532 var ret = this[object.type](object);
2534 this.current = this.parents.shift();
2536 if (!this.mutating || ret) {
2538 } else if (ret !== false) {
2543 Program: function Program(program) {
2544 this.acceptArray(program.body);
2547 MustacheStatement: visitSubExpression,
2548 Decorator: visitSubExpression,
2550 BlockStatement: visitBlock,
2551 DecoratorBlock: visitBlock,
2553 PartialStatement: visitPartial,
2554 PartialBlockStatement: function PartialBlockStatement(partial) {
2555 visitPartial.call(this, partial);
2557 this.acceptKey(partial, 'program');
2560 ContentStatement: function ContentStatement() /* content */{},
2561 CommentStatement: function CommentStatement() /* comment */{},
2563 SubExpression: visitSubExpression,
2565 PathExpression: function PathExpression() /* path */{},
2567 StringLiteral: function StringLiteral() /* string */{},
2568 NumberLiteral: function NumberLiteral() /* number */{},
2569 BooleanLiteral: function BooleanLiteral() /* bool */{},
2570 UndefinedLiteral: function UndefinedLiteral() /* literal */{},
2571 NullLiteral: function NullLiteral() /* literal */{},
2573 Hash: function Hash(hash) {
2574 this.acceptArray(hash.pairs);
2576 HashPair: function HashPair(pair) {
2577 this.acceptRequired(pair, 'value');
2581 function visitSubExpression(mustache) {
2582 this.acceptRequired(mustache, 'path');
2583 this.acceptArray(mustache.params);
2584 this.acceptKey(mustache, 'hash');
2586 function visitBlock(block) {
2587 visitSubExpression.call(this, block);
2589 this.acceptKey(block, 'program');
2590 this.acceptKey(block, 'inverse');
2592 function visitPartial(partial) {
2593 this.acceptRequired(partial, 'name');
2594 this.acceptArray(partial.params);
2595 this.acceptKey(partial, 'hash');
2598 exports['default'] = Visitor;
2599 module.exports = exports['default'];
2603 /***/ function(module, exports, __webpack_require__) {
2607 var _interopRequireDefault = __webpack_require__(1)['default'];
2609 exports.__esModule = true;
2610 exports.SourceLocation = SourceLocation;
2612 exports.stripFlags = stripFlags;
2613 exports.stripComment = stripComment;
2614 exports.preparePath = preparePath;
2615 exports.prepareMustache = prepareMustache;
2616 exports.prepareRawBlock = prepareRawBlock;
2617 exports.prepareBlock = prepareBlock;
2618 exports.prepareProgram = prepareProgram;
2619 exports.preparePartialBlock = preparePartialBlock;
2621 var _exception = __webpack_require__(6);
2623 var _exception2 = _interopRequireDefault(_exception);
2625 function validateClose(open, close) {
2626 close = close.path ? close.path.original : close;
2628 if (open.path.original !== close) {
2629 var errorNode = { loc: open.path.loc };
2631 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode);
2635 function SourceLocation(source, locInfo) {
2636 this.source = source;
2638 line: locInfo.first_line,
2639 column: locInfo.first_column
2642 line: locInfo.last_line,
2643 column: locInfo.last_column
2647 function id(token) {
2648 if (/^\[.*\]$/.test(token)) {
2649 return token.substr(1, token.length - 2);
2655 function stripFlags(open, close) {
2657 open: open.charAt(2) === '~',
2658 close: close.charAt(close.length - 3) === '~'
2662 function stripComment(comment) {
2663 return comment.replace(/^\{\{~?\!-?-?/, '').replace(/-?-?~?\}\}$/, '');
2666 function preparePath(data, parts, loc) {
2667 loc = this.locInfo(loc);
2669 var original = data ? '@' : '',
2674 for (var i = 0, l = parts.length; i < l; i++) {
2675 var part = parts[i].part,
2677 // If we have [] syntax then we do not treat path references as operators,
2678 // i.e. foo.[this] resolves to approximately context.foo['this']
2679 isLiteral = parts[i].original !== part;
2680 original += (parts[i].separator || '') + part;
2682 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) {
2683 if (dig.length > 0) {
2684 throw new _exception2['default']('Invalid path: ' + original, { loc: loc });
2685 } else if (part === '..') {
2687 depthString += '../';
2695 type: 'PathExpression',
2704 function prepareMustache(path, params, hash, open, strip, locInfo) {
2705 // Must use charAt to support IE pre-10
2706 var escapeFlag = open.charAt(3) || open.charAt(2),
2707 escaped = escapeFlag !== '{' && escapeFlag !== '&';
2709 var decorator = /\*/.test(open);
2711 type: decorator ? 'Decorator' : 'MustacheStatement',
2717 loc: this.locInfo(locInfo)
2721 function prepareRawBlock(openRawBlock, contents, close, locInfo) {
2722 validateClose(openRawBlock, close);
2724 locInfo = this.locInfo(locInfo);
2733 type: 'BlockStatement',
2734 path: openRawBlock.path,
2735 params: openRawBlock.params,
2736 hash: openRawBlock.hash,
2745 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
2746 if (close && close.path) {
2747 validateClose(openBlock, close);
2750 var decorator = /\*/.test(openBlock.open);
2752 program.blockParams = openBlock.blockParams;
2754 var inverse = undefined,
2755 inverseStrip = undefined;
2757 if (inverseAndProgram) {
2759 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram);
2762 if (inverseAndProgram.chain) {
2763 inverseAndProgram.program.body[0].closeStrip = close.strip;
2766 inverseStrip = inverseAndProgram.strip;
2767 inverse = inverseAndProgram.program;
2777 type: decorator ? 'DecoratorBlock' : 'BlockStatement',
2778 path: openBlock.path,
2779 params: openBlock.params,
2780 hash: openBlock.hash,
2783 openStrip: openBlock.strip,
2784 inverseStrip: inverseStrip,
2785 closeStrip: close && close.strip,
2786 loc: this.locInfo(locInfo)
2790 function prepareProgram(statements, loc) {
2791 if (!loc && statements.length) {
2792 var firstLoc = statements[0].loc,
2793 lastLoc = statements[statements.length - 1].loc;
2795 /* istanbul ignore else */
2796 if (firstLoc && lastLoc) {
2798 source: firstLoc.source,
2800 line: firstLoc.start.line,
2801 column: firstLoc.start.column
2804 line: lastLoc.end.line,
2805 column: lastLoc.end.column
2819 function preparePartialBlock(open, program, close, locInfo) {
2820 validateClose(open, close);
2823 type: 'PartialBlockStatement',
2825 params: open.params,
2828 openStrip: open.strip,
2829 closeStrip: close && close.strip,
2830 loc: this.locInfo(locInfo)
2836 /***/ function(module, exports, __webpack_require__) {
2838 /* eslint-disable new-cap */
2842 var _interopRequireDefault = __webpack_require__(1)['default'];
2844 exports.__esModule = true;
2845 exports.Compiler = Compiler;
2846 exports.precompile = precompile;
2847 exports.compile = compile;
2849 var _exception = __webpack_require__(6);
2851 var _exception2 = _interopRequireDefault(_exception);
2853 var _utils = __webpack_require__(5);
2855 var _ast = __webpack_require__(24);
2857 var _ast2 = _interopRequireDefault(_ast);
2859 var slice = [].slice;
2861 function Compiler() {}
2863 // the foundHelper register will disambiguate helper lookup from finding a
2864 // function in a context. This is necessary for mustache compatibility, which
2865 // requires that context functions in blocks are evaluated by blockHelperMissing,
2866 // and then proceed as if the resulting value was provided to blockHelperMissing.
2868 Compiler.prototype = {
2871 equals: function equals(other) {
2872 var len = this.opcodes.length;
2873 if (other.opcodes.length !== len) {
2877 for (var i = 0; i < len; i++) {
2878 var opcode = this.opcodes[i],
2879 otherOpcode = other.opcodes[i];
2880 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
2885 // We know that length is the same between the two arrays because they are directly tied
2886 // to the opcode behavior above.
2887 len = this.children.length;
2888 for (var i = 0; i < len; i++) {
2889 if (!this.children[i].equals(other.children[i])) {
2899 compile: function compile(program, options) {
2900 this.sourceNode = [];
2903 this.options = options;
2904 this.stringParams = options.stringParams;
2905 this.trackIds = options.trackIds;
2907 options.blockParams = options.blockParams || [];
2909 // These changes will propagate to the other compiler components
2910 var knownHelpers = options.knownHelpers;
2911 options.knownHelpers = {
2912 'helperMissing': true,
2913 'blockHelperMissing': true,
2922 for (var _name in knownHelpers) {
2923 /* istanbul ignore else */
2924 if (_name in knownHelpers) {
2925 options.knownHelpers[_name] = knownHelpers[_name];
2930 return this.accept(program);
2933 compileProgram: function compileProgram(program) {
2934 var childCompiler = new this.compiler(),
2935 // eslint-disable-line new-cap
2936 result = childCompiler.compile(program, this.options),
2939 this.usePartial = this.usePartial || result.usePartial;
2941 this.children[guid] = result;
2942 this.useDepths = this.useDepths || result.useDepths;
2947 accept: function accept(node) {
2948 /* istanbul ignore next: Sanity code */
2949 if (!this[node.type]) {
2950 throw new _exception2['default']('Unknown type: ' + node.type, node);
2953 this.sourceNode.unshift(node);
2954 var ret = this[node.type](node);
2955 this.sourceNode.shift();
2959 Program: function Program(program) {
2960 this.options.blockParams.unshift(program.blockParams);
2962 var body = program.body,
2963 bodyLength = body.length;
2964 for (var i = 0; i < bodyLength; i++) {
2965 this.accept(body[i]);
2968 this.options.blockParams.shift();
2970 this.isSimple = bodyLength === 1;
2971 this.blockParams = program.blockParams ? program.blockParams.length : 0;
2976 BlockStatement: function BlockStatement(block) {
2977 transformLiteralToPath(block);
2979 var program = block.program,
2980 inverse = block.inverse;
2982 program = program && this.compileProgram(program);
2983 inverse = inverse && this.compileProgram(inverse);
2985 var type = this.classifySexpr(block);
2987 if (type === 'helper') {
2988 this.helperSexpr(block, program, inverse);
2989 } else if (type === 'simple') {
2990 this.simpleSexpr(block);
2992 // now that the simple mustache is resolved, we need to
2993 // evaluate it by executing `blockHelperMissing`
2994 this.opcode('pushProgram', program);
2995 this.opcode('pushProgram', inverse);
2996 this.opcode('emptyHash');
2997 this.opcode('blockValue', block.path.original);
2999 this.ambiguousSexpr(block, program, inverse);
3001 // now that the simple mustache is resolved, we need to
3002 // evaluate it by executing `blockHelperMissing`
3003 this.opcode('pushProgram', program);
3004 this.opcode('pushProgram', inverse);
3005 this.opcode('emptyHash');
3006 this.opcode('ambiguousBlockValue');
3009 this.opcode('append');
3012 DecoratorBlock: function DecoratorBlock(decorator) {
3013 var program = decorator.program && this.compileProgram(decorator.program);
3014 var params = this.setupFullMustacheParams(decorator, program, undefined),
3015 path = decorator.path;
3017 this.useDecorators = true;
3018 this.opcode('registerDecorator', params.length, path.original);
3021 PartialStatement: function PartialStatement(partial) {
3022 this.usePartial = true;
3024 var program = partial.program;
3026 program = this.compileProgram(partial.program);
3029 var params = partial.params;
3030 if (params.length > 1) {
3031 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial);
3032 } else if (!params.length) {
3033 if (this.options.explicitPartialContext) {
3034 this.opcode('pushLiteral', 'undefined');
3036 params.push({ type: 'PathExpression', parts: [], depth: 0 });
3040 var partialName = partial.name.original,
3041 isDynamic = partial.name.type === 'SubExpression';
3043 this.accept(partial.name);
3046 this.setupFullMustacheParams(partial, program, undefined, true);
3048 var indent = partial.indent || '';
3049 if (this.options.preventIndent && indent) {
3050 this.opcode('appendContent', indent);
3054 this.opcode('invokePartial', isDynamic, partialName, indent);
3055 this.opcode('append');
3057 PartialBlockStatement: function PartialBlockStatement(partialBlock) {
3058 this.PartialStatement(partialBlock);
3061 MustacheStatement: function MustacheStatement(mustache) {
3062 this.SubExpression(mustache);
3064 if (mustache.escaped && !this.options.noEscape) {
3065 this.opcode('appendEscaped');
3067 this.opcode('append');
3070 Decorator: function Decorator(decorator) {
3071 this.DecoratorBlock(decorator);
3074 ContentStatement: function ContentStatement(content) {
3075 if (content.value) {
3076 this.opcode('appendContent', content.value);
3080 CommentStatement: function CommentStatement() {},
3082 SubExpression: function SubExpression(sexpr) {
3083 transformLiteralToPath(sexpr);
3084 var type = this.classifySexpr(sexpr);
3086 if (type === 'simple') {
3087 this.simpleSexpr(sexpr);
3088 } else if (type === 'helper') {
3089 this.helperSexpr(sexpr);
3091 this.ambiguousSexpr(sexpr);
3094 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
3095 var path = sexpr.path,
3096 name = path.parts[0],
3097 isBlock = program != null || inverse != null;
3099 this.opcode('getContext', path.depth);
3101 this.opcode('pushProgram', program);
3102 this.opcode('pushProgram', inverse);
3107 this.opcode('invokeAmbiguous', name, isBlock);
3110 simpleSexpr: function simpleSexpr(sexpr) {
3111 var path = sexpr.path;
3114 this.opcode('resolvePossibleLambda');
3117 helperSexpr: function helperSexpr(sexpr, program, inverse) {
3118 var params = this.setupFullMustacheParams(sexpr, program, inverse),
3120 name = path.parts[0];
3122 if (this.options.knownHelpers[name]) {
3123 this.opcode('invokeKnownHelper', params.length, name);
3124 } else if (this.options.knownHelpersOnly) {
3125 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr);
3131 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path));
3135 PathExpression: function PathExpression(path) {
3136 this.addDepth(path.depth);
3137 this.opcode('getContext', path.depth);
3139 var name = path.parts[0],
3140 scoped = _ast2['default'].helpers.scopedId(path),
3141 blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
3144 this.opcode('lookupBlockParam', blockParamId, path.parts);
3146 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}`
3147 this.opcode('pushContext');
3148 } else if (path.data) {
3149 this.options.data = true;
3150 this.opcode('lookupData', path.depth, path.parts, path.strict);
3152 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped);
3156 StringLiteral: function StringLiteral(string) {
3157 this.opcode('pushString', string.value);
3160 NumberLiteral: function NumberLiteral(number) {
3161 this.opcode('pushLiteral', number.value);
3164 BooleanLiteral: function BooleanLiteral(bool) {
3165 this.opcode('pushLiteral', bool.value);
3168 UndefinedLiteral: function UndefinedLiteral() {
3169 this.opcode('pushLiteral', 'undefined');
3172 NullLiteral: function NullLiteral() {
3173 this.opcode('pushLiteral', 'null');
3176 Hash: function Hash(hash) {
3177 var pairs = hash.pairs,
3181 this.opcode('pushHash');
3183 for (; i < l; i++) {
3184 this.pushParam(pairs[i].value);
3187 this.opcode('assignToHash', pairs[i].key);
3189 this.opcode('popHash');
3193 opcode: function opcode(name) {
3194 this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc });
3197 addDepth: function addDepth(depth) {
3202 this.useDepths = true;
3205 classifySexpr: function classifySexpr(sexpr) {
3206 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path);
3208 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
3210 // a mustache is an eligible helper if:
3211 // * its id is simple (a single part, not `this` or `..`)
3212 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr);
3214 // if a mustache is an eligible helper but not a definite
3215 // helper, it is ambiguous, and will be resolved in a later
3216 // pass or at runtime.
3217 var isEligible = !isBlockParam && (isHelper || isSimple);
3219 // if ambiguous, we can possibly resolve the ambiguity now
3220 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc.
3221 if (isEligible && !isHelper) {
3222 var _name2 = sexpr.path.parts[0],
3223 options = this.options;
3225 if (options.knownHelpers[_name2]) {
3227 } else if (options.knownHelpersOnly) {
3234 } else if (isEligible) {
3241 pushParams: function pushParams(params) {
3242 for (var i = 0, l = params.length; i < l; i++) {
3243 this.pushParam(params[i]);
3247 pushParam: function pushParam(val) {
3248 var value = val.value != null ? val.value : val.original || '';
3250 if (this.stringParams) {
3251 if (value.replace) {
3252 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.');
3256 this.addDepth(val.depth);
3258 this.opcode('getContext', val.depth || 0);
3259 this.opcode('pushStringParam', value, val.type);
3261 if (val.type === 'SubExpression') {
3262 // SubExpressions get evaluated and passed in
3263 // in string params mode.
3267 if (this.trackIds) {
3268 var blockParamIndex = undefined;
3269 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) {
3270 blockParamIndex = this.blockParamIndex(val.parts[0]);
3272 if (blockParamIndex) {
3273 var blockParamChild = val.parts.slice(1).join('.');
3274 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild);
3276 value = val.original || value;
3277 if (value.replace) {
3278 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, '');
3281 this.opcode('pushId', val.type, value);
3288 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
3289 var params = sexpr.params;
3290 this.pushParams(params);
3292 this.opcode('pushProgram', program);
3293 this.opcode('pushProgram', inverse);
3296 this.accept(sexpr.hash);
3298 this.opcode('emptyHash', omitEmpty);
3304 blockParamIndex: function blockParamIndex(name) {
3305 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
3306 var blockParams = this.options.blockParams[depth],
3307 param = blockParams && _utils.indexOf(blockParams, name);
3308 if (blockParams && param >= 0) {
3309 return [depth, param];
3315 function precompile(input, options, env) {
3316 if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3317 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input);
3320 options = options || {};
3321 if (!('data' in options)) {
3322 options.data = true;
3324 if (options.compat) {
3325 options.useDepths = true;
3328 var ast = env.parse(input, options),
3329 environment = new env.Compiler().compile(ast, options);
3330 return new env.JavaScriptCompiler().compile(environment, options);
3333 function compile(input, options, env) {
3334 if (options === undefined) options = {};
3336 if (input == null || typeof input !== 'string' && input.type !== 'Program') {
3337 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input);
3340 if (!('data' in options)) {
3341 options.data = true;
3343 if (options.compat) {
3344 options.useDepths = true;
3347 var compiled = undefined;
3349 function compileInput() {
3350 var ast = env.parse(input, options),
3351 environment = new env.Compiler().compile(ast, options),
3352 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true);
3353 return env.template(templateSpec);
3356 // Template is only compiled on first use and cached after that point.
3357 function ret(context, execOptions) {
3359 compiled = compileInput();
3361 return compiled.call(this, context, execOptions);
3363 ret._setup = function (setupOptions) {
3365 compiled = compileInput();
3367 return compiled._setup(setupOptions);
3369 ret._child = function (i, data, blockParams, depths) {
3371 compiled = compileInput();
3373 return compiled._child(i, data, blockParams, depths);
3378 function argEquals(a, b) {
3383 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
3384 for (var i = 0; i < a.length; i++) {
3385 if (!argEquals(a[i], b[i])) {
3393 function transformLiteralToPath(sexpr) {
3394 if (!sexpr.path.parts) {
3395 var literal = sexpr.path;
3396 // Casting to string here to make false and 0 literal values play nicely with the rest
3399 type: 'PathExpression',
3402 parts: [literal.original + ''],
3403 original: literal.original + '',
3411 /***/ function(module, exports, __webpack_require__) {
3415 var _interopRequireDefault = __webpack_require__(1)['default'];
3417 exports.__esModule = true;
3419 var _base = __webpack_require__(4);
3421 var _exception = __webpack_require__(6);
3423 var _exception2 = _interopRequireDefault(_exception);
3425 var _utils = __webpack_require__(5);
3427 var _codeGen = __webpack_require__(32);
3429 var _codeGen2 = _interopRequireDefault(_codeGen);
3431 function Literal(value) {
3435 function JavaScriptCompiler() {}
3437 JavaScriptCompiler.prototype = {
3438 // PUBLIC API: You can override these methods in a subclass to provide
3439 // alternative compiled forms for name lookup and buffering semantics
3440 nameLookup: function nameLookup(parent, name /* , type*/) {
3441 if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
3442 return [parent, '.', name];
3444 return [parent, '[', JSON.stringify(name), ']'];
3447 depthedLookup: function depthedLookup(name) {
3448 return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
3451 compilerInfo: function compilerInfo() {
3452 var revision = _base.COMPILER_REVISION,
3453 versions = _base.REVISION_CHANGES[revision];
3454 return [revision, versions];
3457 appendToBuffer: function appendToBuffer(source, location, explicit) {
3458 // Force a source as this simplifies the merge logic.
3459 if (!_utils.isArray(source)) {
3462 source = this.source.wrap(source, location);
3464 if (this.environment.isSimple) {
3465 return ['return ', source, ';'];
3466 } else if (explicit) {
3467 // This is a case where the buffer operation occurs as a child of another
3468 // construct, generally braces. We have to explicitly output these buffer
3469 // operations to ensure that the emitted code goes in the correct location.
3470 return ['buffer += ', source, ';'];
3472 source.appendToBuffer = true;
3477 initializeBuffer: function initializeBuffer() {
3478 return this.quotedString('');
3482 compile: function compile(environment, options, context, asObject) {
3483 this.environment = environment;
3484 this.options = options;
3485 this.stringParams = this.options.stringParams;
3486 this.trackIds = this.options.trackIds;
3487 this.precompile = !asObject;
3489 this.name = this.environment.name;
3490 this.isChild = !!context;
3491 this.context = context || {
3500 this.stackVars = [];
3502 this.registers = { list: [] };
3504 this.compileStack = [];
3505 this.inlineStack = [];
3506 this.blockParams = [];
3508 this.compileChildren(environment, options);
3510 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
3511 this.useBlockParams = this.useBlockParams || environment.useBlockParams;
3513 var opcodes = environment.opcodes,
3515 firstLoc = undefined,
3519 for (i = 0, l = opcodes.length; i < l; i++) {
3520 opcode = opcodes[i];
3522 this.source.currentLocation = opcode.loc;
3523 firstLoc = firstLoc || opcode.loc;
3524 this[opcode.opcode].apply(this, opcode.args);
3527 // Flush any trailing content that might be pending.
3528 this.source.currentLocation = firstLoc;
3529 this.pushSource('');
3531 /* istanbul ignore next */
3532 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
3533 throw new _exception2['default']('Compile completed with content left on stack');
3536 if (!this.decorators.isEmpty()) {
3537 this.useDecorators = true;
3539 this.decorators.prepend('var decorators = container.decorators;\n');
3540 this.decorators.push('return fn;');
3543 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]);
3545 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n');
3546 this.decorators.push('}\n');
3547 this.decorators = this.decorators.merge();
3550 this.decorators = undefined;
3553 var fn = this.createFunctionContext(asObject);
3554 if (!this.isChild) {
3556 compiler: this.compilerInfo(),
3560 if (this.decorators) {
3561 ret.main_d = this.decorators; // eslint-disable-line camelcase
3562 ret.useDecorators = true;
3565 var _context = this.context;
3566 var programs = _context.programs;
3567 var decorators = _context.decorators;
3569 for (i = 0, l = programs.length; i < l; i++) {
3571 ret[i] = programs[i];
3572 if (decorators[i]) {
3573 ret[i + '_d'] = decorators[i];
3574 ret.useDecorators = true;
3579 if (this.environment.usePartial) {
3580 ret.usePartial = true;
3582 if (this.options.data) {
3585 if (this.useDepths) {
3586 ret.useDepths = true;
3588 if (this.useBlockParams) {
3589 ret.useBlockParams = true;
3591 if (this.options.compat) {
3596 ret.compiler = JSON.stringify(ret.compiler);
3598 this.source.currentLocation = { start: { line: 1, column: 0 } };
3599 ret = this.objectLiteral(ret);
3601 if (options.srcName) {
3602 ret = ret.toStringWithSourceMap({ file: options.destName });
3603 ret.map = ret.map && ret.map.toString();
3605 ret = ret.toString();
3608 ret.compilerOptions = this.options;
3617 preamble: function preamble() {
3618 // track the last context pushed into place to allow skipping the
3619 // getContext opcode when it would be a noop
3620 this.lastContext = 0;
3621 this.source = new _codeGen2['default'](this.options.srcName);
3622 this.decorators = new _codeGen2['default'](this.options.srcName);
3625 createFunctionContext: function createFunctionContext(asObject) {
3626 var varDeclarations = '';
3628 var locals = this.stackVars.concat(this.registers.list);
3629 if (locals.length > 0) {
3630 varDeclarations += ', ' + locals.join(', ');
3633 // Generate minimizer alias mappings
3635 // When using true SourceNodes, this will update all references to the given alias
3636 // as the source nodes are reused in situ. For the non-source node compilation mode,
3637 // aliases will not be used, but this case is already being run on the client and
3638 // we aren't concern about minimizing the template size.
3640 for (var alias in this.aliases) {
3641 // eslint-disable-line guard-for-in
3642 var node = this.aliases[alias];
3644 if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) {
3645 varDeclarations += ', alias' + ++aliasCount + '=' + alias;
3646 node.children[0] = 'alias' + aliasCount;
3650 var params = ['container', 'depth0', 'helpers', 'partials', 'data'];
3652 if (this.useBlockParams || this.useDepths) {
3653 params.push('blockParams');
3655 if (this.useDepths) {
3656 params.push('depths');
3659 // Perform a second pass over the output to merge content when possible
3660 var source = this.mergeSource(varDeclarations);
3663 params.push(source);
3665 return Function.apply(this, params);
3667 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']);
3670 mergeSource: function mergeSource(varDeclarations) {
3671 var isSimple = this.environment.isSimple,
3672 appendOnly = !this.forceBuffer,
3673 appendFirst = undefined,
3674 sourceSeen = undefined,
3675 bufferStart = undefined,
3676 bufferEnd = undefined;
3677 this.source.each(function (line) {
3678 if (line.appendToBuffer) {
3680 line.prepend(' + ');
3690 bufferStart.prepend('buffer += ');
3693 bufferStart = bufferEnd = undefined;
3705 bufferStart.prepend('return ');
3707 } else if (!sourceSeen) {
3708 this.source.push('return "";');
3711 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer());
3714 bufferStart.prepend('return buffer + ');
3717 this.source.push('return buffer;');
3721 if (varDeclarations) {
3722 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n'));
3725 return this.source.merge();
3730 // On stack, before: hash, inverse, program, value
3731 // On stack, after: return value of blockHelperMissing
3733 // The purpose of this opcode is to take a block of the form
3734 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and
3735 // replace it on the stack with the result of properly
3736 // invoking blockHelperMissing.
3737 blockValue: function blockValue(name) {
3738 var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
3739 params = [this.contextName(0)];
3740 this.setupHelperArgs(name, 0, params);
3742 var blockName = this.popStack();
3743 params.splice(1, 0, blockName);
3745 this.push(this.source.functionCall(blockHelperMissing, 'call', params));
3748 // [ambiguousBlockValue]
3750 // On stack, before: hash, inverse, program, value
3751 // Compiler value, before: lastHelper=value of last found helper, if any
3752 // On stack, after, if no lastHelper: same as [blockValue]
3753 // On stack, after, if lastHelper: value
3754 ambiguousBlockValue: function ambiguousBlockValue() {
3755 // We're being a bit cheeky and reusing the options value from the prior exec
3756 var blockHelperMissing = this.aliasable('helpers.blockHelperMissing'),
3757 params = [this.contextName(0)];
3758 this.setupHelperArgs('', 0, params, true);
3762 var current = this.topStack();
3763 params.splice(1, 0, current);
3765 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']);
3770 // On stack, before: ...
3771 // On stack, after: ...
3773 // Appends the string value of `content` to the current buffer
3774 appendContent: function appendContent(content) {
3775 if (this.pendingContent) {
3776 content = this.pendingContent + content;
3778 this.pendingLocation = this.source.currentLocation;
3781 this.pendingContent = content;
3786 // On stack, before: value, ...
3787 // On stack, after: ...
3789 // Coerces `value` to a String and appends it to the current buffer.
3791 // If `value` is truthy, or 0, it is coerced into a string and appended
3792 // Otherwise, the empty string is appended
3793 append: function append() {
3794 if (this.isInline()) {
3795 this.replaceStack(function (current) {
3796 return [' != null ? ', current, ' : ""'];
3799 this.pushSource(this.appendToBuffer(this.popStack()));
3801 var local = this.popStack();
3802 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']);
3803 if (this.environment.isSimple) {
3804 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']);
3811 // On stack, before: value, ...
3812 // On stack, after: ...
3814 // Escape `value` and append it to the buffer
3815 appendEscaped: function appendEscaped() {
3816 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')']));
3821 // On stack, before: ...
3822 // On stack, after: ...
3823 // Compiler value, after: lastContext=depth
3825 // Set the value of the `lastContext` compiler value to the depth
3826 getContext: function getContext(depth) {
3827 this.lastContext = depth;
3832 // On stack, before: ...
3833 // On stack, after: currentContext, ...
3835 // Pushes the value of the current context onto the stack.
3836 pushContext: function pushContext() {
3837 this.pushStackLiteral(this.contextName(this.lastContext));
3840 // [lookupOnContext]
3842 // On stack, before: ...
3843 // On stack, after: currentContext[name], ...
3845 // Looks up the value of `name` on the current context and pushes
3846 // it onto the stack.
3847 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
3850 if (!scoped && this.options.compat && !this.lastContext) {
3851 // The depthed query is expected to handle the undefined logic for the root level that
3852 // is implemented below, so we evaluate that directly in compat mode
3853 this.push(this.depthedLookup(parts[i++]));
3858 this.resolvePath('context', parts, i, falsy, strict);
3861 // [lookupBlockParam]
3863 // On stack, before: ...
3864 // On stack, after: blockParam[name], ...
3866 // Looks up the value of `parts` on the given block param and pushes
3867 // it onto the stack.
3868 lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
3869 this.useBlockParams = true;
3871 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']);
3872 this.resolvePath('context', parts, 1);
3877 // On stack, before: ...
3878 // On stack, after: data, ...
3880 // Push the data lookup operator
3881 lookupData: function lookupData(depth, parts, strict) {
3883 this.pushStackLiteral('data');
3885 this.pushStackLiteral('container.data(data, ' + depth + ')');
3888 this.resolvePath('data', parts, 0, true, strict);
3891 resolvePath: function resolvePath(type, parts, i, falsy, strict) {
3892 // istanbul ignore next
3896 if (this.options.strict || this.options.assumeObjects) {
3897 this.push(strictLookup(this.options.strict && strict, this, parts, type));
3901 var len = parts.length;
3902 for (; i < len; i++) {
3903 /* eslint-disable no-loop-func */
3904 this.replaceStack(function (current) {
3905 var lookup = _this.nameLookup(current, parts[i], type);
3906 // We want to ensure that zero and false are handled properly if the context (falsy flag)
3907 // needs to have the special handling for these values.
3909 return [' != null ? ', lookup, ' : ', current];
3911 // Otherwise we can use generic falsy handling
3912 return [' && ', lookup];
3915 /* eslint-enable no-loop-func */
3919 // [resolvePossibleLambda]
3921 // On stack, before: value, ...
3922 // On stack, after: resolved value, ...
3924 // If the `value` is a lambda, replace it on the stack by
3925 // the return value of the lambda
3926 resolvePossibleLambda: function resolvePossibleLambda() {
3927 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']);
3930 // [pushStringParam]
3932 // On stack, before: ...
3933 // On stack, after: string, currentContext, ...
3935 // This opcode is designed for use in string mode, which
3936 // provides the string value of a parameter along with its
3937 // depth rather than resolving it immediately.
3938 pushStringParam: function pushStringParam(string, type) {
3940 this.pushString(type);
3942 // If it's a subexpression, the string result
3943 // will be pushed after this opcode.
3944 if (type !== 'SubExpression') {
3945 if (typeof string === 'string') {
3946 this.pushString(string);
3948 this.pushStackLiteral(string);
3953 emptyHash: function emptyHash(omitEmpty) {
3954 if (this.trackIds) {
3955 this.push('{}'); // hashIds
3957 if (this.stringParams) {
3958 this.push('{}'); // hashContexts
3959 this.push('{}'); // hashTypes
3961 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}');
3963 pushHash: function pushHash() {
3965 this.hashes.push(this.hash);
3967 this.hash = { values: [], types: [], contexts: [], ids: [] };
3969 popHash: function popHash() {
3970 var hash = this.hash;
3971 this.hash = this.hashes.pop();
3973 if (this.trackIds) {
3974 this.push(this.objectLiteral(hash.ids));
3976 if (this.stringParams) {
3977 this.push(this.objectLiteral(hash.contexts));
3978 this.push(this.objectLiteral(hash.types));
3981 this.push(this.objectLiteral(hash.values));
3986 // On stack, before: ...
3987 // On stack, after: quotedString(string), ...
3989 // Push a quoted version of `string` onto the stack
3990 pushString: function pushString(string) {
3991 this.pushStackLiteral(this.quotedString(string));
3996 // On stack, before: ...
3997 // On stack, after: value, ...
3999 // Pushes a value onto the stack. This operation prevents
4000 // the compiler from creating a temporary variable to hold
4002 pushLiteral: function pushLiteral(value) {
4003 this.pushStackLiteral(value);
4008 // On stack, before: ...
4009 // On stack, after: program(guid), ...
4011 // Push a program expression onto the stack. This takes
4012 // a compile-time guid and converts it into a runtime-accessible
4014 pushProgram: function pushProgram(guid) {
4016 this.pushStackLiteral(this.programExpression(guid));
4018 this.pushStackLiteral(null);
4022 // [registerDecorator]
4024 // On stack, before: hash, program, params..., ...
4025 // On stack, after: ...
4027 // Pops off the decorator's parameters, invokes the decorator,
4028 // and inserts the decorator into the decorators list.
4029 registerDecorator: function registerDecorator(paramSize, name) {
4030 var foundDecorator = this.nameLookup('decorators', name, 'decorator'),
4031 options = this.setupHelperArgs(name, paramSize);
4033 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']);
4038 // On stack, before: hash, inverse, program, params..., ...
4039 // On stack, after: result of helper invocation
4041 // Pops off the helper's parameters, invokes the helper,
4042 // and pushes the helper's return value onto the stack.
4044 // If the helper is not found, `helperMissing` is called.
4045 invokeHelper: function invokeHelper(paramSize, name, isSimple) {
4046 var nonHelper = this.popStack(),
4047 helper = this.setupHelper(paramSize, name),
4048 simple = isSimple ? [helper.name, ' || '] : '';
4050 var lookup = ['('].concat(simple, nonHelper);
4051 if (!this.options.strict) {
4052 lookup.push(' || ', this.aliasable('helpers.helperMissing'));
4056 this.push(this.source.functionCall(lookup, 'call', helper.callParams));
4059 // [invokeKnownHelper]
4061 // On stack, before: hash, inverse, program, params..., ...
4062 // On stack, after: result of helper invocation
4064 // This operation is used when the helper is known to exist,
4065 // so a `helperMissing` fallback is not required.
4066 invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
4067 var helper = this.setupHelper(paramSize, name);
4068 this.push(this.source.functionCall(helper.name, 'call', helper.callParams));
4071 // [invokeAmbiguous]
4073 // On stack, before: hash, inverse, program, params..., ...
4074 // On stack, after: result of disambiguation
4076 // This operation is used when an expression like `{{foo}}`
4077 // is provided, but we don't know at compile-time whether it
4078 // is a helper or a path.
4080 // This operation emits more code than the other options,
4081 // and can be avoided by passing the `knownHelpers` and
4082 // `knownHelpersOnly` flags at compile-time.
4083 invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
4084 this.useRegister('helper');
4086 var nonHelper = this.popStack();
4089 var helper = this.setupHelper(0, name, helperCall);
4091 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');
4093 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')'];
4094 if (!this.options.strict) {
4095 lookup[0] = '(helper = ';
4096 lookup.push(' != null ? helper : ', this.aliasable('helpers.helperMissing'));
4099 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']);
4104 // On stack, before: context, ...
4105 // On stack after: result of partial invocation
4107 // This operation pops off a context, invokes a partial with that context,
4108 // and pushes the result of the invocation back.
4109 invokePartial: function invokePartial(isDynamic, name, indent) {
4111 options = this.setupParams(name, 1, params);
4114 name = this.popStack();
4115 delete options.name;
4119 options.indent = JSON.stringify(indent);
4121 options.helpers = 'helpers';
4122 options.partials = 'partials';
4123 options.decorators = 'container.decorators';
4126 params.unshift(this.nameLookup('partials', name, 'partial'));
4128 params.unshift(name);
4131 if (this.options.compat) {
4132 options.depths = 'depths';
4134 options = this.objectLiteral(options);
4135 params.push(options);
4137 this.push(this.source.functionCall('container.invokePartial', '', params));
4142 // On stack, before: value, ..., hash, ...
4143 // On stack, after: ..., hash, ...
4145 // Pops a value off the stack and assigns it to the current hash
4146 assignToHash: function assignToHash(key) {
4147 var value = this.popStack(),
4148 context = undefined,
4152 if (this.trackIds) {
4153 id = this.popStack();
4155 if (this.stringParams) {
4156 type = this.popStack();
4157 context = this.popStack();
4160 var hash = this.hash;
4162 hash.contexts[key] = context;
4165 hash.types[key] = type;
4170 hash.values[key] = value;
4173 pushId: function pushId(type, name, child) {
4174 if (type === 'BlockParam') {
4175 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : ''));
4176 } else if (type === 'PathExpression') {
4177 this.pushString(name);
4178 } else if (type === 'SubExpression') {
4179 this.pushStackLiteral('true');
4181 this.pushStackLiteral('null');
4187 compiler: JavaScriptCompiler,
4189 compileChildren: function compileChildren(environment, options) {
4190 var children = environment.children,
4192 compiler = undefined;
4194 for (var i = 0, l = children.length; i < l; i++) {
4195 child = children[i];
4196 compiler = new this.compiler(); // eslint-disable-line new-cap
4198 var existing = this.matchExistingProgram(child);
4200 if (existing == null) {
4201 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
4202 var index = this.context.programs.length;
4203 child.index = index;
4204 child.name = 'program' + index;
4205 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
4206 this.context.decorators[index] = compiler.decorators;
4207 this.context.environments[index] = child;
4209 this.useDepths = this.useDepths || compiler.useDepths;
4210 this.useBlockParams = this.useBlockParams || compiler.useBlockParams;
4211 child.useDepths = this.useDepths;
4212 child.useBlockParams = this.useBlockParams;
4214 child.index = existing.index;
4215 child.name = 'program' + existing.index;
4217 this.useDepths = this.useDepths || existing.useDepths;
4218 this.useBlockParams = this.useBlockParams || existing.useBlockParams;
4222 matchExistingProgram: function matchExistingProgram(child) {
4223 for (var i = 0, len = this.context.environments.length; i < len; i++) {
4224 var environment = this.context.environments[i];
4225 if (environment && environment.equals(child)) {
4231 programExpression: function programExpression(guid) {
4232 var child = this.environment.children[guid],
4233 programParams = [child.index, 'data', child.blockParams];
4235 if (this.useBlockParams || this.useDepths) {
4236 programParams.push('blockParams');
4238 if (this.useDepths) {
4239 programParams.push('depths');
4242 return 'container.program(' + programParams.join(', ') + ')';
4245 useRegister: function useRegister(name) {
4246 if (!this.registers[name]) {
4247 this.registers[name] = true;
4248 this.registers.list.push(name);
4252 push: function push(expr) {
4253 if (!(expr instanceof Literal)) {
4254 expr = this.source.wrap(expr);
4257 this.inlineStack.push(expr);
4261 pushStackLiteral: function pushStackLiteral(item) {
4262 this.push(new Literal(item));
4265 pushSource: function pushSource(source) {
4266 if (this.pendingContent) {
4267 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
4268 this.pendingContent = undefined;
4272 this.source.push(source);
4276 replaceStack: function replaceStack(callback) {
4279 createdStack = undefined,
4280 usedLiteral = undefined;
4282 /* istanbul ignore next */
4283 if (!this.isInline()) {
4284 throw new _exception2['default']('replaceStack on non-inline');
4287 // We want to merge the inline statement into the replacement statement via ','
4288 var top = this.popStack(true);
4290 if (top instanceof Literal) {
4291 // Literals do not need to be inlined
4292 stack = [top.value];
4293 prefix = ['(', stack];
4296 // Get or create the current stack name for use by the inline
4297 createdStack = true;
4298 var _name = this.incrStack();
4300 prefix = ['((', this.push(_name), ' = ', top, ')'];
4301 stack = this.topStack();
4304 var item = callback.call(this, stack);
4312 this.push(prefix.concat(item, ')'));
4315 incrStack: function incrStack() {
4317 if (this.stackSlot > this.stackVars.length) {
4318 this.stackVars.push('stack' + this.stackSlot);
4320 return this.topStackName();
4322 topStackName: function topStackName() {
4323 return 'stack' + this.stackSlot;
4325 flushInline: function flushInline() {
4326 var inlineStack = this.inlineStack;
4327 this.inlineStack = [];
4328 for (var i = 0, len = inlineStack.length; i < len; i++) {
4329 var entry = inlineStack[i];
4330 /* istanbul ignore if */
4331 if (entry instanceof Literal) {
4332 this.compileStack.push(entry);
4334 var stack = this.incrStack();
4335 this.pushSource([stack, ' = ', entry, ';']);
4336 this.compileStack.push(stack);
4340 isInline: function isInline() {
4341 return this.inlineStack.length;
4344 popStack: function popStack(wrapped) {
4345 var inline = this.isInline(),
4346 item = (inline ? this.inlineStack : this.compileStack).pop();
4348 if (!wrapped && item instanceof Literal) {
4352 /* istanbul ignore next */
4353 if (!this.stackSlot) {
4354 throw new _exception2['default']('Invalid stack pop');
4362 topStack: function topStack() {
4363 var stack = this.isInline() ? this.inlineStack : this.compileStack,
4364 item = stack[stack.length - 1];
4366 /* istanbul ignore if */
4367 if (item instanceof Literal) {
4374 contextName: function contextName(context) {
4375 if (this.useDepths && context) {
4376 return 'depths[' + context + ']';
4378 return 'depth' + context;
4382 quotedString: function quotedString(str) {
4383 return this.source.quotedString(str);
4386 objectLiteral: function objectLiteral(obj) {
4387 return this.source.objectLiteral(obj);
4390 aliasable: function aliasable(name) {
4391 var ret = this.aliases[name];
4393 ret.referenceCount++;
4397 ret = this.aliases[name] = this.source.wrap(name);
4398 ret.aliasable = true;
4399 ret.referenceCount = 1;
4404 setupHelper: function setupHelper(paramSize, name, blockHelper) {
4406 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
4407 var foundHelper = this.nameLookup('helpers', name, 'helper'),
4408 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : {}');
4412 paramsInit: paramsInit,
4414 callParams: [callContext].concat(params)
4418 setupParams: function setupParams(helper, paramSize, params) {
4423 objectArgs = !params,
4430 options.name = this.quotedString(helper);
4431 options.hash = this.popStack();
4433 if (this.trackIds) {
4434 options.hashIds = this.popStack();
4436 if (this.stringParams) {
4437 options.hashTypes = this.popStack();
4438 options.hashContexts = this.popStack();
4441 var inverse = this.popStack(),
4442 program = this.popStack();
4444 // Avoid setting fn and inverse if neither are set. This allows
4445 // helpers to do a check for `if (options.fn)`
4446 if (program || inverse) {
4447 options.fn = program || 'container.noop';
4448 options.inverse = inverse || 'container.noop';
4451 // The parameters go on to the stack in order (making sure that they are evaluated in order)
4452 // so we need to pop them off the stack in reverse order
4455 param = this.popStack();
4458 if (this.trackIds) {
4459 ids[i] = this.popStack();
4461 if (this.stringParams) {
4462 types[i] = this.popStack();
4463 contexts[i] = this.popStack();
4468 options.args = this.source.generateArray(params);
4471 if (this.trackIds) {
4472 options.ids = this.source.generateArray(ids);
4474 if (this.stringParams) {
4475 options.types = this.source.generateArray(types);
4476 options.contexts = this.source.generateArray(contexts);
4479 if (this.options.data) {
4480 options.data = 'data';
4482 if (this.useBlockParams) {
4483 options.blockParams = 'blockParams';
4488 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
4489 var options = this.setupParams(helper, paramSize, params);
4490 options = this.objectLiteral(options);
4492 this.useRegister('options');
4493 params.push('options');
4494 return ['options=', options];
4495 } else if (params) {
4496 params.push(options);
4505 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(' ');
4507 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
4509 for (var i = 0, l = reservedWords.length; i < l; i++) {
4510 compilerWords[reservedWords[i]] = true;
4514 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
4515 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
4518 function strictLookup(requireTerminal, compiler, parts, type) {
4519 var stack = compiler.popStack(),
4522 if (requireTerminal) {
4526 for (; i < len; i++) {
4527 stack = compiler.nameLookup(stack, parts[i], type);
4530 if (requireTerminal) {
4531 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')'];
4537 exports['default'] = JavaScriptCompiler;
4538 module.exports = exports['default'];
4542 /***/ function(module, exports, __webpack_require__) {
4547 exports.__esModule = true;
4549 var _utils = __webpack_require__(5);
4551 var SourceNode = undefined;
4554 /* istanbul ignore next */
4556 // We don't support this in AMD environments. For these environments, we asusme that
4557 // they are running on the browser and thus have no need for the source-map library.
4558 var SourceMap = require('source-map');
4559 SourceNode = SourceMap.SourceNode;
4564 /* istanbul ignore if: tested but not covered in istanbul due to dist build */
4566 SourceNode = function (line, column, srcFile, chunks) {
4572 /* istanbul ignore next */
4573 SourceNode.prototype = {
4574 add: function add(chunks) {
4575 if (_utils.isArray(chunks)) {
4576 chunks = chunks.join('');
4580 prepend: function prepend(chunks) {
4581 if (_utils.isArray(chunks)) {
4582 chunks = chunks.join('');
4584 this.src = chunks + this.src;
4586 toStringWithSourceMap: function toStringWithSourceMap() {
4587 return { code: this.toString() };
4589 toString: function toString() {
4595 function castChunk(chunk, codeGen, loc) {
4596 if (_utils.isArray(chunk)) {
4599 for (var i = 0, len = chunk.length; i < len; i++) {
4600 ret.push(codeGen.wrap(chunk[i], loc));
4603 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
4604 // Handle primitives that the SourceNode will throw up on
4610 function CodeGen(srcFile) {
4611 this.srcFile = srcFile;
4615 CodeGen.prototype = {
4616 isEmpty: function isEmpty() {
4617 return !this.source.length;
4619 prepend: function prepend(source, loc) {
4620 this.source.unshift(this.wrap(source, loc));
4622 push: function push(source, loc) {
4623 this.source.push(this.wrap(source, loc));
4626 merge: function merge() {
4627 var source = this.empty();
4628 this.each(function (line) {
4629 source.add([' ', line, '\n']);
4634 each: function each(iter) {
4635 for (var i = 0, len = this.source.length; i < len; i++) {
4636 iter(this.source[i]);
4640 empty: function empty() {
4641 var loc = this.currentLocation || { start: {} };
4642 return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
4644 wrap: function wrap(chunk) {
4645 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
4647 if (chunk instanceof SourceNode) {
4651 chunk = castChunk(chunk, this, loc);
4653 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
4656 functionCall: function functionCall(fn, type, params) {
4657 params = this.generateList(params);
4658 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
4661 quotedString: function quotedString(str) {
4662 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
4663 .replace(/\u2029/g, '\\u2029') + '"';
4666 objectLiteral: function objectLiteral(obj) {
4669 for (var key in obj) {
4670 if (obj.hasOwnProperty(key)) {
4671 var value = castChunk(obj[key], this);
4672 if (value !== 'undefined') {
4673 pairs.push([this.quotedString(key), ':', value]);
4678 var ret = this.generateList(pairs);
4684 generateList: function generateList(entries) {
4685 var ret = this.empty();
4687 for (var i = 0, len = entries.length; i < len; i++) {
4692 ret.add(castChunk(entries[i], this));
4698 generateArray: function generateArray(entries) {
4699 var ret = this.generateList(entries);
4707 exports['default'] = CodeGen;
4708 module.exports = exports['default'];