/*!
 * jQuery JavaScript Library v1.11.2
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2014-12-17T15:27Z
 */

/*!
 * Sizzle CSS Selector Engine v2.2.0-pre
 * http://sizzlejs.com/
 *
 * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2014-12-16
 */

//     Underscore.js 1.5.1
//     http://underscorejs.org
//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Underscore may be freely distributed under the MIT license.

/**
 * @license RequireJS text 2.0.13+ Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */

//! license : MIT

/*!
 * JavaScript Cookie v2.1.0
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */

//     (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
//     Backbone may be freely distributed under the MIT license.
//     For all details and documentation:
//     http://backbonejs.org

/*
  backbone.paginator
  http://github.com/backbone-paginator/backbone.paginator

  Copyright (c) 2016 Jimmy Yuen Ho Wong and contributors
  Licensed under the MIT @license.
*/

/*
 * SimpleModal @VERSION - jQuery Plugin
 * http://simplemodal.com/
 * Copyright (c) 2014 Eric Martin
 * Licensed under MIT and GPL
 * Date:
 */

/*
Copyright 2012 Igor Vaynberg

Version: 3.5.2 Timestamp: Sat Nov  1 14:43:36 EDT 2014

This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.

You may obtain a copy of the Apache License and the GPL License at:

    http://www.apache.org/licenses/LICENSE-2.0
    http://www.gnu.org/licenses/gpl-2.0.html

Unless required by applicable law or agreed to in writing, software distributed under the
Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
the specific language governing permissions and limitations under the Apache License and the GPL License.
*/

/*! jQuery UI - v1.11.3 - 2015-02-14
* http://jqueryui.com
* Includes: core.js, widget.js, tabs.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */

/*!
 * jQuery UI Core 1.11.3
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/category/ui-core/
 */

/*!
 * jQuery UI Widget 1.11.3
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/jQuery.widget/
 */

/*!
 * jQuery UI Tabs 1.11.3
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/tabs/
 */

/*! jQuery UI - v1.11.1 - 2014-09-17
* http://jqueryui.com
* Includes: widget.js
* Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */

/*!
 * jQuery UI Widget 1.11.1
 * http://jqueryui.com
 *
 * Copyright 2014 jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/jQuery.widget/
 */

/*
 * jQuery File Upload Plugin
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

/*
 * jQuery File Upload Processing Plugin
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2012, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

/*
 * jQuery File Upload Validation Plugin
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2013, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

/*
 * jQuery File Upload User Interface Plugin
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2010, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function i(e){var t=e.length,i=re.type(e);return"function"!==i&&!re.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===i||0===t||"number"==typeof t&&t>0&&t-1 in e))}function n(e,t,i){if(re.isFunction(t))return re.grep(e,function(e,n){return!!t.call(e,n,e)!==i});if(t.nodeType)return re.grep(e,function(e){return e===t!==i});if("string"==typeof t){if(he.test(t))return re.filter(t,e,i);t=re.filter(t,e)}return re.grep(e,function(e){return re.inArray(e,t)>=0!==i})}function r(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}function s(e){var t=Ye[e]={};return re.each(e.match(ye)||[],function(e,i){t[i]=!0}),t}function o(){fe.addEventListener?(fe.removeEventListener("DOMContentLoaded",a,!1),e.removeEventListener("load",a,!1)):(fe.detachEvent("onreadystatechange",a),e.detachEvent("onload",a))}function a(){(fe.addEventListener||"load"===event.type||"complete"===fe.readyState)&&(o(),re.ready())}function l(e,t,i){if(void 0===i&&1===e.nodeType){var n="data-"+t.replace(Ce,"-$1").toLowerCase();if(i=e.getAttribute(n),"string"==typeof i){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:Te.test(i)?re.parseJSON(i):i)}catch(e){}re.data(e,t,i)}else i=void 0}return i}function c(e){var t;for(t in e)if(("data"!==t||!re.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function u(e,t,i,n){if(re.acceptData(e)){var r,s,o=re.expando,a=e.nodeType,l=a?re.cache:e,c=a?e[o]:e[o]&&o;if(c&&l[c]&&(n||l[c].data)||void 0!==i||"string"!=typeof t)return c||(c=a?e[o]=K.pop()||re.guid++:o),l[c]||(l[c]=a?{}:{toJSON:re.noop}),"object"!=typeof t&&"function"!=typeof t||(n?l[c]=re.extend(l[c],t):l[c].data=re.extend(l[c].data,t)),s=l[c],n||(s.data||(s.data={}),s=s.data),void 0!==i&&(s[re.camelCase(t)]=i),"string"==typeof t?(r=s[t],null==r&&(r=s[re.camelCase(t)])):r=s,r}}function d(e,t,i){if(re.acceptData(e)){var n,r,s=e.nodeType,o=s?re.cache:e,a=s?e[re.expando]:re.expando;if(o[a]){if(t&&(n=i?o[a]:o[a].data)){re.isArray(t)?t=t.concat(re.map(t,re.camelCase)):t in n?t=[t]:(t=re.camelCase(t),t=t in n?[t]:t.split(" ")),r=t.length;for(;r--;)delete n[t[r]];if(i?!c(n):!re.isEmptyObject(n))return}(i||(delete o[a].data,c(o[a])))&&(s?re.cleanData([e],!0):ie.deleteExpando||o!=o.window?delete o[a]:o[a]=null)}}}function h(){return!0}function p(){return!1}function f(){try{return fe.activeElement}catch(e){}}function m(e){var t=Fe.split("|"),i=e.createDocumentFragment();if(i.createElement)for(;t.length;)i.createElement(t.pop());return i}function g(e,t){var i,n,r=0,s=typeof e.getElementsByTagName!==Se?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==Se?e.querySelectorAll(t||"*"):void 0;if(!s)for(s=[],i=e.childNodes||e;null!=(n=i[r]);r++)!t||re.nodeName(n,t)?s.push(n):re.merge(s,g(n,t));return void 0===t||t&&re.nodeName(e,t)?re.merge([e],s):s}function v(e){xe.test(e.type)&&(e.defaultChecked=e.checked)}function _(e,t){return re.nodeName(e,"table")&&re.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function y(e){return e.type=(null!==re.find.attr(e,"type"))+"/"+e.type,e}function Y(e){var t=Oe.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function b(e,t){for(var i,n=0;null!=(i=e[n]);n++)re._data(i,"globalEval",!t||re._data(t[n],"globalEval"))}function L(e,t){if(1===t.nodeType&&re.hasData(e)){var i,n,r,s=re._data(e),o=re._data(t,s),a=s.events;if(a){delete o.handle,o.events={};for(i in a)for(n=0,r=a[i].length;n<r;n++)re.event.add(t,i,a[i][n])}o.data&&(o.data=re.extend({},o.data))}}function S(e,t){var i,n,r;if(1===t.nodeType){if(i=t.nodeName.toLowerCase(),!ie.noCloneEvent&&t[re.expando]){r=re._data(t);for(n in r.events)re.removeEvent(t,n,r.handle);t.removeAttribute(re.expando)}"script"===i&&t.text!==e.text?(y(t).text=e.text,Y(t)):"object"===i?(t.parentNode&&(t.outerHTML=e.outerHTML),ie.html5Clone&&e.innerHTML&&!re.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===i&&xe.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===i?t.defaultSelected=t.selected=e.defaultSelected:"input"!==i&&"textarea"!==i||(t.defaultValue=e.defaultValue)}}function T(t,i){var n,r=re(i.createElement(t)).appendTo(i.body),s=e.getDefaultComputedStyle&&(n=e.getDefaultComputedStyle(r[0]))?n.display:re.css(r[0],"display");return r.detach(),s}function C(e){var t=fe,i=Ve[e];return i||(i=T(e,t),"none"!==i&&i||(qe=(qe||re("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=(qe[0].contentWindow||qe[0].contentDocument).document,t.write(),t.close(),i=T(e,t),qe.detach()),Ve[e]=i),i}function w(e,t){return{get:function(){var i=e();if(null!=i)return i?void delete this.get:(this.get=t).apply(this,arguments)}}}function Z(e,t){if(t in e)return t;for(var i=t.charAt(0).toUpperCase()+t.slice(1),n=t,r=ht.length;r--;)if(t=ht[r]+i,t in e)return t;return n}function D(e,t){for(var i,n,r,s=[],o=0,a=e.length;o<a;o++)n=e[o],n.style&&(s[o]=re._data(n,"olddisplay"),i=n.style.display,t?(s[o]||"none"!==i||(n.style.display=""),""===n.style.display&&De(n)&&(s[o]=re._data(n,"olddisplay",C(n.nodeName)))):(r=De(n),(i&&"none"!==i||!r)&&re._data(n,"olddisplay",r?i:re.css(n,"display"))));for(o=0;o<a;o++)n=e[o],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?s[o]||"":"none"));return e}function M(e,t,i){var n=lt.exec(t);return n?Math.max(0,n[1]-(i||0))+(n[2]||"px"):t}function x(e,t,i,n,r){for(var s=i===(n?"border":"content")?4:"width"===t?1:0,o=0;s<4;s+=2)"margin"===i&&(o+=re.css(e,i+Ze[s],!0,r)),n?("content"===i&&(o-=re.css(e,"padding"+Ze[s],!0,r)),"margin"!==i&&(o-=re.css(e,"border"+Ze[s]+"Width",!0,r))):(o+=re.css(e,"padding"+Ze[s],!0,r),"padding"!==i&&(o+=re.css(e,"border"+Ze[s]+"Width",!0,r)));return o}function H(e,t,i){var n=!0,r="width"===t?e.offsetWidth:e.offsetHeight,s=et(e),o=ie.boxSizing&&"border-box"===re.css(e,"boxSizing",!1,s);if(r<=0||null==r){if(r=tt(e,t,s),(r<0||null==r)&&(r=e.style[t]),nt.test(r))return r;n=o&&(ie.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+x(e,t,i||(o?"border":"content"),n,s)+"px"}function X(e,t,i,n,r){return new X.prototype.init(e,t,i,n,r)}function P(){return setTimeout(function(){pt=void 0}),pt=re.now()}function J(e,t){var i,n={height:e},r=0;for(t=t?1:0;r<4;r+=2-t)i=Ze[r],n["margin"+i]=n["padding"+i]=e;return t&&(n.opacity=n.width=e),n}function k(e,t,i){for(var n,r=(yt[t]||[]).concat(yt["*"]),s=0,o=r.length;s<o;s++)if(n=r[s].call(i,t,e))return n}function F(e,t,i){var n,r,s,o,a,l,c,u,d=this,h={},p=e.style,f=e.nodeType&&De(e),m=re._data(e,"fxshow");i.queue||(a=re._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,l=a.empty.fire,a.empty.fire=function(){a.unqueued||l()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,re.queue(e,"fx").length||a.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(i.overflow=[p.overflow,p.overflowX,p.overflowY],c=re.css(e,"display"),u="none"===c?re._data(e,"olddisplay")||C(e.nodeName):c,"inline"===u&&"none"===re.css(e,"float")&&(ie.inlineBlockNeedsLayout&&"inline"!==C(e.nodeName)?p.zoom=1:p.display="inline-block")),i.overflow&&(p.overflow="hidden",ie.shrinkWrapBlocks()||d.always(function(){p.overflow=i.overflow[0],p.overflowX=i.overflow[1],p.overflowY=i.overflow[2]}));for(n in t)if(r=t[n],mt.exec(r)){if(delete t[n],s=s||"toggle"===r,r===(f?"hide":"show")){if("show"!==r||!m||void 0===m[n])continue;f=!0}h[n]=m&&m[n]||re.style(e,n)}else c=void 0;if(re.isEmptyObject(h))"inline"===("none"===c?C(e.nodeName):c)&&(p.display=c);else{m?"hidden"in m&&(f=m.hidden):m=re._data(e,"fxshow",{}),s&&(m.hidden=!f),f?re(e).show():d.done(function(){re(e).hide()}),d.done(function(){var t;re._removeData(e,"fxshow");for(t in h)re.style(e,t,h[t])});for(n in h)o=k(f?m[n]:0,n,d),n in m||(m[n]=o.start,f&&(o.end=o.start,o.start="width"===n||"height"===n?1:0))}}function Q(e,t){var i,n,r,s,o;for(i in e)if(n=re.camelCase(i),r=t[n],s=e[i],re.isArray(s)&&(r=s[1],s=e[i]=s[0]),i!==n&&(e[n]=s,delete e[i]),o=re.cssHooks[n],o&&"expand"in o){s=o.expand(s),delete e[n];for(i in s)i in e||(e[i]=s[i],t[i]=r)}else t[n]=r}function N(e,t,i){var n,r,s=0,o=_t.length,a=re.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var t=pt||P(),i=Math.max(0,c.startTime+c.duration-t),n=i/c.duration||0,s=1-n,o=0,l=c.tweens.length;o<l;o++)c.tweens[o].run(s);return a.notifyWith(e,[c,s,i]),s<1&&l?i:(a.resolveWith(e,[c]),!1)},c=a.promise({elem:e,props:re.extend({},t),opts:re.extend(!0,{specialEasing:{}},i),originalProperties:t,originalOptions:i,startTime:pt||P(),duration:i.duration,tweens:[],createTween:function(t,i){var n=re.Tween(e,c.opts,t,i,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(n),n},stop:function(t){var i=0,n=t?c.tweens.length:0;if(r)return this;for(r=!0;i<n;i++)c.tweens[i].run(1);return t?a.resolveWith(e,[c,t]):a.rejectWith(e,[c,t]),this}}),u=c.props;for(Q(u,c.opts.specialEasing);s<o;s++)if(n=_t[s].call(c,e,u,c.opts))return n;return re.map(u,k,c),re.isFunction(c.opts.start)&&c.opts.start.call(e,c),re.fx.timer(re.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function B(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,r=0,s=t.toLowerCase().match(ye)||[];if(re.isFunction(i))for(;n=s[r++];)"+"===n.charAt(0)?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function W(e,t,i,n){function r(a){var l;return s[a]=!0,re.each(e[a]||[],function(e,a){var c=a(t,i,n);return"string"!=typeof c||o||s[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),r(c),!1)}),l}var s={},o=e===Rt;return r(t.dataTypes[0])||!s["*"]&&r("*")}function E(e,t){var i,n,r=re.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&re.extend(!0,e,i),e}function G(e,t,i){for(var n,r,s,o,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in a)if(a[o]&&a[o].test(r)){l.unshift(o);break}if(l[0]in i)s=l[0];else{for(o in i){if(!l[0]||e.converters[o+" "+l[0]]){s=o;break}n||(n=o)}s=s||n}if(s)return s!==l[0]&&l.unshift(s),i[s]}function R(e,t,i,n){var r,s,o,a,l,c={},u=e.dataTypes.slice();if(u[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(s=u.shift();s;)if(e.responseFields[s]&&(i[e.responseFields[s]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=u.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(o=c[l+" "+s]||c["* "+s],!o)for(r in c)if(a=r.split(" "),a[1]===s&&(o=c[l+" "+a[0]]||c["* "+a[0]])){o===!0?o=c[r]:c[r]!==!0&&(s=a[0],u.unshift(a[1]));break}if(o!==!0)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}function j(e,t,i,n){var r;if(re.isArray(t))re.each(t,function(t,r){i||At.test(e)?n(e,r):j(e+"["+("object"==typeof r?t:"")+"]",r,i,n)});else if(i||"object"!==re.type(t))n(e,t);else for(r in t)j(e+"["+r+"]",t[r],i,n)}function $(){try{return new e.XMLHttpRequest}catch(e){}}function A(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function O(e){return re.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}var K=[],I=K.slice,U=K.concat,z=K.push,q=K.indexOf,V={},ee=V.toString,te=V.hasOwnProperty,ie={},ne="1.11.2",re=function(e,t){return new re.fn.init(e,t)},se=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,oe=/^-ms-/,ae=/-([\da-z])/gi,le=function(e,t){return t.toUpperCase()};re.fn=re.prototype={jquery:ne,constructor:re,selector:"",length:0,toArray:function(){return I.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:I.call(this)},pushStack:function(e){var t=re.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return re.each(this,e,t)},map:function(e){return this.pushStack(re.map(this,function(t,i){return e.call(t,i,t)}))},slice:function(){return this.pushStack(I.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(e<0?t:0);return this.pushStack(i>=0&&i<t?[this[i]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:z,sort:K.sort,splice:K.splice},re.extend=re.fn.extend=function(){var e,t,i,n,r,s,o=arguments[0]||{},a=1,l=arguments.length,c=!1;for("boolean"==typeof o&&(c=o,o=arguments[a]||{},a++),"object"==typeof o||re.isFunction(o)||(o={}),a===l&&(o=this,a--);a<l;a++)if(null!=(r=arguments[a]))for(n in r)e=o[n],i=r[n],o!==i&&(c&&i&&(re.isPlainObject(i)||(t=re.isArray(i)))?(t?(t=!1,s=e&&re.isArray(e)?e:[]):s=e&&re.isPlainObject(e)?e:{},o[n]=re.extend(c,s,i)):void 0!==i&&(o[n]=i));return o},re.extend({expando:"jQuery"+(ne+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===re.type(e)},isArray:Array.isArray||function(e){return"array"===re.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!re.isArray(e)&&e-parseFloat(e)+1>=0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==re.type(e)||e.nodeType||re.isWindow(e))return!1;try{if(e.constructor&&!te.call(e,"constructor")&&!te.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}if(ie.ownLast)for(t in e)return te.call(e,t);for(t in e);return void 0===t||te.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?V[ee.call(e)]||"object":typeof e},globalEval:function(t){t&&re.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(oe,"ms-").replace(ae,le)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,s=0,o=e.length,a=i(e);if(n){if(a)for(;s<o&&(r=t.apply(e[s],n),r!==!1);s++);else for(s in e)if(r=t.apply(e[s],n),r===!1)break}else if(a)for(;s<o&&(r=t.call(e[s],s,e[s]),r!==!1);s++);else for(s in e)if(r=t.call(e[s],s,e[s]),r===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(se,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(i(Object(e))?re.merge(n,"string"==typeof e?[e]:e):z.call(n,e)),n},inArray:function(e,t,i){var n;if(t){if(q)return q.call(t,e,i);for(n=t.length,i=i?i<0?Math.max(0,n+i):i:0;i<n;i++)if(i in t&&t[i]===e)return i}return-1},merge:function(e,t){for(var i=+t.length,n=0,r=e.length;n<i;)e[r++]=t[n++];if(i!==i)for(;void 0!==t[n];)e[r++]=t[n++];return e.length=r,e},grep:function(e,t,i){for(var n,r=[],s=0,o=e.length,a=!i;s<o;s++)n=!t(e[s],s),n!==a&&r.push(e[s]);return r},map:function(e,t,n){var r,s=0,o=e.length,a=i(e),l=[];if(a)for(;s<o;s++)r=t(e[s],s,n),null!=r&&l.push(r);else for(s in e)r=t(e[s],s,n),null!=r&&l.push(r);return U.apply([],l)},guid:1,proxy:function(e,t){var i,n,r;if("string"==typeof t&&(r=e[t],t=e,e=r),re.isFunction(e))return i=I.call(arguments,2),n=function(){return e.apply(t||this,i.concat(I.call(arguments)))},n.guid=e.guid=e.guid||re.guid++,n},now:function(){return+new Date},support:ie}),re.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){V["[object "+t+"]"]=t.toLowerCase()});var ce=function(e){function t(e,t,i,n){var r,s,o,a,l,c,d,p,f,m;if((t?t.ownerDocument||t:W)!==X&&H(t),t=t||X,i=i||[],a=t.nodeType,"string"!=typeof e||!e||1!==a&&9!==a&&11!==a)return i;if(!n&&J){if(11!==a&&(r=_e.exec(e)))if(o=r[1]){if(9===a){if(s=t.getElementById(o),!s||!s.parentNode)return i;if(s.id===o)return i.push(s),i}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(o))&&N(t,s)&&s.id===o)return i.push(s),i}else{if(r[2])return q.apply(i,t.getElementsByTagName(e)),i;if((o=r[3])&&b.getElementsByClassName)return q.apply(i,t.getElementsByClassName(o)),i}if(b.qsa&&(!k||!k.test(e))){if(p=d=B,f=t,m=1!==a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){for(c=C(e),(d=t.getAttribute("id"))?p=d.replace(Ye,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+h(c[l]);f=ye.test(e)&&u(t.parentNode)||t,m=c.join(",")}if(m)try{return q.apply(i,f.querySelectorAll(m)),i}catch(e){}finally{d||t.removeAttribute("id")}}}return Z(e.replace(le,"$1"),t,i,n)}function i(){function e(i,n){return t.push(i+" ")>L.cacheLength&&delete e[t.shift()],e[i+" "]=n}var t=[];return e}function n(e){return e[B]=!0,e}function r(e){var t=X.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function s(e,t){for(var i=e.split("|"),n=e.length;n--;)L.attrHandle[i[n]]=t}function o(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||O)-(~e.sourceIndex||O);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function a(e){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===e}}function l(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}function c(e){return n(function(t){return t=+t,n(function(i,n){for(var r,s=e([],i.length,t),o=s.length;o--;)i[r=s[o]]&&(i[r]=!(n[r]=i[r]))})})}function u(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function h(e){for(var t=0,i=e.length,n="";t<i;t++)n+=e[t].value;return n}function p(e,t,i){var n=t.dir,r=i&&"parentNode"===n,s=G++;return t.first?function(t,i,s){for(;t=t[n];)if(1===t.nodeType||r)return e(t,i,s)}:function(t,i,o){var a,l,c=[E,s];if(o){for(;t=t[n];)if((1===t.nodeType||r)&&e(t,i,o))return!0}else for(;t=t[n];)if(1===t.nodeType||r){if(l=t[B]||(t[B]={}),(a=l[n])&&a[0]===E&&a[1]===s)return c[2]=a[2];if(l[n]=c,c[2]=e(t,i,o))return!0}}}function f(e){return e.length>1?function(t,i,n){for(var r=e.length;r--;)if(!e[r](t,i,n))return!1;return!0}:e[0]}function m(e,i,n){for(var r=0,s=i.length;r<s;r++)t(e,i[r],n);return n}function g(e,t,i,n,r){for(var s,o=[],a=0,l=e.length,c=null!=t;a<l;a++)(s=e[a])&&(i&&!i(s,n,r)||(o.push(s),c&&t.push(a)));return o}function v(e,t,i,r,s,o){return r&&!r[B]&&(r=v(r)),s&&!s[B]&&(s=v(s,o)),n(function(n,o,a,l){var c,u,d,h=[],p=[],f=o.length,v=n||m(t||"*",a.nodeType?[a]:a,[]),_=!e||!n&&t?v:g(v,h,e,a,l),y=i?s||(n?e:f||r)?[]:o:_;if(i&&i(_,y,a,l),r)for(c=g(y,p),r(c,[],a,l),u=c.length;u--;)(d=c[u])&&(y[p[u]]=!(_[p[u]]=d));if(n){if(s||e){if(s){for(c=[],u=y.length;u--;)(d=y[u])&&c.push(_[u]=d);s(null,y=[],c,l)}for(u=y.length;u--;)(d=y[u])&&(c=s?ee(n,d):h[u])>-1&&(n[c]=!(o[c]=d))}}else y=g(y===o?y.splice(f,y.length):y),s?s(null,o,y,l):q.apply(o,y)})}function _(e){for(var t,i,n,r=e.length,s=L.relative[e[0].type],o=s||L.relative[" "],a=s?1:0,l=p(function(e){return e===t},o,!0),c=p(function(e){return ee(t,e)>-1},o,!0),u=[function(e,i,n){var r=!s&&(n||i!==D)||((t=i).nodeType?l(e,i,n):c(e,i,n));return t=null,r}];a<r;a++)if(i=L.relative[e[a].type])u=[p(f(u),i)];else{if(i=L.filter[e[a].type].apply(null,e[a].matches),i[B]){for(n=++a;n<r&&!L.relative[e[n].type];n++);return v(a>1&&f(u),a>1&&h(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(le,"$1"),i,a<n&&_(e.slice(a,n)),n<r&&_(e=e.slice(n)),n<r&&h(e))}u.push(i)}return f(u)}function y(e,i){var r=i.length>0,s=e.length>0,o=function(n,o,a,l,c){var u,d,h,p=0,f="0",m=n&&[],v=[],_=D,y=n||s&&L.find.TAG("*",c),Y=E+=null==_?1:Math.random()||.1,b=y.length;for(c&&(D=o!==X&&o);f!==b&&null!=(u=y[f]);f++){if(s&&u){for(d=0;h=e[d++];)if(h(u,o,a)){l.push(u);break}c&&(E=Y)}r&&((u=!h&&u)&&p--,n&&m.push(u))}if(p+=f,r&&f!==p){for(d=0;h=i[d++];)h(m,v,o,a);if(n){if(p>0)for(;f--;)m[f]||v[f]||(v[f]=U.call(l));v=g(v)}q.apply(l,v),c&&!n&&v.length>0&&p+i.length>1&&t.uniqueSort(l)}return c&&(E=Y,D=_),m};return r?n(o):o}var Y,b,L,S,T,C,w,Z,D,M,x,H,X,P,J,k,F,Q,N,B="sizzle"+1*new Date,W=e.document,E=0,G=0,R=i(),j=i(),$=i(),A=function(e,t){return e===t&&(x=!0),0},O=1<<31,K={}.hasOwnProperty,I=[],U=I.pop,z=I.push,q=I.push,V=I.slice,ee=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ie="[\\x20\\t\\r\\n\\f]",ne="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",re=ne.replace("w","w#"),se="\\["+ie+"*("+ne+")(?:"+ie+"*([*^$|!~]?=)"+ie+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+re+"))|)"+ie+"*\\]",oe=":("+ne+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+se+")*)|.*)\\)|)",ae=new RegExp(ie+"+","g"),le=new RegExp("^"+ie+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ie+"+$","g"),ce=new RegExp("^"+ie+"*,"+ie+"*"),ue=new RegExp("^"+ie+"*([>+~]|"+ie+")"+ie+"*"),de=new RegExp("="+ie+"*([^\\]'\"]*?)"+ie+"*\\]","g"),he=new RegExp(oe),pe=new RegExp("^"+re+"$"),fe={ID:new RegExp("^#("+ne+")"),CLASS:new RegExp("^\\.("+ne+")"),TAG:new RegExp("^("+ne.replace("w","w*")+")"),ATTR:new RegExp("^"+se),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ie+"*(even|odd|(([+-]|)(\\d*)n|)"+ie+"*(?:([+-]|)"+ie+"*(\\d+)|))"+ie+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ie+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ie+"*((?:-\\d)?\\d*)"+ie+"*\\)|)(?=[^-]|$)","i")},me=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,_e=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,Ye=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ie+"?|("+ie+")|.)","ig"),Le=function(e,t,i){var n="0x"+t-65536;return n!==n||i?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},Se=function(){H()};try{q.apply(I=V.call(W.childNodes),W.childNodes),I[W.childNodes.length].nodeType}catch(e){q={apply:I.length?function(e,t){z.apply(e,V.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}b=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},H=t.setDocument=function(e){var t,i,n=e?e.ownerDocument||e:W;return n!==X&&9===n.nodeType&&n.documentElement?(X=n,P=n.documentElement,i=n.defaultView,i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",Se,!1):i.attachEvent&&i.attachEvent("onunload",Se)),J=!T(n),b.attributes=r(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByTagName=r(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),b.getElementsByClassName=ve.test(n.getElementsByClassName),b.getById=r(function(e){return P.appendChild(e).id=B,!n.getElementsByName||!n.getElementsByName(B).length}),b.getById?(L.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&J){var i=t.getElementById(e);return i&&i.parentNode?[i]:[]}},L.filter.ID=function(e){var t=e.replace(be,Le);return function(e){return e.getAttribute("id")===t}}):(delete L.find.ID,L.filter.ID=function(e){var t=e.replace(be,Le);return function(e){var i="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return i&&i.value===t}}),L.find.TAG=b.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(e):void 0}:function(e,t){var i,n=[],r=0,s=t.getElementsByTagName(e);if("*"===e){for(;i=s[r++];)1===i.nodeType&&n.push(i);return n}return s},L.find.CLASS=b.getElementsByClassName&&function(e,t){if(J)return t.getElementsByClassName(e)},F=[],k=[],(b.qsa=ve.test(n.querySelectorAll))&&(r(function(e){P.appendChild(e).innerHTML="<a id='"+B+"'></a><select id='"+B+"-\f]' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&k.push("[*^$]="+ie+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||k.push("\\["+ie+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+B+"-]").length||k.push("~="),e.querySelectorAll(":checked").length||k.push(":checked"),e.querySelectorAll("a#"+B+"+*").length||k.push(".#.+[+~]")}),r(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&k.push("name"+ie+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||k.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),k.push(",.*:")})),(b.matchesSelector=ve.test(Q=P.matches||P.webkitMatchesSelector||P.mozMatchesSelector||P.oMatchesSelector||P.msMatchesSelector))&&r(function(e){b.disconnectedMatch=Q.call(e,"div"),Q.call(e,"[s!='']:x"),F.push("!=",oe)}),k=k.length&&new RegExp(k.join("|")),F=F.length&&new RegExp(F.join("|")),t=ve.test(P.compareDocumentPosition),N=t||ve.test(P.contains)?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return x=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&i||!b.sortDetached&&t.compareDocumentPosition(e)===i?e===n||e.ownerDocument===W&&N(W,e)?-1:t===n||t.ownerDocument===W&&N(W,t)?1:M?ee(M,e)-ee(M,t):0:4&i?-1:1)}:function(e,t){if(e===t)return x=!0,0;var i,r=0,s=e.parentNode,a=t.parentNode,l=[e],c=[t];if(!s||!a)return e===n?-1:t===n?1:s?-1:a?1:M?ee(M,e)-ee(M,t):0;if(s===a)return o(e,t);for(i=e;i=i.parentNode;)l.unshift(i);for(i=t;i=i.parentNode;)c.unshift(i);for(;l[r]===c[r];)r++;return r?o(l[r],c[r]):l[r]===W?-1:c[r]===W?1:0},n):X},t.matches=function(e,i){return t(e,null,null,i)},t.matchesSelector=function(e,i){if((e.ownerDocument||e)!==X&&H(e),i=i.replace(de,"='$1']"),b.matchesSelector&&J&&(!F||!F.test(i))&&(!k||!k.test(i)))try{var n=Q.call(e,i);if(n||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return t(i,X,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==X&&H(e),N(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==X&&H(e);var i=L.attrHandle[t.toLowerCase()],n=i&&K.call(L.attrHandle,t.toLowerCase())?i(e,t,!J):void 0;return void 0!==n?n:b.attributes||!J?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,i=[],n=0,r=0;if(x=!b.detectDuplicates,M=!b.sortStable&&e.slice(0),e.sort(A),x){for(;t=e[r++];)t===e[r]&&(n=i.push(r));for(;n--;)e.splice(i[n],1)}return M=null,e},S=t.getText=function(e){var t,i="",n=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=S(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[n++];)i+=S(t);return i},L=t.selectors={cacheLength:50,createPseudo:n,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,Le),e[3]=(e[3]||e[4]||e[5]||"").replace(be,Le),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,i=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":i&&he.test(i)&&(t=C(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,Le).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=R[e+" "];return t||(t=new RegExp("(^|"+ie+")"+e+"("+ie+"|$)"))&&R(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,i,n){return function(r){var s=t.attr(r,e);return null==s?"!="===i:!i||(s+="","="===i?s===n:"!="===i?s!==n:"^="===i?n&&0===s.indexOf(n):"*="===i?n&&s.indexOf(n)>-1:"$="===i?n&&s.slice(-n.length)===n:"~="===i?(" "+s.replace(ae," ")+" ").indexOf(n)>-1:"|="===i&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,i,n,r){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),a="of-type"===t;return 1===n&&0===r?function(e){return!!e.parentNode}:function(t,i,l){var c,u,d,h,p,f,m=s!==o?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),_=!l&&!a;if(g){if(s){for(;m;){for(d=t;d=d[m];)if(a?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&_){for(u=g[B]||(g[B]={}),c=u[e]||[],p=c[0]===E&&c[1],h=c[0]===E&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(h=p=0)||f.pop();)if(1===d.nodeType&&++h&&d===t){u[e]=[E,p,h];break}}else if(_&&(c=(t[B]||(t[B]={}))[e])&&c[0]===E)h=c[1];else for(;(d=++p&&d&&d[m]||(h=p=0)||f.pop())&&((a?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++h||(_&&((d[B]||(d[B]={}))[e]=[E,h]),d!==t)););return h-=r,h===n||h%n===0&&h/n>=0}}},PSEUDO:function(e,i){var r,s=L.pseudos[e]||L.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return s[B]?s(i):s.length>1?(r=[e,e,"",i],L.setFilters.hasOwnProperty(e.toLowerCase())?n(function(e,t){for(var n,r=s(e,i),o=r.length;o--;)n=ee(e,r[o]),e[n]=!(t[n]=r[o])}):function(e){return s(e,0,r)}):s}},pseudos:{not:n(function(e){var t=[],i=[],r=w(e.replace(le,"$1"));return r[B]?n(function(e,t,i,n){for(var s,o=r(e,null,n,[]),a=e.length;a--;)(s=o[a])&&(e[a]=!(t[a]=s))}):function(e,n,s){return t[0]=e,r(t,null,s,i),t[0]=null,!i.pop()}}),has:n(function(e){return function(i){return t(e,i).length>0}}),contains:n(function(e){return e=e.replace(be,Le),function(t){return(t.textContent||t.innerText||S(t)).indexOf(e)>-1}}),lang:n(function(e){return pe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,Le).toLowerCase(),function(t){var i;do if(i=J?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===e||0===i.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===P},focus:function(e){return e===X.activeElement&&(!X.hasFocus||X.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!L.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return me.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,i){return[i<0?i+t:i]}),even:c(function(e,t){for(var i=0;i<t;i+=2)e.push(i);return e}),odd:c(function(e,t){for(var i=1;i<t;i+=2)e.push(i);return e}),lt:c(function(e,t,i){for(var n=i<0?i+t:i;--n>=0;)e.push(n);return e}),gt:c(function(e,t,i){for(var n=i<0?i+t:i;++n<t;)e.push(n);return e})}},L.pseudos.nth=L.pseudos.eq;for(Y in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})L.pseudos[Y]=a(Y);for(Y in{submit:!0,reset:!0})L.pseudos[Y]=l(Y);return d.prototype=L.filters=L.pseudos,L.setFilters=new d,C=t.tokenize=function(e,i){var n,r,s,o,a,l,c,u=j[e+" "];if(u)return i?0:u.slice(0);for(a=e,l=[],c=L.preFilter;a;){n&&!(r=ce.exec(a))||(r&&(a=a.slice(r[0].length)||a),l.push(s=[])),n=!1,(r=ue.exec(a))&&(n=r.shift(),s.push({value:n,type:r[0].replace(le," ")}),a=a.slice(n.length));for(o in L.filter)!(r=fe[o].exec(a))||c[o]&&!(r=c[o](r))||(n=r.shift(),
s.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return i?a.length:a?t.error(e):j(e,l).slice(0)},w=t.compile=function(e,t){var i,n=[],r=[],s=$[e+" "];if(!s){for(t||(t=C(e)),i=t.length;i--;)s=_(t[i]),s[B]?n.push(s):r.push(s);s=$(e,y(r,n)),s.selector=e}return s},Z=t.select=function(e,t,i,n){var r,s,o,a,l,c="function"==typeof e&&e,d=!n&&C(e=c.selector||e);if(i=i||[],1===d.length){if(s=d[0]=d[0].slice(0),s.length>2&&"ID"===(o=s[0]).type&&b.getById&&9===t.nodeType&&J&&L.relative[s[1].type]){if(t=(L.find.ID(o.matches[0].replace(be,Le),t)||[])[0],!t)return i;c&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(r=fe.needsContext.test(e)?0:s.length;r--&&(o=s[r],!L.relative[a=o.type]);)if((l=L.find[a])&&(n=l(o.matches[0].replace(be,Le),ye.test(s[0].type)&&u(t.parentNode)||t))){if(s.splice(r,1),e=n.length&&h(s),!e)return q.apply(i,n),i;break}}return(c||w(e,d))(n,t,!J,i,ye.test(e)&&u(t.parentNode)||t),i},b.sortStable=B.split("").sort(A).join("")===B,b.detectDuplicates=!!x,H(),b.sortDetached=r(function(e){return 1&e.compareDocumentPosition(X.createElement("div"))}),r(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||s("type|href|height|width",function(e,t,i){if(!i)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),b.attributes&&r(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||s("value",function(e,t,i){if(!i&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),r(function(e){return null==e.getAttribute("disabled")})||s(te,function(e,t,i){var n;if(!i)return e[t]===!0?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),t}(e);re.find=ce,re.expr=ce.selectors,re.expr[":"]=re.expr.pseudos,re.unique=ce.uniqueSort,re.text=ce.getText,re.isXMLDoc=ce.isXML,re.contains=ce.contains;var ue=re.expr.match.needsContext,de=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,he=/^.[^:#\[\.,]*$/;re.filter=function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?re.find.matchesSelector(n,e)?[n]:[]:re.find.matches(e,re.grep(t,function(e){return 1===e.nodeType}))},re.fn.extend({find:function(e){var t,i=[],n=this,r=n.length;if("string"!=typeof e)return this.pushStack(re(e).filter(function(){for(t=0;t<r;t++)if(re.contains(n[t],this))return!0}));for(t=0;t<r;t++)re.find(e,n[t],i);return i=this.pushStack(r>1?re.unique(i):i),i.selector=this.selector?this.selector+" "+e:e,i},filter:function(e){return this.pushStack(n(this,e||[],!1))},not:function(e){return this.pushStack(n(this,e||[],!0))},is:function(e){return!!n(this,"string"==typeof e&&ue.test(e)?re(e):e||[],!1).length}});var pe,fe=e.document,me=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ge=re.fn.init=function(e,t){var i,n;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:me.exec(e),!i||!i[1]&&t)return!t||t.jquery?(t||pe).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof re?t[0]:t,re.merge(this,re.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:fe,!0)),de.test(i[1])&&re.isPlainObject(t))for(i in t)re.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}if(n=fe.getElementById(i[2]),n&&n.parentNode){if(n.id!==i[2])return pe.find(e);this.length=1,this[0]=n}return this.context=fe,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):re.isFunction(e)?"undefined"!=typeof pe.ready?pe.ready(e):e(re):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),re.makeArray(e,this))};ge.prototype=re.fn,pe=re(fe);var ve=/^(?:parents|prev(?:Until|All))/,_e={children:!0,contents:!0,next:!0,prev:!0};re.extend({dir:function(e,t,i){for(var n=[],r=e[t];r&&9!==r.nodeType&&(void 0===i||1!==r.nodeType||!re(r).is(i));)1===r.nodeType&&n.push(r),r=r[t];return n},sibling:function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i}}),re.fn.extend({has:function(e){var t,i=re(e,this),n=i.length;return this.filter(function(){for(t=0;t<n;t++)if(re.contains(this,i[t]))return!0})},closest:function(e,t){for(var i,n=0,r=this.length,s=[],o=ue.test(e)||"string"!=typeof e?re(e,t||this.context):0;n<r;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(i.nodeType<11&&(o?o.index(i)>-1:1===i.nodeType&&re.find.matchesSelector(i,e))){s.push(i);break}return this.pushStack(s.length>1?re.unique(s):s)},index:function(e){return e?"string"==typeof e?re.inArray(this[0],re(e)):re.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(re.unique(re.merge(this.get(),re(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),re.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return re.dir(e,"parentNode")},parentsUntil:function(e,t,i){return re.dir(e,"parentNode",i)},next:function(e){return r(e,"nextSibling")},prev:function(e){return r(e,"previousSibling")},nextAll:function(e){return re.dir(e,"nextSibling")},prevAll:function(e){return re.dir(e,"previousSibling")},nextUntil:function(e,t,i){return re.dir(e,"nextSibling",i)},prevUntil:function(e,t,i){return re.dir(e,"previousSibling",i)},siblings:function(e){return re.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return re.sibling(e.firstChild)},contents:function(e){return re.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:re.merge([],e.childNodes)}},function(e,t){re.fn[e]=function(i,n){var r=re.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=re.filter(n,r)),this.length>1&&(_e[e]||(r=re.unique(r)),ve.test(e)&&(r=r.reverse())),this.pushStack(r)}});var ye=/\S+/g,Ye={};re.Callbacks=function(e){e="string"==typeof e?Ye[e]||s(e):re.extend({},e);var t,i,n,r,o,a,l=[],c=!e.once&&[],u=function(s){for(i=e.memory&&s,n=!0,o=a||0,a=0,r=l.length,t=!0;l&&o<r;o++)if(l[o].apply(s[0],s[1])===!1&&e.stopOnFalse){i=!1;break}t=!1,l&&(c?c.length&&u(c.shift()):i?l=[]:d.disable())},d={add:function(){if(l){var n=l.length;!function t(i){re.each(i,function(i,n){var r=re.type(n);"function"===r?e.unique&&d.has(n)||l.push(n):n&&n.length&&"string"!==r&&t(n)})}(arguments),t?r=l.length:i&&(a=n,u(i))}return this},remove:function(){return l&&re.each(arguments,function(e,i){for(var n;(n=re.inArray(i,l,n))>-1;)l.splice(n,1),t&&(n<=r&&r--,n<=o&&o--)}),this},has:function(e){return e?re.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],r=0,this},disable:function(){return l=c=i=void 0,this},disabled:function(){return!l},lock:function(){return c=void 0,i||d.disable(),this},locked:function(){return!c},fireWith:function(e,i){return!l||n&&!c||(i=i||[],i=[e,i.slice?i.slice():i],t?c.push(i):u(i)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!n}};return d},re.extend({Deferred:function(e){var t=[["resolve","done",re.Callbacks("once memory"),"resolved"],["reject","fail",re.Callbacks("once memory"),"rejected"],["notify","progress",re.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return re.Deferred(function(i){re.each(t,function(t,s){var o=re.isFunction(e[t])&&e[t];r[s[1]](function(){var e=o&&o.apply(this,arguments);e&&re.isFunction(e.promise)?e.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[s[0]+"With"](this===n?i.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?re.extend(e,n):n}},r={};return n.pipe=n.then,re.each(t,function(e,s){var o=s[2],a=s[3];n[s[1]]=o.add,a&&o.add(function(){i=a},t[1^e][2].disable,t[2][2].lock),r[s[0]]=function(){return r[s[0]+"With"](this===r?n:this,arguments),this},r[s[0]+"With"]=o.fireWith}),n.promise(r),e&&e.call(r,r),r},when:function(e){var t,i,n,r=0,s=I.call(arguments),o=s.length,a=1!==o||e&&re.isFunction(e.promise)?o:0,l=1===a?e:re.Deferred(),c=function(e,i,n){return function(r){i[e]=this,n[e]=arguments.length>1?I.call(arguments):r,n===t?l.notifyWith(i,n):--a||l.resolveWith(i,n)}};if(o>1)for(t=new Array(o),i=new Array(o),n=new Array(o);r<o;r++)s[r]&&re.isFunction(s[r].promise)?s[r].promise().done(c(r,n,s)).fail(l.reject).progress(c(r,i,t)):--a;return a||l.resolveWith(n,s),l.promise()}});var be;re.fn.ready=function(e){return re.ready.promise().done(e),this},re.extend({isReady:!1,readyWait:1,holdReady:function(e){e?re.readyWait++:re.ready(!0)},ready:function(e){if(e===!0?!--re.readyWait:!re.isReady){if(!fe.body)return setTimeout(re.ready);re.isReady=!0,e!==!0&&--re.readyWait>0||(be.resolveWith(fe,[re]),re.fn.triggerHandler&&(re(fe).triggerHandler("ready"),re(fe).off("ready")))}}}),re.ready.promise=function(t){if(!be)if(be=re.Deferred(),"complete"===fe.readyState)setTimeout(re.ready);else if(fe.addEventListener)fe.addEventListener("DOMContentLoaded",a,!1),e.addEventListener("load",a,!1);else{fe.attachEvent("onreadystatechange",a),e.attachEvent("onload",a);var i=!1;try{i=null==e.frameElement&&fe.documentElement}catch(e){}i&&i.doScroll&&!function e(){if(!re.isReady){try{i.doScroll("left")}catch(t){return setTimeout(e,50)}o(),re.ready()}}()}return be.promise(t)};var Le,Se="undefined";for(Le in re(ie))break;ie.ownLast="0"!==Le,ie.inlineBlockNeedsLayout=!1,re(function(){var e,t,i,n;i=fe.getElementsByTagName("body")[0],i&&i.style&&(t=fe.createElement("div"),n=fe.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(t),typeof t.style.zoom!==Se&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",ie.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(i.style.zoom=1)),i.removeChild(n))}),function(){var e=fe.createElement("div");if(null==ie.deleteExpando){ie.deleteExpando=!0;try{delete e.test}catch(e){ie.deleteExpando=!1}}e=null}(),re.acceptData=function(e){var t=re.noData[(e.nodeName+" ").toLowerCase()],i=+e.nodeType||1;return(1===i||9===i)&&(!t||t!==!0&&e.getAttribute("classid")===t)};var Te=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ce=/([A-Z])/g;re.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?re.cache[e[re.expando]]:e[re.expando],!!e&&!c(e)},data:function(e,t,i){return u(e,t,i)},removeData:function(e,t){return d(e,t)},_data:function(e,t,i){return u(e,t,i,!0)},_removeData:function(e,t){return d(e,t,!0)}}),re.fn.extend({data:function(e,t){var i,n,r,s=this[0],o=s&&s.attributes;if(void 0===e){if(this.length&&(r=re.data(s),1===s.nodeType&&!re._data(s,"parsedAttrs"))){for(i=o.length;i--;)o[i]&&(n=o[i].name,0===n.indexOf("data-")&&(n=re.camelCase(n.slice(5)),l(s,n,r[n])));re._data(s,"parsedAttrs",!0)}return r}return"object"==typeof e?this.each(function(){re.data(this,e)}):arguments.length>1?this.each(function(){re.data(this,e,t)}):s?l(s,e,re.data(s,e)):void 0},removeData:function(e){return this.each(function(){re.removeData(this,e)})}}),re.extend({queue:function(e,t,i){var n;if(e)return t=(t||"fx")+"queue",n=re._data(e,t),i&&(!n||re.isArray(i)?n=re._data(e,t,re.makeArray(i)):n.push(i)),n||[]},dequeue:function(e,t){t=t||"fx";var i=re.queue(e,t),n=i.length,r=i.shift(),s=re._queueHooks(e,t),o=function(){re.dequeue(e,t)};"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===t&&i.unshift("inprogress"),delete s.stop,r.call(e,o,s)),!n&&s&&s.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return re._data(e,i)||re._data(e,i,{empty:re.Callbacks("once memory").add(function(){re._removeData(e,t+"queue"),re._removeData(e,i)})})}}),re.fn.extend({queue:function(e,t){var i=2;return"string"!=typeof e&&(t=e,e="fx",i--),arguments.length<i?re.queue(this[0],e):void 0===t?this:this.each(function(){var i=re.queue(this,e,t);re._queueHooks(this,e),"fx"===e&&"inprogress"!==i[0]&&re.dequeue(this,e)})},dequeue:function(e){return this.each(function(){re.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var i,n=1,r=re.Deferred(),s=this,o=this.length,a=function(){--n||r.resolveWith(s,[s])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";o--;)i=re._data(s[o],e+"queueHooks"),i&&i.empty&&(n++,i.empty.add(a));return a(),r.promise(t)}});var we=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ze=["Top","Right","Bottom","Left"],De=function(e,t){return e=t||e,"none"===re.css(e,"display")||!re.contains(e.ownerDocument,e)},Me=re.access=function(e,t,i,n,r,s,o){var a=0,l=e.length,c=null==i;if("object"===re.type(i)){r=!0;for(a in i)re.access(e,t,a,i[a],!0,s,o)}else if(void 0!==n&&(r=!0,re.isFunction(n)||(o=!0),c&&(o?(t.call(e,n),t=null):(c=t,t=function(e,t,i){return c.call(re(e),i)})),t))for(;a<l;a++)t(e[a],i,o?n:n.call(e[a],a,t(e[a],i)));return r?e:c?t.call(e):l?t(e[0],i):s},xe=/^(?:checkbox|radio)$/i;!function(){var e=fe.createElement("input"),t=fe.createElement("div"),i=fe.createDocumentFragment();if(t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",ie.leadingWhitespace=3===t.firstChild.nodeType,ie.tbody=!t.getElementsByTagName("tbody").length,ie.htmlSerialize=!!t.getElementsByTagName("link").length,ie.html5Clone="<:nav></:nav>"!==fe.createElement("nav").cloneNode(!0).outerHTML,e.type="checkbox",e.checked=!0,i.appendChild(e),ie.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",ie.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,i.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",ie.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,ie.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){ie.noCloneEvent=!1}),t.cloneNode(!0).click()),null==ie.deleteExpando){ie.deleteExpando=!0;try{delete t.test}catch(e){ie.deleteExpando=!1}}}(),function(){var t,i,n=fe.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})i="on"+t,(ie[t+"Bubbles"]=i in e)||(n.setAttribute(i,"t"),ie[t+"Bubbles"]=n.attributes[i].expando===!1);n=null}();var He=/^(?:input|select|textarea)$/i,Xe=/^key/,Pe=/^(?:mouse|pointer|contextmenu)|click/,Je=/^(?:focusinfocus|focusoutblur)$/,ke=/^([^.]*)(?:\.(.+)|)$/;re.event={global:{},add:function(e,t,i,n,r){var s,o,a,l,c,u,d,h,p,f,m,g=re._data(e);if(g){for(i.handler&&(l=i,i=l.handler,r=l.selector),i.guid||(i.guid=re.guid++),(o=g.events)||(o=g.events={}),(u=g.handle)||(u=g.handle=function(e){return typeof re===Se||e&&re.event.triggered===e.type?void 0:re.event.dispatch.apply(u.elem,arguments)},u.elem=e),t=(t||"").match(ye)||[""],a=t.length;a--;)s=ke.exec(t[a])||[],p=m=s[1],f=(s[2]||"").split(".").sort(),p&&(c=re.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,c=re.event.special[p]||{},d=re.extend({type:p,origType:m,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&re.expr.match.needsContext.test(r),namespace:f.join(".")},l),(h=o[p])||(h=o[p]=[],h.delegateCount=0,c.setup&&c.setup.call(e,n,f,u)!==!1||(e.addEventListener?e.addEventListener(p,u,!1):e.attachEvent&&e.attachEvent("on"+p,u))),c.add&&(c.add.call(e,d),d.handler.guid||(d.handler.guid=i.guid)),r?h.splice(h.delegateCount++,0,d):h.push(d),re.event.global[p]=!0);e=null}},remove:function(e,t,i,n,r){var s,o,a,l,c,u,d,h,p,f,m,g=re.hasData(e)&&re._data(e);if(g&&(u=g.events)){for(t=(t||"").match(ye)||[""],c=t.length;c--;)if(a=ke.exec(t[c])||[],p=m=a[1],f=(a[2]||"").split(".").sort(),p){for(d=re.event.special[p]||{},p=(n?d.delegateType:d.bindType)||p,h=u[p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=s=h.length;s--;)o=h[s],!r&&m!==o.origType||i&&i.guid!==o.guid||a&&!a.test(o.namespace)||n&&n!==o.selector&&("**"!==n||!o.selector)||(h.splice(s,1),o.selector&&h.delegateCount--,d.remove&&d.remove.call(e,o));l&&!h.length&&(d.teardown&&d.teardown.call(e,f,g.handle)!==!1||re.removeEvent(e,p,g.handle),delete u[p])}else for(p in u)re.event.remove(e,p+t[c],i,n,!0);re.isEmptyObject(u)&&(delete g.handle,re._removeData(e,"events"))}},trigger:function(t,i,n,r){var s,o,a,l,c,u,d,h=[n||fe],p=te.call(t,"type")?t.type:t,f=te.call(t,"namespace")?t.namespace.split("."):[];if(a=u=n=n||fe,3!==n.nodeType&&8!==n.nodeType&&!Je.test(p+re.event.triggered)&&(p.indexOf(".")>=0&&(f=p.split("."),p=f.shift(),f.sort()),o=p.indexOf(":")<0&&"on"+p,t=t[re.expando]?t:new re.Event(p,"object"==typeof t&&t),t.isTrigger=r?2:3,t.namespace=f.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),i=null==i?[t]:re.makeArray(i,[t]),c=re.event.special[p]||{},r||!c.trigger||c.trigger.apply(n,i)!==!1)){if(!r&&!c.noBubble&&!re.isWindow(n)){for(l=c.delegateType||p,Je.test(l+p)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(n.ownerDocument||fe)&&h.push(u.defaultView||u.parentWindow||e)}for(d=0;(a=h[d++])&&!t.isPropagationStopped();)t.type=d>1?l:c.bindType||p,s=(re._data(a,"events")||{})[t.type]&&re._data(a,"handle"),s&&s.apply(a,i),s=o&&a[o],s&&s.apply&&re.acceptData(a)&&(t.result=s.apply(a,i),t.result===!1&&t.preventDefault());if(t.type=p,!r&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(h.pop(),i)===!1)&&re.acceptData(n)&&o&&n[p]&&!re.isWindow(n)){u=n[o],u&&(n[o]=null),re.event.triggered=p;try{n[p]()}catch(e){}re.event.triggered=void 0,u&&(n[o]=u)}return t.result}},dispatch:function(e){e=re.event.fix(e);var t,i,n,r,s,o=[],a=I.call(arguments),l=(re._data(this,"events")||{})[e.type]||[],c=re.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){for(o=re.event.handlers.call(this,e,l),t=0;(r=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=r.elem,s=0;(n=r.handlers[s++])&&!e.isImmediatePropagationStopped();)e.namespace_re&&!e.namespace_re.test(n.namespace)||(e.handleObj=n,e.data=n.data,i=((re.event.special[n.origType]||{}).handle||n.handler).apply(r.elem,a),void 0!==i&&(e.result=i)===!1&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var i,n,r,s,o=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(r=[],s=0;s<a;s++)n=t[s],i=n.selector+" ",void 0===r[i]&&(r[i]=n.needsContext?re(i,this).index(l)>=0:re.find(i,this,null,[l]).length),r[i]&&r.push(n);r.length&&o.push({elem:l,handlers:r})}return a<t.length&&o.push({elem:this,handlers:t.slice(a)}),o},fix:function(e){if(e[re.expando])return e;var t,i,n,r=e.type,s=e,o=this.fixHooks[r];for(o||(this.fixHooks[r]=o=Pe.test(r)?this.mouseHooks:Xe.test(r)?this.keyHooks:{}),n=o.props?this.props.concat(o.props):this.props,e=new re.Event(s),t=n.length;t--;)i=n[t],e[i]=s[i];return e.target||(e.target=s.srcElement||fe),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,s):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var i,n,r,s=t.button,o=t.fromElement;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||fe,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),!e.relatedTarget&&o&&(e.relatedTarget=o===e.target?t.toElement:o),e.which||void 0===s||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==f()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===f()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(re.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1},_default:function(e){return re.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,i,n){var r=re.extend(new re.Event,i,{type:e,isSimulated:!0,originalEvent:{}});n?re.event.trigger(r,null,t):re.event.dispatch.call(t,r),r.isDefaultPrevented()&&i.preventDefault()}},re.removeEvent=fe.removeEventListener?function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i,!1)}:function(e,t,i){var n="on"+t;e.detachEvent&&(typeof e[n]===Se&&(e[n]=null),e.detachEvent(n,i))},re.Event=function(e,t){return this instanceof re.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?h:p):this.type=e,t&&re.extend(this,t),this.timeStamp=e&&e.timeStamp||re.now(),void(this[re.expando]=!0)):new re.Event(e,t)},re.Event.prototype={isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},re.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){re.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=this,r=e.relatedTarget,s=e.handleObj;return r&&(r===n||re.contains(n,r))||(e.type=s.origType,i=s.handler.apply(this,arguments),e.type=t),i}}}),ie.submitBubbles||(re.event.special.submit={setup:function(){return!re.nodeName(this,"form")&&void re.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,i=re.nodeName(t,"input")||re.nodeName(t,"button")?t.form:void 0;i&&!re._data(i,"submitBubbles")&&(re.event.add(i,"submit._submit",function(e){e._submit_bubble=!0}),re._data(i,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&re.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!re.nodeName(this,"form")&&void re.event.remove(this,"._submit")}}),ie.changeBubbles||(re.event.special.change={setup:function(){return He.test(this.nodeName)?("checkbox"!==this.type&&"radio"!==this.type||(re.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),re.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),re.event.simulate("change",this,e,!0)})),!1):void re.event.add(this,"beforeactivate._change",function(e){var t=e.target;He.test(t.nodeName)&&!re._data(t,"changeBubbles")&&(re.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||re.event.simulate("change",this.parentNode,e,!0)}),re._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return re.event.remove(this,"._change"),!He.test(this.nodeName)}}),ie.focusinBubbles||re.each({focus:"focusin",blur:"focusout"},function(e,t){var i=function(e){re.event.simulate(t,e.target,re.event.fix(e),!0)};re.event.special[t]={setup:function(){var n=this.ownerDocument||this,r=re._data(n,t);r||n.addEventListener(e,i,!0),re._data(n,t,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this,r=re._data(n,t)-1;r?re._data(n,t,r):(n.removeEventListener(e,i,!0),re._removeData(n,t))}}}),re.fn.extend({on:function(e,t,i,n,r){var s,o;if("object"==typeof e){"string"!=typeof t&&(i=i||t,t=void 0);for(s in e)this.on(s,t,i,e[s],r);return this}if(null==i&&null==n?(n=t,i=t=void 0):null==n&&("string"==typeof t?(n=i,i=void 0):(n=i,i=t,t=void 0)),n===!1)n=p;else if(!n)return this;return 1===r&&(o=n,n=function(e){return re().off(e),o.apply(this,arguments)},n.guid=o.guid||(o.guid=re.guid++)),this.each(function(){re.event.add(this,e,n,i,t)})},one:function(e,t,i,n){return this.on(e,t,i,n,1)},off:function(e,t,i){var n,r;if(e&&e.preventDefault&&e.handleObj)return n=e.handleObj,re(e.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return t!==!1&&"function"!=typeof t||(i=t,t=void 0),i===!1&&(i=p),this.each(function(){re.event.remove(this,e,i,t)})},trigger:function(e,t){return this.each(function(){re.event.trigger(e,t,this)})},triggerHandler:function(e,t){var i=this[0];if(i)return re.event.trigger(e,t,i,!0)}});var Fe="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Qe=/ jQuery\d+="(?:null|\d+)"/g,Ne=new RegExp("<(?:"+Fe+")[\\s/>]","i"),Be=/^\s+/,We=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ee=/<([\w:]+)/,Ge=/<tbody/i,Re=/<|&#?\w+;/,je=/<(?:script|style|link)/i,$e=/checked\s*(?:[^=]|=\s*.checked.)/i,Ae=/^$|\/(?:java|ecma)script/i,Oe=/^true\/(.*)/,Ke=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Ie={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:ie.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},Ue=m(fe),ze=Ue.appendChild(fe.createElement("div"));Ie.optgroup=Ie.option,Ie.tbody=Ie.tfoot=Ie.colgroup=Ie.caption=Ie.thead,Ie.th=Ie.td,re.extend({clone:function(e,t,i){var n,r,s,o,a,l=re.contains(e.ownerDocument,e);if(ie.html5Clone||re.isXMLDoc(e)||!Ne.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(ze.innerHTML=e.outerHTML,ze.removeChild(s=ze.firstChild)),!(ie.noCloneEvent&&ie.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||re.isXMLDoc(e)))for(n=g(s),a=g(e),o=0;null!=(r=a[o]);++o)n[o]&&S(r,n[o]);if(t)if(i)for(a=a||g(e),n=n||g(s),o=0;null!=(r=a[o]);o++)L(r,n[o]);else L(e,s);return n=g(s,"script"),n.length>0&&b(n,!l&&g(e,"script")),n=a=r=null,s},buildFragment:function(e,t,i,n){for(var r,s,o,a,l,c,u,d=e.length,h=m(t),p=[],f=0;f<d;f++)if(s=e[f],s||0===s)if("object"===re.type(s))re.merge(p,s.nodeType?[s]:s);else if(Re.test(s)){for(a=a||h.appendChild(t.createElement("div")),l=(Ee.exec(s)||["",""])[1].toLowerCase(),u=Ie[l]||Ie._default,a.innerHTML=u[1]+s.replace(We,"<$1></$2>")+u[2],r=u[0];r--;)a=a.lastChild;if(!ie.leadingWhitespace&&Be.test(s)&&p.push(t.createTextNode(Be.exec(s)[0])),!ie.tbody)for(s="table"!==l||Ge.test(s)?"<table>"!==u[1]||Ge.test(s)?0:a:a.firstChild,r=s&&s.childNodes.length;r--;)re.nodeName(c=s.childNodes[r],"tbody")&&!c.childNodes.length&&s.removeChild(c);for(re.merge(p,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=h.lastChild}else p.push(t.createTextNode(s));for(a&&h.removeChild(a),ie.appendChecked||re.grep(g(p,"input"),v),f=0;s=p[f++];)if((!n||re.inArray(s,n)===-1)&&(o=re.contains(s.ownerDocument,s),a=g(h.appendChild(s),"script"),o&&b(a),i))for(r=0;s=a[r++];)Ae.test(s.type||"")&&i.push(s);return a=null,h},cleanData:function(e,t){for(var i,n,r,s,o=0,a=re.expando,l=re.cache,c=ie.deleteExpando,u=re.event.special;null!=(i=e[o]);o++)if((t||re.acceptData(i))&&(r=i[a],s=r&&l[r])){if(s.events)for(n in s.events)u[n]?re.event.remove(i,n):re.removeEvent(i,n,s.handle);l[r]&&(delete l[r],c?delete i[a]:typeof i.removeAttribute!==Se?i.removeAttribute(a):i[a]=null,K.push(r))}}}),re.fn.extend({text:function(e){return Me(this,function(e){return void 0===e?re.text(this):this.empty().append((this[0]&&this[0].ownerDocument||fe).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=_(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=_(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var i,n=e?re.filter(e,this):this,r=0;null!=(i=n[r]);r++)t||1!==i.nodeType||re.cleanData(g(i)),i.parentNode&&(t&&re.contains(i.ownerDocument,i)&&b(g(i,"script")),i.parentNode.removeChild(i));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&re.cleanData(g(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&re.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return re.clone(this,e,t)})},html:function(e){return Me(this,function(e){var t=this[0]||{},i=0,n=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(Qe,""):void 0;if("string"==typeof e&&!je.test(e)&&(ie.htmlSerialize||!Ne.test(e))&&(ie.leadingWhitespace||!Be.test(e))&&!Ie[(Ee.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(We,"<$1></$2>");try{for(;i<n;i++)t=this[i]||{},1===t.nodeType&&(re.cleanData(g(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,re.cleanData(g(this)),e&&e.replaceChild(t,this)}),e&&(e.length||e.nodeType)?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t){e=U.apply([],e);var i,n,r,s,o,a,l=0,c=this.length,u=this,d=c-1,h=e[0],p=re.isFunction(h);if(p||c>1&&"string"==typeof h&&!ie.checkClone&&$e.test(h))return this.each(function(i){var n=u.eq(i);p&&(e[0]=h.call(this,i,n.html())),n.domManip(e,t)});if(c&&(a=re.buildFragment(e,this[0].ownerDocument,!1,this),i=a.firstChild,1===a.childNodes.length&&(a=i),i)){for(s=re.map(g(a,"script"),y),r=s.length;l<c;l++)n=a,l!==d&&(n=re.clone(n,!0,!0),r&&re.merge(s,g(n,"script"))),t.call(this[l],n,l);if(r)for(o=s[s.length-1].ownerDocument,re.map(s,Y),l=0;l<r;l++)n=s[l],Ae.test(n.type||"")&&!re._data(n,"globalEval")&&re.contains(o,n)&&(n.src?re._evalUrl&&re._evalUrl(n.src):re.globalEval((n.text||n.textContent||n.innerHTML||"").replace(Ke,"")));a=i=null}return this}}),re.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){re.fn[e]=function(e){for(var i,n=0,r=[],s=re(e),o=s.length-1;n<=o;n++)i=n===o?this:this.clone(!0),re(s[n])[t](i),z.apply(r,i.get());return this.pushStack(r)}});var qe,Ve={};!function(){var e;ie.shrinkWrapBlocks=function(){if(null!=e)return e;e=!1;var t,i,n;return i=fe.getElementsByTagName("body")[0],i&&i.style?(t=fe.createElement("div"),n=fe.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(t),typeof t.style.zoom!==Se&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(fe.createElement("div")).style.width="5px",e=3!==t.offsetWidth),i.removeChild(n),e):void 0}}();var et,tt,it=/^margin/,nt=new RegExp("^("+we+")(?!px)[a-z%]+$","i"),rt=/^(top|right|bottom|left)$/;e.getComputedStyle?(et=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},tt=function(e,t,i){var n,r,s,o,a=e.style;return i=i||et(e),o=i?i.getPropertyValue(t)||i[t]:void 0,i&&(""!==o||re.contains(e.ownerDocument,e)||(o=re.style(e,t)),nt.test(o)&&it.test(t)&&(n=a.width,r=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=o,
o=i.width,a.width=n,a.minWidth=r,a.maxWidth=s)),void 0===o?o:o+""}):fe.documentElement.currentStyle&&(et=function(e){return e.currentStyle},tt=function(e,t,i){var n,r,s,o,a=e.style;return i=i||et(e),o=i?i[t]:void 0,null==o&&a&&a[t]&&(o=a[t]),nt.test(o)&&!rt.test(t)&&(n=a.left,r=e.runtimeStyle,s=r&&r.left,s&&(r.left=e.currentStyle.left),a.left="fontSize"===t?"1em":o,o=a.pixelLeft+"px",a.left=n,s&&(r.left=s)),void 0===o?o:o+""||"auto"}),function(){function t(){var t,i,n,r;i=fe.getElementsByTagName("body")[0],i&&i.style&&(t=fe.createElement("div"),n=fe.createElement("div"),n.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(n).appendChild(t),t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",s=o=!1,l=!0,e.getComputedStyle&&(s="1%"!==(e.getComputedStyle(t,null)||{}).top,o="4px"===(e.getComputedStyle(t,null)||{width:"4px"}).width,r=t.appendChild(fe.createElement("div")),r.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",r.style.marginRight=r.style.width="0",t.style.width="1px",l=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight),t.removeChild(r)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",r=t.getElementsByTagName("td"),r[0].style.cssText="margin:0;border:0;padding:0;display:none",a=0===r[0].offsetHeight,a&&(r[0].style.display="",r[1].style.display="none",a=0===r[0].offsetHeight),i.removeChild(n))}var i,n,r,s,o,a,l;i=fe.createElement("div"),i.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=i.getElementsByTagName("a")[0],n=r&&r.style,n&&(n.cssText="float:left;opacity:.5",ie.opacity="0.5"===n.opacity,ie.cssFloat=!!n.cssFloat,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",ie.clearCloneStyle="content-box"===i.style.backgroundClip,ie.boxSizing=""===n.boxSizing||""===n.MozBoxSizing||""===n.WebkitBoxSizing,re.extend(ie,{reliableHiddenOffsets:function(){return null==a&&t(),a},boxSizingReliable:function(){return null==o&&t(),o},pixelPosition:function(){return null==s&&t(),s},reliableMarginRight:function(){return null==l&&t(),l}}))}(),re.swap=function(e,t,i,n){var r,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];r=i.apply(e,n||[]);for(s in t)e.style[s]=o[s];return r};var st=/alpha\([^)]*\)/i,ot=/opacity\s*=\s*([^)]*)/,at=/^(none|table(?!-c[ea]).+)/,lt=new RegExp("^("+we+")(.*)$","i"),ct=new RegExp("^([+-])=("+we+")","i"),ut={position:"absolute",visibility:"hidden",display:"block"},dt={letterSpacing:"0",fontWeight:"400"},ht=["Webkit","O","Moz","ms"];re.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=tt(e,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:ie.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,i,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,s,o,a=re.camelCase(t),l=e.style;if(t=re.cssProps[a]||(re.cssProps[a]=Z(l,a)),o=re.cssHooks[t]||re.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(r=o.get(e,!1,n))?r:l[t];if(s=typeof i,"string"===s&&(r=ct.exec(i))&&(i=(r[1]+1)*r[2]+parseFloat(re.css(e,t)),s="number"),null!=i&&i===i&&("number"!==s||re.cssNumber[a]||(i+="px"),ie.clearCloneStyle||""!==i||0!==t.indexOf("background")||(l[t]="inherit"),!(o&&"set"in o&&void 0===(i=o.set(e,i,n)))))try{l[t]=i}catch(e){}}},css:function(e,t,i,n){var r,s,o,a=re.camelCase(t);return t=re.cssProps[a]||(re.cssProps[a]=Z(e.style,a)),o=re.cssHooks[t]||re.cssHooks[a],o&&"get"in o&&(s=o.get(e,!0,i)),void 0===s&&(s=tt(e,t,n)),"normal"===s&&t in dt&&(s=dt[t]),""===i||i?(r=parseFloat(s),i===!0||re.isNumeric(r)?r||0:s):s}}),re.each(["height","width"],function(e,t){re.cssHooks[t]={get:function(e,i,n){if(i)return at.test(re.css(e,"display"))&&0===e.offsetWidth?re.swap(e,ut,function(){return H(e,t,n)}):H(e,t,n)},set:function(e,i,n){var r=n&&et(e);return M(e,i,n?x(e,t,n,ie.boxSizing&&"border-box"===re.css(e,"boxSizing",!1,r),r):0)}}}),ie.opacity||(re.cssHooks.opacity={get:function(e,t){return ot.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var i=e.style,n=e.currentStyle,r=re.isNumeric(t)?"alpha(opacity="+100*t+")":"",s=n&&n.filter||i.filter||"";i.zoom=1,(t>=1||""===t)&&""===re.trim(s.replace(st,""))&&i.removeAttribute&&(i.removeAttribute("filter"),""===t||n&&!n.filter)||(i.filter=st.test(s)?s.replace(st,r):s+" "+r)}}),re.cssHooks.marginRight=w(ie.reliableMarginRight,function(e,t){if(t)return re.swap(e,{display:"inline-block"},tt,[e,"marginRight"])}),re.each({margin:"",padding:"",border:"Width"},function(e,t){re.cssHooks[e+t]={expand:function(i){for(var n=0,r={},s="string"==typeof i?i.split(" "):[i];n<4;n++)r[e+Ze[n]+t]=s[n]||s[n-2]||s[0];return r}},it.test(e)||(re.cssHooks[e+t].set=M)}),re.fn.extend({css:function(e,t){return Me(this,function(e,t,i){var n,r,s={},o=0;if(re.isArray(t)){for(n=et(e),r=t.length;o<r;o++)s[t[o]]=re.css(e,t[o],!1,n);return s}return void 0!==i?re.style(e,t,i):re.css(e,t)},e,t,arguments.length>1)},show:function(){return D(this,!0)},hide:function(){return D(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){De(this)?re(this).show():re(this).hide()})}}),re.Tween=X,X.prototype={constructor:X,init:function(e,t,i,n,r,s){this.elem=e,this.prop=i,this.easing=r||"swing",this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=s||(re.cssNumber[i]?"":"px")},cur:function(){var e=X.propHooks[this.prop];return e&&e.get?e.get(this):X.propHooks._default.get(this)},run:function(e){var t,i=X.propHooks[this.prop];return this.options.duration?this.pos=t=re.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):X.propHooks._default.set(this),this}},X.prototype.init.prototype=X.prototype,X.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=re.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){re.fx.step[e.prop]?re.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[re.cssProps[e.prop]]||re.cssHooks[e.prop])?re.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},X.propHooks.scrollTop=X.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},re.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},re.fx=X.prototype.init,re.fx.step={};var pt,ft,mt=/^(?:toggle|show|hide)$/,gt=new RegExp("^(?:([+-])=|)("+we+")([a-z%]*)$","i"),vt=/queueHooks$/,_t=[F],yt={"*":[function(e,t){var i=this.createTween(e,t),n=i.cur(),r=gt.exec(t),s=r&&r[3]||(re.cssNumber[e]?"":"px"),o=(re.cssNumber[e]||"px"!==s&&+n)&&gt.exec(re.css(i.elem,e)),a=1,l=20;if(o&&o[3]!==s){s=s||o[3],r=r||[],o=+n||1;do a=a||".5",o/=a,re.style(i.elem,e,o+s);while(a!==(a=i.cur()/n)&&1!==a&&--l)}return r&&(o=i.start=+o||+n||0,i.unit=s,i.end=r[1]?o+(r[1]+1)*r[2]:+r[2]),i}]};re.Animation=re.extend(N,{tweener:function(e,t){re.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var i,n=0,r=e.length;n<r;n++)i=e[n],yt[i]=yt[i]||[],yt[i].unshift(t)},prefilter:function(e,t){t?_t.unshift(e):_t.push(e)}}),re.speed=function(e,t,i){var n=e&&"object"==typeof e?re.extend({},e):{complete:i||!i&&t||re.isFunction(e)&&e,duration:e,easing:i&&t||t&&!re.isFunction(t)&&t};return n.duration=re.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in re.fx.speeds?re.fx.speeds[n.duration]:re.fx.speeds._default,null!=n.queue&&n.queue!==!0||(n.queue="fx"),n.old=n.complete,n.complete=function(){re.isFunction(n.old)&&n.old.call(this),n.queue&&re.dequeue(this,n.queue)},n},re.fn.extend({fadeTo:function(e,t,i,n){return this.filter(De).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var r=re.isEmptyObject(e),s=re.speed(t,i,n),o=function(){var t=N(this,re.extend({},e),s);(r||re._data(this,"finish"))&&t.stop(!0)};return o.finish=o,r||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,t,i){var n=function(e){var t=e.stop;delete e.stop,t(i)};return"string"!=typeof e&&(i=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,r=null!=e&&e+"queueHooks",s=re.timers,o=re._data(this);if(r)o[r]&&o[r].stop&&n(o[r]);else for(r in o)o[r]&&o[r].stop&&vt.test(r)&&n(o[r]);for(r=s.length;r--;)s[r].elem!==this||null!=e&&s[r].queue!==e||(s[r].anim.stop(i),t=!1,s.splice(r,1));!t&&i||re.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,i=re._data(this),n=i[e+"queue"],r=i[e+"queueHooks"],s=re.timers,o=n?n.length:0;for(i.finish=!0,re.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish})}}),re.each(["toggle","show","hide"],function(e,t){var i=re.fn[t];re.fn[t]=function(e,n,r){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(J(t,!0),e,n,r)}}),re.each({slideDown:J("show"),slideUp:J("hide"),slideToggle:J("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){re.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}}),re.timers=[],re.fx.tick=function(){var e,t=re.timers,i=0;for(pt=re.now();i<t.length;i++)e=t[i],e()||t[i]!==e||t.splice(i--,1);t.length||re.fx.stop(),pt=void 0},re.fx.timer=function(e){re.timers.push(e),e()?re.fx.start():re.timers.pop()},re.fx.interval=13,re.fx.start=function(){ft||(ft=setInterval(re.fx.tick,re.fx.interval))},re.fx.stop=function(){clearInterval(ft),ft=null},re.fx.speeds={slow:600,fast:200,_default:400},re.fn.delay=function(e,t){return e=re.fx?re.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,i){var n=setTimeout(t,e);i.stop=function(){clearTimeout(n)}})},function(){var e,t,i,n,r;t=fe.createElement("div"),t.setAttribute("className","t"),t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=t.getElementsByTagName("a")[0],i=fe.createElement("select"),r=i.appendChild(fe.createElement("option")),e=t.getElementsByTagName("input")[0],n.style.cssText="top:1px",ie.getSetAttribute="t"!==t.className,ie.style=/top/.test(n.getAttribute("style")),ie.hrefNormalized="/a"===n.getAttribute("href"),ie.checkOn=!!e.value,ie.optSelected=r.selected,ie.enctype=!!fe.createElement("form").enctype,i.disabled=!0,ie.optDisabled=!r.disabled,e=fe.createElement("input"),e.setAttribute("value",""),ie.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),ie.radioValue="t"===e.value}();var Yt=/\r/g;re.fn.extend({val:function(e){var t,i,n,r=this[0];{if(arguments.length)return n=re.isFunction(e),this.each(function(i){var r;1===this.nodeType&&(r=n?e.call(this,i,re(this).val()):e,null==r?r="":"number"==typeof r?r+="":re.isArray(r)&&(r=re.map(r,function(e){return null==e?"":e+""})),t=re.valHooks[this.type]||re.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))});if(r)return t=re.valHooks[r.type]||re.valHooks[r.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(i=t.get(r,"value"))?i:(i=r.value,"string"==typeof i?i.replace(Yt,""):null==i?"":i)}}}),re.extend({valHooks:{option:{get:function(e){var t=re.find.attr(e,"value");return null!=t?t:re.trim(re.text(e))}},select:{get:function(e){for(var t,i,n=e.options,r=e.selectedIndex,s="select-one"===e.type||r<0,o=s?null:[],a=s?r+1:n.length,l=r<0?a:s?r:0;l<a;l++)if(i=n[l],(i.selected||l===r)&&(ie.optDisabled?!i.disabled:null===i.getAttribute("disabled"))&&(!i.parentNode.disabled||!re.nodeName(i.parentNode,"optgroup"))){if(t=re(i).val(),s)return t;o.push(t)}return o},set:function(e,t){for(var i,n,r=e.options,s=re.makeArray(t),o=r.length;o--;)if(n=r[o],re.inArray(re.valHooks.option.get(n),s)>=0)try{n.selected=i=!0}catch(e){n.scrollHeight}else n.selected=!1;return i||(e.selectedIndex=-1),r}}}}),re.each(["radio","checkbox"],function(){re.valHooks[this]={set:function(e,t){if(re.isArray(t))return e.checked=re.inArray(re(e).val(),t)>=0}},ie.checkOn||(re.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var bt,Lt,St=re.expr.attrHandle,Tt=/^(?:checked|selected)$/i,Ct=ie.getSetAttribute,wt=ie.input;re.fn.extend({attr:function(e,t){return Me(this,re.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){re.removeAttr(this,e)})}}),re.extend({attr:function(e,t,i){var n,r,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===Se?re.prop(e,t,i):(1===s&&re.isXMLDoc(e)||(t=t.toLowerCase(),n=re.attrHooks[t]||(re.expr.match.bool.test(t)?Lt:bt)),void 0===i?n&&"get"in n&&null!==(r=n.get(e,t))?r:(r=re.find.attr(e,t),null==r?void 0:r):null!==i?n&&"set"in n&&void 0!==(r=n.set(e,i,t))?r:(e.setAttribute(t,i+""),i):void re.removeAttr(e,t))},removeAttr:function(e,t){var i,n,r=0,s=t&&t.match(ye);if(s&&1===e.nodeType)for(;i=s[r++];)n=re.propFix[i]||i,re.expr.match.bool.test(i)?wt&&Ct||!Tt.test(i)?e[n]=!1:e[re.camelCase("default-"+i)]=e[n]=!1:re.attr(e,i,""),e.removeAttribute(Ct?i:n)},attrHooks:{type:{set:function(e,t){if(!ie.radioValue&&"radio"===t&&re.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}}}),Lt={set:function(e,t,i){return t===!1?re.removeAttr(e,i):wt&&Ct||!Tt.test(i)?e.setAttribute(!Ct&&re.propFix[i]||i,i):e[re.camelCase("default-"+i)]=e[i]=!0,i}},re.each(re.expr.match.bool.source.match(/\w+/g),function(e,t){var i=St[t]||re.find.attr;St[t]=wt&&Ct||!Tt.test(t)?function(e,t,n){var r,s;return n||(s=St[t],St[t]=r,r=null!=i(e,t,n)?t.toLowerCase():null,St[t]=s),r}:function(e,t,i){if(!i)return e[re.camelCase("default-"+t)]?t.toLowerCase():null}}),wt&&Ct||(re.attrHooks.value={set:function(e,t,i){return re.nodeName(e,"input")?void(e.defaultValue=t):bt&&bt.set(e,t,i)}}),Ct||(bt={set:function(e,t,i){var n=e.getAttributeNode(i);if(n||e.setAttributeNode(n=e.ownerDocument.createAttribute(i)),n.value=t+="","value"===i||t===e.getAttribute(i))return t}},St.id=St.name=St.coords=function(e,t,i){var n;if(!i)return(n=e.getAttributeNode(t))&&""!==n.value?n.value:null},re.valHooks.button={get:function(e,t){var i=e.getAttributeNode(t);if(i&&i.specified)return i.value},set:bt.set},re.attrHooks.contenteditable={set:function(e,t,i){bt.set(e,""!==t&&t,i)}},re.each(["width","height"],function(e,t){re.attrHooks[t]={set:function(e,i){if(""===i)return e.setAttribute(t,"auto"),i}}})),ie.style||(re.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var Zt=/^(?:input|select|textarea|button|object)$/i,Dt=/^(?:a|area)$/i;re.fn.extend({prop:function(e,t){return Me(this,re.prop,e,t,arguments.length>1)},removeProp:function(e){return e=re.propFix[e]||e,this.each(function(){try{this[e]=void 0,delete this[e]}catch(e){}})}}),re.extend({propFix:{for:"htmlFor",class:"className"},prop:function(e,t,i){var n,r,s,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return s=1!==o||!re.isXMLDoc(e),s&&(t=re.propFix[t]||t,r=re.propHooks[t]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(e,i,t))?n:e[t]=i:r&&"get"in r&&null!==(n=r.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=re.find.attr(e,"tabindex");return t?parseInt(t,10):Zt.test(e.nodeName)||Dt.test(e.nodeName)&&e.href?0:-1}}}}),ie.hrefNormalized||re.each(["href","src"],function(e,t){re.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),ie.optSelected||(re.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),re.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){re.propFix[this.toLowerCase()]=this}),ie.enctype||(re.propFix.enctype="encoding");var Mt=/[\t\r\n\f]/g;re.fn.extend({addClass:function(e){var t,i,n,r,s,o,a=0,l=this.length,c="string"==typeof e&&e;if(re.isFunction(e))return this.each(function(t){re(this).addClass(e.call(this,t,this.className))});if(c)for(t=(e||"").match(ye)||[];a<l;a++)if(i=this[a],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(Mt," "):" ")){for(s=0;r=t[s++];)n.indexOf(" "+r+" ")<0&&(n+=r+" ");o=re.trim(n),i.className!==o&&(i.className=o)}return this},removeClass:function(e){var t,i,n,r,s,o,a=0,l=this.length,c=0===arguments.length||"string"==typeof e&&e;if(re.isFunction(e))return this.each(function(t){re(this).removeClass(e.call(this,t,this.className))});if(c)for(t=(e||"").match(ye)||[];a<l;a++)if(i=this[a],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(Mt," "):"")){for(s=0;r=t[s++];)for(;n.indexOf(" "+r+" ")>=0;)n=n.replace(" "+r+" "," ");o=e?re.trim(n):"",i.className!==o&&(i.className=o)}return this},toggleClass:function(e,t){var i=typeof e;return"boolean"==typeof t&&"string"===i?t?this.addClass(e):this.removeClass(e):re.isFunction(e)?this.each(function(i){re(this).toggleClass(e.call(this,i,this.className,t),t)}):this.each(function(){if("string"===i)for(var t,n=0,r=re(this),s=e.match(ye)||[];t=s[n++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else i!==Se&&"boolean"!==i||(this.className&&re._data(this,"__className__",this.className),this.className=this.className||e===!1?"":re._data(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",i=0,n=this.length;i<n;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(Mt," ").indexOf(t)>=0)return!0;return!1}}),re.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){re.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}}),re.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)}});var xt=re.now(),Ht=/\?/,Xt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;re.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var i,n=null,r=re.trim(t+"");return r&&!re.trim(r.replace(Xt,function(e,t,r,s){return i&&t&&(n=0),0===n?e:(i=r||t,n+=!s-!r,"")}))?Function("return "+r)():re.error("Invalid JSON: "+t)},re.parseXML=function(t){var i,n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?(n=new DOMParser,i=n.parseFromString(t,"text/xml")):(i=new ActiveXObject("Microsoft.XMLDOM"),i.async="false",i.loadXML(t))}catch(e){i=void 0}return i&&i.documentElement&&!i.getElementsByTagName("parsererror").length||re.error("Invalid XML: "+t),i};var Pt,Jt,kt=/#.*$/,Ft=/([?&])_=[^&]*/,Qt=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Bt=/^(?:GET|HEAD)$/,Wt=/^\/\//,Et=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Gt={},Rt={},jt="*/".concat("*");try{Jt=location.href}catch(e){Jt=fe.createElement("a"),Jt.href="",Jt=Jt.href}Pt=Et.exec(Jt.toLowerCase())||[],re.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Jt,type:"GET",isLocal:Nt.test(Pt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":jt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":re.parseJSON,"text xml":re.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?E(E(e,re.ajaxSettings),t):E(re.ajaxSettings,e)},ajaxPrefilter:B(Gt),ajaxTransport:B(Rt),ajax:function(e,t){function i(e,t,i,n){var r,u,v,_,Y,L=t;2!==y&&(y=2,a&&clearTimeout(a),c=void 0,o=n||"",b.readyState=e>0?4:0,r=e>=200&&e<300||304===e,i&&(_=G(d,b,i)),_=R(d,_,b,r),r?(d.ifModified&&(Y=b.getResponseHeader("Last-Modified"),Y&&(re.lastModified[s]=Y),Y=b.getResponseHeader("etag"),Y&&(re.etag[s]=Y)),204===e||"HEAD"===d.type?L="nocontent":304===e?L="notmodified":(L=_.state,u=_.data,v=_.error,r=!v)):(v=L,!e&&L||(L="error",e<0&&(e=0))),b.status=e,b.statusText=(t||L)+"",r?f.resolveWith(h,[u,L,b]):f.rejectWith(h,[b,L,v]),b.statusCode(g),g=void 0,l&&p.trigger(r?"ajaxSuccess":"ajaxError",[b,d,r?u:v]),m.fireWith(h,[b,L]),l&&(p.trigger("ajaxComplete",[b,d]),--re.active||re.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r,s,o,a,l,c,u,d=re.ajaxSetup({},t),h=d.context||d,p=d.context&&(h.nodeType||h.jquery)?re(h):re.event,f=re.Deferred(),m=re.Callbacks("once memory"),g=d.statusCode||{},v={},_={},y=0,Y="canceled",b={readyState:0,getResponseHeader:function(e){var t;if(2===y){if(!u)for(u={};t=Qt.exec(o);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===y?o:null},setRequestHeader:function(e,t){var i=e.toLowerCase();return y||(e=_[i]=_[i]||e,v[e]=t),this},overrideMimeType:function(e){return y||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(y<2)for(t in e)g[t]=[g[t],e[t]];else b.always(e[b.status]);return this},abort:function(e){var t=e||Y;return c&&c.abort(t),i(0,t),this}};if(f.promise(b).complete=m.add,b.success=b.done,b.error=b.fail,d.url=((e||d.url||Jt)+"").replace(kt,"").replace(Wt,Pt[1]+"//"),d.type=t.method||t.type||d.method||d.type,d.dataTypes=re.trim(d.dataType||"*").toLowerCase().match(ye)||[""],null==d.crossDomain&&(n=Et.exec(d.url.toLowerCase()),d.crossDomain=!(!n||n[1]===Pt[1]&&n[2]===Pt[2]&&(n[3]||("http:"===n[1]?"80":"443"))===(Pt[3]||("http:"===Pt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=re.param(d.data,d.traditional)),W(Gt,d,t,b),2===y)return b;l=re.event&&d.global,l&&0===re.active++&&re.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!Bt.test(d.type),s=d.url,d.hasContent||(d.data&&(s=d.url+=(Ht.test(s)?"&":"?")+d.data,delete d.data),d.cache===!1&&(d.url=Ft.test(s)?s.replace(Ft,"$1_="+xt++):s+(Ht.test(s)?"&":"?")+"_="+xt++)),d.ifModified&&(re.lastModified[s]&&b.setRequestHeader("If-Modified-Since",re.lastModified[s]),re.etag[s]&&b.setRequestHeader("If-None-Match",re.etag[s])),(d.data&&d.hasContent&&d.contentType!==!1||t.contentType)&&b.setRequestHeader("Content-Type",d.contentType),b.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+jt+"; q=0.01":""):d.accepts["*"]);for(r in d.headers)b.setRequestHeader(r,d.headers[r]);if(d.beforeSend&&(d.beforeSend.call(h,b,d)===!1||2===y))return b.abort();Y="abort";for(r in{success:1,error:1,complete:1})b[r](d[r]);if(c=W(Rt,d,t,b)){b.readyState=1,l&&p.trigger("ajaxSend",[b,d]),d.async&&d.timeout>0&&(a=setTimeout(function(){b.abort("timeout")},d.timeout));try{y=1,c.send(v,i)}catch(e){if(!(y<2))throw e;i(-1,e)}}else i(-1,"No Transport");return b},getJSON:function(e,t,i){return re.get(e,t,i,"json")},getScript:function(e,t){return re.get(e,void 0,t,"script")}}),re.each(["get","post"],function(e,t){re[t]=function(e,i,n,r){return re.isFunction(i)&&(r=r||n,n=i,i=void 0),re.ajax({url:e,type:t,dataType:r,data:i,success:n})}}),re._evalUrl=function(e){return re.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},re.fn.extend({wrapAll:function(e){if(re.isFunction(e))return this.each(function(t){re(this).wrapAll(e.call(this,t))});if(this[0]){var t=re(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return re.isFunction(e)?this.each(function(t){re(this).wrapInner(e.call(this,t))}):this.each(function(){var t=re(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=re.isFunction(e);return this.each(function(i){re(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(){return this.parent().each(function(){re.nodeName(this,"body")||re(this).replaceWith(this.childNodes)}).end()}}),re.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!ie.reliableHiddenOffsets()&&"none"===(e.style&&e.style.display||re.css(e,"display"))},re.expr.filters.visible=function(e){return!re.expr.filters.hidden(e)};var $t=/%20/g,At=/\[\]$/,Ot=/\r?\n/g,Kt=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;re.param=function(e,t){var i,n=[],r=function(e,t){t=re.isFunction(t)?t():null==t?"":t,n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=re.ajaxSettings&&re.ajaxSettings.traditional),re.isArray(e)||e.jquery&&!re.isPlainObject(e))re.each(e,function(){r(this.name,this.value)});else for(i in e)j(i,e[i],t,r);return n.join("&").replace($t,"+")},re.fn.extend({serialize:function(){return re.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=re.prop(this,"elements");return e?re.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!re(this).is(":disabled")&&It.test(this.nodeName)&&!Kt.test(e)&&(this.checked||!xe.test(e))}).map(function(e,t){var i=re(this).val();return null==i?null:re.isArray(i)?re.map(i,function(e){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:i.replace(Ot,"\r\n")}}).get()}}),re.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$()||A()}:$;var Ut=0,zt={},qt=re.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in zt)zt[e](void 0,!0)}),ie.cors=!!qt&&"withCredentials"in qt,qt=ie.ajax=!!qt,qt&&re.ajaxTransport(function(e){if(!e.crossDomain||ie.cors){var t;return{send:function(i,n){var r,s=e.xhr(),o=++Ut;if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(r in e.xhrFields)s[r]=e.xhrFields[r];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(r in i)void 0!==i[r]&&s.setRequestHeader(r,i[r]+"");s.send(e.hasContent&&e.data||null),t=function(i,r){var a,l,c;if(t&&(r||4===s.readyState))if(delete zt[o],t=void 0,s.onreadystatechange=re.noop,r)4!==s.readyState&&s.abort();else{c={},a=s.status,"string"==typeof s.responseText&&(c.text=s.responseText);try{l=s.statusText}catch(e){l=""}a||!e.isLocal||e.crossDomain?1223===a&&(a=204):a=c.text?200:404}c&&n(a,l,c,s.getAllResponseHeaders())},e.async?4===s.readyState?setTimeout(t):s.onreadystatechange=zt[o]=t:t()},abort:function(){t&&t(void 0,!0)}}}}),re.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return re.globalEval(e),e}}}),re.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),re.ajaxTransport("script",function(e){if(e.crossDomain){var t,i=fe.head||re("head")[0]||fe.documentElement;return{send:function(n,r){t=fe.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,i){(i||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,i||r(200,"success"))},i.insertBefore(t,i.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var Vt=[],ei=/(=)\?(?=&|$)|\?\?/;re.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Vt.pop()||re.expando+"_"+xt++;return this[e]=!0,e}}),re.ajaxPrefilter("json jsonp",function(t,i,n){var r,s,o,a=t.jsonp!==!1&&(ei.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ei.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=re.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(ei,"$1"+r):t.jsonp!==!1&&(t.url+=(Ht.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return o||re.error(r+" was not called"),o[0]},t.dataTypes[0]="json",s=e[r],e[r]=function(){o=arguments},n.always(function(){e[r]=s,t[r]&&(t.jsonpCallback=i.jsonpCallback,Vt.push(r)),o&&re.isFunction(s)&&s(o[0]),o=s=void 0}),"script"}),re.parseHTML=function(e,t,i){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(i=t,t=!1),t=t||fe;var n=de.exec(e),r=!i&&[];return n?[t.createElement(n[1])]:(n=re.buildFragment([e],t,r),r&&r.length&&re(r).remove(),re.merge([],n.childNodes))};var ti=re.fn.load;re.fn.load=function(e,t,i){if("string"!=typeof e&&ti)return ti.apply(this,arguments);var n,r,s,o=this,a=e.indexOf(" ");return a>=0&&(n=re.trim(e.slice(a,e.length)),e=e.slice(0,a)),re.isFunction(t)?(i=t,t=void 0):t&&"object"==typeof t&&(s="POST"),o.length>0&&re.ajax({url:e,type:s,dataType:"html",data:t}).done(function(e){r=arguments,o.html(n?re("<div>").append(re.parseHTML(e)).find(n):e)}).complete(i&&function(e,t){o.each(i,r||[e.responseText,t,e])}),this},re.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){re.fn[t]=function(e){return this.on(t,e)}}),re.expr.filters.animated=function(e){return re.grep(re.timers,function(t){return e===t.elem}).length};var ii=e.document.documentElement;re.offset={setOffset:function(e,t,i){var n,r,s,o,a,l,c,u=re.css(e,"position"),d=re(e),h={};"static"===u&&(e.style.position="relative"),a=d.offset(),s=re.css(e,"top"),l=re.css(e,"left"),c=("absolute"===u||"fixed"===u)&&re.inArray("auto",[s,l])>-1,c?(n=d.position(),o=n.top,r=n.left):(o=parseFloat(s)||0,r=parseFloat(l)||0),re.isFunction(t)&&(t=t.call(e,i,a)),null!=t.top&&(h.top=t.top-a.top+o),null!=t.left&&(h.left=t.left-a.left+r),"using"in t?t.using.call(e,h):d.css(h)}},re.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){re.offset.setOffset(this,e,t)});var t,i,n={top:0,left:0},r=this[0],s=r&&r.ownerDocument;if(s)return t=s.documentElement,re.contains(t,r)?(typeof r.getBoundingClientRect!==Se&&(n=r.getBoundingClientRect()),i=O(s),{top:n.top+(i.pageYOffset||t.scrollTop)-(t.clientTop||0),left:n.left+(i.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):n},position:function(){if(this[0]){var e,t,i={top:0,left:0},n=this[0];return"fixed"===re.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),re.nodeName(e[0],"html")||(i=e.offset()),i.top+=re.css(e[0],"borderTopWidth",!0),i.left+=re.css(e[0],"borderLeftWidth",!0)),{top:t.top-i.top-re.css(n,"marginTop",!0),left:t.left-i.left-re.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||ii;e&&!re.nodeName(e,"html")&&"static"===re.css(e,"position");)e=e.offsetParent;return e||ii})}}),re.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var i=/Y/.test(t);re.fn[e]=function(n){return Me(this,function(e,n,r){var s=O(e);return void 0===r?s?t in s?s[t]:s.document.documentElement[n]:e[n]:void(s?s.scrollTo(i?re(s).scrollLeft():r,i?r:re(s).scrollTop()):e[n]=r)},e,n,arguments.length,null)}}),re.each(["top","left"],function(e,t){re.cssHooks[t]=w(ie.pixelPosition,function(e,i){if(i)return i=tt(e,t),nt.test(i)?re(e).position()[t]+"px":i})}),re.each({Height:"height",Width:"width"},function(e,t){re.each({padding:"inner"+e,content:t,"":"outer"+e},function(i,n){re.fn[n]=function(n,r){var s=arguments.length&&(i||"boolean"!=typeof n),o=i||(n===!0||r===!0?"margin":"border");return Me(this,function(t,i,n){var r;return re.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(r=t.documentElement,
Math.max(t.body["scroll"+e],r["scroll"+e],t.body["offset"+e],r["offset"+e],r["client"+e])):void 0===n?re.css(t,i,o):re.style(t,i,n,o)},t,s?n:void 0,s,null)}})}),re.fn.size=function(){return this.length},re.fn.andSelf=re.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return re});var ni=e.jQuery,ri=e.$;return re.noConflict=function(t){return e.$===re&&(e.$=ri),t&&e.jQuery===re&&(e.jQuery=ni),re},typeof t===Se&&(e.jQuery=e.$=re),re}),function(){var e=this,t=e._,i={},n=Array.prototype,r=Object.prototype,s=Function.prototype,o=n.push,a=n.slice,l=n.concat,c=r.toString,u=r.hasOwnProperty,d=n.forEach,h=n.map,p=n.reduce,f=n.reduceRight,m=n.filter,g=n.every,v=n.some,_=n.indexOf,y=n.lastIndexOf,Y=Array.isArray,b=Object.keys,L=s.bind,S=function(e){return e instanceof S?e:this instanceof S?void(this._wrapped=e):new S(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=S),exports._=S):e._=S,S.VERSION="1.5.1";var T=S.each=S.forEach=function(e,t,n){if(null!=e)if(d&&e.forEach===d)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(t.call(n,e[r],r,e)===i)return}else for(var o in e)if(S.has(e,o)&&t.call(n,e[o],o,e)===i)return};S.map=S.collect=function(e,t,i){var n=[];return null==e?n:h&&e.map===h?e.map(t,i):(T(e,function(e,r,s){n.push(t.call(i,e,r,s))}),n)};var C="Reduce of empty array with no initial value";S.reduce=S.foldl=S.inject=function(e,t,i,n){var r=arguments.length>2;if(null==e&&(e=[]),p&&e.reduce===p)return n&&(t=S.bind(t,n)),r?e.reduce(t,i):e.reduce(t);if(T(e,function(e,s,o){r?i=t.call(n,i,e,s,o):(i=e,r=!0)}),!r)throw new TypeError(C);return i},S.reduceRight=S.foldr=function(e,t,i,n){var r=arguments.length>2;if(null==e&&(e=[]),f&&e.reduceRight===f)return n&&(t=S.bind(t,n)),r?e.reduceRight(t,i):e.reduceRight(t);var s=e.length;if(s!==+s){var o=S.keys(e);s=o.length}if(T(e,function(a,l,c){l=o?o[--s]:--s,r?i=t.call(n,i,e[l],l,c):(i=e[l],r=!0)}),!r)throw new TypeError(C);return i},S.find=S.detect=function(e,t,i){var n;return w(e,function(e,r,s){if(t.call(i,e,r,s))return n=e,!0}),n},S.filter=S.select=function(e,t,i){var n=[];return null==e?n:m&&e.filter===m?e.filter(t,i):(T(e,function(e,r,s){t.call(i,e,r,s)&&n.push(e)}),n)},S.reject=function(e,t,i){return S.filter(e,function(e,n,r){return!t.call(i,e,n,r)},i)},S.every=S.all=function(e,t,n){t||(t=S.identity);var r=!0;return null==e?r:g&&e.every===g?e.every(t,n):(T(e,function(e,s,o){if(!(r=r&&t.call(n,e,s,o)))return i}),!!r)};var w=S.some=S.any=function(e,t,n){t||(t=S.identity);var r=!1;return null==e?r:v&&e.some===v?e.some(t,n):(T(e,function(e,s,o){if(r||(r=t.call(n,e,s,o)))return i}),!!r)};S.contains=S.include=function(e,t){return null!=e&&(_&&e.indexOf===_?e.indexOf(t)!=-1:w(e,function(e){return e===t}))},S.invoke=function(e,t){var i=a.call(arguments,2),n=S.isFunction(t);return S.map(e,function(e){return(n?t:e[t]).apply(e,i)})},S.pluck=function(e,t){return S.map(e,function(e){return e[t]})},S.where=function(e,t,i){return S.isEmpty(t)?i?void 0:[]:S[i?"find":"filter"](e,function(e){for(var i in t)if(t[i]!==e[i])return!1;return!0})},S.findWhere=function(e,t){return S.where(e,t,!0)},S.max=function(e,t,i){if(!t&&S.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&S.isEmpty(e))return-(1/0);var n={computed:-(1/0),value:-(1/0)};return T(e,function(e,r,s){var o=t?t.call(i,e,r,s):e;o>n.computed&&(n={value:e,computed:o})}),n.value},S.min=function(e,t,i){if(!t&&S.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&S.isEmpty(e))return 1/0;var n={computed:1/0,value:1/0};return T(e,function(e,r,s){var o=t?t.call(i,e,r,s):e;o<n.computed&&(n={value:e,computed:o})}),n.value},S.shuffle=function(e){var t,i=0,n=[];return T(e,function(e){t=S.random(i++),n[i-1]=n[t],n[t]=e}),n};var Z=function(e){return S.isFunction(e)?e:function(t){return t[e]}};S.sortBy=function(e,t,i){var n=Z(t);return S.pluck(S.map(e,function(e,t,r){return{value:e,index:t,criteria:n.call(i,e,t,r)}}).sort(function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(i<n||void 0===n)return-1}return e.index<t.index?-1:1}),"value")};var D=function(e,t,i,n){var r={},s=Z(null==t?S.identity:t);return T(e,function(t,o){var a=s.call(i,t,o,e);n(r,a,t)}),r};S.groupBy=function(e,t,i){return D(e,t,i,function(e,t,i){(S.has(e,t)?e[t]:e[t]=[]).push(i)})},S.countBy=function(e,t,i){return D(e,t,i,function(e,t){S.has(e,t)||(e[t]=0),e[t]++})},S.sortedIndex=function(e,t,i,n){i=null==i?S.identity:Z(i);for(var r=i.call(n,t),s=0,o=e.length;s<o;){var a=s+o>>>1;i.call(n,e[a])<r?s=a+1:o=a}return s},S.toArray=function(e){return e?S.isArray(e)?a.call(e):e.length===+e.length?S.map(e,S.identity):S.values(e):[]},S.size=function(e){return null==e?0:e.length===+e.length?e.length:S.keys(e).length},S.first=S.head=S.take=function(e,t,i){if(null!=e)return null==t||i?e[0]:a.call(e,0,t)},S.initial=function(e,t,i){return a.call(e,0,e.length-(null==t||i?1:t))},S.last=function(e,t,i){if(null!=e)return null==t||i?e[e.length-1]:a.call(e,Math.max(e.length-t,0))},S.rest=S.tail=S.drop=function(e,t,i){return a.call(e,null==t||i?1:t)},S.compact=function(e){return S.filter(e,S.identity)};var M=function(e,t,i){return t&&S.every(e,S.isArray)?l.apply(i,e):(T(e,function(e){S.isArray(e)||S.isArguments(e)?t?o.apply(i,e):M(e,t,i):i.push(e)}),i)};S.flatten=function(e,t){return M(e,t,[])},S.without=function(e){return S.difference(e,a.call(arguments,1))},S.uniq=S.unique=function(e,t,i,n){S.isFunction(t)&&(n=i,i=t,t=!1);var r=i?S.map(e,i,n):e,s=[],o=[];return T(r,function(i,n){(t?n&&o[o.length-1]===i:S.contains(o,i))||(o.push(i),s.push(e[n]))}),s},S.union=function(){return S.uniq(S.flatten(arguments,!0))},S.intersection=function(e){var t=a.call(arguments,1);return S.filter(S.uniq(e),function(e){return S.every(t,function(t){return S.indexOf(t,e)>=0})})},S.difference=function(e){var t=l.apply(n,a.call(arguments,1));return S.filter(e,function(e){return!S.contains(t,e)})},S.zip=function(){for(var e=S.max(S.pluck(arguments,"length").concat(0)),t=new Array(e),i=0;i<e;i++)t[i]=S.pluck(arguments,""+i);return t},S.object=function(e,t){if(null==e)return{};for(var i={},n=0,r=e.length;n<r;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},S.indexOf=function(e,t,i){if(null==e)return-1;var n=0,r=e.length;if(i){if("number"!=typeof i)return n=S.sortedIndex(e,t),e[n]===t?n:-1;n=i<0?Math.max(0,r+i):i}if(_&&e.indexOf===_)return e.indexOf(t,i);for(;n<r;n++)if(e[n]===t)return n;return-1},S.lastIndexOf=function(e,t,i){if(null==e)return-1;var n=null!=i;if(y&&e.lastIndexOf===y)return n?e.lastIndexOf(t,i):e.lastIndexOf(t);for(var r=n?i:e.length;r--;)if(e[r]===t)return r;return-1},S.range=function(e,t,i){arguments.length<=1&&(t=e||0,e=0),i=arguments[2]||1;for(var n=Math.max(Math.ceil((t-e)/i),0),r=0,s=new Array(n);r<n;)s[r++]=e,e+=i;return s};var x=function(){};S.bind=function(e,t){var i,n;if(L&&e.bind===L)return L.apply(e,a.call(arguments,1));if(!S.isFunction(e))throw new TypeError;return i=a.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,i.concat(a.call(arguments)));x.prototype=e.prototype;var r=new x;x.prototype=null;var s=e.apply(r,i.concat(a.call(arguments)));return Object(s)===s?s:r}},S.partial=function(e){var t=a.call(arguments,1);return function(){return e.apply(this,t.concat(a.call(arguments)))}},S.bindAll=function(e){var t=a.call(arguments,1);if(0===t.length)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=S.bind(e[t],e)}),e},S.memoize=function(e,t){var i={};return t||(t=S.identity),function(){var n=t.apply(this,arguments);return S.has(i,n)?i[n]:i[n]=e.apply(this,arguments)}},S.delay=function(e,t){var i=a.call(arguments,2);return setTimeout(function(){return e.apply(null,i)},t)},S.defer=function(e){return S.delay.apply(S,[e,1].concat(a.call(arguments,1)))},S.throttle=function(e,t,i){var n,r,s,o=null,a=0;i||(i={});var l=function(){a=i.leading===!1?0:new Date,o=null,s=e.apply(n,r)};return function(){var c=new Date;a||i.leading!==!1||(a=c);var u=t-(c-a);return n=this,r=arguments,u<=0?(clearTimeout(o),o=null,a=c,s=e.apply(n,r)):o||i.trailing===!1||(o=setTimeout(l,u)),s}},S.debounce=function(e,t,i){var n,r=null;return function(){var s=this,o=arguments,a=function(){r=null,i||(n=e.apply(s,o))},l=i&&!r;return clearTimeout(r),r=setTimeout(a,t),l&&(n=e.apply(s,o)),n}},S.once=function(e){var t,i=!1;return function(){return i?t:(i=!0,t=e.apply(this,arguments),e=null,t)}},S.wrap=function(e,t){return function(){var i=[e];return o.apply(i,arguments),t.apply(this,i)}},S.compose=function(){var e=arguments;return function(){for(var t=arguments,i=e.length-1;i>=0;i--)t=[e[i].apply(this,t)];return t[0]}},S.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},S.keys=b||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var i in e)S.has(e,i)&&t.push(i);return t},S.values=function(e){var t=[];for(var i in e)S.has(e,i)&&t.push(e[i]);return t},S.pairs=function(e){var t=[];for(var i in e)S.has(e,i)&&t.push([i,e[i]]);return t},S.invert=function(e){var t={};for(var i in e)S.has(e,i)&&(t[e[i]]=i);return t},S.functions=S.methods=function(e){var t=[];for(var i in e)S.isFunction(e[i])&&t.push(i);return t.sort()},S.extend=function(e){return T(a.call(arguments,1),function(t){if(t)for(var i in t)e[i]=t[i]}),e},S.pick=function(e){var t={},i=l.apply(n,a.call(arguments,1));return T(i,function(i){i in e&&(t[i]=e[i])}),t},S.omit=function(e){var t={},i=l.apply(n,a.call(arguments,1));for(var r in e)S.contains(i,r)||(t[r]=e[r]);return t},S.defaults=function(e){return T(a.call(arguments,1),function(t){if(t)for(var i in t)void 0===e[i]&&(e[i]=t[i])}),e},S.clone=function(e){return S.isObject(e)?S.isArray(e)?e.slice():S.extend({},e):e},S.tap=function(e,t){return t(e),e};var H=function(e,t,i,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof S&&(e=e._wrapped),t instanceof S&&(t=t._wrapped);var r=c.call(e);if(r!=c.call(t))return!1;switch(r){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(var s=i.length;s--;)if(i[s]==e)return n[s]==t;var o=e.constructor,a=t.constructor;if(o!==a&&!(S.isFunction(o)&&o instanceof o&&S.isFunction(a)&&a instanceof a))return!1;i.push(e),n.push(t);var l=0,u=!0;if("[object Array]"==r){if(l=e.length,u=l==t.length)for(;l--&&(u=H(e[l],t[l],i,n)););}else{for(var d in e)if(S.has(e,d)&&(l++,!(u=S.has(t,d)&&H(e[d],t[d],i,n))))break;if(u){for(d in t)if(S.has(t,d)&&!l--)break;u=!l}}return i.pop(),n.pop(),u};S.isEqual=function(e,t){return H(e,t,[],[])},S.isEmpty=function(e){if(null==e)return!0;if(S.isArray(e)||S.isString(e))return 0===e.length;for(var t in e)if(S.has(e,t))return!1;return!0},S.isElement=function(e){return!(!e||1!==e.nodeType)},S.isArray=Y||function(e){return"[object Array]"==c.call(e)},S.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){S["is"+e]=function(t){return c.call(t)=="[object "+e+"]"}}),S.isArguments(arguments)||(S.isArguments=function(e){return!(!e||!S.has(e,"callee"))}),"function"!=typeof/./&&(S.isFunction=function(e){return"function"==typeof e}),S.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},S.isNaN=function(e){return S.isNumber(e)&&e!=+e},S.isBoolean=function(e){return e===!0||e===!1||"[object Boolean]"==c.call(e)},S.isNull=function(e){return null===e},S.isUndefined=function(e){return void 0===e},S.has=function(e,t){return u.call(e,t)},S.noConflict=function(){return e._=t,this},S.identity=function(e){return e},S.times=function(e,t,i){for(var n=Array(Math.max(0,e)),r=0;r<e;r++)n[r]=t.call(i,r);return n},S.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var X={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};X.unescape=S.invert(X.escape);var P={escape:new RegExp("["+S.keys(X.escape).join("")+"]","g"),unescape:new RegExp("("+S.keys(X.unescape).join("|")+")","g")};S.each(["escape","unescape"],function(e){S[e]=function(t){return null==t?"":(""+t).replace(P[e],function(t){return X[e][t]})}}),S.result=function(e,t){if(null!=e){var i=e[t];return S.isFunction(i)?i.call(e):i}},S.mixin=function(e){T(S.functions(e),function(t){var i=S[t]=e[t];S.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),N.call(this,i.apply(S,e))}})};var J=0;S.uniqueId=function(e){var t=++J+"";return e?e+t:t},S.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var k=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},Q=/\\|'|\r|\n|\t|\u2028|\u2029/g;S.template=function(e,t,i){var n;i=S.defaults({},i,S.templateSettings);var r=new RegExp([(i.escape||k).source,(i.interpolate||k).source,(i.evaluate||k).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(r,function(t,i,n,r,a){return o+=e.slice(s,a).replace(Q,function(e){return"\\"+F[e]}),i&&(o+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'"),n&&(o+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),r&&(o+="';\n"+r+"\n__p+='"),s=a+t.length,t}),o+="';\n",i.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=new Function(i.variable||"obj","_",o)}catch(e){throw e.source=o,e}if(t)return n(t,S);var a=function(e){return n.call(this,e,S)};return a.source="function("+(i.variable||"obj")+"){\n"+o+"}",a},S.chain=function(e){return S(e).chain()};var N=function(e){return this._chain?S(e).chain():e};S.mixin(S),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];S.prototype[e]=function(){var i=this._wrapped;return t.apply(i,arguments),"shift"!=e&&"splice"!=e||0!==i.length||delete i[0],N.call(this,i)}}),T(["concat","join","slice"],function(e){var t=n[e];S.prototype[e]=function(){return N.call(this,t.apply(this._wrapped,arguments))}}),S.extend(S.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t;return t||e._}}(this)),define("text",["module"],function(e){"use strict";var t,i,n,r,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],a=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,l=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c="undefined"!=typeof location&&location.href,u=c&&location.protocol&&location.protocol.replace(/\:/,""),d=c&&location.hostname,h=c&&(location.port||void 0),p={},f=e.config&&e.config()||{};return t={version:"2.0.13+",strip:function(e){if(e){e=e.replace(a,"");var t=e.match(l);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:f.createXhr||function(){var e,t,i;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;t<3;t+=1){i=o[t];try{e=new ActiveXObject(i)}catch(e){}if(e){o=[i];break}}return e},parseName:function(e){var t,i,n,r=!1,s=e.lastIndexOf("."),o=0===e.indexOf("./")||0===e.indexOf("../");return s!==-1&&(!o||s>1)?(t=e.substring(0,s),i=e.substring(s+1)):t=e,n=i||t,s=n.indexOf("!"),s!==-1&&(r="strip"===n.substring(s+1),n=n.substring(0,s),i?i=n:t=n),{moduleName:t,ext:i,strip:r}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,i,n,r){var s,o,a,l=t.xdRegExp.exec(e);return!l||(s=l[2],o=l[3],o=o.split(":"),a=o[1],o=o[0],!(s&&s!==i||o&&o.toLowerCase()!==n.toLowerCase()||(a||o)&&a!==r))},finishLoad:function(e,i,n,r){n=i?t.strip(n):n,f.isBuild&&(p[e]=n),r(n)},load:function(e,i,n,r){if(r&&r.isBuild&&!r.inlineText)return void n();f.isBuild=r&&r.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),a=i.toUrl(o),l=f.useXhr||t.useXhr;return 0===a.indexOf("empty:")?void n():void(!c||l(a,u,d,h)?t.get(a,function(i){t.finishLoad(e,s.strip,i,n)},function(e){n.error&&n.error(e)}):i([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,n)}))},write:function(e,i,n,r){if(p.hasOwnProperty(i)){var s=t.jsEscape(p[i]);n.asModule(e+"!"+i,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,i,n,r,s){var o=t.parseName(i),a=o.ext?"."+o.ext:"",l=o.moduleName+a,c=n.toUrl(o.moduleName+a)+".js";t.load(l,n,function(i){var n=function(e){return r(c,e)};n.asModule=function(e,t){return r.asModule(e,c,t)},t.write(e,l,n,s)},s)}},"node"===f.env||!f.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"]?(i=require.nodeRequire("fs"),t.get=function(e,t,n){try{var r=i.readFileSync(e,"utf8");"\ufeff"===r[0]&&(r=r.substring(1)),t(r)}catch(e){n&&n(e)}}):"xhr"===f.env||!f.env&&t.createXhr()?t.get=function(e,i,n,r){var s,o=t.createXhr();if(o.open("GET",e,!0),r)for(s in r)r.hasOwnProperty(s)&&o.setRequestHeader(s.toLowerCase(),r[s]);f.onXhr&&f.onXhr(o,e),o.onreadystatechange=function(t){var r,s;4===o.readyState&&(r=o.status||0,r>399&&r<600?(s=new Error(e+" HTTP status: "+r),s.xhr=o,n&&n(s)):i(o.responseText),f.onXhrComplete&&f.onXhrComplete(o,e))},o.send(null)}:"rhino"===f.env||!f.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?t.get=function(e,t){var i,n,r="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),a=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),r)),l="";try{for(i=new java.lang.StringBuffer,n=a.readLine(),n&&n.length()&&65279===n.charAt(0)&&(n=n.substring(1)),null!==n&&i.append(n);null!==(n=a.readLine());)i.append(o),i.append(n);l=String(i.toString())}finally{a.close()}t(l)}:("xpconnect"===f.env||!f.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(n=Components.classes,r=Components.interfaces,Components.utils.import("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in n,t.get=function(e,t){var i,o,a,l={};s&&(e=e.replace(/\//g,"\\")),a=new FileUtils.File(e);try{i=n["@mozilla.org/network/file-input-stream;1"].createInstance(r.nsIFileInputStream),i.init(a,1,0,!1),o=n["@mozilla.org/intl/converter-input-stream;1"].createInstance(r.nsIConverterInputStream),o.init(i,"utf-8",i.available(),r.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(i.available(),l),o.close(),i.close(),t(l.value)}catch(e){throw new Error((a&&a.path||"")+": "+e)}}),t}),define("pinyin-by-unicode",{strChineseFirstPY:" "
}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("moment",t):e.moment=t()}(this,function(){"use strict";function e(){return _n.apply(null,arguments)}function t(e){_n=e}function i(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){var i,n=[];for(i=0;i<e.length;++i)n.push(t(e[i],i));return n}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function o(e,t){for(var i in t)s(t,i)&&(e[i]=t[i]);return s(t,"toString")&&(e.toString=t.toString),s(t,"valueOf")&&(e.valueOf=t.valueOf),e}function a(e,t,i,n){return Je(e,t,i,n,!0).utc()}function l(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function c(e){return null==e._pf&&(e._pf=l()),e._pf}function u(e){if(null==e._isValid){var t=c(e);e._isValid=!(isNaN(e._d.getTime())||!(t.overflow<0)||t.empty||t.invalidMonth||t.invalidWeekday||t.nullInput||t.invalidFormat||t.userInvalidated),e._strict&&(e._isValid=e._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return e._isValid}function d(e){var t=a(NaN);return null!=e?o(c(t),e):c(t).userInvalidated=!0,t}function h(e){return void 0===e}function p(e,t){var i,n,r;if(h(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),h(t._i)||(e._i=t._i),h(t._f)||(e._f=t._f),h(t._l)||(e._l=t._l),h(t._strict)||(e._strict=t._strict),h(t._tzm)||(e._tzm=t._tzm),h(t._isUTC)||(e._isUTC=t._isUTC),h(t._offset)||(e._offset=t._offset),h(t._pf)||(e._pf=c(t)),h(t._locale)||(e._locale=t._locale),yn.length>0)for(i in yn)n=yn[i],r=t[n],h(r)||(e[n]=r);return e}function f(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Yn===!1&&(Yn=!0,e.updateOffset(this),Yn=!1)}function m(e){return e instanceof f||null!=e&&null!=e._isAMomentObject}function g(e){return e<0?Math.ceil(e):Math.floor(e)}function v(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=g(t)),i}function _(e,t,i){var n,r=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),o=0;for(n=0;n<r;n++)(i&&e[n]!==t[n]||!i&&v(e[n])!==v(t[n]))&&o++;return o+s}function y(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function Y(e,t){var i=!0;return o(function(){return i&&(y(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),i=!1),t.apply(this,arguments)},t)}function b(e,t){bn[e]||(y(t),bn[e]=!0)}function L(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function T(e){var t,i;for(i in e)t=e[i],L(t)?this[i]=t:this["_"+i]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function C(e,t){var i,n=o({},e);for(i in t)s(t,i)&&(S(e[i])&&S(t[i])?(n[i]={},o(n[i],e[i]),o(n[i],t[i])):null!=t[i]?n[i]=t[i]:delete n[i]);return n}function w(e){null!=e&&this.set(e)}function Z(e){return e?e.toLowerCase().replace("_","-"):e}function D(e){for(var t,i,n,r,s=0;s<e.length;){for(r=Z(e[s]).split("-"),t=r.length,i=Z(e[s+1]),i=i?i.split("-"):null;t>0;){if(n=M(r.slice(0,t).join("-")))return n;if(i&&i.length>=t&&_(r,i,!0)>=t-1)break;t--}s++}return null}function M(e){var t=null;if(!Sn[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=Ln._abbr,require("./locale/"+e),x(t)}catch(e){}return Sn[e]}function x(e,t){var i;return e&&(i=h(t)?P(e):H(e,t),i&&(Ln=i)),Ln._abbr}function H(e,t){return null!==t?(t.abbr=e,null!=Sn[e]?(b("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),t=C(Sn[e]._config,t)):null!=t.parentLocale&&(null!=Sn[t.parentLocale]?t=C(Sn[t.parentLocale]._config,t):b("parentLocaleUndefined","specified parentLocale is not defined yet")),Sn[e]=new w(t),x(e),Sn[e]):(delete Sn[e],null)}function X(e,t){if(null!=t){var i;null!=Sn[e]&&(t=C(Sn[e]._config,t)),i=new w(t),i.parentLocale=Sn[e],Sn[e]=i,x(e)}else null!=Sn[e]&&(null!=Sn[e].parentLocale?Sn[e]=Sn[e].parentLocale:null!=Sn[e]&&delete Sn[e]);return Sn[e]}function P(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Ln;if(!i(e)){if(t=M(e))return t;e=[e]}return D(e)}function J(){return Object.keys(Sn)}function k(e,t){var i=e.toLowerCase();Tn[i]=Tn[i+"s"]=Tn[t]=e}function F(e){return"string"==typeof e?Tn[e]||Tn[e.toLowerCase()]:void 0}function Q(e){var t,i,n={};for(i in e)s(e,i)&&(t=F(i),t&&(n[t]=e[i]));return n}function N(t,i){return function(n){return null!=n?(W(this,t,n),e.updateOffset(this,i),this):B(this,t)}}function B(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function W(e,t,i){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](i)}function E(e,t){var i;if("object"==typeof e)for(i in e)this.set(i,e[i]);else if(e=F(e),L(this[e]))return this[e](t);return this}function G(e,t,i){var n=""+Math.abs(e),r=t-n.length,s=e>=0;return(s?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}function R(e,t,i,n){var r=n;"string"==typeof n&&(r=function(){return this[n]()}),e&&(Dn[e]=r),t&&(Dn[t[0]]=function(){return G(r.apply(this,arguments),t[1],t[2])}),i&&(Dn[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function j(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function $(e){var t,i,n=e.match(Cn);for(t=0,i=n.length;t<i;t++)Dn[n[t]]?n[t]=Dn[n[t]]:n[t]=j(n[t]);return function(r){var s="";for(t=0;t<i;t++)s+=n[t]instanceof Function?n[t].call(r,e):n[t];return s}}function A(e,t){return e.isValid()?(t=O(t,e.localeData()),Zn[t]=Zn[t]||$(t),Zn[t](e)):e.localeData().invalidDate()}function O(e,t){function i(e){return t.longDateFormat(e)||e}var n=5;for(wn.lastIndex=0;n>=0&&wn.test(e);)e=e.replace(wn,i),wn.lastIndex=0,n-=1;return e}function K(e,t,i){An[e]=L(t)?t:function(e,n){return e&&i?i:t}}function I(e,t){return s(An,e)?An[e](t._strict,t._locale):new RegExp(U(e))}function U(e){return z(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,r){return t||i||n||r}))}function z(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function q(e,t){var i,n=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(n=function(e,i){i[t]=v(e)}),i=0;i<e.length;i++)On[e[i]]=n}function V(e,t){q(e,function(e,i,n,r){n._w=n._w||{},t(e,n._w,n,r)})}function ee(e,t,i){null!=t&&s(On,e)&&On[e](t,i._a,i,e)}function te(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function ie(e,t){return i(this._months)?this._months[e.month()]:this._months[nr.test(t)?"format":"standalone"][e.month()]}function ne(e,t){return i(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[nr.test(t)?"format":"standalone"][e.month()]}function re(e,t,i){var n,r,s;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(r=a([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(s="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}}function se(e,t){var i;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=v(t);else if(t=e.localeData().monthsParse(t),"number"!=typeof t)return e;return i=Math.min(e.date(),te(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e}function oe(t){return null!=t?(se(this,t),e.updateOffset(this,!0),this):B(this,"Month")}function ae(){return te(this.year(),this.month())}function le(e){return this._monthsParseExact?(s(this,"_monthsRegex")||ue.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function ce(e){return this._monthsParseExact?(s(this,"_monthsRegex")||ue.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function ue(){function e(e,t){return t.length-e.length}var t,i,n=[],r=[],s=[];for(t=0;t<12;t++)i=a([2e3,t]),n.push(this.monthsShort(i,"")),r.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(n.sort(e),r.sort(e),s.sort(e),t=0;t<12;t++)n[t]=z(n[t]),r[t]=z(r[t]),s[t]=z(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")$","i")}function de(e){var t,i=e._a;return i&&c(e).overflow===-2&&(t=i[In]<0||i[In]>11?In:i[Un]<1||i[Un]>te(i[Kn],i[In])?Un:i[zn]<0||i[zn]>24||24===i[zn]&&(0!==i[qn]||0!==i[Vn]||0!==i[er])?zn:i[qn]<0||i[qn]>59?qn:i[Vn]<0||i[Vn]>59?Vn:i[er]<0||i[er]>999?er:-1,c(e)._overflowDayOfYear&&(t<Kn||t>Un)&&(t=Un),c(e)._overflowWeeks&&t===-1&&(t=tr),c(e)._overflowWeekday&&t===-1&&(t=ir),c(e).overflow=t),e}function he(e){var t,i,n,r,s,o,a=e._i,l=lr.exec(a)||cr.exec(a);if(l){for(c(e).iso=!0,t=0,i=dr.length;t<i;t++)if(dr[t][1].exec(l[1])){r=dr[t][0],n=dr[t][2]!==!1;break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,i=hr.length;t<i;t++)if(hr[t][1].exec(l[3])){s=(l[2]||" ")+hr[t][0];break}if(null==s)return void(e._isValid=!1)}if(!n&&null!=s)return void(e._isValid=!1);if(l[4]){if(!ur.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=r+(s||"")+(o||""),Ze(e)}else e._isValid=!1}function pe(t){var i=pr.exec(t._i);return null!==i?void(t._d=new Date(+i[1])):(he(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function fe(e,t,i,n,r,s,o){var a=new Date(e,t,i,n,r,s,o);return e<100&&e>=0&&isFinite(a.getFullYear())&&a.setFullYear(e),a}function me(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function ge(e){return ve(e)?366:365}function ve(e){return e%4===0&&e%100!==0||e%400===0}function _e(){return ve(this.year())}function ye(e,t,i){var n=7+t-i,r=(7+me(e,0,n).getUTCDay()-t)%7;return-r+n-1}function Ye(e,t,i,n,r){var s,o,a=(7+i-n)%7,l=ye(e,n,r),c=1+7*(t-1)+a+l;return c<=0?(s=e-1,o=ge(s)+c):c>ge(e)?(s=e+1,o=c-ge(e)):(s=e,o=c),{year:s,dayOfYear:o}}function be(e,t,i){var n,r,s=ye(e.year(),t,i),o=Math.floor((e.dayOfYear()-s-1)/7)+1;return o<1?(r=e.year()-1,n=o+Le(r,t,i)):o>Le(e.year(),t,i)?(n=o-Le(e.year(),t,i),r=e.year()+1):(r=e.year(),n=o),{week:n,year:r}}function Le(e,t,i){var n=ye(e,t,i),r=ye(e+1,t,i);return(ge(e)-n+r)/7}function Se(e,t,i){return null!=e?e:null!=t?t:i}function Te(t){var i=new Date(e.now());return t._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function Ce(e){var t,i,n,r,s=[];if(!e._d){for(n=Te(e),e._w&&null==e._a[Un]&&null==e._a[In]&&we(e),e._dayOfYear&&(r=Se(e._a[Kn],n[Kn]),e._dayOfYear>ge(r)&&(c(e)._overflowDayOfYear=!0),i=me(r,0,e._dayOfYear),e._a[In]=i.getUTCMonth(),e._a[Un]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=n[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[zn]&&0===e._a[qn]&&0===e._a[Vn]&&0===e._a[er]&&(e._nextDay=!0,e._a[zn]=0),e._d=(e._useUTC?me:fe).apply(null,s),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[zn]=24)}}function we(e){var t,i,n,r,s,o,a,l;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(s=1,o=4,i=Se(t.GG,e._a[Kn],be(ke(),1,4).year),n=Se(t.W,1),r=Se(t.E,1),(r<1||r>7)&&(l=!0)):(s=e._locale._week.dow,o=e._locale._week.doy,i=Se(t.gg,e._a[Kn],be(ke(),s,o).year),n=Se(t.w,1),null!=t.d?(r=t.d,(r<0||r>6)&&(l=!0)):null!=t.e?(r=t.e+s,(t.e<0||t.e>6)&&(l=!0)):r=s),n<1||n>Le(i,s,o)?c(e)._overflowWeeks=!0:null!=l?c(e)._overflowWeekday=!0:(a=Ye(i,n,r,s,o),e._a[Kn]=a.year,e._dayOfYear=a.dayOfYear)}function Ze(t){if(t._f===e.ISO_8601)return void he(t);t._a=[],c(t).empty=!0;var i,n,r,s,o,a=""+t._i,l=a.length,u=0;for(r=O(t._f,t._locale).match(Cn)||[],i=0;i<r.length;i++)s=r[i],n=(a.match(I(s,t))||[])[0],n&&(o=a.substr(0,a.indexOf(n)),o.length>0&&c(t).unusedInput.push(o),a=a.slice(a.indexOf(n)+n.length),u+=n.length),Dn[s]?(n?c(t).empty=!1:c(t).unusedTokens.push(s),ee(s,n,t)):t._strict&&!n&&c(t).unusedTokens.push(s);c(t).charsLeftOver=l-u,a.length>0&&c(t).unusedInput.push(a),c(t).bigHour===!0&&t._a[zn]<=12&&t._a[zn]>0&&(c(t).bigHour=void 0),t._a[zn]=De(t._locale,t._a[zn],t._meridiem),Ce(t),de(t)}function De(e,t,i){var n;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?(n=e.isPM(i),n&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function Me(e){var t,i,n,r,s;if(0===e._f.length)return c(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)s=0,t=p({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],Ze(t),u(t)&&(s+=c(t).charsLeftOver,s+=10*c(t).unusedTokens.length,c(t).score=s,(null==n||s<n)&&(n=s,i=t));o(e,i||t)}function xe(e){if(!e._d){var t=Q(e._i);e._a=r([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),Ce(e)}}function He(e){var t=new f(de(Xe(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Xe(e){var t=e._i,r=e._f;return e._locale=e._locale||P(e._l),null===t||void 0===r&&""===t?d({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),m(t)?new f(de(t)):(i(r)?Me(e):r?Ze(e):n(t)?e._d=t:Pe(e),u(e)||(e._d=null),e))}function Pe(t){var s=t._i;void 0===s?t._d=new Date(e.now()):n(s)?t._d=new Date(+s):"string"==typeof s?pe(t):i(s)?(t._a=r(s.slice(0),function(e){return parseInt(e,10)}),Ce(t)):"object"==typeof s?xe(t):"number"==typeof s?t._d=new Date(s):e.createFromInputFallback(t)}function Je(e,t,i,n,r){var s={};return"boolean"==typeof i&&(n=i,i=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=r,s._l=i,s._i=e,s._f=t,s._strict=n,He(s)}function ke(e,t,i,n){return Je(e,t,i,n,!1)}function Fe(e,t){var n,r;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return ke();for(n=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](n)||(n=t[r]);return n}function Qe(){var e=[].slice.call(arguments,0);return Fe("isBefore",e)}function Ne(){var e=[].slice.call(arguments,0);return Fe("isAfter",e)}function Be(e){var t=Q(e),i=t.year||0,n=t.quarter||0,r=t.month||0,s=t.week||0,o=t.day||0,a=t.hour||0,l=t.minute||0,c=t.second||0,u=t.millisecond||0;this._milliseconds=+u+1e3*c+6e4*l+36e5*a,this._days=+o+7*s,this._months=+r+3*n+12*i,this._data={},this._locale=P(),this._bubble()}function We(e){return e instanceof Be}function Ee(e,t){R(e,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+G(~~(e/60),2)+t+G(~~e%60,2)})}function Ge(e,t){var i=(t||"").match(e)||[],n=i[i.length-1]||[],r=(n+"").match(_r)||["-",0,0],s=+(60*r[1])+v(r[2]);return"+"===r[0]?s:-s}function Re(t,i){var r,s;return i._isUTC?(r=i.clone(),s=(m(t)||n(t)?+t:+ke(t))-+r,r._d.setTime(+r._d+s),e.updateOffset(r,!1),r):ke(t).local()}function je(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function $e(t,i){var n,r=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Ge(Rn,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&i&&(n=je(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),r!==t&&(!i||this._changeInProgress?lt(this,it(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:je(this):null!=t?this:NaN}function Ae(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Oe(e){return this.utcOffset(0,e)}function Ke(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(je(this),"m")),this}function Ie(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ge(Gn,this._i)),this}function Ue(e){return!!this.isValid()&&(e=e?ke(e).utcOffset():0,(this.utcOffset()-e)%60===0)}function ze(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function qe(){if(!h(this._isDSTShifted))return this._isDSTShifted;var e={};if(p(e,this),e=Xe(e),e._a){var t=e._isUTC?a(e._a):ke(e._a);this._isDSTShifted=this.isValid()&&_(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Ve(){return!!this.isValid()&&!this._isUTC}function et(){return!!this.isValid()&&this._isUTC}function tt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function it(e,t){var i,n,r,o=e,a=null;return We(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(o={},t?o[t]=e:o.milliseconds=e):(a=yr.exec(e))?(i="-"===a[1]?-1:1,o={y:0,d:v(a[Un])*i,h:v(a[zn])*i,m:v(a[qn])*i,s:v(a[Vn])*i,ms:v(a[er])*i}):(a=Yr.exec(e))?(i="-"===a[1]?-1:1,o={y:nt(a[2],i),M:nt(a[3],i),w:nt(a[4],i),d:nt(a[5],i),h:nt(a[6],i),m:nt(a[7],i),s:nt(a[8],i)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(r=st(ke(o.from),ke(o.to)),o={},o.ms=r.milliseconds,o.M=r.months),n=new Be(o),We(e)&&s(e,"_locale")&&(n._locale=e._locale),n}function nt(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function rt(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function st(e,t){var i;return e.isValid()&&t.isValid()?(t=Re(t,e),e.isBefore(t)?i=rt(e,t):(i=rt(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function ot(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function at(e,t){return function(i,n){var r,s;return null===n||isNaN(+n)||(b(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),s=i,i=n,n=s),i="string"==typeof i?+i:i,r=it(i,n),lt(this,r,e),this}}function lt(t,i,n,r){var s=i._milliseconds,o=ot(i._days),a=ot(i._months);t.isValid()&&(r=null==r||r,s&&t._d.setTime(+t._d+s*n),o&&W(t,"Date",B(t,"Date")+o*n),a&&se(t,B(t,"Month")+a*n),r&&e.updateOffset(t,o||a))}function ct(e,t){var i=e||ke(),n=Re(i,this).startOf("day"),r=this.diff(n,"days",!0),s=r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse",o=t&&(L(t[s])?t[s]():t[s]);return this.format(o||this.localeData().calendar(s,this,ke(i)))}function ut(){return new f(this)}function dt(e,t){var i=m(e)?e:ke(e);return!(!this.isValid()||!i.isValid())&&(t=F(h(t)?"millisecond":t),"millisecond"===t?+this>+i:+i<+this.clone().startOf(t))}function ht(e,t){var i=m(e)?e:ke(e);return!(!this.isValid()||!i.isValid())&&(t=F(h(t)?"millisecond":t),"millisecond"===t?+this<+i:+this.clone().endOf(t)<+i)}function pt(e,t,i){return this.isAfter(e,i)&&this.isBefore(t,i)}function ft(e,t){var i,n=m(e)?e:ke(e);return!(!this.isValid()||!n.isValid())&&(t=F(t||"millisecond"),"millisecond"===t?+this===+n:(i=+n,+this.clone().startOf(t)<=i&&i<=+this.clone().endOf(t)))}function mt(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function gt(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function vt(e,t,i){var n,r,s,o;return this.isValid()?(n=Re(e,this),n.isValid()?(r=6e4*(n.utcOffset()-this.utcOffset()),t=F(t),"year"===t||"month"===t||"quarter"===t?(o=_t(this,n),"quarter"===t?o/=3:"year"===t&&(o/=12)):(s=this-n,o="second"===t?s/1e3:"minute"===t?s/6e4:"hour"===t?s/36e5:"day"===t?(s-r)/864e5:"week"===t?(s-r)/6048e5:s),i?o:g(o)):NaN):NaN}function _t(e,t){var i,n,r=12*(t.year()-e.year())+(t.month()-e.month()),s=e.clone().add(r,"months");return t-s<0?(i=e.clone().add(r-1,"months"),n=(t-s)/(s-i)):(i=e.clone().add(r+1,"months"),n=(t-s)/(i-s)),-(r+n)}function yt(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Yt(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?L(Date.prototype.toISOString)?this.toDate().toISOString():A(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):A(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function bt(t){var i=A(this,t||e.defaultFormat);return this.localeData().postformat(i)}function Lt(e,t){return this.isValid()&&(m(e)&&e.isValid()||ke(e).isValid())?it({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function St(e){return this.from(ke(),e)}function Tt(e,t){return this.isValid()&&(m(e)&&e.isValid()||ke(e).isValid())?it({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Ct(e){return this.to(ke(),e)}function wt(e){var t;return void 0===e?this._locale._abbr:(t=P(e),null!=t&&(this._locale=t),this)}function Zt(){return this._locale}function Dt(e){switch(e=F(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function Mt(e){return e=F(e),void 0===e||"millisecond"===e?this:this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms")}function xt(){return+this._d-6e4*(this._offset||0)}function Ht(){return Math.floor(+this/1e3)}function Xt(){return this._offset?new Date(+this):this._d}function Pt(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Jt(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function kt(){return this.isValid()?this.toISOString():null}function Ft(){return u(this)}function Qt(){return o({},c(this))}function Nt(){return c(this).overflow}function Bt(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Wt(e,t){R(0,[e,e.length],0,t)}function Et(e){return $t.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Gt(e){return $t.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Rt(){return Le(this.year(),1,4)}function jt(){var e=this.localeData()._week;return Le(this.year(),e.dow,e.doy)}function $t(e,t,i,n,r){var s;return null==e?be(this,n,r).year:(s=Le(e,n,r),t>s&&(t=s),At.call(this,e,t,i,n,r))}function At(e,t,i,n,r){var s=Ye(e,t,i,n,r),o=me(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function Ot(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Kt(e){return be(e,this._week.dow,this._week.doy).week}function It(){return this._week.dow}function Ut(){return this._week.doy}function zt(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function qt(e){var t=be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Vt(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function ei(e,t){return i(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function ti(e){return this._weekdaysShort[e.day()]}function ii(e){return this._weekdaysMin[e.day()]}function ni(e,t,i){var n,r,s;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(r=ke([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===t&&this._fullWeekdaysParse[n].test(e))return n;if(i&&"ddd"===t&&this._shortWeekdaysParse[n].test(e))return n;if(i&&"dd"===t&&this._minWeekdaysParse[n].test(e))return n;if(!i&&this._weekdaysParse[n].test(e))return n}}function ri(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Vt(e,this.localeData()),this.add(e-t,"d")):t}function si(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function oi(e){return this.isValid()?null==e?this.day()||7:this.day(this.day()%7?e:e-7):null!=e?this:NaN}function ai(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function li(){return this.hours()%12||12}function ci(e,t){R(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function ui(e,t){return t._meridiemParse}function di(e){return"p"===(e+"").toLowerCase().charAt(0)}function hi(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function pi(e,t){t[er]=v(1e3*("0."+e))}function fi(){return this._isUTC?"UTC":""}function mi(){return this._isUTC?"Coordinated Universal Time":""}function gi(e){return ke(1e3*e)}function vi(){return ke.apply(null,arguments).parseZone()}function _i(e,t,i){var n=this._calendar[e];return L(n)?n.call(t,i):n}function yi(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function Yi(){return this._invalidDate}function bi(e){return this._ordinal.replace("%d",e)}function Li(e){return e}function Si(e,t,i,n){var r=this._relativeTime[i];return L(r)?r(e,t,i,n):r.replace(/%d/i,e)}function Ti(e,t){var i=this._relativeTime[e>0?"future":"past"];return L(i)?i(t):i.replace(/%s/i,t)}function Ci(e,t,i,n){var r=P(),s=a().set(n,t);return r[i](s,e)}function wi(e,t,i,n,r){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return Ci(e,t,i,r);var s,o=[];for(s=0;s<n;s++)o[s]=Ci(e,s,i,r);return o}function Zi(e,t){return wi(e,t,"months",12,"month")}function Di(e,t){return wi(e,t,"monthsShort",12,"month")}function Mi(e,t){return wi(e,t,"weekdays",7,"day")}function xi(e,t){return wi(e,t,"weekdaysShort",7,"day")}function Hi(e,t){return wi(e,t,"weekdaysMin",7,"day")}function Xi(){var e=this._data;return this._milliseconds=jr(this._milliseconds),this._days=jr(this._days),this._months=jr(this._months),e.milliseconds=jr(e.milliseconds),e.seconds=jr(e.seconds),e.minutes=jr(e.minutes),e.hours=jr(e.hours),e.months=jr(e.months),e.years=jr(e.years),this}function Pi(e,t,i,n){var r=it(t,i);return e._milliseconds+=n*r._milliseconds,e._days+=n*r._days,e._months+=n*r._months,e._bubble()}function Ji(e,t){return Pi(this,e,t,1)}function ki(e,t){return Pi(this,e,t,-1)}function Fi(e){return e<0?Math.floor(e):Math.ceil(e)}function Qi(){var e,t,i,n,r,s=this._milliseconds,o=this._days,a=this._months,l=this._data;return s>=0&&o>=0&&a>=0||s<=0&&o<=0&&a<=0||(s+=864e5*Fi(Bi(a)+o),o=0,a=0),l.milliseconds=s%1e3,e=g(s/1e3),l.seconds=e%60,t=g(e/60),l.minutes=t%60,i=g(t/60),l.hours=i%24,o+=g(i/24),r=g(Ni(o)),a+=r,o-=Fi(Bi(r)),n=g(a/12),a%=12,l.days=o,l.months=a,l.years=n,this}function Ni(e){return 4800*e/146097}function Bi(e){return 146097*e/4800}function Wi(e){var t,i,n=this._milliseconds;if(e=F(e),"month"===e||"year"===e)return t=this._days+n/864e5,i=this._months+Ni(t),"month"===e?i:i/12;switch(t=this._days+Math.round(Bi(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function Ei(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*v(this._months/12)}function Gi(e){return function(){return this.as(e)}}function Ri(e){return e=F(e),this[e+"s"]()}function ji(e){return function(){return this._data[e]}}function $i(){return g(this.days()/7)}function Ai(e,t,i,n,r){return r.relativeTime(t||1,!!i,e,n)}function Oi(e,t,i){var n=it(e).abs(),r=os(n.as("s")),s=os(n.as("m")),o=os(n.as("h")),a=os(n.as("d")),l=os(n.as("M")),c=os(n.as("y")),u=r<as.s&&["s",r]||s<=1&&["m"]||s<as.m&&["mm",s]||o<=1&&["h"]||o<as.h&&["hh",o]||a<=1&&["d"]||a<as.d&&["dd",a]||l<=1&&["M"]||l<as.M&&["MM",l]||c<=1&&["y"]||["yy",c];return u[2]=t,u[3]=+e>0,u[4]=i,Ai.apply(null,u)}function Ki(e,t){return void 0!==as[e]&&(void 0===t?as[e]:(as[e]=t,!0))}function Ii(e){var t=this.localeData(),i=Oi(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function Ui(){var e,t,i,n=ls(this._milliseconds)/1e3,r=ls(this._days),s=ls(this._months);e=g(n/60),t=g(e/60),n%=60,e%=60,i=g(s/12),s%=12;var o=i,a=s,l=r,c=t,u=e,d=n,h=this.asSeconds();return h?(h<0?"-":"")+"P"+(o?o+"Y":"")+(a?a+"M":"")+(l?l+"D":"")+(c||u||d?"T":"")+(c?c+"H":"")+(u?u+"M":"")+(d?d+"S":""):"P0D"}function zi(e,t,i,n){var r={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?r[i][0]:r[i][1]}function qi(e,t,i,n){var r=e;switch(i){case"s":return n||t?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(n||t?" perc":" perce");case"mm":return r+(n||t?" perc":" perce");case"h":return"egy"+(n||t?" óra":" órája");case"hh":return r+(n||t?" óra":" órája");case"d":return"egy"+(n||t?" nap":" napja");case"dd":return r+(n||t?" nap":" napja");case"M":return"egy"+(n||t?" hónap":" hónapja");case"MM":return r+(n||t?" hónap":" hónapja");case"y":return"egy"+(n||t?" év":" éve");case"yy":return r+(n||t?" év":" éve")}return""}function Vi(e){return(e?"":"[múlt] ")+"["+ps[this.day()]+"] LT[-kor]"}function en(e){return e%100===11||e%10!==1}function tn(e,t,i,n){var r=e+" ";switch(i){case"s":return t||n?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return t?"mínúta":"mínútu";case"mm":return en(e)?r+(t||n?"mínútur":"mínútum"):t?r+"mínúta":r+"mínútu";case"hh":return en(e)?r+(t||n?"klukkustundir":"klukkustundum"):r+"klukkustund";case"d":return t?"dagur":n?"dag":"degi";case"dd":return en(e)?t?r+"dagar":r+(n?"daga":"dögum"):t?r+"dagur":r+(n?"dag":"degi");case"M":return t?"mánuður":n?"mánuð":"mánuði";case"MM":return en(e)?t?r+"mánuðir":r+(n?"mánuði":"mánuðum"):t?r+"mánuður":r+(n?"mánuð":"mánuði");case"y":return t||n?"ár":"ári";case"yy":return en(e)?r+(t||n?"ár":"árum"):r+(t||n?"ár":"ári")}}function nn(e,t,i){return i?t%10===1&&11!==t?e[2]:e[3]:t%10===1&&11!==t?e[0]:e[1]}function rn(e,t,i){return e+" "+nn(fs[i],e,t)}function sn(e,t,i){return nn(fs[i],e,t)}function on(e,t){return t?"dažas sekundes":"dažām sekundēm"}function an(e){return e%10<5&&e%10>1&&~~(e/10)%10!==1}function ln(e,t,i){var n=e+" ";switch(i){case"m":return t?"minuta":"minutę";case"mm":return n+(an(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return n+(an(e)?"godziny":"godzin");case"MM":return n+(an(e)?"miesiące":"miesięcy");case"yy":return n+(an(e)?"lata":"lat")}}function cn(e,t){var i=e.split("_");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}function un(e,t,i){var n={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===i?t?"минута":"минуту":e+" "+cn(n[i],+e)}function dn(e){return e>1&&e<5}function hn(e,t,i,n){var r=e+" ";switch(i){case"s":return t||n?"pár sekúnd":"pár sekundami";case"m":return t?"minúta":n?"minútu":"minútou";case"mm":return t||n?r+(dn(e)?"minúty":"minút"):r+"minútami";case"h":return t?"hodina":n?"hodinu":"hodinou";case"hh":return t||n?r+(dn(e)?"hodiny":"hodín"):r+"hodinami";case"d":return t||n?"deň":"dňom";case"dd":return t||n?r+(dn(e)?"dni":"dní"):r+"dňami";case"M":return t||n?"mesiac":"mesiacom";case"MM":return t||n?r+(dn(e)?"mesiace":"mesiacov"):r+"mesiacmi";case"y":return t||n?"rok":"rokom";
case"yy":return t||n?r+(dn(e)?"roky":"rokov"):r+"rokmi"}}function pn(e,t,i,n){var r=e+" ";switch(i){case"s":return t||n?"nekaj sekund":"nekaj sekundami";case"m":return t?"ena minuta":"eno minuto";case"mm":return r+=1===e?t?"minuta":"minuto":2===e?t||n?"minuti":"minutama":e<5?t||n?"minute":"minutami":t||n?"minut":"minutami";case"h":return t?"ena ura":"eno uro";case"hh":return r+=1===e?t?"ura":"uro":2===e?t||n?"uri":"urama":e<5?t||n?"ure":"urami":t||n?"ur":"urami";case"d":return t||n?"en dan":"enim dnem";case"dd":return r+=1===e?t||n?"dan":"dnem":2===e?t||n?"dni":"dnevoma":t||n?"dni":"dnevi";case"M":return t||n?"en mesec":"enim mesecem";case"MM":return r+=1===e?t||n?"mesec":"mesecem":2===e?t||n?"meseca":"mesecema":e<5?t||n?"mesece":"meseci":t||n?"mesecev":"meseci";case"y":return t||n?"eno leto":"enim letom";case"yy":return r+=1===e?t||n?"leto":"letom":2===e?t||n?"leti":"letoma":e<5?t||n?"leta":"leti":t||n?"let":"leti"}}function fn(e,t){var i=e.split("_");return t%10===1&&t%100!==11?i[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?i[1]:i[2]}function mn(e,t,i){var n={mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return"m"===i?t?"хвилина":"хвилину":"h"===i?t?"година":"годину":e+" "+fn(n[i],+e)}function gn(e,t){var i={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},n=/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative";return i[n][e.day()]}function vn(e){return function(){return e+"о"+(11===this.hours()?"б":"")+"] LT"}}var _n,yn=e.momentProperties=[],Yn=!1,bn={};e.suppressDeprecationWarnings=!1;var Ln,Sn={},Tn={},Cn=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,wn=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Zn={},Dn={},Mn=/\d/,xn=/\d\d/,Hn=/\d{3}/,Xn=/\d{4}/,Pn=/[+-]?\d{6}/,Jn=/\d\d?/,kn=/\d\d\d\d?/,Fn=/\d\d\d\d\d\d?/,Qn=/\d{1,3}/,Nn=/\d{1,4}/,Bn=/[+-]?\d{1,6}/,Wn=/\d+/,En=/[+-]?\d+/,Gn=/Z|[+-]\d\d:?\d\d/gi,Rn=/Z|[+-]\d\d(?::?\d\d)?/gi,jn=/[+-]?\d+(\.\d{1,3})?/,$n=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,An={},On={},Kn=0,In=1,Un=2,zn=3,qn=4,Vn=5,er=6,tr=7,ir=8;R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),R("MMMM",0,0,function(e){return this.localeData().months(this,e)}),k("month","M"),K("M",Jn),K("MM",Jn,xn),K("MMM",function(e,t){return t.monthsShortRegex(e)}),K("MMMM",function(e,t){return t.monthsRegex(e)}),q(["M","MM"],function(e,t){t[In]=v(e)-1}),q(["MMM","MMMM"],function(e,t,i,n){var r=i._locale.monthsParse(e,n,i._strict);null!=r?t[In]=r:c(i).invalidMonth=e});var nr=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,rr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),sr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),or=$n,ar=$n,lr=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,cr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,ur=/Z|[+-]\d\d(?::?\d\d)?/,dr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],hr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],pr=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=Y("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),R("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),k("year","y"),K("Y",En),K("YY",Jn,xn),K("YYYY",Nn,Xn),K("YYYYY",Bn,Pn),K("YYYYYY",Bn,Pn),q(["YYYYY","YYYYYY"],Kn),q("YYYY",function(t,i){i[Kn]=2===t.length?e.parseTwoDigitYear(t):v(t)}),q("YY",function(t,i){i[Kn]=e.parseTwoDigitYear(t)}),q("Y",function(e,t){t[Kn]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return v(e)+(v(e)>68?1900:2e3)};var fr=N("FullYear",!1);e.ISO_8601=function(){};var mr=Y("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=ke.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:d()}),gr=Y("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=ke.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:d()}),vr=function(){return Date.now?Date.now():+new Date};Ee("Z",":"),Ee("ZZ",""),K("Z",Rn),K("ZZ",Rn),q(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Ge(Rn,e)});var _r=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var yr=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Yr=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;it.fn=Be.prototype;var br=at(1,"add"),Lr=at(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Sr=Y("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Wt("gggg","weekYear"),Wt("ggggg","weekYear"),Wt("GGGG","isoWeekYear"),Wt("GGGGG","isoWeekYear"),k("weekYear","gg"),k("isoWeekYear","GG"),K("G",En),K("g",En),K("GG",Jn,xn),K("gg",Jn,xn),K("GGGG",Nn,Xn),K("gggg",Nn,Xn),K("GGGGG",Bn,Pn),K("ggggg",Bn,Pn),V(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=v(e)}),V(["gg","GG"],function(t,i,n,r){i[r]=e.parseTwoDigitYear(t)}),R("Q",0,"Qo","quarter"),k("quarter","Q"),K("Q",Mn),q("Q",function(e,t){t[In]=3*(v(e)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),k("week","w"),k("isoWeek","W"),K("w",Jn),K("ww",Jn,xn),K("W",Jn),K("WW",Jn,xn),V(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=v(e)});var Tr={dow:0,doy:6};R("D",["DD",2],"Do","date"),k("date","D"),K("D",Jn),K("DD",Jn,xn),K("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),q(["D","DD"],Un),q("Do",function(e,t){t[Un]=v(e.match(Jn)[0],10)});var Cr=N("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),R("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),R("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),k("day","d"),k("weekday","e"),k("isoWeekday","E"),K("d",Jn),K("e",Jn),K("E",Jn),K("dd",$n),K("ddd",$n),K("dddd",$n),V(["dd","ddd","dddd"],function(e,t,i,n){var r=i._locale.weekdaysParse(e,n,i._strict);null!=r?t.d=r:c(i).invalidWeekday=e}),V(["d","e","E"],function(e,t,i,n){t[n]=v(e)});var wr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Dr="Su_Mo_Tu_We_Th_Fr_Sa".split("_");R("DDD",["DDDD",3],"DDDo","dayOfYear"),k("dayOfYear","DDD"),K("DDD",Qn),K("DDDD",Hn),q(["DDD","DDDD"],function(e,t,i){i._dayOfYear=v(e)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,li),R("hmm",0,0,function(){return""+li.apply(this)+G(this.minutes(),2)}),R("hmmss",0,0,function(){return""+li.apply(this)+G(this.minutes(),2)+G(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+G(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+G(this.minutes(),2)+G(this.seconds(),2)}),ci("a",!0),ci("A",!1),k("hour","h"),K("a",ui),K("A",ui),K("H",Jn),K("h",Jn),K("HH",Jn,xn),K("hh",Jn,xn),K("hmm",kn),K("hmmss",Fn),K("Hmm",kn),K("Hmmss",Fn),q(["H","HH"],zn),q(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),q(["h","hh"],function(e,t,i){t[zn]=v(e),c(i).bigHour=!0}),q("hmm",function(e,t,i){var n=e.length-2;t[zn]=v(e.substr(0,n)),t[qn]=v(e.substr(n)),c(i).bigHour=!0}),q("hmmss",function(e,t,i){var n=e.length-4,r=e.length-2;t[zn]=v(e.substr(0,n)),t[qn]=v(e.substr(n,2)),t[Vn]=v(e.substr(r)),c(i).bigHour=!0}),q("Hmm",function(e,t,i){var n=e.length-2;t[zn]=v(e.substr(0,n)),t[qn]=v(e.substr(n))}),q("Hmmss",function(e,t,i){var n=e.length-4,r=e.length-2;t[zn]=v(e.substr(0,n)),t[qn]=v(e.substr(n,2)),t[Vn]=v(e.substr(r))});var Mr=/[ap]\.?m?\.?/i,xr=N("Hours",!0);R("m",["mm",2],0,"minute"),k("minute","m"),K("m",Jn),K("mm",Jn,xn),q(["m","mm"],qn);var Hr=N("Minutes",!1);R("s",["ss",2],0,"second"),k("second","s"),K("s",Jn),K("ss",Jn,xn),q(["s","ss"],Vn);var Xr=N("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),k("millisecond","ms"),K("S",Qn,Mn),K("SS",Qn,xn),K("SSS",Qn,Hn);var Pr;for(Pr="SSSS";Pr.length<=9;Pr+="S")K(Pr,Wn);for(Pr="S";Pr.length<=9;Pr+="S")q(Pr,pi);var Jr=N("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var kr=f.prototype;kr.add=br,kr.calendar=ct,kr.clone=ut,kr.diff=vt,kr.endOf=Mt,kr.format=bt,kr.from=Lt,kr.fromNow=St,kr.to=Tt,kr.toNow=Ct,kr.get=E,kr.invalidAt=Nt,kr.isAfter=dt,kr.isBefore=ht,kr.isBetween=pt,kr.isSame=ft,kr.isSameOrAfter=mt,kr.isSameOrBefore=gt,kr.isValid=Ft,kr.lang=Sr,kr.locale=wt,kr.localeData=Zt,kr.max=gr,kr.min=mr,kr.parsingFlags=Qt,kr.set=E,kr.startOf=Dt,kr.subtract=Lr,kr.toArray=Pt,kr.toObject=Jt,kr.toDate=Xt,kr.toISOString=Yt,kr.toJSON=kt,kr.toString=yt,kr.unix=Ht,kr.valueOf=xt,kr.creationData=Bt,kr.year=fr,kr.isLeapYear=_e,kr.weekYear=Et,kr.isoWeekYear=Gt,kr.quarter=kr.quarters=Ot,kr.month=oe,kr.daysInMonth=ae,kr.week=kr.weeks=zt,kr.isoWeek=kr.isoWeeks=qt,kr.weeksInYear=jt,kr.isoWeeksInYear=Rt,kr.date=Cr,kr.day=kr.days=ri,kr.weekday=si,kr.isoWeekday=oi,kr.dayOfYear=ai,kr.hour=kr.hours=xr,kr.minute=kr.minutes=Hr,kr.second=kr.seconds=Xr,kr.millisecond=kr.milliseconds=Jr,kr.utcOffset=$e,kr.utc=Oe,kr.local=Ke,kr.parseZone=Ie,kr.hasAlignedHourOffset=Ue,kr.isDST=ze,kr.isDSTShifted=qe,kr.isLocal=Ve,kr.isUtcOffset=et,kr.isUtc=tt,kr.isUTC=tt,kr.zoneAbbr=fi,kr.zoneName=mi,kr.dates=Y("dates accessor is deprecated. Use date instead.",Cr),kr.months=Y("months accessor is deprecated. Use month instead",oe),kr.years=Y("years accessor is deprecated. Use year instead",fr),kr.zone=Y("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ae);var Fr=kr,Qr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Nr={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Br="Invalid date",Wr="%d",Er=/\d{1,2}/,Gr={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Rr=w.prototype;Rr._calendar=Qr,Rr.calendar=_i,Rr._longDateFormat=Nr,Rr.longDateFormat=yi,Rr._invalidDate=Br,Rr.invalidDate=Yi,Rr._ordinal=Wr,Rr.ordinal=bi,Rr._ordinalParse=Er,Rr.preparse=Li,Rr.postformat=Li,Rr._relativeTime=Gr,Rr.relativeTime=Si,Rr.pastFuture=Ti,Rr.set=T,Rr.months=ie,Rr._months=rr,Rr.monthsShort=ne,Rr._monthsShort=sr,Rr.monthsParse=re,Rr._monthsRegex=ar,Rr.monthsRegex=ce,Rr._monthsShortRegex=or,Rr.monthsShortRegex=le,Rr.week=Kt,Rr._week=Tr,Rr.firstDayOfYear=Ut,Rr.firstDayOfWeek=It,Rr.weekdays=ei,Rr._weekdays=wr,Rr.weekdaysMin=ii,Rr._weekdaysMin=Dr,Rr.weekdaysShort=ti,Rr._weekdaysShort=Zr,Rr.weekdaysParse=ni,Rr.isPM=di,Rr._meridiemParse=Mr,Rr.meridiem=hi,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,i=1===v(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+i}}),e.lang=Y("moment.lang is deprecated. Use moment.locale instead.",x),e.langData=Y("moment.langData is deprecated. Use moment.localeData instead.",P);var jr=Math.abs,$r=Gi("ms"),Ar=Gi("s"),Or=Gi("m"),Kr=Gi("h"),Ir=Gi("d"),Ur=Gi("w"),zr=Gi("M"),qr=Gi("y"),Vr=ji("milliseconds"),es=ji("seconds"),ts=ji("minutes"),is=ji("hours"),ns=ji("days"),rs=ji("months"),ss=ji("years"),os=Math.round,as={s:45,m:45,h:22,d:26,M:11},ls=Math.abs,cs=Be.prototype;cs.abs=Xi,cs.add=Ji,cs.subtract=ki,cs.as=Wi,cs.asMilliseconds=$r,cs.asSeconds=Ar,cs.asMinutes=Or,cs.asHours=Kr,cs.asDays=Ir,cs.asWeeks=Ur,cs.asMonths=zr,cs.asYears=qr,cs.valueOf=Ei,cs._bubble=Qi,cs.get=Ri,cs.milliseconds=Vr,cs.seconds=es,cs.minutes=ts,cs.hours=is,cs.days=ns,cs.weeks=$i,cs.months=rs,cs.years=ss,cs.humanize=Ii,cs.toISOString=Ui,cs.toString=Ui,cs.toJSON=Ui,cs.locale=wt,cs.localeData=Zt,cs.toIsoString=Y("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ui),cs.lang=Sr,R("X",0,0,"unix"),R("x",0,0,"valueOf"),K("x",En),K("X",jn),q("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),q("x",function(e,t,i){i._d=new Date(v(e))}),e.version="2.12.0",t(ke),e.fn=Fr,e.min=Qe,e.max=Ne,e.now=vr,e.utc=a,e.unix=gi,e.months=Zi,e.isDate=n,e.locale=x,e.invalid=d,e.duration=it,e.isMoment=m,e.weekdays=Mi,e.parseZone=vi,e.localeData=P,e.isDuration=We,e.monthsShort=Di,e.weekdaysMin=Hi,e.defineLocale=H,e.updateLocale=X,e.locales=J,e.weekdaysShort=xi,e.normalizeUnits=F,e.relativeTimeThreshold=Ki,e.prototype=Fr;var us=e,ds=(us.defineLocale("ca",{months:"gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre".split("_"),monthsShort:"gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.".split("_"),weekdays:"diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte".split("_"),weekdaysShort:"dg._dl._dt._dc._dj._dv._ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd D MMMM YYYY H:mm"},calendar:{sameDay:function(){return"[avui a "+(1!==this.hours()?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(1!==this.hours()?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(1!==this.hours()?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(1!==this.hours()?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(1!==this.hours()?"les":"la")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinalParse:/\d{1,2}(r|n|t|è|a)/,ordinal:function(e,t){var i=1===e?"r":2===e?"n":3===e?"r":4===e?"t":"è";return"w"!==t&&"W"!==t||(i="a"),e+i},week:{dow:1,doy:4}}),us.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:zi,mm:"%d Minuten",h:zi,hh:"%d Stunden",d:zi,dd:zi,M:zi,MM:zi,y:zi,yy:zi},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),us.defineLocale("en-gb",{months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10,i=1===~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+i},week:{dow:1,doy:4}}),"ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_")),hs="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),ps=(us.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,t){return/-MMM-/.test(t)?hs[e.month()]:ds[e.month()]},weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),us.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"Di_Lu_Ma_Me_Je_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd'hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinalParse:/\d{1,2}(er|)/,ordinal:function(e){return e+(1===e?"er":"")},week:{dow:1,doy:4}}),us.defineLocale("he",{months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳".split("_"),weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א_ב_ג_ד_ה_ו_ש".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},calendar:{sameDay:"[היום ב־]LT",nextDay:"[מחר ב־]LT",nextWeek:"dddd [בשעה] LT",lastDay:"[אתמול ב־]LT",lastWeek:"[ביום] dddd [האחרון בשעה] LT",sameElse:"L"},relativeTime:{future:"בעוד %s",past:"לפני %s",s:"מספר שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:function(e){return 2===e?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return 2===e?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return 2===e?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return 2===e?"שנתיים":e%10===0&&10!==e?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,i){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?i?'לפנה"צ':"לפני הצהריים":e<18?i?'אחה"צ':"אחרי הצהריים":"בערב"}}),"vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" ")),fs=(us.defineLocale("hu",{months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"},meridiemParse:/de|du/i,isPM:function(e){return"u"===e.charAt(1).toLowerCase()},meridiem:function(e,t,i){return e<12?i===!0?"de":"DE":i===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return Vi.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return Vi.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:qi,m:qi,mm:qi,h:qi,hh:qi,d:qi,dd:qi,M:qi,MM:qi,y:qi,yy:qi},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),us.defineLocale("is",{months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},calendar:{sameDay:"[í dag kl.] LT",nextDay:"[á morgun kl.] LT",nextWeek:"dddd [kl.] LT",lastDay:"[í gær kl.] LT",lastWeek:"[síðasta] dddd [kl.] LT",sameElse:"L"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s:tn,m:tn,mm:tn,h:"klukkustund",hh:tn,d:tn,dd:tn,M:tn,MM:tn,y:tn,yy:tn},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),us.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato".split("_"),weekdaysShort:"Dom_Lun_Mar_Mer_Gio_Ven_Sab".split("_"),weekdaysMin:"Do_Lu_Ma_Me_Gi_Ve_Sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(e){return(/^[0-9].+$/.test(e)?"tra":"in")+" "+e},past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}}),us.defineLocale("ja",{months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"Ah時m分",LTS:"Ah時m分s秒",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah時m分",LLLL:"YYYY年M月D日Ah時m分 dddd"},meridiemParse:/午前|午後/i,isPM:function(e){return"午後"===e},meridiem:function(e,t,i){return e<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:"[来週]dddd LT",lastDay:"[昨日] LT",lastWeek:"[前週]dddd LT",sameElse:"L"},ordinalParse:/\d{1,2}日/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";default:return e}},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}}),us.defineLocale("ko",{months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),longDateFormat:{LT:"A h시 m분",LTS:"A h시 m분 s초",L:"YYYY.MM.DD",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h시 m분",LLLL:"YYYY년 MMMM D일 dddd A h시 m분"},calendar:{sameDay:"오늘 LT",nextDay:"내일 LT",nextWeek:"dddd LT",lastDay:"어제 LT",lastWeek:"지난주 dddd LT",sameElse:"L"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇초",ss:"%d초",m:"일분",mm:"%d분",h:"한시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한달",MM:"%d달",y:"일년",yy:"%d년"},ordinalParse:/\d{1,2}일/,ordinal:"%d일",meridiemParse:/오전|오후/,isPM:function(e){return"오후"===e},meridiem:function(e,t,i){return e<12?"오전":"오후"}}),{m:"minūtes_minūtēm_minūte_minūtes".split("_"),mm:"minūtes_minūtēm_minūte_minūtes".split("_"),h:"stundas_stundām_stunda_stundas".split("_"),hh:"stundas_stundām_stunda_stundas".split("_"),d:"dienas_dienām_diena_dienas".split("_"),dd:"dienas_dienām_diena_dienas".split("_"),M:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),MM:"mēneša_mēnešiem_mēnesis_mēneši".split("_"),y:"gada_gadiem_gads_gadi".split("_"),yy:"gada_gadiem_gads_gadi".split("_")}),ms=(us.defineLocale("lv",{months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},calendar:{sameDay:"[Šodien pulksten] LT",nextDay:"[Rīt pulksten] LT",nextWeek:"dddd [pulksten] LT",lastDay:"[Vakar pulksten] LT",lastWeek:"[Pagājušā] dddd [pulksten] LT",sameElse:"L"},relativeTime:{future:"pēc %s",past:"pirms %s",s:on,m:sn,mm:rn,h:sn,hh:rn,d:sn,dd:rn,M:sn,MM:rn,y:sn,yy:rn},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_")),gs="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),vs=(us.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,t){return/-MMM-/.test(t)?gs[e.month()]:ms[e.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinalParse:/\d{1,2}(ste|de)/,ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}}),"styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_")),_s="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),ys=(us.defineLocale("pl",{months:function(e,t){return""===t?"("+_s[e.month()]+"|"+vs[e.month()]+")":/D MMMM/.test(t)?_s[e.month()]:vs[e.month()]},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"nie_pon_wt_śr_czw_pt_sb".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:"[W] dddd [o] LT",lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:ln,mm:ln,h:ln,hh:ln,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:ln,y:"rok",yy:ln},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),us.defineLocale("pt-br",{months:"Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdays:"Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado".split("_"),weekdaysShort:"Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),weekdaysMin:"Dom_2ª_3ª_4ª_5ª_6ª_Sáb".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},calendar:{sameDay:"[Hoje às] LT",nextDay:"[Amanhã às] LT",nextWeek:"dddd [às] LT",lastDay:"[Ontem às] LT",lastWeek:function(){return 0===this.day()||6===this.day()?"[Último] dddd [às] LT":"[Última] dddd [às] LT"},sameElse:"L"},relativeTime:{future:"em %s",past:"%s atrás",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"},ordinalParse:/\d{1,2}º/,ordinal:"%dº"}),[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i]),Ys=(us.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:ys,longMonthsParse:ys,shortMonthsParse:ys,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"},calendar:{sameDay:"[Сегодня в] LT",
nextDay:"[Завтра в] LT",lastDay:"[Вчера в] LT",nextWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В следующее] dddd [в] LT";case 1:case 2:case 4:return"[В следующий] dddd [в] LT";case 3:case 5:case 6:return"[В следующую] dddd [в] LT"}},lastWeek:function(e){if(e.week()===this.week())return 2===this.day()?"[Во] dddd [в] LT":"[В] dddd [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:un,mm:un,h:"час",hh:un,d:"день",dd:un,M:"месяц",MM:un,y:"год",yy:un},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,i){return e<4?"ночи":e<12?"утра":e<17?"дня":"вечера"},ordinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":return e+"-й";case"D":return e+"-го";case"w":case"W":return e+"-я";default:return e}},week:{dow:1,doy:7}}),"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_")),bs="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Ls=(us.defineLocale("sk",{months:Ys,monthsShort:bs,weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm"},calendar:{sameDay:"[dnes o] LT",nextDay:"[zajtra o] LT",nextWeek:function(){switch(this.day()){case 0:return"[v nedeľu o] LT";case 1:case 2:return"[v] dddd [o] LT";case 3:return"[v stredu o] LT";case 4:return"[vo štvrtok o] LT";case 5:return"[v piatok o] LT";case 6:return"[v sobotu o] LT"}},lastDay:"[včera o] LT",lastWeek:function(){switch(this.day()){case 0:return"[minulú nedeľu o] LT";case 1:case 2:return"[minulý] dddd [o] LT";case 3:return"[minulú stredu o] LT";case 4:case 5:return"[minulý] dddd [o] LT";case 6:return"[minulú sobotu o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"pred %s",s:hn,m:hn,mm:hn,h:hn,hh:hn,d:hn,dd:hn,M:hn,MM:hn,y:hn,yy:hn},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),us.defineLocale("sl",{months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD. MM. YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},calendar:{sameDay:"[danes ob] LT",nextDay:"[jutri ob] LT",nextWeek:function(){switch(this.day()){case 0:return"[v] [nedeljo] [ob] LT";case 3:return"[v] [sredo] [ob] LT";case 6:return"[v] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[v] dddd [ob] LT"}},lastDay:"[včeraj ob] LT",lastWeek:function(){switch(this.day()){case 0:return"[prejšnjo] [nedeljo] [ob] LT";case 3:return"[prejšnjo] [sredo] [ob] LT";case 6:return"[prejšnjo] [soboto] [ob] LT";case 1:case 2:case 4:case 5:return"[prejšnji] dddd [ob] LT"}},sameElse:"L"},relativeTime:{future:"čez %s",past:"pred %s",s:pn,m:pn,mm:pn,h:pn,hh:pn,d:pn,dd:pn,M:pn,MM:pn,y:pn,yy:pn},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),us.defineLocale("sv",{months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Idag] LT",nextDay:"[Imorgon] LT",lastDay:"[Igår] LT",nextWeek:"[På] dddd LT",lastWeek:"[I] dddd[s] LT",sameElse:"L"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"},ordinalParse:/\d{1,2}(e|a)/,ordinal:function(e){var t=e%10,i=1===~~(e%100/10)?"e":1===t?"a":2===t?"a":"e";return e+i},week:{dow:1,doy:4}}),us.defineLocale("th",{months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"มกรา_กุมภา_มีนา_เมษา_พฤษภา_มิถุนา_กรกฎา_สิงหา_กันยา_ตุลา_พฤศจิกา_ธันวา".split("_"),weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),longDateFormat:{LT:"H นาฬิกา m นาที",LTS:"H นาฬิกา m นาที s วินาที",L:"YYYY/MM/DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H นาฬิกา m นาที",LLLL:"วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที"},meridiemParse:/ก่อนเที่ยง|หลังเที่ยง/,isPM:function(e){return"หลังเที่ยง"===e},meridiem:function(e,t,i){return e<12?"ก่อนเที่ยง":"หลังเที่ยง"},calendar:{sameDay:"[วันนี้ เวลา] LT",nextDay:"[พรุ่งนี้ เวลา] LT",nextWeek:"dddd[หน้า เวลา] LT",lastDay:"[เมื่อวานนี้ เวลา] LT",lastWeek:"[วัน]dddd[ที่แล้ว เวลา] LT",sameElse:"L"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"}}),{1:"'inci",5:"'inci",8:"'inci",70:"'inci",80:"'inci",2:"'nci",7:"'nci",20:"'nci",50:"'nci",3:"'üncü",4:"'üncü",100:"'üncü",6:"'ncı",9:"'uncu",10:"'uncu",30:"'uncu",60:"'ıncı",90:"'ıncı"}),Ss=(us.defineLocale("tr",{months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[bugün saat] LT",nextDay:"[yarın saat] LT",nextWeek:"[haftaya] dddd [saat] LT",lastDay:"[dün] LT",lastWeek:"[geçen hafta] dddd [saat] LT",sameElse:"L"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinalParse:/\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,ordinal:function(e){if(0===e)return e+"'ıncı";var t=e%10,i=e%100-t,n=e>=100?100:null;return e+(Ls[t]||Ls[i]||Ls[n])},week:{dow:1,doy:7}}),us.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:gn,weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:vn("[Сьогодні "),nextDay:vn("[Завтра "),lastDay:vn("[Вчора "),nextWeek:vn("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return vn("[Минулої] dddd [").call(this);case 1:case 2:case 4:return vn("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:mn,mm:mn,h:"годину",hh:mn,d:"день",dd:mn,M:"місяць",MM:mn,y:"рік",yy:mn},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,i){return e<4?"ночі":e<12?"ранку":e<17?"дня":"вечора"},ordinalParse:/\d{1,2}-(й|го)/,ordinal:function(e,t){switch(t){case"M":case"d":case"DDD":case"w":case"W":return e+"-й";case"D":return e+"-го";default:return e}},week:{dow:1,doy:7}}),us.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,i){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var e,t;return e=us().startOf("week"),t=this.unix()-e.unix()>=604800?"[下]":"[本]",0===this.minutes()?t+"dddAh点整":t+"dddAh点mm"},lastWeek:function(){var e,t;return e=us().startOf("week"),t=this.unix()<e.unix()?"[上]":"[本]",0===this.minutes()?t+"dddAh点整":t+"dddAh点mm"},sameElse:"LL"},ordinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}}),us.defineLocale("zh-tw",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah點mm分",LTS:"Ah點m分s秒",L:"YYYY年MMMD日",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah點mm分",LLLL:"YYYY年MMMD日ddddAh點mm分",l:"YYYY年MMMD日",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah點mm分",llll:"YYYY年MMMD日ddddAh點mm分"},meridiemParse:/早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"早上"===t||"上午"===t?e:"中午"===t?e>=11?e:e+12:"下午"===t||"晚上"===t?e+12:void 0},meridiem:function(e,t,i){var n=100*e+t;return n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:"[今天]LT",nextDay:"[明天]LT",nextWeek:"[下]ddddLT",lastDay:"[昨天]LT",lastWeek:"[上]ddddLT",sameElse:"L"},ordinalParse:/\d{1,2}(日|月|週)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"週";default:return e}},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d分鐘",h:"一小時",hh:"%d小時",d:"一天",dd:"%d天",M:"一個月",MM:"%d個月",y:"一年",yy:"%d年"}}),us);return Ss.locale("en"),Ss}),function(e){if("function"==typeof define&&define.amd)define("js.cookie",e);else if("object"==typeof exports)module.exports=e();else{var t=window.Cookies,i=window.Cookies=e();i.noConflict=function(){return window.Cookies=t,i}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}function t(i){function n(t,r,s){var o;if(arguments.length>1){if(s=e({path:"/"},n.defaults,s),"number"==typeof s.expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*s.expires),s.expires=a}try{o=JSON.stringify(r),/^[\{\[]/.test(o)&&(r=o)}catch(e){}return r=i.write?i.write(r,t):encodeURIComponent(String(r)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)),t=t.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),t=t.replace(/[\(\)]/g,escape),document.cookie=[t,"=",r,s.expires&&"; expires="+s.expires.toUTCString(),s.path&&"; path="+s.path,s.domain&&"; domain="+s.domain,s.secure?"; secure":""].join("")}t||(o={});for(var l=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,u=0;u<l.length;u++){var d=l[u].split("="),h=d[0].replace(c,decodeURIComponent),p=d.slice(1).join("=");'"'===p.charAt(0)&&(p=p.slice(1,-1));try{if(p=i.read?i.read(p,h):i(p,h)||p.replace(c,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(e){}if(t===h){o=p;break}t||(o[h]=p)}catch(e){}}return o}return n.get=n.set=n,n.getJSON=function(){return n.apply({json:!0},[].slice.call(arguments))},n.defaults={},n.remove=function(t,i){n(t,"",e(i,{expires:-1}))},n.withConverter=t,n}return t(function(){})}),require.config({shim:{underscore:{exports:"_"},backbone:{deps:["underscore","jquery"],exports:"Backbone"},"backbone.paginator":{deps:["backbone"],exports:"BackbonePaginator"}},paths:{jquery:"lib/jquery","jquery.ui.core":"lib/jquery.ui.core","jquery.ui.widget":"lib/jquery.ui.widget.1.11.1","jquery.ui.progressbar":"lib/jquery.ui.progressbar","jquery.ui.tabs":"lib/jquery.ui.tabs",tmpl:"lib/tmpl.min","jquery.iframe-transport":"lib/jquery.iframe-transport","jquery.fileupload":"lib/jquery.fileupload","jquery.fileupload-process":"lib/jquery.fileupload-process","jquery.fileupload-validate":"lib/jquery.fileupload-validate","jquery.fileupload-ui":"lib/jquery.fileupload-ui","jquery.magnific-popup":"lib/jquery.magnific-popup","js.cookie":"lib/js.cookie",simplemodal:"lib/jquery.simplemodal",jstree:"lib/jstree.min",select2:"lib/select2-3.5.2",moment:"lib/moment-with-locales",marked:"lib/marked.min",underscore:"lib/underscore",backbone:"lib/backbone","backbone.paginator":"lib/backbone.paginator",text:"lib/text"}}),define("common",["jquery","underscore","text","pinyin-by-unicode","moment","js.cookie"],function(e,t,i,n,r,s){return{INFO_TIMEOUT:1e4,SUCCESS_TIMEOUT:3e3,ERROR_TIMEOUT:3e3,strChineseFirstPY:n.strChineseFirstPY,getUrl:function(e){var t=app.config.siteRoot,i=app.config.fileServerRoot;switch(e.name){case"list_lib_dir":return t+"ajax/lib/"+e.repo_id+"/dir/";case"del_dir":return t+"api/v2.1/repos/"+e.repo_id+"/dir/";case"del_file":return t+"api/v2.1/repos/"+e.repo_id+"/file/";case"download_dir_zip_url":return i+"zip/"+e.zip_token;case"zip_task":return t+"api/v2.1/repos/"+e.repo_id+"/zip-task/";case"query_zip_progress":return t+"api/v2.1/query-zip-progress/";case"copy_move_task":return t+"api/v2.1/copy-move-task/";case"query_copy_move_progress":return t+"api/v2.1/query-copy-move-progress/";case"rename_dir":return t+"api/v2.1/repos/"+e.repo_id+"/dir/";case"rename_file":return t+"api/v2.1/repos/"+e.repo_id+"/file/";case"lock_or_unlock_file":return t+"api/v2.1/repos/"+e.repo_id+"/file/";case"new_dir":return t+"api/v2.1/repos/"+e.repo_id+"/dir/";case"new_file":return t+"api/v2.1/repos/"+e.repo_id+"/file/";case"del_dirents":return t+"ajax/repo/"+e.repo_id+"/dirents/delete/";case"mv_dirents":return t+"ajax/repo/"+e.repo_id+"/dirents/move/";case"cp_dirents":return t+"ajax/repo/"+e.repo_id+"/dirents/copy/";case"get_dirents":return t+"ajax/repo/"+e.repo_id+"/dirents/";case"dir-details":return t+"api/v2.1/repos/"+e.repo_id+"/dir/detail/";case"tags":return t+"api/v2.1/repos/"+e.repo_id+"/tags/";case"file-comments":return t+"api2/repos/"+e.repo_id+"/file/comments/";case"repos":return t+"api2/repos/";case"deleted_repos":return t+"api/v2.1/deleted-repos/";case"pub_repos":return t+"api2/repos/public/";case"unenc_rw_repos":return t+"ajax/unenc-rw-repos/";case"api_v2.1_repo_set_password":return t+"api/v2.1/repos/"+e.repo_id+"/set-password/";case"get_history_changes":return t+"ajax/repo/"+e.repo_id+"/history/changes/";case"beshared_repo":return t+"api2/beshared-repos/"+e.repo_id+"/";case"dir_shared_items":return t+"api2/repos/"+e.repo_id+"/dir/shared_items/";case"shared_repos":return t+"api2/shared-repos/"+e.repo_id+"/";case"repo":return t+"api2/repos/"+e.repo_id+"/";case"repo_v2.1":return t+"api/v2.1/repos/"+e.repo_id+"/";case"repo_owner":return t+"api2/repos/"+e.repo_id+"/owner/";case"repo_history_limit":return t+"api2/repos/"+e.repo_id+"/history-limit/";case"repo_shared_download_links":return t+"api2/repos/"+e.repo_id+"/download-shared-links/";case"repo_shared_download_link":return t+"api2/repos/"+e.repo_id+"/download-shared-links/"+e.token+"/";case"repo_shared_upload_links":return t+"api2/repos/"+e.repo_id+"/upload-shared-links/";case"repo_shared_upload_link":return t+"api2/repos/"+e.repo_id+"/upload-shared-links/"+e.token+"/";case"repo_user_folder_perm":return t+"api2/repos/"+e.repo_id+"/user-folder-perm/";case"repo_group_folder_perm":return t+"api2/repos/"+e.repo_id+"/group-folder-perm/";case"repo_upload_link":return t+"api2/repos/"+e.repo_id+"/upload-link/";case"repo_update_link":return t+"api2/repos/"+e.repo_id+"/update-link/";case"repo_file_uploaded_bytes":return t+"api/v2.1/repos/"+e.repo_id+"/file-uploaded-bytes/";case"repo_labels":return t+"api/v2.1/revision-tags/tagged-items/";case"user_repo_labels":return t+"api/v2.1/revision-tags/tag-names/";case"share_admin_repos":return t+"api/v2.1/shared-repos/";case"share_admin_repo":return t+"api/v2.1/shared-repos/"+e.repo_id+"/";case"share_admin_folders":return t+"api/v2.1/shared-folders/";case"share_admin_share_links":return t+"api/v2.1/share-links/";case"share_admin_share_link":return t+"api/v2.1/share-links/"+e.token+"/";case"share_admin_upload_links":return t+"api/v2.1/upload-links/";case"share_admin_upload_link":return t+"api/v2.1/upload-links/"+e.token+"/";case"send_shared_download_link":return t+"share/link/send/";case"send_shared_upload_link":return t+"share/upload_link/send/";case"groups":return t+"api/v2.1/groups/";case"shareable_groups":return t+"api/v2.1/shareable-groups/";case"search_group":return t+"api/v2.1/search-group/";case"group":return t+"api/v2.1/groups/"+e.group_id+"/";case"group_members":return t+"api/v2.1/groups/"+e.group_id+"/members/";case"group_member":return t+"api/v2.1/groups/"+e.group_id+"/members/"+e.email+"/";case"group_member_bulk":return t+"api/v2.1/groups/"+e.group_id+"/members/bulk/";case"group_import_members":return t+"ajax/group/"+e.group_id+"/members/import/";case"group_repos":return t+"api2/groups/"+e.group_id+"/repos/";case"group_discussions":return t+"api2/groups/"+e.group_id+"/discussions/";case"group_discussion":return t+"api2/groups/"+e.group_id+"/discussions/"+e.discussion_id+"/";case"thumbnail_create":return t+"thumbnail/"+e.repo_id+"/create/";case"thumbnail_get":return t+"thumbnail/"+e.repo_id+"/"+e.size+e.path;case"view_raw_file":return t+"repo/"+e.repo_id+"/raw"+e.path;case"get_popup_notices":return t+"ajax/get_popup_notices/";case"notifications":return t+"api/v2.1/notifications/";case"notification":return t+"api/v2.1/notification/";case"user_enabled_modules":return t+"api/v2.1/user-enabled-modules/";case"starred_files":return t+"api2/starredfiles/";case"events":return t+"api2/events/";case"devices":return t+"api2/devices/";case"invitations":return t+"api/v2.1/invitations/";case"invitations_batch":return t+"api/v2.1/invitations/batch/";case"invitation":return t+"api/v2.1/invitations/"+e.token+"/";case"search_user":return t+"api2/search-user/";case"user_profile":return t+"profile/"+e.username+"/";case"space_and_traffic":return t+"ajax/space_and_traffic/";case"sysinfo":return t+"api/v2.1/admin/sysinfo/";case"admin-devices":return t+"api/v2.1/admin/devices/";case"admin-device-errors":return t+"api/v2.1/admin/device-errors/";case"admin-device-trusted-ip":return t+"api/v2.1/admin/device-trusted-ip/";case"admin-libraries":return t+"api/v2.1/admin/libraries/";case"admin-library":return t+"api/v2.1/admin/libraries/"+e.repo_id+"/";case"admin-library-history-limit":return t+"api/v2.1/admin/libraries/"+e.repo_id+"/history-limit/";case"admin-library-dirents":return t+"api/v2.1/admin/libraries/"+e.repo_id+"/dirents/";case"admin-groups":return t+"api/v2.1/admin/groups/";case"admin-group":return t+"api/v2.1/admin/groups/"+e.group_id+"/";case"admin-group-libraries":return t+"api/v2.1/admin/groups/"+e.group_id+"/libraries/";case"admin-group-library":return t+"api/v2.1/admin/groups/"+e.group_id+"/libraries/"+e.repo_id+"/";case"admin-group-members":return t+"api/v2.1/admin/groups/"+e.group_id+"/members/";case"admin-group-member":return t+"api/v2.1/admin/groups/"+e.group_id+"/members/"+e.email+"/";case"admin-system-library":return t+"api/v2.1/admin/system-library/";case"admin-system-library-upload-link":return t+"api/v2.1/admin/system-library/upload-link/";case"admin-trash-libraries":return t+"api/v2.1/admin/trash-libraries/";case"admin-trash-library":return t+"api/v2.1/admin/trash-libraries/"+e.repo_id+"/";case"admin_shares":return t+"api/v2.1/admin/shares/";case"sys_group_admin_export_excel":return t+"sys/groupadmin/export-excel/";case"admin-operation-logs":return t+"api/v2.1/admin/admin-logs/";case"admin-login-logs":return t+"api/v2.1/admin/admin-login-logs/";case"license":return t+"api/v2.1/admin/license/"}},FILEEXT_ICON_MAP:{md:"txt.png",txt:"txt.png",pdf:"pdf.png",doc:"word.png",docx:"word.png",odt:"word.png",fodt:"word.png",ppt:"ppt.png",pptx:"ppt.png",odp:"ppt.png",fodp:"ppt.png",xls:"excel.png",xlsx:"excel.png",ods:"excel.png",fods:"excel.png",mp4:"video.png",ogv:"video.png",webm:"video.png",mov:"video.png",flv:"video.png",wmv:"video.png",rmvb:"video.png",mp3:"music.png",oga:"music.png",ogg:"music.png",flac:"music.png",aac:"music.png",ac3:"music.png",wma:"music.png",jpg:"pic.png",jpeg:"pic.png",png:"pic.png",svg:"pic.png",gif:"pic.png",bmp:"pic.png",ico:"pic.png",default:"file.png"},getFileIconUrl:function(e,i){i=i>24?192:24;var n;return e.lastIndexOf(".")==-1?app.config.mediaUrl+"img/file/"+i+"/"+this.FILEEXT_ICON_MAP.default:(n=e.substr(e.lastIndexOf(".")+1).toLowerCase(),t.has(this.FILEEXT_ICON_MAP,n)?app.config.mediaUrl+"img/file/"+i+"/"+this.FILEEXT_ICON_MAP[n]:app.config.mediaUrl+"img/file/"+i+"/"+this.FILEEXT_ICON_MAP.default)},getDirIconUrl:function(e,t){return t>24?e?app.config.mediaUrl+"img/folder-read-only-192.png":app.config.mediaUrl+"img/folder-192.png":e?app.config.mediaUrl+"img/folder-read-only-24.png":app.config.mediaUrl+"img/folder-24.png"},getLibIconUrl:function(e,t,i){var n="lib.png";e&&(n="lib-encrypted.png"),t&&(n="lib-readonly.png");var r=i||256;return app.config.mediaUrl+"img/lib/"+r+"/"+n},getLibIconTitle:function(e,t){return e?gettext("Encrypted library"):t?gettext("Read-Only library"):gettext("Read-Write library")},isHiDPI:function(){var e=window.devicePixelRatio?window.devicePixelRatio:1;return e>1},showConfirm:function(t,i,n){var r=e("#confirm-popup"),s=e("#confirm-con"),o=e("#confirm-yes");s.html("<h3>"+t+"</h3><p>"+i+"</p>"),r.modal({appendTo:"#main"}),e("#simplemodal-container").css({height:"auto"}),o.click(n)},confirm_with_extra_option_template:t.template(e("#confirm-dialog-with-extra-option-tmpl").html()),showConfirmWithExtraOption:function(t,i,n,r){var s=e("#confirm-popup"),o=e("#confirm-con"),a=e("#confirm-yes"),l=this.confirm_with_extra_option_template({is_pro:app.pageOptions.is_pro,title:t,content:i,extraOption:n});o.html(l),s.modal({appendTo:"#main"}),e("#simplemodal-container").css({height:"auto"}),a.click(function(){var t="on"===e("#confirm-extra-option:checked").val();r(t)})},closeModal:function(){e.modal.close()},feedback:function(t,i,n){var r,s,o,a=this,n=n||5e3,l="15px",c="";"string"==typeof t?o=e('<li class="'+i+'">'+this.HTMLescape(t)+"</li>"):(e(t).each(function(e,t){c+='<li class="'+t.type+'">'+a.HTMLescape(t.msg)+"</li>"}),o=e(c)),e(".messages").length>0?r=e(".messages").html(o):(r=e('<ul class="messages"></ul>').html(o),e("#main").append(r)),s="-"+(r.outerHeight()+parseInt(l))+"px",r.css({left:(e(window).width()-r.width())/2,top:s}),setTimeout(function(){r.css({top:l})},10),setTimeout(function(){r.css({top:s})},n)},showFormError:function(t,i){e("#"+t+" .error").html(i).removeClass("hide"),e("#simplemodal-container").css({height:"auto"})},ajaxErrorHandler:function(t,i,n){if(t.responseText){var r=e.parseJSON(t.responseText);this.feedback(r.error||r.error_msg||r.detail,"error")}else this.feedback(gettext("Failed. Please check the network."),"error")},enableButton:function(e){e.removeAttr("disabled").removeClass("btn-disabled")},disableButton:function(e){e.attr("disabled","disabled").addClass("btn-disabled")},setCaretPos:function(e,t){var i;return document.selection?(i=e.createTextRange(),i.move("character",t),i.select()):e.setSelectionRange(t,t)},prepareApiCsrf:function(){Backbone._sync=Backbone.sync,Backbone.sync=function(e,t,i){if("create"==e||"update"==e||"delete"==e){var n=app.pageOptions.csrfToken;i.beforeSend=function(e){e.setRequestHeader("X-CSRFToken",n)}}return Backbone._sync(e,t,i)}},prepareCSRFToken:function(e,t){function i(e){var t=null;if(document.cookie&&""!=document.cookie)for(var i=document.cookie.split(";"),n=0;n<i.length;n++){var r=jQuery.trim(i[n]);if(r.substring(0,e.length+1)==e+"="){t=decodeURIComponent(r.substring(e.length+1));break}}return t}/^http:.*/.test(t.url)||/^https:.*/.test(t.url)||e.setRequestHeader("X-CSRFToken",i("csrftoken"))},ajaxPost:function(t){var i,n=this,r=t.form,s=t.form_id,o=t.post_url,a=t.post_data,l=t.after_op_success,c=r.children('[type="submit"]');this.disableButton(c),i=t.after_op_error?t.after_op_error:function(t,i,r){var o;o=t.responseText?e.parseJSON(t.responseText).error||e.parseJSON(t.responseText).error_msg:gettext("Failed. Please check the network."),n.showFormError(s,o),n.enableButton(c)},e.ajax({url:o,type:"POST",dataType:"json",beforeSend:this.prepareCSRFToken,data:a,success:l,error:i})},ajaxGet:function(t){var i,n=t.get_url,r=t.data,s=t.after_op_success;i=t.after_op_error?t.after_op_error:function(e,t,i){},e.ajax({url:n,cache:!1,dataType:"json",data:r,success:s,error:i})},HTMLescape:function(e){return document.createElement("div").appendChild(document.createTextNode(e)).parentNode.innerHTML},pathJoin:function(e){for(var t=e[0],i=1;i<e.length;i++)t+="/"==t[t.length-1]||"/"==e[i][0]?e[i]:"/"+e[i];return t},encodePath:function(e){for(var t=e.split("/"),i=[],n=0,r=t.length;n<r;n++)i.push(encodeURIComponent(t[n]));return i.join("/")},initLocale:function(){var e;e="en"==app.pageOptions.language_code?"en-gb":"es-ar"==app.pageOptions.language_code||"es-mx"==app.pageOptions.language_code?"es":app.pageOptions.language_code,r.locale(e)},getRelativeTimeStr:function(e){var t=new Date;return e-t>0?gettext("Just now"):e.fromNow()},closeTopNoticeBar:function(){if(!app.pageOptions.cur_note)return!1;var t=app.pageOptions.cur_note.id;if(e("#info-bar").addClass("hide"),navigator.cookieEnabled){var i=new Date,n=document.cookie.split("; "),r=!1;i.setTime(i.getTime()+12096e5),t+="; expires="+i.toGMTString()+"; path="+app.config.siteRoot;for(var s=0,o=n.length;s<o;s++)if("info_id"==n[s].split("=")[0]){r=!0,document.cookie="info_id="+n[s].split("=")[1]+t;break}r||(document.cookie="info_id="+t)}},contactInputOptionsForSelect2:function(){var t=this;return{placeholder:gettext("Search users or enter emails and press Enter"),tags:[],minimumInputLength:1,formatInputTooShort:gettext("Please enter 1 or more character"),formatNoMatches:gettext("No matches"),formatSearching:gettext("Searching..."),formatAjaxError:gettext("Loading failed"),ajax:{url:t.getUrl({name:"search_user"}),dataType:"json",delay:250,cache:!0,data:function(e){return{q:e}},results:function(e){for(var t=[],i=e.users,n=0,r=i.length;n<r;n++)t.push({id:i[n].email,text:i[n].name+" "+i[n].contact_email,avatar_url:i[n].avatar_url,contact_email:i[n].contact_email,name:i[n].name});return{results:t}}},formatResult:function(e){return e.avatar_url?'<img src="'+e.avatar_url+'" width="32" height="32" class="avatar"><span class="text ellipsis">'+t.HTMLescape(e.name)+"<br />"+t.HTMLescape(e.contact_email)+"</span>":void 0},formatSelection:function(e){return t.HTMLescape(e.name||e.id)},createSearchChoice:function(t){return{id:e.trim(t)}},escapeMarkup:function(e){return e}}},groupInputOptionsForSelect2:function(){var e=this;return{placeholder:gettext("Search groups"),tags:[],minimumInputLength:1,formatInputTooShort:gettext("Please enter 1 or more character"),formatNoMatches:gettext("No matches"),formatSearching:gettext("Searching..."),formatAjaxError:gettext("Loading failed"),ajax:{url:e.getUrl({name:"search_group"}),dataType:"json",delay:250,cache:!0,data:function(e){return{q:e}},results:function(e){for(var t=[],i=e,n=0,r=i.length;n<r;n++)t.push({id:i[n].id,text:i[n].name,name:i[n].name});return{results:t}}},formatResult:function(t){return t.name?'<span class="text ellipsis">'+e.HTMLescape(t.name)+"</span>":void 0},formatSelection:function(t){return e.HTMLescape(t.name)},escapeMarkup:function(e){return e}}},imageCheck:function(e){if(e.lastIndexOf(".")==-1)return!1;var t=e.substr(e.lastIndexOf(".")+1).toLowerCase(),i=["gif","jpeg","jpg","png","ico","bmp"];return i.indexOf(t)!=-1},videoCheck:function(e){if(e.lastIndexOf(".")==-1)return!1;var t=e.substr(e.lastIndexOf(".")+1).toLowerCase(),i=["mp4","ogv","webm","mov"];return i.indexOf(t)!=-1},compareTwoWord:function(e,t){var i,n,r=e.charCodeAt(0),s=t.charCodeAt(0),o=this.strChineseFirstPY;return 19968<r&&r<40869&&19968<s&&s<40869?(i=o.charAt(r-19968).toLowerCase(),n=o.charAt(s-19968).toLowerCase(),i>=n?1:-1):19968<r&&r<40869&&!(19968<s&&s<40869)?1:!(19968<r&&r<40869)&&19968<s&&s<40869?-1:(i=e.toLowerCase(),n=t.toLowerCase(),this.compareStrWithNumbersIn(i,n))},compareStrWithNumbersIn:function(e,t){var i,n,r,s=/\d+|\D+/g,o=/\d/,a=e.match(s),l=t.match(s),c=Math.min(a.length,l.length);if(a&&l&&(i=o.test(a[0]))==o.test(l[0]))for(var u=0;u<c;u++){if(n=a[u],r=l[u],i&&(n=parseInt(n,10),r=parseInt(r,10)),n!=r)return n<r?-1:1;i=!i}return(e>=t)-(e<=t)},toggleSortByNameMode:function(){"name_up"==app.pageOptions.sort_mode?(s.set("sort_mode","name_down"),app.pageOptions.sort_mode="name_down"):(s.set("sort_mode","name_up"),app.pageOptions.sort_mode="name_up")},toggleSortByTimeMode:function(){"time_down"==app.pageOptions.sort_mode?(s.set("sort_mode","time_up"),app.pageOptions.sort_mode="time_up"):(s.set("sort_mode","time_down"),app.pageOptions.sort_mode="time_down")},updateSortIconByMode:function(t){var i=app.pageOptions.sort_mode,n=t.context,r=e(".by-name .sort-icon",n),s=e(".by-time .sort-icon",n);switch(r.hide(),s.hide(),i){case"name_down":r.removeClass("icon-caret-up").addClass("icon-caret-down").show();break;case"name_up":r.removeClass("icon-caret-down").addClass("icon-caret-up").show();break;case"time_down":s.removeClass("icon-caret-up").addClass("icon-caret-down").show();break;case"time_up":s.removeClass("icon-caret-down").addClass("icon-caret-up").show();break;default:r.removeClass("icon-caret-down").addClass("icon-caret-up").show()}},sortLibs:function(e){var t=this,i=app.pageOptions.sort_mode,n=e.libs;switch(i){case"name_up":n.comparator=function(e,i){if(!e.get("name"))return 1;if(!i.get("name"))return-1;var n=t.compareTwoWord(e.get("name"),i.get("name"));return n};break;case"name_down":n.comparator=function(e,i){if(!e.get("name"))return-1;if(!i.get("name"))return 1;var n=t.compareTwoWord(e.get("name"),i.get("name"));return-n};break;case"time_up":n.comparator=function(e,t){return e.get("mtime")<t.get("mtime")?-1:1};break;case"time_down":n.comparator=function(e,t){return e.get("mtime")<t.get("mtime")?1:-1}}n.sort()},fileSizeFormat:function(e,t){var i=1024,n=1024*i,r=1024*n,s=1024*r,t=t||0;return e>=0&&e<i?e+" B":e>=i&&e<n?(e/i).toFixed(t)+" KB":e>=n&&e<r?(e/n).toFixed(t)+" MB":e>=r&&e<s?(e/r).toFixed(t)+" GB":e>=s?(e/s).toFixed(t)+" TB":e+" B"},quotaSizeFormat:function(e,t){var i=1e3,n=1e3*i,r=1e3*n,s=1e3*r,t=t||0;return e>=0&&e<i?e+" B":e>=i&&e<n?(e/i).toFixed(t)+" KB":e>=n&&e<r?(e/n).toFixed(t)+" MB":e>=r&&e<s?(e/r).toFixed(t)+" GB":e>=s?(e/s).toFixed(t)+" TB":e+" B"},groupId2Name:function(e){for(var t,i=app.pageOptions.groups,n=0,r=i.length;n<r;n++)if(e==i[n].id){t=i[n].name;break}return t},setCaretPosition:function(e,t){var i;return document.selection?(i=e.createTextRange(),i.move("character",t),i.select()):e.setSelectionRange(t,t)},zipDownload:function(t,i,n){var r,s,o=this,a=gettext("Packaging..."),l=e("<p></p>"),c=function(){
e.ajax({url:o.getUrl({name:"query_zip_progress"})+"?token="+s,dataType:"json",cache:!1,success:function(t){var i=0==t.total?"100%":(t.zipped/t.total*100).toFixed(0)+"%";l.html(a+" "+i),t.total==t.zipped&&(setTimeout(function(){e.modal.close()},500),clearInterval(r),location.href=o.getUrl({name:"download_dir_zip_url",zip_token:s}))},error:function(e){o.ajaxErrorHandler(e),clearInterval(r)}})};e.ajax({url:o.getUrl({name:"zip_task",repo_id:t}),data:{parent_dir:i,dirents:n},traditional:!0,dataType:"json",success:function(t){s=t.zip_token,l.html(a).modal(),e("#simplemodal-container").css({width:"auto"}),c(),r=setInterval(c,1e3)},error:function(e){o.ajaxErrorHandler(e)}})}}}),function(e,t){if("function"==typeof define&&define.amd)define("backbone",["underscore","jquery","exports"],function(i,n,r){e.Backbone=t(e,r,i,n)});else if("undefined"!=typeof exports){var i=require("underscore");t(e,exports,i)}else e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t,i,n){var r=e.Backbone,s=[],o=(s.push,s.slice);s.splice;t.VERSION="1.1.2",t.$=n,t.noConflict=function(){return e.Backbone=r,this},t.emulateHTTP=!1,t.emulateJSON=!1;var a=t.Events={on:function(e,t,i){if(!c(this,"on",e,[t,i])||!t)return this;this._events||(this._events={});var n=this._events[e]||(this._events[e]=[]);return n.push({callback:t,context:i,ctx:i||this}),this},once:function(e,t,n){if(!c(this,"once",e,[t,n])||!t)return this;var r=this,s=i.once(function(){r.off(e,s),t.apply(this,arguments)});return s._callback=t,this.on(e,s,n)},off:function(e,t,n){var r,s,o,a,l,u,d,h;if(!this._events||!c(this,"off",e,[t,n]))return this;if(!e&&!t&&!n)return this._events=void 0,this;for(a=e?[e]:i.keys(this._events),l=0,u=a.length;l<u;l++)if(e=a[l],o=this._events[e]){if(this._events[e]=r=[],t||n)for(d=0,h=o.length;d<h;d++)s=o[d],(t&&t!==s.callback&&t!==s.callback._callback||n&&n!==s.context)&&r.push(s);r.length||delete this._events[e]}return this},trigger:function(e){if(!this._events)return this;var t=o.call(arguments,1);if(!c(this,"trigger",e,t))return this;var i=this._events[e],n=this._events.all;return i&&u(i,t),n&&u(n,arguments),this},stopListening:function(e,t,n){var r=this._listeningTo;if(!r)return this;var s=!t&&!n;n||"object"!=typeof t||(n=this),e&&((r={})[e._listenId]=e);for(var o in r)e=r[o],e.off(t,n,this),(s||i.isEmpty(e._events))&&delete this._listeningTo[o];return this}},l=/\s+/,c=function(e,t,i,n){if(!i)return!0;if("object"==typeof i){for(var r in i)e[t].apply(e,[r,i[r]].concat(n));return!1}if(l.test(i)){for(var s=i.split(l),o=0,a=s.length;o<a;o++)e[t].apply(e,[s[o]].concat(n));return!1}return!0},u=function(e,t){var i,n=-1,r=e.length,s=t[0],o=t[1],a=t[2];switch(t.length){case 0:for(;++n<r;)(i=e[n]).callback.call(i.ctx);return;case 1:for(;++n<r;)(i=e[n]).callback.call(i.ctx,s);return;case 2:for(;++n<r;)(i=e[n]).callback.call(i.ctx,s,o);return;case 3:for(;++n<r;)(i=e[n]).callback.call(i.ctx,s,o,a);return;default:for(;++n<r;)(i=e[n]).callback.apply(i.ctx,t);return}},d={listenTo:"on",listenToOnce:"once"};i.each(d,function(e,t){a[t]=function(t,n,r){var s=this._listeningTo||(this._listeningTo={}),o=t._listenId||(t._listenId=i.uniqueId("l"));return s[o]=t,r||"object"!=typeof n||(r=this),t[e](n,r,this),this}}),a.bind=a.on,a.unbind=a.off,i.extend(t,a);var h=t.Model=function(e,t){var n=e||{};t||(t={}),this.cid=i.uniqueId("c"),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(n=this.parse(n,t)||{}),n=i.defaults({},n,i.result(this,"defaults")),this.set(n,t),this.changed={},this.initialize.apply(this,arguments)};i.extend(h.prototype,a,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return i.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return i.escape(this.get(e))},has:function(e){return null!=this.get(e)},set:function(e,t,n){var r,s,o,a,l,c,u,d;if(null==e)return this;if("object"==typeof e?(s=e,n=t):(s={})[e]=t,n||(n={}),!this._validate(s,n))return!1;o=n.unset,l=n.silent,a=[],c=this._changing,this._changing=!0,c||(this._previousAttributes=i.clone(this.attributes),this.changed={}),d=this.attributes,u=this._previousAttributes,this.idAttribute in s&&(this.id=s[this.idAttribute]);for(r in s)t=s[r],i.isEqual(d[r],t)||a.push(r),i.isEqual(u[r],t)?delete this.changed[r]:this.changed[r]=t,o?delete d[r]:d[r]=t;if(!l){a.length&&(this._pending=n);for(var h=0,p=a.length;h<p;h++)this.trigger("change:"+a[h],this,d[a[h]],n)}if(c)return this;if(!l)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,i.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var n in this.attributes)t[n]=void 0;return this.set(t,i.extend({},e,{unset:!0}))},hasChanged:function(e){return null==e?!i.isEmpty(this.changed):i.has(this.changed,e)},changedAttributes:function(e){if(!e)return!!this.hasChanged()&&i.clone(this.changed);var t,n=!1,r=this._changing?this._previousAttributes:this.attributes;for(var s in e)i.isEqual(r[s],t=e[s])||((n||(n={}))[s]=t);return n},previous:function(e){return null!=e&&this._previousAttributes?this._previousAttributes[e]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(e){e=e?i.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=this,n=e.success;return e.success=function(i){return!!t.set(t.parse(i,e),e)&&(n&&n(t,i,e),void t.trigger("sync",t,i,e))},Q(this,e),this.sync("read",this,e)},save:function(e,t,n){var r,s,o,a=this.attributes;if(null==e||"object"==typeof e?(r=e,n=t):(r={})[e]=t,n=i.extend({validate:!0},n),r&&!n.wait){if(!this.set(r,n))return!1}else if(!this._validate(r,n))return!1;r&&n.wait&&(this.attributes=i.extend({},a,r)),void 0===n.parse&&(n.parse=!0);var l=this,c=n.success;return n.success=function(e){l.attributes=a;var t=l.parse(e,n);return n.wait&&(t=i.extend(r||{},t)),!(i.isObject(t)&&!l.set(t,n))&&(c&&c(l,e,n),void l.trigger("sync",l,e,n))},Q(this,n),s=this.isNew()?"create":n.patch?"patch":"update","patch"===s&&(n.attrs=r),o=this.sync(s,this,n),r&&n.wait&&(this.attributes=a),o},destroy:function(e){e=e?i.clone(e):{};var t=this,n=e.success,r=function(){t.trigger("destroy",t,t.collection,e)};if(e.success=function(i){(e.wait||t.isNew())&&r(),n&&n(t,i,e),t.isNew()||t.trigger("sync",t,i,e)},this.isNew())return e.success(),!1;Q(this,e);var s=this.sync("delete",this,e);return e.wait||r(),s},url:function(){var e=i.result(this,"urlRoot")||i.result(this.collection,"url")||F();return this.isNew()?e:e.replace(/([^\/])$/,"$1/")+encodeURIComponent(this.id)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(e){return this._validate({},i.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=i.extend({},this.attributes,e);var n=this.validationError=this.validate(e,t)||null;return!n||(this.trigger("invalid",this,n,i.extend(t,{validationError:n})),!1)}});var p=["keys","values","pairs","invert","pick","omit"];i.each(p,function(e){h.prototype[e]=function(){var t=o.call(arguments);return t.unshift(this.attributes),i[e].apply(i,t)}});var f=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),void 0!==t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,i.extend({silent:!0},t))},m={add:!0,remove:!0,merge:!0},g={add:!0,remove:!1};i.extend(f.prototype,a,{model:h,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return t.sync.apply(this,arguments)},add:function(e,t){return this.set(e,i.extend({merge:!1},t,g))},remove:function(e,t){var n=!i.isArray(e);e=n?[e]:i.clone(e),t||(t={});var r,s,o,a;for(r=0,s=e.length;r<s;r++)a=e[r]=this.get(e[r]),a&&(delete this._byId[a.id],delete this._byId[a.cid],o=this.indexOf(a),this.models.splice(o,1),this.length--,t.silent||(t.index=o,a.trigger("remove",a,this,t)),this._removeReference(a,t));return n?e[0]:e},set:function(e,t){t=i.defaults({},t,m),t.parse&&(e=this.parse(e,t));var n=!i.isArray(e);e=n?e?[e]:[]:i.clone(e);var r,s,o,a,l,c,u,d=t.at,p=this.model,f=this.comparator&&null==d&&t.sort!==!1,g=i.isString(this.comparator)?this.comparator:null,v=[],_=[],y={},Y=t.add,b=t.merge,L=t.remove,S=!(f||!Y||!L)&&[];for(r=0,s=e.length;r<s;r++){if(l=e[r]||{},o=l instanceof h?a=l:l[p.prototype.idAttribute||"id"],c=this.get(o))L&&(y[c.cid]=!0),b&&(l=l===a?a.attributes:l,t.parse&&(l=c.parse(l,t)),c.set(l,t),f&&!u&&c.hasChanged(g)&&(u=!0)),e[r]=c;else if(Y){if(a=e[r]=this._prepareModel(l,t),!a)continue;v.push(a),this._addReference(a,t)}a=c||a,!S||!a.isNew()&&y[a.id]||S.push(a),y[a.id]=!0}if(L){for(r=0,s=this.length;r<s;++r)y[(a=this.models[r]).cid]||_.push(a);_.length&&this.remove(_,t)}if(v.length||S&&S.length)if(f&&(u=!0),this.length+=v.length,null!=d)for(r=0,s=v.length;r<s;r++)this.models.splice(d+r,0,v[r]);else{S&&(this.models.length=0);var T=S||v;for(r=0,s=T.length;r<s;r++)this.models.push(T[r])}if(u&&this.sort({silent:!0}),!t.silent){for(r=0,s=v.length;r<s;r++)(a=v[r]).trigger("add",a,this,t);(u||S&&S.length)&&this.trigger("sort",this,t)}return n?e[0]:e},reset:function(e,t){t||(t={});for(var n=0,r=this.models.length;n<r;n++)this._removeReference(this.models[n],t);return t.previousModels=this.models,this._reset(),e=this.add(e,i.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,i.extend({at:this.length},t))},pop:function(e){var t=this.at(this.length-1);return this.remove(t,e),t},unshift:function(e,t){return this.add(e,i.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return o.apply(this.models,arguments)},get:function(e){if(null!=e)return this._byId[e]||this._byId[e.id]||this._byId[e.cid]},at:function(e){return this.models[e]},where:function(e,t){return i.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var i in e)if(e[i]!==t.get(i))return!1;return!0})},findWhere:function(e){return this.where(e,!0)},sort:function(e){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return e||(e={}),i.isString(this.comparator)||1===this.comparator.length?this.models=this.sortBy(this.comparator,this):this.models.sort(i.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return i.invoke(this.models,"get",e)},fetch:function(e){e=e?i.clone(e):{},void 0===e.parse&&(e.parse=!0);var t=e.success,n=this;return e.success=function(i){var r=e.reset?"reset":"set";n[r](i,e),t&&t(n,i,e),n.trigger("sync",n,i,e)},Q(this,e),this.sync("read",this,e)},create:function(e,t){if(t=t?i.clone(t):{},!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var n=this,r=t.success;return t.success=function(e,i){t.wait&&n.add(e,t),r&&r(e,i,t)},e.save(null,t),e},parse:function(e,t){return e},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(e,t){if(e instanceof h)return e;t=t?i.clone(t):{},t.collection=this;var n=new this.model(e,t);return n.validationError?(this.trigger("invalid",this,n.validationError,t),!1):n},_addReference:function(e,t){this._byId[e.cid]=e,null!=e.id&&(this._byId[e.id]=e),e.collection||(e.collection=this),e.on("all",this._onModelEvent,this)},_removeReference:function(e,t){this===e.collection&&delete e.collection,e.off("all",this._onModelEvent,this)},_onModelEvent:function(e,t,i,n){("add"!==e&&"remove"!==e||i===this)&&("destroy"===e&&this.remove(t,n),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],null!=t.id&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments))}});var v=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample"];i.each(v,function(e){f.prototype[e]=function(){var t=o.call(arguments);return t.unshift(this.models),i[e].apply(i,t)}});var _=["groupBy","countBy","sortBy","indexBy"];i.each(_,function(e){f.prototype[e]=function(t,n){var r=i.isFunction(t)?t:function(e){return e.get(t)};return i[e](this.models,r,n)}});var y=t.View=function(e){this.cid=i.uniqueId("view"),e||(e={}),i.extend(this,i.pick(e,b)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},Y=/^(\S+)\s*(.*)$/,b=["model","collection","el","id","attributes","className","tagName","events"];i.extend(y.prototype,a,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this.stopListening(),this},setElement:function(e,i){return this.$el&&this.undelegateEvents(),this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0],i!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=i.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var n=e[t];if(i.isFunction(n)||(n=this[e[t]]),n){var r=t.match(Y),s=r[1],o=r[2];n=i.bind(n,this),s+=".delegateEvents"+this.cid,""===o?this.$el.on(s,n):this.$el.on(s,o,n)}}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"),!1);else{var e=i.extend({},i.result(this,"attributes"));this.id&&(e.id=i.result(this,"id")),this.className&&(e.class=i.result(this,"className"));var n=t.$("<"+i.result(this,"tagName")+">").attr(e);this.setElement(n,!1)}}}),t.sync=function(e,n,r){var s=S[e];i.defaults(r||(r={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var o={type:s,dataType:"json"};if(r.url||(o.url=i.result(n,"url")||F()),null!=r.data||!n||"create"!==e&&"update"!==e&&"patch"!==e||(o.contentType="application/json",o.data=JSON.stringify(r.attrs||n.toJSON(r))),r.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{}),r.emulateHTTP&&("PUT"===s||"DELETE"===s||"PATCH"===s)){o.type="POST",r.emulateJSON&&(o.data._method=s);var a=r.beforeSend;r.beforeSend=function(e){if(e.setRequestHeader("X-HTTP-Method-Override",s),a)return a.apply(this,arguments)}}"GET"===o.type||r.emulateJSON||(o.processData=!1),"PATCH"===o.type&&L&&(o.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var l=r.xhr=t.ajax(i.extend(o,r));return n.trigger("request",n,l,r),l};var L=!("undefined"==typeof window||!window.ActiveXObject||window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent),S={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var T=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},C=/\((.*?)\)/g,w=/(\(\?)?:\w+/g,Z=/\*\w+/g,D=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(T.prototype,a,{initialize:function(){},route:function(e,n,r){i.isRegExp(e)||(e=this._routeToRegExp(e)),i.isFunction(n)&&(r=n,n=""),r||(r=this[n]);var s=this;return t.history.route(e,function(i){var o=s._extractParameters(e,i);s.execute(r,o),s.trigger.apply(s,["route:"+n].concat(o)),s.trigger("route",n,o),t.history.trigger("route",s,n,o)}),this},execute:function(e,t){e&&e.apply(this,t)},navigate:function(e,i){return t.history.navigate(e,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var e,t=i.keys(this.routes);null!=(e=t.pop());)this.route(e,this.routes[e])}},_routeToRegExp:function(e){return e=e.replace(D,"\\$&").replace(C,"(?:$1)?").replace(w,function(e,t){return t?e:"([^/?]+)"}).replace(Z,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var n=e.exec(t).slice(1);return i.map(n,function(e,t){return t===n.length-1?e||null:e?decodeURIComponent(e):null})}});var M=t.History=function(){this.handlers=[],i.bindAll(this,"checkUrl"),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},x=/^[#\/]|\s+$/g,H=/^\/+|\/+$/g,X=/msie [\w.]+/,P=/\/$/,J=/#.*$/;M.started=!1,i.extend(M.prototype,a,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(e){var t=(e||this).location.href.match(/#(.*)$/);return t?t[1]:""},getFragment:function(e,t){if(null==e)if(this._hasPushState||!this._wantsHashChange||t){e=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(P,"");e.indexOf(i)||(e=e.slice(i.length))}else e=this.getHash();return e.replace(x,"")},start:function(e){if(M.started)throw new Error("Backbone.history has already been started");M.started=!0,this.options=i.extend({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=this.options.hashChange!==!1,this._wantsPushState=!!this.options.pushState,this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var n=this.getFragment(),r=document.documentMode,s=X.exec(navigator.userAgent.toLowerCase())&&(!r||r<=7);if(this.root=("/"+this.root+"/").replace(H,"/"),s&&this._wantsHashChange){var o=t.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=o.hide().appendTo("body")[0].contentWindow,this.navigate(n)}this._hasPushState?t.$(window).on("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?t.$(window).on("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=n;var a=this.location;if(this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return this.fragment=this.getFragment(null,!0),this.location.replace(this.root+"#"+this.fragment),!0;this._hasPushState&&this.atRoot()&&a.hash&&(this.fragment=this.getHash().replace(x,""),this.history.replaceState({},document.title,this.root+this.fragment))}if(!this.options.silent)return this.loadUrl()},stop:function(){t.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),M.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();return t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe))),t!==this.fragment&&(this.iframe&&this.navigate(t),void this.loadUrl())},loadUrl:function(e){return e=this.fragment=this.getFragment(e),i.any(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0})},navigate:function(e,t){if(!M.started)return!1;t&&t!==!0||(t={trigger:!!t});var i=this.root+(e=this.getFragment(e||""));if(e=e.replace(J,""),this.fragment!==e){if(this.fragment=e,""===e&&"/"!==i&&(i=i.slice(0,-1)),this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,e,t.replace),this.iframe&&e!==this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,e,t.replace))}return t.trigger?this.loadUrl(e):void 0}},_updateHash:function(e,t,i){if(i){var n=e.href.replace(/(javascript:|#).*$/,"");e.replace(n+"#"+t)}else e.hash="#"+t}}),t.history=new M;var k=function(e,t){var n,r=this;n=e&&i.has(e,"constructor")?e.constructor:function(){return r.apply(this,arguments)},i.extend(n,r,t);var s=function(){this.constructor=n};return s.prototype=r.prototype,n.prototype=new s,e&&i.extend(n.prototype,e),n.__super__=r.prototype,n};h.extend=f.extend=T.extend=y.extend=M.extend=k;var F=function(){throw new Error('A "url" property or function must be specified')},Q=function(e,t){var i=t.error;t.error=function(n){i&&i(e,n,t),e.trigger("error",e,n,t)}};return t}),define("sysadmin-app/views/side-nav",["jquery","underscore","backbone","common"],function(e,t,i,n){"use strict";var r=i.View.extend({el:"#side-nav",template:t.template(e("#side-nav-tmpl").html()),initialize:function(){this.default_cur_tab="dashboard",this.data={cur_tab:this.default_cur_tab},this.render();var t=this;e("#js-toggle-side-nav").click(function(){return t.show(),!1}),e(window).resize(function(){e(window).width()>=768&&t.show()})},render:function(){return this.$el.html(this.template(this.data)),this},setCurTab:function(t,i){this.data.cur_tab=t||this.default_cur_tab,i&&e.extend(this.data,i),this.render()},show:function(){this.$el.css({left:"0px"})},hide:function(){this.$el.css({left:"-300px"})},events:{"click .js-close-side-nav":"closeNav","click li a":"visitLink","submit #libs-search-form":"searchLibs","submit #trash-libs-search-form":"searchTrashLibs","submit #groups-search-form":"searchGroups"},closeNav:function(){return this.hide(),!1},visitLink:function(t){return e(window).width()<768&&this.hide(),!0},searchLibs:function(){var t=this.$("#libs-search-form"),i=e.trim(e('[name="name"]',t).val());if(!i)return!1;var n=t.attr("action")+"?name="+encodeURIComponent(i)+"&owner=";return location.href=n,!1},searchTrashLibs:function(){var t=this.$("#trash-libs-search-form"),i=e.trim(e('[name="name"]',t).val());if(!i)return!1;var n=t.attr("action")+"?name="+encodeURIComponent(i);return location.href=n,!1},searchGroups:function(){var t=this.$("#groups-search-form"),i=e.trim(e('[name="name"]',t).val());if(!i)return!1;var n=t.attr("action")+"?name="+encodeURIComponent(i);return location.href=n,!1}});return r}),define("sysadmin-app/models/sysinfo",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({url:function(){return i.getUrl({name:"sysinfo"})}});return n}),define("sysadmin-app/views/dashboard",["jquery","underscore","backbone","common","sysadmin-app/models/sysinfo"],function(e,t,i,n,r){"use strict";var s=i.View.extend({id:"admin-dashboard",template:t.template(e("#sysinfo-tmpl").html()),conTemplate:t.template(e("#sysinfo-con-tmpl").html()),initialize:function(){this.sysinfo=new r,this.render()},events:{"click .license-file-upload-btn":"uploadFile","change .license-file-upload-input":"uploadLicenseFile"},uploadFile:function(){this.$(".license-file-upload-input").trigger("click")},uploadLicenseFile:function(){var t,i=this.$(".license-file-upload-input");if(i[0].files){t=i[0].files[0];var r=i.attr("name"),s=new FormData;s.append(r,t),e.ajax({url:n.getUrl({name:"license"}),type:"POST",data:s,processData:!1,contentType:!1,beforeSend:n.prepareCSRFToken,success:function(){location.reload(!0)},error:function(e){n.ajaxErrorHandler(e)}})}},render:function(){this.$el.html(this.template()),this.$loadingTip=this.$(".loading-tip"),this.$sysinfo=this.$(".sysinfo")},showSysinfo:function(){this.$sysinfo.empty(),this.$loadingTip.show();var t=this;this.sysinfo.fetch({cache:!1,success:function(e,i,n){t.reset()},error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},hide:function(){this.$el.detach()},show:function(){e("#right-panel").html(this.$el),this.showSysinfo()},reset:function(){this.$loadingTip.hide();var e=this.sysinfo.toJSON();e.formatted_storage=n.quotaSizeFormat(e.total_storage,1),this.$sysinfo.html(this.conTemplate(e))}});return s}),define("app/views/widgets/hl-item-view",["jquery","underscore","backbone","common"],function(e,t,i,n){"use strict";var r=i.View.extend({tagName:"tr",hiddenOperationClass:".op-icon",initialize:function(e){this.$el.on("mouseenter",t.bind(this.highlight,this)),this.$el.on("mouseleave",t.bind(this.rmHighlight,this)),this.$el.on("focus","*",t.bind(this.focus,this))},focus:function(){if(app.ui.currentDropdown||app.ui.freezeItemHightlight)return!0;if(app.ui.currentHighlightedItem){if(app.ui.currentHighlightedItem==this)return!0;app.ui.currentHighlightedItem.rmHighlight()}return this.highlight(),!0},highlight:function(){app.ui.currentDropdown||app.ui.freezeItemHightlight||(app.ui.currentHighlightedItem=this,this.$el.addClass("hl").find(this.hiddenOperationClass).removeClass("vh"))},rmHighlight:function(){app.ui.currentDropdown||app.ui.freezeItemHightlight||(app.ui.currentHighlightedItem=null,this.$el.removeClass("hl"),e(window).width()>=768&&this.$el.find(this.hiddenOperationClass).addClass("vh"))}});return r}),define("sysadmin-app/views/device",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#device-item-tmpl").html()),events:{"click .unlink-device":"unlinkDeviceWithConfirm"},initialize:function(){s.prototype.initialize.call(this)},render:function(){var e=this.model.toJSON(),t=r(e.last_accessed);return e.time=t.format("LLLL"),e.time_from_now=n.getRelativeTimeStr(t),this.$el.html(this.template(e)),this},unlinkDeviceWithConfirm:function(){var t=this,i=this.model.get("is_desktop_client"),r=this.model.get("device_name");if(!i)return t.model.unlink({wipe_device:!0,success:function(){t.remove();var e=gettext("Successfully unlink %(name)s.").replace("%(name)s",r);n.feedback(e,"success")},error:function(e){n.ajaxErrorHandler(e)}}),!1;var s=gettext("Unlink device"),o=gettext("Are you sure you want to unlink this device?"),a=gettext("Delete files from this device the next time it comes online."),l=function(i){return t.model.unlink({wipe_device:i,success:function(){t.remove();var e=gettext("Successfully unlink %(name)s.").replace("%(name)s",r);n.feedback(e,"success")},error:function(e){n.ajaxErrorHandler(e)},complete:function(){e.modal.close()}}),!1};n.showConfirmWithExtraOption(s,o,a,l)}});return o}),function(e){if("object"==typeof exports&&"function"==typeof require)module.exports=e(require("underscore"),require("backbone"));else if("function"==typeof define&&define.amd)define("backbone.paginator",["underscore","backbone"],e);else if("undefined"!=typeof _&&"undefined"!=typeof Backbone){var t=Backbone.PageableCollection,i=e(_,Backbone);Backbone.PageableCollection.noConflict=function(){return Backbone.PageableCollection=t,i}}}(function(e,t){"use strict";function i(t,i){if(!e.isNumber(t)||e.isNaN(t)||!e.isFinite(t)||~~t!==t)throw new TypeError("`"+i+"` must be a finite integer");return t}function n(e){for(var t,i,n,r,s={},o=decodeURIComponent,a=e.split("&"),l=0,c=a.length;l<c;l++){var u=a[l];t=u.split("="),i=t[0],n=t[1],null==n&&(n=!0),i=o(i),n=o(n),r=s[i],f(r)?r.push(n):r?s[i]=[r,n]:s[i]=n}return s}function r(e,t,i){var n=e._events[t];if(n&&n.length){var r=n[n.length-1],s=r.callback;r.callback=function(){try{s.apply(this,arguments),i()}catch(e){throw e}finally{r.callback=s}}}else i()}var s=e.extend,o=e.omit,a=e.clone,l=e.each,c=e.pick,u=e.contains,d=e.isEmpty,h=e.pairs,p=e.invert,f=e.isArray,m=e.isFunction,g=e.isObject,v=e.keys,_=e.isUndefined,y=Math.ceil,Y=Math.floor,b=Math.max,L=t.Collection.prototype,S=/[\s'"]/g,T=/[<>\s'"]/g,C=t.PageableCollection=t.Collection.extend({state:{firstPage:1,lastPage:null,currentPage:null,pageSize:25,totalPages:null,totalRecords:null,sortKey:null,order:-1},mode:"server",queryParams:{currentPage:"page",pageSize:"per_page",totalPages:"total_pages",totalRecords:"total_entries",sortKey:"sort_by",order:"order",directions:{"-1":"asc",1:"desc"}},constructor:function(e,t){L.constructor.apply(this,arguments),t=t||{};var i=this.mode=t.mode||this.mode||w.mode,n=s({},w.queryParams,this.queryParams,t.queryParams||{});n.directions=s({},w.queryParams.directions,this.queryParams.directions,n.directions||{}),this.queryParams=n;var r=this.state=s({},w.state,this.state,t.state||{});r.currentPage=null==r.currentPage?r.firstPage:r.currentPage,f(e)||(e=e?[e]:[]),e=e.slice(),"server"==i||null!=r.totalRecords||d(e)||(r.totalRecords=e.length),this.switchMode(i,s({fetch:!1,resetState:!1,models:e},t));var o=t.comparator;if(r.sortKey&&!o&&this.setSorting(r.sortKey,r.order,t),"server"!=i){var l=this.fullCollection;o&&t.full&&(this.comparator=null,l.comparator=o),t.full&&l.sort(),d(e)||(this.reset(e,s({silent:!0},t)),this.getPage(r.currentPage),e.splice.apply(e,[0,e.length].concat(this.models)))}this._initState=a(this.state)},_makeFullCollection:function(e,i){var n,r,s,o=["url","model","sync","comparator"],a=this.constructor.prototype,l={};for(n=0,r=o.length;n<r;n++)s=o[n],_(a[s])||(l[s]=a[s]);var c=new(t.Collection.extend(l))(e,i);for(n=0,r=o.length;n<r;n++)s=o[n],this[s]!==a[s]&&(c[s]=this[s]);return c},_makeCollectionEventHandler:function(e,t){return function(i,n,o,c){var u=e._handlers;l(v(u),function(i){var n=u[i];e.off(i,n),t.off(i,n)});var d=a(e.state),h=d.firstPage,p=0===h?d.currentPage:d.currentPage-1,f=d.pageSize,m=p*f,g=m+f;if("add"==i){var Y,b,L,S,c=c||{};if(o==t)b=t.indexOf(n),b>=m&&b<g&&(S=e,Y=L=b-m);else{Y=e.indexOf(n),b=m+Y,S=t;var L=_(c.at)?b:c.at+m}if(c.onRemove||(++d.totalRecords,delete c.onRemove),e.state=e._checkState(d),S){S.add(n,s({},c||{},{at:L}));var T=Y>=f?n:!_(c.at)&&L<g&&e.length>f?e.at(f):null;T&&r(o,i,function(){e.remove(T,{onAdd:!0})})}}if("remove"==i)if(c.onAdd)delete c.onAdd;else{if(--d.totalRecords){var C=d.totalPages=y(d.totalRecords/f);d.lastPage=0===h?C-1:C||h,d.currentPage>C&&(d.currentPage=d.lastPage)}else d.totalRecords=null,d.totalPages=null;e.state=e._checkState(d);var w,Z=c.index;o==e?((w=t.at(g))?r(e,i,function(){e.push(w,{onRemove:!0})}):!e.length&&d.totalRecords&&e.reset(t.models.slice(m-f,g-f),s({},c,{parse:!1})),t.remove(n)):Z>=m&&Z<g&&((w=t.at(g-1))&&r(e,i,function(){e.push(w,{onRemove:!0})}),e.remove(n),!e.length&&d.totalRecords&&e.reset(t.models.slice(m-f,g-f),s({},c,{parse:!1})))}if("reset"==i)if(c=o,o=n,o==e&&null==c.from&&null==c.to){var D=t.models.slice(0,m),M=t.models.slice(m+e.models.length);t.reset(D.concat(e.models).concat(M),c)}else o==t&&((d.totalRecords=t.models.length)||(d.totalRecords=null,d.totalPages=null),"client"==e.mode&&(h=d.lastPage=d.currentPage=d.firstPage,p=0===h?d.currentPage:d.currentPage-1,m=p*f,g=m+f),e.state=e._checkState(d),e.reset(t.models.slice(m,g),s({},c,{parse:!1})));"sort"==i&&(c=o,o=n,o===t&&e.reset(t.models.slice(m,g),s({},c,{parse:!1}))),l(v(u),function(i){var n=u[i];l([e,t],function(e){e.on(i,n);var t=e._events[i]||[];t.unshift(t.pop())})})}},_checkState:function(e){var t=this.mode,n=this.links,r=e.totalRecords,s=e.pageSize,o=e.currentPage,a=e.firstPage,l=e.totalPages;if(null!=r&&null!=s&&null!=o&&null!=a&&("infinite"!=t||n)){if(r=i(r,"totalRecords"),s=i(s,"pageSize"),o=i(o,"currentPage"),a=i(a,"firstPage"),s<1)throw new RangeError("`pageSize` must be >= 1");if(l=e.totalPages=y(r/s),a<0||a>1)throw new RangeError("`firstPage must be 0 or 1`");if(e.lastPage=0===a?b(0,l-1):l||a,"infinite"==t){if(!n[o+""])throw new RangeError("No link found for page "+o)}else if(o<a||l>0&&(a?o>l:o>=l))throw new RangeError("`currentPage` must be firstPage <= currentPage "+(a?"<":"<=")+" totalPages if "+a+"-based. Got "+o+".")}return e},setPageSize:function(e,t){e=i(e,"pageSize"),t=t||{first:!1};var n=this.state,r=y(n.totalRecords/e),a=r?b(n.firstPage,Y(r*n.currentPage/n.totalPages)):n.firstPage;return n=this.state=this._checkState(s({},n,{pageSize:e,currentPage:t.first?n.firstPage:a,totalPages:r})),this.getPage(n.currentPage,o(t,["first"]))},switchMode:function(t,i){if(!u(["server","client","infinite"],t))throw new TypeError('`mode` must be one of "server", "client" or "infinite"');i=i||{fetch:!0,resetState:!0};var n=this.state=i.resetState?a(this._initState):this._checkState(s({},this.state));this.mode=t;var r,c=this,d=this.fullCollection,h=this._handlers=this._handlers||{};if("server"==t||d)"server"==t&&d&&(l(v(h),function(e){r=h[e],c.off(e,r),d.off(e,r)}),delete this._handlers,this._fullComparator=d.comparator,delete this.fullCollection);else{d=this._makeFullCollection(i.models||[],i),d.pageableCollection=this,this.fullCollection=d;var p=this._makeCollectionEventHandler(this,d);l(["add","remove","reset","sort"],function(t){h[t]=r=e.bind(p,{},t),c.on(t,r),d.on(t,r);
}),d.comparator=this._fullComparator}if("infinite"==t)for(var f=this.links={},m=n.firstPage,g=y(n.totalRecords/n.pageSize),_=0===m?b(0,g-1):g||m,Y=n.firstPage;Y<=_;Y++)f[Y]=this.url;else this.links&&delete this.links;return i.fetch?this.fetch(o(i,"fetch","resetState")):this},hasPreviousPage:function(){var e=this.state,t=e.currentPage;return"infinite"!=this.mode?t>e.firstPage:!!this.links[t-1]},hasNextPage:function(){var e=this.state,t=this.state.currentPage;return"infinite"!=this.mode?t<e.lastPage:!!this.links[t+1]},getFirstPage:function(e){return this.getPage("first",e)},getPreviousPage:function(e){return this.getPage("prev",e)},getNextPage:function(e){return this.getPage("next",e)},getLastPage:function(e){return this.getPage("last",e)},getPage:function(e,t){var n=this.mode,r=this.fullCollection;t=t||{fetch:!1};var a=this.state,l=a.firstPage,c=a.currentPage,u=a.lastPage,h=a.pageSize,p=e;switch(e){case"first":p=l;break;case"prev":p=c-1;break;case"next":p=c+1;break;case"last":p=u;break;default:p=i(e,"index")}this.state=this._checkState(s({},a,{currentPage:p})),t.from=c,t.to=p;var f=(0===l?p:p-1)*h,m=r&&r.length?r.models.slice(f,f+h):[];return"client"!=n&&("infinite"!=n||d(m))||t.fetch?("infinite"==n&&(t.url=this.links[p]),this.fetch(o(t,"fetch"))):(this.reset(m,o(t,"fetch")),this)},getPageByOffset:function(e,t){if(e<0)throw new RangeError("`offset must be > 0`");e=i(e);var n=Y(e/this.state.pageSize);return 0!==this.state.firstPage&&n++,n>this.state.lastPage&&(n=this.state.lastPage),this.getPage(n,t)},sync:function(e,i,n){var r=this;if("infinite"==r.mode){var o=n.success,a=r.state.currentPage;n.success=function(e,t,i){var l=r.links,c=r.parseLinks(e,s({xhr:i},n));c.first&&(l[r.state.firstPage]=c.first),c.prev&&(l[a-1]=c.prev),c.next&&(l[a+1]=c.next),o&&o(e,t,i)}}return(L.sync||t.sync).call(r,e,i,n)},parseLinks:function(e,t){var i={},n=t.xhr.getResponseHeader("Link");if(n){var r=["first","prev","next"];l(n.split(","),function(e){var t=e.split(";"),n=t[0].replace(T,""),s=t.slice(1);l(s,function(e){var t=e.split("="),s=t[0].replace(S,""),o=t[1].replace(S,"");"rel"==s&&u(r,o)&&(i[o]=n)})})}return i},parse:function(e,t){var i=this.parseState(e,a(this.queryParams),a(this.state),t);return i&&(this.state=this._checkState(s({},this.state,i))),this.parseRecords(e,t)},parseState:function(t,i,n,r){if(t&&2===t.length&&g(t[0])&&f(t[1])){var s=a(n),c=t[0];return l(h(o(i,"directions")),function(t){var i=t[0],n=t[1],r=c[n];_(r)||e.isNull(r)||(s[i]=c[n])}),c.order&&(s.order=1*p(i.directions)[c.order]),s}},parseRecords:function(e,t){return e&&2===e.length&&g(e[0])&&f(e[1])?e[1]:e},fetch:function(t){t=t||{};var i=this._checkState(this.state),r=this.mode;"infinite"!=r||t.url||(t.url=this.links[i.currentPage]);var a=t.data||{},l=t.url||this.url||"";m(l)&&(l=l.call(this));var u=l.indexOf("?");u!=-1&&(s(a,n(l.slice(u+1))),l=l.slice(0,u)),t.url=l,t.data=a;var d="client"==this.mode?c(this.queryParams,"sortKey","order"):o(c(this.queryParams,v(w.queryParams)),"directions"),p=e.clone(this);e.each(d,function(t,n){t=m(t)?t.call(p):t,null!=i[n]&&null!=t&&e.isUndefined(a[t])&&(a[t]=i[n])},this);var g;if(i.sortKey&&i.order){var y=m(d.order)?d.order.call(p):d.order;if(f(i.order))for(a[y]=[],g=0;g<i.order.length;g+=1)a[y].push(this.queryParams.directions[i.order[g]]);else a[y]=this.queryParams.directions[i.order+""]}else i.sortKey||delete a[d.order];var Y,b,S=h(o(this.queryParams,v(w.queryParams)));for(g=0;g<S.length;g++)Y=S[g],b=Y[1],b=m(b)?b.call(p):b,null!=b&&(a[Y[0]]=b);if("server"!=r){var T=this,C=this.fullCollection,Z=t.success;return t.success=function(e,i,n){n=n||{},_(t.silent)?delete n.silent:n.silent=t.silent;var o=e.models;"client"==r?C.reset(o,n):(C.add(o,s({at:C.length},s(n,{parse:!1}))),T.trigger("reset",T,n)),Z&&Z(e,i,n)},L.fetch.call(this,s({},t,{silent:!0}))}return L.fetch.call(this,t)},_makeComparator:function(e,t,i){var n=this.state;if(e=e||n.sortKey,t=t||n.order,e&&t)return i||(i=function(e,t){return e.get(t)}),function(n,r){var s,o=i(n,e),a=i(r,e);return 1===t&&(s=o,o=a,a=s),o===a?0:o<a?-1:1}},setSorting:function(e,t,i){var n=this.state;n.sortKey=e,n.order=t=t||n.order;var r=this.fullCollection,o=!1,a=!1;e||(o=a=!0);var l=this.mode;i=s({side:"client"==l?l:"server",full:!0},i);var c=this._makeComparator(e,t,i.sortValue),u=i.full,d=i.side;return"client"==d?u?(r&&(r.comparator=c),o=!0):(this.comparator=c,a=!0):"server"!=d||u||(this.comparator=c),o&&(this.comparator=null),a&&r&&(r.comparator=null),this}}),w=C.prototype;return C}),define("sysadmin-app/models/device",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({unlink:function(e){var t={platform:this.get("platform"),device_id:this.get("device_id"),user:this.get("user")};e.wipe_device&&(t.wipe_device="true"),$.ajax({url:i.getUrl({name:"admin-devices"}),type:"DELETE",dataType:"json",beforeSend:i.prepareCSRFToken,data:t,success:function(){e.success&&e.success()},error:function(t){e.error&&e.error(t)},complete:function(t){e.complete&&e.complete(t)}})}});return n}),define("sysadmin-app/collection/devices",["underscore","backbone.paginator","common","sysadmin-app/models/device"],function(e,t,i,n){"use strict";var r=Backbone.PageableCollection.extend({model:n,state:{pageSize:50},parseState:function(e){return e.page_info},url:function(){return i.getUrl({name:"admin-devices"})},parseRecords:function(e){return e.devices}});return r}),define("sysadmin-app/views/desktop-devices",["jquery","underscore","backbone","common","moment","sysadmin-app/views/device","sysadmin-app/collection/devices"],function(e,t,i,n,r,s,o){"use strict";var a=i.View.extend({id:"admin-devices",template:t.template(e("#devices-tmpl").html()),initialize:function(){this.deviceCollection=new o,this.listenTo(this.deviceCollection,"add",this.addOne),this.listenTo(this.deviceCollection,"reset",this.reset),this.render()},render:function(){this.$el.html(this.template({cur_tab:"desktop",is_pro:app.pageOptions.is_pro})),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$jsPrevious=this.$(".js-previous"),this.$jsNext=this.$(".js-next")},events:{"click #paginator .js-next":"getNextPage","click #paginator .js-previous":"getPreviousPage"},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$jsNext.hide(),this.$jsPrevious.hide()},getNextPage:function(){this.initPage();var e=this.deviceCollection.state.current_page;return this.deviceCollection.state.has_next_page&&this.deviceCollection.getPage(e+1,{reset:!0,data:{platform:"desktop"}}),!1},getPreviousPage:function(){this.initPage();var e=this.deviceCollection.state.current_page;return e>1&&this.deviceCollection.getPage(e-1,{reset:!0,data:{platform:"desktop"}}),!1},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showDesktopDevices()},showDesktopDevices:function(){this.initPage();var t=this.option.current_page||1;this.deviceCollection.fetch({data:{platform:"desktop",page:t},cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},reset:function(){var e=this.deviceCollection.length,t=this.deviceCollection.state.current_page;this.$loadingTip.hide(),e>0?(this.deviceCollection.each(this.addOne,this),this.$table.show(),this.renderPaginator()):this.$emptyTip.show(),app.router.navigate("desktop-devices/?page="+t)},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)},renderPaginator:function(){this.deviceCollection.state.has_next_page?this.$jsNext.show():this.$jsNext.hide();var e=this.deviceCollection.state.current_page;e>1?this.$jsPrevious.show():this.$jsPrevious.hide()}});return a}),define("sysadmin-app/views/mobile-devices",["jquery","underscore","backbone","common","moment","sysadmin-app/views/device","sysadmin-app/collection/devices"],function(e,t,i,n,r,s,o){"use strict";var a=i.View.extend({id:"admin-devices",template:t.template(e("#devices-tmpl").html()),initialize:function(){this.deviceCollection=new o,this.listenTo(this.deviceCollection,"add",this.addOne),this.listenTo(this.deviceCollection,"reset",this.reset),this.render()},render:function(){this.$el.html(this.template({cur_tab:"mobile",is_pro:app.pageOptions.is_pro})),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$jsPrevious=this.$(".js-previous"),this.$jsNext=this.$(".js-next")},events:{"click #paginator .js-next":"getNextPage","click #paginator .js-previous":"getPreviousPage"},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$jsNext.hide(),this.$jsPrevious.hide()},getNextPage:function(){this.initPage();var e=this.deviceCollection.state.current_page;return this.deviceCollection.state.has_next_page&&this.deviceCollection.getPage(e+1,{reset:!0,data:{platform:"mobile"}}),!1},getPreviousPage:function(){this.initPage();var e=this.deviceCollection.state.current_page;return e>1&&this.deviceCollection.getPage(e-1,{reset:!0,data:{platform:"mobile"}}),!1},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showMobileDevices()},showMobileDevices:function(){this.initPage();var t=this.option.current_page||1;this.deviceCollection.fetch({data:{platform:"mobile",page:t},cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},reset:function(){var e=this.deviceCollection.length,t=this.deviceCollection.state.current_page;this.$loadingTip.hide(),e>0?(this.deviceCollection.each(this.addOne,this),this.$table.show(),this.renderPaginator()):this.$emptyTip.show(),app.router.navigate("mobile-devices/?page="+t)},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)},renderPaginator:function(){this.deviceCollection.state.has_next_page?this.$jsNext.show():this.$jsNext.hide();var e=this.deviceCollection.state.current_page;e>1?this.$jsPrevious.show():this.$jsPrevious.hide()}});return a}),define("sysadmin-app/views/device-error",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#device-error-item-tmpl").html()),initialize:function(){s.prototype.initialize.call(this)},render:function(){var e=this.model.toJSON(),t=r(e.error_time);return e.time=t.format("LLLL"),e.time_from_now=n.getRelativeTimeStr(t),this.$el.html(this.template(e)),this}});return o}),define("sysadmin-app/models/device-error",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({});return n}),define("sysadmin-app/collection/device-errors",["underscore","backbone","common","sysadmin-app/models/device-error"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,url:function(){return i.getUrl({name:"admin-device-errors"})}});return r}),define("sysadmin-app/views/device-errors",["jquery","underscore","backbone","common","sysadmin-app/views/device-error","sysadmin-app/collection/device-errors"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"admin-device-errors",template:t.template(e("#device-errors-tmpl").html()),initialize:function(){this.deviceErrorCollection=new s,this.listenTo(this.deviceErrorCollection,"add",this.addOne),this.listenTo(this.deviceErrorCollection,"reset",this.reset),this.render()},events:{"click #clean-device-errors":"cleanDeviceErrors"},cleanDeviceErrors:function(){var t=this;return e.ajax({url:n.getUrl({name:"admin-device-errors"}),type:"DELETE",beforeSend:n.prepareCSRFToken,success:function(){t.$table.hide(),t.$cleanBtn.hide(),t.$emptyTip.show(),t.deviceErrorCollection.reset();var e=gettext("Successfully clean all errors.");n.feedback(e,"success")},error:function(e){n.ajaxErrorHandler(e)}}),!1},render:function(){this.$el.html(this.template({cur_tab:"errors"})),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$cleanBtn=this.$("#clean-device-errors")},hide:function(){this.$el.detach()},show:function(){e("#right-panel").html(this.$el),this.showAdminDeviceError()},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide()},showAdminDeviceError:function(){this.initPage();this.deviceErrorCollection.fetch({cache:!1,reset:!0,success:function(e,t,i){},error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},reset:function(){this.$loadingTip.hide(),this.deviceErrorCollection.length?(this.deviceErrorCollection.each(this.addOne,this),this.$table.show(),this.$cleanBtn.show()):this.$emptyTip.show()},addOne:function(e){var t=new r({model:e});this.$tableBody.append(t.render().el)}});return o}),function(e){"function"==typeof define&&define.amd?define("simplemodal",["jquery"],e):e(jQuery)}(function(e){var t=[],i=e(document),n=navigator.userAgent.toLowerCase(),r=e(window),s=[],o={ieQuirks:null,msie:/msie/.test(n)&&!/opera/.test(n),opera:/opera/.test(n)};o.ie6=o.msie&&/msie 6./.test(n)&&"object"!=typeof window.XMLHttpRequest,o.ie7=o.msie&&/msie 7.0/.test(n),o.boxModel="CSS1Compat"===document.compatMode;var a;e.modal=function(t,i){return e.modal.impl.init(t,i)},e.modal.close=function(){e.modal.impl.close()},e.modal.focus=function(t){e.modal.impl.focus(t)},e.modal.setContainerDimensions=function(){e.modal.impl.setContainerDimensions()},e.modal.setPosition=function(){e.modal.impl.setPosition()},e.modal.update=function(t,i){e.modal.impl.update(t,i)},e.fn.modal=function(t){return e.modal.impl.init(this,t)},e.modal.defaults={appendTo:"body",focus:!0,opacity:50,overlayId:"simplemodal-overlay",overlayCss:{},containerId:"simplemodal-container",containerCss:{},dataId:"simplemodal-data",dataCss:{},minHeight:null,minWidth:null,maxHeight:null,maxWidth:null,autoResize:!1,autoPosition:!0,zIndex:1e3,close:!0,closeHTML:'<a class="modalCloseImg" title="Close"></a>',closeClass:"simplemodal-close",escClose:!0,overlayClose:!1,fixed:!0,position:null,persist:!1,modal:!0,onOpen:null,onShow:null,onClose:null},e.modal.impl={d:{},init:function(t,i){var n=this;if(n.d.data)return!1;if(o.ieQuirks=o.msie&&!o.boxModel,n.o=e.extend({},e.modal.defaults,i),n.zIndex=n.o.zIndex,n.occb=!1,"object"==typeof t)t=t instanceof e?t:e(t),n.d.placeholder=!1,t.parent().parent().size()>0&&(t.before(e("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),n.d.placeholder=!0,n.display=t.css("display"),n.o.persist||(n.d.orig=t.clone(!0)));else{if("string"!=typeof t&&"number"!=typeof t)return alert("SimpleModal Error: Unsupported data type: "+typeof t),n;t=e("<div></div>").html(t)}return n.create(t),t=null,n.open(),e.isFunction(n.o.onShow)&&n.o.onShow.apply(n,[n.d]),n},create:function(i){var n=this;n.getDimensions(),n.o.modal&&o.ie6&&(n.d.iframe=e('<iframe src="javascript:false;"></iframe>').css(e.extend(n.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:s[0],width:s[1],zIndex:n.o.zIndex,top:0,left:0})).appendTo(n.o.appendTo)),n.d.overlay=e("<div></div>").attr("id",n.o.overlayId).attr("tabIndex",-1).addClass("simplemodal-overlay").css(e.extend(n.o.overlayCss,{display:"none",opacity:n.o.opacity/100,height:n.o.modal?t[0]:0,width:n.o.modal?t[1]:0,position:"fixed",left:0,top:0,zIndex:n.o.zIndex+1})).appendTo(n.o.appendTo),n.d.container=e('<div role="dialog" aria-labelledby="dialogTitle" aria-describedby="dialogDiscription"></div>').attr("id",n.o.containerId).addClass("simplemodal-container").css(e.extend({position:n.o.fixed?"fixed":"absolute"},n.o.containerCss,{display:"none",zIndex:n.o.zIndex+2})).append(n.o.close&&n.o.closeHTML?e(n.o.closeHTML).addClass(n.o.closeClass):"").appendTo(n.o.appendTo),n.d.wrap=e('<div role="document"></div>').addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(n.d.container),n.d.data=i.attr("id",i.attr("id")||n.o.dataId).addClass("simplemodal-data").css(e.extend(n.o.dataCss,{display:"none"})).appendTo("body"),i=null,n.setContainerDimensions(),n.d.data.appendTo(n.d.wrap),(o.ie6||o.ieQuirks)&&n.fixIE()},bindEvents:function(){var n=this;e("."+n.o.closeClass).bind("click.simplemodal",function(e){e.preventDefault(),n.close()}),n.o.modal&&n.o.close&&n.o.overlayClose&&n.d.overlay.bind("click.simplemodal",function(e){e.preventDefault(),n.close()}),i.bind("keydown.simplemodal",function(e){n.o.modal&&9===e.keyCode?n.watchTab(e):n.o.close&&n.o.escClose&&27===e.keyCode&&(e.preventDefault(),n.close())}),r.bind("resize.simplemodal orientationchange.simplemodal",function(){n.getDimensions(),n.o.autoResize?n.setContainerDimensions():n.o.autoPosition&&n.setPosition(),o.ie6||o.ieQuirks?n.fixIE():n.o.modal&&(n.d.iframe&&n.d.iframe.css({height:s[0],width:s[1]}),n.d.overlay.css({height:t[0],width:t[1]}))})},unbindEvents:function(){e("."+this.o.closeClass).unbind("click.simplemodal"),i.unbind("keydown.simplemodal"),r.unbind(".simplemodal"),this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var t=this,i=t.o.position;e.each([t.d.iframe||null,t.o.modal?t.d.overlay:null,"fixed"===t.d.container.css("position")?t.d.container:null],function(e,t){if(t){var n="document.body.clientHeight",r="document.body.clientWidth",s="document.body.scrollHeight",o="document.body.scrollLeft",a="document.body.scrollTop",l="document.body.scrollWidth",c="document.documentElement.clientHeight",u="document.documentElement.clientWidth",d="document.documentElement.scrollLeft",h="document.documentElement.scrollTop",p=t[0].style;if(p.position="absolute",e<2)p.removeExpression("height"),p.removeExpression("width"),p.setExpression("height",""+s+" > "+n+" ? "+s+" : "+n+' + "px"'),p.setExpression("width",""+l+" > "+r+" ? "+l+" : "+r+' + "px"');else{var f,m;if(i&&i.constructor===Array){var g=i[0]?"number"==typeof i[0]?i[0].toString():i[0].replace(/px/,""):t.css("top").replace(/px/,"");if(f=g.indexOf("%")===-1?g+" + (t = "+h+" ? "+h+" : "+a+') + "px"':parseInt(g.replace(/%/,""))+" * (("+c+" || "+n+") / 100) + (t = "+h+" ? "+h+" : "+a+') + "px"',i[1]){var v="number"==typeof i[1]?i[1].toString():i[1].replace(/px/,"");m=v.indexOf("%")===-1?v+" + (t = "+d+" ? "+d+" : "+o+') + "px"':parseInt(v.replace(/%/,""))+" * (("+u+" || "+r+") / 100) + (t = "+d+" ? "+d+" : "+o+') + "px"'}}else f="("+c+" || "+n+") / 2 - (this.offsetHeight / 2) + (t = "+h+" ? "+h+" : "+a+') + "px"',m="("+u+" || "+r+") / 2 - (this.offsetWidth / 2) + (t = "+d+" ? "+d+" : "+o+') + "px"';p.removeExpression("top"),p.removeExpression("left"),p.setExpression("top",f),p.setExpression("left",m)}}})},focus:function(t){var i=this,n=t&&e.inArray(t,["first","last"])!==-1?t:"first",r=e(":input:enabled:visible:"+n,i.d.wrap);setTimeout(function(){r.length>0?r.focus():i.d.wrap.focus()},10)},getDimensions:function(){var e="undefined"==typeof window.innerHeight?r.height():window.innerHeight;t=[i.height(),i.width()],s=[e,r.width()]},getVal:function(e,t){return e?"number"==typeof e?e:"auto"===e?0:e.indexOf("%")>0?parseInt(e.replace(/%/,""))/100*("h"===t?s[0]:s[1]):parseInt(e.replace(/px/,"")):null},update:function(e,t){var i=this;return!!i.d.data&&(i.d.origHeight=i.getVal(e,"h"),i.d.origWidth=i.getVal(t,"w"),i.d.data.hide(),e&&i.d.container.css("height",e),t&&i.d.container.css("width",t),i.setContainerDimensions(),i.d.data.show(),i.o.focus&&i.focus(),i.unbindEvents(),void i.bindEvents())},setContainerDimensions:function(){var e=this,t=o.ie6||o.ie7,i=e.d.origHeight?e.d.origHeight:o.opera?e.d.container.height():e.getVal(t?e.d.container[0].currentStyle.height:e.d.container.css("height"),"h"),n=e.d.origWidth?e.d.origWidth:o.opera?e.d.container.width():e.getVal(t?e.d.container[0].currentStyle.width:e.d.container.css("width"),"w"),r=e.d.data.outerHeight(!0),a=e.d.data.outerWidth(!0);e.d.origHeight=e.d.origHeight||i,e.d.origWidth=e.d.origWidth||n;var l=e.o.maxHeight?e.getVal(e.o.maxHeight,"h"):null,c=e.o.maxWidth?e.getVal(e.o.maxWidth,"w"):null,u=l&&l<s[0]?l:s[0],d=c&&c<s[1]?c:s[1],h=e.o.minHeight?e.getVal(e.o.minHeight,"h"):"auto";i=i?e.o.autoResize&&i>u?u:i<h?h:i:r?r>u?u:e.o.minHeight&&"auto"!==h&&r<h?h:r:h;var p=e.o.minWidth?e.getVal(e.o.minWidth,"w"):"auto";n=n?e.o.autoResize&&n>d?d:n<p?p:n:a?a>d?d:e.o.minWidth&&"auto"!==p&&a<p?p:a:p,e.d.container.css({height:i,width:n}),e.d.wrap.css({overflow:r>i||a>n?"auto":"visible"}),e.o.autoPosition&&e.setPosition()},setPosition:function(){var e,t,i=this,n=s[0]/2-i.d.container.outerHeight(!0)/2,o=s[1]/2-i.d.container.outerWidth(!0)/2,a="fixed"!==i.d.container.css("position")?r.scrollTop():0;i.o.position&&"[object Array]"===Object.prototype.toString.call(i.o.position)?(e=a+(i.o.position[0]||n),t=i.o.position[1]||o):(e=a+n,t=o),i.d.container.css({left:t,top:e})},watchTab:function(t){var i=this;if(e(t.target).parents(".simplemodal-container").length>0){if(i.inputs=e(":input:enabled:visible:first, :input:enabled:visible:last",i.d.data[0]),!t.shiftKey&&t.target===i.inputs[i.inputs.length-1]||t.shiftKey&&t.target===i.inputs[0]||0===i.inputs.length){t.preventDefault();var n=t.shiftKey?"last":"first";i.focus(n)}}else t.preventDefault(),i.focus()},open:function(){var t=this;t.d.iframe&&t.d.iframe.show(),e.isFunction(t.o.onOpen)?t.o.onOpen.apply(t,[t.d]):(t.d.overlay.show(),t.d.container.show(),t.d.data.show()),a=document.activeElement,t.o.focus&&t.focus(),t.bindEvents()},close:function(){var t=this;if(!t.d.data)return!1;if(a&&a.focus(),t.unbindEvents(),e.isFunction(t.o.onClose)&&!t.occb)t.occb=!0,t.o.onClose.apply(t,[t.d]);else{if(t.d.placeholder){var i=e("#simplemodal-placeholder");t.o.persist?i.replaceWith(t.d.data.removeClass("simplemodal-data").css("display",t.display)):(t.d.data.hide().remove(),i.replaceWith(t.d.orig))}else t.d.data.hide().remove();t.d.container.hide().remove(),t.d.overlay.hide(),t.d.iframe&&t.d.iframe.hide().remove(),t.d.overlay.remove(),t.d={}}}}}),function(e){"undefined"==typeof e.fn.each2&&e.extend(e.fn,{each2:function(t){for(var i=e([0]),n=-1,r=this.length;++n<r&&(i.context=i[0]=this[n])&&t.call(i[0],n,i)!==!1;);return this}})}(jQuery),function(e,t){"use strict";function i(t){var i=e(document.createTextNode(""));t.before(i),i.before(t),i.remove()}function n(e){function t(e){return W[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function r(e,t){for(var i=0,n=t.length;i<n;i+=1)if(o(e,t[i]))return i;return-1}function s(){var t=e(B);t.appendTo(document.body);var i={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),i}function o(e,i){return e===i||e!==t&&i!==t&&(null!==e&&null!==i&&(e.constructor===String?e+""==i+"":i.constructor===String&&i+""==e+""))}function a(e,t,i){var n,r,s;if(null===e||e.length<1)return[];for(n=e.split(t),r=0,s=n.length;r<s;r+=1)n[r]=i(n[r]);return n}function l(e){return e.outerWidth(!1)-e.width()}function c(i){var n="keyup-change-value";i.on("keydown",function(){e.data(i,n)===t&&e.data(i,n,i.val())}),i.on("keyup",function(){var r=e.data(i,n);r!==t&&i.val()!==r&&(e.removeData(i,n),i.trigger("keyup-change"))})}function u(i){i.on("mousemove",function(i){var n=Q;n!==t&&n.x===i.pageX&&n.y===i.pageY||e(i.target).trigger("mousemove-filtered",i)})}function d(e,i,n){n=n||t;var r;return function(){var t=arguments;window.clearTimeout(r),r=window.setTimeout(function(){i.apply(n,t)},e)}}function h(e,t){var i=d(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){r(e.target,t.get())>=0&&i(e)})}function p(e){e[0]!==document.activeElement&&window.setTimeout(function(){var t,i=e[0],n=e.val().length;e.focus();var r=i.offsetWidth>0||i.offsetHeight>0;r&&i===document.activeElement&&(i.setSelectionRange?i.setSelectionRange(n,n):i.createTextRange&&(t=i.createTextRange(),t.collapse(!1),t.select()))},0)}function f(t){t=e(t)[0];var i=0,n=0;if("selectionStart"in t)i=t.selectionStart,n=t.selectionEnd-i;else if("selection"in document){t.focus();var r=document.selection.createRange();n=document.selection.createRange().text.length,r.moveStart("character",-t.value.length),i=r.text.length-n}return{offset:i,length:n}}function m(e){e.preventDefault(),e.stopPropagation()}function g(e){e.preventDefault(),e.stopImmediatePropagation()}function v(t){if(!J){var i=t[0].currentStyle||window.getComputedStyle(t[0],null);J=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"}),J.attr("class","select2-sizer"),e(document.body).append(J)}return J.text(t.val()),J.width()}function _(t,i,n){var r,s,o=[];r=e.trim(t.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&o.push(this)})),r=e.trim(i.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(s=n(this),s&&o.push(s))})),t.attr("class",o.join(" "))}function y(e,t,i,r){var s=n(e.toUpperCase()).indexOf(n(t.toUpperCase())),o=t.length;return s<0?void i.push(r(e)):(i.push(r(e.substring(0,s))),i.push("<span class='select2-match'>"),i.push(r(e.substring(s,s+o))),i.push("</span>"),void i.push(r(e.substring(s+o,e.length))))}function Y(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function b(i){var n,r=null,s=i.quietMillis||100,o=i.url,a=this;return function(l){window.clearTimeout(n),n=window.setTimeout(function(){var n=i.data,s=o,c=i.transport||e.fn.select2.ajaxDefaults.transport,u={type:i.type||"GET",cache:i.cache||!1,jsonpCallback:i.jsonpCallback||t,dataType:i.dataType||"json"},d=e.extend({},e.fn.select2.ajaxDefaults.params,u);n=n?n.call(a,l.term,l.page,l.context):null,s="function"==typeof s?s.call(a,l.term,l.page,l.context):s,r&&"function"==typeof r.abort&&r.abort(),i.params&&(e.isFunction(i.params)?e.extend(d,i.params.call(a)):e.extend(d,i.params)),e.extend(d,{url:s,dataType:i.dataType,data:n,success:function(e){var t=i.results(e,l.page,l);l.callback(t)},error:function(e,t,i){var n={hasError:!0,jqXHR:e,textStatus:t,errorThrown:i};l.callback(n)}}),r=c.call(a,d)},s)}}function L(t){var i,n,r=t,s=function(e){return""+e.text};e.isArray(r)&&(n=r,r={results:n}),e.isFunction(r)===!1&&(n=r,r=function(){return n});var o=r();return o.text&&(s=o.text,e.isFunction(s)||(i=o.text,s=function(e){return e[i]})),function(t){var i,n=t.term,o={results:[]};return""===n?void t.callback(r()):(i=function(r,o){var a,l;if(r=r[0],r.children){a={};for(l in r)r.hasOwnProperty(l)&&(a[l]=r[l]);a.children=[],e(r.children).each2(function(e,t){i(t,a.children)}),(a.children.length||t.matcher(n,s(a),r))&&o.push(a)}else t.matcher(n,s(r),r)&&o.push(r)},e(r().results).each2(function(e,t){i(t,o.results)}),void t.callback(o))}}function S(i){var n=e.isFunction(i);return function(r){var s=r.term,o={results:[]},a=n?i(r):i;e.isArray(a)&&(e(a).each(function(){var e=this.text!==t,i=e?this.text:this;(""===s||r.matcher(s,i))&&o.results.push(e?this:{id:this,text:this})}),r.callback(o))}}function T(t,i){if(e.isFunction(t))return!0;if(!t)return!1;if("string"==typeof t)return!0;throw new Error(i+" must be a string, function, or falsy value")}function C(t,i){if(e.isFunction(t)){var n=Array.prototype.slice.call(arguments,2);return t.apply(i,n)}return t}function w(t){var i=0;return e.each(t,function(e,t){t.children?i+=w(t.children):i++}),i}function Z(e,i,n,r){var s,a,l,c,u,d=e,h=!1;if(!r.createSearchChoice||!r.tokenSeparators||r.tokenSeparators.length<1)return t;for(;;){for(a=-1,l=0,c=r.tokenSeparators.length;l<c&&(u=r.tokenSeparators[l],a=e.indexOf(u),!(a>=0));l++);if(a<0)break;if(s=e.substring(0,a),e=e.substring(a+u.length),s.length>0&&(s=r.createSearchChoice.call(this,s,i),s!==t&&null!==s&&r.id(s)!==t&&null!==r.id(s))){for(h=!1,l=0,c=i.length;l<c;l++)if(o(r.id(s),r.id(i[l]))){h=!0;break}h||n(s)}}return d!==e?e:void 0}function D(){var t=this;e.each(arguments,function(e,i){t[i].remove(),t[i]=null})}function M(t,i){var n=function(){};return n.prototype=new t,n.prototype.constructor=n,n.prototype.parent=t.prototype,n.prototype=e.extend(n.prototype,i),n}if(window.Select2===t){var x,H,X,P,J,k,F,Q={x:0,y:0},N={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case N.LEFT:case N.RIGHT:case N.UP:case N.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case N.SHIFT:case N.CTRL:case N.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},B="<div class='select2-measure-scrollbar'></div>",W={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U",
"Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};k=e(document),P=function(){var e=1;return function(){return e++}}(),x=M(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(i){var n,r,o=".select2-results";this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&i.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+P()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",i.element.attr("title")),this.body=e(document.body),_(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",i.element.attr("style")),this.container.css(C(i.containerCss,this.opts.element)),this.container.addClass(C(i.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",m),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),_(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(C(i.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",m),this.results=n=this.container.find(o),this.search=r=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",m),u(this.results),this.dropdown.on("mousemove-filtered",o,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",o,this.bind(function(e){this._touchEvent=!0,this.highlightUnderEvent(e)})),this.dropdown.on("touchmove",o,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",o,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(e){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),h(80,this.results),this.dropdown.on("scroll-debounced",o,this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),e(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),e.fn.mousewheel&&n.mousewheel(function(e,t,i,r){var s=n.scrollTop();r>0&&s-r<=0?(n.scrollTop(0),m(e)):r<0&&n.get(0).scrollHeight-n.scrollTop()+r<=n.height()&&(n.scrollTop(n.get(0).scrollHeight-n.height()),m(e))}),c(r),r.on("keyup-change input paste",this.bind(this.updateResults)),r.on("focus",function(){r.addClass("select2-focused")}),r.on("blur",function(){r.removeClass("select2-focused")}),this.dropdown.on("mouseup",o,this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=t,e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength);var a=i.element.prop("disabled");a===t&&(a=!1),this.enable(!a);var l=i.element.prop("readonly");l===t&&(l=!1),this.readonly(l),F=F||s(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",i.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,i=e.data("select2"),n=this;this.close(),e.length&&e[0].detachEvent&&n._sync&&e.each(function(){n._sync&&this.detachEvent("onpropertychange",n._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,i!==t&&(i.container.remove(),i.liveRegion.remove(),i.dropdown.remove(),e.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show()),D.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:o(e.attr("locked"),"locked")||o(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(i){var n,r,s,l,c=this;if(n=i.element,"select"===n.get(0).tagName.toLowerCase()&&(this.select=r=i.element),r&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),i=e.extend({},{populateResults:function(n,r,s){var o,a=this.opts.id,l=this.liveRegion;(o=function(n,r,u){var d,h,p,f,m,g,v,_,y,Y;n=i.sortResults(n,r,s);var b=[];for(d=0,h=n.length;d<h;d+=1)p=n[d],m=p.disabled===!0,f=!m&&a(p)!==t,g=p.children&&p.children.length>0,v=e("<li></li>"),v.addClass("select2-results-dept-"+u),v.addClass("select2-result"),v.addClass(f?"select2-result-selectable":"select2-result-unselectable"),m&&v.addClass("select2-disabled"),g&&v.addClass("select2-result-with-children"),v.addClass(c.opts.formatResultCssClass(p)),v.attr("role","presentation"),_=e(document.createElement("div")),_.addClass("select2-result-label"),_.attr("id","select2-result-label-"+P()),_.attr("role","option"),Y=i.formatResult(p,_,s,c.opts.escapeMarkup),Y!==t&&(_.html(Y),v.append(_)),g&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(p.children,y,u+1),v.append(y)),v.data("select2-data",p),b.push(v[0]);r.append(b),l.text(i.formatMatches(n.length))})(r,n,0)}},e.fn.select2.defaults,i),"function"!=typeof i.id&&(s=i.id,i.id=function(e){return e[s]}),e.isArray(i.element.data("select2Tags"))){if("tags"in i)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+i.element.attr("id");i.tags=i.element.data("select2Tags")}if(r?(i.query=this.bind(function(e){var i,r,s,o={results:[],more:!1},a=e.term;s=function(t,i){var n;t.is("option")?e.matcher(a,t.text(),t)&&i.push(c.optionToData(t)):t.is("optgroup")&&(n=c.optionToData(t),t.children().each2(function(e,t){s(t,n.children)}),n.children.length>0&&i.push(n))},i=n.children(),this.getPlaceholder()!==t&&i.length>0&&(r=this.getPlaceholderOption(),r&&(i=i.not(r))),i.each2(function(e,t){s(t,o.results)}),e.callback(o)}),i.id=function(e){return e.id}):"query"in i||("ajax"in i?(l=i.element.data("ajax-url"),l&&l.length>0&&(i.ajax.url=l),i.query=b.call(i.element,i.ajax)):"data"in i?i.query=L(i.data):"tags"in i&&(i.query=S(i.tags),i.createSearchChoice===t&&(i.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),i.initSelection===t&&(i.initSelection=function(t,n){var r=[];e(a(t.val(),i.separator,i.transformVal)).each(function(){var t={id:this,text:this},n=i.tags;e.isFunction(n)&&(n=n()),e(n).each(function(){if(o(this.id,t.id))return t=this,!1}),r.push(t)}),n(r)}))),"function"!=typeof i.query)throw"query function not defined for Select2 "+i.element.attr("id");if("top"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof i.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return i},monitorSource:function(){var i,n=this.opts.element,r=this;n.on("change.select2",this.bind(function(e){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),this._sync=this.bind(function(){var e=n.prop("disabled");e===t&&(e=!1),this.enable(!e);var i=n.prop("readonly");i===t&&(i=!1),this.readonly(i),this.container&&(_(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(C(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(_(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(C(this.opts.dropdownCssClass,this.opts.element)))}),n.length&&n[0].attachEvent&&n.each(function(){this.attachEvent("onpropertychange",r._sync)}),i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,i!==t&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new i(function(t){e.each(t,r._sync)}),this.propertyObserver.observe(n.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var i=e.Event("select2-selecting",{val:this.id(t),object:t,choice:t});return this.opts.element.trigger(i),!i.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,i,n,r,s,o=this.dropdown,a=this.container,l=a.offset(),c=a.outerHeight(!1),u=a.outerWidth(!1),d=o.outerHeight(!1),h=e(window),p=h.width(),f=h.height(),m=h.scrollLeft()+p,g=h.scrollTop()+f,v=l.top+c,_=l.left,y=v+d<=g,Y=l.top-d>=h.scrollTop(),b=o.outerWidth(!1),L=function(){return _+b<=m},S=function(){return l.left+m+a.outerWidth(!1)>b},T=o.hasClass("select2-drop-above");T?(i=!0,!Y&&y&&(n=!0,i=!1)):(i=!1,!y&&Y&&(n=!0,i=!0)),n&&(o.hide(),l=this.container.offset(),c=this.container.outerHeight(!1),u=this.container.outerWidth(!1),d=o.outerHeight(!1),m=h.scrollLeft()+p,g=h.scrollTop()+f,v=l.top+c,_=l.left,b=o.outerWidth(!1),o.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(s=e(".select2-results",o)[0],o.addClass("select2-drop-auto-width"),o.css("width",""),b=o.outerWidth(!1)+(s.scrollHeight===s.clientHeight?0:F.width),b>u?u=b:b=u,d=o.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(t=this.body.offset(),v-=t.top,_-=t.left),!L()&&S()&&(_=l.left+this.container.outerWidth(!1)-b),r={left:_,width:u},i?(r.top=l.top-d,r.bottom="auto",this.container.addClass("select2-drop-above"),o.addClass("select2-drop-above")):(r.top=v,r.bottom="auto",this.container.removeClass("select2-drop-above"),o.removeClass("select2-drop-above")),r=e.extend(r,C(this.opts.dropdownCss,this.opts.element)),o.css(r)},shouldOpen:function(){var t;return!this.opened()&&(this._enabled!==!1&&this._readonly!==!0&&(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),k.on("mousemove.select2Event",function(e){Q.x=e.pageX,Q.y=e.pageY}),!0)},opening:function(){var t,n=this.containerEventName,r="scroll."+n,s="resize."+n,o="orientationchange."+n;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),t=e("#select2-drop-mask"),0===t.length&&(t=e(document.createElement("div")),t.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body),t.on("mousedown touchstart click",function(n){i(t);var r,s=e("#select2-drop");s.length>0&&(r=s.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close(),n.preventDefault(),n.stopPropagation())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var a=this;this.container.parents().add(window).each(function(){e(this).on(s+" "+r+" "+o,function(e){a.opened()&&a.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerEventName,i="scroll."+t,n="resize."+t,r="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(i).off(n).off(r)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),k.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return C(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var t,i,n,r,s,o,a,l,c=this.results;if(i=this.highlight(),!(i<0)){if(0==i)return void c.scrollTop(0);t=this.findHighlightableChoices().find(".select2-result-label"),n=e(t[i]),l=(n.offset()||{}).top||0,r=l+n.outerHeight(!0),i===t.length-1&&(a=c.find("li.select2-more-results"),a.length>0&&(r=a.offset().top+a.outerHeight(!0))),s=c.offset().top+c.outerHeight(!1),r>s&&c.scrollTop(c.scrollTop()+(r-s)),o=l-c.offset().top,o<0&&"none"!=n.css("display")&&c.scrollTop(c.scrollTop()+o)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){for(var i=this.findHighlightableChoices(),n=this.highlight();n>-1&&n<i.length;){n+=t;var r=e(i[n]);if(r.hasClass("select2-result-selectable")&&!r.hasClass("select2-disabled")&&!r.hasClass("select2-selected")){this.highlight(n);break}}},highlight:function(t){var i,n,s=this.findHighlightableChoices();return 0===arguments.length?r(s.filter(".select2-highlighted")[0],s.get()):(t>=s.length&&(t=s.length-1),t<0&&(t=0),this.removeHighlight(),i=e(s[t]),i.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",i.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(i.text()),n=i.data("select2-data"),void(n&&this.opts.element.trigger({type:"select2-highlight",val:this.id(n),choice:n})))},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var i=e(t.target).closest(".select2-result-selectable");if(i.length>0&&!i.is(".select2-highlighted")){var n=this.findHighlightableChoices();this.highlight(n.index(i))}else 0==i.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e,t=this.results,i=t.find("li.select2-more-results"),n=this.resultsPage+1,r=this,s=this.search.val(),o=this.context;0!==i.length&&(e=i.offset().top-t.offset().top-t.height(),e<=this.opts.loadMorePadding&&(i.addClass("select2-active"),this.opts.query({element:this.opts.element,term:s,page:n,context:o,matcher:this.opts.matcher,callback:this.bind(function(e){r.opened()&&(r.opts.populateResults.call(this,t,e.results,{term:s,page:n,context:o}),r.postprocessResults(e,!1,!1),e.more===!0?(i.detach().appendTo(t).html(r.opts.escapeMarkup(C(r.opts.formatLoadMore,r.opts.element,n+1))),window.setTimeout(function(){r.loadMoreIfNeeded()},10)):i.remove(),r.positionDropdown(),r.resultsPage=n,r.context=e.context,this.opts.element.trigger({type:"select2-loaded",items:e}))})})))},tokenize:function(){},updateResults:function(i){function n(){c.removeClass("select2-active"),h.positionDropdown(),u.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?h.liveRegion.text(u.text()):h.liveRegion.text(h.opts.formatMatches(u.find('.select2-result-selectable:not(".select2-selected")').length))}function r(e){u.html(e),n()}var s,a,l,c=this.search,u=this.results,d=this.opts,h=this,p=c.val(),f=e.data(this.container,"select2-last-term");if((i===!0||!f||!o(p,f))&&(e.data(this.container,"select2-last-term",p),i===!0||this.showSearchInput!==!1&&this.opened())){l=++this.queryCount;var m=this.getMaximumSelectionSize();if(m>=1&&(s=this.data(),e.isArray(s)&&s.length>=m&&T(d.formatSelectionTooBig,"formatSelectionTooBig")))return void r("<li class='select2-selection-limit'>"+C(d.formatSelectionTooBig,d.element,m)+"</li>");if(c.val().length<d.minimumInputLength)return r(T(d.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+C(d.formatInputTooShort,d.element,c.val(),d.minimumInputLength)+"</li>":""),void(i&&this.showSearch&&this.showSearch(!0));if(d.maximumInputLength&&c.val().length>d.maximumInputLength)return void r(T(d.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+C(d.formatInputTooLong,d.element,c.val(),d.maximumInputLength)+"</li>":"");d.formatSearching&&0===this.findHighlightableChoices().length&&r("<li class='select2-searching'>"+C(d.formatSearching,d.element)+"</li>"),c.addClass("select2-active"),this.removeHighlight(),a=this.tokenize(),a!=t&&null!=a&&c.val(a),this.resultsPage=1,d.query({element:d.element,term:c.val(),page:this.resultsPage,context:null,matcher:d.matcher,callback:this.bind(function(s){var a;if(l==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(s.hasError!==t&&T(d.formatAjaxError,"formatAjaxError"))return void r("<li class='select2-ajax-error'>"+C(d.formatAjaxError,d.element,s.jqXHR,s.textStatus,s.errorThrown)+"</li>");if(this.context=s.context===t?null:s.context,this.opts.createSearchChoice&&""!==c.val()&&(a=this.opts.createSearchChoice.call(h,c.val(),s.results),a!==t&&null!==a&&h.id(a)!==t&&null!==h.id(a)&&0===e(s.results).filter(function(){return o(h.id(this),h.id(a))}).length&&this.opts.createSearchChoicePosition(s.results,a)),0===s.results.length&&T(d.formatNoMatches,"formatNoMatches"))return void r("<li class='select2-no-results'>"+C(d.formatNoMatches,d.element,c.val())+"</li>");u.empty(),h.opts.populateResults.call(this,u,s.results,{term:c.val(),page:this.resultsPage,context:null}),s.more===!0&&T(d.formatLoadMore,"formatLoadMore")&&(u.append("<li class='select2-more-results'>"+d.escapeMarkup(C(d.formatLoadMore,d.element,this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(s,i),n(),this.opts.element.trigger({type:"select2-loaded",items:s})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){p(this.search)},selectHighlighted:function(e){if(this._touchMoved)return void this.clearTouchMoved();var t=this.highlight(),i=this.results.find(".select2-highlighted"),n=i.closest(".select2-result").data("select2-data");n?(this.highlight(t),this.onSelect(n,e)):e&&e.noFocus&&this.close()},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==t?e.text():t)},getPlaceholderOption:function(){if(this.select){var i=this.select.children("option").first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&i||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===e.trim(i.text())&&""===i.val())return i}},initContainerWidth:function(){function i(){var i,n,r,s,o,a;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(i=this.opts.element.attr("style"),i!==t)for(n=i.split(";"),s=0,o=n.length;s<o;s+=1)if(a=n[s].replace(/\s/g,""),r=a.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==r&&r.length>=1)return r[1];return"resolve"===this.opts.width?(i=this.opts.element.css("width"),i.indexOf("%")>0?i:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var n=i.call(this);null!==n&&this.container.css("width",n)}}),H=M(x,{createContainer:function(){var t=e(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <label for='' class='select2-offscreen'></label>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'","       aria-autocomplete='list' />","   </div>","   <ul class='select2-results' role='listbox'>","   </ul>","</div>"].join(""));return t},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var i,n,r;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),i=this.search.get(0),i.createTextRange?(n=i.createTextRange(),n.collapse(!1),n.select()):i.setSelectionRange&&(r=this.search.val().length,i.setSelectionRange(r,r))),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),D.call(this,"selection","focusser")},initContainer:function(){var t,n,r=this.container,s=this.dropdown,o=P();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=r.find(".select2-choice"),this.focusser=r.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+o),this.focusser.attr("aria-labelledby","select2-chosen-"+o),this.results.attr("id","select2-results-"+o),this.search.attr("aria-owns","select2-results-"+o),this.focusser.attr("id","s2id_autogen"+o),n=e("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(n.text()).attr("for",this.focusser.attr("id"));var a=this.opts.element.attr("title");this.opts.element.attr("title",a||n.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(e("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode){if(e.which===N.PAGE_UP||e.which===N.PAGE_DOWN)return void m(e);switch(e.which){case N.UP:case N.DOWN:return this.moveHighlight(e.which===N.UP?-1:1),void m(e);case N.ENTER:return this.selectHighlighted(),void m(e);case N.TAB:return void this.selectHighlighted({noFocus:!0});case N.ESC:return this.cancel(e),void m(e)}}})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==N.TAB&&!N.isControl(e)&&!N.isFunctionKey(e)&&e.which!==N.ESC){if(this.opts.openOnEnter===!1&&e.which===N.ENTER)return void m(e);if(e.which==N.DOWN||e.which==N.UP||e.which==N.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void m(e)}return e.which==N.DELETE||e.which==N.BACKSPACE?(this.opts.allowClear&&this.clear(),void m(e)):void 0}})),c(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),g(e),this.close(),this.selection&&this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(n){i(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),m(n)})),s.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){m(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(t){var i=this.selection.data("select2-data");if(i){var n=e.Event("select2-clearing");if(this.opts.element.trigger(n),n.isDefaultPrevented())return;var r=this.getPlaceholderOption();this.opts.element.val(r?r.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),t!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.setPlaceholder(),e.nextSearchTerm=e.opts.nextSearchTerm(i,e.search.val()))})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()!==t&&((e=this.getPlaceholderOption())!==t&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val());
},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=e.find("option").filter(function(){return this.selected&&!this.disabled});t(i.optionToData(n))}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var r=i.val(),s=null;t.query({matcher:function(e,i,n){var a=o(r,t.id(n));return a&&(s=n),a},callback:e.isFunction(n)?function(){n(s)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,i){var n=0,r=this;if(this.findHighlightableChoices().each2(function(e,t){if(o(r.id(t.data("select2-data")),r.opts.element.val()))return n=e,!1}),i!==!1&&(t===!0&&n>=0?this.highlight(n):this.highlight(0)),t===!0){var s=this.opts.minimumResultsForSearch;s>=0&&this.showSearch(w(e.results)>=s)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var i=this.opts.element.val(),n=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),o(i,this.id(e))||this.triggerChange({added:e,removed:n})}},updateSelection:function(e){var i,n,r=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),r.empty(),null!==e&&(i=this.opts.formatSelection(e,r,this.opts.escapeMarkup)),i!==t&&r.append(i),n=this.opts.formatSelectionCssClass(e,r),n!==t&&r.addClass(n),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,i=!1,n=null,r=this,s=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(i=arguments[1]),this.select)this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return n=r.optionToData(t),!1}),this.updateSelection(n),this.setPlaceholder(),i&&this.triggerChange({added:n,removed:s});else{if(!e&&0!==e)return void this.clear(i);if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){r.opts.element.val(e?r.id(e):""),r.updateSelection(e),r.setPlaceholder(),i&&r.triggerChange({added:e,removed:s})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var i,n=!1;return 0===arguments.length?(i=this.selection.data("select2-data"),i==t&&(i=null),i):(arguments.length>1&&(n=arguments[1]),void(e?(i=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),n&&this.triggerChange({added:e,removed:i})):this.clear(n)))}}),X=M(x,{createContainer:function(){var t=e(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <label for='' class='select2-offscreen'></label>","    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var n=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){n.push(i.optionToData(t))}),t(n)}:"data"in t&&(t.initSelection=t.initSelection||function(i,n){var r=a(i.val(),t.separator,t.transformVal),s=[];t.query({matcher:function(i,n,a){var l=e.grep(r,function(e){return o(e,t.id(a))}).length;return l&&s.push(a),l},callback:e.isFunction(n)?function(){for(var e=[],i=0;i<r.length;i++)for(var a=r[i],l=0;l<s.length;l++){var c=s[l];if(o(a,t.id(c))){e.push(c),s.splice(l,1);break}}n(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){e("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),D.call(this,"searchContainer","selection")},initContainer:function(){var t,i=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(i);var n=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(t){n.search[0].focus(),n.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+P()),this.search.prev().text(e("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.focus(this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var i=t.find(".select2-search-choice-focus"),n=i.prev(".select2-search-choice:not(.select2-locked)"),r=i.next(".select2-search-choice:not(.select2-locked)"),s=f(this.search);if(i.length&&(e.which==N.LEFT||e.which==N.RIGHT||e.which==N.BACKSPACE||e.which==N.DELETE||e.which==N.ENTER)){var o=i;return e.which==N.LEFT&&n.length?o=n:e.which==N.RIGHT?o=r.length?r:null:e.which===N.BACKSPACE?this.unselect(i.first())&&(this.search.width(10),o=n.length?n:r):e.which==N.DELETE?this.unselect(i.first())&&(this.search.width(10),o=r.length?r:null):e.which==N.ENTER&&(o=null),this.selectChoice(o),m(e),void(o&&o.length||this.open())}if((e.which===N.BACKSPACE&&1==this.keydowns||e.which==N.LEFT)&&0==s.offset&&!s.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void m(e);if(this.selectChoice(null),this.opened())switch(e.which){case N.UP:case N.DOWN:return this.moveHighlight(e.which===N.UP?-1:1),void m(e);case N.ENTER:return this.selectHighlighted(),void m(e);case N.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case N.ESC:return this.cancel(e),void m(e)}if(e.which!==N.TAB&&!N.isControl(e)&&!N.isFunctionKey(e)&&e.which!==N.BACKSPACE&&e.which!==N.ESC){if(e.which===N.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),e.which!==N.PAGE_UP&&e.which!==N.PAGE_DOWN||m(e),e.which===N.ENTER&&m(e)}}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("click",i,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",i,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),i=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.search.width(i>0?i:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var i=[],n=[],s=this;e(t).each(function(){r(s.id(this),i)<0&&(i.push(s.id(this)),n.push(this))}),t=n,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){s.addSelectedChoice(this)}),s.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts),null!=e&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,i){this.triggerSelect(e)&&""!==e.text&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.clearSearch(),this.updateResults(),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),i&&i.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(i){var n,r,s=!i.locked,o=e("<li class='select2-search-choice'>    <div></div>    <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),a=e("<li class='select2-search-choice select2-locked'><div></div></li>"),l=s?o:a,c=this.id(i),u=this.getVal();n=this.opts.formatSelection(i,l.find("div"),this.opts.escapeMarkup),n!=t&&l.find("div").replaceWith(e("<div></div>").html(n)),r=this.opts.formatSelectionCssClass(i,l.find("div")),r!=t&&l.addClass(r),s&&l.find(".select2-search-choice-close").on("mousedown",m).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),m(t),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),l.data("select2-data",i),l.insertBefore(this.searchContainer),u.push(c),this.setVal(u)},unselect:function(t){var i,n,s=this.getVal();if(t=t.closest(".select2-search-choice"),0===t.length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(i=t.data("select2-data")){var o=e.Event("select2-removing");if(o.val=this.id(i),o.choice=i,this.opts.element.trigger(o),o.isDefaultPrevented())return!1;for(;(n=r(this.id(i),s))>=0;)s.splice(n,1),this.setVal(s),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}),!0}},postprocessResults:function(e,t,i){var n=this.getVal(),s=this.results.find(".select2-result"),o=this.results.find(".select2-result-with-children"),a=this;s.each2(function(e,t){var i=a.id(t.data("select2-data"));r(i,n)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),o.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),this.highlight()==-1&&i!==!1&&this.opts.closeOnSelect===!0&&a.highlight(0),!this.opts.createSearchChoice&&!s.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&T(a.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+C(a.opts.formatNoMatches,a.opts.element,a.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-l(this.search)},resizeSearch:function(){var e,t,i,n,r,s=l(this.search);e=v(this.search)+10,t=this.search.offset().left,i=this.selection.width(),n=this.selection.offset().left,r=i-(t-n)-s,r<e&&(r=i-s),r<40&&(r=i-s),r<=0&&(r=e),this.search.width(Math.floor(r))},getVal:function(){var e;return this.select?(e=this.select.val(),null===e?[]:e):(e=this.opts.element.val(),a(e,this.opts.separator,this.opts.transformVal))},setVal:function(t){var i;this.select?this.select.val(t):(i=[],e(t).each(function(){r(this,i)<0&&i.push(this)}),this.opts.element.val(0===i.length?"":i.join(this.opts.separator)))},buildChangeDetails:function(e,t){for(var t=t.slice(0),e=e.slice(0),i=0;i<t.length;i++)for(var n=0;n<e.length;n++)o(this.opts.id(t[i]),this.opts.id(e[n]))&&(t.splice(i,1),i>0&&i--,e.splice(n,1),n--);return{added:t,removed:e}},val:function(i,n){var r,s=this;if(0===arguments.length)return this.getVal();if(r=this.data(),r.length||(r=[]),!i&&0!==i)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(n&&this.triggerChange({added:this.data(),removed:r}));if(this.setVal(i),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),n&&this.triggerChange(this.buildChangeDetails(r,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var i=e.map(t,s.id);s.setVal(i),s.updateSelection(t),s.clearSearch(),n&&s.triggerChange(s.buildChangeDetails(r,s.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],i=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(i.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,i){var n,r,s=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get():(r=this.data(),t||(t=[]),n=e.map(t,function(e){return s.opts.id(e)}),this.setVal(n),this.updateSelection(t),this.clearSearch(),i&&this.triggerChange(this.buildChangeDetails(r,this.data())),void 0)}}),e.fn.select2=function(){var i,n,s,o,a,l=Array.prototype.slice.call(arguments,0),c=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],u=["opened","isFocused","container","dropdown"],d=["val","data"],h={search:"externalSearch"};return this.each(function(){if(0===l.length||"object"==typeof l[0])i=0===l.length?{}:e.extend({},l[0]),i.element=e(this),"select"===i.element.get(0).tagName.toLowerCase()?a=i.element.prop("multiple"):(a=i.multiple||!1,"tags"in i&&(i.multiple=a=!0)),n=a?new window.Select2.class.multi:new window.Select2.class.single,n.init(i);else{if("string"!=typeof l[0])throw"Invalid arguments to select2 plugin: "+l;if(r(l[0],c)<0)throw"Unknown method: "+l[0];if(o=t,n=e(this).data("select2"),n===t)return;if(s=l[0],"container"===s?o=n.container:"dropdown"===s?o=n.dropdown:(h[s]&&(s=h[s]),o=n[s].apply(n,l.slice(1))),r(l[0],u)>=0||r(l[0],d)>=0&&1==l.length)return!1}}),o===t?this:o},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,i,n){var r=[];return y(this.text(e),i.term,r,n),r.join("")},transformVal:function(t){return e.trim(t)},formatSelection:function(e,i,n){return e?n(this.text(e)):t},sortResults:function(e,t,i){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(e,i){return t},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==t?null:e.id},text:function(t){return t&&this.data&&this.data.text?e.isFunction(this.data.text)?this.data.text(t):t[this.data.text]:t.text},matcher:function(e,t){return n(""+t).toUpperCase().indexOf(n(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:Z,escapeMarkup:Y,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null},nextSearchTerm:function(e,i){return t},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){var t="ontouchstart"in window||navigator.msMaxTouchPoints>0;return!t||!(e.opts.minimumResultsForSearch<0)}},e.fn.select2.locales=[],e.fn.select2.locales.en={formatMatches:function(e){return 1===e?"One result is available, press enter to select it.":e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(e,t,i){return"Loading failed"},formatInputTooShort:function(e,t){var i=t-e.length;return"Please enter "+i+" or more character"+(1==i?"":"s")},formatInputTooLong:function(e,t){var i=e.length-t;return"Please delete "+i+" character"+(1==i?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(e){return"Loading more results…"},formatSearching:function(){return"Searching…"}},e.extend(e.fn.select2.defaults,e.fn.select2.locales.en),e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:b,local:L,tags:S},util:{debounce:d,markMatch:y,escapeMarkup:Y,stripDiacritics:n},class:{abstract:x,single:H,multi:X}}}}(jQuery),define("select2",function(){}),function(e){"function"==typeof define&&define.amd?define("jquery.ui.tabs",["jquery"],e):e(jQuery)}(function(e){function t(t,n){var r,s,o,a=t.nodeName.toLowerCase();return"area"===a?(r=t.parentNode,s=r.name,!(!t.href||!s||"map"!==r.nodeName.toLowerCase())&&(o=e("img[usemap='#"+s+"']")[0],!!o&&i(o))):(/^(input|select|textarea|button|object)$/.test(a)?!t.disabled:"a"===a?t.href||n:n)&&i(t)}function i(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}e.ui=e.ui||{},e.extend(e.ui,{version:"1.11.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({scrollParent:function(t){var i=this.css("position"),n="absolute"===i,r=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return(!n||"static"!==t.css("position"))&&r.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==i&&s.length?s:e(this[0].ownerDocument||document)},uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(i){return t(i,!isNaN(e.attr(i,"tabindex")))},tabbable:function(i){var n=e.attr(i,"tabindex"),r=isNaN(n);return(r||n>=0)&&t(i,!r)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function n(t,i,n,s){return e.each(r,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var r="Width"===i?["Left","Right"]:["Top","Bottom"],s=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(s,n(this,t)+"px")})},e.fn["outer"+i]=function(t,r){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(s,n(this,t,!0,r)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,n,r=e(this[0]);r.length&&r[0]!==document;){if(i=r.css("position"),("absolute"===i||"relative"===i||"fixed"===i)&&(n=parseInt(r.css("zIndex"),10),!isNaN(n)&&0!==n))return n;r=r.parent()}return 0}}),e.ui.plugin={add:function(t,i,n){var r,s=e.ui[t].prototype;for(r in n)s.plugins[r]=s.plugins[r]||[],s.plugins[r].push([i,n[r]])},call:function(e,t,i,n){var r,s=e.plugins[t];if(s&&(n||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(r=0;r<s.length;r++)e.options[s[r][0]]&&s[r][1].apply(e.element,i)}};var n=0,r=Array.prototype.slice;e.cleanData=function(t){return function(i){var n,r,s;for(s=0;null!=(r=i[s]);s++)try{n=e._data(r,"events"),n&&n.remove&&e(r).triggerHandler("remove")}catch(e){}t(i)}}(e.cleanData),e.widget=function(t,i,n){var r,s,o,a,l={},c=t.split(".")[0];return t=t.split(".")[1],r=c+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[c]=e[c]||{},s=e[c][t],o=e[c][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new o(e,t)},e.extend(o,s,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),a=new i,a.options=e.widget.extend({},a.options),e.each(n,function(t,n){return e.isFunction(n)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},r=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,s=this._superApply;return this._super=e,this._superApply=r,t=n.apply(this,arguments),this._super=i,this._superApply=s,t}}()):void(l[t]=n)}),o.prototype=e.widget.extend(a,{widgetEventPrefix:s?a.widgetEventPrefix||t:t},l,{constructor:o,namespace:c,widgetName:t,widgetFullName:r}),s?(e.each(s._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete s._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var i,n,s=r.call(arguments,1),o=0,a=s.length;o<a;o++)for(i in s[o])n=s[o][i],s[o].hasOwnProperty(i)&&void 0!==n&&(e.isPlainObject(n)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],n):e.widget.extend({},n):t[i]=n);return t},e.widget.bridge=function(t,i){var n=i.prototype.widgetFullName||t;e.fn[t]=function(s){var o="string"==typeof s,a=r.call(arguments,1),l=this;return o?this.each(function(){var i,r=e.data(this,n);return"instance"===s?(l=r,!1):r?e.isFunction(r[s])&&"_"!==s.charAt(0)?(i=r[s].apply(r,a),i!==r&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+s+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+s+"'")}):(a.length&&(s=e.widget.extend.apply(null,[s].concat(a))),this.each(function(){var t=e.data(this,n);t?(t.option(s||{}),t._init&&t._init()):e.data(this,n,new i(s,this))})),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,r,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},n=t.split("."),t=n.shift(),n.length){for(r=o[t]=e.widget.extend({},this.options[t]),s=0;s<n.length-1;s++)r[n[s]]=r[n[s]]||{},r=r[n[s]];if(t=n.pop(),1===arguments.length)return void 0===r[t]?null:r[t];r[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,n){var r,s=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=r=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,r=this.widget()),e.each(n,function(n,o){function a(){if(t||s.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof o?s[o]:o).apply(s,arguments)}"string"!=typeof o&&(a.guid=o.guid=o.guid||a.guid||e.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+s.eventNamespace,u=l[2];u?r.delegate(u,c,a):i.bind(c,a)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,n){var r,s,o=this.options[t];if(n=n||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],s=i.originalEvent)for(r in s)r in i||(i[r]=s[r]);return this.element.trigger(i,n),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,r,s){"string"==typeof r&&(r={effect:r});var o,a=r?r===!0||"number"==typeof r?i:r.effect||i:t;r=r||{},"number"==typeof r&&(r={duration:r}),o=!e.isEmptyObject(r),r.complete=s,r.delay&&n.delay(r.delay),o&&e.effects&&e.effects.effect[a]?n[t](r):a!==t&&n[a]?n[a](r.duration,r.easing,s):n.queue(function(i){e(this)[t](),s&&s.call(n[0]),i()})}});e.widget,e.widget("ui.tabs",{version:"1.11.3",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var i,n;t=t.cloneNode(!1),i=t.href.replace(e,""),n=location.href.replace(e,"");try{i=decodeURIComponent(i)}catch(e){}try{n=decodeURIComponent(n)}catch(e){}return t.hash.length>1&&i===n}}(),_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(i.active):this.active=e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===t&&(n&&this.tabs.each(function(i,r){if(e(r).attr("aria-controls")===n)return t=i,!1}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==t&&t!==-1||(t=!!this.tabs.length&&0)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),t===-1&&(t=!i&&0)),!i&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),n=this.tabs.index(i),r=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:n++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:r=!1,n--;break;case e.ui.keyCode.END:n=this.anchors.length-1;break;case e.ui.keyCode.HOME:n=0;break;case e.ui.keyCode.SPACE:
return t.preventDefault(),clearTimeout(this.activating),void this._activate(n);case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n!==this.options.active&&n);default:return}t.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,r),t.ctrlKey||t.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){function n(){return t>r&&(t=0),t<0&&(t=r),t}for(var r=this.tabs.length-1;e.inArray(n(),this.options.disabled)!==-1;)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?void this._activate(t):"disabled"===e?void this._setupDisabled(t):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),void("heightStyle"===e&&this._setupHeightStyle(t)))},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,i=this.tabs,n=this.anchors,r=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,n){var r,s,o,a=e(n).uniqueId().attr("id"),l=e(n).closest("li"),c=l.attr("aria-controls");t._isLocal(n)?(r=n.hash,o=r.substring(1),s=t.element.find(t._sanitizeSelector(r))):(o=l.attr("aria-controls")||e({}).uniqueId()[0].id,r="#"+o,s=t.element.find(r),s.length||(s=t._createPanel(o),s.insertAfter(t.panels[i-1]||t.tablist)),s.attr("aria-live","polite")),s.length&&(t.panels=t.panels.add(s)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":o,"aria-labelledby":a}),s.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),i&&(this._off(i.not(this.tabs)),this._off(n.not(this.anchors)),this._off(r.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,n=0;i=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,n=this.element.parent();"fill"===t?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,n=this.active,r=e(t.currentTarget),s=r.closest("li"),o=s[0]===n[0],a=o&&i.collapsible,l=a?e():this._getPanelForTab(s),c=n.length?this._getPanelForTab(n):e(),u={oldTab:n,oldPanel:c,newTab:a?e():s,newPanel:l};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",t,u)===!1||(i.active=!a&&this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),c.length||l.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(s),t),this._toggle(t,u))},_toggle:function(t,i){function n(){s.running=!1,s._trigger("activate",t,i)}function r(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&s.options.show?s._show(o,s.options.show,n):(o.show(),n())}var s=this,o=i.newPanel,a=i.oldPanel;this.running=!0,a.length&&this.options.hide?this._hide(a,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),a.hide(),r()),a.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&a.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var i,n=this._findActive(t);n[0]!==this.active[0]&&(n.length||(n=this.active),i=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;i!==!1&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(i!==!0){if(void 0===t)i=!0;else{if(t=this._getIndex(t),e.inArray(t,i)!==-1)return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var n=this,r=this.tabs.eq(t),s=r.find(".ui-tabs-anchor"),o=this._getPanelForTab(r),a={tab:r,panel:o};this._isLocal(s[0])||(this.xhr=e.ajax(this._ajaxSettings(s,i,a)),this.xhr&&"canceled"!==this.xhr.statusText&&(r.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){o.html(e),n._trigger("load",i,a)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&n.panels.stop(!1,!0),r.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(t,i,n){var r=this;return{url:t.attr("href"),beforeSend:function(t,s){return r._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:s},n))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}),define("sysadmin-app/views/folder-share-item",["jquery","underscore","backbone","common"],function(e,t,i,n){"use strict";var r=i.View.extend({tagName:"tr",template:t.template(e("#folder-perm-item-tmpl").html()),initialize:function(e){this.item_data=e.item_data,this.repo_id=e.repo_id,this.render()},render:function(){return this.$el.html(this.template(this.item_data)),this},events:{mouseenter:"showOpIcons",mouseleave:"hideOpIcons","click .perm-edit-icon":"editIconClick","change .perm-toggle-select":"editPerm","click .delete-icon":"del"},showOpIcons:function(){this.$el.find(".op-icon").removeClass("vh")},hideOpIcons:function(){this.$el.find(".op-icon").addClass("vh")},editIconClick:function(t){return e(t.currentTarget).closest("td").find(".perm").addClass("hide").end().find(".perm-toggle-select").removeClass("hide"),!1},editPerm:function(t){var i,r=this,s=this.item_data,o=e(t.currentTarget).val(),a=n.getUrl({name:"admin_shares"});i=s.for_user?{repo_id:r.repo_id,share_type:"user",permission:o,share_to:s.user_email}:{repo_id:r.repo_id,share_type:"group",permission:o,share_to:s.group_id},e.ajax({url:a,dataType:"json",method:"PUT",beforeSend:n.prepareCSRFToken,data:i,success:function(e){s.permission=e.permission,r.render()},error:function(t){var i;if(t.responseText){var r=e.parseJSON(t.responseText);i=r.error||r.error_msg,i=n.HTMLescape(i)}else i=gettext("Failed. Please check the network.");s.for_user?e("#dir-user-share .error").html(i).removeClass("hide"):e("#dir-group-share .error").html(i).removeClass("hide")}})},del:function(){var t,i=this,r=this.item_data,s=n.getUrl({name:"admin_shares"});return t=r.for_user?{repo_id:i.repo_id,share_type:"user",permission:r.permission,share_to:r.user_email}:{repo_id:i.repo_id,share_type:"group",permission:r.permission,share_to:r.group_id},e.ajax({url:s,dataType:"json",method:"DELETE",beforeSend:n.prepareCSRFToken,data:t,success:function(){i.remove()},error:function(t){var i;if(t.responseText){var s=e.parseJSON(t.responseText);i=s.error||s.error_msg,i=n.HTMLescape(i)}else i=gettext("Failed. Please check the network.");r.for_user?e("#dir-user-share .error").html(i).removeClass("hide"):e("#dir-group-share .error").html(i).removeClass("hide")}}),!1}});return r}),define("sysadmin-app/views/share",["jquery","underscore","backbone","common","sysadmin-app/views/folder-share-item"],function(e,t,i,n,r){"use strict";var s=i.View.extend({tagName:"div",id:"share-popup",template:t.template(e("#share-popup-tmpl").html()),initialize:function(t){this.repo_id=t.repo_id,this.repo_name=t.repo_name,this.render(),this.$el.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.$("#share-tabs").tabs(),this.dirUserSharePanelInit(),this.dirGroupSharePanelInit();var i=this;e(document).on("click",function(e){var t=e.target||event.srcElement;i.$(".perm-edit-icon, .perm-toggle-select").is(t)||(i.$(".perm").removeClass("hide"),i.$(".perm-toggle-select").addClass("hide"))})},render:function(){return this.$el.html(this.template({title:gettext("Share {placeholder}").replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(this.repo_name)+'">'+n.HTMLescape(this.repo_name)+"</span>"),repo_id:this.repo_id})),this},events:{"click #add-dir-user-share-item .submit":"dirUserShare","click #add-dir-group-share-item .submit":"dirGroupShare"},dirUserSharePanelInit:function(){var t=this.$("#dir-user-share"),i=this.$("#add-dir-user-share-item"),s=this.repo_id;e('[name="emails"]',t).select2(e.extend({},n.contactInputOptionsForSelect2())),n.ajaxGet({get_url:n.getUrl({name:"admin_shares"}),data:{repo_id:s,share_type:"user"},after_op_success:function(t){e(t).each(function(e,t){var n=new r({repo_id:s,item_data:{user_email:t.user_email,user_name:t.user_name,permission:t.permission,for_user:!0}});i.after(n.el)})}}),t.removeClass("hide"),this.$(".loading-tip").hide()},dirGroupSharePanelInit:function(){var t=this.$("#dir-group-share"),i=this.$("#add-dir-group-share-item"),s=this.repo_id;e('[name="groups"]',t).select2(e.extend({},n.groupInputOptionsForSelect2())),n.ajaxGet({get_url:n.getUrl({name:"admin_shares"}),data:{repo_id:s,share_type:"group"},after_op_success:function(t){e(t).each(function(e,t){var n=new r({repo_id:s,item_data:{group_id:t.group_id,group_name:t.group_name,permission:t.permission,for_user:!1}});i.after(n.el)})}}),t.removeClass("hide"),this.$(".loading-tip").hide()},dirUserShare:function(){var t=this.$("#add-dir-user-share-item"),i=e('[name="emails"]',t),s=i.val(),o=e('[name="permission"]',t),a=o.val();if(!s||!a)return!1;var l=this.repo_id,c=e('[type="submit"]',t),u=e("#dir-user-share .error");n.disableButton(c),e.ajax({url:n.getUrl({name:"admin_shares"}),dataType:"json",method:"POST",beforeSend:n.prepareCSRFToken,traditional:!0,data:{repo_id:l,share_type:"user",share_to:s.split(","),permission:a},success:function(s){if(s.success.length>0&&(e(s.success).each(function(e,i){var n=new r({repo_id:l,item_data:{user_email:i.user_email,user_name:i.user_name,permission:i.permission,for_user:!0}});t.after(n.el)}),i.select2("val",""),e('[value="rw"]',o).attr("selected","selected"),e('[value="r"]',o).removeAttr("selected"),u.addClass("hide")),s.failed.length>0){var a="";e(s.failed).each(function(e,t){a+=n.HTMLescape(t.user_email)+": "+n.HTMLescape(t.error_msg)+"<br />"}),u.html(a).removeClass("hide")}},error:function(t){var i;i=t.responseText?n.HTMLescape(e.parseJSON(t.responseText).error_msg):gettext("Failed. Please check the network."),u.html(i).removeClass("hide")},complete:function(){n.enableButton(c)}})},dirGroupShare:function(){var t=this.$("#add-dir-group-share-item"),i=e('[name="groups"]',t),s=i.val(),o=e('[name="permission"]',t),a=o.val();if(!s||!a)return!1;var l=this.repo_id,c=e("#dir-group-share .error"),u=e('[type="submit"]',t);n.disableButton(u),e.ajax({url:n.getUrl({name:"admin_shares"}),dataType:"json",method:"POST",beforeSend:n.prepareCSRFToken,traditional:!0,data:{repo_id:l,share_type:"group",share_to:s.split(","),permission:a},success:function(s){if(s.success.length>0&&(e(s.success).each(function(e,i){var n=new r({repo_id:l,item_data:{group_id:i.group_id,group_name:i.group_name,permission:i.permission,for_user:!1}});t.after(n.el)}),i.select2("val",""),e('[value="rw"]',o).attr("selected","selected"),e('[value="r"]',o).removeAttr("selected"),c.addClass("hide")),s.failed.length>0){var a="";e(s.failed).each(function(e,t){a+=n.HTMLescape(t.group_id)+": "+n.HTMLescape(t.error_msg)+"<br />"}),c.html(a).removeClass("hide")}},error:function(t){var i;i=t.responseText?n.HTMLescape(e.parseJSON(t.responseText).error_msg):gettext("Failed. Please check the network."),c.html(i).removeClass("hide")},complete:function(){n.enableButton(u)}})}});return s}),define("app/views/dialogs/repo-history-settings",["jquery","underscore","backbone","common"],function(e,t,i,n){"use strict";var r=i.View.extend({template:t.template(e("#history-settings-dialog-tmpl").html()),initialize:function(t){this.repo_name=t.repo_name,this.repo_id=t.repo_id,this.url_name=t.url_name,this.render(),this.$(".op-target").css({"max-width":280}),this.$el.modal(),e("#simplemodal-container").css({height:"auto"}),this.$loadingTip=this.$(".loading-tip"),this.$error=this.$(".error"),this.$form=this.$("form"),this.$radios=this.$("input:radio[name=history]"),this.$days_input=this.$("input:text[name=days]"),this.$submit=this.$("[type=submit]"),this.renderHistorySettings()},render:function(){var e=this.repo_name;return this.$el.html(this.template({title:gettext("{placeholder} History Setting").replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(e)+'">'+n.HTMLescape(e)+"</span>"),default_history_limit:30})),this},renderHistorySettings:function(){var t=this;e.ajax({url:n.getUrl({name:this.url_name,repo_id:this.repo_id}),type:"get",dataType:"json",success:function(e){t.$loadingTip.hide(),e.keep_days<=-1?t.$radios.filter("[value=full_history]").prop("checked",!0):0==e.keep_days?t.$radios.filter("[value=no_history]").prop("checked",!0):(t.$radios.filter("[value=partial_history]").prop("checked",!0),t.$days_input.prop("disabled",!1).removeClass("input-disabled"),t.$days_input.attr("value",e.keep_days)),t.$radios.filter(":checked").focus(),app.pageOptions.enable_repo_history_setting||(t.$(".history-settings-notice").removeClass("hide"),t.$radios.prop("disabled",!0),t.$days_input.prop("disabled",!0).addClass("input-disabled"),t.$submit.prop("disabled",!0).addClass("btn-disabled"))},error:function(i){var n;n=i.responseText?e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),t.$error.html(n).show()}})},events:{'change [name="history"]':"changeHistorySetting","submit form":"formSubmit"},changeHistorySetting:function(t){var i=e(t.currentTarget).val(),n=this.$days_input;"full_history"==i||"no_history"==i?n.prop("disabled",!0).addClass("input-disabled"):n.prop("disabled",!1).removeClass("input-disabled")},formSubmit:function(){var t,i=this.$radios.filter(":checked").val(),r=this;return t="partial_history"==i?this.$days_input.val():"full_history"==i?-1:0,this.$submit.prop("disabled",!0),e.ajax({url:n.getUrl({name:this.url_name,repo_id:this.repo_id}),type:"put",dataType:"json",beforeSend:n.prepareCSRFToken,data:{keep_days:t},success:function(){e.modal.close(),n.feedback(gettext("Successfully set library history."),"success")},error:function(t){var i;i=t.responseText?e.parseJSON(t.responseText).error_msg:gettext("Failed. Please check the network."),r.$error.html(i).show(),n.enableButton(r.$submit)}}),!1}});return r}),define("app/views/widgets/dropdown",["jquery","underscore","backbone","common"],function(e,t,i,n){"use strict";e(document).click(function(e){var t=app.ui.currentDropdown,i=e.target||event.srcElement;return!t||(t.$(".sf-dropdown-menu").is(i)||t.$(".sf-dropdown-menu").find("*").is(i)||(t.hide(),app.ui.currentHighlightedItem&&app.ui.currentHighlightedItem.rmHighlight()),!0)}),e(document).keydown(function(e){if(27==e.keyCode){var t=app.ui.currentDropdown;t&&(t.hide(),app.ui.currentHighlightedItem&&app.ui.currentHighlightedItem.rmHighlight())}});var r=i.View.extend({defaultOptions:{left:"0px"},initialize:function(e){this.$el.on("click",".sf-dropdown-toggle",t.bind(this.toggleDropdown,this)),this.$el.on("keydown",t.bind(this.handleKeydown,this)),this.options={},t.extend(this.options,this.defaultOptions,e)},hide:function(){app.ui.currentDropdown=null,this.$(".sf-dropdown-menu").addClass("hide").removeAttr("style")},show:function(){var t=this.$(".sf-dropdown-toggle"),i=this.$(".sf-dropdown-menu");app.ui.currentDropdown=this,void 0!=this.options.right?i.css("right",this.options.right):i.css("left",this.options.left),t.offset().top+t.outerHeight(!0)+i.outerHeight(!0)>e(window).scrollTop()+e(window).height()&&i.css({bottom:t.outerHeight(!0)+4}),this.$(".sf-dropdown-menu").removeClass("hide")},toggleDropdown:function(){return app.ui.currentDropdown&&app.ui.currentDropdown!=this&&app.ui.currentDropdown.hide(),this.$(".sf-dropdown-menu").is(":hidden")?this.show():this.hide(),!1},handleKeydown:function(t){if(/(38|40)/.test(t.which)){t.preventDefault(),t.stopPropagation();var i=e.makeArray(this.$el.find("li a"));if(i.length){var n=i.indexOf(t.target);38===t.which&&n>0&&n--,40===t.which&&n<i.length-1&&n++,i[n].focus()}}}});return r}),define("sysadmin-app/views/repo",["jquery","underscore","backbone","common","moment","simplemodal","select2","jquery.ui.tabs","sysadmin-app/views/share","app/views/dialogs/repo-history-settings","app/views/widgets/hl-item-view","app/views/widgets/dropdown"],function(e,t,i,n,r,s,o,a,l,c,u,d){"use strict";var h=u.extend({tagName:"tr",template:t.template(e("#library-item-tmpl").html()),transferTemplate:t.template(e("#library-transfer-form-tmpl").html()),events:{"click .js-repo-share":"share","click .js-popup-history-setting":"popupHistorySetting","click .repo-delete-btn":"deleteLibrary","click .repo-transfer-btn":"transferLibrary"},share:function(){var e={repo_id:this.model.get("id"),repo_name:this.model.get("name")};return new l(e),this.togglePopup(),!1},popupHistorySetting:function(){var e={repo_name:this.model.get("name"),repo_id:this.model.get("id"),url_name:"admin-library-history-limit"};return this.togglePopup(),new c(e),!1},togglePopup:function(){this.dropdown.hide()},initialize:function(){u.prototype.initialize.call(this),this.listenTo(this.model,"change",this.render)},deleteLibrary:function(){var t=this,i=this.model.get("name"),r=gettext("Delete Library"),s=gettext("Are you sure you want to delete %s ?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-library",repo_id:t.model.get("id")}),type:"DELETE",cache:!1,beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$el.remove(),n.feedback(gettext("Successfully deleted."),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};return n.showConfirm(r,s,o),!1},transferLibrary:function(){var t=this,i=this.model.get("name"),r=e(this.transferTemplate({title:gettext("Transfer Library {library_name} To").replace("{library_name}",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>")}));return r.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),e('[name="email"]',r).select2(e.extend(n.contactInputOptionsForSelect2(),{width:"300px",maximumSelectionSize:1,placeholder:gettext("Search user or enter email and press Enter"),formatSelectionTooBig:gettext("You cannot select any more choices")})),r.submit(function(){var i=e.trim(e('[name="email"]',e(this)).val());if(!i)return!1;if(i==t.model.get("owner"))return!1;var s=n.getUrl({name:"admin-library",repo_id:t.model.get("id")}),o=e('[type="submit"]',e(this));return n.disableButton(o),e.ajax({url:s,type:"put",dataType:"json",beforeSend:n.prepareCSRFToken,data:{owner:i},success:function(){e.modal.close(),t.model.set({owner:i}),n.feedback(gettext("Successfully transferred the library."),"success")},error:function(t){var i;i=t.responseText?e.parseJSON(t.responseText).error_msg:gettext("Failed. Please check the network."),e(".error",r).html(i).show(),n.enableButton(o)}}),!1}),!1},render:function(){var e=this.model.toJSON(),t=n.isHiDPI()?48:24,i=this.model.getIconUrl(t),s=r(e.last_accessed);return e.icon_url=i,e.icon_title=this.model.getIconTitle(),e.enable_sys_admin_view_repo=app.pageOptions.enable_sys_admin_view_repo,e.is_pro=app.pageOptions.is_pro,e.time=s.format("LLLL"),e.time_from_now=n.getRelativeTimeStr(s),this.$el.html(this.template(e)),this.dropdown=new d({el:this.$(".sf-dropdown"),right:0}),this}});return h}),define("sysadmin-app/models/repo",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({getIconUrl:function(e){var t=this.get("encrypted");return i.getLibIconUrl(t,!1,e)},getIconTitle:function(){var e=this.get("encrypted");return i.getLibIconTitle(e,!1)}});return n}),define("sysadmin-app/collection/repos",["underscore","backbone.paginator","common","sysadmin-app/models/repo"],function(e,t,i,n){"use strict";var r=Backbone.PageableCollection.extend({model:n,state:{pageSize:100},parseState:function(e){return e.page_info},parseRecords:function(e){return e.repos},url:function(){return i.getUrl({name:"admin-libraries"})}});return r}),define("sysadmin-app/views/repos",["jquery","underscore","backbone","common","sysadmin-app/views/repo","sysadmin-app/collection/repos"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"libraries",tabNavTemplate:t.template(e("#libraries-tabnav-tmpl").html()),template:t.template(e("#libraries-tmpl").html()),libraryAddFormtemplate:t.template(e("#library-add-form-tmpl").html()),initialize:function(){this.repoCollection=new s,this.listenTo(this.repoCollection,"add",this.addOne),this.listenTo(this.repoCollection,"reset",this.reset),this.render()},render:function(){var t=e(this.tabNavTemplate({cur_tab:"all"}));this.$el.append(t),this.$el.append(this.template()),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$jsPrevious=this.$(".js-previous"),this.$jsNext=this.$(".js-next")},events:{"click .js-add-library":"addLibrary","click #paginator .js-next":"getNextPage","click #paginator .js-previous":"getPreviousPage"},addLibrary:function(){var t=e(this.libraryAddFormtemplate()),i=this.repoCollection;return t.modal(),e("#simplemodal-container").css({height:"auto"}),e('[name="library_owner"]',t).select2(e.extend(n.contactInputOptionsForSelect2(),{width:"268px",containerCss:{"margin-bottom":"5px"},maximumSelectionSize:1,placeholder:gettext("Search user or enter email and press Enter"),formatSelectionTooBig:gettext("You cannot select any more choices")})),t.submit(function(){var r=e.trim(e('[name="library_name"]',t).val()),s=e.trim(e('[name="library_owner"]',t).val()),o=e(".error",t),a=e('[type="submit"]',t);return r?(o.hide(),n.disableButton(a),i.create({name:r,owner:s},{prepend:!0,wait:!0,success:function(){1==i.length&&i.reset(i.models),n.closeModal()},error:function(e,t,i){var r;r=t.responseText?t.responseJSON.error_msg:gettext("Please check the network."),o.html(r).show(),n.enableButton(a)}}),!1):(o.html(gettext("Name is required.")).show(),!1)}),!1},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$jsNext.hide(),this.$jsPrevious.hide()},getNextPage:function(){this.initPage();var e=this.repoCollection.state.current_page;return this.repoCollection.state.has_next_page&&this.repoCollection.getPage(e+1,{reset:!0}),!1},getPreviousPage:function(){this.initPage();var e=this.repoCollection.state.current_page;return e>1&&this.repoCollection.getPage(e-1,{reset:!0}),!1},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.getContent()},getContent:function(){this.initPage();var t=this;this.repoCollection.fetch({data:{page:this.option.page},cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")},complete:function(){t.$loadingTip.hide()}})},reset:function(){var e=this.repoCollection.state.current_page;app.router.navigate("all-libs/?page="+e),this.$loadingTip.hide(),this.repoCollection.length>0?(this.repoCollection.each(this.addOne,this),this.$table.show(),this.renderPaginator()):this.$emptyTip.show()},renderPaginator:function(){this.repoCollection.state.has_next_page?this.$jsNext.show():this.$jsNext.hide();var e=this.repoCollection.state.current_page;e>1?this.$jsPrevious.show():this.$jsPrevious.hide()},addOne:function(e,t,i){var n=new r({model:e});i.prepend?this.$tableBody.prepend(n.render().el):this.$tableBody.append(n.render().el)}});return o}),define("sysadmin-app/collection/search-repos",["underscore","backbone","common","sysadmin-app/models/repo"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,url:function(){return i.getUrl({name:"admin-libraries"})},parse:function(e){return this.search_name=e.name,this.search_owner=e.owner,e.repos}});return r}),define("sysadmin-app/views/search-repos",["jquery","underscore","backbone","common","sysadmin-app/views/repo","sysadmin-app/collection/search-repos"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"search-libraries",template:t.template(e("#search-libraries-tmpl").html()),initialize:function(){this.repoCollection=new s,this.listenTo(this.repoCollection,"add",this.addOne),this.listenTo(this.repoCollection,"reset",this.reset),this.render()},render:function(){this.$el.append(this.template()),this.$form=this.$("#search-repo-form"),this.$name=e('[name="name"]',this.$form),this.$owner=e('[name="owner"]',this.$form),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},events:{"submit #search-repo-form":"formSubmit"},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.getContent(t)},getContent:function(t){this.initPage();var i=this;this.repoCollection.fetch({data:t,cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")},complete:function(){i.$loadingTip.hide()}})},reset:function(){var e=this.repoCollection.search_name,t=this.repoCollection.search_owner;app.router.navigate("#search-libs/?name="+encodeURIComponent(e)+"&owner="+encodeURIComponent(t)),this.$name.val(e),this.$owner.val(t),this.$loadingTip.hide(),this.repoCollection.length>0?(this.repoCollection.each(this.addOne,this),this.$table.show()):this.$emptyTip.show()},addOne:function(e){var t=new r({model:e});this.$tableBody.append(t.render().el)},formSubmit:function(){var t=e.trim(this.$name.val()),i=e.trim(this.$owner.val());return!(!t&&!i)&&(this.getContent({name:t,owner:i}),!1)}});return o}),define("sysadmin-app/models/system-repo",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({});return n}),define("sysadmin-app/views/system-repo",["jquery","underscore","backbone","common","sysadmin-app/models/system-repo"],function(e,t,i,n,r){"use strict";var s=i.View.extend({id:"system-library",tabNavTemplate:t.template(e("#libraries-tabnav-tmpl").html()),template:t.template(e("#system-library-tmpl").html()),itemTemplate:t.template(e("#system-library-item-tmpl").html()),initialize:function(){this.systemRepo=new r,this.render()},render:function(){var t=e(this.tabNavTemplate({cur_tab:"system"}));this.$el.append(t),this.$el.append(this.template()),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip");
},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show()},showSystemLibrary:function(){this.initPage();var t=this;this.systemRepo.fetch({url:n.getUrl({name:"admin-system-library"}),cache:!1,reset:!0,success:function(e,i,n){t.reset()},error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},hide:function(){this.$el.detach()},show:function(){e("#right-panel").html(this.$el),this.showSystemLibrary()},reset:function(){this.$loadingTip.hide(),this.$tableBody.html(this.itemTemplate(this.systemRepo.toJSON())),this.$table.show()}});return s}),define("sysadmin-app/views/trash-repo",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#trash-library-item-tmpl").html()),events:{"click .repo-delete-btn":"deleteTrashLibrary","click .repo-restore-btn":"restoreTrashLibrary"},initialize:function(){s.prototype.initialize.call(this)},deleteTrashLibrary:function(){var t=this,i=this.model.get("name"),r=gettext("Delete Library"),s=gettext("Are you sure you want to delete %s completely?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-trash-library",repo_id:t.model.get("id")}),type:"DELETE",beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$el.remove(),n.feedback(gettext("Success"),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};return n.showConfirm(r,s,o),!1},restoreTrashLibrary:function(){var t=this,i=this.model.get("name"),r=gettext("Restore Library"),s=gettext("Are you sure you want to restore %s?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-trash-library",repo_id:t.model.get("id")}),type:"PUT",beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$el.remove(),n.feedback(gettext("Success"),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};return n.showConfirm(r,s,o),!1},render:function(){var e=this.model.toJSON(),t=n.isHiDPI()?48:24,i=this.model.getIconUrl(t),s=r(e.delete_time);return e.icon_url=i,e.icon_title=this.model.getIconTitle(),e.time=s.format("LLLL"),e.time_from_now=n.getRelativeTimeStr(s),this.$el.html(this.template(e)),this}});return o}),define("sysadmin-app/models/trash-repo",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({getIconUrl:function(e){return i.getLibIconUrl(!1,!1,e)},getIconTitle:function(){return gettext("Read-Write library")}});return n}),define("sysadmin-app/collection/trash-repos",["underscore","backbone.paginator","common","sysadmin-app/models/trash-repo"],function(e,t,i,n){"use strict";var r=Backbone.PageableCollection.extend({model:n,url:function(){return i.getUrl({name:"admin-trash-libraries"})},state:{pageSize:100},parseState:function(e){return e.page_info},parseRecords:function(e){return e.repos}});return r}),define("sysadmin-app/views/trash-repos",["jquery","underscore","backbone","common","moment","sysadmin-app/views/trash-repo","sysadmin-app/collection/trash-repos"],function(e,t,i,n,r,s,o){"use strict";var a=i.View.extend({id:"trash-libraries",tabNavTemplate:t.template(e("#libraries-tabnav-tmpl").html()),template:t.template(e("#trash-libraries-tmpl").html()),initialize:function(){this.trashRepoCollection=new o,this.listenTo(this.trashRepoCollection,"add",this.addOne),this.listenTo(this.trashRepoCollection,"reset",this.reset),this.render()},render:function(){this.$el.html(this.tabNavTemplate({cur_tab:"trash"})+this.template()),this.$tip=this.$(".tip"),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$cleanBtn=this.$(".js-clean"),this.$jsPrevious=this.$(".js-previous"),this.$jsNext=this.$(".js-next")},events:{"click .js-clean":"cleanTrashLibraries","click #paginator .js-next":"getNextPage","click #paginator .js-previous":"getPreviousPage"},cleanTrashLibraries:function(){var t=this,i=gettext("Clear Trash"),r=gettext("Are you sure you want to clear trash?"),s=function(){e.ajax({url:n.getUrl({name:"admin-trash-libraries"}),type:"DELETE",beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$cleanBtn.hide(),t.$tip.hide(),t.$table.hide(),t.$jsNext.hide(),t.$jsPrevious.hide(),t.$emptyTip.show(),n.feedback(gettext("Success"),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};n.showConfirm(i,r,s)},getNextPage:function(){this.initPage();var e=this.trashRepoCollection.state.current_page;return this.trashRepoCollection.state.has_next_page&&this.trashRepoCollection.getPage(e+1,{reset:!0}),!1},getPreviousPage:function(){this.initPage();var e=this.trashRepoCollection.state.current_page;return e>1&&this.trashRepoCollection.getPage(e-1,{reset:!0}),!1},initPage:function(){this.$tip.hide(),this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$cleanBtn.hide(),this.$jsNext.hide(),this.$jsPrevious.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showTrashLibraries()},showTrashLibraries:function(){this.initPage();this.trashRepoCollection.fetch({data:{page:this.option.page},cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},reset:function(){var e=this.trashRepoCollection.state.current_page;app.router.navigate("trash-libs/?page="+e),this.$loadingTip.hide(),this.trashRepoCollection.length>0?(this.trashRepoCollection.each(this.addOne,this),this.$cleanBtn.show(),this.$tip.show(),this.$table.show(),this.renderPaginator()):(this.$emptyTip.show(),this.$cleanBtn.hide())},renderPaginator:function(){this.trashRepoCollection.state.has_next_page?this.$jsNext.show():this.$jsNext.hide();var e=this.trashRepoCollection.state.current_page;e>1?this.$jsPrevious.show():this.$jsPrevious.hide()},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)}});return a}),define("sysadmin-app/collection/search-trash-repos",["underscore","backbone","common","sysadmin-app/models/trash-repo"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,url:function(){return i.getUrl({name:"admin-trash-libraries"})},parse:function(e){return this.search_owner=e.search_owner,e.repos}});return r}),define("sysadmin-app/views/search-trash-repos",["jquery","underscore","backbone","common","moment","sysadmin-app/views/trash-repo","sysadmin-app/collection/search-trash-repos"],function(e,t,i,n,r,s,o){"use strict";var a=i.View.extend({id:"trash-libraries",tabNavTemplate:t.template(e("#libraries-tabnav-tmpl").html()),template:t.template(e("#trash-libraries-tmpl").html()),initialize:function(){this.trashRepoCollection=new o,this.listenTo(this.trashRepoCollection,"add",this.addOne),this.listenTo(this.trashRepoCollection,"reset",this.reset),this.render()},render:function(){this.$el.html(this.tabNavTemplate({cur_tab:"trash"})+this.template()),this.$tip=this.$(".tip"),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$cleanBtn=this.$(".js-clean")},events:{"click .js-clean":"cleanTrashLibraries"},cleanTrashLibraries:function(){var t=this,i=this.trashRepoCollection.search_owner,r=gettext("Delete Library By Owner"),s=gettext("Are you sure you want to delete all %s's libraries?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-trash-libraries"}),type:"DELETE",data:{owner:i},beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$cleanBtn.hide(),t.$tip.hide(),t.$table.hide(),t.$emptyTip.show(),n.feedback(gettext("Success"),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};n.showConfirm(r,s,o)},initPage:function(){this.$tip.hide(),this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$cleanBtn.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showTrashLibraries()},showTrashLibraries:function(){this.initPage();var t=this;this.trashRepoCollection.fetch({data:{owner:this.option.owner},cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")},complete:function(){t.$loadingTip.hide()}})},reset:function(){var e=this.trashRepoCollection.length;this.$loadingTip.hide(),e>0?(this.trashRepoCollection.each(this.addOne,this),this.$cleanBtn.show(),this.$tip.show(),this.$table.show()):(this.$emptyTip.show(),this.$cleanBtn.hide())},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)}});return a}),function(e){"use strict";var t=function(e,i){var n=/[^\w\-\.:]/.test(e)?new Function(t.arg+",tmpl","var _e=tmpl.encode"+t.helper+",_s='"+e.replace(t.regexp,t.func)+"';return _s;"):t.cache[e]=t.cache[e]||t(t.load(e));return i?n(i,t):function(e){return n(e,t)}};t.cache={},t.load=function(e){return document.getElementById(e).innerHTML},t.regexp=/([\s'\\])(?![^%]*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,t.func=function(e,t,i,n,r,s){return t?{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[e]||"\\"+e:i?"="===i?"'+_e("+n+")+'":"'+("+n+"||'')+'":r?"';":s?"_s+='":void 0},t.encReg=/[<>&"'\x00]/g,t.encMap={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"},t.encode=function(e){return String(e||"").replace(t.encReg,function(e){return t.encMap[e]||""})},t.arg="o",t.helper=",print=function(s,e){_s+=e&&(s||'')||_e(s);},include=function(s,d){_s+=tmpl(s,d);}","function"==typeof define&&define.amd?define("tmpl",[],function(){return t}):e.tmpl=t}(this),function(e){"function"==typeof define&&define.amd?define("jquery.ui.widget",["jquery"],e):e(jQuery)}(function(e){var t=0,i=Array.prototype.slice;e.cleanData=function(t){return function(i){var n,r,s;for(s=0;null!=(r=i[s]);s++)try{n=e._data(r,"events"),n&&n.remove&&e(r).triggerHandler("remove")}catch(e){}t(i)}}(e.cleanData),e.widget=function(t,i,n){var r,s,o,a,l={},c=t.split(".")[0];return t=t.split(".")[1],r=c+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[c]=e[c]||{},s=e[c][t],o=e[c][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new o(e,t)},e.extend(o,s,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),a=new i,a.options=e.widget.extend({},a.options),e.each(n,function(t,n){return e.isFunction(n)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},r=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,s=this._superApply;return this._super=e,this._superApply=r,t=n.apply(this,arguments),this._super=i,this._superApply=s,t}}()):void(l[t]=n)}),o.prototype=e.widget.extend(a,{widgetEventPrefix:s?a.widgetEventPrefix||t:t},l,{constructor:o,namespace:c,widgetName:t,widgetFullName:r}),s?(e.each(s._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete s._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var n,r,s=i.call(arguments,1),o=0,a=s.length;o<a;o++)for(n in s[o])r=s[o][n],s[o].hasOwnProperty(n)&&void 0!==r&&(e.isPlainObject(r)?t[n]=e.isPlainObject(t[n])?e.widget.extend({},t[n],r):e.widget.extend({},r):t[n]=r);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(s){var o="string"==typeof s,a=i.call(arguments,1),l=this;return s=!o&&a.length?e.widget.extend.apply(null,[s].concat(a)):s,o?this.each(function(){var i,n=e.data(this,r);return"instance"===s?(l=n,!1):n?e.isFunction(n[s])&&"_"!==s.charAt(0)?(i=n[s].apply(n,a),i!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+s+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+s+"'")}):this.each(function(){var t=e.data(this,r);t?(t.option(s||{}),t._init&&t._init()):e.data(this,r,new n(s,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(i,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),i),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,r,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},n=t.split("."),t=n.shift(),n.length){for(r=o[t]=e.widget.extend({},this.options[t]),s=0;s<n.length-1;s++)r[n[s]]=r[n[s]]||{},r=r[n[s]];if(t=n.pop(),1===arguments.length)return void 0===r[t]?null:r[t];r[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,n){var r,s=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=r=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,r=this.widget()),e.each(n,function(n,o){function a(){if(t||s.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof o?s[o]:o).apply(s,arguments)}"string"!=typeof o&&(a.guid=o.guid=o.guid||a.guid||e.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),c=l[1]+s.eventNamespace,u=l[2];u?r.delegate(u,c,a):i.bind(c,a)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,n){var r,s,o=this.options[t];if(n=n||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],s=i.originalEvent)for(r in s)r in i||(i[r]=s[r]);return this.element.trigger(i,n),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(n))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,r,s){"string"==typeof r&&(r={effect:r});var o,a=r?r===!0||"number"==typeof r?i:r.effect||i:t;r=r||{},"number"==typeof r&&(r={duration:r}),o=!e.isEmptyObject(r),r.complete=s,r.delay&&n.delay(r.delay),o&&e.effects&&e.effects.effect[a]?n[t](r):a!==t&&n[a]?n[a](r.duration,r.easing,s):n.queue(function(i){e(this)[t](),s&&s.call(n[0]),i()})}});e.widget}),function(e){"use strict";"function"==typeof define&&define.amd?define("jquery.fileupload",["jquery","jquery.ui.widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}(function(e){"use strict";function t(t){var i="dragover"===t;return function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var r=n.dataTransfer;r&&e.inArray("Files",r.types)!==-1&&this._trigger(t,e.Event(t,{delegatedEvent:n}))!==!1&&(n.preventDefault(),i&&(r.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('<input type="file">').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,function(e,i){t=t.replace("{"+e+"}",i)}),t},formData:function(e){return e.serializeArray()},add:function(t,i){return!t.isDefaultPrevented()&&void((i.autoUpload||i.autoUpload!==!1&&e(this).fileupload("option","autoUpload"))&&i.process().done(function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){var e=this.slice||this.webkitSlice||this.mozSlice;return e.apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,function(e,t){i.push({name:e,value:t})}),i):[]},_getTotal:function(t){var i=0;return e.each(t,function(e,t){i+=t.size||1}),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,r=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&r-i._time<i.progressInterval&&t.loaded!==t.total)return;i._time=r,n=Math.floor(t.loaded/t.total*(i.chunkSize||i._progress.total))+(i.uploadedBytes||0),this._progress.loaded+=n-i._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(r,this._progress.loaded,i.bitrateInterval),i._progress.loaded=i.loaded=n,i._progress.bitrate=i.bitrate=i._bitrateTimer.getBitrate(r,n,i.bitrateInterval),this._trigger("progress",e.Event("progress",{delegatedEvent:t}),i),this._trigger("progressall",e.Event("progressall",{delegatedEvent:t}),this._progress)}},_initProgressListener:function(t){var i=this,n=t.xhr?t.xhr():e.ajaxSettings.xhr();n.upload&&(e(n.upload).bind("progress",function(e){var n=e.originalEvent;e.lengthComputable=n.lengthComputable,e.loaded=n.loaded,e.total=n.total,i._onProgress(e,t)}),t.xhr=function(){return n})},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_initXHRData:function(t){var i,n=this,r=t.files[0],s=t.multipart||!e.support.xhrFileUpload,o="array"===e.type(t.paramName)?t.paramName[0]:t.paramName;t.headers=e.extend({},t.headers),t.contentRange&&(t.headers["Content-Range"]=t.contentRange),s&&!t.blob&&this._isInstanceOf("File",r)||(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(r.name)+'"'),s?e.support.xhrFormDataFileUpload&&(t.postMessage?(i=this._getFormData(t),t.blob?i.push({name:o,value:t.blob}):e.each(t.files,function(n,r){i.push({name:"array"===e.type(t.paramName)&&t.paramName[n]||o,value:r})})):(n._isInstanceOf("FormData",t.formData)?i=t.formData:(i=new FormData,e.each(this._getFormData(t),function(e,t){i.append(t.name,t.value)})),t.blob?i.append(o,t.blob,r.name):e.each(t.files,function(r,s){(n._isInstanceOf("File",s)||n._isInstanceOf("Blob",s))&&i.append("array"===e.type(t.paramName)&&t.paramName[r]||o,s,s.uploadName||s.name)})),t.data=i):(t.contentType=r.type||"application/octet-stream",t.data=t.blob||r),t.blob=null},_initIframeSettings:function(t){var i=e("<a></a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each(function(){for(var t=e(this),i=t.prop("name")||"files[]",r=(t.prop("files")||[1]).length;r;)n.push(i),r-=1}),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var r=e.Deferred(),s=r.promise();return i=i||this.options.context||s,t===!0?r.resolveWith(i,n):t===!1&&r.rejectWith(i,n),s.abort=r.promise,this._enhancePromise(s)},_addConvenienceMethods:function(t,i){var n=this,r=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,s){return(t||s)&&(i._processQueue=this._processQueue=(this._processQueue||r([this])).then(function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():r(arguments)}).then(t,s)),this._processQueue||r([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)!==!1&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,r,s=this,o=t.files[0],a=o.size,l=t.uploadedBytes,c=t.maxChunkSize||a,u=this._blobSlice,d=e.Deferred(),h=d.promise();return!(!(this._isXHRUpload(t)&&u&&(l||c<a))||t.data)&&(!!i||(l>=a?(o.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",o.error])):(r=function(){var i=e.extend({},t),h=i._progress.loaded;i.blob=u.call(o,l,l+c,o.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+a,s._initXHRData(i),s._initProgressListener(i),n=(s._trigger("chunksend",null,i)!==!1&&e.ajax(i)||s._getXHRPromise(!1,i.context)).done(function(n,o,c){l=s._getUploadedBytes(c)||l+i.chunkSize,h+i.chunkSize-i._progress.loaded&&s._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=o,i.jqXHR=c,s._trigger("chunkdone",null,i),s._trigger("chunkalways",null,i),l<a?r():d.resolveWith(i.context,[n,o,c])}).fail(function(e,t,n){i.jqXHR=e,i.textStatus=t,i.errorThrown=n,s._trigger("chunkfail",null,i),s._trigger("chunkalways",null,i),d.rejectWith(i.context,[e,t,n])})},this._enhancePromise(h),h.abort=function(){return n.abort()},r(),h)))},_beforeSend:function(e,t){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0),this._initResponseObject(t),this._initProgressObject(t),t._progress.loaded=t.loaded=t.uploadedBytes||0,t._progress.total=t.total=this._getTotal(t.files)||1,t._progress.bitrate=t.bitrate=0,this._active+=1,this._progress.loaded+=t.loaded,this._progress.total+=t.total},_onDone:function(t,i,n,r){var s=r._progress.total,o=r._response;r._progress.loaded<s&&this._onProgress(e.Event("progress",{lengthComputable:!0,loaded:s,total:s}),r),o.result=r.result=t,o.textStatus=r.textStatus=i,o.jqXHR=r.jqXHR=n,this._trigger("done",null,r)},_onFail:function(e,t,i,n){var r=n._response;n.recalculateProgress&&(this._progress.loaded-=n._progress.loaded,this._progress.total-=n._progress.total),r.jqXHR=n.jqXHR=e,r.textStatus=n.textStatus=t,r.errorThrown=n.errorThrown=i,this._trigger("fail",null,n)},_onAlways:function(e,t,i,n){this._trigger("always",null,n)},_onSend:function(t,i){i.submit||this._addConvenienceMethods(t,i);var n,r,s,o,a=this,l=a._getAJAXSettings(i),c=function(){return a._sending+=1,l._bitrateTimer=new a._BitrateTimer,n=n||((r||a._trigger("send",e.Event("send",{delegatedEvent:t}),l)===!1)&&a._getXHRPromise(!1,l.context,r)||a._chunkedUpload(l)||e.ajax(l)).done(function(e,t,i){a._onDone(e,t,i,l)}).fail(function(e,t,i){a._onFail(e,t,i,l)}).always(function(e,t,i){if(a._onAlways(e,t,i,l),a._sending-=1,a._active-=1,l.limitConcurrentUploads&&l.limitConcurrentUploads>a._sending)for(var n=a._slots.shift();n;){if("pending"===a._getDeferredState(n)){n.resolve();break}n=a._slots.shift()}0===a._active&&a._trigger("stop")})};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(s=e.Deferred(),this._slots.push(s),o=s.then(c)):(this._sequence=this._sequence.then(c,c),o=this._sequence),o.abort=function(){return r=[void 0,"abort","abort"],n?n.abort():(s&&s.rejectWith(l.context,r),c())},this._enhancePromise(o)):c()},_onAdd:function(t,i){var n,r,s,o,a=this,l=!0,c=e.extend({},this.options,i),u=i.files,d=u.length,h=c.limitMultiFileUploads,p=c.limitMultiFileUploadSize,f=c.limitMultiFileUploadSizeOverhead,m=0,g=this._getParamName(c),v=0;if(!d)return!1;if(p&&void 0===u[0].size&&(p=void 0),(c.singleFileUploads||h||p)&&this._isXHRUpload(c))if(c.singleFileUploads||p||!h)if(!c.singleFileUploads&&p)for(s=[],n=[],o=0;o<d;o+=1)m+=u[o].size+f,(o+1===d||m+u[o+1].size+f>p||h&&o+1-v>=h)&&(s.push(u.slice(v,o+1)),r=g.slice(v,o+1),r.length||(r=g),n.push(r),v=o+1,m=0);else n=g;else for(s=[],n=[],o=0;o<d;o+=h)s.push(u.slice(o,o+h)),r=g.slice(o,o+h),r.length||(r=g),n.push(r);else s=[u],n=[g];return i.originalFiles=u,e.each(s||u,function(r,o){var c=e.extend({},i);return c.files=s?o:[o],c.paramName=n[r],a._initResponseObject(c),a._initProgressObject(c),a._addConvenienceMethods(t,c),l=a._trigger("add",e.Event("add",{delegatedEvent:t}),c)}),l},_replaceFileInput:function(t){var i=t.fileInput,n=i.clone(!0),r=i.is(document.activeElement);t.fileInputClone=n,e("<form></form>").append(n)[0].reset(),i.after(n).detach(),r&&n.focus(),e.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map(function(e,t){return t===i[0]?n[0]:t}),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,r=this,s=e.Deferred(),o=function(e){e&&!e.entry&&(e.entry=t),s.resolve([e])},a=function(e){r._handleFileTreeEntries(e,i+t.name+"/").done(function(e){s.resolve(e)}).fail(o)},l=function(){n.readEntries(function(e){e.length?(c=c.concat(e),l()):a(c)},o)},c=[];return i=i||"",t.isFile?t._file?(t._file.relativePath=i,s.resolve(t._file)):t.file(function(e){e.relativePath=i,s.resolve(e)},o):t.isDirectory?(n=t.createReader(),l()):s.resolve([]),s.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,function(e){return n._handleFileTreeEntry(e,i)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(t){t=t||{};var i=t.items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,function(e){var t;return e.webkitGetAsEntry?(t=e.webkitGetAsEntry(),t&&(t._file=e.getAsFile()),t):e.getAsEntry()})):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){t=e(t);var i,n,r=t.prop("webkitEntries")||t.prop("entries");if(r&&r.length)return this._handleFileTreeEntries(r);if(i=e.makeArray(t.prop("files")),i.length)void 0===i[0].name&&i[0].fileName&&e.each(i,function(e,t){t.name=t.fileName,t.size=t.fileSize});else{if(n=t.prop("value"),!n)return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always(function(r){n.files=r,i.options.replaceFileInput&&i._replaceFileInput(n),i._trigger("change",e.Event("change",{delegatedEvent:t}),n)!==!1&&i._onAdd(t,n)})},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)}),this._trigger("paste",e.Event("paste",{
delegatedEvent:t}),n)!==!1&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,r={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always(function(n){r.files=n,i._trigger("drop",e.Event("drop",{delegatedEvent:t}),r)!==!1&&i._onAdd(t,r)}))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_setOption:function(t,i){var n=e.inArray(t,this._specialOptions)!==-1;n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,function(e,r){var s,o=r.name.toLowerCase();/^data-/.test(o)&&(o=o.slice(5).replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()}),s=n[o],t._isRegExpOption(o,s)&&(s=t._getRegExp(s)),i[o]=s)})},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always(function(e){t.files=e,i._onAdd(null,t)}):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,r=this,s=e.Deferred(),o=s.promise();return o.abort=function(){return n=!0,i?i.abort():(s.reject(null,"abort","abort"),o)},this._getFileInputFiles(t.fileInput).always(function(e){if(!n){if(!e.length)return void s.reject();t.files=e,i=r._onSend(null,t),i.then(function(e,t,i){s.resolve(e,t,i)},function(e,t,i){s.reject(e,t,i)})}}),this._enhancePromise(o)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})}),function(e){"use strict";"function"==typeof define&&define.amd?define("jquery.fileupload-process",["jquery","./jquery.fileupload"],e):e("object"==typeof exports?require("jquery"):window.jQuery)}(function(e){"use strict";var t=e.blueimp.fileupload.prototype.options.add;e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{processQueue:[],add:function(i,n){var r=e(this);n.process(function(){return r.fileupload("process",n)}),t.call(this,i,n)}},processActions:{},_processFile:function(t,i){var n=this,r=e.Deferred().resolveWith(n,[t]),s=r.promise();return this._trigger("process",null,t),e.each(t.processQueue,function(t,r){var o=function(t){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():n.processActions[r.action].call(n,t,r)};s=s.then(o,r.always&&o)}),s.done(function(){n._trigger("processdone",null,t),n._trigger("processalways",null,t)}).fail(function(){n._trigger("processfail",null,t),n._trigger("processalways",null,t)}),s},_transformProcessQueue:function(t){var i=[];e.each(t.processQueue,function(){var n={},r=this.action,s=this.prefix===!0?r:this.prefix;e.each(this,function(i,r){"string"===e.type(r)&&"@"===r.charAt(0)?n[i]=t[r.slice(1)||(s?s+i.charAt(0).toUpperCase()+i.slice(1):i)]:n[i]=r}),i.push(n)}),t.processQueue=i},processing:function(){return this._processing},process:function(t){var i=this,n=e.extend({},this.options,t);return n.processQueue&&n.processQueue.length&&(this._transformProcessQueue(n),0===this._processing&&this._trigger("processstart"),e.each(t.files,function(r){var s=r?e.extend({},n):n,o=function(){return t.errorThrown?e.Deferred().rejectWith(i,[t]).promise():i._processFile(s,t)};s.index=r,i._processing+=1,i._processingQueue=i._processingQueue.then(o,o).always(function(){i._processing-=1,0===i._processing&&i._trigger("processstop")})})),this._processingQueue},_create:function(){this._super(),this._processing=0,this._processingQueue=e.Deferred().resolveWith(this).promise()}})}),function(e){"use strict";"function"==typeof define&&define.amd?define("jquery.fileupload-validate",["jquery","./jquery.fileupload-process"],e):e("object"==typeof exports?require("jquery"):window.jQuery)}(function(e){"use strict";e.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{getNumberOfFiles:e.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(t,i){if(i.disabled)return t;var n,r=e.Deferred(),s=this.options,o=t.files[t.index];return(i.minFileSize||i.maxFileSize)&&(n=o.size),"number"===e.type(i.maxNumberOfFiles)&&(s.getNumberOfFiles()||0)+t.files.length>i.maxNumberOfFiles?o.error=s.i18n("maxNumberOfFiles"):!i.acceptFileTypes||i.acceptFileTypes.test(o.type)||i.acceptFileTypes.test(o.name)?n>i.maxFileSize?o.error=s.i18n("maxFileSize"):"number"===e.type(n)&&n<i.minFileSize?o.error=s.i18n("minFileSize"):delete o.error:o.error=s.i18n("acceptFileTypes"),o.error||t.files.error?(t.files.error=!0,r.rejectWith(this,[t])):r.resolveWith(this,[t]),r.promise()}}})}),function(e){"use strict";"function"==typeof define&&define.amd?define("jquery.fileupload-ui",["jquery","tmpl","./jquery.fileupload-validate"],e):"object"==typeof exports?e(require("jquery"),require("tmpl")):e(window.jQuery,window.tmpl)}(function(e,t){"use strict";e.blueimp.fileupload.prototype._specialOptions.push("filesContainer","uploadTemplateId","downloadTemplateId"),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{autoUpload:!1,uploadTemplateId:"template-upload",downloadTemplateId:"template-download",filesContainer:void 0,prependFiles:!1,dataType:"json",messages:{unknownError:"Unknown error"},getNumberOfFiles:function(){return this.filesContainer.children().not(".processing").length},getFilesFromResponse:function(t){return t.result&&e.isArray(t.result.files)?t.result.files:[]},add:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this),r=n.data("blueimp-fileupload")||n.data("fileupload"),s=r.options;i.context=r._renderUpload(i.files).data("data",i).addClass("processing"),s.filesContainer[s.prependFiles?"prepend":"append"](i.context),r._forceReflow(i.context),r._transition(i.context),i.process(function(){return n.fileupload("process",i)}).always(function(){i.context.each(function(t){e(this).find(".size").text(r._formatFileSize(i.files[t].size))}).removeClass("processing"),r._renderPreviews(i)}).done(function(){i.context.find(".start").prop("disabled",!1),r._trigger("added",t,i)!==!1&&(s.autoUpload||i.autoUpload)&&i.autoUpload!==!1&&i.submit()}).fail(function(){i.files.error&&i.context.each(function(t){var n=i.files[t].error;n&&e(this).find(".error").text(n)})})},send:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload");return i.context&&i.dataType&&"iframe"===i.dataType.substr(0,6)&&i.context.find(".progress").addClass(!e.support.transition&&"progress-animated").attr("aria-valuenow",100).children().first().css("width","100%"),n._trigger("sent",t,i)},done:function(t,i){if(t.isDefaultPrevented())return!1;var n,r,s=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),o=i.getFilesFromResponse||s.options.getFilesFromResponse,a=o(i);i.context?i.context.each(function(o){var l=a[o]||{error:"Empty file upload result"};r=s._addFinishedDeferreds(),s._transition(e(this)).done(function(){var o=e(this);n=s._renderDownload([l]).replaceAll(o),s._forceReflow(n),s._transition(n).done(function(){i.context=e(this),s._trigger("completed",t,i),s._trigger("finished",t,i),r.resolve()})})}):(n=s._renderDownload(a)[s.options.prependFiles?"prependTo":"appendTo"](s.options.filesContainer),s._forceReflow(n),r=s._addFinishedDeferreds(),s._transition(n).done(function(){i.context=e(this),s._trigger("completed",t,i),s._trigger("finished",t,i),r.resolve()}))},fail:function(t,i){if(t.isDefaultPrevented())return!1;var n,r,s=e(this).data("blueimp-fileupload")||e(this).data("fileupload");i.context?i.context.each(function(o){if("abort"!==i.errorThrown){var a=i.files[o];a.error=a.error||i.errorThrown||i.i18n("unknownError"),r=s._addFinishedDeferreds(),s._transition(e(this)).done(function(){var o=e(this);n=s._renderDownload([a]).replaceAll(o),s._forceReflow(n),s._transition(n).done(function(){i.context=e(this),s._trigger("failed",t,i),s._trigger("finished",t,i),r.resolve()})})}else r=s._addFinishedDeferreds(),s._transition(e(this)).done(function(){e(this).remove(),s._trigger("failed",t,i),s._trigger("finished",t,i),r.resolve()})}):"abort"!==i.errorThrown?(i.context=s._renderUpload(i.files)[s.options.prependFiles?"prependTo":"appendTo"](s.options.filesContainer).data("data",i),s._forceReflow(i.context),r=s._addFinishedDeferreds(),s._transition(i.context).done(function(){i.context=e(this),s._trigger("failed",t,i),s._trigger("finished",t,i),r.resolve()})):(s._trigger("failed",t,i),s._trigger("finished",t,i),s._addFinishedDeferreds().resolve())},progress:function(t,i){if(t.isDefaultPrevented())return!1;var n=Math.floor(i.loaded/i.total*100);i.context&&i.context.each(function(){e(this).find(".progress").attr("aria-valuenow",n).children().first().css("width",n+"%")})},progressall:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this),r=Math.floor(i.loaded/i.total*100),s=n.find(".fileupload-progress"),o=s.find(".progress-extended");o.length&&o.html((n.data("blueimp-fileupload")||n.data("fileupload"))._renderExtendedProgress(i)),s.find(".progress").attr("aria-valuenow",r).children().first().css("width",r+"%")},start:function(t){if(t.isDefaultPrevented())return!1;var i=e(this).data("blueimp-fileupload")||e(this).data("fileupload");i._resetFinishedDeferreds(),i._transition(e(this).find(".fileupload-progress")).done(function(){i._trigger("started",t)})},stop:function(t){if(t.isDefaultPrevented())return!1;var i=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),n=i._addFinishedDeferreds();e.when.apply(e,i._getFinishedDeferreds()).done(function(){i._trigger("stopped",t)}),i._transition(e(this).find(".fileupload-progress")).done(function(){e(this).find(".progress").attr("aria-valuenow","0").children().first().css("width","0%"),e(this).find(".progress-extended").html("&nbsp;"),n.resolve()})},processstart:function(t){return!t.isDefaultPrevented()&&void e(this).addClass("fileupload-processing")},processstop:function(t){return!t.isDefaultPrevented()&&void e(this).removeClass("fileupload-processing")},destroy:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),r=function(){n._transition(i.context).done(function(){e(this).remove(),n._trigger("destroyed",t,i)})};i.url?(i.dataType=i.dataType||n.options.dataType,e.ajax(i).done(r).fail(function(){n._trigger("destroyfailed",t,i)})):r()}},_resetFinishedDeferreds:function(){this._finishedUploads=[]},_addFinishedDeferreds:function(t){return t||(t=e.Deferred()),this._finishedUploads.push(t),t},_getFinishedDeferreds:function(){return this._finishedUploads},_enableDragToDesktop:function(){var t=e(this),i=t.prop("href"),n=t.prop("download"),r="application/octet-stream";t.bind("dragstart",function(e){try{e.originalEvent.dataTransfer.setData("DownloadURL",[r,n,i].join(":"))}catch(e){}})},_formatFileSize:function(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"},_formatBitrate:function(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" Gbit/s":e>=1e6?(e/1e6).toFixed(2)+" Mbit/s":e>=1e3?(e/1e3).toFixed(2)+" kbit/s":e.toFixed(2)+" bit/s"},_formatTime:function(e){var t=new Date(1e3*e),i=Math.floor(e/86400);return i=i?i+"d ":"",i+("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)},_formatPercentage:function(e){return(100*e).toFixed(2)+" %"},_renderExtendedProgress:function(e){return this._formatBitrate(e.bitrate)+" | "+this._formatTime(8*(e.total-e.loaded)/e.bitrate)+" | "+this._formatPercentage(e.loaded/e.total)+" | "+this._formatFileSize(e.loaded)+" / "+this._formatFileSize(e.total)},_renderTemplate:function(t,i){if(!t)return e();var n=t({files:i,formatFileSize:this._formatFileSize,options:this.options});return n instanceof e?n:e(this.options.templatesContainer).html(n).children()},_renderPreviews:function(t){t.context.find(".preview").each(function(i,n){e(n).append(t.files[i].preview)})},_renderUpload:function(e){return this._renderTemplate(this.options.uploadTemplate,e)},_renderDownload:function(e){return this._renderTemplate(this.options.downloadTemplate,e).find("a[download]").each(this._enableDragToDesktop).end()},_startHandler:function(t){t.preventDefault();var i=e(t.currentTarget),n=i.closest(".template-upload"),r=n.data("data");i.prop("disabled",!0),r&&r.submit&&r.submit()},_cancelHandler:function(t){t.preventDefault();var i=e(t.currentTarget).closest(".template-upload,.template-download"),n=i.data("data")||{};n.context=n.context||i,n.abort?n.abort():(n.errorThrown="abort",this._trigger("fail",t,n))},_deleteHandler:function(t){t.preventDefault();var i=e(t.currentTarget);this._trigger("destroy",t,e.extend({context:i.closest(".template-download"),type:"DELETE"},i.data()))},_forceReflow:function(t){return e.support.transition&&t.length&&t[0].offsetWidth},_transition:function(t){var i=e.Deferred();return e.support.transition&&t.hasClass("fade")&&t.is(":visible")?t.bind(e.support.transition.end,function(n){n.target===t[0]&&(t.unbind(e.support.transition.end),i.resolveWith(t))}).toggleClass("in"):(t.toggleClass("in"),i.resolveWith(t)),i},_initButtonBarEventHandlers:function(){var t=this.element.find(".fileupload-buttonbar"),i=this.options.filesContainer;this._on(t.find(".start"),{click:function(e){e.preventDefault(),i.find(".start").click()}}),this._on(t.find(".cancel"),{click:function(e){e.preventDefault(),i.find(".cancel").click()}}),this._on(t.find(".delete"),{click:function(e){e.preventDefault(),i.find(".toggle:checked").closest(".template-download").find(".delete").click(),t.find(".toggle").prop("checked",!1)}}),this._on(t.find(".toggle"),{change:function(t){i.find(".toggle").prop("checked",e(t.currentTarget).is(":checked"))}})},_destroyButtonBarEventHandlers:function(){this._off(this.element.find(".fileupload-buttonbar").find(".start, .cancel, .delete"),"click"),this._off(this.element.find(".fileupload-buttonbar .toggle"),"change.")},_initEventHandlers:function(){this._super(),this._on(this.options.filesContainer,{"click .start":this._startHandler,"click .cancel":this._cancelHandler,"click .delete":this._deleteHandler}),this._initButtonBarEventHandlers()},_destroyEventHandlers:function(){this._destroyButtonBarEventHandlers(),this._off(this.options.filesContainer,"click"),this._super()},_enableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!1).parent().removeClass("disabled")},_disableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!0).parent().addClass("disabled")},_initTemplates:function(){var e=this.options;e.templatesContainer=this.document[0].createElement(e.filesContainer.prop("nodeName")),t&&(e.uploadTemplateId&&(e.uploadTemplate=t(e.uploadTemplateId)),e.downloadTemplateId&&(e.downloadTemplate=t(e.downloadTemplateId)))},_initFilesContainer:function(){var t=this.options;void 0===t.filesContainer?t.filesContainer=this.element.find(".files"):t.filesContainer instanceof e||(t.filesContainer=e(t.filesContainer))},_initSpecialOptions:function(){this._super(),this._initFilesContainer(),this._initTemplates()},_create:function(){this._super(),this._resetFinishedDeferreds(),e.support.fileInput||this._disableFileInputButton()},enable:function(){var e=!1;this.options.disabled&&(e=!0),this._super(),e&&(this.element.find("input, button").prop("disabled",!1),this._enableFileInputButton())},disable:function(){this.options.disabled||(this.element.find("input, button").prop("disabled",!0),this._disableFileInputButton()),this._super()}})}),define("app/views/fileupload",["common","backbone","jquery.fileupload-ui"],function(e,t,i){window.locale={fileupload:{errors:{maxFileSize:gettext("File is too big"),minFileSize:gettext("File is too small"),acceptFileTypes:gettext("Filetype not allowed"),maxNumberOfFiles:gettext("Maximum number of files exceeded"),uploadedBytes:gettext("Uploaded bytes exceed file size"),emptyResult:gettext("Empty file upload result")},error:gettext("Error"),uploaded:gettext("uploaded"),canceled:gettext("canceled"),start:gettext("Start"),cancel:gettext("Cancel"),destroy:gettext("Delete")}};var n=t.View.extend({el:$("#upload-file-dialog"),fileupdateConfirmTemplate:_.template($("#fileupdate-confirm-template").html()),initialize:function(t){var i=this.dirView=t.dirView,n=i.dir,r=this.$el.addClass("fixed-upload-file-dialog");this.popup_height="200px";var s=$(".status",r),o=$(".total-progress",r),a=$(".fileupload-buttonbar .cancel",r),l=$(".sf-close",r),c=$(".saving-tip",r),u={uploading:gettext("File Uploading..."),complete:gettext("File Upload complete"),canceled:gettext("File Upload canceled"),failed:gettext("File Upload failed")},d=[],h=[],p=app.pageOptions.enable_upload_folder,f=app.pageOptions.enable_resumable_fileupload,m=[],g=[],v=function(e){var t;return"number"!=typeof e?"":(t=e/8,t>=1e9?(t/1e9).toFixed(2)+" GB/s":t>=1e6?(t/1e6).toFixed(2)+" MB/s":t>=1e3?(t/1e3).toFixed(2)+" kB/s":t.toFixed(2)+" B/s")},_=this;r.fileupload({paramName:"file",getFilesFromResponse:function(e){if(e.result)return e.result},autoUpload:!0,maxNumberOfFiles:app.pageOptions.max_number_of_files_for_fileupload,sequentialUploads:!0}).bind("fileuploadadd",function(e,t){if(!i.$el.is(":visible"))return!1;if(n.user_perm&&"rw"!=n.user_perm)return!1;r.removeClass("hide"),a.removeClass("hide"),l.addClass("hide"),r.height(parseInt(_.popup_height)),$(".fileupload-buttonbar, table",r).removeClass("hide");var s=n.path;if(r.fileupload("option",{formData:{parent_dir:"/"==s?s:s+"/"},maxChunkSize:void 0,uploadedBytes:void 0}),p){var o=i.$("#upload-menu");o.hasClass("hide")||o.addClass("hide");var c=t.files[0];return"."==c.name?void t.files.shift():void(t.fileInput?c.webkitRelativePath&&(c.relative_path=c.webkitRelativePath):c.relativePath&&(c.relative_path=c.relativePath+c.name))}}).bind("fileuploadstart",function(){s.html(u.uploading)}).bind("fileuploadsubmit",function(t,i){if(0==i.files.length)return!1;var s=i.files[0];if(s.error)return!1;var o=function(){var t,o;n.is_system_library?(t=e.getUrl({name:"admin-system-library-upload-link",repo_id:n.repo_id}),o={from:"web",path:n.path}):(t=e.getUrl({name:"repo_upload_link",repo_id:n.repo_id}),o={from:"web",p:n.path}),$.ajax({url:t,data:o,cache:!1,dataType:"json",success:function(t){if(n.is_system_library&&(t=t.upload_link),p&&s.relative_path){var o=s.relative_path,a=o.substring(0,o.lastIndexOf("/")+1),l=r.fileupload("option","formData");l.relative_path=a,r.fileupload("option",{formData:l}),i.url=t,i.jqXHR=r.fileupload("send",i)}else{var c=1048576;f&&s.size&&s.size>c?(r.fileupload("option","maxChunkSize",c),$.ajax({url:e.getUrl({name:"repo_file_uploaded_bytes",repo_id:n.repo_id}),data:{parent_dir:n.path,file_name:s.name},cache:!1,dataType:"json",success:function(e){r.fileupload("option","uploadedBytes",e.uploadedBytes),i.url=t,i.jqXHR=r.fileupload("send",i)}})):(i.url=t,i.jqXHR=r.fileupload("send",i))}},error:function(){s.error=gettext("Failed to get upload url")}})};if(s.relative_path||i.originalFiles.length>1)return o(),!1;var a=function(){$.ajax({url:e.getUrl({name:"repo_update_link",repo_id:n.repo_id}),data:{from:"web",p:n.path},cache:!1,dataType:"json",success:function(e){var t=r.fileupload("option","formData");t.target_file=t.parent_dir+s.name,r.fileupload("option","formData",t),s.to_update=!0,i.url=e,i.jqXHR=r.fileupload("send",i)},error:function(){s.error=gettext("Failed to get update url")}})},l=n.where({is_file:!0}),c=[];if($(l).each(function(){c.push(this.get("obj_name"))}),n.is_system_library||c.indexOf(s.name)==-1)o();else{var u=gettext("Replace file {filename}?").replace("{filename}",'<span class="op-target">'+e.HTMLescape(s.name)+"</span>"),d=$(_.fileupdateConfirmTemplate({title:u}));d.modal({onClose:function(){$.modal.close(),s.choose_to_update?a():s.choose_to_upload?o():(i.jqXHR=r.fileupload("send",i),i.jqXHR.abort())}}),$("#simplemodal-container").css({width:"auto",height:"auto"}),$(".yes",d).click(function(){var t=n.findWhere({obj_name:s.name});t.get("is_locked")?t.get("locked_by_me")?(s.choose_to_update=!0,$.modal.close()):($(".error",d).html(gettext("File is locked")).removeClass("hide"),e.disableButton($(this))):(s.choose_to_update=!0,$.modal.close())}),$(".no",d).click(function(){s.choose_to_upload=!0,$.modal.close()})}return!1}).bind("fileuploadprogressall",function(e,t){o.html(parseInt(t.loaded/t.total*100,10)+'% <span style="font-size:14px;color:#555;">('+v(t.bitrate)+")</span>").removeClass("hide"),t.loaded>0&&t.loaded==t.total&&c.show()}).bind("fileuploaddone",function(e,t){if("success"==t.textStatus){var i=t.files[0],r=i.relative_path,s=t.result[0];s.uploaded=!0,r&&(s.relative_path=r.substring(0,r.lastIndexOf("/")+1)+s.name);var o=n.path;if(o="/"==o?o:o+"/",t.formData.parent_dir==o){if(!r)return void(i.to_update?h.push(s):d.push(s));if(p){var a=r.substring(0,r.indexOf("/")),l=n.where({is_dir:!0,obj_name:a});l.length>0?g.indexOf(a)==-1&&g.push(a):m.indexOf(a)==-1&&m.push(a)}}}}).bind("fileuploadstop",function(){a.addClass("hide"),l.removeClass("hide");var t=n.path;if(t="/"==t?t:t+"/",r.fileupload("option","formData").parent_dir==t){var s=parseInt((new Date).getTime()/1e3);d.length>0&&($(d).each(function(t,r){var o=n.add({is_file:!0,is_img:e.imageCheck(r.name),obj_name:r.name,last_modified:s,file_size:e.fileSizeFormat(r.size,1),obj_id:r.id,file_icon:"file.png",perm:"rw",last_update:gettext("Just now"),starred:!1},{silent:!0});i.addNewFile(o)}),d=[]),m.length>0&&($(m).each(function(e,r){var o=n.add({is_dir:!0,obj_name:r,perm:"rw",last_modified:s,last_update:gettext("Just now"),p_dpath:t+r},{silent:!0});i.addNewDir(o)}),m=[]),g.length>0&&($(g).each(function(e,t){var i=n.where({is_dir:!0,obj_name:t});i[0].set({last_modified:s,last_update:gettext("Just now")})}),g=[]),h.length>0&&($(h).each(function(t,i){var r=n.where({is_file:!0,obj_name:i.name});r[0].set({obj_id:i.id,file_size:e.fileSizeFormat(i.size,1),last_modified:s,last_update:gettext("Just now")})}),h=[])}}).bind("fileuploadfail",function(e,t){var i=t.files[0];!i.error&&t.jqXHR&&t.jqXHR.responseJSON&&t.jqXHR.responseJSON.error&&(i.error=t.jqXHR.responseJSON.error)}).bind("fileuploadcompleted",function(){0==$(".files .cancel",r).length&&(c.hide(),o.addClass("hide"),s.html(u.complete))}).bind("fileuploadfailed",function(e,t){0==$(".files .cancel",r).length&&(a.addClass("hide"),l.removeClass("hide"),o.addClass("hide"),c.hide(),"abort"==t.errorThrown?s.html(u.canceled):s.html(u.failed))});var y=app.pageOptions.max_upload_file_size;y&&r.fileupload("option","maxFileSize",y),r.fileupload("option","redirect",window.location.href.replace(/\/repo\/[-a-z0-9]{36}\/.*/,app.config.mediaUrl+"cors/result.html?%s"))},events:{"click .fold-switch":"foldAndUnfoldPopup","click .sf-close":"closePopup"},foldAndUnfoldPopup:function(){var e=this.$el,t=parseInt(this.popup_height),i=$(".fileupload-buttonbar, table",e);e.height()==t?(e.height($(".hd",e).outerHeight(!0)),i.addClass("hide")):(e.height(t),i.removeClass("hide"))},closePopup:function(){var e=this.$el;e.addClass("hide"),$(".files",e).empty()}});return n}),define("sysadmin-app/views/dirent",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#dirent-item-tmpl").html()),events:{"click .dirent-download-btn":"downloadDirent","click .dirent-delete-btn":"deleteDirent"},initialize:function(e){s.prototype.initialize.call(this),this.dir=e.dirView.dir},downloadDirent:function(){return e.ajax({url:this.model.getDownloadUrl(),dataType:"json",success:function(e){location.href=e.download_url},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)}}),!1},deleteDirent:function(){var t=this;return e.ajax({url:this.model.getDeleteUrl(),type:"DELETE",beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$el.remove(),n.feedback(gettext("Success"),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)}}),!1},render:function(){var e=n.isHiDPI()?48:24,t=this.model.toJSON(),i=r(t.last_update);return t.time=i.format("LLLL"),t.time_from_now=n.getRelativeTimeStr(i),t.icon_url=this.model.getIconUrl(e),this.model.get("is_file")?t.download_url=this.model.getDownloadUrl():t.url=this.model.getWebUrl(),t.repo_id=this.dir.repo_id,t.is_system_library=this.dir.is_system_library,this.$el.html(this.template(t)),this}});return o}),define("sysadmin-app/models/dirent",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({getPath:function(){return i.pathJoin([this.collection.path,this.get("obj_name")])},getWebUrl:function(){var e=this.collection,t=this.getPath();return this.get("is_file")?"":"#libs/"+e.repo_id+i.encodePath(t)},getDownloadUrl:function(){var e=this.collection,t=this.getPath();return app.config.siteRoot+"api/v2.1/admin/libraries/"+e.repo_id+"/dirent/?path="+encodeURIComponent(t)+"&dl=1"},getDeleteUrl:function(){var e=this.collection,t=this.getPath();return app.config.siteRoot+"api/v2.1/admin/libraries/"+e.repo_id+"/dirent/?path="+encodeURIComponent(t)},getIconUrl:function(e){if(this.get("is_file"))return i.getFileIconUrl(this.get("obj_name"),e);var t="r"==this.get("perm");return i.getDirIconUrl(t,e)}});return n}),define("sysadmin-app/collection/dirents",["underscore","backbone","common","sysadmin-app/models/dirent"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,url:function(){return i.getUrl({name:"admin-library-dirents",repo_id:this.repo_id})},parse:function(e){return this.repo_name=e.repo_name,this.repo_id=e.repo_id,this.is_system_library=e.is_system_library,e.dirent_list},setPath:function(e,t){this.repo_id=e,this.path=t}});return r}),define("sysadmin-app/views/dir",["jquery","underscore","backbone","common","app/views/fileupload","sysadmin-app/views/dirent","sysadmin-app/collection/dirents"],function(e,t,i,n,r,s,o){"use strict";var a=i.View.extend({id:"dir-view",template:t.template(e("#dir-view-tmpl").html()),pathBarTemplate:t.template(e("#dir-path-bar-tmpl").html()),dir_op_bar_template:t.template(e("#dir-op-bar-tmpl").html()),newDirTemplate:t.template(e("#add-new-dir-form-template").html()),initialize:function(){this.dir=new o,this.listenTo(this.dir,"add",this.addOne),this.listenTo(this.dir,"reset",this.reset),this.fileUploadView=new r({dirView:this}),this.render()},render:function(){this.$el.html(this.template()),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$path_bar=this.$(".path-bar"),this.$dir_op_bar=this.$(".repo-op")},events:{"click .basic-upload-btn":"uploadFile","click #add-new-dir":"newDir"},uploadFile:function(){this.$("#basic-upload-input").trigger("click")},addNewFile:function(t){t.set("last_update",(new Date).getTime());var i=new s({model:t,dirView:this}),n=i.render().el;if(0==e("tr",this.$tableBody).length)this.$tableBody.append(n);else{var r=this.dir.where({is_file:!1});0==r.length?this.$tableBody.prepend(n):e(e("tr",this.$tableBody)[r.length-1]).after(n)}},newDir:function(){var t=e(this.newDirTemplate()),i=t.attr("id"),r=this.dir,s=this;t.modal({appendTo:"#main"}),e("#simplemodal-container").css({height:"auto"}),t.submit(function(){var o=e.trim(e('input[name="name"]',t).val());if(!o)return n.showFormError(i,gettext("It is required.")),!1;var a={obj_name:o},l=n.getUrl({name:"admin-library-dirents",repo_id:r.repo_id})+"?parent_dir="+n.encodePath(r.path),c=function(t){var i=r.add(t,{silent:!0});e.modal.close(),s.addNewDir(i)};return n.ajaxPost({form:t,post_url:l,post_data:a,after_op_success:c,form_id:i}),!1})},addNewDir:function(e){var t=this,i=new s({model:e,dirView:t});t.$tableBody.prepend(i.render().el)},hide:function(){this.$el.detach(),this.attached=!1,this.fileUploadView.closePopup()},show:function(t,i){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.dir.setPath(t,i),this.fetchLibraryDirents()},initPage:function(){this.renderPath(),this.renderDirOpBar(),this.setFileInput(),this.$tableBody.empty(),this.$loadingTip.show()},renderPath:function(){var t=this.dir,i=t.path,r={path:i,repo_name:t.repo_name,is_system_library:t.is_system_library},s=i.substr(1).split("/"),o=n.encodePath(i.substr(1)).split("/");"/"!=i&&e.extend(r,{path_list:s,path_list_encoded:o,repo_id:t.repo_id}),this.$path_bar.html(this.pathBarTemplate(r))},renderDirOpBar:function(){this.dir.is_system_library?this.$dir_op_bar.html(this.dir_op_bar_template()).show():this.$dir_op_bar.empty().hide()},setFileInput:function(){var e=this.fileUploadView.$el;e.fileupload("option","fileInput",this.$("#basic-upload-input"))},fetchLibraryDirents:function(){var t=this.dir;t.fetch({data:{parent_dir:t.path},cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},reset:function(){this.initPage(),this.$loadingTip.hide();var e=this.dir.length;e>0&&(this.dir.each(this.addOne,this),this.$table.show())},addOne:function(e){var t=new s({model:e,dirView:this});this.$tableBody.append(t.render().el)}});return a}),define("sysadmin-app/views/group",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#group-item-tmpl").html()),transferTemplate:t.template(e("#group-transfer-form-tmpl").html()),events:{"click .group-delete-btn":"deleteGroup","click .group-transfer-btn":"transferGroup"},initialize:function(){s.prototype.initialize.call(this),this.listenTo(this.model,"change",this.render)},deleteGroup:function(){var t=this,i=this.model.get("name"),r=gettext("Delete Group"),s=gettext("Are you sure you want to delete %s ?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-group",group_id:t.model.get("id")}),type:"DELETE",cache:!1,beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$el.remove(),n.feedback(gettext("Successfully deleted 1 item."),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};return n.showConfirm(r,s,o),!1},transferGroup:function(){var t=this,i=this.model.get("name"),r=this.model.get("id"),s=this.model.get("owner"),o=e(this.transferTemplate({
title:gettext("Transfer Group {group_name} To").replace("{group_name}",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>")}));return o.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),e('[name="email"]',o).select2(e.extend(n.contactInputOptionsForSelect2(),{width:"300px",maximumSelectionSize:1,placeholder:gettext("Search user or enter email and press Enter"),formatSelectionTooBig:gettext("You cannot select any more choices")})),o.submit(function(){var i=e.trim(e('[name="email"]',e(this)).val()),a=e('[type="submit"]',e(this));return!!i&&(i!=s&&(n.disableButton(a),e.ajax({url:n.getUrl({name:"admin-group",group_id:r}),type:"put",dataType:"json",beforeSend:n.prepareCSRFToken,data:{new_owner:i},success:function(){e.modal.close(),t.model.set({owner:i}),n.feedback(gettext("Successfully transferred the group."),"success")},error:function(t){var i;i=t.responseText?e.parseJSON(t.responseText).error_msg:gettext("Failed. Please check the network."),e(".error",o).html(i).show(),n.enableButton(a)}}),!1))}),!1},render:function(){var e=this.model.toJSON(),t=r(e.created_at);return e.time=t.format("LLLL"),e.time_from_now=n.getRelativeTimeStr(t),this.$el.html(this.template(e)),this}});return o}),define("sysadmin-app/models/group",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({});return n}),define("sysadmin-app/collection/groups",["underscore","backbone.paginator","common","sysadmin-app/models/group"],function(e,t,i,n){"use strict";var r=Backbone.PageableCollection.extend({model:n,state:{pageSize:100},parseState:function(e){return e.page_info},parseRecords:function(e){return e.groups},url:function(){return i.getUrl({name:"admin-groups"})}});return r}),define("sysadmin-app/views/groups",["jquery","underscore","backbone","common","sysadmin-app/views/group","sysadmin-app/collection/groups"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"admin-groups",template:t.template(e("#groups-tmpl").html()),groupAddFormtemplate:t.template(e("#group-add-form-tmpl").html()),initialize:function(){this.groupCollection=new s,this.listenTo(this.groupCollection,"add",this.addOne),this.listenTo(this.groupCollection,"reset",this.reset),this.render()},render:function(){this.$el.append(this.template()),this.$newGroup=this.$(".js-add-group"),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$jsPrevious=this.$(".js-previous"),this.$jsNext=this.$(".js-next"),this.$error=this.$(".error")},events:{"click .js-add-group":"addGroup","click .js-export-excel":"exportExcel","click #paginator .js-next":"getNextPage","click #paginator .js-previous":"getPreviousPage"},initPage:function(){this.$loadingTip.show(),this.$table.hide(),this.$tableBody.empty(),this.$jsNext.hide(),this.$jsPrevious.hide(),this.$emptyTip.hide(),this.$error.hide()},addGroup:function(){var t=e(this.groupAddFormtemplate()),i=this.groupCollection;return t.modal(),e("#simplemodal-container").css({height:"auto"}),e('[name="group_owner"]',t).select2(e.extend(n.contactInputOptionsForSelect2(),{width:"268px",containerCss:{"margin-bottom":"5px"},maximumSelectionSize:1,placeholder:gettext("Search user or enter email and press Enter"),formatSelectionTooBig:gettext("You cannot select any more choices")})),t.submit(function(){var r=e.trim(e('[name="group_name"]',t).val()),s=e.trim(e('[name="group_owner"]',t).val()),o=e(".error",t),a=e('[type="submit"]',t);return r?(o.hide(),n.disableButton(a),i.create({group_name:r,group_owner:s},{prepend:!0,wait:!0,success:function(){1==i.length&&i.reset(i.models),n.closeModal()},error:function(e,t,i){var r;r=t.responseText?t.responseJSON.error_msg:gettext("Please check the network."),o.html(r).show(),n.enableButton(a)}}),!1):(o.html(gettext("Name is required.")).show(),!1)}),!1},exportExcel:function(){location.href=n.getUrl({name:"sys_group_admin_export_excel"})},getNextPage:function(){this.initPage();var e=this.groupCollection.state.current_page;return this.groupCollection.state.has_next_page&&this.groupCollection.getPage(e+1,{reset:!0}),!1},getPreviousPage:function(){this.initPage();var e=this.groupCollection.state.current_page;return e>1&&this.groupCollection.getPage(e-1,{reset:!0}),!1},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.getContent()},getContent:function(){this.initPage();var t=this;this.groupCollection.fetch({data:{page:this.option.page},cache:!1,reset:!0,error:function(i,n,r){var s;s=n.responseText?401==n.status||403==n.status?gettext("Permission error"):e.parseJSON(n.responseText).error_msg:gettext("Failed. Please check the network."),t.$error.html(s).show()},complete:function(){t.$loadingTip.hide()}})},reset:function(){this.initPage();var e=this.groupCollection.state.current_page;app.router.navigate("groups/?page="+e),this.$loadingTip.hide(),this.groupCollection.length>0?(this.groupCollection.each(this.addOne,this),this.$table.show(),this.renderPaginator()):this.$emptyTip.show()},renderPaginator:function(){this.groupCollection.state.has_next_page?this.$jsNext.show():this.$jsNext.hide();var e=this.groupCollection.state.current_page;e>1?this.$jsPrevious.show():this.$jsPrevious.hide()},addOne:function(e,t,i){var n=new r({model:e});i.prepend?this.$tableBody.prepend(n.render().el):this.$tableBody.append(n.render().el)}});return o}),define("sysadmin-app/collection/search-groups",["underscore","backbone","common","sysadmin-app/models/group"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,url:function(){return i.getUrl({name:"admin-groups"})},parse:function(e){return this.search_name=e.name,e.groups}});return r}),define("sysadmin-app/views/search-groups",["jquery","underscore","backbone","common","sysadmin-app/views/group","sysadmin-app/collection/search-groups"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"search-groups",template:t.template(e("#search-groups-tmpl").html()),initialize:function(){this.groupCollection=new s,this.listenTo(this.groupCollection,"add",this.addOne),this.listenTo(this.groupCollection,"reset",this.reset),this.render()},render:function(){this.$el.append(this.template()),this.$form=this.$("#search-group-form"),this.$name=e('[name="name"]',this.$form),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},events:{"submit #search-group-form":"formSubmit"},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.getContent(t)},getContent:function(t){this.initPage();var i=this;this.groupCollection.fetch({data:t,cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")},complete:function(){i.$loadingTip.hide()}})},reset:function(){var e=this.groupCollection.search_name;app.router.navigate("#search-groups/?name="+encodeURIComponent(e)),this.$name.val(e),this.$loadingTip.hide(),this.groupCollection.length>0?(this.groupCollection.each(this.addOne,this),this.$table.show()):this.$emptyTip.show()},addOne:function(e){var t=new r({model:e});this.$tableBody.append(t.render().el)},formSubmit:function(){var t=e.trim(this.$name.val());return!!t&&(this.getContent({name:t}),!1)}});return o}),define("sysadmin-app/views/group-repo",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,i,n,r){"use strict";var s=r.extend({tagName:"tr",template:t.template(e("#group-library-item-tmpl").html()),events:{"click .repo-unshare-btn":"unshareGroupLibrary"},initialize:function(){r.prototype.initialize.call(this)},unshareGroupLibrary:function(){var t=this,i=this.model.get("name"),r=gettext("Unshare Library"),s=gettext("Are you sure you want to unshare %s ?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-group-library",group_id:t.model.get("group_id"),repo_id:t.model.get("repo_id")}),type:"DELETE",beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$el.remove();var e=gettext("Successfully unshared library {placeholder}").replace("{placeholder}",i);n.feedback(e,"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};return n.showConfirm(r,s,o),!1},render:function(){var e=this.model.toJSON(),t=n.isHiDPI()?48:24,i=this.model.getIconUrl(t);return e.icon_url=i,e.icon_title=this.model.getIconTitle(),e.formatted_size=n.fileSizeFormat(e.size,1),e.enable_sys_admin_view_repo=app.pageOptions.enable_sys_admin_view_repo,e.is_pro=app.pageOptions.is_pro,this.$el.html(this.template(e)),this}});return s}),define("sysadmin-app/models/group-repo",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({getIconUrl:function(e){var t=this.get("encrypted"),n="r"==this.get("permission");return i.getLibIconUrl(t,n,e)},getIconTitle:function(){var e=this.get("encrypted"),t="r"==this.get("permission");return i.getLibIconTitle(e,t)}});return n}),define("sysadmin-app/collection/group-repos",["underscore","backbone","common","sysadmin-app/models/group-repo"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,setGroupId:function(e){this.group_id=e},parse:function(e){return this.group_name=e.group_name,e.libraries},url:function(){return i.getUrl({name:"admin-group-libraries",group_id:this.group_id})}});return r}),define("sysadmin-app/views/group-repos",["jquery","underscore","backbone","common","sysadmin-app/views/group-repo","sysadmin-app/collection/group-repos"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"admin-groups",tabNavTemplate:t.template(e("#groups-tabnav-tmpl").html()),template:t.template(e("#group-libraries-tmpl").html()),initialize:function(){this.groupRepoCollection=new s,this.listenTo(this.groupRepoCollection,"add",this.addOne),this.listenTo(this.groupRepoCollection,"reset",this.reset)},render:function(){var t=this.groupRepoCollection.group_id;this.$el.html(this.tabNavTemplate({cur_tab:"libs",group_id:t})+this.template()),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.groupRepoCollection.setGroupId(t),this.render(),this.showGroupLibraries()},showGroupLibraries:function(){this.initPage();this.groupRepoCollection.fetch({cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},reset:function(){this.$loadingTip.hide(),this.groupRepoCollection.length>0?(this.groupRepoCollection.each(this.addOne,this),this.$table.show()):this.$emptyTip.show(),this.$(".path-bar").append(this.groupRepoCollection.group_name)},addOne:function(e){var t=new r({model:e});this.$tableBody.append(t.render().el)}});return o}),define("sysadmin-app/views/group-member",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,i,n,r){"use strict";var s=r.extend({tagName:"tr",template:t.template(e("#group-member-item-tmpl").html()),events:{"click .user-role-edit-icon":"showEdit","change .user-role-select":"editRole","click .member-delete-btn":"deleteGroupMember"},initialize:function(){r.prototype.initialize.call(this),this.listenTo(this.model,"change",this.render);var t=this;e(document).on("click",function(e){var i=e.target||event.srcElement;t.$(".user-role-edit-icon, .user-role-select").is(i)||(t.$(".cur-role, .user-role-edit-icon").show(),t.$(".user-role-select").hide())})},showEdit:function(){this.$(".cur-role, .user-role-edit-icon").hide(),this.$(".user-role-select").show()},editRole:function(){var t=this,i=this.$('[name="role"]').val(),r=1==i;e.ajax({url:n.getUrl({name:"admin-group-member",group_id:t.model.get("group_id"),email:t.model.get("email")}),type:"put",dataType:"json",beforeSend:n.prepareCSRFToken,data:{is_admin:r},success:function(e){t.model.set({is_admin:e.is_admin,role:e.role})},error:function(t){var i;i=t.responseText?e.parseJSON(t.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(i,"error")}})},deleteGroupMember:function(){var t=this,i=this.model.get("email"),r=gettext("Delete Member"),s=gettext("Are you sure you want to delete %s ?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-group-member",group_id:t.model.get("group_id"),email:i}),type:"DELETE",beforeSend:n.prepareCSRFToken,dataType:"json",success:function(){t.$el.remove();var e=gettext("Successfully deleted member {placeholder}").replace("{placeholder}",i);n.feedback(e,"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};return n.showConfirm(r,s,o),!1},render:function(){return this.$el.html(this.template(this.model.toJSON())),this}});return s}),define("sysadmin-app/models/group-member",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({});return n}),define("sysadmin-app/collection/group-members",["underscore","backbone","common","sysadmin-app/models/group-member"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,setGroupId:function(e){this.group_id=e},parse:function(e){return this.group_name=e.group_name,e.members},url:function(){return i.getUrl({name:"admin-group-members",group_id:this.group_id})}});return r}),define("sysadmin-app/views/group-members",["jquery","underscore","backbone","common","sysadmin-app/views/group-member","sysadmin-app/collection/group-members"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"admin-groups",tabNavTemplate:t.template(e("#groups-tabnav-tmpl").html()),template:t.template(e("#group-members-tmpl").html()),addMemberFormTemplate:t.template(e("#add-group-member-form-tmpl").html()),initialize:function(){this.groupMemberCollection=new s,this.listenTo(this.groupMemberCollection,"add",this.addOne),this.listenTo(this.groupMemberCollection,"reset",this.reset)},events:{"click #js-add-group-member":"addGroupMember"},addGroupMember:function(){var t=e(this.addMemberFormTemplate()),i=this;return t.modal(),e("#simplemodal-container").css({height:"auto",width:"auto"}),e('[name="email"]',t).select2(e.extend(n.contactInputOptionsForSelect2(),{width:"275px",containerCss:{"margin-bottom":"5px"},placeholder:gettext("Search user or enter email and press Enter")})),t.submit(function(){var r=i.groupMemberCollection.group_id,s=e.trim(e('[name="email"]',t).val()),o=e(".error",t),a=e('[type="submit"]',t);if(!s)return o.html(gettext("Email is required.")).show(),!1;for(var l=[],c=s.split(","),u=0;u<c.length;u++)l.push(c[u]);return o.hide(),n.disableButton(a),e.ajax({url:n.getUrl({name:"admin-group-members",group_id:r}),type:"POST",dataType:"json",beforeSend:n.prepareCSRFToken,traditional:!0,data:{email:l},success:function(t){t.success.length>0&&i.groupMemberCollection.add(t.success,{prepend:!0});var r="";t.failed.length>0?(e(t.failed).each(function(e,t){r+=n.HTMLescape(t.email)+": "+n.HTMLescape(t.error_msg)+"<br />"}),o.html(r).show(),n.enableButton(a)):n.closeModal()},error:function(e,t,i){var r;r=e.responseText?e.responseJSON.error_msg:gettext("Please check the network."),o.html(r).show(),n.enableButton(a)}}),!1}),!1},render:function(){var t=this.groupMemberCollection.group_id;this.$el.html(this.tabNavTemplate({cur_tab:"members",group_id:t})+this.template()),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.groupMemberCollection.setGroupId(t),this.render(),this.showGroupMembers()},showGroupMembers:function(){this.initPage();this.groupMemberCollection.fetch({cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")}})},reset:function(){this.$loadingTip.hide(),this.groupMemberCollection.length>0?(this.groupMemberCollection.each(this.addOne,this),this.$table.show()):this.$emptyTip.show(),this.$(".path-bar").append(this.groupMemberCollection.group_name)},addOne:function(e,t,i){var n=new r({model:e});i.prepend?this.$tableBody.prepend(n.render().el):this.$tableBody.append(n.render().el)}});return o}),define("sysadmin-app/views/admin-operation-log",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#admin-log-item-tmpl").html()),events:{},initialize:function(){s.prototype.initialize.call(this)},render:function(){var e={email:this.model.get("email")},t=r(this.model.get("datetime"));e.time=t.format("LLLL"),e.time_from_now=n.getRelativeTimeStr(t);var i=this.model.get("detail"),s=function(e){return app.config.siteRoot+"useradmin/info/"+encodeURIComponent(e)+"/"};switch(e.admin_user_url=s(e.email),this.model.get("operation")){case"repo_create":e.op_title=gettext("Create Library"),e.op_details=gettext("Created library {library_name} with {owner} as its owner").replace("{owner}",'<a href="'+s(i.owner)+'">'+n.HTMLescape(i.owner)+"</a>"),app.pageOptions.is_pro&&app.pageOptions.enable_sys_admin_view_repo?e.op_details=e.op_details.replace("{library_name}",'<a href="#libs/'+encodeURIComponent(i.id)+'/">'+n.HTMLescape(i.name)+"</a>"):e.op_details=e.op_details.replace("{library_name}",'<span class="bold" title="'+i.id+'">'+n.HTMLescape(i.name)+"</span>");break;case"repo_delete":e.op_title=gettext("Delete Library"),e.op_details=gettext("Deleted library {library_name}").replace("{library_name}",'<span class="bold" title="'+i.id+'">'+n.HTMLescape(i.name)+"</span>");break;case"repo_transfer":e.op_title=gettext("Transfer Library"),e.op_details=gettext("Transferred library {library_name} from {user_from} to {user_to}").replace("{user_from}",'<a href="'+s(i.from)+'">'+n.HTMLescape(i.from)+"</a>").replace("{user_to}",'<a href="'+s(i.to)+'">'+n.HTMLescape(i.to)+"</a>"),app.pageOptions.is_pro&&app.pageOptions.enable_sys_admin_view_repo?e.op_details=e.op_details.replace("{library_name}",'<a href="#libs/'+encodeURIComponent(i.id)+'/">'+n.HTMLescape(i.name)+"</a>"):e.op_details=e.op_details.replace("{library_name}",'<span class="bold" title="'+i.id+'">'+n.HTMLescape(i.name)+"</span>");break;case"group_create":e.op_title=gettext("Create Group"),e.op_details=gettext("Created group {group_name}").replace("{group_name}",'<a href="#groups/'+encodeURIComponent(i.id)+'/">'+n.HTMLescape(i.name)+"</a>");break;case"group_transfer":e.op_title=gettext("Transfer Group"),e.op_details=gettext("Transferred group {group_name} from {user_from} to {user_to}").replace("{group_name}",'<a href="#groups/'+encodeURIComponent(i.id)+'/">'+n.HTMLescape(i.name)+"</a>").replace("{user_from}",'<a href="'+s(i.from)+'">'+n.HTMLescape(i.from)+"</a>").replace("{user_to}",'<a href="'+s(i.to)+'">'+n.HTMLescape(i.to)+"</a>");break;case"group_delete":e.op_title=gettext("Delete Group"),e.op_details=gettext("Deleted group {group_name}").replace("{group_name}",'<span class="bold" title="'+i.id+'">'+n.HTMLescape(i.name)+"</span>");break;case"user_add":e.op_title=gettext("Add User"),e.op_details=gettext("Added user {user}").replace("{user}",'<a href="'+s(i.email)+'">'+n.HTMLescape(i.email)+"</a>");break;case"user_delete":e.op_title=gettext("Delete User"),e.op_details=gettext("Deleted user {user}").replace("{user}",'<span class="bold">'+n.HTMLescape(i.email)+"</span>")}return this.$el.html(this.template(e)),this}});return o}),define("sysadmin-app/models/admin-operation-log",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({});return n}),define("sysadmin-app/collection/admin-operation-logs",["underscore","backbone.paginator","common","sysadmin-app/models/admin-operation-log"],function(e,t,i,n){"use strict";var r=Backbone.PageableCollection.extend({model:n,url:function(){return i.getUrl({name:"admin-operation-logs"})},state:{firstPage:1,pageSize:100},queryParams:{currentPage:"page",pageSize:"per_page",totalPages:null,totalRecords:null},parseState:function(e){return{totalRecords:e.total_count}},parseRecords:function(e){return e.data}});return r}),define("sysadmin-app/views/admin-operation-logs",["jquery","underscore","backbone","common","sysadmin-app/views/admin-operation-log","sysadmin-app/collection/admin-operation-logs"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"admin-logs",template:t.template(e("#admin-operation-logs-tmpl").html()),initialize:function(){this.adminOperationLogCollection=new s,this.listenTo(this.adminOperationLogCollection,"add",this.addOne),this.listenTo(this.adminOperationLogCollection,"reset",this.reset),this.render()},render:function(){this.$el.html(this.template()),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$jsPrevious=this.$(".js-previous"),this.$jsNext=this.$(".js-next")},events:{"click #paginator .js-next":"getNextPage","click #paginator .js-previous":"getPreviousPage"},getNextPage:function(){return this.initPage(),this.adminOperationLogCollection.getNextPage({reset:!0}),!1},getPreviousPage:function(){return this.initPage(),this.adminOperationLogCollection.getPreviousPage({reset:!0}),!1},initPage:function(){this.$loadingTip.show(),this.$table.hide(),this.$tableBody.empty(),this.$emptyTip.hide(),this.$jsNext.hide(),this.$jsPrevious.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.getContent()},renderPaginator:function(){this.adminOperationLogCollection.hasNextPage()?this.$jsNext.show():this.$jsNext.hide(),this.adminOperationLogCollection.hasPreviousPage()?this.$jsPrevious.show():this.$jsPrevious.hide()},getContent:function(){this.initPage();var t=this,i=parseInt(this.option.current_page)||1,r=parseInt(this.adminOperationLogCollection.state.firstPage),s=parseInt(this.adminOperationLogCollection.state.totalPages);r<=i&&i<=s?this.adminOperationLogCollection.getPage(i).done(function(){t.$loadingTip.hide();var e=t.adminOperationLogCollection.state.currentPage;app.router.navigate("admin-operation-logs/?page="+e),t.adminOperationLogCollection.length>0?t.$table.show():t.$emptyTip.show(),t.renderPaginator()}):(t.adminOperationLogCollection.state.currentPage=1,this.adminOperationLogCollection.fetch({cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")},complete:function(){t.$loadingTip.hide()}}))},addOne:function(e){var t=new r({model:e});this.$tableBody.append(t.render().el)},reset:function(){this.$loadingTip.hide();var e=this.adminOperationLogCollection.state.currentPage;app.router.navigate("admin-operation-logs/?page="+e),this.adminOperationLogCollection.length>0?(this.adminOperationLogCollection.each(this.addOne,this),this.$table.show()):this.$emptyTip.show(),this.renderPaginator()}});return o}),define("sysadmin-app/views/admin-login-log",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#admin-login-log-item-tmpl").html()),events:{},initialize:function(){s.prototype.initialize.call(this)},render:function(){var e={email:this.model.get("email"),login_ip:this.model.get("login_ip"),login_success:this.model.get("login_success")},t=r(this.model.get("login_time"));e.time=t.format("LLLL"),e.time_from_now=n.getRelativeTimeStr(t);var i=function(e){return app.config.siteRoot+"useradmin/info/"+encodeURIComponent(e)+"/"};return e.admin_user_url=i(e.email),this.$el.html(this.template(e)),this}});return o}),define("sysadmin-app/models/admin-login-log",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({});return n}),define("sysadmin-app/collection/admin-login-logs",["underscore","backbone.paginator","common","sysadmin-app/models/admin-login-log"],function(e,t,i,n){"use strict";var r=Backbone.PageableCollection.extend({model:n,url:function(){return i.getUrl({name:"admin-login-logs"})},state:{firstPage:1,pageSize:100},queryParams:{currentPage:"page",pageSize:"per_page",totalPages:null,totalRecords:null},parseState:function(e){return{totalRecords:e.total_count}},parseRecords:function(e){return e.data}});return r}),define("sysadmin-app/views/admin-login-logs",["jquery","underscore","backbone","common","sysadmin-app/views/admin-login-log","sysadmin-app/collection/admin-login-logs"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"admin-login-logs",template:t.template(e("#admin-login-logs-tmpl").html()),initialize:function(){this.adminLoginLogCollection=new s,this.listenTo(this.adminLoginLogCollection,"add",this.addOne),this.listenTo(this.adminLoginLogCollection,"reset",this.reset),this.render()},render:function(){this.$el.html(this.template()),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$jsPrevious=this.$(".js-previous"),this.$jsNext=this.$(".js-next")},events:{"click #paginator .js-next":"getNextPage","click #paginator .js-previous":"getPreviousPage"},getNextPage:function(){return this.initPage(),this.adminLoginLogCollection.getNextPage({reset:!0}),!1},getPreviousPage:function(){return this.initPage(),this.adminLoginLogCollection.getPreviousPage({reset:!0}),!1},initPage:function(){this.$loadingTip.show(),this.$table.hide(),this.$tableBody.empty(),this.$emptyTip.hide(),this.$jsNext.hide(),this.$jsPrevious.hide()},hide:function(){this.$el.detach(),this.attached=!1},show:function(t){this.option=t,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.getContent()},renderPaginator:function(){this.adminLoginLogCollection.hasNextPage()?this.$jsNext.show():this.$jsNext.hide(),this.adminLoginLogCollection.hasPreviousPage()?this.$jsPrevious.show():this.$jsPrevious.hide()},getContent:function(){this.initPage();var t=this,i=parseInt(this.option.current_page)||1,r=parseInt(this.adminLoginLogCollection.state.firstPage),s=parseInt(this.adminLoginLogCollection.state.totalPages);r<=i&&i<=s?this.adminLoginLogCollection.getPage(i).done(function(){t.$loadingTip.hide();var e=t.adminLoginLogCollection.state.currentPage;app.router.navigate("admin-login-logs/?page="+e),t.adminLoginLogCollection.length>0?t.$table.show():t.$emptyTip.show(),t.renderPaginator()}):(t.adminLoginLogCollection.state.currentPage=1,this.adminLoginLogCollection.fetch({cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?401==i.status||403==i.status?gettext("Permission error"):e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")},complete:function(){t.$loadingTip.hide()}}))},addOne:function(e){var t=new r({model:e});this.$tableBody.append(t.render().el)},reset:function(){this.$loadingTip.hide();var e=this.adminLoginLogCollection.state.currentPage;app.router.navigate("admin-login-logs/?page="+e),this.adminLoginLogCollection.length>0?(this.adminLoginLogCollection.each(this.addOne,this),this.$table.show()):this.$emptyTip.show(),this.renderPaginator()}});return o}),define("sysadmin-app/views/device-trusted-ipaddress",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,i,n,r,s){"use strict";var o=s.extend({tagName:"tr",template:t.template(e("#device-trusted-ipaddress-item-tmpl").html()),events:{"click .trusted-ip-delete-btn":"deleteIP"},initialize:function(){s.prototype.initialize.call(this)},deleteIP:function(){var t=this,i=this.model.get("ip"),r=gettext("Delete"),s=gettext("Are you sure you want to delete %s ?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target" title="'+n.HTMLescape(i)+'">'+n.HTMLescape(i)+"</span>"),o=function(){e.ajax({url:n.getUrl({name:"admin-device-trusted-ip"}),type:"DELETE",cache:!1,data:{ipaddress:i},dataType:"JSON",beforeSend:n.prepareCSRFToken,success:function(e){t.$el.remove(),n.feedback(gettext("Successfully deleted 1 item."),"success")},error:function(e,t,i){n.ajaxErrorHandler(e,t,i)},complete:function(){e.modal.close()}})};return n.showConfirm(r,s,o),!1},render:function(){var e=this.model.toJSON();return this.$el.html(this.template(e)),this}});return o}),define("sysadmin-app/models/device-trusted-ipaddress",["underscore","backbone","common"],function(e,t,i){"use strict";var n=t.Model.extend({});return n}),define("sysadmin-app/collection/device-trusted-ipaddresses",["underscore","backbone","common","sysadmin-app/models/device-trusted-ipaddress"],function(e,t,i,n){"use strict";var r=t.Collection.extend({model:n,url:function(){return i.getUrl({name:"admin-device-trusted-ip"})}});return r}),define("sysadmin-app/views/device-trusted-ipaddresses",["jquery","underscore","backbone","common","sysadmin-app/views/device-trusted-ipaddress","sysadmin-app/collection/device-trusted-ipaddresses"],function(e,t,i,n,r,s){"use strict";var o=i.View.extend({id:"admin-device-trusted-ip",template:t.template(e("#device-trusted-ipaddresses-tmpl").html()),ipAddFormtemplate:t.template(e("#add-trusted-ipaddress-form-tmpl").html()),initialize:function(){this.deviceTrustedIPAddressCollection=new s,this.listenTo(this.deviceTrustedIPAddressCollection,"add",this.addOne),this.listenTo(this.deviceTrustedIPAddressCollection,"reset",this.reset),this.render()},events:{"click #add-trusted-ip-btn":"showAddTrustedIpForm"},showAddTrustedIpForm:function(){var t=e(this.ipAddFormtemplate()),i=this.deviceTrustedIPAddressCollection;return t.modal(),e("#simplemodal-container").css({width:"auto",height:"auto"}),t.submit(function(){var r=e("add-ip-form-btn",t),s=e.trim(e("#ipaddress",t).val()),o=e(".error",t);return s?(o.hide(),n.disableButton(r),i.create({ipaddress:s},{prepend:!0,wait:!0,success:function(){1==i.length&&i.reset(i.models),n.closeModal()},error:function(t,i,s){var a;a=i.responseText?e.parseJSON(i.responseText).error_msg:gettext("Please check the network."),o.html(a).show(),n.enableButton(r)}}),!1):(o.html(gettext("It is required.")).show(),False)}),!1},render:function(){this.$el.html(this.template({cur_tab:"settings",is_pro:app.pageOptions.is_pro})),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$error=this.$(".error")},hide:function(){this.$el.detach(),this.attached=!1},show:function(){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showAdminDeviceTrustedIP()},initPage:function(){this.$loadingTip.show(),this.$table.hide(),this.$tableBody.empty(),this.$error.hide(),this.$emptyTip.hide()},showAdminDeviceTrustedIP:function(){this.initPage();var t=this;this.deviceTrustedIPAddressCollection.fetch({
cache:!1,reset:!0,error:function(t,i,r){var s;s=i.responseText?e.parseJSON(i.responseText).error_msg:gettext("Failed. Please check the network."),n.feedback(s,"error")},complete:function(){t.$loadingTip.hide()}})},reset:function(){this.initPage(),this.$loadingTip.hide(),this.deviceTrustedIPAddressCollection.length>0?(this.deviceTrustedIPAddressCollection.each(this.addOne,this),this.$table.show()):this.$emptyTip.show()},addOne:function(e,t,i){var n=new r({model:e});i.prepend?this.$tableBody.prepend(n.render().el):this.$tableBody.append(n.render().el)}});return o}),define("app/views/widgets/popover",["jquery","underscore","backbone","common"],function(e,t,i,n){"use strict";e(document).click(function(e){var t=app.ui.currentPopover,i=e.target||event.srcElement;return!t||(t.$el.is(i)||t.$el.find("*").is(i)||t.hide(),!0)}),e(document).keydown(function(e){if(27==e.keyCode){var t=app.ui.currentPopover;t&&t.hide()}}),e(window).resize(function(){var e=app.ui.currentPopover;return!e||void e.setConMaxHeight()});var r=i.View.extend({initialize:function(e){this.$el.on("click",".js-close",t.bind(this.hide,this))},setConMaxHeight:function(){this.$(".sf-popover-con").css({"max-height":e(window).height()-this.$el.offset().top-this.$(".sf-popover-hd").outerHeight(!0)-2})},hide:function(){return app.ui.currentPopover=null,this.$el.detach(),!1},show:function(){app.ui.currentPopover=this,this.showContent(),this.setConMaxHeight()},toggle:function(){return app.ui.currentPopover?app.ui.currentPopover!=this?(app.ui.currentPopover.hide(),this.show()):this.hide():this.show(),!1}});return r}),define("app/views/account",["jquery","underscore","backbone","common","app/views/widgets/popover"],function(e,t,i,n,r){"use strict";var s=r.extend({id:"user-info-popup",className:"sf-popover account-popup",template:t.template(e("#user-info-popup-tmpl").html()),initialize:function(t){r.prototype.initialize.call(this),this.render(),this.$loadingTip=this.$(".loading-tip"),this.$error=this.$(".error"),this.$space=this.$("#space-traffic"),this.$account=e("#account");var i=this;e("#my-info").click(function(){return i.toggle(),!1})},render:function(){return this.$el.html(this.template()),this},showContent:function(){var t=this;this.$error.hide(),this.$loadingTip.show(),this.$space.addClass("hide"),e.ajax({url:n.getUrl({name:"space_and_traffic"}),dataType:"json",cache:!1,success:function(e){t.$loadingTip.hide(),t.$space.html(e.html).removeClass("hide")},error:function(i,n,r){t.$loadingTip.hide();var s;s=i.responseText?e.parseJSON(i.responseText).error:gettext("Please check the network."),t.$error.html(s).show()}}),this.$account.append(this.$el)}});return s}),define("sysadmin-app/router",["jquery","backbone","common","sysadmin-app/views/side-nav","sysadmin-app/views/dashboard","sysadmin-app/views/desktop-devices","sysadmin-app/views/mobile-devices","sysadmin-app/views/device-errors","sysadmin-app/views/repos","sysadmin-app/views/search-repos","sysadmin-app/views/system-repo","sysadmin-app/views/trash-repos","sysadmin-app/views/search-trash-repos","sysadmin-app/views/dir","sysadmin-app/views/groups","sysadmin-app/views/search-groups","sysadmin-app/views/group-repos","sysadmin-app/views/group-members","sysadmin-app/views/admin-operation-logs","sysadmin-app/views/admin-login-logs","sysadmin-app/views/device-trusted-ipaddresses","app/views/account"],function(e,t,i,n,r,s,o,a,l,c,u,d,h,p,f,m,g,v,_,y,Y,b){"use strict";var L=t.Router.extend({routes:{"":"showDashboard","dashboard/":"showDashboard","desktop-devices/":"showDesktopDevices","mobile-devices/":"showMobileDevices","device-errors/":"showDeviceErrors","device-trusted-ip/":"showDeviceTrustedIP","all-libs/":"showLibraries","search-libs/":"showSearchLibraries","system-lib/":"showSystemLibrary","trash-libs/":"showTrashLibraries","search-trash-libs/":"showSearchTrashLibraries","libs/:repo_id(/*path)":"showLibraryDir","groups/":"showGroups","search-groups/":"showSearchGroups","groups/:group_id/":"showGroupLibraries","groups/:group_id/libs/":"showGroupLibraries","groups/:group_id/members/":"showGroupMembers","admin-operation-logs/":"showAdminOperationLogs","admin-login-logs/":"showAdminLoginLogs","*actions":"showDashboard"},initialize:function(){e("#initial-loading-view").hide(),i.prepareApiCsrf(),i.initLocale(),this.sideNavView=new n,app.ui={sideNavView:this.sideNavView},this.dashboardView=new r,this.desktopDevicesView=new s,this.mobileDevicesView=new o,this.deviceErrorsView=new a,this.deviceTrustedIPView=new Y,this.reposView=new l,this.searchReposView=new c,this.systemReposView=new u,this.trashReposView=new d,this.searchTrashReposView=new h,this.dirView=new p,this.groupsView=new f,this.searchGroupsView=new m,this.groupReposView=new g,this.groupMembersView=new v,this.adminOperationLogsview=new _,this.adminLoginLogsView=new y,app.ui.accountView=this.accountView=new b,this.currentView=this.dashboardView,e("#info-bar .close").click(i.closeTopNoticeBar)},switchCurrentView:function(e){this.currentView!=e&&(this.currentView.hide(),this.currentView=e)},showDashboard:function(){return!!app.pageOptions.admin_permissions.can_view_system_info&&(this.switchCurrentView(this.dashboardView),this.sideNavView.setCurTab("dashboard"),void this.dashboardView.show())},showDesktopDevices:function(e){if(!app.pageOptions.is_default_admin)return this.showDashboard(),!1;var t=window.location.href,i=t.match(/.*?page=(\d+)/);if(i)var e=i[1];else var e=null;this.switchCurrentView(this.desktopDevicesView),this.sideNavView.setCurTab("devices"),this.desktopDevicesView.show({current_page:e})},showMobileDevices:function(e){if(!app.pageOptions.is_default_admin)return this.showDashboard(),!1;var t=window.location.href,i=t.match(/.*?page=(\d+)/);e=i?i[1]:null,this.switchCurrentView(this.mobileDevicesView),this.sideNavView.setCurTab("devices"),this.mobileDevicesView.show({current_page:e})},showDeviceErrors:function(){return app.pageOptions.is_default_admin?(this.switchCurrentView(this.deviceErrorsView),this.sideNavView.setCurTab("devices"),void this.deviceErrorsView.show()):(this.showDashboard(),!1)},showDeviceTrustedIP:function(){this.switchCurrentView(this.deviceTrustedIPView),this.sideNavView.setCurTab("devices"),this.deviceTrustedIPView.show()},showLibraries:function(){if(!app.pageOptions.admin_permissions.can_manage_library)return this.showDashboard(),!1;var e=location.href.match(/.*?page=(\d+)/),t=e?e[1]:1;this.switchCurrentView(this.reposView),this.sideNavView.setCurTab("libraries",{option:"all"}),this.reposView.show({page:t})},showSearchLibraries:function(){if(!app.pageOptions.admin_permissions.can_manage_library)return this.showDashboard(),!1;var e=location.href.match(/.*?name=(.*)&owner=(.*)/),t=e?e[1]:"",i=e?e[2]:"";this.switchCurrentView(this.searchReposView),this.sideNavView.setCurTab("libraries",{option:"search"}),this.searchReposView.show({name:decodeURIComponent(t),owner:decodeURIComponent(i)})},showLibraryDir:function(e,t){return app.pageOptions.admin_permissions.can_manage_library?(t=t?"/"+t:"/",this.switchCurrentView(this.dirView),this.dirView.show(e,t),void this.sideNavView.setCurTab("libraries",{option:""})):(this.showDashboard(),!1)},showSystemLibrary:function(){return app.pageOptions.admin_permissions.can_manage_library?(this.switchCurrentView(this.systemReposView),this.sideNavView.setCurTab("libraries",{option:"system"}),void this.systemReposView.show()):(this.showDashboard(),!1)},showTrashLibraries:function(){if(!app.pageOptions.admin_permissions.can_manage_library)return this.showDashboard(),!1;var e=location.href.match(/.*?page=(\d+)/),t=e?e[1]:1;this.switchCurrentView(this.trashReposView),this.sideNavView.setCurTab("libraries",{option:"trash"}),this.trashReposView.show({page:t})},showSearchTrashLibraries:function(){if(!app.pageOptions.admin_permissions.can_manage_library)return this.showDashboard(),!1;var e=location.href.match(/.*?name=(.*)/),t=e?e[1]:"";this.switchCurrentView(this.searchTrashReposView),this.sideNavView.setCurTab("libraries",{option:"trash"}),this.searchTrashReposView.show({owner:decodeURIComponent(t)})},showGroups:function(){if(!app.pageOptions.admin_permissions.can_manage_group)return this.showDashboard(),!1;var e=location.href.match(/.*?page=(\d+)/),t=e?e[1]:1;this.switchCurrentView(this.groupsView),this.sideNavView.setCurTab("groups"),this.groupsView.show({page:t})},showSearchGroups:function(){if(!app.pageOptions.admin_permissions.can_manage_group)return this.showDashboard(),!1;var e=location.href.match(/.*?name=(.*)/),t=e?e[1]:"";this.switchCurrentView(this.searchGroupsView),this.sideNavView.setCurTab("groups",{option:"search"}),this.searchGroupsView.show({name:decodeURIComponent(t)})},showGroupLibraries:function(e){return app.pageOptions.admin_permissions.can_manage_group?(this.switchCurrentView(this.groupReposView),this.sideNavView.setCurTab("groups"),void this.groupReposView.show(e)):(this.showDashboard(),!1)},showGroupMembers:function(e){return app.pageOptions.admin_permissions.can_manage_group?(this.switchCurrentView(this.groupMembersView),this.sideNavView.setCurTab("groups"),void this.groupMembersView.show(e)):(this.showDashboard(),!1)},showAdminOperationLogs:function(){if(!app.pageOptions.admin_permissions.can_view_admin_log)return this.showDashboard(),!1;var e=window.location.href,t=e.match(/.*?page=(\d+)/);if(t)var i=t[1];else var i=null;this.switchCurrentView(this.adminOperationLogsview),this.sideNavView.setCurTab("admin-logs"),this.adminOperationLogsview.show({current_page:i})},showAdminLoginLogs:function(){var e=window.location.href,t=e.match(/.*?page=(\d+)/);if(t)var i=t[1];else var i=null;this.switchCurrentView(this.adminLoginLogsView),this.sideNavView.setCurTab("admin-logs"),this.adminLoginLogsView.show({current_page:i})}});return L}),define("sysadmin-app/main",["sysadmin-app/router"],function(e){app.router=new e,Backbone.history.start()}),require(["./common"],function(e){require(["sysadmin-app/main"])}),define("sysadmin-main",function(){});