@kosatyi/ejs 0.0.76 → 0.0.78

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.
@@ -0,0 +1,1284 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ejs = {}));
5
+ })(this, (function (exports) { 'use strict';
6
+
7
+ function _regeneratorRuntime() {
8
+ _regeneratorRuntime = function () {
9
+ return e;
10
+ };
11
+ var t,
12
+ e = {},
13
+ r = Object.prototype,
14
+ n = r.hasOwnProperty,
15
+ o = Object.defineProperty || function (t, e, r) {
16
+ t[e] = r.value;
17
+ },
18
+ i = "function" == typeof Symbol ? Symbol : {},
19
+ a = i.iterator || "@@iterator",
20
+ c = i.asyncIterator || "@@asyncIterator",
21
+ u = i.toStringTag || "@@toStringTag";
22
+ function define(t, e, r) {
23
+ return Object.defineProperty(t, e, {
24
+ value: r,
25
+ enumerable: !0,
26
+ configurable: !0,
27
+ writable: !0
28
+ }), t[e];
29
+ }
30
+ try {
31
+ define({}, "");
32
+ } catch (t) {
33
+ define = function (t, e, r) {
34
+ return t[e] = r;
35
+ };
36
+ }
37
+ function wrap(t, e, r, n) {
38
+ var i = e && e.prototype instanceof Generator ? e : Generator,
39
+ a = Object.create(i.prototype),
40
+ c = new Context(n || []);
41
+ return o(a, "_invoke", {
42
+ value: makeInvokeMethod(t, r, c)
43
+ }), a;
44
+ }
45
+ function tryCatch(t, e, r) {
46
+ try {
47
+ return {
48
+ type: "normal",
49
+ arg: t.call(e, r)
50
+ };
51
+ } catch (t) {
52
+ return {
53
+ type: "throw",
54
+ arg: t
55
+ };
56
+ }
57
+ }
58
+ e.wrap = wrap;
59
+ var h = "suspendedStart",
60
+ l = "suspendedYield",
61
+ f = "executing",
62
+ s = "completed",
63
+ y = {};
64
+ function Generator() {}
65
+ function GeneratorFunction() {}
66
+ function GeneratorFunctionPrototype() {}
67
+ var p = {};
68
+ define(p, a, function () {
69
+ return this;
70
+ });
71
+ var d = Object.getPrototypeOf,
72
+ v = d && d(d(values([])));
73
+ v && v !== r && n.call(v, a) && (p = v);
74
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
75
+ function defineIteratorMethods(t) {
76
+ ["next", "throw", "return"].forEach(function (e) {
77
+ define(t, e, function (t) {
78
+ return this._invoke(e, t);
79
+ });
80
+ });
81
+ }
82
+ function AsyncIterator(t, e) {
83
+ function invoke(r, o, i, a) {
84
+ var c = tryCatch(t[r], t, o);
85
+ if ("throw" !== c.type) {
86
+ var u = c.arg,
87
+ h = u.value;
88
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
89
+ invoke("next", t, i, a);
90
+ }, function (t) {
91
+ invoke("throw", t, i, a);
92
+ }) : e.resolve(h).then(function (t) {
93
+ u.value = t, i(u);
94
+ }, function (t) {
95
+ return invoke("throw", t, i, a);
96
+ });
97
+ }
98
+ a(c.arg);
99
+ }
100
+ var r;
101
+ o(this, "_invoke", {
102
+ value: function (t, n) {
103
+ function callInvokeWithMethodAndArg() {
104
+ return new e(function (e, r) {
105
+ invoke(t, n, e, r);
106
+ });
107
+ }
108
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
109
+ }
110
+ });
111
+ }
112
+ function makeInvokeMethod(e, r, n) {
113
+ var o = h;
114
+ return function (i, a) {
115
+ if (o === f) throw new Error("Generator is already running");
116
+ if (o === s) {
117
+ if ("throw" === i) throw a;
118
+ return {
119
+ value: t,
120
+ done: !0
121
+ };
122
+ }
123
+ for (n.method = i, n.arg = a;;) {
124
+ var c = n.delegate;
125
+ if (c) {
126
+ var u = maybeInvokeDelegate(c, n);
127
+ if (u) {
128
+ if (u === y) continue;
129
+ return u;
130
+ }
131
+ }
132
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
133
+ if (o === h) throw o = s, n.arg;
134
+ n.dispatchException(n.arg);
135
+ } else "return" === n.method && n.abrupt("return", n.arg);
136
+ o = f;
137
+ var p = tryCatch(e, r, n);
138
+ if ("normal" === p.type) {
139
+ if (o = n.done ? s : l, p.arg === y) continue;
140
+ return {
141
+ value: p.arg,
142
+ done: n.done
143
+ };
144
+ }
145
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
146
+ }
147
+ };
148
+ }
149
+ function maybeInvokeDelegate(e, r) {
150
+ var n = r.method,
151
+ o = e.iterator[n];
152
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
153
+ var i = tryCatch(o, e.iterator, r.arg);
154
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
155
+ var a = i.arg;
156
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
157
+ }
158
+ function pushTryEntry(t) {
159
+ var e = {
160
+ tryLoc: t[0]
161
+ };
162
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
163
+ }
164
+ function resetTryEntry(t) {
165
+ var e = t.completion || {};
166
+ e.type = "normal", delete e.arg, t.completion = e;
167
+ }
168
+ function Context(t) {
169
+ this.tryEntries = [{
170
+ tryLoc: "root"
171
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
172
+ }
173
+ function values(e) {
174
+ if (e || "" === e) {
175
+ var r = e[a];
176
+ if (r) return r.call(e);
177
+ if ("function" == typeof e.next) return e;
178
+ if (!isNaN(e.length)) {
179
+ var o = -1,
180
+ i = function next() {
181
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
182
+ return next.value = t, next.done = !0, next;
183
+ };
184
+ return i.next = i;
185
+ }
186
+ }
187
+ throw new TypeError(typeof e + " is not iterable");
188
+ }
189
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
190
+ value: GeneratorFunctionPrototype,
191
+ configurable: !0
192
+ }), o(GeneratorFunctionPrototype, "constructor", {
193
+ value: GeneratorFunction,
194
+ configurable: !0
195
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
196
+ var e = "function" == typeof t && t.constructor;
197
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
198
+ }, e.mark = function (t) {
199
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
200
+ }, e.awrap = function (t) {
201
+ return {
202
+ __await: t
203
+ };
204
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
205
+ return this;
206
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
207
+ void 0 === i && (i = Promise);
208
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
209
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
210
+ return t.done ? t.value : a.next();
211
+ });
212
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
213
+ return this;
214
+ }), define(g, "toString", function () {
215
+ return "[object Generator]";
216
+ }), e.keys = function (t) {
217
+ var e = Object(t),
218
+ r = [];
219
+ for (var n in e) r.push(n);
220
+ return r.reverse(), function next() {
221
+ for (; r.length;) {
222
+ var t = r.pop();
223
+ if (t in e) return next.value = t, next.done = !1, next;
224
+ }
225
+ return next.done = !0, next;
226
+ };
227
+ }, e.values = values, Context.prototype = {
228
+ constructor: Context,
229
+ reset: function (e) {
230
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
231
+ },
232
+ stop: function () {
233
+ this.done = !0;
234
+ var t = this.tryEntries[0].completion;
235
+ if ("throw" === t.type) throw t.arg;
236
+ return this.rval;
237
+ },
238
+ dispatchException: function (e) {
239
+ if (this.done) throw e;
240
+ var r = this;
241
+ function handle(n, o) {
242
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
243
+ }
244
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
245
+ var i = this.tryEntries[o],
246
+ a = i.completion;
247
+ if ("root" === i.tryLoc) return handle("end");
248
+ if (i.tryLoc <= this.prev) {
249
+ var c = n.call(i, "catchLoc"),
250
+ u = n.call(i, "finallyLoc");
251
+ if (c && u) {
252
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
253
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
254
+ } else if (c) {
255
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
256
+ } else {
257
+ if (!u) throw new Error("try statement without catch or finally");
258
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
259
+ }
260
+ }
261
+ }
262
+ },
263
+ abrupt: function (t, e) {
264
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
265
+ var o = this.tryEntries[r];
266
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
267
+ var i = o;
268
+ break;
269
+ }
270
+ }
271
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
272
+ var a = i ? i.completion : {};
273
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
274
+ },
275
+ complete: function (t, e) {
276
+ if ("throw" === t.type) throw t.arg;
277
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
278
+ },
279
+ finish: function (t) {
280
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
281
+ var r = this.tryEntries[e];
282
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
283
+ }
284
+ },
285
+ catch: function (t) {
286
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
287
+ var r = this.tryEntries[e];
288
+ if (r.tryLoc === t) {
289
+ var n = r.completion;
290
+ if ("throw" === n.type) {
291
+ var o = n.arg;
292
+ resetTryEntry(r);
293
+ }
294
+ return o;
295
+ }
296
+ }
297
+ throw new Error("illegal catch attempt");
298
+ },
299
+ delegateYield: function (e, r, n) {
300
+ return this.delegate = {
301
+ iterator: values(e),
302
+ resultName: r,
303
+ nextLoc: n
304
+ }, "next" === this.method && (this.arg = t), y;
305
+ }
306
+ }, e;
307
+ }
308
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
309
+ try {
310
+ var info = gen[key](arg);
311
+ var value = info.value;
312
+ } catch (error) {
313
+ reject(error);
314
+ return;
315
+ }
316
+ if (info.done) {
317
+ resolve(value);
318
+ } else {
319
+ Promise.resolve(value).then(_next, _throw);
320
+ }
321
+ }
322
+ function _asyncToGenerator(fn) {
323
+ return function () {
324
+ var self = this,
325
+ args = arguments;
326
+ return new Promise(function (resolve, reject) {
327
+ var gen = fn.apply(self, args);
328
+ function _next(value) {
329
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
330
+ }
331
+ function _throw(err) {
332
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
333
+ }
334
+ _next(undefined);
335
+ });
336
+ };
337
+ }
338
+ function _defineProperty(obj, key, value) {
339
+ key = _toPropertyKey(key);
340
+ if (key in obj) {
341
+ Object.defineProperty(obj, key, {
342
+ value: value,
343
+ enumerable: true,
344
+ configurable: true,
345
+ writable: true
346
+ });
347
+ } else {
348
+ obj[key] = value;
349
+ }
350
+ return obj;
351
+ }
352
+ function _toPrimitive(input, hint) {
353
+ if (typeof input !== "object" || input === null) return input;
354
+ var prim = input[Symbol.toPrimitive];
355
+ if (prim !== undefined) {
356
+ var res = prim.call(input, hint || "default");
357
+ if (typeof res !== "object") return res;
358
+ throw new TypeError("@@toPrimitive must return a primitive value.");
359
+ }
360
+ return (hint === "string" ? String : Number)(input);
361
+ }
362
+ function _toPropertyKey(arg) {
363
+ var key = _toPrimitive(arg, "string");
364
+ return typeof key === "symbol" ? key : String(key);
365
+ }
366
+
367
+ var typeProp = function typeProp() {
368
+ var args = [].slice.call(arguments);
369
+ var callback = args.shift();
370
+ return args.filter(callback).pop();
371
+ };
372
+ var isArray = function isArray(v) {
373
+ return Array.isArray(v);
374
+ };
375
+ var isFunction = function isFunction(v) {
376
+ return typeof v === 'function';
377
+ };
378
+ var isString = function isString(v) {
379
+ return typeof v === 'string';
380
+ };
381
+ var isBoolean = function isBoolean(v) {
382
+ return typeof v === 'boolean';
383
+ };
384
+ var isUndefined = function isUndefined(v) {
385
+ return typeof v === 'undefined';
386
+ };
387
+
388
+ var isNodeEnv = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]';
389
+ var isNode = function isNode() {
390
+ return isNodeEnv;
391
+ };
392
+ var symbolEntities = {
393
+ "'": "'",
394
+ '\\': '\\',
395
+ '\r': 'r',
396
+ '\n': 'n',
397
+ '\t': 't',
398
+ "\u2028": 'u2028',
399
+ "\u2029": 'u2029'
400
+ };
401
+ var htmlEntities = {
402
+ '&': '&amp;',
403
+ '<': '&lt;',
404
+ '>': '&gt;',
405
+ '"': '&quot;',
406
+ "'": '&#x27;'
407
+ };
408
+ var regexKeys = function regexKeys(obj) {
409
+ return new RegExp(['[', Object.keys(obj).join(''), ']'].join(''), 'g');
410
+ };
411
+ var htmlEntitiesMatch = regexKeys(htmlEntities);
412
+ var symbolEntitiesMatch = regexKeys(symbolEntities);
413
+ var entities = function entities() {
414
+ var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
415
+ return ('' + string).replace(htmlEntitiesMatch, function (match) {
416
+ return htmlEntities[match];
417
+ });
418
+ };
419
+ var symbols = function symbols(string) {
420
+ return ('' + string).replace(symbolEntitiesMatch, function (match) {
421
+ return '\\' + symbolEntities[match];
422
+ });
423
+ };
424
+ var safeValue = function safeValue(value, escape) {
425
+ var check = value;
426
+ return check == null ? '' : escape === true ? entities(check) : check;
427
+ };
428
+ var instanceOf = function instanceOf(object, instance) {
429
+ return Boolean(object instanceof instance);
430
+ };
431
+ var getPath = function getPath(context, name, strict) {
432
+ var data = context;
433
+ var chunks = String(name).split('.');
434
+ var prop = chunks.pop();
435
+ for (var i = 0; i < chunks.length; i++) {
436
+ var part = chunks[i];
437
+ if (isFunction(data['toJSON'])) {
438
+ data = data.toJSON();
439
+ }
440
+ if (strict && data.hasOwnProperty(part) === false) {
441
+ data = {};
442
+ break;
443
+ }
444
+ data = data[part] = data[part] || {};
445
+ }
446
+ if (isFunction(data['toJSON'])) {
447
+ data = data.toJSON();
448
+ }
449
+ return [data, prop];
450
+ };
451
+ var ext = function ext(path, defaults) {
452
+ var ext = path.split('.').pop();
453
+ if (ext !== defaults) {
454
+ path = [path, defaults].join('.');
455
+ }
456
+ return path;
457
+ };
458
+
459
+ /**
460
+ * @type {<T extends {}, U, V, W,Y>(T,U,V,W,Y)=> T & U & V & W & Y}
461
+ */
462
+ var extend = function extend(target) {
463
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
464
+ args[_key - 1] = arguments[_key];
465
+ }
466
+ return args.filter(function (source) {
467
+ return source;
468
+ }).reduce(function (target, source) {
469
+ return Object.assign(target, source);
470
+ }, target);
471
+ };
472
+ var noop = function noop() {};
473
+ var each = function each(object, callback) {
474
+ var prop;
475
+ for (prop in object) {
476
+ if (hasProp(object, prop)) {
477
+ callback(object[prop], prop, object);
478
+ }
479
+ }
480
+ };
481
+ var map = function map(object, callback, context) {
482
+ var result = [];
483
+ each(object, function (value, key, object) {
484
+ var item = callback(value, key, object);
485
+ if (isUndefined(item) === false) {
486
+ result.push(item);
487
+ }
488
+ });
489
+ return result;
490
+ };
491
+ var filter = function filter(object, callback, context) {
492
+ var isArray = object instanceof Array;
493
+ var result = isArray ? [] : {};
494
+ each(object, function (value, key, object) {
495
+ var item = callback(value, key, object);
496
+ if (isUndefined(item) === false) {
497
+ if (isArray) {
498
+ result.push(item);
499
+ } else {
500
+ result[key] = item;
501
+ }
502
+ }
503
+ });
504
+ return result;
505
+ };
506
+ var omit = function omit(object, list) {
507
+ return filter(object, function (value, key) {
508
+ if (list.indexOf(key) === -1) {
509
+ return value;
510
+ }
511
+ });
512
+ };
513
+ var resolve$1 = function resolve(value, callback, context) {
514
+ return Promise.resolve(value).then(callback.bind(context));
515
+ };
516
+ var hasProp = function hasProp(object, prop) {
517
+ return object && object.hasOwnProperty(prop);
518
+ };
519
+
520
+ var defaults = {};
521
+ defaults["export"] = 'ejsPrecompiled';
522
+ defaults.cache = true;
523
+ defaults.chokidar = null;
524
+ defaults.path = 'views';
525
+ defaults.resolver = function (path, template) {
526
+ return Promise.resolve(['resolver is not defined', path, template].join(' '));
527
+ };
528
+ defaults.extension = 'ejs';
529
+ defaults.rmWhitespace = true;
530
+ defaults.withObject = true;
531
+ defaults.globalHelpers = [];
532
+ defaults.vars = {
533
+ SCOPE: 'ejs',
534
+ COMPONENT: 'ui',
535
+ EXTEND: '$$e',
536
+ BUFFER: '$$a',
537
+ LAYOUT: '$$l',
538
+ BLOCKS: '$$b',
539
+ MACRO: '$$m',
540
+ SAFE: '$$v'
541
+ };
542
+ defaults.token = {
543
+ start: '<%',
544
+ end: '%>',
545
+ regex: '([\\s\\S]+?)'
546
+ };
547
+
548
+ var configSchema = function configSchema(config, options) {
549
+ extend(config, {
550
+ path: typeProp(isString, defaults.path, config.path, options.path),
551
+ "export": typeProp(isString, defaults["export"], config["export"], options["export"]),
552
+ resolver: typeProp(isFunction, defaults.resolver, config.resolver, options.resolver),
553
+ extension: typeProp(isString, defaults.extension, config.extension, options.extension),
554
+ withObject: typeProp(isBoolean, defaults.withObject, config.withObject, options.withObject),
555
+ rmWhitespace: typeProp(isBoolean, defaults.rmWhitespace, config.rmWhitespace, options.rmWhitespace),
556
+ cache: typeProp(isBoolean, defaults.cache, config.cache, options.cache),
557
+ token: extend({}, defaults.token, config.token, options.token),
558
+ vars: extend({}, defaults.vars, config.vars, options.vars),
559
+ globalHelpers: typeProp(isArray, defaults.globalHelpers, config.globalHelpers, options.globalHelpers)
560
+ });
561
+ };
562
+
563
+ var global = typeof globalThis !== 'undefined' ? globalThis : window || self;
564
+ function Cache(config) {
565
+ if (instanceOf(this, Cache) === false) return new Cache();
566
+ var cache = {
567
+ enabled: true,
568
+ list: {}
569
+ };
570
+ this.configure = function (config) {
571
+ cache.enabled = config.cache;
572
+ if (isNode() === false) {
573
+ this.load(global[config["export"]]);
574
+ }
575
+ };
576
+ this.clear = function () {
577
+ cache.list = {};
578
+ };
579
+ this.load = function (data) {
580
+ if (cache.enabled) {
581
+ extend(cache.list, data || {});
582
+ }
583
+ return this;
584
+ };
585
+ this.get = function (key) {
586
+ if (cache.enabled) {
587
+ return cache.list[key];
588
+ }
589
+ };
590
+ this.set = function (key, value) {
591
+ if (cache.enabled) {
592
+ cache.list[key] = value;
593
+ }
594
+ return this;
595
+ };
596
+ this.resolve = function (key) {
597
+ return Promise.resolve(this.get(key));
598
+ };
599
+ this.remove = function (key) {
600
+ delete cache.list[key];
601
+ };
602
+ this.exist = function (key) {
603
+ return hasProp(cache.list, key);
604
+ };
605
+ }
606
+
607
+ var tagList = [{
608
+ symbol: '-',
609
+ format: function format(value) {
610
+ return "')\n".concat(this.BUFFER, "(").concat(this.SAFE, "(").concat(value, ",1))\n").concat(this.BUFFER, "('");
611
+ }
612
+ }, {
613
+ symbol: '=',
614
+ format: function format(value) {
615
+ return "')\n".concat(this.BUFFER, "(").concat(this.SAFE, "(").concat(value, "))\n").concat(this.BUFFER, "('");
616
+ }
617
+ }, {
618
+ symbol: '#',
619
+ format: function format(value) {
620
+ return "')\n/**".concat(value, "**/\n").concat(this.BUFFER, "('");
621
+ }
622
+ }, {
623
+ symbol: '',
624
+ format: function format(value) {
625
+ return "')\n".concat(value.trim(), "\n").concat(this.BUFFER, "('");
626
+ }
627
+ }];
628
+ function matchTokens(regex, text, callback) {
629
+ var index = 0;
630
+ text.replace(regex, function () {
631
+ var params = [].slice.call(arguments, 0, -1);
632
+ var offset = params.pop();
633
+ var match = params.shift();
634
+ callback(params, index, offset);
635
+ index = offset + match.length;
636
+ return match;
637
+ });
638
+ }
639
+ function Compiler(config) {
640
+ if (instanceOf(this, Compiler) === false) return new Compiler(config);
641
+ var compiler = {};
642
+ this.configure = function (config) {
643
+ compiler.withObject = config.withObject;
644
+ compiler.rmWhitespace = config.rmWhitespace;
645
+ compiler.token = config.token;
646
+ compiler.vars = config.vars;
647
+ compiler.globalHelpers = config.globalHelpers;
648
+ compiler.matches = [];
649
+ compiler.formats = [];
650
+ compiler.slurp = {
651
+ match: '[ \\t]*',
652
+ start: [compiler.token.start, '_'],
653
+ end: ['_', compiler.token.end]
654
+ };
655
+ tagList.forEach(function (item) {
656
+ compiler.matches.push(compiler.token.start.concat(item.symbol).concat(compiler.token.regex).concat(compiler.token.end));
657
+ compiler.formats.push(item.format.bind(compiler.vars));
658
+ });
659
+ compiler.regex = new RegExp(compiler.matches.join('|').concat('|$'), 'g');
660
+ compiler.slurpStart = new RegExp([compiler.slurp.match, compiler.slurp.start.join('')].join(''), 'gm');
661
+ compiler.slurpEnd = new RegExp([compiler.slurp.end.join(''), compiler.slurp.match].join(''), 'gm');
662
+ };
663
+ this.compile = function (content, path) {
664
+ var _compiler$vars = compiler.vars,
665
+ SCOPE = _compiler$vars.SCOPE,
666
+ SAFE = _compiler$vars.SAFE,
667
+ BUFFER = _compiler$vars.BUFFER,
668
+ COMPONENT = _compiler$vars.COMPONENT;
669
+ var GLOBALS = compiler.globalHelpers;
670
+ content = String(content);
671
+ if (compiler.rmWhitespace) {
672
+ content = content.replace(/[\r\n]+/g, '\n').replace(/^\s+|\s+$/gm, '');
673
+ }
674
+ content = content.replace(compiler.slurpStart, compiler.token.start).replace(compiler.slurpEnd, compiler.token.end);
675
+ var source = "".concat(BUFFER, "('");
676
+ matchTokens(compiler.regex, content, function (params, index, offset) {
677
+ source += symbols(content.slice(index, offset));
678
+ params.forEach(function (value, index) {
679
+ if (value) {
680
+ source += compiler.formats[index](value);
681
+ }
682
+ });
683
+ });
684
+ source += "');";
685
+ source = "try{".concat(source, "}catch(e){return ").concat(BUFFER, ".error(e)}");
686
+ if (compiler.withObject) {
687
+ source = "with(".concat(SCOPE, "){").concat(source, "}");
688
+ }
689
+ source = "".concat(BUFFER, ".start();").concat(source, "return ").concat(BUFFER, ".end();");
690
+ source += "\n//# sourceURL=".concat(path);
691
+ var result = null;
692
+ var params = [SCOPE, COMPONENT, BUFFER, SAFE].concat(GLOBALS);
693
+ try {
694
+ result = Function.apply(null, params.concat(source));
695
+ result.source = "(function(".concat(params.join(','), "){\n").concat(source, "\n})");
696
+ } catch (e) {
697
+ e.filename = path;
698
+ e.source = source;
699
+ throw e;
700
+ }
701
+ return result;
702
+ };
703
+ this.configure(config);
704
+ }
705
+
706
+ function Template(config, cache, compiler) {
707
+ if (instanceOf(this, Template) === false) return new Template(config, cache, compiler);
708
+ if (instanceOf(cache, Cache) === false) throw new TypeError('cache is not instance of Cache');
709
+ if (instanceOf(compiler, Compiler) === false) throw new TypeError('compiler is not instance of Compiler');
710
+ var template = {};
711
+ var result = function result(template, content) {
712
+ cache.set(template, content);
713
+ return content;
714
+ };
715
+ var resolve = function resolve(path) {
716
+ return template.resolver(template.path, path);
717
+ };
718
+ var compile = function compile(content, template) {
719
+ if (isFunction(content)) {
720
+ return content;
721
+ } else {
722
+ return compiler.compile(content, template);
723
+ }
724
+ };
725
+ this.configure = function (config) {
726
+ template.path = config.path;
727
+ template.cache = config.cache;
728
+ if (isFunction(config.resolver)) {
729
+ template.resolver = config.resolver;
730
+ }
731
+ };
732
+ this.get = function (template) {
733
+ if (cache.exist(template)) {
734
+ return cache.resolve(template);
735
+ }
736
+ return resolve(template).then(function (content) {
737
+ return result(template, compile(content, template));
738
+ });
739
+ };
740
+ this.configure(config);
741
+ }
742
+
743
+ var selfClosed = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
744
+ var space = ' ';
745
+ var quote = '"';
746
+ var equal = '=';
747
+ var slash = '/';
748
+ var lt = '<';
749
+ var gt = '>';
750
+ var element = function element(tag, attrs, content) {
751
+ var result = [];
752
+ var hasClosedTag = selfClosed.indexOf(tag) === -1;
753
+ var attributes = map(attrs, function (value, key) {
754
+ if (value !== null && value !== undefined) {
755
+ return [entities(key), [quote, entities(value), quote].join('')].join(equal);
756
+ }
757
+ }).join(space);
758
+ result.push([lt, tag, space, attributes, gt].join(''));
759
+ if (content) {
760
+ result.push(content instanceof Array ? content.join('') : content);
761
+ }
762
+ if (hasClosedTag) {
763
+ result.push([lt, slash, tag, gt].join(''));
764
+ }
765
+ return result.join('');
766
+ };
767
+
768
+ function TemplateError(message) {
769
+ this.code = 1;
770
+ this.name = 'TemplateError';
771
+ this.message = message;
772
+ Error.call(this);
773
+ }
774
+ Object.setPrototypeOf(TemplateNotFound.prototype, Error.prototype);
775
+ function TemplateNotFound(message) {
776
+ TemplateError.call(this);
777
+ this.code = 404;
778
+ this.name = 'TemplateNotFound';
779
+ this.message = message;
780
+ }
781
+ Object.setPrototypeOf(TemplateNotFound.prototype, TemplateError.prototype);
782
+ function TemplateSyntaxError(message) {
783
+ TemplateError.call(this);
784
+ this.code = 500;
785
+ this.name = 'TemplateSyntaxError';
786
+ this.message = message;
787
+ }
788
+ Object.setPrototypeOf(TemplateSyntaxError.prototype, TemplateError.prototype);
789
+
790
+ function resolve(list) {
791
+ return Promise.all(list || []).then(function (list) {
792
+ return list.join('');
793
+ });
794
+ }
795
+ function reject(error) {
796
+ return Promise.reject(new TemplateSyntaxError(error.message));
797
+ }
798
+ function createBuffer() {
799
+ var store = [],
800
+ array = [];
801
+ function buffer(value) {
802
+ array.push(value);
803
+ }
804
+ buffer.start = function () {
805
+ array = [];
806
+ };
807
+ buffer.backup = function () {
808
+ store.push(array.concat());
809
+ array = [];
810
+ };
811
+ buffer.restore = function () {
812
+ var result = array.concat();
813
+ array = store.pop();
814
+ return resolve(result);
815
+ };
816
+ buffer.error = function (e) {
817
+ return reject(e);
818
+ };
819
+ buffer.end = function () {
820
+ return resolve(array);
821
+ };
822
+ return buffer;
823
+ }
824
+
825
+ function Context(config) {
826
+ if (instanceOf(this, Context) === false) return new Context(config);
827
+ this.configure = function (config, methods) {
828
+ var _Object$definePropert;
829
+ var _config$vars = config.vars,
830
+ BLOCKS = _config$vars.BLOCKS,
831
+ MACRO = _config$vars.MACRO,
832
+ EXTEND = _config$vars.EXTEND,
833
+ LAYOUT = _config$vars.LAYOUT,
834
+ BUFFER = _config$vars.BUFFER,
835
+ COMPONENT = _config$vars.COMPONENT;
836
+ this.create = function (data) {
837
+ return new Scope(data);
838
+ };
839
+ this.helpers = function (methods) {
840
+ extend(Scope.prototype, methods || {});
841
+ };
842
+ /**
843
+ * @name ContextScope
844
+ * @param data
845
+ * @constructor
846
+ */
847
+ function Scope(data) {
848
+ this[BLOCKS] = {};
849
+ this[MACRO] = {};
850
+ extend(this, data || {});
851
+ }
852
+ Scope.prototype = extend({}, methods || {});
853
+ Object.defineProperties(Scope.prototype, (_Object$definePropert = {}, _defineProperty(_Object$definePropert, BUFFER, {
854
+ value: createBuffer(),
855
+ writable: true,
856
+ configurable: false,
857
+ enumerable: false
858
+ }), _defineProperty(_Object$definePropert, BLOCKS, {
859
+ value: {},
860
+ writable: true,
861
+ configurable: false,
862
+ enumerable: false
863
+ }), _defineProperty(_Object$definePropert, MACRO, {
864
+ value: {},
865
+ writable: true,
866
+ configurable: false,
867
+ enumerable: false
868
+ }), _defineProperty(_Object$definePropert, LAYOUT, {
869
+ value: false,
870
+ writable: true,
871
+ configurable: false,
872
+ enumerable: false
873
+ }), _defineProperty(_Object$definePropert, EXTEND, {
874
+ value: false,
875
+ writable: true,
876
+ configurable: false,
877
+ enumerable: false
878
+ }), _defineProperty(_Object$definePropert, "getMacro", {
879
+ value: function value() {
880
+ return this[MACRO];
881
+ },
882
+ writable: false,
883
+ configurable: false,
884
+ enumerable: false
885
+ }), _defineProperty(_Object$definePropert, "getBuffer", {
886
+ value: function value() {
887
+ return this[BUFFER];
888
+ },
889
+ writable: false,
890
+ configurable: false,
891
+ enumerable: false
892
+ }), _defineProperty(_Object$definePropert, "getComponent", {
893
+ value: function value() {
894
+ var context = this;
895
+ if (COMPONENT in context) {
896
+ return function () {
897
+ return context[COMPONENT].apply(context, arguments);
898
+ };
899
+ }
900
+ return function () {
901
+ console.log('%s function not defined', COMPONENT);
902
+ };
903
+ },
904
+ writable: false,
905
+ configurable: false,
906
+ enumerable: false
907
+ }), _defineProperty(_Object$definePropert, "getBlocks", {
908
+ value: function value() {
909
+ return this[BLOCKS];
910
+ },
911
+ writable: false,
912
+ configurable: false,
913
+ enumerable: false
914
+ }), _defineProperty(_Object$definePropert, "setExtend", {
915
+ value: function value(_value) {
916
+ this[EXTEND] = _value;
917
+ },
918
+ writable: false,
919
+ configurable: false,
920
+ enumerable: false
921
+ }), _defineProperty(_Object$definePropert, "getExtend", {
922
+ value: function value() {
923
+ return this[EXTEND];
924
+ },
925
+ writable: false,
926
+ configurable: false,
927
+ enumerable: false
928
+ }), _defineProperty(_Object$definePropert, "setLayout", {
929
+ value: function value(layout) {
930
+ this[LAYOUT] = layout;
931
+ },
932
+ writable: false,
933
+ configurable: false,
934
+ enumerable: false
935
+ }), _defineProperty(_Object$definePropert, "getLayout", {
936
+ value: function value() {
937
+ return this[LAYOUT];
938
+ },
939
+ writable: false,
940
+ configurable: false,
941
+ enumerable: false
942
+ }), _defineProperty(_Object$definePropert, "clone", {
943
+ value: function value(exclude_blocks) {
944
+ var filter = [LAYOUT, EXTEND, BUFFER];
945
+ if (exclude_blocks === true) {
946
+ filter.push(BLOCKS);
947
+ }
948
+ return omit(this, filter);
949
+ },
950
+ writable: false,
951
+ configurable: false,
952
+ enumerable: false
953
+ }), _defineProperty(_Object$definePropert, "extend", {
954
+ value: function value(layout) {
955
+ this.setExtend(true);
956
+ this.setLayout(layout);
957
+ },
958
+ writable: false,
959
+ configurable: false,
960
+ enumerable: false
961
+ }), _defineProperty(_Object$definePropert, "echo", {
962
+ value: function value(layout) {
963
+ var buffer = this.getBuffer();
964
+ var params = [].slice.call(arguments);
965
+ params.forEach(buffer);
966
+ },
967
+ writable: false,
968
+ configurable: false,
969
+ enumerable: false
970
+ }), _defineProperty(_Object$definePropert, "fn", {
971
+ value: function value(callback) {
972
+ var buffer = this.getBuffer();
973
+ var context = this;
974
+ return function () {
975
+ buffer.backup();
976
+ if (isFunction(callback)) {
977
+ callback.apply(context, arguments);
978
+ }
979
+ return buffer.restore();
980
+ };
981
+ },
982
+ writable: false,
983
+ configurable: false,
984
+ enumerable: false
985
+ }), _defineProperty(_Object$definePropert, "get", {
986
+ value: function value(name, defaults) {
987
+ var path = getPath(this, name, true);
988
+ var result = path.shift();
989
+ var prop = path.pop();
990
+ return hasProp(result, prop) ? result[prop] : defaults;
991
+ },
992
+ writable: true,
993
+ configurable: true,
994
+ enumerable: false
995
+ }), _defineProperty(_Object$definePropert, "set", {
996
+ value: function value(name, _value2) {
997
+ var path = getPath(this, name, false);
998
+ var result = path.shift();
999
+ var prop = path.pop();
1000
+ if (this.getExtend() && hasProp(result, prop)) {
1001
+ return result[prop];
1002
+ }
1003
+ return result[prop] = _value2;
1004
+ },
1005
+ writable: false,
1006
+ configurable: false,
1007
+ enumerable: false
1008
+ }), _defineProperty(_Object$definePropert, "macro", {
1009
+ value: function value(name, callback) {
1010
+ var list = this.getMacro();
1011
+ var macro = this.fn(callback);
1012
+ var context = this;
1013
+ list[name] = function () {
1014
+ return context.echo(macro.apply(undefined, arguments));
1015
+ };
1016
+ },
1017
+ writable: false,
1018
+ configurable: false,
1019
+ enumerable: false
1020
+ }), _defineProperty(_Object$definePropert, "call", {
1021
+ value: function value(name) {
1022
+ var list = this.getMacro();
1023
+ var macro = list[name];
1024
+ var params = [].slice.call(arguments, 1);
1025
+ if (isFunction(macro)) {
1026
+ return macro.apply(macro, params);
1027
+ }
1028
+ },
1029
+ writable: false,
1030
+ configurable: false,
1031
+ enumerable: false
1032
+ }), _defineProperty(_Object$definePropert, "block", {
1033
+ value: function value(name, callback) {
1034
+ var _this = this;
1035
+ var blocks = this.getBlocks();
1036
+ blocks[name] = blocks[name] || [];
1037
+ blocks[name].push(this.fn(callback));
1038
+ if (this.getExtend()) return;
1039
+ var list = Object.assign([], blocks[name]);
1040
+ var current = function current() {
1041
+ return list.shift();
1042
+ };
1043
+ var next = function next() {
1044
+ var parent = current();
1045
+ if (parent) {
1046
+ return function () {
1047
+ _this.echo(parent(next()));
1048
+ };
1049
+ } else {
1050
+ return noop;
1051
+ }
1052
+ };
1053
+ this.echo(current()(next()));
1054
+ },
1055
+ writable: false,
1056
+ configurable: false,
1057
+ enumerable: false
1058
+ }), _defineProperty(_Object$definePropert, "include", {
1059
+ value: function value(path, data, cx) {
1060
+ var context = cx === false ? {} : this.clone(true);
1061
+ var params = extend(context, data || {});
1062
+ var promise = this.render(path, params);
1063
+ this.echo(promise);
1064
+ },
1065
+ writable: false,
1066
+ configurable: false,
1067
+ enumerable: false
1068
+ }), _defineProperty(_Object$definePropert, "use", {
1069
+ value: function value(path, namespace) {
1070
+ var promise = this.require(path);
1071
+ this.echo(resolve$1(promise, function (exports) {
1072
+ var list = this.getMacro();
1073
+ each(exports, function (macro, name) {
1074
+ list[[namespace, name].join('.')] = macro;
1075
+ });
1076
+ }, this));
1077
+ },
1078
+ writable: false,
1079
+ configurable: false,
1080
+ enumerable: false
1081
+ }), _defineProperty(_Object$definePropert, "async", {
1082
+ value: function value(promise, callback) {
1083
+ this.echo(resolve$1(promise, function (data) {
1084
+ return this.fn(callback)(data);
1085
+ }, this));
1086
+ },
1087
+ writable: false,
1088
+ configurable: false,
1089
+ enumerable: false
1090
+ }), _defineProperty(_Object$definePropert, "each", {
1091
+ value: function value(object, callback) {
1092
+ if (isString(object)) {
1093
+ object = this.get(object, []);
1094
+ }
1095
+ each(object, callback);
1096
+ },
1097
+ writable: false,
1098
+ configurable: false,
1099
+ enumerable: false
1100
+ }), _defineProperty(_Object$definePropert, "element", {
1101
+ value: function value(tag, attr, content) {
1102
+ return element(tag, attr, content);
1103
+ },
1104
+ writable: false,
1105
+ configurable: false,
1106
+ enumerable: false
1107
+ }), _defineProperty(_Object$definePropert, "el", {
1108
+ value: function value(tag, attr, content) {
1109
+ if (isFunction(content)) {
1110
+ content = this.fn(content)();
1111
+ }
1112
+ this.echo(resolve$1(content, function (content) {
1113
+ return this.element(tag, attr, content);
1114
+ }, this));
1115
+ },
1116
+ writable: false,
1117
+ configurable: false,
1118
+ enumerable: false
1119
+ }), _Object$definePropert));
1120
+ };
1121
+ this.configure(config);
1122
+ }
1123
+
1124
+ function EJS(options) {
1125
+ if (instanceOf(this, EJS) === false) return new EJS(options);
1126
+ var scope = {};
1127
+ var config = {};
1128
+ configSchema(config, options || {});
1129
+ var context = new Context(config);
1130
+ var compiler = new Compiler(config);
1131
+ var cache = new Cache();
1132
+ var template = new Template(config, cache, compiler);
1133
+ var output = function output(path, scope) {
1134
+ var globalHelpers = config.globalHelpers;
1135
+ var params = [scope, scope.getComponent(), scope.getBuffer(), safeValue].concat(globalHelpers.filter(function (name) {
1136
+ return isFunction(scope[name]);
1137
+ }).map(function (name) {
1138
+ return scope[name].bind(scope);
1139
+ }));
1140
+ return template.get(path).then(function (callback) {
1141
+ return callback.apply(scope, params);
1142
+ });
1143
+ };
1144
+ var require = function require(name) {
1145
+ var filepath = ext(name, config.extension);
1146
+ var scope = context.create({});
1147
+ return output(filepath, scope).then(function () {
1148
+ return scope.getMacro();
1149
+ });
1150
+ };
1151
+ var render = function render(name, data) {
1152
+ var filepath = ext(name, config.extension);
1153
+ var scope = context.create(data);
1154
+ return output(filepath, scope).then(function (content) {
1155
+ if (scope.getExtend()) {
1156
+ scope.setExtend(false);
1157
+ var layout = scope.getLayout();
1158
+ var _data = scope.clone();
1159
+ return render(layout, _data);
1160
+ }
1161
+ return content;
1162
+ });
1163
+ };
1164
+ this.configure = function (options) {
1165
+ options = options || {};
1166
+ configSchema(config, options);
1167
+ context.configure(config, scope);
1168
+ compiler.configure(config);
1169
+ cache.configure(config);
1170
+ template.configure(config);
1171
+ return config;
1172
+ };
1173
+ this.render = function (name, data) {
1174
+ return render(name, data);
1175
+ };
1176
+ this.helpers = function (methods) {
1177
+ context.helpers(extend(scope, methods));
1178
+ };
1179
+ this.preload = function (list) {
1180
+ return cache.load(list || {});
1181
+ };
1182
+ this.create = function (options) {
1183
+ return new EJS(options);
1184
+ };
1185
+ this.compile = function (content, path) {
1186
+ return compiler.compile(content, path);
1187
+ };
1188
+ this.context = function (data) {
1189
+ return context.create(data);
1190
+ };
1191
+ this.helpers({
1192
+ require: require,
1193
+ render: render
1194
+ });
1195
+ return this;
1196
+ }
1197
+
1198
+ var templateCache = {};
1199
+ var ejs = new EJS({
1200
+ cache: false,
1201
+ withObject: false,
1202
+ resolver: function resolver(path, name) {
1203
+ return new Promise(function (resolve, reject) {
1204
+ if (templateCache.hasOwnProperty(name)) {
1205
+ resolve(templateCache[name]);
1206
+ } else {
1207
+ reject(new TemplateNotFound("template ".concat(name, " not found")));
1208
+ }
1209
+ });
1210
+ }
1211
+ });
1212
+ var getOrigin = function getOrigin(url, secure) {
1213
+ url = new URL(url);
1214
+ if (secure) url.protocol = 'https:';
1215
+ return url.origin;
1216
+ };
1217
+ function setTemplates(list) {
1218
+ Object.assign(templateCache, list || {});
1219
+ }
1220
+
1221
+ /**
1222
+ * @typedef {Object<string,any>} HonoContext
1223
+ * @property {function(*):Promise<Response>} html
1224
+ * @property {function(name:string,data:{}):Promise<string>} render
1225
+ * @property {function(name:string,data:{}):Promise<string>} ejs
1226
+ * @property {ContextScope} data
1227
+ */
1228
+
1229
+ /**
1230
+ *
1231
+ * @param {Object<string,any>} options
1232
+ * @return {(function(c:Context, next): Promise<any>)|*}
1233
+ */
1234
+ function setRenderer(_ref) {
1235
+ var _ref$secure = _ref.secure,
1236
+ secure = _ref$secure === void 0 ? true : _ref$secure,
1237
+ _ref$version = _ref.version,
1238
+ version = _ref$version === void 0 ? '1.0' : _ref$version;
1239
+ return /*#__PURE__*/function () {
1240
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(c, next) {
1241
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1242
+ while (1) switch (_context.prev = _context.next) {
1243
+ case 0:
1244
+ c.data = context({});
1245
+ c.data.set('version', version);
1246
+ c.data.set('origin', getOrigin(c.req.url, secure));
1247
+ c.ejs = function (name, data) {
1248
+ return render(name, Object.assign({}, c.data, data));
1249
+ };
1250
+ c.render = function (name, data) {
1251
+ return c.html(c.ejs(name, data));
1252
+ };
1253
+ _context.next = 7;
1254
+ return next();
1255
+ case 7:
1256
+ case "end":
1257
+ return _context.stop();
1258
+ }
1259
+ }, _callee);
1260
+ }));
1261
+ return function (_x, _x2) {
1262
+ return _ref2.apply(this, arguments);
1263
+ };
1264
+ }();
1265
+ }
1266
+ var render = ejs.render,
1267
+ context = ejs.context,
1268
+ compile = ejs.compile,
1269
+ helpers = ejs.helpers,
1270
+ preload = ejs.preload,
1271
+ configure = ejs.configure,
1272
+ create = ejs.create;
1273
+
1274
+ exports.compile = compile;
1275
+ exports.configure = configure;
1276
+ exports.context = context;
1277
+ exports.create = create;
1278
+ exports.helpers = helpers;
1279
+ exports.preload = preload;
1280
+ exports.render = render;
1281
+ exports.setRenderer = setRenderer;
1282
+ exports.setTemplates = setTemplates;
1283
+
1284
+ }));