@jaredwray/fumanchu 1.0.2 → 1.0.3

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,3697 +0,0 @@
1
- var $8NT9G$handlebarsutils = require("handlebars-utils");
2
- var $8NT9G$lazycache = require("lazy-cache");
3
- require("array-sort");
4
- require("arr-flatten");
5
- require("to-gfm-code-block");
6
- require("html-tag");
7
- var $8NT9G$kindof = require("kind-of");
8
- require("is-glob");
9
- require("micromatch");
10
- require("falsey");
11
- require("is-even");
12
- var $8NT9G$isnumber = require("is-number");
13
- require("create-frame");
14
- require("get-object");
15
- require("get-value");
16
- require("for-own");
17
- require("relative");
18
- var $8NT9G$fs = require("fs");
19
- var $8NT9G$path = require("path");
20
- var $8NT9G$hasvalue = require("has-value");
21
- var $8NT9G$year = require("year");
22
- var $8NT9G$helperdate = require("helper-date");
23
- var $8NT9G$striptags = require("striptags");
24
- var $8NT9G$logginghelpers = require("logging-helpers");
25
- var $8NT9G$helperformarkdown = require("helper-for-markdown");
26
- var $8NT9G$helpermd = require("helper-md");
27
- var $8NT9G$handlebarshelpercreateframe = require("handlebars-helper-create-frame");
28
- var $8NT9G$process = require("process");
29
- var $8NT9G$url = require("url");
30
- var $8NT9G$querystring = require("querystring");
31
- var $8NT9G$handlebars = require("handlebars");
32
- var $8NT9G$forin = require("for-in");
33
- var $8NT9G$defineproperty = require("define-property");
34
-
35
- var $parcel$global =
36
- typeof globalThis !== 'undefined'
37
- ? globalThis
38
- : typeof self !== 'undefined'
39
- ? self
40
- : typeof window !== 'undefined'
41
- ? window
42
- : typeof global !== 'undefined'
43
- ? global
44
- : {};
45
- var $parcel$modules = {};
46
- var $parcel$inits = {};
47
-
48
- var parcelRequire = $parcel$global["parcelRequire840f"];
49
- if (parcelRequire == null) {
50
- parcelRequire = function(id) {
51
- if (id in $parcel$modules) {
52
- return $parcel$modules[id].exports;
53
- }
54
- if (id in $parcel$inits) {
55
- var init = $parcel$inits[id];
56
- delete $parcel$inits[id];
57
- var module = {id: id, exports: {}};
58
- $parcel$modules[id] = module;
59
- init.call(module.exports, module, module.exports);
60
- return module.exports;
61
- }
62
- var err = new Error("Cannot find module '" + id + "'");
63
- err.code = 'MODULE_NOT_FOUND';
64
- throw err;
65
- };
66
-
67
- parcelRequire.register = function register(id, init) {
68
- $parcel$inits[id] = init;
69
- };
70
-
71
- $parcel$global["parcelRequire840f"] = parcelRequire;
72
- }
73
- parcelRequire.register("3R4ea", function(module, exports) {
74
- "use strict";
75
-
76
-
77
- var $6LuVW = parcelRequire("6LuVW");
78
- var $2ce999d10e0b8ead$var$helpers = module.exports;
79
- /**
80
- * Returns all of the items in an array after the specified index.
81
- * Opposite of [before](#before).
82
- *
83
- * ```handlebars
84
- * <!-- array: ['a', 'b', 'c'] -->
85
- * {{after array 1}}
86
- * <!-- results in: '["c"]' -->
87
- * ```
88
- * @param {Array} `array` Collection
89
- * @param {Number} `n` Starting index (number of items to exclude)
90
- * @return {Array} Array exluding `n` items.
91
- * @api public
92
- */ $2ce999d10e0b8ead$var$helpers.after = function(array, n) {
93
- if ($8NT9G$handlebarsutils.isUndefined(array)) return "";
94
- return array.slice(n);
95
- };
96
- /**
97
- * Cast the given `value` to an array.
98
- *
99
- * ```handlebars
100
- * {{arrayify "foo"}}
101
- * <!-- results in: [ "foo" ] -->
102
- * ```
103
- * @param {any} `value`
104
- * @return {Array}
105
- * @api public
106
- */ $2ce999d10e0b8ead$var$helpers.arrayify = function(value) {
107
- return value ? Array.isArray(value) ? value : [
108
- value
109
- ] : [];
110
- };
111
- /**
112
- * Return all of the items in the collection before the specified
113
- * count. Opposite of [after](#after).
114
- *
115
- * ```handlebars
116
- * <!-- array: ['a', 'b', 'c'] -->
117
- * {{before array 2}}
118
- * <!-- results in: '["a", "b"]' -->
119
- * ```
120
- * @param {Array} `array`
121
- * @param {Number} `n`
122
- * @return {Array} Array excluding items after the given number.
123
- * @api public
124
- */ $2ce999d10e0b8ead$var$helpers.before = function(array, n) {
125
- if ($8NT9G$handlebarsutils.isUndefined(array)) return "";
126
- return array.slice(0, -n);
127
- };
128
- /**
129
- * ```handlebars
130
- * <!-- array: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] -->
131
- * {{#eachIndex array}}
132
- * {{item}} is {{index}}
133
- * {{/eachIndex}}
134
- * ```
135
- * @param {Array} `array`
136
- * @param {Object} `options`
137
- * @return {String}
138
- * @block
139
- * @api public
140
- */ $2ce999d10e0b8ead$var$helpers.eachIndex = function(array, options) {
141
- var result = "";
142
- for(var i = 0; i < array.length; i++)result += options.fn({
143
- item: array[i],
144
- index: i
145
- });
146
- return result;
147
- };
148
- /**
149
- * Block helper that filters the given array and renders the block for values that
150
- * evaluate to `true`, otherwise the inverse block is returned.
151
- *
152
- * ```handlebars
153
- * <!-- array: ['a', 'b', 'c'] -->
154
- * {{#filter array "foo"}}AAA{{else}}BBB{{/filter}}
155
- * <!-- results in: 'BBB' -->
156
- * ```
157
- * @param {Array} `array`
158
- * @param {any} `value`
159
- * @param {Object} `options`
160
- * @return {String}
161
- * @block
162
- * @api public
163
- */ $2ce999d10e0b8ead$var$helpers.filter = function(array, value, options) {
164
- var content = "";
165
- var results = [];
166
- // filter on a specific property
167
- var prop = options.hash && (options.hash.property || options.hash.prop);
168
- if (prop) results = array.filter(function(val) {
169
- return value === $6LuVW.get(val, prop);
170
- });
171
- else // filter on a string value
172
- results = array.filter(function(v) {
173
- return value === v;
174
- });
175
- if (results && results.length > 0) {
176
- for(var i = 0; i < results.length; i++)content += options.fn(results[i]);
177
- return content;
178
- }
179
- return options.inverse(this);
180
- };
181
- /**
182
- * Returns the first item, or first `n` items of an array.
183
- *
184
- * ```handlebars
185
- * {{first "['a', 'b', 'c', 'd', 'e']" 2}}
186
- * <!-- results in: '["a", "b"]' -->
187
- * ```
188
- * @param {Array} `array`
189
- * @param {Number} `n` Number of items to return, starting at `0`.
190
- * @return {Array}
191
- * @api public
192
- */ $2ce999d10e0b8ead$var$helpers.first = function(array, n) {
193
- if ($8NT9G$handlebarsutils.isUndefined(array)) return "";
194
- if (!$6LuVW.isNumber(n)) return array[0];
195
- return array.slice(0, n);
196
- };
197
- /**
198
- * Iterates over each item in an array and exposes the current item
199
- * in the array as context to the inner block. In addition to
200
- * the current array item, the helper exposes the following variables
201
- * to the inner block:
202
- *
203
- * - `index`
204
- * - `total`
205
- * - `isFirst`
206
- * - `isLast`
207
- *
208
- * Also, `@index` is exposed as a private variable, and additional
209
- * private variables may be defined as hash arguments.
210
- *
211
- * ```handlebars
212
- * <!-- accounts = [
213
- * {'name': 'John', 'email': 'john@example.com'},
214
- * {'name': 'Malcolm', 'email': 'malcolm@example.com'},
215
- * {'name': 'David', 'email': 'david@example.com'}
216
- * ] -->
217
- *
218
- * {{#forEach accounts}}
219
- * <a href="mailto:{{ email }}" title="Send an email to {{ name }}">
220
- * {{ name }}
221
- * </a>{{#unless isLast}}, {{/unless}}
222
- * {{/forEach}}
223
- * ```
224
- * @source <http://stackoverflow.com/questions/13861007>
225
- * @param {Array} `array`
226
- * @return {String}
227
- * @block
228
- * @api public
229
- */ $2ce999d10e0b8ead$var$helpers.forEach = function(array, options) {
230
- var data = $6LuVW.createFrame(options, options.hash);
231
- var len = array.length;
232
- var buffer = "";
233
- var i = -1;
234
- while(++i < len){
235
- var item = array[i];
236
- data.index = i;
237
- item.index = i + 1;
238
- item.total = len;
239
- item.isFirst = i === 0;
240
- item.isLast = i === len - 1;
241
- buffer += options.fn(item, {
242
- data: data
243
- });
244
- }
245
- return buffer;
246
- };
247
- /**
248
- * Block helper that renders the block if an array has the
249
- * given `value`. Optionally specify an inverse block to render
250
- * when the array does not have the given value.
251
- *
252
- * ```handlebars
253
- * <!-- array: ['a', 'b', 'c'] -->
254
- * {{#inArray array "d"}}
255
- * foo
256
- * {{else}}
257
- * bar
258
- * {{/inArray}}
259
- * <!-- results in: 'bar' -->
260
- * ```
261
- * @param {Array} `array`
262
- * @param {any} `value`
263
- * @param {Object} `options`
264
- * @return {String}
265
- * @block
266
- * @api public
267
- */ $2ce999d10e0b8ead$var$helpers.inArray = function(array, value, options) {
268
- return $8NT9G$handlebarsutils.value($8NT9G$handlebarsutils.indexOf(array, value) > -1, this, options);
269
- };
270
- /**
271
- * Returns true if `value` is an es5 array.
272
- *
273
- * ```handlebars
274
- * {{isArray "abc"}}
275
- * <!-- results in: false -->
276
- *
277
- * <!-- array: [1, 2, 3] -->
278
- * {{isArray array}}
279
- * <!-- results in: true -->
280
- * ```
281
- * @param {any} `value` The value to test.
282
- * @return {Boolean}
283
- * @api public
284
- */ $2ce999d10e0b8ead$var$helpers.isArray = function(value) {
285
- return Array.isArray(value);
286
- };
287
- /**
288
- * Returns the item from `array` at index `idx`.
289
- *
290
- * ```handlebars
291
- * <!-- array: ['a', 'b', 'c'] -->
292
- * {{itemAt array 1}}
293
- * <!-- results in: 'b' -->
294
- * ```
295
- * @param {Array} `array`
296
- * @param {Number} `idx`
297
- * @return {any} `value`
298
- * @block
299
- * @api public
300
- */ $2ce999d10e0b8ead$var$helpers.itemAt = function(array, idx) {
301
- array = $8NT9G$handlebarsutils.result(array);
302
- if (Array.isArray(array)) {
303
- idx = $6LuVW.isNumber(idx) ? +idx : 0;
304
- if (idx < 0) return array[array.length + idx];
305
- if (idx < array.length) return array[idx];
306
- }
307
- };
308
- /**
309
- * Join all elements of array into a string, optionally using a
310
- * given separator.
311
- *
312
- * ```handlebars
313
- * <!-- array: ['a', 'b', 'c'] -->
314
- * {{join array}}
315
- * <!-- results in: 'a, b, c' -->
316
- *
317
- * {{join array '-'}}
318
- * <!-- results in: 'a-b-c' -->
319
- * ```
320
- * @param {Array} `array`
321
- * @param {String} `separator` The separator to use. Defaults to `, `.
322
- * @return {String}
323
- * @api public
324
- */ $2ce999d10e0b8ead$var$helpers.join = function(array, separator) {
325
- if (typeof array === "string") return array;
326
- if (!Array.isArray(array)) return "";
327
- separator = $8NT9G$handlebarsutils.isString(separator) ? separator : ", ";
328
- return array.join(separator);
329
- };
330
- /**
331
- * Returns true if the the length of the given `value` is equal
332
- * to the given `length`. Can be used as a block or inline helper.
333
- *
334
- * @param {Array|String} `value`
335
- * @param {Number} `length`
336
- * @param {Object} `options`
337
- * @return {String}
338
- * @block
339
- * @api public
340
- */ $2ce999d10e0b8ead$var$helpers.equalsLength = function(value, length, options) {
341
- if ($8NT9G$handlebarsutils.isOptions(length)) {
342
- options = length;
343
- length = 0;
344
- }
345
- var len = 0;
346
- if (typeof value === "string" || Array.isArray(value)) len = value.length;
347
- return $8NT9G$handlebarsutils.value(len === length, this, options);
348
- };
349
- /**
350
- * Returns the last item, or last `n` items of an array or string.
351
- * Opposite of [first](#first).
352
- *
353
- * ```handlebars
354
- * <!-- var value = ['a', 'b', 'c', 'd', 'e'] -->
355
- *
356
- * {{last value}}
357
- * <!-- results in: ['e'] -->
358
- *
359
- * {{last value 2}}
360
- * <!-- results in: ['d', 'e'] -->
361
- *
362
- * {{last value 3}}
363
- * <!-- results in: ['c', 'd', 'e'] -->
364
- * ```
365
- * @param {Array|String} `value` Array or string.
366
- * @param {Number} `n` Number of items to return from the end of the array.
367
- * @return {Array}
368
- * @api public
369
- */ $2ce999d10e0b8ead$var$helpers.last = function(value, n) {
370
- if (!Array.isArray(value) && typeof value !== "string") return "";
371
- if (!$6LuVW.isNumber(n)) return value[value.length - 1];
372
- return value.slice(-Math.abs(n));
373
- };
374
- /**
375
- * Returns the length of the given string or array.
376
- *
377
- * ```handlebars
378
- * {{length '["a", "b", "c"]'}}
379
- * <!-- results in: 3 -->
380
- *
381
- * <!-- results in: myArray = ['a', 'b', 'c', 'd', 'e']; -->
382
- * {{length myArray}}
383
- * <!-- results in: 5 -->
384
- *
385
- * <!-- results in: myObject = {'a': 'a', 'b': 'b'}; -->
386
- * {{length myObject}}
387
- * <!-- results in: 2 -->
388
- * ```
389
- * @param {Array|Object|String} `value`
390
- * @return {Number} The length of the value.
391
- * @api public
392
- */ $2ce999d10e0b8ead$var$helpers.length = function(value) {
393
- if ($8NT9G$handlebarsutils.isObject(value) && !$8NT9G$handlebarsutils.isOptions(value)) value = Object.keys(value);
394
- if (typeof value === "string" || Array.isArray(value)) return value.length;
395
- return 0;
396
- };
397
- /**
398
- * Alias for [equalsLength](#equalsLength)
399
- *
400
- * @api public
401
- */ $2ce999d10e0b8ead$var$helpers.lengthEqual = $2ce999d10e0b8ead$var$helpers.equalsLength;
402
- /**
403
- * Returns a new array, created by calling `function` on each
404
- * element of the given `array`. For example,
405
- *
406
- * ```handlebars
407
- * <!-- array: ['a', 'b', 'c'], and "double" is a
408
- * fictitious function that duplicates letters -->
409
- * {{map array double}}
410
- * <!-- results in: '["aa", "bb", "cc"]' -->
411
- * ```
412
- *
413
- * @param {Array} `array`
414
- * @param {Function} `fn`
415
- * @return {String}
416
- * @api public
417
- */ $2ce999d10e0b8ead$var$helpers.map = function(array, iter) {
418
- if (!Array.isArray(array)) return "";
419
- var len = array.length;
420
- var res = new Array(len);
421
- var i = -1;
422
- if (typeof iter !== "function") return array;
423
- while(++i < len)res[i] = iter(array[i], i, array);
424
- return res;
425
- };
426
- /**
427
- * Map over the given object or array or objects and create an array of values
428
- * from the given `prop`. Dot-notation may be used (as a string) to get
429
- * nested properties.
430
- *
431
- * ```handlebars
432
- * // {{pluck items "data.title"}}
433
- * <!-- results in: '["aa", "bb", "cc"]' -->
434
- * ```
435
- * @param {Array|Object} `collection`
436
- * @param {Function} `prop`
437
- * @return {String}
438
- * @api public
439
- */ $2ce999d10e0b8ead$var$helpers.pluck = function(arr, prop) {
440
- if ($8NT9G$handlebarsutils.isUndefined(arr)) return "";
441
- var res = [];
442
- for(var i = 0; i < arr.length; i++){
443
- var val = $6LuVW.get(arr[i], prop);
444
- if (typeof val !== "undefined") res.push(val);
445
- }
446
- return res;
447
- };
448
- /**
449
- * Reverse the elements in an array, or the characters in a string.
450
- *
451
- * ```handlebars
452
- * <!-- value: 'abcd' -->
453
- * {{reverse value}}
454
- * <!-- results in: 'dcba' -->
455
- * <!-- value: ['a', 'b', 'c', 'd'] -->
456
- * {{reverse value}}
457
- * <!-- results in: ['d', 'c', 'b', 'a'] -->
458
- * ```
459
- * @param {Array|String} `value`
460
- * @return {Array|String} Returns the reversed string or array.
461
- * @api public
462
- */ $2ce999d10e0b8ead$var$helpers.reverse = function(val) {
463
- if (Array.isArray(val)) {
464
- val.reverse();
465
- return val;
466
- }
467
- if (val && typeof val === "string") return val.split("").reverse().join("");
468
- };
469
- /**
470
- * Block helper that returns the block if the callback returns true
471
- * for some value in the given array.
472
- *
473
- * ```handlebars
474
- * <!-- array: [1, 'b', 3] -->
475
- * {{#some array isString}}
476
- * Render me if the array has a string.
477
- * {{else}}
478
- * Render me if it doesn't.
479
- * {{/some}}
480
- * <!-- results in: 'Render me if the array has a string.' -->
481
- * ```
482
- * @param {Array} `array`
483
- * @param {Function} `iter` Iteratee
484
- * @param {Options} Handlebars provided options object
485
- * @return {String}
486
- * @block
487
- * @api public
488
- */ $2ce999d10e0b8ead$var$helpers.some = function(array, iter, options) {
489
- if (Array.isArray(array)) for(var i = 0; i < array.length; i++){
490
- if (iter(array[i], i, array)) return options.fn(this);
491
- }
492
- return options.inverse(this);
493
- };
494
- /**
495
- * Sort the given `array`. If an array of objects is passed,
496
- * you may optionally pass a `key` to sort on as the second
497
- * argument. You may alternatively pass a sorting function as
498
- * the second argument.
499
- *
500
- * ```handlebars
501
- * <!-- array: ['b', 'a', 'c'] -->
502
- * {{sort array}}
503
- * <!-- results in: '["a", "b", "c"]' -->
504
- * ```
505
- *
506
- * @param {Array} `array` the array to sort.
507
- * @param {String|Function} `key` The object key to sort by, or sorting function.
508
- * @api public
509
- */ $2ce999d10e0b8ead$var$helpers.sort = function(array, options) {
510
- if (!Array.isArray(array)) return "";
511
- if ($6LuVW.get(options, "hash.reverse")) return array.sort().reverse();
512
- return array.sort();
513
- };
514
- /**
515
- * Sort an `array`. If an array of objects is passed,
516
- * you may optionally pass a `key` to sort on as the second
517
- * argument. You may alternatively pass a sorting function as
518
- * the second argument.
519
- *
520
- * ```handlebars
521
- * <!-- array: [{a: 'zzz'}, {a: 'aaa'}] -->
522
- * {{sortBy array "a"}}
523
- * <!-- results in: '[{"a":"aaa"}, {"a":"zzz"}]' -->
524
- * ```
525
- *
526
- * @param {Array} `array` the array to sort.
527
- * @param {String|Function} `props` One or more properties to sort by, or sorting functions to use.
528
- * @api public
529
- */ $2ce999d10e0b8ead$var$helpers.sortBy = function(array, prop, options) {
530
- if (!Array.isArray(array)) return "";
531
- var args = [].slice.call(arguments);
532
- // remove handlebars options
533
- args.pop();
534
- if (!$8NT9G$handlebarsutils.isString(prop) && typeof prop !== "function") return array.sort();
535
- return $6LuVW.sortBy.apply(null, args);
536
- };
537
- /**
538
- * Use the items in the array _after_ the specified index
539
- * as context inside a block. Opposite of [withBefore](#withBefore).
540
- *
541
- * ```handlebars
542
- * <!-- array: ['a', 'b', 'c', 'd', 'e'] -->
543
- * {{#withAfter array 3}}
544
- * {{this}}
545
- * {{/withAfter}}
546
- * <!-- results in: "de" -->
547
- * ```
548
- * @param {Array} `array`
549
- * @param {Number} `idx`
550
- * @param {Object} `options`
551
- * @return {Array}
552
- * @block
553
- * @api public
554
- */ $2ce999d10e0b8ead$var$helpers.withAfter = function(array, idx, options) {
555
- if (!Array.isArray(array)) return "";
556
- array = array.slice(idx);
557
- var result = "";
558
- for(var i = 0; i < array.length; i++)result += options.fn(array[i]);
559
- return result;
560
- };
561
- /**
562
- * Use the items in the array _before_ the specified index
563
- * as context inside a block. Opposite of [withAfter](#withAfter).
564
- *
565
- * ```handlebars
566
- * <!-- array: ['a', 'b', 'c', 'd', 'e'] -->
567
- * {{#withBefore array 3}}
568
- * {{this}}
569
- * {{/withBefore}}
570
- * <!-- results in: 'ab' -->
571
- * ```
572
- * @param {Array} `array`
573
- * @param {Number} `idx`
574
- * @param {Object} `options`
575
- * @return {Array}
576
- * @block
577
- * @api public
578
- */ $2ce999d10e0b8ead$var$helpers.withBefore = function(array, idx, options) {
579
- if (!Array.isArray(array)) return "";
580
- array = array.slice(0, -idx);
581
- var result = "";
582
- for(var i = 0; i < array.length; i++)result += options.fn(array[i]);
583
- return result;
584
- };
585
- /**
586
- * Use the first item in a collection inside a handlebars
587
- * block expression. Opposite of [withLast](#withLast).
588
- *
589
- * ```handlebars
590
- * <!-- array: ['a', 'b', 'c'] -->
591
- * {{#withFirst array}}
592
- * {{this}}
593
- * {{/withFirst}}
594
- * <!-- results in: 'a' -->
595
- * ```
596
- * @param {Array} `array`
597
- * @param {Number} `idx`
598
- * @param {Object} `options`
599
- * @return {String}
600
- * @block
601
- * @api public
602
- */ $2ce999d10e0b8ead$var$helpers.withFirst = function(array, idx, options) {
603
- if ($8NT9G$handlebarsutils.isUndefined(array)) return "";
604
- array = $8NT9G$handlebarsutils.result(array);
605
- if (!$8NT9G$handlebarsutils.isUndefined(idx)) idx = parseFloat($8NT9G$handlebarsutils.result(idx));
606
- if ($8NT9G$handlebarsutils.isUndefined(idx)) {
607
- options = idx;
608
- return options.fn(array[0]);
609
- }
610
- array = array.slice(0, idx);
611
- var result = "";
612
- for(var i = 0; i < array.length; i++)result += options.fn(array[i]);
613
- return result;
614
- };
615
- /**
616
- * Block helper that groups array elements by given group `size`.
617
- *
618
- * ```handlebars
619
- * <!-- array: ['a','b','c','d','e','f','g','h'] -->
620
- * {{#withGroup array 4}}
621
- * {{#each this}}
622
- * {{.}}
623
- * {{each}}
624
- * <br>
625
- * {{/withGroup}}
626
- * <!-- results in: -->
627
- * <!-- 'a','b','c','d'<br> -->
628
- * <!-- 'e','f','g','h'<br> -->
629
- * ```
630
- * @param {Array} `array` The array to iterate over
631
- * @param {Number} `size` The desired length of each array "group"
632
- * @param {Object} `options` Handlebars options
633
- * @return {String}
634
- * @block
635
- * @api public
636
- */ $2ce999d10e0b8ead$var$helpers.withGroup = function(array, size, options) {
637
- var result = "";
638
- if (Array.isArray(array) && array.length > 0) {
639
- var subcontext = [];
640
- for(var i = 0; i < array.length; i++){
641
- if (i > 0 && i % size === 0) {
642
- result += options.fn(subcontext);
643
- subcontext = [];
644
- }
645
- subcontext.push(array[i]);
646
- }
647
- result += options.fn(subcontext);
648
- }
649
- return result;
650
- };
651
- /**
652
- * Use the last item or `n` items in an array as context inside a block.
653
- * Opposite of [withFirst](#withFirst).
654
- *
655
- * ```handlebars
656
- * <!-- array: ['a', 'b', 'c'] -->
657
- * {{#withLast array}}
658
- * {{this}}
659
- * {{/withLast}}
660
- * <!-- results in: 'c' -->
661
- * ```
662
- * @param {Array} `array`
663
- * @param {Number} `idx` The starting index.
664
- * @param {Object} `options`
665
- * @return {String}
666
- * @block
667
- * @api public
668
- */ $2ce999d10e0b8ead$var$helpers.withLast = function(array, idx, options) {
669
- if ($8NT9G$handlebarsutils.isUndefined(array)) return "";
670
- array = $8NT9G$handlebarsutils.result(array);
671
- if (!$8NT9G$handlebarsutils.isUndefined(idx)) idx = parseFloat($8NT9G$handlebarsutils.result(idx));
672
- if ($8NT9G$handlebarsutils.isUndefined(idx)) {
673
- options = idx;
674
- return options.fn(array[array.length - 1]);
675
- }
676
- array = array.slice(-idx);
677
- var len = array.length, i = -1;
678
- var result = "";
679
- while(++i < len)result += options.fn(array[i]);
680
- return result;
681
- };
682
- /**
683
- * Block helper that sorts a collection and exposes the sorted
684
- * collection as context inside the block.
685
- *
686
- * ```handlebars
687
- * <!-- array: ['b', 'a', 'c'] -->
688
- * {{#withSort array}}{{this}}{{/withSort}}
689
- * <!-- results in: 'abc' -->
690
- * ```
691
- * @param {Array} `array`
692
- * @param {String} `prop`
693
- * @param {Object} `options` Specify `reverse="true"` to reverse the array.
694
- * @return {String}
695
- * @block
696
- * @api public
697
- */ $2ce999d10e0b8ead$var$helpers.withSort = function(array, prop, options) {
698
- if ($8NT9G$handlebarsutils.isUndefined(array)) return "";
699
- var result = "";
700
- if ($8NT9G$handlebarsutils.isUndefined(prop)) {
701
- options = prop;
702
- array = array.sort();
703
- if ($6LuVW.get(options, "hash.reverse")) array = array.reverse();
704
- for(var i = 0, len = array.length; i < len; i++)result += options.fn(array[i]);
705
- return result;
706
- }
707
- array.sort(function(a, b) {
708
- a = $6LuVW.get(a, prop);
709
- b = $6LuVW.get(b, prop);
710
- return a > b ? 1 : a < b ? -1 : 0;
711
- });
712
- if ($6LuVW.get(options, "hash.reverse")) array = array.reverse();
713
- var alen = array.length, j = -1;
714
- while(++j < alen)result += options.fn(array[j]);
715
- return result;
716
- };
717
- /**
718
- * Block helper that return an array with all duplicate
719
- * values removed. Best used along with a [each](#each) helper.
720
- *
721
- * ```handlebars
722
- * <!-- array: ['a', 'a', 'c', 'b', 'e', 'e'] -->
723
- * {{#each (unique array)}}{{.}}{{/each}}
724
- * <!-- results in: 'acbe' -->
725
- * ```
726
- * @param {Array} `array`
727
- * @param {Object} `options`
728
- * @return {Array}
729
- * @api public
730
- */ $2ce999d10e0b8ead$var$helpers.unique = function(array, options) {
731
- if ($8NT9G$handlebarsutils.isUndefined(array)) return "";
732
- return array.filter(function(item, index, arr) {
733
- return arr.indexOf(item) === index;
734
- });
735
- };
736
-
737
- });
738
- parcelRequire.register("6LuVW", function(module, exports) {
739
- "use strict";
740
-
741
-
742
- var $cebzt = parcelRequire("cebzt");
743
- /**
744
- * Returns true if the given value contains the given
745
- * `object`, optionally passing a starting index.
746
- *
747
- * @param {Array} val
748
- * @param {Object} obj
749
- * @param {Number} start
750
- * @return {Boolean}
751
- */ $cebzt.contains = function(val, obj, start) {
752
- if (val == null || obj == null || !$cebzt.isNumber(val.length)) return false;
753
- return val.indexOf(obj, start) !== -1;
754
- };
755
- /**
756
- * Remove leading and trailing whitespace and non-word
757
- * characters from the given string.
758
- *
759
- * @param {String} `str`
760
- * @return {String}
761
- */ $cebzt.chop = function(str) {
762
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
763
- var re = /^[-_.\W\s]+|[-_.\W\s]+$/g;
764
- return str.trim().replace(re, "");
765
- };
766
- /**
767
- * Change casing on the given `string`, optionally
768
- * passing a delimiter to use between words in the
769
- * returned string.
770
- *
771
- * ```handlebars
772
- * utils.changecase('fooBarBaz');
773
- * //=> 'foo bar baz'
774
- *
775
- * utils.changecase('fooBarBaz' '-');
776
- * //=> 'foo-bar-baz'
777
- * ```
778
- * @param {String} `string` The string to change.
779
- * @return {String}
780
- * @api public
781
- */ $cebzt.changecase = function(str, fn) {
782
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
783
- if (str.length === 1) return str.toLowerCase();
784
- str = $cebzt.chop(str).toLowerCase();
785
- if (typeof fn !== "function") fn = $cebzt.identity;
786
- var re = /[-_.\W\s]+(\w|$)/g;
787
- return str.replace(re, function(_, ch) {
788
- return fn(ch);
789
- });
790
- };
791
- /**
792
- * Generate a random number
793
- *
794
- * @param {Number} `min`
795
- * @param {Number} `max`
796
- * @return {Number}
797
- * @api public
798
- */ $cebzt.random = function(min, max) {
799
- return min + Math.floor(Math.random() * (max - min + 1));
800
- };
801
- /**
802
- * Expose `utils`
803
- */ module.exports = $cebzt;
804
-
805
- });
806
- parcelRequire.register("cebzt", function(module, exports) {
807
- "use strict";
808
-
809
- var $8e6fc4a7311c757b$var$utils = $8NT9G$lazycache(undefined);
810
- var $8e6fc4a7311c757b$var$fn = undefined;
811
- require = $8e6fc4a7311c757b$var$utils;
812
-
813
-
814
-
815
-
816
-
817
-
818
-
819
-
820
-
821
-
822
-
823
-
824
-
825
-
826
-
827
- require = $8e6fc4a7311c757b$var$fn;
828
- /**
829
- * Expose `utils`
830
- */ module.exports = $8e6fc4a7311c757b$var$utils;
831
-
832
- });
833
-
834
-
835
-
836
- parcelRequire.register("dhYI6", function(module, exports) {
837
- "use strict";
838
-
839
-
840
-
841
- var $6LuVW = parcelRequire("6LuVW");
842
- var $9acbf4b46923c49b$var$helpers = module.exports;
843
- /**
844
- * Embed code from an external file as preformatted text.
845
- *
846
- * ```handlebars
847
- * {{embed 'path/to/file.js'}}
848
- * <!-- optionally specify the language to use -->
849
- * {{embed 'path/to/file.hbs' 'html')}}
850
- * ```
851
- *
852
- * @param {String} `filepath` filepath to the file to embed.
853
- * @param {String} `language` Optionally specify the language to use for syntax highlighting.
854
- * @return {String}
855
- * @api public
856
- */ $9acbf4b46923c49b$var$helpers.embed = function embed(filepath, ext) {
857
- ext = typeof ext !== "string" ? $8NT9G$path.extname(filepath).slice(1) : ext;
858
- var code = $8NT9G$fs.readFileSync(filepath, "utf8");
859
- if (ext === "markdown" || ext === "md") {
860
- ext = "markdown";
861
- // if the string is markdown, escape backticks
862
- code = code.split("`").join("&#x60");
863
- }
864
- return $6LuVW.block(code, ext).trim() + "\n";
865
- };
866
- /**
867
- * Embed a GitHub Gist using only the id of the Gist
868
- *
869
- * ```handlebars
870
- * {{gist "12345"}}
871
- * ```
872
- * @param {String} `id`
873
- * @return {String}
874
- * @api public
875
- */ $9acbf4b46923c49b$var$helpers.gist = function(id) {
876
- return $6LuVW.tag("script", {
877
- src: "https://gist.github.com/" + id + ".js"
878
- });
879
- };
880
- /**
881
- * Generate the HTML for a jsFiddle link with the given `params`
882
- *
883
- * ```handlebars
884
- * {{jsfiddle id="0dfk10ks" tabs="true"}}
885
- * ```
886
- * @param {Object} `params`
887
- * @return {String}
888
- * @api public
889
- */ $9acbf4b46923c49b$var$helpers.jsfiddle = function jsFiddle(options) {
890
- var attr = Object.assign({}, options && options.hash);
891
- if (typeof attr.id === "undefined") throw new Error("jsfiddle helper expects an `id`");
892
- attr.id = "http://jsfiddle.net/" + attr.id;
893
- attr.width = attr.width || "100%";
894
- attr.height = attr.height || "300";
895
- attr.skin = attr.skin || "/presentation/";
896
- attr.tabs = (attr.tabs || "result,js,html,css") + attr.skin;
897
- attr.src = attr.id + "/embedded/" + attr.tabs;
898
- attr.allowfullscreen = attr.allowfullscreen || "allowfullscreen";
899
- attr.frameborder = attr.frameborder || "0";
900
- delete attr.tabs;
901
- delete attr.skin;
902
- delete attr.id;
903
- return $6LuVW.tag("iframe", attr);
904
- };
905
-
906
- });
907
-
908
- parcelRequire.register("2oMW4", function(module, exports) {
909
- "use strict";
910
-
911
-
912
- var $icPqk = parcelRequire("icPqk");
913
-
914
- var $3R4ea = parcelRequire("3R4ea");
915
- var $1bf3c8450fafb5a8$var$forEach = $3R4ea.forEach;
916
- var $1bf3c8450fafb5a8$var$forOwn = $icPqk.forOwn;
917
- var $1bf3c8450fafb5a8$var$helpers = module.exports;
918
- /**
919
- * Inline, subexpression, or block helper that returns true (or the block)
920
- * if the given collection is empty, or false (or the inverse block, if
921
- * supplied) if the colleciton is not empty.
922
- *
923
- * ```handlebars
924
- * <!-- array: [] -->
925
- * {{#isEmpty array}}AAA{{else}}BBB{{/isEmpty}}
926
- * <!-- results in: 'AAA' -->
927
- *
928
- * <!-- array: [] -->
929
- * {{isEmpty array}}
930
- * <!-- results in: true -->
931
- * ```
932
- * @param {Object} `collection`
933
- * @param {Object} `options`
934
- * @return {String}
935
- * @block
936
- * @api public
937
- */ $1bf3c8450fafb5a8$var$helpers.isEmpty = function(collection, options) {
938
- if (!$8NT9G$handlebarsutils.isOptions(options)) {
939
- options = collection;
940
- return $8NT9G$handlebarsutils.fn(true, this, options);
941
- }
942
- if (Array.isArray(collection) && !collection.length) return $8NT9G$handlebarsutils.fn(true, this, options);
943
- var keys = Object.keys(collection);
944
- var isEmpty = typeof collection === "object" && !keys.length;
945
- return $8NT9G$handlebarsutils.value(isEmpty, this, options);
946
- };
947
- /**
948
- * Block helper that iterates over an array or object. If
949
- * an array is given, `.forEach` is called, or if an object
950
- * is given, `.forOwn` is called, otherwise the inverse block
951
- * is returned.
952
- *
953
- * @param {Object|Array} `collection` The collection to iterate over
954
- * @param {Object} `options`
955
- * @return {String}
956
- * @block
957
- * @api public
958
- */ $1bf3c8450fafb5a8$var$helpers.iterate = function(collection, options) {
959
- if (Array.isArray(collection)) return $1bf3c8450fafb5a8$var$forEach.apply(null, arguments);
960
- if ($8NT9G$handlebarsutils.isObject(collection)) return $1bf3c8450fafb5a8$var$forOwn.apply(null, arguments);
961
- return options.inverse(this);
962
- };
963
-
964
- });
965
- parcelRequire.register("icPqk", function(module, exports) {
966
- "use strict";
967
- var $d4113ca779e780cb$var$hasOwn = Object.hasOwnProperty;
968
-
969
-
970
- var $3R4ea = parcelRequire("3R4ea");
971
-
972
- var $6LuVW = parcelRequire("6LuVW");
973
- var $d4113ca779e780cb$var$helpers = module.exports;
974
- /**
975
- * Extend the context with the properties of other objects.
976
- * A shallow merge is performed to avoid mutating the context.
977
- *
978
- * @param {Object} `objects` One or more objects to extend.
979
- * @return {Object}
980
- * @api public
981
- */ $d4113ca779e780cb$var$helpers.extend = function() {
982
- var args = [].slice.call(arguments);
983
- var opts = {};
984
- if ($8NT9G$handlebarsutils.isOptions(args[args.length - 1])) {
985
- // remove handlebars options object
986
- opts = args.pop().hash;
987
- // re-add handlebars options.hash object
988
- args.push(opts);
989
- }
990
- var context = {};
991
- for(var i = 0; i < args.length; i++){
992
- var obj = args[i];
993
- if ($8NT9G$handlebarsutils.isObject(obj)) {
994
- var keys = Object.keys(obj);
995
- for(var j = 0; j < keys.length; j++){
996
- var key = keys[j];
997
- context[key] = obj[key];
998
- }
999
- }
1000
- }
1001
- return context;
1002
- };
1003
- /**
1004
- * Block helper that iterates over the properties of
1005
- * an object, exposing each key and value on the context.
1006
- *
1007
- * @param {Object} `context`
1008
- * @param {Object} `options`
1009
- * @return {String}
1010
- * @block
1011
- * @api public
1012
- */ $d4113ca779e780cb$var$helpers.forIn = function(obj, options) {
1013
- if (!$8NT9G$handlebarsutils.isOptions(options)) return obj.inverse(this);
1014
- var data = $6LuVW.createFrame(options, options.hash);
1015
- var result = "";
1016
- for(var key in obj){
1017
- data.key = key;
1018
- result += options.fn(obj[key], {
1019
- data: data
1020
- });
1021
- }
1022
- return result;
1023
- };
1024
- /**
1025
- * Block helper that iterates over the **own** properties of
1026
- * an object, exposing each key and value on the context.
1027
- *
1028
- * @param {Object} `obj` The object to iterate over.
1029
- * @param {Object} `options`
1030
- * @return {String}
1031
- * @block
1032
- * @api public
1033
- */ $d4113ca779e780cb$var$helpers.forOwn = function(obj, options) {
1034
- if (!$8NT9G$handlebarsutils.isOptions(options)) return obj.inverse(this);
1035
- var data = $6LuVW.createFrame(options, options.hash);
1036
- var result = "";
1037
- for(var key in obj)if (obj.hasOwnProperty(key)) {
1038
- data.key = key;
1039
- result += options.fn(obj[key], {
1040
- data: data
1041
- });
1042
- }
1043
- return result;
1044
- };
1045
- /**
1046
- * Take arguments and, if they are string or number, convert them to a dot-delineated object property path.
1047
- *
1048
- * @param {String|Number} `prop` The property segments to assemble (can be multiple).
1049
- * @return {String}
1050
- * @api public
1051
- */ $d4113ca779e780cb$var$helpers.toPath = function() {
1052
- var prop = [];
1053
- for(var i = 0; i < arguments.length; i++)if (typeof arguments[i] === "string" || typeof arguments[i] === "number") prop.push(arguments[i]);
1054
- return prop.join(".");
1055
- };
1056
- /**
1057
- * Use property paths (`a.b.c`) to get a value or nested value from
1058
- * the context. Works as a regular helper or block helper.
1059
- *
1060
- * @param {String} `prop` The property to get, optionally using dot notation for nested properties.
1061
- * @param {Object} `context` The context object
1062
- * @param {Object} `options` The handlebars options object, if used as a block helper.
1063
- * @return {String}
1064
- * @block
1065
- * @api public
1066
- */ $d4113ca779e780cb$var$helpers.get = function(prop, context, options) {
1067
- var val = $6LuVW.get(context, prop);
1068
- if (options && options.fn) return val ? options.fn(val) : options.inverse(context);
1069
- return val;
1070
- };
1071
- /**
1072
- * Use property paths (`a.b.c`) to get an object from
1073
- * the context. Differs from the `get` helper in that this
1074
- * helper will return the actual object, including the
1075
- * given property key. Also, this helper does not work as a
1076
- * block helper.
1077
- *
1078
- * @param {String} `prop` The property to get, optionally using dot notation for nested properties.
1079
- * @param {Object} `context` The context object
1080
- * @return {String}
1081
- * @api public
1082
- */ $d4113ca779e780cb$var$helpers.getObject = function(prop, context) {
1083
- return $6LuVW.getObject(context, prop);
1084
- };
1085
- /**
1086
- * Return true if `key` is an own, enumerable property
1087
- * of the given `context` object.
1088
- *
1089
- * ```handlebars
1090
- * {{hasOwn context key}}
1091
- * ```
1092
- *
1093
- * @param {String} `key`
1094
- * @param {Object} `context` The context object.
1095
- * @return {Boolean}
1096
- * @api public
1097
- */ $d4113ca779e780cb$var$helpers.hasOwn = function(context, key) {
1098
- return $d4113ca779e780cb$var$hasOwn.call(context, key);
1099
- };
1100
- /**
1101
- * Return true if `value` is an object.
1102
- *
1103
- * ```handlebars
1104
- * {{isObject "foo"}}
1105
- * //=> false
1106
- * ```
1107
- * @param {String} `value`
1108
- * @return {Boolean}
1109
- * @api public
1110
- */ $d4113ca779e780cb$var$helpers.isObject = function(value) {
1111
- return $6LuVW.typeOf(value) === "object";
1112
- };
1113
- /**
1114
- * Parses the given string using `JSON.parse`.
1115
- *
1116
- * ```handlebars
1117
- * <!-- string: '{"foo": "bar"}' -->
1118
- * {{JSONparse string}}
1119
- * <!-- results in: { foo: 'bar' } -->
1120
- * ```
1121
- * @param {String} `string` The string to parse
1122
- * @contributor github.com/keeganstreet
1123
- * @block
1124
- * @api public
1125
- */ $d4113ca779e780cb$var$helpers.JSONparse = function(str, options) {
1126
- return JSON.parse(str);
1127
- };
1128
- /**
1129
- * Stringify an object using `JSON.stringify`.
1130
- *
1131
- * ```handlebars
1132
- * <!-- object: { foo: 'bar' } -->
1133
- * {{JSONstringify object}}
1134
- * <!-- results in: '{"foo": "bar"}' -->
1135
- * ```
1136
- * @param {Object} `obj` Object to stringify
1137
- * @return {String}
1138
- * @api public
1139
- */ $d4113ca779e780cb$var$helpers.JSONstringify = function(obj, indent) {
1140
- if (!$6LuVW.isNumber(indent)) indent = 0;
1141
- return JSON.stringify(obj, null, indent);
1142
- };
1143
- /**
1144
- * Deeply merge the properties of the given `objects` with the
1145
- * context object.
1146
- *
1147
- * @param {Object} `object` The target object. Pass an empty object to shallow clone.
1148
- * @param {Object} `objects`
1149
- * @return {Object}
1150
- * @api public
1151
- */ $d4113ca779e780cb$var$helpers.merge = function(context /*, objects, options*/ ) {
1152
- var args = [].slice.call(arguments);
1153
- var opts = {};
1154
- if ($8NT9G$handlebarsutils.isOptions(args[args.length - 1])) {
1155
- // remove handlebars options object
1156
- opts = args.pop().hash;
1157
- // re-add options.hash
1158
- args.push(opts);
1159
- }
1160
- return Object.assign.apply(null, args);
1161
- };
1162
- /**
1163
- * Alias for parseJSON. this will be
1164
- * deprecated in a future release
1165
- */ $d4113ca779e780cb$var$helpers.parseJSON = $d4113ca779e780cb$var$helpers.JSONparse;
1166
- /**
1167
- * Pick properties from the context object.
1168
- *
1169
- * @param {Array|String} `properties` One or more properties to pick.
1170
- * @param {Object} `context`
1171
- * @param {Object} `options` Handlebars options object.
1172
- * @return {Object} Returns an object with the picked values. If used as a block helper, the values are passed as context to the inner block. If no values are found, the context is passed to the inverse block.
1173
- * @block
1174
- * @api public
1175
- */ $d4113ca779e780cb$var$helpers.pick = function(props, context, options) {
1176
- var keys = $3R4ea.arrayify(props);
1177
- var len = keys.length, i = -1;
1178
- var result = {};
1179
- while(++i < len)result = $d4113ca779e780cb$var$helpers.extend({}, result, $6LuVW.getObject(context, keys[i]));
1180
- if (options.fn) {
1181
- if (Object.keys(result).length) return options.fn(result);
1182
- return options.inverse(context);
1183
- }
1184
- return result;
1185
- };
1186
- /**
1187
- * Alias for JSONstringify. this will be
1188
- * deprecated in a future release
1189
- */ $d4113ca779e780cb$var$helpers.stringify = $d4113ca779e780cb$var$helpers.JSONstringify;
1190
-
1191
- });
1192
-
1193
-
1194
- parcelRequire.register("dOcEg", function(module, exports) {
1195
- "use strict";
1196
-
1197
-
1198
-
1199
- var $6LuVW = parcelRequire("6LuVW");
1200
- var $a0d9c199bd06e6ac$var$helpers = module.exports;
1201
- /**
1202
- * Helper that renders the block if **both** of the given values
1203
- * are truthy. If an inverse block is specified it will be rendered
1204
- * when falsy. Works as a block helper, inline helper or
1205
- * subexpression.
1206
- *
1207
- * ```handlebars
1208
- * <!-- {great: true, magnificent: true} -->
1209
- * {{#and great magnificent}}A{{else}}B{{/and}}
1210
- * <!-- results in: 'A' -->
1211
- * ```
1212
- * @param {any} `a`
1213
- * @param {any} `b`
1214
- * @param {Object} `options` Handlebars provided options object
1215
- * @return {String}
1216
- * @block
1217
- * @api public
1218
- */ $a0d9c199bd06e6ac$var$helpers.and = function() {
1219
- var len = arguments.length - 1;
1220
- var options = arguments[len];
1221
- var val = true;
1222
- for(var i = 0; i < len; i++)if (!arguments[i]) {
1223
- val = false;
1224
- break;
1225
- }
1226
- return $8NT9G$handlebarsutils.value(val, this, options);
1227
- };
1228
- /**
1229
- * Render a block when a comparison of the first and third
1230
- * arguments returns true. The second argument is
1231
- * the [arithemetic operator][operators] to use. You may also
1232
- * optionally specify an inverse block to render when falsy.
1233
- *
1234
- * @param `a`
1235
- * @param `operator` The operator to use. Operators must be enclosed in quotes: `">"`, `"="`, `"<="`, and so on.
1236
- * @param `b`
1237
- * @param {Object} `options` Handlebars provided options object
1238
- * @return {String} Block, or if specified the inverse block is rendered if falsey.
1239
- * @block
1240
- * @api public
1241
- */ $a0d9c199bd06e6ac$var$helpers.compare = function(a, operator, b, options) {
1242
- /*eslint eqeqeq: 0*/ if (arguments.length < 4) throw new Error("handlebars Helper {{compare}} expects 4 arguments");
1243
- var result;
1244
- switch(operator){
1245
- case "==":
1246
- result = a == b;
1247
- break;
1248
- case "===":
1249
- result = a === b;
1250
- break;
1251
- case "!=":
1252
- result = a != b;
1253
- break;
1254
- case "!==":
1255
- result = a !== b;
1256
- break;
1257
- case "<":
1258
- result = a < b;
1259
- break;
1260
- case ">":
1261
- result = a > b;
1262
- break;
1263
- case "<=":
1264
- result = a <= b;
1265
- break;
1266
- case ">=":
1267
- result = a >= b;
1268
- break;
1269
- case "typeof":
1270
- result = typeof a === b;
1271
- break;
1272
- default:
1273
- throw new Error("helper {{compare}}: invalid operator: `" + operator + "`");
1274
- }
1275
- return $8NT9G$handlebarsutils.value(result, this, options);
1276
- };
1277
- /**
1278
- * Block helper that renders the block if `collection` has the
1279
- * given `value`, using strict equality (`===`) for comparison,
1280
- * otherwise the inverse block is rendered (if specified). If a
1281
- * `startIndex` is specified and is negative, it is used as the
1282
- * offset from the end of the collection.
1283
- *
1284
- * ```handlebars
1285
- * <!-- array = ['a', 'b', 'c'] -->
1286
- * {{#contains array "d"}}
1287
- * This will not be rendered.
1288
- * {{else}}
1289
- * This will be rendered.
1290
- * {{/contains}}
1291
- * ```
1292
- * @param {Array|Object|String} `collection` The collection to iterate over.
1293
- * @param {any} `value` The value to check for.
1294
- * @param {Number} `[startIndex=0]` Optionally define the starting index.
1295
- * @param {Object} `options` Handlebars provided options object.
1296
- * @block
1297
- * @api public
1298
- */ $a0d9c199bd06e6ac$var$helpers.contains = function(collection, value, startIndex, options) {
1299
- if (typeof startIndex === "object") {
1300
- options = startIndex;
1301
- startIndex = undefined;
1302
- }
1303
- var val = $6LuVW.contains(collection, value, startIndex);
1304
- return $8NT9G$handlebarsutils.value(val, this, options);
1305
- };
1306
- /**
1307
- * Returns the first value that is not undefined, otherwise the "default" value is returned.
1308
- *
1309
- * @param {any} `value`
1310
- * @param {any} `defaultValue`
1311
- * @return {String}
1312
- * @alias .or
1313
- * @api public
1314
- */ $a0d9c199bd06e6ac$var$helpers.default = function() {
1315
- for(var i = 0; i < arguments.length - 1; i++){
1316
- if (arguments[i] != null) return arguments[i];
1317
- }
1318
- return "";
1319
- };
1320
- /**
1321
- * Block helper that renders a block if `a` is **equal to** `b`.
1322
- * If an inverse block is specified it will be rendered when falsy.
1323
- * You may optionally use the `compare=""` hash argument for the
1324
- * second value.
1325
- *
1326
- * @param {String} `a`
1327
- * @param {String} `b`
1328
- * @param {Object} `options` Handlebars provided options object
1329
- * @return {String} Block, or inverse block if specified and falsey.
1330
- * @alias is
1331
- * @block
1332
- * @api public
1333
- */ $a0d9c199bd06e6ac$var$helpers.eq = function(a, b, options) {
1334
- if (arguments.length === 2) {
1335
- options = b;
1336
- b = options.hash.compare;
1337
- }
1338
- return $8NT9G$handlebarsutils.value(a === b, this, options);
1339
- };
1340
- /**
1341
- * Block helper that renders a block if `a` is **greater than** `b`.
1342
- *
1343
- * If an inverse block is specified it will be rendered when falsy.
1344
- * You may optionally use the `compare=""` hash argument for the
1345
- * second value.
1346
- *
1347
- * @param {String} `a`
1348
- * @param {String} `b`
1349
- * @param {Object} `options` Handlebars provided options object
1350
- * @return {String} Block, or inverse block if specified and falsey.
1351
- * @block
1352
- * @api public
1353
- */ $a0d9c199bd06e6ac$var$helpers.gt = function(a, b, options) {
1354
- if (arguments.length === 2) {
1355
- options = b;
1356
- b = options.hash.compare;
1357
- }
1358
- return $8NT9G$handlebarsutils.value(a > b, this, options);
1359
- };
1360
- /**
1361
- * Block helper that renders a block if `a` is **greater than or
1362
- * equal to** `b`.
1363
- *
1364
- * If an inverse block is specified it will be rendered when falsy.
1365
- * You may optionally use the `compare=""` hash argument for the
1366
- * second value.
1367
- *
1368
- * @param {String} `a`
1369
- * @param {String} `b`
1370
- * @param {Object} `options` Handlebars provided options object
1371
- * @return {String} Block, or inverse block if specified and falsey.
1372
- * @block
1373
- * @api public
1374
- */ $a0d9c199bd06e6ac$var$helpers.gte = function(a, b, options) {
1375
- if (arguments.length === 2) {
1376
- options = b;
1377
- b = options.hash.compare;
1378
- }
1379
- return $8NT9G$handlebarsutils.value(a >= b, this, options);
1380
- };
1381
- /**
1382
- * Block helper that renders a block if `value` has `pattern`.
1383
- * If an inverse block is specified it will be rendered when falsy.
1384
- *
1385
- * @param {any} `val` The value to check.
1386
- * @param {any} `pattern` The pattern to check for.
1387
- * @param {Object} `options` Handlebars provided options object
1388
- * @return {String}
1389
- * @block
1390
- * @api public
1391
- */ $a0d9c199bd06e6ac$var$helpers.has = function(value, pattern, options) {
1392
- if ($8NT9G$handlebarsutils.isOptions(value)) {
1393
- options = value;
1394
- pattern = null;
1395
- value = null;
1396
- }
1397
- if ($8NT9G$handlebarsutils.isOptions(pattern)) {
1398
- options = pattern;
1399
- pattern = null;
1400
- }
1401
- if (value === null) return $8NT9G$handlebarsutils.value(false, this, options);
1402
- if (arguments.length === 2) return $8NT9G$handlebarsutils.value($8NT9G$hasvalue(this, value), this, options);
1403
- if ((Array.isArray(value) || $8NT9G$handlebarsutils.isString(value)) && $8NT9G$handlebarsutils.isString(pattern)) {
1404
- if (value.indexOf(pattern) > -1) return $8NT9G$handlebarsutils.fn(true, this, options);
1405
- }
1406
- if ($8NT9G$handlebarsutils.isObject(value) && $8NT9G$handlebarsutils.isString(pattern) && pattern in value) return $8NT9G$handlebarsutils.fn(true, this, options);
1407
- return $8NT9G$handlebarsutils.inverse(false, this, options);
1408
- };
1409
- /**
1410
- * Returns true if the given `value` is falsey. Uses the [falsey][]
1411
- * library for comparisons. Please see that library for more information
1412
- * or to report bugs with this helper.
1413
- *
1414
- * @param {any} `val`
1415
- * @param {Options} `options`
1416
- * @return {Boolean}
1417
- * @api public
1418
- */ $a0d9c199bd06e6ac$var$helpers.isFalsey = function(val, options) {
1419
- return $8NT9G$handlebarsutils.value($6LuVW.falsey(val), this, options);
1420
- };
1421
- /**
1422
- * Returns true if the given `value` is truthy. Uses the [falsey][]
1423
- * library for comparisons. Please see that library for more information
1424
- * or to report bugs with this helper.
1425
- *
1426
- * @param {any} `val`
1427
- * @param {Options} `options`
1428
- * @return {Boolean}
1429
- * @api public
1430
- */ $a0d9c199bd06e6ac$var$helpers.isTruthy = function(val, options) {
1431
- return $8NT9G$handlebarsutils.value(!$6LuVW.falsey(val), this, options);
1432
- };
1433
- /**
1434
- * Return true if the given value is an even number.
1435
- *
1436
- * ```handlebars
1437
- * {{#ifEven value}}
1438
- * render A
1439
- * {{else}}
1440
- * render B
1441
- * {{/ifEven}}
1442
- * ```
1443
- * @param {Number} `number`
1444
- * @param {Object} `options` Handlebars provided options object
1445
- * @return {String} Block, or inverse block if specified and falsey.
1446
- * @block
1447
- * @api public
1448
- */ $a0d9c199bd06e6ac$var$helpers.ifEven = function(num, options) {
1449
- return $8NT9G$handlebarsutils.value($6LuVW.isEven(num), this, options);
1450
- };
1451
- /**
1452
- * Conditionally renders a block if the remainder is zero when
1453
- * `a` operand is divided by `b`. If an inverse block is specified
1454
- * it will be rendered when the remainder is **not zero**.
1455
- *
1456
- * @param {Number}
1457
- * @param {Number}
1458
- * @param {Object} `options` Handlebars provided options object
1459
- * @return {String} Block, or inverse block if specified and falsey.
1460
- * @block
1461
- * @api public
1462
- */ $a0d9c199bd06e6ac$var$helpers.ifNth = function(a, b, options) {
1463
- var isNth = $6LuVW.isNumber(a) && $6LuVW.isNumber(b) && b % a === 0;
1464
- return $8NT9G$handlebarsutils.value(isNth, this, options);
1465
- };
1466
- /**
1467
- * Block helper that renders a block if `value` is **an odd number**.
1468
- * If an inverse block is specified it will be rendered when falsy.
1469
- *
1470
- * ```handlebars
1471
- * {{#ifOdd value}}
1472
- * render A
1473
- * {{else}}
1474
- * render B
1475
- * {{/ifOdd}}
1476
- * ```
1477
- * @param {Object} `value`
1478
- * @param {Object} `options` Handlebars provided options object
1479
- * @return {String} Block, or inverse block if specified and falsey.
1480
- * @block
1481
- * @api public
1482
- */ $a0d9c199bd06e6ac$var$helpers.ifOdd = function(val, options) {
1483
- return $8NT9G$handlebarsutils.value(!$6LuVW.isEven(val), this, options);
1484
- };
1485
- /**
1486
- * Block helper that renders a block if `a` is **equal to** `b`.
1487
- * If an inverse block is specified it will be rendered when falsy.
1488
- * Similar to [eq](#eq) but does not do strict equality.
1489
- *
1490
- * @param {any} `a`
1491
- * @param {any} `b`
1492
- * @param {Object} `options` Handlebars provided options object
1493
- * @return {String}
1494
- * @block
1495
- * @api public
1496
- */ $a0d9c199bd06e6ac$var$helpers.is = function(a, b, options) {
1497
- if (arguments.length === 2) {
1498
- options = b;
1499
- b = options.hash.compare;
1500
- }
1501
- return $8NT9G$handlebarsutils.value(a == b, this, options);
1502
- };
1503
- /**
1504
- * Block helper that renders a block if `a` is **not equal to** `b`.
1505
- * If an inverse block is specified it will be rendered when falsy.
1506
- * Similar to [unlessEq](#unlesseq) but does not use strict equality for
1507
- * comparisons.
1508
- *
1509
- * @param {String} `a`
1510
- * @param {String} `b`
1511
- * @param {Object} `options` Handlebars provided options object
1512
- * @return {String}
1513
- * @block
1514
- * @api public
1515
- */ $a0d9c199bd06e6ac$var$helpers.isnt = function(a, b, options) {
1516
- if (arguments.length === 2) {
1517
- options = b;
1518
- b = options.hash.compare;
1519
- }
1520
- return $8NT9G$handlebarsutils.value(a != b, this, options);
1521
- };
1522
- /**
1523
- * Block helper that renders a block if `a` is **less than** `b`.
1524
- *
1525
- * If an inverse block is specified it will be rendered when falsy.
1526
- * You may optionally use the `compare=""` hash argument for the
1527
- * second value.
1528
- *
1529
- * @param {Object} `context`
1530
- * @param {Object} `options` Handlebars provided options object
1531
- * @return {String} Block, or inverse block if specified and falsey.
1532
- * @block
1533
- * @api public
1534
- */ $a0d9c199bd06e6ac$var$helpers.lt = function(a, b, options) {
1535
- if (arguments.length === 2) {
1536
- options = b;
1537
- b = options.hash.compare;
1538
- }
1539
- return $8NT9G$handlebarsutils.value(a < b, this, options);
1540
- };
1541
- /**
1542
- * Block helper that renders a block if `a` is **less than or
1543
- * equal to** `b`.
1544
- *
1545
- * If an inverse block is specified it will be rendered when falsy.
1546
- * You may optionally use the `compare=""` hash argument for the
1547
- * second value.
1548
- *
1549
- * @param {Sring} `a`
1550
- * @param {Sring} `b`
1551
- * @param {Object} `options` Handlebars provided options object
1552
- * @return {String} Block, or inverse block if specified and falsey.
1553
- * @block
1554
- * @api public
1555
- */ $a0d9c199bd06e6ac$var$helpers.lte = function(a, b, options) {
1556
- if (arguments.length === 2) {
1557
- options = b;
1558
- b = options.hash.compare;
1559
- }
1560
- return $8NT9G$handlebarsutils.value(a <= b, this, options);
1561
- };
1562
- /**
1563
- * Block helper that renders a block if **neither of** the given values
1564
- * are truthy. If an inverse block is specified it will be rendered
1565
- * when falsy.
1566
- *
1567
- * @param {any} `a`
1568
- * @param {any} `b`
1569
- * @param `options` Handlebars options object
1570
- * @return {String} Block, or inverse block if specified and falsey.
1571
- * @block
1572
- * @api public
1573
- */ $a0d9c199bd06e6ac$var$helpers.neither = function(a, b, options) {
1574
- return $8NT9G$handlebarsutils.value(!a && !b, this, options);
1575
- };
1576
- /**
1577
- * Returns true if `val` is falsey. Works as a block or inline helper.
1578
- *
1579
- * @param {String} `val`
1580
- * @param {Object} `options` Handlebars provided options object
1581
- * @return {String}
1582
- * @block
1583
- * @api public
1584
- */ $a0d9c199bd06e6ac$var$helpers.not = function(val, options) {
1585
- return $8NT9G$handlebarsutils.value(!val, this, options);
1586
- };
1587
- /**
1588
- * Block helper that renders a block if **any of** the given values
1589
- * is truthy. If an inverse block is specified it will be rendered
1590
- * when falsy.
1591
- *
1592
- * ```handlebars
1593
- * {{#or a b c}}
1594
- * If any value is true this will be rendered.
1595
- * {{/or}}
1596
- * ```
1597
- *
1598
- * @param {...any} `arguments` Variable number of arguments
1599
- * @param {Object} `options` Handlebars options object
1600
- * @return {String} Block, or inverse block if specified and falsey.
1601
- * @block
1602
- * @api public
1603
- */ $a0d9c199bd06e6ac$var$helpers.or = function() {
1604
- var len = arguments.length - 1;
1605
- var options = arguments[len];
1606
- var val = false;
1607
- for(var i = 0; i < len; i++)if (arguments[i]) {
1608
- val = true;
1609
- break;
1610
- }
1611
- return $8NT9G$handlebarsutils.value(val, this, options);
1612
- };
1613
- /**
1614
- * Block helper that always renders the inverse block **unless `a` is
1615
- * is equal to `b`**.
1616
- *
1617
- * @param {String} `a`
1618
- * @param {String} `b`
1619
- * @param {Object} `options` Handlebars provided options object
1620
- * @return {String} Inverse block by default, or block if falsey.
1621
- * @block
1622
- * @api public
1623
- */ $a0d9c199bd06e6ac$var$helpers.unlessEq = function(a, b, options) {
1624
- if ($8NT9G$handlebarsutils.isOptions(b)) {
1625
- options = b;
1626
- b = options.hash.compare;
1627
- }
1628
- return $8NT9G$handlebarsutils.value(a !== b, this, options);
1629
- };
1630
- /**
1631
- * Block helper that always renders the inverse block **unless `a` is
1632
- * is greater than `b`**.
1633
- *
1634
- * @param {Object} `a` The default value
1635
- * @param {Object} `b` The value to compare
1636
- * @param {Object} `options` Handlebars provided options object
1637
- * @return {String} Inverse block by default, or block if falsey.
1638
- * @block
1639
- * @api public
1640
- */ $a0d9c199bd06e6ac$var$helpers.unlessGt = function(a, b, options) {
1641
- if ($8NT9G$handlebarsutils.isOptions(b)) {
1642
- options = b;
1643
- b = options.hash.compare;
1644
- }
1645
- return $8NT9G$handlebarsutils.value(a <= b, this, options);
1646
- };
1647
- /**
1648
- * Block helper that always renders the inverse block **unless `a` is
1649
- * is less than `b`**.
1650
- *
1651
- * @param {Object} `a` The default value
1652
- * @param {Object} `b` The value to compare
1653
- * @param {Object} `options` Handlebars provided options object
1654
- * @return {String} Block, or inverse block if specified and falsey.
1655
- * @block
1656
- * @api public
1657
- */ $a0d9c199bd06e6ac$var$helpers.unlessLt = function(a, b, options) {
1658
- if ($8NT9G$handlebarsutils.isOptions(b)) {
1659
- options = b;
1660
- b = options.hash.compare;
1661
- }
1662
- return $8NT9G$handlebarsutils.value(a >= b, this, options);
1663
- };
1664
- /**
1665
- * Block helper that always renders the inverse block **unless `a` is
1666
- * is greater than or equal to `b`**.
1667
- *
1668
- * @param {any} `a`
1669
- * @param {any} `b`
1670
- * @param {Object} `options` Handlebars provided options object
1671
- * @return {String} Block, or inverse block if specified and falsey.
1672
- * @block
1673
- * @api public
1674
- */ $a0d9c199bd06e6ac$var$helpers.unlessGteq = function(a, b, options) {
1675
- if ($8NT9G$handlebarsutils.isOptions(b)) {
1676
- options = b;
1677
- b = options.hash.compare;
1678
- }
1679
- return $8NT9G$handlebarsutils.value(a < b, this, options);
1680
- };
1681
- /**
1682
- * Block helper that always renders the inverse block **unless `a` is
1683
- * is less than or equal to `b`**.
1684
- *
1685
- * @param {any} `a`
1686
- * @param {any} `b`
1687
- * @param {Object} `options` Handlebars provided options object
1688
- * @return {String} Block, or inverse block if specified and falsey.
1689
- * @block
1690
- * @api public
1691
- */ $a0d9c199bd06e6ac$var$helpers.unlessLteq = function(a, b, options) {
1692
- if ($8NT9G$handlebarsutils.isOptions(b)) {
1693
- options = b;
1694
- b = options.hash.compare;
1695
- }
1696
- return $8NT9G$handlebarsutils.value(a > b, this, options);
1697
- };
1698
-
1699
- });
1700
-
1701
- parcelRequire.register("04qnQ", function(module, exports) {
1702
- "use strict";
1703
- var $00d4d710aca9d965$var$helpers = module.exports;
1704
-
1705
- /**
1706
- * Get the current year.
1707
- *
1708
- * ```handlebars
1709
- * {{year}}
1710
- * <!-- 2017 -->
1711
- * ```
1712
- * @exposes year as year
1713
- * @api public
1714
- */ $00d4d710aca9d965$var$helpers.year = $8NT9G$year;
1715
-
1716
- /**
1717
- * Use [moment][] as a helper. See [helper-date][] for more details.
1718
- *
1719
- * @exposes helper-date as moment
1720
- * @api public
1721
- */ $00d4d710aca9d965$var$helpers.moment = $00d4d710aca9d965$var$helpers.date = $8NT9G$helperdate;
1722
-
1723
- });
1724
-
1725
- parcelRequire.register("f5TF7", function(module, exports) {
1726
- "use strict";
1727
-
1728
-
1729
-
1730
-
1731
- var $6LuVW = parcelRequire("6LuVW");
1732
-
1733
- var $7ijcX = parcelRequire("7ijcX");
1734
- var $afd27ffff1667114$var$helpers = module.exports;
1735
- /**
1736
- * Helper `fileSize` is deprecated. Use `helper.prettyBytes` instead.
1737
- */ $afd27ffff1667114$var$helpers.fileSize = $7ijcX.bytes;
1738
- /**
1739
- * Read a file from the file system. This is useful in composing
1740
- * "include"-style helpers using sub-expressions.
1741
- *
1742
- * ```handlebars
1743
- * {{read "a/b/c.js"}}
1744
- * {{someHelper (read "a/b/c.md")}}
1745
- * ```
1746
- * @param {String} `filepath`
1747
- * @return {String}
1748
- * @api public
1749
- */ $afd27ffff1667114$var$helpers.read = function(filepath, options) {
1750
- return $8NT9G$fs.readFileSync(filepath, "utf8");
1751
- };
1752
- /**
1753
- * Return an array of files from the given
1754
- * directory.
1755
- *
1756
- * @param {String} `directory`
1757
- * @return {Array}
1758
- * @api public
1759
- */ $afd27ffff1667114$var$helpers.readdir = function(dir, filter) {
1760
- var files = $8NT9G$fs.readdirSync(dir);
1761
- files = files.map(function(fp) {
1762
- return $8NT9G$path.join(dir, fp);
1763
- });
1764
- if ($8NT9G$handlebarsutils.isOptions(filter)) return files;
1765
- if (typeof filter === "function") return filter(files);
1766
- if ($6LuVW.typeOf(filter) === "regexp") return files.filter(function(fp) {
1767
- return filter.test(fp);
1768
- });
1769
- if ($6LuVW.isGlob(filter)) {
1770
- const isMatch = $6LuVW.mm.matcher(filter);
1771
- const result = [];
1772
- for(let i = 0; i < files.length; i++)if (isMatch(files[i])) result.push(files[i]);
1773
- return result;
1774
- }
1775
- if ([
1776
- "isFile",
1777
- "isDirectory"
1778
- ].indexOf(filter) !== -1) return files.filter(function(fp) {
1779
- var stat = $8NT9G$fs.statSync(fp);
1780
- return stat[filter]();
1781
- });
1782
- return files;
1783
- };
1784
-
1785
- });
1786
- parcelRequire.register("7ijcX", function(module, exports) {
1787
- "use strict";
1788
-
1789
-
1790
-
1791
- var $6LuVW = parcelRequire("6LuVW");
1792
- var $54f91d20d600d1a0$var$helpers = module.exports;
1793
- /**
1794
- * Format a number to it's equivalent in bytes. If a string is passed,
1795
- * it's length will be formatted and returned.
1796
- *
1797
- * **Examples:**
1798
- *
1799
- * - `'foo' => 3 B`
1800
- * - `13661855 => 13.66 MB`
1801
- * - `825399 => 825.39 kB`
1802
- * - `1396 => 1.4 kB`
1803
- *
1804
- * @param {Number|String} `number`
1805
- * @return {String}
1806
- * @api public
1807
- */ $54f91d20d600d1a0$var$helpers.bytes = function(number, precision, options) {
1808
- if (number == null) return "0 B";
1809
- if (!$6LuVW.isNumber(number)) {
1810
- number = number.length;
1811
- if (!number) return "0 B";
1812
- }
1813
- if (!$6LuVW.isNumber(precision)) precision = 2;
1814
- var abbr = [
1815
- "B",
1816
- "kB",
1817
- "MB",
1818
- "GB",
1819
- "TB",
1820
- "PB",
1821
- "EB",
1822
- "ZB",
1823
- "YB"
1824
- ];
1825
- precision = Math.pow(10, precision);
1826
- number = Number(number);
1827
- var len = abbr.length - 1;
1828
- while(len-- >= 0){
1829
- var size = Math.pow(10, len * 3);
1830
- if (size <= number + 1) {
1831
- number = Math.round(number * precision / size) / precision;
1832
- number += " " + abbr[len];
1833
- break;
1834
- }
1835
- }
1836
- return number;
1837
- };
1838
- /**
1839
- * Add commas to numbers
1840
- *
1841
- * @param {Number} `num`
1842
- * @return {Number}
1843
- * @api public
1844
- */ $54f91d20d600d1a0$var$helpers.addCommas = function(num) {
1845
- return num.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
1846
- };
1847
- /**
1848
- * Convert a string or number to a formatted phone number.
1849
- *
1850
- * @param {Number|String} `num` The phone number to format, e.g. `8005551212`
1851
- * @return {Number} Formatted phone number: `(800) 555-1212`
1852
- * @source http://bit.ly/QlPmPr
1853
- * @api public
1854
- */ $54f91d20d600d1a0$var$helpers.phoneNumber = function(num) {
1855
- num = num.toString();
1856
- return "(" + num.substr(0, 3) + ") " + num.substr(3, 3) + "-" + num.substr(6, 4);
1857
- };
1858
- /**
1859
- * Abbreviate numbers to the given number of `precision`. This is for
1860
- * general numbers, not size in bytes.
1861
- *
1862
- * @param {Number} `number`
1863
- * @param {Number} `precision`
1864
- * @return {String}
1865
- * @api public
1866
- */ $54f91d20d600d1a0$var$helpers.toAbbr = function(number, precision) {
1867
- if (!$6LuVW.isNumber(number)) number = 0;
1868
- if ($8NT9G$handlebarsutils.isUndefined(precision)) precision = 2;
1869
- number = Number(number);
1870
- // 2 decimal places => 100, 3 => 1000, etc.
1871
- precision = Math.pow(10, precision);
1872
- var abbr = [
1873
- "k",
1874
- "m",
1875
- "b",
1876
- "t",
1877
- "q"
1878
- ];
1879
- var len = abbr.length - 1;
1880
- while(len >= 0){
1881
- var size = Math.pow(10, (len + 1) * 3);
1882
- if (size <= number + 1) {
1883
- number = Math.round(number * precision / size) / precision;
1884
- number += abbr[len];
1885
- break;
1886
- }
1887
- len--;
1888
- }
1889
- return number;
1890
- };
1891
- /**
1892
- * Returns a string representing the given number in exponential notation.
1893
- *
1894
- * ```handlebars
1895
- * {{toExponential number digits}};
1896
- * ```
1897
- * @param {Number} `number`
1898
- * @param {Number} `fractionDigits` Optional. An integer specifying the number of digits to use after the decimal point. Defaults to as many digits as necessary to specify the number.
1899
- * @return {Number}
1900
- * @api public
1901
- */ $54f91d20d600d1a0$var$helpers.toExponential = function(number, digits) {
1902
- if (!$6LuVW.isNumber(number)) number = 0;
1903
- if ($8NT9G$handlebarsutils.isUndefined(digits)) digits = 0;
1904
- return Number(number).toExponential(digits);
1905
- };
1906
- /**
1907
- * Formats the given number using fixed-point notation.
1908
- *
1909
- * ```handlebars
1910
- * {{toFixed "1.1234" 2}}
1911
- * //=> '1.12'
1912
- * ```
1913
- * @param {Number} `number`
1914
- * @param {Number} `digits` (Optional) The number of digits to appear after the decimal point; this may be a value between 0 and 20. If this argument is omitted, it is treated as 0.
1915
- * @return {String} A string representing the given number using fixed-point notation.
1916
- * @api public
1917
- */ $54f91d20d600d1a0$var$helpers.toFixed = function(number, digits) {
1918
- if (!$6LuVW.isNumber(number)) number = 0;
1919
- if (!$8NT9G$isnumber(digits)) digits = 0;
1920
- return Number(number).toFixed(digits);
1921
- };
1922
- /**
1923
- * @param {Number} `number`
1924
- * @return {Number}
1925
- * @api public
1926
- */ $54f91d20d600d1a0$var$helpers.toFloat = function(number) {
1927
- return parseFloat(number);
1928
- };
1929
- /**
1930
- * @param {Number} `number`
1931
- * @return {Number}
1932
- * @api public
1933
- */ $54f91d20d600d1a0$var$helpers.toInt = function(number) {
1934
- return parseInt(number, 10);
1935
- };
1936
- /**
1937
- * Returns a string representing the `Number` object to the specified precision.
1938
- *
1939
- * ```handlebars
1940
- * {{toPrecision "1.1234" 2}}
1941
- * //=> '1.1'
1942
- * ```
1943
- * @param {Number} `number`
1944
- * @param {Number} `precision` (Optional) An integer specifying the number of significant digits. If precison is not between 1 and 100 (inclusive), it will be coerced to `0`.
1945
- * @return {String} A string representing a Number object in fixed-point or exponential notation rounded to precision significant digits.
1946
- * @api public
1947
- */ $54f91d20d600d1a0$var$helpers.toPrecision = function(number, precision) {
1948
- if (!$6LuVW.isNumber(number)) number = 0;
1949
- if (!$8NT9G$isnumber(precision)) precision = 1;
1950
- return Number(number).toPrecision(precision);
1951
- };
1952
-
1953
- });
1954
-
1955
-
1956
- parcelRequire.register("32RMd", function(module, exports) {
1957
- "use strict";
1958
-
1959
-
1960
-
1961
- var $cLqRK = parcelRequire("cLqRK");
1962
-
1963
- var $6LuVW = parcelRequire("6LuVW");
1964
- var $237b45eadb36f79f$var$parseAttr = $cLqRK.parseAttributes;
1965
- var $237b45eadb36f79f$var$helpers = module.exports;
1966
- /**
1967
- * Stringify attributes on the options `hash`.
1968
- *
1969
- * ```handlebars
1970
- * <!-- value = 'bar' -->
1971
- * <div{{attr foo=value}}></div>
1972
- * <!-- results in: <div foo="bar"></div>
1973
- * ```
1974
- * @param {Object} `options`
1975
- * @return {String}
1976
- * @api public
1977
- */ $237b45eadb36f79f$var$helpers.attr = function(options) {
1978
- var val = $237b45eadb36f79f$var$parseAttr(options && options.hash || {});
1979
- return val.trim() ? " " + val : "";
1980
- };
1981
- /**
1982
- * Add an array of `<link>` tags. Automatically resolves
1983
- * relative paths to `options.assets` if passed on the context.
1984
- *
1985
- * ```handlebars
1986
- * <!-- {stylesheets: ['foo.css', 'bar.css']} -->
1987
- * {{css stylesheets}}
1988
- *
1989
- * <!-- results in: -->
1990
- * <!-- <link type="text/css" rel="stylesheet" href="foo.css"> -->
1991
- * <!-- <link type="text/css" rel="stylesheet" href="bar.css"> -->
1992
- * ```
1993
- * @param {String|Array} `list` One or more stylesheet urls.
1994
- * @return {String}
1995
- * @api public
1996
- */ $237b45eadb36f79f$var$helpers.css = function(list, options) {
1997
- if (arguments.length < 2) {
1998
- options = list;
1999
- list = [];
2000
- }
2001
- var styles = $8NT9G$handlebarsutils.arrayify(list);
2002
- var assets = "";
2003
- if (this && this.options) assets = this.options.assets || "";
2004
- if (options.hash.href) styles = $8NT9G$handlebarsutils.arrayify(options.hash.href);
2005
- return styles.map(function(item) {
2006
- var ext = $8NT9G$path.extname(item);
2007
- var fp = item;
2008
- if (!/(^\/\/)|(:\/\/)/.test(item)) fp = $8NT9G$path.posix.join(assets, item);
2009
- if (ext === ".less") return '<link type="text/css" rel="stylesheet/less" href="' + fp + '">';
2010
- return '<link type="text/css" rel="stylesheet" href="' + fp + '">';
2011
- }).join("\n");
2012
- };
2013
- /**
2014
- * Generate one or more `<script></script>` tags with paths/urls to
2015
- * javascript or coffeescript files.
2016
- *
2017
- * ```handlebars
2018
- * {{js scripts}}
2019
- * ```
2020
- * @param {Object} `context`
2021
- * @return {String}
2022
- * @api public
2023
- */ $237b45eadb36f79f$var$helpers.js = function(context) {
2024
- if ($6LuVW.typeOf(context) === "object") {
2025
- var attr = $237b45eadb36f79f$var$parseAttr(context.hash);
2026
- return "<script" + (attr ? " " + attr : "") + "></script>";
2027
- }
2028
- if ($6LuVW.typeOf(context) === "string") return '<script src="' + context + '"></script>';
2029
- context = $8NT9G$handlebarsutils.arrayify(context);
2030
- return context.map(function(fp) {
2031
- return $8NT9G$path.extname(fp) === ".coffee" ? $6LuVW.tag("script", {
2032
- type: "text/coffeescript",
2033
- src: fp
2034
- }) : $6LuVW.tag("script", {
2035
- src: fp
2036
- });
2037
- }).join("\n");
2038
- };
2039
- /**
2040
- * Strip HTML tags from a string, so that only the text nodes
2041
- * are preserved.
2042
- *
2043
- * ```handlebars
2044
- * {{sanitize "<span>foo</span>"}}
2045
- * <!-- results in: 'foo' -->
2046
- * ```
2047
- *
2048
- * @param {String} `str` The string of HTML to sanitize.
2049
- * @return {String}
2050
- * @api public
2051
- */ $237b45eadb36f79f$var$helpers.sanitize = function(str) {
2052
- return $cLqRK.sanitize(str);
2053
- };
2054
- /**
2055
- * Block helper for creating unordered lists (`<ul></ul>`)
2056
- *
2057
- * @param {Object} `context`
2058
- * @param {Object} `options`
2059
- * @return {String}
2060
- * @block
2061
- * @api public
2062
- */ $237b45eadb36f79f$var$helpers.ul = function(context, options) {
2063
- return "<ul " + $237b45eadb36f79f$var$parseAttr(options.hash) + ">" + context.map(function(item) {
2064
- if (typeof item !== "string") item = options.fn(item);
2065
- return "<li>" + item + "</li>";
2066
- }).join("\n") + "</ul>";
2067
- };
2068
- /**
2069
- * Block helper for creating ordered lists (`<ol></ol>`)
2070
- *
2071
- * @param {Object} `context`
2072
- * @param {Object} `options`
2073
- * @return {String}
2074
- * @block
2075
- * @api public
2076
- */ $237b45eadb36f79f$var$helpers.ol = function(context, options) {
2077
- return "<ol " + $237b45eadb36f79f$var$parseAttr(options.hash) + ">" + context.map(function(item) {
2078
- if (typeof item !== "string") item = options.fn(item);
2079
- return "<li>" + item + "</li>";
2080
- }).join("\n") + "</ol>";
2081
- };
2082
- /**
2083
- * Returns a `<figure>` with a thumbnail linked to a full picture
2084
- *
2085
- * @param {Object} `context` Object with values/attributes to add to the generated elements:
2086
- * @param {String} `context.alt`
2087
- * @param {String} `context.src`
2088
- * @param {Number} `context.width`
2089
- * @param {Number} `context.height`
2090
- * @return {String} HTML `<figure>` element with image and optional caption/link.
2091
- * @contributor: Marie Hogebrandt <https://github.com/Melindrea>
2092
- * @api public
2093
- */ $237b45eadb36f79f$var$helpers.thumbnailImage = function(context) {
2094
- var figure = "";
2095
- var image = "";
2096
- var link = context.full || false;
2097
- var imageAttributes = {
2098
- alt: context.alt,
2099
- src: context.thumbnail,
2100
- width: context.size.width,
2101
- height: context.size.height
2102
- };
2103
- var figureAttributes = {
2104
- id: "image-" + context.id
2105
- };
2106
- var linkAttributes = {
2107
- href: link,
2108
- rel: "thumbnail"
2109
- };
2110
- if (context.classes) {
2111
- if (context.classes.image) imageAttributes.class = context.classes.image.join(" ");
2112
- if (context.classes.figure) figureAttributes.class = context.classes.figure.join(" ");
2113
- if (context.classes.link) linkAttributes.class = context.classes.link.join(" ");
2114
- }
2115
- figure += "<figure " + $237b45eadb36f79f$var$parseAttr(figureAttributes) + ">\n";
2116
- image += "<img " + $237b45eadb36f79f$var$parseAttr(imageAttributes) + ">\n";
2117
- if (link) figure += "<a " + $237b45eadb36f79f$var$parseAttr(linkAttributes) + ">\n" + image + "</a>\n";
2118
- else figure += image;
2119
- if (context.caption) figure += "<figcaption>" + context.caption + "</figcaption>\n";
2120
- figure += "</figure>";
2121
- return figure;
2122
- };
2123
-
2124
- });
2125
- parcelRequire.register("cLqRK", function(module, exports) {
2126
- "use strict";
2127
-
2128
-
2129
- /**
2130
- * Expose `utils`
2131
- */ var $94aeb6d2746b46d5$var$html = module.exports;
2132
- /**
2133
- * Remove extra newlines from HTML, respect indentation.
2134
- *
2135
- * @param {String} html
2136
- * @return {String}
2137
- * @api public
2138
- */ $94aeb6d2746b46d5$var$html.condense = function(str) {
2139
- return str.replace(/(\r\n|\r|\n|\u2028|\u2029) {2,}/g, "\n");
2140
- };
2141
- /**
2142
- * Add a single newline above code comments in HTML
2143
- *
2144
- * @param {String} `html`
2145
- * @return {String}
2146
- * @api public
2147
- */ $94aeb6d2746b46d5$var$html.padcomments = function(str) {
2148
- return str.replace(/(\s*<!--)/g, "\n$1");
2149
- };
2150
- /**
2151
- * Parse HTML tag attributes from the `options.hash`.
2152
- *
2153
- * @param {Object} `hash` Helper options hash, e.g. `{foo: 'bar'}`
2154
- * @return {String} Stringified attributes, e.g. `foo="bar"`
2155
- * @api public
2156
- */ $94aeb6d2746b46d5$var$html.parseAttributes = function parseAttributes(hash) {
2157
- return Object.keys(hash).map(function(key) {
2158
- var val = String(hash[key]).replace(/^['"]|["']$/g, "");
2159
- return key + '="' + val + '"';
2160
- }).join(" ");
2161
- };
2162
- /**
2163
- * Strip HTML tags from a string, so that only the text nodes
2164
- * are preserved.
2165
- *
2166
- * ```handlebars
2167
- * {{sanitize "<span>foo</span>"}}
2168
- * //=> 'foo'
2169
- * ```
2170
- *
2171
- * @param {String} `str` The string of HTML to sanitize.
2172
- * @return {String}
2173
- * @api public
2174
- */ $94aeb6d2746b46d5$var$html.sanitize = function(str) {
2175
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2176
- return $8NT9G$striptags(str).trim();
2177
- };
2178
- $94aeb6d2746b46d5$var$html.toAttributes = function toAttributes(hash) {
2179
- var res = "";
2180
- var keys = Object.keys(hash);
2181
- for(var i = 0; i < keys.length; i++){
2182
- var val = hash[keys[i]];
2183
- if (val === true) res += " " + keys[i];
2184
- else res += " " + keys[i] + '="' + String(val) + '"';
2185
- }
2186
- return res;
2187
- };
2188
-
2189
- });
2190
-
2191
-
2192
- parcelRequire.register("bALdb", function(module, exports) {
2193
- "use strict";
2194
-
2195
-
2196
- var $6LuVW = parcelRequire("6LuVW");
2197
- var $8707adc63a081255$var$helpers = module.exports;
2198
- /**
2199
- * i18n helper. See [button-i18n](https://github.com/assemble/buttons)
2200
- * for a working example.
2201
- *
2202
- * @contributor Laurent Goderre <https://github.com/LaurentGoderrre>
2203
- * @param {String} `key`
2204
- * @param {Object} `options`
2205
- * @return {String}
2206
- * @api public
2207
- */ $8707adc63a081255$var$helpers.i18n = function(prop, locals, options) {
2208
- if ($8NT9G$handlebarsutils.isOptions(locals)) {
2209
- options = locals;
2210
- locals = {};
2211
- }
2212
- if (!$8NT9G$handlebarsutils.isString(prop)) throw new Error('{{i18n}} helper expected "key" to be a string');
2213
- var opts = $8NT9G$handlebarsutils.options(this, locals, options);
2214
- var context = Object.assign({}, this, opts);
2215
- var lang = context.language || context.lang;
2216
- if (!$8NT9G$handlebarsutils.isString(lang)) throw new TypeError('{{i18n}} helper expected "language" to be a string');
2217
- var cache = context[lang];
2218
- if (typeof cache === "undefined") throw new Error('{{i18n}} helper cannot find language "' + lang + '"');
2219
- var result = $6LuVW.get(cache, prop);
2220
- if (typeof result === "undefined") throw new Error('{{i18n}} helper cannot find property "' + prop + '" for language "' + lang + '"');
2221
- return result;
2222
- };
2223
-
2224
- });
2225
-
2226
- parcelRequire.register("jZuol", function(module, exports) {
2227
- "use strict";
2228
-
2229
- var $e8db49f7d25cac09$var$helpers = module.exports;
2230
- /**
2231
- * Returns either the `singular` or `plural` inflection of a word based on
2232
- * the given `count`.
2233
- *
2234
- * ```handlebars
2235
- * {{inflect 0 "string" "strings"}}
2236
- * <!-- "strings" -->
2237
- * {{inflect 1 "string" "strings"}}
2238
- * <!-- "string" -->
2239
- * {{inflect 1 "string" "strings" true}}
2240
- * <!-- "1 string" -->
2241
- * {{inflect 2 "string" "strings"}}
2242
- * <!-- "strings" -->
2243
- * {{inflect 2 "string" "strings" true}}
2244
- * <!-- "2 strings" -->
2245
- * ```
2246
- * @param {Number} `count`
2247
- * @param {String} `singular` The singular form
2248
- * @param {String} `plural` The plural form
2249
- * @param {String} `includeCount`
2250
- * @return {String}
2251
- * @api public
2252
- */ $e8db49f7d25cac09$var$helpers.inflect = function(count, singular, plural, includeCount) {
2253
- var word = count > 1 || count === 0 ? plural : singular;
2254
- if (includeCount === true) return String(count) + " " + word;
2255
- else return word;
2256
- };
2257
- /**
2258
- * Returns an ordinalized number as a string.
2259
- *
2260
- * ```handlebars
2261
- * {{ordinalize 1}}
2262
- * <!-- '1st' -->
2263
- * {{ordinalize 21}}
2264
- * <!-- '21st' -->
2265
- * {{ordinalize 29}}
2266
- * <!-- '29th' -->
2267
- * {{ordinalize 22}}
2268
- * <!-- '22nd' -->
2269
- * ```
2270
- *
2271
- * @param {String} `val` The value to ordinalize.
2272
- * @return {String} The ordinalized number
2273
- * @api public
2274
- */ $e8db49f7d25cac09$var$helpers.ordinalize = function(val) {
2275
- var num = Math.abs(Math.round(val));
2276
- var str = String(val);
2277
- var res = num % 100;
2278
- if ($8NT9G$handlebarsutils.indexOf([
2279
- 11,
2280
- 12,
2281
- 13
2282
- ], res) >= 0) return str + "th";
2283
- switch(num % 10){
2284
- case 1:
2285
- return str + "st";
2286
- case 2:
2287
- return str + "nd";
2288
- case 3:
2289
- return str + "rd";
2290
- default:
2291
- return str + "th";
2292
- }
2293
- };
2294
-
2295
- });
2296
-
2297
- parcelRequire.register("l63ao", function(module, exports) {
2298
- "use strict";
2299
-
2300
- /**
2301
- * [logging-helpers](https://github.com/helpers/logging-helpers).
2302
- * @api public
2303
- */ module.exports = $8NT9G$logginghelpers;
2304
-
2305
- });
2306
-
2307
- parcelRequire.register("157n4", function(module, exports) {
2308
- "use strict";
2309
- /**
2310
- * Expose markdown `helpers` (for performance we're using getters so
2311
- * that the helpers are only loaded if called)
2312
- */ var $0c9bf9d204894bfd$var$helpers = module.exports;
2313
- var $0c9bf9d204894bfd$var$markdown;
2314
-
2315
- /**
2316
- * Block helper that converts a string of inline markdown to HTML.
2317
- *
2318
- * ```handlebars
2319
- * {{#markdown}}
2320
- * # Foo
2321
- * {{/markdown}}
2322
- * <!-- results in: <h1>Foo</h1> -->
2323
- * ```
2324
- * @name .markdown
2325
- * @param {Object} `context`
2326
- * @param {Object} `options`
2327
- * @return {String}
2328
- * @block
2329
- * @api public
2330
- */ Object.defineProperty($0c9bf9d204894bfd$var$helpers, "markdown", {
2331
- configurable: true,
2332
- enumerable: true,
2333
- set: function(val) {
2334
- $0c9bf9d204894bfd$var$markdown = val;
2335
- },
2336
- get: function() {
2337
- // this is defined as a getter to avoid calling this function
2338
- // unless the helper is actually used
2339
- return $0c9bf9d204894bfd$var$markdown || ($0c9bf9d204894bfd$var$markdown = $8NT9G$helperformarkdown());
2340
- }
2341
- });
2342
-
2343
- /**
2344
- * Read a markdown file from the file system and inject its contents after
2345
- * converting it to HTML.
2346
- *
2347
- * ```handlebars
2348
- * {{md "foo/bar.md"}}
2349
- * ```
2350
- * @param {Object} `context`
2351
- * @param {Object} `options`
2352
- * @return {String}
2353
- * @block
2354
- * @api public
2355
- */ $0c9bf9d204894bfd$var$helpers.md = $8NT9G$helpermd;
2356
-
2357
- });
2358
-
2359
- parcelRequire.register("7tOGz", function(module, exports) {
2360
- "use strict";
2361
-
2362
-
2363
- var $6LuVW = parcelRequire("6LuVW");
2364
- var $57228ef6659add76$var$helpers = module.exports;
2365
- /**
2366
- * Returns an array of strings that match the given glob pattern(s).
2367
- * Options may be passed on the options hash or locals.
2368
- *
2369
- * ```handlebars
2370
- * {{match (readdir "foo") "*.js"}}
2371
- * {{match (readdir "foo") (toRegex "\\.js$")}}
2372
- * ```
2373
- * @param {Array|String} `files`
2374
- * @param {Array|String} `patterns` One or more glob patterns.
2375
- * @param {Object} `locals`
2376
- * @param {Object} `options`
2377
- * @return {Array} Array of matches
2378
- * @api public
2379
- */ $57228ef6659add76$var$helpers.match = function(files, patterns, locals, options) {
2380
- var opts = $8NT9G$handlebarsutils.options(this, locals, options);
2381
- if (typeof patterns === "string") patterns = patterns.split(/, */);
2382
- return $6LuVW.mm(files, patterns, opts);
2383
- };
2384
- /**
2385
- * Returns true if a filepath contains the given pattern.
2386
- * Options may be passed on the options hash or locals.
2387
- *
2388
- * ```handlebars
2389
- * {{isMatch "foo.md" "*.md"}}
2390
- * <!-- results in: true -->
2391
- * ```
2392
- *
2393
- * @param {String} `filepath`
2394
- * @param {String} `pattern`
2395
- * @param {Object} `options`
2396
- * @return {Boolean}
2397
- * @api public
2398
- */ $57228ef6659add76$var$helpers.isMatch = function(files, patterns, locals, options) {
2399
- var opts = $8NT9G$handlebarsutils.options(this, locals, options);
2400
- return $6LuVW.mm.isMatch(files, patterns, opts);
2401
- };
2402
- /**
2403
- * Alias for micromatch helper. Deprecated in v0.9.0.
2404
- */ $57228ef6659add76$var$helpers.mm = function() {
2405
- console.log("the {{mm}} helper is depcrecated and will be removed");
2406
- console.log("in handlebars-helpers v1.0.0, please use the {{match}}");
2407
- console.log("helper instead.");
2408
- return $57228ef6659add76$var$helpers.match.apply(this, arguments);
2409
- };
2410
-
2411
- });
2412
-
2413
- parcelRequire.register("diHL6", function(module, exports) {
2414
- "use strict";
2415
-
2416
-
2417
- var $6LuVW = parcelRequire("6LuVW");
2418
- var $9aeee661c1324e2c$var$helpers = module.exports;
2419
- /**
2420
- * Return the magnitude of `a`.
2421
- *
2422
- * @param {Number} `a`
2423
- * @return {Number}
2424
- * @api public
2425
- */ $9aeee661c1324e2c$var$helpers.abs = function(num) {
2426
- if (!$8NT9G$isnumber(num)) throw new TypeError("expected a number");
2427
- return Math.abs(num);
2428
- };
2429
- /**
2430
- * Return the sum of `a` plus `b`.
2431
- *
2432
- * @param {Number} `a`
2433
- * @param {Number} `b`
2434
- * @return {Number}
2435
- * @api public
2436
- */ $9aeee661c1324e2c$var$helpers.add = function(a, b) {
2437
- if ($8NT9G$isnumber(a) && $8NT9G$isnumber(b)) return Number(a) + Number(b);
2438
- if (typeof a === "string" && typeof b === "string") return a + b;
2439
- return "";
2440
- };
2441
- /**
2442
- * Returns the average of all numbers in the given array.
2443
- *
2444
- * ```handlebars
2445
- * {{avg "[1, 2, 3, 4, 5]"}}
2446
- * <!-- results in: '3' -->
2447
- * ```
2448
- *
2449
- * @param {Array} `array` Array of numbers to add up.
2450
- * @return {Number}
2451
- * @api public
2452
- */ $9aeee661c1324e2c$var$helpers.avg = function() {
2453
- var args = [].concat.apply([], arguments);
2454
- // remove handlebars options object
2455
- args.pop();
2456
- return $9aeee661c1324e2c$var$helpers.sum(args) / args.length;
2457
- };
2458
- /**
2459
- * Get the `Math.ceil()` of the given value.
2460
- *
2461
- * @param {Number} `value`
2462
- * @return {Number}
2463
- * @api public
2464
- */ $9aeee661c1324e2c$var$helpers.ceil = function(num) {
2465
- if (!$8NT9G$isnumber(num)) throw new TypeError("expected a number");
2466
- return Math.ceil(num);
2467
- };
2468
- /**
2469
- * Divide `a` by `b`
2470
- *
2471
- * @param {Number} `a` numerator
2472
- * @param {Number} `b` denominator
2473
- * @api public
2474
- */ $9aeee661c1324e2c$var$helpers.divide = function(a, b) {
2475
- if (!$8NT9G$isnumber(a)) throw new TypeError("expected the first argument to be a number");
2476
- if (!$8NT9G$isnumber(b)) throw new TypeError("expected the second argument to be a number");
2477
- return Number(a) / Number(b);
2478
- };
2479
- /**
2480
- * Get the `Math.floor()` of the given value.
2481
- *
2482
- * @param {Number} `value`
2483
- * @return {Number}
2484
- * @api public
2485
- */ $9aeee661c1324e2c$var$helpers.floor = function(num) {
2486
- if (!$8NT9G$isnumber(num)) throw new TypeError("expected a number");
2487
- return Math.floor(num);
2488
- };
2489
- /**
2490
- * Return the difference of `a` minus `b`.
2491
- *
2492
- * @param {Number} `a`
2493
- * @param {Number} `b`
2494
- * @alias subtract
2495
- * @api public
2496
- */ $9aeee661c1324e2c$var$helpers.minus = function(a, b) {
2497
- if (!$8NT9G$isnumber(a)) throw new TypeError("expected the first argument to be a number");
2498
- if (!$8NT9G$isnumber(b)) throw new TypeError("expected the second argument to be a number");
2499
- return Number(a) - Number(b);
2500
- };
2501
- /**
2502
- * Get the remainder of a division operation.
2503
- *
2504
- * @param {Number} `a`
2505
- * @param {Number} `b`
2506
- * @return {Number}
2507
- * @api public
2508
- */ $9aeee661c1324e2c$var$helpers.modulo = function(a, b) {
2509
- if (!$8NT9G$isnumber(a)) throw new TypeError("expected the first argument to be a number");
2510
- if (!$8NT9G$isnumber(b)) throw new TypeError("expected the second argument to be a number");
2511
- return Number(a) % Number(b);
2512
- };
2513
- /**
2514
- * Return the product of `a` times `b`.
2515
- *
2516
- * @param {Number} `a` factor
2517
- * @param {Number} `b` multiplier
2518
- * @return {Number}
2519
- * @alias times
2520
- * @api public
2521
- */ $9aeee661c1324e2c$var$helpers.multiply = function(a, b) {
2522
- if (!$8NT9G$isnumber(a)) throw new TypeError("expected the first argument to be a number");
2523
- if (!$8NT9G$isnumber(b)) throw new TypeError("expected the second argument to be a number");
2524
- return Number(a) * Number(b);
2525
- };
2526
- /**
2527
- * Add `a` by `b`.
2528
- *
2529
- * @param {Number} `a` factor
2530
- * @param {Number} `b` multiplier
2531
- * @api public
2532
- */ $9aeee661c1324e2c$var$helpers.plus = function(a, b) {
2533
- if (!$8NT9G$isnumber(a)) throw new TypeError("expected the first argument to be a number");
2534
- if (!$8NT9G$isnumber(b)) throw new TypeError("expected the second argument to be a number");
2535
- return Number(a) + Number(b);
2536
- };
2537
- /**
2538
- * Generate a random number between two values
2539
- *
2540
- * @param {Number} `min`
2541
- * @param {Number} `max`
2542
- * @return {String}
2543
- * @api public
2544
- */ $9aeee661c1324e2c$var$helpers.random = function(min, max) {
2545
- if (!$8NT9G$isnumber(min)) throw new TypeError("expected minimum to be a number");
2546
- if (!$8NT9G$isnumber(max)) throw new TypeError("expected maximum to be a number");
2547
- return $6LuVW.random(min, max);
2548
- };
2549
- /**
2550
- * Get the remainder when `a` is divided by `b`.
2551
- *
2552
- * @param {Number} `a` a
2553
- * @param {Number} `b` b
2554
- * @api public
2555
- */ $9aeee661c1324e2c$var$helpers.remainder = function(a, b) {
2556
- return a % b;
2557
- };
2558
- /**
2559
- * Round the given number.
2560
- *
2561
- * @param {Number} `number`
2562
- * @return {Number}
2563
- * @api public
2564
- */ $9aeee661c1324e2c$var$helpers.round = function(num) {
2565
- if (!$8NT9G$isnumber(num)) throw new TypeError("expected a number");
2566
- return Math.round(num);
2567
- };
2568
- /**
2569
- * Return the product of `a` minus `b`.
2570
- *
2571
- * @param {Number} `a`
2572
- * @param {Number} `b`
2573
- * @return {Number}
2574
- * @alias minus
2575
- * @api public
2576
- */ $9aeee661c1324e2c$var$helpers.subtract = function(a, b) {
2577
- if (!$8NT9G$isnumber(a)) throw new TypeError("expected the first argument to be a number");
2578
- if (!$8NT9G$isnumber(b)) throw new TypeError("expected the second argument to be a number");
2579
- return Number(a) - Number(b);
2580
- };
2581
- /**
2582
- * Returns the sum of all numbers in the given array.
2583
- *
2584
- * ```handlebars
2585
- * {{sum "[1, 2, 3, 4, 5]"}}
2586
- * <!-- results in: '15' -->
2587
- * ```
2588
- * @param {Array} `array` Array of numbers to add up.
2589
- * @return {Number}
2590
- * @api public
2591
- */ $9aeee661c1324e2c$var$helpers.sum = function() {
2592
- var args = [].concat.apply([], arguments);
2593
- var len = args.length;
2594
- var sum = 0;
2595
- while(len--)if ($6LuVW.isNumber(args[len])) sum += Number(args[len]);
2596
- return sum;
2597
- };
2598
- /**
2599
- * Multiply number `a` by number `b`.
2600
- *
2601
- * @param {Number} `a` factor
2602
- * @param {Number} `b` multiplier
2603
- * @return {Number}
2604
- * @alias multiply
2605
- * @api public
2606
- */ $9aeee661c1324e2c$var$helpers.times = function() {
2607
- return $9aeee661c1324e2c$var$helpers.multiply.apply(this, arguments);
2608
- };
2609
-
2610
- });
2611
-
2612
- parcelRequire.register("2fV8Q", function(module, exports) {
2613
- "use strict";
2614
-
2615
-
2616
- var $6LuVW = parcelRequire("6LuVW");
2617
- var $1a494e9ec7bf2bc1$var$helpers = module.exports;
2618
-
2619
- /**
2620
- * Block helper for exposing private `@` variables on the context
2621
- */ $1a494e9ec7bf2bc1$var$helpers.frame = $8NT9G$handlebarshelpercreateframe;
2622
- /**
2623
- * Return the given value of `prop` from `this.options`.
2624
- *
2625
- * ```handlebars
2626
- * <!-- context = {options: {a: {b: {c: 'ddd'}}}} -->
2627
- * {{option "a.b.c"}}
2628
- * <!-- results => `ddd` -->
2629
- * ```
2630
- * @param {String} `prop`
2631
- * @return {any}
2632
- * @api public
2633
- */ $1a494e9ec7bf2bc1$var$helpers.option = function(prop, locals, options) {
2634
- return $6LuVW.get($8NT9G$handlebarsutils.options(this, locals, options), prop);
2635
- };
2636
- /**
2637
- * Block helper that renders the block without taking any arguments.
2638
- *
2639
- * @param {Object} `options`
2640
- * @return {String}
2641
- * @block
2642
- * @api public
2643
- */ $1a494e9ec7bf2bc1$var$helpers.noop = function(options) {
2644
- return options.fn(this);
2645
- };
2646
-
2647
- /**
2648
- * Get the native type of the given `value`
2649
- *
2650
- * ```handlebars
2651
- * {{typeOf 1}}
2652
- * //=> 'number'
2653
- * {{typeOf "1"}}
2654
- * //=> 'string'
2655
- * {{typeOf "foo"}}
2656
- * //=> 'string'
2657
- * ```
2658
- * @param {any} `value`
2659
- * @return {String} Returns the type of value.
2660
- * @api public
2661
- */ $1a494e9ec7bf2bc1$var$helpers.typeOf = $8NT9G$kindof;
2662
- /**
2663
- * Block helper that builds the context for the block
2664
- * from the options hash.
2665
- *
2666
- * @param {Object} `options` Handlebars provided options object.
2667
- * @contributor Vladimir Kuznetsov <https://github.com/mistakster>
2668
- * @block
2669
- * @api public
2670
- */ $1a494e9ec7bf2bc1$var$helpers.withHash = function(options) {
2671
- if (options.hash && Object.keys(options.hash).length) return options.fn(options.hash);
2672
- else return options.inverse(this);
2673
- };
2674
-
2675
- });
2676
-
2677
- parcelRequire.register("h6LqX", function(module, exports) {
2678
-
2679
- "use strict";
2680
-
2681
-
2682
-
2683
- var $6LuVW = parcelRequire("6LuVW");
2684
- var $c747ca944c6b85c7$var$helpers = module.exports;
2685
- /**
2686
- * Get the directory path segment from the given `filepath`.
2687
- *
2688
- * ```handlebars
2689
- * {{absolute "docs/toc.md"}}
2690
- * <!-- results in: 'docs' -->
2691
- * ```
2692
- * @param {String} `ext`
2693
- * @return {String}
2694
- * @api public
2695
- */ $c747ca944c6b85c7$var$helpers.absolute = function(filepath, options) {
2696
- options = options || {
2697
- data: {}
2698
- };
2699
- var context = $8NT9G$handlebarsutils.options(this, options);
2700
- var ctx = Object.assign({}, options.data.root, context);
2701
- var cwd = ctx.cwd || $8NT9G$process.cwd();
2702
- return $8NT9G$path.resolve(cwd, filepath);
2703
- };
2704
- /**
2705
- * Get the directory path segment from the given `filepath`.
2706
- *
2707
- * ```handlebars
2708
- * {{dirname "docs/toc.md"}}
2709
- * <!-- results in: 'docs' -->
2710
- * ```
2711
- * @param {String} `ext`
2712
- * @return {String}
2713
- * @api public
2714
- */ $c747ca944c6b85c7$var$helpers.dirname = function(filepath, options) {
2715
- if (typeof filepath !== "string") throw new TypeError($6LuVW.expectedType("filepath", "string", filepath));
2716
- return $8NT9G$path.dirname(filepath);
2717
- };
2718
- /**
2719
- * Get the relative filepath from `a` to `b`.
2720
- *
2721
- * ```handlebars
2722
- * {{relative a b}}
2723
- * ```
2724
- * @param {String} `a`
2725
- * @param {String} `b`
2726
- * @return {String}
2727
- * @api public
2728
- */ $c747ca944c6b85c7$var$helpers.relative = function(a, b) {
2729
- if (typeof a !== "string") throw new TypeError($6LuVW.expectedType("first path", "string", a));
2730
- if (typeof b !== "string") throw new TypeError($6LuVW.expectedType("second path", "string", b));
2731
- return $6LuVW.relative(a, b);
2732
- };
2733
- /**
2734
- * Get the file extension from the given `filepath`.
2735
- *
2736
- * ```handlebars
2737
- * {{basename "docs/toc.md"}}
2738
- * <!-- results in: 'toc.md' -->
2739
- * ```
2740
- * @param {String} `ext`
2741
- * @return {String}
2742
- * @api public
2743
- */ $c747ca944c6b85c7$var$helpers.basename = function(filepath) {
2744
- if (typeof filepath !== "string") throw new TypeError($6LuVW.expectedType("filepath", "string", filepath));
2745
- return $8NT9G$path.basename(filepath);
2746
- };
2747
- /**
2748
- * Get the "stem" from the given `filepath`.
2749
- *
2750
- * ```handlebars
2751
- * {{stem "docs/toc.md"}}
2752
- * <!-- results in: 'toc' -->
2753
- * ```
2754
- * @param {String} `filepath`
2755
- * @return {String}
2756
- * @api public
2757
- */ $c747ca944c6b85c7$var$helpers.stem = function(filepath) {
2758
- if (typeof filepath !== "string") throw new TypeError($6LuVW.expectedType("filepath", "string", filepath));
2759
- return $8NT9G$path.basename(filepath, $8NT9G$path.extname(filepath));
2760
- };
2761
- /**
2762
- * Get the file extension from the given `filepath`.
2763
- *
2764
- * ```handlebars
2765
- * {{extname "docs/toc.md"}}
2766
- * <!-- results in: '.md' -->
2767
- * ```
2768
- * @param {String} `filepath`
2769
- * @return {String}
2770
- * @api public
2771
- */ $c747ca944c6b85c7$var$helpers.extname = function(filepath) {
2772
- if (typeof filepath !== "string") throw new TypeError($6LuVW.expectedType("filepath", "string", filepath));
2773
- return $8NT9G$path.extname(filepath);
2774
- };
2775
- /**
2776
- * Resolve an absolute path from the given `filepath`.
2777
- *
2778
- * ```handlebars
2779
- * {{resolve "docs/toc.md"}}
2780
- * <!-- results in: '/User/dev/docs/toc.md' -->
2781
- * ```
2782
- * @param {String} `filepath`
2783
- * @return {String}
2784
- * @api public
2785
- */ $c747ca944c6b85c7$var$helpers.resolve = function(filepath) {
2786
- var args = [].slice.call(arguments);
2787
- var opts = $8NT9G$handlebarsutils.options(this, args.pop());
2788
- var cwd = $8NT9G$path.resolve(opts.cwd || $8NT9G$process.cwd());
2789
- args.unshift(cwd);
2790
- return $8NT9G$path.resolve.apply($8NT9G$path, args);
2791
- };
2792
- /**
2793
- * Get specific (joined) segments of a file path by passing a
2794
- * range of array indices.
2795
- *
2796
- * ```handlebars
2797
- * {{segments "a/b/c/d" "2" "3"}}
2798
- * <!-- results in: 'c/d' -->
2799
- *
2800
- * {{segments "a/b/c/d" "1" "3"}}
2801
- * <!-- results in: 'b/c/d' -->
2802
- *
2803
- * {{segments "a/b/c/d" "1" "2"}}
2804
- * <!-- results in: 'b/c' -->
2805
- * ```
2806
- *
2807
- * @param {String} `filepath` The file path to split into segments.
2808
- * @return {String} Returns a single, joined file path.
2809
- * @api public
2810
- */ $c747ca944c6b85c7$var$helpers.segments = function(filepath, a, b) {
2811
- if (typeof filepath !== "string") throw new TypeError($6LuVW.expectedType("filepath", "string", filepath));
2812
- var segments = filepath.split(/[\\\/]+/);
2813
- return segments.slice(a, b).join("/");
2814
- };
2815
-
2816
- });
2817
-
2818
- parcelRequire.register("gj0tB", function(module, exports) {
2819
- "use strict";
2820
-
2821
-
2822
- var $6LuVW = parcelRequire("6LuVW");
2823
- var $bdeeca51fa3a6dad$var$helpers = module.exports;
2824
- /**
2825
- * Convert the given string to a regular expression.
2826
- *
2827
- * ```handlebars
2828
- * {{toRegex "foo"}}
2829
- * <!-- results in: /foo/ -->
2830
- * ```
2831
- * @param {String} `str`
2832
- * @return {RegExp}
2833
- * @api public
2834
- */ $bdeeca51fa3a6dad$var$helpers.toRegex = function(str, locals, options) {
2835
- var opts = $8NT9G$handlebarsutils.options({}, locals, options);
2836
- return new RegExp(str, opts.flags);
2837
- };
2838
- /**
2839
- * Returns true if the given `str` matches the given regex. A regex can
2840
- * be passed on the context, or using the [toRegex](#toregex) helper as a
2841
- * subexpression.
2842
- *
2843
- * ```handlebars
2844
- * {{test "bar" (toRegex "foo")}}
2845
- * <!-- results in: false -->
2846
- * {{test "foobar" (toRegex "foo")}}
2847
- * <!-- results in: true -->
2848
- * {{test "foobar" (toRegex "^foo$")}}
2849
- * <!-- results in: false -->
2850
- * ```
2851
- * @param {String} `str`
2852
- * @return {RegExp}
2853
- * @api public
2854
- */ $bdeeca51fa3a6dad$var$helpers.test = function(str, regex) {
2855
- if (!$8NT9G$handlebarsutils.isString(str)) return false;
2856
- $6LuVW.typeOf(regex);
2857
- return regex.test(str);
2858
- };
2859
-
2860
- });
2861
-
2862
- parcelRequire.register("emnAl", function(module, exports) {
2863
- "use strict";
2864
-
2865
-
2866
-
2867
- var $6LuVW = parcelRequire("6LuVW");
2868
- var $a7456a4c77d6516e$var$helpers = module.exports;
2869
- /**
2870
- * Append the specified `suffix` to the given string.
2871
- *
2872
- * ```handlebars
2873
- * <!-- given that "item.stem" is "foo" -->
2874
- * {{append item.stem ".html"}}
2875
- * <!-- results in: 'foo.html' -->
2876
- * ```
2877
- * @param {String} `str`
2878
- * @param {String} `suffix`
2879
- * @return {String}
2880
- * @api public
2881
- */ $a7456a4c77d6516e$var$helpers.append = function(str, suffix) {
2882
- if (typeof str === "string" && typeof suffix === "string") return str + suffix;
2883
- return str;
2884
- };
2885
- /**
2886
- * camelCase the characters in the given `string`.
2887
- *
2888
- * ```handlebars
2889
- * {{camelcase "foo bar baz"}};
2890
- * <!-- results in: 'fooBarBaz' -->
2891
- * ```
2892
- * @param {String} `string` The string to camelcase.
2893
- * @return {String}
2894
- * @api public
2895
- */ $a7456a4c77d6516e$var$helpers.camelcase = function(str) {
2896
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2897
- return $6LuVW.changecase(str, function(ch) {
2898
- return ch.toUpperCase();
2899
- });
2900
- };
2901
- /**
2902
- * Capitalize the first word in a sentence.
2903
- *
2904
- * ```handlebars
2905
- * {{capitalize "foo bar baz"}}
2906
- * <!-- results in: "Foo bar baz" -->
2907
- * ```
2908
- * @param {String} `str`
2909
- * @return {String}
2910
- * @api public
2911
- */ $a7456a4c77d6516e$var$helpers.capitalize = function(str) {
2912
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2913
- return str.charAt(0).toUpperCase() + str.slice(1);
2914
- };
2915
- /**
2916
- * Capitalize all words in a string.
2917
- *
2918
- * ```handlebars
2919
- * {{capitalizeAll "foo bar baz"}}
2920
- * <!-- results in: "Foo Bar Baz" -->
2921
- * ```
2922
- * @param {String} `str`
2923
- * @return {String}
2924
- * @api public
2925
- */ $a7456a4c77d6516e$var$helpers.capitalizeAll = function(str) {
2926
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2927
- if ($8NT9G$handlebarsutils.isString(str)) return str.replace(/\w\S*/g, function(word) {
2928
- return $a7456a4c77d6516e$var$helpers.capitalize(word);
2929
- });
2930
- };
2931
- /**
2932
- * Center a string using non-breaking spaces
2933
- *
2934
- * @param {String} `str`
2935
- * @param {String} `spaces`
2936
- * @return {String}
2937
- * @api public
2938
- */ $a7456a4c77d6516e$var$helpers.center = function(str, spaces) {
2939
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2940
- var space = "";
2941
- var i = 0;
2942
- while(i < spaces){
2943
- space += "&nbsp;";
2944
- i++;
2945
- }
2946
- return space + str + space;
2947
- };
2948
- /**
2949
- * Like trim, but removes both extraneous whitespace **and
2950
- * non-word characters** from the beginning and end of a string.
2951
- *
2952
- * ```handlebars
2953
- * {{chop "_ABC_"}}
2954
- * <!-- results in: 'ABC' -->
2955
- *
2956
- * {{chop "-ABC-"}}
2957
- * <!-- results in: 'ABC' -->
2958
- *
2959
- * {{chop " ABC "}}
2960
- * <!-- results in: 'ABC' -->
2961
- * ```
2962
- * @param {String} `string` The string to chop.
2963
- * @return {String}
2964
- * @api public
2965
- */ $a7456a4c77d6516e$var$helpers.chop = function(str) {
2966
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2967
- return $6LuVW.chop(str);
2968
- };
2969
- /**
2970
- * dash-case the characters in `string`. Replaces non-word
2971
- * characters and periods with hyphens.
2972
- *
2973
- * ```handlebars
2974
- * {{dashcase "a-b-c d_e"}}
2975
- * <!-- results in: 'a-b-c-d-e' -->
2976
- * ```
2977
- * @param {String} `string`
2978
- * @return {String}
2979
- * @api public
2980
- */ $a7456a4c77d6516e$var$helpers.dashcase = function(str) {
2981
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2982
- return $6LuVW.changecase(str, function(ch) {
2983
- return "-" + ch;
2984
- });
2985
- };
2986
- /**
2987
- * dot.case the characters in `string`.
2988
- *
2989
- * ```handlebars
2990
- * {{dotcase "a-b-c d_e"}}
2991
- * <!-- results in: 'a.b.c.d.e' -->
2992
- * ```
2993
- * @param {String} `string`
2994
- * @return {String}
2995
- * @api public
2996
- */ $a7456a4c77d6516e$var$helpers.dotcase = function(str) {
2997
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
2998
- return $6LuVW.changecase(str, function(ch) {
2999
- return "." + ch;
3000
- });
3001
- };
3002
- /**
3003
- * Lowercase all of the characters in the given string. Alias for [lowercase](#lowercase).
3004
- *
3005
- * ```handlebars
3006
- * {{downcase "aBcDeF"}}
3007
- * <!-- results in: 'abcdef' -->
3008
- * ```
3009
- * @param {String} `string`
3010
- * @return {String}
3011
- * @alias lowercase
3012
- * @api public
3013
- */ $a7456a4c77d6516e$var$helpers.downcase = function() {
3014
- return $a7456a4c77d6516e$var$helpers.lowercase.apply(this, arguments);
3015
- };
3016
- /**
3017
- * Truncates a string to the specified `length`, and appends
3018
- * it with an elipsis, `…`.
3019
- *
3020
- * ```handlebars
3021
- * {{ellipsis (sanitize "<span>foo bar baz</span>"), 7}}
3022
- * <!-- results in: 'foo bar…' -->
3023
- * {{ellipsis "foo bar baz", 7}}
3024
- * <!-- results in: 'foo bar…' -->
3025
- * ```
3026
- * @param {String} `str`
3027
- * @param {Number} `length` The desired length of the returned string.
3028
- * @return {String} The truncated string.
3029
- * @api public
3030
- */ $a7456a4c77d6516e$var$helpers.ellipsis = function(str, limit) {
3031
- if ($8NT9G$handlebarsutils.isString(str)) {
3032
- if (str.length <= limit) return str;
3033
- return $a7456a4c77d6516e$var$helpers.truncate(str, limit) + "…";
3034
- }
3035
- };
3036
- /**
3037
- * Replace spaces in a string with hyphens.
3038
- *
3039
- * ```handlebars
3040
- * {{hyphenate "foo bar baz qux"}}
3041
- * <!-- results in: "foo-bar-baz-qux" -->
3042
- * ```
3043
- * @param {String} `str`
3044
- * @return {String}
3045
- * @api public
3046
- */ $a7456a4c77d6516e$var$helpers.hyphenate = function(str) {
3047
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3048
- return str.split(" ").join("-");
3049
- };
3050
- /**
3051
- * Return true if `value` is a string.
3052
- *
3053
- * ```handlebars
3054
- * {{isString "foo"}}
3055
- * <!-- results in: 'true' -->
3056
- * ```
3057
- * @param {String} `value`
3058
- * @return {Boolean}
3059
- * @api public
3060
- */ $a7456a4c77d6516e$var$helpers.isString = function(value) {
3061
- return typeof value === "string";
3062
- };
3063
- /**
3064
- * Lowercase all characters in the given string.
3065
- *
3066
- * ```handlebars
3067
- * {{lowercase "Foo BAR baZ"}}
3068
- * <!-- results in: 'foo bar baz' -->
3069
- * ```
3070
- * @param {String} `str`
3071
- * @return {String}
3072
- * @api public
3073
- */ $a7456a4c77d6516e$var$helpers.lowercase = function(str) {
3074
- if ($8NT9G$handlebarsutils.isObject(str) && str.fn) return str.fn(this).toLowerCase();
3075
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3076
- return str.toLowerCase();
3077
- };
3078
- /**
3079
- * Return the number of occurrences of `substring` within the
3080
- * given `string`.
3081
- *
3082
- * ```handlebars
3083
- * {{occurrences "foo bar foo bar baz" "foo"}}
3084
- * <!-- results in: 2 -->
3085
- * ```
3086
- * @param {String} `str`
3087
- * @param {String} `substring`
3088
- * @return {Number} Number of occurrences
3089
- * @api public
3090
- */ $a7456a4c77d6516e$var$helpers.occurrences = function(str, substring) {
3091
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3092
- var len = substring.length;
3093
- var pos = 0;
3094
- var n = 0;
3095
- while((pos = str.indexOf(substring, pos)) > -1){
3096
- n++;
3097
- pos += len;
3098
- }
3099
- return n;
3100
- };
3101
- /**
3102
- * PascalCase the characters in `string`.
3103
- *
3104
- * ```handlebars
3105
- * {{pascalcase "foo bar baz"}}
3106
- * <!-- results in: 'FooBarBaz' -->
3107
- * ```
3108
- * @param {String} `string`
3109
- * @return {String}
3110
- * @api public
3111
- */ $a7456a4c77d6516e$var$helpers.pascalcase = function(str) {
3112
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3113
- str = $6LuVW.changecase(str, function(ch) {
3114
- return ch.toUpperCase();
3115
- });
3116
- return str.charAt(0).toUpperCase() + str.slice(1);
3117
- };
3118
- /**
3119
- * path/case the characters in `string`.
3120
- *
3121
- * ```handlebars
3122
- * {{pathcase "a-b-c d_e"}}
3123
- * <!-- results in: 'a/b/c/d/e' -->
3124
- * ```
3125
- * @param {String} `string`
3126
- * @return {String}
3127
- * @api public
3128
- */ $a7456a4c77d6516e$var$helpers.pathcase = function(str) {
3129
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3130
- return $6LuVW.changecase(str, function(ch) {
3131
- return "/" + ch;
3132
- });
3133
- };
3134
- /**
3135
- * Replace spaces in the given string with pluses.
3136
- *
3137
- * ```handlebars
3138
- * {{plusify "foo bar baz"}}
3139
- * <!-- results in: 'foo+bar+baz' -->
3140
- * ```
3141
- * @param {String} `str` The input string
3142
- * @return {String} Input string with spaces replaced by plus signs
3143
- * @source Stephen Way <https://github.com/stephenway>
3144
- * @api public
3145
- */ $a7456a4c77d6516e$var$helpers.plusify = function(str, ch) {
3146
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3147
- if (!$8NT9G$handlebarsutils.isString(ch)) ch = " ";
3148
- return str.split(ch).join("+");
3149
- };
3150
- /**
3151
- * Prepends the given `string` with the specified `prefix`.
3152
- *
3153
- * ```handlebars
3154
- * <!-- given that "val" is "bar" -->
3155
- * {{prepend val "foo-"}}
3156
- * <!-- results in: 'foo-bar' -->
3157
- * ```
3158
- * @param {String} `str`
3159
- * @param {String} `prefix`
3160
- * @return {String}
3161
- * @api public
3162
- */ $a7456a4c77d6516e$var$helpers.prepend = function(str, prefix) {
3163
- return typeof str === "string" && typeof prefix === "string" ? prefix + str : str;
3164
- };
3165
- /**
3166
- * Render a block without processing mustache templates inside the block.
3167
- *
3168
- * ```handlebars
3169
- * {{{{#raw}}}}
3170
- * {{foo}}
3171
- * {{{{/raw}}}}
3172
- * <!-- results in: '{{foo}}' -->
3173
- * ```
3174
- *
3175
- * @param {Object} `options`
3176
- * @return {String}
3177
- * @block
3178
- * @api public
3179
- */ $a7456a4c77d6516e$var$helpers.raw = function(options) {
3180
- var str = options.fn();
3181
- var opts = $8NT9G$handlebarsutils.options(this, options);
3182
- if (opts.escape !== false) {
3183
- var idx = 0;
3184
- while((idx = str.indexOf("{{", idx)) !== -1){
3185
- if (str[idx - 1] !== "\\") str = str.slice(0, idx) + "\\" + str.slice(idx);
3186
- idx += 3;
3187
- }
3188
- }
3189
- return str;
3190
- };
3191
- /**
3192
- * Remove all occurrences of `substring` from the given `str`.
3193
- *
3194
- * ```handlebars
3195
- * {{remove "a b a b a b" "a "}}
3196
- * <!-- results in: 'b b b' -->
3197
- * ```
3198
- * @param {String} `str`
3199
- * @param {String} `substring`
3200
- * @return {String}
3201
- * @api public
3202
- */ $a7456a4c77d6516e$var$helpers.remove = function(str, ch) {
3203
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3204
- if (!$8NT9G$handlebarsutils.isString(ch)) return str;
3205
- return str.split(ch).join("");
3206
- };
3207
- /**
3208
- * Remove the first occurrence of `substring` from the given `str`.
3209
- *
3210
- * ```handlebars
3211
- * {{remove "a b a b a b" "a"}}
3212
- * <!-- results in: ' b a b a b' -->
3213
- * ```
3214
- * @param {String} `str`
3215
- * @param {String} `substring`
3216
- * @return {String}
3217
- * @api public
3218
- */ $a7456a4c77d6516e$var$helpers.removeFirst = function(str, ch) {
3219
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3220
- if (!$8NT9G$handlebarsutils.isString(ch)) return str;
3221
- return str.replace(ch, "");
3222
- };
3223
- /**
3224
- * Replace all occurrences of substring `a` with substring `b`.
3225
- *
3226
- * ```handlebars
3227
- * {{replace "a b a b a b" "a" "z"}}
3228
- * <!-- results in: 'z b z b z b' -->
3229
- * ```
3230
- * @param {String} `str`
3231
- * @param {String} `a`
3232
- * @param {String} `b`
3233
- * @return {String}
3234
- * @api public
3235
- */ $a7456a4c77d6516e$var$helpers.replace = function(str, a, b) {
3236
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3237
- if (!$8NT9G$handlebarsutils.isString(a)) return str;
3238
- if (!$8NT9G$handlebarsutils.isString(b)) b = "";
3239
- return str.split(a).join(b);
3240
- };
3241
- /**
3242
- * Replace the first occurrence of substring `a` with substring `b`.
3243
- *
3244
- * ```handlebars
3245
- * {{replace "a b a b a b" "a" "z"}}
3246
- * <!-- results in: 'z b a b a b' -->
3247
- * ```
3248
- * @param {String} `str`
3249
- * @param {String} `a`
3250
- * @param {String} `b`
3251
- * @return {String}
3252
- * @api public
3253
- */ $a7456a4c77d6516e$var$helpers.replaceFirst = function(str, a, b) {
3254
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3255
- if (!$8NT9G$handlebarsutils.isString(a)) return str;
3256
- if (!$8NT9G$handlebarsutils.isString(b)) b = "";
3257
- return str.replace(a, b);
3258
- };
3259
- /**
3260
- * Reverse a string.
3261
- *
3262
- * ```handlebars
3263
- * {{reverse "abcde"}}
3264
- * <!-- results in: 'edcba' -->
3265
- * ```
3266
- * @param {String} `str`
3267
- * @return {String}
3268
- * @api public
3269
- */ $a7456a4c77d6516e$var$helpers.reverse = function(str) {
3270
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3271
- return str.split("").reverse().join("");
3272
- };
3273
- /**
3274
- * Sentence case the given string
3275
- *
3276
- * ```handlebars
3277
- * {{sentence "hello world. goodbye world."}}
3278
- * <!-- results in: 'Hello world. Goodbye world.' -->
3279
- * ```
3280
- * @param {String} `str`
3281
- * @return {String}
3282
- * @api public
3283
- */ $a7456a4c77d6516e$var$helpers.sentence = function(str) {
3284
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3285
- return str.replace(/((?:\S[^\.\?\!]*)[\.\?\!]*)/g, function(txt) {
3286
- return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
3287
- });
3288
- };
3289
- /**
3290
- * snake_case the characters in the given `string`.
3291
- *
3292
- * ```handlebars
3293
- * {{snakecase "a-b-c d_e"}}
3294
- * <!-- results in: 'a_b_c_d_e' -->
3295
- * ```
3296
- * @param {String} `string`
3297
- * @return {String}
3298
- * @api public
3299
- */ $a7456a4c77d6516e$var$helpers.snakecase = function(str) {
3300
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3301
- return $6LuVW.changecase(str, function(ch) {
3302
- return "_" + ch;
3303
- });
3304
- };
3305
- /**
3306
- * Split `string` by the given `character`.
3307
- *
3308
- * ```handlebars
3309
- * {{split "a,b,c" ","}}
3310
- * <!-- results in: ['a', 'b', 'c'] -->
3311
- * ```
3312
- * @param {String} `string` The string to split.
3313
- * @return {String} `character` Default is an empty string.
3314
- * @api public
3315
- */ $a7456a4c77d6516e$var$helpers.split = function(str, ch) {
3316
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3317
- if (!$8NT9G$handlebarsutils.isString(ch)) ch = ",";
3318
- return str.split(ch);
3319
- };
3320
- /**
3321
- * Tests whether a string begins with the given prefix.
3322
- *
3323
- * ```handlebars
3324
- * {{#startsWith "Goodbye" "Hello, world!"}}
3325
- * Whoops
3326
- * {{else}}
3327
- * Bro, do you even hello world?
3328
- * {{/startsWith}}
3329
- * ```
3330
- * @contributor Dan Fox <http://github.com/iamdanfox>
3331
- * @param {String} `prefix`
3332
- * @param {String} `testString`
3333
- * @param {String} `options`
3334
- * @return {String}
3335
- * @block
3336
- * @api public
3337
- */ $a7456a4c77d6516e$var$helpers.startsWith = function(prefix, str, options) {
3338
- var args = [].slice.call(arguments);
3339
- options = args.pop();
3340
- if ($8NT9G$handlebarsutils.isString(str) && str.indexOf(prefix) === 0) return options.fn(this);
3341
- if (typeof options.inverse === "function") return options.inverse(this);
3342
- return "";
3343
- };
3344
- /**
3345
- * Title case the given string.
3346
- *
3347
- * ```handlebars
3348
- * {{titleize "this is title case"}}
3349
- * <!-- results in: 'This Is Title Case' -->
3350
- * ```
3351
- * @param {String} `str`
3352
- * @return {String}
3353
- * @api public
3354
- */ $a7456a4c77d6516e$var$helpers.titleize = function(str) {
3355
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3356
- var title = str.replace(/[- _]+/g, " ");
3357
- var words = title.split(" ");
3358
- var len = words.length;
3359
- var res = [];
3360
- var i = 0;
3361
- while(len--){
3362
- var word = words[i++];
3363
- res.push(module.exports.capitalize(word));
3364
- }
3365
- return res.join(" ");
3366
- };
3367
- /**
3368
- * Removes extraneous whitespace from the beginning and end
3369
- * of a string.
3370
- *
3371
- * ```handlebars
3372
- * {{trim " ABC "}}
3373
- * <!-- results in: 'ABC' -->
3374
- * ```
3375
- * @param {String} `string` The string to trim.
3376
- * @return {String}
3377
- * @api public
3378
- */ $a7456a4c77d6516e$var$helpers.trim = function(str) {
3379
- return typeof str === "string" ? str.trim() : "";
3380
- };
3381
- /**
3382
- * Removes extraneous whitespace from the beginning of a string.
3383
- *
3384
- * ```handlebars
3385
- * {{trim " ABC "}}
3386
- * <!-- results in: 'ABC ' -->
3387
- * ```
3388
- * @param {String} `string` The string to trim.
3389
- * @return {String}
3390
- * @api public
3391
- */ $a7456a4c77d6516e$var$helpers.trimLeft = function(str) {
3392
- if ($8NT9G$handlebarsutils.isString(str)) return str.replace(/^\s+/, "");
3393
- };
3394
- /**
3395
- * Removes extraneous whitespace from the end of a string.
3396
- *
3397
- * ```handlebars
3398
- * {{trimRight " ABC "}}
3399
- * <!-- results in: ' ABC' -->
3400
- * ```
3401
- * @param {String} `string` The string to trim.
3402
- * @return {String}
3403
- * @api public
3404
- */ $a7456a4c77d6516e$var$helpers.trimRight = function(str) {
3405
- if ($8NT9G$handlebarsutils.isString(str)) return str.replace(/\s+$/, "");
3406
- };
3407
- /**
3408
- * Truncate a string to the specified `length`. Also see [ellipsis](#ellipsis).
3409
- *
3410
- * ```handlebars
3411
- * truncate("foo bar baz", 7);
3412
- * <!-- results in: 'foo bar' -->
3413
- * truncate(sanitize("<span>foo bar baz</span>", 7));
3414
- * <!-- results in: 'foo bar' -->
3415
- * ```
3416
- * @param {String} `str`
3417
- * @param {Number} `limit` The desired length of the returned string.
3418
- * @param {String} `suffix` Optionally supply a string to use as a suffix to
3419
- * denote when the string has been truncated. Otherwise an ellipsis (`…`) will be used.
3420
- * @return {String} The truncated string.
3421
- * @api public
3422
- */ $a7456a4c77d6516e$var$helpers.truncate = function(str, limit, suffix) {
3423
- if ($8NT9G$handlebarsutils.isString(str)) {
3424
- if (typeof suffix !== "string") suffix = "";
3425
- if (str.length > limit) return str.slice(0, limit - suffix.length) + suffix;
3426
- return str;
3427
- }
3428
- };
3429
- /**
3430
- * Truncate a string to have the specified number of words.
3431
- * Also see [truncate](#truncate).
3432
- *
3433
- * ```handlebars
3434
- * truncateWords("foo bar baz", 1);
3435
- * <!-- results in: 'foo…' -->
3436
- * truncateWords("foo bar baz", 2);
3437
- * <!-- results in: 'foo bar…' -->
3438
- * truncateWords("foo bar baz", 3);
3439
- * <!-- results in: 'foo bar baz' -->
3440
- * ```
3441
- * @param {String} `str`
3442
- * @param {Number} `limit` The desired length of the returned string.
3443
- * @param {String} `suffix` Optionally supply a string to use as a suffix to
3444
- * denote when the string has been truncated.
3445
- * @return {String} The truncated string.
3446
- * @api public
3447
- */ $a7456a4c77d6516e$var$helpers.truncateWords = function(str, count, suffix) {
3448
- if ($8NT9G$handlebarsutils.isString(str) && $8NT9G$isnumber(count)) {
3449
- if (typeof suffix !== "string") suffix = "…";
3450
- var num = Number(count);
3451
- var arr = str.split(/[ \t]/);
3452
- if (num > arr.length) arr = arr.slice(0, num);
3453
- var val = arr.join(" ").trim();
3454
- return val + suffix;
3455
- }
3456
- };
3457
- /**
3458
- * Uppercase all of the characters in the given string. Alias for [uppercase](#uppercase).
3459
- *
3460
- * ```handlebars
3461
- * {{upcase "aBcDeF"}}
3462
- * <!-- results in: 'ABCDEF' -->
3463
- * ```
3464
- * @param {String} `string`
3465
- * @return {String}
3466
- * @alias uppercase
3467
- * @api public
3468
- */ $a7456a4c77d6516e$var$helpers.upcase = function() {
3469
- return $a7456a4c77d6516e$var$helpers.uppercase.apply(this, arguments);
3470
- };
3471
- /**
3472
- * Uppercase all of the characters in the given string. If used as a
3473
- * block helper it will uppercase the entire block. This helper
3474
- * does not support inverse blocks.
3475
- *
3476
- * ```handlebars
3477
- * {{uppercase "aBcDeF"}}
3478
- * <!-- results in: 'ABCDEF' -->
3479
- * ```
3480
- * @related capitalize capitalizeAll
3481
- * @param {String} `str` The string to uppercase
3482
- * @param {Object} `options` Handlebars options object
3483
- * @return {String}
3484
- * @block
3485
- * @api public
3486
- */ $a7456a4c77d6516e$var$helpers.uppercase = function(str) {
3487
- if ($8NT9G$handlebarsutils.isObject(str) && str.fn) return str.fn(this).toUpperCase();
3488
- if (!$8NT9G$handlebarsutils.isString(str)) return "";
3489
- return str.toUpperCase();
3490
- };
3491
-
3492
- });
3493
-
3494
- parcelRequire.register("kgeTN", function(module, exports) {
3495
- "use strict";
3496
-
3497
-
3498
-
3499
- var $ec00dbe583aba483$var$helpers = module.exports;
3500
- /**
3501
- * Encodes a Uniform Resource Identifier (URI) component
3502
- * by replacing each instance of certain characters by
3503
- * one, two, three, or four escape sequences representing
3504
- * the UTF-8 encoding of the character.
3505
- *
3506
- * @param {String} `str` The un-encoded string
3507
- * @return {String} The endcoded string
3508
- * @api public
3509
- */ $ec00dbe583aba483$var$helpers.encodeURI = function(str) {
3510
- if ($8NT9G$handlebarsutils.isString(str)) return encodeURIComponent(str);
3511
- };
3512
- /**
3513
- * Escape the given string by replacing characters with escape sequences.
3514
- * Useful for allowing the string to be used in a URL, etc.
3515
- *
3516
- * @param {String} `str`
3517
- * @return {String} Escaped string.
3518
- * @api public
3519
- */ $ec00dbe583aba483$var$helpers.escape = function(str) {
3520
- if ($8NT9G$handlebarsutils.isString(str)) return $8NT9G$querystring.escape(str);
3521
- };
3522
- /**
3523
- * Decode a Uniform Resource Identifier (URI) component.
3524
- *
3525
- * @param {String} `str`
3526
- * @return {String}
3527
- * @api public
3528
- */ $ec00dbe583aba483$var$helpers.decodeURI = function(str) {
3529
- if ($8NT9G$handlebarsutils.isString(str)) return decodeURIComponent(str);
3530
- };
3531
- /**
3532
- * Alias for [encodeURI](#encodeuri).
3533
- * @api public
3534
- */ $ec00dbe583aba483$var$helpers.url_encode = function() {
3535
- return $ec00dbe583aba483$var$helpers.encodeURI.apply(this, arguments);
3536
- };
3537
- /**
3538
- * Alias for [decodeURI](#decodeuri).
3539
- * @api public
3540
- */ $ec00dbe583aba483$var$helpers.url_decode = function(val) {
3541
- return $ec00dbe583aba483$var$helpers.decodeURI.apply(this, arguments);
3542
- };
3543
- /**
3544
- * Take a base URL, and a href URL, and resolve them as a
3545
- * browser would for an anchor tag.
3546
- *
3547
- * @param {String} `base`
3548
- * @param {String} `href`
3549
- * @return {String}
3550
- * @api public
3551
- */ $ec00dbe583aba483$var$helpers.urlResolve = function(base, href) {
3552
- return $8NT9G$url.resolve(base, href);
3553
- };
3554
- /**
3555
- * Parses a `url` string into an object.
3556
- *
3557
- * @param {String} `str` URL string
3558
- * @return {String} Returns stringified JSON
3559
- * @api public
3560
- */ $ec00dbe583aba483$var$helpers.urlParse = function(str) {
3561
- return $8NT9G$url.parse(str);
3562
- };
3563
- /**
3564
- * Strip the query string from the given `url`.
3565
- *
3566
- * @param {String} `url`
3567
- * @return {String} the url without the queryString
3568
- * @api public
3569
- */ $ec00dbe583aba483$var$helpers.stripQuerystring = function(str) {
3570
- if ($8NT9G$handlebarsutils.isString(str)) return str.split("?")[0];
3571
- };
3572
- /**
3573
- * Strip protocol from a `url`. Useful for displaying media that
3574
- * may have an 'http' protocol on secure connections.
3575
- *
3576
- * ```handlebars
3577
- * <!-- url = 'http://foo.bar' -->
3578
- * {{stripProtocol url}}
3579
- * <!-- results in: '//foo.bar' -->
3580
- * ```
3581
- * @param {String} `str`
3582
- * @return {String} the url with http protocol stripped
3583
- * @api public
3584
- */ $ec00dbe583aba483$var$helpers.stripProtocol = function(str) {
3585
- if ($8NT9G$handlebarsutils.isString(str)) {
3586
- var parsed = $8NT9G$url.parse(str);
3587
- parsed.protocol = "";
3588
- return parsed.format();
3589
- }
3590
- };
3591
-
3592
- });
3593
-
3594
-
3595
- var $4de426ed509ccb66$exports = {};
3596
- /*!
3597
- * handlebars-helpers <https://github.com/helpers/handlebars-helpers>
3598
- *
3599
- * Copyright (c) 2013-2017, Jon Schlinkert, Brian Woodward.
3600
- * Released under the MIT License.
3601
- */ "use strict";
3602
-
3603
-
3604
- var $bdc6a54aba68341e$exports = {};
3605
- "use strict";
3606
-
3607
-
3608
-
3609
-
3610
-
3611
-
3612
-
3613
-
3614
-
3615
-
3616
-
3617
-
3618
-
3619
-
3620
-
3621
-
3622
-
3623
-
3624
-
3625
-
3626
- $bdc6a54aba68341e$exports = {
3627
- array: (parcelRequire("3R4ea")),
3628
- code: (parcelRequire("dhYI6")),
3629
- collection: (parcelRequire("2oMW4")),
3630
- comparison: (parcelRequire("dOcEg")),
3631
- date: (parcelRequire("04qnQ")),
3632
- fs: (parcelRequire("f5TF7")),
3633
- html: (parcelRequire("32RMd")),
3634
- i18n: (parcelRequire("bALdb")),
3635
- inflection: (parcelRequire("jZuol")),
3636
- logging: (parcelRequire("l63ao")),
3637
- markdown: (parcelRequire("157n4")),
3638
- match: (parcelRequire("7tOGz")),
3639
- math: (parcelRequire("diHL6")),
3640
- misc: (parcelRequire("2fV8Q")),
3641
- number: (parcelRequire("7ijcX")),
3642
- object: (parcelRequire("icPqk")),
3643
- path: (parcelRequire("h6LqX")),
3644
- regex: (parcelRequire("gj0tB")),
3645
- string: (parcelRequire("emnAl")),
3646
- url: (parcelRequire("kgeTN"))
3647
- };
3648
-
3649
-
3650
-
3651
- /**
3652
- * Expose helpers
3653
- */ $4de426ed509ccb66$exports = function helpers(groups, options) {
3654
- if (typeof groups === "string") groups = [
3655
- groups
3656
- ];
3657
- else if (!Array.isArray(groups)) {
3658
- options = groups;
3659
- groups = null;
3660
- }
3661
- options = options || {};
3662
- var hbs = options.handlebars || options.hbs || $8NT9G$handlebars;
3663
- $8NT9G$defineproperty($4de426ed509ccb66$exports, "handlebars", hbs);
3664
- if (groups) groups.forEach(function(key) {
3665
- hbs.registerHelper($bdc6a54aba68341e$exports[key]);
3666
- });
3667
- else $8NT9G$forin($bdc6a54aba68341e$exports, function(group, key) {
3668
- hbs.registerHelper(group);
3669
- });
3670
- return hbs.helpers;
3671
- };
3672
-
3673
- /**
3674
- * Expose helper groups
3675
- */ $8NT9G$forin($bdc6a54aba68341e$exports, function(group, key) {
3676
- $8NT9G$defineproperty($4de426ed509ccb66$exports, key, function(options) {
3677
- options = options || {};
3678
- var hbs = options.handlebars || options.hbs || $8NT9G$handlebars;
3679
- $8NT9G$defineproperty($4de426ed509ccb66$exports, "handlebars", hbs);
3680
- hbs.registerHelper(group);
3681
- return hbs.helpers;
3682
- });
3683
- });
3684
-
3685
- /**
3686
- * Expose `utils`
3687
- */ $4de426ed509ccb66$exports.utils = (parcelRequire("6LuVW"));
3688
-
3689
-
3690
- const $a1cc8df1e709125c$var$handlebars = $8NT9G$handlebars.create();
3691
- $4de426ed509ccb66$exports({
3692
- handlebars: $a1cc8df1e709125c$var$handlebars
3693
- });
3694
- module.exports = $a1cc8df1e709125c$var$handlebars;
3695
-
3696
-
3697
- //# sourceMappingURL=fumanchu.min.js.map