PluginProbe
Force Refresh / 2.1.0
Force Refresh v2.1.0
3.2.1 3.2.0 3.1.2 3.1.1 3.1.0 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.2.0 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.11.0 2.11.1 2.12.0 All 54 releases
force-refresh / node_modules / handlebars / dist / handlebars.runtime.js

handlebars.runtime.js in Force Refresh 2.1.0, at node_modules/handlebars/dist/handlebars.runtime.js

1,468 lines 40.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**!
2
3 @license
4 handlebars v4.0.12
5
6 Copyright (C) 2011-2017 by Yehuda Katz
7
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:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
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
24 THE SOFTWARE.
25
26 */
27 (function webpackUniversalModuleDefinition(root, factory) {
28 if(typeof exports === 'object' && typeof module === 'object')
29 module.exports = factory();
30 else if(typeof define === 'function' && define.amd)
31 define([], factory);
32 else if(typeof exports === 'object')
33 exports["Handlebars"] = factory();
34 else
35 root["Handlebars"] = factory();
36 })(this, function() {
37 return /******/ (function(modules) { // webpackBootstrap
38 /******/ // The module cache
39 /******/ var installedModules = {};
40
41 /******/ // The require function
42 /******/ function __webpack_require__(moduleId) {
43
44 /******/ // Check if module is in cache
45 /******/ if(installedModules[moduleId])
46 /******/ return installedModules[moduleId].exports;
47
48 /******/ // Create a new module (and put it into the cache)
49 /******/ var module = installedModules[moduleId] = {
50 /******/ exports: {},
51 /******/ id: moduleId,
52 /******/ loaded: false
53 /******/ };
54
55 /******/ // Execute the module function
56 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
57
58 /******/ // Flag the module as loaded
59 /******/ module.loaded = true;
60
61 /******/ // Return the exports of the module
62 /******/ return module.exports;
63 /******/ }
64
65
66 /******/ // expose the modules object (__webpack_modules__)
67 /******/ __webpack_require__.m = modules;
68
69 /******/ // expose the module cache
70 /******/ __webpack_require__.c = installedModules;
71
72 /******/ // __webpack_public_path__
73 /******/ __webpack_require__.p = "";
74
75 /******/ // Load entry module and return exports
76 /******/ return __webpack_require__(0);
77 /******/ })
78 /************************************************************************/
79 /******/ ([
80 /* 0 */
81 /***/ (function(module, exports, __webpack_require__) {
82
83 'use strict';
84
85 var _interopRequireWildcard = __webpack_require__(1)['default'];
86
87 var _interopRequireDefault = __webpack_require__(2)['default'];
88
89 exports.__esModule = true;
90
91 var _handlebarsBase = __webpack_require__(3);
92
93 var base = _interopRequireWildcard(_handlebarsBase);
94
95 // Each of these augment the Handlebars object. No need to setup here.
96 // (This is done to easily share code between commonjs and browse envs)
97
98 var _handlebarsSafeString = __webpack_require__(20);
99
100 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
101
102 var _handlebarsException = __webpack_require__(5);
103
104 var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
105
106 var _handlebarsUtils = __webpack_require__(4);
107
108 var Utils = _interopRequireWildcard(_handlebarsUtils);
109
110 var _handlebarsRuntime = __webpack_require__(21);
111
112 var runtime = _interopRequireWildcard(_handlebarsRuntime);
113
114 var _handlebarsNoConflict = __webpack_require__(33);
115
116 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
117
118 // For compatibility and usage outside of module systems, make the Handlebars object a namespace
119 function create() {
120 var hb = new base.HandlebarsEnvironment();
121
122 Utils.extend(hb, base);
123 hb.SafeString = _handlebarsSafeString2['default'];
124 hb.Exception = _handlebarsException2['default'];
125 hb.Utils = Utils;
126 hb.escapeExpression = Utils.escapeExpression;
127
128 hb.VM = runtime;
129 hb.template = function (spec) {
130 return runtime.template(spec, hb);
131 };
132
133 return hb;
134 }
135
136 var inst = create();
137 inst.create = create;
138
139 _handlebarsNoConflict2['default'](inst);
140
141 inst['default'] = inst;
142
143 exports['default'] = inst;
144 module.exports = exports['default'];
145
146 /***/ }),
147 /* 1 */
148 /***/ (function(module, exports) {
149
150 "use strict";
151
152 exports["default"] = function (obj) {
153 if (obj && obj.__esModule) {
154 return obj;
155 } else {
156 var newObj = {};
157
158 if (obj != null) {
159 for (var key in obj) {
160 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key];
161 }
162 }
163
164 newObj["default"] = obj;
165 return newObj;
166 }
167 };
168
169 exports.__esModule = true;
170
171 /***/ }),
172 /* 2 */
173 /***/ (function(module, exports) {
174
175 "use strict";
176
177 exports["default"] = function (obj) {
178 return obj && obj.__esModule ? obj : {
179 "default": obj
180 };
181 };
182
183 exports.__esModule = true;
184
185 /***/ }),
186 /* 3 */
187 /***/ (function(module, exports, __webpack_require__) {
188
189 'use strict';
190
191 var _interopRequireDefault = __webpack_require__(2)['default'];
192
193 exports.__esModule = true;
194 exports.HandlebarsEnvironment = HandlebarsEnvironment;
195
196 var _utils = __webpack_require__(4);
197
198 var _exception = __webpack_require__(5);
199
200 var _exception2 = _interopRequireDefault(_exception);
201
202 var _helpers = __webpack_require__(9);
203
204 var _decorators = __webpack_require__(17);
205
206 var _logger = __webpack_require__(19);
207
208 var _logger2 = _interopRequireDefault(_logger);
209
210 var VERSION = '4.0.12';
211 exports.VERSION = VERSION;
212 var COMPILER_REVISION = 7;
213
214 exports.COMPILER_REVISION = COMPILER_REVISION;
215 var REVISION_CHANGES = {
216 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
217 2: '== 1.0.0-rc.3',
218 3: '== 1.0.0-rc.4',
219 4: '== 1.x.x',
220 5: '== 2.0.0-alpha.x',
221 6: '>= 2.0.0-beta.1',
222 7: '>= 4.0.0'
223 };
224
225 exports.REVISION_CHANGES = REVISION_CHANGES;
226 var objectType = '[object Object]';
227
228 function HandlebarsEnvironment(helpers, partials, decorators) {
229 this.helpers = helpers || {};
230 this.partials = partials || {};
231 this.decorators = decorators || {};
232
233 _helpers.registerDefaultHelpers(this);
234 _decorators.registerDefaultDecorators(this);
235 }
236
237 HandlebarsEnvironment.prototype = {
238 constructor: HandlebarsEnvironment,
239
240 logger: _logger2['default'],
241 log: _logger2['default'].log,
242
243 registerHelper: function registerHelper(name, fn) {
244 if (_utils.toString.call(name) === objectType) {
245 if (fn) {
246 throw new _exception2['default']('Arg not supported with multiple helpers');
247 }
248 _utils.extend(this.helpers, name);
249 } else {
250 this.helpers[name] = fn;
251 }
252 },
253 unregisterHelper: function unregisterHelper(name) {
254 delete this.helpers[name];
255 },
256
257 registerPartial: function registerPartial(name, partial) {
258 if (_utils.toString.call(name) === objectType) {
259 _utils.extend(this.partials, name);
260 } else {
261 if (typeof partial === 'undefined') {
262 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined');
263 }
264 this.partials[name] = partial;
265 }
266 },
267 unregisterPartial: function unregisterPartial(name) {
268 delete this.partials[name];
269 },
270
271 registerDecorator: function registerDecorator(name, fn) {
272 if (_utils.toString.call(name) === objectType) {
273 if (fn) {
274 throw new _exception2['default']('Arg not supported with multiple decorators');
275 }
276 _utils.extend(this.decorators, name);
277 } else {
278 this.decorators[name] = fn;
279 }
280 },
281 unregisterDecorator: function unregisterDecorator(name) {
282 delete this.decorators[name];
283 }
284 };
285
286 var log = _logger2['default'].log;
287
288 exports.log = log;
289 exports.createFrame = _utils.createFrame;
290 exports.logger = _logger2['default'];
291
292 /***/ }),
293 /* 4 */
294 /***/ (function(module, exports) {
295
296 'use strict';
297
298 exports.__esModule = true;
299 exports.extend = extend;
300 exports.indexOf = indexOf;
301 exports.escapeExpression = escapeExpression;
302 exports.isEmpty = isEmpty;
303 exports.createFrame = createFrame;
304 exports.blockParams = blockParams;
305 exports.appendContextPath = appendContextPath;
306 var escape = {
307 '&': '&amp;',
308 '<': '&lt;',
309 '>': '&gt;',
310 '"': '&quot;',
311 "'": '&#x27;',
312 '`': '&#x60;',
313 '=': '&#x3D;'
314 };
315
316 var badChars = /[&<>"'`=]/g,
317 possible = /[&<>"'`=]/;
318
319 function escapeChar(chr) {
320 return escape[chr];
321 }
322
323 function extend(obj /* , ...source */) {
324 for (var i = 1; i < arguments.length; i++) {
325 for (var key in arguments[i]) {
326 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
327 obj[key] = arguments[i][key];
328 }
329 }
330 }
331
332 return obj;
333 }
334
335 var toString = Object.prototype.toString;
336
337 exports.toString = toString;
338 // Sourced from lodash
339 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
340 /* eslint-disable func-style */
341 var isFunction = function isFunction(value) {
342 return typeof value === 'function';
343 };
344 // fallback for older versions of Chrome and Safari
345 /* istanbul ignore next */
346 if (isFunction(/x/)) {
347 exports.isFunction = isFunction = function (value) {
348 return typeof value === 'function' && toString.call(value) === '[object Function]';
349 };
350 }
351 exports.isFunction = isFunction;
352
353 /* eslint-enable func-style */
354
355 /* istanbul ignore next */
356 var isArray = Array.isArray || function (value) {
357 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false;
358 };
359
360 exports.isArray = isArray;
361 // Older IE versions do not directly support indexOf so we must implement our own, sadly.
362
363 function indexOf(array, value) {
364 for (var i = 0, len = array.length; i < len; i++) {
365 if (array[i] === value) {
366 return i;
367 }
368 }
369 return -1;
370 }
371
372 function escapeExpression(string) {
373 if (typeof string !== 'string') {
374 // don't escape SafeStrings, since they're already safe
375 if (string && string.toHTML) {
376 return string.toHTML();
377 } else if (string == null) {
378 return '';
379 } else if (!string) {
380 return string + '';
381 }
382
383 // Force a string conversion as this will be done by the append regardless and
384 // the regex test will do this transparently behind the scenes, causing issues if
385 // an object's to string has escaped characters in it.
386 string = '' + string;
387 }
388
389 if (!possible.test(string)) {
390 return string;
391 }
392 return string.replace(badChars, escapeChar);
393 }
394
395 function isEmpty(value) {
396 if (!value && value !== 0) {
397 return true;
398 } else if (isArray(value) && value.length === 0) {
399 return true;
400 } else {
401 return false;
402 }
403 }
404
405 function createFrame(object) {
406 var frame = extend({}, object);
407 frame._parent = object;
408 return frame;
409 }
410
411 function blockParams(params, ids) {
412 params.path = ids;
413 return params;
414 }
415
416 function appendContextPath(contextPath, id) {
417 return (contextPath ? contextPath + '.' : '') + id;
418 }
419
420 /***/ }),
421 /* 5 */
422 /***/ (function(module, exports, __webpack_require__) {
423
424 'use strict';
425
426 var _Object$defineProperty = __webpack_require__(6)['default'];
427
428 exports.__esModule = true;
429
430 var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
431
432 function Exception(message, node) {
433 var loc = node && node.loc,
434 line = undefined,
435 column = undefined;
436 if (loc) {
437 line = loc.start.line;
438 column = loc.start.column;
439
440 message += ' - ' + line + ':' + column;
441 }
442
443 var tmp = Error.prototype.constructor.call(this, message);
444
445 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
446 for (var idx = 0; idx < errorProps.length; idx++) {
447 this[errorProps[idx]] = tmp[errorProps[idx]];
448 }
449
450 /* istanbul ignore else */
451 if (Error.captureStackTrace) {
452 Error.captureStackTrace(this, Exception);
453 }
454
455 try {
456 if (loc) {
457 this.lineNumber = line;
458
459 // Work around issue under safari where we can't directly set the column value
460 /* istanbul ignore next */
461 if (_Object$defineProperty) {
462 Object.defineProperty(this, 'column', {
463 value: column,
464 enumerable: true
465 });
466 } else {
467 this.column = column;
468 }
469 }
470 } catch (nop) {
471 /* Ignore if the browser is very particular */
472 }
473 }
474
475 Exception.prototype = new Error();
476
477 exports['default'] = Exception;
478 module.exports = exports['default'];
479
480 /***/ }),
481 /* 6 */
482 /***/ (function(module, exports, __webpack_require__) {
483
484 module.exports = { "default": __webpack_require__(7), __esModule: true };
485
486 /***/ }),
487 /* 7 */
488 /***/ (function(module, exports, __webpack_require__) {
489
490 var $ = __webpack_require__(8);
491 module.exports = function defineProperty(it, key, desc){
492 return $.setDesc(it, key, desc);
493 };
494
495 /***/ }),
496 /* 8 */
497 /***/ (function(module, exports) {
498
499 var $Object = Object;
500 module.exports = {
501 create: $Object.create,
502 getProto: $Object.getPrototypeOf,
503 isEnum: {}.propertyIsEnumerable,
504 getDesc: $Object.getOwnPropertyDescriptor,
505 setDesc: $Object.defineProperty,
506 setDescs: $Object.defineProperties,
507 getKeys: $Object.keys,
508 getNames: $Object.getOwnPropertyNames,
509 getSymbols: $Object.getOwnPropertySymbols,
510 each: [].forEach
511 };
512
513 /***/ }),
514 /* 9 */
515 /***/ (function(module, exports, __webpack_require__) {
516
517 'use strict';
518
519 var _interopRequireDefault = __webpack_require__(2)['default'];
520
521 exports.__esModule = true;
522 exports.registerDefaultHelpers = registerDefaultHelpers;
523
524 var _helpersBlockHelperMissing = __webpack_require__(10);
525
526 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
527
528 var _helpersEach = __webpack_require__(11);
529
530 var _helpersEach2 = _interopRequireDefault(_helpersEach);
531
532 var _helpersHelperMissing = __webpack_require__(12);
533
534 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
535
536 var _helpersIf = __webpack_require__(13);
537
538 var _helpersIf2 = _interopRequireDefault(_helpersIf);
539
540 var _helpersLog = __webpack_require__(14);
541
542 var _helpersLog2 = _interopRequireDefault(_helpersLog);
543
544 var _helpersLookup = __webpack_require__(15);
545
546 var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
547
548 var _helpersWith = __webpack_require__(16);
549
550 var _helpersWith2 = _interopRequireDefault(_helpersWith);
551
552 function registerDefaultHelpers(instance) {
553 _helpersBlockHelperMissing2['default'](instance);
554 _helpersEach2['default'](instance);
555 _helpersHelperMissing2['default'](instance);
556 _helpersIf2['default'](instance);
557 _helpersLog2['default'](instance);
558 _helpersLookup2['default'](instance);
559 _helpersWith2['default'](instance);
560 }
561
562 /***/ }),
563 /* 10 */
564 /***/ (function(module, exports, __webpack_require__) {
565
566 'use strict';
567
568 exports.__esModule = true;
569
570 var _utils = __webpack_require__(4);
571
572 exports['default'] = function (instance) {
573 instance.registerHelper('blockHelperMissing', function (context, options) {
574 var inverse = options.inverse,
575 fn = options.fn;
576
577 if (context === true) {
578 return fn(this);
579 } else if (context === false || context == null) {
580 return inverse(this);
581 } else if (_utils.isArray(context)) {
582 if (context.length > 0) {
583 if (options.ids) {
584 options.ids = [options.name];
585 }
586
587 return instance.helpers.each(context, options);
588 } else {
589 return inverse(this);
590 }
591 } else {
592 if (options.data && options.ids) {
593 var data = _utils.createFrame(options.data);
594 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
595 options = { data: data };
596 }
597
598 return fn(context, options);
599 }
600 });
601 };
602
603 module.exports = exports['default'];
604
605 /***/ }),
606 /* 11 */
607 /***/ (function(module, exports, __webpack_require__) {
608
609 'use strict';
610
611 var _interopRequireDefault = __webpack_require__(2)['default'];
612
613 exports.__esModule = true;
614
615 var _utils = __webpack_require__(4);
616
617 var _exception = __webpack_require__(5);
618
619 var _exception2 = _interopRequireDefault(_exception);
620
621 exports['default'] = function (instance) {
622 instance.registerHelper('each', function (context, options) {
623 if (!options) {
624 throw new _exception2['default']('Must pass iterator to #each');
625 }
626
627 var fn = options.fn,
628 inverse = options.inverse,
629 i = 0,
630 ret = '',
631 data = undefined,
632 contextPath = undefined;
633
634 if (options.data && options.ids) {
635 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
636 }
637
638 if (_utils.isFunction(context)) {
639 context = context.call(this);
640 }
641
642 if (options.data) {
643 data = _utils.createFrame(options.data);
644 }
645
646 function execIteration(field, index, last) {
647 if (data) {
648 data.key = field;
649 data.index = index;
650 data.first = index === 0;
651 data.last = !!last;
652
653 if (contextPath) {
654 data.contextPath = contextPath + field;
655 }
656 }
657
658 ret = ret + fn(context[field], {
659 data: data,
660 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
661 });
662 }
663
664 if (context && typeof context === 'object') {
665 if (_utils.isArray(context)) {
666 for (var j = context.length; i < j; i++) {
667 if (i in context) {
668 execIteration(i, i, i === context.length - 1);
669 }
670 }
671 } else {
672 var priorKey = undefined;
673
674 for (var key in context) {
675 if (context.hasOwnProperty(key)) {
676 // We're running the iterations one step out of sync so we can detect
677 // the last iteration without have to scan the object twice and create
678 // an itermediate keys array.
679 if (priorKey !== undefined) {
680 execIteration(priorKey, i - 1);
681 }
682 priorKey = key;
683 i++;
684 }
685 }
686 if (priorKey !== undefined) {
687 execIteration(priorKey, i - 1, true);
688 }
689 }
690 }
691
692 if (i === 0) {
693 ret = inverse(this);
694 }
695
696 return ret;
697 });
698 };
699
700 module.exports = exports['default'];
701
702 /***/ }),
703 /* 12 */
704 /***/ (function(module, exports, __webpack_require__) {
705
706 'use strict';
707
708 var _interopRequireDefault = __webpack_require__(2)['default'];
709
710 exports.__esModule = true;
711
712 var _exception = __webpack_require__(5);
713
714 var _exception2 = _interopRequireDefault(_exception);
715
716 exports['default'] = function (instance) {
717 instance.registerHelper('helperMissing', function () /* [args, ]options */{
718 if (arguments.length === 1) {
719 // A missing field in a {{foo}} construct.
720 return undefined;
721 } else {
722 // Someone is actually trying to call something, blow up.
723 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
724 }
725 });
726 };
727
728 module.exports = exports['default'];
729
730 /***/ }),
731 /* 13 */
732 /***/ (function(module, exports, __webpack_require__) {
733
734 'use strict';
735
736 exports.__esModule = true;
737
738 var _utils = __webpack_require__(4);
739
740 exports['default'] = function (instance) {
741 instance.registerHelper('if', function (conditional, options) {
742 if (_utils.isFunction(conditional)) {
743 conditional = conditional.call(this);
744 }
745
746 // Default behavior is to render the positive path if the value is truthy and not empty.
747 // The `includeZero` option may be set to treat the condtional as purely not empty based on the
748 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
749 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
750 return options.inverse(this);
751 } else {
752 return options.fn(this);
753 }
754 });
755
756 instance.registerHelper('unless', function (conditional, options) {
757 return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
758 });
759 };
760
761 module.exports = exports['default'];
762
763 /***/ }),
764 /* 14 */
765 /***/ (function(module, exports) {
766
767 'use strict';
768
769 exports.__esModule = true;
770
771 exports['default'] = function (instance) {
772 instance.registerHelper('log', function () /* message, options */{
773 var args = [undefined],
774 options = arguments[arguments.length - 1];
775 for (var i = 0; i < arguments.length - 1; i++) {
776 args.push(arguments[i]);
777 }
778
779 var level = 1;
780 if (options.hash.level != null) {
781 level = options.hash.level;
782 } else if (options.data && options.data.level != null) {
783 level = options.data.level;
784 }
785 args[0] = level;
786
787 instance.log.apply(instance, args);
788 });
789 };
790
791 module.exports = exports['default'];
792
793 /***/ }),
794 /* 15 */
795 /***/ (function(module, exports) {
796
797 'use strict';
798
799 exports.__esModule = true;
800
801 exports['default'] = function (instance) {
802 instance.registerHelper('lookup', function (obj, field) {
803 return obj && obj[field];
804 });
805 };
806
807 module.exports = exports['default'];
808
809 /***/ }),
810 /* 16 */
811 /***/ (function(module, exports, __webpack_require__) {
812
813 'use strict';
814
815 exports.__esModule = true;
816
817 var _utils = __webpack_require__(4);
818
819 exports['default'] = function (instance) {
820 instance.registerHelper('with', function (context, options) {
821 if (_utils.isFunction(context)) {
822 context = context.call(this);
823 }
824
825 var fn = options.fn;
826
827 if (!_utils.isEmpty(context)) {
828 var data = options.data;
829 if (options.data && options.ids) {
830 data = _utils.createFrame(options.data);
831 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
832 }
833
834 return fn(context, {
835 data: data,
836 blockParams: _utils.blockParams([context], [data && data.contextPath])
837 });
838 } else {
839 return options.inverse(this);
840 }
841 });
842 };
843
844 module.exports = exports['default'];
845
846 /***/ }),
847 /* 17 */
848 /***/ (function(module, exports, __webpack_require__) {
849
850 'use strict';
851
852 var _interopRequireDefault = __webpack_require__(2)['default'];
853
854 exports.__esModule = true;
855 exports.registerDefaultDecorators = registerDefaultDecorators;
856
857 var _decoratorsInline = __webpack_require__(18);
858
859 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
860
861 function registerDefaultDecorators(instance) {
862 _decoratorsInline2['default'](instance);
863 }
864
865 /***/ }),
866 /* 18 */
867 /***/ (function(module, exports, __webpack_require__) {
868
869 'use strict';
870
871 exports.__esModule = true;
872
873 var _utils = __webpack_require__(4);
874
875 exports['default'] = function (instance) {
876 instance.registerDecorator('inline', function (fn, props, container, options) {
877 var ret = fn;
878 if (!props.partials) {
879 props.partials = {};
880 ret = function (context, options) {
881 // Create a new partials stack frame prior to exec.
882 var original = container.partials;
883 container.partials = _utils.extend({}, original, props.partials);
884 var ret = fn(context, options);
885 container.partials = original;
886 return ret;
887 };
888 }
889
890 props.partials[options.args[0]] = options.fn;
891
892 return ret;
893 });
894 };
895
896 module.exports = exports['default'];
897
898 /***/ }),
899 /* 19 */
900 /***/ (function(module, exports, __webpack_require__) {
901
902 'use strict';
903
904 exports.__esModule = true;
905
906 var _utils = __webpack_require__(4);
907
908 var logger = {
909 methodMap: ['debug', 'info', 'warn', 'error'],
910 level: 'info',
911
912 // Maps a given level value to the `methodMap` indexes above.
913 lookupLevel: function lookupLevel(level) {
914 if (typeof level === 'string') {
915 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
916 if (levelMap >= 0) {
917 level = levelMap;
918 } else {
919 level = parseInt(level, 10);
920 }
921 }
922
923 return level;
924 },
925
926 // Can be overridden in the host environment
927 log: function log(level) {
928 level = logger.lookupLevel(level);
929
930 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
931 var method = logger.methodMap[level];
932 if (!console[method]) {
933 // eslint-disable-line no-console
934 method = 'log';
935 }
936
937 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
938 message[_key - 1] = arguments[_key];
939 }
940
941 console[method].apply(console, message); // eslint-disable-line no-console
942 }
943 }
944 };
945
946 exports['default'] = logger;
947 module.exports = exports['default'];
948
949 /***/ }),
950 /* 20 */
951 /***/ (function(module, exports) {
952
953 // Build out our basic SafeString type
954 'use strict';
955
956 exports.__esModule = true;
957 function SafeString(string) {
958 this.string = string;
959 }
960
961 SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
962 return '' + this.string;
963 };
964
965 exports['default'] = SafeString;
966 module.exports = exports['default'];
967
968 /***/ }),
969 /* 21 */
970 /***/ (function(module, exports, __webpack_require__) {
971
972 'use strict';
973
974 var _Object$seal = __webpack_require__(22)['default'];
975
976 var _interopRequireWildcard = __webpack_require__(1)['default'];
977
978 var _interopRequireDefault = __webpack_require__(2)['default'];
979
980 exports.__esModule = true;
981 exports.checkRevision = checkRevision;
982 exports.template = template;
983 exports.wrapProgram = wrapProgram;
984 exports.resolvePartial = resolvePartial;
985 exports.invokePartial = invokePartial;
986 exports.noop = noop;
987
988 var _utils = __webpack_require__(4);
989
990 var Utils = _interopRequireWildcard(_utils);
991
992 var _exception = __webpack_require__(5);
993
994 var _exception2 = _interopRequireDefault(_exception);
995
996 var _base = __webpack_require__(3);
997
998 function checkRevision(compilerInfo) {
999 var compilerRevision = compilerInfo && compilerInfo[0] || 1,
1000 currentRevision = _base.COMPILER_REVISION;
1001
1002 if (compilerRevision !== currentRevision) {
1003 if (compilerRevision < currentRevision) {
1004 var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
1005 compilerVersions = _base.REVISION_CHANGES[compilerRevision];
1006 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 + ').');
1007 } else {
1008 // Use the embedded version info since the runtime doesn't know about this revision yet
1009 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] + ').');
1010 }
1011 }
1012 }
1013
1014 function template(templateSpec, env) {
1015 /* istanbul ignore next */
1016 if (!env) {
1017 throw new _exception2['default']('No environment passed to template');
1018 }
1019 if (!templateSpec || !templateSpec.main) {
1020 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
1021 }
1022
1023 templateSpec.main.decorator = templateSpec.main_d;
1024
1025 // Note: Using env.VM references rather than local var references throughout this section to allow
1026 // for external users to override these as psuedo-supported APIs.
1027 env.VM.checkRevision(templateSpec.compiler);
1028
1029 function invokePartialWrapper(partial, context, options) {
1030 if (options.hash) {
1031 context = Utils.extend({}, context, options.hash);
1032 if (options.ids) {
1033 options.ids[0] = true;
1034 }
1035 }
1036
1037 partial = env.VM.resolvePartial.call(this, partial, context, options);
1038 var result = env.VM.invokePartial.call(this, partial, context, options);
1039
1040 if (result == null && env.compile) {
1041 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1042 result = options.partials[options.name](context, options);
1043 }
1044 if (result != null) {
1045 if (options.indent) {
1046 var lines = result.split('\n');
1047 for (var i = 0, l = lines.length; i < l; i++) {
1048 if (!lines[i] && i + 1 === l) {
1049 break;
1050 }
1051
1052 lines[i] = options.indent + lines[i];
1053 }
1054 result = lines.join('\n');
1055 }
1056 return result;
1057 } else {
1058 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1059 }
1060 }
1061
1062 // Just add water
1063 var container = {
1064 strict: function strict(obj, name) {
1065 if (!(name in obj)) {
1066 throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1067 }
1068 return obj[name];
1069 },
1070 lookup: function lookup(depths, name) {
1071 var len = depths.length;
1072 for (var i = 0; i < len; i++) {
1073 if (depths[i] && depths[i][name] != null) {
1074 return depths[i][name];
1075 }
1076 }
1077 },
1078 lambda: function lambda(current, context) {
1079 return typeof current === 'function' ? current.call(context) : current;
1080 },
1081
1082 escapeExpression: Utils.escapeExpression,
1083 invokePartial: invokePartialWrapper,
1084
1085 fn: function fn(i) {
1086 var ret = templateSpec[i];
1087 ret.decorator = templateSpec[i + '_d'];
1088 return ret;
1089 },
1090
1091 programs: [],
1092 program: function program(i, data, declaredBlockParams, blockParams, depths) {
1093 var programWrapper = this.programs[i],
1094 fn = this.fn(i);
1095 if (data || depths || blockParams || declaredBlockParams) {
1096 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1097 } else if (!programWrapper) {
1098 programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1099 }
1100 return programWrapper;
1101 },
1102
1103 data: function data(value, depth) {
1104 while (value && depth--) {
1105 value = value._parent;
1106 }
1107 return value;
1108 },
1109 merge: function merge(param, common) {
1110 var obj = param || common;
1111
1112 if (param && common && param !== common) {
1113 obj = Utils.extend({}, common, param);
1114 }
1115
1116 return obj;
1117 },
1118 // An empty object to use as replacement for null-contexts
1119 nullContext: _Object$seal({}),
1120
1121 noop: env.VM.noop,
1122 compilerInfo: templateSpec.compiler
1123 };
1124
1125 function ret(context) {
1126 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1127
1128 var data = options.data;
1129
1130 ret._setup(options);
1131 if (!options.partial && templateSpec.useData) {
1132 data = initData(context, data);
1133 }
1134 var depths = undefined,
1135 blockParams = templateSpec.useBlockParams ? [] : undefined;
1136 if (templateSpec.useDepths) {
1137 if (options.depths) {
1138 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths;
1139 } else {
1140 depths = [context];
1141 }
1142 }
1143
1144 function main(context /*, options*/) {
1145 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1146 }
1147 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1148 return main(context, options);
1149 }
1150 ret.isTop = true;
1151
1152 ret._setup = function (options) {
1153 if (!options.partial) {
1154 container.helpers = container.merge(options.helpers, env.helpers);
1155
1156 if (templateSpec.usePartial) {
1157 container.partials = container.merge(options.partials, env.partials);
1158 }
1159 if (templateSpec.usePartial || templateSpec.useDecorators) {
1160 container.decorators = container.merge(options.decorators, env.decorators);
1161 }
1162 } else {
1163 container.helpers = options.helpers;
1164 container.partials = options.partials;
1165 container.decorators = options.decorators;
1166 }
1167 };
1168
1169 ret._child = function (i, data, blockParams, depths) {
1170 if (templateSpec.useBlockParams && !blockParams) {
1171 throw new _exception2['default']('must pass block params');
1172 }
1173 if (templateSpec.useDepths && !depths) {
1174 throw new _exception2['default']('must pass parent depths');
1175 }
1176
1177 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1178 };
1179 return ret;
1180 }
1181
1182 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1183 function prog(context) {
1184 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1185
1186 var currentDepths = depths;
1187 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) {
1188 currentDepths = [context].concat(depths);
1189 }
1190
1191 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1192 }
1193
1194 prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1195
1196 prog.program = i;
1197 prog.depth = depths ? depths.length : 0;
1198 prog.blockParams = declaredBlockParams || 0;
1199 return prog;
1200 }
1201
1202 function resolvePartial(partial, context, options) {
1203 if (!partial) {
1204 if (options.name === '@partial-block') {
1205 partial = options.data['partial-block'];
1206 } else {
1207 partial = options.partials[options.name];
1208 }
1209 } else if (!partial.call && !options.name) {
1210 // This is a dynamic partial that returned a string
1211 options.name = partial;
1212 partial = options.partials[partial];
1213 }
1214 return partial;
1215 }
1216
1217 function invokePartial(partial, context, options) {
1218 // Use the current closure context to save the partial-block if this partial
1219 var currentPartialBlock = options.data && options.data['partial-block'];
1220 options.partial = true;
1221 if (options.ids) {
1222 options.data.contextPath = options.ids[0] || options.data.contextPath;
1223 }
1224
1225 var partialBlock = undefined;
1226 if (options.fn && options.fn !== noop) {
1227 (function () {
1228 options.data = _base.createFrame(options.data);
1229 // Wrapper function to get access to currentPartialBlock from the closure
1230 var fn = options.fn;
1231 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) {
1232 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1233
1234 // Restore the partial-block from the closure for the execution of the block
1235 // i.e. the part inside the block of the partial call.
1236 options.data = _base.createFrame(options.data);
1237 options.data['partial-block'] = currentPartialBlock;
1238 return fn(context, options);
1239 };
1240 if (fn.partials) {
1241 options.partials = Utils.extend({}, options.partials, fn.partials);
1242 }
1243 })();
1244 }
1245
1246 if (partial === undefined && partialBlock) {
1247 partial = partialBlock;
1248 }
1249
1250 if (partial === undefined) {
1251 throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1252 } else if (partial instanceof Function) {
1253 return partial(context, options);
1254 }
1255 }
1256
1257 function noop() {
1258 return '';
1259 }
1260
1261 function initData(context, data) {
1262 if (!data || !('root' in data)) {
1263 data = data ? _base.createFrame(data) : {};
1264 data.root = context;
1265 }
1266 return data;
1267 }
1268
1269 function executeDecorators(fn, prog, container, depths, data, blockParams) {
1270 if (fn.decorator) {
1271 var props = {};
1272 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1273 Utils.extend(prog, props);
1274 }
1275 return prog;
1276 }
1277
1278 /***/ }),
1279 /* 22 */
1280 /***/ (function(module, exports, __webpack_require__) {
1281
1282 module.exports = { "default": __webpack_require__(23), __esModule: true };
1283
1284 /***/ }),
1285 /* 23 */
1286 /***/ (function(module, exports, __webpack_require__) {
1287
1288 __webpack_require__(24);
1289 module.exports = __webpack_require__(29).Object.seal;
1290
1291 /***/ }),
1292 /* 24 */
1293 /***/ (function(module, exports, __webpack_require__) {
1294
1295 // 19.1.2.17 Object.seal(O)
1296 var isObject = __webpack_require__(25);
1297
1298 __webpack_require__(26)('seal', function($seal){
1299 return function seal(it){
1300 return $seal && isObject(it) ? $seal(it) : it;
1301 };
1302 });
1303
1304 /***/ }),
1305 /* 25 */
1306 /***/ (function(module, exports) {
1307
1308 module.exports = function(it){
1309 return typeof it === 'object' ? it !== null : typeof it === 'function';
1310 };
1311
1312 /***/ }),
1313 /* 26 */
1314 /***/ (function(module, exports, __webpack_require__) {
1315
1316 // most Object methods by ES6 should accept primitives
1317 var $export = __webpack_require__(27)
1318 , core = __webpack_require__(29)
1319 , fails = __webpack_require__(32);
1320 module.exports = function(KEY, exec){
1321 var fn = (core.Object || {})[KEY] || Object[KEY]
1322 , exp = {};
1323 exp[KEY] = exec(fn);
1324 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);
1325 };
1326
1327 /***/ }),
1328 /* 27 */
1329 /***/ (function(module, exports, __webpack_require__) {
1330
1331 var global = __webpack_require__(28)
1332 , core = __webpack_require__(29)
1333 , ctx = __webpack_require__(30)
1334 , PROTOTYPE = 'prototype';
1335
1336 var $export = function(type, name, source){
1337 var IS_FORCED = type & $export.F
1338 , IS_GLOBAL = type & $export.G
1339 , IS_STATIC = type & $export.S
1340 , IS_PROTO = type & $export.P
1341 , IS_BIND = type & $export.B
1342 , IS_WRAP = type & $export.W
1343 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})
1344 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]
1345 , key, own, out;
1346 if(IS_GLOBAL)source = name;
1347 for(key in source){
1348 // contains in native
1349 own = !IS_FORCED && target && key in target;
1350 if(own && key in exports)continue;
1351 // export native or passed
1352 out = own ? target[key] : source[key];
1353 // prevent global pollution for namespaces
1354 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
1355 // bind timers to global for call from export context
1356 : IS_BIND && own ? ctx(out, global)
1357 // wrap global constructors for prevent change them in library
1358 : IS_WRAP && target[key] == out ? (function(C){
1359 var F = function(param){
1360 return this instanceof C ? new C(param) : C(param);
1361 };
1362 F[PROTOTYPE] = C[PROTOTYPE];
1363 return F;
1364 // make static versions for prototype methods
1365 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
1366 if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
1367 }
1368 };
1369 // type bitmap
1370 $export.F = 1; // forced
1371 $export.G = 2; // global
1372 $export.S = 4; // static
1373 $export.P = 8; // proto
1374 $export.B = 16; // bind
1375 $export.W = 32; // wrap
1376 module.exports = $export;
1377
1378 /***/ }),
1379 /* 28 */
1380 /***/ (function(module, exports) {
1381
1382 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
1383 var global = module.exports = typeof window != 'undefined' && window.Math == Math
1384 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
1385 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
1386
1387 /***/ }),
1388 /* 29 */
1389 /***/ (function(module, exports) {
1390
1391 var core = module.exports = {version: '1.2.6'};
1392 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
1393
1394 /***/ }),
1395 /* 30 */
1396 /***/ (function(module, exports, __webpack_require__) {
1397
1398 // optional / simple context binding
1399 var aFunction = __webpack_require__(31);
1400 module.exports = function(fn, that, length){
1401 aFunction(fn);
1402 if(that === undefined)return fn;
1403 switch(length){
1404 case 1: return function(a){
1405 return fn.call(that, a);
1406 };
1407 case 2: return function(a, b){
1408 return fn.call(that, a, b);
1409 };
1410 case 3: return function(a, b, c){
1411 return fn.call(that, a, b, c);
1412 };
1413 }
1414 return function(/* ...args */){
1415 return fn.apply(that, arguments);
1416 };
1417 };
1418
1419 /***/ }),
1420 /* 31 */
1421 /***/ (function(module, exports) {
1422
1423 module.exports = function(it){
1424 if(typeof it != 'function')throw TypeError(it + ' is not a function!');
1425 return it;
1426 };
1427
1428 /***/ }),
1429 /* 32 */
1430 /***/ (function(module, exports) {
1431
1432 module.exports = function(exec){
1433 try {
1434 return !!exec();
1435 } catch(e){
1436 return true;
1437 }
1438 };
1439
1440 /***/ }),
1441 /* 33 */
1442 /***/ (function(module, exports) {
1443
1444 /* WEBPACK VAR INJECTION */(function(global) {/* global window */
1445 'use strict';
1446
1447 exports.__esModule = true;
1448
1449 exports['default'] = function (Handlebars) {
1450 /* istanbul ignore next */
1451 var root = typeof global !== 'undefined' ? global : window,
1452 $Handlebars = root.Handlebars;
1453 /* istanbul ignore next */
1454 Handlebars.noConflict = function () {
1455 if (root.Handlebars === Handlebars) {
1456 root.Handlebars = $Handlebars;
1457 }
1458 return Handlebars;
1459 };
1460 };
1461
1462 module.exports = exports['default'];
1463 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1464
1465 /***/ })
1466 /******/ ])
1467 });
1468 ;