text: function AMgetSupportedProp(t){for(var e=document.documentElement,r=0;r<t.length;r++)if(t[r]in e.style)return t[r]}function AMtoCamelCase(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase().replace("-","")})}function AMscrollTo(t,e,r,o){if(!(0>=e)){var n=t-o[r],s=n/e*10;setTimeout(function(){o[r]=o[r]+s,o[r]!==t&&AMscrollTo(t,e-10,r,o)},10)}}function AMsetProp(t,e,r){setTimeout(function(){r.style[t]=e},10)}function AMpushHandler(t,e,r,o){t.handlers.push({event:e,handler:function(t){var e=am(t.target).closest(r);null!==e&&o.call(e.js[0],t)},attachedTo:r})}window.AutoMagicConstructor=function(){this.selector=null,this.length=0,this.js=null};var AMvendors=["-webkit-","-o-","-moz-","-ms-",""];window.am=am=AutoMagic=window.AutoMagic=function(t){var e=new window.AutoMagicConstructor;e.selector=t;var r;if("undefined"==typeof t)r=[document];else if("object"==typeof t)r="[object Array]"===Object.prototype.toString.call(t)||"[object NodeList]"===Object.prototype.toString.call(t)?t:[t];else{if("string"!=typeof t)return void e.throwError("Invalid selector!");r=document.querySelectorAll(t)}return e.length=r.length,e.js=r,e},am.devMode=!0,window.AutoMagicConstructor.prototype.addClass=function(){for(var t=arguments,e=this.js,r=0,o=e.length;o>r;r++)for(var n=e[r],s=t[0].split(" "),a=0,i=s.length;i>a;a++){var l=s[a];n.className.indexOf(l)<0&&(n.className+=" "+l)}return this},window.AutoMagicConstructor.prototype.after=function(){var t=arguments,e=this.js[0];return e.insertAdjacentHTML("afterend",t[0]),am(e)},window.AutoMagicConstructor.prototype.animate=function(){var t=arguments,e=this.js,r,o=[],n=[],s,a,i,l,u,c;if("number"==typeof t[1]){for(o=[],a=0,i=AMvendors.length;i>a;a++)n=AMvendors[a],o.push(AMtoCamelCase(n+"transition-duration"));r=AMgetSupportedProp(o)}if("string"==typeof t[2]){for(o=[],a=0,i=AMvendors.length;i>a;a++)n=AMvendors[a],o.push(AMtoCamelCase(n+"transition-timing-function"));s=AMgetSupportedProp(o)}for(o=[],a=0,i=AMvendors.length;i>a;a++)n=AMvendors[a],o.push(AMtoCamelCase(n+"transition-property"));var p=AMgetSupportedProp(o);for(u=0,elemsLength=e.length;u<elemsLength;u++){c=e[u],c.style[p]="";var f=0;for(l in t[0])l.indexOf("background")>-1&&(l="background"),l.indexOf("border")>-1&&(l="border"),l.indexOf("fill")>-1&&(l="fill"),l.indexOf("flex")>-1&&(l="flex"),l.indexOf("font")>-1&&(l="font"),l.indexOf("margin")>-1&&(l="margin"),l.indexOf("motion")>-1&&(l="motion"),l.indexOf("outline")>-1&&(l="outline"),l.indexOf("padding")>-1&&(l="padding"),l.indexOf("stroke")>-1&&(l="stroke"),l.indexOf("text")>-1&&(l="text"),0!==f?c.style[p]+=","+l:c.style[p]+=l,f++;"number"==typeof t[1]&&(c.style[r]=t[1]+"ms"),"string"==typeof t[2]&&(c.style[s]=t[2])}var d=[];o=[];for(l in t[0]){for(o=[],a=0,i=AMvendors.length;i>a;a++)n=AMvendors[a],o.push(AMtoCamelCase(n+l));d.push({prop:AMgetSupportedProp(o),value:t[0][l]})}var h=this;for(u=0,elemsLength=e.length,c=e[u];u<elemsLength;u++)for(a=0,propertiesLength=d.length,property=d[a];a<propertiesLength;a++){var g=window.getComputedStyle(c);c.style[property.prop]=g.getPropertyValue(property.prop),AMsetProp(property.prop,property.value,c)}return setTimeout(function(){"function"==typeof t[2]?t[2].call(h.js):"function"==typeof t[3]&&t[3].call(h.js)},t[1]),this},window.AutoMagicConstructor.prototype.append=function(){for(var t=arguments,e=this.js,r=0,o=e.length,n=e[r];o>r;r++)"string"==typeof t[0]?n.insertAdjacentHTML("beforeend",t[0]):n.appendChild(t[0]);return this},window.AutoMagicConstructor.prototype.attr=function(){var t=arguments,e=this.js,r,o,n;if(!(t.length>1))return r=e[0],r.getAttribute(t[0]);for(o=0,n=e.length,r=e[o];n>o;o++)r.setAttribute(t[0],t[1]);return this},window.AutoMagicConstructor.prototype.before=function(){var t=arguments,e=this.js[0];return e.insertAdjacentHTML("beforebegin",t[0]),am(e)},window.AutoMagicConstructor.prototype.closest=function(){var t=arguments;elem=this.js[0];for(var e=elem.matches||elem.webkitMatchesSelector||elem.mozMatchesSelector||elem.msMatchesSelector;elem&&"html"!==elem.tagName.toLowerCase()&&!e.call(elem,t[0]);)elem=elem.parentNode;return"html"==elem.tagName.toLowerCase()?void 0:am(elem)},window.AutoMagicConstructor.prototype.css=function(){var t=arguments,e=this.js,r=[],o=[],n,s,a,i,l,u,c;if("string"==typeof t[0]&&1===t.length)return window.getComputedStyle(e[0]).getPropertyValue(t[0]);if("string"==typeof t[0]&&"string"==typeof t[1]&&2===t.length){for(r=[],l=0,u=AMvendors.length;u>l;l++)n=AMvendors[l],r.push(AMtoCamelCase(n+t[0]));for(o={prop:AMgetSupportedProp(r),value:t[1]},s=0,a=e.length,i=e[s];a>s;s++)c=window.getComputedStyle(i),i.style[t[0]]=c.getPropertyValue(o.prop),AMsetProp(o.prop,o.value,i)}else{for(var p in t[0]){r=[];for(var f=0,d=AMvendors.length;d>f;f++)n=AMvendors[f],r.push(AMtoCamelCase(n+p));o.push({prop:AMgetSupportedProp(r),value:t[0][p]})}for(s=0,a=e.length,i=e[s];a>s;s++)for(l=0,propertiesLength=o.length;l<propertiesLength;l++)property=o[l],c=window.getComputedStyle(i),i.style[property.prop]=c.getPropertyValue(property.prop),AMsetProp(property.prop,property.value,i)}return this},window.AutoMagicConstructor.prototype.data=function(){var t=arguments,e=this.js,r,o,n;if(!(t.length>1)){r=e[0];try{JSON.parse(r.getAttribute("data-"+t[0]))}catch(s){return r.getAttribute("data-"+t[0])}return JSON.parse(r.getAttribute("data-"+t[0]))}for(o=0,n=e.length,r=e[o];n>o;o++)r.setAttribute("data-"+t[0],JSON.stringify(t[1]));return this},window.AutoMagicConstructor.prototype.each=function(){for(var t=arguments,e=this.js,r=0,o=e.length,n=e[r];o>r;r++)t[0].apply(n,[n,r])},window.AutoMagicConstructor.prototype.eq=function(){var t=arguments,e=this.js;return am(e[t[0]])},window.AutoMagicConstructor.prototype.find=function(){var t=arguments,e=this.js;return am(e[0].querySelectorAll(t[0]))},window.AutoMagicConstructor.prototype.has=function(){var t=arguments,e=this.js[0],r=am(t[0]).js[0];if("undefined"==typeof r)return!1;for(var o=r.parentNode;null!==o;){if(o==e)return!0;o=o.parentNode}return!1},window.AutoMagicConstructor.prototype.hasClass=function(){var t=arguments,e=this.js[0];return(" "+e.className+" ").indexOf(" "+t[0]+" ")>-1},window.AutoMagicConstructor.prototype.height=function(){var t=arguments,e=this.js;if(0===t.length)return e[0].clientHeight;if("boolean"==typeof t[0]&&t[0]===!0)return e[0].offsetHeight;if("boolean"==typeof t[0]&&t[0]===!1)return e[0].clientHeight;if("number"==typeof t[0]){for(var r=0,o=e.length,n=e[r];o>r;r++)n.style.height=t[0]+"px";return this}},window.AutoMagicConstructor.prototype.hide=function(){var t=arguments,e=this.js;if(0===t.length)for(var r=0,o=e.length,n=e[r];o>r;r++)n.style.display="none";else setTimeout(function(){for(var t=0,r=e.length,o=e[t];r>t;t++)o.style.display="none"},t[0]);return this},window.AutoMagicConstructor.prototype.html=function(){var t=arguments,e=this.js[0];return 0===t.length?e.innerHTML:(e.innerHTML=t[0],this)},window.AutoMagicConstructor.prototype.index=function(){var t=this.js;if(0===t.length)return-1;for(var e=t[0],r=e.parentNode.childNodes,o=0,n=0;n<r.length;n++){if(r[n]===e)return o;1===r[n].nodeType&&o++}return-1},window.AutoMagicConstructor.prototype.insertAtCaret=function(){var t=arguments,e=this.js,r=e[0],o=r.scrollTop,n=r.selectionStart,s=r.value.substring(0,n),a=r.value.substring(r.selectionEnd,r.value.length);return r.value=s+t[0]+a,n+=t[0].length,r.selectionStart=n,r.selectionEnd=n,r.focus(),r.scrollTop=o,this},window.AutoMagicConstructor.prototype.is=function(){var t=arguments,e=this.js[0];return t.length>0?":checked"===t[0]?e.checked:":disabled"===t[0]?e.disabled:":selected"===t[0]?e.selected:":empty"===t[0]?""===e.value:e===am(t[0]).js[0]:void 0},window.AutoMagicConstructor.prototype.load=function(){var t=arguments,e=this.js[0];return t.length>0&&("function"==typeof t[0]?e.onload=t[0]:"string"==typeof t[0]&&(req=new XMLHttpRequest,req.open("GET",t[0],!0),req.send(null),req.onreadystatechange=function(){if(req.readyState==req.DONE){var r=req.responseText;if(200==req.status)if(e.innerHTML=r,null!==am(e).js[0].querySelector("script")){var o=am(e).js[0].querySelector("script").getAttribute("src");am(e).js[0].querySelector("script").parentNode.removeChild(am(e).js[0].querySelector("script"));var n=document.createElement("script");n.type="text/javascript",n.src=o,n.onload=function(){"undefined"!=typeof t[1]&&t[1]()},e.appendChild(n)}else"undefined"!=typeof t[1]&&t[1]();else(400==req.status||500==req.status)&&am.throwError("Something went wrong!")}})),this},window.AutoMagicConstructor.prototype.next=function(){var t=arguments,e=this.js[0],r=e.nextElementSibling;if(t.length>0)for(var o=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;!o.call(r,t[0])&&null!==r;)r=r.nextElementSibling;return null===r?void am.throwError("Element not found!"):am(r)},window.AutoMagicConstructor.prototype.nextAll=function(){var t=arguments,e=this.js[0],r=e.nextElementSibling,o=[];if(t.length>0)for(var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;null!==r;)n.call(r,t[0])&&o.push(r),r=r.nextElementSibling;else for(;null!==r;)o.push(r),r=r.nextElementSibling;return o.length<1?void am.throwError("Element not found!"):am(o)},window.AutoMagicConstructor.prototype.not=function(){for(var t=arguments,e=[],r=this.js,o=0,n=r.length,s=r[o];n>o;o++){for(var a=!0,i=0,l=am(t[0]).js.length,u=am(t[0]).js[o];l>i;i++)s===u&&(a=!1);a&&e.push(s)}return am(e)},window.AutoMagicConstructor.prototype.off=function(){var t=arguments,e=this.js,r,o,n,s,a,i,l,u;if(0===t.length){for(r=0,o=e.length,n=e[r];o>r;r++)if("undefined"!=typeof n.handlers){for(s=0,a=n.handlers.length;a>s;s++)i=n.handlers[s],n.removeEventListener(i.event,i.handler);n.handlers=[]}}else if(1===t.length&&"string"==typeof t[0])for(r=0,o=e.length,n=e[r];o>r;r++){if(u=null,"undefined"==typeof n.handlers)return void am.throwError("The selected event is not bound!");for(s=0,a=n.handlers.length;a>s;s++)i=n.handlers[s],i.event===t[0]&&(u=i.handler,n.handlers.splice(s,1));if(null===u)return void am.throwError("The selected event is not bound!");n.removeEventListener(t[0],u)}else if(2===t.length&&"string"==typeof t[0]&&"function"==typeof t[1])for(r=0,o=e.length,n=e[r];o>r;r++){for(l=!1,s=0,a=n.handlers.length;a>s;s++)i=n.handlers[s],i.event===t[0]&&i.handler.toString()===t[1].toString()&&(n.handlers.splice(s,1),l=!0);if(!l)return void am.throwError("The selected event is not bound!");n.removeEventListener(t[0],t[1])}else{if(2!==t.length||"string"!=typeof t[0]||"string"!=typeof t[1])return void am.throwError("SyntaxError: Invalid argument/s!");for(r=0,o=e.length,n=e[r];o>r;r++){for(l=!1,s=0,a=n.handlers.length;a>s;s++)i=n.handlers[s],i.event===t[0]&&i.attachedTo===t[1]&&(u=i.handler,n.handlers.splice(s,1),l=!0);if(!l)return void am.throwError("The selected event is not bound!");n.removeEventListener(t[0],u)}}return this},window.AutoMagicConstructor.prototype.offset=function(){var t=arguments,e=this.js[0];if(0===t.length){for(var r=0,o=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)r+=e.offsetLeft-e.scrollLeft,o+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{top:o,left:r}}var n=am(t[0]).js[0];return n.contains(e)&&n!==e?{top:am(e).offset().top-am(n).offset().top,left:am(e).offset().left-am(n).offset().left}:void am.throwError('Illegal Selector: the "relative" element is not an ancestor of the selected element or they are the same.')},window.AutoMagicConstructor.prototype.on=function(){var t=arguments,e=this.js,r,o,n;if(t.length<2)return void am.throwError("SyntaxError: Invalid arguments!");if(2===t.length)for(r=0,o=e.length,n=e[r];o>r;r++)"undefined"==typeof n.handlers&&(n.handlers=[]),n.handlers.push({event:t[0],handler:t[1],attachedTo:""}),n.addEventListener(t[0],t[1]);else for(r=0,o=e.length,n=e[r];o>r;r++)"undefined"==typeof n.handlers&&(n.handlers=[]),AMpushHandler(n,t[0],t[1],t[2]),n.addEventListener(t[0],n.handlers[n.handlers.length-1].handler,!0);return this},window.AutoMagicConstructor.prototype.parent=function(){var t=arguments,e=this.js[0];if(t.length>0){var r=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;return r.call(e,t[0])?am(e.parentNode):void 0}return am(e.parentNode)},window.AutoMagicConstructor.prototype.prepend=function(){for(var t=arguments,e=this.js,r=0,o=e.length,n=e[r];o>r;r++)"string"==typeof t[0]?n.insertAdjacentHTML("afterbegin",t[0]):n.childNodes.length>0?n.insertBefore(t[0],n.firstChild):n.appendChild(t[0]);return this},window.AutoMagicConstructor.prototype.prev=function(){var t=arguments,e=this.js[0],r=e.previousElementSibling;if(t.length>0)for(var o=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;!o.call(r,t[0])&&null!==r;)r=r.previousElementSibling;return null===r?void am.throwError("Element not found!"):am(r)},window.AutoMagicConstructor.prototype.prevAll=function(){var t=arguments,e=this.js[0],r=e.previousElementSibling,o=[];if(t.length>0)for(var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;null!==r;)n.call(r,t[0])&&o.push(r),r=r.previousElementSibling;else for(;null!==r;)o.push(r),r=r.previousElementSibling;return o.length<1?void am.throwError("Element not found!"):am(o)},window.AutoMagicConstructor.prototype.prop=function(){var t=arguments,e=this.js;if(!(t.length>1))return 1===t.length?e[0][t[0]]:void am.throwError("SyntaxError: Please specify a property!");for(var r=0,o=e.length,n=e[r];o>r;r++)n[t[0]]=t[1];return this},window.AutoMagicConstructor.prototype.remove=function(){for(var t=arguments,e=this.js,r=0,o=e.length,n=e[r];o>r;r++)n.parentNode.removeChild(n)},window.AutoMagicConstructor.prototype.removeClass=function(){for(var t=arguments,e=this.js,r=0,o=e.length,n=e[r];o>r;r++)for(var s=t[0].split(" "),a=0,i=s.length;i>a;a++)for(var l=s[a],u=n.className.split(" "),c=0,p=u.length;p>c;c++){var f=u[c];f===l&&(n.className=n.className.replace(l,""))}return this},window.AutoMagicConstructor.prototype.replaceClass=function(){for(var t=arguments,e=this.js,r=0,o=e.length,n=e[r];o>r;r++)n.className=n.className.split(t[0]).join(t[1]);return this},window.AutoMagicConstructor.prototype.scroll=function(){var t=arguments,e=this.js[0];if(0===t.length)return{x:{position:e.scrollLeft,length:e.scrollWidth},y:{position:e.scrollTop,length:e.scrollHeight}};if(1===t.length){if("string"==typeof t[0])return"x"===t[0].toLowerCase()||"left"===t[0].toLowerCase()?{position:e.scrollLeft,length:e.scrollWidth}:"y"===t[0].toLowerCase()||"top"===t[0].toLowerCase()?{position:e.scrollTop,length:e.scrollHeight}:void 0;am.throwError("SyntaxError: Invalid argument!")}else if(2===t.length)if("string"!=typeof t[0]||"number"!=typeof t[1])am.throwError("SyntaxError: Invalid argument!");else if("x"===t[0].toLowerCase()||"left"===t[0].toLowerCase())e.scrollLeft=t[1];else{if("y"!==t[0].toLowerCase()&&"top"!==t[0].toLowerCase())return void 0;e.scrollTop=t[1]}else if("string"!=typeof t[0]||"number"!=typeof t[1]||"number"!=typeof t[2])am.throwError("SyntaxError: Invalid argument!");else if("x"===t[0].toLowerCase()||"left"===t[0].toLowerCase())t[2]<=0?e.scrollLeft=t[1]:AMscrollTo(t[1],t[2],"scrollLeft",e);else{if("y"!==t[0].toLowerCase()&&"top"!==t[0].toLowerCase())return void 0;t[2]<=0?e.scrollTop=t[1]:AMscrollTo(t[1],t[2],"scrollTop",e)}return this},window.AutoMagicConstructor.prototype.show=function(){var t=arguments,e=this.js;switch(typeof t[0]){case"undefined":case"string":for(var r=0,o=e.length,n=e[r];o>r;r++)n.style.display=t[0]||"initial";break;case"number":setTimeout(function(){for(var r=0,o=e.length,n=e[r];o>r;r++)n.style.display=t[1]||"initial"},t[0]);break;default:return void am.throwError("SyntaxError: Invalid argument!")}return this},window.AutoMagicConstructor.prototype.siblings=function(){var t=arguments,e=this.js[0],r=[],o,n,s;if(t.length>0){var a=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;for(o=0,n=e.parentNode.childNodes.length;n>o;o++){var s=e.parentNode.childNodes[o];s!==e&&1===s.nodeType&&a.call(s,t[0])&&r.push(s)}}else for(o=0,n=e.parentNode.childNodes.length,s=e.parentNode.childNodes[o];n>o;o++)s!==e&&1===s.nodeType&&r.push(s);return am(r)},window.AutoMagicConstructor.prototype.text=function(){var t=arguments,e=this.js[0];return 0===t.length?e.innerText:(e.innerText=t[0],am(this.js[0]))},window.AutoMagicConstructor.prototype.toggleClass=function(){for(var t=arguments,e=this.js,r=0,o=e.length,n=e[r];o>r;r++)for(var s=t[0].split(" "),a=0,i=s.length;i>a;a++){var l=s[a];if(n.className.indexOf(l)<0)n.className+=" "+l;else for(var u=n.className.split(" "),c=0,p=u.length;p>c;c++){var f=u[c];f===l&&(n.className=n.className.replace(l,""))}}return this},window.AutoMagicConstructor.prototype.trigger=function(){var t=arguments,e,r=this.js[0];return document.createEvent?(e=document.createEvent("HTMLEvents"),e.initEvent(t[0],!0,!0)):(e=document.createEventObject(),e.eventType=t[0]),e.eventName=t[0],document.createEvent?r.dispatchEvent(e):r.fireEvent("on"+e.eventType,e),this},window.AutoMagicConstructor.prototype.val=function(){var t=arguments,e=this.js[0];return t.length>0?(e.value=t[0],am(this.js[0])):e.value},window.AutoMagicConstructor.prototype.width=function(){var t=arguments,e=this.js;if(0===t.length)return e[0].clientWidth;if("boolean"==typeof t[0]&&t[0]===!0)return e[0].offsetWidth;if("boolean"==typeof t[0]&&t[0]===!1)return e[0].clientWidth;if("number"==typeof t[0]){for(var r=0,o=e.length,n=e[r];o>r;r++)n.style.width=t[0]+"px";return this}if("string"==typeof t[0]){for(var r=0,o=e.length,n=e[r];o>r;r++)n.style.width=t[0];return this}},window.AutoMagic.ajax=function(){var t=arguments,e={async:t[0].async||!0,beforeSend:t[0].beforeSend||function(){},complete:t[0].complete||function(){},contentType:t[0].contentType||"application/x-www-form-urlencoded; charset=UTF-8",data:t[0].data||"",dataType:t[0].dataType||"text",error:t[0].error||function(){},fail:t[0].fail||function(){},headers:t[0].headers||{},method:t[0].method||"POST",stringify:t[0].stringify||!1,success:t[0].success||function(){},timeout:t[0].timeout||0,url:t[0].url||"/"},r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState==XMLHttpRequest.DONE){var t=r.responseText;if("json"===e.dataType)try{t=JSON.parse(r.responseText)}catch(o){t=t}e.complete(t),200==r.status?e.success(t):400==r.status?e.error(r,r.status,r.responseText):e.fail(r,r.status,r.responseText)}};var o="",n;if(e.stringify&&"POST"===e.method){for(n in e.data)o+=String(n)+"="+JSON.stringify(e.data[n])+"&";e.data=o}else{for(n in e.data)o+=String(n)+"="+e.data[n]+"&";e.data=o}if("POST"===e.method?r.open(e.method,e.url,e.async):r.open(e.method,e.url+"?"+e.data,e.async),r.responseType="",r.timeout=e.timeout,r.setRequestHeader("Content-Type",e.contentType),void 0!==e.headers.length)for(n in e.headers)r.setRequestHeader(n,e.headers[n]);e.beforeSend(),"POST"===e.method?r.send(e.data):r.send()},window.AutoMagic.cookie=function(){var t=arguments;if(t.length>1){var e="";if(t[2]){var r=new Date;r.setTime(r.getTime()+24*t[2]*60*60*1e3),e="; expires="+r.toGMTString()}document.cookie=t[0]+"="+JSON.stringify(t[1])+e+"; path=/"}else if(1===t.length){for(var o=t[0]+"=",n=document.cookie.split(";"),s=0;s<n.length;s++){for(var a=n[s];" "==a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(o))return JSON.parse(a.substring(o.length,a.length))}return void 0}},window.AutoMagic.each=function(){var t=arguments;if("[object Array]"===Object.prototype.toString.call(t[0]))for(var e=0,r=t[0].length;r>e;e++){var o=t[0][e];t[1].apply(o,[o,e])}else if("object"==typeof t[0]){var e=0;for(var n in t[0])t[1].apply(t[0][n],[n,t[0][n],e]),e++}else am.throwError("SyntaxError: Please provide an array or an object.")},window.AutoMagic.escapeString=function(){var t=arguments,e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","\\":"&#x5C;"};return String(t[0]).replace(/[&<>"'\/\\]/g,function(t){return e[t]})},document.addEventListener("DOMContentLoaded",function(){window.AutoMagic.ready.fired=!0}),window.AutoMagic.ready=function(){var t=arguments;window.AutoMagic.ready.fired&&t[0]()},window.AutoMagic.replaceAll=function(){var t=arguments;return 3===t.length?t[0].split(t[1]).join(t[2]):void window.AutoMagic.throwError("SyntaxError: Three arguments required!")},window.AutoMagic.state={push:function(){var t=arguments,e=(""===t[0]?"/":t[0])||window.location.pathname;window.history.pushState({content:am(am.state.elem).html()},"",e)},watch:function(){var t=arguments;am.state.elem=t[0],window.onpopstate=function(e){if(e.state){am(t[0]).html(e.state.content);for(var r=t[0],o=am(r).js[0].querySelectorAll("script").length,n=0;o>n;n++){var s=am(r).js[0].querySelectorAll("script")[n].getAttribute("src");am(r).js[0].querySelectorAll("script")[n].parentNode.removeChild(am(r).js[0].querySelectorAll("script")[n]);var a=document.createElement("script");a.type="text/javascript",a.src=s,am(r).js[0].appendChild(a)}}}},elem:""},window.AutoMagic.storage=function(){var t=arguments;if(t.length>1&&""!==t[1])window.localStorage.setItem(t[0],JSON.stringify(t[1]));else{if(!(t.length>1&&""===t[1]))return null!==window.localStorage.getItem(t[0])?JSON.parse(window.localStorage.getItem(t[0])):void 0;window.localStorage.removeItem(t[0])}},window.AutoMagic.throwError=function(){var t=arguments;am.devMode&&console.error(t[0])},window.AutoMagic.trim=function(){var t=arguments;return"string"==typeof t[0]?t[0].split(" ").join(""):void 0},window.AutoMagic.unescapeString=function(){var t=arguments,e={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#x2F;":"/","&#x5C;":"\\"};return String(t[0]).replace(/&amp;|&lt;|&gt;|&quot;|&#39;|&#x2F;|&#x5C;/gi,function(t){return e[t]})};