text: /*!
   * Ventus 0.2
   * Copyright © 2015 Ramón Lamana
   * http://www.rlamana.com
   */
  !function(t,n){"function"==typeof define&&define.amd?define(["$"],n):t.Ventus=n(t.$)}(this,function(t){var n,e,i;return function(t){function r(t,n){var e,i,r,o,s,a,u,c,l,f,h=n&&n.split("/"),p=m.map,d=p&&p["*"]||{};if(t&&"."===t.charAt(0)&&n){for(h=h.slice(0,h.length-1),t=h.concat(t.split("/")),c=0;f=t[c];c++)if("."===f)t.splice(c,1),c-=1;else if(".."===f){if(1===c&&(".."===t[2]||".."===t[0]))return!0;c>0&&(t.splice(c-1,2),c-=2)}t=t.join("/")}if((h||d)&&p){for(e=t.split("/"),c=e.length;c>0;c-=1){if(i=e.slice(0,c).join("/"),h)for(l=h.length;l>0;l-=1)if(r=p[h.slice(0,l).join("/")],r&&(r=r[i])){o=r,s=c;break}if(o)break;!a&&d&&d[i]&&(a=d[i],u=c)}!o&&a&&(o=a,s=u),o&&(e.splice(0,s,o),t=e.join("/"))}return t}function o(n,e){return function(){return h.apply(t,g.call(arguments,0).concat([n,e]))}}function s(t){return function(n){return r(n,t)}}function a(t){return function(n){p[t]=n}}function u(n){if(d.hasOwnProperty(n)){var e=d[n];delete d[n],v[n]=!0,f.apply(t,e)}if(!p.hasOwnProperty(n))throw new Error("No "+n);return p[n]}function c(t,n){var e,i,o=t.indexOf("!");return-1!==o?(e=r(t.slice(0,o),n),t=t.slice(o+1),i=u(e),t=i&&i.normalize?i.normalize(t,s(n)):r(t,n)):t=r(t,n),{f:e?e+"!"+t:t,n:t,p:i}}function l(t){return function(){return m&&m.config&&m.config[t]||{}}}var f,h,p={},d={},m={},v={},g=[].slice;f=function(n,e,i,r){var s,f,h,m,g,w,b=[];if(r=r||n,"function"==typeof i){for(e=!e.length&&i.length?["require","exports","module"]:e,w=0;w<e.length;w++)if(g=c(e[w],r),h=g.f,"require"===h)b[w]=o(n);else if("exports"===h)b[w]=p[n]={},s=!0;else if("module"===h)f=b[w]={id:n,uri:"",exports:p[n],config:l(n)};else if(p.hasOwnProperty(h)||d.hasOwnProperty(h))b[w]=u(h);else if(g.p)g.p.load(g.n,o(r,!0),a(h),{}),b[w]=p[h];else if(!v[h])throw new Error(n+" missing "+h);m=i.apply(p[n],b),n&&(f&&f.exports!==t&&f.exports!==p[n]?p[n]=f.exports:m===t&&s||(p[n]=m))}else n&&(p[n]=i)},n=e=h=function(n,e,i,r){return"string"==typeof n?u(c(n,e).f):(n.splice||(m=n,e.splice?(n=e,e=i,i=null):n=t),e=e||function(){},r?f(t,n,e,i):setTimeout(function(){f(t,n,e,i)},15),h)},h.config=function(t){return m=t,h},i=function(t,n,e){n.splice||(e=n,n=[]),d[t]=[t,n,e]},i.amd={jQuery:!0}}(),i("almond",[],function(){}),function(t,n){"function"==typeof i&&i.amd?i("handlebars",[],n):"object"==typeof exports?module.exports=n():t.Handlebars=t.Handlebars||n()}(this,function(){var t=function(){"use strict";function t(t){this.string=t}var n;return t.prototype.toString=function(){return""+this.string},n=t}(),n=function(t){"use strict";function n(t){return u[t]}function e(t){for(var n=1;n<arguments.length;n++)for(var e in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],e)&&(t[e]=arguments[n][e]);return t}function i(t){return t instanceof a?t.toString():null==t?"":t?(t=""+t,l.test(t)?t.replace(c,n):t):t+""}function r(t){return t||0===t?p(t)&&0===t.length?!0:!1:!0}function o(t,n){return(t?t+".":"")+n}var s={},a=t,u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/[&<>"'`]/g,l=/[&<>"'`]/;s.extend=e;var f=Object.prototype.toString;s.toString=f;var h=function(t){return"function"==typeof t};h(/x/)&&(h=function(t){return"function"==typeof t&&"[object Function]"===f.call(t)});var h;s.isFunction=h;var p=Array.isArray||function(t){return t&&"object"==typeof t?"[object Array]"===f.call(t):!1};return s.isArray=p,s.escapeExpression=i,s.isEmpty=r,s.appendContextPath=o,s}(t),e=function(){"use strict";function t(t,n){var i;n&&n.firstLine&&(i=n.firstLine,t+=" - "+i+":"+n.firstColumn);for(var r=Error.prototype.constructor.call(this,t),o=0;o<e.length;o++)this[e[o]]=r[e[o]];i&&(this.lineNumber=i,this.column=n.firstColumn)}var n,e=["description","fileName","lineNumber","message","name","number","stack"];return t.prototype=new Error,n=t}(),i=function(t,n){"use strict";function e(t,n){this.helpers=t||{},this.partials=n||{},i(this)}function i(t){t.registerHelper("helperMissing",function(){if(1===arguments.length)return void 0;throw new s("Missing helper: '"+arguments[arguments.length-1].name+"'")}),t.registerHelper("blockHelperMissing",function(n,e){var i=e.inverse,r=e.fn;if(n===!0)return r(this);if(n===!1||null==n)return i(this);if(l(n))return n.length>0?(e.ids&&(e.ids=[e.name]),t.helpers.each(n,e)):i(this);if(e.data&&e.ids){var s=v(e.data);s.contextPath=o.appendContextPath(e.data.contextPath,e.name),e={data:s}}return r(n,e)}),t.registerHelper("each",function(t,n){if(!n)throw new s("Must pass iterator to #each");var e,i,r=n.fn,a=n.inverse,u=0,c="";if(n.data&&n.ids&&(i=o.appendContextPath(n.data.contextPath,n.ids[0])+"."),f(t)&&(t=t.call(this)),n.data&&(e=v(n.data)),t&&"object"==typeof t)if(l(t))for(var h=t.length;h>u;u++)e&&(e.index=u,e.first=0===u,e.last=u===t.length-1,i&&(e.contextPath=i+u)),c+=r(t[u],{data:e});else for(var p in t)t.hasOwnProperty(p)&&(e&&(e.key=p,e.index=u,e.first=0===u,i&&(e.contextPath=i+p)),c+=r(t[p],{data:e}),u++);return 0===u&&(c=a(this)),c}),t.registerHelper("if",function(t,n){return f(t)&&(t=t.call(this)),!n.hash.includeZero&&!t||o.isEmpty(t)?n.inverse(this):n.fn(this)}),t.registerHelper("unless",function(n,e){return t.helpers["if"].call(this,n,{fn:e.inverse,inverse:e.fn,hash:e.hash})}),t.registerHelper("with",function(t,n){f(t)&&(t=t.call(this));var e=n.fn;if(o.isEmpty(t))return n.inverse(this);if(n.data&&n.ids){var i=v(n.data);i.contextPath=o.appendContextPath(n.data.contextPath,n.ids[0]),n={data:i}}return e(t,n)}),t.registerHelper("log",function(n,e){var i=e.data&&null!=e.data.level?parseInt(e.data.level,10):1;t.log(i,n)}),t.registerHelper("lookup",function(t,n){return t&&t[n]})}var r={},o=t,s=n,a="2.0.0";r.VERSION=a;var u=6;r.COMPILER_REVISION=u;var c={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1"};r.REVISION_CHANGES=c;var l=o.isArray,f=o.isFunction,h=o.toString,p="[object Object]";r.HandlebarsEnvironment=e,e.prototype={constructor:e,logger:d,log:m,registerHelper:function(t,n){if(h.call(t)===p){if(n)throw new s("Arg not supported with multiple helpers");o.extend(this.helpers,t)}else this.helpers[t]=n},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,n){h.call(t)===p?o.extend(this.partials,t):this.partials[t]=n},unregisterPartial:function(t){delete this.partials[t]}};var d={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(t,n){if(d.level<=t){var e=d.methodMap[t];"undefined"!=typeof console&&console[e]&&console[e].call(console,n)}}};r.logger=d;var m=d.log;r.log=m;var v=function(t){var n=o.extend({},t);return n._parent=t,n};return r.createFrame=v,r}(n,e),r=function(t,n,e){"use strict";function i(t){var n=t&&t[0]||1,e=h;if(n!==e){if(e>n){var i=p[e],r=p[n];throw new f("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+i+") or downgrade your runtime to an older version ("+r+").")}throw new f("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}}function r(t,n){if(!n)throw new f("No environment passed to template");if(!t||!t.main)throw new f("Unknown template object: "+typeof t);n.VM.checkRevision(t.compiler);var e=function(e,i,r,o,s,a,u,c,h){s&&(o=l.extend({},o,s));var p=n.VM.invokePartial.call(this,e,r,o,a,u,c,h);if(null==p&&n.compile){var d={helpers:a,partials:u,data:c,depths:h};u[r]=n.compile(e,{data:void 0!==c,compat:t.compat},n),p=u[r](o,d)}if(null!=p){if(i){for(var m=p.split("\n"),v=0,g=m.length;g>v&&(m[v]||v+1!==g);v++)m[v]=i+m[v];p=m.join("\n")}return p}throw new f("The partial "+r+" could not be compiled when running in runtime-only mode")},i={lookup:function(t,n){for(var e=t.length,i=0;e>i;i++)if(t[i]&&null!=t[i][n])return t[i][n]},lambda:function(t,n){return"function"==typeof t?t.call(n):t},escapeExpression:l.escapeExpression,invokePartial:e,fn:function(n){return t[n]},programs:[],program:function(t,n,e){var i=this.programs[t],r=this.fn(t);return n||e?i=o(this,t,r,n,e):i||(i=this.programs[t]=o(this,t,r)),i},data:function(t,n){for(;t&&n--;)t=t._parent;return t},merge:function(t,n){var e=t||n;return t&&n&&t!==n&&(e=l.extend({},n,t)),e},noop:n.VM.noop,compilerInfo:t.compiler},r=function(n,e){e=e||{};var o=e.data;r._setup(e),!e.partial&&t.useData&&(o=u(n,o));var s;return t.useDepths&&(s=e.depths?[n].concat(e.depths):[n]),t.main.call(i,n,i.helpers,i.partials,o,s)};return r.isTop=!0,r._setup=function(e){e.partial?(i.helpers=e.helpers,i.partials=e.partials):(i.helpers=i.merge(e.helpers,n.helpers),t.usePartial&&(i.partials=i.merge(e.partials,n.partials)))},r._child=function(n,e,r){if(t.useDepths&&!r)throw new f("must pass parent depths");return o(i,n,t[n],e,r)},r}function o(t,n,e,i,r){var o=function(n,o){return o=o||{},e.call(t,n,t.helpers,t.partials,o.data||i,r&&[n].concat(r))};return o.program=n,o.depth=r?r.length:0,o}function s(t,n,e,i,r,o,s){var a={partial:!0,helpers:i,partials:r,data:o,depths:s};if(void 0===t)throw new f("The partial "+n+" could not be found");return t instanceof Function?t(e,a):void 0}function a(){return""}function u(t,n){return n&&"root"in n||(n=n?d(n):{},n.root=t),n}var c={},l=t,f=n,h=e.COMPILER_REVISION,p=e.REVISION_CHANGES,d=e.createFrame;return c.checkRevision=i,c.template=r,c.program=o,c.invokePartial=s,c.noop=a,c}(n,e,i),o=function(t,n,e,i,r){"use strict";var o,s=t,a=n,u=e,c=i,l=r,f=function(){var t=new s.HandlebarsEnvironment;return c.extend(t,s),t.SafeString=a,t.Exception=u,t.Utils=c,t.escapeExpression=c.escapeExpression,t.VM=l,t.template=function(n){return l.template(n,t)},t},h=f();return h.create=f,h["default"]=h,o=h}(i,t,e,n,r);return o}),function(t){"use strict";function n(t,n,e){return function(i){return(i.funct===t&&i.scope===n)===e}}function e(t,e,i,r){return t[e]?t[e].some(n(i,r,!0)):!1}function r(){this._listeners={}}r.prototype={listenersCount:function(t){var n=this._listeners[t];return n?n.length:0},on:function(t,n,i){var r=this._listeners;e(r,t,n,i)||(r[t]||(r[t]=[]),r[t].push({funct:n,scope:i}))},off:function(t,e,i){var r=this._listeners[t];r&&(this._listeners[t]=r.filter(n(e,i,!1)))},once:function(t,n,i){e(this._listeners,t,n,i)||this.on(t,function r(){this.off(t,r,this),n.apply(i,arguments)},this)},emit:function(t){var n=this._listeners[t];if(n){var e=Array.prototype.slice.call(arguments,1);n.forEach(function(t){t.funct.apply(t.scope,e)})}},connect:function(t,n){if(t)for(var e in t)t.hasOwnProperty(e)&&this.on(e,t[e],n)},disconnect:function(t,n){if(t)for(var e in t)t.hasOwnProperty(e)&&this.off(e,t[e],n)}},"undefined"!=typeof module&&module.exports?module.exports=r:"undefined"!=typeof i&&i.amd?i("ventus/core/emitter",[],function(){return r}):t.Emitter=r}(this),i("ventus/core/view",["$"],function(t){"use strict";for(var n=/^(?:(.*)\s)?(\w+)$/,e="transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",i="animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd",r=["transform","transition","animation","transform-origin"],o=r.length;o--;)!function(n){t.cssHooks[n]={get:function(){return null},set:function(t,e){t.style["-webkit-"+n]=e,t.style["-moz-"+n]=e,t.style["-ms-"+n]=e,t.style["-o-"+n]=e,t.style[n]=e}}}(r[o]);return t.fn.extend({listen:function(t,e){var i,r,o,s;for(var a in t)if(t.hasOwnProperty(a)){if(i=t[a],r=a.match(n),o=r[1],s=r[2],"mousedown"===s?s+=" touchstart":"mousemove"===s?s+=" touchmove":"mouseup"===s?s+=" touchend":"click"===s&&(s+=" touchend"),"string"==typeof i&&(i=e[i]),!i)throw new Error("Handler not found");o?this.on(s,o,i.bind(e)):this.on(s,i.bind(e))}return this},onTransitionEnd:function(t,n){this.one(e,function(){t.apply(n||this)})},onAnimationEnd:function(t,n){this.one(i,function(){t.apply(n||this)})}}),function(n){return"function"==typeof n?function(e){return t(n(e||{}))}:t(n)}}),i("ventus/tpl/window",["handlebars"],function(t){return t.template({compiler:[6,">= 2.0.0-beta.1"],main:function(t,n,e,i){var r,o="function",s=n.helperMissing,a=this.escapeExpression;return'<div class="wm-window '+a((r=null!=(r=n.classname||(null!=t?t.classname:t))?r:s,typeof r===o?r.call(t,{name:"classname",hash:{},data:i}):r))+'">\n	<div class="wm-window-box">\n		<header class="wm-window-title" unselectable="on">\n			<h1 unselectable="on">'+a((r=null!=(r=n.title||(null!=t?t.title:t))?r:s,typeof r===o?r.call(t,{name:"title",hash:{},data:i}):r))+'</h1>\n			<div class="wm-button-group">\n				<button class="wm-minimize">&nbsp;</button>\n				<button class="wm-maximize">&nbsp;</button>\n				<button class="wm-close">&nbsp;</button>\n			</div>\n		</header>\n\n		<section class="wm-content"></section>\n\n		<button class="wm-resize">&nbsp;</button>\n	</div>\n	<div class="wm-window-overlay"></div>\n</div>\n'},useData:!0})}),i("ventus/wm/window",["ventus/core/emitter","ventus/core/view","ventus/tpl/window"],function(t,n,e){"use strict";var i=function(i){this.signals=new t,i=i||{title:"Untitle Window",width:400,height:200,x:0,y:0,content:"",movable:!0,resizable:!0,widget:!1,titlebar:!0},this.el=n(e({title:i.title,classname:i.classname||""})),this.el.listen(this.events.window,this),i.opacity&&this.el.css("opacity",i.opacity),this.$content=this.el.find(".wm-content"),i.content&&this.$content.append(i.content),this.$titlebar=this.el.find("header"),this.width=i.width||400,this.height=i.height||200,this.x=i.x||0,this.y=i.y||0,this.z=1e4,this.opened=!1,this.enabled=!0,this.active=!1,this.maximized=!1,this.minimized=!1,this.widget=!1,this.movable=!0,this.resizable="undefined"!=typeof i.resizable?i.resizable:!0,this.titlebar=!0};return i.prototype={_restore:null,_moving:null,_resizing:null,slots:{move:function(t){this.enabled&&this.movable&&(this._moving=this.toLocal({x:t.originalEvent.pageX,y:t.originalEvent.pageY}),this.el.addClass("move"),t.preventDefault())}},events:{window:{click:function(t){this.signals.emit("select",this,t)},mousedown:function(t){this.focus(),this.widget&&this.slots.move.call(this,t)},".wm-content click":function(t){this.enabled&&this.signals.emit("click",this,t)},".wm-window-title mousedown":function(t){this.slots.move.call(this,t)},".wm-window-title dblclick":function(){this.enabled&&this.resizable&&this.maximize()},".wm-window-title button.wm-close click":function(t){t.stopPropagation(),t.preventDefault(),this.enabled&&this.close()},".wm-window-title button.wm-maximize click":function(t){t.stopPropagation(),t.preventDefault(),this.enabled&&this.resizable&&this.maximize()},".wm-window-title button.wm-minimize click":function(t){t.stopPropagation(),t.preventDefault(),this.enabled&&this.minimize()},".wm-window-title button mousedown":function(t){this.focus(),t.stopPropagation(),t.preventDefault()},"button.wm-resize mousedown":function(t){this.enabled&&this.resizable&&(this._resizing={width:this.width-t.originalEvent.pageX,height:this.height-t.originalEvent.pageY},this.el.addClass("resizing"),t.preventDefault())}},space:{mousemove:function(t){this._moving&&this.move(t.originalEvent.pageX-this._moving.x,t.originalEvent.pageY-this._moving.y),this._resizing&&this.resize(t.originalEvent.pageX+this._resizing.width,t.originalEvent.pageY+this._resizing.height)},mouseup:function(){this._moving&&(this.el.removeClass("move"),this._moving=null),this._resizing&&(this.el.removeClass("resizing"),this._restore=null,this._resizing=null)}}},set space(t){return t&&!t.listen?void console.error("The given space element is not a valid View"):(this._space=t,t.append(this.el),void t.listen(this.events.space,this))},get space(){return this._space},get maximized(){return this._maximized},set maximized(t){t?(this._restoreMaximized=this.stamp(),this.signals.emit("maximize",this,this._restoreMaximized)):this.signals.emit("restore",this,this._restoreMaximized),this._maximized=t},get minimized(){return this._minimized},set minimized(t){t?(this._restoreMinimized=this.stamp(),this.signals.emit("minimize",this,this._restoreMinimized)):this.signals.emit("restore",this,this._restoreMinimized),this._minimized=t},set active(t){t?(this.signals.emit("focus",this),this.el.addClass("active"),this.el.removeClass("inactive")):(this.signals.emit("blur",this),this.el.removeClass("active"),this.el.addClass("inactive")),this._active=t},get active(){return this._active},set enabled(t){t?this.el.removeClass("disabled"):this.el.addClass("disabled"),this._enabled=t},get enabled(){return this._enabled},set movable(t){this._movable=!!t},get movable(){return this._movable},set resizable(t){t?this.el.removeClass("noresizable"):this.el.addClass("noresizable"),this._resizable=!!t},get resizable(){return this._resizable},set closed(t){this.opened=!t,t&&(this.signals.emit("close",this),this.el.addClass("closing"),this.el.onAnimationEnd(function(){this.el.removeClass("closing"),this.el.addClass("closed"),this.el.hide(),this.$content.html("")},this))},get closed(){return!this._opened},set opened(t){t&&(this.signals.emit("open",this),this.el.show(),this.el.addClass("opening"),this.el.onAnimationEnd(function(){this.el.removeClass("opening")},this)),this._opened=t},get opened(){return this._opened},set widget(t){this._widget=t},get widget(){return this._widget},set titlebar(t){t?this.$titlebar.removeClass("hide"):this.$titlebar.addClass("hide"),this._titlebar=t},get titlebar(){return this._titlebar},set width(t){this.el.width(t)},get width(){return parseInt(this.el.width(),10)},set height(t){this.el.height(t)},get height(){return parseInt(this.el.height(),10)},set x(t){this.el.css("left",t)},set y(t){this.el.css("top",t)},get x(){return parseInt(this.el.css("left"),10)},get y(){return parseInt(this.el.css("top"),10)},set z(t){this.el.css("z-index",t)},get z(){return parseInt(this.el.css("z-index"),10)},open:function(){return this.opened=!0,this},resize:function(t,n){return this.width=t,this.height=n,this},move:function(t,n){return this.x=t,this.y=n,this},stamp:function(){return this.restore=function(){var t={width:this.width,height:this.height},n={x:this.x,y:this.y};return function(){return this.resize(t.width,t.height),this.move(n.x,n.y),this}}.apply(this),this.restore},restore:function(){},maximize:function(){return this.el.addClass("maximazing"),this.el.onTransitionEnd(function(){this.el.removeClass("maximazing")},this),this.maximized=!this.maximized,this},minimize:function(){return this.el.addClass("minimizing"),this.el.onTransitionEnd(function(){this.el.removeClass("minimizing")},this),this.minimized=!this.minimized,this},close:function(){return this.closed=!0,this},focus:function(){return this.active=!0,this},blur:function(){return this.active=!1,this},toLocal:function(t){return{x:t.x-this.x,y:t.y-this.y}},toGlobal:function(t){return{x:t.x+this.x,y:t.y+this.y}},append:function(t){t.appendTo(this.$content)}},i}),i("ventus/wm/modes/default",[],function(){"use strict";var t={register:function(){console.log("Default mode registered.")},plug:function(){},unplug:function(){},actions:{maximize:function(t){t.move(0,0),t.el.css("-webkit-transform","translate3d(0, 0, 0);"),t.resize(this.el.width(),this.el.height())},restore:function(t,n){n.call(t)},minimize:function(t){t.resize(0,0)}}};return t}),function(){var t=this,n=t._,e={},i=Array.prototype,r=Object.prototype,o=Function.prototype,s=i.push,a=i.slice,u=i.concat,c=r.toString,l=r.hasOwnProperty,f=i.forEach,h=i.map,p=i.reduce,d=i.reduceRight,m=i.filter,v=i.every,g=i.some,w=i.indexOf,b=i.lastIndexOf,y=Array.isArray,x=Object.keys,j=o.bind,_=function(t){return t instanceof _?t:this instanceof _?void(this._wrapped=t):new _(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=_),exports._=_):t._=_,_.VERSION="1.4.4";var O=_.each=_.forEach=function(t,n,i){if(null!=t)if(f&&t.forEach===f)t.forEach(n,i);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(n.call(i,t[r],r,t)===e)return}else for(var s in t)if(_.has(t,s)&&n.call(i,t[s],s,t)===e)return};_.map=_.collect=function(t,n,e){var i=[];return null==t?i:h&&t.map===h?t.map(n,e):(O(t,function(t,r,o){i[i.length]=n.call(e,t,r,o)}),i)};var E="Reduce of empty array with no initial value";_.reduce=_.foldl=_.inject=function(t,n,e,i){var r=arguments.length>2;if(null==t&&(t=[]),p&&t.reduce===p)return i&&(n=_.bind(n,i)),r?t.reduce(n,e):t.reduce(n);if(O(t,function(t,o,s){r?e=n.call(i,e,t,o,s):(e=t,r=!0)}),!r)throw new TypeError(E);return e},_.reduceRight=_.foldr=function(t,n,e,i){var r=arguments.length>2;if(null==t&&(t=[]),d&&t.reduceRight===d)return i&&(n=_.bind(n,i)),r?t.reduceRight(n,e):t.reduceRight(n);var o=t.length;if(o!==+o){var s=_.keys(t);o=s.length}if(O(t,function(a,u,c){u=s?s[--o]:--o,r?e=n.call(i,e,t[u],u,c):(e=t[u],r=!0)}),!r)throw new TypeError(E);return e},_.find=_.detect=function(t,n,e){var i;return z(t,function(t,r,o){return n.call(e,t,r,o)?(i=t,!0):void 0}),i},_.filter=_.select=function(t,n,e){var i=[];return null==t?i:m&&t.filter===m?t.filter(n,e):(O(t,function(t,r,o){n.call(e,t,r,o)&&(i[i.length]=t)}),i)},_.reject=function(t,n,e){return _.filter(t,function(t,i,r){return!n.call(e,t,i,r)},e)},_.every=_.all=function(t,n,i){n||(n=_.identity);var r=!0;return null==t?r:v&&t.every===v?t.every(n,i):(O(t,function(t,o,s){return(r=r&&n.call(i,t,o,s))?void 0:e}),!!r)};var z=_.some=_.any=function(t,n,i){n||(n=_.identity);var r=!1;return null==t?r:g&&t.some===g?t.some(n,i):(O(t,function(t,o,s){return r||(r=n.call(i,t,o,s))?e:void 0}),!!r)};_.contains=_.include=function(t,n){return null==t?!1:w&&t.indexOf===w?-1!=t.indexOf(n):z(t,function(t){return t===n})},_.invoke=function(t,n){var e=a.call(arguments,2),i=_.isFunction(n);return _.map(t,function(t){return(i?n:t[n]).apply(t,e)})},_.pluck=function(t,n){return _.map(t,function(t){return t[n]})},_.where=function(t,n,e){return _.isEmpty(n)?e?null:[]:_[e?"find":"filter"](t,function(t){for(var e in n)if(n[e]!==t[e])return!1;return!0})},_.findWhere=function(t,n){return _.where(t,n,!0)},_.max=function(t,n,e){if(!n&&_.isArray(t)&&t[0]===+t[0]&&65535>t.length)return Math.max.apply(Math,t);if(!n&&_.isEmpty(t))return-1/0;var i={computed:-1/0,value:-1/0};return O(t,function(t,r,o){var s=n?n.call(e,t,r,o):t;s>=i.computed&&(i={value:t,computed:s})}),i.value},_.min=function(t,n,e){if(!n&&_.isArray(t)&&t[0]===+t[0]&&65535>t.length)return Math.min.apply(Math,t);if(!n&&_.isEmpty(t))return 1/0;var i={computed:1/0,value:1/0};return O(t,function(t,r,o){var s=n?n.call(e,t,r,o):t;i.computed>s&&(i={value:t,computed:s})}),i.value},_.shuffle=function(t){var n,e=0,i=[];return O(t,function(t){n=_.random(e++),i[e-1]=i[n],i[n]=t}),i};var k=function(t){return _.isFunction(t)?t:function(n){return n[t]}};_.sortBy=function(t,n,e){var i=k(n);return _.pluck(_.map(t,function(t,n,r){return{value:t,index:n,criteria:i.call(e,t,n,r)}}).sort(function(t,n){var e=t.criteria,i=n.criteria;if(e!==i){if(e>i||void 0===e)return 1;if(i>e||void 0===i)return-1}return t.index<n.index?-1:1}),"value")};var C=function(t,n,e,i){var r={},o=k(n||_.identity);return O(t,function(n,s){var a=o.call(e,n,s,t);i(r,a,n)}),r};_.groupBy=function(t,n,e){return C(t,n,e,function(t,n,e){(_.has(t,n)?t[n]:t[n]=[]).push(e)})},_.countBy=function(t,n,e){return C(t,n,e,function(t,n){_.has(t,n)||(t[n]=0),t[n]++})},_.sortedIndex=function(t,n,e,i){e=null==e?_.identity:k(e);for(var r=e.call(i,n),o=0,s=t.length;s>o;){var a=o+s>>>1;r>e.call(i,t[a])?o=a+1:s=a}return o},_.toArray=function(t){return t?_.isArray(t)?a.call(t):t.length===+t.length?_.map(t,_.identity):_.values(t):[]},_.size=function(t){return null==t?0:t.length===+t.length?t.length:_.keys(t).length},_.first=_.head=_.take=function(t,n,e){return null==t?void 0:null==n||e?t[0]:a.call(t,0,n)},_.initial=function(t,n,e){return a.call(t,0,t.length-(null==n||e?1:n))},_.last=function(t,n,e){return null==t?void 0:null==n||e?t[t.length-1]:a.call(t,Math.max(t.length-n,0))},_.rest=_.tail=_.drop=function(t,n,e){return a.call(t,null==n||e?1:n)},_.compact=function(t){return _.filter(t,_.identity)};var A=function(t,n,e){return O(t,function(t){_.isArray(t)?n?s.apply(e,t):A(t,n,e):e.push(t)}),e};_.flatten=function(t,n){return A(t,n,[])},_.without=function(t){return _.difference(t,a.call(arguments,1))},_.uniq=_.unique=function(t,n,e,i){_.isFunction(n)&&(i=e,e=n,n=!1);var r=e?_.map(t,e,i):t,o=[],s=[];return O(r,function(e,i){(n?i&&s[s.length-1]===e:_.contains(s,e))||(s.push(e),o.push(t[i]))}),o},_.union=function(){return _.uniq(u.apply(i,arguments))},_.intersection=function(t){var n=a.call(arguments,1);return _.filter(_.uniq(t),function(t){return _.every(n,function(n){return _.indexOf(n,t)>=0})})},_.difference=function(t){var n=u.apply(i,a.call(arguments,1));return _.filter(t,function(t){return!_.contains(n,t)})},_.zip=function(){for(var t=a.call(arguments),n=_.max(_.pluck(t,"length")),e=Array(n),i=0;n>i;i++)e[i]=_.pluck(t,""+i);return e},_.object=function(t,n){if(null==t)return{};for(var e={},i=0,r=t.length;r>i;i++)n?e[t[i]]=n[i]:e[t[i][0]]=t[i][1];return e},_.indexOf=function(t,n,e){if(null==t)return-1;var i=0,r=t.length;if(e){if("number"!=typeof e)return i=_.sortedIndex(t,n),t[i]===n?i:-1;i=0>e?Math.max(0,r+e):e}if(w&&t.indexOf===w)return t.indexOf(n,e);for(;r>i;i++)if(t[i]===n)return i;return-1},_.lastIndexOf=function(t,n,e){if(null==t)return-1;var i=null!=e;if(b&&t.lastIndexOf===b)return i?t.lastIndexOf(n,e):t.lastIndexOf(n);for(var r=i?e:t.length;r--;)if(t[r]===n)return r;return-1},_.range=function(t,n,e){1>=arguments.length&&(n=t||0,t=0),e=arguments[2]||1;for(var i=Math.max(Math.ceil((n-t)/e),0),r=0,o=Array(i);i>r;)o[r++]=t,t+=e;return o},_.bind=function(t,n){if(t.bind===j&&j)return j.apply(t,a.call(arguments,1));var e=a.call(arguments,2);return function(){return t.apply(n,e.concat(a.call(arguments)))}},_.partial=function(t){var n=a.call(arguments,1);return function(){return t.apply(this,n.concat(a.call(arguments)))}},_.bindAll=function(t){var n=a.call(arguments,1);return 0===n.length&&(n=_.functions(t)),O(n,function(n){t[n]=_.bind(t[n],t)}),t},_.memoize=function(t,n){var e={};return n||(n=_.identity),function(){var i=n.apply(this,arguments);return _.has(e,i)?e[i]:e[i]=t.apply(this,arguments)}},_.delay=function(t,n){var e=a.call(arguments,2);return setTimeout(function(){return t.apply(null,e)},n)},_.defer=function(t){return _.delay.apply(_,[t,1].concat(a.call(arguments,1)))},_.throttle=function(t,n){var e,i,r,o,s=0,a=function(){s=new Date,r=null,o=t.apply(e,i)};return function(){var u=new Date,c=n-(u-s);return e=this,i=arguments,0>=c?(clearTimeout(r),r=null,s=u,o=t.apply(e,i)):r||(r=setTimeout(a,c)),o}},_.debounce=function(t,n,e){var i,r;return function(){var o=this,s=arguments,a=function(){i=null,e||(r=t.apply(o,s))},u=e&&!i;return clearTimeout(i),i=setTimeout(a,n),u&&(r=t.apply(o,s)),r}},_.once=function(t){var n,e=!1;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}},_.wrap=function(t,n){return function(){var e=[t];return s.apply(e,arguments),n.apply(this,e)}},_.compose=function(){var t=arguments;return function(){for(var n=arguments,e=t.length-1;e>=0;e--)n=[t[e].apply(this,n)];return n[0]}},_.after=function(t,n){return 0>=t?n():function(){return 1>--t?n.apply(this,arguments):void 0}},_.keys=x||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var n=[];for(var e in t)_.has(t,e)&&(n[n.length]=e);return n},_.values=function(t){var n=[];for(var e in t)_.has(t,e)&&n.push(t[e]);return n},_.pairs=function(t){var n=[];for(var e in t)_.has(t,e)&&n.push([e,t[e]]);return n},_.invert=function(t){var n={};for(var e in t)_.has(t,e)&&(n[t[e]]=e);return n},_.functions=_.methods=function(t){var n=[];for(var e in t)_.isFunction(t[e])&&n.push(e);return n.sort()},_.extend=function(t){return O(a.call(arguments,1),function(n){if(n)for(var e in n)t[e]=n[e]}),t},_.pick=function(t){var n={},e=u.apply(i,a.call(arguments,1));return O(e,function(e){e in t&&(n[e]=t[e])}),n},_.omit=function(t){var n={},e=u.apply(i,a.call(arguments,1));for(var r in t)_.contains(e,r)||(n[r]=t[r]);return n},_.defaults=function(t){return O(a.call(arguments,1),function(n){if(n)for(var e in n)null==t[e]&&(t[e]=n[e])}),t},_.clone=function(t){return _.isObject(t)?_.isArray(t)?t.slice():_.extend({},t):t},_.tap=function(t,n){return n(t),t};var M=function(t,n,e,i){if(t===n)return 0!==t||1/t==1/n;if(null==t||null==n)return t===n;t instanceof _&&(t=t._wrapped),n instanceof _&&(n=n._wrapped);var r=c.call(t);if(r!=c.call(n))return!1;switch(r){case"[object String]":return t==n+"";case"[object Number]":return t!=+t?n!=+n:0==t?1/t==1/n:t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object RegExp]":return t.source==n.source&&t.global==n.global&&t.multiline==n.multiline&&t.ignoreCase==n.ignoreCase}if("object"!=typeof t||"object"!=typeof n)return!1;for(var o=e.length;o--;)if(e[o]==t)return i[o]==n;e.push(t),i.push(n);var s=0,a=!0;if("[object Array]"==r){if(s=t.length,a=s==n.length)for(;s--&&(a=M(t[s],n[s],e,i)););}else{var u=t.constructor,l=n.constructor;if(u!==l&&!(_.isFunction(u)&&u instanceof u&&_.isFunction(l)&&l instanceof l))return!1;for(var f in t)if(_.has(t,f)&&(s++,!(a=_.has(n,f)&&M(t[f],n[f],e,i))))break;if(a){for(f in n)if(_.has(n,f)&&!s--)break;a=!s}}return e.pop(),i.pop(),a};_.isEqual=function(t,n){return M(t,n,[],[])},_.isEmpty=function(t){if(null==t)return!0;if(_.isArray(t)||_.isString(t))return 0===t.length;for(var n in t)if(_.has(t,n))return!1;return!0},_.isElement=function(t){return!(!t||1!==t.nodeType)},_.isArray=y||function(t){return"[object Array]"==c.call(t)},_.isObject=function(t){return t===Object(t)},O(["Arguments","Function","String","Number","Date","RegExp"],function(t){_["is"+t]=function(n){return c.call(n)=="[object "+t+"]"}}),_.isArguments(arguments)||(_.isArguments=function(t){return!(!t||!_.has(t,"callee"))}),"function"!=typeof/./&&(_.isFunction=function(t){return"function"==typeof t}),_.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},_.isNaN=function(t){return _.isNumber(t)&&t!=+t},_.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==c.call(t)},_.isNull=function(t){return null===t},_.isUndefined=function(t){return void 0===t},_.has=function(t,n){return l.call(t,n)},_.noConflict=function(){return t._=n,this},_.identity=function(t){return t},_.times=function(t,n,e){for(var i=Array(t),r=0;t>r;r++)i[r]=n.call(e,r);return i},_.random=function(t,n){return null==n&&(n=t,t=0),t+Math.floor(Math.random()*(n-t+1))};var P={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};P.unescape=_.invert(P.escape);var I={escape:RegExp("["+_.keys(P.escape).join("")+"]","g"),unescape:RegExp("("+_.keys(P.unescape).join("|")+")","g")};_.each(["escape","unescape"],function(t){_[t]=function(n){return null==n?"":(""+n).replace(I[t],function(n){return P[t][n]})}}),_.result=function(t,n){if(null==t)return null;var e=t[n];return _.isFunction(e)?e.call(t):e},_.mixin=function(t){O(_.functions(t),function(n){var e=_[n]=t[n];_.prototype[n]=function(){var t=[this._wrapped];return s.apply(t,arguments),F.call(this,e.apply(_,t))}})};var T=0;_.uniqueId=function(t){var n=++T+"";return t?t+n:n},_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var S=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},N=/\\|'|\r|\n|\t|\u2028|\u2029/g;_.template=function(t,n,e){var i;e=_.defaults({},e,_.templateSettings);var r=RegExp([(e.escape||S).source,(e.interpolate||S).source,(e.evaluate||S).source].join("|")+"|$","g"),o=0,s="__p+='";t.replace(r,function(n,e,i,r,a){return s+=t.slice(o,a).replace(N,function(t){return"\\"+R[t]}),e&&(s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'"),i&&(s+="'+\n((__t=("+i+"))==null?'':__t)+\n'"),r&&(s+="';\n"+r+"\n__p+='"),o=a+n.length,n}),s+="';\n",e.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{i=Function(e.variable||"obj","_",s)}catch(a){throw a.source=s,a}if(n)return i(n,_);var u=function(t){return i.call(this,t,_)};return u.source="function("+(e.variable||"obj")+"){\n"+s+"}",u},_.chain=function(t){return _(t).chain()};var F=function(t){return this._chain?_(t).chain():t
  };_.mixin(_),O(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var n=i[t];_.prototype[t]=function(){var e=this._wrapped;return n.apply(e,arguments),"shift"!=t&&"splice"!=t||0!==e.length||delete e[0],F.call(this,e)}}),O(["concat","join","slice"],function(t){var n=i[t];_.prototype[t]=function(){return F.call(this,n.apply(this._wrapped,arguments))}}),_.extend(_.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),i("underscore",[],function(){}),i("ventus/wm/modes/expose",["underscore"],function(t){"use strict";var n={register:function(){var n=this;console.log("Expose mode registered."),this.el.on("contextmenu",t.throttle(function(){return"expose"!==n.mode?n.mode="expose":"expose"===n.mode&&(n.mode="default"),!1},1e3))},plug:function(){var t,n,e,i,r=Math.floor,o=Math.ceil,s=this,a=o(this.windows.length/2),u=r(this.el.width()/a),c=r(this.el.height()/2);this.el.addClass("expose");for(var l,f=0,h=this.windows.length;h>f;f++)l=this.windows[f],l.stamp(),t=l.height>l.width?l.height>c?c/l.height:1:l.width>u?u/l.width:1,t-=.15,i={x:f%a*u,y:(a>f?0:1)*c},n=i.x+r((u-t*l.width)/2),e=i.y+r((c-t*l.height)/2),l.enabled=!1,l.movable=!1,l.el.addClass("exposing"),l.el.css("transform-origin","0 0"),l.el.css("transform","scale("+t+")"),l.el.css("top",e),l.el.css("left",n),l.el.onTransitionEnd(function(){l.el.removeClass("exposing")},this);this.overlay=!0,this.el.one("click",function(){s.mode="default"})},unplug:function(){for(var t,n=this.windows.length;n--;){t=this.windows[n],t.restore(),t.el.css("transform","scale(1)"),t.el.css("transform-origin","50% 50%");var e=function(t){return function(){this.el.removeClass("expose"),t.el.css("transform","")}}(t);this.el.onTransitionEnd(e,this),t.movable=!0,t.enabled=!0}this.overlay=!1},actions:{focus:function(){},close:function(){this.mode="expose"},select:function(t){this.mode="default",t.focus()}}};return n}),i("ventus/wm/modes/fullscreen",[],function(){"use strict";var t={register:function(){console.log("Fullscreen mode registered.")},plug:function(){this.el.addClass("fullscreen");for(var t,n=0,e=this.windows.length;e>n;n++)t=this.windows[n],t.move(0,0),t.el.css("-webkit-transform","translate3d(0, 0, 0);"),t.resize(this.el.width(),this.el.height())},unplug:function(){for(var t,n=this.windows.length;n--;){t=this.windows[n],t.restore(),t.el.css("transform","scale(1)"),t.el.css("transform-origin","50% 50%");var e=function(t){return function(){this.el.removeClass("fullscreen"),t.el.css("transform","")}}(t);this.el.onTransitionEnd(e,this),t.movable=!0,t.resizable=!0,t.enabled=!0}this.overlay=!1},actions:{focus:function(){},close:function(){this.mode="expose"},select:function(t){this.mode="default",t.focus()}}};return t}),i("ventus/wm/windowmanager",["$","ventus/wm/window","ventus/core/view","ventus/wm/modes/default","ventus/wm/modes/expose","ventus/wm/modes/fullscreen"],function(t,n,e,i,r,o){"use strict";var s=function(){this.el=e('<div class="wm-space"><div class="wm-overlay" /></div>'),t(document.body).prepend(this.el),this.$overlay=this.el.find(".wm-overlay"),this.$overlay.css("z-index",this._baseZ-1),this.actions.forEach(function(t){this[t]=function(t){return function(){this.currentMode.actions[t]&&this.currentMode.actions[t].apply(this,arguments)}}.call(this,t)},this);for(var n in this.modes)this.modes.hasOwnProperty(n)&&this.modes[n].register&&this.modes[n].register.apply(this);this.windows=[],this.active=null,this.mode="default",this.createWindow.fromQuery=this.createWindow.fromQuery.bind(this),this.createWindow.fromElement=this.createWindow.fromElement.bind(this)};return s.prototype={actions:["focus","blur","close","maximize","minimize","restore","select"],modes:{"default":i,expose:r,fullscreen:o},set mode(t){var n=this.modes[t];n&&this._mode!==t&&(this._mode&&this.currentMode.unplug&&this.currentMode.unplug.apply(this),n.plug&&n.plug.apply(this),this._mode=t)},get mode(){return this._mode},get currentMode(){return this.modes[this._mode]},set overlay(t){this.$overlay.css("opacity",t?.8:0),this._overlay=t},get overlay(){return this._overlay},createWindow:function(t){var e=new n(t);return this.mode="default",e.signals.on("focus",this._focus,this),e.signals.on("blur",this._blur,this),e.signals.on("close",this._close,this),this.actions.forEach(function(t){e.signals.on(t,this[t],this)},this),this.windows.push(e),e.space=this.el,e.focus(),e},_focus:function(t){var n,e,i=1e4,r=i+1e4;if(!this.active||this.active!==t){if(this.active?(n=this.active.z,this.active.blur()):n=i,e=this.windows.indexOf(t),this.windows.splice(e,1),this.windows.push(t),t.z=n+1,n>r+this.windows.length)for(var o,s=this.windows.length;s--;)o=this.windows[s].z,this.windows[s].z=i+(o-r);this.active=t}},_blur:function(t){this.active===t&&(this.active=null)},_close:function(t){var n,e=this.windows.indexOf(t);return-1===e?void console.log("Trying to close a window that doesn't exist in this window manager"):(this.windows.splice(e,1),n=this.windows.length,void(this.active&&this.active===t&&(this.active=0!==n?this.windows[n-1]:null,this.active&&this.active.focus())))}},s.prototype.createWindow.fromQuery=function(t,n){return n.content=e(t),this.createWindow(n)},s.prototype.createWindow.fromElement=function(t,n){return n.content=e(t),this.createWindow(n)},s}),i("ventus",["require","exports","module","ventus/wm/windowmanager","ventus/wm/window"],function(t){"use strict";return{version:"0.2",browser:{animationEventName:function(){var t=document.body.style,n=null;return""===t.animation?n="animationend":""===t.MozAnimation?n="mozAnimationEnd":""===t.webkitAnimation&&(n="webkitAnimationEnd"),n}},WindowManager:t("ventus/wm/windowmanager"),Window:t("ventus/wm/window")}}),i("src/main",["almond","handlebars","ventus"],function(){}),i("$",function(){return t}),i("underscore",function(){return _}),e("ventus")});