/** * isomorph 0.3.0 - https://github.com/insin/isomorph * MIT Licensed */ !function(r){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.isomorph=r()}}(function(){return function r(t,e,n){function o(u,a){if(!e[u]){if(!t[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var f=e[u]={exports:{}};t[u][0].call(f.exports,function(r){var e=t[u][1][r];return o(e?e:r)},f,f.exports,r,t,e,n)}return e[u].exports}for(var i="function"==typeof require&&require,u=0;ue;e++)t=r[e],n.Array(t)&&(i+=t.length-1,o.apply(r,[e,1].concat(t)),e--);return r}var n=r("./is"),o=Array.prototype.splice;t.exports={flatten:e}},{"./is":6}],3:[function(r,t){"use strict";function e(){}function n(r){return"object"==typeof r?(e.prototype=r,new e):r}function o(r){var t,e;if("object"!=typeof r)return r;var o=r.valueOf();if(r==o){t=new r.constructor(o);var i="string"!=f(r);for(e in r)!c.call(r,e)||!i&&l.test(e)||(t[e]=r[e]);return t}if(r instanceof r.constructor&&r.constructor!==Object){t=n(r.constructor.prototype);for(e in r)c.call(r,e)&&(t[e]=r[e])}else{t={};for(e in r)t[e]=r[e]}return t}function i(r){for(var t in r)this[t]=r[t]}function u(){this.copiedObjects=[];var r=this;this.recursiveDeepCopy=function(t){return r.deepCopy(t)},this.depth=0}function a(r,t){var e=new u;return t&&(e.maxDepth=t),e.deepCopy(r)}var c=Object.prototype.hasOwnProperty,s=Object.prototype.toString,f=function(r){return s.call(r).slice(8,-1).toLowerCase()},p={"boolean":!0,number:!0,string:!0},l=/^(?:\d+|length)$/,h=[];i.prototype={constructor:i,canCopy:function(){return!1},create:function(){},populate:function(){}},u.prototype={constructor:u,maxDepth:256,cacheResult:function(r,t){this.copiedObjects.push([r,t])},getCachedResult:function(r){for(var t=this.copiedObjects,e=t.length,n=0;e>n;n++)if(t[n][0]===r)return t[n][1];return void 0},deepCopy:function(r){if(null===r)return null;if("object"!=typeof r)return r;var t=this.getCachedResult(r);if(t)return t;for(var e=0;ethis.maxDepth)throw new Error("Exceeded max recursion depth in deep copy.");return r.populate(this.recursiveDeepCopy,t,e),this.depth--,e}},a.DeepCopier=i,a.deepCopiers=h,a.register=function(r){r instanceof i||(r=new i(r)),h.unshift(r)},a.register({canCopy:function(){return!0},create:function(r){return r instanceof r.constructor?n(r.constructor.prototype):{}},populate:function(r,t,e){for(var n in t)c.call(t,n)&&(e[n]=r(t[n]));return e}}),a.register({canCopy:function(r){return p[f(r)]},create:function(r){return new r.constructor(r.valueOf())},populate:function(r,t,e){var n="string"!=f(t);for(var o in t)!c.call(t,o)||!n&&l.test(o)||(e[o]=r(t[o]));return e}}),a.register({canCopy:function(r){return"regexp"==f(r)},create:function(r){return r}}),a.register({canCopy:function(r){return"date"==f(r)},create:function(r){return new Date(r)}}),a.register({canCopy:function(r){return"array"==f(r)},create:function(r){return new r.constructor},populate:function(r,t,e){for(var n=0;nt&&e-1&&(n=s.charAt(e)+"B"),o.toFixed(2).replace(f,"")+" "+n}var u=Array.prototype.slice,a=/%[%s]/g,c=/({{?)(\w+)}/g,s="kMGTPEZY",f=/\.00$|0$/;t.exports={format:e,formatArr:n,formatObj:o,fileSize:i}},{}],5:[function(r,t){"use strict";function e(r,t){var e=arguments.length>2?n.call(arguments,2):null,o=function(){var o=e?e.concat(n.call(arguments)):arguments;return r.apply(t,o)};return o.__func__=r,o.__context__=t,o}var n=Array.prototype.slice;t.exports={bind:e}},{}],6:[function(r,t){"use strict";function e(r){return"[object Array]"==l.call(r)}function n(r){return"[object Boolean]"==l.call(r)}function o(r){return"[object Date]"==l.call(r)}function i(r){return"[object Error]"==l.call(r)}function u(r){return"[object Function]"==l.call(r)}function a(r){return"[object Number]"==l.call(r)}function c(r){return"[object Object]"==l.call(r)}function s(r){return"[object RegExp]"==l.call(r)}function f(r){return"[object String]"==l.call(r)}function p(r){for(var t in r)return!1;return!0}var l=Object.prototype.toString;t.exports={Array:e,Boolean:n,Date:o,Empty:p,Error:i,Function:u,NaN:isNaN,Number:a,Object:c,RegExp:s,String:f}},{}],7:[function(r,t){"use strict";function e(r){for(var t,e=1,n=arguments.length;n>e;e++)if(t=arguments[e])for(var o in t)f(t,o)&&(r[o]=t[o]);return r}function n(r,t){var e=function(){};return e.prototype=t.prototype,r.prototype=new e,r.prototype.constructor=r,r}function o(r){var t=[];for(var e in r)f(r,e)&&t.push([e,r[e]]);return t}function i(r){for(var t,e={},n=0,o=r.length;o>n;n++)t=r[n],e[t[0]]=t[1];return e}function u(r){for(var t={},e=0,n=r.length;n>e;e++)t[""+r[e]]=!0;return t}function a(r,t,e){return f(r,t)?r[t]:e}function c(r,t,e){if(null==r)throw new Error("pop was given "+r);if(f(r,t)){var n=r[t];return delete r[t],n}if(2==arguments.length)throw new Error("pop was given an object which didn't have an own '"+t+"' property, without a default value to return");return e}function s(r,t,e){if(null==r)throw new Error("setDefault was given "+r);return e=e||null,f(r,t)?r[t]:(r[t]=e,e)}var f=function(){var r=Object.prototype.hasOwnProperty;return function(t,e){return r.call(t,e)}}(),p=function(){var r=Object.prototype.toString;return function(t){return r.call(t).slice(8,-1).toLowerCase()}}();t.exports={hasOwn:f,type:p,extend:e,inherits:n,items:o,fromItems:i,lookup:u,get:a,pop:c,setDefault:s}},{}],8:[function(r,t){"use strict";function e(r){var t={};if(r.length<2)return t;for(var e=r.substring(1).split("&"),n=0,i=e.length;i>n;n++){var u=e[n].split("="),a=u[0],c=decodeURIComponent(u[1]);t.hasOwnProperty(a)?o.Array(t[a])?t[a].push(c):t[a]=[t[a],c]:t[a]=c}return t}function n(r){var t=[];for(var e in r)if(o.Array(r[e]))for(var n=r[e],i=0,u=n.length;u>i;i++)t.push(e+"="+encodeURIComponent(n[i]));else t.push(e+"="+encodeURIComponent(r[e]));return t.join("&")}var o=r("./is");t.exports={parse:e,stringify:n}},{"./is":6}],9:[function(r,t){"use strict";function e(r,t,e){n.RegExp(r)||(r=new RegExp(r,e));for(var o=null,i=[];null!==(o=r.exec(t));){switch(o.length){case 1:i.push(o[0]);break;case 2:i.push(o[1]);break;default:i.push(o.slice(1))}if(!r.global)break}return i}var n=r("./is");t.exports={findAll:e}},{"./is":6}],10:[function(r,t){"use strict";function e(r){return 10>r?"0"+r:r}function n(r,t){for(var e=0,n=t.length;n>e;e++)if(r===t[e])return e;return-1}function o(r,t){this.format=r,this.locale=t;var e=o._cache[t.name+"|"+r];void 0!==e?(this.re=e[0],this.matchOrder=e[1]):this.compilePattern()}var i=r("./is"),u={b:function(r){return"("+r.b.join("|")+")"},B:function(r){return"("+r.B.join("|")+")"},p:function(r){return"("+r.AM+"|"+r.PM+")"},d:"(\\d\\d?)",H:"(\\d\\d?)",I:"(\\d\\d?)",m:"(\\d\\d?)",M:"(\\d\\d?)",S:"(\\d\\d?)",y:"(\\d\\d?)",Y:"(\\d{4})","%":"%"},a={a:function(r,t){return t.a[r.getDay()]},A:function(r,t){return t.A[r.getDay()]},b:function(r,t){return t.b[r.getMonth()]},B:function(r,t){return t.B[r.getMonth()]},d:function(r){return e(r.getDate(),2)},H:function(r){return e(r.getHours(),2)},M:function(r){return e(r.getMinutes(),2)},m:function(r){return e(r.getMonth()+1,2)},S:function(r){return e(r.getSeconds(),2)},w:function(r){return r.getDay()},Y:function(r){return r.getFullYear()},"%":function(){return"%"}},c=/[^%]%$/;o._cache={},o.prototype.compilePattern=function(){for(var r,t,e=this.format.split(/(?:\s|\t|\n)+/).join(" "),n=[],a=[],c=0,s=e.length;s>c;c++)if(r=e.charAt(c),"%"==r){if(c==s-1)throw new Error("strptime format ends with raw %");if(r=e.charAt(++c),t=u[r],void 0===t)throw new Error("strptime format contains an unknown directive: %"+r);n.push(i.Function(t)?t(this.locale):t),"%"!=r&&a.push(r)}else n.push(" "===r?" +":r);this.re=new RegExp("^"+n.join("")+"$"),this.matchOrder=a,o._cache[this.locale.name+"|"+this.format]=[this.re,a]},o.prototype.parse=function(r){var t=this.re.exec(r);if(null===t)throw new Error("Time data did not match format: data="+r+", format="+this.format);for(var e=[1900,1,1,0,0,0],o={},i=1,u=t.length;u>i;i++)o[this.matchOrder[i-1]]=t[i];if(o.hasOwnProperty("Y"))e[0]=parseInt(o.Y,10);else if(o.hasOwnProperty("y")){var a=parseInt(o.y,10);68>a?a=2e3+a:100>a&&(a=1900+a),e[0]=a}if(o.hasOwnProperty("m")){var c=parseInt(o.m,10);if(1>c||c>12)throw new Error("Month is out of range: "+c);e[1]=c}else o.hasOwnProperty("B")?e[1]=n(o.B,this.locale.B)+1:o.hasOwnProperty("b")&&(e[1]=n(o.b,this.locale.b)+1);if(o.hasOwnProperty("d")){var s=parseInt(o.d,10);if(1>s||s>31)throw new Error("Day is out of range: "+s);e[2]=s}var f;if(o.hasOwnProperty("H")){if(f=parseInt(o.H,10),f>23)throw new Error("Hour is out of range: "+f);e[3]=f}else if(o.hasOwnProperty("I")){if(f=parseInt(o.I,10),1>f||f>12)throw new Error("Hour is out of range: "+f);12==f&&(f=0),e[3]=f,o.hasOwnProperty("p")&&o.p==this.locale.PM&&(e[3]=e[3]+12)}if(o.hasOwnProperty("M")){var p=parseInt(o.M,10);if(p>59)throw new Error("Minute is out of range: "+p);e[4]=p}if(o.hasOwnProperty("S")){var l=parseInt(o.S,10);if(l>59)throw new Error("Second is out of range: "+l);e[5]=l}if(s=e[2],c=e[1],a=e[0],(4==c||6==c||9==c||11==c)&&s>30||2==c&&s>(a%4===0&&a%100!==0||a%400===0?29:28))throw new Error("Day is out of range: "+s);return e};var s={defaultLocale:"en",locales:{en:{name:"en",a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],AM:"AM",b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],PM:"PM"}}},f=s.getLocale=function(r){if(r){if(s.locales.hasOwnProperty(r))return s.locales[r];if(r.length>2){var t=r.substring(0,2);if(s.locales.hasOwnProperty(t))return s.locales[t]}}return s.locales[s.defaultLocale]},p=s.strptime=function(r,t,e){return new o(t,f(e)).parse(r)};s.strpdate=function(r,t,e){var n=p(r,t,e);return new Date(n[0],n[1]-1,n[2],n[3],n[4],n[5])},s.strftime=function(r,t,e){if(c.test(t))throw new Error("strftime format ends with raw %");return e=f(e),t.replace(/(%.)/g,function(t,n){var o=n.charAt(1);if("undefined"==typeof a[o])throw new Error("strftime format contains an unknown directive: "+n);return a[o](r,e)})},t.exports=s},{"./is":6}],11:[function(r,t){"use strict";function e(r){for(var t=e.options,n=t.parser[t.strictMode?"strict":"loose"].exec(r),o={},i=14;i--;)o[t.key[i]]=n[i]||"";return o[t.q.name]={},o[t.key[12]].replace(t.q.parser,function(r,e,n){e&&(o[t.q.name][e]=n)}),o}function n(r){var t="";r.protocol&&(t+=r.protocol+"://"),r.user&&(t+=r.user),r.password&&(t+=":"+r.password),(r.user||r.password)&&(t+="@"),r.host&&(t+=r.host),r.port&&(t+=":"+r.port),r.path&&(t+=r.path);var e=r.queryKey,n=[];for(var o in e)if(e.hasOwnProperty(o)){var i=encodeURIComponent(e[o]);o=encodeURIComponent(o),n.push(i?o+"="+i:o)}return n.length>0&&(t+="?"+n.join("&")),r.anchor&&(t+="#"+r.anchor),t}e.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},t.exports={parseUri:e,makeUri:n}},{}]},{},[1])(1)});