syriastreet.com/assets/js/lib/underscore.js

1 line
14 KiB
JavaScript
Raw Normal View History

2023-10-06 21:29:45 +00:00
!function(){function l(n){return null==n?E.identity:E.isFunction(n)?n:E.property(n)}function n(o){return function(r,e,i){var u={};return e=l(e),F(r,function(n,t){t=e.call(i,n,t,r);o(u,t,n)}),u}}function e(n,t,r){return t&&E.every(n,E.isArray)?h.apply(r,n):(F(n,function(n){E.isArray(n)||E.isArguments(n)?t?f.apply(r,n):e(n,t,r):r.push(n)}),r)}function o(){}function s(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof E&&(n=n._wrapped),t instanceof E&&(t=t._wrapped);var i=y.call(n);if(i!=y.call(t))return!1;switch(i){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var u=r.length;u--;)if(r[u]==n)return e[u]==t;var o=n.constructor,c=t.constructor;if(o!==c&&!(E.isFunction(o)&&o instanceof o&&E.isFunction(c)&&c instanceof c)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var l=0,a=!0;if("[object Array]"==i){if(a=(l=n.length)==t.length)for(;l--&&(a=s(n[l],t[l],r,e)););}else{for(var f in n)if(E.has(n,f)&&(l++,!(a=E.has(t,f)&&s(n[f],t[f],r,e))))break;if(a){for(f in t)if(E.has(t,f)&&!l--)break;a=!l}}return r.pop(),e.pop(),a}var t=this,r=t._,c={},i=Array.prototype,u=Object.prototype,a=Function.prototype,f=i.push,p=i.slice,h=i.concat,y=u.toString,d=u.hasOwnProperty,v=i.forEach,g=i.map,m=i.reduce,b=i.reduceRight,x=i.filter,w=i.every,_=i.some,j=i.indexOf,A=i.lastIndexOf,u=Array.isArray,O=Object.keys,k=a.bind,E=function(n){return n instanceof E?n:this instanceof E?void(this._wrapped=n):new E(n)},F=("undefined"!=typeof exports?(exports="undefined"!=typeof module&&module.exports?module.exports=E:exports)._=E:t._=E,E.VERSION="1.6.0",E.each=E.forEach=function(n,t,r){if(null!=n)if(v&&n.forEach===v)n.forEach(t,r);else if(n.length===+n.length){for(var e=0,i=n.length;e<i;e++)if(t.call(r,n[e],e,n)===c)return}else for(var u=E.keys(n),e=0,i=u.length;e<i;e++)if(t.call(r,n[u[e]],u[e],n)===c)return;return n}),M=(E.map=E.collect=function(n,e,i){var u=[];if(null!=n){if(g&&n.map===g)return n.map(e,i);F(n,function(n,t,r){u.push(e.call(i,n,t,r))})}return u},"Reduce of empty array with no initial value"),R=(E.reduce=E.foldl=E.inject=function(n,e,i,u){var o=2<arguments.length;if(null==n&&(n=[]),m&&n.reduce===m)return u&&(e=E.bind(e,u)),o?n.reduce(e,i):n.reduce(e);if(F(n,function(n,t,r){o?i=e.call(u,i,n,t,r):(i=n,o=!0)}),o)return i;throw new TypeError(M)},E.reduceRight=E.foldr=function(e,i,u,o){var c=2<arguments.length;if(null==e&&(e=[]),b&&e.reduceRight===b)return o&&(i=E.bind(i,o)),c?e.reduceRight(i,u):e.reduceRight(i);var l,a=e.length;if(a!==+a&&(l=E.keys(e),a=l.length),F(e,function(n,t,r){t=l?l[--a]:--a,c?u=i.call(o,u,e[t],t,r):(u=e[t],c=!0)}),c)return u;throw new TypeError(M)},E.find=E.detect=function(n,e,i){var u;return R(n,function(n,t,r){if(e.call(i,n,t,r))return u=n,!0}),u},E.filter=E.select=function(n,e,i){var u=[];if(null!=n){if(x&&n.filter===x)return n.filter(e,i);F(n,function(n,t,r){e.call(i,n,t,r)&&u.push(n)})}return u},E.reject=function(n,e,i){return E.filter(n,function(n,t,r){return!e.call(i,n,t,r)},i)},E.every=E.all=function(n,e,i){e=e||E.identity;var u=!0;return null==n?u:w&&n.every===w?n.every(e,i):(F(n,function(n,t,r){if(!(u=u&&e.call(i,n,t,r)))return c}),!!u)},E.some=E.any=function(n,e,i){e=e||E.identity;var u=!1;return null==n?u:_&&n.some===_?n.some(e,i):(F(n,function(n,t,r){if(u=u||e.call(i,n,t,r))return c}),!!u)}),S=(E.contains=E.include=function(n,t){return null!=n&&(j&&n.indexOf===j?-1!=n.indexOf(t):R(n,function(n){return n===t}))},E.invoke=function(n,t){var r=p.call(arguments,2),e=E.isFunction(t);return E.map(n,function(n){return(e?t:n[t]).apply(n,r)})},E.pluck=function(n,t){return E.map(n,E.property(t))},E.where=function(n,t){return E.filter(n,E.matches(t))},E.findWhere=function(n,t){return E.find(n,E.matches(t))},E.max=function(n,e,i){var u,o;return!e&&E.isArray(n)&&n[0]===+n[0]&&n.length<655