Skip to content
This repository
Browse code

release v0.3.0

  • Loading branch information...
commit 7469a94222b3ab40763121f85d3e1fc5772e9106 1 parent 42840ae
authored January 26, 2011
2  README.md
Source Rendered
@@ -43,7 +43,7 @@ In Node:
43 43
 
44 44
 To render compiled templates in the browser:
45 45
 
46  
-    <script src="dust-core-0.2.5.min.js"></script>
  46
+    <script src="dust-core-0.3.0.min.js"></script>
47 47
 
48 48
 Demo & Guide
49 49
 ------------
21  dist/dust-core-0.2.5.min.js
... ...
@@ -1,21 +0,0 @@
1  
-//
2  
-// Dust - Asynchronous Templating v0.2.5
3  
-// http://akdubya.github.com/dustjs
4  
-//
5  
-// Copyright (c) 2010, Aleksander Williams
6  
-// Released under the MIT License.
7  
-//
8  
-
9  
-var dust={};
10  
-(function(d){function h(a,b,c){this.stack=a;this.global=b;this.blocks=c}function k(a,b,c,e){this.tail=b;this.isObject=!d.isArray(a)&&a&&typeof a==="object";this.head=a;this.index=c;this.of=e}function l(a){this.head=new g(this);this.callback=a;this.out=""}function j(){this.head=new g(this)}function g(a,b,c){this.root=a;this.next=b;this.data="";this.flushable=false;this.taps=c}function m(a,b){this.head=a;this.tail=b}d.cache={};d.register=function(a,b){if(a)d.cache[a]=b};d.render=function(a,b,c){c=(new l(c)).head;
11  
-d.load(a,c,h.wrap(b)).end()};d.stream=function(a,b){var c=new j;d.nextTick(function(){d.load(a,c.head,h.wrap(b)).end()});return c};d.renderSource=function(a,b,c){return d.compileFn(a)(b,c)};d.compileFn=function(a,b){var c=d.loadSource(d.compile(a,b));return function(e,f){var i=f?new l(f):new j;d.nextTick(function(){c(i.head,h.wrap(e)).end()});return i}};d.load=function(a,b,c){var e=d.cache[a];if(e)return e(b,c);else{if(d.onLoad)return b.map(function(f){d.onLoad(a,function(i,n){if(i)return f.setError(i);
12  
-d.cache[a]||d.loadSource(d.compile(n,a));d.cache[a](f,c).end()})});return b.setError(Error("Template Not Found: "+a))}};d.loadSource=function(a){return eval(a)};d.isArray=Array.isArray?Array.isArray:function(a){return Object.prototype.toString.call(a)=="[object Array]"};d.nextTick=function(a){setTimeout(a,0)};d.isEmpty=function(a){if(d.isArray(a)&&!a.length)return true;if(a===0)return false;return!a};d.filter=function(a,b,c){for(var e=c.length,f=0;f<e;f++){var i=c[f];if(i==="s")b=null;else a=d.filters[i](a)}if(b)a=
13  
-d.filters[b](a);return a};d.filters={h:function(a){return d.escapeHtml(a)},j:function(a){return d.escapeJs(a)},u:encodeURI,uc:encodeURIComponent};d.makeBase=function(a){return new h(new k,a)};h.wrap=function(a){if(a instanceof h)return a;return new h(new k(a))};h.prototype.get=function(a){for(var b=this.stack,c;b;){if(b.isObject){c=b.head[a];if(c!==undefined)return c}b=b.tail}return this.global?this.global[a]:undefined};h.prototype.getPath=function(a,b){var c=this.stack,e=b.length;if(a&&e===0)return c.head;
14  
-if(c.isObject){c=c.head;for(var f=0;c&&f<e;){c=c[b[f]];f++}return c}};h.prototype.push=function(a,b,c){return new h(new k(a,this.stack,b,c),this.global,this.blocks)};h.prototype.rebase=function(a){return new h(new k(a),this.global,this.blocks)};h.prototype.current=function(){return this.stack.head};h.prototype.getBlock=function(a){var b=this.blocks;if(b)for(var c=b.length,e;c--;)if(e=b[c][a])return e};h.prototype.shiftBlocks=function(a){var b=this.blocks;if(a){newBlocks=b?b.concat([a]):[a];return new h(this.stack,
15  
-this.global,newBlocks)}return this};l.prototype.flush=function(){for(var a=this.head;a;){if(a.flushable)this.out+=a.data;else{if(a.error){this.callback(a.error);this.flush=function(){}}return}this.head=a=a.next}this.callback(null,this.out)};j.prototype.flush=function(){for(var a=this.head;a;){if(a.flushable)this.emit("data",a.data);else{if(a.error){this.emit("error",a.error);this.flush=function(){}}return}this.head=a=a.next}this.emit("end")};j.prototype.emit=function(a,b){var c=this.events;c&&c[a]&&
16  
-c[a](b)};j.prototype.on=function(a,b){if(!this.events)this.events={};this.events[a]=b;return this};g.prototype.write=function(a){var b=this.taps;if(b)a=b.go(a);this.data+=a;return this};g.prototype.end=function(a){a&&this.write(a);this.flushable=true;this.root.flush();return this};g.prototype.map=function(a){var b=new g(this.root,this.next,this.taps),c=new g(this.root,b,this.taps);this.next=c;this.flushable=true;a(c);return b};g.prototype.tap=function(a){var b=this.taps;this.taps=b?b.push(a):new m(a);
17  
-return this};g.prototype.untap=function(){this.taps=this.taps.tail;return this};g.prototype.render=function(a,b){return a(this,b)};g.prototype.reference=function(a,b,c,e){if(typeof a==="function"){a=a(this,b,null,{auto:c,filters:e});if(a instanceof g)return a}return d.isEmpty(a)?this:this.write(d.filter(a,c,e))};g.prototype.section=function(a,b,c,e){if(typeof a==="function"){a=a(this,b,c,e);if(a instanceof g)return a}var f=c.block;c=c["else"];if(e)b=b.push(e);if(d.isArray(a)){if(f){e=a.length;c=this;
18  
-for(var i=0;i<e;i++)c=f(c,b.push(a[i],i,e));return c}}else if(a===true){if(f)return f(this,b)}else if(a||a===0){if(f)return f(this,b.push(a))}else if(c)return c(this,b);return this};g.prototype.exists=function(a,b,c){var e=c.block;c=c["else"];if(d.isEmpty(a)){if(c)return c(this,b)}else if(e)return e(this,b);return this};g.prototype.notexists=function(a,b,c){var e=c.block;c=c["else"];if(d.isEmpty(a)){if(e)return e(this,b)}else if(c)return c(this,b);return this};g.prototype.block=function(a,b,c){c=
19  
-c.block;if(a)c=a;if(c)return c(this,b);return this};g.prototype.partial=function(a,b){if(typeof a==="function")return this.capture(a,b,function(c,e){d.load(c,e,b).end()});return d.load(a,this,b)};g.prototype.helper=function(a,b,c,e){return d.helpers[a](this,b,c,e)};g.prototype.capture=function(a,b,c){return this.map(function(e){var f=new l(function(i,n){i?e.setError(i):c(n,e)});a(f.head,b).end()})};g.prototype.setError=function(a){this.error=a;this.root.flush();return this};d.helpers={sep:function(a,
20  
-b,c){if(b.stack.index===b.stack.of-1)return a;return c.block(a,b)},idx:function(a,b,c){return c.block(a,b.push(b.stack.index))}};m.prototype.push=function(a){return new m(a,this)};m.prototype.go=function(a){for(var b=this;b;){a=b.head(a);b=b.tail}return a};var o=/[&<>\"]/,p=/&/g,q=/</g,r=/>/g,s=/\"/g;d.escapeHtml=function(a){if(typeof a==="string"){if(!o.test(a))return a;return a.replace(p,"&amp;").replace(q,"&lt;").replace(r,"&gt;").replace(s,"&quot;")}return a};var t=/\\/g,u=/\r/g,v=/\u2028/g,w=
21  
-/\u2029/g,x=/\n/g,y=/\f/g,z=/'/g,A=/"/g,B=/\t/g;d.escapeJs=function(a){if(typeof a==="string")return a.replace(t,"\\\\").replace(A,'\\"').replace(z,"\\'").replace(u,"\\r").replace(v,"\\u2028").replace(w,"\\u2029").replace(x,"\\n").replace(y,"\\f").replace(B,"\\t");return a}})(dust);if(typeof exports!=="undefined"){require("./server")(dust);module.exports=dust};
35  dist/dust-core-0.2.5.js → dist/dust-core-0.3.0.js
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-// Dust - Asynchronous Templating v0.2.5
  2
+// Dust - Asynchronous Templating v0.3.0
3 3
 // http://akdubya.github.com/dustjs
4 4
 //
5 5
 // Copyright (c) 2010, Aleksander Williams
@@ -86,14 +86,14 @@ dust.isEmpty = function(value) {
86 86
 };
87 87
 
88 88
 dust.filter = function(string, auto, filters) {
89  
-  var len = filters.length;
90  
-
91  
-  for (var i=0; i<len; i++) {
92  
-    var name = filters[i];
93  
-    if (name === "s") {
94  
-      auto = null;
95  
-    } else {
96  
-      string = dust.filters[name](string);
  89
+  if (filters) {
  90
+    for (var i=0, len=filters.length; i<len; i++) {
  91
+      var name = filters[i];
  92
+      if (name === "s") {
  93
+        auto = null;
  94
+      } else {
  95
+        string = dust.filters[name](string);
  96
+      }
97 97
     }
98 98
   }
99 99
   if (auto) {
@@ -103,16 +103,9 @@ dust.filter = function(string, auto, filters) {
103 103
 };
104 104
 
105 105
 dust.filters = {
106  
-  h: function(value) {
107  
-    return dust.escapeHtml(value);
108  
-  },
109  
-
110  
-  j: function(value) {
111  
-    return dust.escapeJs(value);
112  
-  },
113  
-
  106
+  h: function(value) { return dust.escapeHtml(value); },
  107
+  j: function(value) { return dust.escapeJs(value); },
114 108
   u: encodeURI,
115  
-
116 109
   uc: encodeURIComponent
117 110
 }
118 111
 
@@ -477,7 +470,7 @@ Tap.prototype.go = function(value) {
477 470
   return value;
478 471
 };
479 472
 
480  
-var HCHARS = /[&<>\"]/,
  473
+var HCHARS = new RegExp(/[&<>\"]/),
481 474
     AMP    = /&/g,
482 475
     LT     = /</g,
483 476
     GT     = />/g,
@@ -522,6 +515,8 @@ dust.escapeJs = function(s) {
522 515
 })(dust);
523 516
 
524 517
 if (typeof exports !== "undefined") {
525  
-  require('./server')(dust);
  518
+  if (typeof process !== "undefined") {
  519
+      require('./server')(dust);
  520
+  }
526 521
   module.exports = dust;
527 522
 }
21  dist/dust-core-0.3.0.min.js
... ...
@@ -0,0 +1,21 @@
  1
+//
  2
+// Dust - Asynchronous Templating v0.3.0
  3
+// http://akdubya.github.com/dustjs
  4
+//
  5
+// Copyright (c) 2010, Aleksander Williams
  6
+// Released under the MIT License.
  7
+//
  8
+
  9
+var dust={};
  10
+(function(d){function h(a,b,c){this.stack=a;this.global=b;this.blocks=c}function k(a,b,c,e){this.tail=b;this.isObject=!d.isArray(a)&&a&&typeof a==="object";this.head=a;this.index=c;this.of=e}function l(a){this.head=new f(this);this.callback=a;this.out=""}function j(){this.head=new f(this)}function f(a,b,c){this.root=a;this.next=b;this.data="";this.flushable=false;this.taps=c}function m(a,b){this.head=a;this.tail=b}d.cache={};d.register=function(a,b){if(a)d.cache[a]=b};d.render=function(a,b,c){c=(new l(c)).head;
  11
+d.load(a,c,h.wrap(b)).end()};d.stream=function(a,b){var c=new j;d.nextTick(function(){d.load(a,c.head,h.wrap(b)).end()});return c};d.renderSource=function(a,b,c){return d.compileFn(a)(b,c)};d.compileFn=function(a,b){var c=d.loadSource(d.compile(a,b));return function(e,g){var i=g?new l(g):new j;d.nextTick(function(){c(i.head,h.wrap(e)).end()});return i}};d.load=function(a,b,c){var e=d.cache[a];if(e)return e(b,c);else{if(d.onLoad)return b.map(function(g){d.onLoad(a,function(i,n){if(i)return g.setError(i);
  12
+d.cache[a]||d.loadSource(d.compile(n,a));d.cache[a](g,c).end()})});return b.setError(Error("Template Not Found: "+a))}};d.loadSource=function(a){return eval(a)};d.isArray=Array.isArray?Array.isArray:function(a){return Object.prototype.toString.call(a)=="[object Array]"};d.nextTick=function(a){setTimeout(a,0)};d.isEmpty=function(a){if(d.isArray(a)&&!a.length)return true;if(a===0)return false;return!a};d.filter=function(a,b,c){if(c)for(var e=0,g=c.length;e<g;e++){var i=c[e];if(i==="s")b=null;else a=
  13
+d.filters[i](a)}if(b)a=d.filters[b](a);return a};d.filters={h:function(a){return d.escapeHtml(a)},j:function(a){return d.escapeJs(a)},u:encodeURI,uc:encodeURIComponent};d.makeBase=function(a){return new h(new k,a)};h.wrap=function(a){if(a instanceof h)return a;return new h(new k(a))};h.prototype.get=function(a){for(var b=this.stack,c;b;){if(b.isObject){c=b.head[a];if(c!==undefined)return c}b=b.tail}return this.global?this.global[a]:undefined};h.prototype.getPath=function(a,b){var c=this.stack,e=b.length;
  14
+if(a&&e===0)return c.head;if(c.isObject){c=c.head;for(var g=0;c&&g<e;){c=c[b[g]];g++}return c}};h.prototype.push=function(a,b,c){return new h(new k(a,this.stack,b,c),this.global,this.blocks)};h.prototype.rebase=function(a){return new h(new k(a),this.global,this.blocks)};h.prototype.current=function(){return this.stack.head};h.prototype.getBlock=function(a){var b=this.blocks;if(b)for(var c=b.length,e;c--;)if(e=b[c][a])return e};h.prototype.shiftBlocks=function(a){var b=this.blocks;if(a){newBlocks=
  15
+b?b.concat([a]):[a];return new h(this.stack,this.global,newBlocks)}return this};l.prototype.flush=function(){for(var a=this.head;a;){if(a.flushable)this.out+=a.data;else{if(a.error){this.callback(a.error);this.flush=function(){}}return}this.head=a=a.next}this.callback(null,this.out)};j.prototype.flush=function(){for(var a=this.head;a;){if(a.flushable)this.emit("data",a.data);else{if(a.error){this.emit("error",a.error);this.flush=function(){}}return}this.head=a=a.next}this.emit("end")};j.prototype.emit=
  16
+function(a,b){var c=this.events;c&&c[a]&&c[a](b)};j.prototype.on=function(a,b){if(!this.events)this.events={};this.events[a]=b;return this};f.prototype.write=function(a){var b=this.taps;if(b)a=b.go(a);this.data+=a;return this};f.prototype.end=function(a){a&&this.write(a);this.flushable=true;this.root.flush();return this};f.prototype.map=function(a){var b=new f(this.root,this.next,this.taps),c=new f(this.root,b,this.taps);this.next=c;this.flushable=true;a(c);return b};f.prototype.tap=function(a){var b=
  17
+this.taps;this.taps=b?b.push(a):new m(a);return this};f.prototype.untap=function(){this.taps=this.taps.tail;return this};f.prototype.render=function(a,b){return a(this,b)};f.prototype.reference=function(a,b,c,e){if(typeof a==="function"){a=a(this,b,null,{auto:c,filters:e});if(a instanceof f)return a}return d.isEmpty(a)?this:this.write(d.filter(a,c,e))};f.prototype.section=function(a,b,c,e){if(typeof a==="function"){a=a(this,b,c,e);if(a instanceof f)return a}var g=c.block;c=c["else"];if(e)b=b.push(e);
  18
+if(d.isArray(a)){if(g){e=a.length;c=this;for(var i=0;i<e;i++)c=g(c,b.push(a[i],i,e));return c}}else if(a===true){if(g)return g(this,b)}else if(a||a===0){if(g)return g(this,b.push(a))}else if(c)return c(this,b);return this};f.prototype.exists=function(a,b,c){var e=c.block;c=c["else"];if(d.isEmpty(a)){if(c)return c(this,b)}else if(e)return e(this,b);return this};f.prototype.notexists=function(a,b,c){var e=c.block;c=c["else"];if(d.isEmpty(a)){if(e)return e(this,b)}else if(c)return c(this,b);return this};
  19
+f.prototype.block=function(a,b,c){c=c.block;if(a)c=a;if(c)return c(this,b);return this};f.prototype.partial=function(a,b){if(typeof a==="function")return this.capture(a,b,function(c,e){d.load(c,e,b).end()});return d.load(a,this,b)};f.prototype.helper=function(a,b,c,e){return d.helpers[a](this,b,c,e)};f.prototype.capture=function(a,b,c){return this.map(function(e){var g=new l(function(i,n){i?e.setError(i):c(n,e)});a(g.head,b).end()})};f.prototype.setError=function(a){this.error=a;this.root.flush();
  20
+return this};d.helpers={sep:function(a,b,c){if(b.stack.index===b.stack.of-1)return a;return c.block(a,b)},idx:function(a,b,c){return c.block(a,b.push(b.stack.index))}};m.prototype.push=function(a){return new m(a,this)};m.prototype.go=function(a){for(var b=this;b;){a=b.head(a);b=b.tail}return a};var o=RegExp(/[&<>\"]/),p=/&/g,q=/</g,r=/>/g,s=/\"/g;d.escapeHtml=function(a){if(typeof a==="string"){if(!o.test(a))return a;return a.replace(p,"&amp;").replace(q,"&lt;").replace(r,"&gt;").replace(s,"&quot;")}return a};
  21
+var t=/\\/g,u=/\r/g,v=/\u2028/g,w=/\u2029/g,x=/\n/g,y=/\f/g,z=/'/g,A=/"/g,B=/\t/g;d.escapeJs=function(a){if(typeof a==="string")return a.replace(t,"\\\\").replace(A,'\\"').replace(z,"\\'").replace(u,"\\r").replace(v,"\\u2028").replace(w,"\\u2029").replace(x,"\\n").replace(y,"\\f").replace(B,"\\t");return a}})(dust);if(typeof exports!=="undefined"){typeof process!=="undefined"&&require("./server")(dust);module.exports=dust};
60  dist/dust-full-0.2.5.min.js
... ...
@@ -1,60 +0,0 @@
1  
-//
2  
-// Dust - Asynchronous Templating v0.2.5
3  
-// http://akdubya.github.com/dustjs
4  
-//
5  
-// Copyright (c) 2010, Aleksander Williams
6  
-// Released under the MIT License.
7  
-//
8  
-
9  
-var dust={};
10  
-(function(o){function A(e,j,k){this.stack=e;this.global=j;this.blocks=k}function H(e,j,k,v){this.tail=j;this.isObject=!o.isArray(e)&&e&&typeof e==="object";this.head=e;this.index=k;this.of=v}function q(e){this.head=new l(this);this.callback=e;this.out=""}function J(){this.head=new l(this)}function l(e,j,k){this.root=e;this.next=j;this.data="";this.flushable=false;this.taps=k}function G(e,j){this.head=e;this.tail=j}o.cache={};o.register=function(e,j){if(e)o.cache[e]=j};o.render=function(e,j,k){k=(new q(k)).head;
11  
-o.load(e,k,A.wrap(j)).end()};o.stream=function(e,j){var k=new J;o.nextTick(function(){o.load(e,k.head,A.wrap(j)).end()});return k};o.renderSource=function(e,j,k){return o.compileFn(e)(j,k)};o.compileFn=function(e,j){var k=o.loadSource(o.compile(e,j));return function(v,y){var E=y?new q(y):new J;o.nextTick(function(){k(E.head,A.wrap(v)).end()});return E}};o.load=function(e,j,k){var v=o.cache[e];if(v)return v(j,k);else{if(o.onLoad)return j.map(function(y){o.onLoad(e,function(E,K){if(E)return y.setError(E);
12  
-o.cache[e]||o.loadSource(o.compile(K,e));o.cache[e](y,k).end()})});return j.setError(Error("Template Not Found: "+e))}};o.loadSource=function(e){return eval(e)};o.isArray=Array.isArray?Array.isArray:function(e){return Object.prototype.toString.call(e)=="[object Array]"};o.nextTick=function(e){setTimeout(e,0)};o.isEmpty=function(e){if(o.isArray(e)&&!e.length)return true;if(e===0)return false;return!e};o.filter=function(e,j,k){for(var v=k.length,y=0;y<v;y++){var E=k[y];if(E==="s")j=null;else e=o.filters[E](e)}if(j)e=
13  
-o.filters[j](e);return e};o.filters={h:function(e){return o.escapeHtml(e)},j:function(e){return o.escapeJs(e)},u:encodeURI,uc:encodeURIComponent};o.makeBase=function(e){return new A(new H,e)};A.wrap=function(e){if(e instanceof A)return e;return new A(new H(e))};A.prototype.get=function(e){for(var j=this.stack,k;j;){if(j.isObject){k=j.head[e];if(k!==undefined)return k}j=j.tail}return this.global?this.global[e]:undefined};A.prototype.getPath=function(e,j){var k=this.stack,v=j.length;if(e&&v===0)return k.head;
14  
-if(k.isObject){k=k.head;for(var y=0;k&&y<v;){k=k[j[y]];y++}return k}};A.prototype.push=function(e,j,k){return new A(new H(e,this.stack,j,k),this.global,this.blocks)};A.prototype.rebase=function(e){return new A(new H(e),this.global,this.blocks)};A.prototype.current=function(){return this.stack.head};A.prototype.getBlock=function(e){var j=this.blocks;if(j)for(var k=j.length,v;k--;)if(v=j[k][e])return v};A.prototype.shiftBlocks=function(e){var j=this.blocks;if(e){newBlocks=j?j.concat([e]):[e];return new A(this.stack,
15  
-this.global,newBlocks)}return this};q.prototype.flush=function(){for(var e=this.head;e;){if(e.flushable)this.out+=e.data;else{if(e.error){this.callback(e.error);this.flush=function(){}}return}this.head=e=e.next}this.callback(null,this.out)};J.prototype.flush=function(){for(var e=this.head;e;){if(e.flushable)this.emit("data",e.data);else{if(e.error){this.emit("error",e.error);this.flush=function(){}}return}this.head=e=e.next}this.emit("end")};J.prototype.emit=function(e,j){var k=this.events;k&&k[e]&&
16  
-k[e](j)};J.prototype.on=function(e,j){if(!this.events)this.events={};this.events[e]=j;return this};l.prototype.write=function(e){var j=this.taps;if(j)e=j.go(e);this.data+=e;return this};l.prototype.end=function(e){e&&this.write(e);this.flushable=true;this.root.flush();return this};l.prototype.map=function(e){var j=new l(this.root,this.next,this.taps),k=new l(this.root,j,this.taps);this.next=k;this.flushable=true;e(k);return j};l.prototype.tap=function(e){var j=this.taps;this.taps=j?j.push(e):new G(e);
17  
-return this};l.prototype.untap=function(){this.taps=this.taps.tail;return this};l.prototype.render=function(e,j){return e(this,j)};l.prototype.reference=function(e,j,k,v){if(typeof e==="function"){e=e(this,j,null,{auto:k,filters:v});if(e instanceof l)return e}return o.isEmpty(e)?this:this.write(o.filter(e,k,v))};l.prototype.section=function(e,j,k,v){if(typeof e==="function"){e=e(this,j,k,v);if(e instanceof l)return e}var y=k.block;k=k["else"];if(v)j=j.push(v);if(o.isArray(e)){if(y){v=e.length;k=this;
18  
-for(var E=0;E<v;E++)k=y(k,j.push(e[E],E,v));return k}}else if(e===true){if(y)return y(this,j)}else if(e||e===0){if(y)return y(this,j.push(e))}else if(k)return k(this,j);return this};l.prototype.exists=function(e,j,k){var v=k.block;k=k["else"];if(o.isEmpty(e)){if(k)return k(this,j)}else if(v)return v(this,j);return this};l.prototype.notexists=function(e,j,k){var v=k.block;k=k["else"];if(o.isEmpty(e)){if(v)return v(this,j)}else if(k)return k(this,j);return this};l.prototype.block=function(e,j,k){k=
19  
-k.block;if(e)k=e;if(k)return k(this,j);return this};l.prototype.partial=function(e,j){if(typeof e==="function")return this.capture(e,j,function(k,v){o.load(k,v,j).end()});return o.load(e,this,j)};l.prototype.helper=function(e,j,k,v){return o.helpers[e](this,j,k,v)};l.prototype.capture=function(e,j,k){return this.map(function(v){var y=new q(function(E,K){E?v.setError(E):k(K,v)});e(y.head,j).end()})};l.prototype.setError=function(e){this.error=e;this.root.flush();return this};o.helpers={sep:function(e,
20  
-j,k){if(j.stack.index===j.stack.of-1)return e;return k.block(e,j)},idx:function(e,j,k){return k.block(e,j.push(j.stack.index))}};G.prototype.push=function(e){return new G(e,this)};G.prototype.go=function(e){for(var j=this;j;){e=j.head(e);j=j.tail}return e};var r=/[&<>\"]/,n=/&/g,x=/</g,w=/>/g,z=/\"/g;o.escapeHtml=function(e){if(typeof e==="string"){if(!r.test(e))return e;return e.replace(n,"&amp;").replace(x,"&lt;").replace(w,"&gt;").replace(z,"&quot;")}return e};var C=/\\/g,D=/\r/g,O=/\u2028/g,L=
21  
-/\u2029/g,U=/\n/g,I=/\f/g,P=/'/g,S=/"/g,T=/\t/g;o.escapeJs=function(e){if(typeof e==="string")return e.replace(C,"\\\\").replace(S,'\\"').replace(P,"\\'").replace(D,"\\r").replace(O,"\\u2028").replace(L,"\\u2029").replace(U,"\\n").replace(I,"\\f").replace(T,"\\t");return e}})(dust);if(typeof exports!=="undefined"){require("./server")(dust);module.exports=dust}
22  
-(function(o){function A(r,n){for(var x=[n[0]],w=1,z=n.length;w<z;w++){var C=o.filterNode(r,n[w]);C&&x.push(C)}return x}function H(r,n){return n}function q(){}function J(r,n,x){return"."+x+"("+o.compileNode(r,n[1])+","+o.compileNode(r,n[2])+","+o.compileNode(r,n[4])+","+o.compileNode(r,n[3])+")"}o.compile=function(r,n){var x,w=o.parse(r);x=o.filterNode({},w);w={name:n,bodies:[],blocks:{},index:0,auto:"h"};x="(function(){dust.register("+(n?'"'+n+'"':"null")+","+o.compileNode(w,x)+");";var z;var C=[],
23  
-D=w.blocks;for(z in D)C.push(z+":"+D[z]);if(C.length){w.blocks="ctx=ctx.shiftBlocks(blocks);";z="var blocks={"+C.join(",")+"};"}else z=w.blocks="";z=x+z;x=[];C=w.bodies;w=w.blocks;D=0;for(var O=C.length;D<O;D++)x[D]="function body_"+D+"(chk,ctx){"+w+"return chk"+C[D]+";}";w=x.join("");return z+w+"return body_0;})();"};o.filterNode=function(r,n){return o.optimizers[n[0]](r,n)};o.optimizers={body:function(r,n){for(var x=[n[0]],w,z=1,C=n.length;z<C;z++){var D=o.filterNode(r,n[z]);if(D)if(D[0]==="buffer")if(w)w[1]+=
24  
-D[1];else{w=D;x.push(D)}else{w=null;x.push(D)}}return x},buffer:H,special:function(r,n){return["buffer",l[n[1]]]},format:q,reference:A,"#":A,"?":A,"^":A,"<":A,"+":A,"@":A,partial:A,context:A,params:A,bodies:A,param:A,filters:H,key:H,path:H,literal:H,comment:q};var l={s:" ",n:"\n",r:"\r",lb:"{",rb:"}"};o.compileNode=function(r,n){return o.nodes[n[0]](r,n)};o.nodes={body:function(r,n){for(var x=r.index++,w="body_"+x,z="",C=1,D=n.length;C<D;C++)z+=o.compileNode(r,n[C]);r.bodies[x]=z;return w},buffer:function(r,
25  
-n){return".write("+G(n[1])+")"},format:function(r,n){return".write("+G(n[1]+n[2])+")"},reference:function(r,n){return".reference("+o.compileNode(r,n[1])+",ctx,"+o.compileNode(r,n[2])+")"},"#":function(r,n){return J(r,n,"section")},"?":function(r,n){return J(r,n,"exists")},"^":function(r,n){return J(r,n,"notexists")},"<":function(r,n){for(var x=n[4],w=1,z=x.length;w<z;w++){var C=x[w];if(C[1][1]==="block"){r.blocks[n[1].text]=o.compileNode(r,C[2]);break}}return""},"+":function(r,n){return".block(ctx.getBlock("+
26  
-G(n[1].text)+"),"+o.compileNode(r,n[2])+","+o.compileNode(r,n[4])+","+o.compileNode(r,n[3])+")"},"@":function(r,n){return".helper("+G(n[1].text)+","+o.compileNode(r,n[2])+","+o.compileNode(r,n[4])+","+o.compileNode(r,n[3])+")"},partial:function(r,n){return".partial("+o.compileNode(r,n[1])+","+o.compileNode(r,n[2])+")"},context:function(r,n){if(n[1])return"ctx.rebase("+o.compileNode(r,n[1])+")";return"ctx"},params:function(r,n){for(var x=[],w=1,z=n.length;w<z;w++)x.push(o.compileNode(r,n[w]));if(x.length)return"{"+
27  
-x.join(",")+"}";return"null"},bodies:function(r,n){for(var x=[],w=1,z=n.length;w<z;w++)x.push(o.compileNode(r,n[w]));return"{"+x.join(",")+"}"},param:function(r,n){return o.compileNode(r,n[1])+":"+o.compileNode(r,n[2])},filters:function(r,n){for(var x=[],w=1,z=n.length;w<z;w++)x.push('"'+n[w]+'"');return'"'+r.auto+'",['+x.join(",")+"]"},key:function(r,n){return'ctx.get("'+n[1]+'")'},path:function(r,n){for(var x=n[1],w=n[2],z=[],C=0,D=w.length;C<D;C++)z.push('"'+w[C]+'"');return"ctx.getPath("+x+",["+
28  
-z.join(",")+"])"},literal:function(r,n){return G(n[1])}};var G=typeof JSON==="undefined"?function(r){return'"'+o.escapeJs(r)+'"'}:JSON.stringify})(typeof exports!=="undefined"?exports:window.dust);
29  
-(function(o){var A=function(){var H={parse:function(q){function J(p){return'"'+p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\n/g,"\\n")+'"'}function l(p){if(!(a<Q)){if(a>Q){Q=a;V=[]}V.push(p)}}function G(){var p="body@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=[];for(var c=r();c!==null;){b.push(c);c=r()}b=b!==null?["body"].concat(b):null;u[p]={nextPos:a,result:b};return b}function r(){var p="part@"+a,b=u[p];
30  
-if(b){a=b.nextPos;return b.result}b=j();if(b!==null)b=b;else{b=n();if(b!==null)b=b;else{b="partial@"+a;var c=u[b];if(c){a=c.nextPos;b=c.result}else{c=h;h=false;var d=a,g=v();if(g!==null){if(q.substr(a,1)===">"){var f=">";a+=1}else{f=null;h&&l('">"')}if(f!==null){var i=I();i=i!==null?["literal",i]:null;if(i!==null)i=i;else{i=P();i=i!==null?i:null}if(i!==null){var m=z();if(m!==null){if(q.substr(a,1)==="/"){var s="/";a+=1}else{s=null;h&&l('"/"')}if(s!==null){var t=y();if(t!==null)g=[g,f,i,m,s,t];else{g=
31  
-null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["partial",g[2],g[3]]:null;(h=c)&&d===null&&l("partial");u[b]={nextPos:a,result:d};b=d}if(b!==null)b=b;else{b=O();if(b!==null)b=b;else{b=D();if(b!==null)b=b;else{b="buffer@"+a;if(c=u[b]){a=c.nextPos;b=c.result}else{c=h;h=false;d=a;g=E();if(g!==null){f=[];for(i=K();i!==null;){f.push(i);i=K()}if(f!==null)g=[g,f];else{g=null;a=d}}else{g=null;a=d}d=g!==null?["format",g[0],g[1].join("")]:null;if(d!==
32  
-null)d=d;else{i=g=a;f=h;h=false;m=k();h=f;if(m===null)f="";else{f=null;a=i}if(f!==null){m=a;i=h;h=false;s=E();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;t=j();h=s;if(t===null)s="";else{s=null;a=m}if(s!==null){if(q.length>a){m=q.charAt(a);a++}else{m=null;h&&l("any character")}if(m!==null)f=[f,i,s,m];else{f=null;a=g}}else{f=null;a=g}}else{f=null;a=g}}else{f=null;a=g}g=f!==null?f[3]:null;if(g!==null)for(d=[];g!==null;){d.push(g);i=g=a;f=h;h=false;m=k();h=f;if(m===null)f="";else{f=
33  
-null;a=i}if(f!==null){m=a;i=h;h=false;s=E();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;t=j();h=s;if(t===null)s="";else{s=null;a=m}if(s!==null){if(q.length>a){m=q.charAt(a);a++}else{m=null;h&&l("any character")}if(m!==null)f=[f,i,s,m];else{f=null;a=g}}else{f=null;a=g}}else{f=null;a=g}}else{f=null;a=g}g=f!==null?f[3]:null}else d=null;d=d!==null?["buffer",d.join("")]:null;d=d!==null?d:null}(h=c)&&d===null&&l("buffer");u[b]={nextPos:a,result:d};b=d}b=b!==null?b:null}}}}}u[p]={nextPos:a,
34  
-result:b};return b}function n(){var p="section@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=x();if(d!==null){var g=y();if(g!==null){var f=G();if(f!==null){var i=C();if(i!==null){var m=w();if(m!==null){var s=d[1].text===m.text?"":null;if(s!==null)d=[d,g,f,i,m,s];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(t,B,M){M.push(["param",["literal","block"],B]);t.push(M);return t}(d[0],d[2],d[3],d[4]):null;if(c!==
35  
-null)c=c;else{c=a;d=x();if(d!==null){if(q.substr(a,1)==="/"){g="/";a+=1}else{g=null;h&&l('"/"')}if(g!==null){f=y();if(f!==null)d=[d,g,f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(t){t.push(["bodies"]);return t}(d[0]):null;c=c!==null?c:null}(h=b)&&c===null&&l("section");u[p]={nextPos:a,result:c};return c}function x(){var p="sec_tag_start@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=a;var c=v();if(c!==null){if(q.substr(a).match(/^[#?^<+@]/)!==null){var d=q.charAt(a);a++}else{d=
36  
-null;h&&l("[#?^<+@]")}if(d!==null){var g=L();if(g!==null){var f=z();if(f!==null){var i;i="params@"+a;var m=u[i];if(m){a=m.nextPos;i=m.result}else{m=h;h=false;var s=[],t=a,B=K();if(B!==null){var M=I();if(M!==null){if(q.substr(a,1)==="="){var N="=";a+=1}else{N=null;h&&l('"="')}if(N!==null){var F=L();if(F!==null)F=F;else{F=P();F=F!==null?F:null}if(F!==null)B=[B,M,N,F];else{B=null;a=t}}else{B=null;a=t}}else{B=null;a=t}}else{B=null;a=t}for(t=B!==null?["param",["literal",B[1]],B[3]]:null;t!==null;){s.push(t);
37  
-t=a;B=K();if(B!==null){M=I();if(M!==null){if(q.substr(a,1)==="="){N="=";a+=1}else{N=null;h&&l('"="')}if(N!==null){F=L();if(F!==null)F=F;else{F=P();F=F!==null?F:null}if(F!==null)B=[B,M,N,F];else{B=null;a=t}}else{B=null;a=t}}else{B=null;a=t}}else{B=null;a=t}t=B!==null?["param",["literal",B[1]],B[3]]:null}s=s!==null?["params"].concat(s):null;(h=m)&&s===null&&l("params");u[i]={nextPos:a,result:s};i=s}if(i!==null)c=[c,d,g,f,i];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=
38  
-null;a=b}b=c!==null?[c[1],c[2],c[3],c[4]]:null;u[p]={nextPos:a,result:b};return b}function w(){var p="end_tag@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=v();if(d!==null){if(q.substr(a,1)==="/"){var g="/";a+=1}else{g=null;h&&l('"/"')}if(g!==null){var f=L();if(f!==null){var i=y();if(i!==null)d=[d,g,f,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?d[2]:null;(h=b)&&c===null&&l("end tag");u[p]={nextPos:a,result:c};return c}function z(){var p="context@"+
39  
-a,b=u[p];if(b){a=b.nextPos;return b.result}b=a;if(q.substr(a,1)===":"){var c=":";a+=1}else{c=null;h&&l('":"')}if(c!==null){var d=L();if(d!==null)c=[c,d];else{c=null;a=b}}else{c=null;a=b}b=c!==null?c[1]:null;b=b!==null?b:"";b=b!==null?b?["context",b]:["context"]:null;u[p]={nextPos:a,result:b};return b}function C(){var p="bodies@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=[],d=a,g=v();if(g!==null){if(q.substr(a,1)===":"){var f=":";a+=1}else{f=null;h&&l('":"')}if(f!==null){var i=I();
40  
-if(i!==null){var m=y();if(m!==null){var s=G();if(s!==null)g=[g,f,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}for(d=g!==null?["param",["literal",g[2]],g[4]]:null;d!==null;){c.push(d);d=a;g=v();if(g!==null){if(q.substr(a,1)===":"){f=":";a+=1}else{f=null;h&&l('":"')}if(f!==null){i=I();if(i!==null){m=y();if(m!==null){s=G();if(s!==null)g=[g,f,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["param",["literal",
41  
-g[2]],g[4]]:null}c=c!==null?["bodies"].concat(c):null;(h=b)&&c===null&&l("bodies");u[p]={nextPos:a,result:c};return c}function D(){var p="reference@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=v();if(d!==null){var g=L();if(g!==null){var f;f="filters@"+a;var i=u[f];if(i){a=i.nextPos;f=i.result}else{i=h;h=false;var m=[],s=a;if(q.substr(a,1)==="|"){var t="|";a+=1}else{t=null;h&&l('"|"')}if(t!==null){var B=I();if(B!==null)t=[t,B];else{t=null;a=s}}else{t=null;a=s}for(s=t!==null?t[1]:
42  
-null;s!==null;){m.push(s);s=a;if(q.substr(a,1)==="|"){t="|";a+=1}else{t=null;h&&l('"|"')}if(t!==null){B=I();if(B!==null)t=[t,B];else{t=null;a=s}}else{t=null;a=s}s=t!==null?t[1]:null}m=m!==null?["filters"].concat(m):null;(h=i)&&m===null&&l("filters");u[f]={nextPos:a,result:m};f=m}if(f!==null){i=y();if(i!==null)d=[d,g,f,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["reference",d[1],d[2]]:null;(h=b)&&c===null&&l("reference");u[p]={nextPos:a,result:c};return c}function O(){var p=
43  
-"special@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=v();if(d!==null){if(q.substr(a,1)==="~"){var g="~";a+=1}else{g=null;h&&l('"~"')}if(g!==null){var f=I();if(f!==null){var i=y();if(i!==null)d=[d,g,f,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["special",d[2]]:null;(h=b)&&c===null&&l("special");u[p]={nextPos:a,result:c};return c}function L(){var p="identifier@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=U();c=c!==null?W(["path"].concat(c),
44  
-p):null;if(c!==null)c=c;else{c=I();c=c!==null?W(["key",c],p):null;c=c!==null?c:null}(h=b)&&c===null&&l("identifier");u[p]={nextPos:a,result:c};return c}function U(){var p="path@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=I();d=d!==null?d:"";if(d!==null){var g=a;if(q.substr(a,1)==="."){var f=".";a+=1}else{f=null;h&&l('"."')}if(f!==null){var i=I();if(i!==null)f=[f,i];else{f=null;a=g}}else{f=null;a=g}g=f!==null?f[1]:null;if(g!==null)for(var m=[];g!==null;){m.push(g);g=a;if(q.substr(a,
45  
-1)==="."){f=".";a+=1}else{f=null;h&&l('"."')}if(f!==null){i=I();if(i!==null)f=[f,i];else{f=null;a=g}}else{f=null;a=g}g=f!==null?f[1]:null}else m=null;if(m!==null)d=[d,m];else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(s,t){if(s){t.unshift(s);return[false,t]}return[true,t]}(d[0],d[1]):null;if(c!==null)c=c;else{if(q.substr(a,1)==="."){c=".";a+=1}else{c=null;h&&l('"."')}c=c!==null?[true,[]]:null;c=c!==null?c:null}(h=b)&&c===null&&l("path");u[p]={nextPos:a,result:c};return c}function I(){var p="key@"+
46  
-a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(q.substr(a).match(/^[a-zA-Z_$]/)!==null){var d=q.charAt(a);a++}else{d=null;h&&l("[a-zA-Z_$]")}if(d!==null){var g=[];if(q.substr(a).match(/^[0-9a-zA-Z_$]/)!==null){var f=q.charAt(a);a++}else{f=null;h&&l("[0-9a-zA-Z_$]")}for(;f!==null;){g.push(f);if(q.substr(a).match(/^[0-9a-zA-Z_$]/)!==null){f=q.charAt(a);a++}else{f=null;h&&l("[0-9a-zA-Z_$]")}}if(g!==null)d=[d,g];else{d=null;a=c}}else{d=null;a=c}c=d!==null?d[0]+d[1].join(""):null;(h=
47  
-b)&&c===null&&l("key");u[p]={nextPos:a,result:c};return c}function P(){var p="inline@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(q.substr(a,1)==='"'){var d='"';a+=1}else{d=null;h&&l('"\\""')}if(d!==null){if(q.substr(a,1)==='"'){var g='"';a+=1}else{g=null;h&&l('"\\""')}if(g!==null)d=[d,g];else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",""]:null;if(c!==null)c=c;else{c=a;if(q.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&l('"\\""')}if(d!==null){g=T();if(g!==null){if(q.substr(a,
48  
-1)==='"'){var f='"';a+=1}else{f=null;h&&l('"\\""')}if(f!==null)d=[d,g,f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",d[1]]:null;if(c!==null)c=c;else{c=a;if(q.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&l('"\\""')}if(d!==null){f=S();if(f!==null)for(g=[];f!==null;){g.push(f);f=S()}else g=null;if(g!==null){if(q.substr(a,1)==='"'){f='"';a+=1}else{f=null;h&&l('"\\""')}if(f!==null)d=[d,g,f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["body"].concat(d[1]):null;
49  
-c=c!==null?c:null}}(h=b)&&c===null&&l("inline");u[p]={nextPos:a,result:c};return c}function S(){var p="inline_part@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=O();if(b!==null)b=b;else{b=D();if(b!==null)b=b;else{b=T();b=b!==null?["buffer",b]:null;b=b!==null?b:null}}u[p]={nextPos:a,result:b};return b}function T(){var p="literal@"+a,b=u[p];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=a,g=h;h=false;var f=k();h=g;if(f===null)g="";else{g=null;a=d}if(g!==null){f=a;d=h;h=false;var i=E();h=d;
50  
-if(i===null)d="";else{d=null;a=f}if(d!==null){f=e();if(f!==null)f=f;else{if(q.substr(a).match(/^[^"]/)!==null){f=q.charAt(a);a++}else{f=null;h&&l('[^"]')}f=f!==null?f:null}if(f!==null)g=[g,d,f];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null;if(c!==null)for(var m=[];c!==null;){m.push(c);d=c=a;g=h;h=false;f=k();h=g;if(f===null)g="";else{g=null;a=d}if(g!==null){f=a;d=h;h=false;i=E();h=d;if(i===null)d="";else{d=null;a=f}if(d!==null){f=e();if(f!==null)f=f;else{if(q.substr(a).match(/^[^"]/)!==
51  
-null){f=q.charAt(a);a++}else{f=null;h&&l('[^"]')}f=f!==null?f:null}if(f!==null)g=[g,d,f];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null}else m=null;m=m!==null?m.join(""):null;(h=b)&&m===null&&l("literal");u[p]={nextPos:a,result:m};return m}function e(){var p="esc@"+a,b=u[p];if(b){a=b.nextPos;return b.result}if(q.substr(a,2)==='\\"'){b='\\"';a+=2}else{b=null;h&&l('"\\\\\\""')}b=b!==null?'"':null;u[p]={nextPos:a,result:b};return b}function j(){var p="comment@"+a,b=u[p];if(b){a=
52  
-b.nextPos;return b.result}b=h;h=false;var c=a;if(q.substr(a,2)==="{!"){var d="{!";a+=2}else{d=null;h&&l('"{!"')}if(d!==null){var g=[],f=a,i=a,m=h;h=false;if(q.substr(a,2)==="!}"){var s="!}";a+=2}else{s=null;h&&l('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(q.length>a){i=q.charAt(a);a++}else{i=null;h&&l("any character")}if(i!==null)i=[m,i];else{i=null;a=f}}else{i=null;a=f}for(f=i!==null?i[1]:null;f!==null;){g.push(f);i=f=a;m=h;h=false;if(q.substr(a,2)==="!}"){s="!}";a+=2}else{s=null;
53  
-h&&l('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(q.length>a){i=q.charAt(a);a++}else{i=null;h&&l("any character")}if(i!==null)i=[m,i];else{i=null;a=f}}else{i=null;a=f}f=i!==null?i[1]:null}if(g!==null){if(q.substr(a,2)==="!}"){f="!}";a+=2}else{f=null;h&&l('"!}"')}if(f!==null)d=[d,g,f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["comment",d[1].join("")]:null;(h=b)&&c===null&&l("comment");u[p]={nextPos:a,result:c};return c}function k(){var p="tag@"+a,b=u[p];if(b){a=
54  
-b.nextPos;return b.result}b=a;var c=v();if(c!==null){if(q.substr(a).match(/^[#?^><+%:@\/~]/)!==null){var d=q.charAt(a);a++}else{d=null;h&&l("[#?^><+%:@\\/~]")}if(d!==null){var g=a,f=a,i=h;h=false;var m=y();h=i;if(m===null)i="";else{i=null;a=f}if(i!==null){f=a;m=h;h=false;var s=E();h=m;if(s===null)m="";else{m=null;a=f}if(m!==null){if(q.length>a){f=q.charAt(a);a++}else{f=null;h&&l("any character")}if(f!==null)i=[i,m,f];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}if(i!==null)for(var t=[];i!==null;){t.push(i);
55  
-f=g=a;i=h;h=false;m=y();h=i;if(m===null)i="";else{i=null;a=f}if(i!==null){f=a;m=h;h=false;s=E();h=m;if(s===null)m="";else{m=null;a=f}if(m!==null){if(q.length>a){f=q.charAt(a);a++}else{f=null;h&&l("any character")}if(f!==null)i=[i,m,f];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}}else t=null;if(t!==null){g=y();if(g!==null)c=[c,d,t,g];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}if(c!==null)b=c;else{b=D();b=b!==null?b:null}u[p]={nextPos:a,result:b};return b}function v(){var p=
56  
-"ld@"+a,b=u[p];if(b){a=b.nextPos;return b.result}if(q.substr(a,1)==="{"){b="{";a+=1}else{b=null;h&&l('"{"')}u[p]={nextPos:a,result:b};return b}function y(){var p="rd@"+a,b=u[p];if(b){a=b.nextPos;return b.result}if(q.substr(a,1)==="}"){b="}";a+=1}else{b=null;h&&l('"}"')}u[p]={nextPos:a,result:b};return b}function E(){var p="eol@"+a,b=u[p];if(b){a=b.nextPos;return b.result}if(q.substr(a,1)==="\n"){b="\n";a+=1}else{b=null;h&&l('"\\n"')}if(b!==null)b=b;else{if(q.substr(a,2)==="\r\n"){b="\r\n";a+=2}else{b=
57  
-null;h&&l('"\\r\\n"')}if(b!==null)b=b;else{if(q.substr(a,1)==="\r"){b="\r";a+=1}else{b=null;h&&l('"\\r"')}if(b!==null)b=b;else{if(q.substr(a,1)==="\u2028"){b="\u2028";a+=1}else{b=null;h&&l('"\\u2028"')}if(b!==null)b=b;else{if(q.substr(a,1)==="\u2029"){b="\u2029";a+=1}else{b=null;h&&l('"\\u2029"')}b=b!==null?b:null}}}}u[p]={nextPos:a,result:b};return b}function K(){var p="ws@"+a,b=u[p];if(b){a=b.nextPos;return b.result}if(q.substr(a).match(/^[\t\u000b\u000c \u00a0\ufeff]/)!==null){b=q.charAt(a);a++}else{b=
58  
-null;h&&l("[\t\u000b\u000c \u00a0\ufeff]")}u[p]={nextPos:a,result:b};return b}function X(){var p=function(c){c.sort();for(var d=null,g=[],f=0;f<c.length;f++)if(c[f]!==d){g.push(c[f]);d=c[f]}switch(g.length){case 0:return"end of input";case 1:return g[0];default:return g.slice(0,g.length-1).join(", ")+" or "+g[g.length-1]}}(V),b=Math.max(a,Q);b=b<q.length?J(q.charAt(b)):"end of input";return"Expected "+p+" but "+b+" found."}function Y(){for(var p=1,b=1,c=false,d=0;d<Q;d++){var g=q.charAt(d);if(g===
59  
-"\n"){c||p++;b=1;c=false}else if(g==="\r"|g==="\u2028"||g==="\u2029"){p++;b=1;c=true}else{b++;c=false}}return{line:p,column:b}}function W(p,b){p.text=q.substring(b.split("@")[1],a);return p}var a=0,h=true,Q=0,V=[],u={},R=G();if(R===null||a!==q.length){R=Y();throw new SyntaxError(X(),R.line,R.column);}return R},toSource:function(){return this._source}};H.SyntaxError=function(q,J,l){this.name="SyntaxError";this.message=q;this.line=J;this.column=l};H.SyntaxError.prototype=Error.prototype;return H}();
60  
-o.parse=A.parse})(typeof exports!=="undefined"?exports:window.dust);
140  dist/dust-full-0.2.5.js → dist/dust-full-0.3.0.js
... ...
@@ -1,5 +1,5 @@
1 1
 //
2  
-// Dust - Asynchronous Templating v0.2.5
  2
+// Dust - Asynchronous Templating v0.3.0
3 3
 // http://akdubya.github.com/dustjs
4 4
 //
5 5
 // Copyright (c) 2010, Aleksander Williams
@@ -86,14 +86,14 @@ dust.isEmpty = function(value) {
86 86
 };
87 87
 
88 88
 dust.filter = function(string, auto, filters) {
89  
-  var len = filters.length;
90  
-
91  
-  for (var i=0; i<len; i++) {
92  
-    var name = filters[i];
93  
-    if (name === "s") {
94  
-      auto = null;
95  
-    } else {
96  
-      string = dust.filters[name](string);
  89
+  if (filters) {
  90
+    for (var i=0, len=filters.length; i<len; i++) {
  91
+      var name = filters[i];
  92
+      if (name === "s") {
  93
+        auto = null;
  94
+      } else {
  95
+        string = dust.filters[name](string);
  96
+      }
97 97
     }
98 98
   }
99 99
   if (auto) {
@@ -103,16 +103,9 @@ dust.filter = function(string, auto, filters) {
103 103
 };
104 104
 
105 105
 dust.filters = {
106  
-  h: function(value) {
107  
-    return dust.escapeHtml(value);
108  
-  },
109  
-
110  
-  j: function(value) {
111  
-    return dust.escapeJs(value);
112  
-  },
113  
-
  106
+  h: function(value) { return dust.escapeHtml(value); },
  107
+  j: function(value) { return dust.escapeJs(value); },
114 108
   u: encodeURI,
115  
-
116 109
   uc: encodeURIComponent
117 110
 }
118 111
 
@@ -477,7 +470,7 @@ Tap.prototype.go = function(value) {
477 470
   return value;
478 471
 };
479 472
 
480  
-var HCHARS = /[&<>\"]/,
  473
+var HCHARS = new RegExp(/[&<>\"]/),
481 474
     AMP    = /&/g,
482 475
     LT     = /</g,
483 476
     GT     = />/g,
@@ -522,7 +515,9 @@ dust.escapeJs = function(s) {
522 515
 })(dust);
523 516
 
524 517
 if (typeof exports !== "undefined") {
525  
-  require('./server')(dust);
  518
+  if (typeof process !== "undefined") {
  519
+      require('./server')(dust);
  520
+  }
526 521
   module.exports = dust;
527 522
 }
528 523
 (function(dust) {
@@ -553,6 +548,7 @@ dust.optimizers = {
553 548
   "<":       visit,
554 549
   "+":       visit,
555 550
   "@":       visit,
  551
+  "%":       visit,
556 552
   partial:   visit,
557 553
   context:   visit,
558 554
   params:    visit,
@@ -565,6 +561,17 @@ dust.optimizers = {
565 561
   comment:   nullify
566 562
 }
567 563
 
  564
+dust.pragmas = {
  565
+  esc: function(compiler, context, bodies, params) {
  566
+    var old = compiler.auto;
  567
+    if (!context) context = 'h';
  568
+    compiler.auto = (context === 's') ? '' : context;
  569
+    var out = compileParts(compiler, bodies.block);
  570
+    compiler.auto = old;
  571
+    return out;
  572
+  }
  573
+}
  574
+
568 575
 function visit(context, node) {
569 576
   var out = [node[0]];
570 577
   for (var i=1, len=node.length; i<len; i++) {
@@ -653,20 +660,22 @@ function compileBodies(context) {
653 660
   return out.join('');
654 661
 }
655 662
 
  663
+function compileParts(context, body) {
  664
+  var parts = '';
  665
+  for (var i=1, len=body.length; i<len; i++) {
  666
+    parts += dust.compileNode(context, body[i]);
  667
+  }
  668
+  return parts;
  669
+}
  670
+
656 671
 dust.compileNode = function(context, node) {
657 672
   return dust.nodes[node[0]](context, node);
658 673
 }
659 674
 
660 675
 dust.nodes = {
661 676
   body: function(context, node) {
662  
-    var id = context.index++,
663  
-        name = "body_" + id,
664  
-        parts = '';
665  
-
666  
-    for (var i=1, len=node.length; i<len; i++) {
667  
-      parts += dust.compileNode(context, node[i]);
668  
-    }
669  
-    context.bodies[id] = parts;
  677
+    var id = context.index++, name = "body_" + id;
  678
+    context.bodies[id] = compileParts(context, node);
670 679
     return name;
671 680
   },
672 681
 
@@ -726,6 +735,30 @@ dust.nodes = {
726 735
       + ")";
727 736
   },
728 737
 
  738
+  "%": function(context, node) {
  739
+    // TODO: Move these hacks into pragma precompiler
  740
+    var name = node[1][1];
  741
+    if (!dust.pragmas[name]) return '';
  742
+
  743
+    var rawBodies = node[4];
  744
+    var bodies = {};
  745
+    for (var i=1, len=rawBodies.length; i<len; i++) {
  746
+      var b = rawBodies[i];
  747
+      bodies[b[1][1]] = b[2];
  748
+    }
  749
+
  750
+    var rawParams = node[3];
  751
+    var params = {};
  752
+    for (var i=1, len=rawParams.length; i<len; i++) {
  753
+      var p = rawParams[i];
  754
+      params[p[1][1]] = p[2][1];
  755
+    }
  756
+
  757
+    var ctx = node[2][1] ? node[2][1].text : null;
  758
+
  759
+    return dust.pragmas[name](context, ctx, bodies, params);
  760
+  },
  761
+
729 762
   partial: function(context, node) {
730 763
     return ".partial("
731 764
       + dust.compileNode(context, node[1])
@@ -768,7 +801,8 @@ dust.nodes = {
768 801
       var filter = node[i];
769 802
       list.push("\"" + filter + "\"");
770 803
     }
771  
-    return "\"" + context.auto + "\",[" + list.join(',') + "]";
  804
+    return "\"" + context.auto + "\""
  805
+      + (list.length ? ",[" + list.join(',') + "]" : '');
772 806
   },
773 807
 
774 808
   key: function(context, node) {
@@ -824,6 +858,31 @@ var parser = (function(){
824 858
       var rightmostMatchFailuresExpected = [];
825 859
       var cache = {};
826 860
       
  861
+      function padLeft(input, padding, length) {
  862
+        var result = input;
  863
+        
  864
+        var padLength = length - input.length;
  865
+        for (var i = 0; i < padLength; i++) {
  866
+          result = padding + result;
  867
+        }
  868
+        
  869
+        return result;
  870
+      }
  871
+      
  872
+      function escape(ch) {
  873
+        var charCode = ch.charCodeAt(0);
  874
+        
  875
+        if (charCode < 0xFF) {
  876
+          var escapeChar = 'x';
  877
+          var length = 2;
  878
+        } else {
  879
+          var escapeChar = 'u';
  880
+          var length = 4;
  881
+        }
  882
+        
  883
+        return '\\' + escapeChar + padLeft(charCode.toString(16).toUpperCase(), '0', length);
  884
+      }
  885
+      
827 886
       function quote(s) {
828 887
         /*
829 888
          * ECMA-262, 5th ed., 7.8.4: All characters may appear literally in a
@@ -832,12 +891,11 @@ var parser = (function(){
832 891
          * Any character may appear in the form of an escape sequence.
833 892
          */
834 893
         return '"' + s
835  
-          .replace(/\\/g, '\\\\')        // backslash
836  
-          .replace(/"/g, '\\"')          // closing quote character
837  
-          .replace(/\r/g, '\\r')         // carriage return
838  
-          .replace(/\u2028/g, '\\u2028') // line separator
839  
-          .replace(/\u2029/g, '\\u2029') // paragraph separator
840  
-          .replace(/\n/g, '\\n')         // line feed
  894
+          .replace(/\\/g, '\\\\')            // backslash
  895
+          .replace(/"/g, '\\"')              // closing quote character
  896
+          .replace(/\r/g, '\\r')             // carriage return
  897
+          .replace(/\n/g, '\\n')             // line feed
  898
+          .replace(/[\x80-\uFFFF]/g, escape) // non-ASCII characters
841 899
           + '"';
842 900
       }
843 901
       
@@ -1047,13 +1105,13 @@ var parser = (function(){
1047 1105
         var savedPos0 = pos;
1048 1106
         var result2 = parse_ld();
1049 1107
         if (result2 !== null) {
1050  
-          if (input.substr(pos).match(/^[#?^<+@]/) !== null) {
  1108
+          if (input.substr(pos).match(/^[#?^<+@%]/) !== null) {
1051 1109
             var result3 = input.charAt(pos);
1052 1110
             pos++;
1053 1111
           } else {
1054 1112
             var result3 = null;
1055 1113
             if (reportMatchFailures) {
1056  
-              matchFailed("[#?^<+@]");
  1114
+              matchFailed("[#?^<+@%]");
1057 1115
             }
1058 1116
           }
1059 1117
           if (result3 !== null) {
@@ -2690,13 +2748,13 @@ var parser = (function(){
2690 2748
         var savedPos0 = pos;
2691 2749
         var result3 = parse_ld();
2692 2750
         if (result3 !== null) {
2693  
-          if (input.substr(pos).match(/^[#?^><+%:@\/~]/) !== null) {
  2751
+          if (input.substr(pos).match(/^[#?^><+%:@\/~%]/) !== null) {
2694 2752
             var result4 = input.charAt(pos);
2695 2753
             pos++;
2696 2754
           } else {
2697 2755
             var result4 = null;
2698 2756
             if (reportMatchFailures) {
2699  
-              matchFailed("[#?^><+%:@\\/~]");
  2757
+              matchFailed("[#?^><+%:@\\/~%]");
2700 2758
             }
2701 2759
           }
2702 2760
           if (result4 !== null) {
@@ -2994,13 +3052,13 @@ var parser = (function(){
2994 3052
         }
2995 3053
         
2996 3054
         
2997  
-        if (input.substr(pos).match(/^[	  ]/) !== null) {
  3055
+        if (input.substr(pos).match(/^[	 \xA0\uFEFF]/) !== null) {
2998 3056
           var result0 = input.charAt(pos);
2999 3057
           pos++;
3000 3058
         } else {
3001 3059
           var result0 = null;
3002 3060
           if (reportMatchFailures) {
3003  
-            matchFailed("[	  ]");
  3061
+            matchFailed("[	 \\xA0\\uFEFF]");
3004 3062
           }
3005 3063
         }
3006 3064
         
61  dist/dust-full-0.3.0.min.js
... ...
@@ -0,0 +1,61 @@
  1
+//
  2
+// Dust - Asynchronous Templating v0.3.0
  3
+// http://akdubya.github.com/dustjs
  4
+//
  5
+// Copyright (c) 2010, Aleksander Williams
  6
+// Released under the MIT License.
  7
+//
  8
+
  9
+var dust={};
  10
+(function(o){function z(e,k,l){this.stack=e;this.global=k;this.blocks=l}function H(e,k,l,x){this.tail=k;this.isObject=!o.isArray(e)&&e&&typeof e==="object";this.head=e;this.index=l;this.of=x}function p(e){this.head=new B(this);this.callback=e;this.out=""}function J(){this.head=new B(this)}function B(e,k,l){this.root=e;this.next=k;this.data="";this.flushable=false;this.taps=l}function r(e,k){this.head=e;this.tail=k}o.cache={};o.register=function(e,k){if(e)o.cache[e]=k};o.render=function(e,k,l){l=(new p(l)).head;
  11
+o.load(e,l,z.wrap(k)).end()};o.stream=function(e,k){var l=new J;o.nextTick(function(){o.load(e,l.head,z.wrap(k)).end()});return l};o.renderSource=function(e,k,l){return o.compileFn(e)(k,l)};o.compileFn=function(e,k){var l=o.loadSource(o.compile(e,k));return function(x,C){var E=C?new p(C):new J;o.nextTick(function(){l(E.head,z.wrap(x)).end()});return E}};o.load=function(e,k,l){var x=o.cache[e];if(x)return x(k,l);else{if(o.onLoad)return k.map(function(C){o.onLoad(e,function(E,M){if(E)return C.setError(E);
  12
+o.cache[e]||o.loadSource(o.compile(M,e));o.cache[e](C,l).end()})});return k.setError(Error("Template Not Found: "+e))}};o.loadSource=function(e){return eval(e)};o.isArray=Array.isArray?Array.isArray:function(e){return Object.prototype.toString.call(e)=="[object Array]"};o.nextTick=function(e){setTimeout(e,0)};o.isEmpty=function(e){if(o.isArray(e)&&!e.length)return true;if(e===0)return false;return!e};o.filter=function(e,k,l){if(l)for(var x=0,C=l.length;x<C;x++){var E=l[x];if(E==="s")k=null;else e=
  13
+o.filters[E](e)}if(k)e=o.filters[k](e);return e};o.filters={h:function(e){return o.escapeHtml(e)},j:function(e){return o.escapeJs(e)},u:encodeURI,uc:encodeURIComponent};o.makeBase=function(e){return new z(new H,e)};z.wrap=function(e){if(e instanceof z)return e;return new z(new H(e))};z.prototype.get=function(e){for(var k=this.stack,l;k;){if(k.isObject){l=k.head[e];if(l!==undefined)return l}k=k.tail}return this.global?this.global[e]:undefined};z.prototype.getPath=function(e,k){var l=this.stack,x=k.length;
  14
+if(e&&x===0)return l.head;if(l.isObject){l=l.head;for(var C=0;l&&C<x;){l=l[k[C]];C++}return l}};z.prototype.push=function(e,k,l){return new z(new H(e,this.stack,k,l),this.global,this.blocks)};z.prototype.rebase=function(e){return new z(new H(e),this.global,this.blocks)};z.prototype.current=function(){return this.stack.head};z.prototype.getBlock=function(e){var k=this.blocks;if(k)for(var l=k.length,x;l--;)if(x=k[l][e])return x};z.prototype.shiftBlocks=function(e){var k=this.blocks;if(e){newBlocks=
  15
+k?k.concat([e]):[e];return new z(this.stack,this.global,newBlocks)}return this};p.prototype.flush=function(){for(var e=this.head;e;){if(e.flushable)this.out+=e.data;else{if(e.error){this.callback(e.error);this.flush=function(){}}return}this.head=e=e.next}this.callback(null,this.out)};J.prototype.flush=function(){for(var e=this.head;e;){if(e.flushable)this.emit("data",e.data);else{if(e.error){this.emit("error",e.error);this.flush=function(){}}return}this.head=e=e.next}this.emit("end")};J.prototype.emit=
  16
+function(e,k){var l=this.events;l&&l[e]&&l[e](k)};J.prototype.on=function(e,k){if(!this.events)this.events={};this.events[e]=k;return this};B.prototype.write=function(e){var k=this.taps;if(k)e=k.go(e);this.data+=e;return this};B.prototype.end=function(e){e&&this.write(e);this.flushable=true;this.root.flush();return this};B.prototype.map=function(e){var k=new B(this.root,this.next,this.taps),l=new B(this.root,k,this.taps);this.next=l;this.flushable=true;e(l);return k};B.prototype.tap=function(e){var k=
  17
+this.taps;this.taps=k?k.push(e):new r(e);return this};B.prototype.untap=function(){this.taps=this.taps.tail;return this};B.prototype.render=function(e,k){return e(this,k)};B.prototype.reference=function(e,k,l,x){if(typeof e==="function"){e=e(this,k,null,{auto:l,filters:x});if(e instanceof B)return e}return o.isEmpty(e)?this:this.write(o.filter(e,l,x))};B.prototype.section=function(e,k,l,x){if(typeof e==="function"){e=e(this,k,l,x);if(e instanceof B)return e}var C=l.block;l=l["else"];if(x)k=k.push(x);
  18
+if(o.isArray(e)){if(C){x=e.length;l=this;for(var E=0;E<x;E++)l=C(l,k.push(e[E],E,x));return l}}else if(e===true){if(C)return C(this,k)}else if(e||e===0){if(C)return C(this,k.push(e))}else if(l)return l(this,k);return this};B.prototype.exists=function(e,k,l){var x=l.block;l=l["else"];if(o.isEmpty(e)){if(l)return l(this,k)}else if(x)return x(this,k);return this};B.prototype.notexists=function(e,k,l){var x=l.block;l=l["else"];if(o.isEmpty(e)){if(x)return x(this,k)}else if(l)return l(this,k);return this};
  19
+B.prototype.block=function(e,k,l){l=l.block;if(e)l=e;if(l)return l(this,k);return this};B.prototype.partial=function(e,k){if(typeof e==="function")return this.capture(e,k,function(l,x){o.load(l,x,k).end()});return o.load(e,this,k)};B.prototype.helper=function(e,k,l,x){return o.helpers[e](this,k,l,x)};B.prototype.capture=function(e,k,l){return this.map(function(x){var C=new p(function(E,M){E?x.setError(E):l(M,x)});e(C.head,k).end()})};B.prototype.setError=function(e){this.error=e;this.root.flush();
  20
+return this};o.helpers={sep:function(e,k,l){if(k.stack.index===k.stack.of-1)return e;return l.block(e,k)},idx:function(e,k,l){return l.block(e,k.push(k.stack.index))}};r.prototype.push=function(e){return new r(e,this)};r.prototype.go=function(e){for(var k=this;k;){e=k.head(e);k=k.tail}return e};var K=RegExp(/[&<>\"]/),q=/&/g,j=/</g,w=/>/g,t=/\"/g;o.escapeHtml=function(e){if(typeof e==="string"){if(!K.test(e))return e;return e.replace(q,"&amp;").replace(j,"&lt;").replace(w,"&gt;").replace(t,"&quot;")}return e};
  21
+var y=/\\/g,A=/\r/g,F=/\u2028/g,L=/\u2029/g,N=/\n/g,V=/\f/g,I=/'/g,Q=/"/g,T=/\t/g;o.escapeJs=function(e){if(typeof e==="string")return e.replace(y,"\\\\").replace(Q,'\\"').replace(I,"\\'").replace(A,"\\r").replace(F,"\\u2028").replace(L,"\\u2029").replace(N,"\\n").replace(V,"\\f").replace(T,"\\t");return e}})(dust);if(typeof exports!=="undefined"){typeof process!=="undefined"&&require("./server")(dust);module.exports=dust}
  22
+(function(o){function z(q,j){for(var w=[j[0]],t=1,y=j.length;t<y;t++){var A=o.filterNode(q,j[t]);A&&w.push(A)}return w}function H(q,j){return j}function p(){}function J(q,j){for(var w="",t=1,y=j.length;t<y;t++)w+=o.compileNode(q,j[t]);return w}function B(q,j,w){return"."+w+"("+o.compileNode(q,j[1])+","+o.compileNode(q,j[2])+","+o.compileNode(q,j[4])+","+o.compileNode(q,j[3])+")"}o.compile=function(q,j){var w,t=o.parse(q);w=o.filterNode({},t);t={name:j,bodies:[],blocks:{},index:0,auto:"h"};w="(function(){dust.register("+
  23
+(j?'"'+j+'"':"null")+","+o.compileNode(t,w)+");";var y;var A=[],F=t.blocks;for(y in F)A.push(y+":"+F[y]);if(A.length){t.blocks="ctx=ctx.shiftBlocks(blocks);";y="var blocks={"+A.join(",")+"};"}else y=t.blocks="";y=w+y;w=[];A=t.bodies;t=t.blocks;F=0;for(var L=A.length;F<L;F++)w[F]="function body_"+F+"(chk,ctx){"+t+"return chk"+A[F]+";}";t=w.join("");return y+t+"return body_0;})();"};o.filterNode=function(q,j){return o.optimizers[j[0]](q,j)};o.optimizers={body:function(q,j){for(var w=[j[0]],t,y=1,A=
  24
+j.length;y<A;y++){var F=o.filterNode(q,j[y]);if(F)if(F[0]==="buffer")if(t)t[1]+=F[1];else{t=F;w.push(F)}else{t=null;w.push(F)}}return w},buffer:H,special:function(q,j){return["buffer",r[j[1]]]},format:p,reference:z,"#":z,"?":z,"^":z,"<":z,"+":z,"@":z,"%":z,partial:z,context:z,params:z,bodies:z,param:z,filters:H,key:H,path:H,literal:H,comment:p};o.pragmas={esc:function(q,j,w){var t=q.auto;j||(j="h");q.auto=j==="s"?"":j;j=J(q,w.block);q.auto=t;return j}};var r={s:" ",n:"\n",r:"\r",lb:"{",rb:"}"};o.compileNode=
  25
+function(q,j){return o.nodes[j[0]](q,j)};o.nodes={body:function(q,j){var w=q.index++,t="body_"+w;q.bodies[w]=J(q,j);return t},buffer:function(q,j){return".write("+K(j[1])+")"},format:function(q,j){return".write("+K(j[1]+j[2])+")"},reference:function(q,j){return".reference("+o.compileNode(q,j[1])+",ctx,"+o.compileNode(q,j[2])+")"},"#":function(q,j){return B(q,j,"section")},"?":function(q,j){return B(q,j,"exists")},"^":function(q,j){return B(q,j,"notexists")},"<":function(q,j){for(var w=j[4],t=1,y=
  26
+w.length;t<y;t++){var A=w[t];if(A[1][1]==="block"){q.blocks[j[1].text]=o.compileNode(q,A[2]);break}}return""},"+":function(q,j){return".block(ctx.getBlock("+K(j[1].text)+"),"+o.compileNode(q,j[2])+","+o.compileNode(q,j[4])+","+o.compileNode(q,j[3])+")"},"@":function(q,j){return".helper("+K(j[1].text)+","+o.compileNode(q,j[2])+","+o.compileNode(q,j[4])+","+o.compileNode(q,j[3])+")"},"%":function(q,j){var w=j[1][1];if(!o.pragmas[w])return"";for(var t=j[4],y={},A=1,F=t.length;A<F;A++){var L=t[A];y[L[1][1]]=
  27
+L[2]}t=j[3];L={};A=1;for(F=t.length;A<F;A++){var N=t[A];L[N[1][1]]=N[2][1]}return o.pragmas[w](q,j[2][1]?j[2][1].text:null,y,L)},partial:function(q,j){return".partial("+o.compileNode(q,j[1])+","+o.compileNode(q,j[2])+")"},context:function(q,j){if(j[1])return"ctx.rebase("+o.compileNode(q,j[1])+")";return"ctx"},params:function(q,j){for(var w=[],t=1,y=j.length;t<y;t++)w.push(o.compileNode(q,j[t]));if(w.length)return"{"+w.join(",")+"}";return"null"},bodies:function(q,j){for(var w=[],t=1,y=j.length;t<
  28
+y;t++)w.push(o.compileNode(q,j[t]));return"{"+w.join(",")+"}"},param:function(q,j){return o.compileNode(q,j[1])+":"+o.compileNode(q,j[2])},filters:function(q,j){for(var w=[],t=1,y=j.length;t<y;t++)w.push('"'+j[t]+'"');return'"'+q.auto+'"'+(w.length?",["+w.join(",")+"]":"")},key:function(q,j){return'ctx.get("'+j[1]+'")'},path:function(q,j){for(var w=j[1],t=j[2],y=[],A=0,F=t.length;A<F;A++)y.push('"'+t[A]+'"');return"ctx.getPath("+w+",["+y.join(",")+"])"},literal:function(q,j){return K(j[1])}};var K=
  29
+typeof JSON==="undefined"?function(q){return'"'+o.escapeJs(q)+'"'}:JSON.stringify})(typeof exports!=="undefined"?exports:window.dust);
  30
+(function(o){var z=function(){var H={parse:function(p){function J(n){var b=n.charCodeAt(0);if(b<255){n="x";var c=2}else{n="u";c=4}n="\\"+n;var d=b.toString(16).toUpperCase();b=d;c=c-d.length;for(d=0;d<c;d++)b="0"+b;return n+b}function B(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/[\x80-\uFFFF]/g,J)+'"'}function r(n){if(!(a<R)){if(a>R){R=a;W=[]}W.push(n)}}function K(){var n="body@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=[];for(var c=
  31
+q();c!==null;){b.push(c);c=q()}b=b!==null?["body"].concat(b):null;v[n]={nextPos:a,result:b};return b}function q(){var n="part@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=l();if(b!==null)b=b;else{b=j();if(b!==null)b=b;else{b="partial@"+a;var c=v[b];if(c){a=c.nextPos;b=c.result}else{c=h;h=false;var d=a,g=C();if(g!==null){if(p.substr(a,1)===">"){var f=">";a+=1}else{f=null;h&&r('">"')}if(f!==null){var i=I();i=i!==null?["literal",i]:null;if(i!==null)i=i;else{i=Q();i=i!==null?i:null}if(i!==null){var m=
  32
+y();if(m!==null){if(p.substr(a,1)==="/"){var s="/";a+=1}else{s=null;h&&r('"/"')}if(s!==null){var u=E();if(u!==null)g=[g,f,i,m,s,u];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["partial",g[2],g[3]]:null;(h=c)&&d===null&&r("partial");v[b]={nextPos:a,result:d};b=d}if(b!==null)b=b;else{b=L();if(b!==null)b=b;else{b=F();if(b!==null)b=b;else{b="buffer@"+a;if(c=v[b]){a=c.nextPos;b=c.result}else{c=h;h=false;d=a;g=M();if(g!==null){f=[];for(i=
  33
+U();i!==null;){f.push(i);i=U()}if(f!==null)g=[g,f];else{g=null;a=d}}else{g=null;a=d}d=g!==null?["format",g[0],g[1].join("")]:null;if(d!==null)d=d;else{i=g=a;f=h;h=false;m=x();h=f;if(m===null)f="";else{f=null;a=i}if(f!==null){m=a;i=h;h=false;s=M();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;u=l();h=s;if(u===null)s="";else{s=null;a=m}if(s!==null){if(p.length>a){m=p.charAt(a);a++}else{m=null;h&&r("any character")}if(m!==null)f=[f,i,s,m];else{f=null;a=g}}else{f=null;a=g}}else{f=
  34
+null;a=g}}else{f=null;a=g}g=f!==null?f[3]:null;if(g!==null)for(d=[];g!==null;){d.push(g);i=g=a;f=h;h=false;m=x();h=f;if(m===null)f="";else{f=null;a=i}if(f!==null){m=a;i=h;h=false;s=M();h=i;if(s===null)i="";else{i=null;a=m}if(i!==null){m=a;s=h;h=false;u=l();h=s;if(u===null)s="";else{s=null;a=m}if(s!==null){if(p.length>a){m=p.charAt(a);a++}else{m=null;h&&r("any character")}if(m!==null)f=[f,i,s,m];else{f=null;a=g}}else{f=null;a=g}}else{f=null;a=g}}else{f=null;a=g}g=f!==null?f[3]:null}else d=null;d=d!==
  35
+null?["buffer",d.join("")]:null;d=d!==null?d:null}(h=c)&&d===null&&r("buffer");v[b]={nextPos:a,result:d};b=d}b=b!==null?b:null}}}}}v[n]={nextPos:a,result:b};return b}function j(){var n="section@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=w();if(d!==null){var g=E();if(g!==null){var f=K();if(f!==null){var i=A();if(i!==null){var m=t();if(m!==null){var s=d[1].text===m.text?"":null;if(s!==null)d=[d,g,f,i,m,s];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=
  36
+null;a=c}}else{d=null;a=c}c=d!==null?function(u,D,O){O.push(["param",["literal","block"],D]);u.push(O);return u}(d[0],d[2],d[3],d[4]):null;if(c!==null)c=c;else{c=a;d=w();if(d!==null){if(p.substr(a,1)==="/"){g="/";a+=1}else{g=null;h&&r('"/"')}if(g!==null){f=E();if(f!==null)d=[d,g,f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(u){u.push(["bodies"]);return u}(d[0]):null;c=c!==null?c:null}(h=b)&&c===null&&r("section");v[n]={nextPos:a,result:c};return c}function w(){var n="sec_tag_start@"+
  37
+a,b=v[n];if(b){a=b.nextPos;return b.result}b=a;var c=C();if(c!==null){if(p.substr(a).match(/^[#?^<+@%]/)!==null){var d=p.charAt(a);a++}else{d=null;h&&r("[#?^<+@%]")}if(d!==null){var g=N();if(g!==null){var f=y();if(f!==null){var i;i="params@"+a;var m=v[i];if(m){a=m.nextPos;i=m.result}else{m=h;h=false;var s=[],u=a,D=U();if(D!==null){var O=I();if(O!==null){if(p.substr(a,1)==="="){var P="=";a+=1}else{P=null;h&&r('"="')}if(P!==null){var G=N();if(G!==null)G=G;else{G=Q();G=G!==null?G:null}if(G!==null)D=
  38
+[D,O,P,G];else{D=null;a=u}}else{D=null;a=u}}else{D=null;a=u}}else{D=null;a=u}for(u=D!==null?["param",["literal",D[1]],D[3]]:null;u!==null;){s.push(u);u=a;D=U();if(D!==null){O=I();if(O!==null){if(p.substr(a,1)==="="){P="=";a+=1}else{P=null;h&&r('"="')}if(P!==null){G=N();if(G!==null)G=G;else{G=Q();G=G!==null?G:null}if(G!==null)D=[D,O,P,G];else{D=null;a=u}}else{D=null;a=u}}else{D=null;a=u}}else{D=null;a=u}u=D!==null?["param",["literal",D[1]],D[3]]:null}s=s!==null?["params"].concat(s):null;(h=m)&&s===
  39
+null&&r("params");v[i]={nextPos:a,result:s};i=s}if(i!==null)c=[c,d,g,f,i];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}b=c!==null?[c[1],c[2],c[3],c[4]]:null;v[n]={nextPos:a,result:b};return b}function t(){var n="end_tag@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=C();if(d!==null){if(p.substr(a,1)==="/"){var g="/";a+=1}else{g=null;h&&r('"/"')}if(g!==null){var f=N();if(f!==null){var i=E();if(i!==null)d=[d,g,f,i];else{d=null;a=c}}else{d=null;
  40
+a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?d[2]:null;(h=b)&&c===null&&r("end tag");v[n]={nextPos:a,result:c};return c}function y(){var n="context@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=a;if(p.substr(a,1)===":"){var c=":";a+=1}else{c=null;h&&r('":"')}if(c!==null){var d=N();if(d!==null)c=[c,d];else{c=null;a=b}}else{c=null;a=b}b=c!==null?c[1]:null;b=b!==null?b:"";b=b!==null?b?["context",b]:["context"]:null;v[n]={nextPos:a,result:b};return b}function A(){var n="bodies@"+a,b=v[n];if(b){a=
  41
+b.nextPos;return b.result}b=h;h=false;var c=[],d=a,g=C();if(g!==null){if(p.substr(a,1)===":"){var f=":";a+=1}else{f=null;h&&r('":"')}if(f!==null){var i=I();if(i!==null){var m=E();if(m!==null){var s=K();if(s!==null)g=[g,f,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}for(d=g!==null?["param",["literal",g[2]],g[4]]:null;d!==null;){c.push(d);d=a;g=C();if(g!==null){if(p.substr(a,1)===":"){f=":";a+=1}else{f=null;h&&r('":"')}if(f!==null){i=I();if(i!==null){m=
  42
+E();if(m!==null){s=K();if(s!==null)g=[g,f,i,m,s];else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}}else{g=null;a=d}d=g!==null?["param",["literal",g[2]],g[4]]:null}c=c!==null?["bodies"].concat(c):null;(h=b)&&c===null&&r("bodies");v[n]={nextPos:a,result:c};return c}function F(){var n="reference@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=C();if(d!==null){var g=N();if(g!==null){var f;f="filters@"+a;var i=v[f];if(i){a=i.nextPos;f=i.result}else{i=h;h=false;var m=
  43
+[],s=a;if(p.substr(a,1)==="|"){var u="|";a+=1}else{u=null;h&&r('"|"')}if(u!==null){var D=I();if(D!==null)u=[u,D];else{u=null;a=s}}else{u=null;a=s}for(s=u!==null?u[1]:null;s!==null;){m.push(s);s=a;if(p.substr(a,1)==="|"){u="|";a+=1}else{u=null;h&&r('"|"')}if(u!==null){D=I();if(D!==null)u=[u,D];else{u=null;a=s}}else{u=null;a=s}s=u!==null?u[1]:null}m=m!==null?["filters"].concat(m):null;(h=i)&&m===null&&r("filters");v[f]={nextPos:a,result:m};f=m}if(f!==null){i=E();if(i!==null)d=[d,g,f,i];else{d=null;
  44
+a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["reference",d[1],d[2]]:null;(h=b)&&c===null&&r("reference");v[n]={nextPos:a,result:c};return c}function L(){var n="special@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=C();if(d!==null){if(p.substr(a,1)==="~"){var g="~";a+=1}else{g=null;h&&r('"~"')}if(g!==null){var f=I();if(f!==null){var i=E();if(i!==null)d=[d,g,f,i];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["special",d[2]]:
  45
+null;(h=b)&&c===null&&r("special");v[n]={nextPos:a,result:c};return c}function N(){var n="identifier@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=V();c=c!==null?X(["path"].concat(c),n):null;if(c!==null)c=c;else{c=I();c=c!==null?X(["key",c],n):null;c=c!==null?c:null}(h=b)&&c===null&&r("identifier");v[n]={nextPos:a,result:c};return c}function V(){var n="path@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=I();d=d!==null?d:"";if(d!==null){var g=a;if(p.substr(a,1)===
  46
+"."){var f=".";a+=1}else{f=null;h&&r('"."')}if(f!==null){var i=I();if(i!==null)f=[f,i];else{f=null;a=g}}else{f=null;a=g}g=f!==null?f[1]:null;if(g!==null)for(var m=[];g!==null;){m.push(g);g=a;if(p.substr(a,1)==="."){f=".";a+=1}else{f=null;h&&r('"."')}if(f!==null){i=I();if(i!==null)f=[f,i];else{f=null;a=g}}else{f=null;a=g}g=f!==null?f[1]:null}else m=null;if(m!==null)d=[d,m];else{d=null;a=c}}else{d=null;a=c}c=d!==null?function(s,u){if(s){u.unshift(s);return[false,u]}return[true,u]}(d[0],d[1]):null;if(c!==
  47
+null)c=c;else{if(p.substr(a,1)==="."){c=".";a+=1}else{c=null;h&&r('"."')}c=c!==null?[true,[]]:null;c=c!==null?c:null}(h=b)&&c===null&&r("path");v[n]={nextPos:a,result:c};return c}function I(){var n="key@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a).match(/^[a-zA-Z_$]/)!==null){var d=p.charAt(a);a++}else{d=null;h&&r("[a-zA-Z_$]")}if(d!==null){var g=[];if(p.substr(a).match(/^[0-9a-zA-Z_$]/)!==null){var f=p.charAt(a);a++}else{f=null;h&&r("[0-9a-zA-Z_$]")}for(;f!==null;){g.push(f);
  48
+if(p.substr(a).match(/^[0-9a-zA-Z_$]/)!==null){f=p.charAt(a);a++}else{f=null;h&&r("[0-9a-zA-Z_$]")}}if(g!==null)d=[d,g];else{d=null;a=c}}else{d=null;a=c}c=d!==null?d[0]+d[1].join(""):null;(h=b)&&c===null&&r("key");v[n]={nextPos:a,result:c};return c}function Q(){var n="inline@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a,1)==='"'){var d='"';a+=1}else{d=null;h&&r('"\\""')}if(d!==null){if(p.substr(a,1)==='"'){var g='"';a+=1}else{g=null;h&&r('"\\""')}if(g!==null)d=[d,
  49
+g];else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",""]:null;if(c!==null)c=c;else{c=a;if(p.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&r('"\\""')}if(d!==null){g=e();if(g!==null){if(p.substr(a,1)==='"'){var f='"';a+=1}else{f=null;h&&r('"\\""')}if(f!==null)d=[d,g,f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["literal",d[1]]:null;if(c!==null)c=c;else{c=a;if(p.substr(a,1)==='"'){d='"';a+=1}else{d=null;h&&r('"\\""')}if(d!==null){f=T();if(f!==null)for(g=[];f!==null;){g.push(f);
  50
+f=T()}else g=null;if(g!==null){if(p.substr(a,1)==='"'){f='"';a+=1}else{f=null;h&&r('"\\""')}if(f!==null)d=[d,g,f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["body"].concat(d[1]):null;c=c!==null?c:null}}(h=b)&&c===null&&r("inline");v[n]={nextPos:a,result:c};return c}function T(){var n="inline_part@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=L();if(b!==null)b=b;else{b=F();if(b!==null)b=b;else{b=e();b=b!==null?["buffer",b]:null;b=b!==null?b:null}}v[n]={nextPos:a,result:b};return b}
  51
+function e(){var n="literal@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a,d=a,g=h;h=false;var f=x();h=g;if(f===null)g="";else{g=null;a=d}if(g!==null){f=a;d=h;h=false;var i=M();h=d;if(i===null)d="";else{d=null;a=f}if(d!==null){f=k();if(f!==null)f=f;else{if(p.substr(a).match(/^[^"]/)!==null){f=p.charAt(a);a++}else{f=null;h&&r('[^"]')}f=f!==null?f:null}if(f!==null)g=[g,d,f];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null;if(c!==null)for(var m=[];c!==null;){m.push(c);
  52
+d=c=a;g=h;h=false;f=x();h=g;if(f===null)g="";else{g=null;a=d}if(g!==null){f=a;d=h;h=false;i=M();h=d;if(i===null)d="";else{d=null;a=f}if(d!==null){f=k();if(f!==null)f=f;else{if(p.substr(a).match(/^[^"]/)!==null){f=p.charAt(a);a++}else{f=null;h&&r('[^"]')}f=f!==null?f:null}if(f!==null)g=[g,d,f];else{g=null;a=c}}else{g=null;a=c}}else{g=null;a=c}c=g!==null?g[2]:null}else m=null;m=m!==null?m.join(""):null;(h=b)&&m===null&&r("literal");v[n]={nextPos:a,result:m};return m}function k(){var n="esc@"+a,b=v[n];
  53
+if(b){a=b.nextPos;return b.result}if(p.substr(a,2)==='\\"'){b='\\"';a+=2}else{b=null;h&&r('"\\\\\\""')}b=b!==null?'"':null;v[n]={nextPos:a,result:b};return b}function l(){var n="comment@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=h;h=false;var c=a;if(p.substr(a,2)==="{!"){var d="{!";a+=2}else{d=null;h&&r('"{!"')}if(d!==null){var g=[],f=a,i=a,m=h;h=false;if(p.substr(a,2)==="!}"){var s="!}";a+=2}else{s=null;h&&r('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(p.length>a){i=p.charAt(a);
  54
+a++}else{i=null;h&&r("any character")}if(i!==null)i=[m,i];else{i=null;a=f}}else{i=null;a=f}for(f=i!==null?i[1]:null;f!==null;){g.push(f);i=f=a;m=h;h=false;if(p.substr(a,2)==="!}"){s="!}";a+=2}else{s=null;h&&r('"!}"')}h=m;if(s===null)m="";else{m=null;a=i}if(m!==null){if(p.length>a){i=p.charAt(a);a++}else{i=null;h&&r("any character")}if(i!==null)i=[m,i];else{i=null;a=f}}else{i=null;a=f}f=i!==null?i[1]:null}if(g!==null){if(p.substr(a,2)==="!}"){f="!}";a+=2}else{f=null;h&&r('"!}"')}if(f!==null)d=[d,g,
  55
+f];else{d=null;a=c}}else{d=null;a=c}}else{d=null;a=c}c=d!==null?["comment",d[1].join("")]:null;(h=b)&&c===null&&r("comment");v[n]={nextPos:a,result:c};return c}function x(){var n="tag@"+a,b=v[n];if(b){a=b.nextPos;return b.result}b=a;var c=C();if(c!==null){if(p.substr(a).match(/^[#?^><+%:@\/~%]/)!==null){var d=p.charAt(a);a++}else{d=null;h&&r("[#?^><+%:@\\/~%]")}if(d!==null){var g=a,f=a,i=h;h=false;var m=E();h=i;if(m===null)i="";else{i=null;a=f}if(i!==null){f=a;m=h;h=false;var s=M();h=m;if(s===null)m=
  56
+"";else{m=null;a=f}if(m!==null){if(p.length>a){f=p.charAt(a);a++}else{f=null;h&&r("any character")}if(f!==null)i=[i,m,f];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}if(i!==null)for(var u=[];i!==null;){u.push(i);f=g=a;i=h;h=false;m=E();h=i;if(m===null)i="";else{i=null;a=f}if(i!==null){f=a;m=h;h=false;s=M();h=m;if(s===null)m="";else{m=null;a=f}if(m!==null){if(p.length>a){f=p.charAt(a);a++}else{f=null;h&&r("any character")}if(f!==null)i=[i,m,f];else{i=null;a=g}}else{i=null;a=g}}else{i=null;a=g}}else u=
  57
+null;if(u!==null){g=E();if(g!==null)c=[c,d,u,g];else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}}else{c=null;a=b}if(c!==null)b=c;else{b=F();b=b!==null?b:null}v[n]={nextPos:a,result:b};return b}function C(){var n="ld@"+a,b=v[n];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="{"){b="{";a+=1}else{b=null;h&&r('"{"')}v[n]={nextPos:a,result:b};return b}function E(){var n="rd@"+a,b=v[n];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="}"){b="}";a+=1}else{b=null;h&&r('"}"')}v[n]={nextPos:a,result:b};
  58
+return b}function M(){var n="eol@"+a,b=v[n];if(b){a=b.nextPos;return b.result}if(p.substr(a,1)==="\n"){b="\n";a+=1}else{b=null;h&&r('"\\n"')}if(b!==null)b=b;else{if(p.substr(a,2)==="\r\n"){b="\r\n";a+=2}else{b=null;h&&r('"\\r\\n"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\r"){b="\r";a+=1}else{b=null;h&&r('"\\r"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2028"){b="\u2028";a+=1}else{b=null;h&&r('"\\u2028"')}if(b!==null)b=b;else{if(p.substr(a,1)==="\u2029"){b="\u2029";a+=1}else{b=null;h&&r('"\\u2029"')}b=
  59
+b!==null?b:null}}}}v[n]={nextPos:a,result:b};return b}function U(){var n="ws@"+a,b=v[n];if(b){a=b.nextPos;return b.result}if(p.substr(a).match(/^[\t\u000b\u000c \xA0\uFEFF]/)!==null){b=p.charAt(a);a++}else{b=null;h&&r("[\t\u000b\u000c \\xA0\\uFEFF]")}v[n]={nextPos:a,result:b};return b}function Y(){var n=function(c){c.sort();for(var d=null,g=[],f=0;f<c.length;f++)if(c[f]!==d){g.push(c[f]);d=c[f]}switch(g.length){case 0:return"end of input";case 1:return g[0];default:return g.slice(0,g.length-1).join(", ")+
  60
+" or "+g[g.length-1]}}(W),b=Math.max(a,R);b=b<p.length?B(p.charAt(b)):"end of input";return"Expected "+n+" but "+b+" found."}function Z(){for(var n=1,b=1,c=false,d=0;d<R;d++){var g=p.charAt(d);if(g==="\n"){c||n++;b=1;c=false}else if(g==="\r"|g==="\u2028"||g==="\u2029"){n++;b=1;c=true}else{b++;c=false}}return{line:n,column:b}}function X(n,b){n.text=p.substring(b.split("@")[1],a);return n}var a=0,h=true,R=0,W=[],v={},S=K();if(S===null||a!==p.length){S=Z();throw new SyntaxError(Y(),S.line,S.column);
  61
+}return S},toSource:function(){return this._source}};H.SyntaxError=function(p,J,B){this.name="SyntaxError";this.message=p;this.line=J;this.column=B};H.SyntaxError.prototype=Error.prototype;return H}();o.parse=z.parse})(typeof exports!=="undefined"?exports:window.dust);
4  docs/api.md
Source Rendered
@@ -12,12 +12,12 @@ Then, within your Node script or the REPL:
12 12
 
13 13
 This will import everything needed to parse, compile and render templates. To render Dust templates in the browser, grab the runtime distribution and include it in your script tags along with your compiled templates:
14 14
 
15  
-    <script src="dust-core-0.2.5.min.js"></script>
  15
+    <script src="dust-core-0.3.0.min.js"></script>
16 16
     <script src="compiled_templates.js"></script>
17 17
 
18 18
 Include the full distribution if you want to compile templates within the browser (as in the online demo):
19 19
 
20  
-    <script src="dust-full-0.2.5.min.js"></script>
  20
+    <script src="dust-full-0.3.0.min.js"></script>
21 21
 
22 22
 Precompilation is the recommended approach for general use.
23 23
 
14  index.html
@@ -200,7 +200,7 @@
200 200
 code .string, code .regexp { color: #669933 }
201 201
 code .class, code .special {  }
202 202
 code .number               { color: #eddd3d }
203  
-code .comment              { color: grey }</style><script src="vendor/ecma.js"></script><script src="vendor/jquery.min.js"></script><script src="vendor/jsdump.js"></script><script src="vendor/beautify.js"></script><script src="lib/dust.js"></script><script src="lib/parser.js"></script><script src="lib/compiler.js"></script><script src="test/examples.js"></script><script src="test/uutest.js"></script><script src="test/core.js"></script><script type="text/javascript">(function(){dust.register("select",body_0);function body_0(chk,ctx){return chk.write("<select style=\"clear: both;\">").section(ctx.get("examples"),ctx,{"block":body_1},null).write("</select>");}function body_1(chk,ctx){return chk.write("<option ").reference(ctx.get("selected"),ctx,"h",[]).write(" value=\"").helper("idx",ctx,{"block":body_2},null).write("\">").reference(ctx.get("name"),ctx,"h",[]).write("</option>");}function body_2(chk,ctx){return chk.reference(ctx.getPath(true,[]),ctx,"h",[]);}return body_0;})();</script><script type="text/javascript">jsDump.parsers['function'] = function(fn) {
  203
+code .comment              { color: grey }</style><script src="vendor/ecma.js"></script><script src="vendor/jquery.min.js"></script><script src="vendor/jsdump.js"></script><script src="vendor/beautify.js"></script><script src="lib/dust.js"></script><script src="lib/parser.js"></script><script src="lib/compiler.js"></script><script src="test/examples.js"></script><script src="test/uutest.js"></script><script src="test/core.js"></script><script type="text/javascript">(function(){dust.register("select",body_0);function body_0(chk,ctx){return chk.write("<select style=\"clear: both;\">").section(ctx.get("examples"),ctx,{"block":body_1},null).write("</select>");}function body_1(chk,ctx){return chk.write("<option ").reference(ctx.get("selected"),ctx,"h").write(" value=\"").helper("idx",ctx,{"block":body_2},null).write("\">").reference(ctx.get("name"),ctx,"h").write("</option>");}function body_2(chk,ctx){return chk.reference(ctx.getPath(true,[]),ctx,"h");}return body_0;})();</script><script type="text/javascript">jsDump.parsers['function'] = function(fn) {
204 204
   return fn.toString();
205 205
 }
206 206
 
@@ -721,13 +721,13 @@
721 721
 
722 722
 <p>This will import everything needed to parse, compile and render templates. To render Dust templates in the browser, grab the runtime distribution and include it in your script tags along with your compiled templates:</p>
723 723
 
724  
-<pre><code>&lt;script src="dust-core-0.2.5.min.js"&gt;&lt;/script&gt;
  724
+<pre><code>&lt;script src="dust-core-0.3.0.min.js"&gt;&lt;/script&gt;
725 725
 &lt;script src="compiled_templates.js"&gt;&lt;/script&gt;
726 726
 </code></pre>
727 727
 
728 728
 <p>Include the full distribution if you want to compile templates within the browser (as in the online demo):</p>
729 729
 
730  
-<pre><code>&lt;script src="dust-full-0.2.5.min.js"&gt;&lt;/script&gt;
  730
+<pre><code>&lt;script src="dust-full-0.3.0.min.js"&gt;&lt;/script&gt;
731 731
 </code></pre>
732 732
 
733 733
 <p>Precompilation is the recommended approach for general use.</p>
@@ -928,15 +928,15 @@
928 928
 
929 929
 <h4>Loading</h4>
930 930
 
931  
-<pre><code>dust.register(name, function)
  931
+<pre><code>dust.register(name, fn)
932 932
 </code></pre>
933 933
 
934  
-<p>Used internally to register templates with the runtime environment. Override to customize the way Dust caches templates.</p>
  934
+<p>Used internally to register template function <code>fn</code> with the runtime environment. Override to customize the way Dust caches templates.</p>
935 935
 
936  
-<pre><code>dust.load(name, chunk, context)
  936
+<pre><code>dust.onLoad(name, callback(err, out))
937 937
 </code></pre>
938 938
 
939  
-<p>Used internally to loads and render the named template. Override to change the way templates are loaded (e.g., to load templates from the filesystem or a database).</p>
  939
+<p>By default Dust returns a "template not found" error when a named template cannot be located in the cache. Override <code>onLoad</code> to specify a fallback loading mechanism (e.g., to load templates from the filesystem or a database).</p>
940 940
 
941 941
 <pre><code>dust.loadSource(source, [filename])
942 942
 </code></pre>

0 notes on commit 7469a94

Please sign in to comment.
Something went wrong with that request. Please try again.