aboutsummaryrefslogtreecommitdiffstats
path: root/syte/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'syte/static/js')
-rw-r--r--syte/static/js/components/base.js32
-rw-r--r--syte/static/js/components/blog-posts.js143
-rw-r--r--syte/static/js/components/dribbble.js53
-rw-r--r--syte/static/js/components/github.js46
-rw-r--r--syte/static/js/components/instagram.js66
-rw-r--r--syte/static/js/components/links.js67
-rw-r--r--syte/static/js/components/mobile.js15
-rw-r--r--syte/static/js/components/twitter.js82
-rwxr-xr-xsyte/static/js/libs/bootstrap-modal.js222
-rw-r--r--syte/static/js/libs/handlebars.js1550
-rwxr-xr-xsyte/static/js/libs/jquery.url.js162
-rw-r--r--syte/static/js/libs/json.js42
-rw-r--r--syte/static/js/libs/moment.min.js6
-rw-r--r--syte/static/js/libs/prettify.js28
-rw-r--r--syte/static/js/libs/require.js33
-rw-r--r--syte/static/js/libs/spin.min.js2
-rw-r--r--syte/static/js/libs/text.js11
-rw-r--r--syte/static/js/min/scripts.min.js8
18 files changed, 2568 insertions, 0 deletions
diff --git a/syte/static/js/components/base.js b/syte/static/js/components/base.js
new file mode 100644
index 0000000..0d60276
--- /dev/null
+++ b/syte/static/js/components/base.js
@@ -0,0 +1,32 @@
+//Global configs and functions shared between js
+
+function numberWithCommas(x) {
+ return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
+}
+
+require.config({
+ baseUrl: "/static/",
+ paths: {
+ "text": "js/libs/text",
+ "json": "js/libs/json"
+ },
+ waitSeconds: 15
+});
+
+var spin_opts = {
+ lines: 9,
+ length: 5,
+ width: 2,
+ radius: 4,
+ rotate: 9,
+ color: '#4c4c4c',
+ speed: 1.5,
+ trail: 40,
+ shadow: false,
+ hwaccel: false,
+ className: 'spinner',
+ zIndex: 2e9
+};
+
+
+
diff --git a/syte/static/js/components/blog-posts.js b/syte/static/js/components/blog-posts.js
new file mode 100644
index 0000000..27f8ab5
--- /dev/null
+++ b/syte/static/js/components/blog-posts.js
@@ -0,0 +1,143 @@
+
+function fetchBlogPosts(post, tag) {
+ var blog_fetch_url = '/blog.json';
+
+ if (post)
+ blog_fetch_url = '/post/' + post;
+ else if (tag)
+ blog_fetch_url = '/tags/' + tag;
+
+ $.getJSON(blog_fetch_url, function(blog_posts) {
+ require(["text!templates/blog-post-text.html",
+ "text!templates/blog-post-photo.html",
+ "text!templates/blog-post-link.html",
+ "text!templates/blog-post-video.html",
+ "text!templates/blog-post-audio.html",
+ "text!templates/blog-post-quote.html"],
+
+ function(text_post_template, photo_post_template,
+ link_post_template, video_post_template, audio_post_template,
+ quote_post_template) {
+
+ var text_template = Handlebars.compile(text_post_template);
+ var photo_template = Handlebars.compile(photo_post_template);
+ var link_template = Handlebars.compile(link_post_template);
+ var video_template = Handlebars.compile(video_post_template);
+ var audio_template = Handlebars.compile(audio_post_template);
+ var quote_template = Handlebars.compile(quote_post_template);
+
+ $('.loading').remove();
+ $.each(blog_posts.response.posts, function(i, p) {
+ p.formated_date = moment(p.date).format('MMMM DD, YYYY')
+
+ if (p.type == 'text')
+ $('#blog-posts').append(text_template(p));
+ else if (p.type == 'photo')
+ $('#blog-posts').append(photo_template(p));
+ else if (p.type == 'link')
+ $('#blog-posts').append(link_template(p));
+ else if (p.type == 'video')
+ $('#blog-posts').append(video_template(p));
+ else if (p.type == 'audio')
+ $('#blog-posts').append(audio_template(p));
+ else if (p.type == 'quote')
+ $('#blog-posts').append(quote_template(p));
+
+ });
+
+ setupLinks();
+ adjustBlogHeaders();
+ prettyPrint();
+ setTimeout(setupBlogHeaderScroll, 1000);
+ adjustSelection('home-link');
+ });
+ });
+}
+
+function adjustBlogHeaders() {
+ if(isMobileView)
+ return;
+
+ $('.blog-section article hgroup').each(function(i, e) {
+ $(e).find('h3 a').css({
+ 'margin-top': '-' + ($(e).height() + 100) + 'px'
+ }).addClass('adjusted');
+ });
+}
+
+function setupBlogHeaderScroll() {
+
+ if(isMobileView)
+ return;
+
+ var previousTarget,
+ activeTarget,
+ $window = $(window),
+ offsets = [],
+ targets = [],
+ $posts = $('.blog-section article hgroup h3 a').each(function() {
+ if (this.hash) {
+ targets.push(this.hash);
+ offsets.push($(this.hash).offset().top);
+ }
+ });
+
+ function processScroll(e) {
+ var scrollTop = $window.scrollTop(),
+ i = offsets.length;
+
+ for (i; i--;) {
+ if (activeTarget != targets[i] && scrollTop > offsets[i] && (!offsets[i + 1] || scrollTop < offsets[i + 1])) {
+
+ var hgroup = $(activeTarget).find("hgroup");
+ var margintop = '';
+ if (hgroup.length) {
+ margintop = '-' + ($(hgroup[0]).height() + 100) + 'px';
+ }
+
+ //set current target to be absolute
+ $("h3 a[href=" + activeTarget + "]").removeClass("active").css({
+ position: "absolute",
+ top: "auto",
+ 'margin-top': margintop
+ });
+
+ //set new target to be fixed
+ activeTarget = targets[i];
+ $("h3 a[href=" + activeTarget + "]").attr('style', '').addClass("active");
+ }
+
+ if (activeTarget && activeTarget != targets[i] && scrollTop + 50 >= offsets[i] && (!offsets[i + 1] || scrollTop + 50 <= offsets[i + 1])) {
+
+ // if it's close to the new target scroll the current target up
+ $("h3 a[href=" + activeTarget + "]")
+ .removeClass("active")
+ .css({
+ position: "absolute",
+ top: ($(activeTarget).outerHeight(true) + $(activeTarget).offset().top - 50) + "px",
+ bottom: "auto"
+ });
+ }
+
+ if (activeTarget == targets[i] && scrollTop > offsets[i] - 50 && (!offsets[i + 1] || scrollTop <= offsets[i + 1] - 50)) {
+ // if the current target is not fixed make it fixed.
+ if (!$("h3 a[href=" + activeTarget + "]").hasClass("active")) {
+ $("h3 a[href=" + activeTarget + "]").attr('style', '').addClass("active");
+ }
+ }
+ }
+ }
+
+ $posts.click(function(e) {
+ if (!this.hash)
+ return;
+ $('html, body').stop().animate({
+ scrollTop: $(this.hash).offset().top
+ }, 500, 'linear');
+
+ processScroll();
+ e.preventDefault();
+ });
+
+ $window.scroll(processScroll).trigger("scroll");
+}
diff --git a/syte/static/js/components/dribbble.js b/syte/static/js/components/dribbble.js
new file mode 100644
index 0000000..7c2ed59
--- /dev/null
+++ b/syte/static/js/components/dribbble.js
@@ -0,0 +1,53 @@
+
+function setupDribbble(url, el) {
+ var href = el.href;
+
+ if ($('#dribbble-profile').length > 0) {
+ window.location = href;
+ return;
+ }
+
+ var params = url.attr('path').split('/').filter(function(w) {
+ if (w.length)
+ return true;
+ return false;
+ })
+
+ if (params.length == 1) {
+ var username = params[0];
+
+ var spinner = new Spinner(spin_opts).spin();
+ $('#dribbble-link').append(spinner.el);
+
+ require(["json!/dribbble/" + username, "text!templates/dribbble-view.html"],
+ function(dribbble_data, dribbble_view) {
+ if (dribbble_data.message || dribbble_data.length == 0) {
+ window.location = href;
+ return;
+ }
+
+ var template = Handlebars.compile(dribbble_view);
+
+ var user = dribbble_data.shots[0].player;
+ user.following_count = numberWithCommas(user.following_count);
+ user.followers_count = numberWithCommas(user.followers_count);
+ user.likes_count = numberWithCommas(user.likes_count);
+
+ var template_data = {
+ "user": user,
+ "shots": dribbble_data.shots
+ }
+
+ $(template(template_data)).modal().on('hidden', function () {
+ $(this).remove();
+ adjustSelection('home-link');
+ })
+
+ spinner.stop();
+ });
+
+ return;
+ }
+
+ window.location = href;
+}
diff --git a/syte/static/js/components/github.js b/syte/static/js/components/github.js
new file mode 100644
index 0000000..7bad5ea
--- /dev/null
+++ b/syte/static/js/components/github.js
@@ -0,0 +1,46 @@
+
+function setupGithub(url, el) {
+ var href = el.href;
+
+ if ($('#github-profile').length > 0) {
+ window.location = href;
+ return;
+ }
+
+ var params = url.attr('path').split('/').filter(function(w) {
+ if (w.length)
+ return true;
+ return false;
+ })
+
+ if (params.length == 1) {
+ var username = params[0];
+
+ var spinner = new Spinner(spin_opts).spin();
+ $('#github-link').append(spinner.el);
+
+ require(["json!/github/" + username, "text!templates/github-view.html"],
+ function(github_data, github_view) {
+ if (github_data.error || github_data.length == 0) {
+ window.location = href;
+ return;
+ }
+
+ var template = Handlebars.compile(github_view);
+ github_data.user.following_count = numberWithCommas(github_data.user.following_count)
+ github_data.user.followers_count = numberWithCommas(github_data.user.followers_count)
+
+ $(template(github_data)).modal().on('hidden', function () {
+ $(this).remove();
+ adjustSelection('home-link');
+ })
+
+ spinner.stop();
+
+ });
+
+ return;
+ }
+
+ window.location = href;
+}
diff --git a/syte/static/js/components/instagram.js b/syte/static/js/components/instagram.js
new file mode 100644
index 0000000..3c6dc3a
--- /dev/null
+++ b/syte/static/js/components/instagram.js
@@ -0,0 +1,66 @@
+
+function setupInstagram(el) {
+ var href = el.href;
+
+ if($('#instagram-profile').length > 0) {
+ window.location = href;
+ return;
+ }
+
+ var spinner = new Spinner(spin_opts).spin();
+ $('#instagram-link').append(spinner.el);
+
+ require(["json!/instagram/",
+ "text!templates/instagram-view.html",
+ "text!templates/instagram-view-more.html"],
+ function(instagram_data, instagram_view, instagram_view_more) {
+ if (instagram_data.media == 0){
+ window.location = href;
+ return;
+ }
+
+ var template = Handlebars.compile(instagram_view);
+
+ var user_counts = instagram_data.user['counts'];
+ user_counts.media = numberWithCommas(user_counts.media);
+ user_counts.followed_by = numberWithCommas(user_counts.followed_by);
+ user_counts.follows = numberWithCommas(user_counts.follows);
+
+ $.each(instagram_data.media, function(i, p) {
+ p.formated_date = moment.unix(parseInt(p.created_time)).fromNow();
+ });
+
+ $(template(instagram_data)).modal().on('hidden', function () {
+ $(this).remove();
+ adjustSelection('home-link');
+ })
+
+ var more_template = Handlebars.compile(instagram_view_more);
+
+ $('#load-more-pics').click(function(e) {
+ next = $(this).attr('data-control-next');
+
+ var spinner = new Spinner(spin_opts).spin();
+ $('#load-more-pics').append(spinner.el);
+
+ $.getJSON('/instagram/' + next, function(data) {
+
+ $.each(data.media, function(i, p) {
+ p.formated_date = moment.unix(parseInt(p.created_time)).fromNow();
+ });
+
+ $('.instagram .profile-shots').append(more_template(data));
+
+ if (data.pagination && data.pagination['next_max_id'])
+ $('#load-more-pics').attr('data-control-next', data.pagination['next_max_id']);
+ else
+ $('#load-more-pics').remove();
+
+ spinner.stop();
+ });
+
+ })
+
+ spinner.stop();
+ });
+}
diff --git a/syte/static/js/components/links.js b/syte/static/js/components/links.js
new file mode 100644
index 0000000..0671f6a
--- /dev/null
+++ b/syte/static/js/components/links.js
@@ -0,0 +1,67 @@
+
+function setupLinks() {
+
+ $('a').click(function(e) {
+ e.preventDefault();
+ e.stopPropagation();
+
+ var url = $.url(this.href.replace('/#!', ''));
+
+ if (this.id == 'home-link' && window.location.pathname == '/') {
+ $('#github-profile').remove();
+ $('#dribbble-profile').remove();
+ $('#twitter-profile').remove();
+ $('#instagram-profile').remove();
+ $('.modal-backdrop').remove();
+ adjustSelection('home-link');
+ }
+ else if(this.id == 'instagram-link' && instagram_integration_enabled) {
+ $('#github-profile').remove();
+ $('#dribbble-profile').remove();
+ $('#twitter-profile').remove();
+ $('.modal-backdrop').remove();
+ adjustSelection('instagram-link');
+
+ setupInstagram(this);
+ }
+ else if (twitter_integration_enabled && (url.attr('host') == 'twitter.com' || url.attr('host') == 'www.twitter.com')) {
+
+ $('#github-profile').remove();
+ $('#dribbble-profile').remove();
+ $('#instagram-profile').remove();
+ $('.modal-backdrop').remove();
+ adjustSelection('twitter-link');
+
+ setupTwitter(url, this);
+ }
+ else if (github_integration_enabled && (url.attr('host') == 'github.com' || url.attr('host') == 'www.github.com')) {
+
+ $('#twitter-profile').remove();
+ $('#dribbble-profile').remove();
+ $('#instagram-profile').remove();
+ $('.modal-backdrop').remove();
+ adjustSelection('github-link');
+
+ setupGithub(url, this);
+ }
+ else if (dribbble_integration_enabled && (url.attr('host') == 'dribbble.com' || url.attr('host') == 'www.dribbble.com')) {
+
+ $('#twitter-profile').remove();
+ $('#github-profile').remove();
+ $('#instagram-profile').remove();
+ $('.modal-backdrop').remove();
+ adjustSelection('dribbble-link');
+
+ setupDribbble(url, this);
+ }
+ else {
+ window.location = this.href;
+ }
+ });
+}
+
+function adjustSelection(el) {
+ $('.main-nav').children('li').removeClass('sel');
+ $('#' + el).parent().addClass('sel');
+}
+
diff --git a/syte/static/js/components/mobile.js b/syte/static/js/components/mobile.js
new file mode 100644
index 0000000..4b530b3
--- /dev/null
+++ b/syte/static/js/components/mobile.js
@@ -0,0 +1,15 @@
+
+var isMobileView = false;
+var mediaQuery = window.matchMedia("(max-width:600px)");
+
+if (mediaQuery.matches) {
+ isMobileView = true;
+}
+
+$(function() {
+ $('#mobile-nav-btn').click(function() {
+ $('.main-section').toggleClass('nav-opened');
+ });
+});
+
+
diff --git a/syte/static/js/components/twitter.js b/syte/static/js/components/twitter.js
new file mode 100644
index 0000000..4a8bb30
--- /dev/null
+++ b/syte/static/js/components/twitter.js
@@ -0,0 +1,82 @@
+
+function setupTwitter(url, el) {
+ var href = el.href;
+
+ if ($('#twitter-profile').length > 0) {
+ window.location = href;
+ return;
+ }
+
+ var params = url.attr('path').split('/').filter(function(w) {
+ if (w.length)
+ return true;
+ return false;
+ })
+
+ if (params.length == 1) {
+ var username = params[0];
+
+ var spinner = new Spinner(spin_opts).spin();
+ $('#twitter-link').append(spinner.el);
+
+ require(["json!/twitter/" + username, "text!templates/twitter-view.html"],
+ function(twitter_data, twitter_view) {
+ if (twitter_data.error || twitter_data.length == 0) {
+ window.location = href;
+ return;
+ }
+
+ var template = Handlebars.compile(twitter_view);
+
+ var tweets = [];
+ $.each(twitter_data, function(i, t) {
+ if (i > 3)
+ return;
+
+ //'ddd MMM DD HH:mm:ss ZZ YYYY'
+ t.formated_date = moment(t.created_at).fromNow();
+ t.f_text = twitterLinkify(t.text);
+ tweets.push(t);
+ });
+
+ var user = twitter_data[0].user;
+ user.statuses_count = numberWithCommas(user.statuses_count);
+ user.friends_count = numberWithCommas(user.friends_count);
+ user.followers_count = numberWithCommas(user.followers_count);
+ user.f_description = twitterLinkify(user.description);
+
+ var template_data = {
+ "user": user,
+ "tweets": tweets
+ }
+
+ $(template(template_data)).modal().on('hidden', function () {
+ $(this).remove();
+ adjustSelection('home-link');
+ })
+
+ spinner.stop();
+ });
+
+ return;
+ }
+
+ window.location = href;
+}
+
+function twitterLinkify(text) {
+ text = text.replace(/(https?:\/\/\S+)/gi, function (s) {
+ return '<a href="' + s + '">' + s + '</a>';
+ });
+
+ text = text.replace(/(^|) @(\w+)/gi, function (s) {
+ return '<a href="http://twitter.com/' + s + '">' + s + '</a>';
+ });
+
+ text = text.replace(/(^|) #(\w+)/gi, function (s) {
+ return '<a href="http://search.twitter.com/search?q=' + s.replace(/#/,'%23') + '">' + s + '</a>';
+ });
+
+ return text;
+}
+
diff --git a/syte/static/js/libs/bootstrap-modal.js b/syte/static/js/libs/bootstrap-modal.js
new file mode 100755
index 0000000..f6d94f5
--- /dev/null
+++ b/syte/static/js/libs/bootstrap-modal.js
@@ -0,0 +1,222 @@
+/* =========================================================
+ * bootstrap-modal.js v2.0.3
+ * http://twitter.github.com/bootstrap/javascript.html#modals
+ * =========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* MODAL CLASS DEFINITION
+ * ====================== */
+
+ var Modal = function (content, options) {
+ this.options = options
+ this.$element = $(content)
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
+ }
+
+ Modal.prototype = {
+
+ constructor: Modal
+
+ , toggle: function () {
+ return this[!this.isShown ? 'show' : 'hide']()
+ }
+
+ , show: function () {
+ var that = this
+ , e = $.Event('show')
+
+ this.$element.trigger(e)
+
+ if (this.isShown || e.isDefaultPrevented()) return
+
+ $('body').addClass('modal-open')
+
+ this.isShown = true
+
+ escape.call(this)
+ backdrop.call(this, function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
+ if (!that.$element.parent().length) {
+ that.$element.appendTo(document.body) //don't move modals dom position
+ }
+
+ that.$element
+ .show()
+
+ if (transition) {
+ that.$element[0].offsetWidth // force reflow
+ }
+
+ //this mobile part is custom, im too lasy to extend this feature for this
+ if (isMobileView)
+ that.$element.css('top', (window.pageYOffset + 45) + 'px');
+
+ that.$element.addClass('in')
+
+ transition ?
+ that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
+ that.$element.trigger('shown')
+
+ })
+ }
+
+ , hide: function (e) {
+ e && e.preventDefault()
+
+ var that = this
+
+ e = $.Event('hide')
+
+ this.$element.trigger(e)
+
+ if (!this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = false
+
+ $('body').removeClass('modal-open')
+
+ escape.call(this)
+
+ this.$element.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade') ?
+ hideWithTransition.call(this) :
+ hideModal.call(this)
+ }
+
+ }
+
+
+ /* MODAL PRIVATE METHODS
+ * ===================== */
+
+ function hideWithTransition() {
+ var that = this
+ , timeout = setTimeout(function () {
+ that.$element.off($.support.transition.end)
+ hideModal.call(that)
+ }, 500)
+
+ this.$element.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ hideModal.call(that)
+ })
+ }
+
+ function hideModal(that) {
+ this.$element
+ .hide()
+ .trigger('hidden')
+
+ backdrop.call(this)
+ }
+
+ function backdrop(callback) {
+ var that = this
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+ if (this.isShown && this.options.backdrop) {
+ var doAnimate = $.support.transition && animate
+
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+ .appendTo(document.body)
+
+ if (this.options.backdrop != 'static') {
+ this.$backdrop.click($.proxy(this.hide, this))
+ }
+
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+ this.$backdrop.addClass('in')
+
+ doAnimate ?
+ this.$backdrop.one($.support.transition.end, callback) :
+ callback()
+
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade')?
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
+ removeBackdrop.call(this)
+
+ } else if (callback) {
+ callback()
+ }
+ }
+
+ function removeBackdrop() {
+ this.$backdrop.remove()
+ this.$backdrop = null
+ }
+
+ function escape() {
+ var that = this
+ if (this.isShown && this.options.keyboard) {
+ $(document).on('keyup.dismiss.modal', function ( e ) {
+ e.which == 27 && that.hide()
+ })
+ } else if (!this.isShown) {
+ $(document).off('keyup.dismiss.modal')
+ }
+ }
+
+
+ /* MODAL PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.modal = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('modal')
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
+ if (typeof option == 'string') data[option]()
+ else if (options.show) data.show()
+ })
+ }
+
+ $.fn.modal.defaults = {
+ backdrop: true
+ , keyboard: true
+ , show: true
+ }
+
+ $.fn.modal.Constructor = Modal
+
+
+ /* MODAL DATA-API
+ * ============== */
+
+ $(function () {
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
+
+ e.preventDefault()
+ $target.modal(option)
+ })
+ })
+
+}(window.jQuery);
diff --git a/syte/static/js/libs/handlebars.js b/syte/static/js/libs/handlebars.js
new file mode 100644
index 0000000..83119ff
--- /dev/null
+++ b/syte/static/js/libs/handlebars.js
@@ -0,0 +1,1550 @@
+// lib/handlebars/base.js
+var Handlebars = {};
+
+Handlebars.VERSION = "1.0.beta.6";
+
+Handlebars.helpers = {};
+Handlebars.partials = {};
+
+Handlebars.registerHelper = function(name, fn, inverse) {
+ if(inverse) { fn.not = inverse; }
+ this.helpers[name] = fn;
+};
+
+Handlebars.registerPartial = function(name, str) {
+ this.partials[name] = str;
+};
+
+Handlebars.registerHelper('helperMissing', function(arg) {
+ if(arguments.length === 2) {
+ return undefined;
+ } else {
+ throw new Error("Could not find property '" + arg + "'");
+ }
+});
+
+var toString = Object.prototype.toString, functionType = "[object Function]";
+
+Handlebars.registerHelper('blockHelperMissing', function(context, options) {
+ var inverse = options.inverse || function() {}, fn = options.fn;
+
+
+ var ret = "";
+ var type = toString.call(context);
+
+ if(type === functionType) { context = context.call(this); }
+
+ if(context === true) {
+ return fn(this);
+ } else if(context === false || context == null) {
+ return inverse(this);
+ } else if(type === "[object Array]") {
+ if(context.length > 0) {
+ for(var i=0, j=context.length; i<j; i++) {
+ ret = ret + fn(context[i]);
+ }
+ } else {
+ ret = inverse(this);
+ }
+ return ret;
+ } else {
+ return fn(context);
+ }
+});
+
+Handlebars.registerHelper('each', function(context, options) {
+ var fn = options.fn, inverse = options.inverse;
+ var ret = "";
+
+ if(context && context.length > 0) {
+ for(var i=0, j=context.length; i<j; i++) {
+ ret = ret + fn(context[i]);
+ }
+ } else {
+ ret = inverse(this);
+ }
+ return ret;
+});
+
+Handlebars.registerHelper('if', function(context, options) {
+ var type = toString.call(context);
+ if(type === functionType) { context = context.call(this); }
+
+ if(!context || Handlebars.Utils.isEmpty(context)) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+});
+
+Handlebars.registerHelper('unless', function(context, options) {
+ var fn = options.fn, inverse = options.inverse;
+ options.fn = inverse;
+ options.inverse = fn;
+
+ return Handlebars.helpers['if'].call(this, context, options);
+});
+
+Handlebars.registerHelper('with', function(context, options) {
+ return options.fn(context);
+});
+
+Handlebars.registerHelper('log', function(context) {
+ Handlebars.log(context);
+});
+;
+// lib/handlebars/compiler/parser.js
+/* Jison generated parser */
+var handlebars = (function(){
+
+var parser = {trace: function trace() { },
+yy: {},
+symbols_: {"error":2,"root":3,"program":4,"EOF":5,"statements":6,"simpleInverse":7,"statement":8,"openInverse":9,"closeBlock":10,"openBlock":11,"mustache":12,"partial":13,"CONTENT":14,"COMMENT":15,"OPEN_BLOCK":16,"inMustache":17,"CLOSE":18,"OPEN_INVERSE":19,"OPEN_ENDBLOCK":20,"path":21,"OPEN":22,"OPEN_UNESCAPED":23,"OPEN_PARTIAL":24,"params":25,"hash":26,"param":27,"STRING":28,"INTEGER":29,"BOOLEAN":30,"hashSegments":31,"hashSegment":32,"ID":33,"EQUALS":34,"pathSegments":35,"SEP":36,"$accept":0,"$end":1},
+terminals_: {2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},
+productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],
+performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+
+var $0 = $$.length - 1;
+switch (yystate) {
+case 1: return $$[$0-1]
+break;
+case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0])
+break;
+case 3: this.$ = new yy.ProgramNode($$[$0])
+break;
+case 4: this.$ = new yy.ProgramNode([])
+break;
+case 5: this.$ = [$$[$0]]
+break;
+case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
+break;
+case 7: this.$ = new yy.InverseNode($$[$0-2], $$[$0-1], $$[$0])
+break;
+case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0])
+break;
+case 9: this.$ = $$[$0]
+break;
+case 10: this.$ = $$[$0]
+break;
+case 11: this.$ = new yy.ContentNode($$[$0])
+break;
+case 12: this.$ = new yy.CommentNode($$[$0])
+break;
+case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
+break;
+case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
+break;
+case 15: this.$ = $$[$0-1]
+break;
+case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1])
+break;
+case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true)
+break;
+case 18: this.$ = new yy.PartialNode($$[$0-1])
+break;
+case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1])
+break;
+case 20:
+break;
+case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]
+break;
+case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]
+break;
+case 23: this.$ = [[$$[$0-1]], $$[$0]]
+break;
+case 24: this.$ = [[$$[$0]], null]
+break;
+case 25: $$[$0-1].push($$[$0]); this.$ = $$[$0-1];
+break;
+case 26: this.$ = [$$[$0]]
+break;
+case 27: this.$ = $$[$0]
+break;
+case 28: this.$ = new yy.StringNode($$[$0])
+break;
+case 29: this.$ = new yy.IntegerNode($$[$0])
+break;
+case 30: this.$ = new yy.BooleanNode($$[$0])
+break;
+case 31: this.$ = new yy.HashNode($$[$0])
+break;
+case 32: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]
+break;
+case 33: this.$ = [$$[$0]]
+break;
+case 34: this.$ = [$$[$0-2], $$[$0]]
+break;
+case 35: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]
+break;
+case 36: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]
+break;
+case 37: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]
+break;
+case 38: this.$ = new yy.IdNode($$[$0])
+break;
+case 39: $$[$0-2].push($$[$0]); this.$ = $$[$0-2];
+break;
+case 40: this.$ = [$$[$0]]
+break;
+}
+},
+table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],
+defaultActions: {16:[2,1],37:[2,23],53:[2,21]},
+parseError: function parseError(str, hash) {
+ throw new Error(str);
+},
+parse: function parse(input) {
+ var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
+ this.lexer.setInput(input);
+ this.lexer.yy = this.yy;
+ this.yy.lexer = this.lexer;
+ if (typeof this.lexer.yylloc == "undefined")
+ this.lexer.yylloc = {};
+ var yyloc = this.lexer.yylloc;
+ lstack.push(yyloc);
+ if (typeof this.yy.parseError === "function")
+ this.parseError = this.yy.parseError;
+ function popStack(n) {
+ stack.length = stack.length - 2 * n;
+ vstack.length = vstack.length - n;
+ lstack.length = lstack.length - n;
+ }
+ function lex() {
+ var token;
+ token = self.lexer.lex() || 1;
+ if (typeof token !== "number") {
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol == null)
+ symbol = lex();
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === "undefined" || !action.length || !action[0]) {
+ if (!recovering) {
+ expected = [];
+ for (p in table[state])
+ if (this.terminals_[p] && p > 2) {
+ expected.push("'" + this.terminals_[p] + "'");
+ }
+ var errStr = "";
+ if (this.lexer.showPosition) {
+ errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + this.terminals_[symbol] + "'";
+ } else {
+ errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1?"end of input":"'" + (this.terminals_[symbol] || symbol) + "'");
+ }
+ this.parseError(errStr, {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
+ }
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0)
+ recovering--;
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column};
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+ if (typeof r !== "undefined") {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+}
+};/* Jison generated lexer */
+var lexer = (function(){
+
+var lexer = ({EOF:1,
+parseError:function parseError(str, hash) {
+ if (this.yy.parseError) {
+ this.yy.parseError(str, hash);
+ } else {
+ throw new Error(str);
+ }
+ },
+setInput:function (input) {
+ this._input = input;
+ this._more = this._less = this.done = false;
+ this.yylineno = this.yyleng = 0;
+ this.yytext = this.matched = this.match = '';
+ this.conditionStack = ['INITIAL'];
+ this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};
+ return this;
+ },
+input:function () {
+ var ch = this._input[0];
+ this.yytext+=ch;
+ this.yyleng++;
+ this.match+=ch;
+ this.matched+=ch;
+ var lines = ch.match(/\n/);
+ if (lines) this.yylineno++;
+ this._input = this._input.slice(1);
+ return ch;
+ },
+unput:function (ch) {
+ this._input = ch + this._input;
+ return this;
+ },
+more:function () {
+ this._more = true;
+ return this;
+ },
+pastInput:function () {
+ var past = this.matched.substr(0, this.matched.length - this.match.length);
+ return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, "");
+ },
+upcomingInput:function () {
+ var next = this.match;
+ if (next.length < 20) {
+ next += this._input.substr(0, 20-next.length);
+ }
+ return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\n/g, "");
+ },
+showPosition:function () {
+ var pre = this.pastInput();
+ var c = new Array(pre.length + 1).join("-");
+ return pre + this.upcomingInput() + "\n" + c+"^";
+ },
+next:function () {
+ if (this.done) {
+ return this.EOF;
+ }
+ if (!this._input) this.done = true;
+
+ var token,
+ match,
+ col,
+ lines;
+ if (!this._more) {
+ this.yytext = '';
+ this.match = '';
+ }
+ var rules = this._currentRules();
+ for (var i=0;i < rules.length; i++) {
+ match = this._input.match(this.rules[rules[i]]);
+ if (match) {
+ lines = match[0].match(/\n.*/g);
+ if (lines) this.yylineno += lines.length;
+ this.yylloc = {first_line: this.yylloc.last_line,
+ last_line: this.yylineno+1,
+ first_column: this.yylloc.last_column,
+ last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length}
+ this.yytext += match[0];
+ this.match += match[0];
+ this.matches = match;
+ this.yyleng = this.yytext.length;
+ this._more = false;
+ this._input = this._input.slice(match[0].length);
+ this.matched += match[0];
+ token = this.performAction.call(this, this.yy, this, rules[i],this.conditionStack[this.conditionStack.length-1]);
+ if (token) return token;
+ else return;
+ }
+ }
+ if (this._input === "") {
+ return this.EOF;
+ } else {
+ this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
+ {text: "", token: null, line: this.yylineno});
+ }
+ },
+lex:function lex() {
+ var r = this.next();
+ if (typeof r !== 'undefined') {
+ return r;
+ } else {
+ return this.lex();
+ }
+ },
+begin:function begin(condition) {
+ this.conditionStack.push(condition);
+ },
+popState:function popState() {
+ return this.conditionStack.pop();
+ },
+_currentRules:function _currentRules() {
+ return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;
+ },
+topState:function () {
+ return this.conditionStack[this.conditionStack.length-2];
+ },
+pushState:function begin(condition) {
+ this.begin(condition);
+ }});
+lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
+
+var YYSTATE=YY_START
+switch($avoiding_name_collisions) {
+case 0:
+ if(yy_.yytext.slice(-1) !== "\\") this.begin("mu");
+ if(yy_.yytext.slice(-1) === "\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin("emu");
+ if(yy_.yytext) return 14;
+
+break;
+case 1: return 14;
+break;
+case 2: this.popState(); return 14;
+break;
+case 3: return 24;
+break;
+case 4: return 16;
+break;
+case 5: return 20;
+break;
+case 6: return 19;
+break;
+case 7: return 19;
+break;
+case 8: return 23;
+break;
+case 9: return 23;
+break;
+case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15;
+break;
+case 11: return 22;
+break;
+case 12: return 34;
+break;
+case 13: return 33;
+break;
+case 14: return 33;
+break;
+case 15: return 36;
+break;
+case 16: /*ignore whitespace*/
+break;
+case 17: this.popState(); return 18;
+break;
+case 18: this.popState(); return 18;
+break;
+case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\"/g,'"'); return 28;
+break;
+case 20: return 30;
+break;
+case 21: return 30;
+break;
+case 22: return 29;
+break;
+case 23: return 33;
+break;
+case 24: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 33;
+break;
+case 25: return 'INVALID';
+break;
+case 26: return 5;
+break;
+}
+};
+lexer.rules = [/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/];
+lexer.conditions = {"mu":{"rules":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],"inclusive":false},"emu":{"rules":[2],"inclusive":false},"INITIAL":{"rules":[0,1,26],"inclusive":true}};return lexer;})()
+parser.lexer = lexer;
+return parser;
+})();
+if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
+exports.parser = handlebars;
+exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }
+exports.main = function commonjsMain(args) {
+ if (!args[1])
+ throw new Error('Usage: '+args[0]+' FILE');
+ if (typeof process !== 'undefined') {
+ var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
+ } else {
+ var cwd = require("file").path(require("file").cwd());
+ var source = cwd.join(args[1]).read({charset: "utf-8"});
+ }
+ return exports.parser.parse(source);
+}
+if (typeof module !== 'undefined' && require.main === module) {
+ exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
+}
+};
+;
+// lib/handlebars/compiler/base.js
+Handlebars.Parser = handlebars;
+
+Handlebars.parse = function(string) {
+ Handlebars.Parser.yy = Handlebars.AST;
+ return Handlebars.Parser.parse(string);
+};
+
+Handlebars.print = function(ast) {
+ return new Handlebars.PrintVisitor().accept(ast);
+};
+
+Handlebars.logger = {
+ DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,
+
+ // override in the host environment
+ log: function(level, str) {}
+};
+
+Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };
+;
+// lib/handlebars/compiler/ast.js
+(function() {
+
+ Handlebars.AST = {};
+
+ Handlebars.AST.ProgramNode = function(statements, inverse) {
+ this.type = "program";
+ this.statements = statements;
+ if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }
+ };
+
+ Handlebars.AST.MustacheNode = function(params, hash, unescaped) {
+ this.type = "mustache";
+ this.id = params[0];
+ this.params = params.slice(1);
+ this.hash = hash;
+ this.escaped = !unescaped;
+ };
+
+ Handlebars.AST.PartialNode = function(id, context) {
+ this.type = "partial";
+
+ // TODO: disallow complex IDs
+
+ this.id = id;
+ this.context = context;
+ };
+
+ var verifyMatch = function(open, close) {
+ if(open.original !== close.original) {
+ throw new Handlebars.Exception(open.original + " doesn't match " + close.original);
+ }
+ };
+
+ Handlebars.AST.BlockNode = function(mustache, program, close) {
+ verifyMatch(mustache.id, close);
+ this.type = "block";
+ this.mustache = mustache;
+ this.program = program;
+ };
+
+ Handlebars.AST.InverseNode = function(mustache, program, close) {
+ verifyMatch(mustache.id, close);
+ this.type = "inverse";
+ this.mustache = mustache;
+ this.program = program;
+ };
+
+ Handlebars.AST.ContentNode = function(string) {
+ this.type = "content";
+ this.string = string;
+ };
+
+ Handlebars.AST.HashNode = function(pairs) {
+ this.type = "hash";
+ this.pairs = pairs;
+ };
+
+ Handlebars.AST.IdNode = function(parts) {
+ this.type = "ID";
+ this.original = parts.join(".");
+
+ var dig = [], depth = 0;
+
+ for(var i=0,l=parts.length; i<l; i++) {
+ var part = parts[i];
+
+ if(part === "..") { depth++; }
+ else if(part === "." || part === "this") { this.isScoped = true; }
+ else { dig.push(part); }
+ }
+
+ this.parts = dig;
+ this.string = dig.join('.');
+ this.depth = depth;
+ this.isSimple = (dig.length === 1) && (depth === 0);
+ };
+
+ Handlebars.AST.StringNode = function(string) {
+ this.type = "STRING";
+ this.string = string;
+ };
+
+ Handlebars.AST.IntegerNode = function(integer) {
+ this.type = "INTEGER";
+ this.integer = integer;
+ };
+
+ Handlebars.AST.BooleanNode = function(bool) {
+ this.type = "BOOLEAN";
+ this.bool = bool;
+ };
+
+ Handlebars.AST.CommentNode = function(comment) {
+ this.type = "comment";
+ this.comment = comment;
+ };
+
+})();;
+// lib/handlebars/utils.js
+Handlebars.Exception = function(message) {
+ var tmp = Error.prototype.constructor.apply(this, arguments);
+
+ for (var p in tmp) {
+ if (tmp.hasOwnProperty(p)) { this[p] = tmp[p]; }
+ }
+
+ this.message = tmp.message;
+};
+Handlebars.Exception.prototype = new Error;
+
+// Build out our basic SafeString type
+Handlebars.SafeString = function(string) {
+ this.string = string;
+};
+Handlebars.SafeString.prototype.toString = function() {
+ return this.string.toString();
+};
+
+(function() {
+ var escape = {
+ "<": "&lt;",
+ ">": "&gt;",
+ '"': "&quot;",
+ "'": "&#x27;",
+ "`": "&#x60;"
+ };
+
+ var badChars = /&(?!\w+;)|[<>"'`]/g;
+ var possible = /[&<>"'`]/;
+
+ var escapeChar = function(chr) {
+ return escape[chr] || "&amp;";
+ };
+
+ Handlebars.Utils = {
+ escapeExpression: function(string) {
+ // don't escape SafeStrings, since they're already safe
+ if (string instanceof Handlebars.SafeString) {
+ return string.toString();
+ } else if (string == null || string === false) {
+ return "";
+ }
+
+ if(!possible.test(string)) { return string; }
+ return string.replace(badChars, escapeChar);
+ },
+
+ isEmpty: function(value) {
+ if (typeof value === "undefined") {
+ return true;
+ } else if (value === null) {
+ return true;
+ } else if (value === false) {
+ return true;
+ } else if(Object.prototype.toString.call(value) === "[object Array]" && value.length === 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ };
+})();;
+// lib/handlebars/compiler/compiler.js
+Handlebars.Compiler = function() {};
+Handlebars.JavaScriptCompiler = function() {};
+
+(function(Compiler, JavaScriptCompiler) {
+ Compiler.OPCODE_MAP = {
+ appendContent: 1,
+ getContext: 2,
+ lookupWithHelpers: 3,
+ lookup: 4,
+ append: 5,
+ invokeMustache: 6,
+ appendEscaped: 7,
+ pushString: 8,
+ truthyOrFallback: 9,
+ functionOrFallback: 10,
+ invokeProgram: 11,
+ invokePartial: 12,
+ push: 13,
+ assignToHash: 15,
+ pushStringParam: 16
+ };
+
+ Compiler.MULTI_PARAM_OPCODES = {
+ appendContent: 1,
+ getContext: 1,
+ lookupWithHelpers: 2,
+ lookup: 1,
+ invokeMustache: 3,
+ pushString: 1,
+ truthyOrFallback: 1,
+ functionOrFallback: 1,
+ invokeProgram: 3,
+ invokePartial: 1,
+ push: 1,
+ assignToHash: 1,
+ pushStringParam: 1
+ };
+
+ Compiler.DISASSEMBLE_MAP = {};
+
+ for(var prop in Compiler.OPCODE_MAP) {
+ var value = Compiler.OPCODE_MAP[prop];
+ Compiler.DISASSEMBLE_MAP[value] = prop;
+ }
+
+ Compiler.multiParamSize = function(code) {
+ return Compiler.MULTI_PARAM_OPCODES[Compiler.DISASSEMBLE_MAP[code]];
+ };
+
+ Compiler.prototype = {
+ compiler: Compiler,
+
+ disassemble: function() {
+ var opcodes = this.opcodes, opcode, nextCode;
+ var out = [], str, name, value;
+
+ for(var i=0, l=opcodes.length; i<l; i++) {
+ opcode = opcodes[i];
+
+ if(opcode === 'DECLARE') {
+ name = opcodes[++i];
+ value = opcodes[++i];
+ out.push("DECLARE " + name + " = " + value);
+ } else {
+ str = Compiler.DISASSEMBLE_MAP[opcode];
+
+ var extraParams = Compiler.multiParamSize(opcode);
+ var codes = [];
+
+ for(var j=0; j<extraParams; j++) {
+ nextCode = opcodes[++i];
+
+ if(typeof nextCode === "string") {
+ nextCode = "\"" + nextCode.replace("\n", "\\n") + "\"";
+ }
+
+ codes.push(nextCode);
+ }
+
+ str = str + " " + codes.join(" ");
+
+ out.push(str);
+ }
+ }
+
+ return out.join("\n");
+ },
+
+ guid: 0,
+
+ compile: function(program, options) {
+ this.children = [];
+ this.depths = {list: []};
+ this.options = options;
+
+ // These changes will propagate to the other compiler components
+ var knownHelpers = this.options.knownHelpers;
+ this.options.knownHelpers = {
+ 'helperMissing': true,
+ 'blockHelperMissing': true,
+ 'each': true,
+ 'if': true,
+ 'unless': true,
+ 'with': true,
+ 'log': true
+ };
+ if (knownHelpers) {
+ for (var name in knownHelpers) {
+ this.options.knownHelpers[name] = knownHelpers[name];
+ }
+ }
+
+ return this.program(program);
+ },
+
+ accept: function(node) {
+ return this[node.type](node);
+ },
+
+ program: function(program) {
+ var statements = program.statements, statement;
+ this.opcodes = [];
+
+ for(var i=0, l=statements.length; i<l; i++) {
+ statement = statements[i];
+ this[statement.type](statement);
+ }
+ this.isSimple = l === 1;
+
+ this.depths.list = this.depths.list.sort(function(a, b) {
+ return a - b;
+ });
+
+ return this;
+ },
+
+ compileProgram: function(program) {
+ var result = new this.compiler().compile(program, this.options);
+ var guid = this.guid++;
+
+ this.usePartial = this.usePartial || result.usePartial;
+
+ this.children[guid] = result;
+
+ for(var i=0, l=result.depths.list.length; i<l; i++) {
+ depth = result.depths.list[i];
+
+ if(depth < 2) { continue; }
+ else { this.addDepth(depth - 1); }
+ }
+
+ return guid;
+ },
+
+ block: function(block) {
+ var mustache = block.mustache;
+ var depth, child, inverse, inverseGuid;
+
+ var params = this.setupStackForMustache(mustache);
+
+ var programGuid = this.compileProgram(block.program);
+
+ if(block.program.inverse) {
+ inverseGuid = this.compileProgram(block.program.inverse);
+ this.declare('inverse', inverseGuid);
+ }
+
+ this.opcode('invokeProgram', programGuid, params.length, !!mustache.hash);
+ this.declare('inverse', null);
+ this.opcode('append');
+ },
+
+ inverse: function(block) {
+ var params = this.setupStackForMustache(block.mustache);
+
+ var programGuid = this.compileProgram(block.program);
+
+ this.declare('inverse', programGuid);
+
+ this.opcode('invokeProgram', null, params.length, !!block.mustache.hash);
+ this.declare('inverse', null);
+ this.opcode('append');
+ },
+
+ hash: function(hash) {
+ var pairs = hash.pairs, pair, val;
+
+ this.opcode('push', '{}');
+
+ for(var i=0, l=pairs.length; i<l; i++) {
+ pair = pairs[i];
+ val = pair[1];
+
+ this.accept(val);
+ this.opcode('assignToHash', pair[0]);
+ }
+ },
+
+ partial: function(partial) {
+ var id = partial.id;
+ this.usePartial = true;
+
+ if(partial.context) {
+ this.ID(partial.context);
+ } else {
+ this.opcode('push', 'depth0');
+ }
+
+ this.opcode('invokePartial', id.original);
+ this.opcode('append');
+ },
+
+ content: function(content) {
+ this.opcode('appendContent', content.string);
+ },
+
+ mustache: function(mustache) {
+ var params = this.setupStackForMustache(mustache);
+
+ this.opcode('invokeMustache', params.length, mustache.id.original, !!mustache.hash);
+
+ if(mustache.escaped && !this.options.noEscape) {
+ this.opcode('appendEscaped');
+ } else {
+ this.opcode('append');
+ }
+ },
+
+ ID: function(id) {
+ this.addDepth(id.depth);
+
+ this.opcode('getContext', id.depth);
+
+ this.opcode('lookupWithHelpers', id.parts[0] || null, id.isScoped || false);
+
+ for(var i=1, l=id.parts.length; i<l; i++) {
+ this.opcode('lookup', id.parts[i]);
+ }
+ },
+
+ STRING: function(string) {
+ this.opcode('pushString', string.string);
+ },
+
+ INTEGER: function(integer) {
+ this.opcode('push', integer.integer);
+ },
+
+ BOOLEAN: function(bool) {
+ this.opcode('push', bool.bool);
+ },
+
+ comment: function() {},
+
+ // HELPERS
+ pushParams: function(params) {
+ var i = params.length, param;
+
+ while(i--) {
+ param = params[i];
+
+ if(this.options.stringParams) {
+ if(param.depth) {
+ this.addDepth(param.depth);
+ }
+
+ this.opcode('getContext', param.depth || 0);
+ this.opcode('pushStringParam', param.string);
+ } else {
+ this[param.type](param);
+ }
+ }
+ },
+
+ opcode: function(name, val1, val2, val3) {
+ this.opcodes.push(Compiler.OPCODE_MAP[name]);
+ if(val1 !== undefined) { this.opcodes.push(val1); }
+ if(val2 !== undefined) { this.opcodes.push(val2); }
+ if(val3 !== undefined) { this.opcodes.push(val3); }
+ },
+
+ declare: function(name, value) {
+ this.opcodes.push('DECLARE');
+ this.opcodes.push(name);
+ this.opcodes.push(value);
+ },
+
+ addDepth: function(depth) {
+ if(depth === 0) { return; }
+
+ if(!this.depths[depth]) {
+ this.depths[depth] = true;
+ this.depths.list.push(depth);
+ }
+ },
+
+ setupStackForMustache: function(mustache) {
+ var params = mustache.params;
+
+ this.pushParams(params);
+
+ if(mustache.hash) {
+ this.hash(mustache.hash);
+ }
+
+ this.ID(mustache.id);
+
+ return params;
+ }
+ };
+
+ JavaScriptCompiler.prototype = {
+ // PUBLIC API: You can override these methods in a subclass to provide
+ // alternative compiled forms for name lookup and buffering semantics
+ nameLookup: function(parent, name, type) {
+ if (/^[0-9]+$/.test(name)) {
+ return parent + "[" + name + "]";
+ } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
+ return parent + "." + name;
+ }
+ else {
+ return parent + "['" + name + "']";
+ }
+ },
+
+ appendToBuffer: function(string) {
+ if (this.environment.isSimple) {
+ return "return " + string + ";";
+ } else {
+ return "buffer += " + string + ";";
+ }
+ },
+
+ initializeBuffer: function() {
+ return this.quotedString("");
+ },
+
+ namespace: "Handlebars",
+ // END PUBLIC API
+
+ compile: function(environment, options, context, asObject) {
+ this.environment = environment;
+ this.options = options || {};
+
+ this.name = this.environment.name;
+ this.isChild = !!context;
+ this.context = context || {
+ programs: [],
+ aliases: { self: 'this' },
+ registers: {list: []}
+ };
+
+ this.preamble();
+
+ this.stackSlot = 0;
+ this.stackVars = [];
+
+ this.compileChildren(environment, options);
+
+ var opcodes = environment.opcodes, opcode;
+
+ this.i = 0;
+
+ for(l=opcodes.length; this.i<l; this.i++) {
+ opcode = this.nextOpcode(0);
+
+ if(opcode[0] === 'DECLARE') {
+ this.i = this.i + 2;
+ this[opcode[1]] = opcode[2];
+ } else {
+ this.i = this.i + opcode[1].length;
+ this[opcode[0]].apply(this, opcode[1]);
+ }
+ }
+
+ return this.createFunctionContext(asObject);
+ },
+
+ nextOpcode: function(n) {
+ var opcodes = this.environment.opcodes, opcode = opcodes[this.i + n], name, val;
+ var extraParams, codes;
+
+ if(opcode === 'DECLARE') {
+ name = opcodes[this.i + 1];
+ val = opcodes[this.i + 2];
+ return ['DECLARE', name, val];
+ } else {
+ name = Compiler.DISASSEMBLE_MAP[opcode];
+
+ extraParams = Compiler.multiParamSize(opcode);
+ codes = [];
+
+ for(var j=0; j<extraParams; j++) {
+ codes.push(opcodes[this.i + j + 1 + n]);
+ }
+
+ return [name, codes];
+ }
+ },
+
+ eat: function(opcode) {
+ this.i = this.i + opcode.length;
+ },
+
+ preamble: function() {
+ var out = [];
+
+ // this register will disambiguate helper lookup from finding a function in
+ // a context. This is necessary for mustache compatibility, which requires
+ // that context functions in blocks are evaluated by blockHelperMissing, and
+ // then proceed as if the resulting value was provided to blockHelperMissing.
+ this.useRegister('foundHelper');
+
+ if (!this.isChild) {
+ var namespace = this.namespace;
+ var copies = "helpers = helpers || " + namespace + ".helpers;";
+ if(this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
+ out.push(copies);
+ } else {
+ out.push('');
+ }
+
+ if (!this.environment.isSimple) {
+ out.push(", buffer = " + this.initializeBuffer());
+ } else {
+ out.push("");
+ }
+
+ // track the last context pushed into place to allow skipping the
+ // getContext opcode when it would be a noop
+ this.lastContext = 0;
+ this.source = out;
+ },
+
+ createFunctionContext: function(asObject) {
+ var locals = this.stackVars;
+ if (!this.isChild) {
+ locals = locals.concat(this.context.registers.list);
+ }
+
+ if(locals.length > 0) {
+ this.source[1] = this.source[1] + ", " + locals.join(", ");
+ }
+
+ // Generate minimizer alias mappings
+ if (!this.isChild) {
+ var aliases = []
+ for (var alias in this.context.aliases) {
+ this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];
+ }
+ }
+
+ if (this.source[1]) {
+ this.source[1] = "var " + this.source[1].substring(2) + ";";
+ }
+
+ // Merge children
+ if (!this.isChild) {
+ this.source[1] += '\n' + this.context.programs.join('\n') + '\n';
+ }
+
+ if (!this.environment.isSimple) {
+ this.source.push("return buffer;");
+ }
+
+ var params = this.isChild ? ["depth0", "data"] : ["Handlebars", "depth0", "helpers", "partials", "data"];
+
+ for(var i=0, l=this.environment.depths.list.length; i<l; i++) {
+ params.push("depth" + this.environment.depths.list[i]);
+ }
+
+ if (asObject) {
+ params.push(this.source.join("\n "));
+
+ return Function.apply(this, params);
+ } else {
+ var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\n ' + this.source.join("\n ") + '}';
+ Handlebars.log(Handlebars.logger.DEBUG, functionSource + "\n\n");
+ return functionSource;
+ }
+ },
+
+ appendContent: function(content) {
+ this.source.push(this.appendToBuffer(this.quotedString(content)));
+ },
+
+ append: function() {
+ var local = this.popStack();
+ this.source.push("if(" + local + " || " + local + " === 0) { " + this.appendToBuffer(local) + " }");
+ if (this.environment.isSimple) {
+ this.source.push("else { " + this.appendToBuffer("''") + " }");
+ }
+ },
+
+ appendEscaped: function() {
+ var opcode = this.nextOpcode(1), extra = "";
+ this.context.aliases.escapeExpression = 'this.escapeExpression';
+
+ if(opcode[0] === 'appendContent') {
+ extra = " + " + this.quotedString(opcode[1][0]);
+ this.eat(opcode);
+ }
+
+ this.source.push(this.appendToBuffer("escapeExpression(" + this.popStack() + ")" + extra));
+ },
+
+ getContext: function(depth) {
+ if(this.lastContext !== depth) {
+ this.lastContext = depth;
+ }
+ },
+
+ lookupWithHelpers: function(name, isScoped) {
+ if(name) {
+ var topStack = this.nextStack();
+
+ this.usingKnownHelper = false;
+
+ var toPush;
+ if (!isScoped && this.options.knownHelpers[name]) {
+ toPush = topStack + " = " + this.nameLookup('helpers', name, 'helper');
+ this.usingKnownHelper = true;
+ } else if (isScoped || this.options.knownHelpersOnly) {
+ toPush = topStack + " = " + this.nameLookup('depth' + this.lastContext, name, 'context');
+ } else {
+ this.register('foundHelper', this.nameLookup('helpers', name, 'helper'));
+ toPush = topStack + " = foundHelper || " + this.nameLookup('depth' + this.lastContext, name, 'context');
+ }
+
+ toPush += ';';
+ this.source.push(toPush);
+ } else {
+ this.pushStack('depth' + this.lastContext);
+ }
+ },
+
+ lookup: function(name) {
+ var topStack = this.topStack();
+ this.source.push(topStack + " = (" + topStack + " === null || " + topStack + " === undefined || " + topStack + " === false ? " +
+ topStack + " : " + this.nameLookup(topStack, name, 'context') + ");");
+ },
+
+ pushStringParam: function(string) {
+ this.pushStack('depth' + this.lastContext);
+ this.pushString(string);
+ },
+
+ pushString: function(string) {
+ this.pushStack(this.quotedString(string));
+ },
+
+ push: function(name) {
+ this.pushStack(name);
+ },
+
+ invokeMustache: function(paramSize, original, hasHash) {
+ this.populateParams(paramSize, this.quotedString(original), "{}", null, hasHash, function(nextStack, helperMissingString, id) {
+ if (!this.usingKnownHelper) {
+ this.context.aliases.helperMissing = 'helpers.helperMissing';
+ this.context.aliases.undef = 'void 0';
+ this.source.push("else if(" + id + "=== undef) { " + nextStack + " = helperMissing.call(" + helperMissingString + "); }");
+ if (nextStack !== id) {
+ this.source.push("else { " + nextStack + " = " + id + "; }");
+ }
+ }
+ });
+ },
+
+ invokeProgram: function(guid, paramSize, hasHash) {
+ var inverse = this.programExpression(this.inverse);
+ var mainProgram = this.programExpression(guid);
+
+ this.populateParams(paramSize, null, mainProgram, inverse, hasHash, function(nextStack, helperMissingString, id) {
+ if (!this.usingKnownHelper) {
+ this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';
+ this.source.push("else { " + nextStack + " = blockHelperMissing.call(" + helperMissingString + "); }");
+ }
+ });
+ },
+
+ populateParams: function(paramSize, helperId, program, inverse, hasHash, fn) {
+ var needsRegister = hasHash || this.options.stringParams || inverse || this.options.data;
+ var id = this.popStack(), nextStack;
+ var params = [], param, stringParam, stringOptions;
+
+ if (needsRegister) {
+ this.register('tmp1', program);
+ stringOptions = 'tmp1';
+ } else {
+ stringOptions = '{ hash: {} }';
+ }
+
+ if (needsRegister) {
+ var hash = (hasHash ? this.popStack() : '{}');
+ this.source.push('tmp1.hash = ' + hash + ';');
+ }
+
+ if(this.options.stringParams) {
+ this.source.push('tmp1.contexts = [];');
+ }
+
+ for(var i=0; i<paramSize; i++) {
+ param = this.popStack();
+ params.push(param);
+
+ if(this.options.stringParams) {
+ this.source.push('tmp1.contexts.push(' + this.popStack() + ');');
+ }
+ }
+
+ if(inverse) {
+ this.source.push('tmp1.fn = tmp1;');
+ this.source.push('tmp1.inverse = ' + inverse + ';');
+ }
+
+ if(this.options.data) {
+ this.source.push('tmp1.data = data;');
+ }
+
+ params.push(stringOptions);
+
+ this.populateCall(params, id, helperId || id, fn, program !== '{}');
+ },
+
+ populateCall: function(params, id, helperId, fn, program) {
+ var paramString = ["depth0"].concat(params).join(", ");
+ var helperMissingString = ["depth0"].concat(helperId).concat(params).join(", ");
+
+ var nextStack = this.nextStack();
+
+ if (this.usingKnownHelper) {
+ this.source.push(nextStack + " = " + id + ".call(" + paramString + ");");
+ } else {
+ this.context.aliases.functionType = '"function"';
+ var condition = program ? "foundHelper && " : ""
+ this.source.push("if(" + condition + "typeof " + id + " === functionType) { " + nextStack + " = " + id + ".call(" + paramString + "); }");
+ }
+ fn.call(this, nextStack, helperMissingString, id);
+ this.usingKnownHelper = false;
+ },
+
+ invokePartial: function(context) {
+ params = [this.nameLookup('partials', context, 'partial'), "'" + context + "'", this.popStack(), "helpers", "partials"];
+
+ if (this.options.data) {
+ params.push("data");
+ }
+
+ this.pushStack("self.invokePartial(" + params.join(", ") + ");");
+ },
+
+ assignToHash: function(key) {
+ var value = this.popStack();
+ var hash = this.topStack();
+
+ this.source.push(hash + "['" + key + "'] = " + value + ";");
+ },
+
+ // HELPERS
+
+ compiler: JavaScriptCompiler,
+
+ compileChildren: function(environment, options) {
+ var children = environment.children, child, compiler;
+
+ for(var i=0, l=children.length; i<l; i++) {
+ child = children[i];
+ compiler = new this.compiler();
+
+ this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children
+ var index = this.context.programs.length;
+ child.index = index;
+ child.name = 'program' + index;
+ this.context.programs[index] = compiler.compile(child, options, this.context);
+ }
+ },
+
+ programExpression: function(guid) {
+ if(guid == null) { return "self.noop"; }
+
+ var child = this.environment.children[guid],
+ depths = child.depths.list;
+ var programParams = [child.index, child.name, "data"];
+
+ for(var i=0, l = depths.length; i<l; i++) {
+ depth = depths[i];
+
+ if(depth === 1) { programParams.push("depth0"); }
+ else { programParams.push("depth" + (depth - 1)); }
+ }
+
+ if(depths.length === 0) {
+ return "self.program(" + programParams.join(", ") + ")";
+ } else {
+ programParams.shift();
+ return "self.programWithDepth(" + programParams.join(", ") + ")";
+ }
+ },
+
+ register: function(name, val) {
+ this.useRegister(name);
+ this.source.push(name + " = " + val + ";");
+ },
+
+ useRegister: function(name) {
+ if(!this.context.registers[name]) {
+ this.context.registers[name] = true;
+ this.context.registers.list.push(name);
+ }
+ },
+
+ pushStack: function(item) {
+ this.source.push(this.nextStack() + " = " + item + ";");
+ return "stack" + this.stackSlot;
+ },
+
+ nextStack: function() {
+ this.stackSlot++;
+ if(this.stackSlot > this.stackVars.length) { this.stackVars.push("stack" + this.stackSlot); }
+ return "stack" + this.stackSlot;
+ },
+
+ popStack: function() {
+ return "stack" + this.stackSlot--;
+ },
+
+ topStack: function() {
+ return "stack" + this.stackSlot;
+ },
+
+ quotedString: function(str) {
+ return '"' + str
+ .replace(/\\/g, '\\\\')
+ .replace(/"/g, '\\"')
+ .replace(/\n/g, '\\n')
+ .replace(/\r/g, '\\r') + '"';
+ }
+ };
+
+ var reservedWords = (
+ "break else new var" +
+ " case finally return void" +
+ " catch for switch while" +
+ " continue function this with" +
+ " default if throw" +
+ " delete in try" +
+ " do instanceof typeof" +
+ " abstract enum int short" +
+ " boolean export interface static" +
+ " byte extends long super" +
+ " char final native synchronized" +
+ " class float package throws" +
+ " const goto private transient" +
+ " debugger implements protected volatile" +
+ " double import public let yield"
+ ).split(" ");
+
+ var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
+
+ for(var i=0, l=reservedWords.length; i<l; i++) {
+ compilerWords[reservedWords[i]] = true;
+ }
+
+ JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
+ if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {
+ return true;
+ }
+ return false;
+ }
+
+})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
+
+Handlebars.precompile = function(string, options) {
+ options = options || {};
+
+ var ast = Handlebars.parse(string);
+ var environment = new Handlebars.Compiler().compile(ast, options);
+ return new Handlebars.JavaScriptCompiler().compile(environment, options);
+};
+
+Handlebars.compile = function(string, options) {
+ options = options || {};
+
+ var compiled;
+ function compile() {
+ var ast = Handlebars.parse(string);
+ var environment = new Handlebars.Compiler().compile(ast, options);
+ var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);
+ return Handlebars.template(templateSpec);
+ }
+
+ // Template is only compiled on first use and cached after that point.
+ return function(context, options) {
+ if (!compiled) {
+ compiled = compile();
+ }
+ return compiled.call(this, context, options);
+ };
+};
+;
+// lib/handlebars/runtime.js
+Handlebars.VM = {
+ template: function(templateSpec) {
+ // Just add water
+ var container = {
+ escapeExpression: Handlebars.Utils.escapeExpression,
+ invokePartial: Handlebars.VM.invokePartial,
+ programs: [],
+ program: function(i, fn, data) {
+ var programWrapper = this.programs[i];
+ if(data) {
+ return Handlebars.VM.program(fn, data);
+ } else if(programWrapper) {
+ return programWrapper;
+ } else {
+ programWrapper = this.programs[i] = Handlebars.VM.program(fn);
+ return programWrapper;
+ }
+ },
+ programWithDepth: Handlebars.VM.programWithDepth,
+ noop: Handlebars.VM.noop
+ };
+
+ return function(context, options) {
+ options = options || {};
+ return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);
+ };
+ },
+
+ programWithDepth: function(fn, data, $depth) {
+ var args = Array.prototype.slice.call(arguments, 2);
+
+ return function(context, options) {
+ options = options || {};
+
+ return fn.apply(this, [context, options.data || data].concat(args));
+ };
+ },
+ program: function(fn, data) {
+ return function(context, options) {
+ options = options || {};
+
+ return fn(context, options.data || data);
+ };
+ },
+ noop: function() { return ""; },
+ invokePartial: function(partial, name, context, helpers, partials, data) {
+ options = { helpers: helpers, partials: partials, data: data };
+
+ if(partial === undefined) {
+ throw new Handlebars.Exception("The partial " + name + " could not be found");
+ } else if(partial instanceof Function) {
+ return partial(context, options);
+ } else if (!Handlebars.compile) {
+ throw new Handlebars.Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
+ } else {
+ partials[name] = Handlebars.compile(partial);
+ return partials[name](context, options);
+ }
+ }
+};
+
+Handlebars.template = Handlebars.VM.template;
+;
diff --git a/syte/static/js/libs/jquery.url.js b/syte/static/js/libs/jquery.url.js
new file mode 100755
index 0000000..6618526
--- /dev/null
+++ b/syte/static/js/libs/jquery.url.js
@@ -0,0 +1,162 @@
+/*
+ * JQuery URL Parser plugin
+ * Developed and maintanined by Mark Perkins, mark@allmarkedup.com
+ * Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
+ * Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
+ */
+
+;(function($, undefined) {
+
+ var tag2attr = {
+ a : 'href',
+ img : 'src',
+ form : 'action',
+ base : 'href',
+ script : 'src',
+ iframe : 'src',
+ link : 'href'
+ },
+
+ key = ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"], // keys available to query
+
+ aliases = { "anchor" : "fragment" }, // aliases for backwards compatability
+
+ parser = {
+ strict : /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, //less intuitive, more accurate to the specs
+ loose : /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ // more intuitive, fails on relative paths and deviates from specs
+ },
+
+ querystring_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g, // supports both ampersand and semicolon-delimted query string key/value pairs
+
+ fragment_parser = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g; // supports both ampersand and semicolon-delimted fragment key/value pairs
+
+ function parseUri( url, strictMode )
+ {
+ var str = decodeURI( url ),
+ res = parser[ strictMode || false ? "strict" : "loose" ].exec( str ),
+ uri = { attr : {}, param : {}, seg : {} },
+ i = 14;
+
+ while ( i-- )
+ {
+ uri.attr[ key[i] ] = res[i] || "";
+ }
+
+ // build query and fragment parameters
+
+ uri.param['query'] = {};
+ uri.param['fragment'] = {};
+
+ uri.attr['query'].replace( querystring_parser, function ( $0, $1, $2 ){
+ if ($1)
+ {
+ uri.param['query'][$1] = $2;
+ }
+ });
+
+ uri.attr['fragment'].replace( fragment_parser, function ( $0, $1, $2 ){
+ if ($1)
+ {
+ uri.param['fragment'][$1] = $2;
+ }
+ });
+
+ // split path and fragement into segments
+
+ uri.seg['path'] = uri.attr.path.replace(/^\/+|\/+$/g,'').split('/');
+
+ uri.seg['fragment'] = uri.attr.fragment.replace(/^\/+|\/+$/g,'').split('/');
+
+ // compile a 'base' domain attribute
+
+ uri.attr['base'] = uri.attr.host ? uri.attr.protocol+"://"+uri.attr.host + (uri.attr.port ? ":"+uri.attr.port : '') : '';
+
+ return uri;
+ };
+
+ function getAttrName( elm )
+ {
+ var tn = elm.tagName;
+ if ( tn !== undefined ) return tag2attr[tn.toLowerCase()];
+ return tn;
+ }
+
+ $.fn.url = function( strictMode )
+ {
+ var url = '';
+
+ if ( this.length )
+ {
+ url = $(this).attr( getAttrName(this[0]) ) || '';
+ }
+
+ return $.url( url, strictMode );
+ };
+
+ $.url = function( url, strictMode )
+ {
+ if ( arguments.length === 1 && url === true )
+ {
+ strictMode = true;
+ url = undefined;
+ }
+
+ strictMode = strictMode || false;
+ url = url || window.location.toString();
+
+ return {
+
+ data : parseUri(url, strictMode),
+
+ // get various attributes from the URI
+ attr : function( attr )
+ {
+ attr = aliases[attr] || attr;
+ return attr !== undefined ? this.data.attr[attr] : this.data.attr;
+ },
+
+ // return query string parameters
+ param : function( param )
+ {
+ return param !== undefined ? this.data.param.query[param] : this.data.param.query;
+ },
+
+ // return fragment parameters
+ fparam : function( param )
+ {
+ return param !== undefined ? this.data.param.fragment[param] : this.data.param.fragment;
+ },
+
+ // return path segments
+ segment : function( seg )
+ {
+ if ( seg === undefined )
+ {
+ return this.data.seg.path;
+ }
+ else
+ {
+ seg = seg < 0 ? this.data.seg.path.length + seg : seg - 1; // negative segments count from the end
+ return this.data.seg.path[seg];
+ }
+ },
+
+ // return fragment segments
+ fsegment : function( seg )
+ {
+ if ( seg === undefined )
+ {
+ return this.data.seg.fragment;
+ }
+ else
+ {
+ seg = seg < 0 ? this.data.seg.fragment.length + seg : seg - 1; // negative segments count from the end
+ return this.data.seg.fragment[seg];
+ }
+ }
+
+ };
+
+ };
+
+})(jQuery); \ No newline at end of file
diff --git a/syte/static/js/libs/json.js b/syte/static/js/libs/json.js
new file mode 100644
index 0000000..fbf3fbc
--- /dev/null
+++ b/syte/static/js/libs/json.js
@@ -0,0 +1,42 @@
+/*!
+ * RequireJS plugin for loading JSON files
+ * - depends on Text plugin and it was HEAVILY "inspired" by it as well.
+ *
+ * IMPORTANT: it only works on r.js optimizer after version 0.26+ 20011/09/27
+ *
+ * @author Miller Medeiros
+ * @version 0.0.1 (2011/06/10)
+ * Released under the WTFPL <http://sam.zoy.org/wtfpl/>
+ */
+define(['text'], function(text){
+
+ var jsonParse = (typeof JSON !== 'undefined' && typeof JSON.parse === 'function')? JSON.parse : function(val){
+ return eval('('+ val +')'); //quick and dirty
+ },
+ buildMap = {};
+
+ //API
+ return {
+
+ load : function(name, req, onLoad, config) {
+ text.get(req.toUrl(name), function(data){
+ if (config.isBuild) {
+ buildMap[name] = data;
+ onLoad(data);
+ } else {
+ onLoad(jsonParse(data));
+ }
+ });
+ },
+
+ //write method based on RequireJS official text plugin by James Burke
+ //https://github.com/jrburke/requirejs/blob/master/text.js
+ write : function(pluginName, moduleName, write){
+ if(moduleName in buildMap){
+ var content = buildMap[moduleName];
+ write('define("'+ pluginName +'!'+ moduleName +'", function(){ return '+ content +';});\n');
+ }
+ }
+
+ };
+}); \ No newline at end of file
diff --git a/syte/static/js/libs/moment.min.js b/syte/static/js/libs/moment.min.js
new file mode 100644
index 0000000..c1b132a
--- /dev/null
+++ b/syte/static/js/libs/moment.min.js
@@ -0,0 +1,6 @@
+// moment.js
+// version : 1.6.2
+// author : Tim Wood
+// license : MIT
+// momentjs.com
+(function(a,b){function A(a,b){this._d=a,this._isUTC=!!b}function B(a){return a<0?Math.ceil(a):Math.floor(a)}function C(a){var b=this._data={},c=a.years||a.y||0,d=a.months||a.M||0,e=a.weeks||a.w||0,f=a.days||a.d||0,g=a.hours||a.h||0,h=a.minutes||a.m||0,i=a.seconds||a.s||0,j=a.milliseconds||a.ms||0;this._milliseconds=j+i*1e3+h*6e4+g*36e5,this._days=f+e*7,this._months=d+c*12,b.milliseconds=j%1e3,i+=B(j/1e3),b.seconds=i%60,h+=B(i/60),b.minutes=h%60,g+=B(h/60),b.hours=g%24,f+=B(g/24),f+=e*7,b.days=f%30,d+=B(f/30),b.months=d%12,c+=B(d/12),b.years=c}function D(a,b){var c=a+"";while(c.length<b)c="0"+c;return c}function E(a,b,c){var d=b._milliseconds,e=b._days,f=b._months,g;d&&a._d.setTime(+a+d*c),e&&a.date(a.date()+e*c),f&&(g=a.date(),a.date(1).month(a.month()+f*c).date(Math.min(g,a.daysInMonth())))}function F(a){return Object.prototype.toString.call(a)==="[object Array]"}function G(b){return new a(b[0],b[1]||0,b[2]||1,b[3]||0,b[4]||0,b[5]||0,b[6]||0)}function H(b,d){function q(d){var l,r;switch(d){case"M":return e+1;case"Mo":return e+1+o(e+1);case"MM":return D(e+1,2);case"MMM":return c.monthsShort[e];case"MMMM":return c.months[e];case"D":return f;case"Do":return f+o(f);case"DD":return D(f,2);case"DDD":return l=new a(g,e,f),r=new a(g,0,1),~~((l-r)/864e5+1.5);case"DDDo":return l=q("DDD"),l+o(l);case"DDDD":return D(q("DDD"),3);case"d":return h;case"do":return h+o(h);case"ddd":return c.weekdaysShort[h];case"dddd":return c.weekdays[h];case"w":return l=new a(g,e,f-h+5),r=new a(l.getFullYear(),0,4),~~((l-r)/864e5/7+1.5);case"wo":return l=q("w"),l+o(l);case"ww":return D(q("w"),2);case"YY":return D(g%100,2);case"YYYY":return g;case"a":return p?p(i,j,!1):i>11?"pm":"am";case"A":return p?p(i,j,!0):i>11?"PM":"AM";case"H":return i;case"HH":return D(i,2);case"h":return i%12||12;case"hh":return D(i%12||12,2);case"m":return j;case"mm":return D(j,2);case"s":return k;case"ss":return D(k,2);case"S":return~~(m/100);case"SS":return D(~~(m/10),2);case"SSS":return D(m,3);case"Z":return(n<0?"-":"+")+D(~~(Math.abs(n)/60),2)+":"+D(~~(Math.abs(n)%60),2);case"ZZ":return(n<0?"-":"+")+D(~~(10*Math.abs(n)/6),4);case"L":case"LL":case"LLL":case"LLLL":case"LT":return H(b,c.longDateFormat[d]);default:return d.replace(/(^\[)|(\\)|\]$/g,"")}}var e=b.month(),f=b.date(),g=b.year(),h=b.day(),i=b.hours(),j=b.minutes(),k=b.seconds(),m=b.milliseconds(),n=-b.zone(),o=c.ordinal,p=c.meridiem;return d.replace(l,q)}function I(a){switch(a){case"DDDD":return p;case"YYYY":return q;case"S":case"SS":case"SSS":case"DDD":return o;case"MMM":case"MMMM":case"ddd":case"dddd":case"a":case"A":return r;case"Z":case"ZZ":return s;case"T":return t;case"MM":case"DD":case"dd":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return n;default:return new RegExp(a.replace("\\",""))}}function J(a,b,d,e){var f;switch(a){case"M":case"MM":d[1]=b==null?0:~~b-1;break;case"MMM":case"MMMM":for(f=0;f<12;f++)if(c.monthsParse[f].test(b)){d[1]=f;break}break;case"D":case"DD":case"DDD":case"DDDD":d[2]=~~b;break;case"YY":b=~~b,d[0]=b+(b>70?1900:2e3);break;case"YYYY":d[0]=~~Math.abs(b);break;case"a":case"A":e.isPm=(b+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":d[3]=~~b;break;case"m":case"mm":d[4]=~~b;break;case"s":case"ss":d[5]=~~b;break;case"S":case"SS":case"SSS":d[6]=~~(("0."+b)*1e3);break;case"Z":case"ZZ":e.isUTC=!0,f=(b+"").match(x),f&&f[1]&&(e.tzh=~~f[1]),f&&f[2]&&(e.tzm=~~f[2]),f&&f[0]==="+"&&(e.tzh=-e.tzh,e.tzm=-e.tzm)}}function K(b,c){var d=[0,0,1,0,0,0,0],e={tzh:0,tzm:0},f=c.match(l),g,h;for(g=0;g<f.length;g++)h=(I(f[g]).exec(b)||[])[0],b=b.replace(I(f[g]),""),J(f[g],h,d,e);return e.isPm&&d[3]<12&&(d[3]+=12),e.isPm===!1&&d[3]===12&&(d[3]=0),d[3]+=e.tzh,d[4]+=e.tzm,e.isUTC?new a(a.UTC.apply({},d)):G(d)}function L(a,b){var c=Math.min(a.length,b.length),d=Math.abs(a.length-b.length),e=0,f;for(f=0;f<c;f++)~~a[f]!==~~b[f]&&e++;return e+d}function M(a,b){var c,d=a.match(m)||[],e,f=99,g,h,i;for(g=0;g<b.length;g++)h=K(a,b[g]),e=H(new A(h),b[g]).match(m)||[],i=L(d,e),i<f&&(f=i,c=h);return c}function N(b){var c="YYYY-MM-DDT",d;if(u.exec(b)){for(d=0;d<4;d++)if(w[d][1].exec(b)){c+=w[d][0];break}return s.exec(b)?K(b,c+" Z"):K(b,c)}return new a(b)}function O(a,b,d,e){var f=c.relativeTime[a];return typeof f=="function"?f(b||1,!!d,a,e):f.replace(/%d/i,b||1)}function P(a,b){var c=e(Math.abs(a)/1e3),d=e(c/60),f=e(d/60),g=e(f/24),h=e(g/365),i=c<45&&["s",c]||d===1&&["m"]||d<45&&["mm",d]||f===1&&["h"]||f<22&&["hh",f]||g===1&&["d"]||g<=25&&["dd",g]||g<=45&&["M"]||g<345&&["MM",e(g/30)]||h===1&&["y"]||["yy",h];return i[2]=b,i[3]=a>0,O.apply({},i)}function Q(a,b){c.fn[a]=function(a){var c=this._isUTC?"UTC":"";return a!=null?(this._d["set"+c+b](a),this):this._d["get"+c+b]()}}function R(a){c.duration.fn[a]=function(){return this._data[a]}}function S(a,b){c.duration.fn["as"+a]=function(){return+this/b}}var c,d="1.6.2",e=Math.round,f,g={},h="en",i=typeof module!="undefined",j="months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),k=/^\/?Date\((\-?\d+)/i,l=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|LT|LL?L?L?)/g,m=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,n=/\d\d?/,o=/\d{1,3}/,p=/\d{3}/,q=/\d{4}/,r=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,s=/Z|[\+\-]\d\d:?\d\d/i,t=/T/i,u=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,v="YYYY-MM-DDTHH:mm:ssZ",w=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],x=/([\+\-]|\d\d)/gi,y="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),z={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6};c=function(d,e){if(d===null||d==="")return null;var f,g,h;return c.isMoment(d)?(f=new a(+d._d),h=d._isUTC):e?F(e)?f=M(d,e):f=K(d,e):(g=k.exec(d),f=d===b?new a:g?new a(+g[1]):d instanceof a?d:F(d)?G(d):typeof d=="string"?N(d):new a(d)),new A(f,h)},c.utc=function(b,d){return F(b)?new A(new a(a.UTC.apply({},b)),!0):d&&b?c(b+" +0000",d+" Z").utc():c(b&&!s.exec(b)?b+"+0000":b).utc()},c.unix=function(a){return c(a*1e3)},c.duration=function(a,b){var d=c.isDuration(a),e=typeof a=="number",f=d?a._data:e?{}:a;return e&&(b?f[b]=a:f.milliseconds=a),new C(f)},c.humanizeDuration=function(a,b,d){return c.duration(a,b===!0?null:b).humanize(b===!0?!0:d)},c.version=d,c.defaultFormat=v,c.lang=function(a,b){var d,e,f=[];if(!a)return h;if(b){for(d=0;d<12;d++)f[d]=new RegExp("^"+b.months[d]+"|^"+b.monthsShort[d].replace(".",""),"i");b.monthsParse=b.monthsParse||f,g[a]=b}if(g[a]){for(d=0;d<j.length;d++)c[j[d]]=g[a][j[d]]||g.en[j[d]];h=a}else i&&(e=require("./lang/"+a),c.lang(a,e))},c.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:!1,calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(a){var b=a%10;return~~(a%100/10)===1?"th":b===1?"st":b===2?"nd":b===3?"rd":"th"}}),c.isMoment=function(a){return a instanceof A},c.isDuration=function(a){return a instanceof C},c.fn=A.prototype={clone:function(){return c(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this._d.toString()},toDate:function(){return this._d},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(a){return H(this,a?a:c.defaultFormat)},add:function(a,b){var d=b?c.duration(+b,a):c.duration(a);return E(this,d,1),this},subtract:function(a,b){var d=b?c.duration(+b,a):c.duration(a);return E(this,d,-1),this},diff:function(a,b,d){var f=this._isUTC?c(a).utc():c(a).local(),g=(this.zone()-f.zone())*6e4,h=this._d-f._d-g,i=this.year()-f.year(),j=this.month()-f.month(),k=this.date()-f.date(),l;return b==="months"?l=i*12+j+k/30:b==="years"?l=i+(j+k/30)/12:l=b==="seconds"?h/1e3:b==="minutes"?h/6e4:b==="hours"?h/36e5:b==="days"?h/864e5:b==="weeks"?h/6048e5:h,d?l:e(l)},from:function(a,b){return c.duration(this.diff(a)).humanize(!b)},fromNow:function(a){return this.from(c(),a)},calendar:function(){var a=this.diff(c().sod(),"days",!0),b=c.calendar,d=b.sameElse,e=a<-6?d:a<-1?b.lastWeek:a<0?b.lastDay:a<1?b.sameDay:a<2?b.nextDay:a<7?b.nextWeek:d;return this.format(typeof e=="function"?e.apply(this):e)},isLeapYear:function(){var a=this.year();return a%4===0&&a%100!==0||a%400===0},isDST:function(){return this.zone()<c([this.year()]).zone()||this.zone()<c([this.year(),5]).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return a==null?b:this.add({d:a-b})},sod:function(){return c(this).hours(0).minutes(0).seconds(0).milliseconds(0)},eod:function(){return this.sod().add({d:1,ms:-1})},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return c(this).month(this.month()+1).date(0).date()}};for(f=0;f<y.length;f++)Q(y[f].toLowerCase(),y[f]);Q("year","FullYear"),c.duration.fn=C.prototype={weeks:function(){return B(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months*2592e6},humanize:function(a){var b=+this,d=c.relativeTime,e=P(b,!a);return a&&(e=(b<=0?d.past:d.future).replace(/%s/i,e)),e}};for(f in z)z.hasOwnProperty(f)&&(S(f,z[f]),R(f.toLowerCase()));S("Weeks",6048e5),i&&(module.exports=c),typeof window!="undefined"&&typeof ender=="undefined"&&(window.moment=c),typeof define=="function"&&define.amd&&define("moment",[],function(){return c})})(Date); \ No newline at end of file
diff --git a/syte/static/js/libs/prettify.js b/syte/static/js/libs/prettify.js
new file mode 100644
index 0000000..eef5ad7
--- /dev/null
+++ b/syte/static/js/libs/prettify.js
@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
diff --git a/syte/static/js/libs/require.js b/syte/static/js/libs/require.js
new file mode 100644
index 0000000..162cd9a
--- /dev/null
+++ b/syte/static/js/libs/require.js
@@ -0,0 +1,33 @@
+/*
+ RequireJS 1.0.8 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+var requirejs,require,define;
+(function(r){function K(a){return O.call(a)==="[object Function]"}function G(a){return O.call(a)==="[object Array]"}function $(a,c,l){for(var j in c)if(!(j in L)&&(!(j in a)||l))a[j]=c[j];return d}function P(a,c,d){a=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+a);if(d)a.originalError=d;return a}function aa(a,c,d){var j,k,t;for(j=0;t=c[j];j++){t=typeof t==="string"?{name:t}:t;k=t.location;if(d&&(!k||k.indexOf("/")!==0&&k.indexOf(":")===-1))k=d+"/"+(k||t.name);a[t.name]={name:t.name,location:k||
+t.name,main:(t.main||"main").replace(fa,"").replace(ba,"")}}}function V(a,c){a.holdReady?a.holdReady(c):c?a.readyWait+=1:a.ready(!0)}function ga(a){function c(b,f){var g,m;if(b&&b.charAt(0)===".")if(f){q.pkgs[f]?f=[f]:(f=f.split("/"),f=f.slice(0,f.length-1));g=b=f.concat(b.split("/"));var a;for(m=0;a=g[m];m++)if(a===".")g.splice(m,1),m-=1;else if(a==="..")if(m===1&&(g[2]===".."||g[0]===".."))break;else m>0&&(g.splice(m-1,2),m-=2);m=q.pkgs[g=b[0]];b=b.join("/");m&&b===g+"/"+m.main&&(b=g)}else b.indexOf("./")===
+0&&(b=b.substring(2));return b}function l(b,f){var g=b?b.indexOf("!"):-1,m=null,a=f?f.name:null,h=b,e,d;g!==-1&&(m=b.substring(0,g),b=b.substring(g+1,b.length));m&&(m=c(m,a));b&&(m?e=(g=n[m])&&g.normalize?g.normalize(b,function(b){return c(b,a)}):c(b,a):(e=c(b,a),d=G[e],d||(d=i.nameToUrl(b,null,f),G[e]=d)));return{prefix:m,name:e,parentMap:f,url:d,originalName:h,fullName:m?m+"!"+(e||""):e}}function j(){var b=!0,f=q.priorityWait,g,a;if(f){for(a=0;g=f[a];a++)if(!s[g]){b=!1;break}b&&delete q.priorityWait}return b}
+function k(b,f,g){return function(){var a=ha.call(arguments,0),c;if(g&&K(c=a[a.length-1]))c.__requireJsBuild=!0;a.push(f);return b.apply(null,a)}}function t(b,f,g){f=k(g||i.require,b,f);$(f,{nameToUrl:k(i.nameToUrl,b),toUrl:k(i.toUrl,b),defined:k(i.requireDefined,b),specified:k(i.requireSpecified,b),isBrowser:d.isBrowser});return f}function p(b){var f,g,a,c=b.callback,h=b.map,e=h.fullName,ca=b.deps;a=b.listeners;var j=q.requireExecCb||d.execCb;if(c&&K(c)){if(q.catchError.define)try{g=j(e,b.callback,
+ca,n[e])}catch(k){f=k}else g=j(e,b.callback,ca,n[e]);if(e)(c=b.cjsModule)&&c.exports!==r&&c.exports!==n[e]?g=n[e]=b.cjsModule.exports:g===r&&b.usingExports?g=n[e]:(n[e]=g,H[e]&&(T[e]=!0))}else e&&(g=n[e]=c,H[e]&&(T[e]=!0));if(x[b.id])delete x[b.id],b.isDone=!0,i.waitCount-=1,i.waitCount===0&&(J=[]);delete M[e];if(d.onResourceLoad&&!b.placeholder)d.onResourceLoad(i,h,b.depArray);if(f)return g=(e?l(e).url:"")||f.fileName||f.sourceURL,a=f.moduleTree,f=P("defineerror",'Error evaluating module "'+e+'" at location "'+
+g+'":\n'+f+"\nfileName:"+g+"\nlineNumber: "+(f.lineNumber||f.line),f),f.moduleName=e,f.moduleTree=a,d.onError(f);for(f=0;c=a[f];f++)c(g);return r}function u(b,f){return function(g){b.depDone[f]||(b.depDone[f]=!0,b.deps[f]=g,b.depCount-=1,b.depCount||p(b))}}function o(b,f){var g=f.map,a=g.fullName,c=g.name,h=N[b]||(N[b]=n[b]),e;if(!f.loading)f.loading=!0,e=function(b){f.callback=function(){return b};p(f);s[f.id]=!0;A()},e.fromText=function(b,f){var g=Q;s[b]=!1;i.scriptCount+=1;i.fake[b]=!0;g&&(Q=!1);
+d.exec(f);g&&(Q=!0);i.completeLoad(b)},a in n?e(n[a]):h.load(c,t(g.parentMap,!0,function(b,a){var c=[],e,m;for(e=0;m=b[e];e++)m=l(m,g.parentMap),b[e]=m.fullName,m.prefix||c.push(b[e]);f.moduleDeps=(f.moduleDeps||[]).concat(c);return i.require(b,a)}),e,q)}function y(b){x[b.id]||(x[b.id]=b,J.push(b),i.waitCount+=1)}function D(b){this.listeners.push(b)}function v(b,f){var g=b.fullName,a=b.prefix,c=a?N[a]||(N[a]=n[a]):null,h,e;g&&(h=M[g]);if(!h&&(e=!0,h={id:(a&&!c?O++ +"__p@:":"")+(g||"__r@"+O++),map:b,
+depCount:0,depDone:[],depCallbacks:[],deps:[],listeners:[],add:D},B[h.id]=!0,g&&(!a||N[a])))M[g]=h;a&&!c?(g=l(a),a in n&&!n[a]&&(delete n[a],delete R[g.url]),a=v(g,!0),a.add(function(){var f=l(b.originalName,b.parentMap),f=v(f,!0);h.placeholder=!0;f.add(function(b){h.callback=function(){return b};p(h)})})):e&&f&&(s[h.id]=!1,i.paused.push(h),y(h));return h}function C(b,f,a,c){var b=l(b,c),d=b.name,h=b.fullName,e=v(b),j=e.id,k=e.deps,o;if(h){if(h in n||s[j]===!0||h==="jquery"&&q.jQuery&&q.jQuery!==
+a().fn.jquery)return;B[j]=!0;s[j]=!0;h==="jquery"&&a&&W(a())}e.depArray=f;e.callback=a;for(a=0;a<f.length;a++)if(j=f[a])j=l(j,d?b:c),o=j.fullName,f[a]=o,o==="require"?k[a]=t(b):o==="exports"?(k[a]=n[h]={},e.usingExports=!0):o==="module"?e.cjsModule=k[a]={id:d,uri:d?i.nameToUrl(d,null,c):r,exports:n[h]}:o in n&&!(o in x)&&(!(h in H)||h in H&&T[o])?k[a]=n[o]:(h in H&&(H[o]=!0,delete n[o],R[j.url]=!1),e.depCount+=1,e.depCallbacks[a]=u(e,a),v(j,!0).add(e.depCallbacks[a]));e.depCount?y(e):p(e)}function w(b){C.apply(null,
+b)}function F(b,f){var a=b.map.fullName,c=b.depArray,d=!0,h,e,i,l;if(b.isDone||!a||!s[a])return l;if(f[a])return b;f[a]=!0;if(c){for(h=0;h<c.length;h++){e=c[h];if(!s[e]&&!ia[e]){d=!1;break}if((i=x[e])&&!i.isDone&&s[e])if(l=F(i,f))break}d||(l=r,delete f[a])}return l}function z(b,a){var g=b.map.fullName,c=b.depArray,d,h,e,i;if(b.isDone||!g||!s[g])return r;if(g){if(a[g])return n[g];a[g]=!0}if(c)for(d=0;d<c.length;d++)if(h=c[d])if((e=l(h).prefix)&&(i=x[e])&&z(i,a),(e=x[h])&&!e.isDone&&s[h])h=z(e,a),b.depCallbacks[d](h);
+return n[g]}function E(){var b=q.waitSeconds*1E3,b=b&&i.startTime+b<(new Date).getTime(),a="",c=!1,l=!1,k=[],h,e;if(i.pausedCount>0)return r;if(q.priorityWait)if(j())A();else return r;for(h in s)if(!(h in L)&&(c=!0,!s[h]))if(b)a+=h+" ";else if(l=!0,h.indexOf("!")===-1){k=[];break}else(e=M[h]&&M[h].moduleDeps)&&k.push.apply(k,e);if(!c&&!i.waitCount)return r;if(b&&a)return b=P("timeout","Load timeout for modules: "+a),b.requireType="timeout",b.requireModules=a,b.contextName=i.contextName,d.onError(b);
+if(l&&k.length)for(a=0;h=x[k[a]];a++)if(h=F(h,{})){z(h,{});break}if(!b&&(l||i.scriptCount)){if((I||da)&&!X)X=setTimeout(function(){X=0;E()},50);return r}if(i.waitCount){for(a=0;h=J[a];a++)z(h,{});i.paused.length&&A();Y<5&&(Y+=1,E())}Y=0;d.checkReadyState();return r}var i,A,q={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},catchError:{}},S=[],B={require:!0,exports:!0,module:!0},G={},n={},s={},x={},J=[],R={},O=0,M={},N={},H={},T={},Z=0;W=function(b){if(!i.jQuery&&(b=b||(typeof jQuery!=="undefined"?jQuery:
+null))&&!(q.jQuery&&b.fn.jquery!==q.jQuery)&&("holdReady"in b||"readyWait"in b))if(i.jQuery=b,w(["jquery",[],function(){return jQuery}]),i.scriptCount)V(b,!0),i.jQueryIncremented=!0};A=function(){var b,a,c,l,k,h;i.takeGlobalQueue();Z+=1;if(i.scriptCount<=0)i.scriptCount=0;for(;S.length;)if(b=S.shift(),b[0]===null)return d.onError(P("mismatch","Mismatched anonymous define() module: "+b[b.length-1]));else w(b);if(!q.priorityWait||j())for(;i.paused.length;){k=i.paused;i.pausedCount+=k.length;i.paused=
+[];for(l=0;b=k[l];l++)a=b.map,c=a.url,h=a.fullName,a.prefix?o(a.prefix,b):!R[c]&&!s[h]&&((q.requireLoad||d.load)(i,h,c),c.indexOf("empty:")!==0&&(R[c]=!0));i.startTime=(new Date).getTime();i.pausedCount-=k.length}Z===1&&E();Z-=1;return r};i={contextName:a,config:q,defQueue:S,waiting:x,waitCount:0,specified:B,loaded:s,urlMap:G,urlFetched:R,scriptCount:0,defined:n,paused:[],pausedCount:0,plugins:N,needFullExec:H,fake:{},fullExec:T,managerCallbacks:M,makeModuleMap:l,normalize:c,configure:function(b){var a,
+c,d;b.baseUrl&&b.baseUrl.charAt(b.baseUrl.length-1)!=="/"&&(b.baseUrl+="/");a=q.paths;d=q.pkgs;$(q,b,!0);if(b.paths){for(c in b.paths)c in L||(a[c]=b.paths[c]);q.paths=a}if((a=b.packagePaths)||b.packages){if(a)for(c in a)c in L||aa(d,a[c],c);b.packages&&aa(d,b.packages);q.pkgs=d}if(b.priority)c=i.requireWait,i.requireWait=!1,A(),i.require(b.priority),A(),i.requireWait=c,q.priorityWait=b.priority;if(b.deps||b.callback)i.require(b.deps||[],b.callback)},requireDefined:function(b,a){return l(b,a).fullName in
+n},requireSpecified:function(b,a){return l(b,a).fullName in B},require:function(b,c,g){if(typeof b==="string"){if(K(c))return d.onError(P("requireargs","Invalid require call"));if(d.get)return d.get(i,b,c);c=l(b,c);b=c.fullName;return!(b in n)?d.onError(P("notloaded","Module name '"+c.fullName+"' has not been loaded yet for context: "+a)):n[b]}(b&&b.length||c)&&C(null,b,c,g);if(!i.requireWait)for(;!i.scriptCount&&i.paused.length;)A();return i.require},takeGlobalQueue:function(){U.length&&(ja.apply(i.defQueue,
+[i.defQueue.length-1,0].concat(U)),U=[])},completeLoad:function(b){var a;for(i.takeGlobalQueue();S.length;)if(a=S.shift(),a[0]===null){a[0]=b;break}else if(a[0]===b)break;else w(a),a=null;a?w(a):w([b,[],b==="jquery"&&typeof jQuery!=="undefined"?function(){return jQuery}:null]);d.isAsync&&(i.scriptCount-=1);A();d.isAsync||(i.scriptCount-=1)},toUrl:function(b,a){var c=b.lastIndexOf("."),d=null;c!==-1&&(d=b.substring(c,b.length),b=b.substring(0,c));return i.nameToUrl(b,d,a)},nameToUrl:function(b,a,g){var l,
+k,h,e,j=i.config,b=c(b,g&&g.fullName);if(d.jsExtRegExp.test(b))a=b+(a?a:"");else{l=j.paths;k=j.pkgs;g=b.split("/");for(e=g.length;e>0;e--)if(h=g.slice(0,e).join("/"),l[h]){g.splice(0,e,l[h]);break}else if(h=k[h]){b=b===h.name?h.location+"/"+h.main:h.location;g.splice(0,e,b);break}a=g.join("/")+(a||".js");a=(a.charAt(0)==="/"||a.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+a}return j.urlArgs?a+((a.indexOf("?")===-1?"?":"&")+j.urlArgs):a}};i.jQueryCheck=W;i.resume=A;return i}function ka(){var a,c,d;if(C&&C.readyState===
+"interactive")return C;a=document.getElementsByTagName("script");for(c=a.length-1;c>-1&&(d=a[c]);c--)if(d.readyState==="interactive")return C=d;return null}var la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/require\(\s*["']([^'"\s]+)["']\s*\)/g,fa=/^\.\//,ba=/\.js$/,O=Object.prototype.toString,u=Array.prototype,ha=u.slice,ja=u.splice,I=!!(typeof window!=="undefined"&&navigator&&document),da=!I&&typeof importScripts!=="undefined",na=I&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,
+ea=typeof opera!=="undefined"&&opera.toString()==="[object Opera]",L={},D={},U=[],C=null,Y=0,Q=!1,ia={require:!0,module:!0,exports:!0},d,u={},J,y,v,E,o,w,F,B,z,W,X;if(typeof define==="undefined"){if(typeof requirejs!=="undefined")if(K(requirejs))return;else u=requirejs,requirejs=r;typeof require!=="undefined"&&!K(require)&&(u=require,require=r);d=requirejs=function(a,c,d){var j="_",k;!G(a)&&typeof a!=="string"&&(k=a,G(c)?(a=c,c=d):a=[]);if(k&&k.context)j=k.context;d=D[j]||(D[j]=ga(j));k&&d.configure(k);
+return d.require(a,c)};d.config=function(a){return d(a)};require||(require=d);d.toUrl=function(a){return D._.toUrl(a)};d.version="1.0.8";d.jsExtRegExp=/^\/|:|\?|\.js$/;y=d.s={contexts:D,skipAsync:{}};if(d.isAsync=d.isBrowser=I)if(v=y.head=document.getElementsByTagName("head")[0],E=document.getElementsByTagName("base")[0])v=y.head=E.parentNode;d.onError=function(a){throw a;};d.load=function(a,c,l){d.resourcesReady(!1);a.scriptCount+=1;d.attach(l,a,c);if(a.jQuery&&!a.jQueryIncremented)V(a.jQuery,!0),
+a.jQueryIncremented=!0};define=function(a,c,d){var j,k;typeof a!=="string"&&(d=c,c=a,a=null);G(c)||(d=c,c=[]);!c.length&&K(d)&&d.length&&(d.toString().replace(la,"").replace(ma,function(a,d){c.push(d)}),c=(d.length===1?["require"]:["require","exports","module"]).concat(c));if(Q&&(j=J||ka()))a||(a=j.getAttribute("data-requiremodule")),k=D[j.getAttribute("data-requirecontext")];(k?k.defQueue:U).push([a,c,d]);return r};define.amd={multiversion:!0,plugins:!0,jQuery:!0};d.exec=function(a){return eval(a)};
+d.execCb=function(a,c,d,j){return c.apply(j,d)};d.addScriptToDom=function(a){J=a;E?v.insertBefore(a,E):v.appendChild(a);J=null};d.onScriptLoad=function(a){var c=a.currentTarget||a.srcElement,l;if(a.type==="load"||c&&na.test(c.readyState))C=null,a=c.getAttribute("data-requirecontext"),l=c.getAttribute("data-requiremodule"),D[a].completeLoad(l),c.detachEvent&&!ea?c.detachEvent("onreadystatechange",d.onScriptLoad):c.removeEventListener("load",d.onScriptLoad,!1)};d.attach=function(a,c,l,j,k,o){var p;
+if(I)return j=j||d.onScriptLoad,p=c&&c.config&&c.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),p.type=k||c&&c.config.scriptType||"text/javascript",p.charset="utf-8",p.async=!y.skipAsync[a],c&&p.setAttribute("data-requirecontext",c.contextName),p.setAttribute("data-requiremodule",l),p.attachEvent&&!(p.attachEvent.toString&&p.attachEvent.toString().indexOf("[native code]")<0)&&!ea?(Q=!0,o?p.onreadystatechange=function(){if(p.readyState===
+"loaded")p.onreadystatechange=null,p.attachEvent("onreadystatechange",j),o(p)}:p.attachEvent("onreadystatechange",j)):p.addEventListener("load",j,!1),p.src=a,o||d.addScriptToDom(p),p;else da&&(importScripts(a),c.completeLoad(l));return null};if(I){o=document.getElementsByTagName("script");for(B=o.length-1;B>-1&&(w=o[B]);B--){if(!v)v=w.parentNode;if(F=w.getAttribute("data-main")){if(!u.baseUrl)o=F.split("/"),w=o.pop(),o=o.length?o.join("/")+"/":"./",u.baseUrl=o,F=w.replace(ba,"");u.deps=u.deps?u.deps.concat(F):
+[F];break}}}d.checkReadyState=function(){var a=y.contexts,c;for(c in a)if(!(c in L)&&a[c].waitCount)return;d.resourcesReady(!0)};d.resourcesReady=function(a){var c,l;d.resourcesDone=a;if(d.resourcesDone)for(l in a=y.contexts,a)if(!(l in L)&&(c=a[l],c.jQueryIncremented))V(c.jQuery,!1),c.jQueryIncremented=!1};d.pageLoaded=function(){if(document.readyState!=="complete")document.readyState="complete"};if(I&&document.addEventListener&&!document.readyState)document.readyState="loading",window.addEventListener("load",
+d.pageLoaded,!1);d(u);if(d.isAsync&&typeof setTimeout!=="undefined")z=y.contexts[u.context||"_"],z.requireWait=!0,setTimeout(function(){z.requireWait=!1;z.scriptCount||z.resume();d.checkReadyState()},0)}})();
diff --git a/syte/static/js/libs/spin.min.js b/syte/static/js/libs/spin.min.js
new file mode 100644
index 0000000..c38b40e
--- /dev/null
+++ b/syte/static/js/libs/spin.min.js
@@ -0,0 +1,2 @@
+//fgnass.github.com/spin.js#v1.2.5
+(function(a,b,c){function g(a,c){var d=b.createElement(a||"div"),e;for(e in c)d[e]=c[e];return d}function h(a){for(var b=1,c=arguments.length;b<c;b++)a.appendChild(arguments[b]);return a}function j(a,b,c,d){var g=["opacity",b,~~(a*100),c,d].join("-"),h=.01+c/d*100,j=Math.max(1-(1-a)/b*(100-h),a),k=f.substring(0,f.indexOf("Animation")).toLowerCase(),l=k&&"-"+k+"-"||"";return e[g]||(i.insertRule("@"+l+"keyframes "+g+"{"+"0%{opacity:"+j+"}"+h+"%{opacity:"+a+"}"+(h+.01)+"%{opacity:1}"+(h+b)%100+"%{opacity:"+a+"}"+"100%{opacity:"+j+"}"+"}",0),e[g]=1),g}function k(a,b){var e=a.style,f,g;if(e[b]!==c)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(g=0;g<d.length;g++){f=d[g]+b;if(e[f]!==c)return f}}function l(a,b){for(var c in b)a.style[k(a,c)||c]=b[c];return a}function m(a){for(var b=1;b<arguments.length;b++){var d=arguments[b];for(var e in d)a[e]===c&&(a[e]=d[e])}return a}function n(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a=a.offsetParent)b.x+=a.offsetLeft,b.y+=a.offsetTop;return b}var d=["webkit","Moz","ms","O"],e={},f,i=function(){var a=g("style");return h(b.getElementsByTagName("head")[0],a),a.sheet||a.styleSheet}(),o={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},p=function q(a){if(!this.spin)return new q(a);this.opts=m(a||{},q.defaults,o)};p.defaults={},m(p.prototype,{spin:function(a){this.stop();var b=this,c=b.opts,d=b.el=l(g(0,{className:c.className}),{position:"relative",zIndex:c.zIndex}),e=c.radius+c.length+c.width,h,i;a&&(a.insertBefore(d,a.firstChild||null),i=n(a),h=n(d),l(d,{left:(c.left=="auto"?i.x-h.x+(a.offsetWidth>>1):c.left+e)+"px",top:(c.top=="auto"?i.y-h.y+(a.offsetHeight>>1):c.top+e)+"px"})),d.setAttribute("aria-role","progressbar"),b.lines(d,b.opts);if(!f){var j=0,k=c.fps,m=k/c.speed,o=(1-c.opacity)/(m*c.trail/100),p=m/c.lines;!function q(){j++;for(var a=c.lines;a;a--){var e=Math.max(1-(j+a*p)%m*o,c.opacity);b.opacity(d,c.lines-a,e,c)}b.timeout=b.el&&setTimeout(q,~~(1e3/k))}()}return b},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=c),this},lines:function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c+b.rotate)+"deg) translate("+b.radius+"px"+",0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c<b.lines;c++)d=l(g(),{position:"absolute",top:1+~(b.width/2)+"px",transform:b.hwaccel?"translate3d(0,0,0)":"",opacity:b.opacity,animation:f&&j(b.opacity,b.trail,c,b.lines)+" "+1/b.speed+"s linear infinite"}),b.shadow&&h(d,l(e("#000","0 0 4px #000"),{top:"2px"})),h(a,h(d,e(b.color,"0 0 1px rgba(0,0,0,.1)")));return a},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),!function(){function a(a,b){return g("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',b)}var b=l(g("group"),{behavior:"url(#default#VML)"});!k(b,"transform")&&b.adj?(i.addRule(".spin-vml","behavior:url(#default#VML)"),p.prototype.lines=function(b,c){function f(){return l(a("group",{coordsize:e+" "+e,coordorigin:-d+" "+ -d}),{width:e,height:e})}function k(b,e,g){h(i,h(l(f(),{rotation:360/c.lines*b+"deg",left:~~e}),h(l(a("roundrect",{arcsize:1}),{width:d,height:c.width,left:c.radius,top:-c.width>>1,filter:g}),a("fill",{color:c.color,opacity:c.opacity}),a("stroke",{opacity:0}))))}var d=c.length+c.width,e=2*d,g=-(c.width+c.length)*2+"px",i=l(f(),{position:"absolute",top:g,left:g}),j;if(c.shadow)for(j=1;j<=c.lines;j++)k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(j=1;j<=c.lines;j++)k(j);return h(b,i)},p.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}):f=k(b,"animation")}(),a.Spinner=p})(window,document); \ No newline at end of file
diff --git a/syte/static/js/libs/text.js b/syte/static/js/libs/text.js
new file mode 100644
index 0000000..d18166d
--- /dev/null
+++ b/syte/static/js/libs/text.js
@@ -0,0 +1,11 @@
+/*
+ RequireJS text 1.0.8 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ Available via the MIT or new BSD license.
+ see: http://github.com/jrburke/requirejs for details
+*/
+(function(){var k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],m=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,n=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,i=typeof location!=="undefined"&&location.href,o=i&&location.protocol&&location.protocol.replace(/\:/,""),p=i&&location.hostname,q=i&&(location.port||void 0),j=[];define(function(){var e,l;e={version:"1.0.8",strip:function(a){if(a){var a=a.replace(m,""),c=a.match(n);c&&(a=c[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,
+"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r")},createXhr:function(){var a,c,b;if(typeof XMLHttpRequest!=="undefined")return new XMLHttpRequest;else if(typeof ActiveXObject!=="undefined")for(c=0;c<3;c++){b=k[c];try{a=new ActiveXObject(b)}catch(f){}if(a){k=[b];break}}return a},parseName:function(a){var c=!1,b=a.indexOf("."),f=a.substring(0,b),a=a.substring(b+1,a.length),b=a.indexOf("!");b!==-1&&(c=a.substring(b+1,a.length),
+c=c==="strip",a=a.substring(0,b));return{moduleName:f,ext:a,strip:c}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,c,b,f){var d=e.xdRegExp.exec(a),g;if(!d)return!0;a=d[2];d=d[3];d=d.split(":");g=d[1];d=d[0];return(!a||a===c)&&(!d||d===b)&&(!g&&!d||g===f)},finishLoad:function(a,c,b,f,d){b=c?e.strip(b):b;d.isBuild&&(j[a]=b);f(b)},load:function(a,c,b,f){if(f.isBuild&&!f.inlineText)b();else{var d=e.parseName(a),g=d.moduleName+"."+d.ext,h=c.toUrl(g),r=f&&f.text&&f.text.useXhr||e.useXhr;!i||r(h,
+o,p,q)?e.get(h,function(c){e.finishLoad(a,d.strip,c,b,f)}):c([g],function(a){e.finishLoad(d.moduleName+"."+d.ext,d.strip,a,b,f)})}},write:function(a,c,b){if(j.hasOwnProperty(c)){var f=e.jsEscape(j[c]);b.asModule(a+"!"+c,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,c,b,f,d){var c=e.parseName(c),g=c.moduleName+"."+c.ext,h=b.toUrl(c.moduleName+"."+c.ext)+".js";e.load(g,b,function(){var b=function(a){return f(h,a)};b.asModule=function(a,b){return f.asModule(a,h,b)};e.write(a,g,
+b,d)},d)}};if(e.createXhr())e.get=function(a,c){var b=e.createXhr();b.open("GET",a,!0);b.onreadystatechange=function(){b.readyState===4&&c(b.responseText)};b.send(null)};else if(typeof process!=="undefined"&&process.versions&&process.versions.node)l=require.nodeRequire("fs"),e.get=function(a,c){var b=l.readFileSync(a,"utf8");b.indexOf("\ufeff")===0&&(b=b.substring(1));c(b)};else if(typeof Packages!=="undefined")e.get=function(a,c){var b=new java.io.File(a),f=java.lang.System.getProperty("line.separator"),
+b=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(b),"utf-8")),d,e,h="";try{d=new java.lang.StringBuffer;(e=b.readLine())&&e.length()&&e.charAt(0)===65279&&(e=e.substring(1));for(d.append(e);(e=b.readLine())!==null;)d.append(f),d.append(e);h=String(d.toString())}finally{b.close()}c(h)};return e})})();
diff --git a/syte/static/js/min/scripts.min.js b/syte/static/js/min/scripts.min.js
new file mode 100644
index 0000000..a732d8d
--- /dev/null
+++ b/syte/static/js/min/scripts.min.js
@@ -0,0 +1,8 @@
+/*
+ * JQuery URL Parser plugin
+ * Developed and maintanined by Mark Perkins, mark@allmarkedup.com
+ * Source repository: https://github.com/allmarkedup/jQuery-URL-Parser
+ * Licensed under an MIT-style license. See https://github.com/allmarkedup/jQuery-URL-Parser/blob/master/LICENSE for details.
+ */function numberWithCommas(e){return e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function fetchBlogPosts(e,t){var n="/blog.json";e?n="/post/"+e:t&&(n="/tags/"+t),$.getJSON(n,function(e){require(["text!templates/blog-post-text.html","text!templates/blog-post-photo.html","text!templates/blog-post-link.html","text!templates/blog-post-video.html","text!templates/blog-post-audio.html","text!templates/blog-post-quote.html"],function(t,n,r,i,s,o){var u=Handlebars.compile(t),a=Handlebars.compile(n),f=Handlebars.compile(r),l=Handlebars.compile(i),c=Handlebars.compile(s),h=Handlebars.compile(o);$(".loading").remove(),$.each(e.response.posts,function(e,t){t.formated_date=moment(t.date).format("MMMM DD, YYYY"),t.type=="text"?$("#blog-posts").append(u(t)):t.type=="photo"?$("#blog-posts").append(a(t)):t.type=="link"?$("#blog-posts").append(f(t)):t.type=="video"?$("#blog-posts").append(l(t)):t.type=="audio"?$("#blog-posts").append(c(t)):t.type=="quote"&&$("#blog-posts").append(h(t))}),setupLinks(),adjustBlogHeaders(),prettyPrint(),setTimeout(setupBlogHeaderScroll,1e3),adjustSelection("home-link")})})}function adjustBlogHeaders(){if(isMobileView)return;$(".blog-section article hgroup").each(function(e,t){$(t).find("h3 a").css({"margin-top":"-"+($(t).height()+100)+"px"}).addClass("adjusted")})}function setupBlogHeaderScroll(){function o(e){var s=n.scrollTop(),o=r.length;for(o;o--;){if(t!=i[o]&&s>r[o]&&(!r[o+1]||s<r[o+1])){var u=$(t).find("hgroup"),a="";u.length&&(a="-"+($(u[0]).height()+100)+"px"),$("h3 a[href="+t+"]").removeClass("active").css({position:"absolute",top:"auto","margin-top":a}),t=i[o],$("h3 a[href="+t+"]").attr("style","").addClass("active")}t&&t!=i[o]&&s+50>=r[o]&&(!r[o+1]||s+50<=r[o+1])&&$("h3 a[href="+t+"]").removeClass("active").css({position:"absolute",top:$(t).outerHeight(!0)+$(t).offset().top-50+"px",bottom:"auto"}),t==i[o]&&s>r[o]-50&&(!r[o+1]||s<=r[o+1]-50)&&($("h3 a[href="+t+"]").hasClass("active")||$("h3 a[href="+t+"]").attr("style","").addClass("active"))}}if(isMobileView)return;var e,t,n=$(window),r=[],i=[],s=$(".blog-section article hgroup h3 a").each(function(){this.hash&&(i.push(this.hash),r.push($(this.hash).offset().top))});s.click(function(e){if(!this.hash)return;$("html, body").stop().animate({scrollTop:$(this.hash).offset().top},500,"linear"),o(),e.preventDefault()}),n.scroll(o).trigger("scroll")}function setupLinks(){$("a").click(function(e){e.preventDefault(),e.stopPropagation();var t=$.url(this.href.replace("/#!",""));this.id=="home-link"&&window.location.pathname=="/"?($("#github-profile").remove(),$("#dribbble-profile").remove(),$("#twitter-profile").remove(),$("#instagram-profile").remove(),$(".modal-backdrop").remove(),adjustSelection("home-link")):this.id=="instagram-link"&&instagram_integration_enabled?($("#github-profile").remove(),$("#dribbble-profile").remove(),$("#twitter-profile").remove(),$(".modal-backdrop").remove(),adjustSelection("instagram-link"),setupInstagram(this)):!twitter_integration_enabled||t.attr("host")!="twitter.com"&&t.attr("host")!="www.twitter.com"?!github_integration_enabled||t.attr("host")!="github.com"&&t.attr("host")!="www.github.com"?!dribbble_integration_enabled||t.attr("host")!="dribbble.com"&&t.attr("host")!="www.dribbble.com"?window.location=this.href:($("#twitter-profile").remove(),$("#github-profile").remove(),$("#instagram-profile").remove(),$(".modal-backdrop").remove(),adjustSelection("dribbble-link"),setupDribbble(t,this)):($("#twitter-profile").remove(),$("#dribbble-profile").remove(),$("#instagram-profile").remove(),$(".modal-backdrop").remove(),adjustSelection("github-link"),setupGithub(t,this)):($("#github-profile").remove(),$("#dribbble-profile").remove(),$("#instagram-profile").remove(),$(".modal-backdrop").remove(),adjustSelection("twitter-link"),setupTwitter(t,this))})}function adjustSelection(e){$(".main-nav").children("li").removeClass("sel"),$("#"+e).parent().addClass("sel")}function setupTwitter(e,t){var n=t.href;if($("#twitter-profile").length>0){window.location=n;return}var r=e.attr("path").split("/").filter(function(e){return e.length?!0:!1});if(r.length==1){var i=r[0],s=(new Spinner(spin_opts)).spin();$("#twitter-link").append(s.el),require(["json!/twitter/"+i,"text!templates/twitter-view.html"],function(e,t){if(e.error||e.length==0){window.location=n;return}var r=Handlebars.compile(t),i=[];$.each(e,function(e,t){if(e>3)return;t.formated_date=moment(t.created_at).fromNow(),t.f_text=twitterLinkify(t.text),i.push(t)});var o=e[0].user;o.statuses_count=numberWithCommas(o.statuses_count),o.friends_count=numberWithCommas(o.friends_count),o.followers_count=numberWithCommas(o.followers_count),o.f_description=twitterLinkify(o.description);var u={user:o,tweets:i};$(r(u)).modal().on("hidden",function(){$(this).remove(),adjustSelection("home-link")}),s.stop()});return}window.location=n}function twitterLinkify(e){return e=e.replace(/(https?:\/\/\S+)/gi,function(e){return'<a href="'+e+'">'+e+"</a>"}),e=e.replace(/(^|) @(\w+)/gi,function(e){return'<a href="http://twitter.com/'+e+'">'+e+"</a>"}),e=e.replace(/(^|) #(\w+)/gi,function(e){return'<a href="http://search.twitter.com/search?q='+e.replace(/#/,"%23")+'">'+e+"</a>"}),e}function setupGithub(e,t){var n=t.href;if($("#github-profile").length>0){window.location=n;return}var r=e.attr("path").split("/").filter(function(e){return e.length?!0:!1});if(r.length==1){var i=r[0],s=(new Spinner(spin_opts)).spin();$("#github-link").append(s.el),require(["json!/github/"+i,"text!templates/github-view.html"],function(e,t){if(e.error||e.length==0){window.location=n;return}var r=Handlebars.compile(t);e.user.following_count=numberWithCommas(e.user.following_count),e.user.followers_count=numberWithCommas(e.user.followers_count),$(r(e)).modal().on("hidden",function(){$(this).remove(),adjustSelection("home-link")}),s.stop()});return}window.location=n}function setupInstagram(e){var t=e.href;if($("#instagram-profile").length>0){window.location=t;return}var n=(new Spinner(spin_opts)).spin();$("#instagram-link").append(n.el),require(["json!/instagram/","text!templates/instagram-view.html","text!templates/instagram-view-more.html"],function(e,r,i){if(e.media==0){window.location=t;return}var s=Handlebars.compile(r),o=e.user.counts;o.media=numberWithCommas(o.media),o.followed_by=numberWithCommas(o.followed_by),o.follows=numberWithCommas(o.follows),$.each(e.media,function(e,t){t.formated_date=moment.unix(parseInt(t.created_time)).fromNow()}),$(s(e)).modal().on("hidden",function(){$(this).remove(),adjustSelection("home-link")});var u=Handlebars.compile(i);$("#load-more-pics").click(function(e){next=$(this).attr("data-control-next");var t=(new Spinner(spin_opts)).spin();$("#load-more-pics").append(t.el),$.getJSON("/instagram/"+next,function(e){$.each(e.media,function(e,t){t.formated_date=moment.unix(parseInt(t.created_time)).fromNow()}),$(".instagram .profile-shots").append(u(e)),e.pagination&&e.pagination.next_max_id?$("#load-more-pics").attr("data-control-next",e.pagination.next_max_id):$("#load-more-pics").remove(),t.stop()})}),n.stop()})}(function(e,t){function a(e,t){var n=decodeURI(e),i=s[t||!1?"strict":"loose"].exec(n),a={attr:{},param:{},seg:{}},f=14;while(f--)a.attr[r[f]]=i[f]||"";return a.param.query={},a.param.fragment={},a.attr.query.replace(o,function(e,t,n){t&&(a.param.query[t]=n)}),a.attr.fragment.replace(u,function(e,t,n){t&&(a.param.fragment[t]=n)}),a.seg.path=a.attr.path.replace(/^\/+|\/+$/g,"").split("/"),a.seg.fragment=a.attr.fragment.replace(/^\/+|\/+$/g,"").split("/"),a.attr.base=a.attr.host?a.attr.protocol+"://"+a.attr.host+(a.attr.port?":"+a.attr.port:""):"",a}function f(e){var r=e.tagName;return r!==t?n[r.toLowerCase()]:r}var n={a:"href",img:"src",form:"action",base:"href",script:"src",iframe:"src",link:"href"},r=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"],i={anchor:"fragment"},s={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},o=/(?:^|&|;)([^&=;]*)=?([^&;]*)/g,u=/(?:^|&|;)([^&=;]*)=?([^&;]*)/g;e.fn.url=function(t){var n="";return this.length&&(n=e(this).attr(f(this[0]))||""),e.url(n,t)},e.url=function(e,n){return arguments.length===1&&e===!0&&(n=!0,e=t),n=n||!1,e=e||window.location.toString(),{data:a(e,n),attr:function(e){return e=i[e]||e,e!==t?this.data.attr[e]:this.data.attr},param:function(e){return e!==t?this.data.param.query[e]:this.data.param.query},fparam:function(e){return e!==t?this.data.param.fragment[e]:this.data.param.fragment},segment:function(e){return e===t?this.data.seg.path:(e=e<0?this.data.seg.path.length+e:e-1,this.data.seg.path[e])},fsegment:function(e){return e===t?this.data.seg.fragment:(e=e<0?this.data.seg.fragment.length+e:e-1,this.data.seg.fragment[e])}}}})(jQuery);var requirejs,require,define;(function(r){function K(e){return O.call(e)==="[object Function]"}function G(e){return O.call(e)==="[object Array]"}function $(e,t,n){for(var r in t)!(r in L)&&(!(r in e)||n)&&(e[r]=t[r]);return d}function P(e,t,n){return e=Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e),n&&(e.originalError=n),e}function aa(e,t,n){var r,i,s;for(r=0;s=t[r];r++)s=typeof s=="string"?{name:s}:s,i=s.location,n&&(!i||i.indexOf("/")!==0&&i.indexOf(":")===-1)&&(i=n+"/"+(i||s.name)),e[s.name]={name:s.name,location:i||s.name,main:(s.main||"main").replace(fa,"").replace(ba,"")}}function V(e,t){e.holdReady?e.holdReady(t):t?e.readyWait+=1:e.ready(!0)}function ga(e){function t(e,t){var n,r;if(e&&e.charAt(0)===".")if(t){E.pkgs[t]?t=[t]:(t=t.split("/"),t=t.slice(0,t.length-1)),n=e=t.concat(e.split("/"));var i;for(r=0;i=n[r];r++)if(i===".")n.splice(r,1),r-=1;else if(i===".."){if(r===1&&(n[2]===".."||n[0]===".."))break;r>0&&(n.splice(r-1,2),r-=2)}r=E.pkgs[n=e[0]],e=e.join("/"),r&&e===n+"/"+r.main&&(e=n)}else e.indexOf("./")===0&&(e=e.substring(2));return e}function n(e,n){var r=e?e.indexOf("!"):-1,i=null,s=n?n.name:null,o=e,u,a;return r!==-1&&(i=e.substring(0,r),e=e.substring(r+1,e.length)),i&&(i=t(i,s)),e&&(i?u=(r=N[i])&&r.normalize?r.normalize(e,function(e){return t(e,s)}):t(e,s):(u=t(e,s),a=T[u],a||(a=b.nameToUrl(e,null,n),T[u]=a))),{prefix:i,name:u,parentMap:n,url:a,originalName:o,fullName:i?i+"!"+(u||""):u}}function i(){var e=!0,t=E.priorityWait,n,r;if(t){for(r=0;n=t[r];r++)if(!C[n]){e=!1;break}e&&delete E.priorityWait}return e}function s(e,t,n){return function(){var r=ha.call(arguments,0),i;return n&&K(i=r[r.length-1])&&(i.__requireJsBuild=!0),r.push(t),e.apply(null,r)}}function o(e,t,n){return t=s(n||b.require,e,t),$(t,{nameToUrl:s(b.nameToUrl,e),toUrl:s(b.toUrl,e),defined:s(b.requireDefined,e),specified:s(b.requireSpecified,e),isBrowser:d.isBrowser}),t}function u(e){var t,i,s,o=e.callback,u=e.map,a=u.fullName,f=e.deps;s=e.listeners;var l=E.requireExecCb||d.execCb;if(o&&K(o)){if(E.catchError.define)try{i=l(a,e.callback,f,N[a])}catch(c){t=c}else i=l(a,e.callback,f,N[a]);a&&((o=e.cjsModule)&&o.exports!==r&&o.exports!==N[a]?i=N[a]=e.cjsModule.exports:i===r&&e.usingExports?i=N[a]:(N[a]=i,H[a]&&(B[a]=!0)))}else a&&(i=N[a]=o,H[a]&&(B[a]=!0));k[e.id]&&(delete k[e.id],e.isDone=!0,b.waitCount-=1,b.waitCount===0&&(A=[])),delete _[a],d.onResourceLoad&&!e.placeholder&&d.onResourceLoad(b,u,e.depArray);if(t)return i=(a?n(a).url:"")||t.fileName||t.sourceURL,s=t.moduleTree,t=P("defineerror",'Error evaluating module "'+a+'" at location "'+i+'":\n'+t+"\nfileName:"+i+"\nlineNumber: "+(t.lineNumber||t.line),t),t.moduleName=a,t.moduleTree=s,d.onError(t);for(t=0;o=s[t];t++)o(i);return r}function a(e,t){return function(n){e.depDone[t]||(e.depDone[t]=!0,e.deps[t]=n,e.depCount-=1,e.depCount||u(e))}}function f(e,t){var r=t.map,i=r.fullName,s=r.name,a=D[e]||(D[e]=N[e]),f;t.loading||(t.loading=!0,f=function(e){t.callback=function(){return e},u(t),C[t.id]=!0,w()},f.fromText=function(e,t){var n=Q;C[e]=!1,b.scriptCount+=1,b.fake[e]=!0,n&&(Q=!1),d.exec(t),n&&(Q=!0),b.completeLoad(e)},i in N?f(N[i]):a.load(s,o(r.parentMap,!0,function(e,i){var s=[],o,u;for(o=0;u=e[o];o++)u=n(u,r.parentMap),e[o]=u.fullName,u.prefix||s.push(e[o]);return t.moduleDeps=(t.moduleDeps||[]).concat(s),b.require(e,i)}),f,E))}function l(e){k[e.id]||(k[e.id]=e,A.push(e),b.waitCount+=1)}function c(e){this.listeners.push(e)}function h(e,t){var r=e.fullName,i=e.prefix,s=i?D[i]||(D[i]=N[i]):null,o,a;return r&&(o=_[r]),!o&&(a=!0,o={id:(i&&!s?M++ +"__p@:":"")+(r||"__r@"+M++),map:e,depCount:0,depDone:[],depCallbacks:[],deps:[],listeners:[],add:c},x[o.id]=!0,r&&(!i||D[i]))&&(_[r]=o),i&&!s?(r=n(i),i in N&&!N[i]&&(delete N[i],delete O[r.url]),i=h(r,!0),i.add(function(){var t=n(e.originalName,e.parentMap),t=h(t,!0);o.placeholder=!0,t.add(function(e){o.callback=function(){return e},u(o)})})):a&&t&&(C[o.id]=!1,b.paused.push(o),l(o)),o}function p(e,t,i,s){var e=n(e,s),f=e.name,c=e.fullName,p=h(e),d=p.id,v=p.deps,m;if(c){if(c in N||C[d]===!0||c==="jquery"&&E.jQuery&&E.jQuery!==i().fn.jquery)return;x[d]=!0,C[d]=!0,c==="jquery"&&i&&W(i())}p.depArray=t,p.callback=i;for(i=0;i<t.length;i++)if(d=t[i])d=n(d,f?e:s),m=d.fullName,t[i]=m,m==="require"?v[i]=o(e):m==="exports"?(v[i]=N[c]={},p.usingExports=!0):m==="module"?p.cjsModule=v[i]={id:f,uri:f?b.nameToUrl(f,null,s):r,exports:N[c]}:!(m in N)||m in k||c in H&&!(c in H&&B[m])?(c in H&&(H[m]=!0,delete N[m],O[d.url]=!1),p.depCount+=1,p.depCallbacks[i]=a(p,i),h(d,!0).add(p.depCallbacks[i])):v[i]=N[m];p.depCount?l(p):u(p)}function v(e){p.apply(null,e)}function m(e,t){var n=e.map.fullName,i=e.depArray,s=!0,o,u,a,f;if(e.isDone||!n||!C[n])return f;if(t[n])return e;t[n]=!0;if(i){for(o=0;o<i.length;o++){u=i[o];if(!C[u]&&!ia[u]){s=!1;break}if((a=k[u])&&!a.isDone&&C[u])if(f=m(a,t))break}s||(f=r,delete t[n])}return f}function g(e,t){var i=e.map.fullName,s=e.depArray,o,u,a,f;if(e.isDone||!i||!C[i])return r;if(i){if(t[i])return N[i];t[i]=!0}if(s)for(o=0;o<s.length;o++)if(u=s[o])if((a=n(u).prefix)&&(f=k[a])&&g(f,t),(a=k[u])&&!a.isDone&&C[u])u=g(a,t),e.depCallbacks[o](u);return N[i]}function y(){var e=E.waitSeconds*1e3,e=e&&b.startTime+e<(new Date).getTime(),t="",n=!1,s=!1,o=[],u,a;if(b.pausedCount>0)return r;if(E.priorityWait){if(!i())return r;w()}for(u in C)if(!(u in L)&&(n=!0,!C[u]))if(e)t+=u+" ";else{if(s=!0,u.indexOf("!")===-1){o=[];break}(a=_[u]&&_[u].moduleDeps)&&o.push.apply(o,a)}if(!n&&!b.waitCount)return r;if(e&&t)return e=P("timeout","Load timeout for modules: "+t),e.requireType="timeout",e.requireModules=t,e.contextName=b.contextName,d.onError(e);if(s&&o.length)for(t=0;u=k[o[t]];t++)if(u=m(u,{})){g(u,{});break}if(!e&&(s||b.scriptCount))return(I||da)&&!X&&(X=setTimeout(function(){X=0,y()},50)),r;if(b.waitCount){for(t=0;u=A[t];t++)g(u,{});b.paused.length&&w(),Y<5&&(Y+=1,y())}return Y=0,d.checkReadyState(),r}var b,w,E={waitSeconds:7,baseUrl:"./",paths:{},pkgs:{},catchError:{}},S=[],x={require:!0,exports:!0,module:!0},T={},N={},C={},k={},A=[],O={},M=0,_={},D={},H={},B={},j=0;return W=function(e){!b.jQuery&&(e=e||(typeof jQuery!="undefined"?jQuery:null))&&(!E.jQuery||e.fn.jquery===E.jQuery)&&("holdReady"in e||"readyWait"in e)&&(b.jQuery=e,v(["jquery",[],function(){return jQuery}]),b.scriptCount)&&(V(e,!0),b.jQueryIncremented=!0)},w=function(){var e,t,n,s,o,u;b.takeGlobalQueue(),j+=1,b.scriptCount<=0&&(b.scriptCount=0);for(;S.length;){if(e=S.shift(),e[0]===null)return d.onError(P("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));v(e)}if(!E.priorityWait||i())for(;b.paused.length;){o=b.paused,b.pausedCount+=o.length,b.paused=[];for(s=0;e=o[s];s++)t=e.map,n=t.url,u=t.fullName,t.prefix?f(t.prefix,e):!O[n]&&!C[u]&&((E.requireLoad||d.load)(b,u,n),n.indexOf("empty:")!==0&&(O[n]=!0));b.startTime=(new Date).getTime(),b.pausedCount-=o.length}return j===1&&y(),j-=1,r},b={contextName:e,config:E,defQueue:S,waiting:k,waitCount:0,specified:x,loaded:C,urlMap:T,urlFetched:O,scriptCount:0,defined:N,paused:[],pausedCount:0,plugins:D,needFullExec:H,fake:{},fullExec:B,managerCallbacks:_,makeModuleMap:n,normalize:t,configure:function(e){var t,n,r;e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!=="/"&&(e.baseUrl+="/"),t=E.paths,r=E.pkgs,$(E,e,!0);if(e.paths){for(n in e.paths)n in L||(t[n]=e.paths[n]);E.paths=t}if((t=e.packagePaths)||e.packages){if(t)for(n in t)n in L||aa(r,t[n],n);e.packages&&aa(r,e.packages),E.pkgs=r}e.priority&&(n=b.requireWait,b.requireWait=!1,w(),b.require(e.priority),w(),b.requireWait=n,E.priorityWait=e.priority),(e.deps||e.callback)&&b.require(e.deps||[],e.callback)},requireDefined:function(e,t){return n(e,t).fullName in N},requireSpecified:function(e,t){return n(e,t).fullName in x},require:function(t,r,i){if(typeof t=="string")return K(r)?d.onError(P("requireargs","Invalid require call")):d.get?d.get(b,t,r):(r=n(t,r),t=r.fullName,t in N?N[t]:d.onError(P("notloaded","Module name '"+r.fullName+"' has not been loaded yet for context: "+e)));(t&&t.length||r)&&p(null,t,r,i);if(!b.requireWait)for(;!b.scriptCount&&b.paused.length;)w();return b.require},takeGlobalQueue:function(){U.length&&(ja.apply(b.defQueue,[b.defQueue.length-1,0].concat(U)),U=[])},completeLoad:function(e){var t;for(b.takeGlobalQueue();S.length;){if(t=S.shift(),t[0]===null){t[0]=e;break}if(t[0]===e)break;v(t),t=null}t?v(t):v([e,[],e==="jquery"&&typeof jQuery!="undefined"?function(){return jQuery}:null]),d.isAsync&&(b.scriptCount-=1),w(),d.isAsync||(b.scriptCount-=1)},toUrl:function(e,t){var n=e.lastIndexOf("."),r=null;return n!==-1&&(r=e.substring(n,e.length),e=e.substring(0,n)),b.nameToUrl(e,r,t)},nameToUrl:function(e,n,r){var i,s,o,u,a=b.config,e=t(e,r&&r.fullName);if(d.jsExtRegExp.test(e))n=e+(n?n:"");else{i=a.paths,s=a.pkgs,r=e.split("/");for(u=r.length;u>0;u--){if(o=r.slice(0,u).join("/"),i[o]){r.splice(0,u,i[o]);break}if(o=s[o]){e=e===o.name?o.location+"/"+o.main:o.location,r.splice(0,u,e);break}}n=r.join("/")+(n||".js"),n=(n.charAt(0)==="/"||n.match(/^[\w\+\.\-]+:/)?"":a.baseUrl)+n}return a.urlArgs?n+((n.indexOf("?")===-1?"?":"&")+a.urlArgs):n}},b.jQueryCheck=W,b.resume=w,b}function ka(){var e,t,n;if(C&&C.readyState==="interactive")return C;e=document.getElementsByTagName("script");for(t=e.length-1;t>-1&&(n=e[t]);t--)if(n.readyState==="interactive")return C=n;return null}var la=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ma=/require\(\s*["']([^'"\s]+)["']\s*\)/g,fa=/^\.\//,ba=/\.js$/,O=Object.prototype.toString,u=Array.prototype,ha=u.slice,ja=u.splice,I=typeof window!="undefined"&&!!navigator&&!!document,da=!I&&typeof importScripts!="undefined",na=I&&navigator.platform==="PLAYSTATION 3"?/^complete$/:/^(complete|loaded)$/,ea=typeof opera!="undefined"&&opera.toString()==="[object Opera]",L={},D={},U=[],C=null,Y=0,Q=!1,ia={require:!0,module:!0,exports:!0},d,u={},J,y,v,E,o,w,F,B,z,W,X;if(typeof define=="undefined"){if(typeof requirejs!="undefined"){if(K(requirejs))return;u=requirejs,requirejs=r}typeof require!="undefined"&&!K(require)&&(u=require,require=r),d=requirejs=function(e,t,n){var r="_",i;return!G(e)&&typeof e!="string"&&(i=e,G(t)?(e=t,t=n):e=[]),i&&i.context&&(r=i.context),n=D[r]||(D[r]=ga(r)),i&&n.configure(i),n.require(e,t)},d.config=function(e){return d(e)},require||(require=d),d.toUrl=function(e){return D._.toUrl(e)},d.version="1.0.8",d.jsExtRegExp=/^\/|:|\?|\.js$/,y=d.s={contexts:D,skipAsync:{}};if(d.isAsync=d.isBrowser=I)if(v=y.head=document.getElementsByTagName("head")[0],E=document.getElementsByTagName("base")[0])v=y.head=E.parentNode;d.onError=function(e){throw e},d.load=function(e,t,n){d.resourcesReady(!1),e.scriptCount+=1,d.attach(n,e,t),e.jQuery&&!e.jQueryIncremented&&(V(e.jQuery,!0),e.jQueryIncremented=!0)},define=function(e,t,n){var i,s;return typeof e!="string"&&(n=t,t=e,e=null),G(t)||(n=t,t=[]),!t.length&&K(n)&&n.length&&(n.toString().replace(la,"").replace(ma,function(e,n){t.push(n)}),t=(n.length===1?["require"]:["require","exports","module"]).concat(t)),Q&&(i=J||ka())&&(e||(e=i.getAttribute("data-requiremodule")),s=D[i.getAttribute("data-requirecontext")]),(s?s.defQueue:U).push([e,t,n]),r},define.amd={multiversion:!0,plugins:!0,jQuery:!0},d.exec=function(a){return eval(a)},d.execCb=function(e,t,n,r){return t.apply(r,n)},d.addScriptToDom=function(e){J=e,E?v.insertBefore(e,E):v.appendChild(e),J=null},d.onScriptLoad=function(e){var t=e.currentTarget||e.srcElement,n;if(e.type==="load"||t&&na.test(t.readyState))C=null,e=t.getAttribute("data-requirecontext"),n=t.getAttribute("data-requiremodule"),D[e].completeLoad(n),t.detachEvent&&!ea?t.detachEvent("onreadystatechange",d.onScriptLoad):t.removeEventListener("load",d.onScriptLoad,!1)},d.attach=function(e,t,n,r,i,s){var o;return I?(r=r||d.onScriptLoad,o=t&&t.config&&t.config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script"),o.type=i||t&&t.config.scriptType||"text/javascript",o.charset="utf-8",o.async=!y.skipAsync[e],t&&o.setAttribute("data-requirecontext",t.contextName),o.setAttribute("data-requiremodule",n),o.attachEvent&&!(o.attachEvent.toString&&o.attachEvent.toString().indexOf("[native code]")<0)&&!ea?(Q=!0,s?o.onreadystatechange=function(){o.readyState==="loaded"&&(o.onreadystatechange=null,o.attachEvent("onreadystatechange",r),s(o))}:o.attachEvent("onreadystatechange",r)):o.addEventListener("load",r,!1),o.src=e,s||d.addScriptToDom(o),o):(da&&(importScripts(e),t.completeLoad(n)),null)};if(I){o=document.getElementsByTagName("script");for(B=o.length-1;B>-1&&(w=o[B]);B--){v||(v=w.parentNode);if(F=w.getAttribute("data-main")){u.baseUrl||(o=F.split("/"),w=o.pop(),o=o.length?o.join("/")+"/":"./",u.baseUrl=o,F=w.replace(ba,"")),u.deps=u.deps?u.deps.concat(F):[F];break}}}d.checkReadyState=function(){var e=y.contexts,t;for(t in e)if(!(t in L)&&e[t].waitCount)return;d.resourcesReady(!0)},d.resourcesReady=function(e){var t,n;d.resourcesDone=e;if(d.resourcesDone)for(n in e=y.contexts,e)!(n in L)&&(t=e[n],t.jQueryIncremented)&&(V(t.jQuery,!1),t.jQueryIncremented=!1)},d.pageLoaded=function(){document.readyState!=="complete"&&(document.readyState="complete")},I&&document.addEventListener&&!document.readyState&&(document.readyState="loading",window.addEventListener("load",d.pageLoaded,!1)),d(u),d.isAsync&&typeof setTimeout!="undefined"&&(z=y.contexts[u.context||"_"],z.requireWait=!0,setTimeout(function(){z.requireWait=!1,z.scriptCount||z.resume(),d.checkReadyState()},0))}})();var Handlebars={};Handlebars.VERSION="1.0.beta.6",Handlebars.helpers={},Handlebars.partials={},Handlebars.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},Handlebars.registerPartial=function(e,t){this.partials[e]=t},Handlebars.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var toString=Object.prototype.toString,functionType="[object Function]";Handlebars.registerHelper("blockHelperMissing",function(e,t){var n=t.inverse||function(){},r=t.fn,i="",s=toString.call(e);s===functionType&&(e=e.call(this));if(e===!0)return r(this);if(e===!1||e==null)return n(this);if(s==="[object Array]"){if(e.length>0)for(var o=0,u=e.length;o<u;o++)i+=r(e[o]);else i=n(this);return i}return r(e)}),Handlebars.registerHelper("each",function(e,t){var n=t.fn,r=t.inverse,i="";if(e&&e.length>0)for(var s=0,o=e.length;s<o;s++)i+=n(e[s]);else i=r(this);return i}),Handlebars.registerHelper("if",function(e,t){var n=toString.call(e);return n===functionType&&(e=e.call(this)),!e||Handlebars.Utils.isEmpty(e)?t.inverse(this):t.fn(this)}),Handlebars.registerHelper("unless",function(e,t){var n=t.fn,r=t.inverse;return t.fn=r,t.inverse=n,Handlebars.helpers["if"].call(this,e,t)}),Handlebars.registerHelper("with",function(e,t){return t.fn(e)}),Handlebars.registerHelper("log",function(e){Handlebars.log(e)});var handlebars=function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,statements:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,params:25,hash:26,param:27,STRING:28,INTEGER:29,BOOLEAN:30,hashSegments:31,hashSegment:32,ID:33,EQUALS:34,pathSegments:35,SEP:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function(t,n,r,i,s,o,u){var a=o.length-1;switch(s){case 1:return o[a-1];case 2:this.$=new i.ProgramNode(o[a-2],o[a]);break;case 3:this.$=new i.ProgramNode(o[a]);break;case 4:this.$=new i.ProgramNode([]);break;case 5:this.$=[o[a]];break;case 6:o[a-1].push(o[a]),this.$=o[a-1];break;case 7:this.$=new i.InverseNode(o[a-2],o[a-1],o[a]);break;case 8:this.$=new i.BlockNode(o[a-2],o[a-1],o[a]);break;case 9:this.$=o[a];break;case 10:this.$=o[a];break;case 11:this.$=new i.ContentNode(o[a]);break;case 12:this.$=new i.CommentNode(o[a]);break;case 13:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 14:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 15:this.$=o[a-1];break;case 16:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 17:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1],!0);break;case 18:this.$=new i.PartialNode(o[a-1]);break;case 19:this.$=new i.PartialNode(o[a-2],o[a-1]);break;case 20:break;case 21:this.$=[[o[a-2]].concat(o[a-1]),o[a]];break;case 22:this.$=[[o[a-1]].concat(o[a]),null];break;case 23:this.$=[[o[a-1]],o[a]];break;case 24:this.$=[[o[a]],null];break;case 25:o[a-1].push(o[a]),this.$=o[a-1];break;case 26:this.$=[o[a]];break;case 27:this.$=o[a];break;case 28:this.$=new i.StringNode(o[a]);break;case 29:this.$=new i.IntegerNode(o[a]);break;case 30:this.$=new i.BooleanNode(o[a]);break;case 31:this.$=new i.HashNode(o[a]);break;case 32:o[a-1].push(o[a]),this.$=o[a-1];break;case 33:this.$=[o[a]];break;case 34:this.$=[o[a-2],o[a]];break;case 35:this.$=[o[a-2],new i.StringNode(o[a])];break;case 36:this.$=[o[a-2],new i.IntegerNode(o[a])];break;case 37:this.$=[o[a-2],new i.BooleanNode(o[a])];break;case 38:this.$=new i.IdNode(o[a]);break;case 39:o[a-2].push(o[a]),this.$=o[a-2];break;case 40:this.$=[o[a]]}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,23],53:[2,21]},parseError:function(t,n){throw new Error(t)},parse:function(t){function d(e){r.length=r.length-2*e,i.length=i.length-e,s.length=s.length-e}function v(){var e;return e=n.lexer.lex()||1,typeof e!="number"&&(e=n.symbols_[e]||e),e}var n=this,r=[0],i=[null],s=[],o=this.table,u="",a=0,f=0,l=0,c=2,h=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var p=this.lexer.yylloc;s.push(p),typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);var m,g,y,b,w,E,S={},x,T,N,C;for(;;){y=r[r.length-1],this.defaultActions[y]?b=this.defaultActions[y]:(m==null&&(m=v()),b=o[y]&&o[y][m]);if(typeof b=="undefined"||!b.length||!b[0])if(!l){C=[];for(x in o[y])this.terminals_[x]&&x>2&&C.push("'"+this.terminals_[x]+"'");var k="";this.lexer.showPosition?k="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+this.terminals_[m]+"'":k="Parse error on line "+(a+1)+": Unexpected "+(m==1?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[m]||m,line:this.lexer.yylineno,loc:p,expected:C})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+m);switch(b[0]){case 1:r.push(m),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(b[1]),m=null,g?(m=g,g=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:T=this.productions_[b[1]][1],S.$=i[i.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},E=this.performAction.call(S,u,f,a,this.yy,b[1],i,s);if(typeof E!="undefined")return E;T&&(r=r.slice(0,-1*T*2),i=i.slice(0,-1*T),s=s.slice(0,-1*T)),r.push(this.productions_[b[1]][0]),i.push(S.$),s.push(S._$),N=o[r[r.length-2]][r[r.length-1]],r.push(N);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parseError)throw new Error(t);this.yy.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column
+:0},this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;var t=e.match(/\n/);return t&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r;this._more||(this.yytext="",this.match="");var i=this._currentRules();for(var s=0;s<i.length;s++){t=this._input.match(this.rules[i[s]]);if(t){r=t[0].match(/\n.*/g),r&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i[s],this.conditionStack[this.conditionStack.length-1]);if(e)return e;return}}if(this._input==="")return this.EOF;this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return typeof t!="undefined"?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)}};return e.performAction=function(t,n,r,i){var s=i;switch(r){case 0:n.yytext.slice(-1)!=="\\"&&this.begin("mu"),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1),this.begin("emu"));if(n.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return 24;case 4:return 16;case 5:return 20;case 6:return 19;case 7:return 19;case 8:return 23;case 9:return 23;case 10:return n.yytext=n.yytext.substr(3,n.yyleng-5),this.popState(),15;case 11:return 22;case 12:return 34;case 13:return 33;case 14:return 33;case 15:return 36;case 16:break;case 17:return this.popState(),18;case 18:return this.popState(),18;case 19:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\"/g,'"'),28;case 20:return 30;case 21:return 30;case 22:return 29;case 23:return 33;case 24:return n.yytext=n.yytext.substr(1,n.yyleng-2),33;case 25:return"INVALID";case 26:return 5}},e.rules=[/^[^\x00]*?(?=(\{\{))/,/^[^\x00]+/,/^[^\x00]{2,}?(?=(\{\{))/,/^\{\{>/,/^\{\{#/,/^\{\{\//,/^\{\{\^/,/^\{\{\s*else\b/,/^\{\{\{/,/^\{\{&/,/^\{\{![\s\S]*?\}\}/,/^\{\{/,/^=/,/^\.(?=[} ])/,/^\.\./,/^[\/.]/,/^\s+/,/^\}\}\}/,/^\}\}/,/^"(\\["]|[^"])*"/,/^true(?=[}\s])/,/^false(?=[}\s])/,/^[0-9]+(?=[}\s])/,/^[a-zA-Z0-9_$-]+(?=[=}\s\/.])/,/^\[[^\]]*\]/,/^./,/^$/],e.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],inclusive:!1},emu:{rules:[2],inclusive:!1},INITIAL:{rules:[0,1,26],inclusive:!0}},e}();return e.lexer=t,e}();typeof require!="undefined"&&typeof exports!="undefined"&&(exports.parser=handlebars,exports.parse=function(){return handlebars.parse.apply(handlebars,arguments)},exports.main=function(t){if(!t[1])throw new Error("Usage: "+t[0]+" FILE");if(typeof process!="undefined")var n=require("fs").readFileSync(require("path").join(process.cwd(),t[1]),"utf8");else var r=require("file").path(require("file").cwd()),n=r.join(t[1]).read({charset:"utf-8"});return exports.parser.parse(n)},typeof module!="undefined"&&require.main===module&&exports.main(typeof process!="undefined"?process.argv.slice(1):require("system").args)),Handlebars.Parser=handlebars,Handlebars.parse=function(e){return Handlebars.Parser.yy=Handlebars.AST,Handlebars.Parser.parse(e)},Handlebars.print=function(e){return(new Handlebars.PrintVisitor).accept(e)},Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){}},Handlebars.log=function(e,t){Handlebars.logger.log(e,t)},function(){Handlebars.AST={},Handlebars.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new Handlebars.AST.ProgramNode(t))},Handlebars.AST.MustacheNode=function(e,t,n){this.type="mustache",this.id=e[0],this.params=e.slice(1),this.hash=t,this.escaped=!n},Handlebars.AST.PartialNode=function(e,t){this.type="partial",this.id=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new Handlebars.Exception(e.original+" doesn't match "+t.original)};Handlebars.AST.BlockNode=function(t,n,r){e(t.id,r),this.type="block",this.mustache=t,this.program=n},Handlebars.AST.InverseNode=function(t,n,r){e(t.id,r),this.type="inverse",this.mustache=t,this.program=n},Handlebars.AST.ContentNode=function(e){this.type="content",this.string=e},Handlebars.AST.HashNode=function(e){this.type="hash",this.pairs=e},Handlebars.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r<i;r++){var s=e[r];s===".."?n++:s==="."||s==="this"?this.isScoped=!0:t.push(s)}this.parts=t,this.string=t.join("."),this.depth=n,this.isSimple=t.length===1&&n===0},Handlebars.AST.StringNode=function(e){this.type="STRING",this.string=e},Handlebars.AST.IntegerNode=function(e){this.type="INTEGER",this.integer=e},Handlebars.AST.BooleanNode=function(e){this.type="BOOLEAN",this.bool=e},Handlebars.AST.CommentNode=function(e){this.type="comment",this.comment=e}}(),Handlebars.Exception=function(e){var t=Error.prototype.constructor.apply(this,arguments);for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);this.message=t.message},Handlebars.Exception.prototype=new Error,Handlebars.SafeString=function(e){this.string=e},Handlebars.SafeString.prototype.toString=function(){return this.string.toString()},function(){var e={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},t=/&(?!\w+;)|[<>"'`]/g,n=/[&<>"'`]/,r=function(t){return e[t]||"&amp;"};Handlebars.Utils={escapeExpression:function(e){return e instanceof Handlebars.SafeString?e.toString():e==null||e===!1?"":n.test(e)?e.replace(t,r):e},isEmpty:function(e){return typeof e=="undefined"?!0:e===null?!0:e===!1?!0:Object.prototype.toString.call(e)==="[object Array]"&&e.length===0?!0:!1}}}(),Handlebars.Compiler=function(){},Handlebars.JavaScriptCompiler=function(){},function(e,t){e.OPCODE_MAP={appendContent:1,getContext:2,lookupWithHelpers:3,lookup:4,append:5,invokeMustache:6,appendEscaped:7,pushString:8,truthyOrFallback:9,functionOrFallback:10,invokeProgram:11,invokePartial:12,push:13,assignToHash:15,pushStringParam:16},e.MULTI_PARAM_OPCODES={appendContent:1,getContext:1,lookupWithHelpers:2,lookup:1,invokeMustache:3,pushString:1,truthyOrFallback:1,functionOrFallback:1,invokeProgram:3,invokePartial:1,push:1,assignToHash:1,pushStringParam:1},e.DISASSEMBLE_MAP={};for(var n in e.OPCODE_MAP){var r=e.OPCODE_MAP[n];e.DISASSEMBLE_MAP[r]=n}e.multiParamSize=function(t){return e.MULTI_PARAM_OPCODES[e.DISASSEMBLE_MAP[t]]},e.prototype={compiler:e,disassemble:function(){var t=this.opcodes,n,r,i=[],s,o,u;for(var a=0,f=t.length;a<f;a++){n=t[a];if(n==="DECLARE")o=t[++a],u=t[++a],i.push("DECLARE "+o+" = "+u);else{s=e.DISASSEMBLE_MAP[n];var l=e.multiParamSize(n),c=[];for(var h=0;h<l;h++)r=t[++a],typeof r=="string"&&(r='"'+r.replace("\n","\\n")+'"'),c.push(r);s=s+" "+c.join(" "),i.push(s)}}return i.join("\n")},guid:0,compile:function(e,t){this.children=[],this.depths={list:[]},this.options=t;var n=this.options.knownHelpers;this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0};if(n)for(var r in n)this.options.knownHelpers[r]=n[r];return this.program(e)},accept:function(e){return this[e.type](e)},program:function(e){var t=e.statements,n;this.opcodes=[];for(var r=0,i=t.length;r<i;r++)n=t[r],this[n.type](n);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(e,t){return e-t}),this},compileProgram:function(e){var t=(new this.compiler).compile(e,this.options),n=this.guid++;this.usePartial=this.usePartial||t.usePartial,this.children[n]=t;for(var r=0,i=t.depths.list.length;r<i;r++){depth=t.depths.list[r];if(depth<2)continue;this.addDepth(depth-1)}return n},block:function(e){var t=e.mustache,n,r,i,s,o=this.setupStackForMustache(t),u=this.compileProgram(e.program);e.program.inverse&&(s=this.compileProgram(e.program.inverse),this.declare("inverse",s)),this.opcode("invokeProgram",u,o.length,!!t.hash),this.declare("inverse",null),this.opcode("append")},inverse:function(e){var t=this.setupStackForMustache(e.mustache),n=this.compileProgram(e.program);this.declare("inverse",n),this.opcode("invokeProgram",null,t.length,!!e.mustache.hash),this.declare("inverse",null),this.opcode("append")},hash:function(e){var t=e.pairs,n,r;this.opcode("push","{}");for(var i=0,s=t.length;i<s;i++)n=t[i],r=n[1],this.accept(r),this.opcode("assignToHash",n[0])},partial:function(e){var t=e.id;this.usePartial=!0,e.context?this.ID(e.context):this.opcode("push","depth0"),this.opcode("invokePartial",t.original),this.opcode("append")},content:function(e){this.opcode("appendContent",e.string)},mustache:function(e){var t=this.setupStackForMustache(e);this.opcode("invokeMustache",t.length,e.id.original,!!e.hash),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ID:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth),this.opcode("lookupWithHelpers",e.parts[0]||null,e.isScoped||!1);for(var t=1,n=e.parts.length;t<n;t++)this.opcode("lookup",e.parts[t])},STRING:function(e){this.opcode("pushString",e.string)},INTEGER:function(e){this.opcode("push",e.integer)},BOOLEAN:function(e){this.opcode("push",e.bool)},comment:function(){},pushParams:function(e){var t=e.length,n;while(t--)n=e[t],this.options.stringParams?(n.depth&&this.addDepth(n.depth),this.opcode("getContext",n.depth||0),this.opcode("pushStringParam",n.string)):this[n.type](n)},opcode:function(t,n,r,i){this.opcodes.push(e.OPCODE_MAP[t]),n!==undefined&&this.opcodes.push(n),r!==undefined&&this.opcodes.push(r),i!==undefined&&this.opcodes.push(i)},declare:function(e,t){this.opcodes.push("DECLARE"),this.opcodes.push(e),this.opcodes.push(t)},addDepth:function(e){if(e===0)return;this.depths[e]||(this.depths[e]=!0,this.depths.list.push(e))},setupStackForMustache:function(e){var t=e.params;return this.pushParams(t),e.hash&&this.hash(e.hash),this.ID(e.id),t}},t.prototype={nameLookup:function(e,n,r){return/^[0-9]+$/.test(n)?e+"["+n+"]":t.isValidJavaScriptVariableName(n)?e+"."+n:e+"['"+n+"']"},appendToBuffer:function(e){return this.environment.isSimple?"return "+e+";":"buffer += "+e+";"},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(e,t,n,r){this.environment=e,this.options=t||{},this.name=this.environment.name,this.isChild=!!n,this.context=n||{programs:[],aliases:{self:"this"},registers:{list:[]}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.compileChildren(e,t);var i=e.opcodes,s;this.i=0;for(u=i.length;this.i<u;this.i++)s=this.nextOpcode(0),s[0]==="DECLARE"?(this.i=this.i+2,this[s[1]]=s[2]):(this.i=this.i+s[1].length,this[s[0]].apply(this,s[1]));return this.createFunctionContext(r)},nextOpcode:function(t){var n=this.environment.opcodes,r=n[this.i+t],i,s,o,u;if(r==="DECLARE")return i=n[this.i+1],s=n[this.i+2],["DECLARE",i,s];i=e.DISASSEMBLE_MAP[r],o=e.multiParamSize(r),u=[];for(var a=0;a<o;a++)u.push(n[this.i+a+1+t]);return[i,u]},eat:function(e){this.i=this.i+e.length},preamble:function(){var e=[];this.useRegister("foundHelper");if(!this.isChild){var t=this.namespace,n="helpers = helpers || "+t+".helpers;";this.environment.usePartial&&(n=n+" partials = partials || "+t+".partials;"),e.push(n)}else e.push("");this.environment.isSimple?e.push(""):e.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=e},createFunctionContext:function(e){var t=this.stackVars;this.isChild||(t=t.concat(this.context.registers.list)),t.length>0&&(this.source[1]=this.source[1]+", "+t.join(", "));if(!this.isChild){var n=[];for(var r in this.context.aliases)this.source[1]=this.source[1]+", "+r+"="+this.context.aliases[r]}this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.source.push("return buffer;");var i=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var s=0,o=this.environment.depths.list.length;s<o;s++)i.push("depth"+this.environment.depths.list[s]);if(e)return i.push(this.source.join("\n ")),Function.apply(this,i);var u="function "+(this.name||"")+"("+i.join(",")+") {\n "+this.source.join("\n ")+"}";return Handlebars.log(Handlebars.logger.DEBUG,u+"\n\n"),u},appendContent:function(e){this.source.push(this.appendToBuffer(this.quotedString(e)))},append:function(){var e=this.popStack();this.source.push("if("+e+" || "+e+" === 0) { "+this.appendToBuffer(e)+" }"),this.environment.isSimple&&this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){var e=this.nextOpcode(1),t="";this.context.aliases.escapeExpression="this.escapeExpression",e[0]==="appendContent"&&(t=" + "+this.quotedString(e[1][0]),this.eat(e)),this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"+t))},getContext:function(e){this.lastContext!==e&&(this.lastContext=e)},lookupWithHelpers:function(e,t){if(e){var n=this.nextStack();this.usingKnownHelper=!1;var r;!t&&this.options.knownHelpers[e]?(r=n+" = "+this.nameLookup("helpers",e,"helper"),this.usingKnownHelper=!0):t||this.options.knownHelpersOnly?r=n+" = "+this.nameLookup("depth"+this.lastContext,e,"context"):(this.register("foundHelper",this.nameLookup("helpers",e,"helper")),r=n+" = foundHelper || "+this.nameLookup("depth"+this.lastContext,e,"context")),r+=";",this.source.push(r)}else this.pushStack("depth"+this.lastContext)},lookup:function(e){var t=this.topStack();this.source.push(t+" = ("+t+" === null || "+t+" === undefined || "+t+" === false ? "+t+" : "+this.nameLookup(t,e,"context")+");")},pushStringParam:function(e){this.pushStack("depth"+this.lastContext),this.pushString(e)},pushString:function(e){this.pushStack(this.quotedString(e))},push:function(e){this.pushStack(e)},invokeMustache:function(e,t,n){this.populateParams(e,this.quotedString(t),"{}",null,n,function(e,t,n){this.usingKnownHelper||(this.context.aliases.helperMissing="helpers.helperMissing",this.context.aliases.undef="void 0",this.source.push("else if("+n+"=== undef) { "+e+" = helperMissing.call("+t+"); }"),e!==n&&this.source.push("else { "+e+" = "+n+"; }"))})},invokeProgram:function(e,t,n){var r=this.programExpression(this.inverse),i=this.programExpression(e);this.populateParams(t,null,i,r,n,function(e,t,n){this.usingKnownHelper||(this.context.aliases.blockHelperMissing="helpers.blockHelperMissing",this.source.push("else { "+e+" = blockHelperMissing.call("+t+"); }"))})},populateParams:function(e,t,n,r,i,s){var o=i||this.options.stringParams||r||this.options.data,u=this.popStack(),a,f=[],l,c,h;o?(this.register("tmp1",n),h="tmp1"):h="{ hash: {} }";if(o){var p=i?this.popStack():"{}";this.source.push("tmp1.hash = "+p+";")}this.options.stringParams&&this.source.push("tmp1.contexts = [];");for(var d=0;d<e;d++)l=this.popStack(),f.push(l),this.options.stringParams&&this.source.push("tmp1.contexts.push("+this.popStack()+");");r&&(this.source.push("tmp1.fn = tmp1;"),this.source.push("tmp1.inverse = "+r+";")),this.options.data&&this.source.push("tmp1.data = data;"),f.push(h),this.populateCall(f,u,t||u,s,n!=="{}")},populateCall:function(e,t,n,r,i){var s=["depth0"].concat(e).join(", "),o=["depth0"].concat(n).concat(e).join(", "),u=this.nextStack();if(this.usingKnownHelper)this.source.push(u+" = "+t+".call("+s+");");else{this.context.aliases.functionType='"function"';var a=i?"foundHelper && ":"";this.source.push("if("+a+"typeof "+t+" === functionType) { "+u+" = "+t+".call("+s+"); }")}r.call(this,u,o,t),this.usingKnownHelper=!1},invokePartial:function(e){params=[this.nameLookup("partials",e,"partial"),"'"+e+"'",this.popStack(),"helpers","partials"],this.options.data&&params.push("data"),this.pushStack("self.invokePartial("+params.join(", ")+");")},assignToHash:function(e){var t=this.popStack(),n=this.topStack();this.source.push(n+"['"+e+"'] = "+t+";")},compiler:t,compileChildren:function(e,t){var n=e.children,r,i;for(var s=0,o=n.length;s<o;s++){r=n[s],i=new this.compiler,this.context.programs.push("");var u=this.context.programs.length;r.index=u,r.name="program"+u,this.context.programs[u]=i.compile(r,t,this.context)}},programExpression:function(e){if(e==null)return"self.noop";var t=this.environment.children[e],n=t.depths.list,r=[t.index,t.name,"data"];for(var i=0,s=n.length;i<s;i++)depth=n[i],depth===1?r.push("depth0"):r.push("depth"+(depth-1));return n.length===0?"self.program("+r.join(", ")+")":(r.shift(),"self.programWithDepth("+r.join(", ")+")")},register:function(e,t){this.useRegister(e),this.source.push(e+" = "+t+";")},useRegister:function(e){this.context.registers[e]||(this.context.registers[e]=!0,this.context.registers.list.push(e))},pushStack:function(e){return this.source.push(this.nextStack()+" = "+e+";"),"stack"+this.stackSlot},nextStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){return"stack"+this.stackSlot--},topStack:function(){return"stack"+this.stackSlot},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'}};var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=t.RESERVED_WORDS={};for(var o=0,u=i.length;o<u;o++)s[i[o]]=!0;t.isValidJavaScriptVariableName=function(e){return!t.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(e)?!0:!1}}(Handlebars.Compiler,Handlebars.JavaScriptCompiler),Handlebars.precompile=function(e,t){t=t||{};var n=Handlebars.parse(e),r=(new Handlebars.Compiler).compile(n,t);return(new Handlebars.JavaScriptCompiler).compile(r,t)},Handlebars.compile=function(e,t){function r(){var n=Handlebars.parse(e),r=(new Handlebars.Compiler).compile(n,t),i=(new Handlebars.JavaScriptCompiler).compile(r,t,undefined,!0);return Handlebars.template(i)}t=t||{};var n;return function(e,t){return n||(n=r()),n.call(this,e,t)}},Handlebars.VM={template:function(e){var t={escapeExpression:Handlebars.Utils.escapeExpression,invokePartial:Handlebars.VM.invokePartial,programs:[],program:function(e,t,n){var r=this.programs[e];return n?Handlebars.VM.program(t,n):r?r:(r=this.programs[e]=Handlebars.VM.program(t),r)},programWithDepth:Handlebars.VM.programWithDepth,noop:Handlebars.VM.noop};return function(n,r){return r=r||{},e.call(t,Handlebars,n,r.helpers,r.partials,r.data)}},programWithDepth:function(e,t,n){var r=Array.prototype.slice.call(arguments,2);return function(n,i){return i=i||{},e.apply(this,[n,i.data||t].concat(r))}},program:function(e,t){return function(n,r){return r=r||{},e(n,r.data||t)}},noop:function(){return""},invokePartial:function(e,t,n,r,i,s){options={helpers:r,partials:i,data:s};if(e===undefined)throw new Handlebars.Exception("The partial "+t+" could not be found");if(e instanceof Function)return e(n,options);if(!Handlebars.compile)throw new Handlebars.Exception("The partial "+t+" could not be compiled when running in runtime-only mode");return i[t]=Handlebars.compile(e),i[t](n,options)}},Handlebars.template=Handlebars.VM.template,function(e,t){function n(e,t){this._d=e,this._isUTC=!!t}function r(e){return e<0?Math.ceil(e):Math.floor(e)}function i(e){var t=this._data={},n=e.years||e.y||0,i=e.months||e.M||0,s=e.weeks||e.w||0,o=e.days||e.d||0,u=e.hours||e.h||0,a=e.minutes||e.m||0,f=e.seconds||e.s||0,l=e.milliseconds||e.ms||0;this._milliseconds=l+f*1e3+a*6e4+u*36e5,this._days=o+s*7,this._months=i+n*12,t.milliseconds=l%1e3,f+=r(l/1e3),t.seconds=f%60,a+=r(f/60),t.minutes=a%60,u+=r(a/60),t.hours=u%24,o+=r(u/24),o+=s*7,t.days=o%30,i+=r(o/30),t.months=i%12,n+=r(i/12),t.years=n}function s(e,t){var n=e+"";while(n.length<t)n="0"+n;return n}function o(e,t,n){var r=t._milliseconds,i=t._days,s=t._months,o;r&&e._d.setTime(+e+r*n),i&&e.date(e.date()+i*n),s&&(o=e.date(),e.date(1).month(e.month()+s*n).date(Math.min(o,e.daysInMonth())))}function u(e){return Object.prototype.toString.call(e)==="[object Array]"}function a(t){return new e(t[0],t[1]||0,t[2]||1,t[3]||0,t[4]||0,t[5]||0,t[6]||0)}function f(t,n){function r(n){var g,y;switch(n){case"M":return i+1;case"Mo":return i+1+v(i+1);case"MM":return s(i+1,2);case"MMM":return E.monthsShort[i];case"MMMM":return E.months[i];case"D":return o;case"Do":return o+v(o);case"DD":return s(o,2);case"DDD":return g=new e(u,i,o),y=new e(u,0,1),~~((g-y)/864e5+1.5);case"DDDo":return g=r("DDD"),g+v(g);case"DDDD":return s(r("DDD"),3);case"d":return a;case"do":return a+v(a);case"ddd":return E.weekdaysShort[a];case"dddd":return E.weekdays[a];case"w":return g=new e(u,i,o-a+5),y=new e(g.getFullYear(),0,4),~~((g-y)/864e5/7+1.5);case"wo":return g=r("w"),g+v(g);case"ww":return s(r("w"),2);case"YY":return s(u%100,2);case"YYYY":return u;case"a":return m?m(l,c,!1):l>11?"pm":"am";case"A":return m?m(l,c,!0):l>11?"PM":"AM";case"H":return l;case"HH":return s(l,2);case"h":return l%12||12;case"hh":return s(l%12||12,2);case"m":return c;case"mm":return s(c,2);case"s":return h;case"ss":return s(h,2);case"S":return~~(p/100);case"SS":return s(~~(p/10),2);case"SSS":return s(p,3);case"Z":return(d<0?"-":"+")+s(~~(Math.abs(d)/60),2)+":"+s(~~(Math.abs(d)%60),2);case"ZZ":return(d<0?"-":"+")+s(~~(10*Math.abs(d)/6),4);case"L":case"LL":case"LLL":case"LLLL":case"LT":return f(t,E.longDateFormat[n]);default:return n.replace(/(^\[)|(\\)|\]$/g,"")}}var i=t.month(),o=t.date(),u=t.year(),a=t.day(),l=t.hours(),c=t.minutes(),h=t.seconds(),p=t.milliseconds(),d=-t.zone(),v=E.ordinal,m=E.meridiem;return n.replace(O,r)}function l(e){switch(e){case"DDDD":return P;case"YYYY":return H;case"S":case"SS":case"SSS":case"DDD":return D;case"MMM":case"MMMM":case"ddd":case"dddd":case"a":case"A":return B;case"Z":case"ZZ":return j;case"T":return F;case"MM":case"DD":case"dd":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return _;default:return new RegExp(e.replace("\\",""))}}function c(e,t,n,r){var i;switch(e){case"M":case"MM":n[1]=t==null?0:~~t-1;break;case"MMM":case"MMMM":for(i=0;i<12;i++)if(E.monthsParse[i].test(t)){n[1]=i;break}break;case"D":case"DD":case"DDD":case"DDDD":n[2]=~~t;break;case"YY":t=~~t,n[0]=t+(t>70?1900:2e3);break;case"YYYY":n[0]=~~Math.abs(t);break;case"a":case"A":r.isPm=(t+"").toLowerCase()==="pm";break;case"H":case"HH":case"h":case"hh":n[3]=~~t;break;case"m":case"mm":n[4]=~~t;break;case"s":case"ss":n[5]=~~t;break;case"S":case"SS":case"SSS":n[6]=~~(("0."+t)*1e3);break;case"Z":case"ZZ":r.isUTC=!0,i=(t+"").match(U),i&&i[1]&&(r.tzh=~~i[1]),i&&i[2]&&(r.tzm=~~i[2]),i&&i[0]==="+"&&(r.tzh=-r.tzh,r.tzm=-r.tzm)}}function h(t,n){var r=[0,0,1,0,0,0,0],i={tzh:0,tzm:0},s=n.match(O),o,u;for(o=0;o<s.length;o++)u=(l(s[o]).exec(t)||[])[0],t=t.replace(l(s[o]),""),c(s[o],u,r,i);return i.isPm&&r[3]<12&&(r[3]+=12),i.isPm===!1&&r[3]===12&&(r[3]=0),r[3]+=i.tzh,r[4]+=i.tzm,i.isUTC?new e(e.UTC.apply({},r)):a(r)}function p(e,t){var n=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),i=0,s;for(s=0;s<n;s++)~~e[s]!==~~t[s]&&i++;return i+r}function d(e,t){var r,i=e.match(M)||[],s,o=99,u,a,l;for(u=0;u<t.length;u++)a=h(e,t[u]),s=f(new n(a),t[u]).match(M)||[],l=p(i,s),l<o&&(o=l,r=a);return r}function v(t){var n="YYYY-MM-DDT",r;if(I.exec(t)){for(r=0;r<4;r++)if(R[r][1].exec(t)){n+=R[r][0];break}return j.exec(t)?h(t,n+" Z"):h(t,n)}return new e(t)}function m(e,t,n,r){var i=E.relativeTime[e];return typeof i=="function"?i(t||1,!!n,e,r):i.replace(/%d/i,t||1)}function g(e,t){var n=x(Math.abs(e)/1e3),r=x(n/60),i=x(r/60),s=x(i/24),o=x(s/365),u=n<45&&["s",n]||r===1&&["m"]||r<45&&["mm",r]||i===1&&["h"]||i<22&&["hh",i]||s===1&&["d"]||s<=25&&["dd",s]||s<=45&&["M"]||s<345&&["MM",x(s/30)]||o===1&&["y"]||["yy",o];return u[2]=t,u[3]=e>0,m.apply({},u)}function y(e,t){E.fn[e]=function(e){var n=this._isUTC?"UTC":"";return e!=null?(this._d["set"+n+t](e),this):this._d["get"+n+t]()}}function b(e){E.duration.fn[e]=function(){return this._data[e]}}function w(e,t){E.duration.fn["as"+e]=function(){return+this/t}}var E,S="1.6.2",x=Math.round,T,N={},C="en",k=typeof module!="undefined",L="months|monthsShort|monthsParse|weekdays|weekdaysShort|longDateFormat|calendar|relativeTime|ordinal|meridiem".split("|"),A=/^\/?Date\((\-?\d+)/i,O=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|dddd?|do?|w[o|w]?|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|zz?|ZZ?|LT|LL?L?L?)/g,M=/([0-9a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)/gi,_=/\d\d?/,D=/\d{1,3}/,P=/\d{3}/,H=/\d{4}/,B=/[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+/i,j=/Z|[\+\-]\d\d:?\d\d/i,F=/T/i,I=/^\s*\d{4}-\d\d-\d\d(T(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,q="YYYY-MM-DDTHH:mm:ssZ",R=[["HH:mm:ss.S",/T\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/T\d\d:\d\d:\d\d/],["HH:mm",/T\d\d:\d\d/],["HH",/T\d\d/]],U=/([\+\-]|\d\d)/gi,z="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),W={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6};E=function(r,i){if(r===null||r==="")return null;var s,o,f;return E.isMoment(r)?(s=new e(+r._d),f=r._isUTC):i?u(i)?s=d(r,i):s=h(r,i):(o=A.exec(r),s=r===t?new e:o?new e(+o[1]):r instanceof e?r:u(r)?a(r):typeof r=="string"?v(r):new e(r)),new n(s,f)},E.utc=function(t,r){return u(t)?new n(new e(e.UTC.apply({},t)),!0):r&&t?E(t+" +0000",r+" Z").utc():E(t&&!j.exec(t)?t+"+0000":t).utc()},E.unix=function(e){return E(e*1e3)},E.duration=function(e,t){var n=E.isDuration(e),r=typeof e=="number",s=n?e._data:r?{}:e;return r&&(t?s[t]=e:s.milliseconds=e),new i(s)},E.humanizeDuration=function(e,t,n){return E.duration(e,t===!0?null:t).humanize(t===!0?!0:n)},E.version=S,E.defaultFormat=q,E.lang=function(e,t){var n,r,i=[];if(!e)return C;if(t){for(n=0;n<12;n++)i[n]=new RegExp("^"+t.months[n]+"|^"+t.monthsShort[n].replace(".",""),"i");t.monthsParse=t.monthsParse||i,N[e]=t}if(N[e]){for(n=0;n<L.length;n++)E[L[n]]=N[e][L[n]]||N.en[L[n]];C=e}else k&&(r=require("./lang/"+e),E.lang(e,r))},E.lang("en",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},meridiem:!1,calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinal:function(e){var t=e%10;return~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th"}}),E.isMoment=function(e){return e instanceof n},E.isDuration=function(e){return e instanceof i},E.fn=n.prototype={clone:function(){return E(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this._d.toString()},toDate:function(){return this._d},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(e){return f(this,e?e:E.defaultFormat)},add:function(e,t){var n=t?E.duration(+t,e):E.duration(e);return o(this,n,1),this},subtract:function(e,t){var n=t?E.duration(+t,e):E.duration(e);return o(this,n,-1),this},diff:function(e,t,n){var r=this._isUTC?E(e).utc():E(e).local(),i=(this.zone()-r.zone())*6e4,s=this._d-r._d-i,o=this.year()-r.year(),u=this.month()-r.month(),a=this.date()-r.date(),f;return t==="months"?f=o*12+u+a/30:t==="years"?f=o+(u+a/30)/12:f=t==="seconds"?s/1e3:t==="minutes"?s/6e4:t==="hours"?s/36e5:t==="days"?s/864e5:t==="weeks"?s/6048e5:s,n?f:x(f)},from:function(e,t){return E.duration(this.diff(e)).humanize(!t)},fromNow:function(e){return this.from(E(),e)},calendar:function(){var e=this.diff(E().sod(),"days",!0),t=E.calendar,n=t.sameElse,r=e<-6?n:e<-1?t.lastWeek:e<0?t.lastDay:e<1?t.sameDay:e<2?t.nextDay:e<7?t.nextWeek:n;return this.format(typeof r=="function"?r.apply(this):r)},isLeapYear:function(){var e=this.year();return e%4===0&&e%100!==0||e%400===0},isDST:function(){return this.zone()<E([this.year()]).zone()||this.zone()<E([this.year(),5]).zone()},day:function(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e==null?t:this.add({d:e-t})},sod:function(){return E(this).hours(0).minutes(0).seconds(0).milliseconds(0)},eod:function(){return this.sod().add({d:1,ms:-1})},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return E(this).month(this.month()+1).date(0).date()}};for(T=0;T<z.length;T++)y(z[T].toLowerCase(),z[T]);y("year","FullYear"),E.duration.fn=i.prototype={weeks:function(){return r(this.days()/7)},valueOf:function(){return this._milliseconds+this._days*864e5+this._months*2592e6},humanize:function(e){var t=+this,n=E.relativeTime,r=g(t,!e);return e&&(r=(t<=0?n.past:n.future).replace(/%s/i,r)),r}};for(T in W)W.hasOwnProperty(T)&&(w(T,W[T]),b(T.toLowerCase()));w("Weeks",6048e5),k&&(module.exports=E),typeof window!="undefined"&&typeof ender=="undefined"&&(window.moment=E),typeof define=="function"&&define.amd&&define("moment",[],function(){return E})}(Date),!function(e){"use strict";function n(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),r.call(t)},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),r.call(t)})}function r(e){this.$element.hide().trigger("hidden"),i.call(this)}function i(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(s,this)):s.call(this)):t&&t()}function s(){this.$backdrop.remove(),this.$backdrop=null}function o(){var t=this;this.isShown&&this.options.keyboard?e(document).on("keyup.dismiss.modal",function(e){e.which==27&&t.hide()}):this.isShown||e(document).off("keyup.dismiss.modal")}var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this))};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;e("body").addClass("modal-open"),this.isShown=!0,o.call(this),i.call(this,function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,isMobileView&&t.$element.css("top",window.pageYOffset+45+"px"),t.$element.addClass("in"),n?t.$element.one(e.support.transition.end,function(){t.$element.trigger("shown")}):t.$element.trigger("shown")})},hide:function(t){t&&t.preventDefault();var i=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,e("body").removeClass("modal-open"),o.call(this),this.$element.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?n.call(this):r.call(this)}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof
+n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({},i.data(),n.data());t.preventDefault(),i.modal(s)})})}(window.jQuery),function(e,t,n){function r(e,n){var r=t.createElement(e||"div"),i;for(i in n)r[i]=n[i];return r}function i(e){for(var t=1,n=arguments.length;t<n;t++)e.appendChild(arguments[t]);return e}function s(e,t,n,r){var i=["opacity",t,~~(e*100),n,r].join("-"),s=.01+n/r*100,o=Math.max(1-(1-e)/t*(100-s),e),u=h.substring(0,h.indexOf("Animation")).toLowerCase(),a=u&&"-"+u+"-"||"";return c[i]||(p.insertRule("@"+a+"keyframes "+i+"{"+"0%{opacity:"+o+"}"+s+"%{opacity:"+e+"}"+(s+.01)+"%{opacity:1}"+(s+t)%100+"%{opacity:"+e+"}"+"100%{opacity:"+o+"}"+"}",0),c[i]=1),i}function o(e,t){var r=e.style,i,s;if(r[t]!==n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(s=0;s<l.length;s++){i=l[s]+t;if(r[i]!==n)return i}}function u(e,t){for(var n in t)e.style[o(e,n)||n]=t[n];return e}function a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)e[i]===n&&(e[i]=r[i])}return e}function f(e){var t={x:e.offsetLeft,y:e.offsetTop};while(e=e.offsetParent)t.x+=e.offsetLeft,t.y+=e.offsetTop;return t}var l=["webkit","Moz","ms","O"],c={},h,p=function(){var e=r("style");return i(t.getElementsByTagName("head")[0],e),e.sheet||e.styleSheet}(),d={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},v=function m(e){if(!this.spin)return new m(e);this.opts=a(e||{},m.defaults,d)};v.defaults={},a(v.prototype,{spin:function(e){this.stop();var t=this,n=t.opts,i=t.el=u(r(0,{className:n.className}),{position:"relative",zIndex:n.zIndex}),s=n.radius+n.length+n.width,o,a;e&&(e.insertBefore(i,e.firstChild||null),a=f(e),o=f(i),u(i,{left:(n.left=="auto"?a.x-o.x+(e.offsetWidth>>1):n.left+s)+"px",top:(n.top=="auto"?a.y-o.y+(e.offsetHeight>>1):n.top+s)+"px"})),i.setAttribute("aria-role","progressbar"),t.lines(i,t.opts);if(!h){var l=0,c=n.fps,p=c/n.speed,d=(1-n.opacity)/(p*n.trail/100),v=p/n.lines;!function m(){l++;for(var e=n.lines;e;e--){var r=Math.max(1-(l+e*v)%p*d,n.opacity);t.opacity(i,n.lines-e,r,n)}t.timeout=t.el&&setTimeout(m,~~(1e3/c))}()}return t},stop:function(){var e=this.el;return e&&(clearTimeout(this.timeout),e.parentNode&&e.parentNode.removeChild(e),this.el=n),this},lines:function(e,t){function n(e,n){return u(r(),{position:"absolute",width:t.length+t.width+"px",height:t.width+"px",background:e,boxShadow:n,transformOrigin:"left",transform:"rotate("+~~(360/t.lines*o+t.rotate)+"deg) translate("+t.radius+"px"+",0)",borderRadius:(t.width>>1)+"px"})}var o=0,a;for(;o<t.lines;o++)a=u(r(),{position:"absolute",top:1+~(t.width/2)+"px",transform:t.hwaccel?"translate3d(0,0,0)":"",opacity:t.opacity,animation:h&&s(t.opacity,t.trail,o,t.lines)+" "+1/t.speed+"s linear infinite"}),t.shadow&&i(a,u(n("#000","0 0 4px #000"),{top:"2px"})),i(e,i(a,n(t.color,"0 0 1px rgba(0,0,0,.1)")));return e},opacity:function(e,t,n){t<e.childNodes.length&&(e.childNodes[t].style.opacity=n)}}),!function(){function e(e,t){return r("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',t)}var t=u(r("group"),{behavior:"url(#default#VML)"});!o(t,"transform")&&t.adj?(p.addRule(".spin-vml","behavior:url(#default#VML)"),v.prototype.lines=function(t,n){function r(){return u(e("group",{coordsize:a+" "+a,coordorigin:-o+" "+ -o}),{width:a,height:a})}function s(t,s,a){i(l,i(u(r(),{rotation:360/n.lines*t+"deg",left:~~s}),i(u(e("roundrect",{arcsize:1}),{width:o,height:n.width,left:n.radius,top:-n.width>>1,filter:a}),e("fill",{color:n.color,opacity:n.opacity}),e("stroke",{opacity:0}))))}var o=n.length+n.width,a=2*o,f=-(n.width+n.length)*2+"px",l=u(r(),{position:"absolute",top:f,left:f}),c;if(n.shadow)for(c=1;c<=n.lines;c++)s(c,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(c=1;c<=n.lines;c++)s(c);return i(t,l)},v.prototype.opacity=function(e,t,n,r){var i=e.firstChild;r=r.shadow&&r.lines||0,i&&t+r<i.childNodes.length&&(i=i.childNodes[t+r],i=i&&i.firstChild,i=i&&i.firstChild,i&&(i.opacity=n))}):h=o(t,"animation")}(),e.Spinner=v}(window,document);var q=null;window.PR_SHOULD_USE_CONTINUATION=!0,function(){function e(e){function t(e){var t=e.charCodeAt(0);if(t!==92)return t;var n=e.charAt(1);return(t=c[n])?t:"0"<=n&&n<="7"?parseInt(e.substring(1),8):n==="u"||n==="x"?parseInt(e.substring(2),16):e.charCodeAt(1)}function n(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);e=String.fromCharCode(e);if(e==="\\"||e==="-"||e==="["||e==="]")e="\\"+e;return e}function r(e){for(var r=e.substring(1,e.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),e=[],i=[],s=r[0]==="^",o=s?1:0,u=r.length;o<u;++o){var a=r[o];if(/\\[bdsw]/i.test(a))e.push(a);else{var a=t(a),f;o+2<u&&"-"===r[o+1]?(f=t(r[o+2]),o+=2):f=a,i.push([a,f]),f<65||a>122||(f<65||a>90||i.push([Math.max(65,a)|32,Math.min(f,90)|32]),f<97||a>122||i.push([Math.max(97,a)&-33,Math.min(f,122)&-33]))}}i.sort(function(e,t){return e[0]-t[0]||t[1]-e[1]}),r=[],a=[NaN,NaN];for(o=0;o<i.length;++o)u=i[o],u[0]<=a[1]+1?a[1]=Math.max(a[1],u[1]):r.push(a=u);i=["["],s&&i.push("^"),i.push.apply(i,e);for(o=0;o<r.length;++o)u=r[o],i.push(n(u[0])),u[1]>u[0]&&(u[1]+1>u[0]&&i.push("-"),i.push(n(u[1])));return i.push("]"),i.join("")}function i(e){for(var t=e.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),n=t.length,i=[],u=0,a=0;u<n;++u){var f=t[u];f==="("?++a:"\\"===f.charAt(0)&&(f=+f.substring(1))&&f<=a&&(i[f]=-1)}for(u=1;u<i.length;++u)-1===i[u]&&(i[u]=++s);for(a=u=0;u<n;++u)f=t[u],f==="("?(++a,i[a]===void 0&&(t[u]="(?:")):"\\"===f.charAt(0)&&(f=+f.substring(1))&&f<=a&&(t[u]="\\"+i[a]);for(a=u=0;u<n;++u)"^"===t[u]&&"^"!==t[u+1]&&(t[u]="");if(e.ignoreCase&&o)for(u=0;u<n;++u)f=t[u],e=f.charAt(0),f.length>=2&&e==="["?t[u]=r(f):e!=="\\"&&(t[u]=f.replace(/[A-Za-z]/g,function(e){return e=e.charCodeAt(0),"["+String.fromCharCode(e&-33,e|32)+"]"}));return t.join("")}for(var s=0,o=!1,u=!1,a=0,f=e.length;a<f;++a){var l=e[a];if(l.ignoreCase)u=!0;else if(/[a-z]/i.test(l.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){o=!0,u=!1;break}}for(var c={b:8,t:9,n:10,v:11,f:12,r:13},h=[],a=0,f=e.length;a<f;++a){l=e[a];if(l.global||l.multiline)throw Error(""+l);h.push("(?:"+i(l)+")")}return RegExp(h.join("|"),u?"gi":"g")}function t(e){function t(e){switch(e.nodeType){case 1:if(n.test(e.className))break;for(var u=e.firstChild;u;u=u.nextSibling)t(u);u=e.nodeName;if("BR"===u||"LI"===u)r[o]="\n",s[o<<1]=i++,s[o++<<1|1]=e;break;case 3:case 4:u=e.nodeValue,u.length&&(u=a?u.replace(/\r\n?/g,"\n"):u.replace(/[\t\n\r ]+/g," "),r[o]=u,s[o<<1]=i,i+=u.length,s[o++<<1|1]=e)}}var n=/(?:^|\s)nocode(?:\s|$)/,r=[],i=0,s=[],o=0,u;e.currentStyle?u=e.currentStyle.whiteSpace:window.getComputedStyle&&(u=document.defaultView.getComputedStyle(e,q).getPropertyValue("white-space"));var a=u&&"pre"===u.substring(0,3);return t(e),{a:r.join("").replace(/\n$/,""),c:s}}function n(e,t,n,r){t&&(e={a:t,d:e},n(e),r.push.apply(r,e.e))}function r(t,r){function i(e){for(var t=e.d,f=[t,"pln"],l=0,c=e.a.match(o)||[],h={},p=0,d=c.length;p<d;++p){var v=c[p],m=h[v],g=void 0,y;if(typeof m=="string")y=!1;else{var b=s[v.charAt(0)];if(b)g=v.match(b[1]),m=b[0];else{for(y=0;y<a;++y)if(b=r[y],g=v.match(b[1])){m=b[0];break}g||(m="pln")}(y=m.length>=5&&"lang-"===m.substring(0,5))&&(!g||typeof g[1]!="string")&&(y=!1,m="src"),y||(h[v]=m)}b=l,l+=v.length;if(y){y=g[1];var w=v.indexOf(y),E=w+y.length;g[2]&&(E=v.length-g[2].length,w=E-y.length),m=m.substring(5),n(t+b,v.substring(0,w),i,f),n(t+b+w,y,u(m,y),f),n(t+b+E,v.substring(E),i,f)}else f.push(t+b,m)}e.e=f}var s={},o;(function(){for(var n=t.concat(r),i=[],u={},a=0,f=n.length;a<f;++a){var l=n[a],c=l[3];if(c)for(var h=c.length;--h>=0;)s[c.charAt(h)]=l;l=l[1],c=""+l,u.hasOwnProperty(c)||(i.push(l),u[c]=q)}i.push(/[\S\s]/),o=e(i)})();var a=r.length;return i}function i(e){var t=[],n=[];e.tripleQuotedStrings?t.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):e.multiLineStrings?t.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,q,"'\"`"]):t.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]),e.verbatimStrings&&n.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var i=e.hashComments;return i&&(e.cStyleComments?(i>1?t.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):t.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),n.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):t.push(["com",/^#[^\n\r]*/,q,"#"])),e.cStyleComments&&(n.push(["com",/^\/\/[^\n\r]*/,q]),n.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q])),e.regexLiterals&&n.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]),(i=e.types)&&n.push(["typ",i]),e=(""+e.keywords).replace(/^ | $/g,""),e.length&&n.push(["kwd",RegExp("^(?:"+e.replace(/[\s,]+/g,"|")+")\\b"),q]),t.push(["pln",/^\s+/,q," \r\n  "]),n.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]),r(t,n)}function s(e,t){function n(e){switch(e.nodeType){case 1:if(i.test(e.className))break;if("BR"===e.nodeName)r(e),e.parentNode&&e.parentNode.removeChild(e);else for(e=e.firstChild;e;e=e.nextSibling)n(e);break;case 3:case 4:if(a){var t=e.nodeValue,u=t.match(s);if(u){var f=t.substring(0,u.index);e.nodeValue=f,(t=t.substring(u.index+u[0].length))&&e.parentNode.insertBefore(o.createTextNode(t),e.nextSibling),r(e),f||e.parentNode.removeChild(e)}}}}function r(e){function t(e,n){var r=n?e.cloneNode(!1):e,i=e.parentNode;if(i){var i=t(i,1),s=e.nextSibling;i.appendChild(r);for(var o=s;o;o=s)s=o.nextSibling,i.appendChild(o)}return r}for(;!e.nextSibling;)if(e=e.parentNode,!e)return;for(var e=t(e.nextSibling,0),n;(n=e.parentNode)&&n.nodeType===1;)e=n;f.push(e)}var i=/(?:^|\s)nocode(?:\s|$)/,s=/\r\n?|\n/,o=e.ownerDocument,u;e.currentStyle?u=e.currentStyle.whiteSpace:window.getComputedStyle&&(u=o.defaultView.getComputedStyle(e,q).getPropertyValue("white-space"));var a=u&&"pre"===u.substring(0,3);for(u=o.createElement("LI");e.firstChild;)u.appendChild(e.firstChild);for(var f=[u],l=0;l<f.length;++l)n(f[l]);t===(t|0)&&f[0].setAttribute("value",t);var c=o.createElement("OL");c.className="linenums";for(var h=Math.max(0,t-1|0)||0,l=0,p=f.length;l<p;++l)u=f[l],u.className="L"+(l+h)%10,u.firstChild||u.appendChild(o.createTextNode(" ")),c.appendChild(u);e.appendChild(c)}function o(e,t){for(var n=t.length;--n>=0;){var r=t[n];b.hasOwnProperty(r)?window.console&&console.warn("cannot override language handler %s",r):b[r]=e}}function u(e,t){if(!e||!b.hasOwnProperty(e))e=/^\s*</.test(t)?"default-markup":"default-code";return b[e]}function a(e){var n=e.g;try{var r=t(e.h),i=r.a;e.a=i,e.c=r.c,e.d=0,u(n,i)(e);var s=/\bMSIE\b/.test(navigator.userAgent),n=/\n/g,o=e.a,a=o.length,r=0,f=e.c,l=f.length,i=0,c=e.e,h=c.length,e=0;c[h]=a;var p,d;for(d=p=0;d<h;)c[d]!==c[d+2]?(c[p++]=c[d++],c[p++]=c[d++]):d+=2;h=p;for(d=p=0;d<h;){for(var v=c[d],m=c[d+1],g=d+2;g+2<=h&&c[g+1]===m;)g+=2;c[p++]=v,c[p++]=m,d=g}for(c.length=p;i<l;){var y=f[i+2]||a,b=c[e+2]||a,g=Math.min(y,b),w=f[i+1],E;if(w.nodeType!==1&&(E=o.substring(r,g))){s&&(E=E.replace(n,"\r")),w.nodeValue=E;var S=w.ownerDocument,x=S.createElement("SPAN");x.className=c[e+1];var T=w.parentNode;T.replaceChild(x,w),x.appendChild(w),r<y&&(f[i+1]=w=S.createTextNode(o.substring(g,y)),T.insertBefore(w,x.nextSibling))}r=g,r>=y&&(i+=2),r>=b&&(e+=2)}}catch(N){"console"in window&&console.log(N&&N.stack?N.stack:N)}}var f=["break,continue,do,else,for,if,return,while"],l=[[f,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],c=[l,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],h=[l,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],p=[h,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],l=[l,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],d=[f,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],v=[f,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],f=[f,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],m=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,g=/\S/,y=i({keywords:[c,p,l,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+d,v,f],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),b={};o(y,["default-code"]),o(r([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),o(r([["pln",/^\s+/,q," \r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]),o(r([],[["atv",/^[\S\s]+/]]),["uq.val"]),o(i({keywords:c,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),o(i({keywords:"null,true,false"}),["json"]),o(i({keywords:p,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),o(i({keywords:h,cStyleComments:!0}),["java"]),o(i({keywords:f,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]),o(i({keywords:d,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py"]),o(i({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]),o(i({keywords:v,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]),o(i({keywords:l,cStyleComments:!0,regexLiterals:!0}),["js"]),o(i({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),o(r([],[["str",/^[\S\s]+/]]),["regex"]),window.prettyPrintOne=function(e,t,n){var r=document.createElement("PRE");return r.innerHTML=e,n&&s(r,n),a({g:t,i:n,h:r}),r.innerHTML},window.prettyPrint=function(e){function t(){for(var n=window.PR_SHOULD_USE_CONTINUATION?f.now()+250:Infinity;l<r.length&&f.now()<n;l++){var i=r[l],o=i.className;if(o.indexOf("prettyprint")>=0){var o=o.match(h),u,p;if(p=!o){p=i;for(var d=void 0,v=p.firstChild;v;v=v.nextSibling)var m=v.nodeType,d=m===1?d?p:v:m===3?g.test(v.nodeValue)?p:d:d;p=(u=d===p?void 0:d)&&"CODE"===u.tagName}p&&(o=u.className.match(h)),o&&(o=o[1]),p=!1;for(d=i.parentNode;d;d=d.parentNode)if((d.tagName==="pre"||d.tagName==="code"||d.tagName==="xmp")&&d.className&&d.className.indexOf("prettyprint")>=0){p=!0;break}p||((p=(p=i.className.match(/\blinenums\b(?::(\d+))?/))?p[1]&&p[1].length?+p[1]:!0:!1)&&s(i,p),c={g:o,h:i,i:p},a(c))}}l<r.length?setTimeout(t,250):e&&e()}for(var n=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],r=[],i=0;i<n.length;++i)for(var o=0,u=n[i].length;o<u;++o)r.push(n[i][o]);var n=q,f=Date;f.now||(f={now:function(){return+(new Date)}});var l=0,c,h=/\blang(?:uage)?-([\w.]+)(?!\S)/;t()},window.PR={createSimpleLexer:r,registerLangHandler:o,sourceDecorator:i,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}}(),require.config({baseUrl:"/static/",paths:{text:"js/libs/text",json:"js/libs/json"},waitSeconds:15});var spin_opts={lines:9,length:5,width:2,radius:4,rotate:9,color:"#4c4c4c",speed:1.5,trail:40,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2e9},isMobileView=!1,mediaQuery=window.matchMedia("(max-width:600px)");mediaQuery.matches&&(isMobileView=!0),$(function(){$("#mobile-nav-btn").click(function(){$(".main-section").toggleClass("nav-opened")})}); \ No newline at end of file