/* Underscore-Awesomer.js 1.2.4 (c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/underscore-awesomer/ License: MIT (http://www.opensource.org/licenses/mit-license.php) */(function(){return function(e){return typeof define=="function"&&define.amd?define("underscore-awesomer",["underscore"],e):e.call(this)}(function(){var e,t;e=this;if(!this._&&typeof require!="undefined")try{t=require("lodash")}catch(n){t=require("underscore")}else t=this._;return t&&t.hasOwnProperty("_")&&(t=t._),typeof e.exports!="undefined"&&(e.exports=t),t.AWESOMENESS="1.2.4",t.pluck=function(e,n,r){return r?t.map(e,function(e){var t;return t=e[n],delete e[n],t}):t.map(e,function(e){return e[n]})},t.remove=function(e,n,r){var i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,D,P;r==null&&(r={});if(t.isEmpty(e))return!n||t.isFunction(n)?[]:void 0;t.isFunction(r)&&(r={callback:r});if(r.preclear){f=e,e=t.clone(e);if(t.isArray(f))f.length=0;else for(s in f)delete f[s]}l=[],c=!1;if(t.isArray(e)){if(t.isUndefined(n))l=t.keys(e);else if(t.isFunction(n))r.first_only?(c=!0,t.find(e,function(e,t){return n(e)?(l.push(t),!0):!1})):t.each(e,function(e,t){if(n(e))return l.push(t)});else if(t.isArray(n))if(r.first_only){c=!0;for(d=0,y=n.length;d=0&&l.push(i);else{c=!0;for(i in e)h=e[i],n===h&&l.push(i)}if(c){if(!l.length)return void 0;h=e[l[0]],l=l.sort(function(e,n){return t.compare(n,e)});for(m=0,w=l.length;m0)for(i in r)r[i]=t.clone(r[i],n-1);return r},t.deepClone=function(e,n){var r,i;if(!e||typeof e!="object")return e;if(t.isString(e))return String.prototype.slice.call(e);if(t.isDate(e))return new Date(e.valueOf());if(t.isFunction(e.clone))return e.clone();if(t.isArray(e))r=Array.prototype.slice.call(e);else{if(e.constructor!=={}.constructor)return e;r=t.extend({},e)}if(!t.isUndefined(n)&&n>0)for(i in r)r[i]=t.deepClone(r[i],n-1);return r},t.isConstructor=function(e){return t.isFunction(e)&&e.name},t.resolveConstructor=function(n){var r,i;return r=t.isArray(n)?n:t.isString(n)?n.split("."):void 0,r?(i=r.length===1?e[r[0]]:t.keypath(e,r),i&&t.isConstructor(i)?i:void 0):t.isFunction(n)&&t.isConstructor(n)?n:void 0},t.CONVERT_NONE=0,t.CONVERT_IS_TYPE=1,t.CONVERT_TO_METHOD=2,t.conversionPath=function(e,n){var r,i,s,o;i=t.isArray(n)?n:t.isString(n)?n.split("."):void 0,o=typeof e,r=i?i[i.length-1]:void 0,o=typeof e,r=i?i[i.length-1]:void 0;if(i&&o===r)return t.CONVERT_IS_TYPE;s=t.resolveConstructor(i?i:n);if(s&&o==="object")try{if(e instanceof s)return t.CONVERT_IS_TYPE}catch(u){({})}return r=s&&s.name?s.name:r,r?t["is"+r]&&t["is"+r](e)?t.CONVERT_IS_TYPE:o==="object"&&e["to"+r]?t.CONVERT_TO_METHOD:t.CONVERT_NONE:t.CONVERT_NONE},t.isConvertible=function(e,n){return t.conversionPath(e,n)>0},t.toType=function(e,n){var r,i;r=t.isArray(n)?n:t.isString(n)?n.split("."):void 0;switch(t.conversionPath(e,r?r:n)){case 1:return e;case 2:return r?e["to"+r[r.length-1]]():(i=t.resolveConstructor(n),i&&i.name?e["to"+i.name]():void 0)}return void 0},t.functionExists=function(e,n){return e instanceof Object&&e[n]&&t.isFunction(e[n])},t.callIfExists=function(e,n){return t.functionExists(e,n)?e[n].apply(e,Array.prototype.slice.call(arguments,2)):void 0},t.getSuperFunction=function(e,n){var r;return r=t.keypathValueOwner(e,["constructor","__super__",n]),r&&t.isFunction(r[n])?r[n]:void 0},t.superCall=function(e,n){var r;return r=t.getSuperFunction(e,n),r?r.apply(e,Array.prototype.slice.call(arguments,2)):void 0},t.superApply=function(e,n,r){var i;return i=t.getSuperFunction(e,n),i?i.apply(e,r):void 0},t.classOf=function(e){return e!=null&&Object.getPrototypeOf(Object(e)).constructor.name||void 0},t.copyProperties=function(e,n,r,i){var s,o,u,a,f;u=r||t.keys(n),s=!1;for(a=0,f=u.length;a>1,t.compare(r(e[o]),r(n))===t.COMPARE_ASCENDING?s=o+1:i=o;return s},t.COMPARE_EQUAL=0,t.COMPARE_ASCENDING=-1,t.COMPARE_DESCENDING=1,t.compare=function(e,n,r){var i;return typeof e!="object"?e===n?t.COMPARE_EQUAL:e