drapcode-builder
Version:
Drapcode Builder Library
2 lines • 783 kB
JavaScript
/*! drapcode-builder - 0.1.19 */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["drapcode-builder"]=e():t["drapcode-builder"]=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=102)}([function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return On})),n.d(e,"VERSION",(function(){return i.e})),n.d(e,"restArguments",(function(){return o})),n.d(e,"isObject",(function(){return a})),n.d(e,"isNull",(function(){return s})),n.d(e,"isUndefined",(function(){return l})),n.d(e,"isBoolean",(function(){return c})),n.d(e,"isElement",(function(){return u})),n.d(e,"isString",(function(){return h})),n.d(e,"isNumber",(function(){return f})),n.d(e,"isDate",(function(){return p})),n.d(e,"isRegExp",(function(){return g})),n.d(e,"isError",(function(){return v})),n.d(e,"isSymbol",(function(){return m})),n.d(e,"isArrayBuffer",(function(){return b})),n.d(e,"isDataView",(function(){return j})),n.d(e,"isArray",(function(){return T})),n.d(e,"isFunction",(function(){return x})),n.d(e,"isArguments",(function(){return D})),n.d(e,"isFinite",(function(){return M})),n.d(e,"isNaN",(function(){return A})),n.d(e,"isTypedArray",(function(){return R})),n.d(e,"isEmpty",(function(){return B})),n.d(e,"isMatch",(function(){return W})),n.d(e,"isEqual",(function(){return K})),n.d(e,"isMap",(function(){return rt})),n.d(e,"isWeakMap",(function(){return it})),n.d(e,"isSet",(function(){return ot})),n.d(e,"isWeakSet",(function(){return at})),n.d(e,"keys",(function(){return $})),n.d(e,"allKeys",(function(){return Y})),n.d(e,"values",(function(){return st})),n.d(e,"pairs",(function(){return lt})),n.d(e,"invert",(function(){return ct})),n.d(e,"functions",(function(){return ut})),n.d(e,"methods",(function(){return ut})),n.d(e,"extend",(function(){return ht})),n.d(e,"extendOwn",(function(){return ft})),n.d(e,"assign",(function(){return ft})),n.d(e,"defaults",(function(){return pt})),n.d(e,"create",(function(){return vt})),n.d(e,"clone",(function(){return mt})),n.d(e,"tap",(function(){return bt})),n.d(e,"get",(function(){return Ot})),n.d(e,"has",(function(){return Ct})),n.d(e,"mapObject",(function(){return Mt})),n.d(e,"identity",(function(){return St})),n.d(e,"constant",(function(){return L})),n.d(e,"noop",(function(){return At})),n.d(e,"toPath",(function(){return yt})),n.d(e,"property",(function(){return jt})),n.d(e,"propertyOf",(function(){return Lt})),n.d(e,"matcher",(function(){return kt})),n.d(e,"matches",(function(){return kt})),n.d(e,"times",(function(){return Nt})),n.d(e,"random",(function(){return _t})),n.d(e,"now",(function(){return It})),n.d(e,"escape",(function(){return Rt})),n.d(e,"unescape",(function(){return zt})),n.d(e,"templateSettings",(function(){return Ht})),n.d(e,"template",(function(){return Gt})),n.d(e,"result",(function(){return Kt})),n.d(e,"uniqueId",(function(){return Xt})),n.d(e,"chain",(function(){return Jt})),n.d(e,"iteratee",(function(){return Et})),n.d(e,"partial",(function(){return te})),n.d(e,"bind",(function(){return ee})),n.d(e,"bindAll",(function(){return ie})),n.d(e,"memoize",(function(){return oe})),n.d(e,"delay",(function(){return ae})),n.d(e,"defer",(function(){return se})),n.d(e,"throttle",(function(){return le})),n.d(e,"debounce",(function(){return ce})),n.d(e,"wrap",(function(){return ue})),n.d(e,"negate",(function(){return de})),n.d(e,"compose",(function(){return he})),n.d(e,"after",(function(){return fe})),n.d(e,"before",(function(){return pe})),n.d(e,"once",(function(){return ge})),n.d(e,"findKey",(function(){return ve})),n.d(e,"findIndex",(function(){return be})),n.d(e,"findLastIndex",(function(){return ye})),n.d(e,"sortedIndex",(function(){return we})),n.d(e,"indexOf",(function(){return Oe})),n.d(e,"lastIndexOf",(function(){return Ce})),n.d(e,"find",(function(){return Se})),n.d(e,"detect",(function(){return Se})),n.d(e,"findWhere",(function(){return ke})),n.d(e,"each",(function(){return je})),n.d(e,"forEach",(function(){return je})),n.d(e,"map",(function(){return Te})),n.d(e,"collect",(function(){return Te})),n.d(e,"reduce",(function(){return Ee})),n.d(e,"foldl",(function(){return Ee})),n.d(e,"inject",(function(){return Ee})),n.d(e,"reduceRight",(function(){return De})),n.d(e,"foldr",(function(){return De})),n.d(e,"filter",(function(){return Me})),n.d(e,"select",(function(){return Me})),n.d(e,"reject",(function(){return Ae})),n.d(e,"every",(function(){return Le})),n.d(e,"all",(function(){return Le})),n.d(e,"some",(function(){return Ne})),n.d(e,"any",(function(){return Ne})),n.d(e,"contains",(function(){return _e})),n.d(e,"includes",(function(){return _e})),n.d(e,"include",(function(){return _e})),n.d(e,"invoke",(function(){return Ie})),n.d(e,"pluck",(function(){return Fe})),n.d(e,"where",(function(){return Ve})),n.d(e,"max",(function(){return Re})),n.d(e,"min",(function(){return ze})),n.d(e,"shuffle",(function(){return We})),n.d(e,"sample",(function(){return Be})),n.d(e,"sortBy",(function(){return Ue})),n.d(e,"groupBy",(function(){return Ge})),n.d(e,"indexBy",(function(){return Ke})),n.d(e,"countBy",(function(){return Ye})),n.d(e,"partition",(function(){return Xe})),n.d(e,"toArray",(function(){return $e})),n.d(e,"size",(function(){return Je})),n.d(e,"pick",(function(){return Qe})),n.d(e,"omit",(function(){return tn})),n.d(e,"first",(function(){return nn})),n.d(e,"head",(function(){return nn})),n.d(e,"take",(function(){return nn})),n.d(e,"initial",(function(){return en})),n.d(e,"last",(function(){return on})),n.d(e,"rest",(function(){return rn})),n.d(e,"tail",(function(){return rn})),n.d(e,"drop",(function(){return rn})),n.d(e,"compact",(function(){return an})),n.d(e,"flatten",(function(){return sn})),n.d(e,"without",(function(){return cn})),n.d(e,"uniq",(function(){return un})),n.d(e,"unique",(function(){return un})),n.d(e,"union",(function(){return dn})),n.d(e,"intersection",(function(){return hn})),n.d(e,"difference",(function(){return ln})),n.d(e,"unzip",(function(){return fn})),n.d(e,"transpose",(function(){return fn})),n.d(e,"zip",(function(){return pn})),n.d(e,"object",(function(){return gn})),n.d(e,"range",(function(){return vn})),n.d(e,"chunk",(function(){return mn})),n.d(e,"mixin",(function(){return yn}));var r={};n.r(r),n.d(r,"VERSION",(function(){return i.e})),n.d(r,"restArguments",(function(){return o})),n.d(r,"isObject",(function(){return a})),n.d(r,"isNull",(function(){return s})),n.d(r,"isUndefined",(function(){return l})),n.d(r,"isBoolean",(function(){return c})),n.d(r,"isElement",(function(){return u})),n.d(r,"isString",(function(){return h})),n.d(r,"isNumber",(function(){return f})),n.d(r,"isDate",(function(){return p})),n.d(r,"isRegExp",(function(){return g})),n.d(r,"isError",(function(){return v})),n.d(r,"isSymbol",(function(){return m})),n.d(r,"isArrayBuffer",(function(){return b})),n.d(r,"isDataView",(function(){return j})),n.d(r,"isArray",(function(){return T})),n.d(r,"isFunction",(function(){return x})),n.d(r,"isArguments",(function(){return D})),n.d(r,"isFinite",(function(){return M})),n.d(r,"isNaN",(function(){return A})),n.d(r,"isTypedArray",(function(){return R})),n.d(r,"isEmpty",(function(){return B})),n.d(r,"isMatch",(function(){return W})),n.d(r,"isEqual",(function(){return K})),n.d(r,"isMap",(function(){return rt})),n.d(r,"isWeakMap",(function(){return it})),n.d(r,"isSet",(function(){return ot})),n.d(r,"isWeakSet",(function(){return at})),n.d(r,"keys",(function(){return $})),n.d(r,"allKeys",(function(){return Y})),n.d(r,"values",(function(){return st})),n.d(r,"pairs",(function(){return lt})),n.d(r,"invert",(function(){return ct})),n.d(r,"functions",(function(){return ut})),n.d(r,"methods",(function(){return ut})),n.d(r,"extend",(function(){return ht})),n.d(r,"extendOwn",(function(){return ft})),n.d(r,"assign",(function(){return ft})),n.d(r,"defaults",(function(){return pt})),n.d(r,"create",(function(){return vt})),n.d(r,"clone",(function(){return mt})),n.d(r,"tap",(function(){return bt})),n.d(r,"get",(function(){return Ot})),n.d(r,"has",(function(){return Ct})),n.d(r,"mapObject",(function(){return Mt})),n.d(r,"identity",(function(){return St})),n.d(r,"constant",(function(){return L})),n.d(r,"noop",(function(){return At})),n.d(r,"toPath",(function(){return yt})),n.d(r,"property",(function(){return jt})),n.d(r,"propertyOf",(function(){return Lt})),n.d(r,"matcher",(function(){return kt})),n.d(r,"matches",(function(){return kt})),n.d(r,"times",(function(){return Nt})),n.d(r,"random",(function(){return _t})),n.d(r,"now",(function(){return It})),n.d(r,"escape",(function(){return Rt})),n.d(r,"unescape",(function(){return zt})),n.d(r,"templateSettings",(function(){return Ht})),n.d(r,"template",(function(){return Gt})),n.d(r,"result",(function(){return Kt})),n.d(r,"uniqueId",(function(){return Xt})),n.d(r,"chain",(function(){return Jt})),n.d(r,"iteratee",(function(){return Et})),n.d(r,"partial",(function(){return te})),n.d(r,"bind",(function(){return ee})),n.d(r,"bindAll",(function(){return ie})),n.d(r,"memoize",(function(){return oe})),n.d(r,"delay",(function(){return ae})),n.d(r,"defer",(function(){return se})),n.d(r,"throttle",(function(){return le})),n.d(r,"debounce",(function(){return ce})),n.d(r,"wrap",(function(){return ue})),n.d(r,"negate",(function(){return de})),n.d(r,"compose",(function(){return he})),n.d(r,"after",(function(){return fe})),n.d(r,"before",(function(){return pe})),n.d(r,"once",(function(){return ge})),n.d(r,"findKey",(function(){return ve})),n.d(r,"findIndex",(function(){return be})),n.d(r,"findLastIndex",(function(){return ye})),n.d(r,"sortedIndex",(function(){return we})),n.d(r,"indexOf",(function(){return Oe})),n.d(r,"lastIndexOf",(function(){return Ce})),n.d(r,"find",(function(){return Se})),n.d(r,"detect",(function(){return Se})),n.d(r,"findWhere",(function(){return ke})),n.d(r,"each",(function(){return je})),n.d(r,"forEach",(function(){return je})),n.d(r,"map",(function(){return Te})),n.d(r,"collect",(function(){return Te})),n.d(r,"reduce",(function(){return Ee})),n.d(r,"foldl",(function(){return Ee})),n.d(r,"inject",(function(){return Ee})),n.d(r,"reduceRight",(function(){return De})),n.d(r,"foldr",(function(){return De})),n.d(r,"filter",(function(){return Me})),n.d(r,"select",(function(){return Me})),n.d(r,"reject",(function(){return Ae})),n.d(r,"every",(function(){return Le})),n.d(r,"all",(function(){return Le})),n.d(r,"some",(function(){return Ne})),n.d(r,"any",(function(){return Ne})),n.d(r,"contains",(function(){return _e})),n.d(r,"includes",(function(){return _e})),n.d(r,"include",(function(){return _e})),n.d(r,"invoke",(function(){return Ie})),n.d(r,"pluck",(function(){return Fe})),n.d(r,"where",(function(){return Ve})),n.d(r,"max",(function(){return Re})),n.d(r,"min",(function(){return ze})),n.d(r,"shuffle",(function(){return We})),n.d(r,"sample",(function(){return Be})),n.d(r,"sortBy",(function(){return Ue})),n.d(r,"groupBy",(function(){return Ge})),n.d(r,"indexBy",(function(){return Ke})),n.d(r,"countBy",(function(){return Ye})),n.d(r,"partition",(function(){return Xe})),n.d(r,"toArray",(function(){return $e})),n.d(r,"size",(function(){return Je})),n.d(r,"pick",(function(){return Qe})),n.d(r,"omit",(function(){return tn})),n.d(r,"first",(function(){return nn})),n.d(r,"head",(function(){return nn})),n.d(r,"take",(function(){return nn})),n.d(r,"initial",(function(){return en})),n.d(r,"last",(function(){return on})),n.d(r,"rest",(function(){return rn})),n.d(r,"tail",(function(){return rn})),n.d(r,"drop",(function(){return rn})),n.d(r,"compact",(function(){return an})),n.d(r,"flatten",(function(){return sn})),n.d(r,"without",(function(){return cn})),n.d(r,"uniq",(function(){return un})),n.d(r,"unique",(function(){return un})),n.d(r,"union",(function(){return dn})),n.d(r,"intersection",(function(){return hn})),n.d(r,"difference",(function(){return ln})),n.d(r,"unzip",(function(){return fn})),n.d(r,"transpose",(function(){return fn})),n.d(r,"zip",(function(){return pn})),n.d(r,"object",(function(){return gn})),n.d(r,"range",(function(){return vn})),n.d(r,"chunk",(function(){return mn})),n.d(r,"mixin",(function(){return yn})),n.d(r,"default",(function(){return wn}));var i=n(4);function o(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r);case 2:return t.call(this,arguments[0],arguments[1],r)}var o=Array(e+1);for(i=0;i<e;i++)o[i]=arguments[i];return o[e]=r,t.apply(this,o)}}function a(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function s(t){return null===t}function l(t){return void 0===t}function c(t){return!0===t||!1===t||"[object Boolean]"===i.t.call(t)}function u(t){return!(!t||1!==t.nodeType)}function d(t){var e="[object "+t+"]";return function(t){return i.t.call(t)===e}}var h=d("String"),f=d("Number"),p=d("Date"),g=d("RegExp"),v=d("Error"),m=d("Symbol"),b=d("ArrayBuffer"),y=d("Function"),w=i.p.document&&i.p.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof w&&(y=function(t){return"function"==typeof t||!1});var x=y,O=d("Object"),C=i.s&&O(new DataView(new ArrayBuffer(8))),S="undefined"!=typeof Map&&O(new Map),k=d("DataView");var j=C?function(t){return null!=t&&x(t.getInt8)&&b(t.buffer)}:k,T=i.k||d("Array");function P(t,e){return null!=t&&i.i.call(t,e)}var E=d("Arguments");!function(){E(arguments)||(E=function(t){return P(t,"callee")})}();var D=E;function M(t){return!m(t)&&Object(i.f)(t)&&!isNaN(parseFloat(t))}function A(t){return f(t)&&Object(i.g)(t)}function L(t){return function(){return t}}function N(t){return function(e){var n=t(e);return"number"==typeof n&&n>=0&&n<=i.b}}function _(t){return function(e){return null==e?void 0:e[t]}}var I=_("byteLength"),F=N(I),V=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var R=i.r?function(t){return i.l?Object(i.l)(t)&&!j(t):F(t)&&V.test(i.t.call(t))}:L(!1),z=_("length");function H(t,e){e=function(t){for(var e={},n=t.length,r=0;r<n;++r)e[t[r]]=!0;return{contains:function(t){return!0===e[t]},push:function(n){return e[n]=!0,t.push(n)}}}(e);var n=i.n.length,r=t.constructor,o=x(r)&&r.prototype||i.c,a="constructor";for(P(t,a)&&!e.contains(a)&&e.push(a);n--;)(a=i.n[n])in t&&t[a]!==o[a]&&!e.contains(a)&&e.push(a)}function $(t){if(!a(t))return[];if(i.m)return Object(i.m)(t);var e=[];for(var n in t)P(t,n)&&e.push(n);return i.h&&H(t,e),e}function B(t){if(null==t)return!0;var e=z(t);return"number"==typeof e&&(T(t)||h(t)||D(t))?0===e:0===z($(t))}function W(t,e){var n=$(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0}function U(t){return t instanceof U?t:this instanceof U?void(this._wrapped=t):new U(t)}function q(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,I(t))}U.VERSION=i.e,U.prototype.value=function(){return this._wrapped},U.prototype.valueOf=U.prototype.toJSON=U.prototype.value,U.prototype.toString=function(){return String(this._wrapped)};function G(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var o=typeof t;return("function"===o||"object"===o||"object"==typeof e)&&function t(e,n,r,o){e instanceof U&&(e=e._wrapped);n instanceof U&&(n=n._wrapped);var a=i.t.call(e);if(a!==i.t.call(n))return!1;if(C&&"[object Object]"==a&&j(e)){if(!j(n))return!1;a="[object DataView]"}switch(a){case"[object RegExp]":case"[object String]":return""+e==""+n;case"[object Number]":return+e!=+e?+n!=+n:0==+e?1/+e==1/n:+e==+n;case"[object Date]":case"[object Boolean]":return+e==+n;case"[object Symbol]":return i.d.valueOf.call(e)===i.d.valueOf.call(n);case"[object ArrayBuffer]":case"[object DataView]":return t(q(e),q(n),r,o)}var s="[object Array]"===a;if(!s&&R(e)){if(I(e)!==I(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)return!0;s=!0}if(!s){if("object"!=typeof e||"object"!=typeof n)return!1;var l=e.constructor,c=n.constructor;if(l!==c&&!(x(l)&&l instanceof l&&x(c)&&c instanceof c)&&"constructor"in e&&"constructor"in n)return!1}o=o||[];var u=(r=r||[]).length;for(;u--;)if(r[u]===e)return o[u]===n;if(r.push(e),o.push(n),s){if((u=e.length)!==n.length)return!1;for(;u--;)if(!G(e[u],n[u],r,o))return!1}else{var d,h=$(e);if(u=h.length,$(n).length!==u)return!1;for(;u--;)if(d=h[u],!P(n,d)||!G(e[d],n[d],r,o))return!1}return r.pop(),o.pop(),!0}(t,e,n,r)}function K(t,e){return G(t,e)}function Y(t){if(!a(t))return[];var e=[];for(var n in t)e.push(n);return i.h&&H(t,e),e}function X(t){var e=z(t);return function(n){if(null==n)return!1;var r=Y(n);if(z(r))return!1;for(var i=0;i<e;i++)if(!x(n[t[i]]))return!1;return t!==et||!x(n[J])}}var J="forEach",Z=["clear","delete"],Q=["get","has","set"],tt=Z.concat(J,Q),et=Z.concat(Q),nt=["add"].concat(Z,J,"has"),rt=S?X(tt):d("Map"),it=S?X(et):d("WeakMap"),ot=S?X(nt):d("Set"),at=d("WeakSet");function st(t){for(var e=$(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r}function lt(t){for(var e=$(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r}function ct(t){for(var e={},n=$(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e}function ut(t){var e=[];for(var n in t)x(t[n])&&e.push(n);return e.sort()}function dt(t,e){return function(n){var r=arguments.length;if(e&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,l=0;l<s;l++){var c=a[l];e&&void 0!==n[c]||(n[c]=o[c])}return n}}var ht=dt(Y),ft=dt($),pt=dt(Y,!0);function gt(t){if(!a(t))return{};if(i.j)return Object(i.j)(t);var e=function(){};e.prototype=t;var n=new e;return e.prototype=null,n}function vt(t,e){var n=gt(t);return e&&ft(n,e),n}function mt(t){return a(t)?T(t)?t.slice():ht({},t):t}function bt(t,e){return e(t),t}function yt(t){return T(t)?t:[t]}function wt(t){return U.toPath(t)}function xt(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function Ot(t,e,n){var r=xt(t,wt(e));return l(r)?n:r}function Ct(t,e){for(var n=(e=wt(e)).length,r=0;r<n;r++){var i=e[r];if(!P(t,i))return!1;t=t[i]}return!!n}function St(t){return t}function kt(t){return t=ft({},t),function(e){return W(e,t)}}function jt(t){return t=wt(t),function(e){return xt(e,t)}}function Tt(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}}function Pt(t,e,n){return null==t?St:x(t)?Tt(t,e,n):a(t)&&!T(t)?kt(t):jt(t)}function Et(t,e){return Pt(t,e,1/0)}function Dt(t,e,n){return U.iteratee!==Et?U.iteratee(t,e):Pt(t,e,n)}function Mt(t,e,n){e=Dt(e,n);for(var r=$(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o}function At(){}function Lt(t){return null==t?At:function(e){return Ot(t,e)}}function Nt(t,e,n){var r=Array(Math.max(0,t));e=Tt(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r}function _t(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}U.toPath=yt,U.iteratee=Et;var It=Date.now||function(){return(new Date).getTime()};function Ft(t){var e=function(e){return t[e]},n="(?:"+$(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}}var Vt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Rt=Ft(Vt),zt=Ft(ct(Vt)),Ht=U.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},$t=/(.)^/,Bt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Wt=/\\|'|\r|\n|\u2028|\u2029/g;function Ut(t){return"\\"+Bt[t]}var qt=/^\s*(\w|\$)+\s*$/;function Gt(t,e,n){!e&&n&&(e=n),e=pt({},e,U.templateSettings);var r=RegExp([(e.escape||$t).source,(e.interpolate||$t).source,(e.evaluate||$t).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,(function(e,n,r,a,s){return o+=t.slice(i,s).replace(Wt,Ut),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e})),o+="';\n";var a,s=e.variable;if(s){if(!qt.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(t){throw t.source=o,t}var l=function(t){return a.call(this,t,U)};return l.source="function("+s+"){\n"+o+"}",l}function Kt(t,e,n){var r=(e=wt(e)).length;if(!r)return x(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=x(o)?o.call(t):o}return t}var Yt=0;function Xt(t){var e=++Yt+"";return t?t+e:e}function Jt(t){var e=U(t);return e._chain=!0,e}function Zt(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=gt(t.prototype),s=t.apply(o,i);return a(s)?s:o}var Qt=o((function(t,e){var n=Qt.placeholder,r=function(){for(var i=0,o=e.length,a=Array(o),s=0;s<o;s++)a[s]=e[s]===n?arguments[i++]:e[s];for(;i<arguments.length;)a.push(arguments[i++]);return Zt(t,r,this,this,a)};return r}));Qt.placeholder=U;var te=Qt,ee=o((function(t,e,n){if(!x(t))throw new TypeError("Bind must be called on a function");var r=o((function(i){return Zt(t,r,e,this,n.concat(i))}));return r})),ne=N(z);function re(t,e,n,r){if(r=r||[],e||0===e){if(e<=0)return r.concat(t)}else e=1/0;for(var i=r.length,o=0,a=z(t);o<a;o++){var s=t[o];if(ne(s)&&(T(s)||D(s)))if(e>1)re(s,e-1,n,r),i=r.length;else for(var l=0,c=s.length;l<c;)r[i++]=s[l++];else n||(r[i++]=s)}return r}var ie=o((function(t,e){var n=(e=re(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=ee(t[r],t)}return t}));function oe(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return P(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n}var ae=o((function(t,e,n){return setTimeout((function(){return t.apply(null,n)}),e)})),se=te(ae,U,1);function le(t,e,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:It(),r=null,a=t.apply(i,o),r||(i=o=null)},c=function(){var c=It();s||!1!==n.leading||(s=c);var u=e-(c-s);return i=this,o=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=c,a=t.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c}function ce(t,e,n){var r,i,a,s,l,c=function(){var o=It()-i;e>o?r=setTimeout(c,e-o):(r=null,n||(s=t.apply(l,a)),r||(a=l=null))},u=o((function(o){return l=this,a=o,i=It(),r||(r=setTimeout(c,e),n&&(s=t.apply(l,a))),s}));return u.cancel=function(){clearTimeout(r),r=a=l=null},u}function ue(t,e){return te(e,t)}function de(t){return function(){return!t.apply(this,arguments)}}function he(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function fe(t,e){return function(){if(--t<1)return e.apply(this,arguments)}}function pe(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}}var ge=te(pe,2);function ve(t,e,n){e=Dt(e,n);for(var r,i=$(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r}function me(t){return function(e,n,r){n=Dt(n,r);for(var i=z(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}var be=me(1),ye=me(-1);function we(t,e,n,r){for(var i=(n=Dt(n,r,1))(e),o=0,a=z(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o}function xe(t,e,n){return function(r,o,a){var s=0,l=z(r);if("number"==typeof a)t>0?s=a>=0?a:Math.max(a+l,s):l=a>=0?Math.min(a+1,l):a+l+1;else if(n&&a&&l)return r[a=n(r,o)]===o?a:-1;if(o!=o)return(a=e(i.q.call(r,s,l),A))>=0?a+s:-1;for(a=t>0?s:l-1;a>=0&&a<l;a+=t)if(r[a]===o)return a;return-1}}var Oe=xe(1,be,we),Ce=xe(-1,ye);function Se(t,e,n){var r=(ne(t)?be:ve)(t,e,n);if(void 0!==r&&-1!==r)return t[r]}function ke(t,e){return Se(t,kt(e))}function je(t,e,n){var r,i;if(e=Tt(e,n),ne(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=$(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t}function Te(t,e,n){e=Dt(e,n);for(var r=!ne(t)&&$(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o}function Pe(t){var e=function(e,n,r,i){var o=!ne(e)&&$(e),a=(o||e).length,s=t>0?0:a-1;for(i||(r=e[o?o[s]:s],s+=t);s>=0&&s<a;s+=t){var l=o?o[s]:s;r=n(r,e[l],l,e)}return r};return function(t,n,r,i){var o=arguments.length>=3;return e(t,Tt(n,i,4),r,o)}}var Ee=Pe(1),De=Pe(-1);function Me(t,e,n){var r=[];return e=Dt(e,n),je(t,(function(t,n,i){e(t,n,i)&&r.push(t)})),r}function Ae(t,e,n){return Me(t,de(Dt(e)),n)}function Le(t,e,n){e=Dt(e,n);for(var r=!ne(t)&&$(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0}function Ne(t,e,n){e=Dt(e,n);for(var r=!ne(t)&&$(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1}function _e(t,e,n,r){return ne(t)||(t=st(t)),("number"!=typeof n||r)&&(n=0),Oe(t,e,n)>=0}var Ie=o((function(t,e,n){var r,i;return x(e)?i=e:(e=wt(e),r=e.slice(0,-1),e=e[e.length-1]),Te(t,(function(t){var o=i;if(!o){if(r&&r.length&&(t=xt(t,r)),null==t)return;o=t[e]}return null==o?o:o.apply(t,n)}))}));function Fe(t,e){return Te(t,jt(e))}function Ve(t,e){return Me(t,kt(e))}function Re(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=ne(t)?t:st(t)).length;s<l;s++)null!=(r=t[s])&&r>o&&(o=r);else e=Dt(e,n),je(t,(function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)}));return o}function ze(t,e,n){var r,i,o=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=ne(t)?t:st(t)).length;s<l;s++)null!=(r=t[s])&&r<o&&(o=r);else e=Dt(e,n),je(t,(function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)}));return o}var He=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function $e(t){return t?T(t)?i.q.call(t):h(t)?t.match(He):ne(t)?Te(t,St):st(t):[]}function Be(t,e,n){if(null==e||n)return ne(t)||(t=st(t)),t[_t(t.length-1)];var r=$e(t),i=z(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=_t(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)}function We(t){return Be(t,1/0)}function Ue(t,e,n){var r=0;return e=Dt(e,n),Fe(Te(t,(function(t,n,i){return{value:t,index:r++,criteria:e(t,n,i)}})).sort((function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index})),"value")}function qe(t,e){return function(n,r,i){var o=e?[[],[]]:{};return r=Dt(r,i),je(n,(function(e,i){var a=r(e,i,n);t(o,e,a)})),o}}var Ge=qe((function(t,e,n){P(t,n)?t[n].push(e):t[n]=[e]})),Ke=qe((function(t,e,n){t[n]=e})),Ye=qe((function(t,e,n){P(t,n)?t[n]++:t[n]=1})),Xe=qe((function(t,e,n){t[n?0:1].push(e)}),!0);function Je(t){return null==t?0:ne(t)?t.length:$(t).length}function Ze(t,e,n){return e in n}var Qe=o((function(t,e){var n={},r=e[0];if(null==t)return n;x(r)?(e.length>1&&(r=Tt(r,e[1])),e=Y(t)):(r=Ze,e=re(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n})),tn=o((function(t,e){var n,r=e[0];return x(r)?(r=de(r),e.length>1&&(n=e[1])):(e=Te(re(e,!1,!1),String),r=function(t,n){return!_e(e,n)}),Qe(t,r,n)}));function en(t,e,n){return i.q.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))}function nn(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[0]:en(t,t.length-e)}function rn(t,e,n){return i.q.call(t,null==e||n?1:e)}function on(t,e,n){return null==t||t.length<1?null==e||n?void 0:[]:null==e||n?t[t.length-1]:rn(t,Math.max(0,t.length-e))}function an(t){return Me(t,Boolean)}function sn(t,e){return re(t,e,!1)}var ln=o((function(t,e){return e=re(e,!0,!0),Me(t,(function(t){return!_e(e,t)}))})),cn=o((function(t,e){return ln(t,e)}));function un(t,e,n,r){c(e)||(r=n,n=e,e=!1),null!=n&&(n=Dt(n,r));for(var i=[],o=[],a=0,s=z(t);a<s;a++){var l=t[a],u=n?n(l,a,t):l;e&&!n?(a&&o===u||i.push(l),o=u):n?_e(o,u)||(o.push(u),i.push(l)):_e(i,l)||i.push(l)}return i}var dn=o((function(t){return un(re(t,!0,!0))}));function hn(t){for(var e=[],n=arguments.length,r=0,i=z(t);r<i;r++){var o=t[r];if(!_e(e,o)){var a;for(a=1;a<n&&_e(arguments[a],o);a++);a===n&&e.push(o)}}return e}function fn(t){for(var e=t&&Re(t,z).length||0,n=Array(e),r=0;r<e;r++)n[r]=Fe(t,r);return n}var pn=o(fn);function gn(t,e){for(var n={},r=0,i=z(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n}function vn(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i}function mn(t,e){if(null==e||e<1)return[];for(var n=[],r=0,o=t.length;r<o;)n.push(i.q.call(t,r,r+=e));return n}function bn(t,e){return t._chain?U(e).chain():e}function yn(t){return je(ut(t),(function(e){var n=U[e]=t[e];U.prototype[e]=function(){var t=[this._wrapped];return i.o.apply(t,arguments),bn(this,n.apply(U,t))}})),U}je(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=i.a[t];U.prototype[t]=function(){var n=this._wrapped;return null!=n&&(e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),bn(this,n)}})),je(["concat","join","slice"],(function(t){var e=i.a[t];U.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),bn(this,t)}}));var wn=U,xn=yn(r);xn._=xn;var On=xn},function(t,e,n){(function(r){var i,o,a;a="object"==typeof self&&self.self===self&&self||"object"==typeof r&&r.global===r&&r,i=[n(0),n(11),e],void 0===(o=function(t,e,n){a.Backbone=function(t,e,n,r){var i=t.Backbone,o=Array.prototype.slice;e.VERSION="1.3.3",e.$=r,e.noConflict=function(){return t.Backbone=i,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a=function(t,e,r){n.each(e,(function(e,i){n[i]&&(t.prototype[i]=function(t,e,r){switch(t){case 1:return function(){return n[e](this[r])};case 2:return function(t){return n[e](this[r],t)};case 3:return function(t,i){return n[e](this[r],s(t,this),i)};case 4:return function(t,i,o){return n[e](this[r],s(t,this),i,o)};default:return function(){var t=o.call(arguments);return t.unshift(this[r]),n[e].apply(n,t)}}}(e,i,r))}))},s=function(t,e){return n.isFunction(t)?t:n.isObject(t)&&!e._isModel(t)?l(t):n.isString(t)?function(e){return e.get(t)}:t},l=function(t){var e=n.matches(t);return function(t){return e(t.attributes)}},c=e.Events={},u=/\s+/,d=function(t,e,r,i,o){var a,s=0;if(r&&"object"==typeof r){void 0!==i&&"context"in o&&void 0===o.context&&(o.context=i);for(a=n.keys(r);s<a.length;s++)e=d(t,e,a[s],r[a[s]],o)}else if(r&&u.test(r))for(a=r.split(u);s<a.length;s++)e=t(e,a[s],i,o);else e=t(e,r,i,o);return e};c.on=function(t,e,n){return h(this,t,e,n)};var h=function(t,e,n,r,i){return t._events=d(f,t._events||{},e,n,{context:r,ctx:t,listening:i}),i&&((t._listeners||(t._listeners={}))[i.id]=i),t};c.listenTo=function(t,e,r){if(!t)return this;var i=t._listenId||(t._listenId=n.uniqueId("l")),o=this._listeningTo||(this._listeningTo={}),a=o[i];if(!a){var s=this._listenId||(this._listenId=n.uniqueId("l"));a=o[i]={obj:t,objId:i,id:s,listeningTo:o,count:0}}return h(t,e,r,this,a),this};var f=function(t,e,n,r){if(n){var i=t[e]||(t[e]=[]),o=r.context,a=r.ctx,s=r.listening;s&&s.count++,i.push({callback:n,context:o,ctx:o||a,listening:s})}return t};c.off=function(t,e,n){return this._events?(this._events=d(p,this._events,t,e,{context:n,listeners:this._listeners}),this):this},c.stopListening=function(t,e,r){var i=this._listeningTo;if(!i)return this;for(var o=t?[t._listenId]:n.keys(i),a=0;a<o.length;a++){var s=i[o[a]];if(!s)break;s.obj.off(e,r,this)}return this};var p=function(t,e,r,i){if(t){var o,a=0,s=i.context,l=i.listeners;if(e||r||s){for(var c=e?[e]:n.keys(t);a<c.length;a++){var u=t[e=c[a]];if(!u)break;for(var d=[],h=0;h<u.length;h++){var f=u[h];r&&r!==f.callback&&r!==f.callback._callback||s&&s!==f.context?d.push(f):(o=f.listening)&&0==--o.count&&(delete l[o.id],delete o.listeningTo[o.objId])}d.length?t[e]=d:delete t[e]}return t}for(var p=n.keys(l);a<p.length;a++)delete l[(o=l[p[a]]).id],delete o.listeningTo[o.objId]}};c.once=function(t,e,r){var i=d(g,{},t,e,n.bind(this.off,this));return"string"==typeof t&&null==r&&(e=void 0),this.on(i,e,r)},c.listenToOnce=function(t,e,r){var i=d(g,{},e,r,n.bind(this.stopListening,this,t));return this.listenTo(t,i)};var g=function(t,e,r,i){if(r){var o=t[e]=n.once((function(){i(e,o),r.apply(this,arguments)}));o._callback=r}return t};c.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),n=Array(e),r=0;r<e;r++)n[r]=arguments[r+1];return d(v,this._events,t,void 0,n),this};var v=function(t,e,n,r){if(t){var i=t[e],o=t.all;i&&o&&(o=o.slice()),i&&m(i,r),o&&m(o,[e].concat(r))}return t},m=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,s);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e);return}};c.bind=c.on,c.unbind=c.off,n.extend(e,c);var b=e.Model=function(t,e){var r=t||{};e||(e={}),this.cid=n.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(r=this.parse(r,e)||{});var i=n.result(this,"defaults");r=n.defaults(n.extend({},i,r),i),this.set(r,e),this.changed={},this.initialize.apply(this,arguments)};n.extend(b.prototype,c,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",initialize:function(){},toJSON:function(t){return n.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return n.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!n.iteratee(t,this)(this.attributes)},set:function(t,e,r){if(null==t)return this;var i;if("object"==typeof t?(i=t,r=e):(i={})[t]=e,r||(r={}),!this._validate(i,r))return!1;var o=r.unset,a=r.silent,s=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=n.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,d=this._previousAttributes;for(var h in i)e=i[h],n.isEqual(c[h],e)||s.push(h),n.isEqual(d[h],e)?delete u[h]:u[h]=e,o?delete c[h]:c[h]=e;if(this.idAttribute in i&&(this.id=this.get(this.idAttribute)),!a){s.length&&(this._pending=r);for(var f=0;f<s.length;f++)this.trigger("change:"+s[f],this,c[s[f]],r)}if(l)return this;if(!a)for(;this._pending;)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,n.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var r in this.attributes)e[r]=void 0;return this.set(e,n.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!n.isEmpty(this.changed):n.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&n.clone(this.changed);var e=this._changing?this._previousAttributes:this.attributes,r={};for(var i in t){var o=t[i];n.isEqual(e[i],o)||(r[i]=o)}return!!n.size(r)&&r},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(t){t=n.extend({parse:!0},t);var e=this,r=t.success;return t.success=function(n){var i=t.parse?e.parse(n,t):n;if(!e.set(i,t))return!1;r&&r.call(t.context,e,n,t),e.trigger("sync",e,n,t)},F(this,t),this.sync("read",this,t)},save:function(t,e,r){var i;null==t||"object"==typeof t?(i=t,r=e):(i={})[t]=e;var o=(r=n.extend({validate:!0,parse:!0},r)).wait;if(i&&!o){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;var a=this,s=r.success,l=this.attributes;r.success=function(t){a.attributes=l;var e=r.parse?a.parse(t,r):t;if(o&&(e=n.extend({},i,e)),e&&!a.set(e,r))return!1;s&&s.call(r.context,a,t,r),a.trigger("sync",a,t,r)},F(this,r),i&&o&&(this.attributes=n.extend({},l,i));var c=this.isNew()?"create":r.patch?"patch":"update";"patch"!==c||r.attrs||(r.attrs=i);var u=this.sync(c,this,r);return this.attributes=l,u},destroy:function(t){t=t?n.clone(t):{};var e=this,r=t.success,i=t.wait,o=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(n){i&&o(),r&&r.call(t.context,e,n,t),e.isNew()||e.trigger("sync",e,n,t)};var a=!1;return this.isNew()?n.defer(t.success):(F(this,t),a=this.sync("delete",this,t)),i||o(),a},url:function(){var t=n.result(this,"urlRoot")||n.result(this.collection,"url")||I();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},n.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=n.extend({},this.attributes,t);var r=this.validationError=this.validate(t,e)||null;return!r||(this.trigger("invalid",this,r,n.extend(e,{validationError:r})),!1)}}),a(b,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes");var y=e.Collection=function(t,e){e||(e={}),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,n.extend({silent:!0},e))},w={add:!0,remove:!0,merge:!0},x={add:!0,remove:!1},O=function(t,e,n){n=Math.min(Math.max(n,0),t.length);var r,i=Array(t.length-n),o=e.length;for(r=0;r<i.length;r++)i[r]=t[r+n];for(r=0;r<o;r++)t[r+n]=e[r];for(r=0;r<i.length;r++)t[r+o+n]=i[r]};n.extend(y.prototype,c,{model:b,initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,n.extend({merge:!1},e,x))},remove:function(t,e){e=n.extend({},e);var r=!n.isArray(t);t=r?[t]:t.slice();var i=this._removeModels(t,e);return!e.silent&&i.length&&(e.changes={added:[],merged:[],removed:i},this.trigger("update",this,e)),r?i[0]:i},set:function(t,e){if(null!=t){(e=n.extend({},w,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var r=!n.isArray(t);t=r?[t]:t.slice();var i=e.at;null!=i&&(i=+i),i>this.length&&(i=this.length),i<0&&(i+=this.length+1);var o,a,s=[],l=[],c=[],u=[],d={},h=e.add,f=e.merge,p=e.remove,g=!1,v=this.comparator&&null==i&&!1!==e.sort,m=n.isString(this.comparator)?this.comparator:null;for(a=0;a<t.length;a++){o=t[a];var b=this.get(o);if(b){if(f&&o!==b){var y=this._isModel(o)?o.attributes:o;e.parse&&(y=b.parse(y,e)),b.set(y,e),c.push(b),v&&!g&&(g=b.hasChanged(m))}d[b.cid]||(d[b.cid]=!0,s.push(b)),t[a]=b}else h&&(o=t[a]=this._prepareModel(o,e))&&(l.push(o),this._addReference(o,e),d[o.cid]=!0,s.push(o))}if(p){for(a=0;a<this.length;a++)d[(o=this.models[a]).cid]||u.push(o);u.length&&this._removeModels(u,e)}var x=!1,C=!v&&h&&p;if(s.length&&C?(x=this.length!==s.length||n.some(this.models,(function(t,e){return t!==s[e]})),this.models.length=0,O(this.models,s,0),this.length=this.models.length):l.length&&(v&&(g=!0),O(this.models,l,null==i?this.length:i),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(a=0;a<l.length;a++)null!=i&&(e.index=i+a),(o=l[a]).trigger("add",o,this,e);(g||x)&&this.trigger("sort",this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},this.trigger("update",this,e))}return r?t[0]:t}},reset:function(t,e){e=e?n.clone(e):{};for(var r=0;r<this.models.length;r++)this._removeReference(this.models[r],e);return e.previousModels=this.models,this._reset(),t=this.add(t,n.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,n.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,n.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return o.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(t.attributes||t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var r=e.length;return n.isFunction(e)&&(e=n.bind(e,this)),1===r||n.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){var e=(t=n.extend({parse:!0},t)).success,r=this;return t.success=function(n){var i=t.reset?"reset":"set";r[i](n,t),e&&e.call(t.context,r,n,t),r.trigger("sync",r,n,t)},F(this,t),this.sync("read",this,t)},create:function(t,e){var r=(e=e?n.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;r||this.add(t,e);var i=this,o=e.success;return e.success=function(t,e,n){r&&i.add(t,n),o&&o.call(n.context,t,e,n)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?n.clone(e):{}).collection=this;var r=new this.model(t,e);return r.validationError?(this.trigger("invalid",this,r.validationError,e),!1):r},_removeModels:function(t,e){for(var n=[],r=0;r<t.length;r++){var i=this.get(t[r]);if(i){var o=this.indexOf(i);this.models.splice(o,1),this.length--,delete this._byId[i.cid];var a=this.modelId(i.attributes);null!=a&&delete this._byId[a],e.silent||(e.index=o,i.trigger("remove",i,this,e)),n.push(i),this._removeReference(i,e)}}return n},_isModel:function(t){return t instanceof b},_addReference:function(t,e){this._byId[t.cid]=t;var n=this.modelId(t.attributes);null!=n&&(this._byId[n]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var n=this.modelId(t.attributes);null!=n&&delete this._byId[n],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){if(e){if(("add"===t||"remove"===t)&&n!==this)return;if("destroy"===t&&this.remove(e,r),"change"===t){var i=this.modelId(e.previousAttributes()),o=this.modelId(e.attributes);i!==o&&(null!=i&&delete this._byId[i],null!=o&&(this._byId[o]=e))}}this.trigger.apply(this,arguments)}}),a(y,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models");var C=e.View=function(t){this.cid=n.uniqueId("view"),n.extend(this,n.pick(t,k)),this._ensureElement(),this.initialize.apply(this,arguments)},S=/^(\S+)\s*(.*)$/,k=["model","collection","el","id","attributes","className","tagName","events"];n.extend(C.prototype,c,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=n.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var r=t[e];if(n.isFunction(r)||(r=this[r]),r){var i=e.match(S);this.delegate(i[1],i[2],n.bind(r,this))}}return this},delegate:function(t,e,n){return this.$el.on(t+".delegateEvents"+this.cid,e,n),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,n){return this.$el.off(t+".delegateEvents"+this.cid,e,n),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(n.result(this,"el"));else{var t=n.extend({},n.result(this,"attributes"));this.id&&(t.id=n.result(this,"id")),this.className&&(t.class=n.result(this,"className")),this.setElement(this._createElement(n.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}}),e.sync=function(t,r,i){var o=j[t];n.defaults(i||(i={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:o,dataType:"json"};if(i.url||(a.url=n.result(r,"url")||I()),null!=i.data||!r||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),i.emulateHTTP&&("PUT"===o||"DELETE"===o||"PATCH"===o)){a.type="POST",i.emulateJSON&&(a.data._method=o);var s=i.beforeSend;i.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",o),s)return s.apply(this,arguments)}}"GET"===a.type||i.emulateJSON||(a.processData=!1);var l=i.error;i.error=function(t,e,n){i.textStatus=e,i.errorThrown=n,l&&l.call(i.context,t,e,n)};var c=i.xhr=e.ajax(n.extend(a,i));return r.trigger("request",r,c,i),c};var j={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var T=e.Router=function(t){t||(t={}),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},P=/\((.*?)\)/g,E=/(\(\?)?:\w+/g,D=/\*\w+/g,M=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(T.prototype,c,{initialize:function(){},route:function(t,r,i){n.isRegExp(t)||(t=this._routeToRegExp(t)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var o=this;return e.history.route(t,(function(n){var a=o._extractParameters(t,n);!1!==o.execute(i,a,r)&&(o.trigger.apply(o,["route:"+r].concat(a)),o.trigger("route",r,a),e.history.trigger("route",o,r,a))})),this},execute:function(t,e,n){t&&t.apply(this,e)},navigate:function(t,n){return e.history.navigate(t,n),this},_bindRoutes:function(){if(this.routes){this.routes=n.result(this,"routes");for(var t,e=n.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(M,"\\$&").replace(P,"(?:$1)?").replace(E,(function(t,e){return e?t:"([^/?]+)"})).replace(D,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return n.map(r,(function(t,e){return e===r.length-1?t||null:t?decodeURIComponent(t):null}))}});var A=e.History=function(){this.handlers=[],this.checkUrl=n.bind(this.checkUrl,this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},L=/^[#\/]|\s+$/g,N=/^\/+|\/+$/g,_=/#.*$/;A.started=!1,n.extend(A.prototype,c,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(L,"")},start:function(t){if(A.started)throw new Error("Backbone.history has already been started");if(A.started=!0,this.options=n.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(N,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var r=document.body,i=r.insertBefore(this.iframe,r.firstChild).contentWindow;i.document.open(),i.document.close(),i.location.hash="#"+this.fragment}var o=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?o("popstate",this.checkUrl,!1):th