diff --git a/server.js b/server.js index 5a7c595ae..e1d70e1db 100644 --- a/server.js +++ b/server.js @@ -258,7 +258,7 @@ app.use(function (req, res, next) { var httpServer = httpsOpts ? Https.createServer(httpsOpts, app) : Http.createServer(app); /* Install sockjs websocket server */ -OOServer.install(httpServer, config.httpPort, () => { +//OOServer.install(httpServer, config.httpPort, () => { httpServer.listen(config.httpPort,config.httpAddress,function(){ var host = config.httpAddress; var hostName = !host.indexOf(':') ? '[' + host + ']' : host; @@ -268,11 +268,11 @@ OOServer.install(httpServer, config.httpPort, () => { console.log('\n[%s] server available http://%s%s', new Date().toISOString(), hostName, ps); }); -}); +//}); if (config.httpSafePort) { var safeHttpServer = Http.createServer(app).listen(config.httpSafePort, config.httpAddress); - OOServer.install(safeHttpServer, config.httpSafePort, () => { - }); + //OOServer.install(safeHttpServer, config.httpSafePort, () => { + //}); } var wsConfig = { server: httpServer }; diff --git a/www/common/onlyoffice/sdkjs/cell/sdk-all-min.js b/www/common/onlyoffice/sdkjs/cell/sdk-all-min.js index 88caf0e20..74f03ebe8 100644 --- a/www/common/onlyoffice/sdkjs/cell/sdk-all-min.js +++ b/www/common/onlyoffice/sdkjs/cell/sdk-all-min.js @@ -3174,6 +3174,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) DocsCoApi.prototype._send = function(data) { if (data !== null && typeof data === "object") { if (this._state > 0) { + console.log(data); this.sockjs.send(JSON.stringify(data)); } else { this._msgBuffer.push(JSON.stringify(data)); @@ -3184,6 +3185,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) DocsCoApi.prototype._sendRaw = function(data) { if (data !== null && typeof data === "string") { if (this._state > 0) { + console.log(data); this.sockjs.send(data); } else { this._msgBuffer.push(data); @@ -3755,6 +3757,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) var t = this; var sockjs; + /* if (window['IS_NATIVE_EDITOR']) { sockjs = this.sockjs = window['SockJS']; sockjs.open(); @@ -3763,21 +3766,27 @@ AscBrowser.convertToRetinaValue = function(value, isScale) //ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io //при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4) sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']}); - } + }*/ + sockjs = this.sockjs = {}; + //t._state = true; sockjs.onopen = function() { + /* if (t.reconnectTimeout) { clearTimeout(t.reconnectTimeout); t.reconnectTimeout = null; t.attemptCount = 0; } + */ t._state = ConnectionState.WaitAuth; t.onFirstConnect(); }; + sockjs.onopen(); sockjs.onmessage = function(e) { //TODO: add checks and error handling //Get data type + console.log(e.data); var dataObject = JSON.parse(e.data); switch (dataObject['type']) { case 'auth' : @@ -3847,6 +3856,68 @@ AscBrowser.convertToRetinaValue = function(value, isScale) break; } }; + + sockjs.close = function () { + console.error('Close realtime'); + }; + + var send = function (data) { + setTimeout(function () { + console.log(data); + sockjs.onmessage({ + data: JSON.stringify(data) + }); + }); + }; + sockjs.send = function (data) { + console.log(data); + try { + var obj = JSON.parse(data); + } catch (e) { + console.error(e); + return; + } + var msg, msg2; + switch (obj.type) { + case 'auth': + msg = { + "type":"auth", + "result":1, + "sessionId":"08e77705-dc5c-477d-b73a-b1a7cbca1e9b", + "sessionTimeConnect":+new Date(), + "participants":[] + }; + msg2 = { + "type":"documentOpen", + "data":{"type":"open","status":"ok","data":{"Editor.bin":obj.openCmd.url}} + }; + send(msg); + send(msg2); + break; + case 'getMessages': + msg = {}; + break; + } + }; + + var license = { + type: 'license', + license: { + type: 3, + light: false, + trial: false, + rights: 1, + buildVersion: "4.3.3", + buildNumber: 4, + branding: false + } + }; + send(license); + + + + + /* sockjs.onclose = function(evt) { if (ConnectionState.SaveChanges === t._state) { // Мы сохраняли изменения и разорвалось соединение @@ -3871,6 +3942,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) t._tryReconnect(); } }; + */ return sockjs; }; @@ -3917,7 +3989,8 @@ AscBrowser.convertToRetinaValue = function(value, isScale) //----------------------------------------------------------export---------------------------------------------------- window['AscCommon'] = window['AscCommon'] || {}; window['AscCommon'].CDocsCoApi = CDocsCoApi; -})(window); +})(window); + /* * (c) Copyright Ascensio System SIA 2010-2017 * @@ -9205,7 +9278,6 @@ function saveWithParts(fSendCommand, fCallback, fCallbackRequest, oAdditionalDat } function loadFileContent(url, callback) { -console.error(url); asc_ajax({ url: url, dataType: "text", @@ -9228,90 +9300,86 @@ function getImageFromChanges (name) { } return null; } -function openFileCommand(binUrl, changesUrl, Signature, callback) { - var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false; - var onEndOpen = function() { - console.error("this is where we should decrypt"); - if (bEndLoadFile && bEndLoadChanges) { - if (callback) { - callback(bError, oResult); - } - } - }; - var sFileUrl = binUrl; - sFileUrl = sFileUrl.replace(/\\/g, "/"); - - if (!window['IS_NATIVE_EDITOR']) { - asc_ajax({ - url: sFileUrl, - dataType: "text", - success: function(result) { - //получаем url к папке с файлом - var url; - var nIndex = sFileUrl.lastIndexOf("/"); - url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl; - if (0 < result.length) { - oResult.bSerFormat = Signature === result.substring(0, Signature.length); - oResult.data = result; - oResult.url = url; - } else { - bError = true; - } - bEndLoadFile = true; - onEndOpen(); - console.error(oResult); // XXX - }, - error: function() { - bEndLoadFile = true; - bError = true; - onEndOpen(); - } - }); - } - - if (null != changesUrl) { - console.error("null changesUrl"); // XXX - getJSZipUtils().getBinaryContent(changesUrl, function(err, data) { - bEndLoadChanges = true; - if (err) { - bError = true; - onEndOpen(); - return; - } - - oZipChanges = new (require('jszip'))(data); - oResult.changes = []; - for (var i in oZipChanges.files) { - if (i.endsWith('.json')) { - // Заглушка на имя файла (стоило его начинать с цифры) - oResult.changes[parseInt(i.slice('changes'.length))] = - JSON.parse(oZipChanges.files[i].asText()); - } - } - onEndOpen(); - }); - } else { - bEndLoadChanges = true; - } - - if (window['IS_NATIVE_EDITOR']) { - console.error("is native editor"); - var result = window["native"]["openFileCommand"](sFileUrl, changesUrl, Signature); - - var url; - var nIndex = sFileUrl.lastIndexOf("/"); - url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl; - if (0 < result.length) { - oResult.bSerFormat = Signature === result.substring(0, Signature.length); - oResult.data = result; - oResult.url = url; - } else { - bError = true; - } - bEndLoadFile = true; - onEndOpen(); - } -} +function openFileCommand(binUrl, changesUrl, Signature, callback) { + var bError = false, oResult = new OpenFileResult(), bEndLoadFile = false, bEndLoadChanges = false; + var onEndOpen = function() { + if (bEndLoadFile && bEndLoadChanges) { + if (callback) { + callback(bError, oResult); + } + } + }; + var sFileUrl = binUrl; + sFileUrl = sFileUrl.replace(/\\/g, "/"); + + if (!window['IS_NATIVE_EDITOR']) { + asc_ajax({ + url: sFileUrl, + dataType: "text", + success: function(result) { + //получаем url к папке с файлом + var url; + var nIndex = sFileUrl.lastIndexOf("/"); + url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl; + if (0 < result.length) { + oResult.bSerFormat = Signature === result.substring(0, Signature.length); + oResult.data = result; + oResult.url = url; + } else { + bError = true; + } + bEndLoadFile = true; + onEndOpen(); + }, + error: function() { + bEndLoadFile = true; + bError = true; + onEndOpen(); + } + }); + } + + if (null != changesUrl) { + getJSZipUtils().getBinaryContent(changesUrl, function(err, data) { + bEndLoadChanges = true; + if (err) { + bError = true; + onEndOpen(); + return; + } + + oZipChanges = new (require('jszip'))(data); + oResult.changes = []; + for (var i in oZipChanges.files) { + if (i.endsWith('.json')) { + // Заглушка на имя файла (стоило его начинать с цифры) + oResult.changes[parseInt(i.slice('changes'.length))] = JSON.parse(oZipChanges.files[i].asText()); + } + } + onEndOpen(); + }); + } else { + bEndLoadChanges = true; + } + + if (window['IS_NATIVE_EDITOR']) { + var result = window["native"]["openFileCommand"](sFileUrl, changesUrl, Signature); + + var url; + var nIndex = sFileUrl.lastIndexOf("/"); + url = (-1 !== nIndex) ? sFileUrl.substring(0, nIndex + 1) : sFileUrl; + if (0 < result.length) { + oResult.bSerFormat = Signature === result.substring(0, Signature.length); + oResult.data = result; + oResult.url = url; + } else { + bError = true; + } + + bEndLoadFile = true; + onEndOpen(); + } + } function sendCommand(editor, fCallback, rdata, dataContainer) { //json не должен превышать размера 2097152, иначе при его чтении будет exception var docConnectionId = editor.CoAuthoringApi.getDocId(); diff --git a/www/common/onlyoffice/sdkjs/slide/sdk-all-min.js b/www/common/onlyoffice/sdkjs/slide/sdk-all-min.js index e3ca4529a..bc77ab9b8 100644 --- a/www/common/onlyoffice/sdkjs/slide/sdk-all-min.js +++ b/www/common/onlyoffice/sdkjs/slide/sdk-all-min.js @@ -3755,6 +3755,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) var t = this; var sockjs; + /* if (window['IS_NATIVE_EDITOR']) { sockjs = this.sockjs = window['SockJS']; sockjs.open(); @@ -3763,8 +3764,11 @@ AscBrowser.convertToRetinaValue = function(value, isScale) //ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io //при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4) sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']}); - } + }*/ + sockjs = {}; + t._state = true; + /* sockjs.onopen = function() { if (t.reconnectTimeout) { clearTimeout(t.reconnectTimeout); @@ -3775,6 +3779,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) t._state = ConnectionState.WaitAuth; t.onFirstConnect(); }; + */ sockjs.onmessage = function(e) { //TODO: add checks and error handling //Get data type @@ -3847,6 +3852,67 @@ AscBrowser.convertToRetinaValue = function(value, isScale) break; } }; + + sockjs.close = function () { + console.error('Close realtime'); + }; + + var send = function (data) { + setTimeout(function () { + this.onmessage(JSON.stringify(data)); + }); + }; + sockjs.send = function (data) { + try { + var obj = JSON.parse(data); + } catch (e) { + console.log(data); + console.error(e); + return; + } + var msg, msg2; + switch (obj.type) { + case 'auth': + msg = { + "type":"auth", + "result":1, + "sessionId":"08e77705-dc5c-477d-b73a-b1a7cbca1e9b", + "sessionTimeConnect":+new Date(), + "participants":[] + }; + msg2 = { + "type":"documentOpen", + "data":{"type":"open","status":"ok","data":{"Editor.bin":obj.openCmd.url}} + }; + send(msg); + send(msg2); + break; + case 'getMessages': + msg = {}; + break; + } + }; + + var license = { + type: 'license', + license: { + type: 3, + light: false, + trial: false, + rights: 1, + buildVersion: "4.3.3", + buildNumber: 4, + branding: false + } + }; + sockjs.onmessage({ + data: JSON.stringify(license) + }); + + + + + /* sockjs.onclose = function(evt) { if (ConnectionState.SaveChanges === t._state) { // Мы сохраняли изменения и разорвалось соединение @@ -3871,6 +3937,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) t._tryReconnect(); } }; + */ return sockjs; }; @@ -3917,7 +3984,8 @@ AscBrowser.convertToRetinaValue = function(value, isScale) //----------------------------------------------------------export---------------------------------------------------- window['AscCommon'] = window['AscCommon'] || {}; window['AscCommon'].CDocsCoApi = CDocsCoApi; -})(window); +})(window); + /* * (c) Copyright Ascensio System SIA 2010-2017 * diff --git a/www/common/onlyoffice/sdkjs/word/sdk-all-min.js b/www/common/onlyoffice/sdkjs/word/sdk-all-min.js index f663928c2..6b7bd779b 100644 --- a/www/common/onlyoffice/sdkjs/word/sdk-all-min.js +++ b/www/common/onlyoffice/sdkjs/word/sdk-all-min.js @@ -3755,6 +3755,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) var t = this; var sockjs; + /* if (window['IS_NATIVE_EDITOR']) { sockjs = this.sockjs = window['SockJS']; sockjs.open(); @@ -3763,8 +3764,11 @@ AscBrowser.convertToRetinaValue = function(value, isScale) //ограничиваем transports WebSocket и XHR / JSONP polling, как и engine.io https://github.com/socketio/engine.io //при переборе streaming transports у клиента с wirewall происходило зацикливание(не повторялось в версии sock.js 0.3.4) sockjs = this.sockjs = new (this._getSockJs())(this.sockjs_url, null, {transports: ['websocket', 'xdr-polling', 'xhr-polling', 'iframe-xhr-polling', 'jsonp-polling']}); - } + }*/ + sockjs = {}; + t._state = true; + /* sockjs.onopen = function() { if (t.reconnectTimeout) { clearTimeout(t.reconnectTimeout); @@ -3775,6 +3779,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) t._state = ConnectionState.WaitAuth; t.onFirstConnect(); }; + */ sockjs.onmessage = function(e) { //TODO: add checks and error handling //Get data type @@ -3847,6 +3852,67 @@ AscBrowser.convertToRetinaValue = function(value, isScale) break; } }; + + sockjs.close = function () { + console.error('Close realtime'); + }; + + var send = function (data) { + setTimeout(function () { + this.onmessage(JSON.stringify(data)); + }); + }; + sockjs.send = function (data) { + try { + var obj = JSON.parse(data); + } catch (e) { + console.log(data); + console.error(e); + return; + } + var msg, msg2; + switch (obj.type) { + case 'auth': + msg = { + "type":"auth", + "result":1, + "sessionId":"08e77705-dc5c-477d-b73a-b1a7cbca1e9b", + "sessionTimeConnect":+new Date(), + "participants":[] + }; + msg2 = { + "type":"documentOpen", + "data":{"type":"open","status":"ok","data":{"Editor.bin":obj.openCmd.url}} + }; + send(msg); + send(msg2); + break; + case 'getMessages': + msg = {}; + break; + } + }; + + var license = { + type: 'license', + license: { + type: 3, + light: false, + trial: false, + rights: 1, + buildVersion: "4.3.3", + buildNumber: 4, + branding: false + } + }; + sockjs.onmessage({ + data: JSON.stringify(license) + }); + + + + + /* sockjs.onclose = function(evt) { if (ConnectionState.SaveChanges === t._state) { // Мы сохраняли изменения и разорвалось соединение @@ -3871,6 +3937,7 @@ AscBrowser.convertToRetinaValue = function(value, isScale) t._tryReconnect(); } }; + */ return sockjs; }; @@ -3917,7 +3984,8 @@ AscBrowser.convertToRetinaValue = function(value, isScale) //----------------------------------------------------------export---------------------------------------------------- window['AscCommon'] = window['AscCommon'] || {}; window['AscCommon'].CDocsCoApi = CDocsCoApi; -})(window); +})(window); + /* * (c) Copyright Ascensio System SIA 2010-2017 * diff --git a/www/common/onlyoffice/web-apps/apps/documenteditor/main/app.js b/www/common/onlyoffice/web-apps/apps/documenteditor/main/app.js index 2aa0cea04..1536a56bf 100644 --- a/www/common/onlyoffice/web-apps/apps/documenteditor/main/app.js +++ b/www/common/onlyoffice/web-apps/apps/documenteditor/main/app.js @@ -1,8 +1,53 @@ /* - * Copyright (c) Ascensio System SIA 2018. All rights reserved + * Copyright (c) Ascensio System SIA 2019. All rights reserved * * http://www.onlyoffice.com * * Version: 0.0.0 (build:0) */ -function onDropDownKeyDown(e){var t=$(this),n=t.parent(),r=jQuery.Event("keydown.before.bs.dropdown"),i=jQuery.Event("keydown.after.bs.dropdown");n.trigger(r),n.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(e=arguments[1]),/^(38|40|27|13|9|37|39)$/.test(e.keyCode)&&!e.ctrlKey&&!e.altKey&&(patchDropDownKeyDownAdditional.call(this,e),/(37|39)/.test(e.keyCode)||(e.preventDefault(),e.stopPropagation()))):(patchDropDownKeyDown.call(this,e),e.preventDefault(),e.stopPropagation()),n.trigger(i)}function patchDropDownKeyDown(e){if(!/(38|40|27|37|39)/.test(e.keyCode))return;var t=$(this);e.preventDefault(),e.stopPropagation();if(t.is(".disabled, :disabled"))return;var n=getParent(t),r=n.hasClass("open")||n.hasClass("over");if(!r||r&&e.keyCode==27){if(e.which==27){i=$("[role=menu] li.dropdown-submenu.over:visible",n);if(i.size())return i.eq(i.size()-1).removeClass("over"),!1;n.hasClass("dropdown-submenu")&&n.hasClass("over")?(n.removeClass("over"),n.find("> a").focus()):n.find("[data-toggle=dropdown]").focus()}return r?t.click():undefined}var i=$("> [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(":focus"));if(e.keyCode==39){if(s<0)return;var o=i.eq(s).parent();o.hasClass("dropdown-submenu")&&!o.hasClass("over")&&(o.mouseenter(),o.addClass("focused-submenu"),_.delay(function(){var e=$("> [role=menu]",o),t=e.find("> li:not(.divider):not(.disabled):visible > a"),n=0;if(e.find("> .menu-scroll").length>0){var r=e.scrollTop();for(var i=0;ir){n=i;break}}t.length>0&&t.eq(n).focus()},250))}else e.keyCode==37?n.hasClass("dropdown-submenu")&&n.hasClass("over")&&(n.removeClass("over"),n.find("> a").focus()):(e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s [role=menu] > li:not(.divider):not(.disabled):visible",n).find("> a");if(!i.length)return;var s=i.index(i.filter(".focus"));e.keyCode==38?s>0?s--:t.hasClass("no-cyclic")?s=0:s=i.length-1:e.keyCode==40&&(s2;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;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=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=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=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i":">",'"':""","'":"'"}};_.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)),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(window,noGlobal){function isArrayLike(e){var t=!!e&&"length"in e&&e.length,n=jQuery.type(e);return n==="function"||jQuery.isWindow(e)?!1:n==="array"||t===0||typeof t=="number"&&t>0&&t-1 in e}function winnow(e,t,n){if(jQuery.isFunction(t))return jQuery.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return jQuery.grep(e,function(e){return e===t!==n});if(typeof t=="string"){if(risSimple.test(t))return jQuery.filter(t,e,n);t=jQuery.filter(t,e)}return jQuery.grep(e,function(e){return indexOf.call(t,e)>-1!==n})}function sibling(e,t){while((e=e[t])&&e.nodeType!==1);return e}function createOptions(e){var t={};return jQuery.each(e.match(rnotwhite)||[],function(e,n){t[n]=!0}),t}function completed(){document.removeEventListener("DOMContentLoaded",completed),window.removeEventListener("load",completed),jQuery.ready()}function Data(){this.expando=jQuery.expando+Data.uid++}function dataAttr(e,t,n){var r;if(n===undefined&&e.nodeType===1){r="data-"+t.replace(rmultiDash,"-$&").toLowerCase(),n=e.getAttribute(r);if(typeof n=="string"){try{n=n==="true"?!0:n==="false"?!1:n==="null"?null:+n+""===n?+n:rbrace.test(n)?jQuery.parseJSON(n):n}catch(i){}dataUser.set(e,t,n)}else n=undefined}return n}function adjustCSS(e,t,n,r){var i,s=1,o=20,u=r?function(){return r.cur()}:function(){return jQuery.css(e,t,"")},a=u(),f=n&&n[3]||(jQuery.cssNumber[t]?"":"px"),l=(jQuery.cssNumber[t]||f!=="px"&&+a)&&rcssNum.exec(jQuery.css(e,t));if(l&&l[3]!==f){f=f||l[3],n=n||[],l=+a||1;do s=s||".5",l/=s,jQuery.style(e,t,l+f);while(s!==(s=u()/a)&&s!==1&&--o)}return n&&(l=+l||+a||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=f,r.start=l,r.end=i)),i}function getAll(e,t){var n=typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll(t||"*"):[];return t===undefined||t&&jQuery.nodeName(e,t)?jQuery.merge([e],n):n}function setGlobalEval(e,t){var n=0,r=e.length;for(;n-1){i&&i.push(s);continue}f=jQuery.contains(s.ownerDocument,s),o=getAll(c.appendChild(s),"script"),f&&setGlobalEval(o);if(n){l=0;while(s=o[l++])rscriptType.test(s.type||"")&&n.push(s)}}return c}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(e){}}function on(e,t,n,r,i,s){var o,u;if(typeof t=="object"){typeof n!="string"&&(r=r||n,n=undefined);for(u in t)on(e,u,n,r,t[u],s);return e}r==null&&i==null?(i=n,r=n=undefined):i==null&&(typeof n=="string"?(i=r,r=undefined):(i=r,r=n,n=undefined));if(i===!1)i=returnFalse;else if(!i)return e;return s===1&&(o=i,i=function(e){return jQuery().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=jQuery.guid++)),e.each(function(){jQuery.event.add(this,t,i,r,n)})}function manipulationTarget(e,t){return jQuery.nodeName(e,"table")&&jQuery.nodeName(t.nodeType!==11?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function disableScript(e){return e.type=(e.getAttribute("type")!==null)+"/"+e.type,e}function restoreScript(e){var t=rscriptTypeMasked.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function cloneCopyEvent(e,t){var n,r,i,s,o,u,a,f;if(t.nodeType!==1)return;if(dataPriv.hasData(e)){s=dataPriv.access(e),o=dataPriv.set(t,s),f=s.events;if(f){delete o.handle,o.events={};for(i in f)for(n=0,r=f[i].length;n1&&typeof p=="string"&&!support.checkClone&&rchecked.test(p))return e.each(function(i){var s=e.eq(i);d&&(t[0]=p.call(this,i,s.html())),domManip(s,t,n,r)});if(c){i=buildFragment(t,e[0].ownerDocument,!1,e,r),s=i.firstChild,i.childNodes.length===1&&(i=s);if(s||r){o=jQuery.map(getAll(i,"script"),disableScript),u=o.length;for(;l")).appendTo(t.documentElement),t=iframe[0].contentDocument,t.write(),t.close(),n=actualDisplay(e,t),iframe.detach();elemdisplay[e]=n}return n}function curCSS(e,t,n){var r,i,s,o,u=e.style;return n=n||getStyles(e),o=n?n.getPropertyValue(t)||n[t]:undefined,(o===""||o===undefined)&&!jQuery.contains(e.ownerDocument,e)&&(o=jQuery.style(e,t)),n&&!support.pixelMarginRight()&&rnumnonpx.test(o)&&rmargin.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}function addGetHookIf(e,t){return{get:function(){if(e()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function vendorPropName(e){if(e in emptyStyle)return e;var t=e[0].toUpperCase()+e.slice(1),n=cssPrefixes.length;while(n--){e=cssPrefixes[n]+t;if(e in emptyStyle)return e}}function setPositiveNumber(e,t,n){var r=rcssNum.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function augmentWidthOrHeight(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+=jQuery.css(e,n+cssExpand[s],!0,i)),r?(n==="content"&&(o-=jQuery.css(e,"padding"+cssExpand[s],!0,i)),n!=="margin"&&(o-=jQuery.css(e,"border"+cssExpand[s]+"Width",!0,i))):(o+=jQuery.css(e,"padding"+cssExpand[s],!0,i),n!=="padding"&&(o+=jQuery.css(e,"border"+cssExpand[s]+"Width",!0,i)));return o}function getWidthOrHeight(e,t,n){var r=!0,i=t==="width"?e.offsetWidth:e.offsetHeight,s=getStyles(e),o=jQuery.css(e,"boxSizing",!1,s)==="border-box";document.msFullscreenElement&&window.top!==window&&e.getClientRects().length&&(i=Math.round(e.getBoundingClientRect()[t]*100));if(i<=0||i==null){i=curCSS(e,t,s);if(i<0||i==null)i=e.style[t];if(rnumnonpx.test(i))return i;r=o&&(support.boxSizingReliable()||i===e.style[t]),i=parseFloat(i)||0}return i+augmentWidthOrHeight(e,t,n||(o?"border":"content"),r,s)+"px"}function showHide(e,t){var n,r,i,s=[],o=0,u=e.length;for(;o=0&&n=0},isPlainObject:function(e){var t;if(jQuery.type(e)!=="object"||e.nodeType||jQuery.isWindow(e))return!1;if(e.constructor&&!hasOwn.call(e,"constructor")&&!hasOwn.call(e.constructor.prototype||{},"isPrototypeOf"))return!1;for(t in e);return t===undefined||hasOwn.call(e,t)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return e==null?e+"":typeof e=="object"||typeof e=="function"?class2type[toString.call(e)]||"object":typeof e},globalEval:function(code){var script,indirect=eval;code=jQuery.trim(code),code&&(code.indexOf("use strict")===1?(script=document.createElement("script"),script.text=code,document.head.appendChild(script).parentNode.removeChild(script)):indirect(code))},camelCase:function(e){return e.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(isArrayLike(e)){n=e.length;for(;rr.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function ut(e){return e[w]=!0,e}function at(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ft(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function lt(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 ct(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function pt(e){return ut(function(t){return t=+t,ut(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 dt(e){return e&&typeof e.getElementsByTagName!="undefined"&&e}function vt(){}function mt(e){var t=0,n=e.length,r="";for(;t1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function bt(e,t,n){var r=0,i=t.length;for(;r-1&&(s[f]=!(o[f]=c))}}else g=wt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):D.apply(o,g)})}function St(e){var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=gt(function(e){return e===t},u,!0),c=gt(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(;a1&&yt(h),a>1&&mt(e.slice(0,a-1).concat({value:e[a-2].type===" "?"*":""})).replace(U,"$1"),n,a0,i=e.length>0,s=function(s,o,u,a,l){var c,d,m,g=0,y="0",b=s&&[],w=[],E=f,x=s||i&&r.find.TAG("*",l),T=S+=E==null?1:Math.random()||.1,N=x.length;l&&(f=o===p||o||l);for(;y!==N&&(c=x[y])!=null;y++){if(i&&c){d=0,!o&&c.ownerDocument!==p&&(h(c),u=!v);while(m=e[d++])if(m(c,o||p,u)){a.push(c);break}l&&(S=T)}n&&((c=!m&&c)&&g--,s&&b.push(c))}g+=y;if(n&&y!==g){d=0;while(m=t[d++])m(b,w,o,u);if(s){if(g>0)while(y--)!b[y]&&!w[y]&&(w[y]=M.call(a));w=wt(w)}D.apply(a,w),l&&!s&&w.length>0&&g+t.length>1&&st.uniqueSort(a)}return l&&(S=T,f=E),b};return n?ut(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=ot(),N=ot(),C=ot(),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+~]|"+j+")"+j+"*"),X=new RegExp("="+j+"*([^\\]'\"]*?)"+j+"*\\]","g"),V=new RegExp(q),$=new RegExp("^"+F+"$"),J={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+q),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")},K=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,G=/^[^{]+\{\s*\[native \w/,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,et=/'|\\/g,tt=new RegExp("\\\\([\\da-f]{1,6}"+j+"?|("+j+")|.)","ig"),nt=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)},rt=function(){h()};try{D.apply(O=P.call(E.childNodes),E.childNodes),O[E.childNodes.length].nodeType}catch(it){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=st.support={},s=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},h=st.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=p.documentElement,v=!s(p),(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",rt,!1):i.attachEvent&&i.attachEvent("onunload",rt)),n.attributes=at(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=at(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=G.test(p.getElementsByClassName),n.getById=at(function(e){return d.appendChild(e).id=w,!p.getElementsByName||!p.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]:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(tt,nt);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(typeof t.getElementsByClassName!="undefined"&&v)return t.getElementsByClassName(e)},g=[],m=[];if(n.qsa=G.test(p.querySelectorAll))at(function(e){d.appendChild(e).innerHTML=""+"",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(".#.+[+~]")}),at(function(e){var t=p.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=G.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&at(function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),g.push("!=",q)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=G.test(d.compareDocumentPosition),b=t||G.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===p||e.ownerDocument===E&&b(E,e)?-1:t===p||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,o=[e],u=[t];if(!i||!s)return e===p?-1:t===p?1:i?-1:s?1:l?H(l,e)-H(l,t):0;if(i===s)return lt(e,t);n=e;while(n=n.parentNode)o.unshift(n);n=t;while(n=n.parentNode)u.unshift(n);while(o[r]===u[r])r++;return r?lt(o[r],u[r]):o[r]===E?-1:u[r]===E?1:0},p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){(e.ownerDocument||e)!==p&&h(e),t=t.replace(X,"='$1']");if(n.matchesSelector&&v&&!C[t+" "]&&(!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 st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},st.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},st.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},st.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=st.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=st.selectors={cacheLength:50,createPseudo:ut,match:J,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(tt,nt),e[3]=(e[3]||e[4]||e[5]||"").replace(tt,nt),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]||st.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]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return J.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.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(tt,nt).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=st.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(R," ")+" ").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,b=!1;if(m){if(s){while(v){h=t;while(h=h[v])if(u?h.nodeName.toLowerCase()===g:h.nodeType===1)return!1;d=v=e==="only"&&!d&&"nextSibling"}return!0}d=[o?m.firstChild:m.lastChild];if(o&&y){h=m,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p&&f[2],h=p&&m.childNodes[p];while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if(h.nodeType===1&&++b&&h===t){l[e]=[S,p,b];break}}else{y&&(h=t,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p);if(b===!1)while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if((u?h.nodeName.toLowerCase()===g:h.nodeType===1)&&++b){y&&(c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),l[e]=[S,b]);if(h===t)break}}return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ut(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:ut(function(e){var t=[],n=[],r=u(e.replace(U,"$1"));return r[w]?ut(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:ut(function(e){return function(t){return st(e,t).length>0}}),contains:ut(function(e){return e=e.replace(tt,nt),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:ut(function(e){return $.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(tt,nt).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 Q.test(e.nodeName)},input:function(e){return K.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:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[n<0?n+t:n]}),even:pt(function(e,t){var n=0;for(;n=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=n<0?n+t:n;for(;++r2&&(l=f[0]).type==="ID"&&n.getById&&t.nodeType===9&&v&&r.relative[f[1].type]){t=(r.find.ID(l.matches[0].replace(tt,nt),t)||[])[0];if(!t)return i;p&&(t=t.parentNode),e=e.slice(f.shift().value.length)}a=J.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(tt,nt),Z.test(f[0].type)&&dt(t.parentNode)||t)){f.splice(a,1),e=s.length&&mt(f);if(!e)return D.apply(i,s),i;break}}}return(p||u(e,d))(s,t,!v,i,!t||Z.test(e)&&dt(t.parentNode)||t),i},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=at(function(e){return e.compareDocumentPosition(p.createElement("div"))&1}),at(function(e){return e.innerHTML="",e.firstChild.getAttribute("href")==="#"})||ft("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,t.toLowerCase()==="type"?1:2)}),(!n.attributes||!at(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),e.firstChild.getAttribute("value")===""}))&&ft("value",function(e,t,n){if(!n&&e.nodeName.toLowerCase()==="input")return e.defaultValue}),at(function(e){return e.getAttribute("disabled")==null})||ft(B,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),st}(window);jQuery.find=Sizzle,jQuery.expr=Sizzle.selectors,jQuery.expr[":"]=jQuery.expr.pseudos,jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort,jQuery.text=Sizzle.getText,jQuery.isXMLDoc=Sizzle.isXML,jQuery.contains=Sizzle.contains;var dir=function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&e.nodeType!==9)if(e.nodeType===1){if(i&&jQuery(e).is(n))break;r.push(e)}return r},siblings=function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n},rneedsContext=jQuery.expr.match.needsContext,rsingleTag=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,risSimple=/^.[^:#\[\.,]*$/;jQuery.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),t.length===1&&r.nodeType===1?jQuery.find.matchesSelector(r,e)?[r]:[]:jQuery.find.matches(e,jQuery.grep(t,function(e){return e.nodeType===1}))},jQuery.fn.extend({find:function(e){var t,n=this.length,r=[],i=this;if(typeof e!="string")return this.pushStack(jQuery(e).filter(function(){for(t=0;t1?jQuery.unique(r):r),r.selector=this.selector?this.selector+" "+e:e,r},filter:function(e){return this.pushStack(winnow(this,e||[],!1))},not:function(e){return this.pushStack(winnow(this,e||[],!0))},is:function(e){return!!winnow(this,typeof e=="string"&&rneedsContext.test(e)?jQuery(e):e||[],!1).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,init=jQuery.fn.init=function(e,t,n){var r,i;if(!e)return this;n=n||rootjQuery;if(typeof e=="string"){e[0]==="<"&&e[e.length-1]===">"&&e.length>=3?r=[null,e,null]:r=rquickExpr.exec(e);if(r&&(r[1]||!t)){if(r[1]){t=t instanceof jQuery?t[0]:t,jQuery.merge(this,jQuery.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:document,!0));if(rsingleTag.test(r[1])&&jQuery.isPlainObject(t))for(r in t)jQuery.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=document.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=document,this.selector=e,this}return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e)}return e.nodeType?(this.context=this[0]=e,this.length=1,this):jQuery.isFunction(e)?n.ready!==undefined?n.ready(e):e(jQuery):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),jQuery.makeArray(e,this))};init.prototype=jQuery.fn,rootjQuery=jQuery(document);var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:!0,contents:!0,next:!0,prev:!0};jQuery.fn.extend({has:function(e){var t=jQuery(e,this),n=t.length;return this.filter(function(){var e=0;for(;e-1:n.nodeType===1&&jQuery.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?jQuery.uniqueSort(s):s)},index:function(e){return e?typeof e=="string"?indexOf.call(jQuery(e),this[0]):indexOf.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(e,t))))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),jQuery.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return dir(e,"parentNode")},parentsUntil:function(e,t,n){return dir(e,"parentNode",n)},next:function(e){return sibling(e,"nextSibling")},prev:function(e){return sibling(e,"previousSibling")},nextAll:function(e){return dir(e,"nextSibling")},prevAll:function(e){return dir(e,"previousSibling")},nextUntil:function(e,t,n){return dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return dir(e,"previousSibling",n)},siblings:function(e){return siblings((e.parentNode||{}).firstChild,e)},children:function(e){return siblings(e.firstChild)},contents:function(e){return e.contentDocument||jQuery.merge([],e.childNodes)}},function(e,t){jQuery.fn[e]=function(n,r){var i=jQuery.map(this,t,n);return e.slice(-5)!=="Until"&&(r=n),r&&typeof r=="string"&&(i=jQuery.filter(r,i)),this.length>1&&(guaranteedUnique[e]||jQuery.uniqueSort(i),rparentsprev.test(e)&&i.reverse()),this.pushStack(i)}});var rnotwhite=/\S+/g;jQuery.Callbacks=function(e){e=typeof e=="string"?createOptions(e):jQuery.extend({},e);var t,n,r,i,s=[],o=[],u=-1,a=function(){i=e.once,r=t=!0;for(;o.length;u=-1){n=o.shift();while(++u-1)s.splice(n,1),n<=u&&u--}),this},has:function(e){return e?jQuery.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return i=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return i=o=[],n||(s=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],o.push(n),t||a()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!r}};return f},jQuery.extend({Deferred:function(e){var t=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return jQuery.Deferred(function(n){jQuery.each(t,function(t,s){var o=jQuery.isFunction(e[t])&&e[t];i[s[1]](function(){var e=o&&o.apply(this,arguments);e&&jQuery.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[s[0]+"With"](this===r?n.promise():this,o?[e]:arguments)})}),e=null}).promise()},promise:function(e){return e!=null?jQuery.extend(e,r):r}},i={};return r.pipe=r.then,jQuery.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=slice.call(arguments),r=n.length,i=r!==1||e&&jQuery.isFunction(e.promise)?r:0,s=i===1?e:jQuery.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?slice.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t0)return;readyList.resolveWith(document,[jQuery]),jQuery.fn.triggerHandler&&(jQuery(document).triggerHandler("ready"),jQuery(document).off("ready"))}}),jQuery.ready.promise=function(e){return readyList||(readyList=jQuery.Deferred(),document.readyState==="complete"||document.readyState!=="loading"&&!document.documentElement.doScroll?window.setTimeout(jQuery.ready):(document.addEventListener("DOMContentLoaded",completed),window.addEventListener("load",completed))),readyList.promise(e)},jQuery.ready.promise();var access=function(e,t,n,r,i,s,o){var u=0,a=e.length,f=n==null;if(jQuery.type(n)==="object"){i=!0;for(u in n)access(e,t,u,n[u],!0,s,o)}else if(r!==undefined){i=!0,jQuery.isFunction(r)||(o=!0),f&&(o?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(jQuery(e),n)}));if(t)for(;u-1&&n!==undefined&&dataUser.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){dataUser.remove(this,e)})}}),jQuery.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=dataPriv.get(e,t),n&&(!r||jQuery.isArray(n)?r=dataPriv.access(e,t,jQuery.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=jQuery.queue(e,t),r=n.length,i=n.shift(),s=jQuery._queueHooks(e,t),o=function(){jQuery.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 dataPriv.get(e,n)||dataPriv.access(e,n,{empty:jQuery.Callbacks("once memory").add(function(){dataPriv.remove(e,[t+"queue",n])})})}}),jQuery.fn.extend({queue:function(e,t){var n=2;return typeof e!="string"&&(t=e,e="fx",n--),arguments.length",""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td;var rhtml=/<|&#?\w+;/;(function(){var e=document.createDocumentFragment(),t=e.appendChild(document.createElement("div")),n=document.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),support.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",support.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue})();var rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;jQuery.event={global:{},add:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=dataPriv.get(e);if(!m)return;n.handler&&(s=n,n=s.handler,i=s.selector),n.guid||(n.guid=jQuery.guid++),(a=m.events)||(a=m.events={}),(o=m.handle)||(o=m.handle=function(t){return typeof jQuery!="undefined"&&jQuery.event.triggered!==t.type?jQuery.event.dispatch.apply(e,arguments):undefined}),t=(t||"").match(rnotwhite)||[""],f=t.length;while(f--){u=rtypenamespace.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p)continue;c=jQuery.event.special[p]||{},p=(i?c.delegateType:c.bindType)||p,c=jQuery.event.special[p]||{},l=jQuery.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&jQuery.expr.match.needsContext.test(i),namespace:d.join(".")},s),(h=a[p])||(h=a[p]=[],h.delegateCount=0,(!c.setup||c.setup.call(e,r,d,o)===!1)&&e.addEventListener&&e.addEventListener(p,o)),c.add&&(c.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),jQuery.event.global[p]=!0}},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=dataPriv.hasData(e)&&dataPriv.get(e);if(!m||!(a=m.events))return;t=(t||"").match(rnotwhite)||[""],f=t.length;while(f--){u=rtypenamespace.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort();if(!p){for(p in a)jQuery.event.remove(e,p+t[f],n,r,!0);continue}c=jQuery.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=a[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;while(s--)l=h[s],(i||v===l.origType)&&(!n||n.guid===l.guid)&&(!u||u.test(l.namespace))&&(!r||r===l.selector||r==="**"&&l.selector)&&(h.splice(s,1),l.selector&&h.delegateCount--,c.remove&&c.remove.call(e,l));o&&!h.length&&((!c.teardown||c.teardown.call(e,d,m.handle)===!1)&&jQuery.removeEvent(e,p,m.handle),delete a[p])}jQuery.isEmptyObject(a)&&dataPriv.remove(e,"handle events")},dispatch:function(e){e=jQuery.event.fix(e);var t,n,r,i,s,o=[],u=slice.call(arguments),a=(dataPriv.get(this,"events")||{})[e.type]||[],f=jQuery.event.special[e.type]||{};u[0]=e,e.delegateTarget=this;if(f.preDispatch&&f.preDispatch.call(this,e)===!1)return;o=jQuery.event.handlers.call(this,e,a),t=0;while((i=o[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((s=i.handlers[n++])&&!e.isImmediatePropagationStopped())if(!e.rnamespace||e.rnamespace.test(s.namespace))e.handleObj=s,e.data=s.data,r=((jQuery.event.special[s.origType]||{}).handle||s.handler).apply(i.elem,u),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation())}return f.postDispatch&&f.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.type!=="click"||isNaN(e.button)||e.button<1))for(;a!==this;a=a.parentNode||this)if(a.nodeType===1&&(a.disabled!==!0||e.type!=="click")){r=[];for(n=0;n-1:jQuery.find(i,this,null,[a]).length),r[i]&&r.push(s);r.length&&o.push({elem:a,handlers:r})}return u]*)\/>/gi,rnoInnerhtml=/\s*$/g;jQuery.extend({htmlPrefilter:function(e){return e.replace(rxhtmlTag,"<$1>")},clone:function(e,t,n){var r,i,s,o,u=e.cloneNode(!0),a=jQuery.contains(e.ownerDocument,e);if(!support.noCloneChecked&&(e.nodeType===1||e.nodeType===11)&&!jQuery.isXMLDoc(e)){o=getAll(u),s=getAll(e);for(r=0,i=s.length;r0&&setGlobalEval(o,!a&&getAll(e,"script")),u},cleanData:function(e){var t,n,r,i=jQuery.event.special,s=0;for(;(n=e[s])!==undefined;s++)if(acceptData(n)){if(t=n[dataPriv.expando]){if(t.events)for(r in t.events)i[r]?jQuery.event.remove(n,r):jQuery.removeEvent(n,r,t.handle);n[dataPriv.expando]=undefined}n[dataUser.expando]&&(n[dataUser.expando]=undefined)}}}),jQuery.fn.extend({domManip:domManip,detach:function(e){return remove(this,e,!0)},remove:function(e){return remove(this,e)},text:function(e){return access(this,function(e){return e===undefined?jQuery.text(this):this.empty().each(function(){if(this.nodeType===1||this.nodeType===11||this.nodeType===9)this.textContent=e})},null,e,arguments.length)},append:function(){return domManip(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=manipulationTarget(this,e);t.appendChild(e)}})},prepend:function(){return domManip(this,arguments,function(e){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=manipulationTarget(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return domManip(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return domManip(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++)e.nodeType===1&&(jQuery.cleanData(getAll(e,!1)),e.textContent="");return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return jQuery.clone(this,e,t)})},html:function(e){return access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&t.nodeType===1)return t.innerHTML;if(typeof e=="string"&&!rnoInnerhtml.test(e)&&!wrapMap[(rtagName.exec(e)||["",""])[1].toLowerCase()]){e=jQuery.htmlPrefilter(e);try{for(;n1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(e){return typeof e=="boolean"?e?this.show():this.hide():this.each(function(){isHidden(this)?jQuery(this).show():jQuery(this).hide()})}}),jQuery.Tween=Tween,Tween.prototype={constructor:Tween,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||jQuery.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(jQuery.cssNumber[n]?"":"px")},cur:function(){var e=Tween.propHooks[this.prop];return e&&e.get?e.get(this):Tween.propHooks._default.get(this)},run:function(e){var t,n=Tween.propHooks[this.prop];return this.options.duration?this.pos=t=jQuery.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):Tween.propHooks._default.set(this),this}},Tween.prototype.init.prototype=Tween.prototype,Tween.propHooks={_default:{get:function(e){var t;return e.elem.nodeType!==1||e.elem[e.prop]!=null&&e.elem.style[e.prop]==null?e.elem[e.prop]:(t=jQuery.css(e.elem,e.prop,""),!t||t==="auto"?0:t)},set:function(e){jQuery.fx.step[e.prop]?jQuery.fx.step[e.prop](e):e.elem.nodeType!==1||e.elem.style[jQuery.cssProps[e.prop]]==null&&!jQuery.cssHooks[e.prop]?e.elem[e.prop]=e.now:jQuery.style(e.elem,e.prop,e.now+e.unit)}}},Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},jQuery.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},jQuery.fx=Tween.prototype.init,jQuery.fx.step={};var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return adjustCSS(n.elem,e,rcssNum.exec(t),n),n}]},tweener:function(e,t){jQuery.isFunction(e)?(t=e,e=["*"]):e=e.match(rnotwhite);var n,r=0,i=e.length;for(;r1)},removeAttr:function(e){return this.each(function(){jQuery.removeAttr(this,e)})}}),jQuery.extend({attr:function(e,t,n){var r,i,s=e.nodeType;if(s===3||s===8||s===2)return;if(typeof e.getAttribute=="undefined")return jQuery.prop(e,t,n);if(s!==1||!jQuery.isXMLDoc(e))t=t.toLowerCase(),i=jQuery.attrHooks[t]||(jQuery.expr.match.bool.test(t)?boolHook:undefined);if(n!==undefined){if(n===null){jQuery.removeAttr(e,t);return}return i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:(e.setAttribute(t,n+""),n)}return i&&"get"in i&&(r=i.get(e,t))!==null?r:(r=jQuery.find.attr(e,t),r==null?undefined:r)},attrHooks:{type:{set:function(e,t){if(!support.radioValue&&t==="radio"&&jQuery.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r,i=0,s=t&&t.match(rnotwhite);if(s&&e.nodeType===1)while(n=s[i++])r=jQuery.propFix[n]||n,jQuery.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)}}),boolHook={set:function(e,t,n){return t===!1?jQuery.removeAttr(e,n):e.setAttribute(n,n),n}},jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g),function(e,t){var n=attrHandle[t]||jQuery.find.attr;attrHandle[t]=function(e,t,r){var i,s;return r||(s=attrHandle[t],attrHandle[t]=i,i=n(e,t,r)!=null?t.toLowerCase():null,attrHandle[t]=s),i}});var rfocusable=/^(?:input|select|textarea|button)$/i,rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(e,t){return access(this,jQuery.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[jQuery.propFix[e]||e]})}}),jQuery.extend({prop:function(e,t,n){var r,i,s=e.nodeType;if(s===3||s===8||s===2)return;if(s!==1||!jQuery.isXMLDoc(e))t=jQuery.propFix[t]||t,i=jQuery.propHooks[t];return 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=jQuery.find.attr(e,"tabindex");return t?parseInt(t,10):rfocusable.test(e.nodeName)||rclickable.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),support.optSelected||(jQuery.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){jQuery.propFix[this.toLowerCase()]=this});var rclass=/[\t\r\n\f]/g;jQuery.fn.extend({addClass:function(e){var t,n,r,i,s,o,u,a=0;if(jQuery.isFunction(e))return this.each(function(t){jQuery(this).addClass(e.call(this,t,getClass(this)))});if(typeof e=="string"&&e){t=e.match(rnotwhite)||[];while(n=this[a++]){i=getClass(n),r=n.nodeType===1&&(" "+i+" ").replace(rclass," ");if(r){o=0;while(s=t[o++])r.indexOf(" "+s+" ")<0&&(r+=s+" ");u=jQuery.trim(r),i!==u&&n.setAttribute("class",u)}}}return this},removeClass:function(e){var t,n,r,i,s,o,u,a=0;if(jQuery.isFunction(e))return this.each(function(t){jQuery(this).removeClass(e.call(this,t,getClass(this)))});if(!arguments.length)return this.attr("class","");if(typeof e=="string"&&e){t=e.match(rnotwhite)||[];while(n=this[a++]){i=getClass(n),r=n.nodeType===1&&(" "+i+" ").replace(rclass," ");if(r){o=0;while(s=t[o++])while(r.indexOf(" "+s+" ")>-1)r=r.replace(" "+s+" "," ");u=jQuery.trim(r),i!==u&&n.setAttribute("class",u)}}}return this},toggleClass:function(e,t){var n=typeof e;return typeof t=="boolean"&&n==="string"?t?this.addClass(e):this.removeClass(e):jQuery.isFunction(e)?this.each(function(n){jQuery(this).toggleClass(e.call(this,n,getClass(this),t),t)}):this.each(function(){var t,r,i,s;if(n==="string"){r=0,i=jQuery(this),s=e.match(rnotwhite)||[];while(t=s[r++])i.hasClass(t)?i.removeClass(t):i.addClass(t)}else if(e===undefined||n==="boolean")t=getClass(this),t&&dataPriv.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":dataPriv.get(this,"__className__")||"")})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(n.nodeType===1&&(" "+getClass(n)+" ").replace(rclass," ").indexOf(t)>-1)return!0;return!1}});var rreturn=/\r/g,rspaces=/[\x20\t\r\n\f]+/g;jQuery.fn.extend({val:function(e){var t,n,r,i=this[0];if(!arguments.length){if(i)return t=jQuery.valHooks[i.type]||jQuery.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,typeof n=="string"?n.replace(rreturn,""):n==null?"":n);return}return r=jQuery.isFunction(e),this.each(function(n){var i;if(this.nodeType!==1)return;r?i=e.call(this,n,jQuery(this).val()):i=e,i==null?i="":typeof i=="number"?i+="":jQuery.isArray(i)&&(i=jQuery.map(i,function(e){return e==null?"":e+""})),t=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!t||!("set"in t)||t.set(this,i,"value")===undefined)this.value=i})}}),jQuery.extend({valHooks:{option:{get:function(e){var t=jQuery.find.attr(e,"value");return t!=null?t:jQuery.trim(jQuery.text(e)).replace(rspaces," ")}},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-1)n=!0}return n||(e.selectedIndex=-1),s}}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={set:function(e,t){if(jQuery.isArray(t))return e.checked=jQuery.inArray(jQuery(e).val(),t)>-1}},support.checkOn||(jQuery.valHooks[this].get=function(e){return e.getAttribute("value")===null?"on":e.value})});var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/;jQuery.extend(jQuery.event,{trigger:function(e,t,n,r){var i,s,o,u,a,f,l,c=[n||document],h=hasOwn.call(e,"type")?e.type:e,p=hasOwn.call(e,"namespace")?e.namespace.split("."):[];s=o=n=n||document;if(n.nodeType===3||n.nodeType===8)return;if(rfocusMorph.test(h+jQuery.event.triggered))return;h.indexOf(".")>-1&&(p=h.split("."),h=p.shift(),p.sort()),a=h.indexOf(":")<0&&"on"+h,e=e[jQuery.expando]?e:new jQuery.Event(h,typeof e=="object"&&e),e.isTrigger=r?2:3,e.namespace=p.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=undefined,e.target||(e.target=n),t=t==null?[e]:jQuery.makeArray(t,[e]),l=jQuery.event.special[h]||{};if(!r&&l.trigger&&l.trigger.apply(n,t)===!1)return;if(!r&&!l.noBubble&&!jQuery.isWindow(n)){u=l.delegateType||h,rfocusMorph.test(u+h)||(s=s.parentNode);for(;s;s=s.parentNode)c.push(s),o=s;o===(n.ownerDocument||document)&&c.push(o.defaultView||o.parentWindow||window)}i=0;while((s=c[i++])&&!e.isPropagationStopped())e.type=i>1?u:l.bindType||h,f=(dataPriv.get(s,"events")||{})[e.type]&&dataPriv.get(s,"handle"),f&&f.apply(s,t),f=a&&s[a],f&&f.apply&&acceptData(s)&&(e.result=f.apply(s,t),e.result===!1&&e.preventDefault());return e.type=h,!r&&!e.isDefaultPrevented()&&(!l._default||l._default.apply(c.pop(),t)===!1)&&acceptData(n)&&a&&jQuery.isFunction(n[h])&&!jQuery.isWindow(n)&&(o=n[a],o&&(n[a]=null),jQuery.event.triggered=h,n[h](),jQuery.event.triggered=undefined,o&&(n[a]=o)),e.result},simulate:function(e,t,n){var r=jQuery.extend(new jQuery.Event,n,{type:e,isSimulated:!0});jQuery.event.trigger(r,null,t),r.isDefaultPrevented()&&n.preventDefault()}}),jQuery.fn.extend({trigger:function(e,t){return this.each(function(){jQuery.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return jQuery.event.trigger(e,t,n,!0)}}),jQuery.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){jQuery.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),jQuery.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),support.focusin="onfocusin"in window,support.focusin||jQuery.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){jQuery.event.simulate(t,e.target,jQuery.event.fix(e))};jQuery.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=dataPriv.access(r,t);i||r.addEventListener(e,n,!0),dataPriv.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=dataPriv.access(r,t)-1;i?dataPriv.access(r,t,i):(r.removeEventListener(e,n,!0),dataPriv.remove(r,t))}}});var location=window.location,nonce=jQuery.now(),rquery=/\?/;jQuery.parseJSON=function(e){return JSON.parse(e+"")},jQuery.parseXML=function(e){var t;if(!e||typeof e!="string")return null;try{t=(new window.DOMParser).parseFromString(e,"text/xml")}catch(n){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&jQuery.error("Invalid XML: "+e),t};var rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/mg,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),originAnchor=document.createElement("a");originAnchor.href=location.href,jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",isLocal:rlocalProtocol.test(location.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ajaxExtend(ajaxExtend(e,jQuery.ajaxSettings),t):ajaxExtend(jQuery.ajaxSettings,e)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(e,t){function S(e,t,s,u){var f,m,g,b,E,S=t;if(y===2)return;y=2,o&&window.clearTimeout(o),n=undefined,i=u||"",w.readyState=e>0?4:0,f=e>=200&&e<300||e===304,s&&(b=ajaxHandleResponses(l,w,s)),b=ajaxConvert(l,b,w,f);if(f)l.ifModified&&(E=w.getResponseHeader("Last-Modified"),E&&(jQuery.lastModified[r]=E),E=w.getResponseHeader("etag"),E&&(jQuery.etag[r]=E)),e===204||l.type==="HEAD"?S="nocontent":e===304?S="notmodified":(S=b.state,m=b.data,g=b.error,f=!g);else{g=S;if(e||!S)S="error",e<0&&(e=0)}w.status=e,w.statusText=(t||S)+"",f?p.resolveWith(c,[m,S,w]):p.rejectWith(c,[w,S,g]),w.statusCode(v),v=undefined,a&&h.trigger(f?"ajaxSuccess":"ajaxError",[w,l,f?m:g]),d.fireWith(c,[w,S]),a&&(h.trigger("ajaxComplete",[w,l]),--jQuery.active||jQuery.event.trigger("ajaxStop"))}typeof e=="object"&&(t=e,e=undefined),t=t||{};var n,r,i,s,o,u,a,f,l=jQuery.ajaxSetup({},t),c=l.context||l,h=l.context&&(c.nodeType||c.jquery)?jQuery(c):jQuery.event,p=jQuery.Deferred(),d=jQuery.Callbacks("once memory"),v=l.statusCode||{},m={},g={},y=0,b="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(y===2){if(!s){s={};while(t=rheaders.exec(i))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return y===2?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return y||(e=g[n]=g[n]||e,m[e]=t),this},overrideMimeType:function(e){return y||(l.mimeType=e),this},statusCode:function(e){var t;if(e)if(y<2)for(t in e)v[t]=[v[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),S(0,t),this}};p.promise(w).complete=d.add,w.success=w.done,w.error=w.fail,l.url=((e||l.url||location.href)+"").replace(rhash,"").replace(rprotocol,location.protocol+"//"),l.type=t.method||t.type||l.method||l.type,l.dataTypes=jQuery.trim(l.dataType||"*").toLowerCase().match(rnotwhite)||[""];if(l.crossDomain==null){u=document.createElement("a");try{u.href=l.url,u.href=u.href,l.crossDomain=originAnchor.protocol+"//"+originAnchor.host!=u.protocol+"//"+u.host}catch(E){l.crossDomain=!0}}l.data&&l.processData&&typeof l.data!="string"&&(l.data=jQuery.param(l.data,l.traditional)),inspectPrefiltersOrTransports(prefilters,l,t,w);if(y===2)return w;a=jQuery.event&&l.global,a&&jQuery.active++===0&&jQuery.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!rnoContent.test(l.type),r=l.url,l.hasContent||(l.data&&(r=l.url+=(rquery.test(r)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=rts.test(r)?r.replace(rts,"$1_="+nonce++):r+(rquery.test(r)?"&":"?")+"_="+nonce++)),l.ifModified&&(jQuery.lastModified[r]&&w.setRequestHeader("If-Modified-Since",jQuery.lastModified[r]),jQuery.etag[r]&&w.setRequestHeader("If-None-Match",jQuery.etag[r])),(l.data&&l.hasContent&&l.contentType!==!1||t.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):l.accepts["*"]);for(f in l.headers)w.setRequestHeader(f,l.headers[f]);if(!l.beforeSend||l.beforeSend.call(c,w,l)!==!1&&y!==2){b="abort";for(f in{success:1,error:1,complete:1})w[f](l[f]);n=inspectPrefiltersOrTransports(transports,l,t,w);if(!n)S(-1,"No Transport");else{w.readyState=1,a&&h.trigger("ajaxSend",[w,l]);if(y===2)return w;l.async&&l.timeout>0&&(o=window.setTimeout(function(){w.abort("timeout")},l.timeout));try{y=1,n.send(m,S)}catch(E){if(!(y<2))throw E;S(-1,E)}}return w}return w.abort()},getJSON:function(e,t,n){return jQuery.get(e,t,n,"json")},getScript:function(e,t){return jQuery.get(e,undefined,t,"script")}}),jQuery.each(["get","post"],function(e,t){jQuery[t]=function(e,n,r,i){return jQuery.isFunction(n)&&(i=i||r,r=n,n=undefined),jQuery.ajax(jQuery.extend({url:e,type:t,dataType:i,data:n,success:r},jQuery.isPlainObject(e)&&e))}}),jQuery._evalUrl=function(e){return jQuery.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},jQuery.fn.extend({wrapAll:function(e){var t;return jQuery.isFunction(e)?this.each(function(t){jQuery(this).wrapAll(e.call(this,t))}):(this[0]&&(t=jQuery(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return jQuery.isFunction(e)?this.each(function(t){jQuery(this).wrapInner(e.call(this,t))}):this.each(function(){var t=jQuery(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=jQuery.isFunction(e);return this.each(function(n){jQuery(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()}}),jQuery.expr.filters.hidden=function(e){return!jQuery.expr.filters.visible(e)},jQuery.expr.filters.visible=function(e){return e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0};var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.param=function(e,t){var n,r=[],i=function(e,t){t=jQuery.isFunction(t)?t():t==null?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};t===undefined&&(t=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional);if(jQuery.isArray(e)||e.jquery&&!jQuery.isPlainObject(e))jQuery.each(e,function(){i(this.name,this.value)});else for(n in e)buildParams(n,e[n],t,i);return r.join("&").replace(r20,"+")},jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=jQuery.prop(this,"elements");return e?jQuery.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(e)&&(this.checked||!rcheckableType.test(e))}).map(function(e,t){var n=jQuery(this).val();return n==null?null:jQuery.isArray(n)?jQuery.map(n,function(e){return{name:t.name,value:e.replace(rCRLF,"\r\n")}}):{name:t.name,value:n.replace(rCRLF,"\r\n")}}).get()}}),jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest}catch(e){}};var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,support.ajax=xhrSupported=!!xhrSupported,jQuery.ajaxTransport(function(e){var t,n;if(support.cors||xhrSupported&&!e.crossDomain)return{send:function(r,i){var s,o=e.xhr();o.open(e.type,e.url,e.async,e.username,e.password);if(e.xhrFields)for(s in e.xhrFields)o[s]=e.xhrFields[s];e.mimeType&&o.overrideMimeType&&o.overrideMimeType(e.mimeType),!e.crossDomain&&!r["X-Requested-With"]&&(r["X-Requested-With"]="XMLHttpRequest");for(s in r)o.setRequestHeader(s,r[s]);t=function(e){return function(){t&&(t=n=o.onload=o.onerror=o.onabort=o.onreadystatechange=null,e==="abort"?o.abort():e==="error"?typeof o.status!="number"?i(0,"error"):i(o.status,o.statusText):i(xhrSuccessStatus[o.status]||o.status,o.statusText,(o.responseType||"text")!=="text"||typeof o.responseText!="string"?{binary:o.response}:{text:o.responseText},o.getAllResponseHeaders()))}},o.onload=t(),n=o.onerror=t("error"),o.onabort!==undefined?o.onabort=n:o.onreadystatechange=function(){o.readyState===4&&window.setTimeout(function(){t&&n()})},t=t("abort");try{o.send(e.hasContent&&e.data||null)}catch(u){if(t)throw u}},abort:function(){t&&t()}}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return jQuery.globalEval(e),e}}}),jQuery.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),jQuery.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=jQuery("")},trackEvent:function(t,n,r){if(typeof t!="undefined"&&Object.prototype.toString.apply(t)!=="[object String]")throw"Analytics: invalid action type.";if(typeof n!="undefined"&&Object.prototype.toString.apply(n)!=="[object String]")throw"Analytics: invalid label type.";if(typeof r!="undefined"&&(Object.prototype.toString.apply(r)!=="[object Number]"||!isFinite(r)))throw"Analytics: invalid value type.";if(typeof _gaq=="undefined")return;if(e==="undefined")throw"Analytics is not initialized.";_gaq.push(["_trackEvent",e,t,n,r])}}},define("analytics",["jquery"],function(){});if(Common===undefined)var Common={};Common.Gateway=new function(){var e=this,t=$(e),n={init:function(e){t.trigger("init",e)},openDocument:function(e){t.trigger("opendocument",e)},showMessage:function(e){t.trigger("showmessage",e)},applyEditRights:function(e){t.trigger("applyeditrights",e)},processSaveResult:function(e){t.trigger("processsaveresult",e)},processRightsChange:function(e){t.trigger("processrightschange",e)},refreshHistory:function(e){t.trigger("refreshhistory",e)},setHistoryData:function(e){t.trigger("sethistorydata",e)},setEmailAddresses:function(e){t.trigger("setemailaddresses",e)},processMailMerge:function(e){t.trigger("processmailmerge",e)},downloadAs:function(){t.trigger("downloadas")},processMouse:function(e){t.trigger("processmouse",e)},internalCommand:function(e){t.trigger("internalcommand",e)},resetFocus:function(e){t.trigger("resetfocus",e)}},r=function(e){window.parent&&window.JSON&&(e.frameEditorId=window.frameEditorId,window.parent.postMessage(window.JSON.stringify(e),"*"))},i=function(e){var t=e.data;if(Object.prototype.toString.apply(t)!=="[object String]"||!window.JSON)return;var r,i;try{r=window.JSON.parse(t)}catch(s){r=""}r&&(i=n[r.command],i&&i.call(this,r.data))},s=function(e){i(e)};return window.attachEvent?window.attachEvent("onmessage",s):window.addEventListener("message",s,!1),{ready:function(){r({event:"onReady"})},requestEditRights:function(){r({event:"onRequestEditRights"})},requestHistory:function(){r({event:"onRequestHistory"})},requestHistoryData:function(e){r({event:"onRequestHistoryData",data:e})},requestRestore:function(e,t){r({event:"onRequestRestore",data:{version:e,url:t}})},requestEmailAddresses:function(){r({event:"onRequestEmailAddresses"})},requestStartMailMerge:function(){r({event:"onRequestStartMailMerge"})},requestHistoryClose:function(e){r({event:"onRequestHistoryClose"})},reportError:function(e,t){r({event:"onError",data:{errorCode:e,errorDescription:t}})},sendInfo:function(e){r({event:"onInfo",data:e})},setDocumentModified:function(e){r({event:"onDocumentStateChange",data:e})},internalMessage:function(e,t){r({event:"onInternalMessage",data:{type:e,data:t}})},updateVersion:function(){r({event:"onOutdatedVersion"})},downloadAs:function(e){r({event:"onDownloadAs",data:e})},collaborativeChanges:function(){r({event:"onCollaborativeChanges"})},requestRename:function(e){r({event:"onRequestRename",data:e})},metaChange:function(e){r({event:"onMetaChange",data:e})},on:function(n,r){var i=function(t,n){r.call(e,n)};t.on(n,i)}}},define("gateway",["jquery"],function(){});if(Common===undefined)var Common={};Common.Locale=new function(){var l10n={},_createXMLHTTPObject=function(){var e;try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(n){e=!1}}return!e&&typeof XMLHttpRequest!="undefined"&&(e=new XMLHttpRequest),e},_applyLocalization=function(){try{for(var e in l10n){var t=e.split(".");if(t&&t.length>2){var n=window;for(var r=0;r/im,a=/]*>\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.10",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.indexOf("."),o=e.indexOf("./")===0||e.indexOf("../")===0;return s!==-1&&(!o||s>1)?(t=e.substring(0,s),n=e.substring(s+1,e.length)):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.isBuild&&!i.inlineText){r();return}d.isBuild=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"])n=require.nodeRequire("fs"),t.get=function(e,t,r){try{var i=n.readFileSync(e,"utf8");i.indexOf("")===0&&(i=i.substring(1)),t(i)}catch(s){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,i>399&&i<600?(o=new Error(e+" HTTP status: "+i),o.xhr=s,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("text!common/main/lib/template/Header.template",[],function(){return'
\n \n
<%= headerCaption %>
\n
<%= documentCaption %>
\n
<%= textBack %>
\n
'});if(Common===undefined)var Common={};define("common/main/lib/component/BaseView",["backbone"],function(e){"use strict";Common.UI=_.extend(Common.UI||{},{Keys:{BACKSPACE:8,TAB:9,RETURN:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46,HOME:36,END:35,SPACE:32,PAGEUP:33,PAGEDOWN:34,INSERT:45,NUM_PLUS:107,NUM_MINUS:109,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,EQUALITY:187,MINUS:189},BaseView:e.View.extend({isSuspendEvents:!1,initialize:function(e){this.options=this.options?_({}).extend(this.options,e):e},setVisible:function(e){return this[e?"show":"hide"]()},isVisible:function(){return $(this.el).is(":visible")},suspendEvents:function(){this.isSuspendEvents=!0},resumeEvents:function(){this.isSuspendEvents=!1}}),getId:function(e){return _.uniqueId(e||"asc-gen")}})});if(Common===undefined)var Common={};define("common/main/lib/component/Window",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.Window=Common.UI.BaseView.extend(_.extend(function(){function n(){var e=$(".modals-mask");return e.length==0&&(e=$("
").appendTo(document.body).hide(),e.attr("counter",0)),e}function r(e){if(!this.isLocked()&&this.isVisible()&&this.initConfig.enableKeyEvents)switch(e.keyCode){case Common.UI.Keys.ESC:if($(".asc-loadmask").length<1)return e.preventDefault(),e.stopPropagation(),this.initConfig.closable!==!1&&(this.initConfig.toolclose=="hide"?this.hide():this.close()),!1;break;case Common.UI.Keys.RETURN:if(this.$window.find(".btn.primary").length&&$(".asc-loadmask").length<1&&(this.initConfig.onprimary||this.onPrimary).call(this)===!1)return e.preventDefault(),!1}}function i(){if(window.innerHeight==undefined)var e=document.documentElement.offsetWidth,t=document.documentElement.offsetHeight;else e=Common.Utils.innerWidth(),t=Common.Utils.innerHeight();if(this.initConfig.height=="auto"){var n=parseInt(this.$window.find(".body").css("height"));this.initConfig.header&&(n+=parseInt(this.$window.find(".header").css("height")))}else n=this.initConfig.height;var r=this.initConfig.width=="auto"?parseInt(this.$window.find(".body").css("width")):this.initConfig.width,i=Math.floor((parseInt(t)-parseInt(n))/2*.9),s=Math.floor((parseInt(e)-parseInt(r))/2);this.$window.css("left",s),this.$window.css("top",i)}function s(e){return{"-webkit-transition":"0.3s opacity","-moz-transition":"0.3s opacity","-ms-transition":"0.3s opacity","-o-transition":"0.3s opacity",opacity:e}}function o(e){if($(e.target).hasClass("close"))return;Common.UI.Menu.Manager.hideAll();var t=e instanceof jQuery.Event?Common.Utils.zoom():1;this.dragging.enabled=!0,this.dragging.initx=e.pageX*t-parseInt(this.$window.css("left")),this.dragging.inity=e.pageY*t-parseInt(this.$window.css("top"));if(window.innerHeight==undefined)var n=document.documentElement.offsetWidth,r=document.documentElement.offsetHeight;else n=Common.Utils.innerWidth(),r=Common.Utils.innerHeight();this.dragging.maxx=n-parseInt(this.$window.css("width")),this.dragging.maxy=r-parseInt(this.$window.css("height")),$(document).on("mousemove",this.binding.drag),$(document).on("mouseup",this.binding.dragStop),this.fireEvent("drag",[this,"start"])}function u(){$(document).off("mousemove",this.binding.drag),$(document).off("mouseup",this.binding.dragStop),this.dragging.enabled=!1,this.fireEvent("drag",[this,"end"])}function a(e){if(this.dragging.enabled){var t=e instanceof jQuery.Event?Common.Utils.zoom():1,n=e.pageX*t-this.dragging.initx,r=e.pageY*t-this.dragging.inity;n<0?n=0:n>this.dragging.maxx&&(n=this.dragging.maxx),r<0?r=0:r>this.dragging.maxy&&(r=this.dragging.maxy),this.$window.css({left:n,top:r})}}function f(e){Common.UI.Menu.Manager.hideAll();var t=$(e.target),n=parseInt(this.$window.css("left")),r=parseInt(this.$window.css("top"));this.resizing.enabled=!0,this.resizing.initpage_x=e.pageX*Common.Utils.zoom(),this.resizing.initpage_y=e.pageY*Common.Utils.zoom(),this.resizing.initx=this.resizing.initpage_x-n,this.resizing.inity=this.resizing.initpage_y-r,this.resizing.initw=parseInt(this.$window.css("width")),this.resizing.inith=parseInt(this.$window.css("height")),this.resizing.type=[t.hasClass("left")?-1:t.hasClass("right")?1:0,t.hasClass("top")?-1:t.hasClass("bottom")?1:0];var i=window.innerHeight==undefined?document.documentElement.offsetWidth:Common.Utils.innerWidth(),s=window.innerHeight==undefined?document.documentElement.offsetHeight:Common.Utils.innerHeight(),o=this.initConfig.maxwidth?this.initConfig.maxwidth:i,u=this.initConfig.maxheight?this.initConfig.maxheight:s;this.resizing.type[0]>0?(this.resizing.maxx=Math.min(i,n+o),this.resizing.minx=n+this.initConfig.minwidth):this.resizing.type[0]<0&&(this.resizing.maxx=n+this.resizing.initw-this.initConfig.minwidth,this.resizing.minx=Math.max(0,n+this.resizing.initw-o)),this.resizing.type[1]>0?(this.resizing.maxy=Math.min(s,r+u),this.resizing.miny=r+this.initConfig.minheight):this.resizing.type[1]<0&&(this.resizing.maxy=r+this.resizing.inith-this.initConfig.minheight,this.resizing.miny=Math.max(0,r+this.resizing.inith-u)),$(document.body).css("cursor",t.css("cursor")),this.$window.find(".resize-border").addClass("resizing"),this.$window.find(".header").addClass("resizing"),$(document).on("mousemove",this.binding.resize),$(document).on("mouseup",this.binding.resizeStop),this.fireEvent("resize",[this,"start"])}function l(e){if(this.resizing.enabled){var t=!1,n=e instanceof jQuery.Event?Common.Utils.zoom():1,r=e.pageX*n,i=e.pageY*n;this.resizing.type[0]&&rthis.resizing.minx&&(this.resizing.type[0]<0&&this.$window.css({left:r-this.resizing.initx}),this.setWidth(this.resizing.initw+(r-this.resizing.initpage_x)*this.resizing.type[0]),t=!0),this.resizing.type[1]&&ithis.resizing.miny&&(this.resizing.type[1]<0&&this.$window.css({top:i-this.resizing.inity}),this.setHeight(this.resizing.inith+(i-this.resizing.initpage_y)*this.resizing.type[1]),t=!0),t&&this.fireEvent("resizing")}}function c(){$(document).off("mousemove",this.binding.resize),$(document).off("mouseup",this.binding.resizeStop),$(document.body).css("cursor","auto"),this.$window.find(".resize-border").removeClass("resizing"),this.$window.find(".header").removeClass("resizing"),this.resizing.enabled=!1,this.fireEvent("resize",[this,"end"])}var e={closable:!0,header:!0,modal:!0,width:"auto",height:"auto",title:"Title",alias:"Window",cls:"",toolclose:"close",maxwidth:undefined,maxheight:undefined,minwidth:0,minheight:0,enableKeyEvents:!0},t='
<%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;"><% if (header==true) { %>
<% if (closable!==false) %>
<% %><%= title %>
<% } %>
<%= tpl %>
';return Common.UI.alert=function(e){function u(t){var n=t.getChild(".info-box"),r=t.getChild(".info-box span"),i=t.getChild(".footer"),s=t.getChild(".header"),o=t.getChild(".body"),u=t.getChild(".icon"),a=t.getChild(".info-box .dont-show-checkbox");e.dontshow||o.css("padding-bottom","10px"),e.maxwidth&&e.width=="auto"&&r.position().left+r.width()+parseInt(n.css("padding-right"))>e.maxwidth&&(e.width=e.maxwidth),e.width=="auto"?(n.height(Math.max(r.height()+(a.length>0?a.height()+parseInt(a.css("margin-top")):0),u.height())),o.height(parseInt(n.css("height"))+parseInt(i.css("height"))),t.setSize(r.position().left+r.width()+parseInt(n.css("padding-right")),parseInt(o.css("height"))+parseInt(s.css("height")))):(r.css("white-space","normal"),t.setWidth(e.width),n.height(Math.max(r.height()+(a.length>0?a.height()+parseInt(a.css("margin-top")):0),u.height())),o.height(parseInt(n.css("height"))+parseInt(i.css("height"))),t.setHeight(parseInt(o.css("height"))+parseInt(s.css("height")))),r.height() .body").css("height"));this.initConfig.header&&(i+=parseInt(this.$window.find("> .header").css("height"))),this.$window.height(i)}else this.$window.css("height",this.initConfig.height);this.initConfig.resizable&&this.setResizable(this.initConfig.resizable);var s=this;return Common.NotificationCenter.on("window:close",function(){s.$window&&s.isVisible()&&s.close()}),this.fireEvent("render:after",this),this},show:function(e,t){if(this.initConfig.modal){var r=n();if(this.options.animate!==!1){var o=r.css("opacity");r.css("opacity",0),r.attr("counter",parseInt(r.attr("counter"))+1),r.show(),setTimeout(function(){r.css(s(o))},1)}else r.attr("counter",parseInt(r.attr("counter"))+1),r.show();Common.NotificationCenter.trigger("modal:show",this),this.$lastmodal=$(".asc-window.modal:not(.dethrone):visible").first().addClass("dethrone")}this.$window?this.$window.is(":visible")||(this.$window.css({opacity:0}),this.$window.show()):(this.render(),_.isNumber(e)&&_.isNumber(t)?(this.$window.css("left",Math.floor(e)),this.$window.css("top",Math.floor(t))):i.call(this)),$(document).on("keydown."+this.cid,this.binding.keydown);var u=this;setTimeout(function(){u.fireEvent("animate:before",u)},10),this.options.animate!==!1?(this.$window.css({"-webkit-transform":"scale(0.8)","-moz-transform":"scale(0.8)","-ms-transform":"scale(0.8)","-o-transform":"scale(0.8)",opacity:0}),setTimeout(function(){u.$window.css({"-webkit-transition":"0.2s opacity, 0.2s -webkit-transform","-webkit-transform":"scale(1)","-moz-transition":"0.2s opacity, 0.2s -moz-transform","-moz-transform":"scale(1)","-ms-transition":"0.2s opacity, 0.2s -ms-transform","-ms-transform":"scale(1)","-o-transition":"0.2s opacity, 0.2s -o-transform","-o-transform":"scale(1)",opacity:"1"})},1),setTimeout(function(){u.$window.addClass("notransform"),u.fireEvent("show",u)},this.initConfig.modal?1e3:350)):(this.$window.css({opacity:1}),this.$window.addClass("notransform"),this.fireEvent("show",this)),Common.NotificationCenter.trigger("window:show")},close:function(e){$(document).off("keydown."+this.cid),this.initConfig.header&&this.$window.find(".header").off("mousedown",this.binding.dragStart);if(this.initConfig.modal){var t=n(),r=!0;t.attr("counter",parseInt(t.attr("counter"))-1),this.$lastmodal.size()>0&&(this.$lastmodal.removeClass("dethrone"),r=!this.$lastmodal.hasClass("modal")||!this.$lastmodal.is(":visible"));if(r)if(this.options.animate!==!1){var i=t.css("opacity");t.css(s(0)),setTimeout(function(){t.css("opacity",i),parseInt(t.attr("counter"))<1&&(t.hide(),t.attr("counter",0))},300)}else parseInt(t.attr("counter"))<1&&(t.hide(),t.attr("counter",0));Common.NotificationCenter.trigger("modal:close",this)}this.$window.remove(),e!==!0&&this.fireEvent("close",this)},hide:function(){$(document).off("keydown."+this.cid);if(this.$window){if(this.initConfig.modal){var e=n(),t=!0;e.attr("counter",parseInt(e.attr("counter"))-1),this.$lastmodal.size()>0&&(this.$lastmodal.removeClass("dethrone"),t=!this.$lastmodal.hasClass("modal")||!this.$lastmodal.is(":visible"));if(t)if(this.options.animate!==!1){var r=e.css("opacity");e.css(s(0)),setTimeout(function(){e.css("opacity",r),parseInt(e.attr("counter"))<1&&(e.hide(),e.attr("counter",0))},300)}else parseInt(e.attr("counter"))<1&&(e.hide(),e.attr("counter",0));Common.NotificationCenter.trigger("modal:hide",this)}this.$window.hide(),this.$window.removeClass("notransform"),this.fireEvent("hide",this)}},isLocked:function(){return this.$window.hasClass("dethrone")||!this.options.modal&&this.$window.parent().find(".asc-window.modal:visible").length},getChild:function(e){return e?this.$window.find(e):this.$window},setWidth:function(e){if(e>=0){var t=parseInt(this.$window.css("min-width"));e=0){var t=parseInt(this.$window.css("min-height"));e .header").css("height"))),this.$window.find("> .body").css("height",e)}},getHeight:function(){return parseInt(this.$window.css("height"))},setSize:function(e,t){this.setWidth(e),this.setHeight(t)},getSize:function(){return[this.getWidth(),this.getHeight()]},setTitle:function(e){this.$window.find("> .header > .title").text(e)},getTitle:function(){return this.$window.find("> .header > .title").text()},isVisible:function(){return this.$window&&this.$window.is(":visible")},setResizable:function(e,t,n){if(e!==this.resizable){if(e){var r='
'+'
'+'
'+'
'+'
'+'
'+'
'+'
';this.initConfig.header&&(r+='
'),this.$window.append(_.template(r)),this.binding.resize=_.bind(l,this),this.binding.resizeStop=_.bind(c,this),this.binding.resizeStart=_.bind(f,this),t&&t.length>1&&(this.initConfig.minwidth=t[0]),t&&t.length>1&&(this.initConfig.minheight=t[1]),n&&n.length>1&&(this.initConfig.maxwidth=n[0]),n&&n.length>1&&(this.initConfig.maxheight=n[1]),this.$window.find(".resize-border").on("mousedown",this.binding.resizeStart)}else this.$window.find(".resize-border").remove();this.resizable=e}},onPrimary:function(){},cancelButtonText:"Cancel",okButtonText:"OK",yesButtonText:"Yes",noButtonText:"No",closeButtonText:"Close",textWarning:"Warning",textError:"Error",textConfirmation:"Confirmation",textInformation:"Information",textDontShow:"Don't show this message again"}}(),Common.UI.Window||{}))}),define("common/main/lib/view/RenameDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.RenameDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg",filename:""},initialize:function(e){_.extend(this.options,e||{}),this.template=['
','
',"","
",'
',"
",'"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var e=this;e.inputName=new Common.UI.InputField({el:$("#id-dlg-newname"),style:"width: 100%;",validateOnBlur:!1,validation:function(t){return/[\t*\+:\"<>?|\\\\/]/gim.test(t)?e.txtInvalidName+'*+:"<>?|/':!0}});var t=this.getChild();t.find(".btn").on("click",_.bind(this.onBtnClick,this)),e.inputNameEl=t.find("input"),e.inputNameEl.on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var e=this;_.delay(function(){e.inputName.setValue(e.options.filename),e.inputNameEl.focus().select()},100)},onKeyPress:function(e){e.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(e){this._handleInput(e.currentTarget.attributes.result.value)},_handleInput:function(e){if(this.options.handler){if(e=="ok"&&this.inputName.checkValidate()!==!0){this.inputNameEl.focus();return}this.options.handler.call(this,e,this.inputName.getValue())}this.close()},textName:"File name",cancelButtonText:"Cancel",okButtonText:"Ok",txtInvalidName:"The file name cannot contain any of the following characters: "},Common.Views.RenameDialog||{}))});if(Common===undefined)var Common={};Common.Views=Common.Views||{},define("common/main/lib/view/Header",["backbone","text!common/main/lib/template/Header.template","core","common/main/lib/view/RenameDialog"],function(e,t){"use strict";Common.Views.Header=e.View.extend(_.extend({options:{branding:{},headerCaption:"Default Caption",documentCaption:"",canBack:!1},el:"#header",template:_.template(t),events:{"click #header-logo":function(e){var t=!this.branding||!this.branding.logo||!this.branding.logo.url?"http://www.onlyoffice.com":this.branding.logo.url,n=window.open(t);n&&n.focus()}},initialize:function(e){this.options=this.options?_({}).extend(this.options,e):e,this.headerCaption=this.options.headerCaption,this.documentCaption=this.options.documentCaption,this.canBack=this.options.canBack,this.branding=this.options.customization,this.isModified=!1},render:function(){$(this.el).html(this.template({headerCaption:this.headerCaption,documentCaption:Common.Utils.String.htmlEncode(this.documentCaption),canBack:this.canBack,textBack:this.textBack}));var e=(new Common.UI.MenuItem({caption:this.openNewTabText})).on("click",function(e,t){Common.NotificationCenter.trigger("goback",!0),Common.component.Analytics.trackEvent("Back to Folder")});this.gotoDocsMenu=new Common.UI.Menu({style:"min-width: 100px;",items:[e]})},setVisible:function(e){e?this.show():this.hide()},setBranding:function(e){var t;this.branding=e,e&&e.logo&&e.logo.image&&(t=$("#header-logo"),t&&(t.html(''),t.css({"background-image":"none",width:"auto"})))},setHeaderCaption:function(e){this.headerCaption=e;var t=$("#header-caption > div");return t&&t.html(e),e},getHeaderCaption:function(){return this.headerCaption},setDocumentCaption:function(e,t){t!==undefined&&(this.isModified=t),this.documentCaption=e,e||(e=""),this.isModified&&(e+="*");var n=$("#header-documentcaption div");return n&&n.html(Common.Utils.String.htmlEncode(e)),e},getDocumentCaption:function(){return this.documentCaption},setCanBack:function(e){this.canBack=e;var t=$("#header-back");t&&(t.off("mouseup"),t.css("display",e?"table-cell":"none"),e&&t.on("mouseup",_.bind(this.onBackClick,this)))},getCanBack:function(){return this.canBack},onBackClick:function(e){if(e.which==3){Common.UI.Menu.Manager.hideAll();var t=this,n=[e.pageX*Common.Utils.zoom(),e.pageY*Common.Utils.zoom()],r=$(this.el).find(Common.Utils.String.format("#menu-container-{0}",this.gotoDocsMenu.id));this.gotoDocsMenu.rendered||(r.length<1&&(r=$(Common.Utils.String.format('',this.gotoDocsMenu.id)),$(this.el).append(r)),this.gotoDocsMenu.render(r),this.gotoDocsMenu.cmpEl.attr({tabindex:"-1"})),_.delay(function(){r.css({left:n[0]-t.gotoDocsMenu.cmpEl.width(),top:n[1]+3}),t.gotoDocsMenu.show()},10)}else Common.NotificationCenter.trigger("goback",e.which==2),Common.component.Analytics.trackEvent("Back to Folder")},setCanRename:function(e){var t=$("#header-documentcaption div");if(e){var n=this;t.tooltip({title:n.txtRename,placement:"cursor"}),t.on("click",function(e){(new Common.Views.RenameDialog({filename:n.documentCaption,handler:function(e,t){e=="ok"&&!_.isEmpty(t.trim())&&n.documentCaption!==t.trim()&&Common.Gateway.requestRename(t),Common.NotificationCenter.trigger("edit:complete",n)}})).show(t.position().left-1,20)})}else{var r=t.data("bs.tooltip");r&&(r.options.title="",r.setContent()),t.off("click")}t.css("cursor",e?"pointer":"default"),t.toggleClass("renamed",e)},textBack:"Go to Documents",openNewTabText:"Open in New Tab",txtRename:"Rename"},Common.Views.Header||{}))}),define("text!documenteditor/main/app/template/Viewport.template",[],function(){return'
\n
\n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n'});if(Common===undefined)var Common={};define("common/main/lib/component/Layout",["backbone"],function(){"use strict";var e=function(e){this.box=null,this.panels=[],this.splitters=[],_.extend(this,e||{})},t=function(){return{width:null,height:null,resize:!1,stretch:!1,rely:!1}};_.extend(e.prototype,Backbone.Events,{initialize:function(e){this.$parent=this.box.parent(),this.resize={eventMove:_.bind(this.resizeMove,this),eventStop:_.bind(this.resizeStop,this)};var n,r,i=!1;e.items.forEach(function(e){e.el instanceof HTMLElement&&(e.el=$(e.el)),n=_.extend(new t,e),n.stretch&&(i=!0,n.rely=!1,n.resize=!1),this.panels.push(n),n.resize&&(r={isresizer:!0,minpos:n.resize.min||0,maxpos:n.resize.max||0,fmin:n.resize.fmin,fmax:n.resize.fmax,behaviour:n.behaviour,index:this.splitters.length},i?(n.resize.el=r.el=n.el.before('
').prev(),this.panels.splice(this.panels.length-1,0,r)):(n.resize.el=r.el=n.el.after('
').next(),this.panels.push(r)),this.splitters.push({resizer:r}),n.resize.hidden&&r.el.hide())},this),this.freeze=e.freeze,this.freeze&&this.freezePanels(this.freeze)},doLayout:function(){},getElementHeight:function(e){return parseInt(e.css("height"))},getElementWidth:function(e){return parseInt(e.css("width"))},onSelectStart:function(e){return e.preventDefault&&e.preventDefault(),!1},addHandler:function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n},removeHandler:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null},clearSelection:function(){if(window.getSelection){var e=window.getSelection();e.empty?e.empty():e.removeAllRanges&&e.removeAllRanges()}else document.selection&&document.selection.empty()},resizeStart:function(e){this.clearSelection(),this.addHandler(window.document,"selectstart",this.onSelectStart),$(document).on({mousemove:this.resize.eventMove,mouseup:this.resize.eventStop}),Common.NotificationCenter.on({"frame:mousemove":this.resize.eventMove,"frame:mouseup":this.resize.eventStop});var t=e.data.panel;this.resize.type=e.data.type,this.resize.$el=t.el,this.resize.min=t.minpos,this.resize.fmin=t.fmin,this.resize.fmax=t.fmax,this.resize.behaviour=t.behaviour,this.resize.$el.addClass("move"),e.data.type=="vertical"?(this.resize.height=parseInt(this.resize.$el.css("height")),this.resize.max=(t.maxpos>0?t.maxpos:this.resize.$el.parent().height()+t.maxpos)-this.resize.height,this.resize.inity=e.pageY*Common.Utils.zoom()-parseInt(e.currentTarget.style.top)):e.data.type=="horizontal"&&(this.resize.width=parseInt(this.resize.$el.css("width")),this.resize.max=(t.maxpos>0?t.maxpos:this.resize.$el.parent().height()+t.maxpos)-this.resize.width,this.resize.initx=e.pageX*Common.Utils.zoom()-parseInt(e.currentTarget.style.left)),Common.NotificationCenter.trigger("layout:resizestart")},resizeMove:function(e){var t=e instanceof jQuery.Event?Common.Utils.zoom():1;if(this.resize.type=="vertical")var n="top",r=e.pageY*t-this.resize.inity;else this.resize.type=="horizontal"&&(n="left",r=e.pageX*t-this.resize.initx);this.resize.fmin&&this.resize.fmax?!(rthis.resize.fmax())&&(this.resize.$el[0].style[n]=r+"px"):!(rthis.resize.max)&&(this.resize.$el[0].style[n]=r+"px")},resizeStop:function(e){this.removeHandler(window.document,"selectstart",this.onSelectStart),$(document).off({mousemove:this.resize.eventMove,mouseup:this.resize.eventStop}),Common.NotificationCenter.off({"frame:mousemove":this.resize.eventMove,"frame:mouseup":this.resize.eventStop});if(!this.resize.$el)return;var t=e instanceof jQuery.Event?Common.Utils.zoom():1;if(this.resize.type=="vertical")var n="height",r=e.pageY*t-this.resize.inity;else this.resize.type=="horizontal"&&(n="width",r=e.pageX*t-this.resize.initx);this.resize.fmin&&this.resize.fmax?(rthis.resize.fmax()&&(r=this.resize.fmax())):(rthis.resize.max&&(r=this.resize.max));var i=null,s=null,o=0;this.resize.$el.hasClass("after")?(i=this.resize.$el.prev(),s=this.resize.$el.next(),o=parseInt(i.css(n))):(i=this.resize.$el.next(),s=this.resize.$el.next(),o=parseInt(i.css(n)),r=i.parent()[n]()-(r+this.resize[n])),this.resize.type=="vertical"&&(r-=i.position().top),this.resize.type=="horizontal"&&(r-=i.position().left),i.css(n,r+"px"),this.resize.behaviour&&s.css(n,parseInt(s.css(n))-(r-o)),this.resize.$el.removeClass("move"),delete this.resize.$el,this.resize.value!=r&&(this.doLayout(),this.trigger("layout:resizedrag",this)),Common.NotificationCenter.trigger("layout:resizestop")},freezePanels:function(e){this.panels.forEach(function(t){!t.stretch&&t.resize&&$(t.resize.el).css("cursor",e?"default":"")}),this.freeze=e},setResizeValue:function(e,t){if(e>=this.splitters.length)return;var n=null,r=null,i=0,s=this.splitters[e].resizer,o="height";ts.fmax()&&(t=s.fmax()),s.el.hasClass("after")?(n=s.el.prev(),r=s.el.next(),i=parseInt(n.css(o))):(n=s.el.next(),t=n.parent()[o]()-(t+s[o]),r=s.el.next(),i=parseInt(n.css(o))),t-=n.position().top,n.css(o,t+"px"),s.behaviour&&r.css(o,parseInt(r.css(o))-(t-i)),s.value!=t&&this.doLayout()}}),!Common.UI&&(Common.UI={}),Common.UI.VBoxLayout=function(t){e.apply(this,arguments),this.initialize.apply(this,arguments)},Common.UI.VBoxLayout.prototype=_.extend(new e,{initialize:function(t){e.prototype.initialize.call(this,t),this.panels.forEach(function(e){!e.stretch&&!e.height&&(e.height=this.getElementHeight(e.el)),e.isresizer&&e.el.on("mousedown",{type:"vertical",panel:e},_.bind(this.resizeStart,this))},this),this.doLayout.call(this)},doLayout:function(){var e=0,t,n;this.panels.forEach(function(r){r.stretch?t=r:(n=r.el.is(":visible"),n&&(e+=r.rely!==!0?r.height:this.getElementHeight(r.el)),r.resize&&r.resize.autohide!==!1&&r.resize.el&&(n?(r.resize.el.show(),t&&(e+=r.resize.height)):(r.resize.el.hide(),t&&(e-=r.resize.height))))},this),t&&(t.height=this.$parent.height()-e),e=0,this.panels.forEach(function(t){t.el.is(":visible")&&(n={top:e},t.rely!==!0&&(n.height=t.height),t.el.css(n),e+=this.getElementHeight(t.el))},this)}}),Common.UI.HBoxLayout=function(t){e.apply(this,arguments),this.initialize.apply(this,arguments)},Common.UI.HBoxLayout.prototype=_.extend(new e,{initialize:function(t){e.prototype.initialize.call(this,t),this.panels.forEach(function(e){!e.stretch&&!e.width&&(e.width=this.getElementWidth(e.el)),e.isresizer&&e.el.on("mousedown",{type:"horizontal",panel:e},_.bind(this.resizeStart,this))},this),this.doLayout.call(this)},doLayout:function(e){var t=0,n,r;this.panels.forEach(function(e){e.stretch?n=e:(r=e.el.is(":visible"),r&&(t+=e.rely!==!0?e.width:this.getElementWidth(e.el)),e.resize&&e.resize.autohide!==!1&&e.resize.el&&(r?(e.resize.el.show(),n&&(t-=e.resize.width)):(e.resize.el.hide(),n&&(t-=e.resize.width))))},this),n&&(n.width=this.$parent.width()-t),t=0,this.panels.forEach(function(e){e.el.is(":visible")&&(r={left:t},e.rely!==!0&&(r.width=e.width),e.el.css(r),t+=this.getElementWidth(e.el))},this)}}),Common.UI.VBoxLayout.prototype.constructor=Common.UI.VBoxLayout,Common.UI.HBoxLayout.prototype.constructor=Common.UI.HBoxLayout}),define("documenteditor/main/app/view/Viewport",["text!documenteditor/main/app/template/Viewport.template","jquery","underscore","backbone","common/main/lib/component/Layout"],function(e,t,n,r){"use strict";DE.Views.Viewport=r.View.extend({el:"#viewport",template:n.template(e),events:{},initialize:function(){},render:function(){var e=t(this.el);e.html(this.template({})),Common.Utils.isSafari?(t("body").addClass("safari"),t("body").mousewheel(function(e){e.preventDefault(),e.stopPropagation()})):Common.Utils.isChrome&&t("body").addClass("chrome");var n=t("#viewport-vbox-layout",e),r=n.find(" > .layout-item");return this.vlayout=new Common.UI.VBoxLayout({box:n,items:[{el:r[0],rely:!0},{el:r[1],rely:!0},{el:r[2],stretch:!0},{el:r[3],height:25}]}),n=t("#viewport-hbox-layout",e),r=n.find(" > .layout-item"),this.hlayout=new Common.UI.HBoxLayout({box:n,items:[{el:r[0],rely:!0,resize:{hidden:!0,autohide:!1,min:300,max:600}},{el:r[3],rely:!0,resize:{hidden:!0,autohide:!1,min:300,max:600}},{el:r[1],stretch:!0},{el:t(r[2]).hide(),rely:!0}]}),this},applyEditorMode:function(){var e=this,t=DE.getController("Toolbar").getView("Toolbar"),n=DE.getController("RightMenu").getView("RightMenu"),r=DE.getController("Statusbar").getView("Statusbar");e._toolbar=t.render(this.mode),e._rightMenu=n.render(this.mode);var i=Common.localStorage.getItem("de-hidden-status");i!==null&&parseInt(i)==1&&r.setVisible(!1)},setMode:function(e){e.isDisconnected?(n.isUndefined(this.mode)&&(this.mode={}),this.mode.canCoAuthoring=!1):this.mode=e}})}),define("text!documenteditor/main/app/template/LeftMenu.template",[],function(){return'
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n