"use strict";!function(e){var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;function r(e){var r=this;r.target=e||window.document,r.queries={},r.counter=0,r.timer=null,r.paused=!1,r.worker=new t((function(){r.paused||r.schedule()})),r.worker.observe(r.target,{childList:!0,subtree:!0})}r.prototype.watch=function(e,t){var r,n=this;r="string"==typeof e?e:e.selector,e={id:++n.counter,selector:r,callback:t},n.run(e),n.queries[r]=e},r.prototype.forget=function(e){var t="string"==typeof e?e:e.selector;delete this.queries[t]},r.prototype.pause=function(){this.paused=!0},r.prototype.play=function(){this.paused=!1},r.prototype.schedule=function(){var e=this;e.timer&&window.clearTimeout(e.timer),e.timer=window.setTimeout((function(){e.runAll()}),20)},r.prototype.runAll=function(){var t=this;e.each(t.queries,(function(e,r){t.run(r)}))},r.prototype.run=function(t){var r="__observed_"+t.id;e(t.selector).not((function(){return e(this).data(r)})).each(t.callback).each((function(){e(this).data(r,!0)}))},window.JQObserver=window.JQObserver||new r,e.fn.observe=function(e){return window.JQObserver.watch(this,e),this},e.fn.unobserve=function(){return window.JQObserver.forget(this),this},e.fn.livequery||(e.fn.livequery=e.fn.observe,e.fn.expire=e.fn.unobserve)}(jQuery);
