New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

absurd

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

absurd - npm Package Compare versions

Comparing version 0.2.87 to 0.2.88

client-side/lib/03.injected/01.injected.start.js

248

client-side/build/absurd.js

@@ -1,2 +0,2 @@

/* version: 0.2.87, born: 17-1-2014 15:24 */
/* version: 0.2.88, born: 18-1-2014 15:43 */
var Absurd = (function(w) {

@@ -136,2 +136,85 @@ var lib = {

}
var qs = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelector(selector);
};
var qsa = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelectorAll(selector);
};
var getStyle = function(styleProp, el) {
el = el || this.el;
if(el && el.currentStyle) {
return el.currentStyle[styleProp];
} else if (window.getComputedStyle) {
return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
}
return null;
};
var addClass = function(className, el) {
el = el || this.el;
if(el.classList) {
el.classList.add(className);
} else {
var current = el.className;
if(current.indexOf(className) < 0) {
if(current == '') el.className = className;
else el.className += ' ' + className;
}
}
return this;
};
var removeClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.remove(className);
} else {
var current = el.className.split(' ');
var newClasses = [];
for(var i=0; i<current.length; i++) {
if(current[i] != className) newClasses.push(current[i]);
}
el.className = newClasses.join(' ');
}
return this;
}
var replaceClass = function(classNameA, classNameB, el) {
el = el || this.el;
var current = el.className.split(' '), found = false;
for(var i=0; i<current.length; i++) {
if(current[i] == classNameA) {
found = true;
current[i] = classNameB;
}
}
if(!found) {
return addClass(classNameB, el);
}
el.className = current.join(' ');
return this;
}
var toggleClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.toggle(className);
} else {
var classes = el.className.split(' ');
var existingIndex = -1;
for (var i = classes.length; i--;) {
if (classes[i] === className)
existingIndex = i;
}
if(existingIndex >= 0)
classes.splice(existingIndex, 1);
else
classes.push(className);
el.className = classes.join(' ');
}
return this;
}
var Component = function(componentName, absurd, eventBus, cls) {

@@ -211,3 +294,15 @@ var api = lib.helpers.Extend({

return this;
}
};
api.applyCSS = function(data, skipAutoPopulation) {
if(this.html && typeof this.html === 'string') {
var res = {};
res[this.html] = data;
data = res;
}
this.css = data;
if(!skipAutoPopulation) {
this.populate();
}
return this;
};
var HTMLSource = false;

@@ -300,2 +395,9 @@

};
api.applyHTML = function(data, skipAutoPopulation) {
this.html = data;
if(!skipAutoPopulation) {
this.populate();
}
return this;
};
var appended = false

@@ -361,2 +463,6 @@ api.__append = function(next) {

api.onAnimationEnd = function(el, func) {
if(arguments.length == 1) {
func = el;
el = this.el;
}
var self = this;

@@ -370,2 +476,6 @@ var eventName = api.__getAnimAndTransEndEventName(el);

api.onTransitionEnd = function(el, func) {
if(arguments.length == 1) {
func = el;
el = this.el;
}
var self = this;

@@ -474,101 +584,19 @@ var eventName = api.__getAnimAndTransEndEventName(el);

};
api.qs = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelector(selector);
};
api.qsa = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelectorAll(selector);
};
api.getStyle = function(styleProp, el) {
el = el || this.el;
if(el && el.currentStyle) {
return el.currentStyle[styleProp];
} else if (window.getComputedStyle) {
return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
}
return null;
};
api.addClass = function(className, el) {
el = el || this.el;
if(el.classList) {
el.classList.add(className);
} else {
var current = el.className;
if(current.indexOf(className) < 0) {
if(current == '') el.className = className;
else el.className += ' ' + className;
}
}
api.qs = qs;
api.qsa = qsa;
api.getStyle = getStyle;
api.addClass = addClass;
api.removeClass = removeClass;
api.replaceClass = replaceClass;
api.toggleClass = toggleClass;
return api;
};
api.removeClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.remove(className);
} else {
var current = el.className.split(' ');
var newClasses = [];
for(var i=0; i<current.length; i++) {
if(current[i] != className) newClasses.push(current[i]);
}
el.className = newClasses.join(' ');
var injecting = function(absurd) {
absurd.di.register('is', {
appended: function(selector) {
if(typeof selector == 'undefined') selector = this.host.html;
return qs(selector) ? true : false;
}
return api;
});
}
api.replaceClass = function(classNameA, classNameB, el) {
el = el || this.el;
var current = el.className.split(' '), found = false;
for(var i=0; i<current.length; i++) {
if(current[i] == classNameA) {
found = true;
current[i] = classNameB;
}
}
if(!found) {
return api.addClass(classNameB, el);
}
el.className = current.join(' ');
return api;
}
api.toggleClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.toggle(className);
} else {
var classes = el.className.split(' ');
var existingIndex = -1;
for (var i = classes.length; i--;) {
if (classes[i] === className)
existingIndex = i;
}
if(existingIndex >= 0)
classes.splice(existingIndex, 1);
else
classes.push(className);
el.className = classes.join(' ');
}
return api;
}
api.verify = function(selector, ok, fail) {
var test = function() {
var res = this.qs(selector) ? true : false;
if(res && ok) ok.apply(this);
else if(fail) fail.apply(this);
}
if(typeof selector == 'string') {
test.apply(this);
} else if(typeof selector == 'function') {
fail = ok;
ok = selector;
selector = this.html;
test.apply(this);
}
}
return api;
};
var client = function() {

@@ -657,10 +685,7 @@ return function(arg) {

(function(fn) {
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', fn);
} else if(document.attachEvent) {
document.attachEvent('onreadystatechange', function() {
if (document.readyState === 'interactive') {
fn();
}
});
if(!window) return;
if (window.addEventListener) {
window.addEventListener('load', fn);
} else if(window.attachEvent) {
window.attachEvent('onload', fn);
}

@@ -726,2 +751,3 @@ })(function() {

_api.di = lib.DI(_api);
injecting(_api);

@@ -808,3 +834,13 @@ /******************************************* Copied directly from /lib/API.js */

var d = deps[i];
args.push(self.dependencies[d] && d != '' ? self.dependencies[d] : a.shift());
if(typeof self.dependencies[d] != 'undefined') {
var diModule = self.dependencies[d];
if(typeof diModule == 'function') {
diModule.prototype.host = scope;
} else if(typeof diModule == 'object') {
diModule.host = scope;
}
args.push(diModule);
} else {
args.push(a.shift())
}
}

@@ -811,0 +847,0 @@ return func.apply(scope, args);

@@ -1,1 +0,1 @@

var Absurd=function(){var b={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}},html:{plugins:{},helpers:{}},component:{plugins:{}}}},d=function(a){return a.indexOf("css/CSS.js")>0||"/../CSS.js"==a?b.processors.css.CSS:a.indexOf("html/HTML.js")>0?b.processors.html.HTML:a.indexOf("component/Component.js")>0?b.processors.component.Component:"js-beautify"==a?{html:function(a){return a}}:"./helpers/PropAnalyzer"==a?b.processors.html.helpers.PropAnalyzer:"../../helpers/TransformUppercase"==a?b.helpers.TransformUppercase:"./helpers/TemplateEngine"==a?b.processors.html.helpers.TemplateEngine:"../helpers/Extend"==a?b.helpers.Extend:"../helpers/Clone"==a?b.helpers.Clone:"../helpers/Prefixes"==a||"/../../../helpers/Prefixes"==a?b.helpers.Prefixes:a==e+"/../../../../"?Absurd:function(){}},e="",f=function(a,b){!function c(){a.length>0&&a.shift().apply(b||{},[c].concat(Array.prototype.slice.call(arguments,0)))}()},g=function(a,b){var c;try{c=(b||document).querySelectorAll(a)}catch(d){c=document.querySelectorAll(a)}return c},h=function(a){var b={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[1,"<div>","</div>"]};b.optgroup=b.option,b.tbody=b.tfoot=b.colgroup=b.caption=b.thead,b.th=b.td;var c=document.createElement("div"),d=/<\s*\w.*?>/g.exec(a);if(null!=d){var c,e=d[0].replace(/</g,"").replace(/>/g,""),f=b[e]||b._default;a=f[1]+a+f[2],c.innerHTML=a;for(var g=f[0]+1;g--;)c=c.lastChild}else c.innerHTML=a,c=c.lastChild;return c},i=function(a,b,c){return a.addEventListener?(a.addEventListener(b,c,!1),!0):a.attachEvent?a.attachEvent("on"+b,c):void 0},j=function(a){for(var b,c=a.childNodes,d=c.length,e=0,f=/^\s*$/;d>e;e++)b=c[e],3==b.nodeType&&f.test(b.nodeValue)&&(a.removeChild(b),e--,d--);return a},k=function(b,c,d){for(var e=document.createElement(b),f=0;f<c.length,a=c[f];f++)e.setAttribute(a.name,a.value);return e.innerHTML=d,e},l=function(a,c,d,e){var l=b.helpers.Extend({__name:a},e),m=b.helpers.Extend,n=[];l.listeners=n,l.on=function(a,b,c){return n[a]||(n[a]=[]),n[a].push({callback:b,scope:c}),this},l.off=function(a,b){return n[a]?(b||(n[a]=[]),this):this},l.dispatch=function(a,b,c){if(!b||"object"!=typeof b||b instanceof Array||(b.target=this),n[a])for(var e=0;e<n[a].length;e++){var f=n[a][e].callback;f.apply(c||n[a][e].scope||{},[b])}return this[a]&&"function"==typeof this[a]&&this[a](b),d&&d.dispatch(a,b),this};var o={};l.set=function(a,b){return o[a]=b,this},l.get=function(a){return o[a]};var p=!1;l.__handleCSS=function(b){return this.css?c.flush().add(this.css).compile(function(c,d){if(p)p.raw!==d&&(p.raw=d,p.element.innerHTML=d);else{var e=k("style",[{name:"id",value:a+"-css"},{name:"type",value:"text/css"}],d);(g("head")||g("body"))[0].appendChild(e),p={raw:d,element:e}}b()}):b(),this};var q=!1;l.__mergeDOMElements=function(a,b){if(j(a),j(b),"undefined"!=typeof a&&"undefined"!=typeof b&&!a.isEqualNode(b)){if(a.nodeName!==b.nodeName)return a.parentNode&&a.parentNode.replaceChild(b,a),void 0;if(a.nodeValue!==b.nodeValue&&(a.nodeValue=b.nodeValue),a.attributes){for(var c,d,e=a.attributes,f=b.attributes,g={},h=0;h<e.length,c=e[h];h++){for(var i=0;i<f.length,d=f[i];i++)c.name===d.name&&(a.setAttribute(c.name,d.value),g[c.name]=!0);g[c.name]||a.removeAttribute(c.name)}for(var h=0;h<f.length,d=f[h];h++)g[d.name]||a.setAttribute(d.name,d.value)}var k=[];if(a.childNodes.length>=b.childNodes.length)for(var h=0;h<a.childNodes.length;h++)b.childNodes[h]||b.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);else for(var h=0;h<b.childNodes.length;h++)a.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);for(var h=0;h<k.length;h++)l.__mergeDOMElements(k[h][0],k[h][1])}},l.__handleHTML=function(a){var b=this,d=function(){c.flush().morph("html").add(q).compile(function(c,d){b.el?l.__mergeDOMElements(b.el,h(d)):b.el=h(d),a()},b)};if(this.html)if("string"==typeof this.html){if(!this.el){var e=g(this.html);e.length>0&&(this.el=e[0],q={"":this.el.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">")})}d()}else"object"==typeof this.html?(q=m({},this.html),d()):a();else a();return this};var r=!1;l.__append=function(a){return!r&&this.el&&this.get("parent")&&(r=!0,this.get("parent").appendChild(this.el)),a(),this};var s={events:{}};l.__handleEvents=function(a){if(this.el){var b=this,c=function(a){var c=a.getAttribute("data-absurd-event");if(c=c.split(":"),c.length>=2){var d=c[0],e=c[1];c.splice(0,2);var f=c;(!s.events[d]||s.events[d].indexOf(a)<0)&&(s.events[d]||(s.events[d]=[]),s.events[d].push(a),i(a,d,function(a){if("function"==typeof b[e]){var c=b[e];c.apply(b,[a].concat(f))}}))}};this.el.hasAttribute&&this.el.hasAttribute("data-absurd-event")&&c(this.el);for(var d=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-event]"):[],e=0;e<d.length;e++)c(d[e])}return a(),this},l.__getAnimAndTransEndEventName=function(a){if(a){var b,c={animation:["animationend","transitionend"],OAnimation:["oAnimationEnd","oTransitionEnd"],MozAnimation:["animationend","transitionend"],WebkitAnimation:["webkitAnimationEnd","webkitTransitionEnd"]};for(b in c)if(void 0!==a.style[b])return c[b]}},l.onAnimationEnd=function(a,b){var c=this,d=l.__getAnimAndTransEndEventName(a);return d?(this.addEventListener(a,d[0],function(a){b.apply(c,[a])}),void 0):(b.apply(this,[{error:"Animations not supported."}]),void 0)},l.onTransitionEnd=function(a,b){var c=this,d=l.__getAnimAndTransEndEventName(a);return d?(this.addEventListener(a,d[1],function(a){b.apply(c,[a])}),void 0):(b.apply(this,[{error:"Animations not supported."}]),void 0)};var t={funcs:{},index:0};return l.__handleAsyncFunctions=function(a){if(this.el){var b=[];if(this.el.hasAttribute&&this.el.hasAttribute("data-absurd-async"))b.push(this.el);else for(var c=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-async]"):[],d=0;d<c.length;d++)b.push(c[d]);if(0===b.length)a();else{var e=this;!function f(){if(0===b.length)a();else{var c=b.shift(),d=c.getAttribute("data-absurd-async"),g=function(a){"string"==typeof a?c.parentNode.replaceChild(h(a),c):c.parentNode.replaceChild(a,c),f()};"function"==typeof e[t.funcs[d].name]?e[t.funcs[d].name].apply(e,[g].concat(t.funcs[d].args)):"function"==typeof t.funcs[d].func&&t.funcs[d].func.apply(e,[g].concat(t.funcs[d].args))}}()}}else a();return this},l.async=function(){var a=Array.prototype.slice.call(arguments,0),b=a.shift(),c="_"+t.index++;return t.funcs[c]={args:a,name:b},'<script data-absurd-async="'+c+'"></script>'},l.child=function(){var a=Array.prototype.slice.call(arguments,0),b=this.get("children"),c=b&&b[a.shift()],d="_"+t.index++;return t.funcs[d]={args:a,func:function(a){c.populate({callback:function(b){a(b.html.element)}})}},'<script data-absurd-async="'+d+'"></script>'},l.wire=function(a){return c.components.events.on(a,this[a]||function(){},this),this},l.populate=function(a){return f([l.__handleCSS,l.__handleHTML,l.__append,l.__handleEvents,l.__handleAsyncFunctions,function(){t={funcs:{},index:0};var b={css:p,html:{element:this.el}};this.dispatch("populated",b),a&&"function"==typeof a.callback&&a.callback(b)}],this),this},l.str2DOMElement=h,l.addEventListener=i,l.queue=f,l.compileHTML=function(a,b,d){c.flush().morph("html").add(a).compile(b,d)},l.compileCSS=function(a,b,d){c.flush().add(a).compile(b,d)},l.qs=function(a,b){return b=b===!1?document:b||this.el||document,b.querySelector(a)},l.qsa=function(a,b){return b=b===!1?document:b||this.el||document,b.querySelectorAll(a)},l.getStyle=function(a,b){return b=b||this.el,b&&b.currentStyle?b.currentStyle[a]:window.getComputedStyle?document.defaultView.getComputedStyle(b,null).getPropertyValue(a):null},l.addClass=function(a,b){if(b=b||this.el,b.classList)b.classList.add(a);else{var c=b.className;c.indexOf(a)<0&&(""==c?b.className=a:b.className+=" "+a)}return l},l.removeClass=function(a,b){if(b=b||this.el,b.classList)b.classList.remove(a);else{for(var c=b.className.split(" "),d=[],e=0;e<c.length;e++)c[e]!=a&&d.push(c[e]);b.className=d.join(" ")}return l},l.replaceClass=function(a,b,c){c=c||this.el;for(var d=c.className.split(" "),e=!1,f=0;f<d.length;f++)d[f]==a&&(e=!0,d[f]=b);return e?(c.className=d.join(" "),l):l.addClass(b,c)},l.toggleClass=function(a,b){if(b=b||this.el,b.classList)b.classList.toggle(a);else{for(var c=b.className.split(" "),d=-1,e=c.length;e--;)c[e]===a&&(d=e);d>=0?c.splice(d,1):c.push(a),b.className=c.join(" ")}return l},l.verify=function(a,b,c){var d=function(){var d=this.qs(a)?!0:!1;d&&b?b.apply(this):c&&c.apply(this)};"string"==typeof a?d.apply(this):"function"==typeof a&&(c=b,b=a,a=this.html,d.apply(this))},l},m=function(){return function(a){var d=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={defaultProcessor:b.processors.css.CSS()},f={},g={},h={},i={};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return h},e.getStorage=function(){return g},e.flush=function(){return f={},g=[],i={},e.defaultProcessor=b.processors.css.CSS(),e},e.import=function(){return e.callHooks("import",arguments)?e:e},e.addHook=function(a,b){i[a]||(i[a]=[]);for(var d=!1,e=0;c=i[a][e];e++)c===b&&(d=!0);d===!1?i[a].push(b):null},e.callHooks=function(a,b){if(i[a])for(var d=0;c=i[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.components=function(a){var c=b.helpers.Extend,d=b.helpers.Clone,e={},f=[],g=c({},l()),h={};return function(a){document.addEventListener?document.addEventListener("DOMContentLoaded",a):document.attachEvent&&document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&a()})}(function(){h.broadcast("ready")}),h={events:g,register:function(b,h){return e[b]=function(){var e=c({},l(b,a,g,d(h)));return a.di.resolveObject(e),f.push(e),"function"==typeof e.constructor&&e.constructor.apply(e,Array.prototype.slice.call(arguments,0)),e}},get:function(a){if(e[a])return e[a];throw new Error("There is no component with name '"+a+"'.")},remove:function(a){return e[a]?(delete e[a],!0):!1},list:function(){var a=[];for(var b in e)a.push(b);return a},flush:function(){return e={},f=[],this},broadcast:function(a,b){for(var c=0;c<f.length,instance=f[c];c++)"function"==typeof instance[a]&&instance[a](b);return this}}}(e),e.component=function(a){return function(b,c){return"undefined"==typeof c?a.components.get(b):a.components.register(b,c)}}(e),e.di=b.DI(e),e.compile=function(a,b){if(e.callHooks("compile",arguments))return e;var c={combineSelectors:!0,minify:!1,processor:e.defaultProcessor,keepCamelCase:!1,api:e};b=d(c,b||{}),b.processor(e.getRules(),a||function(){},b),e.flush()};for(var j in b.api)"compile"!==j&&(e[j]=b.api[j](e),e[j]=function(a){return function(){var c=b.api[a](e);return e.callHooks(a,arguments)?e:c.apply(e,arguments)}}(j));for(var k in b.processors.css.plugins)e.plugin(k,b.processors.css.plugins[k]());return"function"==typeof a&&a(e),"undefined"!=typeof Organic&&Organic.init(e),e}};b.DI=function(){var a={dependencies:{},register:function(a,b){return this.dependencies[a]=b,this},resolve:function(){var a,b,c,d=this,e=!1;"string"==typeof arguments[0]?(a=arguments[1],b=arguments[0].replace(/ /g,"").split(","),c=arguments[2]||{}):(a=arguments[0],b=a.toString().match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].replace(/ /g,"").split(","),c=arguments[1]||{});for(var f=0;f<b.length;f++)"undefined"!=typeof this.dependencies[b[f]]&&(e=!0);return e?function(){for(var e=[],f=Array.prototype.slice.call(arguments,0),g=0;g<b.length;g++){var h=b[g];e.push(d.dependencies[h]&&""!=h?d.dependencies[h]:f.shift())}return a.apply(c,e)}:a},resolveObject:function(a){if("object"==typeof a)for(var b in a)"function"==typeof a[b]?a[b]=this.resolve(a[b],a):a[b]instanceof Array&&2==a[b].length&&"string"==typeof a[b][0]&&"function"==typeof a[b][1]&&(a[b]=this.resolve(a[b][0],a[b][1],a));return this},flush:function(){return this.dependencies={},this}};return a},b.api.add=function(a){var b=(d("../helpers/Extend"),d("../helpers/Prefixes")),c=[],e={combineSelectors:!0},f=function(c,d,e,f,h){var i=b.nonPrefixProp(d),j=a.getPlugins()[i.prop];if("undefined"!=typeof j){var k=j(a,e,i.prefix);return k&&g(c,k,f,h),!0}return!1},g=function(a,d,h,i){if(h=h||"mainstream",null!==d&&"undefined"!=typeof d&&d!==!1)if(i||a||(a=""),/, ?/g.test(a)&&e.combineSelectors)for(var j=a.replace(/, /g,",").split(","),k=0;k<j.length,p=j[k];k++)g(p,d,h,i);else if(!f(null,a,d,h,i))if("undefined"==typeof d.length||"object"!=typeof d){var l={},m=a,n={},o={};for(var q in d){var r=typeof d[q];"object"!==r&&"function"!==r&&d[q]!==!1?f(a,q,d[q],h,i)===!1&&(m=0===m.indexOf("^")?m.substr(1,m.length-1)+("undefined"!=typeof i?" "+i:""):"undefined"!=typeof i?i+" "+a:a,l[q]=d[q],b.addPrefixes(q,l)):"object"===r?n[q]=d[q]:"function"===r&&(o[q]=d[q])}c.push({selector:m,props:l,stylesheet:h});for(var q in n)if(":"===q.charAt(0))g(a+q,n[q],h,i);else if(/&/g.test(q))if(/, ?/g.test(q)&&e.combineSelectors)for(var j=q.replace(/, /g,",").split(","),k=0;k<j.length,p=j[k];k++)p.indexOf("&")>=0?g(p.replace(/&/g,a),n[q],h,i):g(p,n[q],h,"undefined"!=typeof i?i+" "+a:a);else g(q.replace(/&/g,a),n[q],h,i);else 0===q.indexOf("@media")||0===q.indexOf("@supports")?g(a,n[q],q,i):0===a.indexOf("@media")||0===q.indexOf("@supports")?g(q,n[q],a,i):0===a.indexOf("^")?g(a.substr(1,a.length-1)+("undefined"!=typeof i?" "+i:"")+" "+q,n[q],h):f(a,q,n[q],h,i)===!1&&g(q,n[q],h,(i?i+" ":"")+a);for(var q in o){var s={};s[q]=o[q](),g(a,s,h,i)}}else for(var k=0;k<d.length,q=d[k];k++)g(a,q,h,i)},h=function(b,d,f){c=[],a.numOfAddedRules+=1,"object"==typeof d&&"undefined"==typeof f&&(e=d,d=null),"undefined"!=typeof f&&(e=f);var h=a.defaultProcessor.type;for(var i in b)g(i,b[i],d||"mainstream");for(var j=0;j<c.length;j++){var d=c[j].stylesheet,i=c[j].selector,k=c[j].props,l=a.getRules(d),m=l[i]||{};for(var n in k){var o=k[n];"object"!=typeof o&&(m[n]="css"==h?"+"===o.toString().charAt(0)?m&&m[n]?m[n]+", "+o.substr(1,o.length-1):o.substr(1,o.length-1):">"===o.toString().charAt(0)?m&&m[n]?m[n]+" "+o.substr(1,o.length-1):o.substr(1,o.length-1):o:o)}l[i]=m}return a};return h};var n=d("../helpers/Extend");b.api.compile=function(a){return function(){for(var b=null,c=null,d=null,e=0;e<arguments.length;e++)switch(typeof arguments[e]){case"function":c=arguments[e];break;case"string":b=arguments[e];break;case"object":d=arguments[e]}var f={combineSelectors:!0,minify:!1,keepCamelCase:!1,processor:a.defaultProcessor,api:a};d=n(f,d||{}),d.processor(a.getRules(),function(d,e){if(null!=b)try{s.writeFile(b,e,function(a){c(a,e)})}catch(d){c.apply({},arguments)}else c.apply({},arguments);a.flush()},d)}},b.api.compileFile=function(a){return a.compile};var q=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.darken=function(){return function(a,b){return q(a,-(b/100))}},b.api.define=function(a){return function(b,c){return a.getStorage().__defined||(a.getStorage().__defined={}),a.getStorage().__defined[b]=c,a}},b.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}};var q=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.lighten=function(){return function(a,b){return q(a,b/100)}};var r={html:function(a){a.defaultProcessor=d(e+"/../processors/html/HTML.js")(),a.hook("add",function(b,c){return a.getRules(c||"mainstream").push(b),!0})},component:function(a){a.defaultProcessor=d(e+"/../processors/component/Component.js")(),a.hook("add",function(b){b instanceof Array||(b=[b]);for(var d=0;d<b.length,c=b[d];d++)a.getRules("mainstream").push(c);return!0})}};b.api.morph=function(a){return function(b){return r[b]&&(a.flush(),r[b](a)),a}},b.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},b.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}};{var s=d("fs");d("path")}b.api.rawImport=function(a){var b=function(b){var c=s.readFileSync(b,{encoding:"utf8"});a.raw(c)};return function(c){var d,e,f;if("string"==typeof c)b(c);else for(e=0,f=c.length;f>e;e++)d=c[e],b(d);return a}},b.api.register=function(a){return function(b,c){return a[b]=c,a}},b.api.storage=function(a){var b=a.getStorage(),c=function(d,e){if("undefined"!=typeof e)b[d]=e;else{if("object"!=typeof d){if(b[d])return b[d];throw new Error("There is no data in the storage associated with '"+d+"'")}for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&c(f,d[f])}return a};return c},b.helpers.Clone=function M(a){if(!a)return a;var b,c=[Number,String,Boolean];if(c.forEach(function(c){a instanceof c&&(b=c(a))}),"undefined"==typeof b)if("[object Array]"===Object.prototype.toString.call(a))b=[],a.forEach(function(a,c){b[c]=M(a)});else if("object"==typeof a)if(a.nodeType&&"function"==typeof a.cloneNode)var b=a.cloneNode(!0);else if(a.prototype)b=a;else if(a instanceof Date)b=new Date(a);else{b={};for(var d in a)b[d]=M(a[d])}else b=a;return b},b.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},b.helpers.Extend=function(){for(var a=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},b=arguments[0],c=1;c<arguments.length;c++)b=a(b,arguments[c]);return b};var t=function(a){var b,c;return(c=a.match(/^\-(w|m|s|o)+\-/)||"-"===a.charAt(0))?null!==c&&c[0]?(b={prefix:c[0].replace(/-/g,"")},b.prop=a.replace(c[0],"")):(b={prefix:""},b.prop=a.substr(1,a.length)):b={prefix:!1,prop:a},b};b.helpers.Prefixes={addPrefixes:function(a,b){var c=a,d=t(a),e=b[a];d.prefix!==!1&&(delete b[c],b[d.prop]=e,(""===d.prefix||d.prefix.indexOf("w")>=0)&&(b["-webkit-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("m")>=0)&&(b["-moz-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("s")>=0)&&(b["-ms-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("o")>=0)&&(b["-o-"+d.prop]=e))},nonPrefixProp:function(a){var b=t(a);return b.prefix!==!1&&(b.prefix=""==b.prefix?"-":"-"+b.prefix+"-"),b}},b.helpers.RequireUncached=function(a){return delete d.cache[d.resolve(a)],d(a)},b.helpers.TransformUppercase=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};var u=function(a,b,f){var g="",h="",i=[],j=f.api;cssPreprocessor=d(e+"/../css/CSS.js")(),htmlPreprocessor=d(e+"/../html/HTML.js")();for(var k=function(a){for(var b=0;b<i.length,component=i[b];b++)"function"==typeof component&&(component=component()),j.add(component.css?component.css:{});cssPreprocessor(j.getRules(),function(b,c){g+=c,a(b)},f)},l=function(b){var c=0,d=null,e=function(){if(c>a.length-1)return b(d),void 0;var g=a[c];"function"==typeof g&&(g=g()),j.morph("html").add(g.html?g.html:{}),htmlPreprocessor(j.getRules(),function(a,b){h+=b,c+=1,d=a,e()},f)};e()},m=function(a){for(var b in a)if("_include"===b)if(a[b]instanceof Array)for(var d=0;d<a[b].length,c=a[b][d];d++)"function"==typeof c&&(c=c()),i.push(c),m(c);else"function"==typeof a[b]&&(a[b]=a[b]()),i.push(a[b]),m(a[b]);else"object"==typeof a[b]&&m(a[b])},n=0;n<a.length,c=a[n];n++)"function"==typeof c&&(c=c()),i.push(c),m(c);j.flush(),k(function(a){j.morph("html"),l(function(c){b(a||c?{error:{css:a,html:c}}:null,g,h)})})};b.processors.component.Component=function(){var a=function(a,b,c){u(a.mainstream,b,c)};return a.type="component",a};var w="\n",x={combineSelectors:!0,minify:!1,keepCamelCase:!1},y=d("../../helpers/TransformUppercase"),z=function(a,b){var c="";for(var d in a)if(0===d.indexOf("____raw"))c+=a[d][d]+w;else{var e=d+" {"+w;for(var f in a[d]){var g=a[d][f];""===g&&(g='""'),f=f.replace(/^%(.*)+?%/,""),e+=b&&b.keepCamelCase===!0?" "+f+": "+g+";"+w:" "+y(f)+": "+g+";"+w}e+="}"+w,c+=e}return c},A=function(a){var b={},c={};for(var d in a){var e=a[d];for(var f in e){var g=e[f];b[f]||(b[f]={}),b[f][g]||(b[f][g]=[]),b[f][g].push(d)}}for(var f in b){var h=b[f];for(var g in h){var i=h[g];c[i.join(", ")]||(c[i.join(", ")]={});var d=c[i.join(", ")];d[f]=g}}return c},B=function(a){return a=a.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),a=a.replace(/ {2,}/g," "),a=a.replace(/ ([{:}]) /g,"$1"),a=a.replace(/([;,]) /g,"$1"),a=a.replace(/ !/g,"!")},C=function(a,b){if(b&&b.api&&b.api.getStorage().__defined){var c=b.api.getStorage().__defined;for(var d in c){var e=new RegExp("<%( )?"+d+"( )?%>","g");a="function"!=typeof c[d]?a.replace(e,c[d]):a.replace(e,c[d]())}}return a};b.processors.css.CSS=function(){var a=function(a,b,c){c=c||x;var d="";for(var e in a){var f=a[e];f=c.combineSelectors?A(f):f,d+="mainstream"===e?z(f,c):e+" {"+w+z(f,c)+"}"+w}return d=C(d,c),c.minify?(d=B(d),b&&b(null,d)):b&&b(null,d),d};return a.type="css",a},b.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},b.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},b.processors.css.plugins.keyframes=function(){return function(a,b){d(e+"/../CSS.js")(),d(e+"/../../../helpers/Prefixes");if("object"==typeof b){var c;if("undefined"!=typeof b.frames)c=b.frames;else if("undefined"!=typeof b.keyframes){c={};for(var f=0;rule=b.keyframes[f];f++)if("keyframe"===rule.type)for(var g=c[rule.values]={},h=0;declaration=rule.declarations[h];h++)"declaration"===declaration.type&&(g[declaration.property]=declaration.value)}var i=d(e+"/../../../../")();i.add(c).compile(function(c,d){var e="@keyframes "+b.name+" {\n";e+=d,e+="}",e=e+"\n"+e.replace("@keyframes","@-webkit-keyframes"),a.raw(e)},{combineSelectors:!1})}}},b.processors.css.plugins.media=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@media "+b.media+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}},b.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},b.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},b.processors.css.plugins.supports=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@supports "+b.supports+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}};var D=null,w="\n",x={},E=d("js-beautify").html,F=d("../../helpers/TransformUppercase"),G={},H=function(a){var b="";for(var c in D)if(c==a)for(var d=D[c].length,e=0;d>e;e++)b+=J("",D[c][e]);return b},I=function(a,b){return b&&b.keepCamelCase===!0?a:F(a,b)},J=function(a,b){var c="",e="",f="",g=d("./helpers/PropAnalyzer")(a);if(a=g.tag,""!=g.attrs&&(e+=" "+g.attrs),"string"==typeof b)return K(a,e,b);var h=function(a){""!=f&&(f+=w),f+=a};for(var i in b){var j=b[i];switch(i){case"_attrs":for(var k in j)e+="function"==typeof j[k]?" "+I(k,G)+'="'+j[k]()+'"':" "+I(k,G)+'="'+j[k]+'"';break;case"_":h(j);break;case"_tpl":if("string"==typeof j)h(H(j));else if(j instanceof Array){for(var l="",m=0;tpl=j[m];m++)l+=H(tpl),m<j.length-1&&(l+=w);h(l)}break;case"_include":var l="",n=function(a){"function"==typeof a&&(a=a()),a.css&&a.html&&(a=a.html),l+=J("",a)};if(j instanceof Array)for(var m=0;m<j.length,o=j[m];m++)n(o);else"object"==typeof j&&n(j);h(l);break;default:switch(typeof j){case"string":h(J(i,j));break;case"object":if(j.length&&j.length>0){for(var l="",m=0;v=j[m];m++)l+=J("","function"==typeof v?v():v),m<j.length-1&&(l+=w);h(J(i,l))}else h(J(i,j));break;case"function":h(J(i,j()))}}}return c+=""!=a?K(a,e,f):f},K=function(a,b,c){var d="";return""==a&&""==b&&""!=c?c:(a=""==a?"div":a,d+=""!==c?"<"+I(a,G)+b+">"+w+c+w+"</"+I(a,G)+">":"<"+I(a,G)+b+"/>")},L=function(a){return a=d("./helpers/TemplateEngine")(a.replace(/[\r\t\n]/g,""),G),G.minify?a:E(a,{indent_size:G.indentSize||4})};return b.processors.html.HTML=function(){var a=function(a,b,c){D=a,b=b||function(){},c=G=c||x;var d=L(H("mainstream"));return b(null,d),d};return a.type="html",a},b.processors.html.helpers.PropAnalyzer=function(a){var b={tag:"",attrs:""},d=(a.length,""),e=!1,f=[],g="",h=!1,i="",j=!1;if(/(#|\.|\[|\])/gi.test(a)===!1)return{tag:a,attrs:""};for(var k=0;k<a.length,c=a[k];k++)"["!==c||j?j?"]"!=c?i+=c:(j=!1,k-=1):"."!==c||e?e?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?d+=c:(f.push(d),e=!1,d="",k-=1):"#"!==c||h?h?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?g+=c:(h=!1,k-=1):"."!=c&&"#"!=c&&"["!=c&&"]"!=c&&(b.tag+=c):h=!0:e=!0:j=!0;""!=d&&f.push(d);for(var l="",k=0;cls=f[k];k++)l+=""===l?cls:" "+cls;return b.attrs+=""!=l?'class="'+l+'"':"",""!=g&&(b.attrs+=(""!=b.attrs?" ":"")+'id="'+g+'"'),""===b.tag&&""!=b.attrs&&(b.tag="div"),""!=i&&(b.attrs+=(""!=b.attrs?" ":"")+i),b},b.processors.html.helpers.TemplateEngine=function(a,b){for(var c,d=/<%(.+?)%>/g,e=/(^( )?(var|if|for|else|switch|case|break|{|}|;))(.*)?/g,f="var r=[];\n",g=0,h=function(a,b){return f+=b?a.match(e)?a+"\n":"r.push("+a+");\n":""!=a?'r.push("'+a.replace(/"/g,'\\"')+'");\n':"",h};match=d.exec(a);)h(a.slice(g,match.index))(match[1],!0),g=match.index+match[0].length;h(a.substr(g,a.length-g)),f=(f+'return r.join("");').replace(/[\r\t\n]/g,"");try{c=new Function(f).apply(b)}catch(i){console.error("'"+i.message+"'"," in \n\nCode:\n",f,"\n")}return c},m()}(window);
var Absurd=function(){var b={api:{},helpers:{},plugins:{},processors:{css:{plugins:{}},html:{plugins:{},helpers:{}},component:{plugins:{}}}},d=function(a){return a.indexOf("css/CSS.js")>0||"/../CSS.js"==a?b.processors.css.CSS:a.indexOf("html/HTML.js")>0?b.processors.html.HTML:a.indexOf("component/Component.js")>0?b.processors.component.Component:"js-beautify"==a?{html:function(a){return a}}:"./helpers/PropAnalyzer"==a?b.processors.html.helpers.PropAnalyzer:"../../helpers/TransformUppercase"==a?b.helpers.TransformUppercase:"./helpers/TemplateEngine"==a?b.processors.html.helpers.TemplateEngine:"../helpers/Extend"==a?b.helpers.Extend:"../helpers/Clone"==a?b.helpers.Clone:"../helpers/Prefixes"==a||"/../../../helpers/Prefixes"==a?b.helpers.Prefixes:a==e+"/../../../../"?Absurd:function(){}},e="",f=function(a,b){!function c(){a.length>0&&a.shift().apply(b||{},[c].concat(Array.prototype.slice.call(arguments,0)))}()},g=function(a,b){var c;try{c=(b||document).querySelectorAll(a)}catch(d){c=document.querySelectorAll(a)}return c},h=function(a){var b={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[1,"<div>","</div>"]};b.optgroup=b.option,b.tbody=b.tfoot=b.colgroup=b.caption=b.thead,b.th=b.td;var c=document.createElement("div"),d=/<\s*\w.*?>/g.exec(a);if(null!=d){var c,e=d[0].replace(/</g,"").replace(/>/g,""),f=b[e]||b._default;a=f[1]+a+f[2],c.innerHTML=a;for(var g=f[0]+1;g--;)c=c.lastChild}else c.innerHTML=a,c=c.lastChild;return c},i=function(a,b,c){return a.addEventListener?(a.addEventListener(b,c,!1),!0):a.attachEvent?a.attachEvent("on"+b,c):void 0},j=function(a){for(var b,c=a.childNodes,d=c.length,e=0,f=/^\s*$/;d>e;e++)b=c[e],3==b.nodeType&&f.test(b.nodeValue)&&(a.removeChild(b),e--,d--);return a},k=function(b,c,d){for(var e=document.createElement(b),f=0;f<c.length,a=c[f];f++)e.setAttribute(a.name,a.value);return e.innerHTML=d,e},l=function(a,b){return b=b===!1?document:b||this.el||document,b.querySelector(a)},m=function(a,b){return b=b===!1?document:b||this.el||document,b.querySelectorAll(a)},n=function(a,b){return b=b||this.el,b&&b.currentStyle?b.currentStyle[a]:window.getComputedStyle?document.defaultView.getComputedStyle(b,null).getPropertyValue(a):null},q=function(a,b){if(b=b||this.el,b.classList)b.classList.add(a);else{var c=b.className;c.indexOf(a)<0&&(""==c?b.className=a:b.className+=" "+a)}return this},r=function(a,b){if(b=b||this.el,b.classList)b.classList.remove(a);else{for(var c=b.className.split(" "),d=[],e=0;e<c.length;e++)c[e]!=a&&d.push(c[e]);b.className=d.join(" ")}return this},s=function(a,b,c){c=c||this.el;for(var d=c.className.split(" "),e=!1,f=0;f<d.length;f++)d[f]==a&&(e=!0,d[f]=b);return e?(c.className=d.join(" "),this):q(b,c)},t=function(a,b){if(b=b||this.el,b.classList)b.classList.toggle(a);else{for(var c=b.className.split(" "),d=-1,e=c.length;e--;)c[e]===a&&(d=e);d>=0?c.splice(d,1):c.push(a),b.className=c.join(" ")}return this},u=function(a,c,d,e){var o=b.helpers.Extend({__name:a},e),p=b.helpers.Extend,u=[];o.listeners=u,o.on=function(a,b,c){return u[a]||(u[a]=[]),u[a].push({callback:b,scope:c}),this},o.off=function(a,b){return u[a]?(b||(u[a]=[]),this):this},o.dispatch=function(a,b,c){if(!b||"object"!=typeof b||b instanceof Array||(b.target=this),u[a])for(var e=0;e<u[a].length;e++){var f=u[a][e].callback;f.apply(c||u[a][e].scope||{},[b])}return this[a]&&"function"==typeof this[a]&&this[a](b),d&&d.dispatch(a,b),this};var v={};o.set=function(a,b){return v[a]=b,this},o.get=function(a){return v[a]};var w=!1;o.__handleCSS=function(b){return this.css?c.flush().add(this.css).compile(function(c,d){if(w)w.raw!==d&&(w.raw=d,w.element.innerHTML=d);else{var e=k("style",[{name:"id",value:a+"-css"},{name:"type",value:"text/css"}],d);(g("head")||g("body"))[0].appendChild(e),w={raw:d,element:e}}b()}):b(),this},o.applyCSS=function(a,b){if(this.html&&"string"==typeof this.html){var c={};c[this.html]=a,a=c}return this.css=a,b||this.populate(),this};var x=!1;o.__mergeDOMElements=function(a,b){if(j(a),j(b),"undefined"!=typeof a&&"undefined"!=typeof b&&!a.isEqualNode(b)){if(a.nodeName!==b.nodeName)return a.parentNode&&a.parentNode.replaceChild(b,a),void 0;if(a.nodeValue!==b.nodeValue&&(a.nodeValue=b.nodeValue),a.attributes){for(var c,d,e=a.attributes,f=b.attributes,g={},h=0;h<e.length,c=e[h];h++){for(var i=0;i<f.length,d=f[i];i++)c.name===d.name&&(a.setAttribute(c.name,d.value),g[c.name]=!0);g[c.name]||a.removeAttribute(c.name)}for(var h=0;h<f.length,d=f[h];h++)g[d.name]||a.setAttribute(d.name,d.value)}var k=[];if(a.childNodes.length>=b.childNodes.length)for(var h=0;h<a.childNodes.length;h++)b.childNodes[h]||b.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);else for(var h=0;h<b.childNodes.length;h++)a.appendChild(document.createTextNode("")),k.push([a.childNodes[h],b.childNodes[h]]);for(var h=0;h<k.length;h++)o.__mergeDOMElements(k[h][0],k[h][1])}},o.__handleHTML=function(a){var b=this,d=function(){c.flush().morph("html").add(x).compile(function(c,d){b.el?o.__mergeDOMElements(b.el,h(d)):b.el=h(d),a()},b)};if(this.html)if("string"==typeof this.html){if(!this.el){var e=g(this.html);e.length>0&&(this.el=e[0],x={"":this.el.outerHTML.replace(/&lt;/g,"<").replace(/&gt;/g,">")})}d()}else"object"==typeof this.html?(x=p({},this.html),d()):a();else a();return this},o.applyHTML=function(a,b){return this.html=a,b||this.populate(),this};var y=!1;o.__append=function(a){return!y&&this.el&&this.get("parent")&&(y=!0,this.get("parent").appendChild(this.el)),a(),this};var z={events:{}};o.__handleEvents=function(a){if(this.el){var b=this,c=function(a){var c=a.getAttribute("data-absurd-event");if(c=c.split(":"),c.length>=2){var d=c[0],e=c[1];c.splice(0,2);var f=c;(!z.events[d]||z.events[d].indexOf(a)<0)&&(z.events[d]||(z.events[d]=[]),z.events[d].push(a),i(a,d,function(a){if("function"==typeof b[e]){var c=b[e];c.apply(b,[a].concat(f))}}))}};this.el.hasAttribute&&this.el.hasAttribute("data-absurd-event")&&c(this.el);for(var d=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-event]"):[],e=0;e<d.length;e++)c(d[e])}return a(),this},o.__getAnimAndTransEndEventName=function(a){if(a){var b,c={animation:["animationend","transitionend"],OAnimation:["oAnimationEnd","oTransitionEnd"],MozAnimation:["animationend","transitionend"],WebkitAnimation:["webkitAnimationEnd","webkitTransitionEnd"]};for(b in c)if(void 0!==a.style[b])return c[b]}},o.onAnimationEnd=function(a,b){1==arguments.length&&(b=a,a=this.el);var c=this,d=o.__getAnimAndTransEndEventName(a);return d?(this.addEventListener(a,d[0],function(a){b.apply(c,[a])}),void 0):(b.apply(this,[{error:"Animations not supported."}]),void 0)},o.onTransitionEnd=function(a,b){1==arguments.length&&(b=a,a=this.el);var c=this,d=o.__getAnimAndTransEndEventName(a);return d?(this.addEventListener(a,d[1],function(a){b.apply(c,[a])}),void 0):(b.apply(this,[{error:"Animations not supported."}]),void 0)};var A={funcs:{},index:0};return o.__handleAsyncFunctions=function(a){if(this.el){var b=[];if(this.el.hasAttribute&&this.el.hasAttribute("data-absurd-async"))b.push(this.el);else for(var c=this.el.querySelectorAll?this.el.querySelectorAll("[data-absurd-async]"):[],d=0;d<c.length;d++)b.push(c[d]);if(0===b.length)a();else{var e=this;!function f(){if(0===b.length)a();else{var c=b.shift(),d=c.getAttribute("data-absurd-async"),g=function(a){"string"==typeof a?c.parentNode.replaceChild(h(a),c):c.parentNode.replaceChild(a,c),f()};"function"==typeof e[A.funcs[d].name]?e[A.funcs[d].name].apply(e,[g].concat(A.funcs[d].args)):"function"==typeof A.funcs[d].func&&A.funcs[d].func.apply(e,[g].concat(A.funcs[d].args))}}()}}else a();return this},o.async=function(){var a=Array.prototype.slice.call(arguments,0),b=a.shift(),c="_"+A.index++;return A.funcs[c]={args:a,name:b},'<script data-absurd-async="'+c+'"></script>'},o.child=function(){var a=Array.prototype.slice.call(arguments,0),b=this.get("children"),c=b&&b[a.shift()],d="_"+A.index++;return A.funcs[d]={args:a,func:function(a){c.populate({callback:function(b){a(b.html.element)}})}},'<script data-absurd-async="'+d+'"></script>'},o.wire=function(a){return c.components.events.on(a,this[a]||function(){},this),this},o.populate=function(a){return f([o.__handleCSS,o.__handleHTML,o.__append,o.__handleEvents,o.__handleAsyncFunctions,function(){A={funcs:{},index:0};var b={css:w,html:{element:this.el}};this.dispatch("populated",b),a&&"function"==typeof a.callback&&a.callback(b)}],this),this},o.str2DOMElement=h,o.addEventListener=i,o.queue=f,o.compileHTML=function(a,b,d){c.flush().morph("html").add(a).compile(b,d)},o.compileCSS=function(a,b,d){c.flush().add(a).compile(b,d)},o.qs=l,o.qsa=m,o.getStyle=n,o.addClass=q,o.removeClass=r,o.replaceClass=s,o.toggleClass=t,o},w=function(a){a.di.register("is",{appended:function(a){return"undefined"==typeof a&&(a=this.host.html),l(a)?!0:!1}})},x=function(){return function(a){var d=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},e={defaultProcessor:b.processors.css.CSS()},f={},g={},h={},i={};e.getRules=function(a){return"undefined"==typeof a?f:("undefined"==typeof f[a]&&(f[a]=[]),f[a])},e.getPlugins=function(){return h},e.getStorage=function(){return g},e.flush=function(){return f={},g=[],i={},e.defaultProcessor=b.processors.css.CSS(),e},e.import=function(){return e.callHooks("import",arguments)?e:e},e.addHook=function(a,b){i[a]||(i[a]=[]);for(var d=!1,e=0;c=i[a][e];e++)c===b&&(d=!0);d===!1?i[a].push(b):null},e.callHooks=function(a,b){if(i[a])for(var d=0;c=i[a][d];d++)if(c.apply(e,b)===!0)return!0;return!1},e.numOfAddedRules=0,e.components=function(a){var c=b.helpers.Extend,d=b.helpers.Clone,e={},f=[],g=c({},u()),h={};return function(a){window&&(window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a))}(function(){h.broadcast("ready")}),h={events:g,register:function(b,h){return e[b]=function(){var e=c({},u(b,a,g,d(h)));return a.di.resolveObject(e),f.push(e),"function"==typeof e.constructor&&e.constructor.apply(e,Array.prototype.slice.call(arguments,0)),e}},get:function(a){if(e[a])return e[a];throw new Error("There is no component with name '"+a+"'.")},remove:function(a){return e[a]?(delete e[a],!0):!1},list:function(){var a=[];for(var b in e)a.push(b);return a},flush:function(){return e={},f=[],this},broadcast:function(a,b){for(var c=0;c<f.length,instance=f[c];c++)"function"==typeof instance[a]&&instance[a](b);return this}}}(e),e.component=function(a){return function(b,c){return"undefined"==typeof c?a.components.get(b):a.components.register(b,c)}}(e),e.di=b.DI(e),w(e),e.compile=function(a,b){if(e.callHooks("compile",arguments))return e;var c={combineSelectors:!0,minify:!1,processor:e.defaultProcessor,keepCamelCase:!1,api:e};b=d(c,b||{}),b.processor(e.getRules(),a||function(){},b),e.flush()};for(var j in b.api)"compile"!==j&&(e[j]=b.api[j](e),e[j]=function(a){return function(){var c=b.api[a](e);return e.callHooks(a,arguments)?e:c.apply(e,arguments)}}(j));for(var k in b.processors.css.plugins)e.plugin(k,b.processors.css.plugins[k]());return"function"==typeof a&&a(e),"undefined"!=typeof Organic&&Organic.init(e),e}};b.DI=function(){var a={dependencies:{},register:function(a,b){return this.dependencies[a]=b,this},resolve:function(){var a,b,c,d=this,e=!1;"string"==typeof arguments[0]?(a=arguments[1],b=arguments[0].replace(/ /g,"").split(","),c=arguments[2]||{}):(a=arguments[0],b=a.toString().match(/^function\s*[^\(]*\(\s*([^\)]*)\)/m)[1].replace(/ /g,"").split(","),c=arguments[1]||{});for(var f=0;f<b.length;f++)"undefined"!=typeof this.dependencies[b[f]]&&(e=!0);return e?function(){for(var e=[],f=Array.prototype.slice.call(arguments,0),g=0;g<b.length;g++){var h=b[g];if("undefined"!=typeof d.dependencies[h]){var i=d.dependencies[h];"function"==typeof i?i.prototype.host=c:"object"==typeof i&&(i.host=c),e.push(i)}else e.push(f.shift())}return a.apply(c,e)}:a},resolveObject:function(a){if("object"==typeof a)for(var b in a)"function"==typeof a[b]?a[b]=this.resolve(a[b],a):a[b]instanceof Array&&2==a[b].length&&"string"==typeof a[b][0]&&"function"==typeof a[b][1]&&(a[b]=this.resolve(a[b][0],a[b][1],a));return this},flush:function(){return this.dependencies={},this}};return a},b.api.add=function(a){var b=(d("../helpers/Extend"),d("../helpers/Prefixes")),c=[],e={combineSelectors:!0},f=function(c,d,e,f,h){var i=b.nonPrefixProp(d),j=a.getPlugins()[i.prop];if("undefined"!=typeof j){var k=j(a,e,i.prefix);return k&&g(c,k,f,h),!0}return!1},g=function(a,d,h,i){if(h=h||"mainstream",null!==d&&"undefined"!=typeof d&&d!==!1)if(i||a||(a=""),/, ?/g.test(a)&&e.combineSelectors)for(var j=a.replace(/, /g,",").split(","),k=0;k<j.length,p=j[k];k++)g(p,d,h,i);else if(!f(null,a,d,h,i))if("undefined"==typeof d.length||"object"!=typeof d){var l={},m=a,n={},o={};for(var q in d){var r=typeof d[q];"object"!==r&&"function"!==r&&d[q]!==!1?f(a,q,d[q],h,i)===!1&&(m=0===m.indexOf("^")?m.substr(1,m.length-1)+("undefined"!=typeof i?" "+i:""):"undefined"!=typeof i?i+" "+a:a,l[q]=d[q],b.addPrefixes(q,l)):"object"===r?n[q]=d[q]:"function"===r&&(o[q]=d[q])}c.push({selector:m,props:l,stylesheet:h});for(var q in n)if(":"===q.charAt(0))g(a+q,n[q],h,i);else if(/&/g.test(q))if(/, ?/g.test(q)&&e.combineSelectors)for(var j=q.replace(/, /g,",").split(","),k=0;k<j.length,p=j[k];k++)p.indexOf("&")>=0?g(p.replace(/&/g,a),n[q],h,i):g(p,n[q],h,"undefined"!=typeof i?i+" "+a:a);else g(q.replace(/&/g,a),n[q],h,i);else 0===q.indexOf("@media")||0===q.indexOf("@supports")?g(a,n[q],q,i):0===a.indexOf("@media")||0===q.indexOf("@supports")?g(q,n[q],a,i):0===a.indexOf("^")?g(a.substr(1,a.length-1)+("undefined"!=typeof i?" "+i:"")+" "+q,n[q],h):f(a,q,n[q],h,i)===!1&&g(q,n[q],h,(i?i+" ":"")+a);for(var q in o){var s={};s[q]=o[q](),g(a,s,h,i)}}else for(var k=0;k<d.length,q=d[k];k++)g(a,q,h,i)},h=function(b,d,f){c=[],a.numOfAddedRules+=1,"object"==typeof d&&"undefined"==typeof f&&(e=d,d=null),"undefined"!=typeof f&&(e=f);var h=a.defaultProcessor.type;for(var i in b)g(i,b[i],d||"mainstream");for(var j=0;j<c.length;j++){var d=c[j].stylesheet,i=c[j].selector,k=c[j].props,l=a.getRules(d),m=l[i]||{};for(var n in k){var o=k[n];"object"!=typeof o&&(m[n]="css"==h?"+"===o.toString().charAt(0)?m&&m[n]?m[n]+", "+o.substr(1,o.length-1):o.substr(1,o.length-1):">"===o.toString().charAt(0)?m&&m[n]?m[n]+" "+o.substr(1,o.length-1):o.substr(1,o.length-1):o:o)}l[i]=m}return a};return h};var y=d("../helpers/Extend");b.api.compile=function(a){return function(){for(var b=null,c=null,d=null,e=0;e<arguments.length;e++)switch(typeof arguments[e]){case"function":c=arguments[e];break;case"string":b=arguments[e];break;case"object":d=arguments[e]}var f={combineSelectors:!0,minify:!1,keepCamelCase:!1,processor:a.defaultProcessor,api:a};d=y(f,d||{}),d.processor(a.getRules(),function(d,e){if(null!=b)try{B.writeFile(b,e,function(a){c(a,e)})}catch(d){c.apply({},arguments)}else c.apply({},arguments);a.flush()},d)}},b.api.compileFile=function(a){return a.compile};var z=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.darken=function(){return function(a,b){return z(a,-(b/100))}},b.api.define=function(a){return function(b,c){return a.getStorage().__defined||(a.getStorage().__defined={}),a.getStorage().__defined[b]=c,a}},b.api.hook=function(a){return function(b,c){return a.addHook(b,c),a}};var z=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e};b.api.lighten=function(){return function(a,b){return z(a,b/100)}};var A={html:function(a){a.defaultProcessor=d(e+"/../processors/html/HTML.js")(),a.hook("add",function(b,c){return a.getRules(c||"mainstream").push(b),!0})},component:function(a){a.defaultProcessor=d(e+"/../processors/component/Component.js")(),a.hook("add",function(b){b instanceof Array||(b=[b]);for(var d=0;d<b.length,c=b[d];d++)a.getRules("mainstream").push(c);return!0})}};b.api.morph=function(a){return function(b){return A[b]&&(a.flush(),A[b](a)),a}},b.api.plugin=function(a){var b=function(b,c){return a.getPlugins()[b]=c,a};return b},b.api.raw=function(a){return function(b){var c={},d={},e="____raw_"+a.numOfAddedRules;return d[e]=b,c[e]=d,a.add(c),a}};{var B=d("fs");d("path")}b.api.rawImport=function(a){var b=function(b){var c=B.readFileSync(b,{encoding:"utf8"});a.raw(c)};return function(c){var d,e,f;if("string"==typeof c)b(c);else for(e=0,f=c.length;f>e;e++)d=c[e],b(d);return a}},b.api.register=function(a){return function(b,c){return a[b]=c,a}},b.api.storage=function(a){var b=a.getStorage(),c=function(d,e){if("undefined"!=typeof e)b[d]=e;else{if("object"!=typeof d){if(b[d])return b[d];throw new Error("There is no data in the storage associated with '"+d+"'")}for(var f in d)Object.prototype.hasOwnProperty.call(d,f)&&c(f,d[f])}return a};return c},b.helpers.Clone=function U(a){if(!a)return a;var b,c=[Number,String,Boolean];if(c.forEach(function(c){a instanceof c&&(b=c(a))}),"undefined"==typeof b)if("[object Array]"===Object.prototype.toString.call(a))b=[],a.forEach(function(a,c){b[c]=U(a)});else if("object"==typeof a)if(a.nodeType&&"function"==typeof a.cloneNode)var b=a.cloneNode(!0);else if(a.prototype)b=a;else if(a instanceof Date)b=new Date(a);else{b={};for(var d in a)b[d]=U(a[d])}else b=a;return b},b.helpers.ColorLuminance=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,""),a.length<6&&(a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),b=b||0;var c,d,e="#";for(d=0;3>d;d++)c=parseInt(a.substr(2*d,2),16),c=Math.round(Math.min(Math.max(0,c+c*b),255)).toString(16),e+=("00"+c).substr(c.length);return e},b.helpers.Extend=function(){for(var a=function(a,b){for(var c in b)hasOwnProperty.call(b,c)&&(a[c]=b[c]);return a},b=arguments[0],c=1;c<arguments.length;c++)b=a(b,arguments[c]);return b};var C=function(a){var b,c;return(c=a.match(/^\-(w|m|s|o)+\-/)||"-"===a.charAt(0))?null!==c&&c[0]?(b={prefix:c[0].replace(/-/g,"")},b.prop=a.replace(c[0],"")):(b={prefix:""},b.prop=a.substr(1,a.length)):b={prefix:!1,prop:a},b};b.helpers.Prefixes={addPrefixes:function(a,b){var c=a,d=C(a),e=b[a];d.prefix!==!1&&(delete b[c],b[d.prop]=e,(""===d.prefix||d.prefix.indexOf("w")>=0)&&(b["-webkit-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("m")>=0)&&(b["-moz-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("s")>=0)&&(b["-ms-"+d.prop]=e),(""===d.prefix||d.prefix.indexOf("o")>=0)&&(b["-o-"+d.prop]=e))},nonPrefixProp:function(a){var b=C(a);return b.prefix!==!1&&(b.prefix=""==b.prefix?"-":"-"+b.prefix+"-"),b}},b.helpers.RequireUncached=function(a){return delete d.cache[d.resolve(a)],d(a)},b.helpers.TransformUppercase=function(a){for(var b="",d=0;c=a.charAt(d);d++)b+=c===c.toUpperCase()&&c.toLowerCase()!==c.toUpperCase()?"-"+c.toLowerCase():c;return b};var D=function(a,b,f){var g="",h="",i=[],j=f.api;cssPreprocessor=d(e+"/../css/CSS.js")(),htmlPreprocessor=d(e+"/../html/HTML.js")();for(var k=function(a){for(var b=0;b<i.length,component=i[b];b++)"function"==typeof component&&(component=component()),j.add(component.css?component.css:{});cssPreprocessor(j.getRules(),function(b,c){g+=c,a(b)},f)},l=function(b){var c=0,d=null,e=function(){if(c>a.length-1)return b(d),void 0;var g=a[c];"function"==typeof g&&(g=g()),j.morph("html").add(g.html?g.html:{}),htmlPreprocessor(j.getRules(),function(a,b){h+=b,c+=1,d=a,e()},f)};e()},m=function(a){for(var b in a)if("_include"===b)if(a[b]instanceof Array)for(var d=0;d<a[b].length,c=a[b][d];d++)"function"==typeof c&&(c=c()),i.push(c),m(c);else"function"==typeof a[b]&&(a[b]=a[b]()),i.push(a[b]),m(a[b]);else"object"==typeof a[b]&&m(a[b])},n=0;n<a.length,c=a[n];n++)"function"==typeof c&&(c=c()),i.push(c),m(c);j.flush(),k(function(a){j.morph("html"),l(function(c){b(a||c?{error:{css:a,html:c}}:null,g,h)})})};b.processors.component.Component=function(){var a=function(a,b,c){D(a.mainstream,b,c)};return a.type="component",a};var E="\n",F={combineSelectors:!0,minify:!1,keepCamelCase:!1},G=d("../../helpers/TransformUppercase"),H=function(a,b){var c="";for(var d in a)if(0===d.indexOf("____raw"))c+=a[d][d]+E;else{var e=d+" {"+E;for(var f in a[d]){var g=a[d][f];""===g&&(g='""'),f=f.replace(/^%(.*)+?%/,""),e+=b&&b.keepCamelCase===!0?" "+f+": "+g+";"+E:" "+G(f)+": "+g+";"+E}e+="}"+E,c+=e}return c},I=function(a){var b={},c={};for(var d in a){var e=a[d];for(var f in e){var g=e[f];b[f]||(b[f]={}),b[f][g]||(b[f][g]=[]),b[f][g].push(d)}}for(var f in b){var h=b[f];for(var g in h){var i=h[g];c[i.join(", ")]||(c[i.join(", ")]={});var d=c[i.join(", ")];d[f]=g}}return c},J=function(a){return a=a.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),a=a.replace(/ {2,}/g," "),a=a.replace(/ ([{:}]) /g,"$1"),a=a.replace(/([;,]) /g,"$1"),a=a.replace(/ !/g,"!")},K=function(a,b){if(b&&b.api&&b.api.getStorage().__defined){var c=b.api.getStorage().__defined;for(var d in c){var e=new RegExp("<%( )?"+d+"( )?%>","g");a="function"!=typeof c[d]?a.replace(e,c[d]):a.replace(e,c[d]())}}return a};b.processors.css.CSS=function(){var a=function(a,b,c){c=c||F;var d="";for(var e in a){var f=a[e];f=c.combineSelectors?I(f):f,d+="mainstream"===e?H(f,c):e+" {"+E+H(f,c)+"}"+E}return d=K(d,c),c.minify?(d=J(d),b&&b(null,d)):b&&b(null,d),d};return a.type="css",a},b.processors.css.plugins.charset=function(){return function(a,b){"string"==typeof b?a.raw('@charset: "'+b+'";'):"object"==typeof b&&(b=b.charset.replace(/:/g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,""),a.raw('@charset: "'+b+'";'))}},b.processors.css.plugins.document=function(){return function(a,b){if("object"==typeof b){var c="";if(c+="@"+b.vendor+"document",c+=" "+b.document,b.rules&&b.rules.length)for(var d=0;rule=b.rules[d];d++)a.handlecssrule(rule,c);else"undefined"!=typeof b.styles&&a.add(b.styles,c)}}},b.processors.css.plugins.keyframes=function(){return function(a,b){d(e+"/../CSS.js")(),d(e+"/../../../helpers/Prefixes");if("object"==typeof b){var c;if("undefined"!=typeof b.frames)c=b.frames;else if("undefined"!=typeof b.keyframes){c={};for(var f=0;rule=b.keyframes[f];f++)if("keyframe"===rule.type)for(var g=c[rule.values]={},h=0;declaration=rule.declarations[h];h++)"declaration"===declaration.type&&(g[declaration.property]=declaration.value)}var i=d(e+"/../../../../")();i.add(c).compile(function(c,d){var e="@keyframes "+b.name+" {\n";e+=d,e+="}",e=e+"\n"+e.replace("@keyframes","@-webkit-keyframes"),a.raw(e)},{combineSelectors:!1})}}},b.processors.css.plugins.media=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@media "+b.media+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}},b.processors.css.plugins.namespace=function(){return function(a,b){"string"==typeof b?a.raw('@namespace: "'+b+'";'):"object"==typeof b&&(b=b.namespace.replace(/: /g,"").replace(/'/g,"").replace(/"/g,"").replace(/ /g,"").replace(/:h/g,"h"),a.raw('@namespace: "'+b+'";'))}},b.processors.css.plugins.page=function(){return function(a,b){if("object"==typeof b){var c="";c+=b.selectors.length>0?"@page "+b.selectors.join(", ")+" {\n":"@page {\n";for(var d=0;declaration=b.declarations[d];d++)"declaration"==declaration.type&&(c+=" "+declaration.property+": "+declaration.value+";\n");c+="}",a.raw(c)}}},b.processors.css.plugins.supports=function(){return function(a,b){var c=d(e+"/../CSS.js")();if("object"==typeof b){for(var f="@supports "+b.supports+" {\n",g={},h=0;rule=b.rules[h];h++){var i=g[rule.selectors.toString()]={};if("rule"===rule.type)for(var j=0;declaration=rule.declarations[j];j++)"declaration"===declaration.type&&(i[declaration.property]=declaration.value)}f+=c({mainstream:g}),f+="}",a.raw(f)}}};var L=null,E="\n",F={},M=d("js-beautify").html,N=d("../../helpers/TransformUppercase"),O={},P=function(a){var b="";for(var c in L)if(c==a)for(var d=L[c].length,e=0;d>e;e++)b+=R("",L[c][e]);return b},Q=function(a,b){return b&&b.keepCamelCase===!0?a:N(a,b)},R=function(a,b){var c="",e="",f="",g=d("./helpers/PropAnalyzer")(a);if(a=g.tag,""!=g.attrs&&(e+=" "+g.attrs),"string"==typeof b)return S(a,e,b);var h=function(a){""!=f&&(f+=E),f+=a};for(var i in b){var j=b[i];switch(i){case"_attrs":for(var k in j)e+="function"==typeof j[k]?" "+Q(k,O)+'="'+j[k]()+'"':" "+Q(k,O)+'="'+j[k]+'"';break;case"_":h(j);break;case"_tpl":if("string"==typeof j)h(P(j));else if(j instanceof Array){for(var l="",m=0;tpl=j[m];m++)l+=P(tpl),m<j.length-1&&(l+=E);h(l)}break;case"_include":var l="",n=function(a){"function"==typeof a&&(a=a()),a.css&&a.html&&(a=a.html),l+=R("",a)};if(j instanceof Array)for(var m=0;m<j.length,o=j[m];m++)n(o);else"object"==typeof j&&n(j);h(l);break;default:switch(typeof j){case"string":h(R(i,j));break;case"object":if(j.length&&j.length>0){for(var l="",m=0;v=j[m];m++)l+=R("","function"==typeof v?v():v),m<j.length-1&&(l+=E);h(R(i,l))}else h(R(i,j));break;case"function":h(R(i,j()))}}}return c+=""!=a?S(a,e,f):f},S=function(a,b,c){var d="";return""==a&&""==b&&""!=c?c:(a=""==a?"div":a,d+=""!==c?"<"+Q(a,O)+b+">"+E+c+E+"</"+Q(a,O)+">":"<"+Q(a,O)+b+"/>")},T=function(a){return a=d("./helpers/TemplateEngine")(a.replace(/[\r\t\n]/g,""),O),O.minify?a:M(a,{indent_size:O.indentSize||4})};return b.processors.html.HTML=function(){var a=function(a,b,c){L=a,b=b||function(){},c=O=c||F;var d=T(P("mainstream"));return b(null,d),d};return a.type="html",a},b.processors.html.helpers.PropAnalyzer=function(a){var b={tag:"",attrs:""},d=(a.length,""),e=!1,f=[],g="",h=!1,i="",j=!1;if(/(#|\.|\[|\])/gi.test(a)===!1)return{tag:a,attrs:""};for(var k=0;k<a.length,c=a[k];k++)"["!==c||j?j?"]"!=c?i+=c:(j=!1,k-=1):"."!==c||e?e?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?d+=c:(f.push(d),e=!1,d="",k-=1):"#"!==c||h?h?"."!=c&&"#"!=c&&"["!=c&&"]"!=c?g+=c:(h=!1,k-=1):"."!=c&&"#"!=c&&"["!=c&&"]"!=c&&(b.tag+=c):h=!0:e=!0:j=!0;""!=d&&f.push(d);for(var l="",k=0;cls=f[k];k++)l+=""===l?cls:" "+cls;return b.attrs+=""!=l?'class="'+l+'"':"",""!=g&&(b.attrs+=(""!=b.attrs?" ":"")+'id="'+g+'"'),""===b.tag&&""!=b.attrs&&(b.tag="div"),""!=i&&(b.attrs+=(""!=b.attrs?" ":"")+i),b},b.processors.html.helpers.TemplateEngine=function(a,b){for(var c,d=/<%(.+?)%>/g,e=/(^( )?(var|if|for|else|switch|case|break|{|}|;))(.*)?/g,f="var r=[];\n",g=0,h=function(a,b){return f+=b?a.match(e)?a+"\n":"r.push("+a+");\n":""!=a?'r.push("'+a.replace(/"/g,'\\"')+'");\n':"",h};match=d.exec(a);)h(a.slice(g,match.index))(match[1],!0),g=match.index+match[0].length;h(a.substr(g,a.length-g)),f=(f+'return r.join("");').replace(/[\r\t\n]/g,"");try{c=new Function(f).apply(b)}catch(i){console.error("'"+i.message+"'"," in \n\nCode:\n",f,"\n")}return c},x()}(window);

@@ -1,2 +0,2 @@

/* version: 0.2.87, born: 17-1-2014 15:24 */
/* version: 0.2.88, born: 18-1-2014 15:43 */
var Organic = (function(w){

@@ -3,0 +3,0 @@ var o = {

@@ -133,2 +133,85 @@ var lib = {

return node;
}
var qs = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelector(selector);
};
var qsa = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelectorAll(selector);
};
var getStyle = function(styleProp, el) {
el = el || this.el;
if(el && el.currentStyle) {
return el.currentStyle[styleProp];
} else if (window.getComputedStyle) {
return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
}
return null;
};
var addClass = function(className, el) {
el = el || this.el;
if(el.classList) {
el.classList.add(className);
} else {
var current = el.className;
if(current.indexOf(className) < 0) {
if(current == '') el.className = className;
else el.className += ' ' + className;
}
}
return this;
};
var removeClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.remove(className);
} else {
var current = el.className.split(' ');
var newClasses = [];
for(var i=0; i<current.length; i++) {
if(current[i] != className) newClasses.push(current[i]);
}
el.className = newClasses.join(' ');
}
return this;
}
var replaceClass = function(classNameA, classNameB, el) {
el = el || this.el;
var current = el.className.split(' '), found = false;
for(var i=0; i<current.length; i++) {
if(current[i] == classNameA) {
found = true;
current[i] = classNameB;
}
}
if(!found) {
return addClass(classNameB, el);
}
el.className = current.join(' ');
return this;
}
var toggleClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.toggle(className);
} else {
var classes = el.className.split(' ');
var existingIndex = -1;
for (var i = classes.length; i--;) {
if (classes[i] === className)
existingIndex = i;
}
if(existingIndex >= 0)
classes.splice(existingIndex, 1);
else
classes.push(className);
el.className = classes.join(' ');
}
return this;
}

@@ -25,2 +25,14 @@ var CSS = false;

return this;
}
};
api.applyCSS = function(data, skipAutoPopulation) {
if(this.html && typeof this.html === 'string') {
var res = {};
res[this.html] = data;
data = res;
}
this.css = data;
if(!skipAutoPopulation) {
this.populate();
}
return this;
};

@@ -87,2 +87,9 @@ var HTMLSource = false;

return this;
};
api.applyHTML = function(data, skipAutoPopulation) {
this.html = data;
if(!skipAutoPopulation) {
this.populate();
}
return this;
};

@@ -52,2 +52,6 @@ var cache = { events: {} };

api.onAnimationEnd = function(el, func) {
if(arguments.length == 1) {
func = el;
el = this.el;
}
var self = this;

@@ -61,2 +65,6 @@ var eventName = api.__getAnimAndTransEndEventName(el);

api.onTransitionEnd = function(el, func) {
if(arguments.length == 1) {
func = el;
el = this.el;
}
var self = this;

@@ -63,0 +71,0 @@ var eventName = api.__getAnimAndTransEndEventName(el);

@@ -10,98 +10,8 @@ api.str2DOMElement = str2DOMElement;

};
api.qs = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelector(selector);
};
api.qsa = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelectorAll(selector);
};
api.getStyle = function(styleProp, el) {
el = el || this.el;
if(el && el.currentStyle) {
return el.currentStyle[styleProp];
} else if (window.getComputedStyle) {
return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
}
return null;
};
api.addClass = function(className, el) {
el = el || this.el;
if(el.classList) {
el.classList.add(className);
} else {
var current = el.className;
if(current.indexOf(className) < 0) {
if(current == '') el.className = className;
else el.className += ' ' + className;
}
}
return api;
};
api.removeClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.remove(className);
} else {
var current = el.className.split(' ');
var newClasses = [];
for(var i=0; i<current.length; i++) {
if(current[i] != className) newClasses.push(current[i]);
}
el.className = newClasses.join(' ');
}
return api;
}
api.replaceClass = function(classNameA, classNameB, el) {
el = el || this.el;
var current = el.className.split(' '), found = false;
for(var i=0; i<current.length; i++) {
if(current[i] == classNameA) {
found = true;
current[i] = classNameB;
}
}
if(!found) {
return api.addClass(classNameB, el);
}
el.className = current.join(' ');
return api;
}
api.toggleClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.toggle(className);
} else {
var classes = el.className.split(' ');
var existingIndex = -1;
for (var i = classes.length; i--;) {
if (classes[i] === className)
existingIndex = i;
}
if(existingIndex >= 0)
classes.splice(existingIndex, 1);
else
classes.push(className);
el.className = classes.join(' ');
}
return api;
}
api.verify = function(selector, ok, fail) {
var test = function() {
var res = this.qs(selector) ? true : false;
if(res && ok) ok.apply(this);
else if(fail) fail.apply(this);
}
if(typeof selector == 'string') {
test.apply(this);
} else if(typeof selector == 'function') {
fail = ok;
ok = selector;
selector = this.html;
test.apply(this);
}
}
api.qs = qs;
api.qsa = qsa;
api.getStyle = getStyle;
api.addClass = addClass;
api.removeClass = removeClass;
api.replaceClass = replaceClass;
api.toggleClass = toggleClass;

@@ -84,10 +84,7 @@ var client = function() {

(function(fn) {
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', fn);
} else if(document.attachEvent) {
document.attachEvent('onreadystatechange', function() {
if (document.readyState === 'interactive') {
fn();
}
});
if(!window) return;
if (window.addEventListener) {
window.addEventListener('load', fn);
} else if(window.attachEvent) {
window.attachEvent('onload', fn);
}

@@ -153,2 +150,3 @@ })(function() {

_api.di = lib.DI(_api);
injecting(_api);

@@ -155,0 +153,0 @@ /******************************************* Copied directly from /lib/API.js */

@@ -195,3 +195,3 @@ describe("Testing components events", function() {

var self = this;
this.onTransitionEnd(this.el, function(e) {
this.onTransitionEnd(function(e) {
expect(this.__name).toBe('TransitionEnd');

@@ -198,0 +198,0 @@ expect(e).toBeDefined();

@@ -78,26 +78,2 @@ describe("Testing components (utils)", function() {

it("should use verify", function(done) {
absurd.component("GetStyleTest", {
html: '#HTMLReporter',
andAgain: function() {
this.verify(function() {
expect(this.__name).toBe("GetStyleTest");
done();
});
},
testAgain: function() {
this.verify('.no-such-element', function() {}, function() {
expect(this.__name).toBe("GetStyleTest");
this.andAgain();
});
},
constructor: function() {
this.verify('body', function() {
expect(this.__name).toBe("GetStyleTest");
this.testAgain();
});
}
})();
});
});

@@ -28,3 +28,13 @@ module.exports = function(api) {

var d = deps[i];
args.push(self.dependencies[d] && d != '' ? self.dependencies[d] : a.shift());
if(typeof self.dependencies[d] != 'undefined') {
var diModule = self.dependencies[d];
if(typeof diModule == 'function') {
diModule.prototype.host = scope;
} else if(typeof diModule == 'object') {
diModule.host = scope;
}
args.push(diModule);
} else {
args.push(a.shift())
}
}

@@ -31,0 +41,0 @@ return func.apply(scope, args);

{
"name": "absurd",
"version": "0.2.87",
"version": "0.2.88",
"homepage": "http://absurdjs.com/",

@@ -5,0 +5,0 @@ "description": "CSS/HTML preprocessor. Check out krasimirtsonev.com/blog/article/AbsurdJS-fundamentals",

@@ -134,2 +134,85 @@ var lib = {

}
var qs = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelector(selector);
};
var qsa = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelectorAll(selector);
};
var getStyle = function(styleProp, el) {
el = el || this.el;
if(el && el.currentStyle) {
return el.currentStyle[styleProp];
} else if (window.getComputedStyle) {
return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
}
return null;
};
var addClass = function(className, el) {
el = el || this.el;
if(el.classList) {
el.classList.add(className);
} else {
var current = el.className;
if(current.indexOf(className) < 0) {
if(current == '') el.className = className;
else el.className += ' ' + className;
}
}
return this;
};
var removeClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.remove(className);
} else {
var current = el.className.split(' ');
var newClasses = [];
for(var i=0; i<current.length; i++) {
if(current[i] != className) newClasses.push(current[i]);
}
el.className = newClasses.join(' ');
}
return this;
}
var replaceClass = function(classNameA, classNameB, el) {
el = el || this.el;
var current = el.className.split(' '), found = false;
for(var i=0; i<current.length; i++) {
if(current[i] == classNameA) {
found = true;
current[i] = classNameB;
}
}
if(!found) {
return addClass(classNameB, el);
}
el.className = current.join(' ');
return this;
}
var toggleClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.toggle(className);
} else {
var classes = el.className.split(' ');
var existingIndex = -1;
for (var i = classes.length; i--;) {
if (classes[i] === className)
existingIndex = i;
}
if(existingIndex >= 0)
classes.splice(existingIndex, 1);
else
classes.push(className);
el.className = classes.join(' ');
}
return this;
}
var Component = function(componentName, absurd, eventBus, cls) {

@@ -209,3 +292,15 @@ var api = lib.helpers.Extend({

return this;
}
};
api.applyCSS = function(data, skipAutoPopulation) {
if(this.html && typeof this.html === 'string') {
var res = {};
res[this.html] = data;
data = res;
}
this.css = data;
if(!skipAutoPopulation) {
this.populate();
}
return this;
};
var HTMLSource = false;

@@ -298,2 +393,9 @@

};
api.applyHTML = function(data, skipAutoPopulation) {
this.html = data;
if(!skipAutoPopulation) {
this.populate();
}
return this;
};
var appended = false

@@ -359,2 +461,6 @@ api.__append = function(next) {

api.onAnimationEnd = function(el, func) {
if(arguments.length == 1) {
func = el;
el = this.el;
}
var self = this;

@@ -368,2 +474,6 @@ var eventName = api.__getAnimAndTransEndEventName(el);

api.onTransitionEnd = function(el, func) {
if(arguments.length == 1) {
func = el;
el = this.el;
}
var self = this;

@@ -472,101 +582,19 @@ var eventName = api.__getAnimAndTransEndEventName(el);

};
api.qs = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelector(selector);
};
api.qsa = function(selector, parent) {
if(parent === false) { parent = document; }
else { parent = parent || this.el || document; }
return parent.querySelectorAll(selector);
};
api.getStyle = function(styleProp, el) {
el = el || this.el;
if(el && el.currentStyle) {
return el.currentStyle[styleProp];
} else if (window.getComputedStyle) {
return document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
}
return null;
};
api.addClass = function(className, el) {
el = el || this.el;
if(el.classList) {
el.classList.add(className);
} else {
var current = el.className;
if(current.indexOf(className) < 0) {
if(current == '') el.className = className;
else el.className += ' ' + className;
}
}
api.qs = qs;
api.qsa = qsa;
api.getStyle = getStyle;
api.addClass = addClass;
api.removeClass = removeClass;
api.replaceClass = replaceClass;
api.toggleClass = toggleClass;
return api;
};
api.removeClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.remove(className);
} else {
var current = el.className.split(' ');
var newClasses = [];
for(var i=0; i<current.length; i++) {
if(current[i] != className) newClasses.push(current[i]);
}
el.className = newClasses.join(' ');
var injecting = function(absurd) {
absurd.di.register('is', {
appended: function(selector) {
if(typeof selector == 'undefined') selector = this.host.html;
return qs(selector) ? true : false;
}
return api;
});
}
api.replaceClass = function(classNameA, classNameB, el) {
el = el || this.el;
var current = el.className.split(' '), found = false;
for(var i=0; i<current.length; i++) {
if(current[i] == classNameA) {
found = true;
current[i] = classNameB;
}
}
if(!found) {
return api.addClass(classNameB, el);
}
el.className = current.join(' ');
return api;
}
api.toggleClass = function(className, el) {
el = el || this.el;
if (el.classList) {
el.classList.toggle(className);
} else {
var classes = el.className.split(' ');
var existingIndex = -1;
for (var i = classes.length; i--;) {
if (classes[i] === className)
existingIndex = i;
}
if(existingIndex >= 0)
classes.splice(existingIndex, 1);
else
classes.push(className);
el.className = classes.join(' ');
}
return api;
}
api.verify = function(selector, ok, fail) {
var test = function() {
var res = this.qs(selector) ? true : false;
if(res && ok) ok.apply(this);
else if(fail) fail.apply(this);
}
if(typeof selector == 'string') {
test.apply(this);
} else if(typeof selector == 'function') {
fail = ok;
ok = selector;
selector = this.html;
test.apply(this);
}
}
return api;
};
var client = function() {

@@ -655,10 +683,7 @@ return function(arg) {

(function(fn) {
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', fn);
} else if(document.attachEvent) {
document.attachEvent('onreadystatechange', function() {
if (document.readyState === 'interactive') {
fn();
}
});
if(!window) return;
if (window.addEventListener) {
window.addEventListener('load', fn);
} else if(window.attachEvent) {
window.attachEvent('onload', fn);
}

@@ -724,2 +749,3 @@ })(function() {

_api.di = lib.DI(_api);
injecting(_api);

@@ -726,0 +752,0 @@ /******************************************* Copied directly from /lib/API.js */

@@ -28,3 +28,13 @@ lib.DI = function(api) {

var d = deps[i];
args.push(self.dependencies[d] && d != '' ? self.dependencies[d] : a.shift());
if(typeof self.dependencies[d] != 'undefined') {
var diModule = self.dependencies[d];
if(typeof diModule == 'function') {
diModule.prototype.host = scope;
} else if(typeof diModule == 'object') {
diModule.host = scope;
}
args.push(diModule);
} else {
args.push(a.shift())
}
}

@@ -31,0 +41,0 @@ return func.apply(scope, args);

@@ -145,2 +145,41 @@ describe("Dependency injector", function() {

it("should be able to pass a boolean", function(done) {
api.di.register("BooleanValue", false);
var doSomething = api.di.resolve(function(BooleanValue) {
expect(BooleanValue).toBeDefined();
expect(typeof BooleanValue).toBe('boolean');
expect(BooleanValue).toBe(false);
done();
});
doSomething();
});
it("should use the host", function(done) {
var ExternalService = {
gogo: function() {
return this.host.name;
}
}
api.di.register("es", ExternalService);
var doSomething = api.di.resolve(function(es) {
this.name = 42;
expect(es.gogo()).toBe(42);
done();
});
doSomething();
});
it("should use the host while a function is injected", function(done) {
var ExternalService = function() {
return { name: this.host.name };
}
api.di.register("es", ExternalService);
var doSomething = api.di.resolve(function(es) {
this.name = 42;
expect((new es()).name).toBe(42);
done();
});
doSomething();
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc