handlebars_assets 0.20.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
 
3
- handlebars v3.0.0
3
+ handlebars v4.0.2
4
4
 
5
- Copyright (C) 2011-2014 by Yehuda Katz
5
+ Copyright (C) 2011-2015 by Yehuda Katz
6
6
 
7
7
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  of this software and associated documentation files (the "Software"), to deal
@@ -24,703 +24,1216 @@ THE SOFTWARE.
24
24
 
25
25
  @license
26
26
  */
27
- /* exported Handlebars */
28
- (function (root, factory) {
29
- if (typeof define === 'function' && define.amd) {
30
- define([], factory);
31
- } else if (typeof exports === 'object') {
32
- module.exports = factory();
33
- } else {
34
- root.Handlebars = factory();
35
- }
36
- }(this, function () {
37
- // handlebars/utils.js
38
- var __module2__ = (function() {
39
- "use strict";
40
- var __exports__ = {};
41
- /*jshint -W004 */
42
- var escape = {
43
- "&": "&",
44
- "<": "&lt;",
45
- ">": "&gt;",
46
- '"': "&quot;",
47
- "'": "&#x27;",
48
- "`": "&#x60;"
49
- };
50
-
51
- var badChars = /[&<>"'`]/g;
52
- var possible = /[&<>"'`]/;
53
-
54
- function escapeChar(chr) {
55
- return escape[chr];
56
- }
57
-
58
- function extend(obj /* , ...source */) {
59
- for (var i = 1; i < arguments.length; i++) {
60
- for (var key in arguments[i]) {
61
- if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
62
- obj[key] = arguments[i][key];
63
- }
64
- }
65
- }
66
-
67
- return obj;
68
- }
69
-
70
- __exports__.extend = extend;var toString = Object.prototype.toString;
71
- __exports__.toString = toString;
72
- // Sourced from lodash
73
- // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
74
- var isFunction = function(value) {
75
- return typeof value === 'function';
76
- };
77
- // fallback for older versions of Chrome and Safari
78
- /* istanbul ignore next */
79
- if (isFunction(/x/)) {
80
- isFunction = function(value) {
81
- return typeof value === 'function' && toString.call(value) === '[object Function]';
82
- };
83
- }
84
- var isFunction;
85
- __exports__.isFunction = isFunction;
86
- /* istanbul ignore next */
87
- var isArray = Array.isArray || function(value) {
88
- return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
89
- };
90
- __exports__.isArray = isArray;
91
- // Older IE versions do not directly support indexOf so we must implement our own, sadly.
92
- function indexOf(array, value) {
93
- for (var i = 0, len = array.length; i < len; i++) {
94
- if (array[i] === value) {
95
- return i;
96
- }
97
- }
98
- return -1;
99
- }
100
-
101
- __exports__.indexOf = indexOf;
102
- function escapeExpression(string) {
103
- // don't escape SafeStrings, since they're already safe
104
- if (string && string.toHTML) {
105
- return string.toHTML();
106
- } else if (string == null) {
107
- return "";
108
- } else if (!string) {
109
- return string + '';
110
- }
111
-
112
- // Force a string conversion as this will be done by the append regardless and
113
- // the regex test will do this transparently behind the scenes, causing issues if
114
- // an object's to string has escaped characters in it.
115
- string = "" + string;
116
-
117
- if(!possible.test(string)) { return string; }
118
- return string.replace(badChars, escapeChar);
119
- }
120
-
121
- __exports__.escapeExpression = escapeExpression;function isEmpty(value) {
122
- if (!value && value !== 0) {
123
- return true;
124
- } else if (isArray(value) && value.length === 0) {
125
- return true;
126
- } else {
127
- return false;
128
- }
129
- }
130
-
131
- __exports__.isEmpty = isEmpty;function blockParams(params, ids) {
132
- params.path = ids;
133
- return params;
134
- }
135
-
136
- __exports__.blockParams = blockParams;function appendContextPath(contextPath, id) {
137
- return (contextPath ? contextPath + '.' : '') + id;
138
- }
139
-
140
- __exports__.appendContextPath = appendContextPath;
141
- return __exports__;
142
- })();
143
-
144
- // handlebars/exception.js
145
- var __module3__ = (function() {
146
- "use strict";
147
- var __exports__;
148
-
149
- var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
150
-
151
- function Exception(message, node) {
152
- var loc = node && node.loc,
153
- line,
154
- column;
155
- if (loc) {
156
- line = loc.start.line;
157
- column = loc.start.column;
158
-
159
- message += ' - ' + line + ':' + column;
160
- }
161
-
162
- var tmp = Error.prototype.constructor.call(this, message);
163
-
164
- // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
165
- for (var idx = 0; idx < errorProps.length; idx++) {
166
- this[errorProps[idx]] = tmp[errorProps[idx]];
167
- }
168
-
169
- if (loc) {
170
- this.lineNumber = line;
171
- this.column = column;
172
- }
173
- }
174
-
175
- Exception.prototype = new Error();
176
-
177
- __exports__ = Exception;
178
- return __exports__;
179
- })();
180
-
181
- // handlebars/base.js
182
- var __module1__ = (function(__dependency1__, __dependency2__) {
183
- "use strict";
184
- var __exports__ = {};
185
- var Utils = __dependency1__;
186
- var Exception = __dependency2__;
187
-
188
- var VERSION = "3.0.0";
189
- __exports__.VERSION = VERSION;var COMPILER_REVISION = 6;
190
- __exports__.COMPILER_REVISION = COMPILER_REVISION;
191
- var REVISION_CHANGES = {
192
- 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
193
- 2: '== 1.0.0-rc.3',
194
- 3: '== 1.0.0-rc.4',
195
- 4: '== 1.x.x',
196
- 5: '== 2.0.0-alpha.x',
197
- 6: '>= 2.0.0-beta.1'
198
- };
199
- __exports__.REVISION_CHANGES = REVISION_CHANGES;
200
- var isArray = Utils.isArray,
201
- isFunction = Utils.isFunction,
202
- toString = Utils.toString,
203
- objectType = '[object Object]';
204
-
205
- function HandlebarsEnvironment(helpers, partials) {
206
- this.helpers = helpers || {};
207
- this.partials = partials || {};
208
-
209
- registerDefaultHelpers(this);
210
- }
211
-
212
- __exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
213
- constructor: HandlebarsEnvironment,
214
-
215
- logger: logger,
216
- log: log,
217
-
218
- registerHelper: function(name, fn) {
219
- if (toString.call(name) === objectType) {
220
- if (fn) { throw new Exception('Arg not supported with multiple helpers'); }
221
- Utils.extend(this.helpers, name);
222
- } else {
223
- this.helpers[name] = fn;
224
- }
225
- },
226
- unregisterHelper: function(name) {
227
- delete this.helpers[name];
228
- },
229
-
230
- registerPartial: function(name, partial) {
231
- if (toString.call(name) === objectType) {
232
- Utils.extend(this.partials, name);
233
- } else {
234
- if (typeof partial === 'undefined') {
235
- throw new Exception('Attempting to register a partial as undefined');
236
- }
237
- this.partials[name] = partial;
238
- }
239
- },
240
- unregisterPartial: function(name) {
241
- delete this.partials[name];
242
- }
243
- };
244
-
245
- function registerDefaultHelpers(instance) {
246
- instance.registerHelper('helperMissing', function(/* [args, ]options */) {
247
- if(arguments.length === 1) {
248
- // A missing field in a {{foo}} constuct.
249
- return undefined;
250
- } else {
251
- // Someone is actually trying to call something, blow up.
252
- throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'");
253
- }
254
- });
255
-
256
- instance.registerHelper('blockHelperMissing', function(context, options) {
257
- var inverse = options.inverse,
258
- fn = options.fn;
259
-
260
- if(context === true) {
261
- return fn(this);
262
- } else if(context === false || context == null) {
263
- return inverse(this);
264
- } else if (isArray(context)) {
265
- if(context.length > 0) {
266
- if (options.ids) {
267
- options.ids = [options.name];
268
- }
269
-
270
- return instance.helpers.each(context, options);
271
- } else {
272
- return inverse(this);
273
- }
274
- } else {
275
- if (options.data && options.ids) {
276
- var data = createFrame(options.data);
277
- data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
278
- options = {data: data};
279
- }
280
-
281
- return fn(context, options);
282
- }
283
- });
284
-
285
- instance.registerHelper('each', function(context, options) {
286
- if (!options) {
287
- throw new Exception('Must pass iterator to #each');
288
- }
289
-
290
- var fn = options.fn, inverse = options.inverse;
291
- var i = 0, ret = "", data;
292
-
293
- var contextPath;
294
- if (options.data && options.ids) {
295
- contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
296
- }
297
-
298
- if (isFunction(context)) { context = context.call(this); }
299
-
300
- if (options.data) {
301
- data = createFrame(options.data);
302
- }
303
-
304
- function execIteration(key, i, last) {
305
- if (data) {
306
- data.key = key;
307
- data.index = i;
308
- data.first = i === 0;
309
- data.last = !!last;
310
-
311
- if (contextPath) {
312
- data.contextPath = contextPath + key;
313
- }
314
- }
315
-
316
- ret = ret + fn(context[key], {
317
- data: data,
318
- blockParams: Utils.blockParams([context[key], key], [contextPath + key, null])
319
- });
320
- }
321
-
322
- if(context && typeof context === 'object') {
323
- if (isArray(context)) {
324
- for(var j = context.length; i<j; i++) {
325
- execIteration(i, i, i === context.length-1);
326
- }
327
- } else {
328
- var priorKey;
329
-
330
- for(var key in context) {
331
- if(context.hasOwnProperty(key)) {
332
- // We're running the iterations one step out of sync so we can detect
333
- // the last iteration without have to scan the object twice and create
334
- // an itermediate keys array.
335
- if (priorKey) {
336
- execIteration(priorKey, i-1);
337
- }
338
- priorKey = key;
339
- i++;
340
- }
341
- }
342
- if (priorKey) {
343
- execIteration(priorKey, i-1, true);
344
- }
345
- }
346
- }
347
-
348
- if(i === 0){
349
- ret = inverse(this);
350
- }
351
-
352
- return ret;
353
- });
354
-
355
- instance.registerHelper('if', function(conditional, options) {
356
- if (isFunction(conditional)) { conditional = conditional.call(this); }
357
-
358
- // Default behavior is to render the positive path if the value is truthy and not empty.
359
- // The `includeZero` option may be set to treat the condtional as purely not empty based on the
360
- // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
361
- if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
362
- return options.inverse(this);
363
- } else {
364
- return options.fn(this);
365
- }
366
- });
367
-
368
- instance.registerHelper('unless', function(conditional, options) {
369
- return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
370
- });
371
-
372
- instance.registerHelper('with', function(context, options) {
373
- if (isFunction(context)) { context = context.call(this); }
374
-
375
- var fn = options.fn;
376
-
377
- if (!Utils.isEmpty(context)) {
378
- if (options.data && options.ids) {
379
- var data = createFrame(options.data);
380
- data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
381
- options = {data:data};
382
- }
383
-
384
- return fn(context, options);
385
- } else {
386
- return options.inverse(this);
387
- }
388
- });
389
-
390
- instance.registerHelper('log', function(message, options) {
391
- var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
392
- instance.log(level, message);
393
- });
394
-
395
- instance.registerHelper('lookup', function(obj, field) {
396
- return obj && obj[field];
397
- });
398
- }
399
-
400
- var logger = {
401
- methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
402
-
403
- // State enum
404
- DEBUG: 0,
405
- INFO: 1,
406
- WARN: 2,
407
- ERROR: 3,
408
- level: 1,
409
-
410
- // Can be overridden in the host environment
411
- log: function(level, message) {
412
- if (typeof console !== 'undefined' && logger.level <= level) {
413
- var method = logger.methodMap[level];
414
- (console[method] || console.log).call(console, message);
415
- }
416
- }
417
- };
418
- __exports__.logger = logger;
419
- var log = logger.log;
420
- __exports__.log = log;
421
- var createFrame = function(object) {
422
- var frame = Utils.extend({}, object);
423
- frame._parent = object;
424
- return frame;
425
- };
426
- __exports__.createFrame = createFrame;
427
- return __exports__;
428
- })(__module2__, __module3__);
429
-
430
- // handlebars/safe-string.js
431
- var __module4__ = (function() {
432
- "use strict";
433
- var __exports__;
434
- // Build out our basic SafeString type
435
- function SafeString(string) {
436
- this.string = string;
437
- }
438
-
439
- SafeString.prototype.toString = SafeString.prototype.toHTML = function() {
440
- return "" + this.string;
441
- };
442
-
443
- __exports__ = SafeString;
444
- return __exports__;
445
- })();
446
-
447
- // handlebars/runtime.js
448
- var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
449
- "use strict";
450
- var __exports__ = {};
451
- var Utils = __dependency1__;
452
- var Exception = __dependency2__;
453
- var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
454
- var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
455
- var createFrame = __dependency3__.createFrame;
456
-
457
- function checkRevision(compilerInfo) {
458
- var compilerRevision = compilerInfo && compilerInfo[0] || 1,
459
- currentRevision = COMPILER_REVISION;
460
-
461
- if (compilerRevision !== currentRevision) {
462
- if (compilerRevision < currentRevision) {
463
- var runtimeVersions = REVISION_CHANGES[currentRevision],
464
- compilerVersions = REVISION_CHANGES[compilerRevision];
465
- throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
466
- "Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
467
- } else {
468
- // Use the embedded version info since the runtime doesn't know about this revision yet
469
- throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
470
- "Please update your runtime to a newer version ("+compilerInfo[1]+").");
471
- }
472
- }
473
- }
474
-
475
- __exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
476
-
477
- function template(templateSpec, env) {
478
- /* istanbul ignore next */
479
- if (!env) {
480
- throw new Exception("No environment passed to template");
481
- }
482
- if (!templateSpec || !templateSpec.main) {
483
- throw new Exception('Unknown template object: ' + typeof templateSpec);
484
- }
485
-
486
- // Note: Using env.VM references rather than local var references throughout this section to allow
487
- // for external users to override these as psuedo-supported APIs.
488
- env.VM.checkRevision(templateSpec.compiler);
489
-
490
- var invokePartialWrapper = function(partial, context, options) {
491
- if (options.hash) {
492
- context = Utils.extend({}, context, options.hash);
493
- }
494
-
495
- partial = env.VM.resolvePartial.call(this, partial, context, options);
496
- var result = env.VM.invokePartial.call(this, partial, context, options);
497
-
498
- if (result == null && env.compile) {
499
- options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
500
- result = options.partials[options.name](context, options);
501
- }
502
- if (result != null) {
503
- if (options.indent) {
504
- var lines = result.split('\n');
505
- for (var i = 0, l = lines.length; i < l; i++) {
506
- if (!lines[i] && i + 1 === l) {
507
- break;
508
- }
509
-
510
- lines[i] = options.indent + lines[i];
511
- }
512
- result = lines.join('\n');
513
- }
514
- return result;
515
- } else {
516
- throw new Exception("The partial " + options.name + " could not be compiled when running in runtime-only mode");
517
- }
518
- };
519
-
520
- // Just add water
521
- var container = {
522
- strict: function(obj, name) {
523
- if (!(name in obj)) {
524
- throw new Exception('"' + name + '" not defined in ' + obj);
525
- }
526
- return obj[name];
527
- },
528
- lookup: function(depths, name) {
529
- var len = depths.length;
530
- for (var i = 0; i < len; i++) {
531
- if (depths[i] && depths[i][name] != null) {
532
- return depths[i][name];
533
- }
534
- }
535
- },
536
- lambda: function(current, context) {
537
- return typeof current === 'function' ? current.call(context) : current;
538
- },
539
-
540
- escapeExpression: Utils.escapeExpression,
541
- invokePartial: invokePartialWrapper,
542
-
543
- fn: function(i) {
544
- return templateSpec[i];
545
- },
546
-
547
- programs: [],
548
- program: function(i, data, declaredBlockParams, blockParams, depths) {
549
- var programWrapper = this.programs[i],
550
- fn = this.fn(i);
551
- if (data || depths || blockParams || declaredBlockParams) {
552
- programWrapper = program(this, i, fn, data, declaredBlockParams, blockParams, depths);
553
- } else if (!programWrapper) {
554
- programWrapper = this.programs[i] = program(this, i, fn);
555
- }
556
- return programWrapper;
557
- },
558
-
559
- data: function(data, depth) {
560
- while (data && depth--) {
561
- data = data._parent;
562
- }
563
- return data;
564
- },
565
- merge: function(param, common) {
566
- var ret = param || common;
567
-
568
- if (param && common && (param !== common)) {
569
- ret = Utils.extend({}, common, param);
570
- }
571
-
572
- return ret;
573
- },
574
-
575
- noop: env.VM.noop,
576
- compilerInfo: templateSpec.compiler
577
- };
578
-
579
- var ret = function(context, options) {
580
- options = options || {};
581
- var data = options.data;
582
-
583
- ret._setup(options);
584
- if (!options.partial && templateSpec.useData) {
585
- data = initData(context, data);
586
- }
587
- var depths,
588
- blockParams = templateSpec.useBlockParams ? [] : undefined;
589
- if (templateSpec.useDepths) {
590
- depths = options.depths ? [context].concat(options.depths) : [context];
591
- }
592
-
593
- return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);
594
- };
595
- ret.isTop = true;
596
-
597
- ret._setup = function(options) {
598
- if (!options.partial) {
599
- container.helpers = container.merge(options.helpers, env.helpers);
600
-
601
- if (templateSpec.usePartial) {
602
- container.partials = container.merge(options.partials, env.partials);
603
- }
604
- } else {
605
- container.helpers = options.helpers;
606
- container.partials = options.partials;
607
- }
608
- };
609
-
610
- ret._child = function(i, data, blockParams, depths) {
611
- if (templateSpec.useBlockParams && !blockParams) {
612
- throw new Exception('must pass block params');
613
- }
614
- if (templateSpec.useDepths && !depths) {
615
- throw new Exception('must pass parent depths');
616
- }
617
-
618
- return program(container, i, templateSpec[i], data, 0, blockParams, depths);
619
- };
620
- return ret;
621
- }
622
-
623
- __exports__.template = template;function program(container, i, fn, data, declaredBlockParams, blockParams, depths) {
624
- var prog = function(context, options) {
625
- options = options || {};
626
-
627
- return fn.call(container,
628
- context,
629
- container.helpers, container.partials,
630
- options.data || data,
631
- blockParams && [options.blockParams].concat(blockParams),
632
- depths && [context].concat(depths));
633
- };
634
- prog.program = i;
635
- prog.depth = depths ? depths.length : 0;
636
- prog.blockParams = declaredBlockParams || 0;
637
- return prog;
638
- }
639
-
640
- __exports__.program = program;function resolvePartial(partial, context, options) {
641
- if (!partial) {
642
- partial = options.partials[options.name];
643
- } else if (!partial.call && !options.name) {
644
- // This is a dynamic partial that returned a string
645
- options.name = partial;
646
- partial = options.partials[partial];
647
- }
648
- return partial;
649
- }
650
-
651
- __exports__.resolvePartial = resolvePartial;function invokePartial(partial, context, options) {
652
- options.partial = true;
653
-
654
- if(partial === undefined) {
655
- throw new Exception("The partial " + options.name + " could not be found");
656
- } else if(partial instanceof Function) {
657
- return partial(context, options);
658
- }
659
- }
660
-
661
- __exports__.invokePartial = invokePartial;function noop() { return ""; }
662
-
663
- __exports__.noop = noop;function initData(context, data) {
664
- if (!data || !('root' in data)) {
665
- data = data ? createFrame(data) : {};
666
- data.root = context;
667
- }
668
- return data;
669
- }
670
- return __exports__;
671
- })(__module2__, __module3__, __module1__);
672
-
673
- // handlebars.runtime.js
674
- var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
675
- "use strict";
676
- var __exports__;
677
- /*globals Handlebars: true */
678
- var base = __dependency1__;
679
-
680
- // Each of these augment the Handlebars object. No need to setup here.
681
- // (This is done to easily share code between commonjs and browse envs)
682
- var SafeString = __dependency2__;
683
- var Exception = __dependency3__;
684
- var Utils = __dependency4__;
685
- var runtime = __dependency5__;
686
-
687
- // For compatibility and usage outside of module systems, make the Handlebars object a namespace
688
- var create = function() {
689
- var hb = new base.HandlebarsEnvironment();
690
-
691
- Utils.extend(hb, base);
692
- hb.SafeString = SafeString;
693
- hb.Exception = Exception;
694
- hb.Utils = Utils;
695
- hb.escapeExpression = Utils.escapeExpression;
696
-
697
- hb.VM = runtime;
698
- hb.template = function(spec) {
699
- return runtime.template(spec, hb);
700
- };
701
-
702
- return hb;
703
- };
704
-
705
- var Handlebars = create();
706
- Handlebars.create = create;
707
-
708
- /*jshint -W040 */
709
- /* istanbul ignore next */
710
- var root = typeof global !== 'undefined' ? global : window,
711
- $Handlebars = root.Handlebars;
712
- /* istanbul ignore next */
713
- Handlebars.noConflict = function() {
714
- if (root.Handlebars === Handlebars) {
715
- root.Handlebars = $Handlebars;
716
- }
717
- };
718
-
719
- Handlebars['default'] = Handlebars;
720
-
721
- __exports__ = Handlebars;
722
- return __exports__;
723
- })(__module1__, __module4__, __module3__, __module2__, __module5__);
724
-
725
- return __module0__;
726
- }));
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__(17);
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__(18);
111
+
112
+ var runtime = _interopRequireWildcard(_handlebarsRuntime);
113
+
114
+ var _handlebarsNoConflict = __webpack_require__(19);
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__(6);
203
+
204
+ var _decorators = __webpack_require__(14);
205
+
206
+ var _logger = __webpack_require__(16);
207
+
208
+ var _logger2 = _interopRequireDefault(_logger);
209
+
210
+ var VERSION = '4.0.2';
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 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) {
423
+
424
+ 'use strict';
425
+
426
+ exports.__esModule = true;
427
+
428
+ var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
429
+
430
+ function Exception(message, node) {
431
+ var loc = node && node.loc,
432
+ line = undefined,
433
+ column = undefined;
434
+ if (loc) {
435
+ line = loc.start.line;
436
+ column = loc.start.column;
437
+
438
+ message += ' - ' + line + ':' + column;
439
+ }
440
+
441
+ var tmp = Error.prototype.constructor.call(this, message);
442
+
443
+ // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
444
+ for (var idx = 0; idx < errorProps.length; idx++) {
445
+ this[errorProps[idx]] = tmp[errorProps[idx]];
446
+ }
447
+
448
+ /* istanbul ignore else */
449
+ if (Error.captureStackTrace) {
450
+ Error.captureStackTrace(this, Exception);
451
+ }
452
+
453
+ if (loc) {
454
+ this.lineNumber = line;
455
+ this.column = column;
456
+ }
457
+ }
458
+
459
+ Exception.prototype = new Error();
460
+
461
+ exports['default'] = Exception;
462
+ module.exports = exports['default'];
463
+
464
+ /***/ },
465
+ /* 6 */
466
+ /***/ function(module, exports, __webpack_require__) {
467
+
468
+ 'use strict';
469
+
470
+ var _interopRequireDefault = __webpack_require__(2)['default'];
471
+
472
+ exports.__esModule = true;
473
+ exports.registerDefaultHelpers = registerDefaultHelpers;
474
+
475
+ var _helpersBlockHelperMissing = __webpack_require__(7);
476
+
477
+ var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
478
+
479
+ var _helpersEach = __webpack_require__(8);
480
+
481
+ var _helpersEach2 = _interopRequireDefault(_helpersEach);
482
+
483
+ var _helpersHelperMissing = __webpack_require__(9);
484
+
485
+ var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
486
+
487
+ var _helpersIf = __webpack_require__(10);
488
+
489
+ var _helpersIf2 = _interopRequireDefault(_helpersIf);
490
+
491
+ var _helpersLog = __webpack_require__(11);
492
+
493
+ var _helpersLog2 = _interopRequireDefault(_helpersLog);
494
+
495
+ var _helpersLookup = __webpack_require__(12);
496
+
497
+ var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
498
+
499
+ var _helpersWith = __webpack_require__(13);
500
+
501
+ var _helpersWith2 = _interopRequireDefault(_helpersWith);
502
+
503
+ function registerDefaultHelpers(instance) {
504
+ _helpersBlockHelperMissing2['default'](instance);
505
+ _helpersEach2['default'](instance);
506
+ _helpersHelperMissing2['default'](instance);
507
+ _helpersIf2['default'](instance);
508
+ _helpersLog2['default'](instance);
509
+ _helpersLookup2['default'](instance);
510
+ _helpersWith2['default'](instance);
511
+ }
512
+
513
+ /***/ },
514
+ /* 7 */
515
+ /***/ function(module, exports, __webpack_require__) {
516
+
517
+ 'use strict';
518
+
519
+ exports.__esModule = true;
520
+
521
+ var _utils = __webpack_require__(4);
522
+
523
+ exports['default'] = function (instance) {
524
+ instance.registerHelper('blockHelperMissing', function (context, options) {
525
+ var inverse = options.inverse,
526
+ fn = options.fn;
527
+
528
+ if (context === true) {
529
+ return fn(this);
530
+ } else if (context === false || context == null) {
531
+ return inverse(this);
532
+ } else if (_utils.isArray(context)) {
533
+ if (context.length > 0) {
534
+ if (options.ids) {
535
+ options.ids = [options.name];
536
+ }
537
+
538
+ return instance.helpers.each(context, options);
539
+ } else {
540
+ return inverse(this);
541
+ }
542
+ } else {
543
+ if (options.data && options.ids) {
544
+ var data = _utils.createFrame(options.data);
545
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
546
+ options = { data: data };
547
+ }
548
+
549
+ return fn(context, options);
550
+ }
551
+ });
552
+ };
553
+
554
+ module.exports = exports['default'];
555
+
556
+ /***/ },
557
+ /* 8 */
558
+ /***/ function(module, exports, __webpack_require__) {
559
+
560
+ 'use strict';
561
+
562
+ var _interopRequireDefault = __webpack_require__(2)['default'];
563
+
564
+ exports.__esModule = true;
565
+
566
+ var _utils = __webpack_require__(4);
567
+
568
+ var _exception = __webpack_require__(5);
569
+
570
+ var _exception2 = _interopRequireDefault(_exception);
571
+
572
+ exports['default'] = function (instance) {
573
+ instance.registerHelper('each', function (context, options) {
574
+ if (!options) {
575
+ throw new _exception2['default']('Must pass iterator to #each');
576
+ }
577
+
578
+ var fn = options.fn,
579
+ inverse = options.inverse,
580
+ i = 0,
581
+ ret = '',
582
+ data = undefined,
583
+ contextPath = undefined;
584
+
585
+ if (options.data && options.ids) {
586
+ contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
587
+ }
588
+
589
+ if (_utils.isFunction(context)) {
590
+ context = context.call(this);
591
+ }
592
+
593
+ if (options.data) {
594
+ data = _utils.createFrame(options.data);
595
+ }
596
+
597
+ function execIteration(field, index, last) {
598
+ // Don't iterate over undefined values since we can't execute blocks against them
599
+ // in non-strict (js) mode.
600
+ if (context[field] == null) {
601
+ return;
602
+ }
603
+
604
+ if (data) {
605
+ data.key = field;
606
+ data.index = index;
607
+ data.first = index === 0;
608
+ data.last = !!last;
609
+
610
+ if (contextPath) {
611
+ data.contextPath = contextPath + field;
612
+ }
613
+ }
614
+
615
+ ret = ret + fn(context[field], {
616
+ data: data,
617
+ blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
618
+ });
619
+ }
620
+
621
+ if (context && typeof context === 'object') {
622
+ if (_utils.isArray(context)) {
623
+ for (var j = context.length; i < j; i++) {
624
+ execIteration(i, i, i === context.length - 1);
625
+ }
626
+ } else {
627
+ var priorKey = undefined;
628
+
629
+ for (var key in context) {
630
+ if (context.hasOwnProperty(key)) {
631
+ // We're running the iterations one step out of sync so we can detect
632
+ // the last iteration without have to scan the object twice and create
633
+ // an itermediate keys array.
634
+ if (priorKey !== undefined) {
635
+ execIteration(priorKey, i - 1);
636
+ }
637
+ priorKey = key;
638
+ i++;
639
+ }
640
+ }
641
+ if (priorKey !== undefined) {
642
+ execIteration(priorKey, i - 1, true);
643
+ }
644
+ }
645
+ }
646
+
647
+ if (i === 0) {
648
+ ret = inverse(this);
649
+ }
650
+
651
+ return ret;
652
+ });
653
+ };
654
+
655
+ module.exports = exports['default'];
656
+
657
+ /***/ },
658
+ /* 9 */
659
+ /***/ function(module, exports, __webpack_require__) {
660
+
661
+ 'use strict';
662
+
663
+ var _interopRequireDefault = __webpack_require__(2)['default'];
664
+
665
+ exports.__esModule = true;
666
+
667
+ var _exception = __webpack_require__(5);
668
+
669
+ var _exception2 = _interopRequireDefault(_exception);
670
+
671
+ exports['default'] = function (instance) {
672
+ instance.registerHelper('helperMissing', function () /* [args, ]options */{
673
+ if (arguments.length === 1) {
674
+ // A missing field in a {{foo}} construct.
675
+ return undefined;
676
+ } else {
677
+ // Someone is actually trying to call something, blow up.
678
+ throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"');
679
+ }
680
+ });
681
+ };
682
+
683
+ module.exports = exports['default'];
684
+
685
+ /***/ },
686
+ /* 10 */
687
+ /***/ function(module, exports, __webpack_require__) {
688
+
689
+ 'use strict';
690
+
691
+ exports.__esModule = true;
692
+
693
+ var _utils = __webpack_require__(4);
694
+
695
+ exports['default'] = function (instance) {
696
+ instance.registerHelper('if', function (conditional, options) {
697
+ if (_utils.isFunction(conditional)) {
698
+ conditional = conditional.call(this);
699
+ }
700
+
701
+ // Default behavior is to render the positive path if the value is truthy and not empty.
702
+ // The `includeZero` option may be set to treat the condtional as purely not empty based on the
703
+ // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
704
+ if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
705
+ return options.inverse(this);
706
+ } else {
707
+ return options.fn(this);
708
+ }
709
+ });
710
+
711
+ instance.registerHelper('unless', function (conditional, options) {
712
+ return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash });
713
+ });
714
+ };
715
+
716
+ module.exports = exports['default'];
717
+
718
+ /***/ },
719
+ /* 11 */
720
+ /***/ function(module, exports) {
721
+
722
+ 'use strict';
723
+
724
+ exports.__esModule = true;
725
+
726
+ exports['default'] = function (instance) {
727
+ instance.registerHelper('log', function () /* message, options */{
728
+ var args = [undefined],
729
+ options = arguments[arguments.length - 1];
730
+ for (var i = 0; i < arguments.length - 1; i++) {
731
+ args.push(arguments[i]);
732
+ }
733
+
734
+ var level = 1;
735
+ if (options.hash.level != null) {
736
+ level = options.hash.level;
737
+ } else if (options.data && options.data.level != null) {
738
+ level = options.data.level;
739
+ }
740
+ args[0] = level;
741
+
742
+ instance.log.apply(instance, args);
743
+ });
744
+ };
745
+
746
+ module.exports = exports['default'];
747
+
748
+ /***/ },
749
+ /* 12 */
750
+ /***/ function(module, exports) {
751
+
752
+ 'use strict';
753
+
754
+ exports.__esModule = true;
755
+
756
+ exports['default'] = function (instance) {
757
+ instance.registerHelper('lookup', function (obj, field) {
758
+ return obj && obj[field];
759
+ });
760
+ };
761
+
762
+ module.exports = exports['default'];
763
+
764
+ /***/ },
765
+ /* 13 */
766
+ /***/ function(module, exports, __webpack_require__) {
767
+
768
+ 'use strict';
769
+
770
+ exports.__esModule = true;
771
+
772
+ var _utils = __webpack_require__(4);
773
+
774
+ exports['default'] = function (instance) {
775
+ instance.registerHelper('with', function (context, options) {
776
+ if (_utils.isFunction(context)) {
777
+ context = context.call(this);
778
+ }
779
+
780
+ var fn = options.fn;
781
+
782
+ if (!_utils.isEmpty(context)) {
783
+ var data = options.data;
784
+ if (options.data && options.ids) {
785
+ data = _utils.createFrame(options.data);
786
+ data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]);
787
+ }
788
+
789
+ return fn(context, {
790
+ data: data,
791
+ blockParams: _utils.blockParams([context], [data && data.contextPath])
792
+ });
793
+ } else {
794
+ return options.inverse(this);
795
+ }
796
+ });
797
+ };
798
+
799
+ module.exports = exports['default'];
800
+
801
+ /***/ },
802
+ /* 14 */
803
+ /***/ function(module, exports, __webpack_require__) {
804
+
805
+ 'use strict';
806
+
807
+ var _interopRequireDefault = __webpack_require__(2)['default'];
808
+
809
+ exports.__esModule = true;
810
+ exports.registerDefaultDecorators = registerDefaultDecorators;
811
+
812
+ var _decoratorsInline = __webpack_require__(15);
813
+
814
+ var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);
815
+
816
+ function registerDefaultDecorators(instance) {
817
+ _decoratorsInline2['default'](instance);
818
+ }
819
+
820
+ /***/ },
821
+ /* 15 */
822
+ /***/ function(module, exports, __webpack_require__) {
823
+
824
+ 'use strict';
825
+
826
+ exports.__esModule = true;
827
+
828
+ var _utils = __webpack_require__(4);
829
+
830
+ exports['default'] = function (instance) {
831
+ instance.registerDecorator('inline', function (fn, props, container, options) {
832
+ var ret = fn;
833
+ if (!props.partials) {
834
+ props.partials = {};
835
+ ret = function (context, options) {
836
+ // Create a new partials stack frame prior to exec.
837
+ var original = container.partials;
838
+ container.partials = _utils.extend({}, original, props.partials);
839
+ var ret = fn(context, options);
840
+ container.partials = original;
841
+ return ret;
842
+ };
843
+ }
844
+
845
+ props.partials[options.args[0]] = options.fn;
846
+
847
+ return ret;
848
+ });
849
+ };
850
+
851
+ module.exports = exports['default'];
852
+
853
+ /***/ },
854
+ /* 16 */
855
+ /***/ function(module, exports) {
856
+
857
+ 'use strict';
858
+
859
+ exports.__esModule = true;
860
+ var logger = {
861
+ methodMap: ['debug', 'info', 'warn', 'error'],
862
+ level: 'info',
863
+
864
+ // Maps a given level value to the `methodMap` indexes above.
865
+ lookupLevel: function lookupLevel(level) {
866
+ if (typeof level === 'string') {
867
+ var levelMap = logger.methodMap.indexOf(level.toLowerCase());
868
+ if (levelMap >= 0) {
869
+ level = levelMap;
870
+ } else {
871
+ level = parseInt(level, 10);
872
+ }
873
+ }
874
+
875
+ return level;
876
+ },
877
+
878
+ // Can be overridden in the host environment
879
+ log: function log(level) {
880
+ level = logger.lookupLevel(level);
881
+
882
+ if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) {
883
+ var method = logger.methodMap[level];
884
+ if (!console[method]) {
885
+ // eslint-disable-line no-console
886
+ method = 'log';
887
+ }
888
+
889
+ for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
890
+ message[_key - 1] = arguments[_key];
891
+ }
892
+
893
+ console[method].apply(console, message); // eslint-disable-line no-console
894
+ }
895
+ }
896
+ };
897
+
898
+ exports['default'] = logger;
899
+ module.exports = exports['default'];
900
+
901
+ /***/ },
902
+ /* 17 */
903
+ /***/ function(module, exports) {
904
+
905
+ // Build out our basic SafeString type
906
+ 'use strict';
907
+
908
+ exports.__esModule = true;
909
+ function SafeString(string) {
910
+ this.string = string;
911
+ }
912
+
913
+ SafeString.prototype.toString = SafeString.prototype.toHTML = function () {
914
+ return '' + this.string;
915
+ };
916
+
917
+ exports['default'] = SafeString;
918
+ module.exports = exports['default'];
919
+
920
+ /***/ },
921
+ /* 18 */
922
+ /***/ function(module, exports, __webpack_require__) {
923
+
924
+ 'use strict';
925
+
926
+ var _interopRequireWildcard = __webpack_require__(1)['default'];
927
+
928
+ var _interopRequireDefault = __webpack_require__(2)['default'];
929
+
930
+ exports.__esModule = true;
931
+ exports.checkRevision = checkRevision;
932
+ exports.template = template;
933
+ exports.wrapProgram = wrapProgram;
934
+ exports.resolvePartial = resolvePartial;
935
+ exports.invokePartial = invokePartial;
936
+ exports.noop = noop;
937
+
938
+ var _utils = __webpack_require__(4);
939
+
940
+ var Utils = _interopRequireWildcard(_utils);
941
+
942
+ var _exception = __webpack_require__(5);
943
+
944
+ var _exception2 = _interopRequireDefault(_exception);
945
+
946
+ var _base = __webpack_require__(3);
947
+
948
+ function checkRevision(compilerInfo) {
949
+ var compilerRevision = compilerInfo && compilerInfo[0] || 1,
950
+ currentRevision = _base.COMPILER_REVISION;
951
+
952
+ if (compilerRevision !== currentRevision) {
953
+ if (compilerRevision < currentRevision) {
954
+ var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
955
+ compilerVersions = _base.REVISION_CHANGES[compilerRevision];
956
+ 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 + ').');
957
+ } else {
958
+ // Use the embedded version info since the runtime doesn't know about this revision yet
959
+ 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] + ').');
960
+ }
961
+ }
962
+ }
963
+
964
+ function template(templateSpec, env) {
965
+ /* istanbul ignore next */
966
+ if (!env) {
967
+ throw new _exception2['default']('No environment passed to template');
968
+ }
969
+ if (!templateSpec || !templateSpec.main) {
970
+ throw new _exception2['default']('Unknown template object: ' + typeof templateSpec);
971
+ }
972
+
973
+ templateSpec.main.decorator = templateSpec.main_d;
974
+
975
+ // Note: Using env.VM references rather than local var references throughout this section to allow
976
+ // for external users to override these as psuedo-supported APIs.
977
+ env.VM.checkRevision(templateSpec.compiler);
978
+
979
+ function invokePartialWrapper(partial, context, options) {
980
+ if (options.hash) {
981
+ context = Utils.extend({}, context, options.hash);
982
+ if (options.ids) {
983
+ options.ids[0] = true;
984
+ }
985
+ }
986
+
987
+ partial = env.VM.resolvePartial.call(this, partial, context, options);
988
+ var result = env.VM.invokePartial.call(this, partial, context, options);
989
+
990
+ if (result == null && env.compile) {
991
+ options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
992
+ result = options.partials[options.name](context, options);
993
+ }
994
+ if (result != null) {
995
+ if (options.indent) {
996
+ var lines = result.split('\n');
997
+ for (var i = 0, l = lines.length; i < l; i++) {
998
+ if (!lines[i] && i + 1 === l) {
999
+ break;
1000
+ }
1001
+
1002
+ lines[i] = options.indent + lines[i];
1003
+ }
1004
+ result = lines.join('\n');
1005
+ }
1006
+ return result;
1007
+ } else {
1008
+ throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode');
1009
+ }
1010
+ }
1011
+
1012
+ // Just add water
1013
+ var container = {
1014
+ strict: function strict(obj, name) {
1015
+ if (!(name in obj)) {
1016
+ throw new _exception2['default']('"' + name + '" not defined in ' + obj);
1017
+ }
1018
+ return obj[name];
1019
+ },
1020
+ lookup: function lookup(depths, name) {
1021
+ var len = depths.length;
1022
+ for (var i = 0; i < len; i++) {
1023
+ if (depths[i] && depths[i][name] != null) {
1024
+ return depths[i][name];
1025
+ }
1026
+ }
1027
+ },
1028
+ lambda: function lambda(current, context) {
1029
+ return typeof current === 'function' ? current.call(context) : current;
1030
+ },
1031
+
1032
+ escapeExpression: Utils.escapeExpression,
1033
+ invokePartial: invokePartialWrapper,
1034
+
1035
+ fn: function fn(i) {
1036
+ var ret = templateSpec[i];
1037
+ ret.decorator = templateSpec[i + '_d'];
1038
+ return ret;
1039
+ },
1040
+
1041
+ programs: [],
1042
+ program: function program(i, data, declaredBlockParams, blockParams, depths) {
1043
+ var programWrapper = this.programs[i],
1044
+ fn = this.fn(i);
1045
+ if (data || depths || blockParams || declaredBlockParams) {
1046
+ programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths);
1047
+ } else if (!programWrapper) {
1048
+ programWrapper = this.programs[i] = wrapProgram(this, i, fn);
1049
+ }
1050
+ return programWrapper;
1051
+ },
1052
+
1053
+ data: function data(value, depth) {
1054
+ while (value && depth--) {
1055
+ value = value._parent;
1056
+ }
1057
+ return value;
1058
+ },
1059
+ merge: function merge(param, common) {
1060
+ var obj = param || common;
1061
+
1062
+ if (param && common && param !== common) {
1063
+ obj = Utils.extend({}, common, param);
1064
+ }
1065
+
1066
+ return obj;
1067
+ },
1068
+
1069
+ noop: env.VM.noop,
1070
+ compilerInfo: templateSpec.compiler
1071
+ };
1072
+
1073
+ function ret(context) {
1074
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1075
+
1076
+ var data = options.data;
1077
+
1078
+ ret._setup(options);
1079
+ if (!options.partial && templateSpec.useData) {
1080
+ data = initData(context, data);
1081
+ }
1082
+ var depths = undefined,
1083
+ blockParams = templateSpec.useBlockParams ? [] : undefined;
1084
+ if (templateSpec.useDepths) {
1085
+ if (options.depths) {
1086
+ depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths;
1087
+ } else {
1088
+ depths = [context];
1089
+ }
1090
+ }
1091
+
1092
+ function main(context /*, options*/) {
1093
+ return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths);
1094
+ }
1095
+ main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
1096
+ return main(context, options);
1097
+ }
1098
+ ret.isTop = true;
1099
+
1100
+ ret._setup = function (options) {
1101
+ if (!options.partial) {
1102
+ container.helpers = container.merge(options.helpers, env.helpers);
1103
+
1104
+ if (templateSpec.usePartial) {
1105
+ container.partials = container.merge(options.partials, env.partials);
1106
+ }
1107
+ if (templateSpec.usePartial || templateSpec.useDecorators) {
1108
+ container.decorators = container.merge(options.decorators, env.decorators);
1109
+ }
1110
+ } else {
1111
+ container.helpers = options.helpers;
1112
+ container.partials = options.partials;
1113
+ container.decorators = options.decorators;
1114
+ }
1115
+ };
1116
+
1117
+ ret._child = function (i, data, blockParams, depths) {
1118
+ if (templateSpec.useBlockParams && !blockParams) {
1119
+ throw new _exception2['default']('must pass block params');
1120
+ }
1121
+ if (templateSpec.useDepths && !depths) {
1122
+ throw new _exception2['default']('must pass parent depths');
1123
+ }
1124
+
1125
+ return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths);
1126
+ };
1127
+ return ret;
1128
+ }
1129
+
1130
+ function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
1131
+ function prog(context) {
1132
+ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
1133
+
1134
+ var currentDepths = depths;
1135
+ if (depths && context !== depths[0]) {
1136
+ currentDepths = [context].concat(depths);
1137
+ }
1138
+
1139
+ return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths);
1140
+ }
1141
+
1142
+ prog = executeDecorators(fn, prog, container, depths, data, blockParams);
1143
+
1144
+ prog.program = i;
1145
+ prog.depth = depths ? depths.length : 0;
1146
+ prog.blockParams = declaredBlockParams || 0;
1147
+ return prog;
1148
+ }
1149
+
1150
+ function resolvePartial(partial, context, options) {
1151
+ if (!partial) {
1152
+ if (options.name === '@partial-block') {
1153
+ partial = options.data['partial-block'];
1154
+ } else {
1155
+ partial = options.partials[options.name];
1156
+ }
1157
+ } else if (!partial.call && !options.name) {
1158
+ // This is a dynamic partial that returned a string
1159
+ options.name = partial;
1160
+ partial = options.partials[partial];
1161
+ }
1162
+ return partial;
1163
+ }
1164
+
1165
+ function invokePartial(partial, context, options) {
1166
+ options.partial = true;
1167
+ if (options.ids) {
1168
+ options.data.contextPath = options.ids[0] || options.data.contextPath;
1169
+ }
1170
+
1171
+ var partialBlock = undefined;
1172
+ if (options.fn && options.fn !== noop) {
1173
+ partialBlock = options.data['partial-block'] = options.fn;
1174
+
1175
+ if (partialBlock.partials) {
1176
+ options.partials = Utils.extend({}, options.partials, partialBlock.partials);
1177
+ }
1178
+ }
1179
+
1180
+ if (partial === undefined && partialBlock) {
1181
+ partial = partialBlock;
1182
+ }
1183
+
1184
+ if (partial === undefined) {
1185
+ throw new _exception2['default']('The partial ' + options.name + ' could not be found');
1186
+ } else if (partial instanceof Function) {
1187
+ return partial(context, options);
1188
+ }
1189
+ }
1190
+
1191
+ function noop() {
1192
+ return '';
1193
+ }
1194
+
1195
+ function initData(context, data) {
1196
+ if (!data || !('root' in data)) {
1197
+ data = data ? _base.createFrame(data) : {};
1198
+ data.root = context;
1199
+ }
1200
+ return data;
1201
+ }
1202
+
1203
+ function executeDecorators(fn, prog, container, depths, data, blockParams) {
1204
+ if (fn.decorator) {
1205
+ var props = {};
1206
+ prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
1207
+ Utils.extend(prog, props);
1208
+ }
1209
+ return prog;
1210
+ }
1211
+
1212
+ /***/ },
1213
+ /* 19 */
1214
+ /***/ function(module, exports) {
1215
+
1216
+ /* WEBPACK VAR INJECTION */(function(global) {/* global window */
1217
+ 'use strict';
1218
+
1219
+ exports.__esModule = true;
1220
+
1221
+ exports['default'] = function (Handlebars) {
1222
+ /* istanbul ignore next */
1223
+ var root = typeof global !== 'undefined' ? global : window,
1224
+ $Handlebars = root.Handlebars;
1225
+ /* istanbul ignore next */
1226
+ Handlebars.noConflict = function () {
1227
+ if (root.Handlebars === Handlebars) {
1228
+ root.Handlebars = $Handlebars;
1229
+ }
1230
+ };
1231
+ };
1232
+
1233
+ module.exports = exports['default'];
1234
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
1235
+
1236
+ /***/ }
1237
+ /******/ ])
1238
+ });
1239
+ ;