You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.3 MiB
JavaScript

/*
* Copyright (c) Ascensio System SIA 2019. All rights reserved
*
* http://www.onlyoffice.com
*
* Version: 0.0.0 (build:0)
*/
function onDropDownKeyDown(t){var e=$(this),i=e.parent(),n=jQuery.Event("keydown.before.bs.dropdown"),o=jQuery.Event("keydown.after.bs.dropdown");i.trigger(n),i.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(t=arguments[1]),!/^(38|40|27|13|9|37|39)$/.test(t.keyCode)||t.ctrlKey||t.altKey||(patchDropDownKeyDownAdditional.call(this,t),/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()))):(patchDropDownKeyDown.call(this,t),t.preventDefault(),t.stopPropagation()),i.trigger(o)}function patchDropDownKeyDown(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&27==t.keyCode){if(27==t.which){if(o=$("[role=menu] li.dropdown-submenu.over:visible",i),o.length)return o.eq(o.length-1).removeClass("over"),!1;i.hasClass("dropdown-submenu")&&i.hasClass("over")?(i.removeClass("over"),i.find("> a").focus()):i.find("[data-toggle=dropdown]").focus()}return n?e.click():void 0}var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(":focus"));if(39==t.keyCode){if(s<0)return;var a=o.eq(s).parent();a.hasClass("dropdown-submenu")&&!a.hasClass("over")&&(a.mouseenter(),a.addClass("focused-submenu"),_.delay(function(){var t=$("> [role=menu]",a),e=t.find("> li:not(.divider):not(.disabled):visible > a"),i=t.find("> li:not(.divider):not(.disabled):visible .dataview"),n=0;if(t.find("> .menu-scroll").length>0)for(var o=t.scrollTop(),s=0;s<e.length;s++)if(e[s].offsetTop>o){n=s;break}e.length>0&&i.length<1&&e.eq(n).focus()},250))}else 37==t.keyCode?i.hasClass("dropdown-submenu")&&i.hasClass("over")&&(i.removeClass("over"),i.find("> a").focus()):(38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),i.hasClass("dropdown-submenu")&&i.hasClass("over")&&i.addClass("focused-submenu"),o.eq(s).focus())}}}}function patchDropDownKeyDownAdditional(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&(27==t.keyCode||37==t.keyCode||39==t.keyCode))return n?e.click():void 0;var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(".focus"));38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),o.removeClass("focus"),o.eq(s).addClass("focus")}}}}function getParent(t){var e=t.attr("data-target");e||(e=t.attr("href"),e=e&&/#/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i=e&&$(e);return i&&i.length?i:t.parent()}function clearMenus(t){$(".dropdown-toggle").each(function(e){var i=$(this).parent();if(i.hasClass("open")){if("prevent-canvas-click"==i.attr("data-value"))return void i.attr("data-value","");i.trigger(e=$.Event("hide.bs.dropdown")),e.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",t)}})}if(function(){var t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this||{},e=t._,i=Array.prototype,n=Object.prototype,o="undefined"!=typeof Symbol?Symbol.prototype:null,s=i.push,a=i.slice,r=n.toString,l=n.hasOwnProperty,c=Array.isArray,h=Object.keys,d=Object.create,p=function(){},m=function(t){return t instanceof m?t:this instanceof m?void(this._wrapped=t):new m(t)};"undefined"==typeof exports||exports.nodeType?t._=m:("undefined"!=typeof module&&!module.nodeType&&module.exports&&(exports=module.exports=m),exports._=m),m.VERSION="1.8.3";var u,g=function(t,e,i){if(void 0===e)return t;switch(i){case 1:return function(i){return t.call(e,i)};case null:case 3:return function(i,n,o){return t.call(e,i,n,o)};case 4:return function(i,n,o,s){return t.call(e,i,n,o,s)}}return function(){return t.apply(e,arguments)}},f=function(t,e,i){return m.it
;var n,o=0,s=e.toLowerCase().match(Et)||[];if(ut.isFunction(i))for(;n=s[o++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Z(t,e,i,n){function o(r){var l;return s[r]=!0,ut.each(t[r]||[],function(t,r){var c=r(e,i,n);return"string"!=typeof c||a||s[c]?a?!(l=c):void 0:(e.dataTypes.unshift(c),o(c),!1)}),l}var s={},a=t===Re;return o(e.dataTypes[0])||!s["*"]&&o("*")}function J(t,e){var i,n,o=ut.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((o[i]?t:n||(n={}))[i]=e[i]);return n&&ut.extend(!0,t,n),t}function Q(t,e,i){for(var n,o,s,a,r=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(o in r)if(r[o]&&r[o].test(n)){l.unshift(o);break}if(l[0]in i)s=l[0];else{for(o in i){if(!l[0]||t.converters[o+" "+l[0]]){s=o;break}a||(a=o)}s=s||a}if(s)return s!==l[0]&&l.unshift(s),i[s]}function tt(t,e,i,n){var o,s,a,r,l,c={},h=t.dataTypes.slice();if(h[1])for(a in t.converters)c[a.toLowerCase()]=t.converters[a];for(s=h.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=h.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(a=c[l+" "+s]||c["* "+s]))for(o in c)if(r=o.split(" "),r[1]===s&&(a=c[l+" "+r[0]]||c["* "+r[0]])){!0===a?a=c[o]:!0!==c[o]&&(s=r[0],h.unshift(r[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}var et=[],it=t.document,nt=Object.getPrototypeOf,ot=et.slice,st=et.concat,at=et.push,rt=et.indexOf,lt={},ct=lt.toString,ht=lt.hasOwnProperty,dt=ht.toString,pt=dt.call(Object),mt={},ut=function(t,e){return new ut.fn.init(t,e)},gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ft=/^-ms-/,bt=/-([a-z])/g,Ct=function(t,e){return e.toUpperCase()};ut.fn=ut.prototype={jquery:"3.2.1",constructor:ut,length:0,toArray:function(){return ot.call(this)},get:function(t){return null==t?ot.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=ut.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return ut.each(this,t)},map:function(t){return this.pushStack(ut.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(ot.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:at,sort:et.sort,splice:et.splice},ut.extend=ut.fn.extend=function(){var t,e,i,n,o,s,a=arguments[0]||{},r=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[r]||{},r++),"object"==typeof a||ut.isFunction(a)||(a={}),r===l&&(a=this,r--);r<l;r++)if(null!=(t=arguments[r]))for(e in t)i=a[e],n=t[e],a!==n&&(c&&n&&(ut.isPlainObject(n)||(o=Array.isArray(n)))?(o?(o=!1,s=i&&Array.isArray(i)?i:[]):s=i&&ut.isPlainObject(i)?i:{},a[e]=ut.extend(c,s,n)):void 0!==n&&(a[e]=n));return a},ut.extend({expando:"jQuery"+("3.2.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===ut.type(t)},isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){var e=ut.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==ct.call(t))&&(!(e=nt(t))||"function"==typeof(i=ht.call(e,"constructor")&&e.constructor)&&dt.call(i)===pt)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?lt[ct.call(t)]||"object":typeof t},globalEval:function(t){i(t)},camelCase:function(t){return t.replace(ft,"ms-").replace(bt,Ct)},each:function(t,e){var i,o=0;if(n(t))for(i=t.length;o<i&&!1!==e.call(t[o],o,t[o]);o++);else for(o in t)if(!1===e.call(t[o],o,t[o]))break;return t},trim:function(t){return null==t?"":(t+"").replace(gt,"")},makeArray:function(t,e){var i=e||[];return null!=t&&(n(Object(t))?ut.merge(
ut.readyException(t)}),this},ut.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--ut.readyWait:ut.isReady)||(ut.isReady=!0,!0!==t&&--ut.readyWait>0||Dt.resolveWith(it,[ut]))}}),ut.ready.then=Dt.then,"complete"===it.readyState||"loading"!==it.readyState&&!it.documentElement.doScroll?t.setTimeout(ut.ready):(it.addEventListener("DOMContentLoaded",d),t.addEventListener("load",d));var Pt=function(t,e,i,n,o,s,a){var r=0,l=t.length,c=null==i;if("object"===ut.type(i)){o=!0;for(r in i)Pt(t,e,r,i[r],!0,s,a)}else if(void 0!==n&&(o=!0,ut.isFunction(n)||(a=!0),c&&(a?(e.call(t,n),e=null):(c=e,e=function(t,e,i){return c.call(ut(t),i)})),e))for(;r<l;r++)e(t[r],i,a?n:n.call(t[r],r,e(t[r],i)));return o?t:c?e.call(t):l?e(t[0],i):s},Ft=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};p.uid=1,p.prototype={cache:function(t){var e=t[this.expando];return e||(e={},Ft(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,o=this.cache(t);if("string"==typeof e)o[ut.camelCase(e)]=i;else for(n in e)o[ut.camelCase(n)]=e[n];return o},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][ut.camelCase(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){Array.isArray(e)?e=e.map(ut.camelCase):(e=ut.camelCase(e),e=e in n?[e]:e.match(Et)||[]),i=e.length;for(;i--;)delete n[e[i]]}(void 0===e||ut.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!ut.isEmptyObject(e)}};var Ut=new p,Vt=new p,Lt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Bt=/[A-Z]/g;ut.extend({hasData:function(t){return Vt.hasData(t)||Ut.hasData(t)},data:function(t,e,i){return Vt.access(t,e,i)},removeData:function(t,e){Vt.remove(t,e)},_data:function(t,e,i){return Ut.access(t,e,i)},_removeData:function(t,e){Ut.remove(t,e)}}),ut.fn.extend({data:function(t,e){var i,n,o,s=this[0],a=s&&s.attributes;if(void 0===t){if(this.length&&(o=Vt.get(s),1===s.nodeType&&!Ut.get(s,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&(n=a[i].name,0===n.indexOf("data-")&&(n=ut.camelCase(n.slice(5)),u(s,n,o[n])));Ut.set(s,"hasDataAttrs",!0)}return o}return"object"==typeof t?this.each(function(){Vt.set(this,t)}):Pt(this,function(e){var i;if(s&&void 0===e){if(void 0!==(i=Vt.get(s,t)))return i;if(void 0!==(i=u(s,t)))return i}else this.each(function(){Vt.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){Vt.remove(this,t)})}}),ut.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=Ut.get(t,e),i&&(!n||Array.isArray(i)?n=Ut.access(t,e,ut.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=ut.queue(t,e),n=i.length,o=i.shift(),s=ut._queueHooks(t,e),a=function(){ut.dequeue(t,e)};"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===e&&i.unshift("inprogress"),delete s.stop,o.call(t,a,s)),!n&&s&&s.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return Ut.get(t,i)||Ut.access(t,i,{empty:ut.Callbacks("once memory").add(function(){Ut.remove(t,[e+"queue",i])})})}}),ut.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?ut.queue(this[0],t):void 0===e?this:this.each(function(){var i=ut.queue(this,t,e);ut._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&ut.dequeue(this,t)})},dequeue:function(t){return this.each(function(){ut.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,o=ut.Deferred(),s=this,a=this.length,r=function(){--n||o.resolveWith(s,[s])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(i=Ut.get(s[a],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(r));return r(),o.promise(e)}});var Rt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Nt=new RegExp("^(?:([+-])=|)("+Rt+")([a-z%]*)$","i"),Ot=["Top","Right","Bottom","Left"],Ht=function(t,e){return t=e||t,"none"===t.style.display||""===t.sty
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":JSON.parse,"text xml":ut.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?J(J(t,ut.ajaxSettings),e):J(ut.ajaxSettings,t)},ajaxPrefilter:X(Be),ajaxTransport:X(Re),ajax:function(e,i){function n(e,i,n,r){var c,p,m,y,_,x=i;h||(h=!0,l&&t.clearTimeout(l),o=void 0,a=r||"",w.readyState=e>0?4:0,c=e>=200&&e<300||304===e,n&&(y=Q(u,w,n)),y=tt(u,y,w,c),c?(u.ifModified&&(_=w.getResponseHeader("Last-Modified"),_&&(ut.lastModified[s]=_),(_=w.getResponseHeader("etag"))&&(ut.etag[s]=_)),204===e||"HEAD"===u.type?x="nocontent":304===e?x="notmodified":(x=y.state,p=y.data,m=y.error,c=!m)):(m=x,!e&&x||(x="error",e<0&&(e=0))),w.status=e,w.statusText=(i||x)+"",c?b.resolveWith(g,[p,x,w]):b.rejectWith(g,[w,x,m]),w.statusCode(v),v=void 0,d&&f.trigger(c?"ajaxSuccess":"ajaxError",[w,u,c?p:m]),C.fireWith(g,[w,x]),d&&(f.trigger("ajaxComplete",[w,u]),--ut.active||ut.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=void 0),i=i||{};var o,s,a,r,l,c,h,d,p,m,u=ut.ajaxSetup({},i),g=u.context||u,f=u.context&&(g.nodeType||g.jquery)?ut(g):ut.event,b=ut.Deferred(),C=ut.Callbacks("once memory"),v=u.statusCode||{},y={},_={},x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(h){if(!r)for(r={};e=Fe.exec(a);)r[e[1].toLowerCase()]=e[2];e=r[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return h?a:null},setRequestHeader:function(t,e){return null==h&&(t=_[t.toLowerCase()]=_[t.toLowerCase()]||t,y[t]=e),this},overrideMimeType:function(t){return null==h&&(u.mimeType=t),this},statusCode:function(t){var e;if(t)if(h)w.always(t[w.status]);else for(e in t)v[e]=[v[e],t[e]];return this},abort:function(t){var e=t||x;return o&&o.abort(e),n(0,e),this}};if(b.promise(w),u.url=((e||u.url||we.href)+"").replace(Le,we.protocol+"//"),u.type=i.method||i.type||u.method||u.type,u.dataTypes=(u.dataType||"*").toLowerCase().match(Et)||[""],null==u.crossDomain){c=it.createElement("a");try{c.href=u.url,c.href=c.href,u.crossDomain=Oe.protocol+"//"+Oe.host!=c.protocol+"//"+c.host}catch(t){u.crossDomain=!0}}if(u.data&&u.processData&&"string"!=typeof u.data&&(u.data=ut.param(u.data,u.traditional)),Z(Be,u,i,w),h)return w;d=ut.event&&u.global,d&&0==ut.active++&&ut.event.trigger("ajaxStart"),u.type=u.type.toUpperCase(),u.hasContent=!Ve.test(u.type),s=u.url.replace(De,""),u.hasContent?u.data&&u.processData&&0===(u.contentType||"").indexOf("application/x-www-form-urlencoded")&&(u.data=u.data.replace(Me,"+")):(m=u.url.slice(s.length),u.data&&(s+=(Ae.test(s)?"&":"?")+u.data,delete u.data),!1===u.cache&&(s=s.replace(Pe,"$1"),m=(Ae.test(s)?"&":"?")+"_="+Se+++m),u.url=s+m),u.ifModified&&(ut.lastModified[s]&&w.setRequestHeader("If-Modified-Since",ut.lastModified[s]),ut.etag[s]&&w.setRequestHeader("If-None-Match",ut.etag[s])),(u.data&&u.hasContent&&!1!==u.contentType||i.contentType)&&w.setRequestHeader("Content-Type",u.contentType),w.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+("*"!==u.dataTypes[0]?", "+Ne+"; q=0.01":""):u.accepts["*"]);for(p in u.headers)w.setRequestHeader(p,u.headers[p]);if(u.beforeSend&&(!1===u.beforeSend.call(g,w,u)||h))return w.abort();if(x="abort",C.add(u.complete),w.done(u.success),w.fail(u.error),o=Z(Re,u,i,w)){if(w.readyState=1,d&&f.trigger("ajaxSend",[w,u]),h)return w;u.async&&u.timeout>0&&(l=t.setTimeout(function(){w.abort("timeout")},u.timeout));try{h=!1,o.send(y,n)}catch(t){if(h)throw t;n(-1,t)}}else n(-1,"No Transport");return w},getJSON:function(t,e,i){return ut.get(t,e,i,"json")},getScript:function(t,e){return ut.get(t,void 0,e,"script")}}),ut.each(["get","post"],function(t,e){ut[e]=function(t,i,n,o){return ut.isFunction(i)&&(o=o||n,n=i,i=void 0),ut.ajax(ut.extend({url:t,type:e,dataType:o,data:i,success:n},ut.isPlainObject(t)&&t))}}),ut._evalUrl=function(t){return ut.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1
;o||i.data("bs.alert",o=new n(this)),"string"==typeof e&&o[e].call(i)})}var i='[data-dismiss="alert"]',n=function(e){t(e).on("click",i,this.close)};n.VERSION="3.3.7",n.TRANSITION_DURATION=150,n.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var o=t(this),s=o.attr("data-target");s||(s=o.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t("#"===s?[]:s);e&&e.preventDefault(),a.length||(a=o.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(n.TRANSITION_DURATION):i())};var o=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=n,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",i,n.prototype.close)}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),o=n.data("bs.button"),s="object"==typeof e&&e;o||n.data("bs.button",o=new i(this,s)),"toggle"==e?o.toggle():e&&o.setState(e)})}var i=function(e,n){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,n),this.isLoading=!1};i.VERSION="3.3.7",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",n=this.$element,o=n.is("input")?"val":"html",s=n.data();e+="Text",null==s.resetText&&n.data("resetText",n[o]()),setTimeout(t.proxy(function(){n[o](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,n.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,n.removeClass(i).removeAttr(i).prop(i,!1))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var n=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=n,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var n=t(i.target).closest(".btn");e.call(n,"toggle"),t(i.target).is('input[type="radio"], input[type="checkbox"]')||(i.preventDefault(),n.is("input,button")?n.trigger("focus"):n.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),o=n.data("bs.carousel"),s=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;o||n.data("bs.carousel",o=new i(this,s)),"number"==typeof e?o.to(e):a?o[a]():s.interval&&o.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.7",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prot
}),a=t.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(n);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},i.prototype.activate=function(e,n,o){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),o&&o()}var a=n.find("> .active"),r=o&&t.support.transition&&(a.length&&a.hasClass("fade")||!!n.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var n=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=n,this};var o=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',o).on("click.bs.tab.data-api",'[data-toggle="pill"]',o)}(jQuery),function(t){"use strict";function e(e){return this.each(function(){var n=t(this),o=n.data("bs.affix"),s="object"==typeof e&&e;o||n.data("bs.affix",o=new i(this,s)),"string"==typeof e&&o[e]()})}var i=function(e,n){this.options=t.extend({},i.DEFAULTS,n),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.7",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(t,e,i,n){var o=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return o<i&&"top";if("bottom"==this.affixed)return null!=i?!(o+this.unpin<=s.top)&&"bottom":!(o+a<=t-n)&&"bottom";var r=null==this.affixed,l=r?o:s.top,c=r?a:e;return null!=i&&o<=i?"top":null!=n&&l+c>=t-n&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),n=this.options.offset,o=n.top,s=n.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof n&&(s=o=n),"function"==typeof o&&(o=n.top(this.$element)),"function"==typeof s&&(s=n.bottom(this.$element));var r=this.getState(a,e,o,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var n=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=n,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),n=i.data();n.offset=n.offset||{},null!=n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!=n.offsetTop&&(n.offset.top=n.offsetTop),e.call(i,n)})})}(jQuery),define("bootstrap",["jquery"],function(){}),void 0===Common)var Common={};if(define("notification",["backbone"],function(t){"use strict";var e=function(){};if(_.extend(e.prototype,t.Events),void 0!==Common.NotificationCenter)throw"Native Common.NotificationCenter instance already defined.";e.extend=t.Model.extend,Common.NotificationCenter=new e}),function(){var t=function(t,e){for(v
setTimeout(function(){r.$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(){r.$window.addClass("notransform"),r.fireEvent("show",r)},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){if($(document).off("keydown."+this.cid),this.initConfig.header&&this.$window.find(".header").off("mousedown",this.binding.dragStart),this.initConfig.modal){var i=t(),o=!0;if(i.attr("counter",parseInt(i.attr("counter"))-1),this.$lastmodal.length>0&&(this.$lastmodal.removeClass("dethrone"),o=!(this.$lastmodal.hasClass("modal")&&this.$lastmodal.is(":visible"))),o)if(!1!==this.options.animate){var s=i.css("opacity");i.css(n(0)),setTimeout(function(){i.css("opacity",s),parseInt(i.attr("counter"))<1&&(i.hide(),i.attr("counter",0))},300)}else parseInt(i.attr("counter"))<1&&(i.hide(),i.attr("counter",0));Common.NotificationCenter.trigger("modal:close",this)}this.$window.remove(),!0!==e&&this.fireEvent("close",this)},hide:function(){if($(document).off("keydown."+this.cid),this.$window){if(this.initConfig.modal){var e=t(),i=!0;if(e.attr("counter",parseInt(e.attr("counter"))-1),this.$lastmodal.length>0&&(this.$lastmodal.removeClass("dethrone"),i=!(this.$lastmodal.hasClass("modal")&&this.$lastmodal.is(":visible"))),i)if(!1!==this.options.animate){var o=e.css("opacity");e.css(n(0)),setTimeout(function(){e.css("opacity",o),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(t){return t?this.$window.find(t):this.$window},setWidth:function(t){if(t>=0){var e=parseInt(this.$window.css("min-width"));t<e&&(t=e),t-=parseInt(this.$window.css("border-left-width"))+parseInt(this.$window.css("border-right-width")),this.$window.width(t)}},getWidth:function(){return parseInt(this.$window.css("width"))},setHeight:function(t){if(t>=0){var e=parseInt(this.$window.css("min-height"));t<e&&(t=e),t-=parseInt(this.$window.css("border-bottom-width"))+parseInt(this.$window.css("border-top-width")),this.$window.height(t),this.initConfig.header&&(t-=parseInt(this.$window.find("> .header").css("height"))),this.$window.find("> .body").css("height",t)}},getHeight:function(){return parseInt(this.$window.css("height"))},setSize:function(t,e){this.setWidth(t),this.setHeight(e)},getSize:function(){return[this.getWidth(),this.getHeight()]},setTitle:function(t){this.$window.find("> .header > .title").text(t)},getTitle:function(){return this.$window.find("> .header > .title").text()},getLeft:function(){return parseInt(this.$window.css("left"))},getTop:function(){return parseInt(this.$window.css("top"))},isVisible:function(){return this.$window&&this.$window.is(":visible")},setResizable:function(t,e,i){if(t!==this.resizable){if(t){var n='<div class="resize-border left" style="top:'+(this.initConfig.header?"33":"5")+'px; bottom: 5px; height: auto; border-right-style: solid; cursor: e-resize;"></div><div class="resize-border left bottom" style="border-bottom-left-radius: 5px; cursor: sw-resize;"></div><div class="resize-border bottom" style="left: 4px; right: 4px; width: auto; z-index: 2; border-top-style: solid; cursor: s-resize;"></div><div class="resize-border right bottom" style="border-bottom-right-radius: 5px; cursor: se-resize;"></div><div class="resize-border right" style="top:'+(this.initConfig.header?"33":"5")+'px; bottom: 5px; hei
var t=e.toString(16),o=i.toString(16),s=n.toString(16);return 1==t.length&&(t="0"+t),1==o.length&&(o="0"+o),1==s.length&&(s="0"+s),"#"+t+o+s},toHSB:function(){var t={h:0,s:0,b:0},o=Math.min(e,i,n),s=Math.max(e,i,n),a=s-o;return t.b=s,t.s=0!=s?255*a/s:0,0!=t.s?t.h=e==s?0+(i-n)/a:i==s?2+(n-e)/a:4+(e-i)/a:t.h=0,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t.h=parseInt(t.h),t.s=parseInt(t.s),t.b=parseInt(t.b),t}}},Common.Utils.String=new function(){return{format:function(t){var e=_.toArray(arguments).slice(1);return t.replace(/\{(\d+)\}/g,function(t,i){return e[i]})},htmlEncode:function(t){return _.escape(t)},htmlDecode:function(t){return _.unescape(t)},ellipsis:function(t,e,i){if(t&&t.length>e){if(i){var n=t.substr(0,e-2),o=Math.max(n.lastIndexOf(" "),n.lastIndexOf("."),n.lastIndexOf("!"),n.lastIndexOf("?"));if(-1!==o&&o>=e-15)return n.substr(0,o)+"..."}return t.substr(0,e-3)+"..."}return t},platformKey:function(t,e,i){return _.isEmpty(e)&&(e=" ({0})"),Common.Utils.isMac?(_.isFunction(i)&&(t=i.call(this,t)),Common.Utils.String.format(e,t.replace(/\+(?=\S)/g,"").replace(/Ctrl|ctrl/g,"⌘").replace(/Alt|alt/g,"⌥").replace(/Shift|shift/g,"⇧"))):Common.Utils.String.format(e,t)}}},Common.Utils.isBrowserSupported=function(){return!(0!=Common.Utils.ieVersion&&Common.Utils.ieVersion<9||0!=Common.Utils.safariVersion&&Common.Utils.safariVersion<5||0!=Common.Utils.firefoxVersion&&Common.Utils.firefoxVersion<4||0!=Common.Utils.chromeVersion&&Common.Utils.chromeVersion<7||0!=Common.Utils.operaVersion&&Common.Utils.operaVersion<10.5)},Common.Utils.showBrowserRestriction=function(){var t=window.DE?"Document":window.SSE?"Spreadsheet":window.PE?"Presentation":"that",e=document.createElement("div");e.innerHTML='<div class="app-error-panel"><div class="message-block"><div class="message-inner"><div class="title">Your browser is not supported.</div><div class="text">Sorry, '+t+' Editor is currently only supported in the latest versions of the Chrome, Firefox, Safari or Internet Explorer web browsers.</div></div></div><div class="message-auxiliary"></div></div>',document.body.appendChild(e),$("#loading-mask").hide().remove(),$("#viewport").hide().remove()},Common.Utils.applyCustomization=function(t,e){for(var i in t){var n;if(e[i]&&(n=$(e[i]),n.length)){var o=t[i];!1===o||!1===o.visible?n.hide():(o.text&&n.text(o.text),!1===o.visible&&n.hide())}}},Common.Utils.applyCustomizationPlugins=function(plugins){if(plugins&&!(plugins.length<1)){var _createXMLHTTPObject=function(){var t;try{t=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{t=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){t=!1}}return t||"undefined"==typeof XMLHttpRequest||(t=new XMLHttpRequest),t},_getPluginCode=function(url){if(!url)return"";try{var xhrObj=_createXMLHTTPObject();xhrObj&&url&&(xhrObj.open("GET",url,!1),xhrObj.send(""),200==xhrObj.status&&eval(xhrObj.responseText))}catch(t){}return null};plugins.forEach(function(t){t&&_getPluginCode(t)})}},Common.Utils.fillUserInfo=function(t,e,i){var n=t||{};return!n.id&&(n.id="uid-"+Date.now()),_.isEmpty(n.name)?(_.isEmpty(n.firstname)&&_.isEmpty(n.lastname)&&(n.firstname=i),_.isEmpty(n.firstname)?n.fullname=n.lastname:_.isEmpty(n.lastname)?n.fullname=n.firstname:n.fullname=/^ru/.test(e)?n.lastname+" "+n.firstname:n.firstname+" "+n.lastname):n.fullname=n.name,n},Common.Utils.createXhr=function(){var t;try{t=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{t=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){t=!1}}return t||"undefined"==typeof XMLHttpRequest||(t=new XMLHttpRequest),t},Common.Utils.getConfigJson=function(t){if(t)try{var e=Common.Utils.createXhr();if(e)return e.open("GET",t,!1),e.send(""),JSON.parse(e.responseText)}catch(t){}return null},String.prototype.strongMatch=function(t){if(t&&t instanceof RegExp){var e=this.toString().match(t);return!!(e&&e.length>0&&e[0].length==this.length)}return!1},define("common/main/lib/util/utils",function(){}),void 0===Common)var Common={};if(define("common/main/lib/view/CopyWarningDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.CopyWarningDialog
return this.offset},alignPosition:function(){var t="menu"===this.cmpEl.attr("role")?this.cmpEl:this.cmpEl.find("[role=menu]"),e=this.menuAlignEl||t.parent(),i=this.menuAlign.match(/^([a-z]+)-([a-z]+)/),n=e.offset(),o=Common.Utils.innerWidth(),s=Common.Utils.innerHeight()-10,a=t.outerWidth(),r=t.outerHeight(),l=e.outerWidth(),c=e.outerHeight(),h={tl:[0,0],bl:[0,r],tr:[a,0],br:[a,r]},d={tl:[0,0],tr:[l,0],bl:[0,c],br:[l,c]},p=n.left-h[i[1]][0]+d[i[2]][0]+this.offset[0],m=n.top-h[i[1]][1]+d[i[2]][1]+this.offset[1];p+a>o&&(p=e.is("li.dropdown-submenu")?n.left-a+2:o-a),m+r>s&&(m=s-r),m<0&&(m=0),this.options.additionalAlign?this.options.additionalAlign.call(this,t,p,m):t.css({left:p,top:m})}}),{Manager:function(){return t}()})}()}),define("spreadsheeteditor/main/app/view/DocumentHolder",["jquery","underscore","backbone","gateway","common/main/lib/component/Menu"],function(t,e,i,n){"use strict";SSE.Views.DocumentHolder=i.View.extend(e.extend({el:"#editor_sdk",template:null,events:{},initialize:function(){var t=this;this.setApi=function(e){return t.api=e,t}},render:function(){return this.fireEvent("render:before",this),this.cmpEl=t(this.el),this.fireEvent("render:after",this),this},focus:function(){var t=this;e.defer(function(){t.cmpEl.focus()},50)},createDelayedElementsViewer:function(){var t=this;t.menuViewCopy=new Common.UI.MenuItem({caption:t.txtCopy,value:"copy"}),t.menuViewUndo=new Common.UI.MenuItem({caption:t.textUndo}),t.menuViewCopySeparator=new Common.UI.MenuItem({caption:"--"}),t.menuViewAddComment=new Common.UI.MenuItem({id:"id-context-menu-item-view-add-comment",caption:t.txtAddComment}),this.viewModeMenu=new Common.UI.Menu({items:[t.menuViewCopy,t.menuViewUndo,t.menuViewCopySeparator,t.menuViewAddComment]}),t.fireEvent("createdelayedelements",[t])},createDelayedElements:function(){var i=this;i.pmiCut=new Common.UI.MenuItem({caption:i.txtCut,value:"cut"}),i.pmiCopy=new Common.UI.MenuItem({caption:i.txtCopy,value:"copy"}),i.pmiPaste=new Common.UI.MenuItem({caption:i.txtPaste,value:"paste"}),i.pmiSelectTable=new Common.UI.MenuItem({caption:i.txtSelect,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:this.selectRowText,value:Asc.c_oAscChangeSelectionFormatTable.row},{caption:this.selectColumnText,value:Asc.c_oAscChangeSelectionFormatTable.column},{caption:this.selectDataText,value:Asc.c_oAscChangeSelectionFormatTable.data},{caption:this.selectTableText,value:Asc.c_oAscChangeSelectionFormatTable.all}]})}),i.pmiInsertEntire=new Common.UI.MenuItem({caption:i.txtInsert}),i.pmiInsertCells=new Common.UI.MenuItem({caption:i.txtInsert,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:i.txtShiftRight,value:Asc.c_oAscInsertOptions.InsertCellsAndShiftRight},{caption:i.txtShiftDown,value:Asc.c_oAscInsertOptions.InsertCellsAndShiftDown},{caption:i.txtRow,value:Asc.c_oAscInsertOptions.InsertRows},{caption:i.txtColumn,value:Asc.c_oAscInsertOptions.InsertColumns}]})}),i.pmiInsertTable=new Common.UI.MenuItem({caption:i.txtInsert,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:i.insertRowAboveText,value:Asc.c_oAscInsertOptions.InsertTableRowAbove},{caption:i.insertRowBelowText,value:Asc.c_oAscInsertOptions.InsertTableRowBelow},{caption:i.insertColumnLeftText,value:Asc.c_oAscInsertOptions.InsertTableColLeft},{caption:i.insertColumnRightText,value:Asc.c_oAscInsertOptions.InsertTableColRight}]})}),i.pmiDeleteEntire=new Common.UI.MenuItem({caption:i.txtDelete}),i.pmiDeleteCells=new Common.UI.MenuItem({caption:i.txtDelete,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:i.txtShiftLeft,value:Asc.c_oAscDeleteOptions.DeleteCellsAndShiftLeft},{caption:i.txtShiftUp,value:Asc.c_oAscDeleteOptions.DeleteCellsAndShiftTop},{caption:i.txtRow,value:Asc.c_oAscDeleteOptions.DeleteRows},{caption:i.txtColumn,value:Asc.c_oAscDeleteOptions.DeleteColumns}]})}),i.pmiDeleteTable=new Common.UI.MenuItem({caption:i.txtDelete,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:this.deleteRowText,value:Asc.c_oAscDeleteOptions.DeleteRows},{caption:this.deleteColumnText,value:Asc.c_oAscDeleteOptions.DeleteColumns},{captio
this.editable=e.options.editable||!0,this.disabled=e.options.disabled,this.spellcheck=e.options.spellcheck,this.blankError=e.options.blankError||"This field is required",this.validateOnChange=e.options.validateOnChange,this.validateOnBlur=e.options.validateOnBlur,this.maxLength=e.options.maxLength,e.rendered=e.options.rendered||!1,e.options.el&&e.render()},render:function(t){var e=this;if(e.rendered?this.cmpEl=$(this.el):(this.cmpEl=$(this.template({id:this.id,cls:this.cls,style:this.style,value:this.value,type:this.type,name:this.name,placeHolder:this.placeHolder,spellcheck:this.spellcheck,scope:e})),t?(this.setElement(t,!1),t.html(this.cmpEl)):$(this.el).html(this.cmpEl)),!e.rendered){var i=this.cmpEl;if(this._input=this.cmpEl.find("input").addBack().filter("input"),this.editable&&(this._input.on("blur",_.bind(this.onInputChanged,this)),this._input.on("keypress",_.bind(this.onKeyPress,this)),this._input.on("keyup",_.bind(this.onKeyUp,this)),this.validateOnChange&&this._input.on("input",_.bind(this.onInputChanging,this)),this.maxLength&&this._input.attr("maxlength",this.maxLength)),this.setEditable(this.editable),this.disabled&&this.setDisabled(this.disabled),this._input.closest(".asc-window").length>0)var n=function(){var t=i.find(".input-error").data("bs.tooltip");t&&t.tip().remove(),Common.NotificationCenter.off({"modal:close":n})};Common.NotificationCenter.on({"modal:close":n})}return e.rendered=!0,this},_doChange:function(t,e){if(!e||!e.synthetic){var i=$(t.target).val(),n=this.value;this.trigger("changed:before",this,i,n,t),t.isDefaultPrevented()||(this.value=i,this.validateOnBlur&&this.checkValidate(),this.trigger("changed:after",this,i,n,t))}},onInputChanged:function(t,e){this._doChange(t,e)},onInputChanging:function(t,e){var i=$(t.target).val(),n=this.value;t.isDefaultPrevented()||(this.value=i,this.validateOnBlur&&this.checkValidate(),this.trigger("changing",this,i,n,t))},onKeyPress:function(t){if(this.trigger("keypress:before",this,t),!t.isDefaultPrevented()){if(t.keyCode===Common.UI.Keys.RETURN)this._doChange(t);else if(this.options.maskExp&&!_.isEmpty(this.options.maskExp.source)){var e=String.fromCharCode(t.which);this.options.maskExp.test(e)||t.ctrlKey||t.keyCode===Common.UI.Keys.DELETE||t.keyCode===Common.UI.Keys.BACKSPACE||t.keyCode===Common.UI.Keys.LEFT||t.keyCode===Common.UI.Keys.RIGHT||t.keyCode===Common.UI.Keys.HOME||t.keyCode===Common.UI.Keys.END||t.keyCode===Common.UI.Keys.ESC||t.keyCode===Common.UI.Keys.INSERT||(t.preventDefault(),t.stopPropagation())}this.trigger("keypress:after",this,t)}},onKeyUp:function(t){this.trigger("keyup:before",this,t),t.isDefaultPrevented()||this.trigger("keyup:after",this,t)},setEditable:function(t){var e=this._input;this.editable=t,t&&e?(e.removeAttr("readonly"),e.removeAttr("data-can-copy")):(e.attr("readonly","readonly"),e.attr("data-can-copy",!1))},isEditable:function(){return this.editable},setDisabled:function(t){this.disabled=t,$(this.el).toggleClass("disabled",t),t?this._input.attr("disabled",!0):this._input.removeAttr("disabled")},isDisabled:function(){return this.disabled},setValue:function(t){this.value=t,this.rendered&&this._input.val(t)},getValue:function(){return this.value},focus:function(){this._input.focus()},checkValidate:function(){var t=this,e=[];if(!t.allowBlank&&_.isEmpty(t.value)&&e.push(t.blankError),_.isFunction(t.validation)){var i=t.validation.call(t,t.value);!0!==i&&(e=_.flatten(e.concat(i)))}if(!_.isEmpty(e)){if(t.cmpEl.hasClass("error")){var n=t.cmpEl.find(".input-error").data("bs.tooltip");return n&&(n.options.title=e.join("\n"),n.setContent()),e}t.cmpEl.addClass("error");var o=t.cmpEl.find(".input-error"),s=o.closest(".asc-window"),n=o.data("bs.tooltip");return n&&n.tip().remove(),o.attr("data-toggle","tooltip"),o.removeData("bs.tooltip"),o.tooltip({title:e.join("\n"),placement:"cursor"}),s.length>0&&o.data("bs.tooltip").tip().css("z-index",parseInt(s.css("z-index"))+10),e}return t.cmpEl.removeClass("error"),!0},showError:function(t){var e=this;if(_.isEmpty(t))e.cmpEl.removeClass("error");else{e.cmpEl.addClass("error");var i=e.cmpEl.fi
isDisabled:function(){return this.disabled},onItemCheck:function(t){this.disabled||this.setValue(!0)},setRawValue:function(t){var t=!0===t||"true"===t||"1"===t||1===t;$("input[type=button][name="+this.name+"]").removeClass("checked"),this.$radio.toggleClass("checked",t)},setValue:function(t,e){if(this.rendered){var i=this.$radio.hasClass("checked");this.setRawValue(t),!0!==e&&i!==t&&this.trigger("change",this,this.$radio.hasClass("checked"))}else this.options.checked=t},getValue:function(){return this.$radio.hasClass("checked")}})}),void 0===Common)var Common={};if(define("common/main/lib/component/DataView",["common/main/lib/component/BaseView","common/main/lib/component/Scroller"],function(){"use strict";Common.UI.DataViewGroupModel=Backbone.Model.extend({defaults:function(){return{id:Common.UI.getId(),caption:"",inline:!1,headername:void 0}}}),Common.UI.DataViewGroupStore=Backbone.Collection.extend({model:Common.UI.DataViewGroupModel}),Common.UI.DataViewModel=Backbone.Model.extend({defaults:function(){return{id:Common.UI.getId(),selected:!1,allowSelected:!0,value:null,disabled:!1}}}),Common.UI.DataViewStore=Backbone.Collection.extend({model:Common.UI.DataViewModel}),Common.UI.DataViewItem=Common.UI.BaseView.extend({options:{},template:_.template(['<div id="<%= id %>"><%= value %></div>'].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;e.template=e.options.template||e.template,e.listenTo(e.model,"change",e.render),e.listenTo(e.model,"change:selected",e.onSelectChange),e.listenTo(e.model,"remove",e.remove)},render:function(){if(_.isUndefined(this.model.id))return this;var t=$(this.el);return t.html(this.template(this.model.toJSON())),t.addClass("item"),t.toggleClass("selected",this.model.get("selected")&&this.model.get("allowSelected")),t.off("click").on("click",_.bind(this.onClick,this)),t.off("dblclick").on("dblclick",_.bind(this.onDblClick,this)),t.off("contextmenu").on("contextmenu",_.bind(this.onContextMenu,this)),t.toggleClass("disabled",this.model.get("disabled")),_.isUndefined(this.model.get("cls"))||t.addClass(this.model.get("cls")),this.trigger("change",this,this.model),this},remove:function(){this.stopListening(this.model),this.trigger("remove",this,this.model),Common.UI.BaseView.prototype.remove.call(this)},onClick:function(t){if(this.model.get("disabled"))return!1;this.trigger("click",this,this.model,t)},onDblClick:function(t){if(this.model.get("disabled"))return!1;this.trigger("dblclick",this,this.model,t)},onContextMenu:function(t){this.trigger("contextmenu",this,this.model,t)},onSelectChange:function(t,e){this.trigger("select",this,t,e)}}),Common.UI.DataView=Common.UI.BaseView.extend({options:{multiSelect:!1,handleSelect:!0,enableKeyEvents:!0,keyMoveDirection:"both",restoreHeight:0,emptyText:"",listenStoreEvents:!0,allowScrollbar:!0,showLast:!0,useBSKeydown:!1},template:_.template(['<div class="dataview inner" style="<%= style %>">',"<% _.each(groups, function(group) { %>","<% if (group.headername !== undefined) { %>",'<div class="header-name"><%= group.headername %></div>',"<% } %>",'<div class="grouped-data <% if (group.inline) { %> inline <% } %> <% if (!_.isEmpty(group.caption)) { %> margin <% } %>" id="<%= group.id %>">',"<% if (!_.isEmpty(group.caption)) { %>",'<div class="group-description">',"<span><%= group.caption %></span>","</div>","<% } %>",'<div class="group-items-container">',"</div>","</div>","<% }); %>","</div>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;e.template=e.options.template||e.template,e.store=e.options.store||new Common.UI.DataViewStore,e.groups=e.options.groups||null,e.itemTemplate=e.options.itemTemplate||null,e.multiSelect=e.options.multiSelect,e.handleSelect=e.options.handleSelect,e.parentMenu=e.options.parentMenu,e.enableKeyEvents=e.options.enableKeyEvents,e.useBSKeydown=e.options.useBSKeydown,e.showLast=e.options.showLast,e.style=e.options.style||"",e.emptyText=e.options.emptyText||"",e.listenStoreEvents=void 0===e.options.listenStoreEvents||e.options.listenStoreEvents
return'<div id="id-adv-image-alttext" class="settings-panel active">\n <div class="inner-content">\n <table cols="1" width="100%">\n <tr>\n <td class="padding-large">\n <label class="header"><%= scope.textAltTitle %></label>\n <div id="image-advanced-alt-title"></div>\n </td>\n </tr>\n <tr>\n <td>\n <label class="header"><%= scope.textAltDescription %></label>\n <textarea id="image-advanced-alt-description" class="form-control" style="width: 100%; height: 70px;"></textarea>\n </td>\n </tr>\n <tr>\n <td>\n <label><%= scope.textAltTip %></label>\n </td>\n </tr>\n </table>\n </div>\n</div>'}),define("spreadsheeteditor/main/app/view/ImageSettingsAdvanced",["text!spreadsheeteditor/main/app/template/ImageSettingsAdvanced.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/InputField"],function(t){"use strict";SSE.Views.ImageSettingsAdvanced=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{contentWidth:300,height:342,toggleGroup:"image-adv-settings-group",properties:null,storageName:"sse-image-settings-adv-category"},initialize:function(e){_.extend(this.options,{title:this.textTitle,items:[{panelId:"id-adv-image-alttext",panelCaption:this.textAlt}],contentTemplate:_.template(t)({scope:this})},e),Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this,this.options),this._originalProps=this.options.imageProps,this._changedProps=null},render:function(){Common.Views.AdvancedSettingsWindow.prototype.render.call(this);var t=this;this.inputAltTitle=new Common.UI.InputField({el:$("#image-advanced-alt-title"),allowBlank:!0,validateOnBlur:!1,style:"width: 100%;"}).on("changed:after",function(){t.isAltTitleChanged=!0}),this.textareaAltDescription=this.$window.find("textarea"),this.textareaAltDescription.keydown(function(e){e.keyCode==Common.UI.Keys.RETURN&&e.stopPropagation(),t.isAltDescChanged=!0}),this.afterRender()},afterRender:function(){if(this._setDefaults(this._originalProps),this.storageName){var t=Common.localStorage.getItem(this.storageName);this.setActiveCategory(null!==t?parseInt(t):0)}},_setDefaults:function(t){if(t){var e=t.asc_getTitle();this.inputAltTitle.setValue(e||""),e=t.asc_getDescription(),this.textareaAltDescription.val(e||""),this._changedProps=new Asc.asc_CImgProperty}},getSettings:function(){return this.isAltTitleChanged&&this._changedProps.asc_putTitle(this.inputAltTitle.getValue()),this.isAltDescChanged&&this._changedProps.asc_putDescription(this.textareaAltDescription.val()),{imageProps:this._changedProps}},textTitle:"Image - Advanced Settings",cancelButtonText:"Cancel",okButtonText:"Ok",textAlt:"Alternative Text",textAltTitle:"Title",textAltDescription:"Description",textAltTip:"The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table."},SSE.Views.ImageSettingsAdvanced||{}))}),define("spreadsheeteditor/main/app/view/SetValueDialog",["common/main/lib/component/Window","common/main/lib/component/ComboBox"],function(){"use strict";SSE.Views.SetValueDialog=Common.UI.Window.extend(_.extend({options:{width:214,header:!0,style:"min-width: 214px;",cls:"modal-dlg"},initialize:function(t){_.extend(this.options,{title:this.textTitle},t||{}),this.template=['<div class="box">','<div class="input-row">','<div id="id-spin-set-value"></div>',"</div>",'<div class="footer center">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template)(this.options),this.startvalue=this.options.startvalue,this.maxvalue=this.options.ma
s=r.length>1?r[1].asc_getOperator()||0:0,i=null===r[0].asc_getVal()?"":r[0].asc_getVal(),n=r.length>1?null===r[1].asc_getVal()?"":r[1].asc_getVal():""}if(-1!==t.value){var l=new Asc.CustomFilters;l.asc_setCustomFilters(-2==t.value?[new Asc.CustomFilter,new Asc.CustomFilter]:[new Asc.CustomFilter]);var c=l.asc_getCustomFilters();l.asc_setAnd(!0),c[0].asc_setOperator(-2==t.value?Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo:t.value),-2==t.value?(c[0].asc_setVal(o==Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo&&s==Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo?i:""),c[1].asc_setOperator(Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo),c[1].asc_setVal(o==Asc.c_oAscCustomAutoFilter.isGreaterThanOrEqualTo&&s==Asc.c_oAscCustomAutoFilter.isLessThanOrEqualTo?n:"")):c[0].asc_setVal(t.value==o?i:""),e.asc_setFilter(l),e.asc_setType(Asc.c_oAscAutoFilterTypes.CustomFilters)}var h=this,d=new SSE.Views.DigitalFilterDialog({api:this.api,type:"number"}).on({close:function(){h.close()}});this.close(),d.setSettings(this.configTo),d.show()},onTextFilterMenuClick:function(t,e){var i=this.configTo.asc_getFilterObj(),n="",o=Asc.c_oAscCustomAutoFilter.equals;if(i.asc_getType()==Asc.c_oAscAutoFilterTypes.CustomFilters){var s=i.asc_getFilter(),a=s.asc_getCustomFilters();s.asc_getAnd(),o=a[0].asc_getOperator(),a.length>1?a[1].asc_getOperator()||0:0,n=null===a[0].asc_getVal()?"":a[0].asc_getVal(),a.length>1?null===a[1].asc_getVal()?"":a[1].asc_getVal():""}if(-1!==e.value){var r=new Asc.CustomFilters;r.asc_setCustomFilters([new Asc.CustomFilter]);var l=r.asc_getCustomFilters();r.asc_setAnd(!0),l[0].asc_setOperator(e.value),l[0].asc_setVal(e.value==o?n:""),i.asc_setFilter(r),i.asc_setType(Asc.c_oAscAutoFilterTypes.CustomFilters)}var c=this,h=new SSE.Views.DigitalFilterDialog({api:this.api,type:"text"}).on({close:function(){c.close()}});this.close(),h.setSettings(this.configTo),h.show()},onNumDynamicFilterItemClick:function(t){var e=this.configTo.asc_getFilterObj();e.asc_getType()!==Asc.c_oAscAutoFilterTypes.DynamicFilter&&(e.asc_setFilter(new Asc.DynamicFilter),e.asc_setType(Asc.c_oAscAutoFilterTypes.DynamicFilter)),e.asc_getFilter().asc_setType(t.value),this.api.asc_applyAutoFilter(this.configTo),this.close()},onTop10FilterItemClick:function(t,e){var i=this,n=new SSE.Views.Top10FilterDialog({api:this.api}).on({close:function(){i.close()}});this.close(),n.setSettings(this.configTo),n.show()},onFilterColorSelect:function(t,e,i){var n=this.configTo.asc_getFilterObj();n.asc_getType()!==Asc.c_oAscAutoFilterTypes.ColorFilter&&(n.asc_setFilter(new Asc.ColorFilter),n.asc_setType(Asc.c_oAscAutoFilterTypes.ColorFilter));var o=n.asc_getFilter();o.asc_setCellColor(!!t&&null),o.asc_setCColor(t&&"transparent"==i||!t&&"#000000"==i?null:Common.Utils.ThemeColor.getRgbColor(i)),this.api.asc_applyAutoFilter(this.configTo),this.close()},onSortColorSelect:function(t,e,i){if(this.api&&this.configTo){var n=t==Asc.c_oAscSortOptions.ByColorFill;this.api.asc_sortColFilter(t,this.configTo.asc_getCellId(),this.configTo.asc_getDisplayName(),n&&"transparent"==i||!n&&"#000000"==i?null:Common.Utils.ThemeColor.getRgbColor(i))}this.close()},onCellCheck:function(t,e,i){if(!this.checkCellTrigerBlock){var n="",o="",s=!1,a=null,r=window.event?window.event:window._event;if(r){if(o=r.target.type,n=$(r.currentTarget).find(".list-item"),n.length){a=n.get(0).getBoundingClientRect();var l=r.clientX*Common.Utils.zoom(),c=r.clientY*Common.Utils.zoom();a.left<l&&l<a.right&&a.top<c&&c<a.bottom&&(s=!0)}("button"===o||s)&&(this.updateCellCheck(t,i),_.delay(function(){t.$el.find(".listview").focus()},100,this))}}},onListKeyDown:function(t,e){var i=this.cellsList;i.disabled||(_.isUndefined(void 0)&&(e=t),e.keyCode==Common.UI.Keys.SPACE?(e.preventDefault(),e.stopPropagation(),this.updateCellCheck(i,i.getSelectedRec()[0])):Common.UI.DataView.prototype.onKeyDown.call(this.cellsList,t,e))},updateCellCheck:function(t,e){if(e&&t){t.isSuspendEvents=!0;var i=!e.get("check"),n=this,o=n.filter?n.filteredIndexes:n.throughIndexes;if("0"==e.get("groupid"))this.cells.each(function(t){"2"!==t.get("groupid")
;case Asc.c_oAscMouseMoveType.LockedObject:n=a;break;case Asc.c_oAscMouseMoveType.ResizeColumn:o=a;break;case Asc.c_oAscMouseMoveType.ResizeRow:s=a}var r=this,l=[0,0],c=r.tooltips.coauth,h=r.tooltips.comment,d=r.tooltips.hyperlink,p=r.tooltips.row_column,m=[r.documentHolder.cmpEl.offset().left-$(window).scrollLeft(),r.documentHolder.cmpEl.offset().top-$(window).scrollTop()];d.isHidden=!1,p.isHidden=!1;if(e){var u=t[e-1],g=u.asc_getHyperlink();if(g.asc_getType()==Asc.c_oAscHyperlinkType.WebLink){var f=g.asc_getTooltip();f=f?Common.Utils.String.htmlEncode(f)+"<br><b>"+r.textCtrlClick+"</b>":g.asc_getHyperlinkUrl()+"<br><b>"+r.textCtrlClick+"</b>"}else f=g.asc_getTooltip()||g.asc_getLocation();d.ref&&d.ref.isVisible()&&d.text!=f&&(d.ref.hide(),d.isHidden=!0),d.ref&&d.ref.isVisible()||(d.text=f,d.ref=new Common.UI.Tooltip({owner:r.documentHolder,html:!0,title:f}).on("tooltip:hide",function(t){d.ref=void 0,d.text=""}),d.ref.show([-1e4,-1e4]),d.isHidden=!1),l=[u.asc_getX(),u.asc_getY()],l[0]+=m[0]+6,l[1]+=m[1]-20,l[1]-=d.ref.getBSTip().$tip.height();var b=d.ref.getBSTip().$tip.width();l[0]+b>r.tooltips.coauth.bodyWidth&&(l[0]=r.tooltips.coauth.bodyWidth-b),d.ref.getBSTip().$tip.css({top:l[1]+"px",left:l[0]+"px"})}else r.hideHyperlinkTip();if(void 0!==o||void 0!==s){var u=t[void 0!==o?o-1:s-1],C=Common.Utils.String.format(void 0!==o?this.textChangeColumnWidth:this.textChangeRowHeight,u.asc_getSizeCCOrPt().toFixed(2),u.asc_getSizePx().toFixed());if(p.ref&&p.ref.isVisible()&&p.text!=C&&(p.text=C,p.ref.setTitle(C),p.ref.updateTitle()),!p.ref||!p.ref.isVisible()){p.text=C,p.ref=new Common.UI.Tooltip({owner:r.documentHolder,html:!0,title:C}).on("tooltip:hide",function(t){p.ref=void 0,p.text=""}),p.ref.show([-1e4,-1e4]),p.isHidden=!1,l=[u.asc_getX(),u.asc_getY()],l[0]+=m[0]+6,l[1]+=m[1]-20-p.ttHeight;var b=p.ref.getBSTip().$tip.width();l[0]+b>r.tooltips.coauth.bodyWidth&&(l[0]=r.tooltips.coauth.bodyWidth-b-20),p.ref.getBSTip().$tip.css({top:l[1]+"px",left:l[0]+"px"})}}else!p.isHidden&&p.ref&&(p.ref.hide(),p.isHidden=!0);if(r.permissions.isEdit||r.permissions.canComments)if(i&&!this.popupmenu){if(u=t[i-1],!h.editCommentId&&h.moveCommentId!=u.asc_getCommentIndexes()[0]){h.moveCommentId=u.asc_getCommentIndexes()[0],h.moveCommentTimer&&clearTimeout(h.moveCommentTimer);var v=u.asc_getCommentIndexes(),y=u.asc_getX(),_=u.asc_getY(),x=u.asc_getReverseX();h.moveCommentTimer=setTimeout(function(){if(h.moveCommentId&&!h.editCommentId){h.viewCommentId=h.moveCommentId;var t=r.getApplication().getController("Common.Controllers.Comments");t&&(t.isSelectedComment||t.onApiShowComment(v,y,_,x,!1,!0))}},400)}}else if(h.moveCommentId=void 0,void 0!=h.viewCommentId){h={};var w=this.getApplication().getController("Common.Controllers.Comments");w&&(this.permissions.canCoAuthoring&&this.permissions.canComments?setTimeout(function(){w.onApiHideComment(!0)},200):w.onApiHideComment(!0))}if(r.permissions.isEdit)if(n){if(u=t[n-1],c.XY||r.onDocumentResize(),c.x_point!=u.asc_getX()||c.y_point!=u.asc_getY()){r.hideCoAuthTips(),c.x_point=u.asc_getX(),c.y_point=u.asc_getY();var S=$(document.createElement("div")),A=u.asc_getLockedObjectType()==Asc.c_oAscMouseMoveLockedObjectType.Sheet||u.asc_getLockedObjectType()==Asc.c_oAscMouseMoveLockedObjectType.TableProperties;c.ref=S,S.addClass("username-tip"),S.css({height:c.ttHeight+"px",position:"absolute",zIndex:"900",visibility:"visible"}),$(document.body).append(S),l=[A?c.x_point+c.rightMenuWidth:c.bodyWidth-(c.x_point+c.XY[0]),c.y_point+c.XY[1]],l[1]>c.XY[1]&&l[1]+c.ttHeight<c.XY[1]+c.apiHeight&&(S.text(function(t){var e=SSE.getCollection("Common.Collections.Users");if(e){var i=e.findUser(t);if(i)return i.get("username")}return r.guestText}(u.asc_getUserId())),c.bodyWidth-l[0]<c.ref.width()?S.css({visibility:"visible",left:"0px",top:l[1]-c.ttHeight+"px"}):S.css({visibility:"visible",right:l[0]+"px",top:l[1]+"px"}))}}else r.hideCoAuthTips()}},onApiHideComment:function(){this.tooltips.comment.viewCommentId=this.tooltips.comment.editCommentId=this.tooltips.comment.moveCommentId=void 0},onApiHyperlinkClick:function(t){if(!t)
callback:"put_ColumnAlign",value:Asc.c_oAscMathInterfaceMatrixColumnAlign.Center}},{caption:e.rightText,checkable:!0,checked:n.get_ColumnAlign()==Asc.c_oAscMathInterfaceMatrixColumnAlign.Right,equationProps:{type:i,callback:"put_ColumnAlign",value:Asc.c_oAscMathInterfaceMatrixColumnAlign.Right}}]})}),o.push(t);break;case Asc.c_oAscMathInterfaceType.EqArray:t=new Common.UI.MenuItem({caption:e.txtInsertEqBefore,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"insert_Equation",value:!0}}),o.push(t),t=new Common.UI.MenuItem({caption:e.txtInsertEqAfter,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"insert_Equation",value:!1}}),o.push(t),t=new Common.UI.MenuItem({caption:e.txtDeleteEq,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"delete_Equation"}}),o.push(t),t=new Common.UI.MenuItem({caption:e.alignmentText,equation:!0,disabled:e._currentParaObjDisabled,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:e.txtTop,checkable:!0,checked:n.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Top,equationProps:{type:i,callback:"put_Align",value:Asc.c_oAscMathInterfaceEqArrayAlign.Top}},{caption:e.centerText,checkable:!0,checked:n.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Center,equationProps:{type:i,callback:"put_Align",value:Asc.c_oAscMathInterfaceEqArrayAlign.Center}},{caption:e.txtBottom,checkable:!0,checked:n.get_Align()==Asc.c_oAscMathInterfaceEqArrayAlign.Bottom,equationProps:{type:i,callback:"put_Align",value:Asc.c_oAscMathInterfaceEqArrayAlign.Bottom}}]})}),o.push(t);break;case Asc.c_oAscMathInterfaceType.LargeOperator:t=new Common.UI.MenuItem({caption:e.txtLimitChange,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"put_LimitLocation",value:n.get_LimitLocation()==Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr?Asc.c_oAscMathInterfaceNaryLimitLocation.SubSup:Asc.c_oAscMathInterfaceNaryLimitLocation.UndOvr}}),o.push(t),void 0!==n.get_HideUpper()&&(t=new Common.UI.MenuItem({caption:n.get_HideUpper()?e.txtShowTopLimit:e.txtHideTopLimit,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"put_HideUpper",value:!n.get_HideUpper()}}),o.push(t)),void 0!==n.get_HideLower()&&(t=new Common.UI.MenuItem({caption:n.get_HideLower()?e.txtShowBottomLimit:e.txtHideBottomLimit,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"put_HideLower",value:!n.get_HideLower()}}),o.push(t));break;case Asc.c_oAscMathInterfaceType.Delimiter:t=new Common.UI.MenuItem({caption:e.txtInsertArgBefore,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"insert_DelimiterArgument",value:!0}}),o.push(t),t=new Common.UI.MenuItem({caption:e.txtInsertArgAfter,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"insert_DelimiterArgument",value:!1}}),o.push(t),n.can_DeleteArgument()&&(t=new Common.UI.MenuItem({caption:e.txtDeleteArg,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"delete_DelimiterArgument"}}),o.push(t)),t=new Common.UI.MenuItem({caption:n.has_Separators()?e.txtDeleteCharsAndSeparators:e.txtDeleteChars,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"remove_DelimiterCharacters"}}),o.push(t),t=new Common.UI.MenuItem({caption:n.get_HideOpeningBracket()?e.txtShowOpenBracket:e.txtHideOpenBracket,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"put_HideOpeningBracket",value:!n.get_HideOpeningBracket()}}),o.push(t),t=new Common.UI.MenuItem({caption:n.get_HideClosingBracket()?e.txtShowCloseBracket:e.txtHideCloseBracket,equation:!0,disabled:e._currentParaObjDisabled,equationProps:{type:i,callback:"put_HideClosingBracket",value:!n.get_HideClosingBracket()}}),o.push(t),t=new Common.UI.MenuItem({caption:e.txtStretchBrackets,equation:!0,disabled:e._currentParaObjDisabled,checkable:!0,checked:n.get_StretchBrackets(),equationProps:{type:i,callback:"put_StretchBrackets",value:!n.get_StretchBrackets()}}),o.push(t),t=new Common.UI.MenuItem({cap
this.editor.$btnexpand.removeClass("btn-collapse")):(this.editor.$el.height(this.editor.keep_height||74),this.editor.$btnexpand.addClass("btn-collapse")),Common.NotificationCenter.trigger("layout:changed","celleditor"),Common.NotificationCenter.trigger("edit:complete",this.editor,{restorefocus:!0})},onInsertFunction:function(){if(this.mode.isEdit&&!this.editor.$btnfunc.hasClass("disabled")){var t=this.getApplication().getController("FormulaDialog");t&&($("#ce-func-label",this.editor.el).blur(),t.showDialog())}},onNamedRangesMenu:function(t,e){var i=this;if("manager"==e.options.value){for(var n=this.api.asc_getWorksheetsCount(),o=-1,s=[],a=[];++o<n;)this.api.asc_isWorksheetHidden(o)||(a[o]=this.api.asc_getWorksheetName(o),s.push({displayValue:a[o],value:o}));new SSE.Views.NameManagerDlg({api:this.api,handler:function(t){Common.NotificationCenter.trigger("edit:complete",this.editor)},locked:this.namedrange_locked,sheets:s,sheetNames:a,ranges:this.api.asc_getDefinedNames(Asc.c_oAscGetDefinedNamesList.All),props:this.api.asc_getDefaultDefinedName(),sort:this.rangeListSort}).on("close",function(t){i.rangeListSort=t.getSettings()}).show()}else this.api.asc_findCell(e.caption),Common.NotificationCenter.trigger("edit:complete",this.editor)},onNameBeforeShow:function(){var t=this.api.asc_getDefinedNames(Asc.c_oAscGetDefinedNamesList.WorksheetWorkbook),e=this.editor.btnNamedRanges.menu,i="";e.removeItems(2,e.items.length-1),t.sort(function(t,e){var i=t.asc_getName().toLowerCase(),n=e.asc_getName().toLowerCase();return i==n?0:i<n?-1:1}),_.each(t,function(t,n){var o=t.asc_getName();i!==o&&e.addItem(new Common.UI.MenuItem({caption:t.asc_getName()})),i=o}),this.editor.btnNamedRanges.menu.items[1].setVisible(e.items.length>2)},onLockDefNameManager:function(t){this.namedrange_locked=t==Asc.c_oAscDefinedNameReason.LockDefNameManager}})}),define("common/main/lib/view/ImageFromUrlDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.ImageFromUrlDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg"},initialize:function(t){_.extend(this.options,t||{}),this.template=['<div class="box">','<div class="input-row">',"<label>"+this.textUrl+"</label>","</div>",'<div id="id-dlg-url" class="input-row"></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].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 t=this;t.inputUrl=new Common.UI.InputField({el:$("#id-dlg-url"),allowBlank:!1,blankError:t.txtEmpty,style:"width: 100%;",validateOnBlur:!1,validation:function(e){return!!/((^https?)|(^ftp)):\/\/.+/i.test(e)||t.txtNotUrl}});var e=this.getChild();e.find(".btn").on("click",_.bind(this.onBtnClick,this)),e.find("input").on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.getChild("input").focus()},500)},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},_handleInput:function(t){if(this.options.handler){if("ok"==t&&!0!==this.inputUrl.checkValidate())return void this.inputUrl.cmpEl.find("input").focus();this.options.handler.call(this,t,this.inputUrl.getValue())}this.close()},textUrl:"Paste an image URL:",cancelButtonText:"Cancel",okButtonText:"Ok",txtEmpty:"This field is required",txtNotUrl:'This field should be a URL in the format "http://www.example.com"'},Common.Views.ImageFromUrlDialog||{}))}),void 0===Common)var Common={};if(define("common/main/lib/util/define",[],function(){"use strict";Common.define={},Common.define.c_oAscMathMainType={Symbol:0,Fraction:1,Script:2,Radical:3,Integral:4,LargeOperator:5,Bracket:6,Function:7,Accent:8,LimitLog:9,
template:_.template(["<% if (menu == null) { %>",'<button type="button" class="btn <%= cls %>" id="<%= id %>" style="<%= style %>">','<span class="caption"><%= caption %></span>','<% if (iconCls != "") { %>','<span class="btn-icon <%= iconCls %>">&nbsp;</span>',"<% } %>","</button>","<% } else if (split == false) {%>",'<div class="btn-group" id="<%= id %>" style="<%= style %>">','<button type="button" class="btn dropdown-toggle <%= cls %>" data-toggle="dropdown">','<span class="caption"><%= caption %></span>','<% if (iconCls != "") { %>','<span class="btn-icon <%= iconCls %>">&nbsp;</span>',"<% } %>",'<span class="caret img-commonctrl"></span>',"</button>","</div>","<% } else { %>",'<div class="btn-group split" id="<%= id %>" style="<%= style %>">','<button type="button" class="btn <%= cls %>">','<span class="caption"><%= caption %></span>','<% if (iconCls != "") { %>','<span class="btn-icon <%= iconCls %>">&nbsp;</span>',"<% } %>","</button>",'<button type="button" class="btn <%= cls %> dropdown-toggle" data-toggle="dropdown">','<span class="caret img-commonctrl"></span>','<span class="sr-only"></span>',"</button>","</div>","<% } %>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;e.id=e.options.id||Common.UI.getId(),e.hint=e.options.hint,e.enableToggle=e.options.enableToggle,e.allowDepress=e.options.allowDepress,e.cls=e.options.cls,e.iconCls=e.options.iconCls,e.menu=e.options.menu,e.split=e.options.split,e.toggleGroup=e.options.toggleGroup,e.disabled=e.options.disabled,e.pressed=e.options.pressed,e.caption=e.options.caption,e.template=e.options.template||e.template,e.style=e.options.style,e.rendered=!1,e.options.el&&e.render()},render:function(t){var e=this;if(e.trigger("render:before",e),e.cmpEl=$(e.el),t&&(e.setElement(t,!1),e.rendered||(e.cmpEl=$(this.template({id:e.id,cls:e.cls,iconCls:e.iconCls,menu:e.menu,split:e.split,disabled:e.disabled,pressed:e.pressed,caption:e.caption,style:e.style})),e.menu&&_.isObject(e.menu)&&_.isFunction(e.menu.render)&&e.menu.render(e.cmpEl),t.html(e.cmpEl))),!e.rendered){var i=e.cmpEl,n=i.hasClass("btn-group"),o=i.hasClass("split");if(e.options.hint){var s=e.cmpEl.closest(".asc-window");e.cmpEl.attr("data-toggle","tooltip"),e.cmpEl.tooltip({title:e.options.hint,placement:e.options.hintAnchor||"cursor"}),s.length>0&&e.cmpEl.data("bs.tooltip").tip().css("z-index",parseInt(s.css("z-index"))+10)}_.isString(e.toggleGroup)&&(e.enableToggle=!0);var a=function(t){if(!e.disabled&&1==t.which){if(e.doToggle(),e.options.hint){var i=e.cmpEl.data("bs.tooltip");i&&(void 0===i.dontShow&&(i.dontShow=!0),i.hide())}e.trigger("click",e,t)}},r=function(t,n){if(!t){var s=!1;_.each($("button",i),function(t){if($(t).is(":hover"))return s=!0,!1}),s||(i.removeClass("over"),$("button",i).removeClass("over"))}if(t||!e.enableToggle||!e.allowDepress||!e.pressed){if(t&&!o&&e.enableToggle&&e.allowDepress&&!e.pressed)return void n.preventDefault();$("button:first",i).toggleClass("active",t),$("[data-toggle^=dropdown]",i).toggleClass("active",t),i.toggleClass("active",t)}},l=function(t){if(!e.disabled&&1==t.which&&o){if(e.options.hint){var n=e.cmpEl.data("bs.tooltip");n&&(void 0===n.dontShow&&(n.dontShow=!0),n.hide())}var s=i.hasClass("open");r(!s,t)}},c=function(t,e){o?r(e,t):(i.toggleClass("active",e),$("button",i).toggleClass("active",e))},h=function(t){r(!0,t),$(document).on("mouseup",d)},d=function(t){r(!1,t),$(document).off("mouseup",d)},p=function(t,i){e.cmpEl.find(".dropdown-toggle").blur(),e.cmpEl.hasClass("active")!==e.pressed&&e.cmpEl.trigger("button.internal.active",[e.pressed])};n?(o&&($("[data-toggle^=dropdown]",i).on("mousedown",_.bind(l,this)),$("button",i).on("mousedown",_.bind(h,this))),i.on("hide.bs.dropdown",_.bind(r,e,!1)),i.on("show.bs.dropdown",_.bind(r,e,!0)),i.on("hidden.bs.dropdown",_.bind(p,e)),$("button:first",i).on("click",a)):i.on("click",a),i.on("button.internal.active",_.bind(c,e)),i.on("mouseover",function(t){e.disabled||(e.cmpEl.addClass("over"),e.trigger("mouseover",e,t))}),i.on("mouseout",function(t){e.disabled||(e.cmpEl.removeClass
template:_.template(['<div class="input-group combobox fonts <%= cls %>" id="<%= id %>" style="<%= style %>">','<input type="text" class="form-control">','<div style="display: table-cell;"></div>','<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret img-commonctrl"></span></button>','<ul class="dropdown-menu <%= menuCls %>" style="<%= menuStyle %>" role="menu">','<li class="divider">',"<% _.each(items, function(item) { %>",'<li id="<%= item.id %>">','<a class="font-item" tabindex="-1" type="menuitem" style="vertical-align:middle; margin: 0 0 0 -10px; height:<%=scope.getListItemHeight()%>px;"/>',"</li>","<% }); %>","</ul>","</div>"].join("")),initialize:function(t){Common.UI.ComboBox.prototype.initialize.call(this,_.extend(t,{displayField:"name",scroller:{wheelSpeed:20,alwaysVisibleY:!0,onChange:this.updateVisibleFontsTiles.bind(this)}})),this.recent=_.isNumber(t.recent)?t.recent:3,Common.NotificationCenter.on("fonts:change",_.bind(this.onApiChangeFont,this)),Common.NotificationCenter.on("fonts:load",_.bind(this.fillFonts,this))},render:function(t){var e=null;return _.isUndefined(this._input)||(e=this._input.val()),Common.UI.ComboBox.prototype.render.call(this,t),this.setRawValue(e),this._input.on("keyup",_.bind(this.onInputKeyUp,this)),this._input.on("keydown",_.bind(this.onInputKeyDown,this)),this},onAfterKeydownMenu:function(t){var e=this;return t.keyCode==Common.UI.Keys.RETURN?($(t.target).closest("input").length?this.lastValue!==this._input.val()&&this._input.trigger("change"):($(t.target).click(),this.rendered&&(Common.Utils.isIE?this._input.trigger("change",{onkeydown:!0}):this._input.blur())),!1):t.keyCode==Common.UI.Keys.ESC&&this.isMenuOpen()?(this._input.val(this.lastValue),setTimeout(function(){e.closeMenu(),e.onAfterHideMenu(t)},10),!1):(t.keyCode!=Common.UI.Keys.HOME&&t.keyCode!=Common.UI.Keys.END&&t.keyCode!=Common.UI.Keys.BACKSPACE||!this.isMenuOpen()||(e._input.focus(),setTimeout(function(){e._input[0].selectionStart=e._input[0].selectionEnd=t.keyCode==Common.UI.Keys.HOME?0:e._input[0].value.length},10)),void this.updateVisibleFontsTiles())},onInputKeyUp:function(t){if(t.keyCode!=Common.UI.Keys.RETURN&&t.keyCode!==Common.UI.Keys.SHIFT&&t.keyCode!==Common.UI.Keys.CTRL&&t.keyCode!==Common.UI.Keys.ALT&&t.keyCode!==Common.UI.Keys.LEFT&&t.keyCode!==Common.UI.Keys.RIGHT&&t.keyCode!==Common.UI.Keys.HOME&&t.keyCode!==Common.UI.Keys.END&&t.keyCode!==Common.UI.Keys.ESC&&t.keyCode!==Common.UI.Keys.INSERT&&t.keyCode!==Common.UI.Keys.TAB&&(t.stopPropagation(),this.selectCandidate(t.keyCode==Common.UI.Keys.DELETE||t.keyCode==Common.UI.Keys.BACKSPACE),this._selectedItem)){var e=this;void 0===e._timerSelection&&(e._timerSelection=setInterval(function(){if(!(new Date-e._inInputKeyDown<100)&&e._selectedItem){clearInterval(e._timerSelection),e._timerSelection=void 0;var t=e._input[0],i=e._selectedItem.get(e.displayField),n=t.value;e.rendered&&(document.selection?document.selection.createRange().text=i:(t.selectionStart||"0"==t.selectionStart)&&(t.value=i,t.selectionStart=n.length,t.selectionEnd=i.length))}},10))}},onInputKeyDown:function(t){this._inInputKeyDown=new Date;var e=this;t.keyCode==Common.UI.Keys.ESC?(this._input.val(this.lastValue),setTimeout(function(){e.closeMenu(),e.onAfterHideMenu(t)},10)):t.keyCode!=Common.UI.Keys.RETURN&&t.keyCode!=Common.UI.Keys.CTRL&&t.keyCode!=Common.UI.Keys.SHIFT&&t.keyCode!=Common.UI.Keys.ALT&&(this.isMenuOpen()||t.ctrlKey||this.openMenu(),t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.DOWN?_.delay(function(){var i=t.keyCode==Common.UI.Keys.DOWN?e.cmpEl.find("ul li.selected").nextAll("li:not(.divider)"):e.cmpEl.find("ul li.selected").prevAll("li:not(.divider)");i=i.length>0?i.eq(0):t.keyCode==Common.UI.Keys.DOWN?e.cmpEl.find("ul li:not(.divider):first"):e.cmpEl.find("ul li:not(.divider):last"),i=i.find("a"),e._skipInputChange=!0,i.focus(),e.updateVisibleFontsTiles()},10):e._skipInputChange=!1)},onInputChanged:function(t,e){if(!e||!e.synthetic){if(this._skipInputChange)return void(this._skipInputChange=!1);if(this._isMouseDow
lock:[o.editCell,o.selChart,o.selChartText,o.selImage,o.selShape,o.cantHyperlink,o.multiselect,o.lostConnect,o.coAuth,o.editPivot]}),n.btnInsertChart=new Common.UI.Button({id:"id-toolbar-btn-insertchart",cls:"btn-toolbar",iconCls:"btn-insertchart",lock:[o.editCell,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.coAuthText],menu:new Common.UI.Menu({style:"width: 435px;",items:[{template:e.template('<div id="id-toolbar-menu-insertchart" class="menu-insertchart" style="margin: 5px 5px 5px 10px;"></div>')}]})}),n.btnEditChart=new Common.UI.Button({id:"id-toolbar-rtn-edit-chart",cls:"btn-toolbar btn-text-value",caption:n.tipEditChart,lock:[o.lostConnect],style:"width: 120px;"}),n.btnInsertShape=new Common.UI.Button({id:"id-toolbar-btn-insertshape",cls:"btn-toolbar",iconCls:"btn-insertshape",enableToggle:!0,lock:[o.editCell,o.selChartText,o.selImage,o.lostConnect,o.coAuth],menu:new Common.UI.Menu({cls:"menu-shapes"})}),n.btnInsertText=new Common.UI.Button({id:"id-toolbar-btn-inserttext",cls:"btn-toolbar",iconCls:"btn-text",lock:[o.editCell,o.selChartText,o.selImage,o.lostConnect,o.coAuth],enableToggle:!0,split:!0,menu:new Common.UI.Menu({items:[{caption:this.textInsText,value:"text"},this.mnuInsertTextArt=new Common.UI.MenuItem({caption:this.textInsTextArt,value:"art",menu:new Common.UI.Menu({menuAlign:"tl-tr",cls:"menu-shapes",items:[{template:e.template('<div id="id-toolbar-menu-insart" style="width: 239px; margin-left: 5px;"></div>')}]})})]})}),this.btnInsertEquation=new Common.UI.Button({id:"id-toolbar-btn-insertequation",cls:"btn-toolbar",iconCls:"btn-insertequation",split:!0,lock:[o.editCell,o.selChartText,o.selImage,o.lostConnect,o.coAuth],menu:new Common.UI.Menu({cls:"menu-shapes"})}),n.btnSortDown=new Common.UI.Button({id:"id-toolbar-btn-sort-down",cls:"btn-toolbar",iconCls:"btn-sort-down",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.ruleFilter,o.editPivot]}),n.btnSortUp=new Common.UI.Button({id:"id-toolbar-btn-sort-up",cls:"btn-toolbar",iconCls:"btn-sort-up",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.ruleFilter,o.editPivot]}),n.btnSetAutofilter=new Common.UI.Button({id:"id-toolbar-btn-setautofilter",cls:"btn-toolbar",iconCls:"btn-autofilter",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.ruleFilter,o.editPivot],enableToggle:!0}),n.btnClearAutofilter=new Common.UI.Button({id:"id-toolbar-btn-clearfilter",cls:"btn-toolbar",iconCls:"btn-clear-filter",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.ruleDelFilter,o.editPivot]}),n.btnSearch=new Common.UI.Button({id:"id-toolbar-btn-search",cls:"btn-toolbar",iconCls:"btn-search",lock:[o.lostConnect]}),n.btnTableTemplate=new Common.UI.Button({id:"id-toolbar-btn-ttempl",cls:"btn-toolbar",iconCls:"btn-ttempl",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.ruleFilter,o.multiselect],menu:new Common.UI.Menu({items:[{template:e.template('<div id="id-toolbar-menu-table-templates" style="width: 288px; height: 300px; margin: 0px 4px;"></div>')}]})}),n.listStyles=new Common.UI.ComboDataView({cls:"combo-styles",enableKeyEvents:!0,itemWidth:112,itemHeight:38,menuMaxHeight:226,lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth],beforeOpenHandler:function(e){var i=this,n=i.openButton.menu;if(n.cmpEl){var o=t(i.cmpEl.find(".dataview.inner .style").get(0)).parent(),s=o.is(":visible")?parseInt(o.css("width")):i.itemWidth+parseInt(o.css("padding-left"))+parseInt(o.css("padding-right"))+parseInt(o.css("border-left-width"))+parseInt(o.css("border-right-width")),a=i.menuPicker.store.length>=6?6:i.menuPicker.store.length,r=Math.min(i.menuPicker.store.length,Math.round(t(".dataview",t(i.fieldPicker.el)).width()/(-1+s)+.5));r=r<a?a:r,n.menuAlignEl=i.cmpEl,n.menuAlign="tl-tl";var l=i.cmpEl.width()-i.openButton.$el.width()-r*(-1+s)-
type:Asc.c_oAscChartTypeSettings.barStackedPer,allowSelected:!0,iconCls:"column-pstack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barNormal3d,allowSelected:!0,iconCls:"column-3d-normal"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStacked3d,allowSelected:!0,iconCls:"column-3d-stack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStackedPer3d,allowSelected:!0,iconCls:"column-3d-pstack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barNormal3dPerspective,allowSelected:!0,iconCls:"column-3d-normal-per"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineNormal,allowSelected:!0,iconCls:"line-normal"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStacked,allowSelected:!0,iconCls:"line-stack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStackedPer,allowSelected:!0,iconCls:"line-pstack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.line3d,allowSelected:!0,iconCls:"line-3d"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie,allowSelected:!0,iconCls:"pie-normal"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.doughnut,allowSelected:!0,iconCls:"pie-doughnut"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie3d,allowSelected:!0,iconCls:"pie-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal,allowSelected:!0,iconCls:"bar-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked,allowSelected:!0,iconCls:"bar-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer,allowSelected:!0,iconCls:"bar-pstack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal3d,allowSelected:!0,iconCls:"bar-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked3d,allowSelected:!0,iconCls:"bar-3d-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer3d,allowSelected:!0,iconCls:"bar-3d-pstack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaNormal,allowSelected:!0,iconCls:"area-normal"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStacked,allowSelected:!0,iconCls:"area-stack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStackedPer,allowSelected:!0,iconCls:"area-pstack"},{group:"menu-chart-group-scatter",type:Asc.c_oAscChartTypeSettings.scatter,allowSelected:!0,iconCls:"point-normal"},{group:"menu-chart-group-stock",type:Asc.c_oAscChartTypeSettings.stock,allowSelected:!0,iconCls:"stock-normal"}]),itemTemplate:e.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')})},setApi:function(t){return this.api=t,this.mode.isEditMailMerge||this.mode.isEditDiagram||(this.api.asc_registerCallback("asc_onCollaborativeChanges",e.bind(this.onApiCollaborativeChanges,this)),this.api.asc_registerCallback("asc_onSendThemeColorSchemes",e.bind(this.onApiSendThemeColorSchemes,this)),this.api.asc_registerCallback("asc_onAuthParticipantsChanged",e.bind(this.onApiUsersChanged,this)),this.api.asc_registerCallback("asc_onParticipantsChanged",e.bind(this.onApiUsersChanged,this))),this},setMode:function(e){if(e.isDisconnected)this.lockToolbar(SSE.enumLock.lostConnect,!0),this.lockToolbar(SSE.enumLock.lostConnect,!0,{array:[this.btnEditChart,this.btnUndo,this.btnRedo,this.btnOpenDocument,this.btnNewDocument,this.btnSave]}),this.lockToolbar(SSE.enumLock.cantPrint,!e.canPrint||e.disableDownload,{array:[this.btnPrint]});else{if(this.mode=e,!e.nativeApp){var i=t(".toolbar-group-native");i&&i.hide()}e.isDesktopApp&&t(".toolbar-group-native").hide(),this.lockToolbar(SSE.enumLock.cantPrint,!e.canPrint,{array:[this.btnPrint]})}},onApiSendThemeColorSchemes:function(i){var n=this;this.mnuColorSchema=this.btnColorSchemas.menu,this.mnuColorSchema&&this.mnuColorSchema.items.length>0&&e.each(this.mnuColorSchema.items,function(t){t.remove()}),null==this.mnuColorSchema&&(this.mnuColorSchema=new Common.UI.Menu({maxHeight:600,re
template:['<div class="box" style="height:'+(e.options.height-85)+'px;">','<div class="content-panel" style="padding: 0 10px;"><div class="inner-content">','<div class="settings-panel active">','<table cols="1" style="width: 100%;">',"<tr>",'<td style="width:170px;padding-bottom: 3px;">','<label class="header">',e.textCategory,"</label>",'<div id="format-settings-combo-format" class="input-group-nr" style="width:264px;"></div>',"</td>","</tr>","<tr>",'<td class="padding-large" style="white-space: nowrap;">','<label style="vertical-align: middle; margin-right: 4px;">'+e.txtSample+"</label>",'<label id="format-settings-label-example" style="vertical-align: middle; max-width: 220px; overflow: hidden; text-overflow: ellipsis;">100</label>',"</td>","</tr>","<tr>",'<td class="padding-small">',"</td>","</tr>",'<tr class="format-decimal">','<td class="padding-large" style="vertical-align: bottom;">','<label class="header">',e.textDecimal,"</label>",'<div id="format-settings-spin-decimal"></div>',"</td>","</tr>",'<tr class="format-separator">','<td class="padding-large">','<div id="format-settings-checkbox-separator"></div>',"</td>","</tr>",'<tr class="format-symbols">','<td class="padding-large">','<label class="header">',e.textSymbols,"</label>",'<div id="format-settings-combo-symbols" class="input-group-nr" style="width:264px;"></div>',"</td>","</tr>",'<tr class="format-decimal">','<td class="padding-large format-negative">','<label class="header">',e.textFormat,"</label>",'<div id="format-settings-combo-negative" class="input-group-nr" style="width:264px;"></div>',"</td>","</tr>",'<tr class="format-type">','<td class="padding-large">','<label class="header">',e.textFormat,"</label>",'<div id="format-settings-combo-type" class="input-group-nr" style="width:264px;"></div>',"</td>","</tr>",'<tr class="format-code">','<td colspan="1" class="padding-large">','<label class="header">',e.textFormat,"</label>",'<div id="format-settings-combo-code" class="input-group-nr" style="width:264px;"></div>',"</td>","</tr>","</table>","</div></div>","</div>","</div>",'<div class="separator horizontal"/>','<div class="footer center">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px; width: 86px;">'+e.textOk+"</button>",'<button class="btn normal dlg-btn" result="cancel" style="width: 86px;">'+e.textCancel+"</button>","</div>"].join("")},t),this.api=t.api,this.handler=t.handler,this.props=t.props,this._state={hasDecimal:!1,hasNegative:!1,hasSeparator:!1,hasType:!1,hasSymbols:!1,hasCode:!1},Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this,this.options),this.FormatType=Asc.c_oAscNumFormatType.General,this.Format="General",this.CustomFormat=null},render:function(){Common.Views.AdvancedSettingsWindow.prototype.render.call(this);this.cmbFormat=new Common.UI.ComboBox({el:$("#format-settings-combo-format"),cls:"input-group-nr",menuStyle:"min-width: 264px;",editable:!1,data:this.numFormatData}),this.cmbFormat.setValue(this.FormatType),this.cmbFormat.on("selected",_.bind(this.onFormatSelect,this)),this.cmbNegative=new Common.UI.ComboBox({el:$("#format-settings-combo-negative"),cls:"input-group-nr",menuStyle:"min-width: 264px;max-height:235px;",editable:!1,data:[],scrollAlwaysVisible:!0}),this.cmbNegative.on("selected",_.bind(this.onNegativeSelect,this)),this.spnDecimal=new Common.UI.MetricSpinner({el:$("#format-settings-spin-decimal"),step:1,width:45,defaultUnit:"",value:2,maxValue:30,minValue:0,allowDecimal:!1}),this.spnDecimal.on("change",_.bind(this.onDecimalChange,this)),this.chSeparator=new Common.UI.CheckBox({el:$("#format-settings-checkbox-separator"),labelText:this.textSeparator}),this.chSeparator.on("change",_.bind(this.onSeparatorChange,this)),this.cmbSymbols=new Common.UI.ComboBox({el:$("#format-settings-combo-symbols"),cls:"input-group-nr",menuStyle:"min-width: 264px;max-height:235px;",editable:!1,data:[],scrollAlwaysVisible:!0}),this.cmbSymbols.on("selected",_.bind(this.onSymbolsSelect,this)),this.cmbType=new Common.UI.ComboBox({el:$("#format-settings-combo-type"),cls:"input-group-nr",menu
this.api&&this.api.asc_setCellTextWrap(t.pressed),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Wrap")},onTextOrientationMenu:function(t,e){var i=0;switch(e.value){case"countcw":i=45;break;case"clockwise":i=-45;break;case"rotateup":i=90;break;case"rotatedown":i=-90}this._state.angle=void 0,this.api&&this.api.asc_setCellAngle(i),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Text orientation")},onInsertImageMenu:function(t,e,i){if("file"===e.value)this.toolbar.fireEvent("insertimage",this.toolbar),this.api&&this.api.asc_addImage(),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Image");else{var n=this;new Common.Views.ImageFromUrlDialog({handler:function(t,e){if("ok"==t){if(n.api){var i=e.replace(/\s/g,"");_.isEmpty(i)?Common.UI.warning({msg:this.textEmptyImgUrl}):(n.toolbar.fireEvent("insertimage",n.toolbar),n.api.asc_addImageDrawingObject(i),Common.component.Analytics.trackEvent("ToolBar","Image"))}Common.NotificationCenter.trigger("edit:complete",n.toolbar)}}}).show()}},onHyperlink:function(t){var e,i,n=this;if(n.api){for(var o=n.api.asc_getWorksheetsCount(),s=-1,a=[];++s<o;)this.api.asc_isWorksheetHidden(s)||a.push({displayValue:n.api.asc_getWorksheetName(s),value:n.api.asc_getWorksheetName(s)});var r=function(t,e){"ok"==e&&(i=t.getSettings(),n.api.asc_insertHyperlink(i)),Common.NotificationCenter.trigger("edit:complete",n.toolbar)},l=n.api.asc_getCellInfo(),c=l.asc_getFlags().asc_getSelectionType();i=l.asc_getHyperlink(),e=new SSE.Views.HyperlinkSettingsDialog({api:n.api,handler:r}),e.show(),e.setSettings({sheets:a,currentSheet:n.api.asc_getWorksheetName(n.api.asc_getActiveWorksheetIndex()),props:i,text:l.asc_getText(),isLock:l.asc_getFlags().asc_getLockText(),allowInternal:c!==Asc.c_oAscSelectionType.RangeImage&&c!==Asc.c_oAscSelectionType.RangeShape&&c!==Asc.c_oAscSelectionType.RangeShapeText&&c!==Asc.c_oAscSelectionType.RangeChart&&c!==Asc.c_oAscSelectionType.RangeChartText})}Common.component.Analytics.trackEvent("ToolBar","Add Hyperlink")},onEditChart:function(t){if(this.editMode){var e=this,i=e.api.asc_getCellInfo();if(i.asc_getFlags().asc_getSelectionType()!=Asc.c_oAscSelectionType.RangeImage){var n;if(e.api){n=e.api.asc_getChartObject();for(var o=e.api.asc_getGraphicObjectProps(),s=null,a=0;a<o.length;a++)if(o[a].asc_getObjectType()==Asc.c_oAscTypeSelectElement.Image){var r=o[a].asc_getObjectValue();r.asc_getChartProperties()&&(s=r)}if(n){var l=e.toolbar.mode.isEditDiagram||i.asc_getFlags().asc_getSelectionType()==Asc.c_oAscSelectionType.RangeChart||i.asc_getFlags().asc_getSelectionType()==Asc.c_oAscSelectionType.RangeChartText;new SSE.Views.ChartSettingsDlg({chartSettings:n,imageSettings:s,isChart:!0,api:e.api,handler:function(t,i){"ok"==t&&e.api&&(l?e.api.asc_editChartDrawingObject(i.chartSettings):e.api.asc_addChartDrawingObject(i.chartSettings),i.imageSettings&&e.api.asc_setGraphicObjectProps(i.imageSettings)),Common.NotificationCenter.trigger("edit:complete",e.toolbar)}}).show()}}}}},onSelectChart:function(t,e,i,n){if(this.editMode){var o=this,s=o.api.asc_getCellInfo(),a=s.asc_getFlags().asc_getSelectionType(),r=i.get("group"),l="menu-chart-group-sparkcolumn"==r||"menu-chart-group-sparkline"==r||"menu-chart-group-sparkwin"==r;if(a!=Asc.c_oAscSelectionType.RangeImage&&o.api){var c;if(!l||a!=Asc.c_oAscSelectionType.RangeCells&&a!=Asc.c_oAscSelectionType.RangeCol&&a!=Asc.c_oAscSelectionType.RangeRow&&a!=Asc.c_oAscSelectionType.RangeMax){if(!l){var h=a==Asc.c_oAscSelectionType.RangeChart||a==Asc.c_oAscSelectionType.RangeChartText;if(c=o.api.asc_getChartObject()){c.putType(i.get("type"));var d=c.getRange(),p=o.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart,d,!0,!c.getInColumns(),c.getType());p==Asc.c_oAscError.ID.No?h?o.api.asc_editChartDrawingObject(c):o.api.asc_addChartDrawingObject(c):Common.UI.warning({msg:p==Asc.c_oAscError.ID.StockChartError?o.errorStockChart:p==Asc.c_oAscError.ID.MaxDataSeriesErr
s.btnTextOrient.menu.items[1].setChecked(!0,!0);break;case-45:s.btnTextOrient.menu.items[2].setChecked(!0,!0);break;case 90:s.btnTextOrient.menu.items[3].setChecked(!0,!0);break;case-90:s.btnTextOrient.menu.items[4].setChecked(!0,!0);break;default:s.btnTextOrient.menu.items[0].setChecked(!0,!0)}this._state.angle=e}if(e=t.asc_getStyleName(),this._state.prstyle!=e&&!this.toolbar.listStyles.isDisabled()){var E=this.toolbar.listStyles;if(E.rendered){E.suspendEvents();var M=E.menuPicker.store.findWhere({name:e});this._state.prstyle=E.menuPicker.store.length>0?e:void 0,E.menuPicker.selectRecord(M),E.resumeEvents()}}e=i==Asc.c_oAscSelectionType.RangeRow,this._state.controlsdisabled.rows!==e&&(this._state.controlsdisabled.rows=e,s.btnAddCell.menu.items[3].setDisabled(e),s.btnDeleteCell.menu.items[3].setDisabled(e)),e=i==Asc.c_oAscSelectionType.RangeCol,this._state.controlsdisabled.cols!==e&&(this._state.controlsdisabled.cols=e,s.btnAddCell.menu.items[2].setDisabled(e),s.btnDeleteCell.menu.items[2].setDisabled(e)),e=C&&C.asc_getIsApplyAutoFilter(),this._state.controlsdisabled.cells_right!==(this._state.controlsdisabled.rows||e)&&(this._state.controlsdisabled.cells_right=this._state.controlsdisabled.rows||e,s.btnAddCell.menu.items[0].setDisabled(this._state.controlsdisabled.cells_right),s.btnDeleteCell.menu.items[0].setDisabled(this._state.controlsdisabled.cells_right)),this._state.controlsdisabled.cells_down!==(this._state.controlsdisabled.cols||e)&&(this._state.controlsdisabled.cells_down=this._state.controlsdisabled.cols||e,s.btnAddCell.menu.items[1].setDisabled(this._state.controlsdisabled.cells_down),s.btnDeleteCell.menu.items[1].setDisabled(this._state.controlsdisabled.cells_down))}}}},onApiStyleChange:function(){this.toolbar.btnCopyStyle.toggle(!1,!0),this.modeAlwaysSetStyle=!1},updateThemeColors:function(){var t=function(t,e){if(t){for(var i,n=Common.Utils.ThemeColor.getEffectColors(),o=0;o<n.length;o++)"object"==typeof t.currentColor&&void 0===i&&t.currentColor.effectId==n[o].effectId&&(i=n[o]);t.updateColors(n,Common.Utils.ThemeColor.getStandartColors()),void 0===t.currentColor?t.currentColor=e:void 0!==i&&(t.currentColor=i)}};t(this.toolbar.mnuTextColorPicker,Common.Utils.ThemeColor.getStandartColors()[1]),void 0===this.toolbar.btnTextColor.currentColor?this.toolbar.btnTextColor.currentColor=Common.Utils.ThemeColor.getStandartColors()[1]:this.toolbar.btnTextColor.currentColor=this.toolbar.mnuTextColorPicker.currentColor.color||this.toolbar.mnuTextColorPicker.currentColor,$(".btn-color-value-line",this.toolbar.btnTextColor.cmpEl).css("background-color","#"+this.toolbar.btnTextColor.currentColor),t(this.toolbar.mnuBackColorPicker,Common.Utils.ThemeColor.getStandartColors()[3]),void 0===this.toolbar.btnBackColor.currentColor?this.toolbar.btnBackColor.currentColor=Common.Utils.ThemeColor.getStandartColors()[3]:this.toolbar.btnBackColor.currentColor=this.toolbar.mnuBackColorPicker.currentColor.color||this.toolbar.mnuBackColorPicker.currentColor,$(".btn-color-value-line",this.toolbar.btnBackColor.cmpEl).css("background-color","transparent"==this.toolbar.btnBackColor.currentColor?"transparent":"#"+this.toolbar.btnBackColor.currentColor),void 0===this._state.clrtext_asccolor&&void 0===this._state.clrshd_asccolor||(this._state.clrtext=void 0,this._state.clrback=void 0,this.onApiSelectionChanged(this.api.asc_getCellInfo())),this._state.clrtext_asccolor=void 0,this._state.clrshd_asccolor=void 0,this.toolbar.mnuBorderColorPicker&&(t(this.toolbar.mnuBorderColorPicker,Common.Utils.ThemeColor.getEffectColors()[1]),this.toolbar.btnBorders.options.borderscolor=this.toolbar.mnuBorderColorPicker.currentColor.color||this.toolbar.mnuBorderColorPicker.currentColor,$("#id-toolbar-mnu-item-border-color .menu-item-icon").css("border-color","#"+this.toolbar.btnBorders.options.borderscolor))},hideElements:function(t){if(!_.isUndefined(t.title)){var e=this.getApplication().getController("Viewport").getView("Common.Views.Header");e&&e.setVisible(!t.title),Common.NotificationCenter.trigger("layout:changed","header")}if(_.isUndefined(t.compact)||thi
return'\r\n<div class="statusbar">\r\n <div id="status-tabs-scroll" class="status-group">\r\n <button id="status-btn-tabfirst" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-tab-first">&nbsp;</span></button>\r\n <button id="status-btn-tabback" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-tab-back">&nbsp;</span></button>\r\n <button id="status-btn-tabnext" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-tab-next">&nbsp;</span></button>\r\n <button id="status-btn-tablast" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-tab-last">&nbsp;</span></button>\r\n </div>\r\n <div id="status-addtabs-box" class="status-group">\r\n <button id="status-btn-addtab" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-zoom-up">&nbsp;</span></button>\r\n </div>\r\n <div id="status-zoom-box" class="status-group">\r\n <div class="separator short" />\r\n <button id="status-btn-zoomdown" type="button" class="btn small btn-toolbar"><span class="btn-icon btn-zoom-down">&nbsp;</span></button>\r\n <div class="cnt-zoom">\r\n <div class="dropdown-toggle" data-toggle="dropdown">\r\n <label id="status-label-zoom" class="status-label">Zoom 100%</label>\r\n </div>\r\n </div>\r\n <button id="status-btn-zoomup" type="button" class="btn small btn-toolbar" style="margin-right:40px;"><span class="btn-icon btn-zoom-up">&nbsp;</span></button>\r\n </div>\r\n \x3c!-- /** coauthoring begin **/ --\x3e\r\n <div id="status-users-ct" class="status-group dropup" style="display:none;">\r\n <div class="separator short" />\r\n <div id="status-users-block" style="display:inline-block; cursor:pointer; margin-left: 12px;">\r\n <span id="status-users-icon" class="img-commonctrl" style="margin-bottom: 1px;"/>\r\n <label id="status-users-count" class="status-label" style="font-size: 14px; font-weight: normal; margin-top: -1px;">+</label>\r\n </div>\r\n <div id="status-users-menu" class="dropdown-menu">\r\n <label style="display: block;margin-right: 14px;"><%= scope.tipUsers %></label>\r\n <div id="status-users-list"></div>\r\n <label id="status-change-rights" class="link" style="margin-top: 15px;"><%= scope.txAccessRights %></label>\r\n </div>\r\n </div>\r\n \x3c!-- /** coauthoring end **/ --\x3e\r\n <div id="status-math-box" class="status-group">\r\n <div class="separator short" style="margin-right: 12px;" />\r\n <label id="status-math-average">AVERAGE: 10</label>\r\n <label id="status-math-count">COUNT: 3</label>\r\n <label id="status-math-sum">SUM: 5</label>\r\n </div>\r\n <div id="status-filtered-box" class="status-group">\r\n <div class="separator short" style="margin-right: 12px;" />\r\n <label id="status-filtered-records"></label>\r\n </div>\r\n <div id="status-sheets-bar-box">\r\n <div id="status-sheets-bar" class="status-group">\r\n </div>\r\n </div>\r\n</div>\r\n'}),void 0===Common)var Common={};define("common/main/lib/component/Tab",["common/main/lib/component/BaseView"],function(t){"use strict";var e=function(t){return this.active=!1,this.label="Tab",this.cls="",this.template=_.template(['<li class="<% if(active){ %>active<% } %> <% if(cls.length){%><%= cls %><%}%>" data-label="<%= label %>">',"<a><%- label %></a>","</li>"].join("")),this.initialize.call(this,t),this};_.extend(e.prototype,{initialize:function(t){_.extend(this,t)},render:function(){var t=this.template(this);return this.$el=$(t),this.rendered=!0,this.disable(this.disabled),this},isActive:function(){return this.$el.hasClass("active")},activate:function(){this.$el.hasClass("active")||this.$el.addClass("active")},deactivate:function(){this.$el.removeClass("active")},on:function(){this.$el.on.apply(this,arguments)},disable:function(t){this.disabled=t,this.rendered&&(t&&!this.$el.hasClass("disabled")?t
t.listNames.$el.find(".listview").focus()},100,this)},hide:function(){Common.UI.Window.prototype.hide.apply(this,arguments),this.mask.off("mousedown",_.bind(this.onUpdateFocus,this))},onBtnClick:function(t){var e=this.listNames.getSelectedRec();this.options.handler&&this.options.handler.call(this,t.currentTarget.attributes.result.value,e[0].get("inindex")),this.close()},onPrimary:function(){this.options.handler&&this.options.handler.call(this,"ok",this.listNames.getSelectedRec()[0].get("inindex")),this.close()},onUpdateFocus:function(){_.delay(function(t){t.listNames.$el.find(".listview").focus()},100,this)},itemCopyToEnd:"(Copy to end)",itemMoveToEnd:"(Move to end)",textCopyBefore:"Copy before sheet",textMoveBefore:"Move before sheet"},i||{}))}),define("spreadsheeteditor/main/app/controller/Statusbar",["core","spreadsheeteditor/main/app/view/Statusbar"],function(){"use strict";SSE.Controllers.Statusbar=Backbone.Controller.extend(_.extend({models:[],collections:[],views:["Statusbar"],initialize:function(){this.addListeners({Statusbar:{"show:hidden":_.bind(function(t,e){this.hideWorksheet(!1,e)},this),"sheet:changename":_.bind(function(){this.api.asc_closeCellEditor(),this.renameWorksheet()},this),"sheet:setcolor":_.bind(this.setWorksheetColor,this),"sheet:updateColors":_.bind(this.updateTabsColors,this),"sheet:move":_.bind(this.moveWorksheet,this)}})},events:function(){return{"click #status-btn-zoomdown":_.bind(this.zoomDocument,this,"down"),"click #status-btn-zoomup":_.bind(this.zoomDocument,this,"up"),"click .cnt-zoom":_.bind(this.onZoomShow,this)}},onLaunch:function(){this.statusbar=this.createView("Statusbar",{storeUsers:this.getApplication().getCollection("Common.Collections.Users")}).render(),this.statusbar.$el.css("z-index",10),this.statusbar.labelZoom.css("min-width",70),this.statusbar.zoomMenu.on("item:click",_.bind(this.menuZoomClick,this)),this.bindViewEvents(this.statusbar,this.events),$("#id-tab-menu-new-color",this.statusbar.$el).on("click",_.bind(this.onNewBorderColor,this))},setApi:function(t){this.api=t,this.api.asc_registerCallback("asc_onZoomChanged",_.bind(this.onZoomChange,this)),this.api.asc_registerCallback("asc_onSelectionMathChanged",_.bind(this.onApiMathChanged,this)),this.api.asc_registerCallback("asc_onCoAuthoringDisconnect",_.bind(this.onApiDisconnect,this)),Common.NotificationCenter.on("api:disconnect",_.bind(this.onApiDisconnect,this)),this.api.asc_registerCallback("asc_onUpdateTabColor",_.bind(this.onApiUpdateTabColor,this)),this.api.asc_registerCallback("asc_onEditCell",_.bind(this.onApiEditCell,this)),this.api.asc_registerCallback("asc_onWorkbookLocked",_.bind(this.onWorkbookLocked,this)),this.api.asc_registerCallback("asc_onWorksheetLocked",_.bind(this.onWorksheetLocked,this)),this.api.asc_registerCallback("asc_onError",_.bind(this.onError,this)),this.api.asc_registerCallback("asc_onFilterInfo",_.bind(this.onApiFilterInfo,this)),this.api.asc_registerCallback("asc_onActiveSheetChanged",_.bind(this.onApiActiveSheetChanged,this)),this.statusbar.setApi(t)},zoomDocument:function(t,e){switch(t){case"up":var i=Math.floor(10*this.api.asc_getZoom())/10;i+=.1,!(i>2)&&this.api.asc_setZoom(i);break;case"down":i=Math.ceil(10*this.api.asc_getZoom())/10,i-=.1,!(i<.5)&&this.api.asc_setZoom(i)}Common.NotificationCenter.trigger("edit:complete",this.statusbar)},menuZoomClick:function(t,e){this.api.asc_setZoom(e.value/100),Common.NotificationCenter.trigger("edit:complete",this.statusbar)},onZoomChange:function(t,e){this.statusbar.labelZoom.text(Common.Utils.String.format(this.zoomText,Math.floor(100*(t+.005))))},onApiDisconnect:function(){this.statusbar.setMode({isDisconnected:!0}),this.statusbar.update()},onWorkbookLocked:function(t){this.statusbar.tabbar[t?"addClass":"removeClass"]("coauth-locked"),this.statusbar.btnAddWorksheet.setDisabled(t||this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.Chart||this.statusbar.rangeSelectionMode==Asc.c_oAscSelectionDialogType.FormatTable);for(var e,i=this.statusbar.tabbar.getCount();i-- >0;)e=this.statusbar.tabbar.getAt(i),e.sheetindex>=0||e.disable(t
this.btnOriginalSize.setDisabled(null===t.asc_getImageUrl()||void 0===t.asc_getImageUrl()||this._locked);var i=t.asc_getPluginGuid();if(e=null!==i&&void 0!==i,this._state.isOleObject!==e&&(this.btnInsertFromUrl.setVisible(!e),this.btnInsertFromFile.setVisible(!e),this.btnEditObject.setVisible(e),this.lblReplace.text(e?this.textEditObject:this.textInsert),this._state.isOleObject=e),this._state.isOleObject){var n=SSE.getCollection("Common.Collections.Plugins").findWhere({guid:i});this.btnEditObject.setDisabled(null===n||void 0===n||this._locked)}else this.btnInsertFromUrl.setDisabled(null===i||this._locked),this.btnInsertFromFile.setDisabled(null===i||this._locked)}},onWidthChange:function(t,e,i,n){var o=t.getNumberValue(),s=this.spnHeight.getNumberValue();if(this.btnRatio.pressed&&(s=o/this._nRatio,s>this.spnHeight.options.maxValue&&(s=this.spnHeight.options.maxValue,o=s*this._nRatio,this.spnWidth.setValue(o,!0)),this.spnHeight.setValue(s,!0)),this.api){var a=new Asc.asc_CImgProperty;a.asc_putWidth(Common.Utils.Metric.fnRecalcToMM(o)),a.asc_putHeight(Common.Utils.Metric.fnRecalcToMM(s)),this.api.asc_setGraphicObjectProps(a)}Common.NotificationCenter.trigger("edit:complete",this)},onHeightChange:function(t,e,i,n){var o=t.getNumberValue(),s=this.spnWidth.getNumberValue();if(this.btnRatio.pressed&&(s=o*this._nRatio,s>this.spnWidth.options.maxValue&&(s=this.spnWidth.options.maxValue,o=s/this._nRatio,this.spnHeight.setValue(o,!0)),this.spnWidth.setValue(s,!0)),this.api){var a=new Asc.asc_CImgProperty;a.asc_putWidth(Common.Utils.Metric.fnRecalcToMM(s)),a.asc_putHeight(Common.Utils.Metric.fnRecalcToMM(o)),this.api.asc_setGraphicObjectProps(a)}Common.NotificationCenter.trigger("edit:complete",this)},setOriginalSize:function(){if(this.api){var t=this.api.asc_getOriginalImageSize(),e=t.asc_getImageWidth(),i=t.asc_getImageHeight(),n=new Asc.asc_CImgProperty;n.asc_putWidth(e),n.asc_putHeight(i),this.api.asc_setGraphicObjectProps(n),Common.NotificationCenter.trigger("edit:complete",this)}},insertFromUrl:function(){var t=this;new Common.Views.ImageFromUrlDialog({handler:function(e,n){if("ok"==e&&t.api){var o=n.replace(/ /g,"");if(!i.isEmpty(o)){var s=new Asc.asc_CImgProperty;s.asc_putImageUrl(o),t.api.asc_setGraphicObjectProps(s)}}Common.NotificationCenter.trigger("edit:complete",t)}}).show()},setLocked:function(t){this._locked=t},disableControls:function(t){this._initSettings||this._state.DisabledControls!==t&&(this._state.DisabledControls=t,i.each(this.lockedControls,function(e){e.setDisabled(t)}),this.linkAdvanced.toggleClass("disabled",t))},textKeepRatio:"Constant Proportions",textSize:"Size",textWidth:"Width",textHeight:"Height",textOriginalSize:"Default Size",textInsert:"Replace Image",textFromUrl:"From URL",textFromFile:"From File",textEditObject:"Edit Object",textEdit:"Edit",textAdvanced:"Show advanced settings"},SSE.Views.ImageSettings||{}))}),define("text!spreadsheeteditor/main/app/template/ChartSettings.template",[],function(){return'<table cols="3" id="chart-panel-size">\r\n <tr>\r\n <td colspan=3>\r\n <label class="header"><%= scope.textSize %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="88px">\r\n <label class="input-label"><%= scope.textWidth %></label>\r\n <div id="chart-spin-width"></div>\r\n </td>\r\n <td class="padding-small" width="28px" style="vertical-align: bottom;">\r\n <div id="chart-button-ratio"></div>\r\n </td>\r\n <td class="padding-small" width="88px">\r\n <label class="input-label"><%= scope.textHeight %></label>\r\n <div id="chart-spin-height"></div>\r\n </td>\r\n </tr>\r\n</table>\r\n<table cols="1" id="chart-panel-types">\r\n <tr>\r\n <td class="padding-small">\r\n <div class="separator horizontal"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <label class="header"><%= scope.textType %></label>\r\n <div id="chart-button-type" style=""></div>\r\n <
t.api&&(e.api=t.api,e.api.asc_setSelectionDialogMode(t.type,t.range?t.range:""),e.api.asc_unregisterCallback("asc_onSelectionRangeChanged",_.bind(e.onApiRangeChanged,e)),e.api.asc_registerCallback("asc_onSelectionRangeChanged",_.bind(e.onApiRangeChanged,e)),Common.NotificationCenter.trigger("cells:range",t.type)),e.inputRange.validation=function(i){return t.validation?t.validation.call(e,i):e.api.asc_checkDataRange(t.type,i,!1)!=Asc.c_oAscError.ID.DataRangeError||e.txtInvalidRange}},getSettings:function(){return this.inputRange.getValue()},onApiRangeChanged:function(t){this.inputRange.setValue(t.asc_getName()),this.inputRange.cmpEl.hasClass("error")&&this.inputRange.cmpEl.removeClass("error")},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},onClose:function(t){this.api&&this.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None),Common.NotificationCenter.trigger("cells:range",Asc.c_oAscSelectionDialogType.None),SSE.getController("RightMenu").SetDisabled(!1)},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},_handleInput:function(t){if(this.options.handler){if("ok"==t&&!0!==this.inputRange.checkValidate())return;this.options.handler.call(this,this,t)}this.close()},show:function(){Common.UI.Window.prototype.show.call(this),SSE.getController("RightMenu").SetDisabled(!0)},txtTitle:"Select Data Range",textCancel:"Cancel",txtEmpty:"This field is required",txtInvalidRange:"ERROR! Invalid cells range",errorMaxRows:"ERROR! The maximum number of data series per chart is 255.",errorStockChart:"Incorrect row order. To build a stock chart place the data on the sheet in the following order:<br> opening price, max price, min price, closing price."},SSE.Views.CellRangeDialog||{}))}),define("spreadsheeteditor/main/app/view/ChartSettingsDlg",["text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/CheckBox","common/main/lib/component/InputField","spreadsheeteditor/main/app/view/CellRangeDialog"],function(t){"use strict";SSE.Views.ChartSettingsDlg=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{contentWidth:322,height:535,toggleGroup:"chart-settings-dlg-group",storageName:"sse-chart-settings-adv-category"},initialize:function(e){_.extend(this.options,{title:this.textTitle,items:[{panelId:"id-chart-settings-dlg-style",panelCaption:this.textTypeData},{panelId:"id-chart-settings-dlg-layout",panelCaption:this.textLayout},{panelId:"id-chart-settings-dlg-vert",panelCaption:this.textVertAxis},{panelId:"id-chart-settings-dlg-hor",panelCaption:this.textHorAxis},{panelId:"id-spark-settings-dlg-style",panelCaption:this.textTypeData},{panelId:"id-spark-settings-dlg-axis",panelCaption:this.textAxisOptions},{panelId:"id-chart-settings-dlg-alttext",panelCaption:this.textAlt}],contentTemplate:_.template(t)({scope:this})},e),this.options.handler=function(t,i){return"ok"==t&&!this.isRangeValid()||void(e.handler&&e.handler.call(this,t,i))},Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this,this.options),this._state={ChartType:Asc.c_oAscChartTypeSettings.barNormal,SparkType:-1},this._noApply=!0,this._changedProps=null,this.api=this.options.api,this.chartSettings=this.options.chartSettings,this.imageSettings=this.options.imageSettings,this.sparklineStyles=this.options.sparklineStyles,this.isChart=this.options.isChart,this.vertAxisProps=null,this.horAxisProps=null,this.currentAxisProps=null,this.dataRangeValid="",this.sparkDataRangeValid="",this.dataLocationRangeValid="",this.currentChartType=this._state.ChartType,this.storageName=this.isChart?"sse-chart-settings-adv-category":"sse-spark-settings-adv-category"},render:function(){Common.Views.AdvancedSettingsWindow.prototype.render.call(this);var t=this,e=this.getChild(),i=function(t,i,n){var o=this;e.hasClass("notransform")?(t.css({left:i,top:n}),o.options.additionalAlign=null):(e.addClass("notransform"),t.addClass("hidden"),setTimeout(function(){t.removeClass("hidden"),t.css({left:i,top:n}),o.options.additionalAlign=n
var i=t==Asc.c_oAscChartTypeSettings.lineNormal||t==Asc.c_oAscChartTypeSettings.lineStacked||t==Asc.c_oAscChartTypeSettings.lineStackedPer||t==Asc.c_oAscChartTypeSettings.scatter;this.chMarkers.setVisible(i),this.cmbLines.setVisible(i),this.lblLines.toggleClass("hidden",!i),i&&(this.chMarkers.setValue(this.chartSettings.getShowMarker(),!0),this.cmbLines.setValue(this.chartSettings.getLine()?this.chartSettings.getSmooth()?2:1:0)),i=t==Asc.c_oAscChartTypeSettings.pie||t==Asc.c_oAscChartTypeSettings.doughnut||t==Asc.c_oAscChartTypeSettings.pie3d,this.btnsCategory[2].setDisabled(i),this.btnsCategory[3].setDisabled(i),this.cmbHorShow.setDisabled(i),this.cmbVertShow.setDisabled(i),this.cmbHorTitle.setDisabled(i),this.cmbVertTitle.setDisabled(i),this.cmbHorGrid.setDisabled(i),this.cmbVertGrid.setDisabled(i),this.cmbHorShow.setValue(this.chartSettings.getShowHorAxis()),this.cmbVertShow.setValue(this.chartSettings.getShowVerAxis()),this.cmbHorTitle.setValue(this.chartSettings.getHorAxisLabel()),this.cmbVertTitle.setValue(this.chartSettings.getVertAxisLabel()),this.cmbHorGrid.setValue(this.chartSettings.getHorGridLines()),this.cmbVertGrid.setValue(this.chartSettings.getVertGridLines()),i=t==Asc.c_oAscChartTypeSettings.barNormal3d||t==Asc.c_oAscChartTypeSettings.barStacked3d||t==Asc.c_oAscChartTypeSettings.barStackedPer3d||t==Asc.c_oAscChartTypeSettings.hBarNormal3d||t==Asc.c_oAscChartTypeSettings.hBarStacked3d||t==Asc.c_oAscChartTypeSettings.hBarStackedPer3d||t==Asc.c_oAscChartTypeSettings.barNormal3dPerspective,this.cmbAxisPos.setDisabled(i),i=t==Asc.c_oAscChartTypeSettings.hBarNormal||t==Asc.c_oAscChartTypeSettings.hBarStacked||t==Asc.c_oAscChartTypeSettings.hBarStackedPer||t==Asc.c_oAscChartTypeSettings.hBarNormal3d||t==Asc.c_oAscChartTypeSettings.hBarStacked3d||t==Asc.c_oAscChartTypeSettings.hBarStackedPer3d,this.btnsCategory[2].options.contentTarget=i?"id-chart-settings-dlg-hor":"id-chart-settings-dlg-vert",this.btnsCategory[3].options.contentTarget=i||t==Asc.c_oAscChartTypeSettings.scatter?"id-chart-settings-dlg-vert":"id-chart-settings-dlg-hor"},updateDataLabels:function(t,e){if(t!==this.currentChartType){var i=[{value:Asc.c_oAscChartDataLabelsPos.none,displayValue:this.textNone},{value:Asc.c_oAscChartDataLabelsPos.ctr,displayValue:this.textCenter}];t==Asc.c_oAscChartTypeSettings.barNormal||t==Asc.c_oAscChartTypeSettings.hBarNormal?i.push({value:Asc.c_oAscChartDataLabelsPos.inBase,displayValue:this.textInnerBottom},{value:Asc.c_oAscChartDataLabelsPos.inEnd,displayValue:this.textInnerTop},{value:Asc.c_oAscChartDataLabelsPos.outEnd,displayValue:this.textOuterTop}):t==Asc.c_oAscChartTypeSettings.barStacked||t==Asc.c_oAscChartTypeSettings.barStackedPer||t==Asc.c_oAscChartTypeSettings.hBarStacked||t==Asc.c_oAscChartTypeSettings.hBarStackedPer?i.push({value:Asc.c_oAscChartDataLabelsPos.inBase,displayValue:this.textInnerBottom},{value:Asc.c_oAscChartDataLabelsPos.inEnd,displayValue:this.textInnerTop}):t==Asc.c_oAscChartTypeSettings.lineNormal||t==Asc.c_oAscChartTypeSettings.lineStacked||t==Asc.c_oAscChartTypeSettings.lineStackedPer||t==Asc.c_oAscChartTypeSettings.stock||t==Asc.c_oAscChartTypeSettings.scatter?i.push({value:Asc.c_oAscChartDataLabelsPos.l,displayValue:this.textLeft},{value:Asc.c_oAscChartDataLabelsPos.r,displayValue:this.textRight},{value:Asc.c_oAscChartDataLabelsPos.t,displayValue:this.textTop},{value:Asc.c_oAscChartDataLabelsPos.b,displayValue:this.textBottom}):t!=Asc.c_oAscChartTypeSettings.pie&&t!=Asc.c_oAscChartTypeSettings.pie3d||i.push({value:Asc.c_oAscChartDataLabelsPos.bestFit,displayValue:this.textFit},{value:Asc.c_oAscChartDataLabelsPos.inEnd,displayValue:this.textInnerTop},{value:Asc.c_oAscChartDataLabelsPos.outEnd,displayValue:this.textOuterTop}),this.cmbDataLabels.setData(i)}if(void 0!==e){this.cmbDataLabels.store.findWhere({value:e})||(e=Asc.c_oAscChartDataLabelsPos.ctr)}else e=Asc.c_oAscChartDataLabelsPos.none;this.cmbDataLabels.setValue(e),this.onSelectDataLabels(this.cmbDataLabels,{value:e})},onVCategoryClick:function(){this.vertAxisProps.getAxisType()==Asc.c_oAscAxisType.val?this.fillVProps(this.v
this.colorsLast.select(this.LastColor,!0),m=!0;break}m||this.colorsLast.clearSelection()}else this.colorsLast.select(this.LastColor,!0);this._state.LastColor=this.LastColor,a=!0}}if(g=t.asc_getNegativePoint(),h=t.asc_getColorNegative(),this._state.NegativePoint!==g&&(this.chNegativePoint.setValue(null!==g&&void 0!==g?g:"indeterminate",!0),this._state.NegativePoint=g,a=!0),h){this.NegativeColor=h.asc_getType()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?{color:Common.Utils.ThemeColor.getHexColor(h.asc_getR(),h.asc_getG(),h.asc_getB()),effectValue:h.asc_getValue()}:Common.Utils.ThemeColor.getHexColor(h.asc_getR(),h.asc_getG(),h.asc_getB());var d=typeof this.NegativeColor,p=typeof this._state.NegativeColor;if(d!==p||"object"==d&&(this.NegativeColor.effectValue!==this._state.NegativeColor.effectValue||this._state.NegativeColor.color.indexOf(this.NegativeColor.color)<0)||"object"!=d&&(this._state.NegativeColor.indexOf(this.NegativeColor)<0||"object"==typeof this.btnNegativeColor.color)){if(this.btnNegativeColor.setColor(this.NegativeColor),"object"==typeof this.NegativeColor){for(var m=!1,u=0;u<10;u++)if(Common.Utils.ThemeColor.ThemeValues[u]==this.NegativeColor.effectValue){this.colorsNegative.select(this.NegativeColor,!0),m=!0;break}m||this.colorsNegative.clearSelection()}else this.colorsNegative.select(this.NegativeColor,!0);this._state.NegativeColor=this.NegativeColor,a=!0}}a&&this.updateSparkStyles(t.asc_getStyles())}},updateMetricUnit:function(){if(this.spinners)for(var t=0;t<this.spinners.length;t++){var e=this.spinners[t];e.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()),e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.1)}},UpdateThemeColors:function(){var t;this.btnSparkColor||(t=this.defColor,this.btnSparkColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="spark-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="spark-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnSparkColor.render(e("#spark-color-btn")),this.btnSparkColor.setColor("000000"),this.lockedControls.push(this.btnSparkColor),this.colorsSpark=new Common.UI.ThemeColorPalette({el:e("#spark-color-menu"),value:"000000"}),this.colorsSpark.on("select",i.bind(this.onColorsSparkSelect,this)),e(this.el).on("click","#spark-color-new",i.bind(this.addNewColor,this,this.colorsSpark,this.btnSparkColor)),this.btnHighColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="spark-high-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="spark-high-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}).render(e("#spark-high-color-btn")),this.btnHighColor.setColor(this.defColor.color),this.lockedControls.push(this.btnHighColor),this.colorsHigh=new Common.UI.ThemeColorPalette({el:e("#spark-high-color-menu")}),this.colorsHigh.on("select",i.bind(this.onColorsPointSelect,this,0,this.btnHighColor)),e(this.el).on("click","#spark-high-color-new",i.bind(this.addNewColor,this,this.colorsHigh,this.btnHighColor)),this.btnLowColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="spark-low-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="spark-low-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}).render(e("#spark-low-color-btn")),this.btnLowColor.setColor(this.defColor.color),this.lockedControls.push(this.btnLowColor),this.colorsLow=new Common.UI.ThemeColorPalette({el:e("#spark-low-color-menu")}),this.colorsLow.on("select",i.bind(this.onColorsPointSelect,this,1,this.btnLowColor)),e(this.el).on("click","#spark-low-color-new",i.bind(this.addNewColor,this,this.colorsLow,this.btnLowColor)),this.btnNegativeColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="spark-negative-color-menu" s
return'<table cols="1">\r\n <tr>\r\n <td>\r\n <label class="header"><%= scope.strFill %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <div id="shape-combo-fill-src" style="width: 100%;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <div id="shape-panel-color-fill" class="padding-small" style="width: 100%;">\r\n <div id="shape-back-color-btn" style=""></div>\r\n </div>\r\n <div id="shape-panel-image-fill" class="settings-hidden padding-small" style="width: 100%;">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <button type="button" class="btn btn-text-default" id="shape-button-from-file" style="width:90px;"><%= scope.textFromFile %></button>\r\n </td>\r\n <td class="padding-small" width="50%">\r\n <button type="button" class="btn btn-text-default" id="shape-button-from-url" style="width:90px;float:right;"><%= scope.textFromUrl %></button>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="vertical-align: top">\r\n <div id="shape-combo-fill-type" style="width: 90px;"></div>\r\n </td>\r\n <td rowspan="2">\r\n <div style="width: 90px; height: 80px; padding: 14px 20px; border: 1px solid #AFAFAF; border-radius: 2px; background: #ffffff;float:right;">\r\n <div id="shape-texture-img" style="width: 50px;height: 50px;"></div>\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="vertical-align: bottom">\r\n <label class="input-label" style=""><%= scope.textTexture %></label>\r\n <div id="shape-combo-fill-texture" style="width: 90px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div id="shape-panel-pattern-fill" class="settings-hidden padding-small" style="width: 100%;">\r\n <label class="input-label" style="margin-top: 3px;"><%= scope.strPattern %></label>\r\n <div id="shape-combo-pattern" style="width: 100%; height: 42px; margin-bottom: 8px;"></div>\r\n <div style="width: 100%; height: 25px; margin-bottom: 8px;">\r\n <label class="input-label" style="margin-top: 3px;"><%= scope.strForeground %></label>\r\n <div id="shape-foreground-color-btn" style="display: inline-block; float:right;"></div>\r\n </div>\r\n <div style="width: 100%; height: 25px;">\r\n <label class="input-label" style="margin-top: 3px;"><%= scope.strBackground %></label>\r\n <div id="shape-background-color-btn" style="display: inline-block; float:right;"></div>\r\n </div>\r\n </div>\r\n <div id="shape-panel-gradient-fill" class="settings-hidden padding-small" style="width: 100%;">\r\n <div style="height:80px;">\r\n <div style="display: inline-block;">\r\n <label class="input-label" style=""><%= scope.textStyle %></label>\r\n <div id="shape-combo-grad-type" style="width: 90px;"></div>\r\n </div>\r\n <div style="display: inline-block;float: right;">\r\n <label class="input-label" style=""><%= scope.textDirection %></label>\r\n <div id="shape-button-direction" style=""></div>\r\n </div>\r\n </div>\r\n <label class="header" style="display:block;margin-bottom: 5px;"><%= scope.textGradient %></label>\r\n <div style="display: inline-block; margin-top: 3p
return'<div id="id-adv-shape-width" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="3">\r\n <tr>\r\n <td width="108px">\r\n <label class="input-label"><%= scope.textWidth %></label>\r\n <div id="shape-advanced-spin-width"></div>\r\n </td>\r\n <td width="28px" style="vertical-align: bottom;">\r\n <div id="shape-advanced-button-ratio"></div>\r\n </td>\r\n <td width="108px">\r\n <label class="input-label"><%= scope.textHeight %></label>\r\n <div id="shape-advanced-spin-height"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n</div>\r\n<div id="id-adv-shape-shape" class="settings-panel">\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="header"><%= scope.textLineStyle %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-large" width="125px">\r\n <label class="input-label"><%= scope.textCapType %></label>\r\n <div id="shape-advanced-cap-type" style="width: 100px;"></div>\r\n </td>\r\n <td class="padding-large">\r\n <label class="input-label"><%= scope.textJoinType %></label>\r\n <div id="shape-advanced-join-type" style="width: 100px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class="separator horizontal padding-large"></div>\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="header"><%= scope.textArrows %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="125px">\r\n <label class="input-label"><%= scope.textBeginStyle %></label>\r\n <div id="shape-advanced-begin-style" style="width: 100px;"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textEndStyle %></label>\r\n <div id="shape-advanced-end-style" style="width: 100px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textBeginSize %></label>\r\n <div id="shape-advanced-begin-size" style="width: 100px;"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textEndSize %></label>\r\n <div id="shape-advanced-end-size" style="width: 100px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n</div>\r\n<div id="id-adv-shape-margins" class="settings-panel">\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td class="padding-small" width="125px">\r\n <label class="input-label"><%= scope.textTop %></label>\r\n <div id="shape-margin-top"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textLeft %></label>\r\n <div id="shape-margin-left"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textBottom %></label>\r\n <div id="shape-margin-bottom"></div>\r\n </td>\r\n <td class="padding-small">\r\n <label class="input-label"><%= scope.textRight %></label>\r\n
n.asc_putFill(new Asc.asc_CFillSolid),n.asc_getFill().asc_putColor(Common.Utils.ThemeColor.getRgbColor("transparent"==this.ShapeColor.Color?{color:"4f81bd",effectId:24}:this.ShapeColor.Color)),i.asc_putFill(n),this.imgprops.asc_putShapeProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_GRAD:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_GRAD,!this._noApply){var i=new Asc.asc_CShapeProperty,n=new Asc.asc_CShapeFill;if(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD),n.asc_putFill(new Asc.asc_CFillGrad),n.asc_getFill().asc_putGradType(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(n.asc_getFill().asc_putLinearAngle(6e4*this.GradLinearDirectionType),n.asc_getFill().asc_putLinearScale(!0)),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD){var o=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),s=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();o="ffffff"===o&&"ffffff"===s?{color:"4f81bd",effectId:24}:this.GradColor.colors[0],n.asc_getFill().asc_putPositions([1e3*this.GradColor.values[0],1e3*this.GradColor.values[1]]),n.asc_getFill().asc_putColors([Common.Utils.ThemeColor.getRgbColor(o),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])}i.asc_putFill(n),this.imgprops.asc_putShapeProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_BLIP:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_BLIP;break;case Asc.c_oAscFill.FILL_TYPE_PATT:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_PATT,!this._noApply){var i=new Asc.asc_CShapeProperty,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_PATT),n.asc_putFill(new Asc.asc_CFillHatch),n.asc_getFill().asc_putPatternType(this.PatternFillType);var a=Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();a="ffffff"===Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color).get_color().get_hex()&&"ffffff"===a?{color:"4f81bd",effectId:24}:this.FGColor.Color,n.asc_getFill().asc_putColorFg(Common.Utils.ThemeColor.getRgbColor(a)),n.asc_getFill().asc_putColorBg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),i.asc_putFill(n),this.imgprops.asc_putShapeProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_NOFILL:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_NOFILL,!this._noApply){var i=new Asc.asc_CShapeProperty,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_NOFILL),n.asc_putFill(null),i.asc_putFill(n),this.imgprops.asc_putShapeProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}}Common.NotificationCenter.trigger("edit:complete",this)},onColorsBackSelect:function(t,e){if(this.btnBackColor.setColor(e),this.ShapeColor={Value:1,Color:e},this.api&&!this._noApply){var i=new Asc.asc_CShapeProperty,n=new Asc.asc_CShapeFill;"transparent"==this.ShapeColor.Color?(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_NOFILL),n.asc_putFill(null)):(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_SOLID),n.asc_putFill(new Asc.asc_CFillSolid),n.asc_getFill().asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color))),i.asc_putFill(n),this.imgprops.asc_putShapeProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}Common.NotificationCenter.trigger("edit:complete",this)},addNewColor:function(t,e){t.addNewColor("object"==typeof e.color?e.color.color:e.color)},onPatternSelect:function(t,e){if(this.api&&!this._noApply){this.PatternFillType=e.get("type");var i=new Asc.asc_CShapeProperty,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_PATT),n.asc_putFill(new Asc.asc_CFillHatch),n.asc_getFill().asc_putPatternType(this.PatternFillType),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_PATT&&(n.asc_getFill().asc_putColorFg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color)),n.asc_getFill().asc_putColorBg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color))),i.asc_putFill(n),this.imgprops.asc_putShapeProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}Common.Notificati
type:225,subtype:7,iconcls:"gradient-right-bottom"}],this._viewDataRadial=[{offsetx:100,offsety:150,type:2,subtype:5,iconcls:"gradient-radial-center"}],this.btnDirection=new Common.UI.Button({cls:"btn-large-dataview",iconCls:"item-gradient gradient-left",menu:new Common.UI.Menu({style:"min-width: 60px;",menuAlign:"tr-br",items:[{template:i.template('<div id="id-shape-menu-direction" style="width: 175px; margin: 0 5px;"></div>')}]})}),this.btnDirection.on("render:after",function(n){t.mnuDirectionPicker=new Common.UI.DataView({el:e("#id-shape-menu-direction"),parentMenu:n.menu,restoreHeight:174,store:new Common.UI.DataViewStore(t._viewDataLinear),itemTemplate:i.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')})}),this.btnDirection.render(e("#shape-button-direction")),this.mnuDirectionPicker.on("item:click",i.bind(this.onSelectGradient,this,this.btnDirection)),this.fillControls.push(this.btnDirection),this.sldrGradient=new Common.UI.MultiSliderGradient({el:e("#shape-slider-gradient"),width:125,minValue:0,maxValue:100,values:[0,100]}),this.sldrGradient.on("change",i.bind(this.onGradientChange,this)),this.sldrGradient.on("changecomplete",i.bind(this.onGradientChangeComplete,this)),this.sldrGradient.on("thumbclick",function(e,i){t.GradColor.currentIdx=i;var n=t.GradColor.colors[t.GradColor.currentIdx];t.btnGradColor.setColor(n),t.colorsGrad.select(n,!1)}),this.sldrGradient.on("thumbdblclick",function(e){t.btnGradColor.cmpEl.find("button").dropdown("toggle")}),this.sldrGradient.on("sortthumbs",function(e,n){var o,s=[];i.each(n,function(e,i){s.push(t.GradColor.colors[e]),t.GradColor.currentIdx==e&&(o=i)}),t.OriginalFillType=null,t.GradColor.colors=s,t.GradColor.currentIdx=o}),this.fillControls.push(this.sldrGradient),this.cmbBorderSize=new Common.UI.ComboBorderSizeEditable({el:e("#shape-combo-border-size"),style:"width: 93px;",txtNoBorders:this.txtNoBorders}).on("selected",i.bind(this.onBorderSizeSelect,this)).on("changed:before",i.bind(this.onBorderSizeChanged,this,!0)).on("changed:after",i.bind(this.onBorderSizeChanged,this,!1)).on("combo:blur",i.bind(this.onComboBlur,this,!1)),this.BorderSize=this.cmbBorderSize.store.at(2).get("value"),this.cmbBorderSize.setValue(this.BorderSize),this.lockedControls.push(this.cmbBorderSize),this.cmbBorderType=new Common.UI.ComboBorderType({el:e("#shape-combo-border-type"),style:"width: 93px;",menuStyle:"min-width: 93px;"}).on("selected",i.bind(this.onBorderTypeSelect,this)).on("combo:blur",i.bind(this.onComboBlur,this,!1)),this.BorderType=Asc.c_oDashType.solid,this.cmbBorderType.setValue(this.BorderType),this.lockedControls.push(this.cmbBorderType),this.btnChangeShape=new Common.UI.Button({cls:"btn-icon-default",iconCls:"btn-change-shape",menu:new Common.UI.Menu({menuAlign:"tr-br",cls:"menu-shapes",items:[]})}),this.btnChangeShape.render(e("#shape-btn-change")),this.lockedControls.push(this.btnChangeShape),e(this.el).on("click","#shape-advanced-link",i.bind(this.openAdvancedSettings,this)),this.linkAdvanced=e("#shape-advanced-link")},createDelayedElements:function(){this.createDelayedControls();var t=[0,1,3,2,4,53,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52];this.patternViewData=[];for(var e=0;e<13;e++)for(var i=0;i<4;i++){var n=4*e+i;this.patternViewData[n]={offsetx:28*i,offsety:28*e,type:t[n]}}this.patternViewData.splice(this.patternViewData.length-2,2);for(var e=0;e<this.patternViewData.length;e++)this.patternViewData[e].id=Common.UI.getId();this.cmbPattern.menuPicker.store.add(this.patternViewData),this.cmbPattern.menuPicker.store.length>0&&(this.cmbPattern.fillComboView(this.cmbPattern.menuPicker.store.at(0),!0),this.PatternFillType=this.patternViewData[0].type),this.fillAutoShapes(),this.UpdateThemeColors(),this._initSettings=!1},onInitStandartTextures:function(t){var n=this;if(t&&t.length>0){this.btnTexture||(this.btnTexture=new Common.UI.ComboBox({el:e("#shape-combo-fill-texture"),template:i.template(['<div class="input-group
this.GradRadialDirectionIdx>=0?this.btnDirection.setIconCls("item-gradient "+this._viewDataRadial[this.GradRadialDirectionIdx].iconcls):this.btnDirection.setIconCls(""));if(this.api&&!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD),n.asc_putFill(new Asc.asc_CFillGrad),n.asc_getFill().asc_putGradType(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(n.asc_getFill().asc_putLinearAngle(6e4*this.GradLinearDirectionType),n.asc_getFill().asc_putLinearScale(!0)),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}Common.NotificationCenter.trigger("edit:complete",this)},onSelectGradient:function(t,e,n,o){if(!this._noApply){var s={};if(i.isFunction(o.toJSON)){if(!o.get("selected"))return;s=o.toJSON()}else s=o;if(this.btnDirection.setIconCls("item-gradient "+s.iconcls),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR?this.GradLinearDirectionType=s.type:this.GradRadialDirectionIdx=0,this.api&&this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR){var a=new Asc.asc_TextArtProperties,r=new Asc.asc_CShapeFill;r.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD),r.asc_putFill(new Asc.asc_CFillGrad),r.asc_getFill().asc_putGradType(this.GradFillType),r.asc_getFill().asc_putLinearAngle(6e4*s.type),r.asc_getFill().asc_putLinearScale(!0),a.asc_putFill(r),this.shapeprops.put_TextArtProperties(a),this.api.asc_setGraphicObjectProps(this.imgprops)}Common.NotificationCenter.trigger("edit:complete",this)}},onColorsGradientSelect:function(t,e){if(this.btnGradColor.setColor(e),this.GradColor.colors[this.GradColor.currentIdx]=e,this.sldrGradient.setColorValue(Common.Utils.String.format("#{0}","object"==typeof e?e.color:e)),this.api&&!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD),n.asc_putFill(new Asc.asc_CFillGrad),n.asc_getFill().asc_putGradType(this.GradFillType),n.asc_getFill().asc_putColors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD&&(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(n.asc_getFill().asc_putLinearAngle(6e4*this.GradLinearDirectionType),n.asc_getFill().asc_putLinearScale(!0)),n.asc_getFill().asc_putPositions([1e3*this.GradColor.values[0],1e3*this.GradColor.values[1]])),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}Common.NotificationCenter.trigger("edit:complete",this)},onGradientChange:function(t,e,n){this.GradColor.values=t.getValues(),this._sliderChanged=!0,this.api&&!this._noApply&&this._sendUndoPoint&&(this.api.setStartPointHistory(),this._sendUndoPoint=!1,this.updateslider=setInterval(i.bind(this._gradientApplyFunc,this),100))},onGradientChangeComplete:function(t,e,i){clearInterval(this.updateslider),this._sliderChanged=!0,this.api.setEndPointHistory(),this._gradientApplyFunc(),this._sendUndoPoint=!0},_gradientApplyFunc:function(){if(this._sliderChanged){var t=new Asc.asc_TextArtProperties,e=new Asc.asc_CShapeFill;e.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD),e.asc_putFill(new Asc.asc_CFillGrad),e.asc_getFill().asc_putGradType(this.GradFillType),e.asc_getFill().asc_putPositions([1e3*this.GradColor.values[0],1e3*this.GradColor.values[1]]),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD&&(this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(e.asc_getFill().asc_putLinearAngle(6e4*this.GradLinearDirectionType),e.asc_getFill().asc_putLinearScale(!0)),e.asc_getFill().asc_putColors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])),t.asc_putFill(e),this.shapeprops.put_TextArtProperties(t),this.api.asc_setGraphicObjectProps(this.imgprops),this._sliderChanged=!1}},applyBorderSize:function(t){if(t=parseFloat(t),t=isNaN(t)?0:Math.max(0,Math.min(1584,t)),this.BorderSize=t,this.api&&!this._noApply){var e=new Asc.asc_TextArtProper
this.colorsBorder.on("select",i.bind(this.onColorsBorderSelect,this)),e(this.el).on("click","#textart-border-color-new",i.bind(this.addNewColor,this,this.colorsBorder,this.btnBorderColor)),this.btnBackColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="textart-back-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="textart-back-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnBackColor.render(e("#textart-back-color-btn")),this.btnBackColor.setColor("transparent"),this.lockedControls.push(this.btnBackColor),this.colorsBack=new Common.UI.ThemeColorPalette({el:e("#textart-back-color-menu"),value:"transparent",transparent:!0}),this.colorsBack.on("select",i.bind(this.onColorsBackSelect,this)),e(this.el).on("click","#textart-back-color-new",i.bind(this.addNewColor,this,this.colorsBack,this.btnBackColor)),this.btnFGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="textart-foreground-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="textart-foreground-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnFGColor.render(e("#textart-foreground-color-btn")),this.btnFGColor.setColor("000000"),this.lockedControls.push(this.btnFGColor),this.colorsFG=new Common.UI.ThemeColorPalette({el:e("#textart-foreground-color-menu"),value:"000000"}),this.colorsFG.on("select",i.bind(this.onColorsFGSelect,this)),e(this.el).on("click","#textart-foreground-color-new",i.bind(this.addNewColor,this,this.colorsFG,this.btnFGColor)),this.btnBGColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="textart-background-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="textart-background-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnBGColor.render(e("#textart-background-color-btn")),this.btnBGColor.setColor("ffffff"),this.lockedControls.push(this.btnBGColor),this.colorsBG=new Common.UI.ThemeColorPalette({el:e("#textart-background-color-menu"),value:"ffffff"}),this.colorsBG.on("select",i.bind(this.onColorsBGSelect,this)),e(this.el).on("click","#textart-background-color-new",i.bind(this.addNewColor,this,this.colorsBG,this.btnBGColor)),this.btnGradColor=new Common.UI.ColorButton({style:"width:45px;",menu:new Common.UI.Menu({items:[{template:i.template('<div id="textart-gradient-color-menu" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:i.template('<a id="textart-gradient-color-new" style="padding-left:12px;">'+this.textNewColor+"</a>")}]})}),this.btnGradColor.render(e("#textart-gradient-color-btn")),this.btnGradColor.setColor("000000"),this.lockedControls.push(this.btnGradColor),this.colorsGrad=new Common.UI.ThemeColorPalette({el:e("#textart-gradient-color-menu"),value:"000000"}),this.colorsGrad.on("select",i.bind(this.onColorsGradientSelect,this)),e(this.el).on("click","#textart-gradient-color-new",i.bind(this.addNewColor,this,this.colorsGrad,this.btnGradColor))),this.colorsBorder.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBack.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsFG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsBG.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors()),this.colorsGrad.updateColors(Common.Utils.ThemeColor.getEffectColors(),Common.Utils.ThemeColor.getStandartColors())},_pt2mm:function(t){return 25.4*t/72},_mm2pt:function(t){return 72*t/25.4},ShowHideElem:function(t){this.FillColorContainer.toggleClass("settings-hidden",t!==Asc.c_oAscFill.FILL_TYPE_SOLID),this.FillImageContainer.toggleClass("settings-hidden",t!==Asc.c_oAscFill.FILL_TYPE_BLIP),this.Fi
this.rightmenu.on("render:after",_.bind(this.onRightMenuAfterRender,this))},onRightMenuAfterRender:function(t){t.shapeSettings.application=t.textartSettings.application=this.getApplication(),this._settings=[],this._settings[Common.Utils.documentSettingsType.Paragraph]={panelId:"id-paragraph-settings",panel:t.paragraphSettings,btn:t.btnText,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Image]={panelId:"id-image-settings",panel:t.imageSettings,btn:t.btnImage,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Shape]={panelId:"id-shape-settings",panel:t.shapeSettings,btn:t.btnShape,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.TextArt]={panelId:"id-textart-settings",panel:t.textartSettings,btn:t.btnTextArt,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Chart]={panelId:"id-chart-settings",panel:t.chartSettings,btn:t.btnChart,hidden:1,locked:!1},this._settings[Common.Utils.documentSettingsType.Table]={panelId:"id-table-settings",panel:t.tableSettings,btn:t.btnTable,hidden:1,locked:!1}},setApi:function(t){this.api=t,this.api.asc_registerCallback("asc_onCoAuthoringDisconnect",_.bind(this.onCoAuthoringDisconnect,this)),Common.NotificationCenter.on("api:disconnect",_.bind(this.onCoAuthoringDisconnect,this)),Common.NotificationCenter.on("cells:range",_.bind(this.onCellsRange,this))},setMode:function(t){this.editMode=t.isEdit},onRightMenuClick:function(t,e,i){if(!i&&this.editMode){var n=this._settings[e].panel,o=this._settings[e].props;o&&n&&n.ChangeSettings.call(n,o)}Common.NotificationCenter.trigger("layout:changed","rightmenu")},onSelectionChanged:function(t){if(!this.rangeSelectionMode){var e=[],i=t.asc_getFlags().asc_getSelectionType(),n=t.asc_getFormatTableInfo(),o=t.asc_getSparklineInfo();i!=Asc.c_oAscSelectionType.RangeImage&&i!=Asc.c_oAscSelectionType.RangeShape&&i!=Asc.c_oAscSelectionType.RangeChart&&i!=Asc.c_oAscSelectionType.RangeChartText&&i!=Asc.c_oAscSelectionType.RangeShapeText||(e=this.api.asc_getGraphicObjectProps()),e.length<=0&&!n&&!o&&!this.rightmenu.minimizedMode&&(this.rightmenu.clearSelection(),this._openRightMenu=!0);var s=t.asc_getLocked(),a=!0===t.asc_getLockedTable(),r=!0===t.asc_getLockedSparkline();this.onFocusObject(e,n,o,s,a,r)}},onFocusObject:function(t,e,i,n,o,s){if(this.editMode){for(var a=0;a<this._settings.length;++a)this._settings[a]&&(this._settings[a].hidden=1,this._settings[a].locked=!1);for(a=0;a<t.length;++a){var r=t[a].asc_getObjectType(),l=this.getDocumentSettingsType(r);if(!(void 0===l||l>=this._settings.length||void 0===this._settings[l])){var c=t[a].asc_getObjectValue();l==Common.Utils.documentSettingsType.Image&&(null!==c.asc_getChartProperties()?(l=Common.Utils.documentSettingsType.Chart,this._settings[l].btn.updateHint(this.rightmenu.txtChartSettings)):null!==c.asc_getShapeProperties()&&(l=Common.Utils.documentSettingsType.Shape,c.asc_getShapeProperties().asc_getTextArtProperties()&&(this._settings[Common.Utils.documentSettingsType.TextArt].props=c,this._settings[Common.Utils.documentSettingsType.TextArt].hidden=0,this._settings[Common.Utils.documentSettingsType.TextArt].locked=c.asc_getLocked()))),this._settings[l].props=c,this._settings[l].hidden=0,this._settings[l].locked=c.asc_getLocked()}}e&&(l=Common.Utils.documentSettingsType.Table,this._settings[l].props=e,this._settings[l].locked=o,this._settings[l].hidden=0),i&&(l=Common.Utils.documentSettingsType.Chart,this._settings[l].props=i,this._settings[l].locked=s,this._settings[l].hidden=0,this._settings[l].btn.updateHint(this.rightmenu.txtSparklineSettings));var h,d=-1,p=-1,m=this.rightmenu.GetActivePane();for(a=0;a<this._settings.length;++a){var u=this._settings[a];void 0!==u&&(u.hidden?(u.btn.isDisabled()||u.btn.setDisabled(!0),m==u.panelId&&(h=-1)):(u.btn.isDisabled()&&u.btn.setDisabled(!1),d=a,u.needShow?(u.needShow=!1,p=a):m==u.panelId&&(h=a),u.panel.setLocked(u.locked)))}if(!this.rightmenu.minimizedMode||this._openRightMenu){var g;p>-1?g=p:d>=0&&h<0?g=d:h>=0&&(g=h),void 0==g&&this._openRightMenu&&d>=0&&(g=d),void 0!==g&&(this.rightmenu.Se
autoHeightTextBox:function(){function i(){l=$(n.scroller.el).scrollTop(),s.scrollHeight>s.clientHeight?(o.css({height:s.scrollHeight+r+"px"}),e.calculateSizeOfContent()):(c=s.clientHeight)>=a&&(o.css({height:a+"px"}),s.scrollHeight>s.clientHeight&&(h=Math.max(s.scrollHeight+r,a),o.css({height:h+"px"})),e.calculateSizeOfContent(),e.setLeftTop(t.arrowPosX,t.arrowPosY,t.leftX),e.calculateSizeOfContent()),n.scroller.scrollTop(l),n.autoScrollToEditButtons()}var n=this,o=this.$el.find("textarea"),s=null,a=50,r=0,l=0,c=0,h=0;o&&o.length&&(s=o.get(0))&&(r=.25*parseInt(o.css("lineHeight"),10),i(),o.bind("input propertychange",i)),this.textBox=o},clearTextBoxBind:function(){this.textBox&&(this.textBox.unbind("input propertychange"),this.textBox=void 0)},autoScrollToEditButtons:function(){var t=$("#id-comments-change-popover"),e=null,i=this.el.getBoundingClientRect(),n=0;t.length&&(e=t.get(0).getBoundingClientRect())&&i&&(n=i.bottom-(e.bottom+7))<0&&this.scroller.scrollTop(this.scroller.getScrollTop()-n)}}}());if(a)if(this.commentsView)this.commentsView.render($("#id-comments-popover")),this.commentsView.onResetItems();else{this.commentsView=new a({el:$("#id-comments-popover"),store:t.store,itemTemplate:_.template(n(i,{textAddReply:e.textAddReply,textAdd:e.textAdd,textCancel:e.textCancel,textEdit:e.textEdit,textReply:e.textReply,textClose:e.textClose,maxCommLength:Asc.c_oAscMaxCellOrCommentLength}))});var r=function(t,i,n){i.tipsArray&&i.tipsArray.forEach(function(t){t.remove()});var o=[],s=$(i.el).find(".btn-resolve");s.tooltip({title:e.textResolve,placement:"cursor"}),s.each(function(t,e){o.push($(e).data("bs.tooltip").tip())}),s=$(i.el).find(".btn-resolve-check"),s.tooltip({title:e.textOpenAgain,placement:"cursor"}),s.each(function(t,e){o.push($(e).data("bs.tooltip").tip())}),i.tipsArray=o},l=function(){t._isMouseOver=!0},c=function(){t._isMouseOver=!1};this.commentsView.on("item:add",r),this.commentsView.on("item:remove",r),this.commentsView.on("item:change",r),this.commentsView.cmpEl.on("mouseover",l).on("mouseout",c),this.commentsView.on("item:click",function(i,n,o,s){function a(){t.update()}var r,l,c,h,d,p;if(r=$(s.target)){if(l=o.get("editTextInPopover"),c=o.get("showReplyInPopover"),p=o.get("hideAddReply"),h=o.get("uid"),d=r.attr("data-value"),o.get("hint"))return void e.fireEvent("comment:disableHint",[o]);if(r.hasClass("btn-edit"))_.isUndefined(d)?l||(e.fireEvent("comment:closeEditing"),o.set("editTextInPopover",!0),e.fireEvent("comment:show",[h]),this.autoHeightTextBox(),t.calculateSizeOfContent(),t.setLeftTop(t.arrowPosX,t.arrowPosY,t.leftX),t.calculateSizeOfContent(),a(),t.hookTextBox(),this.autoScrollToEditButtons(),this.setFocusToTextBox()):(e.fireEvent("comment:closeEditing",[h]),e.fireEvent("comment:editReply",[h,d,!0]),this.replyId=d,this.autoHeightTextBox(),t.calculateSizeOfContent(),t.setLeftTop(t.arrowPosX,t.arrowPosY,t.leftX),t.calculateSizeOfContent(),a(),t.hookTextBox(),this.autoScrollToEditButtons(),this.setFocusToTextBox());else if(r.hasClass("btn-delete"))_.isUndefined(d)?e.fireEvent("comment:remove",[h]):(e.fireEvent("comment:removeReply",[h,d]),t.calculateSizeOfContent(),t.setLeftTop(t.arrowPosX,t.arrowPosY,t.leftX),t.calculateSizeOfContent()),e.fireEvent("comment:closeEditing"),a();else if(r.hasClass("user-reply"))e.fireEvent("comment:closeEditing"),o.set("showReplyInPopover",!0),t.calculateSizeOfContent(),t.setLeftTop(t.arrowPosX,t.arrowPosY,t.leftX),t.calculateSizeOfContent(),a(),this.autoHeightTextBox(),t.hookTextBox(),this.autoScrollToEditButtons(),this.setFocusToTextBox();else if(r.hasClass("btn-reply",!1))c&&(this.clearTextBoxBind(),e.fireEvent("comment:addReply",[h,this.getActiveTextBoxVal()]),e.fireEvent("comment:closeEditing"),a());else if(r.hasClass("btn-close",!1))e.fireEvent("comment:closeEditing",[h]),t.calculateSizeOfContent(),e.fireEvent("comment:show",[h]),a();else if(r.hasClass("btn-inner-edit",!1)){if(o.get("dummy"))return void e.fireEvent("comment:addDummyComment",[this.getActiveTextBoxVal()]);this.clearTextBoxBind(),_.isUndefined(this.replyId)?l&&(e.fireEvent("comment:change",[h,t
checkable:!0}),this.miMatchWord=new Common.UI.MenuItem({caption:this.options.matchwordstr||this.textWholeWords,checkable:!0}),this.miHighlight=new Common.UI.MenuItem({caption:this.textHighlight,checkable:!0}),this.btnOptions=new Common.UI.Button({id:"search-btn-options",cls:"btn-toolbar",iconCls:"btn-settings",menu:new Common.UI.Menu({items:[this.miMatchCase,this.miMatchWord,this.miHighlight]})}),this.options.extraoptions&&(this.btnOptions.menu.addItem({caption:"--"}),this.options.extraoptions.forEach(function(t){this.btnOptions.menu.addItem(t)},this)),this.btnOptions.render(this.$window.find("#search-placeholder-btn-options")),this.options.matchcase||this.miMatchCase.hide(),this.options.matchword||this.miMatchWord.hide(),this.options.markresult?this.options.markresult.applied&&this.miHighlight.setChecked(!0,!0):this.miHighlight.hide(),"search"===this.options.mode&&$(this.$window.find(".input-row").get(2)).hide(),this.txtSearch=this.$window.find("#sd-text-search"),this.txtReplace=this.$window.find("#sd-text-replace"),this.lblReplace=this.$window.find("#search-label-replace"),this.miHighlight.on("toggle",_.bind(this.onHighlight,this)),this.$window.find(".btn[result=back]").on("click",_.bind(this.onBtnClick,this,"back")),this.$window.find(".btn[result=next]").on("click",_.bind(this.onBtnClick,this,"next")),this.$window.find(".btn[result=replace]").on("click",_.bind(this.onBtnClick,this,"replace")),this.$window.find(".btn[result=replaceall]").on("click",_.bind(this.onBtnClick,this,"replaceall")),this.$window.find("label[result=replaceshow]").on("click",_.bind(this.onShowReplace,this)),this.txtSearch.on("keydown",null,"search",_.bind(this.onKeyPress,this)),this.txtReplace.on("keydown",null,"replace",_.bind(this.onKeyPress,this)),this.on("animate:before",_.bind(this.focus,this)),this},show:function(t){Common.UI.Window.prototype.show.call(this),!this.mode&&!t&&(t="search"),t&&this.mode!=t&&this.setMode(t),this.options.markresult&&this.miHighlight.checked&&this.fireEvent("search:highlight",[this,!0]),this.focus()},focus:function(){var t=this;setTimeout(function(){t.txtSearch.focus(),t.txtSearch.select()},10)},onKeyPress:function(t){this.isLocked()||(t.keyCode==Common.UI.Keys.RETURN?("search"==t.data?this.onBtnClick("next",t):"replace"==t.data&&"replace"==this.mode&&this.onBtnClick("replace",t),t.preventDefault(),t.stopPropagation()):t.keyCode==Common.UI.Keys.ESC&&$(".asc-loadmask").length<1&&(this.hide(),t.preventDefault(),t.stopPropagation()))},onBtnClick:function(t,e){if(!$(".asc-loadmask").length){var i={textsearch:this.txtSearch.val(),textreplace:this.txtReplace.val(),matchcase:this.miMatchCase.checked,matchword:this.miMatchWord.checked,highlight:this.miHighlight.checked};this.fireEvent("search:"+t,[this,i])}},setMode:function(t){this.mode=t;var e=this.$window.find(".input-row");"no-replace"===t?(this.setTitle(this.textTitle2),e.eq(1).hide(),e.eq(2).hide(),this.$window.find(".btn[result=replace]").hide(),this.$window.find(".btn[result=replaceall]").hide(),this.options.matchcase||this.options.matchword||this.options.markresult||(this.txtSearch.addClass("clear"),this.btnOptions.hide()),this.setHeight(170)):(this.txtSearch.removeClass("clear"),this.setTitle(this.textTitle),"search"===t?(e.eq(2).show(),this.lblReplace.text(this.txtBtnReplace),e.eq(1).hide(),this.$window.find(".btn[result=replace]").hide(),this.$window.find(".btn[result=replaceall]").hide(),this.setHeight(200)):(e.eq(2).show(),this.lblReplace.text(this.txtBtnHideReplace),e.eq(1).show(),this.$window.find(".btn[result=replace]").show(),this.$window.find(".btn[result=replaceall]").show(),this.setHeight(230)))},onShowReplace:function(t){this.setMode("replace"==this.mode?"search":"replace");var e=this;_.defer(function(){"replace"==e.mode?e.txtReplace.focus():e.txtSearch.focus()},300)},onHighlight:function(t,e){this.fireEvent("search:highlight",[this,e])},getSettings:function(){return{textsearch:this.txtSearch.val(),casesensitive:this.miMatchCase.checked,wholewords:this.miMatchWord.checked}},textTitle:"Search & Replace",textTitle2:"Search",txtBtnReplace:"Replace",txt
;break;case"print":Common.NotificationCenter.trigger("print",this.leftMenu);break;case"exit":Common.NotificationCenter.trigger("goback");break;case"edit":Common.Gateway.requestEditRights();break;case"new":i?n=!1:this.onCreateNew(void 0,"blank");break;case"rename":var o=this,s=o.api.asc_getDocumentName();new Common.Views.RenameDialog({filename:s,handler:function(t,e){"ok"!=t||_.isEmpty(e.trim())||s===e.trim()||Common.Gateway.requestRename(e),Common.NotificationCenter.trigger("edit:complete",o)}}).show();break;default:n=!1}n&&(t.hide(),this.leftMenu.btnFile.toggle(!1,!0))},clickSaveAsFormat:function(t,e){e==Asc.c_oAscFileType.CSV?Common.UI.warning({closable:!1,title:this.textWarning,msg:this.warnDownloadAs,buttons:["ok","cancel"],callback:_.bind(function(i){"ok"==i&&(this.api.asc_DownloadAs(e),t.hide(),this.leftMenu.btnFile.toggle(!1,!0))},this)}):(this.api.asc_DownloadAs(e),t.hide(),this.leftMenu.btnFile.toggle(!1,!0))},applySettings:function(t){this.api.asc_setFontRenderingMode(parseInt(Common.localStorage.getItem("sse-settings-fontrender")));var e=Common.localStorage.getItem("sse-settings-livecomment"),i=Common.localStorage.getItem("sse-settings-resolvedcomment");null===e||0!=parseInt(e)?this.api.asc_showComments(!(null!==i&&0==parseInt(i))):this.api.asc_hideComments(),this.mode.isEdit&&!this.mode.isOffline&&this.mode.canCoAuthoring&&(e=Common.localStorage.getItem("sse-settings-coauthmode"),this.api.asc_SetFastCollaborative(null===e||1==parseInt(e))),this.mode.isEdit&&(e=Common.localStorage.getItem("sse-settings-autosave"),this.api.asc_setAutoSaveGap(parseInt(e))),e=Common.localStorage.getItem("sse-settings-func-locale"),e&&(e=SSE.Views.FormulaLang.get(e)),null!==e&&this.api.asc_setLocalization(e),e=Common.localStorage.getItem("sse-settings-reg-settings"),null!==e&&this.api.asc_setLocale(parseInt(e)),t.hide(),this.leftMenu.btnFile.toggle(!1,!0),this.leftMenu.fireEvent("settings:apply")},onCreateNew:function(t,e){if(!0===this.mode.nativeApp)this.api.asc_openNewDocument("blank"==e?"":e);else{var i=window.open("blank"==e?this.mode.createUrl:e,"_blank");i&&i.focus()}t&&(t.hide(),this.leftMenu.btnFile.toggle(!1,!0))},onOpenRecent:function(t,e){t&&(t.hide(),this.leftMenu.btnFile.toggle(!1,!0));var i=window.open(e);i&&i.focus(),Common.component.Analytics.trackEvent("Open Recent")},clickToolbarSettings:function(t){this.leftMenu.btnFile.pressed&&"opts"==this.leftMenu.btnFile.panel.active?this.leftMenu.close():this.leftMenu.showMenu("file:opts")},clickStatusbarUsers:function(){this.leftMenu.btnFile.panel.panels.rights.changeAccessRights()},onHideChat:function(){$(this.leftMenu.btnChat.el).blur(),Common.NotificationCenter.trigger("layout:changed","leftmenu")},onQuerySearch:function(t,e,i){if(i.textsearch&&i.textsearch.length){var n=this.dlgSearch.findOptions;if(n.asc_setFindWhat(i.textsearch),n.asc_setScanForward("back"!=t),n.asc_setIsMatchCase(i.matchcase),n.asc_setIsWholeCell(i.matchword),n.asc_setScanOnOnlySheet(this.dlgSearch.menuWithin.menu.items[0].checked),n.asc_setScanByRows(this.dlgSearch.menuSearch.menu.items[0].checked),n.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value),!this.api.asc_findText(n)){var o=this;Common.UI.info({msg:this.textNoTextFound,callback:function(){o.dlgSearch.focus()}})}}},onQueryReplace:function(t,e){if(!_.isEmpty(e.textsearch)){this.api.isReplaceAll=!1;var i=this.dlgSearch.findOptions;i.asc_setFindWhat(e.textsearch),i.asc_setReplaceWith(e.textreplace),i.asc_setIsMatchCase(e.matchcase),i.asc_setIsWholeCell(e.matchword),i.asc_setScanOnOnlySheet(this.dlgSearch.menuWithin.menu.items[0].checked),i.asc_setScanByRows(this.dlgSearch.menuSearch.menu.items[0].checked),i.asc_setLookIn(this.dlgSearch.menuLookin.menu.items[0].checked?Asc.c_oAscFindLookIn.Formulas:Asc.c_oAscFindLookIn.Value),i.asc_setIsReplaceAll(!1),this.api.asc_replaceText(i)}},onQueryReplaceAll:function(t,e){if(!_.isEmpty(e.textsearch)){this.api.isReplaceAll=!0;var i=this.dlgSearch.findOptions;i.asc_setFindWhat(e.textsearch),i.asc_setReplaceWith(e.textreplace),i.asc_setIs
2155:["quz-EC","Runasimi (Ecuador)"],3179:["quz-PE","Runasimi (Piruw)"],24:["ro","Română"],1048:["ro-RO","Română (România)"],2072:["ro-MD","Română (Moldova)"],23:["rm","Rumantsch"],1047:["rm-CH","Rumantsch (Svizra)"],25:["ru","Русский"],1049:["ru-RU","Русский (Россия)"],2073:["ru-MD","Русский (Молдавия)"],28731:["smn","Sämikielâ"],31803:["smj","Julevusámegiella"],59:["se","Davvisámegiella"],29755:["sms","Sääm´ǩiõll"],30779:["sma","åarjelsaemiengiele"],9275:["smn-FI","Sämikielâ (Suomâ)"],4155:["smj-NO","Julevusámegiella (Vuodna)"],5179:["smj-SE","Julevusámegiella (Svierik)"],3131:["se-FI","Davvisámegiella (Suopma)"],1083:["se-NO","Davvisámegiella (Norga)"],2107:["se-SE","Davvisámegiella (Ruoŧŧa)"],8251:["sms-FI","Sääm´ǩiõll (Lää´ddjânnam)"],6203:["sma-NO","åarjelsaemiengiele (Nöörje)"],7227:["sma-SE","åarjelsaemiengiele (Sveerje)"],79:["sa","संस्कृत"],1103:["sa-IN","संस्कृत (भारतम्)"],145:["gd","Gàidhlig"],1169:["gd-GB","Gàidhlig (An Rìoghachd Aonaichte)"],31770:["sr","Srpski"],27674:["sr-Cyrl","Српски (Ћирилица)"],7194:["sr-Cyrl-BA","Српски (Босна и Херцеговина)"],12314:["sr-Cyrl-ME","Српски (Црна Гора)"],3098:["sr-Cyrl-CS","Српски (Србија и Црна Гора (Претходно))"],10266:["sr-Cyrl-RS","Српски (Србија)"],28698:["sr-Latn","Srpski (Latinica)"],6170:["sr-Latn-BA","Srpski (Bosna i Hercegovina)"],11290:["sr-Latn-ME","Srpski (Crna Gora)"],2074:["sr-Latn-CS","Srpski (Srbija i Crna Gora (Prethodno))"],9242:["sr-Latn-RS","Srpski (Srbija, Latinica)"],108:["nso","Sesotho sa Leboa"],1132:["nso-ZA","Sesotho sa Leboa (Afrika Borwa)"],50:["tn","Setswana"],1074:["tn-ZA","Setswana (Aforika Borwa)"],91:["si","සිංහ"],1115:["si-LK","සිංහ (ශ්‍රී ලංකා)"],27:["sk","Slovenčina"],1051:["sk-SK","Slovenčina (Slovenská republika)"],36:["sl","Slovenski"],1060:["sl-SI","Slovenski (Slovenija)"],10:["es","Español"],11274:["es-AR","Español (Argentina)"],16394:["es-BO","Español (Bolivia)"],13322:["es-CL","Español (Chile)"],9226:["es-CO","Español (Colombia)"],5130:["es-CR","Español (Costa Rica)"],7178:["es-DO","Español (República Dominicana)"],12298:["es-EC","Español (Ecuador)"],17418:["es-SV","Español (El Salvador)"],4106:["es-GT","Español (Guatemala)"],18442:["es-HN","Español (Honduras)"],2058:["es-MX","Español (México)"],19466:["es-NI","Español (Nicaragua)"],6154:["es-PA","Español (Panamá)"],15370:["es-PY","Español (Paraguay)"],10250:["es-PE","Español (Perú)"],20490:["es-PR","Español (Puerto Rico)"],3082:["es-ES","Español (España, alfabetización internacional)"],21514:["es-US","Español (Estados Unidos)"],14346:["es-UY","Español (Uruguay)"],8202:["es-VE","Español (Republica Bolivariana de Venezuela)"],1034:["es-ES_tradnl","Spanish"],29:["sv","Svenska"],2077:["sv-FI","Svenska (Finland)"],1053:["sv-SE","Svenska (Sverige)"],90:["syr","ܣܘܪܝܝܐ‏"],1114:["syr-SY","ܣܘܪܝܝܐ (سوريا)"],40:["tg","Тоҷикӣ"],31784:["tg-Cyrl","Тоҷикӣ"],1064:["tg-Cyrl-TJ","Тоҷикӣ (Тоҷикистон)"],95:["tzm","Tamazight"],31839:["tzm-Latn","Tamazight (Latin)"],2143:["tzm-Latn-DZ","Tamazight (Djazaïr)"],73:["ta","தமிழ்"],1097:["ta-IN","தமிழ் (இந்தியா)"],68:["tt","Татар"],1092:["tt-RU","Татар (Россия)"],74:["te","తెలుగు"],1098:["te-IN","తెలుగు (భారత దేశం)"],30:["th","ไทย"],1054:["th-TH","ไทย (ไทย)"],81:["bo","བོད་ཡིག"],1105:["bo-CN","བོད་ཡིག (ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།)"],31:["tr","Türkçe"],1055:["tr-TR","Türkçe (Türkiye)"],66:["tk","Türkmençe"],1090:["tk-TM","Türkmençe (Türkmenistan)"],34:["uk","Українська"],1058:["uk-UA","Українська (Україна)"],46:["hsb","Hornjoserbšćina"],1070:["hsb-DE","Hornjoserbšćina (Němska)"],32:["u
var e=this,i=this._state.lostEditingRights;this._state.lostEditingRights=!this._state.lostEditingRights,this.api.asc_coAuthoringDisconnect(),this.getApplication().getController("LeftMenu").leftMenu.getMenu("file").panels.rights.onLostEditRights(),Common.NotificationCenter.trigger("api:disconnect"),i||Common.UI.warning({title:this.notcriticalErrorTitle,maxwidth:600,msg:_.isEmpty(t.message)?this.warnProcessRightsChange:t.message,callback:function(){e._state.lostEditingRights=!1,e.onEditComplete()}})}},onDownloadAs:function(){this.api.asc_DownloadAs(Asc.c_oAscFileType.XLSX,!0)},onProcessMouse:function(t){if("mouseup"==t.type){var e=document.getElementById("editor_sdk");if(e){var i=e.getBoundingClientRect(),n=t.event||{};this.api.asc_onMouseUp(n,t.x-i.left,t.y-i.top)}}},goBack:function(t){var e=this.appOptions.customization.goback.url;t?window.open(e,"_blank"):parent.location.href=e},onEditComplete:function(t,e){e&&e.restorefocus&&this.api.isCEditorFocused?(this.formulaInput.blur(),this.formulaInput.focus()):(this.getApplication().getController("DocumentHolder").getView("DocumentHolder").focus(),this.api.isCEditorFocused=!1)},onSelectionChanged:function(t){this._isChartDataReady||(this._isChartDataReady=!0,Common.Gateway.internalMessage("chartDataReady"))},onLongActionBegin:function(t,e){var i={id:e,type:t};this.stackLongActions.push(i),this.setLongActionView(i)},onLongActionEnd:function(t,e){var i={id:e,type:t};this.stackLongActions.pop(i),this.headerView.setDocumentCaption(this.api.asc_getDocumentName()),this.updateWindowTitle(this.api.asc_isDocumentModified(),!0),t===Asc.c_oAscAsyncActionType.BlockInteraction&&e==Asc.c_oAscAsyncAction.Open&&(Common.Gateway.internalMessage("documentReady",{}),this.onDocumentReady()),i=this.stackLongActions.get({type:Asc.c_oAscAsyncActionType.Information}),i&&this.setLongActionView(i),e==Asc.c_oAscAsyncAction.Save&&this.toolbarView&&this.toolbarView.synchronizeChanges(),i=this.stackLongActions.get({type:Asc.c_oAscAsyncActionType.BlockInteraction}),i?this.setLongActionView(i):(this.loadMask&&(!this.loadMask.isVisible()||this.dontCloseDummyComment||this.dontCloseChat||this.api.asc_enableKeyEvents(!0),this.loadMask.hide()),t==Asc.c_oAscAsyncActionType.BlockInteraction&&(e!=Asc.c_oAscAsyncAction.LoadDocumentFonts&&e!=Asc.c_oAscAsyncAction.ApplyChanges||!this.dontCloseDummyComment&&!this.dontCloseChat)&&this.onEditComplete(this.loadMask,{restorefocus:!0}))},setLongActionView:function(t){var e="";switch(t.id){case Asc.c_oAscAsyncAction.Open:e=this.openTitleText;break;case Asc.c_oAscAsyncAction.Save:e=this.saveTitleText;break;case Asc.c_oAscAsyncAction.ForceSaveTimeout:case Asc.c_oAscAsyncAction.ForceSaveButton:break;case Asc.c_oAscAsyncAction.LoadDocumentFonts:e=this.loadFontsTitleText;break;case Asc.c_oAscAsyncAction.LoadDocumentImages:e=this.loadImagesTitleText;break;case Asc.c_oAscAsyncAction.LoadFont:e=this.loadFontTitleText;break;case Asc.c_oAscAsyncAction.LoadImage:e=this.loadImageTitleText;break;case Asc.c_oAscAsyncAction.DownloadAs:e=this.downloadTitleText;break;case Asc.c_oAscAsyncAction.Print:e=this.printTitleText;break;case Asc.c_oAscAsyncAction.UploadImage:e=this.uploadImageTitleText;break;case Asc.c_oAscAsyncAction.Recalc:e=this.titleRecalcFormulas;break;case Asc.c_oAscAsyncAction.SlowOperation:e=this.textPleaseWait;break;case Asc.c_oAscAsyncAction.PrepareToSave:e=this.savePreparingText;break;case-255:e=this.txtEditingMode;break;case-256:e=this.loadingDocumentTitleText;break;default:"string"==typeof t.id&&(e=t.id)}t.type==Asc.c_oAscAsyncActionType.BlockInteraction&&(!this.loadMask&&(this.loadMask=new Common.UI.LoadMask({owner:$("#viewport")})),this.loadMask.setTitle(e),this.isShowOpenDialog||(this.api.asc_enableKeyEvents(!1),this.loadMask.show()))},onApplyEditRights:function(t){t&&!t.allowed&&Common.UI.info({title:this.requestEditFailedTitleText,msg:t.message||this.requestEditFailedMessageText})},onDocumentReady:function(){function t(){if(!window.AscDesktopEditor){var e=[];Common.Utils.isIE9m&&e.push(i.warnBrowserIE9),e.length&&i.showTips(e)}document.removeEventListener("visibilityc
this.api&&this.api.asc_closeCellEditor()},setMergeData:function(t){"object"==typeof t&&this.api&&(this.api.asc_setData(t),this.isFrameClosed=!1)},getMergeData:function(){if(this.api){var t=this.api.asc_getData();"object"==typeof t&&Common.Gateway.internalMessage("mergeData",{data:t})}},unitsChanged:function(t){var e=Common.localStorage.getItem("sse-settings-unit");Common.Utils.Metric.setCurrentMetric(null!==e?parseInt(e):Common.Utils.Metric.getDefaultMetric()),this.getApplication().getController("RightMenu").updateMetricUnit(),this.getApplication().getController("Print").getView("MainSettingsPrint").updateMetricUnit()},_compareActionStrong:function(t,e){return t.id===e.id&&t.type===e.type},_compareActionWeak:function(t,e){return t.type===e.type},onContextMenu:function(t){var e=t.target.getAttribute("data-can-copy"),i=t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement;if(i&&"false"===e||!i&&"true"!==e)return t.stopPropagation(),t.preventDefault(),!1},onNamedRangeLocked:function(){$(".asc-window.modal.alert:visible").length<1&&Common.UI.alert({closable:!1,msg:this.errorCreateDefName,title:this.notcriticalErrorTitle,iconCls:"warn",buttons:["ok"],callback:_.bind(function(t){this.onEditComplete()},this)})},onTryUndoInFastCollaborative:function(){var t=window.localStorage.getItem("sse-hide-try-undoredo");t&&1==parseInt(t)||Common.UI.info({width:500,msg:this.textTryUndoRedo,iconCls:"info",buttons:["custom","cancel"],primary:"custom",customButtonText:this.textStrict,dontshow:!0,callback:_.bind(function(t,e){e&&window.localStorage.setItem("sse-hide-try-undoredo",1),"custom"==t&&(Common.localStorage.setItem("sse-settings-coauthmode",0),this.api.asc_SetFastCollaborative(!1),this._state.fastCoauth=!1),this.onEditComplete()},this)})},onAuthParticipantsChanged:function(t){var e=0;_.each(t,function(t){t.asc_getView()||e++}),this._state.usersCount=e},applySettings:function(){if(this.appOptions.isEdit&&!this.appOptions.isOffline&&this.appOptions.canCoAuthoring){var t=Common.localStorage.getItem("sse-settings-coauthmode"),e=this._state.fastCoauth;this._state.fastCoauth=null===t||1==parseInt(t),this._state.fastCoauth&&!e&&this.toolbarView.synchronizeChanges()}this.appOptions.canForcesave&&(t=Common.localStorage.getItem("sse-settings-forcesave"),this.appOptions.forcesave=null===t?this.appOptions.canForcesave:1==parseInt(t),this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave))},onDocumentName:function(t){this.headerView.setDocumentCaption(t),this.updateWindowTitle(this.api.asc_isDocumentModified(),!0)},onMeta:function(t){var e=this.getApplication(),i=e.getController("LeftMenu").getView("LeftMenu").getMenu("file");e.getController("Viewport").getView("Common.Views.Header").setDocumentCaption(t.title),this.updateWindowTitle(this.api.asc_isDocumentModified(),!0),this.appOptions.spreadsheet.title=t.title,i.loadDocument({doc:this.appOptions.spreadsheet}),i.panels.info.updateInfo(this.appOptions.spreadsheet),Common.Gateway.metaChange(t)},onPrint:function(){this.appOptions.canPrint&&Common.NotificationCenter.trigger("print",this)},onPrintUrl:function(t){if(this.iframePrint&&(this.iframePrint.parentNode.removeChild(this.iframePrint),this.iframePrint=null),!this.iframePrint){var e=this;this.iframePrint=document.createElement("iframe"),this.iframePrint.id="id-print-frame",this.iframePrint.style.display="none",this.iframePrint.style.visibility="hidden",this.iframePrint.style.position="fixed",this.iframePrint.style.right="0",this.iframePrint.style.bottom="0",document.body.appendChild(this.iframePrint),this.iframePrint.onload=function(){e.iframePrint.contentWindow.focus(),e.iframePrint.contentWindow.print(),e.iframePrint.contentWindow.blur(),window.focus()}}t&&(this.iframePrint.src=t)},requestPlugins:function(t){t&&this.updatePlugins(Common.Utils.getConfigJson(t),!1)},updatePlugins:function(t,e){if(t){var i=e?t.UIpluginsData:t.pluginsData;if(i&&!(i.length<1)){var n=[],o=_.isEmpty(t.url)?"":t.url;if(""!==o&&console.warn("Obsolete: The url parameter is deprecated. Please check the documentation for new plugin connecti
template:_.template(['<table class="main"><tbody>','<tr class="comments">','<td class="left"><label><%= scope.txtLiveComment %></label></td>','<td class="right"><div id="fms-chb-live-comment"/></td>',"</tr>",'<tr class="divider comments"></tr>','<tr class="comments">','<td class="left"></td>','<td class="right"><div id="fms-chb-resolved-comment"/></td>',"</tr>",'<tr class="divider comments"></tr>','<tr class="autosave">','<td class="left"><label id="fms-lbl-autosave"><%= scope.textAutoSave %></label></td>','<td class="right"><span id="fms-chb-autosave" /></td>',"</tr>",'<tr class="divider autosave"></tr>','<tr class="forcesave">','<td class="left"><label id="fms-lbl-forcesave"><%= scope.textForceSave %></label></td>','<td class="right"><span id="fms-chb-forcesave" /></td>',"</tr>",'<tr class="divider forcesave"></tr>','<tr class="coauth changes">','<td class="left"><label><%= scope.strCoAuthMode %></label></td>','<td class="right">','<div><div id="fms-cmb-coauth-mode" style="display: inline-block; margin-right: 15px;"/>','<label id="fms-lbl-coauth-mode" style="vertical-align: middle;"><%= scope.strCoAuthModeDescFast %></label></div></td>',"</tr>",'<tr class="divider coauth changes"></tr>',"<tr>",'<td class="left"><label><%= scope.strZoom %></label></td>','<td class="right"><div id="fms-cmb-zoom" class="input-group-nr" /></td>',"</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left"><label><%= scope.strFontRender %></label></td>','<td class="right"><span id="fms-cmb-font-render" /></td>',"</tr>",'<tr class="divider"></tr>','<tr class="edit">','<td class="left"><label><%= scope.strUnit %></label></td>','<td class="right"><span id="fms-cmb-unit" /></td>',"</tr>",'<tr class="divider edit"></tr>','<tr class="edit">','<td class="left"><label><%= scope.strFuncLocale %></label></td>','<td class="right">','<div><div id="fms-cmb-func-locale" style="display: inline-block; margin-right: 15px;"/>','<label id="fms-lbl-func-locale" style="vertical-align: middle;"><%= scope.strFuncLocaleEx %></label></div></td>',"</tr>",'<tr class="divider edit"></tr>','<tr class="edit">','<td class="left"><label><%= scope.strRegSettings %></label></td>','<td class="right">','<div><div id="fms-cmb-reg-settings" style="display: inline-block; margin-right: 15px;"/>','<label id="fms-lbl-reg-settings" style="vertical-align: middle;"></label></div></td>',"</tr>",'<tr class="divider edit"></tr>',"<tr>",'<td class="left"></td>','<td class="right"><button id="fms-btn-apply" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',"</tr>","</tbody></table>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,arguments),this.menu=t.menu},render:function(){return $(this.el).html(this.template({scope:this})),this.chLiveComment=new Common.UI.CheckBox({el:$("#fms-chb-live-comment"),labelText:this.strLiveComment}).on("change",_.bind(function(t,e,i,n){this.chResolvedComment.setDisabled("checked"!==t.getValue())},this)),this.chResolvedComment=new Common.UI.CheckBox({el:$("#fms-chb-resolved-comment"),labelText:this.strResolvedComment}),this.cmbCoAuthMode=new Common.UI.ComboBox({el:$("#fms-cmb-coauth-mode"),style:"width: 160px;",editable:!1,cls:"input-group-nr",data:[{value:1,displayValue:this.strFast,descValue:this.strCoAuthModeDescFast},{value:0,displayValue:this.strStrict,descValue:this.strCoAuthModeDescStrict}]}).on("selected",_.bind(function(t,e){1==e.value&&"checked"!==this.chAutosave.getValue()&&this.chAutosave.setValue(1),this.lblCoAuthMode.text(e.descValue)},this)),this.lblCoAuthMode=$("#fms-lbl-coauth-mode"),this.cmbZoom=new Common.UI.ComboBox({el:$("#fms-cmb-zoom"),style:"width: 160px;",editable:!1,cls:"input-group-nr",menuStyle:"max-height: 210px;",data:[{value:50,displayValue:"50%"},{value:60,displayValue:"60%"},{value:70,displayValue:"70%"},{value:80,displayValue:"80%"},{value:90,displayValue:"90%"},{value:100,displayValue:"100%"},{value:110,displayValue:"110%"},{value:120,displayValue:"120%"},{value:150,displayValue:"150%"},{value:175,displayValue:"175%"},{value:200,displayValue:"200%"}]}),this.cmbFon
style:"width: 242px;",menuStyle:"max-height: 280px; min-width: 242px;",editable:!1,cls:"input-group-nr",data:[{value:"215.9|279.4",displayValue:"US Letter (21,59cm x 27,94cm)",caption:"US Letter"},{value:"215.9|355.6",displayValue:"US Legal (21,59cm x 35,56cm)",caption:"US Legal"},{value:"210|297",displayValue:"A4 (21cm x 29,7cm)",caption:"A4"},{value:"148.1|209.9",displayValue:"A5 (14,81cm x 20,99cm)",caption:"A5"},{value:"176|250.1",displayValue:"B5 (17,6cm x 25,01cm)",caption:"B5"},{value:"104.8|241.3",displayValue:"Envelope #10 (10,48cm x 24,13cm)",caption:"Envelope #10"},{value:"110.1|220.1",displayValue:"Envelope DL (11,01cm x 22,01cm)",caption:"Envelope DL"},{value:"279.4|431.7",displayValue:"Tabloid (27,94cm x 43,17cm)",caption:"Tabloid"},{value:"297|420.1",displayValue:"A3 (29,7cm x 42,01cm)",caption:"A3"},{value:"304.8|457.1",displayValue:"Tabloid Oversize (30,48cm x 45,71cm)",caption:"Tabloid Oversize"},{value:"196.8|273",displayValue:"ROC 16K (19,68cm x 27,3cm)",caption:"ROC 16K"},{value:"119.9|234.9",displayValue:"Envelope Choukei 3 (11,99cm x 23,49cm)",caption:"Envelope Choukei 3"},{value:"330.2|482.5",displayValue:"Super B/A3 (33,02cm x 48,25cm)",caption:"Super B/A3"}]}),this.cmbPaperOrientation=new Common.UI.ComboBox({el:$("#printadv-dlg-combo-orient"),style:"width: 132px;",menuStyle:"min-width: 132px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscPageOrientation.PagePortrait,displayValue:this.strPortrait},{value:Asc.c_oAscPageOrientation.PageLandscape,displayValue:this.strLandscape}]}),this.chPrintGrid=new Common.UI.CheckBox({el:$("#printadv-dlg-chb-grid"),labelText:this.textPrintGrid}),this.chPrintRows=new Common.UI.CheckBox({el:$("#printadv-dlg-chb-rows"),labelText:this.textPrintHeadings}),this.spnMarginTop=new Common.UI.MetricSpinner({el:$("#printadv-dlg-spin-margin-top"),step:.1,width:110,defaultUnit:"cm",value:"0 cm",maxValue:48.25,minValue:0}),this.spinners.push(this.spnMarginTop),this.spnMarginBottom=new Common.UI.MetricSpinner({el:$("#printadv-dlg-spin-margin-bottom"),step:.1,width:110,defaultUnit:"cm",value:"0 cm",maxValue:48.25,minValue:0}),this.spinners.push(this.spnMarginBottom),this.spnMarginLeft=new Common.UI.MetricSpinner({el:$("#printadv-dlg-spin-margin-left"),step:.1,width:110,defaultUnit:"cm",value:"0.19 cm",maxValue:48.25,minValue:0}),this.spinners.push(this.spnMarginLeft),this.spnMarginRight=new Common.UI.MetricSpinner({el:$("#printadv-dlg-spin-margin-right"),step:.1,width:110,defaultUnit:"cm",value:"0.19 cm",maxValue:48.25,minValue:0}),this.spinners.push(this.spnMarginRight),this.cmbLayout=new Common.UI.ComboBox({el:$("#printadv-dlg-combo-layout"),style:"width: 242px;",menuStyle:"min-width: 242px;",editable:!1,cls:"input-group-nr",data:[{value:0,displayValue:this.textActualSize},{value:1,displayValue:this.textFitPage},{value:2,displayValue:this.textFitCols},{value:3,displayValue:this.textFitRows}]}),this.btnHide=new Common.UI.Button({el:$("#printadv-dlg-btn-hide")}),this.btnHide.on("click",_.bind(this.handlerShowDetails,this)),this.panelDetails=$("#printadv-dlg-content-to-hide"),this.updateMetricUnit(),this.options.afterrender&&this.options.afterrender.call(this);var t=Common.localStorage.getItem("sse-hide-print-settings");this.extended=null!==t&&0==parseInt(t),this.handlerShowDetails(this.btnHide)},setRange:function(t){this.cmbRange.setValue(t)},getRange:function(){return this.cmbRange.getValue()},comboRangeChange:function(t,e){this.fireEvent("changerange",this)},updateMetricUnit:function(){if(this.spinners)for(var t=0;t<this.spinners.length;t++){var e=this.spinners[t];e.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()),e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.1)}for(var i=this.cmbPaperSize.store,t=0;t<i.length;t++){var n=i.at(t),o=n.get("value"),s=/^\d{3}\.?\d*/.exec(o),a=/\d{3}\.?\d*$/.exec(o);n.set("displayValue",n.get("caption")+" ("+parseFloat(Common.Utils.Metric.fnRecalcFromMM(s).toFixed(2))+Common.Utils.Metric.getCurrentMetricName()+" x "+parseFloat(Common.Utils.Metric.fnRecalcFromMM(a).toFixed(2))+Common.U
}):this.collection.at(i).get("last")&&this.collection.at(i).set("last",!1,{silent:!0}),n=!1;this.onUpdateFilter(this.filter,!0),this.view.render()}this.view.update()},findComment:function(t,e){return _.isUndefined(t)?this.collection.findWhere({id:e}):this.collection.findWhere({uid:t})},findPopupComment:function(t){return this.popoverComments.findWhere({id:t})},closeEditing:function(t){if(!_.isUndefined(t)){var e=this.findPopupComment(t);e&&(e.set("editTextInPopover",!1),e.set("showReplyInPopover",!1)),this.subEditStrings[t]&&delete this.subEditStrings[t],this.subEditStrings[t+"-R"]&&delete this.subEditStrings[t+"-R"]}this.collection.clearEditing(),this.collection.each(function(t){var e=_.clone(t.get("replys"));t.get("replys").length=0,e.forEach(function(t){t.get("editText")&&t.set("editText",!1),t.get("editTextInPopover")&&t.set("editTextInPopover",!1)}),t.set("replys",e)}),this.view.showEditContainer(!1),this.view.update()},disableHint:function(t){t&&this.mode.canComments&&(t.set("hint",!1),this.api.asc_showComment(t.get("uid"),!1),this.isSelectedComment=!0)},blockPopover:function(t){this.isSelectedComment=t,t&&this.getPopover().isVisible()&&this.getPopover().hide()},getPopover:function(){return this.view.getPopover(this.sdkViewName)},readSDKComment:function(t,e){var i=e.asc_getOnlyOfficeTime()?new Date(this.stringOOToLocalDate(e.asc_getOnlyOfficeTime())):""==e.asc_getTime()?new Date:new Date(this.stringUtcToLocalDate(e.asc_getTime())),n=new Common.Models.Comment({uid:t,userid:e.asc_getUserId(),username:e.asc_getUserName(),date:this.dateToLocaleTimeString(i),quote:e.asc_getQuoteText(),comment:e.asc_getText(),resolved:e.asc_getSolved(),unattached:!_.isUndefined(e.asc_getDocumentFlag)&&e.asc_getDocumentFlag(),id:Common.UI.getId(),time:i.getTime(),showReply:!1,editText:!1,last:void 0,editTextInPopover:!!this.editPopover,showReplyInPopover:!1,hideAddReply:_.isUndefined(this.hidereply)?!!this.showPopover:this.hidereply,scope:this.view,editable:this.mode.canEditComments||e.asc_getUserId()==this.currentUserId});if(n){var o=this.readSDKReplies(e);o.length&&n.set("replys",o)}return n},readSDKReplies:function(t){var e=0,i=[],n=null,o=t.asc_getRepliesCount();if(o){for(e=0;e<o;++e)n=t.asc_getReply(e).asc_getOnlyOfficeTime()?new Date(this.stringOOToLocalDate(t.asc_getReply(e).asc_getOnlyOfficeTime())):""==t.asc_getReply(e).asc_getTime()?new Date:new Date(this.stringUtcToLocalDate(t.asc_getReply(e).asc_getTime())),i.push(new Common.Models.Reply({id:Common.UI.getId(),userid:t.asc_getReply(e).asc_getUserId(),username:t.asc_getReply(e).asc_getUserName(),date:this.dateToLocaleTimeString(n),reply:t.asc_getReply(e).asc_getText(),time:n.getTime(),editText:!1,editTextInPopover:!1,showReplyInPopover:!1,scope:this.view,editable:this.mode.canEditComments||t.asc_getReply(e).asc_getUserId()==this.currentUserId}));i.sort(function(t,e){return t.get("time")-e.get("time")})}return i},addDummyComment:function(){if(this.api){var t=this,e=null,i=new Date,n=this.getPopover();if(n){if(this.popoverComments.length)return void _.delay(function(){n.commentsView.setFocusToTextBox()},200);var o=new Common.Models.Comment({id:-1,time:i.getTime(),date:this.dateToLocaleTimeString(i),userid:this.currentUserId,username:this.currentUserName,editTextInPopover:!0,showReplyInPopover:!1,hideAddReply:!0,scope:this.view,dummy:!0});this.popoverComments.reset(),this.popoverComments.push(o),this.uids=[],this.isSelectedComment=!0,this.isDummyComment=!0,_.isUndefined(this.api.asc_SetDocumentPlaceChangedEnabled)||t.api.asc_SetDocumentPlaceChangedEnabled(!0),n.handlerHide=function(){},n.isVisible()&&n.hide(),n.handlerHide=function(){t.clearDummyComment()},e=this.api.asc_getAnchorPosition(),e&&(n.setLeftTop(e.asc_getX()+e.asc_getWidth(),e.asc_getY(),this.hintmode?e.asc_getX():void 0),n.show(!0,!1,!0))}}},onAddDummyComment:function(e){if(this.api&&e&&e.length>0){var i=t();i&&(this.showPopover=!0,this.editPopover=!1,this.hidereply=!1,this.isSelectedComment=!1,this.uids=[],this.isDummyComment=!1,this.popoverComments.reset(),this.getPopover().isVisible()&&this.getPopover().hide(),i.as