/* Copyright: Sean Amarasinghe 2016 */ function bindEvent(a,b){var b=b||Mixin.emptyFn;this.elements.forEach(function(c){c.addEventListener(a,b)})}var Dom=function(){"use strict";return function(a){a.constructor!==NodeList?this.elements=[a]:this.elements=a[0]?Array.prototype.slice.call(a):[],this.callee=a.callee,this.selector=a.selector}}();DOM=function(){"use strict";var a={query:function(a){var b,c;return b=Mixin.isObject(a)?a:document.querySelectorAll(a),c=new Dom(b),c.callee="query",c.selector=a,c},get:function(a){var b,c;return b=document.getElementById(a),c=new Dom([b]),c.callee="get",c.selector=a,c},create:function(a){var b,c,d=new DOMParser;return a&&"string"==typeof a&&(b=d.parseFromString(a,"text/xml").firstChild,c=new Dom([b]),c.callee="create"),c}};return a}(),window.$||($=DOM.query);var Mixin=function(){"use strict";var a={get duration(){var a=arguments[0],b=arguments[1],c=arguments[2],d=arguments[3];return"string"==typeof a&&(a="slow"===a?c:"fast"===a?d:b),a},objectFromArray:function(a){var b={};return a.forEach(function(a){b[a]=void 0}),b},isObject:function(a){return"object"==typeof a},slice:function(a){return Array.prototype.slice.call(a)},forEachProperty:function(a,b){var c,d,e=-1;if("object"==typeof a)for(var f in a)a.hasOwnProperty(f)&&(c=f,d=a[f],++e,b.call(this,c,d,e))},emptyFn:function(){}};return a}();!function(){"use strict";DOM.ajax=function(a){var b=new XMLHttpRequest;type=a.type||"POST",url=a.url||"/",data=a.data||"",successFn=a.success||emptyFn,errorFn=optiosn.error||emptyFn,"POST"===type&&(b.open("POST",url,!0),b.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),b.send(data)),"GET"===type&&(b.open("GET",url,!0),b.onload=function(){if(b.status>=200&&b.status<400){b.responseText;successFn(reponse)}else errorFn()},b.onerror=function(){errorFn()},b.send())}}(),function(){"use strict";DOM.param=function(a){var b=Object.keys(a).map(function(b){return encodeURIComponent(b)+"="+encodeURIComponent(a[b])}).join("&");return b}}(),function(){"use strict";DOM.getJSON=function(a){var b=new XMLHttpRequest;type="GET",url=a.url||"/",successFn=a.success||emptyFn,errorFn=optiosn.error||emptyFn,"GET"===type&&(b.open("GET",url,!0),b.onload=function(){var a;b.status>=200&&b.status<400?(a=JSON.parse(b.responseText),successFn(a)):errorFn()},b.onerror=function(){errorFn()},b.send())},DOM.getScript=function(a,b){var c=document.createElement("script"),d=document.getElementsByTagName("script")[0];c.async=1,d.parentNode.insertBefore(c,d),c.onload=c.onreadystatechange=function(a,d){(d||!c.readyState||/loaded|complete/.test(c.readyState))&&(c.onload=c.onreadystatechange=null,c=void 0,d||b&&b())},c.src=a}}(),function(){"use strict";Dom.prototype.hasClass=function(a){return this.elements.some(function(b){return b.classList?b.classList.contains(a):new RegExp("(^| )"+a+"( |$)","gi").test(b.className)})},Dom.prototype.addClass=function(a){return a&&this.elements[0]&&this.elements.forEach(function(b){b.classList?b.classList.add(a):b.className+=" "+a}),new Dom(this.elements)},Dom.prototype.removeClass=function(a){return this.elements.forEach(function(b){a?b.classList?b.classList.remove(a):b.className=b.className.replace(new RegExp("(^|\\b)"+a.split(" ").join("|")+"(\\b|$)","gi")," "):b.className=""}),new Dom(this.elements)},Dom.prototype.toggleClass=function(a){var b,c;return a&&this.elements.forEach(function(d){d.classList?d.classList.toggle(a):(b=d.className.split(" "),c=b.indexOf(a),c>=0?b.splice(c,1):b.push(a),d.className=b.join(" "))}),new Dom(this.elements)}}(),function(){"use strict";function a(a,b){var c,d;return b?("number"==typeof b&&this.elements.forEach(function(c){c.style[a]=b+"px"}),new Dom(this.elements)):(c=this.elements[0])?(d=document.defaultView.getComputedStyle(c),parseInt(d.getPropertyValue(a).split("px")[0])):void 0}Dom.prototype.css=function(a,b){var c=[];return a?(this.elements.forEach(function(d){var e=document.defaultView.getComputedStyle(d);b?d.style[a]=b:c.push(e.getPropertyValue(a))}),b?new Dom(this.elements):"get"===this.callee?c[0]:c):void 0},Dom.prototype.height=function(b){return a.call(this,"height",b)},Dom.prototype.width=function(b){return a.call(this,"width",b)},Dom.prototype.innerWidth=function(){var a=this.elements[0];return a?a.clientWidth:void 0},Dom.prototype.innerHeight=function(){var a=this.elements[0];return a?a.clientHeight:void 0},Dom.prototype.outerWidth=function(a){var b=this.elements[0],c=0;return b?(a&&(c=2*(b.offsetWidth-b.clientWidth)),b.offsetWidth+c):void 0},Dom.prototype.outerHeight=function(a){var b=this.elements[0],c=0;return b?(a&&(c=2*(b.offsetHeight-b.clientHeight)),b.offsetHeight+c):void 0},Dom.prototype.offset=function(){var a,b=this.elements[0];return b?(a=el.getBoundingClientRect(),{top:a.top+document.body.scrollTop,left:a.left+document.body.scrollLeft}):void 0},Dom.prototype.position=function(){var a=this.elements[0];return a?{top:a.offsetTop,left:a.offsetLeft}:void 0},Dom.prototype.scrollLeft=function(a){var b=this.elements[0];return b?(a&&(b.scrollLeft=a),b.scrollLeft):void 0},Dom.prototype.scrollTop=function(a){var b=this.elements[0];return b?(a&&(b.scrollTop=a),b.scrollTop):void 0}}(),function(){"use strict";Dom.data=function(){var a,b,c,d,e=Mixin.slice(arguments),f="data-dom-";return 3===e.length&&(b=e[0],c=e[1],d=e[2],b.setAttribute(f+c,d)),2===e.length&&(b=e[0],a=e[1],Mixin.forEachProperty(a,function(a,c){b.setAttribute(f+a,c)})),1===e.length?(c=e[0],d=f+c,b=document.querySelector("["+d+"]"),b.getAttribute(d)):void 0},Dom.prototype.data=function(){var a,b,c,d=Mixin.slice(arguments),e="data-dom-";if(1===d.length&&(a=d[0]),2===d.length&&(b=d[0],c=d[1]),b&&this.elements.forEach(function(a){a.setAttribute(e+b,c)}),a)for(var f in a)a.hasOwnProperty(f)&&this.elements.forEach(function(b){b.setAttribute(e+f,a[f])})},Dom.prototype.removeData=function(){var a,b=Mixin.slice(arguments),c="string"==typeof b[0],d="object"==typeof b[0],e="data-dom-",f=this.elements;c?a=[b[0]]:d&&(a=b[0]),a&&a.forEach(function(a){f.forEach(function(b){b.removeAttribute(e+a)})})}}(),function(){"use strict";Dom.prototype.hide=function(){this.elements.forEach(function(a){a.style.display="none"})},Dom.prototype.show=function(){this.elements.forEach(function(a){a.style.display="block"})},Dom.prototype.toggle=function(){var a;this.elements.forEach(function(b){a=b.style.display,b.style.display="block"===a?"none":"block"})}}(),function(){"use strict";function a(a){var b,c,d=new Date,c=setInterval(function(){var e=new Date-d,f=e/a.duration;f>1&&(f=1),b=a.delta(f),a.step(b),1===f&&clearInterval(c)},a.delay||10)}Dom.prototype.animate=function(b,c,d,e){return this.elements.forEach(function(e){if(b)for(var f in b)b.hasOwnProperty(f)&&(c=Mixin.duration(c,400,150,400),a({delay:10,duration:c||400,delta:function(a){if(d)for(var b in d)switch(d[b]){case"easeIn":a=1-Math.sin(Math.acos(a));break;case"easeOut":a=1-delta(1-a);break;case"easeInOut":a=.5>a?delta(2*a)/2:(2-delta(2*(1-a)))/2}return a},step:function(a){var c=e.style[f].split("px")[0],d=b[f]*a,g=b[f];g>c&&d>c?e.style[f]=b[f]*a+"px":c>g&&(e.style[f]=c-b[f]*a+"px")}}))}),new Dom(this.elements)}}(),function(){"use strict";function a(a,c,d){b(a,c,"0"!==a.style.opacity?"out":"in",d)}function b(a,b,c,d){var e,f,g,h,i=a.style,j=10,k=1e3,b=b||100,l=k/j;a.opacity;if(10>b&&(b=10),b=Mixin.duration(b,100,150,50),f=b/j,"in"===c){if("1"===i.opacity)return;e=0,g=1,i.opacity="0",h=g/f}else{if("0"===i.opacity)return;e=1,g=0,h=e/f}var m=function(){"in"===c?(e+=h,i.opacity=e,g>e?setTimeout(m,l):(i.opacity="1",d&&d())):(e-=h,i.opacity=e,e>g?setTimeout(m,l):(i.opacity="0",d&&d()))};m()}Dom.prototype.fadeIn=function(a,c){return this.elements.forEach(function(d){b(d,a,"in",c)}),new Dom(this.elements)},Dom.prototype.fadeOut=function(a,c){return this.elements.forEach(function(d){b(d,a,"out",c)}),new Dom(this.elements)},Dom.prototype.fadeToggle=function(b,c){return this.elements.forEach(function(d){a(d,b,c)}),new Dom(this.elements)}}(),function(){"use strict";function a(a,c,d){b(a,c,0!==a.offsetHeight?"up":"down",d)}function b(a,b,c,d){var e,f,g,h,i=a.style,j=10,k=1e3,b=b||400,l=k/j,m=a.offsetHeight;if(10>b&&(b=10),b=Mixin.duration(b,400,600,200),f=b/j,"down"===c){if(0!==m)return;e=0,g=i.height.split("px")[0],i.display="block",i.height="0px",h=g/f}else{if(0===m)return;e=m,g=0,h=e/f}var n=function(){"down"===c?(e+=h,i.height=e+"px",g>e?setTimeout(n,l):d&&d()):(e-=h,i.height=e+"px",e>g?setTimeout(n,l):(i.display="none",i.height=m+"px",d&&d()))};n()}Dom.prototype.slideDown=function(a,c){var d=[];return this.elements.forEach(function(d){b(d,a,"down",c)}),new Dom(d)},Dom.prototype.slideUp=function(a,c){var d=[];return this.elements.forEach(function(d){b(d,a,"up",c)}),new Dom(d)},Dom.prototype.slideToggle=function(b,c){var d=[];return this.elements.forEach(function(d){a(d,b,c)}),new Dom(d)}}(),function(){"use strict";Dom.prototype.resize=function(a){a&&this.elements.forEach(function(b){b.addEventListener("resize",a,!1)})},Dom.prototype.scroll=function(a){a&&this.elements.forEach(function(b){b.addEventListener("scroll",a)})}}(),function(){"use strict";Dom.prototype.ready=function(a){"loading"!=document.readyState?a():document.addEventListener("DOMContentLoaded",a)},Dom.prototype.load=function(a){a&&this.elements.forEach(function(b){b.addEventListener("load",a)})},Dom.prototype.unload=function(a){a&&this.elements.forEach(function(b){b.addEventListener("unload",a)})}}(),function(){"use strict";DOM.Event=function(a){return new Event(a)}}(),function(){"use strict";Dom.prototype.bind=function(a,b){a&&b&&this.elements.forEach(function(c){c.addEventListener(a,b,!1)})},Dom.prototype.delegate=function(a,b,c){this.on(b,a,c)},Dom.prototype.off=function(a,b,c){var d,c=c||Mixin.emptyFn,a=a?this.selector+" "+a:this.selector;d=b?document.querySelectorAll(a):this.elements,Mixin.slice(d).forEach(function(a){b?a.removeEventListener(b,c,!1):a.removeEventListener()})},Dom.prototype.on=function(){var a,b,c=arguments.length,d=arguments[0],e=Mixin.emptyFn;3===c?(e=arguments[2],b=arguments[1]):2===c&&(e=arguments[1]),d&&(a=3===c?document.querySelectorAll(this.selector+" "+b):this.elements,a.length>0&&Mixin.slice(a).forEach(function(a){a.addEventListener(d,e,!1)}))},Dom.prototype.one=function(a,b,c){var d,c=c||Mixin.emptyFn;b&&a&&(d=document.querySelectorAll(this.selector+" "+b),d.length>0&&Mixin.slice(d).forEach(function(b){b.addEventListener(a,function d(a){return a.target.removeEventListener(a.type,d),c(a)},!1)}))},Dom.prototype.trigger=function(a){var b=new Event(a);this.elements.forEach(function(a){a.dispatchEvent(b)})},Dom.prototype.unbind=function(a,b){a&&b&&this.elements.forEach(function(c){c.removeEventListener(a,b,!1)})},Dom.prototype.undelegate=function(a,b,c){this.off(a,b,c)}}(),function(){"use strict";Dom.prototype.blur=function(a){bindEvent.call(this,"blur",a)},Dom.prototype.change=function(a){bindEvent.call(this,"change",a)},Dom.prototype.focus=function(a){bindEvent.call(this,"focus",a)},Dom.prototype.focusin=function(a){bindEvent.call(this,"focusin",a)},Dom.prototype.focusout=function(a){bindEvent.call(this,"focusout",a)},Dom.prototype.select=function(a){bindEvent.call(this,"select",a)},Dom.prototype.submit=function(a){bindEvent.call(this,"submit",a)}}(),function(){"use strict";Dom.prototype.keydown=function(a){a&&bindEvent.call(this,"keydown",a)},Dom.prototype.keypress=function(a){a&&bindEvent.call(this,"keypress",a)},Dom.prototype.keyup=function(a){a&&bindEvent.call(this,"keyup",a)}}(),function(){"use strict";Dom.prototype.click=function(a){this.elements.forEach(function(b){b.onclick=a})},Dom.prototype.dblclick=function(a){this.elements.forEach(function(b){b.ondblclick=a})},Dom.prototype.hover=function(a){this.elements.forEach(function(b){b.onmouseover=a,b.onmouseout=a})},Dom.prototype.mouseenter=function(a){this.elements.forEach(function(b){b.onmouseover=a})},Dom.prototype.mouseleave=function(a){this.elements.forEach(function(b){b.onmouseout=a})},Dom.prototype.mousedown=function(a){this.elements.forEach(function(b){b.onmousedown=a})},Dom.prototype.mousemove=function(a){this.elements.forEach(function(b){b.onmousemove=a})},Dom.prototype.mouseout=function(a){this.elements.forEach(function(b){b.onmouseout=a})},Dom.prototype.mouseover=function(a){this.elements.forEach(function(b){b.onmouseover=a})},Dom.prototype.mouseup=function(a){this.elements.forEach(function(b){b.onmouseup=a})}}(),function(){"use strict";Dom.prototype.pushStack=function(a){return a&&a.forEach(function(a){this.elements.push(a)}.bind(this)),new Dom(this.elements)}}(),function(){"use strict";Dom.prototype.attr=function(a,b){var c=[];return a&&this.elements.length>0&&(this.elements.forEach(function(d){b?d.setAttribute(a,b):c.push(d.getAttribute(a))}),!b)?"get"===this.callee?c[0]:c:void 0}}(),function(){"use strict";Dom.prototype.clone=function(){var a=[];return this.elements.forEach(function(b){a.push(b.cloneNode(!0))}),new Dom(a)}}(),function(){"use strict";Dom.prototype.append=function(a){var b,c,d,e,f;a&&(b=this.elements,b.forEach(function(b,g){if("string"==typeof a){for(d=document.createDocumentFragment(),e=document.createElement("body"),e.innerHTML=a;f=e.firstElementChild;)d.appendChild(f);b.appendChild(d)}else c=a.elements,c.forEach(function(a){b.appendChild(a)})}))}}(),function(){"use strict";Dom.prototype.html=function(){var a=[];return this.elements.forEach(function(b){a.push(b.outerHTML)}),"get"===this.callee?a[0]:a},Dom.prototype.text=function(a){var b=[];return a?void this.elements.forEach(function(b){b.innerText=a}):(this.elements.forEach(function(a){b.push(a.innerText)}),"get"===this.callee?b[0]:b)},Dom.prototype.prepend=function(a){var b,c;a&&(b=this.elements,b.forEach(function(b,d){"string"==typeof a?b.insertAdjacentHTML("afterbegin",a):(c=a.elements,c.forEach(function(a){b.insertAdjacentHTML("afterbegin",a)}))}))}}(),function(){"use strict";Dom.prototype.empty=function(){this.elements.forEach(function(a){a.outerHTML=null})},Dom.prototype.remove=function(){this.elements.forEach(function(a){a.parentNode.removeChild(a)})},Dom.prototype.detach=function(){var a=[];return this.elements.forEach(function(b){a.push(b),b.parentNode.removeChild(b)}),a},Dom.prototype.unwrap=function(){var a;this.elements.forEach(function(b){a=b.parentNode,a.outerHTML=b.outerHTML})}}(),function(){"use strict";Dom.prototype.replaceWith=function(a){a&&this.elements.forEach(function(b){b.outerHTML=a[0].outerHTML})},Dom.prototype.replaceAll=function(a){var b,c;"create"===this.callee&&(b=this.elements[0],c=DOM.query(a),c.elements.forEach(function(a){a.outerHTML=b.outerHTML}))}}(),function(){"use strict";Dom.prototype.get=function(a){return void 0!=a?this.elements[a]:this.elements},Dom.prototype.index=function(a){return a?this.elements.indexOf(a):void 0},Dom.prototype.toArray=function(){return this.elements}}(),function(){"use strict";function a(){return b().split(" ")[0]}function b(){var a,b=navigator.userAgent,c=b.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(c[1])?(a=/\brv[ :]+(\d+)/g.exec(b)||[],"IE "+(a[1]||"")):"Chrome"===c[1]&&(a=b.match(/\b(OPR|Edge)\/(\d+)/),null!=a)?a.slice(1).join(" ").replace("OPR","Opera"):(c=c[2]?[c[1],c[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(a=b.match(/version\/(\d+)/i))&&c.splice(1,1,a[1]),c.join(" "))}var c="Chrome",d="Firefox",e="IE",f="Opera",g="Safari";DOM.isChrome=function(){return a()===c},DOM.isFirefox=function(){return a()===d},DOM.isIE=function(){return a()===e},DOM.isOpera=function(){return a()===f},DOM.isSafari=function(){return a()===g},DOM.detectBrowser=function(){return b()}}(),function(){"use strict";var a=window.navigator.platform,b="MacIntel",c="Linux",d="Win32";DOM.isMac=function(){return a===b},DOM.isLinux=function(){return a===c},DOM.isWindows=function(){return a===d}}(),function(){"use strict";Dom.prototype.first=function(){var a=this.elements,b=a?a[0]:this[0];return new Dom([b])},Dom.prototype.last=function(){var a=this.elements,b=a?a[this.elements.length-1]:this[this.length-1];return new Dom([b])},Dom.prototype.eq=function(a){var b;return a?(b=0>a?this.elements.length:0,new Dom([this.elements[b+a]])):void 0},Dom.prototype.map=function(a){a&&this.elements.map(function(b){a.call(b)})},Dom.prototype.has=function(a){return a?this.elements.some(function(b){return Array.prototype.slice.call(b.childNodes).some(function(b){return b.parentNode.querySelectorAll(a).length>0})}):void 0},Dom.prototype.is=function(a){var b;return a?(b=document.querySelectorAll(a),this.elements.some(function(a){return Array.prototype.slice.call(b).some(function(b){return a.isEqualNode(b)})})):void 0},Dom.prototype.filter=function(a){var b=[];return a&&this.elements.forEach(function(c){c.parentNode.querySelectorAll(a).length>0&&b.push(c)}),new Dom(b)},Dom.prototype.slice=function(a,b){var c=[],a=a||1,b=b||this.elements.length;return this.elements.forEach(function(d,e){e+2>a&&b>e&&c.push(d)}),new Dom(c)},Dom.prototype.getEl=function(){var a=this.elements;return a?a[0]:void 0}}(),function(){"use strict";Dom.prototype.add=function(a){var b,c=[];return this.elements.forEach(function(d){b=document.createElement(a),c.push(d.append(b))}),new Dom([b])},Dom.prototype.not=function(a){var b=[];return this.elements.forEach(function(c){c.parentNode.querySelector(a)!==c&&b.push(c)}),new Dom(b)},Dom.prototype.each=function(a){a&&this.elements.forEach(function(b,c){a(c)})}}(),function(){"use strict";function a(a,b,c,d){var e,f,g=[],a=a||"next",h="get"===this.callee?"#":"",i=document.querySelector(h+this.selector);if(e="next"===a?i.nextElementSibling:i.previousElementSibling)do if(f=d?b&&e.outerHTML.indexOf(b)>-1?void 0:e:b?e.outerHTML.indexOf(b)>-1?e:void 0:e,f&&g.push(f),d&&e.outerHTML.indexOf(d)>-1)break;while(!c&&(e=e.nextElementSibling));return new Dom(g)}function b(a){var b,c=[];b=this.elements[0].parentNode.firstChild;do b=a?b.outerHTML.indexOf(a)>-1?b:void 0:b,b!==this.elements[0]&&c.push(b);while(b=b.nextElementSibling);return new Dom(c)}function c(a){for(var b,c=[],d=this.elements[0].parentNode.childNodes[1],e=!1;!e&&d&&a;){do{if(e=d.outerHTML.indexOf(a)>-1,e&&d!==this.elements[0]){c.push(d);break}b=d}while(d=d.nextElementSibling);d=b.parentNode}return new Dom(c)}function d(a,b,c,d){var e,f,g=[];return this.elements.forEach(function(h){e=h.parentNode;do{if(c&&null!==e.querySelector(c))break;a?null!==e.querySelector(a)&&g.push(e):d?(f=e.style.position,(f.indexOf("absolute")>-1||f.indexOf("relative")>-1||f.indexOf("fixed")>-1)&&g.push(e)):g.push(e)}while(!b&&(e=e.parentNode))}),new Dom(g)}Dom.prototype.children=function(){var a=[];return this.elements.forEach(function(b){Array.prototype.slice.call(b.children).forEach(function(b){a.push(b)})}),new Dom(a)},Dom.prototype.find=function(a){var b;return a&&(b=document.querySelectorAll(this.selector+" "+a)),new Dom(b)},Dom.prototype.parent=function(a){return d.call(this,a,!0)},Dom.prototype.parents=function(a){return d.call(this,a)},Dom.prototype.offsetParent=function(a){return d.call(this,void 0,!0,!0)},Dom.prototype.parentsUntil=function(a){return d.call(this,void 0,void 0,a)},Dom.prototype.closest=function(a){return c.call(this,a)},Dom.prototype.next=function(b){return a.call(this,"next",b,!0)},Dom.prototype.prev=function(b){return a.call(this,"prev",b,!0)},Dom.prototype.nextAll=function(b){return a.call(this,"next",b)},Dom.prototype.prevAll=function(b){return a.call(this,"prev",b)},Dom.prototype.nextUntil=function(b){return a.call(this,"next",b,!1,!0)},Dom.prototype.prevUntil=function(b){return a.call(this,"prev",b,!1,!0)},Dom.prototype.siblings=function(a){return b.call(this,a)}}(),function(){"use strict";DOM.contains=function(a,b){var c,d;return a&&b?a.elements&&b.elements?(c=a.elements[0],d=b.elements[0],c!==d&&c.contains(d)):a!==b&&a.contains(b):void 0},DOM.extend=function(a){var a=a||{};return Array.prototype.slice.call(arguments).forEach(function(b,c){var d=b;if(d)for(var e in d)d.hasOwnProperty(e)&&("object"==typeof d[e]?DOM.extend(a[e],d[e]):a[e]=d[e])}),a},DOM.inArray=function(a,b){return a&&b?b.indexOf(a):void 0},DOM.isArray=function(a){return a?Array.isArray(a):void 0},DOM.isEmptyObject=function(a){if(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}},DOM.isFunction=function(a){return a?"function"==typeof a:void 0},DOM.isPlainObject=function(a){return a?"[object Object]"===Object.prototype.toString.call(a):void 0},DOM.isWindow=function(a){if(a){var b=Object.prototype.toString.call(a);return"[object global]"===b||"[object Window]"===b||"[object DOMWindow]"===b}},DOM.isXMLDoc=function(a){var b;return a?(b=(a?a.ownerDocument||a:0).documentElement,b?"HTML"!==b.nodeName:!1):void 0},DOM.makeArray=function(a){return a?Array.prototype.slice.call(a):void 0},DOM.map=function(a,b){var a=a||[];return b?(a=Array.prototype.slice.call(a),a.map(b)):void 0},DOM.merge=function(a,b){return a&&b&&Array.isArray(a)?a.concat(b):void 0},DOM.noop=function(){},DOM.now=function(){return(new Date).getTime()},DOM.parseHTML=function(a){var b;return a?(b=document.implementation.createHTMLDocument(),b.body.innerHTML=a,b.body.children):void 0},DOM.parseJSON=function(a){return a?JSON.parse(a):void 0},DOM.parseXML=function(a){var b,c;return a?(window.DOMParser?(b=new DOMParser,c=b.parseFromString(a,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a)),c):void 0},DOM.proxy=function(a,b){a&&b&&a.bind(b)},DOM.queue=function(){var a=[],b=Array.prototype.slice.call(arguments);return b.forEach(function(b){a.push(b)}),a},DOM.dequeue=function(a){return a?a.pop():void 0},DOM.globalEval=function(a){a&&window.eval.call(window,a)},DOM.grep=function(a,b){var c=[];return a&&b?(a.forEach(function(a){b(a)&&c.push(a)}),c):void 0},DOM.trim=function(a){return a&&"string"==typeof a?a.trim():void 0},DOM.unique=function(a){var b=[];return a&&Array.isArray(a)&&a.forEach(function(a){-1===b.indexOf(a)&&b.push(a)}),b}}();