/*! kawapp 0.1.3 */
function kawapp(){return this instanceof kawapp?void 0:new kawapp}!function(a){"undefined"!=typeof module&&"undefined"!=typeof module.exports&&(module.exports=a),a.request=Object,a.prototype.END=a.END={end:!0},a.prototype.SKIP=a.SKIP={skip:!0},a.prototype.length=0,a.prototype.use=function(){for(var a=0;a<arguments.length;a++)this[this.length++]=arguments[a];return this},a.prototype.useif=function(b){function c(c,d,e){var f=b(c);e(f instanceof Error?f:f?null:a.SKIP)}function d(b,c,d){d(a.END)}var e=Array.prototype.slice.call(arguments,1),f=a();return f.use(c),f.use.apply(f,e),f.use(d),this.use(f)},a.prototype.mount=function(b){function c(a){var c=a.location.pathname;if(c)return b instanceof RegExp?b.test(c):0===c.search(b)}var d=Array.prototype.slice.call(arguments,1);return this.mounts||(this.use(a.mw.location()),this.mounts=0),this.mounts++,d.unshift(c),this.useif.apply(this,d)},a.prototype.start=function(b,c,d){function e(b){b===a.END&&(b=null),d&&d(b,c)}1==arguments.length&&"function"==typeof b?(d=b,b=null):2==arguments.length&&"function"==typeof c&&(d=c,c=null),b||(b=this.context||a.request()),c||(c=this.canvas||a.response());var f=Array.prototype.slice.call(this),g=a.mw.merge.apply(null,f);return g(b,c,e),this}}(kawapp),function(a){var b=a.util||(a.util={});a.prototype.util=b,b.parseParam=function(a){for(var b=a.split(/[&;]/),c={},d=0;d<b.length;d++){var e=b[d];if(e.length){var f,g,h=e.indexOf("=");h>-1?(f=e.substring(0,h),g=e.substring(h+1)):f=g=e,f=f.replace(/\+/g," "),g=g.replace(/\+/g," "),f=decodeURIComponent(f),g=decodeURIComponent(g),c[f]=g}}return c}}(kawapp),function(a){var b=a.mw||(a.mw={});a.prototype.mw=b,b.merge=function(b){function c(c,e,f){function g(i){if(i||h>=d.length)return i===a.SKIP&&(i=null),void f(i);if(b=d[h++],b instanceof a){var j=Array.prototype.slice.call(b);b=a.mw.merge.apply(null,j)}b(c,e,g)}var h=0;g()}var d=arguments;return c},b.location=function(a){function b(b,c,d){b.location||(b.location="undefined"!=typeof location?location:a||{}),d()}return b},b.parseQuery=function(b,c){function d(b,c,d){return b.locationSearch?d():void a.mw.location()(b,c,function(a){return a?d(a):e(b,c,d)})}function e(d,e,f){b&&!d[b]&&(d[b]={});var g=b?d[b]:d,h=d.location.search||c;if(h&&h.length>1){var i=d.locationSearch=a.util.parseParam(h.substr(1));for(var j in i)g[j]=i[j]}f()}return d},b.parseHash=function(b,c){function d(b,c,d){return b.locationHash?d():void a.mw.location()(b,c,function(a){return a?d(a):e(b,c,d)})}function e(d,e,f){b&&!d[b]&&(d[b]={});var g=b?d[b]:d,h=d.location.hash||c;if(h&&h.search(/^#!.*\?/)>-1){var i=d.locationHash=a.util.parseParam(h.replace(/^#!.*\?/,""));for(var j in i)g[j]=i[j]}f()}return d}}(kawapp),function(a){function b(){return this instanceof b?void(this[0]=[]):new b}a.response=b,b.prototype.length=1,b.prototype.empty=function(){return this[0].length=0,this},b.prototype.append=function(){var a=Array.prototype.slice.call(arguments),b=this[0];return a.forEach(function(a){b.push(a)}),this},b.prototype.html=function(a){if(arguments.length)return this.empty().append(a),this;var b=this[0].map(function(a){if("object"==typeof a){if(a.cheerio)return a;if(a.jquery){var b=a.constructor,c=new b("<div/>");a=a.first(),a.parent().length&&(a=a.clone());var d=c.append(a).html();return d}if(a.hasOwnProperty("outerHTML"))return a.outerHTML}return a});return b.join("")}}(kawapp);