text: !function e(t,n,r){function i(o,u){if(!n[o]){if(!t[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var i=e,s=t,o=n;u=l=a=void 0,r=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,s);if(void 0!==u){if("value"in u)return u.value;var a=u.get;return void 0===a?void 0:a.call(o)}var l=Object.getPrototypeOf(i);if(null===l)return void 0;e=l,t=s,n=o,r=!0}},a=e("./renderable-element.js"),l=r(a),c=e("./event-dispatcher.js"),f=r(c),h=function(e){function t(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.events=new f["default"],this._elementProperties=["clientWidth","clientHeight","innerText"]}return s(t,e),o(t,[{key:"addCssRules",value:function(e){var t,n=new Promise(function(e,n){t=e});return e.forEach(this._initObserver.bind(this,t)),n}},{key:"_initObserver",value:function(e,t){elementObserver(t.selector).find(this._addElements.bind(this,t,e)).added(this._addElements.bind(this,t,e)).removed(this._removeElements.bind(this)).changed(this._elementProperties,this._onChanged.bind(this))}},{key:"_addElements",value:function(e,n,r){var i=this,s=[];r.forEach(function(e){return-1===s.indexOf(e)&&s.push(e)}),s.map(function(t){return l["default"].register(t,e)}).filter(function(e){return null!=e}).forEach(function(e){return u(Object.getPrototypeOf(t.prototype),"push",i).call(i,e)}),s.length&&(this.concat(s),n(s),this.events.trigger("added",this))}},{key:"_removeElements",value:function(e){var t=this.filter(function(t){return-1!==e.indexOf(t.element)});t=t.filter(function(e,n){return t.indexOf(e)==n}),e.forEach(this._removeElement.bind(this))}},{key:"_removeElement",value:function(e){var n=this.filter(function(t){return t.element==e}).pop();if(n){n.destroy();var r=this.indexOf(n);u(Object.getPrototypeOf(t.prototype),"splice",this).call(this,r,1)}}},{key:"_onChanged",value:function(e){var t=this,n=e.map(function(e){var n=e.target,r=t.filter(function(e){return e.element==n}).pop();return r});this.events.trigger("changed",n)}}]),t}(Array);n["default"]=h;!function(e){function t(){var e=this;i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._cssRules=[],this.readyPromise=new Promise(function(t,n){e.resolveReady=t}),this.changedPromise=new Promise(function(t,n){e.resolveChanged=t})}return s(t,e),o(t,[{key:"addCssRules",value:function(e){this._cssRules=this._cssRules.concat(e);this._createCssRuleObservers.bind(this,e);return this.readyPromise}},{key:"_createCssRuleObservers",value:function(e){var t=this,n=e.map(function(e){return new CssRuleObserver(e)}),r=n.map(function(e){return e.readyPromise});r.forEach(function(e){return e.then(t._resolveReady.bind(t))}),n.forEach(function(e){return t.concat(e)})}},{key:"_resolveReady",value:function(e){this.resolveReady(e)}}]),t}(Array);t.exports=n["default"]},{"./event-dispatcher.js":2,"./renderable-element.js":4}],2:[function(e,t,n){"use strict";function r(e){return{_allowedEventNames:e,_eventCallbacks:[],on:function(e,t){return this._validateEventName(e),this._eventCallbacks.push({eventName:e,callback:t}),this},trigger:function(e){this._validateEventName(e);for(var t=Array.prototype.slice.call(arguments,1),n=0;n<this._eventCallbacks.length;n++){var r=this._eventCallbacks[n];if(r.eventName==e)if(r.callback.constructor==Array)for(var i=0;i<r.callback.length;i++)r.callback[i].apply(this,t);else r.callback.apply(this,t)}return this},hasEventListener:function(e){for(var t=0;t<this._eventCallbacks.length;t++){var n=this._eventCallbacks[t];if(n.eventName==e)return!0}return!1},_validateEventName:function(e){if(this._allowedEventNames&&-1===this._allowedEventNames.indexOf(e))throw new Error(e+" is not a valid event name.")}}}Object.defineProperty(n,"__esModule",{value:!0}),n["default"]=r,t.exports=n["default"]},{}],3:[function(require,module,exports){"use strict";var methods={"if":function _if(condition){return eval(condition)},"min-width":function(e){return this.offsetWidth>=e},"max-width":function(e){return this.offsetWidth<=e},"min-height":function(e){return this.offsetHeight>=e},"max-height":function(e){return this.offsetHeight<=e},"min-text-length":function(e){return this.innerText.length>=e},"max-text-length":function(e){return this.innerText.length<=e},"overflow-x":function(e){elementObserver.disconnect();var t="overflow-x-"+e,n=this.hasAttribute(t);n&&this.removeAttribute(t);var r=!1,i=this.children,s=this.offsetLeft,o=this.clientWidth,u=window.getComputedStyle(this);o-=u.paddingLeft?parseFloat(u.paddingLeft):0,o-=u.paddingRight?parseFloat(u.paddingRight):0;for(var a=0;a<i.length;a++){var l=i[a];l.offsetLeft-s+l.offsetWidth>o&&(r=!0)}return n&&this.setAttribute(t,""),elementObserver.connect(),r},has:function(e){return null!==this.querySelector(e)}};module.exports=methods},{}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e("./methods.js"),u=r(o),a=function(){function e(t){i(this,e),this._cssRules=[],this.element=t}return s(e,[{key:"destroy",value:function(){}},{key:"render",value:function(e){this._cssRules.forEach(this._renderCssRule.bind(this))}},{key:"_renderCssRule",value:function(e){e.methods.forEach(this._renderMethod.bind(this,e))}},{key:"_renderMethod",value:function(e,t){var n=t.name,r=t.arguments,i=u["default"][n].call(this.element,r);i?this.element.hasAttribute(e.attributeAlias)||this.element.setAttribute(e.attributeAlias,""):(this.element.removeAttribute||console.log(this.element),this.element.removeAttribute(e.attributeAlias))}},{key:"_addCssRule",value:function(e){var t=this._cssRules.filter(function(t){return t.attributeAlias==e.attributeAlias});0==t.length&&this._cssRules.push(e)}}],[{key:"register",value:function(t,n){var r=this._instances.filter(function(e){return e.element==t}).pop();return r?(r._addCssRule(n),null):(r=new e(t),r._addCssRule(n),this._instances.push(r),r)}}]),e}();n["default"]=a,a._instances=[],t.exports=n["default"]},{"./methods.js":3}],5:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e("./event-dispatcher.js"),u=r(o),a=function(){function e(t){i(this,e),this.events=new u["default"],this._elementList=t,this._requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},this._queue=[],this._elementList.events.on("added",this._render.bind(this)),this._elementList.events.on("changed",this._render.bind(this)),this._timeoutId=null}return s(e,[{key:"_render",value:function(e){var t=this;e.forEach(function(e){-1===t._queue.indexOf(e)&&t._queue.push(e)});var n=this._queue.length;clearTimeout(this._timeoutId),this._timeoutId=setTimeout(function(){this._requestAnimationFrame.call(window,this._renderQueue.bind(this))}.bind(this),n)}},{key:"_renderQueue",value:function(){for(;this._queue.length;){var e=this._queue.shift();this._renderElement(e)}}},{key:"_renderElement",value:function(e){var t=this;e.render(function(){return t.events.trigger("rendered",e.element)})}}]),e}();n["default"]=a,t.exports=n["default"]},{"./event-dispatcher.js":2}],6:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=e("./client/rendering-queue.js"),u=r(o),a=e("./client/element-list.js"),l=r(a),c=function(){function e(){i(this,e),this._elementList=new l["default"];new u["default"](this._elementList)}return s(e,[{key:"addCssRules",value:function(e){return this._elementList.addCssRules(e)}},{key:"rendered",value:function(e){}}]),e}();window.elementQuery=new c,document.addEventListener("DOMContentLoaded",function(){var e=document.createElement("div");document.body.appendChild(e),e.setAttribute("id","element-observer-rules");var t=window.getComputedStyle(e),n=t.getPropertyValue("font-family");n=n.substring(1,n.length-1);var r=JSON.parse(n);elementQuery.addCssRules(r)})},{"./client/element-list.js":1,"./client/rendering-queue.js":5}]},{},[6]);
  //# sourceMappingURL=index.min.js.map