1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
var a,b,body,h1,head,html,i,p,s,th,title,u;a = function(){return __ck.tag('a', arguments);};b = function(){return __ck.tag('b', arguments);};body = function(){return __ck.tag('body', arguments);};h1 = function(){return __ck.tag('h1', arguments);};head = function(){return __ck.tag('head', arguments);};html = function(){return __ck.tag('html', arguments);};i = function(){return __ck.tag('i', arguments);};p = function(){return __ck.tag('p', arguments);};s = function(){return __ck.tag('s', arguments);};th = function(){return __ck.tag('th', arguments);};title = function(){return __ck.tag('title', arguments);};u = function(){return __ck.tag('u', arguments);};var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) {  for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }  function ctor() { this.constructor = child; }  ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype;  return child; };var __indexOf = Array.prototype.indexOf || function(item) {  for (var i = 0, l = this.length; i < l; i++) {    if (this[i] === item) return i;  } return -1; };

    var coffeescript, comment, doctype, h, ie, tag, text, yield, __ck;
    if (data == null) {
        data = {};
    }
    if (data.format == null) {
        data.format = false;
    }
    if (data.autoescape == null) {
        data.autoescape = false;
    }
    __ck = {buffer:[], esc:function (txt) {
        if (data.autoescape) {
            return h(txt);
        } else {
            return String(txt);
        }
    }, tabs:0, repeat:function (string, count) {
        return Array(count + 1).join(string);
    }, indent:function () {
        if (data.format) {
            return text(this.repeat("  ", this.tabs));
        }
    }, tag:function (name, args) {
        var combo, i, _i, _len;
        combo = [name];
        for (_i = 0, _len = args.length; _i < _len; _i++) {
            i = args[_i];
            combo.push(i);
        }
        return tag.apply(data, combo);
    }, render_idclass:function (str) {
        var c, classes, i, id, _i, _j, _len, _len2, _ref;
        classes = [];
        _ref = str.split(".");
        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
            i = _ref[_i];
            if (__indexOf.call(i, "#") >= 0) {
                id = i.replace("#", "");
            } else {
                if (i !== "") {
                    classes.push(i);
                }
            }
        }
        if (id) {
            text(" id=\"" + id + "\"");
        }
        if (classes.length > 0) {
            text(" class=\"");
            for (_j = 0, _len2 = classes.length; _j < _len2; _j++) {
                c = classes[_j];
                if (c !== classes[0]) {
                    text(" ");
                }
                text(c);
            }
            return text("\"");
        }
    }, render_attrs:function (obj, prefix) {
        var k, v, _results;
        if (prefix == null) {
            prefix = "";
        }
        _results = [];
        for (k in obj) {
            v = obj[k];
            if (typeof v === "boolean" && v) {
                v = k;
            }
            if (typeof v === "function") {
                v = "(" + v + ").call(this);";
            }
            if (typeof v === "object" && !(v instanceof Array)) {
                _results.push(this.render_attrs(v, prefix + k + "-"));
            } else {
                if (v) {
                    _results.push(text(" " + (prefix + k) + "=\"" + (this.esc(v)) + "\""));
                } else {
                    _results.push(void 0);
                }
            }
        }
        return _results;
    }, render_contents:function (contents) {
        var result;
        switch (typeof contents) {
          case "string":
          case "number":
          case "boolean":
            return text(this.esc(contents));
          case "function":
            if (data.format) {
                text("\n");
            }
            this.tabs++;
            result = contents.call(data);
            if (typeof result === "string") {
                this.indent();
                text(this.esc(result));
                if (data.format) {
                    text("\n");
                }
            }
            this.tabs--;
            return this.indent();
        }
    }, render_tag:function (name, idclass, attrs, contents) {
        this.indent();
        text("<" + name);
        if (idclass) {
            this.render_idclass(idclass);
        }
        if (attrs) {
            this.render_attrs(attrs);
        }
        if (__indexOf.call(this.self_closing, name) >= 0) {
            text(" />");
            if (data.format) {
                text("\n");
            }
        } else {
            text(">");
            this.render_contents(contents);
            text("</" + name + ">");
            if (data.format) {
                text("\n");
            }
        }
        return null;
    }};
    tag = function () {
        var a, args, attrs, contents, idclass, name, _i, _len;
        name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
        for (_i = 0, _len = args.length; _i < _len; _i++) {
            a = args[_i];
            switch (typeof a) {
              case "function":
                contents = a;
                break;
              case "object":
                attrs = a;
                break;
              case "number":
              case "boolean":
                contents = a;
                break;
              case "string":
                if (args.length === 1) {
                    contents = a;
                } else {
                    if (a === args[0]) {
                        idclass = a;
                    } else {
                        contents = a;
                    }
                }
            }
        }
        return __ck.render_tag(name, idclass, attrs, contents);
    };
    yield = function (f) {
        var old_buffer, temp_buffer;
        temp_buffer = [];
        old_buffer = __ck.buffer;
        __ck.buffer = temp_buffer;
        f();
        __ck.buffer = old_buffer;
        return temp_buffer.join("");
    };
    h = function (txt) {
        return String(txt).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
    };
    doctype = function (type) {
        if (type == null) {
            type = "default";
        }
        text(__ck.doctypes[type]);
        if (data.format) {
            return text("\n");
        }
    };
    text = function (txt) {
        __ck.buffer.push(String(txt));
        return null;
    };
    comment = function (cmt) {
        text("<!--" + cmt + "-->");
        if (data.format) {
            return text("\n");
        }
    };
    coffeescript = function (param) {
        switch (typeof param) {
          case "function":
            return script("" + __ck.coffeescript_helpers + "(" + param + ").call(this);");
          case "string":
            return script({type:"text/coffeescript"}, function () {
                return param;
            });
          case "object":
            param.type = "text/coffeescript";
            return script(param);
        }
    };
    ie = function (condition, contents) {
        __ck.indent();
        text("<!--[if " + condition + "]>");
        __ck.render_contents(contents);
        text("<![endif]-->");
        if (data.format) {
            return text("\n");
        }
    };
    return null;
}
__ck.doctypes = {"default":"<!DOCTYPE html>","5":"<!DOCTYPE html>","xml":"<?xml version=\"1.0\" encoding=\"utf-8\" ?>","transitional":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">","strict":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">","frameset":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">","1.1":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">","basic":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.1//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd\">","mobile":"<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd\">","ce":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"ce-html-1.0-transitional.dtd\">"};__ck.coffeescript_helpers = "var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) {  for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }  function ctor() { this.constructor = child; }  ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype;  return child; };var __indexOf = Array.prototype.indexOf || function(item) {  for (var i = 0, l = this.length; i < l; i++) {    if (this[i] === item) return i;  } return -1; };";__ck.self_closing = ["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","basefont","frame"];(
function () {
    doctype(5);
    return html(function () {
        head(function () {
            return title("" + this.title);
        });
        return body(function () {
            return h1("" + this.hello);
        });
    });
}
).call(data);return __ck.buffer.join('');