/*!
 * 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

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

/**
 * marked - a markdown parser
 * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
 * https://github.com/chjj/marked
 */

/*! jQuery UI - v1.11.3 - 2015-02-28
* http://jqueryui.com
* Includes: core.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 - 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 UI - v1.11.3 - 2015-02-28
* http://jqueryui.com
* Includes: progressbar.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */

/*!
 * jQuery UI Progressbar 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/progressbar/
 */

/*! Magnific Popup - v1.0.0 - 2014-12-12
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2014 Dmitry Semenov; */

/*! 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 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/
 */

/*
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 Iframe Transport Plugin 1.4
 * https://github.com/blueimp/jQuery-File-Upload
 *
 * Copyright 2011, Sebastian Tschan
 * https://blueimp.net
 *
 * Licensed under the MIT license:
 * http://www.opensource.org/licenses/MIT
 */

/*
 * jQuery File Upload Plugin 5.42.1
 * 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 File Processing Plugin 1.3.0
 * 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 1.1.2
 * 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 9.6.0
 * 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){typeof module=="object"&&typeof module.exports=="object"?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)})(typeof window!="undefined"?window:this,function(e,t){function g(e){var t=e.length,n=h.type(e);return n==="function"||h.isWindow(e)?!1:e.nodeType===1&&t?!0:n==="array"||t===0||typeof t=="number"&&t>0&&t-1 in e}function S(e,t,n){if(h.isFunction(t))return h.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return h.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(E.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,function(e){return h.inArray(e,t)>=0!==n})}function A(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function _(e){var t=M[e]={};return h.each(e.match(O)||[],function(e,n){t[n]=!0}),t}function P(){T.addEventListener?(T.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(T.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))}function H(){if(T.addEventListener||event.type==="load"||T.readyState==="complete")P(),h.ready()}function q(e,t,n){if(n===undefined&&e.nodeType===1){var r="data-"+t.replace(I,"-$1").toLowerCase();n=e.getAttribute(r);if(typeof n=="string"){try{n=n==="true"?!0:n==="false"?!1:n==="null"?null:+n+""===n?+n:F.test(n)?h.parseJSON(n):n}catch(i){}h.data(e,t,n)}else n=undefined}return n}function R(e){var t;for(t in e){if(t==="data"&&h.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function U(e,t,r,i){if(!h.acceptData(e))return;var s,o,u=h.expando,a=e.nodeType,f=a?h.cache:e,l=a?e[u]:e[u]&&u;if((!l||!f[l]||!i&&!f[l].data)&&r===undefined&&typeof t=="string")return;l||(a?l=e[u]=n.pop()||h.guid++:l=u),f[l]||(f[l]=a?{}:{toJSON:h.noop});if(typeof t=="object"||typeof t=="function")i?f[l]=h.extend(f[l],t):f[l].data=h.extend(f[l].data,t);return o=f[l],i||(o.data||(o.data={}),o=o.data),r!==undefined&&(o[h.camelCase(t)]=r),typeof t=="string"?(s=o[t],s==null&&(s=o[h.camelCase(t)])):s=o,s}function z(e,t,n){if(!h.acceptData(e))return;var r,i,s=e.nodeType,o=s?h.cache:e,u=s?e[h.expando]:h.expando;if(!o[u])return;if(t){r=n?o[u]:o[u].data;if(r){h.isArray(t)?t=t.concat(h.map(t,h.camelCase)):t in r?t=[t]:(t=h.camelCase(t),t in r?t=[t]:t=t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!R(r):!h.isEmptyObject(r))return}}if(!n){delete o[u].data;if(!R(o[u]))return}s?h.cleanData([e],!0):l.deleteExpando||o!=o.window?delete o[u]:o[u]=null}function et(){return!0}function tt(){return!1}function nt(){try{return T.activeElement}catch(e){}}function rt(e){var t=it.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function wt(e,t){var n,r,i=0,s=typeof e.getElementsByTagName!==B?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==B?e.querySelectorAll(t||"*"):undefined;if(!s)for(s=[],n=e.childNodes||e;(r=n[i])!=null;i++)!t||h.nodeName(r,t)?s.push(r):h.merge(s,wt(r,t));return t===undefined||t&&h.nodeName(e,t)?h.merge([e],s):s}function Et(e){J.test(e.type)&&(e.defaultChecked=e.checked)}function St(e,t){return h.nodeName(e,"table")&&h.nodeName(t.nodeType!==11?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function xt(e){return e.type=(h.find.attr(e,"type")!==null)+"/"+e.type,e}function Tt(e){var t=vt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Nt(e,t){var n,r=0;for(;(n=e[r])!=null;r++)h._data(n,"globalEval",!t||h._data(t[r],"globalEval"))}function Ct(e,t){if(t.nodeType!==1||!h.hasData(e))return;var n,r,i,s=h._data(e),o=h._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)h.event.add(t,n,u[n][r])}o.data&&(o.data=h.extend({},o.data))}function kt(e,t){var n,r,i;if(t.nodeType!==1)return;n=t.nodeName.toLowerCase();if(!l.noCloneEvent&&t[h.expando]){i=h._data(t);for(r in i.events)h.removeEvent(t,r,i.handle);t.removeAttribute(h.expando)}if(n==="script"&&t.text!==e.text)xt(t).text=e.text,Tt(t);else if(n==="object")t.parentNode&&(t.outerHTML=e.outerHTML),l.html5Clone&&e.innerHTML&&!h.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML);else if(n==="input"&&J.test(e.type))t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value);else if(n==="option")t.defaultSelected=t.selected=e.defaultSelected;else if(n==="input"||n==="textarea")t.defaultValue=e.defaultValue}function Ot(t,n){var r,i=h(n.createElement(t)).appendTo(n.body),s=e.getDefaultComputedStyle&&(r=e.getDefaultComputedStyle(i[0]))?r.display:h.css(i[0],"display");return i.detach(),s}function Mt(e){var t=T,n=At[e];if(!n){n=Ot(e,t);if(n==="none"||!n)Lt=(Lt||h("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement),t=(Lt[0].contentWindow||Lt[0].contentDocument).document,t.write(),t.close(),n=Ot(e,t),Lt.detach();At[e]=n}return n}function jt(e,t){return{get:function(){var n=e();if(n==null)return;if(n){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function Vt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Xt.length;while(i--){t=Xt[i]+n;if(t in e)return t}return r}function $t(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o<u;o++){r=e[o];if(!r.style)continue;s[o]=h._data(r,"olddisplay"),n=r.style.display,t?(!s[o]&&n==="none"&&(r.style.display=""),r.style.display===""&&V(r)&&(s[o]=h._data(r,"olddisplay",Mt(r.nodeName)))):(i=V(r),(n&&n!=="none"||!i)&&h._data(r,"olddisplay",i?n:h.css(r,"display")))}for(o=0;o<u;o++){r=e[o];if(!r.style)continue;if(!t||r.style.display==="none"||r.style.display==="")r.style.display=t?s[o]||"":"none"}return e}function Jt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Kt(e,t,n,r,i){var s=n===(r?"border":"content")?4:t==="width"?1:0,o=0;for(;s<4;s+=2)n==="margin"&&(o+=h.css(e,n+X[s],!0,i)),r?(n==="content"&&(o-=h.css(e,"padding"+X[s],!0,i)),n!=="margin"&&(o-=h.css(e,"border"+X[s]+"Width",!0,i))):(o+=h.css(e,"padding"+X[s],!0,i),n!=="padding"&&(o+=h.css(e,"border"+X[s]+"Width",!0,i)));return o}function Qt(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=Pt(e),o=l.boxSizing&&h.css(e,"boxSizing",!1,s)==="border-box";if(i<=0||i==null){i=Ht(e,t,s);if(i<0||i==null)i=e.style[t];if(Dt.test(i))return i;r=o&&(l.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+Kt(e,t,n||(o?"border":"content"),r,s)+"px"}function Gt(e,t,n,r,i){return new Gt.prototype.init(e,t,n,r,i)}function on(){return setTimeout(function(){Yt=undefined}),Yt=h.now()}function un(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=X[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function an(e,t,n){var r,i=(sn[t]||[]).concat(sn["*"]),s=0,o=i.length;for(;s<o;s++)if(r=i[s].call(n,t,e))return r}function fn(e,t,n){var r,i,s,o,u,a,f,c,p=this,d={},v=e.style,m=e.nodeType&&V(e),g=h._data(e,"fxshow");n.queue||(u=h._queueHooks(e,"fx"),u.unqueued==null&&(u.unqueued=0,a=u.empty.fire,u.empty.fire=function(){u.unqueued||a()}),u.unqueued++,p.always(function(){p.always(function(){u.unqueued--,h.queue(e,"fx").length||u.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[v.overflow,v.overflowX,v.overflowY],f=h.css(e,"display"),c=f==="none"?h._data(e,"olddisplay")||Mt(e.nodeName):f,c==="inline"&&h.css(e,"float")==="none"&&(!l.inlineBlockNeedsLayout||Mt(e.nodeName)==="inline"?v.display="inline-block":v.zoom=1)),n.overflow&&(v.overflow="hidden",l.shrinkWrapBlocks()||p.always(function(){v.overflow=n.overflow[0],v.overflowX=n.overflow[1],v.overflowY=n.overflow[2]}));for(r in t){i=t[r];if(en.exec(i)){delete t[r],s=s||i==="toggle";if(i===(m?"hide":"show")){if(i!=="show"||!g||g[r]===undefined)continue;m=!0}d[r]=g&&g[r]||h.style(e,r)}else f=undefined}if(!h.isEmptyObject(d)){g?"hidden"in g&&(m=g.hidden):g=h._data(e,"fxshow",{}),s&&(g.hidden=!m),m?h(e).show():p.done(function(){h(e).hide()}),p.done(function(){var t;h._removeData(e,"fxshow");for(t in d)h.style(e,t,d[t])});for(r in d)o=an(m?g[r]:0,r,p),r in g||(g[r]=o.start,m&&(o.end=o.start,o.start=r==="width"||r==="height"?1:0))}else(f==="none"?Mt(e.nodeName):f)==="inline"&&(v.display=f)}function ln(e,t){var n,r,i,s,o;for(n in e){r=h.camelCase(n),i=t[r],s=e[n],h.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=h.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function cn(e,t,n){var r,i,s=0,o=rn.length,u=h.Deferred().always(function(){delete a.elem}),a=function(){if(i)return!1;var t=Yt||on(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,s=1-r,o=0,a=f.tweens.length;for(;o<a;o++)f.tweens[o].run(s);return u.notifyWith(e,[f,s,n]),s<1&&a?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:h.extend({},t),opts:h.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Yt||on(),duration:n.duration,tweens:[],createTween:function(t,n){var r=h.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(r),r},stop:function(t){var n=0,r=t?f.tweens.length:0;if(i)return this;i=!0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;ln(l,f.opts.specialEasing);for(;s<o;s++){r=rn[s].call(f,e,l,f.opts);if(r)return r}return h.map(l,an,f),h.isFunction(f.opts.start)&&f.opts.start.call(e,f),h.fx.timer(h.extend(a,{elem:e,anim:f,queue:f.opts.queue})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Fn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(O)||[];if(h.isFunction(n))while(r=s[i++])r.charAt(0)==="+"?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function In(e,t,n,r){function o(u){var a;return i[u]=!0,h.each(e[u]||[],function(e,u){var f=u(t,n,r);if(typeof f=="string"&&!s&&!i[f])return t.dataTypes.unshift(f),o(f),!1;if(s)return!(a=f)}),a}var i={},s=e===Hn;return o(t.dataTypes[0])||!i["*"]&&o("*")}function qn(e,t){var n,r,i=h.ajaxSettings.flatOptions||{};for(r in t)t[r]!==undefined&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&h.extend(!0,e,n),e}function Rn(e,t,n){var r,i,s,o,u=e.contents,a=e.dataTypes;while(a[0]==="*")a.shift(),i===undefined&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(o in u)if(u[o]&&u[o].test(i)){a.unshift(o);break}if(a[0]in n)s=a[0];else{for(o in n){if(!a[0]||e.converters[o+" "+a[0]]){s=o;break}r||(r=o)}s=s||r}if(s)return s!==a[0]&&a.unshift(s),n[s]}function Un(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s){e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift();if(s)if(s==="*")s=a;else if(a!=="*"&&a!==s){o=f[a+" "+s]||f["* "+s];if(!o)for(i in f){u=i.split(" ");if(u[1]===s){o=f[a+" "+u[0]]||f["* "+u[0]];if(o){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}}}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}}return{state:"success",data:t}}function Jn(e,t,n,r){var i;if(h.isArray(t))h.each(t,function(t,i){n||Wn.test(e)?r(e,i):Jn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&h.type(t)==="object")for(i in t)Jn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Yn(){try{return new e.XMLHttpRequest}catch(t){}}function Zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function ir(e){return h.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n=[],r=n.slice,i=n.concat,s=n.push,o=n.indexOf,u={},a=u.toString,f=u.hasOwnProperty,l={},c="1.11.2",h=function(e,t){return new h.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,d=/^-ms-/,v=/-([\da-z])/gi,m=function(e,t){return t.toUpperCase()};h.fn=h.prototype={jquery:c,constructor:h,selector:"",length:0,toArray:function(){return r.call(this)},get:function(e){return e!=null?e<0?this[e+this.length]:this[e]:r.call(this)},pushStack:function(e){var t=h.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return h.each(this,e,t)},map:function(e){return this.pushStack(h.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(r.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:s,sort:n.sort,splice:n.splice},h.extend=h.fn.extend=function(){var e,t,n,r,i,s,o=arguments[0]||{},u=1,a=arguments.length,f=!1;typeof o=="boolean"&&(f=o,o=arguments[u]||{},u++),typeof o!="object"&&!h.isFunction(o)&&(o={}),u===a&&(o=this,u--);for(;u<a;u++)if((i=arguments[u])!=null)for(r in i){e=o[r],n=i[r];if(o===n)continue;f&&n&&(h.isPlainObject(n)||(t=h.isArray(n)))?(t?(t=!1,s=e&&h.isArray(e)?e:[]):s=e&&h.isPlainObject(e)?e:{},o[r]=h.extend(f,s,n)):n!==undefined&&(o[r]=n)}return o},h.extend({expando:"jQuery"+(c+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return h.type(e)==="function"},isArray:Array.isArray||function(e){return h.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!h.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||h.type(e)!=="object"||e.nodeType||h.isWindow(e))return!1;try{if(e.constructor&&!f.call(e,"constructor")&&!f.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(l.ownLast)for(t in e)return f.call(e,t);for(t in e);return t===undefined||f.call(e,t)},type:function(e){return e==null?e+"":typeof e=="object"||typeof e=="function"?u[a.call(e)]||"object":typeof e},globalEval:function(t){t&&h.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(d,"ms-").replace(v,m)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,s=e.length,o=g(e);if(n)if(o)for(;i<s;i++){r=t.apply(e[i],n);if(r===!1)break}else for(i in e){r=t.apply(e[i],n);if(r===!1)break}else if(o)for(;i<s;i++){r=t.call(e[i],i,e[i]);if(r===!1)break}else for(i in e){r=t.call(e[i],i,e[i]);if(r===!1)break}return e},trim:function(e){return e==null?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return e!=null&&(g(Object(e))?h.merge(n,typeof e=="string"?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(o)return o.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){var n=+t.length,r=0,i=e.length;while(r<n)e[i++]=t[r++];if(n!==n)while(t[r]!==undefined)e[i++]=t[r++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length,u=!n;for(;s<o;s++)r=!t(e[s],s),r!==u&&i.push(e[s]);return i},map:function(e,t,n){var r,s=0,o=e.length,u=g(e),a=[];if(u)for(;s<o;s++)r=t(e[s],s,n),r!=null&&a.push(r);else for(s in e)r=t(e[s],s,n),r!=null&&a.push(r);return i.apply([],a)},guid:1,proxy:function(e,t){var n,i,s;return typeof t=="string"&&(s=e[t],t=e,e=s),h.isFunction(e)?(n=r.call(arguments,2),i=function(){return e.apply(t||this,n.concat(r.call(arguments)))},i.guid=e.guid=e.guid||h.guid++,i):undefined},now:function(){return+(new Date)},support:l}),h.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){u["[object "+t+"]"]=t.toLowerCase()});var y=function(e){function ot(e,t,r,i){var s,u,f,l,c,d,g,y,S,x;(t?t.ownerDocument||t:E)!==p&&h(t),t=t||p,r=r||[],l=t.nodeType;if(typeof e!="string"||!e||l!==1&&l!==9&&l!==11)return r;if(!i&&v){if(l!==11&&(s=Z.exec(e)))if(f=s[1]){if(l===9){u=t.getElementById(f);if(!u||!u.parentNode)return r;if(u.id===f)return r.push(u),r}else if(t.ownerDocument&&(u=t.ownerDocument.getElementById(f))&&b(t,u)&&u.id===f)return r.push(u),r}else{if(s[2])return D.apply(r,t.getElementsByTagName(e)),r;if((f=s[3])&&n.getElementsByClassName)return D.apply(r,t.getElementsByClassName(f)),r}if(n.qsa&&(!m||!m.test(e))){y=g=w,S=t,x=l!==1&&e;if(l===1&&t.nodeName.toLowerCase()!=="object"){d=o(e),(g=t.getAttribute("id"))?y=g.replace(tt,"\\$&"):t.setAttribute("id",y),y="[id='"+y+"'] ",c=d.length;while(c--)d[c]=y+gt(d[c]);S=et.test(e)&&vt(t.parentNode)||t,x=d.join(",")}if(x)try{return D.apply(r,S.querySelectorAll(x)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return a(e.replace(z,"$1"),t,r,i)}function ut(){function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function at(e){return e[w]=!0,e}function ft(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),i=e.length;while(i--)r.attrHandle[n[i]]=t}function ct(e,t){var n=t&&e,r=n&&e.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||L)-(~e.sourceIndex||L);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function dt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function vt(e){return e&&typeof e.getElementsByTagName!="undefined"&&e}function mt(){}function gt(e){var t=0,n=e.length,r="";for(;t<n;t++)r+=e[t].value;return r}function yt(e,t,n){var r=t.dir,i=n&&r==="parentNode",s=x++;return t.first?function(t,n,s){while(t=t[r])if(t.nodeType===1||i)return e(t,n,s)}:function(t,n,o){var u,a,f=[S,s];if(o){while(t=t[r])if(t.nodeType===1||i)if(e(t,n,o))return!0}else while(t=t[r])if(t.nodeType===1||i){a=t[w]||(t[w]={});if((u=a[r])&&u[0]===S&&u[1]===s)return f[2]=u[2];a[r]=f;if(f[2]=e(t,n,o))return!0}}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function wt(e,t,n){var r=0,i=t.length;for(;r<i;r++)ot(e,t[r],n);return n}function Et(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function St(e,t,n,r,i,s){return r&&!r[w]&&(r=St(r)),i&&!i[w]&&(i=St(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||wt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?Et(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=Et(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?H(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=Et(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):D.apply(o,g)})}function xt(e){var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=yt(function(e){return e===t},u,!0),c=yt(function(e){return H(t,e)>-1},u,!0),h=[function(e,n,r){var i=!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];for(;a<s;a++)if(n=r.relative[e[a].type])h=[yt(bt(h),n)];else{n=r.filter[e[a].type].apply(null,e[a].matches);if(n[w]){i=++a;for(;i<s;i++)if(r.relative[e[i].type])break;return St(a>1&&bt(h),a>1&&gt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(z,"$1"),n,a<i&&xt(e.slice(a,i)),i<s&&xt(e=e.slice(i)),i<s&&gt(e))}h.push(n)}return bt(h)}function Tt(e,t){var n=t.length>0,i=e.length>0,s=function(s,o,u,a,l){var c,h,d,v=0,m="0",g=s&&[],y=[],b=f,w=s||i&&r.find.TAG("*",l),E=S+=b==null?1:Math.random()||.1,x=w.length;l&&(f=o!==p&&o);for(;m!==x&&(c=w[m])!=null;m++){if(i&&c){h=0;while(d=e[h++])if(d(c,o,u)){a.push(c);break}l&&(S=E)}n&&((c=!d&&c)&&v--,s&&g.push(c))}v+=m;if(n&&m!==v){h=0;while(d=t[h++])d(g,y,o,u);if(s){if(v>0)while(m--)!g[m]&&!y[m]&&(y[m]=M.call(a));y=Et(y)}D.apply(a,y),l&&!s&&y.length>0&&v+t.length>1&&ot.uniqueSort(a)}return l&&(S=E,f=b),g};return n?at(s):s}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w="sizzle"+1*new Date,E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=function(e,t){return e===t&&(c=!0),0},L=1<<31,A={}.hasOwnProperty,O=[],M=O.pop,_=O.push,D=O.push,P=O.slice,H=function(e,t){var n=0,r=e.length;for(;n<r;n++)if(e[n]===t)return n;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",j="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",I=F.replace("w","w#"),q="\\["+j+"*("+F+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+j+"*\\]",R=":("+F+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+q+")*)|"+".*"+")\\)|)",U=new RegExp(j+"+","g"),z=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g"),W=new RegExp("^"+j+"*,"+j+"*"),X=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),V=new RegExp("="+j+"*([^\\]'\"]*?)"+j+"*\\]","g"),$=new RegExp(R),J=new RegExp("^"+I+"$"),K={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+q),PSEUDO:new RegExp("^"+R),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/[+~]/,tt=/'|\\/g,nt=new RegExp("\\\\([\\da-f]{1,6}"+j+"?|("+j+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)},it=function(){h()};try{D.apply(O=P.call(E.childNodes),E.childNodes),O[E.childNodes.length].nodeType}catch(st){D={apply:O.length?function(e,t){_.apply(e,P.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}n=ot.support={},s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},h=ot.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:E;if(o===p||o.nodeType!==9||!o.documentElement)return p;p=o,d=o.documentElement,i=o.defaultView,i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",it,!1):i.attachEvent&&i.attachEvent("onunload",it)),v=!s(o),n.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ft(function(e){return e.appendChild(o.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Y.test(o.getElementsByClassName),n.getById=ft(function(e){return d.appendChild(e).id=w,!o.getElementsByName||!o.getElementsByName(w).length}),n.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!="undefined"&&v){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!="undefined")return t.getElementsByTagName(e);if(n.qsa)return t.querySelectorAll(e)}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if(e==="*"){while(n=s[i++])n.nodeType===1&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(v)return t.getElementsByClassName(e)},g=[],m=[];if(n.qsa=Y.test(o.querySelectorAll))ft(function(e){d.appendChild(e).innerHTML="<a id='"+w+"'></a>"+"<select id='"+w+"-\f]' msallowcapture=''>"+"<option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+j+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+j+"*(?:value|"+B+")"),e.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]")}),ft(function(e){var t=o.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+j+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")});return(n.matchesSelector=Y.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ft(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",R)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=Y.test(d.compareDocumentPosition),b=t||Y.test(d.contains)?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&r.nodeType===1&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&e.compareDocumentPosition(r)&16)}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return c=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,r&1||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===o||e.ownerDocument===E&&b(E,e)?-1:t===o||t.ownerDocument===E&&b(E,t)?1:l?H(l,e)-H(l,t):0:r&4?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,r=0,i=e.parentNode,s=t.parentNode,u=[e],a=[t];if(!i||!s)return e===o?-1:t===o?1:i?-1:s?1:l?H(l,e)-H(l,t):0;if(i===s)return ct(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)a.unshift(n);while(u[r]===a[r])r++;return r?ct(u[r],a[r]):u[r]===E?-1:a[r]===E?1:0},o},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){(e.ownerDocument||e)!==p&&h(e),t=t.replace(V,"='$1']");if(n.matchesSelector&&v&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&e.document.nodeType!==11)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=r.attrHandle[t.toLowerCase()],s=i&&A.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):undefined;return s!==undefined?s:n.attributes||!v?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,s=0;c=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(k);if(c){while(t=e[s++])t===e[s]&&(i=r.push(s));while(i--)e.splice(r[i],1)}return l=null,e},i=ot.getText=function(e){var t,n="",r=0,s=e.nodeType;if(!s)while(t=e[r++])n+=i(t);else if(s===1||s===9||s===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(s===3||s===4)return e.nodeValue;return n},r=ot.selectors={cacheLength:50,createPseudo:at,match:K,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(nt,rt),e[3]=(e[3]||e[4]||e[5]||"").replace(nt,rt),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1].slice(0,3)==="nth"?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(e[3]==="even"||e[3]==="odd")),e[5]=+(e[7]+e[8]||e[3]==="odd")):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&$.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return e==="*"?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&T(e,function(e){return t.test(typeof e.className=="string"&&e.className||typeof e.getAttribute!="undefined"&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return i==null?t==="!=":t?(i+="",t==="="?i===n:t==="!="?i!==n:t==="^="?n&&i.indexOf(n)===0:t==="*="?n&&i.indexOf(n)>-1:t==="$="?n&&i.slice(-n.length)===n:t==="~="?(" "+i.replace(U," ")+" ").indexOf(n)>-1:t==="|="?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var s=e.slice(0,3)!=="nth",o=e.slice(-4)!=="last",u=t==="of-type";return r===1&&i===0?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u;if(m){if(s){while(v){c=t;while(c=c[v])if(u?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){l=m[w]||(m[w]={}),f=l[e]||[],p=f[0]===S&&f[1],h=f[0]===S&&f[2],c=p&&m.childNodes[p];while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if(c.nodeType===1&&++h&&c===t){l[e]=[S,p,h];break}}else if(y&&(f=(t[w]||(t[w]={}))[e])&&f[0]===S)h=f[1];else while(c=++p&&c&&c[v]||(h=p=0)||d.pop())if((u?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++h){y&&((c[w]||(c[w]={}))[e]=[S,h]);if(c===t)break}return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=H(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:at(function(e){var t=[],n=[],r=u(e.replace(z,"$1"));return r[w]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),t[0]=null,!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return e=e.replace(nt,rt),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:at(function(e){return J.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||n.indexOf(e+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.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 t==="input"&&!!e.checked||t==="option"&&!!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!r.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},text:function(e){var t;return e.nodeName.toLowerCase()==="input"&&e.type==="text"&&((t=e.getAttribute("type"))==null||t.toLowerCase()==="text")},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[n<0?n+t:n]}),even:dt(function(e,t){var n=0;for(;n<t;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;n<t;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=n<0?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=n<0?n+t:n;for(;++r<t;)e.push(r);return e})}},r.pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=ht(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pt(t);return mt.prototype=r.filters=r.pseudos,r.setFilters=new mt,o=ot.tokenize=function(e,t){var n,i,s,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=r.preFilter;while(u){if(!n||(i=W.exec(u)))i&&(u=u.slice(i[0].length)||u),a.push(s=[]);n=!1;if(i=X.exec(u))n=i.shift(),s.push({value:n,type:i[0].replace(z," ")}),u=u.slice(n.length);for(o in r.filter)(i=K[o].exec(u))&&(!f[o]||(i=f[o](i)))&&(n=i.shift(),s.push({value:n,type:o,matches:i}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)},u=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=o(e)),n=t.length;while(n--)s=xt(t[n]),s[w]?r.push(s):i.push(s);s=C(e,Tt(i,r)),s.selector=e}return s},a=ot.select=function(e,t,i,s){var a,f,l,c,h,p=typeof e=="function"&&e,d=!s&&o(e=p.selector||e);i=i||[];if(d.length===1){f=d[0]=d[0].slice(0);if(f.length>2&&(l=f[0]).type==="ID"&&n.getById&&t.nodeType===9&&v&&r.relative[f[1].type]){t=(r.find.ID(l.matches[0].replace(nt,rt),t)||[])[0];if(!t)return i;p&&(t=t.parentNode),e=e.slice(f.shift().value.length)}a=K.needsContext.test(e)?0:f.length;while(a--){l=f[a];if(r.relative[c=l.type])break;if(h=r.find[c])if(s=h(l.matches[0].replace(nt,rt),et.test(f[0].type)&&vt(t.parentNode)||t)){f.splice(a,1),e=s.length&&gt(f);if(!e)return D.apply(i,s),i;break}}}return(p||u(e,d))(s,t,!v,i,et.test(e)&&vt(t.parentNode)||t),i},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=ft(function(e){return e.compareDocumentPosition(p.createElement("div"))&1}),ft(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild.getAttribute("href")==="#"})||lt("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!n.attributes||!ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&lt("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),ft(function(e){return e.getAttribute("disabled")==null})||lt(B,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),ot}(e);h.find=y,h.expr=y.selectors,h.expr[":"]=h.expr.pseudos,h.unique=y.uniqueSort,h.text=y.getText,h.isXMLDoc=y.isXML,h.contains=y.contains;var b=h.expr.match.needsContext,w=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^.[^:#\[\.,]*$/;h.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?h.find.matchesSelector(r,e)?[r]:[]:h.find.matches(e,h.grep(t,function(e){return e.nodeType===1}))},h.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if(typeof e!="string")return this.pushStack(h(e).filter(function(){for(t=0;t<i;t++)if(h.contains(r[t],this))return!0}));for(t=0;t<i;t++)h.find(e,r[t],n);return n=this.pushStack(i>1?h.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(S(this,e||[],!1))},not:function(e){return this.pushStack(S(this,e||[],!0))},is:function(e){return!!S(this,typeof e=="string"&&b.test(e)?h(e):e||[],!1).length}});var x,T=e.document,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=h.fn.init=function(e,t){var n,r;if(!e)return this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?n=[null,e,null]:n=N.exec(e);if(n&&(n[1]||!t)){if(n[1]){t=t instanceof h?t[0]:t,h.merge(this,h.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:T,!0));if(w.test(n[1])&&h.isPlainObject(t))for(n in t)h.isFunction(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}r=T.getElementById(n[2]);if(r&&r.parentNode){if(r.id!==n[2])return x.find(e);this.length=1,this[0]=r}return this.context=T,this.selector=e,this}return!t||t.jquery?(t||x).find(e):this.constructor(t).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):h.isFunction(e)?typeof x.ready!="undefined"?x.ready(e):e(h):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),h.makeArray(e,this))};C.prototype=h.fn,x=h(T);var k=/^(?:parents|prev(?:Until|All))/,L={children:!0,contents:!0,next:!0,prev:!0};h.extend({dir:function(e,t,n){var r=[],i=e[t];while(i&&i.nodeType!==9&&(n===undefined||i.nodeType!==1||!h(i).is(n)))i.nodeType===1&&r.push(i),i=i[t];return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}}),h.fn.extend({has:function(e){var t,n=h(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(h.contains(this,n[t]))return!0})},closest:function(e,t){var n,r=0,i=this.length,s=[],o=b.test(e)||typeof e!="string"?h(e,t||this.context):0;for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:n.nodeType===1&&h.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?h.unique(s):s)},index:function(e){return e?typeof e=="string"?h.inArray(this[0],h(e)):h.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(h.unique(h.merge(this.get(),h(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),h.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return h.dir(e,"parentNode")},parentsUntil:function(e,t,n){return h.dir(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return h.dir(e,"nextSibling")},prevAll:function(e){return h.dir(e,"previousSibling")},nextUntil:function(e,t,n){return h.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return h.dir(e,"previousSibling",n)},siblings:function(e){return h.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return h.sibling(e.firstChild)},contents:function(e){return h.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:h.merge([],e.childNodes)}},function(e,t){h.fn[e]=function(n,r){var i=h.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=h.filter(r,i)),this.length>1&&(L[e]||(i=h.unique(i)),k.test(e)&&(i=i.reverse())),this.pushStack(i)}});var O=/\S+/g,M={};h.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):h.extend({},e);var t,n,r,i,s,o,u=[],a=!e.once&&[],f=function(c){n=e.memory&&c,r=!0,s=o||0,o=0,i=u.length,t=!0;for(;u&&s<i;s++)if(u[s].apply(c[0],c[1])===!1&&e.stopOnFalse){n=!1;break}t=!1,u&&(a?a.length&&f(a.shift()):n?u=[]:l.disable())},l={add:function(){if(u){var r=u.length;(function s(t){h.each(t,function(t,n){var r=h.type(n);r==="function"?(!e.unique||!l.has(n))&&u.push(n):n&&n.length&&r!=="string"&&s(n)})})(arguments),t?i=u.length:n&&(o=r,f(n))}return this},remove:function(){return u&&h.each(arguments,function(e,n){var r;while((r=h.inArray(n,u,r))>-1)u.splice(r,1),t&&(r<=i&&i--,r<=s&&s--)}),this},has:function(e){return e?h.inArray(e,u)>-1:!!u&&!!u.length},empty:function(){return u=[],i=0,this},disable:function(){return u=a=n=undefined,this},disabled:function(){return!u},lock:function(){return a=undefined,n||l.disable(),this},locked:function(){return!a},fireWith:function(e,n){return u&&(!r||a)&&(n=n||[],n=[e,n.slice?n.slice():n],t?a.push(n):f(n)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},h.extend({Deferred:function(e){var t=[["resolve","done",h.Callbacks("once memory"),"resolved"],["reject","fail",h.Callbacks("once memory"),"rejected"],["notify","progress",h.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return h.Deferred(function(n){h.each(t,function(t,s){var o=h.isFunction(e[t])&&e[t];i[s[1]](function(){var e=o&&o.apply(this,arguments);e&&h.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s[0]+"With"](this===r?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?h.extend(e,r):r}},i={};return r.pipe=r.then,h.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=function(){return i[s[0]+"With"](this===i?r:this,arguments),this},i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=r.call(arguments),i=n.length,s=i!==1||e&&h.isFunction(e.promise)?i:0,o=s===1?e:h.Deferred(),u=function(e,t,n){return function(i){t[e]=this,n[e]=arguments.length>1?r.call(arguments):i,n===a?o.notifyWith(t,n):--s||o.resolveWith(t,n)}},a,f,l;if(i>1){a=new Array(i),f=new Array(i),l=new Array(i);for(;t<i;t++)n[t]&&h.isFunction(n[t].promise)?n[t].promise().done(u(t,l,n)).fail(o.reject).progress(u(t,f,a)):--s}return s||o.resolveWith(l,n),o.promise()}});var D;h.fn.ready=function(e){return h.ready.promise().done(e),this},h.extend({isReady:!1,readyWait:1,holdReady:function(e){e?h.readyWait++:h.ready(!0)},ready:function(e){if(e===!0?--h.readyWait:h.isReady)return;if(!T.body)return setTimeout(h.ready);h.isReady=!0;if(e!==!0&&--h.readyWait>0)return;D.resolveWith(T,[h]),h.fn.triggerHandler&&(h(T).triggerHandler("ready"),h(T).off("ready"))}}),h.ready.promise=function(t){if(!D){D=h.Deferred();if(T.readyState==="complete")setTimeout(h.ready);else if(T.addEventListener)T.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{T.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var n=!1;try{n=e.frameElement==null&&T.documentElement}catch(r){}n&&n.doScroll&&function i(){if(!h.isReady){try{n.doScroll("left")}catch(e){return setTimeout(i,50)}P(),h.ready()}}()}}return D.promise(t)};var B=typeof undefined,j;for(j in h(l))break;l.ownLast=j!=="0",l.inlineBlockNeedsLayout=!1,h(function(){var e,t,n,r;n=T.getElementsByTagName("body")[0];if(!n||!n.style)return;t=T.createElement("div"),r=T.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==B&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=e=t.offsetWidth===3,e&&(n.style.zoom=1)),n.removeChild(r)}),function(){var e=T.createElement("div");if(l.deleteExpando==null){l.deleteExpando=!0;try{delete e.test}catch(t){l.deleteExpando=!1}}e=null}(),h.acceptData=function(e){var t=h.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return n!==1&&n!==9?!1:!t||t!==!0&&e.getAttribute("classid")===t};var F=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,I=/([A-Z])/g;h.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?h.cache[e[h.expando]]:e[h.expando],!!e&&!R(e)},data:function(e,t,n){return U(e,t,n)},removeData:function(e,t){return z(e,t)},_data:function(e,t,n){return U(e,t,n,!0)},_removeData:function(e,t){return z(e,t,!0)}}),h.fn.extend({data:function(e,t){var n,r,i,s=this[0],o=s&&s.attributes;if(e===undefined){if(this.length){i=h.data(s);if(s.nodeType===1&&!h._data(s,"parsedAttrs")){n=o.length;while(n--)o[n]&&(r=o[n].name,r.indexOf("data-")===0&&(r=h.camelCase(r.slice(5)),q(s,r,i[r])));h._data(s,"parsedAttrs",!0)}}return i}return typeof e=="object"?this.each(function(){h.data(this,e)}):arguments.length>1?this.each(function(){h.data(this,e,t)}):s?q(s,e,h.data(s,e)):undefined},removeData:function(e){return this.each(function(){h.removeData(this,e)})}}),h.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=h._data(e,t),n&&(!r||h.isArray(n)?r=h._data(e,t,h.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=h.queue(e,t),r=n.length,i=n.shift(),s=h._queueHooks(e,t),o=function(){h.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return h._data(e,n)||h._data(e,n,{empty:h.Callbacks("once memory").add(function(){h._removeData(e,t+"queue"),h._removeData(e,n)})})}}),h.fn.extend({queue:function(e,t){var n=2;return typeof e!="string"&&(t=e,e="fx",n--),arguments.length<n?h.queue(this[0],e):t===undefined?this:this.each(function(){var n=h.queue(this,e,t);h._queueHooks(this,e),e==="fx"&&n[0]!=="inprogress"&&h.dequeue(this,e)})},dequeue:function(e){return this.each(function(){h.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=h.Deferred(),s=this,o=this.length,u=function(){--r||i.resolveWith(s,[s])};typeof e!="string"&&(t=e,e=undefined),e=e||"fx";while(o--)n=h._data(s[o],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(u));return u(),i.promise(t)}});var W=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,X=["Top","Right","Bottom","Left"],V=function(e,t){return e=t||e,h.css(e,"display")==="none"||!h.contains(e.ownerDocument,e)},$=h.access=function(e,t,n,r,i,s,o){var u=0,a=e.length,f=n==null;if(h.type(n)==="object"){i=!0;for(u in n)h.access(e,t,u,n[u],!0,s,o)}else if(r!==undefined){i=!0,h.isFunction(r)||(o=!0),f&&(o?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(h(e),n)}));if(t)for(;u<a;u++)t(e[u],n,o?r:r.call(e[u],u,t(e[u],n)))}return i?e:f?t.call(e):a?t(e[0],n):s},J=/^(?:checkbox|radio)$/i;(function(){var e=T.createElement("input"),t=T.createElement("div"),n=T.createDocumentFragment();t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=t.firstChild.nodeType===3,l.tbody=!t.getElementsByTagName("tbody").length,l.htmlSerialize=!!t.getElementsByTagName("link").length,l.html5Clone=T.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",e.type="checkbox",e.checked=!0,n.appendChild(e),l.appendChecked=e.checked,t.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,n.appendChild(t),t.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,t.attachEvent&&(t.attachEvent("onclick",function(){l.noCloneEvent=!1}),t.cloneNode(!0).click());if(l.deleteExpando==null){l.deleteExpando=!0;try{delete t.test}catch(r){l.deleteExpando=!1}}})(),function(){var t,n,r=T.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(l[t+"Bubbles"]=n in e)||(r.setAttribute(n,"t"),l[t+"Bubbles"]=r.attributes[n].expando===!1);r=null}();var K=/^(?:input|select|textarea)$/i,Q=/^key/,G=/^(?:mouse|pointer|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=/^([^.]*)(?:\.(.+)|)$/;h.event={global:{},add:function(e,t,n,r,i){var s,o,u,a,f,l,c,p,d,v,m,g=h._data(e);if(!g)return;n.handler&&(a=n,n=a.handler,i=a.selector),n.guid||(n.guid=h.guid++),(o=g.events)||(o=g.events={}),(l=g.handle)||(l=g.handle=function(e){return typeof h===B||!!e&&h.event.triggered===e.type?undefined:h.event.dispatch.apply(l.elem,arguments)},l.elem=e),t=(t||"").match(O)||[""],u=t.length;while(u--){s=Z.exec(t[u])||[],d=m=s[1],v=(s[2]||"").split(".").sort();if(!d)continue;f=h.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=h.event.special[d]||{},c=h.extend({type:d,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&h.expr.match.needsContext.test(i),namespace:v.join(".")},a);if(!(p=o[d])){p=o[d]=[],p.delegateCount=0;if(!f.setup||f.setup.call(e,r,v,l)===!1)e.addEventListener?e.addEventListener(d,l,!1):e.attachEvent&&e.attachEvent("on"+d,l)}f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),h.event.global[d]=!0}e=null},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,p,d,v,m,g=h.hasData(e)&&h._data(e);if(!g||!(l=g.events))return;t=(t||"").match(O)||[""],f=t.length;while(f--){u=Z.exec(t[f])||[],d=m=u[1],v=(u[2]||"").split(".").sort();if(!d){for(d in l)h.event.remove(e,d+t[f],n,r,!0);continue}c=h.event.special[d]||{},d=(r?c.delegateType:c.bindType)||d,p=l[d]||[],u=u[2]&&new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;while(s--)o=p[s],(i||m===o.origType)&&(!n||n.guid===o.guid)&&(!u||u.test(o.namespace))&&(!r||r===o.selector||r==="**"&&o.selector)&&(p.splice(s,1),o.selector&&p.delegateCount--,c.remove&&c.remove.call(e,o));a&&!p.length&&((!c.teardown||c.teardown.call(e,v,g.handle)===!1)&&h.removeEvent(e,d,g.handle),delete l[d])}h.isEmptyObject(l)&&(delete g.handle,h._removeData(e,"events"))},trigger:function(t,n,r,i){var s,o,u,a,l,c,p,d=[r||T],v=f.call(t,"type")?t.type:t,m=f.call(t,"namespace")?t.namespace.split("."):[];u=c=r=r||T;if(r.nodeType===3||r.nodeType===8)return;if(Y.test(v+h.event.triggered))return;v.indexOf(".")>=0&&(m=v.split("."),v=m.shift(),m.sort()),o=v.indexOf(":")<0&&"on"+v,t=t[h.expando]?t:new h.Event(v,typeof t=="object"&&t),t.isTrigger=i?2:3,t.namespace=m.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=n==null?[t]:h.makeArray(n,[t]),l=h.event.special[v]||{};if(!i&&l.trigger&&l.trigger.apply(r,n)===!1)return;if(!i&&!l.noBubble&&!h.isWindow(r)){a=l.delegateType||v,Y.test(a+v)||(u=u.parentNode);for(;u;u=u.parentNode)d.push(u),c=u;c===(r.ownerDocument||T)&&d.push(c.defaultView||c.parentWindow||e)}p=0;while((u=d[p++])&&!t.isPropagationStopped())t.type=p>1?a:l.bindType||v,s=(h._data(u,"events")||{})[t.type]&&h._data(u,"handle"),s&&s.apply(u,n),s=o&&u[o],s&&s.apply&&h.acceptData(u)&&(t.result=s.apply(u,n),t.result===!1&&t.preventDefault());t.type=v;if(!i&&!t.isDefaultPrevented()&&(!l._default||l._default.apply(d.pop(),n)===!1)&&h.acceptData(r)&&o&&r[v]&&!h.isWindow(r)){c=r[o],c&&(r[o]=null),h.event.triggered=v;try{r[v]()}catch(g){}h.event.triggered=undefined,c&&(r[o]=c)}return t.result},dispatch:function(e){e=h.event.fix(e);var t,n,i,s,o,u=[],a=r.call(arguments),f=(h._data(this,"events")||{})[e.type]||[],l=h.event.special[e.type]||{};a[0]=e,e.delegateTarget=this;if(l.preDispatch&&l.preDispatch.call(this,e)===!1)return;u=h.event.handlers.call(this,e,f),t=0;while((s=u[t++])&&!e.isPropagationStopped()){e.currentTarget=s.elem,o=0;while((i=s.handlers[o++])&&!e.isImmediatePropagationStopped())if(!e.namespace_re||e.namespace_re.test(i.namespace))e.handleObj=i,e.data=i.data,n=((h.event.special[i.origType]||{}).handle||i.handler).apply(s.elem,a),n!==undefined&&(e.result=n)===!1&&(e.preventDefault(),e.stopPropagation())}return l.postDispatch&&l.postDispatch.call(this,e),e.result},handlers:function(e,t){var n,r,i,s,o=[],u=t.delegateCount,a=e.target;if(u&&a.nodeType&&(!e.button||e.type!=="click"))for(;a!=this;a=a.parentNode||this)if(a.nodeType===1&&(a.disabled!==!0||e.type!=="click")){i=[];for(s=0;s<u;s++)r=t[s],n=r.selector+" ",i[n]===undefined&&(i[n]=r.needsContext?h(n,this).index(a)>=0:h.find(n,this,null,[a]).length),i[n]&&i.push(r);i.length&&o.push({elem:a,handlers:i})}return u<t.length&&o.push({elem:this,handlers:t.slice(u)}),o},fix:function(e){if(e[h.expando])return e;var t,n,r,i=e.type,s=e,o=this.fixHooks[i];o||(this.fixHooks[i]=o=G.test(i)?this.mouseHooks:Q.test(i)?this.keyHooks:{}),r=o.props?this.props.concat(o.props):this.props,e=new h.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=s.srcElement||T),e.target.nodeType===3&&(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 e.which==null&&(e.which=t.charCode!=null?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 n,r,i,s=t.button,o=t.fromElement;return e.pageX==null&&t.clientX!=null&&(r=e.target.ownerDocument||T,i=r.documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&o&&(e.relatedTarget=o===e.target?t.toElement:o),!e.which&&s!==undefined&&(e.which=s&1?1:s&2?3:s&4?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==nt()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===nt()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(h.nodeName(this,"input")&&this.type==="checkbox"&&this.click)return this.click(),!1},_default:function(e){return h.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=h.extend(new h.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?h.event.trigger(i,null,t):h.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},h.removeEvent=T.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===B&&(e[r]=null),e.detachEvent(r,n))},h.Event=function(e,t){if(!(this instanceof h.Event))return new h.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.defaultPrevented===undefined&&e.returnValue===!1?et:tt):this.type=e,t&&h.extend(this,t),this.timeStamp=e&&e.timeStamp||h.now(),this[h.expando]=!0},h.Event.prototype={isDefaultPrevented:tt,isPropagationStopped:tt,isImmediatePropagationStopped:tt,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=et;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=et;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=et,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},h.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){h.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj;if(!i||i!==r&&!h.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),l.submitBubbles||(h.event.special.submit={setup:function(){if(h.nodeName(this,"form"))return!1;h.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=h.nodeName(t,"input")||h.nodeName(t,"button")?t.form:undefined;n&&!h._data(n,"submitBubbles")&&(h.event.add(n,"submit._submit",function(e){e._submit_bubble=!0}),h._data(n,"submitBubbles",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&h.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(h.nodeName(this,"form"))return!1;h.event.remove(this,"._submit")}}),l.changeBubbles||(h.event.special.change={setup:function(){if(K.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")h.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),h.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),h.event.simulate("change",this,e,!0)});return!1}h.event.add(this,"beforeactivate._change",function(e){var t=e.target;K.test(t.nodeName)&&!h._data(t,"changeBubbles")&&(h.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&h.event.simulate("change",this.parentNode,e,!0)}),h._data(t,"changeBubbles",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return h.event.remove(this,"._change"),!K.test(this.nodeName)}}),l.focusinBubbles||h.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){h.event.simulate(t,e.target,h.event.fix(e),!0)};h.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=h._data(r,t);i||r.addEventListener(e,n,!0),h._data(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=h._data(r,t)-1;i?h._data(r,t,i):(r.removeEventListener(e,n,!0),h._removeData(r,t))}}}),h.fn.extend({on:function(e,t,n,r,i){var s,o;if(typeof e=="object"){typeof t!="string"&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}n==null&&r==null?(r=t,n=t=undefined):r==null&&(typeof t=="string"?(r=n,n=undefined):(r=n,n=t,t=undefined));if(r===!1)r=tt;else if(!r)return this;return i===1&&(o=r,r=function(e){return h().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=h.guid++)),this.each(function(){h.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,h(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if(typeof e=="object"){for(i in e)this.off(i,t,e[i]);return this}if(t===!1||typeof t=="function")n=t,t=undefined;return n===!1&&(n=tt),this.each(function(){h.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){h.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return h.event.trigger(e,t,n,!0)}});var it="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",st=/ jQuery\d+="(?:null|\d+)"/g,ot=new RegExp("<(?:"+it+")[\\s/>]","i"),ut=/^\s+/,at=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ft=/<([\w:]+)/,lt=/<tbody/i,ct=/<|&#?\w+;/,ht=/<(?:script|style|link)/i,pt=/checked\s*(?:[^=]|=\s*.checked.)/i,dt=/^$|\/(?:java|ecma)script/i,vt=/^true\/(.*)/,mt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,gt={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:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},yt=rt(T),bt=yt.appendChild(T.createElement("div"));gt.optgroup=gt.option,gt.tbody=gt.tfoot=gt.colgroup=gt.caption=gt.thead,gt.th=gt.td,h.extend({clone:function(e,t,n){var r,i,s,o,u,a=h.contains(e.ownerDocument,e);l.html5Clone||h.isXMLDoc(e)||!ot.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(bt.innerHTML=e.outerHTML,bt.removeChild(s=bt.firstChild));if((!l.noCloneEvent||!l.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!h.isXMLDoc(e)){r=wt(s),u=wt(e);for(o=0;(i=u[o])!=null;++o)r[o]&&kt(i,r[o])}if(t)if(n){u=u||wt(e),r=r||wt(s);for(o=0;(i=u[o])!=null;o++)Ct(i,r[o])}else Ct(e,s);return r=wt(s,"script"),r.length>0&&Nt(r,!a&&wt(e,"script")),r=u=i=null,s},buildFragment:function(e,t,n,r){var i,s,o,u,a,f,c,p=e.length,d=rt(t),v=[],m=0;for(;m<p;m++){s=e[m];if(s||s===0)if(h.type(s)==="object")h.merge(v,s.nodeType?[s]:s);else if(!ct.test(s))v.push(t.createTextNode(s));else{u=u||d.appendChild(t.createElement("div")),a=(ft.exec(s)||["",""])[1].toLowerCase(),c=gt[a]||gt._default,u.innerHTML=c[1]+s.replace(at,"<$1></$2>")+c[2],i=c[0];while(i--)u=u.lastChild;!l.leadingWhitespace&&ut.test(s)&&v.push(t.createTextNode(ut.exec(s)[0]));if(!l.tbody){s=a==="table"&&!lt.test(s)?u.firstChild:c[1]==="<table>"&&!lt.test(s)?u:0,i=s&&s.childNodes.length;while(i--)h.nodeName(f=s.childNodes[i],"tbody")&&!f.childNodes.length&&s.removeChild(f)}h.merge(v,u.childNodes),u.textContent="";while(u.firstChild)u.removeChild(u.firstChild);u=d.lastChild}}u&&d.removeChild(u),l.appendChecked||h.grep(wt(v,"input"),Et),m=0;while(s=v[m++]){if(r&&h.inArray(s,r)!==-1)continue;o=h.contains(s.ownerDocument,s),u=wt(d.appendChild(s),"script"),o&&Nt(u);if(n){i=0;while(s=u[i++])dt.test(s.type||"")&&n.push(s)}}return u=null,d},cleanData:function(e,t){var r,i,s,o,u=0,a=h.expando,f=h.cache,c=l.deleteExpando,p=h.event.special;for(;(r=e[u])!=null;u++)if(t||h.acceptData(r)){s=r[a],o=s&&f[s];if(o){if(o.events)for(i in o.events)p[i]?h.event.remove(r,i):h.removeEvent(r,i,o.handle);f[s]&&(delete f[s],c?delete r[a]:typeof r.removeAttribute!==B?r.removeAttribute(a):r[a]=null,n.push(s))}}}}),h.fn.extend({text:function(e){return $(this,function(e){return e===undefined?h.text(this):this.empty().append((this[0]&&this[0].ownerDocument||T).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=St(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=St(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){var n,r=e?h.filter(e,this):this,i=0;for(;(n=r[i])!=null;i++)!t&&n.nodeType===1&&h.cleanData(wt(n)),n.parentNode&&(t&&h.contains(n.ownerDocument,n)&&Nt(wt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&h.cleanData(wt(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&h.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return h.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined)return t.nodeType===1?t.innerHTML.replace(st,""):undefined;if(typeof e=="string"&&!ht.test(e)&&(l.htmlSerialize||!ot.test(e))&&(l.leadingWhitespace||!ut.test(e))&&!gt[(ft.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(at,"<$1></$2>");try{for(;n<r;n++)t=this[n]||{},t.nodeType===1&&(h.cleanData(wt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=arguments[0];return this.domManip(arguments,function(t){e=this.parentNode,h.cleanData(wt(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=i.apply([],e);var n,r,s,o,u,a,f=0,c=this.length,p=this,d=c-1,v=e[0],m=h.isFunction(v);if(m||c>1&&typeof v=="string"&&!l.checkClone&&pt.test(v))return this.each(function(n){var r=p.eq(n);m&&(e[0]=v.call(this,n,r.html())),r.domManip(e,t)});if(c){a=h.buildFragment(e,this[0].ownerDocument,!1,this),n=a.firstChild,a.childNodes.length===1&&(a=n);if(n){o=h.map(wt(a,"script"),xt),s=o.length;for(;f<c;f++)r=a,f!==d&&(r=h.clone(r,!0,!0),s&&h.merge(o,wt(r,"script"))),t.call(this[f],r,f);if(s){u=o[o.length-1].ownerDocument,h.map(o,Tt);for(f=0;f<s;f++)r=o[f],dt.test(r.type||"")&&!h._data(r,"globalEval")&&h.contains(u,r)&&(r.src?h._evalUrl&&h._evalUrl(r.src):h.globalEval((r.text||r.textContent||r.innerHTML||"").replace(mt,"")))}a=n=null}}return this}}),h.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){h.fn[e]=function(e){var n,r=0,i=[],o=h(e),u=o.length-1;for(;r<=u;r++)n=r===u?this:this.clone(!0),h(o[r])[t](n),s.apply(i,n.get());return this.pushStack(i)}});var Lt,At={};(function(){var e;l.shrinkWrapBlocks=function(){if(e!=null)return e;e=!1;var t,n,r;n=T.getElementsByTagName("body")[0];if(!n||!n.style)return;return t=T.createElement("div"),r=T.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(t),typeof t.style.zoom!==B&&(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(T.createElement("div")).style.width="5px",e=t.offsetWidth!==3),n.removeChild(r),e}})();var _t=/^margin/,Dt=new RegExp("^("+W+")(?!px)[a-z%]+$","i"),Pt,Ht,Bt=/^(top|right|bottom|left)$/;e.getComputedStyle?(Pt=function(t){return t.ownerDocument.defaultView.opener?t.ownerDocument.defaultView.getComputedStyle(t,null):e.getComputedStyle(t,null)},Ht=function(e,t,n){var r,i,s,o,u=e.style;return n=n||Pt(e),o=n?n.getPropertyValue(t)||n[t]:undefined,n&&(o===""&&!h.contains(e.ownerDocument,e)&&(o=h.style(e,t)),Dt.test(o)&&_t.test(t)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=o,o=n.width,u.width=r,u.minWidth=i,u.maxWidth=s)),o===undefined?o:o+""}):T.documentElement.currentStyle&&(Pt=function(e){return e.currentStyle},Ht=function(e,t,n){var r,i,s,o,u=e.style;return n=n||Pt(e),o=n?n[t]:undefined,o==null&&u&&u[t]&&(o=u[t]),Dt.test(o)&&!Bt.test(t)&&(r=u.left,i=e.runtimeStyle,s=i&&i.left,s&&(i.left=e.currentStyle.left),u.left=t==="fontSize"?"1em":o,o=u.pixelLeft+"px",u.left=r,s&&(i.left=s)),o===undefined?o:o+""||"auto"}),function(){function a(){var t,n,r,a;n=T.getElementsByTagName("body")[0];if(!n||!n.style)return;t=T.createElement("div"),r=T.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).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",i=s=!1,u=!0,e.getComputedStyle&&(i=(e.getComputedStyle(t,null)||{}).top!=="1%",s=(e.getComputedStyle(t,null)||{width:"4px"}).width==="4px",a=t.appendChild(T.createElement("div")),a.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",a.style.marginRight=a.style.width="0",t.style.width="1px",u=!parseFloat((e.getComputedStyle(a,null)||{}).marginRight),t.removeChild(a)),t.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=t.getElementsByTagName("td"),a[0].style.cssText="margin:0;border:0;padding:0;display:none",o=a[0].offsetHeight===0,o&&(a[0].style.display="",a[1].style.display="none",o=a[0].offsetHeight===0),n.removeChild(r)}var t,n,r,i,s,o,u;t=T.createElement("div"),t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=t.getElementsByTagName("a")[0],n=r&&r.style;if(!n)return;n.cssText="float:left;opacity:.5",l.opacity=n.opacity==="0.5",l.cssFloat=!!n.cssFloat,t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle=t.style.backgroundClip==="content-box",l.boxSizing=n.boxSizing===""||n.MozBoxSizing===""||n.WebkitBoxSizing==="",h.extend(l,{reliableHiddenOffsets:function(){return o==null&&a(),o},boxSizingReliable:function(){return s==null&&a(),s},pixelPosition:function(){return i==null&&a(),i},reliableMarginRight:function(){return u==null&&a(),u}})}(),h.swap=function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i};var Ft=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,qt=/^(none|table(?!-c[ea]).+)/,Rt=new RegExp("^("+W+")(.*)$","i"),Ut=new RegExp("^([+-])=("+W+")","i"),zt={position:"absolute",visibility:"hidden",display:"block"},Wt={letterSpacing:"0",fontWeight:"400"},Xt=["Webkit","O","Moz","ms"];h.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ht(e,"opacity");return n===""?"1":n}}}},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":l.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,r){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var i,s,o,u=h.camelCase(t),a=e.style;t=h.cssProps[u]||(h.cssProps[u]=Vt(a,u)),o=h.cssHooks[t]||h.cssHooks[u];if(n===undefined)return o&&"get"in o&&(i=o.get(e,!1,r))!==undefined?i:a[t];s=typeof n,s==="string"&&(i=Ut.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(h.css(e,t)),s="number");if(n==null||n!==n)return;s==="number"&&!h.cssNumber[u]&&(n+="px"),!l.clearCloneStyle&&n===""&&t.indexOf("background")===0&&(a[t]="inherit");if(!o||!("set"in o)||(n=o.set(e,n,r))!==undefined)try{a[t]=n}catch(f){}},css:function(e,t,n,r){var i,s,o,u=h.camelCase(t);return t=h.cssProps[u]||(h.cssProps[u]=Vt(e.style,u)),o=h.cssHooks[t]||h.cssHooks[u],o&&"get"in o&&(s=o.get(e,!0,n)),s===undefined&&(s=Ht(e,t,r)),s==="normal"&&t in Wt&&(s=Wt[t]),n===""||n?(i=parseFloat(s),n===!0||h.isNumeric(i)?i||0:s):s}}),h.each(["height","width"],function(e,t){h.cssHooks[t]={get:function(e,n,r){if(n)return qt.test(h.css(e,"display"))&&e.offsetWidth===0?h.swap(e,zt,function(){return Qt(e,t,r)}):Qt(e,t,r)},set:function(e,n,r){var i=r&&Pt(e);return Jt(e,n,r?Kt(e,t,r,l.boxSizing&&h.css(e,"boxSizing",!1,i)==="border-box",i):0)}}}),l.opacity||(h.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=h.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if((t>=1||t==="")&&h.trim(s.replace(Ft,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(t===""||r&&!r.filter)return}n.filter=Ft.test(s)?s.replace(Ft,i):s+" "+i}}),h.cssHooks.marginRight=jt(l.reliableMarginRight,function(e,t){if(t)return h.swap(e,{display:"inline-block"},Ht,[e,"marginRight"])}),h.each({margin:"",padding:"",border:"Width"},function(e,t){h.cssHooks[e+t]={expand:function(n){var r=0,i={},s=typeof n=="string"?n.split(" "):[n];for(;r<4;r++)i[e+X[r]+t]=s[r]||s[r-2]||s[0];return i}},_t.test(e)||(h.cssHooks[e+t].set=Jt)}),h.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,s={},o=0;if(h.isArray(t)){r=Pt(e),i=t.length;for(;o<i;o++)s[t[o]]=h.css(e,t[o],!1,r);return s}return n!==undefined?h.style(e,t,n):h.css(e,t)},e,t,arguments.length>1)},show:function(){return $t(this,!0)},hide:function(){return $t(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){V(this)?h(this).show():h(this).hide()})}}),h.Tween=Gt,Gt.prototype={constructor:Gt,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(h.cssNumber[n]?"":"px")},cur:function(){var e=Gt.propHooks[this.prop];return e&&e.get?e.get(this):Gt.propHooks._default.get(this)},run:function(e){var t,n=Gt.propHooks[this.prop];return this.options.duration?this.pos=t=h.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),n&&n.set?n.set(this):Gt.propHooks._default.set(this),this}},Gt.prototype.init.prototype=Gt.prototype,Gt.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=h.css(e.elem,e.prop,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){h.fx.step[e.prop]?h.fx.step[e.prop](e):e.elem.style&&(e.elem.style[h.cssProps[e.prop]]!=null||h.cssHooks[e.prop])?h.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Gt.propHooks.scrollTop=Gt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},h.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},h.fx=Gt.prototype.init,h.fx.step={};var Yt,Zt,en=/^(?:toggle|show|hide)$/,tn=new RegExp("^(?:([+-])=|)("+W+")([a-z%]*)$","i"),nn=/queueHooks$/,rn=[fn],sn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=tn.exec(t),s=i&&i[3]||(h.cssNumber[e]?"":"px"),o=(h.cssNumber[e]||s!=="px"&&+r)&&tn.exec(h.css(n.elem,e)),u=1,a=20;if(o&&o[3]!==s){s=s||o[3],i=i||[],o=+r||1;do u=u||".5",o/=u,h.style(n.elem,e,o+s);while(u!==(u=n.cur()/r)&&u!==1&&--a)}return i&&(o=n.start=+o||+r||0,n.unit=s,n.end=i[1]?o+(i[1]+1)*i[2]:+i[2]),n}]};h.Animation=h.extend(cn,{tweener:function(e,t){h.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],sn[n]=sn[n]||[],sn[n].unshift(t)},prefilter:function(e,t){t?rn.unshift(e):rn.push(e)}}),h.speed=function(e,t,n){var r=e&&typeof e=="object"?h.extend({},e):{complete:n||!n&&t||h.isFunction(e)&&e,duration:e,easing:n&&t||t&&!h.isFunction(t)&&t};r.duration=h.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in h.fx.speeds?h.fx.speeds[r.duration]:h.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){h.isFunction(r.old)&&r.old.call(this),r.queue&&h.dequeue(this,r.queue)},r},h.fn.extend({fadeTo:function(e,t,n,r){return this.filter(V).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=h.isEmptyObject(e),s=h.speed(t,n,r),o=function(){var t=cn(this,h.extend({},e),s);(i||h._data(this,"finish"))&&t.stop(!0)};return o.finish=o,i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return typeof e!="string"&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=e!=null&&e+"queueHooks",s=h.timers,o=h._data(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&nn.test(i)&&r(o[i]);for(i=s.length;i--;)s[i].elem===this&&(e==null||s[i].queue===e)&&(s[i].anim.stop(n),t=!1,s.splice(i,1));(t||!n)&&h.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=h._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],s=h.timers,o=r?r.length:0;n.finish=!0,h.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0);for(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++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),h.each(["toggle","show","hide"],function(e,t){var n=h.fn[t];h.fn[t]=function(e,r,i){return e==null||typeof e=="boolean"?n.apply(this,arguments):this.animate(un(t,!0),e,r,i)}}),h.each({slideDown:un("show"),slideUp:un("hide"),slideToggle:un("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){h.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),h.timers=[],h.fx.tick=function(){var e,t=h.timers,n=0;Yt=h.now();for(;n<t.length;n++)e=t[n],!e()&&t[n]===e&&t.splice(n--,1);t.length||h.fx.stop(),Yt=undefined},h.fx.timer=function(e){h.timers.push(e),e()?h.fx.start():h.timers.pop()},h.fx.interval=13,h.fx.start=function(){Zt||(Zt=setInterval(h.fx.tick,h.fx.interval))},h.fx.stop=function(){clearInterval(Zt),Zt=null},h.fx.speeds={slow:600,fast:200,_default:400},h.fn.delay=function(e,t){return e=h.fx?h.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},function(){var e,t,n,r,i;t=T.createElement("div"),t.setAttribute("className","t"),t.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",r=t.getElementsByTagName("a")[0],n=T.createElement("select"),i=n.appendChild(T.createElement("option")),e=t.getElementsByTagName("input")[0],r.style.cssText="top:1px",l.getSetAttribute=t.className!=="t",l.style=/top/.test(r.getAttribute("style")),l.hrefNormalized=r.getAttribute("href")==="/a",l.checkOn=!!e.value,l.optSelected=i.selected,l.enctype=!!T.createElement("form").enctype,n.disabled=!0,l.optDisabled=!i.disabled,e=T.createElement("input"),e.setAttribute("value",""),l.input=e.getAttribute("value")==="",e.value="t",e.setAttribute("type","radio"),l.radioValue=e.value==="t"}();var hn=/\r/g;h.fn.extend({val:function(e){var t,n,r,i=this[0];if(!arguments.length){if(i)return t=h.valHooks[i.type]||h.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,typeof n=="string"?n.replace(hn,""):n==null?"":n);return}return r=h.isFunction(e),this.each(function(n){var i;if(this.nodeType!==1)return;r?i=e.call(this,n,h(this).val()):i=e,i==null?i="":typeof i=="number"?i+="":h.isArray(i)&&(i=h.map(i,function(e){return e==null?"":e+""})),t=h.valHooks[this.type]||h.valHooks[this.nodeName.toLowerCase()];if(!t||!("set"in t)||t.set(this,i,"value")===undefined)this.value=i})}}),h.extend({valHooks:{option:{get:function(e){var t=h.find.attr(e,"value");return t!=null?t:h.trim(h.text(e))}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(l.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!h.nodeName(n.parentNode,"optgroup"))){t=h(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n,r,i=e.options,s=h.makeArray(t),o=i.length;while(o--){r=i[o];if(h.inArray(h.valHooks.option.get(r),s)>=0)try{r.selected=n=!0}catch(u){r.scrollHeight}else r.selected=!1}return n||(e.selectedIndex=-1),i}}}}),h.each(["radio","checkbox"],function(){h.valHooks[this]={set:function(e,t){if(h.isArray(t))return e.checked=h.inArray(h(e).val(),t)>=0}},l.checkOn||(h.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})});var pn,dn,vn=h.expr.attrHandle,mn=/^(?:checked|selected)$/i,gn=l.getSetAttribute,yn=l.input;h.fn.extend({attr:function(e,t){return $(this,h.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){h.removeAttr(this,e)})}}),h.extend({attr:function(e,t,n){var r,i,s=e.nodeType;if(!e||s===3||s===8||s===2)return;if(typeof e.getAttribute===B)return h.prop(e,t,n);if(s!==1||!h.isXMLDoc(e))t=t.toLowerCase(),r=h.attrHooks[t]||(h.expr.match.bool.test(t)?dn:pn);if(n===undefined)return r&&"get"in r&&(i=r.get(e,t))!==null?i:(i=h.find.attr(e,t),i==null?undefined:i);if(n!==null)return r&&"set"in r&&(i=r.set(e,n,t))!==undefined?i:(e.setAttribute(t,n+""),n);h.removeAttr(e,t)},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(O);if(s&&e.nodeType===1)while(n=s[i++])r=h.propFix[n]||n,h.expr.match.bool.test(n)?yn&&gn||!mn.test(n)?e[r]=!1:e[h.camelCase("default-"+n)]=e[r]=!1:h.attr(e,n,""),e.removeAttribute(gn?n:r)},attrHooks:{type:{set:function(e,t){if(!l.radioValue&&t==="radio"&&h.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}}}),dn={set:function(e,t,n){return t===!1?h.removeAttr(e,n):yn&&gn||!mn.test(n)?e.setAttribute(!gn&&h.propFix[n]||n,n):e[h.camelCase("default-"+n)]=e[n]=!0,n}},h.each(h.expr.match.bool.source.match(/\w+/g),function(e,t){var n=vn[t]||h.find.attr;vn[t]=yn&&gn||!mn.test(t)?function(e,t,r){var i,s;return r||(s=vn[t],vn[t]=i,i=n(e,t,r)!=null?t.toLowerCase():null,vn[t]=s),i}:function(e,t,n){if(!n)return e[h.camelCase("default-"+t)]?t.toLowerCase():null}});if(!yn||!gn)h.attrHooks.value={set:function(e,t,n){if(!h.nodeName(e,"input"))return pn&&pn.set(e,t,n);e.defaultValue=t}};gn||(pn={set:function(e,t,n){var r=e.getAttributeNode(n);r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="";if(n==="value"||t===e.getAttribute(n))return t}},vn.id=vn.name=vn.coords=function(e,t,n){var r;if(!n)return(r=e.getAttributeNode(t))&&r.value!==""?r.value:null},h.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:pn.set},h.attrHooks.contenteditable={set:function(e,t,n){pn.set(e,t===""?!1:t,n)}},h.each(["width","height"],function(e,t){h.attrHooks[t]={set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}}})),l.style||(h.attrHooks.style={get:function(e){return e.style.cssText||undefined},set:function(e,t){return e.style.cssText=t+""}});var bn=/^(?:input|select|textarea|button|object)$/i,wn=/^(?:a|area)$/i;h.fn.extend({prop:function(e,t){return $(this,h.prop,e,t,arguments.length>1)},removeProp:function(e){return e=h.propFix[e]||e,this.each(function(){try{this[e]=undefined,delete this[e]}catch(t){}})}}),h.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,s,o=e.nodeType;if(!e||o===3||o===8||o===2)return;return s=o!==1||!h.isXMLDoc(e),s&&(t=h.propFix[t]||t,i=h.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&(r=i.get(e,t))!==null?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=h.find.attr(e,"tabindex");return t?parseInt(t,10):bn.test(e.nodeName)||wn.test(e.nodeName)&&e.href?0:-1}}}}),l.hrefNormalized||h.each(["href","src"],function(e,t){h.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),l.optSelected||(h.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),h.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){h.propFix[this.toLowerCase()]=this}),l.enctype||(h.propFix.enctype="encoding");var En=/[\t\r\n\f]/g;h.fn.extend({addClass:function(e){var t,n,r,i,s,o,u=0,a=this.length,f=typeof e=="string"&&e;if(h.isFunction(e))return this.each(function(t){h(this).addClass(e.call(this,t,this.className))});if(f){t=(e||"").match(O)||[];for(;u<a;u++){n=this[u],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(En," "):" ");if(r){s=0;while(i=t[s++])r.indexOf(" "+i+" ")<0&&(r+=i+" ");o=h.trim(r),n.className!==o&&(n.className=o)}}}return this},removeClass:function(e){var t,n,r,i,s,o,u=0,a=this.length,f=arguments.length===0||typeof e=="string"&&e;if(h.isFunction(e))return this.each(function(t){h(this).removeClass(e.call(this,t,this.className))});if(f){t=(e||"").match(O)||[];for(;u<a;u++){n=this[u],r=n.nodeType===1&&(n.className?(" "+n.className+" ").replace(En," "):"");if(r){s=0;while(i=t[s++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");o=e?h.trim(r):"",n.className!==o&&(n.className=o)}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):h.isFunction(e)?this.each(function(n){h(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var t,r=0,i=h(this),s=e.match(O)||[];while(t=s[r++])i.hasClass(t)?i.removeClass(t):i.addClass(t)}else if(n===B||n==="boolean")this.className&&h._data(this,"__className__",this.className),this.className=this.className||e===!1?"":h._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(En," ").indexOf(t)>=0)return!0;return!1}}),h.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){h.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),h.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)}});var Sn=h.now(),xn=/\?/,Tn=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;h.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,r=null,i=h.trim(t+"");return i&&!h.trim(i.replace(Tn,function(e,t,i,s){return n&&t&&(r=0),r===0?e:(n=i||t,r+=!s-!i,"")}))?Function("return "+i)():h.error("Invalid JSON: "+t)},h.parseXML=function(t){var n,r;if(!t||typeof t!="string")return null;try{e.DOMParser?(r=new DOMParser,n=r.parseFromString(t,"text/xml")):(n=new ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(t))}catch(i){n=undefined}return(!n||!n.documentElement||n.getElementsByTagName("parsererror").length)&&h.error("Invalid XML: "+t),n};var Nn,Cn,kn=/#.*$/,Ln=/([?&])_=[^&]*/,An=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,On=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mn=/^(?:GET|HEAD)$/,_n=/^\/\//,Dn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Pn={},Hn={},Bn="*/".concat("*");try{Cn=location.href}catch(jn){Cn=T.createElement("a"),Cn.href="",Cn=Cn.href}Nn=Dn.exec(Cn.toLowerCase())||[],h.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Cn,type:"GET",isLocal:On.test(Nn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Bn,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":h.parseJSON,"text xml":h.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?qn(qn(e,h.ajaxSettings),t):qn(h.ajaxSettings,e)},ajaxPrefilter:Fn(Pn),ajaxTransport:Fn(Hn),ajax:function(e,t){function x(e,t,n,r){var f,g,y,w,S,x=t;if(b===2)return;b=2,o&&clearTimeout(o),a=undefined,s=r||"",E.readyState=e>0?4:0,f=e>=200&&e<300||e===304,n&&(w=Rn(l,E,n)),w=Un(l,w,E,f);if(f)l.ifModified&&(S=E.getResponseHeader("Last-Modified"),S&&(h.lastModified[i]=S),S=E.getResponseHeader("etag"),S&&(h.etag[i]=S)),e===204||l.type==="HEAD"?x="nocontent":e===304?x="notmodified":(x=w.state,g=w.data,y=w.error,f=!y);else{y=x;if(e||!x)x="error",e<0&&(e=0)}E.status=e,E.statusText=(t||x)+"",f?d.resolveWith(c,[g,x,E]):d.rejectWith(c,[E,x,y]),E.statusCode(m),m=undefined,u&&p.trigger(f?"ajaxSuccess":"ajaxError",[E,l,f?g:y]),v.fireWith(c,[E,x]),u&&(p.trigger("ajaxComplete",[E,l]),--h.active||h.event.trigger("ajaxStop"))}typeof e=="object"&&(t=e,e=undefined),t=t||{};var n,r,i,s,o,u,a,f,l=h.ajaxSetup({},t),c=l.context||l,p=l.context&&(c.nodeType||c.jquery)?h(c):h.event,d=h.Deferred(),v=h.Callbacks("once memory"),m=l.statusCode||{},g={},y={},b=0,w="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(b===2){if(!f){f={};while(t=An.exec(s))f[t[1].toLowerCase()]=t[2]}t=f[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return b===2?s:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=y[n]=y[n]||e,g[e]=t),this},overrideMimeType:function(e){return b||(l.mimeType=e),this},statusCode:function(e){var t;if(e)if(b<2)for(t in e)m[t]=[m[t],e[t]];else E.always(e[E.status]);return this},abort:function(e){var t=e||w;return a&&a.abort(t),x(0,t),this}};d.promise(E).complete=v.add,E.success=E.done,E.error=E.fail,l.url=((e||l.url||Cn)+"").replace(kn,"").replace(_n,Nn[1]+"//"),l.type=t.method||t.type||l.method||l.type,l.dataTypes=h.trim(l.dataType||"*").toLowerCase().match(O)||[""],l.crossDomain==null&&(n=Dn.exec(l.url.toLowerCase()),l.crossDomain=!(!n||n[1]===Nn[1]&&n[2]===Nn[2]&&(n[3]||(n[1]==="http:"?"80":"443"))===(Nn[3]||(Nn[1]==="http:"?"80":"443")))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=h.param(l.data,l.traditional)),In(Pn,l,t,E);if(b===2)return E;u=h.event&&l.global,u&&h.active++===0&&h.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Mn.test(l.type),i=l.url,l.hasContent||(l.data&&(i=l.url+=(xn.test(i)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Ln.test(i)?i.replace(Ln,"$1_="+Sn++):i+(xn.test(i)?"&":"?")+"_="+Sn++)),l.ifModified&&(h.lastModified[i]&&E.setRequestHeader("If-Modified-Since",h.lastModified[i]),h.etag[i]&&E.setRequestHeader("If-None-Match",h.etag[i])),(l.data&&l.hasContent&&l.contentType!==!1||t.contentType)&&E.setRequestHeader("Content-Type",l.contentType),E.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+Bn+"; q=0.01":""):l.accepts["*"]);for(r in l.headers)E.setRequestHeader(r,l.headers[r]);if(!l.beforeSend||l.beforeSend.call(c,E,l)!==!1&&b!==2){w="abort";for(r in{success:1,error:1,complete:1})E[r](l[r]);a=In(Hn,l,t,E);if(!a)x(-1,"No Transport");else{E.readyState=1,u&&p.trigger("ajaxSend",[E,l]),l.async&&l.timeout>0&&(o=setTimeout(function(){E.abort("timeout")},l.timeout));try{b=1,a.send(g,x)}catch(S){if(!(b<2))throw S;x(-1,S)}}return E}return E.abort()},getJSON:function(e,t,n){return h.get(e,t,n,"json")},getScript:function(e,t){return h.get(e,undefined,t,"script")}}),h.each(["get","post"],function(e,t){h[t]=function(e,n,r,i){return h.isFunction(n)&&(i=i||r,r=n,n=undefined),h.ajax({url:e,type:t,dataType:i,data:n,success:r})}}),h._evalUrl=function(e){return h.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},h.fn.extend({wrapAll:function(e){if(h.isFunction(e))return this.each(function(t){h(this).wrapAll(e.call(this,t))});if(this[0]){var t=h(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return h.isFunction(e)?this.each(function(t){h(this).wrapInner(e.call(this,t))}):this.each(function(){var t=h(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=h.isFunction(e);return this.each(function(n){h(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){h.nodeName(this,"body")||h(this).replaceWith(this.childNodes)}).end()}}),h.expr.filters.hidden=function(e){return e.offsetWidth<=0&&e.offsetHeight<=0||!l.reliableHiddenOffsets()&&(e.style&&e.style.display||h.css(e,"display"))==="none"},h.expr.filters.visible=function(e){return!h.expr.filters.hidden(e)};var zn=/%20/g,Wn=/\[\]$/,Xn=/\r?\n/g,Vn=/^(?:submit|button|image|reset|file)$/i,$n=/^(?:input|select|textarea|keygen)/i;h.param=function(e,t){var n,r=[],i=function(e,t){t=h.isFunction(t)?t():t==null?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};t===undefined&&(t=h.ajaxSettings&&h.ajaxSettings.traditional);if(h.isArray(e)||e.jquery&&!h.isPlainObject(e))h.each(e,function(){i(this.name,this.value)});else for(n in e)Jn(n,e[n],t,i);return r.join("&").replace(zn,"+")},h.fn.extend({serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=h.prop(this,"elements");return e?h.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!h(this).is(":disabled")&&$n.test(this.nodeName)&&!Vn.test(e)&&(this.checked||!J.test(e))}).map(function(e,t){var n=h(this).val();return n==null?null:h.isArray(n)?h.map(n,function(e){return{name:t.name,value:e.replace(Xn,"\r\n")}}):{name:t.name,value:n.replace(Xn,"\r\n")}}).get()}}),h.ajaxSettings.xhr=e.ActiveXObject!==undefined?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Yn()||Zn()}:Yn;var Kn=0,Qn={},Gn=h.ajaxSettings.xhr();e.attachEvent&&e.attachEvent("onunload",function(){for(var e in Qn)Qn[e](undefined,!0)}),l.cors=!!Gn&&"withCredentials"in Gn,Gn=l.ajax=!!Gn,Gn&&h.ajaxTransport(function(e){if(!e.crossDomain||l.cors){var t;return{send:function(n,r){var i,s=e.xhr(),o=++Kn;s.open(e.type,e.url,e.async,e.username,e.password);if(e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),!e.crossDomain&&!n["X-Requested-With"]&&(n["X-Requested-With"]="XMLHttpRequest");for(i in n)n[i]!==undefined&&s.setRequestHeader(i,n[i]+"");s.send(e.hasContent&&e.data||null),t=function(n,i){var u,a,f;if(t&&(i||s.readyState===4)){delete Qn[o],t=undefined,s.onreadystatechange=h.noop;if(i)s.readyState!==4&&s.abort();else{f={},u=s.status,typeof s.responseText=="string"&&(f.text=s.responseText);try{a=s.statusText}catch(l){a=""}!u&&e.isLocal&&!e.crossDomain?u=f.text?200:404:u===1223&&(u=204)}}f&&r(u,a,f,s.getAllResponseHeaders())},e.async?s.readyState===4?setTimeout(t):s.onreadystatechange=Qn[o]=t:t()},abort:function(){t&&t(undefined,!0)}}}}),h.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return h.globalEval(e),e}}}),h.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),h.ajaxTransport("script",function(e){if(e.crossDomain){var t,n=T.head||h("head")[0]||T.documentElement;return{send:function(r,i){t=T.createElement("script"),t.async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){if(n||!t.readyState||/loaded|complete/.test(t.readyState))t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||i(200,"success")},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(undefined,!0)}}}});var er=[],tr=/(=)\?(?=&|$)|\?\?/;h.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=er.pop()||h.expando+"_"+Sn++;return this[e]=!0,e}}),h.ajaxPrefilter("json jsonp",function(t,n,r){var i,s,o,u=t.jsonp!==!1&&(tr.test(t.url)?"url":typeof t.data=="string"&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&tr.test(t.data)&&"data");if(u||t.dataTypes[0]==="jsonp")return i=t.jsonpCallback=h.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,u?t[u]=t[u].replace(tr,"$1"+i):t.jsonp!==!1&&(t.url+=(xn.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||h.error(i+" was not called"),o[0]},t.dataTypes[0]="json",s=e[i],e[i]=function(){o=arguments},r.always(function(){e[i]=s,t[i]&&(t.jsonpCallback=n.jsonpCallback,er.push(i)),o&&h.isFunction(s)&&s(o[0]),o=s=undefined}),"script"}),h.parseHTML=function(e,t,n){if(!e||typeof e!="string")return null;typeof t=="boolean"&&(n=t,t=!1),t=t||T;var r=w.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=h.buildFragment([e],t,i),i&&i.length&&h(i).remove(),h.merge([],r.childNodes))};var nr=h.fn.load;h.fn.load=function(e,t,n){if(typeof e!="string"&&nr)return nr.apply(this,arguments);var r,i,s,o=this,u=e.indexOf(" ");return u>=0&&(r=h.trim(e.slice(u,e.length)),e=e.slice(0,u)),h.isFunction(t)?(n=t,t=undefined):t&&typeof t=="object"&&(s="POST"),o.length>0&&h.ajax({url:e,type:s,dataType:"html",data:t}).done(function(e){i=arguments,o.html(r?h("<div>").append(h.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){o.each(n,i||[e.responseText,t,e])}),this},h.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){h.fn[t]=function(e){return this.on(t,e)}}),h.expr.filters.animated=function(e){return h.grep(h.timers,function(t){return e===t.elem}).length};var rr=e.document.documentElement;h.offset={setOffset:function(e,t,n){var r,i,s,o,u,a,f,l=h.css(e,"position"),c=h(e),p={};l==="static"&&(e.style.position="relative"),u=c.offset(),s=h.css(e,"top"),a=h.css(e,"left"),f=(l==="absolute"||l==="fixed")&&h.inArray("auto",[s,a])>-1,f?(r=c.position(),o=r.top,i=r.left):(o=parseFloat(s)||0,i=parseFloat(a)||0),h.isFunction(t)&&(t=t.call(e,n,u)),t.top!=null&&(p.top=t.top-u.top+o),t.left!=null&&(p.left=t.left-u.left+i),"using"in t?t.using.call(e,p):c.css(p)}},h.fn.extend({offset:function(e){if(arguments.length)return e===undefined?this:this.each(function(t){h.offset.setOffset(this,e,t)});var t,n,r={top:0,left:0},i=this[0],s=i&&i.ownerDocument;if(!s)return;return t=s.documentElement,h.contains(t,i)?(typeof i.getBoundingClientRect!==B&&(r=i.getBoundingClientRect()),n=ir(s),{top:r.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:r.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):r},position:function(){if(!this[0])return;var e,t,n={top:0,left:0},r=this[0];return h.css(r,"position")==="fixed"?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),h.nodeName(e[0],"html")||(n=e.offset()),n.top+=h.css(e[0],"borderTopWidth",!0),n.left+=h.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-h.css(r,"marginTop",!0),left:t.left-n.left-h.css(r,"marginLeft",!0)}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||rr;while(e&&!h.nodeName(e,"html")&&h.css(e,"position")==="static")e=e.offsetParent;return e||rr})}}),h.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n=/Y/.test(t);h.fn[e]=function(r){return $(this,function(e,r,i){var s=ir(e);if(i===undefined)return s?t in s?s[t]:s.document.documentElement[r]:e[r];s?s.scrollTo(n?h(s).scrollLeft():i,n?i:h(s).scrollTop()):e[r]=i},e,r,arguments.length,null)}}),h.each(["top","left"],function(e,t){h.cssHooks[t]=jt(l.pixelPosition,function(e,n){if(n)return n=Ht(e,t),Dt.test(n)?h(e).position()[t]+"px":n})}),h.each({Height:"height",Width:"width"},function(e,t){h.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){h.fn[r]=function(r,i){var s=arguments.length&&(n||typeof r!="boolean"),o=n||(r===!0||i===!0?"margin":"border");return $(this,function(t,n,r){var i;return h.isWindow(t)?t.document.documentElement["client"+e]:t.nodeType===9?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?h.css(t,n,o):h.style(t,n,r,o)},t,s?r:undefined,s,null)}})}),h.fn.size=function(){return this.length},h.fn.andSelf=h.fn.addBack,typeof define=="function"&&define.amd&&define("jquery",[],function(){return h});var sr=e.jQuery,or=e.$;return h.noConflict=function(t){return e.$===h&&(e.$=or),t&&e.jQuery===h&&(e.jQuery=sr),h},typeof t===B&&(e.jQuery=e.$=h),h}),function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=x),exports._=x):e._=x,x.VERSION="1.5.1";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(x.has(e,o)&&t.call(r,e[o],o,e)===n)return};x.map=x.collect=function(e,t,n){var r=[];return e==null?r:h&&e.map===h?e.map(t,n):(T(e,function(e,i,s){r.push(t.call(n,e,i,s))}),r)};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p)return r&&(t=x.bind(t,r)),i?e.reduce(t,n):e.reduce(t);T(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError(N);return n},x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d)return r&&(t=x.bind(t,r)),i?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError(N);return n},x.find=x.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},x.filter=x.select=function(e,t,n){var r=[];return e==null?r:v&&e.filter===v?e.filter(t,n):(T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)}),r)},x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)},x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;return e==null?i:m&&e.every===m?e.every(t,r):(T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;return e==null?i:g&&e.some===g?e.some(t,r):(T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})},x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})},x.pluck=function(e,t){return x.map(e,function(e){return e[t]})},x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},x.findWhere=function(e,t){return x.where(e,t,!0)},x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})}),r.value},x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};return T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},x.shuffle=function(e){var t,n=0,r=[];return T(e,function(e){t=x.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t==null?x.identity:t);return T(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};x.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)})},x.countBy=function(e,t,n){return L(e,t,n,function(e,t){x.has(e,t)||(e[t]=0),e[t]++})},x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]},x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length},x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,0,t):e[0]},x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},x.last=function(e,t,n){return e==null?void 0:t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){return t&&x.every(e,x.isArray)?a.apply(n,e):(T(e,function(e){x.isArray(e)||x.isArguments(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n)};x.flatten=function(e,t){return A(e,t,[])},x.without=function(e){return x.difference(e,u.call(arguments,1))},x.uniq=x.unique=function(e,t,n,r){x.isFunction(t)&&(r=n,n=t,t=!1);var i=n?x.map(e,n,r):e,s=[],o=[];return T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n))o.push(n),s.push(e[r])}),s},x.union=function(){return x.uniq(x.flatten(arguments,!0))},x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})},x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})},x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n<e;n++)t[n]=x.pluck(arguments,""+n);return t},x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number")return r=x.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},x.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};x.bind=function(e,t){var n,r;if(S&&e.bind===S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;return n=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}},x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}},x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");return T(t,function(t){e[t]=x.bind(e[t],e)}),e},x.memoize=function(e,t){var n={};return t||(t=x.identity),function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))},x.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:new Date,o=null,s=e.apply(r,i)};return function(){var f=new Date;!u&&n.leading===!1&&(u=f);var l=t-(f-u);return r=this,i=arguments,l<=0?(clearTimeout(o),o=null,u=f,s=e.apply(r,i)):!o&&n.trailing!==!1&&(o=setTimeout(a,l)),s}},x.debounce=function(e,t,n){var r,i=null;return function(){var s=this,o=arguments,u=function(){i=null,n||(r=e.apply(s,o))},a=n&&!i;return clearTimeout(i),i=setTimeout(u,t),a&&(r=e.apply(s,o)),r}},x.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},x.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t},x.values=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push(e[n]);return t},x.pairs=function(e){var t=[];for(var n in e)x.has(e,n)&&t.push([n,e[n]]);return t},x.invert=function(e){var t={};for(var n in e)x.has(e,n)&&(t[e[n]]=n);return t},x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()},x.extend=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]}),e},x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return T(n,function(n){n in e&&(t[n]=e[n])}),t},x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t},x.defaults=function(e){return T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e},x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e},x.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped),t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?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(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;var o=e.constructor,u=t.constructor;if(o!==u&&!(x.isFunction(o)&&o instanceof o&&x.isFunction(u)&&u instanceof u))return!1;n.push(e),r.push(t);var a=0,l=!0;if(i=="[object Array]"){a=e.length,l=a==t.length;if(l)while(a--)if(!(l=M(e[a],t[a],n,r)))break}else{for(var c in e)if(x.has(e,c)){a++;if(!(l=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(l){for(c in t)if(x.has(t,c)&&!(a--))break;l=!a}}return n.pop(),r.pop(),l};x.isEqual=function(e,t){return M(e,t,[],[])},x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0},x.isElement=function(e){return!!e&&e.nodeType===1},x.isArray=w||function(e){return f.call(e)=="[object Array]"},x.isObject=function(e){return e===Object(e)},T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}}),x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")}),typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"}),x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},x.isNaN=function(e){return x.isNumber(e)&&e!=+e},x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"},x.isNull=function(e){return e===null},x.isUndefined=function(e){return e===void 0},x.has=function(e,t){return l.call(e,t)},x.noConflict=function(){return e._=t,this},x.identity=function(e){return e},x.times=function(e,t,n){var r=Array(Math.max(0,e));for(var i=0;i<e;i++)r[i]=t.call(n,i);return r},x.random=function(e,t){return t==null&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n},x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t},x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){return o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),s=u+t.length,t}),o+="';\n",n.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{r=new Function(n.variable||"obj","_",o)}catch(u){throw u.source=o,u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};return a.source="function("+(n.variable||"obj")+"){\n"+o+"}",a},x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x),T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),x.extend(x.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}.call(this),define("underscore",function(e){return function(){var t,n;return t||e._}}(this)),define("text",["module"],function(e){var t,n,r,i,s,o=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],u=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,f=typeof location!="undefined"&&location.href,l=f&&location.protocol&&location.protocol.replace(/\:/,""),c=f&&location.hostname,h=f&&(location.port||undefined),p={},d=e.config&&e.config()||{};t={version:"2.0.13+",strip:function(e){if(e){e=e.replace(u,"");var t=e.match(a);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:d.createXhr||function(){var e,t,n;if(typeof XMLHttpRequest!="undefined")return new XMLHttpRequest;if(typeof ActiveXObject!="undefined")for(t=0;t<3;t+=1){n=o[t];try{e=new ActiveXObject(n)}catch(r){}if(e){o=[n];break}}return e},parseName:function(e){var t,n,r,i=!1,s=e.lastIndexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1)):t=e,r=n||t,s=r.indexOf("!"),s!==-1&&(i=r.substring(s+1)==="strip",r=r.substring(0,s),n?n=r:t=r),{moduleName:t,ext:n,strip:i}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,n,r,i){var s,o,u,a=t.xdRegExp.exec(e);return a?(s=a[2],o=a[3],o=o.split(":"),u=o[1],o=o[0],(!s||s===n)&&(!o||o.toLowerCase()===r.toLowerCase())&&(!u&&!o||u===i)):!0},finishLoad:function(e,n,r,i){r=n?t.strip(r):r,d.isBuild&&(p[e]=r),i(r)},load:function(e,n,r,i){if(i&&i.isBuild&&!i.inlineText){r();return}d.isBuild=i&&i.isBuild;var s=t.parseName(e),o=s.moduleName+(s.ext?"."+s.ext:""),u=n.toUrl(o),a=d.useXhr||t.useXhr;if(u.indexOf("empty:")===0){r();return}!f||a(u,l,c,h)?t.get(u,function(n){t.finishLoad(e,s.strip,n,r)},function(e){r.error&&r.error(e)}):n([o],function(e){t.finishLoad(s.moduleName+"."+s.ext,s.strip,e,r)})},write:function(e,n,r,i){if(p.hasOwnProperty(n)){var s=t.jsEscape(p[n]);r.asModule(e+"!"+n,"define(function () { return '"+s+"';});\n")}},writeFile:function(e,n,r,i,s){var o=t.parseName(n),u=o.ext?"."+o.ext:"",a=o.moduleName+u,f=r.toUrl(o.moduleName+u)+".js";t.load(a,r,function(n){var r=function(e){return i(f,e)};r.asModule=function(e,t){return i.asModule(e,f,t)},t.write(e,a,r,s)},s)}};if(d.env==="node"||!d.env&&typeof process!="undefined"&&process.versions&&!!process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i[0]==="﻿"&&(i=i.substring(1)),t(i)}catch(s){r&&r(s)}};else if(d.env==="xhr"||!d.env&&t.createXhr())t.get=function(e,n,r,i){var s=t.createXhr(),o;s.open("GET",e,!0);if(i)for(o in i)i.hasOwnProperty(o)&&s.setRequestHeader(o.toLowerCase(),i[o]);d.onXhr&&d.onXhr(s,e),s.onreadystatechange=function(t){var i,o;s.readyState===4&&(i=s.status||0,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,r&&r(o)):n(s.responseText),d.onXhrComplete&&d.onXhrComplete(s,e))},s.send(null)};else if(d.env==="rhino"||!d.env&&typeof Packages!="undefined"&&typeof java!="undefined")t.get=function(e,t){var n,r,i="utf-8",s=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),u=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s),i)),a="";try{n=new java.lang.StringBuffer,r=u.readLine(),r&&r.length()&&r.charAt(0)===65279&&(r=r.substring(1)),r!==null&&n.append(r);while((r=u.readLine())!==null)n.append(o),n.append(r);a=String(n.toString())}finally{u.close()}t(a)};else if(d.env==="xpconnect"||!d.env&&typeof Components!="undefined"&&Components.classes&&Components.interfaces)r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),s="@mozilla.org/windows-registry-key;1"in r,t.get=function(e,t){var n,o,u,a={};s&&(e=e.replace(/\//g,"\\")),u=new FileUtils.File(e);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(u,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),a),o.close(),n.close(),t(a.value)}catch(f){throw new Error((u&&u.path||"")+": "+f)}};return t}),define("pinyin-by-unicode",{strChineseFirstPY:" "}),function(e,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define("moment",t):e.moment=t()}(this,function(){function t(){return e.apply(null,arguments)}function n(t){e=t}function r(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function i(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function s(e,t){var n=[],r;for(r=0;r<e.length;++r)n.push(t(e[r],r));return n}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){for(var n in t)o(t,n)&&(e[n]=t[n]);return o(t,"toString")&&(e.toString=t.toString),o(t,"valueOf")&&(e.valueOf=t.valueOf),e}function a(e,t,n,r){return _n(e,t,n,r,!0).utc()}function f(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function l(e){return e._pf==null&&(e._pf=f()),e._pf}function c(e){if(e._isValid==null){var t=l(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&&t.charsLeftOver===0&&t.unusedTokens.length===0&&t.bigHour===undefined)}return e._isValid}function h(e){var t=a(NaN);return e!=null?u(l(t),e):l(t).userInvalidated=!0,t}function p(e){return e===void 0}function v(e,t){var n,r,i;p(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),p(t._i)||(e._i=t._i),p(t._f)||(e._f=t._f),p(t._l)||(e._l=t._l),p(t._strict)||(e._strict=t._strict),p(t._tzm)||(e._tzm=t._tzm),p(t._isUTC)||(e._isUTC=t._isUTC),p(t._offset)||(e._offset=t._offset),p(t._pf)||(e._pf=l(t)),p(t._locale)||(e._locale=t._locale);if(d.length>0)for(n in d)r=d[n],i=t[r],p(i)||(e[r]=i);return e}function g(e){v(this,e),this._d=new Date(e._d!=null?e._d.getTime():NaN),m===!1&&(m=!0,t.updateOffset(this),m=!1)}function y(e){return e instanceof g||e!=null&&e._isAMomentObject!=null}function b(e){return e<0?Math.ceil(e):Math.floor(e)}function w(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=b(t)),n}function E(e,t,n){var r=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),s=0,o;for(o=0;o<r;o++)(n&&e[o]!==t[o]||!n&&w(e[o])!==w(t[o]))&&s++;return s+i}function S(e){t.suppressDeprecationWarnings===!1&&typeof console!="undefined"&&console.warn&&console.warn("Deprecation warning: "+e)}function x(e,t){var n=!0;return u(function(){return n&&(S(e+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}function N(e,t){T[e]||(S(t),T[e]=!0)}function C(e){return e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function k(e){return Object.prototype.toString.call(e)==="[object Object]"}function L(e){var t,n;for(n in e)t=e[n],C(t)?this[n]=t:this["_"+n]=t;this._config=e,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function A(e,t){var n=u({},e),r;for(r in t)o(t,r)&&(k(e[r])&&k(t[r])?(n[r]={},u(n[r],e[r]),u(n[r],t[r])):t[r]!=null?n[r]=t[r]:delete n[r]);return n}function O(e){e!=null&&this.set(e)}function D(e){return e?e.toLowerCase().replace("_","-"):e}function P(e){var t=0,n,r,i,s;while(t<e.length){s=D(e[t]).split("-"),n=s.length,r=D(e[t+1]),r=r?r.split("-"):null;while(n>0){i=H(s.slice(0,n).join("-"));if(i)return i;if(r&&r.length>=n&&E(s,r,!0)>=n-1)break;n--}t++}return null}function H(e){var t=null;if(!M[e]&&typeof module!="undefined"&&module&&module.exports)try{t=_._abbr,require("./locale/"+e),B(t)}catch(n){}return M[e]}function B(e,t){var n;return e&&(p(t)?n=I(e):n=j(e,t),n&&(_=n)),_._abbr}function j(e,t){return t!==null?(t.abbr=e,M[e]!=null?(N("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=A(M[e]._config,t)):t.parentLocale!=null&&(M[t.parentLocale]!=null?t=A(M[t.parentLocale]._config,t):N("parentLocaleUndefined","specified parentLocale is not defined yet")),M[e]=new O(t),B(e),M[e]):(delete M[e],null)}function F(e,t){if(t!=null){var n;M[e]!=null&&(t=A(M[e]._config,t)),n=new O(t),n.parentLocale=M[e],M[e]=n,B(e)}else M[e]!=null&&(M[e].parentLocale!=null?M[e]=M[e].parentLocale:M[e]!=null&&delete M[e]);return M[e]}function I(e){var t;e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr);if(!e)return _;if(!r(e)){t=H(e);if(t)return t;e=[e]}return P(e)}function q(){return Object.keys(M)}function U(e,t){var n=e.toLowerCase();R[n]=R[n+"s"]=R[t]=e}function z(e){return typeof e=="string"?R[e]||R[e.toLowerCase()]:undefined}function W(e){var t={},n,r;for(r in e)o(e,r)&&(n=z(r),n&&(t[n]=e[r]));return t}function X(e,n){return function(r){return r!=null?($(this,e,r),t.updateOffset(this,n),this):V(this,e)}}function V(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function $(e,t,n){e.isValid()&&e._d["set"+(e._isUTC?"UTC":"")+t](n)}function J(e,t){var n;if(typeof e=="object")for(n in e)this.set(n,e[n]);else{e=z(e);if(C(this[e]))return this[e](t)}return this}function K(e,t,n){var r=""+Math.abs(e),i=t-r.length,s=e>=0;return(s?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function et(e,t,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),e&&(Z[e]=i),t&&(Z[t[0]]=function(){return K(i.apply(this,arguments),t[1],t[2])}),n&&(Z[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function tt(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function nt(e){var t=e.match(Q),n,r;for(n=0,r=t.length;n<r;n++)Z[t[n]]?t[n]=Z[t[n]]:t[n]=tt(t[n]);return function(i){var s="";for(n=0;n<r;n++)s+=t[n]instanceof Function?t[n].call(i,e):t[n];return s}}function rt(e,t){return e.isValid()?(t=it(t,e.localeData()),Y[t]=Y[t]||nt(t),Y[t](e)):e.localeData().invalidDate()}function it(e,t){function r(e){return t.longDateFormat(e)||e}var n=5;G.lastIndex=0;while(n>=0&&G.test(e))e=e.replace(G,r),G.lastIndex=0,n-=1;return e}function xt(e,t,n){St[e]=C(t)?t:function(e,r){return e&&n?n:t}}function Tt(e,t){return o(St,e)?St[e](t._strict,t._locale):new RegExp(Nt(e))}function Nt(e){return Ct(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i}))}function Ct(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Lt(e,t){var n,r=t;typeof e=="string"&&(e=[e]),typeof t=="number"&&(r=function(e,n){n[t]=w(e)});for(n=0;n<e.length;n++)kt[e[n]]=r}function At(e,t){Lt(e,function(e,n,r,i){r._w=r._w||{},t(e,r._w,r,i)})}function Ot(e,t,n){t!=null&&o(kt,e)&&kt[e](t,n._a,n,e)}function qt(e,t){return(new Date(Date.UTC(e,t+1,0))).getUTCDate()}function zt(e,t){return r(this._months)?this._months[e.month()]:this._months[Rt.test(t)?"format":"standalone"][e.month()]}function Xt(e,t){return r(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Rt.test(t)?"format":"standalone"][e.month()]}function Vt(e,t,n){var r,i,s;this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]);for(r=0;r<12;r++){i=a([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(s.replace(".",""),"i"));if(n&&t==="MMMM"&&this._longMonthsParse[r].test(e))return r;if(n&&t==="MMM"&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}}function $t(e,t){var n;if(!e.isValid())return e;if(typeof t=="string")if(/^\d+$/.test(t))t=w(t);else{t=e.localeData().monthsParse(t);if(typeof t!="number")return e}return n=Math.min(e.date(),qt(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function Jt(e){return e!=null?($t(this,e),t.updateOffset(this,!0),this):V(this,"Month")}function Kt(){return qt(this.year(),this.month())}function Gt(e){return this._monthsParseExact?(o(this,"_monthsRegex")||en.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex}function Zt(e){return this._monthsParseExact?(o(this,"_monthsRegex")||en.call(this),e?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex}function en(){function e(e,t){return t.length-e.length}var t=[],n=[],r=[],i,s;for(i=0;i<12;i++)s=a([2e3,i]),t.push(this.monthsShort(s,"")),n.push(this.months(s,"")),r.push(this.months(s,"")),r.push(this.monthsShort(s,""));t.sort(e),n.sort(e),r.sort(e);for(i=0;i<12;i++)t[i]=Ct(t[i]),n[i]=Ct(n[i]),r[i]=Ct(r[i]);this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")$","i")}function tn(e){var t,n=e._a;return n&&l(e).overflow===-2&&(t=n[_t]<0||n[_t]>11?_t:n[Dt]<1||n[Dt]>qt(n[Mt],n[_t])?Dt:n[Pt]<0||n[Pt]>24||n[Pt]===24&&(n[Ht]!==0||n[Bt]!==0||n[jt]!==0)?Pt:n[Ht]<0||n[Ht]>59?Ht:n[Bt]<0||n[Bt]>59?Bt:n[jt]<0||n[jt]>999?jt:-1,l(e)._overflowDayOfYear&&(t<Mt||t>Dt)&&(t=Dt),l(e)._overflowWeeks&&t===-1&&(t=Ft),l(e)._overflowWeekday&&t===-1&&(t=It),l(e).overflow=t),e}function fn(e){var t,n,r=e._i,i=nn.exec(r)||rn.exec(r),s,o,u,a;if(i){l(e).iso=!0;for(t=0,n=on.length;t<n;t++)if(on[t][1].exec(i[1])){o=on[t][0],s=on[t][2]!==!1;break}if(o==null){e._isValid=!1;return}if(i[3]){for(t=0,n=un.length;t<n;t++)if(un[t][1].exec(i[3])){u=(i[2]||" ")+un[t][0];break}if(u==null){e._isValid=!1;return}}if(!s&&u!=null){e._isValid=!1;return}if(i[4]){if(!sn.exec(i[4])){e._isValid=!1;return}a="Z"}e._f=o+(u||"")+(a||""),Nn(e)}else e._isValid=!1}function ln(e){var n=an.exec(e._i);if(n!==null){e._d=new Date(+n[1]);return}fn(e),e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))}function cn(e,t,n,r,i,s,o){var u=new Date(e,t,n,r,i,s,o);return e<100&&e>=0&&isFinite(u.getFullYear())&&u.setFullYear(e),u}function hn(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function pn(e){return dn(e)?366:365}function dn(e){return e%4===0&&e%100!==0||e%400===0}function mn(){return dn(this.year())}function gn(e,t,n){var r=7+t-n,i=(7+hn(e,0,r).getUTCDay()-t)%7;return-i+r-1}function yn(e,t,n,r,i){var s=(7+n-r)%7,o=gn(e,r,i),u=1+7*(t-1)+s+o,a,f;return u<=0?(a=e-1,f=pn(a)+u):u>pn(e)?(a=e+1,f=u-pn(e)):(a=e,f=u),{year:a,dayOfYear:f}}function bn(e,t,n){var r=gn(e.year(),t,n),i=Math.floor((e.dayOfYear()-r-1)/7)+1,s,o;return i<1?(o=e.year()-1,s=i+wn(o,t,n)):i>wn(e.year(),t,n)?(s=i-wn(e.year(),t,n),o=e.year()+1):(o=e.year(),s=i),{week:s,year:o}}function wn(e,t,n){var r=gn(e,t,n),i=gn(e+1,t,n);return(pn(e)-r+i)/7}function En(e,t,n){return e!=null?e:t!=null?t:n}function Sn(e){var n=new Date(t.now());return e._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function xn(e){var t,n,r=[],i,s;if(e._d)return;i=Sn(e),e._w&&e._a[Dt]==null&&e._a[_t]==null&&Tn(e),e._dayOfYear&&(s=En(e._a[Mt],i[Mt]),e._dayOfYear>pn(s)&&(l(e)._overflowDayOfYear=!0),n=hn(s,0,e._dayOfYear),e._a[_t]=n.getUTCMonth(),e._a[Dt]=n.getUTCDate());for(t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Pt]===24&&e._a[Ht]===0&&e._a[Bt]===0&&e._a[jt]===0&&(e._nextDay=!0,e._a[Pt]=0),e._d=(e._useUTC?hn:cn).apply(null,r),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Pt]=24)}function Tn(e){var t,n,r,i,s,o,u,a;t=e._w;if(t.GG!=null||t.W!=null||t.E!=null){s=1,o=4,n=En(t.GG,e._a[Mt],bn(Dn(),1,4).year),r=En(t.W,1),i=En(t.E,1);if(i<1||i>7)a=!0}else{s=e._locale._week.dow,o=e._locale._week.doy,n=En(t.gg,e._a[Mt],bn(Dn(),s,o).year),r=En(t.w,1);if(t.d!=null){i=t.d;if(i<0||i>6)a=!0}else if(t.e!=null){i=t.e+s;if(t.e<0||t.e>6)a=!0}else i=s}r<1||r>wn(n,s,o)?l(e)._overflowWeeks=!0:a!=null?l(e)._overflowWeekday=!0:(u=yn(n,r,i,s,o),e._a[Mt]=u.year,e._dayOfYear=u.dayOfYear)}function Nn(e){if(e._f===t.ISO_8601){fn(e);return}e._a=[],l(e).empty=!0;var n=""+e._i,r,i,s,o,u,a=n.length,f=0;s=it(e._f,e._locale).match(Q)||[];for(r=0;r<s.length;r++)o=s[r],i=(n.match(Tt(o,e))||[])[0],i&&(u=n.substr(0,n.indexOf(i)),u.length>0&&l(e).unusedInput.push(u),n=n.slice(n.indexOf(i)+i.length),f+=i.length),Z[o]?(i?l(e).empty=!1:l(e).unusedTokens.push(o),Ot(o,i,e)):e._strict&&!i&&l(e).unusedTokens.push(o);l(e).charsLeftOver=a-f,n.length>0&&l(e).unusedInput.push(n),l(e).bigHour===!0&&e._a[Pt]<=12&&e._a[Pt]>0&&(l(e).bigHour=undefined),e._a[Pt]=Cn(e._locale,e._a[Pt],e._meridiem),xn(e),tn(e)}function Cn(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):e.isPM!=null?(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0),t):t}function kn(e){var t,n,r,i,s;if(e._f.length===0){l(e).invalidFormat=!0,e._d=new Date(NaN);return}for(i=0;i<e._f.length;i++){s=0,t=v({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[i],Nn(t);if(!c(t))continue;s+=l(t).charsLeftOver,s+=l(t).unusedTokens.length*10,l(t).score=s;if(r==null||s<r)r=s,n=t}u(e,n||t)}function Ln(e){if(e._d)return;var t=W(e._i);e._a=s([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),xn(e)}function An(e){var t=new g(tn(On(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=undefined),t}function On(e){var t=e._i,n=e._f;return e._locale=e._locale||I(e._l),t===null||n===undefined&&t===""?h({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),y(t)?new g(tn(t)):(r(n)?kn(e):n?Nn(e):i(t)?e._d=t:Mn(e),c(e)||(e._d=null),e))}function Mn(e){var n=e._i;n===undefined?e._d=new Date(t.now()):i(n)?e._d=new Date(+n):typeof n=="string"?ln(e):r(n)?(e._a=s(n.slice(0),function(e){return parseInt(e,10)}),xn(e)):typeof n=="object"?Ln(e):typeof n=="number"?e._d=new Date(n):t.createFromInputFallback(e)}function _n(e,t,n,r,i){var s={};return typeof n=="boolean"&&(r=n,n=undefined),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=n,s._i=e,s._f=t,s._strict=r,An(s)}function Dn(e,t,n,r){return _n(e,t,n,r,!1)}function Bn(e,t){var n,i;t.length===1&&r(t[0])&&(t=t[0]);if(!t.length)return Dn();n=t[0];for(i=1;i<t.length;++i)if(!t[i].isValid()||t[i][e](n))n=t[i];return n}function jn(){var e=[].slice.call(arguments,0);return Bn("isBefore",e)}function Fn(){var e=[].slice.call(arguments,0);return Bn("isAfter",e)}function qn(e){var t=W(e),n=t.year||0,r=t.quarter||0,i=t.month||0,s=t.week||0,o=t.day||0,u=t.hour||0,a=t.minute||0,f=t.second||0,l=t.millisecond||0;this._milliseconds=+l+f*1e3+a*6e4+u*36e5,this._days=+o+s*7,this._months=+i+r*3+n*12,this._data={},this._locale=I(),this._bubble()}function Rn(e){return e instanceof qn}function Un(e,t){et(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+K(~~(e/60),2)+t+K(~~e%60,2)})}function Wn(e,t){var n=(t||"").match(e)||[],r=n[n.length-1]||[],i=(r+"").match(zn)||["-",0,0],s=+(i[1]*60)+w(i[2]);return i[0]==="+"?s:-s}function Xn(e,n){var r,s;return n._isUTC?(r=n.clone(),s=(y(e)||i(e)?+e:+Dn(e))- +r,r._d.setTime(+r._d+s),t.updateOffset(r,!1),r):Dn(e).local()}function Vn(e){return-Math.round(e._d.getTimezoneOffset()/15)*15}function $n(e,n){var r=this._offset||0,i;return this.isValid()?e!=null?(typeof e=="string"?e=Wn(bt,e):Math.abs(e)<16&&(e*=60),!this._isUTC&&n&&(i=Vn(this)),this._offset=e,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==e&&(!n||this._changeInProgress?hr(this,or(e-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,t.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:Vn(this):e!=null?this:NaN}function Jn(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Kn(e){return this.utcOffset(0,e)}function Qn(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Vn(this),"m")),this}function Gn(){return this._tzm?this.utcOffset(this._tzm):typeof this._i=="string"&&this.utcOffset(Wn(yt,this._i)),this}function Yn(e){return this.isValid()?(e=e?Dn(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function Zn(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function er(){if(!p(this._isDSTShifted))return this._isDSTShifted;var e={};v(e,this),e=On(e);if(e._a){var t=e._isUTC?a(e._a):Dn(e._a);this._isDSTShifted=this.isValid()&&E(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function tr(){return this.isValid()?!this._isUTC:!1}function nr(){return this.isValid()?this._isUTC:!1}function rr(){return this.isValid()?this._isUTC&&this._offset===0:!1}function or(e,t){var n=e,r=null,i,s,u;return Rn(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:typeof e=="number"?(n={},t?n[t]=e:n.milliseconds=e):(r=ir.exec(e))?(i=r[1]==="-"?-1:1,n={y:0,d:w(r[Dt])*i,h:w(r[Pt])*i,m:w(r[Ht])*i,s:w(r[Bt])*i,ms:w(r[jt])*i}):(r=sr.exec(e))?(i=r[1]==="-"?-1:1,n={y:ur(r[2],i),M:ur(r[3],i),w:ur(r[4],i),d:ur(r[5],i),h:ur(r[6],i),m:ur(r[7],i),s:ur(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(u=fr(Dn(n.from),Dn(n.to)),n={},n.ms=u.milliseconds,n.M=u.months),s=new qn(n),Rn(e)&&o(e,"_locale")&&(s._locale=e._locale),s}function ur(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function ar(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t- +e.clone().add(n.months,"M"),n}function fr(e,t){var n;return!e.isValid()||!t.isValid()?{milliseconds:0,months:0}:(t=Xn(t,e),e.isBefore(t)?n=ar(e,t):(n=ar(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n)}function lr(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function cr(e,t){return function(n,r){var i,s;return r!==null&&!isNaN(+r)&&(N(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),s=n,n=r,r=s),n=typeof n=="string"?+n:n,i=or(n,r),hr(this,i,e),this}}function hr(e,n,r,i){var s=n._milliseconds,o=lr(n._days),u=lr(n._months);if(!e.isValid())return;i=i==null?!0:i,s&&e._d.setTime(+e._d+s*r),o&&$(e,"Date",V(e,"Date")+o*r),u&&$t(e,V(e,"Month")+u*r),i&&t.updateOffset(e,o||u)}function vr(e,t){var n=e||Dn(),r=Xn(n,this).startOf("day"),i=this.diff(r,"days",!0),s=i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse",o=t&&(C(t[s])?t[s]():t[s]);return this.format(o||this.localeData().calendar(s,this,Dn(n)))}function mr(){return new g(this)}function gr(e,t){var n=y(e)?e:Dn(e);return!this.isValid()||!n.isValid()?!1:(t=z(p(t)?"millisecond":t),t==="millisecond"?+this>+n:+n<+this.clone().startOf(t))}function yr(e,t){var n=y(e)?e:Dn(e);return!this.isValid()||!n.isValid()?!1:(t=z(p(t)?"millisecond":t),t==="millisecond"?+this<+n:+this.clone().endOf(t)<+n)}function br(e,t,n){return this.isAfter(e,n)&&this.isBefore(t,n)}function wr(e,t){var n=y(e)?e:Dn(e),r;return!this.isValid()||!n.isValid()?!1:(t=z(t||"millisecond"),t==="millisecond"?+this===+n:(r=+n,+this.clone().startOf(t)<=r&&r<=+this.clone().endOf(t)))}function Er(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function Sr(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function xr(e,t,n){var r,i,s,o;return this.isValid()?(r=Xn(e,this),r.isValid()?(i=(r.utcOffset()-this.utcOffset())*6e4,t=z(t),t==="year"||t==="month"||t==="quarter"?(o=Tr(this,r),t==="quarter"?o/=3:t==="year"&&(o/=12)):(s=this-r,o=t==="second"?s/1e3:t==="minute"?s/6e4:t==="hour"?s/36e5:t==="day"?(s-i)/864e5:t==="week"?(s-i)/6048e5:s),n?o:b(o)):NaN):NaN}function Tr(e,t){var n=(t.year()-e.year())*12+(t.month()-e.month()),r=e.clone().add(n,"months"),i,s;return t-r<0?(i=e.clone().add(n-1,"months"),s=(t-r)/(r-i)):(i=e.clone().add(n+1,"months"),s=(t-r)/(i-r)),-(n+s)}function Nr(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Cr(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?C(Date.prototype.toISOString)?this.toDate().toISOString():rt(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):rt(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function kr(e){var n=rt(this,e||t.defaultFormat);return this.localeData().postformat(n)}function Lr(e,t){return this.isValid()&&(y(e)&&e.isValid()||Dn(e).isValid())?or({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Ar(e){return this.from(Dn(),e)}function Or(e,t){return this.isValid()&&(y(e)&&e.isValid()||Dn(e).isValid())?or({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Mr(e){return this.to(Dn(),e)}function _r(e){var t;return e===undefined?this._locale._abbr:(t=I(e),t!=null&&(this._locale=t),this)}function Pr(){return this._locale}function Hr(e){e=z(e);switch(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 e==="week"&&this.weekday(0),e==="isoWeek"&&this.isoWeekday(1),e==="quarter"&&this.month(Math.floor(this.month()/3)*3),this}function Br(e){return e=z(e),e===undefined||e==="millisecond"?this:this.startOf(e).add(1,e==="isoWeek"?"week":e).subtract(1,"ms")}function jr(){return+this._d-(this._offset||0)*6e4}function Fr(){return Math.floor(+this/1e3)}function Ir(){return this._offset?new Date(+this):this._d}function qr(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Rr(){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 Ur(){return this.isValid()?this.toISOString():null}function zr(){return c(this)}function Wr(){return u({},l(this))}function Xr(){return l(this).overflow}function Vr(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function $r(e,t){et(0,[e,e.length],0,t)}function Jr(e){return Yr.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Kr(e){return Yr.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Qr(){return wn(this.year(),1,4)}function Gr(){var e=this.localeData()._week;return wn(this.year(),e.dow,e.doy)}function Yr(e,t,n,r,i){var s;return e==null?bn(this,r,i).year:(s=wn(e,r,i),t>s&&(t=s),Zr.call(this,e,t,n,r,i))}function Zr(e,t,n,r,i){var s=yn(e,t,n,r,i),o=hn(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function ei(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}function ti(e){return bn(e,this._week.dow,this._week.doy).week}function ri(){return this._week.dow}function ii(){return this._week.doy}function si(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function oi(e){var t=bn(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}function ai(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function li(e,t){return r(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]}function hi(e){return this._weekdaysShort[e.day()]}function di(e){return this._weekdaysMin[e.day()]}function vi(e,t,n){var r,i,s;this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]);for(r=0;r<7;r++){i=Dn([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(s.replace(".",""),"i"));if(n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function mi(e){if(!this.isValid())return e!=null?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return e!=null?(e=ai(e,this.localeData()),this.add(e-t,"d")):t}function gi(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function yi(e){return this.isValid()?e==null?this.day()||7:this.day(this.day()%7?e:e-7):e!=null?this:NaN}function bi(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}function wi(){return this.hours()%12||12}function Ei(e,t){et(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Si(e,t){return t._meridiemParse}function xi(e){return(e+"").toLowerCase().charAt(0)==="p"}function Ni(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Oi(e,t){t[jt]=w(("0."+e)*1e3)}function _i(){return this._isUTC?"UTC":""}function Di(){return this._isUTC?"Coordinated Universal Time":""}function Bi(e){return Dn(e*1e3)}function ji(){return Dn.apply(null,arguments).parseZone()}function Ii(e,t,n){var r=this._calendar[e];return C(r)?r.call(t,n):r}function Ri(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function zi(){return this._invalidDate}function Vi(e){return this._ordinal.replace("%d",e)}function $i(e){return e}function Ki(e,t,n,r){var i=this._relativeTime[n];return C(i)?i(e,t,n,r):i.replace(/%d/i,e)}function Qi(e,t){var n=this._relativeTime[e>0?"future":"past"];return C(n)?n(t):n.replace(/%s/i,t)}function Yi(e,t,n,r){var i=I(),s=a().set(r,t);return i[n](s,e)}function Zi(e,t,n,r,i){typeof e=="number"&&(t=e,e=undefined),e=e||"";if(t!=null)return Yi(e,t,n,i);var s,o=[];for(s=0;s<r;s++)o[s]=Yi(e,s,n,i);return o}function es(e,t){return Zi(e,t,"months",12,"month")}function ts(e,t){return Zi(e,t,"monthsShort",12,"month")}function ns(e,t){return Zi(e,t,"weekdays",7,"day")}function rs(e,t){return Zi(e,t,"weekdaysShort",7,"day")}function is(e,t){return Zi(e,t,"weekdaysMin",7,"day")}function os(){var e=this._data;return this._milliseconds=ss(this._milliseconds),this._days=ss(this._days),this._months=ss(this._months),e.milliseconds=ss(e.milliseconds),e.seconds=ss(e.seconds),e.minutes=ss(e.minutes),e.hours=ss(e.hours),e.months=ss(e.months),e.years=ss(e.years),this}function us(e,t,n,r){var i=or(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function as(e,t){return us(this,e,t,1)}function fs(e,t){return us(this,e,t,-1)}function ls(e){return e<0?Math.floor(e):Math.ceil(e)}function cs(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,i,s,o,u,a;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=ls(ps(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,i=b(e/1e3),r.seconds=i%60,s=b(i/60),r.minutes=s%60,o=b(s/60),r.hours=o%24,t+=b(o/24),a=b(hs(t)),n+=a,t-=ls(ps(a)),u=b(n/12),n%=12,r.days=t,r.months=n,r.years=u,this}function hs(e){return e*4800/146097}function ps(e){return e*146097/4800}function ds(e){var t,n,r=this._milliseconds;e=z(e);if(e==="month"||e==="year")return t=this._days+r/864e5,n=this._months+hs(t),e==="month"?n:n/12;t=this._days+Math.round(ps(this._months));switch(e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function vs(){return this._milliseconds+this._days*864e5+this._months%12*2592e6+w(this._months/12)*31536e6}function ms(e){return function(){return this.as(e)}}function Ns(e){return e=z(e),this[e+"s"]()}function Cs(e){return function(){return this._data[e]}}function Ps(){return b(this.days()/7)}function js(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}function Fs(e,t,n){var r=or(e).abs(),i=Hs(r.as("s")),s=Hs(r.as("m")),o=Hs(r.as("h")),u=Hs(r.as("d")),a=Hs(r.as("M")),f=Hs(r.as("y")),l=i<Bs.s&&["s",i]||s<=1&&["m"]||s<Bs.m&&["mm",s]||o<=1&&["h"]||o<Bs.h&&["hh",o]||u<=1&&["d"]||u<Bs.d&&["dd",u]||a<=1&&["M"]||a<Bs.M&&["MM",a]||f<=1&&["y"]||["yy",f];return l[2]=t,l[3]=+e>0,l[4]=n,js.apply(null,l)}function Is(e,t){return Bs[e]===undefined?!1:t===undefined?Bs[e]:(Bs[e]=t,!0)}function qs(e){var t=this.localeData(),n=Fs(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Us(){var e=Rs(this._milliseconds)/1e3,t=Rs(this._days),n=Rs(this._months),r,i,s;r=b(e/60),i=b(r/60),e%=60,r%=60,s=b(n/12),n%=12;var o=s,u=n,a=t,f=i,l=r,c=e,h=this.asSeconds();return h?(h<0?"-":"")+"P"+(o?o+"Y":"")+(u?u+"M":"")+(a?a+"D":"")+(f||l||c?"T":"")+(f?f+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}function Vs(e,t,n,r){var i={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?i[n][0]:i[n][1]}function to(e,t,n,r){var i=e,s;switch(n){case"s":return r||t?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(r||t?" perc":" perce");case"mm":return i+(r||t?" perc":" perce");case"h":return"egy"+(r||t?" óra":" órája");case"hh":return i+(r||t?" óra":" órája");case"d":return"egy"+(r||t?" nap":" napja");case"dd":return i+(r||t?" nap":" napja");case"M":return"egy"+(r||t?" hónap":" hónapja");case"MM":return i+(r||t?" hónap":" hónapja");case"y":return"egy"+(r||t?" év":" éve");case"yy":return i+(r||t?" év":" éve")}return""}function no(e){return(e?"":"[múlt] ")+"["+eo[this.day()]+"] LT[-kor]"}function io(e){return e%100===11?!0:e%10===1?!1:!0}function so(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"nokkrar sekúndur":"nokkrum sekúndum";case"m":return t?"mínúta":"mínútu";case"mm":if(io(e))return i+(t||r?"mínútur":"mínútum");if(t)return i+"mínúta";return i+"mínútu";case"hh":if(io(e))return i+(t||r?"klukkustundir":"klukkustundum");return i+"klukkustund";case"d":if(t)return"dagur";return r?"dag":"degi";case"dd":if(io(e))return t?i+"dagar":i+(r?"daga":"dögum");if(t)return i+"dagur";return i+(r?"dag":"degi");case"M":if(t)return"mánuður";return r?"mánuð":"mánuði";case"MM":if(io(e))return t?i+"mánuðir":i+(r?"mánuði":"mánuðum");if(t)return i+"mánuður";return i+(r?"mánuð":"mánuði");case"y":return t||r?"ár":"ári";case"yy":if(io(e))return i+(t||r?"ár":"árum");return i+(t||r?"ár":"ári")}}function co(e,t,n){return n?t%10===1&&t!==11?e[2]:e[3]:t%10===1&&t!==11?e[0]:e[1]}function ho(e,t,n){return e+" "+co(lo[n],e,t)}function po(e,t,n){return co(lo[n],e,t)}function vo(e,t){return t?"dažas sekundes":"dažām sekundēm"}function So(e){return e%10<5&&e%10>1&&~~(e/10)%10!==1}function xo(e,t,n){var r=e+" ";switch(n){case"m":return t?"minuta":"minutę";case"mm":return r+(So(e)?"minuty":"minut");case"h":return t?"godzina":"godzinę";case"hh":return r+(So(e)?"godziny":"godzin");case"MM":return r+(So(e)?"miesiące":"miesięcy");case"yy":return r+(So(e)?"lata":"lat")}}function Co(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function ko(e,t,n){var r={mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return n==="m"?t?"минута":"минуту":e+" "+Co(r[n],+e)}function _o(e){return e>1&&e<5}function Do(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"pár sekúnd":"pár sekundami";case"m":return t?"minúta":r?"minútu":"minútou";case"mm":return t||r?i+(_o(e)?"minúty":"minút"):i+"minútami";case"h":return t?"hodina":r?"hodinu":"hodinou";case"hh":return t||r?i+(_o(e)?"hodiny":"hodín"):i+"hodinami";case"d":return t||r?"deň":"dňom";case"dd":return t||r?i+(_o(e)?"dni":"dní"):i+"dňami";case"M":return t||r?"mesiac":"mesiacom";case"MM":return t||r?i+(_o(e)?"mesiace":"mesiacov"):i+"mesiacmi";case"y":return t||r?"rok":"rokom";case"yy":return t||r?i+(_o(e)?"roky":"rokov"):i+"rokmi"}}function Ho(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"nekaj sekund":"nekaj sekundami";case"m":return t?"ena minuta":"eno minuto";case"mm":return e===1?i+=t?"minuta":"minuto":e===2?i+=t||r?"minuti":"minutama":e<5?i+=t||r?"minute":"minutami":i+=t||r?"minut":"minutami",i;case"h":return t?"ena ura":"eno uro";case"hh":return e===1?i+=t?"ura":"uro":e===2?i+=t||r?"uri":"urama":e<5?i+=t||r?"ure":"urami":i+=t||r?"ur":"urami",i;case"d":return t||r?"en dan":"enim dnem";case"dd":return e===1?i+=t||r?"dan":"dnem":e===2?i+=t||r?"dni":"dnevoma":i+=t||r?"dni":"dnevi",i;case"M":return t||r?"en mesec":"enim mesecem";case"MM":return e===1?i+=t||r?"mesec":"mesecem":e===2?i+=t||r?"meseca":"mesecema":e<5?i+=t||r?"mesece":"meseci":i+=t||r?"mesecev":"meseci",i;case"y":return t||r?"eno leto":"enim letom";case"yy":return e===1?i+=t||r?"leto":"letom":e===2?i+=t||r?"leti":"letoma":e<5?i+=t||r?"leta":"leti":i+=t||r?"let":"leti",i}}function Ro(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}function Uo(e,t,n){var r={mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"};return n==="m"?t?"хвилина":"хвилину":n==="h"?t?"година":"годину":e+" "+Ro(r[n],+e)}function zo(e,t){var n={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")},r=/(\[[ВвУу]\]) ?dddd/.test(t)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(t)?"genitive":"nominative";return n[r][e.day()]}function Wo(e){return function(){return e+"о"+(this.hours()===11?"б":"")+"] LT"}}var e,d=t.momentProperties=[],m=!1,T={};t.suppressDeprecationWarnings=!1;var M={},_,R={},Q=/(\[[^\[]*\])|(\\)?([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,G=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Y={},Z={},st=/\d/,ot=/\d\d/,ut=/\d{3}/,at=/\d{4}/,ft=/[+-]?\d{6}/,lt=/\d\d?/,ct=/\d\d\d\d?/,ht=/\d\d\d\d\d\d?/,pt=/\d{1,3}/,dt=/\d{1,4}/,vt=/[+-]?\d{1,6}/,mt=/\d+/,gt=/[+-]?\d+/,yt=/Z|[+-]\d\d:?\d\d/gi,bt=/Z|[+-]\d\d(?::?\d\d)?/gi,wt=/[+-]?\d+(\.\d{1,3})?/,Et=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,St={},kt={},Mt=0,_t=1,Dt=2,Pt=3,Ht=4,Bt=5,jt=6,Ft=7,It=8;et("M",["MM",2],"Mo",function(){return this.month()+1}),et("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),et("MMMM",0,0,function(e){return this.localeData().months(this,e)}),U("month","M"),xt("M",lt),xt("MM",lt,ot),xt("MMM",function(e,t){return t.monthsShortRegex(e)}),xt("MMMM",function(e,t){return t.monthsRegex(e)}),Lt(["M","MM"],function(e,t){t[_t]=w(e)-1}),Lt(["MMM","MMMM"],function(e,t,n,r){var i=n._locale.monthsParse(e,r,n._strict);i!=null?t[_t]=i:l(n).invalidMonth=e});var Rt=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Ut="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Wt="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Qt=Et,Yt=Et,nn=/^\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)?)?/,rn=/^\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)?)?/,sn=/Z|[+-]\d\d(?::?\d\d)?/,on=[["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}/]],un=[["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/]],an=/^\/?Date\((\-?\d+)/i;t.createFromInputFallback=x("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":""))}),et("Y",0,0,function(){var e=this.year();return e<=9999?""+e:"+"+e}),et(0,["YY",2],0,function(){return this.year()%100}),et(0,["YYYY",4],0,"year"),et(0,["YYYYY",5],0,"year"),et(0,["YYYYYY",6,!0],0,"year"),U("year","y"),xt("Y",gt),xt("YY",lt,ot),xt("YYYY",dt,at),xt("YYYYY",vt,ft),xt("YYYYYY",vt,ft),Lt(["YYYYY","YYYYYY"],Mt),Lt("YYYY",function(e,n){n[Mt]=e.length===2?t.parseTwoDigitYear(e):w(e)}),Lt("YY",function(e,n){n[Mt]=t.parseTwoDigitYear(e)}),Lt("Y",function(e,t){t[Mt]=parseInt(e,10)}),t.parseTwoDigitYear=function(e){return w(e)+(w(e)>68?1900:2e3)};var vn=X("FullYear",!1);t.ISO_8601=function(){};var Pn=x("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=Dn.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:h()}),Hn=x("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=Dn.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:h()}),In=function(){return Date.now?Date.now():+(new Date)};Un("Z",":"),Un("ZZ",""),xt("Z",bt),xt("ZZ",bt),Lt(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Wn(bt,e)});var zn=/([\+\-]|\d\d)/gi;t.updateOffset=function(){};var ir=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,sr=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;or.fn=qn.prototype;var pr=cr(1,"add"),dr=cr(-1,"subtract");t.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Dr=x("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===undefined?this.localeData():this.locale(e)});et(0,["gg",2],0,function(){return this.weekYear()%100}),et(0,["GG",2],0,function(){return this.isoWeekYear()%100}),$r("gggg","weekYear"),$r("ggggg","weekYear"),$r("GGGG","isoWeekYear"),$r("GGGGG","isoWeekYear"),U("weekYear","gg"),U("isoWeekYear","GG"),xt("G",gt),xt("g",gt),xt("GG",lt,ot),xt("gg",lt,ot),xt("GGGG",dt,at),xt("gggg",dt,at),xt("GGGGG",vt,ft),xt("ggggg",vt,ft),At(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=w(e)}),At(["gg","GG"],function(e,n,r,i){n[i]=t.parseTwoDigitYear(e)}),et("Q",0,"Qo","quarter"),U("quarter","Q"),xt("Q",st),Lt("Q",function(e,t){t[_t]=(w(e)-1)*3}),et("w",["ww",2],"wo","week"),et("W",["WW",2],"Wo","isoWeek"),U("week","w"),U("isoWeek","W"),xt("w",lt),xt("ww",lt,ot),xt("W",lt),xt("WW",lt,ot),At(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=w(e)});var ni={dow:0,doy:6};et("D",["DD",2],"Do","date"),U("date","D"),xt("D",lt),xt("DD",lt,ot),xt("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),Lt(["D","DD"],Dt),Lt("Do",function(e,t){t[Dt]=w(e.match(lt)[0],10)});var ui=X("Date",!0);et("d",0,"do","day"),et("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),et("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),et("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),et("e",0,0,"weekday"),et("E",0,0,"isoWeekday"),U("day","d"),U("weekday","e"),U("isoWeekday","E"),xt("d",lt),xt("e",lt),xt("E",lt),xt("dd",Et),xt("ddd",Et),xt("dddd",Et),At(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);i!=null?t.d=i:l(n).invalidWeekday=e}),At(["d","e","E"],function(e,t,n,r){t[r]=w(e)});var fi="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ci="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),pi="Su_Mo_Tu_We_Th_Fr_Sa".split("_");et("DDD",["DDDD",3],"DDDo","dayOfYear"),U("dayOfYear","DDD"),xt("DDD",pt),xt("DDDD",ut),Lt(["DDD","DDDD"],function(e,t,n){n._dayOfYear=w(e)}),et("H",["HH",2],0,"hour"),et("h",["hh",2],0,wi),et("hmm",0,0,function(){return""+wi.apply(this)+K(this.minutes(),2)}),et("hmmss",0,0,function(){return""+wi.apply(this)+K(this.minutes(),2)+K(this.seconds(),2)}),et("Hmm",0,0,function(){return""+this.hours()+K(this.minutes(),2)}),et("Hmmss",0,0,function(){return""+this.hours()+K(this.minutes(),2)+K(this.seconds(),2)}),Ei("a",!0),Ei("A",!1),U("hour","h"),xt("a",Si),xt("A",Si),xt("H",lt),xt("h",lt),xt("HH",lt,ot),xt("hh",lt,ot),xt("hmm",ct),xt("hmmss",ht),xt("Hmm",ct),xt("Hmmss",ht),Lt(["H","HH"],Pt),Lt(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),Lt(["h","hh"],function(e,t,n){t[Pt]=w(e),l(n).bigHour=!0}),Lt("hmm",function(e,t,n){var r=e.length-2;t[Pt]=w(e.substr(0,r)),t[Ht]=w(e.substr(r)),l(n).bigHour=!0}),Lt("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Pt]=w(e.substr(0,r)),t[Ht]=w(e.substr(r,2)),t[Bt]=w(e.substr(i)),l(n).bigHour=!0}),Lt("Hmm",function(e,t,n){var r=e.length-2;t[Pt]=w(e.substr(0,r)),t[Ht]=w(e.substr(r))}),Lt("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[Pt]=w(e.substr(0,r)),t[Ht]=w(e.substr(r,2)),t[Bt]=w(e.substr(i))});var Ti=/[ap]\.?m?\.?/i,Ci=X("Hours",!0);et("m",["mm",2],0,"minute"),U("minute","m"),xt("m",lt),xt("mm",lt,ot),Lt(["m","mm"],Ht);var ki=X("Minutes",!1);et("s",["ss",2],0,"second"),U("second","s"),xt("s",lt),xt("ss",lt,ot),Lt(["s","ss"],Bt);var Li=X("Seconds",!1);et("S",0,0,function(){return~~(this.millisecond()/100)}),et(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),et(0,["SSS",3],0,"millisecond"),et(0,["SSSS",4],0,function(){return this.millisecond()*10}),et(0,["SSSSS",5],0,function(){return this.millisecond()*100}),et(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),et(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),et(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),et(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),U("millisecond","ms"),xt("S",pt,st),xt("SS",pt,ot),xt("SSS",pt,ut);var Ai;for(Ai="SSSS";Ai.length<=9;Ai+="S")xt(Ai,mt);for(Ai="S";Ai.length<=9;Ai+="S")Lt(Ai,Oi);var Mi=X("Milliseconds",!1);et("z",0,0,"zoneAbbr"),et("zz",0,0,"zoneName");var Pi=g.prototype;Pi.add=pr,Pi.calendar=vr,Pi.clone=mr,Pi.diff=xr,Pi.endOf=Br,Pi.format=kr,Pi.from=Lr,Pi.fromNow=Ar,Pi.to=Or,Pi.toNow=Mr,Pi.get=J,Pi.invalidAt=Xr,Pi.isAfter=gr,Pi.isBefore=yr,Pi.isBetween=br,Pi.isSame=wr,Pi.isSameOrAfter=Er,Pi.isSameOrBefore=Sr,Pi.isValid=zr,Pi.lang=Dr,Pi.locale=_r,Pi.localeData=Pr,Pi.max=Hn,Pi.min=Pn,Pi.parsingFlags=Wr,Pi.set=J,Pi.startOf=Hr,Pi.subtract=dr,Pi.toArray=qr,Pi.toObject=Rr,Pi.toDate=Ir,Pi.toISOString=Cr,Pi.toJSON=Ur,Pi.toString=Nr,Pi.unix=Fr,Pi.valueOf=jr,Pi.creationData=Vr,Pi.year=vn,Pi.isLeapYear=mn,Pi.weekYear=Jr,Pi.isoWeekYear=Kr,Pi.quarter=Pi.quarters=ei,Pi.month=Jt,Pi.daysInMonth=Kt,Pi.week=Pi.weeks=si,Pi.isoWeek=Pi.isoWeeks=oi,Pi.weeksInYear=Gr,Pi.isoWeeksInYear=Qr,Pi.date=ui,Pi.day=Pi.days=mi,Pi.weekday=gi,Pi.isoWeekday=yi,Pi.dayOfYear=bi,Pi.hour=Pi.hours=Ci,Pi.minute=Pi.minutes=ki,Pi.second=Pi.seconds=Li,Pi.millisecond=Pi.milliseconds=Mi,Pi.utcOffset=$n,Pi.utc=Kn,Pi.local=Qn,Pi.parseZone=Gn,Pi.hasAlignedHourOffset=Yn,Pi.isDST=Zn,Pi.isDSTShifted=er,Pi.isLocal=tr,Pi.isUtcOffset=nr,Pi.isUtc=rr,Pi.isUTC=rr,Pi.zoneAbbr=_i,Pi.zoneName=Di,Pi.dates=x("dates accessor is deprecated. Use date instead.",ui),Pi.months=x("months accessor is deprecated. Use month instead",Jt),Pi.years=x("years accessor is deprecated. Use year instead",vn),Pi.zone=x("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Jn);var Hi=Pi,Fi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},qi={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"},Ui="Invalid date",Wi="%d",Xi=/\d{1,2}/,Ji={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"},Gi=O.prototype;Gi._calendar=Fi,Gi.calendar=Ii,Gi._longDateFormat=qi,Gi.longDateFormat=Ri,Gi._invalidDate=Ui,Gi.invalidDate=zi,Gi._ordinal=Wi,Gi.ordinal=Vi,Gi._ordinalParse=Xi,Gi.preparse=$i,Gi.postformat=$i,Gi._relativeTime=Ji,Gi.relativeTime=Ki,Gi.pastFuture=Qi,Gi.set=L,Gi.months=zt,Gi._months=Ut,Gi.monthsShort=Xt,Gi._monthsShort=Wt,Gi.monthsParse=Vt,Gi._monthsRegex=Yt,Gi.monthsRegex=Zt,Gi._monthsShortRegex=Qt,Gi.monthsShortRegex=Gt,Gi.week=ti,Gi._week=ni,Gi.firstDayOfYear=ii,Gi.firstDayOfWeek=ri,Gi.weekdays=li,Gi._weekdays=fi,Gi.weekdaysMin=di,Gi._weekdaysMin=pi,Gi.weekdaysShort=hi,Gi._weekdaysShort=ci,Gi.weekdaysParse=vi,Gi.isPM=xi,Gi._meridiemParse=Ti,Gi.meridiem=Ni,B("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=w(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}}),t.lang=x("moment.lang is deprecated. Use moment.locale instead.",B),t.langData=x("moment.langData is deprecated. Use moment.localeData instead.",I);var ss=Math.abs,gs=ms("ms"),ys=ms("s"),bs=ms("m"),ws=ms("h"),Es=ms("d"),Ss=ms("w"),xs=ms("M"),Ts=ms("y"),ks=Cs("milliseconds"),Ls=Cs("seconds"),As=Cs("minutes"),Os=Cs("hours"),Ms=Cs("days"),_s=Cs("months"),Ds=Cs("years"),Hs=Math.round,Bs={s:45,m:45,h:22,d:26,M:11},Rs=Math.abs,zs=qn.prototype;zs.abs=os,zs.add=as,zs.subtract=fs,zs.as=ds,zs.asMilliseconds=gs,zs.asSeconds=ys,zs.asMinutes=bs,zs.asHours=ws,zs.asDays=Es,zs.asWeeks=Ss,zs.asMonths=xs,zs.asYears=Ts,zs.valueOf=vs,zs._bubble=cs,zs.get=Ns,zs.milliseconds=ks,zs.seconds=Ls,zs.minutes=As,zs.hours=Os,zs.days=Ms,zs.weeks=Ps,zs.months=_s,zs.years=Ds,zs.humanize=qs,zs.toISOString=Us,zs.toString=Us,zs.toJSON=Us,zs.locale=_r,zs.localeData=Pr,zs.toIsoString=x("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Us),zs.lang=Dr,et("X",0,0,"unix"),et("x",0,0,"valueOf"),xt("x",gt),xt("X",wt),Lt("X",function(e,t,n){n._d=new Date(parseFloat(e,10)*1e3)}),Lt("x",function(e,t,n){n._d=new Date(w(e))}),t.version="2.12.0",n(Dn),t.fn=Hi,t.min=jn,t.max=Fn,t.now=In,t.utc=a,t.unix=Bi,t.months=es,t.isDate=i,t.locale=B,t.invalid=h,t.duration=or,t.isMoment=y,t.weekdays=ns,t.parseZone=ji,t.localeData=I,t.isDuration=Rn,t.monthsShort=ts,t.weekdaysMin=is,t.defineLocale=j,t.updateLocale=F,t.locales=q,t.weekdaysShort=rs,t.normalizeUnits=z,t.relativeTimeThreshold=Is,t.prototype=Hi;var Ws=t,Xs=Ws.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 "+(this.hours()!==1?"les":"la")+"] LT"},nextDay:function(){return"[demà a "+(this.hours()!==1?"les":"la")+"] LT"},nextWeek:function(){return"dddd [a "+(this.hours()!==1?"les":"la")+"] LT"},lastDay:function(){return"[ahir a "+(this.hours()!==1?"les":"la")+"] LT"},lastWeek:function(){return"[el] dddd [passat a "+(this.hours()!==1?"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 n=e===1?"r":e===2?"n":e===3?"r":e===4?"t":"è";if(t==="w"||t==="W")n="a";return e+n},week:{dow:1,doy:4}}),$s=Ws.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:Vs,mm:"%d Minuten",h:Vs,hh:"%d Stunden",d:Vs,dd:Vs,M:Vs,MM:Vs,y:Vs,yy:Vs},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Js=Ws.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,n=~~(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n},week:{dow:1,doy:4}}),Ks="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),Qs="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),Gs=Ws.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(e,t){return/-MMM-/.test(t)?Qs[e.month()]:Ks[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"+(this.hours()!==1?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(this.hours()!==1?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(this.hours()!==1?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(this.hours()!==1?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(this.hours()!==1?"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}}),Ys=Ws.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+(e===1?"er":"")},week:{dow:1,doy:4}}),Zs=Ws.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 e===2?"שעתיים":e+" שעות"},d:"יום",dd:function(e){return e===2?"יומיים":e+" ימים"},M:"חודש",MM:function(e){return e===2?"חודשיים":e+" חודשים"},y:"שנה",yy:function(e){return e===2?"שנתיים":e%10===0&&e!==10?e+" שנה":e+" שנים"}},meridiemParse:/אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,isPM:function(e){return/^(אחה"צ|אחרי הצהריים|בערב)$/.test(e)},meridiem:function(e,t,n){return e<5?"לפנות בוקר":e<10?"בבוקר":e<12?n?'לפנה"צ':"לפני הצהריים":e<18?n?'אחה"צ':"אחרי הצהריים":"בערב"}}),eo="vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton".split(" "),ro=Ws.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 e.charAt(1).toLowerCase()==="u"},meridiem:function(e,t,n){return e<12?n===!0?"de":"DE":n===!0?"du":"DU"},calendar:{sameDay:"[ma] LT[-kor]",nextDay:"[holnap] LT[-kor]",nextWeek:function(){return no.call(this,!0)},lastDay:"[tegnap] LT[-kor]",lastWeek:function(){return no.call(this,!1)},sameElse:"L"},relativeTime:{future:"%s múlva",past:"%s",s:to,m:to,mm:to,h:to,hh:to,d:to,dd:to,M:to,MM:to,y:to,yy:to},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),oo=Ws.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:so,m:so,mm:so,h:"klukkustund",hh:so,d:so,dd:so,M:so,MM:so,y:so,yy:so},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),uo=Ws.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}}),ao=Ws.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,n){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年"}}),fo=Ws.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,n){return e<12?"오전":"오후"}}),lo={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("_")},mo=Ws.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:vo,m:po,mm:ho,h:po,hh:ho,d:po,dd:ho,M:po,MM:ho,y:po,yy:ho},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),go="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),yo="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),bo=Ws.defineLocale("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,t){return/-MMM-/.test(t)?yo[e.month()]:go[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+(e===1||e===8||e>=20?"ste":"de")},week:{dow:1,doy:4}}),wo="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),Eo="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),To=Ws.defineLocale("pl",{months:function(e,t){return t===""?"("+Eo[e.month()]+"|"+wo[e.month()]+")":/D MMMM/.test(t)?Eo[e.month()]:wo[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:xo,mm:xo,h:xo,hh:xo,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:xo,y:"rok",yy:xo},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),No=Ws.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 this.day()===0||this.day()===6?"[Ú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º"}),Lo=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[й|я]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i],Ao=Ws.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв_фев_мар_апр_мая_июня_июля_авг_сен_окт_ноя_дек".split("_"),standalone:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:Lo,longMonthsParse:Lo,shortMonthsParse:Lo,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 this.day()===2?"[Во] 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 this.day()===2?"[Во] 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:ko,mm:ko,h:"час",hh:ko,d:"день",dd:ko,M:"месяц",MM:ko,y:"год",yy:ko},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(e){return/^(дня|вечера)$/.test(e)},meridiem:function(e,t,n){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}}),Oo="január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),Mo="jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),Po=Ws.defineLocale("sk",{months:Oo,monthsShort:Mo,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:Do,m:Do,mm:Do,h:Do,hh:Do,d:Do,dd:Do,M:Do,MM:Do,y:Do,yy:Do},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}}),Bo=Ws.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:Ho,m:Ho,mm:Ho,h:Ho,hh:Ho,d:Ho,dd:Ho,M:Ho,MM:Ho,y:Ho,yy:Ho},ordinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:7}}),jo=Ws.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,n=~~(e%100/10)===1?"e":t===1?"a":t===2?"a":t===3?"e":"e";return e+n},week:{dow:1,doy:4}}),Fo=Ws.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,n){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 ปี"}}),Io={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ı"},qo=Ws.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(e===0)return e+"'ıncı";var t=e%10,n=e%100-t,r=e>=100?100:null;return e+(Io[t]||Io[n]||Io[r])},week:{dow:1,doy:7}}),Xo=Ws.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:zo,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:Wo("[Сьогодні "),nextDay:Wo("[Завтра "),lastDay:Wo("[Вчора "),nextWeek:Wo("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return Wo("[Минулої] dddd [").call(this);case 1:case 2:case 4:return Wo("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:Uo,mm:Uo,h:"годину",hh:Uo,d:"день",dd:Uo,M:"місяць",MM:Uo,y:"рік",yy:Uo},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(e){return/^(дня|вечора)$/.test(e)},meridiem:function(e,t,n){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}}),Vo=Ws.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 e===12&&(e=0),t==="凌晨"||t==="早上"||t==="上午"?e:t==="下午"||t==="晚上"?e+12:e>=11?e:e+12},meridiem:function(e,t,n){var r=e*100+t;return r<600?"凌晨":r<900?"早上":r<1130?"上午":r<1230?"中午":r<1800?"下午":"晚上"},calendar:{sameDay:function(){return this.minutes()===0?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return this.minutes()===0?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return this.minutes()===0?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var e,t;return e=Ws().startOf("week"),t=this.unix()-e.unix()>=604800?"[下]":"[本]",this.minutes()===0?t+"dddAh点整":t+"dddAh点mm"},lastWeek:function(){var e,t;return e=Ws().startOf("week"),t=this.unix()<e.unix()?"[上]":"[本]",this.minutes()===0?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}}),$o=Ws.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){e===12&&(e=0);if(t==="早上"||t==="上午")return e;if(t==="中午")return e>=11?e:e+12;if(t==="下午"||t==="晚上")return e+12},meridiem:function(e,t,n){var r=e*100+t;return r<900?"早上":r<1130?"上午":r<1230?"中午":r<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年"}}),Jo=Ws;return Jo.locale("en"),Jo}),function(e){if(typeof define=="function"&&define.amd)define("js.cookie",e);else if(typeof exports=="object")module.exports=e();else{var t=window.Cookies,n=window.Cookies=e();n.noConflict=function(){return window.Cookies=t,n}}}(function(){function e(){var e=0,t={};for(;e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(n){function r(t,i,s){var o;if(arguments.length>1){s=e({path:"/"},r.defaults,s);if(typeof s.expires=="number"){var u=new Date;u.setMilliseconds(u.getMilliseconds()+s.expires*864e5),s.expires=u}try{o=JSON.stringify(i),/^[\{\[]/.test(o)&&(i=o)}catch(a){}return n.write?i=n.write(i,t):i=encodeURIComponent(String(i)).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,"=",i,s.expires&&"; expires="+s.expires.toUTCString(),s.path&&"; path="+s.path,s.domain&&"; domain="+s.domain,s.secure?"; secure":""].join("")}t||(o={});var f=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,c=0;for(;c<f.length;c++){var h=f[c].split("="),p=h[0].replace(l,decodeURIComponent),d=h.slice(1).join("=");d.charAt(0)==='"'&&(d=d.slice(1,-1));try{d=n.read?n.read(d,p):n(d,p)||d.replace(l,decodeURIComponent);if(this.json)try{d=JSON.parse(d)}catch(a){}if(t===p){o=d;break}t||(o[p]=d)}catch(a){}}return o}return r.get=r.set=r,r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}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.1.4","jquery.fileupload":"lib/jquery.fileupload.5.42.1","jquery.fileupload-process":"lib/jquery.fileupload.file-processing.1.3.0","jquery.fileupload-validate":"lib/jquery.fileupload.validation.1.1.2","jquery.fileupload-ui":"lib/jquery.fileupload.ui.9.6.0","jquery.magnific-popup":"lib/jquery.magnific-popup","js.cookie":"lib/js.cookie",simplemodal:"lib/jquery.simplemodal",jstree:"lib/jstree.1.0",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,n,r,i,s){return{INFO_TIMEOUT:1e4,SUCCESS_TIMEOUT:3e3,ERROR_TIMEOUT:3e3,strChineseFirstPY:r.strChineseFirstPY,getUrl:function(e){var t=app.config.siteRoot,n=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 n+"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"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"mv_dir":return t+"ajax/repo/"+e.repo_id+"/dir/mv/";case"cp_dir":return t+"ajax/repo/"+e.repo_id+"/dir/cp/";case"mv_file":return t+"ajax/repo/"+e.repo_id+"/file/mv/";case"cp_file":return t+"ajax/repo/"+e.repo_id+"/file/cp/";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_cp_progress":return t+"ajax/cp_progress/";case"cancel_cp":return t+"ajax/cancel_cp/";case"get_file_op_url":return t+"ajax/repo/"+e.repo_id+"/file_op_url/";case"get_file_uploaded_bytes":return t+"ajax/repo/"+e.repo_id+"/get-file-uploaded-bytes/";case"get_dirents":return t+"ajax/repo/"+e.repo_id+"/dirents/";case"repos":return t+"api2/repos/";case"pub_repos":return t+"api2/repos/public/";case"get_my_unenc_repos":return t+"ajax/my-unenc-repos/";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_folder_perm_by_path":return t+"ajax/repo/"+e.repo_id+"/get-folder-perm-by-path/";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_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_change_password":return t+"ajax/repo/"+e.repo_id+"/setting/change-passwd/";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"set_user_folder_perm":return t+"ajax/repo/"+e.repo_id+"/set-user-folder-perm/";case"set_group_folder_perm":return t+"ajax/repo/"+e.repo_id+"/set-group-folder-perm/";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"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"toggle_group_modules":return t+"ajax/group/"+e.group_id+"/toggle-modules/";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"get_user_contacts":return t+"ajax/contacts/";case"get_popup_notices":return t+"ajax/get_popup_notices/";case"set_notices_seen":return t+"ajax/set_notices_seen/";case"get_unseen_notices_num":return t+"ajax/unseen-notices-count/";case"set_notice_seen_by_id":return t+"ajax/set_notice_seen_by_id/";case"toggle_personal_modules":return t+"ajax/toggle-personal-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"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-libraries":return t+"api/v2.1/admin/libraries/";case"admin-library":return t+"api/v2.1/admin/libraries/"+e.repo_id+"/";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-system-library":return t+"api/v2.1/admin/system-library/";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/"}},FILEEXT_ICON_MAP:{md:"txt.png",txt:"txt.png",pdf:"pdf.png",doc:"word.png",docx:"word.png",ppt:"ppt.png",pptx:"ppt.png",xls:"excel.png",xlsx:"excel.png",txt:"txt.png",odt:"word.png",fodt:"word.png",ods:"excel.png",fods:"excel.png",odp:"ppt.png",fodp:"ppt.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,n){n>24?n=192:n=24;var r;return e.lastIndexOf(".")==-1?app.config.mediaUrl+"img/file/"+n+"/"+this.FILEEXT_ICON_MAP["default"]:(r=e.substr(e.lastIndexOf(".")+1).toLowerCase(),t.has(this.FILEEXT_ICON_MAP,r)?app.config.mediaUrl+"img/file/"+n+"/"+this.FILEEXT_ICON_MAP[r]:app.config.mediaUrl+"img/file/"+n+"/"+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,n){return n>24?e?app.config.mediaUrl+"img/lib/96/lib-encrypted.png":t?app.config.mediaUrl+"img/lib/96/lib-readonly.png":app.config.mediaUrl+"img/lib/96/lib.png":e?app.config.mediaUrl+"img/lib/24/lib-encrypted.png":t?app.config.mediaUrl+"img/lib/24/lib-readonly.png":app.config.mediaUrl+"img/lib/24/lib.png"},isHiDPI:function(){var e=window.devicePixelRatio?window.devicePixelRatio:1;return e>1?!0:!1},showConfirm:function(t,n,r){var i=e("#confirm-popup"),s=e("#confirm-con"),o=e("#confirm-yes");s.html("<h3>"+t+"</h3><p>"+n+"</p>"),i.modal({appendTo:"#main"}),e("#simplemodal-container").css({height:"auto"}),o.click(r)},confirm_with_extra_option_template:t.template(e("#confirm-dialog-with-extra-option-tmpl").html()),showConfirmWithExtraOption:function(t,n,r,i){var s=e("#confirm-popup"),o=e("#confirm-con"),u=e("#confirm-yes"),a=this.confirm_with_extra_option_template({is_pro:app.pageOptions.is_pro,title:t,content:n,extraOption:r});o.html(a),s.modal({appendTo:"#main"}),e("#simplemodal-container").css({height:"auto"}),u.click(function(){var t=e("#confirm-extra-option:checked").val()==="on";i(t)})},closeModal:function(){e.modal.close()},feedback:function(t,n,r){var r=r||5e3;if(e(".messages").length>0)e(".messages").html('<li class="'+n+'">'+this.HTMLescape(t)+"</li>");else{var i='<ul class="messages"><li class="'+n+'">'+this.HTMLescape(t)+"</li></ul>";e("#main").append(i)}e(".messages").css({left:(e(window).width()-e(".messages").width())/2,top:10}).removeClass("hide"),setTimeout(function(){e(".messages").addClass("hide")},r)},showFormError:function(t,n){e("#"+t+" .error").html(n).removeClass("hide"),e("#simplemodal-container").css({height:"auto"})},ajaxErrorHandler:function(t,n,r){if(t.responseText){var i=e.parseJSON(t.responseText);this.feedback(i.error||i.error_msg||i.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 n;return document.selection?(n=e.createTextRange(),n.move("character",t),n.select()):e.setSelectionRange(t,t)},prepareApiCsrf:function(){Backbone._sync=Backbone.sync,Backbone.sync=function(e,t,n){if(e=="create"||e=="update"||e=="delete"){var r=app.pageOptions.csrfToken;n.beforeSend=function(e){e.setRequestHeader("X-CSRFToken",r)}}return Backbone._sync(e,t,n)}},prepareCSRFToken:function(e,t){function n(e){var t=null;if(document.cookie&&document.cookie!=""){var n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=jQuery.trim(n[r]);if(i.substring(0,e.length+1)==e+"="){t=decodeURIComponent(i.substring(e.length+1));break}}}return t}!/^http:.*/.test(t.url)&&!/^https:.*/.test(t.url)&&e.setRequestHeader("X-CSRFToken",n("csrftoken"))},ajaxPost:function(t){var n=this,r=t.form,i=t.form_id,s=t.post_url,o=t.post_data,u=t.after_op_success,a,f=r.children('[type="submit"]');this.disableButton(f),t.after_op_error?a=t.after_op_error:a=function(t,r,s){var o;t.responseText?o=e.parseJSON(t.responseText).error||e.parseJSON(t.responseText).error_msg:o=gettext("Failed. Please check the network."),n.showFormError(i,o),n.enableButton(f)},e.ajax({url:s,type:"POST",dataType:"json",beforeSend:this.prepareCSRFToken,data:o,success:u,error:a})},ajaxGet:function(t){var n=this,r=t.get_url,i=t.data,s=t.after_op_success,o;t.after_op_error?o=t.after_op_error:o=function(e,t,n){},e.ajax({url:r,cache:!1,dataType:"json",data:i,success:s,error:o})},HTMLescape:function(e){return document.createElement("div").appendChild(document.createTextNode(e)).parentNode.innerHTML},pathJoin:function(e){var t=e[0];for(var n=1;n<e.length;n++)t[t.length-1]=="/"||e[n][0]=="/"?t+=e[n]:t+="/"+e[n];return t},encodePath:function(e){var t=e.split("/"),n=[];for(var r=0,i=t.length;r<i;r++)n.push(encodeURIComponent(t[r]));return n.join("/")},initLocale:function(){var e;app.pageOptions.language_code=="en"?e="en-gb":app.pageOptions.language_code=="es-ar"||app.pageOptions.language_code=="es-mx"?e="es":e=app.pageOptions.language_code,i.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;e("#info-bar").addClass("hide");if(navigator.cookieEnabled){var n=new Date,r=document.cookie.split("; "),i=!1;n.setTime(n.getTime()+12096e5),t+="; expires="+n.toGMTString()+"; path="+app.config.siteRoot;for(var s=0,o=r.length;s<o;s++)if(r[s].split("=")[0]=="info_id"){i=!0,document.cookie="info_id="+r[s].split("=")[1]+t;break}i||(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){var t=[],n=e.users;for(var r=0,i=n.length;r<i;r++)t.push({id:n[r].email,text:n[r].name+" "+n[r].contact_email,avatar_url:n[r].avatar_url,contact_email:n[r].contact_email,name:n[r].name});return{results:t}}},formatResult:function(e){if(e.avatar_url)return'<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>";return},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){var t=[],n=e;for(var r=0,i=n.length;r<i;r++)t.push({id:n[r].id,text:n[r].name,name:n[r].name});return{results:t}}},formatResult:function(t){if(t.name)return'<span class="text ellipsis">'+e.HTMLescape(t.name)+"</span>";return},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(),n=["gif","jpeg","jpg","png","ico","bmp"];return n.indexOf(t)!=-1?!0:!1},compareTwoWord:function(e,t){var n,r,i=e.charCodeAt(0),s=t.charCodeAt(0),o=this.strChineseFirstPY;return 19968<i&&i<40869&&19968<s&&s<40869?(n=o.charAt(i-19968).toLowerCase(),r=o.charAt(s-19968).toLowerCase(),n>=r?1:-1):19968<i&&i<40869&&!(19968<s&&s<40869)?1:!(19968<i&&i<40869)&&19968<s&&s<40869?-1:(n=e.toLowerCase(),r=t.toLowerCase(),this.compareStrWithNumbersIn(n,r))},compareStrWithNumbersIn:function(e,t){var n=/\d+|\D+/g,r=/\d/,i=e.match(n),s=t.match(n),o,u=Math.min(i.length,s.length),a,f;if(i&&s&&(o=r.test(i[0]))==r.test(s[0]))for(var l=0;l<u;l++){a=i[l],f=s[l],o&&(a=parseInt(a,10),f=parseInt(f,10));if(a!=f)return a<f?-1:1;o=!o}return(e>=t)-(e<=t)},toggleSortByNameMode:function(){app.pageOptions.sort_mode=="name_up"?(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(){app.pageOptions.sort_mode=="time_down"?(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 n=app.pageOptions.sort_mode,r=t.context,i=e(".by-name .sort-icon",r),s=e(".by-time .sort-icon",r);i.hide(),s.hide();switch(n){case"name_down":i.removeClass("icon-caret-up").addClass("icon-caret-down").show();break;case"name_up":i.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:i.removeClass("icon-caret-down").addClass("icon-caret-up").show()}},sortLibs:function(e){var t=this,n=app.pageOptions.sort_mode,r=e.libs;switch(n){case"name_up":r.comparator=function(e,n){if(!e.get("name"))return 1;if(!n.get("name"))return-1;var r=t.compareTwoWord(e.get("name"),n.get("name"));return r};break;case"name_down":r.comparator=function(e,n){if(!e.get("name"))return-1;if(!n.get("name"))return 1;var r=t.compareTwoWord(e.get("name"),n.get("name"));return-r};break;case"time_up":r.comparator=function(e,t){return e.get("mtime")<t.get("mtime")?-1:1};break;case"time_down":r.comparator=function(e,t){return e.get("mtime")<t.get("mtime")?1:-1}}r.sort()},fileSizeFormat:function(e,t){var n=1024,r=n*1024,i=r*1024,s=i*1024,t=t||0;return e>=0&&e<n?e+" B":e>=n&&e<r?(e/n).toFixed(t)+" KB":e>=r&&e<i?(e/r).toFixed(t)+" MB":e>=i&&e<s?(e/i).toFixed(t)+" GB":e>=s?(e/s).toFixed(t)+" TB":e+" B"},groupId2Name:function(e){var t,n=app.pageOptions.groups;for(var r=0,i=n.length;r<i;r++)if(e==n[r].id){t=n[r].name;break}return t},setCaretPosition:function(e,t){var n;return document.selection?(n=e.createTextRange(),n.move("character",t),n.select()):e.setSelectionRange(t,t)}}}),function(e,t){if(typeof define=="function"&&define.amd)define("backbone",["underscore","jquery","exports"],function(n,r,i){e.Backbone=t(e,i,n,r)});else if(typeof exports!="undefined"){var n=require("underscore");t(e,exports,n)}else e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t,n,r){var i=e.Backbone,s=[],o=s.push,u=s.slice,a=s.splice;t.VERSION="1.1.2",t.$=r,t.noConflict=function(){return e.Backbone=i,this},t.emulateHTTP=!1,t.emulateJSON=!1;var f=t.Events={on:function(e,t,n){if(!c(this,"on",e,[t,n])||!t)return this;this._events||(this._events={});var r=this._events[e]||(this._events[e]=[]);return r.push({callback:t,context:n,ctx:n||this}),this},once:function(e,t,r){if(!c(this,"once",e,[t,r])||!t)return this;var i=this,s=n.once(function(){i.off(e,s),t.apply(this,arguments)});return s._callback=t,this.on(e,s,r)},off:function(e,t,r){var i,s,o,u,a,f,l,h;if(!this._events||!c(this,"off",e,[t,r]))return this;if(!e&&!t&&!r)return this._events=void 0,this;u=e?[e]:n.keys(this._events);for(a=0,f=u.length;a<f;a++){e=u[a];if(o=this._events[e]){this._events[e]=i=[];if(t||r)for(l=0,h=o.length;l<h;l++)s=o[l],(t&&t!==s.callback&&t!==s.callback._callback||r&&r!==s.context)&&i.push(s);i.length||delete this._events[e]}}return this},trigger:function(e){if(!this._events)return this;var t=u.call(arguments,1);if(!c(this,"trigger",e,t))return this;var n=this._events[e],r=this._events.all;return n&&h(n,t),r&&h(r,arguments),this},stopListening:function(e,t,r){var i=this._listeningTo;if(!i)return this;var s=!t&&!r;!r&&typeof t=="object"&&(r=this),e&&((i={})[e._listenId]=e);for(var o in i)e=i[o],e.off(t,r,this),(s||n.isEmpty(e._events))&&delete this._listeningTo[o];return this}},l=/\s+/,c=function(e,t,n,r){if(!n)return!0;if(typeof n=="object"){for(var i in n)e[t].apply(e,[i,n[i]].concat(r));return!1}if(l.test(n)){var s=n.split(l);for(var o=0,u=s.length;o<u;o++)e[t].apply(e,[s[o]].concat(r));return!1}return!0},h=function(e,t){var n,r=-1,i=e.length,s=t[0],o=t[1],u=t[2];switch(t.length){case 0:while(++r<i)(n=e[r]).callback.call(n.ctx);return;case 1:while(++r<i)(n=e[r]).callback.call(n.ctx,s);return;case 2:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o);return;case 3:while(++r<i)(n=e[r]).callback.call(n.ctx,s,o,u);return;default:while(++r<i)(n=e[r]).callback.apply(n.ctx,t);return}},p={listenTo:"on",listenToOnce:"once"};n.each(p,function(e,t){f[t]=function(t,r,i){var s=this._listeningTo||(this._listeningTo={}),o=t._listenId||(t._listenId=n.uniqueId("l"));return s[o]=t,!i&&typeof r=="object"&&(i=this),t[e](r,i,this),this}}),f.bind=f.on,f.unbind=f.off,n.extend(t,f);var d=t.Model=function(e,t){var r=e||{};t||(t={}),this.cid=n.uniqueId("c"),this.attributes={},t.collection&&(this.collection=t.collection),t.parse&&(r=this.parse(r,t)||{}),r=n.defaults({},r,n.result(this,"defaults")),this.set(r,t),this.changed={},this.initialize.apply(this,arguments)};n.extend(d.prototype,f,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},sync:function(){return t.sync.apply(this,arguments)},get:function(e){return this.attributes[e]},escape:function(e){return n.escape(this.get(e))},has:function(e){return this.get(e)!=null},set:function(e,t,r){var i,s,o,u,a,f,l,c;if(e==null)return this;typeof e=="object"?(s=e,r=t):(s={})[e]=t,r||(r={});if(!this._validate(s,r))return!1;o=r.unset,a=r.silent,u=[],f=this._changing,this._changing=!0,f||(this._previousAttributes=n.clone(this.attributes),this.changed={}),c=this.attributes,l=this._previousAttributes,this.idAttribute in s&&(this.id=s[this.idAttribute]);for(i in s)t=s[i],n.isEqual(c[i],t)||u.push(i),n.isEqual(l[i],t)?delete this.changed[i]:this.changed[i]=t,o?delete c[i]:c[i]=t;if(!a){u.length&&(this._pending=r);for(var h=0,p=u.length;h<p;h++)this.trigger("change:"+u[h],this,c[u[h]],r)}if(f)return this;if(!a)while(this._pending)r=this._pending,this._pending=!1,this.trigger("change",this,r);return this._pending=!1,this._changing=!1,this},unset:function(e,t){return this.set(e,void 0,n.extend({},t,{unset:!0}))},clear:function(e){var t={};for(var r in this.attributes)t[r]=void 0;return this.set(t,n.extend({},e,{unset:!0}))},hasChanged:function(e){return e==null?!n.isEmpty(this.changed):n.has(this.changed,e)},changedAttributes:function(e){if(!e)return this.hasChanged()?n.clone(this.changed):!1;var t,r=!1,i=this._changing?this._previousAttributes:this.attributes;for(var s in e){if(n.isEqual(i[s],t=e[s]))continue;(r||(r={}))[s]=t}return r},previous:function(e){return e==null||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return n.clone(this._previousAttributes)},fetch:function(e){e=e?n.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=this,r=e.success;return e.success=function(n){if(!t.set(t.parse(n,e),e))return!1;r&&r(t,n,e),t.trigger("sync",t,n,e)},I(this,e),this.sync("read",this,e)},save:function(e,t,r){var i,s,o,u=this.attributes;e==null||typeof e=="object"?(i=e,r=t):(i={})[e]=t,r=n.extend({validate:!0},r);if(i&&!r.wait){if(!this.set(i,r))return!1}else if(!this._validate(i,r))return!1;i&&r.wait&&(this.attributes=n.extend({},u,i)),r.parse===void 0&&(r.parse=!0);var a=this,f=r.success;return r.success=function(e){a.attributes=u;var t=a.parse(e,r);r.wait&&(t=n.extend(i||{},t));if(n.isObject(t)&&!a.set(t,r))return!1;f&&f(a,e,r),a.trigger("sync",a,e,r)},I(this,r),s=this.isNew()?"create":r.patch?"patch":"update",s==="patch"&&(r.attrs=i),o=this.sync(s,this,r),i&&r.wait&&(this.attributes=u),o},destroy:function(e){e=e?n.clone(e):{};var t=this,r=e.success,i=function(){t.trigger("destroy",t,t.collection,e)};e.success=function(n){(e.wait||t.isNew())&&i(),r&&r(t,n,e),t.isNew()||t.trigger("sync",t,n,e)};if(this.isNew())return e.success(),!1;I(this,e);var s=this.sync("delete",this,e);return e.wait||i(),s},url:function(){var e=n.result(this,"urlRoot")||n.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({},n.extend(e||{},{validate:!0}))},_validate:function(e,t){if(!t.validate||!this.validate)return!0;e=n.extend({},this.attributes,e);var r=this.validationError=this.validate(e,t)||null;return r?(this.trigger("invalid",this,r,n.extend(t,{validationError:r})),!1):!0}});var v=["keys","values","pairs","invert","pick","omit"];n.each(v,function(e){d.prototype[e]=function(){var t=u.call(arguments);return t.unshift(this.attributes),n[e].apply(n,t)}});var m=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),t.comparator!==void 0&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,n.extend({silent:!0},t))},g={add:!0,remove:!0,merge:!0},y={add:!0,remove:!1};n.extend(m.prototype,f,{model:d,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,n.extend({merge:!1},t,y))},remove:function(e,t){var r=!n.isArray(e);e=r?[e]:n.clone(e),t||(t={});var i,s,o,u;for(i=0,s=e.length;i<s;i++){u=e[i]=this.get(e[i]);if(!u)continue;delete this._byId[u.id],delete this._byId[u.cid],o=this.indexOf(u),this.models.splice(o,1),this.length--,t.silent||(t.index=o,u.trigger("remove",u,this,t)),this._removeReference(u,t)}return r?e[0]:e},set:function(e,t){t=n.defaults({},t,g),t.parse&&(e=this.parse(e,t));var r=!n.isArray(e);e=r?e?[e]:[]:n.clone(e);var i,s,o,u,a,f,l,c=t.at,h=this.model,p=this.comparator&&c==null&&t.sort!==!1,v=n.isString(this.comparator)?this.comparator:null,m=[],y=[],b={},w=t.add,E=t.merge,S=t.remove,x=!p&&w&&S?[]:!1;for(i=0,s=e.length;i<s;i++){a=e[i]||{},a instanceof d?o=u=a:o=a[h.prototype.idAttribute||"id"];if(f=this.get(o))S&&(b[f.cid]=!0),E&&(a=a===u?u.attributes:a,t.parse&&(a=f.parse(a,t)),f.set(a,t),p&&!l&&f.hasChanged(v)&&(l=!0)),e[i]=f;else if(w){u=e[i]=this._prepareModel(a,t);if(!u)continue;m.push(u),this._addReference(u,t)}u=f||u,x&&(u.isNew()||!b[u.id])&&x.push(u),b[u.id]=!0}if(S){for(i=0,s=this.length;i<s;++i)b[(u=this.models[i]).cid]||y.push(u);y.length&&this.remove(y,t)}if(m.length||x&&x.length){p&&(l=!0),this.length+=m.length;if(c!=null)for(i=0,s=m.length;i<s;i++)this.models.splice(c+i,0,m[i]);else{x&&(this.models.length=0);var T=x||m;for(i=0,s=T.length;i<s;i++)this.models.push(T[i])}}l&&this.sort({silent:!0});if(!t.silent){for(i=0,s=m.length;i<s;i++)(u=m[i]).trigger("add",u,this,t);(l||x&&x.length)&&this.trigger("sort",this,t)}return r?e[0]:e},reset:function(e,t){t||(t={});for(var r=0,i=this.models.length;r<i;r++)this._removeReference(this.models[r],t);return t.previousModels=this.models,this._reset(),e=this.add(e,n.extend({silent:!0},t)),t.silent||this.trigger("reset",this,t),e},push:function(e,t){return this.add(e,n.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,n.extend({at:0},t))},shift:function(e){var t=this.at(0);return this.remove(t,e),t},slice:function(){return u.apply(this.models,arguments)},get:function(e){return e==null?void 0:this._byId[e]||this._byId[e.id]||this._byId[e.cid]},at:function(e){return this.models[e]},where:function(e,t){return n.isEmpty(e)?t?void 0:[]:this[t?"find":"filter"](function(t){for(var n in e)if(e[n]!==t.get(n))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={}),n.isString(this.comparator)||this.comparator.length===1?this.models=this.sortBy(this.comparator,this):this.models.sort(n.bind(this.comparator,this)),e.silent||this.trigger("sort",this,e),this},pluck:function(e){return n.invoke(this.models,"get",e)},fetch:function(e){e=e?n.clone(e):{},e.parse===void 0&&(e.parse=!0);var t=e.success,r=this;return e.success=function(n){var i=e.reset?"reset":"set";r[i](n,e),t&&t(r,n,e),r.trigger("sync",r,n,e)},I(this,e),this.sync("read",this,e)},create:function(e,t){t=t?n.clone(t):{};if(!(e=this._prepareModel(e,t)))return!1;t.wait||this.add(e,t);var r=this,i=t.success;return t.success=function(e,n){t.wait&&r.add(e,t),i&&i(e,n,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 d)return e;t=t?n.clone(t):{},t.collection=this;var r=new this.model(e,t);return r.validationError?(this.trigger("invalid",this,r.validationError,t),!1):r},_addReference:function(e,t){this._byId[e.cid]=e,e.id!=null&&(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,n,r){if((e==="add"||e==="remove")&&n!==this)return;e==="destroy"&&this.remove(t,r),t&&e==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],t.id!=null&&(this._byId[t.id]=t)),this.trigger.apply(this,arguments)}});var b=["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"];n.each(b,function(e){m.prototype[e]=function(){var t=u.call(arguments);return t.unshift(this.models),n[e].apply(n,t)}});var w=["groupBy","countBy","sortBy","indexBy"];n.each(w,function(e){m.prototype[e]=function(t,r){var i=n.isFunction(t)?t:function(e){return e.get(t)};return n[e](this.models,i,r)}});var E=t.View=function(e){this.cid=n.uniqueId("view"),e||(e={}),n.extend(this,n.pick(e,x)),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},S=/^(\S+)\s*(.*)$/,x=["model","collection","el","id","attributes","className","tagName","events"];n.extend(E.prototype,f,{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,n){return this.$el&&this.undelegateEvents(),this.$el=e instanceof t.$?e:t.$(e),this.el=this.$el[0],n!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=n.result(this,"events")))return this;this.undelegateEvents();for(var t in e){var r=e[t];n.isFunction(r)||(r=this[e[t]]);if(!r)continue;var i=t.match(S),s=i[1],o=i[2];r=n.bind(r,this),s+=".delegateEvents"+this.cid,o===""?this.$el.on(s,r):this.$el.on(s,o,r)}return this},undelegateEvents:function(){return this.$el.off(".delegateEvents"+this.cid),this},_ensureElement:function(){if(!this.el){var e=n.extend({},n.result(this,"attributes"));this.id&&(e.id=n.result(this,"id")),this.className&&(e["class"]=n.result(this,"className"));var r=t.$("<"+n.result(this,"tagName")+">").attr(e);this.setElement(r,!1)}else this.setElement(n.result(this,"el"),!1)}}),t.sync=function(e,r,i){var s=N[e];n.defaults(i||(i={}),{emulateHTTP:t.emulateHTTP,emulateJSON:t.emulateJSON});var o={type:s,dataType:"json"};i.url||(o.url=n.result(r,"url")||F()),i.data==null&&r&&(e==="create"||e==="update"||e==="patch")&&(o.contentType="application/json",o.data=JSON.stringify(i.attrs||r.toJSON(i))),i.emulateJSON&&(o.contentType="application/x-www-form-urlencoded",o.data=o.data?{model:o.data}:{});if(i.emulateHTTP&&(s==="PUT"||s==="DELETE"||s==="PATCH")){o.type="POST",i.emulateJSON&&(o.data._method=s);var u=i.beforeSend;i.beforeSend=function(e){e.setRequestHeader("X-HTTP-Method-Override",s);if(u)return u.apply(this,arguments)}}o.type!=="GET"&&!i.emulateJSON&&(o.processData=!1),o.type==="PATCH"&&T&&(o.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")});var a=i.xhr=t.ajax(n.extend(o,i));return r.trigger("request",r,a,i),a};var T=typeof window!="undefined"&&!!window.ActiveXObject&&(!window.XMLHttpRequest||!(new XMLHttpRequest).dispatchEvent),N={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};t.ajax=function(){return t.$.ajax.apply(t.$,arguments)};var C=t.Router=function(e){e||(e={}),e.routes&&(this.routes=e.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},k=/\((.*?)\)/g,L=/(\(\?)?:\w+/g,A=/\*\w+/g,O=/[\-{}\[\]+?.,\\\^$|#\s]/g;n.extend(C.prototype,f,{initialize:function(){},route:function(e,r,i){n.isRegExp(e)||(e=this._routeToRegExp(e)),n.isFunction(r)&&(i=r,r=""),i||(i=this[r]);var s=this;return t.history.route(e,function(n){var o=s._extractParameters(e,n);s.execute(i,o),s.trigger.apply(s,["route:"+r].concat(o)),s.trigger("route",r,o),t.history.trigger("route",s,r,o)}),this},execute:function(e,t){e&&e.apply(this,t)},navigate:function(e,n){return t.history.navigate(e,n),this},_bindRoutes:function(){if(!this.routes)return;this.routes=n.result(this,"routes");var e,t=n.keys(this.routes);while((e=t.pop())!=null)this.route(e,this.routes[e])},_routeToRegExp:function(e){return e=e.replace(O,"\\$&").replace(k,"(?:$1)?").replace(L,function(e,t){return t?e:"([^/?]+)"}).replace(A,"([^?]*?)"),new RegExp("^"+e+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(e,t){var r=e.exec(t).slice(1);return n.map(r,function(e,t){return t===r.length-1?e||null:e?decodeURIComponent(e):null})}});var M=t.History=function(){this.handlers=[],n.bindAll(this,"checkUrl"),typeof window!="undefined"&&(this.location=window.location,this.history=window.history)},_=/^[#\/]|\s+$/g,D=/^\/+|\/+$/g,P=/msie [\w.]+/,H=/\/$/,B=/#.*$/;M.started=!1,n.extend(M.prototype,f,{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(e==null)if(this._hasPushState||!this._wantsHashChange||t){e=decodeURI(this.location.pathname+this.location.search);var n=this.root.replace(H,"");e.indexOf(n)||(e=e.slice(n.length))}else e=this.getHash();return e.replace(_,"")},start:function(e){if(M.started)throw new Error("Backbone.history has already been started");M.started=!0,this.options=n.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 r=this.getFragment(),i=document.documentMode,s=P.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(D,"/");if(s&&this._wantsHashChange){var o=t.$('<iframe src="javascript:0" tabindex="-1">');this.iframe=o.hide().appendTo("body")[0].contentWindow,this.navigate(r)}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=r;var u=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()&&u.hash&&(this.fragment=this.getHash().replace(_,""),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();t===this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t===this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()},loadUrl:function(e){return e=this.fragment=this.getFragment(e),n.any(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0})},navigate:function(e,t){if(!M.started)return!1;if(!t||t===!0)t={trigger:!!t};var n=this.root+(e=this.getFragment(e||""));e=e.replace(B,"");if(this.fragment===e)return;this.fragment=e,e===""&&n!=="/"&&(n=n.slice(0,-1));if(this._hasPushState)this.history[t.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);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))}if(t.trigger)return this.loadUrl(e)},_updateHash:function(e,t,n){if(n){var r=e.href.replace(/(javascript:|#).*$/,"");e.replace(r+"#"+t)}else e.hash="#"+t}}),t.history=new M;var j=function(e,t){var r=this,i;e&&n.has(e,"constructor")?i=e.constructor:i=function(){return r.apply(this,arguments)},n.extend(i,r,t);var s=function(){this.constructor=i};return s.prototype=r.prototype,i.prototype=new s,e&&n.extend(i.prototype,e),i.__super__=r.prototype,i};d.extend=m.extend=C.extend=E.extend=M.extend=j;var F=function(){throw new Error('A "url" property or function must be specified')},I=function(e,t){var n=t.error;t.error=function(r){n&&n(e,r,t),e.trigger("error",e,r,t)}};return t}),define("app/views/side-nav",["jquery","underscore","backbone","common","js.cookie"],function(e,t,n,r,i){var s=n.View.extend({el:"#side-nav",template:t.template(e("#side-nav-tmpl").html()),enableModTemplate:t.template(e("#myhome-mods-enable-form-tmpl").html()),initialize:function(){this.default_cur_tab="mine",this.group_expanded=!1,i.get("group_expanded")&&i.get("group_expanded")=="true"&&(this.group_expanded=!0),this.data={cur_tab:this.default_cur_tab,show_group_list:this.group_expanded,groups:app.pageOptions.groups,mods_enabled:app.pageOptions.user_mods_enabled,can_add_repo:app.pageOptions.can_add_repo,can_generate_share_link:app.pageOptions.can_generate_share_link,can_generate_upload_link:app.pageOptions.can_generate_upload_link};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},events:{"click #group-nav a:first":"toggleGroupList","click #enable-mods":"enableMods","click .js-close-side-nav":"closeNav","click li > a":"visitLink","click .js-about":"showAbout"},toggleGroupList:function(){var t=e("#group-nav .toggle-icon");return t.toggleClass("icon-caret-left icon-caret-down"),e("#group-nav .grp-list").slideToggle(),t.hasClass("icon-caret-down")?(i.set("group_expanded","true"),this.data.show_group_list=!0):(i.set("group_expanded","false"),this.data.show_group_list=!1),!1},enableMods:function(){var t=app.pageOptions.user_mods_enabled,n=e(this.enableModTemplate({mods_available:app.pageOptions.user_mods_available,mods_enabled:t}));n.modal({focus:!1}),e("#simplemodal-container").css("height","auto"),e(".checkbox-orig",n).click(function(){e(this).parent().toggleClass("checkbox-checked")});var i=e('[name="personal_wiki"]'),s=i.prop("checked"),o=this;return n.submit(function(){var u=i.prop("checked");return u==s?!1:(r.ajaxPost({form:n,form_id:n.attr("id"),post_url:r.getUrl({name:"toggle_personal_modules"}),post_data:{personal_wiki:u},after_op_success:function(){if(u)t.push("personal wiki");else{var n=t.indexOf("personal wiki");n>-1&&t.splice(n,1)}e.modal.close(),o.render()}}),!1)}),!1},setCurTab:function(t,n){this.data.cur_tab=t||this.default_cur_tab,n&&e.extend(this.data,n);if(this.$clickedTab)this.$(".tab-cur").removeClass("tab-cur"),this.$clickedTab.addClass("tab-cur"),this.$clickedTab=null;else{this.render();var r=this.$(".tab-cur").offset().top,i=e(window).height()-this.$(".side-nav-footer").outerHeight(!0);r>i&&this.$(".side-nav-con").css({overflow:"auto"}).scrollTop(r-i+this.$(".tab-cur").outerHeight(!0)+10).removeAttr("style")}},updateGroups:function(){var t=this;e.ajax({url:r.getUrl({name:"groups"}),type:"GET",dataType:"json",cache:!1,success:function(e){var n=[];for(var i=0,s=e.length;i<s;i++)n.push({id:e[i].id,name:e[i].name});n.sort(function(e,t){return r.compareTwoWord(e.name,t.name)}),app.pageOptions.groups=n,t.data.groups=n,t.render()},error:function(){}})},show:function(){this.$el.css({left:"0px"})},hide:function(){this.$el.css({left:"-300px"})},closeNav:function(){return this.hide(),!1},visitLink:function(t){return e(t.target).attr("href")!=="#"&&(this.$clickedTab=e(t.target).parent()),e(window).width()<768&&e(t.target).attr("href")!=="#"&&this.hide(),!0},showAbout:function(){var e=this.$(".about-content");return e.modal(),!1}});return s}),define("app/models/repo",["underscore","backbone","common"],function(e,t,n){var r=t.Model.extend({defaults:{id:null,name:"",desc:"",mtime:0,mtime_relative:"",encrypted:!1,owner:"-",owner_nickname:"-",permission:"rw"},parse:function(t){var n=e.clone(t);return n.id=t.id||t.repo_id,n.name=t.name||t.repo_name,n.desc=t.desc||t.repo_desc,n.size_formatted=t.size_formatted||t.repo_size_formatted,n},validate:function(e,t){if(!e.name)return gettext("Name is required");if(e.encrypted){if(!e.passwd1)return gettext("Please enter password");if(!e.passwd2)return gettext("Please enter the password again");if(e.passwd1.length<app.pageOptions.repo_password_min_length)return gettext("Password is too short");if(e.passwd1!=e.passwd2)return gettext("Passwords don't match")}},getIconUrl:function(e){var t=this.get("encrypted"),r=this.get("permission")=="r"?!0:!1;return n.getLibIconUrl(t,r,e)},getIconTitle:function(){var e="";return this.get("encrypted")?e=gettext("Encrypted library"):this.get("permission")=="rw"?e=gettext("Read-Write library"):e=gettext("Read-Only library"),e}});return r}),define("app/collections/repos",["underscore","backbone","common","app/models/repo"],function(e,t,n,r){var i=t.Collection.extend({model:r,type:"mine",url:function(){return n.getUrl({name:"repos"})},initialize:function(e){e&&(this.type=e.type?e.type:"mine")},fetch:function(n){return n=n?e.clone(n):{},n.url=this.url()+"?type="+this.type,t.Collection.prototype.fetch.call(this,n)},create:function(n,r){return r=r?e.clone(r):{},r.url=this.url()+"?from=web",t.Collection.prototype.create.call(this,n,r)}});return i}),define("app/views/folder-share-item",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.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.path=e.path,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 n=this,i=this.item_data,s=r.getUrl({name:"dir_shared_items",repo_id:this.repo_id})+"?p="+encodeURIComponent(this.path);i.for_user?s+="&share_type=user&username="+encodeURIComponent(i.user):s+="&share_type=group&group_id="+encodeURIComponent(i.group_id);var o=e(t.currentTarget).val();e.ajax({url:s,dataType:"json",method:"POST",beforeSend:r.prepareCSRFToken,data:{permission:o},success:function(){i.perm=o,n.render()},error:function(t){var n;t.responseText?n=gettext("Edit failed"):n=gettext("Failed. Please check the network."),i.for_user?e("#dir-user-share .error").html(n).removeClass("hide"):e("#dir-group-share .error").html(n).removeClass("hide")}})},del:function(){var t=this,n=this.item_data,i=r.getUrl({name:"dir_shared_items",repo_id:this.repo_id})+"?p="+encodeURIComponent(this.path);return n.for_user?i+="&share_type=user&username="+encodeURIComponent(n.user):i+="&share_type=group&group_id="+encodeURIComponent(n.group_id),e.ajax({url:i,dataType:"json",method:"DELETE",beforeSend:r.prepareCSRFToken,success:function(){t.remove()},error:function(t){var r;t.responseText?r=gettext("Delete failed"):r=gettext("Failed. Please check the network."),n.for_user?e("#dir-user-share .error").html(r).removeClass("hide"):e("#dir-group-share .error").html(r).removeClass("hide")}}),!1}});return i}),define("app/views/share",["jquery","underscore","backbone","common","app/views/folder-share-item"],function(e,t,n,r,i){var s=n.View.extend({tagName:"div",id:"share-popup",template:t.template(e("#share-popup-tmpl").html()),initialize:function(t){this.is_repo_owner=t.is_repo_owner,this.is_virtual=t.is_virtual,this.user_perm=t.user_perm,this.repo_id=t.repo_id,this.repo_encrypted=t.repo_encrypted,this.dirent_path=t.dirent_path,this.obj_name=t.obj_name,this.is_dir=t.is_dir,this.render(),this.$el.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.$("#share-tabs").tabs(),!this.repo_encrypted&&app.pageOptions.can_generate_share_link&&this.downloadLinkPanelInit();if(this.is_dir){this.user_perm=="rw"&&!this.repo_encrypted&&app.pageOptions.can_generate_upload_link&&this.uploadLinkPanelInit();if(!this.is_virtual&&this.is_repo_owner){this.dirUserSharePanelInit(),this.dirGroupSharePanelInit();var n=this;e(document).on("click",function(e){var t=e.target||event.srcElement;n.$(".perm-edit-icon, .perm-toggle-select").is(t)||(n.$(".perm").removeClass("hide"),n.$(".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="'+r.HTMLescape(this.obj_name)+'">'+r.HTMLescape(this.obj_name)+"</span>"),is_dir:this.is_dir,is_repo_owner:this.is_repo_owner,is_virtual:this.is_virtual,user_perm:this.user_perm,repo_id:this.repo_id,can_generate_share_link:app.pageOptions.can_generate_share_link,can_generate_upload_link:app.pageOptions.can_generate_upload_link,repo_encrypted:this.repo_encrypted})),this},events:{'click [type="checkbox"]':"clickCheckbox","submit #generate-download-link-form":"generateDownloadLink","click #send-download-link":"showDownloadLinkSendForm","submit #send-download-link-form":"sendDownloadLink","click #cancel-share-download-link":"cancelShareDownloadLink","click #delete-download-link":"deleteDownloadLink","click #generate-download-link-form .generate-random-password":"generateRandomDownloadPassword","keydown #generate-download-link-form .generate-random-password":"generateRandomDownloadPassword","click #generate-download-link-form .show-or-hide-password":"showOrHideDownloadPassword","keydown #generate-download-link-form .show-or-hide-password":"showOrHideDownloadPassword","submit #generate-upload-link-form":"generateUploadLink","click #send-upload-link":"showUploadLinkSendForm","submit #send-upload-link-form":"sendUploadLink","click #cancel-share-upload-link":"cancelShareUploadLink","click #delete-upload-link":"deleteUploadLink","click #generate-upload-link-form .generate-random-password":"generateRandomUploadPassword","keydown #generate-upload-link-form .generate-random-password":"generateRandomUploadPassword","click #generate-upload-link-form .show-or-hide-password":"showOrHideUploadPassword","keydown #generate-upload-link-form .show-or-hide-password":"showOrHideUploadPassword","click #add-dir-user-share-item .submit":"dirUserShare","click #add-dir-group-share-item .submit":"dirGroupShare"},clickCheckbox:function(t){var n=e(t.currentTarget);n.closest(".checkbox-label").next().toggleClass("hide")},downloadLinkPanelInit:function(){var e=this,t=function(t){e.$(".loading-tip").hide();if(t.length==1){var n=t[0],r=n.link;e.download_link=r,e.download_link_token=n.token,e.$("#download-link").html(r),e.$("#direct-dl-link").html(r+"?raw=1"),n.is_expired&&(e.$("#send-download-link").addClass("hide"),e.$("#download-link, #direct-dl-link").append(' <span class="error">('+gettext("Expired")+")</span>")),e.$("#download-link-operations").removeClass("hide")}else e.$("#generate-download-link-form").removeClass("hide")};r.ajaxGet({get_url:r.getUrl({name:"share_admin_share_links"}),data:{repo_id:this.repo_id,path:this.dirent_path},after_op_success:t})},generateRandomPassword:function(t,n){if(t.type=="keydown"&&t.which!=32)return;var r=app.pageOptions.share_link_password_min_length,i="",s="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz0123456789";for(var o=0;o<r;o++)i+=s.charAt(Math.floor(Math.random()*s.length));e("input[name=password], input[name=password_again]",n).attr("type","text").val(i),e(".show-or-hide-password",n).attr("title",gettext("Hide")).attr("aria-label",gettext("Hide")).removeClass("icon-eye").addClass("icon-eye-slash")},generateRandomDownloadPassword:function(t){this.generateRandomPassword(t,e("#generate-download-link-form"))},showOrHidePassword:function(t,n){if(t.type=="keydown"&&t.which!=32)return;var r=e(".show-or-hide-password",n),i=e("input[name=password], input[name=password_again]",n);r.toggleClass("icon-eye icon-eye-slash"),r.hasClass("icon-eye")?(r.attr("title",gettext("Show")),r.attr("aria-label",gettext("Show")),i.attr("type","password")):(r.attr("title",gettext("Hide")),r.attr("aria-label",gettext("Hide")),i.attr("type","text"))},showOrHideDownloadPassword:function(t){this.showOrHidePassword(t,e("#generate-download-link-form"))},generateLink:function(t){var n=t.link_type,i=t.form,s=i.attr("id"),o=e('[name="use_passwd"]',i),u=o.prop("checked");if(n=="download")var a=e('[name="set_expiration"]',i),f=a.prop("checked");var l={};if(u){var c=e('[name="password"]',i),h=e('[name="password_again"]',i),p=e.trim(c.val()),d=e.trim(h.val());if(!p)return r.showFormError(s,gettext("Please enter password")),!1;if(p.length<app.pageOptions.share_link_password_min_length)return r.showFormError(s,gettext("Password is too short")),!1;if(!d)return r.showFormError(s,gettext("Please enter the password again")),!1;if(p!=d)return r.showFormError(s,gettext("Passwords don't match")),!1;l.password=p}if(f){var v=e('[name="expire_days"]',i),m=e.trim(v.val());if(!m)return r.showFormError(s,gettext("Please enter days.")),!1;if(Math.floor(m)!=m||!e.isNumeric(m))return r.showFormError(s,gettext("Please enter valid days")),!1;l.expire_days=m}e(".error",i).addClass("hide").html("");var g=e('[type="submit"]',i);r.disableButton(g),e.extend(l,{repo_id:this.repo_id,path:this.dirent_path});var y=this,b=function(e){i.addClass("hide"),r.enableButton(g),u&&(o.prop("checked",!1).parent().removeClass("checkbox-checked").end().closest(".checkbox-label").next().addClass("hide"),c.val(""),h.val("")),f&&(a.prop("checked",!1).parent().removeClass("checkbox-checked").end().closest(".checkbox-label").next().addClass("hide"),v.val("")),n=="download"?(y.$("#download-link").html(e.link),y.$("#direct-dl-link").html(e.link+"?raw=1"),y.download_link=e.link,y.download_link_token=e.token,y.$("#download-link-operations").removeClass("hide")):(y.$("#upload-link").html(e.link),y.upload_link=e.link,y.upload_link_token=e.token,y.$("#upload-link-operations").removeClass("hide"))};r.ajaxPost({form:i,post_url:t.post_url,post_data:l,after_op_success:b,form_id:s})},generateDownloadLink:function(){return this.generateLink({link_type:"download",form:this.$("#generate-download-link-form"),post_url:r.getUrl({name:"share_admin_share_links"})}),!1},showDownloadLinkSendForm:function(){this.$("#send-download-link, #delete-download-link").addClass("hide"),this.$("#send-download-link-form").removeClass("hide")},sendLink:function(t){var n=t.form,i=n.attr("id"),s=e.trim(e('[name="email"]',n).val()),o=e('textarea[name="extra_msg"]',n).val();if(!s)return r.showFormError(i,gettext("Please input at least an email.")),!1;var u=e('[type="submit"]',n),a=e(".sending-tip",n);r.disableButton(u),a.removeClass("hide");var f={email:s,extra_msg:o};e.extend(f,t.other_post_data);var l=function(t){e.modal.close();var n=gettext("Successfully sent to {placeholder}").replace("{placeholder}",t.send_success.join(", "));r.feedback(n,"success"),t.send_failed.length>0&&(n+="<br />"+gettext("Failed to send to {placeholder}").replace("{placeholder}",t.send_failed.join(", ")),r.feedback(n,"info"))},c=function(t){a.addClass("hide"),r.enableButton(u);var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),r.showFormError(i,n),r.enableButton(u)};r.ajaxPost({form:n,post_url:t.post_url,post_data:f,after_op_success:l,after_op_error:c,form_id:i})},sendDownloadLink:function(){return this.sendLink({form:this.$("#send-download-link-form"),other_post_data:{file_shared_link:this.download_link,file_shared_name:this.obj_name,file_shared_type:this.is_dir?"d":"f"},post_url:r.getUrl({name:"send_shared_download_link"})}),!1},cancelShareDownloadLink:function(){this.$("#send-download-link, #delete-download-link").removeClass("hide"),this.$("#send-download-link-form").addClass("hide")},deleteDownloadLink:function(){var t=this;e.ajax({url:r.getUrl({name:"share_admin_share_link",token:this.download_link_token}),type:"DELETE",cache:!1,beforeSend:r.prepareCSRFToken,dataType:"json",success:function(e){t.$("#generate-download-link-form").removeClass("hide"),t.$("#download-link-operations").addClass("hide")}})},uploadLinkPanelInit:function(){var e=this,t=function(t){if(t.length==1){var n=t[0],r=n.link;e.upload_link_token=n.token,e.upload_link=r,e.$("#upload-link").html(r),e.$("#upload-link-operations").removeClass("hide")}else e.$("#generate-upload-link-form").removeClass("hide")};r.ajaxGet({get_url:r.getUrl({name:"share_admin_upload_links"}),data:{repo_id:this.repo_id,path:this.dirent_path},after_op_success:t})},generateRandomUploadPassword:function(t){this.generateRandomPassword(t,e("#generate-upload-link-form"))},showOrHideUploadPassword:function(t){this.showOrHidePassword(t,e("#generate-upload-link-form"))},generateUploadLink:function(){return this.generateLink({link_type:"upload",form:this.$("#generate-upload-link-form"),post_url:r.getUrl({name:"share_admin_upload_links"})}),!1},showUploadLinkSendForm:function(){this.$("#send-upload-link, #delete-upload-link").addClass("hide"),this.$("#send-upload-link-form").removeClass("hide")},sendUploadLink:function(){return this.sendLink({form:this.$("#send-upload-link-form"),other_post_data:{shared_upload_link:this.upload_link},post_url:r.getUrl({name:"send_shared_upload_link"})}),!1},cancelShareUploadLink:function(){this.$("#send-upload-link, #delete-upload-link").removeClass("hide"),this.$("#send-upload-link-form").addClass("hide")},deleteUploadLink:function(){var t=this;e.ajax({url:r.getUrl({name:"share_admin_upload_link",token:this.upload_link_token}),type:"DELETE",cache:!1,beforeSend:r.prepareCSRFToken,dataType:"json",success:function(e){t.$("#generate-upload-link-form").removeClass("hide"),t.$("#upload-link-operations").addClass("hide")}})},dirUserSharePanelInit:function(){var t=this.$("#dir-user-share");e('[name="emails"]',t).select2(e.extend({},r.contactInputOptionsForSelect2()));var n=e("#add-dir-user-share-item"),s=this.repo_id,o=this.dirent_path;r.ajaxGet({get_url:r.getUrl({name:"dir_shared_items",repo_id:s}),data:{p:o,share_type:"user"},after_op_success:function(t){e(t).each(function(e,t){var r=new i({repo_id:s,path:o,item_data:{user:t.user_info.name,user_name:t.user_info.nickname,perm:t.permission,for_user:!0}});n.after(r.el)})}}),t.removeClass("hide"),this.$(".loading-tip").hide()},dirGroupSharePanelInit:function(){var t=this.$("#dir-group-share"),n=app.pageOptions.groups||[],s="";for(var o=0,u=n.length;o<u;o++)s+='<option value="'+n[o].id+'" data-index="'+o+'">'+n[o].name+"</option>";e('[name="groups"]',t).html(s).select2({placeholder:gettext("Select groups"),escapeMarkup:function(e){return e}});var a=e("#add-dir-group-share-item"),f=this.repo_id,l=this.dirent_path;r.ajaxGet({get_url:r.getUrl({name:"dir_shared_items",repo_id:f}),data:{p:l,share_type:"group"},after_op_success:function(t){e(t).each(function(e,t){var n=new i({repo_id:f,path:l,item_data:{group_id:t.group_info.id,group_name:t.group_info.name,perm:t.permission,for_user:!1}});a.after(n.el)})}}),t.removeClass("hide"),this.$(".loading-tip").hide()},dirUserShare:function(){var t=e("#dir-user-share"),n=this.$("#add-dir-user-share-item"),s=e('[name="emails"]',n),o=s.val();if(!o)return!1;var u=e("#add-dir-user-share-item"),a=this.repo_id,f=this.dirent_path,l=e('[name="permission"]',n),c=l.val(),h=e(".error",t),p=e('[type="submit"]',n);r.disableButton(p),e.ajax({url:r.getUrl({name:"dir_shared_items",repo_id:a})+"?p="+encodeURIComponent(f),dataType:"json",method:"PUT",beforeSend:r.prepareCSRFToken,traditional:!0,data:{share_type:"user",username:o.split(","),permission:c},success:function(t){t.success.length>0&&(e(t.success).each(function(e,t){var n=new i({repo_id:a,path:f,item_data:{user:t.user_info.name,user_name:t.user_info.nickname,perm:t.permission,for_user:!0}});u.after(n.el)}),s.select2("val",""),e('[value="rw"]',l).attr("selected","selected"),e('[value="r"]',l).removeAttr("selected"),h.addClass("hide"));if(t.failed.length>0){var n="";e(t.failed).each(function(e,t){n+=r.HTMLescape(t.email)+": "+t.error_msg+"<br />"}),h.html(n).removeClass("hide")}},error:function(t){var n;if(t.responseText){var r=e.parseJSON(t.responseText);n=r.error||r.error_msg}else n=gettext("Failed. Please check the network.");h.html(n).removeClass("hide")},complete:function(){r.enableButton(p)}})},dirGroupShare:function(){var t=e("#dir-group-share"),n=this.$("#add-dir-group-share-item"),s=e('[name="groups"]',n),o=s.val();if(!o)return!1;var u=e("#add-dir-group-share-item"),a=this.repo_id,f=this.dirent_path,l=e('[name="permission"]',n),c=l.val(),h=e(".error",t),p=e('[type="submit"]',n);r.disableButton(p),e.ajax({url:r.getUrl({name:"dir_shared_items",repo_id:a})+"?p="+encodeURIComponent(f),dataType:"json",method:"PUT",beforeSend:r.prepareCSRFToken,traditional:!0,data:{share_type:"group",group_id:o,permission:c},success:function(t){t.success.length>0&&(e(t.success).each(function(e,t){var n=new i({repo_id:a,path:f,item_data:{group_id:t.group_info.id,group_name:t.group_info.name,perm:t.permission,for_user:!1}});u.after(n.el)}),s.select2("val",""),e('[value="rw"]',l).attr("selected","selected"),e('[value="r"]',l).removeAttr("selected"),h.addClass("hide"));if(t.failed.length>0){var n="";e(t.failed).each(function(e,t){n+=r.HTMLescape(t.group_name)+": "+t.error_msg+"<br />"}),h.html(n).removeClass("hide")}},error:function(t){var n;if(t.responseText){var r=e.parseJSON(t.responseText);n=r.error||r.error_msg}else n=gettext("Failed. Please check the network.");h.html(n).removeClass("hide")},complete:function(){r.enableButton(p)}})}});return s}),define("app/views/dialogs/repo-change-password",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({template:t.template(e("#repo-change-password-form-tmpl").html()),initialize:function(t){this.repo_name=t.repo_name,this.repo_id=t.repo_id,this.render(),this.$(".op-target").css({"max-width":280}),this.$el.modal(),e("#simplemodal-container").css({height:"auto"})},render:function(){var e=this.repo_name;return this.$el.html(this.template({title:gettext("Change Password of Library {placeholder}").replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+r.HTMLescape(e)+'">'+r.HTMLescape(e)+"</span>")})),this},events:{"submit form":"formSubmit"},formSubmit:function(){var t=this,n=this.$("form"),i=this.$(".error"),s=e.trim(e('input[name="old_passwd"]',n).val()),o=e.trim(e('input[name="new_passwd"]',n).val()),u=e.trim(e('input[name="new_passwd_again"]',n).val());if(!s)return i.html(gettext("Please enter the old password")).removeClass("hide"),!1;if(!o)return i.html(gettext("Please enter a new password")).removeClass("hide"),!1;if(o.length<app.pageOptions.repo_password_min_length)return i.html(gettext("New password is too short")).removeClass("hide"),!1;if(!u)return i.html(gettext("Please enter the new password again")).removeClass("hide"),!1;if(o!=u)return i.html(gettext("New passwords don't match")).removeClass("hide"),!1;var a=this.$('[type="submit"]');return r.disableButton(a),e.ajax({url:r.getUrl({name:"repo_change_password",repo_id:this.repo_id}),type:"POST",dataType:"json",beforeSend:r.prepareCSRFToken,data:{old_passwd:s,new_passwd:o,new_passwd_again:u},success:function(){e.modal.close(),r.feedback(gettext("Successfully changed library password."),"success")},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),i.html(n).show(),r.enableButton(a)}}),!1}});return i}),define("app/views/dialogs/repo-history-settings",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.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.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="'+r.HTMLescape(e)+'">'+r.HTMLescape(e)+"</span>"),default_history_limit:30})),this},renderHistorySettings:function(){var t=this;e.ajax({url:r.getUrl({name:"repo_history_limit",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):e.keep_days==0?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(n){var r;n.responseText?r=e.parseJSON(n.responseText).error_msg:r=gettext("Failed. Please check the network."),t.$error.html(r).show()}})},events:{'change [name="history"]':"changeHistorySetting","submit form":"formSubmit"},changeHistorySetting:function(t){var n=e(t.currentTarget).val(),r=this.$days_input;n=="full_history"||n=="no_history"?r.prop("disabled",!0).addClass("input-disabled"):r.prop("disabled",!1).removeClass("input-disabled")},formSubmit:function(){var t,n=this.$radios.filter(":checked").val(),i=this;return n=="partial_history"?t=this.$days_input.val():n=="full_history"?t=-1:t=0,this.$submit.prop("disabled",!0),e.ajax({url:r.getUrl({name:"repo_history_limit",repo_id:this.repo_id}),type:"put",dataType:"json",beforeSend:r.prepareCSRFToken,data:{keep_days:t},success:function(){e.modal.close(),r.feedback(gettext("Successfully set library history."),"success")},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error_msg:n=gettext("Failed. Please check the network."),i.$error.html(n).show(),r.enableButton(i.$submit)}}),!1}});return i}),define("app/collections/repo-shared-download-links",["underscore","backbone","common"],function(e,t,n){var r=t.Collection.extend({initialize:function(e){this.repo_id=e.repo_id},url:function(){return n.getUrl({name:"repo_shared_download_links",repo_id:this.repo_id})}});return r}),define("app/collections/repo-shared-upload-links",["underscore","backbone","common"],function(e,t,n){var r=t.Collection.extend({initialize:function(e){this.repo_id=e.repo_id},url:function(){return n.getUrl({name:"repo_shared_upload_links",repo_id:this.repo_id})}});return r}),define("app/views/repo-shared-link",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({tagName:"tr",template:t.template(e("#repo-shared-link-tmpl").html()),events:{mouseenter:"highlight",mouseleave:"rmHighlight","click .rm-link":"removeLink"},initialize:function(t){this.data={},e.extend(this.data,t)},render:function(){var t={},n=this.model.get("path"),i=n,s="";return e.extend(t,this.model.attributes),this.data.link_type=="upload"&&e.extend(t,{share_type:"d"}),t.share_type=="d"?i=n.substring(0,n.length-1):s=r.fileSizeFormat(this.model.get("size"),1),e.extend(t,{repo_id:this.data.repo_id,formattedSize:s,encoded_path:r.encodePath(i)}),this.$el.html(this.template(t)),this},highlight:function(){this.$el.addClass("hl").find(".op-icon").removeClass("vh")},rmHighlight:function(){this.$el.removeClass("hl").find(".op-icon").addClass("vh")},removeLink:function(){var t=r.getUrl({name:this.data.link_type=="download"?"repo_shared_download_link":"repo_shared_upload_link",repo_id:this.data.repo_id,token:this.model.get("token")}),n=this;return e.ajax({url:t,type:"delete",dataType:"json",beforeSend:r.prepareCSRFToken,success:function(){n.remove()},error:function(t){var r;t.responseText?r=e.parseJSON(response.responseText).error_msg:r=gettext("Please check the network."),n.data.$error.html(r).show()}}),!1}});return i}),define("app/views/dialogs/repo-share-link-admin",["jquery","underscore","backbone","common","app/collections/repo-shared-download-links","app/collections/repo-shared-upload-links","app/views/repo-shared-link"],function(e,t,n,r,i,s,o){var u=n.View.extend({tagName:"div",id:"repo-share-link-admin-dialog",template:t.template(e("#repo-shared-links-admin-dialog-tmpl").html()),initialize:function(t){this.repo_name=t.repo_name,this.repo_id=t.repo_id,this.render(),this.$(".op-target").css({"max-width":280}),this.$el.modal(),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.$(".js-tabs").tabs();var n=new i({repo_id:this.repo_id});n.link_type="download",this.$downloadLinksPanel=this.$("#js-download-links");var r=new s({repo_id:this.repo_id});r.link_type="upload",this.$uploadLinksPanel=this.$("#js-upload-links"),app.pageOptions.can_generate_share_link&&this.renderLinksPanel({links:n,$panel:this.$downloadLinksPanel}),app.pageOptions.can_generate_upload_link&&this.renderLinksPanel({links:r,$panel:this.$uploadLinksPanel})},render:function(){return this.$el.html(this.template({can_generate_share_link:app.pageOptions.can_generate_share_link,can_generate_upload_link:app.pageOptions.can_generate_upload_link,title:gettext("{placeholder} Share Links").replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+r.HTMLescape(this.repo_name)+'">'+r.HTMLescape(this.repo_name)+"</span>")})),this},renderLinksPanel:function(t){var n=t.links,r=t.$panel,i=e(".loading-tip",r),s=e(".error",r);this.listenTo(n,"add",this.addLink),n.fetch({cache:!1,success:function(e,t,n){i.hide()},error:function(t,n,r){i.hide();var o;n.responseText?n["status"]==401||n["status"]==403?o=gettext("Permission error"):o=e.parseJSON(n.responseText).error_msg:o=gettext("Please check the network."),s.html(o).show()}})},addLink:function(t,n,r){var i=n.link_type,s=i=="download"?this.$downloadLinksPanel:this.$uploadLinksPanel,u=new o({model:t,repo_id:this.repo_id,link_type:i,$error:e(".error",s)});e("tbody",s).append(u.render().el)}});return u}),function(){if(jQuery&&jQuery.jstree)return;var e=!1,t=!1,n=!1;(function(r){r.vakata={},r.vakata.css={get_css:function(e,t,n){e=e.toLowerCase();var r=n.cssRules||n.rules,i=0;do{if(r.length&&i>r.length+5)return!1;if(r[i].selectorText&&r[i].selectorText.toLowerCase()==e)return t===!0?(n.removeRule&&n.removeRule(i),n.deleteRule&&n.deleteRule(i),!0):r[i]}while(r[++i]);return!1},add_css:function(e,t){return r.jstree.css.get_css(e,!1,t)?!1:(t.insertRule?t.insertRule(e+" { }",0):t.addRule(e,null,0),r.vakata.css.get_css(e))},remove_css:function(e,t){return r.vakata.css.get_css(e,!0,t)},add_sheet:function(e){var t=!1,n=!0;if(e.str)return e.title&&(t=r("style[id='"+e.title+"-stylesheet']")[0]),t?n=!1:(t=document.createElement("style"),t.setAttribute("type","text/css"),e.title&&t.setAttribute("id",e.title+"-stylesheet")),t.styleSheet?n?(document.getElementsByTagName("head")[0].appendChild(t),t.styleSheet.cssText=e.str):t.styleSheet.cssText=t.styleSheet.cssText+" "+e.str:(t.appendChild(document.createTextNode(e.str)),document.getElementsByTagName("head")[0].appendChild(t)),t.sheet||t.styleSheet;if(e.url){if(!document.createStyleSheet)return t=document.createElement("link"),t.rel="stylesheet",t.type="text/css",t.media="all",t.href=e.url,document.getElementsByTagName("head")[0].appendChild(t),t.styleSheet;try{t=document.createStyleSheet(e.url)}catch(i){}}}};var i=[],s=-1,o={},u={};r.fn.jstree=function(e){var t=typeof e=="string",n=Array.prototype.slice.call(arguments,1),s=this;if(t){if(e.substring(0,1)=="_")return s;this.each(function(){var t=i[r.data(this,"jstree-instance-id")],o=t&&r.isFunction(t[e])?t[e].apply(t,n):t;if(typeof o!="undefined"&&(e.indexOf("is_")===0||o!==!0&&o!==!1))return s=o,!1})}else this.each(function(){var t=r.data(this,"jstree-instance-id"),s=[],u=e?r.extend({},!0,e):{},a=r(this),f=!1,l=[];s=s.concat(n),a.data("jstree")&&s.push(a.data("jstree")),u=s.length?r.extend.apply(null,[!0,u].concat(s)):u,typeof t!="undefined"&&i[t]&&i[t].destroy(),t=parseInt(i.push({}),10)-1,r.data(this,"jstree-instance-id",t),u.plugins=r.isArray(u.plugins)?u.plugins:r.jstree.defaults.plugins.slice(),u.plugins.unshift("core"),u.plugins=u.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(","),f=r.extend(!0,{},r.jstree.defaults,u),f.plugins=u.plugins,r.each(o,function(e,t){r.inArray(e,f.plugins)===-1?(f[e]=null,delete f[e]):l.push(e)}),f.plugins=l,i[t]=new r.jstree._instance(t,r(this).addClass("jstree jstree-"+t),f),r.each(i[t]._get_settings().plugins,function(e,n){i[t].data[n]={}}),r.each(i[t]._get_settings().plugins,function(e,n){o[n]&&o[n].__init.apply(i[t])}),setTimeout(function(){i[t].init()},0)});return s},r.jstree={defaults:{plugins:[]},_focused:function(){return i[s]||null},_reference:function(e){if(i[e])return i[e];var t=r(e);return!t.length&&typeof e=="string"&&(t=r("#"+e)),t.length?i[t.closest(".jstree").data("jstree-instance-id")]||null:null},_instance:function(e,t,n){this.data={core:{}},this.get_settings=function(){return r.extend(!0,{},n)},this._get_settings=function(){return n},this.get_index=function(){return e},this.get_container=function(){return t},this.get_container_ul=function(){return t.children("ul:eq(0)")},this._set_settings=function(e){n=r.extend(!0,{},n,e)}},_fn:{},plugin:function(e,t){t=r.extend({},{__init:r.noop,__destroy:r.noop,_fn:{},defaults:!1},t),o[e]=t,r.jstree.defaults[e]=t.defaults,r.each(t._fn,function(t,n){n.plugin=e,n.old=r.jstree._fn[t],r.jstree._fn[t]=function(){var e,i=n,s=Array.prototype.slice.call(arguments),o=new r.Event("before.jstree"),u=!1;if(this.data.core.locked===!0&&t!=="unlock"&&t!=="is_locked")return;do{if(i&&i.plugin&&r.inArray(i.plugin,this._get_settings().plugins)!==-1)break;i=i.old}while(i);if(!i)return;if(t.indexOf("_")===0)e=i.apply(this,s);else{e=this.get_container().triggerHandler(o,{func:t,inst:this,args:s,plugin:i.plugin});if(e===!1)return;typeof e!="undefined"&&(s=e),e=i.apply(r.extend({},this,{__callback:function(e){this.get_container().triggerHandler(t+".jstree",{inst:this,args:s,rslt:e,rlbk:u})},__rollback:function(){return u=this.get_rollback(),u},__call_old:function(e){return i.old.apply(this,e?Array.prototype.slice.call(arguments,1):s)}}),s)}return e},r.jstree._fn[t].old=n.old,r.jstree._fn[t].plugin=e})},rollback:function(e){e&&(r.isArray(e)||(e=[e]),r.each(e,function(e,t){i[t.i].set_rollback(t.h,t.d)}))}},r.jstree._fn=r.jstree._instance.prototype={},r(function(){var i=navigator.userAgent.toLowerCase(),s=(i.match(/.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],o=".jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } .jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } .jstree-rtl li { margin-left:0; margin-right:18px; } .jstree > ul > li { margin-left:0px; } .jstree-rtl > ul > li { margin-right:0px; } .jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } .jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } .jstree a:focus { outline: none; } .jstree a > ins { height:16px; width:16px; } .jstree a > .jstree-icon { margin-right:3px; } .jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } li.jstree-open > ul { display:block; } li.jstree-closed > ul { display:none; } ";if(/msie/.test(i)&&parseInt(s,10)==6){e=!0;try{document.execCommand("BackgroundImageCache",!1,!0)}catch(u){}o+=".jstree li { height:18px; margin-left:0; margin-right:0; } .jstree li li { margin-left:18px; } .jstree-rtl li li { margin-left:0px; margin-right:18px; } li.jstree-open ul { display:block; } li.jstree-closed ul { display:none !important; } .jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } .jstree li a ins { height:16px; width:16px; margin-right:3px; } .jstree-rtl li a ins { margin-right:0px; margin-left:3px; } "}/msie/.test(i)&&parseInt(s,10)==7&&(t=!0,o+=".jstree li a { border-width:0 !important; padding:0px 2px !important; } "),!/compatible/.test(i)&&/mozilla/.test(i)&&parseFloat(s,10)<1.9&&(n=!0,o+=".jstree ins { display:-moz-inline-box; } .jstree li { line-height:12px; } .jstree a { display:-moz-inline-box; } .jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } "),r.vakata.css.add_sheet({str:o,title:"jstree"})}),r.jstree.plugin("core",{__init:function(){this.data.core.locked=!1,this.data.core.to_open=this.get_settings().core.initially_open,this.data.core.to_load=this.get_settings().core.initially_load},defaults:{html_titles:!1,animation:500,initially_open:[],initially_load:[],open_parents:!0,notify_plugins:!0,rtl:!1,load_open:!1,strings:{loading:"Loading ...",new_node:"New node",multiple_selection:"Multiple selection"}},_fn:{init:function(){this.set_focus(),this._get_settings().core.rtl&&this.get_container().addClass("jstree-rtl").css("direction","rtl"),this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins>&#160;</ins><a class='jstree-loading' href='#'><ins class='jstree-icon'>&#160;</ins>"+this._get_string("loading")+"</a></li></ul>"),this.data.core.li_height=this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height()||18,this.get_container().delegate("li > ins","click.jstree",r.proxy(function(e){var t=r(e.target);t.is("ins")&&e.pageY-t.offset().top<this.data.core.li_height&&this.toggle_node(t)},this)).bind("mousedown.jstree",r.proxy(function(){this.set_focus()},this)).bind("dblclick.jstree",function(e){var t;if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){t=window.getSelection();try{t.removeAllRanges(),t.collapse()}catch(n){}}}),this._get_settings().core.notify_plugins&&this.get_container().bind("load_node.jstree",r.proxy(function(e,t){var n=this._get_node(t.rslt.obj),i=this;n===-1&&(n=this.get_container_ul());if(!n.length)return;n.find("li").each(function(){var e=r(this);e.data("jstree")&&r.each(e.data("jstree"),function(t,n){i.data[t]&&r.isFunction(i["_"+t+"_notify"])&&i["_"+t+"_notify"].call(i,e,n)})})},this)),this._get_settings().core.load_open&&this.get_container().bind("load_node.jstree",r.proxy(function(e,t){var n=this._get_node(t.rslt.obj),i=this;n===-1&&(n=this.get_container_ul());if(!n.length)return;n.find("li.jstree-open:not(:has(ul))").each(function(){i.load_node(this,r.noop,r.noop)})},this)),this.__callback(),this.load_node(-1,function(){this.loaded(),this.reload_nodes()})},destroy:function(){var e,t=this.get_index(),n=this._get_settings(),u=this;r.each(n.plugins,function(e,t){try{o[t].__destroy.apply(u)}catch(n){}}),this.__callback();if(this.is_focused())for(e in i)if(i.hasOwnProperty(e)&&e!=t){i[e].set_focus();break}t===s&&(s=-1),this.get_container().unbind(".jstree").undelegate(".jstree").removeData("jstree-instance-id").find("[class^='jstree']").andSelf().attr("class",function(){return this.className.replace(/jstree[^ ]*|$/ig,"")}),r(document).unbind(".jstree-"+t).undelegate(".jstree-"+t),i[t]=null,delete i[t]},_core_notify:function(e,t){t.opened&&this.open_node(e,!1,!0)},lock:function(){this.data.core.locked=!0,this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7"),this.__callback({})},unlock:function(){this.data.core.locked=!1,this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1"),this.__callback({})},is_locked:function(){return this.data.core.locked},save_opened:function(){var e=this;this.data.core.to_open=[],this.get_container_ul().find("li.jstree-open").each(function(){this.id&&e.data.core.to_open.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}),this.__callback(e.data.core.to_open)},save_loaded:function(){},reload_nodes:function(e){var t=this,n=!0,i=[],s=[];e||(this.data.core.reopen=!1,this.data.core.refreshing=!0,this.data.core.to_open=r.map(r.makeArray(this.data.core.to_open),function(e){return"#"+e.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_load=r.map(r.makeArray(this.data.core.to_load),function(e){return"#"+e.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.data.core.to_open.length&&(this.data.core.to_load=this.data.core.to_load.concat(this.data.core.to_open))),this.data.core.to_load.length&&(r.each(this.data.core.to_load,function(e,t){if(t=="#")return!0;r(t).length?i.push(t):s.push(t)}),i.length&&(this.data.core.to_load=s,r.each(i,function(e,r){t._is_loaded(r)||(t.load_node(r,function(){t.reload_nodes(!0)},function(){t.reload_nodes(!0)}),n=!1)}))),this.data.core.to_open.length&&r.each(this.data.core.to_open,function(e,n){t.open_node(n,!1,!0)}),n&&(this.data.core.reopen&&clearTimeout(this.data.core.reopen),this.data.core.reopen=setTimeout(function(){t.__callback({},t)},50),this.data.core.refreshing=!1,this.reopen())},reopen:function(){var e=this;this.data.core.to_open.length&&r.each(this.data.core.to_open,function(t,n){e.open_node(n,!1,!0)}),this.__callback({})},refresh:function(e){var t=this;this.save_opened(),e||(e=-1),e=this._get_node(e),e||(e=-1),e!==-1?e.children("UL").remove():this.get_container_ul().empty(),this.load_node(e,function(){t.__callback({obj:e}),t.reload_nodes()})},loaded:function(){this.__callback()},set_focus:function(){if(this.is_focused())return;var e=r.jstree._focused();e&&e.unset_focus(),this.get_container().addClass("jstree-focused"),s=this.get_index(),this.__callback()},is_focused:function(){return s==this.get_index()},unset_focus:function(){this.is_focused()&&(this.get_container().removeClass("jstree-focused"),s=-1),this.__callback()},_get_node:function(e){var t=r(e,this.get_container());return t.is(".jstree")||e==-1?-1:(t=t.closest("li",this.get_container()),t.length?t:!1)},_get_next:function(e,t){return e=this._get_node(e),e===-1?this.get_container().find("> ul > li:first-child"):e.length?t?e.nextAll("li").size()>0?e.nextAll("li:eq(0)"):!1:e.hasClass("jstree-open")?e.find("li:eq(0)"):e.nextAll("li").size()>0?e.nextAll("li:eq(0)"):e.parentsUntil(".jstree","li").next("li").eq(0):!1},_get_prev:function(e,t){e=this._get_node(e);if(e===-1)return this.get_container().find("> ul > li:last-child");if(!e.length)return!1;if(t)return e.prevAll("li").length>0?e.prevAll("li:eq(0)"):!1;if(e.prev("li").length){e=e.prev("li").eq(0);while(e.hasClass("jstree-open"))e=e.children("ul:eq(0)").children("li:last");return e}var n=e.parentsUntil(".jstree","li:eq(0)");return n.length?n:!1},_get_parent:function(e){e=this._get_node(e);if(e==-1||!e.length)return!1;var t=e.parentsUntil(".jstree","li:eq(0)");return t.length?t:-1},_get_children:function(e){return e=this._get_node(e),e===-1?this.get_container().children("ul:eq(0)").children("li"):e.length?e.children("ul:eq(0)").children("li"):!1},get_path:function(e,t){var n=[],r=this;return e=this._get_node(e),e===-1||!e||!e.length?!1:(e.parentsUntil(".jstree","li").each(function(){n.push(t?this.id:r.get_text(this))}),n.reverse(),n.push(t?e.attr("id"):this.get_text(e)),n)},_get_string:function(e){return this._get_settings().core.strings[e]||e},is_open:function(e){return e=this._get_node(e),e&&e!==-1&&e.hasClass("jstree-open")},is_closed:function(e){return e=this._get_node(e),e&&e!==-1&&e.hasClass("jstree-closed")},is_leaf:function(e){return e=this._get_node(e),e&&e!==-1&&e.hasClass("jstree-leaf")},correct_state:function(e){e=this._get_node(e);if(!e||e===-1)return!1;e.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove(),this.__callback({obj:e})},open_node:function(t,n,r){t=this._get_node(t);if(!t.length)return!1;if(!t.hasClass("jstree-closed"))return n&&n.call(),!1;var i=r||e?0:this._get_settings().core.animation,s=this;this._is_loaded(t)?(this._get_settings().core.open_parents&&t.parentsUntil(".jstree",".jstree-closed").each(function(){s.open_node(this,!1,!0)}),i&&t.children("ul").css("display","none"),t.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading"),i?t.children("ul").stop(!0,!0).slideDown(i,function(){this.style.display="",s.after_open(t)}):s.after_open(t),this.__callback({obj:t}),n&&n.call()):(t.children("a").addClass("jstree-loading"),this.load_node(t,function(){s.open_node(t,n,r)},n))},after_open:function(e){this.__callback({obj:e})},close_node:function(t,n){t=this._get_node(t);var r=n||e?0:this._get_settings().core.animation,i=this;if(!t.length||!t.hasClass("jstree-open"))return!1;r&&t.children("ul").attr("style","display:block !important"),t.removeClass("jstree-open").addClass("jstree-closed"),r?t.children("ul").stop(!0,!0).slideUp(r,function(){this.style.display="",i.after_close(t)}):i.after_close(t),this.__callback({obj:t})},after_close:function(e){this.__callback({obj:e})},toggle_node:function(e){e=this._get_node(e);if(e.hasClass("jstree-closed"))return this.open_node(e);if(e.hasClass("jstree-open"))return this.close_node(e)},open_all:function(e,t,n){e=e?this._get_node(e):-1;if(!e||e===-1)e=this.get_container_ul();n?e=e.find("li.jstree-closed"):(n=e,e.is(".jstree-closed")?e=e.find("li.jstree-closed").andSelf():e=e.find("li.jstree-closed"));var r=this;e.each(function(){var e=this;r._is_loaded(this)?r.open_node(this,!1,!t):r.open_node(this,function(){r.open_all(e,t,n)},!t)}),n.find("li.jstree-closed").length===0&&this.__callback({obj:n})},close_all:function(e,t){var n=this;e=e?this._get_node(e):this.get_container();if(!e||e===-1)e=this.get_container_ul();e.find("li.jstree-open").andSelf().each(function(){n.close_node(this,!t)}),this.__callback({obj:e})},clean_node:function(e){e=e&&e!=-1?r(e):this.get_container_ul(),e=e.is("li")?e.find("li").andSelf():e.find("li"),e.removeClass("jstree-last").filter("li:last-child").addClass("jstree-last").end().filter(":has(li)").not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed"),e.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove(),this.__callback({obj:e})},get_rollback:function(){return this.__callback(),{i:this.get_index(),h:this.get_container().children("ul").clone(!0),d:this.data}},set_rollback:function(e,t){this.get_container().empty().append(e),this.data=t,this.__callback()},load_node:function(e,t,n){this.__callback({obj:e})},_is_loaded:function(e){return!0},create_node:function(e,t,n,i,s){e=this._get_node(e),t=typeof t=="undefined"?"last":t;var o=r("<li />"),u=this._get_settings().core,a;if(e!==-1&&!e.length)return!1;if(!s&&!this._is_loaded(e))return this.load_node(e,function(){this.create_node(e,t,n,i,!0)}),!1;this.__rollback(),typeof n=="string"&&(n={data:n}),n||(n={}),n.attr&&o.attr(n.attr),n.metadata&&o.data(n.metadata),n.state&&o.addClass("jstree-"+n.state),n.data||(n.data=this._get_string("new_node")),r.isArray(n.data)||(a=n.data,n.data=[],n.data.push(a)),r.each(n.data,function(e,t){a=r("<a />"),r.isFunction(t)&&(t=t.call(this,n)),typeof t=="string"?a.attr("href","#")[u.html_titles?"html":"text"](t):(t.attr||(t.attr={}),t.attr.href||(t.attr.href="#"),a.attr(t.attr)[u.html_titles?"html":"text"](t.title),t.language&&a.addClass(t.language)),a.prepend("<ins class='jstree-icon'>&#160;</ins>"),t.icon&&(t.icon.indexOf("/")===-1?a.children("ins").addClass(t.icon):a.children("ins").css("background","url('"+t.icon+"') center center no-repeat")),o.append(a)}),o.prepend("<ins class='jstree-icon'>&#160;</ins>"),e===-1&&(e=this.get_container(),t==="before"&&(t="first"),t==="after"&&(t="last"));switch(t){case"before":e.before(o),a=this._get_parent(e);break;case"after":e.after(o),a=this._get_parent(e);break;case"inside":case"first":e.children("ul").length||e.append("<ul />"),e.children("ul").prepend(o),a=e;break;case"last":e.children("ul").length||e.append("<ul />"),e.children("ul").append(o),a=e;break;default:e.children("ul").length||e.append("<ul />"),t||(t=0),a=e.children("ul").children("li").eq(t),a.length?a.before(o):e.children("ul").append(o),a=e}if(a===-1||a.get(0)===this.get_container().get(0))a=-1;return this.clean_node(a),this.__callback({obj:o,parent:a}),i&&i.call(this,o),o},get_text:function(e){e=this._get_node(e);if(!e.length)return!1;var t=this._get_settings().core.html_titles;return e=e.children("a:eq(0)"),t?(e=e.clone(),e.children("INS").remove(),e.html()):(e=e.contents().filter(function(){return this.nodeType==3})[0],e.nodeValue)},set_text:function(e,t){e=this._get_node(e);if(!e.length)return!1;e=e.children("a:eq(0)");if(this._get_settings().core.html_titles){var n=e.children("INS").clone();return e.html(t).prepend(n),this.__callback({obj:e,name:t}),!0}return e=e.contents().filter(function(){return this.nodeType==3})[0],this.__callback({obj:e,name:t}),e.nodeValue=t},rename_node:function(e,t){e=this._get_node(e),this.__rollback(),e&&e.length&&this.set_text.apply(this,Array.prototype.slice.call(arguments))&&this.__callback({obj:e,name:t})},delete_node:function(e){e=this._get_node(e);if(!e.length)return!1;this.__rollback();var t=this._get_parent(e),n=r([]),i=this;return e.each(function(){n=n.add(i._get_prev(this))}),e=e.detach(),t!==-1&&t.find("> ul > li").length===0&&t.removeClass("jstree-open jstree-closed").addClass("jstree-leaf"),this.clean_node(t),this.__callback({obj:e,prev:n,parent:t}),e},prepare_move:function(e,t,n,i,s){var o={};o.ot=r.jstree._reference(e)||this,o.o=o.ot._get_node(e),o.r=t===-1?-1:this._get_node(t),o.p=typeof n=="undefined"||n===!1?"last":n;if(!s&&u.o&&u.o[0]===o.o[0]&&u.r[0]===o.r[0]&&u.p===o.p){this.__callback(u),i&&i.call(this,u);return}o.ot=r.jstree._reference(o.o)||this,o.rt=r.jstree._reference(o.r)||this;if(o.r===-1||!o.r){o.cr=-1;switch(o.p){case"first":case"before":case"inside":o.cp=0;break;case"after":case"last":o.cp=o.rt.get_container().find(" > ul > li").length;break;default:o.cp=o.p}}else{if(!/^(before|after)$/.test(o.p)&&!this._is_loaded(o.r))return this.load_node(o.r,function(){this.prepare_move(e,t,n,i,!0)});switch(o.p){case"before":o.cp=o.r.index(),o.cr=o.rt._get_parent(o.r);break;case"after":o.cp=o.r.index()+1,o.cr=o.rt._get_parent(o.r);break;case"inside":case"first":o.cp=0,o.cr=o.r;break;case"last":o.cp=o.r.find(" > ul > li").length,o.cr=o.r;break;default:o.cp=o.p,o.cr=o.r}}o.np=o.cr==-1?o.rt.get_container():o.cr,o.op=o.ot._get_parent(o.o),o.cop=o.o.index(),o.op===-1&&(o.op=o.ot?o.ot.get_container():this.get_container()),!/^(before|after)$/.test(o.p)&&o.op&&o.np&&o.op[0]===o.np[0]&&o.o.index()<o.cp&&o.cp++,o.or=o.np.find(" > ul > li:nth-child("+(o.cp+1)+")"),u=o,this.__callback(u),i&&i.call(this,u)},check_move:function(){var e=u,t=!0,n=e.r===-1?this.get_container():e.r;return!e||!e.o||e.or[0]===e.o[0]?!1:e.op&&e.np&&e.op[0]===e.np[0]&&e.cp-1===e.o.index()?!1:(e.o.each(function(){if(n.parentsUntil(".jstree","li").andSelf().index(this)!==-1)return t=!1,!1}),t)},move_node:function(e,t,n,i,s,o){if(!s)return this.prepare_move(e,t,n,function(e){this.move_node(e,!1,!1,i,!0,o)});i&&(u.cy=!0);if(!o&&!this.check_move())return!1;this.__rollback();var a=!1;i?(a=e.o.clone(!0),a.find("*[id]").andSelf().each(function(){this.id&&(this.id="copy_"+this.id)})):a=e.o,e.or.length?e.or.before(a):(e.np.children("ul").length||r("<ul />").appendTo(e.np),e.np.children("ul:eq(0)").append(a));try{e.ot.clean_node(e.op),e.rt.clean_node(e.np),e.op.find("> ul > li").length||e.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove()}catch(f){}return i&&(u.cy=!0,u.oc=a),this.__callback(u),u},_get_move:function(){return u}}})})(jQuery),function(e){var t,n,r;e(function(){/msie/.test(navigator.userAgent.toLowerCase())?(n=e('<textarea cols="10" rows="2"></textarea>').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),r=e('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({position:"absolute",top:-1e3,left:0}).appendTo("body"),t=n.width()-r.width(),n.add(r).remove()):(n=e("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:0}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200}),t=100-n.width(),n.parent().remove())}),e.jstree.plugin("ui",{__init:function(){this.data.ui.selected=e(),this.data.ui.last_selected=!1,this.data.ui.hovered=null,this.data.ui.to_select=this.get_settings().ui.initially_select,this.get_container().delegate("a","click.jstree",e.proxy(function(t){t.preventDefault(),t.currentTarget.blur(),e(t.currentTarget).hasClass("jstree-loading")||this.select_node(t.currentTarget,!0,t)},this)).delegate("a","mouseenter.jstree",e.proxy(function(t){e(t.currentTarget).hasClass("jstree-loading")||this.hover_node(t.target)},this)).delegate("a","mouseleave.jstree",e.proxy(function(t){e(t.currentTarget).hasClass("jstree-loading")||this.dehover_node(t.target)},this)).bind("reopen.jstree",e.proxy(function(){this.reselect()},this)).bind("get_rollback.jstree",e.proxy(function(){this.dehover_node(),this.save_selected()},this)).bind("set_rollback.jstree",e.proxy(function(){this.reselect()},this)).bind("close_node.jstree",e.proxy(function(t,n){var r=this._get_settings().ui,i=this._get_node(n.rslt.obj),s=i&&i.length?i.children("ul").find("a.jstree-clicked"):e(),o=this;if(r.selected_parent_close===!1||!s.length)return;s.each(function(){o.deselect_node(this),r.selected_parent_close==="select_parent"&&o.select_node(i)})},this)).bind("delete_node.jstree",e.proxy(function(e,t){var n=this._get_settings().ui.select_prev_on_delete,r=this._get_node(t.rslt.obj),i=r&&r.length?r.find("a.jstree-clicked"):[],s=this;i.each(function(){s.deselect_node(this)}),n&&i.length&&t.rslt.prev.each(function(){if(this.parentNode)return s.select_node(this),!1})},this)).bind("move_node.jstree",e.proxy(function(e,t){t.rslt.cy&&t.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked")},this))},defaults:{select_limit:-1,select_multiple_modifier:"ctrl",select_range_modifier:"shift",selected_parent_close:"select_parent",selected_parent_open:!0,select_prev_on_delete:!0,disable_selecting_children:!1,initially_select:[]},_fn:{_get_node:function(t,n){if(typeof t=="undefined"||t===null)return n?this.data.ui.selected:this.data.ui.last_selected;var r=e(t,this.get_container());return r.is(".jstree")||t==-1?-1:(r=r.closest("li",this.get_container()),r.length?r:!1)},_ui_notify:function(e,t){t.selected&&this.select_node(e,!1)},save_selected:function(){var e=this;this.data.ui.to_select=[],this.data.ui.selected.each(function(){this.id&&e.data.ui.to_select.push("#"+this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"))}),this.__callback(this.data.ui.to_select)},reselect:function(){var t=this,n=this.data.ui.to_select;n=e.map(e.makeArray(n),function(e){return"#"+e.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),e.each(n,function(e,n){n&&n!=="#"&&t.select_node(n)}),this.data.ui.selected=this.data.ui.selected.filter(function(){return this.parentNode}),this.__callback()},refresh:function(e){return this.save_selected(),this.__call_old()},hover_node:function(e){e=this._get_node(e);if(!e.length)return!1;e.hasClass("jstree-hovered")||this.dehover_node(),this.data.ui.hovered=e.children("a").addClass("jstree-hovered").parent(),this._fix_scroll(e),this.__callback({obj:e})},dehover_node:function(){var e=this.data.ui.hovered,t;if(!e||!e.length)return!1;t=e.children("a").removeClass("jstree-hovered").parent(),this.data.ui.hovered[0]===t[0]&&(this.data.ui.hovered=null),this.__callback({obj:e})},select_node:function(e,t,n){e=this._get_node(e);if(e==-1||!e||!e.length)return!1;var r=this._get_settings().ui,i=r.select_multiple_modifier=="on"||r.select_multiple_modifier!==!1&&n&&n[r.select_multiple_modifier+"Key"],s=r.select_range_modifier!==!1&&n&&n[r.select_range_modifier+"Key"]&&this.data.ui.last_selected&&this.data.ui.last_selected[0]!==e[0]&&this.data.ui.last_selected.parent()[0]===e.parent()[0],o=this.is_selected(e),u=!0,a=this;if(t){if(r.disable_selecting_children&&i&&(e.parentsUntil(".jstree","li").children("a.jstree-clicked").length||e.children("ul").find("a.jstree-clicked:eq(0)").length))return!1;u=!1;switch(!0){case s:this.data.ui.last_selected.addClass("jstree-last-selected"),e=e[e.index()<this.data.ui.last_selected.index()?"nextUntil":"prevUntil"](".jstree-last-selected").andSelf(),r.select_limit==-1||e.length<r.select_limit?(this.data.ui.last_selected.removeClass("jstree-last-selected"),this.data.ui.selected.each(function(){this!==a.data.ui.last_selected[0]&&a.deselect_node(this)}),o=!1,u=!0):u=!1;break;case o&&!i:this.deselect_all(),o=!1,u=!0;break;case!o&&!i:if(r.select_limit==-1||r.select_limit>0)this.deselect_all(),u=!0;break;case o&&i:this.deselect_node(e);break;case!o&&i:if(r.select_limit==-1||this.data.ui.selected.length+1<=r.select_limit)u=!0}}u&&!o&&(s||(this.data.ui.last_selected=e),e.children("a").addClass("jstree-clicked"),r.selected_parent_open&&e.parents(".jstree-closed").each(function(){a.open_node(this,!1,!0)}),this.data.ui.selected=this.data.ui.selected.add(e),this._fix_scroll(e.eq(0)),this.__callback({obj:e,e:n}))},_fix_scroll:function(e){var n=this.get_container()[0],r;if(n.scrollHeight>n.offsetHeight){e=this._get_node(e);if(!e||e===-1||!e.length||!e.is(":visible"))return;r=e.offset().top-this.get_container().offset().top,r<0&&(n.scrollTop=n.scrollTop+r-1),r+this.data.core.li_height+(n.scrollWidth>n.offsetWidth?t:0)>n.offsetHeight&&(n.scrollTop=n.scrollTop+(r-n.offsetHeight+this.data.core.li_height+1+(n.scrollWidth>n.offsetWidth?t:0)))}},deselect_node:function(e){e=this._get_node(e);if(!e.length)return!1;this.is_selected(e)&&(e.children("a").removeClass("jstree-clicked"),this.data.ui.selected=this.data.ui.selected.not(e),this.data.ui.last_selected.get(0)===e.get(0)&&(this.data.ui.last_selected=this.data.ui.selected.eq(0)),this.__callback({obj:e}))},toggle_select:function(e){e=this._get_node(e);if(!e.length)return!1;this.is_selected(e)?this.deselect_node(e):this.select_node(e)},is_selected:function(e){return this.data.ui.selected.index(this._get_node(e))>=0},get_selected:function(t){return t?e(t).find("a.jstree-clicked").parent():this.data.ui.selected},deselect_all:function(t){var n=t?e(t).find("a.jstree-clicked").parent():this.get_container().find("a.jstree-clicked").parent();n.children("a.jstree-clicked").removeClass("jstree-clicked"),this.data.ui.selected=e([]),this.data.ui.last_selected=!1,this.__callback({obj:n})}}}),e.jstree.defaults.plugins.push("ui")}(jQuery),function(e){var t=[];e.jstree._themes=!1,e.jstree.plugin("themes",{__init:function(){this.get_container().bind("init.jstree",e.proxy(function(){var e=this._get_settings().themes;this.data.themes.dots=e.dots,this.data.themes.icons=e.icons,this.set_theme(e.theme,e.url)},this)).bind("loaded.jstree",e.proxy(function(){this.data.themes.dots?this.show_dots():this.hide_dots(),this.data.themes.icons?this.show_icons():this.hide_icons()},this))},defaults:{theme:"default",url:!1,dots:!0,icons:!0},_fn:{set_theme:function(n,r){if(!n)return!1;r||(r=e.jstree._themes+n+"/style.css"),e.inArray(r,t)==-1&&(e.vakata.css.add_sheet({url:r}),t.push(r)),this.data.themes.theme!=n&&(this.get_container().removeClass("jstree-"+this.data.themes.theme),this.data.themes.theme=n),this.get_container().addClass("jstree-"+n),this.data.themes.dots?this.show_dots():this.hide_dots(),this.data.themes.icons?this.show_icons():this.hide_icons(),this.__callback()},get_theme:function(){return this.data.themes.theme},show_dots:function(){this.data.themes.dots=!0,this.get_container().children("ul").removeClass("jstree-no-dots")},hide_dots:function(){this.data.themes.dots=!1,this.get_container().children("ul").addClass("jstree-no-dots")},toggle_dots:function(){this.data.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this.data.themes.icons=!0,this.get_container().children("ul").removeClass("jstree-no-icons")},hide_icons:function(){this.data.themes.icons=!1,this.get_container().children("ul").addClass("jstree-no-icons")},toggle_icons:function(){this.data.themes.icons?this.hide_icons():this.show_icons()}}}),e(function(){e.jstree._themes===!1&&e("script").each(function(){if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/))return e.jstree._themes=this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/,"")+"themes/",!1}),e.jstree._themes===!1&&(e.jstree._themes="themes/")}),e.jstree.defaults.plugins.push("themes")}(jQuery),function(e){e.jstree.plugin("json_data",{__init:function(){var e=this._get_settings().json_data;e.progressive_unload&&this.get_container().bind("after_close.jstree",function(e,t){t.rslt.obj.children("ul").remove()})},defaults:{data:!1,ajax:!1,correct_state:!0,progressive_render:!1,progressive_unload:!1},_fn:{load_node:function(e,t,n){var r=this;this.load_node_json(e,function(){r.__callback({obj:r._get_node(e)}),t.call(this)},n)},_is_loaded:function(t){var n=this._get_settings().json_data;return t=this._get_node(t),t==-1||!t||!n.ajax&&!n.progressive_render&&!e.isFunction(n.data)||t.is(".jstree-open, .jstree-leaf")||t.children("ul").children("li").length>0},refresh:function(t){t=this._get_node(t);var n=this._get_settings().json_data;return t&&t!==-1&&n.progressive_unload&&(e.isFunction(n.data)||!!n.ajax)&&t.removeData("jstree-children"),this.__call_old()},load_node_json:function(t,n,r){var i=this.get_settings().json_data,s,o=function(){},u=function(){};t=this._get_node(t);if(t&&t!==-1&&(i.progressive_render||i.progressive_unload)&&!t.is(".jstree-open, .jstree-leaf")&&t.children("ul").children("li").length===0&&t.data("jstree-children")){s=this._parse_json(t.data("jstree-children"),t),s&&(t.append(s),i.progressive_unload||t.removeData("jstree-children")),this.clean_node(t),n&&n.call(this);return}if(t&&t!==-1){if(t.data("jstree-is-loading"))return;t.data("jstree-is-loading",!0)}switch(!0){case!i.data&&!i.ajax:throw"Neither data nor ajax settings supplied.";case e.isFunction(i.data):i.data.call(this,t,e.proxy(function(e){e=this._parse_json(e,t),e?(t===-1||!t?this.get_container().children("ul").empty().append(e.children()):(t.append(e).children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree-is-loading")),this.clean_node(t),n&&n.call(this)):(t===-1||!t?i.correct_state&&this.get_container().children("ul").empty():(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree-is-loading"),i.correct_state&&this.correct_state(t)),r&&r.call(this))},this));break;case!!i.data&&!i.ajax||!!i.data&&!!i.ajax&&(!t||t===-1):if(!t||t==-1)s=this._parse_json(i.data,t),s?(this.get_container().children("ul").empty().append(s.children()),this.clean_node()):i.correct_state&&this.get_container().children("ul").empty();n&&n.call(this);break;case!i.data&&!!i.ajax||!!i.data&&!!i.ajax&&t&&t!==-1:o=function(e,n,s){var o=this.get_settings().json_data.ajax.error;o&&o.call(this,e,n,s),t!=-1&&t.length?(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree-is-loading"),n==="success"&&i.correct_state&&this.correct_state(t)):n==="success"&&i.correct_state&&this.get_container().children("ul").empty(),r&&r.call(this)},u=function(r,s,u){var a=this.get_settings().json_data.ajax.success;a&&(r=a.call(this,r,s,u)||r);if(r===""||r&&r.toString&&r.toString().replace(/^[\s\n]+$/,"")===""||!e.isArray(r)&&!e.isPlainObject(r))return o.call(this,u,s,"");r=this._parse_json(r,t),r?(t===-1||!t?this.get_container().children("ul").empty().append(r.children()):(t.append(r).children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree-is-loading")),this.clean_node(t),n&&n.call(this)):t===-1||!t?i.correct_state&&(this.get_container().children("ul").empty(),n&&n.call(this)):(t.children("a.jstree-loading").removeClass("jstree-loading"),t.removeData("jstree-is-loading"),i.correct_state&&(this.correct_state(t),n&&n.call(this)))},i.ajax.context=this,i.ajax.error=o,i.ajax.success=u,i.ajax.dataType||(i.ajax.dataType="json"),e.isFunction(i.ajax.url)&&(i.ajax.url=i.ajax.url.call(this,t)),e.isFunction(i.ajax.data)&&(i.ajax.data=i.ajax.data.call(this,t)),e.ajax(i.ajax)}},_parse_json:function(t,n,r){var i=!1,s=this._get_settings(),o=s.json_data,u=s.core.html_titles,a,f,l,c,h;if(!t)return i;o.progressive_unload&&n&&n!==-1&&n.data("jstree-children",i);if(e.isArray(t)){i=e();if(!t.length)return!1;for(f=0,l=t.length;f<l;f++)a=this._parse_json(t[f],n,!0),a.length&&(i=i.add(a))}else{typeof t=="string"&&(t={data:t});if(!t.data&&t.data!=="")return i;i=e("<li />"),t.attr&&i.attr(t.attr),t.metadata&&i.data(t.metadata),t.state&&i.addClass("jstree-"+t.state),e.isArray(t.data)||(a=t.data,t.data=[],t.data.push(a)),e.each(t.data,function(n,r){a=e("<a />"),e.isFunction(r)&&(r=r.call(this,t)),typeof r=="string"?a.attr("href","#")[u?"html":"text"](r):(r.attr||(r.attr={}),r.attr.href||(r.attr.href="#"),a.attr(r.attr)[u?"html":"text"](r.title),r.language&&a.addClass(r.language)),a.prepend("<ins class='jstree-icon'>&#160;</ins>"),!r.icon&&t.icon&&(r.icon=t.icon),r.icon&&(r.icon.indexOf("/")===-1?a.children("ins").addClass(r.icon):a.children("ins").css("background","url('"+r.icon+"') center center no-repeat")),i.append(a)}),i.prepend("<ins class='jstree-icon'>&#160;</ins>"),t.children&&(o.progressive_render&&t.state!=="open"?i.addClass("jstree-closed").data("jstree-children",t.children):(o.progressive_unload&&i.data("jstree-children",t.children),e.isArray(t.children)&&t.children.length&&(a=this._parse_json(t.children,n,!0),a.length&&(h=e("<ul />"),h.append(a),i.append(h)))))}return r||(c=e("<ul />"),c.append(i),i=c),i},get_json:function(t,n,r,i){var s=[],o=this._get_settings(),u=this,a,f,l,c,h,p;t=this._get_node(t);if(!t||t===-1)t=this.get_container().find("> ul > li");return n=e.isArray(n)?n:["id","class"],!i&&this.data.types&&n.push(o.types.type_attr),r=e.isArray(r)?r:[],t.each(function(){l=e(this),a={data:[]},n.length&&(a.attr={}),e.each(n,function(e,t){f=l.attr(t),f&&f.length&&f.replace(/jstree[^ ]*/ig,"").length&&(a.attr[t]=(" "+f).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,""))}),l.hasClass("jstree-open")&&(a.state="open"),l.hasClass("jstree-closed")&&(a.state="closed"),l.data()&&(a.metadata=l.data()),c=l.children("a"),c.each(function(){h=e(this),r.length||e.inArray("languages",o.plugins)!==-1||h.children("ins").get(0).style.backgroundImage.length||h.children("ins").get(0).className&&h.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").length?(p=!1,e.inArray("languages",o.plugins)!==-1&&e.isArray(o.languages)&&o.languages.length&&e.each(o.languages,function(e,t){if(h.hasClass(t))return p=t,!1}),f={attr:{},title:u.get_text(h,p)},e.each(r,function(e,t){f.attr[t]=(" "+(h.attr(t)||"")).replace(/ jstree[^ ]*/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")}),e.inArray("languages",o.plugins)!==-1&&e.isArray(o.languages)&&o.languages.length&&e.each(o.languages,function(e,t){if(h.hasClass(t))return f.language=t,!0}),h.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/^\s+$/ig,"").length&&(f.icon=h.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,"").replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")),h.children("ins").get(0).style.backgroundImage.length&&(f.icon=h.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")",""))):f=u.get_text(h),c.length>1?a.data.push(f):a.data=f}),l=l.find("> ul > li"),l.length&&(a.children=u.get_json(l,n,r,!0)),s.push(a)}),s}}})}(jQuery),function(e){e.jstree.plugin("checkbox",{__init:function(){this.data.checkbox.noui=this._get_settings().checkbox.override_ui,this.data.ui&&this.data.checkbox.noui&&(this.select_node=this.deselect_node=this.deselect_all=e.noop,this.get_selected=this.get_checked),this.get_container().bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree",e.proxy(function(e,t){this._prepare_checkboxes(t.rslt.obj)},this)).bind("loaded.jstree",e.proxy(function(e){this._prepare_checkboxes()},this)).delegate(this.data.ui&&this.data.checkbox.noui?"a":"ins.jstree-checkbox","click.jstree",e.proxy(function(e){e.preventDefault(),this._get_node(e.target).hasClass("jstree-checked")?this.uncheck_node(e.target):this.check_node(e.target);if(!this.data.ui||!this.data.checkbox.noui)return e.stopImmediatePropagation(),!1;this.save_selected(),this.data.cookies&&this.save_cookie("select_node")},this))},defaults:{override_ui:!1,two_state:!1,real_checkboxes:!1,checked_parent_open:!0,real_checkboxes_names:function(e){return["check_"+(e[0].id||Math.ceil(Math.random()*1e4)),1]}},__destroy:function(){this.get_container().find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end().find("ins.jstree-checkbox").remove()},_fn:{_checkbox_notify:function(e,t){t.checked&&this.check_node(e,!1)},_prepare_checkboxes:function(t){t=!t||t==-1?this.get_container().find("> ul > li"):this._get_node(t);if(t===!1)return;var n,r=this,i,s=this._get_settings().checkbox.two_state,o=this._get_settings().checkbox.real_checkboxes,u=this._get_settings().checkbox.real_checkboxes_names;t.each(function(){i=e(this),n=i.is("li")&&(i.hasClass("jstree-checked")||o&&i.children(":checked").length)?"jstree-checked":"jstree-unchecked",i.find("li").andSelf().each(function(){var t=e(this),i;t.children("a"+(r.data.languages?"":":eq(0)")).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass(s?"jstree-unchecked":n),o&&(t.children(":checkbox").length?t.children(":checkbox").addClass("jstree-real-checkbox"):(i=u.call(r,t),t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='"+i[0]+"' name='"+i[0]+"' value='"+i[1]+"' />")),n==="jstree-checked"&&t.children(":checkbox").attr("checked","checked")),n==="jstree-checked"&&!s&&t.find("li").addClass("jstree-checked")})}),s||(t.length===1&&t.is("li")&&this._repair_state(t),t.is("li")?t.each(function(){r._repair_state(this)}):t.find("> ul > li").each(function(){r._repair_state(this)}),t.find(".jstree-checked").parent().parent().each(function(){r._repair_state(this)}))},change_state:function(t,n){t=this._get_node(t);var r=!1,i=this._get_settings().checkbox.real_checkboxes;if(!t||t===-1)return!1;n=n===!1||n===!0?n:t.hasClass("jstree-checked");if(this._get_settings().checkbox.two_state)n?(t.removeClass("jstree-checked").addClass("jstree-unchecked"),i&&t.children(":checkbox").removeAttr("checked")):(t.removeClass("jstree-unchecked").addClass("jstree-checked"),i&&t.children(":checkbox").attr("checked","checked"));else{if(n){r=t.find("li").andSelf();if(!r.filter(".jstree-checked, .jstree-undetermined").length)return!1;r.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),i&&r.children(":checkbox").removeAttr("checked")}else{r=t.find("li").andSelf();if(!r.filter(".jstree-unchecked, .jstree-undetermined").length)return!1;r.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),i&&r.children(":checkbox").attr("checked","checked"),this.data.ui&&(this.data.ui.last_selected=t),this.data.checkbox.last_selected=t}t.parentsUntil(".jstree","li").each(function(){var t=e(this);if(n){if(t.children("ul").children("li.jstree-checked, li.jstree-undetermined").length)return t.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),i&&t.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked"),!1;t.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"),i&&t.children(":checkbox").removeAttr("checked")}else{if(t.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length)return t.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),i&&t.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked"),!1;t.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"),i&&t.children(":checkbox").attr("checked","checked")}})}return this.data.ui&&this.data.checkbox.noui&&(this.data.ui.selected=this.get_checked()),this.__callback(t),!0},check_node:function(e){if(this.change_state(e,!1)){e=this._get_node(e);if(this._get_settings().checkbox.checked_parent_open){var t=this;e.parents(".jstree-closed").each(function(){t.open_node(this,!1,!0)})}this.__callback({obj:e})}},uncheck_node:function(e){this.change_state(e,!0)&&this.__callback({obj:this._get_node(e)})},check_all:function(){var e=this,t=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");t.each(function(){e.change_state(this,!1)}),this.__callback()},uncheck_all:function(){var e=this,t=this._get_settings().checkbox.two_state?this.get_container_ul().find("li"):this.get_container_ul().children("li");t.each(function(){e.change_state(this,!0)}),this.__callback()},is_checked:function(e){return e=this._get_node(e),e.length?e.is(".jstree-checked"):!1},get_checked:function(e,t){return e=!e||e===-1?this.get_container():this._get_node(e),t||this._get_settings().checkbox.two_state?e.find(".jstree-checked"):e.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked")},get_unchecked:function(e,t){return e=!e||e===-1?this.get_container():this._get_node(e),t||this._get_settings().checkbox.two_state?e.find(".jstree-unchecked"):e.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked")},show_checkboxes:function(){this.get_container().children("ul").removeClass("jstree-no-checkboxes")},hide_checkboxes:function(){this.get_container().children("ul").addClass("jstree-no-checkboxes")},_repair_state:function(e){e=this._get_node(e);if(!e.length)return;var t=this._get_settings().checkbox.real_checkboxes,n=e.find("> ul > .jstree-checked").length,r=e.find("> ul > .jstree-undetermined").length,i=e.find("> ul > li").length;i===0?e.hasClass("jstree-undetermined")&&this.change_state(e,!1):n===0&&r===0?this.change_state(e,!0):n===i?this.change_state(e,!1):(e.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"),t&&e.parentsUntil(".jstree","li").andSelf().children(":checkbox").removeAttr("checked"))},reselect:function(){if(this.data.ui&&this.data.checkbox.noui){var t=this,n=this.data.ui.to_select;n=e.map(e.makeArray(n),function(e){return"#"+e.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")}),this.deselect_all(),e.each(n,function(e,n){t.check_node(n)}),this.__callback()}else this.__call_old()},save_loaded:function(){var e=this;this.data.core.to_load=[],this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function(){this.id&&e.data.core.to_load.push("#"+this.id)})}}}),e(function(){var t=".jstree .jstree-real-checkbox { display:none; } ";e.vakata.css.add_sheet({str:t,title:"jstree"})})}(jQuery),function(t){t.jstree.plugin("types",{__init:function(){var n=this._get_settings().types;this.data.types.attach_to=[],this.get_container().bind("init.jstree",t.proxy(function(){var e=n.types,r=n.type_attr,i="",o=this;t.each(e,function(e,n){t.each(n,function(e,t){/^(max_depth|max_children|icon|valid_children)$/.test(e)||o.data.types.attach_to.push(e)});if(!n.icon)return!0;if(n.icon.image||n.icon.position)e=="default"?i+=".jstree-"+o.get_index()+" a > .jstree-icon { ":i+=".jstree-"+o.get_index()+" li["+r+'="'+e+'"] > a > .jstree-icon { ',n.icon.image&&(i+=" background-image:url("+n.icon.image+"); "),n.icon.position?i+=" background-position:"+n.icon.position+"; ":i+=" background-position:0 0; ",i+="} "}),i!==""&&t.vakata.css.add_sheet({str:i,title:"jstree-types"})},this)).bind("before.jstree",t.proxy(function(e,n){var r,i,s=this._get_settings().types.use_data?this._get_node(n.args[0]):!1,o=s&&s!==-1&&s.length?s.data("jstree"):!1;if(o&&o.types&&o.types[n.func]===!1)return e.stopImmediatePropagation(),!1;if(t.inArray(n.func,this.data.types.attach_to)!==-1){if(!n.args[0]||!n.args[0].tagName&&!n.args[0].jquery)return;r=this._get_settings().types.types,i=this._get_type(n.args[0]);if((r[i]&&typeof r[i][n.func]!="undefined"||r["default"]&&typeof r["default"][n.func]!="undefined")&&this._check(n.func,n.args[0])===!1)return e.stopImmediatePropagation(),!1}},this)),e&&this.get_container().bind("load_node.jstree set_type.jstree",t.proxy(function(e,n){var r=n&&n.rslt&&n.rslt.obj&&n.rslt.obj!==-1?this._get_node(n.rslt.obj).parent():this.get_container_ul(),i=!1,s=this._get_settings().types;t.each(s.types,function(e,t){t.icon&&(t.icon.image||t.icon.position)&&(i=e==="default"?r.find("li > a > .jstree-icon"):r.find("li["+s.type_attr+"='"+e+"'] > a > .jstree-icon"),t.icon.image&&i.css("backgroundImage","url("+t.icon.image+")"),i.css("backgroundPosition",t.icon.position||"0 0"))})},this))},defaults:{max_children:-1,max_depth:-1,valid_children:"all",use_data:!1,type_attr:"rel",types:{"default":{max_children:-1,max_depth:-1,valid_children:"all"}}},_fn:{_types_notify:function(e,t){t.type&&this._get_settings().types.use_data&&this.set_type(t.type,e)},_get_type:function(e){return e=this._get_node(e),!e||!e.length?!1:e.attr(this._get_settings().types.type_attr)||"default"},set_type:function(e,t){t=this._get_node(t);var n=!t.length||!e?!1:t.attr(this._get_settings().types.type_attr,e);return n&&this.__callback({obj:t,type:e}),n},_check:function(e,n,r){n=this._get_node(n);var i=!1,s=this._get_type(n),o=0,u=this,a=this._get_settings().types,f=!1;if(n===-1){if(!a[e])return;i=a[e]}else{if(s===!1)return;f=a.use_data?n.data("jstree"):!1,f&&f.types&&typeof f.types[e]!="undefined"?i=f.types[e]:!a.types[s]||typeof a.types[s][e]=="undefined"?!!a.types["default"]&&typeof a.types["default"][e]!="undefined"&&(i=a.types["default"][e]):i=a.types[s][e]}return t.isFunction(i)&&(i=i.call(this,n)),e==="max_depth"&&n!==-1&&r!==!1&&a.max_depth!==-2&&i!==0&&n.children("a:eq(0)").parentsUntil(".jstree","li").each(function(t){if(a.max_depth!==-1&&a.max_depth-(t+1)<=0)return i=0,!1;o=t===0?i:u._check(e,this,!1);if(o!==-1&&o-(t+1)<=0)return i=0,!1;o>=0&&(o-(t+1)<i||i<0)&&(i=o-(t+1)),a.max_depth>=0&&(a.max_depth-(t+1)<i||i<0)&&(i=a.max_depth-(t+1))}),i},check_move:function(){if(!this.__call_old())return!1;var e=this._get_move(),n=e.rt._get_settings().types,r=e.rt._check("max_children",e.cr),i=e.rt._check("max_depth",e.cr),s=e.rt._check("valid_children",e.cr),o=0,u=1,a;if(s==="none")return!1;if(t.isArray(s)&&e.ot&&e.ot._get_type){e.o.each(function(){if(t.inArray(e.ot._get_type(this),s)===-1)return u=!1,!1});if(u===!1)return!1}if(n.max_children!==-2&&r!==-1){o=e.cr===-1?this.get_container().find("> ul > li").not(e.o).length:e.cr.find("> ul > li").not(e.o).length;if(o+e.o.length>r)return!1}if(n.max_depth!==-2&&i!==-1){u=0;if(i===0)return!1;if(typeof e.o.d=="undefined"){a=e.o;while(a.length>0)a=a.find("> ul > li"),u++;e.o.d=u}if(i-e.o.d<0)return!1}return!0},create_node:function(e,n,r,i,s,o){if(!o&&(s||this._is_loaded(e))){var u=typeof n=="string"&&n.match(/^before|after$/i)&&e!==-1?this._get_parent(e):this._get_node(e),a=this._get_settings().types,f=this._check("max_children",u),l=this._check("max_depth",u),c=this._check("valid_children",u),h;typeof r=="string"&&(r={data:r}),r||(r={});if(c==="none")return!1;if(t.isArray(c))if(!r.attr||!r.attr[a.type_attr])r.attr||(r.attr={}),r.attr[a.type_attr]=c[0];else if(t.inArray(r.attr[a.type_attr],c)===-1)return!1;if(a.max_children!==-2&&f!==-1){h=u===-1?this.get_container().find("> ul > li").length:u.find("> ul > li").length;if(h+1>f)return!1}if(a.max_depth!==-2&&l!==-1&&l-1<0)return!1}return this.__call_old(!0,e,n,r,i,s,o)}}})}(jQuery)}(),define("jstree",function(){}),define("file-tree",["jquery","jstree","underscore","backbone","common"],function(t,n,r,i,s){t.jstree._themes=app.config.mediaUrl+"js/themes/";var o={options:{},formatRepoData:function(e){var t=[],n;for(var r=0,i=e.length;r<i;r++)n={data:e[r].name,attr:{repo_id:e[r].id,root_node:!0},state:"closed"},t.push(n);return t},renderFileTree:function(n,r,i){var s=i||{};n.delegate(".jstree-closed","dblclick",function(e){n.jstree("open_node",t(this)),t(this).find("a").removeClass("jstree-clicked")}).bind("select_node.jstree",function(e,n){t(".jstree-clicked").removeClass("jstree-clicked")}).jstree({json_data:{data:r,ajax:{url:function(t){var n=this.get_path(t),r;if(n.length==1)n="/",r=t.attr("repo_id");else{var i=t.parents("[root_node=true]");r=i.attr("repo_id"),n.shift(),n="/"+n.join("/")+"/"}return app.config.siteRoot+"ajax/repo/"+r+"/dirents/?path="+e(n)},success:function(e){var t=[],n,r;for(var i=0,s=e.length;i<s;i++)n=e[i],n.type=="dir"?r={data:n.name,attr:{type:n.type},state:"closed"}:r={data:n.name,attr:{type:n.type}},t.push(r);return t}}},core:{animation:100},themes:{theme:"classic"},checkbox:{two_state:s.two_state,real_checkboxes:!0,real_checkboxes_names:function(e){var t=this.get_path(e),n,r;return t.length==1?(r="/",n=e.attr("repo_id")):(t.shift(),n=e.parents("[root_node=true]").attr("repo_id"),e.attr("type")=="dir"?r="/"+t.join("/")+"/":r="/"+t.join("/")),["selected",n+r]}},plugins:["themes","json_data","ui","checkbox"]})},renderDirTree:function(e,n,r){e.delegate(".jstree-closed","dblclick",function(n){e.jstree("open_node",t(this)),t(this).find("a").removeClass("jstree-clicked")}).bind("before.jstree",function(e,r){r.func==="select_node"&&t(".jstree-clicked",n).removeClass("jstree-clicked")}).bind("select_node.jstree",function(e,r){var i,s,o=r.inst.get_path(r.rslt.obj);o.length==1?(i="/",s=r.rslt.obj.attr("repo_id")):(s=r.rslt.obj.parents("[root_node=true]").attr("repo_id"),o.shift(),i="/"+o.join("/")+"/"),t('input[name="dst_repo"]',n).val(s),t('input[name="dst_path"]',n).val(i)}).jstree({json_data:{data:r,ajax:{url:function(e){var t=this.get_path(e),n;return t.length==1?(t="/",n=e.attr("repo_id")):(n=e.parents("[root_node=true]").attr("repo_id"),t.shift(),t="/"+t.join("/")+"/"),app.config.siteRoot+"ajax/repo/"+n+"/dirents/?dir_only=true&path="+encodeURIComponent(t)},success:function(e){var t=[],n,r;for(var i=0,s=e.length;i<s;i++)n=e[i],n.has_subdir?r={data:n.name,attr:{type:n.type},state:"closed"}:r={data:n.name,attr:{type:n.type}},t.push(r);return t}}},core:{animation:100},plugins:["themes","json_data","ui"]})},renderTreeForPath:function(e){var n=e.$form,r=e.$container,i=e.repo_name,o=e.repo_id,u=e.path;u!="/"&&(u+="/");var a=this;t.ajax({url:s.getUrl({name:"get_dirents",repo_id:e.repo_id})+"?path="+encodeURIComponent(u)+"&dir_only=true&all_dir=true",cache:!1,dataType:"json",success:function(e){var s=[],f={data:i,attr:{repo_id:o,root_node:!0},state:"open"},l=u.split("/");l.pop();var c=e.length,h=[];for(var p=c-1;p>-1;p--){h[p]=[];if(p==c-1)for(var d=0,v=e[p].length;d<v;d++)h[p].push({data:e[p][d],state:"closed"});else for(var d=0,v=e[p].length;d<v;d++)e[p][d]==l[p+1]?h[p].push({data:e[p][d],state:"open",children:h[p+1]}):h[p].push({data:e[p][d],state:"closed"})}h[0].length>0&&t.extend(f,{children:h[0]}),s.push(f),a.renderDirTree(r,n,s),r.removeClass("hide")},error:function(){var e=[{data:i,attr:{repo_id:o,root_node:!0},state:"closed"}];a.renderDirTree(r,n,e),r.removeClass("hide")}})},prepareOtherReposTree:function(e){var n=this;t("#mv-dir-list #other-repos .hd").click(function(){var r=t("span",t(this)),i=t("#mv-form"),o=t(this).next(),u=t("#mv-dir-list #other-repos #other-repos-dirs");r.hasClass("icon-caret-right")?(r.attr("class","icon-caret-down"),o.show(),t.ajax({url:s.getUrl({name:"unenc_rw_repos"}),cache:!1,dataType:"json",success:function(t){var r=[],s=e.cur_repo_id;for(var a=0,f=t.length;a<f;a++)t[a].id!=s&&r.push({data:t[a].name,attr:{repo_id:t[a].id,root_node:!0},state:"closed"});o.hide(),n.renderDirTree(u,i,r),u.removeClass("hide")}})):(r.attr("class","icon-caret-right"),u.addClass("hide"))})}};return o}),define("app/collections/repo-user-folder-perm",["underscore","backbone","common"],function(e,t,n){var r=t.Collection.extend({initialize:function(e){this.repo_id=e.repo_id},url:function(){return n.getUrl({name:"repo_user_folder_perm",repo_id:this.repo_id})}});return r}),define("app/collections/repo-group-folder-perm",["underscore","backbone","common"],function(e,t,n){var r=t.Collection.extend({initialize:function(e){this.repo_id=e.repo_id},url:function(){return n.getUrl({name:"repo_group_folder_perm",repo_id:this.repo_id})}});return r}),define("app/views/repo-folder-perm",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({tagName:"tr",template:t.template(e("#repo-folder-perm-item-tmpl").html()),events:{mouseenter:"highlight",mouseleave:"rmHighlight","click .edit-icon":"showEdit","change .perm-toggle-select":"edit","click .rm":"rm"},initialize:function(t){this.data={},e.extend(this.data,t),this.listenTo(this.model,"change",this.render)},render:function(){var t={};return e.extend(t,this.model.attributes,{perm_type:this.data.perm_type,repo_id:this.data.repo_id,encoded_path:r.encodePath(this.model.get("folder_path"))}),this.$el.html(this.template(t)),this},highlight:function(){this.$el.addClass("hl").find(".op-icon").removeClass("vh")},rmHighlight:function(){this.$el.removeClass("hl").find(".op-icon").addClass("vh")},showEdit:function(t){var n=e(t.currentTarget).closest("td");return e(".cur-perm, .edit-icon",n).hide(),e(".perm-toggle-select",n).show(),!1},edit:function(t){var n=r.getUrl({name:this.data.perm_type=="user"?"repo_user_folder_perm":"repo_group_folder_perm",repo_id:this.data.repo_id}),i=e(t.currentTarget).val(),s={folder_path:this.model.get("folder_path"),permission:i};this.data.perm_type=="user"?e.extend(s,{user_email:this.model.get("user_email")}):e.extend(s,{group_id:this.model.get("group_id")});var o=this;e.ajax({url:n,type:"put",dataType:"json",beforeSend:r.prepareCSRFToken,data:s,success:function(){o.model.set({permission:i})},error:function(t){var n;t.responseText?n=e.parseJSON(response.responseText).error_msg:n=gettext("Please check the network."),o.data.$error.html(n).show()}})},rm:function(){var t=r.getUrl({name:this.data.perm_type=="user"?"repo_user_folder_perm":"repo_group_folder_perm",repo_id:this.data.repo_id}),n={folder_path:this.model.get("folder_path")};this.data.perm_type=="user"?e.extend(n,{user_email:this.model.get("user_email")}):e.extend(n,{group_id:this.model.get("group_id")});var i=this;return e.ajax({url:t,type:"delete",dataType:"json",beforeSend:r.prepareCSRFToken,data:n,success:function(){i.remove()},error:function(t){var n;t.responseText?n=e.parseJSON(response.responseText).error_msg:n=gettext("Please check the network."),i.data.$error.html(n).show()}}),!1}});return i}),define("app/views/dialogs/repo-folder-perm-admin",["jquery","underscore","backbone","common","file-tree","app/collections/repo-user-folder-perm","app/collections/repo-group-folder-perm","app/views/repo-folder-perm"],function(e,t,n,r,i,s,o,u){var a=n.View.extend({id:"repo-folder-perm-popup",template:t.template(e("#repo-folder-perm-admin-dialog-tmpl").html()),initialize:function(t){this.repo_name=t.repo_name,this.repo_id=t.repo_id,this.render(),this.$(".op-target").css({"max-width":280}),this.$el.modal({focus:!1,onClose:function(){e(document).off("click",r),e.modal.close()}}),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.$(".js-tabs").tabs(),this.userPerm=new s({repo_id:this.repo_id}),this.userPerm.perm_type="user",this.$userPermPanel=this.$("#js-repo-user-folder-perm .js-folder-perm-content"),this.groupPerm=new o({repo_id:this.repo_id}),this.groupPerm.perm_type="group",this.$groupPermPanel=this.$("#js-repo-group-folder-perm .js-folder-perm-content"),this.renderPanel({collection:this.userPerm,$panel:this.$userPermPanel}),this.renderPanel({collection:this.groupPerm,$panel:this.$groupPermPanel});var n=this,r=function(e){var t=e.target||event.srcElement,r=n.$(".perm-toggle-select:visible"),i=r.parent();r.length&&!r.is(t)&&!r.find("*").is(t)&&!i.find(".edit-icon").is(t)&&(r.hide(),i.find(".cur-perm, .edit-icon").show())};e(document).click(r)},render:function(){return this.$el.html(this.template({title:gettext("{placeholder} Folder Permission").replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+r.HTMLescape(this.repo_name)+'">'+r.HTMLescape(this.repo_name)+"</span>")})),this},renderPanel:function(t){var n=t.collection,i=t.$panel,s=e(".loading-tip",i),o=e(".error",i);if(n.perm_type=="user")e('[name="emails"]',i).select2(e.extend(r.contactInputOptionsForSelect2(),{placeholder:gettext("Search user or enter email and press Enter"),maximumSelectionSize:1,formatSelectionTooBig:gettext("You can only select 1 item")}));else{var u=app.pageOptions.groups||[],a="";for(var f=0,l=u.length;f<l;f++)a+='<option value="'+u[f].id+'" data-index="'+f+'">'+u[f].name+"</option>";e('[name="groups"]',i).html(a).select2({placeholder:gettext("Select a group"),maximumSelectionSize:1,formatSelectionTooBig:gettext("You can only select 1 item"),escapeMarkup:function(e){return e}})}this.listenTo(n,"add",this.addItem),n.fetch({cache:!1,success:function(e,t,n){s.hide()},error:function(t,n,r){s.hide();var i;n.responseText?n["status"]==401||n["status"]==403?i=gettext("Permission error"):i=e.parseJSON(n.responseText).error_msg:i=gettext("Please check the network."),o.html(i).show()}})},addItem:function(t,n,r){var i=n.perm_type,s=i=="user"?this.$userPermPanel:this.$groupPermPanel,o=new u({model:t,repo_id:this.repo_id,perm_type:i,$error:e(".error",s)});r.prepend?e('[name="folder_path"]',s).closest("tr").after(o.render().el):e("tbody",s).append(o.render().el)},events:{"click .js-add-folder":"showFolderSelectForm","click .js-folder-select-submit":"addFolder","click .js-folder-select-cancel":"cancelFolderSelect","click .js-user-perm-add-submit":"addUserPerm","click .js-group-perm-add-submit":"addGroupPerm"},showFolderSelectForm:function(t){var n=e(t.currentTarget),r=n.closest(".js-folder-perm-content").slideUp(),s=e(".js-folder-select-form",r.parent()).slideDown(),o=e(".js-jtree-container",s);i.renderTreeForPath({$form:s,$container:o,repo_id:this.repo_id,repo_name:this.repo_name,path:"/"})},addFolder:function(t){var n=e(t.currentTarget),r=n.closest("form"),i=e("[name=dst_path]",r).val();if(!i)return e(".error",r).html(gettext("Please click and choose a directory.")).removeClass("hide"),!1;r.slideUp(),e.jstree._reference(e(".js-jtree-container",r)).destroy();var s=e(".js-folder-perm-content",r.parent()).slideDown();return e("[name=folder_path]",s).val(i),!1},cancelFolderSelect:function(t){var n=e(t.currentTarget),r=n.closest("form").slideUp();e.jstree._reference(e(".js-jtree-container",r)).destroy(),e(".js-folder-perm-content",r.parent()).slideDown()},addUserPerm:function(t){var n=this.$userPermPanel,i=e(".error",n),s=e('[name="emails"]',n),o=e('[name="folder_path"]',n),u=s.val(),a=o.val();if(!u||!a)return!1;var f=e('[name="permission"]',n),l=f.val(),c=e(t.currentTarget);r.disableButton(c),this.userPerm.create({user_email:u,folder_path:a,permission:l},{wait:!0,prepend:!0,success:function(){s.select2("val",""),o.val(""),e('[value="rw"]',f).attr("selected","selected"),e('[value="r"]',f).removeAttr("selected"),i.addClass("hide")},error:function(e,t,n){var r;t.responseText?r=t.responseJSON.error_msg:r=gettext("Please check the network."),i.html(r).removeClass("hide")},complete:function(){r.enableButton(c)}})},addGroupPerm:function(t){var n=this.$groupPermPanel,i=e(".error",n),s=e('[name="groups"]',n),o=e('[name="folder_path"]',n),u=s.val(),a=o.val();if(!u||!a)return!1;var f=e('[name="permission"]',n),l=f.val(),c=e(t.currentTarget);r.disableButton(c),this.groupPerm.create({group_id:u[0],folder_path:a,permission:l},{wait:!0,prepend:!0,success:function(){s.select2("val",""),o.val(""),e('[value="rw"]',f).attr("selected","selected"),e('[value="r"]',f).removeAttr("selected"),i.addClass("hide")},error:function(e,t,n){var r;t.responseText?r=t.responseJSON.error_msg:r=gettext("Please check the network."),i.html(r).removeClass("hide")},complete:function(){r.enableButton(c)}})}});return a}),define("app/views/widgets/hl-item-view",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.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(){if(app.ui.currentDropdown||app.ui.freezeItemHightlight)return;app.ui.currentHighlightedItem=this,this.$el.addClass("hl").find(this.hiddenOperationClass).removeClass("vh")},rmHighlight:function(){if(app.ui.currentDropdown||app.ui.freezeItemHightlight)return;app.ui.currentHighlightedItem=null,this.$el.removeClass("hl").find(this.hiddenOperationClass).addClass("vh")}});return i}),define("app/views/widgets/dropdown",["jquery","underscore","backbone","common"],function(e,t,n,r){e(document).click(function(e){var t=app.ui.currentDropdown,n=e.target||event.srcElement;return t?(!t.$(".sf-dropdown-menu").is(n)&&!t.$(".sf-dropdown-menu").find("*").is(n)&&(t.hide(),app.ui.currentHighlightedItem&&app.ui.currentHighlightedItem.rmHighlight()),!0):!0}),e(document).keydown(function(e){if(e.keyCode==27){var t=app.ui.currentDropdown;t&&(t.hide(),app.ui.currentHighlightedItem&&app.ui.currentHighlightedItem.rmHighlight())}});var i=n.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"),n=this.$(".sf-dropdown-menu");app.ui.currentDropdown=this,this.options.right?n.css("right",this.options.right):n.css("left",this.options.left),t.offset().top+t.outerHeight(!0)+n.outerHeight(!0)>e(window).scrollTop()+e(window).height()&&n.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))return;t.preventDefault(),t.stopPropagation();var n=e.makeArray(this.$el.find("li a"));if(!n.length)return;var r=n.indexOf(t.target);t.which===38&&r>0&&r--,t.which===40&&r<n.length-1&&r++,n[r].focus()}});return i}),define("app/views/repo",["jquery","underscore","backbone","common","app/views/share","app/views/dialogs/repo-change-password","app/views/dialogs/repo-history-settings","app/views/dialogs/repo-share-link-admin","app/views/dialogs/repo-folder-perm-admin","app/views/widgets/hl-item-view","app/views/widgets/dropdown"],function(e,t,n,r,i,s,o,u,a,f,l){var c=f.extend({tagName:"tr",template:t.template(e("#repo-tmpl").html()),renameTemplate:t.template(e("#repo-rename-form-template").html()),transferTemplate:t.template(e("#repo-transfer-form-tmpl").html()),events:{"click .repo-delete-btn":"del","click .repo-share-btn":"share","click .js-repo-rename":"rename","click .js-repo-transfer":"transfer","click .js-repo-change-password":"changePassword","click .js-popup-history-setting":"popupHistorySetting","click .js-popup-share-link-admin":"popupShareLinkAdmin","click .js-popup-folder-perm-admin":"popupFolderPermAdmin"},initialize:function(){f.prototype.initialize.call(this),this.listenTo(this.model,"change",this.render)},render:function(){var e=this.model.toJSON(),n=r.isHiDPI()?96:24,i=this.model.getIconUrl(n);return t.extend(e,{icon_url:i,icon_title:this.model.getIconTitle(),can_generate_share_link:app.pageOptions.can_generate_share_link,can_generate_upload_link:app.pageOptions.can_generate_upload_link}),this.$el.html(this.template(e)),this.dropdown=new l({el:this.$(".sf-dropdown")}),this},del:function(){var t=this,n=this.model.get("name"),i=gettext("Delete Library"),s=gettext("Are you sure you want to delete %s ?").replace("%s",'<span class="op-target ellipsis ellipsis-op-target">'+r.HTMLescape(n)+"</span>"),o=function(){e.ajax({url:r.getUrl({name:"repo",repo_id:t.model.get("id")}),type:"DELETE",cache:!1,dataType:"json",beforeSend:r.prepareCSRFToken,success:function(){t.$el.remove(),r.feedback(gettext("Successfully deleted."),"success")},error:function(e,t,n){r.ajaxErrorHandler(e,t,n)},complete:function(){e.modal.close()}})};return r.showConfirm(i,s,o),this.togglePopup(),!1},share:function(){var e={is_repo_owner:!0,is_virtual:this.model.get("virtual"),user_perm:"rw",repo_id:this.model.get("id"),repo_encrypted:this.model.get("encrypted"),is_dir:!0,dirent_path:"/",obj_name:this.model.get("name")};return new i(e),!1},togglePopup:function(){this.dropdown.hide()},rename:function(){var t=this.model.get("name"),n=e(this.renameTemplate({repo_name:t})),i=this.$(".repo-name-span"),s=this.$(".repo-op-td"),o=i.closest("td");o.attr("colspan",2).css({width:i.width()+s.outerWidth(),height:i.height()}).append(n),s.hide(),i.hide(),e('[name="newname"]',n).select(),this.togglePopup(),app.ui.freezeItemHightlight=!0;var u=function(){return app.ui.freezeItemHightlight=!1,n.remove(),s.show(),i.show(),o.attr("colspan",1).css({width:i.width()}),!1};e(".cancel",n).click(u);var a=n.attr("id"),f=this;return n.submit(function(){var i=e.trim(e('[name="newname"]',n).val());if(!i)return!1;if(i==t)return u(),!1;var s={repo_name:i},o=r.getUrl({name:"repo",repo_id:f.model.get("id")})+"?op=rename",a=function(e){app.ui.freezeItemHightlight=!1,f.model.set({name:i})},l=function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),r.feedback(n,"error"),r.enableButton(c)},c=e('[type="submit"]',n);return r.disableButton(c),e.ajax({url:o,type:"POST",dataType:"json",beforeSend:r.prepareCSRFToken,data:s,success:a,error:l}),!1}),!1},transfer:function(){var t=this;this.togglePopup();var n=this.model.get("name"),i=e(this.transferTemplate({title:gettext("Transfer Library {library_name} To").replace("{library_name}",'<span class="op-target ellipsis ellipsis-op-target" title="'+r.HTMLescape(n)+'">'+r.HTMLescape(n)+"</span>")}));i.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),e('[name="email"]',i).select2(e.extend(r.contactInputOptionsForSelect2(),{width:"300px",maximumSelectionSize:1,placeholder:gettext("Search user or enter email and press Enter"),formatSelectionTooBig:gettext("You cannot select any more choices")})),i.submit(function(){var n=e.trim(e('[name="email"]',e(this)).val());if(!n)return!1;if(n==t.model.get("owner"))return!1;var s=e('[type="submit"]',e(this));return r.disableButton(s),e.ajax({url:r.getUrl({name:"repo_owner",repo_id:t.model.get("id")}),type:"put",dataType:"json",beforeSend:r.prepareCSRFToken,data:{owner:n},success:function(){e.modal.close(),t.remove(),r.feedback(gettext("Successfully transferred the library."),"success")},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error_msg:n=gettext("Failed. Please check the network."),e(".error",i).html(n).show(),r.enableButton(s)}}),!1})},popupHistorySetting:function(){var e={repo_name:this.model.get("name"),repo_id:this.model.get("id")};return this.togglePopup(),new o(e),!1},popupShareLinkAdmin:function(){var e={repo_name:this.model.get("name"),repo_id:this.model.get("id")};return this.togglePopup(),new u(e),!1},popupFolderPermAdmin:function(){var e={repo_name:this.model.get("name"),repo_id:this.model.get("id")};return this.togglePopup(),new a(e),!1},changePassword:function(){var e={repo_name:this.model.get("name"),repo_id:this.model.get("id")};return this.togglePopup(),new s(e),!1}});return c}),function(e){typeof define=="function"&&define.amd?define("simplemodal",["jquery"],e):e(jQuery)}(function(e){var t=[],n=e(document),r=navigator.userAgent.toLowerCase(),i=e(window),s=[],o={ieQuirks:null,msie:/msie/.test(r)&&!/opera/.test(r),opera:/opera/.test(r)};o.ie6=o.msie&&/msie 6./.test(r)&&typeof window.XMLHttpRequest!="object",o.ie7=o.msie&&/msie 7.0/.test(r),o.boxModel=document.compatMode==="CSS1Compat";var u;e.modal=function(t,n){return e.modal.impl.init(t,n)},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,n){e.modal.impl.update(t,n)},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,n){var r=this;if(r.d.data)return!1;o.ieQuirks=o.msie&&!o.boxModel,r.o=e.extend({},e.modal.defaults,n),r.zIndex=r.o.zIndex,r.occb=!1;if(typeof t=="object")t=t instanceof e?t:e(t),r.d.placeholder=!1,t.parent().parent().size()>0&&(t.before(e("<span></span>").attr("id","simplemodal-placeholder").css({display:"none"})),r.d.placeholder=!0,r.display=t.css("display"),r.o.persist||(r.d.orig=t.clone(!0)));else{if(typeof t!="string"&&typeof t!="number")return alert("SimpleModal Error: Unsupported data type: "+typeof t),r;t=e("<div></div>").html(t)}return r.create(t),t=null,r.open(),e.isFunction(r.o.onShow)&&r.o.onShow.apply(r,[r.d]),r},create:function(n){var r=this;r.getDimensions(),r.o.modal&&o.ie6&&(r.d.iframe=e('<iframe src="javascript:false;"></iframe>').css(e.extend(r.o.iframeCss,{display:"none",opacity:0,position:"fixed",height:s[0],width:s[1],zIndex:r.o.zIndex,top:0,left:0})).appendTo(r.o.appendTo)),r.d.overlay=e("<div></div>").attr("id",r.o.overlayId).attr("tabIndex",-1).addClass("simplemodal-overlay").css(e.extend(r.o.overlayCss,{display:"none",opacity:r.o.opacity/100,height:r.o.modal?t[0]:0,width:r.o.modal?t[1]:0,position:"fixed",left:0,top:0,zIndex:r.o.zIndex+1})).appendTo(r.o.appendTo),r.d.container=e('<div role="dialog" aria-labelledby="dialogTitle" aria-describedby="dialogDiscription"></div>').attr("id",r.o.containerId).addClass("simplemodal-container").css(e.extend({position:r.o.fixed?"fixed":"absolute"},r.o.containerCss,{display:"none",zIndex:r.o.zIndex+2})).append(r.o.close&&r.o.closeHTML?e(r.o.closeHTML).addClass(r.o.closeClass):"").appendTo(r.o.appendTo),r.d.wrap=e('<div role="document"></div>').addClass("simplemodal-wrap").css({height:"100%",outline:0,width:"100%"}).appendTo(r.d.container),r.d.data=n.attr("id",n.attr("id")||r.o.dataId).addClass("simplemodal-data").css(e.extend(r.o.dataCss,{display:"none"})).appendTo("body"),n=null,r.setContainerDimensions(),r.d.data.appendTo(r.d.wrap),(o.ie6||o.ieQuirks)&&r.fixIE()},bindEvents:function(){var r=this;e("."+r.o.closeClass).bind("click.simplemodal",function(e){e.preventDefault(),r.close()}),r.o.modal&&r.o.close&&r.o.overlayClose&&r.d.overlay.bind("click.simplemodal",function(e){e.preventDefault(),r.close()}),n.bind("keydown.simplemodal",function(e){r.o.modal&&e.keyCode===9?r.watchTab(e):r.o.close&&r.o.escClose&&e.keyCode===27&&(e.preventDefault(),r.close())}),i.bind("resize.simplemodal orientationchange.simplemodal",function(){r.getDimensions(),r.o.autoResize?r.setContainerDimensions():r.o.autoPosition&&r.setPosition(),o.ie6||o.ieQuirks?r.fixIE():r.o.modal&&(r.d.iframe&&r.d.iframe.css({height:s[0],width:s[1]}),r.d.overlay.css({height:t[0],width:t[1]}))})},unbindEvents:function(){e("."+this.o.closeClass).unbind("click.simplemodal"),n.unbind("keydown.simplemodal"),i.unbind(".simplemodal"),this.d.overlay.unbind("click.simplemodal")},fixIE:function(){var t=this,n=t.o.position;e.each([t.d.iframe||null,t.o.modal?t.d.overlay:null,t.d.container.css("position")==="fixed"?t.d.container:null],function(e,t){if(t){var r="document.body.clientHeight",i="document.body.clientWidth",s="document.body.scrollHeight",o="document.body.scrollLeft",u="document.body.scrollTop",a="document.body.scrollWidth",f="document.documentElement.clientHeight",l="document.documentElement.clientWidth",c="document.documentElement.scrollLeft",h="document.documentElement.scrollTop",d=t[0].style;d.position="absolute";if(e<2)d.removeExpression("height"),d.removeExpression("width"),d.setExpression("height",""+s+" > "+r+" ? "+s+" : "+r+' + "px"'),d.setExpression("width",""+a+" > "+i+" ? "+a+" : "+i+' + "px"');else{var v,m;if(n&&n.constructor===Array){var g=n[0]?typeof n[0]=="number"?n[0].toString():n[0].replace(/px/,""):t.css("top").replace(/px/,"");v=g.indexOf("%")===-1?g+" + (t = "+h+" ? "+h+" : "+u+') + "px"':parseInt(g.replace(/%/,""))+" * (("+f+" || "+r+") / 100) + (t = "+h+" ? "+h+" : "+u+') + "px"';if(n[1]){var y=typeof n[1]=="number"?n[1].toString():n[1].replace(/px/,"");m=y.indexOf("%")===-1?y+" + (t = "+c+" ? "+c+" : "+o+') + "px"':parseInt(y.replace(/%/,""))+" * (("+l+" || "+i+") / 100) + (t = "+c+" ? "+c+" : "+o+') + "px"'}}else v="("+f+" || "+r+") / 2 - (this.offsetHeight / 2) + (t = "+h+" ? "+h+" : "+u+') + "px"',m="("+l+" || "+i+") / 2 - (this.offsetWidth / 2) + (t = "+c+" ? "+c+" : "+o+') + "px"';d.removeExpression("top"),d.removeExpression("left"),d.setExpression("top",v),d.setExpression("left",m)}}})},focus:function(t){var n=this,r=t&&e.inArray(t,["first","last"])!==-1?t:"first",i=e(":input:enabled:visible:"+r,n.d.wrap);setTimeout(function(){i.length>0?i.focus():n.d.wrap.focus()},10)},getDimensions:function(){var e=this,r=typeof window.innerHeight=="undefined"?i.height():window.innerHeight;t=[n.height(),n.width()],s=[r,i.width()]},getVal:function(e,t){return e?typeof e=="number"?e:e==="auto"?0:e.indexOf("%")>0?parseInt(e.replace(/%/,""))/100*(t==="h"?s[0]:s[1]):parseInt(e.replace(/px/,"")):null},update:function(e,t){var n=this;if(!n.d.data)return!1;n.d.origHeight=n.getVal(e,"h"),n.d.origWidth=n.getVal(t,"w"),n.d.data.hide(),e&&n.d.container.css("height",e),t&&n.d.container.css("width",t),n.setContainerDimensions(),n.d.data.show(),n.o.focus&&n.focus(),n.unbindEvents(),n.bindEvents()},setContainerDimensions:function(){var e=this,t=o.ie6||o.ie7,n=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"),r=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"),i=e.d.data.outerHeight(!0),u=e.d.data.outerWidth(!0);e.d.origHeight=e.d.origHeight||n,e.d.origWidth=e.d.origWidth||r;var a=e.o.maxHeight?e.getVal(e.o.maxHeight,"h"):null,f=e.o.maxWidth?e.getVal(e.o.maxWidth,"w"):null,l=a&&a<s[0]?a:s[0],c=f&&f<s[1]?f:s[1],h=e.o.minHeight?e.getVal(e.o.minHeight,"h"):"auto";n?n=e.o.autoResize&&n>l?l:n<h?h:n:i?i>l?n=l:e.o.minHeight&&h!=="auto"&&i<h?n=h:n=i:n=h;var p=e.o.minWidth?e.getVal(e.o.minWidth,"w"):"auto";r?r=e.o.autoResize&&r>c?c:r<p?p:r:u?u>c?r=c:e.o.minWidth&&p!=="auto"&&u<p?r=p:r=u:r=p,e.d.container.css({height:n,width:r}),e.d.wrap.css({overflow:i>n||u>r?"auto":"visible"}),e.o.autoPosition&&e.setPosition()},setPosition:function(){var e=this,t,n,r=s[0]/2-e.d.container.outerHeight(!0)/2,o=s[1]/2-e.d.container.outerWidth(!0)/2,u=e.d.container.css("position")!=="fixed"?i.scrollTop():0;e.o.position&&Object.prototype.toString.call(e.o.position)==="[object Array]"?(t=u+(e.o.position[0]||r),n=e.o.position[1]||o):(t=u+r,n=o),e.d.container.css({left:n,top:t})},watchTab:function(t){var n=this;if(e(t.target).parents(".simplemodal-container").length>0){n.inputs=e(":input:enabled:visible:first, :input:enabled:visible:last",n.d.data[0]);if(!t.shiftKey&&t.target===n.inputs[n.inputs.length-1]||t.shiftKey&&t.target===n.inputs[0]||n.inputs.length===0){t.preventDefault();var r=t.shiftKey?"last":"first";n.focus(r)}}else t.preventDefault(),n.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()),u=document.activeElement,t.o.focus&&t.focus(),t.bindEvents()},close:function(){var t=this;if(!t.d.data)return!1;u&&u.focus(),t.unbindEvents();if(e.isFunction(t.o.onClose)&&!t.occb)t.occb=!0,t.o.onClose.apply(t,[t.d]);else{if(t.d.placeholder){var n=e("#simplemodal-placeholder");t.o.persist?n.replaceWith(t.d.data.removeClass("simplemodal-data").css("display",t.display)):(t.d.data.hide().remove(),n.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={}}}}}),define("app/views/add-repo",["jquery","simplemodal","underscore","backbone","common"],function(e,t,n,r,i){var s=r.View.extend({tagName:"div",template:n.template(e("#create-repo-tmpl").html()),initialize:function(t){this.repos=t,this.render(),this.$el.modal(),e("#simplemodal-container").css({height:"auto"}),this.listenTo(t,"invalid",this.displayValidationErrors)},render:function(){return this.$el.html(this.template(this.templateData())),this},templateData:function(){return{showSharePerm:!1,enable_encrypted_library:app.pageOptions.enable_encrypted_library,library_templates:app.pageOptions.library_templates}},events:{submit:"addRepo","click #encrypt-switch":"togglePasswdInput"},newAttributes:function(){return{name:e.trim(e("input[name=repo_name]",this.$el).val()),encrypted:e("#encrypt-switch").prop("checked"),passwd1:e("input[name=passwd]",this.$el).val(),passwd2:e("input[name=passwd_again]",this.$el).val(),passwd:e("input[name=passwd]",this.$el).val(),library_template:e('[name="library_template"]',this.$el).val()}},displayValidationErrors:function(e,t,n){this.$(".error").html(t).show(),i.enableButton(this.$('[type="submit"]'))},addRepo:function(e){e.preventDefault(),i.disableButton(this.$('[type="submit"]'));var t=this.repos;t.create(this.newAttributes(),{wait:!0,validate:!0,prepend:!0,success:function(){t.length==1&&t.reset(t.models)},error:function(e,t,n){i.feedback("Error","error",i.ERROR_TIMEOUT)},complete:function(){i.closeModal()}})},togglePasswdInput:function(t){var n=e("#encrypt-switch"),r=this.$('input[type="password"]');n.prop("checked")?r.attr("disabled",!1).removeClass("input-disabled"):r.attr("disabled",!0).addClass("input-disabled")}});return s}),define("app/views/myhome-repos",["jquery","underscore","backbone","common","app/collections/repos","app/views/repo","app/views/add-repo"],function(e,t,n,r,i,s,o){var u=n.View.extend({id:"my-own-repos",template:t.template(e("#my-own-repos-tmpl").html()),reposHdTemplate:t.template(e("#my-repos-hd-tmpl").html()),events:{"click .repo-create":"createRepo","click .by-name":"sortByName","click .by-time":"sortByTime"},initialize:function(e){this.repos=new i,this.listenTo(this.repos,"add",this.addOne),this.listenTo(this.repos,"reset",this.reset),this.render()},addOne:function(e,t,n){var r=new s({model:e});n.prepend?this.$tableBody.prepend(r.render().el):this.$tableBody.append(r.render().el)},renderReposHd:function(){this.$tableHead.html(this.reposHdTemplate())},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.repos.length?(this.$emptyTip.hide(),this.renderReposHd(),this.$tableBody.empty(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.repos.each(this.addOne,this),this.$table.show()):(this.$table.hide(),this.$emptyTip.show()),app.pageOptions.guide_enabled&&(e("#guide-for-new").modal({appendTo:"#main",focus:!1}),e("#simplemodal-container").css({height:"auto"}),app.pageOptions.guide_enabled=!1)},showMyRepos:function(){this.$table.hide(),this.$loadingTip.show();var e=this;this.repos.fetch({cache:!1,reset:!0,success:function(e,t,n){},error:function(t,n,r){e.$loadingTip.hide();var i=e.$(".error"),s;n.responseText?n["status"]==401||n["status"]==403?s=gettext("Permission error"):s=gettext("Error"):s=gettext("Please check the network."),i.html(s).show()}})},render:function(){return this.$el.html(this.template()),this.$table=this.$("table"),this.$tableHead=e("thead",this.$table),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$repoCreateBtn=this.$(".repo-create"),this},show:function(){e("#right-panel").html(this.$el),this.showMyRepos()},hide:function(){this.$el.detach()},createRepo:function(){new o(this.repos)},sortByName:function(){return r.toggleSortByNameMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1},sortByTime:function(){return r.toggleSortByTimeMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1}});return u}),define("app/views/shared-repo",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,n,r,i){var s=i.extend({tagName:"tr",template:t.template(e("#shared-repo-tmpl").html()),events:{"click .unshare-btn":"removeShare"},initialize:function(){i.prototype.initialize.call(this)},removeShare:function(t){var n=this,i=function(t){r.feedback(gettext("Success"),"success",r.SUCCESS_TIMOUT),n.$el.remove(),n.collection.remove(n.model,{silent:!0}),n.collection.length==0&&(e("#repos-shared-to-me table").hide(),e("#repos-shared-to-me .empty-tips").show())};return e.ajax({url:r.getUrl({name:"beshared_repo",repo_id:this.model.get("id")})+"?share_type=personal&from="+encodeURIComponent(this.model.get("owner")),type:"DELETE",beforeSend:r.prepareCSRFToken,dataType:"json",success:i}),!1},render:function(){var e=this.model.toJSON(),n=r.isHiDPI()?96:24,i=this.model.getIconUrl(n);return t.extend(e,{icon_url:i,icon_title:this.model.getIconTitle()}),this.$el.html(this.template(e)),this}});return s}),define("app/views/myhome-shared-repos",["jquery","underscore","backbone","common","app/collections/repos","app/views/shared-repo"],function(e,t,n,r,i,s){var o=n.View.extend({id:"repos-shared-to-me",template:t.template(e("#repos-shared-to-me-tmpl").html()),reposHdTemplate:t.template(e("#shared-repos-hd-tmpl").html()),initialize:function(e){this.repos=new i({type:"shared"}),this.listenTo(this.repos,"add",this.addOne),this.listenTo(this.repos,"reset",this.reset),this.render()},addOne:function(e,t,n){var r=new s({model:e,collection:this.repos});n.prepend?this.$tableBody.prepend(r.render().el):this.$tableBody.append(r.render().el)},renderReposHd:function(){this.$tableHead.html(this.reposHdTemplate())},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.repos.length?(this.$emptyTip.hide(),this.renderReposHd(),this.$tableBody.empty(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.repos.each(this.addOne,this),this.$table.show()):(this.$emptyTip.show(),this.$table.hide())},showSharedRepos:function(){this.$el.show(),this.$table.hide();var e=this.$loadingTip;e.show();var t=this;this.repos.fetch({reset:!0,success:function(e,t,n){},error:function(n,r,i){e.hide();var s=t.$(".error"),o;r.responseText?r["status"]==401||r["status"]==403?o=gettext("Permission error"):o=gettext("Error"):o=gettext("Please check the network."),s.html(o).show()}})},render:function(){return this.$el.html(this.template()),this.$table=this.$("table"),this.$tableHead=this.$("thead"),this.$tableBody=this.$("tbody"),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this},show:function(){e("#right-panel").html(this.$el),this.showSharedRepos()},hide:function(){this.$el.detach()},events:{"click .by-name":"sortByName","click .by-time":"sortByTime"},sortByName:function(){return r.toggleSortByNameMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1},sortByTime:function(){return r.toggleSortByTimeMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1}});return o}),define("app/models/group",["underscore","backbone"],function(e,t){var n=t.Model.extend({});return n}),define("app/collections/groups",["underscore","backbone","common","app/models/group"],function(e,t,n,r){var i=t.Collection.extend({model:r,comparator:function(e,t){return n.compareTwoWord(e.get("name"),t.get("name"))},url:function(){return n.getUrl({name:"groups"})}});return i}),define("app/models/group-repo",["underscore","backbone","app/models/repo"],function(e,t,n){var r=n.extend({defaults:{permission:"r"}});return e.extend(r.prototype.defaults,n.prototype.defaults),r}),define("app/collections/group-repos",["underscore","backbone","common","app/models/group-repo"],function(e,t,n,r){var i=t.Collection.extend({model:r,comparator:0/0,url:function(){return n.getUrl({name:"group_repos",group_id:this.group_id})},parse:function(e){return this.is_staff=e.is_staff,e.repos},setGroupID:function(e){this.group_id=e}});return i}),define("app/views/group-repo",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,n,r,i){var s=i.extend({tagName:"tr",template:t.template(e("#group-repo-tmpl").html()),events:{"click .cancel-share":"unshare"},initialize:function(e){i.prototype.initialize.call(this),this.group_id=e.group_id,this.is_staff=e.is_staff,this.show_shared_by=!0,e.show_shared_by!==undefined&&(this.show_shared_by=e.show_shared_by),this.listenTo(this.model,"destroy",this.remove)},render:function(){var t=this.model.toJSON(),n=r.isHiDPI()?96:24,i=this.model.getIconUrl(n);return e.extend(t,{group_id:this.group_id,is_staff:this.is_staff,share_from_me:app.pageOptions.username==this.model.get("owner")?!0:!1,owner_name:this.model.get("owner_nickname")||this.model.get("owner_name"),show_shared_by:this.show_shared_by,icon_url:i,icon_title:this.model.getIconTitle()}),this.$el.html(this.template(t)),this},unshare:function(){var t=this.model.get("name");return this.model.destroy({wait:!0,success:function(){var e=gettext("Successfully unshared 1 item.");r.feedback(e,"success",r.SUCCESS_TIMOUT)},error:function(t,n){var i;n.responseText?i=e.parseJSON(n.responseText).error_msg:i=gettext("Failed. Please check the network."),r.feedback(i,"error")}}),!1}});return s}),define("app/views/group-item",["jquery","underscore","backbone","common","app/collections/group-repos","app/views/group-repo","app/models/group-repo"],function(e,t,n,r,i,s,o){var u=n.View.extend({template:t.template(e("#group-item-tmpl").html()),events:{},initialize:function(){},render:function(){this.$el.html(this.template(this.model.attributes));var e=this.model.get("repos");return e.length&&this.renderRepoList(e),this},renderRepoList:function(t){t.sort(function(e,t){return r.compareTwoWord(e.name,t.name)});var n=this.model.get("id"),u=e.inArray(app.pageOptions.username,this.model.get("admins"))!=-1?!0:!1,a=this.$("tbody"),f=new i;f.setGroupID(n),e(t).each(function(e,t){var r=new s({model:new o(t,{collection:f}),group_id:n,is_staff:u,show_shared_by:!1});a.append(r.render().el)})}});return u}),define("app/views/groups",["jquery","underscore","backbone","common","app/collections/groups","app/views/group-item"],function(e,t,n,r,i,s){var o=n.View.extend({id:"groups",template:t.template(e("#groups-tmpl").html()),initialize:function(e){this.groups=new i,this.listenTo(this.groups,"add",this.addOne),this.listenTo(this.groups,"reset",this.reset),this.render()},events:{"click #add-group":"addGroup"},addOne:function(e,t,n){var r=new s({model:e});n.prepend?this.$groupList.prepend(r.render().el):this.$groupList.append(r.render().el)},reset:function(){this.$error.hide(),this.$loadingTip.hide(),this.groups.length?(this.$emptyTip.hide(),this.$groupList.empty(),this.groups.each(this.addOne,this),this.$groupList.show()):(this.$emptyTip.show(),this.$groupList.hide())},render:function(){this.$el.html(this.template()),this.$loadingTip=this.$(".loading-tip"),this.$groupList=this.$("#group-list"),this.$emptyTip=this.$(".empty-tips"),this.$error=this.$(".error")},showGroups:function(){this.$groupList.hide(),this.$emptyTip.hide(),this.$loadingTip.show();var e=this;this.groups.fetch({cache:!1,data:{with_repos:1},reset:!0,success:function(e,t,n){},error:function(t,n,r){e.$loadingTip.hide();var i;n.responseText?n["status"]==401||n["status"]==403?i=gettext("Permission error"):i=gettext("Error"):i=gettext("Please check the network."),e.$error.html(i).show()}})},show:function(){e("#right-panel").html(this.$el),this.showGroups()},hide:function(){this.$el.detach()},addGroup:function(){var t=e("#group-add-form");t.modal(),e("#simplemodal-container").css({height:"auto"});var n=this.groups,i=this;t.submit(function(){var s=e.trim(e('[name="group_name"]',t).val()),o=e(".error",t),u=e('[type="submit"]',t);return s?(o.hide(),r.disableButton(u),n.create({name:s,repos:[]},{wait:!0,validate:!0,prepend:!0,success:function(){n.length==1&&i.reset(),app.ui.sideNavView.updateGroups(),r.closeModal()},error:function(e,t,n){var i;t.responseText?i=t.responseJSON.error_msg:i=gettext("Please check the network."),o.html(i).show(),r.enableButton(u)}}),!1):(o.html(gettext("It is required.")).show(),!1)})}});return o}),define("app/views/add-group-repo",["jquery","simplemodal","underscore","backbone","common","app/views/add-repo"],function(e,t,n,r,i,s){var o=s.extend({templateData:function(){return{showSharePerm:!0,enable_encrypted_library:app.pageOptions.enable_encrypted_library,library_templates:app.pageOptions.library_templates}},newAttributes:function(){var t=s.prototype.newAttributes.apply(this);return n.extend(t,{permission:e("select[name=permission]",this.$el).val()})}});return o}),define("app/collections/group-members",["underscore","backbone","common"],function(e,t,n){var r=t.Collection.extend({setGroupId:function(e){this.group_id=e},url:function(){return n.getUrl({name:"group_members",group_id:this.group_id})}});return r}),define("app/views/group-member",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({tagName:"li",className:"user-item cspt ovhd",template:t.template(e("#group-member-tmpl").html()),events:{mouseenter:"highlight",mouseleave:"rmHighlight",click:"visitMemberProfile"},initialize:function(e){this.is_owner=e.is_owner},render:function(){var t={is_owner:this.is_owner};return e.extend(t,this.model.attributes),this.$el.html(this.template(t)),this},highlight:function(){this.$el.addClass("hl")},rmHighlight:function(){this.$el.removeClass("hl")},visitMemberProfile:function(){location.href=r.getUrl({name:"user_profile",username:encodeURIComponent(this.model.get("email"))})}});return i}),define("app/views/widgets/popover",["jquery","underscore","backbone","common"],function(e,t,n,r){e(document).click(function(e){var t=app.ui.currentPopover,n=e.target||event.srcElement;return t?(!t.$el.is(n)&&!t.$el.find("*").is(n)&&t.hide(),!0):!0}),e(document).keydown(function(e){if(e.keyCode==27){var t=app.ui.currentPopover;t&&t.hide()}}),e(window).resize(function(){var e=app.ui.currentPopover;if(!e)return!0;e.setConMaxHeight()});var i=n.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 i}),define("app/views/group-members",["jquery","underscore","backbone","common","app/collections/group-members","app/views/group-member","app/views/widgets/popover"],function(e,t,n,r,i,s,o){var u=o.extend({id:"group-members",className:"sf-popover",template:t.template(e("#group-members-tmpl").html()),initialize:function(e){o.prototype.initialize.call(this),this.groupView=e.groupView,this.collection=new i,this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"reset",this.reset),this.render()},events:{},addOne:function(e,t,n){var r=!1;e.get("email")===this.groupView.group.owner&&(r=!0);var i=new s({is_owner:r,model:e});this.$listContainer.append(i.render().el)},reset:function(){this.$error.hide(),this.$loadingTip.hide(),this.$listContainer.empty(),this.collection.each(this.addOne,this),this.$listContainer.show()},render:function(){this.$el.html(this.template()),this.$loadingTip=this.$(".loading-tip"),this.$listContainer=this.$("#group-member-list"),this.$error=this.$(".error")},showContent:function(){this.$listContainer.hide(),this.$loadingTip.show();var t=this;this.collection.setGroupId(this.groupView.group.id),this.collection.fetch({cache:!1,reset:!0,data:{avatar_size:64},success:function(e,t,n){},error:function(e,n,r){t.$loadingTip.hide();var i;n.responseText?n["status"]==401||n["status"]==403?i=gettext("Permission error"):i=gettext("Error"):i=gettext("Please check the network."),t.$error.html(i).show()}}),e("#group-members-icon").after(this.$el)}});return u}),define("app/models/group-discussion",["underscore","backbone","common"],function(e,t,n){var r=t.Model.extend({});return r}),define("app/collections/group-discussions",["underscore","backbone","common","app/models/group-discussion"],function(e,t,n,r){var i=t.Collection.extend({model:r,setGroupId:function(e){this.group_id=e},url:function(){return n.getUrl({name:"group_discussions",group_id:this.group_id})},parse:function(e){return this.current_page=e.current_page,this.page_num=e.page_num,e.msgs}});return i}),function(){function t(t){this.tokens=[],this.tokens.links={},this.options=t||c.defaults,this.rules=e.normal,this.options.gfm&&(this.options.tables?this.rules=e.tables:this.rules=e.gfm)}function r(e,t){this.options=t||c.defaults,this.links=e,this.rules=n.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options;if(!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=n.breaks:this.rules=n.gfm:this.options.pedantic&&(this.rules=n.pedantic)}function i(e){this.options=e||{}}function s(e){this.tokens=[],this.token=null,this.options=e||c.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function o(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function u(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function a(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function f(){}function l(e){var t=1,n,r;for(;t<arguments.length;t++){n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}function c(e,n,r){if(r||typeof n=="function"){r||(r=n,n=null),n=l({},c.defaults,n||{});var i=n.highlight,u,a,f=0;try{u=t.lex(e,n)}catch(h){return r(h)}a=u.length;var p=function(e){if(e)return n.highlight=i,r(e);var t;try{t=s.parse(u,n)}catch(o){e=o}return n.highlight=i,e?r(e):r(null,t)};if(!i||i.length<3)return p();delete n.highlight;if(!a)return p();for(;f<u.length;f++)(function(e){return e.type!=="code"?--a||p():i(e.text,e.lang,function(t,n){if(t)return p(t);if(n==null||n===e.text)return--a||p();e.text=n,e.escaped=!0,--a||p()})})(u[f]);return}try{return n&&(n=l({},c.defaults,n)),s.parse(t.lex(e,n),n)}catch(h){h.message+="\nPlease report this to https://github.com/chjj/marked.";if((n||c.defaults).silent)return"<p>An error occured:</p><pre>"+o(h.message+"",!0)+"</pre>";throw h}}var e={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:f,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:f,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:f,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};e.bullet=/(?:[*+-]|\d+\.)/,e.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,e.item=a(e.item,"gm")(/bull/g,e.bullet)(),e.list=a(e.list)(/bull/g,e.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+e.def.source+")")(),e.blockquote=a(e.blockquote)("def",e.def)(),e._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",e.html=a(e.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,e._tag)(),e.paragraph=a(e.paragraph)("hr",e.hr)("heading",e.heading)("lheading",e.lheading)("blockquote",e.blockquote)("tag","<"+e._tag)("def",e.def)(),e.normal=l({},e),e.gfm=l({},e.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),e.gfm.paragraph=a(e.paragraph)("(?!","(?!"+e.gfm.fences.source.replace("\\1","\\2")+"|"+e.list.source.replace("\\1","\\3")+"|")(),e.tables=l({},e.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=e,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(t,n,r){var t=t.replace(/^ +$/gm,""),i,s,o,u,a,f,l,c,h;while(t){if(o=this.rules.newline.exec(t))t=t.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"});if(o=this.rules.code.exec(t)){t=t.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});continue}if(o=this.rules.fences.exec(t)){t=t.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});continue}if(o=this.rules.heading.exec(t)){t=t.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});continue}if(n&&(o=this.rules.nptable.exec(t))){t=t.substring(o[0].length),f={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")};for(c=0;c<f.align.length;c++)/^ *-+: *$/.test(f.align[c])?f.align[c]="right":/^ *:-+: *$/.test(f.align[c])?f.align[c]="center":/^ *:-+ *$/.test(f.align[c])?f.align[c]="left":f.align[c]=null;for(c=0;c<f.cells.length;c++)f.cells[c]=f.cells[c].split(/ *\| */);this.tokens.push(f);continue}if(o=this.rules.lheading.exec(t)){t=t.substring(o[0].length),this.tokens.push({type:"heading",depth:o[2]==="="?1:2,text:o[1]});continue}if(o=this.rules.hr.exec(t)){t=t.substring(o[0].length),this.tokens.push({type:"hr"});continue}if(o=this.rules.blockquote.exec(t)){t=t.substring(o[0].length),this.tokens.push({type:"blockquote_start"}),o=o[0].replace(/^ *> ?/gm,""),this.token(o,n,!0),this.tokens.push({type:"blockquote_end"});continue}if(o=this.rules.list.exec(t)){t=t.substring(o[0].length),u=o[2],this.tokens.push({type:"list_start",ordered:u.length>1}),o=o[0].match(this.rules.item),i=!1,h=o.length,c=0;for(;c<h;c++)f=o[c],l=f.length,f=f.replace(/^ *([*+-]|\d+\.) +/,""),~f.indexOf("\n ")&&(l-=f.length,f=this.options.pedantic?f.replace(/^ {1,4}/gm,""):f.replace(new RegExp("^ {1,"+l+"}","gm"),"")),this.options.smartLists&&c!==h-1&&(a=e.bullet.exec(o[c+1])[0],u!==a&&!(u.length>1&&a.length>1)&&(t=o.slice(c+1).join("\n")+t,c=h-1)),s=i||/\n\n(?!\s*$)/.test(f),c!==h-1&&(i=f.charAt(f.length-1)==="\n",s||(s=i)),this.tokens.push({type:s?"loose_item_start":"list_item_start"}),this.token(f,!1,r),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"});continue}if(o=this.rules.html.exec(t)){t=t.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&(o[1]==="pre"||o[1]==="script"||o[1]==="style"),text:o[0]});continue}if(!r&&n&&(o=this.rules.def.exec(t))){t=t.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};continue}if(n&&(o=this.rules.table.exec(t))){t=t.substring(o[0].length),f={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(c=0;c<f.align.length;c++)/^ *-+: *$/.test(f.align[c])?f.align[c]="right":/^ *:-+: *$/.test(f.align[c])?f.align[c]="center":/^ *:-+ *$/.test(f.align[c])?f.align[c]="left":f.align[c]=null;for(c=0;c<f.cells.length;c++)f.cells[c]=f.cells[c].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(f);continue}if(n&&(o=this.rules.paragraph.exec(t))){t=t.substring(o[0].length),this.tokens.push({type:"paragraph",text:o[1].charAt(o[1].length-1)==="\n"?o[1].slice(0,-1):o[1]});continue}if(o=this.rules.text.exec(t)){t=t.substring(o[0].length),this.tokens.push({type:"text",text:o[0]});continue}if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}return this.tokens};var n={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:f,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:f,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};n._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,n._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,n.link=a(n.link)("inside",n._inside)("href",n._href)(),n.reflink=a(n.reflink)("inside",n._inside)(),n.normal=l({},n),n.pedantic=l({},n.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),n.gfm=l({},n.normal,{escape:a(n.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:a(n.text)("]|","~]|")("|","|https?://|")()}),n.breaks=l({},n.gfm,{br:a(n.br)("{2,}","*")(),text:a(n.gfm.text)("{2,}","*")()}),r.rules=n,r.output=function(e,t,n){var i=new r(t,n);return i.output(e)},r.prototype.output=function(e){var t="",n,r,i,s;while(e){if(s=this.rules.escape.exec(e)){e=e.substring(s[0].length),t+=s[1];continue}if(s=this.rules.autolink.exec(e)){e=e.substring(s[0].length),s[2]==="@"?(r=s[1].charAt(6)===":"?this.mangle(s[1].substring(7)):this.mangle(s[1]),i=this.mangle("mailto:")+r):(r=o(s[1]),i=r),t+=this.renderer.link(i,null,r);continue}if(!this.inLink&&(s=this.rules.url.exec(e))){e=e.substring(s[0].length),r=o(s[1]),i=r,t+=this.renderer.link(i,null,r);continue}if(s=this.rules.tag.exec(e)){!this.inLink&&/^<a /i.test(s[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(s[0])&&(this.inLink=!1),e=e.substring(s[0].length),t+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):o(s[0]):s[0];continue}if(s=this.rules.link.exec(e)){e=e.substring(s[0].length),this.inLink=!0,t+=this.outputLink(s,{href:s[2],title:s[3]}),this.inLink=!1;continue}if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){e=e.substring(s[0].length),n=(s[2]||s[1]).replace(/\s+/g," "),n=this.links[n.toLowerCase()];if(!n||!n.href){t+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,t+=this.outputLink(s,n),this.inLink=!1;continue}if(s=this.rules.strong.exec(e)){e=e.substring(s[0].length),t+=this.renderer.strong(this.output(s[2]||s[1]));continue}if(s=this.rules.em.exec(e)){e=e.substring(s[0].length),t+=this.renderer.em(this.output(s[2]||s[1]));continue}if(s=this.rules.code.exec(e)){e=e.substring(s[0].length),t+=this.renderer.codespan(o(s[2],!0));continue}if(s=this.rules.br.exec(e)){e=e.substring(s[0].length),t+=this.renderer.br();continue}if(s=this.rules.del.exec(e)){e=e.substring(s[0].length),t+=this.renderer.del(this.output(s[1]));continue}if(s=this.rules.text.exec(e)){e=e.substring(s[0].length),t+=this.renderer.text(o(this.smartypants(s[0])));continue}if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}return t},r.prototype.outputLink=function(e,t){var n=o(t.href),r=t.title?o(t.title):null;return e[0].charAt(0)!=="!"?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,o(e[1]))},r.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},r.prototype.mangle=function(e){if(!this.options.mangle)return e;var t="",n=e.length,r=0,i;for(;r<n;r++)i=e.charCodeAt(r),Math.random()>.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t},i.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);r!=null&&r!==e&&(n=!0,e=r)}return t?'<pre><code class="'+this.options.langPrefix+o(t,!0)+'">'+(n?e:o(e,!0))+"\n</code></pre>\n":"<pre><code>"+(n?e:o(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,n){return"<h"+t+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"</"+n+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n"+"<tbody>\n"+t+"</tbody>\n"+"</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"</"+n+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(u(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(r.indexOf("javascript:")===0||r.indexOf("vbscript:")===0)return""}var s='<a href="'+e+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s},i.prototype.image=function(e,t,n){var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r},i.prototype.text=function(e){return e},s.parse=function(e,t,n){var r=new s(t,n);return r.parse(e)},s.prototype.parse=function(e){this.inline=new r(e.links,this.options,this.renderer),this.tokens=e.reverse();var t="";while(this.next())t+=this.tok();return t},s.prototype.next=function(){return this.token=this.tokens.pop()},s.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},s.prototype.parseText=function(){var e=this.token.text;while(this.peek().type==="text")e+="\n"+this.next().text;return this.inline.output(e)},s.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e="",t="",n,r,i,s,o;i="";for(n=0;n<this.token.header.length;n++)s={header:!0,align:this.token.align[n]},i+=this.renderer.tablecell(this.inline.output(this.token.header[n]),{header:!0,align:this.token.align[n]});e+=this.renderer.tablerow(i);for(n=0;n<this.token.cells.length;n++){r=this.token.cells[n],i="";for(o=0;o<r.length;o++)i+=this.renderer.tablecell(this.inline.output(r[o]),{header:!1,align:this.token.align[o]});t+=this.renderer.tablerow(i)}return this.renderer.table(e,t);case"blockquote_start":var t="";while(this.next().type!=="blockquote_end")t+=this.tok();return this.renderer.blockquote(t);case"list_start":var t="",u=this.token.ordered;while(this.next().type!=="list_end")t+=this.tok();return this.renderer.list(t,u);case"list_item_start":var t="";while(this.next().type!=="list_item_end")t+=this.token.type==="text"?this.parseText():this.tok();return this.renderer.listitem(t);case"loose_item_start":var t="";while(this.next().type!=="list_item_end")t+=this.tok();return this.renderer.listitem(t);case"html":var a=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(a);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},f.exec=f,c.options=c.setOptions=function(e){return l(c.defaults,e),c},c.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,sanitizer:null,mangle:!0,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1},c.Parser=s,c.parser=s.parse,c.Renderer=i,c.Lexer=t,c.lexer=t.lex,c.InlineLexer=r,c.inlineLexer=r.output,c.parse=c,typeof module!="undefined"&&typeof exports=="object"?module.exports=c:typeof define=="function"&&define.amd?define("marked",[],function(){return c}):this.marked=c}.call(function(){return this||(typeof window!="undefined"?window:global)}()),define("app/views/group-discussion",["jquery","underscore","backbone","common","marked","moment"],function(e,t,n,r,i,s){var o=n.View.extend({tagName:"li",className:"msg ovhd",template:t.template(e("#group-discussion-tmpl").html()),events:{mouseenter:"highlight",mouseleave:"rmHighlight","focus *":"focusItem","click .js-del-msg":"delMessage","click .js-reply-msg":"reply"},initialize:function(e){this.listenTo(this.model,"destroy",this.remove),this.parentView=e.parentView,this.is_group_owner=e.is_group_owner,this.is_group_admin=e.is_group_admin},render:function(){var e=this.model.attributes,n=s(e.created_at),o=!1;if(this.is_group_owner||this.is_group_admin||this.model.get("user_email")==app.pageOptions.username)o=!0;var u=r.getUrl({name:"user_profile",username:encodeURIComponent(e.user_email)});return t.extend(e,{content_marked:i(e.content,{breaks:!0,sanitize:!0}),time:n.format("LLLL"),time_from_now:r.getRelativeTimeStr(n),can_delete_msg:o,user_profile_url:u}),this.$el.html(this.template(e)),this},highlight:function(){this.$el.addClass("hl"),this.$(".msg-ops").removeClass("vh")},rmHighlight:function(){this.$el.removeClass("hl"),this.$(".msg-ops").addClass("vh")},focusItem:function(){e(".msg.hl",this.$el.parent()).removeClass("hl").find(".msg-ops").addClass("vh"),this.highlight()},reply:function(){return this.parentView.replyTo(this.model.get("user_name")),!1},delMessage:function(){return this.model.destroy({wait:!0,success:function(){},error:function(t,n){var i;n.responseText?i=e.parseJSON(n.responseText).error_msg:i=gettext("Failed. Please check the network."),r.feedback(i,"error")}}),!1}});return o}),define("app/views/group-discussions",["jquery","underscore","backbone","common","app/collections/group-discussions","app/views/group-discussion"],function(e,t,n,r,i,s){var o=n.View.extend({id:"group-discussions",className:"right-side-panel",template:t.template(e("#group-discussions-tmpl").html()),initialize:function(t){this.groupView=t.groupView,this.collection=new i,this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"reset",this.reset),this.render(),e("#main").append(this.$el),app.ui.groupDiscussions=this;var n=this;e(document).keydown(function(e){e.which==27&&n.hide()}),e(window).resize(function(){n.setConMaxHeight()})},events:{"click .js-close":"close","click .js-load-more":"loadMore","submit form":"formSubmit"},addOne:function(e,t,n){var r=new s({model:e,is_group_owner:this.is_group_owner,is_group_admin:this.is_group_admin,parentView:this});n.prepend?this.$listContainer.append(r.render().el):this.$listContainer.prepend(r.render().el)},reset:function(){this.$error.hide(),this.$loadingTip.hide(),this.$listContainer.empty(),this.collection.length?(this.$emptyTip.hide(),this.collection.each(this.addOne,this),this.$listContainer.show(),this.collection.current_page<this.collection.page_num?this.$loadMore.show():this.$loadMore.hide(),this.scrollConToBottom()):(this.$emptyTip.show(),this.$listContainer.hide(),this.$loadMore.hide())},render:function(){this.$el.html(this.template()),this.$loadingTip=this.$(".loading-tip"),this.$listContainer=this.$("#group-discussion-list"),this.$emptyTip=this.$(".no-discussion-tip"),this.$error=this.$(".error"),this.$loadMore=this.$(".js-load-more")},showContent:function(){this.$listContainer.hide(),this.$loadingTip.show();var t=this;this.is_group_owner=!1,this.is_group_admin=!1,app.pageOptions.username==this.groupView.group.owner?this.is_group_owner=!0:e.inArray(app.pageOptions.username,this.groupView.group.admins)!=-1&&(this.is_group_admin=!0),this.collection.setGroupId(this.groupView.group.id),this.collection.fetch({cache:!1,reset:!0,data:{avatar_size:64},success:function(e,t,n){},error:function(e,n,r){t.$loadingTip.hide();var i;n.responseText?n["status"]==401||n["status"]==403?i=gettext("Permission error"):i=gettext("Error"):i=gettext("Please check the network."),t.$error.html(i).show()}}),this.$(".msg-input").focus(),app.router.navigate("group/"+this.groupView.group.id+"/discussions/")},setConMaxHeight:function(){this.$(".group-discussions-con").css({height:e(window).height()-this.$el.offset().top-this.$(".group-discussions-hd").outerHeight(!0)-this.$(".group-discussions-footer").outerHeight(!0)})},hide:function(){this.$el.css({right:"-400px"})},close:function(){return app.router.navigate("group/"+this.groupView.group.id+"/"),this.hide(),!1},toggle:function(){return this.show(),!1},show:function(){this.showContent(),this.$el.css({right:"0px"}),this.setConMaxHeight()},replyTo:function(e){var t="@"+e+" ",n=this.$('[name="message"]').val(t);r.setCaretPosition(n[0],t.length),n.focus()},loadMore:function(){var t=this;this.$loadMore.hide(),this.$loadingTip.show(),this.collection.fetch({cache:!1,remove:!1,data:{avatar_size:64,page:this.collection.current_page+1},success:function(n,r,i){var s=0;t.$(".msg:lt("+r.msgs.length+")").each(function(){s+=e(this).outerHeight(!0)}),t.$(".group-discussions-con").scrollTop(s-50)},error:function(e,n,r){var i;n.responseText?n["status"]==401||n["status"]==403?i=gettext("Permission error"):i=gettext("Error"):i=gettext("Please check the network."),t.$error.html(i).show()},complete:function(){t.$loadingTip.hide(),t.collection.current_page<t.collection.page_num?t.$loadMore.show():t.$loadMore.hide()}})},formSubmit:function(){var t=this,n=e.trim(this.$('[name="message"]').val());return n?(this.collection.create({content:n,avatar_size:64},{wait:!0,validate:!0,prepend:!0,success:function(){t.$('[name="message"]').val(""),t.collection.length==1?t.collection.reset(t.collection.models):t.scrollConToBottom()},error:function(e,n,r){var i;n.responseText?i=n.responseJSON.error_msg:i=gettext("Please check the network."),t.$error.html(i).show()}}),!1):!1},scrollConToBottom:function(){var e=this.$(".group-discussions-con");e.scrollTop(e[0].scrollHeight-e[0].clientHeight)}});return o}),define("app/views/group-manage-member",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({tagName:"tr",template:t.template(e("#group-manage-member-tmpl").html()),events:{mouseenter:"highlight",mouseleave:"rmHighlight","click .role-edit-icon":"showEdit","change .role-edit":"editRole","click .rm":"rmMember"},initialize:function(e){this.group_id=e.group_id,this.is_owner=e.is_owner,this.$errorContainer=e.errorContainer,this.listenTo(this.model,"change",this.render)},render:function(){return this.$el.html(this.template(e.extend(this.model.attributes,{is_owner:this.is_owner,username:app.pageOptions.username}))),this},highlight:function(){this.$el.addClass("hl").find(".op-icon").removeClass("vh")},rmHighlight:function(){this.$el.removeClass("hl").find(".op-icon").addClass("vh")},showEdit:function(){this.$(".cur-role, .role-edit-icon").hide(),this.$(".role-edit").show()},editRole:function(){var t=this,n=this.$('[name="role"]').val(),i=n==1?!0:!1;e.ajax({url:r.getUrl({name:"group_member",group_id:this.group_id,email:encodeURIComponent(this.model.get("email"))}),type:"put",dataType:"json",beforeSend:r.prepareCSRFToken,data:{is_admin:i},success:function(){t.model.set({is_admin:i})},error:function(n){var r;n.responseText?r=e.parseJSON(n.responseText).error_msg:r=gettext("Failed. Please check the network."),t.$errorContainer.html(r).show()}})},rmMember:function(){var t=this;e.ajax({url:r.getUrl({name:"group_member",group_id:this.group_id,email:encodeURIComponent(this.model.get("email"))}),type:"delete",dataType:"json",beforeSend:r.prepareCSRFToken,success:function(){t.remove()},error:function(n){var r;n.responseText?r=e.parseJSON(n.responseText).error_msg:r=gettext("Failed. Please check the network."),t.$errorContainer.html(r).show()}})}});return i}),define("app/views/group-manage-members",["jquery","underscore","backbone","common","app/collections/group-members","app/views/group-manage-member"],function(e,t,n,r,i,s){var o=n.View.extend({template:t.template(e("#group-manage-members-tmpl").html()),initialize:function(t){this.group_id=t.group_id,this.group_name=t.group_name,this.is_owner=t.is_owner,this.render(),this.$(".op-target").css({"max-width":270}),this.$el.modal({appendTo:"#main",focus:!1,containerCss:{width:560},onClose:function(){e(document).off("click",s),e.modal.close()}}),this.$modalContainer=e("#simplemodal-container").css({height:"auto"}),this.$('[name="user_name"]').select2(e.extend({width:"320px"},r.contactInputOptionsForSelect2())),this.collection=new i,this.listenTo(this.collection,"add",this.addOne),this.renderMemberList(),this.setConMaxHeight(),this.$loadingTip=this.$(".loading-tip"),this.$listContainer=this.$("tbody"),this.$error=this.$(".error");var n=this;e(window).resize(function(){n.setConMaxHeight()});var s=function(e){var t=e.target||event.srcElement,r=n.$(".role-edit:visible"),i=r.parent();r.length&&!r.is(t)&&!r.find("*").is(t)&&!i.find(".role-edit-icon").is(t)&&(r.hide(),i.find(".cur-role, .role-edit-icon").show())};e(document).click(s)},render:function(){var e=gettext("{placeholder} Members").replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+r.HTMLescape(this.group_name)+'">'+r.HTMLescape(this.group_name)+"</span>");return this.$el.html(this.template({title:e,is_owner:this.is_owner})),this},events:{"submit form":"formSubmit"},addOne:function(e,t,n){var r=new s({model:e,group_id:this.group_id,is_owner:this.is_owner,errorContainer:this.$error});n.prepend?this.$listContainer.prepend(r.render().el):this.$listContainer.append(r.render().el)},renderMemberList:function(){var e=this;this.collection.setGroupId(this.group_id),this.collection.fetch({cache:!1,data:{avatar_size:40},success:function(t,n,r){e.$loadingTip.hide()},error:function(t,n,r){e.$loadingTip.hide();var i;n.responseText?n["status"]==401||n["status"]==403?i=gettext("Permission error"):i=gettext("Error"):i=gettext("Please check the network."),e.$error.html(i).show()}})},formSubmit:function(){var t=this,n=this.$('[name="user_name"]'),i=e.trim(n.val());if(!i)return!1;var s=i.split(",");return s.length==1?this.collection.create({email:i},{wait:!0,validate:!0,prepend:!0,success:function(){n.select2("val","")},error:function(e,r,i){n.select2("val","");var s;r.responseText?s=r.responseJSON.error_msg:s=gettext("Please check the network."),t.$error.html(s).show()}}):e.ajax({url:r.getUrl({name:"group_member_bulk",group_id:t.group_id}),type:"post",dataType:"json",beforeSend:r.prepareCSRFToken,data:{emails:i},success:function(r){n.select2("val",""),r.success.length>0&&t.collection.add(r.success,{prepend:!0});var i="";r.failed.length>0&&(e(r.failed).each(function(e,t){i+=t.email+": "+t.error_msg+"<br />"}),t.$error.html(i).show())},error:function(e){var n;e.responseText?n=gettext("Error"):n=gettext("Failed. Please check the network."),t.$error.html(n).show()}}),!1},setConMaxHeight:function(){var t=this.$modalContainer;this.$(".members").css({"max-height":e(window).height()-parseInt(t.css("top"))-parseInt(t.css("padding-top"))-parseInt(t.css("padding-bottom"))-this.$("h3").outerHeight(!0)-this.$("form").outerHeight(!0)-20,overflow:"auto"})}});return o}),define("app/views/group-settings",["jquery","underscore","backbone","common","app/views/group-manage-members","app/views/widgets/popover"],function(e,t,n,r,i,s){var o=s.extend({id:"group-settings",className:"sf-popover",template:t.template(e("#group-settings-tmpl").html()),contentTemplate:t.template(e("#group-settings-content-tmpl").html()),renameTemplate:t.template(e("#group-rename-form-tmpl").html()),transferTemplate:t.template(e("#group-transfer-form-tmpl").html()),importMembersTemplate:t.template(e("#group-import-members-form-tmpl").html()),initialize:function(e){s.prototype.initialize.call(this),this.groupView=e.groupView,this.render()},events:{"mouseenter .group-setting-item":"highlightItem","mouseleave .group-setting-item":"rmHighlightItem","click .group-setting-item":"manageGroup"},render:function(){this.$el.html(this.template())},showContent:function(){this.$listContainer=this.$(".sf-popover-con"),this.is_owner=!1,this.is_admin=!1,app.pageOptions.username==this.groupView.group.owner?this.is_owner=!0:e.inArray(app.pageOptions.username,this.groupView.group.admins)!=-1&&(this.is_admin=!0),this.$listContainer.html(this.contentTemplate({is_owner:this.is_owner,is_admin:this.is_admin,wiki_enabled:this.groupView.group.wiki_enabled})),e("#group-settings-icon").after(this.$el)},highlightItem:function(t){e(t.currentTarget).addClass("hl")},rmHighlightItem:function(t){e(t.currentTarget).removeClass("hl")},manageGroup:function(t){switch(e(t.currentTarget).data("op")){case"rename":this.rename();break;case"transfer":this.transfer();break;case"add-wiki":this.toggleWiki("on");break;case"remove-wiki":this.toggleWiki("off");break;case"import-members":this.importMembers();break;case"manage-members":this.manageMembers();break;case"dismiss":this.dismiss();break;case"leave":this.leave()}return this.hide(),!1},rename:function(){var t=this,n=e(this.renameTemplate());n.modal(),e("#simplemodal-container").css({width:"auto",height:"auto"}),n.submit(function(){var i=e.trim(e('[name="new_name"]',e(this)).val());if(!i||i==t.groupView.group.name)return!1;var s=e('[type="submit"]',e(this));return r.disableButton(s),e.ajax({url:r.getUrl({name:"group",group_id:t.groupView.group.id}),type:"put",dataType:"json",beforeSend:r.prepareCSRFToken,data:{name:i},success:function(){e.modal.close(),app.ui.sideNavView.updateGroups(),t.groupView.renderGroupTop()},error:function(t){var i;t.responseText?i=e.parseJSON(t.responseText).error_msg:i=gettext("Failed. Please check the network."),e(".error",n).html(i).show(),r.enableButton(s)}}),!1})},transfer:function(){var t=this,n=e(this.transferTemplate());n.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),e('[name="email"]',n).select2(e.extend(r.contactInputOptionsForSelect2(),{width:"268px",maximumSelectionSize:1,placeholder:gettext("Search user or enter email and press Enter"),formatSelectionTooBig:gettext("You cannot select any more choices")})),n.submit(function(){var i=e.trim(e('[name="email"]',e(this)).val());if(!i)return!1;if(i==t.groupView.group.owner)return!1;var s=e('[type="submit"]',e(this));return r.disableButton(s),e.ajax({url:r.getUrl({name:"group",group_id:t.groupView.group.id}),type:"put",dataType:"json",beforeSend:r.prepareCSRFToken,data:{owner:i},success:function(){r.feedback(gettext("Successfully transferred the group. You are now a normal member of the group."),"success"),e.modal.close()},error:function(t){var i;t.responseText?i=e.parseJSON(t.responseText).error_msg:i=gettext("Failed. Please check the network."),e(".error",n).html(i).show(),r.enableButton(s)}}),!1})},toggleWiki:function(t){var n=this,i;t=="on"?i="true":i="false",e.ajax({url:r.getUrl({name:"group",group_id:n.groupView.group.id}),type:"put",dataType:"json",beforeSend:r.prepareCSRFToken,data:{wiki_enabled:i},success:function(){n.hide(),n.groupView.renderGroupTop()},error:function(t){var i;t.responseText?i=e.parseJSON(t.responseText).error_msg:i=gettext("Failed. Please check the network."),r.feedback(i,"error"),n.hide()}})},importMembers:function(){var t=this,n=e(this.importMembersTemplate());n.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),n.submit(function(){var i=e("[name=file]",n)[0],s=e(".error",n);if(!i.files.length)return s.html(gettext("Please choose a CSV file")).removeClass("hide"),!1;var o=e('[type="submit"]',e(this));r.disableButton(o);var u=i.files[0],a=new FormData;return a.append("file",u),e.ajax({url:r.getUrl({name:"group_import_members",group_id:t.groupView.group.id}),type:"post",dataType:"json",data:a,processData:!1,contentType:!1,beforeSend:r.prepareCSRFToken,success:function(t){if(t.failed.length>0){var n="";e(t.failed).each(function(e,t){n+=t.email+": "+t.error_msg+"<br />"}),s.html(n).removeClass("hide"),r.enableButton(o)}else e.modal.close(),r.feedback(gettext("Successfully imported."),"success")},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),s.html(n).removeClass("hide"),r.enableButton(o)}}),!1})},manageMembers:function(){new i({group_id:this.groupView.group.id,group_name:this.groupView.group.name,is_owner:this.is_owner})},dismiss:function(){var t=this,n=gettext("Dismiss Group"),i=gettext("Really want to dismiss this group?"),s=function(){e.ajax({url:r.getUrl({name:"group",group_id:t.groupView.group.id}),type:"delete",dataType:"json",beforeSend:r.prepareCSRFToken,success:function(){app.ui.sideNavView.updateGroups(),app.router.navigate("groups/",{trigger:!0})},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error_msg:n=gettext("Failed. Please check the network."),r.feedback(n,"error")},complete:function(){e.modal.close()}})};r.showConfirm(n,i,s)},leave:function(){var t=this,n=gettext("Quit Group"),i=gettext("Are you sure you want to quit this group?"),s=function(){e.ajax({url:r.getUrl({name:"group_member",group_id:t.groupView.group.id,email:encodeURIComponent(app.pageOptions.username)}),type:"delete",dataType:"json",beforeSend:r.prepareCSRFToken,success:function(){app.ui.sideNavView.updateGroups(),app.router.navigate("groups/",{trigger:!0})},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error_msg:n=gettext("Failed. Please check the network."),r.feedback(error_msg,"error")},complete:function(){e.modal.close()}})};r.showConfirm(n,i,s)}});return o}),define("app/views/group",["jquery","underscore","backbone","common","app/collections/group-repos","app/views/group-repo","app/views/add-group-repo","app/views/group-members","app/views/group-discussions","app/views/group-settings"],function(e,t,n,r,i,s,o,u,a,f){var l=n.View.extend({id:"group",template:t.template(e("#group-tmpl").html()),groupTopTemplate:t.template(e("#group-top-tmpl").html()),reposHdTemplate:t.template(e("#shared-repos-hd-tmpl").html()),events:{"click #group-settings-icon":"toggleSettingsPanel","click #group-members-icon":"toggleMembersPanel","click #group-discussions-icon":"toggleDiscussionsPanel","click .repo-create":"createRepo","click .by-name":"sortByName","click .by-time":"sortByTime"},initialize:function(e){this.group={},this.repos=new i,this.listenTo(this.repos,"add",this.addOne),this.listenTo(this.repos,"reset",this.reset),this.settingsView=new f({groupView:this}),this.membersView=new u({groupView:this}),this.discussionsView=new a({groupView:this}),this.render()},addOne:function(e,t,n){var r=new s({model:e,group_id:this.group_id,is_staff:this.repos.is_staff});n.prepend?this.$tableBody.prepend(r.render().el):this.$tableBody.append(r.render().el)},renderReposHd:function(){this.$tableHead.html(this.reposHdTemplate())},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.repos.length?(this.$emptyTip.hide(),this.renderReposHd(),this.$tableBody.empty(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.repos.each(this.addOne,this),this.$table.show()):(this.$emptyTip.show(),this.$table.hide())},renderGroupTop:function(t){var n=this,i=e("#group-top");e.ajax({url:r.getUrl({name:"group",group_id:this.group_id}),cache:!1,dataType:"json",success:function(e){n.group=e,i.html(n.groupTopTemplate(e)),t&&t.showDiscussions&&n.showDiscussions()},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error_msg:n=gettext("Please check the network."),i.html('<p class="error">'+n+"</p>")}})},showRepoList:function(e,t){this.group_id=e,this.$emptyTip.hide(),this.renderGroupTop(t),this.$table.hide();var n=this.$loadingTip;n.show();var r=this;this.repos.setGroupID(e),this.repos.fetch({cache:!1,reset:!0,data:{from:"web"},success:function(e,t,n){},error:function(e,t,i){n.hide();var s=r.$(".error"),o;t.responseText?t["status"]==401||t["status"]==403?o=gettext("Permission error"):o=gettext("Error"):o=gettext("Please check the network."),s.html(o).show()}})},render:function(){this.$el.html(this.template()),this.$table=this.$("table"),this.$tableHead=this.$("thead"),this.$tableBody=this.$("tbody"),this.$loadingTip=this.$("#group-repos .loading-tip"),this.$emptyTip=this.$("#group-repos .empty-tips"),this.attached=!1},show:function(t,n){this.attached||(e("#right-panel").html(this.$el),this.attached=!0),this.showRepoList(t,n)},hide:function(){this.attached=!1,this.$el.detach()},createRepo:function(){new o(this.repos)},sortByName:function(){return r.toggleSortByNameMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1},sortByTime:function(){return r.toggleSortByTimeMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1},toggleSettingsPanel:function(){return this.settingsView.toggle()},toggleMembersPanel:function(){return this.membersView.toggle()},showDiscussions:function(){return this.discussionsView.show()},toggleDiscussionsPanel:function(){return this.discussionsView.toggle()}});return l}),define("app/models/pub-repo",["underscore","backbone","app/models/repo"],function(e,t,n){var r=n.extend({defaults:{permission:"r"}});return e.extend(r.prototype.defaults,n.prototype.defaults),r}),define("app/collections/pub-repos",["underscore","backbone","common","app/models/pub-repo"],function(e,t,n,r){var i=t.Collection.extend({model:r,comparator:0/0,url:function(){return n.getUrl({name:"pub_repos"})}});return i}),define("app/views/organization-repo",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,n,r,i){var s=i.extend({tagName:"tr",template:t.template(e("#organization-repo-tmpl").html()),initialize:function(){i.prototype.initialize.call(this)},render:function(){var e=this.model.toJSON(),n=r.isHiDPI()?96:24,i=this.model.getIconUrl(n);return t.extend(e,{icon_url:i,icon_title:this.model.getIconTitle()}),this.$el.html(this.template(e)),this},events:{"click .cancel-share":"removeShare"},removeShare:function(){var t=this.$el,n=this.model.get("name");return e.ajax({url:r.getUrl({name:"shared_repos",repo_id:this.model.get("id")})+"?share_type=public",type:"DELETE",beforeSend:r.prepareCSRFToken,dataType:"json",success:function(){t.remove();var e=gettext("Successfully unshared 1 item.");r.feedback(e,"success",r.SUCCESS_TIMOUT)},error:function(e){r.ajaxErrorHandler(e)}}),!1}});return s}),define("app/views/create-pub-repo",["jquery","simplemodal","underscore","backbone","common","app/views/add-repo"],function(e,t,n,r,i,s){var o=s.extend({templateData:function(){return{showSharePerm:!0,enable_encrypted_library:app.pageOptions.enable_encrypted_library,library_templates:app.pageOptions.library_templates}},newAttributes:function(){var t=s.prototype.newAttributes.apply(this);return n.extend(t,{permission:e("select[name=permission]",this.$el).val()})}});return o}),define("app/views/add-pubrepo-item",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({tagName:"tr",template:t.template(e("#add-pubrepo-item-tmpl").html()),events:{"click .select":"select","change .share-permission-select":"selectPerm"},initialize:function(){},selectPerm:function(t){var n=e(t.currentTarget).val();this.model.set({pub_perm:n},{silent:!0})},select:function(){var e=this.$("[type=checkbox]");e.prop("checked")?this.model.set({selected:!0},{silent:!0}):this.model.set({selected:!1},{silent:!0})},render:function(){return this.$el.html(this.template(this.model.toJSON())),this}});return i}),define("app/views/add-pub-repo",["jquery","simplemodal","underscore","backbone","common","app/collections/repos","app/views/add-pubrepo-item"],function(e,t,n,r,i,s,o){var u=r.View.extend({id:"add-pubrepo-popup",template:n.template(e("#add-pubrepo-popup-tmpl").html()),initialize:function(t){this.$el.html(this.template()).modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.$table=this.$("table"),this.$loadingTip=this.$(".loading-tip"),this.myRepos=new s,this.pubRepos=t,this.listenTo(this.myRepos,"reset",this.reset),this.myRepos.fetch({reset:!0})},events:{"click .submit":"submit"},submit:function(){var t=this.myRepos.where({selected:!0}),r=this,s=[];n.each(t,function(t){var n=t.id,r="rw";t.has("pub_perm")&&(r=t.get("pub_perm")),s.push(e.ajax({url:i.getUrl({name:"shared_repos",repo_id:n})+"?share_type=public&permission="+r,type:"PUT",beforeSend:i.prepareCSRFToken,dataType:"json",error:function(e,t,n){i.ajaxErrorHandler(e,t,n)}}))});var o=e.when.apply(e,s);o.done(function(){e.modal.close(),r.pubRepos.fetch({reset:!0})})},addOne:function(e){var t=new o({model:e});this.$table.append(t.render().el)},reset:function(){this.$loadingTip.hide(),this.$table.show(),this.myRepos.each(this.addOne,this)}});return u}),define("app/views/organization",["jquery","underscore","backbone","common","app/collections/pub-repos","app/views/organization-repo","app/views/create-pub-repo","app/views/add-pub-repo","app/views/widgets/dropdown"],function(e,t,n,r,i,s,o,u,a){var f=n.View.extend({id:"organization",template:t.template(e("#organization-repos-tmpl").html()),reposHdTemplate:t.template(e("#shared-repos-hd-tmpl").html()),initialize:function(e){this.repos=new i,this.listenTo(this.repos,"add",this.addOne),this.listenTo(this.repos,"reset",this.reset),this.render()},render:function(){this.$el.html(this.template()),this.$table=this.$("table"),this.$tableHead=e("thead",this.$table),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.dropdown=new a({el:this.$(".js-add-pub-lib-dropdown"),right:"0px"})},show:function(){e("#right-panel").html(this.$el),this.showRepoList()},hide:function(){this.$el.detach()},events:{"click .share-existing":"addRepo","click .create-new":"createRepo","click .by-name":"sortByName","click .by-time":"sortByTime"},createRepo:function(){return new o(this.repos),this.dropdown.hide(),!1},addRepo:function(){return new u(this.repos),this.dropdown.hide(),!1},addOne:function(e,t,n){var r=new s({model:e,collection:this.repos});n.prepend?this.$tableBody.prepend(r.render().el):this.$tableBody.append(r.render().el)},renderReposHd:function(){this.$tableHead.html(this.reposHdTemplate())},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.repos.length?(this.$emptyTip.hide(),this.renderReposHd(),this.$tableBody.empty(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.repos.each(this.addOne,this),this.$table.show()):(this.$table.hide(),this.$emptyTip.show())},showRepoList:function(){var e=this.$loadingTip;e.show();var t=this;this.repos.fetch({cache:!1,reset:!0,success:function(e,t,n){},error:function(n,r,i){e.hide();var s=t.$(".error"),o;r.responseText?r["status"]==401||r["status"]==403?o=gettext("Permission error"):o=gettext("Error"):o=gettext("Please check the network."),s.html(o).show()}})},sortByName:function(){return r.toggleSortByNameMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1},sortByTime:function(){return r.toggleSortByTimeMode(),r.updateSortIconByMode({context:this.$el}),r.sortLibs({libs:this.repos}),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.repos.comparator=null,!1}});return f}),function(e){typeof define=="function"&&define.amd?define("jquery.ui.core",["jquery"],e):e(jQuery)}(function(e){function t(t,r){var i,s,o,u=t.nodeName.toLowerCase();return"area"===u?(i=t.parentNode,s=i.name,!t.href||!s||i.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap='#"+s+"']")[0],!!o&&n(o))):(/^(input|select|textarea|button|object)$/.test(u)?!t.disabled:"a"===u?t.href||r:r)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).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 n=this.css("position"),r=n==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return r&&t.css("position")==="static"?!1:i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return n==="fixed"||!s.length?e(this[0].ownerDocument||document):s},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(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(n){return t(n,!isNaN(e.attr(n,"tabindex")))},tabbable:function(n){var r=e.attr(n,"tabindex"),i=isNaN(r);return(i||r>=0)&&t(n,!i)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,n){function o(t,n,i,s){return e.each(r,function(){n-=parseFloat(e.css(t,"padding"+this))||0,i&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var r=n==="Width"?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return t===undefined?s["inner"+n].call(this):this.each(function(){e(this).css(i,o(this,t)+"px")})},e.fn["outer"+n]=function(t,r){return typeof t!="number"?s["outer"+n].call(this,t):this.each(function(){e(this).css(i,o(this,t,!0,r)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?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(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(n,r){return typeof n=="number"?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),r&&r.call(t)},n)}):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(t!==undefined)return this.css("zIndex",t);if(this.length){var n=e(this[0]),r,i;while(n.length&&n[0]!==document){r=n.css("position");if(r==="absolute"||r==="relative"||r==="fixed"){i=parseInt(n.css("zIndex"),10);if(!isNaN(i)&&i!==0)return i}n=n.parent()}}return 0}}),e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n,r){var i,s=e.plugins[t];if(!s)return;if(!r&&(!e.element[0].parentNode||e.element[0].parentNode.nodeType===11))return;for(i=0;i<s.length;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}}}),function(e){typeof define=="function"&&define.amd?define("jquery.ui.widget",["jquery"],e):e(jQuery)}(function(e){var t=0,n=Array.prototype.slice;e.cleanData=function(t){return function(n){var r,i,s;for(s=0;(i=n[s])!=null;s++)try{r=e._data(i,"events"),r&&r.remove&&e(i).triggerHandler("remove")}catch(o){}t(n)}}(e.cleanData),e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];return t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=i,s=r.apply(this,arguments),this._super=t,this._superApply=n,s}}()}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix||t:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){var r=n.call(arguments,1),i=0,s=r.length,o,u;for(;i<s;i++)for(o in r[i])u=r[i][o],r[i].hasOwnProperty(o)&&u!==undefined&&(e.isPlainObject(u)?t[o]=e.isPlainObject(t[o])?e.widget.extend({},t[o],u):e.widget.extend({},u):t[o]=u);return t},e.widget.bridge=function(t,r){var i=r.prototype.widgetFullName||t;e.fn[t]=function(s){var o=typeof s=="string",u=n.call(arguments,1),a=this;return s=!o&&u.length?e.widget.extend.apply(null,[s].concat(u)):s,o?this.each(function(){var n,r=e.data(this,i);if(s==="instance")return a=r,!1;if(!r)return e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+s+"'");if(!e.isFunction(r[s])||s.charAt(0)==="_")return e.error("no such method '"+s+"' for "+t+" widget instance");n=r[s].apply(r,u);if(n!==r&&n!==undefined)return a=n&&n.jquery?a.pushStack(n.get()):n,!1}):this.each(function(){var t=e.data(this,i);t?(t.option(s||{}),t._init&&t._init()):e.data(this,i,new r(s,this))}),a}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(n,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=t++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),n),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),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,n){var r=t,i,s,o;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof t=="string"){r={},i=t.split("."),t=i.shift();if(i.length){s=r[t]=e.widget.extend({},this.options[t]);for(o=0;o<i.length-1;o++)s[i[o]]=s[i[o]]||{},s=s[i[o]];t=i.pop();if(arguments.length===1)return s[t]===undefined?null:s[t];s[t]=n}else{if(arguments.length===1)return this.options[t]===undefined?null:this.options[t];r[t]=n}}return this._setOptions(r),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,e==="disabled"&&(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,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^([\w:-]*)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,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,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}});var r=e.widget}),function(e){typeof define=="function"&&define.amd?define("jquery.ui.progressbar",["jquery","jquery.ui.core","jquery.ui.widget"],e):e(jQuery)}(function(e){var t=e.widget("ui.progressbar",{version:"1.11.3",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){if(e===undefined)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return e===undefined&&(e=this.options.value),this.indeterminate=e===!1,typeof e!="number"&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){e==="max"&&(t=Math.max(this.min,t)),e==="disabled"&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,n=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(n.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}})}),function(e){typeof define=="function"&&define.amd?define("jquery.magnific-popup",["jquery"],e):typeof exports=="object"?e(require("jquery")):e(window.jQuery||window.Zepto)}(function(e){var t="Close",n="BeforeClose",r="AfterClose",i="BeforeAppend",s="MarkupParse",o="Open",u="Change",a="mfp",f="."+a,l="mfp-ready",c="mfp-removing",h="mfp-prevent-close",p,d=function(){},v=!!window.jQuery,m,g=e(window),y,b,w,E,S,x=function(e,t){p.ev.on(a+e+f,t)},T=function(t,n,r,i){var s=document.createElement("div");return s.className="mfp-"+t,r&&(s.innerHTML=r),i?n&&n.appendChild(s):(s=e(s),n&&s.appendTo(n)),s},N=function(t,n){p.ev.triggerHandler(a+t,n),p.st.callbacks&&(t=t.charAt(0).toLowerCase()+t.slice(1),p.st.callbacks[t]&&p.st.callbacks[t].apply(p,e.isArray(n)?n:[n]))},C=function(t){if(t!==S||!p.currTemplate.closeBtn)p.currTemplate.closeBtn=e(p.st.closeMarkup.replace("%title%",p.st.tClose)),S=t;return p.currTemplate.closeBtn},k=function(){e.magnificPopup.instance||(p=new d,p.init(),e.magnificPopup.instance=p)},L=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(e.transition!==undefined)return!0;while(t.length)if(t.pop()+"Transition"in e)return!0;return!1};d.prototype={constructor:d,init:function(){var t=navigator.appVersion;p.isIE7=t.indexOf("MSIE 7.")!==-1,p.isIE8=t.indexOf("MSIE 8.")!==-1,p.isLowIE=p.isIE7||p.isIE8,p.isAndroid=/android/gi.test(t),p.isIOS=/iphone|ipad|ipod/gi.test(t),p.supportsTransition=L(),p.probablyMobile=p.isAndroid||p.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),b=e(document),p.popupsCache={}},open:function(t){y||(y=e(document.body));var n;if(t.isObj===!1){p.items=t.items.toArray(),p.index=0;var r=t.items,i;for(n=0;n<r.length;n++){i=r[n],i.parsed&&(i=i.el[0]);if(i===t.el[0]){p.index=n;break}}}else p.items=e.isArray(t.items)?t.items:[t.items],p.index=t.index||0;if(p.isOpen){p.updateItemHTML();return}p.types=[],E="",t.mainEl&&t.mainEl.length?p.ev=t.mainEl.eq(0):p.ev=b,t.key?(p.popupsCache[t.key]||(p.popupsCache[t.key]={}),p.currTemplate=p.popupsCache[t.key]):p.currTemplate={},p.st=e.extend(!0,{},e.magnificPopup.defaults,t),p.fixedContentPos=p.st.fixedContentPos==="auto"?!p.probablyMobile:p.st.fixedContentPos,p.st.modal&&(p.st.closeOnContentClick=!1,p.st.closeOnBgClick=!1,p.st.showCloseBtn=!1,p.st.enableEscapeKey=!1),p.bgOverlay||(p.bgOverlay=T("bg").on("click"+f,function(){p.close()}),p.wrap=T("wrap").attr("tabindex",-1).on("click"+f,function(e){p._checkIfClose(e.target)&&p.close()}),p.container=T("container",p.wrap)),p.contentContainer=T("content"),p.st.preloader&&(p.preloader=T("preloader",p.container,p.st.tLoading));var u=e.magnificPopup.modules;for(n=0;n<u.length;n++){var a=u[n];a=a.charAt(0).toUpperCase()+a.slice(1),p["init"+a].call(p)}N("BeforeOpen"),p.st.showCloseBtn&&(p.st.closeBtnInside?(x(s,function(e,t,n,r){n.close_replaceWith=C(r.type)}),E+=" mfp-close-btn-in"):p.wrap.append(C())),p.st.alignTop&&(E+=" mfp-align-top"),p.fixedContentPos?p.wrap.css({overflow:p.st.overflowY,overflowX:"hidden",overflowY:p.st.overflowY}):p.wrap.css({top:g.scrollTop(),position:"absolute"}),(p.st.fixedBgPos===!1||p.st.fixedBgPos==="auto"&&!p.fixedContentPos)&&p.bgOverlay.css({height:b.height(),position:"absolute"}),p.st.enableEscapeKey&&b.on("keyup"+f,function(e){e.keyCode===27&&p.close()}),g.on("resize"+f,function(){p.updateSize()}),p.st.closeOnContentClick||(E+=" mfp-auto-cursor"),E&&p.wrap.addClass(E);var c=p.wH=g.height(),h={};if(p.fixedContentPos&&p._hasScrollBar(c)){var d=p._getScrollbarSize();d&&(h.marginRight=d)}p.fixedContentPos&&(p.isIE7?e("body, html").css("overflow","hidden"):h.overflow="hidden");var v=p.st.mainClass;return p.isIE7&&(v+=" mfp-ie7"),v&&p._addClassToMFP(v),p.updateItemHTML(),N("BuildControls"),e("html").css(h),p.bgOverlay.add(p.wrap).prependTo(p.st.prependTo||y),p._lastFocusedEl=document.activeElement,setTimeout(function(){p.content?(p._addClassToMFP(l),p._setFocus()):p.bgOverlay.addClass(l),b.on("focusin"+f,p._onFocusIn)},16),p.isOpen=!0,p.updateSize(c),N(o),t},close:function(){if(!p.isOpen)return;N(n),p.isOpen=!1,p.st.removalDelay&&!p.isLowIE&&p.supportsTransition?(p._addClassToMFP(c),setTimeout(function(){p._close()},p.st.removalDelay)):p._close()},_close:function(){N(t);var n=c+" "+l+" ";p.bgOverlay.detach(),p.wrap.detach(),p.container.empty(),p.st.mainClass&&(n+=p.st.mainClass+" "),p._removeClassFromMFP(n);if(p.fixedContentPos){var i={marginRight:""};p.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}b.off("keyup"+f+" focusin"+f),p.ev.off(f),p.wrap.attr("class","mfp-wrap").removeAttr("style"),p.bgOverlay.attr("class","mfp-bg"),p.container.attr("class","mfp-container"),p.st.showCloseBtn&&(!p.st.closeBtnInside||p.currTemplate[p.currItem.type]===!0)&&p.currTemplate.closeBtn&&p.currTemplate.closeBtn.detach(),p._lastFocusedEl&&e(p._lastFocusedEl).focus(),p.currItem=null,p.content=null,p.currTemplate=null,p.prevHeight=0,N(r)},updateSize:function(e){if(p.isIOS){var t=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*t;p.wrap.css("height",n),p.wH=n}else p.wH=e||g.height();p.fixedContentPos||p.wrap.css("height",p.wH),N("Resize")},updateItemHTML:function(){var t=p.items[p.index];p.contentContainer.detach(),p.content&&p.content.detach(),t.parsed||(t=p.parseEl(p.index));var n=t.type;N("BeforeChange",[p.currItem?p.currItem.type:"",n]),p.currItem=t;if(!p.currTemplate[n]){var r=p.st[n]?p.st[n].markup:!1;N("FirstMarkupParse",r),r?p.currTemplate[n]=e(r):p.currTemplate[n]=!0}w&&w!==t.type&&p.container.removeClass("mfp-"+w+"-holder");var i=p["get"+n.charAt(0).toUpperCase()+n.slice(1)](t,p.currTemplate[n]);p.appendContent(i,n),t.preloaded=!0,N(u,t),w=t.type,p.container.prepend(p.contentContainer),N("AfterChange")},appendContent:function(e,t){p.content=e,e?p.st.showCloseBtn&&p.st.closeBtnInside&&p.currTemplate[t]===!0?p.content.find(".mfp-close").length||p.content.append(C()):p.content=e:p.content="",N(i),p.container.addClass("mfp-"+t+"-holder"),p.contentContainer.append(p.content)},parseEl:function(t){var n=p.items[t],r;n.tagName?n={el:e(n)}:(r=n.type,n={data:n,src:n.src});if(n.el){var i=p.types;for(var s=0;s<i.length;s++)if(n.el.hasClass("mfp-"+i[s])){r=i[s];break}n.src=n.el.attr("data-mfp-src"),n.src||(n.src=n.el.attr("href"))}return n.type=r||p.st.type||"inline",n.index=t,n.parsed=!0,p.items[t]=n,N("ElementParse",n),p.items[t]},addGroup:function(e,t){var n=function(n){n.mfpEl=this,p._openClick(n,e,t)};t||(t={});var r="click.magnificPopup";t.mainEl=e,t.items?(t.isObj=!0,e.off(r).on(r,n)):(t.isObj=!1,t.delegate?e.off(r).on(r,t.delegate,n):(t.items=e,e.off(r).on(r,n)))},_openClick:function(t,n,r){var i=r.midClick!==undefined?r.midClick:e.magnificPopup.defaults.midClick;if(!i&&(t.which===2||t.ctrlKey||t.metaKey))return;var s=r.disableOn!==undefined?r.disableOn:e.magnificPopup.defaults.disableOn;if(s)if(e.isFunction(s)){if(!s.call(p))return!0}else if(g.width()<s)return!0;t.type&&(t.preventDefault(),p.isOpen&&t.stopPropagation()),r.el=e(t.mfpEl),r.delegate&&(r.items=n.find(r.delegate)),p.open(r)},updateStatus:function(e,t){if(p.preloader){m!==e&&p.container.removeClass("mfp-s-"+m),!t&&e==="loading"&&(t=p.st.tLoading);var n={status:e,text:t};N("UpdateStatus",n),e=n.status,t=n.text,p.preloader.html(t),p.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),p.container.addClass("mfp-s-"+e),m=e}},_checkIfClose:function(t){if(e(t).hasClass(h))return;var n=p.st.closeOnContentClick,r=p.st.closeOnBgClick;if(n&&r)return!0;if(!p.content||e(t).hasClass("mfp-close")||p.preloader&&t===p.preloader[0])return!0;if(t!==p.content[0]&&!e.contains(p.content[0],t)){if(r&&e.contains(document,t))return!0}else if(n)return!0;return!1},_addClassToMFP:function(e){p.bgOverlay.addClass(e),p.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),p.wrap.removeClass(e)},_hasScrollBar:function(e){return(p.isIE7?b.height():document.body.scrollHeight)>(e||g.height())},_setFocus:function(){(p.st.focus?p.content.find(p.st.focus).eq(0):p.wrap).focus()},_onFocusIn:function(t){if(t.target!==p.wrap[0]&&!e.contains(p.wrap[0],t.target))return p._setFocus(),!1},_parseMarkup:function(t,n,r){var i;r.data&&(n=e.extend(r.data,n)),N(s,[t,n,r]),e.each(n,function(e,n){if(n===undefined||n===!1)return!0;i=e.split("_");if(i.length>1){var r=t.find(f+"-"+i[0]);if(r.length>0){var s=i[1];s==="replaceWith"?r[0]!==n[0]&&r.replaceWith(n):s==="img"?r.is("img")?r.attr("src",n):r.replaceWith('<img src="'+n+'" class="'+r.attr("class")+'" />'):r.attr(i[1],n)}}else t.find(f+"-"+e).html(n)})},_getScrollbarSize:function(){if(p.scrollbarSize===undefined){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),p.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return p.scrollbarSize}},e.magnificPopup={instance:null,proto:d.prototype,modules:[],open:function(t,n){return k(),t?t=e.extend(!0,{},t):t={},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&times;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(t){k();var n=e(this);if(typeof t=="string")if(t==="open"){var r,i=v?n.data("magnificPopup"):n[0].magnificPopup,s=parseInt(arguments[1],10)||0;i.items?r=i.items[s]:(r=n,i.delegate&&(r=r.find(i.delegate)),r=r.eq(s)),p._openClick({mfpEl:r},n,i)}else p.isOpen&&p[t].apply(p,Array.prototype.slice.call(arguments,1));else t=e.extend(!0,{},t),v?n.data("magnificPopup",t):n[0].magnificPopup=t,p.addGroup(n,t);return n};var A="inline",O,M,_,D=function(){_&&(M.after(_.addClass(O)).detach(),_=null)};e.magnificPopup.registerModule(A,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){p.types.push(A),x(t+"."+A,function(){D()})},getInline:function(t,n){D();if(t.src){var r=p.st.inline,i=e(t.src);if(i.length){var s=i[0].parentNode;s&&s.tagName&&(M||(O=r.hiddenClass,M=T(O),O="mfp-"+O),_=i.after(M).detach().removeClass(O)),p.updateStatus("ready")}else p.updateStatus("error",r.tNotFound),i=e("<div>");return t.inlineElement=i,i}return p.updateStatus("ready"),p._parseMarkup(n,{},t),n}}});var P="ajax",H,B=function(){H&&y.removeClass(H)},j=function(){B(),p.req&&p.req.abort()};e.magnificPopup.registerModule(P,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){p.types.push(P),H=p.st.ajax.cursor,x(t+"."+P,j),x("BeforeChange."+P,j)},getAjax:function(t){H&&y.addClass(H),p.updateStatus("loading");var n=e.extend({url:t.src,success:function(n,r,i){var s={data:n,xhr:i};N("ParseAjax",s),p.appendContent(e(s.data),P),t.finished=!0,B(),p._setFocus(),setTimeout(function(){p.wrap.addClass(l)},16),p.updateStatus("ready"),N("AjaxContentAdded")},error:function(){B(),t.finished=t.loadError=!0,p.updateStatus("error",p.st.ajax.tError.replace("%url%",t.src))}},p.st.ajax.settings);return p.req=e.ajax(n),""}}});var F,I=function(t){if(t.data&&t.data.title!==undefined)return t.data.title;var n=p.st.image.titleSrc;if(n){if(e.isFunction(n))return n.call(p,t);if(t.el)return t.el.attr(n)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=p.st.image,n=".image";p.types.push("image"),x(o+n,function(){p.currItem.type==="image"&&e.cursor&&y.addClass(e.cursor)}),x(t+n,function(){e.cursor&&y.removeClass(e.cursor),g.off("resize"+f)}),x("Resize"+n,p.resizeImage),p.isLowIE&&x("AfterChange",p.resizeImage)},resizeImage:function(){var e=p.currItem;if(!e||!e.img)return;if(p.st.image.verticalFit){var t=0;p.isLowIE&&(t=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",p.wH-t)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,F&&clearInterval(F),e.isCheckingImgSize=!1,N("ImageHasSize",e),e.imgHidden&&(p.content&&p.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var t=0,n=e.img[0],r=function(i){F&&clearInterval(F),F=setInterval(function(){if(n.naturalWidth>0){p._onImageHasSize(e);return}t>200&&clearInterval(F),t++,t===3?r(10):t===40?r(50):t===100&&r(500)},i)};r(1)},getImage:function(t,n){var r=0,i=function(){t&&(t.img[0].complete?(t.img.off(".mfploader"),t===p.currItem&&(p._onImageHasSize(t),p.updateStatus("ready")),t.hasSize=!0,t.loaded=!0,N("ImageLoadComplete")):(r++,r<200?setTimeout(i,100):s()))},s=function(){t&&(t.img.off(".mfploader"),t===p.currItem&&(p._onImageHasSize(t),p.updateStatus("error",o.tError.replace("%url%",t.src))),t.hasSize=!0,t.loaded=!0,t.loadError=!0)},o=p.st.image,u=n.find(".mfp-img");if(u.length){var a=document.createElement("img");a.className="mfp-img",t.el&&t.el.find("img").length&&(a.alt=t.el.find("img").attr("alt")),t.img=e(a).on("load.mfploader",i).on("error.mfploader",s),a.src=t.src,u.is("img")&&(t.img=t.img.clone()),a=t.img[0],a.naturalWidth>0?t.hasSize=!0:a.width||(t.hasSize=!1)}return p._parseMarkup(n,{title:I(t),img_replaceWith:t.img},t),p.resizeImage(),t.hasSize?(F&&clearInterval(F),t.loadError?(n.addClass("mfp-loading"),p.updateStatus("error",o.tError.replace("%url%",t.src))):(n.removeClass("mfp-loading"),p.updateStatus("ready")),n):(p.updateStatus("loading"),t.loading=!0,t.hasSize||(t.imgHidden=!0,n.addClass("mfp-loading"),p.findImageSize(t)),n)}}});var q,R=function(){return q===undefined&&(q=document.createElement("p").style.MozTransform!==undefined),q};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e=p.st.zoom,r=".zoom",i;if(!e.enabled||!p.supportsTransition)return;var s=e.duration,o=function(t){var n=t.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),r="all "+e.duration/1e3+"s "+e.easing,i={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},s="transition";return i["-webkit-"+s]=i["-moz-"+s]=i["-o-"+s]=i[s]=r,n.css(i),n},u=function(){p.content.css("visibility","visible")},a,f;x("BuildControls"+r,function(){if(p._allowZoom()){clearTimeout(a),p.content.css("visibility","hidden"),i=p._getItemToZoom();if(!i){u();return}f=o(i),f.css(p._getOffset()),p.wrap.append(f),a=setTimeout(function(){f.css(p._getOffset(!0)),a=setTimeout(function(){u(),setTimeout(function(){f.remove(),i=f=null,N("ZoomAnimationEnded")},16)},s)},16)}}),x(n+r,function(){if(p._allowZoom()){clearTimeout(a),p.st.removalDelay=s;if(!i){i=p._getItemToZoom();if(!i)return;f=o(i)}f.css(p._getOffset(!0)),p.wrap.append(f),p.content.css("visibility","hidden"),setTimeout(function(){f.css(p._getOffset())},16)}}),x(t+r,function(){p._allowZoom()&&(u(),f&&f.remove(),i=null)})},_allowZoom:function(){return p.currItem.type==="image"},_getItemToZoom:function(){return p.currItem.hasSize?p.currItem.img:!1},_getOffset:function(t){var n;t?n=p.currItem.img:n=p.st.zoom.opener(p.currItem.el||p.currItem);var r=n.offset(),i=parseInt(n.css("padding-top"),10),s=parseInt(n.css("padding-bottom"),10);r.top-=e(window).scrollTop()-i;var o={width:n.width(),height:(v?n.innerHeight():n[0].offsetHeight)-s-i};return R()?o["-moz-transform"]=o.transform="translate("+r.left+"px,"+r.top+"px)":(o.left=r.left,o.top=r.top),o}}});var U="iframe",z="//about:blank",W=function(e){if(p.currTemplate[U]){var t=p.currTemplate[U].find("iframe");t.length&&(e||(t[0].src=z),p.isIE8&&t.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(U,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){p.types.push(U),x("BeforeChange",function(e,t,n){t!==n&&(t===U?W():n===U&&W(!0))}),x(t+"."+U,function(){W()})},getIframe:function(t,n){var r=t.src,i=p.st.iframe;e.each(i.patterns,function(){if(r.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?r=r.substr(r.lastIndexOf(this.id)+this.id.length,r.length):r=this.id.call(this,r)),r=this.src.replace("%id%",r),!1});var s={};return i.srcAction&&(s[i.srcAction]=r),p._parseMarkup(n,s,t),p.updateStatus("ready"),n}}});var X=function(e){var t=p.items.length;return e>t-1?e-t:e<0?t+e:e},V=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=p.st.gallery,r=".mfp-gallery",i=Boolean(e.fn.mfpFastClick);p.direction=!0;if(!n||!n.enabled)return!1;E+=" mfp-gallery",x(o+r,function(){n.navigateByImgClick&&p.wrap.on("click"+r,".mfp-img",function(){if(p.items.length>1)return p.next(),!1}),b.on("keydown"+r,function(e){e.keyCode===37?p.prev():e.keyCode===39&&p.next()})}),x("UpdateStatus"+r,function(e,t){t.text&&(t.text=V(t.text,p.currItem.index,p.items.length))}),x(s+r,function(e,t,r,i){var s=p.items.length;r.counter=s>1?V(n.tCounter,i.index,s):""}),x("BuildControls"+r,function(){if(p.items.length>1&&n.arrows&&!p.arrowLeft){var t=n.arrowMarkup,r=p.arrowLeft=e(t.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(h),s=p.arrowRight=e(t.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(h),o=i?"mfpFastClick":"click";r[o](function(){p.prev()}),s[o](function(){p.next()}),p.isIE7&&(T("b",r[0],!1,!0),T("a",r[0],!1,!0),T("b",s[0],!1,!0),T("a",s[0],!1,!0)),p.container.append(r.add(s))}}),x(u+r,function(){p._preloadTimeout&&clearTimeout(p._preloadTimeout),p._preloadTimeout=setTimeout(function(){p.preloadNearbyImages(),p._preloadTimeout=null},16)}),x(t+r,function(){b.off(r),p.wrap.off("click"+r),p.arrowLeft&&i&&p.arrowLeft.add(p.arrowRight).destroyMfpFastClick(),p.arrowRight=p.arrowLeft=null})},next:function(){p.direction=!0,p.index=X(p.index+1),p.updateItemHTML()},prev:function(){p.direction=!1,p.index=X(p.index-1),p.updateItemHTML()},goTo:function(e){p.direction=e>=p.index,p.index=e,p.updateItemHTML()},preloadNearbyImages:function(){var e=p.st.gallery.preload,t=Math.min(e[0],p.items.length),n=Math.min(e[1],p.items.length),r;for(r=1;r<=(p.direction?n:t);r++)p._preloadItem(p.index+r);for(r=1;r<=(p.direction?t:n);r++)p._preloadItem(p.index-r)},_preloadItem:function(t){t=X(t);if(p.items[t].preloaded)return;var n=p.items[t];n.parsed||(n=p.parseEl(t)),N("LazyLoad",n),n.type==="image"&&(n.img=e('<img class="mfp-img" />').on("load.mfploader",function(){n.hasSize=!0}).on("error.mfploader",function(){n.hasSize=!0,n.loadError=!0,N("LazyLoadError",n)}).attr("src",n.src)),n.preloaded=!0}}});var $="retina";e.magnificPopup.registerModule($,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=p.st.retina,t=e.ratio;t=isNaN(t)?t():t,t>1&&(x("ImageHasSize."+$,function(e,n){n.img.css({"max-width":n.img[0].naturalWidth/t,width:"100%"})}),x("ElementParse."+$,function(n,r){r.src=e.replaceSrc(r,t)}))}}}}),function(){var t=1e3,n="ontouchstart"in window,r=function(){g.off("touchmove"+s+" touchend"+s)},i="mfpFastClick",s="."+i;e.fn.mfpFastClick=function(i){return e(this).each(function(){var o=e(this),u;if(n){var a,f,l,c,h,p;o.on("touchstart"+s,function(e){c=!1,p=1,h=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],f=h.clientX,l=h.clientY,g.on("touchmove"+s,function(e){h=e.originalEvent?e.originalEvent.touches:e.touches,p=h.length,h=h[0];if(Math.abs(h.clientX-f)>10||Math.abs(h.clientY-l)>10)c=!0,r()}).on("touchend"+s,function(e){r();if(c||p>1)return;u=!0,e.preventDefault(),clearTimeout(a),a=setTimeout(function(){u=!1},t),i()})})}o.on("click"+s,function(){u||i()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+s+" click"+s),n&&g.off("touchmove"+s+" touchend"+s)}}(),k()}),define("app/models/dirent",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.Model.extend({getPath:function(){return r.pathJoin([this.collection.path,this.get("obj_name")])},getIconUrl:function(e){if(this.get("is_dir")){var t=this.get("perm")=="r";return r.getDirIconUrl(t,e)}return r.getFileIconUrl(this.get("obj_name"),e)},getWebUrl:function(){var e=this.collection,t=this.getPath();return this.get("is_dir")?e.category?"#"+e.category+"/lib/"+e.repo_id+r.encodePath(t):"#lib/"+e.repo_id+r.encodePath(t):app.config.siteRoot+"lib/"+e.repo_id+"/file"+r.encodePath(t)},getDownloadUrl:function(){var e=this.collection,t=this.getPath();return this.get("is_dir")?app.config.siteRoot+"repo/download_dir/"+e.repo_id+"/?p="+r.encodePath(t):app.config.siteRoot+"lib/"+e.repo_id+"/file"+r.encodePath(t)+"?dl=1"},deleteFromServer:function(t){var n=this.collection,i=this.getPath(),s=this,o={repo_id:n.repo_id,name:this.get("is_dir")?"del_dir":"del_file"};e.ajax({url:r.getUrl(o)+"?p="+encodeURIComponent(i),type:"DELETE",dataType:"json",beforeSend:r.prepareCSRFToken,success:function(e){n.remove(s),t.success&&t.success(e)},error:function(e){t.error&&t.error(e)}})},rename:function(t){var n=this.collection,i=this,s={repo_id:n.repo_id,name:this.get("is_dir")?"rename_dir":"rename_file"},o={operation:"rename",newname:t.newname};e.ajax({url:r.getUrl(s)+"?p="+encodeURIComponent(this.getPath()),type:"POST",dataType:"json",beforeSend:r.prepareCSRFToken,data:o,success:function(n){var r={obj_name:t.newname,last_modified:(new Date).getTime()/1e3,last_update:gettext("Just now")};i.get("is_dir")||e.extend(r,{starred:!1}),i.set(r),t.success&&t.success(n)},error:function(e){t.error&&t.error(e)}})},lockOrUnlockFile:function(t){var n=this.collection,i=this.getPath();e.ajax({url:r.getUrl({name:"lock_or_unlock_file",repo_id:n.repo_id})+"?p="+encodeURIComponent(i),type:"PUT",dataType:"json",data:{operation:t.op,p:i},cache:!1,beforeSend:r.prepareCSRFToken,success:function(){t.success()},error:function(e){t.error(e)}})},lockFile:function(e){var t=this;return this.lockOrUnlockFile({op:"lock",success:function(){t.set({is_locked:!0,locked_by_me:!0,lock_owner_name:app.pageOptions.name}),e.success&&e.success()},error:function(t){e.error&&e.error(t)}}),!1},unlockFile:function(e){var t=this;return this.lockOrUnlockFile({op:"unlock",success:function(){t.set({is_locked:!1}),e.success&&e.success()},error:function(t){e.error&&e.error(t)}}),!1}});return i}),define("app/collections/dirents",["underscore","backbone","common","app/models/dirent"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"list_lib_dir",repo_id:this.repo_id})},initialize:function(){},parse:function(e){return this.repo_name=e.repo_name,this.user_perm=e.user_perm,this.encrypted=e.encrypted,this.is_repo_owner=e.is_repo_owner,this.is_virtual=e.is_virtual,this.has_been_shared_out=e.has_been_shared_out,this.dirent_more=e.dirent_more,this.more_start=e.more_start,e.dirent_list},setPath:function(e,t,n){this.category=e,this.repo_id=t,this.path=n}});return i}),define("app/views/dialogs/dirent-mvcp",["jquery","underscore","backbone","common","file-tree"],function(e,t,n,r,i){var s=n.View.extend({mvcpTemplate:t.template(e("#mvcp-form-template").html()),mvProgressTemplate:t.template(e("#mv-progress-popup-template").html()),initialize:function(t){this.dirent=t.dirent,this.dir=t.dir,this.op_type=t.op_type,this.show_cur_repo=this.dirent.get("perm")=="rw"?!0:!1,this.render(),this.$el.modal({appendTo:"#main",autoResize:!0,focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.show_cur_repo&&i.renderTreeForPath({$form:this.$el,$container:this.$("#current-repo-dirs"),repo_name:this.dir.repo_name,repo_id:this.dir.repo_id,path:this.dir.path}),this.dir.encrypted||i.prepareOtherReposTree({cur_repo_id:this.dir.repo_id}),this.$error=this.$(".error"),this.$form=this.$("form")},render:function(){var e=this.dir,t=this.dirent.get("obj_name"),n=this.dirent.get("is_dir")?"dir":"file",i=this.op_type=="mv"?gettext("Move {placeholder} to:"):gettext("Copy {placeholder} to:");return i=i.replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+r.HTMLescape(t)+'">'+r.HTMLescape(t)+"</span>"),this.$el.html(this.mvcpTemplate({form_title:i,op_type:this.op_type,obj_type:n,obj_name:t,show_cur_repo:this.show_cur_repo,show_other_repos:!e.encrypted})),this},events:{"submit form":"formSubmit"},_showProgress:function(t,n){var i=this,s=this.op_type,o=this.dirent.get("obj_name"),u=e(i.mvProgressTemplate()),a=e("#mv-details",u),f=e("#cancel-mv",u),l=e("#mv-other-info",u);f.removeClass("hide"),setTimeout(function(){u.modal({containerCss:{width:300,height:150,paddingTop:50},focus:!1});var t=i.op_type=="mv"?gettext("Moving %(name)s"):gettext("Copying %(name)s");a.html(t.replace("%(name)s",r.HTMLescape(o))).removeClass("vh"),e("#mv-progress").progressbar(),c()},100);var c=function(){e.ajax({url:r.getUrl({name:"get_cp_progress"})+"?task_id="+encodeURIComponent(n),dataType:"json",success:function(n){var o=e(".ui-progressbar-value",e("#mv-progress"));if(!n.failed&&!n.canceled&&!n.successful)n["done"]==n["total"]?(o.css("width","100%"),a.addClass("vh"),f.addClass("hide"),l.html(gettext("Saving...")).removeClass("hide")):o.css("width",parseInt(n.done/n.total*100,10)+"%"),o.show(),setTimeout(c,1e3);else if(n.successful)e.modal.close(),s=="mv"&&i.dir.remove(i.dirent),r.feedback(t,"success");else{a.addClass("vh");var u=n.failed?gettext("Failed."):gettext("Canceled.");l.html(u).removeClass("hide"),f.addClass("hide"),setTimeout(function(){e.modal.close()},1e3)}},error:function(t,n,r){var i;t.responseText?i=e.parseJSON(t.responseText).error:i=gettext("Failed. Please check the network."),a.addClass("vh"),l.html(i).removeClass("hide"),f.addClass("hide"),setTimeout(function(){e.modal.close()},1e3)}})};f.click(function(){r.disableButton(f),e.ajax({url:r.getUrl({name:"cancel_cp"})+"?task_id="+encodeURIComponent(n),dataType:"json",success:function(t){a.addClass("vh"),l.html(gettext("Canceled.")).removeClass("hide"),f.addClass("hide"),setTimeout(function(){e.modal.close()},1e3)},error:function(t,n,i){var s;t.responseText?s=e.parseJSON(t.responseText).error:s=gettext("Failed. Please check the network."),l.html(s).removeClass("hide"),r.enableButton(f)}})})},formSubmit:function(){var t=this,n=this.dir.path,i=this.dir.repo_id,s=this.dirent.get("obj_name"),o=this.dirent.get("is_dir")?"dir":"file",u=e('[name="dst_repo"]',this.$form).val(),a=e('[name="dst_path"]',this.$form).val();if(!e.trim(u)||!e.trim(a))return e(".error",form).removeClass("hide"),!1;if(u==i&&(a==n||o=="dir"&&a==n+s+"/"))return this.$error.html(gettext("Invalid destination path")).removeClass("hide"),!1;var f={repo_id:i};o=="dir"?f.name=this.op_type=="mv"?"mv_dir":"cp_dir":f.name=this.op_type=="mv"?"mv_file":"cp_file";var l=r.getUrl(f)+"?path="+encodeURIComponent(n)+"&obj_name="+encodeURIComponent(s),c={dst_repo:u,dst_path:a},h=function(n){e.modal.close();var i;t.op_type=="mv"?i=gettext("Successfully moved %(name)s").replace("%(name)s",s):i=gettext("Successfully copied %(name)s").replace("%(name)s",s),n.task_id?t._showProgress(i,n.task_id):(t.op_type=="mv"&&t.dir.remove(t.dirent),r.feedback(i,"success"))};return r.ajaxPost({form:this.$form,post_url:l,post_data:c,after_op_success:h,form_id:this.$form.attr("id")}),!1}});return s}),function(e){typeof define=="function"&&define.amd?define("jquery.ui.tabs",["jquery"],e):e(jQuery)}(function(e){function t(t,r){var i,s,o,u=t.nodeName.toLowerCase();return"area"===u?(i=t.parentNode,s=i.name,!t.href||!s||i.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap='#"+s+"']")[0],!!o&&n(o))):(/^(input|select|textarea|button|object)$/.test(u)?!t.disabled:"a"===u?t.href||r:r)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).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 n=this.css("position"),r=n==="absolute",i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return r&&t.css("position")==="static"?!1:i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return n==="fixed"||!s.length?e(this[0].ownerDocument||document):s},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(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(n){return t(n,!isNaN(e.attr(n,"tabindex")))},tabbable:function(n){var r=e.attr(n,"tabindex"),i=isNaN(r);return(i||r>=0)&&t(n,!i)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,n){function o(t,n,i,s){return e.each(r,function(){n-=parseFloat(e.css(t,"padding"+this))||0,i&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var r=n==="Width"?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),s={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return t===undefined?s["inner"+n].call(this):this.each(function(){e(this).css(i,o(this,t)+"px")})},e.fn["outer"+n]=function(t,r){return typeof t!="number"?s["outer"+n].call(this,t):this.each(function(){e(this).css(i,o(this,t,!0,r)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?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(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.fn.extend({focus:function(t){return function(n,r){return typeof n=="number"?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),r&&r.call(t)},n)}):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(t!==undefined)return this.css("zIndex",t);if(this.length){var n=e(this[0]),r,i;while(n.length&&n[0]!==document){r=n.css("position");if(r==="absolute"||r==="relative"||r==="fixed"){i=parseInt(n.css("zIndex"),10);if(!isNaN(i)&&i!==0)return i}n=n.parent()}}return 0}}),e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n,r){var i,s=e.plugins[t];if(!s)return;if(!r&&(!e.element[0].parentNode||e.element[0].parentNode.nodeType===11))return;for(i=0;i<s.length;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}};var r=0,i=Array.prototype.slice;e.cleanData=function(t){return function(n){var r,i,s;for(s=0;(i=n[s])!=null;s++)try{r=e._data(i,"events"),r&&r.remove&&e(i).triggerHandler("remove")}catch(o){}t(n)}}(e.cleanData),e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];return t=t.split(".")[1],i=f+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[f]=e[f]||{},s=e[f][t],o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=i,s=r.apply(this,arguments),this._super=t,this._superApply=n,s}}()}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix||t:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){var n=i.call(arguments,1),r=0,s=n.length,o,u;for(;r<s;r++)for(o in n[r])u=n[r][o],n[r].hasOwnProperty(o)&&u!==undefined&&(e.isPlainObject(u)?t[o]=e.isPlainObject(t[o])?e.widget.extend({},t[o],u):e.widget.extend({},u):t[o]=u);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(s){var o=typeof s=="string",u=i.call(arguments,1),a=this;return o?this.each(function(){var n,i=e.data(this,r);if(s==="instance")return a=i,!1;if(!i)return e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+s+"'");if(!e.isFunction(i[s])||s.charAt(0)==="_")return e.error("no such method '"+s+"' for "+t+" widget instance");n=i[s].apply(i,u);if(n!==i&&n!==undefined)return a=n&&n.jquery?a.pushStack(n.get()):n,!1}):(u.length&&(s=e.widget.extend.apply(null,[s].concat(u))),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))})),a}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=r++,this.eventNamespace="."+this.widgetName+this.uuid,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.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,n){var r=t,i,s,o;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof t=="string"){r={},i=t.split("."),t=i.shift();if(i.length){s=r[t]=e.widget.extend({},this.options[t]);for(o=0;o<i.length-1;o++)s[i[o]]=s[i[o]]||{},s=s[i[o]];t=i.pop();if(arguments.length===1)return s[t]===undefined?null:s[t];s[t]=n}else{if(arguments.length===1)return this.options[t]===undefined?null:this.options[t];r[t]=n}}return this._setOptions(r),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,e==="disabled"&&(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,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^([\w:-]*)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(n).undelegate(n),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 n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,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,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}});var s=e.widget,o=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 n,r;t=t.cloneNode(!1),n=t.href.replace(e,""),r=location.href.replace(e,"");try{n=decodeURIComponent(n)}catch(i){}try{r=decodeURIComponent(r)}catch(i){}return t.hash.length>1&&n===r}}(),_create:function(){var t=this,n=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible),this._processTabs(),n.active=this._initialActive(),e.isArray(n.disabled)&&(n.disabled=e.unique(n.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(n.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_initialActive:function(){var t=this.options.active,n=this.options.collapsible,r=location.hash.substring(1);if(t===null){r&&this.tabs.each(function(n,i){if(e(i).attr("aria-controls")===r)return t=n,!1}),t===null&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(t===null||t===-1)t=this.tabs.length?0:!1}return t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),t===-1&&(t=n?!1:0)),!n&&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 n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),!t.ctrlKey&&!t.metaKey&&(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?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){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):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),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,n=this.tabs,r=this.anchors,i=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(n,r){var i,s,o,u=e(r).uniqueId().attr("id"),a=e(r).closest("li"),f=a.attr("aria-controls");t._isLocal(r)?(i=r.hash,o=i.substring(1),s=t.element.find(t._sanitizeSelector(i))):(o=a.attr("aria-controls")||e({}).uniqueId()[0].id,i="#"+o,s=t.element.find(i),s.length||(s=t._createPanel(o),s.insertAfter(t.panels[n-1]||t.tablist)),s.attr("aria-live","polite")),s.length&&(t.panels=t.panels.add(s)),f&&a.data("ui-tabs-aria-controls",f),a.attr({"aria-controls":o,"aria-labelledby":u}),s.attr("aria-labelledby",u)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),n&&(this._off(n.not(this.tabs)),this._off(r.not(this.anchors)),this._off(i.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 n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={};t&&e.each(t.split(" "),function(e,t){n[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,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r=this.element.parent();t==="fill"?(n=r.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr("aria-hidden","true"),n.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr("aria-hidden","false"),n.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(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),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(t){var n=this.options.disabled;if(n===!1)return;t===undefined?n=!1:(t=this._getIndex(t),e.isArray(n)?n=e.map(n,function(e){return e!==t?e:null}):n=e.map(this.tabs,function(e,n){return n!==t?n:null})),this._setupDisabled(n)},disable:function(t){var n=this.options.disabled;if(n===!0)return;if(t===undefined)n=!0;else{t=this._getIndex(t);if(e.inArray(t,n)!==-1)return;e.isArray(n)?n=e.merge([t],n).sort():n=[t]}this._setupDisabled(n)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),s=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),u={tab:i,panel:o};if(this._isLocal(s[0]))return;this.xhr=e.ajax(this._ajaxSettings(s,n,u)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){o.html(e),r._trigger("load",n,u)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),o.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}})}),function(e){typeof e.fn.each2=="undefined"&&e.extend(e.fn,{each2:function(t){var n=e([0]),r=-1,i=this.length;while(++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1);return this}})}(jQuery),function(e,t){function p(t){var n=e(document.createTextNode(""));t.before(n),n.before(t),n.remove()}function d(e){function t(e){return h[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function v(e,t){var n=0,r=t.length;for(;n<r;n+=1)if(g(e,t[n]))return n;return-1}function m(){var t=e(c);t.appendTo(document.body);var n={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),n}function g(e,n){return e===n?!0:e===t||n===t?!1:e===null||n===null?!1:e.constructor===String?e+""==n+"":n.constructor===String?n+""==e+"":!1}function y(e,t,n){var r,i,s;if(e===null||e.length<1)return[];r=e.split(t);for(i=0,s=r.length;i<s;i+=1)r[i]=n(r[i]);return r}function b(e){return e.outerWidth(!1)-e.width()}function w(n){var r="keyup-change-value";n.on("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.on("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function E(n){n.on("mousemove",function(n){var r=u;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function S(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function x(e,t){var n=S(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){v(e.target,t.get())>=0&&n(e)})}function T(e){if(e[0]===document.activeElement)return;window.setTimeout(function(){var t=e[0],n=e.val().length,r;e.focus();var i=t.offsetWidth>0||t.offsetHeight>0;i&&t===document.activeElement&&(t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&(r=t.createTextRange(),r.collapse(!1),r.select()))},0)}function N(t){t=e(t)[0];var n=0,r=0;if("selectionStart"in t)n=t.selectionStart,r=t.selectionEnd-n;else if("selection"in document){t.focus();var i=document.selection.createRange();r=document.selection.createRange().text.length,i.moveStart("character",-t.value.length),n=i.text.length-r}return{offset:n,length:r}}function C(e){e.preventDefault(),e.stopPropagation()}function k(e){e.preventDefault(),e.stopImmediatePropagation()}function L(t){if(!o){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);o=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),o.attr("class","select2-sizer"),e(document.body).append(o)}return o.text(t.val()),o.width()}function A(t,n,r){var i,s=[],o;i=e.trim(t.attr("class")),i&&(i=""+i,e(i.split(/\s+/)).each2(function(){this.indexOf("select2-")===0&&s.push(this)})),i=e.trim(n.attr("class")),i&&(i=""+i,e(i.split(/\s+/)).each2(function(){this.indexOf("select2-")!==0&&(o=r(this),o&&s.push(o))})),t.attr("class",s.join(" "))}function O(e,t,n,r){var i=d(e.toUpperCase()).indexOf(d(t.toUpperCase())),s=t.length;if(i<0){n.push(r(e));return}n.push(r(e.substring(0,i))),n.push("<span class='select2-match'>"),n.push(r(e.substring(i,i+s))),n.push("</span>"),n.push(r(e.substring(i+s,e.length)))}function M(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function _(n){var r,i=null,s=n.quietMillis||100,o=n.url,u=this;return function(a){window.clearTimeout(r),r=window.setTimeout(function(){var r=n.data,s=o,f=n.transport||e.fn.select2.ajaxDefaults.transport,l={type:n.type||"GET",cache:n.cache||!1,jsonpCallback:n.jsonpCallback||t,dataType:n.dataType||"json"},c=e.extend({},e.fn.select2.ajaxDefaults.params,l);r=r?r.call(u,a.term,a.page,a.context):null,s=typeof s=="function"?s.call(u,a.term,a.page,a.context):s,i&&typeof i.abort=="function"&&i.abort(),n.params&&(e.isFunction(n.params)?e.extend(c,n.params.call(u)):e.extend(c,n.params)),e.extend(c,{url:s,dataType:n.dataType,data:r,success:function(e){var t=n.results(e,a.page,a);a.callback(t)},error:function(e,t,n){var r={hasError:!0,jqXHR:e,textStatus:t,errorThrown:n};a.callback(r)}}),i=f.call(u,c)},s)}}function D(t){var n=t,r,i,s=function(e){return""+e.text};e.isArray(n)&&(i=n,n={results:i}),e.isFunction(n)===!1&&(i=n,n=function(){return i});var o=n();return o.text&&(s=o.text,e.isFunction(s)||(r=o.text,s=function(e){return e[r]})),function(t){var r=t.term,i={results:[]},o;if(r===""){t.callback(n());return}o=function(n,i){var u,a;n=n[0];if(n.children){u={};for(a in n)n.hasOwnProperty(a)&&(u[a]=n[a]);u.children=[],e(n.children).each2(function(e,t){o(t,u.children)}),(u.children.length||t.matcher(r,s(u),n))&&i.push(u)}else t.matcher(r,s(n),n)&&i.push(n)},e(n().results).each2(function(e,t){o(t,i.results)}),t.callback(i)}}function P(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]},u=r?n(i):n;e.isArray(u)&&(e(u).each(function(){var e=this.text!==t,n=e?this.text:this;(s===""||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o))}}function H(t,n){if(e.isFunction(t))return!0;if(!t)return!1;if(typeof t=="string")return!0;throw new Error(n+" must be a string, function, or falsy value")}function B(t,n){if(e.isFunction(t)){var r=Array.prototype.slice.call(arguments,2);return t.apply(n,r)}return t}function j(t){var n=0;return e.each(t,function(e,t){t.children?n+=j(t.children):n++}),n}function F(e,n,r,i){var s=e,o=!1,u,a,f,l,c;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){a=-1;for(f=0,l=i.tokenSeparators.length;f<l;f++){c=i.tokenSeparators[f],a=e.indexOf(c);if(a>=0)break}if(a<0)break;u=e.substring(0,a),e=e.substring(a+c.length);if(u.length>0){u=i.createSearchChoice.call(this,u,n);if(u!==t&&u!==null&&i.id(u)!==t&&i.id(u)!==null){o=!1;for(f=0,l=n.length;f<l;f++)if(g(i.id(u),i.id(n[f]))){o=!0;break}o||r(u)}}}if(s!==e)return e}function I(){var t=this;e.each(arguments,function(e,n){t[n].remove(),t[n]=null})}function q(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}if(window.Select2!==t)return;var n,r,i,s,o,u={x:0,y:0},a,f,l={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){e=e.which?e.which:e;switch(e){case l.LEFT:case l.RIGHT:case l.UP:case l.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case l.SHIFT:case l.CTRL:case l.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&e<=123}},c="<div class='select2-measure-scrollbar'></div>",h={"Ⓐ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};a=e(document),s=function(){var e=1;return function(){return e++}}(),n=q(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,i,o=".select2-results";this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&n.element.data("select2")!==null&&n.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e(".select2-hidden-accessible"),this.liveRegion.length==0&&(this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+s()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",n.element.attr("title")),this.body=e(document.body),A(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",n.element.attr("style")),this.container.css(B(n.containerCss,this.opts.element)),this.container.addClass(B(n.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",C),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),A(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(B(n.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",C),this.results=r=this.container.find(o),this.search=i=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",C),E(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())})),x(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&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop();i>0&&s-i<=0?(r.scrollTop(0),C(e)):i<0&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),C(e))}),w(i),i.on("keyup-change input paste",this.bind(this.updateResults)),i.on("focus",function(){i.addClass("select2-focused")}),i.on("blur",function(){i.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()),n.maximumInputLength!==null&&this.search.attr("maxlength",n.maximumInputLength);var u=n.element.prop("disabled");u===t&&(u=!1),this.enable(!u);var a=n.element.prop("readonly");a===t&&(a=!1),this.readonly(a),f=f||m(),this.autofocus=n.element.prop("autofocus"),n.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",n.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,n=e.data("select2"),r=this;this.close(),e.length&&e[0].detachEvent&&r._sync&&e.each(function(){r._sync&&this.detachEvent("onpropertychange",r._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,n!==t&&(n.container.remove(),n.liveRegion.remove(),n.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()),I.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){if(e.is("option"))return{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:g(e.attr("locked"),"locked")||g(e.data("locked"),!0)};if(e.is("optgroup"))return{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}},prepareOpts:function(n){var r,i,o,u,a=this;r=n.element,r.get(0).tagName.toLowerCase()==="select"&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,o){var u,f=this.opts.id,l=this.liveRegion;u=function(r,i,c){var h,p,d,v,m,g,y,b,w,E;r=n.sortResults(r,i,o);var S=[];for(h=0,p=r.length;h<p;h+=1)d=r[h],m=d.disabled===!0,v=!m&&f(d)!==t,g=d.children&&d.children.length>0,y=e("<li></li>"),y.addClass("select2-results-dept-"+c),y.addClass("select2-result"),y.addClass(v?"select2-result-selectable":"select2-result-unselectable"),m&&y.addClass("select2-disabled"),g&&y.addClass("select2-result-with-children"),y.addClass(a.opts.formatResultCssClass(d)),y.attr("role","presentation"),b=e(document.createElement("div")),b.addClass("select2-result-label"),b.attr("id","select2-result-label-"+s()),b.attr("role","option"),E=n.formatResult(d,b,o,a.opts.escapeMarkup),E!==t&&(b.html(E),y.append(b)),g&&(w=e("<ul></ul>"),w.addClass("select2-result-sub"),u(d.children,w,c+1),y.append(w)),y.data("select2-data",d),S.push(y[0]);i.append(S),l.text(n.formatMatches(r.length))},u(i,r,0)}},e.fn.select2.defaults,n),typeof n.id!="function"&&(o=n.id,n.id=function(e){return e[o]});if(e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.data("select2Tags")}i?(n.query=this.bind(function(e){var n={results:[],more:!1},i=e.term,s,o,u;u=function(t,n){var r;t.is("option")?e.matcher(i,t.text(),t)&&n.push(a.optionToData(t)):t.is("optgroup")&&(r=a.optionToData(t),t.children().each2(function(e,t){u(t,r.children)}),r.children.length>0&&n.push(r))},s=r.children(),this.getPlaceholder()!==t&&s.length>0&&(o=this.getPlaceholderOption(),o&&(s=s.not(o))),s.each2(function(e,t){u(t,n.results)}),e.callback(n)}),n.id=function(e){return e.id}):"query"in n||("ajax"in n?(u=n.element.data("ajax-url"),u&&u.length>0&&(n.ajax.url=u),n.query=_.call(n.element,n.ajax)):"data"in n?n.query=D(n.data):"tags"in n&&(n.query=P(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(y(t.val(),n.separator,n.transformVal)).each(function(){var t={id:this,text:this},r=n.tags;e.isFunction(r)&&(r=r()),e(r).each(function(){if(g(this.id,t.id))return t=this,!1}),i.push(t)}),r(i)})));if(typeof n.query!="function")throw"query function not defined for Select2 "+n.element.attr("id");if(n.createSearchChoicePosition==="top")n.createSearchChoicePosition=function(e,t){e.unshift(t)};else if(n.createSearchChoicePosition==="bottom")n.createSearchChoicePosition=function(e,t){e.push(t)};else if(typeof n.createSearchChoicePosition!="function")throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return n},monitorSource:function(){var n=this.opts.element,r,i=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 r=n.prop("readonly");r===t&&(r=!1),this.readonly(r),this.container&&(A(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(B(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(A(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(B(this.opts.dropdownCssClass,this.opts.element)))}),n.length&&n[0].attachEvent&&n.each(function(){this.attachEvent("onpropertychange",i._sync)}),r=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,r!==t&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new r(function(t){e.each(t,i._sync)}),this.propertyObserver.observe(n.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var n=e.Event("select2-selecting",{val:this.id(t),object:t,choice:t});return this.opts.element.trigger(n),!n.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?!1:(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0);if(this._enabled===e)return;this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface()},disable:function(){this.enable(!1)},readonly:function(e){e===t&&(e=!1);if(this._readonly===e)return;this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface()},opened:function(){return this.container?this.container.hasClass("select2-dropdown-open"):!1},positionDropdown:function(){var t=this.dropdown,n=this.container,r=n.offset(),i=n.outerHeight(!1),s=n.outerWidth(!1),o=t.outerHeight(!1),u=e(window),a=u.width(),l=u.height(),c=u.scrollLeft()+a,h=u.scrollTop()+l,p=r.top+i,d=r.left,v=p+o<=h,m=r.top-o>=u.scrollTop(),g=t.outerWidth(!1),y=function(){return d+g<=c},b=function(){return r.left+c+n.outerWidth(!1)>g},w=t.hasClass("select2-drop-above"),E,S,x,T,N;w?(S=!0,!m&&v&&(x=!0,S=!1)):(S=!1,!v&&m&&(x=!0,S=!0)),x&&(t.hide(),r=this.container.offset(),i=this.container.outerHeight(!1),s=this.container.outerWidth(!1),o=t.outerHeight(!1),c=u.scrollLeft()+a,h=u.scrollTop()+l,p=r.top+i,d=r.left,g=t.outerWidth(!1),t.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(N=e(".select2-results",t)[0],t.addClass("select2-drop-auto-width"),t.css("width",""),g=t.outerWidth(!1)+(N.scrollHeight===N.clientHeight?0:f.width),g>s?s=g:g=s,o=t.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),this.body.css("position")!=="static"&&(E=this.body.offset(),p-=E.top,d-=E.left),!y()&&b()&&(d=r.left+this.container.outerWidth(!1)-g),T={left:d,width:s},S?(T.top=r.top-o,T.bottom="auto",this.container.addClass("select2-drop-above"),t.addClass("select2-drop-above")):(T.top=p,T.bottom="auto",this.container.removeClass("select2-drop-above"),t.removeClass("select2-drop-above")),T=e.extend(T,B(this.opts.dropdownCss,this.opts.element)),t.css(T)},shouldOpen:function(){var t;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(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(),a.on("mousemove.select2Event",function(e){u.x=e.pageX,u.y=e.pageY}),!0):!1},opening:function(){var t=this.containerEventName,n="scroll."+t,r="resize."+t,i="orientationchange."+t,s;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),s=e("#select2-drop-mask"),s.length===0&&(s=e(document.createElement("div")),s.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),s.hide(),s.appendTo(this.body),s.on("mousedown touchstart click",function(t){p(s);var n=e("#select2-drop"),r;n.length>0&&(r=n.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close(),t.preventDefault(),t.stopPropagation())})),this.dropdown.prev()[0]!==s[0]&&this.dropdown.before(s),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),s.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var o=this;this.container.parents().add(window).each(function(){e(this).on(r+" "+n+" "+i,function(e){o.opened()&&o.positionDropdown()})})},close:function(){if(!this.opened())return;var t=this.containerEventName,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(n).off(r).off(i)}),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(),a.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 B(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var t=this.results,n,r,i,s,o,u,a,f;r=this.highlight();if(r<0)return;if(r==0){t.scrollTop(0);return}n=this.findHighlightableChoices().find(".select2-result-label"),i=e(n[r]),f=(i.offset()||{}).top||0,s=f+i.outerHeight(!0),r===n.length-1&&(a=t.find("li.select2-more-results"),a.length>0&&(s=a.offset().top+a.outerHeight(!0))),o=t.offset().top+t.outerHeight(!1),s>o&&t.scrollTop(t.scrollTop()+(s-o)),u=f-t.offset().top,u<0&&i.css("display")!="none"&&t.scrollTop(t.scrollTop()+u)},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){var n=this.findHighlightableChoices(),r=this.highlight();while(r>-1&&r<n.length){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n=this.findHighlightableChoices(),r,i;if(arguments.length===0)return v(n.filter(".select2-highlighted")[0],n.get());t>=n.length&&(t=n.length-1),t<0&&(t=0),this.removeHighlight(),r=e(n[t]),r.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",r.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(r.text()),i=r.data("select2-data"),i&&this.opts.element.trigger({type:"select2-highlight",val:this.id(i),choice:i})},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 n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else n.length==0&&this.removeHighlight()},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n,r=this.resultsPage+1,i=this,s=this.search.val(),o=this.context;if(t.length===0)return;n=t.offset().top-e.offset().top-e.height(),n<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:s,page:r,context:o,matcher:this.opts.matcher,callback:this.bind(function(n){if(!i.opened())return;i.opts.populateResults.call(this,e,n.results,{term:s,page:r,context:o}),i.postprocessResults(n,!1,!1),n.more===!0?(t.detach().appendTo(e).html(i.opts.escapeMarkup(B(i.opts.formatLoadMore,i.opts.element,r+1))),window.setTimeout(function(){i.loadMoreIfNeeded()},10)):t.remove(),i.positionDropdown(),i.resultsPage=r,i.context=n.context,this.opts.element.trigger({type:"select2-loaded",items:n})})}))},tokenize:function(){},updateResults:function(n){function h(){r.removeClass("select2-active"),u.positionDropdown(),i.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?u.liveRegion.text(i.text()):u.liveRegion.text(u.opts.formatMatches(i.find('.select2-result-selectable:not(".select2-selected")').length))}function p(e){i.html(e),h()}var r=this.search,i=this.results,s=this.opts,o,u=this,a,f=r.val(),l=e.data(this.container,"select2-last-term"),c;if(n!==!0&&l&&g(f,l))return;e.data(this.container,"select2-last-term",f);if(n!==!0&&(this.showSearchInput===!1||!this.opened()))return;c=++this.queryCount;var d=this.getMaximumSelectionSize();if(d>=1){o=this.data();if(e.isArray(o)&&o.length>=d&&H(s.formatSelectionTooBig,"formatSelectionTooBig")){p("<li class='select2-selection-limit'>"+B(s.formatSelectionTooBig,s.element,d)+"</li>");return}}if(r.val().length<s.minimumInputLength){H(s.formatInputTooShort,"formatInputTooShort")?p("<li class='select2-no-results'>"+B(s.formatInputTooShort,s.element,r.val(),s.minimumInputLength)+"</li>"):p(""),n&&this.showSearch&&this.showSearch(!0);return}if(s.maximumInputLength&&r.val().length>s.maximumInputLength){H(s.formatInputTooLong,"formatInputTooLong")?p("<li class='select2-no-results'>"+B(s.formatInputTooLong,s.element,r.val(),s.maximumInputLength)+"</li>"):p("");return}s.formatSearching&&this.findHighlightableChoices().length===0&&p("<li class='select2-searching'>"+B(s.formatSearching,s.element)+"</li>"),r.addClass("select2-active"),this.removeHighlight(),a=this.tokenize(),a!=t&&a!=null&&r.val(a),this.resultsPage=1,s.query({element:s.element,term:r.val(),page:this.resultsPage,context:null,matcher:s.matcher,callback:this.bind(function(o){var a;if(c!=this.queryCount)return;if(!this.opened()){this.search.removeClass("select2-active");return}if(o.hasError!==t&&H(s.formatAjaxError,"formatAjaxError")){p("<li class='select2-ajax-error'>"+B(s.formatAjaxError,s.element,o.jqXHR,o.textStatus,o.errorThrown)+"</li>");return}this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&r.val()!==""&&(a=this.opts.createSearchChoice.call(u,r.val(),o.results),a!==t&&a!==null&&u.id(a)!==t&&u.id(a)!==null&&e(o.results).filter(function(){return g(u.id(this),u.id(a))}).length===0&&this.opts.createSearchChoicePosition(o.results,a));if(o.results.length===0&&H(s.formatNoMatches,"formatNoMatches")){p("<li class='select2-no-results'>"+B(s.formatNoMatches,s.element,r.val())+"</li>");return}i.empty(),u.opts.populateResults.call(this,i,o.results,{term:r.val(),page:this.resultsPage,context:null}),o.more===!0&&H(s.formatLoadMore,"formatLoadMore")&&(i.append("<li class='select2-more-results'>"+s.escapeMarkup(B(s.formatLoadMore,s.element,this.resultsPage))+"</li>"),window.setTimeout(function(){u.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),h(),this.opts.element.trigger({type:"select2-loaded",items:o})})})},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(){T(this.search)},selectHighlighted:function(e){if(this._touchMoved){this.clearTouchMoved();return}var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r?(this.highlight(t),this.onSelect(r,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 n=this.select.children("option").first();if(this.opts.placeholderOption!==t)return this.opts.placeholderOption==="first"&&n||typeof this.opts.placeholderOption=="function"&&this.opts.placeholderOption(this.select);if(e.trim(n.text())===""&&n.val()==="")return n}},initContainerWidth:function(){function n(){var n,r,i,s,o,u;if(this.opts.width==="off")return null;if(this.opts.width==="element")return this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px";if(this.opts.width==="copy"||this.opts.width==="resolve"){n=this.opts.element.attr("style");if(n!==t){r=n.split(";");for(s=0,o=r.length;s<o;s+=1){u=r[s].replace(/\s/g,""),i=u.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i);if(i!==null&&i.length>=1)return i[1]}}return this.opts.width==="resolve"?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:this.opts.element.outerWidth(!1)===0?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);r!==null&&this.container.css("width",r)}}),r=q(n,{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 n,r,i;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(),n=this.search.get(0),n.createTextRange?(r=n.createTextRange(),r.collapse(!1),r.select()):n.setSelectionRange&&(i=this.search.val().length,n.setSelectionRange(i,i))),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(){if(!this.opened())return;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),I.call(this,"selection","focusser")},initContainer:function(){var t,n=this.container,r=this.dropdown,i=s(),o;this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+i),this.focusser.attr("aria-labelledby","select2-chosen-"+i),this.results.attr("id","select2-results-"+i),this.search.attr("aria-owns","select2-results-"+i),this.focusser.attr("id","s2id_autogen"+i),o=e("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(o.text()).attr("for",this.focusser.attr("id"));var u=this.opts.element.attr("title");this.opts.element.attr("title",u||o.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())return;if(229==e.keyCode)return;if(e.which===l.PAGE_UP||e.which===l.PAGE_DOWN){C(e);return}switch(e.which){case l.UP:case l.DOWN:this.moveHighlight(e.which===l.UP?-1:1),C(e);return;case l.ENTER:this.selectHighlighted(),C(e);return;case l.TAB:this.selectHighlighted({noFocus:!0});return;case l.ESC:this.cancel(e),C(e);return}})),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())return;if(e.which===l.TAB||l.isControl(e)||l.isFunctionKey(e)||e.which===l.ESC)return;if(this.opts.openOnEnter===!1&&e.which===l.ENTER){C(e);return}if(e.which==l.DOWN||e.which==l.UP||e.which==l.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;this.open(),C(e);return}if(e.which==l.DELETE||e.which==l.BACKSPACE){this.opts.allowClear&&this.clear(),C(e);return}})),w(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){e.stopPropagation();if(this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){if(!this.isInterfaceEnabled())return;this.clear(),k(e),this.close(),this.selection&&this.selection.focus()})),t.on("mousedown touchstart",this.bind(function(n){p(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),C(n)})),r.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){C(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 n=this.selection.data("select2-data");if(n){var r=e.Event("select2-clearing");this.opts.element.trigger(r);if(r.isDefaultPrevented())return;var i=this.getPlaceholderOption();this.opts.element.val(i?i.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(n),choice:n}),this.triggerChange({removed:n}))}},initSelection:function(){var e;if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.setPlaceholder(),n.nextSearchTerm=n.opts.nextSearchTerm(e,n.search.val()))})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()===t?!1:(e=this.getPlaceholderOption())!==t&&e.prop("selected")||this.opts.element.val()===""||this.opts.element.val()===t||this.opts.element.val()===null},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),n=this;return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var r=e.find("option").filter(function(){return this.selected&&!this.disabled});t(n.optionToData(r))}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val(),s=null;t.query({matcher:function(e,n,r){var o=g(i,t.id(r));return o&&(s=r),o},callback:e.isFunction(r)?function(){r(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,n){var r=0,i=this,s=!0;this.findHighlightableChoices().each2(function(e,t){if(g(i.id(t.data("select2-data")),i.opts.element.val()))return r=e,!1}),n!==!1&&(t===!0&&r>=0?this.highlight(r):this.highlight(0));if(t===!0){var o=this.opts.minimumResultsForSearch;o>=0&&this.showSearch(j(e.results)>=o)}},showSearch:function(t){if(this.showSearchInput===t)return;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))return;var n=this.opts.element.val(),r=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(),g(n,this.id(e))||this.triggerChange({added:e,removed:r})},updateSelection:function(e){var n=this.selection.find(".select2-chosen"),r,i;this.selection.data("select2-data",e),n.empty(),e!==null&&(r=this.opts.formatSelection(e,n,this.opts.escapeMarkup)),r!==t&&n.append(r),i=this.opts.formatSelectionCssClass(e,n),i!==t&&n.addClass(i),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,n=!1,r=null,i=this,s=this.data();if(arguments.length===0)return this.opts.element.val();e=arguments[0],arguments.length>1&&(n=arguments[1]);if(this.select)this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return r=i.optionToData(t),!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange({added:r,removed:s});else{if(!e&&e!==0){this.clear(n);return}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){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange({added:e,removed:s})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n,r=!1;if(arguments.length===0)return n=this.selection.data("select2-data"),n==t&&(n=null),n;arguments.length>1&&(r=arguments[1]),e?(n=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),r&&this.triggerChange({added:e,removed:n})):this.clear(r)}}),i=q(n,{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),n=this;return t.element.get(0).tagName.toLowerCase()==="select"?t.initSelection=function(e,t){var r=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){r.push(n.optionToData(t))}),t(r)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=y(n.val(),t.separator,t.transformVal),s=[];t.query({matcher:function(n,r,o){var u=e.grep(i,function(e){return g(e,t.id(o))}).length;return u&&s.push(o),u},callback:e.isFunction(r)?function(){var e=[];for(var n=0;n<i.length;n++){var o=i[n];for(var u=0;u<s.length;u++){var a=s[u];if(g(o,t.id(a))){e.push(a),s.splice(u,1);break}}}r(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");if(!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),I.call(this,"searchContainer","selection")},initContainer:function(){var t=".select2-choices",n;this.searchContainer=this.container.find(".select2-search-field"),this.selection=n=this.container.find(t);var r=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(t){r.search[0].focus(),r.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+s()),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(){if(this.search.attr("placeholder")&&this.search.val().length==0)return;if(!this.isInterfaceEnabled())return;this.opened()||this.open()})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(!this.isInterfaceEnabled())return;++this.keydowns;var t=n.find(".select2-search-choice-focus"),r=t.prev(".select2-search-choice:not(.select2-locked)"),i=t.next(".select2-search-choice:not(.select2-locked)"),s=N(this.search);if(!(!t.length||e.which!=l.LEFT&&e.which!=l.RIGHT&&e.which!=l.BACKSPACE&&e.which!=l.DELETE&&e.which!=l.ENTER)){var o=t;e.which==l.LEFT&&r.length?o=r:e.which==l.RIGHT?o=i.length?i:null:e.which===l.BACKSPACE?this.unselect(t.first())&&(this.search.width(10),o=r.length?r:i):e.which==l.DELETE?this.unselect(t.first())&&(this.search.width(10),o=i.length?i:null):e.which==l.ENTER&&(o=null),this.selectChoice(o),C(e),(!o||!o.length)&&this.open();return}if((e.which===l.BACKSPACE&&this.keydowns==1||e.which==l.LEFT)&&s.offset==0&&!s.length){this.selectChoice(n.find(".select2-search-choice:not(.select2-locked)").last()),C(e);return}this.selectChoice(null);if(this.opened())switch(e.which){case l.UP:case l.DOWN:this.moveHighlight(e.which===l.UP?-1:1),C(e);return;case l.ENTER:this.selectHighlighted(),C(e);return;case l.TAB:this.selectHighlighted({noFocus:!0}),this.close();return;case l.ESC:this.cancel(e),C(e);return}if(e.which===l.TAB||l.isControl(e)||l.isFunctionKey(e)||e.which===l.BACKSPACE||e.which===l.ESC)return;if(e.which===l.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===l.PAGE_UP||e.which===l.PAGE_DOWN)&&C(e),e.which===l.ENTER&&C(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",t,this.bind(function(t){if(!this.isInterfaceEnabled())return;if(e(t.target).closest(".select2-search-choice").length>0)return;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",t,this.bind(function(){if(!this.isInterfaceEnabled())return;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(){var e;this.opts.element.val()===""&&this.opts.element.text()===""&&(this.updateSelection([]),this.close(),this.clearSearch());if(this.select||this.opts.element.val()!==""){var n=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==t&&e!==null&&(n.updateSelection(e),n.close(),n.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),n=this.getMaxSearchWidth();e!==t&&this.getVal().length===0&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.search.width(n>0?n: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(){if(!this.opened())return;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 n=[],r=[],i=this;e(t).each(function(){v(i.id(this),n)<0&&(n.push(i.id(this)),r.push(this))}),t=r,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){i.addSelectedChoice(this)}),i.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts),e!=null&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,n){if(!this.triggerSelect(e)||e.text==="")return;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}),(!n||!n.noFocus)&&this.focusSearch()},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r=!n.locked,i=e("<li class='select2-search-choice'>    <div></div>    <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),o=r?i:s,u=this.id(n),a=this.getVal(),f,l;f=this.opts.formatSelection(n,o.find("div"),this.opts.escapeMarkup),f!=t&&o.find("div").replaceWith(e("<div></div>").html(f)),l=this.opts.formatSelectionCssClass(n,o.find("div")),l!=t&&o.addClass(l),r&&o.find(".select2-search-choice-close").on("mousedown",C).on("click dblclick",this.bind(function(t){if(!this.isInterfaceEnabled())return;this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),C(t),this.close(),this.focusSearch()})).on("focus",this.bind(function(){if(!this.isInterfaceEnabled())return;this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active")})),o.data("select2-data",n),o.insertBefore(this.searchContainer),a.push(u),this.setVal(a)},unselect:function(t){var n=this.getVal(),r,i;t=t.closest(".select2-search-choice");if(t.length===0)throw"Invalid argument: "+t+". Must be .select2-search-choice";r=t.data("select2-data");if(!r)return;var s=e.Event("select2-removing");s.val=this.id(r),s.choice=r,this.opts.element.trigger(s);if(s.isDefaultPrevented())return!1;while((i=v(this.id(r),n))>=0)n.splice(i,1),this.setVal(n),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(r),choice:r}),this.triggerChange({removed:r}),!0},postprocessResults:function(e,t,n){var r=this.getVal(),i=this.results.find(".select2-result"),s=this.results.find(".select2-result-with-children"),o=this;i.each2(function(e,t){var n=o.id(t.data("select2-data"));v(n,r)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),s.each2(function(e,t){!t.is(".select2-result-selectable")&&t.find(".select2-result-selectable:not(.select2-selected)").length===0&&t.addClass("select2-selected")}),this.highlight()==-1&&n!==!1&&this.opts.closeOnSelect===!0&&o.highlight(0),!this.opts.createSearchChoice&&!i.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&this.results.find(".select2-no-results").length===0)&&H(o.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+B(o.opts.formatNoMatches,o.opts.element,o.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-b(this.search)},resizeSearch:function(){var e,t,n,r,i,s=b(this.search);e=L(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,i<e&&(i=n-s),i<40&&(i=n-s),i<=0&&(i=e),this.search.width(Math.floor(i))},getVal:function(){var e;return this.select?(e=this.select.val(),e===null?[]:e):(e=this.opts.element.val(),y(e,this.opts.separator,this.opts.transformVal))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){v(this,n)<0&&n.push(this)}),this.opts.element.val(n.length===0?"":n.join(this.opts.separator)))},buildChangeDetails:function(e,t){var t=t.slice(0),e=e.slice(0);for(var n=0;n<t.length;n++)for(var r=0;r<e.length;r++)g(this.opts.id(t[n]),this.opts.id(e[r]))&&(t.splice(n,1),n>0&&n--,e.splice(r,1),r--);return{added:t,removed:e}},val:function(n,r){var i,s=this;if(arguments.length===0)return this.getVal();i=this.data(),i.length||(i=[]);if(!n&&n!==0){this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange({added:this.data(),removed:i});return}this.setVal(n);if(this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange(this.buildChangeDetails(i,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 n=e.map(t,s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange(s.buildChangeDetails(i,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=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,n){var r=this,i,s;if(arguments.length===0)return this.selection.children(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();s=this.data(),t||(t=[]),i=e.map(t,function(e){return r.opts.id(e)}),this.setVal(i),this.updateSelection(t),this.clearSearch(),n&&this.triggerChange(this.buildChangeDetails(s,this.data()))}}),e.fn.select2=function(){var n=Array.prototype.slice.call(arguments,0),r,i,s,o,u,a=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],f=["opened","isFocused","container","dropdown"],l=["val","data"],c={search:"externalSearch"};return this.each(function(){if(n.length===0||typeof n[0]=="object")r=n.length===0?{}:e.extend({},n[0]),r.element=e(this),r.element.get(0).tagName.toLowerCase()==="select"?u=r.element.prop("multiple"):(u=r.multiple||!1,"tags"in r&&(r.multiple=u=!0)),i=u?new window.Select2["class"].multi:new window.Select2["class"].single,i.init(r);else{if(typeof n[0]!="string")throw"Invalid arguments to select2 plugin: "+n;if(v(n[0],a)<0)throw"Unknown method: "+n[0];o=t,i=e(this).data("select2");if(i===t)return;s=n[0],s==="container"?o=i.container:s==="dropdown"?o=i.dropdown:(c[s]&&(s=c[s]),o=i[s].apply(i,n.slice(1)));if(v(n[0],f)>=0||v(n[0],l)>=0&&n.length==1)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,n,r){var i=[];return O(this.text(e),n.term,i,r),i.join("")},transformVal:function(t){return e.trim(t)},formatSelection:function(e,n,r){return e?r(this.text(e)):t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(e,n){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 d(""+t).toUpperCase().indexOf(d(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:F,escapeMarkup:M,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null},nextSearchTerm:function(e,n){return t},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){var t="ontouchstart"in window||navigator.msMaxTouchPoints>0;return t?e.opts.minimumResultsForSearch<0?!1:!0:!0}},e.fn.select2.locales=[],e.fn.select2.locales.en={formatMatches:function(e){return e===1?"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,n){return"Loading failed"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" or more character"+(n==1?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please delete "+n+" character"+(n==1?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(e==1?"":"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:_,local:D,tags:P},util:{debounce:S,markMatch:O,escapeMarkup:M,stripDiacritics:d},"class":{"abstract":n,single:r,multi:i}}}(jQuery),define("select2",function(){}),define("app/views/folder-perm-item",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.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.path=e.path,this.render()},render:function(){return this.$el.html(this.template(this.item_data)),this},events:{mouseenter:"showPermOpIcons",mouseleave:"hidePermOpIcons","click .perm-edit-icon":"editIconClick","change .perm-toggle-select":"editPerm","click .delete-icon":"deletePerm"},showPermOpIcons:function(){this.$el.find(".op-icon").removeClass("vh")},hidePermOpIcons: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 n=this,i=e(t.currentTarget).val(),s={perm:i,path:this.path,type:"modify"},o=this.item_data.for_user;o?e.extend(s,{user:this.item_data.user}):e.extend(s,{group_id:this.item_data.group_id}),e.ajax({url:r.getUrl({name:o?"set_user_folder_perm":"set_group_folder_perm",repo_id:this.repo_id}),type:"POST",dataType:"json",cache:!1,beforeSend:r.prepareCSRFToken,data:s,success:function(){n.item_data.perm=i,n.render()},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),o?e("#user-folder-perm .error").html(n).removeClass("hide"):e("#group-folder-perm .error").html(n).removeClass("hide")}})},deletePerm:function(){var t=this,n={perm:this.item_data.perm,path:this.path,type:"delete"},i=this.item_data.for_user;return i?e.extend(n,{user:this.item_data.user}):e.extend(n,{group_id:this.item_data.group_id}),e.ajax({url:r.getUrl({name:i?"set_user_folder_perm":"set_group_folder_perm",repo_id:this.repo_id}),type:"POST",dataType:"json",cache:!1,beforeSend:r.prepareCSRFToken,data:n,success:function(){t.remove()},error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),i?e("#user-folder-perm .error").html(n).removeClass("hide"):e("#group-folder-perm .error").html(n).removeClass("hide")}}),!1}});return i}),define("app/views/folder-perm",["jquery","underscore","backbone","common","jquery.ui.tabs","select2","app/views/folder-perm-item"],function(e,t,n,r,i,s,o){var u=n.View.extend({tagName:"div",id:"folder-perm-popup",template:t.template(e("#folder-perm-popup-tmpl").html()),initialize:function(t){this.repo_id=t.repo_id,this.obj_name=t.obj_name,this.dir_path=t.dir_path,this.path=r.pathJoin([this.dir_path,this.obj_name]),this.render(),this.$el.modal({appendTo:"#main",focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.$("#folder-perm-tabs").tabs(),this.panelsInit();var n=this;e(document).on("click",function(e){var t=e.target||event.srcElement;n.$(".perm-edit-icon, .perm-toggle-select").is(t)||(n.$(".perm").removeClass("hide"),n.$(".perm-toggle-select").addClass("hide"))})},render:function(){return this.$el.html(this.template({title:gettext("Set {placeholder}'s permission").replace("{placeholder}",'<span class="op-target ellipsis ellipsis-op-target" title="'+r.HTMLescape(this.obj_name)+'">'+r.HTMLescape(this.obj_name)+"</span>")})),this},panelsInit:function(){this.$add_user_perm=this.$("#add-user-folder-perm"),this.$add_group_perm=this.$("#add-group-folder-perm");var t=this,n=this.$add_user_perm,i=this.$add_group_perm;r.ajaxGet({get_url:r.getUrl({name:"get_folder_perm_by_path",repo_id:this.repo_id}),data:{path:this.path},after_op_success:function(r){e(r.user_perms).each(function(r,i){var s=new o({repo_id:t.repo_id,path:t.path,item_data:e.extend(i,{for_user:!0})});n.after(s.el)}),e(r.group_perms).each(function(n,r){var s=new o({repo_id:t.repo_id,path:t.path,item_data:e.extend(r,{for_user:!1})});i.after(s.el)})}}),e('[name="email"]',n).select2(r.contactInputOptionsForSelect2());var s=app.pageOptions.groups||[],u="";for(var a=0,f=s.length;a<f;a++)u+='<option value="'+s[a].id+'" data-index="'+a+'">'+s[a].name+"</option>";e('[name="group"]',i).html(u).select2({placeholder:gettext("Select groups"),escapeMarkup:function(e){return e}})},events:{"click #add-user-folder-perm .submit":"addUserFolderPerm","click #add-group-folder-perm .submit":"addGroupFolderPerm"},addUserFolderPerm:function(){var t=this,n=this.$add_user_perm,i=e('[name="email"]',n).val();if(!i)return!1;var s=e('[name="permission"]',n).val();r.ajaxPost({form:n,form_id:n.attr("id"),post_url:r.getUrl({name:"set_user_folder_perm",repo_id:this.repo_id}),post_data:{path:this.path,type:"add",user:i,perm:s},after_op_success:function(r){e(r.success).each(function(e,r){var u=new o({repo_id:t.repo_id,path:t.path,item_data:{user:i,user_name:r.user_name,perm:s,for_user:!0}});n.after(u.el)}),e('[name="email"]',n).select2("val",""),e("#user-folder-perm .error").addClass("hide")},after_op_error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),e("#user-folder-perm .error").html(n).removeClass("hide")}})},addGroupFolderPerm:function(){var t=this,n=this.$add_group_perm,i=e('[name="group"]',n).val().join(",");if(!i)return!1;var s=e('[name="permission"]',n).val();r.ajaxPost({form:n,form_id:n.attr("id"),post_url:r.getUrl({name:"set_group_folder_perm",repo_id:this.repo_id}),post_data:{path:this.path,type:"add",group_id:i,perm:s},after_op_success:function(r){e(r.success).each(function(r,i){var u=new o({repo_id:t.repo_id,path:t.path,item_data:{for_user:!1,perm:s,group_id:i.group_id,group_name:i.group_name}});n.after(u.el),e("#group-folder-perm .error").addClass("hide")}),e('[name="group"]',n).select2("val","")},after_op_error:function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error:n=gettext("Failed. Please check the network."),e("#group-folder-perm .error").html(n).removeClass("hide")}})}});return u}),define("app/views/dirent",["jquery","underscore","backbone","common","file-tree","app/views/share","app/views/dialogs/dirent-mvcp","app/views/folder-perm","app/views/widgets/hl-item-view","app/views/widgets/dropdown"],function(e,t,n,r,i,s,o,u,a,f){var l=a.extend({tagName:"tr",fileTemplate:t.template(e("#dirent-file-tmpl").html()),dirTemplate:t.template(e("#dirent-dir-tmpl").html()),renameTemplate:t.template(e("#rename-form-template").html()),initialize:function(e){a.prototype.initialize.call(this),this.dirView=e.dirView,this.dir=this.dirView.dir,this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"remove",this.remove)},render:function(){var e=this.dir,t=r.pathJoin([e.path,this.model.get("obj_name")]),n=app.pageOptions.is_pro,i=app.pageOptions.file_audit_enabled,s=r.isHiDPI()?48:24,o;return this.model.get("is_dir")?o=this.dirTemplate:o=this.fileTemplate,this.$el.html(o({dirent:this.model.attributes,dirent_path:t,encoded_path:r.encodePath(t),icon_url:this.model.getIconUrl(s),url:this.model.getWebUrl(),download_url:this.model.getDownloadUrl(),category:e.category,repo_id:e.repo_id,is_repo_owner:e.is_repo_owner,is_virtual:e.is_virtual,has_been_shared_out:e.has_been_shared_out,can_generate_share_link:app.pageOptions.can_generate_share_link,can_generate_upload_link:app.pageOptions.can_generate_upload_link,is_pro:n,file_audit_enabled:i,repo_encrypted:e.encrypted})),this.$(".file-locked-icon").attr("title",gettext("locked by {placeholder}").replace("{placeholder}",this.model.get("lock_owner_name"))),this.dropdown=new f({el:this.$(".sf-dropdown")}),this.$(".img-name-link").magnificPopup(this.dirView.magnificPopupOptions),this},events:{"click .select":"select","click .file-star":"starFile","click .img-name-link":"viewImageWithPopup","click .download-dir":"downloadDir","click .share":"share","click .delete":"del","click .rename":"rename","click .mv":"mvcp","click .cp":"mvcp","click .set-folder-permission":"setFolderPerm","click .lock-file":"lockFile","click .unlock-file":"unlockFile","click .open-via-client":"open_via_client"},_hideMenu:function(){this.dropdown.hide()},select:function(){var t=this.$("[type=checkbox]");t.prop("checked")?this.model.set({selected:!0},{silent:!0}):this.model.set({selected:!1},{silent:!0});var n=this.dirView,r=n.$("#multi-dirents-op"),i=n.$("th [type=checkbox]"),s=0;n.$("tr:gt(0) [type=checkbox]").each(function(){e(this).prop("checked")&&(s+=1)});var o=n.$("#cur-dir-ops");s>0?(r.css({display:"inline-block"}),o.hide()):(r.hide(),o.show()),s==n.$("tr:gt(0)").length?i.prop("checked",!0):i.prop("checked",!1)},downloadDir:function(){var t=this.dirView.dir,n=this.model.get("obj_name"),i,s,o=gettext("Packaging..."),u=e("<p></p>"),a=function(){e.ajax({url:r.getUrl({name:"query_zip_progress"})+"?token="+s,dataType:"json",cache:!1,success:function(t){var n=t.total==0?"100%":(t.zipped/t.total*100).toFixed(0)+"%";u.html(o+" "+n),t["total"]==t["zipped"]&&(setTimeout(function(){e.modal.close()},500),clearInterval(i),location.href=r.getUrl({name:"download_dir_zip_url",zip_token:s}))},error:function(e){r.ajaxErrorHandler(e),clearInterval(i)}})};return e.ajax({url:r.getUrl({name:"zip_task",repo_id:t.repo_id}),data:{parent_dir:t.path,dirents:n},dataType:"json",success:function(t){s=t.zip_token,u.html(o).modal(),e("#simplemodal-container").css({width:"auto"}),a(),i=setInterval(a,1e3)},error:function(e){r.ajaxErrorHandler(e)}}),!1},starFile:function(){var t=this,n=this.dirView.dir,i=this.model.get("starred"),s=r.pathJoin([n.path,this.model.get("obj_name")]);return i?e.ajax({url:r.getUrl({name:"starred_files"})+"?repo_id="+n.repo_id+"&p="+encodeURIComponent(s),type:"DELETE",cache:!1,dataType:"json",beforeSend:r.prepareCSRFToken,success:function(){t.model.set({starred:!1})},error:function(e){r.ajaxErrorHandler(e)}}):e.ajax({url:r.getUrl({name:"starred_files"}),type:"POST",cache:!1,dataType:"json",beforeSend:r.prepareCSRFToken,data:{repo_id:n.repo_id,p:s},success:function(){t.model.set({starred:!0})},error:function(e){r.ajaxErrorHandler(e)}}),!1},viewImageWithPopup:function(){var t=e(".img-name-link",this.dirView.$dirent_list).index(this.$(".img-name-link"));e.magnificPopup.open(this.dirView.magnificPopupOptions,t)},share:function(){var e=this.dir,t=this.model.get("obj_name"),n=r.pathJoin([e.path,t]),i={is_repo_owner:e.is_repo_owner,is_virtual:e.is_virtual,user_perm:this.model.get("perm"),repo_id:e.repo_id,repo_encrypted:!1,is_dir:this.model.get("is_dir")?!0:!1,dirent_path:n,obj_name:t};return new s(i),!1},del:function(){var e=this.model.get("obj_name");return this.model.deleteFromServer({success:function(t){var n=gettext("Successfully deleted %(name)s").replace("%(name)s",e);r.feedback(n,"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1},rename:function(){var t=this.model.get("obj_name"),n=e(this.renameTemplate({dirent_name:t})),i=this.$(".dirent-name"),s=this.$(".dirent-op"),o=i.closest("td");o.attr("colspan",2).css({width:i.width()+s.outerWidth(),height:i.height()}).append(n),s.hide(),i.hide();var u=e('[name="newname"]',n),a=t.lastIndexOf(".");!this.model.get("is_dir")&&a!=-1?u[0].setSelectionRange(0,a):u.select(),this._hideMenu(),app.ui.freezeItemHightlight=!0;var f=function(e){app.ui.freezeItemHightlight=!1,app.ui.currentHighlightedItem&&app.ui.currentHighlightedItem.rmHighlight()},l=function(){return app.ui.freezeItemHightlight=!1,app.ui.currentHighlightedItem&&app.ui.currentHighlightedItem.rmHighlight(),n.remove(),s.show(),i.show(),o.attr("colspan",1).css({width:i.width()}),!1};e(".cancel",n).click(l);var c=this;return n.submit(function(){var i=e.trim(e('[name="newname"]',n).val());if(!i)return!1;if(i==t)return l(),!1;var s=e('[type="submit"]',n);r.disableButton(s);var o=function(t){var n;t.responseText?n=e.parseJSON(t.responseText).error_msg:n=gettext("Failed. Please check the network."),r.feedback(n,"error"),r.enableButton(s)};return c.model.rename({newname:i,success:f,error:o}),!1}),!1},mvcp:function(t){var n=e(t.currentTarget).hasClass("mv")?"mv":"cp",r={dir:this.dir,dirent:this.model,op_type:n};return this._hideMenu(),new o(r),!1},setFolderPerm:function(){var e={obj_name:this.model.get("obj_name"),dir_path:this.dir.path,repo_id:this.dir.repo_id};return this._hideMenu(),new u(e),!1},lockFile:function(){var e=this;return this._hideMenu(),this.model.lockFile({success:function(){e.$el.removeClass("hl")},error:function(e){r.ajaxErrorHandler(e)}}),!1},unlockFile:function(){var e=this;return this._hideMenu(),this.model.unlockFile({success:function(){e.$el.removeClass("hl")},error:function(e){r.ajaxErrorHandler(e)}}),!1},open_via_client:function(){return this._hideMenu(),!0}});return l}),define("app/views/dialogs/dirent-rename",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({template:t.template(e("#dirent-rename-dialog-template").html()),initialize:function(t){this.dirent=t.dirent,this.dir=t.dir,this.render(),this.$el.modal({appendTo:"#main",focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"});var n=this.$('[name="newname"]'),r=this.dirent.get("obj_name").lastIndexOf(".");!this.dirent.get("is_dir")&&r!=-1?n[0].setSelectionRange(0,r):n.select(),this.$error=this.$(".error"),this.$form=this.$("form")},render:function(){var e=this.dirent.get("is_dir")?gettext("Rename Folder"):gettext("Rename File");return this.$el.html(this.template({form_title:e,dirent_name:this.dirent.get("obj_name")})),this},events:{"submit form":"formSubmit"},formSubmit:function(){var t=this,n=e.trim(this.$('[name="newname"]').val());if(!n)return!1;if(n==this.dirent.get("obj_name"))return e.modal.close(),!1;var i=this.$('[type="submit"]');return r.disableButton(i),this.dirent.rename({newname:n,success:function(){e.modal.close()},error:function(n,s,o){var u;n.responseText?u=e.parseJSON(n.responseText).error:u=gettext("Failed. Please check the network."),t.$error.html(u).removeClass("hide"),r.enableButton(i)}}),!1}});return i}),define("app/views/dirent-grid",["jquery","underscore","backbone","common","file-tree","app/views/share","app/views/folder-perm","app/views/dialogs/dirent-mvcp","app/views/dialogs/dirent-rename"],function(e,t,n,r,i,s,o,u,a){app=app||{},app.globalState=app.globalState||{};var f=n.View.extend({tagName:"li",className:"grid-item",dirTemplate:t.template(e("#grid-view-dir-item-tmpl").html()),dirOpTemplate:t.template(e("#grid-view-dir-op-tmpl").html()),fileTemplate:t.template(e("#grid-view-file-item-tmpl").html()),fileOpTemplate:t.template(e("#grid-view-file-op-tmpl").html()),renameTemplate:t.template(e("#dirent-rename-dialog-template").html()),initialize:function(e){this.dirView=e.dirView,this.dir=this.dirView.dir,this.listenTo(this.model,"change",this.render),this.listenTo(this.model,"remove",this.remove)},render:function(){var e=this.dir,t=this.model.getPath(),n;return this.model.get("is_dir")?n=this.dirTemplate:n=this.fileTemplate,this.$el.html(n({dirent:this.model.attributes,dirent_path:t,icon_url:this.model.getIconUrl(192),url:this.model.getWebUrl(),category:e.category,repo_id:e.repo_id,is_repo_owner:e.is_repo_owner,is_pro:app.pageOptions.is_pro,repo_encrypted:e.encrypted})),this.$(".file-locked-icon").attr("title",gettext("locked by {placeholder}").replace("{placeholder}",this.model.get("lock_owner_name"))),this.$el.attr("title",this.model.get("obj_name")),this.model.get("is_img")&&this.$(".img-link, .text-link").magnificPopup(this.dirView.magnificPopupOptions),this},events:{mouseenter:"highlight",mouseleave:"rmHighlight",click:"closeMenu","click .img-link":"viewImageWithPopup","click .text-link":"viewImageWithPopup",contextmenu:"showPopupMenu"},highlight:function(){this.$(".img-link").addClass("hl"),this.$(".text-link").addClass("hl")},rmHighlight:function(){this.$(".img-link").removeClass("hl"),this.$(".text-link").removeClass("hl")},showPopupMenu:function(n){e(".grid-item-op",this.dirView.$dirent_grid).remove();var r=this.dir,i;this.model.get("is_dir")?i=this.dirOpTemplate:i=this.fileOpTemplate,this.$(".img-link").addClass("hl"),this.$(".text-link").addClass("hl");var s=i({dirent:this.model.attributes,dirent_path:this.model.getPath(),download_url:this.model.getDownloadUrl(),category:r.category,repo_id:r.repo_id,is_repo_owner:r.is_repo_owner,can_generate_share_link:app.pageOptions.can_generate_share_link,can_generate_upload_link:app.pageOptions.can_generate_upload_link,is_pro:app.pageOptions.is_pro,repo_encrypted:r.encrypted});this.$el.append(s);var o=this.$el.offset();return this.$(".grid-item-op").css({position:"absolute",left:n.pageX-o.left,top:n.pageY-o.top}),this.$(".delete").on("click",t.bind(this.del,this)),this.$(".share").on("click",t.bind(this.share,this)),this.$(".mv").on("click",t.bind(this.mvcp,this)),this.$(".cp").on("click",t.bind(this.mvcp,this)),this.$(".rename").on("click",t.bind(this.rename,this)),this.$(".open-via-client").on("click",t.bind(this.open_via_client,this)),this.$(".lock-file").on("click",t.bind(this.lockFile,this)),this.$(".unlock-file").on("click",t.bind(this.unlockFile,this)),this.$(".set-folder-permission").on("click",t.bind(this.setFolderPerm,this)),!1},viewImageWithPopup:function(){if(this.model.get("is_img")){var n=t.indexOf(this.dir.where({is_img:!0}),this.model);e.magnificPopup.open(this.dirView.magnificPopupOptions,n)}},closeMenu:function(){this.$(".grid-item-op").remove()},del:function(e){this.closeMenu();var t=this.model.get("obj_name");return this.model.deleteFromServer({success:function(e){var n=gettext("Successfully deleted %(name)s").replace("%(name)s",t);r.feedback(n,"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1},share:function(){var e=this.dir,t=this.model.get("obj_name"),n=this.model.getPath(),r={is_repo_owner:e.is_repo_owner,is_virtual:e.is_virtual,user_perm:this.model.get("perm"),repo_id:e.repo_id,repo_encrypted:!1,is_dir:this.model.get("is_dir")?!0:!1,dirent_path:n,obj_name:t};return new s(r),this.closeMenu(),!1},mvcp:function(t){var n=e(t.currentTarget).hasClass("mv")?"mv":"cp",r={dir:this.dir,dirent:this.model,op_type:n};return new u(r),this.closeMenu(),!1},rename:function(){this.closeMenu();var e={dir:this.dir,dirent:this.model};return new a(e),!1},setFolderPerm:function(){var e={obj_name:this.model.get("obj_name"),dir_path:this.dir.path,repo_id:this.dir.repo_id};return new o(e),!1},lockFile:function(){return this.closeMenu(),this.model.lockFile({success:function(){},error:function(e){r.ajaxErrorHandler(e)}}),!1},unlockFile:function(){return this.closeMenu(),this.model.unlockFile({success:function(){},error:function(e){r.ajaxErrorHandler(e)}}),!1},open_via_client:function(){return this.closeMenu(),!0}});return f}),function(e){var t=function(e,n){var r=/[^\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 n?r(n,t):function(e){return r(e,t)}};t.cache={},t.load=function(e){return document.getElementById(e).innerHTML},t.regexp=/([\s'\\])(?![^%]*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,t.func=function(e,t,n,r,i,s){if(t)return{"\n":"\\n","\r":"\\r","	":"\\t"," ":" "}[e]||"\\"+e;if(n)return n==="="?"'+_e("+r+")+'":"'+("+r+"||'')+'";if(i)return"';";if(s)return"_s+='"},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);}",typeof define=="function"&&define.amd?define("tmpl",[],function(){return t}):e.tmpl=t}(this),function(e){typeof define=="function"&&define.amd?define("jquery.iframe-transport",["jquery"],e):e(window.jQuery)}(function(e){var t=0;e.ajaxTransport("iframe",function(n){if(n.async&&(n.type==="POST"||n.type==="GET")){var r,i;return{send:function(s,o){r=e('<form style="display:none;"></form>'),i=e('<iframe src="javascript:false;" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",function(){var t,s=e.isArray(n.paramName)?n.paramName:[n.paramName];i.unbind("load").bind("load",function(){var t;try{t=i.contents();if(!t.length||!t[0].firstChild)throw new Error}catch(n){t=undefined}o(200,"success",{iframe:t}),e('<iframe src="javascript:false;"></iframe>').appendTo(r),r.remove()}),r.prop("target",i.prop("name")).prop("action",n.url).prop("method",n.type),n.formData&&e.each(n.formData,function(t,n){e('<input type="hidden"/>').prop("name",n.name).val(n.value).appendTo(r)}),n.fileInput&&n.fileInput.length&&n.type==="POST"&&(t=n.fileInput.clone(),n.fileInput.after(function(e){return t[e]}),n.paramName&&n.fileInput.each(function(t){e(this).prop("name",s[t]||n.paramName)}),r.append(n.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")),r.submit(),t&&t.length&&n.fileInput.each(function(n,r){var i=e(t[n]);e(r).prop("name",i.prop("name")),i.replaceWith(r)})}),r.append(i).appendTo(document.body)},abort:function(){i&&i.unbind("load").prop("src","javascript".concat(":false;")),r&&r.remove()}}}}),e.ajaxSetup({converters:{"iframe text":function(t){return e(t[0].body).text()},"iframe json":function(t){return e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return e(t[0].body).html()},"iframe script":function(t){return e.globalEval(e(t[0].body).text())}}})}),function(e){typeof define=="function"&&define.amd?define("jquery.fileupload",["jquery","jquery.ui.widget"],e):e(window.jQuery)}(function(e){function t(t){var n=t==="dragover";return function(r){r.dataTransfer=r.originalEvent&&r.originalEvent.dataTransfer;var i=r.dataTransfer;i&&e.inArray("Files",i.types)!==-1&&this._trigger(t,e.Event(t,{delegatedEvent:r}))!==!1&&(r.preventDefault(),n&&(i.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:undefined,fileInput:undefined,replaceFileInput:!0,paramName:undefined,singleFileUploads:!0,limitMultiFileUploads:undefined,limitMultiFileUploadSize:undefined,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:undefined,forceIframeTransport:!1,redirect:undefined,redirectParamName:undefined,postMessage:undefined,multipart:!0,maxChunkSize:undefined,uploadedBytes:undefined,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,n){return t=this.messages[t]||t.toString(),n&&e.each(n,function(e,n){t=t.replace("{"+e+"}",n)}),t},formData:function(e){return e.serializeArray()},add:function(t,n){if(t.isDefaultPrevented())return!1;(n.autoUpload||n.autoUpload!==!1&&e(this).fileupload("option","autoUpload"))&&n.process().done(function(){n.submit()})},processData:!1,contentType:!1,cache:!1},_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,n){var r=e-this.timestamp;if(!this.bitrate||!n||r>n)this.bitrate=(t-this.loaded)*(1e3/r)*8,this.loaded=t,this.timestamp=e;return this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var n;return e.type(t.formData)==="function"?t.formData(t.form):e.isArray(t.formData)?t.formData:e.type(t.formData)==="object"?(n=[],e.each(t.formData,function(e,t){n.push({name:e,value:t})}),n):[]},_getTotal:function(t){var n=0;return e.each(t,function(e,t){n+=t.size||1}),n},_initProgressObject:function(t){var n={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,n):t._progress=n},_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,n){if(t.lengthComputable){var r=Date.now?Date.now():(new Date).getTime(),i;if(n._time&&n.progressInterval&&r-n._time<n.progressInterval&&t.loaded!==t.total)return;n._time=r,i=Math.floor(t.loaded/t.total*(n.chunkSize||n._progress.total))+(n.uploadedBytes||0),this._progress.loaded+=i-n._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(r,this._progress.loaded,n.bitrateInterval),n._progress.loaded=n.loaded=i,n._progress.bitrate=n.bitrate=n._bitrateTimer.getBitrate(r,i,n.bitrateInterval),this._trigger("progress",e.Event("progress",{delegatedEvent:t}),n),this._trigger("progressall",e.Event("progressall",{delegatedEvent:t}),this._progress)}},_initProgressListener:function(t){var n=this,r=t.xhr?t.xhr():e.ajaxSettings.xhr();r.upload&&(e(r.upload).bind("progress",function(e){var r=e.originalEvent;e.lengthComputable=r.lengthComputable,e.loaded=r.loaded,e.total=r.total,n._onProgress(e,t)}),t.xhr=function(){return r})},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_initXHRData:function(t){var n=this,r,i=t.files[0],s=t.multipart||!e.support.xhrFileUpload,o=e.type(t.paramName)==="array"?t.paramName[0]:t.paramName;t.headers=e.extend({},t.headers),t.contentRange&&(t.headers["Content-Range"]=t.contentRange);if(!s||t.blob||!this._isInstanceOf("File",i))t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(i.name)+'"';s?e.support.xhrFormDataFileUpload&&(t.postMessage?(r=this._getFormData(t),t.blob?r.push({name:o,value:t.blob}):e.each(t.files,function(n,i){r.push({name:e.type(t.paramName)==="array"&&t.paramName[n]||o,value:i})})):(n._isInstanceOf("FormData",t.formData)?r=t.formData:(r=new FormData,e.each(this._getFormData(t),function(e,t){r.append(t.name,t.value)})),t.blob?r.append(o,t.blob,i.name):e.each(t.files,function(i,s){(n._isInstanceOf("File",s)||n._isInstanceOf("Blob",s))&&r.append(e.type(t.paramName)==="array"&&t.paramName[i]||o,s,s.uploadName||s.name)})),t.data=r):(t.contentType=i.type||"application/octet-stream",t.data=t.blob||i),t.blob=null},_initIframeSettings:function(t){var n=e("<a></a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&n&&n!==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 n=e(t.fileInput),r=t.paramName;return r?e.isArray(r)||(r=[r]):(r=[],n.each(function(){var t=e(this),n=t.prop("name")||"files[]",i=(t.prop("files")||[1]).length;while(i)r.push(n),i-=1}),r.length||(r=[n.prop("name")||"files[]"])),r},_initFormSettings:function(t){if(!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||e.type(t.form.prop("method"))==="string"&&t.form.prop("method")||"").toUpperCase(),t.type!=="POST"&&t.type!=="PUT"&&t.type!=="PATCH"&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var n=e.extend({},this.options,t);return this._initFormSettings(n),this._initDataSettings(n),n},_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,n,r){var i=e.Deferred(),s=i.promise();return n=n||this.options.context||s,t===!0?i.resolveWith(n,r):t===!1&&i.rejectWith(n,r),s.abort=i.promise,this._enhancePromise(s)},_addConvenienceMethods:function(t,n){var r=this,i=function(t){return e.Deferred().resolveWith(r,t).promise()};n.process=function(t,s){if(t||s)n._processQueue=this._processQueue=(this._processQueue||i([this])).pipe(function(){return n.errorThrown?e.Deferred().rejectWith(r,[n]).promise():i(arguments)}).pipe(t,s);return this._processQueue||i([this])},n.submit=function(){return this.state()!=="pending"&&(n.jqXHR=this.jqXHR=r._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)!==!1&&r._onSend(t,this)),this.jqXHR||r._getXHRPromise()},n.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",r._trigger("fail",null,this),r._getXHRPromise(!1))},n.state=function(){if(this.jqXHR)return r._getDeferredState(this.jqXHR);if(this._processQueue)return r._getDeferredState(this._processQueue)},n.processing=function(){return!this.jqXHR&&this._processQueue&&r._getDeferredState(this._processQueue)==="pending"},n.progress=function(){return this._progress},n.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),n=t&&t.split("-"),r=n&&n.length>1&&parseInt(n[1],10);return r&&r+1},_chunkedUpload:function(t,n){t.uploadedBytes=t.uploadedBytes||0;var r=this,i=t.files[0],s=i.size,o=t.uploadedBytes,u=t.maxChunkSize||s,a=this._blobSlice,f=e.Deferred(),l=f.promise(),c,h;return!(this._isXHRUpload(t)&&a&&(o||u<s))||t.data?!1:n?!0:o>=s?(i.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",i.error])):(h=function(){var n=e.extend({},t),l=n._progress.loaded;n.blob=a.call(i,o,o+u,i.type),n.chunkSize=n.blob.size,n.contentRange="bytes "+o+"-"+(o+n.chunkSize-1)+"/"+s,r._initXHRData(n),r._initProgressListener(n),c=(r._trigger("chunksend",null,n)!==!1&&e.ajax(n)||r._getXHRPromise(!1,n.context)).done(function(i,u,a){o=r._getUploadedBytes(a)||o+n.chunkSize,l+n.chunkSize-n._progress.loaded&&r._onProgress(e.Event("progress",{lengthComputable:!0,loaded:o-n.uploadedBytes,total:o-n.uploadedBytes}),n),t.uploadedBytes=n.uploadedBytes=o,n.result=i,n.textStatus=u,n.jqXHR=a,r._trigger("chunkdone",null,n),r._trigger("chunkalways",null,n),o<s?h():f.resolveWith(n.context,[i,u,a])}).fail(function(e,t,i){n.jqXHR=e,n.textStatus=t,n.errorThrown=i,r._trigger("chunkfail",null,n),r._trigger("chunkalways",null,n),f.rejectWith(n.context,[e,t,i])})},this._enhancePromise(l),l.abort=function(){return c.abort()},h(),l)},_beforeSend:function(e,t){this._active===0&&(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,n,r,i){var s=i._progress.total,o=i._response;i._progress.loaded<s&&this._onProgress(e.Event("progress",{lengthComputable:!0,loaded:s,total:s}),i),o.result=i.result=t,o.textStatus=i.textStatus=n,o.jqXHR=i.jqXHR=r,this._trigger("done",null,i)},_onFail:function(e,t,n,r){var i=r._response;r.recalculateProgress&&(this._progress.loaded-=r._progress.loaded,this._progress.total-=r._progress.total),i.jqXHR=r.jqXHR=e,i.textStatus=r.textStatus=t,i.errorThrown=r.errorThrown=n,this._trigger("fail",null,r)},_onAlways:function(e,t,n,r){this._trigger("always",null,r)},_onSend:function(t,n){n.submit||this._addConvenienceMethods(t,n);var r=this,i,s,o,u,a=r._getAJAXSettings(n),f=function(){return r._sending+=1,a._bitrateTimer=new r._BitrateTimer,i=i||((s||r._trigger("send",e.Event("send",{delegatedEvent:t}),a)===!1)&&r._getXHRPromise(!1,a.context,s)||r._chunkedUpload(a)||e.ajax(a)).done(function(e,t,n){r._onDone(e,t,n,a)}).fail(function(e,t,n){r._onFail(e,t,n,a)}).always(function(e,t,n){r._onAlways(e,t,n,a),r._sending-=1,r._active-=1;if(a.limitConcurrentUploads&&a.limitConcurrentUploads>r._sending){var i=r._slots.shift();while(i){if(r._getDeferredState(i)==="pending"){i.resolve();break}i=r._slots.shift()}}r._active===0&&r._trigger("stop")}),i};return this._beforeSend(t,a),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=e.Deferred(),this._slots.push(o),u=o.pipe(f)):(this._sequence=this._sequence.pipe(f,f),u=this._sequence),u.abort=function(){return s=[undefined,"abort","abort"],i?i.abort():(o&&o.rejectWith(a.context,s),f())},this._enhancePromise(u)):f()},_onAdd:function(t,n){var r=this,i=!0,s=e.extend({},this.options,n),o=n.files,u=o.length,a=s.limitMultiFileUploads,f=s.limitMultiFileUploadSize,l=s.limitMultiFileUploadSizeOverhead,c=0,h=this._getParamName(s),p,d,v,m,g=0;f&&(!u||o[0].size===undefined)&&(f=undefined);if(!(s.singleFileUploads||a||f)||!this._isXHRUpload(s))v=[o],p=[h];else if(!s.singleFileUploads&&!f&&a){v=[],p=[];for(m=0;m<u;m+=a)v.push(o.slice(m,m+a)),d=h.slice(m,m+a),d.length||(d=h),p.push(d)}else if(!s.singleFileUploads&&f){v=[],p=[];for(m=0;m<u;m+=1){c+=o[m].size+l;if(m+1===u||c+o[m+1].size+l>f||a&&m+1-g>=a)v.push(o.slice(g,m+1)),d=h.slice(g,m+1),d.length||(d=h),p.push(d),g=m+1,c=0}}else p=h;return n.originalFiles=o,e.each(v||o,function(s,o){var u=e.extend({},n);return u.files=v?o:[o],u.paramName=p[s],r._initResponseObject(u),r._initProgressObject(u),r._addConvenienceMethods(t,u),i=r._trigger("add",e.Event("add",{delegatedEvent:t}),u),i}),i},_replaceFileInput:function(t){var n=t.fileInput,r=n.clone(!0);t.fileInputClone=r,e("<form></form>").append(r)[0].reset(),n.after(r).detach(),e.cleanData(n.unbind("remove")),this.options.fileInput=this.options.fileInput.map(function(e,t){return t===n[0]?r[0]:t}),n[0]===this.element[0]&&(this.element=r)},_handleFileTreeEntry:function(t,n){var r=this,i=e.Deferred(),s=function(e){e&&!e.entry&&(e.entry=t),i.resolve([e])},o=function(e){r._handleFileTreeEntries(e,n+t.name+"/").done(function(e){i.resolve(e)}).fail(s)},u=function(){a.readEntries(function(e){e.length?(f=f.concat(e),u()):o(f)},s)},a,f=[];return n=n||"",t.isFile?t._file?(t._file.relativePath=n,i.resolve(t._file)):t.file(function(e){e.relativePath=n,i.resolve(e)},s):t.isDirectory?(a=t.createReader(),u()):i.resolve([]),i.promise()},_handleFileTreeEntries:function(t,n){var r=this;return e.when.apply(e,e.map(t,function(e){return r._handleFileTreeEntry(e,n)})).pipe(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(t){t=t||{};var n=t.items;return n&&n.length&&(n[0].webkitGetAsEntry||n[0].getAsEntry)?this._handleFileTreeEntries(e.map(n,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 n=t.prop("webkitEntries")||t.prop("entries"),r,i;if(n&&n.length)return this._handleFileTreeEntries(n);r=e.makeArray(t.prop("files"));if(!r.length){i=t.prop("value");if(!i)return e.Deferred().resolve([]).promise();r=[{name:i.replace(/^.*\\/,"")}]}else r[0].name===undefined&&r[0].fileName&&e.each(r,function(e,t){t.name=t.fileName,t.size=t.fileSize});return e.Deferred().resolve(r).promise()},_getFileInputFiles:function(t){return t instanceof e&&t.length!==1?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).pipe(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(t)},_onChange:function(t){var n=this,r={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(r.fileInput).always(function(i){r.files=i,n.options.replaceFileInput&&n._replaceFileInput(r),n._trigger("change",e.Event("change",{delegatedEvent:t}),r)!==!1&&n._onAdd(t,r)})},_onPaste:function(t){var n=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,r={files:[]};n&&n.length&&(e.each(n,function(e,t){var n=t.getAsFile&&t.getAsFile();n&&r.files.push(n)}),this._trigger("paste",e.Event("paste",{delegatedEvent:t}),r)!==!1&&this._onAdd(t,r))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var n=this,r=t.dataTransfer,i={};r&&r.files&&r.files.length&&(t.preventDefault(),this._getDroppedFiles(r).always(function(r){i.files=r,n._trigger("drop",e.Event("drop",{delegatedEvent:t}),i)!==!1&&n._onAdd(t,i)}))},_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,n){var r=e.inArray(t,this._specialOptions)!==-1;r&&this._destroyEventHandlers(),this._super(t,n),r&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;t.fileInput===undefined?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("/"),n=t.pop();return t.shift(),new RegExp(t.join("/"),n)},_isRegExpOption:function(t,n){return t!=="url"&&e.type(n)==="string"&&/^\/.*\/[igm]{0,3}$/.test(n)},_initDataAttributes:function(){var t=this,n=this.options,r=e(this.element[0].cloneNode(!1)),i=r.data();r.remove(),e.each(i,function(e,i){var s="data-"+e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();r.attr(s)&&(t._isRegExpOption(e,i)&&(i=t._getRegExp(i)),n[e]=i)})},_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 n=this;if(!t||this.options.disabled)return;t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always(function(e){t.files=e,n._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 n=this,r=e.Deferred(),i=r.promise(),s,o;return i.abort=function(){return o=!0,s?s.abort():(r.reject(null,"abort","abort"),i)},this._getFileInputFiles(t.fileInput).always(function(e){if(o)return;if(!e.length){r.reject();return}t.files=e,s=n._onSend(null,t),s.then(function(e,t,n){r.resolve(e,t,n)},function(e,t,n){r.reject(e,t,n)})}),this._enhancePromise(i)}t.files=e.makeArray(t.files);if(t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})}),function(e){typeof define=="function"&&define.amd?define("jquery.fileupload-process",["jquery","jquery.fileupload"],e):e(window.jQuery)}(function(e){var t=e.blueimp.fileupload.prototype.options.add;e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{processQueue:[],add:function(n,r){var i=e(this);r.process(function(){return i.fileupload("process",r)}),t.call(this,n,r)}},processActions:{},_processFile:function(t,n){var r=this,i=e.Deferred().resolveWith(r,[t]),s=i.promise();return this._trigger("process",null,t),e.each(t.processQueue,function(t,i){var o=function(t){return n.errorThrown?e.Deferred().rejectWith(r,[n]).promise():r.processActions[i.action].call(r,t,i)};s=s.pipe(o,i.always&&o)}),s.done(function(){r._trigger("processdone",null,t),r._trigger("processalways",null,t)}).fail(function(){r._trigger("processfail",null,t),r._trigger("processalways",null,t)}),s},_transformProcessQueue:function(t){var n=[];e.each(t.processQueue,function(){var r={},i=this.action,s=this.prefix===!0?i:this.prefix;e.each(this,function(n,i){e.type(i)==="string"&&i.charAt(0)==="@"?r[n]=t[i.slice(1)||(s?s+n.charAt(0).toUpperCase()+n.slice(1):n)]:r[n]=i}),n.push(r)}),t.processQueue=n},processing:function(){return this._processing},process:function(t){var n=this,r=e.extend({},this.options,t);return r.processQueue&&r.processQueue.length&&(this._transformProcessQueue(r),this._processing===0&&this._trigger("processstart"),e.each(t.files,function(i){var s=i?e.extend({},r):r,o=function(){return t.errorThrown?e.Deferred().rejectWith(n,[t]).promise():n._processFile(s,t)};s.index=i,n._processing+=1,n._processingQueue=n._processingQueue.pipe(o,o).always(function(){n._processing-=1,n._processing===0&&n._trigger("processstop")})})),this._processingQueue},_create:function(){this._super(),this._processing=0,this._processingQueue=e.Deferred().resolveWith(this).promise()}})}),function(e){typeof define=="function"&&define.amd?define("jquery.fileupload-validate",["jquery","jquery.fileupload-process"],e):e(window.jQuery)}(function(e){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,n){if(n.disabled)return t;var r=e.Deferred(),i=this.options,s=t.files[t.index],o;if(n.minFileSize||n.maxFileSize)o=s.size;return e.type(n.maxNumberOfFiles)==="number"&&(i.getNumberOfFiles()||0)+t.files.length>n.maxNumberOfFiles?s.error=i.i18n("maxNumberOfFiles"):n.acceptFileTypes&&!n.acceptFileTypes.test(s.type)&&!n.acceptFileTypes.test(s.name)?s.error=i.i18n("acceptFileTypes"):o>n.maxFileSize?s.error=i.i18n("maxFileSize"):e.type(o)==="number"&&o<n.minFileSize?s.error=i.i18n("minFileSize"):delete s.error,s.error||t.files.error?(t.files.error=!0,r.rejectWith(this,[t])):r.resolveWith(this,[t]),r.promise()}}})}),function(e){typeof define=="function"&&define.amd?define("jquery.fileupload-ui",["jquery","tmpl","jquery.iframe-transport","jquery.fileupload-validate"],e):e(window.jQuery,window.tmpl)}(function(e,t){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:undefined,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,n){if(t.isDefaultPrevented())return!1;var r=e(this),i=r.data("blueimp-fileupload")||r.data("fileupload"),s=i.options;n.context=i._renderUpload(n.files).data("data",n).addClass("processing"),s.filesContainer[s.prependFiles?"prepend":"append"](n.context),i._forceReflow(n.context),i._transition(n.context),n.process(function(){return r.fileupload("process",n)}).always(function(){n.context.each(function(t){e(this).find(".size").text(i._formatFileSize(n.files[t].size))}).removeClass("processing"),i._renderPreviews(n)}).done(function(){n.context.find(".start").prop("disabled",!1),i._trigger("added",t,n)!==!1&&(s.autoUpload||n.autoUpload)&&n.autoUpload!==!1&&n.submit()}).fail(function(){n.files.error&&n.context.each(function(t){var r=n.files[t].error;r&&e(this).find(".error").text(r)})})},send:function(t,n){if(t.isDefaultPrevented())return!1;var r=e(this).data("blueimp-fileupload")||e(this).data("fileupload");return n.context&&n.dataType&&n.dataType.substr(0,6)==="iframe"&&n.context.find(".progress").addClass(!e.support.transition&&"progress-animated").attr("aria-valuenow",100).children().first().css("width","100%"),r._trigger("sent",t,n)},done:function(t,n){if(t.isDefaultPrevented())return!1;var r=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),i=n.getFilesFromResponse||r.options.getFilesFromResponse,s=i(n),o,u;n.context?n.context.each(function(i){var a=s[i]||{error:"Empty file upload result"};u=r._addFinishedDeferreds(),r._transition(e(this)).done(function(){var i=e(this);o=r._renderDownload([a]).replaceAll(i),r._forceReflow(o),r._transition(o).done(function(){n.context=e(this),r._trigger("completed",t,n),r._trigger("finished",t,n),u.resolve()})})}):(o=r._renderDownload(s)[r.options.prependFiles?"prependTo":"appendTo"](r.options.filesContainer),r._forceReflow(o),u=r._addFinishedDeferreds(),r._transition(o).done(function(){n.context=e(this),r._trigger("completed",t,n),r._trigger("finished",t,n),u.resolve()}))},fail:function(t,n){if(t.isDefaultPrevented())return!1;var r=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),i,s;n.context?n.context.each(function(o){var u=n.files[o];n.errorThrown!=="abort"?(!u.error&&n.jqXHR&&n.jqXHR.responseJSON&&(u.error=n.jqXHR.responseJSON.error),u.error||(u.error=n.i18n("unknownError"))):u.canceled=!0,s=r._addFinishedDeferreds(),r._transition(e(this)).done(function(){var o=e(this);i=r._renderDownload([u]).replaceAll(o),r._forceReflow(i),r._transition(i).done(function(){n.context=e(this),r._trigger("failed",t,n),r._trigger("finished",t,n),s.resolve()})})}):n.errorThrown!=="abort"?(n.context=r._renderUpload(n.files)[r.options.prependFiles?"prependTo":"appendTo"](r.options.filesContainer).data("data",n),r._forceReflow(n.context),s=r._addFinishedDeferreds(),r._transition(n.context).done(function(){n.context=e(this),r._trigger("failed",t,n),r._trigger("finished",t,n),s.resolve()})):(r._trigger("failed",t,n),r._trigger("finished",t,n),r._addFinishedDeferreds().resolve())},progress:function(t,n){if(t.isDefaultPrevented())return!1;var r=Math.floor(n.loaded/n.total*100);n.context&&n.context.each(function(){e(this).find(".progress").attr("aria-valuenow",r).children().first().css("width",r+"%")})},progressall:function(t,n){if(t.isDefaultPrevented())return!1;var r=e(this),i=Math.floor(n.loaded/n.total*100),s=r.find(".fileupload-progress"),o=s.find(".progress-extended");o.length&&o.html((r.data("blueimp-fileupload")||r.data("fileupload"))._renderExtendedProgress(n)),s.find(".progress").attr("aria-valuenow",i).children().first().css("width",i+"%")},start:function(t){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload");n._resetFinishedDeferreds(),n._transition(e(this).find(".fileupload-progress")).done(function(){n._trigger("started",t)})},stop:function(t){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),r=n._addFinishedDeferreds();e.when.apply(e,n._getFinishedDeferreds()).done(function(){n._trigger("stopped",t)}),n._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;"),r.resolve()})},processstart:function(t){if(t.isDefaultPrevented())return!1;e(this).addClass("fileupload-processing")},processstop:function(t){if(t.isDefaultPrevented())return!1;e(this).removeClass("fileupload-processing")},destroy:function(t,n){if(t.isDefaultPrevented())return!1;var r=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),i=function(){r._transition(n.context).done(function(){e(this).remove(),r._trigger("destroyed",t,n)})};n.url?(n.dataType=n.dataType||r.options.dataType,e.ajax(n).done(i).fail(function(){r._trigger("destroyfailed",t,n)})):i()}},_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),n=t.prop("href"),r=t.prop("download"),i="application/octet-stream";t.bind("dragstart",function(e){try{e.originalEvent.dataTransfer.setData("DownloadURL",[i,r,n].join(":"))}catch(t){}})},_formatFileSize:function(e){return typeof e!="number"?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"},_formatBitrate:function(e){return typeof e!="number"?"":(e/=8,e>=1e9?(e/1e9).toFixed(2)+" GB/s":e>=1e6?(e/1e6).toFixed(2)+" MB/s":e>=1e3?(e/1e3).toFixed(2)+" KB/s":e.toFixed(2)+" B/s")},_formatTime:function(e){var t=new Date(e*1e3),n=Math.floor(e/86400);return n=n?n+"d ":"",n+("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)},_formatPercentage:function(e){return(e*100).toFixed(2)+" %"},_renderExtendedProgress:function(e){return this._formatBitrate(e.bitrate)+" | "+this._formatTime((e.total-e.loaded)*8/e.bitrate)+" | "+this._formatPercentage(e.loaded/e.total)+" | "+this._formatFileSize(e.loaded)+" / "+this._formatFileSize(e.total)},_renderTemplate:function(t,n){if(!t)return e();var r=t({files:n,formatFileSize:this._formatFileSize,options:this.options});return r instanceof e?r:e(this.options.templatesContainer).html(r).children()},_renderPreviews:function(t){t.context.find(".preview").each(function(n,r){e(r).append(t.files[n].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 n=e(t.currentTarget),r=n.closest(".template-upload"),i=r.data("data");n.prop("disabled",!0),i&&i.submit&&i.submit()},_cancelHandler:function(t){t.preventDefault();var n=e(t.currentTarget).closest(".template-upload,.template-download"),r=n.data("data")||{};r.context=r.context||n,r.abort?r.abort():(r.errorThrown="abort",this._trigger("fail",t,r))},_deleteHandler:function(t){t.preventDefault();var n=e(t.currentTarget);this._trigger("destroy",t,e.extend({context:n.closest(".template-download"),type:"DELETE"},n.data()))},_forceReflow:function(t){return e.support.transition&&t.length&&t[0].offsetWidth},_transition:function(t){var n=e.Deferred();return e.support.transition&&t.hasClass("fade")&&t.is(":visible")?t.bind(e.support.transition.end,function(r){r.target===t[0]&&(t.unbind(e.support.transition.end),n.resolveWith(t))}).toggleClass("in"):(t.toggleClass("in"),n.resolveWith(t)),n},_initButtonBarEventHandlers:function(){var t=this.element.find(".fileupload-buttonbar"),n=this.options.filesContainer;this._on(t.find(".start"),{click:function(e){e.preventDefault(),n.find(".start").click()}}),this._on(t.find(".cancel"),{click:function(e){e.preventDefault(),n.find(".cancel").click()}}),this._on(t.find(".delete"),{click:function(e){e.preventDefault(),n.find(".toggle:checked").closest(".template-download").find(".delete").click(),t.find(".toggle").prop("checked",!1)}}),this._on(t.find(".toggle"),{change:function(t){n.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;t.filesContainer===undefined?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,n){window.locale={fileupload:{errors:{maxFileSize:gettext("File is too big"),minFileSize:gettext("File is too small"),acceptFileTypes:gettext("Filetype not allowed"),maxNumberOfFiles:gettext("Max 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 r=t.View.extend({el:$("#upload-file-dialog"),fileupdateConfirmTemplate:_.template($("#fileupdate-confirm-template").html()),initialize:function(t){var n=this.dirView=t.dirView,r=n.dir,i=this.$el.addClass("fixed-upload-file-dialog");this.popup_height="200px";var s=$(".status",i),o=$(".total-progress",i),u=$(".fileupload-buttonbar .cancel",i),a=$(".sf-close",i),f=$(".saving-tip",i),l={uploading:gettext("File Uploading..."),complete:gettext("File Upload complete"),canceled:gettext("File Upload canceled"),failed:gettext("File Upload failed")},c=[],h=[],p=app.pageOptions.enable_upload_folder,d=app.pageOptions.enable_resumable_fileupload,v=[],m=[],g=this;i.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(!n.$el.is(":visible"))return!1;if(r.user_perm&&r.user_perm!="rw")return!1;i.removeClass("hide"),u.removeClass("hide"),a.addClass("hide");var s=r.path;i.fileupload("option",{formData:{parent_dir:s=="/"?s:s+"/"},maxChunkSize:undefined,uploadedBytes:undefined});if(!p)return;var o=n.$("#upload-menu");o.hasClass("hide")||o.addClass("hide");var f=t.files[0];if(f.name=="."){t.files.shift();return}t.fileInput?f.webkitRelativePath&&(f.relative_path=f.webkitRelativePath):f.relativePath&&(f.relative_path=f.relativePath+f.name)}).bind("fileuploadstart",function(){s.html(l.uploading)}).bind("fileuploadsubmit",function(t,n){if(n.files.length==0)return!1;var s=n.files[0];if(s.error)return!1;var o=function(){$.ajax({url:e.getUrl({name:"get_file_op_url",repo_id:r.repo_id}),data:{op_type:"upload",path:r.path},cache:!1,dataType:"json",success:function(t){if(p&&s.relative_path){var o=s.relative_path,u=o.substring(0,o.lastIndexOf("/")+1),a=i.fileupload("option","formData");a.relative_path=u,i.fileupload("option",{formData:a}),n.url=t.url,n.jqXHR=i.fileupload("send",n)}else{var f=1048576;d&&s.size&&s.size>f?(i.fileupload("option","maxChunkSize",f),$.ajax({url:e.getUrl({name:"get_file_uploaded_bytes",repo_id:r.repo_id}),data:{parent_dir:r.path,file_name:s.name},cache:!1,dataType:"json",success:function(e){i.fileupload("option","uploadedBytes",e.uploadedBytes),n.url=t.url,n.jqXHR=i.fileupload("send",n)}})):(n.url=t.url,n.jqXHR=i.fileupload("send",n))}},error:function(){s.error=gettext("Failed to get upload url")}})};if(s.relative_path||n.originalFiles.length>1)return o(),!1;var u=function(){$.ajax({url:e.getUrl({name:"get_file_op_url",repo_id:r.repo_id}),data:{op_type:"update",path:r.path},cache:!1,dataType:"json",success:function(e){var t=i.fileupload("option","formData");t.target_file=t.parent_dir+s.name,i.fileupload("option","formData",t),s.to_update=!0,n.url=e.url,n.jqXHR=i.fileupload("send",n)},error:function(){s.error=gettext("Failed to get update url")}})},a=r.where({is_file:!0}),f=[];$(a).each(function(){f.push(this.get("obj_name"))});if(f.indexOf(s.name)!=-1){var l=gettext("Replace file {filename}?").replace("{filename}",'<span class="op-target">'+e.HTMLescape(s.name)+"</span>"),c=$(g.fileupdateConfirmTemplate({title:l}));c.modal({onClose:function(){$.modal.close(),s.choose_to_update?u():s.choose_to_upload?o():(n.jqXHR=i.fileupload("send",n),n.jqXHR.abort())}}),$("#simplemodal-container").css({height:"auto"}),$(".yes",c).click(function(){var t=r.findWhere({obj_name:s.name});t.get("is_locked")?t.get("locked_by_me")?(s.choose_to_update=!0,$.modal.close()):($(".error",c).html(gettext("File is locked")).removeClass("hide"),e.disableButton($(this))):(s.choose_to_update=!0,$.modal.close())}),$(".no",c).click(function(){s.choose_to_upload=!0,$.modal.close()})}else o();return!1}).bind("fileuploadprogressall",function(e,t){o.html(parseInt(t.loaded/t.total*100,10)+"% "+'<span style="font-size:14px;color:#555;">('+$(this).data("blueimp-fileupload")._formatBitrate(t.bitrate)+")</span>").removeClass("hide"),t.loaded>0&&t.loaded==t.total&&f.show()}).bind("fileuploaddone",function(e,t){if(t.textStatus!="success")return;var n=t.files[0],i=n.relative_path,s=t.result[0];s.uploaded=!0,i&&(s.relative_path=i.substring(0,i.lastIndexOf("/")+1)+s.name);var o=r.path;o=o=="/"?o:o+"/";if(t.formData.parent_dir!=o)return;if(!i){n.to_update?h.push(s):c.push(s);return}if(!p)return;var u=i.substring(0,i.indexOf("/")),a=r.where({is_dir:!0,obj_name:u});a.length>0?m.indexOf(u)==-1&&m.push(u):v.indexOf(u)==-1&&v.push(u)}).bind("fileuploadstop",function(){u.addClass("hide"),a.removeClass("hide");var t=r.path;t=t=="/"?t:t+"/";if(i.fileupload("option","formData").parent_dir!=t)return;var s=parseInt((new Date).getTime()/1e3);c.length>0&&($(c).each(function(t,i){var o=r.add({is_file:!0,is_img:e.imageCheck(i.name),obj_name:i.name,last_modified:s,file_size:e.fileSizeFormat(i.size,1),obj_id:i.id,file_icon:"file.png",perm:"rw",last_update:gettext("Just now"),starred:!1},{silent:!0});n.addNewFile(o)}),c=[]),v.length>0&&($(v).each(function(e,i){var o=r.add({is_dir:!0,obj_name:i,perm:"rw",last_modified:s,last_update:gettext("Just now"),p_dpath:t+i},{silent:!0});n.addNewDir(o)}),v=[]),m.length>0&&($(m).each(function(e,t){var n=r.where({is_dir:!0,obj_name:t});n[0].set({last_modified:s,last_update:gettext("Just now")})}),m=[]),h.length>0&&($(h).each(function(t,n){var i=r.where({is_file:!0,obj_name:n.name});i[0].set({obj_id:n.id,file_size:e.fileSizeFormat(n.size,1),last_modified:s,last_update:gettext("Just now")})}),h=[])}).bind("fileuploadcompleted",function(){$(".files .cancel",i).length==0&&(f.hide(),o.addClass("hide"),s.html(l.complete))}).bind("fileuploadfailed",function(e,t){$(".files .cancel",i).length==0&&(u.addClass("hide"),a.removeClass("hide"),o.addClass("hide"),f.hide(),t.errorThrown=="abort"?s.html(l.canceled):s.html(l.failed))});var y=app.pageOptions.max_upload_file_size;y&&i.fileupload("option","maxFileSize",y),i.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),n=$(".fileupload-buttonbar, table",e);e.height()==t?(e.height($(".hd",e).outerHeight(!0)),n.addClass("hide")):(e.height(t),n.removeClass("hide"))},closePopup:function(){var e=this.$el;e.addClass("hide"),$(".files",e).empty()}});return r}),define("app/views/dir",["jquery","jquery.ui.progressbar","jquery.magnific-popup","simplemodal","underscore","backbone","common","file-tree","js.cookie","app/collections/dirents","app/views/dirent","app/views/dirent-grid","app/views/fileupload","app/views/share","app/views/widgets/dropdown"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d){var v=s.View.extend({id:"dir-view",template:i.template(e("#dir-view-tmpl").html()),path_bar_template:i.template(e("#dir-path-bar-tmpl").html()),dir_op_bar_template:i.template(e("#dir-op-bar-tmpl").html()),dirents_hd_template:i.template(e("#dirents-hd-tmpl").html()),top_search_form_template:i.template(e("#top-search-form-tmpl").html()),newDirTemplate:i.template(e("#add-new-dir-form-template").html()),newFileTemplate:i.template(e("#add-new-file-form-template").html()),mvcpTemplate:i.template(e("#mvcp-form-template").html()),mvProgressTemplate:i.template(e("#mv-progress-popup-template").html()),initialize:function(t){var n=a.get("view_mode");n=="grid"?this.view_mode="grid":this.view_mode="list",this.contextOptions={},this.magnificPopupOptions={type:"image",tClose:gettext("Close (Esc)"),tLoading:gettext("Loading..."),gallery:{enabled:!0,tPrev:gettext("Previous (Left arrow key)"),tNext:gettext("Next (Right arrow key)"),tCounter:gettext("%curr% of %total%")},image:{titleSrc:function(e){var t=o.HTMLescape(e.data.name),n='<a href="'+e.data.url+'" target="_blank">'+gettext("Open in New Tab")+"</a>";return t+"<br />"+n},tError:gettext('<a href="%url%" target="_blank">The image</a> could not be loaded.')}},this.dir=new f,this.listenTo(this.dir,"add",this.addOne),this.listenTo(this.dir,"reset",this.reset),this.fileUploadView=new h({dirView:this}),this.render();var r=this;e(window).scroll(function(){e(r.el).is(":visible")&&r.onWindowScroll()}),e(document).click(function(t){var n=t.target||event.srcElement,r=e("#rename-form");if(r.length&&!r.find("*").is(n)){var i=r.closest("tr");e(".cancel",r).click()}}),e(document).click(function(t){var n=t.target||event.srcElement,r=e(".grid-item-op");r.length>0&&!r.is(n)&&!r.find("*").is(n)&&!r.closest(".grid-item").is(n)&&!r.closest(".grid-item").find("*").is(n)&&r.remove()})},render:function(){this.$el.html(this.template()),this.attached=!1,this.$dirent_list=this.$(".repo-file-list"),this.$dirent_grid=this.$(".grid-view"),this.$dirent_list_body=this.$(".repo-file-list tbody"),this.$loading_tip=this.$(".loading-tip"),this.$error=this.$(".error"),this.$el_con=this.$(".repo-file-list-topbar, .js-dir-content"),this.$path_bar=this.$(".path-bar"),this.$dir_op_bar=this.$(".repo-op")},showDir:function(t,n,r,i){e("#top-search-form").html(this.top_search_form_template({search_repo_id:n})),this.contextOptions=i,this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.dir.setPath(t,n,r),this.dir.dirent_more=!1,this.renderDir()},hide:function(){e("#top-search-form").html(this.top_search_form_template({search_repo_id:""})),this.$el.detach(),this.attached=!1},addOne:function(e){var t;this.view_mode=="list"?(t=new l({model:e,dirView:this}),this.$dirent_list_body.append(t.render().el)):(t=new c({model:e,dirView:this}),this.$dirent_grid.append(t.render().el))},reset:function(){this.renderPath(),this.renderDirOpBar(),this.view_mode=="list"&&this.renderDirentsHd(),o.updateSortIconByMode({context:this.$el}),this.sortDirents(),this.updateMagnificPopupOptions(),this.dir.last_start=0,this.dir.limit=100,this.render_dirents_slice(this.dir.last_start,this.dir.limit),this.setFileInput(),this.getImageThumbnail()},updateMagnificPopupOptions:function(){var t=this.dir.where({is_img:!0}),n=[],r=this.dir.repo_id,i=this.dir.path;e(t).each(function(e,t){var s=t.get("obj_name"),u=o.pathJoin([i,s]);n.push({name:s,url:t.getWebUrl(),src:app.config.siteRoot+"repo/"+r+"/raw"+o.encodePath(u)})}),this.magnificPopupOptions.items=n},setFileInput:function(){var t=this.dir;if(!t.user_perm||t.user_perm!="rw")return;var n=this.fileUploadView.$el;app.pageOptions.enable_upload_folder?"webkitdirectory"in e("#basic-upload-input")[0]?(this.$("#basic-upload").remove(),this.$("#advanced-upload").show(),this.upload_dropdown=new d({el:this.$("#advanced-upload")}),n.fileupload("option",{fileInput:this.$('#advanced-upload input[type="file"]'),replaceFileInput:navigator.userAgent.indexOf("Firefox")==-1?!0:!1})):(this.$("#advanced-upload").remove(),n.fileupload("option","fileInput",this.$("#basic-upload-input"))):n.fileupload("option","fileInput",this.$("#basic-upload-input"))},getImageThumbnail:function(){if(!app.pageOptions.enable_thumbnail||this.dir.encrypted)return!1;var t=this.dir.filter(function(e){return e.get("is_img")&&!e.get("encoded_thumbnail_src")});if(t.length==0)return;var n=t.length,r=this.dir.repo_id,i=this.dir.path,s=this,u=app.pageOptions.thumbnail_default_size;this.view_mode=="grid"&&(u=app.pageOptions.thumbnail_size_for_grid);var a=function(f){var l=t[f],c=o.pathJoin([i,l.get("obj_name")]);e.ajax({url:o.getUrl({name:"thumbnail_create",repo_id:r}),data:{path:c,size:u},cache:!1,dataType:"json",success:function(e){l.set({encoded_thumbnail_src:e.encoded_thumbnail_src})},complete:function(){f<n-1&&s.dir.repo_id==r&&s.dir.path==i&&a(++f)}})};a(0)},_showLibDecryptDialog:function(){var t=this,n=e(e("#repo-decrypt-form-template").html()),r=!1;n.modal({containerCss:{padding:"1px"},onClose:function(){e.modal.close(),t.$el_con.show(),r||app.router.navigate(t.dir.category+"/",{trigger:!0})}}),e("#simplemodal-container").css({height:"auto"}),n.submit(function(){var i=e.trim(e('[name="password"]',n).val());return i?(o.ajaxPost({form:n,form_id:n.attr("id"),post_url:o.getUrl({name:"api_v2.1_repo_set_password",repo_id:t.dir.repo_id}),post_data:{password:i},after_op_success:function(){r=!0,e.modal.close(),t.renderDir()}}),!1):(e(".error",n).html(gettext("Password is required.")).removeClass("hide"),!1)})},renderDir:function(){this.$loading_tip.show(),this.$error.hide(),this.$el_con.show(),this.$dirent_grid.empty(),this.$dirent_list_body.empty(),this.view_mode=="list"?(this.$dirent_list.show(),this.$dirent_grid.hide()):(this.$dirent_list.hide(),this.$dirent_grid.show());var e=this,t=app.pageOptions.thumbnail_default_size;this.view_mode=="grid"&&(t=app.pageOptions.thumbnail_size_for_grid);var n=this.dir;n.fetch({cache:!1,reset:!0,data:{p:n.path,thumbnail_size:t},success:function(){e.$loading_tip.hide()},error:function(t,n,r){e.$loading_tip.hide(),e.$el_con.hide();var i;if(n.responseText){if(n.responseJSON.lib_need_decrypt){e._showLibDecryptDialog();return}i=n.responseJSON.error}else i=gettext("Please check the network.");e.$error.html(i).show()}})},renderPath:function(){var t=this.dir,n=t.path,r="my",i=t.category.split("/")[0];i=="org"?r="org":i=="group"?r="group":i=="common"&&(r="common");var s={path:n,repo_name:t.repo_name,category:t.category,context:r};e.extend(s,this.contextOptions);var u=n.substr(1).split("/"),a=o.encodePath(n.substr(1)).split("/");n!="/"&&e.extend(s,{path_list:u,path_list_encoded:a,repo_id:t.repo_id}),this.$path_bar.html(this.path_bar_template(s))},renderDirOpBar:function(){var t=this.dir;this.$dir_op_bar.html(e.trim(this.dir_op_bar_template({user_perm:t.user_perm,encrypted:t.encrypted,mode:this.view_mode,path:t.path,repo_id:t.repo_id,site_root:app.pageOptions.site_root,is_repo_owner:t.is_repo_owner,can_generate_share_link:app.pageOptions.can_generate_share_link,can_generate_upload_link:app.pageOptions.can_generate_upload_link,enable_upload_folder:app.pageOptions.enable_upload_folder})))},renderDirentsHd:function(){this.$("thead").html(this.dirents_hd_template())},render_dirents_slice:function(e,t){var n=this.dir;i.each(n.slice(e,e+t),this.addOne,this),n.length>e+t?(n.dirent_more=!0,n.last_start=e+t):n.dirent_more=!1},events:{"click #add-new-dir":"newDir","click #add-new-file":"newFile","click #share-cur-dir":"share","click #js-switch-grid-view":"switchToGridView","click #js-switch-list-view":"switchToListView","click th.select":"select","click #mv-dirents":"mv","click #cp-dirents":"cp","click #del-dirents":"del","click #download-dirents":"download","click .by-name":"sortByName","click .by-time":"sortByTime","click .basic-upload-btn":"uploadFile","click .advanced-upload-file":"advancedUploadFile","click .advanced-upload-folder":"advancedUploadFolder"},uploadFile:function(){this.$("#basic-upload-input").trigger("click")},advancedUploadFile:function(){return this.$("#advanced-upload-file-input").trigger("click"),!1},advancedUploadFolder:function(){return this.$("#advanced-upload-folder-input").trigger("click"),!1},newDir:function(){var t=e(this.newDirTemplate()),n=t.attr("id"),r=this.dir,i=this;t.modal({appendTo:"#main"}),e("#simplemodal-container").css({height:"auto"}),t.submit(function(){var s=e.trim(e('input[name="name"]',t).val());if(!s)return o.showFormError(n,gettext("It is required.")),!1;var u={operation:"mkdir"},a=o.getUrl({name:"new_dir",repo_id:r.repo_id})+"?p="+encodeURIComponent(o.pathJoin([r.path,s])),f=function(t){e.modal.close();var n=r.add({is_dir:!0,obj_name:t.obj_name,perm:"rw",last_modified:(new Date).getTime()/1e3,last_update:gettext("Just now"),p_dpath:o.pathJoin([r.path,t.obj_name])},{silent:!0});i.addNewDir(n)};return o.ajaxPost({form:t,post_url:a,post_data:u,after_op_success:f,form_id:n}),!1})},newFile:function(){var t=e(this.newFileTemplate()),n=t.attr("id"),r=t.find('input[name="name"]'),i=this.dir,s=this;t.modal({appendTo:"#main",focus:!1,containerCss:{padding:"20px 25px"}}),r.focus(),e("#simplemodal-container").css({height:"auto"}),e(".set-file-type",t).click(function(){r.val("."+e(this).data("filetype")),o.setCaretPos(r[0],0),r.focus()}),t.submit(function(){var u=e.trim(r.val());if(!u)return o.showFormError(n,gettext("It is required.")),!1;if(u.lastIndexOf(".")!=-1&&u.substr(0,u.lastIndexOf(".")).length==0)return o.showFormError(n,gettext("Only an extension there, please input a name.")),!1;var a={operation:"create"},f=o.getUrl({name:"new_file",repo_id:i.repo_id})+"?p="+encodeURIComponent(o.pathJoin([i.path,u])),l=function(t){e.modal.close();var n=i.add({is_file:!0,is_img:o.imageCheck(t.obj_name),obj_name:t.obj_name,file_size:o.fileSizeFormat(0),obj_id:"0000000000000000000000000000000000000000",file_icon:"file.png",starred:!1,perm:"rw",last_modified:(new Date).getTime()/1e3,last_update:gettext("Just now")},{silent:!0});s.addNewFile(n)};return o.ajaxPost({form:t,post_url:f,post_data:a,after_op_success:l,form_id:n}),!1})},addNewFile:function(t){var n=this,r=this.dir;if(this.view_mode=="list"){var i=new l({model:t,dirView:n}),s=i.render().el;if(e("tr",n.$dirent_list_body).length==0)n.$dirent_list_body.append(s);else{var o=r.where({is_dir:!0});o.length==0?n.$dirent_list_body.prepend(s):e(e("tr",n.$dirent_list_body)[o.length-1]).after(s)}}else{var u=new c({model:t,dirView:n}),a=u.render().el;if(e(".grid-item",n.$dirent_grid).length==0)n.$dirent_grid.append(a);else{var o=r.where({is_dir:!0});o.length==0?n.$dirent_grid.prepend(a):e(e(".grid-item",n.$dirent_grid)[o.length-1]).after(a)}}},addNewDir:function(e){var t=this;if(this.view_mode=="list"){var n=new l({model:e,dirView:t});t.$dirent_list_body.prepend(n.render().el)}else{var r=new c({model:e,dirView:t});t.$dirent_grid.prepend(r.render().el)}},share:function(){var e=this.dir,t=e.path,n={is_repo_owner:e.is_repo_owner,is_virtual:e.is_virtual,user_perm:e.user_perm,repo_id:e.repo_id,is_dir:!0,dirent_path:t,obj_name:t=="/"?e.repo_name:t.substr(t.lastIndexOf("/")+1)};new p(n)},switchToGridView:function(){return this.view_mode=="grid"?!1:(this.view_mode="grid",a.set("view_mode","grid"),this.renderDir(),!1)},switchToListView:function(){return this.view_mode=="list"?!1:(this.view_mode="list",a.set("view_mode","list"),this.renderDir(),!1)},sortDirents:function(){var e=app.pageOptions.sort_mode;switch(e){case"name_up":this.dir.comparator=function(e,t){if(e.get("is_dir")&&t.get("is_file"))return-1;if(e.get("is_file")&&t.get("is_dir"))return 1;var n=o.compareTwoWord(e.get("obj_name"),t.get("obj_name"));return n};break;case"name_down":this.dir.comparator=function(e,t){if(e.get("is_dir")&&t.get("is_file"))return-1;if(e.get("is_file")&&t.get("is_dir"))return 1;var n=o.compareTwoWord(e.get("obj_name"),t.get("obj_name"));return-n};break;case"time_up":this.dir.comparator=function(e,t){return e.get("is_dir")&&t.get("is_file")?-1:e.get("is_file")&&t.get("is_dir")?1:e.get("last_modified")<t.get("last_modified")?-1:1};break;case"time_down":this.dir.comparator=function(e,t){return e.get("is_dir")&&t.get("is_file")?-1:e.get("is_file")&&t.get("is_dir")?1:e.get("last_modified")<t.get("last_modified")?1:-1}}this.dir.sort()},sortByName:function(){return o.toggleSortByNameMode(),o.updateSortIconByMode({context:this.$el}),this.sortDirents(),this.$dirent_list_body.empty(),this.render_dirents_slice(0,this.dir.limit),this.dir.comparator=null,!1},sortByTime:function(){return o.toggleSortByTimeMode(),o.updateSortIconByMode({context:this.$el}),this.sortDirents(),this.$dirent_list_body.empty(),this.render_dirents_slice(0,this.dir.limit),this.dir.comparator=null,!1},select:function(){var e=this.$("th [type=checkbox]"),t=this.dir,n=this.$("[type=checkbox]"),r=this.$("#multi-dirents-op"),i=this.$("#cur-dir-ops");e.prop("checked")?(n.prop("checked",!0),t.each(function(e){e.set({selected:!0},{silent:!0})}),r.css({display:"inline-block"}),i.hide()):(n.prop("checked",!1),t.each(function(e){e.set({selected:!1},{silent:!0})}),r.hide(),i.show())},download:function(){var t=this.dir,n=t.path,r=t.where({selected:!0});if(r.length==1&&r[0].get("is_file")){location.href=r[0].getDownloadUrl();return}var i=[],s,u,a=gettext("Packaging..."),f=e("<p></p>"),l=function(){e.ajax({url:o.getUrl({name:"query_zip_progress"})+"?token="+u,dataType:"json",cache:!1,success:function(t){var n=t.total==0?"100%":(t.zipped/t.total*100).toFixed(0)+"%";f.html(a+" "+n),t["total"]==t["zipped"]&&(setTimeout(function(){e.modal.close()},500),clearInterval(s),location.href=o.getUrl({name:"download_dir_zip_url",zip_token:u}))},error:function(e){o.ajaxErrorHandler(e),clearInterval(s)}})};e(r).each(function(){i.push(this.get("obj_name"))}),e.ajax({url:o.getUrl({name:"zip_task",repo_id:t.repo_id}),data:{parent_dir:n,dirents:i},traditional:!0,dataType:"json",success:function(t){u=t.zip_token,f.html(a).modal(),e("#simplemodal-container").css({width:"auto"}),l(),s=setInterval(l,1e3)},error:function(e){o.ajaxErrorHandler(e)}})},del:function(){var t=this.dir,n=this,r=function(){e("#confirm-popup").append('<p style="color:red;">'+gettext("Processing...")+"</p>");var r=t.where({selected:!0}),i=[];e(r).each(function(){i.push(this.get("obj_name"))}),e.ajax({url:o.getUrl({name:"del_dirents",repo_id:t.repo_id})+"?parent_dir="+encodeURIComponent(t.path),type:"POST",dataType:"json",beforeSend:o.prepareCSRFToken,traditional:!0,data:{dirents_names:i},success:function(s){var u=s.deleted.length,a=s.undeleted.length,f,l;u>0&&(u==i.length?(t.remove(r),n.$("th .checkbox").removeClass("checkbox-checked"),n.$("#multi-dirents-op").hide(),n.$("#cur-dir-ops").show()):e(r).each(function(){s["deleted"].indexOf(this.get("obj_name"))!=-1&&t.remove(this)}),u==1?f=gettext("Successfully deleted %(name)s."):u==2?f=gettext("Successfully deleted %(name)s and 1 other item."):f=gettext("Successfully deleted %(name)s and %(amount)s other items."),f=f.replace("%(name)s",s.deleted[0]).replace("%(amount)s",u-1),o.feedback(f,"success")),a>0&&(a==1?l=gettext("Failed to delete %(name)s."):a==2?l=gettext("Failed to delete %(name)s and 1 other item."):l=gettext("Failed to delete %(name)s and %(amount)s other items."),l=l.replace("%(name)s",s.undeleted[0]).replace("%(amount)s",a-1),o.feedback(l,"error")),e.modal.close()},error:function(t,n,r){e.modal.close(),o.ajaxErrorHandler(t,n,r)}})};o.showConfirm(gettext("Delete Items"),gettext("Are you sure you want to delete these selected items?"),r)},mv:function(){this.mvcp({op:"mv"})},cp:function(){this.mvcp({op:"cp"})},mvcp:function(t){var n=this.dir,r=t.op,i=r=="mv"?gettext("Move selected item(s) to:"):gettext("Copy selected item(s) to:"),s=!0;n.user_perm=="r"&&(s=!1);var a=e(this.mvcpTemplate({form_title:i,op_type:r,obj_type:"",obj_name:"",show_cur_repo:s,show_other_repos:!n.encrypted}));a.modal({appendTo:"#main",autoResize:!0,focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"}),s&&u.renderTreeForPath({$form:a,$container:e("#current-repo-dirs"),repo_name:n.repo_name,repo_id:n.repo_id,path:n.path}),n.encrypted||u.prepareOtherReposTree({cur_repo_id:n.repo_id});var f=this,l=this.dir,c=l.where({is_dir:!0,selected:!0}),h=l.where({is_file:!0,selected:!0}),p=[],d=[];e(c).each(function(){p.push(this.get("obj_name"))}),e(h).each(function(){d.push(this.get("obj_name"))}),a.submit(function(){var t=e('[name="dst_repo"]',a).val(),n=e('[name="dst_path"]',a).val(),i,s=l.path,u={repo_id:l.repo_id};if(!e.trim(t)||!e.trim(n))return e(".error",a).removeClass("hide"),!1;if(t==l.repo_id&&n==s)return e(".error",a).html(gettext("Invalid destination path")).removeClass("hide"),!1;o.disableButton(e('[type="submit"]',a)),a.append('<p style="color:red;">'+gettext("Processing...")+"</p>");if(t==l.repo_id)u.name=r=="mv"?"mv_dirents":"cp_dirents",e.ajax({url:o.getUrl(u)+"?parent_dir="+encodeURIComponent(s),type:"POST",dataType:"json",beforeSend:o.prepareCSRFToken,traditional:!0,data:{file_names:d,dir_names:p,dst_repo:t,dst_path:n},success:function(t){var n=t.success.length,i,s,u=t.url;e.modal.close(),n>0&&(r=="mv"?(n==h.length+c.length?(l.remove(c),l.remove(h),f.$("th .checkbox").removeClass("checkbox-checked"),f.$("#multi-dirents-op").hide(),f.$("#cur-dir-ops").show()):(e(c).each(function(){this.get("obj_name")in t.success&&l.remove(this)}),e(h).each(function(){this.get("obj_name")in t.success&&l.remove(this)})),n==1?i=gettext("Successfully moved %(name)s."):n==2?i=gettext("Successfully moved %(name)s and 1 other item."):i=gettext("Successfully moved %(name)s and %(amount)s other items.")):n==1?i=gettext("Successfully copied %(name)s."):n==2?i=gettext("Successfully copied %(name)s and 1 other item."):i=gettext("Successfully copied %(name)s and %(amount)s other items."),i=i.replace("%(name)s",t.success[0]).replace("%(amount)s",n-1),o.feedback(i,"success")),t.failed.length>0&&(r=="mv"?t.failed.length>1?s=gettext("Internal error. Failed to move %(name)s and %(amount)s other item(s)."):s=gettext("Internal error. Failed to move %(name)s."):t.failed.length>1?s=gettext("Internal error. Failed to copy %(name)s and %(amount)s other item(s)."):s=gettext("Internal error. Failed to copy %(name)s."),s=s.replace("%(name)s",t.failed[0]).replace("%(amount)s",t.failed.length-1),o.feedback(s,"error"))},error:function(t,n,r){e.modal.close(),o.ajaxErrorHandler(t,n,r)}});else{var v=l.where({selected:!0}),m=0,g=e(f.mvProgressTemplate()),y=e("#mv-details",g),b=e("#cancel-mv",g),w=e("#mv-other-info",g),E=function(){var i=v[m],f=i.get("is_dir")?"dir":"file",c=i.get("obj_name"),h,p;r=="mv"?u.name=f=="dir"?"mv_dir":"mv_file":u.name=f=="dir"?"cp_dir":"cp_file",h=o.getUrl(u)+"?path="+encodeURIComponent(s)+"&obj_name="+encodeURIComponent(c),p={dst_repo:t,dst_path:n};var d=function(t){var n=r=="mv"?gettext("Moving file %(index)s of %(total)s"):gettext("Copying file %(index)s of %(total)s");y.html(n.replace("%(index)s",m+1).replace("%(total)s",v.length)).removeClass("vh"),b.removeClass("hide");var s=function(){var n=t.task_id;b.data("task_id",n),e.ajax({url:o.getUrl({name:"get_cp_progress"})+"?task_id="+encodeURIComponent(n),dataType:"json",success:function(t){var n=e(".ui-progressbar-value",e("#mv-progress"));if(!t.failed&&!t.canceled&&!t.successful)setTimeout(s,1e3);else if(t.successful)n.css("width",parseInt((m+1)/v.length*100,10)+"%").show(),r=="mv"&&l.remove(i),S();else if(t.failed){var u=r=="mv"?gettext("Failed to move %(name)s"):gettext("Failed to copy %(name)s");b.after('<p class="error">'+u.replace("%(name)s",o.HTMLescape(c))+"</p>"),x()}},error:function(t,n,r){var i;t.responseText?i=e.parseJSON(t.responseText).error:i=gettext("Failed. Please check the network."),b.after('<p class="error">'+i+"</p>"),x()}})};m==0?(e.modal.close(),setTimeout(function(){g.modal({containerCss:{width:300,height:150,paddingTop:50},focus:!1}),e("#mv-progress").progressbar(),s()},100)):s()};o.ajaxPost({form:a,post_url:h,post_data:p,after_op_success:d,form_id:a.attr("id")})},S=function(){m==v.length-1?setTimeout(function(){e.modal.close()},500):E(++m)},x=function(){setTimeout(function(){e.modal.close()},500)};E(),b.click(function(){o.disableButton(b);var t=e(this).data("task_id");e.ajax({url:o.getUrl({name:"cancel_cp"})+"?task_id="+encodeURIComponent(t),dataType:"json",success:function(e){w.html(gettext("Canceled.")).removeClass("hide"),b.addClass("hide"),x()},error:function(t,n,r){var i;t.responseText?i=e.parseJSON(t.responseText).error:i=gettext("Failed. Please check the network."),w.html(i).removeClass("hide"),o.enableButton(b)}})})}return!1})},onWindowScroll:function(){this.dir.dirent_more&&e(window).scrollTop()+e(window).height()==e(document).height()&&(this.render_dirents_slice(this.dir.last_start,this.dir.limit),this.getImageThumbnail());var t=this.$dir_op_bar,n=this.$path_bar,r=this.$(".repo-file-list"),i=n.offset().top+n.outerHeight(!0),s={position:"fixed",top:0,left:n.offset().left,"background-color":e("#header").css("background-color"),"z-index":12};e(window).scrollTop()>=i?(r.css({"margin-top":t.outerHeight(!0)}),t.outerWidth(this.$el.width()).css(s)):(r.css({"margin-top":0}),t.removeAttr("style"))}});return v}),define("app/views/starred-file-item",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,n,r,i){var s=i.extend({tagName:"tr",template:t.template(e("#starred-file-item-tmpl").html()),events:{"click .unstar":"removeShare"},initialize:function(){i.prototype.initialize.call(this)},render:function(){var e=this.model.toJSON();return e.is_img=r.imageCheck(e.file_name),e.encoded_path=r.encodePath(e.path),this.$el.html(this.template(e)),this},removeShare:function(){var t=this,n=this.model.get("repo_id"),i=this.model.get("file_name"),s=this.model.get("path");return e.ajax({url:r.getUrl({name:"starred_files"})+"?p="+encodeURIComponent(s)+"&repo_id="+encodeURIComponent(n),type:"DELETE",beforeSend:r.prepareCSRFToken,success:function(){t.remove(),r.feedback(gettext("Successfully unstared {placeholder}").replace("{placeholder}",i),"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1}});return s}),define("app/models/starred-file",["underscore","backbone"],function(e,t){var n=t.Model.extend({});return n}),define("app/collections/starred-files",["underscore","backbone","common","app/models/starred-file"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"starred_files"})}});return i}),define("app/views/starred-file",["jquery","underscore","backbone","common","jquery.magnific-popup","app/views/starred-file-item","app/collections/starred-files"],function(e,t,n,r,i,s,o){var u=n.View.extend({id:"starred-file",template:t.template(e("#starred-file-tmpl").html()),initialize:function(){this.starredFiles=new o,this.listenTo(this.starredFiles,"reset",this.reset),this.render()},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)},reset:function(){this.$tableBody.empty(),this.$loadingTip.hide(),this.starredFiles.each(this.addOne,this),this.starredFiles.length?(this.$emptyTip.hide(),this.$table.show()):(this.$emptyTip.show(),this.$table.hide())},showStarredFiles:function(){this.$table.hide(),this.$loadingTip.show(),this.starredFiles.fetch({reset:!0})},render:function(){this.$el.html(this.template()),e("#right-panel").html(this.$el),this.$table=this.$("table"),this.$tableBody=this.$("tbody"),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips"),this.$el.magnificPopup({type:"image",delegate:".img-name-link",tClose:gettext("Close (Esc)"),tLoading:gettext("Loading..."),gallery:{enabled:!0,tPrev:gettext("Previous (Left arrow key)"),tNext:gettext("Next (Right arrow key)"),tCounter:gettext("%curr% of %total%")},image:{titleSrc:function(e){var t=e.el,n=t[0].innerHTML,r='<a href="'+t.attr("href")+'" target="_blank">'+gettext("Open in New Tab")+"</a>";return n+"<br />"+r},tError:gettext('<a href="%url%" target="_blank">The image</a> could not be loaded.')}})},show:function(){e("#right-panel").html(this.$el),this.showStarredFiles()},hide:function(){this.$el.detach()}});return u}),define("app/models/activity",["underscore","backbone"],function(e,t){var n=t.Model.extend({});return n}),define("app/collections/activities",["underscore","backbone","common","app/models/activity"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"events"})}});return i}),define("app/views/details",["jquery","underscore","backbone","common"],function(e,t,n,r){var i=n.View.extend({id:"ls-ch",template:t.template(e("#details-popup-tmpl").html()),detailItemTemplate:t.template(e("#detail-item-tmpl").html()),initialize:function(t){this.repo_id=t.repo_id,this.cmmt_id=t.cmmt_id,this.$el.html(this.template()).modal({autoResize:!0}),e("#simplemodal-container").css({width:"auto",height:"auto"}),this.getDetails()},getDetails:function(){var t=this;r.ajaxGet({get_url:r.getUrl({name:"get_history_changes",repo_id:this.repo_id}),data:{commit_id:this.cmmt_id},after_op_success:function(n){t.$(".loading-tip").hide(),t.$(".commit-time").html(n.date_time);var i=function(e){t.$el.append(t.detailItemTemplate({details_title:e.title,details:e.content}))};n["new"].length>0&&i({title:gettext("New files"),content:n["new"]}),n.removed.length>0&&i({title:gettext("Deleted files"),content:n.removed}),n.renamed.length>0&&i({title:gettext("Renamed or Moved files"),content:n.renamed}),n.modified.length>0&&i({title:gettext("Modified files"),content:n.modified}),n.newdir.length>0&&i({title:gettext("New directories"),content:n.newdir}),n.deldir.length>0&&i({title:gettext("Deleted directories"),content:n.deldir}),n.cmt_desc&&t.$el.append("<p>"+r.HTMLescape(n.cmt_desc)+"</p>"),e(window).resize()},after_op_error:function(n){var r;n.responseText?r=e.parseJSON(n.responseText).error:r=gettext("Failed. Please check the network."),t.$el.html('<p class="error">'+r+"</p>"),setTimeout(function(){e.modal.close()},2500)}})}});return i}),define("app/views/activity-item",["jquery","underscore","backbone","common","app/views/details"],function(e,t,n,r,i){var s=n.View.extend({tagName:"li",className:"event-item",template:t.template(e("#activity-item-tmpl").html()),events:{"click .lsch":"showDetails"},initialize:function(e){this.activity=e},showDetails:function(){var e={repo_id:this.activity.repo_id,cmmt_id:this.activity.commit_id};new i(e)},render:function(){return this.$el.html(this.template({activity:this.activity})),this}});return s}),define("app/views/activities",["jquery","underscore","backbone","common","app/collections/activities","app/views/activity-item"],function(e,t,n,r,i,s){var o=n.View.extend({id:"activities",template:t.template(e("#activities-tmpl").html()),activityGroupHdTemplate:t.template(e("#activity-group-hd-tmpl").html()),activityGroupBdTemplate:t.template(e("#activity-group-bd-tmpl").html()),initialize:function(){this.activities=new i,this.moreOffset=0,this.render()},events:{"click #activities-more":"getMoreActivities"},getMoreActivities:function(){var e=this;this.$loadingTip.show(),this.$activitiesMore.hide(),this.activities.fetch({remove:!1,data:{start:e.moreOffset},success:function(){e.renderActivities()}})},renderActivities:function(){var n=this.activities.toJSON(),r=n.length,i=n[r-1].more,o=[];this.$loadingTip.hide(),this.$activitiesMore.hide(),this.moreOffset=n[r-1].more_offset,this.$activitiesBody.empty().show();for(var u=0;u<r;u++)o=o.concat(n[u].events);var a=t.groupBy(o,"date"),f,l;for(var c in a)f=e(this.activityGroupHdTemplate({date:c})),l=e(this.activityGroupBdTemplate()),t.each(a[c],function(e){var t=new s(e);l.append(t.render().el)}),this.$activitiesBody.append(f).append(l);i&&this.$activitiesMore.show()},showActivities:function(){this.$activitiesBody.hide(),this.$activitiesMore.hide(),this.$loadingTip.show();var e=this;this.activities.fetch({data:{start:0},success:function(){e.renderActivities()}})},render:function(){this.$el.html(this.template()),this.$activitiesBody=this.$("#activities-body"),this.$activitiesMore=this.$("#activities-more"),this.$loadingTip=this.$(".loading-tip")},show:function(){e("#right-panel").html(this.$el),this.showActivities()},hide:function(){this.$el.detach()}});return o}),define("app/views/device",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,n,r,i,s){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=i(e.last_accessed);return e.time=t.format("LLLL"),e.time_from_now=r.getRelativeTimeStr(t),this.$el.html(this.template(e)),this},unlinkDeviceWithConfirm:function(){var t=this,n=this.model.get("is_desktop_client"),i=this.model.get("device_name");if(!n)return t.model.unlink({wipe_device:!0,success:function(){t.remove();var e=gettext("Successfully unlink %(name)s.").replace("%(name)s",i);r.feedback(e,"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1;var s=gettext("Unlink device"),o=gettext("Are you sure you want to unlink this device?"),u=gettext("Delete files from this device the next time it comes online."),a=function(n){return t.model.unlink({wipe_device:n,success:function(){t.remove();var e=gettext("Successfully unlink %(name)s.").replace("%(name)s",i);r.feedback(e,"success")},error:function(e){r.ajaxErrorHandler(e)},complete:function(){e.modal.close()}}),!1};r.showConfirmWithExtraOption(s,o,u,a)}});return o}),define("app/models/device",["underscore","backbone","common"],function(e,t,n){var r=t.Model.extend({unlink:function(e){var t={platform:this.get("platform"),device_id:this.get("device_id")};e.wipe_device&&(t.wipe_device="true"),$.ajax({url:n.getUrl({name:"devices"}),type:"DELETE",dataType:"json",beforeSend:n.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 r}),define("app/collections/devices",["underscore","backbone","common","app/models/device"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"devices"})}});return i}),define("app/views/devices",["jquery","underscore","backbone","common","app/views/device","app/collections/devices"],function(e,t,n,r,i,s){var o=n.View.extend({id:"devices",template:t.template(e("#devices-tmpl").html()),initialize:function(){this.devices=new s,this.listenTo(this.devices,"reset",this.reset),this.render()},addOne:function(e){var t=new i({model:e});this.$tableBody.append(t.render().el)},reset:function(){this.$tableBody.empty(),this.$loadingTip.hide(),this.devices.each(this.addOne,this),this.devices.length?(this.$emptyTip.hide(),this.$table.show()):(this.$emptyTip.show(),this.$table.hide())},render:function(){this.$el.html(this.template()),e("#right-panel").html(this.$el),this.$table=this.$("table"),this.$tableBody=this.$("tbody"),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},show:function(){e("#right-panel").html(this.$el),this.devices.fetch({reset:!0})},hide:function(){this.$el.detach()}});return o}),define("app/views/invitation",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,n,r,i,s){var o=s.extend({tagName:"tr",template:t.template(e("#invitation-item-tmpl").html()),initialize:function(){s.prototype.initialize.call(this)},events:{"click .rm-invitation":"removeInvitation"},removeInvitation:function(){var t=this;return e.ajax({url:r.getUrl({name:"invitation",token:this.model.get("token")}),type:"DELETE",cache:!1,beforeSend:r.prepareCSRFToken,success:function(){t.remove(),r.feedback(gettext("Successfully deleted 1 item"),"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1},render:function(){var e=this.model.toJSON(),t=i(e.invite_time),n=i(e.expire_time);return e.invite_time_format=t.format("LLLL"),e.expire_time_format=n.format("LLLL"),e.invite_time_from_now=t.format("YYYY-MM-DD"),e.expire_time_from_now=n.format("YYYY-MM-DD"),this.$el.html(this.template(e)),this}});return o}),define("app/models/invitation",["underscore","backbone","common"],function(e,t,n){var r=t.Model.extend({});return r}),define("app/collections/invitations",["underscore","backbone","common","app/models/invitation"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"invitations"})}});return i}),define("app/views/invitations",["jquery","underscore","backbone","common","app/views/invitation","app/collections/invitations"],function(e,t,n,r,i,s){var o=n.View.extend({id:"invitations",template:t.template(e("#invitations-tmpl").html()),inviteFormTemplate:t.template(e("#invitation-form-tmpl").html()),initialize:function(){this.collection=new s,this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"reset",this.reset),this.render()},render:function(){this.$el.html(this.template()),this.$loadingTip=this.$(".loading-tip"),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$emptyTip=this.$(".empty-tips"),this.$error=this.$(".error")},events:{"click #invite-people":"invitePeople"},invitePeople:function(){var t=this,n=e(this.inviteFormTemplate()),i=n.attr("id");n.modal({appendTo:"#main"}),e("#simplemodal-container").css({height:"auto"}),n.submit(function(){var i=e.trim(e('input[name="accepter"]',n).val()),s=e(".error",n),o=e('[type="submit"]',n),u=e(".loading-icon",n);return i?(s.hide(),r.disableButton(o),u.show(),t.collection.create({type:"guest",accepter:i},{wait:!0,prepend:!0,success:function(){t.collection.length==1&&t.reset(),e.modal.close()},error:function(e,t,n){var i;t.responseText?i=t.responseJSON.error_msg||t.responseJSON.detail:i=gettext("Please check the network."),s.html(i).show(),r.enableButton(o)},complete:function(){u.hide()}}),!1):(s.html(gettext("It is required.")).show(),!1)})},addOne:function(e,t,n){var r=new i({model:e});n.prepend?this.$tableBody.prepend(r.render().el):this.$tableBody.append(r.render().el)},initPage:function(){this.$loadingTip.show(),this.$table.hide(),this.$tableBody.empty(),this.$emptyTip.hide(),this.$error.hide()},reset:function(){this.$error.hide(),this.collection.length?(this.$tableBody.empty(),this.collection.each(this.addOne,this),this.$emptyTip.hide(),this.$table.show()):(this.$emptyTip.show(),this.$table.hide())},show:function(){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showContent()},showContent:function(){var t=this;this.initPage(),this.collection.fetch({cache:!1,reset:!0,error:function(n,r,i){var s;r.responseText?r["status"]==401||r["status"]==403?s=gettext("Permission error"):s=e.parseJSON(r.responseText).error_msg:s=gettext("Failed. Please check the network."),t.$error.html(s).show()},complete:function(){t.$loadingTip.hide()}})},hide:function(){this.$el.detach(),this.attached=!1}});return o}),define("app/models/share-admin-repo",["underscore","backbone","common"],function(e,t,n){var r=t.Model.extend({getWebUrl:function(){return"#common/lib/"+this.get("repo_id")+"/"},getIconUrl:function(e){var t=this.get("share_permission")=="r"?!0:!1;return n.getLibIconUrl(!1,t,e)},getIconTitle:function(){var e="";return this.get("share_permission")=="rw"?e=gettext("Read-Write"):e=gettext("Read-Only"),e}});return r}),define("app/collections/share-admin-repos",["underscore","backbone","common","app/models/share-admin-repo"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"share_admin_repos"})}});return i}),define("app/views/share-admin-repo",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,n,r,i){var s=i.extend({tagName:"tr",template:t.template(e("#share-admin-folder-tmpl").html()),events:{"click .perm-edit-icon":"showPermSelect","change .perm-select":"updatePermission","click .unshare":"removeShare"},initialize:function(e){i.prototype.initialize.call(this),this.listenTo(this.model,"change",this.render)},showPermSelect:function(){return this.$el.closest("table").find(".perm-select").hide().end().find(".cur-perm, .perm-edit-icon").show(),this.$(".cur-perm, .perm-edit-icon").hide(),this.$(".perm-select").show(),!1},updatePermission:function(){var t=this,n=r.getUrl({name:"share_admin_repo",repo_id:this.model.get("repo_id")}),i=this.model.get("share_type"),s=this.$(".perm-select").val(),o={share_type:i,permission:s};i=="personal"?o.user=this.model.get("user_email"):i=="group"&&(o.group_id=this.model.get("group_id")),e.ajax({url:n,method:"PUT",cache:!1,dataType:"json",data:o,beforeSend:r.prepareCSRFToken,success:function(){t.model.set({share_permission:s}),r.feedback(gettext("Successfully modified permission"),"success")},error:function(e){r.ajaxErrorHandler(e)}})},removeShare:function(){var t=this,n=this.model.get("share_type"),i=r.getUrl({name:"share_admin_repo",repo_id:this.model.get("repo_id")});return n=="personal"?i+="?share_type=personal&user="+encodeURIComponent(this.model.get("user_email")):n=="group"?i+="?share_type=group&group_id="+this.model.get("group_id"):n=="public"&&(i+="?share_type=public"),e.ajax({url:i,type:"DELETE",beforeSend:r.prepareCSRFToken,success:function(){t.remove(),r.feedback(gettext("Successfully deleted 1 item"),"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1},render:function(){var e=this.model.toJSON(),n=r.isHiDPI()?96:24,i=this.model.getIconUrl(n);return t.extend(e,{icon_url:i,icon_title:this.model.getIconTitle(),url:this.model.getWebUrl(),name:this.model.get("repo_name")}),this.$el.html(this.template(e)),this}});return s}),define("app/views/share-admin-repos",["jquery","underscore","backbone","common","app/collections/share-admin-repos","app/views/share-admin-repo"],function(e,t,n,r,i,s){var o=n.View.extend({id:"share-admin-repos",template:t.template(e("#share-admin-repos-tmpl").html()),initialize:function(){this.repos=new i,this.listenTo(this.repos,"add",this.addOne),this.listenTo(this.repos,"reset",this.reset),this.render();var t=this;e(document).click(function(e){var n=e.target||event.srcElement,r=t.$(".perm-select:visible");r.length&&!r.is(n)&&(r.hide(),r.closest("tr").find(".cur-perm, .perm-edit-icon").show())})},events:{"click .by-name":"sortByName"},sortByName:function(){var e=this.repos,t=this.$sortIcon;return t.hasClass("icon-caret-up")?e.comparator=function(e,t){var n=r.compareTwoWord(e.get("repo_name"),t.get("repo_name"));return-n}:e.comparator=function(e,t){var n=r.compareTwoWord(e.get("repo_name"),t.get("repo_name"));return n},e.sort(),this.$tableBody.empty(),e.each(this.addOne,this),t.toggleClass("icon-caret-up icon-caret-down").show(),e.comparator=null,!1},render:function(){this.$el.html(this.template()),this.$table=this.$("table"),this.$sortIcon=e(".by-name .sort-icon",this.$table),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},hide:function(){this.$el.detach(),this.attached=!1},show:function(){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showContent()},showContent:function(){var e=this;this.initPage(),this.repos.fetch({cache:!1,reset:!0,error:function(t,n,r){e.$loadingTip.hide();var i=e.$(".error"),s;n.responseText?n["status"]==401||n["status"]==403?s=gettext("Permission error"):s=gettext("Error"):s=gettext("Please check the network."),i.html(s).show()}})},initPage:function(){this.$table.hide(),this.$sortIcon.attr("class","sort-icon icon-caret-down").hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$(".error").hide()},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.repos.length?(this.$emptyTip.hide(),this.$tableBody.empty(),this.repos.each(this.addOne,this),this.$table.show()):(this.$table.hide(),this.$emptyTip.show())},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)}});return o}),define("app/models/share-admin-folder",["underscore","backbone","common"],function(e,t,n){var r=t.Model.extend({getWebUrl:function(){var e=this.get("path"),t=this.get("repo_id");return"#my-libs/lib/"+t+n.encodePath(e)},getIconUrl:function(e){var t=this.get("share_permission")=="r"?!0:!1;return n.getDirIconUrl(t,e)},getIconTitle:function(){var e="";return this.get("share_permission")=="rw"?e=gettext("Read-Write"):e=gettext("Read-Only"),e}});return r}),define("app/collections/share-admin-folders",["underscore","backbone","common","app/models/share-admin-folder"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"share_admin_folders"})}});return i}),define("app/views/share-admin-folder",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,n,r,i){var s=i.extend({tagName:"tr",template:t.template(e("#share-admin-folder-tmpl").html()),events:{"click .perm-edit-icon":"showPermSelect","change .perm-select":"updatePermission","click .unshare":"removeShare"},initialize:function(e){i.prototype.initialize.call(this),this.listenTo(this.model,"change",this.render)},showPermSelect:function(){return this.$el.closest("table").find(".perm-select").hide().end().find(".cur-perm, .perm-edit-icon").show(),this.$(".cur-perm, .perm-edit-icon").hide(),this.$(".perm-select").show(),!1},updatePermission:function(){var t=this,n=this.model.get("share_type"),i=this.$(".perm-select").val(),s=r.getUrl({name:"dir_shared_items",repo_id:this.model.get("repo_id")})+"?p="+encodeURIComponent(this.model.get("path"));n=="personal"?s+="&share_type=user&username="+encodeURIComponent(this.model.get("user_email")):n=="group"&&(s+="&share_type=group&group_id="+this.model.get("group_id")),e.ajax({url:s,method:"POST",dataType:"json",beforeSend:r.prepareCSRFToken,data:{permission:i},success:function(){t.model.set({share_permission:i}),r.feedback(gettext("Successfully modified permission"),"success")},error:function(e){r.ajaxErrorHandler(e)}})},removeShare:function(){var t=this,n=this.model.get("share_type"),i=r.getUrl({name:"dir_shared_items",repo_id:this.model.get("repo_id")})+"?p="+r.encodePath(this.model.get("path"));return n=="personal"?i+="&share_type=user&username="+r.encodePath(this.model.get("user_email")):n=="group"&&(i+="&share_type=group&group_id="+this.model.get("group_id")),e.ajax({url:i,type:"DELETE",beforeSend:r.prepareCSRFToken,success:function(){t.remove(),r.feedback(gettext("Successfully deleted 1 item"),"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1},render:function(){var e=this.model.toJSON(),n=r.isHiDPI()?96:24,i=this.model.getIconUrl(n);return t.extend(e,{icon_url:i,icon_title:this.model.getIconTitle(),url:this.model.getWebUrl(),name:this.model.get("folder_name")}),this.$el.html(this.template(e)),this}});return s}),define("app/views/share-admin-folders",["jquery","underscore","backbone","common","app/collections/share-admin-folders","app/views/share-admin-folder"],function(e,t,n,r,i,s){var o=n.View.extend({id:"share-admin-folders",template:t.template(e("#share-admin-folders-tmpl").html()),initialize:function(){this.folders=new i,this.listenTo(this.folders,"add",this.addOne),this.listenTo(this.folders,"reset",this.reset),this.render();var t=this;e(document).click(function(e){var n=e.target||event.srcElement,r=t.$(".perm-select:visible");r.length&&!r.is(n)&&(r.hide(),r.closest("tr").find(".cur-perm, .perm-edit-icon").show())})},events:{"click .by-name":"sortByName"},sortByName:function(){var e=this.folders,t=this.$sortIcon;return t.hasClass("icon-caret-up")?e.comparator=function(e,t){var n=r.compareTwoWord(e.get("folder_name"),t.get("folder_name"));return-n}:e.comparator=function(e,t){var n=r.compareTwoWord(e.get("folder_name"),t.get("folder_name"));return n},e.sort(),this.$tableBody.empty(),e.each(this.addOne,this),t.toggleClass("icon-caret-up icon-caret-down").show(),e.comparator=null,!1},render:function(){this.$el.html(this.template()),this.$table=this.$("table"),this.$sortIcon=e(".by-name .sort-icon",this.$table),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},hide:function(){this.$el.detach(),this.attached=!1},show:function(){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showContent()},showContent:function(){this.initPage(),this.folders.fetch({cache:!1,reset:!0,error:function(e,t,n){_this.$loadingTip.hide();var r=_this.$(".error"),i;t.responseText?t["status"]==401||t["status"]==403?i=gettext("Permission error"):i=gettext("Error"):i=gettext("Please check the network."),r.html(i).show()}})},initPage:function(){this.$table.hide(),this.$sortIcon.attr("class","sort-icon icon-caret-down").hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$(".error").hide()},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.folders.length?(this.$emptyTip.hide(),this.$tableBody.empty(),this.folders.each(this.addOne,this),this.$table.show()):(this.$table.hide(),this.$emptyTip.show())},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)}});return o}),define("app/models/share-admin-share-link",["underscore","backbone","common","moment"],function(e,t,n,r){var i=t.Model.extend({parse:function(t){var n=e.clone(t),i=t.expire_date;return i?n.expire_date_timestamp=r(i).format("X"):n.expire_date_timestamp=0,n},getIconUrl:function(e){return this.get("is_dir")?n.getDirIconUrl(!1,e):n.getFileIconUrl(this.get("obj_name"),e)},getWebUrl:function(){var e=this.get("repo_id"),t=this.get("path");return this.get("is_dir")?"#common/lib/"+e+n.encodePath(t):app.config.siteRoot+"lib/"+e+"/file"+n.encodePath(t)}});return i}),define("app/collections/share-admin-share-links",["underscore","backbone","common","app/models/share-admin-share-link"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"share_admin_share_links"})}});return i}),define("app/views/share-admin-share-link",["jquery","underscore","backbone","common","moment","app/views/widgets/hl-item-view"],function(e,t,n,r,i,s){var o=s.extend({tagName:"tr",template:t.template(e("#share-admin-download-link-tmpl").html()),linkPopupTemplate:t.template(e("#share-admin-link-popup-tmpl").html()),events:{"click .rm-link":"removeLink","click .view-link":"viewLink"},initialize:function(e){s.prototype.initialize.call(this)},viewLink:function(){var t=e(this.linkPopupTemplate({link:this.model.get("link")}));t.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"});var n=e("p",t),r=e("input",t);return r.css({width:n.width()+2}),n.hide(),r.show(),r.click(function(){e(this).select()}),!1},removeLink:function(){var t=this;return e.ajax({url:r.getUrl({name:"share_admin_share_link",token:this.model.get("token")}),type:"DELETE",beforeSend:r.prepareCSRFToken,success:function(){t.remove(),r.feedback(gettext("Successfully deleted 1 item"),"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1},render:function(){var e=this.model.toJSON(),n=r.isHiDPI()?96:24,s=this.model.getIconUrl(n);return t.extend(e,{icon_url:s,dirent_url:this.model.getWebUrl(),time:e.expire_date?i(e.expire_date).format("YYYY-MM-DD"):""}),this.$el.html(this.template(e)),this}});return o}),define("app/views/share-admin-share-links",["jquery","underscore","backbone","common","app/collections/share-admin-share-links","app/views/share-admin-share-link"],function(e,t,n,r,i,s){var o=n.View.extend({id:"share-admin-download-links",template:t.template(e("#share-admin-download-links-tmpl").html()),initialize:function(){this.links=new i,this.listenTo(this.links,"add",this.addOne),this.listenTo(this.links,"reset",this.reset),this.render()},events:{"click .by-name":"sortByName","click .by-time":"sortByTime"},initialSort:function(e,t){var n=e.get("is_dir"),r=t.get("is_dir");return n&&!r?-1:!n&&r?1:0},sortByName:function(){var e=this,t=this.links,n=this.$sortByNameIcon;return this.$sortByTimeIcon.hide(),n.hasClass("icon-caret-up")?t.comparator=function(t,n){var i=e.initialSort(t,n);if(i!=0)return i;var s=r.compareTwoWord(t.get("obj_name"),n.get("obj_name"));return-s}:t.comparator=function(t,n){var i=e.initialSort(t,n);if(i!=0)return i;var s=r.compareTwoWord(t.get("obj_name"),n.get("obj_name"));return s},t.sort(),this.$tableBody.empty(),t.each(this.addOne,this),n.toggleClass("icon-caret-up icon-caret-down").show(),t.comparator=null,!1},sortByTime:function(){var e=this,t=this.links,n=this.$sortByTimeIcon;return this.$sortByNameIcon.hide(),n.hasClass("icon-caret-down")?t.comparator=function(t,n){var r=e.initialSort(t,n);return r!=0?r:t.get("expire_date_timestamp")<n.get("expire_date_timestamp")?1:-1}:t.comparator=function(t,n){var r=e.initialSort(t,n);return r!=0?r:t.get("expire_date_timestamp")<n.get("expire_date_timestamp")?-1:1},t.sort(),this.$tableBody.empty(),t.each(this.addOne,this),n.toggleClass("icon-caret-up icon-caret-down").show(),t.comparator=null,!1},render:function(){this.$el.html(this.template({can_generate_upload_link:app.pageOptions.can_generate_upload_link})),this.$table=this.$("table"),this.$sortByNameIcon=this.$(".by-name .sort-icon"),this.$sortByTimeIcon=this.$(".by-time .sort-icon"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},hide:function(){this.$el.detach(),this.attached=!1},show:function(){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showContent()},showContent:function(){var e=this;this.initPage(),this.links.fetch({cache:!1,reset:!0,error:function(t,n,r){e.$loadingTip.hide();var i=e.$(".error"),s;n.responseText?n["status"]==401||n["status"]==403?s=gettext("Permission error"):s=gettext("Error"):s=gettext("Please check the network."),i.html(s).show()}})},initPage:function(){this.$table.hide(),this.$sortByNameIcon.attr("class","sort-icon icon-caret-up").show(),this.$sortByTimeIcon.attr("class","sort-icon icon-caret-down").hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$(".error").hide()},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.links.length?(this.$emptyTip.hide(),this.$tableBody.empty(),this.links.each(this.addOne,this),this.$table.show()):(this.$emptyTip.show(),this.$table.hide())},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)}});return o}),define("app/models/share-admin-upload-link",["underscore","backbone","common"],function(e,t,n){var r=t.Model.extend({getIconUrl:function(e){return n.getDirIconUrl(!1,e)},getWebUrl:function(){var e=this.get("repo_id"),t=this.get("path");return"#common/lib/"+e+n.encodePath(t)}});return r}),define("app/collections/share-admin-upload-links",["underscore","backbone","common","app/models/share-admin-upload-link"],function(e,t,n,r){var i=t.Collection.extend({model:r,url:function(){return n.getUrl({name:"share_admin_upload_links"})}});return i}),define("app/views/share-admin-upload-link",["jquery","underscore","backbone","common","app/views/widgets/hl-item-view"],function(e,t,n,r,i){var s=i.extend({tagName:"tr",template:t.template(e("#share-admin-upload-link-tmpl").html()),linkPopupTemplate:t.template(e("#share-admin-link-popup-tmpl").html()),events:{"click .rm-link":"removeLink","click .view-link":"viewLink"},initialize:function(e){i.prototype.initialize.call(this)},viewLink:function(){var t=e(this.linkPopupTemplate({link:this.model.get("link")}));t.modal({focus:!1}),e("#simplemodal-container").css({width:"auto",height:"auto"});var n=e("p",t),r=e("input",t);return r.css({width:n.width()+2}),n.hide(),r.show(),r.click(function(){e(this).select()}),!1},removeLink:function(){var t=this;return e.ajax({url:r.getUrl({name:"share_admin_upload_link",token:this.model.get("token")}),type:"DELETE",beforeSend:r.prepareCSRFToken,success:function(){t.remove(),r.feedback(gettext("Successfully deleted 1 item"),"success")},error:function(e){r.ajaxErrorHandler(e)}}),!1},render:function(){var e=this.model.toJSON(),n=r.isHiDPI()?96:24,i=this.model.getIconUrl(n);return t.extend(e,{icon_url:i,dirent_url:this.model.getWebUrl()}),this.$el.html(this.template(e)),this}});return s}),define("app/views/share-admin-upload-links",["jquery","underscore","backbone","common","app/collections/share-admin-upload-links","app/views/share-admin-upload-link"],function(e,t,n,r,i,s){var o=n.View.extend({id:"share-admin-upload-links",template:t.template(e("#share-admin-upload-links-tmpl").html()),initialize:function(){this.links=new i,this.listenTo(this.links,"add",this.addOne),this.listenTo(this.links,"reset",this.reset),this.render()},render:function(){this.$el.html(this.template({can_generate_share_link:app.pageOptions.can_generate_share_link})),this.$table=this.$("table"),this.$tableBody=e("tbody",this.$table),this.$loadingTip=this.$(".loading-tip"),this.$emptyTip=this.$(".empty-tips")},hide:function(){this.$el.detach(),this.attached=!1},show:function(){this.attached||(this.attached=!0,e("#right-panel").html(this.$el)),this.showContent()},showContent:function(){var e=this;this.initPage(),this.links.fetch({cache:!1,reset:!0,error:function(t,n,r){e.$loadingTip.hide();var i=e.$(".error"),s;n.responseText?n["status"]==401||n["status"]==403?s=gettext("Permission error"):s=gettext("Error"):s=gettext("Please check the network."),i.html(s).show()}})},initPage:function(){this.$table.hide(),this.$tableBody.empty(),this.$loadingTip.show(),this.$emptyTip.hide(),this.$(".error").hide()},reset:function(){this.$(".error").hide(),this.$loadingTip.hide(),this.links.length?(this.$emptyTip.hide(),this.$tableBody.empty(),this.links.each(this.addOne,this),this.$table.show()):(this.$emptyTip.show(),this.$table.hide())},addOne:function(e){var t=new s({model:e});this.$tableBody.append(t.render().el)}});return o}),define("app/views/notifications",["jquery","underscore","backbone","common","app/views/widgets/popover"],function(e,t,n,r,i){var s=i.extend({id:"notice-popover",className:"sf-popover",template:t.template(e("#notice-popover-tmpl").html()),initialize:function(t){i.prototype.initialize.call(this),this.render(),this.$loadingTip=this.$(".loading-tip"),this.$error=this.$(".error"),this.$noticeList=this.$(".notice-list"),this.$notifications=e("#notifications"),this.$num=e(".num",this.$notifications),this.orig_doc_title=document.title;var n=this,s=function(){e.ajax({url:r.getUrl({name:"get_unseen_notices_num"}),dataType:"json",cache:!1,success:function(e){var t=e.count,r=n.$num;r.html(t),t>0?(r.removeClass("hide"),document.title="("+t+")"+n.orig_doc_title):(r.addClass("hide"),document.title=n.orig_doc_title)},error:function(){clearInterval(o)}})};s();var o=setInterval(s,3e4);e("#notice-icon").click(function(){return n.toggle(),!1})},render:function(){return this.$el.html(this.template()),this},events:{"click .detail":"viewDetail","click .unread a":"visitUnread"},viewDetail:function(t){var n=e(t.currentTarget);location.href=e(".brief a",n.parent()).attr("href")},visitUnread:function(t){var n=e(t.currentTarget),i=n.closest(".unread").data("id"),s=n.attr("href");return e.ajax({url:r.getUrl({name:"set_notice_seen_by_id"})+"?notice_id="+encodeURIComponent(i),type:"POST",dataType:"json",beforeSend:r.prepareCSRFToken,success:function(e){location.href=s},error:function(){location.href=s}}),!1},hide:function(){var t=this;return app.ui.currentPopover=null,this.$el.detach(),this.$(".unread").length>0&&e.ajax({url:r.getUrl({name:"set_notices_seen"}),type:"POST",dataType:"json",beforeSend:r.prepareCSRFToken,success:function(){t.$num.html(0).addClass("hide"),document.title=t.orig_doc_title}}),!1},showContent:function(){var t=this;this.$noticeList.addClass("hide"),this.$error.hide(),this.$loadingTip.show(),e.ajax({url:r.getUrl({name:"get_popup_notices"}),dataType:"json",success:function(e){t.$loadingTip.hide(),t.$noticeList.html(e.notice_html).show()},error:function(n,r,i){t.$loadingTip.hide();var s;n.responseText?s=e.parseJSON(n.responseText).error:s=gettext("Please check the network."),t.$error.html(s).show()}}),this.$notifications.append(this.$el)}});return s}),define("app/views/account",["jquery","underscore","backbone","common","app/views/widgets/popover"],function(e,t,n,r,i){var s=i.extend({id:"user-info-popup",className:"sf-popover account-popup",template:t.template(e("#user-info-popup-tmpl").html()),initialize:function(t){i.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 n=this;e("#my-info").click(function(){return n.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:r.getUrl({name:"space_and_traffic"}),dataType:"json",cache:!1,success:function(e){t.$loadingTip.hide(),t.$space.html(e.html).removeClass("hide")},error:function(n,r,i){t.$loadingTip.hide();var s;n.responseText?s=e.parseJSON(n.responseText).error:s=gettext("Please check the network."),t.$error.html(s).show()}}),this.$account.append(this.$el)}});return s}),define("app/router",["jquery","backbone","common","js.cookie","app/views/side-nav","app/views/myhome-repos","app/views/myhome-shared-repos","app/views/groups","app/views/group","app/views/organization","app/views/dir","app/views/starred-file","app/views/activities","app/views/devices","app/views/invitations","app/views/share-admin-repos","app/views/share-admin-folders","app/views/share-admin-share-links","app/views/share-admin-upload-links","app/views/notifications","app/views/account"],function(e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w){var E=t.Router.extend({routes:{"":"showRepos","my-libs/":"showMyRepos","my-libs/lib/:repo_id(/*path)":"showMyRepoDir","shared-libs/":"showSharedRepos","shared-libs/lib/:repo_id(/*path)":"showSharedRepoDir","groups/":"showGroups","group/:group_id/":"showGroup","group/:group_id/lib/:repo_id(/*path)":"showGroupRepoDir","group/:group_id/discussions/":"showGroupDiscussions","org/":"showOrgRepos","org/lib/:repo_id(/*path)":"showOrgRepoDir","common/lib/:repo_id(/*path)":"showCommonDir","starred/":"showStarredFile","activities/":"showActivities","devices/":"showDevices","invitations/":"showInvitations","share-admin-libs/":"showShareAdminRepos","share-admin-folders/":"showShareAdminFolders","share-admin-share-links/":"showShareAdminShareLinks","share-admin-upload-links/":"showShareAdminUploadLinks","*actions":"showRepos"},initialize:function(){e(".initial-loading").hide(),e(".main-content").show(),n.prepareApiCsrf(),n.initLocale(),this.sideNavView=new i,app.ui.sideNavView=this.sideNavView,this.dirView=new l,this.myReposView=new s,this.sharedReposView=new o,this.orgView=new f,this.groupView=new a,this.groupsView=new u,this.starredFileView=new c,this.devicesView=new p,this.invitationsView=new d,this.activitiesView=new h,this.shareAdminReposView=new v,this.shareAdminFoldersView=new m,this.shareAdminShareLinksView=new g,this.shareAdminUploadLinksView=new y,app.ui.notificationsView=this.notificationsView=new b,app.ui.accountView=this.accountView=new w,app.pageOptions.sort_mode=r.get("sort_mode")||"name_up",this.currentView=this.myReposView,e("#info-bar .close").click(n.closeTopNoticeBar),e("#top-browser-tip .close").click(function(){e("#top-browser-tip").addClass("hide")})},switchCurrentView:function(e){this.currentView!=e&&(this.currentView.hide(),this.currentView=e),app.ui.groupDiscussions&&app.ui.groupDiscussions.hide()},showRepos:function(){app.pageOptions.can_add_repo?this.showMyRepos():this.showSharedRepos()},showMyRepos:function(){this.switchCurrentView(this.myReposView),this.myReposView.show(),this.sideNavView.setCurTab("mine")},showSharedRepos:function(){this.switchCurrentView(this.sharedReposView),this.sharedReposView.show(),this.sideNavView.setCurTab("shared")},showMyRepoDir:function(e,t){t?t="/"+t:t="/",this.switchCurrentView(this.dirView),this.dirView.showDir("my-libs",e,t),this.sideNavView.setCurTab("mine")},showCommonDir:function(e,t){t?t="/"+t:t="/",this.switchCurrentView(this.dirView),this.dirView.showDir("common",e,t),this.sideNavView.setCurTab("mine")},showSharedRepoDir:function(e,t){t?t="/"+t:t="/",this.switchCurrentView(this.dirView),this.dirView.showDir("shared-libs",e,t),this.sideNavView.setCurTab("shared")},showGroups:function(){this.switchCurrentView(this.groupsView),this.groupsView.show(),this.sideNavView.setCurTab("group",{cur_group_tab:"groups",cur_group_id:""})},showGroup:function(e,t){this.switchCurrentView(this.groupView),this.groupView.show(e,t),this.sideNavView.setCurTab("group",{cur_group_tab:"",cur_group_id:e})},showGroupRepoDir:function(e,t,r){r?r="/"+r:r="/";var i=n.groupId2Name(e);i?(this.switchCurrentView(this.dirView),this.dirView.showDir("group/"+e,t,r,{group_name:i}),this.sideNavView.setCurTab("group",{cur_group_tab:"",cur_group_id:e})):(n.feedback("Group {group_id} not found".replace("{group_id}",e),"error"),app.router.navigate("",{trigger:!0}))},showGroupDiscussions:function(e){this.showGroup(e,{showDiscussions:!0})},showOrgRepos:function(){this.switchCurrentView(this.orgView),this.orgView.show(),this.sideNavView.setCurTab("org")},showOrgRepoDir:function(e,t){t?t="/"+t:t="/",this.switchCurrentView(this.dirView),this.dirView.showDir("org",e,t),this.sideNavView.setCurTab("org")},showStarredFile:function(){this.switchCurrentView(this.starredFileView),this.starredFileView.show(),this.sideNavView.setCurTab("starred")},showActivities:function(){this.switchCurrentView(this.activitiesView),this.activitiesView.show(),this.sideNavView.setCurTab("activities")},showDevices:function(){this.switchCurrentView(this.devicesView),this.devicesView.show(),this.sideNavView.setCurTab("devices")},showInvitations:function(){this.switchCurrentView(this.invitationsView),this.invitationsView.show(),this.sideNavView.setCurTab("invitations")},showShareAdminRepos:function(){this.switchCurrentView(this.shareAdminReposView),this.shareAdminReposView.show(),this.sideNavView.setCurTab("share-admin-repos")},showShareAdminFolders:function(){this.switchCurrentView(this.shareAdminFoldersView),this.shareAdminFoldersView.show(),this.sideNavView.setCurTab("share-admin-folders")},showShareAdminShareLinks:function(){this.switchCurrentView(this.shareAdminShareLinksView),this.shareAdminShareLinksView.show(),this.sideNavView.setCurTab("share-admin-links")},showShareAdminUploadLinks:function(){this.switchCurrentView(this.shareAdminUploadLinksView),this.shareAdminUploadLinksView.show(),this.sideNavView.setCurTab("share-admin-links")}});return E}),define("app/main",["app/router"],function(e){app.router=new e,Backbone.history.start()}),require(["./common"],function(e){require(["app/main"])}),define("main",function(){});