!function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("pitApp",["require","exports","angularAnimate","angular"],e)}(function(e,t){function n(t,n,o){var i=!1,a=this,u={stack:{},ready:{bootstrap:!1},on:function(e,t){this.ready[e]?t():(this.stack[e]||(this.stack[e]=[]),this.stack[e].push(t))},trigger:function(e){if(this.stack[e])for(var t in this.stack[e]){var n=this.stack[e][t];try{n()}catch(e){}}this.ready[e]||(this.ready[e]=!0)}};this.eventBind=function(e,t){u.on(e,t)},this.eventTrigger=function(e){u.trigger(e)};var c={};this.data=function(e,t){return t?("delete"==t?delete c[e]:c[e]=t,a):!!c[e]&&c[e]};var s={},f={};this.registerScope=function(e,t,n){if(s[e]={scope:t,args:n||[]},f[e])for(var o in f[e])f[e][o]&&r.isFunction(f[e][o])&&(f[e][o].apply(s[e].scope,s[e].args),f[e][o].prototype.once&&delete f[e][o])},this.whenScope=function(e,t,n){f[e]||(f[e]=[]),n&&(t.prototype.once=!0),f[e].indexOf(t)<0&&f[e].push(t)},this.forScope=function(e,t){if(s[e])try{s[e].scope.$applyAsync(function(){t.apply(s[e].scope,s[e].args)})}catch(t){console.log("$scope "+e+" not available, action ignored."),console.log(t)}else console.log("$scope "+e+" not available, action ignored.")},this.offScope=function(e,t){t?f[e]&&f[e].indexOf(t)>-1&&f[e].splice(f[e].indexOf(t),1):f[e]&&delete f[e]},this.scopeApply=function(e,t){t||(t=function(){}),e.$applyAsync(function(){t.call(e)})},this.moduleLoad=null,this.pageInjector=null,this.register=null,this.bootstrap=null,this.angular=r.module(t,n.concat(["ngAnimate"])),this.angular.factory("$locationParams",function(){var e,t;return{params:{get from_url(){return e},get to_url(){return t}},setParams:function(n,r){e=r,t=n}}}).run(["$rootScope","$templateCache","$q","$http","$injector",function(t,n,o,i,u){a.moduleLoad=function(t,o){o=o||{};var i={js:o.js||"js/modules/"+t,html:void 0!==o.html?o.html:"views/modules/"+t,css:void 0!==o.css?o.css:"css/modules/"+t,success:o.success||r.noop,failed:o.failed||r.noop,skiptemplatecache:o.skiptemplatecache||!1},a={css:!1,html:!1,js:!1,ctrl:null},u=t+".mode",c=function(e){r.extend(a,e),a.js&&a.css&&a.html&&(i.html?s(i.skiptemplatecache?u:n.get(u)?u:null,a.ctrl,i.skiptemplatecache?e.htmltpl:null):s(a.ctrl))},s=i.success||r.noop,f=i.failed||r.noop,l=function(){var t=i.html;t.indexOf(".html")!==t.length-".html".length&&(t+=".html");var r=requirejs.s.contexts._.config;(r.map["*"]&&r.map["*"][i.html]||r.paths[i.html])&&!e.specified("text!"+t)&&(t=i.html),e(["text!"+t],function(e){i.skiptemplatecache||n.put(u,e),c({html:!0,htmltpl:i.skiptemplatecache?e:null})},function(e){c({html:!0}),console.error(e)})};e([i.js],function(e){c({js:!0,ctrl:e||null}),n.get(u)&&!i.skiptemplatecache||!i.html?c({html:!0}):l()},function(e){console.error(e),f(e.xhr)}),i.css?e(["css!"+i.css],function(e){c({css:!0})},function(e){c({css:!0})}):c({css:!0})},a.pageInjector=u}]).config(["$controllerProvider","$compileProvider","$filterProvider","$animateProvider","$provide",function(e,t,n,r,o){a.register={controller:function(t,n){var r=n;return e.register(t,r),a},directive:function(e,n){return t.directive(e,n),a},filter:function(e,t){return n.register(e,t),a},factory:function(e,t){return o.factory(e,t),a},service:function(e,t){return o.service(e,t),a},constant:function(e,t){return o.constant(e,t),a},value:function(e,t){return o.value(e,t),a},animation:function(e,t){return r.register(e,t),a},provider:function(e,t){return o.provider(e,t),a}}}]).config(["$animateProvider",function(e){e.classNameFilter(/ng-animate-enabled/)}]),a.bootstrap=function(){i||(r.bootstrap(document,[t]),u.trigger("bootstrap"),i=!0)},o||i||a.bootstrap()}var r=e("angular");return n}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd&&define("polyfills",["require","exports"],e)}(function(e,t){function n(e){return m(e)?e[e.length-1]:null}function r(e){if(!q(e)&&!m(e))return e;var t=!m(e),n=t?{}:[],o=0,i=0;if(t){var a=G(e);for(i=a.length;o<i;o++){var u=a[o];n[u]=r(e[u])}}else for(i=e.length;o<i;o++)n[o]=r(e[o]);return n}function o(e,t,n,r,o){t=!isNaN(t=Math.abs(t))&&t>0?Math.pow(10,t):1,n=void 0!==n?n:"$",r=r||",",o=o||".";var i=e<0?"-":"",a=parseInt(e=Math.round(Math.abs(+e||0)*t)/t,10)+"",u=(u=a.length)>3?u%3:0,c=n+i+(u?a.substr(0,u)+r:"")+a.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+r);return t>1&&Math.round(Math.abs(e-a)>0)&&(c+=o+(Math.round(Math.abs(e-a)*t)/t).toString().substring(2)),c}function i(e,t){void 0===e&&(e="");var n,r=function(e,t){return e=parseInt(e,10).toString(16),t<e.length?e.slice(e.length-t):t>e.length?Array(t-e.length+1).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=e,n+=r(parseInt((new Date).getTime()/1e3,10),8),n+=r(this.php_js.uniqidSeed,5),t&&(n+=(10*Math.random()).toFixed(8).toString()),n}function a(e,t){try{return e()}catch(e){return C(t)?t(e):void 0}}function u(e){return void 0===e||null===e||void 0===e}function c(e){return!!u(e)||(m(e)?T(e):E(e)?N(e):Z(e)?0==e:q(e)?G(e).length<=0:!e)}function s(e,t){var n=!1;return d(t,function(t){if(e===t)return n=!0,!1}),n}function f(e,t){var n,r,o,i=e,a=t,u=i,c=a,s=/(\.0)+[^\.]*$/;for(u=(u+"").replace(s,"").split("."),c=(c+"").replace(s,"").split("."),o=Math.min(u.length,c.length),n=0;n<o;n++)if(0!==(r=parseInt(u[n],10)-parseInt(c[n],10)))return r;return u.length-c.length}function l(e){var t=e+"=";if(document.cookie)for(var n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return unescape(o.substring(t.length,o.length))}}function p(e,t,n){var r;if(0===n)r='expires=""';else{n||(n=0);var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3),r="expires="+o.toUTCString()}document.cookie=e+"="+t+"; "+r+"; path=/; domain=."+document.domain+"; secure"}function h(){return!1!==navigator.cookieEnabled&&(document.cookie="testcookie=1",-1!=document.cookie.indexOf("testcookie"))}function g(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].indexOf(navigator.platform)||(navigator.userAgent.includes("Mac")&&"ontouchend"in document)>-1}var m=function(e){return Array.isArray?Array.isArray(e):e&&"[object Array]"===Object.prototype.toString.call(e)},d=function(e,t,n,r){if(!m(e))throw new TypeError("forEach called on a non-array type value. The given value is "+typeof e);var o;if(n||(n=e),r)for(var i=e.length,a=i-1;a>=0&&("boolean"!=typeof(o=t.call(n,e[a],a,e))||o);a--);else for(var a=0,i=e.length;a<i&&("boolean"!=typeof(o=t.call(n,e[a],a,e))||o);a++);},v=function(e,t){if(Array.prototype.filter)return Array.prototype.filter.call(e,t);for(var n=[],r=0,o=e.length;r<o;r++)t(e[r])&&n.push(e[r]);return n},y=function(e,t){if(Array.prototype.map)return Array.prototype.map.call(e,t);for(var n=[],r=0,o=e.length;r<o;r++)n.push(t(e[r]));return n},b=function(e,t,n){if(!m(e))throw new TypeError("Array.some called on a non-array type value. The given value is "+typeof e);if(!C(t))throw new TypeError("Iterator of Array.some is not a function. The given value is "+typeof t);if(n||(n=e),Array.prototype.some)return Array.prototype.some.call(e,t,n);for(var r=Object(e),o=r.length>>>0,i=0;i<o;i++)if(i in r&&t.call(n,r[i],i,r))return!0;return!1},w=function(e,t,n){if(!m(e))throw new TypeError("Array.groupBy called on a non-array type. The given value is "+typeof e);var r=e.reduce(function(e,r){var o=r[t];return e[o]=e[o]||[],e[o].push(r),n&&n(r,e[o]),e},{}),o=[];return Y(r,function(e){o.push(e)}),o},O=function(e,t){if(!m(e))throw new TypeError("Array.findIndex called on a non-array type. The given value is "+typeof e);if(Array.prototype.findIndex)return Array.prototype.findIndex.call(e,t);for(var n,r=-1,o=0,i=e.length;o<i;o++)if("boolean"==typeof(n=t(e,e[o],o,e))&&n){r=o;break}return r},x=function(e,t){if(!m(e))throw new TypeError("Array.pushUnique called on a non-array type. The given value is "+typeof e);e.indexOf(t)<0&&e.push(t)},T=function(e){return m(e)?e.length<1:null},j=function(e){return!!m(e)&&!T(e)},S=function(e){return String.prototype.trimLeft?String.prototype.trimLeft.call(e):e.replace(/^\s+/,"")},k=function(e){return String.prototype.trimRight?String.prototype.trimRight.call(e):e.replace(/\s+$/,"")},I=function(e){return String.prototype.trim?String.prototype.trim.call(e):e.replace(/^\s+|\s+$/gm,"")},M=function(e,t){var n=Array.prototype.slice.call(arguments);return n.shift().replace(/\{(\d+)\}/g,function(e,t){return void 0!==n[t]&&null!==n[t]?n[t]:e})},A=function(e,t,n){return E(e)&&!N(e)?e+(t?" ":""):n||""},E=function(e){return"string"==typeof e},N=function(e){return!E(e)||""==e.replace(/\s/g,"")},_=function(e){if(E(e))return e.replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substring(1).toLowerCase()})},D=function(e,t,n){if(E(e))return"b"!="ab".substring(-1)?String.prototype.substr.call(e,t<0?e.length+t:t,n):String.prototype.substr.call(e,t,n);throw new TypeError("String.substr called on a non-string. The given value is "+typeof e)},$=function(e,t,n){if(!E(e))throw new TypeError("String.includes called on a non-string");return String.prototype.includes?String.prototype.includes.call(e,t,n):("number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n))},F=function(e,t){if(!E(e))throw new TypeError("Contains called on a non-string. The given value is "+typeof e);if(!m(t))return!1;var n=!1;return d(t,function(t){return!E(t)||($(e,t)?(n=!0,!1):void 0)}),n},J=function(e){if(!E(e))throw new TypeError("String.splitCamel called on a non-string. The given value is "+typeof e);return e.replace(/([A-Z])/g," $1").replace(/^./,function(e){return e.toUpperCase()})},P=function(e){if(!E(e))throw new TypeError("String.digits called on a non-string. The given value is "+typeof e);return I(e).replace(/[^0-9]/g,"")},C=function(e){return"function"==typeof e},q=function(e){return null!==e&&"object"==typeof e&&!m(e)},U=function(e,t){var n=JSON.parse(JSON.stringify(e));if(!q(e)||!q(t))throw new TypeError("First or second argument is not an plain object");return d(G(t),function(r){q(t[r])?n[r]=U(e[r]||{},t[r]):n[r]=t[r]}),n},K=function(e){return r(e)},L=function(e,t){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");if("function"==typeof Object.assign)return Object.assign.apply(this,arguments);for(var n=Object(e),r=1;r<arguments.length;r++){var o=arguments[r];if(void 0!==o&&null!==o)for(var i=Object.keys(Object(o)),a=0,u=i.length;a<u;a++){var c=i[a],s=Object.getOwnPropertyDescriptor(o,c);void 0!==s&&s.enumerable&&(n[c]=o[c])}}return n},G=function(){var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],r=n.length;return function(o){if("function"==typeof Object.keys)return Object.keys(o);if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError("Object.keys called on non-object. The given value is "+typeof o);var i=[];for(var a in o)e.call(o,a)&&i.push(a);if(t)for(var u=0;u<r;u++)e.call(o,n[u])&&i.push(n[u]);return i}}(),Y=function(e,t,n){var r,o=n||e;if(!q(e))throw new TypeError("Object.forEach called on non-object. The given value is "+typeof e);if(!C(t))throw new TypeError("The given iterator is not a function");for(var i in e)if((!C(e.hasOwnProperty)||e.hasOwnProperty(i))&&"boolean"==typeof(r=t.apply(o,[e[i],i]))&&!r)break},R=function(){return"function"!=typeof Object.create?function(e){var t=function(){};return function(e,n){if(e!==Object(e)&&null!==e)throw TypeError("Argument must be an object, or null");t.prototype=e||{};var r=new t;return t.prototype=null,void 0!==n&&Object.defineProperties(r,n),null===e&&(r.__proto__=null),r}}():Object.create}(),z=function(e,t,n){var r=!1;if(!q(e))throw new TypeError("Object.hasKeys called on non-object. The given value is "+typeof e);return d(t,function(t){if(!(t in e))return r=!1,!1;r=!n||!!e[t]}),r},B=function(e,t,n){var r=!1;if(!q(e))throw new TypeError("Object.hasKeys called on non-object. The given value is "+typeof e);return d(t,function(t){if(t in e&&(r=!n||!!e[t]),r)return!1}),r},H=function(){var e={current:new Date,months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fromToday:function(t,n,r,o){if(o=o||5,!Z(t)&&(t.indexOf("-")>-1&&(t=t.replace(/-/g,"/")),t.indexOf("/")<0))return"";var i=new Date(e.calcTimeOffset(t,-1*e.current.getTimezoneOffset()/60)),a=e.current.getTime()-i.getTime();a/=1e3;Math.floor(a%60);a/=60;var u=Math.max(1,Math.floor(a%60));a/=60;var c=Math.floor(a%24),s=Math.floor(a/24),f=r?" ":", ";return s>o?e[n?"monthsShort":"months"][i.getMonth()]+" "+i.getDate()+f+(r?"":i.getFullYear()):s>=1?s+" day"+(s>1?"s":"")+" ago":c>=1?c+" hr"+(c>1?"s":"")+". ago":u+" min. ago"},calcTimeOffset:function(e,t){var n=Z(e)?new Date(e):new Date,r=n.getTime()+6e4*n.getTimezoneOffset();return new Date(r+36e5*t).getTime()},getDifference:function(t,n,r,o){var i=t.getTimezoneOffset(),a=t.getTime(),u=e.calcTimeOffset(n.getTime(),-1*i/60),c=Math.round(Math.abs(a-u)/36e5),s=Math.round((a-u)/864e5);r||(r="days");var f="days"==r?s:c;return o&&(f=f.toString()+("days"==r?" day":" hr")+(1!==f?"s":"")),f},getElapsedSeconds:function(e,t){var n=e-t;return n/=1e3,Math.round(n%60*100)/100+" sec."},toText:function(t,n,r,o,i,a){var u;if(Z(t)||E(t)){if(!Z(t)&&t){if(t.indexOf("-")>-1&&(t=t.replace(/-/g,"/")),t.indexOf("/")<0)return""}else if(!t)return"";u=new Date(t)}else{if(!t)return"";u=t}var c=o?" ":", ",s=i?u.getUTCMonth():u.getMonth(),f=i?u.getUTCDate():u.getDate(),l=i?u.getUTCFullYear():u.getFullYear();return a&&(f=f.toString()+function(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}(f)),e[n?"monthsShort":"months"][s]+(r?" ":" "+f+c)+(o?"":l)},today:function(){return e.toText(e.current.getTime(),!0)},getAge:function(e,t,n){var r=new Date,o=r.getFullYear(),i=r.getMonth(),a=r.getDate(),u=o-n;return i<e-1&&u--,e-1==i&&a<t&&u--,u},toUTC:function(e){return e.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),e.setUTCHours(e.getHours()),e.setUTCMinutes(e.getMinutes()),e}};return e}(),Q=function(){var e;return{counter:{start:function(){e=(new Date).getTime()},end:function(t){if(!e)return null;var n=(new Date).getTime()-e;return e=!1,t?(n/=1e3,Math.round(n%60*100)/100+"sec."):n+"ms."}}}}(),Z=function(e,t){return"number"==typeof e&&(t?isNaN(e)||isFinite(e):isFinite(e))},V=function(e){if(E(e)){var t=e.trim(),n=t.replace(/[^0-9.]/g,"");return 0==t.indexOf("-")&&(n="-"+n),parseFloat(n)}return Z(e)?e:null},W=function(e,t){var n=!1;e<0&&(n=!0),e=Math.abs(e);var r=t;return r=!isNaN(r=Math.abs(r))&&r>0?Math.pow(10,r):1,e>=1e9?(formattedNumber=(Math.round(e/1e9*r)/r).toString().replace(/\.0$/,"")+"G",n&&(formattedNumber="-"+formattedNumber)):e>=1e6?(formattedNumber=(Math.round(e/1e6*r)/r).toString().replace(/\.0$/,"")+"M",n&&(formattedNumber="-"+formattedNumber)):e>=1e3?(formattedNumber=(Math.round(e/1e3*r)/r).toString().replace(/\.0$/,"")+"K",n&&(formattedNumber="-"+formattedNumber)):formattedNumber=o(e,t,""),formattedNumber},X=function(e){return(e?P(e.toString()):"").replace(/(\d{3})(\d{3})(\d{4})/,"($1) $2-$3")},ee=function(e,t,n){if(!Z(e))throw new TypeError("Number.between called on non-number. The given value is "+typeof e);return n?e>=t[0]&&e<=t[1]:e>t[0]&&e<t[1]},te=function(e){return e*(180/Math.PI)},ne=function(e,t,n,r){var o=Math.abs(r-t),i=Math.abs(n-e),a=Math.sqrt(o*o+i*i),u=o/a;return Math.degrees(Math.asin(u))},re=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},oe=function(e,t,n){if(m(e))d(e,t,n);else{if(!q(e))throw new TypeError("forEach can only be used on arrays or plain objects. The object given is "+typeof value);Y(e,t,n)}},ie=function(){if("undefined"!=typeof window){if(window.requestAnimationFrame)return function(e,t){return window.requestAnimationFrame.apply(window,[e,t])};var e=0,t=function(t,n){var r=(new Date).getTime(),o=Math.max(0,16-(r-e)),i=window.setTimeout(function(){t(r+o)},o);return e=r+o,i}}else t=function(e){e()};return t}(),ae=function(){return"undefined"!=typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame:clearTimeout}();return{Array:{isArray:m,forEach:d,filter:v,findIndex:O,map:y,some:b,isEmpty:T,isPopulated:j,pushUnique:x,groupBy:w,last:n},Number:{isNumber:Z,toNumber:V,formatMoney:o,formatNumber:W,phoneFormat:X,between:ee},String:{isString:E,isEmpty:N,trimLeft:S,trimRight:k,trim:I,format:M,capitalize:_,substr:D,includes:$,containsAny:F,splitCamel:J,digits:P,resolve:A},Math:{degrees:te,getAngle:ne,getRandomInt:re},Object:{assign:L,merge:U,isFunction:C,isObject:q,keys:G,forEach:Y,copy:K,hasKeys:z,hasAnyKey:B,create:R,fromUrlParam:function(e){return JSON.parse('{"'+e.replace(/&/g,'","').replace(/=/g,'":"')+'"}',function(e,t){return""===e?t:decodeURIComponent(t)})}},Date:H,Time:Q,uniqid:i,tryCatch:a,isNullorUndefined:u,isEmpty:c,isAnyOf:s,forEach:oe,requestAnimationFrame:ie,cancelAnimationFrame:ae,versionCompare:f,Cookie:{get:l,set:p,check:h},Browser:{iOS:g}}}),function(e){if("object"==typeof module&&"object"==typeof module.exports){var t=e(require,exports);void 0!==t&&(module.exports=t)}else"function"==typeof define&&define.amd?define("pitLS",["require","exports"],e):window.pitLS=e(function(e){return window[e]},{})}(function(e,t){function n(){var e={setItem:function(e,t,n){var r=new Date;r.setTime(r.getTime()+(n||2592e6));var o="expires="+r.toUTCString();document.cookie=e+"="+t+"; "+o+"; path=/; secure"},removeItem:function(e){document.cookie=e+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"},getItem:function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}}};f.set=function(t,n,r){t=a+t,e.setItem(t,n,r),this.trigger("valuechange",t,n,r)},f.get=function(t){return t=a+t,e.getItem(t)},f.expireKey=function(t,n){var r=e.getItem("_expirations.json")||!1;try{r=JSON.parse(r),r||(r={})}catch(e){r={}}r[a+t]={in:n,since:(new Date).getTime()};e.setItem("_expirations.json",JSON.stringify(r));var o=a+t,i=e.getItem(o);void 0!==i&&null!==i&&e.setItem(o,i,n)},f.getExpiration=function(t){var n=e.getItem("_expirations.json")||!1;if(!n)return!1;try{if(!(n=JSON.parse(n)))return!1}catch(e){return!1}var r=n[a+t]||!1;return r||!1},f.remove=function(t){t=a+t,e.removeItem(t),this.trigger("valuedelete",t)},f.removeGroup=function(t){var n=s();for(var r in n)0==(""+n[r]).indexOf(t+"_")&&e.removeItem(r)},f.isExpired=function(){console.warn("not available for cookies")},f.renameGroup=function(){console.warn("not available for cookies")},f.isGroup=function(){console.warn("not available for cookies")},f.ascookies=!0}var r,o,i=[".json",".string",".number",".function",".boolean"],a="",u=function(e,t){for(var n in t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},arguments.callee(e[n],t[n])):e[n]=t[n];return e},c=function(){var e=!!navigator.cookieEnabled;return void 0!==navigator.cookieEnabled||e||(document.cookie="testcookie",e=-1!=document.cookie.indexOf("testcookie")),!!e},s=function(){for(var e=document.cookie.split(";"),t="",n=1;n<=e.length;n++)t+=n+" "+e[n-1]+"\n";return t},f={useSession:function(e){r=e?window.sessionStorage:window.localStorage},ascookies:!1,useMemory:function(e){e&&!o?(o=r,r={_data:{},setItem:function(e,t){return this._data[e]=String(t)},getItem:function(e){return e in this._data?this._data[e]:void 0},removeItem:function(e){return delete this._data[e]},clear:function(){return this._data={}}}):(r=o,o=!1)},events:[],on:function(e,t,n){this.events[e]||(this.events[e]=[]),n?this.events[e][n+"-key"]=t:this.events[e].push(t)},off:function(e,t){t?this.events[e][t+"-key"]&&delete this.events[e][t+"-key"]:delete this.events[e]},trigger:function(e){if(this.events[e]){var t=arguments;for(var n in this.events[e]){var r=this.events[e][n].apply(this,t);if(this.events[e][n].prototype.once&&delete this.events[e][n],void 0!==r&&!1===r)break}}},one:function(e,t){this.on(e,t),this.events[e][this.events[e].length-1].prototype.once=!0},set:function(e,t,o){var u=e,c=t,s="";if("expirations"==e)return!1;switch(e=a+e,typeof t){case"object":t=JSON.stringify(t),s=i[0];break;case"function":t=t.toString(),s=i[3];break;case"number":t=t.toString(),s=i[2];break;case"boolean":t=t.toString(),s=i[4];break;default:s=i[1]}for(var l=0;l<i.length;l++)if(r.getItem(e+i[l])){r.removeItem(e+i[l]);break}try{r.setItem(e+s,t)}catch(e){e&&e.message&&"QuotaExceededError"==e.message?n():f.useMemory(!0)}o&&f.expireKey(u,o),this.trigger("valuechange",u,c,o)},get:function(e){var t,n=e;e=a+e;for(var o=0;o<i.length;o++)if(r.getItem(e+i[o])){if(f.isExpired(n))return void r.removeItem(e+i[o]);switch(i[o]){case i[0]:t=JSON.parse(r.getItem(e+i[o]));break;case i[1]:t=r.getItem(e+i[o]);break;case i[2]:t=parseFloat(r.getItem(e+i[o]));break;case i[3]:t=new Function(r.getItem(e+i[o]));break;case i[4]:t=JSON.parse(r.getItem(e+i[o]))}break}return"undefined"==t||void 0==t?void 0:"true"==t||"false"!=t&&t},remove:function(e){var t=e;e=a+e;for(var n=0;n<i.length;n++)r.getItem(e+i[n])&&r.removeItem(e+i[n]);this.trigger("valuedelete",t)},group:function(e){if(void 0==e)return a?a.substring(0,a.length-1):"";!1===e&&(a=""),a=e+"_",this.trigger("groupchange",a)},isGroup:function(e){var t=r;for(var n in t)if(0===n.indexOf(e))return!0;return!1},renameGroup:function(e,t,n){n=n||{};var o=e+"_"||a,i={async:n.async||!1,callback:n.callback||!1},c=Object.keys?Object.keys(r):[],s=u({},r);if(a=t+"_",i.async&&Object.keys)return function(){if(ix>=c.length)return i.callback?i.callback():null;var e=c[ix];0===e.indexOf(o)&&(r.setItem(a+e.substring(o.length),s[e]),delete r[e]),ix++}();for(var f in s)0===f.indexOf(o)&&(r.setItem(a+f.substring(o.length),s[f]),delete r[f]);this.trigger("groupchange",a)},removeGroup:function(e,t){e=e?e+"_":a,t=t||{};var n={async:t.async||!1,callback:t.callback||!1,exclude:t.exclude||!1},o=r,i=Object.keys?Object.keys(r):[],u=0;if(asyncDelete=function(){if(u>=i.length)return n.callback?n.callback():null;var t=i[u],o=!1;if(0===t.indexOf(e)){if(n.exclude)for(var a in n.exclude){var c=e+n.exclude[a];if(0===t.indexOf(c+".")){o=!0;break}}o||r.removeItem(t)}u++,setTimeout(asyncDelete)},n.async&&Object.keys)return asyncDelete();for(var c in o){var s=!1;if(0===c.indexOf(e)){if(n.exclude)for(var f in n.exclude){var l=e+n.exclude[f];if(0===c.indexOf(l+".")){s=!0;break}}s||r.removeItem(c)}}},expireKey:function(e,t){var n=r.getItem("_expirations.json")||!1;try{n=JSON.parse(n),n||(n={})}catch(e){n={}}n[a+e]={in:t,since:(new Date).getTime()};r.setItem("_expirations.json",JSON.stringify(n))},isExpired:function(e){var t=r.getItem("_expirations.json")||!1;if(!t)return!1;try{if(!(t=JSON.parse(t)))return!1}catch(e){return!1}var n=t[a+e]||!1;return!!n&&(new Date).getTime()-n.since>=n.in},getExpiration:function(e){var t=r.getItem("_expirations.json")||!1;if(!t)return!1;try{if(!(t=JSON.parse(t)))return!1}catch(e){return!1}var n=t[a+e]||!1;return n||!1}};return function(){var e;try{r=window.localStorage,r.setItem("test","test"),r.removeItem("test")}catch(t){e=!0}if(e&&(c()?n():f.useMemory(!0),f.getKey=f.get,f.setKey=f.set,f.removeKey=f.remove,!e)){var t=r.getItem("_expirations.json")||!1;if(t)try{var o=JSON.parse(t);t=JSON.parse(t);var a=new Date;for(var u in t){var s=t[u]||!1;if(!s)break;if(a.getTime()-s.since>=s.in)for(var l=0;l<i.length;l++)r.getItem(u+i[l])&&(r.removeItem(u+i[l]),delete o[u])}r.setItem("_expirations.json",JSON.stringify(o))}catch(e){}}}(),f});