!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(j(a,c),b)}function f(a,b,c){
return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c
);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e
)&&b.call(c,a[e],e,a)}function h(b,c,d){var e="DEPRECATED METHOD: "+c+"\n"+d+" AT \n";
return function(){var c=new Error("get-stack-trace"),d=c&&c.stack?c.stack.replace(/^[^\(]+?[\n$]/gm,
"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"
):"Unknown Stack Trace",f=a.console&&(a.console.warn||a.console.log);return f&&f.call(a.console,e,d)
,b.apply(this,arguments)}}function i(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),
d.constructor=a,d._super=e,c&&la(d,c)}function j(a,b){return function(){return a.apply(b,arguments)}
}function k(a,b){return typeof a==oa?a.apply(b?b[0]||d:d,b):a}function l(a,b){return a===d?b:a}
function m(a,b,c){g(q(b),function(b){a.addEventListener(b,c,!1)})}function n(a,b,c){g(q(b),function(
b){a.removeEventListener(b,c,!1)})}function o(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1
}function p(a,b){return a.indexOf(b)>-1}function q(a){return a.trim().split(/\s+/g)}function r(a,b,c
){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b
)return d;d++}return-1}function s(a){return Array.prototype.slice.call(a,0)}function t(a,b,c){for(
var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];r(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(
d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function u(a,b){for(var c,e,f=b[0
].toUpperCase()+b.slice(1),g=0;g<ma.length;){if(c=ma[g],e=c?c+f:b,e in a)return e;g++}return d}
function v(){return ua++}function w(b){var c=b.ownerDocument||b;
return c.defaultView||c.parentWindow||a}function x(a,b){var c=this;this.manager=a,this.callback=b,
this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){k(
a.options.enable,[a])&&c.handler(b)},this.init()}function y(a){var b,c=a.options.inputClass;
return new(b=c?c:xa?M:ya?P:wa?R:L)(a,z)}function z(a,b,c){var d=c.pointers.length,
e=c.changedPointers.length,f=b&Ea&&d-e===0,g=b&(Ga|Ha)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(
a.session={}),c.eventType=b,A(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}
function A(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=D(b)),
e>1&&!c.firstMultiple?c.firstMultiple=D(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,
g=c.firstMultiple,h=g?g.center:f.center,i=b.center=E(d);b.timeStamp=ra(),
b.deltaTime=b.timeStamp-f.timeStamp,b.angle=I(h,i),b.distance=H(h,i),B(c,b),b.offsetDirection=G(
b.deltaX,b.deltaY);var j=F(b.deltaTime,b.deltaX,b.deltaY);b.overallVelocityX=j.x,
b.overallVelocityY=j.y,b.overallVelocity=qa(j.x)>qa(j.y)?j.x:j.y,b.scale=g?K(g.pointers,d):1,
b.rotation=g?J(g.pointers,d):0,
b.maxPointers=c.prevInput?b.pointers.length>c.prevInput.maxPointers?b.pointers.length:c.prevInput.maxPointers:b.pointers.length
,C(c,b);var k=a.element;o(b.srcEvent.target,k)&&(k=b.srcEvent.target),b.target=k}function B(a,b){
var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};
b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={
x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function C(a,b){var c,e,f,g,
h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Ha&&(i>Da||h.velocity===d)){
var j=b.deltaX-h.deltaX,k=b.deltaY-h.deltaY,l=F(i,j,k);e=l.x,f=l.y,c=qa(l.x)>qa(l.y)?l.x:l.y,g=G(j,k
),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,
b.velocityX=e,b.velocityY=f,b.direction=g}function D(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={
clientX:pa(a.pointers[c].clientX),clientY:pa(a.pointers[c].clientY)},c++;return{timeStamp:ra(),
pointers:b,center:E(b),deltaX:a.deltaX,deltaY:a.deltaY}}function E(a){var b=a.length;if(1===b
)return{x:pa(a[0].clientX),y:pa(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e
].clientY,e++;return{x:pa(c/b),y:pa(d/b)}}function F(a,b,c){return{x:b/a||0,y:c/a||0}}function G(a,b
){return a===b?Ia:qa(a)>=qa(b)?0>a?Ja:Ka:0>b?La:Ma}function H(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]]
,e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function I(a,b,c){c||(c=Qa);var d=b[c[0]]-a[c[0]],e=b[
c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function J(a,b){return I(b[1],b[0],Ra)+I(a[1],a[0],
Ra)}function K(a,b){return H(b[0],b[1],Ra)/H(a[0],a[1],Ra)}function L(){this.evEl=Ta,this.evWin=Ua,
this.pressed=!1,x.apply(this,arguments)}function M(){this.evEl=Xa,this.evWin=Ya,x.apply(this,
arguments),this.store=this.manager.session.pointerEvents=[]}function N(){this.evTarget=$a,
this.evWin=_a,this.started=!1,x.apply(this,arguments)}function O(a,b){var c=s(a.touches),d=s(
a.changedTouches);return b&(Ga|Ha)&&(c=t(c.concat(d),"identifier",!0)),[c,d]}function P(){
this.evTarget=bb,this.targetIds={},x.apply(this,arguments)}function Q(a,b){var c=s(a.touches),
d=this.targetIds;if(b&(Ea|Fa)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=s(
a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return o(a.target,i)}),b===Ea)for(
e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(
Ga|Ha)&&delete d[g[e].identifier],e++;return h.length?[t(f.concat(h),"identifier",!0),h]:void 0}
function R(){x.apply(this,arguments);var a=j(this.handler,this);this.touch=new P(this.manager,a),
this.mouse=new L(this.manager,a),this.primaryTouch=null,this.lastTouches=[]}function S(a,b){a&Ea?(
this.primaryTouch=b.changedPointers[0].identifier,T.call(this,b)):a&(Ga|Ha)&&T.call(this,b)}
function T(a){var b=a.changedPointers[0];if(b.identifier===this.primaryTouch){var c={x:b.clientX,
y:b.clientY};this.lastTouches.push(c);var d=this.lastTouches,e=function(){var a=d.indexOf(c);
a>-1&&d.splice(a,1)};setTimeout(e,cb)}}function U(a){for(var b=a.srcEvent.clientX,
c=a.srcEvent.clientY,d=0;d<this.lastTouches.length;d++){var e=this.lastTouches[d],f=Math.abs(b-e.x),
g=Math.abs(c-e.y);if(db>=f&&db>=g)return!0}return!1}function V(a,b){this.manager=a,this.set(b)}
function W(a){if(p(a,jb))return jb;var b=p(a,kb),c=p(a,lb);return b&&c?jb:b||c?b?kb:lb:p(a,ib)?ib:hb
}function X(){if(!fb)return!1;var b={},c=a.CSS&&a.CSS.supports;return["auto","manipulation","pan-y",
"pan-x","pan-x pan-y","none"].forEach(function(d){b[d]=c?a.CSS.supports("touch-action",d):!0}),b}
function Y(a){this.options=la({},this.defaults,a||{}),this.id=v(),this.manager=null,
this.options.enable=l(this.options.enable,!0),this.state=nb,this.simultaneous={},this.requireFail=[]
}function Z(a){return a&sb?"cancel":a&qb?"end":a&pb?"move":a&ob?"start":""}function $(a){
return a==Ma?"down":a==La?"up":a==Ja?"left":a==Ka?"right":""}function _(a,b){var c=b.manager;
return c?c.get(a):a}function aa(){Y.apply(this,arguments)}function ba(){aa.apply(this,arguments),
this.pX=null,this.pY=null}function ca(){aa.apply(this,arguments)}function da(){Y.apply(this,
arguments),this._timer=null,this._input=null}function ea(){aa.apply(this,arguments)}function fa(){
aa.apply(this,arguments)}function ga(){Y.apply(this,arguments),this.pTime=!1,this.pCenter=!1,
this._timer=null,this._input=null,this.count=0}function ha(a,b){return b=b||{},b.recognizers=l(
b.recognizers,ha.defaults.preset),new ia(a,b)}function ia(a,b){this.options=la({},ha.defaults,b||{})
,this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},
this.recognizers=[],this.oldCssProps={},this.element=a,this.input=y(this),this.touchAction=new V(
this,this.options.touchAction),ja(this,!0),g(this.options.recognizers,function(a){var b=this.add(
new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function ja(a,b){
var c=a.element;if(c.style){var d;g(a.options.cssProps,function(e,f){d=u(c.style,f),b?(
a.oldCssProps[d]=c.style[d],c.style[d]=e):c.style[d]=a.oldCssProps[d]||""}),b||(a.oldCssProps={})}}
function ka(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,
c.target.dispatchEvent(d)}var la,ma=["","webkit","Moz","MS","ms","o"],na=b.createElement("div"),
oa="function",pa=Math.round,qa=Math.abs,ra=Date.now;la="function"!=typeof Object.assign?function(a){
if(a===d||null===a)throw new TypeError("Cannot convert undefined or null to object");for(
var b=Object(a),c=1;c<arguments.length;c++){var e=arguments[c];if(e!==d&&null!==e)for(var f in e
)e.hasOwnProperty(f)&&(b[f]=e[f])}return b}:Object.assign;var sa=h(function(a,b,c){for(
var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a},"extend",
"Use `assign`."),ta=h(function(a,b){return sa(a,b,!0)},"merge","Use `assign`."),ua=1,
va=/mobile|tablet|ip(ad|hone|od)|android/i,wa="ontouchstart"in a,xa=u(a,"PointerEvent")!==d,
ya=wa&&va.test(navigator.userAgent),za="touch",Aa="pen",Ba="mouse",Ca="kinect",Da=25,Ea=1,Fa=2,Ga=4,
Ha=8,Ia=1,Ja=2,Ka=4,La=8,Ma=16,Na=Ja|Ka,Oa=La|Ma,Pa=Na|Oa,Qa=["x","y"],Ra=["clientX","clientY"];
x.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,
this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(w(
this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&n(this.element,this.evEl,
this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(w(
this.element),this.evWin,this.domHandler)}};var Sa={mousedown:Ea,mousemove:Fa,mouseup:Ga},
Ta="mousedown",Ua="mousemove mouseup";i(L,x,{handler:function(a){var b=Sa[a.type];
b&Ea&&0===a.button&&(this.pressed=!0),b&Fa&&1!==a.which&&(b=Ga),this.pressed&&(b&Ga&&(
this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:Ba,
srcEvent:a}))}});var Va={pointerdown:Ea,pointermove:Fa,pointerup:Ga,pointercancel:Ha,pointerout:Ha},
Wa={2:za,3:Aa,4:Ba,5:Ca},Xa="pointerdown",Ya="pointermove pointerup pointercancel";
a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown",
Ya="MSPointerMove MSPointerUp MSPointerCancel"),i(M,x,{handler:function(a){var b=this.store,c=!1,
d=a.type.toLowerCase().replace("ms",""),e=Va[d],f=Wa[a.pointerType]||a.pointerType,g=f==za,h=r(b,
a.pointerId,"pointerId");e&Ea&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ga|Ha)&&(c=!0),
0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a})
,c&&b.splice(h,1))}});var Za={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},$a="touchstart"
,_a="touchstart touchmove touchend touchcancel";i(N,x,{handler:function(a){var b=Za[a.type];if(
b===Ea&&(this.started=!0),this.started){var c=O.call(this,a,b);b&(Ga|Ha)&&c[0].length-c[1
].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],
pointerType:za,srcEvent:a})}}});var ab={touchstart:Ea,touchmove:Fa,touchend:Ga,touchcancel:Ha},
bb="touchstart touchmove touchend touchcancel";i(P,x,{handler:function(a){var b=ab[a.type],c=Q.call(
this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:za,
srcEvent:a})}});var cb=2500,db=25;i(R,x,{handler:function(a,b,c){var d=c.pointerType==za,
e=c.pointerType==Ba;if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){if(d
)S.call(this,b,c);else if(e&&U.call(this,c))return;this.callback(a,b,c)}},destroy:function(){
this.touch.destroy(),this.mouse.destroy()}});var eb=u(na.style,"touchAction"),fb=eb!==d,gb="compute"
,hb="auto",ib="manipulation",jb="none",kb="pan-x",lb="pan-y",mb=X();V.prototype={set:function(a){
a==gb&&(a=this.compute()),fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a),
this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},
compute:function(){var a=[];return g(this.manager.recognizers,function(b){k(b.options.enable,[b])&&(
a=a.concat(b.getTouchAction()))}),W(a.join(" "))},preventDefaults:function(a){var b=a.srcEvent,
c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();
var d=this.actions,e=p(d,jb)&&!mb[jb],f=p(d,lb)&&!mb[lb],g=p(d,kb)&&!mb[kb];if(e){
var h=1===a.pointers.length,i=a.distance<2,j=a.deltaTime<250;if(h&&i&&j)return}
return g&&f?void 0:e||f&&c&Na||g&&c&Oa?this.preventSrc(b):void 0},preventSrc:function(a){
this.manager.session.prevented=!0,a.preventDefault()}};var nb=1,ob=2,pb=4,qb=8,rb=qb,sb=16,tb=32;
Y.prototype={defaults:{},set:function(a){return la(this.options,a),
this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,
"recognizeWith",this))return this;var b=this.simultaneous;return a=_(a,this),b[a.id]||(b[a.id]=a,
a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this
)?this:(a=_(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,
"requireFailure",this))return this;var b=this.requireFail;return a=_(a,this),-1===r(b,a)&&(b.push(a)
,a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this)
)return this;a=_(a,this);var b=r(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this
},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){
return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(b,a)}var c=this,
d=this.state;qb>d&&b(c.options.event+Z(d)),b(c.options.event),a.additionalEvent&&b(a.additionalEvent
),d>=qb&&b(c.options.event+Z(d))},tryEmit:function(a){return this.canEmit()?this.emit(a):void(
this.state=tb)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a
].state&(tb|nb)))return!1;a++}return!0},recognize:function(a){var b=la({},a);return k(
this.options.enable,[this,b])?(this.state&(rb|sb|tb)&&(this.state=nb),this.state=this.process(b),
void(this.state&(ob|pb|qb|sb)&&this.tryEmit(b))):(this.reset(),void(this.state=tb))},
process:function(a){},getTouchAction:function(){},reset:function(){}},i(aa,Y,{defaults:{pointers:1},
attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},
process:function(a){var b=this.state,c=a.eventType,d=b&(ob|pb),e=this.attrTest(a);return d&&(
c&Ha||!e)?b|sb:d||e?c&Ga?b|qb:b&ob?b|pb:ob:tb}}),i(ba,aa,{defaults:{event:"pan",threshold:10,
pointers:1,direction:Pa},getTouchAction:function(){var a=this.options.direction,b=[];
return a&Na&&b.push(lb),a&Oa&&b.push(kb),b},directionTest:function(a){var b=this.options,c=!0,
d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Na?(
e=0===f?Ia:0>f?Ja:Ka,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Ia:0>g?La:Ma,c=g!=this.pY,
d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){
return aa.prototype.attrTest.call(this,a)&&(this.state&ob||!(this.state&ob)&&this.directionTest(a))
},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=$(a.direction);b&&(
a.additionalEvent=this.options.event+b),this._super.emit.call(this,a)}}),i(ca,aa,{defaults:{
event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[jb]},attrTest:function(a){
return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&ob
)},emit:function(a){if(1!==a.scale){var b=a.scale<1?"in":"out";
a.additionalEvent=this.options.event+b}this._super.emit.call(this,a)}}),i(da,Y,{defaults:{
event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[hb]},
process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,
f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ga|Ha)&&!f)this.reset();else if(
a.eventType&Ea)this.reset(),this._timer=e(function(){this.state=rb,this.tryEmit()},b.time,this
);else if(a.eventType&Ga)return rb;return tb},reset:function(){clearTimeout(this._timer)},
emit:function(a){this.state===rb&&(a&&a.eventType&Ga?this.manager.emit(this.options.event+"up",a):(
this._input.timeStamp=ra(),this.manager.emit(this.options.event,this._input)))}}),i(ea,aa,{
defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[jb]},
attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation
)>this.options.threshold||this.state&ob)}}),i(fa,aa,{defaults:{event:"swipe",threshold:10,
velocity:.3,direction:Na|Oa,pointers:1},getTouchAction:function(){
return ba.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;
return c&(Na|Oa)?b=a.overallVelocity:c&Na?b=a.overallVelocityX:c&Oa&&(b=a.overallVelocityY),
this._super.attrTest.call(this,a
)&&c&a.offsetDirection&&a.distance>this.options.threshold&&a.maxPointers==this.options.pointers&&qa(
b)>this.options.velocity&&a.eventType&Ga},emit:function(a){var b=$(a.offsetDirection);
b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),i(ga,Y,{
defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},
getTouchAction:function(){return[ib]},process:function(a){var b=this.options,
c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),
a.eventType&Ea&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ga
)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||H(
this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,
h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i
)return this.hasRequireFailures()?(this._timer=e(function(){this.state=rb,this.tryEmit()},b.interval
,this),ob):rb}return tb},failTimeout:function(){return this._timer=e(function(){this.state=tb},
this.options.interval,this),tb},reset:function(){clearTimeout(this._timer)},emit:function(){
this.state==rb&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}
}),ha.VERSION="2.0.7",ha.defaults={domEvents:!1,touchAction:gb,enable:!0,inputTarget:null,
inputClass:null,preset:[[ea,{enable:!1}],[ca,{enable:!1},["rotate"]],[fa,{direction:Na}],[ba,{
direction:Na},["swipe"]],[ga],[ga,{event:"doubletap",taps:2},["tap"]],[da]],cssProps:{
userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",
tapHighlightColor:"rgba(0,0,0,0)"}};var ub=1,vb=2;ia.prototype={set:function(a){return la(
this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),
this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){
this.session.stopped=a?vb:ub},recognize:function(a){var b=this.session;if(!b.stopped){
this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&rb
)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],
b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(ob|pb|qb)&&(
e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof Y)return a;for(var b=this.recognizers,
c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",
this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),
a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;if(
a=this.get(a)){var b=this.recognizers,c=r(b,a);-1!==c&&(b.splice(c,1),this.touchAction.update())}
return this},on:function(a,b){if(a!==d&&b!==d){var c=this.handlers;return g(q(a),function(a){c[a]=c[
a]||[],c[a].push(b)}),this}},off:function(a,b){if(a!==d){var c=this.handlers;return g(q(a),function(
a){b?c[a]&&c[a].splice(r(c[a],b),1):delete c[a]}),this}},emit:function(a,b){
this.options.domEvents&&ka(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){
b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),
d++}},destroy:function(){this.element&&ja(this,!1),this.handlers={},this.session={},
this.input.destroy(),this.element=null}},la(ha,{INPUT_START:Ea,INPUT_MOVE:Fa,INPUT_END:Ga,
INPUT_CANCEL:Ha,STATE_POSSIBLE:nb,STATE_BEGAN:ob,STATE_CHANGED:pb,STATE_ENDED:qb,
STATE_RECOGNIZED:rb,STATE_CANCELLED:sb,STATE_FAILED:tb,DIRECTION_NONE:Ia,DIRECTION_LEFT:Ja,
DIRECTION_RIGHT:Ka,DIRECTION_UP:La,DIRECTION_DOWN:Ma,DIRECTION_HORIZONTAL:Na,DIRECTION_VERTICAL:Oa,
DIRECTION_ALL:Pa,Manager:ia,Input:x,TouchAction:V,TouchInput:P,MouseInput:L,PointerEventInput:M,
TouchMouseInput:R,SingleTouchInput:N,Recognizer:Y,AttrRecognizer:aa,Tap:ga,Pan:ba,Swipe:fa,Pinch:ca,
Rotate:ea,Press:da,on:m,off:n,each:g,merge:ta,extend:sa,assign:la,inherit:i,bindFn:j,prefixed:u});
var wb="undefined"!=typeof a?a:"undefined"!=typeof self?self:{};wb.Hammer=ha,
"function"==typeof define&&define.amd?define(function(){return ha}
):"undefined"!=typeof module&&module.exports?module.exports=ha:a[c]=ha}(window,document,"Hammer");
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(
):"function"==typeof define&&define.amd?define(t):(
e="undefined"!=typeof globalThis?globalThis:e||self).DOMPurify=t()}(this,function(){"use strict";
const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:r}=Object;let{
freeze:i,seal:a,create:l}=Object,{apply:c,construct:s}="undefined"!=typeof Reflect&&Reflect;i||(
i=function(e){return e}),a||(a=function(e){return e}),c||(c=function(e,t,n){return e.apply(t,n)}),
s||(s=function(e,t){return new e(...t)});const u=R(Array.prototype.forEach),m=R(
Array.prototype.lastIndexOf),p=R(Array.prototype.pop),f=R(Array.prototype.push),d=R(
Array.prototype.splice),h=R(String.prototype.toLowerCase),g=R(String.prototype.toString),T=R(
String.prototype.match),y=R(String.prototype.replace),E=R(String.prototype.indexOf),A=R(
String.prototype.trim),_=R(Object.prototype.hasOwnProperty),S=R(RegExp.prototype.test),b=(
N=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];
return s(N,t)});var N;function R(e){return function(t){for(var n=arguments.length,o=new Array(
n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return c(e,t,o)}}function w(e,o){
let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;t&&t(e,null);let i=o.length;for(;i--;
){let t=o[i];if("string"==typeof t){const e=r(t);e!==t&&(n(o)||(o[i]=e),t=e)}e[t]=!0}return e}
function O(e){for(let t=0;t<e.length;t++){_(e,t)||(e[t]=null)}return e}function D(t){const n=l(null)
for(const[o,r]of e(t)){_(t,o)&&(Array.isArray(r)?n[o]=O(r
):r&&"object"==typeof r&&r.constructor===Object?n[o]=D(r):n[o]=r)}return n}function v(e,t){for(
;null!==e;){const n=r(e,t);if(n){if(n.get)return R(n.get);if("function"==typeof n.value)return R(
n.value)}e=o(e)}return function(){return null}}const L=i(["a","abbr","acronym","address","area",
"article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas",
"caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del"
,"details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure",
"font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img",
"input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter",
"nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby",
"s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style",
"sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr",
"track","tt","u","ul","var","video","wbr"]),C=i(["svg","a","altglyph","altglyphdef","altglyphitem",
"animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse",
"filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask",
"metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style",
"switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),x=i(["feBlend",
"feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting",
"feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG",
"feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset",
"fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=i(["animate",
"color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src",
"font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow",
"missing-glyph","script","set","solidcolor","unknown","use"]),k=i(["math","menclose","merror",
"mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom",
"mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr",
"munder","munderover","mprescripts"]),I=i(["maction","maligngroup","malignmark","mlongdiv",
"mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml",
"mprescripts","none"]),U=i(["#text"]),z=i(["accept","action","align","alt","autocapitalize",
"autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture",
"cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls",
"controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled",
"disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint",
"face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity",
"ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min"
,"minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum",
"pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster",
"preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows",
"rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src",
"srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value",
"width","wrap","xmlns","slot"]),P=i(["accent-height","accumulate","additive","alignment-baseline",
"amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift",
"begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color",
"color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d",
"dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end",
"exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity",
"font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant",
"font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform",
"height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning",
"keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix",
"kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight",
"markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode",
"min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin",
"overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits"
,"points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx",
"refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering",
"slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation",
"stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap",
"stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style",
"surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform",
"transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2",
"unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y",
"width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2",
"xmlns","y","y1","y2","z","zoomandpan"]),H=i(["accent","accentunder","align","bevelled","close",
"columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle",
"encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote"
,"mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits",
"notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote",
"scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy"
,"subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=i(["xlink:href",
"xml:id","xlink:title","xml:space","xmlns:xlink"]),B=a(/\{\{[\w\W]*|[\w\W]*\}\}/gm),W=a(
/<%[\w\W]*|[\w\W]*%>/gm),G=a(/\$\{[\w\W]*/gm),Y=a(/^data-[\-\w.\u00B7-\uFFFF]+$/),j=a(
/^aria-[\-\w]+$/),X=a(
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q=a(
/^(?:\w+script|data):/i),$=a(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=a(
/^html$/i),V=a(/^[a-z][.\w]*(-[.\w]+)+$/i);var Z=Object.freeze({__proto__:null,ARIA_ATTR:j,
ATTR_WHITESPACE:$,CUSTOM_ELEMENT:V,DATA_ATTR:Y,DOCTYPE_NAME:K,ERB_EXPR:W,IS_ALLOWED_URI:X,
IS_SCRIPT_OR_DATA:q,MUSTACHE_EXPR:B,TMPLIT_EXPR:G});const J=1,Q=3,ee=7,te=8,ne=9,oe=function(){
return"undefined"==typeof window?null:window};var re=function t(){
let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oe();const o=e=>t(e);if(
o.version="3.2.4",o.removed=[],!n||!n.document||n.document.nodeType!==ne||!n.Element
)return o.isSupported=!1,o;let{document:r}=n;const a=r,c=a.currentScript,{DocumentFragment:s,
HTMLTemplateElement:N,Node:R,Element:O,NodeFilter:B,
NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:G,DOMParser:Y,trustedTypes:j}=n,
q=O.prototype,$=v(q,"cloneNode"),V=v(q,"remove"),re=v(q,"nextSibling"),ie=v(q,"childNodes"),ae=v(q,
"parentNode");if("function"==typeof N){const e=r.createElement("template");
e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let le,ce="";const{
implementation:se,createNodeIterator:ue,createDocumentFragment:me,getElementsByTagName:pe}=r,{
importNode:fe}=a;let de={afterSanitizeAttributes:[],afterSanitizeElements:[],
afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],
beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]
};o.isSupported="function"==typeof e&&"function"==typeof ae&&se&&void 0!==se.createHTMLDocument;
const{MUSTACHE_EXPR:he,ERB_EXPR:ge,TMPLIT_EXPR:Te,DATA_ATTR:ye,ARIA_ATTR:Ee,IS_SCRIPT_OR_DATA:Ae,
ATTR_WHITESPACE:_e,CUSTOM_ELEMENT:Se}=Z;let{IS_ALLOWED_URI:be}=Z,Ne=null;const Re=w({},[...L,...C,
...x,...k,...U]);let we=null;const Oe=w({},[...z,...P,...H,...F]);let De=Object.seal(l(null,{
tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,
configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,
configurable:!1,enumerable:!0,value:!1}})),ve=null,Le=null,Ce=!0,xe=!0,Me=!1,ke=!0,Ie=!1,Ue=!0,ze=!1
,Pe=!1,He=!1,Fe=!1,Be=!1,We=!1,Ge=!0,Ye=!1,je=!0,Xe=!1,qe={},$e=null;const Ke=w({},["annotation-xml"
,"audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext",
"noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title",
"video","xmp"]);let Ve=null;const Ze=w({},["audio","video","img","source","image","track"]);
let Je=null;const Qe=w({},["alt","class","for","id","label","name","pattern","placeholder","role",
"summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",
tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml";let ot=nt,rt=!1,it=null;
const at=w({},[et,tt,nt],g);let lt=w({},["mi","mo","mn","ms","mtext"]),ct=w({},["annotation-xml"]);
const st=w({},["title","style","font","a","script"]);let ut=null;const mt=["application/xhtml+xml",
"text/html"];let pt=null,ft=null;const dt=r.createElement("form"),ht=function(e){
return e instanceof RegExp||e instanceof Function},gt=function(){
let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ft||ft!==e){if(
e&&"object"==typeof e||(e={}),e=D(e),ut=-1===mt.indexOf(e.PARSER_MEDIA_TYPE
)?"text/html":e.PARSER_MEDIA_TYPE,pt="application/xhtml+xml"===ut?g:h,Ne=_(e,"ALLOWED_TAGS")?w({},
e.ALLOWED_TAGS,pt):Re,we=_(e,"ALLOWED_ATTR")?w({},e.ALLOWED_ATTR,pt):Oe,it=_(e,"ALLOWED_NAMESPACES"
)?w({},e.ALLOWED_NAMESPACES,g):at,Je=_(e,"ADD_URI_SAFE_ATTR")?w(D(Qe),e.ADD_URI_SAFE_ATTR,pt):Qe,
Ve=_(e,"ADD_DATA_URI_TAGS")?w(D(Ze),e.ADD_DATA_URI_TAGS,pt):Ze,$e=_(e,"FORBID_CONTENTS")?w({},
e.FORBID_CONTENTS,pt):Ke,ve=_(e,"FORBID_TAGS")?w({},e.FORBID_TAGS,pt):{},Le=_(e,"FORBID_ATTR")?w({},
e.FORBID_ATTR,pt):{},qe=!!_(e,"USE_PROFILES")&&e.USE_PROFILES,Ce=!1!==e.ALLOW_ARIA_ATTR,
xe=!1!==e.ALLOW_DATA_ATTR,Me=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,
Ie=e.SAFE_FOR_TEMPLATES||!1,Ue=!1!==e.SAFE_FOR_XML,ze=e.WHOLE_DOCUMENT||!1,Fe=e.RETURN_DOM||!1,
Be=e.RETURN_DOM_FRAGMENT||!1,We=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM
,Ye=e.SANITIZE_NAMED_PROPS||!1,je=!1!==e.KEEP_CONTENT,Xe=e.IN_PLACE||!1,be=e.ALLOWED_URI_REGEXP||X,
ot=e.NAMESPACE||nt,lt=e.MATHML_TEXT_INTEGRATION_POINTS||lt,ct=e.HTML_INTEGRATION_POINTS||ct,
De=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(
e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(De.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),
e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(
De.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),
e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(
De.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(
xe=!1),Be&&(Fe=!0),qe&&(Ne=w({},U),we=[],!0===qe.html&&(w(Ne,L),w(we,z)),!0===qe.svg&&(w(Ne,C),w(we,
P),w(we,F)),!0===qe.svgFilters&&(w(Ne,x),w(we,P),w(we,F)),!0===qe.mathMl&&(w(Ne,k),w(we,H),w(we,F)))
,e.ADD_TAGS&&(Ne===Re&&(Ne=D(Ne)),w(Ne,e.ADD_TAGS,pt)),e.ADD_ATTR&&(we===Oe&&(we=D(we)),w(we,
e.ADD_ATTR,pt)),e.ADD_URI_SAFE_ATTR&&w(Je,e.ADD_URI_SAFE_ATTR,pt),e.FORBID_CONTENTS&&($e===Ke&&(
$e=D($e)),w($e,e.FORBID_CONTENTS,pt)),je&&(Ne["#text"]=!0),ze&&w(Ne,["html","head","body"]),
Ne.table&&(w(Ne,["tbody"]),delete ve.tbody),e.TRUSTED_TYPES_POLICY){if(
"function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw b(
'TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(
"function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw b(
'TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
le=e.TRUSTED_TYPES_POLICY,ce=le.createHTML("")}else void 0===le&&(le=function(e,t){if(
"object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;
const o="data-tt-policy-suffix";t&&t.hasAttribute(o)&&(n=t.getAttribute(o));const r="dompurify"+(
n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){
return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(j,c)),
null!==le&&"string"==typeof ce&&(ce=le.createHTML(""));i&&i(e),ft=e}},Tt=w({},[...C,...x,...M]),
yt=w({},[...k,...I]),Et=function(e){f(o.removed,{element:e});try{ae(e).removeChild(e)}catch(t){V(e)}
},At=function(e,t){try{f(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(o.removed,{
attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Fe||Be)try{Et(t)}catch(e){}else try{
t.setAttribute(e,"")}catch(e){}},_t=function(e){let t=null,n=null;if(He
)e="<remove></remove>"+e;else{const t=T(e,/^[\r\n\t ]+/);n=t&&t[0]}
"application/xhtml+xml"===ut&&ot===nt&&(
e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");
const o=le?le.createHTML(e):e;if(ot===nt)try{t=(new Y).parseFromString(o,ut)}catch(e){}if(
!t||!t.documentElement){t=se.createDocument(ot,"template",null);try{
t.documentElement.innerHTML=rt?ce:o}catch(e){}}const i=t.body||t.documentElement;
return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ot===nt?pe.call(t,
ze?"html":"body")[0]:ze?t.documentElement:i},St=function(e){return ue.call(e.ownerDocument||e,e,
B.SHOW_ELEMENT|B.SHOW_COMMENT|B.SHOW_TEXT|B.SHOW_PROCESSING_INSTRUCTION|B.SHOW_CDATA_SECTION,null)},
bt=function(e){return e instanceof G&&(
"string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(
e.attributes instanceof W
)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes
)},Nt=function(e){return"function"==typeof R&&e instanceof R};function Rt(e,t,n){u(e,e=>{e.call(o,t,
n,ft)})}const wt=function(e){let t=null;if(Rt(de.beforeSanitizeElements,e,null),bt(e))return Et(e),
!0;const n=pt(e.nodeName);if(Rt(de.uponSanitizeElement,e,{tagName:n,allowedTags:Ne}),
e.hasChildNodes()&&!Nt(e.firstElementChild)&&S(/<[/\w]/g,e.innerHTML)&&S(/<[/\w]/g,e.textContent)
)return Et(e),!0;if(e.nodeType===ee)return Et(e),!0;if(Ue&&e.nodeType===te&&S(/<[/\w]/g,e.data)
)return Et(e),!0;if(!Ne[n]||ve[n]){if(!ve[n]&&Dt(n)){if(De.tagNameCheck instanceof RegExp&&S(
De.tagNameCheck,n))return!1;if(De.tagNameCheck instanceof Function&&De.tagNameCheck(n))return!1}if(
je&&!$e[n]){const t=ae(e)||e.parentNode,n=ie(e)||e.childNodes;if(n&&t){for(let o=n.length-1;o>=0;--o
){const r=$(n[o],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,re(e))}}}return Et(e)
,!0}return e instanceof O&&!function(e){let t=ae(e);t&&t.tagName||(t={namespaceURI:ot,
tagName:"template"});const n=h(e.tagName),o=h(t.tagName);return!!it[e.namespaceURI]&&(
e.namespaceURI===tt?t.namespaceURI===nt?"svg"===n:t.namespaceURI===et?"svg"===n&&(
"annotation-xml"===o||lt[o]):Boolean(Tt[n]
):e.namespaceURI===et?t.namespaceURI===nt?"math"===n:t.namespaceURI===tt?"math"===n&&ct[o]:Boolean(
yt[n]):e.namespaceURI===nt?!(t.namespaceURI===tt&&!ct[o])&&!(t.namespaceURI===et&&!lt[o])&&!yt[n]&&(
st[n]||!Tt[n]):!("application/xhtml+xml"!==ut||!it[e.namespaceURI]))}(e)?(Et(e),!0
):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!S(/<\/no(script|embed|frames)/i,e.innerHTML)?(
Ie&&e.nodeType===Q&&(t=e.textContent,u([he,ge,Te],e=>{t=y(t,e," ")}),e.textContent!==t&&(f(o.removed
,{element:e.cloneNode()}),e.textContent=t)),Rt(de.afterSanitizeElements,e,null),!1):(Et(e),!0)},
Ot=function(e,t,n){if(Ge&&("id"===t||"name"===t)&&(n in r||n in dt))return!1;if(xe&&!Le[t]&&S(ye,t)
);else if(Ce&&S(Ee,t));else if(!we[t]||Le[t]){if(!(Dt(e)&&(De.tagNameCheck instanceof RegExp&&S(
De.tagNameCheck,e)||De.tagNameCheck instanceof Function&&De.tagNameCheck(e))&&(
De.attributeNameCheck instanceof RegExp&&S(De.attributeNameCheck,t
)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(t)
)||"is"===t&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&S(
De.tagNameCheck,n)||De.tagNameCheck instanceof Function&&De.tagNameCheck(n))))return!1}else if(Je[t]
);else if(S(be,y(n,_e,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==E(n,
"data:")||!Ve[e]){if(Me&&!S(Ae,y(n,_e,"")));else if(n)return!1}else;return!0},Dt=function(e){
return"annotation-xml"!==e&&T(e,Se)},vt=function(e){Rt(de.beforeSanitizeAttributes,e,null);const{
attributes:t}=e;if(!t||bt(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,
allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const i=t[r],{name:a,
namespaceURI:l,value:c}=i,s=pt(a);let m="value"===a?c:A(c);if(n.attrName=s,n.attrValue=m,
n.keepAttr=!0,n.forceKeepAttr=void 0,Rt(de.uponSanitizeAttribute,e,n),m=n.attrValue,
!Ye||"id"!==s&&"name"!==s||(At(a,e),m="user-content-"+m),Ue&&S(/((--!?|])>)|<\/(style|title)/i,m)){
At(a,e);continue}if(n.forceKeepAttr)continue;if(At(a,e),!n.keepAttr)continue;if(!ke&&S(/\/>/i,m)){
At(a,e);continue}Ie&&u([he,ge,Te],e=>{m=y(m,e," ")});const f=pt(e.nodeName);if(Ot(f,s,m)){if(
le&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(l);else switch(j.getAttributeType(f
,s)){case"TrustedHTML":m=le.createHTML(m);break;case"TrustedScriptURL":m=le.createScriptURL(m)}try{
l?e.setAttributeNS(l,a,m):e.setAttribute(a,m),bt(e)?Et(e):p(o.removed)}catch(e){}}}Rt(
de.afterSanitizeAttributes,e,null)},Lt=function e(t){let n=null;const o=St(t);for(Rt(
de.beforeSanitizeShadowDOM,t,null);n=o.nextNode();)Rt(de.uponSanitizeShadowNode,n,null),wt(n),vt(n),
n.content instanceof s&&e(n.content);Rt(de.afterSanitizeShadowDOM,t,null)};
return o.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null
,r=null,i=null,l=null;if(rt=!e,rt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Nt(e)){if(
"function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(
e=e.toString()))throw b("dirty is not a string, aborting")}if(!o.isSupported)return e;if(Pe||gt(t),
o.removed=[],"string"==typeof e&&(Xe=!1),Xe){if(e.nodeName){const t=pt(e.nodeName);if(!Ne[t]||ve[t]
)throw b("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof R)n=_t(
"\x3c!----\x3e"),r=n.ownerDocument.importNode(e,!0),
r.nodeType===J&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(
!Fe&&!Ie&&!ze&&-1===e.indexOf("<"))return le&&We?le.createHTML(e):e;if(n=_t(e),!n
)return Fe?null:We?ce:""}n&&He&&Et(n.firstChild);const c=St(Xe?e:n);for(;i=c.nextNode();)wt(i),vt(i)
,i.content instanceof s&&Lt(i.content);if(Xe)return e;if(Fe){if(Be)for(l=me.call(n.ownerDocument
);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(we.shadowroot||we.shadowrootmode)&&(
l=fe.call(a,l,!0)),l}let m=ze?n.outerHTML:n.innerHTML;return ze&&Ne["!doctype"
]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(K,
n.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+m),Ie&&u([he,ge,Te
],e=>{m=y(m,e," ")}),le&&We?le.createHTML(m):m},o.setConfig=function(){gt(
arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pe=!0},o.clearConfig=function(){ft=null,
Pe=!1},o.isValidAttribute=function(e,t,n){ft||gt({});const o=pt(e),r=pt(t);return Ot(o,r,n)},
o.addHook=function(e,t){"function"==typeof t&&f(de[e],t)},o.removeHook=function(e,t){if(void 0!==t){
const n=m(de[e],t);return-1===n?void 0:d(de[e],n,1)[0]}return p(de[e])},o.removeHooks=function(e){
de[e]=[]},o.removeAllHooks=function(){de={afterSanitizeAttributes:[],afterSanitizeElements:[],
afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],
beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]
}},o}();return re});(function(global,factory){"use strict";if(
typeof module==="object"&&typeof module.exports==="object"){module.exports=global.document?factory(
global,true):function(w){if(!w.document){throw new Error("jQuery requires a window with a document")
}return factory(w)}}else{factory(global)}})(typeof window!=="undefined"?window:this,function(window,
noGlobal){"use strict";var arr=[];var getProto=Object.getPrototypeOf;var slice=arr.slice;
var flat=arr.flat?function(array){return arr.flat.call(array)}:function(array){
return arr.concat.apply([],array)};var push=arr.push;var indexOf=arr.indexOf;var class2type={};
var toString=class2type.toString;var hasOwn=class2type.hasOwnProperty;var fnToString=hasOwn.toString
var ObjectFunctionString=fnToString.call(Object);var support={};var isFunction=function isFunction(
obj){return typeof obj==="function"&&typeof obj.nodeType!=="number"};var isWindow=function isWindow(
obj){return obj!=null&&obj===obj.window};var document=window.document;
var preservedScriptAttributes={type:true,src:true,nonce:true,noModule:true};function DOMEval(code,
node,doc){doc=doc||document;var i,val,script=doc.createElement("script");script.text=code;if(node){
for(i in preservedScriptAttributes){val=node[i]||node.getAttribute&&node.getAttribute(i);if(val){
script.setAttribute(i,val)}}}doc.head.appendChild(script).parentNode.removeChild(script)}
function toType(obj){if(obj==null){return obj+""}
return typeof obj==="object"||typeof obj==="function"?class2type[toString.call(obj)
]||"object":typeof obj}var version="3.5.1",jQuery=function(selector,context){
return new jQuery.fn.init(selector,context)};jQuery.fn=jQuery.prototype={jquery:version,
constructor:jQuery,length:0,toArray:function(){return slice.call(this)},get:function(num){if(
num==null){return slice.call(this)}return num<0?this[num+this.length]:this[num]},pushStack:function(
elems){var ret=jQuery.merge(this.constructor(),elems);ret.prevObject=this;return ret},each:function(
callback){return jQuery.each(this,callback)},map:function(callback){return this.pushStack(
jQuery.map(this,function(elem,i){return callback.call(elem,i,elem)}))},slice:function(){
return this.pushStack(slice.apply(this,arguments))},first:function(){return this.eq(0)},
last:function(){return this.eq(-1)},even:function(){return this.pushStack(jQuery.grep(this,function(
_elem,i){return(i+1)%2}))},odd:function(){return this.pushStack(jQuery.grep(this,function(_elem,i){
return i%2}))},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(
j>=0&&j<len?[this[j]]:[])},end:function(){return this.prevObject||this.constructor()},push:push,
sort:arr.sort,splice:arr.splice};jQuery.extend=jQuery.fn.extend=function(){var options,name,src,copy
,copyIsArray,clone,target=arguments[0]||{},i=1,length=arguments.length,deep=false;if(
typeof target==="boolean"){deep=target;target=arguments[i]||{};i++}if(
typeof target!=="object"&&!isFunction(target)){target={}}if(i===length){target=this;i--}for(
;i<length;i++){if((options=arguments[i])!=null){for(name in options){copy=options[name];if(
name==="__proto__"||target===copy){continue}if(deep&&copy&&(jQuery.isPlainObject(copy)||(
copyIsArray=Array.isArray(copy)))){src=target[name];if(copyIsArray&&!Array.isArray(src)){clone=[]
}else if(!copyIsArray&&!jQuery.isPlainObject(src)){clone={}}else{clone=src}copyIsArray=false;target[
name]=jQuery.extend(deep,clone,copy)}else if(copy!==undefined){target[name]=copy}}}}return target};
jQuery.extend({expando:"jQuery"+(version+Math.random()).replace(/\D/g,""),isReady:true,
error:function(msg){throw new Error(msg)},noop:function(){},isPlainObject:function(obj){var proto,
Ctor;if(!obj||toString.call(obj)!=="[object Object]"){return false}proto=getProto(obj);if(!proto){
return true}Ctor=hasOwn.call(proto,"constructor")&&proto.constructor;
return typeof Ctor==="function"&&fnToString.call(Ctor)===ObjectFunctionString},
isEmptyObject:function(obj){var name;for(name in obj){return false}return true},globalEval:function(
code,options,doc){DOMEval(code,{nonce:options&&options.nonce},doc)},each:function(obj,callback){
var length,i=0;if(isArrayLike(obj)){length=obj.length;for(;i<length;i++){if(callback.call(obj[i],i,
obj[i])===false){break}}}else{for(i in obj){if(callback.call(obj[i],i,obj[i])===false){break}}}
return obj},makeArray:function(arr,results){var ret=results||[];if(arr!=null){if(isArrayLike(Object(
arr))){jQuery.merge(ret,typeof arr==="string"?[arr]:arr)}else{push.call(ret,arr)}}return ret},
inArray:function(elem,arr,i){return arr==null?-1:indexOf.call(arr,elem,i)},merge:function(first,
second){var len=+second.length,j=0,i=first.length;for(;j<len;j++){first[i++]=second[j]}
first.length=i;return first},grep:function(elems,callback,invert){var callbackInverse,matches=[],i=0
,length=elems.length,callbackExpect=!invert;for(;i<length;i++){callbackInverse=!callback(elems[i],i)
if(callbackInverse!==callbackExpect){matches.push(elems[i])}}return matches},map:function(elems,
callback,arg){var length,value,i=0,ret=[];if(isArrayLike(elems)){length=elems.length;for(
;i<length;i++){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}else{for(i in elems
){value=callback(elems[i],i,arg);if(value!=null){ret.push(value)}}}return flat(ret)},guid:1,
support:support});if(typeof Symbol==="function"){jQuery.fn[Symbol.iterator]=arr[Symbol.iterator]}
jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
function(_i,name){class2type["[object "+name+"]"]=name.toLowerCase()});function isArrayLike(obj){
var length=!!obj&&"length"in obj&&obj.length,type=toType(obj);if(isFunction(obj)||isWindow(obj)){
return false}return type==="array"||length===0||typeof length==="number"&&length>0&&length-1 in obj}
var Sizzle=function(window){var i,support,Expr,getText,isXML,tokenize,compile,select,
outermostContext,sortInput,hasDuplicate,setDocument,document,docElem,documentIsHTML,rbuggyQSA,
rbuggyMatches,matches,contains,expando="sizzle"+1*new Date,preferredDoc=window.document,dirruns=0,
done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),
nonnativeSelectorCache=createCache(),sortOrder=function(a,b){if(a===b){hasDuplicate=true}return 0},
hasOwn={}.hasOwnProperty,arr=[],pop=arr.pop,pushNative=arr.push,push=arr.push,slice=arr.slice,
indexOf=function(list,elem){var i=0,len=list.length;for(;i<len;i++){if(list[i]===elem){return i}}
return-1},
booleans="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|"+"ismap|loop|multiple|open|readonly|required|scoped"
,whitespace="[\\x20\\t\\r\\n\\f]",
identifier="(?:\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
attributes="\\["+whitespace+"*("+identifier+")(?:"+whitespace+"*([*^$|!~]?=)"+whitespace+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+identifier+"))|)"+whitespace+"*\\]"
,
pseudos=":("+identifier+")(?:\\(("+"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|"+"((?:\\\\.|[^\\\\()[\\]]|"+attributes+")*)|"+".*"+")\\)|)"
,rwhitespace=new RegExp(whitespace+"+","g"),rtrim=new RegExp(
"^"+whitespace+"+|((?:^|[^\\\\])(?:\\\\.)*)"+whitespace+"+$","g"),rcomma=new RegExp(
"^"+whitespace+"*,"+whitespace+"*"),rcombinators=new RegExp(
"^"+whitespace+"*([>+~]|"+whitespace+")"+whitespace+"*"),rdescend=new RegExp(whitespace+"|>"),
rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp(
"^#("+identifier+")"),CLASS:new RegExp("^\\.("+identifier+")"),TAG:new RegExp(
"^("+identifier+"|[*])"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),
CHILD:new RegExp(
"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)"
,"i"),bool:new RegExp("^(?:"+booleans+")$","i"),needsContext:new RegExp(
"^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)"
,"i")},rhtml=/HTML$/i,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,
rnative=/^[^{]+\{\s*\[native \w/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rsibling=/[+~]/,
runescape=new RegExp("\\\\[\\da-fA-F]{1,6}"+whitespace+"?|\\\\([^\\r\\n\\f])","g"),
funescape=function(escape,nonHex){var high="0x"+escape.slice(1)-65536;
return nonHex?nonHex:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,
high&1023|56320)},rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
fcssescape=function(ch,asCodePoint){if(asCodePoint){if(ch==="\0"){return"�"}return ch.slice(0,-1
)+"\\"+ch.charCodeAt(ch.length-1).toString(16)+" "}return"\\"+ch},unloadHandler=function(){
setDocument()},inDisabledFieldset=addCombinator(function(elem){
return elem.disabled===true&&elem.nodeName.toLowerCase()==="fieldset"},{dir:"parentNode",
next:"legend"});try{push.apply(arr=slice.call(preferredDoc.childNodes),preferredDoc.childNodes);arr[
preferredDoc.childNodes.length].nodeType}catch(e){push={apply:arr.length?function(target,els){
pushNative.apply(target,slice.call(els))}:function(target,els){var j=target.length,i=0;while(target[
j++]=els[i++]){}target.length=j-1}}}function Sizzle(selector,context,results,seed){var m,i,elem,nid,
match,groups,newSelector,newContext=context&&context.ownerDocument,
nodeType=context?context.nodeType:9;results=results||[];if(
typeof selector!=="string"||!selector||nodeType!==1&&nodeType!==9&&nodeType!==11){return results}if(
!seed){setDocument(context);context=context||document;if(documentIsHTML){if(nodeType!==11&&(
match=rquickExpr.exec(selector))){if(m=match[1]){if(nodeType===9){if(elem=context.getElementById(m)
){if(elem.id===m){results.push(elem);return results}}else{return results}}else{if(newContext&&(
elem=newContext.getElementById(m))&&contains(context,elem)&&elem.id===m){results.push(elem);
return results}}}else if(match[2]){push.apply(results,context.getElementsByTagName(selector));
return results}else if((m=match[3])&&support.getElementsByClassName&&context.getElementsByClassName
){push.apply(results,context.getElementsByClassName(m));return results}}if(
support.qsa&&!nonnativeSelectorCache[selector+" "]&&(!rbuggyQSA||!rbuggyQSA.test(selector))&&(
nodeType!==1||context.nodeName.toLowerCase()!=="object")){newSelector=selector;newContext=context;
if(nodeType===1&&(rdescend.test(selector)||rcombinators.test(selector))){newContext=rsibling.test(
selector)&&testContext(context.parentNode)||context;if(newContext!==context||!support.scope){if(
nid=context.getAttribute("id")){nid=nid.replace(rcssescape,fcssescape)}else{context.setAttribute(
"id",nid=expando)}}groups=tokenize(selector);i=groups.length;while(i--){groups[i]=(
nid?"#"+nid:":scope")+" "+toSelector(groups[i])}newSelector=groups.join(",")}try{push.apply(results,
newContext.querySelectorAll(newSelector));return results}catch(qsaError){nonnativeSelectorCache(
selector,true)}finally{if(nid===expando){context.removeAttribute("id")}}}}}return select(
selector.replace(rtrim,"$1"),context,results,seed)}function createCache(){var keys=[];
function cache(key,value){if(keys.push(key+" ")>Expr.cacheLength){delete cache[keys.shift()]}
return cache[key+" "]=value}return cache}function markFunction(fn){fn[expando]=true;return fn}
function assert(fn){var el=document.createElement("fieldset");try{return!!fn(el)}catch(e){
return false}finally{if(el.parentNode){el.parentNode.removeChild(el)}el=null}}function addHandle(
attrs,handler){var arr=attrs.split("|"),i=arr.length;while(i--){Expr.attrHandle[arr[i]]=handler}}
function siblingCheck(a,b){var cur=b&&a,
diff=cur&&a.nodeType===1&&b.nodeType===1&&a.sourceIndex-b.sourceIndex;if(diff){return diff}if(cur){
while(cur=cur.nextSibling){if(cur===b){return-1}}}return a?1:-1}function createInputPseudo(type){
return function(elem){var name=elem.nodeName.toLowerCase();return name==="input"&&elem.type===type}}
function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return(
name==="input"||name==="button")&&elem.type===type}}function createDisabledPseudo(disabled){
return function(elem){if("form"in elem){if(elem.parentNode&&elem.disabled===false){if("label"in elem
){if("label"in elem.parentNode){return elem.parentNode.disabled===disabled}else{
return elem.disabled===disabled}}
return elem.isDisabled===disabled||elem.isDisabled!==!disabled&&inDisabledFieldset(elem)===disabled}
return elem.disabled===disabled}else if("label"in elem){return elem.disabled===disabled}return false
}}function createPositionalPseudo(fn){return markFunction(function(argument){argument=+argument;
return markFunction(function(seed,matches){var j,matchIndexes=fn([],seed.length,argument),
i=matchIndexes.length;while(i--){if(seed[j=matchIndexes[i]]){seed[j]=!(matches[j]=seed[j])}}})})}
function testContext(context){
return context&&typeof context.getElementsByTagName!=="undefined"&&context}support=Sizzle.support={}
isXML=Sizzle.isXML=function(elem){var namespace=elem.namespaceURI,docElem=(elem.ownerDocument||elem
).documentElement;return!rhtml.test(namespace||docElem&&docElem.nodeName||"HTML")};
setDocument=Sizzle.setDocument=function(node){var hasCompare,subWindow,
doc=node?node.ownerDocument||node:preferredDoc;if(
doc==document||doc.nodeType!==9||!doc.documentElement){return document}document=doc;
docElem=document.documentElement;documentIsHTML=!isXML(document);if(preferredDoc!=document&&(
subWindow=document.defaultView)&&subWindow.top!==subWindow){if(subWindow.addEventListener){
subWindow.addEventListener("unload",unloadHandler,false)}else if(subWindow.attachEvent){
subWindow.attachEvent("onunload",unloadHandler)}}support.scope=assert(function(el){
docElem.appendChild(el).appendChild(document.createElement("div"));
return typeof el.querySelectorAll!=="undefined"&&!el.querySelectorAll(":scope fieldset div").length}
);support.attributes=assert(function(el){el.className="i";return!el.getAttribute("className")});
support.getElementsByTagName=assert(function(el){el.appendChild(document.createComment(""));
return!el.getElementsByTagName("*").length});support.getElementsByClassName=rnative.test(
document.getElementsByClassName);support.getById=assert(function(el){docElem.appendChild(el
).id=expando;return!document.getElementsByName||!document.getElementsByName(expando).length});if(
support.getById){Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,funescape);
return function(elem){return elem.getAttribute("id")===attrId}};Expr.find["ID"]=function(id,context
){if(typeof context.getElementById!=="undefined"&&documentIsHTML){var elem=context.getElementById(id
);return elem?[elem]:[]}}}else{Expr.filter["ID"]=function(id){var attrId=id.replace(runescape,
funescape);return function(elem){
var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");
return node&&node.value===attrId}};Expr.find["ID"]=function(id,context){if(
typeof context.getElementById!=="undefined"&&documentIsHTML){var node,i,elems,
elem=context.getElementById(id);if(elem){node=elem.getAttributeNode("id");if(node&&node.value===id){
return[elem]}elems=context.getElementsByName(id);i=0;while(elem=elems[i++]){
node=elem.getAttributeNode("id");if(node&&node.value===id){return[elem]}}}return[]}}}Expr.find["TAG"
]=support.getElementsByTagName?function(tag,context){if(
typeof context.getElementsByTagName!=="undefined"){return context.getElementsByTagName(tag)}else if(
support.qsa){return context.querySelectorAll(tag)}}:function(tag,context){var elem,tmp=[],i=0,
results=context.getElementsByTagName(tag);if(tag==="*"){while(elem=results[i++]){if(
elem.nodeType===1){tmp.push(elem)}}return tmp}return results};Expr.find["CLASS"
]=support.getElementsByClassName&&function(className,context){if(
typeof context.getElementsByClassName!=="undefined"&&documentIsHTML){
return context.getElementsByClassName(className)}};rbuggyMatches=[];rbuggyQSA=[];if(
support.qsa=rnative.test(document.querySelectorAll)){assert(function(el){var input;
docElem.appendChild(el
).innerHTML="<a id='"+expando+"'></a>"+"<select id='"+expando+"-\r\\' msallowcapture=''>"+"<option selected=''></option></select>"
if(el.querySelectorAll("[msallowcapture^='']").length){rbuggyQSA.push(
"[*^$]="+whitespace+"*(?:''|\"\")")}if(!el.querySelectorAll("[selected]").length){rbuggyQSA.push(
"\\["+whitespace+"*(?:value|"+booleans+")")}if(!el.querySelectorAll("[id~="+expando+"-]").length){
rbuggyQSA.push("~=")}input=document.createElement("input");input.setAttribute("name","");
el.appendChild(input);if(!el.querySelectorAll("[name='']").length){rbuggyQSA.push(
"\\["+whitespace+"*name"+whitespace+"*="+whitespace+"*(?:''|\"\")")}if(!el.querySelectorAll(
":checked").length){rbuggyQSA.push(":checked")}if(!el.querySelectorAll("a#"+expando+"+*").length){
rbuggyQSA.push(".#.+[+~]")}el.querySelectorAll("\\\f");rbuggyQSA.push("[\\r\\n\\f]")});assert(
function(el){
el.innerHTML="<a href='' disabled='disabled'></a>"+"<select disabled='disabled'><option/></select>";
var input=document.createElement("input");input.setAttribute("type","hidden");el.appendChild(input
).setAttribute("name","D");if(el.querySelectorAll("[name=d]").length){rbuggyQSA.push(
"name"+whitespace+"*[*^$|!~]?=")}if(el.querySelectorAll(":enabled").length!==2){rbuggyQSA.push(
":enabled",":disabled")}docElem.appendChild(el).disabled=true;if(el.querySelectorAll(":disabled"
).length!==2){rbuggyQSA.push(":enabled",":disabled")}el.querySelectorAll("*,:x");rbuggyQSA.push(
",.*:")})}if(support.matchesSelector=rnative.test(
matches=docElem.matches||docElem.webkitMatchesSelector||docElem.mozMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector
)){assert(function(el){support.disconnectedMatch=matches.call(el,"*");matches.call(el,"[s!='']:x");
rbuggyMatches.push("!=",pseudos)})}rbuggyQSA=rbuggyQSA.length&&new RegExp(rbuggyQSA.join("|"));
rbuggyMatches=rbuggyMatches.length&&new RegExp(rbuggyMatches.join("|"));hasCompare=rnative.test(
docElem.compareDocumentPosition);contains=hasCompare||rnative.test(docElem.contains)?function(a,b){
var adown=a.nodeType===9?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!!(
bup&&bup.nodeType===1&&(adown.contains?adown.contains(bup
):a.compareDocumentPosition&&a.compareDocumentPosition(bup)&16))}:function(a,b){if(b){while(
b=b.parentNode){if(b===a){return true}}}return false};sortOrder=hasCompare?function(a,b){if(a===b){
hasDuplicate=true;return 0}var compare=!a.compareDocumentPosition-!b.compareDocumentPosition;if(
compare){return compare}compare=(a.ownerDocument||a)==(b.ownerDocument||b
)?a.compareDocumentPosition(b):1;if(compare&1||!support.sortDetached&&b.compareDocumentPosition(a
)===compare){if(a==document||a.ownerDocument==preferredDoc&&contains(preferredDoc,a)){return-1}if(
b==document||b.ownerDocument==preferredDoc&&contains(preferredDoc,b)){return 1}
return sortInput?indexOf(sortInput,a)-indexOf(sortInput,b):0}return compare&4?-1:1}:function(a,b){
if(a===b){hasDuplicate=true;return 0}var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(
!aup||!bup){return a==document?-1:b==document?1:aup?-1:bup?1:sortInput?indexOf(sortInput,a)-indexOf(
sortInput,b):0}else if(aup===bup){return siblingCheck(a,b)}cur=a;while(cur=cur.parentNode){
ap.unshift(cur)}cur=b;while(cur=cur.parentNode){bp.unshift(cur)}while(ap[i]===bp[i]){i++}
return i?siblingCheck(ap[i],bp[i]):ap[i]==preferredDoc?-1:bp[i]==preferredDoc?1:0};return document};
Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)};
Sizzle.matchesSelector=function(elem,expr){setDocument(elem);if(
support.matchesSelector&&documentIsHTML&&!nonnativeSelectorCache[expr+" "]&&(
!rbuggyMatches||!rbuggyMatches.test(expr))&&(!rbuggyQSA||!rbuggyQSA.test(expr))){try{
var ret=matches.call(elem,expr);if(
ret||support.disconnectedMatch||elem.document&&elem.document.nodeType!==11){return ret}}catch(e){
nonnativeSelectorCache(expr,true)}}return Sizzle(expr,document,null,[elem]).length>0};
Sizzle.contains=function(context,elem){if((context.ownerDocument||context)!=document){setDocument(
context)}return contains(context,elem)};Sizzle.attr=function(elem,name){if((elem.ownerDocument||elem
)!=document){setDocument(elem)}var fn=Expr.attrHandle[name.toLowerCase()],val=fn&&hasOwn.call(
Expr.attrHandle,name.toLowerCase())?fn(elem,name,!documentIsHTML):undefined;
return val!==undefined?val:support.attributes||!documentIsHTML?elem.getAttribute(name):(
val=elem.getAttributeNode(name))&&val.specified?val.value:null};Sizzle.escape=function(sel){return(
sel+"").replace(rcssescape,fcssescape)};Sizzle.error=function(msg){throw new Error(
"Syntax error, unrecognized expression: "+msg)};Sizzle.uniqueSort=function(results){var elem,
duplicates=[],j=0,i=0;hasDuplicate=!support.detectDuplicates;
sortInput=!support.sortStable&&results.slice(0);results.sort(sortOrder);if(hasDuplicate){while(
elem=results[i++]){if(elem===results[i]){j=duplicates.push(i)}}while(j--){results.splice(duplicates[
j],1)}}sortInput=null;return results};getText=Sizzle.getText=function(elem){var node,ret="",i=0,
nodeType=elem.nodeType;if(!nodeType){while(node=elem[i++]){ret+=getText(node)}}else if(
nodeType===1||nodeType===9||nodeType===11){if(typeof elem.textContent==="string"){
return elem.textContent}else{for(elem=elem.firstChild;elem;elem=elem.nextSibling){ret+=getText(elem)
}}}else if(nodeType===3||nodeType===4){return elem.nodeValue}return ret};Expr=Sizzle.selectors={
cacheLength:50,createPseudo:markFunction,match:matchExpr,attrHandle:{},find:{},relative:{">":{
dir:"parentNode",first:true}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:true},"~":{
dir:"previousSibling"}},preFilter:{ATTR:function(match){match[1]=match[1].replace(runescape,
funescape);match[3]=(match[3]||match[4]||match[5]||"").replace(runescape,funescape);if(match[2
]==="~="){match[3]=" "+match[3]+" "}return match.slice(0,4)},CHILD:function(match){match[1]=match[1
].toLowerCase();if(match[1].slice(0,3)==="nth"){if(!match[3]){Sizzle.error(match[0])}match[4]=+(
match[4]?match[5]+(match[6]||1):2*(match[3]==="even"||match[3]==="odd"));match[5]=+(match[7]+match[8
]||match[3]==="odd")}else if(match[3]){Sizzle.error(match[0])}return match},PSEUDO:function(match){
var excess,unquoted=!match[6]&&match[2];if(matchExpr["CHILD"].test(match[0])){return null}if(match[3
]){match[2]=match[4]||match[5]||""}else if(unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(
unquoted,true))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)){match[0
]=match[0].slice(0,excess);match[2]=unquoted.slice(0,excess)}return match.slice(0,3)}},filter:{
TAG:function(nodeNameSelector){var nodeName=nodeNameSelector.replace(runescape,funescape
).toLowerCase();return nodeNameSelector==="*"?function(){return true}:function(elem){
return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName}},CLASS:function(className){
var pattern=classCache[className+" "];return pattern||(pattern=new RegExp(
"(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){
return pattern.test(
typeof elem.className==="string"&&elem.className||typeof elem.getAttribute!=="undefined"&&elem.getAttribute(
"class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(
elem,name);if(result==null){return operator==="!="}if(!operator){return true}result+="";
return operator==="="?result===check:operator==="!="?result!==check:operator==="^="?check&&result.indexOf(
check)===0:operator==="*="?check&&result.indexOf(check)>-1:operator==="$="?check&&result.slice(
-check.length)===check:operator==="~="?(" "+result.replace(rwhitespace," ")+" ").indexOf(check
)>-1:operator==="|="?result===check||result.slice(0,check.length+1)===check+"-":false}},
CHILD:function(type,what,_argument,first,last){var simple=type.slice(0,3)!=="nth",
forward=type.slice(-4)!=="last",ofType=what==="of-type";return first===1&&last===0?function(elem){
return!!elem.parentNode}:function(elem,_context,xml){var cache,uniqueCache,outerCache,node,nodeIndex
,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,
name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType,diff=false;if(parent){if(simple){
while(dir){node=elem;while(node=node[dir]){if(ofType?node.nodeName.toLowerCase(
)===name:node.nodeType===1){return false}}start=dir=type==="only"&&!start&&"nextSibling"}return true
}start=[forward?parent.firstChild:parent.lastChild];if(forward&&useCache){node=parent;
outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[node.uniqueID]||(outerCache[
node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0]===dirruns&&cache[1];
diff=nodeIndex&&cache[2];node=nodeIndex&&parent.childNodes[nodeIndex];while(
node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop()){if(
node.nodeType===1&&++diff&&node===elem){uniqueCache[type]=[dirruns,nodeIndex,diff];break}}}else{if(
useCache){node=elem;outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[
node.uniqueID]||(outerCache[node.uniqueID]={});cache=uniqueCache[type]||[];nodeIndex=cache[0
]===dirruns&&cache[1];diff=nodeIndex}if(diff===false){while(node=++nodeIndex&&node&&node[dir]||(
diff=nodeIndex=0)||start.pop()){if((ofType?node.nodeName.toLowerCase()===name:node.nodeType===1
)&&++diff){if(useCache){outerCache=node[expando]||(node[expando]={});uniqueCache=outerCache[
node.uniqueID]||(outerCache[node.uniqueID]={});uniqueCache[type]=[dirruns,diff]}if(node===elem){
break}}}}}diff-=last;return diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,
argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error(
"unsupported pseudo: "+pseudo);if(fn[expando]){return fn(argument)}if(fn.length>1){args=[pseudo,
pseudo,"",argument];return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(
function(seed,matches){var idx,matched=fn(seed,argument),i=matched.length;while(i--){idx=indexOf(
seed,matched[i]);seed[idx]=!(matches[idx]=matched[i])}}):function(elem){return fn(elem,0,args)}}
return fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(
selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,_context,
xml){var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;while(i--){if(elem=unmatched[i]){
seed[i]=!(matches[i]=elem)}}}):function(elem,_context,xml){input[0]=elem;matcher(input,null,xml,
results);input[0]=null;return!results.pop()}}),has:markFunction(function(selector){return function(
elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){
text=text.replace(runescape,funescape);return function(elem){return(elem.textContent||getText(elem)
).indexOf(text)>-1}}),lang:markFunction(function(lang){if(!ridentifier.test(lang||"")){Sizzle.error(
"unsupported lang: "+lang)}lang=lang.replace(runescape,funescape).toLowerCase();return function(elem
){var elemLang;do{if(elemLang=documentIsHTML?elem.lang:elem.getAttribute("xml:lang"
)||elem.getAttribute("lang")){elemLang=elemLang.toLowerCase();
return elemLang===lang||elemLang.indexOf(lang+"-")===0}}while((elem=elem.parentNode
)&&elem.nodeType===1);return false}}),target:function(elem){
var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(
elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(
!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},
enabled:createDisabledPseudo(false),disabled:createDisabledPseudo(true),checked:function(elem){
var nodeName=elem.nodeName.toLowerCase();
return nodeName==="input"&&!!elem.checked||nodeName==="option"&&!!elem.selected},selected:function(
elem){if(elem.parentNode){elem.parentNode.selectedIndex}return elem.selected===true},empty:function(
elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling){if(elem.nodeType<6){return false}}
return true},parent:function(elem){return!Expr.pseudos["empty"](elem)},header:function(elem){
return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},
button:function(elem){var name=elem.nodeName.toLowerCase();
return name==="input"&&elem.type==="button"||name==="button"},text:function(elem){var attr;
return elem.nodeName.toLowerCase()==="input"&&elem.type==="text"&&((attr=elem.getAttribute("type")
)==null||attr.toLowerCase()==="text")},first:createPositionalPseudo(function(){return[0]}),
last:createPositionalPseudo(function(_matchIndexes,length){return[length-1]}),
eq:createPositionalPseudo(function(_matchIndexes,length,argument){return[
argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){
var i=0;for(;i<length;i+=2){matchIndexes.push(i)}return matchIndexes}),odd:createPositionalPseudo(
function(matchIndexes,length){var i=1;for(;i<length;i+=2){matchIndexes.push(i)}return matchIndexes}
),lt:createPositionalPseudo(function(matchIndexes,length,argument){
var i=argument<0?argument+length:argument>length?length:argument;for(;--i>=0;){matchIndexes.push(i)}
return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){
var i=argument<0?argument+length:argument;for(;++i<length;){matchIndexes.push(i)}return matchIndexes
})}};Expr.pseudos["nth"]=Expr.pseudos["eq"];for(i in{radio:true,checkbox:true,file:true,
password:true,image:true}){Expr.pseudos[i]=createInputPseudo(i)}for(i in{submit:true,reset:true}){
Expr.pseudos[i]=createButtonPseudo(i)}function setFilters(){}
setFilters.prototype=Expr.filters=Expr.pseudos;Expr.setFilters=new setFilters;
tokenize=Sizzle.tokenize=function(selector,parseOnly){var matched,match,tokens,type,soFar,groups,
preFilters,cached=tokenCache[selector+" "];if(cached){return parseOnly?0:cached.slice(0)}
soFar=selector;groups=[];preFilters=Expr.preFilter;while(soFar){if(!matched||(match=rcomma.exec(
soFar))){if(match){soFar=soFar.slice(match[0].length)||soFar}groups.push(tokens=[])}matched=false;
if(match=rcombinators.exec(soFar)){matched=match.shift();tokens.push({value:matched,type:match[0
].replace(rtrim," ")});soFar=soFar.slice(matched.length)}for(type in Expr.filter){if((
match=matchExpr[type].exec(soFar))&&(!preFilters[type]||(match=preFilters[type](match)))){
matched=match.shift();tokens.push({value:matched,type:type,matches:match});soFar=soFar.slice(
matched.length)}}if(!matched){break}}return parseOnly?soFar.length:soFar?Sizzle.error(selector
):tokenCache(selector,groups).slice(0)};function toSelector(tokens){var i=0,len=tokens.length,
selector="";for(;i<len;i++){selector+=tokens[i].value}return selector}function addCombinator(matcher
,combinator,base){var dir=combinator.dir,skip=combinator.next,key=skip||dir,
checkNonElements=base&&key==="parentNode",doneName=done++;return combinator.first?function(elem,
context,xml){while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){return matcher(elem,
context,xml)}}return false}:function(elem,context,xml){var oldCache,uniqueCache,outerCache,
newCache=[dirruns,doneName];if(xml){while(elem=elem[dir]){if(elem.nodeType===1||checkNonElements){
if(matcher(elem,context,xml)){return true}}}}else{while(elem=elem[dir]){if(
elem.nodeType===1||checkNonElements){outerCache=elem[expando]||(elem[expando]={});
uniqueCache=outerCache[elem.uniqueID]||(outerCache[elem.uniqueID]={});if(
skip&&skip===elem.nodeName.toLowerCase()){elem=elem[dir]||elem}else if((oldCache=uniqueCache[key]
)&&oldCache[0]===dirruns&&oldCache[1]===doneName){return newCache[2]=oldCache[2]}else{uniqueCache[
key]=newCache;if(newCache[2]=matcher(elem,context,xml)){return true}}}}}return false}}
function elementMatcher(matchers){return matchers.length>1?function(elem,context,xml){
var i=matchers.length;while(i--){if(!matchers[i](elem,context,xml)){return false}}return true
}:matchers[0]}function multipleContexts(selector,contexts,results){var i=0,len=contexts.length;for(
;i<len;i++){Sizzle(selector,contexts[i],results)}return results}function condense(unmatched,map,
filter,context,xml){var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=map!=null;for(
;i<len;i++){if(elem=unmatched[i]){if(!filter||filter(elem,context,xml)){newUnmatched.push(elem);if(
mapped){map.push(i)}}}}return newUnmatched}function setMatcher(preFilter,selector,matcher,postFilter
,postFinder,postSelector){if(postFilter&&!postFilter[expando]){postFilter=setMatcher(postFilter)}if(
postFinder&&!postFinder[expando]){postFinder=setMatcher(postFinder,postSelector)}
return markFunction(function(seed,results,context,xml){var temp,i,elem,preMap=[],postMap=[],
preexisting=results.length,elems=seed||multipleContexts(selector||"*",context.nodeType?[context
]:context,[]),matcherIn=preFilter&&(seed||!selector)?condense(elems,preMap,preFilter,context,xml
):elems,matcherOut=matcher?postFinder||(seed?preFilter:preexisting||postFilter)?[]:results:matcherIn
if(matcher){matcher(matcherIn,matcherOut,context,xml)}if(postFilter){temp=condense(matcherOut,
postMap);postFilter(temp,[],context,xml);i=temp.length;while(i--){if(elem=temp[i]){matcherOut[
postMap[i]]=!(matcherIn[postMap[i]]=elem)}}}if(seed){if(postFinder||preFilter){if(postFinder){temp=[
];i=matcherOut.length;while(i--){if(elem=matcherOut[i]){temp.push(matcherIn[i]=elem)}}postFinder(
null,matcherOut=[],temp,xml)}i=matcherOut.length;while(i--){if((elem=matcherOut[i])&&(
temp=postFinder?indexOf(seed,elem):preMap[i])>-1){seed[temp]=!(results[temp]=elem)}}}}else{
matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut
);if(postFinder){postFinder(null,results,matcherOut,xml)}else{push.apply(results,matcherOut)}}})}
function matcherFromTokens(tokens){var checkContext,matcher,j,len=tokens.length,
leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],
i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},
implicitRelative,true),matchAnyContext=addCombinator(function(elem){return indexOf(checkContext,elem
)>-1},implicitRelative,true),matchers=[function(elem,context,xml){var ret=!leadingRelative&&(
xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml
):matchAnyContext(elem,context,xml));checkContext=null;return ret}];for(;i<len;i++){if(
matcher=Expr.relative[tokens[i].type]){matchers=[addCombinator(elementMatcher(matchers),matcher)]
}else{matcher=Expr.filter[tokens[i].type].apply(null,tokens[i].matches);if(matcher[expando]){j=++i;
for(;j<len;j++){if(Expr.relative[tokens[j].type]){break}}return setMatcher(i>1&&elementMatcher(
matchers),i>1&&toSelector(tokens.slice(0,i-1).concat({value:tokens[i-2].type===" "?"*":""})
).replace(rtrim,"$1"),matcher,i<j&&matcherFromTokens(tokens.slice(i,j)),j<len&&matcherFromTokens(
tokens=tokens.slice(j)),j<len&&toSelector(tokens))}matchers.push(matcher)}}return elementMatcher(
matchers)}function matcherFromGroupMatchers(elementMatchers,setMatchers){
var bySet=setMatchers.length>0,byElement=elementMatchers.length>0,superMatcher=function(seed,context
,xml,results,outermost){var elem,j,matcher,matchedCount=0,i="0",unmatched=seed&&[],setMatched=[],
contextBackup=outermostContext,elems=seed||byElement&&Expr.find["TAG"]("*",outermost),
dirrunsUnique=dirruns+=contextBackup==null?1:Math.random()||.1,len=elems.length;if(outermost){
outermostContext=context==document||context||outermost}for(;i!==len&&(elem=elems[i])!=null;i++){if(
byElement&&elem){j=0;if(!context&&elem.ownerDocument!=document){setDocument(elem);
xml=!documentIsHTML}while(matcher=elementMatchers[j++]){if(matcher(elem,context||document,xml)){
results.push(elem);break}}if(outermost){dirruns=dirrunsUnique}}if(bySet){if(elem=!matcher&&elem){
matchedCount--}if(seed){unmatched.push(elem)}}}matchedCount+=i;if(bySet&&i!==matchedCount){j=0;
while(matcher=setMatchers[j++]){matcher(unmatched,setMatched,context,xml)}if(seed){if(matchedCount>0
){while(i--){if(!(unmatched[i]||setMatched[i])){setMatched[i]=pop.call(results)}}}
setMatched=condense(setMatched)}push.apply(results,setMatched);if(
outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1){Sizzle.uniqueSort(results)
}}if(outermost){dirruns=dirrunsUnique;outermostContext=contextBackup}return unmatched};
return bySet?markFunction(superMatcher):superMatcher}compile=Sizzle.compile=function(selector,match
){var i,setMatchers=[],elementMatchers=[],cached=compilerCache[selector+" "];if(!cached){if(!match){
match=tokenize(selector)}i=match.length;while(i--){cached=matcherFromTokens(match[i]);if(cached[
expando]){setMatchers.push(cached)}else{elementMatchers.push(cached)}}cached=compilerCache(selector,
matcherFromGroupMatchers(elementMatchers,setMatchers));cached.selector=selector}return cached};
select=Sizzle.select=function(selector,context,results,seed){var i,tokens,token,type,find,
compiled=typeof selector==="function"&&selector,match=!seed&&tokenize(
selector=compiled.selector||selector);results=results||[];if(match.length===1){tokens=match[0
]=match[0].slice(0);if(tokens.length>2&&(token=tokens[0]
).type==="ID"&&context.nodeType===9&&documentIsHTML&&Expr.relative[tokens[1].type]){context=(
Expr.find["ID"](token.matches[0].replace(runescape,funescape),context)||[])[0];if(!context){
return results}else if(compiled){context=context.parentNode}selector=selector.slice(tokens.shift(
).value.length)}i=matchExpr["needsContext"].test(selector)?0:tokens.length;while(i--){token=tokens[i
];if(Expr.relative[type=token.type]){break}if(find=Expr.find[type]){if(seed=find(token.matches[0
].replace(runescape,funescape),rsibling.test(tokens[0].type)&&testContext(context.parentNode
)||context)){tokens.splice(i,1);selector=seed.length&&toSelector(tokens);if(!selector){push.apply(
results,seed);return results}break}}}}(compiled||compile(selector,match))(seed,context,
!documentIsHTML,results,!context||rsibling.test(selector)&&testContext(context.parentNode)||context)
return results};support.sortStable=expando.split("").sort(sortOrder).join("")===expando;
support.detectDuplicates=!!hasDuplicate;setDocument();support.sortDetached=assert(function(el){
return el.compareDocumentPosition(document.createElement("fieldset"))&1});if(!assert(function(el){
el.innerHTML="<a href='#'></a>";return el.firstChild.getAttribute("href")==="#"})){addHandle(
"type|href|height|width",function(elem,name,isXML){if(!isXML){return elem.getAttribute(name,
name.toLowerCase()==="type"?1:2)}})}if(!support.attributes||!assert(function(el){
el.innerHTML="<input/>";el.firstChild.setAttribute("value","");return el.firstChild.getAttribute(
"value")===""})){addHandle("value",function(elem,_name,isXML){if(!isXML&&elem.nodeName.toLowerCase(
)==="input"){return elem.defaultValue}})}if(!assert(function(el){return el.getAttribute("disabled"
)==null})){addHandle(booleans,function(elem,name,isXML){var val;if(!isXML){return elem[name
]===true?name.toLowerCase():(val=elem.getAttributeNode(name))&&val.specified?val.value:null}})}
return Sizzle}(window);jQuery.find=Sizzle;jQuery.expr=Sizzle.selectors;jQuery.expr[":"
]=jQuery.expr.pseudos;jQuery.uniqueSort=jQuery.unique=Sizzle.uniqueSort;jQuery.text=Sizzle.getText;
jQuery.isXMLDoc=Sizzle.isXML;jQuery.contains=Sizzle.contains;jQuery.escapeSelector=Sizzle.escape;
var dir=function(elem,dir,until){var matched=[],truncate=until!==undefined;while((elem=elem[dir]
)&&elem.nodeType!==9){if(elem.nodeType===1){if(truncate&&jQuery(elem).is(until)){break}matched.push(
elem)}}return matched};var siblings=function(n,elem){var matched=[];for(;n;n=n.nextSibling){if(
n.nodeType===1&&n!==elem){matched.push(n)}}return matched};
var rneedsContext=jQuery.expr.match.needsContext;function nodeName(elem,name){
return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()}
var rsingleTag=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function winnow(
elements,qualifier,not){if(isFunction(qualifier)){return jQuery.grep(elements,function(elem,i){
return!!qualifier.call(elem,i,elem)!==not})}if(qualifier.nodeType){return jQuery.grep(elements,
function(elem){return elem===qualifier!==not})}if(typeof qualifier!=="string"){return jQuery.grep(
elements,function(elem){return indexOf.call(qualifier,elem)>-1!==not})}return jQuery.filter(
qualifier,elements,not)}jQuery.filter=function(expr,elems,not){var elem=elems[0];if(not){
expr=":not("+expr+")"}if(elems.length===1&&elem.nodeType===1){return jQuery.find.matchesSelector(
elem,expr)?[elem]:[]}return jQuery.find.matches(expr,jQuery.grep(elems,function(elem){
return elem.nodeType===1}))};jQuery.fn.extend({find:function(selector){var i,ret,len=this.length,
self=this;if(typeof selector!=="string"){return this.pushStack(jQuery(selector).filter(function(){
for(i=0;i<len;i++){if(jQuery.contains(self[i],this)){return true}}}))}ret=this.pushStack([]);for(
i=0;i<len;i++){jQuery.find(selector,self[i],ret)}return len>1?jQuery.uniqueSort(ret):ret},
filter:function(selector){return this.pushStack(winnow(this,selector||[],false))},not:function(
selector){return this.pushStack(winnow(this,selector||[],true))},is:function(selector){
return!!winnow(this,typeof selector==="string"&&rneedsContext.test(selector)?jQuery(selector
):selector||[],false).length}});var rootjQuery,rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
init=jQuery.fn.init=function(selector,context,root){var match,elem;if(!selector){return this}
root=root||rootjQuery;if(typeof selector==="string"){if(selector[0]==="<"&&selector[
selector.length-1]===">"&&selector.length>=3){match=[null,selector,null]}else{match=rquickExpr.exec(
selector)}if(match&&(match[1]||!context)){if(match[1]){context=context instanceof jQuery?context[0
]:context;jQuery.merge(this,jQuery.parseHTML(match[1],
context&&context.nodeType?context.ownerDocument||context:document,true));if(rsingleTag.test(match[1]
)&&jQuery.isPlainObject(context)){for(match in context){if(isFunction(this[match])){this[match](
context[match])}else{this.attr(match,context[match])}}}return this}else{
elem=document.getElementById(match[2]);if(elem){this[0]=elem;this.length=1}return this}}else if(
!context||context.jquery){return(context||root).find(selector)}else{return this.constructor(context
).find(selector)}}else if(selector.nodeType){this[0]=selector;this.length=1;return this}else if(
isFunction(selector)){return root.ready!==undefined?root.ready(selector):selector(jQuery)}
return jQuery.makeArray(selector,this)};init.prototype=jQuery.fn;rootjQuery=jQuery(document);
var rparentsprev=/^(?:parents|prev(?:Until|All))/,guaranteedUnique={children:true,contents:true,
next:true,prev:true};jQuery.fn.extend({has:function(target){var targets=jQuery(target,this),
l=targets.length;return this.filter(function(){var i=0;for(;i<l;i++){if(jQuery.contains(this,
targets[i])){return true}}})},closest:function(selectors,context){var cur,i=0,l=this.length,
matched=[],targets=typeof selectors!=="string"&&jQuery(selectors);if(!rneedsContext.test(selectors)
){for(;i<l;i++){for(cur=this[i];cur&&cur!==context;cur=cur.parentNode){if(cur.nodeType<11&&(
targets?targets.index(cur)>-1:cur.nodeType===1&&jQuery.find.matchesSelector(cur,selectors))){
matched.push(cur);break}}}}return this.pushStack(matched.length>1?jQuery.uniqueSort(matched):matched
)},index:function(elem){if(!elem){return this[0]&&this[0].parentNode?this.first().prevAll(
).length:-1}if(typeof elem==="string"){return indexOf.call(jQuery(elem),this[0])}
return indexOf.call(this,elem.jquery?elem[0]:elem)},add:function(selector,context){
return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(),jQuery(selector,context))))},
addBack:function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(
selector))}});function sibling(cur,dir){while((cur=cur[dir])&&cur.nodeType!==1){}return cur}
jQuery.each({parent:function(elem){var parent=elem.parentNode;
return parent&&parent.nodeType!==11?parent:null},parents:function(elem){return dir(elem,"parentNode"
)},parentsUntil:function(elem,_i,until){return dir(elem,"parentNode",until)},next:function(elem){
return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},
nextAll:function(elem){return dir(elem,"nextSibling")},prevAll:function(elem){return dir(elem,
"previousSibling")},nextUntil:function(elem,_i,until){return dir(elem,"nextSibling",until)},
prevUntil:function(elem,_i,until){return dir(elem,"previousSibling",until)},siblings:function(elem){
return siblings((elem.parentNode||{}).firstChild,elem)},children:function(elem){return siblings(
elem.firstChild)},contents:function(elem){if(elem.contentDocument!=null&&getProto(
elem.contentDocument)){return elem.contentDocument}if(nodeName(elem,"template")){
elem=elem.content||elem}return jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name
]=function(until,selector){var matched=jQuery.map(this,fn,until);if(name.slice(-5)!=="Until"){
selector=until}if(selector&&typeof selector==="string"){matched=jQuery.filter(selector,matched)}if(
this.length>1){if(!guaranteedUnique[name]){jQuery.uniqueSort(matched)}if(rparentsprev.test(name)){
matched.reverse()}}return this.pushStack(matched)}});var rnothtmlwhite=/[^\x20\t\r\n\f]+/g;
function createOptions(options){var object={};jQuery.each(options.match(rnothtmlwhite)||[],function(
_,flag){object[flag]=true});return object}jQuery.Callbacks=function(options){
options=typeof options==="string"?createOptions(options):jQuery.extend({},options);var firing,memory
,fired,locked,list=[],queue=[],firingIndex=-1,fire=function(){locked=locked||options.once;
fired=firing=true;for(;queue.length;firingIndex=-1){memory=queue.shift();while(
++firingIndex<list.length){if(list[firingIndex].apply(memory[0],memory[1]
)===false&&options.stopOnFalse){firingIndex=list.length;memory=false}}}if(!options.memory){
memory=false}firing=false;if(locked){if(memory){list=[]}else{list=""}}},self={add:function(){if(list
){if(memory&&!firing){firingIndex=list.length-1;queue.push(memory)}(function add(args){jQuery.each(
args,function(_,arg){if(isFunction(arg)){if(!options.unique||!self.has(arg)){list.push(arg)}
}else if(arg&&arg.length&&toType(arg)!=="string"){add(arg)}})})(arguments);if(memory&&!firing){fire(
)}}return this},remove:function(){jQuery.each(arguments,function(_,arg){var index;while((
index=jQuery.inArray(arg,list,index))>-1){list.splice(index,1);if(index<=firingIndex){firingIndex--}
}});return this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:list.length>0},
empty:function(){if(list){list=[]}return this},disable:function(){locked=queue=[];list=memory="";
return this},disabled:function(){return!list},lock:function(){locked=queue=[];if(!memory&&!firing){
list=memory=""}return this},locked:function(){return!!locked},fireWith:function(context,args){if(
!locked){args=args||[];args=[context,args.slice?args.slice():args];queue.push(args);if(!firing){
fire()}}return this},fire:function(){self.fireWith(this,arguments);return this},fired:function(){
return!!fired}};return self};function Identity(v){return v}function Thrower(ex){throw ex}
function adoptValue(value,resolve,reject,noValue){var method;try{if(value&&isFunction(
method=value.promise)){method.call(value).done(resolve).fail(reject)}else if(value&&isFunction(
method=value.then)){method.call(value,resolve,reject)}else{resolve.apply(undefined,[value].slice(
noValue))}}catch(value){reject.apply(undefined,[value])}}jQuery.extend({Deferred:function(func){
var tuples=[["notify","progress",jQuery.Callbacks("memory"),jQuery.Callbacks("memory"),2],["resolve"
,"done",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),0,"resolved"],["reject",
"fail",jQuery.Callbacks("once memory"),jQuery.Callbacks("once memory"),1,"rejected"]],
state="pending",promise={state:function(){return state},always:function(){deferred.done(arguments
).fail(arguments);return this},catch:function(fn){return promise.then(null,fn)},pipe:function(){
var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(_i,tuple){
var fn=isFunction(fns[tuple[4]])&&fns[tuple[4]];deferred[tuple[1]](function(){
var returned=fn&&fn.apply(this,arguments);if(returned&&isFunction(returned.promise)){
returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject)}else{
newDefer[tuple[0]+"With"](this,fn?[returned]:arguments)}})});fns=null}).promise()},then:function(
onFulfilled,onRejected,onProgress){var maxDepth=0;function resolve(depth,deferred,handler,special){
return function(){var that=this,args=arguments,mightThrow=function(){var returned,then;if(
depth<maxDepth){return}returned=handler.apply(that,args);if(returned===deferred.promise()){
throw new TypeError("Thenable self-resolution")}then=returned&&(
typeof returned==="object"||typeof returned==="function")&&returned.then;if(isFunction(then)){if(
special){then.call(returned,resolve(maxDepth,deferred,Identity,special),resolve(maxDepth,deferred,
Thrower,special))}else{maxDepth++;then.call(returned,resolve(maxDepth,deferred,Identity,special),
resolve(maxDepth,deferred,Thrower,special),resolve(maxDepth,deferred,Identity,deferred.notifyWith))}
}else{if(handler!==Identity){that=undefined;args=[returned]}(special||deferred.resolveWith)(that,
args)}},process=special?mightThrow:function(){try{mightThrow()}catch(e){if(
jQuery.Deferred.exceptionHook){jQuery.Deferred.exceptionHook(e,process.stackTrace)}if(
depth+1>=maxDepth){if(handler!==Thrower){that=undefined;args=[e]}deferred.rejectWith(that,args)}}};
if(depth){process()}else{if(jQuery.Deferred.getStackHook){
process.stackTrace=jQuery.Deferred.getStackHook()}window.setTimeout(process)}}}
return jQuery.Deferred(function(newDefer){tuples[0][3].add(resolve(0,newDefer,isFunction(onProgress
)?onProgress:Identity,newDefer.notifyWith));tuples[1][3].add(resolve(0,newDefer,isFunction(
onFulfilled)?onFulfilled:Identity));tuples[2][3].add(resolve(0,newDefer,isFunction(onRejected
)?onRejected:Thrower))}).promise()},promise:function(obj){return obj!=null?jQuery.extend(obj,promise
):promise}},deferred={};jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[5];
promise[tuple[1]]=list.add;if(stateString){list.add(function(){state=stateString},tuples[3-i][2
].disable,tuples[3-i][3].disable,tuples[0][2].lock,tuples[0][3].lock)}list.add(tuple[3].fire);
deferred[tuple[0]]=function(){deferred[tuple[0]+"With"](this===deferred?undefined:this,arguments);
return this};deferred[tuple[0]+"With"]=list.fireWith});promise.promise(deferred);if(func){func.call(
deferred,deferred)}return deferred},when:function(singleValue){var remaining=arguments.length,
i=remaining,resolveContexts=Array(i),resolveValues=slice.call(arguments),master=jQuery.Deferred(),
updateFunc=function(i){return function(value){resolveContexts[i]=this;resolveValues[i
]=arguments.length>1?slice.call(arguments):value;if(!--remaining){master.resolveWith(resolveContexts
,resolveValues)}}};if(remaining<=1){adoptValue(singleValue,master.done(updateFunc(i)).resolve,
master.reject,!remaining);if(master.state()==="pending"||isFunction(resolveValues[i]&&resolveValues[
i].then)){return master.then()}}while(i--){adoptValue(resolveValues[i],updateFunc(i),master.reject)}
return master.promise()}});var rerrorNames=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
jQuery.Deferred.exceptionHook=function(error,stack){if(
window.console&&window.console.warn&&error&&rerrorNames.test(error.name)){window.console.warn(
"jQuery.Deferred exception: "+error.message,error.stack,stack)}};jQuery.readyException=function(
error){window.setTimeout(function(){throw error})};var readyList=jQuery.Deferred();
jQuery.fn.ready=function(fn){readyList.then(fn).catch(function(error){jQuery.readyException(error)})
return this};jQuery.extend({isReady:false,readyWait:1,ready:function(wait){if(
wait===true?--jQuery.readyWait:jQuery.isReady){return}jQuery.isReady=true;if(
wait!==true&&--jQuery.readyWait>0){return}readyList.resolveWith(document,[jQuery])}});
jQuery.ready.then=readyList.then;function completed(){document.removeEventListener(
"DOMContentLoaded",completed);window.removeEventListener("load",completed);jQuery.ready()}if(
document.readyState==="complete"||document.readyState!=="loading"&&!document.documentElement.doScroll
){window.setTimeout(jQuery.ready)}else{document.addEventListener("DOMContentLoaded",completed);
window.addEventListener("load",completed)}var access=function(elems,fn,key,value,chainable,emptyGet,
raw){var i=0,len=elems.length,bulk=key==null;if(toType(key)==="object"){chainable=true;for(i in key
){access(elems,fn,i,key[i],true,emptyGet,raw)}}else if(value!==undefined){chainable=true;if(
!isFunction(value)){raw=true}if(bulk){if(raw){fn.call(elems,value);fn=null}else{bulk=fn;fn=function(
elem,_key,value){return bulk.call(jQuery(elem),value)}}}if(fn){for(;i<len;i++){fn(elems[i],key,
raw?value:value.call(elems[i],i,fn(elems[i],key)))}}}if(chainable){return elems}if(bulk){
return fn.call(elems)}return len?fn(elems[0],key):emptyGet};var rmsPrefix=/^-ms-/,
rdashAlpha=/-([a-z])/g;function fcamelCase(_all,letter){return letter.toUpperCase()}
function camelCase(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)}
var acceptData=function(owner){return owner.nodeType===1||owner.nodeType===9||!+owner.nodeType};
function Data(){this.expando=jQuery.expando+Data.uid++}Data.uid=1;Data.prototype={cache:function(
owner){var value=owner[this.expando];if(!value){value={};if(acceptData(owner)){if(owner.nodeType){
owner[this.expando]=value}else{Object.defineProperty(owner,this.expando,{value:value,
configurable:true})}}}return value},set:function(owner,data,value){var prop,cache=this.cache(owner);
if(typeof data==="string"){cache[camelCase(data)]=value}else{for(prop in data){cache[camelCase(prop)
]=data[prop]}}return cache},get:function(owner,key){return key===undefined?this.cache(owner):owner[
this.expando]&&owner[this.expando][camelCase(key)]},access:function(owner,key,value){if(
key===undefined||key&&typeof key==="string"&&value===undefined){return this.get(owner,key)}this.set(
owner,key,value);return value!==undefined?value:key},remove:function(owner,key){var i,cache=owner[
this.expando];if(cache===undefined){return}if(key!==undefined){if(Array.isArray(key)){key=key.map(
camelCase)}else{key=camelCase(key);key=key in cache?[key]:key.match(rnothtmlwhite)||[]}i=key.length;
while(i--){delete cache[key[i]]}}if(key===undefined||jQuery.isEmptyObject(cache)){if(owner.nodeType
){owner[this.expando]=undefined}else{delete owner[this.expando]}}},hasData:function(owner){
var cache=owner[this.expando];return cache!==undefined&&!jQuery.isEmptyObject(cache)}};
var dataPriv=new Data;var dataUser=new Data;var rbrace=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
rmultiDash=/[A-Z]/g;function getData(data){if(data==="true"){return true}if(data==="false"){
return false}if(data==="null"){return null}if(data===+data+""){return+data}if(rbrace.test(data)){
return JSON.parse(data)}return data}function dataAttr(elem,key,data){var name;if(
data===undefined&&elem.nodeType===1){name="data-"+key.replace(rmultiDash,"-$&").toLowerCase();
data=elem.getAttribute(name);if(typeof data==="string"){try{data=getData(data)}catch(e){}
dataUser.set(elem,key,data)}else{data=undefined}}return data}jQuery.extend({hasData:function(elem){
return dataUser.hasData(elem)||dataPriv.hasData(elem)},data:function(elem,name,data){
return dataUser.access(elem,name,data)},removeData:function(elem,name){dataUser.remove(elem,name)},
_data:function(elem,name,data){return dataPriv.access(elem,name,data)},_removeData:function(elem,
name){dataPriv.remove(elem,name)}});jQuery.fn.extend({data:function(key,value){var i,name,data,
elem=this[0],attrs=elem&&elem.attributes;if(key===undefined){if(this.length){data=dataUser.get(elem)
if(elem.nodeType===1&&!dataPriv.get(elem,"hasDataAttrs")){i=attrs.length;while(i--){if(attrs[i]){
name=attrs[i].name;if(name.indexOf("data-")===0){name=camelCase(name.slice(5));dataAttr(elem,name,
data[name])}}}dataPriv.set(elem,"hasDataAttrs",true)}}return data}if(typeof key==="object"){
return this.each(function(){dataUser.set(this,key)})}return access(this,function(value){var data;if(
elem&&value===undefined){data=dataUser.get(elem,key);if(data!==undefined){return data}data=dataAttr(
elem,key);if(data!==undefined){return data}return}this.each(function(){dataUser.set(this,key,value)}
)},null,value,arguments.length>1,null,true)},removeData:function(key){return this.each(function(){
dataUser.remove(this,key)})}});jQuery.extend({queue:function(elem,type,data){var queue;if(elem){
type=(type||"fx")+"queue";queue=dataPriv.get(elem,type);if(data){if(!queue||Array.isArray(data)){
queue=dataPriv.access(elem,type,jQuery.makeArray(data))}else{queue.push(data)}}return queue||[]}},
dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),
startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){
jQuery.dequeue(elem,type)};if(fn==="inprogress"){fn=queue.shift();startLength--}if(fn){if(
type==="fx"){queue.unshift("inprogress")}delete hooks.stop;fn.call(elem,next,hooks)}if(
!startLength&&hooks){hooks.empty.fire()}},_queueHooks:function(elem,type){var key=type+"queueHooks";
return dataPriv.get(elem,key)||dataPriv.access(elem,key,{empty:jQuery.Callbacks("once memory").add(
function(){dataPriv.remove(elem,[type+"queue",key])})})}});jQuery.fn.extend({queue:function(type,
data){var setter=2;if(typeof type!=="string"){data=type;type="fx";setter--}if(
arguments.length<setter){return jQuery.queue(this[0],type)}return data===undefined?this:this.each(
function(){var queue=jQuery.queue(this,type,data);jQuery._queueHooks(this,type);if(
type==="fx"&&queue[0]!=="inprogress"){jQuery.dequeue(this,type)}})},dequeue:function(type){
return this.each(function(){jQuery.dequeue(this,type)})},clearQueue:function(type){
return this.queue(type||"fx",[])},promise:function(type,obj){var tmp,count=1,defer=jQuery.Deferred()
,elements=this,i=this.length,resolve=function(){if(!--count){defer.resolveWith(elements,[elements])}
};if(typeof type!=="string"){obj=type;type=undefined}type=type||"fx";while(i--){tmp=dataPriv.get(
elements[i],type+"queueHooks");if(tmp&&tmp.empty){count++;tmp.empty.add(resolve)}}resolve();
return defer.promise(obj)}});var pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
var rcssNum=new RegExp("^(?:([+-])=|)("+pnum+")([a-z%]*)$","i");var cssExpand=["Top","Right",
"Bottom","Left"];var documentElement=document.documentElement;var isAttached=function(elem){
return jQuery.contains(elem.ownerDocument,elem)},composed={composed:true};if(
documentElement.getRootNode){isAttached=function(elem){return jQuery.contains(elem.ownerDocument,
elem)||elem.getRootNode(composed)===elem.ownerDocument}}var isHiddenWithinTree=function(elem,el){
elem=el||elem;return elem.style.display==="none"||elem.style.display===""&&isAttached(elem
)&&jQuery.css(elem,"display")==="none"};function adjustCSS(elem,prop,valueParts,tween){var adjusted,
scale,maxIterations=20,currentValue=tween?function(){return tween.cur()}:function(){
return jQuery.css(elem,prop,"")},initial=currentValue(),unit=valueParts&&valueParts[3]||(
jQuery.cssNumber[prop]?"":"px"),initialInUnit=elem.nodeType&&(jQuery.cssNumber[prop
]||unit!=="px"&&+initial)&&rcssNum.exec(jQuery.css(elem,prop));if(initialInUnit&&initialInUnit[3
]!==unit){initial=initial/2;unit=unit||initialInUnit[3];initialInUnit=+initial||1;while(
maxIterations--){jQuery.style(elem,prop,initialInUnit+unit);if((1-scale)*(1-(scale=currentValue(
)/initial||.5))<=0){maxIterations=0}initialInUnit=initialInUnit/scale}initialInUnit=initialInUnit*2;
jQuery.style(elem,prop,initialInUnit+unit);valueParts=valueParts||[]}if(valueParts){
initialInUnit=+initialInUnit||+initial||0;adjusted=valueParts[1]?initialInUnit+(valueParts[1]+1
)*valueParts[2]:+valueParts[2];if(tween){tween.unit=unit;tween.start=initialInUnit;
tween.end=adjusted}}return adjusted}var defaultDisplayMap={};function getDefaultDisplay(elem){
var temp,doc=elem.ownerDocument,nodeName=elem.nodeName,display=defaultDisplayMap[nodeName];if(
display){return display}temp=doc.body.appendChild(doc.createElement(nodeName));display=jQuery.css(
temp,"display");temp.parentNode.removeChild(temp);if(display==="none"){display="block"}
defaultDisplayMap[nodeName]=display;return display}function showHide(elements,show){var display,elem
,values=[],index=0,length=elements.length;for(;index<length;index++){elem=elements[index];if(
!elem.style){continue}display=elem.style.display;if(show){if(display==="none"){values[index
]=dataPriv.get(elem,"display")||null;if(!values[index]){elem.style.display=""}}if(
elem.style.display===""&&isHiddenWithinTree(elem)){values[index]=getDefaultDisplay(elem)}}else{if(
display!=="none"){values[index]="none";dataPriv.set(elem,"display",display)}}}for(
index=0;index<length;index++){if(values[index]!=null){elements[index].style.display=values[index]}}
return elements}jQuery.fn.extend({show:function(){return showHide(this,true)},hide:function(){
return showHide(this)},toggle:function(state){if(typeof state==="boolean"){return state?this.show(
):this.hide()}return this.each(function(){if(isHiddenWithinTree(this)){jQuery(this).show()}else{
jQuery(this).hide()}})}});var rcheckableType=/^(?:checkbox|radio)$/i;
var rtagName=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i;var rscriptType=/^$|^module$|\/(?:java|ecma)script/i;(
function(){var fragment=document.createDocumentFragment(),div=fragment.appendChild(
document.createElement("div")),input=document.createElement("input");input.setAttribute("type",
"radio");input.setAttribute("checked","checked");input.setAttribute("name","t");div.appendChild(
input);support.checkClone=div.cloneNode(true).cloneNode(true).lastChild.checked;
div.innerHTML="<textarea>x</textarea>";support.noCloneChecked=!!div.cloneNode(true
).lastChild.defaultValue;div.innerHTML="<option></option>";support.option=!!div.lastChild})();
var wrapMap={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,
"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0
,"",""]};wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead;
wrapMap.th=wrapMap.td;if(!support.option){wrapMap.optgroup=wrapMap.option=[1,
"<select multiple='multiple'>","</select>"]}function getAll(context,tag){var ret;if(
typeof context.getElementsByTagName!=="undefined"){ret=context.getElementsByTagName(tag||"*")
}else if(typeof context.querySelectorAll!=="undefined"){ret=context.querySelectorAll(tag||"*")}else{
ret=[]}if(tag===undefined||tag&&nodeName(context,tag)){return jQuery.merge([context],ret)}return ret
}function setGlobalEval(elems,refElements){var i=0,l=elems.length;for(;i<l;i++){dataPriv.set(elems[i
],"globalEval",!refElements||dataPriv.get(refElements[i],"globalEval"))}}var rhtml=/<|&#?\w+;/;
function buildFragment(elems,context,scripts,selection,ignored){var elem,tmp,tag,wrap,attached,j,
fragment=context.createDocumentFragment(),nodes=[],i=0,l=elems.length;for(;i<l;i++){elem=elems[i];
if(elem||elem===0){if(toType(elem)==="object"){jQuery.merge(nodes,elem.nodeType?[elem]:elem)
}else if(!rhtml.test(elem)){nodes.push(context.createTextNode(elem))}else{
tmp=tmp||fragment.appendChild(context.createElement("div"));tag=(rtagName.exec(elem)||["",""])[1
].toLowerCase();wrap=wrapMap[tag]||wrapMap._default;tmp.innerHTML=wrap[1]+jQuery.htmlPrefilter(elem
)+wrap[2];j=wrap[0];while(j--){tmp=tmp.lastChild}jQuery.merge(nodes,tmp.childNodes);
tmp=fragment.firstChild;tmp.textContent=""}}}fragment.textContent="";i=0;while(elem=nodes[i++]){if(
selection&&jQuery.inArray(elem,selection)>-1){if(ignored){ignored.push(elem)}continue}
attached=isAttached(elem);tmp=getAll(fragment.appendChild(elem),"script");if(attached){
setGlobalEval(tmp)}if(scripts){j=0;while(elem=tmp[j++]){if(rscriptType.test(elem.type||"")){
scripts.push(elem)}}}}return fragment}var rkeyEvent=/^key/,
rmouseEvent=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rtypenamespace=/^([^.]*)(?:\.(.+)|)/;
function returnTrue(){return true}function returnFalse(){return false}function expectSync(elem,type
){return elem===safeActiveElement()===(type==="focus")}function safeActiveElement(){try{
return document.activeElement}catch(err){}}function on(elem,types,selector,data,fn,one){var origFn,
type;if(typeof types==="object"){if(typeof selector!=="string"){data=data||selector;
selector=undefined}for(type in types){on(elem,type,selector,data,types[type],one)}return elem}if(
data==null&&fn==null){fn=selector;data=selector=undefined}else if(fn==null){if(
typeof selector==="string"){fn=data;data=undefined}else{fn=data;data=selector;selector=undefined}}
if(fn===false){fn=returnFalse}else if(!fn){return elem}if(one===1){origFn=fn;fn=function(event){
jQuery().off(event);return origFn.apply(this,arguments)};fn.guid=origFn.guid||(
origFn.guid=jQuery.guid++)}return elem.each(function(){jQuery.event.add(this,types,fn,data,selector)
})}jQuery.event={global:{},add:function(elem,types,handler,data,selector){var handleObjIn,
eventHandle,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,elemData=dataPriv.get(
elem);if(!acceptData(elem)){return}if(handler.handler){handleObjIn=handler;
handler=handleObjIn.handler;selector=handleObjIn.selector}if(selector){jQuery.find.matchesSelector(
documentElement,selector)}if(!handler.guid){handler.guid=jQuery.guid++}if(!(events=elemData.events)
){events=elemData.events=Object.create(null)}if(!(eventHandle=elemData.handle)){
eventHandle=elemData.handle=function(e){
return typeof jQuery!=="undefined"&&jQuery.event.triggered!==e.type?jQuery.event.dispatch.apply(elem
,arguments):undefined}}types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){
tmp=rtypenamespace.exec(types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort()
if(!type){continue}special=jQuery.event.special[type]||{};type=(
selector?special.delegateType:special.bindType)||type;special=jQuery.event.special[type]||{};
handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,
selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),
namespace:namespaces.join(".")},handleObjIn);if(!(handlers=events[type])){handlers=events[type]=[];
handlers.delegateCount=0;if(!special.setup||special.setup.call(elem,data,namespaces,eventHandle
)===false){if(elem.addEventListener){elem.addEventListener(type,eventHandle)}}}if(special.add){
special.add.call(elem,handleObj);if(!handleObj.handler.guid){handleObj.handler.guid=handler.guid}}
if(selector){handlers.splice(handlers.delegateCount++,0,handleObj)}else{handlers.push(handleObj)}
jQuery.event.global[type]=true}},remove:function(elem,types,handler,selector,mappedTypes){var j,
origCount,tmp,events,t,handleObj,special,handlers,type,namespaces,origType,
elemData=dataPriv.hasData(elem)&&dataPriv.get(elem);if(!elemData||!(events=elemData.events)){return}
types=(types||"").match(rnothtmlwhite)||[""];t=types.length;while(t--){tmp=rtypenamespace.exec(
types[t])||[];type=origType=tmp[1];namespaces=(tmp[2]||"").split(".").sort();if(!type){for(
type in events){jQuery.event.remove(elem,type+types[t],handler,selector,true)}continue}
special=jQuery.event.special[type]||{};type=(selector?special.delegateType:special.bindType)||type;
handlers=events[type]||[];tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)"
)+"(\\.|$)");origCount=j=handlers.length;while(j--){handleObj=handlers[j];if((
mappedTypes||origType===handleObj.origType)&&(!handler||handler.guid===handleObj.guid)&&(
!tmp||tmp.test(handleObj.namespace))&&(
!selector||selector===handleObj.selector||selector==="**"&&handleObj.selector)){handlers.splice(j,1)
if(handleObj.selector){handlers.delegateCount--}if(special.remove){special.remove.call(elem,
handleObj)}}}if(origCount&&!handlers.length){if(!special.teardown||special.teardown.call(elem,
namespaces,elemData.handle)===false){jQuery.removeEvent(elem,type,elemData.handle)}delete events[
type]}}if(jQuery.isEmptyObject(events)){dataPriv.remove(elem,"handle events")}},dispatch:function(
nativeEvent){var i,j,ret,matched,handleObj,handlerQueue,args=new Array(arguments.length),
event=jQuery.event.fix(nativeEvent),handlers=(dataPriv.get(this,"events")||Object.create(null))[
event.type]||[],special=jQuery.event.special[event.type]||{};args[0]=event;for(
i=1;i<arguments.length;i++){args[i]=arguments[i]}event.delegateTarget=this;if(
special.preDispatch&&special.preDispatch.call(this,event)===false){return}
handlerQueue=jQuery.event.handlers.call(this,event,handlers);i=0;while((matched=handlerQueue[i++]
)&&!event.isPropagationStopped()){event.currentTarget=matched.elem;j=0;while((
handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped()){if(
!event.rnamespace||handleObj.namespace===false||event.rnamespace.test(handleObj.namespace)){
event.handleObj=handleObj;event.data=handleObj.data;ret=((jQuery.event.special[handleObj.origType
]||{}).handle||handleObj.handler).apply(matched.elem,args);if(ret!==undefined){if((event.result=ret
)===false){event.preventDefault();event.stopPropagation()}}}}}if(special.postDispatch){
special.postDispatch.call(this,event)}return event.result},handlers:function(event,handlers){var i,
handleObj,sel,matchedHandlers,matchedSelectors,handlerQueue=[],delegateCount=handlers.delegateCount,
cur=event.target;if(delegateCount&&cur.nodeType&&!(event.type==="click"&&event.button>=1)){for(
;cur!==this;cur=cur.parentNode||this){if(cur.nodeType===1&&!(
event.type==="click"&&cur.disabled===true)){matchedHandlers=[];matchedSelectors={};for(
i=0;i<delegateCount;i++){handleObj=handlers[i];sel=handleObj.selector+" ";if(matchedSelectors[sel
]===undefined){matchedSelectors[sel]=handleObj.needsContext?jQuery(sel,this).index(cur
)>-1:jQuery.find(sel,this,null,[cur]).length}if(matchedSelectors[sel]){matchedHandlers.push(
handleObj)}}if(matchedHandlers.length){handlerQueue.push({elem:cur,handlers:matchedHandlers})}}}}
cur=this;if(delegateCount<handlers.length){handlerQueue.push({elem:cur,handlers:handlers.slice(
delegateCount)})}return handlerQueue},addProp:function(name,hook){Object.defineProperty(
jQuery.Event.prototype,name,{enumerable:true,configurable:true,get:isFunction(hook)?function(){if(
this.originalEvent){return hook(this.originalEvent)}}:function(){if(this.originalEvent){
return this.originalEvent[name]}},set:function(value){Object.defineProperty(this,name,{
enumerable:true,configurable:true,writable:true,value:value})}})},fix:function(originalEvent){
return originalEvent[jQuery.expando]?originalEvent:new jQuery.Event(originalEvent)},special:{load:{
noBubble:true},click:{setup:function(data){var el=this||data;if(rcheckableType.test(el.type
)&&el.click&&nodeName(el,"input")){leverageNative(el,"click",returnTrue)}return false},
trigger:function(data){var el=this||data;if(rcheckableType.test(el.type)&&el.click&&nodeName(el,
"input")){leverageNative(el,"click")}return true},_default:function(event){var target=event.target;
return rcheckableType.test(target.type)&&target.click&&nodeName(target,"input")&&dataPriv.get(target
,"click")||nodeName(target,"a")}},beforeunload:{postDispatch:function(event){if(
event.result!==undefined&&event.originalEvent){event.originalEvent.returnValue=event.result}}}}};
function leverageNative(el,type,expectSync){if(!expectSync){if(dataPriv.get(el,type)===undefined){
jQuery.event.add(el,type,returnTrue)}return}dataPriv.set(el,type,false);jQuery.event.add(el,type,{
namespace:false,handler:function(event){var notAsync,result,saved=dataPriv.get(this,type);if(
event.isTrigger&1&&this[type]){if(!saved.length){saved=slice.call(arguments);dataPriv.set(this,type,
saved);notAsync=expectSync(this,type);this[type]();result=dataPriv.get(this,type);if(
saved!==result||notAsync){dataPriv.set(this,type,false)}else{result={}}if(saved!==result){
event.stopImmediatePropagation();event.preventDefault();return result.value}}else if((
jQuery.event.special[type]||{}).delegateType){event.stopPropagation()}}else if(saved.length){
dataPriv.set(this,type,{value:jQuery.event.trigger(jQuery.extend(saved[0],jQuery.Event.prototype),
saved.slice(1),this)});event.stopImmediatePropagation()}}})}jQuery.removeEvent=function(elem,type,
handle){if(elem.removeEventListener){elem.removeEventListener(type,handle)}};jQuery.Event=function(
src,props){if(!(this instanceof jQuery.Event)){return new jQuery.Event(src,props)}if(src&&src.type){
this.originalEvent=src;this.type=src.type;
this.isDefaultPrevented=src.defaultPrevented||src.defaultPrevented===undefined&&src.returnValue===false?returnTrue:returnFalse
this.target=src.target&&src.target.nodeType===3?src.target.parentNode:src.target;
this.currentTarget=src.currentTarget;this.relatedTarget=src.relatedTarget}else{this.type=src}if(
props){jQuery.extend(this,props)}this.timeStamp=src&&src.timeStamp||Date.now();this[jQuery.expando
]=true};jQuery.Event.prototype={constructor:jQuery.Event,isDefaultPrevented:returnFalse,
isPropagationStopped:returnFalse,isImmediatePropagationStopped:returnFalse,isSimulated:false,
preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=returnTrue;if(
e&&!this.isSimulated){e.preventDefault()}},stopPropagation:function(){var e=this.originalEvent;
this.isPropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopPropagation()}},
stopImmediatePropagation:function(){var e=this.originalEvent;
this.isImmediatePropagationStopped=returnTrue;if(e&&!this.isSimulated){e.stopImmediatePropagation()}
this.stopPropagation()}};jQuery.each({altKey:true,bubbles:true,cancelable:true,changedTouches:true,
ctrlKey:true,detail:true,eventPhase:true,metaKey:true,pageX:true,pageY:true,shiftKey:true,view:true,
char:true,code:true,charCode:true,key:true,keyCode:true,button:true,buttons:true,clientX:true,
clientY:true,offsetX:true,offsetY:true,pointerId:true,pointerType:true,screenX:true,screenY:true,
targetTouches:true,toElement:true,touches:true,which:function(event){var button=event.button;if(
event.which==null&&rkeyEvent.test(event.type)){
return event.charCode!=null?event.charCode:event.keyCode}if(
!event.which&&button!==undefined&&rmouseEvent.test(event.type)){if(button&1){return 1}if(button&2){
return 3}if(button&4){return 2}return 0}return event.which}},jQuery.event.addProp);jQuery.each({
focus:"focusin",blur:"focusout"},function(type,delegateType){jQuery.event.special[type]={
setup:function(){leverageNative(this,type,expectSync);return false},trigger:function(){
leverageNative(this,type);return true},delegateType:delegateType}});jQuery.each({
mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},
function(orig,fix){jQuery.event.special[orig]={delegateType:fix,bindType:fix,handle:function(event){
var ret,target=this,related=event.relatedTarget,handleObj=event.handleObj;if(
!related||related!==target&&!jQuery.contains(target,related)){event.type=handleObj.origType;
ret=handleObj.handler.apply(this,arguments);event.type=fix}return ret}}});jQuery.fn.extend({
on:function(types,selector,data,fn){return on(this,types,selector,data,fn)},one:function(types,
selector,data,fn){return on(this,types,selector,data,fn,1)},off:function(types,selector,fn){
var handleObj,type;if(types&&types.preventDefault&&types.handleObj){handleObj=types.handleObj;
jQuery(types.delegateTarget).off(
handleObj.namespace?handleObj.origType+"."+handleObj.namespace:handleObj.origType,handleObj.selector
,handleObj.handler);return this}if(typeof types==="object"){for(type in types){this.off(type,
selector,types[type])}return this}if(selector===false||typeof selector==="function"){fn=selector;
selector=undefined}if(fn===false){fn=returnFalse}return this.each(function(){jQuery.event.remove(
this,types,fn,selector)})}});var rnoInnerhtml=/<script|<style|<link/i,
rchecked=/checked\s*(?:[^=]|=\s*.checked.)/i,rcleanScript=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g
function manipulationTarget(elem,content){if(nodeName(elem,"table")&&nodeName(
content.nodeType!==11?content:content.firstChild,"tr")){return jQuery(elem).children("tbody")[0
]||elem}return elem}function disableScript(elem){elem.type=(elem.getAttribute("type")!==null
)+"/"+elem.type;return elem}function restoreScript(elem){if((elem.type||"").slice(0,5)==="true/"){
elem.type=elem.type.slice(5)}else{elem.removeAttribute("type")}return elem}function cloneCopyEvent(
src,dest){var i,l,type,pdataOld,udataOld,udataCur,events;if(dest.nodeType!==1){return}if(
dataPriv.hasData(src)){pdataOld=dataPriv.get(src);events=pdataOld.events;if(events){dataPriv.remove(
dest,"handle events");for(type in events){for(i=0,l=events[type].length;i<l;i++){jQuery.event.add(
dest,type,events[type][i])}}}}if(dataUser.hasData(src)){udataOld=dataUser.access(src);
udataCur=jQuery.extend({},udataOld);dataUser.set(dest,udataCur)}}function fixInput(src,dest){
var nodeName=dest.nodeName.toLowerCase();if(nodeName==="input"&&rcheckableType.test(src.type)){
dest.checked=src.checked}else if(nodeName==="input"||nodeName==="textarea"){
dest.defaultValue=src.defaultValue}}function domManip(collection,args,callback,ignored){args=flat(
args);var fragment,first,scripts,hasScripts,node,doc,i=0,l=collection.length,iNoClone=l-1,
value=args[0],valueIsFunction=isFunction(value);if(
valueIsFunction||l>1&&typeof value==="string"&&!support.checkClone&&rchecked.test(value)){
return collection.each(function(index){var self=collection.eq(index);if(valueIsFunction){args[0
]=value.call(this,index,self.html())}domManip(self,args,callback,ignored)})}if(l){
fragment=buildFragment(args,collection[0].ownerDocument,false,collection,ignored);
first=fragment.firstChild;if(fragment.childNodes.length===1){fragment=first}if(first||ignored){
scripts=jQuery.map(getAll(fragment,"script"),disableScript);hasScripts=scripts.length;for(;i<l;i++){
node=fragment;if(i!==iNoClone){node=jQuery.clone(node,true,true);if(hasScripts){jQuery.merge(scripts
,getAll(node,"script"))}}callback.call(collection[i],node,i)}if(hasScripts){doc=scripts[
scripts.length-1].ownerDocument;jQuery.map(scripts,restoreScript);for(i=0;i<hasScripts;i++){
node=scripts[i];if(rscriptType.test(node.type||"")&&!dataPriv.access(node,"globalEval"
)&&jQuery.contains(doc,node)){if(node.src&&(node.type||"").toLowerCase()!=="module"){if(
jQuery._evalUrl&&!node.noModule){jQuery._evalUrl(node.src,{nonce:node.nonce||node.getAttribute(
"nonce")},doc)}}else{DOMEval(node.textContent.replace(rcleanScript,""),node,doc)}}}}}}
return collection}function remove(elem,selector,keepData){var node,nodes=selector?jQuery.filter(
selector,elem):elem,i=0;for(;(node=nodes[i])!=null;i++){if(!keepData&&node.nodeType===1){
jQuery.cleanData(getAll(node))}if(node.parentNode){if(keepData&&isAttached(node)){setGlobalEval(
getAll(node,"script"))}node.parentNode.removeChild(node)}}return elem}jQuery.extend({
htmlPrefilter:function(html){return html},clone:function(elem,dataAndEvents,deepDataAndEvents){var i
,l,srcElements,destElements,clone=elem.cloneNode(true),inPage=isAttached(elem);if(
!support.noCloneChecked&&(elem.nodeType===1||elem.nodeType===11)&&!jQuery.isXMLDoc(elem)){
destElements=getAll(clone);srcElements=getAll(elem);for(i=0,l=srcElements.length;i<l;i++){fixInput(
srcElements[i],destElements[i])}}if(dataAndEvents){if(deepDataAndEvents){
srcElements=srcElements||getAll(elem);destElements=destElements||getAll(clone);for(i=0,
l=srcElements.length;i<l;i++){cloneCopyEvent(srcElements[i],destElements[i])}}else{cloneCopyEvent(
elem,clone)}}destElements=getAll(clone,"script");if(destElements.length>0){setGlobalEval(
destElements,!inPage&&getAll(elem,"script"))}return clone},cleanData:function(elems){var data,elem,
type,special=jQuery.event.special,i=0;for(;(elem=elems[i])!==undefined;i++){if(acceptData(elem)){if(
data=elem[dataPriv.expando]){if(data.events){for(type in data.events){if(special[type]){
jQuery.event.remove(elem,type)}else{jQuery.removeEvent(elem,type,data.handle)}}}elem[
dataPriv.expando]=undefined}if(elem[dataUser.expando]){elem[dataUser.expando]=undefined}}}}});
jQuery.fn.extend({detach:function(selector){return remove(this,selector,true)},remove:function(
selector){return remove(this,selector)},text:function(value){return access(this,function(value){
return value===undefined?jQuery.text(this):this.empty().each(function(){if(
this.nodeType===1||this.nodeType===11||this.nodeType===9){this.textContent=value}})},null,value,
arguments.length)},append:function(){return domManip(this,arguments,function(elem){if(
this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);
target.appendChild(elem)}})},prepend:function(){return domManip(this,arguments,function(elem){if(
this.nodeType===1||this.nodeType===11||this.nodeType===9){var target=manipulationTarget(this,elem);
target.insertBefore(elem,target.firstChild)}})},before:function(){return domManip(this,arguments,
function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,this)}})},after:function(){
return domManip(this,arguments,function(elem){if(this.parentNode){this.parentNode.insertBefore(elem,
this.nextSibling)}})},empty:function(){var elem,i=0;for(;(elem=this[i])!=null;i++){if(
elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.textContent=""}}return this},
clone:function(dataAndEvents,deepDataAndEvents){
dataAndEvents=dataAndEvents==null?false:dataAndEvents;
deepDataAndEvents=deepDataAndEvents==null?dataAndEvents:deepDataAndEvents;return this.map(function(
){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return access(
this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined&&elem.nodeType===1
){return elem.innerHTML}if(typeof value==="string"&&!rnoInnerhtml.test(value)&&!wrapMap[(
rtagName.exec(value)||["",""])[1].toLowerCase()]){value=jQuery.htmlPrefilter(value);try{for(;i<l;i++
){elem=this[i]||{};if(elem.nodeType===1){jQuery.cleanData(getAll(elem,false));elem.innerHTML=value}}
elem=0}catch(e){}}if(elem){this.empty().append(value)}},null,value,arguments.length)},
replaceWith:function(){var ignored=[];return domManip(this,arguments,function(elem){
var parent=this.parentNode;if(jQuery.inArray(this,ignored)<0){jQuery.cleanData(getAll(this));if(
parent){parent.replaceChild(elem,this)}}},ignored)}});jQuery.each({appendTo:"append",
prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(
name,original){jQuery.fn[name]=function(selector){var elems,ret=[],insert=jQuery(selector),
last=insert.length-1,i=0;for(;i<=last;i++){elems=i===last?this:this.clone(true);jQuery(insert[i])[
original](elems);push.apply(ret,elems.get())}return this.pushStack(ret)}});var rnumnonpx=new RegExp(
"^("+pnum+")(?!px)[a-z%]+$","i");var getStyles=function(elem){
var view=elem.ownerDocument.defaultView;if(!view||!view.opener){view=window}
return view.getComputedStyle(elem)};var swap=function(elem,options,callback){var ret,name,old={};
for(name in options){old[name]=elem.style[name];elem.style[name]=options[name]}ret=callback.call(
elem);for(name in options){elem.style[name]=old[name]}return ret};var rboxStyle=new RegExp(
cssExpand.join("|"),"i");(function(){function computeStyleTests(){if(!div){return}
container.style.cssText="position:absolute;left:-11111px;width:60px;"+"margin-top:1px;padding:0;border:0"
div.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;"+"margin:auto;border:1px;padding:1px;"+"width:60%;top:1%"
documentElement.appendChild(container).appendChild(div);var divStyle=window.getComputedStyle(div);
pixelPositionVal=divStyle.top!=="1%";reliableMarginLeftVal=roundPixelMeasures(divStyle.marginLeft
)===12;div.style.right="60%";pixelBoxStylesVal=roundPixelMeasures(divStyle.right)===36;
boxSizingReliableVal=roundPixelMeasures(divStyle.width)===36;div.style.position="absolute";
scrollboxSizeVal=roundPixelMeasures(div.offsetWidth/3)===12;documentElement.removeChild(container);
div=null}function roundPixelMeasures(measure){return Math.round(parseFloat(measure))}
var pixelPositionVal,boxSizingReliableVal,scrollboxSizeVal,pixelBoxStylesVal,reliableTrDimensionsVal
,reliableMarginLeftVal,container=document.createElement("div"),div=document.createElement("div");if(
!div.style){return}div.style.backgroundClip="content-box";div.cloneNode(true
).style.backgroundClip="";support.clearCloneStyle=div.style.backgroundClip==="content-box";
jQuery.extend(support,{boxSizingReliable:function(){computeStyleTests();return boxSizingReliableVal
},pixelBoxStyles:function(){computeStyleTests();return pixelBoxStylesVal},pixelPosition:function(){
computeStyleTests();return pixelPositionVal},reliableMarginLeft:function(){computeStyleTests();
return reliableMarginLeftVal},scrollboxSize:function(){computeStyleTests();return scrollboxSizeVal},
reliableTrDimensions:function(){var table,tr,trChild,trStyle;if(reliableTrDimensionsVal==null){
table=document.createElement("table");tr=document.createElement("tr");
trChild=document.createElement("div");table.style.cssText="position:absolute;left:-11111px";
tr.style.height="1px";trChild.style.height="9px";documentElement.appendChild(table).appendChild(tr
).appendChild(trChild);trStyle=window.getComputedStyle(tr);reliableTrDimensionsVal=parseInt(
trStyle.height)>3;documentElement.removeChild(table)}return reliableTrDimensionsVal}})})();
function curCSS(elem,name,computed){var width,minWidth,maxWidth,ret,style=elem.style;
computed=computed||getStyles(elem);if(computed){ret=computed.getPropertyValue(name)||computed[name];
if(ret===""&&!isAttached(elem)){ret=jQuery.style(elem,name)}if(!support.pixelBoxStyles(
)&&rnumnonpx.test(ret)&&rboxStyle.test(name)){width=style.width;minWidth=style.minWidth;
maxWidth=style.maxWidth;style.minWidth=style.maxWidth=style.width=ret;ret=computed.width;
style.width=width;style.minWidth=minWidth;style.maxWidth=maxWidth}}return ret!==undefined?ret+"":ret
}function addGetHookIf(conditionFn,hookFn){return{get:function(){if(conditionFn()){delete this.get;
return}return(this.get=hookFn).apply(this,arguments)}}}var cssPrefixes=["Webkit","Moz","ms"],
emptyStyle=document.createElement("div").style,vendorProps={};function vendorPropName(name){
var capName=name[0].toUpperCase()+name.slice(1),i=cssPrefixes.length;while(i--){name=cssPrefixes[i
]+capName;if(name in emptyStyle){return name}}}function finalPropName(name){
var final=jQuery.cssProps[name]||vendorProps[name];if(final){return final}if(name in emptyStyle){
return name}return vendorProps[name]=vendorPropName(name)||name}
var rdisplayswap=/^(none|table(?!-c[ea]).+)/,rcustomProp=/^--/,cssShow={position:"absolute",
visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:"0",fontWeight:"400"};
function setPositiveNumber(_elem,value,subtract){var matches=rcssNum.exec(value);
return matches?Math.max(0,matches[2]-(subtract||0))+(matches[3]||"px"):value}
function boxModelAdjustment(elem,dimension,box,isBorderBox,styles,computedVal){
var i=dimension==="width"?1:0,extra=0,delta=0;if(box===(isBorderBox?"border":"content")){return 0}
for(;i<4;i+=2){if(box==="margin"){delta+=jQuery.css(elem,box+cssExpand[i],true,styles)}if(
!isBorderBox){delta+=jQuery.css(elem,"padding"+cssExpand[i],true,styles);if(box!=="padding"){
delta+=jQuery.css(elem,"border"+cssExpand[i]+"Width",true,styles)}else{extra+=jQuery.css(elem,
"border"+cssExpand[i]+"Width",true,styles)}}else{if(box==="content"){delta-=jQuery.css(elem,
"padding"+cssExpand[i],true,styles)}if(box!=="margin"){delta-=jQuery.css(elem,"border"+cssExpand[i
]+"Width",true,styles)}}}if(!isBorderBox&&computedVal>=0){delta+=Math.max(0,Math.ceil(elem[
"offset"+dimension[0].toUpperCase()+dimension.slice(1)]-computedVal-delta-extra-.5))||0}return delta
}function getWidthOrHeight(elem,dimension,extra){var styles=getStyles(elem),
boxSizingNeeded=!support.boxSizingReliable()||extra,isBorderBox=boxSizingNeeded&&jQuery.css(elem,
"boxSizing",false,styles)==="border-box",valueIsBorderBox=isBorderBox,val=curCSS(elem,dimension,
styles),offsetProp="offset"+dimension[0].toUpperCase()+dimension.slice(1);if(rnumnonpx.test(val)){
if(!extra){return val}val="auto"}if((!support.boxSizingReliable(
)&&isBorderBox||!support.reliableTrDimensions()&&nodeName(elem,"tr")||val==="auto"||!parseFloat(val
)&&jQuery.css(elem,"display",false,styles)==="inline")&&elem.getClientRects().length){
isBorderBox=jQuery.css(elem,"boxSizing",false,styles)==="border-box";
valueIsBorderBox=offsetProp in elem;if(valueIsBorderBox){val=elem[offsetProp]}}val=parseFloat(val
)||0;return val+boxModelAdjustment(elem,dimension,extra||(isBorderBox?"border":"content"),
valueIsBorderBox,styles,val)+"px"}jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(
computed){var ret=curCSS(elem,"opacity");return ret===""?"1":ret}}}},cssNumber:{
animationIterationCount:true,columnCount:true,fillOpacity:true,flexGrow:true,flexShrink:true,
fontWeight:true,gridArea:true,gridColumn:true,gridColumnEnd:true,gridColumnStart:true,gridRow:true,
gridRowEnd:true,gridRowStart:true,lineHeight:true,opacity:true,order:true,orphans:true,widows:true,
zIndex:true,zoom:true},cssProps:{},style:function(elem,name,value,extra){if(
!elem||elem.nodeType===3||elem.nodeType===8||!elem.style){return}var ret,type,hooks,
origName=camelCase(name),isCustomProp=rcustomProp.test(name),style=elem.style;if(!isCustomProp){
name=finalPropName(origName)}hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(
value!==undefined){type=typeof value;if(type==="string"&&(ret=rcssNum.exec(value))&&ret[1]){
value=adjustCSS(elem,name,ret);type="number"}if(value==null||value!==value){return}if(
type==="number"&&!isCustomProp){value+=ret&&ret[3]||(jQuery.cssNumber[origName]?"":"px")}if(
!support.clearCloneStyle&&value===""&&name.indexOf("background")===0){style[name]="inherit"}if(
!hooks||!("set"in hooks)||(value=hooks.set(elem,value,extra))!==undefined){if(isCustomProp){
style.setProperty(name,value)}else{style[name]=value}}}else{if(hooks&&"get"in hooks&&(ret=hooks.get(
elem,false,extra))!==undefined){return ret}return style[name]}},css:function(elem,name,extra,styles
){var val,num,hooks,origName=camelCase(name),isCustomProp=rcustomProp.test(name);if(!isCustomProp){
name=finalPropName(origName)}hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName];if(
hooks&&"get"in hooks){val=hooks.get(elem,true,extra)}if(val===undefined){val=curCSS(elem,name,styles
)}if(val==="normal"&&name in cssNormalTransform){val=cssNormalTransform[name]}if(extra===""||extra){
num=parseFloat(val);return extra===true||isFinite(num)?num||0:val}return val}});jQuery.each([
"height","width"],function(_i,dimension){jQuery.cssHooks[dimension]={get:function(elem,computed,
extra){if(computed){return rdisplayswap.test(jQuery.css(elem,"display"))&&(!elem.getClientRects(
).length||!elem.getBoundingClientRect().width)?swap(elem,cssShow,function(){return getWidthOrHeight(
elem,dimension,extra)}):getWidthOrHeight(elem,dimension,extra)}},set:function(elem,value,extra){
var matches,styles=getStyles(elem),scrollboxSizeBuggy=!support.scrollboxSize(
)&&styles.position==="absolute",boxSizingNeeded=scrollboxSizeBuggy||extra,
isBorderBox=boxSizingNeeded&&jQuery.css(elem,"boxSizing",false,styles)==="border-box",
subtract=extra?boxModelAdjustment(elem,dimension,extra,isBorderBox,styles):0;if(
isBorderBox&&scrollboxSizeBuggy){subtract-=Math.ceil(elem["offset"+dimension[0].toUpperCase(
)+dimension.slice(1)]-parseFloat(styles[dimension])-boxModelAdjustment(elem,dimension,"border",false
,styles)-.5)}if(subtract&&(matches=rcssNum.exec(value))&&(matches[3]||"px")!=="px"){elem.style[
dimension]=value;value=jQuery.css(elem,dimension)}return setPositiveNumber(elem,value,subtract)}}});
jQuery.cssHooks.marginLeft=addGetHookIf(support.reliableMarginLeft,function(elem,computed){if(
computed){return(parseFloat(curCSS(elem,"marginLeft"))||elem.getBoundingClientRect().left-swap(elem,
{marginLeft:0},function(){return elem.getBoundingClientRect().left}))+"px"}});jQuery.each({
margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={
expand:function(value){var i=0,expanded={},parts=typeof value==="string"?value.split(" "):[value];
for(;i<4;i++){expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0]}return expanded}};
if(prefix!=="margin"){jQuery.cssHooks[prefix+suffix].set=setPositiveNumber}});jQuery.fn.extend({
css:function(name,value){return access(this,function(elem,name,value){var styles,len,map={},i=0;if(
Array.isArray(name)){styles=getStyles(elem);len=name.length;for(;i<len;i++){map[name[i]]=jQuery.css(
elem,name[i],false,styles)}return map}return value!==undefined?jQuery.style(elem,name,value
):jQuery.css(elem,name)},name,value,arguments.length>1)}});function Tween(elem,options,prop,end,
easing){return new Tween.prototype.init(elem,options,prop,end,easing)}jQuery.Tween=Tween;
Tween.prototype={constructor:Tween,init:function(elem,options,prop,end,easing,unit){this.elem=elem;
this.prop=prop;this.easing=easing||jQuery.easing._default;this.options=options;
this.start=this.now=this.cur();this.end=end;this.unit=unit||(jQuery.cssNumber[prop]?"":"px")},
cur:function(){var hooks=Tween.propHooks[this.prop];return hooks&&hooks.get?hooks.get(this
):Tween.propHooks._default.get(this)},run:function(percent){var eased,hooks=Tween.propHooks[
this.prop];if(this.options.duration){this.pos=eased=jQuery.easing[this.easing](percent,
this.options.duration*percent,0,1,this.options.duration)}else{this.pos=eased=percent}this.now=(
this.end-this.start)*eased+this.start;if(this.options.step){this.options.step.call(this.elem,
this.now,this)}if(hooks&&hooks.set){hooks.set(this)}else{Tween.propHooks._default.set(this)}
return this}};Tween.prototype.init.prototype=Tween.prototype;Tween.propHooks={_default:{
get:function(tween){var result;if(tween.elem.nodeType!==1||tween.elem[tween.prop
]!=null&&tween.elem.style[tween.prop]==null){return tween.elem[tween.prop]}result=jQuery.css(
tween.elem,tween.prop,"");return!result||result==="auto"?0:result},set:function(tween){if(
jQuery.fx.step[tween.prop]){jQuery.fx.step[tween.prop](tween)}else if(tween.elem.nodeType===1&&(
jQuery.cssHooks[tween.prop]||tween.elem.style[finalPropName(tween.prop)]!=null)){jQuery.style(
tween.elem,tween.prop,tween.now+tween.unit)}else{tween.elem[tween.prop]=tween.now}}}};
Tween.propHooks.scrollTop=Tween.propHooks.scrollLeft={set:function(tween){if(
tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now}}};jQuery.easing={
linear:function(p){return p},swing:function(p){return.5-Math.cos(p*Math.PI)/2},_default:"swing"};
jQuery.fx=Tween.prototype.init;jQuery.fx.step={};var fxNow,inProgress,
rfxtypes=/^(?:toggle|show|hide)$/,rrun=/queueHooks$/;function schedule(){if(inProgress){if(
document.hidden===false&&window.requestAnimationFrame){window.requestAnimationFrame(schedule)}else{
window.setTimeout(schedule,jQuery.fx.interval)}jQuery.fx.tick()}}function createFxNow(){
window.setTimeout(function(){fxNow=undefined});return fxNow=Date.now()}function genFx(type,
includeWidth){var which,i=0,attrs={height:type};includeWidth=includeWidth?1:0;for(
;i<4;i+=2-includeWidth){which=cssExpand[i];attrs["margin"+which]=attrs["padding"+which]=type}if(
includeWidth){attrs.opacity=attrs.width=type}return attrs}function createTween(value,prop,animation
){var tween,collection=(Animation.tweeners[prop]||[]).concat(Animation.tweeners["*"]),index=0,
length=collection.length;for(;index<length;index++){if(tween=collection[index].call(animation,prop,
value)){return tween}}}function defaultPrefilter(elem,props,opts){var prop,value,toggle,hooks,
oldfire,propTween,restoreDisplay,display,isBox="width"in props||"height"in props,anim=this,orig={},
style=elem.style,hidden=elem.nodeType&&isHiddenWithinTree(elem),dataShow=dataPriv.get(elem,"fxshow")
if(!opts.queue){hooks=jQuery._queueHooks(elem,"fx");if(hooks.unqueued==null){hooks.unqueued=0;
oldfire=hooks.empty.fire;hooks.empty.fire=function(){if(!hooks.unqueued){oldfire()}}}
hooks.unqueued++;anim.always(function(){anim.always(function(){hooks.unqueued--;if(!jQuery.queue(
elem,"fx").length){hooks.empty.fire()}})})}for(prop in props){value=props[prop];if(rfxtypes.test(
value)){delete props[prop];toggle=toggle||value==="toggle";if(value===(hidden?"hide":"show")){if(
value==="show"&&dataShow&&dataShow[prop]!==undefined){hidden=true}else{continue}}orig[prop
]=dataShow&&dataShow[prop]||jQuery.style(elem,prop)}}propTween=!jQuery.isEmptyObject(props);if(
!propTween&&jQuery.isEmptyObject(orig)){return}if(isBox&&elem.nodeType===1){opts.overflow=[
style.overflow,style.overflowX,style.overflowY];restoreDisplay=dataShow&&dataShow.display;if(
restoreDisplay==null){restoreDisplay=dataPriv.get(elem,"display")}display=jQuery.css(elem,"display")
if(display==="none"){if(restoreDisplay){display=restoreDisplay}else{showHide([elem],true);
restoreDisplay=elem.style.display||restoreDisplay;display=jQuery.css(elem,"display");showHide([elem]
)}}if(display==="inline"||display==="inline-block"&&restoreDisplay!=null){if(jQuery.css(elem,"float"
)==="none"){if(!propTween){anim.done(function(){style.display=restoreDisplay});if(
restoreDisplay==null){display=style.display;restoreDisplay=display==="none"?"":display}}
style.display="inline-block"}}}if(opts.overflow){style.overflow="hidden";anim.always(function(){
style.overflow=opts.overflow[0];style.overflowX=opts.overflow[1];style.overflowY=opts.overflow[2]})}
propTween=false;for(prop in orig){if(!propTween){if(dataShow){if("hidden"in dataShow){
hidden=dataShow.hidden}}else{dataShow=dataPriv.access(elem,"fxshow",{display:restoreDisplay})}if(
toggle){dataShow.hidden=!hidden}if(hidden){showHide([elem],true)}anim.done(function(){if(!hidden){
showHide([elem])}dataPriv.remove(elem,"fxshow");for(prop in orig){jQuery.style(elem,prop,orig[prop])
}})}propTween=createTween(hidden?dataShow[prop]:0,prop,anim);if(!(prop in dataShow)){dataShow[prop
]=propTween.start;if(hidden){propTween.end=propTween.start;propTween.start=0}}}}function propFilter(
props,specialEasing){var index,name,easing,value,hooks;for(index in props){name=camelCase(index);
easing=specialEasing[name];value=props[index];if(Array.isArray(value)){easing=value[1];value=props[
index]=value[0]}if(index!==name){props[name]=value;delete props[index]}hooks=jQuery.cssHooks[name];
if(hooks&&"expand"in hooks){value=hooks.expand(value);delete props[name];for(index in value){if(!(
index in props)){props[index]=value[index];specialEasing[index]=easing}}}else{specialEasing[name
]=easing}}}function Animation(elem,properties,options){var result,stopped,index=0,
length=Animation.prefilters.length,deferred=jQuery.Deferred().always(function(){delete tick.elem}),
tick=function(){if(stopped){return false}var currentTime=fxNow||createFxNow(),remaining=Math.max(0,
animation.startTime+animation.duration-currentTime),temp=remaining/animation.duration||0,
percent=1-temp,index=0,length=animation.tweens.length;for(;index<length;index++){animation.tweens[
index].run(percent)}deferred.notifyWith(elem,[animation,percent,remaining]);if(percent<1&&length){
return remaining}if(!length){deferred.notifyWith(elem,[animation,1,0])}deferred.resolveWith(elem,[
animation]);return false},animation=deferred.promise({elem:elem,props:jQuery.extend({},properties),
opts:jQuery.extend(true,{specialEasing:{},easing:jQuery.easing._default},options),
originalProperties:properties,originalOptions:options,startTime:fxNow||createFxNow(),
duration:options.duration,tweens:[],createTween:function(prop,end){var tween=jQuery.Tween(elem,
animation.opts,prop,end,animation.opts.specialEasing[prop]||animation.opts.easing);
animation.tweens.push(tween);return tween},stop:function(gotoEnd){var index=0,
length=gotoEnd?animation.tweens.length:0;if(stopped){return this}stopped=true;for(
;index<length;index++){animation.tweens[index].run(1)}if(gotoEnd){deferred.notifyWith(elem,[
animation,1,0]);deferred.resolveWith(elem,[animation,gotoEnd])}else{deferred.rejectWith(elem,[
animation,gotoEnd])}return this}}),props=animation.props;propFilter(props,
animation.opts.specialEasing);for(;index<length;index++){result=Animation.prefilters[index].call(
animation,elem,props,animation.opts);if(result){if(isFunction(result.stop)){jQuery._queueHooks(
animation.elem,animation.opts.queue).stop=result.stop.bind(result)}return result}}jQuery.map(props,
createTween,animation);if(isFunction(animation.opts.start)){animation.opts.start.call(elem,animation
)}animation.progress(animation.opts.progress).done(animation.opts.done,animation.opts.complete
).fail(animation.opts.fail).always(animation.opts.always);jQuery.fx.timer(jQuery.extend(tick,{
elem:elem,anim:animation,queue:animation.opts.queue}));return animation}
jQuery.Animation=jQuery.extend(Animation,{tweeners:{"*":[function(prop,value){
var tween=this.createTween(prop,value);adjustCSS(tween.elem,prop,rcssNum.exec(value),tween);
return tween}]},tweener:function(props,callback){if(isFunction(props)){callback=props;props=["*"]
}else{props=props.match(rnothtmlwhite)}var prop,index=0,length=props.length;for(
;index<length;index++){prop=props[index];Animation.tweeners[prop]=Animation.tweeners[prop]||[];
Animation.tweeners[prop].unshift(callback)}},prefilters:[defaultPrefilter],prefilter:function(
callback,prepend){if(prepend){Animation.prefilters.unshift(callback)}else{Animation.prefilters.push(
callback)}}});jQuery.speed=function(speed,easing,fn){
var opt=speed&&typeof speed==="object"?jQuery.extend({},speed):{
complete:fn||!fn&&easing||isFunction(speed)&&speed,duration:speed,
easing:fn&&easing||easing&&!isFunction(easing)&&easing};if(jQuery.fx.off){opt.duration=0}else{if(
typeof opt.duration!=="number"){if(opt.duration in jQuery.fx.speeds){opt.duration=jQuery.fx.speeds[
opt.duration]}else{opt.duration=jQuery.fx.speeds._default}}}if(opt.queue==null||opt.queue===true){
opt.queue="fx"}opt.old=opt.complete;opt.complete=function(){if(isFunction(opt.old)){opt.old.call(
this)}if(opt.queue){jQuery.dequeue(this,opt.queue)}};return opt};jQuery.fn.extend({fadeTo:function(
speed,to,easing,callback){return this.filter(isHiddenWithinTree).css("opacity",0).show().end(
).animate({opacity:to},speed,easing,callback)},animate:function(prop,speed,easing,callback){
var empty=jQuery.isEmptyObject(prop),optall=jQuery.speed(speed,easing,callback),
doAnimation=function(){var anim=Animation(this,jQuery.extend({},prop),optall);if(
empty||dataPriv.get(this,"finish")){anim.stop(true)}};doAnimation.finish=doAnimation;
return empty||optall.queue===false?this.each(doAnimation):this.queue(optall.queue,doAnimation)},
stop:function(type,clearQueue,gotoEnd){var stopQueue=function(hooks){var stop=hooks.stop;
delete hooks.stop;stop(gotoEnd)};if(typeof type!=="string"){gotoEnd=clearQueue;clearQueue=type;
type=undefined}if(clearQueue){this.queue(type||"fx",[])}return this.each(function(){var dequeue=true
,index=type!=null&&type+"queueHooks",timers=jQuery.timers,data=dataPriv.get(this);if(index){if(data[
index]&&data[index].stop){stopQueue(data[index])}}else{for(index in data){if(data[index]&&data[index
].stop&&rrun.test(index)){stopQueue(data[index])}}}for(index=timers.length;index--;){if(timers[index
].elem===this&&(type==null||timers[index].queue===type)){timers[index].anim.stop(gotoEnd);
dequeue=false;timers.splice(index,1)}}if(dequeue||!gotoEnd){jQuery.dequeue(this,type)}})},
finish:function(type){if(type!==false){type=type||"fx"}return this.each(function(){var index,
data=dataPriv.get(this),queue=data[type+"queue"],hooks=data[type+"queueHooks"],timers=jQuery.timers,
length=queue?queue.length:0;data.finish=true;jQuery.queue(this,type,[]);if(hooks&&hooks.stop){
hooks.stop.call(this,true)}for(index=timers.length;index--;){if(timers[index].elem===this&&timers[
index].queue===type){timers[index].anim.stop(true);timers.splice(index,1)}}for(
index=0;index<length;index++){if(queue[index]&&queue[index].finish){queue[index].finish.call(this)}}
delete data.finish})}});jQuery.each(["toggle","show","hide"],function(_i,name){var cssFn=jQuery.fn[
name];jQuery.fn[name]=function(speed,easing,callback){
return speed==null||typeof speed==="boolean"?cssFn.apply(this,arguments):this.animate(genFx(name,
true),speed,easing,callback)}});jQuery.each({slideDown:genFx("show"),slideUp:genFx("hide"),
slideToggle:genFx("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{
opacity:"toggle"}},function(name,props){jQuery.fn[name]=function(speed,easing,callback){
return this.animate(props,speed,easing,callback)}});jQuery.timers=[];jQuery.fx.tick=function(){
var timer,i=0,timers=jQuery.timers;fxNow=Date.now();for(;i<timers.length;i++){timer=timers[i];if(
!timer()&&timers[i]===timer){timers.splice(i--,1)}}if(!timers.length){jQuery.fx.stop()}
fxNow=undefined};jQuery.fx.timer=function(timer){jQuery.timers.push(timer);jQuery.fx.start()};
jQuery.fx.interval=13;jQuery.fx.start=function(){if(inProgress){return}inProgress=true;schedule()};
jQuery.fx.stop=function(){inProgress=null};jQuery.fx.speeds={slow:600,fast:200,_default:400};
jQuery.fn.delay=function(time,type){time=jQuery.fx?jQuery.fx.speeds[time]||time:time;type=type||"fx"
return this.queue(type,function(next,hooks){var timeout=window.setTimeout(next,time);
hooks.stop=function(){window.clearTimeout(timeout)}})};(function(){var input=document.createElement(
"input"),select=document.createElement("select"),opt=select.appendChild(document.createElement(
"option"));input.type="checkbox";support.checkOn=input.value!=="";support.optSelected=opt.selected;
input=document.createElement("input");input.value="t";input.type="radio";
support.radioValue=input.value==="t"})();var boolHook,attrHandle=jQuery.expr.attrHandle;
jQuery.fn.extend({attr:function(name,value){return access(this,jQuery.attr,name,value,
arguments.length>1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,
name)})}});jQuery.extend({attr:function(elem,name,value){var ret,hooks,nType=elem.nodeType;if(
nType===3||nType===8||nType===2){return}if(typeof elem.getAttribute==="undefined"){
return jQuery.prop(elem,name,value)}if(nType!==1||!jQuery.isXMLDoc(elem)){hooks=jQuery.attrHooks[
name.toLowerCase()]||(jQuery.expr.match.bool.test(name)?boolHook:undefined)}if(value!==undefined){
if(value===null){jQuery.removeAttr(elem,name);return}if(hooks&&"set"in hooks&&(ret=hooks.set(elem,
value,name))!==undefined){return ret}elem.setAttribute(name,value+"");return value}if(
hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret}ret=jQuery.find.attr(elem,name);
return ret==null?undefined:ret},attrHooks:{type:{set:function(elem,value){if(
!support.radioValue&&value==="radio"&&nodeName(elem,"input")){var val=elem.value;elem.setAttribute(
"type",value);if(val){elem.value=val}return value}}}},removeAttr:function(elem,value){var name,i=0,
attrNames=value&&value.match(rnothtmlwhite);if(attrNames&&elem.nodeType===1){while(name=attrNames[
i++]){elem.removeAttribute(name)}}}});boolHook={set:function(elem,value,name){if(value===false){
jQuery.removeAttr(elem,name)}else{elem.setAttribute(name,name)}return name}};jQuery.each(
jQuery.expr.match.bool.source.match(/\w+/g),function(_i,name){var getter=attrHandle[name
]||jQuery.find.attr;attrHandle[name]=function(elem,name,isXML){var ret,handle,
lowercaseName=name.toLowerCase();if(!isXML){handle=attrHandle[lowercaseName];attrHandle[
lowercaseName]=ret;ret=getter(elem,name,isXML)!=null?lowercaseName:null;attrHandle[lowercaseName
]=handle}return ret}});var rfocusable=/^(?:input|select|textarea|button)$/i,
rclickable=/^(?:a|area)$/i;jQuery.fn.extend({prop:function(name,value){return access(this,
jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return this.each(function(){
delete this[jQuery.propFix[name]||name]})}});jQuery.extend({prop:function(elem,name,value){var ret,
hooks,nType=elem.nodeType;if(nType===3||nType===8||nType===2){return}if(nType!==1||!jQuery.isXMLDoc(
elem)){name=jQuery.propFix[name]||name;hooks=jQuery.propHooks[name]}if(value!==undefined){if(
hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined){return ret}return elem[name
]=value}if(hooks&&"get"in hooks&&(ret=hooks.get(elem,name))!==null){return ret}return elem[name]},
propHooks:{tabIndex:{get:function(elem){var tabindex=jQuery.find.attr(elem,"tabindex");if(tabindex){
return parseInt(tabindex,10)}if(rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName
)&&elem.href){return 0}return-1}}},propFix:{for:"htmlFor",class:"className"}});if(
!support.optSelected){jQuery.propHooks.selected={get:function(elem){var parent=elem.parentNode;if(
parent&&parent.parentNode){parent.parentNode.selectedIndex}return null},set:function(elem){
var parent=elem.parentNode;if(parent){parent.selectedIndex;if(parent.parentNode){
parent.parentNode.selectedIndex}}}}}jQuery.each(["tabIndex","readOnly","maxLength","cellSpacing",
"cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){
jQuery.propFix[this.toLowerCase()]=this});function stripAndCollapse(value){var tokens=value.match(
rnothtmlwhite)||[];return tokens.join(" ")}function getClass(elem){
return elem.getAttribute&&elem.getAttribute("class")||""}function classesToArray(value){if(
Array.isArray(value)){return value}if(typeof value==="string"){return value.match(rnothtmlwhite)||[]
}return[]}jQuery.fn.extend({addClass:function(value){var classes,elem,cur,curValue,clazz,j,
finalValue,i=0;if(isFunction(value)){return this.each(function(j){jQuery(this).addClass(value.call(
this,j,getClass(this)))})}classes=classesToArray(value);if(classes.length){while(elem=this[i++]){
curValue=getClass(elem);cur=elem.nodeType===1&&" "+stripAndCollapse(curValue)+" ";if(cur){j=0;while(
clazz=classes[j++]){if(cur.indexOf(" "+clazz+" ")<0){cur+=clazz+" "}}finalValue=stripAndCollapse(cur
);if(curValue!==finalValue){elem.setAttribute("class",finalValue)}}}}return this},
removeClass:function(value){var classes,elem,cur,curValue,clazz,j,finalValue,i=0;if(isFunction(value
)){return this.each(function(j){jQuery(this).removeClass(value.call(this,j,getClass(this)))})}if(
!arguments.length){return this.attr("class","")}classes=classesToArray(value);if(classes.length){
while(elem=this[i++]){curValue=getClass(elem);cur=elem.nodeType===1&&" "+stripAndCollapse(curValue
)+" ";if(cur){j=0;while(clazz=classes[j++]){while(cur.indexOf(" "+clazz+" ")>-1){cur=cur.replace(
" "+clazz+" "," ")}}finalValue=stripAndCollapse(cur);if(curValue!==finalValue){elem.setAttribute(
"class",finalValue)}}}}return this},toggleClass:function(value,stateVal){var type=typeof value,
isValidValue=type==="string"||Array.isArray(value);if(typeof stateVal==="boolean"&&isValidValue){
return stateVal?this.addClass(value):this.removeClass(value)}if(isFunction(value)){return this.each(
function(i){jQuery(this).toggleClass(value.call(this,i,getClass(this),stateVal),stateVal)})}
return this.each(function(){var className,i,self,classNames;if(isValidValue){i=0;self=jQuery(this);
classNames=classesToArray(value);while(className=classNames[i++]){if(self.hasClass(className)){
self.removeClass(className)}else{self.addClass(className)}}}else if(
value===undefined||type==="boolean"){className=getClass(this);if(className){dataPriv.set(this,
"__className__",className)}if(this.setAttribute){this.setAttribute("class",
className||value===false?"":dataPriv.get(this,"__className__")||"")}}})},hasClass:function(selector
){var className,elem,i=0;className=" "+selector+" ";while(elem=this[i++]){if(elem.nodeType===1&&(
" "+stripAndCollapse(getClass(elem))+" ").indexOf(className)>-1){return true}}return false}});
var rreturn=/\r/g;jQuery.fn.extend({val:function(value){var hooks,ret,valueIsFunction,elem=this[0];
if(!arguments.length){if(elem){hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[
elem.nodeName.toLowerCase()];if(hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined){
return ret}ret=elem.value;if(typeof ret==="string"){return ret.replace(rreturn,"")}
return ret==null?"":ret}return}valueIsFunction=isFunction(value);return this.each(function(i){
var val;if(this.nodeType!==1){return}if(valueIsFunction){val=value.call(this,i,jQuery(this).val())
}else{val=value}if(val==null){val=""}else if(typeof val==="number"){val+=""}else if(Array.isArray(
val)){val=jQuery.map(val,function(value){return value==null?"":value+""})}hooks=jQuery.valHooks[
this.type]||jQuery.valHooks[this.nodeName.toLowerCase()];if(!hooks||!("set"in hooks)||hooks.set(this
,val,"value")===undefined){this.value=val}})}});jQuery.extend({valHooks:{option:{get:function(elem){
var val=jQuery.find.attr(elem,"value");return val!=null?val:stripAndCollapse(jQuery.text(elem))}},
select:{get:function(elem){var value,option,i,options=elem.options,index=elem.selectedIndex,
one=elem.type==="select-one",values=one?null:[],max=one?index+1:options.length;if(index<0){i=max
}else{i=one?index:0}for(;i<max;i++){option=options[i];if((option.selected||i===index
)&&!option.disabled&&(!option.parentNode.disabled||!nodeName(option.parentNode,"optgroup"))){
value=jQuery(option).val();if(one){return value}values.push(value)}}return values},set:function(elem
,value){var optionSet,option,options=elem.options,values=jQuery.makeArray(value),i=options.length;
while(i--){option=options[i];if(option.selected=jQuery.inArray(jQuery.valHooks.option.get(option),
values)>-1){optionSet=true}}if(!optionSet){elem.selectedIndex=-1}return values}}}});jQuery.each([
"radio","checkbox"],function(){jQuery.valHooks[this]={set:function(elem,value){if(Array.isArray(
value)){return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>-1}}};if(!support.checkOn){
jQuery.valHooks[this].get=function(elem){return elem.getAttribute("value")===null?"on":elem.value}}}
);support.focusin="onfocusin"in window;var rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,
stopPropagationCallback=function(e){e.stopPropagation()};jQuery.extend(jQuery.event,{
trigger:function(event,data,elem,onlyHandlers){var i,cur,tmp,bubbleType,ontype,handle,special,
lastElement,eventPath=[elem||document],type=hasOwn.call(event,"type")?event.type:event,
namespaces=hasOwn.call(event,"namespace")?event.namespace.split("."):[];
cur=lastElement=tmp=elem=elem||document;if(elem.nodeType===3||elem.nodeType===8){return}if(
rfocusMorph.test(type+jQuery.event.triggered)){return}if(type.indexOf(".")>-1){
namespaces=type.split(".");type=namespaces.shift();namespaces.sort()}ontype=type.indexOf(":"
)<0&&"on"+type;event=event[jQuery.expando]?event:new jQuery.Event(type,
typeof event==="object"&&event);event.isTrigger=onlyHandlers?2:3;event.namespace=namespaces.join("."
);event.rnamespace=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"
):null;event.result=undefined;if(!event.target){event.target=elem}data=data==null?[event
]:jQuery.makeArray(data,[event]);special=jQuery.event.special[type]||{};if(
!onlyHandlers&&special.trigger&&special.trigger.apply(elem,data)===false){return}if(
!onlyHandlers&&!special.noBubble&&!isWindow(elem)){bubbleType=special.delegateType||type;if(
!rfocusMorph.test(bubbleType+type)){cur=cur.parentNode}for(;cur;cur=cur.parentNode){eventPath.push(
cur);tmp=cur}if(tmp===(elem.ownerDocument||document)){eventPath.push(
tmp.defaultView||tmp.parentWindow||window)}}i=0;while((cur=eventPath[i++]
)&&!event.isPropagationStopped()){lastElement=cur;event.type=i>1?bubbleType:special.bindType||type;
handle=(dataPriv.get(cur,"events")||Object.create(null))[event.type]&&dataPriv.get(cur,"handle");if(
handle){handle.apply(cur,data)}handle=ontype&&cur[ontype];if(handle&&handle.apply&&acceptData(cur)){
event.result=handle.apply(cur,data);if(event.result===false){event.preventDefault()}}}
event.type=type;if(!onlyHandlers&&!event.isDefaultPrevented()){if((
!special._default||special._default.apply(eventPath.pop(),data)===false)&&acceptData(elem)){if(
ontype&&isFunction(elem[type])&&!isWindow(elem)){tmp=elem[ontype];if(tmp){elem[ontype]=null}
jQuery.event.triggered=type;if(event.isPropagationStopped()){lastElement.addEventListener(type,
stopPropagationCallback)}elem[type]();if(event.isPropagationStopped()){
lastElement.removeEventListener(type,stopPropagationCallback)}jQuery.event.triggered=undefined;if(
tmp){elem[ontype]=tmp}}}}return event.result},simulate:function(type,elem,event){
var e=jQuery.extend(new jQuery.Event,event,{type:type,isSimulated:true});jQuery.event.trigger(e,null
,elem)}});jQuery.fn.extend({trigger:function(type,data){return this.each(function(){
jQuery.event.trigger(type,data,this)})},triggerHandler:function(type,data){var elem=this[0];if(elem
){return jQuery.event.trigger(type,data,elem,true)}}});if(!support.focusin){jQuery.each({
focus:"focusin",blur:"focusout"},function(orig,fix){var handler=function(event){
jQuery.event.simulate(fix,event.target,jQuery.event.fix(event))};jQuery.event.special[fix]={
setup:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix);
if(!attaches){doc.addEventListener(orig,handler,true)}dataPriv.access(doc,fix,(attaches||0)+1)},
teardown:function(){var doc=this.ownerDocument||this.document||this,attaches=dataPriv.access(doc,fix
)-1;if(!attaches){doc.removeEventListener(orig,handler,true);dataPriv.remove(doc,fix)}else{
dataPriv.access(doc,fix,attaches)}}}})}var location=window.location;var nonce={guid:Date.now()};
var rquery=/\?/;jQuery.parseXML=function(data){var xml;if(!data||typeof data!=="string"){return null
}try{xml=(new window.DOMParser).parseFromString(data,"text/xml")}catch(e){xml=undefined}if(
!xml||xml.getElementsByTagName("parsererror").length){jQuery.error("Invalid XML: "+data)}return xml}
var rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,
rsubmittable=/^(?:input|select|textarea|keygen)/i;function buildParams(prefix,obj,traditional,add){
var name;if(Array.isArray(obj)){jQuery.each(obj,function(i,v){if(traditional||rbracket.test(prefix)
){add(prefix,v)}else{buildParams(prefix+"["+(typeof v==="object"&&v!=null?i:"")+"]",v,traditional,
add)}})}else if(!traditional&&toType(obj)==="object"){for(name in obj){buildParams(
prefix+"["+name+"]",obj[name],traditional,add)}}else{add(prefix,obj)}}jQuery.param=function(a,
traditional){var prefix,s=[],add=function(key,valueOrFunction){var value=isFunction(valueOrFunction
)?valueOrFunction():valueOrFunction;s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(
value==null?"":value)};if(a==null){return""}if(Array.isArray(a)||a.jquery&&!jQuery.isPlainObject(a)
){jQuery.each(a,function(){add(this.name,this.value)})}else{for(prefix in a){buildParams(prefix,a[
prefix],traditional,add)}}return s.join("&")};jQuery.fn.extend({serialize:function(){
return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){
var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(
function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(
this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!rcheckableType.test(type))}).map(
function(_i,elem){var val=jQuery(this).val();if(val==null){return null}if(Array.isArray(val)){
return jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}})}return{
name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}});var r20=/%20/g,rhash=/#.*$/,
rantiCache=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)$/gm,
rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,prefilters={},transports={},allTypes="*/".concat("*"),
originAnchor=document.createElement("a");originAnchor.href=location.href;
function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){if(
typeof dataTypeExpression!=="string"){func=dataTypeExpression;dataTypeExpression="*"}var dataType,
i=0,dataTypes=dataTypeExpression.toLowerCase().match(rnothtmlwhite)||[];if(isFunction(func)){while(
dataType=dataTypes[i++]){if(dataType[0]==="+"){dataType=dataType.slice(1)||"*";(structure[dataType
]=structure[dataType]||[]).unshift(func)}else{(structure[dataType]=structure[dataType]||[]).push(
func)}}}}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){
var inspected={},seekingTransport=structure===transports;function inspect(dataType){var selected;
inspected[dataType]=true;jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){
var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);if(
typeof dataTypeOrTransport==="string"&&!seekingTransport&&!inspected[dataTypeOrTransport]){
options.dataTypes.unshift(dataTypeOrTransport);inspect(dataTypeOrTransport);return false}else if(
seekingTransport){return!(selected=dataTypeOrTransport)}});return selected}return inspect(
options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var key,deep,
flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src){if(src[key]!==undefined){(
flatOptions[key]?target:deep||(deep={}))[key]=src[key]}}if(deep){jQuery.extend(true,target,deep)}
return target}function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,
firstDataType,contents=s.contents,dataTypes=s.dataTypes;while(dataTypes[0]==="*"){dataTypes.shift();
if(ct===undefined){ct=s.mimeType||jqXHR.getResponseHeader("Content-Type")}}if(ct){for(
type in contents){if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}}}if(
dataTypes[0]in responses){finalDataType=dataTypes[0]}else{for(type in responses){if(!dataTypes[0
]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}if(!firstDataType){
firstDataType=type}}finalDataType=finalDataType||firstDataType}if(finalDataType){if(
finalDataType!==dataTypes[0]){dataTypes.unshift(finalDataType)}return responses[finalDataType]}}
function ajaxConvert(s,response,jqXHR,isSuccess){var conv2,current,conv,tmp,prev,converters={},
dataTypes=s.dataTypes.slice();if(dataTypes[1]){for(conv in s.converters){converters[
conv.toLowerCase()]=s.converters[conv]}}current=dataTypes.shift();while(current){if(
s.responseFields[current]){jqXHR[s.responseFields[current]]=response}if(
!prev&&isSuccess&&s.dataFilter){response=s.dataFilter(response,s.dataType)}prev=current;
current=dataTypes.shift();if(current){if(current==="*"){current=prev}else if(
prev!=="*"&&prev!==current){conv=converters[prev+" "+current]||converters["* "+current];if(!conv){
for(conv2 in converters){tmp=conv2.split(" ");if(tmp[1]===current){conv=converters[prev+" "+tmp[0]
]||converters["* "+tmp[0]];if(conv){if(conv===true){conv=converters[conv2]}else if(converters[conv2
]!==true){current=tmp[0];dataTypes.unshift(tmp[1])}break}}}}if(conv!==true){if(conv&&s.throws){
response=conv(response)}else{try{response=conv(response)}catch(e){return{state:"parsererror",
error:conv?e:"No conversion from "+prev+" to "+current}}}}}}}return{state:"success",data:response}}
jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:location.href,type:"GET",
isLocal:rlocalProtocol.test(location.protocol),global:true,processData:true,async:true,
contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,
text:"text/plain",html:"text/html",xml:"application/xml, text/xml",
json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},
responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{
"* text":String,"text html":true,"text json":JSON.parse,"text xml":jQuery.parseXML},flatOptions:{
url:true,context:true}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(
target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},
ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(
transports),ajax:function(url,options){if(typeof url==="object"){options=url;url=undefined}
options=options||{};var transport,cacheURL,responseHeadersString,responseHeaders,timeoutTimer,
urlAnchor,completed,fireGlobals,i,uncached,s=jQuery.ajaxSetup({},options),
callbackContext=s.context||s,globalEventContext=s.context&&(
callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,
deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),
statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},strAbort="canceled",jqXHR={
readyState:0,getResponseHeader:function(key){var match;if(completed){if(!responseHeaders){
responseHeaders={};while(match=rheaders.exec(responseHeadersString)){responseHeaders[match[1
].toLowerCase()+" "]=(responseHeaders[match[1].toLowerCase()+" "]||[]).concat(match[2])}}
match=responseHeaders[key.toLowerCase()+" "]}return match==null?null:match.join(", ")},
getAllResponseHeaders:function(){return completed?responseHeadersString:null},
setRequestHeader:function(name,value){if(completed==null){name=requestHeadersNames[name.toLowerCase(
)]=requestHeadersNames[name.toLowerCase()]||name;requestHeaders[name]=value}return this},
overrideMimeType:function(type){if(completed==null){s.mimeType=type}return this},
statusCode:function(map){var code;if(map){if(completed){jqXHR.always(map[jqXHR.status])}else{for(
code in map){statusCode[code]=[statusCode[code],map[code]]}}}return this},abort:function(statusText
){var finalText=statusText||strAbort;if(transport){transport.abort(finalText)}done(0,finalText);
return this}};deferred.promise(jqXHR);s.url=((url||s.url||location.href)+"").replace(rprotocol,
location.protocol+"//");s.type=options.method||options.type||s.method||s.type;s.dataTypes=(
s.dataType||"*").toLowerCase().match(rnothtmlwhite)||[""];if(s.crossDomain==null){
urlAnchor=document.createElement("a");try{urlAnchor.href=s.url;urlAnchor.href=urlAnchor.href;
s.crossDomain=originAnchor.protocol+"//"+originAnchor.host!==urlAnchor.protocol+"//"+urlAnchor.host
}catch(e){s.crossDomain=true}}if(s.data&&s.processData&&typeof s.data!=="string"){
s.data=jQuery.param(s.data,s.traditional)}inspectPrefiltersOrTransports(prefilters,s,options,jqXHR);
if(completed){return jqXHR}fireGlobals=jQuery.event&&s.global;if(fireGlobals&&jQuery.active++===0){
jQuery.event.trigger("ajaxStart")}s.type=s.type.toUpperCase();s.hasContent=!rnoContent.test(s.type);
cacheURL=s.url.replace(rhash,"");if(!s.hasContent){uncached=s.url.slice(cacheURL.length);if(
s.data&&(s.processData||typeof s.data==="string")){cacheURL+=(rquery.test(cacheURL)?"&":"?")+s.data;
delete s.data}if(s.cache===false){cacheURL=cacheURL.replace(rantiCache,"$1");uncached=(rquery.test(
cacheURL)?"&":"?")+"_="+nonce.guid+++uncached}s.url=cacheURL+uncached}else if(
s.data&&s.processData&&(s.contentType||"").indexOf("application/x-www-form-urlencoded")===0){
s.data=s.data.replace(r20,"+")}if(s.ifModified){if(jQuery.lastModified[cacheURL]){
jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL])}if(jQuery.etag[cacheURL]){
jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])}}if(
s.data&&s.hasContent&&s.contentType!==false||options.contentType){jqXHR.setRequestHeader(
"Content-Type",s.contentType)}jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[
0]]?s.accepts[s.dataTypes[0]]+(s.dataTypes[0]!=="*"?", "+allTypes+"; q=0.01":""):s.accepts["*"]);
for(i in s.headers){jqXHR.setRequestHeader(i,s.headers[i])}if(s.beforeSend&&(s.beforeSend.call(
callbackContext,jqXHR,s)===false||completed)){return jqXHR.abort()}strAbort="abort";
completeDeferred.add(s.complete);jqXHR.done(s.success);jqXHR.fail(s.error);
transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR);if(!transport){done(-1,
"No Transport")}else{jqXHR.readyState=1;if(fireGlobals){globalEventContext.trigger("ajaxSend",[jqXHR
,s])}if(completed){return jqXHR}if(s.async&&s.timeout>0){timeoutTimer=window.setTimeout(function(){
jqXHR.abort("timeout")},s.timeout)}try{completed=false;transport.send(requestHeaders,done)}catch(e){
if(completed){throw e}done(-1,e)}}function done(status,nativeStatusText,responses,headers){
var isSuccess,success,error,response,modified,statusText=nativeStatusText;if(completed){return}
completed=true;if(timeoutTimer){window.clearTimeout(timeoutTimer)}transport=undefined;
responseHeadersString=headers||"";jqXHR.readyState=status>0?4:0;
isSuccess=status>=200&&status<300||status===304;if(responses){response=ajaxHandleResponses(s,jqXHR,
responses)}if(!isSuccess&&jQuery.inArray("script",s.dataTypes)>-1){s.converters["text script"
]=function(){}}response=ajaxConvert(s,response,jqXHR,isSuccess);if(isSuccess){if(s.ifModified){
modified=jqXHR.getResponseHeader("Last-Modified");if(modified){jQuery.lastModified[cacheURL
]=modified}modified=jqXHR.getResponseHeader("etag");if(modified){jQuery.etag[cacheURL]=modified}}if(
status===204||s.type==="HEAD"){statusText="nocontent"}else if(status===304){statusText="notmodified"
}else{statusText=response.state;success=response.data;error=response.error;isSuccess=!error}}else{
error=statusText;if(status||!statusText){statusText="error";if(status<0){status=0}}}
jqXHR.status=status;jqXHR.statusText=(nativeStatusText||statusText)+"";if(isSuccess){
deferred.resolveWith(callbackContext,[success,statusText,jqXHR])}else{deferred.rejectWith(
callbackContext,[jqXHR,statusText,error])}jqXHR.statusCode(statusCode);statusCode=undefined;if(
fireGlobals){globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,
isSuccess?success:error])}completeDeferred.fireWith(callbackContext,[jqXHR,statusText]);if(
fireGlobals){globalEventContext.trigger("ajaxComplete",[jqXHR,s]);if(!--jQuery.active){
jQuery.event.trigger("ajaxStop")}}}return jqXHR},getJSON:function(url,data,callback){
return jQuery.get(url,data,callback,"json")},getScript:function(url,callback){return jQuery.get(url,
undefined,callback,"script")}});jQuery.each(["get","post"],function(_i,method){jQuery[method
]=function(url,data,callback,type){if(isFunction(data)){type=type||callback;callback=data;
data=undefined}return jQuery.ajax(jQuery.extend({url:url,type:method,dataType:type,data:data,
success:callback},jQuery.isPlainObject(url)&&url))}});jQuery.ajaxPrefilter(function(s){var i;for(
i in s.headers){if(i.toLowerCase()==="content-type"){s.contentType=s.headers[i]||""}}});
jQuery._evalUrl=function(url,options,doc){return jQuery.ajax({url:url,type:"GET",dataType:"script",
cache:true,async:false,global:false,converters:{"text script":function(){}},dataFilter:function(
response){jQuery.globalEval(response,options,doc)}})};jQuery.fn.extend({wrapAll:function(html){
var wrap;if(this[0]){if(isFunction(html)){html=html.call(this[0])}wrap=jQuery(html,this[0
].ownerDocument).eq(0).clone(true);if(this[0].parentNode){wrap.insertBefore(this[0])}wrap.map(
function(){var elem=this;while(elem.firstElementChild){elem=elem.firstElementChild}return elem}
).append(this)}return this},wrapInner:function(html){if(isFunction(html)){return this.each(function(
i){jQuery(this).wrapInner(html.call(this,i))})}return this.each(function(){var self=jQuery(this),
contents=self.contents();if(contents.length){contents.wrapAll(html)}else{self.append(html)}})},
wrap:function(html){var htmlIsFunction=isFunction(html);return this.each(function(i){jQuery(this
).wrapAll(htmlIsFunction?html.call(this,i):html)})},unwrap:function(selector){this.parent(selector
).not("body").each(function(){jQuery(this).replaceWith(this.childNodes)});return this}});
jQuery.expr.pseudos.hidden=function(elem){return!jQuery.expr.pseudos.visible(elem)};
jQuery.expr.pseudos.visible=function(elem){return!!(
elem.offsetWidth||elem.offsetHeight||elem.getClientRects().length)};
jQuery.ajaxSettings.xhr=function(){try{return new window.XMLHttpRequest}catch(e){}};
var xhrSuccessStatus={0:200,1223:204},xhrSupported=jQuery.ajaxSettings.xhr();
support.cors=!!xhrSupported&&"withCredentials"in xhrSupported;
support.ajax=xhrSupported=!!xhrSupported;jQuery.ajaxTransport(function(options){var callback,
errorCallback;if(support.cors||xhrSupported&&!options.crossDomain){return{send:function(headers,
complete){var i,xhr=options.xhr();xhr.open(options.type,options.url,options.async,options.username,
options.password);if(options.xhrFields){for(i in options.xhrFields){xhr[i]=options.xhrFields[i]}}if(
options.mimeType&&xhr.overrideMimeType){xhr.overrideMimeType(options.mimeType)}if(
!options.crossDomain&&!headers["X-Requested-With"]){headers["X-Requested-With"]="XMLHttpRequest"}
for(i in headers){xhr.setRequestHeader(i,headers[i])}callback=function(type){return function(){if(
callback){
callback=errorCallback=xhr.onload=xhr.onerror=xhr.onabort=xhr.ontimeout=xhr.onreadystatechange=null;
if(type==="abort"){xhr.abort()}else if(type==="error"){if(typeof xhr.status!=="number"){complete(0,
"error")}else{complete(xhr.status,xhr.statusText)}}else{complete(xhrSuccessStatus[xhr.status
]||xhr.status,xhr.statusText,(xhr.responseType||"text"
)!=="text"||typeof xhr.responseText!=="string"?{binary:xhr.response}:{text:xhr.responseText},
xhr.getAllResponseHeaders())}}}};xhr.onload=callback();
errorCallback=xhr.onerror=xhr.ontimeout=callback("error");if(xhr.onabort!==undefined){
xhr.onabort=errorCallback}else{xhr.onreadystatechange=function(){if(xhr.readyState===4){
window.setTimeout(function(){if(callback){errorCallback()}})}}}callback=callback("abort");try{
xhr.send(options.hasContent&&options.data||null)}catch(e){if(callback){throw e}}},abort:function(){
if(callback){callback()}}}}});jQuery.ajaxPrefilter(function(s){if(s.crossDomain){
s.contents.script=false}});jQuery.ajaxSetup({accepts:{
script:"text/javascript, application/javascript, "+"application/ecmascript, application/x-ecmascript"
},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(text){
jQuery.globalEval(text);return text}}});jQuery.ajaxPrefilter("script",function(s){if(
s.cache===undefined){s.cache=false}if(s.crossDomain){s.type="GET"}});jQuery.ajaxTransport("script",
function(s){if(s.crossDomain||s.scriptAttrs){var script,callback;return{send:function(_,complete){
script=jQuery("<script>").attr(s.scriptAttrs||{}).prop({charset:s.scriptCharset,src:s.url}).on(
"load error",callback=function(evt){script.remove();callback=null;if(evt){complete(
evt.type==="error"?404:200,evt.type)}});document.head.appendChild(script[0])},abort:function(){if(
callback){callback()}}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({
jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop(
)||jQuery.expando+"_"+nonce.guid++;this[callback]=true;return callback}});jQuery.ajaxPrefilter(
"json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,
jsonProp=s.jsonp!==false&&(rjsonp.test(s.url)?"url":typeof s.data==="string"&&(s.contentType||""
).indexOf("application/x-www-form-urlencoded")===0&&rjsonp.test(s.data)&&"data");if(
jsonProp||s.dataTypes[0]==="jsonp"){callbackName=s.jsonpCallback=isFunction(s.jsonpCallback
)?s.jsonpCallback():s.jsonpCallback;if(jsonProp){s[jsonProp]=s[jsonProp].replace(rjsonp,
"$1"+callbackName)}else if(s.jsonp!==false){s.url+=(rquery.test(s.url)?"&":"?"
)+s.jsonp+"="+callbackName}s.converters["script json"]=function(){if(!responseContainer){
jQuery.error(callbackName+" was not called")}return responseContainer[0]};s.dataTypes[0]="json";
overwritten=window[callbackName];window[callbackName]=function(){responseContainer=arguments};
jqXHR.always(function(){if(overwritten===undefined){jQuery(window).removeProp(callbackName)}else{
window[callbackName]=overwritten}if(s[callbackName]){s.jsonpCallback=originalSettings.jsonpCallback;
oldCallbacks.push(callbackName)}if(responseContainer&&isFunction(overwritten)){overwritten(
responseContainer[0])}responseContainer=overwritten=undefined});return"script"}});
support.createHTMLDocument=function(){var body=document.implementation.createHTMLDocument("").body;
body.innerHTML="<form></form><form></form>";return body.childNodes.length===2}();
jQuery.parseHTML=function(data,context,keepScripts){if(typeof data!=="string"){return[]}if(
typeof context==="boolean"){keepScripts=context;context=false}var base,parsed,scripts;if(!context){
if(support.createHTMLDocument){context=document.implementation.createHTMLDocument("");
base=context.createElement("base");base.href=document.location.href;context.head.appendChild(base)
}else{context=document}}parsed=rsingleTag.exec(data);scripts=!keepScripts&&[];if(parsed){return[
context.createElement(parsed[1])]}parsed=buildFragment([data],context,scripts);if(
scripts&&scripts.length){jQuery(scripts).remove()}return jQuery.merge([],parsed.childNodes)};
jQuery.fn.load=function(url,params,callback){var selector,type,response,self=this,off=url.indexOf(
" ");if(off>-1){selector=stripAndCollapse(url.slice(off));url=url.slice(0,off)}if(isFunction(params)
){callback=params;params=undefined}else if(params&&typeof params==="object"){type="POST"}if(
self.length>0){jQuery.ajax({url:url,type:type||"GET",dataType:"html",data:params}).done(function(
responseText){response=arguments;self.html(selector?jQuery("<div>").append(jQuery.parseHTML(
responseText)).find(selector):responseText)}).always(callback&&function(jqXHR,status){self.each(
function(){callback.apply(this,response||[jqXHR.responseText,status,jqXHR])})})}return this};
jQuery.expr.pseudos.animated=function(elem){return jQuery.grep(jQuery.timers,function(fn){
return elem===fn.elem}).length};jQuery.offset={setOffset:function(elem,options,i){var curPosition,
curLeft,curCSSTop,curTop,curOffset,curCSSLeft,calculatePosition,position=jQuery.css(elem,"position")
,curElem=jQuery(elem),props={};if(position==="static"){elem.style.position="relative"}
curOffset=curElem.offset();curCSSTop=jQuery.css(elem,"top");curCSSLeft=jQuery.css(elem,"left");
calculatePosition=(position==="absolute"||position==="fixed")&&(curCSSTop+curCSSLeft).indexOf("auto"
)>-1;if(calculatePosition){curPosition=curElem.position();curTop=curPosition.top;
curLeft=curPosition.left}else{curTop=parseFloat(curCSSTop)||0;curLeft=parseFloat(curCSSLeft)||0}if(
isFunction(options)){options=options.call(elem,i,jQuery.extend({},curOffset))}if(options.top!=null){
props.top=options.top-curOffset.top+curTop}if(options.left!=null){
props.left=options.left-curOffset.left+curLeft}if("using"in options){options.using.call(elem,props)
}else{if(typeof props.top==="number"){props.top+="px"}if(typeof props.left==="number"){
props.left+="px"}curElem.css(props)}}};jQuery.fn.extend({offset:function(options){if(
arguments.length){return options===undefined?this:this.each(function(i){jQuery.offset.setOffset(this
,options,i)})}var rect,win,elem=this[0];if(!elem){return}if(!elem.getClientRects().length){return{
top:0,left:0}}rect=elem.getBoundingClientRect();win=elem.ownerDocument.defaultView;return{
top:rect.top+win.pageYOffset,left:rect.left+win.pageXOffset}},position:function(){if(!this[0]){
return}var offsetParent,offset,doc,elem=this[0],parentOffset={top:0,left:0};if(jQuery.css(elem,
"position")==="fixed"){offset=elem.getBoundingClientRect()}else{offset=this.offset();
doc=elem.ownerDocument;offsetParent=elem.offsetParent||doc.documentElement;while(offsetParent&&(
offsetParent===doc.body||offsetParent===doc.documentElement)&&jQuery.css(offsetParent,"position"
)==="static"){offsetParent=offsetParent.parentNode}if(
offsetParent&&offsetParent!==elem&&offsetParent.nodeType===1){parentOffset=jQuery(offsetParent
).offset();parentOffset.top+=jQuery.css(offsetParent,"borderTopWidth",true);
parentOffset.left+=jQuery.css(offsetParent,"borderLeftWidth",true)}}return{
top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",true),
left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",true)}},offsetParent:function(){
return this.map(function(){var offsetParent=this.offsetParent;while(offsetParent&&jQuery.css(
offsetParent,"position")==="static"){offsetParent=offsetParent.offsetParent}
return offsetParent||documentElement})}});jQuery.each({scrollLeft:"pageXOffset",
scrollTop:"pageYOffset"},function(method,prop){var top="pageYOffset"===prop;jQuery.fn[method
]=function(val){return access(this,function(elem,method,val){var win;if(isWindow(elem)){win=elem
}else if(elem.nodeType===9){win=elem.defaultView}if(val===undefined){return win?win[prop]:elem[
method]}if(win){win.scrollTo(!top?val:win.pageXOffset,top?val:win.pageYOffset)}else{elem[method]=val
}},method,val,arguments.length)}});jQuery.each(["top","left"],function(_i,prop){jQuery.cssHooks[prop
]=addGetHookIf(support.pixelPosition,function(elem,computed){if(computed){computed=curCSS(elem,prop)
return rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}})});jQuery.each({
Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,
"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){
var chainable=arguments.length&&(defaultExtra||typeof margin!=="boolean"),extra=defaultExtra||(
margin===true||value===true?"margin":"border");return access(this,function(elem,type,value){var doc;
if(isWindow(elem)){return funcName.indexOf("outer")===0?elem["inner"+name
]:elem.document.documentElement["client"+name]}if(elem.nodeType===9){doc=elem.documentElement;
return Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc[
"offset"+name],doc["client"+name])}return value===undefined?jQuery.css(elem,type,extra
):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable)}})});jQuery.each([
"ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(_i,type){
jQuery.fn[type]=function(fn){return this.on(type,fn)}});jQuery.fn.extend({bind:function(types,data,
fn){return this.on(types,null,data,fn)},unbind:function(types,fn){return this.off(types,null,fn)},
delegate:function(selector,types,data,fn){return this.on(types,selector,data,fn)},
undelegate:function(selector,types,fn){return arguments.length===1?this.off(selector,"**"):this.off(
types,selector||"**",fn)},hover:function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(
fnOut||fnOver)}});jQuery.each((
"blur focus focusin focusout resize scroll click dblclick "+"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave "+"change select submit keydown keypress keyup contextmenu"
).split(" "),function(_i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(
name,null,data,fn):this.trigger(name)}});var rtrim=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
jQuery.proxy=function(fn,context){var tmp,args,proxy;if(typeof context==="string"){tmp=fn[context];
context=fn;fn=tmp}if(!isFunction(fn)){return undefined}args=slice.call(arguments,2);proxy=function(
){return fn.apply(context||this,args.concat(slice.call(arguments)))};
proxy.guid=fn.guid=fn.guid||jQuery.guid++;return proxy};jQuery.holdReady=function(hold){if(hold){
jQuery.readyWait++}else{jQuery.ready(true)}};jQuery.isArray=Array.isArray;
jQuery.parseJSON=JSON.parse;jQuery.nodeName=nodeName;jQuery.isFunction=isFunction;
jQuery.isWindow=isWindow;jQuery.camelCase=camelCase;jQuery.type=toType;jQuery.now=Date.now;
jQuery.isNumeric=function(obj){var type=jQuery.type(obj);return(type==="number"||type==="string"
)&&!isNaN(obj-parseFloat(obj))};jQuery.trim=function(text){return text==null?"":(text+"").replace(
rtrim,"")};if(typeof define==="function"&&define.amd){define("jquery",[],function(){return jQuery})}
var _jQuery=window.jQuery,_$=window.$;jQuery.noConflict=function(deep){if(window.$===jQuery){
window.$=_$}if(deep&&window.jQuery===jQuery){window.jQuery=_jQuery}return jQuery};if(
typeof noGlobal==="undefined"){window.jQuery=window.$=jQuery}return jQuery});(function(factory){if(
typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof exports==="object"
){module.exports=factory}else{factory(jQuery)}})(function($){var toFix=["wheel","mousewheel",
"DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?[
"wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,
nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[
toFix[--i]]=$.event.mouseHooks}}var special=$.event.special.mousewheel={version:"3.1.12",
setup:function(){if(this.addEventListener){for(var i=toBind.length;i;){this.addEventListener(toBind[
--i],handler,false)}}else{this.onmousewheel=handler}$.data(this,"mousewheel-line-height",
special.getLineHeight(this));$.data(this,"mousewheel-page-height",special.getPageHeight(this))},
teardown:function(){if(this.removeEventListener){for(var i=toBind.length;i;){
this.removeEventListener(toBind[--i],handler,false)}}else{this.onmousewheel=null}$.removeData(this,
"mousewheel-line-height");$.removeData(this,"mousewheel-page-height")},getLineHeight:function(elem){
var $elem=$(elem),$parent=$elem["offsetParent"in $.fn?"offsetParent":"parent"]();if(!$parent.length
){$parent=$("body")}return parseInt($parent.css("fontSize"),10)||parseInt($elem.css("fontSize"),10
)||16},getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:true,
normalizeOffset:true}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn
):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}});
function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,
deltaX=0,deltaY=0,absDelta=0,offsetX=0,offsetY=0;event=$.event.fix(orgEvent);event.type="mousewheel"
if("detail"in orgEvent){deltaY=orgEvent.detail*-1}if("wheelDelta"in orgEvent){
deltaY=orgEvent.wheelDelta}if("wheelDeltaY"in orgEvent){deltaY=orgEvent.wheelDeltaY}if(
"wheelDeltaX"in orgEvent){deltaX=orgEvent.wheelDeltaX*-1}if(
"axis"in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaX=deltaY*-1;deltaY=0}
delta=deltaY===0?deltaX:deltaY;if("deltaY"in orgEvent){deltaY=orgEvent.deltaY*-1;delta=deltaY}if(
"deltaX"in orgEvent){deltaX=orgEvent.deltaX;if(deltaY===0){delta=deltaX*-1}}if(
deltaY===0&&deltaX===0){return}if(orgEvent.deltaMode===1){var lineHeight=$.data(this,
"mousewheel-line-height");delta*=lineHeight;deltaY*=lineHeight;deltaX*=lineHeight}else if(
orgEvent.deltaMode===2){var pageHeight=$.data(this,"mousewheel-page-height");delta*=pageHeight;
deltaY*=pageHeight;deltaX*=pageHeight}absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(
!lowestDelta||absDelta<lowestDelta){lowestDelta=absDelta;if(shouldAdjustOldDeltas(orgEvent,absDelta)
){lowestDelta/=40}}if(shouldAdjustOldDeltas(orgEvent,absDelta)){delta/=40;deltaX/=40;deltaY/=40}
delta=Math[delta>=1?"floor":"ceil"](delta/lowestDelta);deltaX=Math[deltaX>=1?"floor":"ceil"](
deltaX/lowestDelta);deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta);if(
special.settings.normalizeOffset&&this.getBoundingClientRect){
var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left;
offsetY=event.clientY-boundingRect.top}event.deltaX=deltaX;event.deltaY=deltaY;
event.deltaFactor=lowestDelta;event.offsetX=offsetX;event.offsetY=offsetY;event.deltaMode=0;
args.unshift(event,delta,deltaX,deltaY);if(nullLowestDeltaTimeout){clearTimeout(
nullLowestDeltaTimeout)}nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200);return(
$.event.dispatch||$.event.handle).apply(this,args)}function nullLowestDelta(){lowestDelta=null}
function shouldAdjustOldDeltas(orgEvent,absDelta){
return special.settings.adjustOldDeltas&&orgEvent.type==="mousewheel"&&absDelta%120===0}});(
function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(
typeof exports==="object"){factory(require("jquery"))}else{factory(jQuery)}})(function($){
"use strict";$.support.htmlMenuitem="HTMLMenuItemElement"in window;
$.support.htmlCommand="HTMLCommandElement"in window;
$.support.eventSelectstart="onselectstart"in document.documentElement;if(!$.ui||!$.widget){
$.cleanData=function(orig){return function(elems){var events,elem,i;for(i=0;elems[i]!=null;i++){
elem=elems[i];try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler(
"remove")}}catch(e){}}orig(elems)}}($.cleanData)}var $currentTrigger=null,initialized=false,$win=$(
window),counter=0,namespaces={},menus={},types={},defaults={selector:null,appendTo:null,
trigger:"right",autoHide:false,delay:200,reposition:true,hideOnSecondTrigger:false,
selectableSubMenu:false,classNames:{hover:"context-menu-hover",disabled:"context-menu-disabled",
visible:"context-menu-visible",notSelectable:"context-menu-not-selectable",icon:"context-menu-icon",
iconEdit:"context-menu-icon-edit",iconCut:"context-menu-icon-cut",iconCopy:"context-menu-icon-copy",
iconPaste:"context-menu-icon-paste",iconDelete:"context-menu-icon-delete",
iconAdd:"context-menu-icon-add",iconQuit:"context-menu-icon-quit",
iconLoadingClass:"context-menu-icon-loading"},determinePosition:function($menu){if(
$.ui&&$.ui.position){$menu.css("display","block").position({my:"center top",at:"center bottom",
of:this,offset:"0 5",collision:"fit"}).css("display","none")}else{var offset=this.offset();
offset.top+=this.outerHeight();offset.left+=this.outerWidth()/2-$menu.outerWidth()/2;$menu.css(
offset)}},position:function(opt,x,y){var offset;if(!x&&!y){opt.determinePosition.call(this,opt.$menu
);return}else if(x==="maintain"&&y==="maintain"){offset=opt.$menu.position()}else{
var offsetParentOffset=opt.$menu.offsetParent().offset();offset={top:y-offsetParentOffset.top,
left:x-offsetParentOffset.left}}var bottom=$win.scrollTop()+$win.height(),right=$win.scrollLeft(
)+$win.width(),height=opt.$menu.outerHeight(),width=opt.$menu.outerWidth();if(
offset.top+height>bottom){offset.top-=height}if(offset.top<0){offset.top=0}if(
offset.left+width>right){offset.left-=width}if(offset.left<0){offset.left=0}opt.$menu.css(offset)},
positionSubmenu:function($menu){if(typeof $menu==="undefined"){return}if($.ui&&$.ui.position){
$menu.css("display","block").position({my:"left top-5",at:"right top",of:this,
collision:"flipfit fit"}).css("display","")}else{var offset={top:-9,left:this.outerWidth()-5};
$menu.css(offset)}},zIndex:1,animation:{duration:50,show:"slideDown",hide:"slideUp"},events:{
preShow:$.noop,show:$.noop,hide:$.noop,activated:$.noop},callback:null,items:{}},hoveract={
timer:null,pageX:null,pageY:null},zindex=function($t){var zin=0,$tt=$t;while(true){zin=Math.max(zin,
parseInt($tt.css("z-index"),10)||0);$tt=$tt.parent();if(!$tt||!$tt.length||"html body".indexOf(
$tt.prop("nodeName").toLowerCase())>-1){break}}return zin},handle={abortevent:function(e){
e.preventDefault();e.stopImmediatePropagation()},contextmenu:function(e){var $this=$(this);if(
e.data.events.preShow($this,e)===false){return}if(e.data.trigger==="right"){e.preventDefault();
e.stopImmediatePropagation()}if(e.data.trigger!=="right"&&e.data.trigger!=="demand"&&e.originalEvent
){return}if(typeof e.mouseButton!=="undefined"&&e.data){if(!(
e.data.trigger==="left"&&e.mouseButton===0)&&!(e.data.trigger==="right"&&e.mouseButton===2)){return}
}if($this.hasClass("context-menu-active")){return}if(!$this.hasClass("context-menu-disabled")){
$currentTrigger=$this;if(e.data.build){var built=e.data.build($currentTrigger,e);if(built===false){
return}e.data=$.extend(true,{},defaults,e.data,built||{});if(!e.data.items||$.isEmptyObject(
e.data.items)){if(window.console){(console.error||console.log).call(console,
"No items specified to show in contextMenu")}throw new Error("No Items specified")}
e.data.$trigger=$currentTrigger;op.create(e.data)}op.show.call($this,e.data,e.pageX,e.pageY)}},
click:function(e){e.preventDefault();e.stopImmediatePropagation();$(this).trigger($.Event(
"contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))},mousedown:function(e){var $this=$(this);
if($currentTrigger&&$currentTrigger.length&&!$currentTrigger.is($this)){$currentTrigger.data(
"contextMenu").$menu.trigger("contextmenu:hide")}if(e.button===2){$currentTrigger=$this.data(
"contextMenuActive",true)}},mouseup:function(e){var $this=$(this);if($this.data("contextMenuActive"
)&&$currentTrigger&&$currentTrigger.length&&$currentTrigger.is($this)&&!$this.hasClass(
"context-menu-disabled")){e.preventDefault();e.stopImmediatePropagation();$currentTrigger=$this;
$this.trigger($.Event("contextmenu",{data:e.data,pageX:e.pageX,pageY:e.pageY}))}$this.removeData(
"contextMenuActive")},mouseenter:function(e){var $this=$(this),$related=$(e.relatedTarget),
$document=$(document);if($related.is(".context-menu-list")||$related.closest(".context-menu-list"
).length){return}if($currentTrigger&&$currentTrigger.length){return}hoveract.pageX=e.pageX;
hoveract.pageY=e.pageY;hoveract.data=e.data;$document.on("mousemove.contextMenuShow",
handle.mousemove);hoveract.timer=setTimeout(function(){hoveract.timer=null;$document.off(
"mousemove.contextMenuShow");$currentTrigger=$this;$this.trigger($.Event("contextmenu",{
data:hoveract.data,pageX:hoveract.pageX,pageY:hoveract.pageY}))},e.data.delay)},mousemove:function(e
){hoveract.pageX=e.pageX;hoveract.pageY=e.pageY},mouseleave:function(e){var $related=$(
e.relatedTarget);if($related.is(".context-menu-list")||$related.closest(".context-menu-list").length
){return}try{clearTimeout(hoveract.timer)}catch(e){}hoveract.timer=null},layerClick:function(e){
var $this=$(this),root=$this.data("contextMenuRoot"),button=e.button,x=e.pageX,y=e.pageY,
fakeClick=x===undefined,target,offset;e.preventDefault();setTimeout(function(){if(fakeClick){if(
root!==null&&typeof root!=="undefined"&&root.$menu!==null&&typeof root.$menu!=="undefined"){
root.$menu.trigger("contextmenu:hide")}return}var $window;
var triggerAction=root.trigger==="left"&&button===0||root.trigger==="right"&&button===2;if(
document.elementFromPoint&&root.$layer){root.$layer.hide();target=document.elementFromPoint(
x-$win.scrollLeft(),y-$win.scrollTop());if(target!==null&&target.isContentEditable){
var range=document.createRange(),sel=window.getSelection();range.selectNode(target);range.collapse(
true);sel.removeAllRanges();sel.addRange(range)}$(target).trigger(e);root.$layer.show()}if(
root.hideOnSecondTrigger&&triggerAction&&root.$menu!==null&&typeof root.$menu!=="undefined"){
root.$menu.trigger("contextmenu:hide");return}if(root.reposition&&triggerAction){if(
document.elementFromPoint){if(root.$trigger.is(target)){root.position.call(root.$trigger,root,x,y);
return}}else{offset=root.$trigger.offset();$window=$(window);offset.top+=$window.scrollTop();if(
offset.top<=e.pageY){offset.left+=$window.scrollLeft();if(offset.left<=e.pageX){
offset.bottom=offset.top+root.$trigger.outerHeight();if(offset.bottom>=e.pageY){
offset.right=offset.left+root.$trigger.outerWidth();if(offset.right>=e.pageX){root.position.call(
root.$trigger,root,x,y);return}}}}}}if(target&&triggerAction){root.$trigger.one("contextmenu:hidden"
,function(){$(target).contextMenu({x:x,y:y,button:button})})}if(
root!==null&&typeof root!=="undefined"&&root.$menu!==null&&typeof root.$menu!=="undefined"){
root.$menu.trigger("contextmenu:hide")}},50)},keyStop:function(e,opt){if(!opt.isInput){
e.preventDefault()}e.stopPropagation()},key:function(e){var opt={};if($currentTrigger){
opt=$currentTrigger.data("contextMenu")||{}}if(typeof opt.zIndex==="undefined"){opt.zIndex=0}
var targetZIndex=0;var getZIndexOfTriggerTarget=function(target){if(target.style.zIndex!==""){
targetZIndex=target.style.zIndex}else{if(
target.offsetParent!==null&&typeof target.offsetParent!=="undefined"){getZIndexOfTriggerTarget(
target.offsetParent)}else if(target.parentElement!==null&&typeof target.parentElement!=="undefined"
){getZIndexOfTriggerTarget(target.parentElement)}}};getZIndexOfTriggerTarget(e.target);if(
opt.$menu&&parseInt(targetZIndex,10)>parseInt(opt.$menu.css("zIndex"),10)){return}switch(e.keyCode){
case 9:case 38:handle.keyStop(e,opt);if(opt.isInput){if(e.keyCode===9&&e.shiftKey){e.preventDefault(
);if(opt.$selected){opt.$selected.find("input, textarea, select").blur()}if(
opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("prevcommand")}return}else if(
e.keyCode===38&&opt.$selected.find("input, textarea, select").prop("type")==="checkbox"){
e.preventDefault();return}}else if(e.keyCode!==9||e.shiftKey){if(
opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("prevcommand")}return}break;
case 40:handle.keyStop(e,opt);if(opt.isInput){if(e.keyCode===9){e.preventDefault();if(opt.$selected
){opt.$selected.find("input, textarea, select").blur()}if(
opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger("nextcommand")}return}else if(
e.keyCode===40&&opt.$selected.find("input, textarea, select").prop("type")==="checkbox"){
e.preventDefault();return}}else{if(opt.$menu!==null&&typeof opt.$menu!=="undefined"){
opt.$menu.trigger("nextcommand")}return}break;case 37:handle.keyStop(e,opt);if(
opt.isInput||!opt.$selected||!opt.$selected.length){break}if(!opt.$selected.parent().hasClass(
"context-menu-root")){var $parent=opt.$selected.parent().parent();opt.$selected.trigger(
"contextmenu:blur");opt.$selected=$parent;return}break;case 39:handle.keyStop(e,opt);if(
opt.isInput||!opt.$selected||!opt.$selected.length){break}var itemdata=opt.$selected.data(
"contextMenu")||{};if(itemdata.$menu&&opt.$selected.hasClass("context-menu-submenu")){
opt.$selected=null;itemdata.$selected=null;itemdata.$menu.trigger("nextcommand");return}break;
case 35:case 36:if(opt.$selected&&opt.$selected.find("input, textarea, select").length){return}else{
(opt.$selected&&opt.$selected.parent()||opt.$menu).children(
":not(."+opt.classNames.disabled+", ."+opt.classNames.notSelectable+")")[
e.keyCode===36?"first":"last"]().trigger("contextmenu:focus");e.preventDefault();return}break;
case 13:handle.keyStop(e,opt);if(opt.isInput){if(opt.$selected&&!opt.$selected.is("textarea, select"
)){e.preventDefault();return}break}if(typeof opt.$selected!=="undefined"&&opt.$selected!==null){
opt.$selected.trigger("mouseup")}return;case 32:case 33:case 34:handle.keyStop(e,opt);return;
case 27:handle.keyStop(e,opt);if(opt.$menu!==null&&typeof opt.$menu!=="undefined"){
opt.$menu.trigger("contextmenu:hide")}return;default:var k=String.fromCharCode(e.keyCode
).toUpperCase();if(opt.accesskeys&&opt.accesskeys[k]){opt.accesskeys[k].$node.trigger(
opt.accesskeys[k].$menu?"contextmenu:focus":"mouseup");return}break}e.stopPropagation();if(
typeof opt.$selected!=="undefined"&&opt.$selected!==null){opt.$selected.trigger(e)}},
prevItem:function(e){e.stopPropagation();var opt=$(this).data("contextMenu")||{};var root=$(this
).data("contextMenuRoot")||{};if(opt.$selected){var $s=opt.$selected;opt=opt.$selected.parent(
).data("contextMenu")||{};opt.$selected=$s}var $children=opt.$menu.children(),
$prev=!opt.$selected||!opt.$selected.prev().length?$children.last():opt.$selected.prev(),
$round=$prev;while($prev.hasClass(root.classNames.disabled)||$prev.hasClass(
root.classNames.notSelectable)||$prev.is(":hidden")){if($prev.prev().length){$prev=$prev.prev()
}else{$prev=$children.last()}if($prev.is($round)){return}}if(opt.$selected){
handle.itemMouseleave.call(opt.$selected.get(0),e)}handle.itemMouseenter.call($prev.get(0),e);
var $input=$prev.find("input, textarea, select");if($input.length){$input.focus()}},
nextItem:function(e){e.stopPropagation();var opt=$(this).data("contextMenu")||{};var root=$(this
).data("contextMenuRoot")||{};if(opt.$selected){var $s=opt.$selected;opt=opt.$selected.parent(
).data("contextMenu")||{};opt.$selected=$s}var $children=opt.$menu.children(),
$next=!opt.$selected||!opt.$selected.next().length?$children.first():opt.$selected.next(),
$round=$next;while($next.hasClass(root.classNames.disabled)||$next.hasClass(
root.classNames.notSelectable)||$next.is(":hidden")){if($next.next().length){$next=$next.next()
}else{$next=$children.first()}if($next.is($round)){return}}if(opt.$selected){
handle.itemMouseleave.call(opt.$selected.get(0),e)}handle.itemMouseenter.call($next.get(0),e);
var $input=$next.find("input, textarea, select");if($input.length){$input.focus()}},
focusInput:function(){var $this=$(this).closest(".context-menu-item"),data=$this.data(),
opt=data.contextMenu,root=data.contextMenuRoot;root.$selected=opt.$selected=$this;
root.isInput=opt.isInput=true},blurInput:function(){var $this=$(this).closest(".context-menu-item"),
data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;root.isInput=opt.isInput=false},
menuMouseenter:function(){var root=$(this).data().contextMenuRoot;root.hovering=true},
menuMouseleave:function(e){var root=$(this).data().contextMenuRoot;if(root.$layer&&root.$layer.is(
e.relatedTarget)){root.hovering=false}},itemMouseenter:function(e){var $this=$(this),
data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot;root.hovering=true;if(
e&&root.$layer&&root.$layer.is(e.relatedTarget)){e.preventDefault();e.stopImmediatePropagation()}(
opt.$menu?opt:root).$menu.children("."+root.classNames.hover).trigger("contextmenu:blur").children(
".hover").trigger("contextmenu:blur");if($this.hasClass(root.classNames.disabled)||$this.hasClass(
root.classNames.notSelectable)){opt.$selected=null;return}$this.trigger("contextmenu:focus")},
itemMouseleave:function(e){var $this=$(this),data=$this.data(),opt=data.contextMenu,
root=data.contextMenuRoot;if(root!==opt&&root.$layer&&root.$layer.is(e.relatedTarget)){if(
typeof root.$selected!=="undefined"&&root.$selected!==null){root.$selected.trigger(
"contextmenu:blur")}e.preventDefault();e.stopImmediatePropagation();
root.$selected=opt.$selected=opt.$node;return}if(opt&&opt.$menu&&opt.$menu.hasClass(
"context-menu-visible")){return}$this.trigger("contextmenu:blur")},itemClick:function(e){
var $this=$(this),data=$this.data(),opt=data.contextMenu,root=data.contextMenuRoot,
key=data.contextMenuKey,callback;if(!opt.items[key]||$this.is(
"."+root.classNames.disabled+", .context-menu-separator, ."+root.classNames.notSelectable
)||$this.is(".context-menu-submenu")&&root.selectableSubMenu===false){return}e.preventDefault();
e.stopImmediatePropagation();if($.isFunction(opt.callbacks[key]
)&&Object.prototype.hasOwnProperty.call(opt.callbacks,key)){callback=opt.callbacks[key]}else if(
$.isFunction(root.callback)){callback=root.callback}else{return}if(callback.call(root.$trigger,key,
root,e)!==false){root.$menu.trigger("contextmenu:hide")}else if(root.$menu.parent().length){
op.update.call(root.$trigger,root)}},inputClick:function(e){e.stopImmediatePropagation()},
hideMenu:function(e,data){var root=$(this).data("contextMenuRoot");op.hide.call(root.$trigger,root,
data&&data.force)},focusItem:function(e){e.stopPropagation();var $this=$(this),data=$this.data(),
opt=data.contextMenu,root=data.contextMenuRoot;if($this.hasClass(root.classNames.disabled
)||$this.hasClass(root.classNames.notSelectable)){return}$this.addClass([root.classNames.hover,
root.classNames.visible].join(" ")).parent().find(".context-menu-item").not($this).removeClass(
root.classNames.visible).filter("."+root.classNames.hover).trigger("contextmenu:blur");
opt.$selected=root.$selected=$this;if(opt&&opt.$node&&opt.$node.hasClass("context-menu-submenu")){
opt.$node.addClass(root.classNames.hover)}if(opt.$node){root.positionSubmenu.call(opt.$node,
opt.$menu)}},blurItem:function(e){e.stopPropagation();var $this=$(this),data=$this.data(),
opt=data.contextMenu,root=data.contextMenuRoot;if(opt.autoHide){$this.removeClass(
root.classNames.visible)}$this.removeClass(root.classNames.hover);opt.$selected=null}},op={
show:function(opt,x,y){var $trigger=$(this),css={};$("#context-menu-layer").trigger("mousedown");
opt.$trigger=$trigger;if(opt.events.show.call($trigger,opt)===false){$currentTrigger=null;return}
var hasVisibleItems=op.update.call($trigger,opt);if(hasVisibleItems===false){$currentTrigger=null;
return}opt.position.call($trigger,opt,x,y);if(opt.zIndex){var additionalZValue=opt.zIndex;if(
typeof opt.zIndex==="function"){additionalZValue=opt.zIndex.call($trigger,opt)}css.zIndex=zindex(
$trigger)+additionalZValue}op.layer.call(opt.$menu,opt,css.zIndex);opt.$menu.find("ul").css("zIndex"
,css.zIndex+1);opt.$menu.css(css)[opt.animation.show](opt.animation.duration,function(){
$trigger.trigger("contextmenu:visible");op.activated(opt);opt.events.activated(opt)});$trigger.data(
"contextMenu",opt).addClass("context-menu-active");$(document).off("keydown.contextMenu").on(
"keydown.contextMenu",handle.key);if(opt.autoHide){$(document).on("mousemove.contextMenuAutoHide",
function(e){var pos=$trigger.offset();pos.right=pos.left+$trigger.outerWidth();
pos.bottom=pos.top+$trigger.outerHeight();if(opt.$layer&&!opt.hovering&&(!(
e.pageX>=pos.left&&e.pageX<=pos.right)||!(e.pageY>=pos.top&&e.pageY<=pos.bottom))){setTimeout(
function(){if(!opt.hovering&&opt.$menu!==null&&typeof opt.$menu!=="undefined"){opt.$menu.trigger(
"contextmenu:hide")}},50)}})}},hide:function(opt,force){var $trigger=$(this);if(!opt){
opt=$trigger.data("contextMenu")||{}}if(!force&&opt.events&&opt.events.hide.call($trigger,opt
)===false){return}$trigger.removeData("contextMenu").removeClass("context-menu-active");if(
opt.$layer){setTimeout(function($layer){return function(){$layer.remove()}}(opt.$layer),10);try{
delete opt.$layer}catch(e){opt.$layer=null}}$currentTrigger=null;opt.$menu.find(
"."+opt.classNames.hover).trigger("contextmenu:blur");opt.$selected=null;opt.$menu.find(
"."+opt.classNames.visible).removeClass(opt.classNames.visible);$(document).off(
".contextMenuAutoHide").off("keydown.contextMenu");if(opt.$menu){opt.$menu[opt.animation.hide](
opt.animation.duration,function(){if(opt.build){opt.$menu.remove();$.each(opt,function(key){switch(
key){case"ns":case"selector":case"build":case"trigger":return true;default:opt[key]=undefined;try{
delete opt[key]}catch(e){}return true}})}setTimeout(function(){$trigger.trigger("contextmenu:hidden"
)},10)})}},create:function(opt,root){if(typeof root==="undefined"){root=opt}opt.$menu=$(
'<ul class="context-menu-list"></ul>').addClass(opt.className||"").data({contextMenu:opt,
contextMenuRoot:root});if(opt.dataAttr){$.each(opt.dataAttr,function(key,item){opt.$menu.attr(
"data-"+opt.key,item)})}$.each(["callbacks","commands","inputs"],function(i,k){opt[k]={};if(!root[k]
){root[k]={}}});if(!root.accesskeys){root.accesskeys={}}function createNameNode(item){var $name=$(
"<span></span>");if(item._accesskey){if(item._beforeAccesskey){$name.append(document.createTextNode(
item._beforeAccesskey))}$("<span></span>").addClass("context-menu-accesskey").text(item._accesskey
).appendTo($name);if(item._afterAccesskey){$name.append(document.createTextNode(item._afterAccesskey
))}}else{if(item.isHtmlName){if(typeof item.accesskey!=="undefined"){throw new Error(
"accesskeys are not compatible with HTML names and cannot be used together in the same item")}
$name.html(item.name)}else{$name.text(item.name)}}return $name}$.each(opt.items,function(key,item){
var $t=$('<li class="context-menu-item"></li>').addClass(item.className||""),$label=null,$input=null
$t.on("click",$.noop);if(typeof item==="string"||item.type==="cm_separator"){item={
type:"cm_seperator"}}item.$node=$t.data({contextMenu:opt,contextMenuRoot:root,contextMenuKey:key});
if(typeof item.accesskey!=="undefined"){var aks=splitAccesskey(item.accesskey);for(var i=0,
ak;ak=aks[i];i++){if(!root.accesskeys[ak]){root.accesskeys[ak]=item;var matched=item.name.match(
new RegExp("^(.*?)("+ak+")(.*)$","i"));if(matched){item._beforeAccesskey=matched[1];
item._accesskey=matched[2];item._afterAccesskey=matched[3]}break}}}if(item.type&&types[item.type]){
types[item.type].call($t,item,opt,root);$.each([opt,root],function(i,k){k.commands[key]=item;if(
$.isFunction(item.callback)&&(typeof k.callbacks[key]==="undefined"||typeof opt.type==="undefined")
){k.callbacks[key]=item.callback}})}else{if(item.type==="cm_seperator"){$t.addClass(
"context-menu-separator "+root.classNames.notSelectable)}else if(item.type==="html"){$t.addClass(
"context-menu-html "+root.classNames.notSelectable)}else if(item.type!=="sub"&&item.type){$label=$(
"<label></label>").appendTo($t);createNameNode(item).appendTo($label);$t.addClass(
"context-menu-input");opt.hasTypes=true;$.each([opt,root],function(i,k){k.commands[key]=item;
k.inputs[key]=item})}else if(item.items){item.type="sub"}switch(item.type){case"cm_seperator":break;
case"text":$input=$('<input type="text" value="1" name="" />').attr("name","context-menu-input-"+key
).val(item.value||"").appendTo($label);break;case"textarea":$input=$('<textarea name=""></textarea>'
).attr("name","context-menu-input-"+key).val(item.value||"").appendTo($label);if(item.height){
$input.height(item.height)}break;case"checkbox":$input=$(
'<input type="checkbox" value="1" name="" />').attr("name","context-menu-input-"+key).val(
item.value||"").prop("checked",!!item.selected).prependTo($label);break;case"radio":$input=$(
'<input type="radio" value="1" name="" />').attr("name","context-menu-input-"+item.radio).val(
item.value||"").prop("checked",!!item.selected).prependTo($label);break;case"select":$input=$(
'<select name=""></select>').attr("name","context-menu-input-"+key).appendTo($label);if(item.options
){$.each(item.options,function(value,text){$("<option></option>").val(value).text(text).appendTo(
$input)});$input.val(item.selected)}break;case"sub":createNameNode(item).appendTo($t);
item.appendTo=item.$node;$t.data("contextMenu",item).addClass("context-menu-submenu");
item.callback=null;if("function"===typeof item.items.then){op.processPromises(item,root,item.items)
}else{op.create(item,root)}break;case"html":$(item.html).appendTo($t);break;default:$.each([opt,root
],function(i,k){k.commands[key]=item;if($.isFunction(item.callback)&&(typeof k.callbacks[key
]==="undefined"||typeof opt.type==="undefined")){k.callbacks[key]=item.callback}});createNameNode(
item).appendTo($t);break}if(
item.type&&item.type!=="sub"&&item.type!=="html"&&item.type!=="cm_seperator"){$input.on("focus",
handle.focusInput).on("blur",handle.blurInput);if(item.events){$input.on(item.events,opt)}}if(
item.icon){if($.isFunction(item.icon)){item._icon=item.icon.call(this,this,$t,key,item)}else{if(
typeof item.icon==="string"&&(item.icon.substring(0,4)==="fab "||item.icon.substring(0,4
)==="fas "||item.icon.substring(0,4)==="fad "||item.icon.substring(0,4
)==="far "||item.icon.substring(0,4)==="fal ")){$t.addClass(
root.classNames.icon+" "+root.classNames.icon+"--fa5");item._icon=$('<i class="'+item.icon+'"></i>')
}else if(typeof item.icon==="string"&&item.icon.substring(0,3)==="fa-"){
item._icon=root.classNames.icon+" "+root.classNames.icon+"--fa fa "+item.icon}else{
item._icon=root.classNames.icon+" "+root.classNames.icon+"-"+item.icon}}if(
typeof item._icon==="string"){$t.addClass(item._icon)}else{$t.prepend(item._icon)}}}
item.$input=$input;item.$label=$label;$t.appendTo(opt.$menu);if(
!opt.hasTypes&&$.support.eventSelectstart){$t.on("selectstart.disableTextSelect",handle.abortevent)}
});if(!opt.$node){opt.$menu.css("display","none").addClass("context-menu-root")}opt.$menu.appendTo(
opt.appendTo||document.body)},resize:function($menu,nested){var domMenu;$menu.css({
position:"absolute",display:"block"});$menu.data("width",(domMenu=$menu.get(0)
).getBoundingClientRect?Math.ceil(domMenu.getBoundingClientRect().width):$menu.outerWidth()+1);
$menu.css({position:"static",minWidth:"0px",maxWidth:"100000px"});$menu.find("> li > ul").each(
function(){op.resize($(this),true)});if(!nested){$menu.find("ul").addBack().css({position:"",
display:"",minWidth:"",maxWidth:""}).outerWidth(function(){return $(this).data("width")})}},
update:function(opt,root){var $trigger=this;if(typeof root==="undefined"){root=opt;op.resize(
opt.$menu)}var hasVisibleItems=false;opt.$menu.children().each(function(){var $item=$(this),
key=$item.data("contextMenuKey"),item=opt.items[key],disabled=$.isFunction(item.disabled
)&&item.disabled.call($trigger,key,root)||item.disabled===true,visible;if($.isFunction(item.visible)
){visible=item.visible.call($trigger,key,root)}else if(typeof item.visible!=="undefined"){
visible=item.visible===true}else{visible=true}if(visible){hasVisibleItems=true}$item[
visible?"show":"hide"]();$item[disabled?"addClass":"removeClass"](root.classNames.disabled);if(
$.isFunction(item.icon)){$item.removeClass(item._icon);var iconResult=item.icon.call(this,$trigger,
$item,key,item);if(typeof iconResult==="string"){$item.addClass(iconResult)}else{$item.prepend(
iconResult)}}if(item.type){$item.find("input, select, textarea").prop("disabled",disabled);switch(
item.type){case"text":case"textarea":item.$input.val(item.value||"");break;case"checkbox":
case"radio":item.$input.val(item.value||"").prop("checked",!!item.selected);break;case"select":
item.$input.val((item.selected===0?"0":item.selected)||"");break}}if(item.$menu){
var subMenuHasVisibleItems=op.update.call($trigger,item,root);if(subMenuHasVisibleItems){
hasVisibleItems=true}}});return hasVisibleItems},layer:function(opt,zIndex){var $layer=opt.$layer=$(
'<div id="context-menu-layer"></div>').css({height:$win.height(),width:$win.width(),display:"block",
position:"fixed","z-index":zIndex-1,top:0,left:0,opacity:0,filter:"alpha(opacity=0)",
"background-color":"#000"}).data("contextMenuRoot",opt).appendTo(document.body).on("contextmenu",
handle.abortevent).on("mousedown",handle.layerClick);if(
typeof document.body.style.maxWidth==="undefined"){$layer.css({position:"absolute",height:$(document
).height()})}return $layer},processPromises:function(opt,root,promise){opt.$node.addClass(
root.classNames.iconLoadingClass);function completedPromise(opt,root,items){if(
typeof items==="undefined"){errorPromise(undefined)}finishPromiseProcess(opt,root,items)}
function errorPromise(opt,root,errorItem){if(typeof errorItem==="undefined"){errorItem={error:{
name:"No items and no error item",icon:"context-menu-icon context-menu-icon-quit"}};if(
window.console){(console.error||console.log).call(console,
'When you reject a promise, provide an "items" object, equal to normal sub-menu items')}}else if(
typeof errorItem==="string"){errorItem={error:{name:errorItem}}}finishPromiseProcess(opt,root,
errorItem)}function finishPromiseProcess(opt,root,items){if(
typeof root.$menu==="undefined"||!root.$menu.is(":visible")){return}opt.$node.removeClass(
root.classNames.iconLoadingClass);opt.items=items;op.create(opt,root,true);op.update(opt,root);
root.positionSubmenu.call(opt.$node,opt.$menu)}promise.then(completedPromise.bind(this,opt,root),
errorPromise.bind(this,opt,root))},activated:function(opt){var $menu=opt.$menu;
var $menuOffset=$menu.offset();var winHeight=$(window).height();var winScrollTop=$(window
).scrollTop();var menuHeight=$menu.height();if(menuHeight>winHeight){$menu.css({
height:winHeight+"px","overflow-x":"hidden","overflow-y":"auto",top:winScrollTop+"px"})}else if(
$menuOffset.top<winScrollTop||$menuOffset.top+menuHeight>winScrollTop+winHeight){$menu.css({
top:winScrollTop+"px"})}}};function splitAccesskey(val){var t=val.split(/\s+/);var keys=[];for(
var i=0,k;k=t[i];i++){k=k.charAt(0).toUpperCase();keys.push(k)}return keys}
$.fn.contextMenu=function(operation){var $t=this,$o=operation;if(this.length>0){if(
typeof operation==="undefined"){this.first().trigger("contextmenu")}else if(
typeof operation.x!=="undefined"&&typeof operation.y!=="undefined"){this.first().trigger($.Event(
"contextmenu",{pageX:operation.x,pageY:operation.y,mouseButton:operation.button}))}else if(
operation==="hide"){var $menu=this.first().data("contextMenu")?this.first().data("contextMenu"
).$menu:null;if($menu){$menu.trigger("contextmenu:hide")}}else if(operation==="destroy"){
$.contextMenu("destroy",{context:this})}else if($.isPlainObject(operation)){operation.context=this;
$.contextMenu("create",operation)}else if(operation){this.removeClass("context-menu-disabled")
}else if(!operation){this.addClass("context-menu-disabled")}}else{$.each(menus,function(){if(
this.selector===$t.selector){$o.data=this;$.extend($o.data,{trigger:"demand"})}});
handle.contextmenu.call($o.target,$o)}return this};$.contextMenu=function(operation,options){if(
typeof operation!=="string"){options=operation;operation="create"}if(typeof options==="string"){
options={selector:options}}else if(typeof options==="undefined"){options={}}var o=$.extend(true,{},
defaults,options||{});var $document=$(document);var $context=$document;var _hasContext=false;if(
!o.context||!o.context.length){o.context=document}else{$context=$(o.context).first();
o.context=$context.get(0);_hasContext=!$(o.context).is(document)}switch(operation){case"update":if(
_hasContext){op.update($context)}else{for(var menu in menus){if(menus.hasOwnProperty(menu)){
op.update(menus[menu])}}}break;case"create":if(!o.selector){throw new Error("No selector specified")
}if(o.selector.match(/.context-menu-(list|item|input)($|\s)/)){throw new Error(
'Cannot bind to selector "'+o.selector+'" as it contains a reserved className')}if(!o.build&&(
!o.items||$.isEmptyObject(o.items))){throw new Error("No Items specified")}counter++;
o.ns=".contextMenu"+counter;if(!_hasContext){namespaces[o.selector]=o.ns}menus[o.ns]=o;if(!o.trigger
){o.trigger="right"}if(!initialized){
var itemClick=o.itemClickEvent==="click"?"click.contextMenu":"mouseup.contextMenu";
var contextMenuItemObj={"contextmenu:focus.contextMenu":handle.focusItem,
"contextmenu:blur.contextMenu":handle.blurItem,"contextmenu.contextMenu":handle.abortevent,
"mouseenter.contextMenu":handle.itemMouseenter,"mouseleave.contextMenu":handle.itemMouseleave};
contextMenuItemObj[itemClick]=handle.itemClick;$document.on({
"contextmenu:hide.contextMenu":handle.hideMenu,"prevcommand.contextMenu":handle.prevItem,
"nextcommand.contextMenu":handle.nextItem,"contextmenu.contextMenu":handle.abortevent,
"mouseenter.contextMenu":handle.menuMouseenter,"mouseleave.contextMenu":handle.menuMouseleave},
".context-menu-list").on("mouseup.contextMenu",".context-menu-input",handle.inputClick).on(
contextMenuItemObj,".context-menu-item");initialized=true}$context.on("contextmenu"+o.ns,o.selector,
o,handle.contextmenu);if(_hasContext){$context.on("remove"+o.ns,function(){$(this).contextMenu(
"destroy")})}switch(o.trigger){case"hover":$context.on("mouseenter"+o.ns,o.selector,o,
handle.mouseenter).on("mouseleave"+o.ns,o.selector,o,handle.mouseleave);break;case"left":
$context.on("click"+o.ns,o.selector,o,handle.click);break;case"touchstart":$context.on(
"touchstart"+o.ns,o.selector,o,handle.click);break}if(!o.build){op.create(o)}break;case"destroy":
var $visibleMenu;if(_hasContext){var context=o.context;$.each(menus,function(ns,o){if(!o){
return true}if(!$(context).is(o.selector)){return true}$visibleMenu=$(".context-menu-list").filter(
":visible");if($visibleMenu.length&&$visibleMenu.data().contextMenuRoot.$trigger.is($(o.context
).find(o.selector))){$visibleMenu.trigger("contextmenu:hide",{force:true})}try{if(menus[o.ns].$menu
){menus[o.ns].$menu.remove()}delete menus[o.ns]}catch(e){menus[o.ns]=null}$(o.context).off(o.ns);
return true})}else if(!o.selector){$document.off(".contextMenu .contextMenuAutoHide");$.each(menus,
function(ns,o){$(o.context).off(o.ns)});namespaces={};menus={};counter=0;initialized=false;$(
"#context-menu-layer, .context-menu-list").remove()}else if(namespaces[o.selector]){$visibleMenu=$(
".context-menu-list").filter(":visible");if($visibleMenu.length&&$visibleMenu.data(
).contextMenuRoot.$trigger.is(o.selector)){$visibleMenu.trigger("contextmenu:hide",{force:true})}
try{if(menus[namespaces[o.selector]].$menu){menus[namespaces[o.selector]].$menu.remove()}
delete menus[namespaces[o.selector]]}catch(e){menus[namespaces[o.selector]]=null}$document.off(
namespaces[o.selector])}break;case"html5":if(
!$.support.htmlCommand&&!$.support.htmlMenuitem||typeof options==="boolean"&&options){$(
'menu[type="context"]').each(function(){if(this.id){$.contextMenu({
selector:"[contextmenu="+this.id+"]",items:$.contextMenu.fromMenu(this)})}}).css("display","none")}
break;default:throw new Error('Unknown operation "'+operation+'"')}return this};
$.contextMenu.setInputValues=function(opt,data){if(typeof data==="undefined"){data={}}$.each(
opt.inputs,function(key,item){switch(item.type){case"text":case"textarea":item.value=data[key]||"";
break;case"checkbox":item.selected=data[key]?true:false;break;case"radio":item.selected=(data[
item.radio]||"")===item.value;break;case"select":item.selected=data[key]||"";break}})};
$.contextMenu.getInputValues=function(opt,data){if(typeof data==="undefined"){data={}}$.each(
opt.inputs,function(key,item){switch(item.type){case"text":case"textarea":case"select":data[key
]=item.$input.val();break;case"checkbox":data[key]=item.$input.prop("checked");break;case"radio":if(
item.$input.prop("checked")){data[item.radio]=item.value}break}});return data};function inputLabel(
node){return node.id&&$('label[for="'+node.id+'"]').val()||node.name}function menuChildren(items,
$children,counter){if(!counter){counter=0}$children.each(function(){var $node=$(this),node=this,
nodeName=this.nodeName.toLowerCase(),label,item;if(nodeName==="label"&&$node.find(
"input, textarea, select").length){label=$node.text();$node=$node.children().first();node=$node.get(
0);nodeName=node.nodeName.toLowerCase()}switch(nodeName){case"menu":item={name:$node.attr("label"),
items:{}};counter=menuChildren(item.items,$node.children(),counter);break;case"a":case"button":
item={name:$node.text(),disabled:!!$node.attr("disabled"),callback:function(){return function(){
$node.get(0).click()}}()};break;case"menuitem":case"command":switch($node.attr("type")){
case undefined:case"command":case"menuitem":item={name:$node.attr("label"),disabled:!!$node.attr(
"disabled"),icon:$node.attr("icon"),callback:function(){return function(){$node.get(0).click()}}()};
break;case"checkbox":item={type:"checkbox",disabled:!!$node.attr("disabled"),name:$node.attr("label"
),selected:!!$node.attr("checked")};break;case"radio":item={type:"radio",disabled:!!$node.attr(
"disabled"),name:$node.attr("label"),radio:$node.attr("radiogroup"),value:$node.attr("id"),
selected:!!$node.attr("checked")};break;default:item=undefined}break;case"hr":item="-------";break;
case"input":switch($node.attr("type")){case"text":item={type:"text",name:label||inputLabel(node),
disabled:!!$node.attr("disabled"),value:$node.val()};break;case"checkbox":item={type:"checkbox",
name:label||inputLabel(node),disabled:!!$node.attr("disabled"),selected:!!$node.attr("checked")};
break;case"radio":item={type:"radio",name:label||inputLabel(node),disabled:!!$node.attr("disabled"),
radio:!!$node.attr("name"),value:$node.val(),selected:!!$node.attr("checked")};break;default:
item=undefined;break}break;case"select":item={type:"select",name:label||inputLabel(node),
disabled:!!$node.attr("disabled"),selected:$node.val(),options:{}};$node.children().each(function(){
item.options[this.value]=$(this).text()});break;case"textarea":item={type:"textarea",
name:label||inputLabel(node),disabled:!!$node.attr("disabled"),value:$node.val()};break;case"label":
break;default:item={type:"html",html:$node.clone(true)};break}if(item){counter++;items["key"+counter
]=item}});return counter}$.contextMenu.fromMenu=function(element){var $this=$(element),items={};
menuChildren(items,$this.children());return items};$.contextMenu.defaults=defaults;
$.contextMenu.types=types;$.contextMenu.handle=handle;$.contextMenu.op=op;$.contextMenu.menus=menus}
);(function(factory){"use strict";if(typeof define==="function"&&define.amd){define(["jquery"],
factory)}else{factory(jQuery)}})(function($){"use strict";$.ui=$.ui||{};
var version=$.ui.version="1.13.2";var widgetUuid=0;
var widgetHasOwnProperty=Array.prototype.hasOwnProperty;var widgetSlice=Array.prototype.slice;
$.cleanData=function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i]
)!=null;i++){events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove"
)}}orig(elems)}}($.cleanData);$.widget=function(name,base,prototype){var existingConstructor,
constructor,basePrototype;var proxiedPrototype={};var namespace=name.split(".")[0];name=name.split(
".")[1];var fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget}if(
Array.isArray(prototype)){prototype=$.extend.apply(null,[{}].concat(prototype))}$.expr.pseudos[
fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName)};$[namespace]=$[namespace]||{};
existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(
!this||!this._createWidget){return new constructor(options,element)}if(arguments.length){
this._createWidget(options,element)}};$.extend(constructor,existingConstructor,{
version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});
basePrototype=new base;basePrototype.options=$.widget.extend({},basePrototype.options);$.each(
prototype,function(prop,value){if(typeof value!=="function"){proxiedPrototype[prop]=value;return}
proxiedPrototype[prop]=function(){function _super(){return base.prototype[prop].apply(this,arguments
)}function _superApply(args){return base.prototype[prop].apply(this,args)}return function(){
var __super=this._super;var __superApply=this._superApply;var returnValue;this._super=_super;
this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;
this._superApply=__superApply;return returnValue}}()});constructor.prototype=$.widget.extend(
basePrototype,{widgetEventPrefix:existingConstructor?basePrototype.widgetEventPrefix||name:name},
proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,
widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,
function(i,child){var childPrototype=child.prototype;$.widget(
childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto)});
delete existingConstructor._childConstructors}else{base._childConstructors.push(constructor)}
$.widget.bridge(name,constructor);return constructor};$.widget.extend=function(target){
var input=widgetSlice.call(arguments,1);var inputIndex=0;var inputLength=input.length;var key;
var value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[
inputIndex][key];if(widgetHasOwnProperty.call(input[inputIndex],key)&&value!==undefined){if(
$.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],
value):$.widget.extend({},value)}else{target[key]=value}}}}return target};$.widget.bridge=function(
name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){
var isMethodCall=typeof options==="string";var args=widgetSlice.call(arguments,1);
var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined
}else{this.each(function(){var methodValue;var instance=$.data(this,fullName);if(
options==="instance"){returnValue=instance;return false}if(!instance){return $.error(
"cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'"
)}if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error(
"no such method '"+options+"' for "+name+" widget instance")}methodValue=instance[options].apply(
instance,args);if(methodValue!==instance&&methodValue!==undefined){
returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;
return false}})}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args))}
this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});
if(instance._init){instance._init()}}else{$.data(this,fullName,new object(options,this))}})}
return returnValue}};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={
widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:false,
create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0
];this.element=$(element);this.uuid=widgetUuid++;this.eventNamespace="."+this.widgetName+this.uuid;
this.bindings=$();this.hoverable=$();this.focusable=$();this.classesElementLookup={};if(
element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{
remove:function(event){if(event.target===element){this.destroy()}}});this.document=$(
element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0
].defaultView||this.document[0].parentWindow)}this.options=$.widget.extend({},this.options,
this._getCreateOptions(),options);this._create();if(this.options.disabled){this._setOptionDisabled(
this.options.disabled)}this._trigger("create",null,this._getCreateEventData());this._init()},
_getCreateOptions:function(){return{}},_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,
destroy:function(){var that=this;this._destroy();$.each(this.classesElementLookup,function(key,value
){that._removeClass(value,key)});this.element.off(this.eventNamespace).removeData(
this.widgetFullName);this.widget().off(this.eventNamespace).removeAttr("aria-disabled");
this.bindings.off(this.eventNamespace)},_destroy:$.noop,widget:function(){return this.element},
option:function(key,value){var options=key;var parts;var curOption;var i;if(arguments.length===0){
return $.widget.extend({},this.options)}if(typeof key==="string"){options={};parts=key.split(".");
key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(
i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]]}
key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key]}
curOption[key]=value}else{if(arguments.length===1){return this.options[key
]===undefined?null:this.options[key]}options[key]=value}}this._setOptions(options);return this},
_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key])}
return this},_setOption:function(key,value){if(key==="classes"){this._setOptionClasses(value)}
this.options[key]=value;if(key==="disabled"){this._setOptionDisabled(value)}return this},
_setOptionClasses:function(value){var classKey,elements,currentElements;for(classKey in value){
currentElements=this.classesElementLookup[classKey];if(value[classKey]===this.options.classes[
classKey]||!currentElements||!currentElements.length){continue}elements=$(currentElements.get());
this._removeClass(currentElements,classKey);elements.addClass(this._classes({element:elements,
keys:classKey,classes:value,add:true}))}},_setOptionDisabled:function(value){this._toggleClass(
this.widget(),this.widgetFullName+"-disabled",null,!!value);if(value){this._removeClass(
this.hoverable,null,"ui-state-hover");this._removeClass(this.focusable,null,"ui-state-focus")}},
enable:function(){return this._setOptions({disabled:false})},disable:function(){
return this._setOptions({disabled:true})},_classes:function(options){var full=[];var that=this;
options=$.extend({element:this.element,classes:this.options.classes||{}},options);
function bindRemoveEvent(){var nodesToBind=[];options.element.each(function(_,element){
var isTracked=$.map(that.classesElementLookup,function(elements){return elements}).some(function(
elements){return elements.is(element)});if(!isTracked){nodesToBind.push(element)}});that._on($(
nodesToBind),{remove:"_untrackClassesElement"})}function processClassString(classes,checkOption){
var current,i;for(i=0;i<classes.length;i++){current=that.classesElementLookup[classes[i]]||$();if(
options.add){bindRemoveEvent();current=$($.uniqueSort(current.get().concat(options.element.get())))
}else{current=$(current.not(options.element).get())}that.classesElementLookup[classes[i]]=current;
full.push(classes[i]);if(checkOption&&options.classes[classes[i]]){full.push(options.classes[
classes[i]])}}}if(options.keys){processClassString(options.keys.match(/\S+/g)||[],true)}if(
options.extra){processClassString(options.extra.match(/\S+/g)||[])}return full.join(" ")},
_untrackClassesElement:function(event){var that=this;$.each(that.classesElementLookup,function(key,
value){if($.inArray(event.target,value)!==-1){that.classesElementLookup[key]=$(value.not(
event.target).get())}});this._off($(event.target))},_removeClass:function(element,keys,extra){
return this._toggleClass(element,keys,extra,false)},_addClass:function(element,keys,extra){
return this._toggleClass(element,keys,extra,true)},_toggleClass:function(element,keys,extra,add){
add=typeof add==="boolean"?add:extra;var shift=typeof element==="string"||element===null,options={
extra:shift?keys:extra,keys:shift?element:keys,element:shift?this.element:element,add:add};
options.element.toggleClass(this._classes(options),add);return this},_on:function(
suppressDisabledCheck,element,handlers){var delegateElement;var instance=this;if(
typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;
suppressDisabledCheck=false}if(!handlers){handlers=element;element=this.element;
delegateElement=this.widget()}else{element=delegateElement=$(element);
this.bindings=this.bindings.add(element)}$.each(handlers,function(event,handler){
function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this
).hasClass("ui-state-disabled"))){return}return(typeof handler==="string"?instance[handler]:handler
).apply(instance,arguments)}if(typeof handler!=="string"){
handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++}var match=event.match(
/^([\w:-]*)\s*(.*)$/);var eventName=match[1]+instance.eventNamespace;var selector=match[2];if(
selector){delegateElement.on(eventName,selector,handlerProxy)}else{element.on(eventName,handlerProxy
)}})},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(
this.eventNamespace+" ")+this.eventNamespace;element.off(eventName);this.bindings=$(
this.bindings.not(element).get());this.focusable=$(this.focusable.not(element).get());
this.hoverable=$(this.hoverable.not(element).get())},_delay:function(handler,delay){
function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,
arguments)}var instance=this;return setTimeout(handlerProxy,delay||0)},_hoverable:function(element){
this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){
this._addClass($(event.currentTarget),null,"ui-state-hover")},mouseleave:function(event){
this._removeClass($(event.currentTarget),null,"ui-state-hover")}})},_focusable:function(element){
this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){this._addClass(
$(event.currentTarget),null,"ui-state-focus")},focusout:function(event){this._removeClass($(
event.currentTarget),null,"ui-state-focus")}})},_trigger:function(type,event,data){var prop,orig;
var callback=this.options[type];data=data||{};event=$.Event(event);event.type=(
type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();
event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)
){event[prop]=orig[prop]}}}this.element.trigger(event,data);return!(
typeof callback==="function"&&callback.apply(this.element[0],[event].concat(data)
)===false||event.isDefaultPrevented())}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,
defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(
typeof options==="string"){options={effect:options}}var hasOptions;
var effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect
options=options||{};if(typeof options==="number"){options={duration:options}}else if(options===true
){options={}}hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){
element.delay(options.delay)}if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method
](options)}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,
options.easing,callback)}else{element.queue(function(next){$(this)[method]();if(callback){
callback.call(element[0])}next()})}}});var widget=$.widget;(function(){var cachedScrollbarWidth,
max=Math.max,abs=Math.abs,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,
roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;
function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0]
)?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)]}function parseCss(
element,property){return parseInt($.css(element,property),10)||0}function isWindow(obj){
return obj!=null&&obj===obj.window}function getDimensions(elem){var raw=elem[0];if(raw.nodeType===9
){return{width:elem.width(),height:elem.height(),offset:{top:0,left:0}}}if(isWindow(raw)){return{
width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}}}if(
raw.preventDefault){return{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}}}return{
width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()}}$.position={
scrollbarWidth:function(){if(cachedScrollbarWidth!==undefined){return cachedScrollbarWidth}var w1,w2
,div=$(
"<div style="+"'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>"+"<div style='height:300px;width:auto;'></div></div>"
),innerDiv=div.children()[0];$("body").append(div);w1=innerDiv.offsetWidth;div.css("overflow",
"scroll");w2=innerDiv.offsetWidth;if(w1===w2){w2=div[0].clientWidth}div.remove();
return cachedScrollbarWidth=w1-w2},getScrollInfo:function(within){
var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),
overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),
hasOverflowX=overflowX==="scroll"||overflowX==="auto"&&within.width<within.element[0].scrollWidth,
hasOverflowY=overflowY==="scroll"||overflowY==="auto"&&within.height<within.element[0].scrollHeight;
return{width:hasOverflowY?$.position.scrollbarWidth():0,
height:hasOverflowX?$.position.scrollbarWidth():0}},getWithinInfo:function(element){
var withinElement=$(element||window),isElemWindow=isWindow(withinElement[0]),
isDocument=!!withinElement[0]&&withinElement[0].nodeType===9,hasOffset=!isElemWindow&&!isDocument;
return{element:withinElement,isWindow:isElemWindow,isDocument:isDocument,offset:hasOffset?$(element
).offset():{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),
width:withinElement.outerWidth(),height:withinElement.outerHeight()}}};$.fn.position=function(
options){if(!options||!options.of){return _position.apply(this,arguments)}options=$.extend({},
options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,
target=typeof options.of==="string"?$(document).find(options.of):$(options.of),
within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),
collision=(options.collision||"flip").split(" "),offsets={};dimensions=getDimensions(target);if(
target[0].preventDefault){options.at="left top"}targetWidth=dimensions.width;
targetHeight=dimensions.height;targetOffset=dimensions.offset;basePosition=$.extend({},targetOffset)
$.each(["my","at"],function(){var pos=(options[this]||"").split(" "),horizontalOffset,verticalOffset
if(pos.length===1){pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?[
"center"].concat(pos):["center","center"]}pos[0]=rhorizontal.test(pos[0])?pos[0]:"center";pos[1
]=rvertical.test(pos[1])?pos[1]:"center";horizontalOffset=roffset.exec(pos[0]);
verticalOffset=roffset.exec(pos[1]);offsets[this]=[horizontalOffset?horizontalOffset[0]:0,
verticalOffset?verticalOffset[0]:0];options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[
0]]});if(collision.length===1){collision[1]=collision[0]}if(options.at[0]==="right"){
basePosition.left+=targetWidth}else if(options.at[0]==="center"){basePosition.left+=targetWidth/2}
if(options.at[1]==="bottom"){basePosition.top+=targetHeight}else if(options.at[1]==="center"){
basePosition.top+=targetHeight/2}atOffset=getOffsets(offsets.at,targetWidth,targetHeight);
basePosition.left+=atOffset[0];basePosition.top+=atOffset[1];return this.each(function(){
var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),
marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),
collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,
collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,
position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),
elem.outerHeight());if(options.my[0]==="right"){position.left-=elemWidth}else if(options.my[0
]==="center"){position.left-=elemWidth/2}if(options.my[1]==="bottom"){position.top-=elemHeight
}else if(options.my[1]==="center"){position.top-=elemHeight/2}position.left+=myOffset[0];
position.top+=myOffset[1];collisionPosition={marginLeft:marginLeft,marginTop:marginTop};$.each([
"left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](
position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,
elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,
collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],
my:options.my,at:options.at,within:within,elem:elem})}});if(options.using){using=function(props){
var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,
top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{
element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},
element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},
horizontal:right<0?"left":left>0?"right":"center",vertical:bottom<0?"top":top>0?"bottom":"middle"};
if(targetWidth<elemWidth&&abs(left+right)<targetWidth){feedback.horizontal="center"}if(
targetHeight<elemHeight&&abs(top+bottom)<targetHeight){feedback.vertical="middle"}if(max(abs(left),
abs(right))>max(abs(top),abs(bottom))){feedback.important="horizontal"}else{
feedback.important="vertical"}options.using.call(this,props,feedback)}}elem.offset($.extend(position
,{using:using}))})};$.ui.position={fit:{left:function(position,data){var within=data.within,
withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,
collisionPosLeft=position.left-data.collisionPosition.marginLeft,
overLeft=withinOffset-collisionPosLeft,
overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset,newOverRight;if(
data.collisionWidth>outerWidth){if(overLeft>0&&overRight<=0){
newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset;
position.left+=overLeft-newOverRight}else if(overRight>0&&overLeft<=0){position.left=withinOffset
}else{if(overLeft>overRight){position.left=withinOffset+outerWidth-data.collisionWidth}else{
position.left=withinOffset}}}else if(overLeft>0){position.left+=overLeft}else if(overRight>0){
position.left-=overRight}else{position.left=max(position.left-collisionPosLeft,position.left)}},
top:function(position,data){var within=data.within,
withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,
collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,
overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset,newOverBottom;if(
data.collisionHeight>outerHeight){if(overTop>0&&overBottom<=0){
newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset;
position.top+=overTop-newOverBottom}else if(overBottom>0&&overTop<=0){position.top=withinOffset
}else{if(overTop>overBottom){position.top=withinOffset+outerHeight-data.collisionHeight}else{
position.top=withinOffset}}}else if(overTop>0){position.top+=overTop}else if(overBottom>0){
position.top-=overBottom}else{position.top=max(position.top-collisionPosTop,position.top)}}},flip:{
left:function(position,data){var within=data.within,
withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,
offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,
collisionPosLeft=position.left-data.collisionPosition.marginLeft,
overLeft=collisionPosLeft-offsetLeft,
overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset=data.my[0
]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0
]==="left"?data.targetWidth:data.at[0]==="right"?-data.targetWidth:0,offset=-2*data.offset[0],
newOverRight,newOverLeft;if(overLeft<0){
newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset;if(
newOverRight<0||newOverRight<abs(overLeft)){position.left+=myOffset+atOffset+offset}}else if(
overRight>0){
newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft;if(
newOverLeft>0||abs(newOverLeft)<overRight){position.left+=myOffset+atOffset+offset}}},top:function(
position,data){var within=data.within,withinOffset=within.offset.top+within.scrollTop,
outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,
collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,
overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top=data.my[1]==="top",
myOffset=top?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1
]==="top"?data.targetHeight:data.at[1]==="bottom"?-data.targetHeight:0,offset=-2*data.offset[1],
newOverTop,newOverBottom;if(overTop<0){
newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset;
if(newOverBottom<0||newOverBottom<abs(overTop)){position.top+=myOffset+atOffset+offset}}else if(
overBottom>0){
newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop;if(
newOverTop>0||abs(newOverTop)<overBottom){position.top+=myOffset+atOffset+offset}}}},flipfit:{
left:function(){$.ui.position.flip.left.apply(this,arguments);$.ui.position.fit.left.apply(this,
arguments)},top:function(){$.ui.position.flip.top.apply(this,arguments);$.ui.position.fit.top.apply(
this,arguments)}}}})();var position=$.ui.position;var data=$.extend($.expr.pseudos,{
data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){
return!!$.data(elem,dataName)}}):function(elem,i,match){return!!$.data(elem,match[3])}});
var disableSelection=$.fn.extend({disableSelection:function(){
var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";
return function(){return this.on(eventType+".ui-disableSelection",function(event){
event.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});
var jQuery=$;
var stepHooks="backgroundColor borderBottomColor borderLeftColor borderRightColor "+"borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"
,class2type={},toString=class2type.toString,rplusequals=/^([\-+])=\s*(\d+\.?\d*)/,stringParsers=[{
re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
parse:function(execResult){return[execResult[1],execResult[2],execResult[3],execResult[4]]}},{
re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
parse:function(execResult){return[execResult[1]*2.55,execResult[2]*2.55,execResult[3]*2.55,
execResult[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(
execResult){return[parseInt(execResult[1],16),parseInt(execResult[2],16),parseInt(execResult[3],16),
execResult[4]?(parseInt(execResult[4],16)/255).toFixed(2):1]}},{
re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(execResult){return[parseInt(
execResult[1]+execResult[1],16),parseInt(execResult[2]+execResult[2],16),parseInt(execResult[3
]+execResult[3],16),execResult[4]?(parseInt(execResult[4]+execResult[4],16)/255).toFixed(2):1]}},{
re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
space:"hsla",parse:function(execResult){return[execResult[1],execResult[2]/100,execResult[3]/100,
execResult[4]]}}],color=jQuery.Color=function(color,green,blue,alpha){
return new jQuery.Color.fn.parse(color,green,blue,alpha)},spaces={rgba:{props:{red:{idx:0,
type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,
type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},propTypes={
byte:{floor:true,max:255},percent:{max:1},degrees:{mod:360,floor:true}},support=color.support={},
supportElem=jQuery("<p>")[0],colors,each=jQuery.each;
supportElem.style.cssText="background-color:rgba(1,1,1,.5)";
support.rgba=supportElem.style.backgroundColor.indexOf("rgba")>-1;each(spaces,function(spaceName,
space){space.cache="_"+spaceName;space.props.alpha={idx:3,type:"percent",def:1}});jQuery.each(
"Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(_i,name){
class2type["[object "+name+"]"]=name.toLowerCase()});function getType(obj){if(obj==null){
return obj+""}return typeof obj==="object"?class2type[toString.call(obj)]||"object":typeof obj}
function clamp(value,prop,allowEmpty){var type=propTypes[prop.type]||{};if(value==null){
return allowEmpty||!prop.def?null:prop.def}value=type.floor?~~value:parseFloat(value);if(isNaN(value
)){return prop.def}if(type.mod){return(value+type.mod)%type.mod}return Math.min(type.max,Math.max(0,
value))}function stringParse(string){var inst=color(),rgba=inst._rgba=[];string=string.toLowerCase()
each(stringParsers,function(_i,parser){var parsed,match=parser.re.exec(string),
values=match&&parser.parse(match),spaceName=parser.space||"rgba";if(values){parsed=inst[spaceName](
values);inst[spaces[spaceName].cache]=parsed[spaces[spaceName].cache];rgba=inst._rgba=parsed._rgba;
return false}});if(rgba.length){if(rgba.join()==="0,0,0,0"){jQuery.extend(rgba,colors.transparent)}
return inst}return colors[string]}color.fn=jQuery.extend(color.prototype,{parse:function(red,green,
blue,alpha){if(red===undefined){this._rgba=[null,null,null,null];return this}if(
red.jquery||red.nodeType){red=jQuery(red).css(green);green=undefined}var inst=this,type=getType(red)
,rgba=this._rgba=[];if(green!==undefined){red=[red,green,blue,alpha];type="array"}if(type==="string"
){return this.parse(stringParse(red)||colors._default)}if(type==="array"){each(spaces.rgba.props,
function(_key,prop){rgba[prop.idx]=clamp(red[prop.idx],prop)});return this}if(type==="object"){if(
red instanceof color){each(spaces,function(_spaceName,space){if(red[space.cache]){inst[space.cache
]=red[space.cache].slice()}})}else{each(spaces,function(_spaceName,space){var cache=space.cache;
each(space.props,function(key,prop){if(!inst[cache]&&space.to){if(key==="alpha"||red[key]==null){
return}inst[cache]=space.to(inst._rgba)}inst[cache][prop.idx]=clamp(red[key],prop,true)});if(inst[
cache]&&jQuery.inArray(null,inst[cache].slice(0,3))<0){if(inst[cache][3]==null){inst[cache][3]=1}if(
space.from){inst._rgba=space.from(inst[cache])}}})}return this}},is:function(compare){var is=color(
compare),same=true,inst=this;each(spaces,function(_,space){var localCache,isCache=is[space.cache];
if(isCache){localCache=inst[space.cache]||space.to&&space.to(inst._rgba)||[];each(space.props,
function(_,prop){if(isCache[prop.idx]!=null){same=isCache[prop.idx]===localCache[prop.idx];
return same}})}return same});return same},_space:function(){var used=[],inst=this;each(spaces,
function(spaceName,space){if(inst[space.cache]){used.push(spaceName)}});return used.pop()},
transition:function(other,distance){var end=color(other),spaceName=end._space(),space=spaces[
spaceName],startColor=this.alpha()===0?color("transparent"):this,start=startColor[space.cache
]||space.to(startColor._rgba),result=start.slice();end=end[space.cache];each(space.props,function(
_key,prop){var index=prop.idx,startValue=start[index],endValue=end[index],type=propTypes[prop.type
]||{};if(endValue===null){return}if(startValue===null){result[index]=endValue}else{if(type.mod){if(
endValue-startValue>type.mod/2){startValue+=type.mod}else if(startValue-endValue>type.mod/2){
startValue-=type.mod}}result[index]=clamp((endValue-startValue)*distance+startValue,prop)}});
return this[spaceName](result)},blend:function(opaque){if(this._rgba[3]===1){return this}
var rgb=this._rgba.slice(),a=rgb.pop(),blend=color(opaque)._rgba;return color(jQuery.map(rgb,
function(v,i){return(1-a)*blend[i]+a*v}))},toRgbaString:function(){var prefix="rgba(",
rgba=jQuery.map(this._rgba,function(v,i){if(v!=null){return v}return i>2?1:0});if(rgba[3]===1){
rgba.pop();prefix="rgb("}return prefix+rgba.join()+")"},toHslaString:function(){var prefix="hsla(",
hsla=jQuery.map(this.hsla(),function(v,i){if(v==null){v=i>2?1:0}if(i&&i<3){v=Math.round(v*100)+"%"}
return v});if(hsla[3]===1){hsla.pop();prefix="hsl("}return prefix+hsla.join()+")"},
toHexString:function(includeAlpha){var rgba=this._rgba.slice(),alpha=rgba.pop();if(includeAlpha){
rgba.push(~~(alpha*255))}return"#"+jQuery.map(rgba,function(v){v=(v||0).toString(16);
return v.length===1?"0"+v:v}).join("")},toString:function(){return this._rgba[3
]===0?"transparent":this.toRgbaString()}});color.fn.parse.prototype=color.fn;function hue2rgb(p,q,h
){h=(h+1)%1;if(h*6<1){return p+(q-p)*h*6}if(h*2<1){return q}if(h*3<2){return p+(q-p)*(2/3-h)*6}
return p}spaces.hsla.to=function(rgba){if(rgba[0]==null||rgba[1]==null||rgba[2]==null){return[null,
null,null,rgba[3]]}var r=rgba[0]/255,g=rgba[1]/255,b=rgba[2]/255,a=rgba[3],max=Math.max(r,g,b),
min=Math.min(r,g,b),diff=max-min,add=max+min,l=add*.5,h,s;if(min===max){h=0}else if(r===max){h=60*(
g-b)/diff+360}else if(g===max){h=60*(b-r)/diff+120}else{h=60*(r-g)/diff+240}if(diff===0){s=0
}else if(l<=.5){s=diff/add}else{s=diff/(2-add)}return[Math.round(h)%360,s,l,a==null?1:a]};
spaces.hsla.from=function(hsla){if(hsla[0]==null||hsla[1]==null||hsla[2]==null){return[null,null,
null,hsla[3]]}var h=hsla[0]/360,s=hsla[1],l=hsla[2],a=hsla[3],q=l<=.5?l*(1+s):l+s-l*s,p=2*l-q;
return[Math.round(hue2rgb(p,q,h+1/3)*255),Math.round(hue2rgb(p,q,h)*255),Math.round(hue2rgb(p,q,
h-1/3)*255),a]};each(spaces,function(spaceName,space){var props=space.props,cache=space.cache,
to=space.to,from=space.from;color.fn[spaceName]=function(value){if(to&&!this[cache]){this[cache]=to(
this._rgba)}if(value===undefined){return this[cache].slice()}var ret,type=getType(value),
arr=type==="array"||type==="object"?value:arguments,local=this[cache].slice();each(props,function(
key,prop){var val=arr[type==="object"?key:prop.idx];if(val==null){val=local[prop.idx]}local[prop.idx
]=clamp(val,prop)});if(from){ret=color(from(local));ret[cache]=local;return ret}else{return color(
local)}};each(props,function(key,prop){if(color.fn[key]){return}color.fn[key]=function(value){
var local,cur,match,fn,vtype=getType(value);if(key==="alpha"){fn=this._hsla?"hsla":"rgba"}else{
fn=spaceName}local=this[fn]();cur=local[prop.idx];if(vtype==="undefined"){return cur}if(
vtype==="function"){value=value.call(this,cur);vtype=getType(value)}if(value==null&&prop.empty){
return this}if(vtype==="string"){match=rplusequals.exec(value);if(match){value=cur+parseFloat(match[
2])*(match[1]==="+"?1:-1)}}local[prop.idx]=value;return this[fn](local)}})});color.hook=function(
hook){var hooks=hook.split(" ");each(hooks,function(_i,hook){jQuery.cssHooks[hook]={set:function(
elem,value){var parsed,curElem,backgroundColor="";if(value!=="transparent"&&(getType(value
)!=="string"||(parsed=stringParse(value)))){value=color(parsed||value);if(
!support.rgba&&value._rgba[3]!==1){curElem=hook==="backgroundColor"?elem.parentNode:elem;while((
backgroundColor===""||backgroundColor==="transparent")&&curElem&&curElem.style){try{
backgroundColor=jQuery.css(curElem,"backgroundColor");curElem=curElem.parentNode}catch(e){}}
value=value.blend(backgroundColor&&backgroundColor!=="transparent"?backgroundColor:"_default")}
value=value.toRgbaString()}try{elem.style[hook]=value}catch(e){}}};jQuery.fx.step[hook]=function(fx
){if(!fx.colorInit){fx.start=color(fx.elem,hook);fx.end=color(fx.end);fx.colorInit=true}
jQuery.cssHooks[hook].set(fx.elem,fx.start.transition(fx.end,fx.pos))}})};color.hook(stepHooks);
jQuery.cssHooks.borderColor={expand:function(value){var expanded={};each(["Top","Right","Bottom",
"Left"],function(_i,part){expanded["border"+part+"Color"]=value});return expanded}};
colors=jQuery.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",
gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",
purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",
transparent:[null,null,null,0],_default:"#ffffff"};var dataSpace="ui-effects-",
dataSpaceStyle="ui-effects-style",dataSpaceAnimated="ui-effects-animated";$.effects={effect:{}};(
function(){var classAnimationActions=["add","remove","toggle"],shorthandStyles={border:1,
borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1
};$.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(_,prop
){$.fx.step[prop]=function(fx){if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){
jQuery.style(fx.elem,prop,fx.end);fx.setAttr=true}}});function camelCase(string){
return string.replace(/-([\da-z])/gi,function(all,letter){return letter.toUpperCase()})}
function getElementStyles(elem){var key,len,
style=elem.ownerDocument.defaultView?elem.ownerDocument.defaultView.getComputedStyle(elem,null
):elem.currentStyle,styles={};if(style&&style.length&&style[0]&&style[style[0]]){len=style.length;
while(len--){key=style[len];if(typeof style[key]==="string"){styles[camelCase(key)]=style[key]}}
}else{for(key in style){if(typeof style[key]==="string"){styles[key]=style[key]}}}return styles}
function styleDifference(oldStyle,newStyle){var diff={},name,value;for(name in newStyle){
value=newStyle[name];if(oldStyle[name]!==value){if(!shorthandStyles[name]){if($.fx.step[name
]||!isNaN(parseFloat(value))){diff[name]=value}}}}return diff}if(!$.fn.addBack){
$.fn.addBack=function(selector){return this.add(
selector==null?this.prevObject:this.prevObject.filter(selector))}}$.effects.animateClass=function(
value,duration,easing,callback){var o=$.speed(duration,easing,callback);return this.queue(function(
){var animated=$(this),baseClass=animated.attr("class")||"",applyClassChange,
allAnimations=o.children?animated.find("*").addBack():animated;allAnimations=allAnimations.map(
function(){var el=$(this);return{el:el,start:getElementStyles(this)}});applyClassChange=function(){
$.each(classAnimationActions,function(i,action){if(value[action]){animated[action+"Class"](value[
action])}})};applyClassChange();allAnimations=allAnimations.map(function(){
this.end=getElementStyles(this.el[0]);this.diff=styleDifference(this.start,this.end);return this});
animated.attr("class",baseClass);allAnimations=allAnimations.map(function(){var styleInfo=this,
dfd=$.Deferred(),opts=$.extend({},o,{queue:false,complete:function(){dfd.resolve(styleInfo)}});
this.el.animate(this.diff,opts);return dfd.promise()});$.when.apply($,allAnimations.get()).done(
function(){applyClassChange();$.each(arguments,function(){var el=this.el;$.each(this.diff,function(
key){el.css(key,"")})});o.complete.call(animated[0])})})};$.fn.extend({addClass:function(orig){
return function(classNames,speed,easing,callback){return speed?$.effects.animateClass.call(this,{
add:classNames},speed,easing,callback):orig.apply(this,arguments)}}($.fn.addClass),
removeClass:function(orig){return function(classNames,speed,easing,callback){
return arguments.length>1?$.effects.animateClass.call(this,{remove:classNames},speed,easing,callback
):orig.apply(this,arguments)}}($.fn.removeClass),toggleClass:function(orig){return function(
classNames,force,speed,easing,callback){if(typeof force==="boolean"||force===undefined){if(!speed){
return orig.apply(this,arguments)}else{return $.effects.animateClass.call(this,force?{add:classNames
}:{remove:classNames},speed,easing,callback)}}else{return $.effects.animateClass.call(this,{
toggle:classNames},force,speed,easing)}}}($.fn.toggleClass),switchClass:function(remove,add,speed,
easing,callback){return $.effects.animateClass.call(this,{add:add,remove:remove},speed,easing,
callback)}})})();(function(){if($.expr&&$.expr.pseudos&&$.expr.pseudos.animated){
$.expr.pseudos.animated=function(orig){return function(elem){return!!$(elem).data(dataSpaceAnimated
)||orig(elem)}}($.expr.pseudos.animated)}if($.uiBackCompat!==false){$.extend($.effects,{
save:function(element,set){var i=0,length=set.length;for(;i<length;i++){if(set[i]!==null){
element.data(dataSpace+set[i],element[0].style[set[i]])}}},restore:function(element,set){var val,i=0
,length=set.length;for(;i<length;i++){if(set[i]!==null){val=element.data(dataSpace+set[i]);
element.css(set[i],val)}}},setMode:function(el,mode){if(mode==="toggle"){mode=el.is(":hidden"
)?"show":"hide"}return mode},createWrapper:function(element){if(element.parent().is(
".ui-effects-wrapper")){return element.parent()}var props={width:element.outerWidth(true),
height:element.outerHeight(true),float:element.css("float")},wrapper=$("<div></div>").addClass(
"ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0
}),size={width:element.width(),height:element.height()},active=document.activeElement;try{active.id
}catch(e){active=document.body}element.wrap(wrapper);if(element[0]===active||$.contains(element[0],
active)){$(active).trigger("focus")}wrapper=element.parent();if(element.css("position")==="static"){
wrapper.css({position:"relative"});element.css({position:"relative"})}else{$.extend(props,{
position:element.css("position"),zIndex:element.css("z-index")});$.each(["top","left","bottom",
"right"],function(i,pos){props[pos]=element.css(pos);if(isNaN(parseInt(props[pos],10))){props[pos
]="auto"}});element.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}element.css(
size);return wrapper.css(props).show()},removeWrapper:function(element){
var active=document.activeElement;if(element.parent().is(".ui-effects-wrapper")){element.parent(
).replaceWith(element);if(element[0]===active||$.contains(element[0],active)){$(active).trigger(
"focus")}}return element}})}$.extend($.effects,{version:"1.13.2",define:function(name,mode,effect){
if(!effect){effect=mode;mode="effect"}$.effects.effect[name]=effect;$.effects.effect[name].mode=mode
return effect},scaledDimensions:function(element,percent,direction){if(percent===0){return{height:0,
width:0,outerHeight:0,outerWidth:0}}var x=direction!=="horizontal"?(percent||100)/100:1,
y=direction!=="vertical"?(percent||100)/100:1;return{height:element.height()*y,width:element.width(
)*x,outerHeight:element.outerHeight()*y,outerWidth:element.outerWidth()*x}},clipToBox:function(
animation){return{width:animation.clip.right-animation.clip.left,
height:animation.clip.bottom-animation.clip.top,left:animation.clip.left,top:animation.clip.top}},
unshift:function(element,queueLength,count){var queue=element.queue();if(queueLength>1){
queue.splice.apply(queue,[1,0].concat(queue.splice(queueLength,count)))}element.dequeue()},
saveStyle:function(element){element.data(dataSpaceStyle,element[0].style.cssText)},
restoreStyle:function(element){element[0].style.cssText=element.data(dataSpaceStyle)||"";
element.removeData(dataSpaceStyle)},mode:function(element,mode){var hidden=element.is(":hidden");if(
mode==="toggle"){mode=hidden?"show":"hide"}if(hidden?mode==="hide":mode==="show"){mode="none"}
return mode},getBaseline:function(origin,original){var y,x;switch(origin[0]){case"top":y=0;break;
case"middle":y=.5;break;case"bottom":y=1;break;default:y=origin[0]/original.height}switch(origin[1]
){case"left":x=0;break;case"center":x=.5;break;case"right":x=1;break;default:x=origin[1
]/original.width}return{x:x,y:y}},createPlaceholder:function(element){var placeholder,
cssPosition=element.css("position"),position=element.position();element.css({marginTop:element.css(
"marginTop"),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),
marginRight:element.css("marginRight")}).outerWidth(element.outerWidth()).outerHeight(
element.outerHeight());if(/^(static|relative)/.test(cssPosition)){cssPosition="absolute";
placeholder=$("<"+element[0].nodeName+">").insertAfter(element).css({display:/^(inline|ruby)/.test(
element.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:element.css("marginTop"
),marginBottom:element.css("marginBottom"),marginLeft:element.css("marginLeft"),
marginRight:element.css("marginRight"),float:element.css("float")}).outerWidth(element.outerWidth()
).outerHeight(element.outerHeight()).addClass("ui-effects-placeholder");element.data(
dataSpace+"placeholder",placeholder)}element.css({position:cssPosition,left:position.left,
top:position.top});return placeholder},removePlaceholder:function(element){
var dataKey=dataSpace+"placeholder",placeholder=element.data(dataKey);if(placeholder){
placeholder.remove();element.removeData(dataKey)}},cleanUp:function(element){$.effects.restoreStyle(
element);$.effects.removePlaceholder(element)},setTransition:function(element,list,factor,value){
value=value||{};$.each(list,function(i,x){var unit=element.cssUnit(x);if(unit[0]>0){value[x]=unit[0
]*factor+unit[1]}});return value}});function _normalizeArguments(effect,options,speed,callback){if(
$.isPlainObject(effect)){options=effect;effect=effect.effect}effect={effect:effect};if(options==null
){options={}}if(typeof options==="function"){callback=options;speed=null;options={}}if(
typeof options==="number"||$.fx.speeds[options]){callback=speed;speed=options;options={}}if(
typeof speed==="function"){callback=speed;speed=null}if(options){$.extend(effect,options)}
speed=speed||options.duration;
effect.duration=$.fx.off?0:typeof speed==="number"?speed:speed in $.fx.speeds?$.fx.speeds[speed
]:$.fx.speeds._default;effect.complete=callback||options.complete;return effect}
function standardAnimationOption(option){if(!option||typeof option==="number"||$.fx.speeds[option]){
return true}if(typeof option==="string"&&!$.effects.effect[option]){return true}if(
typeof option==="function"){return true}if(typeof option==="object"&&!option.effect){return true}
return false}$.fn.extend({effect:function(){var args=_normalizeArguments.apply(this,arguments),
effectMethod=$.effects.effect[args.effect],defaultMode=effectMethod.mode,queue=args.queue,
queueName=queue||"fx",complete=args.complete,mode=args.mode,modes=[],prefilter=function(next){
var el=$(this),normalizedMode=$.effects.mode(el,mode)||defaultMode;el.data(dataSpaceAnimated,true);
modes.push(normalizedMode);if(defaultMode&&(
normalizedMode==="show"||normalizedMode===defaultMode&&normalizedMode==="hide")){el.show()}if(
!defaultMode||normalizedMode!=="none"){$.effects.saveStyle(el)}if(typeof next==="function"){next()}}
if($.fx.off||!effectMethod){if(mode){return this[mode](args.duration,complete)}else{
return this.each(function(){if(complete){complete.call(this)}})}}function run(next){var elem=$(this)
function cleanup(){elem.removeData(dataSpaceAnimated);$.effects.cleanUp(elem);if(args.mode==="hide"
){elem.hide()}done()}function done(){if(typeof complete==="function"){complete.call(elem[0])}if(
typeof next==="function"){next()}}args.mode=modes.shift();if($.uiBackCompat!==false&&!defaultMode){
if(elem.is(":hidden")?mode==="hide":mode==="show"){elem[mode]();done()}else{effectMethod.call(elem[0
],args,done)}}else{if(args.mode==="none"){elem[mode]();done()}else{effectMethod.call(elem[0],args,
cleanup)}}}return queue===false?this.each(prefilter).each(run):this.queue(queueName,prefilter
).queue(queueName,run)},show:function(orig){return function(option){if(standardAnimationOption(
option)){return orig.apply(this,arguments)}else{var args=_normalizeArguments.apply(this,arguments);
args.mode="show";return this.effect.call(this,args)}}}($.fn.show),hide:function(orig){
return function(option){if(standardAnimationOption(option)){return orig.apply(this,arguments)}else{
var args=_normalizeArguments.apply(this,arguments);args.mode="hide";return this.effect.call(this,
args)}}}($.fn.hide),toggle:function(orig){return function(option){if(standardAnimationOption(option
)||typeof option==="boolean"){return orig.apply(this,arguments)}else{
var args=_normalizeArguments.apply(this,arguments);args.mode="toggle";return this.effect.call(this,
args)}}}($.fn.toggle),cssUnit:function(key){var style=this.css(key),val=[];$.each(["em","px","%",
"pt"],function(i,unit){if(style.indexOf(unit)>0){val=[parseFloat(style),unit]}});return val},
cssClip:function(clipObj){if(clipObj){return this.css("clip",
"rect("+clipObj.top+"px "+clipObj.right+"px "+clipObj.bottom+"px "+clipObj.left+"px)")}
return parseClip(this.css("clip"),this)},transfer:function(options,done){var element=$(this),
target=$(options.to),targetFixed=target.css("position")==="fixed",body=$("body"),
fixTop=targetFixed?body.scrollTop():0,fixLeft=targetFixed?body.scrollLeft():0,
endPosition=target.offset(),animation={top:endPosition.top-fixTop,left:endPosition.left-fixLeft,
height:target.innerHeight(),width:target.innerWidth()},startPosition=element.offset(),transfer=$(
"<div class='ui-effects-transfer'></div>");transfer.appendTo("body").addClass(options.className
).css({top:startPosition.top-fixTop,left:startPosition.left-fixLeft,height:element.innerHeight(),
width:element.innerWidth(),position:targetFixed?"fixed":"absolute"}).animate(animation,
options.duration,options.easing,function(){transfer.remove();if(typeof done==="function"){done()}})}
});function parseClip(str,element){var outerWidth=element.outerWidth(),
outerHeight=element.outerHeight(),
clipRegex=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/
,values=clipRegex.exec(str)||["",0,outerWidth,outerHeight,0];return{top:parseFloat(values[1])||0,
right:values[2]==="auto"?outerWidth:parseFloat(values[2]),bottom:values[3
]==="auto"?outerHeight:parseFloat(values[3]),left:parseFloat(values[4])||0}}$.fx.step.clip=function(
fx){if(!fx.clipInit){fx.start=$(fx.elem).cssClip();if(typeof fx.end==="string"){fx.end=parseClip(
fx.end,fx.elem)}fx.clipInit=true}$(fx.elem).cssClip({top:fx.pos*(fx.end.top-fx.start.top
)+fx.start.top,right:fx.pos*(fx.end.right-fx.start.right)+fx.start.right,bottom:fx.pos*(
fx.end.bottom-fx.start.bottom)+fx.start.bottom,left:fx.pos*(fx.end.left-fx.start.left)+fx.start.left
})}})();(function(){var baseEasings={};$.each(["Quad","Cubic","Quart","Quint","Expo"],function(i,
name){baseEasings[name]=function(p){return Math.pow(p,i+2)}});$.extend(baseEasings,{Sine:function(p
){return 1-Math.cos(p*Math.PI/2)},Circ:function(p){return 1-Math.sqrt(1-p*p)},Elastic:function(p){
return p===0||p===1?p:-Math.pow(2,8*(p-1))*Math.sin(((p-1)*80-7.5)*Math.PI/15)},Back:function(p){
return p*p*(3*p-2)},Bounce:function(p){var pow2,bounce=4;while(p<((pow2=Math.pow(2,--bounce))-1)/11
){}return 1/Math.pow(4,3-bounce)-7.5625*Math.pow((pow2*3-2)/22-p,2)}});$.each(baseEasings,function(
name,easeIn){$.easing["easeIn"+name]=easeIn;$.easing["easeOut"+name]=function(p){return 1-easeIn(1-p
)};$.easing["easeInOut"+name]=function(p){return p<.5?easeIn(p*2)/2:1-easeIn(p*-2+2)/2}})})();
var effect=$.effects;var effectsEffectBlind=$.effects.define("blind","hide",function(options,done){
var map={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],
horizontal:["right","left"],right:["left","right"]},element=$(this),
direction=options.direction||"up",start=element.cssClip(),animate={clip:$.extend({},start)},
placeholder=$.effects.createPlaceholder(element);animate.clip[map[direction][0]]=animate.clip[map[
direction][1]];if(options.mode==="show"){element.cssClip(animate.clip);if(placeholder){
placeholder.css($.effects.clipToBox(animate))}animate.clip=start}if(placeholder){
placeholder.animate($.effects.clipToBox(animate),options.duration,options.easing)}element.animate(
animate,{queue:false,duration:options.duration,easing:options.easing,complete:done})});
var effectsEffectBounce=$.effects.define("bounce",function(options,done){var upAnim,downAnim,
refValue,element=$(this),mode=options.mode,hide=mode==="hide",show=mode==="show",
direction=options.direction||"up",distance=options.distance,times=options.times||5,anims=times*2+(
show||hide?1:0),speed=options.duration/anims,easing=options.easing,
ref=direction==="up"||direction==="down"?"top":"left",motion=direction==="up"||direction==="left",
i=0,queuelen=element.queue().length;$.effects.createPlaceholder(element);refValue=element.css(ref);
if(!distance){distance=element[ref==="top"?"outerHeight":"outerWidth"]()/3}if(show){downAnim={
opacity:1};downAnim[ref]=refValue;element.css("opacity",0).css(ref,motion?-distance*2:distance*2
).animate(downAnim,speed,easing)}if(hide){distance=distance/Math.pow(2,times-1)}downAnim={};
downAnim[ref]=refValue;for(;i<times;i++){upAnim={};upAnim[ref]=(motion?"-=":"+=")+distance;
element.animate(upAnim,speed,easing).animate(downAnim,speed,easing);
distance=hide?distance*2:distance/2}if(hide){upAnim={opacity:0};upAnim[ref]=(motion?"-=":"+="
)+distance;element.animate(upAnim,speed,easing)}element.queue(done);$.effects.unshift(element,
queuelen,anims+1)});var effectsEffectClip=$.effects.define("clip","hide",function(options,done){
var start,animate={},element=$(this),direction=options.direction||"vertical",both=direction==="both"
,horizontal=both||direction==="horizontal",vertical=both||direction==="vertical";
start=element.cssClip();animate.clip={top:vertical?(start.bottom-start.top)/2:start.top,
right:horizontal?(start.right-start.left)/2:start.right,bottom:vertical?(start.bottom-start.top
)/2:start.bottom,left:horizontal?(start.right-start.left)/2:start.left};$.effects.createPlaceholder(
element);if(options.mode==="show"){element.cssClip(animate.clip);animate.clip=start}element.animate(
animate,{queue:false,duration:options.duration,easing:options.easing,complete:done})});
var effectsEffectDrop=$.effects.define("drop","hide",function(options,done){var distance,element=$(
this),mode=options.mode,show=mode==="show",direction=options.direction||"left",
ref=direction==="up"||direction==="down"?"top":"left",
motion=direction==="up"||direction==="left"?"-=":"+=",oppositeMotion=motion==="+="?"-=":"+=",
animation={opacity:0};$.effects.createPlaceholder(element);distance=options.distance||element[
ref==="top"?"outerHeight":"outerWidth"](true)/2;animation[ref]=motion+distance;if(show){element.css(
animation);animation[ref]=oppositeMotion+distance;animation.opacity=1}element.animate(animation,{
queue:false,duration:options.duration,easing:options.easing,complete:done})});
var effectsEffectExplode=$.effects.define("explode","hide",function(options,done){var i,j,left,top,
mx,my,rows=options.pieces?Math.round(Math.sqrt(options.pieces)):3,cells=rows,element=$(this),
mode=options.mode,show=mode==="show",offset=element.show().css("visibility","hidden").offset(),
width=Math.ceil(element.outerWidth()/cells),height=Math.ceil(element.outerHeight()/rows),pieces=[];
function childComplete(){pieces.push(this);if(pieces.length===rows*cells){animComplete()}}for(
i=0;i<rows;i++){top=offset.top+i*height;my=i-(rows-1)/2;for(j=0;j<cells;j++){
left=offset.left+j*width;mx=j-(cells-1)/2;element.clone().appendTo("body").wrap("<div></div>").css({
position:"absolute",visibility:"visible",left:-j*width,top:-i*height}).parent().addClass(
"ui-effects-explode").css({position:"absolute",overflow:"hidden",width:width,height:height,
left:left+(show?mx*width:0),top:top+(show?my*height:0),opacity:show?0:1}).animate({left:left+(
show?0:mx*width),top:top+(show?0:my*height),opacity:show?1:0},options.duration||500,options.easing,
childComplete)}}function animComplete(){element.css({visibility:"visible"});$(pieces).remove();done(
)}});var effectsEffectFade=$.effects.define("fade","toggle",function(options,done){
var show=options.mode==="show";$(this).css("opacity",show?0:1).animate({opacity:show?1:0},{
queue:false,duration:options.duration,easing:options.easing,complete:done})});
var effectsEffectFold=$.effects.define("fold","hide",function(options,done){var element=$(this),
mode=options.mode,show=mode==="show",hide=mode==="hide",size=options.size||15,
percent=/([0-9]+)%/.exec(size),horizFirst=!!options.horizFirst,ref=horizFirst?["right","bottom"]:[
"bottom","right"],duration=options.duration/2,placeholder=$.effects.createPlaceholder(element),
start=element.cssClip(),animation1={clip:$.extend({},start)},animation2={clip:$.extend({},start)},
distance=[start[ref[0]],start[ref[1]]],queuelen=element.queue().length;if(percent){size=parseInt(
percent[1],10)/100*distance[hide?0:1]}animation1.clip[ref[0]]=size;animation2.clip[ref[0]]=size;
animation2.clip[ref[1]]=0;if(show){element.cssClip(animation2.clip);if(placeholder){placeholder.css(
$.effects.clipToBox(animation2))}animation2.clip=start}element.queue(function(next){if(placeholder){
placeholder.animate($.effects.clipToBox(animation1),duration,options.easing).animate(
$.effects.clipToBox(animation2),duration,options.easing)}next()}).animate(animation1,duration,
options.easing).animate(animation2,duration,options.easing).queue(done);$.effects.unshift(element,
queuelen,4)});var effectsEffectHighlight=$.effects.define("highlight","show",function(options,done){
var element=$(this),animation={backgroundColor:element.css("backgroundColor")};if(
options.mode==="hide"){animation.opacity=0}$.effects.saveStyle(element);element.css({
backgroundImage:"none",backgroundColor:options.color||"#ffff99"}).animate(animation,{queue:false,
duration:options.duration,easing:options.easing,complete:done})});
var effectsEffectSize=$.effects.define("size",function(options,done){var baseline,factor,temp,
element=$(this),cProps=["fontSize"],vProps=["borderTopWidth","borderBottomWidth","paddingTop",
"paddingBottom"],hProps=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],
mode=options.mode,restore=mode!=="effect",scale=options.scale||"both",origin=options.origin||[
"middle","center"],position=element.css("position"),pos=element.position(),
original=$.effects.scaledDimensions(element),from=options.from||original,
to=options.to||$.effects.scaledDimensions(element,0);$.effects.createPlaceholder(element);if(
mode==="show"){temp=from;from=to;to=temp}factor={from:{y:from.height/original.height,
x:from.width/original.width},to:{y:to.height/original.height,x:to.width/original.width}};if(
scale==="box"||scale==="both"){if(factor.from.y!==factor.to.y){from=$.effects.setTransition(element,
vProps,factor.from.y,from);to=$.effects.setTransition(element,vProps,factor.to.y,to)}if(
factor.from.x!==factor.to.x){from=$.effects.setTransition(element,hProps,factor.from.x,from);
to=$.effects.setTransition(element,hProps,factor.to.x,to)}}if(scale==="content"||scale==="both"){if(
factor.from.y!==factor.to.y){from=$.effects.setTransition(element,cProps,factor.from.y,from);
to=$.effects.setTransition(element,cProps,factor.to.y,to)}}if(origin){
baseline=$.effects.getBaseline(origin,original);from.top=(original.outerHeight-from.outerHeight
)*baseline.y+pos.top;from.left=(original.outerWidth-from.outerWidth)*baseline.x+pos.left;to.top=(
original.outerHeight-to.outerHeight)*baseline.y+pos.top;to.left=(original.outerWidth-to.outerWidth
)*baseline.x+pos.left}delete from.outerHeight;delete from.outerWidth;element.css(from);if(
scale==="content"||scale==="both"){vProps=vProps.concat(["marginTop","marginBottom"]).concat(cProps)
hProps=hProps.concat(["marginLeft","marginRight"]);element.find("*[width]").each(function(){
var child=$(this),childOriginal=$.effects.scaledDimensions(child),childFrom={
height:childOriginal.height*factor.from.y,width:childOriginal.width*factor.from.x,
outerHeight:childOriginal.outerHeight*factor.from.y,
outerWidth:childOriginal.outerWidth*factor.from.x},childTo={height:childOriginal.height*factor.to.y,
width:childOriginal.width*factor.to.x,outerHeight:childOriginal.height*factor.to.y,
outerWidth:childOriginal.width*factor.to.x};if(factor.from.y!==factor.to.y){
childFrom=$.effects.setTransition(child,vProps,factor.from.y,childFrom);
childTo=$.effects.setTransition(child,vProps,factor.to.y,childTo)}if(factor.from.x!==factor.to.x){
childFrom=$.effects.setTransition(child,hProps,factor.from.x,childFrom);
childTo=$.effects.setTransition(child,hProps,factor.to.x,childTo)}if(restore){$.effects.saveStyle(
child)}child.css(childFrom);child.animate(childTo,options.duration,options.easing,function(){if(
restore){$.effects.restoreStyle(child)}})})}element.animate(to,{queue:false,
duration:options.duration,easing:options.easing,complete:function(){var offset=element.offset();if(
to.opacity===0){element.css("opacity",from.opacity)}if(!restore){element.css("position",
position==="static"?"relative":position).offset(offset);$.effects.saveStyle(element)}done()}})});
var effectsEffectScale=$.effects.define("scale",function(options,done){var el=$(this),
mode=options.mode,percent=parseInt(options.percent,10)||(parseInt(options.percent,10
)===0?0:mode!=="effect"?0:100),newOptions=$.extend(true,{from:$.effects.scaledDimensions(el),
to:$.effects.scaledDimensions(el,percent,options.direction||"both"),origin:options.origin||["middle"
,"center"]},options);if(options.fade){newOptions.from.opacity=1;newOptions.to.opacity=0}
$.effects.effect.size.call(this,newOptions,done)});var effectsEffectPuff=$.effects.define("puff",
"hide",function(options,done){var newOptions=$.extend(true,{},options,{fade:true,percent:parseInt(
options.percent,10)||150});$.effects.effect.scale.call(this,newOptions,done)});
var effectsEffectPulsate=$.effects.define("pulsate","show",function(options,done){var element=$(this
),mode=options.mode,show=mode==="show",hide=mode==="hide",showhide=show||hide,anims=(
options.times||5)*2+(showhide?1:0),duration=options.duration/anims,animateTo=0,i=1,
queuelen=element.queue().length;if(show||!element.is(":visible")){element.css("opacity",0).show();
animateTo=1}for(;i<anims;i++){element.animate({opacity:animateTo},duration,options.easing);
animateTo=1-animateTo}element.animate({opacity:animateTo},duration,options.easing);element.queue(
done);$.effects.unshift(element,queuelen,anims+1)});var effectsEffectShake=$.effects.define("shake",
function(options,done){var i=1,element=$(this),direction=options.direction||"left",
distance=options.distance||20,times=options.times||3,anims=times*2+1,speed=Math.round(
options.duration/anims),ref=direction==="up"||direction==="down"?"top":"left",
positiveMotion=direction==="up"||direction==="left",animation={},animation1={},animation2={},
queuelen=element.queue().length;$.effects.createPlaceholder(element);animation[ref]=(
positiveMotion?"-=":"+=")+distance;animation1[ref]=(positiveMotion?"+=":"-=")+distance*2;animation2[
ref]=(positiveMotion?"-=":"+=")+distance*2;element.animate(animation,speed,options.easing);for(
;i<times;i++){element.animate(animation1,speed,options.easing).animate(animation2,speed,
options.easing)}element.animate(animation1,speed,options.easing).animate(animation,speed/2,
options.easing).queue(done);$.effects.unshift(element,queuelen,anims+1)});
var effectsEffectSlide=$.effects.define("slide","show",function(options,done){var startClip,startRef
,element=$(this),map={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left",
"right"]},mode=options.mode,direction=options.direction||"left",
ref=direction==="up"||direction==="down"?"top":"left",
positiveMotion=direction==="up"||direction==="left",distance=options.distance||element[
ref==="top"?"outerHeight":"outerWidth"](true),animation={};$.effects.createPlaceholder(element);
startClip=element.cssClip();startRef=element.position()[ref];animation[ref]=(positiveMotion?-1:1
)*distance+startRef;animation.clip=element.cssClip();animation.clip[map[direction][1]
]=animation.clip[map[direction][0]];if(mode==="show"){element.cssClip(animation.clip);element.css(
ref,animation[ref]);animation.clip=startClip;animation[ref]=startRef}element.animate(animation,{
queue:false,duration:options.duration,easing:options.easing,complete:done})});var effect;if(
$.uiBackCompat!==false){effect=$.effects.define("transfer",function(options,done){$(this).transfer(
options,done)})}var effectsEffectTransfer=effect;$.ui.focusable=function(element,hasTabindex){
var map,mapName,img,focusableIfVisible,fieldset,nodeName=element.nodeName.toLowerCase();if(
"area"===nodeName){map=element.parentNode;mapName=map.name;if(
!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false}img=$(
"img[usemap='#"+mapName+"']");return img.length>0&&img.is(":visible")}if(
/^(input|select|textarea|button|object)$/.test(nodeName)){focusableIfVisible=!element.disabled;if(
focusableIfVisible){fieldset=$(element).closest("fieldset")[0];if(fieldset){
focusableIfVisible=!fieldset.disabled}}}else if("a"===nodeName){
focusableIfVisible=element.href||hasTabindex}else{focusableIfVisible=hasTabindex}
return focusableIfVisible&&$(element).is(":visible")&&visible($(element))};function visible(element
){var visibility=element.css("visibility");while(visibility==="inherit"){element=element.parent();
visibility=element.css("visibility")}return visibility==="visible"}$.extend($.expr.pseudos,{
focusable:function(element){return $.ui.focusable(element,$.attr(element,"tabindex")!=null)}});
var focusable=$.ui.focusable;var form=$.fn._form=function(){return typeof this[0
].form==="string"?this.closest("form"):$(this[0].form)};var formResetMixin=$.ui.formResetMixin={
_formResetHandler:function(){var form=$(this);setTimeout(function(){var instances=form.data(
"ui-form-reset-instances");$.each(instances,function(){this.refresh()})})},
_bindFormResetHandler:function(){this.form=this.element._form();if(!this.form.length){return}
var instances=this.form.data("ui-form-reset-instances")||[];if(!instances.length){this.form.on(
"reset.ui-form-reset",this._formResetHandler)}instances.push(this);this.form.data(
"ui-form-reset-instances",instances)},_unbindFormResetHandler:function(){if(!this.form.length){
return}var instances=this.form.data("ui-form-reset-instances");instances.splice($.inArray(this,
instances),1);if(instances.length){this.form.data("ui-form-reset-instances",instances)}else{
this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}};if(!$.expr.pseudos){
$.expr.pseudos=$.expr[":"]}if(!$.uniqueSort){$.uniqueSort=$.unique}if(!$.escapeSelector){
var rcssescape=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;var fcssescape=function(ch,asCodePoint
){if(asCodePoint){if(ch==="\0"){return"�"}return ch.slice(0,-1)+"\\"+ch.charCodeAt(ch.length-1
).toString(16)+" "}return"\\"+ch};$.escapeSelector=function(sel){return(sel+"").replace(rcssescape,
fcssescape)}}if(!$.fn.even||!$.fn.odd){$.fn.extend({even:function(){return this.filter(function(i){
return i%2===0})},odd:function(){return this.filter(function(i){return i%2===1})}})}
var keycode=$.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,
LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38};
var labels=$.fn.labels=function(){var ancestor,selector,id,labels,ancestors;if(!this.length){
return this.pushStack([])}if(this[0].labels&&this[0].labels.length){return this.pushStack(this[0
].labels)}labels=this.eq(0).parents("label");id=this.attr("id");if(id){ancestor=this.eq(0).parents(
).last();ancestors=ancestor.add(ancestor.length?ancestor.siblings():this.siblings());
selector="label[for='"+$.escapeSelector(id)+"']";labels=labels.add(ancestors.find(selector).addBack(
selector))}return this.pushStack(labels)};var scrollParent=$.fn.scrollParent=function(includeHidden
){var position=this.css("position"),excludeStaticParent=position==="absolute",
overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents(
).filter(function(){var parent=$(this);if(excludeStaticParent&&parent.css("position")==="static"){
return false}return overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css(
"overflow-x"))}).eq(0);return position==="fixed"||!scrollParent.length?$(this[0
].ownerDocument||document):scrollParent};var tabbable=$.extend($.expr.pseudos,{tabbable:function(
element){var tabIndex=$.attr(element,"tabindex"),hasTabindex=tabIndex!=null;return(
!hasTabindex||tabIndex>=0)&&$.ui.focusable(element,hasTabindex)}});var uniqueId=$.fn.extend({
uniqueId:function(){var uuid=0;return function(){return this.each(function(){if(!this.id){
this.id="ui-id-"+ ++uuid}})}}(),removeUniqueId:function(){return this.each(function(){if(
/^ui-id-\d+$/.test(this.id)){$(this).removeAttr("id")}})}});var widgetsAccordion=$.widget(
"ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{
"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all",
"ui-accordion-content":"ui-corner-bottom"},collapsible:false,event:"click",header:function(elem){
return elem.find("> li > :first-child").add(elem.find("> :not(li)").even())},heightStyle:"auto",
icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,
beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",
paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",
paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var options=this.options;
this.prevShow=this.prevHide=$();this._addClass("ui-accordion","ui-widget ui-helper-reset");
this.element.attr("role","tablist");if(!options.collapsible&&(
options.active===false||options.active==null)){options.active=0}this._processPanels();if(
options.active<0){options.active+=this.headers.length}this._refresh()},_getCreateEventData:function(
){return{header:this.active,panel:!this.active.length?$():this.active.next()}},
_createIcons:function(){var icon,children,icons=this.options.icons;if(icons){icon=$("<span>");
this._addClass(icon,"ui-accordion-header-icon","ui-icon "+icons.header);icon.prependTo(this.headers)
children=this.active.children(".ui-accordion-header-icon");this._removeClass(children,icons.header
)._addClass(children,null,icons.activeHeader)._addClass(this.headers,"ui-accordion-icons")}},
_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons");this.headers.children(
".ui-accordion-header-icon").remove()},_destroy:function(){var contents;this.element.removeAttr(
"role");this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex"
).removeUniqueId();this._destroyIcons();contents=this.headers.next().css("display","").removeAttr(
"role aria-hidden aria-labelledby").removeUniqueId();if(this.options.heightStyle!=="content"){
contents.css("height","")}},_setOption:function(key,value){if(key==="active"){this._activate(value);
return}if(key==="event"){if(this.options.event){this._off(this.headers,this.options.event)}
this._setupEvents(value)}this._super(key,value);if(
key==="collapsible"&&!value&&this.options.active===false){this._activate(0)}if(key==="icons"){
this._destroyIcons();if(value){this._createIcons()}}},_setOptionDisabled:function(value){
this._super(value);this.element.attr("aria-disabled",value);this._toggleClass(null,
"ui-state-disabled",!!value);this._toggleClass(this.headers.add(this.headers.next()),null,
"ui-state-disabled",!!value)},_keydown:function(event){if(event.altKey||event.ctrlKey){return}
var keyCode=$.ui.keyCode,length=this.headers.length,currentIndex=this.headers.index(event.target),
toFocus=false;switch(event.keyCode){case keyCode.RIGHT:case keyCode.DOWN:toFocus=this.headers[(
currentIndex+1)%length];break;case keyCode.LEFT:case keyCode.UP:toFocus=this.headers[(
currentIndex-1+length)%length];break;case keyCode.SPACE:case keyCode.ENTER:this._eventHandler(event)
break;case keyCode.HOME:toFocus=this.headers[0];break;case keyCode.END:toFocus=this.headers[length-1
];break}if(toFocus){$(event.target).attr("tabIndex",-1);$(toFocus).attr("tabIndex",0);$(toFocus
).trigger("focus");event.preventDefault()}},_panelKeyDown:function(event){if(
event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){$(event.currentTarget).prev().trigger("focus")}},
refresh:function(){var options=this.options;this._processPanels();if(
options.active===false&&options.collapsible===true||!this.headers.length){options.active=false;
this.active=$()}else if(options.active===false){this._activate(0)}else if(
this.active.length&&!$.contains(this.element[0],this.active[0])){if(
this.headers.length===this.headers.find(".ui-state-disabled").length){options.active=false;
this.active=$()}else{this._activate(Math.max(0,options.active-1))}}else{
options.active=this.headers.index(this.active)}this._destroyIcons();this._refresh()},
_processPanels:function(){var prevHeaders=this.headers,prevPanels=this.panels;if(
typeof this.options.header==="function"){this.headers=this.options.header(this.element)}else{
this.headers=this.element.find(this.options.header)}this._addClass(this.headers,
"ui-accordion-header ui-accordion-header-collapsed","ui-state-default");
this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide();this._addClass(
this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content");if(prevPanels){this._off(
prevHeaders.not(this.headers));this._off(prevPanels.not(this.panels))}},_refresh:function(){
var maxHeight,options=this.options,heightStyle=options.heightStyle,parent=this.element.parent();
this.active=this._findActive(options.active);this._addClass(this.active,"ui-accordion-header-active"
,"ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed");this._addClass(
this.active.next(),"ui-accordion-content-active");this.active.next().show();this.headers.attr("role"
,"tab").each(function(){var header=$(this),headerId=header.uniqueId().attr("id"),panel=header.next()
,panelId=panel.uniqueId().attr("id");header.attr("aria-controls",panelId);panel.attr(
"aria-labelledby",headerId)}).next().attr("role","tabpanel");this.headers.not(this.active).attr({
"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}
).hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex",0)}else{this.active.attr({
"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"})}
this._createIcons();this._setupEvents(options.event);if(heightStyle==="fill"){
maxHeight=parent.height();this.element.siblings(":visible").each(function(){var elem=$(this),
position=elem.css("position");if(position==="absolute"||position==="fixed"){return}
maxHeight-=elem.outerHeight(true)});this.headers.each(function(){maxHeight-=$(this).outerHeight(true
)});this.headers.next().each(function(){$(this).height(Math.max(0,maxHeight-$(this).innerHeight()+$(
this).height()))}).css("overflow","auto")}else if(heightStyle==="auto"){maxHeight=0;
this.headers.next().each(function(){var isVisible=$(this).is(":visible");if(!isVisible){$(this
).show()}maxHeight=Math.max(maxHeight,$(this).css("height","").height());if(!isVisible){$(this
).hide()}}).height(maxHeight)}},_activate:function(index){var active=this._findActive(index)[0];if(
active===this.active[0]){return}active=active||this.active[0];this._eventHandler({target:active,
currentTarget:active,preventDefault:$.noop})},_findActive:function(selector){
return typeof selector==="number"?this.headers.eq(selector):$()},_setupEvents:function(event){
var events={keydown:"_keydown"};if(event){$.each(event.split(" "),function(index,eventName){events[
eventName]="_eventHandler"})}this._off(this.headers.add(this.headers.next()));this._on(this.headers,
events);this._on(this.headers.next(),{keydown:"_panelKeyDown"});this._hoverable(this.headers);
this._focusable(this.headers)},_eventHandler:function(event){var activeChildren,clickedChildren,
options=this.options,active=this.active,clicked=$(event.currentTarget),clickedIsActive=clicked[0
]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():clicked.next(),
toHide=active.next(),eventData={oldHeader:active,oldPanel:toHide,newHeader:collapsing?$():clicked,
newPanel:toShow};event.preventDefault();if(clickedIsActive&&!options.collapsible||this._trigger(
"beforeActivate",event,eventData)===false){return}
options.active=collapsing?false:this.headers.index(clicked);this.active=clickedIsActive?$():clicked;
this._toggle(eventData);this._removeClass(active,"ui-accordion-header-active","ui-state-active");if(
options.icons){activeChildren=active.children(".ui-accordion-header-icon");this._removeClass(
activeChildren,null,options.icons.activeHeader)._addClass(activeChildren,null,options.icons.header)}
if(!clickedIsActive){this._removeClass(clicked,"ui-accordion-header-collapsed")._addClass(clicked,
"ui-accordion-header-active","ui-state-active");if(options.icons){clickedChildren=clicked.children(
".ui-accordion-header-icon");this._removeClass(clickedChildren,null,options.icons.header)._addClass(
clickedChildren,null,options.icons.activeHeader)}this._addClass(clicked.next(),
"ui-accordion-content-active")}},_toggle:function(data){var toShow=data.newPanel,
toHide=this.prevShow.length?this.prevShow:data.oldPanel;this.prevShow.add(this.prevHide).stop(true,
true);this.prevShow=toShow;this.prevHide=toHide;if(this.options.animate){this._animate(toShow,toHide
,data)}else{toHide.hide();toShow.show();this._toggleComplete(data)}toHide.attr({"aria-hidden":"true"
});toHide.prev().attr({"aria-selected":"false","aria-expanded":"false"});if(
toShow.length&&toHide.length){toHide.prev().attr({tabIndex:-1,"aria-expanded":"false"})}else if(
toShow.length){this.headers.filter(function(){return parseInt($(this).attr("tabIndex"),10)===0}
).attr("tabIndex",-1)}toShow.attr("aria-hidden","false").prev().attr({"aria-selected":"true",
"aria-expanded":"true",tabIndex:0})},_animate:function(toShow,toHide,data){var total,easing,duration
,that=this,adjust=0,boxSizing=toShow.css("box-sizing"),down=toShow.length&&(
!toHide.length||toShow.index()<toHide.index()),animate=this.options.animate||{},
options=down&&animate.down||animate,complete=function(){that._toggleComplete(data)};if(
typeof options==="number"){duration=options}if(typeof options==="string"){easing=options}
easing=easing||options.easing||animate.easing;duration=duration||options.duration||animate.duration;
if(!toHide.length){return toShow.animate(this.showProps,duration,easing,complete)}if(!toShow.length
){return toHide.animate(this.hideProps,duration,easing,complete)}total=toShow.show().outerHeight();
toHide.animate(this.hideProps,{duration:duration,easing:easing,step:function(now,fx){
fx.now=Math.round(now)}});toShow.hide().animate(this.showProps,{duration:duration,easing:easing,
complete:complete,step:function(now,fx){fx.now=Math.round(now);if(fx.prop!=="height"){if(
boxSizing==="content-box"){adjust+=fx.now}}else if(that.options.heightStyle!=="content"){
fx.now=Math.round(total-toHide.outerHeight()-adjust);adjust=0}}})},_toggleComplete:function(data){
var toHide=data.oldPanel,prev=toHide.prev();this._removeClass(toHide,"ui-accordion-content-active");
this._removeClass(prev,"ui-accordion-header-active")._addClass(prev,"ui-accordion-header-collapsed")
if(toHide.length){toHide.parent()[0].className=toHide.parent()[0].className}this._trigger("activate"
,null,data)}});var safeActiveElement=$.ui.safeActiveElement=function(document){var activeElement;
try{activeElement=document.activeElement}catch(error){activeElement=document.body}if(!activeElement
){activeElement=document.body}if(!activeElement.nodeName){activeElement=document.body}
return activeElement};var widgetsMenu=$.widget("ui.menu",{version:"1.13.2",defaultElement:"<ul>",
delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{
my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){
this.activeMenu=this.element;this.mouseHandled=false;this.lastMousePosition={x:null,y:null};
this.element.uniqueId().attr({role:this.options.role,tabIndex:0});this._addClass("ui-menu",
"ui-widget ui-widget-content");this._on({"mousedown .ui-menu-item":function(event){
event.preventDefault();this._activateItem(event)},"click .ui-menu-item":function(event){
var target=$(event.target);var active=$($.ui.safeActiveElement(this.document[0]));if(
!this.mouseHandled&&target.not(".ui-state-disabled").length){this.select(event);if(
!event.isPropagationStopped()){this.mouseHandled=true}if(target.has(".ui-menu").length){this.expand(
event)}else if(!this.element.is(":focus")&&active.closest(".ui-menu").length){this.element.trigger(
"focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer)
}}}},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",
mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){
var item=this.active||this._menuItems().first();if(!keepActiveItem){this.focus(event,item)}},
blur:function(event){this._delay(function(){var notContained=!$.contains(this.element[0],
$.ui.safeActiveElement(this.document[0]));if(notContained){this.collapseAll(event)}})},
keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(event){if(
this._closeOnDocumentClick(event)){this.collapseAll(event,true)}this.mouseHandled=false}})},
_activateItem:function(event){if(this.previousFilter){return}if(
event.clientX===this.lastMousePosition.x&&event.clientY===this.lastMousePosition.y){return}
this.lastMousePosition={x:event.clientX,y:event.clientY};var actualTarget=$(event.target).closest(
".ui-menu-item"),target=$(event.currentTarget);if(actualTarget[0]!==target[0]){return}if(target.is(
".ui-state-active")){return}this._removeClass(target.siblings().children(".ui-state-active"),null,
"ui-state-active");this.focus(event,target)},_destroy:function(){var items=this.element.find(
".ui-menu-item").removeAttr("role aria-disabled"),submenus=items.children(".ui-menu-item-wrapper"
).removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr(
"aria-activedescendant").find(".ui-menu").addBack().removeAttr(
"role aria-labelledby aria-expanded aria-hidden aria-disabled "+"tabIndex").removeUniqueId().show();
submenus.children().each(function(){var elem=$(this);if(elem.data("ui-menu-submenu-caret")){
elem.remove()}})},_keydown:function(event){var match,prev,character,skip,preventDefault=true;switch(
event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:
this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;
case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event
);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);
break;case $.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(
event)}break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;
case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=false;
prev=this.previousFilter||"";skip=false;character=event.keyCode>=96&&event.keyCode<=105?(
event.keyCode-96).toString():String.fromCharCode(event.keyCode);clearTimeout(this.filterTimer);if(
character===prev){skip=true}else{character=prev+character}match=this._filterMenuItems(character);
match=skip&&match.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):match;if(
!match.length){character=String.fromCharCode(event.keyCode);match=this._filterMenuItems(character)}
if(match.length){this.focus(event,match);this.previousFilter=character;this.filterTimer=this._delay(
function(){delete this.previousFilter},1e3)}else{delete this.previousFilter}}if(preventDefault){
event.preventDefault()}},_activate:function(event){if(this.active&&!this.active.is(
".ui-state-disabled")){if(this.active.children("[aria-haspopup='true']").length){this.expand(event)
}else{this.select(event)}}},refresh:function(){var menus,items,newSubmenus,newItems,newWrappers,
that=this,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);
this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length);
newSubmenus=submenus.filter(":not(.ui-menu)").hide().attr({role:this.options.role,
"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.prev(),
submenuCaret=$("<span>").data("ui-menu-submenu-caret",true);that._addClass(submenuCaret,
"ui-menu-icon","ui-icon "+icon);item.attr("aria-haspopup","true").prepend(submenuCaret);menu.attr(
"aria-labelledby",item.attr("id"))});this._addClass(newSubmenus,"ui-menu",
"ui-widget ui-widget-content ui-front");menus=submenus.add(this.element);items=menus.find(
this.options.items);items.not(".ui-menu-item").each(function(){var item=$(this);if(that._isDivider(
item)){that._addClass(item,"ui-menu-divider","ui-widget-content")}});newItems=items.not(
".ui-menu-item, .ui-menu-divider");newWrappers=newItems.children().not(".ui-menu").uniqueId().attr({
tabIndex:-1,role:this._itemRole()});this._addClass(newItems,"ui-menu-item")._addClass(newWrappers,
"ui-menu-item-wrapper");items.filter(".ui-state-disabled").attr("aria-disabled","true");if(
this.active&&!$.contains(this.element[0],this.active[0])){this.blur()}},_itemRole:function(){return{
menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(key,value){if(
key==="icons"){var icons=this.element.find(".ui-menu-icon");this._removeClass(icons,null,
this.options.icons.submenu)._addClass(icons,null,value.submenu)}this._super(key,value)},
_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",String(value
));this._toggleClass(null,"ui-state-disabled",!!value)},focus:function(event,item){var nested,
focused,activeParent;this.blur(event,event&&event.type==="focus");this._scrollIntoView(item);
this.active=item.first();focused=this.active.children(".ui-menu-item-wrapper");this._addClass(
focused,null,"ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",
focused.attr("id"))}activeParent=this.active.parent().closest(".ui-menu-item").children(
".ui-menu-item-wrapper");this._addClass(activeParent,null,"ui-state-active");if(
event&&event.type==="keydown"){this._close()}else{this.timer=this._delay(function(){this._close()},
this.delay)}nested=item.children(".ui-menu");if(nested.length&&event&&/^mouse/.test(event.type)){
this._startOpening(nested)}this.activeMenu=item.parent();this._trigger("focus",event,{item:item})},
_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;if(
this._hasScroll()){borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0;
paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0;offset=item.offset(
).top-this.activeMenu.offset().top-borderTop-paddingTop;scroll=this.activeMenu.scrollTop();
elementHeight=this.activeMenu.height();itemHeight=item.outerHeight();if(offset<0){
this.activeMenu.scrollTop(scroll+offset)}else if(offset+itemHeight>elementHeight){
this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight)}}},blur:function(event,fromFocus){
if(!fromFocus){clearTimeout(this.timer)}if(!this.active){return}this._removeClass(
this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active");this._trigger("blur",event,{
item:this.active});this.active=null},_startOpening:function(submenu){clearTimeout(this.timer);if(
submenu.attr("aria-hidden")!=="true"){return}this.timer=this._delay(function(){this._close();
this._open(submenu)},this.delay)},_open:function(submenu){var position=$.extend({of:this.active},
this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(submenu.parents(
".ui-menu")).hide().attr("aria-hidden","true");submenu.show().removeAttr("aria-hidden").attr(
"aria-expanded","true").position(position)},collapseAll:function(event,all){clearTimeout(this.timer)
this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(
this.element.find(".ui-menu"));if(!currentMenu.length){currentMenu=this.element}this._close(
currentMenu);this.blur(event);this._removeClass(currentMenu.find(".ui-state-active"),null,
"ui-state-active");this.activeMenu=currentMenu},all?0:this.delay)},_close:function(startMenu){if(
!startMenu){startMenu=this.active?this.active.parent():this.element}startMenu.find(".ui-menu").hide(
).attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(event){
return!$(event.target).closest(".ui-menu").length},_isDivider:function(item){
return!/[^\-\u2014\u2013\s]/.test(item.text())},collapse:function(event){
var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(
newItem&&newItem.length){this._close();this.focus(event,newItem)}},expand:function(event){
var newItem=this.active&&this._menuItems(this.active.children(".ui-menu")).first();if(
newItem&&newItem.length){this._open(newItem.parent());this._delay(function(){this.focus(event,
newItem)})}},next:function(event){this._move("next","first",event)},previous:function(event){
this._move("prev","last",event)},isFirstItem:function(){return this.active&&!this.active.prevAll(
".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(
".ui-menu-item").length},_menuItems:function(menu){return(menu||this.element).find(
this.options.items).filter(".ui-menu-item")},_move:function(direction,filter,event){var next;if(
this.active){if(direction==="first"||direction==="last"){next=this.active[
direction==="first"?"prevAll":"nextAll"](".ui-menu-item").last()}else{next=this.active[
direction+"All"](".ui-menu-item").first()}}if(!next||!next.length||!this.active){
next=this._menuItems(this.activeMenu)[filter]()}this.focus(event,next)},nextPage:function(event){
var item,base,height;if(!this.active){this.next(event);return}if(this.isLastItem()){return}if(
this._hasScroll()){base=this.active.offset().top;height=this.element.innerHeight();if(
$.fn.jquery.indexOf("3.2.")===0){height+=this.element[0].offsetHeight-this.element.outerHeight()}
this.active.nextAll(".ui-menu-item").each(function(){item=$(this);return item.offset(
).top-base-height<0});this.focus(event,item)}else{this.focus(event,this._menuItems(this.activeMenu)[
!this.active?"first":"last"]())}},previousPage:function(event){var item,base,height;if(!this.active
){this.next(event);return}if(this.isFirstItem()){return}if(this._hasScroll()){
base=this.active.offset().top;height=this.element.innerHeight();if($.fn.jquery.indexOf("3.2.")===0){
height+=this.element[0].offsetHeight-this.element.outerHeight()}this.active.prevAll(".ui-menu-item"
).each(function(){item=$(this);return item.offset().top-base+height>0});this.focus(event,item)}else{
this.focus(event,this._menuItems(this.activeMenu).first())}},_hasScroll:function(){
return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(event){
this.active=this.active||$(event.target).closest(".ui-menu-item");var ui={item:this.active};if(
!this.active.has(".ui-menu").length){this.collapseAll(event,true)}this._trigger("select",event,ui)},
_filterMenuItems:function(character){var escapedCharacter=character.replace(
/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),regex=new RegExp("^"+escapedCharacter,"i");
return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){
return regex.test(String.prototype.trim.call($(this).children(".ui-menu-item-wrapper").text()))})}})
$.widget("ui.autocomplete",{version:"1.13.2",defaultElement:"<input>",options:{appendTo:null,
autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},
source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},
requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var suppressKeyPress,
suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),
isTextarea=nodeName==="textarea",isInput=nodeName==="input";
this.isMultiLine=isTextarea||!isInput&&this._isContentEditable(this.element);
this.valueMethod=this.element[isTextarea||isInput?"val":"text"];this.isNewMenu=true;this._addClass(
"ui-autocomplete-input");this.element.attr("autocomplete","off");this._on(this.element,{
keydown:function(event){if(this.element.prop("readOnly")){suppressKeyPress=true;suppressInput=true;
suppressKeyPressRepeat=true;return}suppressKeyPress=false;suppressInput=false;
suppressKeyPressRepeat=false;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:
suppressKeyPress=true;this._move("previousPage",event);break;case keyCode.PAGE_DOWN:
suppressKeyPress=true;this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=true;
this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=true;this._keyEvent("next"
,event);break;case keyCode.ENTER:if(this.menu.active){suppressKeyPress=true;event.preventDefault();
this.menu.select(event)}break;case keyCode.TAB:if(this.menu.active){this.menu.select(event)}break;
case keyCode.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term
)}this.close(event);event.preventDefault()}break;default:suppressKeyPressRepeat=true;
this._searchTimeout(event);break}},keypress:function(event){if(suppressKeyPress){
suppressKeyPress=false;if(!this.isMultiLine||this.menu.element.is(":visible")){event.preventDefault(
)}return}if(suppressKeyPressRepeat){return}var keyCode=$.ui.keyCode;switch(event.keyCode){
case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move(
"nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:
this._keyEvent("next",event);break}},input:function(event){if(suppressInput){suppressInput=false;
event.preventDefault();return}this._searchTimeout(event)},focus:function(){this.selectedItem=null;
this.previous=this._value()},blur:function(event){clearTimeout(this.searching);this.close(event);
this._change(event)}});this._initSource();this.menu=$("<ul>").appendTo(this._appendTo()).menu({
role:null}).hide().attr({unselectable:"on"}).menu("instance");this._addClass(this.menu.element,
"ui-autocomplete","ui-front");this._on(this.menu.element,{mousedown:function(event){
event.preventDefault()},menufocus:function(event,ui){var label,item;if(this.isNewMenu){
this.isNewMenu=false;if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){
this.menu.blur();this.document.one("mousemove",function(){$(event.target).trigger(
event.originalEvent)});return}}item=ui.item.data("ui-autocomplete-item");if(false!==this._trigger(
"focus",event,{item:item})){if(event.originalEvent&&/^key/.test(event.originalEvent.type)){
this._value(item.value)}}label=ui.item.attr("aria-label")||item.value;if(
label&&String.prototype.trim.call(label).length){clearTimeout(this.liveRegionTimer);
this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(label))},100)}},
menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;
if(this.element[0]!==$.ui.safeActiveElement(this.document[0])){this.element.trigger("focus");
this.previous=previous;this._delay(function(){this.previous=previous;this.selectedItem=item})}if(
false!==this._trigger("select",event,{item:item})){this._value(item.value)}this.term=this._value();
this.close(event);this.selectedItem=item}});this.liveRegion=$("<div>",{role:"status",
"aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);
this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this._on(this.window,{
beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){
clearTimeout(this.searching);this.element.removeAttr("autocomplete");this.menu.element.remove();
this.liveRegion.remove()},_setOption:function(key,value){this._super(key,value);if(key==="source"){
this._initSource()}if(key==="appendTo"){this.menu.element.appendTo(this._appendTo())}if(
key==="disabled"&&value&&this.xhr){this.xhr.abort()}},_isEventTargetInWidget:function(event){
var menuElement=this.menu.element[0];return event.target===this.element[0
]||event.target===menuElement||$.contains(menuElement,event.target)},_closeOnClickOutside:function(
event){if(!this._isEventTargetInWidget(event)){this.close()}},_appendTo:function(){
var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element
):this.document.find(element).eq(0)}if(!element||!element[0]){element=this.element.closest(
".ui-front, dialog")}if(!element.length){element=this.document[0].body}return element},
_initSource:function(){var array,url,that=this;if(Array.isArray(this.options.source)){
array=this.options.source;this.source=function(request,response){response($.ui.autocomplete.filter(
array,request.term))}}else if(typeof this.options.source==="string"){url=this.options.source;
this.source=function(request,response){if(that.xhr){that.xhr.abort()}that.xhr=$.ajax({url:url,
data:request,dataType:"json",success:function(data){response(data)},error:function(){response([])}})
}}else{this.source=this.options.source}},_searchTimeout:function(event){clearTimeout(this.searching)
this.searching=this._delay(function(){var equalValues=this.term===this._value(),
menuVisible=this.menu.element.is(":visible"),
modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;if(
!equalValues||equalValues&&!menuVisible&&!modifierKey){this.selectedItem=null;this.search(null,event
)}},this.options.delay)},search:function(value,event){value=value!=null?value:this._value();
this.term=this._value();if(value.length<this.options.minLength){return this.close(event)}if(
this._trigger("search",event)===false){return}return this._search(value)},_search:function(value){
this.pending++;this._addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({
term:value},this._response())},_response:function(){var index=++this.requestIndex;return function(
content){if(index===this.requestIndex){this.__response(content)}this.pending--;if(!this.pending){
this._removeClass("ui-autocomplete-loading")}}.bind(this)},__response:function(content){if(content){
content=this._normalize(content)}this._trigger("response",null,{content:content});if(
!this.options.disabled&&content&&content.length&&!this.cancelSearch){this._suggest(content);
this._trigger("open")}else{this._close()}},close:function(event){this.cancelSearch=true;this._close(
event)},_close:function(event){this._off(this.document,"mousedown");if(this.menu.element.is(
":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",
event)}},_change:function(event){if(this.previous!==this._value()){this._trigger("change",event,{
item:this.selectedItem})}},_normalize:function(items){if(items.length&&items[0].label&&items[0
].value){return items}return $.map(items,function(item){if(typeof item==="string"){return{
label:item,value:item}}return $.extend({},item,{label:item.label||item.value,
value:item.value||item.label})})},_suggest:function(items){var ul=this.menu.element.empty();
this._renderMenu(ul,items);this.isNewMenu=true;this.menu.refresh();ul.show();this._resizeMenu();
ul.position($.extend({of:this.element},this.options.position));if(this.options.autoFocus){
this.menu.next()}this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){
var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth(
)))},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){
that._renderItemData(ul,item)})},_renderItemData:function(ul,item){return this._renderItem(ul,item
).data("ui-autocomplete-item",item)},_renderItem:function(ul,item){return $("<li>").append($("<div>"
).text(item.label)).appendTo(ul)},_move:function(direction,event){if(!this.menu.element.is(
":visible")){this.search(null,event);return}if(this.menu.isFirstItem()&&/^previous/.test(direction
)||this.menu.isLastItem()&&/^next/.test(direction)){if(!this.isMultiLine){this._value(this.term)}
this.menu.blur();return}this.menu[direction](event)},widget:function(){return this.menu.element},
_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(keyEvent
,event){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(keyEvent,event);
event.preventDefault()}},_isContentEditable:function(element){if(!element.length){return false}
var editable=element.prop("contentEditable");if(editable==="inherit"){
return this._isContentEditable(element.parent())}return editable==="true"}});$.extend(
$.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,
"\\$&")},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i")
return $.grep(array,function(value){return matcher.test(value.label||value.value||value)})}});
$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",
results:function(amount){return amount+(amount>1?" results are":" result is"
)+" available, use up and down arrow keys to navigate."}}},__response:function(content){var message;
this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return}if(
content&&content.length){message=this.options.messages.results(content.length)}else{
message=this.options.messages.noResults}clearTimeout(this.liveRegionTimer);
this.liveRegionTimer=this._delay(function(){this.liveRegion.html($("<div>").text(message))},100)}});
var widgetsAutocomplete=$.ui.autocomplete;var controlgroupCornerRegex=/ui-corner-([a-z]){2,6}/g;
var widgetsControlgroup=$.widget("ui.controlgroup",{version:"1.13.2",defaultElement:"<div>",
options:{direction:"horizontal",disabled:null,onlyVisible:true,items:{
button:"input[type=button], input[type=submit], input[type=reset], button, a",
controlgroupLabel:".ui-controlgroup-label",
checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",
spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){
this.element.attr("role","toolbar");this.refresh()},_destroy:function(){this._callChildMethod(
"destroy");this.childWidgets.removeData("ui-controlgroup-data");this.element.removeAttr("role");if(
this.options.items.controlgroupLabel){this.element.find(this.options.items.controlgroupLabel).find(
".ui-controlgroup-label-contents").contents().unwrap()}},_initWidgets:function(){var that=this,
childWidgets=[];$.each(this.options.items,function(widget,selector){var labels;var options={};if(
!selector){return}if(widget==="controlgroupLabel"){labels=that.element.find(selector);labels.each(
function(){var element=$(this);if(element.children(".ui-controlgroup-label-contents").length){return
}element.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")});
that._addClass(labels,null,"ui-widget ui-widget-content ui-state-default");
childWidgets=childWidgets.concat(labels.get());return}if(!$.fn[widget]){return}if(that[
"_"+widget+"Options"]){options=that["_"+widget+"Options"]("middle")}else{options={classes:{}}}
that.element.find(selector).each(function(){var element=$(this);var instance=element[widget](
"instance");var instanceOptions=$.widget.extend({},options);if(widget==="button"&&element.parent(
".ui-spinner").length){return}if(!instance){instance=element[widget]()[widget]("instance")}if(
instance){instanceOptions.classes=that._resolveClassesValues(instanceOptions.classes,instance)}
element[widget](instanceOptions);var widgetElement=element[widget]("widget");$.data(widgetElement[0]
,"ui-controlgroup-data",instance?instance:element[widget]("instance"));childWidgets.push(
widgetElement[0])})});this.childWidgets=$($.uniqueSort(childWidgets));this._addClass(
this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(method){this.childWidgets.each(
function(){var element=$(this),data=element.data("ui-controlgroup-data");if(data&&data[method]){
data[method]()}})},_updateCornerClass:function(element,position){
var remove="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all";
var add=this._buildSimpleOptions(position,"label").classes.label;this._removeClass(element,null,
remove);this._addClass(element,null,add)},_buildSimpleOptions:function(position,key){
var direction=this.options.direction==="vertical";var result={classes:{}};result.classes[key]={
middle:"",first:"ui-corner-"+(direction?"top":"left"),last:"ui-corner-"+(direction?"bottom":"right"
),only:"ui-corner-all"}[position];return result},_spinnerOptions:function(position){
var options=this._buildSimpleOptions(position,"ui-spinner");options.classes["ui-spinner-up"]="";
options.classes["ui-spinner-down"]="";return options},_buttonOptions:function(position){
return this._buildSimpleOptions(position,"ui-button")},_checkboxradioOptions:function(position){
return this._buildSimpleOptions(position,"ui-checkboxradio-label")},_selectmenuOptions:function(
position){var direction=this.options.direction==="vertical";return{width:direction?"auto":false,
classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{
"ui-selectmenu-button-open":"ui-corner-"+(direction?"top":"tl"),
"ui-selectmenu-button-closed":"ui-corner-"+(direction?"top":"left")},last:{
"ui-selectmenu-button-open":direction?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(
direction?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top",
"ui-selectmenu-button-closed":"ui-corner-all"}}[position]}},_resolveClassesValues:function(classes,
instance){var result={};$.each(classes,function(key){var current=instance.options.classes[key]||"";
current=String.prototype.trim.call(current.replace(controlgroupCornerRegex,""));result[key]=(
current+" "+classes[key]).replace(/\s+/g," ")});return result},_setOption:function(key,value){if(
key==="direction"){this._removeClass("ui-controlgroup-"+this.options.direction)}this._super(key,
value);if(key==="disabled"){this._callChildMethod(value?"disable":"enable");return}this.refresh()},
refresh:function(){var children,that=this;this._addClass(
"ui-controlgroup ui-controlgroup-"+this.options.direction);if(this.options.direction==="horizontal"
){this._addClass(null,"ui-helper-clearfix")}this._initWidgets();children=this.childWidgets;if(
this.options.onlyVisible){children=children.filter(":visible")}if(children.length){$.each(["first",
"last"],function(index,value){var instance=children[value]().data("ui-controlgroup-data");if(
instance&&that["_"+instance.widgetName+"Options"]){var options=that[
"_"+instance.widgetName+"Options"](children.length===1?"only":value);
options.classes=that._resolveClassesValues(options.classes,instance);instance.element[
instance.widgetName](options)}else{that._updateCornerClass(children[value](),value)}});
this._callChildMethod("refresh")}}});$.widget("ui.checkboxradio",[$.ui.formResetMixin,{
version:"1.13.2",options:{disabled:null,label:null,icon:true,classes:{
"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},
_getCreateOptions:function(){var disabled,labels,labelContents;var options=this._super()||{};
this._readType();labels=this.element.labels();this.label=$(labels[labels.length-1]);if(
!this.label.length){$.error("No label found for checkboxradio widget")}this.originalLabel="";
labelContents=this.label.contents().not(this.element[0]);if(labelContents.length){
this.originalLabel+=labelContents.clone().wrapAll("<div></div>").parent().html()}if(
this.originalLabel){options.label=this.originalLabel}disabled=this.element[0].disabled;if(
disabled!=null){options.disabled=disabled}return options},_create:function(){
var checked=this.element[0].checked;this._bindFormResetHandler();if(this.options.disabled==null){
this.options.disabled=this.element[0].disabled}this._setOption("disabled",this.options.disabled);
this._addClass("ui-checkboxradio","ui-helper-hidden-accessible");this._addClass(this.label,
"ui-checkboxradio-label","ui-button ui-widget");if(this.type==="radio"){this._addClass(this.label,
"ui-checkboxradio-radio-label")}if(this.options.label&&this.options.label!==this.originalLabel){
this._updateLabel()}else if(this.originalLabel){this.options.label=this.originalLabel}this._enhance(
);if(checked){this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active")}this._on({
change:"_toggleClasses",focus:function(){this._addClass(this.label,null,
"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,
"ui-state-focus ui-visual-focus")}})},_readType:function(){var nodeName=this.element[0
].nodeName.toLowerCase();this.type=this.element[0].type;if(
nodeName!=="input"||!/radio|checkbox/.test(this.type)){$.error(
"Can't create checkboxradio on element.nodeName="+nodeName+" and element.type="+this.type)}},
_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},
_getRadioGroup:function(){var group;var name=this.element[0].name;
var nameSelector="input[name='"+$.escapeSelector(name)+"']";if(!name){return $([])}if(
this.form.length){group=$(this.form[0].elements).filter(nameSelector)}else{group=$(nameSelector
).filter(function(){return $(this)._form().length===0})}return group.not(this.element)},
_toggleClasses:function(){var checked=this.element[0].checked;this._toggleClass(this.label,
"ui-checkboxradio-checked","ui-state-active",checked);if(this.options.icon&&this.type==="checkbox"){
this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",checked)._toggleClass(this.icon,
null,"ui-icon-blank",!checked)}if(this.type==="radio"){this._getRadioGroup().each(function(){
var instance=$(this).checkboxradio("instance");if(instance){instance._removeClass(instance.label,
"ui-checkboxradio-checked","ui-state-active")}})}},_destroy:function(){this._unbindFormResetHandler(
);if(this.icon){this.icon.remove();this.iconSpace.remove()}},_setOption:function(key,value){if(
key==="label"&&!value){return}this._super(key,value);if(key==="disabled"){this._toggleClass(
this.label,null,"ui-state-disabled",value);this.element[0].disabled=value;return}this.refresh()},
_updateIcon:function(checked){var toAdd="ui-icon ui-icon-background ";if(this.options.icon){if(
!this.icon){this.icon=$("<span>");this.iconSpace=$("<span> </span>");this._addClass(this.iconSpace,
"ui-checkboxradio-icon-space")}if(this.type==="checkbox"){
toAdd+=checked?"ui-icon-check ui-state-checked":"ui-icon-blank";this._removeClass(this.icon,null,
checked?"ui-icon-blank":"ui-icon-check")}else{toAdd+="ui-icon-blank"}this._addClass(this.icon,
"ui-checkboxradio-icon",toAdd);if(!checked){this._removeClass(this.icon,null,
"ui-icon-check ui-state-checked")}this.icon.prependTo(this.label).after(this.iconSpace)}else if(
this.icon!==undefined){this.icon.remove();this.iconSpace.remove();delete this.icon}},
_updateLabel:function(){var contents=this.label.contents().not(this.element[0]);if(this.icon){
contents=contents.not(this.icon[0])}if(this.iconSpace){contents=contents.not(this.iconSpace[0])}
contents.remove();this.label.append(this.options.label)},refresh:function(){
var checked=this.element[0].checked,isDisabled=this.element[0].disabled;this._updateIcon(checked);
this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",checked);if(
this.options.label!==null){this._updateLabel()}if(isDisabled!==this.options.disabled){
this._setOptions({disabled:isDisabled})}}}]);var widgetsCheckboxradio=$.ui.checkboxradio;$.widget(
"ui.button",{version:"1.13.2",defaultElement:"<button>",options:{classes:{
"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,
showLabel:true},_getCreateOptions:function(){var disabled,options=this._super()||{};
this.isInput=this.element.is("input");disabled=this.element[0].disabled;if(disabled!=null){
options.disabled=disabled}this.originalLabel=this.isInput?this.element.val():this.element.html();if(
this.originalLabel){options.label=this.originalLabel}return options},_create:function(){if(
!this.option.showLabel&!this.options.icon){this.options.showLabel=true}if(
this.options.disabled==null){this.options.disabled=this.element[0].disabled||false}
this.hasTitle=!!this.element.attr("title");if(
this.options.label&&this.options.label!==this.originalLabel){if(this.isInput){this.element.val(
this.options.label)}else{this.element.html(this.options.label)}}this._addClass("ui-button",
"ui-widget");this._setOption("disabled",this.options.disabled);this._enhance();if(this.element.is(
"a")){this._on({keyup:function(event){if(event.keyCode===$.ui.keyCode.SPACE){event.preventDefault();
if(this.element[0].click){this.element[0].click()}else{this.element.trigger("click")}}}})}},
_enhance:function(){if(!this.element.is("button")){this.element.attr("role","button")}if(
this.options.icon){this._updateIcon("icon",this.options.icon);this._updateTooltip()}},
_updateTooltip:function(){this.title=this.element.attr("title");if(
!this.options.showLabel&&!this.title){this.element.attr("title",this.options.label)}},
_updateIcon:function(option,value){var icon=option!=="iconPosition",
position=icon?this.options.iconPosition:value,displayBlock=position==="top"||position==="bottom";if(
!this.icon){this.icon=$("<span>");this._addClass(this.icon,"ui-button-icon","ui-icon");if(
!this.options.showLabel){this._addClass("ui-button-icon-only")}}else if(icon){this._removeClass(
this.icon,null,this.options.icon)}if(icon){this._addClass(this.icon,null,value)}this._attachIcon(
position);if(displayBlock){this._addClass(this.icon,null,"ui-widget-icon-block");if(this.iconSpace){
this.iconSpace.remove()}}else{if(!this.iconSpace){this.iconSpace=$("<span> </span>");this._addClass(
this.iconSpace,"ui-button-icon-space")}this._removeClass(this.icon,null,"ui-wiget-icon-block");
this._attachIconSpace(position)}},_destroy:function(){this.element.removeAttr("role");if(this.icon){
this.icon.remove()}if(this.iconSpace){this.iconSpace.remove()}if(!this.hasTitle){
this.element.removeAttr("title")}},_attachIconSpace:function(iconPosition){this.icon[
/^(?:end|bottom)/.test(iconPosition)?"before":"after"](this.iconSpace)},_attachIcon:function(
iconPosition){this.element[/^(?:end|bottom)/.test(iconPosition)?"append":"prepend"](this.icon)},
_setOptions:function(options){
var newShowLabel=options.showLabel===undefined?this.options.showLabel:options.showLabel,
newIcon=options.icon===undefined?this.options.icon:options.icon;if(!newShowLabel&&!newIcon){
options.showLabel=true}this._super(options)},_setOption:function(key,value){if(key==="icon"){if(
value){this._updateIcon(key,value)}else if(this.icon){this.icon.remove();if(this.iconSpace){
this.iconSpace.remove()}}}if(key==="iconPosition"){this._updateIcon(key,value)}if(key==="showLabel"
){this._toggleClass("ui-button-icon-only",null,!value);this._updateTooltip()}if(key==="label"){if(
this.isInput){this.element.val(value)}else{this.element.html(value);if(this.icon){this._attachIcon(
this.options.iconPosition);this._attachIconSpace(this.options.iconPosition)}}}this._super(key,value)
if(key==="disabled"){this._toggleClass(null,"ui-state-disabled",value);this.element[0
].disabled=value;if(value){this.element.trigger("blur")}}},refresh:function(){
var isDisabled=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass(
"ui-button-disabled");if(isDisabled!==this.options.disabled){this._setOptions({disabled:isDisabled})
}this._updateTooltip()}});if($.uiBackCompat!==false){$.widget("ui.button",$.ui.button,{options:{
text:true,icons:{primary:null,secondary:null}},_create:function(){if(
this.options.showLabel&&!this.options.text){this.options.showLabel=this.options.text}if(
!this.options.showLabel&&this.options.text){this.options.text=this.options.showLabel}if(
!this.options.icon&&(this.options.icons.primary||this.options.icons.secondary)){if(
this.options.icons.primary){this.options.icon=this.options.icons.primary}else{
this.options.icon=this.options.icons.secondary;this.options.iconPosition="end"}}else if(
this.options.icon){this.options.icons.primary=this.options.icon}this._super()},_setOption:function(
key,value){if(key==="text"){this._super("showLabel",value);return}if(key==="showLabel"){
this.options.text=value}if(key==="icon"){this.options.icons.primary=value}if(key==="icons"){if(
value.primary){this._super("icon",value.primary);this._super("iconPosition","beginning")}else if(
value.secondary){this._super("icon",value.secondary);this._super("iconPosition","end")}}
this._superApply(arguments)}});$.fn.button=function(orig){return function(options){
var isMethodCall=typeof options==="string";var args=Array.prototype.slice.call(arguments,1);
var returnValue=this;if(isMethodCall){if(!this.length&&options==="instance"){returnValue=undefined
}else{this.each(function(){var methodValue;var type=$(this).attr("type");
var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,
"ui-"+name);if(options==="instance"){returnValue=instance;return false}if(!instance){return $.error(
"cannot call methods on button"+" prior to initialization; "+"attempted to call method '"+options+"'"
)}if(typeof instance[options]!=="function"||options.charAt(0)==="_"){return $.error(
"no such method '"+options+"' for button"+" widget instance")}methodValue=instance[options].apply(
instance,args);if(methodValue!==instance&&methodValue!==undefined){
returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;
return false}})}}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args))}
this.each(function(){var type=$(this).attr("type");
var name=type!=="checkbox"&&type!=="radio"?"button":"checkboxradio";var instance=$.data(this,
"ui-"+name);if(instance){instance.option(options||{});if(instance._init){instance._init()}}else{if(
name==="button"){orig.call($(this),options);return}$(this).checkboxradio($.extend({icon:false},
options))}})}return returnValue}}($.fn.button);$.fn.buttonset=function(){if(!$.ui.controlgroup){
$.error("Controlgroup widget missing")}if(arguments[0]==="option"&&arguments[1
]==="items"&&arguments[2]){return this.controlgroup.apply(this,[arguments[0],"items.button",
arguments[2]])}if(arguments[0]==="option"&&arguments[1]==="items"){return this.controlgroup.apply(
this,[arguments[0],"items.button"])}if(typeof arguments[0]==="object"&&arguments[0].items){
arguments[0].items={button:arguments[0].items}}return this.controlgroup.apply(this,arguments)}}
var widgetsButton=$.ui.button;$.extend($.ui,{datepicker:{version:"1.13.2"}});
var datepicker_instActive;function datepicker_getZindex(elem){var position,value;while(
elem.length&&elem[0]!==document){position=elem.css("position");if(
position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),
10);if(!isNaN(value)&&value!==0){return value}}elem=elem.parent()}return 0}function Datepicker(){
this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;
this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";
this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";
this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";
this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";
this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={
closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January",
"February","March","April","May","June","July","August","September","October","November","December"
],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:[
"Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],
weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:"",
selectMonthLabel:"Select month",selectYearLabel:"Select year"};this._defaults={showOn:"focus",
showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",
buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,
changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,
selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,
onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,
stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,
autoSize:false,disabled:false};$.extend(this._defaults,this.regional[""]);this.regional.en=$.extend(
true,{},this.regional[""]);this.regional["en-US"]=$.extend(true,{},this.regional.en);
this.dpDiv=datepicker_bindHover($(
"<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"
))}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,
_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(settings){
datepicker_extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,
settings){var nodeName,inline,inst;nodeName=target.nodeName.toLowerCase();
inline=nodeName==="div"||nodeName==="span";if(!target.id){this.uuid+=1;target.id="dp"+this.uuid}
inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{});if(nodeName==="input"){
this._connectDatepicker(target,inst)}else if(inline){this._inlineDatepicker(target,inst)}},
_newInst:function(target,inline){var id=target[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{
id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,
inline:inline,dpDiv:!inline?this.dpDiv:datepicker_bindHover($(
"<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"
))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([
]);if(input.hasClass(this.markerClassName)){return}this._attachments(input,inst);input.addClass(
this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",
this._doKeyUp);this._autoSize(inst);$.data(target,"datepicker",inst);if(inst.settings.disabled){
this._disableDatepicker(target)}},_attachments:function(input,inst){var showOn,buttonText,
buttonImage,appendText=this._get(inst,"appendText"),isRTL=this._get(inst,"isRTL");if(inst.append){
inst.append.remove()}if(appendText){inst.append=$("<span>").addClass(this._appendClass).text(
appendText);input[isRTL?"before":"after"](inst.append)}input.off("focus",this._showDatepicker);if(
inst.trigger){inst.trigger.remove()}showOn=this._get(inst,"showOn");if(
showOn==="focus"||showOn==="both"){input.on("focus",this._showDatepicker)}if(
showOn==="button"||showOn==="both"){buttonText=this._get(inst,"buttonText");buttonImage=this._get(
inst,"buttonImage");if(this._get(inst,"buttonImageOnly")){inst.trigger=$("<img>").addClass(
this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText})}else{inst.trigger=$(
"<button type='button'>").addClass(this._triggerClass);if(buttonImage){inst.trigger.html($("<img>"
).attr({src:buttonImage,alt:buttonText,title:buttonText}))}else{inst.trigger.text(buttonText)}}
input[isRTL?"before":"after"](inst.trigger);inst.trigger.on("click",function(){if(
$.datepicker._datepickerShowing&&$.datepicker._lastInput===input[0]){$.datepicker._hideDatepicker()
}else if($.datepicker._datepickerShowing&&$.datepicker._lastInput!==input[0]){
$.datepicker._hideDatepicker();$.datepicker._showDatepicker(input[0])}else{
$.datepicker._showDatepicker(input[0])}return false})}},_autoSize:function(inst){if(this._get(inst,
"autoSize")&&!inst.inline){var findMax,max,maxI,i,date=new Date(2009,12-1,20),dateFormat=this._get(
inst,"dateFormat");if(dateFormat.match(/[DM]/)){findMax=function(names){max=0;maxI=0;for(
i=0;i<names.length;i++){if(names[i].length>max){max=names[i].length;maxI=i}}return maxI};
date.setMonth(findMax(this._get(inst,dateFormat.match(/MM/)?"monthNames":"monthNamesShort")));
date.setDate(findMax(this._get(inst,dateFormat.match(/DD/)?"dayNames":"dayNamesShort")
)+20-date.getDay())}inst.input.attr("size",this._formatDate(inst,date).length)}},
_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(
this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv);$.data(
target,"datepicker",inst);this._setDate(inst,this._getDefaultDate(inst),true);
this._updateDatepicker(inst);this._updateAlternate(inst);if(inst.settings.disabled){
this._disableDatepicker(target)}inst.dpDiv.css("display","block")},_dialogDatepicker:function(input,
date,onSelect,settings,pos){var id,browserWidth,browserHeight,scrollX,scrollY,inst=this._dialogInst;
if(!inst){this.uuid+=1;id="dp"+this.uuid;this._dialogInput=$(
"<input type='text' id='"+id+"' style='position: absolute; top: -100px; width: 0px;'/>");
this._dialogInput.on("keydown",this._doKeyDown);$("body").append(this._dialogInput);
inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(
this._dialogInput[0],"datepicker",inst)}datepicker_extendRemove(inst.settings,settings||{});
date=date&&date.constructor===Date?this._formatDate(inst,date):date;this._dialogInput.val(date);
this._pos=pos?pos.length?pos:[pos.pageX,pos.pageY]:null;if(!this._pos){
browserWidth=document.documentElement.clientWidth;
browserHeight=document.documentElement.clientHeight;
scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;
scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[
browserWidth/2-100+scrollX,browserHeight/2-150+scrollY]}this._dialogInput.css("left",this._pos[0
]+20+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;
this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){
$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],"datepicker",inst);return this},
_destroyDatepicker:function(target){var nodeName,$target=$(target),inst=$.data(target,"datepicker");
if(!$target.hasClass(this.markerClassName)){return}nodeName=target.nodeName.toLowerCase();
$.removeData(target,"datepicker");if(nodeName==="input"){inst.append.remove();inst.trigger.remove();
$target.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",
this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)}else if(
nodeName==="div"||nodeName==="span"){$target.removeClass(this.markerClassName).empty()}if(
datepicker_instActive===inst){datepicker_instActive=null;this._curInst=null}},
_enableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,
"datepicker");if(!$target.hasClass(this.markerClassName)){return}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=false;
inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({
opacity:"1.0",cursor:""})}else if(nodeName==="div"||nodeName==="span"){inline=$target.children(
"."+this._inlineClass);inline.children().removeClass("ui-state-disabled");inline.find(
"select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",false)}
this._disabledInputs=$.map(this._disabledInputs,function(value){return value===target?null:value})},
_disableDatepicker:function(target){var nodeName,inline,$target=$(target),inst=$.data(target,
"datepicker");if(!$target.hasClass(this.markerClassName)){return}
nodeName=target.nodeName.toLowerCase();if(nodeName==="input"){target.disabled=true;
inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({
opacity:"0.5",cursor:"default"})}else if(nodeName==="div"||nodeName==="span"){
inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled");
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",true)}
this._disabledInputs=$.map(this._disabledInputs,function(value){return value===target?null:value});
this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(
!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i
]===target){return true}}return false},_getInst:function(target){try{return $.data(target,
"datepicker")}catch(err){throw"Missing instance data for this datepicker"}},
_optionDatepicker:function(target,name,value){var settings,date,minDate,maxDate,inst=this._getInst(
target);if(arguments.length===2&&typeof name==="string"){return name==="defaults"?$.extend({},
$.datepicker._defaults):inst?name==="all"?$.extend({},inst.settings):this._get(inst,name):null}
settings=name||{};if(typeof name==="string"){settings={};settings[name]=value}if(inst){if(
this._curInst===inst){this._hideDatepicker()}date=this._getDateDatepicker(target,true);
minDate=this._getMinMaxDate(inst,"min");maxDate=this._getMinMaxDate(inst,"max");
datepicker_extendRemove(inst.settings,settings);if(
minDate!==null&&settings.dateFormat!==undefined&&settings.minDate===undefined){
inst.settings.minDate=this._formatDate(inst,minDate)}if(
maxDate!==null&&settings.dateFormat!==undefined&&settings.maxDate===undefined){
inst.settings.maxDate=this._formatDate(inst,maxDate)}if("disabled"in settings){if(settings.disabled
){this._disableDatepicker(target)}else{this._enableDatepicker(target)}}this._attachments($(target),
inst);this._autoSize(inst);this._setDate(inst,date);this._updateAlternate(inst);
this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(
target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){
this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date){var inst=this._getInst(
target);if(inst){this._setDate(inst,date);this._updateDatepicker(inst);this._updateAlternate(inst)}
},_getDateDatepicker:function(target,noDefault){var inst=this._getInst(target);if(inst&&!inst.inline
){this._setDateFromField(inst,noDefault)}return inst?this._getDate(inst):null},_doKeyDown:function(
event){var onSelect,dateStr,sel,inst=$.datepicker._getInst(event.target),handled=true,
isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){
switch(event.keyCode){case 9:$.datepicker._hideDatepicker();handled=false;break;case 13:sel=$(
"td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",inst.dpDiv);if(sel[0]){
$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}
onSelect=$.datepicker._get(inst,"onSelect");if(onSelect){dateStr=$.datepicker._formatDate(inst);
onSelect.apply(inst.input?inst.input[0]:null,[dateStr,inst])}else{$.datepicker._hideDatepicker()}
return false;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(
event.target,event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,
"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(event.target,
event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths"),"M");
break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}
handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){
$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(
event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,isRTL?+1:-1,"D")}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(
event.target,event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,
"stepMonths"),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(
event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(
event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,isRTL?-1:+1,"D")}
handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(
event.target,event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,
"stepMonths"),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(
event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else if(
event.keyCode===36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}if(handled
){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var chars,chr,
inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){
chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));chr=String.fromCharCode(
event.charCode==null?event.keyCode:event.charCode);return event.ctrlKey||event.metaKey||(
chr<" "||!chars||chars.indexOf(chr)>-1)}},_doKeyUp:function(event){var date,
inst=$.datepicker._getInst(event.target);if(inst.input.val()!==inst.lastVal){try{
date=$.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),inst.input?inst.input.val():null,
$.datepicker._getFormatConfig(inst));if(date){$.datepicker._setDateFromField(inst);
$.datepicker._updateAlternate(inst);$.datepicker._updateDatepicker(inst)}}catch(err){}}return true},
_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!=="input"
){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input
)||$.datepicker._lastInput===input){return}var inst,beforeShow,beforeShowSettings,isFixed,offset,
showAnim,duration;inst=$.datepicker._getInst(input);if(
$.datepicker._curInst&&$.datepicker._curInst!==inst){$.datepicker._curInst.dpDiv.stop(true,true);if(
inst&&$.datepicker._datepickerShowing){$.datepicker._hideDatepicker($.datepicker._curInst.input[0])}
}beforeShow=$.datepicker._get(inst,"beforeShow");beforeShowSettings=beforeShow?beforeShow.apply(
input,[input,inst]):{};if(beforeShowSettings===false){return}datepicker_extendRemove(inst.settings,
beforeShowSettings);inst.lastVal=null;$.datepicker._lastInput=input;$.datepicker._setDateFromField(
inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){
$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}
isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")==="fixed";
return!isFixed});offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;
inst.dpDiv.empty();inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});
$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);
inst.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":isFixed?"fixed":"absolute",
display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){
showAnim=$.datepicker._get(inst,"showAnim");duration=$.datepicker._get(inst,"duration");
inst.dpDiv.css("z-index",datepicker_getZindex($(input))+1);$.datepicker._datepickerShowing=true;if(
$.effects&&$.effects.effect[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"
),duration)}else{inst.dpDiv[showAnim||"show"](showAnim?duration:null)}if(
$.datepicker._shouldFocusInput(inst)){inst.input.trigger("focus")}$.datepicker._curInst=inst}},
_updateDatepicker:function(inst){this.maxRows=4;datepicker_instActive=inst;inst.dpDiv.empty(
).append(this._generateHTML(inst));this._attachHandlers(inst);var origyearshtml,
numMonths=this._getNumberOfMonths(inst),cols=numMonths[1],width=17,activeCell=inst.dpDiv.find(
"."+this._dayOverClass+" a"),onUpdateDatepicker=$.datepicker._get(inst,"onUpdateDatepicker");if(
activeCell.length>0){datepicker_handleMouseover.apply(activeCell.get(0))}inst.dpDiv.removeClass(
"ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");if(cols>1){
inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",width*cols+"em")}inst.dpDiv[(numMonths[
0]!==1||numMonths[1]!==1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,
"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(
inst===$.datepicker._curInst&&$.datepicker._datepickerShowing&&$.datepicker._shouldFocusInput(inst)
){inst.input.trigger("focus")}if(inst.yearshtml){origyearshtml=inst.yearshtml;setTimeout(function(){
if(origyearshtml===inst.yearshtml&&inst.yearshtml){inst.dpDiv.find("select.ui-datepicker-year"
).first().replaceWith(inst.yearshtml)}origyearshtml=inst.yearshtml=null},0)}if(onUpdateDatepicker){
onUpdateDatepicker.apply(inst.input?inst.input[0]:null,[inst])}},_shouldFocusInput:function(inst){
return inst.input&&inst.input.is(":visible")&&!inst.input.is(":disabled")&&!inst.input.is(":focus")
},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth(),
dpHeight=inst.dpDiv.outerHeight(),inputWidth=inst.input?inst.input.outerWidth():0,
inputHeight=inst.input?inst.input.outerHeight():0,viewWidth=document.documentElement.clientWidth+(
isFixed?0:$(document).scrollLeft()),viewHeight=document.documentElement.clientHeight+(isFixed?0:$(
document).scrollTop());offset.left-=this._get(inst,"isRTL")?dpWidth-inputWidth:0;
offset.left-=isFixed&&offset.left===inst.input.offset().left?$(document).scrollLeft():0;
offset.top-=isFixed&&offset.top===inst.input.offset().top+inputHeight?$(document).scrollTop():0;
offset.left-=Math.min(offset.left,offset.left+dpWidth>viewWidth&&viewWidth>dpWidth?Math.abs(
offset.left+dpWidth-viewWidth):0);offset.top-=Math.min(offset.top,
offset.top+dpHeight>viewHeight&&viewHeight>dpHeight?Math.abs(dpHeight+inputHeight):0);return offset
},_findPos:function(obj){var position,inst=this._getInst(obj),isRTL=this._get(inst,"isRTL");while(
obj&&(obj.type==="hidden"||obj.nodeType!==1||$.expr.pseudos.hidden(obj))){obj=obj[
isRTL?"previousSibling":"nextSibling"]}position=$(obj).offset();return[position.left,position.top]},
_hideDatepicker:function(input){var showAnim,duration,postProcess,onClose,inst=this._curInst;if(
!inst||input&&inst!==$.data(input,"datepicker")){return}if(this._datepickerShowing){
showAnim=this._get(inst,"showAnim");duration=this._get(inst,"duration");postProcess=function(){
$.datepicker._tidyDialog(inst)};if($.effects&&($.effects.effect[showAnim]||$.effects[showAnim])){
inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{
inst.dpDiv[showAnim==="slideDown"?"slideUp":showAnim==="fadeIn"?"fadeOut":"hide"](
showAnim?duration:null,postProcess)}if(!showAnim){postProcess()}this._datepickerShowing=false;
onClose=this._get(inst,"onClose");if(onClose){onClose.apply(inst.input?inst.input[0]:null,[
inst.input?inst.input.val():"",inst])}this._lastInput=null;if(this._inDialog){this._dialogInput.css(
{position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv
)}}this._inDialog=false}},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).off(
".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}
var $target=$(event.target),inst=$.datepicker._getInst($target[0]);if($target[0
].id!==$.datepicker._mainDivId&&$target.parents("#"+$.datepicker._mainDivId
).length===0&&!$target.hasClass($.datepicker.markerClassName)&&!$target.closest(
"."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&!(
$.datepicker._inDialog&&$.blockUI)||$target.hasClass($.datepicker.markerClassName
)&&$.datepicker._curInst!==inst){$.datepicker._hideDatepicker()}},_adjustDate:function(id,offset,
period){var target=$(id),inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){
return}this._adjustInstDate(inst,offset,period);this._updateDatepicker(inst)},_gotoToday:function(id
){var date,target=$(id),inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent"
)&&inst.currentDay){inst.selectedDay=inst.currentDay;
inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear
}else{date=new Date;inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth(
);inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(
target)},_selectMonthYear:function(id,select,period){var target=$(id),inst=this._getInst(target[0]);
inst["selected"+(period==="M"?"Month":"Year")]=inst["draw"+(period==="M"?"Month":"Year")]=parseInt(
select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},
_selectDay:function(id,month,year,td){var inst,target=$(id);if($(td).hasClass(
this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}inst=this._getInst(target[0]
);inst.selectedDay=inst.currentDay=parseInt($("a",td).attr("data-date"));
inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;this._selectDate(
id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))},_clearDate:function(
id){var target=$(id);this._selectDate(target,"")},_selectDate:function(id,dateStr){var onSelect,
target=$(id),inst=this._getInst(target[0]);dateStr=dateStr!=null?dateStr:this._formatDate(inst);if(
inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);onSelect=this._get(inst,"onSelect");
if(onSelect){onSelect.apply(inst.input?inst.input[0]:null,[dateStr,inst])}else if(inst.input){
inst.input.trigger("change")}if(inst.inline){this._updateDatepicker(inst)}else{this._hideDatepicker(
);this._lastInput=inst.input[0];if(typeof inst.input[0]!=="object"){inst.input.trigger("focus")}
this._lastInput=null}},_updateAlternate:function(inst){var altFormat,date,dateStr,
altField=this._get(inst,"altField");if(altField){altFormat=this._get(inst,"altFormat")||this._get(
inst,"dateFormat");date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,
this._getFormatConfig(inst));$(document).find(altField).val(dateStr)}},noWeekends:function(date){
var day=date.getDay();return[day>0&&day<6,""]},iso8601Week:function(date){var time,
checkDate=new Date(date.getTime());checkDate.setDate(checkDate.getDate()+4-(checkDate.getDay()||7));
time=checkDate.getTime();checkDate.setMonth(0);checkDate.setDate(1);return Math.floor(Math.round((
time-checkDate)/864e5)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null
){throw"Invalid arguments"}value=typeof value==="object"?value.toString():value+"";if(value===""){
return null}var iFormat,dim,extra,iValue=0,shortYearCutoffTemp=(
settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff,
shortYearCutoff=typeof shortYearCutoffTemp!=="string"?shortYearCutoffTemp:(new Date).getFullYear(
)%100+parseInt(shortYearCutoffTemp,10),dayNamesShort=(settings?settings.dayNamesShort:null
)||this._defaults.dayNamesShort,dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames,
monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,
monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames,year=-1,month=-1,day=-1,
doy=-1,literal=false,date,lookAhead=function(match){
var matches=iFormat+1<format.length&&format.charAt(iFormat+1)===match;if(matches){iFormat++}
return matches},getNumber=function(match){var isDoubled=lookAhead(match),
size=match==="@"?14:match==="!"?20:match==="y"&&isDoubled?4:match==="o"?3:2,
minSize=match==="y"?size:1,digits=new RegExp("^\\d{"+minSize+","+size+"}"),num=value.substring(
iValue).match(digits);if(!num){throw"Missing number at position "+iValue}iValue+=num[0].length;
return parseInt(num[0],10)},getName=function(match,shortNames,longNames){var index=-1,names=$.map(
lookAhead(match)?longNames:shortNames,function(v,k){return[[k,v]]}).sort(function(a,b){return-(a[1
].length-b[1].length)});$.each(names,function(i,pair){var name=pair[1];if(value.substr(iValue,
name.length).toLowerCase()===name.toLowerCase()){index=pair[0];iValue+=name.length;return false}});
if(index!==-1){return index+1}else{throw"Unknown name at position "+iValue}},checkLiteral=function(
){if(value.charAt(iValue)!==format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}
iValue++};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat
)==="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){
case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":
doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",
monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":date=new Date(getNumber(
"@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"!":
date=new Date((getNumber("!")-this._ticksTo1970)/1e4);year=date.getFullYear();month=date.getMonth(
)+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;
default:checkLiteral()}}}if(iValue<value.length){extra=value.substr(iValue);if(!/^\s+/.test(extra)){
throw"Extra/unparsed characters found in date: "+extra}}if(year===-1){year=(new Date).getFullYear()
}else if(year<100){year+=(new Date).getFullYear()-(new Date).getFullYear()%100+(
year<=shortYearCutoff?0:-100)}if(doy>-1){month=1;day=doy;do{dim=this._getDaysInMonth(year,month-1);
if(day<=dim){break}month++;day-=dim}while(true)}date=this._daylightSavingAdjust(new Date(year,
month-1,day));if(date.getFullYear()!==year||date.getMonth()+1!==month||date.getDate()!==day){
throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",
RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",
RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:((1970-1
)*365+Math.floor(1970/4)-Math.floor(1970/100)+Math.floor(1970/400))*24*60*60*1e7,
formatDate:function(format,date,settings){if(!date){return""}var iFormat,dayNamesShort=(
settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort,dayNames=(
settings?settings.dayNames:null)||this._defaults.dayNames,monthNamesShort=(
settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort,monthNames=(
settings?settings.monthNames:null)||this._defaults.monthNames,lookAhead=function(match){
var matches=iFormat+1<format.length&&format.charAt(iFormat+1)===match;if(matches){iFormat++}
return matches},formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(
num.length<len){num="0"+num}}return num},formatName=function(match,value,shortNames,longNames){
return lookAhead(match)?longNames[value]:shortNames[value]},output="",literal=false;if(date){for(
iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)==="'"&&!lookAhead(
"'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){
case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(
),dayNamesShort,dayNames);break;case"o":output+=formatNumber("o",Math.round((new Date(
date.getFullYear(),date.getMonth(),date.getDate()).getTime()-new Date(date.getFullYear(),0,0
).getTime())/864e5),3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":
output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=lookAhead(
"y")?date.getFullYear():(date.getFullYear()%100<10?"0":"")+date.getFullYear()%100;break;case"@":
output+=date.getTime();break;case"!":output+=date.getTime()*1e4+this._ticksTo1970;break;case"'":if(
lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}
return output},_possibleChars:function(format){var iFormat,chars="",literal=false,
lookAhead=function(match){var matches=iFormat+1<format.length&&format.charAt(iFormat+1)===match;if(
matches){iFormat++}return matches};for(iFormat=0;iFormat<format.length;iFormat++){if(literal){if(
format.charAt(iFormat)==="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}
}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;
case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:
chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name
]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst,noDefault){
if(inst.input.val()===inst.lastVal){return}var dateFormat=this._get(inst,"dateFormat"),
dates=inst.lastVal=inst.input?inst.input.val():null,defaultDate=this._getDefaultDate(inst),
date=defaultDate,settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,
settings)||defaultDate}catch(event){dates=noDefault?"":dates}inst.selectedDay=date.getDate();
inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()
inst.currentDay=dates?date.getDate():0;inst.currentMonth=dates?date.getMonth():0;
inst.currentYear=dates?date.getFullYear():0;this._adjustInstDate(inst)},_getDefaultDate:function(
inst){return this._restrictMinMax(inst,this._determineDate(inst,this._get(inst,"defaultDate"),
new Date))},_determineDate:function(inst,date,defaultDate){var offsetNumeric=function(offset){
var date=new Date;date.setDate(date.getDate()+offset);return date},offsetString=function(offset){
try{return $.datepicker.parseDate($.datepicker._get(inst,"dateFormat"),offset,
$.datepicker._getFormatConfig(inst))}catch(e){}var date=(offset.toLowerCase().match(/^c/
)?$.datepicker._getDate(inst):null)||new Date,year=date.getFullYear(),month=date.getMonth(),
day=date.getDate(),pattern=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,matches=pattern.exec(offset);
while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":
case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);
day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(
matches[1],10);day=Math.min(day,$.datepicker._getDaysInMonth(year,month));break}
matches=pattern.exec(offset)}return new Date(year,month,day)},
newDate=date==null||date===""?defaultDate:typeof date==="string"?offsetString(date
):typeof date==="number"?isNaN(date)?defaultDate:offsetNumeric(date):new Date(date.getTime());
newDate=newDate&&newDate.toString()==="Invalid Date"?defaultDate:newDate;if(newDate){
newDate.setHours(0);newDate.setMinutes(0);newDate.setSeconds(0);newDate.setMilliseconds(0)}
return this._daylightSavingAdjust(newDate)},_daylightSavingAdjust:function(date){if(!date){
return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(
inst,date,noChange){var clear=!date,origMonth=inst.selectedMonth,origYear=inst.selectedYear,
newDate=this._restrictMinMax(inst,this._determineDate(inst,date,new Date));
inst.selectedDay=inst.currentDay=newDate.getDate();
inst.drawMonth=inst.selectedMonth=inst.currentMonth=newDate.getMonth();
inst.drawYear=inst.selectedYear=inst.currentYear=newDate.getFullYear();if((
origMonth!==inst.selectedMonth||origYear!==inst.selectedYear)&&!noChange){this._notifyChange(inst)}
this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},
_getDate:function(inst){var startDate=!inst.currentYear||inst.input&&inst.input.val(
)===""?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay))
return startDate},_attachHandlers:function(inst){var stepMonths=this._get(inst,"stepMonths"),
id="#"+inst.id.replace(/\\\\/g,"\\");inst.dpDiv.find("[data-handler]").map(function(){var handler={
prev:function(){$.datepicker._adjustDate(id,-stepMonths,"M")},next:function(){
$.datepicker._adjustDate(id,+stepMonths,"M")},hide:function(){$.datepicker._hideDatepicker()},
today:function(){$.datepicker._gotoToday(id)},selectDay:function(){$.datepicker._selectDay(id,
+this.getAttribute("data-month"),+this.getAttribute("data-year"),this);return false},
selectMonth:function(){$.datepicker._selectMonthYear(id,this,"M");return false},selectYear:function(
){$.datepicker._selectMonthYear(id,this,"Y");return false}};$(this).on(this.getAttribute(
"data-event"),handler[this.getAttribute("data-handler")])})},_generateHTML:function(inst){
var maxDraw,prevText,prev,nextText,next,currentText,gotoDate,controls,buttonPanel,firstDay,showWeek,
dayNames,dayNamesMin,monthNames,monthNamesShort,beforeShowDay,showOtherMonths,selectOtherMonths,
defaultDate,html,dow,row,group,col,selectedDate,cornerClass,calender,thead,day,daysInMonth,leadDays,
curRows,numRows,printDate,dRow,tbody,daySettings,otherMonth,unselectable,tempDate=new Date,
today=this._daylightSavingAdjust(new Date(tempDate.getFullYear(),tempDate.getMonth(),
tempDate.getDate())),isRTL=this._get(inst,"isRTL"),showButtonPanel=this._get(inst,"showButtonPanel")
,hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext"),navigationAsDateFormat=this._get(inst,
"navigationAsDateFormat"),numMonths=this._getNumberOfMonths(inst),showCurrentAtPos=this._get(inst,
"showCurrentAtPos"),stepMonths=this._get(inst,"stepMonths"),isMultiMonth=numMonths[0
]!==1||numMonths[1]!==1,currentDate=this._daylightSavingAdjust(!inst.currentDay?new Date(9999,9,9
):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)),minDate=this._getMinMaxDate(inst,
"min"),maxDate=this._getMinMaxDate(inst,"max"),drawMonth=inst.drawMonth-showCurrentAtPos,
drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){
maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[0
]*numMonths[1]+1,maxDate.getDate()));maxDraw=minDate&&maxDraw<minDate?minDate:maxDraw;while(
this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){
drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;prevText=this._get(inst,
"prevText");prevText=!navigationAsDateFormat?prevText:this.formatDate(prevText,
this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst));
if(this._canAdjustMonth(inst,-1,drawYear,drawMonth)){prev=$("<a>").attr({
class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:prevText}
).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")).text(prevText))[0
].outerHTML}else if(hideIfNoPrevNext){prev=""}else{prev=$("<a>").attr({
class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:prevText}).append($("<span>"
).addClass("ui-icon ui-icon-circle-triangle-"+(isRTL?"e":"w")).text(prevText))[0].outerHTML}
nextText=this._get(inst,"nextText");nextText=!navigationAsDateFormat?nextText:this.formatDate(
nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),
this._getFormatConfig(inst));if(this._canAdjustMonth(inst,+1,drawYear,drawMonth)){next=$("<a>"
).attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",
title:nextText}).append($("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")
).text(nextText))[0].outerHTML}else if(hideIfNoPrevNext){next=""}else{next=$("<a>").attr({
class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:nextText}).append($("<span>").attr(
"class","ui-icon ui-icon-circle-triangle-"+(isRTL?"w":"e")).text(nextText))[0].outerHTML}
currentText=this._get(inst,"currentText");gotoDate=this._get(inst,"gotoCurrent"
)&&inst.currentDay?currentDate:today;
currentText=!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,
this._getFormatConfig(inst));controls="";if(!inst.inline){controls=$("<button>").attr({
type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
"data-handler":"hide","data-event":"click"}).text(this._get(inst,"closeText"))[0].outerHTML}
buttonPanel="";if(showButtonPanel){buttonPanel=$(
"<div class='ui-datepicker-buttonpane ui-widget-content'>").append(isRTL?controls:"").append(
this._isInRange(inst,gotoDate)?$("<button>").attr({type:"button",
class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",
"data-handler":"today","data-event":"click"}).text(currentText):"").append(isRTL?"":controls)[0
].outerHTML}firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=isNaN(firstDay)?0:firstDay;
showWeek=this._get(inst,"showWeek");dayNames=this._get(inst,"dayNames");dayNamesMin=this._get(inst,
"dayNamesMin");monthNames=this._get(inst,"monthNames");monthNamesShort=this._get(inst,
"monthNamesShort");beforeShowDay=this._get(inst,"beforeShowDay");showOtherMonths=this._get(inst,
"showOtherMonths");selectOtherMonths=this._get(inst,"selectOtherMonths");
defaultDate=this._getDefaultDate(inst);html="";for(row=0;row<numMonths[0];row++){group="";
this.maxRows=4;for(col=0;col<numMonths[1];col++){selectedDate=this._daylightSavingAdjust(new Date(
drawYear,drawMonth,inst.selectedDay));cornerClass=" ui-corner-all";calender="";if(isMultiMonth){
calender+="<div class='ui-datepicker-group";if(numMonths[1]>1){switch(col){case 0:
calender+=" ui-datepicker-group-first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;
case numMonths[1]-1:calender+=" ui-datepicker-group-last";cornerClass=" ui-corner-"+(
isRTL?"left":"right");break;default:calender+=" ui-datepicker-group-middle";cornerClass="";break}}
calender+="'>"}
calender+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+cornerClass+"'>"+(
/all|left/.test(cornerClass)&&row===0?isRTL?next:prev:"")+(/all|right/.test(cornerClass
)&&row===0?isRTL?prev:next:"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate
,row>0||col>0,monthNames,monthNamesShort
)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>";
thead=showWeek?"<th class='ui-datepicker-week-col'>"+this._get(inst,"weekHeader")+"</th>":"";for(
dow=0;dow<7;dow++){day=(dow+firstDay)%7;thead+="<th scope='col'"+((dow+firstDay+6
)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+dayNames[day]+"'>"+dayNamesMin[day
]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";daysInMonth=this._getDaysInMonth(drawYear,
drawMonth);if(drawYear===inst.selectedYear&&drawMonth===inst.selectedMonth){
inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}leadDays=(this._getFirstDayOfMonth(drawYear,
drawMonth)-firstDay+7)%7;curRows=Math.ceil((leadDays+daysInMonth)/7);
numRows=isMultiMonth?this.maxRows>curRows?this.maxRows:curRows:curRows;this.maxRows=numRows;
printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(
dRow=0;dRow<numRows;dRow++){calender+="<tr>";
tbody=!showWeek?"":"<td class='ui-datepicker-week-col'>"+this._get(inst,"calculateWeek")(printDate
)+"</td>";for(dow=0;dow<7;dow++){daySettings=beforeShowDay?beforeShowDay.apply(
inst.input?inst.input[0]:null,[printDate]):[true,""];otherMonth=printDate.getMonth()!==drawMonth;
unselectable=otherMonth&&!selectOtherMonths||!daySettings[0
]||minDate&&printDate<minDate||maxDate&&printDate>maxDate;tbody+="<td class='"+((dow+firstDay+6
)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+(
printDate.getTime()===selectedDate.getTime(
)&&drawMonth===inst.selectedMonth&&inst._keyEvent||defaultDate.getTime()===printDate.getTime(
)&&defaultDate.getTime()===selectedDate.getTime()?" "+this._dayOverClass:"")+(
unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(
otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()===currentDate.getTime(
)?" "+this._currentClass:"")+(printDate.getTime()===today.getTime()?" ui-datepicker-today":"")
)+"'"+((!otherMonth||showOtherMonths)&&daySettings[2]?" title='"+daySettings[2].replace(/'/g,"&#39;"
)+"'":"")+(
unselectable?"":" data-handler='selectDay' data-event='click' data-month='"+printDate.getMonth(
)+"' data-year='"+printDate.getFullYear()+"'")+">"+(
otherMonth&&!showOtherMonths?"&#xa0;":unselectable?"<span class='ui-state-default'>"+printDate.getDate(
)+"</span>":"<a class='ui-state-default"+(printDate.getTime()===today.getTime(
)?" ui-state-highlight":"")+(printDate.getTime()===currentDate.getTime()?" ui-state-active":"")+(
otherMonth?" ui-priority-secondary":"")+"' href='#' aria-current='"+(printDate.getTime(
)===currentDate.getTime()?"true":"false")+"' data-date='"+printDate.getDate(
)+"'>"+printDate.getDate()+"</a>")+"</td>";printDate.setDate(printDate.getDate()+1);
printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11
){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+(numMonths[0
]>0&&col===numMonths[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"");group+=calender}
html+=group}html+=buttonPanel;inst._keyEvent=false;return html},_generateMonthYearHeader:function(
inst,drawMonth,drawYear,minDate,maxDate,secondary,monthNames,monthNamesShort){var inMinYear,
inMaxYear,month,years,thisYear,determineYear,year,endYear,changeMonth=this._get(inst,"changeMonth"),
changeYear=this._get(inst,"changeYear"),showMonthAfterYear=this._get(inst,"showMonthAfterYear"),
selectMonthLabel=this._get(inst,"selectMonthLabel"),selectYearLabel=this._get(inst,"selectYearLabel"
),html="<div class='ui-datepicker-title'>",monthHtml="";if(secondary||!changeMonth){
monthHtml+="<span class='ui-datepicker-month'>"+monthNames[drawMonth]+"</span>"}else{
inMinYear=minDate&&minDate.getFullYear()===drawYear;inMaxYear=maxDate&&maxDate.getFullYear(
)===drawYear;
monthHtml+="<select class='ui-datepicker-month' aria-label='"+selectMonthLabel+"' data-handler='selectMonth' data-event='change'>"
for(month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(
!inMaxYear||month<=maxDate.getMonth())){monthHtml+="<option value='"+month+"'"+(
month===drawMonth?" selected='selected'":"")+">"+monthNamesShort[month]+"</option>"}}
monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+(secondary||!(changeMonth&&changeYear
)?"&#xa0;":"")}if(!inst.yearshtml){inst.yearshtml="";if(secondary||!changeYear){
html+="<span class='ui-datepicker-year'>"+drawYear+"</span>"}else{years=this._get(inst,"yearRange"
).split(":");thisYear=(new Date).getFullYear();determineYear=function(value){var year=value.match(
/c[+\-].*/)?drawYear+parseInt(value.substring(1),10):value.match(/[+\-].*/)?thisYear+parseInt(value,
10):parseInt(value,10);return isNaN(year)?thisYear:year};year=determineYear(years[0]);
endYear=Math.max(year,determineYear(years[1]||""));year=minDate?Math.max(year,minDate.getFullYear()
):year;endYear=maxDate?Math.min(endYear,maxDate.getFullYear()):endYear;
inst.yearshtml+="<select class='ui-datepicker-year' aria-label='"+selectYearLabel+"' data-handler='selectYear' data-event='change'>"
for(;year<=endYear;year++){inst.yearshtml+="<option value='"+year+"'"+(
year===drawYear?" selected='selected'":"")+">"+year+"</option>"}inst.yearshtml+="</select>";
html+=inst.yearshtml;inst.yearshtml=null}}html+=this._get(inst,"yearSuffix");if(showMonthAfterYear){
html+=(secondary||!(changeMonth&&changeYear)?"&#xa0;":"")+monthHtml}html+="</div>";return html},
_adjustInstDate:function(inst,offset,period){var year=inst.selectedYear+(period==="Y"?offset:0),
month=inst.selectedMonth+(period==="M"?offset:0),day=Math.min(inst.selectedDay,this._getDaysInMonth(
year,month))+(period==="D"?offset:0),date=this._restrictMinMax(inst,this._daylightSavingAdjust(
new Date(year,month,day)));inst.selectedDay=date.getDate();
inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()
if(period==="M"||period==="Y"){this._notifyChange(inst)}},_restrictMinMax:function(inst,date){
var minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),
newDate=minDate&&date<minDate?minDate:date;return maxDate&&newDate>maxDate?maxDate:newDate},
_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){
onChange.apply(inst.input?inst.input[0]:null,[inst.selectedYear,inst.selectedMonth+1,inst])}},
_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");
return numMonths==null?[1,1]:typeof numMonths==="number"?[1,numMonths]:numMonths},
_getMinMaxDate:function(inst,minMax){return this._determineDate(inst,this._get(inst,minMax+"Date"),
null)},_getDaysInMonth:function(year,month){return 32-this._daylightSavingAdjust(new Date(year,month
,32)).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},
_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst),
date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[0]*numMonths[1]
),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}
return this._isInRange(inst,date)},_isInRange:function(inst,date){var yearSplit,currentYear,
minDate=this._getMinMaxDate(inst,"min"),maxDate=this._getMinMaxDate(inst,"max"),minYear=null,
maxYear=null,years=this._get(inst,"yearRange");if(years){yearSplit=years.split(":");currentYear=(
new Date).getFullYear();minYear=parseInt(yearSplit[0],10);maxYear=parseInt(yearSplit[1],10);if(
yearSplit[0].match(/[+\-].*/)){minYear+=currentYear}if(yearSplit[1].match(/[+\-].*/)){
maxYear+=currentYear}}return(!minDate||date.getTime()>=minDate.getTime())&&(!maxDate||date.getTime(
)<=maxDate.getTime())&&(!minYear||date.getFullYear()>=minYear)&&(!maxYear||date.getFullYear(
)<=maxYear)},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");
shortYearCutoff=typeof shortYearCutoff!=="string"?shortYearCutoff:(new Date).getFullYear(
)%100+parseInt(shortYearCutoff,10);return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(
inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,
"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,
year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;
inst.currentYear=inst.selectedYear}
var date=day?typeof day==="object"?day:this._daylightSavingAdjust(new Date(year,month,day)
):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));
return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});
function datepicker_bindHover(dpDiv){
var selector="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
return dpDiv.on("mouseout",selector,function(){$(this).removeClass("ui-state-hover");if(
this.className.indexOf("ui-datepicker-prev")!==-1){$(this).removeClass("ui-datepicker-prev-hover")}
if(this.className.indexOf("ui-datepicker-next")!==-1){$(this).removeClass("ui-datepicker-next-hover"
)}}).on("mouseover",selector,datepicker_handleMouseover)}function datepicker_handleMouseover(){if(
!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline?datepicker_instActive.dpDiv.parent(
)[0]:datepicker_instActive.input[0])){$(this).parents(".ui-datepicker-calendar").find("a"
).removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf(
"ui-datepicker-prev")!==-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf(
"ui-datepicker-next")!==-1){$(this).addClass("ui-datepicker-next-hover")}}}
function datepicker_extendRemove(target,props){$.extend(target,props);for(var name in props){if(
props[name]==null){target[name]=props[name]}}return target}$.fn.datepicker=function(options){if(
!this.length){return this}if(!$.datepicker.initialized){$(document).on("mousedown",
$.datepicker._checkExternalClick);$.datepicker.initialized=true}if($("#"+$.datepicker._mainDivId
).length===0){$("body").append($.datepicker.dpDiv)}var otherArgs=Array.prototype.slice.call(
arguments,1);if(typeof options==="string"&&(
options==="isDisabled"||options==="getDate"||options==="widget")){return $.datepicker[
"_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(
options==="option"&&arguments.length===2&&typeof arguments[1]==="string"){return $.datepicker[
"_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(
){if(typeof options==="string"){$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this
].concat(otherArgs))}else{$.datepicker._attachDatepicker(this,options)}})};
$.datepicker=new Datepicker;$.datepicker.initialized=false;$.datepicker.uuid=(new Date).getTime();
$.datepicker.version="1.13.2";var widgetsDatepicker=$.datepicker;
var ie=$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var mouseHandled=false;$(
document).on("mouseup",function(){mouseHandled=false});var widgetsMouse=$.widget("ui.mouse",{
version:"1.13.2",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},
_mouseInit:function(){var that=this;this.element.on("mousedown."+this.widgetName,function(event){
return that._mouseDown(event)}).on("click."+this.widgetName,function(event){if(true===$.data(
event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,
that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return false}});
this.started=false},_mouseDestroy:function(){this.element.off("."+this.widgetName);if(
this._mouseMoveDelegate){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate
).off("mouseup."+this.widgetName,this._mouseUpDelegate)}},_mouseDown:function(event){if(mouseHandled
){return}this._mouseMoved=false;if(this._mouseStarted){this._mouseUp(event)}
this._mouseDownEvent=event;var that=this,btnIsLeft=event.which===1,
elIsCancel=typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(
this.options.cancel).length:false;if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true
}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(
function(){that.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(event
)&&this._mouseDelayMet(event)){this._mouseStarted=this._mouseStart(event)!==false;if(
!this._mouseStarted){event.preventDefault();return true}}if(true===$.data(event.target,
this.widgetName+".preventClickEvent")){$.removeData(event.target,
this.widgetName+".preventClickEvent")}this._mouseMoveDelegate=function(event){
return that._mouseMove(event)};this._mouseUpDelegate=function(event){return that._mouseUp(event)};
this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName
,this._mouseUpDelegate);event.preventDefault();mouseHandled=true;return true},_mouseMove:function(
event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9
)&&!event.button){return this._mouseUp(event)}else if(!event.which){if(
event.originalEvent.altKey||event.originalEvent.ctrlKey||event.originalEvent.metaKey||event.originalEvent.shiftKey
){this.ignoreMissingWhich=true}else if(!this.ignoreMissingWhich){return this._mouseUp(event)}}}if(
event.which||event.button){this._mouseMoved=true}if(this._mouseStarted){this._mouseDrag(event);
return event.preventDefault()}if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){
this._mouseStarted=this._mouseStart(this._mouseDownEvent,event)!==false;if(this._mouseStarted){
this._mouseDrag(event)}else{this._mouseUp(event)}}return!this._mouseStarted},_mouseUp:function(event
){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off(
"mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;
if(event.target===this._mouseDownEvent.target){$.data(event.target,
this.widgetName+".preventClickEvent",true)}this._mouseStop(event)}if(this._mouseDelayTimer){
clearTimeout(this._mouseDelayTimer);delete this._mouseDelayTimer}this.ignoreMissingWhich=false;
mouseHandled=false;event.preventDefault()},_mouseDistanceMet:function(event){return Math.max(
Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY)
)>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(
){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}});
var plugin=$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(
i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]])}},
call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(!set){return
}if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0
].parentNode.nodeType===11)){return}for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i
][1].apply(instance.element,args)}}}};var safeBlur=$.ui.safeBlur=function(element){if(
element&&element.nodeName.toLowerCase()!=="body"){$(element).trigger("blur")}};$.widget(
"ui.draggable",$.ui.mouse,{version:"1.13.2",widgetEventPrefix:"drag",options:{addClasses:true,
appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,
grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,
revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,
snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null
},_create:function(){if(this.options.helper==="original"){this._setPositionRelative()}if(
this.options.addClasses){this._addClass("ui-draggable")}this._setHandleClassName();this._mouseInit()
},_setOption:function(key,value){this._super(key,value);if(key==="handle"){
this._removeHandleClassName();this._setHandleClassName()}},_destroy:function(){if((
this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return}
this._removeHandleClassName();this._mouseDestroy()},_mouseCapture:function(event){var o=this.options
if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0){return false}
this.handle=this._getHandle(event);if(!this.handle){return false}this._blurActiveElement(event);
this._blockFrames(o.iframeFix===true?"iframe":o.iframeFix);return true},_blockFrames:function(
selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $(
"<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()
).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0]})},_unblockFrames:function(){if(
this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks}},
_blurActiveElement:function(event){var activeElement=$.ui.safeActiveElement(this.document[0]),
target=$(event.target);if(target.closest(activeElement).length){return}$.ui.safeBlur(activeElement)
},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);
this._addClass(this.helper,"ui-draggable-dragging");this._cacheHelperProportions();if($.ui.ddmanager
){$.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");
this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();
this.hasFixedAncestor=this.helper.parents().filter(function(){return $(this).css("position"
)==="fixed"}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(event);
this.originalPosition=this.position=this._generatePosition(event,false);
this.originalPageX=event.pageX;this.originalPageY=event.pageY;if(o.cursorAt){
this._adjustOffsetFromHelper(o.cursorAt)}this._setContainment();if(this._trigger("start",event
)===false){this._clear();return false}this._cacheHelperProportions();if(
$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}this._mouseDrag(event,
true);if($.ui.ddmanager){$.ui.ddmanager.dragStart(this,event)}return true},_refreshOffsets:function(
event){this.offset={top:this.positionAbs.top-this.margins.top,
left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),
relative:this._getRelativeOffset()};this.offset.click={left:event.pageX-this.offset.left,
top:event.pageY-this.offset.top}},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor
){this.offset.parent=this._getParentOffset()}this.position=this._generatePosition(event,true);
this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(
this._trigger("drag",event,ui)===false){this._mouseUp(new $.Event("mouseup",event));return false}
this.position=ui.position}this.helper[0].style.left=this.position.left+"px";this.helper[0
].style.top=this.position.top+"px";if($.ui.ddmanager){$.ui.ddmanager.drag(this,event)}return false},
_mouseStop:function(event){var that=this,dropped=false;if(
$.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event)}if(this.dropped
){dropped=this.dropped;this.dropped=false}if(
this.options.revert==="invalid"&&!dropped||this.options.revert==="valid"&&dropped||this.options.revert===true||typeof this.options.revert==="function"&&this.options.revert.call(
this.element,dropped)){$(this.helper).animate(this.originalPosition,parseInt(
this.options.revertDuration,10),function(){if(that._trigger("stop",event)!==false){that._clear()}})
}else{if(this._trigger("stop",event)!==false){this._clear()}}return false},_mouseUp:function(event){
this._unblockFrames();if($.ui.ddmanager){$.ui.ddmanager.dragStop(this,event)}if(
this.handleElement.is(event.target)){this.element.trigger("focus")}
return $.ui.mouse.prototype._mouseUp.call(this,event)},cancel:function(){if(this.helper.is(
".ui-draggable-dragging")){this._mouseUp(new $.Event("mouseup",{target:this.element[0]}))}else{
this._clear()}return this},_getHandle:function(event){return this.options.handle?!!$(event.target
).closest(this.element.find(this.options.handle)).length:true},_setHandleClassName:function(){
this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;
this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){
this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(event){
var o=this.options,helperIsFunction=typeof o.helper==="function",helper=helperIsFunction?$(
o.helper.apply(this.element[0],[event])):o.helper==="clone"?this.element.clone().removeAttr("id"
):this.element;if(!helper.parents("body").length){helper.appendTo(
o.appendTo==="parent"?this.element[0].parentNode:o.appendTo)}if(helperIsFunction&&helper[0
]===this.element[0]){this._setPositionRelative()}if(helper[0]!==this.element[0
]&&!/(fixed|absolute)/.test(helper.css("position"))){helper.css("position","absolute")}return helper
},_setPositionRelative:function(){if(!/^(?:r|a|f)/.test(this.element.css("position"))){this.element[
0].style.position="relative"}},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){
obj=obj.split(" ")}if(Array.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0}}if("left"in obj){
this.offset.click.left=obj.left+this.margins.left}if("right"in obj){
this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}if("top"in obj){
this.offset.click.top=obj.top+this.margins.top}if("bottom"in obj){
this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},
_isRootNode:function(element){return/(html|body)/i.test(element.tagName)||element===this.document[0]
},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];if(
this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],
this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()
}if(this._isRootNode(this.offsetParent[0])){po={top:0,left:0}}return{top:po.top+(parseInt(
this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css(
"borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{
top:0,left:0}}var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);
return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(
!scrollIsRootNode?this.scrollParent.scrollTop():0),left:p.left-(parseInt(this.helper.css("left"),10
)||0)+(!scrollIsRootNode?this.scrollParent.scrollLeft():0)}},_cacheMargins:function(){this.margins={
left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10
)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css(
"marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={
width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){
var isUserScrollable,c,ce,o=this.options,document=this.document[0];this.relativeContainer=null;if(
!o.containment){this.containment=null;return}if(o.containment==="window"){this.containment=[$(window
).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop(
)-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width(
)-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height(
)||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(
o.containment==="document"){this.containment=[0,0,$(document).width(
)-this.helperProportions.width-this.margins.left,($(document).height(
)||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(
o.containment.constructor===Array){this.containment=o.containment;return}if(o.containment==="parent"
){o.containment=this.helper[0].parentNode}c=$(o.containment);ce=c[0];if(!ce){return}
isUserScrollable=/(scroll|auto)/.test(c.css("overflow"));this.containment=[(parseInt(c.css(
"borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),
10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,
ce.offsetWidth):ce.offsetWidth)-(parseInt(c.css("borderRightWidth"),10)||0)-(parseInt(c.css(
"paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(
isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt(c.css(
"borderBottomWidth"),10)||0)-(parseInt(c.css("paddingBottom"),10)||0
)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relativeContainer=c},
_convertPositionTo:function(d,pos){if(!pos){pos=this.position}var mod=d==="absolute"?1:-1,
scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{
top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-(
this.cssPosition==="fixed"?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top)*mod,
left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-(
this.cssPosition==="fixed"?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)*mod}
},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,
scrollIsRootNode=this._isRootNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;if(
!scrollIsRootNode||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),
left:this.scrollParent.scrollLeft()}}if(constrainPosition){if(this.containment){if(
this.relativeContainer){co=this.relativeContainer.offset();containment=[this.containment[0]+co.left,
this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top]}else{
containment=this.containment}if(event.pageX-this.offset.click.left<containment[0]){
pageX=containment[0]+this.offset.click.left}if(event.pageY-this.offset.click.top<containment[1]){
pageY=containment[1]+this.offset.click.top}if(event.pageX-this.offset.click.left>containment[2]){
pageX=containment[2]+this.offset.click.left}if(event.pageY-this.offset.click.top>containment[3]){
pageY=containment[3]+this.offset.click.top}}if(o.grid){top=o.grid[1]?this.originalPageY+Math.round((
pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;
pageY=containment?top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3
]?top:top-this.offset.click.top>=containment[1]?top-o.grid[1]:top+o.grid[1]:top;left=o.grid[0
]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;
pageX=containment?left-this.offset.click.left>=containment[0
]||left-this.offset.click.left>containment[2]?left:left-this.offset.click.left>=containment[0
]?left-o.grid[0]:left+o.grid[0]:left}if(o.axis==="y"){pageX=this.originalPageX}if(o.axis==="x"){
pageY=this.originalPageY}}return{
top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(
this.cssPosition==="fixed"?-this.offset.scroll.top:scrollIsRootNode?0:this.offset.scroll.top),
left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(
this.cssPosition==="fixed"?-this.offset.scroll.left:scrollIsRootNode?0:this.offset.scroll.left)}},
_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging");if(this.helper[0
]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;
this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy()}},_trigger:function(type,event
,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui,this],true);if(
/^(drag|start|stop)/.test(type)){this.positionAbs=this._convertPositionTo("absolute");
ui.offset=this.positionAbs}return $.Widget.prototype._trigger.call(this,type,event,ui)},plugins:{},
_uiHash:function(){return{helper:this.helper,position:this.position,
originalPosition:this.originalPosition,offset:this.positionAbs}}});$.ui.plugin.add("draggable",
"connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{
item:draggable.element});draggable.sortables=[];$(draggable.options.connectToSortable).each(
function(){var sortable=$(this).sortable("instance");if(sortable&&!sortable.options.disabled){
draggable.sortables.push(sortable);sortable.refreshPositions();sortable._trigger("activate",event,
uiSortable)}})},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{
item:draggable.element});draggable.cancelHelperRemoval=false;$.each(draggable.sortables,function(){
var sortable=this;if(sortable.isOver){sortable.isOver=0;draggable.cancelHelperRemoval=true;
sortable.cancelHelperRemoval=false;sortable._storedCSS={position:sortable.placeholder.css("position"
),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")};sortable._mouseStop(
event);sortable.options.helper=sortable.options._helper}else{sortable.cancelHelperRemoval=true;
sortable._trigger("deactivate",event,uiSortable)}})},drag:function(event,ui,draggable){$.each(
draggable.sortables,function(){var innermostIntersecting=false,sortable=this;
sortable.positionAbs=draggable.positionAbs;sortable.helperProportions=draggable.helperProportions;
sortable.offset.click=draggable.offset.click;if(sortable._intersectsWith(sortable.containerCache)){
innermostIntersecting=true;$.each(draggable.sortables,function(){
this.positionAbs=draggable.positionAbs;this.helperProportions=draggable.helperProportions;
this.offset.click=draggable.offset.click;if(this!==sortable&&this._intersectsWith(
this.containerCache)&&$.contains(sortable.element[0],this.element[0])){innermostIntersecting=false}
return innermostIntersecting})}if(innermostIntersecting){if(!sortable.isOver){sortable.isOver=1;
draggable._parent=ui.helper.parent();sortable.currentItem=ui.helper.appendTo(sortable.element).data(
"ui-sortable-item",true);sortable.options._helper=sortable.options.helper;
sortable.options.helper=function(){return ui.helper[0]};event.target=sortable.currentItem[0];
sortable._mouseCapture(event,true);sortable._mouseStart(event,true,true);
sortable.offset.click.top=draggable.offset.click.top;
sortable.offset.click.left=draggable.offset.click.left;
sortable.offset.parent.left-=draggable.offset.parent.left-sortable.offset.parent.left;
sortable.offset.parent.top-=draggable.offset.parent.top-sortable.offset.parent.top;
draggable._trigger("toSortable",event);draggable.dropped=sortable.element;$.each(draggable.sortables
,function(){this.refreshPositions()});draggable.currentItem=draggable.element;
sortable.fromOutside=draggable}if(sortable.currentItem){sortable._mouseDrag(event);
ui.position=sortable.position}}else{if(sortable.isOver){sortable.isOver=0;
sortable.cancelHelperRemoval=true;sortable.options._revert=sortable.options.revert;
sortable.options.revert=false;sortable._trigger("out",event,sortable._uiHash(sortable));
sortable._mouseStop(event,true);sortable.options.revert=sortable.options._revert;
sortable.options.helper=sortable.options._helper;if(sortable.placeholder){
sortable.placeholder.remove()}ui.helper.appendTo(draggable._parent);draggable._refreshOffsets(event)
ui.position=draggable._generatePosition(event,true);draggable._trigger("fromSortable",event);
draggable.dropped=false;$.each(draggable.sortables,function(){this.refreshPositions()})}}})}});
$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),
o=instance.options;if(t.css("cursor")){o._cursor=t.css("cursor")}t.css("cursor",o.cursor)},
stop:function(event,ui,instance){var o=instance.options;if(o._cursor){$("body").css("cursor",
o._cursor)}}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(
ui.helper),o=instance.options;if(t.css("opacity")){o._opacity=t.css("opacity")}t.css("opacity",
o.opacity)},stop:function(event,ui,instance){var o=instance.options;if(o._opacity){$(ui.helper).css(
"opacity",o._opacity)}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){if(
!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false)}if(
i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){
i.overflowOffset=i.scrollParentNotHidden.offset()}},drag:function(event,ui,i){var o=i.options,
scrolled=false,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];if(
scrollParent!==document&&scrollParent.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if(
i.overflowOffset.top+scrollParent.offsetHeight-event.pageY<o.scrollSensitivity){
scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed}else if(
event.pageY-i.overflowOffset.top<o.scrollSensitivity){
scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed}}if(!o.axis||o.axis!=="y"){if(
i.overflowOffset.left+scrollParent.offsetWidth-event.pageX<o.scrollSensitivity){
scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed}else if(
event.pageX-i.overflowOffset.left<o.scrollSensitivity){
scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed}}}else{if(
!o.axis||o.axis!=="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(
document).scrollTop($(document).scrollTop()-o.scrollSpeed)}else if($(window).height()-(
event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document
).scrollTop()+o.scrollSpeed)}}if(!o.axis||o.axis!=="y"){if(event.pageX-$(document).scrollLeft(
)<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed)
}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(
document).scrollLeft($(document).scrollLeft()+o.scrollSpeed)}}}if(
scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event)}}});
$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[];$(
o.snap.constructor!==String?o.snap.items||":data(ui-draggable)":o.snap).each(function(){var $t=$(
this),$o=$t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),
height:$t.outerHeight(),top:$o.top,left:$o.left})}})},drag:function(event,ui,inst){var ts,bs,ls,rs,l
,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width
,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--){
l=inst.snapElements[i].left-inst.margins.left;r=l+inst.snapElements[i].width;t=inst.snapElements[i
].top-inst.margins.top;b=t+inst.snapElements[i].height;if(
x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,
inst.snapElements[i].item)){if(inst.snapElements[i].snapping){if(inst.options.snap.release){
inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{
snapItem:inst.snapElements[i].item}))}}inst.snapElements[i].snapping=false;continue}if(
o.snapMode!=="inner"){ts=Math.abs(t-y2)<=d;bs=Math.abs(b-y1)<=d;ls=Math.abs(l-x2)<=d;rs=Math.abs(
r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{
top:t-inst.helperProportions.height,left:0}).top}if(bs){ui.position.top=inst._convertPositionTo(
"relative",{top:b,left:0}).top}if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,
left:l-inst.helperProportions.width}).left}if(rs){ui.position.left=inst._convertPositionTo(
"relative",{top:0,left:r}).left}}first=ts||bs||ls||rs;if(o.snapMode!=="outer"){ts=Math.abs(t-y1)<=d;
bs=Math.abs(b-y2)<=d;ls=Math.abs(l-x1)<=d;rs=Math.abs(r-x2)<=d;if(ts){
ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top}if(bs){
ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top
}if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left}if(rs){
ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}
).left}}if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){if(inst.options.snap.snap){
inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i
].item}))}}inst.snapElements[i].snapping=ts||bs||ls||rs||first}}});$.ui.plugin.add("draggable",
"stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)
).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0)
});if(!group.length){return}min=parseInt($(group[0]).css("zIndex"),10)||0;$(group).each(function(i){
$(this).css("zIndex",min+i)});this.css("zIndex",min+group.length)}});$.ui.plugin.add("draggable",
"zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("zIndex")
){o._zIndex=t.css("zIndex")}t.css("zIndex",o.zIndex)},stop:function(event,ui,instance){
var o=instance.options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex)}}});
var widgetsDraggable=$.ui.draggable;$.widget("ui.resizable",$.ui.mouse,{version:"1.13.2",
widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",
animateEasing:"swing",aspectRatio:false,autoHide:false,classes:{
"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:false,ghost:false,grid:false,
handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,
resize:null,start:null,stop:null},_num:function(value){return parseFloat(value)||0},
_isNumber:function(value){return!isNaN(parseFloat(value))},_hasScroll:function(el,a){if($(el).css(
"overflow")==="hidden"){return false}var scroll=a&&a==="left"?"scrollLeft":"scrollTop",has=false;if(
el[scroll]>0){return true}try{el[scroll]=1;has=el[scroll]>0;el[scroll]=0}catch(e){}return has},
_create:function(){var margins,o=this.options,that=this;this._addClass("ui-resizable");$.extend(this
,{_aspectRatio:!!o.aspectRatio,aspectRatio:o.aspectRatio,originalElement:this.element,
_proportionallyResizeElements:[],
_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0
].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap($(
"<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),
width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),
left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",
this.element.resizable("instance"));this.elementIsWrapper=true;margins={
marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),
marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css(
"marginLeft")};this.element.css(margins);this.originalElement.css("margin",0);
this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none"
);this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,
display:"block"}));this.originalElement.css(margins);this._proportionallyResize()}
this._setupHandles();if(o.autoHide){$(this.element).on("mouseenter",function(){if(o.disabled){return
}that._removeClass("ui-resizable-autohide");that._handles.show()}).on("mouseleave",function(){if(
o.disabled){return}if(!that.resizing){that._addClass("ui-resizable-autohide");that._handles.hide()}}
)}this._mouseInit()},_destroy:function(){this._mouseDestroy();this._addedHandles.remove();
var wrapper,_destroy=function(exp){$(exp).removeData("resizable").removeData("ui-resizable").off(
".resizable")};if(this.elementIsWrapper){_destroy(this.element);wrapper=this.element;
this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),
height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper);
wrapper.remove()}this.originalElement.css("resize",this.originalResizeStyle);_destroy(
this.originalElement);return this},_setOption:function(key,value){this._super(key,value);switch(key
){case"handles":this._removeHandles();this._setupHandles();break;case"aspectRatio":
this._aspectRatio=!!value;break;default:break}},_setupHandles:function(){var o=this.options,handle,i
,n,hname,axis,that=this;this.handles=o.handles||(!$(".ui-resizable-handle",this.element
).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",
se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});
this._handles=$();this._addedHandles=$();if(this.handles.constructor===String){if(
this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw"}n=this.handles.split(",");this.handles={};
for(i=0;i<n.length;i++){handle=String.prototype.trim.call(n[i]);hname="ui-resizable-"+handle;axis=$(
"<div>");this._addClass(axis,"ui-resizable-handle "+hname);axis.css({zIndex:o.zIndex});this.handles[
handle]=".ui-resizable-"+handle;if(!this.element.children(this.handles[handle]).length){
this.element.append(axis);this._addedHandles=this._addedHandles.add(axis)}}}
this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(
i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=this.element.children(
this.handles[i]).first().show()}else if(this.handles[i].jquery||this.handles[i].nodeType){
this.handles[i]=$(this.handles[i]);this._on(this.handles[i],{mousedown:that._mouseDown})}if(
this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){
axis=$(this.handles[i],this.element);padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight(
):axis.outerWidth();padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(
i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize()}
this._handles=this._handles.add(this.handles[i])}};this._renderAxis(this.element);
this._handles=this._handles.add(this.element.find(".ui-resizable-handle"));
this._handles.disableSelection();this._handles.on("mouseover",function(){if(!that.resizing){if(
this.className){axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}
that.axis=axis&&axis[1]?axis[1]:"se"}});if(o.autoHide){this._handles.hide();this._addClass(
"ui-resizable-autohide")}},_removeHandles:function(){this._addedHandles.remove()},
_mouseCapture:function(event){var i,handle,capture=false;for(i in this.handles){handle=$(
this.handles[i])[0];if(handle===event.target||$.contains(handle,event.target)){capture=true}}
return!this.options.disabled&&capture},_mouseStart:function(event){var curleft,curtop,cursor,
o=this.options,el=this.element;this.resizing=true;this._renderProxy();curleft=this._num(
this.helper.css("left"));curtop=this._num(this.helper.css("top"));if(o.containment){curleft+=$(
o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0}
this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{
width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()};
this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),
height:el.height()};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight(
)-el.height()};this.originalPosition={left:curleft,top:curtop};this.originalMousePosition={
left:event.pageX,top:event.pageY};
this.aspectRatio=typeof o.aspectRatio==="number"?o.aspectRatio:this.originalSize.width/this.originalSize.height||1
cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",
cursor==="auto"?this.axis+"-resize":cursor);this._addClass("ui-resizable-resizing");this._propagate(
"start",event);return true},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition
,a=this.axis,dx=event.pageX-smp.left||0,dy=event.pageY-smp.top||0,trigger=this._change[a];
this._updatePrevProperties();if(!trigger){return false}data=trigger.apply(this,[event,dx,dy]);
this._updateVirtualBoundaries(event.shiftKey);if(this._aspectRatio||event.shiftKey){
data=this._updateRatio(data,event)}data=this._respectSize(data,event);this._updateCache(data);
this._propagate("resize",event);props=this._applyChanges();if(
!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}if(
!$.isEmptyObject(props)){this._updatePrevProperties();this._trigger("resize",event,this.ui());
this._applyChanges()}return false},_mouseStop:function(event){this.resizing=false;var pr,ista,
soffseth,soffsetw,s,left,top,o=this.options,that=this;if(this._helper){
pr=this._proportionallyResizeElements;ista=pr.length&&/textarea/i.test(pr[0].nodeName);
soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height;
soffsetw=ista?0:that.sizeDiff.width;s={width:that.helper.width()-soffsetw,height:that.helper.height(
)-soffseth};left=parseFloat(that.element.css("left"))+(that.position.left-that.originalPosition.left
)||null;top=parseFloat(that.element.css("top"))+(that.position.top-that.originalPosition.top)||null;
if(!o.animate){this.element.css($.extend(s,{top:top,left:left}))}that.helper.height(that.size.height
);that.helper.width(that.size.width);if(this._helper&&!o.animate){this._proportionallyResize()}}$(
"body").css("cursor","auto");this._removeClass("ui-resizable-resizing");this._propagate("stop",event
);if(this._helper){this.helper.remove()}return false},_updatePrevProperties:function(){
this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={
width:this.size.width,height:this.size.height}},_applyChanges:function(){var props={};if(
this.position.top!==this.prevPosition.top){props.top=this.position.top+"px"}if(
this.position.left!==this.prevPosition.left){props.left=this.position.left+"px"}if(
this.size.width!==this.prevSize.width){props.width=this.size.width+"px"}if(
this.size.height!==this.prevSize.height){props.height=this.size.height+"px"}this.helper.css(props);
return props},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight
,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,
maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight
)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(
this._aspectRatio||forceAspectRatio){pMinWidth=b.minHeight*this.aspectRatio;
pMinHeight=b.minWidth/this.aspectRatio;pMaxWidth=b.maxHeight*this.aspectRatio;
pMaxHeight=b.maxWidth/this.aspectRatio;if(pMinWidth>b.minWidth){b.minWidth=pMinWidth}if(
pMinHeight>b.minHeight){b.minHeight=pMinHeight}if(pMaxWidth<b.maxWidth){b.maxWidth=pMaxWidth}if(
pMaxHeight<b.maxHeight){b.maxHeight=pMaxHeight}}this._vBoundaries=b},_updateCache:function(data){
this.offset=this.helper.offset();if(this._isNumber(data.left)){this.position.left=data.left}if(
this._isNumber(data.top)){this.position.top=data.top}if(this._isNumber(data.height)){
this.size.height=data.height}if(this._isNumber(data.width)){this.size.width=data.width}},
_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;if(this._isNumber(
data.height)){data.width=data.height*this.aspectRatio}else if(this._isNumber(data.width)){
data.height=data.width/this.aspectRatio}if(a==="sw"){data.left=cpos.left+(csize.width-data.width);
data.top=null}if(a==="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(
csize.width-data.width)}return data},_respectSize:function(data){var o=this._vBoundaries,a=this.axis
,ismaxw=this._isNumber(data.width)&&o.maxWidth&&o.maxWidth<data.width,ismaxh=this._isNumber(
data.height)&&o.maxHeight&&o.maxHeight<data.height,isminw=this._isNumber(data.width
)&&o.minWidth&&o.minWidth>data.width,isminh=this._isNumber(data.height
)&&o.minHeight&&o.minHeight>data.height,dw=this.originalPosition.left+this.originalSize.width,
dh=this.originalPosition.top+this.originalSize.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(
isminw){data.width=o.minWidth}if(isminh){data.height=o.minHeight}if(ismaxw){data.width=o.maxWidth}
if(ismaxh){data.height=o.maxHeight}if(isminw&&cw){data.left=dw-o.minWidth}if(ismaxw&&cw){
data.left=dw-o.maxWidth}if(isminh&&ch){data.top=dh-o.minHeight}if(ismaxh&&ch){
data.top=dh-o.maxHeight}if(!data.width&&!data.height&&!data.left&&data.top){data.top=null}else if(
!data.width&&!data.height&&!data.top&&data.left){data.left=null}return data},
_getPaddingPlusBorderDimensions:function(element){var i=0,widths=[],borders=[element.css(
"borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css(
"borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css(
"paddingBottom"),element.css("paddingLeft")];for(;i<4;i++){widths[i]=parseFloat(borders[i])||0;
widths[i]+=parseFloat(paddings[i])||0}return{height:widths[0]+widths[2],width:widths[1]+widths[3]}},
_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return}var prel,i=0,
element=this.helper||this.element;for(;i<this._proportionallyResizeElements.length;i++){
prel=this._proportionallyResizeElements[i];if(!this.outerDimensions){
this.outerDimensions=this._getPaddingPlusBorderDimensions(prel)}prel.css({height:element.height(
)-this.outerDimensions.height||0,width:element.width()-this.outerDimensions.width||0})}},
_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(
this._helper){this.helper=this.helper||$("<div></div>").css({overflow:"hidden"});this._addClass(
this.helper,this._helper);this.helper.css({width:this.element.outerWidth(),
height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",
top:this.elementOffset.top+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection()
}else{this.helper=this.element}},_change:{e:function(event,dx){return{
width:this.originalSize.width+dx}},w:function(event,dx){var cs=this.originalSize,
sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx}},n:function(event,dx,dy){
var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy}},
s:function(event,dx,dy){return{height:this.originalSize.height+dy}},se:function(event,dx,dy){
return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]))},
sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(
this,[event,dx,dy]))},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),
this._change.e.apply(this,[event,dx,dy]))},nw:function(event,dx,dy){return $.extend(
this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]))}},
_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);if(n!=="resize"){
this._trigger(n,event,this.ui())}},plugins:{},ui:function(){return{
originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,
size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});
$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),
o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&/textarea/i.test(pr[0].nodeName
),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,
soffsetw=ista?0:that.sizeDiff.width,style={width:that.size.width-soffsetw,
height:that.size.height-soffseth},left=parseFloat(that.element.css("left"))+(
that.position.left-that.originalPosition.left)||null,top=parseFloat(that.element.css("top"))+(
that.position.top-that.originalPosition.top)||null;that.element.animate($.extend(style,top&&left?{
top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={
width:parseFloat(that.element.css("width")),height:parseFloat(that.element.css("height")),
top:parseFloat(that.element.css("top")),left:parseFloat(that.element.css("left"))};if(pr&&pr.length
){$(pr[0]).css({width:data.width,height:data.height})}that._updateCache(data);that._propagate(
"resize",event)}})}});$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,
ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,
oc=o.containment,ce=oc instanceof $?oc.get(0):/parent/.test(oc)?el.parent().get(0):oc;if(!ce){return
}that.containerElement=$(ce);if(/document/.test(oc)||oc===document){that.containerOffset={left:0,
top:0};that.containerPosition={left:0,top:0};that.parentData={element:$(document),left:0,top:0,
width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight}}else{
element=$(ce);p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(
element.css("padding"+name))});that.containerOffset=element.offset();
that.containerPosition=element.position();that.containerSize={height:element.innerHeight()-p[3],
width:element.innerWidth()-p[1]};co=that.containerOffset;ch=that.containerSize.height;
cw=that.containerSize.width;width=that._hasScroll(ce,"left")?ce.scrollWidth:cw;
height=that._hasScroll(ce)?ce.scrollHeight:ch;that.parentData={element:ce,left:co.left,top:co.top,
width:width,height:height}}},resize:function(event){var woset,hoset,isParent,isOffsetRelative,
that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,
pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,
continueResize=true;if(ce[0]!==document&&/static/.test(ce.css("position"))){cop=co}if(cp.left<(
that._helper?co.left:0)){that.size.width=that.size.width+(
that._helper?that.position.left-co.left:that.position.left-cop.left);if(pRatio){
that.size.height=that.size.width/that.aspectRatio;continueResize=false}
that.position.left=o.helper?co.left:0}if(cp.top<(that._helper?co.top:0)){
that.size.height=that.size.height+(that._helper?that.position.top-co.top:that.position.top);if(
pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false}
that.position.top=that._helper?co.top:0}isParent=that.containerElement.get(0)===that.element.parent(
).get(0);isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position"));if(
isParent&&isOffsetRelative){that.offset.left=that.parentData.left+that.position.left;
that.offset.top=that.parentData.top+that.position.top}else{that.offset.left=that.element.offset(
).left;that.offset.top=that.element.offset().top}woset=Math.abs(that.sizeDiff.width+(
that._helper?that.offset.left-cop.left:that.offset.left-co.left));hoset=Math.abs(
that.sizeDiff.height+(that._helper?that.offset.top-cop.top:that.offset.top-co.top));if(
woset+that.size.width>=that.parentData.width){that.size.width=that.parentData.width-woset;if(pRatio
){that.size.height=that.size.width/that.aspectRatio;continueResize=false}}if(
hoset+that.size.height>=that.parentData.height){that.size.height=that.parentData.height-hoset;if(
pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false}}if(!continueResize){
that.position.left=that.prevPosition.left;that.position.top=that.prevPosition.top;
that.size.width=that.prevSize.width;that.size.height=that.prevSize.height}},stop:function(){
var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,
cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),
w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;if(
that._helper&&!o.animate&&/relative/.test(ce.css("position"))){$(this).css({
left:ho.left-cop.left-co.left,width:w,height:h})}if(that._helper&&!o.animate&&/static/.test(ce.css(
"position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h})}}});$.ui.plugin.add(
"resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options;$(
o.alsoResize).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseFloat(
el.width()),height:parseFloat(el.height()),left:parseFloat(el.css("left")),top:parseFloat(el.css(
"top"))})})},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,
os=that.originalSize,op=that.originalPosition,delta={height:that.size.height-os.height||0,
width:that.size.width-os.width||0,top:that.position.top-op.top||0,left:that.position.left-op.left||0
};$(o.alsoResize).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),
style={},css=el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top",
"left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[
prop]=sum||null}});el.css(style)})},stop:function(){$(this).removeData("ui-resizable-alsoresize")}})
$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),
cs=that.size;that.ghost=that.originalElement.clone();that.ghost.css({opacity:.25,display:"block",
position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0});that._addClass(
that.ghost,"ui-resizable-ghost");if($.uiBackCompat!==false&&typeof that.options.ghost==="string"){
that.ghost.addClass(this.options.ghost)}that.ghost.appendTo(that.helper)},resize:function(){
var that=$(this).resizable("instance");if(that.ghost){that.ghost.css({position:"relative",
height:that.size.height,width:that.size.width})}},stop:function(){var that=$(this).resizable(
"instance");if(that.ghost&&that.helper){that.helper.get(0).removeChild(that.ghost.get(0))}}});
$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable(
"instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,
grid=typeof o.grid==="number"?[o.grid,o.grid]:o.grid,gridX=grid[0]||1,gridY=grid[1]||1,
ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,
newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&o.maxWidth<newWidth,
isMaxHeight=o.maxHeight&&o.maxHeight<newHeight,isMinWidth=o.minWidth&&o.minWidth>newWidth,
isMinHeight=o.minHeight&&o.minHeight>newHeight;o.grid=grid;if(isMinWidth){newWidth+=gridX}if(
isMinHeight){newHeight+=gridY}if(isMaxWidth){newWidth-=gridX}if(isMaxHeight){newHeight-=gridY}if(
/^(se|s|e)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight}else if(/^(ne)$/.test(a)){
that.size.width=newWidth;that.size.height=newHeight;that.position.top=op.top-oy}else if(
/^(sw)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.left=op.left-ox
}else{if(newHeight-gridY<=0||newWidth-gridX<=0){
outerDimensions=that._getPaddingPlusBorderDimensions(this)}if(newHeight-gridY>0){
that.size.height=newHeight;that.position.top=op.top-oy}else{newHeight=gridY-outerDimensions.height;
that.size.height=newHeight;that.position.top=op.top+os.height-newHeight}if(newWidth-gridX>0){
that.size.width=newWidth;that.position.left=op.left-ox}else{newWidth=gridX-outerDimensions.width;
that.size.width=newWidth;that.position.left=op.left+os.width-newWidth}}}});
var widgetsResizable=$.ui.resizable;$.widget("ui.dialog",{version:"1.13.2",options:{appendTo:"body",
autoOpen:true,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},
closeOnEscape:true,closeText:"Close",draggable:true,hide:null,height:"auto",maxHeight:null,
maxWidth:null,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",of:window,
collision:"fit",using:function(pos){var topOffset=$(this).css(pos).offset().top;if(topOffset<0){$(
this).css("top",pos.top-topOffset)}}},resizable:true,show:null,title:null,width:300,
beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,
resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:true,height:true,maxHeight:true,
maxWidth:true,minHeight:true,minWidth:true,width:true},resizableRelatedOptions:{maxHeight:true,
maxWidth:true,minHeight:true,minWidth:true},_create:function(){this.originalCss={
display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0
].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height};
this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(
this.element)};this.originalTitle=this.element.attr("title");if(
this.options.title==null&&this.originalTitle!=null){this.options.title=this.originalTitle}if(
this.options.disabled){this.options.disabled=false}this._createWrapper();this.element.show(
).removeAttr("title").appendTo(this.uiDialog);this._addClass("ui-dialog-content","ui-widget-content"
);this._createTitlebar();this._createButtonPane();if(this.options.draggable&&$.fn.draggable){
this._makeDraggable()}if(this.options.resizable&&$.fn.resizable){this._makeResizable()}
this._isOpen=false;this._trackFocus()},_init:function(){if(this.options.autoOpen){this.open()}},
_appendTo:function(){var element=this.options.appendTo;if(element&&(element.jquery||element.nodeType
)){return $(element)}return this.document.find(element||"body").eq(0)},_destroy:function(){var next,
originalPosition=this.originalPosition;this._untrackInstance();this._destroyOverlay();
this.element.removeUniqueId().css(this.originalCss).detach();this.uiDialog.remove();if(
this.originalTitle){this.element.attr("title",this.originalTitle)}
next=originalPosition.parent.children().eq(originalPosition.index);if(next.length&&next[0
]!==this.element[0]){next.before(this.element)}else{originalPosition.parent.append(this.element)}},
widget:function(){return this.uiDialog},disable:$.noop,enable:$.noop,close:function(event){
var that=this;if(!this._isOpen||this._trigger("beforeClose",event)===false){return}
this._isOpen=false;this._focusedElement=null;this._destroyOverlay();this._untrackInstance();if(
!this.opener.filter(":focusable").trigger("focus").length){$.ui.safeBlur($.ui.safeActiveElement(
this.document[0]))}this._hide(this.uiDialog,this.options.hide,function(){that._trigger("close",event
)})},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},
_moveToTop:function(event,silent){var moved=false,zIndices=this.uiDialog.siblings(
".ui-front:visible").map(function(){return+$(this).css("z-index")}).get(),zIndexMax=Math.max.apply(
null,zIndices);if(zIndexMax>=+this.uiDialog.css("z-index")){this.uiDialog.css("z-index",zIndexMax+1)
moved=true}if(moved&&!silent){this._trigger("focus",event)}return moved},open:function(){
var that=this;if(this._isOpen){if(this._moveToTop()){this._focusTabbable()}return}this._isOpen=true;
this.opener=$($.ui.safeActiveElement(this.document[0]));this._size();this._position();
this._createOverlay();this._moveToTop(null,true);if(this.overlay){this.overlay.css("z-index",
this.uiDialog.css("z-index")-1)}this._show(this.uiDialog,this.options.show,function(){
that._focusTabbable();that._trigger("focus")});this._makeFocusTarget();this._trigger("open")},
_focusTabbable:function(){var hasFocus=this._focusedElement;if(!hasFocus){
hasFocus=this.element.find("[autofocus]")}if(!hasFocus.length){hasFocus=this.element.find(
":tabbable")}if(!hasFocus.length){hasFocus=this.uiDialogButtonPane.find(":tabbable")}if(
!hasFocus.length){hasFocus=this.uiDialogTitlebarClose.filter(":tabbable")}if(!hasFocus.length){
hasFocus=this.uiDialog}hasFocus.eq(0).trigger("focus")},_restoreTabbableFocus:function(){
var activeElement=$.ui.safeActiveElement(this.document[0]),isActive=this.uiDialog[0
]===activeElement||$.contains(this.uiDialog[0],activeElement);if(!isActive){this._focusTabbable()}},
_keepFocus:function(event){event.preventDefault();this._restoreTabbableFocus();this._delay(
this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=$("<div>").hide().attr({
tabIndex:-1,role:"dialog"}).appendTo(this._appendTo());this._addClass(this.uiDialog,"ui-dialog",
"ui-widget ui-widget-content ui-front");this._on(this.uiDialog,{keydown:function(event){if(
this.options.closeOnEscape&&!event.isDefaultPrevented(
)&&event.keyCode&&event.keyCode===$.ui.keyCode.ESCAPE){event.preventDefault();this.close(event);
return}if(event.keyCode!==$.ui.keyCode.TAB||event.isDefaultPrevented()){return}
var tabbables=this.uiDialog.find(":tabbable"),first=tabbables.first(),last=tabbables.last();if((
event.target===last[0]||event.target===this.uiDialog[0])&&!event.shiftKey){this._delay(function(){
first.trigger("focus")});event.preventDefault()}else if((event.target===first[0
]||event.target===this.uiDialog[0])&&event.shiftKey){this._delay(function(){last.trigger("focus")});
event.preventDefault()}},mousedown:function(event){if(this._moveToTop(event)){this._focusTabbable()}
}});if(!this.element.find("[aria-describedby]").length){this.uiDialog.attr({
"aria-describedby":this.element.uniqueId().attr("id")})}},_createTitlebar:function(){
var uiDialogTitle;this.uiDialogTitlebar=$("<div>");this._addClass(this.uiDialogTitlebar,
"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix");this._on(this.uiDialogTitlebar,{
mousedown:function(event){if(!$(event.target).closest(".ui-dialog-titlebar-close")){
this.uiDialog.trigger("focus")}}});this.uiDialogTitlebarClose=$("<button type='button'></button>"
).button({label:$("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",
showLabel:false}).appendTo(this.uiDialogTitlebar);this._addClass(this.uiDialogTitlebarClose,
"ui-dialog-titlebar-close");this._on(this.uiDialogTitlebarClose,{click:function(event){
event.preventDefault();this.close(event)}});uiDialogTitle=$("<span>").uniqueId().prependTo(
this.uiDialogTitlebar);this._addClass(uiDialogTitle,"ui-dialog-title");this._title(uiDialogTitle);
this.uiDialogTitlebar.prependTo(this.uiDialog);this.uiDialog.attr({
"aria-labelledby":uiDialogTitle.attr("id")})},_title:function(title){if(this.options.title){
title.text(this.options.title)}else{title.html("&#160;")}},_createButtonPane:function(){
this.uiDialogButtonPane=$("<div>");this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane",
"ui-widget-content ui-helper-clearfix");this.uiButtonSet=$("<div>").appendTo(this.uiDialogButtonPane
);this._addClass(this.uiButtonSet,"ui-dialog-buttonset");this._createButtons()},
_createButtons:function(){var that=this,buttons=this.options.buttons;this.uiDialogButtonPane.remove(
);this.uiButtonSet.empty();if($.isEmptyObject(buttons)||Array.isArray(buttons)&&!buttons.length){
this._removeClass(this.uiDialog,"ui-dialog-buttons");return}$.each(buttons,function(name,props){
var click,buttonOptions;props=typeof props==="function"?{click:props,text:name}:props;
props=$.extend({type:"button"},props);click=props.click;buttonOptions={icon:props.icon,
iconPosition:props.iconPosition,showLabel:props.showLabel,icons:props.icons,text:props.text};
delete props.click;delete props.icon;delete props.iconPosition;delete props.showLabel;
delete props.icons;if(typeof props.text==="boolean"){delete props.text}$("<button></button>",props
).button(buttonOptions).appendTo(that.uiButtonSet).on("click",function(){click.apply(that.element[0]
,arguments)})});this._addClass(this.uiDialog,"ui-dialog-buttons");this.uiDialogButtonPane.appendTo(
this.uiDialog)},_makeDraggable:function(){var that=this,options=this.options;function filteredUi(ui
){return{position:ui.position,offset:ui.offset}}this.uiDialog.draggable({
cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",
containment:"document",start:function(event,ui){that._addClass($(this),"ui-dialog-dragging");
that._blockFrames();that._trigger("dragStart",event,filteredUi(ui))},drag:function(event,ui){
that._trigger("drag",event,filteredUi(ui))},stop:function(event,ui){
var left=ui.offset.left-that.document.scrollLeft(),top=ui.offset.top-that.document.scrollTop();
options.position={my:"left top",at:"left"+(left>=0?"+":"")+left+" "+"top"+(top>=0?"+":"")+top,
of:that.window};that._removeClass($(this),"ui-dialog-dragging");that._unblockFrames();that._trigger(
"dragStop",event,filteredUi(ui))}})},_makeResizable:function(){var that=this,options=this.options,
handles=options.resizable,position=this.uiDialog.css("position"),
resizeHandles=typeof handles==="string"?handles:"n,e,s,w,se,sw,ne,nw";function filteredUi(ui){
return{originalPosition:ui.originalPosition,originalSize:ui.originalSize,position:ui.position,
size:ui.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",
alsoResize:this.element,maxWidth:options.maxWidth,maxHeight:options.maxHeight,
minWidth:options.minWidth,minHeight:this._minHeight(),handles:resizeHandles,start:function(event,ui
){that._addClass($(this),"ui-dialog-resizing");that._blockFrames();that._trigger("resizeStart",event
,filteredUi(ui))},resize:function(event,ui){that._trigger("resize",event,filteredUi(ui))},
stop:function(event,ui){var offset=that.uiDialog.offset(),left=offset.left-that.document.scrollLeft(
),top=offset.top-that.document.scrollTop();options.height=that.uiDialog.height();
options.width=that.uiDialog.width();options.position={my:"left top",at:"left"+(left>=0?"+":""
)+left+" "+"top"+(top>=0?"+":"")+top,of:that.window};that._removeClass($(this),"ui-dialog-resizing")
that._unblockFrames();that._trigger("resizeStop",event,filteredUi(ui))}}).css("position",position)},
_trackFocus:function(){this._on(this.widget(),{focusin:function(event){this._makeFocusTarget();
this._focusedElement=$(event.target)}})},_makeFocusTarget:function(){this._untrackInstance();
this._trackingInstances().unshift(this)},_untrackInstance:function(){
var instances=this._trackingInstances(),exists=$.inArray(this,instances);if(exists!==-1){
instances.splice(exists,1)}},_trackingInstances:function(){var instances=this.document.data(
"ui-dialog-instances");if(!instances){instances=[];this.document.data("ui-dialog-instances",
instances)}return instances},_minHeight:function(){var options=this.options;
return options.height==="auto"?options.minHeight:Math.min(options.minHeight,options.height)},
_position:function(){var isVisible=this.uiDialog.is(":visible");if(!isVisible){this.uiDialog.show()}
this.uiDialog.position(this.options.position);if(!isVisible){this.uiDialog.hide()}},
_setOptions:function(options){var that=this,resize=false,resizableOptions={};$.each(options,
function(key,value){that._setOption(key,value);if(key in that.sizeRelatedOptions){resize=true}if(
key in that.resizableRelatedOptions){resizableOptions[key]=value}});if(resize){this._size();
this._position()}if(this.uiDialog.is(":data(ui-resizable)")){this.uiDialog.resizable("option",
resizableOptions)}},_setOption:function(key,value){var isDraggable,isResizable,
uiDialog=this.uiDialog;if(key==="disabled"){return}this._super(key,value);if(key==="appendTo"){
this.uiDialog.appendTo(this._appendTo())}if(key==="buttons"){this._createButtons()}if(
key==="closeText"){this.uiDialogTitlebarClose.button({label:$("<a>").text(""+this.options.closeText
).html()})}if(key==="draggable"){isDraggable=uiDialog.is(":data(ui-draggable)");if(
isDraggable&&!value){uiDialog.draggable("destroy")}if(!isDraggable&&value){this._makeDraggable()}}
if(key==="position"){this._position()}if(key==="resizable"){isResizable=uiDialog.is(
":data(ui-resizable)");if(isResizable&&!value){uiDialog.resizable("destroy")}if(
isResizable&&typeof value==="string"){uiDialog.resizable("option","handles",value)}if(
!isResizable&&value!==false){this._makeResizable()}}if(key==="title"){this._title(
this.uiDialogTitlebar.find(".ui-dialog-title"))}},_size:function(){var nonContentHeight,
minContentHeight,maxContentHeight,options=this.options;this.element.show().css({width:"auto",
minHeight:0,maxHeight:"none",height:0});if(options.minWidth>options.width){
options.width=options.minWidth}nonContentHeight=this.uiDialog.css({height:"auto",width:options.width
}).outerHeight();minContentHeight=Math.max(0,options.minHeight-nonContentHeight);
maxContentHeight=typeof options.maxHeight==="number"?Math.max(0,options.maxHeight-nonContentHeight
):"none";if(options.height==="auto"){this.element.css({minHeight:minContentHeight,
maxHeight:maxContentHeight,height:"auto"})}else{this.element.height(Math.max(0,
options.height-nonContentHeight))}if(this.uiDialog.is(":data(ui-resizable)")){
this.uiDialog.resizable("option","minHeight",this._minHeight())}},_blockFrames:function(){
this.iframeBlocks=this.document.find("iframe").map(function(){var iframe=$(this);return $("<div>"
).css({position:"absolute",width:iframe.outerWidth(),height:iframe.outerHeight()}).appendTo(
iframe.parent()).offset(iframe.offset())[0]})},_unblockFrames:function(){if(this.iframeBlocks){
this.iframeBlocks.remove();delete this.iframeBlocks}},_allowInteraction:function(event){if($(
event.target).closest(".ui-dialog").length){return true}return!!$(event.target).closest(
".ui-datepicker").length},_createOverlay:function(){if(!this.options.modal){return}
var jqMinor=$.fn.jquery.substring(0,4);var isOpening=true;this._delay(function(){isOpening=false});
if(!this.document.data("ui-dialog-overlays")){this.document.on("focusin.ui-dialog",function(event){
if(isOpening){return}var instance=this._trackingInstances()[0];if(!instance._allowInteraction(event)
){event.preventDefault();instance._focusTabbable();if(jqMinor==="3.4."||jqMinor==="3.5."){
instance._delay(instance._restoreTabbableFocus)}}}.bind(this))}this.overlay=$("<div>").appendTo(
this._appendTo());this._addClass(this.overlay,null,"ui-widget-overlay ui-front");this._on(
this.overlay,{mousedown:"_keepFocus"});this.document.data("ui-dialog-overlays",(this.document.data(
"ui-dialog-overlays")||0)+1)},_destroyOverlay:function(){if(!this.options.modal){return}if(
this.overlay){var overlays=this.document.data("ui-dialog-overlays")-1;if(!overlays){
this.document.off("focusin.ui-dialog");this.document.removeData("ui-dialog-overlays")}else{
this.document.data("ui-dialog-overlays",overlays)}this.overlay.remove();this.overlay=null}}});if(
$.uiBackCompat!==false){$.widget("ui.dialog",$.ui.dialog,{options:{dialogClass:""},
_createWrapper:function(){this._super();this.uiDialog.addClass(this.options.dialogClass)},
_setOption:function(key,value){if(key==="dialogClass"){this.uiDialog.removeClass(
this.options.dialogClass).addClass(value)}this._superApply(arguments)}})}
var widgetsDialog=$.ui.dialog;$.widget("ui.droppable",{version:"1.13.2",widgetEventPrefix:"drop",
options:{accept:"*",addClasses:true,greedy:false,scope:"default",tolerance:"intersect",
activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,
o=this.options,accept=o.accept;this.isover=false;this.isout=true;
this.accept=typeof accept==="function"?accept:function(d){return d.is(accept)};
this.proportions=function(){if(arguments.length){proportions=arguments[0]}else{
return proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0
].offsetHeight}}};this._addToManager(o.scope);if(o.addClasses){this._addClass("ui-droppable")}},
_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[];
$.ui.ddmanager.droppables[scope].push(this)},_splice:function(drop){var i=0;for(;i<drop.length;i++){
if(drop[i]===this){drop.splice(i,1)}}},_destroy:function(){var drop=$.ui.ddmanager.droppables[
this.options.scope];this._splice(drop)},_setOption:function(key,value){if(key==="accept"){
this.accept=typeof value==="function"?value:function(d){return d.is(value)}}else if(key==="scope"){
var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);this._addToManager(value)}
this._super(key,value)},_activate:function(event){var draggable=$.ui.ddmanager.current;
this._addActiveClass();if(draggable){this._trigger("activate",event,this.ui(draggable))}},
_deactivate:function(event){var draggable=$.ui.ddmanager.current;this._removeActiveClass();if(
draggable){this._trigger("deactivate",event,this.ui(draggable))}},_over:function(event){
var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0
]===this.element[0]){return}if(this.accept.call(this.element[0],
draggable.currentItem||draggable.element)){this._addHoverClass();this._trigger("over",event,this.ui(
draggable))}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(
draggable.currentItem||draggable.element)[0]===this.element[0]){return}if(this.accept.call(
this.element[0],draggable.currentItem||draggable.element)){this._removeHoverClass();this._trigger(
"out",event,this.ui(draggable))}},_drop:function(event,custom){
var draggable=custom||$.ui.ddmanager.current,childrenIntersection=false;if(!draggable||(
draggable.currentItem||draggable.element)[0]===this.element[0]){return false}this.element.find(
":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$(this).droppable(
"instance");if(
inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(
inst.element[0],draggable.currentItem||draggable.element)&&$.ui.intersect(draggable,$.extend(inst,{
offset:inst.element.offset()}),inst.options.tolerance,event)){childrenIntersection=true;return false
}});if(childrenIntersection){return false}if(this.accept.call(this.element[0],
draggable.currentItem||draggable.element)){this._removeActiveClass();this._removeHoverClass();
this._trigger("drop",event,this.ui(draggable));return this.element}return false},ui:function(c){
return{draggable:c.currentItem||c.element,helper:c.helper,position:c.position,offset:c.positionAbs}
},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){
this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass(
"ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});
$.ui.intersect=function(){function isOverAxis(x,reference,size){
return x>=reference&&x<reference+size}return function(draggable,droppable,toleranceMode,event){if(
!droppable.offset){return false}var x1=(draggable.positionAbs||draggable.position.absolute
).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute
).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,
y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,
r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){
case"fit":return l<=x1&&x2<=r&&t<=y1&&y2<=b;case"intersect":
return l<x1+draggable.helperProportions.width/2&&x2-draggable.helperProportions.width/2<r&&t<y1+draggable.helperProportions.height/2&&y2-draggable.helperProportions.height/2<b
;case"pointer":return isOverAxis(event.pageY,t,droppable.proportions().height)&&isOverAxis(
event.pageX,l,droppable.proportions().width);case"touch":return(
y1>=t&&y1<=b||y2>=t&&y2<=b||y1<t&&y2>b)&&(x1>=l&&x1<=r||x2>=l&&x2<=r||x1<l&&x2>r);default:
return false}}}();$.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,
event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(
t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(
i=0;i<m.length;i++){if(m[i].options.disabled||t&&!m[i].accept.call(m[i].element[0],
t.currentItem||t.element)){continue}for(j=0;j<list.length;j++){if(list[j]===m[i].element[0]){m[i
].proportions().height=0;continue droppablesLoop}}m[i].visible=m[i].element.css("display")!=="none";
if(!m[i].visible){continue}if(type==="mousedown"){m[i]._activate.call(m[i],event)}m[i].offset=m[i
].element.offset();m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0
].offsetHeight})}},drop:function(draggable,event){var dropped=false;$.each((
$.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){if(!this.options){return}
if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance,event)
){dropped=this._drop.call(this,event)||dropped}if(
!this.options.disabled&&this.visible&&this.accept.call(this.element[0],
draggable.currentItem||draggable.element)){this.isout=true;this.isover=false;this._deactivate.call(
this,event)}});return dropped},dragStart:function(draggable,event){draggable.element.parentsUntil(
"body").on("scroll.droppable",function(){if(!draggable.options.refreshPositions){
$.ui.ddmanager.prepareOffsets(draggable,event)}})},drag:function(draggable,event){if(
draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event)}$.each(
$.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(
this.options.disabled||this.greedyChild||!this.visible){return}var parentInstance,scope,parent,
intersects=$.ui.intersect(draggable,this,this.options.tolerance,event),
c=!intersects&&this.isover?"isout":intersects&&!this.isover?"isover":null;if(!c){return}if(
this.options.greedy){scope=this.options.scope;parent=this.element.parents(":data(ui-droppable)"
).filter(function(){return $(this).droppable("instance").options.scope===scope});if(parent.length){
parentInstance=$(parent[0]).droppable("instance");parentInstance.greedyChild=c==="isover"}}if(
parentInstance&&c==="isover"){parentInstance.isover=false;parentInstance.isout=true;
parentInstance._out.call(parentInstance,event)}this[c]=true;this[c==="isout"?"isover":"isout"]=false
this[c==="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c==="isout"){
parentInstance.isout=false;parentInstance.isover=true;parentInstance._over.call(parentInstance,event
)}})},dragStop:function(draggable,event){draggable.element.parentsUntil("body").off(
"scroll.droppable");if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,
event)}}};if($.uiBackCompat!==false){$.widget("ui.droppable",$.ui.droppable,{options:{
hoverClass:false,activeClass:false},_addActiveClass:function(){this._super();if(
this.options.activeClass){this.element.addClass(this.options.activeClass)}},
_removeActiveClass:function(){this._super();if(this.options.activeClass){this.element.removeClass(
this.options.activeClass)}},_addHoverClass:function(){this._super();if(this.options.hoverClass){
this.element.addClass(this.options.hoverClass)}},_removeHoverClass:function(){this._super();if(
this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}}})}
var widgetsDroppable=$.ui.droppable;var widgetsProgressbar=$.widget("ui.progressbar",{
version:"1.13.2",options:{classes:{"ui-progressbar":"ui-corner-all",
"ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,
value:0,change:null,complete:null},min:0,_create:function(){
this.oldValue=this.options.value=this._constrainedValue();this.element.attr({role:"progressbar",
"aria-valuemin":this.min});this._addClass("ui-progressbar","ui-widget ui-widget-content");
this.valueDiv=$("<div>").appendTo(this.element);this._addClass(this.valueDiv,"ui-progressbar-value",
"ui-widget-header");this._refreshValue()},_destroy:function(){this.element.removeAttr(
"role aria-valuemin aria-valuemax aria-valuenow");this.valueDiv.remove()},value:function(newValue){
if(newValue===undefined){return this.options.value}this.options.value=this._constrainedValue(
newValue);this._refreshValue()},_constrainedValue:function(newValue){if(newValue===undefined){
newValue=this.options.value}this.indeterminate=newValue===false;if(typeof newValue!=="number"){
newValue=0}return this.indeterminate?false:Math.min(this.options.max,Math.max(this.min,newValue))},
_setOptions:function(options){var value=options.value;delete options.value;this._super(options);
this.options.value=this._constrainedValue(value);this._refreshValue()},_setOption:function(key,value
){if(key==="max"){value=Math.max(this.min,value)}this._super(key,value)},
_setOptionDisabled:function(value){this._super(value);this.element.attr("aria-disabled",value);
this._toggleClass(null,"ui-state-disabled",!!value)},_percentage:function(){
return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},
_refreshValue:function(){var value=this.options.value,percentage=this._percentage();
this.valueDiv.toggle(this.indeterminate||value>this.min).width(percentage.toFixed(0)+"%");
this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,value===this.options.max
)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate);if(this.indeterminate){
this.element.removeAttr("aria-valuenow");if(!this.overlayDiv){this.overlayDiv=$("<div>").appendTo(
this.valueDiv);this._addClass(this.overlayDiv,"ui-progressbar-overlay")}}else{this.element.attr({
"aria-valuemax":this.options.max,"aria-valuenow":value});if(this.overlayDiv){this.overlayDiv.remove(
);this.overlayDiv=null}}if(this.oldValue!==value){this.oldValue=value;this._trigger("change")}if(
value===this.options.max){this._trigger("complete")}}});var widgetsSelectable=$.widget(
"ui.selectable",$.ui.mouse,{version:"1.13.2",options:{appendTo:"body",autoRefresh:true,distance:0,
filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,
unselecting:null},_create:function(){var that=this;this._addClass("ui-selectable");
this.dragged=false;this.refresh=function(){that.elementPos=$(that.element[0]).offset();
that.selectees=$(that.options.filter,that.element[0]);that._addClass(that.selectees,"ui-selectee");
that.selectees.each(function(){var $this=$(this),selecteeOffset=$this.offset(),pos={
left:selecteeOffset.left-that.elementPos.left,top:selecteeOffset.top-that.elementPos.top};$.data(
this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,
right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:false,
selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),
unselecting:$this.hasClass("ui-unselecting")})})};this.refresh();this._mouseInit();this.helper=$(
"<div>");this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){
this.selectees.removeData("selectable-item");this._mouseDestroy()},_mouseStart:function(event){
var that=this,options=this.options;this.opos=[event.pageX,event.pageY];this.elementPos=$(
this.element[0]).offset();if(this.options.disabled){return}this.selectees=$(options.filter,
this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);
this.helper.css({left:event.pageX,top:event.pageY,width:0,height:0});if(options.autoRefresh){
this.refresh()}this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,
"selectable-item");selectee.startselected=true;if(!event.metaKey&&!event.ctrlKey){that._removeClass(
selectee.$element,"ui-selected");selectee.selected=false;that._addClass(selectee.$element,
"ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{
unselecting:selectee.element})}});$(event.target).parents().addBack().each(function(){var doSelect,
selectee=$.data(this,"selectable-item");if(selectee){
doSelect=!event.metaKey&&!event.ctrlKey||!selectee.$element.hasClass("ui-selected");
that._removeClass(selectee.$element,doSelect?"ui-unselecting":"ui-selected")._addClass(
selectee.$element,doSelect?"ui-selecting":"ui-unselecting");selectee.unselecting=!doSelect;
selectee.selecting=doSelect;selectee.selected=doSelect;if(doSelect){that._trigger("selecting",event,
{selecting:selectee.element})}else{that._trigger("unselecting",event,{unselecting:selectee.element})
}return false}})},_mouseDrag:function(event){this.dragged=true;if(this.options.disabled){return}
var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY
if(x1>x2){tmp=x2;x2=x1;x1=tmp}if(y1>y2){tmp=y2;y2=y1;y1=tmp}this.helper.css({left:x1,top:y1,
width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item"
),hit=false,offset={};if(!selectee||selectee.element===that.element[0]){return}
offset.left=selectee.left+that.elementPos.left;offset.right=selectee.right+that.elementPos.left;
offset.top=selectee.top+that.elementPos.top;offset.bottom=selectee.bottom+that.elementPos.top;if(
options.tolerance==="touch"){hit=!(offset.left>x2||offset.right<x1||offset.top>y2||offset.bottom<y1)
}else if(options.tolerance==="fit"){
hit=offset.left>x1&&offset.right<x2&&offset.top>y1&&offset.bottom<y2}if(hit){if(selectee.selected){
that._removeClass(selectee.$element,"ui-selected");selectee.selected=false}if(selectee.unselecting){
that._removeClass(selectee.$element,"ui-unselecting");selectee.unselecting=false}if(
!selectee.selecting){that._addClass(selectee.$element,"ui-selecting");selectee.selecting=true;
that._trigger("selecting",event,{selecting:selectee.element})}}else{if(selectee.selecting){if((
event.metaKey||event.ctrlKey)&&selectee.startselected){that._removeClass(selectee.$element,
"ui-selecting");selectee.selecting=false;that._addClass(selectee.$element,"ui-selected");
selectee.selected=true}else{that._removeClass(selectee.$element,"ui-selecting");
selectee.selecting=false;if(selectee.startselected){that._addClass(selectee.$element,
"ui-unselecting");selectee.unselecting=true}that._trigger("unselecting",event,{
unselecting:selectee.element})}}if(selectee.selected){if(
!event.metaKey&&!event.ctrlKey&&!selectee.startselected){that._removeClass(selectee.$element,
"ui-selected");selectee.selected=false;that._addClass(selectee.$element,"ui-unselecting");
selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element})}}}});
return false},_mouseStop:function(event){var that=this;this.dragged=false;$(".ui-unselecting",
this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(
selectee.$element,"ui-unselecting");selectee.unselecting=false;selectee.startselected=false;
that._trigger("unselected",event,{unselected:selectee.element})});$(".ui-selecting",this.element[0]
).each(function(){var selectee=$.data(this,"selectable-item");that._removeClass(selectee.$element,
"ui-selecting")._addClass(selectee.$element,"ui-selected");selectee.selecting=false;
selectee.selected=true;selectee.startselected=true;that._trigger("selected",event,{
selected:selectee.element})});this._trigger("stop",event);this.helper.remove();return false}});
var widgetsSelectmenu=$.widget("ui.selectmenu",[$.ui.formResetMixin,{version:"1.13.2",
defaultElement:"<select>",options:{appendTo:null,classes:{
"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},
disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",
collision:"none"},width:false,change:null,close:null,focus:null,open:null,select:null},
_create:function(){var selectmenuId=this.element.uniqueId().attr("id");this.ids={
element:selectmenuId,button:selectmenuId+"-button",menu:selectmenuId+"-menu"};this._drawButton();
this._drawMenu();this._bindFormResetHandler();this._rendered=false;this.menuItems=$()},
_drawButton:function(){var icon,that=this,item=this._parseOption(this.element.find("option:selected"
),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button);
this._on(this.labels,{click:function(event){this.button.trigger("focus");event.preventDefault()}});
this.element.hide();this.button=$("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,
role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,
"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element);this._addClass(
this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget");icon=$(
"<span>").appendTo(this.button);this._addClass(icon,"ui-selectmenu-icon",
"ui-icon "+this.options.icons.button);this.buttonItem=this._renderButtonItem(item).appendTo(
this.button);if(this.options.width!==false){this._resizeButton()}this._on(this.button,
this._buttonEvents);this.button.one("focusin",function(){if(!that._rendered){that._refreshMenu()}})
},_drawMenu:function(){var that=this;this.menu=$("<ul>",{"aria-hidden":"true",
"aria-labelledby":this.ids.button,id:this.ids.menu});this.menuWrap=$("<div>").append(this.menu);
this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front");this.menuWrap.appendTo(this._appendTo(
));this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",
select:function(event,ui){event.preventDefault();that._setSelection();that._select(ui.item.data(
"ui-selectmenu-item"),event)},focus:function(event,ui){var item=ui.item.data("ui-selectmenu-item");
if(that.focusIndex!=null&&item.index!==that.focusIndex){that._trigger("focus",event,{item:item});if(
!that.isOpen){that._select(item,event)}}that.focusIndex=item.index;that.button.attr(
"aria-activedescendant",that.menuItems.eq(item.index).attr("id"))}}).menu("instance");
this.menuInstance._off(this.menu,"mouseleave");this.menuInstance._closeOnDocumentClick=function(){
return false};this.menuInstance._isDivider=function(){return false}},refresh:function(){
this._refreshMenu();this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(
this._getSelectedItem().data("ui-selectmenu-item")||{}));if(this.options.width===null){
this._resizeButton()}},_refreshMenu:function(){var item,options=this.element.find("option");
this.menu.empty();this._parseOptions(options);this._renderMenu(this.menu,this.items);
this.menuInstance.refresh();this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(
".ui-menu-item-wrapper");this._rendered=true;if(!options.length){return}item=this._getSelectedItem()
this.menuInstance.focus(null,item);this._setAria(item.data("ui-selectmenu-item"));this._setOption(
"disabled",this.element.prop("disabled"))},open:function(event){if(this.options.disabled){return}if(
!this._rendered){this._refreshMenu()}else{this._removeClass(this.menu.find(".ui-state-active"),null,
"ui-state-active");this.menuInstance.focus(null,this._getSelectedItem())}if(!this.menuItems.length){
return}this.isOpen=true;this._toggleAttr();this._resizeMenu();this._position();this._on(
this.document,this._documentClick);this._trigger("open",event)},_position:function(){
this.menuWrap.position($.extend({of:this.button},this.options.position))},close:function(event){if(
!this.isOpen){return}this.isOpen=false;this._toggleAttr();this.range=null;this._off(this.document);
this._trigger("close",event)},widget:function(){return this.button},menuWidget:function(){
return this.menu},_renderButtonItem:function(item){var buttonItem=$("<span>");this._setText(
buttonItem,item.label);this._addClass(buttonItem,"ui-selectmenu-text");return buttonItem},
_renderMenu:function(ul,items){var that=this,currentOptgroup="";$.each(items,function(index,item){
var li;if(item.optgroup!==currentOptgroup){li=$("<li>",{text:item.optgroup});that._addClass(li,
"ui-selectmenu-optgroup","ui-menu-divider"+(item.element.parent("optgroup").prop("disabled"
)?" ui-state-disabled":""));li.appendTo(ul);currentOptgroup=item.optgroup}that._renderItemData(ul,
item)})},_renderItemData:function(ul,item){return this._renderItem(ul,item).data(
"ui-selectmenu-item",item)},_renderItem:function(ul,item){var li=$("<li>"),wrapper=$("<div>",{
title:item.element.attr("title")});if(item.disabled){this._addClass(li,null,"ui-state-disabled")}
this._setText(wrapper,item.label);return li.append(wrapper).appendTo(ul)},_setText:function(element,
value){if(value){element.text(value)}else{element.html("&#160;")}},_move:function(direction,event){
var item,next,filter=".ui-menu-item";if(this.isOpen){item=this.menuItems.eq(this.focusIndex).parent(
"li")}else{item=this.menuItems.eq(this.element[0].selectedIndex).parent("li");
filter+=":not(.ui-state-disabled)"}if(direction==="first"||direction==="last"){next=item[
direction==="first"?"prevAll":"nextAll"](filter).eq(-1)}else{next=item[direction+"All"](filter).eq(0
)}if(next.length){this.menuInstance.focus(event,next)}},_getSelectedItem:function(){
return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(event){this[
this.isOpen?"close":"open"](event)},_setSelection:function(){var selection;if(!this.range){return}
if(window.getSelection){selection=window.getSelection();selection.removeAllRanges();
selection.addRange(this.range)}else{this.range.select()}this.button.trigger("focus")},
_documentClick:{mousedown:function(event){if(!this.isOpen){return}if(!$(event.target).closest(
".ui-selectmenu-menu, #"+$.escapeSelector(this.ids.button)).length){this.close(event)}}},
_buttonEvents:{mousedown:function(){var selection;if(window.getSelection){
selection=window.getSelection();if(selection.rangeCount){this.range=selection.getRangeAt(0)}}else{
this.range=document.selection.createRange()}},click:function(event){this._setSelection();
this._toggle(event)},keydown:function(event){var preventDefault=true;switch(event.keyCode){
case $.ui.keyCode.TAB:case $.ui.keyCode.ESCAPE:this.close(event);preventDefault=false;break;
case $.ui.keyCode.ENTER:if(this.isOpen){this._selectFocusedItem(event)}break;case $.ui.keyCode.UP:
if(event.altKey){this._toggle(event)}else{this._move("prev",event)}break;case $.ui.keyCode.DOWN:if(
event.altKey){this._toggle(event)}else{this._move("next",event)}break;case $.ui.keyCode.SPACE:if(
this.isOpen){this._selectFocusedItem(event)}else{this._toggle(event)}break;case $.ui.keyCode.LEFT:
this._move("prev",event);break;case $.ui.keyCode.RIGHT:this._move("next",event);break;
case $.ui.keyCode.HOME:case $.ui.keyCode.PAGE_UP:this._move("first",event);break;
case $.ui.keyCode.END:case $.ui.keyCode.PAGE_DOWN:this._move("last",event);break;default:
this.menu.trigger(event);preventDefault=false}if(preventDefault){event.preventDefault()}}},
_selectFocusedItem:function(event){var item=this.menuItems.eq(this.focusIndex).parent("li");if(
!item.hasClass("ui-state-disabled")){this._select(item.data("ui-selectmenu-item"),event)}},
_select:function(item,event){var oldIndex=this.element[0].selectedIndex;this.element[0
].selectedIndex=item.index;this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(item))
this._setAria(item);this._trigger("select",event,{item:item});if(item.index!==oldIndex){
this._trigger("change",event,{item:item})}this.close(event)},_setAria:function(item){
var id=this.menuItems.eq(item.index).attr("id");this.button.attr({"aria-labelledby":id,
"aria-activedescendant":id});this.menu.attr("aria-activedescendant",id)},_setOption:function(key,
value){if(key==="icons"){var icon=this.button.find("span.ui-icon");this._removeClass(icon,null,
this.options.icons.button)._addClass(icon,null,value.button)}this._super(key,value);if(
key==="appendTo"){this.menuWrap.appendTo(this._appendTo())}if(key==="width"){this._resizeButton()}},
_setOptionDisabled:function(value){this._super(value);this.menuInstance.option("disabled",value);
this.button.attr("aria-disabled",value);this._toggleClass(this.button,null,"ui-state-disabled",value
);this.element.prop("disabled",value);if(value){this.button.attr("tabindex",-1);this.close()}else{
this.button.attr("tabindex",0)}},_appendTo:function(){var element=this.options.appendTo;if(element){
element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0)}if(
!element||!element[0]){element=this.element.closest(".ui-front, dialog")}if(!element.length){
element=this.document[0].body}return element},_toggleAttr:function(){this.button.attr(
"aria-expanded",this.isOpen);this._removeClass(this.button,"ui-selectmenu-button-"+(
this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(
this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen);
this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var width=this.options.width;
if(width===false){this.button.css("width","");return}if(width===null){width=this.element.show(
).outerWidth();this.element.hide()}this.button.outerWidth(width)},_resizeMenu:function(){
this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},
_getCreateOptions:function(){var options=this._super();options.disabled=this.element.prop("disabled"
);return options},_parseOptions:function(options){var that=this,data=[];options.each(function(index,
item){if(item.hidden){return}data.push(that._parseOption($(item),index))});this.items=data},
_parseOption:function(option,index){var optgroup=option.parent("optgroup");return{element:option,
index:index,value:option.val(),label:option.text(),optgroup:optgroup.attr("label")||"",
disabled:optgroup.prop("disabled")||option.prop("disabled")}},_destroy:function(){
this._unbindFormResetHandler();this.menuWrap.remove();this.button.remove();this.element.show();
this.element.removeUniqueId();this.labels.attr("for",this.ids.element)}}]);
var widgetsSlider=$.widget("ui.slider",$.ui.mouse,{version:"1.13.2",widgetEventPrefix:"slide",
options:{animate:false,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all",
"ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,
orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,
stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;
this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();
this._calculateNewMax();this._addClass("ui-slider ui-slider-"+this.orientation,
"ui-widget ui-widget-content");this._refresh();this._animateOff=false},_refresh:function(){
this._createRange();this._createHandles();this._setupEvents();this._refreshValue()},
_createHandles:function(){var i,handleCount,options=this.options,existingHandles=this.element.find(
".ui-slider-handle"),handle="<span tabindex='0'></span>",handles=[];
handleCount=options.values&&options.values.length||1;if(existingHandles.length>handleCount){
existingHandles.slice(handleCount).remove();existingHandles=existingHandles.slice(0,handleCount)}
for(i=existingHandles.length;i<handleCount;i++){handles.push(handle)}
this.handles=existingHandles.add($(handles.join("")).appendTo(this.element));this._addClass(
this.handles,"ui-slider-handle","ui-state-default");this.handle=this.handles.eq(0);
this.handles.each(function(i){$(this).data("ui-slider-handle-index",i).attr("tabIndex",0)})},
_createRange:function(){var options=this.options;if(options.range){if(options.range===true){if(
!options.values){options.values=[this._valueMin(),this._valueMin()]}else if(
options.values.length&&options.values.length!==2){options.values=[options.values[0],options.values[0
]]}else if(Array.isArray(options.values)){options.values=options.values.slice(0)}}if(
!this.range||!this.range.length){this.range=$("<div>").appendTo(this.element);this._addClass(
this.range,"ui-slider-range")}else{this._removeClass(this.range,
"ui-slider-range-min ui-slider-range-max");this.range.css({left:"",bottom:""})}if(
options.range==="min"||options.range==="max"){this._addClass(this.range,
"ui-slider-range-"+options.range)}}else{if(this.range){this.range.remove()}this.range=null}},
_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);
this._hoverable(this.handles);this._focusable(this.handles)},_destroy:function(){
this.handles.remove();if(this.range){this.range.remove()}this._mouseDestroy()},
_mouseCapture:function(event){var position,normValue,distance,closestHandle,index,allowed,offset,
mouseOverHandle,that=this,o=this.options;if(o.disabled){return false}this.elementSize={
width:this.element.outerWidth(),height:this.element.outerHeight()};
this.elementOffset=this.element.offset();position={x:event.pageX,y:event.pageY};
normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;
this.handles.each(function(i){var thisDistance=Math.abs(normValue-that.values(i));if(
distance>thisDistance||distance===thisDistance&&(i===that._lastChangedValue||that.values(i)===o.min)
){distance=thisDistance;closestHandle=$(this);index=i}});allowed=this._start(event,index);if(
allowed===false){return false}this._mouseSliding=true;this._handleIndex=index;this._addClass(
closestHandle,null,"ui-state-active");closestHandle.trigger("focus");offset=closestHandle.offset();
mouseOverHandle=!$(event.target).parents().addBack().is(".ui-slider-handle");
this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-closestHandle.width(
)/2,top:event.pageY-offset.top-closestHandle.height()/2-(parseInt(closestHandle.css("borderTopWidth"
),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css(
"marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue
)}this._animateOff=true;return true},_mouseStart:function(){return true},_mouseDrag:function(event){
var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(
event,this._handleIndex,normValue);return false},_mouseStop:function(event){this._removeClass(
this.handles,null,"ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);
this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;
this._animateOff=false;return false},_detectOrientation:function(){
this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},
_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;
if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;
pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{
pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(
this._clickOffset?this._clickOffset.top:0)}percentMouse=pixelMouse/pixelTotal;if(percentMouse>1){
percentMouse=1}if(percentMouse<0){percentMouse=0}if(this.orientation==="vertical"){
percentMouse=1-percentMouse}valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin(
)+percentMouse*valueTotal;return this._trimAlignValue(valueMouse)},_uiHash:function(index,value,
values){var uiHash={handle:this.handles[index],handleIndex:index,
value:value!==undefined?value:this.value()};if(this._hasMultipleValues()){
uiHash.value=value!==undefined?value:this.values(index);uiHash.values=values||this.values()}
return uiHash},_hasMultipleValues:function(){return this.options.values&&this.options.values.length
},_start:function(event,index){return this._trigger("start",event,this._uiHash(index))},
_slide:function(event,index,newVal){var allowed,otherVal,currentValue=this.value(),
newValues=this.values();if(this._hasMultipleValues()){otherVal=this.values(index?0:1);
currentValue=this.values(index);if(this.options.values.length===2&&this.options.range===true){
newVal=index===0?Math.min(otherVal,newVal):Math.max(otherVal,newVal)}newValues[index]=newVal}if(
newVal===currentValue){return}allowed=this._trigger("slide",event,this._uiHash(index,newVal,
newValues));if(allowed===false){return}if(this._hasMultipleValues()){this.values(index,newVal)}else{
this.value(newVal)}},_stop:function(event,index){this._trigger("stop",event,this._uiHash(index))},
_change:function(event,index){if(!this._keySliding&&!this._mouseSliding){
this._lastChangedValue=index;this._trigger("change",event,this._uiHash(index))}},value:function(
newValue){if(arguments.length){this.options.value=this._trimAlignValue(newValue);this._refreshValue(
);this._change(null,0);return}return this._value()},values:function(index,newValue){var vals,
newValues,i;if(arguments.length>1){this.options.values[index]=this._trimAlignValue(newValue);
this._refreshValue();this._change(null,index);return}if(arguments.length){if(Array.isArray(
arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i<vals.length;i+=1){vals[i
]=this._trimAlignValue(newValues[i]);this._change(null,i)}this._refreshValue()}else{if(
this._hasMultipleValues()){return this._values(index)}else{return this.value()}}}else{
return this._values()}},_setOption:function(key,value){var i,valsLength=0;if(
key==="range"&&this.options.range===true){if(value==="min"){this.options.value=this._values(0);
this.options.values=null}else if(value==="max"){this.options.value=this._values(
this.options.values.length-1);this.options.values=null}}if(Array.isArray(this.options.values)){
valsLength=this.options.values.length}this._super(key,value);switch(key){case"orientation":
this._detectOrientation();this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass(
"ui-slider-"+this.orientation);this._refreshValue();if(this.options.range){this._refreshRange(value)
}this.handles.css(value==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;
this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":
this._animateOff=true;this._refreshValue();for(i=valsLength-1;i>=0;i--){this._change(null,i)}
this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;
this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":
this._animateOff=true;this._refresh();this._animateOff=false;break}},_setOptionDisabled:function(
value){this._super(value);this._toggleClass(null,"ui-state-disabled",!!value)},_value:function(){
var val=this.options.value;val=this._trimAlignValue(val);return val},_values:function(index){var val
,vals,i;if(arguments.length){val=this.options.values[index];val=this._trimAlignValue(val);return val
}else if(this._hasMultipleValues()){vals=this.options.values.slice();for(i=0;i<vals.length;i+=1){
vals[i]=this._trimAlignValue(vals[i])}return vals}else{return[]}},_trimAlignValue:function(val){if(
val<=this._valueMin()){return this._valueMin()}if(val>=this._valueMax()){return this._valueMax()}
var step=this.options.step>0?this.options.step:1,valModStep=(val-this._valueMin())%step,
alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=valModStep>0?step:-step}
return parseFloat(alignValue.toFixed(5))},_calculateNewMax:function(){var max=this.options.max,
min=this._valueMin(),step=this.options.step,aboveMin=Math.round((max-min)/step)*step;
max=aboveMin+min;if(max>this.options.max){max-=step}this.max=parseFloat(max.toFixed(this._precision(
)))},_precision:function(){var precision=this._precisionOf(this.options.step);if(
this.options.min!==null){precision=Math.max(precision,this._precisionOf(this.options.min))}
return precision},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");
return decimal===-1?0:str.length-decimal-1},_valueMin:function(){return this.options.min},
_valueMax:function(){return this.max},_refreshRange:function(orientation){if(
orientation==="vertical"){this.range.css({width:"",left:""})}if(orientation==="horizontal"){
this.range.css({height:"",bottom:""})}},_refreshValue:function(){var lastValPercent,valPercent,value
,valueMin,valueMax,oRange=this.options.range,o=this.options,that=this,
animate=!this._animateOff?o.animate:false,_set={};if(this._hasMultipleValues()){this.handles.each(
function(i){valPercent=(that.values(i)-that._valueMin())/(that._valueMax()-that._valueMin())*100;
_set[that.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[
animate?"animate":"css"](_set,o.animate);if(that.options.range===true){if(
that.orientation==="horizontal"){if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({
left:valPercent+"%"},o.animate)}if(i===1){that.range[animate?"animate":"css"]({
width:valPercent-lastValPercent+"%"},{queue:false,duration:o.animate})}}else{if(i===0){
that.range.stop(1,1)[animate?"animate":"css"]({bottom:valPercent+"%"},o.animate)}if(i===1){
that.range[animate?"animate":"css"]({height:valPercent-lastValPercent+"%"},{queue:false,
duration:o.animate})}}}lastValPercent=valPercent})}else{value=this.value();valueMin=this._valueMin()
valueMax=this._valueMax();valPercent=valueMax!==valueMin?(value-valueMin)/(valueMax-valueMin)*100:0;
_set[this.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[
animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){
this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate)}if(
oRange==="max"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({
width:100-valPercent+"%"},o.animate)}if(oRange==="min"&&this.orientation==="vertical"){
this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate)}if(
oRange==="max"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({
height:100-valPercent+"%"},o.animate)}}},_handleEvents:{keydown:function(event){var allowed,curVal,
newVal,step,index=$(event.target).data("ui-slider-handle-index");switch(event.keyCode){
case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:
case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:
event.preventDefault();if(!this._keySliding){this._keySliding=true;this._addClass($(event.target),
null,"ui-state-active");allowed=this._start(event,index);if(allowed===false){return}}break}
step=this.options.step;if(this._hasMultipleValues()){curVal=newVal=this.values(index)}else{
curVal=newVal=this.value()}switch(event.keyCode){case $.ui.keyCode.HOME:newVal=this._valueMin();
break;case $.ui.keyCode.END:newVal=this._valueMax();break;case $.ui.keyCode.PAGE_UP:
newVal=this._trimAlignValue(curVal+(this._valueMax()-this._valueMin())/this.numPages);break;
case $.ui.keyCode.PAGE_DOWN:newVal=this._trimAlignValue(curVal-(this._valueMax()-this._valueMin()
)/this.numPages);break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===this._valueMax()){
return}newVal=this._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:
if(curVal===this._valueMin()){return}newVal=this._trimAlignValue(curVal-step);break}this._slide(
event,index,newVal)},keyup:function(event){var index=$(event.target).data("ui-slider-handle-index");
if(this._keySliding){this._keySliding=false;this._stop(event,index);this._change(event,index);
this._removeClass($(event.target),null,"ui-state-active")}}}});var widgetsSortable=$.widget(
"ui.sortable",$.ui.mouse,{version:"1.13.2",widgetEventPrefix:"sort",ready:false,options:{
appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,
dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,
helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,
scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,
beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,
start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){
return x>=reference&&x<reference+size},_isFloating:function(item){return/left|right/.test(item.css(
"float"))||/inline|table-cell/.test(item.css("display"))},_create:function(){this.containerCache={};
this._addClass("ui-sortable");this.refresh();this.offset=this.element.offset();this._mouseInit();
this._setHandleClassName();this.ready=true},_setOption:function(key,value){this._super(key,value);
if(key==="handle"){this._setHandleClassName()}},_setHandleClassName:function(){var that=this;
this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle");$.each(this.items,
function(){that._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle
):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(
var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData(this.widgetName+"-item")}
return this},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=false,
that=this;if(this.reverting){return false}if(this.options.disabled||this.options.type==="static"){
return false}this._refreshItems(event);$(event.target).parents().each(function(){if($.data(this,
that.widgetName+"-item")===that){currentItem=$(this);return false}});if($.data(event.target,
that.widgetName+"-item")===that){currentItem=$(event.target)}if(!currentItem){return false}if(
this.options.handle&&!overrideHandle){$(this.options.handle,currentItem).find("*").addBack().each(
function(){if(this===event.target){validHandle=true}});if(!validHandle){return false}}
this.currentItem=currentItem;this._removeCurrentsFromItems();return true},_mouseStart:function(event
,overrideHandle,noActivation){var i,body,o=this.options;this.currentContainer=this;
this.refreshPositions();this.appendTo=$(o.appendTo!=="parent"?o.appendTo:this.currentItem.parent());
this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();
this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,
left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{
left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},relative:this._getRelativeOffset(
)});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");if(
o.cursorAt){this._adjustOffsetFromHelper(o.cursorAt)}this.domPosition={prev:this.currentItem.prev()[
0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){
this.currentItem.hide()}this._createPlaceholder();this.scrollParent=this.placeholder.scrollParent();
$.extend(this.offset,{parent:this._getParentOffset()});if(o.containment){this._setContainment()}if(
o.cursor&&o.cursor!=="auto"){body=this.document.find("body");this.storedCursor=body.css("cursor");
body.css("cursor",o.cursor);this.storedStylesheet=$(
"<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body)}if(o.zIndex){if(
this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",
o.zIndex)}if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity"
)}this.helper.css("opacity",o.opacity)}if(this.scrollParent[0]!==this.document[0
]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset()}
this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){
this._cacheHelperProportions()}if(!noActivation){for(i=this.containers.length-1;i>=0;i--){
this.containers[i]._trigger("activate",event,this._uiHash(this))}}if($.ui.ddmanager){
$.ui.ddmanager.current=this}if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,
event)}this.dragging=true;this._addClass(this.helper,"ui-sortable-helper");if(!this.helper.parent(
).is(this.appendTo)){this.helper.detach().appendTo(this.appendTo);
this.offset.parent=this._getParentOffset()}
this.position=this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;
this.originalPageY=event.pageY;this.lastPositionAbs=this.positionAbs=this._convertPositionTo(
"absolute");this._mouseDrag(event);return true},_scroll:function(event){var o=this.options,
scrolled=false;if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){
if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-event.pageY<o.scrollSensitivity){
this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed}else if(
event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0
].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed}if(
this.overflowOffset.left+this.scrollParent[0].offsetWidth-event.pageX<o.scrollSensitivity){
this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed}else if(
event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0
].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed}}else{if(
event.pageY-this.document.scrollTop()<o.scrollSensitivity){scrolled=this.document.scrollTop(
this.document.scrollTop()-o.scrollSpeed)}else if(this.window.height()-(
event.pageY-this.document.scrollTop())<o.scrollSensitivity){scrolled=this.document.scrollTop(
this.document.scrollTop()+o.scrollSpeed)}if(event.pageX-this.document.scrollLeft(
)<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed)
}else if(this.window.width()-(event.pageX-this.document.scrollLeft())<o.scrollSensitivity){
scrolled=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed)}}return scrolled},
_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options;
this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(
!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px"}if(
!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px"}if(
o.scroll){if(this._scroll(event)!==false){this._refreshItemPositions(true);if(
$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event)}}}this.dragDirection={
vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()};for(
i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];
intersection=this._intersectsWithPointer(item);if(!intersection){continue}if(
item.instance!==this.currentContainer){continue}if(itemElement!==this.currentItem[0
]&&this.placeholder[intersection===1?"next":"prev"]()[0]!==itemElement&&!$.contains(
this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],
itemElement):true)){this.direction=intersection===1?"down":"up";if(
this.options.tolerance==="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item)
}else{break}this._trigger("change",event,this._uiHash());break}}this._contactContainers(event);if(
$.ui.ddmanager){$.ui.ddmanager.drag(this,event)}this._trigger("sort",event,this._uiHash());
this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(event,noPropagation){if(
!event){return}if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event)}if(
this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={}
if(!axis||axis==="x"){animation.left=cur.left-this.offset.parent.left-this.margins.left+(
this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)}if(!axis||axis==="y"
){animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0
]===this.document[0].body?0:this.offsetParent[0].scrollTop)}this.reverting=true;$(this.helper
).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event)})}else{
this._clear(event,noPropagation)}return false},cancel:function(){if(this.dragging){this._mouseUp(
new $.Event("mouseup",{target:null}));if(this.options.helper==="original"){this.currentItem.css(
this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{
this.currentItem.show()}for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger(
"deactivate",null,this._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i
]._trigger("out",null,this._uiHash(this));this.containers[i].containerCache.over=0}}}if(
this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(
this.placeholder[0])}if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){
this.helper.remove()}$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});
if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem)}else{$(
this.domPosition.parent).prepend(this.currentItem)}}return this},serialize:function(o){
var items=this._getItemsAsjQuery(o&&o.connected),str=[];o=o||{};$(items).each(function(){var res=($(
o.item||this).attr(o.attribute||"id")||"").match(o.expression||/(.+)[\-=_](.+)/);if(res){str.push((
o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]))}});if(!str.length&&o.key){str.push(
o.key+"=")}return str.join("&")},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected
),ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"")});
return ret},_intersectsWith:function(item){var x1=this.positionAbs.left,
x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,
l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,
dxClick=this.offset.click.left,
isOverElementHeight=this.options.axis==="x"||y1+dyClick>t&&y1+dyClick<b,
isOverElementWidth=this.options.axis==="y"||x1+dxClick>l&&x1+dxClick<r,
isOverElement=isOverElementHeight&&isOverElementWidth;if(
this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[
this.floating?"width":"height"]>item[this.floating?"width":"height"]){return isOverElement}else{
return l<x1+this.helperProportions.width/2&&x2-this.helperProportions.width/2<r&&t<y1+this.helperProportions.height/2&&y2-this.helperProportions.height/2<b
}},_intersectsWithPointer:function(item){var verticalDirection,horizontalDirection,
isOverElementHeight=this.options.axis==="x"||this._isOverAxis(
this.positionAbs.top+this.offset.click.top,item.top,item.height),
isOverElementWidth=this.options.axis==="y"||this._isOverAxis(
this.positionAbs.left+this.offset.click.left,item.left,item.width),
isOverElement=isOverElementHeight&&isOverElementWidth;if(!isOverElement){return false}
verticalDirection=this.dragDirection.vertical;horizontalDirection=this.dragDirection.horizontal;
return this.floating?horizontalDirection==="right"||verticalDirection==="down"?2:1:verticalDirection&&(
verticalDirection==="down"?2:1)},_intersectsWithSides:function(item){
var isOverBottomHalf=this._isOverAxis(this.positionAbs.top+this.offset.click.top,
item.top+item.height/2,item.height),isOverRightHalf=this._isOverAxis(
this.positionAbs.left+this.offset.click.left,item.left+item.width/2,item.width),
verticalDirection=this.dragDirection.vertical,horizontalDirection=this.dragDirection.horizontal;if(
this.floating&&horizontalDirection){
return horizontalDirection==="right"&&isOverRightHalf||horizontalDirection==="left"&&!isOverRightHalf
}else{return verticalDirection&&(
verticalDirection==="down"&&isOverBottomHalf||verticalDirection==="up"&&!isOverBottomHalf)}},
_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;
return delta!==0&&(delta>0?"down":"up")},_getDragHorizontalDirection:function(){
var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!==0&&(delta>0?"right":"left")
},refresh:function(event){this._refreshItems(event);this._setHandleClassName();
this.refreshPositions();return this},_connectWith:function(){var options=this.options;
return options.connectWith.constructor===String?[options.connectWith]:options.connectWith},
_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],
connectWith=this._connectWith();if(connectWith&&connected){for(i=connectWith.length-1;i>=0;i--){
cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],
this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([
typeof inst.options.items==="function"?inst.options.items.call(inst.element):$(inst.options.items,
inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst])}}}}queries.push([
typeof this.options.items==="function"?this.options.items.call(this.element,null,{
options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(
".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function addItems(){items.push(this)}
for(i=queries.length-1;i>=0;i--){queries[i][0].each(addItems)}return $(items)},
_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)"
);this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++){if(list[j]===item.item[
0]){return false}}return true})},_refreshItems:function(event){this.items=[];this.containers=[this];
var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[
typeof this.options.items==="function"?this.options.items.call(this.element[0],event,{
item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();
if(connectWith&&this.ready){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[
0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(
inst&&inst!==this&&!inst.options.disabled){queries.push([
typeof inst.options.items==="function"?inst.options.items.call(inst.element[0],event,{
item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst)}}}}for(
i=queries.length-1;i>=0;i--){targetData=queries[i][1];_queries=queries[i][0];for(j=0,
queriesLength=_queries.length;j<queriesLength;j++){item=$(_queries[j]);item.data(
this.widgetName+"-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,
left:0,top:0})}}},_refreshItemPositions:function(fast){var i,item,t,p;for(
i=this.items.length-1;i>=0;i--){item=this.items[i];if(
this.currentContainer&&item.instance!==this.currentContainer&&item.item[0]!==this.currentItem[0]){
continue}t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(
!fast){item.width=t.outerWidth();item.height=t.outerHeight()}p=t.offset();item.left=p.left;
item.top=p.top}},refreshPositions:function(fast){
this.floating=this.items.length?this.options.axis==="x"||this._isFloating(this.items[0].item):false;
if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}
this._refreshItemPositions(fast);var i,p;if(
this.options.custom&&this.options.custom.refreshContainers){
this.options.custom.refreshContainers.call(this)}else{for(i=this.containers.length-1;i>=0;i--){
p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[
i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i
].element.outerWidth();this.containers[i].containerCache.height=this.containers[i
].element.outerHeight()}}return this},_createPlaceholder:function(that){that=that||this;
var className,nodeName,o=that.options;if(!o.placeholder||o.placeholder.constructor===String){
className=o.placeholder;nodeName=that.currentItem[0].nodeName.toLowerCase();o.placeholder={
element:function(){var element=$("<"+nodeName+">",that.document[0]);that._addClass(element,
"ui-sortable-placeholder",className||that.currentItem[0].className)._removeClass(element,
"ui-sortable-helper");if(nodeName==="tbody"){that._createTrPlaceholder(that.currentItem.find("tr"
).eq(0),$("<tr>",that.document[0]).appendTo(element))}else if(nodeName==="tr"){
that._createTrPlaceholder(that.currentItem,element)}else if(nodeName==="img"){element.attr("src",
that.currentItem.attr("src"))}if(!className){element.css("visibility","hidden")}return element},
update:function(container,p){if(className&&!o.forcePlaceholderSize){return}if(!p.height(
)||o.forcePlaceholderSize&&(nodeName==="tbody"||nodeName==="tr")){p.height(
that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(
that.currentItem.css("paddingBottom")||0,10))}if(!p.width()){p.width(that.currentItem.innerWidth(
)-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight"
)||0,10))}}}}that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem));
that.currentItem.after(that.placeholder);o.placeholder.update(that,that.placeholder)},
_createTrPlaceholder:function(sourceTr,targetTr){var that=this;sourceTr.children().each(function(){
$("<td>&#160;</td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(targetTr)}
)},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,
cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(
i=this.containers.length-1;i>=0;i--){if($.contains(this.currentItem[0],this.containers[i].element[0]
)){continue}if(this._intersectsWith(this.containers[i].containerCache)){if(
innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0])){
continue}innermostContainer=this.containers[i];innermostIndex=i}else{if(this.containers[i
].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i
].containerCache.over=0}}}if(!innermostContainer){return}if(this.containers.length===1){if(
!this.containers[innermostIndex].containerCache.over){this.containers[innermostIndex]._trigger(
"over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1}}else{
dist=1e4;itemWithLeastDistance=null;floating=innermostContainer.floating||this._isFloating(
this.currentItem);posProperty=floating?"left":"top";sizeProperty=floating?"width":"height";
axis=floating?"pageX":"pageY";for(j=this.items.length-1;j>=0;j--){if(!$.contains(this.containers[
innermostIndex].element[0],this.items[j].item[0])){continue}if(this.items[j].item[0
]===this.currentItem[0]){continue}cur=this.items[j].item.offset()[posProperty];nearBottom=false;if(
event[axis]-cur>this.items[j][sizeProperty]/2){nearBottom=true}if(Math.abs(event[axis]-cur)<dist){
dist=Math.abs(event[axis]-cur);itemWithLeastDistance=this.items[j];
this.direction=nearBottom?"up":"down"}}if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return}
if(this.currentContainer===this.containers[innermostIndex]){if(
!this.currentContainer.containerCache.over){this.containers[innermostIndex]._trigger("over",event,
this._uiHash());this.currentContainer.containerCache.over=1}return}if(itemWithLeastDistance){
this._rearrange(event,itemWithLeastDistance,null,true)}else{this._rearrange(event,null,
this.containers[innermostIndex].element,true)}this._trigger("change",event,this._uiHash());
this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));
this.currentContainer=this.containers[innermostIndex];this.options.placeholder.update(
this.currentContainer,this.placeholder);this.scrollParent=this.placeholder.scrollParent();if(
this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){
this.overflowOffset=this.scrollParent.offset()}this.containers[innermostIndex]._trigger("over",event
,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1}},_createHelper:function(
event){var o=this.options,helper=typeof o.helper==="function"?$(o.helper.apply(this.element[0],[
event,this.currentItem])):o.helper==="clone"?this.currentItem.clone():this.currentItem;if(
!helper.parents("body").length){this.appendTo[0].appendChild(helper[0])}if(helper[0
]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,
height:this.currentItem[0].style.height,position:this.currentItem.css("position"),
top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(!helper[0
].style.width||o.forceHelperSize){helper.width(this.currentItem.width())}if(!helper[0
].style.height||o.forceHelperSize){helper.height(this.currentItem.height())}return helper},
_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ")}if(Array.isArray(
obj)){obj={left:+obj[0],top:+obj[1]||0}}if("left"in obj){
this.offset.click.left=obj.left+this.margins.left}if("right"in obj){
this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left}if("top"in obj){
this.offset.click.top=obj.top+this.margins.top}if("bottom"in obj){
this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top}},
_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();
var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0
]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0])){
po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0
]===this.document[0].body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase(
)==="html"&&$.ui.ie){po={top:0,left:0}}return{top:po.top+(parseInt(this.offsetParent.css(
"borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},
_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.currentItem.position();
return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),
left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{
top:0,left:0}}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css(
"marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},
_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),
height:this.helper.outerHeight()}},_setContainment:function(){var ce,co,over,o=this.options;if(
o.containment==="parent"){o.containment=this.helper[0].parentNode}if(
o.containment==="document"||o.containment==="window"){this.containment=[
0-this.offset.relative.left-this.offset.parent.left,
0-this.offset.relative.top-this.offset.parent.top,o.containment==="document"?this.document.width(
):this.window.width()-this.helperProportions.width-this.margins.left,(
o.containment==="document"?this.document.height(
)||document.body.parentNode.scrollHeight:this.window.height()||this.document[0
].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(
!/^(document|window|parent)$/.test(o.containment)){ce=$(o.containment)[0];co=$(o.containment
).offset();over=$(ce).css("overflow")!=="hidden";this.containment=[co.left+(parseInt($(ce).css(
"borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(
parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0
)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt(
$(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0
)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,
ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css(
"paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},
_convertPositionTo:function(d,pos){if(!pos){pos=this.position}var mod=d==="absolute"?1:-1,
scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(
this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,
scrollIsRootNode=/(html|body)/i.test(scroll[0].tagName);return{
top:pos.top+this.offset.relative.top*mod+this.offset.parent.top*mod-(
this.cssPosition==="fixed"?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop()
)*mod,left:pos.left+this.offset.relative.left*mod+this.offset.parent.left*mod-(
this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft()
)*mod}},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,
pageY=event.pageY,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0
]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,
scrollIsRootNode=/(html|body)/i.test(scroll[0].tagName);if(this.cssPosition==="relative"&&!(
this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){
this.offset.relative=this._getRelativeOffset()}if(this.originalPosition){if(this.containment){if(
event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0
]+this.offset.click.left}if(event.pageY-this.offset.click.top<this.containment[1]){
pageY=this.containment[1]+this.offset.click.top}if(
event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2
]+this.offset.click.left}if(event.pageY-this.offset.click.top>this.containment[3]){
pageY=this.containment[3]+this.offset.click.top}}if(o.grid){top=this.originalPageY+Math.round((
pageY-this.originalPageY)/o.grid[1])*o.grid[1];
pageY=this.containment?top-this.offset.click.top>=this.containment[1
]&&top-this.offset.click.top<=this.containment[3]?top:top-this.offset.click.top>=this.containment[1
]?top-o.grid[1]:top+o.grid[1]:top;left=this.originalPageX+Math.round((pageX-this.originalPageX
)/o.grid[0])*o.grid[0];pageX=this.containment?left-this.offset.click.left>=this.containment[0
]&&left-this.offset.click.left<=this.containment[2
]?left:left-this.offset.click.left>=this.containment[0]?left-o.grid[0]:left+o.grid[0]:left}}return{
top:pageY-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(
this.cssPosition==="fixed"?-this.scrollParent.scrollTop():scrollIsRootNode?0:scroll.scrollTop()),
left:pageX-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(
this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())}
},_rearrange:function(event,i,a,hardRefresh){if(a){a[0].appendChild(this.placeholder[0])}else{
i.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?i.item[0]:i.item[0
].nextSibling)}this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(
function(){if(counter===this.counter){this.refreshPositions(!hardRefresh)}})},_clear:function(event,
noPropagation){this.reverting=false;var i,delayedTriggers=[];if(
!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem)}
this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(
this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]=""}}
this.currentItem.css(this._storedCSS);this._removeClass(this.currentItem,"ui-sortable-helper")}else{
this.currentItem.show()}if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){
this._trigger("receive",event,this._uiHash(this.fromOutside))})}if((
this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0
]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(
function(event){this._trigger("update",event,this._uiHash())})}if(this!==this.currentContainer){if(
!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash())});
delayedTriggers.push(function(c){return function(event){c._trigger("receive",event,this._uiHash(this
))}}.call(this,this.currentContainer));delayedTriggers.push(function(c){return function(event){
c._trigger("update",event,this._uiHash(this))}}.call(this,this.currentContainer))}}
function delayEvent(type,instance,container){return function(event){container._trigger(type,event,
instance._uiHash(instance))}}for(i=this.containers.length-1;i>=0;i--){if(!noPropagation){
delayedTriggers.push(delayEvent("deactivate",this,this.containers[i]))}if(this.containers[i
].containerCache.over){delayedTriggers.push(delayEvent("out",this,this.containers[i]));
this.containers[i].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css(
"cursor",this.storedCursor);this.storedStylesheet.remove()}if(this._storedOpacity){this.helper.css(
"opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",
this._storedZIndex==="auto"?"":this._storedZIndex)}this.dragging=false;if(!noPropagation){
this._trigger("beforeStop",event,this._uiHash())}this.placeholder[0].parentNode.removeChild(
this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){
this.helper.remove()}this.helper=null}if(!noPropagation){for(i=0;i<delayedTriggers.length;i++){
delayedTriggers[i].call(this,event)}this._trigger("stop",event,this._uiHash())}
this.fromOutside=false;return!this.cancelHelperRemoval},_trigger:function(){if(
$.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(_inst){
var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),
position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,
item:inst.currentItem,sender:_inst?_inst.element:null}}});function spinnerModifier(fn){
return function(){var previous=this.element.val();fn.apply(this,arguments);this._refresh();if(
previous!==this.element.val()){this._trigger("change")}}}$.widget("ui.spinner",{version:"1.13.2",
defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all",
"ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{
down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:true,max:null,min:null,
numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){
this._setOption("max",this.options.max);this._setOption("min",this.options.min);this._setOption(
"step",this.options.step);if(this.value()!==""){this._value(this.element.val(),true)}this._draw();
this._on(this._events);this._refresh();this._on(this.window,{beforeunload:function(){
this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var options=this._super();
var element=this.element;$.each(["min","max","step"],function(i,option){var value=element.attr(
option);if(value!=null&&value.length){options[option]=value}});return options},_events:{
keydown:function(event){if(this._start(event)&&this._keydown(event)){event.preventDefault()}},
keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(event){if(
this.cancelBlur){delete this.cancelBlur;return}this._stop();this._refresh();if(
this.previous!==this.element.val()){this._trigger("change",event)}},mousewheel:function(event,delta
){var activeElement=$.ui.safeActiveElement(this.document[0]);var isActive=this.element[0
]===activeElement;if(!isActive||!delta){return}if(!this.spinning&&!this._start(event)){return false}
this._spin((delta>0?1:-1)*this.options.step,event);clearTimeout(this.mousewheelTimer);
this.mousewheelTimer=this._delay(function(){if(this.spinning){this._stop(event)}},100);
event.preventDefault()},"mousedown .ui-spinner-button":function(event){var previous;
previous=this.element[0]===$.ui.safeActiveElement(this.document[0])?this.previous:this.element.val()
function checkFocus(){var isActive=this.element[0]===$.ui.safeActiveElement(this.document[0]);if(
!isActive){this.element.trigger("focus");this.previous=previous;this._delay(function(){
this.previous=previous})}}event.preventDefault();checkFocus.call(this);this.cancelBlur=true;
this._delay(function(){delete this.cancelBlur;checkFocus.call(this)});if(this._start(event)===false
){return}this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event)},
"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(event){if(!$(
event.currentTarget).hasClass("ui-state-active")){return}if(this._start(event)===false){return false
}this._repeat(null,$(event.currentTarget).hasClass("ui-spinner-up")?1:-1,event)},
"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr(
"autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){
this._enhance();this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content");
this._addClass("ui-spinner-input");this.element.attr("role","spinbutton");
this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",true).button({
classes:{"ui-button":""}});this._removeClass(this.buttons,"ui-corner-all");this._addClass(
this.buttons.first(),"ui-spinner-button ui-spinner-up");this._addClass(this.buttons.last(),
"ui-spinner-button ui-spinner-down");this.buttons.first().button({icon:this.options.icons.up,
showLabel:false});this.buttons.last().button({icon:this.options.icons.down,showLabel:false});if(
this.buttons.height()>Math.ceil(this.uiSpinner.height()*.5)&&this.uiSpinner.height()>0){
this.uiSpinner.height(this.uiSpinner.height())}},_keydown:function(event){var options=this.options,
keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.UP:this._repeat(null,1,event);return true;
case keyCode.DOWN:this._repeat(null,-1,event);return true;case keyCode.PAGE_UP:this._repeat(null,
options.page,event);return true;case keyCode.PAGE_DOWN:this._repeat(null,-options.page,event);
return true}return false},_start:function(event){if(!this.spinning&&this._trigger("start",event
)===false){return false}if(!this.counter){this.counter=1}this.spinning=true;return true},
_repeat:function(i,steps,event){i=i||500;clearTimeout(this.timer);this.timer=this._delay(function(){
this._repeat(40,steps,event)},i);this._spin(steps*this.options.step,event)},_spin:function(step,
event){var value=this.value()||0;if(!this.counter){this.counter=1}value=this._adjustValue(
value+step*this._increment(this.counter));if(!this.spinning||this._trigger("spin",event,{value:value
})!==false){this._value(value);this.counter++}},_increment:function(i){
var incremental=this.options.incremental;if(incremental){
return typeof incremental==="function"?incremental(i):Math.floor(i*i*i/5e4-i*i/500+17*i/200+1)}
return 1},_precision:function(){var precision=this._precisionOf(this.options.step);if(
this.options.min!==null){precision=Math.max(precision,this._precisionOf(this.options.min))}
return precision},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");
return decimal===-1?0:str.length-decimal-1},_adjustValue:function(value){var base,aboveMin,
options=this.options;base=options.min!==null?options.min:0;aboveMin=value-base;aboveMin=Math.round(
aboveMin/options.step)*options.step;value=base+aboveMin;value=parseFloat(value.toFixed(
this._precision()));if(options.max!==null&&value>options.max){return options.max}if(
options.min!==null&&value<options.min){return options.min}return value},_stop:function(event){if(
!this.spinning){return}clearTimeout(this.timer);clearTimeout(this.mousewheelTimer);this.counter=0;
this.spinning=false;this._trigger("stop",event)},_setOption:function(key,value){var prevValue,first,
last;if(key==="culture"||key==="numberFormat"){prevValue=this._parse(this.element.val());
this.options[key]=value;this.element.val(this._format(prevValue));return}if(
key==="max"||key==="min"||key==="step"){if(typeof value==="string"){value=this._parse(value)}}if(
key==="icons"){first=this.buttons.first().find(".ui-icon");this._removeClass(first,null,
this.options.icons.up);this._addClass(first,null,value.up);last=this.buttons.last().find(".ui-icon")
this._removeClass(last,null,this.options.icons.down);this._addClass(last,null,value.down)}
this._super(key,value)},_setOptionDisabled:function(value){this._super(value);this._toggleClass(
this.uiSpinner,null,"ui-state-disabled",!!value);this.element.prop("disabled",!!value);
this.buttons.button(value?"disable":"enable")},_setOptions:spinnerModifier(function(options){
this._super(options)}),_parse:function(val){if(typeof val==="string"&&val!==""){
val=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(val,10,this.options.culture
):+val}return val===""||isNaN(val)?null:val},_format:function(value){if(value===""){return""}
return window.Globalize&&this.options.numberFormat?Globalize.format(value,this.options.numberFormat,
this.options.culture):value},_refresh:function(){this.element.attr({
"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(
this.element.val())})},isValid:function(){var value=this.value();if(value===null){return false}
return value===this._adjustValue(value)},_value:function(value,allowAny){var parsed;if(value!==""){
parsed=this._parse(value);if(parsed!==null){if(!allowAny){parsed=this._adjustValue(parsed)}
value=this._format(parsed)}}this.element.val(value);this._refresh()},_destroy:function(){
this.element.prop("disabled",false).removeAttr(
"autocomplete role aria-valuemin aria-valuemax aria-valuenow");this.uiSpinner.replaceWith(
this.element)},stepUp:spinnerModifier(function(steps){this._stepUp(steps)}),_stepUp:function(steps){
if(this._start()){this._spin((steps||1)*this.options.step);this._stop()}},stepDown:spinnerModifier(
function(steps){this._stepDown(steps)}),_stepDown:function(steps){if(this._start()){this._spin((
steps||1)*-this.options.step);this._stop()}},pageUp:spinnerModifier(function(pages){this._stepUp((
pages||1)*this.options.page)}),pageDown:spinnerModifier(function(pages){this._stepDown((pages||1
)*this.options.page)}),value:function(newVal){if(!arguments.length){return this._parse(
this.element.val())}spinnerModifier(this._value).call(this,newVal)},widget:function(){
return this.uiSpinner}});if($.uiBackCompat!==false){$.widget("ui.spinner",$.ui.spinner,{
_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml(
)).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},
_buttonHtml:function(){return"<a></a><a></a>"}})}var widgetsSpinner=$.ui.spinner;$.widget("ui.tabs",
{version:"1.13.2",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all",
"ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},
collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,
beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var rhash=/#.*$/;return function(
anchor){var anchorUrl,locationUrl;anchorUrl=anchor.href.replace(rhash,"");
locationUrl=location.href.replace(rhash,"");try{anchorUrl=decodeURIComponent(anchorUrl)}catch(error
){}try{locationUrl=decodeURIComponent(locationUrl)}catch(error){}
return anchor.hash.length>1&&anchorUrl===locationUrl}}(),_create:function(){var that=this,
options=this.options;this.running=false;this._addClass("ui-tabs","ui-widget ui-widget-content");
this._toggleClass("ui-tabs-collapsible",null,options.collapsible);this._processTabs();
options.active=this._initialActive();if(Array.isArray(options.disabled)){
options.disabled=$.uniqueSort(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"),
function(li){return that.tabs.index(li)}))).sort()}if(
this.options.active!==false&&this.anchors.length){this.active=this._findActive(options.active)}else{
this.active=$()}this._refresh();if(this.active.length){this.load(options.active)}},
_initialActive:function(){var active=this.options.active,collapsible=this.options.collapsible,
locationHash=location.hash.substring(1);if(active===null){if(locationHash){this.tabs.each(function(i
,tab){if($(tab).attr("aria-controls")===locationHash){active=i;return false}})}if(active===null){
active=this.tabs.index(this.tabs.filter(".ui-tabs-active"))}if(active===null||active===-1){
active=this.tabs.length?0:false}}if(active!==false){active=this.tabs.index(this.tabs.eq(active));if(
active===-1){active=collapsible?false:0}}if(!collapsible&&active===false&&this.anchors.length){
active=0}return active},_getCreateEventData:function(){return{tab:this.active,
panel:!this.active.length?$():this._getPanelForTab(this.active)}},_tabKeydown:function(event){
var focusedTab=$($.ui.safeActiveElement(this.document[0])).closest("li"),
selectedIndex=this.tabs.index(focusedTab),goingForward=true;if(this._handlePageNav(event)){return}
switch(event.keyCode){case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:selectedIndex++;break;
case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:goingForward=false;selectedIndex--;break;
case $.ui.keyCode.END:selectedIndex=this.anchors.length-1;break;case $.ui.keyCode.HOME:
selectedIndex=0;break;case $.ui.keyCode.SPACE:event.preventDefault();clearTimeout(this.activating);
this._activate(selectedIndex);return;case $.ui.keyCode.ENTER:event.preventDefault();clearTimeout(
this.activating);this._activate(selectedIndex===this.options.active?false:selectedIndex);return;
default:return}event.preventDefault();clearTimeout(this.activating);
selectedIndex=this._focusNextTab(selectedIndex,goingForward);if(!event.ctrlKey&&!event.metaKey){
focusedTab.attr("aria-selected","false");this.tabs.eq(selectedIndex).attr("aria-selected","true");
this.activating=this._delay(function(){this.option("active",selectedIndex)},this.delay)}},
_panelKeydown:function(event){if(this._handlePageNav(event)){return}if(
event.ctrlKey&&event.keyCode===$.ui.keyCode.UP){event.preventDefault();this.active.trigger("focus")}
},_handlePageNav:function(event){if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP){
this._activate(this._focusNextTab(this.options.active-1,false));return true}if(
event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(
this.options.active+1,true));return true}},_findNextTab:function(index,goingForward){
var lastTabIndex=this.tabs.length-1;function constrain(){if(index>lastTabIndex){index=0}if(index<0){
index=lastTabIndex}return index}while($.inArray(constrain(),this.options.disabled)!==-1){
index=goingForward?index+1:index-1}return index},_focusNextTab:function(index,goingForward){
index=this._findNextTab(index,goingForward);this.tabs.eq(index).trigger("focus");return index},
_setOption:function(key,value){if(key==="active"){this._activate(value);return}this._super(key,value
);if(key==="collapsible"){this._toggleClass("ui-tabs-collapsible",null,value);if(
!value&&this.options.active===false){this._activate(0)}}if(key==="event"){this._setupEvents(value)}
if(key==="heightStyle"){this._setupHeightStyle(value)}},_sanitizeSelector:function(hash){
return hash?hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){
var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(
lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab)});this._processTabs();if(
options.active===false||!this.anchors.length){options.active=false;this.active=$()}else if(
this.active.length&&!$.contains(this.tablist[0],this.active[0])){if(
this.tabs.length===options.disabled.length){options.active=false;this.active=$()}else{
this._activate(this._findNextTab(Math.max(0,options.active-1),false))}}else{
options.active=this.tabs.index(this.active)}this._refresh()},_refresh:function(){
this._setOptionDisabled(this.options.disabled);this._setupEvents(this.options.event);
this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({
"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(
this.active)).hide().attr({"aria-hidden":"true"});if(!this.active.length){this.tabs.eq(0).attr(
"tabIndex",0)}else{this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});
this._addClass(this.active,"ui-tabs-active","ui-state-active");this._getPanelForTab(this.active
).show().attr({"aria-hidden":"false"})}},_processTabs:function(){var that=this,prevTabs=this.tabs,
prevAnchors=this.anchors,prevPanels=this.panels;this.tablist=this._getList().attr("role","tablist");
this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header");
this.tablist.on("mousedown"+this.eventNamespace,"> li",function(event){if($(this).is(
".ui-state-disabled")){event.preventDefault()}}).on("focus"+this.eventNamespace,".ui-tabs-anchor",
function(){if($(this).closest("li").is(".ui-state-disabled")){this.blur()}});
this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1});this._addClass(
this.tabs,"ui-tabs-tab","ui-state-default");this.anchors=this.tabs.map(function(){return $("a",this
)[0]}).attr({tabIndex:-1});this._addClass(this.anchors,"ui-tabs-anchor");this.panels=$();
this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr(
"id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");if(that._isLocal(
anchor)){selector=anchor.hash;panelId=selector.substring(1);panel=that.element.find(
that._sanitizeSelector(selector))}else{panelId=tab.attr("aria-controls")||$({}).uniqueId()[0].id;
selector="#"+panelId;panel=that.element.find(selector);if(!panel.length){panel=that._createPanel(
panelId);panel.insertAfter(that.panels[i-1]||that.tablist)}panel.attr("aria-live","polite")}if(
panel.length){that.panels=that.panels.add(panel)}if(originalAriaControls){tab.data(
"ui-tabs-aria-controls",originalAriaControls)}tab.attr({"aria-controls":panelId,
"aria-labelledby":anchorId});panel.attr("aria-labelledby",anchorId)});this.panels.attr("role",
"tabpanel");this._addClass(this.panels,"ui-tabs-panel","ui-widget-content");if(prevTabs){this._off(
prevTabs.not(this.tabs));this._off(prevAnchors.not(this.anchors));this._off(prevPanels.not(
this.panels))}},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},
_createPanel:function(id){return $("<div>").attr("id",id).data("ui-tabs-destroy",true)},
_setOptionDisabled:function(disabled){var currentItem,li,i;if(Array.isArray(disabled)){if(
!disabled.length){disabled=false}else if(disabled.length===this.anchors.length){disabled=true}}for(
i=0;li=this.tabs[i];i++){currentItem=$(li);if(disabled===true||$.inArray(i,disabled)!==-1){
currentItem.attr("aria-disabled","true");this._addClass(currentItem,null,"ui-state-disabled")}else{
currentItem.removeAttr("aria-disabled");this._removeClass(currentItem,null,"ui-state-disabled")}}
this.options.disabled=disabled;this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,
disabled===true)},_setupEvents:function(event){var events={};if(event){$.each(event.split(" "),
function(index,eventName){events[eventName]="_eventHandler"})}this._off(this.anchors.add(this.tabs
).add(this.panels));this._on(true,this.anchors,{click:function(event){event.preventDefault()}});
this._on(this.anchors,events);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{
keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs)},
_setupHeightStyle:function(heightStyle){var maxHeight,parent=this.element.parent();if(
heightStyle==="fill"){maxHeight=parent.height();maxHeight-=this.element.outerHeight(
)-this.element.height();this.element.siblings(":visible").each(function(){var elem=$(this),
position=elem.css("position");if(position==="absolute"||position==="fixed"){return}
maxHeight-=elem.outerHeight(true)});this.element.children().not(this.panels).each(function(){
maxHeight-=$(this).outerHeight(true)});this.panels.each(function(){$(this).height(Math.max(0,
maxHeight-$(this).innerHeight()+$(this).height()))}).css("overflow","auto")}else if(
heightStyle==="auto"){maxHeight=0;this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this
).height("").height())}).height(maxHeight)}},_eventHandler:function(event){var options=this.options,
active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0
]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$(
):this._getPanelForTab(tab),toHide=!active.length?$():this._getPanelForTab(active),eventData={
oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};event.preventDefault();if(
tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading"
)||this.running||clickedIsActive&&!options.collapsible||this._trigger("beforeActivate",event,
eventData)===false){return}options.active=collapsing?false:this.tabs.index(tab);
this.active=clickedIsActive?$():tab;if(this.xhr){this.xhr.abort()}if(!toHide.length&&!toShow.length
){$.error("jQuery UI Tabs: Mismatching fragment identifier.")}if(toShow.length){this.load(
this.tabs.index(tab),event)}this._toggle(event,eventData)},_toggle:function(event,eventData){
var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=true;
function complete(){that.running=false;that._trigger("activate",event,eventData)}function show(){
that._addClass(eventData.newTab.closest("li"),"ui-tabs-active","ui-state-active");if(
toShow.length&&that.options.show){that._show(toShow,that.options.show,complete)}else{toShow.show();
complete()}}if(toHide.length&&this.options.hide){this._hide(toHide,this.options.hide,function(){
that._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active");show()})}else{
this._removeClass(eventData.oldTab.closest("li"),"ui-tabs-active","ui-state-active");toHide.hide();
show()}toHide.attr("aria-hidden","true");eventData.oldTab.attr({"aria-selected":"false",
"aria-expanded":"false"});if(toShow.length&&toHide.length){eventData.oldTab.attr("tabIndex",-1)
}else if(toShow.length){this.tabs.filter(function(){return $(this).attr("tabIndex")===0}).attr(
"tabIndex",-1)}toShow.attr("aria-hidden","false");eventData.newTab.attr({"aria-selected":"true",
"aria-expanded":"true",tabIndex:0})},_activate:function(index){var anchor,active=this._findActive(
index);if(active[0]===this.active[0]){return}if(!active.length){active=this.active}
anchor=active.find(".ui-tabs-anchor")[0];this._eventHandler({target:anchor,currentTarget:anchor,
preventDefault:$.noop})},_findActive:function(index){return index===false?$():this.tabs.eq(index)},
_getIndex:function(index){if(typeof index==="string"){index=this.anchors.index(this.anchors.filter(
"[href$='"+$.escapeSelector(index)+"']"))}return index},_destroy:function(){if(this.xhr){
this.xhr.abort()}this.tablist.removeAttr("role").off(this.eventNamespace);this.anchors.removeAttr(
"role tabIndex").removeUniqueId();this.tabs.add(this.panels).each(function(){if($.data(this,
"ui-tabs-destroy")){$(this).remove()}else{$(this).removeAttr(
"role tabIndex "+"aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}});
this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");if(prev){li.attr(
"aria-controls",prev).removeData("ui-tabs-aria-controls")}else{li.removeAttr("aria-controls")}});
this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","")}},
enable:function(index){var disabled=this.options.disabled;if(disabled===false){return}if(
index===undefined){disabled=false}else{index=this._getIndex(index);if(Array.isArray(disabled)){
disabled=$.map(disabled,function(num){return num!==index?num:null})}else{disabled=$.map(this.tabs,
function(li,num){return num!==index?num:null})}}this._setOptionDisabled(disabled)},disable:function(
index){var disabled=this.options.disabled;if(disabled===true){return}if(index===undefined){
disabled=true}else{index=this._getIndex(index);if($.inArray(index,disabled)!==-1){return}if(
Array.isArray(disabled)){disabled=$.merge([index],disabled).sort()}else{disabled=[index]}}
this._setOptionDisabled(disabled)},load:function(index,event){index=this._getIndex(index);
var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(
tab),eventData={tab:tab,panel:panel},complete=function(jqXHR,status){if(status==="abort"){
that.panels.stop(false,true)}that._removeClass(tab,"ui-tabs-loading");panel.removeAttr("aria-busy");
if(jqXHR===that.xhr){delete that.xhr}};if(this._isLocal(anchor[0])){return}this.xhr=$.ajax(
this._ajaxSettings(anchor,event,eventData));if(this.xhr&&this.xhr.statusText!=="canceled"){
this._addClass(tab,"ui-tabs-loading");panel.attr("aria-busy","true");this.xhr.done(function(response
,status,jqXHR){setTimeout(function(){panel.html(response);that._trigger("load",event,eventData);
complete(jqXHR,status)},1)}).fail(function(jqXHR,status){setTimeout(function(){complete(jqXHR,status
)},1)})}},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href"
).replace(/#.*$/,""),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,
$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData))}}},_getPanelForTab:function(tab){var id=$(
tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id))}});if(
$.uiBackCompat!==false){$.widget("ui.tabs",$.ui.tabs,{_processTabs:function(){this._superApply(
arguments);this._addClass(this.tabs,"ui-tab")}})}var widgetsTabs=$.ui.tabs;$.widget("ui.tooltip",{
version:"1.13.2",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(
){var title=$(this).attr("title");return $("<a>").text(title).html()},hide:true,
items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"
},show:true,track:false,close:null,open:null},_addDescribedBy:function(elem,id){var describedby=(
elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id);elem.data("ui-tooltip-id",id
).attr("aria-describedby",String.prototype.trim.call(describedby.join(" ")))},
_removeDescribedBy:function(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr(
"aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);if(index!==-1){
describedby.splice(index,1)}elem.removeData("ui-tooltip-id");describedby=String.prototype.trim.call(
describedby.join(" "));if(describedby){elem.attr("aria-describedby",describedby)}else{
elem.removeAttr("aria-describedby")}},_create:function(){this._on({mouseover:"open",focusin:"open"})
this.tooltips={};this.parents={};this.liveRegion=$("<div>").attr({role:"log",
"aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body);
this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible");this.disabledTitles=$([])},
_setOption:function(key,value){var that=this;this._super(key,value);if(key==="content"){$.each(
this.tooltips,function(id,tooltipData){that._updateContent(tooltipData.element)})}},
_setOptionDisabled:function(value){this[value?"_disable":"_enable"]()},_disable:function(){
var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur");
event.target=event.currentTarget=tooltipData.element[0];that.close(event,true)});
this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(
function(){var element=$(this);if(element.is("[title]")){return element.data("ui-tooltip-title",
element.attr("title")).removeAttr("title")}}))},_enable:function(){this.disabledTitles.each(
function(){var element=$(this);if(element.data("ui-tooltip-title")){element.attr("title",
element.data("ui-tooltip-title"))}});this.disabledTitles=$([])},open:function(event){var that=this,
target=$(event?event.target:this.element).closest(this.options.items);if(
!target.length||target.data("ui-tooltip-id")){return}if(target.attr("title")){target.data(
"ui-tooltip-title",target.attr("title"))}target.data("ui-tooltip-open",true);if(
event&&event.type==="mouseover"){target.parents().each(function(){var parent=$(this),blurEvent;if(
parent.data("ui-tooltip-open")){blurEvent=$.Event("blur");
blurEvent.target=blurEvent.currentTarget=this;that.close(blurEvent,true)}if(parent.attr("title")){
parent.uniqueId();that.parents[this.id]={element:this,title:parent.attr("title")};parent.attr(
"title","")}})}this._registerCloseHandlers(event,target);this._updateContent(target,event)},
_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,
eventType=event?event.type:null;if(
typeof contentOption==="string"||contentOption.nodeType||contentOption.jquery){return this._open(
event,target,contentOption)}content=contentOption.call(target[0],function(response){that._delay(
function(){if(!target.data("ui-tooltip-open")){return}if(event){event.type=eventType}this._open(
event,target,response)})});if(content){this._open(event,target,content)}},_open:function(event,
target,content){var tooltipData,tooltip,delayedShow,a11yContent,positionOption=$.extend({},
this.options.position);if(!content){return}tooltipData=this._find(target);if(tooltipData){
tooltipData.tooltip.find(".ui-tooltip-content").html(content);return}if(target.is("[title]")){if(
event&&event.type==="mouseover"){target.attr("title","")}else{target.removeAttr("title")}}
tooltipData=this._tooltip(target);tooltip=tooltipData.tooltip;this._addDescribedBy(target,
tooltip.attr("id"));tooltip.find(".ui-tooltip-content").html(content);this.liveRegion.children(
).hide();a11yContent=$("<div>").html(tooltip.find(".ui-tooltip-content").html());
a11yContent.removeAttr("name").find("[name]").removeAttr("name");a11yContent.removeAttr("id").find(
"[id]").removeAttr("id");a11yContent.appendTo(this.liveRegion);function position(event){
positionOption.of=event;if(tooltip.is(":hidden")){return}tooltip.position(positionOption)}if(
this.options.track&&event&&/^mouse/.test(event.type)){this._on(this.document,{mousemove:position});
position(event)}else{tooltip.position($.extend({of:target},this.options.position))}tooltip.hide();
this._show(tooltip,this.options.show);if(
this.options.track&&this.options.show&&this.options.show.delay){
delayedShow=this.delayedShow=setInterval(function(){if(tooltip.is(":visible")){position(
positionOption.of);clearInterval(delayedShow)}},13)}this._trigger("open",event,{tooltip:tooltip})},
_registerCloseHandlers:function(event,target){var events={keyup:function(event){if(
event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0];
this.close(fakeEvent,true)}}};if(target[0]!==this.element[0]){events.remove=function(){
var targetElement=this._find(target);if(targetElement){this._removeTooltip(targetElement.tooltip)}}}
if(!event||event.type==="mouseover"){events.mouseleave="close"}if(!event||event.type==="focusin"){
events.focusout="close"}this._on(true,target,events)},close:function(event){var tooltip,that=this,
target=$(event?event.currentTarget:this.element),tooltipData=this._find(target);if(!tooltipData){
target.removeData("ui-tooltip-open");return}tooltip=tooltipData.tooltip;if(tooltipData.closing){
return}clearInterval(this.delayedShow);if(target.data("ui-tooltip-title")&&!target.attr("title")){
target.attr("title",target.data("ui-tooltip-title"))}this._removeDescribedBy(target);
tooltipData.hiding=true;tooltip.stop(true);this._hide(tooltip,this.options.hide,function(){
that._removeTooltip($(this))});target.removeData("ui-tooltip-open");this._off(target,
"mouseleave focusout keyup");if(target[0]!==this.element[0]){this._off(target,"remove")}this._off(
this.document,"mousemove");if(event&&event.type==="mouseleave"){$.each(this.parents,function(id,
parent){$(parent.element).attr("title",parent.title);delete that.parents[id]})}
tooltipData.closing=true;this._trigger("close",event,{tooltip:tooltip});if(!tooltipData.hiding){
tooltipData.closing=false}},_tooltip:function(element){var tooltip=$("<div>").attr("role","tooltip")
,content=$("<div>").appendTo(tooltip),id=tooltip.uniqueId().attr("id");this._addClass(content,
"ui-tooltip-content");this._addClass(tooltip,"ui-tooltip","ui-widget ui-widget-content");
tooltip.appendTo(this._appendTo(element));return this.tooltips[id]={element:element,tooltip:tooltip}
},_find:function(target){var id=target.data("ui-tooltip-id");return id?this.tooltips[id]:null},
_removeTooltip:function(tooltip){clearInterval(this.delayedShow);tooltip.remove();
delete this.tooltips[tooltip.attr("id")]},_appendTo:function(target){var element=target.closest(
".ui-front, dialog");if(!element.length){element=this.document[0].body}return element},
_destroy:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event(
"blur"),element=tooltipData.element;event.target=event.currentTarget=element[0];that.close(event,
true);$("#"+id).remove();if(element.data("ui-tooltip-title")){if(!element.attr("title")){
element.attr("title",element.data("ui-tooltip-title"))}element.removeData("ui-tooltip-title")}});
this.liveRegion.remove()}});if($.uiBackCompat!==false){$.widget("ui.tooltip",$.ui.tooltip,{options:{
tooltipClass:null},_tooltip:function(){var tooltipData=this._superApply(arguments);if(
this.options.tooltipClass){tooltipData.tooltip.addClass(this.options.tooltipClass)}
return tooltipData}})}var widgetsTooltip=$.ui.tooltip});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.sq={closeText:"mbylle",
prevText:"mbrapa",nextText:"Përpara",currentText:"sot",monthNames:["Janar","Shkurt","Mars","Prill",
"Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"],monthNamesShort:["Jan","Shk",
"Mar","Pri","Maj","Qer","Kor","Gus","Sht","Tet","Nën","Dhj"],dayNames:["E Diel","E Hënë","E Martë",
"E Mërkurë","E Enjte","E Premte","E Shtune"],dayNamesShort:["Di","Hë","Ma","Më","En","Pr","Sh"],
dayNamesMin:["Di","Hë","Ma","Më","En","Pr","Sh"],weekHeader:"Ja",dateFormat:"dd.mm.yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.sq);
return datepicker.regional.sq});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.cs={closeText:"Zavřít",
prevText:"Dříve",nextText:"Později",currentText:"Nyní",monthNames:["leden","únor","březen","duben",
"květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],monthNamesShort:["led",
"úno","bře","dub","kvě","čer","čvc","srp","zář","říj","lis","pro"],dayNames:["neděle","pondělí",
"úterý","středa","čtvrtek","pátek","sobota"],dayNamesShort:["ne","po","út","st","čt","pá","so"],
dayNamesMin:["ne","po","út","st","čt","pá","so"],weekHeader:"Týd",dateFormat:"dd.mm.yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.cs);
return datepicker.regional.cs});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["ar-DZ"]={
closeText:"إغلاق",prevText:"السابق",nextText:"التالي",currentText:"اليوم",monthNames:["جانفي",
"فيفري","مارس","أفريل","ماي","جوان","جويلية","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر"],
monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],dayNames:["الأحد","الاثنين",
"الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesShort:["الأحد","الاثنين","الثلاثاء",
"الأربعاء","الخميس","الجمعة","السبت"],dayNamesMin:["ح","ن","ث","ر","خ","ج","س"],weekHeader:"أسبوع",
dateFormat:"dd/mm/yy",firstDay:6,isRTL:true,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional["ar-DZ"]);return datepicker.regional["ar-DZ"]});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.ca={closeText:"Tanca",prevText:"Anterior",nextText:"Següent",
currentText:"Avui",monthNames:["gener","febrer","març","abril","maig","juny","juliol","agost",
"setembre","octubre","novembre","desembre"],monthNamesShort:["gen","feb","març","abr","maig","juny",
"jul","ag","set","oct","nov","des"],dayNames:["diumenge","dilluns","dimarts","dimecres","dijous",
"divendres","dissabte"],dayNamesShort:["dg","dl","dt","dc","dj","dv","ds"],dayNamesMin:["dg","dl",
"dt","dc","dj","dv","ds"],weekHeader:"Set",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.ca);
return datepicker.regional.ca});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.fr={closeText:"Fermer",
prevText:"Précédent",nextText:"Suivant",currentText:"Aujourd'hui",monthNames:["janvier","février",
"mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],
monthNamesShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.",
"déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:[
"dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],
weekHeader:"Sem.",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.fr);return datepicker.regional.fr});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional["it-CH"]={closeText:"Chiudi",prevText:"Prec",nextText:"Succ",
currentText:"Oggi",monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio",
"Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag"
,"Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Lunedì","Martedì","Mercoledì",
"Giovedì","Venerdì","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],
dayNamesMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],weekHeader:"Sm",dateFormat:"dd.mm.yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional[
"it-CH"]);return datepicker.regional["it-CH"]});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.mk={closeText:"Затвори",
prevText:"Претходна",nextText:"Следно",currentText:"Денес",monthNames:["Јануари","Февруари","Март",
"Април","Мај","Јуни","Јули","Август","Септември","Октомври","Ноември","Декември"],monthNamesShort:[
"Јан","Фев","Мар","Апр","Мај","Јун","Јул","Авг","Сеп","Окт","Ное","Дек"],dayNames:["Недела",
"Понеделник","Вторник","Среда","Четврток","Петок","Сабота"],dayNamesShort:["Нед","Пон","Вто","Сре",
"Чет","Пет","Саб"],dayNamesMin:["Не","По","Вт","Ср","Че","Пе","Са"],weekHeader:"Сед",
dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.mk);return datepicker.regional.mk});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.sl={
closeText:"Zapri",prevText:"Prejšnji",nextText:"Naslednji",currentText:"Trenutni",monthNames:[
"Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November",
"December"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"
],dayNames:["Nedelja","Ponedeljek","Torek","Sreda","Četrtek","Petek","Sobota"],dayNamesShort:["Ned",
"Pon","Tor","Sre","Čet","Pet","Sob"],dayNamesMin:["Ne","Po","To","Sr","Če","Pe","So"],
weekHeader:"Teden",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.sl);return datepicker.regional.sl});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.hr={closeText:"Zatvori",prevText:"Prethodno",nextText:"Sljedeći",
currentText:"Danas",monthNames:["Siječanj","Veljača","Ožujak","Travanj","Svibanj","Lipanj","Srpanj",
"Kolovoz","Rujan","Listopad","Studeni","Prosinac"],monthNamesShort:["Sij","Velj","Ožu","Tra","Svi",
"Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],dayNames:["Nedjelja","Ponedjeljak","Utorak","Srijeda",
"Četvrtak","Petak","Subota"],dayNamesShort:["Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayNamesMin:[
"Ne","Po","Ut","Sr","Če","Pe","Su"],weekHeader:"Tje",dateFormat:"dd.mm.yy.",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.hr);
return datepicker.regional.hr});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["zh-TW"]={
closeText:"關閉",prevText:"上個月",nextText:"下個月",currentText:"今天",monthNames:["一月","二月","三月","四月","五月",
"六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月",
"十月","十一月","十二月"],dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["週日","週一","週二"
,"週三","週四","週五","週六"],dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"週",
dateFormat:"yy/mm/dd",firstDay:1,isRTL:false,showMonthAfterYear:true,yearSuffix:"年"};
datepicker.setDefaults(datepicker.regional["zh-TW"]);return datepicker.regional["zh-TW"]});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.ta={closeText:"மூடு",prevText:"முன்னையது",nextText:"அடுத்தது",
currentText:"இன்று",monthNames:["தை","மாசி","பங்குனி","சித்திரை","வைகாசி","ஆனி","ஆடி","ஆவணி",
"புரட்டாசி","ஐப்பசி","கார்த்திகை","மார்கழி"],monthNamesShort:["தை","மாசி","பங்","சித்","வைகா","ஆனி",
"ஆடி","ஆவ","புர","ஐப்","கார்","மார்"],dayNames:["ஞாயிற்றுக்கிழமை","திங்கட்கிழமை","செவ்வாய்க்கிழமை",
"புதன்கிழமை","வியாழக்கிழமை","வெள்ளிக்கிழமை","சனிக்கிழமை"],dayNamesShort:["ஞாயிறு","திங்கள்",
"செவ்வாய்","புதன்","வியாழன்","வெள்ளி","சனி"],dayNamesMin:["ஞா","தி","செ","பு","வி","வெ","ச"],
weekHeader:"Не",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""}
datepicker.setDefaults(datepicker.regional.ta);return datepicker.regional.ta});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["en-NZ"]={
closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January",
"February","March","April","May","June","July","August","September","October","November","December"
],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:[
"Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],
weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""}
datepicker.setDefaults(datepicker.regional["en-NZ"]);return datepicker.regional["en-NZ"]});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.hy={closeText:"Փակել",prevText:"Նախ.",nextText:"Հաջ.",
currentText:"Այսօր",monthNames:["Հունվար","Փետրվար","Մարտ","Ապրիլ","Մայիս","Հունիս","Հուլիս",
"Օգոստոս","Սեպտեմբեր","Հոկտեմբեր","Նոյեմբեր","Դեկտեմբեր"],monthNamesShort:["Հունվ","Փետր","Մարտ",
"Ապր","Մայիս","Հունիս","Հուլ","Օգս","Սեպ","Հոկ","Նոյ","Դեկ"],dayNames:["կիրակի","եկուշաբթի",
"երեքշաբթի","չորեքշաբթի","հինգշաբթի","ուրբաթ","շաբաթ"],dayNamesShort:["կիր","երկ","երք","չրք","հնգ",
"ուրբ","շբթ"],dayNamesMin:["կիր","երկ","երք","չրք","հնգ","ուրբ","շբթ"],weekHeader:"ՇԲՏ",
dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.hy);return datepicker.regional.hy});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.ru={
closeText:"Закрыть",prevText:"Пред",nextText:"След",currentText:"Сегодня",monthNames:["Январь",
"Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],
monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:[
"воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],dayNamesShort:["вск",
"пнд","втр","срд","чтв","птн","сбт"],dayNamesMin:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],
weekHeader:"Нед",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""
};datepicker.setDefaults(datepicker.regional.ru);return datepicker.regional.ru});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["nl-BE"]={
closeText:"Sluiten",prevText:"Vorig",nextText:"Volgende",currentText:"Vandaag",monthNames:["januari"
,"februari","maart","april","mei","juni","juli","augustus","september","oktober","november",
"december"],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"
],dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],
dayNamesShort:["zon","maa","din","woe","don","vri","zat"],dayNamesMin:["zo","ma","di","wo","do","vr"
,"za"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional["nl-BE"]);return datepicker.regional[
"nl-BE"]});(function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.tj={closeText:"Идома",prevText:"Қафо",nextText:"Пеш",
currentText:"Имрӯз",monthNames:["Январ","Феврал","Март","Апрел","Май","Июн","Июл","Август","Сентябр"
,"Октябр","Ноябр","Декабр"],monthNamesShort:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен",
"Окт","Ноя","Дек"],dayNames:["якшанбе","душанбе","сешанбе","чоршанбе","панҷшанбе","ҷумъа","шанбе"],
dayNamesShort:["якш","душ","сеш","чор","пан","ҷум","шан"],dayNamesMin:["Як","Дш","Сш","Чш","Пш","Ҷм"
,"Шн"],weekHeader:"Хф",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.tj);return datepicker.regional.tj});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional["de-AT"]={closeText:"Schließen",prevText:"Zurück",nextText:"Vor",
currentText:"Heute",monthNames:["Jänner","Februar","März","April","Mai","Juni","Juli","August",
"September","Oktober","November","Dezember"],monthNamesShort:["Jän","Feb","Mär","Apr","Mai","Jun",
"Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag"
,"Freitag","Samstag"],dayNamesShort:["So","Mo","Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di"
,"Mi","Do","Fr","Sa"],weekHeader:"KW",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional["de-AT"]);
return datepicker.regional["de-AT"]});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.eo={closeText:"Fermi",
prevText:"Anta",nextText:"Sekv",currentText:"Nuna",monthNames:["Januaro","Februaro","Marto","Aprilo"
,"Majo","Junio","Julio","Aŭgusto","Septembro","Oktobro","Novembro","Decembro"],monthNamesShort:[
"Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aŭg","Sep","Okt","Nov","Dec"],dayNames:["Dimanĉo","Lundo"
,"Mardo","Merkredo","Ĵaŭdo","Vendredo","Sabato"],dayNamesShort:["Dim","Lun","Mar","Mer","Ĵaŭ","Ven",
"Sab"],dayNamesMin:["Di","Lu","Ma","Me","Ĵa","Ve","Sa"],weekHeader:"Sb",dateFormat:"dd/mm/yy",
firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(
datepicker.regional.eo);return datepicker.regional.eo});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.ro={closeText:"Închide",
prevText:"Luna precedentă",nextText:"Luna următoare ",currentText:"Azi",monthNames:["Ianuarie",
"Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie",
"Decembrie"],monthNamesShort:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov",
"Dec"],dayNames:["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"],dayNamesShort:["Dum"
,"Lun","Mar","Mie","Joi","Vin","Sâm"],dayNamesMin:["Du","Lu","Ma","Mi","Jo","Vi","Sâ"],
weekHeader:"Săpt",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.ro);return datepicker.regional.ro});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.pt={closeText:"Fechar",prevText:"Anterior",nextText:"Seguinte",
currentText:"Hoje",monthNames:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto"
,"Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun",
"Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Terça-feira",
"Quarta-feira","Quinta-feira","Sexta-feira","Sábado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui",
"Sex","Sáb"],dayNamesMin:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],weekHeader:"Sem",
dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.pt);return datepicker.regional.pt});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.lb={
closeText:"Fäerdeg",prevText:"Zréck",nextText:"Weider",currentText:"Haut",monthNames:["Januar",
"Februar","Mäerz","Abrëll","Mee","Juni","Juli","August","September","Oktober","November","Dezember"
],monthNamesShort:["Jan","Feb","Mäe","Abr","Mee","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],
dayNames:["Sonndeg","Méindeg","Dënschdeg","Mëttwoch","Donneschdeg","Freideg","Samschdeg"],
dayNamesShort:["Son","Méi","Dën","Mët","Don","Fre","Sam"],dayNamesMin:["So","Mé","Dë","Më","Do","Fr"
,"Sa"],weekHeader:"W",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.lb);return datepicker.regional.lb});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional["cy-GB"]={closeText:"Done",prevText:"Prev",nextText:"Next",
currentText:"Today",monthNames:["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffennaf",
"Awst","Medi","Hydref","Tachwedd","Rhagfyr"],monthNamesShort:["Ion","Chw","Maw","Ebr","Mai","Meh",
"Gor","Aws","Med","Hyd","Tac","Rha"],dayNames:["Dydd Sul","Dydd Llun","Dydd Mawrth","Dydd Mercher",
"Dydd Iau","Dydd Gwener","Dydd Sadwrn"],dayNamesShort:["Sul","Llu","Maw","Mer","Iau","Gwe","Sad"],
dayNamesMin:["Su","Ll","Ma","Me","Ia","Gw","Sa"],weekHeader:"Wy",dateFormat:"dd/mm/yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional[
"cy-GB"]);return datepicker.regional["cy-GB"]});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["en-AU"]={
closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January",
"February","March","April","May","June","July","August","September","October","November","December"
],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:[
"Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],
weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""}
datepicker.setDefaults(datepicker.regional["en-AU"]);return datepicker.regional["en-AU"]});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.ml={closeText:"ശരി",prevText:"മുന്നത്തെ",nextText:"അടുത്തത് ",
currentText:"ഇന്ന്",monthNames:["ജനുവരി","ഫെബ്രുവരി","മാര്‍ച്ച്","ഏപ്രില്‍","മേയ്","ജൂണ്‍","ജൂലൈ",
"ആഗസ്റ്റ്","സെപ്റ്റംബര്‍","ഒക്ടോബര്‍","നവംബര്‍","ഡിസംബര്‍"],monthNamesShort:["ജനു","ഫെബ്","മാര്‍",
"ഏപ്രി","മേയ്","ജൂണ്‍","ജൂലാ","ആഗ","സെപ്","ഒക്ടോ","നവം","ഡിസ"],dayNames:["ഞായര്‍","തിങ്കള്‍","ചൊവ്വ"
,"ബുധന്‍","വ്യാഴം","വെള്ളി","ശനി"],dayNamesShort:["ഞായ","തിങ്ക","ചൊവ്വ","ബുധ","വ്യാഴം","വെള്ളി",
"ശനി"],dayNamesMin:["ഞാ","തി","ചൊ","ബു","വ്യാ","വെ","ശ"],weekHeader:"ആ",dateFormat:"dd/mm/yy",
firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(
datepicker.regional.ml);return datepicker.regional.ml});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.eu={closeText:"Egina",
prevText:"Aur",nextText:"Hur",currentText:"Gaur",monthNames:["urtarrila","otsaila","martxoa",
"apirila","maiatza","ekaina","uztaila","abuztua","iraila","urria","azaroa","abendua"],
monthNamesShort:["urt.","ots.","mar.","api.","mai.","eka.","uzt.","abu.","ira.","urr.","aza.","abe."
],dayNames:["igandea","astelehena","asteartea","asteazkena","osteguna","ostirala","larunbata"],
dayNamesShort:["ig.","al.","ar.","az.","og.","ol.","lr."],dayNamesMin:["ig","al","ar","az","og","ol"
,"lr"],weekHeader:"As",dateFormat:"yy-mm-dd",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.eu);return datepicker.regional.eu});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.ar={closeText:"إغلاق",prevText:"السابق",nextText:"التالي",
currentText:"اليوم",monthNames:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس",
"سبتمبر","أكتوبر","نوفمبر","ديسمبر"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11",
"12"],dayNames:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],dayNamesShort:[
"أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة","سبت"],dayNamesMin:["ح","ن","ث","ر","خ","ج","س"],
weekHeader:"أسبوع",dateFormat:"dd/mm/yy",firstDay:0,isRTL:true,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.ar);return datepicker.regional.ar});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.be={closeText:"Зачыніць",prevText:"Папяр.",nextText:"Наст.",
currentText:"Сёньня",monthNames:["Студзень","Люты","Сакавік","Красавік","Травень","Чэрвень","Ліпень"
,"Жнівень","Верасень","Кастрычнік","Лістапад","Сьнежань"],monthNamesShort:["Сту","Лют","Сак","Кра",
"Тра","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сьн"],dayNames:["нядзеля","панядзелак","аўторак","серада"
,"чацьвер","пятніца","субота"],dayNamesShort:["ндз","пнд","аўт","срд","чцв","птн","сбт"],
dayNamesMin:["Нд","Пн","Аў","Ср","Чц","Пт","Сб"],weekHeader:"Тд",dateFormat:"dd.mm.yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.be);
return datepicker.regional.be});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.et={closeText:"Sulge",
prevText:"Eelnev",nextText:"Järgnev",currentText:"Täna",monthNames:["Jaanuar","Veebruar","Märts",
"Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],
monthNamesShort:["Jaan","Veebr","Märts","Apr","Mai","Juuni","Juuli","Aug","Sept","Okt","Nov","Dets"
],dayNames:["Pühapäev","Esmaspäev","Teisipäev","Kolmapäev","Neljapäev","Reede","Laupäev"],
dayNamesShort:["Pühap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup"],dayNamesMin:["P","E","T",
"K","N","R","L"],weekHeader:"näd",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.et);
return datepicker.regional.et});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.de={
closeText:"Schließen",prevText:"Zurück",nextText:"Vor",currentText:"Heute",monthNames:["Januar",
"Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],
monthNamesShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],dayNames:[
"Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],dayNamesShort:["So","Mo",
"Di","Mi","Do","Fr","Sa"],dayNamesMin:["So","Mo","Di","Mi","Do","Fr","Sa"],weekHeader:"KW",
dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.de);return datepicker.regional.de});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.af={
closeText:"Selekteer",prevText:"Vorige",nextText:"Volgende",currentText:"Vandag",monthNames:[
"Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober",
"November","Desember"],monthNamesShort:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt",
"Nov","Des"],dayNames:["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],
dayNamesShort:["Son","Maa","Din","Woe","Don","Vry","Sat"],dayNamesMin:["So","Ma","Di","Wo","Do","Vr"
,"Sa"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.af);return datepicker.regional.af});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional["sr-SR"]={closeText:"Zatvori",prevText:"Prethodno",
nextText:"Sljedeći",currentText:"Danas",monthNames:["Januar","Februar","Mart","April","Maj","Jun",
"Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthNamesShort:["Jan","Feb","Mar","Apr"
,"Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],dayNames:["Nedelja","Ponedeljak","Utorak","Sreda",
"Četvrtak","Petak","Subota"],dayNamesShort:["Ned","Pon","Uto","Sre","Čet","Pet","Sub"],dayNamesMin:[
"Ne","Po","Ut","Sr","Če","Pe","Su"],weekHeader:"Sed",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional["sr-SR"]);
return datepicker.regional["sr-SR"]});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.is={closeText:"Loka",
prevText:"Fyrri",nextText:"Næsti ",currentText:"Í dag",monthNames:["Janúar","Febrúar","Mars","Apríl"
,"Maí","Júní","Júlí","Ágúst","September","Október","Nóvember","Desember"],monthNamesShort:["Jan",
"Feb","Mar","Apr","Maí","Jún","Júl","Ágú","Sep","Okt","Nóv","Des"],dayNames:["Sunnudagur",
"Mánudagur","Þriðjudagur","Miðvikudagur","Fimmtudagur","Föstudagur","Laugardagur"],dayNamesShort:[
"Sun","Mán","Þri","Mið","Fim","Fös","Lau"],dayNamesMin:["Su","Má","Þr","Mi","Fi","Fö","La"],
weekHeader:"Vika",dateFormat:"dd.mm.yy",firstDay:0,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.is);return datepicker.regional.is});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.sv={closeText:"Stäng",prevText:"Förra",nextText:"Nästa",
currentText:"Idag",monthNames:["januari","februari","mars","april","maj","juni","juli","augusti",
"september","oktober","november","december"],monthNamesShort:["jan.","feb.","mars","apr.","maj",
"juni","juli","aug.","sep.","okt.","nov.","dec."],dayNamesShort:["sön","mån","tis","ons","tor","fre"
,"lör"],dayNames:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],dayNamesMin:["sö"
,"må","ti","on","to","fr","lö"],weekHeader:"Ve",dateFormat:"yy-mm-dd",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.sv);
return datepicker.regional.sv});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.rm={closeText:"Serrar",
prevText:"Suandant",nextText:"Precedent",currentText:"Actual",monthNames:["Schaner","Favrer","Mars",
"Avrigl","Matg","Zercladur","Fanadur","Avust","Settember","October","November","December"],
monthNamesShort:["Scha","Fev","Mar","Avr","Matg","Zer","Fan","Avu","Sett","Oct","Nov","Dec"],
dayNames:["Dumengia","Glindesdi","Mardi","Mesemna","Gievgia","Venderdi","Sonda"],dayNamesShort:[
"Dum","Gli","Mar","Mes","Gie","Ven","Som"],dayNamesMin:["Du","Gl","Ma","Me","Gi","Ve","So"],
weekHeader:"emna",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.rm);return datepicker.regional.rm});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.it={closeText:"Chiudi",prevText:"Prec",nextText:"Succ",
currentText:"Oggi",monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio",
"Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag"
,"Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Lunedì","Martedì","Mercoledì",
"Giovedì","Venerdì","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],
dayNamesMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.it);
return datepicker.regional.it});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.uk={closeText:"Закрити",
prevText:"Попередній",nextText:"найближчий",currentText:"Сьогодні",monthNames:["Січень","Лютий",
"Березень","Квітень","Травень","Червень","Липень","Серпень","Вересень","Жовтень","Листопад",
"Грудень"],monthNamesShort:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"
],dayNames:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"],dayNamesShort:[
"нед","пнд","вів","срд","чтв","птн","сбт"],dayNamesMin:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],
weekHeader:"Тиж",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""
};datepicker.setDefaults(datepicker.regional.uk);return datepicker.regional.uk});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.az={
closeText:"Bağla",prevText:"Geri",nextText:"İrəli",currentText:"Bugün",monthNames:["Yanvar","Fevral"
,"Mart","Aprel","May","İyun","İyul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],
monthNamesShort:["Yan","Fev","Mar","Apr","May","İyun","İyul","Avq","Sen","Okt","Noy","Dek"],
dayNames:["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],
dayNamesShort:["B","Be","Ça","Ç","Ca","C","Ş"],dayNamesMin:["B","B","Ç","С","Ç","C","Ş"],
weekHeader:"Hf",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""}
datepicker.setDefaults(datepicker.regional.az);return datepicker.regional.az});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.nl={
closeText:"Sluiten",prevText:"Vorig",nextText:"Volgende",currentText:"Vandaag",monthNames:["januari"
,"februari","maart","april","mei","juni","juli","augustus","september","oktober","november",
"december"],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"
],dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],
dayNamesShort:["zon","maa","din","woe","don","vri","zat"],dayNamesMin:["zo","ma","di","wo","do","vr"
,"za"],weekHeader:"Wk",dateFormat:"dd-mm-yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.nl);return datepicker.regional.nl});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.hu={closeText:"Bezár",prevText:"Vissza",nextText:"Előre",
currentText:"Ma",monthNames:["Január","Február","Március","Április","Május","Június","Július",
"Augusztus","Szeptember","Október","November","December"],monthNamesShort:["Jan","Feb","Már","Ápr",
"Máj","Jún","Júl","Aug","Szep","Okt","Nov","Dec"],dayNames:["Vasárnap","Hétfő","Kedd","Szerda",
"Csütörtök","Péntek","Szombat"],dayNamesShort:["Vas","Hét","Ked","Sze","Csü","Pén","Szo"],
dayNamesMin:["V","H","K","Sze","Cs","P","Szo"],weekHeader:"Hét",dateFormat:"yy.mm.dd.",firstDay:1,
isRTL:false,showMonthAfterYear:true,yearSuffix:""};datepicker.setDefaults(datepicker.regional.hu);
return datepicker.regional.hu});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.nn={closeText:"Lukk",
prevText:"Førre",nextText:"Neste",currentText:"I dag",monthNames:["januar","februar","mars","april",
"mai","juni","juli","august","september","oktober","november","desember"],monthNamesShort:["jan",
"feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],dayNamesShort:["sun","mån","tys",
"ons","tor","fre","lau"],dayNames:["sundag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"
],dayNamesMin:["su","må","ty","on","to","fr","la"],weekHeader:"Veke",dateFormat:"dd.mm.yy",
firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(
datepicker.regional.nn);return datepicker.regional.nn});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.tr={closeText:"kapat",
prevText:"geri",nextText:"ileri",currentText:"bugün",monthNames:["Ocak","Şubat","Mart","Nisan",
"Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthNamesShort:["Oca","Şub",
"Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],dayNames:["Pazar","Pazartesi","Salı",
"Çarşamba","Perşembe","Cuma","Cumartesi"],dayNamesShort:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],
dayNamesMin:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],weekHeader:"Hf",dateFormat:"dd.mm.yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.tr);
return datepicker.regional.tr});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.vi={closeText:"Đóng",
prevText:"Trước",nextText:"Tiếp",currentText:"Hôm nay",monthNames:["Tháng Một","Tháng Hai",
"Tháng Ba","Tháng Tư","Tháng Năm","Tháng Sáu","Tháng Bảy","Tháng Tám","Tháng Chín","Tháng Mười",
"Tháng Mười Một","Tháng Mười Hai"],monthNamesShort:["Tháng 1","Tháng 2","Tháng 3","Tháng 4",
"Tháng 5","Tháng 6","Tháng 7","Tháng 8","Tháng 9","Tháng 10","Tháng 11","Tháng 12"],dayNames:[
"Chủ Nhật","Thứ Hai","Thứ Ba","Thứ Tư","Thứ Năm","Thứ Sáu","Thứ Bảy"],dayNamesShort:["CN","T2","T3",
"T4","T5","T6","T7"],dayNamesMin:["CN","T2","T3","T4","T5","T6","T7"],weekHeader:"Tu",
dateFormat:"dd/mm/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.vi);return datepicker.regional.vi});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.ko={
closeText:"닫기",prevText:"이전달",nextText:"다음달",currentText:"오늘",monthNames:["1월","2월","3월","4월","5월",
"6월","7월","8월","9월","10월","11월","12월"],monthNamesShort:["1월","2월","3월","4월","5월","6월","7월","8월","9월"
,"10월","11월","12월"],dayNames:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"],dayNamesShort:["일","월","화",
"수","목","금","토"],dayNamesMin:["일","월","화","수","목","금","토"],weekHeader:"주",dateFormat:"yy. m. d.",
firstDay:0,isRTL:false,showMonthAfterYear:true,yearSuffix:"년"};datepicker.setDefaults(
datepicker.regional.ko);return datepicker.regional.ko});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["en-GB"]={
closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January",
"February","March","April","May","June","July","August","September","October","November","December"
],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:[
"Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],
weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""}
datepicker.setDefaults(datepicker.regional["en-GB"]);return datepicker.regional["en-GB"]});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.fa={closeText:"بستن",prevText:"قبلی",nextText:"بعدی",
currentText:"امروز",monthNames:["ژانویه","فوریه","مارس","آوریل","مه","ژوئن","ژوئیه","اوت","سپتامبر",
"اکتبر","نوامبر","دسامبر"],monthNamesShort:["1","2","3","4","5","6","7","8","9","10","11","12"],
dayNames:["يکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],dayNamesShort:["ی","د","س"
,"چ","پ","ج","ش"],dayNamesMin:["ی","د","س","چ","پ","ج","ش"],weekHeader:"هف",dateFormat:"yy/mm/dd",
firstDay:6,isRTL:true,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(
datepicker.regional.fa);return datepicker.regional.fa});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["fr-CH"]={
closeText:"Fermer",prevText:"Préc",nextText:"Suiv",currentText:"Courant",monthNames:["janvier",
"février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],
monthNamesShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.","oct.","nov.",
"déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],dayNamesShort:[
"dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J","V","S"],
weekHeader:"Sm",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""}
datepicker.setDefaults(datepicker.regional["fr-CH"]);return datepicker.regional["fr-CH"]});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional["zh-CN"]={closeText:"关闭",prevText:"上月",nextText:"下月",
currentText:"今天",monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["星期日",
"星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二","周三","周四","周五","周六"],
dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"周",dateFormat:"yy-mm-dd",firstDay:1,
isRTL:false,showMonthAfterYear:true,yearSuffix:"年"};datepicker.setDefaults(datepicker.regional[
"zh-CN"]);return datepicker.regional["zh-CN"]});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.id={closeText:"Tutup",
prevText:"Mundur",nextText:"Maju",currentText:"Hari ini",monthNames:["Januari","Februari","Maret",
"April","Mei","Juni","Juli","Agustus","September","Oktober","Nopember","Desember"],monthNamesShort:[
"Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agus","Sep","Okt","Nop","Des"],dayNames:["Minggu","Senin"
,"Selasa","Rabu","Kamis","Jumat","Sabtu"],dayNamesShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],
dayNamesMin:["Mg","Sn","Sl","Rb","Km","Jm","Sb"],weekHeader:"Mg",dateFormat:"dd/mm/yy",firstDay:0,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.id);
return datepicker.regional.id});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["pt-BR"]={
closeText:"Fechar",prevText:"Anterior",nextText:"Próximo",currentText:"Hoje",monthNames:["Janeiro",
"Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro",
"Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"
],dayNames:["Domingo","Segunda-feira","Terça-feira","Quarta-feira","Quinta-feira","Sexta-feira",
"Sábado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],dayNamesMin:["Dom","Seg","Ter",
"Qua","Qui","Sex","Sáb"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:0,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional["pt-BR"]);
return datepicker.regional["pt-BR"]});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.ms={closeText:"Tutup",
prevText:"Sebelum",nextText:"Selepas",currentText:"hari ini",monthNames:["Januari","Februari","Mac",
"April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthNamesShort:[
"Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],dayNames:["Ahad","Isnin",
"Selasa","Rabu","Khamis","Jumaat","Sabtu"],dayNamesShort:["Aha","Isn","Sel","Rab","kha","Jum","Sab"
],dayNamesMin:["Ah","Is","Se","Ra","Kh","Ju","Sa"],weekHeader:"Mg",dateFormat:"dd/mm/yy",firstDay:0,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.ms);
return datepicker.regional.ms});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.ja={closeText:"閉じる",
prevText:"前",nextText:"次",currentText:"今日",monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月",
"10月","11月","12月"],monthNamesShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],
dayNames:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],dayNamesShort:["日","月","火","水","木","金","土"],
dayNamesMin:["日","月","火","水","木","金","土"],weekHeader:"週",dateFormat:"yy/mm/dd",firstDay:0,
isRTL:false,showMonthAfterYear:true,yearSuffix:"年"};datepicker.setDefaults(datepicker.regional.ja);
return datepicker.regional.ja});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.ky={closeText:"Жабуу",
prevText:"Мур",nextText:"Кий",currentText:"Бүгүн",monthNames:["Январь","Февраль","Март","Апрель",
"Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],monthNamesShort:["Янв","Фев",
"Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],dayNames:["жекшемби","дүйшөмбү",
"шейшемби","шаршемби","бейшемби","жума","ишемби"],dayNamesShort:["жек","дүй","шей","шар","бей","жум"
,"ише"],dayNamesMin:["Жк","Дш","Шш","Шр","Бш","Жм","Иш"],weekHeader:"Жум",dateFormat:"dd.mm.yy",
firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(
datepicker.regional.ky);return datepicker.regional.ky});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.kk={closeText:"Жабу",
prevText:"Алдыңғы",nextText:"Келесі",currentText:"Бүгін",monthNames:["Қаңтар","Ақпан","Наурыз",
"Сәуір","Мамыр","Маусым","Шілде","Тамыз","Қыркүйек","Қазан","Қараша","Желтоқсан"],monthNamesShort:[
"Қаң","Ақп","Нау","Сәу","Мам","Мау","Шіл","Там","Қыр","Қаз","Қар","Жел"],dayNames:["Жексенбі",
"Дүйсенбі","Сейсенбі","Сәрсенбі","Бейсенбі","Жұма","Сенбі"],dayNamesShort:["жкс","дсн","ссн","срс",
"бсн","жма","снб"],dayNamesMin:["Жк","Дс","Сс","Ср","Бс","Жм","Сн"],weekHeader:"Не",
dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.kk);return datepicker.regional.kk});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["fr-CA"]={
closeText:"Fermer",prevText:"Précédent",nextText:"Suivant",currentText:"Aujourd'hui",monthNames:[
"janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre",
"décembre"],monthNamesShort:["janv.","févr.","mars","avril","mai","juin","juil.","août","sept.",
"oct.","nov.","déc."],dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
dayNamesShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],dayNamesMin:["D","L","M","M","J",
"V","S"],weekHeader:"Sem.",dateFormat:"yy-mm-dd",firstDay:0,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional["fr-CA"]);return datepicker.regional[
"fr-CA"]});(function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.da={closeText:"Luk",prevText:"Forrige",nextText:"Næste",
currentText:"I dag",monthNames:["Januar","Februar","Marts","April","Maj","Juni","Juli","August",
"September","Oktober","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun",
"Jul","Aug","Sep","Okt","Nov","Dec"],dayNames:["Søndag","Mandag","Tirsdag","Onsdag","Torsdag",
"Fredag","Lørdag"],dayNamesShort:["Søn","Man","Tir","Ons","Tor","Fre","Lør"],dayNamesMin:["Sø","Ma",
"Ti","On","To","Fr","Lø"],weekHeader:"Uge",dateFormat:"dd-mm-yy",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.da);
return datepicker.regional.da});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.gl={closeText:"Pechar",
prevText:"Ant",nextText:"Seg",currentText:"Hoxe",monthNames:["Xaneiro","Febreiro","Marzo","Abril",
"Maio","Xuño","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],monthNamesShort:["Xan",
"Feb","Mar","Abr","Mai","Xuñ","Xul","Ago","Set","Out","Nov","Dec"],dayNames:["Domingo","Luns",
"Martes","Mércores","Xoves","Venres","Sábado"],dayNamesShort:["Dom","Lun","Mar","Mér","Xov","Ven",
"Sáb"],dayNamesMin:["Do","Lu","Ma","Mé","Xo","Ve","Sá"],weekHeader:"Sm",dateFormat:"dd/mm/yy",
firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(
datepicker.regional.gl);return datepicker.regional.gl});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.ka={closeText:"დახურვა",
prevText:"წინა",nextText:"შემდეგი ",currentText:"დღეს",monthNames:["იანვარი","თებერვალი","მარტი",
"აპრილი","მაისი","ივნისი","ივლისი","აგვისტო","სექტემბერი","ოქტომბერი","ნოემბერი","დეკემბერი"],
monthNamesShort:["იან","თებ","მარ","აპრ","მაი","ივნ","ივლ","აგვ","სექ","ოქტ","ნოე","დეკ"],dayNames:[
"კვირა","ორშაბათი","სამშაბათი","ოთხშაბათი","ხუთშაბათი","პარასკევი","შაბათი"],dayNamesShort:["კვ",
"ორშ","სამ","ოთხ","ხუთ","პარ","შაბ"],dayNamesMin:["კვ","ორშ","სამ","ოთხ","ხუთ","პარ","შაბ"],
weekHeader:"კვირა",dateFormat:"dd-mm-yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.ka);return datepicker.regional.ka});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.lt={closeText:"Uždaryti",prevText:"Atgal",nextText:"Pirmyn",
currentText:"Šiandien",monthNames:["Sausis","Vasaris","Kovas","Balandis","Gegužė","Birželis","Liepa"
,"Rugpjūtis","Rugsėjis","Spalis","Lapkritis","Gruodis"],monthNamesShort:["Sau","Vas","Kov","Bal",
"Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],dayNames:["sekmadienis","pirmadienis",
"antradienis","trečiadienis","ketvirtadienis","penktadienis","šeštadienis"],dayNamesShort:["sek",
"pir","ant","tre","ket","pen","šeš"],dayNamesMin:["Se","Pr","An","Tr","Ke","Pe","Še"],
weekHeader:"SAV",dateFormat:"yy-mm-dd",firstDay:1,isRTL:false,showMonthAfterYear:true,yearSuffix:""}
datepicker.setDefaults(datepicker.regional.lt);return datepicker.regional.lt});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.bs={
closeText:"Zatvori",prevText:"Prethodno",nextText:"Sljedeći",currentText:"Danas",monthNames:[
"Januar","Februar","Mart","April","Maj","Juni","Juli","August","Septembar","Oktobar","Novembar",
"Decembar"],monthNamesShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"
],dayNames:["Nedelja","Ponedeljak","Utorak","Srijeda","Četvrtak","Petak","Subota"],dayNamesShort:[
"Ned","Pon","Uto","Sri","Čet","Pet","Sub"],dayNamesMin:["Ne","Po","Ut","Sr","Če","Pe","Su"],
weekHeader:"Wk",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""}
datepicker.setDefaults(datepicker.regional.bs);return datepicker.regional.bs});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional["zh-HK"]={
closeText:"關閉",prevText:"上月",nextText:"下月",currentText:"今天",monthNames:["一月","二月","三月","四月","五月",
"六月","七月","八月","九月","十月","十一月","十二月"],monthNamesShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月",
"十月","十一月","十二月"],dayNames:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayNamesShort:["周日","周一","周二"
,"周三","周四","周五","周六"],dayNamesMin:["日","一","二","三","四","五","六"],weekHeader:"周",
dateFormat:"dd-mm-yy",firstDay:0,isRTL:false,showMonthAfterYear:true,yearSuffix:"年"};
datepicker.setDefaults(datepicker.regional["zh-HK"]);return datepicker.regional["zh-HK"]});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.sr={closeText:"Затвори",prevText:"Претходна",nextText:"Следећи",
currentText:"Данас",monthNames:["Јануар","Фебруар","Март","Април","Мај","Јун","Јул","Август",
"Септембар","Октобар","Новембар","Децембар"],monthNamesShort:["Јан","Феб","Мар","Апр","Мај","Јун",
"Јул","Авг","Сеп","Окт","Нов","Дец"],dayNames:["Недеља","Понедељак","Уторак","Среда","Четвртак",
"Петак","Субота"],dayNamesShort:["Нед","Пон","Уто","Сре","Чет","Пет","Суб"],dayNamesMin:["Не","По",
"Ут","Ср","Че","Пе","Су"],weekHeader:"Сед",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.sr);
return datepicker.regional.sr});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.lv={closeText:"Aizvērt",
prevText:"Iepr.",nextText:"Nāk.",currentText:"Šodien",monthNames:["Janvāris","Februāris","Marts",
"Aprīlis","Maijs","Jūnijs","Jūlijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],
monthNamesShort:["Jan","Feb","Mar","Apr","Mai","Jūn","Jūl","Aug","Sep","Okt","Nov","Dec"],dayNames:[
"svētdiena","pirmdiena","otrdiena","trešdiena","ceturtdiena","piektdiena","sestdiena"],
dayNamesShort:["svt","prm","otr","tre","ctr","pkt","sst"],dayNamesMin:["Sv","Pr","Ot","Tr","Ct","Pk"
,"Ss"],weekHeader:"Ned.",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.lv);return datepicker.regional.lv});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.km={closeText:"ធ្វើ​រួច",prevText:"មុន",nextText:"បន្ទាប់",
currentText:"ថ្ងៃ​នេះ",monthNames:["មករា","កុម្ភៈ","មីនា","មេសា","ឧសភា","មិថុនា","កក្កដា","សីហា",
"កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],monthNamesShort:["មករា","កុម្ភៈ","មីនា","មេសា","ឧសភា","មិថុនា",
"កក្កដា","សីហា","កញ្ញា","តុលា","វិច្ឆិកា","ធ្នូ"],dayNames:["អាទិត្យ","ចន្ទ","អង្គារ","ពុធ",
"ព្រហស្បតិ៍","សុក្រ","សៅរ៍"],dayNamesShort:["អា","ច","អ","ពុ","ព្រហ","សុ","សៅ"],dayNamesMin:["អា",
"ច","អ","ពុ","ព្រហ","សុ","សៅ"],weekHeader:"សប្ដាហ៍",dateFormat:"dd-mm-yy",firstDay:1,isRTL:false,
showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.km);
return datepicker.regional.km});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.pl={closeText:"Zamknij",
prevText:"Poprzedni",nextText:"Następny",currentText:"Dziś",monthNames:["Styczeń","Luty","Marzec",
"Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],
monthNamesShort:["Sty","Lu","Mar","Kw","Maj","Cze","Lip","Sie","Wrz","Pa","Lis","Gru"],dayNames:[
"Niedziela","Poniedziałek","Wtorek","Środa","Czwartek","Piątek","Sobota"],dayNamesShort:["Nie","Pn",
"Wt","Śr","Czw","Pt","So"],dayNamesMin:["N","Pn","Wt","Śr","Cz","Pt","So"],weekHeader:"Tydz",
dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.pl);return datepicker.regional.pl});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.fo={
closeText:"Lat aftur",prevText:"Fyrra",nextText:"Næsta",currentText:"Í dag",monthNames:["Januar",
"Februar","Mars","Apríl","Mei","Juni","Juli","August","September","Oktober","November","Desember"],
monthNamesShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"],dayNames:[
"Sunnudagur","Mánadagur","Týsdagur","Mikudagur","Hósdagur","Fríggjadagur","Leyardagur"],
dayNamesShort:["Sun","Mán","Týs","Mik","Hós","Frí","Ley"],dayNamesMin:["Su","Má","Tý","Mi","Hó","Fr"
,"Le"],weekHeader:"Vk",dateFormat:"dd-mm-yy",firstDay:1,isRTL:false,showMonthAfterYear:false,
yearSuffix:""};datepicker.setDefaults(datepicker.regional.fo);return datepicker.regional.fo});(
function(factory){"use strict";if(typeof define==="function"&&define.amd){define([
"../widgets/datepicker"],factory)}else{factory(jQuery.datepicker)}})(function(datepicker){
"use strict";datepicker.regional.bg={closeText:"затвори",prevText:"назад",nextText:"напред",
nextBigText:"&#x3E;&#x3E;",currentText:"днес",monthNames:["Януари","Февруари","Март","Април","Май",
"Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],monthNamesShort:["Яну","Фев","Мар"
,"Апр","Май","Юни","Юли","Авг","Сеп","Окт","Нов","Дек"],dayNames:["Неделя","Понеделник","Вторник",
"Сряда","Четвъртък","Петък","Събота"],dayNamesShort:["Нед","Пон","Вто","Сря","Чет","Пет","Съб"],
dayNamesMin:["Не","По","Вт","Ср","Че","Пе","Съ"],weekHeader:"Wk",dateFormat:"dd.mm.yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.bg);
return datepicker.regional.bg});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.nb={closeText:"Lukk",
prevText:"Forrige",nextText:"Neste",currentText:"I dag",monthNames:["januar","februar","mars",
"april","mai","juni","juli","august","september","oktober","november","desember"],monthNamesShort:[
"jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],dayNamesShort:["søn","man",
"tir","ons","tor","fre","lør"],dayNames:["søndag","mandag","tirsdag","onsdag","torsdag","fredag",
"lørdag"],dayNamesMin:["sø","ma","ti","on","to","fr","lø"],weekHeader:"Uke",dateFormat:"dd.mm.yy",
firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(
datepicker.regional.nb);return datepicker.regional.nb});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.th={closeText:"ปิด",
prevText:"ย้อน",nextText:"ถัดไป",currentText:"วันนี้",monthNames:["มกราคม","กุมภาพันธ์","มีนาคม",
"เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"],
monthNamesShort:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.",
"ธ.ค."],dayNames:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์"],dayNamesShort:["อา."
,"จ.","อ.","พ.","พฤ.","ศ.","ส."],dayNamesMin:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],weekHeader:"Wk",
dateFormat:"dd/mm/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.th);return datepicker.regional.th});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.fi={
closeText:"Sulje",prevText:"Edellinen",nextText:"Seuraava",currentText:"Tänään",monthNames:[
"Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kesäkuu","Heinäkuu","Elokuu","Syyskuu",
"Lokakuu","Marraskuu","Joulukuu"],monthNamesShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kesä",
"Heinä","Elo","Syys","Loka","Marras","Joulu"],dayNamesShort:["Su","Ma","Ti","Ke","To","Pe","La"],
dayNames:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],
dayNamesMin:["Su","Ma","Ti","Ke","To","Pe","La"],weekHeader:"Vk",dateFormat:"d.m.yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.fi);
return datepicker.regional.fi});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.sk={closeText:"Zavrieť",
prevText:"Predchádzajúci",nextText:"Nasledujúci",currentText:"Dnes",monthNames:["január","február",
"marec","apríl","máj","jún","júl","august","september","október","november","december"],
monthNamesShort:["Jan","Feb","Mar","Apr","Máj","Jún","Júl","Aug","Sep","Okt","Nov","Dec"],dayNames:[
"nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],dayNamesShort:["Ned","Pon","Uto",
"Str","Štv","Pia","Sob"],dayNamesMin:["Ne","Po","Ut","St","Št","Pia","So"],weekHeader:"Ty",
dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.sk);return datepicker.regional.sk});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.he={
closeText:"סגור",prevText:"הקודם",nextText:"הבא",currentText:"היום",monthNames:["ינואר","פברואר",
"מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"],monthNamesShort:[
"ינו","פבר","מרץ","אפר","מאי","יוני","יולי","אוג","ספט","אוק","נוב","דצמ"],dayNames:["ראשון","שני",
"שלישי","רביעי","חמישי","שישי","שבת"],dayNamesShort:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],
dayNamesMin:["א'","ב'","ג'","ד'","ה'","ו'","שבת"],weekHeader:"Wk",dateFormat:"dd/mm/yy",firstDay:0,
isRTL:true,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.he);
return datepicker.regional.he});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.el={
closeText:"Κλείσιμο",prevText:"Προηγούμενος",nextText:"Επόμενος",currentText:"Σήμερα",monthNames:[
"Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος",
"Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"],monthNamesShort:["Ιαν","Φεβ","Μαρ","Απρ","Μαι",
"Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],dayNames:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη",
"Πέμπτη","Παρασκευή","Σάββατο"],dayNamesShort:["Κυρ","Δευ","Τρι","Τετ","Πεμ","Παρ","Σαβ"],
dayNamesMin:["Κυ","Δε","Τρ","Τε","Πε","Πα","Σα"],weekHeader:"Εβδ",dateFormat:"dd/mm/yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.el);
return datepicker.regional.el});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.es={closeText:"Cerrar",
prevText:"Ant",nextText:"Sig",currentText:"Hoy",monthNames:["enero","febrero","marzo","abril","mayo"
,"junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthNamesShort:["ene",
"feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],dayNames:["domingo","lunes",
"martes","miércoles","jueves","viernes","sábado"],dayNamesShort:["dom","lun","mar","mié","jue","vie"
,"sáb"],dayNamesMin:["D","L","M","X","J","V","S"],weekHeader:"Sm",dateFormat:"dd/mm/yy",firstDay:1,
isRTL:false,showMonthAfterYear:false,yearSuffix:""};datepicker.setDefaults(datepicker.regional.es);
return datepicker.regional.es});(function(factory){"use strict";if(
typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)}else{factory(
jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.hi={closeText:"बंद",
prevText:"पिछला",nextText:"अगला",currentText:"आज",monthNames:["जनवरी ","फरवरी","मार्च","अप्रेल","मई"
,"जून","जूलाई","अगस्त ","सितम्बर","अक्टूबर","नवम्बर","दिसम्बर"],monthNamesShort:["जन","फर","मार्च",
"अप्रेल","मई","जून","जूलाई","अग","सित","अक्ट","नव","दि"],dayNames:["रविवार","सोमवार","मंगलवार",
"बुधवार","गुरुवार","शुक्रवार","शनिवार"],dayNamesShort:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"
],dayNamesMin:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],weekHeader:"हफ्ता",
dateFormat:"dd/mm/yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""};
datepicker.setDefaults(datepicker.regional.hi);return datepicker.regional.hi});(function(factory){
"use strict";if(typeof define==="function"&&define.amd){define(["../widgets/datepicker"],factory)
}else{factory(jQuery.datepicker)}})(function(datepicker){"use strict";datepicker.regional.no={
closeText:"Lukk",prevText:"Forrige",nextText:"Neste",currentText:"I dag",monthNames:["januar",
"februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],
monthNamesShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],
dayNamesShort:["søn","man","tir","ons","tor","fre","lør"],dayNames:["søndag","mandag","tirsdag",
"onsdag","torsdag","fredag","lørdag"],dayNamesMin:["sø","ma","ti","on","to","fr","lø"],
weekHeader:"Uke",dateFormat:"dd.mm.yy",firstDay:1,isRTL:false,showMonthAfterYear:false,yearSuffix:""
};datepicker.setDefaults(datepicker.regional.no);return datepicker.regional.no});(function(factory){
if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(
typeof module==="object"&&typeof module.exports==="object"){module.exports=factory(require("jquery")
)}else{factory(jQuery)}})(function($){var menuTrees=[],IE=!!window.createPopup,mouse=false,
touchEvents="ontouchstart"in window,mouseDetectionEnabled=false,
requestAnimationFrame=window.requestAnimationFrame||function(callback){return setTimeout(callback,
1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(id){clearTimeout(id)};
function initMouseDetection(disable){var eNS=".smartmenus_mouse";if(!mouseDetectionEnabled&&!disable
){var firstTime=true,lastMove=null;$(document).bind(getEventsNS([["mousemove",function(e){
var thisMove={x:e.pageX,y:e.pageY,timeStamp:(new Date).getTime()};if(lastMove){var deltaX=Math.abs(
lastMove.x-thisMove.x),deltaY=Math.abs(lastMove.y-thisMove.y);if((deltaX>0||deltaY>0
)&&deltaX<=2&&deltaY<=2&&thisMove.timeStamp-lastMove.timeStamp<=300){mouse=true;if(firstTime){
var $a=$(e.target).closest("a");if($a.is("a")){$.each(menuTrees,function(){if($.contains(this.$root[
0],$a[0])){this.itemEnter({currentTarget:$a[0]});return false}})}firstTime=false}}}lastMove=thisMove
}],[
touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"
,function(e){if(isTouchEvent(e.originalEvent)){mouse=false}}]],eNS));mouseDetectionEnabled=true
}else if(mouseDetectionEnabled&&disable){$(document).unbind(eNS);mouseDetectionEnabled=false}}
function isTouchEvent(e){return!/^(4|mouse)$/.test(e.pointerType)}function getEventsNS(defArr,eNS){
if(!eNS){eNS=""}var obj={};$.each(defArr,function(index,value){obj[value[0].split(" ").join(eNS+" "
)+eNS]=value[1]});return obj}$.SmartMenus=function(elm,options){this.$root=$(elm);this.opts=options;
this.rootId="";this.accessIdPrefix="";this.$subArrow=null;this.activatedItems=[];
this.visibleSubMenus=[];this.showTimeout=0;this.hideTimeout=0;this.scrollTimeout=0;
this.clickActivated=false;this.focusActivated=false;this.zIndexInc=0;this.idInc=0;
this.$firstLink=null;this.$firstSub=null;this.disabled=false;this.$disableOverlay=null;
this.$touchScrollingSub=null;
this.cssTransforms3d="perspective"in elm.style||"webkitPerspective"in elm.style;
this.wasCollapsible=false;this.init()};$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,
function(){this.menuHideAll()})},destroy:function(){while(menuTrees.length){menuTrees[0].destroy()}
initMouseDetection(true)},prototype:{init:function(refresh){var self=this;if(!refresh){
menuTrees.push(this);this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,"");
this.accessIdPrefix="sm-"+this.rootId+"-";if(this.$root.hasClass("sm-rtl")){
this.opts.rightToLeftSubMenus=true}var eNS=".smartmenus";this.$root.data("smartmenus",this).attr(
"data-smartmenus-id",this.rootId).dataSM("level",1).bind(getEventsNS([["mouseover focusin",$.proxy(
this.rootOver,this)],["mouseout focusout",$.proxy(this.rootOut,this)],["keydown",$.proxy(
this.rootKeyDown,this)]],eNS)).delegate("a",getEventsNS([["mouseenter",$.proxy(this.itemEnter,this)]
,["mouseleave",$.proxy(this.itemLeave,this)],["mousedown",$.proxy(this.itemDown,this)],["focus",
$.proxy(this.itemFocus,this)],["blur",$.proxy(this.itemBlur,this)],["click",$.proxy(this.itemClick,
this)]],eNS));eNS+=this.rootId;if(this.opts.hideOnClick){$(document).bind(getEventsNS([["touchstart"
,$.proxy(this.docTouchStart,this)],["touchmove",$.proxy(this.docTouchMove,this)],["touchend",
$.proxy(this.docTouchEnd,this)],["click",$.proxy(this.docClick,this)]],eNS))}$(window).bind(
getEventsNS([["resize orientationchange",$.proxy(this.winResize,this)]],eNS));if(
this.opts.subIndicators){this.$subArrow=$("<span/>").addClass("sub-arrow");if(
this.opts.subIndicatorsText){this.$subArrow.html(this.opts.subIndicatorsText)}}initMouseDetection()}
this.$firstSub=this.$root.find("ul").each(function(){self.menuInit($(this))}).eq(0);
this.$firstLink=this.$root.find("a").eq(0);if(this.opts.markCurrentItem){
var reDefaultDoc=/(index|default)\.[^#\?\/]*/i,reHash=/#.*/,locHref=window.location.href.replace(
reDefaultDoc,""),locHrefNoHash=locHref.replace(reHash,"");this.$root.find("a").each(function(){
var href=this.href.replace(reDefaultDoc,""),$this=$(this);if(href==locHref||href==locHrefNoHash){
$this.addClass("current");if(self.opts.markCurrentTree){$this.parentsUntil("[data-smartmenus-id]",
"ul").each(function(){$(this).dataSM("parent-a").addClass("current")})}}})}
this.wasCollapsible=this.isCollapsible()},destroy:function(refresh){if(!refresh){
var eNS=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id"
).removeDataSM("level").unbind(eNS).undelegate(eNS);eNS+=this.rootId;$(document).unbind(eNS);$(
window).unbind(eNS);if(this.opts.subIndicators){this.$subArrow=null}}this.menuHideAll();
var self=this;this.$root.find("ul").each(function(){var $this=$(this);if($this.dataSM(
"scroll-arrows")){$this.dataSM("scroll-arrows").remove()}if($this.dataSM("shown-before")){if(
self.opts.subMenusMinWidth||self.opts.subMenusMaxWidth){$this.css({width:"",minWidth:"",maxWidth:""}
).removeClass("sm-nowrap")}if($this.dataSM("scroll-arrows")){$this.dataSM("scroll-arrows").remove()}
$this.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})}if(($this.attr("id")||""
).indexOf(self.accessIdPrefix)==0){$this.removeAttr("id")}}).removeDataSM("in-mega").removeDataSM(
"shown-before").removeDataSM("ie-shim").removeDataSM("scroll-arrows").removeDataSM("parent-a"
).removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr(
"aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded");this.$root.find(
"a.has-submenu").each(function(){var $this=$(this);if($this.attr("id").indexOf(self.accessIdPrefix
)==0){$this.removeAttr("id")}}).removeClass("has-submenu").removeDataSM("sub").removeAttr(
"aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM(
"sub");if(this.opts.subIndicators){this.$root.find("span.sub-arrow").remove()}if(
this.opts.markCurrentItem){this.$root.find("a.current").removeClass("current")}if(!refresh){
this.$root=null;this.$firstLink=null;this.$firstSub=null;if(this.$disableOverlay){
this.$disableOverlay.remove();this.$disableOverlay=null}menuTrees.splice($.inArray(this,menuTrees),1
)}},disable:function(noOverlay){if(!this.disabled){this.menuHideAll();if(
!noOverlay&&!this.opts.isPopup&&this.$root.is(":visible")){var pos=this.$root.offset();
this.$disableOverlay=$('<div class="sm-jquery-disable-overlay"/>').css({position:"absolute",
top:pos.top,left:pos.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),
zIndex:this.getStartZIndex(true),opacity:0}).appendTo(document.body)}this.disabled=true}},
docClick:function(e){if(this.$touchScrollingSub){this.$touchScrollingSub=null;return}if(
this.visibleSubMenus.length&&!$.contains(this.$root[0],e.target)||$(e.target).is("a")){
this.menuHideAll()}},docTouchEnd:function(e){if(!this.lastTouch){return}if(
this.visibleSubMenus.length&&(this.lastTouch.x2===undefined||this.lastTouch.x1==this.lastTouch.x2
)&&(this.lastTouch.y2===undefined||this.lastTouch.y1==this.lastTouch.y2)&&(
!this.lastTouch.target||!$.contains(this.$root[0],this.lastTouch.target))){if(this.hideTimeout){
clearTimeout(this.hideTimeout);this.hideTimeout=0}var self=this;this.hideTimeout=setTimeout(
function(){self.menuHideAll()},350)}this.lastTouch=null},docTouchMove:function(e){if(!this.lastTouch
){return}var touchPoint=e.originalEvent.touches[0];this.lastTouch.x2=touchPoint.pageX;
this.lastTouch.y2=touchPoint.pageY},docTouchStart:function(e){
var touchPoint=e.originalEvent.touches[0];this.lastTouch={x1:touchPoint.pageX,y1:touchPoint.pageY,
target:touchPoint.target}},enable:function(){if(this.disabled){if(this.$disableOverlay){
this.$disableOverlay.remove();this.$disableOverlay=null}this.disabled=false}},
getClosestMenu:function(elm){var $closestMenu=$(elm).closest("ul");while($closestMenu.dataSM(
"in-mega")){$closestMenu=$closestMenu.parent().closest("ul")}return $closestMenu[0]||null},
getHeight:function($elm){return this.getOffset($elm,true)},getOffset:function($elm,height){var old;
if($elm.css("display")=="none"){old={position:$elm[0].style.position,visibility:$elm[0
].style.visibility};$elm.css({position:"absolute",visibility:"hidden"}).show()}var box=$elm[0
].getBoundingClientRect&&$elm[0].getBoundingClientRect(),val=box&&(
height?box.height||box.bottom-box.top:box.width||box.right-box.left);if(!val&&val!==0){
val=height?$elm[0].offsetHeight:$elm[0].offsetWidth}if(old){$elm.hide().css(old)}return val},
getStartZIndex:function(root){var zIndex=parseInt(this[root?"$root":"$firstSub"].css("z-index"));if(
!root&&isNaN(zIndex)){zIndex=parseInt(this.$root.css("z-index"))}return!isNaN(zIndex)?zIndex:1},
getTouchPoint:function(e){return e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||e},
getViewport:function(height){var name=height?"Height":"Width",val=document.documentElement[
"client"+name],val2=window["inner"+name];if(val2){val=Math.min(val,val2)}return val},
getViewportHeight:function(){return this.getViewport(true)},getViewportWidth:function(){
return this.getViewport()},getWidth:function($elm){return this.getOffset($elm)},
handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function($a){
return this.handleEvents()&&!this.isLinkInMegaMenu($a)},isCollapsible:function(){
return this.$firstSub.css("position")=="static"},isCSSOn:function(){return this.$firstLink.css(
"display")=="block"},isFixed:function(){var isFixed=this.$root.css("position")=="fixed";if(!isFixed
){this.$root.parentsUntil("body").each(function(){if($(this).css("position")=="fixed"){isFixed=true;
return false}})}return isFixed},isLinkInMegaMenu:function($a){return $(this.getClosestMenu($a[0])
).hasClass("mega-menu")},isTouchMode:function(){
return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function($a,focus){
var $ul=$a.closest("ul"),level=$ul.dataSM("level");if(level>1&&(!this.activatedItems[level-2
]||this.activatedItems[level-2][0]!=$ul.dataSM("parent-a")[0])){var self=this;$($ul.parentsUntil(
"[data-smartmenus-id]","ul").get().reverse()).add($ul).each(function(){self.itemActivate($(this
).dataSM("parent-a"))})}if(!this.isCollapsible()||focus){this.menuHideSubMenus(!this.activatedItems[
level-1]||this.activatedItems[level-1][0]!=$a[0]?level-1:level)}this.activatedItems[level-1]=$a;if(
this.$root.triggerHandler("activate.smapi",$a[0])===false){return}var $sub=$a.dataSM("sub");if(
$sub&&(this.isTouchMode()||(!this.opts.showOnClick||this.clickActivated))){this.menuShow($sub)}},
itemBlur:function(e){var $a=$(e.currentTarget);if(!this.handleItemEvents($a)){return}
this.$root.triggerHandler("blur.smapi",$a[0])},itemClick:function(e){var $a=$(e.currentTarget);if(
!this.handleItemEvents($a)){return}if(this.$touchScrollingSub&&this.$touchScrollingSub[0
]==$a.closest("ul")[0]){this.$touchScrollingSub=null;e.stopPropagation();return false}if(
this.$root.triggerHandler("click.smapi",$a[0])===false){return false}var subArrowClicked=$(e.target
).is("span.sub-arrow"),$sub=$a.dataSM("sub"),firstLevelSub=$sub?$sub.dataSM("level")==2:false;if(
$sub&&!$sub.is(":visible")){if(this.opts.showOnClick&&firstLevelSub){this.clickActivated=true}
this.itemActivate($a);if($sub.is(":visible")){this.focusActivated=true;return false}}else if(
this.isCollapsible()&&subArrowClicked){this.itemActivate($a);this.menuHide($sub);return false}if(
this.opts.showOnClick&&firstLevelSub||$a.hasClass("disabled")||this.$root.triggerHandler(
"select.smapi",$a[0])===false){return false}},itemDown:function(e){var $a=$(e.currentTarget);if(
!this.handleItemEvents($a)){return}$a.dataSM("mousedown",true)},itemEnter:function(e){var $a=$(
e.currentTarget);if(!this.handleItemEvents($a)){return}if(!this.isTouchMode()){if(this.showTimeout){
clearTimeout(this.showTimeout);this.showTimeout=0}var self=this;this.showTimeout=setTimeout(
function(){self.itemActivate($a)},this.opts.showOnClick&&$a.closest("ul").dataSM("level"
)==1?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",$a[0])},
itemFocus:function(e){var $a=$(e.currentTarget);if(!this.handleItemEvents($a)){return}if(
this.focusActivated&&(!this.isTouchMode()||!$a.dataSM("mousedown"))&&(
!this.activatedItems.length||this.activatedItems[this.activatedItems.length-1][0]!=$a[0])){
this.itemActivate($a,true)}this.$root.triggerHandler("focus.smapi",$a[0])},itemLeave:function(e){
var $a=$(e.currentTarget);if(!this.handleItemEvents($a)){return}if(!this.isTouchMode()){$a[0].blur()
if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}}$a.removeDataSM("mousedown")
this.$root.triggerHandler("mouseleave.smapi",$a[0])},menuHide:function($sub){if(
this.$root.triggerHandler("beforehide.smapi",$sub[0])===false){return}$sub.stop(true,true);if(
$sub.css("display")!="none"){var complete=function(){$sub.css("z-index","")};if(this.isCollapsible()
){if(this.opts.collapsibleHideFunction){this.opts.collapsibleHideFunction.call(this,$sub,complete)
}else{$sub.hide(this.opts.collapsibleHideDuration,complete)}}else{if(this.opts.hideFunction){
this.opts.hideFunction.call(this,$sub,complete)}else{$sub.hide(this.opts.hideDuration,complete)}}if(
$sub.dataSM("ie-shim")){$sub.dataSM("ie-shim").remove().css({"-webkit-transform":"",transform:""})}
if($sub.dataSM("scroll")){this.menuScrollStop($sub);$sub.css({"touch-action":"",
"-ms-touch-action":"","-webkit-transform":"",transform:""}).unbind(".smartmenus_scroll"
).removeDataSM("scroll").dataSM("scroll-arrows").hide()}$sub.dataSM("parent-a").removeClass(
"highlighted").attr("aria-expanded","false");$sub.attr({"aria-expanded":"false","aria-hidden":"true"
});var level=$sub.dataSM("level");this.activatedItems.splice(level-1,1);this.visibleSubMenus.splice(
$.inArray($sub,this.visibleSubMenus),1);this.$root.triggerHandler("hide.smapi",$sub[0])}},
menuHideAll:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}
var level=this.opts.isPopup?1:0;for(var i=this.visibleSubMenus.length-1;i>=level;i--){this.menuHide(
this.visibleSubMenus[i])}if(this.opts.isPopup){this.$root.stop(true,true);if(this.$root.is(
":visible")){if(this.opts.hideFunction){this.opts.hideFunction.call(this,this.$root)}else{
this.$root.hide(this.opts.hideDuration)}if(this.$root.dataSM("ie-shim")){this.$root.dataSM("ie-shim"
).remove()}}}this.activatedItems=[];this.visibleSubMenus=[];this.clickActivated=false;
this.focusActivated=false;this.zIndexInc=0;this.$root.triggerHandler("hideAll.smapi")},
menuHideSubMenus:function(level){for(var i=this.activatedItems.length-1;i>=level;i--){
var $sub=this.activatedItems[i].dataSM("sub");if($sub){this.menuHide($sub)}}},
menuIframeShim:function($ul){if(IE&&this.opts.overlapControlsInIE&&!$ul.dataSM("ie-shim")){
$ul.dataSM("ie-shim",$("<iframe/>").attr({src:"javascript:0",tabindex:-9}).css({position:"absolute",
top:"auto",left:"0",opacity:0,border:"0"}))}},menuInit:function($ul){if(!$ul.dataSM("in-mega")){if(
$ul.hasClass("mega-menu")){$ul.find("ul").dataSM("in-mega",true)}var level=2,par=$ul[0];while((
par=par.parentNode.parentNode)!=this.$root[0]){level++}var $a=$ul.prevAll("a").eq(-1);if(!$a.length
){$a=$ul.prevAll().find("a").eq(-1)}$a.addClass("has-submenu").dataSM("sub",$ul);$ul.dataSM(
"parent-a",$a).dataSM("level",level).parent().dataSM("sub",$ul);var aId=$a.attr("id"
)||this.accessIdPrefix+ ++this.idInc,ulId=$ul.attr("id")||this.accessIdPrefix+ ++this.idInc;$a.attr(
{id:aId,"aria-haspopup":"true","aria-controls":ulId,"aria-expanded":"false"});$ul.attr({id:ulId,
role:"group","aria-hidden":"true","aria-labelledby":aId,"aria-expanded":"false"});if(
this.opts.subIndicators){$a[this.opts.subIndicatorsPos](this.$subArrow.clone())}}},
menuPosition:function($sub){var $a=$sub.dataSM("parent-a"),$li=$a.closest("li"),$ul=$li.parent(),
level=$sub.dataSM("level"),subW=this.getWidth($sub),subH=this.getHeight($sub),itemOffset=$a.offset()
,itemX=itemOffset.left,itemY=itemOffset.top,itemW=this.getWidth($a),itemH=this.getHeight($a),$win=$(
window),winX=$win.scrollLeft(),winY=$win.scrollTop(),winW=this.getViewportWidth(),
winH=this.getViewportHeight(),horizontalParent=$ul.parent().is("[data-sm-horizontal-sub]"
)||level==2&&!$ul.hasClass("sm-vertical"),rightToLeft=this.opts.rightToLeftSubMenus&&!$li.is(
"[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&$li.is("[data-sm-reverse]"),
subOffsetX=level==2?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,
subOffsetY=level==2?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY,x,y;if(
horizontalParent){x=rightToLeft?itemW-subW-subOffsetX:subOffsetX;
y=this.opts.bottomToTopSubMenus?-subH-subOffsetY:itemH+subOffsetY}else{
x=rightToLeft?subOffsetX-subW:itemW-subOffsetX;
y=this.opts.bottomToTopSubMenus?itemH-subOffsetY-subH:subOffsetY}if(this.opts.keepInViewport){
var absX=itemX+x,absY=itemY+y;if(rightToLeft&&absX<winX){
x=horizontalParent?winX-absX+x:itemW-subOffsetX}else if(!rightToLeft&&absX+subW>winX+winW){
x=horizontalParent?winX+winW-subW-absX+x:subOffsetX-subW}if(!horizontalParent){if(
subH<winH&&absY+subH>winY+winH){y+=winY+winH-subH-absY}else if(subH>=winH||absY<winY){y+=winY-absY}}
if(horizontalParent&&(absY+subH>winY+winH+.49||absY<winY)||!horizontalParent&&subH>winH+.49){
var self=this;if(!$sub.dataSM("scroll-arrows")){$sub.dataSM("scroll-arrows",$([$(
'<span class="scroll-up"><span class="scroll-up-arrow"></span></span>')[0],$(
'<span class="scroll-down"><span class="scroll-down-arrow"></span></span>')[0]]).bind({
mouseenter:function(){$sub.dataSM("scroll").up=$(this).hasClass("scroll-up");self.menuScroll($sub)},
mouseleave:function(e){self.menuScrollStop($sub);self.menuScrollOut($sub,e)},
"mousewheel DOMMouseScroll":function(e){e.preventDefault()}}).insertAfter($sub))}
var eNS=".smartmenus_scroll";$sub.dataSM("scroll",{y:this.cssTransforms3d?0:y-itemH,step:1,
itemH:itemH,subH:subH,arrowDownH:this.getHeight($sub.dataSM("scroll-arrows").eq(1))}).bind(
getEventsNS([["mouseover",function(e){self.menuScrollOver($sub,e)}],["mouseout",function(e){
self.menuScrollOut($sub,e)}],["mousewheel DOMMouseScroll",function(e){self.menuScrollMousewheel($sub
,e)}]],eNS)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:x+(parseInt($sub.css(
"border-left-width"))||0),width:subW-(parseInt($sub.css("border-left-width"))||0)-(parseInt(
$sub.css("border-right-width"))||0),zIndex:$sub.css("z-index")}).eq(
horizontalParent&&this.opts.bottomToTopSubMenus?0:1).show();if(this.isFixed()){$sub.css({
"touch-action":"none","-ms-touch-action":"none"}).bind(getEventsNS([[
touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"
,function(e){self.menuScrollTouch($sub,e)}]],eNS))}}}$sub.css({top:"auto",left:"0",marginLeft:x,
marginTop:y-itemH});this.menuIframeShim($sub);if($sub.dataSM("ie-shim")){$sub.dataSM("ie-shim").css(
{zIndex:$sub.css("z-index"),width:subW,height:subH,marginLeft:x,marginTop:y-itemH})}},
menuScroll:function($sub,once,step){var data=$sub.dataSM("scroll"),$arrows=$sub.dataSM(
"scroll-arrows"),end=data.up?data.upEnd:data.downEnd,diff;if(!once&&data.momentum){
data.momentum*=.92;diff=data.momentum;if(diff<.5){this.menuScrollStop($sub);return}}else{
diff=step||(once||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(data.step))}
var level=$sub.dataSM("level");if(this.activatedItems[level-1]&&this.activatedItems[level-1].dataSM(
"sub")&&this.activatedItems[level-1].dataSM("sub").is(":visible")){this.menuHideSubMenus(level-1)}
data.y=data.up&&end<=data.y||!data.up&&end>=data.y?data.y:Math.abs(end-data.y)>diff?data.y+(
data.up?diff:-diff):end;$sub.add($sub.dataSM("ie-shim")).css(this.cssTransforms3d?{
"-webkit-transform":"translate3d(0, "+data.y+"px, 0)",transform:"translate3d(0, "+data.y+"px, 0)"}:{
marginTop:data.y});if(mouse&&(data.up&&data.y>data.downEnd||!data.up&&data.y<data.upEnd)){
$arrows.eq(data.up?1:0).show()}if(data.y==end){if(mouse){$arrows.eq(data.up?0:1).hide()}
this.menuScrollStop($sub)}else if(!once){if(
this.opts.scrollAccelerate&&data.step<this.opts.scrollStep){data.step+=.2}var self=this;
this.scrollTimeout=requestAnimationFrame(function(){self.menuScroll($sub)})}},
menuScrollMousewheel:function($sub,e){if(this.getClosestMenu(e.target)==$sub[0]){e=e.originalEvent;
var up=(e.wheelDelta||-e.detail)>0;if($sub.dataSM("scroll-arrows").eq(up?0:1).is(":visible")){
$sub.dataSM("scroll").up=up;this.menuScroll($sub,true)}}e.preventDefault()},menuScrollOut:function(
$sub,e){if(mouse){if(!/^scroll-(up|down)/.test((e.relatedTarget||"").className)&&($sub[0
]!=e.relatedTarget&&!$.contains($sub[0],e.relatedTarget)||this.getClosestMenu(e.relatedTarget
)!=$sub[0])){$sub.dataSM("scroll-arrows").css("visibility","hidden")}}},menuScrollOver:function($sub
,e){if(mouse){if(!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==$sub[
0]){this.menuScrollRefreshData($sub);var data=$sub.dataSM("scroll"),upEnd=$(window).scrollTop(
)-$sub.dataSM("parent-a").offset().top-data.itemH;$sub.dataSM("scroll-arrows").eq(0).css(
"margin-top",upEnd).end().eq(1).css("margin-top",upEnd+this.getViewportHeight()-data.arrowDownH
).end().css("visibility","visible")}}},menuScrollRefreshData:function($sub){var data=$sub.dataSM(
"scroll"),upEnd=$(window).scrollTop()-$sub.dataSM("parent-a").offset().top-data.itemH;if(
this.cssTransforms3d){upEnd=-(parseFloat($sub.css("margin-top"))-upEnd)}$.extend(data,{upEnd:upEnd,
downEnd:upEnd+this.getViewportHeight()-data.subH})},menuScrollStop:function($sub){if(
this.scrollTimeout){cancelAnimationFrame(this.scrollTimeout);this.scrollTimeout=0;$sub.dataSM(
"scroll").step=1;return true}},menuScrollTouch:function($sub,e){e=e.originalEvent;if(isTouchEvent(e)
){var touchPoint=this.getTouchPoint(e);if(this.getClosestMenu(touchPoint.target)==$sub[0]){
var data=$sub.dataSM("scroll");if(/(start|down)$/i.test(e.type)){if(this.menuScrollStop($sub)){
e.preventDefault();this.$touchScrollingSub=$sub}else{this.$touchScrollingSub=null}
this.menuScrollRefreshData($sub);$.extend(data,{touchStartY:touchPoint.pageY,
touchStartTime:e.timeStamp})}else if(/move$/i.test(e.type)){
var prevY=data.touchY!==undefined?data.touchY:data.touchStartY;if(
prevY!==undefined&&prevY!=touchPoint.pageY){this.$touchScrollingSub=$sub;
var up=prevY<touchPoint.pageY;if(data.up!==undefined&&data.up!=up){$.extend(data,{
touchStartY:touchPoint.pageY,touchStartTime:e.timeStamp})}$.extend(data,{up:up,
touchY:touchPoint.pageY});this.menuScroll($sub,true,Math.abs(touchPoint.pageY-prevY))}
e.preventDefault()}else{if(data.touchY!==undefined){if(data.momentum=Math.pow(Math.abs(
touchPoint.pageY-data.touchStartY)/(e.timeStamp-data.touchStartTime),2)*15){this.menuScrollStop($sub
);this.menuScroll($sub);e.preventDefault()}delete data.touchY}}}}},menuShow:function($sub){if(
!$sub.dataSM("beforefirstshowfired")){$sub.dataSM("beforefirstshowfired",true);if(
this.$root.triggerHandler("beforefirstshow.smapi",$sub[0])===false){return}}if(
this.$root.triggerHandler("beforeshow.smapi",$sub[0])===false){return}$sub.dataSM("shown-before",
true).stop(true,true);if(!$sub.is(":visible")){var $a=$sub.dataSM("parent-a");if(
this.opts.keepHighlighted||this.isCollapsible()){$a.addClass("highlighted")}if(this.isCollapsible()
){$sub.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",
marginLeft:"",marginTop:""})}else{$sub.css("z-index",this.zIndexInc=(
this.zIndexInc||this.getStartZIndex())+1);if(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth
){$sub.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap");if(
this.opts.subMenusMinWidth){$sub.css("min-width",this.opts.subMenusMinWidth)}if(
this.opts.subMenusMaxWidth){var noMaxWidth=this.getWidth($sub);$sub.css("max-width",
this.opts.subMenusMaxWidth);if(noMaxWidth>this.getWidth($sub)){$sub.removeClass("sm-nowrap").css(
"width",this.opts.subMenusMaxWidth)}}}this.menuPosition($sub);if($sub.dataSM("ie-shim")){
$sub.dataSM("ie-shim").insertBefore($sub)}}var complete=function(){$sub.css("overflow","")};if(
this.isCollapsible()){if(this.opts.collapsibleShowFunction){this.opts.collapsibleShowFunction.call(
this,$sub,complete)}else{$sub.show(this.opts.collapsibleShowDuration,complete)}}else{if(
this.opts.showFunction){this.opts.showFunction.call(this,$sub,complete)}else{$sub.show(
this.opts.showDuration,complete)}}$a.attr("aria-expanded","true");$sub.attr({"aria-expanded":"true",
"aria-hidden":"false"});this.visibleSubMenus.push($sub);this.$root.triggerHandler("show.smapi",$sub[
0])}},popupHide:function(noHideTimeout){if(this.hideTimeout){clearTimeout(this.hideTimeout);
this.hideTimeout=0}var self=this;this.hideTimeout=setTimeout(function(){self.menuHideAll()},
noHideTimeout?1:this.opts.hideTimeout)},popupShow:function(left,top){if(!this.opts.isPopup){alert(
'SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'
);return}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}this.$root.dataSM(
"shown-before",true).stop(true,true);if(!this.$root.is(":visible")){this.$root.css({left:left,
top:top});this.menuIframeShim(this.$root);if(this.$root.dataSM("ie-shim")){this.$root.dataSM(
"ie-shim").css({zIndex:this.$root.css("z-index"),width:this.getWidth(this.$root),
height:this.getHeight(this.$root),left:left,top:top}).insertBefore(this.$root)}var self=this,
complete=function(){self.$root.css("overflow","")};if(this.opts.showFunction){
this.opts.showFunction.call(this,this.$root,complete)}else{this.$root.show(this.opts.showDuration,
complete)}this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(true);this.init(true)
},rootKeyDown:function(e){if(!this.handleEvents()){return}switch(e.keyCode){case 27:
var $activeTopItem=this.activatedItems[0];if($activeTopItem){this.menuHideAll();$activeTopItem[0
].focus();var $sub=$activeTopItem.dataSM("sub");if($sub){this.menuHide($sub)}}break;case 32:
var $target=$(e.target);if($target.is("a")&&this.handleItemEvents($target)){var $sub=$target.dataSM(
"sub");if($sub&&!$sub.is(":visible")){this.itemClick({currentTarget:e.target});e.preventDefault()}}
break}},rootOut:function(e){if(!this.handleEvents()||this.isTouchMode()||e.target==this.$root[0]){
return}if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}if(
!this.opts.showOnClick||!this.opts.hideOnClick){var self=this;this.hideTimeout=setTimeout(function(
){self.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(e){if(!this.handleEvents(
)||this.isTouchMode()||e.target==this.$root[0]){return}if(this.hideTimeout){clearTimeout(
this.hideTimeout);this.hideTimeout=0}},winResize:function(e){if(!this.handleEvents()){if(
this.$disableOverlay){var pos=this.$root.offset();this.$disableOverlay.css({top:pos.top,
left:pos.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}return}if(!(
"onorientationchange"in window)||e.type=="orientationchange"){var isCollapsible=this.isCollapsible()
if(!(this.wasCollapsible&&isCollapsible)){if(this.activatedItems.length){this.activatedItems[
this.activatedItems.length-1][0].blur()}this.menuHideAll()}this.wasCollapsible=isCollapsible}}}});
$.fn.dataSM=function(key,val){if(val){return this.data(key+"_smartmenus",val)}return this.data(
key+"_smartmenus")};$.fn.removeDataSM=function(key){return this.removeData(key+"_smartmenus")};
$.fn.smartmenus=function(options){if(typeof options=="string"){var args=arguments,method=options;
Array.prototype.shift.call(args);return this.each(function(){var smartmenus=$(this).data(
"smartmenus");if(smartmenus&&smartmenus[method]){smartmenus[method].apply(smartmenus,args)}})}
var opts=$.extend({},$.fn.smartmenus.defaults,options);return this.each(function(){new $.SmartMenus(
this,opts)})};$.fn.smartmenus.defaults={isPopup:false,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,
subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",
subIndicators:true,subIndicatorsPos:"prepend",subIndicatorsText:"+",scrollStep:30,
scrollAccelerate:true,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,
hideDuration:0,hideFunction:function($ul,complete){$ul.fadeOut(200,complete)},
collapsibleShowDuration:0,collapsibleShowFunction:function($ul,complete){$ul.slideDown(200,complete)
},collapsibleHideDuration:0,collapsibleHideFunction:function($ul,complete){$ul.slideUp(200,complete)
},showOnClick:false,hideOnClick:true,noMouseOver:false,keepInViewport:true,keepHighlighted:true,
markCurrentItem:false,markCurrentTree:true,rightToLeftSubMenus:false,bottomToTopSubMenus:false,
overlapControlsInIE:true};return $});!function(f){
typeof module!="undefined"&&typeof exports=="object"?module.exports=f(
):typeof define!="undefined"&&define.amd?define(["fzstd",f]):(typeof self!="undefined"?self:this
).fzstd=f()}(function(){var _e={};"use strict";var r=ArrayBuffer,t=Uint8Array,e=Uint16Array,
n=Int16Array,a=Uint32Array,s=Int32Array,i=function(r,e,n){if(t.prototype.slice
)return t.prototype.slice.call(r,e,n);(null==e||e<0)&&(e=0),(null==n||n>r.length)&&(n=r.length);
var a=new t(n-e);return a.set(r.subarray(e,n)),a},o=function(r,e,n,a){if(t.prototype.fill
)return t.prototype.fill.call(r,e,n,a);for((null==n||n<0)&&(n=0),(null==a||a>r.length)&&(a=r.length
);n<a;++n)r[n]=e;return r},u=function(r,e,n,a){if(t.prototype.copyWithin
)return t.prototype.copyWithin.call(r,e,n,a);for((null==n||n<0)&&(n=0),(null==a||a>r.length)&&(
a=r.length);n<a;)r[e++]=r[n++]};_e.ZstdErrorCode={InvalidData:0,WindowSizeTooLarge:1,
InvalidBlockType:2,FSEAccuracyTooHigh:3,DistanceTooFarBack:4,UnexpectedEOF:5};var f=[
"invalid zstd data","window size too large (>2046MB)","invalid block type","FSE accuracy too high",
"match distance too far back","unexpected EOF"],h=function(r,t,e){var n=Error(t||f[r]);if(n.code=r,
Error.captureStackTrace&&Error.captureStackTrace(n,h),!e)throw n;return n},l=function(r,t,e){for(
var n=0,a=0;n<e;++n)a|=r[t++]<<(n<<3);return a},v=function(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16|r[
t+3]<<24)>>>0},c=function(r,e){var n=r[0]|r[1]<<8|r[2]<<16;if(3126568==n&&253==r[3]){var a=r[4],
i=a>>5&1,o=a>>2&1,u=3&a,f=a>>6;8&a&&h(0);var c=6-i,b=3==u?4:u,y=l(r,c,b),p=f?1<<f:i,w=l(r,c+=b,p)+(
1==f&&256),g=w;if(!i){var d=1<<10+(r[5]>>3);g=d+(d>>3)*(7&r[5])}g>2145386496&&h(1);var m=new t((
1==e?w||g:e?0:g)+12);return m[0]=1,m[4]=4,m[8]=8,{b:c+p,y:0,l:0,d:y,w:e&&1!=e?e:m.subarray(12),e:g,
o:new s(m.buffer,0,3),u:w,c:o,m:Math.min(131072,g)}}if(25481893==(n>>4|r[3]<<20))return v(r,4)+8;h(0
)},b=function(r){for(var t=0;1<<t<=r;++t);return t-1},y=function(a,s,i){var o=4+(s<<3),u=5+(15&a[s])
u>i&&h(3);for(var f=1<<u,l=f,v=-1,c=-1,y=-1,p=f,w=new r(512+(f<<2)),g=new n(w,0,256),d=new e(w,0,256
),m=new e(w,512,f),z=512+(f<<1),E=new t(w,z,f),k=new t(w,z+f);v<255&&l>0;){var A=b(l+1),T=o>>3,x=(
1<<A+1)-1,F=(a[T]|a[T+1]<<8|a[T+2]<<16)>>(7&o)&x,S=(1<<A)-1,B=x-l-1,I=F&S;if(I<B?(o+=A,F=I):(o+=A+1,
F>S&&(F-=B)),g[++v]=--F,-1==F?(l+=F,E[--p]=v):l-=F,!F)do{var U=o>>3;c=(a[U]|a[U+1]<<8)>>(7&o)&3,o+=2
,v+=c}while(3==c)}(v>255||l)&&h(0);for(var D=0,M=(f>>1)+(f>>3)+3,W=f-1,O=0;O<=v;++O){var j=g[O];if(
j<1)d[O]=-j;else for(y=0;y<j;++y){E[D]=O;do{D=D+M&W}while(D>=p)}}for(D&&h(0),y=0;y<f;++y){var C=d[E[
y]]++,H=k[y]=u-b(C);m[y]=(C<<H)-f}return[o+7>>3,{b:u,s:E,n:k,t:m}]},p=function(r,n){var a=0,s=-1,
i=new t(292),u=r[n],f=i.subarray(0,256),l=i.subarray(256,268),v=new e(i.buffer,268);if(u<128){
var c=y(r,n+1,6),p=c[1],w=c[0]<<3,g=r[n+=u];g||h(0);for(var d=0,m=0,z=p.b,E=z,k=(++n<<3)-8+b(g);!((
k-=z)<w);){var A=k>>3;if(f[++s]=p.s[d+=(r[A]|r[A+1]<<8)>>(7&k)&(1<<z)-1],(k-=E)<w)break;f[++s]=p.s[
m+=(r[A=k>>3]|r[A+1]<<8)>>(7&k)&(1<<E)-1],z=p.n[d],d=p.t[d],E=p.n[m],m=p.t[m]}++s>255&&h(0)}else{
for(s=u-127;a<s;a+=2){var T=r[++n];f[a]=T>>4,f[a+1]=15&T}++n}var x=0;for(a=0;a<s;++a)(I=f[a])>11&&h(
0),x+=I&&1<<I-1;var F=b(x)+1,S=1<<F,B=S-x;for(B&B-1&&h(0),f[s++]=b(B)+1,a=0;a<s;++a){var I;++l[f[a
]=(I=f[a])&&F+1-I]}var U=new t(S<<1),D=U.subarray(0,S),M=U.subarray(S);for(v[F]=0,a=F;a>0;--a){
var W=v[a];o(M,a,W,v[a-1]=W+l[a]*(1<<F-a))}for(v[0]!=S&&h(0),a=0;a<s;++a){var O=f[a];if(O){var j=v[O
];o(D,a,j,v[O]=j+(1<<F-O))}}return[n,{n:M,b:F,s:D}]},w=y(new t([81,16,99,140,49,198,24,99,12,33,196,
24,99,102,102,134,70,146,4]),0,6)[1],g=y(new t([33,20,196,24,99,140,33,132,16,66,8,33,132,16,66,8,33
,68,68,68,68,68,68,68,68,36,9]),0,6)[1],d=y(new t([32,132,16,66,102,70,68,68,68,68,36,73,2]),0,5)[1]
,m=function(r,t){for(var e=r.length,n=new s(e),a=0;a<e;++a)n[a]=t,t+=1<<r[a];return n},z=new t(
new s([0,0,0,0,16843009,50528770,134678020,202050057,269422093]).buffer,0,36),E=m(z,0),k=new t(
new s([0,0,0,0,0,0,0,0,16843009,50528770,117769220,185207048,252579084,16]).buffer,0,53),A=m(k,3),
T=function(r,t,e){var n=r.length,a=t.length,s=r[n-1],i=(1<<e.b)-1,o=-e.b;s||h(0);for(var u=0,f=e.b,
l=(n<<3)-8+b(s)-f,v=-1;l>o&&v<a;){var c=l>>3;t[++v]=e.s[u=(u<<f|(r[c]|r[c+1]<<8|r[c+2]<<16)>>(7&l)
)&i],l-=f=e.n[u]}l==o&&v+1==a||h(0)},x=function(r,t,e){var n=6,a=t.length+3>>2,s=a<<1,i=a+s;T(
r.subarray(n,n+=r[0]|r[1]<<8),t.subarray(0,a),e),T(r.subarray(n,n+=r[2]|r[3]<<8),t.subarray(a,s),e),
T(r.subarray(n,n+=r[4]|r[5]<<8),t.subarray(s,i),e),T(r.subarray(n),t.subarray(i),e)},F=function(r,n,
a){var s,u=n.b,f=r[u],l=f>>1&3;n.l=1&f;var v=f>>3|r[u+1]<<5|r[u+2]<<13,c=(u+=3)+v;if(1==l){if(
u>=r.length)return;return n.b=u+1,a?(o(a,r[u],n.y,n.y+=v),a):o(new t(v),r[u])}if(!(c>r.length)){if(
0==l)return n.b=c,a?(a.set(r.subarray(u,c),n.y),n.y+=v,a):i(r,u,c);if(2==l){var m=r[u],F=3&m,
S=m>>2&3,B=m>>4,I=0,U=0;F<2?1&S?B|=r[++u]<<4|(2&S&&r[++u]<<12):B=m>>3:(U=S,S<2?(B|=(63&r[++u])<<4,
I=r[u]>>6|r[++u]<<2):2==S?(B|=r[++u]<<4|(3&r[++u])<<12,I=r[u]>>2|r[++u]<<6):(B|=r[++u]<<4|(63&r[++u]
)<<12,I=r[u]>>6|r[++u]<<2|r[++u]<<10)),++u;var D=a?a.subarray(n.y,n.y+n.m):new t(n.m),M=D.length-B;
if(0==F)D.set(r.subarray(u,u+=B),M);else if(1==F)o(D,r[u++],M);else{var W=n.h;if(2==F){var O=p(r,u);
I+=u-(u=O[0]),n.h=W=O[1]}else W||h(0);(U?x:T)(r.subarray(u,u+=I),D.subarray(M),W)}var j=r[u++];if(j
){255==j?j=32512+(r[u++]|r[u++]<<8):j>127&&(j=j-128<<8|r[u++]);var C=r[u++];3&C&&h(0);for(var H=[g,d
,w],L=2;L>-1;--L){var Z=C>>2+(L<<1)&3;if(1==Z){var q=new t([0,0,r[u++]]);H[L]={s:q.subarray(2,3),
n:q.subarray(0,1),t:new e(q.buffer,0,1),b:0}}else 2==Z?(u=(s=y(r,u,9-(1&L)))[0],H[L]=s[1]):3==Z&&(
n.t||h(0),H[L]=n.t[L])}var G=n.t=H,J=G[0],K=G[1],N=G[2],P=r[c-1];P||h(0);var Q=(c<<3)-8+b(P)-N.b,
R=Q>>3,V=0,X=(r[R]|r[R+1]<<8)>>(7&Q)&(1<<N.b)-1,Y=(r[R=(Q-=K.b)>>3]|r[R+1]<<8)>>(7&Q)&(1<<K.b)-1,$=(
r[R=(Q-=J.b)>>3]|r[R+1]<<8)>>(7&Q)&(1<<J.b)-1;for(++j;--j;){var _=N.s[X],rr=N.n[X],tr=J.s[$],er=J.n[
$],nr=K.s[Y],ar=K.n[Y],sr=1<<nr,ir=sr+((r[R=(Q-=nr)>>3]|r[R+1]<<8|r[R+2]<<16|r[R+3]<<24)>>>(7&Q
)&sr-1);R=(Q-=k[tr])>>3;var or=A[tr]+((r[R]|r[R+1]<<8|r[R+2]<<16)>>(7&Q)&(1<<k[tr])-1);R=(Q-=z[_]
)>>3;var ur=E[_]+((r[R]|r[R+1]<<8|r[R+2]<<16)>>(7&Q)&(1<<z[_])-1);if(R=(Q-=rr)>>3,X=N.t[X]+((r[R]|r[
R+1]<<8)>>(7&Q)&(1<<rr)-1),R=(Q-=er)>>3,$=J.t[$]+((r[R]|r[R+1]<<8)>>(7&Q)&(1<<er)-1),R=(Q-=ar)>>3,
Y=K.t[Y]+((r[R]|r[R+1]<<8)>>(7&Q)&(1<<ar)-1),ir>3)n.o[2]=n.o[1],n.o[1]=n.o[0],n.o[0]=ir-=3;else{
var fr=ir-(0!=ur);fr?(ir=3==fr?n.o[0]-1:n.o[fr],fr>1&&(n.o[2]=n.o[1]),n.o[1]=n.o[0],n.o[0]=ir
):ir=n.o[0]}for(L=0;L<ur;++L)D[V+L]=D[M+L];M+=ur;var hr=(V+=ur)-ir;if(hr<0){var lr=-hr,vr=n.e+hr;
for(lr>or&&(lr=or),L=0;L<lr;++L)D[V+L]=n.w[vr+L];V+=lr,or-=lr,hr=0}for(L=0;L<or;++L)D[V+L]=D[hr+L];
V+=or}if(V!=M)for(;M<D.length;)D[V++]=D[M++];else V=D.length;a?n.y+=V:D=i(D,0,V)}else if(a){if(
n.y+=B,M)for(L=0;L<B;++L)D[L]=D[M+L]}else M&&(D=i(D,M));return n.b=c,D}h(2)}},S=function(r,e){if(
1==r.length)return r[0];for(var n=new t(e),a=0,s=0;a<r.length;++a){var i=r[a];n.set(i,s),s+=i.length
}return n};function B(r,t){for(var e=0,n=[],a=+!t,s=0;r.length;){var i=c(r,a||t);if(
"object"==typeof i){for(a?(t=null,i.w.length==i.u&&(n.push(t=i.w),s+=i.u)):(n.push(t),i.e=0);!i.l;){
var o=F(r,i,t);o||h(5),t?i.e=i.y:(n.push(o),s+=o.length,u(i.w,0,o.length),i.w.set(o,
i.w.length-o.length))}e=i.b+4*i.c}else e=i;r=r.subarray(e)}return S(n,s)}_e.decompress=B;
var I=function(){function r(r){this.ondata=r,this.c=[],this.l=0,this.z=0}
return r.prototype.push=function(r,t){if("number"==typeof this.s){var e=Math.min(r.length,this.s);
r=r.subarray(e),this.s-=e}var n=r.length+this.l;if(!this.s){if(t){if(!n)return;n<5&&h(5)}else if(
n<18)return this.c.push(r),void(this.l=n);if(this.l&&(this.c.push(r),r=S(this.c,n),this.c=[],
this.l=0),"number"==typeof(this.s=c(r)))return this.push(r,t)}if("number"!=typeof this.s){if(n<(
this.z||4))return t&&h(5),this.c.push(r),void(this.l=n);if(this.l&&(this.c.push(r),r=S(this.c,n),
this.c=[],this.l=0),!this.z&&n<(this.z=2&r[this.s.b]?5:4+(r[this.s.b]>>3|r[this.s.b+1]<<5|r[
this.s.b+2]<<13)))return t&&h(5),this.c.push(r),void(this.l=n);for(this.z=0;;){var a=F(r,this.s);if(
!a){t&&h(5);var s=r.subarray(this.s.b);return this.s.b=0,this.c.push(s),void(this.l+=s.length)}if(
this.ondata(a,!1),u(this.s.w,0,a.length),this.s.w.set(a,this.s.w.length-a.length),this.s.l){
var i=r.subarray(this.s.b);return this.s=4*this.s.c,void this.push(i,t)}}}},r}();_e.Decompress=I;
return _e});!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports
):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).glMatrix={})}(this,
function(t){"use strict";var n=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array,
r=Math.random;var u=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,
n=arguments.length;n--;)t+=arguments[n]*arguments[n];return Math.sqrt(t)});var e=Object.freeze({
__proto__:null,EPSILON:n,get ARRAY_TYPE(){return a},RANDOM:r,setMatrixArrayType:function(t){a=t},
toRadian:function(t){return t*u},equals:function(t,a){return Math.abs(t-a)<=n*Math.max(1,Math.abs(t)
,Math.abs(a))}});function o(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1],c=a[2],s=a[3];
return t[0]=r*i+e*h,t[1]=u*i+o*h,t[2]=r*c+e*s,t[3]=u*c+o*s,t}function i(t,n,a){return t[0]=n[0]-a[0]
,t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}var h=o,c=i,s=Object.freeze({__proto__:null,
create:function(){var t=new a(4);return a!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},
clone:function(t){var n=new a(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n},copy:function(t,n
){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0
,t[3]=1,t},fromValues:function(t,n,r,u){var e=new a(4);return e[0]=t,e[1]=n,e[2]=r,e[3]=u,e},
set:function(t,n,a,r,u){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t},transpose:function(t,n){if(t===n){
var a=n[1];t[1]=n[2],t[2]=a}else t[0]=n[0],t[1]=n[2],t[2]=n[1],t[3]=n[3];return t},invert:function(t
,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a*e-u*r;return o?(o=1/o,t[0]=e*o,t[1]=-r*o,t[2]=-u*o,t[3]=a*o,
t):null},adjoint:function(t,n){var a=n[0];return t[0]=n[3],t[1]=-n[1],t[2]=-n[2],t[3]=a,t},
determinant:function(t){return t[0]*t[3]-t[2]*t[1]},multiply:o,rotate:function(t,n,a){var r=n[0],
u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);return t[0]=r*h+e*i,t[1]=u*h+o*i,t[2]=r*-i+e*h,t[3
]=u*-i+o*h,t},scale:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1];return t[0]=r*i,t[
1]=u*i,t[2]=e*h,t[3]=o*h,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r
,t[1]=a,t[2]=-a,t[3]=r,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t},
str:function(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},frob:function(t){
return Math.hypot(t[0],t[1],t[2],t[3])},LDU:function(t,n,a,r){return t[2]=r[2]/r[0],a[0]=r[0],a[1
]=r[1],a[3]=r[3]-t[2]*a[1],[t,n,a]},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[
2]+a[2],t[3]=n[3]+a[3],t},subtract:i,exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2
]===n[2]&&t[3]===n[3]},equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=a[0],h=a[1],c=a[2],
s=a[3];return Math.abs(r-i)<=n*Math.max(1,Math.abs(r),Math.abs(i))&&Math.abs(u-h)<=n*Math.max(1,
Math.abs(u),Math.abs(h))&&Math.abs(e-c)<=n*Math.max(1,Math.abs(e),Math.abs(c))&&Math.abs(o-s
)<=n*Math.max(1,Math.abs(o),Math.abs(s))},multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1
]*a,t[2]=n[2]*a,t[3]=n[3]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1
]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t},mul:h,sub:c});function M(t,n,a){var r=n[0],u=n[1]
,e=n[2],o=n[3],i=n[4],h=n[5],c=a[0],s=a[1],M=a[2],f=a[3],l=a[4],v=a[5];return t[0]=r*c+e*s,t[1
]=u*c+o*s,t[2]=r*M+e*f,t[3]=u*M+o*f,t[4]=r*l+e*v+i,t[5]=u*l+o*v+h,t}function f(t,n,a){return t[0]=n[
0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t}var l=M,v=f,
b=Object.freeze({__proto__:null,create:function(){var t=new a(6);return a!=Float32Array&&(t[1]=0,t[2
]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t},clone:function(t){var n=new a(6);return n[0]=t[0],n[1]=t[1],n[2
]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3
]=n[3],t[4]=n[4],t[5]=n[5],t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,
t},fromValues:function(t,n,r,u,e,o){var i=new a(6);return i[0]=t,i[1]=n,i[2]=r,i[3]=u,i[4]=e,i[5]=o,
i},set:function(t,n,a,r,u,e,o){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t},invert:function(t
,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=a*e-r*u;return h?(h=1/h,t[0]=e*h,t[1]=-r*h,t[2
]=-u*h,t[3]=a*h,t[4]=(u*i-e*o)*h,t[5]=(r*o-a*i)*h,t):null},determinant:function(t){return t[0]*t[3
]-t[1]*t[2]},multiply:M,rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],
c=Math.sin(a),s=Math.cos(a);return t[0]=r*s+e*c,t[1]=u*s+o*c,t[2]=r*-c+e*s,t[3]=u*-c+o*s,t[4]=i,t[5
]=h,t},scale:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=a[0],s=a[1];return t[0
]=r*c,t[1]=u*c,t[2]=e*s,t[3]=o*s,t[4]=i,t[5]=h,t},translate:function(t,n,a){var r=n[0],u=n[1],e=n[2]
,o=n[3],i=n[4],h=n[5],c=a[0],s=a[1];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=r*c+e*s+i,t[5]=u*c+o*s+h
,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=-a,t[3]=r,
t[4]=0,t[5]=0,t},fromScaling:function(t,n){return t[0]=n[0],t[1]=0,t[2]=0,t[3]=n[1],t[4]=0,t[5]=0,t
},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=n[0],t[5]=n[1],t},
str:function(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"},
frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)},add:function(t,n,a){return t[0
]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t},
subtract:f,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4
]=n[4]*a,t[5]=n[5]*a,t},multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1
]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t},exactEquals:function(t,n
){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]},
equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],h=t[5],c=a[0],s=a[1],M=a[2],f=a[3],l=a[4
],v=a[5];return Math.abs(r-c)<=n*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(u-s)<=n*Math.max(1,
Math.abs(u),Math.abs(s))&&Math.abs(e-M)<=n*Math.max(1,Math.abs(e),Math.abs(M))&&Math.abs(o-f
)<=n*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(i-l)<=n*Math.max(1,Math.abs(i),Math.abs(l)
)&&Math.abs(h-v)<=n*Math.max(1,Math.abs(h),Math.abs(v))},mul:l,sub:v});function m(){var t=new a(9);
return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}
function d(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=a[0],l=a[1],
v=a[2],b=a[3],m=a[4],d=a[5],p=a[6],x=a[7],y=a[8];return t[0]=f*r+l*o+v*c,t[1]=f*u+l*i+v*s,t[2
]=f*e+l*h+v*M,t[3]=b*r+m*o+d*c,t[4]=b*u+m*i+d*s,t[5]=b*e+m*h+d*M,t[6]=p*r+x*o+y*c,t[7]=p*u+x*i+y*s,
t[8]=p*e+x*h+y*M,t}function p(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3
]-a[3],t[4]=n[4]-a[4],t[5]=n[5]-a[5],t[6]=n[6]-a[6],t[7]=n[7]-a[7],t[8]=n[8]-a[8],t}var x=d,y=p,
q=Object.freeze({__proto__:null,create:m,fromMat4:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2]
,t[3]=n[4],t[4]=n[5],t[5]=n[6],t[6]=n[8],t[7]=n[9],t[8]=n[10],t},clone:function(t){var n=new a(9);
return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n},
copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7
]=n[7],t[8]=n[8],t},fromValues:function(t,n,r,u,e,o,i,h,c){var s=new a(9);return s[0]=t,s[1]=n,s[2
]=r,s[3]=u,s[4]=e,s[5]=o,s[6]=i,s[7]=h,s[8]=c,s},set:function(t,n,a,r,u,e,o,i,h,c){return t[0]=n,t[1
]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=h,t[8]=c,t},identity:function(t){return t[0]=1,t[1]=0,t[
2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},transpose:function(t,n){if(t===n){var a=n[1],r=n[2
],u=n[5];t[1]=n[3],t[2]=n[6],t[3]=a,t[5]=n[7],t[6]=r,t[7]=u}else t[0]=n[0],t[1]=n[3],t[2]=n[6],t[3
]=n[1],t[4]=n[4],t[5]=n[7],t[6]=n[2],t[7]=n[5],t[8]=n[8];return t},invert:function(t,n){var a=n[0],
r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8],M=s*o-i*c,f=-s*e+i*h,l=c*e-o*h,v=a*M+r*f+u*l
return v?(v=1/v,t[0]=M*v,t[1]=(-s*r+u*c)*v,t[2]=(i*r-u*o)*v,t[3]=f*v,t[4]=(s*a-u*h)*v,t[5]=(-i*a+u*e
)*v,t[6]=l*v,t[7]=(-c*a+r*h)*v,t[8]=(o*a-r*e)*v,t):null},adjoint:function(t,n){var a=n[0],r=n[1],
u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8];return t[0]=o*s-i*c,t[1]=u*c-r*s,t[2]=r*i-u*o,t[3
]=i*h-e*s,t[4]=a*s-u*h,t[5]=u*e-a*i,t[6]=e*c-o*h,t[7]=r*h-a*c,t[8]=a*o-r*e,t},determinant:function(t
){var n=t[0],a=t[1],r=t[2],u=t[3],e=t[4],o=t[5],i=t[6],h=t[7],c=t[8];return n*(c*e-o*h)+a*(-c*u+o*i
)+r*(h*u-e*i)},multiply:d,translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],
c=n[6],s=n[7],M=n[8],f=a[0],l=a[1];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=i,t[5]=h,t[6]=f*r+l*o+c,
t[7]=f*u+l*i+s,t[8]=f*e+l*h+M,t},rotate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5
],c=n[6],s=n[7],M=n[8],f=Math.sin(a),l=Math.cos(a);return t[0]=l*r+f*o,t[1]=l*u+f*i,t[2]=l*e+f*h,t[3
]=l*o-f*r,t[4]=l*i-f*u,t[5]=l*h-f*e,t[6]=c,t[7]=s,t[8]=M,t},scale:function(t,n,a){var r=a[0],u=a[1];
return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=u*n[3],t[4]=u*n[4],t[5]=u*n[5],t[6]=n[6],t[7]=n[7],
t[8]=n[8],t},fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=n[0
],t[7]=n[1],t[8]=1,t},fromRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1
]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromScaling:function(t,n){return t[0]=n[0],
t[1]=0,t[2]=0,t[3]=0,t[4]=n[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},fromMat2d:function(t,n){return t[0]=n[
0],t[1]=n[1],t[2]=0,t[3]=n[2],t[4]=n[3],t[5]=0,t[6]=n[4],t[7]=n[5],t[8]=1,t},fromQuat:function(t,n){
var a=n[0],r=n[1],u=n[2],e=n[3],o=a+a,i=r+r,h=u+u,c=a*o,s=r*o,M=r*i,f=u*o,l=u*i,v=u*h,b=e*o,m=e*i,
d=e*h;return t[0]=1-M-v,t[3]=s-d,t[6]=f+m,t[1]=s+d,t[4]=1-c-v,t[7]=l-b,t[2]=f-m,t[5]=l+b,t[8]=1-c-M,
t},normalFromMat4:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8],
M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15],p=a*i-r*o,x=a*h-u*o,y=a*c-e*o,q=r*h-u*i,
g=r*c-e*i,_=u*c-e*h,A=s*b-M*v,w=s*m-f*v,R=s*d-l*v,z=M*m-f*b,O=M*d-l*b,j=f*d-l*m,
P=p*j-x*O+y*z+q*R-g*w+_*A;return P?(P=1/P,t[0]=(i*j-h*O+c*z)*P,t[1]=(h*R-o*j-c*w)*P,t[2]=(
o*O-i*R+c*A)*P,t[3]=(u*O-r*j-e*z)*P,t[4]=(a*j-u*R+e*w)*P,t[5]=(r*R-a*O-e*A)*P,t[6]=(b*_-m*g+d*q)*P,
t[7]=(m*y-v*_-d*x)*P,t[8]=(v*g-b*y+d*p)*P,t):null},projection:function(t,n,a){return t[0]=2/n,t[1]=0
,t[2]=0,t[3]=0,t[4]=-2/a,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t},str:function(t){return"mat3("+t[0]+", "+t[1
]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"},frob:function(t){
return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},add:function(t,n,a){return t[0]=n[0
]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7
]=n[7]+a[7],t[8]=n[8]+a[8],t},subtract:p,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1
]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*a,t},
multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3
]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t[6]=n[6]+a[6]*r,t[7]=n[7]+a[7]*r,t[8]=n[8]+a[8]*r,t
},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4
]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]},equals:function(t,a){var r=t[0],u=t[1],e=t[2]
,o=t[3],i=t[4],h=t[5],c=t[6],s=t[7],M=t[8],f=a[0],l=a[1],v=a[2],b=a[3],m=a[4],d=a[5],p=a[6],x=a[7],
y=a[8];return Math.abs(r-f)<=n*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(u-l)<=n*Math.max(1,
Math.abs(u),Math.abs(l))&&Math.abs(e-v)<=n*Math.max(1,Math.abs(e),Math.abs(v))&&Math.abs(o-b
)<=n*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(i-m)<=n*Math.max(1,Math.abs(i),Math.abs(m)
)&&Math.abs(h-d)<=n*Math.max(1,Math.abs(h),Math.abs(d))&&Math.abs(c-p)<=n*Math.max(1,Math.abs(c),
Math.abs(p))&&Math.abs(s-x)<=n*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(M-y)<=n*Math.max(1,
Math.abs(M),Math.abs(y))},mul:x,sub:y});function g(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5
]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _(t,n,a){
var r=n[0],u=n[1],e=n[2],o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=n[9],l=n[10],v=n[11],b=n[12],
m=n[13],d=n[14],p=n[15],x=a[0],y=a[1],q=a[2],g=a[3];return t[0]=x*r+y*i+q*M+g*b,t[1]=x*u+y*h+q*f+g*m
,t[2]=x*e+y*c+q*l+g*d,t[3]=x*o+y*s+q*v+g*p,x=a[4],y=a[5],q=a[6],g=a[7],t[4]=x*r+y*i+q*M+g*b,t[5
]=x*u+y*h+q*f+g*m,t[6]=x*e+y*c+q*l+g*d,t[7]=x*o+y*s+q*v+g*p,x=a[8],y=a[9],q=a[10],g=a[11],t[8
]=x*r+y*i+q*M+g*b,t[9]=x*u+y*h+q*f+g*m,t[10]=x*e+y*c+q*l+g*d,t[11]=x*o+y*s+q*v+g*p,x=a[12],y=a[13],
q=a[14],g=a[15],t[12]=x*r+y*i+q*M+g*b,t[13]=x*u+y*h+q*f+g*m,t[14]=x*e+y*c+q*l+g*d,t[15
]=x*o+y*s+q*v+g*p,t}function A(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=r+r,h=u+u,c=e+e,s=r*i,M=r*h,
f=r*c,l=u*h,v=u*c,b=e*c,m=o*i,d=o*h,p=o*c;return t[0]=1-(l+b),t[1]=M+p,t[2]=f-d,t[3]=0,t[4]=M-p,t[5
]=1-(s+b),t[6]=v+m,t[7]=0,t[8]=f+d,t[9]=v-m,t[10]=1-(s+l),t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],
t[15]=1,t}function w(t,n){return t[0]=n[12],t[1]=n[13],t[2]=n[14],t}function R(t,n){var a=n[0],r=n[1
],u=n[2],e=n[4],o=n[5],i=n[6],h=n[8],c=n[9],s=n[10];return t[0]=Math.hypot(a,r,u),t[1]=Math.hypot(e,
o,i),t[2]=Math.hypot(h,c,s),t}function z(t,n){var r=new a(3);R(r,n);var u=1/r[0],e=1/r[1],o=1/r[2],
i=n[0]*u,h=n[1]*e,c=n[2]*o,s=n[4]*u,M=n[5]*e,f=n[6]*o,l=n[8]*u,v=n[9]*e,b=n[10]*o,m=i+M+b,d=0;
return m>0?(d=2*Math.sqrt(m+1),t[3]=.25*d,t[0]=(f-v)/d,t[1]=(l-c)/d,t[2]=(h-s)/d):i>M&&i>b?(
d=2*Math.sqrt(1+i-M-b),t[3]=(f-v)/d,t[0]=.25*d,t[1]=(h+s)/d,t[2]=(l+c)/d):M>b?(d=2*Math.sqrt(1+M-i-b
),t[3]=(l-c)/d,t[0]=(h+s)/d,t[1]=.25*d,t[2]=(f+v)/d):(d=2*Math.sqrt(1+b-i-M),t[3]=(h-s)/d,t[0]=(l+c
)/d,t[1]=(f+v)/d,t[2]=.25*d),t}function O(t,n,a,r,u){var e,o=1/Math.tan(n/2);return t[0]=o/a,t[1]=0,
t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,
null!=u&&u!==1/0?(e=1/(r-u),t[10]=(u+r)*e,t[14]=2*u*r*e):(t[10]=-1,t[14]=-2*r),t}var j=O;function P(
t,n,a,r,u,e,o){var i=1/(n-a),h=1/(r-u),c=1/(e-o);return t[0]=-2*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5
]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(n+a)*i,t[13]=(u+r)*h,t[14]=(o+e)*c,t[15
]=1,t}var S=P;function E(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],
t[4]=n[4]-a[4],t[5]=n[5]-a[5],t[6]=n[6]-a[6],t[7]=n[7]-a[7],t[8]=n[8]-a[8],t[9]=n[9]-a[9],t[10]=n[10
]-a[10],t[11]=n[11]-a[11],t[12]=n[12]-a[12],t[13]=n[13]-a[13],t[14]=n[14]-a[14],t[15]=n[15]-a[15],t}
var T=_,D=E,F=Object.freeze({__proto__:null,create:function(){var t=new a(16);
return a!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[
13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},clone:function(t){var n=new a(16);return n[0]=t[0],
n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10
],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},copy:function(t,n){return t[0]=n[0]
,t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[
10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},fromValues:function(t,n,r,u,e,o,i
,h,c,s,M,f,l,v,b,m){var d=new a(16);return d[0]=t,d[1]=n,d[2]=r,d[3]=u,d[4]=e,d[5]=o,d[6]=i,d[7]=h,
d[8]=c,d[9]=s,d[10]=M,d[11]=f,d[12]=l,d[13]=v,d[14]=b,d[15]=m,d},set:function(t,n,a,r,u,e,o,i,h,c,s,
M,f,l,v,b,m){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=h,t[8]=c,t[9]=s,t[10]=M,t[
11]=f,t[12]=l,t[13]=v,t[14]=b,t[15]=m,t},identity:g,transpose:function(t,n){if(t===n){var a=n[1],
r=n[2],u=n[3],e=n[6],o=n[7],i=n[11];t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=a,t[6]=n[9],t[7]=n[13],t[8
]=r,t[9]=e,t[11]=n[14],t[12]=u,t[13]=o,t[14]=i}else t[0]=n[0],t[1]=n[4],t[2]=n[8],t[3]=n[12],t[4]=n[
1],t[5]=n[5],t[6]=n[9],t[7]=n[13],t[8]=n[2],t[9]=n[6],t[10]=n[10],t[11]=n[14],t[12]=n[3],t[13]=n[7],
t[14]=n[11],t[15]=n[15];return t},invert:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5]
,h=n[6],c=n[7],s=n[8],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15],p=a*i-r*o,x=a*h-u*o,
y=a*c-e*o,q=r*h-u*i,g=r*c-e*i,_=u*c-e*h,A=s*b-M*v,w=s*m-f*v,R=s*d-l*v,z=M*m-f*b,O=M*d-l*b,j=f*d-l*m,
P=p*j-x*O+y*z+q*R-g*w+_*A;return P?(P=1/P,t[0]=(i*j-h*O+c*z)*P,t[1]=(u*O-r*j-e*z)*P,t[2]=(
b*_-m*g+d*q)*P,t[3]=(f*g-M*_-l*q)*P,t[4]=(h*R-o*j-c*w)*P,t[5]=(a*j-u*R+e*w)*P,t[6]=(m*y-v*_-d*x)*P,
t[7]=(s*_-f*y+l*x)*P,t[8]=(o*O-i*R+c*A)*P,t[9]=(r*R-a*O-e*A)*P,t[10]=(v*g-b*y+d*p)*P,t[11]=(
M*y-s*g-l*p)*P,t[12]=(i*w-o*z-h*A)*P,t[13]=(a*z-r*w+u*A)*P,t[14]=(b*x-v*q-m*p)*P,t[15]=(s*q-M*x+f*p
)*P,t):null},adjoint:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=n[4],i=n[5],h=n[6],c=n[7],s=n[8
],M=n[9],f=n[10],l=n[11],v=n[12],b=n[13],m=n[14],d=n[15];return t[0]=i*(f*d-l*m)-M*(h*d-c*m)+b*(
h*l-c*f),t[1]=-(r*(f*d-l*m)-M*(u*d-e*m)+b*(u*l-e*f)),t[2]=r*(h*d-c*m)-i*(u*d-e*m)+b*(u*c-e*h),t[3
]=-(r*(h*l-c*f)-i*(u*l-e*f)+M*(u*c-e*h)),t[4]=-(o*(f*d-l*m)-s*(h*d-c*m)+v*(h*l-c*f)),t[5]=a*(f*d-l*m
)-s*(u*d-e*m)+v*(u*l-e*f),t[6]=-(a*(h*d-c*m)-o*(u*d-e*m)+v*(u*c-e*h)),t[7]=a*(h*l-c*f)-o*(u*l-e*f
)+s*(u*c-e*h),t[8]=o*(M*d-l*b)-s*(i*d-c*b)+v*(i*l-c*M),t[9]=-(a*(M*d-l*b)-s*(r*d-e*b)+v*(r*l-e*M)),
t[10]=a*(i*d-c*b)-o*(r*d-e*b)+v*(r*c-e*i),t[11]=-(a*(i*l-c*M)-o*(r*l-e*M)+s*(r*c-e*i)),t[12]=-(o*(
M*m-f*b)-s*(i*m-h*b)+v*(i*f-h*M)),t[13]=a*(M*m-f*b)-s*(r*m-u*b)+v*(r*f-u*M),t[14]=-(a*(i*m-h*b)-o*(
r*m-u*b)+v*(r*h-u*i)),t[15]=a*(i*f-h*M)-o*(r*f-u*M)+s*(r*h-u*i),t},determinant:function(t){var n=t[0
],a=t[1],r=t[2],u=t[3],e=t[4],o=t[5],i=t[6],h=t[7],c=t[8],s=t[9],M=t[10],f=t[11],l=t[12],v=t[13],
b=t[14],m=t[15];return(n*o-a*e)*(M*m-f*b)-(n*i-r*e)*(s*m-f*v)+(n*h-u*e)*(s*b-M*v)+(a*i-r*o)*(c*m-f*l
)-(a*h-u*o)*(c*b-M*l)+(r*h-u*i)*(c*v-s*l)},multiply:_,translate:function(t,n,a){var r,u,e,o,i,h,c,s,
M,f,l,v,b=a[0],m=a[1],d=a[2];return n===t?(t[12]=n[0]*b+n[4]*m+n[8]*d+n[12],t[13]=n[1]*b+n[5]*m+n[9
]*d+n[13],t[14]=n[2]*b+n[6]*m+n[10]*d+n[14],t[15]=n[3]*b+n[7]*m+n[11]*d+n[15]):(r=n[0],u=n[1],e=n[2]
,o=n[3],i=n[4],h=n[5],c=n[6],s=n[7],M=n[8],f=n[9],l=n[10],v=n[11],t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=i
,t[5]=h,t[6]=c,t[7]=s,t[8]=M,t[9]=f,t[10]=l,t[11]=v,t[12]=r*b+i*m+M*d+n[12],t[13]=u*b+h*m+f*d+n[13],
t[14]=e*b+c*m+l*d+n[14],t[15]=o*b+s*m+v*d+n[15]),t},scale:function(t,n,a){var r=a[0],u=a[1],e=a[2];
return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=n[3]*r,t[4]=n[4]*u,t[5]=n[5]*u,t[6]=n[6]*u,t[7]=n[7
]*u,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=n[11]*e,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[
15],t},rotate:function(t,a,r,u){var e,o,i,h,c,s,M,f,l,v,b,m,d,p,x,y,q,g,_,A,w,R,z,O,j=u[0],P=u[1],
S=u[2],E=Math.hypot(j,P,S);return E<n?null:(j*=E=1/E,P*=E,S*=E,e=Math.sin(r),i=1-(o=Math.cos(r)),
h=a[0],c=a[1],s=a[2],M=a[3],f=a[4],l=a[5],v=a[6],b=a[7],m=a[8],d=a[9],p=a[10],x=a[11],y=j*j*i+o,
q=P*j*i+S*e,g=S*j*i-P*e,_=j*P*i-S*e,A=P*P*i+o,w=S*P*i+j*e,R=j*S*i+P*e,z=P*S*i-j*e,O=S*S*i+o,t[0
]=h*y+f*q+m*g,t[1]=c*y+l*q+d*g,t[2]=s*y+v*q+p*g,t[3]=M*y+b*q+x*g,t[4]=h*_+f*A+m*w,t[5]=c*_+l*A+d*w,
t[6]=s*_+v*A+p*w,t[7]=M*_+b*A+x*w,t[8]=h*R+f*z+m*O,t[9]=c*R+l*z+d*O,t[10]=s*R+v*z+p*O,t[11
]=M*R+b*z+x*O,a!==t&&(t[12]=a[12],t[13]=a[13],t[14]=a[14],t[15]=a[15]),t)},rotateX:function(t,n,a){
var r=Math.sin(a),u=Math.cos(a),e=n[4],o=n[5],i=n[6],h=n[7],c=n[8],s=n[9],M=n[10],f=n[11];
return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[
15]),t[4]=e*u+c*r,t[5]=o*u+s*r,t[6]=i*u+M*r,t[7]=h*u+f*r,t[8]=c*u-e*r,t[9]=s*u-o*r,t[10]=M*u-i*r,t[
11]=f*u-h*r,t},rotateY:function(t,n,a){var r=Math.sin(a),u=Math.cos(a),e=n[0],o=n[1],i=n[2],h=n[3],
c=n[8],s=n[9],M=n[10],f=n[11];return n!==t&&(t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[12]=n[12],t[
13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=e*u-c*r,t[1]=o*u-s*r,t[2]=i*u-M*r,t[3]=h*u-f*r,t[8]=e*r+c*u,
t[9]=o*r+s*u,t[10]=i*r+M*u,t[11]=h*r+f*u,t},rotateZ:function(t,n,a){var r=Math.sin(a),u=Math.cos(a),
e=n[0],o=n[1],i=n[2],h=n[3],c=n[4],s=n[5],M=n[6],f=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[
10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=e*u+c*r,t[1]=o*u+s*r,t[2
]=i*u+M*r,t[3]=h*u+f*r,t[4]=c*u-e*r,t[5]=s*u-o*r,t[6]=M*u-i*r,t[7]=f*u-h*r,t},
fromTranslation:function(t,n){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,
t[9]=0,t[10]=1,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromScaling:function(t,n){
return t[0]=n[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=n[2],t[11
]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,a,r){var u,e,o,i=r[0],h=r[1],c=r[2],
s=Math.hypot(i,h,c);return s<n?null:(i*=s=1/s,h*=s,c*=s,u=Math.sin(a),o=1-(e=Math.cos(a)),t[0
]=i*i*o+e,t[1]=h*i*o+c*u,t[2]=c*i*o-h*u,t[3]=0,t[4]=i*h*o-c*u,t[5]=h*h*o+e,t[6]=c*h*o+i*u,t[7]=0,t[8
]=i*c*o+h*u,t[9]=h*c*o-i*u,t[10]=c*c*o+e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},
fromXRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4
]=0,t[5]=r,t[6]=a,t[7]=0,t[8]=0,t[9]=-a,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},
fromYRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4
]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=a,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},
fromZRotation:function(t,n){var a=Math.sin(n),r=Math.cos(n);return t[0]=r,t[1]=a,t[2]=0,t[3]=0,t[4
]=-a,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},
fromRotationTranslation:A,fromQuat2:function(t,n){var r=new a(3),u=-n[0],e=-n[1],o=-n[2],i=n[3],h=n[
4],c=n[5],s=n[6],M=n[7],f=u*u+e*e+o*o+i*i;return f>0?(r[0]=2*(h*i+M*u+c*o-s*e)/f,r[1]=2*(
c*i+M*e+s*u-h*o)/f,r[2]=2*(s*i+M*o+h*e-c*u)/f):(r[0]=2*(h*i+M*u+c*o-s*e),r[1]=2*(c*i+M*e+s*u-h*o),r[
2]=2*(s*i+M*o+h*e-c*u)),A(t,n,r),t},getTranslation:w,getScaling:R,getRotation:z,
fromRotationTranslationScale:function(t,n,a,r){var u=n[0],e=n[1],o=n[2],i=n[3],h=u+u,c=e+e,s=o+o,
M=u*h,f=u*c,l=u*s,v=e*c,b=e*s,m=o*s,d=i*h,p=i*c,x=i*s,y=r[0],q=r[1],g=r[2];return t[0]=(1-(v+m))*y,
t[1]=(f+x)*y,t[2]=(l-p)*y,t[3]=0,t[4]=(f-x)*q,t[5]=(1-(M+m))*q,t[6]=(b+d)*q,t[7]=0,t[8]=(l+p)*g,t[9
]=(b-d)*g,t[10]=(1-(M+v))*g,t[11]=0,t[12]=a[0],t[13]=a[1],t[14]=a[2],t[15]=1,t},
fromRotationTranslationScaleOrigin:function(t,n,a,r,u){var e=n[0],o=n[1],i=n[2],h=n[3],c=e+e,s=o+o,
M=i+i,f=e*c,l=e*s,v=e*M,b=o*s,m=o*M,d=i*M,p=h*c,x=h*s,y=h*M,q=r[0],g=r[1],_=r[2],A=u[0],w=u[1],R=u[2
],z=(1-(b+d))*q,O=(l+y)*q,j=(v-x)*q,P=(l-y)*g,S=(1-(f+d))*g,E=(m+p)*g,T=(v+x)*_,D=(m-p)*_,F=(1-(f+b)
)*_;return t[0]=z,t[1]=O,t[2]=j,t[3]=0,t[4]=P,t[5]=S,t[6]=E,t[7]=0,t[8]=T,t[9]=D,t[10]=F,t[11]=0,t[
12]=a[0]+A-(z*A+P*w+T*R),t[13]=a[1]+w-(O*A+S*w+D*R),t[14]=a[2]+R-(j*A+E*w+F*R),t[15]=1,t},
fromQuat:function(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=a+a,i=r+r,h=u+u,c=a*o,s=r*o,M=r*i,f=u*o,
l=u*i,v=u*h,b=e*o,m=e*i,d=e*h;return t[0]=1-M-v,t[1]=s+d,t[2]=f-m,t[3]=0,t[4]=s-d,t[5]=1-c-v,t[6
]=l+b,t[7]=0,t[8]=f+m,t[9]=l-b,t[10]=1-c-M,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},
frustum:function(t,n,a,r,u,e,o){var i=1/(a-n),h=1/(u-r),c=1/(e-o);return t[0]=2*e*i,t[1]=0,t[2]=0,t[
3]=0,t[4]=0,t[5]=2*e*h,t[6]=0,t[7]=0,t[8]=(a+n)*i,t[9]=(u+r)*h,t[10]=(o+e)*c,t[11]=-1,t[12]=0,t[13
]=0,t[14]=o*e*2*c,t[15]=0,t},perspectiveNO:O,perspective:j,perspectiveZO:function(t,n,a,r,u){var e,
o=1/Math.tan(n/2);return t[0]=o/a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[
11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=u&&u!==1/0?(e=1/(r-u),t[10]=u*e,t[14]=u*r*e):(t[10]=-1,t[14]=-r
),t},perspectiveFromFieldOfView:function(t,n,a,r){var u=Math.tan(n.upDegrees*Math.PI/180),
e=Math.tan(n.downDegrees*Math.PI/180),o=Math.tan(n.leftDegrees*Math.PI/180),i=Math.tan(
n.rightDegrees*Math.PI/180),h=2/(o+i),c=2/(u+e);return t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6
]=0,t[7]=0,t[8]=-(o-i)*h*.5,t[9]=(u-e)*c*.5,t[10]=r/(a-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*a/(a-r),
t[15]=0,t},orthoNO:P,ortho:S,orthoZO:function(t,n,a,r,u,e,o){var i=1/(n-a),h=1/(r-u),c=1/(e-o);
return t[0]=-2*i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,
t[12]=(n+a)*i,t[13]=(u+r)*h,t[14]=e*c,t[15]=1,t},lookAt:function(t,a,r,u){var e,o,i,h,c,s,M,f,l,v,
b=a[0],m=a[1],d=a[2],p=u[0],x=u[1],y=u[2],q=r[0],_=r[1],A=r[2];return Math.abs(b-q)<n&&Math.abs(m-_
)<n&&Math.abs(d-A)<n?g(t):(M=b-q,f=m-_,l=d-A,e=x*(l*=v=1/Math.hypot(M,f,l))-y*(f*=v),o=y*(M*=v)-p*l,
i=p*f-x*M,(v=Math.hypot(e,o,i))?(e*=v=1/v,o*=v,i*=v):(e=0,o=0,i=0),h=f*i-l*o,c=l*e-M*i,s=M*o-f*e,(
v=Math.hypot(h,c,s))?(h*=v=1/v,c*=v,s*=v):(h=0,c=0,s=0),t[0]=e,t[1]=h,t[2]=M,t[3]=0,t[4]=o,t[5]=c,t[
6]=f,t[7]=0,t[8]=i,t[9]=s,t[10]=l,t[11]=0,t[12]=-(e*b+o*m+i*d),t[13]=-(h*b+c*m+s*d),t[14]=-(
M*b+f*m+l*d),t[15]=1,t)},targetTo:function(t,n,a,r){var u=n[0],e=n[1],o=n[2],i=r[0],h=r[1],c=r[2],
s=u-a[0],M=e-a[1],f=o-a[2],l=s*s+M*M+f*f;l>0&&(s*=l=1/Math.sqrt(l),M*=l,f*=l);var v=h*f-c*M,
b=c*s-i*f,m=i*M-h*s;return(l=v*v+b*b+m*m)>0&&(v*=l=1/Math.sqrt(l),b*=l,m*=l),t[0]=v,t[1]=b,t[2]=m,t[
3]=0,t[4]=M*m-f*b,t[5]=f*v-s*m,t[6]=s*b-M*v,t[7]=0,t[8]=s,t[9]=M,t[10]=f,t[11]=0,t[12]=u,t[13]=e,t[
14]=o,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5
]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14
]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[
9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[
2]=n[2]+a[2],t[3]=n[3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t[8]=n[8]+a[
8],t[9]=n[9]+a[9],t[10]=n[10]+a[10],t[11]=n[11]+a[11],t[12]=n[12]+a[12],t[13]=n[13]+a[13],t[14]=n[14
]+a[14],t[15]=n[15]+a[15],t},subtract:E,multiplyScalar:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1
]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=n[7]*a,t[8]=n[8]*a,t[9]=n[9]*a,
t[10]=n[10]*a,t[11]=n[11]*a,t[12]=n[12]*a,t[13]=n[13]*a,t[14]=n[14]*a,t[15]=n[15]*a,t},
multiplyScalarAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t[3
]=n[3]+a[3]*r,t[4]=n[4]+a[4]*r,t[5]=n[5]+a[5]*r,t[6]=n[6]+a[6]*r,t[7]=n[7]+a[7]*r,t[8]=n[8]+a[8]*r,
t[9]=n[9]+a[9]*r,t[10]=n[10]+a[10]*r,t[11]=n[11]+a[11]*r,t[12]=n[12]+a[12]*r,t[13]=n[13]+a[13]*r,t[
14]=n[14]+a[14]*r,t[15]=n[15]+a[15]*r,t},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1
]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]&&t[9
]===n[9]&&t[10]===n[10]&&t[11]===n[11]&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[15]===n[15]},
equals:function(t,a){var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],h=t[5],c=t[6],s=t[7],M=t[8],f=t[9],l=t[
10],v=t[11],b=t[12],m=t[13],d=t[14],p=t[15],x=a[0],y=a[1],q=a[2],g=a[3],_=a[4],A=a[5],w=a[6],R=a[7],
z=a[8],O=a[9],j=a[10],P=a[11],S=a[12],E=a[13],T=a[14],D=a[15];return Math.abs(r-x)<=n*Math.max(1,
Math.abs(r),Math.abs(x))&&Math.abs(u-y)<=n*Math.max(1,Math.abs(u),Math.abs(y))&&Math.abs(e-q
)<=n*Math.max(1,Math.abs(e),Math.abs(q))&&Math.abs(o-g)<=n*Math.max(1,Math.abs(o),Math.abs(g)
)&&Math.abs(i-_)<=n*Math.max(1,Math.abs(i),Math.abs(_))&&Math.abs(h-A)<=n*Math.max(1,Math.abs(h),
Math.abs(A))&&Math.abs(c-w)<=n*Math.max(1,Math.abs(c),Math.abs(w))&&Math.abs(s-R)<=n*Math.max(1,
Math.abs(s),Math.abs(R))&&Math.abs(M-z)<=n*Math.max(1,Math.abs(M),Math.abs(z))&&Math.abs(f-O
)<=n*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(l-j)<=n*Math.max(1,Math.abs(l),Math.abs(j)
)&&Math.abs(v-P)<=n*Math.max(1,Math.abs(v),Math.abs(P))&&Math.abs(b-S)<=n*Math.max(1,Math.abs(b),
Math.abs(S))&&Math.abs(m-E)<=n*Math.max(1,Math.abs(m),Math.abs(E))&&Math.abs(d-T)<=n*Math.max(1,
Math.abs(d),Math.abs(T))&&Math.abs(p-D)<=n*Math.max(1,Math.abs(p),Math.abs(D))},mul:T,sub:D});
function I(){var t=new a(3);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function L(t){var n=t[0
],a=t[1],r=t[2];return Math.hypot(n,a,r)}function V(t,n,r){var u=new a(3);return u[0]=t,u[1]=n,u[2
]=r,u}function Q(t,n,a){return t[0]=n[0]-a[0],t[1]=n[1]-a[1],t[2]=n[2]-a[2],t}function Y(t,n,a){
return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t[2]=n[2]*a[2],t}function Z(t,n,a){return t[0]=n[0]/a[0],t[1
]=n[1]/a[1],t[2]=n[2]/a[2],t}function X(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2];
return Math.hypot(a,r,u)}function N(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2];return a*a+r*r+u*u}
function B(t){var n=t[0],a=t[1],r=t[2];return n*n+a*a+r*r}function k(t,n){var a=n[0],r=n[1],u=n[2],
e=a*a+r*r+u*u;return e>0&&(e=1/Math.sqrt(e)),t[0]=n[0]*e,t[1]=n[1]*e,t[2]=n[2]*e,t}function U(t,n){
return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function W(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[0],i=a[1],h=a[2]
return t[0]=u*h-e*i,t[1]=e*o-r*h,t[2]=r*i-u*o,t}var C,G=Q,H=Y,J=Z,K=X,$=N,tt=L,nt=B,at=(C=I(),
function(t,n,a,r,u,e){var o,i;for(n||(n=3),a||(a=0),i=r?Math.min(r*n+a,t.length):t.length,
o=a;o<i;o+=n)C[0]=t[o],C[1]=t[o+1],C[2]=t[o+2],u(C,C,e),t[o]=C[0],t[o+1]=C[1],t[o+2]=C[2];return t})
,rt=Object.freeze({__proto__:null,create:I,clone:function(t){var n=new a(3);return n[0]=t[0],n[1]=t[
1],n[2]=t[2],n},length:L,fromValues:V,copy:function(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t},
set:function(t,n,a,r){return t[0]=n,t[1]=a,t[2]=r,t},add:function(t,n,a){return t[0]=n[0]+a[0],t[1
]=n[1]+a[1],t[2]=n[2]+a[2],t},subtract:Q,multiply:Y,divide:Z,ceil:function(t,n){return t[0
]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t},floor:function(t,n){return t[0
]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2]=Math.floor(n[2]),t},min:function(t,n,a){return t[0
]=Math.min(n[0],a[0]),t[1]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t},max:function(t,n,a){
return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t},round:function(
t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2]),t},scale:function(t,n,
a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t},scaleAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0
]*r,t[1]=n[1]+a[1]*r,t[2]=n[2]+a[2]*r,t},distance:X,squaredDistance:N,squaredLength:B,
negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t},inverse:function(t,n){return t[0
]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t},normalize:k,dot:U,cross:W,lerp:function(t,n,a,r){var u=n[0],e=n[
1],o=n[2];return t[0]=u+r*(a[0]-u),t[1]=e+r*(a[1]-e),t[2]=o+r*(a[2]-o),t},hermite:function(t,n,a,r,u
,e){var o=e*e,i=o*(2*e-3)+1,h=o*(e-2)+e,c=o*(e-1),s=o*(3-2*e);return t[0]=n[0]*i+a[0]*h+r[0]*c+u[0
]*s,t[1]=n[1]*i+a[1]*h+r[1]*c+u[1]*s,t[2]=n[2]*i+a[2]*h+r[2]*c+u[2]*s,t},bezier:function(t,n,a,r,u,e
){var o=1-e,i=o*o,h=e*e,c=i*o,s=3*e*i,M=3*h*o,f=h*e;return t[0]=n[0]*c+a[0]*s+r[0]*M+u[0]*f,t[1]=n[1
]*c+a[1]*s+r[1]*M+u[1]*f,t[2]=n[2]*c+a[2]*s+r[2]*M+u[2]*f,t},random:function(t,n){n=n||1;var a=2*r(
)*Math.PI,u=2*r()-1,e=Math.sqrt(1-u*u)*n;return t[0]=Math.cos(a)*e,t[1]=Math.sin(a)*e,t[2]=u*n,t},
transformMat4:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[3]*r+a[7]*u+a[11]*e+a[15];return o=o||1,
t[0]=(a[0]*r+a[4]*u+a[8]*e+a[12])/o,t[1]=(a[1]*r+a[5]*u+a[9]*e+a[13])/o,t[2]=(a[2]*r+a[6]*u+a[10
]*e+a[14])/o,t},transformMat3:function(t,n,a){var r=n[0],u=n[1],e=n[2];return t[0]=r*a[0]+u*a[3
]+e*a[6],t[1]=r*a[1]+u*a[4]+e*a[7],t[2]=r*a[2]+u*a[5]+e*a[8],t},transformQuat:function(t,n,a){
var r=a[0],u=a[1],e=a[2],o=a[3],i=n[0],h=n[1],c=n[2],s=u*c-e*h,M=e*i-r*c,f=r*h-u*i,l=u*f-e*M,
v=e*s-r*f,b=r*M-u*s,m=2*o;return s*=m,M*=m,f*=m,l*=2,v*=2,b*=2,t[0]=i+s+l,t[1]=h+M+v,t[2]=c+f+b,t},
rotateX:function(t,n,a,r){var u=[],e=[];return u[0]=n[0]-a[0],u[1]=n[1]-a[1],u[2]=n[2]-a[2],e[0]=u[0
],e[1]=u[1]*Math.cos(r)-u[2]*Math.sin(r),e[2]=u[1]*Math.sin(r)+u[2]*Math.cos(r),t[0]=e[0]+a[0],t[1
]=e[1]+a[1],t[2]=e[2]+a[2],t},rotateY:function(t,n,a,r){var u=[],e=[];return u[0]=n[0]-a[0],u[1]=n[1
]-a[1],u[2]=n[2]-a[2],e[0]=u[2]*Math.sin(r)+u[0]*Math.cos(r),e[1]=u[1],e[2]=u[2]*Math.cos(r)-u[0
]*Math.sin(r),t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t},rotateZ:function(t,n,a,r){var u=[],e=[
];return u[0]=n[0]-a[0],u[1]=n[1]-a[1],u[2]=n[2]-a[2],e[0]=u[0]*Math.cos(r)-u[1]*Math.sin(r),e[1]=u[
0]*Math.sin(r)+u[1]*Math.cos(r),e[2]=u[2],t[0]=e[0]+a[0],t[1]=e[1]+a[1],t[2]=e[2]+a[2],t},
angle:function(t,n){var a=t[0],r=t[1],u=t[2],e=n[0],o=n[1],i=n[2],h=Math.sqrt(a*a+r*r+u*u
)*Math.sqrt(e*e+o*o+i*i),c=h&&U(t,n)/h;return Math.acos(Math.min(Math.max(c,-1),1))},zero:function(t
){return t[0]=0,t[1]=0,t[2]=0,t},str:function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},
exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]},equals:function(t,a){
var r=t[0],u=t[1],e=t[2],o=a[0],i=a[1],h=a[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),
Math.abs(o))&&Math.abs(u-i)<=n*Math.max(1,Math.abs(u),Math.abs(i))&&Math.abs(e-h)<=n*Math.max(1,
Math.abs(e),Math.abs(h))},sub:G,mul:H,div:J,dist:K,sqrDist:$,len:tt,sqrLen:nt,forEach:at});
function ut(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function et(t){
var n=new a(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function ot(t,n,r,u){var e=new a(4);
return e[0]=t,e[1]=n,e[2]=r,e[3]=u,e}function it(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3]
,t}function ht(t,n,a,r,u){return t[0]=n,t[1]=a,t[2]=r,t[3]=u,t}function ct(t,n,a){return t[0]=n[0
]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[3]+a[3],t}function st(t,n,a){return t[0]=n[0]-a[0],t[1
]=n[1]-a[1],t[2]=n[2]-a[2],t[3]=n[3]-a[3],t}function Mt(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],
t[2]=n[2]*a[2],t[3]=n[3]*a[3],t}function ft(t,n,a){return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t[2]=n[2]/a[
2],t[3]=n[3]/a[3],t}function lt(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t}
function vt(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2],e=n[3]-t[3];return Math.hypot(a,r,u,e)}
function bt(t,n){var a=n[0]-t[0],r=n[1]-t[1],u=n[2]-t[2],e=n[3]-t[3];return a*a+r*r+u*u+e*e}
function mt(t){var n=t[0],a=t[1],r=t[2],u=t[3];return Math.hypot(n,a,r,u)}function dt(t){var n=t[0],
a=t[1],r=t[2],u=t[3];return n*n+a*a+r*r+u*u}function pt(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],
o=a*a+r*r+u*u+e*e;return o>0&&(o=1/Math.sqrt(o)),t[0]=a*o,t[1]=r*o,t[2]=u*o,t[3]=e*o,t}function xt(t
,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]}function yt(t,n,a,r){var u=n[0],e=n[1],o=n[2],
i=n[3];return t[0]=u+r*(a[0]-u),t[1]=e+r*(a[1]-e),t[2]=o+r*(a[2]-o),t[3]=i+r*(a[3]-i),t}function qt(
t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}function gt(t,a){var r=t[0],u=t[1],
e=t[2],o=t[3],i=a[0],h=a[1],c=a[2],s=a[3];return Math.abs(r-i)<=n*Math.max(1,Math.abs(r),Math.abs(i)
)&&Math.abs(u-h)<=n*Math.max(1,Math.abs(u),Math.abs(h))&&Math.abs(e-c)<=n*Math.max(1,Math.abs(e),
Math.abs(c))&&Math.abs(o-s)<=n*Math.max(1,Math.abs(o),Math.abs(s))}var _t=st,At=Mt,wt=ft,Rt=vt,zt=bt
,Ot=mt,jt=dt,Pt=function(){var t=ut();return function(n,a,r,u,e,o){var i,h;for(a||(a=4),r||(r=0),
h=u?Math.min(u*a+r,n.length):n.length,i=r;i<h;i+=a)t[0]=n[i],t[1]=n[i+1],t[2]=n[i+2],t[3]=n[i+3],e(t
,t,o),n[i]=t[0],n[i+1]=t[1],n[i+2]=t[2],n[i+3]=t[3];return n}}(),St=Object.freeze({__proto__:null,
create:ut,clone:et,fromValues:ot,copy:it,set:ht,add:ct,subtract:st,multiply:Mt,divide:ft,
ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t[2]=Math.ceil(n[2]),t[3
]=Math.ceil(n[3]),t},floor:function(t,n){return t[0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t[2
]=Math.floor(n[2]),t[3]=Math.floor(n[3]),t},min:function(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1
]=Math.min(n[1],a[1]),t[2]=Math.min(n[2],a[2]),t[3]=Math.min(n[3],a[3]),t},max:function(t,n,a){
return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]),t[2]=Math.max(n[2],a[2]),t[3]=Math.max(n[3]
,a[3]),t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t[2]=Math.round(n[2
]),t[3]=Math.round(n[3]),t},scale:lt,scaleAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1
]+a[1]*r,t[2]=n[2]+a[2]*r,t[3]=n[3]+a[3]*r,t},distance:vt,squaredDistance:bt,length:mt,
squaredLength:dt,negate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=-n[3],t},
inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t[2]=1/n[2],t[3]=1/n[3],t},normalize:pt,dot:xt,
cross:function(t,n,a,r){var u=a[0]*r[1]-a[1]*r[0],e=a[0]*r[2]-a[2]*r[0],o=a[0]*r[3]-a[3]*r[0],i=a[1
]*r[2]-a[2]*r[1],h=a[1]*r[3]-a[3]*r[1],c=a[2]*r[3]-a[3]*r[2],s=n[0],M=n[1],f=n[2],l=n[3];return t[0
]=M*c-f*h+l*i,t[1]=-s*c+f*o-l*e,t[2]=s*h-M*o+l*u,t[3]=-s*i+M*e-f*u,t},lerp:yt,random:function(t,n){
var a,u,e,o,i,h;n=n||1;do{i=(a=2*r()-1)*a+(u=2*r()-1)*u}while(i>=1);do{h=(e=2*r()-1)*e+(o=2*r()-1)*o
}while(h>=1);var c=Math.sqrt((1-i)/h);return t[0]=n*a,t[1]=n*u,t[2]=n*e*c,t[3]=n*o*c,t},
transformMat4:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3];return t[0]=a[0]*r+a[4]*u+a[8]*e+a[12
]*o,t[1]=a[1]*r+a[5]*u+a[9]*e+a[13]*o,t[2]=a[2]*r+a[6]*u+a[10]*e+a[14]*o,t[3]=a[3]*r+a[7]*u+a[11
]*e+a[15]*o,t},transformQuat:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=a[0],i=a[1],h=a[2],c=a[3],
s=c*r+i*e-h*u,M=c*u+h*r-o*e,f=c*e+o*u-i*r,l=-o*r-i*u-h*e;return t[0]=s*c+l*-o+M*-h-f*-i,t[1
]=M*c+l*-i+f*-o-s*-h,t[2]=f*c+l*-h+s*-i-M*-o,t[3]=n[3],t},zero:function(t){return t[0]=0,t[1]=0,t[2
]=0,t[3]=0,t},str:function(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},exactEquals:qt,
equals:gt,sub:_t,mul:At,div:wt,dist:Rt,sqrDist:zt,len:Ot,sqrLen:jt,forEach:Pt});function Et(){
var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Tt(t,n,a){a*=.5;
var r=Math.sin(a);return t[0]=r*n[0],t[1]=r*n[1],t[2]=r*n[2],t[3]=Math.cos(a),t}function Dt(t,n,a){
var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1],c=a[2],s=a[3];return t[0]=r*s+o*i+u*c-e*h,t[1
]=u*s+o*h+e*i-r*c,t[2]=e*s+o*c+r*h-u*i,t[3]=o*s-r*i-u*h-e*c,t}function Ft(t,n,a){a*=.5;var r=n[0],
u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);return t[0]=r*h+o*i,t[1]=u*h+e*i,t[2]=e*h-u*i,t[3
]=o*h-r*i,t}function It(t,n,a){a*=.5;var r=n[0],u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);
return t[0]=r*h-e*i,t[1]=u*h+o*i,t[2]=e*h+r*i,t[3]=o*h-u*i,t}function Lt(t,n,a){a*=.5;var r=n[0],
u=n[1],e=n[2],o=n[3],i=Math.sin(a),h=Math.cos(a);return t[0]=r*h+u*i,t[1]=u*h-r*i,t[2]=e*h+o*i,t[3
]=o*h-e*i,t}function Vt(t,n){var a=n[0],r=n[1],u=n[2],e=n[3],o=Math.sqrt(a*a+r*r+u*u),i=Math.exp(e),
h=o>0?i*Math.sin(o)/o:0;return t[0]=a*h,t[1]=r*h,t[2]=u*h,t[3]=i*Math.cos(o),t}function Qt(t,n){
var a=n[0],r=n[1],u=n[2],e=n[3],o=Math.sqrt(a*a+r*r+u*u),i=o>0?Math.atan2(o,e)/o:0;return t[0]=a*i,
t[1]=r*i,t[2]=u*i,t[3]=.5*Math.log(a*a+r*r+u*u+e*e),t}function Yt(t,a,r,u){var e,o,i,h,c,s=a[0],M=a[
1],f=a[2],l=a[3],v=r[0],b=r[1],m=r[2],d=r[3];return(o=s*v+M*b+f*m+l*d)<0&&(o=-o,v=-v,b=-b,m=-m,d=-d)
,1-o>n?(e=Math.acos(o),i=Math.sin(e),h=Math.sin((1-u)*e)/i,c=Math.sin(u*e)/i):(h=1-u,c=u),t[0
]=h*s+c*v,t[1]=h*M+c*b,t[2]=h*f+c*m,t[3]=h*l+c*d,t}function Zt(t,n){var a,r=n[0]+n[4]+n[8];if(r>0
)a=Math.sqrt(r+1),t[3]=.5*a,a=.5/a,t[0]=(n[5]-n[7])*a,t[1]=(n[6]-n[2])*a,t[2]=(n[1]-n[3])*a;else{
var u=0;n[4]>n[0]&&(u=1),n[8]>n[3*u+u]&&(u=2);var e=(u+1)%3,o=(u+2)%3;a=Math.sqrt(n[3*u+u]-n[3*e+e
]-n[3*o+o]+1),t[u]=.5*a,a=.5/a,t[3]=(n[3*e+o]-n[3*o+e])*a,t[e]=(n[3*e+u]+n[3*u+e])*a,t[o]=(n[3*o+u
]+n[3*u+o])*a}return t}var Xt,Nt,Bt,kt,Ut,Wt,Ct=et,Gt=ot,Ht=it,Jt=ht,Kt=ct,$t=Dt,tn=lt,nn=xt,an=yt,
rn=mt,un=rn,en=dt,on=en,hn=pt,cn=qt,sn=gt,Mn=(Xt=I(),Nt=V(1,0,0),Bt=V(0,1,0),function(t,n,a){
var r=U(n,a);return r<-.999999?(W(Xt,Nt,n),tt(Xt)<1e-6&&W(Xt,Bt,n),k(Xt,Xt),Tt(t,Xt,Math.PI),t
):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(W(Xt,n,a),t[0]=Xt[0],t[1]=Xt[1],t[2]=Xt[2],t[3]=1+r,hn(
t,t))}),fn=(kt=Et(),Ut=Et(),function(t,n,a,r,u,e){return Yt(kt,n,u,e),Yt(Ut,a,r,e),Yt(t,kt,Ut,2*e*(
1-e)),t}),ln=(Wt=m(),function(t,n,a,r){return Wt[0]=a[0],Wt[3]=a[1],Wt[6]=a[2],Wt[1]=r[0],Wt[4]=r[1]
,Wt[7]=r[2],Wt[2]=-n[0],Wt[5]=-n[1],Wt[8]=-n[2],hn(t,Zt(t,Wt))}),vn=Object.freeze({__proto__:null,
create:Et,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},setAxisAngle:Tt,
getAxisAngle:function(t,a){var r=2*Math.acos(a[3]),u=Math.sin(r/2);return u>n?(t[0]=a[0]/u,t[1]=a[1
]/u,t[2]=a[2]/u):(t[0]=1,t[1]=0,t[2]=0),r},getAngle:function(t,n){var a=nn(t,n);return Math.acos(
2*a*a-1)},multiply:Dt,rotateX:Ft,rotateY:It,rotateZ:Lt,calculateW:function(t,n){var a=n[0],r=n[1],
u=n[2];return t[0]=a,t[1]=r,t[2]=u,t[3]=Math.sqrt(Math.abs(1-a*a-r*r-u*u)),t},exp:Vt,ln:Qt,
pow:function(t,n,a){return Qt(t,n),tn(t,t,a),Vt(t,t),t},slerp:Yt,random:function(t){var n=r(),a=r(),
u=r(),e=Math.sqrt(1-n),o=Math.sqrt(n);return t[0]=e*Math.sin(2*Math.PI*a),t[1]=e*Math.cos(
2*Math.PI*a),t[2]=o*Math.sin(2*Math.PI*u),t[3]=o*Math.cos(2*Math.PI*u),t},invert:function(t,n){
var a=n[0],r=n[1],u=n[2],e=n[3],o=a*a+r*r+u*u+e*e,i=o?1/o:0;return t[0]=-a*i,t[1]=-r*i,t[2]=-u*i,t[3
]=e*i,t},conjugate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t},fromMat3:Zt,
fromEuler:function(t,n,a,r){var u=.5*Math.PI/180;n*=u,a*=u,r*=u;var e=Math.sin(n),o=Math.cos(n),
i=Math.sin(a),h=Math.cos(a),c=Math.sin(r),s=Math.cos(r);return t[0]=e*h*s-o*i*c,t[1]=o*i*s+e*h*c,t[2
]=o*h*c-e*i*s,t[3]=o*h*s+e*i*c,t},str:function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3
]+")"},clone:Ct,fromValues:Gt,copy:Ht,set:Jt,add:Kt,mul:$t,scale:tn,dot:nn,lerp:an,length:rn,len:un,
squaredLength:en,sqrLen:on,normalize:hn,exactEquals:cn,equals:sn,rotationTo:Mn,sqlerp:fn,setAxes:ln}
);function bn(t,n,a){var r=.5*a[0],u=.5*a[1],e=.5*a[2],o=n[0],i=n[1],h=n[2],c=n[3];return t[0]=o,t[1
]=i,t[2]=h,t[3]=c,t[4]=r*c+u*h-e*i,t[5]=u*c+e*o-r*h,t[6]=e*c+r*i-u*o,t[7]=-r*o-u*i-e*h,t}
function mn(t,n){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7
]=n[7],t}var dn=Ht;var pn=Ht;function xn(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=a[4],h=a[5],c=a[6]
,s=a[7],M=n[4],f=n[5],l=n[6],v=n[7],b=a[0],m=a[1],d=a[2],p=a[3];return t[0]=r*p+o*b+u*d-e*m,t[1
]=u*p+o*m+e*b-r*d,t[2]=e*p+o*d+r*m-u*b,t[3]=o*p-r*b-u*m-e*d,t[4]=r*s+o*i+u*c-e*h+M*p+v*b+f*d-l*m,t[5
]=u*s+o*h+e*i-r*c+f*p+v*m+l*b-M*d,t[6]=e*s+o*c+r*h-u*i+l*p+v*d+M*m-f*b,t[7
]=o*s-r*i-u*h-e*c+v*p-M*b-f*m-l*d,t}var yn=xn;var qn=nn;var gn=rn,_n=gn,An=en,wn=An;
var Rn=Object.freeze({__proto__:null,create:function(){var t=new a(8);return a!=Float32Array&&(t[0
]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t},clone:function(t){var n=new a(8);return n[0
]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n},fromValues:function(
t,n,r,u,e,o,i,h){var c=new a(8);return c[0]=t,c[1]=n,c[2]=r,c[3]=u,c[4]=e,c[5]=o,c[6]=i,c[7]=h,c},
fromRotationTranslationValues:function(t,n,r,u,e,o,i){var h=new a(8);h[0]=t,h[1]=n,h[2]=r,h[3]=u;
var c=.5*e,s=.5*o,M=.5*i;return h[4]=c*u+s*r-M*n,h[5]=s*u+M*t-c*r,h[6]=M*u+c*n-s*t,h[7]=-c*t-s*n-M*r
,h},fromRotationTranslation:bn,fromTranslation:function(t,n){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4
]=.5*n[0],t[5]=.5*n[1],t[6]=.5*n[2],t[7]=0,t},fromRotation:function(t,n){return t[0]=n[0],t[1]=n[1],
t[2]=n[2],t[3]=n[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},fromMat4:function(t,n){var r=Et();z(r,n);
var u=new a(3);return w(u,n),bn(t,r,u),t},copy:mn,identity:function(t){return t[0]=0,t[1]=0,t[2]=0,
t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t},set:function(t,n,a,r,u,e,o,i,h){return t[0]=n,t[1]=a,t[2]=r,t[
3]=u,t[4]=e,t[5]=o,t[6]=i,t[7]=h,t},getReal:dn,getDual:function(t,n){return t[0]=n[4],t[1]=n[5],t[2
]=n[6],t[3]=n[7],t},setReal:pn,setDual:function(t,n){return t[4]=n[0],t[5]=n[1],t[6]=n[2],t[7]=n[3],
t},getTranslation:function(t,n){var a=n[4],r=n[5],u=n[6],e=n[7],o=-n[0],i=-n[1],h=-n[2],c=n[3];
return t[0]=2*(a*c+e*o+r*h-u*i),t[1]=2*(r*c+e*i+u*o-a*h),t[2]=2*(u*c+e*h+a*i-r*o),t},
translate:function(t,n,a){var r=n[0],u=n[1],e=n[2],o=n[3],i=.5*a[0],h=.5*a[1],c=.5*a[2],s=n[4],M=n[5
],f=n[6],l=n[7];return t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=o*i+u*c-e*h+s,t[5]=o*h+e*i-r*c+M,t[6
]=o*c+r*h-u*i+f,t[7]=-r*i-u*h-e*c+l,t},rotateX:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3],
i=n[4],h=n[5],c=n[6],s=n[7],M=i*o+s*r+h*e-c*u,f=h*o+s*u+c*r-i*e,l=c*o+s*e+i*u-h*r,v=s*o-i*r-h*u-c*e;
return Ft(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6
]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateY:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3]
,i=n[4],h=n[5],c=n[6],s=n[7],M=i*o+s*r+h*e-c*u,f=h*o+s*u+c*r-i*e,l=c*o+s*e+i*u-h*r,v=s*o-i*r-h*u-c*e
return It(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6
]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateZ:function(t,n,a){var r=-n[0],u=-n[1],e=-n[2],o=n[3]
,i=n[4],h=n[5],c=n[6],s=n[7],M=i*o+s*r+h*e-c*u,f=h*o+s*u+c*r-i*e,l=c*o+s*e+i*u-h*r,v=s*o-i*r-h*u-c*e
return Lt(t,n,a),r=t[0],u=t[1],e=t[2],o=t[3],t[4]=M*o+v*r+f*e-l*u,t[5]=f*o+v*u+l*r-M*e,t[6
]=l*o+v*e+M*u-f*r,t[7]=v*o-M*r-f*u-l*e,t},rotateByQuatAppend:function(t,n,a){var r=a[0],u=a[1],e=a[2
],o=a[3],i=n[0],h=n[1],c=n[2],s=n[3];return t[0]=i*o+s*r+h*e-c*u,t[1]=h*o+s*u+c*r-i*e,t[2
]=c*o+s*e+i*u-h*r,t[3]=s*o-i*r-h*u-c*e,i=n[4],h=n[5],c=n[6],s=n[7],t[4]=i*o+s*r+h*e-c*u,t[5
]=h*o+s*u+c*r-i*e,t[6]=c*o+s*e+i*u-h*r,t[7]=s*o-i*r-h*u-c*e,t},rotateByQuatPrepend:function(t,n,a){
var r=n[0],u=n[1],e=n[2],o=n[3],i=a[0],h=a[1],c=a[2],s=a[3];return t[0]=r*s+o*i+u*c-e*h,t[1
]=u*s+o*h+e*i-r*c,t[2]=e*s+o*c+r*h-u*i,t[3]=o*s-r*i-u*h-e*c,i=a[4],h=a[5],c=a[6],s=a[7],t[4
]=r*s+o*i+u*c-e*h,t[5]=u*s+o*h+e*i-r*c,t[6]=e*s+o*c+r*h-u*i,t[7]=o*s-r*i-u*h-e*c,t},
rotateAroundAxis:function(t,a,r,u){if(Math.abs(u)<n)return mn(t,a);var e=Math.hypot(r[0],r[1],r[2]);
u*=.5;var o=Math.sin(u),i=o*r[0]/e,h=o*r[1]/e,c=o*r[2]/e,s=Math.cos(u),M=a[0],f=a[1],l=a[2],v=a[3];
t[0]=M*s+v*i+f*c-l*h,t[1]=f*s+v*h+l*i-M*c,t[2]=l*s+v*c+M*h-f*i,t[3]=v*s-M*i-f*h-l*c;var b=a[4],m=a[5
],d=a[6],p=a[7];return t[4]=b*s+p*i+m*c-d*h,t[5]=m*s+p*h+d*i-b*c,t[6]=d*s+p*c+b*h-m*i,t[7
]=p*s-b*i-m*h-d*c,t},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t[2]=n[2]+a[2],t[3]=n[
3]+a[3],t[4]=n[4]+a[4],t[5]=n[5]+a[5],t[6]=n[6]+a[6],t[7]=n[7]+a[7],t},multiply:xn,mul:yn,
scale:function(t,n,a){return t[0]=n[0]*a,t[1]=n[1]*a,t[2]=n[2]*a,t[3]=n[3]*a,t[4]=n[4]*a,t[5]=n[5]*a
,t[6]=n[6]*a,t[7]=n[7]*a,t},dot:qn,lerp:function(t,n,a,r){var u=1-r;return qn(n,a)<0&&(r=-r),t[0]=n[
0]*u+a[0]*r,t[1]=n[1]*u+a[1]*r,t[2]=n[2]*u+a[2]*r,t[3]=n[3]*u+a[3]*r,t[4]=n[4]*u+a[4]*r,t[5]=n[5
]*u+a[5]*r,t[6]=n[6]*u+a[6]*r,t[7]=n[7]*u+a[7]*r,t},invert:function(t,n){var a=An(n);return t[0]=-n[
0]/a,t[1]=-n[1]/a,t[2]=-n[2]/a,t[3]=n[3]/a,t[4]=-n[4]/a,t[5]=-n[5]/a,t[6]=-n[6]/a,t[7]=n[7]/a,t},
conjugate:function(t,n){return t[0]=-n[0],t[1]=-n[1],t[2]=-n[2],t[3]=n[3],t[4]=-n[4],t[5]=-n[5],t[6
]=-n[6],t[7]=n[7],t},length:gn,len:_n,squaredLength:An,sqrLen:wn,normalize:function(t,n){var a=An(n)
if(a>0){a=Math.sqrt(a);var r=n[0]/a,u=n[1]/a,e=n[2]/a,o=n[3]/a,i=n[4],h=n[5],c=n[6],s=n[7],
M=r*i+u*h+e*c+o*s;t[0]=r,t[1]=u,t[2]=e,t[3]=o,t[4]=(i-r*M)/a,t[5]=(h-u*M)/a,t[6]=(c-e*M)/a,t[7]=(
s-o*M)/a}return t},str:function(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4
]+", "+t[5]+", "+t[6]+", "+t[7]+")"},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]&&t[2
]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]},equals:function(t,a){
var r=t[0],u=t[1],e=t[2],o=t[3],i=t[4],h=t[5],c=t[6],s=t[7],M=a[0],f=a[1],l=a[2],v=a[3],b=a[4],m=a[5
],d=a[6],p=a[7];return Math.abs(r-M)<=n*Math.max(1,Math.abs(r),Math.abs(M))&&Math.abs(u-f
)<=n*Math.max(1,Math.abs(u),Math.abs(f))&&Math.abs(e-l)<=n*Math.max(1,Math.abs(e),Math.abs(l)
)&&Math.abs(o-v)<=n*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(i-b)<=n*Math.max(1,Math.abs(i),
Math.abs(b))&&Math.abs(h-m)<=n*Math.max(1,Math.abs(h),Math.abs(m))&&Math.abs(c-d)<=n*Math.max(1,
Math.abs(c),Math.abs(d))&&Math.abs(s-p)<=n*Math.max(1,Math.abs(s),Math.abs(p))}});function zn(){
var t=new a(2);return a!=Float32Array&&(t[0]=0,t[1]=0),t}function On(t,n,a){return t[0]=n[0]-a[0],t[
1]=n[1]-a[1],t}function jn(t,n,a){return t[0]=n[0]*a[0],t[1]=n[1]*a[1],t}function Pn(t,n,a){
return t[0]=n[0]/a[0],t[1]=n[1]/a[1],t}function Sn(t,n){var a=n[0]-t[0],r=n[1]-t[1];
return Math.hypot(a,r)}function En(t,n){var a=n[0]-t[0],r=n[1]-t[1];return a*a+r*r}function Tn(t){
var n=t[0],a=t[1];return Math.hypot(n,a)}function Dn(t){var n=t[0],a=t[1];return n*n+a*a}var Fn=Tn,
In=On,Ln=jn,Vn=Pn,Qn=Sn,Yn=En,Zn=Dn,Xn=function(){var t=zn();return function(n,a,r,u,e,o){var i,h;
for(a||(a=2),r||(r=0),h=u?Math.min(u*a+r,n.length):n.length,i=r;i<h;i+=a)t[0]=n[i],t[1]=n[i+1],e(t,t
,o),n[i]=t[0],n[i+1]=t[1];return n}}(),Nn=Object.freeze({__proto__:null,create:zn,clone:function(t){
var n=new a(2);return n[0]=t[0],n[1]=t[1],n},fromValues:function(t,n){var r=new a(2);return r[0]=t,
r[1]=n,r},copy:function(t,n){return t[0]=n[0],t[1]=n[1],t},set:function(t,n,a){return t[0]=n,t[1]=a,
t},add:function(t,n,a){return t[0]=n[0]+a[0],t[1]=n[1]+a[1],t},subtract:On,multiply:jn,divide:Pn,
ceil:function(t,n){return t[0]=Math.ceil(n[0]),t[1]=Math.ceil(n[1]),t},floor:function(t,n){return t[
0]=Math.floor(n[0]),t[1]=Math.floor(n[1]),t},min:function(t,n,a){return t[0]=Math.min(n[0],a[0]),t[1
]=Math.min(n[1],a[1]),t},max:function(t,n,a){return t[0]=Math.max(n[0],a[0]),t[1]=Math.max(n[1],a[1]
),t},round:function(t,n){return t[0]=Math.round(n[0]),t[1]=Math.round(n[1]),t},scale:function(t,n,a
){return t[0]=n[0]*a,t[1]=n[1]*a,t},scaleAndAdd:function(t,n,a,r){return t[0]=n[0]+a[0]*r,t[1]=n[1
]+a[1]*r,t},distance:Sn,squaredDistance:En,length:Tn,squaredLength:Dn,negate:function(t,n){return t[
0]=-n[0],t[1]=-n[1],t},inverse:function(t,n){return t[0]=1/n[0],t[1]=1/n[1],t},normalize:function(t,
n){var a=n[0],r=n[1],u=a*a+r*r;return u>0&&(u=1/Math.sqrt(u)),t[0]=n[0]*u,t[1]=n[1]*u,t},
dot:function(t,n){return t[0]*n[0]+t[1]*n[1]},cross:function(t,n,a){var r=n[0]*a[1]-n[1]*a[0];
return t[0]=t[1]=0,t[2]=r,t},lerp:function(t,n,a,r){var u=n[0],e=n[1];return t[0]=u+r*(a[0]-u),t[1
]=e+r*(a[1]-e),t},random:function(t,n){n=n||1;var a=2*r()*Math.PI;return t[0]=Math.cos(a)*n,t[1
]=Math.sin(a)*n,t},transformMat2:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[2]*u,t[1]=a[
1]*r+a[3]*u,t},transformMat2d:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[2]*u+a[4],t[1
]=a[1]*r+a[3]*u+a[5],t},transformMat3:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[3]*u+a[
6],t[1]=a[1]*r+a[4]*u+a[7],t},transformMat4:function(t,n,a){var r=n[0],u=n[1];return t[0]=a[0]*r+a[4
]*u+a[12],t[1]=a[1]*r+a[5]*u+a[13],t},rotate:function(t,n,a,r){var u=n[0]-a[0],e=n[1]-a[1],
o=Math.sin(r),i=Math.cos(r);return t[0]=u*i-e*o+a[0],t[1]=u*o+e*i+a[1],t},angle:function(t,n){
var a=t[0],r=t[1],u=n[0],e=n[1],o=Math.sqrt(a*a+r*r)*Math.sqrt(u*u+e*e),i=o&&(a*u+r*e)/o;
return Math.acos(Math.min(Math.max(i,-1),1))},zero:function(t){return t[0]=0,t[1]=0,t},str:function(
t){return"vec2("+t[0]+", "+t[1]+")"},exactEquals:function(t,n){return t[0]===n[0]&&t[1]===n[1]},
equals:function(t,a){var r=t[0],u=t[1],e=a[0],o=a[1];return Math.abs(r-e)<=n*Math.max(1,Math.abs(r),
Math.abs(e))&&Math.abs(u-o)<=n*Math.max(1,Math.abs(u),Math.abs(o))},len:Fn,sub:In,mul:Ln,div:Vn,
dist:Qn,sqrDist:Yn,sqrLen:Zn,forEach:Xn});t.glMatrix=e,t.mat2=s,t.mat2d=b,t.mat3=q,t.mat4=F,
t.quat=vn,t.quat2=Rn,t.vec2=Nn,t.vec3=rt,t.vec4=St,Object.defineProperty(t,"__esModule",{value:!0})}
);if(typeof ResizeObserver==="undefined"){(function(global,factory){
typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory(
):typeof define==="function"&&define.amd?define(factory):global.ResizeObserver=factory()})(this,
function(){"use strict";var MapShim=function(){if(typeof Map!=="undefined"){return Map}
function getIndex(arr,key){var result=-1;arr.some(function(entry,index){if(entry[0]===key){
result=index;return true}return false});return result}return function(){function class_1(){
this.__entries__=[]}Object.defineProperty(class_1.prototype,"size",{get:function(){
return this.__entries__.length},enumerable:true,configurable:true});class_1.prototype.get=function(
key){var index=getIndex(this.__entries__,key);var entry=this.__entries__[index];return entry&&entry[
1]};class_1.prototype.set=function(key,value){var index=getIndex(this.__entries__,key);if(~index){
this.__entries__[index][1]=value}else{this.__entries__.push([key,value])}};
class_1.prototype.delete=function(key){var entries=this.__entries__;var index=getIndex(entries,key);
if(~index){entries.splice(index,1)}};class_1.prototype.has=function(key){return!!~getIndex(
this.__entries__,key)};class_1.prototype.clear=function(){this.__entries__.splice(0)};
class_1.prototype.forEach=function(callback,ctx){if(ctx===void 0){ctx=null}for(var _i=0,
_a=this.__entries__;_i<_a.length;_i++){var entry=_a[_i];callback.call(ctx,entry[1],entry[0])}};
return class_1}()}();
var isBrowser=typeof window!=="undefined"&&typeof document!=="undefined"&&window.document===document
var global$1=function(){if(typeof global!=="undefined"&&global.Math===Math){return global}if(
typeof self!=="undefined"&&self.Math===Math){return self}if(
typeof window!=="undefined"&&window.Math===Math){return window}return Function("return this")()}();
var requestAnimationFrame$1=function(){if(typeof requestAnimationFrame==="function"){
return requestAnimationFrame.bind(global$1)}return function(callback){return setTimeout(function(){
return callback(Date.now())},1e3/60)}}();var trailingTimeout=2;function throttle(callback,delay){
var leadingCall=false,trailingCall=false,lastCallTime=0;function resolvePending(){if(leadingCall){
leadingCall=false;callback()}if(trailingCall){proxy()}}function timeoutCallback(){
requestAnimationFrame$1(resolvePending)}function proxy(){var timeStamp=Date.now();if(leadingCall){
if(timeStamp-lastCallTime<trailingTimeout){return}trailingCall=true}else{leadingCall=true;
trailingCall=false;setTimeout(timeoutCallback,delay)}lastCallTime=timeStamp}return proxy}
var REFRESH_DELAY=20;var transitionKeys=["top","right","bottom","left","width","height","size",
"weight"];var mutationObserverSupported=typeof MutationObserver!=="undefined";
var ResizeObserverController=function(){function ResizeObserverController(){this.connected_=false;
this.mutationEventsAdded_=false;this.mutationsObserver_=null;this.observers_=[];
this.onTransitionEnd_=this.onTransitionEnd_.bind(this);this.refresh=throttle(this.refresh.bind(this)
,REFRESH_DELAY)}ResizeObserverController.prototype.addObserver=function(observer){if(
!~this.observers_.indexOf(observer)){this.observers_.push(observer)}if(!this.connected_){
this.connect_()}};ResizeObserverController.prototype.removeObserver=function(observer){
var observers=this.observers_;var index=observers.indexOf(observer);if(~index){observers.splice(
index,1)}if(!observers.length&&this.connected_){this.disconnect_()}};
ResizeObserverController.prototype.refresh=function(){var changesDetected=this.updateObservers_();
if(changesDetected){this.refresh()}};ResizeObserverController.prototype.updateObservers_=function(){
var activeObservers=this.observers_.filter(function(observer){return observer.gatherActive(),
observer.hasActive()});activeObservers.forEach(function(observer){return observer.broadcastActive()}
);return activeObservers.length>0};ResizeObserverController.prototype.connect_=function(){if(
!isBrowser||this.connected_){return}document.addEventListener("transitionend",this.onTransitionEnd_)
window.addEventListener("resize",this.refresh);if(mutationObserverSupported){
this.mutationsObserver_=new MutationObserver(this.refresh);this.mutationsObserver_.observe(document,
{attributes:true,childList:true,characterData:true,subtree:true})}else{document.addEventListener(
"DOMSubtreeModified",this.refresh);this.mutationEventsAdded_=true}this.connected_=true};
ResizeObserverController.prototype.disconnect_=function(){if(!isBrowser||!this.connected_){return}
document.removeEventListener("transitionend",this.onTransitionEnd_);window.removeEventListener(
"resize",this.refresh);if(this.mutationsObserver_){this.mutationsObserver_.disconnect()}if(
this.mutationEventsAdded_){document.removeEventListener("DOMSubtreeModified",this.refresh)}
this.mutationsObserver_=null;this.mutationEventsAdded_=false;this.connected_=false};
ResizeObserverController.prototype.onTransitionEnd_=function(_a){var _b=_a.propertyName,
propertyName=_b===void 0?"":_b;var isReflowProperty=transitionKeys.some(function(key){
return!!~propertyName.indexOf(key)});if(isReflowProperty){this.refresh()}};
ResizeObserverController.getInstance=function(){if(!this.instance_){
this.instance_=new ResizeObserverController}return this.instance_};
ResizeObserverController.instance_=null;return ResizeObserverController}();
var defineConfigurable=function(target,props){for(var _i=0,_a=Object.keys(props);_i<_a.length;_i++){
var key=_a[_i];Object.defineProperty(target,key,{value:props[key],enumerable:false,writable:false,
configurable:true})}return target};var getWindowOf=function(target){
var ownerGlobal=target&&target.ownerDocument&&target.ownerDocument.defaultView;
return ownerGlobal||global$1};var emptyRect=createRectInit(0,0,0,0);function toFloat(value){
return parseFloat(value)||0}function getBordersSize(styles){var positions=[];for(
var _i=1;_i<arguments.length;_i++){positions[_i-1]=arguments[_i]}return positions.reduce(function(
size,position){var value=styles["border-"+position+"-width"];return size+toFloat(value)},0)}
function getPaddings(styles){var positions=["top","right","bottom","left"];var paddings={};for(
var _i=0,positions_1=positions;_i<positions_1.length;_i++){var position=positions_1[_i];
var value=styles["padding-"+position];paddings[position]=toFloat(value)}return paddings}
function getSVGContentRect(target){var bbox=target.getBBox();return createRectInit(0,0,bbox.width,
bbox.height)}function getHTMLElementContentRect(target){var clientWidth=target.clientWidth,
clientHeight=target.clientHeight;if(!clientWidth&&!clientHeight){return emptyRect}
var styles=getWindowOf(target).getComputedStyle(target);var paddings=getPaddings(styles);
var horizPad=paddings.left+paddings.right;var vertPad=paddings.top+paddings.bottom;
var width=toFloat(styles.width),height=toFloat(styles.height);if(styles.boxSizing==="border-box"){
if(Math.round(width+horizPad)!==clientWidth){width-=getBordersSize(styles,"left","right")+horizPad}
if(Math.round(height+vertPad)!==clientHeight){height-=getBordersSize(styles,"top","bottom")+vertPad}
}if(!isDocumentElement(target)){var vertScrollbar=Math.round(width+horizPad)-clientWidth;
var horizScrollbar=Math.round(height+vertPad)-clientHeight;if(Math.abs(vertScrollbar)!==1){
width-=vertScrollbar}if(Math.abs(horizScrollbar)!==1){height-=horizScrollbar}}return createRectInit(
paddings.left,paddings.top,width,height)}var isSVGGraphicsElement=function(){if(
typeof SVGGraphicsElement!=="undefined"){return function(target){
return target instanceof getWindowOf(target).SVGGraphicsElement}}return function(target){
return target instanceof getWindowOf(target).SVGElement&&typeof target.getBBox==="function"}}();
function isDocumentElement(target){return target===getWindowOf(target).document.documentElement}
function getContentRect(target){if(!isBrowser){return emptyRect}if(isSVGGraphicsElement(target)){
return getSVGContentRect(target)}return getHTMLElementContentRect(target)}
function createReadOnlyRect(_a){var x=_a.x,y=_a.y,width=_a.width,height=_a.height;
var Constr=typeof DOMRectReadOnly!=="undefined"?DOMRectReadOnly:Object;var rect=Object.create(
Constr.prototype);defineConfigurable(rect,{x:x,y:y,width:width,height:height,top:y,right:x+width,
bottom:height+y,left:x});return rect}function createRectInit(x,y,width,height){return{x:x,y:y,
width:width,height:height}}var ResizeObservation=function(){function ResizeObservation(target){
this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=createRectInit(0,0,0,0);
this.target=target}ResizeObservation.prototype.isActive=function(){var rect=getContentRect(
this.target);this.contentRect_=rect;
return rect.width!==this.broadcastWidth||rect.height!==this.broadcastHeight};
ResizeObservation.prototype.broadcastRect=function(){var rect=this.contentRect_;
this.broadcastWidth=rect.width;this.broadcastHeight=rect.height;return rect};
return ResizeObservation}();var ResizeObserverEntry=function(){function ResizeObserverEntry(target,
rectInit){var contentRect=createReadOnlyRect(rectInit);defineConfigurable(this,{target:target,
contentRect:contentRect})}return ResizeObserverEntry}();var ResizeObserverSPI=function(){
function ResizeObserverSPI(callback,controller,callbackCtx){this.activeObservations_=[];
this.observations_=new MapShim;if(typeof callback!=="function"){throw new TypeError(
"The callback provided as parameter 1 is not a function.")}this.callback_=callback;
this.controller_=controller;this.callbackCtx_=callbackCtx}
ResizeObserverSPI.prototype.observe=function(target){if(!arguments.length){throw new TypeError(
"1 argument required, but only 0 present.")}if(typeof Element==="undefined"||!(
Element instanceof Object)){return}if(!(target instanceof getWindowOf(target).Element)){
throw new TypeError('parameter 1 is not of type "Element".')}var observations=this.observations_;if(
observations.has(target)){return}observations.set(target,new ResizeObservation(target));
this.controller_.addObserver(this);this.controller_.refresh()};
ResizeObserverSPI.prototype.unobserve=function(target){if(!arguments.length){throw new TypeError(
"1 argument required, but only 0 present.")}if(typeof Element==="undefined"||!(
Element instanceof Object)){return}if(!(target instanceof getWindowOf(target).Element)){
throw new TypeError('parameter 1 is not of type "Element".')}var observations=this.observations_;if(
!observations.has(target)){return}observations.delete(target);if(!observations.size){
this.controller_.removeObserver(this)}};ResizeObserverSPI.prototype.disconnect=function(){
this.clearActive();this.observations_.clear();this.controller_.removeObserver(this)};
ResizeObserverSPI.prototype.gatherActive=function(){var _this=this;this.clearActive();
this.observations_.forEach(function(observation){if(observation.isActive()){
_this.activeObservations_.push(observation)}})};
ResizeObserverSPI.prototype.broadcastActive=function(){if(!this.hasActive()){return}
var ctx=this.callbackCtx_;var entries=this.activeObservations_.map(function(observation){
return new ResizeObserverEntry(observation.target,observation.broadcastRect())});
this.callback_.call(ctx,entries,ctx);this.clearActive()};
ResizeObserverSPI.prototype.clearActive=function(){this.activeObservations_.splice(0)};
ResizeObserverSPI.prototype.hasActive=function(){return this.activeObservations_.length>0};
return ResizeObserverSPI}();var observers=typeof WeakMap!=="undefined"?new WeakMap:new MapShim;
var ResizeObserver=function(){function ResizeObserver(callback){if(!(this instanceof ResizeObserver)
){throw new TypeError("Cannot call a class as a function.")}if(!arguments.length){
throw new TypeError("1 argument required, but only 0 present.")}
var controller=ResizeObserverController.getInstance();var observer=new ResizeObserverSPI(callback,
controller,this);observers.set(this,observer)}return ResizeObserver}();["observe","unobserve",
"disconnect"].forEach(function(method){ResizeObserver.prototype[method]=function(){var _a;return(
_a=observers.get(this))[method].apply(_a,arguments)}});var index=function(){if(
typeof global$1.ResizeObserver!=="undefined"){return global$1.ResizeObserver}return ResizeObserver}(
);return index})}(function(global,factory){
typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory(
):typeof define==="function"&&define.amd?define(factory):(global=global||self,
global.Autolinker=factory())})(this,function(){"use strict";function defaults(dest,src){for(
var prop in src){if(src.hasOwnProperty(prop)&&dest[prop]===undefined){dest[prop]=src[prop]}}
return dest}function ellipsis(str,truncateLen,ellipsisChars){var ellipsisLength;if(
str.length>truncateLen){if(ellipsisChars==null){ellipsisChars="&hellip;";ellipsisLength=3}else{
ellipsisLength=ellipsisChars.length}str=str.substring(0,truncateLen-ellipsisLength)+ellipsisChars}
return str}function indexOf(arr,element){if(Array.prototype.indexOf){return arr.indexOf(element)
}else{for(var i=0,len=arr.length;i<len;i++){if(arr[i]===element)return i}return-1}}function remove(
arr,fn){for(var i=arr.length-1;i>=0;i--){if(fn(arr[i])===true){arr.splice(i,1)}}}
function splitAndCapture(str,splitRegex){if(!splitRegex.global)throw new Error(
"`splitRegex` must have the 'g' flag set");var result=[],lastIdx=0,match;while(
match=splitRegex.exec(str)){result.push(str.substring(lastIdx,match.index));result.push(match[0]);
lastIdx=match.index+match[0].length}result.push(str.substring(lastIdx));return result}
function throwUnhandledCaseError(theValue){throw new Error(
"Unhandled case for value: '"+theValue+"'")}var HtmlTag=function(){function HtmlTag(cfg){if(
cfg===void 0){cfg={}}this.tagName="";this.attrs={};this.innerHTML="";this.whitespaceRegex=/\s+/;
this.tagName=cfg.tagName||"";this.attrs=cfg.attrs||{};
this.innerHTML=cfg.innerHtml||cfg.innerHTML||""}HtmlTag.prototype.setTagName=function(tagName){
this.tagName=tagName;return this};HtmlTag.prototype.getTagName=function(){return this.tagName||""};
HtmlTag.prototype.setAttr=function(attrName,attrValue){var tagAttrs=this.getAttrs();tagAttrs[
attrName]=attrValue;return this};HtmlTag.prototype.getAttr=function(attrName){return this.getAttrs(
)[attrName]};HtmlTag.prototype.setAttrs=function(attrs){Object.assign(this.getAttrs(),attrs);
return this};HtmlTag.prototype.getAttrs=function(){return this.attrs||(this.attrs={})};
HtmlTag.prototype.setClass=function(cssClass){return this.setAttr("class",cssClass)};
HtmlTag.prototype.addClass=function(cssClass){var classAttr=this.getClass(),
whitespaceRegex=this.whitespaceRegex,classes=!classAttr?[]:classAttr.split(whitespaceRegex),
newClasses=cssClass.split(whitespaceRegex),newClass;while(newClass=newClasses.shift()){if(indexOf(
classes,newClass)===-1){classes.push(newClass)}}this.getAttrs()["class"]=classes.join(" ");
return this};HtmlTag.prototype.removeClass=function(cssClass){var classAttr=this.getClass(),
whitespaceRegex=this.whitespaceRegex,classes=!classAttr?[]:classAttr.split(whitespaceRegex),
removeClasses=cssClass.split(whitespaceRegex),removeClass;while(classes.length&&(
removeClass=removeClasses.shift())){var idx=indexOf(classes,removeClass);if(idx!==-1){
classes.splice(idx,1)}}this.getAttrs()["class"]=classes.join(" ");return this};
HtmlTag.prototype.getClass=function(){return this.getAttrs()["class"]||""};
HtmlTag.prototype.hasClass=function(cssClass){return(" "+this.getClass()+" ").indexOf(
" "+cssClass+" ")!==-1};HtmlTag.prototype.setInnerHTML=function(html){this.innerHTML=html;
return this};HtmlTag.prototype.setInnerHtml=function(html){return this.setInnerHTML(html)};
HtmlTag.prototype.getInnerHTML=function(){return this.innerHTML||""};
HtmlTag.prototype.getInnerHtml=function(){return this.getInnerHTML()};
HtmlTag.prototype.toAnchorString=function(){var tagName=this.getTagName(),
attrsStr=this.buildAttrsStr();attrsStr=attrsStr?" "+attrsStr:"";return["<",tagName,attrsStr,">",
this.getInnerHtml(),"</",tagName,">"].join("")};HtmlTag.prototype.buildAttrsStr=function(){if(
!this.attrs)return"";var attrs=this.getAttrs(),attrsArr=[];for(var prop in attrs){if(
attrs.hasOwnProperty(prop)){attrsArr.push(prop+'="'+attrs[prop]+'"')}}return attrsArr.join(" ")};
return HtmlTag}();function truncateSmart(url,truncateLen,ellipsisChars){
var ellipsisLengthBeforeParsing;var ellipsisLength;if(ellipsisChars==null){ellipsisChars="&hellip;";
ellipsisLength=3;ellipsisLengthBeforeParsing=8}else{ellipsisLength=ellipsisChars.length;
ellipsisLengthBeforeParsing=ellipsisChars.length}var parse_url=function(url){var urlObj={};
var urlSub=url;var match=urlSub.match(/^([a-z]+):\/\//i);if(match){urlObj.scheme=match[1];
urlSub=urlSub.substr(match[0].length)}match=urlSub.match(/^(.*?)(?=(\?|#|\/|$))/i);if(match){
urlObj.host=match[1];urlSub=urlSub.substr(match[0].length)}match=urlSub.match(
/^\/(.*?)(?=(\?|#|$))/i);if(match){urlObj.path=match[1];urlSub=urlSub.substr(match[0].length)}
match=urlSub.match(/^\?(.*?)(?=(#|$))/i);if(match){urlObj.query=match[1];urlSub=urlSub.substr(match[
0].length)}match=urlSub.match(/^#(.*?)$/i);if(match){urlObj.fragment=match[1]}return urlObj};
var buildUrl=function(urlObj){var url="";if(urlObj.scheme&&urlObj.host){url+=urlObj.scheme+"://"}if(
urlObj.host){url+=urlObj.host}if(urlObj.path){url+="/"+urlObj.path}if(urlObj.query){
url+="?"+urlObj.query}if(urlObj.fragment){url+="#"+urlObj.fragment}return url};
var buildSegment=function(segment,remainingAvailableLength){
var remainingAvailableLengthHalf=remainingAvailableLength/2,startOffset=Math.ceil(
remainingAvailableLengthHalf),endOffset=-1*Math.floor(remainingAvailableLengthHalf),end="";if(
endOffset<0){end=segment.substr(endOffset)}return segment.substr(0,startOffset)+ellipsisChars+end};
if(url.length<=truncateLen){return url}var availableLength=truncateLen-ellipsisLength;
var urlObj=parse_url(url);if(urlObj.query){var matchQuery=urlObj.query.match(
/^(.*?)(?=(\?|\#))(.*?)$/i);if(matchQuery){urlObj.query=urlObj.query.substr(0,matchQuery[1].length);
url=buildUrl(urlObj)}}if(url.length<=truncateLen){return url}if(urlObj.host){
urlObj.host=urlObj.host.replace(/^www\./,"");url=buildUrl(urlObj)}if(url.length<=truncateLen){
return url}var str="";if(urlObj.host){str+=urlObj.host}if(str.length>=availableLength){if(
urlObj.host.length==truncateLen){return(urlObj.host.substr(0,truncateLen-ellipsisLength
)+ellipsisChars).substr(0,availableLength+ellipsisLengthBeforeParsing)}return buildSegment(str,
availableLength).substr(0,availableLength+ellipsisLengthBeforeParsing)}var pathAndQuery="";if(
urlObj.path){pathAndQuery+="/"+urlObj.path}if(urlObj.query){pathAndQuery+="?"+urlObj.query}if(
pathAndQuery){if((str+pathAndQuery).length>=availableLength){if((str+pathAndQuery
).length==truncateLen){return(str+pathAndQuery).substr(0,truncateLen)}
var remainingAvailableLength=availableLength-str.length;return(str+buildSegment(pathAndQuery,
remainingAvailableLength)).substr(0,availableLength+ellipsisLengthBeforeParsing)}else{
str+=pathAndQuery}}if(urlObj.fragment){var fragment="#"+urlObj.fragment;if((str+fragment
).length>=availableLength){if((str+fragment).length==truncateLen){return(str+fragment).substr(0,
truncateLen)}var remainingAvailableLength2=availableLength-str.length;return(str+buildSegment(
fragment,remainingAvailableLength2)).substr(0,availableLength+ellipsisLengthBeforeParsing)}else{
str+=fragment}}if(urlObj.scheme&&urlObj.host){var scheme=urlObj.scheme+"://";if((str+scheme
).length<availableLength){return(scheme+str).substr(0,truncateLen)}}if(str.length<=truncateLen){
return str}var end="";if(availableLength>0){end=str.substr(-1*Math.floor(availableLength/2))}return(
str.substr(0,Math.ceil(availableLength/2))+ellipsisChars+end).substr(0,
availableLength+ellipsisLengthBeforeParsing)}function truncateMiddle(url,truncateLen,ellipsisChars){
if(url.length<=truncateLen){return url}var ellipsisLengthBeforeParsing;var ellipsisLength;if(
ellipsisChars==null){ellipsisChars="&hellip;";ellipsisLengthBeforeParsing=8;ellipsisLength=3}else{
ellipsisLengthBeforeParsing=ellipsisChars.length;ellipsisLength=ellipsisChars.length}
var availableLength=truncateLen-ellipsisLength;var end="";if(availableLength>0){end=url.substr(
-1*Math.floor(availableLength/2))}return(url.substr(0,Math.ceil(availableLength/2)
)+ellipsisChars+end).substr(0,availableLength+ellipsisLengthBeforeParsing)}function truncateEnd(
anchorText,truncateLen,ellipsisChars){return ellipsis(anchorText,truncateLen,ellipsisChars)}
var AnchorTagBuilder=function(){function AnchorTagBuilder(cfg){if(cfg===void 0){cfg={}}
this.newWindow=false;this.truncate={};this.className="";this.newWindow=cfg.newWindow||false;
this.truncate=cfg.truncate||{};this.className=cfg.className||""}
AnchorTagBuilder.prototype.build=function(match){return new HtmlTag({tagName:"a",
attrs:this.createAttrs(match),innerHtml:this.processAnchorText(match.getAnchorText())})};
AnchorTagBuilder.prototype.createAttrs=function(match){var attrs={href:match.getAnchorHref()};
var cssClass=this.createCssClass(match);if(cssClass){attrs["class"]=cssClass}if(this.newWindow){
attrs["target"]="_blank";attrs["rel"]="noopener noreferrer"}if(this.truncate){if(
this.truncate.length&&this.truncate.length<match.getAnchorText().length){attrs["title"
]=match.getAnchorHref()}}return attrs};AnchorTagBuilder.prototype.createCssClass=function(match){
var className=this.className;if(!className){return""}else{var returnClasses=[className],
cssClassSuffixes=match.getCssClassSuffixes();for(var i=0,len=cssClassSuffixes.length;i<len;i++){
returnClasses.push(className+"-"+cssClassSuffixes[i])}return returnClasses.join(" ")}};
AnchorTagBuilder.prototype.processAnchorText=function(anchorText){anchorText=this.doTruncate(
anchorText);return anchorText};AnchorTagBuilder.prototype.doTruncate=function(anchorText){
var truncate=this.truncate;if(!truncate||!truncate.length)return anchorText;
var truncateLength=truncate.length,truncateLocation=truncate.location;if(truncateLocation==="smart"
){return truncateSmart(anchorText,truncateLength)}else if(truncateLocation==="middle"){
return truncateMiddle(anchorText,truncateLength)}else{return truncateEnd(anchorText,truncateLength)}
};return AnchorTagBuilder}();var Match=function(){function Match(cfg){this.__jsduckDummyDocProp=null
this.matchedText="";this.offset=0;this.tagBuilder=cfg.tagBuilder;this.matchedText=cfg.matchedText;
this.offset=cfg.offset}Match.prototype.getMatchedText=function(){return this.matchedText};
Match.prototype.setOffset=function(offset){this.offset=offset};Match.prototype.getOffset=function(){
return this.offset};Match.prototype.getCssClassSuffixes=function(){return[this.getType()]};
Match.prototype.buildTag=function(){return this.tagBuilder.build(this)};return Match}();
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(b.hasOwnProperty(p)
)d[p]=b[p]};return extendStatics(d,b)};function __extends(d,b){extendStatics(d,b);function __(){
this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}
var __assign=function(){__assign=Object.assign||function __assign(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};var EmailMatch=function(_super){
__extends(EmailMatch,_super);function EmailMatch(cfg){var _this=_super.call(this,cfg)||this;
_this.email="";_this.email=cfg.email;return _this}EmailMatch.prototype.getType=function(){
return"email"};EmailMatch.prototype.getEmail=function(){return this.email};
EmailMatch.prototype.getAnchorHref=function(){return"mailto:"+this.email};
EmailMatch.prototype.getAnchorText=function(){return this.email};return EmailMatch}(Match);
var HashtagMatch=function(_super){__extends(HashtagMatch,_super);function HashtagMatch(cfg){
var _this=_super.call(this,cfg)||this;_this.serviceName="";_this.hashtag="";
_this.serviceName=cfg.serviceName;_this.hashtag=cfg.hashtag;return _this}
HashtagMatch.prototype.getType=function(){return"hashtag"};
HashtagMatch.prototype.getServiceName=function(){return this.serviceName};
HashtagMatch.prototype.getHashtag=function(){return this.hashtag};
HashtagMatch.prototype.getAnchorHref=function(){var serviceName=this.serviceName,
hashtag=this.hashtag;switch(serviceName){case"twitter":return"https://twitter.com/hashtag/"+hashtag;
case"facebook":return"https://www.facebook.com/hashtag/"+hashtag;case"instagram":
return"https://instagram.com/explore/tags/"+hashtag;default:throw new Error(
"Unknown service name to point hashtag to: "+serviceName)}};
HashtagMatch.prototype.getAnchorText=function(){return"#"+this.hashtag};return HashtagMatch}(Match);
var MentionMatch=function(_super){__extends(MentionMatch,_super);function MentionMatch(cfg){
var _this=_super.call(this,cfg)||this;_this.serviceName="twitter";_this.mention="";
_this.mention=cfg.mention;_this.serviceName=cfg.serviceName;return _this}
MentionMatch.prototype.getType=function(){return"mention"};
MentionMatch.prototype.getMention=function(){return this.mention};
MentionMatch.prototype.getServiceName=function(){return this.serviceName};
MentionMatch.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":
return"https://twitter.com/"+this.mention;case"instagram":
return"https://instagram.com/"+this.mention;case"soundcloud":
return"https://soundcloud.com/"+this.mention;default:throw new Error(
"Unknown service name to point mention to: "+this.serviceName)}};
MentionMatch.prototype.getAnchorText=function(){return"@"+this.mention};
MentionMatch.prototype.getCssClassSuffixes=function(){
var cssClassSuffixes=_super.prototype.getCssClassSuffixes.call(this),
serviceName=this.getServiceName();if(serviceName){cssClassSuffixes.push(serviceName)}
return cssClassSuffixes};return MentionMatch}(Match);var PhoneMatch=function(_super){__extends(
PhoneMatch,_super);function PhoneMatch(cfg){var _this=_super.call(this,cfg)||this;_this.number="";
_this.plusSign=false;_this.number=cfg.number;_this.plusSign=cfg.plusSign;return _this}
PhoneMatch.prototype.getType=function(){return"phone"};PhoneMatch.prototype.getPhoneNumber=function(
){return this.number};PhoneMatch.prototype.getNumber=function(){return this.getPhoneNumber()};
PhoneMatch.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number};
PhoneMatch.prototype.getAnchorText=function(){return this.matchedText};return PhoneMatch}(Match);
var UrlMatch=function(_super){__extends(UrlMatch,_super);function UrlMatch(cfg){
var _this=_super.call(this,cfg)||this;_this.url="";_this.urlMatchType="scheme";
_this.protocolUrlMatch=false;_this.protocolRelativeMatch=false;_this.stripPrefix={scheme:true,
www:true};_this.stripTrailingSlash=true;_this.decodePercentEncoding=true;
_this.schemePrefixRegex=/^(https?:\/\/)?/i;_this.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i;
_this.protocolRelativeRegex=/^\/\//;_this.protocolPrepended=false;
_this.urlMatchType=cfg.urlMatchType;_this.url=cfg.url;_this.protocolUrlMatch=cfg.protocolUrlMatch;
_this.protocolRelativeMatch=cfg.protocolRelativeMatch;_this.stripPrefix=cfg.stripPrefix;
_this.stripTrailingSlash=cfg.stripTrailingSlash;
_this.decodePercentEncoding=cfg.decodePercentEncoding;return _this}
UrlMatch.prototype.getType=function(){return"url"};UrlMatch.prototype.getUrlMatchType=function(){
return this.urlMatchType};UrlMatch.prototype.getUrl=function(){var url=this.url;if(
!this.protocolRelativeMatch&&!this.protocolUrlMatch&&!this.protocolPrepended){
url=this.url="http://"+url;this.protocolPrepended=true}return url};
UrlMatch.prototype.getAnchorHref=function(){var url=this.getUrl();return url.replace(/&amp;/g,"&")};
UrlMatch.prototype.getAnchorText=function(){var anchorText=this.getMatchedText();if(
this.protocolRelativeMatch){anchorText=this.stripProtocolRelativePrefix(anchorText)}if(
this.stripPrefix.scheme){anchorText=this.stripSchemePrefix(anchorText)}if(this.stripPrefix.www){
anchorText=this.stripWwwPrefix(anchorText)}if(this.stripTrailingSlash){
anchorText=this.removeTrailingSlash(anchorText)}if(this.decodePercentEncoding){
anchorText=this.removePercentEncoding(anchorText)}return anchorText};
UrlMatch.prototype.stripSchemePrefix=function(url){return url.replace(this.schemePrefixRegex,"")};
UrlMatch.prototype.stripWwwPrefix=function(url){return url.replace(this.wwwPrefixRegex,"$1")};
UrlMatch.prototype.stripProtocolRelativePrefix=function(text){return text.replace(
this.protocolRelativeRegex,"")};UrlMatch.prototype.removeTrailingSlash=function(anchorText){if(
anchorText.charAt(anchorText.length-1)==="/"){anchorText=anchorText.slice(0,-1)}return anchorText};
UrlMatch.prototype.removePercentEncoding=function(anchorText){
var preProcessedEntityAnchorText=anchorText.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;"
).replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{
return decodeURIComponent(preProcessedEntityAnchorText)}catch(e){return preProcessedEntityAnchorText
}};return UrlMatch}(Match);var Matcher=function(){function Matcher(cfg){
this.__jsduckDummyDocProp=null;this.tagBuilder=cfg.tagBuilder}return Matcher}();
var letterRe=/[A-Za-z]/;var digitRe=/[\d]/;var nonDigitRe=/[\D]/;var whitespaceRe=/\s/;
var quoteRe=/['"]/;var controlCharsRe=/[\x00-\x1F\x7F]/;
var alphaCharsStr=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source
var emojiStr=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source
var marksStr=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source
var alphaCharsAndMarksStr=alphaCharsStr+emojiStr+marksStr;
var decimalNumbersStr=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source
var alphaNumericCharsStr=alphaCharsAndMarksStr+decimalNumbersStr;
var alphaNumericAndMarksCharsStr=alphaCharsAndMarksStr+decimalNumbersStr;
var ipStr="(?:["+decimalNumbersStr+"]{1,3}\\.){3}["+decimalNumbersStr+"]{1,3}";
var domainLabelStr="["+alphaNumericAndMarksCharsStr+"](?:["+alphaNumericAndMarksCharsStr+"\\-]{0,61}["+alphaNumericAndMarksCharsStr+"])?"
var getDomainLabelStr=function(group){return"(?=("+domainLabelStr+"))\\"+group};
var getDomainNameStr=function(group){return"(?:"+getDomainLabelStr(group
)+"(?:\\."+getDomainLabelStr(group+1)+"){0,126}|"+ipStr+")"};var domainNameCharRegex=new RegExp(
"["+alphaNumericAndMarksCharsStr+"]");
var tldRegex=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/
var localPartCharRegex=new RegExp("["+alphaNumericAndMarksCharsStr+"!#$%&'*+/=?^_`{|}~-]");
var strictTldRegex=new RegExp("^"+tldRegex.source+"$");var EmailMatcher=function(_super){__extends(
EmailMatcher,_super);function EmailMatcher(){var _this=_super!==null&&_super.apply(this,arguments
)||this;_this.localPartCharRegex=localPartCharRegex;_this.strictTldRegex=strictTldRegex;return _this
}EmailMatcher.prototype.parseMatches=function(text){var tagBuilder=this.tagBuilder,
localPartCharRegex=this.localPartCharRegex,strictTldRegex=this.strictTldRegex,matches=[],
len=text.length,noCurrentEmailMatch=new CurrentEmailMatch;var mailtoTransitions={m:"a",a:"i",i:"l",
l:"t",t:"o",o:":"};var charIdx=0,state=0,currentEmailMatch=noCurrentEmailMatch;while(charIdx<len){
var char=text.charAt(charIdx);switch(state){case 0:stateNonEmailAddress(char);break;case 1:
stateMailTo(text.charAt(charIdx-1),char);break;case 2:stateLocalPart(char);break;case 3:
stateLocalPartDot(char);break;case 4:stateAtSign(char);break;case 5:stateDomainChar(char);break;
case 6:stateDomainHyphen(char);break;case 7:stateDomainDot(char);break;default:
throwUnhandledCaseError(state)}charIdx++}captureMatchIfValidAndReset();return matches;
function stateNonEmailAddress(char){if(char==="m"){beginEmailMatch(1)}else if(
localPartCharRegex.test(char)){beginEmailMatch()}}function stateMailTo(prevChar,char){if(
prevChar===":"){if(localPartCharRegex.test(char)){state=2;currentEmailMatch=new CurrentEmailMatch(
__assign({},currentEmailMatch,{hasMailtoPrefix:true}))}else{resetToNonEmailMatchState()}}else if(
mailtoTransitions[prevChar]===char);else if(localPartCharRegex.test(char)){state=2}else if(
char==="."){state=3}else if(char==="@"){state=4}else{resetToNonEmailMatchState()}}
function stateLocalPart(char){if(char==="."){state=3}else if(char==="@"){state=4}else if(
localPartCharRegex.test(char));else{resetToNonEmailMatchState()}}function stateLocalPartDot(char){
if(char==="."){resetToNonEmailMatchState()}else if(char==="@"){resetToNonEmailMatchState()}else if(
localPartCharRegex.test(char)){state=2}else{resetToNonEmailMatchState()}}function stateAtSign(char){
if(domainNameCharRegex.test(char)){state=5}else{resetToNonEmailMatchState()}}
function stateDomainChar(char){if(char==="."){state=7}else if(char==="-"){state=6}else if(
domainNameCharRegex.test(char));else{captureMatchIfValidAndReset()}}function stateDomainHyphen(char
){if(char==="-"||char==="."){captureMatchIfValidAndReset()}else if(domainNameCharRegex.test(char)){
state=5}else{captureMatchIfValidAndReset()}}function stateDomainDot(char){if(char==="."||char==="-"
){captureMatchIfValidAndReset()}else if(domainNameCharRegex.test(char)){state=5;
currentEmailMatch=new CurrentEmailMatch(__assign({},currentEmailMatch,{hasDomainDot:true}))}else{
captureMatchIfValidAndReset()}}function beginEmailMatch(newState){if(newState===void 0){newState=2}
state=newState;currentEmailMatch=new CurrentEmailMatch({idx:charIdx})}
function resetToNonEmailMatchState(){state=0;currentEmailMatch=noCurrentEmailMatch}
function captureMatchIfValidAndReset(){if(currentEmailMatch.hasDomainDot){
var matchedText=text.slice(currentEmailMatch.idx,charIdx);if(/[-.]$/.test(matchedText)){
matchedText=matchedText.slice(0,-1)}
var emailAddress=currentEmailMatch.hasMailtoPrefix?matchedText.slice("mailto:".length):matchedText;
if(doesEmailHaveValidTld(emailAddress)){matches.push(new EmailMatch({tagBuilder:tagBuilder,
matchedText:matchedText,offset:currentEmailMatch.idx,email:emailAddress}))}}
resetToNonEmailMatchState();function doesEmailHaveValidTld(emailAddress){
var emailAddressTld=emailAddress.split(".").pop()||"";
var emailAddressNormalized=emailAddressTld.toLowerCase();var isValidTld=strictTldRegex.test(
emailAddressNormalized);return isValidTld}}};return EmailMatcher}(Matcher);
var CurrentEmailMatch=function(){function CurrentEmailMatch(cfg){if(cfg===void 0){cfg={}}
this.idx=cfg.idx!==undefined?cfg.idx:-1;this.hasMailtoPrefix=!!cfg.hasMailtoPrefix;
this.hasDomainDot=!!cfg.hasDomainDot}return CurrentEmailMatch}();var UrlMatchValidator=function(){
function UrlMatchValidator(){}UrlMatchValidator.isValid=function(urlMatch,protocolUrlMatch){if(
protocolUrlMatch&&!this.isValidUriScheme(protocolUrlMatch)||this.urlMatchDoesNotHaveProtocolOrDot(
urlMatch,protocolUrlMatch)||this.urlMatchDoesNotHaveAtLeastOneWordChar(urlMatch,protocolUrlMatch
)&&!this.isValidIpAddress(urlMatch)||this.containsMultipleDots(urlMatch)){return false}return true};
UrlMatchValidator.isValidIpAddress=function(uriSchemeMatch){var newRegex=new RegExp(
this.hasFullProtocolRegex.source+this.ipRegex.source);var uriScheme=uriSchemeMatch.match(newRegex);
return uriScheme!==null};UrlMatchValidator.containsMultipleDots=function(urlMatch){
var stringBeforeSlash=urlMatch;if(this.hasFullProtocolRegex.test(urlMatch)){
stringBeforeSlash=urlMatch.split("://")[1]}return stringBeforeSlash.split("/")[0].indexOf("..")>-1};
UrlMatchValidator.isValidUriScheme=function(uriSchemeMatch){
var uriSchemeMatchArr=uriSchemeMatch.match(this.uriSchemeRegex),
uriScheme=uriSchemeMatchArr&&uriSchemeMatchArr[0].toLowerCase();
return uriScheme!=="javascript:"&&uriScheme!=="vbscript:"};
UrlMatchValidator.urlMatchDoesNotHaveProtocolOrDot=function(urlMatch,protocolUrlMatch){
return!!urlMatch&&(!protocolUrlMatch||!this.hasFullProtocolRegex.test(protocolUrlMatch)
)&&urlMatch.indexOf(".")===-1};UrlMatchValidator.urlMatchDoesNotHaveAtLeastOneWordChar=function(
urlMatch,protocolUrlMatch){if(urlMatch&&protocolUrlMatch){return!this.hasFullProtocolRegex.test(
protocolUrlMatch)&&!this.hasWordCharAfterProtocolRegex.test(urlMatch)}else{return false}};
UrlMatchValidator.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//;
UrlMatchValidator.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/;
UrlMatchValidator.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+alphaCharsStr+"]");
UrlMatchValidator.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/
return UrlMatchValidator}();var matcherRegex=function(){
var schemeRegex=/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/
,wwwRegex=/(?:www\.)/,urlSuffixRegex=new RegExp(
"[/?#](?:["+alphaNumericAndMarksCharsStr+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+alphaNumericAndMarksCharsStr+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"
);return new RegExp(["(?:","(",schemeRegex.source,getDomainNameStr(2),")","|","(","(//)?",
wwwRegex.source,getDomainNameStr(6),")","|","(","(//)?",getDomainNameStr(10)+"\\.",tldRegex.source,
"(?![-"+alphaNumericCharsStr+"])",")",")","(?::[0-9]+)?","(?:"+urlSuffixRegex.source+")?"].join(""),
"gi")}();var wordCharRegExp=new RegExp("["+alphaNumericAndMarksCharsStr+"]");
var UrlMatcher=function(_super){__extends(UrlMatcher,_super);function UrlMatcher(cfg){
var _this=_super.call(this,cfg)||this;_this.stripPrefix={scheme:true,www:true};
_this.stripTrailingSlash=true;_this.decodePercentEncoding=true;_this.matcherRegex=matcherRegex;
_this.wordCharRegExp=wordCharRegExp;_this.stripPrefix=cfg.stripPrefix;
_this.stripTrailingSlash=cfg.stripTrailingSlash;
_this.decodePercentEncoding=cfg.decodePercentEncoding;return _this}
UrlMatcher.prototype.parseMatches=function(text){var matcherRegex=this.matcherRegex,
stripPrefix=this.stripPrefix,stripTrailingSlash=this.stripTrailingSlash,
decodePercentEncoding=this.decodePercentEncoding,tagBuilder=this.tagBuilder,matches=[],match;
var _loop_1=function(){var matchStr=match[0],schemeUrlMatch=match[1],wwwUrlMatch=match[4],
wwwProtocolRelativeMatch=match[5],tldProtocolRelativeMatch=match[9],offset=match.index,
protocolRelativeMatch=wwwProtocolRelativeMatch||tldProtocolRelativeMatch,prevChar=text.charAt(
offset-1);if(!UrlMatchValidator.isValid(matchStr,schemeUrlMatch)){return"continue"}if(
offset>0&&prevChar==="@"){return"continue"}if(
offset>0&&protocolRelativeMatch&&this_1.wordCharRegExp.test(prevChar)){return"continue"}if(
/\?$/.test(matchStr)){matchStr=matchStr.substr(0,matchStr.length-1)}if(
this_1.matchHasUnbalancedClosingParen(matchStr)){matchStr=matchStr.substr(0,matchStr.length-1)}else{
var pos=this_1.matchHasInvalidCharAfterTld(matchStr,schemeUrlMatch);if(pos>-1){
matchStr=matchStr.substr(0,pos)}}var foundCommonScheme=["http://","https://"].find(function(
commonScheme){return!!schemeUrlMatch&&schemeUrlMatch.indexOf(commonScheme)!==-1});if(
foundCommonScheme){var indexOfSchemeStart=matchStr.indexOf(foundCommonScheme);
matchStr=matchStr.substr(indexOfSchemeStart);schemeUrlMatch=schemeUrlMatch.substr(indexOfSchemeStart
);offset=offset+indexOfSchemeStart}var urlMatchType=schemeUrlMatch?"scheme":wwwUrlMatch?"www":"tld",
protocolUrlMatch=!!schemeUrlMatch;matches.push(new UrlMatch({tagBuilder:tagBuilder,
matchedText:matchStr,offset:offset,urlMatchType:urlMatchType,url:matchStr,
protocolUrlMatch:protocolUrlMatch,protocolRelativeMatch:!!protocolRelativeMatch,
stripPrefix:stripPrefix,stripTrailingSlash:stripTrailingSlash,
decodePercentEncoding:decodePercentEncoding}))};var this_1=this;while((match=matcherRegex.exec(text)
)!==null){_loop_1()}return matches};UrlMatcher.prototype.matchHasUnbalancedClosingParen=function(
matchStr){var endChar=matchStr.charAt(matchStr.length-1);var startChar;if(endChar===")"){
startChar="("}else if(endChar==="]"){startChar="["}else if(endChar==="}"){startChar="{"}else{
return false}var numOpenBraces=0;for(var i=0,len=matchStr.length-1;i<len;i++){
var char=matchStr.charAt(i);if(char===startChar){numOpenBraces++}else if(char===endChar){
numOpenBraces=Math.max(numOpenBraces-1,0)}}if(numOpenBraces===0){return true}return false};
UrlMatcher.prototype.matchHasInvalidCharAfterTld=function(urlMatch,schemeUrlMatch){if(!urlMatch){
return-1}var offset=0;if(schemeUrlMatch){offset=urlMatch.indexOf(":");urlMatch=urlMatch.slice(offset
)}var re=new RegExp(
"^((.?//)?[-."+alphaNumericAndMarksCharsStr+"]*[-"+alphaNumericAndMarksCharsStr+"]\\.[-"+alphaNumericAndMarksCharsStr+"]+)"
);var res=re.exec(urlMatch);if(res===null){return-1}offset+=res[1].length;urlMatch=urlMatch.slice(
res[1].length);if(/^[^-.A-Za-z0-9:\/?#]/.test(urlMatch)){return offset}return-1};return UrlMatcher}(
Matcher);var matcherRegex$1=new RegExp(
"#[_"+alphaNumericAndMarksCharsStr+"]{1,139}(?![_"+alphaNumericAndMarksCharsStr+"])","g");
var nonWordCharRegex=new RegExp("[^"+alphaNumericAndMarksCharsStr+"]");var HashtagMatcher=function(
_super){__extends(HashtagMatcher,_super);function HashtagMatcher(cfg){var _this=_super.call(this,cfg
)||this;_this.serviceName="twitter";_this.matcherRegex=matcherRegex$1;
_this.nonWordCharRegex=nonWordCharRegex;_this.serviceName=cfg.serviceName;return _this}
HashtagMatcher.prototype.parseMatches=function(text){var matcherRegex=this.matcherRegex,
nonWordCharRegex=this.nonWordCharRegex,serviceName=this.serviceName,tagBuilder=this.tagBuilder,
matches=[],match;while((match=matcherRegex.exec(text))!==null){var offset=match.index,
prevChar=text.charAt(offset-1);if(offset===0||nonWordCharRegex.test(prevChar)){
var matchedText=match[0],hashtag=match[0].slice(1);matches.push(new HashtagMatch({
tagBuilder:tagBuilder,matchedText:matchedText,offset:offset,serviceName:serviceName,hashtag:hashtag}
))}}return matches};return HashtagMatcher}(Matcher);
var phoneMatcherRegex=/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/g
var PhoneMatcher=function(_super){__extends(PhoneMatcher,_super);function PhoneMatcher(){
var _this=_super!==null&&_super.apply(this,arguments)||this;_this.matcherRegex=phoneMatcherRegex;
return _this}PhoneMatcher.prototype.parseMatches=function(text){var matcherRegex=this.matcherRegex,
tagBuilder=this.tagBuilder,matches=[],match;while((match=matcherRegex.exec(text))!==null){
var matchedText=match[0],cleanNumber=matchedText.replace(/[^0-9,;#]/g,""),plusSign=!!(match[1
]||match[2]),before=match.index==0?"":text.substr(match.index-1,1),after=text.substr(
match.index+matchedText.length,1),contextClear=!before.match(/\d/)&&!after.match(/\d/);if(
this.testMatch(match[3])&&this.testMatch(matchedText)&&contextClear){matches.push(new PhoneMatch({
tagBuilder:tagBuilder,matchedText:matchedText,offset:match.index,number:cleanNumber,
plusSign:plusSign}))}}return matches};PhoneMatcher.prototype.testMatch=function(text){
return nonDigitRe.test(text)};return PhoneMatcher}(Matcher);var twitterRegex=new RegExp(
"@[_"+alphaNumericAndMarksCharsStr+"]{1,50}(?![_"+alphaNumericAndMarksCharsStr+"])","g");
var instagramRegex=new RegExp(
"@[_."+alphaNumericAndMarksCharsStr+"]{1,30}(?![_"+alphaNumericAndMarksCharsStr+"])","g");
var soundcloudRegex=new RegExp(
"@[-_."+alphaNumericAndMarksCharsStr+"]{1,50}(?![-_"+alphaNumericAndMarksCharsStr+"])","g");
var nonWordCharRegex$1=new RegExp("[^"+alphaNumericAndMarksCharsStr+"]");
var MentionMatcher=function(_super){__extends(MentionMatcher,_super);function MentionMatcher(cfg){
var _this=_super.call(this,cfg)||this;_this.serviceName="twitter";_this.matcherRegexes={
twitter:twitterRegex,instagram:instagramRegex,soundcloud:soundcloudRegex};
_this.nonWordCharRegex=nonWordCharRegex$1;_this.serviceName=cfg.serviceName;return _this}
MentionMatcher.prototype.parseMatches=function(text){var serviceName=this.serviceName,
matcherRegex=this.matcherRegexes[this.serviceName],nonWordCharRegex=this.nonWordCharRegex,
tagBuilder=this.tagBuilder,matches=[],match;if(!matcherRegex){return matches}while((
match=matcherRegex.exec(text))!==null){var offset=match.index,prevChar=text.charAt(offset-1);if(
offset===0||nonWordCharRegex.test(prevChar)){var matchedText=match[0].replace(/\.+$/g,""),
mention=matchedText.slice(1);matches.push(new MentionMatch({tagBuilder:tagBuilder,
matchedText:matchedText,offset:offset,serviceName:serviceName,mention:mention}))}}return matches};
return MentionMatcher}(Matcher);function parseHtml(html,_a){var onOpenTag=_a.onOpenTag,
onCloseTag=_a.onCloseTag,onText=_a.onText,onComment=_a.onComment,onDoctype=_a.onDoctype;
var noCurrentTag=new CurrentTag;var charIdx=0,len=html.length,state=0,currentDataIdx=0,
currentTag=noCurrentTag;while(charIdx<len){var char=html.charAt(charIdx);switch(state){case 0:
stateData(char);break;case 1:stateTagOpen(char);break;case 2:stateEndTagOpen(char);break;case 3:
stateTagName(char);break;case 4:stateBeforeAttributeName(char);break;case 5:stateAttributeName(char)
break;case 6:stateAfterAttributeName(char);break;case 7:stateBeforeAttributeValue(char);break;
case 8:stateAttributeValueDoubleQuoted(char);break;case 9:stateAttributeValueSingleQuoted(char);
break;case 10:stateAttributeValueUnquoted(char);break;case 11:stateAfterAttributeValueQuoted(char);
break;case 12:stateSelfClosingStartTag(char);break;case 13:stateMarkupDeclarationOpen(char);break;
case 14:stateCommentStart(char);break;case 15:stateCommentStartDash(char);break;case 16:
stateComment(char);break;case 17:stateCommentEndDash(char);break;case 18:stateCommentEnd(char);break
case 19:stateCommentEndBang(char);break;case 20:stateDoctype(char);break;default:
throwUnhandledCaseError(state)}charIdx++}if(currentDataIdx<charIdx){emitText()}function stateData(
char){if(char==="<"){startNewTag()}}function stateTagOpen(char){if(char==="!"){state=13}else if(
char==="/"){state=2;currentTag=new CurrentTag(__assign({},currentTag,{isClosing:true}))}else if(
char==="<"){startNewTag()}else if(letterRe.test(char)){state=3;currentTag=new CurrentTag(__assign({}
,currentTag,{isOpening:true}))}else{state=0;currentTag=noCurrentTag}}function stateTagName(char){if(
whitespaceRe.test(char)){currentTag=new CurrentTag(__assign({},currentTag,{name:captureTagName()}));
state=4}else if(char==="<"){startNewTag()}else if(char==="/"){currentTag=new CurrentTag(__assign({},
currentTag,{name:captureTagName()}));state=12}else if(char===">"){currentTag=new CurrentTag(
__assign({},currentTag,{name:captureTagName()}));emitTagAndPreviousTextNode()}else if(
!letterRe.test(char)&&!digitRe.test(char)&&char!==":"){resetToDataState()}}function stateEndTagOpen(
char){if(char===">"){resetToDataState()}else if(letterRe.test(char)){state=3}else{resetToDataState()
}}function stateBeforeAttributeName(char){if(whitespaceRe.test(char));else if(char==="/"){state=12
}else if(char===">"){emitTagAndPreviousTextNode()}else if(char==="<"){startNewTag()}else if(
char==="="||quoteRe.test(char)||controlCharsRe.test(char)){resetToDataState()}else{state=5}}
function stateAttributeName(char){if(whitespaceRe.test(char)){state=6}else if(char==="/"){state=12
}else if(char==="="){state=7}else if(char===">"){emitTagAndPreviousTextNode()}else if(char==="<"){
startNewTag()}else if(quoteRe.test(char)){resetToDataState()}}function stateAfterAttributeName(char
){if(whitespaceRe.test(char));else if(char==="/"){state=12}else if(char==="="){state=7}else if(
char===">"){emitTagAndPreviousTextNode()}else if(char==="<"){startNewTag()}else if(quoteRe.test(char
)){resetToDataState()}else{state=5}}function stateBeforeAttributeValue(char){if(whitespaceRe.test(
char));else if(char==='"'){state=8}else if(char==="'"){state=9}else if(/[>=`]/.test(char)){
resetToDataState()}else if(char==="<"){startNewTag()}else{state=10}}
function stateAttributeValueDoubleQuoted(char){if(char==='"'){state=11}}
function stateAttributeValueSingleQuoted(char){if(char==="'"){state=11}}
function stateAttributeValueUnquoted(char){if(whitespaceRe.test(char)){state=4}else if(char===">"){
emitTagAndPreviousTextNode()}else if(char==="<"){startNewTag()}}
function stateAfterAttributeValueQuoted(char){if(whitespaceRe.test(char)){state=4}else if(char==="/"
){state=12}else if(char===">"){emitTagAndPreviousTextNode()}else if(char==="<"){startNewTag()}else{
state=4;reconsumeCurrentCharacter()}}function stateSelfClosingStartTag(char){if(char===">"){
currentTag=new CurrentTag(__assign({},currentTag,{isClosing:true}));emitTagAndPreviousTextNode()
}else{state=4}}function stateMarkupDeclarationOpen(char){if(html.substr(charIdx,2)==="--"){
charIdx+=2;currentTag=new CurrentTag(__assign({},currentTag,{type:"comment"}));state=14}else if(
html.substr(charIdx,7).toUpperCase()==="DOCTYPE"){charIdx+=7;currentTag=new CurrentTag(__assign({},
currentTag,{type:"doctype"}));state=20}else{resetToDataState()}}function stateCommentStart(char){if(
char==="-"){state=15}else if(char===">"){resetToDataState()}else{state=16}}
function stateCommentStartDash(char){if(char==="-"){state=18}else if(char===">"){resetToDataState()
}else{state=16}}function stateComment(char){if(char==="-"){state=17}}function stateCommentEndDash(
char){if(char==="-"){state=18}else{state=16}}function stateCommentEnd(char){if(char===">"){
emitTagAndPreviousTextNode()}else if(char==="!"){state=19}else if(char==="-");else{state=16}}
function stateCommentEndBang(char){if(char==="-"){state=17}else if(char===">"){
emitTagAndPreviousTextNode()}else{state=16}}function stateDoctype(char){if(char===">"){
emitTagAndPreviousTextNode()}else if(char==="<"){startNewTag()}}function resetToDataState(){state=0;
currentTag=noCurrentTag}function startNewTag(){state=1;currentTag=new CurrentTag({idx:charIdx})}
function emitTagAndPreviousTextNode(){var textBeforeTag=html.slice(currentDataIdx,currentTag.idx);
if(textBeforeTag){onText(textBeforeTag,currentDataIdx)}if(currentTag.type==="comment"){onComment(
currentTag.idx)}else if(currentTag.type==="doctype"){onDoctype(currentTag.idx)}else{if(
currentTag.isOpening){onOpenTag(currentTag.name,currentTag.idx)}if(currentTag.isClosing){onCloseTag(
currentTag.name,currentTag.idx)}}resetToDataState();currentDataIdx=charIdx+1}function emitText(){
var text=html.slice(currentDataIdx,charIdx);onText(text,currentDataIdx);currentDataIdx=charIdx+1}
function captureTagName(){var startIdx=currentTag.idx+(currentTag.isClosing?2:1);return html.slice(
startIdx,charIdx).toLowerCase()}function reconsumeCurrentCharacter(){charIdx--}}
var CurrentTag=function(){function CurrentTag(cfg){if(cfg===void 0){cfg={}}
this.idx=cfg.idx!==undefined?cfg.idx:-1;this.type=cfg.type||"tag";this.name=cfg.name||"";
this.isOpening=!!cfg.isOpening;this.isClosing=!!cfg.isClosing}return CurrentTag}();
var Autolinker=function(){function Autolinker(cfg){if(cfg===void 0){cfg={}}
this.version=Autolinker.version;this.urls={};this.email=true;this.phone=true;this.hashtag=false;
this.mention=false;this.newWindow=true;this.stripPrefix={scheme:true,www:true};
this.stripTrailingSlash=true;this.decodePercentEncoding=true;this.truncate={length:0,location:"end"}
this.className="";this.replaceFn=null;this.context=undefined;this.sanitizeHtml=false;
this.matchers=null;this.tagBuilder=null;this.urls=this.normalizeUrlsCfg(cfg.urls);
this.email=typeof cfg.email==="boolean"?cfg.email:this.email;
this.phone=typeof cfg.phone==="boolean"?cfg.phone:this.phone;this.hashtag=cfg.hashtag||this.hashtag;
this.mention=cfg.mention||this.mention;
this.newWindow=typeof cfg.newWindow==="boolean"?cfg.newWindow:this.newWindow;
this.stripPrefix=this.normalizeStripPrefixCfg(cfg.stripPrefix);
this.stripTrailingSlash=typeof cfg.stripTrailingSlash==="boolean"?cfg.stripTrailingSlash:this.stripTrailingSlash
this.decodePercentEncoding=typeof cfg.decodePercentEncoding==="boolean"?cfg.decodePercentEncoding:this.decodePercentEncoding
this.sanitizeHtml=cfg.sanitizeHtml||false;var mention=this.mention;if(
mention!==false&&mention!=="twitter"&&mention!=="instagram"&&mention!=="soundcloud"){
throw new Error("invalid `mention` cfg - see docs")}var hashtag=this.hashtag;if(
hashtag!==false&&hashtag!=="twitter"&&hashtag!=="facebook"&&hashtag!=="instagram"){throw new Error(
"invalid `hashtag` cfg - see docs")}this.truncate=this.normalizeTruncateCfg(cfg.truncate);
this.className=cfg.className||this.className;this.replaceFn=cfg.replaceFn||this.replaceFn;
this.context=cfg.context||this}Autolinker.link=function(textOrHtml,options){
var autolinker=new Autolinker(options);return autolinker.link(textOrHtml)};
Autolinker.parse=function(textOrHtml,options){var autolinker=new Autolinker(options);
return autolinker.parse(textOrHtml)};Autolinker.prototype.normalizeUrlsCfg=function(urls){if(
urls==null)urls=true;if(typeof urls==="boolean"){return{schemeMatches:urls,wwwMatches:urls,
tldMatches:urls}}else{return{
schemeMatches:typeof urls.schemeMatches==="boolean"?urls.schemeMatches:true,
wwwMatches:typeof urls.wwwMatches==="boolean"?urls.wwwMatches:true,
tldMatches:typeof urls.tldMatches==="boolean"?urls.tldMatches:true}}};
Autolinker.prototype.normalizeStripPrefixCfg=function(stripPrefix){if(stripPrefix==null
)stripPrefix=true;if(typeof stripPrefix==="boolean"){return{scheme:stripPrefix,www:stripPrefix}
}else{return{scheme:typeof stripPrefix.scheme==="boolean"?stripPrefix.scheme:true,
www:typeof stripPrefix.www==="boolean"?stripPrefix.www:true}}};
Autolinker.prototype.normalizeTruncateCfg=function(truncate){if(typeof truncate==="number"){return{
length:truncate,location:"end"}}else{return defaults(truncate||{},{length:Number.POSITIVE_INFINITY,
location:"end"})}};Autolinker.prototype.parse=function(textOrHtml){var _this=this;var skipTagNames=[
"a","style","script"],skipTagsStackCount=0,matches=[];parseHtml(textOrHtml,{onOpenTag:function(
tagName){if(skipTagNames.indexOf(tagName)>=0){skipTagsStackCount++}},onText:function(text,offset){
if(skipTagsStackCount===0){
var htmlCharacterEntitiesRegex=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi;
var textSplit=splitAndCapture(text,htmlCharacterEntitiesRegex);var currentOffset_1=offset;
textSplit.forEach(function(splitText,i){if(i%2===0){var textNodeMatches=_this.parseText(splitText,
currentOffset_1);matches.push.apply(matches,textNodeMatches)}currentOffset_1+=splitText.length})}},
onCloseTag:function(tagName){if(skipTagNames.indexOf(tagName)>=0){skipTagsStackCount=Math.max(
skipTagsStackCount-1,0)}},onComment:function(offset){},onDoctype:function(offset){}});
matches=this.compactMatches(matches);matches=this.removeUnwantedMatches(matches);return matches};
Autolinker.prototype.compactMatches=function(matches){matches.sort(function(a,b){return a.getOffset(
)-b.getOffset()});for(var i=0;i<matches.length-1;i++){var match=matches[i],offset=match.getOffset(),
matchedTextLength=match.getMatchedText().length,endIdx=offset+matchedTextLength;if(
i+1<matches.length){if(matches[i+1].getOffset()===offset){var removeIdx=matches[i+1].getMatchedText(
).length>matchedTextLength?i:i+1;matches.splice(removeIdx,1);continue}if(matches[i+1].getOffset(
)<endIdx){matches.splice(i+1,1)}}}return matches};
Autolinker.prototype.removeUnwantedMatches=function(matches){if(!this.hashtag)remove(matches,
function(match){return match.getType()==="hashtag"});if(!this.email)remove(matches,function(match){
return match.getType()==="email"});if(!this.phone)remove(matches,function(match){
return match.getType()==="phone"});if(!this.mention)remove(matches,function(match){
return match.getType()==="mention"});if(!this.urls.schemeMatches){remove(matches,function(m){
return m.getType()==="url"&&m.getUrlMatchType()==="scheme"})}if(!this.urls.wwwMatches){remove(
matches,function(m){return m.getType()==="url"&&m.getUrlMatchType()==="www"})}if(
!this.urls.tldMatches){remove(matches,function(m){return m.getType()==="url"&&m.getUrlMatchType(
)==="tld"})}return matches};Autolinker.prototype.parseText=function(text,offset){if(offset===void 0
){offset=0}offset=offset||0;var matchers=this.getMatchers(),matches=[];for(var i=0,
numMatchers=matchers.length;i<numMatchers;i++){var textMatches=matchers[i].parseMatches(text);for(
var j=0,numTextMatches=textMatches.length;j<numTextMatches;j++){textMatches[j].setOffset(
offset+textMatches[j].getOffset())}matches.push.apply(matches,textMatches)}return matches};
Autolinker.prototype.link=function(textOrHtml){if(!textOrHtml){return""}if(this.sanitizeHtml){
textOrHtml=textOrHtml.replace(/</g,"&lt;").replace(/>/g,"&gt;")}var matches=this.parse(textOrHtml),
newHtml=[],lastIndex=0;for(var i=0,len=matches.length;i<len;i++){var match=matches[i];newHtml.push(
textOrHtml.substring(lastIndex,match.getOffset()));newHtml.push(this.createMatchReturnVal(match));
lastIndex=match.getOffset()+match.getMatchedText().length}newHtml.push(textOrHtml.substring(
lastIndex));return newHtml.join("")};Autolinker.prototype.createMatchReturnVal=function(match){
var replaceFnResult;if(this.replaceFn){replaceFnResult=this.replaceFn.call(this.context,match)}if(
typeof replaceFnResult==="string"){return replaceFnResult}else if(replaceFnResult===false){
return match.getMatchedText()}else if(replaceFnResult instanceof HtmlTag){
return replaceFnResult.toAnchorString()}else{var anchorTag=match.buildTag();
return anchorTag.toAnchorString()}};Autolinker.prototype.getMatchers=function(){if(!this.matchers){
var tagBuilder=this.getTagBuilder();var matchers=[new HashtagMatcher({tagBuilder:tagBuilder,
serviceName:this.hashtag}),new EmailMatcher({tagBuilder:tagBuilder}),new PhoneMatcher({
tagBuilder:tagBuilder}),new MentionMatcher({tagBuilder:tagBuilder,serviceName:this.mention}),
new UrlMatcher({tagBuilder:tagBuilder,stripPrefix:this.stripPrefix,
stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];
return this.matchers=matchers}else{return this.matchers}};
Autolinker.prototype.getTagBuilder=function(){var tagBuilder=this.tagBuilder;if(!tagBuilder){
tagBuilder=this.tagBuilder=new AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,
className:this.className})}return tagBuilder};Autolinker.version="3.14.1";
Autolinker.AnchorTagBuilder=AnchorTagBuilder;Autolinker.HtmlTag=HtmlTag;Autolinker.matcher={
Email:EmailMatcher,Hashtag:HashtagMatcher,Matcher:Matcher,Mention:MentionMatcher,Phone:PhoneMatcher,
Url:UrlMatcher};Autolinker.match={Email:EmailMatch,Hashtag:HashtagMatch,Match:Match,
Mention:MentionMatch,Phone:PhoneMatch,Url:UrlMatch};return Autolinker}();return Autolinker});(
function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(
typeof module==="object"&&module.exports){module.exports=function(root,jQuery){if(jQuery===undefined
){if(typeof window!=="undefined"){jQuery=require("jquery")}else{jQuery=require("jquery")(root)}}
factory(jQuery);return jQuery}}else{factory(jQuery)}})(function(jQuery){var S2=function(){if(
jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd){var S2=jQuery.fn.select2.amd}var S2;(
function(){if(!S2||!S2.requirejs){if(!S2){S2={}}else{require=S2}var requirejs,require,define;(
function(undef){var main,req,makeMap,handlers,defined={},waiting={},config={},defining={},
hasOwn=Object.prototype.hasOwnProperty,aps=[].slice,jsSuffixRegExp=/\.js$/;function hasProp(obj,prop
){return hasOwn.call(obj,prop)}function normalize(name,baseName){var nameParts,nameSegment,mapValue,
foundMap,lastIndex,foundI,foundStarMap,starI,i,j,part,normalizedBaseParts,
baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"]||{};if(name){
name=name.split("/");lastIndex=name.length-1;if(config.nodeIdCompat&&jsSuffixRegExp.test(name[
lastIndex])){name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")}if(name[0].charAt(0
)==="."&&baseParts){normalizedBaseParts=baseParts.slice(0,baseParts.length-1);
name=normalizedBaseParts.concat(name)}for(i=0;i<name.length;i++){part=name[i];if(part==="."){
name.splice(i,1);i-=1}else if(part===".."){if(i===0||i===1&&name[2]===".."||name[i-1]===".."){
continue}else if(i>0){name.splice(i-1,2);i-=2}}}name=name.join("/")}if((baseParts||starMap)&&map){
nameParts=name.split("/");for(i=nameParts.length;i>0;i-=1){nameSegment=nameParts.slice(0,i).join("/"
);if(baseParts){for(j=baseParts.length;j>0;j-=1){mapValue=map[baseParts.slice(0,j).join("/")];if(
mapValue){mapValue=mapValue[nameSegment];if(mapValue){foundMap=mapValue;foundI=i;break}}}}if(
foundMap){break}if(!foundStarMap&&starMap&&starMap[nameSegment]){foundStarMap=starMap[nameSegment];
starI=i}}if(!foundMap&&foundStarMap){foundMap=foundStarMap;foundI=starI}if(foundMap){
nameParts.splice(0,foundI,foundMap);name=nameParts.join("/")}}return name}function makeRequire(
relName,forceSync){return function(){var args=aps.call(arguments,0);if(typeof args[0
]!=="string"&&args.length===1){args.push(null)}return req.apply(undef,args.concat([relName,forceSync
]))}}function makeNormalize(relName){return function(name){return normalize(name,relName)}}
function makeLoad(depName){return function(value){defined[depName]=value}}function callDep(name){if(
hasProp(waiting,name)){var args=waiting[name];delete waiting[name];defining[name]=true;main.apply(
undef,args)}if(!hasProp(defined,name)&&!hasProp(defining,name)){throw new Error("No "+name)}
return defined[name]}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;if(
index>-1){prefix=name.substring(0,index);name=name.substring(index+1,name.length)}return[prefix,name
]}function makeRelParts(relName){return relName?splitPrefix(relName):[]}makeMap=function(name,
relParts){var plugin,parts=splitPrefix(name),prefix=parts[0],relResourceName=relParts[1];name=parts[
1];if(prefix){prefix=normalize(prefix,relResourceName);plugin=callDep(prefix)}if(prefix){if(
plugin&&plugin.normalize){name=plugin.normalize(name,makeNormalize(relResourceName))}else{
name=normalize(name,relResourceName)}}else{name=normalize(name,relResourceName);parts=splitPrefix(
name);prefix=parts[0];name=parts[1];if(prefix){plugin=callDep(prefix)}}return{
f:prefix?prefix+"!"+name:name,n:name,pr:prefix,p:plugin}};function makeConfig(name){return function(
){return config&&config.config&&config.config[name]||{}}}handlers={require:function(name){
return makeRequire(name)},exports:function(name){var e=defined[name];if(typeof e!=="undefined"){
return e}else{return defined[name]={}}},module:function(name){return{id:name,uri:"",exports:defined[
name],config:makeConfig(name)}}};main=function(name,deps,callback,relName){var cjsModule,depName,ret
,map,i,relParts,args=[],callbackType=typeof callback,usingExports;relName=relName||name;
relParts=makeRelParts(relName);if(callbackType==="undefined"||callbackType==="function"){
deps=!deps.length&&callback.length?["require","exports","module"]:deps;for(i=0;i<deps.length;i+=1){
map=makeMap(deps[i],relParts);depName=map.f;if(depName==="require"){args[i]=handlers.require(name)
}else if(depName==="exports"){args[i]=handlers.exports(name);usingExports=true}else if(
depName==="module"){cjsModule=args[i]=handlers.module(name)}else if(hasProp(defined,depName
)||hasProp(waiting,depName)||hasProp(defining,depName)){args[i]=callDep(depName)}else if(map.p){
map.p.load(map.n,makeRequire(relName,true),makeLoad(depName),{});args[i]=defined[depName]}else{
throw new Error(name+" missing "+depName)}}ret=callback?callback.apply(defined[name],args):undefined
if(name){if(cjsModule&&cjsModule.exports!==undef&&cjsModule.exports!==defined[name]){defined[name
]=cjsModule.exports}else if(ret!==undef||!usingExports){defined[name]=ret}}}else if(name){defined[
name]=callback}};requirejs=require=req=function(deps,callback,relName,forceSync,alt){if(
typeof deps==="string"){if(handlers[deps]){return handlers[deps](callback)}return callDep(makeMap(
deps,makeRelParts(callback)).f)}else if(!deps.splice){config=deps;if(config.deps){req(config.deps,
config.callback)}if(!callback){return}if(callback.splice){deps=callback;callback=relName;
relName=null}else{deps=undef}}callback=callback||function(){};if(typeof relName==="function"){
relName=forceSync;forceSync=alt}if(forceSync){main(undef,deps,callback,relName)}else{setTimeout(
function(){main(undef,deps,callback,relName)},4)}return req};req.config=function(cfg){return req(cfg
)};requirejs._defined=defined;define=function(name,deps,callback){if(typeof name!=="string"){
throw new Error("See almond README: incorrect module build, no module name")}if(!deps.splice){
callback=deps;deps=[]}if(!hasProp(defined,name)&&!hasProp(waiting,name)){waiting[name]=[name,deps,
callback]}};define.amd={jQuery:true}})();S2.requirejs=requirejs;S2.require=require;S2.define=define}
})();S2.define("almond",function(){});S2.define("jquery",[],function(){var _$=jQuery||$;if(
_$==null&&console&&console.error){console.error(
"Select2: An instance of jQuery or a jQuery-compatible library was not "+"found. Make sure that you are including jQuery before Select2 on your "+"web page."
)}return _$});S2.define("select2/utils",["jquery"],function($){var Utils={};Utils.Extend=function(
ChildClass,SuperClass){var __hasProp={}.hasOwnProperty;function BaseConstructor(){
this.constructor=ChildClass}for(var key in SuperClass){if(__hasProp.call(SuperClass,key)){
ChildClass[key]=SuperClass[key]}}BaseConstructor.prototype=SuperClass.prototype;
ChildClass.prototype=new BaseConstructor;ChildClass.__super__=SuperClass.prototype;return ChildClass
};function getMethods(theClass){var proto=theClass.prototype;var methods=[];for(
var methodName in proto){var m=proto[methodName];if(typeof m!=="function"){continue}if(
methodName==="constructor"){continue}methods.push(methodName)}return methods}
Utils.Decorate=function(SuperClass,DecoratorClass){var decoratedMethods=getMethods(DecoratorClass);
var superMethods=getMethods(SuperClass);function DecoratedClass(){
var unshift=Array.prototype.unshift;var argCount=DecoratorClass.prototype.constructor.length;
var calledConstructor=SuperClass.prototype.constructor;if(argCount>0){unshift.call(arguments,
SuperClass.prototype.constructor);calledConstructor=DecoratorClass.prototype.constructor}
calledConstructor.apply(this,arguments)}DecoratorClass.displayName=SuperClass.displayName;
function ctr(){this.constructor=DecoratedClass}DecoratedClass.prototype=new ctr;for(
var m=0;m<superMethods.length;m++){var superMethod=superMethods[m];DecoratedClass.prototype[
superMethod]=SuperClass.prototype[superMethod]}var calledMethod=function(methodName){
var originalMethod=function(){};if(methodName in DecoratedClass.prototype){
originalMethod=DecoratedClass.prototype[methodName]}var decoratedMethod=DecoratorClass.prototype[
methodName];return function(){var unshift=Array.prototype.unshift;unshift.call(arguments,
originalMethod);return decoratedMethod.apply(this,arguments)}};for(
var d=0;d<decoratedMethods.length;d++){var decoratedMethod=decoratedMethods[d];
DecoratedClass.prototype[decoratedMethod]=calledMethod(decoratedMethod)}return DecoratedClass};
var Observable=function(){this.listeners={}};Observable.prototype.on=function(event,callback){
this.listeners=this.listeners||{};if(event in this.listeners){this.listeners[event].push(callback)
}else{this.listeners[event]=[callback]}};Observable.prototype.trigger=function(event){
var slice=Array.prototype.slice;var params=slice.call(arguments,1);this.listeners=this.listeners||{}
if(params==null){params=[]}if(params.length===0){params.push({})}params[0]._type=event;if(
event in this.listeners){this.invoke(this.listeners[event],slice.call(arguments,1))}if(
"*"in this.listeners){this.invoke(this.listeners["*"],arguments)}};
Observable.prototype.invoke=function(listeners,params){for(var i=0,len=listeners.length;i<len;i++){
listeners[i].apply(this,params)}};Utils.Observable=Observable;Utils.generateChars=function(length){
var chars="";for(var i=0;i<length;i++){var randomChar=Math.floor(Math.random()*36);
chars+=randomChar.toString(36)}return chars};Utils.bind=function(func,context){return function(){
func.apply(context,arguments)}};Utils._convertData=function(data){for(var originalKey in data){
var keys=originalKey.split("-");var dataLevel=data;if(keys.length===1){continue}for(
var k=0;k<keys.length;k++){var key=keys[k];key=key.substring(0,1).toLowerCase()+key.substring(1);if(
!(key in dataLevel)){dataLevel[key]={}}if(k==keys.length-1){dataLevel[key]=data[originalKey]}
dataLevel=dataLevel[key]}delete data[originalKey]}return data};Utils.hasScroll=function(index,el){
var $el=$(el);var overflowX=el.style.overflowX;var overflowY=el.style.overflowY;if(
overflowX===overflowY&&(overflowY==="hidden"||overflowY==="visible")){return false}if(
overflowX==="scroll"||overflowY==="scroll"){return true}return $el.innerHeight(
)<el.scrollHeight||$el.innerWidth()<el.scrollWidth};Utils.escapeMarkup=function(markup){
var replaceMap={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"}
if(typeof markup!=="string"){return markup}return String(markup).replace(/[&<>"'\/\\]/g,function(
match){return replaceMap[match]})};Utils.appendMany=function($element,$nodes){if($.fn.jquery.substr(
0,3)==="1.7"){var $jqNodes=$();$.map($nodes,function(node){$jqNodes=$jqNodes.add(node)});
$nodes=$jqNodes}$element.append($nodes)};Utils.__cache={};var id=0;
Utils.GetUniqueElementId=function(element){var select2Id=element.getAttribute("data-select2-id");if(
select2Id==null){if(element.id){select2Id=element.id;element.setAttribute("data-select2-id",
select2Id)}else{element.setAttribute("data-select2-id",++id);select2Id=id.toString()}}
return select2Id};Utils.StoreData=function(element,name,value){var id=Utils.GetUniqueElementId(
element);if(!Utils.__cache[id]){Utils.__cache[id]={}}Utils.__cache[id][name]=value};
Utils.GetData=function(element,name){var id=Utils.GetUniqueElementId(element);if(name){if(
Utils.__cache[id]){if(Utils.__cache[id][name]!=null){return Utils.__cache[id][name]}return $(element
).data(name)}return $(element).data(name)}else{return Utils.__cache[id]}};Utils.RemoveData=function(
element){var id=Utils.GetUniqueElementId(element);if(Utils.__cache[id]!=null){delete Utils.__cache[
id]}element.removeAttribute("data-select2-id")};return Utils});S2.define("select2/results",["jquery"
,"./utils"],function($,Utils){function Results($element,options,dataAdapter){this.$element=$element;
this.data=dataAdapter;this.options=options;Results.__super__.constructor.call(this)}Utils.Extend(
Results,Utils.Observable);Results.prototype.render=function(){var $results=$(
'<ul class="select2-results__options" role="listbox"></ul>');if(this.options.get("multiple")){
$results.attr("aria-multiselectable","true")}this.$results=$results;return $results};
Results.prototype.clear=function(){this.$results.empty()};Results.prototype.displayMessage=function(
params){var escapeMarkup=this.options.get("escapeMarkup");this.clear();this.hideLoading();
var $message=$('<li role="alert" aria-live="assertive"'+' class="select2-results__option"></li>');
var message=this.options.get("translations").get(params.message);$message.append(escapeMarkup(
message(params.args)));$message[0].className+=" select2-results__message";this.$results.append(
$message)};Results.prototype.hideMessages=function(){this.$results.find(".select2-results__message"
).remove()};Results.prototype.append=function(data){this.hideLoading();var $options=[];if(
data.results==null||data.results.length===0){if(this.$results.children().length===0){this.trigger(
"results:message",{message:"noResults"})}return}data.results=this.sort(data.results);for(
var d=0;d<data.results.length;d++){var item=data.results[d];var $option=this.option(item);
$options.push($option)}this.$results.append($options)};Results.prototype.position=function($results,
$dropdown){var $resultsContainer=$dropdown.find(".select2-results");$resultsContainer.append(
$results)};Results.prototype.sort=function(data){var sorter=this.options.get("sorter");
return sorter(data)};Results.prototype.highlightFirstItem=function(){
var $options=this.$results.find(".select2-results__option[aria-selected]");
var $selected=$options.filter("[aria-selected=true]");if($selected.length>0){$selected.first(
).trigger("mouseenter")}else{$options.first().trigger("mouseenter")}this.ensureHighlightVisible()};
Results.prototype.setClasses=function(){var self=this;this.data.current(function(selected){
var selectedIds=$.map(selected,function(s){return s.id.toString()});var $options=self.$results.find(
".select2-results__option[aria-selected]");$options.each(function(){var $option=$(this);
var item=Utils.GetData(this,"data");var id=""+item.id;if(
item.element!=null&&item.element.selected||item.element==null&&$.inArray(id,selectedIds)>-1){
$option.attr("aria-selected","true")}else{$option.attr("aria-selected","false")}})})};
Results.prototype.showLoading=function(params){this.hideLoading();var loadingMore=this.options.get(
"translations").get("searching");var loading={disabled:true,loading:true,text:loadingMore(params)};
var $loading=this.option(loading);$loading.className+=" loading-results";this.$results.prepend(
$loading)};Results.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()}
Results.prototype.option=function(data){var option=document.createElement("li");
option.className="select2-results__option";var attrs={role:"option","aria-selected":"false"};
var matches=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector
if(data.element!=null&&matches.call(data.element,":disabled")||data.element==null&&data.disabled){
delete attrs["aria-selected"];attrs["aria-disabled"]="true"}if(data.id==null){delete attrs[
"aria-selected"]}if(data._resultId!=null){option.id=data._resultId}if(data.title){
option.title=data.title}if(data.children){attrs.role="group";attrs["aria-label"]=data.text;
delete attrs["aria-selected"]}for(var attr in attrs){var val=attrs[attr];option.setAttribute(attr,
val)}if(data.children){var $option=$(option);var label=document.createElement("strong");
label.className="select2-results__group";var $label=$(label);this.template(data,label);
var $children=[];for(var c=0;c<data.children.length;c++){var child=data.children[c];
var $child=this.option(child);$children.push($child)}var $childrenContainer=$("<ul></ul>",{
class:"select2-results__options select2-results__options--nested"});$childrenContainer.append(
$children);$option.append(label);$option.append($childrenContainer)}else{this.template(data,option)}
Utils.StoreData(option,"data",data);return option};Results.prototype.bind=function(container,
$container){var self=this;var id=container.id+"-results";this.$results.attr("id",id);container.on(
"results:all",function(params){self.clear();self.append(params.data);if(container.isOpen()){
self.setClasses();self.highlightFirstItem()}});container.on("results:append",function(params){
self.append(params.data);if(container.isOpen()){self.setClasses()}});container.on("query",function(
params){self.hideMessages();self.showLoading(params)});container.on("select",function(){if(
!container.isOpen()){return}self.setClasses();if(self.options.get("scrollAfterSelect")){
self.highlightFirstItem()}});container.on("unselect",function(){if(!container.isOpen()){return}
self.setClasses();if(self.options.get("scrollAfterSelect")){self.highlightFirstItem()}});
container.on("open",function(){self.$results.attr("aria-expanded","true");self.$results.attr(
"aria-hidden","false");self.setClasses();self.ensureHighlightVisible()});container.on("close",
function(){self.$results.attr("aria-expanded","false");self.$results.attr("aria-hidden","true");
self.$results.removeAttr("aria-activedescendant")});container.on("results:toggle",function(){
var $highlighted=self.getHighlightedResults();if($highlighted.length===0){return}
$highlighted.trigger("mouseup")});container.on("results:select",function(){
var $highlighted=self.getHighlightedResults();if($highlighted.length===0){return}
var data=Utils.GetData($highlighted[0],"data");if($highlighted.attr("aria-selected")=="true"){
self.trigger("close",{})}else{self.trigger("select",{data:data})}});container.on("results:previous",
function(){var $highlighted=self.getHighlightedResults();var $options=self.$results.find(
"[aria-selected]");var currentIndex=$options.index($highlighted);if(currentIndex<=0){return}
var nextIndex=currentIndex-1;if($highlighted.length===0){nextIndex=0}var $next=$options.eq(nextIndex
);$next.trigger("mouseenter");var currentOffset=self.$results.offset().top;var nextTop=$next.offset(
).top;var nextOffset=self.$results.scrollTop()+(nextTop-currentOffset);if(nextIndex===0){
self.$results.scrollTop(0)}else if(nextTop-currentOffset<0){self.$results.scrollTop(nextOffset)}});
container.on("results:next",function(){var $highlighted=self.getHighlightedResults();
var $options=self.$results.find("[aria-selected]");var currentIndex=$options.index($highlighted);
var nextIndex=currentIndex+1;if(nextIndex>=$options.length){return}var $next=$options.eq(nextIndex);
$next.trigger("mouseenter");var currentOffset=self.$results.offset().top+self.$results.outerHeight(
false);var nextBottom=$next.offset().top+$next.outerHeight(false);
var nextOffset=self.$results.scrollTop()+nextBottom-currentOffset;if(nextIndex===0){
self.$results.scrollTop(0)}else if(nextBottom>currentOffset){self.$results.scrollTop(nextOffset)}});
container.on("results:focus",function(params){params.element.addClass(
"select2-results__option--highlighted")});container.on("results:message",function(params){
self.displayMessage(params)});if($.fn.mousewheel){this.$results.on("mousewheel",function(e){
var top=self.$results.scrollTop();var bottom=self.$results.get(0).scrollHeight-top+e.deltaY;
var isAtTop=e.deltaY>0&&top-e.deltaY<=0;var isAtBottom=e.deltaY<0&&bottom<=self.$results.height();
if(isAtTop){self.$results.scrollTop(0);e.preventDefault();e.stopPropagation()}else if(isAtBottom){
self.$results.scrollTop(self.$results.get(0).scrollHeight-self.$results.height());e.preventDefault()
e.stopPropagation()}})}this.$results.on("mouseup",".select2-results__option[aria-selected]",
function(evt){var $this=$(this);var data=Utils.GetData(this,"data");if($this.attr("aria-selected"
)==="true"){if(self.options.get("multiple")){self.trigger("unselect",{originalEvent:evt,data:data})
}else{self.trigger("close",{})}return}self.trigger("select",{originalEvent:evt,data:data})});
this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(evt){
var data=Utils.GetData(this,"data");self.getHighlightedResults().removeClass(
"select2-results__option--highlighted");self.trigger("results:focus",{data:data,element:$(this)})})}
Results.prototype.getHighlightedResults=function(){var $highlighted=this.$results.find(
".select2-results__option--highlighted");return $highlighted};Results.prototype.destroy=function(){
this.$results.remove()};Results.prototype.ensureHighlightVisible=function(){
var $highlighted=this.getHighlightedResults();if($highlighted.length===0){return}
var $options=this.$results.find("[aria-selected]");var currentIndex=$options.index($highlighted);
var currentOffset=this.$results.offset().top;var nextTop=$highlighted.offset().top;
var nextOffset=this.$results.scrollTop()+(nextTop-currentOffset);
var offsetDelta=nextTop-currentOffset;nextOffset-=$highlighted.outerHeight(false)*2;if(
currentIndex<=2){this.$results.scrollTop(0)}else if(offsetDelta>this.$results.outerHeight(
)||offsetDelta<0){this.$results.scrollTop(nextOffset)}};Results.prototype.template=function(result,
container){var template=this.options.get("templateResult");var escapeMarkup=this.options.get(
"escapeMarkup");var content=template(result,container);if(content==null){
container.style.display="none"}else if(typeof content==="string"){container.innerHTML=escapeMarkup(
content)}else{$(container).append(content)}};return Results});S2.define("select2/keys",[],function(
){var KEYS={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,
PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return KEYS});S2.define(
"select2/selection/base",["jquery","../utils","../keys"],function($,Utils,KEYS){
function BaseSelection($element,options){this.$element=$element;this.options=options;
BaseSelection.__super__.constructor.call(this)}Utils.Extend(BaseSelection,Utils.Observable);
BaseSelection.prototype.render=function(){var $selection=$(
'<span class="select2-selection" role="combobox" '+' aria-haspopup="true" aria-expanded="false">'+"</span>"
);this._tabindex=0;if(Utils.GetData(this.$element[0],"old-tabindex")!=null){
this._tabindex=Utils.GetData(this.$element[0],"old-tabindex")}else if(this.$element.attr("tabindex"
)!=null){this._tabindex=this.$element.attr("tabindex")}$selection.attr("title",this.$element.attr(
"title"));$selection.attr("tabindex",this._tabindex);$selection.attr("aria-disabled","false");
this.$selection=$selection;return $selection};BaseSelection.prototype.bind=function(container,
$container){var self=this;var resultsId=container.id+"-results";this.container=container;
this.$selection.on("focus",function(evt){self.trigger("focus",evt)});this.$selection.on("blur",
function(evt){self._handleBlur(evt)});this.$selection.on("keydown",function(evt){self.trigger(
"keypress",evt);if(evt.which===KEYS.SPACE){evt.preventDefault()}});container.on("results:focus",
function(params){self.$selection.attr("aria-activedescendant",params.data._resultId)});container.on(
"selection:update",function(params){self.update(params.data)});container.on("open",function(){
self.$selection.attr("aria-expanded","true");self.$selection.attr("aria-owns",resultsId);
self._attachCloseHandler(container)});container.on("close",function(){self.$selection.attr(
"aria-expanded","false");self.$selection.removeAttr("aria-activedescendant");
self.$selection.removeAttr("aria-owns");self.$selection.trigger("focus");self._detachCloseHandler(
container)});container.on("enable",function(){self.$selection.attr("tabindex",self._tabindex);
self.$selection.attr("aria-disabled","false")});container.on("disable",function(){
self.$selection.attr("tabindex","-1");self.$selection.attr("aria-disabled","true")})};
BaseSelection.prototype._handleBlur=function(evt){var self=this;window.setTimeout(function(){if(
document.activeElement==self.$selection[0]||$.contains(self.$selection[0],document.activeElement)){
return}self.trigger("blur",evt)},1)};BaseSelection.prototype._attachCloseHandler=function(container
){$(document.body).on("mousedown.select2."+container.id,function(e){var $target=$(e.target);
var $select=$target.closest(".select2");var $all=$(".select2.select2-container--open");$all.each(
function(){if(this==$select[0]){return}var $element=Utils.GetData(this,"element");$element.select2(
"close")})})};BaseSelection.prototype._detachCloseHandler=function(container){$(document.body).off(
"mousedown.select2."+container.id)};BaseSelection.prototype.position=function($selection,$container
){var $selectionContainer=$container.find(".selection");$selectionContainer.append($selection)};
BaseSelection.prototype.destroy=function(){this._detachCloseHandler(this.container)};
BaseSelection.prototype.update=function(data){throw new Error(
"The `update` method must be defined in child classes.")};
BaseSelection.prototype.isEnabled=function(){return!this.isDisabled()};
BaseSelection.prototype.isDisabled=function(){return this.options.get("disabled")};
return BaseSelection});S2.define("select2/selection/single",["jquery","./base","../utils","../keys"]
,function($,BaseSelection,Utils,KEYS){function SingleSelection(){
SingleSelection.__super__.constructor.apply(this,arguments)}Utils.Extend(SingleSelection,
BaseSelection);SingleSelection.prototype.render=function(){
var $selection=SingleSelection.__super__.render.call(this);$selection.addClass(
"select2-selection--single");$selection.html(
'<span class="select2-selection__rendered"></span>'+'<span class="select2-selection__arrow" role="presentation">'+'<b role="presentation"></b>'+"</span>"
);return $selection};SingleSelection.prototype.bind=function(container,$container){var self=this;
SingleSelection.__super__.bind.apply(this,arguments);var id=container.id+"-container";
this.$selection.find(".select2-selection__rendered").attr("id",id).attr("role","textbox").attr(
"aria-readonly","true");this.$selection.attr("aria-labelledby",id);this.$selection.on("mousedown",
function(evt){if(evt.which!==1){return}self.trigger("toggle",{originalEvent:evt})});
this.$selection.on("focus",function(evt){});this.$selection.on("blur",function(evt){});container.on(
"focus",function(evt){if(!container.isOpen()){self.$selection.trigger("focus")}})};
SingleSelection.prototype.clear=function(){var $rendered=this.$selection.find(
".select2-selection__rendered");$rendered.empty();$rendered.removeAttr("title")};
SingleSelection.prototype.display=function(data,container){var template=this.options.get(
"templateSelection");var escapeMarkup=this.options.get("escapeMarkup");return escapeMarkup(template(
data,container))};SingleSelection.prototype.selectionContainer=function(){return $("<span></span>")}
SingleSelection.prototype.update=function(data){if(data.length===0){this.clear();return}
var selection=data[0];var $rendered=this.$selection.find(".select2-selection__rendered");
var formatted=this.display(selection,$rendered);$rendered.empty().append(formatted);
var title=selection.title||selection.text;if(title){$rendered.attr("title",title)}else{
$rendered.removeAttr("title")}};return SingleSelection});S2.define("select2/selection/multiple",[
"jquery","./base","../utils"],function($,BaseSelection,Utils){function MultipleSelection($element,
options){MultipleSelection.__super__.constructor.apply(this,arguments)}Utils.Extend(
MultipleSelection,BaseSelection);MultipleSelection.prototype.render=function(){
var $selection=MultipleSelection.__super__.render.call(this);$selection.addClass(
"select2-selection--multiple");$selection.html('<ul class="select2-selection__rendered"></ul>');
return $selection};MultipleSelection.prototype.bind=function(container,$container){var self=this;
MultipleSelection.__super__.bind.apply(this,arguments);this.$selection.on("click",function(evt){
self.trigger("toggle",{originalEvent:evt})});this.$selection.on("click",
".select2-selection__choice__remove",function(evt){if(self.isDisabled()){return}var $remove=$(this);
var $selection=$remove.parent();var data=Utils.GetData($selection[0],"data");self.trigger("unselect"
,{originalEvent:evt,data:data})})};MultipleSelection.prototype.clear=function(){
var $rendered=this.$selection.find(".select2-selection__rendered");$rendered.empty();
$rendered.removeAttr("title")};MultipleSelection.prototype.display=function(data,container){
var template=this.options.get("templateSelection");var escapeMarkup=this.options.get("escapeMarkup")
return escapeMarkup(template(data,container))};
MultipleSelection.prototype.selectionContainer=function(){var $container=$(
'<li class="select2-selection__choice">'+'<span class="select2-selection__choice__remove" role="presentation">'+"&times;"+"</span>"+"</li>"
);return $container};MultipleSelection.prototype.update=function(data){this.clear();if(
data.length===0){return}var $selections=[];for(var d=0;d<data.length;d++){var selection=data[d];
var $selection=this.selectionContainer();var formatted=this.display(selection,$selection);
$selection.append(formatted);var title=selection.title||selection.text;if(title){$selection.attr(
"title",title)}Utils.StoreData($selection[0],"data",selection);$selections.push($selection)}
var $rendered=this.$selection.find(".select2-selection__rendered");Utils.appendMany($rendered,
$selections)};return MultipleSelection});S2.define("select2/selection/placeholder",["../utils"],
function(Utils){function Placeholder(decorated,$element,options){
this.placeholder=this.normalizePlaceholder(options.get("placeholder"));decorated.call(this,$element,
options)}Placeholder.prototype.normalizePlaceholder=function(_,placeholder){if(
typeof placeholder==="string"){placeholder={id:"",text:placeholder}}return placeholder};
Placeholder.prototype.createPlaceholder=function(decorated,placeholder){
var $placeholder=this.selectionContainer();$placeholder.html(this.display(placeholder));
$placeholder.addClass("select2-selection__placeholder").removeClass("select2-selection__choice");
return $placeholder};Placeholder.prototype.update=function(decorated,data){
var singlePlaceholder=data.length==1&&data[0].id!=this.placeholder.id;
var multipleSelections=data.length>1;if(multipleSelections||singlePlaceholder){
return decorated.call(this,data)}this.clear();var $placeholder=this.createPlaceholder(
this.placeholder);this.$selection.find(".select2-selection__rendered").append($placeholder)};
return Placeholder});S2.define("select2/selection/allowClear",["jquery","../keys","../utils"],
function($,KEYS,Utils){function AllowClear(){}AllowClear.prototype.bind=function(decorated,container
,$container){var self=this;decorated.call(this,container,$container);if(this.placeholder==null){if(
this.options.get("debug")&&window.console&&console.error){console.error(
"Select2: The `allowClear` option should be used in combination "+"with the `placeholder` option.")}
}this.$selection.on("mousedown",".select2-selection__clear",function(evt){self._handleClear(evt)});
container.on("keypress",function(evt){self._handleKeyboardClear(evt,container)})};
AllowClear.prototype._handleClear=function(_,evt){if(this.isDisabled()){return}
var $clear=this.$selection.find(".select2-selection__clear");if($clear.length===0){return}
evt.stopPropagation();var data=Utils.GetData($clear[0],"data");var previousVal=this.$element.val();
this.$element.val(this.placeholder.id);var unselectData={data:data};this.trigger("clear",
unselectData);if(unselectData.prevented){this.$element.val(previousVal);return}for(
var d=0;d<data.length;d++){unselectData={data:data[d]};this.trigger("unselect",unselectData);if(
unselectData.prevented){this.$element.val(previousVal);return}}this.$element.trigger("input"
).trigger("change");this.trigger("toggle",{})};AllowClear.prototype._handleKeyboardClear=function(_,
evt,container){if(container.isOpen()){return}if(evt.which==KEYS.DELETE||evt.which==KEYS.BACKSPACE){
this._handleClear(evt)}};AllowClear.prototype.update=function(decorated,data){decorated.call(this,
data);if(this.$selection.find(".select2-selection__placeholder").length>0||data.length===0){return}
var removeAll=this.options.get("translations").get("removeAllItems");var $remove=$(
'<span class="select2-selection__clear" title="'+removeAll()+'">'+"&times;"+"</span>");
Utils.StoreData($remove[0],"data",data);this.$selection.find(".select2-selection__rendered"
).prepend($remove)};return AllowClear});S2.define("select2/selection/search",["jquery","../utils",
"../keys"],function($,Utils,KEYS){function Search(decorated,$element,options){decorated.call(this,
$element,options)}Search.prototype.render=function(decorated){var $search=$(
'<li class="select2-search select2-search--inline">'+'<input class="select2-search__field" type="search" tabindex="-1"'+' autocomplete="off" autocorrect="off" autocapitalize="none"'+' spellcheck="false" role="searchbox" aria-autocomplete="list" />'+"</li>"
);this.$searchContainer=$search;this.$search=$search.find("input");var $rendered=decorated.call(this
);this._transferTabIndex();return $rendered};Search.prototype.bind=function(decorated,container,
$container){var self=this;var resultsId=container.id+"-results";decorated.call(this,container,
$container);container.on("open",function(){self.$search.attr("aria-controls",resultsId);
self.$search.trigger("focus")});container.on("close",function(){self.$search.val("");
self.$search.removeAttr("aria-controls");self.$search.removeAttr("aria-activedescendant");
self.$search.trigger("focus")});container.on("enable",function(){self.$search.prop("disabled",false)
self._transferTabIndex()});container.on("disable",function(){self.$search.prop("disabled",true)});
container.on("focus",function(evt){self.$search.trigger("focus")});container.on("results:focus",
function(params){if(params.data._resultId){self.$search.attr("aria-activedescendant",
params.data._resultId)}else{self.$search.removeAttr("aria-activedescendant")}});this.$selection.on(
"focusin",".select2-search--inline",function(evt){self.trigger("focus",evt)});this.$selection.on(
"focusout",".select2-search--inline",function(evt){self._handleBlur(evt)});this.$selection.on(
"keydown",".select2-search--inline",function(evt){evt.stopPropagation();self.trigger("keypress",evt)
self._keyUpPrevented=evt.isDefaultPrevented();var key=evt.which;if(
key===KEYS.BACKSPACE&&self.$search.val()===""){var $previousChoice=self.$searchContainer.prev(
".select2-selection__choice");if($previousChoice.length>0){var item=Utils.GetData($previousChoice[0]
,"data");self.searchRemoveChoice(item);evt.preventDefault()}}});this.$selection.on("click",
".select2-search--inline",function(evt){if(self.$search.val()){evt.stopPropagation()}});
var msie=document.documentMode;var disableInputEvents=msie&&msie<=11;this.$selection.on(
"input.searchcheck",".select2-search--inline",function(evt){if(disableInputEvents){
self.$selection.off("input.search input.searchcheck");return}self.$selection.off("keyup.search")});
this.$selection.on("keyup.search input.search",".select2-search--inline",function(evt){if(
disableInputEvents&&evt.type==="input"){self.$selection.off("input.search input.searchcheck");return
}var key=evt.which;if(key==KEYS.SHIFT||key==KEYS.CTRL||key==KEYS.ALT){return}if(key==KEYS.TAB){
return}self.handleSearch(evt)})};Search.prototype._transferTabIndex=function(decorated){
this.$search.attr("tabindex",this.$selection.attr("tabindex"));this.$selection.attr("tabindex","-1")
};Search.prototype.createPlaceholder=function(decorated,placeholder){this.$search.attr("placeholder"
,placeholder.text)};Search.prototype.update=function(decorated,data){
var searchHadFocus=this.$search[0]==document.activeElement;this.$search.attr("placeholder","");
decorated.call(this,data);this.$selection.find(".select2-selection__rendered").append(
this.$searchContainer);this.resizeSearch();if(searchHadFocus){this.$search.trigger("focus")}};
Search.prototype.handleSearch=function(){this.resizeSearch();if(!this._keyUpPrevented){
var input=this.$search.val();this.trigger("query",{term:input})}this._keyUpPrevented=false};
Search.prototype.searchRemoveChoice=function(decorated,item){this.trigger("unselect",{data:item});
this.$search.val(item.text);this.handleSearch()};Search.prototype.resizeSearch=function(){
this.$search.css("width","25px");var width="";if(this.$search.attr("placeholder")!==""){
width=this.$selection.find(".select2-selection__rendered").width()}else{
var minimumWidth=this.$search.val().length+1;width=minimumWidth*.75+"em"}this.$search.css("width",
width)};return Search});S2.define("select2/selection/eventRelay",["jquery"],function($){
function EventRelay(){}EventRelay.prototype.bind=function(decorated,container,$container){
var self=this;var relayEvents=["open","opening","close","closing","select","selecting","unselect",
"unselecting","clear","clearing"];var preventableEvents=["opening","closing","selecting",
"unselecting","clearing"];decorated.call(this,container,$container);container.on("*",function(name,
params){if($.inArray(name,relayEvents)===-1){return}params=params||{};var evt=$.Event(
"select2:"+name,{params:params});self.$element.trigger(evt);if($.inArray(name,preventableEvents
)===-1){return}params.prevented=evt.isDefaultPrevented()})};return EventRelay});S2.define(
"select2/translation",["jquery","require"],function($,require){function Translation(dict){
this.dict=dict||{}}Translation.prototype.all=function(){return this.dict};
Translation.prototype.get=function(key){return this.dict[key]};
Translation.prototype.extend=function(translation){this.dict=$.extend({},translation.all(),this.dict
)};Translation._cache={};Translation.loadPath=function(path){if(!(path in Translation._cache)){
var translations=require(path);Translation._cache[path]=translations}return new Translation(
Translation._cache[path])};return Translation});S2.define("select2/diacritics",[],function(){
var diacritics={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A",
"Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A",
"Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA",
"Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B",
"Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C",
"Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D",
"Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E",
"É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E",
"Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E",
"Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G",
"Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H",
"Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I",
"Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I",
"Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K",
"Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L",
"Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L",
"Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M",
"Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N",
"Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O",
"Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O",
"Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O",
"Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE",
"Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P",
"Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R",
"Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S",
"Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S",
"Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T",
"Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U",
"Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U",
"Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U",
"Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W",
"Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y",
"Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y",
"Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z",
"Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a",
"ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a",
"ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa",
"æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b",
"ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c",
"ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d",
"ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e",
"ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e",
"ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e",
"ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g",
"ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h",
"ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv",
"ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i",
"ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j",
"ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k",
"ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l",
"ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m",
"ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n",
"ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o",
"ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o",
"ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o",
"ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o",
"ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p",
"ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r",
"ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r",
"ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s",
"ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t",
"ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u",
"ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u",
"ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u",
"ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v",
"ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w",
"ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y",
"ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z",
"ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι",
"Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο",
"ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"};return diacritics});S2.define("select2/data/base",[
"../utils"],function(Utils){function BaseAdapter($element,options){
BaseAdapter.__super__.constructor.call(this)}Utils.Extend(BaseAdapter,Utils.Observable);
BaseAdapter.prototype.current=function(callback){throw new Error(
"The `current` method must be defined in child classes.")};BaseAdapter.prototype.query=function(
params,callback){throw new Error("The `query` method must be defined in child classes.")};
BaseAdapter.prototype.bind=function(container,$container){};BaseAdapter.prototype.destroy=function(
){};BaseAdapter.prototype.generateResultId=function(container,data){var id=container.id+"-result-";
id+=Utils.generateChars(4);if(data.id!=null){id+="-"+data.id.toString()}else{
id+="-"+Utils.generateChars(4)}return id};return BaseAdapter});S2.define("select2/data/select",[
"./base","../utils","jquery"],function(BaseAdapter,Utils,$){function SelectAdapter($element,options
){this.$element=$element;this.options=options;SelectAdapter.__super__.constructor.call(this)}
Utils.Extend(SelectAdapter,BaseAdapter);SelectAdapter.prototype.current=function(callback){
var data=[];var self=this;this.$element.find(":selected").each(function(){var $option=$(this);
var option=self.item($option);data.push(option)});callback(data)};
SelectAdapter.prototype.select=function(data){var self=this;data.selected=true;if($(data.element
).is("option")){data.element.selected=true;this.$element.trigger("input").trigger("change");return}
if(this.$element.prop("multiple")){this.current(function(currentData){var val=[];data=[data];
data.push.apply(data,currentData);for(var d=0;d<data.length;d++){var id=data[d].id;if($.inArray(id,
val)===-1){val.push(id)}}self.$element.val(val);self.$element.trigger("input").trigger("change")})
}else{var val=data.id;this.$element.val(val);this.$element.trigger("input").trigger("change")}};
SelectAdapter.prototype.unselect=function(data){var self=this;if(!this.$element.prop("multiple")){
return}data.selected=false;if($(data.element).is("option")){data.element.selected=false;
this.$element.trigger("input").trigger("change");return}this.current(function(currentData){var val=[
];for(var d=0;d<currentData.length;d++){var id=currentData[d].id;if(id!==data.id&&$.inArray(id,val
)===-1){val.push(id)}}self.$element.val(val);self.$element.trigger("input").trigger("change")})};
SelectAdapter.prototype.bind=function(container,$container){var self=this;this.container=container;
container.on("select",function(params){self.select(params.data)});container.on("unselect",function(
params){self.unselect(params.data)})};SelectAdapter.prototype.destroy=function(){this.$element.find(
"*").each(function(){Utils.RemoveData(this)})};SelectAdapter.prototype.query=function(params,
callback){var data=[];var self=this;var $options=this.$element.children();$options.each(function(){
var $option=$(this);if(!$option.is("option")&&!$option.is("optgroup")){return}var option=self.item(
$option);var matches=self.matches(params,option);if(matches!==null){data.push(matches)}});callback({
results:data})};SelectAdapter.prototype.addOptions=function($options){Utils.appendMany(this.$element
,$options)};SelectAdapter.prototype.option=function(data){var option;if(data.children){
option=document.createElement("optgroup");option.label=data.text}else{option=document.createElement(
"option");if(option.textContent!==undefined){option.textContent=data.text}else{
option.innerText=data.text}}if(data.id!==undefined){option.value=data.id}if(data.disabled){
option.disabled=true}if(data.selected){option.selected=true}if(data.title){option.title=data.title}
var $option=$(option);var normalizedData=this._normalizeItem(data);normalizedData.element=option;
Utils.StoreData(option,"data",normalizedData);return $option};SelectAdapter.prototype.item=function(
$option){var data={};data=Utils.GetData($option[0],"data");if(data!=null){return data}if($option.is(
"option")){data={id:$option.val(),text:$option.text(),disabled:$option.prop("disabled"),
selected:$option.prop("selected"),title:$option.prop("title")}}else if($option.is("optgroup")){
data={text:$option.prop("label"),children:[],title:$option.prop("title")};
var $children=$option.children("option");var children=[];for(var c=0;c<$children.length;c++){
var $child=$($children[c]);var child=this.item($child);children.push(child)}data.children=children}
data=this._normalizeItem(data);data.element=$option[0];Utils.StoreData($option[0],"data",data);
return data};SelectAdapter.prototype._normalizeItem=function(item){if(item!==Object(item)){item={
id:item,text:item}}item=$.extend({},{text:""},item);var defaults={selected:false,disabled:false};if(
item.id!=null){item.id=item.id.toString()}if(item.text!=null){item.text=item.text.toString()}if(
item._resultId==null&&item.id&&this.container!=null){item._resultId=this.generateResultId(
this.container,item)}return $.extend({},defaults,item)};SelectAdapter.prototype.matches=function(
params,data){var matcher=this.options.get("matcher");return matcher(params,data)};
return SelectAdapter});S2.define("select2/data/array",["./select","../utils","jquery"],function(
SelectAdapter,Utils,$){function ArrayAdapter($element,options){this._dataToConvert=options.get(
"data")||[];ArrayAdapter.__super__.constructor.call(this,$element,options)}Utils.Extend(ArrayAdapter
,SelectAdapter);ArrayAdapter.prototype.bind=function(container,$container){
ArrayAdapter.__super__.bind.call(this,container,$container);this.addOptions(this.convertToOptions(
this._dataToConvert))};ArrayAdapter.prototype.select=function(data){var $option=this.$element.find(
"option").filter(function(i,elm){return elm.value==data.id.toString()});if($option.length===0){
$option=this.option(data);this.addOptions($option)}ArrayAdapter.__super__.select.call(this,data)};
ArrayAdapter.prototype.convertToOptions=function(data){var self=this;
var $existing=this.$element.find("option");var existingIds=$existing.map(function(){
return self.item($(this)).id}).get();var $options=[];function onlyItem(item){return function(){
return $(this).val()==item.id}}for(var d=0;d<data.length;d++){var item=this._normalizeItem(data[d]);
if($.inArray(item.id,existingIds)>=0){var $existingOption=$existing.filter(onlyItem(item));
var existingData=this.item($existingOption);var newData=$.extend(true,{},item,existingData);
var $newOption=this.option(newData);$existingOption.replaceWith($newOption);continue}
var $option=this.option(item);if(item.children){var $children=this.convertToOptions(item.children);
Utils.appendMany($option,$children)}$options.push($option)}return $options};return ArrayAdapter});
S2.define("select2/data/ajax",["./array","../utils","jquery"],function(ArrayAdapter,Utils,$){
function AjaxAdapter($element,options){this.ajaxOptions=this._applyDefaults(options.get("ajax"));if(
this.ajaxOptions.processResults!=null){this.processResults=this.ajaxOptions.processResults}
AjaxAdapter.__super__.constructor.call(this,$element,options)}Utils.Extend(AjaxAdapter,ArrayAdapter)
AjaxAdapter.prototype._applyDefaults=function(options){var defaults={data:function(params){
return $.extend({},params,{q:params.term})},transport:function(params,success,failure){
var $request=$.ajax(params);$request.then(success);$request.fail(failure);return $request}};
return $.extend({},defaults,options,true)};AjaxAdapter.prototype.processResults=function(results){
return results};AjaxAdapter.prototype.query=function(params,callback){var matches=[];var self=this;
if(this._request!=null){if($.isFunction(this._request.abort)){this._request.abort()}
this._request=null}var options=$.extend({type:"GET"},this.ajaxOptions);if(
typeof options.url==="function"){options.url=options.url.call(this.$element,params)}if(
typeof options.data==="function"){options.data=options.data.call(this.$element,params)}
function request(){var $request=options.transport(options,function(data){
var results=self.processResults(data,params);if(self.options.get("debug"
)&&window.console&&console.error){if(!results||!results.results||!$.isArray(results.results)){
console.error(
"Select2: The AJAX results did not return an array in the "+"`results` key of the response.")}}
callback(results)},function(){if("status"in $request&&($request.status===0||$request.status==="0")){
return}self.trigger("results:message",{message:"errorLoading"})});self._request=$request}if(
this.ajaxOptions.delay&&params.term!=null){if(this._queryTimeout){window.clearTimeout(
this._queryTimeout)}this._queryTimeout=window.setTimeout(request,this.ajaxOptions.delay)}else{
request()}};return AjaxAdapter});S2.define("select2/data/tags",["jquery"],function($){function Tags(
decorated,$element,options){var tags=options.get("tags");var createTag=options.get("createTag");if(
createTag!==undefined){this.createTag=createTag}var insertTag=options.get("insertTag");if(
insertTag!==undefined){this.insertTag=insertTag}decorated.call(this,$element,options);if($.isArray(
tags)){for(var t=0;t<tags.length;t++){var tag=tags[t];var item=this._normalizeItem(tag);
var $option=this.option(item);this.$element.append($option)}}}Tags.prototype.query=function(
decorated,params,callback){var self=this;this._removeOldTags();if(
params.term==null||params.page!=null){decorated.call(this,params,callback);return}function wrapper(
obj,child){var data=obj.results;for(var i=0;i<data.length;i++){var option=data[i];
var checkChildren=option.children!=null&&!wrapper({results:option.children},true);var optionText=(
option.text||"").toUpperCase();var paramsTerm=(params.term||"").toUpperCase();
var checkText=optionText===paramsTerm;if(checkText||checkChildren){if(child){return false}
obj.data=data;callback(obj);return}}if(child){return true}var tag=self.createTag(params);if(
tag!=null){var $option=self.option(tag);$option.attr("data-select2-tag",true);self.addOptions([
$option]);self.insertTag(data,tag)}obj.results=data;callback(obj)}decorated.call(this,params,wrapper
)};Tags.prototype.createTag=function(decorated,params){var term=$.trim(params.term);if(term===""){
return null}return{id:term,text:term}};Tags.prototype.insertTag=function(_,data,tag){data.unshift(
tag)};Tags.prototype._removeOldTags=function(_){var $options=this.$element.find(
"option[data-select2-tag]");$options.each(function(){if(this.selected){return}$(this).remove()})};
return Tags});S2.define("select2/data/tokenizer",["jquery"],function($){function Tokenizer(decorated
,$element,options){var tokenizer=options.get("tokenizer");if(tokenizer!==undefined){
this.tokenizer=tokenizer}decorated.call(this,$element,options)}Tokenizer.prototype.bind=function(
decorated,container,$container){decorated.call(this,container,$container);
this.$search=container.dropdown.$search||container.selection.$search||$container.find(
".select2-search__field")};Tokenizer.prototype.query=function(decorated,params,callback){
var self=this;function createAndSelect(data){var item=self._normalizeItem(data);
var $existingOptions=self.$element.find("option").filter(function(){return $(this).val()===item.id})
if(!$existingOptions.length){var $option=self.option(item);$option.attr("data-select2-tag",true);
self._removeOldTags();self.addOptions([$option])}select(item)}function select(data){self.trigger(
"select",{data:data})}params.term=params.term||"";var tokenData=this.tokenizer(params,this.options,
createAndSelect);if(tokenData.term!==params.term){if(this.$search.length){this.$search.val(
tokenData.term);this.$search.trigger("focus")}params.term=tokenData.term}decorated.call(this,params,
callback)};Tokenizer.prototype.tokenizer=function(_,params,options,callback){
var separators=options.get("tokenSeparators")||[];var term=params.term;var i=0;
var createTag=this.createTag||function(params){return{id:params.term,text:params.term}};while(
i<term.length){var termChar=term[i];if($.inArray(termChar,separators)===-1){i++;continue}
var part=term.substr(0,i);var partParams=$.extend({},params,{term:part});var data=createTag(
partParams);if(data==null){i++;continue}callback(data);term=term.substr(i+1)||"";i=0}return{
term:term}};return Tokenizer});S2.define("select2/data/minimumInputLength",[],function(){
function MinimumInputLength(decorated,$e,options){this.minimumInputLength=options.get(
"minimumInputLength");decorated.call(this,$e,options)}MinimumInputLength.prototype.query=function(
decorated,params,callback){params.term=params.term||"";if(params.term.length<this.minimumInputLength
){this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,
input:params.term,params:params}});return}decorated.call(this,params,callback)};
return MinimumInputLength});S2.define("select2/data/maximumInputLength",[],function(){
function MaximumInputLength(decorated,$e,options){this.maximumInputLength=options.get(
"maximumInputLength");decorated.call(this,$e,options)}MaximumInputLength.prototype.query=function(
decorated,params,callback){params.term=params.term||"";if(
this.maximumInputLength>0&&params.term.length>this.maximumInputLength){this.trigger(
"results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:params.term,
params:params}});return}decorated.call(this,params,callback)};return MaximumInputLength});S2.define(
"select2/data/maximumSelectionLength",[],function(){function MaximumSelectionLength(decorated,$e,
options){this.maximumSelectionLength=options.get("maximumSelectionLength");decorated.call(this,$e,
options)}MaximumSelectionLength.prototype.bind=function(decorated,container,$container){
var self=this;decorated.call(this,container,$container);container.on("select",function(){
self._checkIfMaximumSelected()})};MaximumSelectionLength.prototype.query=function(decorated,params,
callback){var self=this;this._checkIfMaximumSelected(function(){decorated.call(self,params,callback)
})};MaximumSelectionLength.prototype._checkIfMaximumSelected=function(_,successCallback){
var self=this;this.current(function(currentData){var count=currentData!=null?currentData.length:0;
if(self.maximumSelectionLength>0&&count>=self.maximumSelectionLength){self.trigger("results:message"
,{message:"maximumSelected",args:{maximum:self.maximumSelectionLength}});return}if(successCallback){
successCallback()}})};return MaximumSelectionLength});S2.define("select2/dropdown",["jquery",
"./utils"],function($,Utils){function Dropdown($element,options){this.$element=$element;
this.options=options;Dropdown.__super__.constructor.call(this)}Utils.Extend(Dropdown,
Utils.Observable);Dropdown.prototype.render=function(){var $dropdown=$(
'<span class="select2-dropdown">'+'<span class="select2-results"></span>'+"</span>");$dropdown.attr(
"dir",this.options.get("dir"));this.$dropdown=$dropdown;return $dropdown};
Dropdown.prototype.bind=function(){};Dropdown.prototype.position=function($dropdown,$container){};
Dropdown.prototype.destroy=function(){this.$dropdown.remove()};return Dropdown});S2.define(
"select2/dropdown/search",["jquery","../utils"],function($,Utils){function Search(){}
Search.prototype.render=function(decorated){var $rendered=decorated.call(this);var $search=$(
'<span class="select2-search select2-search--dropdown">'+'<input class="select2-search__field" type="search" tabindex="-1"'+' autocomplete="off" autocorrect="off" autocapitalize="none"'+' spellcheck="false" role="searchbox" aria-autocomplete="list" />'+"</span>"
);this.$searchContainer=$search;this.$search=$search.find("input");$rendered.prepend($search);
return $rendered};Search.prototype.bind=function(decorated,container,$container){var self=this;
var resultsId=container.id+"-results";decorated.call(this,container,$container);this.$search.on(
"keydown",function(evt){self.trigger("keypress",evt);self._keyUpPrevented=evt.isDefaultPrevented()})
this.$search.on("input",function(evt){$(this).off("keyup")});this.$search.on("keyup input",function(
evt){self.handleSearch(evt)});container.on("open",function(){self.$search.attr("tabindex",0);
self.$search.attr("aria-controls",resultsId);self.$search.trigger("focus");window.setTimeout(
function(){self.$search.trigger("focus")},0)});container.on("close",function(){self.$search.attr(
"tabindex",-1);self.$search.removeAttr("aria-controls");self.$search.removeAttr(
"aria-activedescendant");self.$search.val("");self.$search.trigger("blur")});container.on("focus",
function(){if(!container.isOpen()){self.$search.trigger("focus")}});container.on("results:all",
function(params){if(params.query.term==null||params.query.term===""){var showSearch=self.showSearch(
params);if(showSearch){self.$searchContainer.removeClass("select2-search--hide")}else{
self.$searchContainer.addClass("select2-search--hide")}}});container.on("results:focus",function(
params){if(params.data._resultId){self.$search.attr("aria-activedescendant",params.data._resultId)
}else{self.$search.removeAttr("aria-activedescendant")}})};Search.prototype.handleSearch=function(
evt){if(!this._keyUpPrevented){var input=this.$search.val();this.trigger("query",{term:input})}
this._keyUpPrevented=false};Search.prototype.showSearch=function(_,params){return true};
return Search});S2.define("select2/dropdown/hidePlaceholder",[],function(){function HidePlaceholder(
decorated,$element,options,dataAdapter){this.placeholder=this.normalizePlaceholder(options.get(
"placeholder"));decorated.call(this,$element,options,dataAdapter)}
HidePlaceholder.prototype.append=function(decorated,data){data.results=this.removePlaceholder(
data.results);decorated.call(this,data)};HidePlaceholder.prototype.normalizePlaceholder=function(_,
placeholder){if(typeof placeholder==="string"){placeholder={id:"",text:placeholder}}
return placeholder};HidePlaceholder.prototype.removePlaceholder=function(_,data){
var modifiedData=data.slice(0);for(var d=data.length-1;d>=0;d--){var item=data[d];if(
this.placeholder.id===item.id){modifiedData.splice(d,1)}}return modifiedData};return HidePlaceholder
});S2.define("select2/dropdown/infiniteScroll",["jquery"],function($){function InfiniteScroll(
decorated,$element,options,dataAdapter){this.lastParams={};decorated.call(this,$element,options,
dataAdapter);this.$loadingMore=this.createLoadingMore();this.loading=false}
InfiniteScroll.prototype.append=function(decorated,data){this.$loadingMore.remove();
this.loading=false;decorated.call(this,data);if(this.showLoadingMore(data)){this.$results.append(
this.$loadingMore);this.loadMoreIfNeeded()}};InfiniteScroll.prototype.bind=function(decorated,
container,$container){var self=this;decorated.call(this,container,$container);container.on("query",
function(params){self.lastParams=params;self.loading=true});container.on("query:append",function(
params){self.lastParams=params;self.loading=true});this.$results.on("scroll",
this.loadMoreIfNeeded.bind(this))};InfiniteScroll.prototype.loadMoreIfNeeded=function(){
var isLoadMoreVisible=$.contains(document.documentElement,this.$loadingMore[0]);if(
this.loading||!isLoadMoreVisible){return}var currentOffset=this.$results.offset(
).top+this.$results.outerHeight(false);var loadingMoreOffset=this.$loadingMore.offset(
).top+this.$loadingMore.outerHeight(false);if(currentOffset+50>=loadingMoreOffset){this.loadMore()}}
InfiniteScroll.prototype.loadMore=function(){this.loading=true;var params=$.extend({},{page:1},
this.lastParams);params.page++;this.trigger("query:append",params)};
InfiniteScroll.prototype.showLoadingMore=function(_,data){
return data.pagination&&data.pagination.more};InfiniteScroll.prototype.createLoadingMore=function(){
var $option=$(
"<li "+'class="select2-results__option select2-results__option--load-more"'+'role="option" aria-disabled="true"></li>'
);var message=this.options.get("translations").get("loadingMore");$option.html(message(
this.lastParams));return $option};return InfiniteScroll});S2.define("select2/dropdown/attachBody",[
"jquery","../utils"],function($,Utils){function AttachBody(decorated,$element,options){
this.$dropdownParent=$(options.get("dropdownParent")||document.body);decorated.call(this,$element,
options)}AttachBody.prototype.bind=function(decorated,container,$container){var self=this;
decorated.call(this,container,$container);container.on("open",function(){self._showDropdown();
self._attachPositioningHandler(container);self._bindContainerResultHandlers(container)});
container.on("close",function(){self._hideDropdown();self._detachPositioningHandler(container)});
this.$dropdownContainer.on("mousedown",function(evt){evt.stopPropagation()})};
AttachBody.prototype.destroy=function(decorated){decorated.call(this);
this.$dropdownContainer.remove()};AttachBody.prototype.position=function(decorated,$dropdown,
$container){$dropdown.attr("class",$container.attr("class"));$dropdown.removeClass("select2");
$dropdown.addClass("select2-container--open");$dropdown.css({position:"absolute",top:-999999});
this.$container=$container};AttachBody.prototype.render=function(decorated){var $container=$(
"<span></span>");var $dropdown=decorated.call(this);$container.append($dropdown);
this.$dropdownContainer=$container;return $container};AttachBody.prototype._hideDropdown=function(
decorated){this.$dropdownContainer.detach()};
AttachBody.prototype._bindContainerResultHandlers=function(decorated,container){if(
this._containerResultsHandlersBound){return}var self=this;container.on("results:all",function(){
self._positionDropdown();self._resizeDropdown()});container.on("results:append",function(){
self._positionDropdown();self._resizeDropdown()});container.on("results:message",function(){
self._positionDropdown();self._resizeDropdown()});container.on("select",function(){
self._positionDropdown();self._resizeDropdown()});container.on("unselect",function(){
self._positionDropdown();self._resizeDropdown()});this._containerResultsHandlersBound=true};
AttachBody.prototype._attachPositioningHandler=function(decorated,container){var self=this;
var scrollEvent="scroll.select2."+container.id;var resizeEvent="resize.select2."+container.id;
var orientationEvent="orientationchange.select2."+container.id;
var $watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.each(function(){
Utils.StoreData(this,"select2-scroll-position",{x:$(this).scrollLeft(),y:$(this).scrollTop()})});
$watchers.on(scrollEvent,function(ev){var position=Utils.GetData(this,"select2-scroll-position");$(
this).scrollTop(position.y)});$(window).on(scrollEvent+" "+resizeEvent+" "+orientationEvent,
function(e){self._positionDropdown();self._resizeDropdown()})};
AttachBody.prototype._detachPositioningHandler=function(decorated,container){
var scrollEvent="scroll.select2."+container.id;var resizeEvent="resize.select2."+container.id;
var orientationEvent="orientationchange.select2."+container.id;
var $watchers=this.$container.parents().filter(Utils.hasScroll);$watchers.off(scrollEvent);$(window
).off(scrollEvent+" "+resizeEvent+" "+orientationEvent)};
AttachBody.prototype._positionDropdown=function(){var $window=$(window);
var isCurrentlyAbove=this.$dropdown.hasClass("select2-dropdown--above");
var isCurrentlyBelow=this.$dropdown.hasClass("select2-dropdown--below");var newDirection=null;
var offset=this.$container.offset();offset.bottom=offset.top+this.$container.outerHeight(false);
var container={height:this.$container.outerHeight(false)};container.top=offset.top;
container.bottom=offset.top+container.height;var dropdown={height:this.$dropdown.outerHeight(false)}
var viewport={top:$window.scrollTop(),bottom:$window.scrollTop()+$window.height()};
var enoughRoomAbove=viewport.top<offset.top-dropdown.height;
var enoughRoomBelow=viewport.bottom>offset.bottom+dropdown.height;var css={left:offset.left,
top:container.bottom};var $offsetParent=this.$dropdownParent;if($offsetParent.css("position"
)==="static"){$offsetParent=$offsetParent.offsetParent()}var parentOffset={top:0,left:0};if(
$.contains(document.body,$offsetParent[0])||$offsetParent[0].isConnected){
parentOffset=$offsetParent.offset()}css.top-=parentOffset.top;css.left-=parentOffset.left;if(
!isCurrentlyAbove&&!isCurrentlyBelow){newDirection="below"}if(
!enoughRoomBelow&&enoughRoomAbove&&!isCurrentlyAbove){newDirection="above"}else if(
!enoughRoomAbove&&enoughRoomBelow&&isCurrentlyAbove){newDirection="below"}if(
newDirection=="above"||isCurrentlyAbove&&newDirection!=="below"){
css.top=container.top-parentOffset.top-dropdown.height}if(newDirection!=null){
this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass(
"select2-dropdown--"+newDirection);this.$container.removeClass(
"select2-container--below select2-container--above").addClass("select2-container--"+newDirection)}
this.$dropdownContainer.css(css)};AttachBody.prototype._resizeDropdown=function(){var css={
width:this.$container.outerWidth(false)+"px"};if(this.options.get("dropdownAutoWidth")){
css.minWidth=css.width;css.position="relative";css.width="auto"}this.$dropdown.css(css)};
AttachBody.prototype._showDropdown=function(decorated){this.$dropdownContainer.appendTo(
this.$dropdownParent);this._positionDropdown();this._resizeDropdown()};return AttachBody});
S2.define("select2/dropdown/minimumResultsForSearch",[],function(){function countResults(data){
var count=0;for(var d=0;d<data.length;d++){var item=data[d];if(item.children){count+=countResults(
item.children)}else{count++}}return count}function MinimumResultsForSearch(decorated,$element,
options,dataAdapter){this.minimumResultsForSearch=options.get("minimumResultsForSearch");if(
this.minimumResultsForSearch<0){this.minimumResultsForSearch=Infinity}decorated.call(this,$element,
options,dataAdapter)}MinimumResultsForSearch.prototype.showSearch=function(decorated,params){if(
countResults(params.data.results)<this.minimumResultsForSearch){return false}return decorated.call(
this,params)};return MinimumResultsForSearch});S2.define("select2/dropdown/selectOnClose",[
"../utils"],function(Utils){function SelectOnClose(){}SelectOnClose.prototype.bind=function(
decorated,container,$container){var self=this;decorated.call(this,container,$container);
container.on("close",function(params){self._handleSelectOnClose(params)})};
SelectOnClose.prototype._handleSelectOnClose=function(_,params){if(
params&&params.originalSelect2Event!=null){var event=params.originalSelect2Event;if(
event._type==="select"||event._type==="unselect"){return}}
var $highlightedResults=this.getHighlightedResults();if($highlightedResults.length<1){return}
var data=Utils.GetData($highlightedResults[0],"data");if(
data.element!=null&&data.element.selected||data.element==null&&data.selected){return}this.trigger(
"select",{data:data})};return SelectOnClose});S2.define("select2/dropdown/closeOnSelect",[],
function(){function CloseOnSelect(){}CloseOnSelect.prototype.bind=function(decorated,container,
$container){var self=this;decorated.call(this,container,$container);container.on("select",function(
evt){self._selectTriggered(evt)});container.on("unselect",function(evt){self._selectTriggered(evt)})
};CloseOnSelect.prototype._selectTriggered=function(_,evt){var originalEvent=evt.originalEvent;if(
originalEvent&&(originalEvent.ctrlKey||originalEvent.metaKey)){return}this.trigger("close",{
originalEvent:originalEvent,originalSelect2Event:evt})};return CloseOnSelect});S2.define(
"select2/i18n/en",[],function(){return{errorLoading:function(){
return"The results could not be loaded."},inputTooLong:function(args){
var overChars=args.input.length-args.maximum;var message="Please delete "+overChars+" character";if(
overChars!=1){message+="s"}return message},inputTooShort:function(args){
var remainingChars=args.minimum-args.input.length;
var message="Please enter "+remainingChars+" or more characters";return message},
loadingMore:function(){return"Loading more results…"},maximumSelected:function(args){
var message="You can only select "+args.maximum+" item";if(args.maximum!=1){message+="s"}
return message},noResults:function(){return"No results found"},searching:function(){
return"Searching…"},removeAllItems:function(){return"Remove all items"}}});S2.define(
"select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple",
"./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay",
"./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags",
"./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength",
"./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder",
"./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch",
"./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function($,require,ResultsList,
SingleSelection,MultipleSelection,Placeholder,AllowClear,SelectionSearch,EventRelay,Utils,
Translation,DIACRITICS,SelectData,ArrayData,AjaxData,Tags,Tokenizer,MinimumInputLength,
MaximumInputLength,MaximumSelectionLength,Dropdown,DropdownSearch,HidePlaceholder,InfiniteScroll,
AttachBody,MinimumResultsForSearch,SelectOnClose,CloseOnSelect,EnglishTranslation){
function Defaults(){this.reset()}Defaults.prototype.apply=function(options){options=$.extend(true,{}
,this.defaults,options);if(options.dataAdapter==null){if(options.ajax!=null){
options.dataAdapter=AjaxData}else if(options.data!=null){options.dataAdapter=ArrayData}else{
options.dataAdapter=SelectData}if(options.minimumInputLength>0){options.dataAdapter=Utils.Decorate(
options.dataAdapter,MinimumInputLength)}if(options.maximumInputLength>0){
options.dataAdapter=Utils.Decorate(options.dataAdapter,MaximumInputLength)}if(
options.maximumSelectionLength>0){options.dataAdapter=Utils.Decorate(options.dataAdapter,
MaximumSelectionLength)}if(options.tags){options.dataAdapter=Utils.Decorate(options.dataAdapter,Tags
)}if(options.tokenSeparators!=null||options.tokenizer!=null){options.dataAdapter=Utils.Decorate(
options.dataAdapter,Tokenizer)}if(options.query!=null){var Query=require(
options.amdBase+"compat/query");options.dataAdapter=Utils.Decorate(options.dataAdapter,Query)}if(
options.initSelection!=null){var InitSelection=require(options.amdBase+"compat/initSelection");
options.dataAdapter=Utils.Decorate(options.dataAdapter,InitSelection)}}if(
options.resultsAdapter==null){options.resultsAdapter=ResultsList;if(options.ajax!=null){
options.resultsAdapter=Utils.Decorate(options.resultsAdapter,InfiniteScroll)}if(
options.placeholder!=null){options.resultsAdapter=Utils.Decorate(options.resultsAdapter,
HidePlaceholder)}if(options.selectOnClose){options.resultsAdapter=Utils.Decorate(
options.resultsAdapter,SelectOnClose)}}if(options.dropdownAdapter==null){if(options.multiple){
options.dropdownAdapter=Dropdown}else{var SearchableDropdown=Utils.Decorate(Dropdown,DropdownSearch)
options.dropdownAdapter=SearchableDropdown}if(options.minimumResultsForSearch!==0){
options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,MinimumResultsForSearch)}if(
options.closeOnSelect){options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,CloseOnSelect)
}if(options.dropdownCssClass!=null||options.dropdownCss!=null||options.adaptDropdownCssClass!=null){
var DropdownCSS=require(options.amdBase+"compat/dropdownCss");
options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,DropdownCSS)}
options.dropdownAdapter=Utils.Decorate(options.dropdownAdapter,AttachBody)}if(
options.selectionAdapter==null){if(options.multiple){options.selectionAdapter=MultipleSelection
}else{options.selectionAdapter=SingleSelection}if(options.placeholder!=null){
options.selectionAdapter=Utils.Decorate(options.selectionAdapter,Placeholder)}if(options.allowClear
){options.selectionAdapter=Utils.Decorate(options.selectionAdapter,AllowClear)}if(options.multiple){
options.selectionAdapter=Utils.Decorate(options.selectionAdapter,SelectionSearch)}if(
options.containerCssClass!=null||options.containerCss!=null||options.adaptContainerCssClass!=null){
var ContainerCSS=require(options.amdBase+"compat/containerCss");
options.selectionAdapter=Utils.Decorate(options.selectionAdapter,ContainerCSS)}
options.selectionAdapter=Utils.Decorate(options.selectionAdapter,EventRelay)}
options.language=this._resolveLanguage(options.language);options.language.push("en");
var uniqueLanguages=[];for(var l=0;l<options.language.length;l++){var language=options.language[l];
if(uniqueLanguages.indexOf(language)===-1){uniqueLanguages.push(language)}}
options.language=uniqueLanguages;options.translations=this._processTranslations(options.language,
options.debug);return options};Defaults.prototype.reset=function(){function stripDiacritics(text){
function match(a){return DIACRITICS[a]||a}return text.replace(/[^\u0000-\u007E]/g,match)}
function matcher(params,data){if($.trim(params.term)===""){return data}if(
data.children&&data.children.length>0){var match=$.extend(true,{},data);for(
var c=data.children.length-1;c>=0;c--){var child=data.children[c];var matches=matcher(params,child);
if(matches==null){match.children.splice(c,1)}}if(match.children.length>0){return match}
return matcher(params,match)}var original=stripDiacritics(data.text).toUpperCase();
var term=stripDiacritics(params.term).toUpperCase();if(original.indexOf(term)>-1){return data}
return null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:true,debug:false,
dropdownAutoWidth:false,escapeMarkup:Utils.escapeMarkup,language:{},matcher:matcher,
minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,
selectOnClose:false,scrollAfterSelect:false,sorter:function(data){return data},
templateResult:function(result){return result.text},templateSelection:function(selection){
return selection.text},theme:"default",width:"resolve"}};
Defaults.prototype.applyFromElement=function(options,$element){var optionLanguage=options.language;
var defaultLanguage=this.defaults.language;var elementLanguage=$element.prop("lang");
var parentLanguage=$element.closest("[lang]").prop("lang");
var languages=Array.prototype.concat.call(this._resolveLanguage(elementLanguage),
this._resolveLanguage(optionLanguage),this._resolveLanguage(defaultLanguage),this._resolveLanguage(
parentLanguage));options.language=languages;return options};
Defaults.prototype._resolveLanguage=function(language){if(!language){return[]}if($.isEmptyObject(
language)){return[]}if($.isPlainObject(language)){return[language]}var languages;if(!$.isArray(
language)){languages=[language]}else{languages=language}var resolvedLanguages=[];for(
var l=0;l<languages.length;l++){resolvedLanguages.push(languages[l]);if(typeof languages[l
]==="string"&&languages[l].indexOf("-")>0){var languageParts=languages[l].split("-");
var baseLanguage=languageParts[0];resolvedLanguages.push(baseLanguage)}}return resolvedLanguages};
Defaults.prototype._processTranslations=function(languages,debug){var translations=new Translation;
for(var l=0;l<languages.length;l++){var languageData=new Translation;var language=languages[l];if(
typeof language==="string"){try{languageData=Translation.loadPath(language)}catch(e){try{
language=this.defaults.amdLanguageBase+language;languageData=Translation.loadPath(language)}catch(ex
){if(debug&&window.console&&console.warn){console.warn(
'Select2: The language file for "'+language+'" could '+"not be automatically loaded. A fallback will be used instead."
)}}}}else if($.isPlainObject(language)){languageData=new Translation(language)}else{
languageData=language}translations.extend(languageData)}return translations};
Defaults.prototype.set=function(key,value){var camelKey=$.camelCase(key);var data={};data[camelKey
]=value;var convertedData=Utils._convertData(data);$.extend(true,this.defaults,convertedData)};
var defaults=new Defaults;return defaults});S2.define("select2/options",["require","jquery",
"./defaults","./utils"],function(require,$,Defaults,Utils){function Options(options,$element){
this.options=options;if($element!=null){this.fromElement($element)}if($element!=null){
this.options=Defaults.applyFromElement(this.options,$element)}this.options=Defaults.apply(
this.options);if($element&&$element.is("input")){var InputCompat=require(this.get("amdBase"
)+"compat/inputData");this.options.dataAdapter=Utils.Decorate(this.options.dataAdapter,InputCompat)}
}Options.prototype.fromElement=function($e){var excludedData=["select2"];if(
this.options.multiple==null){this.options.multiple=$e.prop("multiple")}if(
this.options.disabled==null){this.options.disabled=$e.prop("disabled")}if(this.options.dir==null){
if($e.prop("dir")){this.options.dir=$e.prop("dir")}else if($e.closest("[dir]").prop("dir")){
this.options.dir=$e.closest("[dir]").prop("dir")}else{this.options.dir="ltr"}}$e.prop("disabled",
this.options.disabled);$e.prop("multiple",this.options.multiple);if(Utils.GetData($e[0],
"select2Tags")){if(this.options.debug&&window.console&&console.warn){console.warn(
"Select2: The `data-select2-tags` attribute has been changed to "+'use the `data-data` and `data-tags="true"` attributes and will be '+"removed in future versions of Select2."
)}Utils.StoreData($e[0],"data",Utils.GetData($e[0],"select2Tags"));Utils.StoreData($e[0],"tags",true
)}if(Utils.GetData($e[0],"ajaxUrl")){if(this.options.debug&&window.console&&console.warn){
console.warn(
"Select2: The `data-ajax-url` attribute has been changed to "+"`data-ajax--url` and support for the old attribute will be removed"+" in future versions of Select2."
)}$e.attr("ajax--url",Utils.GetData($e[0],"ajaxUrl"));Utils.StoreData($e[0],"ajax-Url",
Utils.GetData($e[0],"ajaxUrl"))}var dataset={};function upperCaseLetter(_,letter){
return letter.toUpperCase()}for(var attr=0;attr<$e[0].attributes.length;attr++){
var attributeName=$e[0].attributes[attr].name;var prefix="data-";if(attributeName.substr(0,
prefix.length)==prefix){var dataName=attributeName.substring(prefix.length);
var dataValue=Utils.GetData($e[0],dataName);var camelDataName=dataName.replace(/-([a-z])/g,
upperCaseLetter);dataset[camelDataName]=dataValue}}if($.fn.jquery&&$.fn.jquery.substr(0,2
)=="1."&&$e[0].dataset){dataset=$.extend(true,{},$e[0].dataset,dataset)}var data=$.extend(true,{},
Utils.GetData($e[0]),dataset);data=Utils._convertData(data);for(var key in data){if($.inArray(key,
excludedData)>-1){continue}if($.isPlainObject(this.options[key])){$.extend(this.options[key],data[
key])}else{this.options[key]=data[key]}}return this};Options.prototype.get=function(key){
return this.options[key]};Options.prototype.set=function(key,val){this.options[key]=val};
return Options});S2.define("select2/core",["jquery","./options","./utils","./keys"],function($,
Options,Utils,KEYS){var Select2=function($element,options){if(Utils.GetData($element[0],"select2"
)!=null){Utils.GetData($element[0],"select2").destroy()}this.$element=$element;
this.id=this._generateId($element);options=options||{};this.options=new Options(options,$element);
Select2.__super__.constructor.call(this);var tabindex=$element.attr("tabindex")||0;Utils.StoreData(
$element[0],"old-tabindex",tabindex);$element.attr("tabindex","-1");
var DataAdapter=this.options.get("dataAdapter");this.dataAdapter=new DataAdapter($element,
this.options);var $container=this.render();this._placeContainer($container);
var SelectionAdapter=this.options.get("selectionAdapter");this.selection=new SelectionAdapter(
$element,this.options);this.$selection=this.selection.render();this.selection.position(
this.$selection,$container);var DropdownAdapter=this.options.get("dropdownAdapter");
this.dropdown=new DropdownAdapter($element,this.options);this.$dropdown=this.dropdown.render();
this.dropdown.position(this.$dropdown,$container);var ResultsAdapter=this.options.get(
"resultsAdapter");this.results=new ResultsAdapter($element,this.options,this.dataAdapter);
this.$results=this.results.render();this.results.position(this.$results,this.$dropdown);
var self=this;this._bindAdapters();this._registerDomEvents();this._registerDataEvents();
this._registerSelectionEvents();this._registerDropdownEvents();this._registerResultsEvents();
this._registerEvents();this.dataAdapter.current(function(initialData){self.trigger(
"selection:update",{data:initialData})});$element.addClass("select2-hidden-accessible");
$element.attr("aria-hidden","true");this._syncAttributes();Utils.StoreData($element[0],"select2",
this);$element.data("select2",this)};Utils.Extend(Select2,Utils.Observable);
Select2.prototype._generateId=function($element){var id="";if($element.attr("id")!=null){
id=$element.attr("id")}else if($element.attr("name")!=null){id=$element.attr("name"
)+"-"+Utils.generateChars(2)}else{id=Utils.generateChars(4)}id=id.replace(/(:|\.|\[|\]|,)/g,"");
id="select2-"+id;return id};Select2.prototype._placeContainer=function($container){
$container.insertAfter(this.$element);var width=this._resolveWidth(this.$element,this.options.get(
"width"));if(width!=null){$container.css("width",width)}};Select2.prototype._resolveWidth=function(
$element,method){var WIDTH=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if(
method=="resolve"){var styleWidth=this._resolveWidth($element,"style");if(styleWidth!=null){
return styleWidth}return this._resolveWidth($element,"element")}if(method=="element"){
var elementWidth=$element.outerWidth(false);if(elementWidth<=0){return"auto"}
return elementWidth+"px"}if(method=="style"){var style=$element.attr("style");if(
typeof style!=="string"){return null}var attrs=style.split(";");for(var i=0,l=attrs.length;i<l;i=i+1
){var attr=attrs[i].replace(/\s/g,"");var matches=attr.match(WIDTH);if(
matches!==null&&matches.length>=1){return matches[1]}}return null}if(method=="computedstyle"){
var computedStyle=window.getComputedStyle($element[0]);return computedStyle.width}return method};
Select2.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container);
this.selection.bind(this,this.$container);this.dropdown.bind(this,this.$container);
this.results.bind(this,this.$container)};Select2.prototype._registerDomEvents=function(){
var self=this;this.$element.on("change.select2",function(){self.dataAdapter.current(function(data){
self.trigger("selection:update",{data:data})})});this.$element.on("focus.select2",function(evt){
self.trigger("focus",evt)});this._syncA=Utils.bind(this._syncAttributes,this);
this._syncS=Utils.bind(this._syncSubtree,this);if(this.$element[0].attachEvent){this.$element[0
].attachEvent("onpropertychange",this._syncA)}
var observer=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(
observer!=null){this._observer=new observer(function(mutations){self._syncA();self._syncS(null,
mutations)});this._observer.observe(this.$element[0],{attributes:true,childList:true,subtree:false})
}else if(this.$element[0].addEventListener){this.$element[0].addEventListener("DOMAttrModified",
self._syncA,false);this.$element[0].addEventListener("DOMNodeInserted",self._syncS,false);
this.$element[0].addEventListener("DOMNodeRemoved",self._syncS,false)}};
Select2.prototype._registerDataEvents=function(){var self=this;this.dataAdapter.on("*",function(name
,params){self.trigger(name,params)})};Select2.prototype._registerSelectionEvents=function(){
var self=this;var nonRelayEvents=["toggle","focus"];this.selection.on("toggle",function(){
self.toggleDropdown()});this.selection.on("focus",function(params){self.focus(params)});
this.selection.on("*",function(name,params){if($.inArray(name,nonRelayEvents)!==-1){return}
self.trigger(name,params)})};Select2.prototype._registerDropdownEvents=function(){var self=this;
this.dropdown.on("*",function(name,params){self.trigger(name,params)})};
Select2.prototype._registerResultsEvents=function(){var self=this;this.results.on("*",function(name,
params){self.trigger(name,params)})};Select2.prototype._registerEvents=function(){var self=this;
this.on("open",function(){self.$container.addClass("select2-container--open")});this.on("close",
function(){self.$container.removeClass("select2-container--open")});this.on("enable",function(){
self.$container.removeClass("select2-container--disabled")});this.on("disable",function(){
self.$container.addClass("select2-container--disabled")});this.on("blur",function(){
self.$container.removeClass("select2-container--focus")});this.on("query",function(params){if(
!self.isOpen()){self.trigger("open",{})}this.dataAdapter.query(params,function(data){self.trigger(
"results:all",{data:data,query:params})})});this.on("query:append",function(params){
this.dataAdapter.query(params,function(data){self.trigger("results:append",{data:data,query:params})
})});this.on("keypress",function(evt){var key=evt.which;if(self.isOpen()){if(
key===KEYS.ESC||key===KEYS.TAB||key===KEYS.UP&&evt.altKey){self.close(evt);evt.preventDefault()
}else if(key===KEYS.ENTER){self.trigger("results:select",{});evt.preventDefault()}else if(
key===KEYS.SPACE&&evt.ctrlKey){self.trigger("results:toggle",{});evt.preventDefault()}else if(
key===KEYS.UP){self.trigger("results:previous",{});evt.preventDefault()}else if(key===KEYS.DOWN){
self.trigger("results:next",{});evt.preventDefault()}}else{if(
key===KEYS.ENTER||key===KEYS.SPACE||key===KEYS.DOWN&&evt.altKey){self.open();evt.preventDefault()}}}
)};Select2.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop(
"disabled"));if(this.isDisabled()){if(this.isOpen()){this.close()}this.trigger("disable",{})}else{
this.trigger("enable",{})}};Select2.prototype._isChangeMutation=function(evt,mutations){
var changed=false;var self=this;if(evt&&evt.target&&(
evt.target.nodeName!=="OPTION"&&evt.target.nodeName!=="OPTGROUP")){return}if(!mutations){
changed=true}else if(mutations.addedNodes&&mutations.addedNodes.length>0){for(
var n=0;n<mutations.addedNodes.length;n++){var node=mutations.addedNodes[n];if(node.selected){
changed=true}}}else if(mutations.removedNodes&&mutations.removedNodes.length>0){changed=true
}else if($.isArray(mutations)){$.each(mutations,function(evt,mutation){if(self._isChangeMutation(evt
,mutation)){changed=true;return false}})}return changed};Select2.prototype._syncSubtree=function(evt
,mutations){var changed=this._isChangeMutation(evt,mutations);var self=this;if(changed){
this.dataAdapter.current(function(currentData){self.trigger("selection:update",{data:currentData})})
}};Select2.prototype.trigger=function(name,args){var actualTrigger=Select2.__super__.trigger;
var preTriggerMap={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",
clear:"clearing"};if(args===undefined){args={}}if(name in preTriggerMap){
var preTriggerName=preTriggerMap[name];var preTriggerArgs={prevented:false,name:name,args:args};
actualTrigger.call(this,preTriggerName,preTriggerArgs);if(preTriggerArgs.prevented){
args.prevented=true;return}}actualTrigger.call(this,name,args)};
Select2.prototype.toggleDropdown=function(){if(this.isDisabled()){return}if(this.isOpen()){
this.close()}else{this.open()}};Select2.prototype.open=function(){if(this.isOpen()){return}if(
this.isDisabled()){return}this.trigger("query",{})};Select2.prototype.close=function(evt){if(
!this.isOpen()){return}this.trigger("close",{originalEvent:evt})};
Select2.prototype.isEnabled=function(){return!this.isDisabled()};
Select2.prototype.isDisabled=function(){return this.options.get("disabled")};
Select2.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")};
Select2.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")};
Select2.prototype.focus=function(data){if(this.hasFocus()){return}this.$container.addClass(
"select2-container--focus");this.trigger("focus",{})};Select2.prototype.enable=function(args){if(
this.options.get("debug")&&window.console&&console.warn){console.warn(
'Select2: The `select2("enable")` method has been deprecated and will'+' be removed in later Select2 versions. Use $element.prop("disabled")'+" instead."
)}if(args==null||args.length===0){args=[true]}var disabled=!args[0];this.$element.prop("disabled",
disabled)};Select2.prototype.data=function(){if(this.options.get("debug"
)&&arguments.length>0&&window.console&&console.warn){console.warn(
'Select2: Data can no longer be set using `select2("data")`. You '+"should consider setting the value instead using `$element.val()`."
)}var data=[];this.dataAdapter.current(function(currentData){data=currentData});return data};
Select2.prototype.val=function(args){if(this.options.get("debug")&&window.console&&console.warn){
console.warn(
'Select2: The `select2("val")` method has been deprecated and will be'+" removed in later Select2 versions. Use $element.val() instead."
)}if(args==null||args.length===0){return this.$element.val()}var newVal=args[0];if($.isArray(newVal)
){newVal=$.map(newVal,function(obj){return obj.toString()})}this.$element.val(newVal).trigger(
"input").trigger("change")};Select2.prototype.destroy=function(){this.$container.remove();if(
this.$element[0].detachEvent){this.$element[0].detachEvent("onpropertychange",this._syncA)}if(
this._observer!=null){this._observer.disconnect();this._observer=null}else if(this.$element[0
].removeEventListener){this.$element[0].removeEventListener("DOMAttrModified",this._syncA,false);
this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,false);this.$element[0
].removeEventListener("DOMNodeRemoved",this._syncS,false)}this._syncA=null;this._syncS=null;
this.$element.off(".select2");this.$element.attr("tabindex",Utils.GetData(this.$element[0],
"old-tabindex"));this.$element.removeClass("select2-hidden-accessible");this.$element.attr(
"aria-hidden","false");Utils.RemoveData(this.$element[0]);this.$element.removeData("select2");
this.dataAdapter.destroy();this.selection.destroy();this.dropdown.destroy();this.results.destroy();
this.dataAdapter=null;this.selection=null;this.dropdown=null;this.results=null};
Select2.prototype.render=function(){var $container=$(
'<span class="select2 select2-container">'+'<span class="selection"></span>'+'<span class="dropdown-wrapper" aria-hidden="true"></span>'+"</span>"
);$container.attr("dir",this.options.get("dir"));this.$container=$container;
this.$container.addClass("select2-container--"+this.options.get("theme"));Utils.StoreData(
$container[0],"element",this.$element);return $container};return Select2});S2.define(
"select2/compat/utils",["jquery"],function($){function syncCssClasses($dest,$src,adapter){
var classes,replacements=[],adapted;classes=$.trim($dest.attr("class"));if(classes){
classes=""+classes;$(classes.split(/\s+/)).each(function(){if(this.indexOf("select2-")===0){
replacements.push(this)}})}classes=$.trim($src.attr("class"));if(classes){classes=""+classes;$(
classes.split(/\s+/)).each(function(){if(this.indexOf("select2-")!==0){adapted=adapter(this);if(
adapted!=null){replacements.push(adapted)}}})}$dest.attr("class",replacements.join(" "))}return{
syncCssClasses:syncCssClasses}});S2.define("select2/compat/containerCss",["jquery","./utils"],
function($,CompatUtils){function _containerAdapter(clazz){return null}function ContainerCSS(){}
ContainerCSS.prototype.render=function(decorated){var $container=decorated.call(this);
var containerCssClass=this.options.get("containerCssClass")||"";if($.isFunction(containerCssClass)){
containerCssClass=containerCssClass(this.$element)}var containerCssAdapter=this.options.get(
"adaptContainerCssClass");containerCssAdapter=containerCssAdapter||_containerAdapter;if(
containerCssClass.indexOf(":all:")!==-1){containerCssClass=containerCssClass.replace(":all:","");
var _cssAdapter=containerCssAdapter;containerCssAdapter=function(clazz){var adapted=_cssAdapter(
clazz);if(adapted!=null){return adapted+" "+clazz}return clazz}}var containerCss=this.options.get(
"containerCss")||{};if($.isFunction(containerCss)){containerCss=containerCss(this.$element)}
CompatUtils.syncCssClasses($container,this.$element,containerCssAdapter);$container.css(containerCss
);$container.addClass(containerCssClass);return $container};return ContainerCSS});S2.define(
"select2/compat/dropdownCss",["jquery","./utils"],function($,CompatUtils){function _dropdownAdapter(
clazz){return null}function DropdownCSS(){}DropdownCSS.prototype.render=function(decorated){
var $dropdown=decorated.call(this);var dropdownCssClass=this.options.get("dropdownCssClass")||"";if(
$.isFunction(dropdownCssClass)){dropdownCssClass=dropdownCssClass(this.$element)}
var dropdownCssAdapter=this.options.get("adaptDropdownCssClass");
dropdownCssAdapter=dropdownCssAdapter||_dropdownAdapter;if(dropdownCssClass.indexOf(":all:")!==-1){
dropdownCssClass=dropdownCssClass.replace(":all:","");var _cssAdapter=dropdownCssAdapter;
dropdownCssAdapter=function(clazz){var adapted=_cssAdapter(clazz);if(adapted!=null){
return adapted+" "+clazz}return clazz}}var dropdownCss=this.options.get("dropdownCss")||{};if(
$.isFunction(dropdownCss)){dropdownCss=dropdownCss(this.$element)}CompatUtils.syncCssClasses(
$dropdown,this.$element,dropdownCssAdapter);$dropdown.css(dropdownCss);$dropdown.addClass(
dropdownCssClass);return $dropdown};return DropdownCSS});S2.define("select2/compat/initSelection",[
"jquery"],function($){function InitSelection(decorated,$element,options){if(options.get("debug"
)&&window.console&&console.warn){console.warn(
"Select2: The `initSelection` option has been deprecated in favor"+" of a custom data adapter that overrides the `current` method. "+"This method is now called multiple times instead of a single "+"time when the instance is initialized. Support will be removed "+"for the `initSelection` option in future versions of Select2"
)}this.initSelection=options.get("initSelection");this._isInitialized=false;decorated.call(this,
$element,options)}InitSelection.prototype.current=function(decorated,callback){var self=this;if(
this._isInitialized){decorated.call(this,callback);return}this.initSelection.call(null,this.$element
,function(data){self._isInitialized=true;if(!$.isArray(data)){data=[data]}callback(data)})};
return InitSelection});S2.define("select2/compat/inputData",["jquery","../utils"],function($,Utils){
function InputData(decorated,$element,options){this._currentData=[];
this._valueSeparator=options.get("valueSeparator")||",";if($element.prop("type")==="hidden"){if(
options.get("debug")&&console&&console.warn){console.warn(
"Select2: Using a hidden input with Select2 is no longer "+"supported and may stop working in the future. It is recommended "+"to use a `<select>` element instead."
)}}decorated.call(this,$element,options)}InputData.prototype.current=function(_,callback){
function getSelected(data,selectedIds){var selected=[];if(data.selected||$.inArray(data.id,
selectedIds)!==-1){data.selected=true;selected.push(data)}else{data.selected=false}if(data.children
){selected.push.apply(selected,getSelected(data.children,selectedIds))}return selected}
var selected=[];for(var d=0;d<this._currentData.length;d++){var data=this._currentData[d];
selected.push.apply(selected,getSelected(data,this.$element.val().split(this._valueSeparator)))}
callback(selected)};InputData.prototype.select=function(_,data){if(!this.options.get("multiple")){
this.current(function(allData){$.map(allData,function(data){data.selected=false})});
this.$element.val(data.id);this.$element.trigger("input").trigger("change")}else{
var value=this.$element.val();value+=this._valueSeparator+data.id;this.$element.val(value);
this.$element.trigger("input").trigger("change")}};InputData.prototype.unselect=function(_,data){
var self=this;data.selected=false;this.current(function(allData){var values=[];for(
var d=0;d<allData.length;d++){var item=allData[d];if(data.id==item.id){continue}values.push(item.id)
}self.$element.val(values.join(self._valueSeparator));self.$element.trigger("input").trigger(
"change")})};InputData.prototype.query=function(_,params,callback){var results=[];for(
var d=0;d<this._currentData.length;d++){var data=this._currentData[d];var matches=this.matches(
params,data);if(matches!==null){results.push(matches)}}callback({results:results})};
InputData.prototype.addOptions=function(_,$options){var options=$.map($options,function($option){
return Utils.GetData($option[0],"data")});this._currentData.push.apply(this._currentData,options)};
return InputData});S2.define("select2/compat/matcher",["jquery"],function($){function oldMatcher(
matcher){function wrappedMatcher(params,data){var match=$.extend(true,{},data);if(
params.term==null||$.trim(params.term)===""){return match}if(data.children){for(
var c=data.children.length-1;c>=0;c--){var child=data.children[c];var doesMatch=matcher(params.term,
child.text,child);if(!doesMatch){match.children.splice(c,1)}}if(match.children.length>0){
return match}}if(matcher(params.term,data.text,data)){return match}return null}return wrappedMatcher
}return oldMatcher});S2.define("select2/compat/query",[],function(){function Query(decorated,
$element,options){if(options.get("debug")&&window.console&&console.warn){console.warn(
"Select2: The `query` option has been deprecated in favor of a "+"custom data adapter that overrides the `query` method. Support "+"will be removed for the `query` option in future versions of "+"Select2."
)}decorated.call(this,$element,options)}Query.prototype.query=function(_,params,callback){
params.callback=callback;var query=this.options.get("query");query.call(null,params)};return Query})
S2.define("select2/dropdown/attachContainer",[],function(){function AttachContainer(decorated,
$element,options){decorated.call(this,$element,options)}AttachContainer.prototype.position=function(
decorated,$dropdown,$container){var $dropdownContainer=$container.find(".dropdown-wrapper");
$dropdownContainer.append($dropdown);$dropdown.addClass("select2-dropdown--below");
$container.addClass("select2-container--below")};return AttachContainer});S2.define(
"select2/dropdown/stopPropagation",[],function(){function StopPropagation(){}
StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,
container,$container);var stoppedEvents=["blur","change","click","dblclick","focus","focusin",
"focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove",
"mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(stoppedEvents.join(" "),
function(evt){evt.stopPropagation()})};return StopPropagation});S2.define(
"select2/selection/stopPropagation",[],function(){function StopPropagation(){}
StopPropagation.prototype.bind=function(decorated,container,$container){decorated.call(this,
container,$container);var stoppedEvents=["blur","change","click","dblclick","focus","focusin",
"focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove",
"mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(stoppedEvents.join(" "),
function(evt){evt.stopPropagation()})};return StopPropagation});(function(factory){if(
typeof S2.define==="function"&&S2.define.amd){S2.define("jquery-mousewheel",["jquery"],factory)
}else if(typeof exports==="object"){module.exports=factory}else{factory(jQuery)}})(function($){
var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],
toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll",
"MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if(
$.event.fixHooks){for(var i=toFix.length;i;){$.event.fixHooks[toFix[--i]]=$.event.mouseHooks}}
var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener){
for(var i=toBind.length;i;){this.addEventListener(toBind[--i],handler,false)}}else{
this.onmousewheel=handler}$.data(this,"mousewheel-line-height",special.getLineHeight(this));$.data(
this,"mousewheel-page-height",special.getPageHeight(this))},teardown:function(){if(
this.removeEventListener){for(var i=toBind.length;i;){this.removeEventListener(toBind[--i],handler,
false)}}else{this.onmousewheel=null}$.removeData(this,"mousewheel-line-height");$.removeData(this,
"mousewheel-page-height")},getLineHeight:function(elem){var $elem=$(elem),$parent=$elem[
"offsetParent"in $.fn?"offsetParent":"parent"]();if(!$parent.length){$parent=$("body")}
return parseInt($parent.css("fontSize"),10)||parseInt($elem.css("fontSize"),10)||16},
getPageHeight:function(elem){return $(elem).height()},settings:{adjustOldDeltas:true,
normalizeOffset:true}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn
):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}});
function handler(event){var orgEvent=event||window.event,args=slice.call(arguments,1),delta=0,
deltaX=0,deltaY=0,absDelta=0,offsetX=0,offsetY=0;event=$.event.fix(orgEvent);event.type="mousewheel"
if("detail"in orgEvent){deltaY=orgEvent.detail*-1}if("wheelDelta"in orgEvent){
deltaY=orgEvent.wheelDelta}if("wheelDeltaY"in orgEvent){deltaY=orgEvent.wheelDeltaY}if(
"wheelDeltaX"in orgEvent){deltaX=orgEvent.wheelDeltaX*-1}if(
"axis"in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaX=deltaY*-1;deltaY=0}
delta=deltaY===0?deltaX:deltaY;if("deltaY"in orgEvent){deltaY=orgEvent.deltaY*-1;delta=deltaY}if(
"deltaX"in orgEvent){deltaX=orgEvent.deltaX;if(deltaY===0){delta=deltaX*-1}}if(
deltaY===0&&deltaX===0){return}if(orgEvent.deltaMode===1){var lineHeight=$.data(this,
"mousewheel-line-height");delta*=lineHeight;deltaY*=lineHeight;deltaX*=lineHeight}else if(
orgEvent.deltaMode===2){var pageHeight=$.data(this,"mousewheel-page-height");delta*=pageHeight;
deltaY*=pageHeight;deltaX*=pageHeight}absDelta=Math.max(Math.abs(deltaY),Math.abs(deltaX));if(
!lowestDelta||absDelta<lowestDelta){lowestDelta=absDelta;if(shouldAdjustOldDeltas(orgEvent,absDelta)
){lowestDelta/=40}}if(shouldAdjustOldDeltas(orgEvent,absDelta)){delta/=40;deltaX/=40;deltaY/=40}
delta=Math[delta>=1?"floor":"ceil"](delta/lowestDelta);deltaX=Math[deltaX>=1?"floor":"ceil"](
deltaX/lowestDelta);deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta);if(
special.settings.normalizeOffset&&this.getBoundingClientRect){
var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left;
offsetY=event.clientY-boundingRect.top}event.deltaX=deltaX;event.deltaY=deltaY;
event.deltaFactor=lowestDelta;event.offsetX=offsetX;event.offsetY=offsetY;event.deltaMode=0;
args.unshift(event,delta,deltaX,deltaY);if(nullLowestDeltaTimeout){clearTimeout(
nullLowestDeltaTimeout)}nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200);return(
$.event.dispatch||$.event.handle).apply(this,args)}function nullLowestDelta(){lowestDelta=null}
function shouldAdjustOldDeltas(orgEvent,absDelta){
return special.settings.adjustOldDeltas&&orgEvent.type==="mousewheel"&&absDelta%120===0}});
S2.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults",
"./select2/utils"],function($,_,Select2,Defaults,Utils){if($.fn.select2==null){var thisMethods=[
"open","close","destroy"];$.fn.select2=function(options){options=options||{};if(
typeof options==="object"){this.each(function(){var instanceOptions=$.extend(true,{},options);
var instance=new Select2($(this),instanceOptions)});return this}else if(typeof options==="string"){
var ret;var args=Array.prototype.slice.call(arguments,1);this.each(function(){
var instance=Utils.GetData(this,"select2");if(instance==null&&window.console&&console.error){
console.error(
"The select2('"+options+"') method was called on an "+"element that is not using Select2.")}
ret=instance[options].apply(instance,args)});if($.inArray(options,thisMethods)>-1){return this}
return ret}else{throw new Error("Invalid arguments for Select2: "+options)}}}if(
$.fn.select2.defaults==null){$.fn.select2.defaults=Defaults}return Select2});return{
define:S2.define,require:S2.require}}();var select2=S2.require("jquery.select2");
jQuery.fn.select2.amd=S2;return select2});
var invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;
var htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;var htmlCtrlEntityRegex=/&(newline|tab);/gi;
var ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;
var urlSchemeRegex=/^.+(:|&colon;)/gim;var relativeFirstCharacters=[".","/"];
function isRelativeUrlWithoutProtocol(url){return relativeFirstCharacters.indexOf(url[0])>-1}
function decodeHtmlCharacters(str){return str.replace(htmlEntitiesRegex,function(match,dec){
return String.fromCharCode(dec)})}function sanitizeUrl(url){var sanitizedUrl=decodeHtmlCharacters(
url||"").replace(htmlCtrlEntityRegex,"").replace(ctrlCharactersRegex,"").trim();if(!sanitizedUrl){
return"about:blank"}if(isRelativeUrlWithoutProtocol(sanitizedUrl)){return sanitizedUrl}
var urlSchemeParseResults=sanitizedUrl.match(urlSchemeRegex);if(!urlSchemeParseResults){
return sanitizedUrl}var urlScheme=urlSchemeParseResults[0];if(invalidProtocolRegex.test(urlScheme)){
return"about:blank"}return sanitizedUrl}window.sanitizeUrl=sanitizeUrl;(function(){"use strict";
var undef_type="undefined",string_type="string",nav={},String_ctr=String,
has_own_prop=Object.prototype.hasOwnProperty,load_queues={},localizations={},FALSE=!1,TRUE=!0,
browserless=FALSE,l10n_js_media_type=/^\s*application\/(?:vnd\.oftn\.|x-)?l10n\+json\s*(?:$|;)/i,XHR
,$locale="locale",$default_locale="defaultLocale",$to_locale_string="toLocaleString",
$to_lowercase="toLowerCase",array_index_of=Array.prototype.indexOf||function(item){
var len=this.length,i=0;for(;i<len;i++){if(i in this&&this[i]===item){return i}}return-1},
request_JSON=function(uri){if(browserless)return loadFromDisk(uri);var req=new XHR,data={};try{
req.open("GET",uri,FALSE);req.send(null)}catch(e){console.log(
"Localization Error: Unable to get localization data: "+uri,e)}try{data=JSON.parse(req.responseText)
}catch(e){setTimeout(function(){var l10n_err=new Error("Unable to load localization data: "+uri);
l10n_err.name="Localization Error";throw l10n_err},0)}return data},load=String_ctr[$to_locale_string
]=function(data){if(arguments.length>0&&typeof data!=="number"){if(typeof data===string_type){load(
request_JSON(data))}else if(data===FALSE){localizations={}}else{var locale,localization,message;for(
locale in data){if(has_own_prop.call(data,locale)){localization=data[locale];locale=locale[
$to_lowercase]();if(!(locale in localizations)||localization===FALSE){localizations[locale]={}}if(
localization===FALSE){continue}if(typeof localization===string_type){if(String_ctr[$locale][
$to_lowercase]().indexOf(locale)===0){localization=request_JSON(localization)}else{if(!(
locale in load_queues)){load_queues[locale]=[]}load_queues[locale].push(localization);continue}}for(
message in localization){if(has_own_prop.call(localization,message)){localizations[locale][message
]=localization[message]}}}}}}return Function.prototype[$to_locale_string].apply(String_ctr,arguments
)},loadFromDisk=String_ctr[$to_locale_string]=function(uri){var fs=require("fs");
var read=fs.readFileSync(uri,"utf8");return JSON.parse(read)},process_load_queue=function(locale){
var queue=load_queues[locale],i=0,len=queue.length,localization;for(;i<len;i++){localization={};
localization[locale]=request_JSON(queue[i]);load(localization)}delete load_queues[locale]},
use_default,localize=String_ctr.prototype[$to_locale_string]=function(){
var using_default=use_default,current_locale=String_ctr[using_default?$default_locale:$locale],
parts=current_locale[$to_lowercase]().split("-"),i=parts.length,this_val=this.valueOf(),locale;
use_default=FALSE;do{locale=parts.slice(0,i).join("-");if(locale in load_queues){process_load_queue(
locale)}if(locale in localizations&&this_val in localizations[locale]){return localizations[locale][
this_val]}}while(i--);if(!using_default&&String_ctr[$default_locale]){use_default=TRUE;
return localize.call(this_val)}return this_val};try{nav=self.navigator}catch(selfNotFoundException){
if(global.nav){nav=global.nav}else{
var nodeError="Problem setting nav in L10N. You are most likely running in a non-browser environment like Node."+'If this is the case, you can resolve this error by setting global.nav to an object which contains a "language"  field. '
throw new Error(nodeError)}browserless=TRUE}if(
!browserless&&typeof XMLHttpRequest===undef_type&&typeof ActiveXObject!==undef_type){
var AXO=ActiveXObject;XHR=function(){try{return new AXO("Msxml2.XMLHTTP.6.0")}catch(xhrEx1){}try{
return new AXO("Msxml2.XMLHTTP.3.0")}catch(xhrEx2){}try{return new AXO("Msxml2.XMLHTTP")}catch(
xhrEx3){}throw new Error("XMLHttpRequest not supported by this browser.")}}else{try{
XHR=XMLHttpRequest}catch(xhrEx4){if(global.XMLHttpRequest){XHR=global.XMLHttpRequest}else{
var nodeError="Problem setting XHR in L10N. You are most likely running in a non-browser environment like Node."+"If this is the case, you can resolve this error by setting global.XMLHttpRequest to a function which produces XMLHttpRequests. "+"\nTip: if you are using node, you might want to use the XHR2 package (usage: global.XMLHttpRequest = require('xhr2')"
throw new Error(nodeError)}}}String_ctr[$default_locale]=String_ctr[$default_locale]||"";String_ctr[
$locale]=nav&&(nav.language||nav.userLanguage)||"";document.documentElement.lang=window.langParam;
if(!browserless||typeof document!==undef_type){var elts=document.getElementsByTagName("link"),
i=elts.length,localization;while(i--){var elt=elts[i],rel=(elt.getAttribute("rel")||"")[
$to_lowercase]().split(/\s+/);if(l10n_js_media_type.test(elt.type)){if(array_index_of.call(rel,
"localizations")!==-1){load(elt.getAttribute("href"))}else if(array_index_of.call(rel,"localization"
)!==-1){localization={};localization[(elt.getAttribute("hreflang")||"")[$to_lowercase]()
]=elt.getAttribute("href");load(localization)}}}}else{if(global.l10NLocalFilePath){load(
global.l10NLocalFilePath)}else{
var nodeError="Problem loading localization file. You are most likely running in a non-browser environment like Node."+"If this is the case, you can resolve this error by setting global.l10NLocalFilePath to the path of your localization file. "
throw new Error(nodeError)}}})();(function(window){var DocUtil=function(){function DocUtil(){}
DocUtil.inlineStyleHelper=function(text,toBeReplaced,quotes){var startIndex=1;while(startIndex!==-1
){startIndex=text.indexOf(toBeReplaced);if(startIndex!==-1){var endIndex=text.indexOf(quotes,
startIndex+toBeReplaced.length+1);var subString=text.substr(startIndex,endIndex-startIndex+1);
text=text.replace(subString,"")}}return text};DocUtil.stripStyle=function(html){var startIndex=1;
while(startIndex!==-1){startIndex=html.indexOf("<style ");if(startIndex!==-1){
var endIndex=html.indexOf("</style>");var subString=html.substr(startIndex,
endIndex-startIndex+"</style>".length);html=html.replace(subString,"")}}html=this.inlineStyleHelper(
html,'style="','"');html=this.inlineStyleHelper(html,"style='","'");return html};
DocUtil.stripHTML=function(html){html=this.stripStyle(html);var tmp=(new DOMParser).parseFromString(
html,"text/html").body;return tmp.textContent.trim()||tmp.innerText.trim()||""};return DocUtil}();
var LocaleService=function(){function LocaleService(){this._globalDecimal=".";
this._globalMinusSign="-";this._initialized=false}
LocaleService.prototype.initializeNumberFormatting=function(){var _this=this;if(this._initialized
)return;this._initialized=true;if(typeof Intl!=="undefined"){try{var formatter=void 0;if(
app.UI.language.fromURL&&app.UI.language.fromURL!=="")formatter=new Intl.NumberFormat(
app.UI.language.fromURL);else formatter=new Intl.NumberFormat(window.L.Browser.lang);
formatter.formatToParts(-11.1).map(function(item){switch(item.type){case"decimal":
_this._globalDecimal=item.value;break;case"minusSign":_this._globalMinusSign=item.value;break}})
}catch(e){window.app.console.log("Exception parsing lang "+e)}}};
LocaleService.prototype.getDecimalSeparator=function(){return this._globalDecimal};
LocaleService.prototype.getMinusSign=function(){return this._globalMinusSign};return LocaleService}(
);var LayoutingService=function(){function LayoutingService(){this._requestedFrame=null;
this._layoutTasks=[];this._layoutTaskFlush=null;this.MAX_TASK_DURATION_MS=35;
this.MIN_TIMER_DELAY_MS=10}LayoutingService.prototype.appendLayoutingTask=function(task){
this._layoutTasks.push(task);this._scheduleLayouting()};
LayoutingService.prototype.hasTasksPending=function(){return this._layoutTasks.length>0};
LayoutingService.prototype.runTheTopTask=function(){var task=this._layoutTasks.shift();if(!task
)return false;try{task()}catch(ex){console.error("LayoutingTask exception: "+ex)}return true};
LayoutingService.prototype.cancelFrame=function(){if(this._requestedFrame
)window.cancelAnimationFrame(this._requestedFrame);this._requestedFrame=null};
LayoutingService.prototype._setupTimer=function(){this._layoutTaskFlush=setTimeout(
this._flushLayoutingQueue.bind(this),this.MIN_TIMER_DELAY_MS)};
LayoutingService.prototype._reachedTaskTimeout=function(start){var duration=performance.now()-start;
if(duration>this.MAX_TASK_DURATION_MS)return true;return false};
LayoutingService.prototype._flushLayoutingQueue=function(){var _this=this;this._layoutTaskFlush=null
if(!this.hasTasksPending())return;this._requestedFrame=window.requestAnimationFrame(function(){
_this._requestedFrame=null;var start=performance.now();while(_this.runTheTopTask()){if(
_this._reachedTaskTimeout(start)){_this._scheduleLayouting();return}}})};
LayoutingService.prototype._scheduleLayouting=function(){if(this._layoutTaskFlush)return;
this._setupTimer()};return LayoutingService}();var ServerConnectionService=function(){
function ServerConnectionService(){TileManager.appendAfterFirstTileTask(
this.onFirstTileReceived.bind(this))}ServerConnectionService.prototype.onBasicUI=function(){
app.console.debug("ServerConnectionService: onBasicUI")};
ServerConnectionService.prototype.onViewSetting=function(viewSetting){app.console.debug(
"ServerConnectionService: onViewSetting");if(!app.map){app.console.error(
"ServerConnectionService: missing map reference");return}var zoteroPlugin=app.map.zotero;
var zoteroAPIKey=viewSetting.zoteroAPIKey;if(
window.zoteroEnabled&&zoteroAPIKey&&!zoteroPlugin&&!window.mode.isMobile()){app.console.debug(
"ServerConnectionService: initialize Zotero plugin");zoteroPlugin=window.L.control.zotero(app.map);
zoteroPlugin.apiKey=zoteroAPIKey;app.map.zotero=zoteroPlugin;app.map.addControl(zoteroPlugin);
zoteroPlugin.updateUserID()}if(viewSetting.accessibilityState){app.console.debug(
"ServerConnectionService: initialize accessibility");app.map.lockAccessibilityOn()}};
ServerConnectionService.prototype.onSpecializedUI=function(docType){app.console.debug(
"ServerConnectionService: onSpecializedUI - "+docType);app.map.fire("initializedui")};
ServerConnectionService.prototype.onDocumentLoaded=function(){app.console.debug(
"ServerConnectionService: onDocumentLoaded")};
ServerConnectionService.prototype.onFirstTileReceived=function(){var _a,_b;app.console.debug(
"ServerConnectionService: onFirstTileReceived");if(!window.mode.isMobile()){var zoteroItems=[
"zoteroaddeditbibliography","zoterocontaineradd","zoterocontainerrefresh","zoteroSetDocPrefs",
"references-zoterosetdocprefs-break"];var isWriter=(_b=(_a=app.map
)===null||_a===void 0?void 0:_a._docLayer)===null||_b===void 0?void 0:_b.isWriter();if(
isWriter&&window.zoteroEnabled&&app.map.zotero){app.console.debug(
"ServerConnectionService: show UI for zotero");zoteroItems.forEach(function(id){
return app.map.uiManager.notebookbar.showItem(id)})}else{app.console.debug(
"ServerConnectionService: hide UI for zotero");zoteroItems.forEach(function(id){
return app.map.uiManager.notebookbar.hideItem(id)})}}app.map.uiManager.initializeLateComponents()};
ServerConnectionService.prototype.onNotebookbarInCoreInit=function(){app.console.debug(
"ServerConnectionService: onNotebookbarInCoreInit")};return ServerConnectionService}();window.app={
CSections:{},activeDocument:null,definitions:{},dpiScale:window.devicePixelRatio,
roundedDpiScale:Math.round(window.devicePixelRatio),canvasSize:null,viewId:null,isAdminUser:null,
calc:{cellAddress:null,cellCursorVisible:false,cellCursorRectangle:null,decimalSeparator:null,
otherCellCursors:{},splitCoordinate:null,partHashes:null,autoFilterCell:null,
pivotTableFilterCell:null},impress:{partList:null,notesMode:false,twipsCorrection:.567},map:null,
util:null,LOUtil:null,IconUtil:null,Evented:null,Log:null,DebugManager:null,dispatcher:null,
layoutingService:null,serverConnectionService:null,twipsToPixels:0,pixelsToTwips:0,
accessibilityState:false,UI:{language:{fromURL:window.langParam,fromBrowser:window.L.Browser.lang,
notebookbarAccessibility:null}},file:{editComment:false,allowManageRedlines:false,readOnly:true,
permission:"readonly",disableSidebar:false,textCursor:{visible:false,rectangle:null},
fileBasedView:false,writer:{pageRectangleList:[],multiPageView:false},exportFormats:[]},following:{
mode:"none",viewId:-1},tile:{size:null},socket:window.app.socket,console:window.app.console,
languages:[],favouriteLanguages:["de-DE","en-US","en-GB","es-ES","fr-FR","it","nl-NL","pt-BR",
"pt-PT","ru"],colorNames:null,colorPalettes:{StandardColors:{name:_("Standard"),colors:[[{
Value:"000000"},{Value:"111111"},{Value:"1C1C1C"},{Value:"333333"},{Value:"666666"},{Value:"808080"}
,{Value:"999999"},{Value:"B2B2B2"},{Value:"CCCCCC"},{Value:"DDDDDD"},{Value:"EEEEEE"},{
Value:"FFFFFF"}],[{Value:"FFFF00"},{Value:"FFBF00"},{Value:"FF8000"},{Value:"FF4000"},{
Value:"FF0000"},{Value:"BF0041"},{Value:"800080"},{Value:"55308D"},{Value:"2A6099"},{Value:"158466"}
,{Value:"00A933"},{Value:"81D41A"}],[{Value:"FFFFD7"},{Value:"FFF5CE"},{Value:"FFDBB6"},{
Value:"FFD8CE"},{Value:"FFD7D7"},{Value:"F7D1D5"},{Value:"E0C2CD"},{Value:"DEDCE6"},{Value:"DEE6EF"}
,{Value:"DEE7E5"},{Value:"DDE8CB"},{Value:"F6F9D4"}],[{Value:"FFFFA6"},{Value:"FFE994"},{
Value:"FFB66C"},{Value:"FFAA95"},{Value:"FFA6A6"},{Value:"EC9BA4"},{Value:"BF819E"},{Value:"B7B3CA"}
,{Value:"B4C7DC"},{Value:"B3CAC7"},{Value:"AFD095"},{Value:"E8F2A1"}],[{Value:"FFFF6D"},{
Value:"FFDE59"},{Value:"FF972F"},{Value:"FF7B59"},{Value:"FF6D6D"},{Value:"E16173"},{Value:"A1467E"}
,{Value:"8E86AE"},{Value:"729FCF"},{Value:"81ACA6"},{Value:"77BC65"},{Value:"D4EA6B"}],[{
Value:"FFFF38"},{Value:"FFD428"},{Value:"FF860D"},{Value:"FF5429"},{Value:"FF3838"},{Value:"D62E4E"}
,{Value:"8D1D75"},{Value:"6B5E9B"},{Value:"5983B0"},{Value:"50938A"},{Value:"3FAF46"},{
Value:"BBE33D"}],[{Value:"E6E905"},{Value:"E8A202"},{Value:"EA7500"},{Value:"ED4C05"},{
Value:"F10D0C"},{Value:"A7074B"},{Value:"780373"},{Value:"5B277D"},{Value:"3465A4"},{Value:"168253"}
,{Value:"069A2E"},{Value:"5EB91E"}],[{Value:"ACB20C"},{Value:"B47804"},{Value:"B85C00"},{
Value:"BE480A"},{Value:"C9211E"},{Value:"861141"},{Value:"650953"},{Value:"55215B"},{Value:"355269"}
,{Value:"1E6A39"},{Value:"127622"},{Value:"468A1A"}],[{Value:"706E0C"},{Value:"784B04"},{
Value:"7B3D00"},{Value:"813709"},{Value:"8D281E"},{Value:"611729"},{Value:"4E102D"},{Value:"481D32"}
,{Value:"383D3C"},{Value:"28471F"},{Value:"224B12"},{Value:"395511"}],[{Value:"443205"},{
Value:"472702"},{Value:"492300"},{Value:"4B2204"},{Value:"50200C"},{Value:"41190D"},{Value:"3B160E"}
,{Value:"3A1A0F"},{Value:"362413"},{Value:"302709"},{Value:"2E2706"},{Value:"342A06"}]]},
ThemeColors:{name:_("Theme colors"),colors:[]},DocumentColors:{name:_("Document colors"),colors:[]}
},colorLastSelection:{},serverAudit:null,events:null,showNavigator:false};
var activateValidation=false;if(activateValidation){var validator={set:function(obj,prop,value){obj[
prop]=value;console.log("window.app property changed: "+prop,value);return true}};
window.app=new Proxy(window.app,validator);window.app.file=new Proxy(window.app.file,validator)}
window.JSDialog={verbose:false};window.SlideShow={};window.addEventListener("load",function(){
app.calc.cellCursorRectangle=new cool.SimpleRectangle(0,0,0,0);
app.calc.cellAddress=new cool.SimplePoint(0,0);app.calc.splitCoordinate=new cool.SimplePoint(0,0);
app.file.textCursor.rectangle=new cool.SimpleRectangle(0,0,0,0);app.tile.size=new cool.SimplePoint(0
,0);app.pixelsToTwips=15;app.twipsToPixels=1/app.pixelsToTwips;app.tile.size.pX=app.tile.size.pY=256
});app.getViewRectangles=function(){if(app.map._docLayer._splitPanesContext
)return app.map._docLayer._splitPanesContext.getViewRectangles();else return[
app.activeDocument.activeView.viewedRectangle.clone()]};
app.isPointVisibleInTheDisplayedArea=function(twipsArray){if(app.map._docLayer._splitPanesContext){
let rectangles=app.map._docLayer._splitPanesContext.getViewRectangles();for(
let i=0;i<rectangles.length;i++){if(rectangles[i].containsPoint(twipsArray))return true}return false
}else{return app.activeDocument.activeView.viewedRectangle.containsPoint(twipsArray)}};
app.isXVisibleInTheDisplayedArea=function(twipsX){if(app.map._docLayer._splitPanesContext){
let rectangles=app.map._docLayer._splitPanesContext.getViewRectangles();for(
let i=0;i<rectangles.length;i++){if(rectangles[i].containsX(twipsX))return true}return false}else{
return app.activeDocument.activeView.viewedRectangle.containsX(twipsX)}};
app.isYVisibleInTheDisplayedArea=function(twipsY){if(app.map._docLayer._splitPanesContext){
let rectangles=app.map._docLayer._splitPanesContext.getViewRectangles();for(
let i=0;i<rectangles.length;i++){if(rectangles[i].containsY(twipsY))return true}return false}else{
return app.activeDocument.activeView.viewedRectangle.containsY(twipsY)}};
app.isRectangleVisibleInTheDisplayedArea=function(twipsArray){if(
app.map._docLayer._splitPanesContext){
let rectangles=app.map._docLayer._splitPanesContext.getViewRectangles();for(
let i=0;i<rectangles.length;i++){if(rectangles[i].intersectsRectangle(twipsArray))return true}
return false}else{return app.activeDocument.activeView.viewedRectangle.intersectsRectangle(
twipsArray)}};app.isXOrdinateInFrozenPane=function(pixelX){if(app.map._docLayer._splitPanesContext){
const splitPos=app.map._docLayer._splitPanesContext.getSplitPos();if(pixelX<splitPos.x
)return true;else return false}else return false};app.isYOrdinateInFrozenPane=function(pixelY){if(
app.map._docLayer._splitPanesContext){
const splitPos=app.map._docLayer._splitPanesContext.getSplitPos();if(pixelY<splitPos.y
)return true;else return false}else return false};app.isReadOnly=function(){return app.file.readOnly
};app.getScale=function(){return app.tile.size.pX/app.tile.size.x*15/app.dpiScale};
app.setCursorVisibility=function(visible){app.file.textCursor.visible=visible};
app.isCommentEditingAllowed=function(){return app.file.editComment};
app.isRedlineManagementAllowed=function(){return app.file.allowManageRedlines};
app.setPermission=function(permission){app.file.permission=permission;if(permission==="edit"){
app.file.readOnly=false;app.file.editComment=true;app.file.allowManageRedlines=true}else if(
permission==="readonly"){app.file.readOnly=true;app.file.editComment=false;
app.file.allowManageRedlines=false}};app.setCommentEditingPermission=function(isAllowed){
app.file.editComment=isAllowed};app.setRedlineManagementAllowed=function(isAllowed){
app.file.allowManageRedlines=isAllowed};app.getPermission=function(){return app.file.permission};
app.registerExportFormat=function(label,format){var duplicate=false;for(
var i=0;i<app.file.exportFormats.length;i++){if(app.file.exportFormats[i
].label==label&&app.file.exportFormats[i].format==format){duplicate=true;break}}if(duplicate==false
){app.file.exportFormats.push({label:label,format:format})}};app.getFollowedViewId=function(){
return app.following.viewId};app.setFollowingOff=function(){app.console.debug("user following: OFF")
app.following.mode="none";app.following.viewId=-1};app.setFollowingUser=function(viewId){
app.console.debug("user following: USER - "+viewId);app.following.mode="user";
app.following.viewId=viewId};app.setFollowingEditor=function(viewId=-1){app.console.debug(
"user following: EDITOR - "+viewId);app.following.mode="editor";app.following.viewId=viewId};
app.isFollowingOff=function(){return app.following.mode==="none"};app.isFollowingUser=function(){
return app.following.mode==="user"};app.isFollowingEditor=function(){
return app.following.mode==="editor"};app.updateFollowingUsers=function(){app.console.debug(
"user following: update");var isCellCursorVisible=app.calc.cellCursorVisible;
var isTextCursorVisible=app.file.textCursor.visible;if(isCellCursorVisible||isTextCursorVisible){
let twipsArray=[];if(isCellCursorVisible)twipsArray=[app.calc.cellCursorRectangle.x2,
app.calc.cellCursorRectangle.y2];else twipsArray=[app.file.textCursor.rectangle.x2,
app.file.textCursor.rectangle.y2];const cursorPositionInView=app.isPointVisibleInTheDisplayedArea(
twipsArray);if(parseInt(app.getFollowedViewId())===parseInt(app.map._docLayer._viewId
)&&!cursorPositionInView){app.setFollowingOff()}else if(parseInt(app.getFollowedViewId()
)===-1&&cursorPositionInView){app.setFollowingUser(parseInt(app.map._docLayer._viewId))}}};
app.showAsyncDownloadError=function(response,initialMsg){const reader=new FileReader;
const timeout=1e4;reader.onload=function(){if(reader.result==="wrong server"){initialMsg+=_(
", cluster configuration error: mis-matching serverid");app.map.uiManager.showSnackbar(initialMsg,""
,null,timeout)}else{app.map.uiManager.showSnackbar(initialMsg,"",null,timeout)}};reader.readAsText(
response)};app.calc.isRTL=function(){if(!app.map._docLayer||!app.map._docLayer._lastStatusJSON
)return false;const part=app.map._docLayer._lastStatusJSON.parts[app.map._docLayer._selectedPart];
if(part)return part.rtllayout!==0;else return false};app.setServerAuditFromCore=function(entries){
app.serverAudit=entries;app.map.fire("receivedserveraudit")};app.isExperimentalMode=function(){if(
app.socket&&app.socket.WSDServer&&app.socket.WSDServer.Options
)return app.socket.WSDServer.Options.indexOf("E")!==-1;return false};app.calc.isPartHidden=function(
part){if(!app.map._docLayer||!app.map._docLayer._lastStatusJSON)return false;if(
part>=app.map._docLayer._lastStatusJSON.parts.length)return false;
return app.map._docLayer._lastStatusJSON.parts[part].visible===0};app.calc.isPartProtected=function(
part){if(!app.map._docLayer||!app.map._docLayer._lastStatusJSON)return false;if(
part>=app.map._docLayer._lastStatusJSON.parts.length)return false;
return app.map._docLayer._lastStatusJSON.parts[part].protected===1};
app.calc.isAnyPartHidden=function(){if(!app.map._docLayer||!app.map._docLayer._lastStatusJSON
)return false;for(let i=0;i<app.map._docLayer._lastStatusJSON.parts.length;i++){if(
app.map._docLayer._lastStatusJSON.parts[i].visible===0)return true}return false};
app.calc.getHiddenPartCount=function(){if(!app.map._docLayer||!app.map._docLayer._lastStatusJSON
)return 0;let count=0;for(let i=0;i<app.map._docLayer._lastStatusJSON.parts.length;i++){if(
app.map._docLayer._lastStatusJSON.parts[i].visible===0)count++}return count};
app.calc.getVisiblePartCount=function(){if(!app.map._docLayer||!app.map._docLayer._lastStatusJSON
)return 0;let count=0;for(let i=0;i<app.map._docLayer._lastStatusJSON.parts.length;i++){if(
app.map._docLayer._lastStatusJSON.parts[i].visible===1)count++}return count};
app.calc.getHiddenPartNameArray=function(){if(!app.map._docLayer||!app.map._docLayer._lastStatusJSON
)return[];let array=[];for(let i=0;i<app.map._docLayer._lastStatusJSON.parts.length;i++){
let part=app.map._docLayer._lastStatusJSON.parts[i];if(part.visible===0)array.push(part.name)}
return array};app.impress.isSlideHidden=function(index){if(app.impress.partList){if(
app.impress.partList.length>index)return!app.impress.partList[index].visible;else{app.console.warn(
"Index is bigger than the part count (isSlideHidden): "+index);return true}}else return false};
app.impress.areAllSlidesHidden=function(){if(app.impress.partList){for(
let i=0;i<app.impress.partList.length;i++){if(app.impress.partList[i].visible===1)return false}
return true}else return false};app.impress.getSelectedSlidesCount=function(){let count=0;if(
app.impress.partList){for(let i=0;i<app.impress.partList.length;i++){if(app.impress.partList[i
].selected===1)count++}}return count};app.impress.getIndexFromSlideHash=function(hash){if(
app.impress.partList){for(let i=0;i<app.impress.partList.length;i++){if(app.impress.partList[i
].hash===hash)return i}app.console.warn("No part with hash (getIndexFromSlideHash): "+hash);return 0
}else return 0};app.impress.isSlideSelected=function(index){if(
app.impress.partList&&index>=0&&index<app.impress.partList.length){return app.impress.partList[index
].selected===1}else return false};var Dispatcher=function(){function Dispatcher(docType){if(
docType===void 0){docType=undefined}this.actionsMap={};
docType=docType?docType:app.map._docLayer._docType;this.addGeneralCommands();this.addExportCommands(
);if(docType==="text"){this.addWriterCommands();this.addZoteroCommands()}else if(
docType==="spreadsheet"){this.addCalcCommands()}else if(["presentation","drawing"].includes(docType)
){this.addImpressAndDrawCommands()}if(window.mode.isMobile())this.addMobileCommands()}
Dispatcher.prototype.addGeneralCommands=function(){var _this=this;this.actionsMap["save"]=function(
){if(!app.map.isReadOnlyMode()){app.map.fire("postMessage",{msgId:"UI_Save",args:{source:"toolbar"}}
);if(!app.map._disableDefaultAction["UI_Save"]){app.map.save(false,false)}}};this.actionsMap[
"closeapp"]=function(){if(window.ThisIsAMobileApp){window.postMobileMessage("BYE")}else{if(
app.map&&app.map.formulabar&&(app.map.formulabar.hasFocus()||app.map.formulabar.isInEditMode())){
_this.dispatch("acceptformula")}window.prefs.sendPendingBrowserSettingsUpdate();app.map.fire(
"postMessage",{msgId:"close",args:{EverModified:app.map._everModified,Deprecated:true}});
app.map.fire("postMessage",{msgId:"UI_Close",args:{EverModified:app.map._everModified}})}if(
!app.map._disableDefaultAction["UI_Close"])app.map.remove()};this.actionsMap["userlist"]=function(){
if(app.map.userList)app.map.userList.openDropdown()};this.actionsMap["print"]=function(){
app.map.print()};this.actionsMap["print-notespages"]=function(){var options={ExportNotesPages:{
type:"boolean",value:true},ExportOnlyNotesPages:{type:"boolean",value:true}};
var optionsString=JSON.stringify(options);app.map.print(optionsString)};this.actionsMap["repair"
]=function(){app.socket.sendMessage("commandvalues command=.uno:DocumentRepair")};this.actionsMap[
"remotelink"]=function(){app.map.fire("postMessage",{msgId:"UI_PickLink"})};this.actionsMap[
"remoteaicontent"]=function(){app.map.fire("postMessage",{msgId:"UI_InsertAIContent"})};
this.actionsMap["hyperlinkdialog"]=function(){app.map.sendUnoCommand(".uno:HyperlinkDialog")};
this.actionsMap["inserthyperlink"]=function(){app.map.sendUnoCommand(".uno:HyperlinkDialog")};
this.actionsMap["rev-history"]=function(){app.map.openRevisionHistory()};this.actionsMap["shareas"
]=function(){app.map.openShare()};this.actionsMap["savecomments"]=function(){if(
app.isCommentEditingAllowed()){app.map.fire("postMessage",{msgId:"UI_Save"});if(
!app.map._disableDefaultAction["UI_Save"]){app.map.save(false,false)}}};this.actionsMap[
"insertmultimedia"]=function(){window.L.DomUtil.get("insertmultimedia").click()};this.actionsMap[
"remotemultimedia"]=function(){app.map.fire("postMessage",{msgId:"UI_InsertFile",args:{
callback:"Action_InsertMultimedia",mimeTypeFilter:["video/MP2T","video/mp4","video/mpeg","video/ogg"
,"video/quicktime","video/webm","video/x-matroska","video/x-ms-wmv","video/x-msvideo","audio/aac",
"audio/flac","audio/mp4","audio/mpeg","audio/ogg","audio/x-wav"]}})};this.actionsMap[
"charmapcontrol"]=function(){app.map.sendUnoCommand(".uno:InsertSymbol")};this.actionsMap[
"closetablet"]=function(){app.map.uiManager.enterReadonlyOrClose()};this.actionsMap[
"toggledarktheme"]=function(){app.map.uiManager.toggleDarkMode()};this.actionsMap["invertbackground"
]=function(){app.map.uiManager.toggleInvert()};this.actionsMap["home-search"]=function(){
app.map.uiManager.focusSearch()};this.actionsMap["renamedocument"]=function(){
app.map.uiManager.renameDocument()};this.actionsMap["togglewasm"]=function(){
app.map.uiManager.toggleWasm()};this.actionsMap["languagemenu"]=function(){app.map.fire(
"morelanguages")};this.actionsMap["morelanguages-selection"]=function(){app.map.fire("morelanguages"
,{applyto:"selection"})};this.actionsMap["morelanguages-paragraph"]=function(){app.map.fire(
"morelanguages",{applyto:"paragraph"})};this.actionsMap["morelanguages-all"]=function(){
app.map.fire("morelanguages",{applyto:"all"})};this.actionsMap["localgraphic"]=function(){
window.L.DomUtil.get("insertgraphic").click()};this.actionsMap["remotegraphic"]=this.actionsMap[
"insertremotegraphic"]=function(){app.map.fire("postMessage",{msgId:"UI_InsertGraphic"})};
this.actionsMap["showhelp"]=function(){app.map.showHelp("online-help-content")};this.actionsMap[
"focustonotebookbar"]=function(){var tabsContainer=document.getElementsByClassName(
"notebookbar-tabs-container")[0].children[0];var elementToFocus;if(tabsContainer){for(
var i=0;i<tabsContainer.children.length;i++){if(tabsContainer.children[i].classList.contains(
"selected")){elementToFocus=tabsContainer.children[i];break}}}if(!elementToFocus
)elementToFocus=document.getElementById("Home-tab-label");elementToFocus.focus()};this.actionsMap[
"saveas"]=function(){if(app.map&&app.map.uiManager.getCurrentMode()==="notebookbar"){
app.map.openSaveAs()}};this.actionsMap["insertcomment"]=function(){app.map.insertComment()};
this.actionsMap["showcommentsnavigator"]=function(data){if(!document.getElementById(
"navigation-sidebar").classList.contains("visible"))app.map.sendUnoCommand(".uno:Navigator");
app.map.sendUnoCommand(".uno:NavigatorSelectComment?CommentId:short="+(data?data:0))};
this.actionsMap["zoomin"]=function(){app.map.zoomIn(1,null,true)};this.actionsMap["zoomout"
]=function(){app.map.zoomOut(1,null,true)};this.actionsMap["zoomreset"]=function(){app.map.setZoom(
app.map.options.zoom,null,true)};this.actionsMap["searchprev"]=function(){
app.searchService.searchPrevious()};this.actionsMap["searchnext"]=function(){
app.searchService.searchNext()};this.actionsMap["cancelsearch"]=function(){app.map.cancelSearch()};
this.actionsMap["showsearchbar"]=function(){$("#toolbar-down").hide();$("#showsearchbar"
).removeClass("over");$("#toolbar-search").show();window.L.DomUtil.get("search-input").focus()};
this.actionsMap["hidesearchbar"]=function(){$("#toolbar-search").hide();if(app.map.isEditMode())$(
"#toolbar-down").show();if(!app.isReadOnly()&&app.map.isReadOnlyMode())$("#mobile-edit-button").css(
"display","flex")};this.actionsMap["prev"]=function(){if(app.map._docLayer._docType==="text"
)app.map.goToPage("prev");else app.map.setPart("prev")};this.actionsMap["next"]=function(){if(
app.map._docLayer._docType==="text")app.map.goToPage("next");else app.map.setPart("next")};
this.actionsMap["inserttextbox"]=function(){app.map.sendUnoCommand(
".uno:Text?CreateDirectly:bool=true")};this.actionsMap["insertannotation"]=function(){
app.map.insertComment()};this.actionsMap["fold"]=this.actionsMap["hamburger-tablet"]=function(){
app.map.uiManager.toggleMenubar()};this.actionsMap["close"]=this.actionsMap["closemobile"]=function(
){app.map.uiManager.enterReadonlyOrClose()};this.actionsMap["serveraudit"]=function(){
app.map.serverAuditDialog.open()};this.actionsMap["togglea11ystate"]=function(){if(
app.map._lockAccessibilityOn){return}var prevAccessibilityState=window.prefs.getBoolean(
"accessibilityState");app.map.setAccessibilityState(!prevAccessibilityState)};this.actionsMap[
"toggleuimode"]=function(){if(app.map.uiManager.shouldUseNotebookbarMode()){
app.map.uiManager.onChangeUIMode({mode:"classic",force:true})}else{app.map.uiManager.onChangeUIMode(
{mode:"notebookbar",force:true})}};this.actionsMap["showruler"]=function(){
app.map.uiManager.toggleRuler()};this.actionsMap["showstatusbar"]=function(){
app.map.uiManager.toggleStatusBar()};this.actionsMap["collapsenotebookbar"]=function(){
app.map.uiManager.collapseNotebookbar()};this.actionsMap["scrollpreviewup"]=function(){
var stylePreview=document.getElementById("stylesview");stylePreview.scrollBy({
top:-stylePreview.offsetHeight,behavior:"smooth"})};this.actionsMap["scrollpreviewdown"]=function(){
var stylePreview=document.getElementById("stylesview");stylePreview.scrollBy({
top:stylePreview.offsetHeight,behavior:"smooth"})}};Dispatcher.prototype.addExportCommands=function(
){this.actionsMap["exportpdf"]=function(){app.map.sendUnoCommand(".uno:ExportToPDF",{SynchronMode:{
type:"boolean",value:false}})};this.actionsMap["exportdirectpdf"]=function(){app.map.sendUnoCommand(
".uno:ExportDirectToPDF",{SynchronMode:{type:"boolean",value:false}})};this.actionsMap["exportepub"
]=function(){app.map.sendUnoCommand(".uno:ExportToEPUB",{SynchronMode:{type:"boolean",value:false}})
}};Dispatcher.prototype.addCalcCommands=function(){this.actionsMap["acceptformula"]=function(){if(
window.mode.isMobile()){app.map.focus();app.map._docLayer.postKeyboardEvent("input",
app.map.keyboard.keyCodes.enter,app.map.keyboard._toUNOKeyCode(app.map.keyboard.keyCodes.enter))
}else{app.map.sendUnoCommand(".uno:AcceptFormula")}app.map.onFormulaBarBlur();
app.map.formulabarBlur();app.map.formulabarSetDirty()};this.actionsMap["cancelformula"]=function(){
app.map.sendUnoCommand(".uno:Cancel");app.map.onFormulaBarBlur();app.map.formulabarBlur();
app.map.formulabarSetDirty()};this.actionsMap["startformula"]=function(){app.map.sendUnoCommand(
".uno:StartFormula");app.map.onFormulaBarFocus();app.map.formulabarFocus();
app.map.formulabarSetDirty()};this.actionsMap["functiondialog"]=function(){if(window.mode.isMobile(
)&&app.map._functionWizardData){app.map._docLayer._closeMobileWizard();
app.map._docLayer._openMobileWizard(app.map._functionWizardData);app.map.formulabarSetDirty()}else{
app.map.sendUnoCommand(".uno:FunctionDialog")}};this.actionsMap["print-active-sheet"]=function(){
var currentSheet=app.map._docLayer._selectedPart+1;var options={ExportFormFields:{type:"boolean",
value:false},ExportNotes:{type:"boolean",value:false},SheetRange:{type:"string",
value:currentSheet+"-"+currentSheet}};var optionsString=JSON.stringify(options);app.map.print(
optionsString)};this.actionsMap["print-all-sheets"]=function(){app.map.print()};this.actionsMap[
"togglerelative"]=function(){app.map.sendUnoCommand(".uno:ToggleRelative")};this.actionsMap[
"focusonaddressinput"]=function(){document.getElementById("#addressInput input").focus()};
this.actionsMap["insertsheet"]=function(){var nPos=$("#spreadsheet-tab-scroll")[0].childElementCount
app.map.insertPage(nPos);app.map.insertPage.scrollToEnd=true};this.actionsMap["firstrecord"
]=function(){$("#spreadsheet-tab-scroll").scrollLeft(0)};this.actionsMap["nextrecord"]=function(){$(
"#spreadsheet-tab-scroll").scrollLeft($("#spreadsheet-tab-scroll").scrollLeft()+60)};
this.actionsMap["prevrecord"]=function(){$("#spreadsheet-tab-scroll").scrollLeft($(
"#spreadsheet-tab-scroll").scrollLeft()-30)};this.actionsMap["lastrecord"]=function(){
window.L.DomUtil.get("spreadsheet-tab-scroll").scrollLeft=1e5};this.actionsMap["columnrowhighlight"
]=function(){var newState=!app.map.uiManager.getHighlightMode();app.map.uiManager.setHighlightMode(
newState);if(newState)FocusCellSection.showFocusCellSection(
);else FocusCellSection.hideFocusCellSection();app.sectionContainer.requestReDraw()};
this.actionsMap["defaultborderstyle"]=function(){app.map.sendUnoCommand(
window.getBorderStyleUNOCommand(0,0,1,0,0,0,0))}};
Dispatcher.prototype.addImpressAndDrawCommands=function(){this.actionsMap["presentation"
]=this.actionsMap["fullscreen-presentation"]=function(){if(window.canvasSlideshowEnabled
)app.map.fire("newfullscreen");else app.map.fire("fullscreen")};this.actionsMap[
"presentation-currentslide"]=this.actionsMap["presentation-currentslide"]=function(){if(
window.canvasSlideshowEnabled)app.map.fire("newfullscreen",{
startSlideNumber:app.map.getCurrentPartNumber()});else app.map.fire("fullscreen",{
startSlideNumber:app.map.getCurrentPartNumber()})};this.actionsMap["presentinwindow"
]=this.actionsMap["present-in-window"]=function(){if(window.canvasSlideshowEnabled)app.map.fire(
"newpresentinwindow");else app.map.fire("presentinwindow")};this.actionsMap["followmepresentation"
]=this.actionsMap["presentation-follow-me"]=function(){app.map.slideShowPresenter.setLeader(true);
app.map.fire("newpresentinwindow")};this.actionsMap["presenterconsole"]=function(){if(
window.canvasSlideshowEnabled)app.map.fire("newpresentinconsole")};this.actionsMap[
"fullscreen-drawing"]=function(){app.util.toggleFullScreen()};this.actionsMap["deletepage"
]=function(){var msg;if(app.map.getDocType()==="presentation"){msg=_(
"Are you sure you want to delete this slide?")}else{msg=_(
"Are you sure you want to delete this page?")}app.map.uiManager.showInfoModal("deleteslide-modal",_(
"Delete"),msg,"",_("OK"),function(){app.map.deletePage()},true,"deleteslide-modal-response")};
this.actionsMap["previouspart"]=function(){app.map._docLayer._preview._scrollViewByDirection("prev")
};this.actionsMap["nextpart"]=function(){app.map._docLayer._preview._scrollViewByDirection("next")};
this.actionsMap["lastpart"]=function(){if(app&&app.file.fileBasedView===true){
var partToSelect=app.map._docLayer._parts-1;app.map._docLayer._preview._scrollViewToPartPosition(
partToSelect)}};this.actionsMap["firstpart"]=function(){if(app&&app.file.fileBasedView===true){
var partToSelect=0;app.map._docLayer._preview._scrollViewToPartPosition(partToSelect)}};
this.actionsMap["hideslide"]=function(){app.map.hideSlide()};this.actionsMap["showslide"]=function(
){app.map.showSlide()};this.actionsMap["duplicatepage"]=function(){app.map.duplicatePage()};
this.actionsMap["insertpage"]=function(){app.map.insertPage()};this.actionsMap["leftpara"]=function(
){app.map.sendUnoCommand(window.getUNOCommand({textCommand:".uno:LeftPara",
objectCommand:".uno:ObjectAlignLeft",unosheet:".uno:AlignLeft"}))};this.actionsMap["centerpara"
]=function(){app.map.sendUnoCommand(window.getUNOCommand({textCommand:".uno:CenterPara",
objectCommand:".uno:AlignCenter",unosheet:".uno:AlignHorizontalCenter"}))};this.actionsMap[
"rightpara"]=function(){app.map.sendUnoCommand(window.getUNOCommand({textCommand:".uno:RightPara",
objectCommand:".uno:ObjectAlignRight",unosheet:".uno:AlignRight"}))};this.actionsMap[
"selectbackground"]=function(){window.L.DomUtil.get("selectbackground").click()};this.actionsMap[
"notesmode"]=function(){if(app.impress.notesMode)app.map.sendUnoCommand(".uno:NormalMultiPaneGUI"
);else app.map.sendUnoCommand(".uno:NotesMode")}};Dispatcher.prototype.addZoteroCommands=function(){
this.actionsMap["zoteroaddeditcitation"]=function(){app.map.zotero.handleItemList()};
this.actionsMap["zoterosetdocprefs"]=function(){app.map.zotero.handleStyleList()};this.actionsMap[
"zoteroaddeditbibliography"]=function(){app.map.zotero.insertBibliography()};this.actionsMap[
"zoteroaddnote"]=function(){app.map.zotero.handleInsertNote()};this.actionsMap["zoterorefresh"
]=function(){app.map.zotero.refreshCitationsAndBib()};this.actionsMap["zoterounlink"]=function(){
app.map.zotero.unlinkCitations()}};Dispatcher.prototype.addWriterCommands=function(){
this.actionsMap[".uno:ShowResolvedAnnotations"]=function(){var items=app.map["stateChangeHandler"];
var val=items.getItemValue(".uno:ShowResolvedAnnotations");val=val==="true"||val===true;
app.map.showResolvedComments(!val)};this.actionsMap["showannotations"]=function(){var items=app.map[
"stateChangeHandler"];var val=items.getItemValue("showannotations");val=val==="true"||val===true;
app.map.showComments(!val)};this.actionsMap[".uno:AcceptAllTrackedChanges"]=function(){
app.map.sendUnoCommand(".uno:AcceptAllTrackedChanges");app.socket.sendMessage(
"commandvalues command=.uno:ViewAnnotations")};this.actionsMap[".uno:RejectAllTrackedChanges"
]=function(){app.map.sendUnoCommand(".uno:RejectAllTrackedChanges");
var commentSection=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);
commentSection.rejectAllTrackedCommentChanges()};this.actionsMap["toggletracking"]=function(){
var TrackChangesCurrentState=app.map["stateChangeHandler"].getItemValue(".uno:TrackChanges");if(
TrackChangesCurrentState==="true"||TrackChangesCurrentState===true)app.map.sendUnoCommand(
".uno:TrackChanges?TrackChanges:bool=false");else app.map.sendUnoCommand(
".uno:TrackChangesInAllViews")};this.actionsMap["acceptTrackedChangeToNext"]=function(){
app.map.sendUnoCommand(".uno:AcceptTrackedChangeToNext")};this.actionsMap[
"rejectTrackedChangeToNext"]=function(){app.map.sendUnoCommand(".uno:RejectTrackedChangeToNext")}};
Dispatcher.prototype.addMobileCommands=function(){this.actionsMap["comment_wizard"]=function(){
var configuration=window;if(configuration.commentWizard){configuration.commentWizard=false;
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).removeHighlighters();
app.map.fire("closemobilewizard");app.map.mobileTopBar.selectItem("comment_wizard",false)}else{if(
configuration.insertionMobileWizard)app.dispatcher.dispatch("insertion_mobile_wizard");else if(
configuration.mobileWizard)app.dispatcher.dispatch("mobile_wizard");configuration.commentWizard=true
var menuData=app.map._docLayer.getCommentWizardStructure();app.map.fire("mobilewizard",{
data:menuData});app.map.mobileTopBar.selectItem("comment_wizard",true)}};this.actionsMap[
"mobile_wizard"]=function(){var configuration=window;if(configuration.mobileWizard){
configuration.mobileWizard=false;app.map.sendUnoCommand(".uno:SidebarHide");app.map.fire(
"closemobilewizard");app.map.mobileTopBar.selectItem("mobile_wizard",false)}else{if(
configuration.insertionMobileWizard)app.dispatcher.dispatch("insertion_mobile_wizard");else if(
configuration.commentWizard)app.dispatcher.dispatch("comment_wizard");
configuration.mobileWizard=true;app.map.sendUnoCommand(".uno:SidebarShow");app.map.fire(
"showwizardsidebar");app.map.mobileTopBar.selectItem("mobile_wizard",true)}};this.actionsMap[
"insertion_mobile_wizard"]=function(){var configuration=window;if(
configuration.insertionMobileWizard){configuration.insertionMobileWizard=false;app.map.fire(
"closemobilewizard");app.map.mobileTopBar.selectItem("insertion_mobile_wizard",false)}else{if(
configuration.mobileWizard)app.dispatcher.dispatch("mobile_wizard");else if(
configuration.commentWizard)app.dispatcher.dispatch("comment_wizard");
configuration.insertionMobileWizard=true;var menuData=app.map.menubar.generateInsertMenuStructure();
app.map.fire("mobilewizard",{data:menuData});app.map.mobileTopBar.selectItem(
"insertion_mobile_wizard",true)}};this.actionsMap["fontcolor"]=function(){app.map.fire(
"mobilewizard",{data:window.getColorPickerData("Font Color")})};this.actionsMap["backcolor"
]=function(){app.map.fire("mobilewizard",{data:window.getColorPickerData("Highlight Color")})}};
Dispatcher.prototype.dispatch=function(action,data){if(app.map.dialog.hasOpenedDialog(
)||app.map.jsdialog&&app.map.jsdialog.hasDialogOpened()){app.map.dialog.blinkOpenDialog();
console.debug("Cannot dispatch: "+action+" when dialog is opened.");return}if(action.indexOf(
"saveas-")===0){var format=action.substring("saveas-".length);app.map.openSaveAs(format);return
}else if(action.indexOf("downloadas-")===0){var format=action.substring("downloadas-".length);
var fileName=app.map["wopi"].BaseFileName;fileName=fileName.substr(0,fileName.lastIndexOf("."));
fileName=fileName===""?"document":fileName;app.map.downloadAs(fileName+"."+format,format);return}if(
action.indexOf("exportas-")===0){var format=action.substring("exportas-".length);app.map.openSaveAs(
format);return}if(
action===".uno:Copy"||action===".uno:Cut"||action===".uno:Paste"||action===".uno:PasteSpecial"){
app.map._clip.filterExecCopyPaste(action);return}if(this.actionsMap[action]!==undefined){
this.actionsMap[action](data);return}console.error('unknown dispatch: "'+action+'"')};
return Dispatcher}();app.definitions["dispatcher"]=Dispatcher;var DocEvents=function(){
function DocEvents(){}DocEvents.prototype.initiate=function(){
this.container=document.getElementById(DocEvents.documentContainerId);if(!this.container
)console.error("DocEvents initation failed.");new ResizeObserver(this.fire.bind(this,"resize")
).observe(this.container)};DocEvents.prototype.fire=function(eventType,details){
var newEvent=new CustomEvent(eventType,{detail:details});this.container.dispatchEvent(newEvent)};
DocEvents.prototype.on=function(eventType,callback){this.container.addEventListener(eventType,
callback)};DocEvents.prototype.off=function(eventType,callback){this.container.removeEventListener(
eventType,callback)};DocEvents.documentContainerId="document-container";return DocEvents}();
app.definitions.events=DocEvents;app.events=new DocEvents;app.events.initiate();var cool;(function(
cool){var SimplePoint=function(){function SimplePoint(x,y){this._x=Math.round(x);this._y=Math.round(
y)}Object.defineProperty(SimplePoint.prototype,"x",{get:function(){return this._x},set:function(x){
this._x=Math.round(x)},enumerable:false,configurable:true});Object.defineProperty(
SimplePoint.prototype,"y",{get:function(){return this._y},set:function(y){this._y=Math.round(y)},
enumerable:false,configurable:true});SimplePoint.prototype.equals=function(point){
return this._x===Math.round(point[0])&&this._y===Math.round(point[1])};
SimplePoint.prototype.toArray=function(){return[this._x,this._y]};
SimplePoint.prototype.distanceTo=function(point){return Math.sqrt(Math.pow(this._x-point[0],2
)+Math.pow(this._y-point[1],2))};Object.defineProperty(SimplePoint.prototype,"pX",{get:function(){
return Math.round(this._x*app.twipsToPixels)},set:function(x){this._x=Math.round(x*app.pixelsToTwips
)},enumerable:false,configurable:true});Object.defineProperty(SimplePoint.prototype,"pY",{
get:function(){return Math.round(this._y*app.twipsToPixels)},set:function(y){this._y=Math.round(
y*app.pixelsToTwips)},enumerable:false,configurable:true});SimplePoint.prototype.pEquals=function(
point){return this.pX===Math.round(point[0])&&this.pY===Math.round(point[1])};
SimplePoint.prototype.pToArray=function(){return[this.pX,this.pY]};
SimplePoint.prototype.pDistanceTo=function(point){return Math.sqrt(Math.pow(this.pX-point[0],2
)+Math.pow(this.pY-point[1],2))};Object.defineProperty(SimplePoint.prototype,"cX",{get:function(){
return Math.round(this._x*app.twipsToPixels/app.dpiScale)},set:function(x){this._x=Math.round(
x*app.dpiScale*app.pixelsToTwips)},enumerable:false,configurable:true});Object.defineProperty(
SimplePoint.prototype,"cY",{get:function(){return Math.round(this._y*app.twipsToPixels/app.dpiScale)
},set:function(y){this._y=Math.round(y*app.dpiScale*app.pixelsToTwips)},enumerable:false,
configurable:true});SimplePoint.prototype.cEquals=function(point){return this.cX===Math.round(point[
0])&&this.cY===Math.round(point[1])};SimplePoint.prototype.cToArray=function(){return[this.cX,
this.cY]};SimplePoint.prototype.cDistanceTo=function(point){return Math.sqrt(Math.pow(this.cX-point[
0],2)+Math.pow(this.cY-point[1],2))};SimplePoint.prototype.clone=function(){return new SimplePoint(
this._x,this._y)};SimplePoint.fromCorePixels=function(point){return new SimplePoint(Math.round(
point[0]*app.pixelsToTwips),Math.round(point[1]*app.pixelsToTwips))};return SimplePoint}();
cool.SimplePoint=SimplePoint;var SimpleRectangle=function(){function SimpleRectangle(x,y,width,
height){this._x1=Math.round(x);this._y1=Math.round(y);this._width=Math.round(width);
this._height=Math.round(height)}Object.defineProperty(SimpleRectangle.prototype,"x1",{get:function(
){return this._x1},set:function(x1){this._x1=Math.round(x1)},enumerable:false,configurable:true});
Object.defineProperty(SimpleRectangle.prototype,"y1",{get:function(){return this._y1},set:function(
y1){this._y1=Math.round(y1)},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"x2",{get:function(){return this._x1+this._width},set:function(x2){
this._width=Math.round(x2)-this._x1},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"y2",{get:function(){return this._y1+this._height},set:function(y2){
this._height=Math.round(y2)-this._y1},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"width",{get:function(){return this._width},set:function(width){
this._width=Math.round(width)},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"height",{get:function(){return this._height},set:function(height){
this._height=Math.round(height)},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"area",{get:function(){return this._width*this._height},enumerable:false,
configurable:true});Object.defineProperty(SimpleRectangle.prototype,"center",{get:function(){return[
(this.x1+this.x2)/2,(this.y1+this.y2)/2]},enumerable:false,configurable:true});
SimpleRectangle.prototype.toArray=function(){return[this._x1,this._y1,this._width,this._height]};
SimpleRectangle.prototype.containsPoint=function(point){return Math.round(point[0]
)>=this.x1&&Math.round(point[0])<=this.x2&&Math.round(point[1])>=this.y1&&Math.round(point[1]
)<=this.y2};SimpleRectangle.prototype.containsX=function(x){return Math.round(x
)>=this.x1&&Math.round(x)<=this.x2};SimpleRectangle.prototype.containsY=function(y){
return Math.round(y)>=this.y1&&Math.round(y)<=this.y2};
SimpleRectangle.prototype.containsRectangle=function(rectangle){return this.containsPoint([
rectangle[0],rectangle[1]])&&this.containsPoint([rectangle[0]+rectangle[2],rectangle[1]+rectangle[3]
])};SimpleRectangle.prototype.intersectsRectangle=function(rectangle){
return app.LOUtil._doRectanglesIntersect(this.toArray(),rectangle)};
SimpleRectangle.prototype.equals=function(rectangle){return this.x1===Math.round(rectangle[0]
)&&this.y1===Math.round(rectangle[1])&&this.width===Math.round(rectangle[2]
)&&this.height===Math.round(rectangle[3])};SimpleRectangle.prototype.moveTo=function(point){
this._x1=Math.round(point[0]);this._y1=Math.round(point[1])};
SimpleRectangle.prototype.moveBy=function(point){this._x1+=Math.round(point[0]);
this._y1+=Math.round(point[1])};Object.defineProperty(SimpleRectangle.prototype,"pX1",{get:function(
){return Math.round(this._x1*app.twipsToPixels)},set:function(x1){this._x1=Math.round(
x1*app.pixelsToTwips)},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"pY1",{get:function(){return Math.round(this._y1*app.twipsToPixels)},
set:function(y1){this._y1=Math.round(y1*app.pixelsToTwips)},enumerable:false,configurable:true});
Object.defineProperty(SimpleRectangle.prototype,"pX2",{get:function(){return this.pX1+this.pWidth},
set:function(x2){this._width=Math.round(x2*app.pixelsToTwips)-this._x1},enumerable:false,
configurable:true});Object.defineProperty(SimpleRectangle.prototype,"pY2",{get:function(){
return this.pY1+this.pHeight},set:function(y2){this._height=Math.round(y2*app.pixelsToTwips
)-this._y1},enumerable:false,configurable:true});Object.defineProperty(SimpleRectangle.prototype,
"pWidth",{get:function(){return Math.round(this._width*app.twipsToPixels)},set:function(width){
this._width=Math.round(width*app.pixelsToTwips)},enumerable:false,configurable:true});
Object.defineProperty(SimpleRectangle.prototype,"pHeight",{get:function(){return Math.round(
this._height*app.twipsToPixels)},set:function(height){this._height=Math.round(
height*app.pixelsToTwips)},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"pArea",{get:function(){return this.pWidth*this.pHeight},enumerable:false,
configurable:true});Object.defineProperty(SimpleRectangle.prototype,"pCenter",{get:function(){
return[(this.pX1+this.pX2)/2,(this.pY1+this.pY2)/2]},enumerable:false,configurable:true});
SimpleRectangle.prototype.pToArray=function(){return[this.pX1,this.pY1,this.pWidth,this.pHeight]};
SimpleRectangle.prototype.pContainsPoint=function(point){return Math.round(point[0]
)>=this.pX1&&Math.round(point[0])<=this.pX2&&Math.round(point[1])>=this.pY1&&Math.round(point[1]
)<=this.pY2};SimpleRectangle.prototype.pContainsX=function(x){return Math.round(x
)>=this.pX1&&Math.round(x)<=this.pX2};SimpleRectangle.prototype.pContainsY=function(y){
return Math.round(y)>=this.pY1&&Math.round(y)<=this.pY2};
SimpleRectangle.prototype.pContainsRectangle=function(rectangle){return this.pContainsPoint([
rectangle[0],rectangle[1]])&&this.pContainsPoint([rectangle[0]+rectangle[2],rectangle[1]+rectangle[3
]])};SimpleRectangle.prototype.pIntersectsRectangle=function(rectangle){
return app.LOUtil._doRectanglesIntersect(this.pToArray(),rectangle)};
SimpleRectangle.prototype.pEquals=function(rectangle){return this.pX1===Math.round(rectangle[0]
)&&this.pY1===Math.round(rectangle[1])&&this.pWidth===Math.round(rectangle[2]
)&&this.pHeight===Math.round(rectangle[3])};SimpleRectangle.prototype.pMoveTo=function(point){
this._x1=Math.round(point[0]*app.pixelsToTwips);this._y1=Math.round(point[1]*app.pixelsToTwips)};
SimpleRectangle.prototype.pMoveBy=function(point){this._x1+=Math.round(point[0]*app.pixelsToTwips);
this._y1+=Math.round(point[1]*app.pixelsToTwips)};Object.defineProperty(SimpleRectangle.prototype,
"cX1",{get:function(){return Math.round(this._x1*app.twipsToPixels/app.dpiScale)},set:function(x1){
this._x1=Math.round(x1*app.dpiScale*app.pixelsToTwips)},enumerable:false,configurable:true});
Object.defineProperty(SimpleRectangle.prototype,"cY1",{get:function(){return Math.round(
this._y1*app.twipsToPixels/app.dpiScale)},set:function(y1){this._y1=Math.round(
y1*app.dpiScale*app.pixelsToTwips)},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"cX2",{get:function(){return this.cX1+this.cWidth},set:function(x2){
this._width=Math.round(x2*app.dpiScale*app.pixelsToTwips)},enumerable:false,configurable:true});
Object.defineProperty(SimpleRectangle.prototype,"cY2",{get:function(){return this.cY1+this.cHeight},
set:function(y2){this._height=Math.round(y2*app.dpiScale*app.pixelsToTwips)},enumerable:false,
configurable:true});Object.defineProperty(SimpleRectangle.prototype,"cWidth",{get:function(){
return Math.round(this._width*app.twipsToPixels/app.dpiScale)},set:function(width){
this._width=Math.round(width*app.dpiScale*app.pixelsToTwips)},enumerable:false,configurable:true});
Object.defineProperty(SimpleRectangle.prototype,"cHeight",{get:function(){return Math.round(
this._height*app.twipsToPixels/app.dpiScale)},set:function(height){this._height=Math.round(
height*app.dpiScale*app.pixelsToTwips)},enumerable:false,configurable:true});Object.defineProperty(
SimpleRectangle.prototype,"cArea",{get:function(){return this.cWidth*this.cHeight},enumerable:false,
configurable:true});Object.defineProperty(SimpleRectangle.prototype,"cCenter",{get:function(){
return[(this.cX1+this.cX2)/2,(this.cY1+this.cY2)/2]},enumerable:false,configurable:true});
SimpleRectangle.prototype.cToArray=function(){return[this.cX1,this.cY1,this.cWidth,this.cHeight]};
SimpleRectangle.prototype.cContainsPoint=function(point){return Math.round(point[0]
)>=this.cX1&&Math.round(point[0])<=this.cX2&&Math.round(point[1])>=this.cY1&&Math.round(point[1]
)<=this.cY2};SimpleRectangle.prototype.cContainsX=function(x){return Math.round(x
)>=this.cX1&&Math.round(x)<=this.cX2};SimpleRectangle.prototype.cContainsY=function(y){
return Math.round(y)>=this.cY1&&Math.round(y)<=this.cY2};
SimpleRectangle.prototype.cContainsRectangle=function(rectangle){return this.cContainsPoint([
rectangle[0],rectangle[1]])&&this.cContainsPoint([rectangle[0]+rectangle[2],rectangle[1]+rectangle[3
]])};SimpleRectangle.prototype.cIntersectsRectangle=function(rectangle){
return app.LOUtil._doRectanglesIntersect(this.cToArray(),rectangle)};
SimpleRectangle.prototype.cEquals=function(rectangle){return this.cX1===Math.round(rectangle[0]
)&&this.cY1===Math.round(rectangle[this.y1])&&this.cWidth===Math.round(rectangle[2]
)&&this.cHeight===Math.round(rectangle[3])};SimpleRectangle.prototype.cMoveTo=function(point){
this._x1=Math.round(point[0]*app.dpiScale*app.pixelsToTwips);this._y1=Math.round(point[1
]*app.dpiScale*app.pixelsToTwips)};SimpleRectangle.prototype.cMoveBy=function(point){
this._x1+=Math.round(point[0]*app.dpiScale*app.pixelsToTwips);this._y1+=Math.round(point[1
]*app.dpiScale*app.pixelsToTwips)};SimpleRectangle.prototype.clone=function(){
return new SimpleRectangle(this.x1,this.y1,this.width,this.height)};
SimpleRectangle.fromCorePixels=function(rectangle){return new SimpleRectangle(Math.round(rectangle[0
]*app.pixelsToTwips),Math.round(rectangle[1]*app.pixelsToTwips),Math.round(rectangle[2
]*app.pixelsToTwips),Math.round(rectangle[3]*app.pixelsToTwips))};return SimpleRectangle}();
cool.SimpleRectangle=SimpleRectangle;function rectanglesToPolygon(rectangles,converterConstant,
tolerance){if(converterConstant===void 0){converterConstant=1}if(tolerance===void 0){tolerance=5}
var rowArray=[];for(var i=0;i<rectangles.length;i++){var rectangle=rectangles[i];var found=false;
for(var j=0;j<rowArray.length;j++){var row=rowArray[j];if(Math.abs(row[0][1]-rectangle[1]
)<=tolerance){row.push(rectangle);found=true;break}}if(!found){rowArray.push([rectangle])}}
var finalRows=[];for(var i=0;i<rowArray.length;i++){var leftmost=rowArray[i][0][0];
var rightmost=rowArray[i][0][0]+rowArray[i][0][2];for(var j=1;j<rowArray[i].length;j++){
var rectangle=rowArray[i][j];if(rectangle[0]<leftmost){leftmost=rectangle[0]}if(rectangle[0
]+rectangle[2]>rightmost){rightmost=rectangle[0]+rectangle[2]}}finalRows.push([leftmost,rowArray[i][
0][1],rightmost-leftmost,rowArray[i][0][3]])}for(var i=0;i<finalRows.length;i++){for(
var j=i+1;j<finalRows.length;j++){if(finalRows[i][1]>finalRows[j][1]){var temp=finalRows[i];
finalRows[i]=finalRows[j];finalRows[j]=temp}}}var polygon=[];for(var i=0;i<finalRows.length;i++){if(
i===0){polygon.push(finalRows[i][0]+finalRows[i][2]);polygon.push(finalRows[i][1]);polygon.push(
finalRows[i][0]);polygon.push(finalRows[i][1]);polygon.push(finalRows[i][0]);polygon.push(finalRows[
i][1]+finalRows[i][3])}else{if(finalRows[i][0]!==polygon[polygon.length-2]||finalRows[i][1
]!==polygon[polygon.length-1]){polygon.push(finalRows[i][0]);polygon.push(finalRows[i][1])}
polygon.push(finalRows[i][0]);polygon.push(finalRows[i][1]+finalRows[i][3])}if(
i===finalRows.length-1){polygon.push(finalRows[i][0]+finalRows[i][2]);polygon.push(finalRows[i][1
]+finalRows[i][3])}}for(var i=finalRows.length-1;i>=0;i--){if(finalRows[i][0]+finalRows[i][2
]!==polygon[polygon.length-2]||finalRows[i][1]+finalRows[i][3]!==polygon[polygon.length-1]){
polygon.push(finalRows[i][0]+finalRows[i][2]);polygon.push(finalRows[i][1]+finalRows[i][3])}
polygon.push(finalRows[i][0]+finalRows[i][2]);polygon.push(finalRows[i][1])}if(converterConstant!==1
){for(var i=0;i<polygon.length;i++){polygon[i]=Math.round(converterConstant*polygon[i])}}
return polygon}cool.rectanglesToPolygon=rectanglesToPolygon})(cool||(cool={}));
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};var GraphicSelection=function(){
function GraphicSelection(){}GraphicSelection.hasActiveSelection=function(){
return this.rectangle!==null};GraphicSelection.onUpdatePermission=function(){this.rectangle=null;
this.updateGraphicSelection()};GraphicSelection.resetSelectionRanges=function(){this.rectangle=null;
this.extraInfo=null;if(this.handlesSection){this.handlesSection.removeSubSections();
app.sectionContainer.removeSection(this.handlesSection.name);this.handlesSection=null}};
GraphicSelection.onEmbeddedVideoContent=function(textMsg){if(!this.handlesSection)return;
var videoDesc=JSON.parse(textMsg);if(this.hasActiveSelection()){
videoDesc.width=this.rectangle.cWidth;videoDesc.height=this.rectangle.cHeight}
var routeTokenIndex=videoDesc.url.indexOf("%26RouteToken=");if(routeTokenIndex!=-1){
videoDesc.url=videoDesc.url.replace("%26RouteToken=","&amp;RouteToken=")}
var videoToInsert='<?xml version="1.0" encoding="UTF-8"?>\t\t<foreignObject xmlns="http://www.w3.org/2000/svg" overflow="visible" width="'+videoDesc.width+'" height="'+videoDesc.height+'">\t\t\t<body xmlns="http://www.w3.org/1999/xhtml">\t\t\t\t<video controls="controls" width="'+videoDesc.width+'" height="'+videoDesc.height+'">\t\t\t\t\t<source src="'+videoDesc.url+'" type="'+videoDesc.mimeType+'"/>\t\t\t\t</video>\t\t\t</body>\t\t</foreignObject>'
this.handlesSection.addEmbeddedVideo(videoToInsert)};GraphicSelection.renderDarkOverlay=function(){
var topLeft=new cool.Point(this.rectangle.pX1,this.rectangle.pY1);var bottomRight=new cool.Point(
this.rectangle.pX2,this.rectangle.pY2);if(app.map._docLayer.isCalcRTL()){topLeft.x=Math.abs(
topLeft.x);bottomRight.x=Math.abs(bottomRight.x)}var bounds=new cool.Bounds(topLeft,bottomRight);
app.map._docLayer._oleCSelections.setPointSet(CPointSet.fromBounds(bounds))};
GraphicSelection.convertObjectRectangleTwipsToPixels=function(){if(
this.extraInfo&&this.extraInfo.ObjectRectangles){for(
var i=0;i<this.extraInfo.ObjectRectangles.length;i++){for(var j=0;j<4;j++
)this.extraInfo.ObjectRectangles[i][j]*=app.twipsToPixels*app.impress.twipsCorrection}}};
GraphicSelection.extractAndSetGraphicSelection=function(messageJSON){
var signX=app.map._docLayer.isCalcRTL()?-1:1;var hasExtraInfo=messageJSON.length>5;
var hasGridOffset=false;var extraInfo=null;if(hasExtraInfo){extraInfo=messageJSON[5];if(
extraInfo.gridOffsetX||extraInfo.gridOffsetY){
app.map._docLayer._shapeGridOffset=new cool.SimplePoint(signX*extraInfo.gridOffsetX,
extraInfo.gridOffsetY);hasGridOffset=true}}signX=hasGridOffset&&app.map._docLayer.isCalcRTL()?-1:1;
this.rectangle=new cool.SimpleRectangle(signX*messageJSON[0],messageJSON[1],signX*messageJSON[2],
messageJSON[3]);if(hasGridOffset)this.rectangle.moveBy([app.map._docLayer._shapeGridOffset.x,
app.map._docLayer._shapeGridOffset.y]);this.extraInfo=extraInfo;if(
app.map._docLayer._docType==="presentation")this.convertObjectRectangleTwipsToPixels()};
GraphicSelection.transformGraphicSelection=function(messageJSON){var e_1,_a;var _b,_c;
var docLayer=app.map._docLayer;var verticalOffset=docLayer.getFiledBasedViewVerticalOffset();if(
!verticalOffset){return}messageJSON[1]+=verticalOffset;var extraInfo=messageJSON[5];var rectangle=(
_c=(_b=extraInfo===null||extraInfo===void 0?void 0:extraInfo.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.rectangle;if(!rectangle){return
}try{for(var _d=__values(["1","2","3","4","5","6","7","8"]),_e=_d.next();!_e.done;_e=_d.next()){
var key=_e.value;var y=parseInt(rectangle[key][0].point.y);rectangle[key][0
].point.y=y+verticalOffset}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(_e&&!_e.done&&(
_a=_d.return))_a.call(_d)}finally{if(e_1)throw e_1.error}}};
GraphicSelection.updateGraphicSelection=function(){if(this.hasActiveSelection()){if(
!JSDialog.IsAnyInputFocused())app.map.focus(app.file.textCursor.visible);
var editMode=app.map.isEditMode();if(!editMode){editMode=this.extraInfo&&this.extraInfo.isSignature}
if(!editMode){return}var extraInfo=this.extraInfo;var addHandlesSection=false;if(
!this.handlesSection)addHandlesSection=true;else if(
extraInfo.id!==this.handlesSection.sectionProperties.info.id){this.handlesSection.removeSubSections(
);app.sectionContainer.removeSection(this.handlesSection.name);this.handlesSection=null;
addHandlesSection=true}if(addHandlesSection){
this.handlesSection=new app.definitions.shapeHandlesSection({});app.sectionContainer.addSection(
this.handlesSection)}this.handlesSection.setPosition(this.rectangle.pX1,this.rectangle.pY1);
extraInfo.hasTableSelection=app.map._docLayer.hasTableSelection();this.handlesSection.refreshInfo(
this.extraInfo);this.handlesSection.setShowSection(true);app.sectionContainer.requestReDraw()
}else if(this.handlesSection&&app.sectionContainer.doesSectionExist(this.handlesSection.name)){
this.handlesSection.removeSubSections();app.sectionContainer.removeSection(this.handlesSection.name)
this.handlesSection=null}app.map._docLayer._updateCursorAndOverlay()};
GraphicSelection.onShapeSelectionContent=function(textMsg){textMsg=textMsg.substring(
"shapeselectioncontent:".length+1);var extraInfo=this.extraInfo;if(extraInfo&&extraInfo.id){
app.map._cacheSVG[extraInfo.id]=textMsg}if(
this.handlesSection&&this.handlesSection.sectionProperties.hasVideo)app.map._cacheSVG[extraInfo.id
]=undefined;else if(this.handlesSection)this.handlesSection.setSVG(textMsg)};
GraphicSelection.onMessage=function(textMsg){URLPopUpSection.closeURLPopUp();if(textMsg.match(
"EMPTY")){this.resetSelectionRanges()}else if(textMsg.match("INPLACE EXIT")){
app.map._docLayer._oleCSelections.clear()}else if(textMsg.match("INPLACE")){if(
app.map._docLayer._oleCSelections.empty()){textMsg="["+textMsg.substr("graphicselection:".length
)+"]";try{var msgData=JSON.parse(textMsg);if(msgData.length>1)this.extractAndSetGraphicSelection(
msgData)}catch(error){window.app.console.warn("cannot parse graphicselection command")}
this.renderDarkOverlay();this.rectangle=null;this.updateGraphicSelection()}}else{
textMsg="["+textMsg.substr("graphicselection:".length)+"]";msgData=JSON.parse(textMsg);
this.transformGraphicSelection(msgData);this.extractAndSetGraphicSelection(msgData);if(
!app.map._docLayer._oleCSelections.empty()){app.map._docLayer._oleCSelections.clear();
this.renderDarkOverlay()}this.selectionAngle=msgData.length>4?msgData[4]:0;if(this.extraInfo){
var dragInfo=this.extraInfo.dragInfo;if(dragInfo&&dragInfo.dragMethod==="PieSegmentDragging"){
dragInfo.initialOffset/=100;var dragDir=dragInfo.dragDirection;
dragInfo.dragDirection=app.map._docLayer._twipsToPixels(new cool.Point(dragDir[0],dragDir[1]));
dragDir=dragInfo.dragDirection;dragInfo.range2=dragDir.x*dragDir.x+dragDir.y*dragDir.y}}
var extraInfo=this.extraInfo;if(extraInfo){if(extraInfo.isDraggable===undefined
)extraInfo.isDraggable=true;if(extraInfo.isResizable===undefined)extraInfo.isResizable=true;if(
extraInfo.isRotatable===undefined)extraInfo.isRotatable=true}
var isFrame=extraInfo.type==601&&!extraInfo.isWriterGraphic;if(
!window.ThisIsTheiOSApp&&this.extraInfo.isDraggable&&!this.extraInfo.svg&&!isFrame){
app.socket.sendMessage("rendershapeselection mimetype=image/svg+xml")}if(
!app.map._docLayer.isWriter()&&this.rectangle&&app.map._docLayer._allowViewJump()){if((
!app.isPointVisibleInTheDisplayedArea([this.rectangle.x1,this.rectangle.y1]
)||!app.isPointVisibleInTheDisplayedArea([this.rectangle.x2,this.rectangle.y2])
)&&!TextSelections.getEndRectangle()&&!(app.isFollowingEditor()||app.isFollowingUser()
)&&!app.map.calcInputBarHasFocus()){app.map._docLayer.scrollToPos(new cool.SimplePoint(
this.rectangle.x1,this.rectangle.y1))}}}if(app.map._clip)app.map._clip.onComplexSelection("");if(
app.map._docLayer._selectionContentRequest)clearTimeout(app.map._docLayer._selectionContentRequest);
app.map._docLayer._onMessage("textselectioncontent:");this.updateGraphicSelection();if(
msgData&&msgData.length>5){var extraInfo=msgData[5];if(extraInfo.url!==undefined){
this.onEmbeddedVideoContent(JSON.stringify(extraInfo))}}};GraphicSelection.rectangle=null;
GraphicSelection.extraInfo=null;GraphicSelection.selectionAngle=0;
GraphicSelection.handlesSection=null;return GraphicSelection}();app.events.on("updatepermission",
GraphicSelection.onUpdatePermission.bind(GraphicSelection));
app.definitions.graphicSelection=GraphicSelection;var TextSelections=function(){
function TextSelections(){}TextSelections.initiate=function(){this.start=new TextSelectionHandle(
"selection_start_handle",30,44,new cool.SimplePoint(0,0),"text-selection-handle-start",false);
this.end=new TextSelectionHandle("selection_end_handle",30,44,new cool.SimplePoint(0,0),
"text-selection-handle-end",false);app.sectionContainer.addSection(this.start);
app.sectionContainer.addSection(this.end)};TextSelections.deactivate=function(){if(!this.active
)return;this.active=false;this.start.setShowSection(false);this.end.setShowSection(false)};
TextSelections.activate=function(){if(this.active)return;this.active=true;if(
this.startRectangle&&this.endRectangle){this.start.setShowSection(true);this.end.setShowSection(true
);this.updateMarkers()}};TextSelections.isActive=function(){return this.active};
TextSelections.showHandles=function(){if(this.start.isSectionShown())this.start.setOpacity(1);if(
this.end.isSectionShown())this.end.setOpacity(1)};TextSelections.hideHandles=function(){if(
this.start.isSectionShown())this.start.setOpacity(0);if(this.end.isSectionShown()
)this.end.setOpacity(0)};TextSelections.getStartRectangle=function(){
return this.startRectangle?this.startRectangle.clone():null};
TextSelections.getEndRectangle=function(){return this.endRectangle?this.endRectangle.clone():null};
TextSelections.setStartRectangle=function(rectangle){this.startRectangle=rectangle;
this.updateMarkers()};TextSelections.setEndRectangle=function(rectangle){this.endRectangle=rectangle
this.updateMarkers()};TextSelections.updateMarkers=function(){if(!this.isActive())return;if(
this.startRectangle===null||this.endRectangle===null)return;var startPos={x:this.startRectangle.pX1,
y:this.startRectangle.pY2};var endPos={x:this.endRectangle.pX1,y:this.endRectangle.pY2};if(
app.map._docLayer.isCalcRTL()){startPos.x=app.activeDocument.activeView.viewedRectangle.pX2-(
startPos.x-app.activeDocument.activeView.viewedRectangle.pX1);
endPos.x=app.activeDocument.activeView.viewedRectangle.pX2-(
endPos.x-app.activeDocument.activeView.viewedRectangle.pX1)}var oldStart=this.start.getPosition();
var oldEnd=this.end.getPosition();startPos.x-=30*app.dpiScale;this.start.setPosition(startPos.x,
startPos.y);var newStart=this.start.getPosition();this.end.setPosition(endPos.x,endPos.y);
var newEnd=this.end.getPosition();if(app.map._docLayer.isCalcRTL()&&(
newStart.y<newEnd.y||newStart.y<=newEnd.y&&newStart.x<newEnd.x)){this.start.setPosition(newEnd.pX,
newEnd.pY);this.end.setPosition(newStart.pX,newStart.pY)}else if(!app.map._docLayer.isCalcRTL()&&(
oldEnd.distanceTo(newStart.toArray())<20||oldStart.distanceTo(newEnd.toArray())<20)){
this.switchStartEndHandles()}};TextSelections.switchStartEndHandles=function(){var temp=this.start;
this.start=this.end;this.end=temp};TextSelections.dispose=function(){
app.sectionContainer.removeSection(this.start.name);app.sectionContainer.removeSection(this.end.name
)};TextSelections.startRectangle=null;TextSelections.endRectangle=null;TextSelections.active=false;
return TextSelections}();var CellSelectionMarkers=function(){function CellSelectionMarkers(){}
CellSelectionMarkers.initiate=function(){if(app.map._docLayer._docType!=="spreadsheet")return;
this.initiated=true;this.start=new CellSelectionHandle("cell_selection_handle_start");
this.end=new CellSelectionHandle("cell_selection_handle_end");app.sectionContainer.addSection(
this.start);app.sectionContainer.addSection(this.end)};CellSelectionMarkers.update=function(){if(
window.mode.isDesktop())return;if(!this.initiated)return;
var showMarkers=app.map._docLayer._cellSelectionArea||app.calc.cellCursorVisible;if(showMarkers){
this.start.setShowSection(true);this.end.setShowSection(true);
var cellRectangle=app.map._docLayer._cellSelectionArea?app.map._docLayer._cellSelectionArea.clone(
):app.calc.cellCursorRectangle.clone();var posStart=new cool.SimplePoint(cellRectangle.x1,
cellRectangle.y1);var posEnd=new cool.SimplePoint(cellRectangle.x2,cellRectangle.y2);
var offset=this.start.sectionProperties.circleRadius;this.start.setPosition(posStart.pX-offset,
posStart.pY-offset);this.end.setPosition(posEnd.pX-offset,posEnd.pY-offset)}else{
this.start.setShowSection(false);this.end.setShowSection(false)}};
CellSelectionMarkers.initiated=false;return CellSelectionMarkers}();var ScrollProperties=function(){
function ScrollProperties(){this.yOffset=0;this.verticalScrollLength=0;this.verticalScrollSize=0;
this.minimumVerticalScrollSize=80*app.roundedDpiScale;this.verticalScrollRatio=0;this.startY=0;
this.verticalScrollStep=0;this.xOffset=0;this.horizontalScrollLength=0;this.horizontalScrollSize=0;
this.minimumHorizontalScrollSize=80*app.roundedDpiScale;this.horizontalScrollRatio=0;this.startX=0;
this.horizontalScrollStep=0;this.usableThickness=20*app.roundedDpiScale;
this.horizontalScrollRightOffset=20;this.scrollBarThickness=6*app.roundedDpiScale;this.edgeOffset=0;
this.moveBy=null}return ScrollProperties}();var ViewLayoutBase=function(){function ViewLayoutBase(){
this.type="ViewLayoutBase";this.clientVisibleAreaCommand="";
this.scrollProperties=new ScrollProperties;this._viewedRectangle=new cool.SimpleRectangle(0,0,0,0);
this.lastViewedRectangle=new cool.SimpleRectangle(0,0,0,0);this._viewSize=new cool.SimplePoint(0,0)}
ViewLayoutBase.prototype.resetClientVisibleArea=function(){
this.lastViewedRectangle=new cool.SimpleRectangle(0,0,0,0)};
ViewLayoutBase.prototype.sendClientVisibleArea=function(forceUpdate){if(forceUpdate===void 0){
forceUpdate=false}if(!app.map._docLoaded)return;
var splitPos=app.map._docLayer._splitPanesContext?app.map._docLayer._splitPanesContext.getSplitPos(
):new cool.Point(0,0);var visibleArea=app.map.getPixelBounds();visibleArea=new cool.Bounds(
app.map._docLayer._pixelsToTwips(visibleArea.min),app.map._docLayer._pixelsToTwips(visibleArea.max))
splitPos=app.map._docLayer._corePixelsToTwips(splitPos);var size=visibleArea.getSize();
var visibleTopLeft=visibleArea.min;
var newClientVisibleAreaCommand="clientvisiblearea x="+Math.round(visibleTopLeft.x
)+" y="+Math.round(visibleTopLeft.y)+" width="+Math.round(size.x)+" height="+Math.round(size.y
)+" splitx="+Math.round(splitPos.x)+" splity="+Math.round(splitPos.y);if(
this.clientVisibleAreaCommand!==newClientVisibleAreaCommand||forceUpdate){if(
app.map._docLayer._ySplitter){app.map._docLayer._ySplitter.onPositionChange()}if(
app.map._docLayer._xSplitter){app.map._docLayer._xSplitter.onPositionChange()}
app.socket.sendMessage(newClientVisibleAreaCommand);if(app.map.contextToolbar
)app.map.contextToolbar.hideContextToolbar();if(
!app.map._fatal&&app.idleHandler._active&&app.socket.connected()
)this.clientVisibleAreaCommand=newClientVisibleAreaCommand}};
ViewLayoutBase.prototype.getLastPanDirection=function(){
var dx=this._viewedRectangle.pX1-this.lastViewedRectangle.pX1;
var dy=this._viewedRectangle.pY1-this.lastViewedRectangle.pY1;return[Math.sign(dx),Math.sign(dy)]};
Object.defineProperty(ViewLayoutBase.prototype,"viewedRectangle",{get:function(){
return this._viewedRectangle},set:function(rectangle){if(!this._viewedRectangle.equals(
rectangle.toArray()))this.lastViewedRectangle=this._viewedRectangle.clone();
this._viewedRectangle=rectangle;app.sectionContainer.onNewDocumentTopLeft();
app.sectionContainer.requestReDraw()},enumerable:false,configurable:true});Object.defineProperty(
ViewLayoutBase.prototype,"viewSize",{get:function(){return this._viewSize},set:function(size){
this._viewSize=size},enumerable:false,configurable:true});
ViewLayoutBase.prototype.getDocumentAnchorSection=function(){
return app.sectionContainer.getDocumentAnchorSection()};
ViewLayoutBase.prototype.calculateHorizontalScrollLength=function(documentAnchor){
var result=documentAnchor.size[0];this.scrollProperties.xOffset=documentAnchor.myTopLeft[0];if(
app.map._docLayer._docType!=="spreadsheet"){
this.scrollProperties.horizontalScrollLength=result-this.scrollProperties.horizontalScrollRightOffset
}else{var splitPanesContext=app.map.getSplitPanesContext();var splitPos={x:0,y:0};if(
splitPanesContext){splitPos=splitPanesContext.getSplitPos().clone();splitPos.x=Math.round(
splitPos.x*app.dpiScale)}this.scrollProperties.xOffset+=splitPos.x;
this.scrollProperties.horizontalScrollLength=result-splitPos.x-this.scrollProperties.horizontalScrollRightOffset
}};ViewLayoutBase.prototype.calculateVerticalScrollLength=function(documentAnchor){
var result=documentAnchor.size[1];this.scrollProperties.yOffset=documentAnchor.myTopLeft[1];if(
app.map._docLayer._docType!=="spreadsheet"){this.scrollProperties.verticalScrollLength=result}else{
var splitPanesContext=app.map.getSplitPanesContext();var splitPos={x:0,y:0};if(splitPanesContext){
splitPos=splitPanesContext.getSplitPos().clone();splitPos.y=Math.round(splitPos.y*app.dpiScale)}
this.scrollProperties.yOffset+=splitPos.y;
this.scrollProperties.verticalScrollLength=result-splitPos.y}};
ViewLayoutBase.prototype.refreshScrollProperties=function(){
var documentAnchor=this.getDocumentAnchorSection();this.calculateVerticalScrollLength(documentAnchor
);this.calculateHorizontalScrollLength(documentAnchor);
this.scrollProperties.verticalScrollSize=Math.round(Math.pow(
this.scrollProperties.verticalScrollLength,2)/app.activeDocument.activeView.viewSize.pY);
this.scrollProperties.horizontalScrollSize=Math.round(Math.pow(
this.scrollProperties.horizontalScrollLength,2)/app.activeDocument.activeView.viewSize.pX);if(
this.scrollProperties.horizontalScrollSize<this.scrollProperties.minimumHorizontalScrollSize
)this.scrollProperties.horizontalScrollSize=this.scrollProperties.minimumHorizontalScrollSize;if(
this.scrollProperties.verticalScrollSize<this.scrollProperties.minimumVerticalScrollSize
)this.scrollProperties.verticalScrollSize=this.scrollProperties.minimumVerticalScrollSize;
this.scrollProperties.horizontalScrollRatio=(
app.activeDocument.activeView.viewSize.pX-documentAnchor.size[0])/(
this.scrollProperties.horizontalScrollLength-this.scrollProperties.horizontalScrollSize);
this.scrollProperties.verticalScrollRatio=(
app.activeDocument.activeView.viewSize.pY-documentAnchor.size[1])/(
this.scrollProperties.verticalScrollLength-this.scrollProperties.verticalScrollSize);
this.scrollProperties.startX=app.activeDocument.activeView.viewedRectangle.pX1/this.scrollProperties.horizontalScrollRatio+this.scrollProperties.xOffset
this.scrollProperties.startY=app.activeDocument.activeView.viewedRectangle.pY1/this.scrollProperties.verticalScrollRatio+this.scrollProperties.yOffset
this.scrollProperties.verticalScrollStep=documentAnchor.size[1]/2;
this.scrollProperties.horizontalScrollStep=documentAnchor.size[0]/2};
ViewLayoutBase.prototype.scrollHorizontal=function(pX){var scrollProps=this.scrollProperties;
var control=scrollProps.moveBy?scrollProps.moveBy[0]:0;control/=scrollProps.horizontalScrollRatio;
var psX=pX/scrollProps.horizontalScrollRatio;if(document.documentElement.dir==="rtl")pX=-pX;
var endPosition=scrollProps.startX-scrollProps.xOffset+control+psX;if(pX>0){if(
endPosition+scrollProps.horizontalScrollSize>scrollProps.horizontalScrollLength)pX=(
scrollProps.horizontalScrollLength-scrollProps.horizontalScrollSize-scrollProps.startX+scrollProps.xOffset-control
)*scrollProps.horizontalScrollRatio;if(pX<0)pX=0}else{if(endPosition<0)pX=(
scrollProps.startX-scrollProps.xOffset+control)*-1*scrollProps.horizontalScrollRatio;if(pX>0)pX=0}
if(scrollProps.moveBy!==null)scrollProps.moveBy[0]+=pX;else scrollProps.moveBy=[pX,0]};
ViewLayoutBase.prototype.scrollVertical=function(pY){var scrollProps=this.scrollProperties;
var control=scrollProps.moveBy?scrollProps.moveBy[1]:0;control/=scrollProps.verticalScrollRatio;
var psY=pY/scrollProps.verticalScrollRatio;
var endPosition=scrollProps.startY-scrollProps.yOffset+control+psY;if(pY>0){if(
endPosition+scrollProps.verticalScrollSize>scrollProps.verticalScrollLength)pY=(
scrollProps.verticalScrollLength-scrollProps.verticalScrollSize-scrollProps.startY+scrollProps.yOffset-control
)*scrollProps.verticalScrollRatio;if(pY<0)pY=0}else{if(endPosition<0)pY=(
scrollProps.startY-scrollProps.yOffset+control)*-1*scrollProps.verticalScrollRatio;if(pY>0)pY=0}if(
scrollProps.moveBy!==null)scrollProps.moveBy[1]+=pY;else scrollProps.moveBy=[0,pY]};
ViewLayoutBase.prototype.canScrollHorizontal=function(documentAnchor){
return this.viewSize.pX>documentAnchor.size[0]};ViewLayoutBase.prototype.canScrollVertical=function(
documentAnchor){return this.viewSize.pY>documentAnchor.size[1]};
ViewLayoutBase.prototype.scroll=function(pX,pY){this.refreshScrollProperties();
var documentAnchor=this.getDocumentAnchorSection();if(pX!==0&&this.canScrollHorizontal(
documentAnchor))this.scrollHorizontal(pX);if(pY!==0&&this.canScrollVertical(documentAnchor)
)this.scrollVertical(pY);app.sectionContainer.requestReDraw()};
ViewLayoutBase.prototype.scrollTo=function(pX,pY){this.refreshScrollProperties();
this.scrollProperties.moveBy=null;pX-=this.viewedRectangle.pX1;pY-=this.viewedRectangle.pY1;
this.scroll(pX,pY)};return ViewLayoutBase}();var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var LayoutPageRectangle=function(_super){__extends(LayoutPageRectangle,_super);
function LayoutPageRectangle(){var _this=_super!==null&&_super.apply(this,arguments)||this;
_this.layoutX=0;_this.layoutY=0;_this.part=0;return _this}return LayoutPageRectangle}(
cool.SimpleRectangle);var MultiPageViewLayout=function(_super){__extends(MultiPageViewLayout,_super)
function MultiPageViewLayout(){var _this=_super.call(this)||this;_this.type="MultiPageViewLayout";
_this.gapBetweenPages=20;_this.availableWidth=0;_this.maxRowsSize=2;_this.layoutRectangles=Array();
return _this}MultiPageViewLayout.prototype.sendClientVisibleArea=function(){
var visibleArea=this.getVisibleAreaRectangle();
var visibleAreaCommand="clientvisiblearea x="+visibleArea.x1+" y="+visibleArea.y1+" width="+visibleArea.width+" height="+visibleArea.height
app.socket.sendMessage(visibleAreaCommand);return new cool.Bounds(new cool.Point(visibleArea.pX1,
visibleArea.pY1),new cool.Point(visibleArea.pX2,visibleArea.pY2))};
MultiPageViewLayout.prototype.resetViewLayout=function(){this.layoutRectangles.length=0;if(
app.file.writer.pageRectangleList.length===0)return;var canvasSize=app.sectionContainer.getViewSize(
);for(var i=0;i<app.file.writer.pageRectangleList.length;i++){
var temp=app.file.writer.pageRectangleList[i];this.layoutRectangles.push(new LayoutPageRectangle(
temp[0],temp[1],temp[2],temp[3]));var currentPageRectangle=this.layoutRectangles[i];
currentPageRectangle.part=i}var lastY=this.gapBetweenPages;this._viewSize.pX=canvasSize[0];for(
var i=0;i<this.layoutRectangles.length;i++){var x=0;var j=i;var totalWidth=0;var go=true;while(
go&&j-i<this.maxRowsSize&&j<this.layoutRectangles.length){var addition=this.layoutRectangles[j
].pWidth+this.gapBetweenPages;if(x+addition<canvasSize[0]||j===i){if(x+addition>canvasSize[0]){
go=false}x+=addition;totalWidth+=this.layoutRectangles[j].pWidth;j++}else go=false}if(x<canvasSize[0
]){var rowItemCount=j-i;var gap=(rowItemCount-1)*this.gapBetweenPages;var margin=(canvasSize[0
]-totalWidth+gap)*.5;var currentX=margin+app.activeDocument.activeView.viewedRectangle.pX1;
var maxY=0;for(var k=i;k<j;k++){this.layoutRectangles[k].layoutX=currentX;this.layoutRectangles[k
].layoutY=lastY;currentX+=this.layoutRectangles[k].pWidth+this.gapBetweenPages;maxY=Math.max(maxY,
this.layoutRectangles[k].pHeight)}lastY+=maxY+this.gapBetweenPages}else{if(x>this._viewSize.pX
)this._viewSize.pX=x+this.gapBetweenPages*2;this.layoutRectangles[i].layoutX=this.gapBetweenPages;
this.layoutRectangles[i].layoutY=lastY;lastY+=this.layoutRectangles[i].pHeight+this.gapBetweenPages}
i=j-1}this._viewSize.pY=Math.max(lastY,canvasSize[1])};
MultiPageViewLayout.prototype.getContainingPageRectangle=function(point){for(
var i=0;i<this.layoutRectangles.length;i++){if(this.layoutRectangles[i].containsPoint(point.toArray(
)))return this.layoutRectangles[i]}return null};
MultiPageViewLayout.prototype.viewPixelsToTwips=function(x,y){for(
var i=0;i<this.layoutRectangles.length;i++){var rectangle=this.layoutRectangles[i];var bounds=[
rectangle.layoutX-app.activeDocument.activeView.viewedRectangle.pX1,
rectangle.layoutY-app.activeDocument.activeView.viewedRectangle.pY1,rectangle.pWidth,
rectangle.pHeight];if(x>bounds[0]&&x<bounds[0]+bounds[2]){if(y>bounds[1]&&y<bounds[1]+bounds[3]){
return[Math.round((rectangle.pX1+(
x-rectangle.layoutX+app.activeDocument.activeView.viewedRectangle.pX1))*app.pixelsToTwips),
Math.round((rectangle.pY1+(y-rectangle.layoutY+app.activeDocument.activeView.viewedRectangle.pY1)
)*app.pixelsToTwips)]}}}return[-1,-1]};MultiPageViewLayout.prototype.twipsToViewPixels=function(x,y
){var point=new cool.SimplePoint(x,y);var containingRectangle=this.getContainingPageRectangle(point)
if(containingRectangle){return[containingRectangle.layoutX+(point.pX-containingRectangle.pX1
)-app.activeDocument.activeView.viewedRectangle.pX1,containingRectangle.layoutY+(
point.pY-containingRectangle.pY1)-app.activeDocument.activeView.viewedRectangle.pY1]}else return[0,0
]};MultiPageViewLayout.prototype.getVisibleAreaRectangle=function(){
var viewedRectangle=app.activeDocument.activeView.viewedRectangle.clone();
viewedRectangle.pWidth=this._viewSize.pX;viewedRectangle.pHeight=this._viewSize.pY;
var resultingRectangle=new cool.SimpleRectangle(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,
Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);for(var i=0;i<this.layoutRectangles.length;i++){
var rectangle=this.layoutRectangles[i];var controlRectangle=[rectangle.layoutX,rectangle.layoutY,
rectangle.pWidth,rectangle.pHeight];var intersection=LOUtil._getIntersectionRectangle(
viewedRectangle.pToArray(),controlRectangle);if(intersection){if(
resultingRectangle.pX1>rectangle.pX1)resultingRectangle.pX1=rectangle.pX1;if(
resultingRectangle.pY1>rectangle.pY1)resultingRectangle.pY1=rectangle.pY1;if(
resultingRectangle.pX2<rectangle.pX2)resultingRectangle.pX2=rectangle.pX2;if(
resultingRectangle.pY2<rectangle.pY2)resultingRectangle.pY2=rectangle.pY2}}
resultingRectangle.pX1-=TileManager.tileSize;resultingRectangle.pY1-=TileManager.tileSize;
resultingRectangle.pWidth+=TileManager.tileSize*2;resultingRectangle.pHeight+=TileManager.tileSize*2
return resultingRectangle};MultiPageViewLayout.prototype.reset=function(){if(
!app.file.writer.multiPageView||!app.file.writer.pageRectangleList.length)return;
this.resetViewLayout();app.map._docLayer._sendClientZoom();var bounds=this.sendClientVisibleArea();
TileManager.updateLayoutView(bounds)};return MultiPageViewLayout}(ViewLayoutBase);
var DocumentBase=function(){function DocumentBase(){this.type="DocumentBase";
this.activeView=new ViewLayoutBase;this._fileSize=new cool.SimplePoint(0,0)}Object.defineProperty(
DocumentBase.prototype,"fileSize",{get:function(){return this._fileSize},set:function(value){
this._fileSize=value},enumerable:false,configurable:true});return DocumentBase}();
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};function hex2string(inData,length){var hexified=[];
var data=new Uint8Array(inData);for(var i=0;i<length;i++){var hex=data[i].toString(16);
var paddedHex=("00"+hex).slice(-2);hexified.push(paddedHex)}return hexified.join("")}
var TileCoordData=function(){function TileCoordData(left,top,zoom,part,mode){if(zoom===void 0){
zoom=null}if(part===void 0){part=null}if(mode===void 0){mode=null}this.x=left;this.y=top;
this.z=zoom!==null?zoom:app.map.getZoom();this.part=part!==null?part:app.map._docLayer._selectedPart
this.mode=mode!==null?mode:0;this.scale=Math.pow(1.2,this.z-10)}
TileCoordData.prototype.getPos=function(){return new cool.Point(this.x,this.y)};
TileCoordData.prototype.key=function(){return this.x+":"+this.y+":"+this.z+":"+this.part+":"+(
this.mode!==undefined?this.mode:0)};TileCoordData.prototype.toString=function(){
return"{ left : "+this.x+", top : "+this.y+", z : "+this.z+", part : "+this.part+", mode : "+this.mode+" }"
};TileCoordData.parseKey=function(key){window.app.console.assert(typeof key==="string",
"key should be a string");var k=key.split(":");var mode=k.length===4?+k[4]:0;
window.app.console.assert(k.length>=5,"invalid key format");return new TileCoordData(+k[0],+k[1],+k[
2],+k[3],mode)};TileCoordData.keyToTileCoords=function(key){return TileCoordData.parseKey(key)};
return TileCoordData}();var PaneBorder=function(){function PaneBorder(paneBorder,paneXFixed,
paneYFixed){this._border=paneBorder;this._xFixed=paneXFixed;this._yFixed=paneYFixed;this._index=0}
PaneBorder.prototype.getBorderIndex=function(){return this._index};
PaneBorder.prototype.incBorderIndex=function(){this._index+=1};
PaneBorder.prototype.getBorderBounds=function(){return this._border};
PaneBorder.prototype.isXFixed=function(){return this._xFixed};
PaneBorder.prototype.isYFixed=function(){return this._yFixed};return PaneBorder}();
var Tile=function(){function Tile(coords){this.distanceFromView=0;this.image=null;this.rawDeltas=[];
this.deltaCount=0;this.updateCount=0;this.loadCount=0;this.gcErrors=0;this.missingContent=0;
this.invalidateCount=0;this.viewId=0;this.wireId=0;this.invalidFrom=0;this.deltaId=0;
this.lastPendingId=0;this.decompressedId=0;this.lastRendered=performance.timeOrigin;
this.lastRequestTime=undefined;this.coords=coords}Tile.prototype.hasContent=function(){
return!!this.image||this.hasKeyframe()};Tile.prototype.needsFetch=function(){
return this.invalidFrom>=this.wireId||!this.hasContent()};Tile.prototype.needsRehydration=function(
){if(this.rawDeltas.length===0)return false;var lastId=this.rawDeltas[this.rawDeltas.length-1].id;
return this.lastPendingId!==lastId};Tile.prototype.hasKeyframe=function(){
return!!this.rawDeltas.length};Tile.prototype.isReady=function(){
return this.decompressedId===this.lastPendingId};Tile.prototype.forceKeyframe=function(wireId){if(
wireId===void 0){wireId=0}this.wireId=wireId;this.invalidFrom=wireId;this.allowFastRequest()};
Tile.prototype.requestingTooFast=function(now){var tooFast=this.lastRequestTime&&now.getTime(
)-this.lastRequestTime.getTime()<5e3;return tooFast};Tile.prototype.updateLastRequest=function(now){
this.lastRequestTime=now};Tile.prototype.allowFastRequest=function(){this.updateLastRequest(
undefined)};Tile.prototype.isReadyToDraw=function(){return!!this.image};return Tile}();
var TileManager=function(){function TileManager(){}TileManager.initialize=function(){var _this=this;
if(window.Worker&&!window.ThisIsAMobileApp){window.app.console.info("Creating CanvasTileWorkers");
for(var i=0;i<4;++i){this.workers.push(new Worker(app.LOUtil.getURL("/src/layer/tile/TileWorker.js")
));this.workers[i].addEventListener("message",function(e){return _this.onWorkerMessage(e)});
this.workers[i].addEventListener("error",function(e){return _this.disableWorker(e)})}}};
TileManager.isReceivedFirstTile=function(){return this.receivedFirstTile};
TileManager.appendAfterFirstTileTask=function(task){this.afterFirstTileTasks.push(task)};
TileManager.updateOverlayMessages=function(){var e_1,_a;if(!app.map._debug.tileDataOn)return;
var totalSize=0;var n_bitmaps=0;var n_current=0;try{for(var _b=__values(this.tiles.values()),
_c=_b.next();!_c.done;_c=_b.next()){var tile=_c.value;if(tile.image)++n_bitmaps;if(
tile.distanceFromView===0)++n_current;totalSize+=tile.rawDeltas.reduce(function(a,c){
return a+c.length},0)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return)
)_a.call(_b)}finally{if(e_1)throw e_1.error}}var mismatch="";if(
n_bitmaps!=this.tileBitmapList.length)mismatch="\nmismatch! "+n_bitmaps+" vs. "+this.tileBitmapList;
app.map._debug.setOverlayMessage("top-tileMem","Tiles: "+String(this.tiles.size).padStart(4," "
)+", bitmaps: "+String(n_bitmaps).padStart(3," ")+" current "+String(n_current).padStart(3," "
)+", Delta size "+Math.ceil(totalSize/1024)+"(KB)"+", Bitmap size: "+Math.ceil(n_bitmaps/2
)+"(MB)"+mismatch)};TileManager.sortTileKeysByDistance=function(){var _this=this;return Array.from(
this.tiles.keys()).sort(function(a,b){return _this.tiles.get(b).distanceFromView-_this.tiles.get(a
).distanceFromView})};TileManager.garbageCollect=function(discardAll){var e_2,_a;if(
discardAll===void 0){discardAll=false}var highDeltaMemory=120*1024*1024;
var lowDeltaMemory=100*1024*1024;var highTileCount=2048;var lowTileCount=highTileCount-128;if(
discardAll){highDeltaMemory=0;lowDeltaMemory=0;highTileCount=0;lowTileCount=0}var totalSize=0;
var tileCount=0;try{for(var _b=__values(this.tiles.values()),_c=_b.next();!_c.done;_c=_b.next()){
var tile=_c.value;if(tile.distanceFromView!==0){totalSize+=tile.rawDeltas.reduce(function(a,c){
return a+c.length},0);tileCount++}}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(_c&&!_c.done&&(
_a=_b.return))_a.call(_b)}finally{if(e_2)throw e_2.error}}var sortedKeys=[];if(
totalSize>highDeltaMemory){var keys=this.sortTileKeysByDistance();sortedKeys=keys;for(
var i=0;i<keys.length&&totalSize>lowDeltaMemory;++i){var key=keys[i];var tile=this.tiles.get(key);
if(tile.rawDeltas.length&&tile.distanceFromView!==0){var rawDeltaSize=tile.rawDeltas.reduce(
function(a,c){return a+c.length},0);totalSize-=rawDeltaSize;if(this.debugDeltas
)window.app.console.log("Reclaim delta "+key+" memory: "+rawDeltaSize+" bytes");
this.reclaimTileBitmapMemory(tile);tile.rawDeltas=[];tile.forceKeyframe()}}}if(
tileCount>highTileCount){var keys=sortedKeys;if(!keys.length)keys=this.sortTileKeysByDistance();for(
var i=0;i<keys.length-lowTileCount;++i){var key=keys[i];var tile=this.tiles.get(key);if(
tile.distanceFromView!==0)this.removeTile(keys[i])}}};TileManager.setBitmapOnTile=function(tile,
bitmap){var highNumBitmaps=250;var assertChecks=false;if(tile.image){if(assertChecks
)window.app.console.assert(!!this.tileBitmapList.find(function(i){return i==tile}));
tile.image.close();tile.image=bitmap;return}if(assertChecks)window.app.console.assert(
!this.tileBitmapList.find(function(i){return i==tile}));if(this.tileBitmapList.length>highNumBitmaps
)this.reclaimTileBitmapMemory(this.tileBitmapList[this.tileBitmapList.length-1]);if(
tile.distanceFromView===0)this.tileBitmapList.unshift(tile);else{var low=0;
var high=this.tileBitmapList.length;var distance=tile.distanceFromView;while(low<high){
var mid=Math.floor((low+high)/2);if(this.tileBitmapList[mid].distanceFromView<distance
)low=mid+1;else high=mid}this.tileBitmapList.splice(low,0,tile)}tile.image=bitmap};
TileManager.sortTileBitmapList=function(){this.tileBitmapList.sort(function(a,b){
return a.distanceFromView-b.distanceFromView})};TileManager.getExpiryFactor=function(tile){
return this.tileBitmapList.indexOf(tile)/Math.max(this.tileBitmapList.length,1)};
TileManager.visibleTilesReady=function(){var e_3,_a;try{for(var _b=__values(this.tiles.values()),
_c=_b.next();!_c.done;_c=_b.next()){var tile=_c.value;if(
tile.distanceFromView===0&&tile.lastPendingId&&!tile.isReady())return false}}catch(e_3_1){e_3={
error:e_3_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_3)throw e_3.error}
}return true};TileManager.endTransactionHandleBitmaps=function(deltas,bitmaps){
var visibleRanges=this.getVisibleRanges();while(deltas.length){var delta=deltas.shift();
var bitmap=bitmaps.shift();var tile=this.tiles.get(delta.key);if(!tile)continue;
this.setBitmapOnTile(tile,bitmap);if(tile.isReady())this.tileReady(tile.coords,visibleRanges)}if(
this.pausedForCoherency&&this.visibleTilesReady()){app.sectionContainer.resumeDrawing();
this.pausedForCoherency=false}if(this.nPendingWorkerTasks===0)while(this.transactionCallbacks.length
)this.transactionCallbacks.pop()();this.garbageCollect()};TileManager.createTileBitmap=function(tile
,delta,deltas,bitmaps){var imageData=this.tileImageCache.get(tile.coords.toString());if(imageData){
var clampedData=new Uint8ClampedArray(imageData.buffer,imageData.byteOffset,imageData.byteLength);
var image=new ImageData(clampedData,this.tileSize,this.tileSize);bitmaps.push(createImageBitmap(
image,{premultiplyAlpha:"none"}));deltas.push(delta)}else{window.app.console.warn(
"Unusual: Tried to create a tile bitmap with no image data")}};
TileManager.decompressPendingDeltas=function(message){var e_4,_a;if(this.workers.length){
var deltaBuckets=[];for(var i=0;i<this.workers.length;++i){deltaBuckets.push([])}while(
this.pendingDeltas.length){var delta=this.pendingDeltas.shift();var bucket=Math.round(
delta.key.x/this.tileSize+delta.key.y/this.tileSize)%this.workers.length;delta.key=delta.key.key();
deltaBuckets[bucket].push(delta)}for(var i=0;i<this.workers.length;++i){var deltas=deltaBuckets[i];
var worker=this.workers[i];if(this.debugDeltas)window.app.console.debug(
"XXX delta bucket ("+i+") length: "+deltas.length);if(deltas.length){++this.nPendingWorkerTasks;
worker.postMessage({message:message,deltas:deltas,cachedTiles:this.tileImageCache,
tileSize:this.tileSize},deltas.map(function(x){return x.rawDelta.buffer}))}}}else{
++this.nPendingWorkerTasks;try{for(var _b=__values(this.pendingDeltas),_c=_b.next(
);!_c.done;_c=_b.next()){var delta=_c.value;delta.key=delta.key.key()}}catch(e_4_1){e_4={error:e_4_1
}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_4)throw e_4.error}}
this.onWorkerMessage({data:{message:"endTransaction",deltas:this.pendingDeltas,
tileSize:this.tileSize}})}this.pendingDeltas.length=0};TileManager.applyCompressedDelta=function(
tile,rawDeltas,isKeyframe,wireMessage,ids){if(this.inTransaction===0)window.app.console.warn(
"applyCompressedDelta called outside of transaction");var rawDelta=new Uint8Array(rawDeltas.reduce(
function(a,c){return a+c.length},0));rawDeltas.reduce(function(a,c){rawDelta.set(c.delta,a);
return a+c.length},0);var e={key:tile.coords,rawDelta:rawDelta,isKeyframe:isKeyframe,
wireMessage:wireMessage,ids:ids};tile.lastPendingId=ids[1];this.pendingDeltas.push(e)};
TileManager.checkTileMsgObject=function(msgObj){if(
typeof msgObj!=="object"||typeof msgObj.x!=="number"||typeof msgObj.y!=="number"||typeof msgObj.tileWidth!=="number"||typeof msgObj.tileHeight!=="number"||typeof msgObj.part!=="number"||typeof msgObj.mode!=="number"&&typeof msgObj.mode!=="undefined"
){window.app.console.error("Unexpected content in the parsed tile message.")}};
TileManager.checkDocLayer=function(){if(this._docLayer)return true;else if(
!this._docLayer&&app.map._docLayer){this._docLayer=app.map._docLayer;return true}else return false};
TileManager.getMaxTileCountToPrefetch=function(tileSize){var viewTileWidth=Math.floor((
this._pixelBounds.getSize().x+tileSize-1)/tileSize);var viewTileHeight=Math.floor((
this._pixelBounds.getSize().y+tileSize-1)/tileSize);return Math.ceil(viewTileWidth*viewTileHeight/4
)*(!this._hasEditPerm?4:1)};TileManager.updateProperties=function(){var updated=false;
var zoom=app.map.getZoom();if(this._zoom!==zoom){this._zoom=zoom;updated=true}
var part=this._docLayer._selectedPart;if(this._preFetchPart!==part){this._preFetchPart=part;
updated=true}var mode=this._docLayer._selectedMode;if(this._preFetchMode!==mode){
this._preFetchMode=mode;updated=true}var hasEditPerm=app.map.isEditMode();if(
this._hasEditPerm!==hasEditPerm){this._hasEditPerm=hasEditPerm;updated=true}
var center=app.map.getCenter();var pixelBounds=app.map.getPixelBoundsCore(center,this._zoom);if(
!this._pixelBounds||!pixelBounds.equals(this._pixelBounds)){this._pixelBounds=pixelBounds;
updated=true}var splitPanesContext=this._docLayer.getSplitPanesContext();
var splitPos=splitPanesContext?splitPanesContext.getSplitPos():new cool.Point(0,0);if(
!this._splitPos||!splitPos.equals(this._splitPos)){this._splitPos=splitPos;updated=true}
return updated};TileManager.computeBorders=function(){this._borders=[];
var tileRanges=this.pxBoundsToTileRanges(this._pixelBounds);
var splitPanesContext=this._docLayer.getSplitPanesContext();
var paneStatusList=splitPanesContext?splitPanesContext.getPanesProperties():[{xFixed:false,
yFixed:false}];window.app.console.assert(tileRanges.length===paneStatusList.length,
"tileRanges and paneStatusList should agree on the number of split-panes");for(
var paneIdx=0;paneIdx<tileRanges.length;++paneIdx){if(paneStatusList[paneIdx
].xFixed&&paneStatusList[paneIdx].yFixed){continue}var tileRange=tileRanges[paneIdx];
var paneBorder=new cool.Bounds(tileRange.min.add(new cool.Point(-1,-1)),tileRange.max.add(
new cool.Point(1,1)));this._borders.push(new PaneBorder(paneBorder,paneStatusList[paneIdx].xFixed,
paneStatusList[paneIdx].yFixed))}};TileManager.clearTilesPreFetcher=function(){if(
this._tilesPreFetcher!==undefined){clearInterval(this._tilesPreFetcher);
this._tilesPreFetcher=undefined}};TileManager.preFetchPartTiles=function(part,mode){
this.updateProperties();var tileRange=this.pxBoundsToTileRange(this._pixelBounds);
var tileCombineQueue=[];for(var j=tileRange.min.y;j<=tileRange.max.y;j++){for(
var i=tileRange.min.x;i<=tileRange.max.x;i++){var coords=new TileCoordData(i*this.tileSize,
j*this.tileSize,this._zoom,part,mode);if(!this.isValidTile(coords))continue;var key=coords.key();if(
!this.tileNeedsFetch(key))continue;tileCombineQueue.push(coords)}}this.sendTileCombineRequest(
tileCombineQueue)};TileManager.queueAcknowledgement=function(tileMsgObj){this.queuedProcessed.push(
+tileMsgObj.wireId)};TileManager.twipsToCoords=function(twips){return new TileCoordData(Math.round(
twips.x/twips.tileWidth)*this.tileSize,Math.round(twips.y/twips.tileHeight)*this.tileSize)};
TileManager.tileMsgToCoords=function(tileMsg){var coords=this.twipsToCoords(tileMsg);
coords.z=tileMsg.zoom;coords.part=tileMsg.part;coords.mode=tileMsg.mode!==undefined?tileMsg.mode:0;
return coords};TileManager.checkPointers=function(){if(app.map&&app.map._docLayer
)return true;else return false};TileManager.beginTransaction=function(){++this.inTransaction};
TileManager.getVisibleRanges=function(){var zoom=Math.round(app.map.getZoom());
var pixelBounds=app.map.getPixelBoundsCore(app.map.getCenter(),zoom);
return app.map._docLayer._splitPanesContext?app.map._docLayer._splitPanesContext.getPxBoundList(
pixelBounds):[pixelBounds]};TileManager.tileZoomIsCurrent=function(coords){var scale=Math.pow(1.2,
app.map.getZoom()-10);return Math.round(coords.scale*1e3)===Math.round(scale*1e3)};
TileManager.tileReady=function(coords,visibleRanges){var key=coords.key();var tile=this.tiles.get(
key);if(!tile)return;for(var i=tile.rawDeltas.length-1;i>0;--i){if(tile.rawDeltas[i].isKeyframe){
tile.rawDeltas=tile.rawDeltas.splice(i);break}}var emptyTilesCountChanged=false;if(
this.emptyTilesCount>0){this.emptyTilesCount-=1;emptyTilesCountChanged=true}if(
app.map&&emptyTilesCountChanged&&this.emptyTilesCount===0){app.map.fire("statusindicator",{
statusType:"alltilesloaded"})}var tileBounds=new cool.Bounds([tile.coords.x,tile.coords.y],[
tile.coords.x+this.tileSize,tile.coords.y+this.tileSize]);if(tileBounds.intersectsAny(visibleRanges)
)app.sectionContainer.requestReDraw()};TileManager.createTile=function(coords){var key=coords.key();
if(this.tiles.has(key)){if(this.debugDeltas)window.app.console.debug("Already created tile "+key);
return this.tiles.get(key)}var tile=new Tile(coords);this.tiles.set(key,tile);return tile};
TileManager.makeTileCurrent=function(tile){tile.distanceFromView=0;tile.allowFastRequest();
this.rehydrateTile(tile,false);return!tile.isReady()};TileManager.rehydrateTile=function(tile,
wireMessage){if(tile.needsRehydration()){if(tile.distanceFromView===0&&!this.pausedForCoherency){
app.sectionContainer.pauseDrawing();this.pausedForCoherency=true}if(this.debugDeltas
)window.app.console.log("Restoring a tile from cached delta at "+tile.coords.key());var firstDelta=0
for(var i=tile.rawDeltas.length-1;i>0;--i){if(tile.rawDeltas[i].isKeyframe){firstDelta=i;break}}if(
tile.lastPendingId>tile.rawDeltas[firstDelta].id){var continuedIdIndex=tile.rawDeltas.findIndex(
function(d){return d.id===tile.lastPendingId});if(continuedIdIndex!==-1
)firstDelta=continuedIdIndex+1}var rawDeltas=tile.rawDeltas.slice(firstDelta);
var lastId=tile.rawDeltas[tile.rawDeltas.length-1].id;this.applyCompressedDelta(tile,rawDeltas,
tile.rawDeltas[firstDelta].isKeyframe,wireMessage,[tile.rawDeltas[firstDelta].id,lastId])}};
TileManager.endTransaction=function(callback){if(callback===void 0){callback=null}if(
this.inTransaction===0){window.app.console.error("Mismatched endTransaction");return}
--this.inTransaction;if(callback)this.transactionCallbacks.push(callback);if(this.inTransaction!==0
)return;if(!this.pendingDeltas.length){if(callback){this.transactionCallbacks.pop();callback()}
return}try{this.decompressPendingDeltas("endTransaction")}catch(e){window.app.console.error(
"Failed to decompress pending deltas");this.inTransaction=0;this.disableWorker(e);if(callback
)callback();return}};TileManager.disableWorker=function(e){if(e===void 0){e=null}if(e
)window.app.console.error("Worker-related error encountered",e);if(!this.workers.length)return;
window.app.console.warn("Disabling worker threads");while(this.workers.length){
var worker=this.workers.shift();try{worker.terminate()}catch(e){window.app.console.error(
"Error terminating worker thread",e)}}this.pendingDeltas.length=0;this.nPendingWorkerTasks=0;while(
this.transactionCallbacks.length)this.transactionCallbacks.pop()();this.redraw()};
TileManager.applyDelta=function(tile,rawDeltas,deltas,keyframeDeltaSize,keyframeImage){var e_5,_a;
var rawDeltaSize=rawDeltas.reduce(function(a,c){return a+c.length},0);if(this.debugDeltas){
var hexStrings=[];try{for(var rawDeltas_1=__values(rawDeltas),rawDeltas_1_1=rawDeltas_1.next(
);!rawDeltas_1_1.done;rawDeltas_1_1=rawDeltas_1.next()){var rawDelta=rawDeltas_1_1.value;
hexStrings.push(hex2string(rawDelta,rawDelta.length))}}catch(e_5_1){e_5={error:e_5_1}}finally{try{
if(rawDeltas_1_1&&!rawDeltas_1_1.done&&(_a=rawDeltas_1.return))_a.call(rawDeltas_1)}finally{if(e_5
)throw e_5.error}}var hexString=hexStrings.join("");window.app.console.log("Applying a raw "+(
keyframeDeltaSize?"keyframe":"delta")+" of length "+rawDeltaSize+(
this.debugDeltasDetail?" hex: "+hexString:""))}var traceEvent=app.socket.createCompleteTraceEvent(
"L.CanvasTileLayer.applyDelta",{keyFrame:!!keyframeDeltaSize,length:rawDeltaSize});
var key=tile.coords.toString();var imgData=keyframeImage?keyframeImage:this.tileImageCache.get(key);
if(!imgData){window.app.console.error("Trying to apply delta with no image data cache");return}
cool.CanvasTileUtils.updateImageFromDeltas(imgData,deltas,keyframeDeltaSize,this.tileSize,
this.debugDeltas);this.tileImageCache.set(key,imgData);if(traceEvent)traceEvent.finish()};
TileManager.removeTile=function(key){var tile=this.tiles.get(key);if(!tile)return;if(
!tile.hasContent()&&this.emptyTilesCount>0)this.emptyTilesCount-=1;this.reclaimTileBitmapMemory(tile
);this.tiles.delete(key)};TileManager.removeAllTiles=function(){var e_6,_a;this.tileBitmapList=[];
try{for(var _b=__values(Array.from(this.tiles.keys())),_c=_b.next();!_c.done;_c=_b.next()){
var key=_c.value;this.removeTile(key)}}catch(e_6_1){e_6={error:e_6_1}}finally{try{if(_c&&!_c.done&&(
_a=_b.return))_a.call(_b)}finally{if(e_6)throw e_6.error}}};TileManager.sortFileBasedQueue=function(
queue){for(var i=0;i<queue.length-1;i++){for(var j=i+1;j<queue.length;j++){var a=queue[i];
var b=queue[j];var switchTiles=false;if(a.part===b.part){if(a.y>b.y){switchTiles=true}else if(
a.y===b.y){switchTiles=a.x>b.x}else{switchTiles=false}}else{switchTiles=a.part>b.part}if(switchTiles
){var temp=a;queue[i]=b;queue[j]=temp}}}};TileManager.reclaimTileBitmapMemory=function(tile){if(
tile.image){tile.image.close();tile.image=null;this.tileImageCache.delete(tile.coords.toString());
tile.decompressedId=0;tile.lastPendingId=0;var n=this.tileBitmapList.findIndex(function(it){
return it==tile});if(n!==-1)this.tileBitmapList.splice(n,1)}};
TileManager.initPreFetchPartTiles=function(){var _this=this;if(!this.checkDocLayer())return;
var targetPart=this._docLayer._selectedPart+app.map._partsDirection;if(
targetPart<0||targetPart>=this._docLayer._parts)return;if(this._partTilePreFetcher)clearTimeout(
this._partTilePreFetcher);this._partTilePreFetcher=setTimeout(function(){_this.preFetchPartTiles(
targetPart,_this._docLayer._selectedMode)},100)};TileManager.initPreFetchAdjacentTiles=function(){
if(!this.checkDocLayer())return;this.updateProperties();if(this._adjacentTilePreFetcher
)clearTimeout(this._adjacentTilePreFetcher);this._adjacentTilePreFetcher=setTimeout(function(){
var direction=app.activeDocument.activeView.getLastPanDirection();
var pixelTopLeft=this._pixelBounds.getTopLeft();pixelTopLeft.y=Math.floor(
pixelTopLeft.y/this.tileSize)*this.tileSize;pixelTopLeft.y-=1;
var pixelBottomRight=this._pixelBounds.getBottomRight();pixelBottomRight.y=Math.ceil(
pixelBottomRight.y/this.tileSize)*this.tileSize;pixelBottomRight.y+=1;
this._pixelBounds=new cool.Bounds(pixelTopLeft,pixelBottomRight);this._pixelBounds.translate(
this._pixelBounds.getSize().x*direction[0],this._pixelBounds.getSize().y*direction[1]);
var queue=this.getMissingTiles(this._pixelBounds,this._zoom);if(this._docLayer.isCalc(
)||queue.length===0){this._pixelBounds.translate(this._pixelBounds.getSize().x*direction[0]/2,
this._pixelBounds.getSize().y*direction[1]/2);queue=queue.concat(this.getMissingTiles(
this._pixelBounds,this._zoom))}if(queue.length!==0)this.addTiles(queue)}.bind(this),50)};
TileManager.sendTileCombineRequest=function(tileCombineQueue){if(tileCombineQueue.length<=0)return;
var partMode={};for(var i=0;i<tileCombineQueue.length;++i){var coords=tileCombineQueue[i];
var pmKey_1=(coords.part<<8)+coords.mode;if(partMode[pmKey_1]===undefined)partMode[pmKey_1]=[];
partMode[pmKey_1].push(coords)}var now=new Date;for(var pmKey in partMode){
var partTileQueue=partMode[pmKey];var part=partTileQueue[0].part;var mode=partTileQueue[0].mode;
var tilePositionsX=[];var tilePositionsY=[];var tileWids=[];var added=new Set;for(
var i=0;i<partTileQueue.length;++i){var coords=partTileQueue[i];var key=coords.key();
var tile=this.tiles.get(key);if(tile&&tile.requestingTooFast(now))continue;if(added.has(key)
)continue;added.add(key);tileWids.push(tile&&tile.wireId!==undefined?tile.wireId:0);
var twips=new cool.Point(Math.floor(coords.x/this.tileSize)*app.tile.size.x,Math.floor(
coords.y/this.tileSize)*app.tile.size.y);tilePositionsX.push(twips.x);tilePositionsY.push(twips.y);
if(tile)tile.updateLastRequest(now)}var msg="tilecombine "+"nviewid=0 "+"part="+part+" "+(
mode!==0?"mode="+mode+" ":""
)+"width="+this.tileSize+" "+"height="+this.tileSize+" "+"tileposx="+tilePositionsX.join(","
)+" "+"tileposy="+tilePositionsY.join(",")+" "+"oldwid="+tileWids.join(","
)+" "+"tilewidth="+app.tile.size.x+" "+"tileheight="+app.tile.size.y;if(added.size
)app.socket.sendMessage(msg,"");else window.app.console.log("Skipped empty (too fast) tilecombine")}
};TileManager.tileNeedsFetch=function(key){var tile=this.tiles.get(key);
return!tile||tile.needsFetch()};TileManager.pxBoundsToTileRanges=function(bounds){var _this=this;if(
!this.checkPointers())return null;if(!app.map._docLayer._splitPanesContext){return[
this.pxBoundsToTileRange(bounds)]}var boundList=app.map._docLayer._splitPanesContext.getPxBoundList(
bounds);return boundList.map(function(x){return _this.pxBoundsToTileRange(x)})};
TileManager.updateTileDistance=function(tile,zoom,visibleRanges){if(visibleRanges===void 0){
visibleRanges=null}if(
tile.coords.z!==zoom||tile.coords.part!==app.map._docLayer._selectedPart||tile.coords.mode!==app.map._docLayer._selectedMode
){tile.distanceFromView=Number.MAX_SAFE_INTEGER;return}if(!visibleRanges
)visibleRanges=this.getVisibleRanges();var tileBounds=new cool.Bounds([tile.coords.x,tile.coords.y],
[tile.coords.x+this.tileSize,tile.coords.y+this.tileSize]);
tile.distanceFromView=tileBounds.distanceTo(visibleRanges[0]);for(var i=1;i<visibleRanges.length;++i
){var distance=tileBounds.distanceTo(visibleRanges[i]);if(distance<tile.distanceFromView
)tile.distanceFromView=distance}};TileManager.getMissingTiles=function(pixelBounds,zoom,isCurrent){
var e_7,_a;if(isCurrent===void 0){isCurrent=false}var tileRanges=this.pxBoundsToTileRanges(
pixelBounds);var queue=[];if(isCurrent){
var currentBounds=app.map._docLayer._splitPanesContext?app.map._docLayer._splitPanesContext.getPxBoundList(
pixelBounds):[pixelBounds];try{for(var _b=__values(this.tiles.values()),_c=_b.next(
);!_c.done;_c=_b.next()){var tile=_c.value;this.updateTileDistance(tile,zoom,currentBounds)}}catch(
e_7_1){e_7={error:e_7_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_7
)throw e_7.error}}this.sortTileBitmapList()}this.beginTransaction();for(
var rangeIdx=0;rangeIdx<tileRanges.length;++rangeIdx){
var tileRange=isCurrent&&!this.shrinkCurrentId?this.expandTileRange(tileRanges[rangeIdx]
):tileRanges[rangeIdx];for(var j=tileRange.min.y;j<=tileRange.max.y;++j){for(
var i=tileRange.min.x;i<=tileRange.max.x;++i){var coords=new TileCoordData(i*this.tileSize,
j*this.tileSize,zoom,app.map._docLayer._selectedPart,app.map._docLayer._selectedMode);if(
!this.isValidTile(coords))continue;var key=coords.key();var tile=this.tiles.get(key);if(
!tile||tile.needsFetch())queue.push(coords);else if(isCurrent)this.makeTileCurrent(tile)}}}
this.endTransaction(null);return queue};TileManager.removeIrrelevantsFromCoordsQueue=function(
coordsQueue){var part=app.map._docLayer._selectedPart;var mode=app.map._docLayer._selectedMode;for(
var i=coordsQueue.length-1;i>0;i--){if(coordsQueue[i].part!==part||coordsQueue[i
].mode!==mode||!this.tileNeedsFetch(coordsQueue[i].key())){coordsQueue.splice(i,1)}else if(
app.map._docLayer._moveInProgress){if(app.map._docLayer._moveTileRequests.includes(coordsQueue[i
].key()))coordsQueue.splice(i,1);else app.map._docLayer._moveTileRequests.push(coordsQueue[i].key())
}}};TileManager.addTiles=function(coordsQueue,isCurrent){if(isCurrent===void 0){isCurrent=false}
this.removeIrrelevantsFromCoordsQueue(coordsQueue);
var visibleRanges=isCurrent?null:this.getVisibleRanges();var zoom=Math.round(app.map.getZoom());for(
var i=0;i<coordsQueue.length;i++){var key=coordsQueue[i].key();var tile=this.tiles.get(key);if(!tile
){tile=this.createTile(coordsQueue[i]);if(!isCurrent)this.updateTileDistance(tile,zoom,visibleRanges
)}}coordsQueue.sort(function(a,b){if(a.y!==b.y)return a.y-b.y;else return a.x-b.x});var rectangles=[
];while(coordsQueue.length>0){var coords=coordsQueue[0];var rectQueue=[coords];
var bound=coords.getPos();coordsQueue.splice(0,1);var rowLocked=false;var hasHole=false;var i=0;
while(i<coordsQueue.length){var current=coordsQueue[i];if(
!hasHole&&current.y===bound.y+this.tileSize){rowLocked=true;bound.y+=this.tileSize}if(
current.y>bound.y)break;if(!rowLocked){if(current.y===bound.y&&current.x===bound.x+this.tileSize){
bound.x+=this.tileSize;rectQueue.push(current);coordsQueue.splice(i,1)}else{rowLocked=true;++i}
}else if(current.x<=bound.x&&current.y<=bound.y){rectQueue.push(current);coordsQueue.splice(i,1)
}else{hasHole=true;++i}}rectangles.push(rectQueue)}for(var r=0;r<rectangles.length;++r
)this.sendTileCombineRequest(rectangles[r]);if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)this.initPreFetchPartTiles()};TileManager.refreshTilesInBackground=function(){var e_8,_a;try{for(
var _b=__values(this.tiles.values()),_c=_b.next();!_c.done;_c=_b.next()){var tile=_c.value;
tile.forceKeyframe()}}catch(e_8_1){e_8={error:e_8_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return)
)_a.call(_b)}finally{if(e_8)throw e_8.error}}};TileManager.setDebugDeltas=function(state){
this.debugDeltas=state;this.debugDeltasDetail=state};TileManager.get=function(coords){
return this.tiles.get(coords.key())};TileManager.pixelCoordsToTwipTileBounds=function(coords){
var pixelsToTwipsForTile=15/app.dpiScale/coords.scale;var x=coords.x*pixelsToTwipsForTile;
var y=coords.y*pixelsToTwipsForTile;var width=app.tile.size.pX*pixelsToTwipsForTile;
var height=app.tile.size.pY*pixelsToTwipsForTile;return[x,y,width,height]};
TileManager.overlapInvalidatedRectangleWithView=function(part,mode,wireId,invalidatedRectangle,
textMsg){var e_9,_a;var needsNewTiles=false;var calc=app.map._docLayer.isCalc();try{for(
var _b=__values(Array.from(this.tiles.entries())),_c=_b.next();!_c.done;_c=_b.next()){var _d=__read(
_c.value,2),key=_d[0],tile=_d[1];var coords=tile.coords;
var tileRectangle=this.pixelCoordsToTwipTileBounds(coords);if(
coords.part===part&&coords.mode===mode&&(invalidatedRectangle.intersectsRectangle(tileRectangle
)||calc&&!this.tileZoomIsCurrent(coords))){if(tile.distanceFromView===0)needsNewTiles=true;
this.invalidateTile(key,wireId)}}}catch(e_9_1){e_9={error:e_9_1}}finally{try{if(_c&&!_c.done&&(
_a=_b.return))_a.call(_b)}finally{if(e_9)throw e_9.error}}if(
app.map._docLayer._debug.tileInvalidationsOn&&part===app.map._docLayer._selectedPart){
app.map._docLayer._debug.addTileInvalidationRectangle(invalidatedRectangle.toArray(),textMsg);if(
needsNewTiles&&mode===app.map._docLayer._selectedMode
)app.map._docLayer._debug.addTileInvalidationMessage(textMsg)}};
TileManager.resetPreFetching=function(resetBorder){if(!this.checkDocLayer())return;
this.clearPreFetch();if(resetBorder)this._borders=undefined;var interval=250;var idleTime=750;
this._preFetchPart=this._docLayer._selectedPart;this._preFetchMode=this._docLayer._selectedMode;
this._preFetchIdle=setTimeout(window.L.bind(function(){this._tilesPreFetcher=setInterval(
window.L.bind(this.preFetchTiles,this),interval);this._preFetchIdle=undefined;this._cumTileCount=0},
this),idleTime)};TileManager.clearPreFetch=function(){if(!this.checkDocLayer())return;
this.clearTilesPreFetcher();if(this._preFetchIdle!==undefined){clearTimeout(this._preFetchIdle);
this._preFetchIdle=undefined}};TileManager.preFetchTiles=function(forceBorderCalc){if(
!this.checkDocLayer())return;if(app.file.fileBasedView&&this._docLayer)this.updateFileBasedView();
if(!this._docLayer||this.emptyTilesCount>0||!this._docLayer._canonicalIdInitialized)return;
var propertiesUpdated=this.updateProperties();var tileSize=this.tileSize;
var maxTilesToFetch=this.getMaxTileCountToPrefetch(tileSize);
var maxBorderWidth=!this._hasEditPerm?40:10;if(
propertiesUpdated||forceBorderCalc||!this._borders||this._borders.length===0)this.computeBorders();
var finalQueue=[];var visitedTiles={};var validTileRange=new cool.Bounds(new cool.Point(0,0),
new cool.Point(Math.floor((app.activeDocument.fileSize.x-1)/app.tile.size.x),Math.floor((
app.activeDocument.fileSize.y-1)/app.tile.size.y)));var tilesToFetch=maxTilesToFetch;
var doneAllPanes=true;for(var paneIdx=0;paneIdx<this._borders.length;++paneIdx){var queue=[];
var paneBorder=this._borders[paneIdx];var borderBounds=paneBorder.getBorderBounds();
var paneXFixed=paneBorder.isXFixed();var paneYFixed=paneBorder.isYFixed();while(
tilesToFetch>0&&paneBorder.getBorderIndex()<maxBorderWidth){var clampedBorder=validTileRange.clamp(
borderBounds);var fetchTopBorder=!paneYFixed&&borderBounds.min.y===clampedBorder.min.y;
var fetchBottomBorder=!paneYFixed&&borderBounds.max.y===clampedBorder.max.y;
var fetchLeftBorder=!paneXFixed&&borderBounds.min.x===clampedBorder.min.x;
var fetchRightBorder=!paneXFixed&&borderBounds.max.x===clampedBorder.max.x;if(
!fetchLeftBorder&&!fetchRightBorder&&!fetchTopBorder&&!fetchBottomBorder){break}if(fetchBottomBorder
){for(var i=clampedBorder.min.x;i<=clampedBorder.max.x;i++){queue.push(new TileCoordData(i*tileSize,
borderBounds.max.y*tileSize,this._zoom,this._preFetchPart,this._preFetchMode))}}if(fetchTopBorder){
for(i=clampedBorder.min.x;i<=clampedBorder.max.x;i++){queue.push(new TileCoordData(i*tileSize,
borderBounds.min.y*tileSize,this._zoom,this._preFetchPart,this._preFetchMode))}}if(fetchRightBorder
){for(i=clampedBorder.min.y;i<=clampedBorder.max.y;i++){queue.push(new TileCoordData(
borderBounds.max.x*tileSize,i*tileSize,this._zoom,this._preFetchPart,this._preFetchMode))}}if(
fetchLeftBorder){for(i=clampedBorder.min.y;i<=clampedBorder.max.y;i++){queue.push(new TileCoordData(
borderBounds.min.x*tileSize,i*tileSize,this._zoom,this._preFetchPart,this._preFetchMode))}}
var tilesPending=false;for(i=0;i<queue.length;i++){var coords=queue[i];var key=coords.key();if(
visitedTiles[key]||!this.isValidTile(coords)||!this.tileNeedsFetch(key))continue;if(tilesToFetch>0){
visitedTiles[key]=true;finalQueue.push(coords);tilesToFetch-=1}else{tilesPending=true}}if(
tilesPending){continue}if(!paneXFixed){if(borderBounds.min.x>0){borderBounds.min.x-=1}if(
borderBounds.max.x<validTileRange.max.x){borderBounds.max.x+=1}}if(!paneYFixed){if(
borderBounds.min.y>0){borderBounds.min.y-=1}if(borderBounds.max.y<validTileRange.max.y){
borderBounds.max.y+=1}}paneBorder.incBorderIndex()}if(paneBorder.getBorderIndex()<maxBorderWidth){
doneAllPanes=false}}window.app.console.assert(finalQueue.length<=maxTilesToFetch,
"finalQueue length("+finalQueue.length+") exceeded maxTilesToFetch("+maxTilesToFetch+")");
var tilesRequested=false;if(finalQueue.length>0){this._cumTileCount+=finalQueue.length;
this.addTiles(finalQueue);tilesRequested=true}if(!tilesRequested||doneAllPanes){
this.clearTilesPreFetcher();this._borders=undefined}};TileManager.sendProcessedResponse=function(){
var toSend=this.queuedProcessed;this.queuedProcessed=[];if(toSend.length>0)app.socket.sendMessage(
"tileprocessed wids="+toSend.join(","));if(this.fetchKeyframeQueue.length>0){
window.app.console.warn("re-fetching prematurely GCd keyframes");this.sendTileCombineRequest(
this.fetchKeyframeQueue);this.fetchKeyframeQueue=[]}};TileManager.onTileMsg=function(textMsg,img){
var tileMsgObj=app.socket.parseServerCmd(textMsg);this.checkTileMsgObject(tileMsgObj);if(
app.map._debug.tileDataOn){app.map._debug.tileDataAddMessage()}if(tileMsgObj.id!==undefined){
app.map.fire("tilepreview",{tile:img,id:tileMsgObj.id,width:tileMsgObj.width,
height:tileMsgObj.height,part:tileMsgObj.part,mode:tileMsgObj.mode!==undefined?tileMsgObj.mode:0,
docType:app.map._docLayer._docType});this.queueAcknowledgement(tileMsgObj);return}
var coords=this.tileMsgToCoords(tileMsgObj);var tile=this.get(coords);if(!tile){
tile=this.createTile(coords);this.updateTileDistance(tile,Math.round(app.map.getZoom()))}
tile.viewId=tileMsgObj.nviewid;tile.wireId=+tileMsgObj.wireId;if(tile.invalidFrom==tile.wireId
)window.app.console.debug("Nasty - updated wireId matches old one");
var hasContent=img!=null&&img.rawData.length>0;if(img&&!img.isKeyframe&&!tile.hasKeyframe()){
window.app.console.debug("Unusual: Delta sent - but we have no keyframe for "+coords.key());
tile.forceKeyframe();tile.gcErrors++;this.fetchKeyframeQueue.push(coords);hasContent=false}if(
hasContent){var rawDelta=new cool.RawDelta(img.rawData,++tile.deltaId,img.isKeyframe);if(
img.isKeyframe||tile.hasKeyframe()){tile.rawDeltas.push(rawDelta)}else{window.app.console.warn(
"Unusual: attempt to append a delta when we have no keyframe.")}}if(tile.distanceFromView===0
)this.rehydrateTile(tile,true);this.queueAcknowledgement(tileMsgObj);if(!this.receivedFirstTile){
this.receivedFirstTile=true;while(this.afterFirstTileTasks.length>0){
var task=this.afterFirstTileTasks.shift();task()}}};TileManager.predictTilesToSlurp=function(){if(
!this.checkPointers())return 0;var size=app.map.getSize();if(size.x===0||size.y===0)return 0;
var zoom=Math.round(app.map.getZoom());var pixelBounds=app.map.getPixelBoundsCore(app.map.getCenter(
),zoom);var queue=this.getMissingTiles(pixelBounds,zoom);return queue.length};
TileManager.pruneTiles=function(){if(app.file.fileBasedView)this.updateFileBasedView(true);
this.garbageCollect()};TileManager.discardAllCache=function(){if(app.file.fileBasedView
)this.updateFileBasedView(true);this.garbageCollect(true)};TileManager.isValidTile=function(coords){
if(coords.x<0||coords.y<0){return false}else if(
coords.x*app.pixelsToTwips>app.activeDocument.fileSize.x||coords.y*app.pixelsToTwips>app.activeDocument.fileSize.y
){return false}else return true};TileManager.redraw=function(){if(app.map){this.removeAllTiles();
this.update()}return this};TileManager.update=function(center,zoom){var _this=this;if(
center===void 0){center=null}if(zoom===void 0){zoom=null}var map=app.map;if(
!map||app.map._docLayer._documentInfo===""||!app.map._docLayer._canonicalIdInitialized){return}if(
app.map._docLayer.isCalc()&&!app.map._docLayer._gotFirstCellCursor)return;var size=map.getSize();if(
size.x===0||size.y===0){setTimeout(function(){this.update()}.bind(this),1);return}if(
this.pausedForCoherency){if(this.shrinkCurrentId)clearTimeout(this.shrinkCurrentId);
this.shrinkCurrentId=setTimeout(function(){_this.shrinkCurrentId=null},100)}if(
app.file.fileBasedView){this.updateFileBasedView();return}if(!center){center=map.getCenter()}if(
!zoom){zoom=Math.round(map.getZoom())}var pixelBounds=map.getPixelBoundsCore(center,zoom);
var queue=this.getMissingTiles(pixelBounds,zoom,true);app.map._docLayer._sendClientZoom();
app.activeDocument.activeView.sendClientVisibleArea();if(queue.length!==0)this.addTiles(queue,true);
if(app.map._docLayer.isCalc()||app.map._docLayer.isWriter())this.initPreFetchAdjacentTiles()};
TileManager.onWorkerMessage=function(e){var e_10,_a;var _this=this;var bitmaps=[];
var bitmapPromises=[];var pendingDeltas=[];switch(e.data.message){case"endTransaction":if(
this.nPendingWorkerTasks)--this.nPendingWorkerTasks;else window.app.console.warn(
"Unexpected worker message");var _loop_1=function(x){var tile=this_1.tiles.get(x.key);if(!tile){if(
this_1.debugDeltas)window.app.console.warn("Tile deleted during rawDelta decompression.");
return"continue"}var rawDeltas=[];var firstDelta=tile.rawDeltas.findIndex(function(d){
return d.id===x.ids[0]});var lastDelta=tile.rawDeltas.findIndex(function(d){return d.id===x.ids[1]})
if(firstDelta!==-1&&lastDelta!==-1)rawDeltas=tile.rawDeltas.slice(firstDelta,lastDelta+1
);else window.app.console.warn("Unusual: Received unknown decompressed keyframe delta(s)");
var lastDecompressedId=tile.decompressedId;tile.decompressedId=x.ids[1];if(x.wireMessage){if(
x.isKeyframe){tile.loadCount++;tile.deltaCount=0;tile.updateCount=0;if(app.map._debug.tileDataOn){
app.map._debug.tileDataAddLoad()}}else if(rawDeltas.length===0){tile.updateCount++;
this_1.nullDeltaUpdate++;if(app.map._docLayer._emptyDeltaDiv){
app.map._docLayer._emptyDeltaDiv.innerText=this_1.nullDeltaUpdate}if(app.map._debug.tileDataOn){
app.map._debug.tileDataAddUpdate()}return"continue"}else{tile.deltaCount++;if(
app.map._debug.tileDataOn){app.map._debug.tileDataAddDelta()}}}if(!x.isKeyframe){if(
lastDecompressedId!==0){if(x.ids[0]!==lastDecompressedId+1){window.app.console.warn(
"Unusual: Received discontiguous decompressed delta")}}else{if(this_1.debugDeltas
)window.app.console.warn("Decompressed delta received on GC'd tile");return"continue"}}if(!x.bitmap
){x.deltas=window.fzstd.decompress(x.rawDelta);if(x.isKeyframe){x.keyframeBuffer=new Uint8Array(
e.data.tileSize*e.data.tileSize*4);x.keyframeDeltaSize=cool.CanvasTileUtils.unrle(x.deltas,
e.data.tileSize,e.data.tileSize,x.keyframeBuffer)}else x.keyframeDeltaSize=0;this_1.applyDelta(tile,
rawDeltas,x.deltas,x.keyframeDeltaSize,x.keyframeBuffer);this_1.createTileBitmap(tile,x,
pendingDeltas,bitmapPromises)}else{this_1.tileImageCache.set(x.key,null);bitmaps.push(x.bitmap);
pendingDeltas.push(x)}};var this_1=this;try{for(var _b=__values(e.data.deltas),_c=_b.next(
);!_c.done;_c=_b.next()){var x=_c.value;_loop_1(x)}}catch(e_10_1){e_10={error:e_10_1}}finally{try{
if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_10)throw e_10.error}}if(
bitmapPromises.length&&bitmaps.length)window.app.console.warn(
"Unusual: Sync and async tile decompression happening simultaneously");if(bitmaps.length
)this.endTransactionHandleBitmaps(pendingDeltas,bitmaps);if(bitmapPromises.length)Promise.all(
bitmapPromises).then(function(bitmaps){_this.endTransactionHandleBitmaps(pendingDeltas,bitmaps)});
break;default:window.app.console.error("Unrecognised message from worker");this.disableWorker()}};
TileManager.updateOnChangePart=function(){if(!this.checkPointers(
)||app.map._docLayer._documentInfo===""){return}var center=app.map.getCenter();var zoom=Math.round(
app.map.getZoom());var pixelBounds=app.map.getPixelBoundsCore(center,zoom);
var queue=this.getMissingTiles(pixelBounds,zoom,true);if(queue.length!==0){for(
var i=0;i<queue.length;i++){var coords=queue[i];var key=coords.key();if(!this.tiles.has(key)
)this.createTile(coords)}this.sendTileCombineRequest(queue)}if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)this.initPreFetchPartTiles()};TileManager.expandTileRange=function(range){
var grow=this.visibleTileExpansion;var direction=app.activeDocument.activeView.getLastPanDirection()
var minOffset=new cool.Point(grow-grow*this.directionalTileExpansion*Math.min(0,direction[0]),
grow-grow*this.directionalTileExpansion*Math.min(0,direction[1]));var maxOffset=new cool.Point(
grow+grow*this.directionalTileExpansion*Math.max(0,direction[0]),
grow+grow*this.directionalTileExpansion*Math.max(0,direction[1]));return new cool.Bounds(
range.min.subtract(minOffset),range.max.add(maxOffset))};TileManager.pxBoundsToTileRange=function(
bounds){return new cool.Bounds(bounds.min.divideBy(this.tileSize)._floor(),bounds.max.divideBy(
this.tileSize)._floor())};TileManager.updateLayoutView=function(bounds){
var queue=this.getMissingTiles(bounds,Math.round(app.map.getZoom()),true);if(queue.length>0
)this.addTiles(queue,true)};TileManager.getVisibleCoordList=function(rectangle){var e_11,_a;if(
rectangle===void 0){rectangle=app.activeDocument.activeView.viewedRectangle}var coordList=Array();
var zoom=app.map.getZoom();try{for(var _b=__values(this.tiles.values()),_c=_b.next(
);!_c.done;_c=_b.next()){var tile=_c.value;var coords=tile.coords;if(
coords.z===zoom&&rectangle.intersectsRectangle([coords.x*app.pixelsToTwips,
coords.y*app.pixelsToTwips,this.tileSize*app.pixelsToTwips,this.tileSize*app.pixelsToTwips])
)coordList.push(coords)}}catch(e_11_1){e_11={error:e_11_1}}finally{try{if(_c&&!_c.done&&(
_a=_b.return))_a.call(_b)}finally{if(e_11)throw e_11.error}}return coordList};
TileManager.updateFileBasedView=function(checkOnly,zoomFrameBounds,forZoom){var e_12,_a;if(
checkOnly===void 0){checkOnly=false}if(zoomFrameBounds===void 0){zoomFrameBounds=null}if(
forZoom===void 0){forZoom=null}if(app.map._docLayer._partHeightTwips===0)return[];if(
app.map._docLayer._isZooming)return[];if(!checkOnly){window.app.console.assert(
zoomFrameBounds===null,"zoomFrameBounds must only be supplied when checkOnly is true");
window.app.console.assert(forZoom===null,"forZoom must only be supplied when checkOnly is true")}if(
forZoom!==null){window.app.console.assert(zoomFrameBounds,
"zoomFrameBounds must be valid when forZoom is specified")}var zoom=forZoom||Math.round(
app.map.getZoom());var currZoom=Math.round(app.map.getZoom());
var relScale=currZoom==zoom?1:app.map.getZoomScale(zoom,currZoom);
var ratio=this.tileSize*relScale/app.tile.size.y;var partHeightPixels=Math.round((
app.map._docLayer._partHeightTwips+app.map._docLayer._spaceBetweenParts)*ratio);
var partWidthPixels=Math.round(app.map._docLayer._partWidthTwips*ratio);var mode=0;
var intersectionAreaRectangle=app.LOUtil._getIntersectionRectangle(
app.activeDocument.activeView.viewedRectangle.pToArray(),[0,0,partWidthPixels,
partHeightPixels*app.map._docLayer._parts]);var queue=[];if(intersectionAreaRectangle){
var minLocalX=Math.floor(intersectionAreaRectangle[0]/app.tile.size.pX)*app.tile.size.pX;
var maxLocalX=Math.floor((intersectionAreaRectangle[0]+intersectionAreaRectangle[2]
)/app.tile.size.pX)*app.tile.size.pX;var startPart=Math.floor(intersectionAreaRectangle[1
]/partHeightPixels);
var startY=app.activeDocument.activeView.viewedRectangle.pY1-startPart*partHeightPixels;
startY=Math.floor(startY/app.tile.size.pY)*app.tile.size.pY;var endPart=Math.ceil((
intersectionAreaRectangle[1]+intersectionAreaRectangle[3])/partHeightPixels);
var endY=app.activeDocument.activeView.viewedRectangle.pY1+app.activeDocument.activeView.viewedRectangle.pY2-endPart*partHeightPixels
endY=Math.floor(endY/app.tile.size.pY)*app.tile.size.pY;var vTileCountPerPart=Math.ceil(
partHeightPixels/app.tile.size.pY);for(var i=startPart;i<endPart;i++){for(
var j=minLocalX;j<=maxLocalX;j+=app.tile.size.pX){for(
var k=0;k<=vTileCountPerPart*app.tile.size.pX;k+=app.tile.size.pY)if((i!==startPart||k>=startY)&&(
i!==endPart||k<=endY))queue.push(new TileCoordData(j,k,zoom,i,mode))}}this.sortFileBasedQueue(queue)
try{for(var _b=__values(this.tiles.values()),_c=_b.next();!_c.done;_c=_b.next()){var tile=_c.value;
tile.distanceFromView=Number.MAX_SAFE_INTEGER}}catch(e_12_1){e_12={error:e_12_1}}finally{try{if(
_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_12)throw e_12.error}}this.beginTransaction();
for(i=0;i<queue.length;i++){var tempTile=this.tiles.get(queue[i].key());if(tempTile
)this.makeTileCurrent(tempTile)}this.endTransaction(null)}if(checkOnly){return queue}else{
app.activeDocument.activeView.sendClientVisibleArea();app.map._docLayer._sendClientZoom();
var tileCombineQueue=[];for(var i=0;i<queue.length;i++){var tile=this.get(queue[i]);if(!tile
)tile=this.createTile(queue[i]);if(tile.needsFetch())tileCombineQueue.push(queue[i])}
this.sendTileCombineRequest(tileCombineQueue)}};TileManager.invalidateTile=function(key,wireId){
var tile=this.tiles.get(key);if(!tile){window.app.console.warn(
"invalidateTile called with invalid key",key);return}tile.invalidateCount++;if(
app.map._debug.tileDataOn){app.map._debug.tileDataAddInvalidate()}if(!tile.hasContent()
)this.removeTile(key);else{if(this.debugDeltas)window.app.console.debug(
"invalidate tile "+key+" with wireId "+wireId);tile.forceKeyframe(wireId?wireId:tile.wireId)}};
TileManager.touchImage=function(tile){if(!tile)return;tile.lastRendered=performance.now();if(
!tile.image)tile.missingContent++};TileManager.inTransaction=0;TileManager.pendingDeltas=[];
TileManager.workers=[];TileManager.transactionCallbacks=[];TileManager.nPendingWorkerTasks=0;
TileManager.nullDeltaUpdate=0;TileManager.queuedProcessed=[];TileManager.fetchKeyframeQueue=[];
TileManager.emptyTilesCount=0;TileManager.debugDeltas=false;TileManager.debugDeltasDetail=false;
TileManager.tiles=new Map;TileManager.tileBitmapList=[];TileManager.tileImageCache=new Map;
TileManager.tileSize=256;TileManager.visibleTileExpansion=1;TileManager.directionalTileExpansion=2;
TileManager.pausedForCoherency=false;TileManager.shrinkCurrentId=null;
TileManager.receivedFirstTile=false;TileManager.afterFirstTileTasks=[];return TileManager}();
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};var SlideBitmapManager=function(){
function SlideBitmapManager(){}SlideBitmapManager.decompressAndCreateImageData=function(imgRawData,
width,height){var img=window.fzstd.decompress(imgRawData);var clampedArray=new Uint8ClampedArray(img
);return new ImageData(clampedArray,width,height)};
SlideBitmapManager.renderCachedCompressSlide=function(layers){var e_1,_a;var pendingLayers=[];
var _loop_1=function(layer){var json=layer.json,imgRawData=layer.imgRawData;if((
json===null||json===void 0?void 0:json.width)&&(json===null||json===void 0?void 0:json.height)){
var imgData=this_1.decompressAndCreateImageData(imgRawData,json.width,json.height);console.debug(
"CompressedCache: fetching layers from compressed cache",layer);pendingLayers.push(
createImageBitmap(imgData).then(function(img){app.map.fire("slidelayer",{message:json,image:img})}))
}};var this_1=this;try{for(var layers_1=__values(layers),layers_1_1=layers_1.next(
);!layers_1_1.done;layers_1_1=layers_1.next()){var layer=layers_1_1.value;_loop_1(layer)}}catch(
e_1_1){e_1={error:e_1_1}}finally{try{if(layers_1_1&&!layers_1_1.done&&(_a=layers_1.return))_a.call(
layers_1)}finally{if(e_1)throw e_1.error}}Promise.all(pendingLayers).then(function(){console.debug(
"CompressedCache: Complete Slide rendering");app.map.fire("sliderenderingcomplete",{
success:"success",compressedLayers:false})}).catch(function(err){app.map.fire(
"sliderenderingcomplete",{success:"fail",compressedLayers:false});console.error(
"Something Went wrong while preparing layers",err)})};
SlideBitmapManager.handleRenderSlideEvent=function(e){if(!e.textMsg.startsWith("slidelayer:"))return
var json=JSON.parse(e.textMsg.substring("slidelayer: ".length));if(json.isCompressed){
this.cacheCompressedLayer(json,e.imgBytes.subarray(e.imgIndex));return}if(json.width&&json.height){
var imgData=this.decompressAndCreateImageData(e.imgBytes.subarray(e.imgIndex),json.width,json.height
);e.imgPromise=createImageBitmap(imgData);this.pendingLayers.push(e.imgPromise);e.imgPromise.then(
function(img){e.image=img;e.imageIsComplete=true;app.map.fire("slidelayer",{message:json,image:img})
})}};SlideBitmapManager.handleSlideRenderingComplete=function(e){var _this=this;if(
!e.textMsg.startsWith("sliderenderingcomplete:"))return;var json=JSON.parse(e.textMsg.substring(
"sliderenderingcomplete: ".length));if(json.compressedLayers&&this.compressedSlideCache.get(
json.slidehash)!=null){var layers=this.compressedSlideCache.get(json.slidehash);if(
json.status==="success"){app.map.fire("compressedslide",{slideHash:json.slidehash,layers:layers})}
this.compressedSlideCache.delete(json.slidehash);app.map.fire("sliderenderingcomplete",{
success:json.status==="success",compressedLayers:json.compressedLayers});return}Promise.all(
this.pendingLayers).then(function(){_this.pendingLayers=[];app.map.fire("sliderenderingcomplete",{
success:json.status==="success",compressedLayers:json.compressedLayers})})};
SlideBitmapManager.cacheCompressedLayer=function(json,imgRawData){if(!this.compressedSlideCache.has(
json.slideHash)){this.compressedSlideCache.set(json.slideHash,[])}this.compressedSlideCache.get(
json.slideHash).push({json:json,imgRawData:imgRawData})};SlideBitmapManager.pendingLayers=[];
SlideBitmapManager.compressedSlideCache=new Map;return SlideBitmapManager}();
var SearchService=function(){function SearchService(){}SearchService.prototype.searchNext=function(
){this.search(window.L.DomUtil.get("search-input").value,false)};
SearchService.prototype.searchPrevious=function(){this.search(window.L.DomUtil.get("search-input"
).value,true)};SearchService.prototype.search=function(text,backward,replaceString,command,expand){
if(backward===undefined){backward=false}if(command===undefined){command=0}if(
replaceString===undefined){replaceString=""}if(
window.L.Map.THIS._docLayer._searchResults&&text!==window.L.Map.THIS._docLayer._searchTerm){
window.L.Map.THIS._docLayer._clearSearchResults()}var searchCmd={"SearchItem.SearchString":{
type:"string",value:undefined},"SearchItem.ReplaceString":{type:"string",value:undefined},
"SearchItem.Backward":{type:"boolean",value:undefined},"SearchItem.SearchStartPointX":{type:"long",
value:undefined},"SearchItem.SearchStartPointY":{type:"long",value:undefined},"SearchItem.Command":{
type:"long",value:undefined}};window.L.Map.THIS.fire("clearselection");
var searchStartPointX=app.activeDocument.activeView.viewedRectangle.x1;
var searchStartPointY=app.activeDocument.activeView.viewedRectangle.y1;if(
window.L.Map.THIS._docLayer&&window.L.Map.THIS._docLayer._lastSearchResult&&expand){
var strTwips=window.L.Map.THIS._docLayer._lastSearchResult.twipsRectangles.match(/\d+/g);if(
strTwips!=null){searchStartPointX=strTwips[0];searchStartPointY=strTwips[1]}this.resetSelection()}
searchCmd["SearchItem.SearchString"].value=text;searchCmd["SearchItem.Backward"].value=backward;
searchCmd["SearchItem.ReplaceString"].value=replaceString;searchCmd["SearchItem.SearchStartPointX"
].value=searchStartPointX;searchCmd["SearchItem.SearchStartPointY"].value=searchStartPointY;
searchCmd["SearchItem.Command"].value=command;app.socket.sendMessage(
"uno .uno:ExecuteSearch "+JSON.stringify(searchCmd))};SearchService.prototype.highlightAll=function(
text){if(window.L.Map.THIS._docLayer._searchResults&&text===window.L.Map.THIS._docLayer._searchTerm
){return}this.search(text,false,"1")};SearchService.prototype.resetSelection=function(){
window.L.Map.THIS._docLayer._clearSearchResults();app.socket.sendMessage("resetselection")};
return SearchService}();app.searchService=new SearchService;var BaseClass=function(){
function BaseClass(opts){this._leaflet_id=-1;this.baseOptions=opts}return BaseClass}();
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var Evented=function(_super){__extends(Evented,_super);
function Evented(outerObject){var _this=_super.call(this)||this;_this._eventsAuto=new Map;
_this._eventsExt=new Map;_this._numEvents=new Map;_this._eventParents=new Map;
_this._outerObject=outerObject?outerObject:_this;return _this}Evented.prototype.on=function(types,fn
,context){var e_1,_a;if(typeof types==="string"){var parts=Util.splitWords(types);for(var i=0,
len=parts.length;i<len;i++){this._addEventHandlerImpl(parts[i],fn,context)}}else if(
types instanceof Map){try{for(var types_1=__values(types),types_1_1=types_1.next(
);!types_1_1.done;types_1_1=types_1.next()){var _b=__read(types_1_1.value,2),type=_b[0],listener=_b[
1];this._addEventHandlerImpl(type,listener,fn)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
types_1_1&&!types_1_1.done&&(_a=types_1.return))_a.call(types_1)}finally{if(e_1)throw e_1.error}}
}else{var typeNames=Object.keys(types);for(var i_1=0,len_1=typeNames.length;i_1<len_1;++i_1){
var typeName=typeNames[i_1];var listener=types[typeName];this._addEventHandlerImpl(typeName,listener
,fn)}}return this};Evented.prototype.off=function(types,fn,context){var e_2,_a;if(!types){
this._eventsExt.clear();this._eventsAuto.clear();this._numEvents.clear()}else if(
typeof types==="string"){var parts=Util.splitWords(types);for(var i=0,len=parts.length;i<len;i++){
this._removeEventHandlerImpl(parts[i],fn,context)}}else if(types instanceof Map){try{for(
var types_2=__values(types),types_2_1=types_2.next();!types_2_1.done;types_2_1=types_2.next()){
var _b=__read(types_2_1.value,2),type=_b[0],listener=_b[1];this._removeEventHandlerImpl(type,
listener,fn)}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(types_2_1&&!types_2_1.done&&(
_a=types_2.return))_a.call(types_2)}finally{if(e_2)throw e_2.error}}}else{var typeNames=Object.keys(
types);for(var i_2=0,len_2=typeNames.length;i_2<len_2;++i_2){var typeName=typeNames[i_2];
var listener=types[typeName];this._removeEventHandlerImpl(typeName,listener,fn)}}return this};
Evented.prototype._addHandlerForeignCtxt=function(foreignCtxtId,type,fn,context){if(
!this._eventsExt.has(type)){this._eventsExt.set(type,new Map)}var typeIndex=this._eventsExt.get(type
);var id=Util.stamp(fn)+"_"+foreignCtxtId;if(!typeIndex.has(id)){typeIndex.set(id,{fn:fn,ctx:context
});var count=this._numEvents.has(type)?this._numEvents.get(type):0;this._numEvents.set(type,count+1)
}};Evented.prototype._addEventHandlerImpl=function(type,fn,context){var foreignCtxtId=0;if(
context&&context!==this._outerObject){foreignCtxtId=Util.stamp(context)}if(foreignCtxtId){
this._addHandlerForeignCtxt(foreignCtxtId,type,fn,context)}else{if(!this._eventsAuto.has(type)){
this._eventsAuto.set(type,[{fn:fn}])}else{this._eventsAuto.get(type).push({fn:fn})}}};
Evented.prototype._removeHandlerForeignCtxt=function(foreignCtxtId,type,fn){var listener=null;
var id=Util.stamp(fn)+"_"+foreignCtxtId;var listeners=this._eventsExt.get(type);if(
listeners&&listeners.get(id)){listener=listeners.get(id);listeners.delete(id);this._numEvents.set(
type,this._numEvents.get(type)-1)}return listener};
Evented.prototype._removeHandlerSelfCtxt=function(type,fn){var listener=null;
var listeners=this._eventsAuto.get(type);if(listeners){var len=listeners.length;for(
var i=0;i<len;i++){if(listeners[i].fn===fn){listener=listeners[i];listeners.splice(i,1);break}}}
return listener};Evented.prototype._removeEventHandlerImpl=function(type,fn,context){if(
!this._eventsExt.size&&!this._eventsAuto.size){return}if(!fn){this._eventsExt.delete(type);
this._numEvents.delete(type);this._eventsAuto.delete(type);return}var foreignCtxtId=0;if(
context&&context!==this._outerObject){foreignCtxtId=Util.stamp(context)}var listener;if(
foreignCtxtId){listener=this._removeHandlerForeignCtxt(foreignCtxtId,type,fn)}else{
listener=this._removeHandlerSelfCtxt(type,fn)}if(listener){listener.fn=Util.falseFn}};
Evented.prototype.fire=function(type,data,propagate){var e_3,_a;if(!this.listens(type,propagate)){
return this}var event=__assign(__assign({},data),{type:type,target:this._outerObject});if(
this._eventsExt.size||this._eventsAuto.size){var typeIndex=this._eventsExt.get(type);
var simpleListeners=this._eventsAuto.get(type);if(simpleListeners){
var listeners=simpleListeners.slice();for(var i=0,len=listeners.length;i<len;i++){listeners[i
].fn.call(this._outerObject,event)}}if(typeIndex){try{for(var typeIndex_1=__values(typeIndex),
typeIndex_1_1=typeIndex_1.next();!typeIndex_1_1.done;typeIndex_1_1=typeIndex_1.next()){
var _b=__read(typeIndex_1_1.value,2),_1=_b[0],value=_b[1];value.fn.call(value.ctx,event)}}catch(
e_3_1){e_3={error:e_3_1}}finally{try{if(typeIndex_1_1&&!typeIndex_1_1.done&&(_a=typeIndex_1.return)
)_a.call(typeIndex_1)}finally{if(e_3)throw e_3.error}}}}if(propagate){this._propagateEvent(event)}
return this};Evented.prototype.addEventParent=function(obj){this._eventParents.set(Util.stamp(obj),
obj);return this};Evented.prototype.removeEventParent=function(obj){if(this._eventParents.size){
this._eventParents.delete(Util.stamp(obj))}return this};
Evented.prototype.hasContextListeners=function(type){if(!this._eventsExt.size){return false}
var mp=this._eventsExt.get(type);if(!mp||!mp.size){return false}return true};
Evented.prototype.hasNoContextListener=function(type){if(!this._eventsAuto.size){return false}
var arr=this._eventsAuto.get(type);if(!arr||!arr.length){return false}return true};
Evented.prototype.listens=function(type,propagate){var e_4,_a;if(this.hasContextListeners(type
)||this.hasNoContextListener(type)){return true}if(propagate){try{for(var _b=__values(
this._eventParents),_c=_b.next();!_c.done;_c=_b.next()){var _d=__read(_c.value,2),_2=_d[0],
parent_1=_d[1];if(parent_1.listens(type,propagate)){return true}}}catch(e_4_1){e_4={error:e_4_1}
}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_4)throw e_4.error}}}
return false};Evented.prototype.once=function(types,fn,context){var e_5,_a;if(typeof types=="string"
){var handler=function(){this.off(types,fn,context).off(types,handler,context)}.bind(this);
return this.on(types,fn,context).on(types,handler,context)}else if(types instanceof Map){try{for(
var types_3=__values(types),types_3_1=types_3.next();!types_3_1.done;types_3_1=types_3.next()){
var _b=__read(types_3_1.value,2),type=_b[0],listener=_b[1];this.once(type,listener,fn)}}catch(e_5_1
){e_5={error:e_5_1}}finally{try{if(types_3_1&&!types_3_1.done&&(_a=types_3.return))_a.call(types_3)
}finally{if(e_5)throw e_5.error}}return this}else{var typeNames=Object.keys(types);for(var i=0,
len=typeNames.length;i<len;++i){var typeName=typeNames[i];var listener=types[typeName];this.once(
typeName,listener,fn)}return this}};Evented.prototype._propagateEvent=function(e){var e_6,_a;try{
for(var _b=__values(this._eventParents),_c=_b.next();!_c.done;_c=_b.next()){var _d=__read(_c.value,2
),_3=_d[0],parent_2=_d[1];parent_2.fire(e.type,__assign({layer:e.target},e),true)}}catch(e_6_1){
e_6={error:e_6_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_6
)throw e_6.error}}};return Evented}(BaseClass);app.Evented=Evented;var cool;(function(cool){
var Rectangle=function(){function Rectangle(x,y,width,height){this.x1=x;this.y1=y;this.width=width;
this.height=height}Object.defineProperty(Rectangle.prototype,"x2",{get:function(){
return this.x1+this.width},enumerable:false,configurable:true});Object.defineProperty(
Rectangle.prototype,"y2",{get:function(){return this.y1+this.height},enumerable:false,
configurable:true});Object.defineProperty(Rectangle.prototype,"area",{get:function(){
return this.width*this.height},enumerable:false,configurable:true});Object.defineProperty(
Rectangle.prototype,"rx1",{get:function(){return Math.round(this.x1)},enumerable:false,
configurable:true});Object.defineProperty(Rectangle.prototype,"ry1",{get:function(){
return Math.round(this.y1)},enumerable:false,configurable:true});Object.defineProperty(
Rectangle.prototype,"rx2",{get:function(){return Math.round(this.x2)},enumerable:false,
configurable:true});Object.defineProperty(Rectangle.prototype,"ry2",{get:function(){
return Math.round(this.y2)},enumerable:false,configurable:true});Object.defineProperty(
Rectangle.prototype,"rwidth",{get:function(){return this.rx2-this.rx1},enumerable:false,
configurable:true});Object.defineProperty(Rectangle.prototype,"rheight",{get:function(){
return this.ry2-this.ry1},enumerable:false,configurable:true});Object.defineProperty(
Rectangle.prototype,"rarea",{get:function(){return this.rwidth*this.rheight},enumerable:false,
configurable:true});Rectangle.prototype.isValid=function(){if(this.x1<=this.x2&&this.y1<=this.y2
)return true;return false};Rectangle.prototype.clone=function(){return new Rectangle(this.x1,this.x2
,this.width,this.height)};Rectangle.prototype.containsPoint=function(x,y){if(
x>=this.x1&&x<=this.x2&&y>=this.y1&&y<=this.y2)return true;return false};
Rectangle.prototype.containsPixel=function(px,py){if(
px>=this.rx1&&px<=this.rx2&&py>=this.ry1&&py<=this.ry2)return true;return false};
Rectangle.prototype.containsXOrdinate=function(ox){if(ox>=this.x1&&ox<=this.x2)return true;
return false};Rectangle.prototype.containsYOrdinate=function(oy){if(oy>=this.y1&&oy<=this.y2
)return true;return false};Rectangle.prototype.containsPixelOrdinateX=function(ox){if(
ox>=this.rx1&&ox<=this.rx2)return true;return false};
Rectangle.prototype.containsPixelOrdinateY=function(oy){if(oy>=this.ry1&&oy<=this.ry2)return true;
return false};Rectangle.prototype.setX1=function(x1){this.width+=this.x1-x1;this.x1=x1};
Rectangle.prototype.setX2=function(x2){this.width=x2-this.x1};Rectangle.prototype.setY1=function(y1
){this.height+=this.y1-y1;this.y1=y1};Rectangle.prototype.setY2=function(y2){this.height=y2-this.y1}
Rectangle.prototype.setWidth=function(width){this.width=width};
Rectangle.prototype.setHeight=function(height){this.height=height};
Rectangle.prototype.setArea=function(area,preserveHeight){if(!preserveHeight){
var height=area/this.width;this.setHeight(height)}else{var width=area/this.height;this.setWidth(
width)}};Rectangle.prototype.moveBy=function(dx,dy){this.x1+=dx;this.y1+=dy};
Rectangle.prototype.moveTo=function(x,y){this.x1=x;this.y1=y};Rectangle.prototype.getX1=function(){
return this.x1};Rectangle.prototype.getX2=function(){return this.x2};
Rectangle.prototype.getY1=function(){return this.y1};Rectangle.prototype.getY2=function(){
return this.y2};Rectangle.prototype.getWidth=function(){return this.width};
Rectangle.prototype.getHeight=function(){return this.height};Rectangle.prototype.getArea=function(){
return this.area};Rectangle.prototype.getCenter=function(){return[(this.x2+this.x1)/2,(
this.y2+this.y1)/2]};Rectangle.prototype.getPxX1=function(){return this.rx1};
Rectangle.prototype.getPxX2=function(){return this.rx2};Rectangle.prototype.getPxY1=function(){
return this.ry1};Rectangle.prototype.getPxY2=function(){return this.ry2};
Rectangle.prototype.getPxWidth=function(){return this.rwidth};
Rectangle.prototype.getPxHeight=function(){return this.rheight};
Rectangle.prototype.getPxArea=function(){return this.rarea};
Rectangle.prototype.getPxCenter=function(){return[Math.round((this.rx2+this.rx1)/2),Math.round((
this.ry2+this.ry1)/2)]};return Rectangle}();cool.Rectangle=Rectangle;function createRectangle(x,y,
width,height){return new Rectangle(x,y,width,height)}cool.createRectangle=createRectangle})(cool||(
cool={}));var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s
,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(
Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(this,arguments)}
var Util=function(){function Util(){}Util.nextId=function(){return++Util.lastId};
Util.stamp=function(obj){if(obj._leaflet_id>0){return obj._leaflet_id}obj._leaflet_id=Util.nextId();
return obj._leaflet_id};Util.merge=function(one,two){return __assign(__assign({},one),two)};
Util.throttle=function(fn,time,context){var lock=false;var wrapperFn;var args=false;
var later=function(){lock=false;if(args){wrapperFn.apply(context,args);args=false}};
wrapperFn=function(){var args_=[];for(var _i=0;_i<arguments.length;_i++){args_[_i]=arguments[_i]}if(
lock){args=args_}else{fn.apply(context,args_);setTimeout(later,time);lock=true}};return wrapperFn};
Util.wrapNum=function(x,range,includeMax){var max=range[1];var min=range[0];var d=max-min;
return x===max&&includeMax?x:((x-min)%d+d)%d+min};Util.falseFn=function(){return false};
Util.formatNum=function(num,digits){var pow=Math.pow(10,digits||5);return Math.round(num*pow)/pow};
Util.trimStart=function(str,prefix){if(str.indexOf(prefix)===0)return str.substring(prefix.length);
return str};Util.trimEnd=function(str,suffix){var suffixIndex=str.lastIndexOf(suffix);if(
suffixIndex!==-1&&str.length-suffix.length===suffixIndex)return str.substring(0,suffixIndex);
return str};Util.trim=function(str,prefix,suffix){if(!prefix)return str.trim?str.trim():str.replace(
/^\s+|\s+$/g,"");var result=Util.trimStart(str,prefix);result=Util.trimEnd(result,suffix);
return result};Util.splitWords=function(str){return Util.trim(str).split(/\s+/)};
Util.round=function(x,e){if(!e){return Math.round(x)}var f=1/e;return Math.round(x*f)*e};
Util.template=function(str,data){return str.replace(Util.templateRe,function(str,key){
var value=data[key];if(value===undefined){throw new Error("No value provided for variable "+str)
}else if(typeof value==="function"){value=value(data)}return value})};
Util.toggleFullScreen=function(){var doc=document;if(
!doc.fullscreenElement&&!doc.mozFullscreenElement&&!doc.msFullscreenElement&&!doc.webkitFullscreenElement
){if(doc.documentElement.requestFullscreen){doc.documentElement.requestFullscreen()}else if(
doc.documentElement.msRequestFullscreen){doc.documentElement.msRequestFullscreen()}else if(
doc.documentElement.mozRequestFullScreen){doc.documentElement.mozRequestFullScreen()}else if(
doc.documentElement.webkitRequestFullscreen){doc.documentElement.webkitRequestFullscreen(
Element.ALLOW_KEYBOARD_INPUT)}}else if(doc.exitFullscreen){doc.exitFullscreen()}else if(
doc.msExitFullscreen){doc.msExitFullscreen()}else if(doc.mozCancelFullScreen){
doc.mozCancelFullScreen()}else if(doc.webkitExitFullscreen){doc.webkitExitFullscreen()}};
Util.isEmpty=function(o){return!(o&&o.length)};Util.mm100thToInch=function(mm){return mm/2540};
Util.getTempCanvas=function(){if(Util._canvas){return Util._canvas}
Util._canvas=document.createElement("canvas");return Util._canvas};Util.getTextWidth=function(text,
font){var canvas=Util.getTempCanvas();var context=canvas.getContext("2d");context.font=font;
var metrics=context.measureText(text);return Math.floor(metrics.width)};Util.getProduct=function(){
var brandFAQURL=typeof brandProductFAQURL!=="undefined"?brandProductFAQURL:"#"
var customWindow=window;if(customWindow.feedbackUrl&&customWindow.buyProductUrl){
var integratorUrl=encodeURIComponent(customWindow.buyProductUrl);
brandFAQURL=customWindow.feedbackUrl;brandFAQURL=brandFAQURL.substring(0,brandFAQURL.lastIndexOf("/"
))+"/product.html?integrator="+integratorUrl}return brandFAQURL};Util.replaceCtrlAltInMac=function(
msg){if(window.L.Browser.mac){var ctrl=/Ctrl/g;var alt=/Alt/g;var CustomString=String;if(
CustomString.locale.startsWith("de")||CustomString.locale.startsWith("dsb"
)||CustomString.locale.startsWith("hsb")){ctrl=/Strg/g}if(CustomString.locale.startsWith("lt")){
ctrl=/Vald/g}if(CustomString.locale.startsWith("sl")){ctrl=/Krmilka/gi;alt=/Izmenjalka/gi}
return msg.replace(ctrl,"⌘").replace(alt,"⌥")}return msg};Util.randomString=function(len){
var result="";var ValidCharacters="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for(var i=0;i<len;i++){result+=ValidCharacters.charAt(Math.floor(Math.random(
)*ValidCharacters.length))}return result};Util.requestAnimFrame=function(fn,context){
return window.requestAnimationFrame(fn.bind(context))};Util.cancelAnimFrame=function(id){if(id){
window.cancelAnimationFrame(id)}};Util.lastId=0;Util.templateRe=/\{ *([\w_]+) *\}/g;
Util.isArray=Array.isArray||function(obj){return Object.prototype.toString.call(obj
)==="[object Array]"};
Util.emptyImageUrl="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";Util._canvas=null;
Util.MAX_SAFE_INTEGER=Math.pow(2,53)-1;Util.MIN_SAFE_INTEGER=-Util.MAX_SAFE_INTEGER;return Util}();
app.util=Util;var LOUtil=function(){function LOUtil(){}LOUtil.onRemoveHTMLElement=function(element,
onDetachCallback){var observer=new MutationObserver(function(){function isDetached(el){
return!el.closest("html")}if(isDetached(element)){onDetachCallback();observer.disconnect()}});
observer.observe(document,{childList:true,subtree:true})};LOUtil.startSpinner=function(spinnerCanvas
,spinnerSpeed){spinnerCanvas.width=50;spinnerCanvas.height=50;var context=spinnerCanvas.getContext(
"2d");context.lineWidth=8;context.strokeStyle="grey";var x=spinnerCanvas.width/2;
var y=spinnerCanvas.height/2;var radius=y-context.lineWidth/2;var spinnerInterval=setInterval(
function(){context.clearRect(0,0,x*2,y*2);context.translate(x,y);context.rotate(
spinnerSpeed*Math.PI/180);context.translate(-x,-y);context.beginPath();context.arc(x,y,radius,0,
Math.PI*1.3);context.stroke()},30);return spinnerInterval};LOUtil.getViewIdColor=function(viewId){
var color=LOUtil.darkColors[(viewId+1)%LOUtil.darkColors.length];return color[2]|color[1]<<8|color[0
]<<16};LOUtil.rgbToHex=function(color){return"#"+("000000"+color.toString(16)).slice(-6)};
LOUtil.stringToBounds=function(bounds){var numbers=bounds.match(/\d+/g);
var topLeft=cool.Point.toPoint(parseInt(numbers[0]),parseInt(numbers[1]));
var bottomRight=topLeft.add(cool.Point.toPoint(parseInt(numbers[2]),parseInt(numbers[3])));
return cool.Bounds.toBounds(topLeft,bottomRight)};LOUtil.stringToRectangles=function(strRect){
var matches=strRect.match(/\d+/g);var rectangles=[];if(matches!==null){for(
var itMatch=0;itMatch<matches.length;itMatch+=4){var topLeft=cool.Point.toPoint(parseInt(matches[
itMatch]),parseInt(matches[itMatch+1]));var size=cool.Point.toPoint(parseInt(matches[itMatch+2]),
parseInt(matches[itMatch+3]));var topRight=topLeft.add(cool.Point.toPoint(size.x,0));
var bottomLeft=topLeft.add(cool.Point.toPoint(0,size.y));var bottomRight=topLeft.add(size);
rectangles.push([bottomLeft,bottomRight,topLeft,topRight])}}return rectangles};
LOUtil.stripName=function(name){var strippedName=name.replace(/\.svg$/,"");if(
strippedName.startsWith("lc_")){strippedName=strippedName.substring(3)}return strippedName};
LOUtil.isDarkModeItem=function(name){var strippedName=LOUtil.stripName(name);
return LOUtil.onlydarkModeItems.includes(strippedName)};LOUtil.isCommonForAllMode=function(name){
var strippedName=LOUtil.stripName(name);return LOUtil.commonItems.includes(strippedName)};
LOUtil.getURL=function(path){if(path==="")return"";var customWindow=window;if(
customWindow.host===""&&customWindow.serviceRoot==="")return path;var url=customWindow.makeHttpUrl(
"/browser/"+customWindow.versionPath);if(path.substr(0,1)!=="/")url+="/";url+=path;return url};
LOUtil.setImage=function(img,name,map){var setupIcon=function(){img.src=LOUtil.getImageURL(name);
LOUtil.checkIfImageExists(img)};setupIcon();map.on("themechanged",setupIcon)};
LOUtil.setUserImage=function(img,map,viewId){var defaultImage=LOUtil.getImageURL("user.svg");
var viewInfo=map._viewInfo[viewId];if(
viewInfo!==undefined&&viewInfo.userextrainfo!==undefined&&viewInfo.userextrainfo.avatar!==undefined
){img.src=viewInfo.userextrainfo.avatar;img.addEventListener("error",function(){img.src=defaultImage
LOUtil.checkIfImageExists(img,true)},{once:true});return}img.src=defaultImage;
LOUtil.checkIfImageExists(img,true)};LOUtil.getImageURL=function(imgName){
var defaultImageURL=LOUtil.getURL("images/"+imgName);if(LOUtil.isCommonForAllMode(imgName)){
return defaultImageURL}if(window.prefs.getBoolean("darkTheme")){return LOUtil.getURL(
"images/dark/"+imgName)}
var dummyEmptyImg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="
defaultImageURL=LOUtil.isDarkModeItem(imgName)?dummyEmptyImg:defaultImageURL;return defaultImageURL}
LOUtil.getIconNameOfCommand=function(name,noCommad){if(!name)return"";var alreadyClean=noCommad;
var cleanName=name;if(!alreadyClean||alreadyClean!==true){var prefixLength=".uno:".length;if(
name.substr(0,prefixLength)==".uno:")cleanName=name.substr(prefixLength);
cleanName=encodeURIComponent(cleanName).replace(/%/g,"");cleanName=cleanName.toLowerCase()}
var iconURLAliases={closemobile:"closedocmobile","file-saveas":"saveas","home-search":"recsearch",
searchdialog3finitialfocusreplace3abool3dtrue:"searchdialog","addmb-menu":"ok",closetablet:"view",
defineprintarea:"menuprintranges",deleteprintarea:"delete",sheetrighttoleft:"pararighttoleft",
alignleft:"leftpara",alignright:"rightpara",alignhorizontalcenter:"centerpara",
alignblock:"justifypara",formatsparklinemenu:"insertsparkline",insertdatecontentcontrol:"datefield",
editheaderandfooter:"headerandfooter",exportas:"saveas",insertheaderfooter:"headerandfooter",
previoustrackedchange:"prevrecord",fieldtransparency:"linetransparency",
lb_glow_transparency:"linetransparency",settransparency:"linetransparency",
field_transparency:"linetransparency",selectionlanugagedefault:"updateall",
connectortoolbox:"connectorlines",conditionalformatdialog:"conditionalformatmenu",
groupoutlinemenu:"group",paperwidth:"pagewidth",charspacing:"spacing",
fontworkcharacterspacingfloater:"spacing",tablesort:"datasort",spellcheckignoreall:"spelling",
deleterowbreak:"delbreakmenu",alignmentpropertypanel:"alignvcenter",cellvertcenter:"alignvcenter",
charbackcolor:"backcolor",charmapcontrol:"insertsymbol",insertrowsafter:"insertrowsmenu",
insertobjectchart:"drawchart",textpropertypanel:"sidebartextpanel",spacepara15:"linespacing",
orientationdegrees:"rotation",clearoutline:"delete",docsign:"editdoc",editmenu:"editdoc",
drawtext:"text",inserttextbox:"text",accepttrackedchanges:"acceptchanges",
accepttrackedchange:"acceptchanges",chartlinepanel:"linestyle",linepropertypanel:"linestyle",
xlinestyle:"linestyle",listspropertypanel:"outlinebullet",shadowpropertypanel:"shadowed",
incrementlevel:"outlineleft",menurowheight:"rowheight",menumargins:"pagemargin",
menuorientation:"orientation",menupagesizescalc:"pagesize",menupagesizeswriter:"pagesize",
setoptimalrowheight:"rowheight",cellverttop:"aligntop",scalignmentpropertypanel:"aligntop",
hyperlinkdialog:"inserthyperlink",remotelink:"inserthyperlink",remoteaicontent:"sdrespageobjs",
openhyperlinkoncursor:"inserthyperlink",pageformatdialog:"pagedialog",backgroundcolor:"fillcolor",
cellappearancepropertypanel:"fillcolor",formatarea:"fillcolor",glowcolor:"fillcolor",
sccellappearancepropertypanel:"fillcolor",insertcolumnsafter:"insertcolumnsmenu",
insertnonbreakingspace:"formattingmark",insertcurrentdate:"datefield",
insertdatefieldfix:"datefield",insertdatefield:"datefield",insertdatefieldvar:"datefield",
setparagraphlanguagemenu:"spelldialog",spellingandgrammardialog:"spelldialog",
spellonline:"spelldialog",
styleapply3fstyle3astring3ddefault26familyname3astring3dcellstyles:"fontcolor",
fontworkgalleryfloater:"fontworkpropertypanel",insertfieldctrl:"insertfield",
pagenumberwizard:"insertpagenumberfield",entirerow:"fromrow",
insertcheckboxcontentcontrol:"checkbox",cellvertbottom:"alignbottom",
insertcurrenttime:"inserttimefield",inserttimefieldfix:"inserttimefield",
inserttimefieldvar:"inserttimefield",cancelformula:"cancel",resetattributes:"setdefault",
tabledialog:"tablemenu",insertindexesentry:"insertmultiindex",paperheight:"pageheight",
masterslidespanel:"masterslide",slidemasterpage:"masterslide",tabledeletemenu:"deletetable",
tracechangemode:"trackchanges",deleteallannotation:"deleteallnotes",
sdtabledesignpanel:"tabledesign",tableeditpanel:"tabledesign",tableautofitmenu:"columnwidth",
menucolumnwidth:"columnwidth",hyphenation:"hyphenate",objectbackone:"behindobject",
deleteannotation:"deletenote",areapropertypanel:"chartareapanel","downloadas-png":"insertgraphic",
decrementlevel:"outlineright",acceptformula:"ok",insertannotation:"shownote",
insertcomment:"shownote",objecttitledescription:"shownote",namegroup:"shownote",
incrementindent:"leftindent",outlineup:"moveup",charttypepanel:"diagramtype",
arrangeframemenu:"arrangemenu",bringtofront:"arrangemenu",
scnumberformatpropertypanel:"numberformatincdecimals",graphicpropertypanel:"graphicdialog",
rotateflipmenu:"rotateleft",outlinedown:"movedown",nexttrackedchange:"nextrecord",
toggleorientation:"orientation",configuredialog:"sidebar",modifypage:"sidebar",
parapropertypanel:"paragraphdialog",tablecellbackgroundcolor:"fillcolor",
zoteroArtwork:"zoteroThesis",zoteroAudioRecording:"zoteroThesis",zoteroBill:"zoteroThesis",
zoteroBlogPost:"zoteroThesis",zoteroBookSection:"zoteroBook",zoteroCase:"zoteroThesis",
zoteroConferencePaper:"zoteroThesis",zoteroDictionaryEntry:"zoteroThesis",
zoteroDocument:"zoteroThesis",zoteroEmail:"zoteroThesis",zoteroEncyclopediaArticle:"zoteroThesis",
zoteroFilm:"zoteroThesis",zoteroForumPost:"zoteroThesis",zoteroHearing:"zoteroThesis",
zoteroInstantMessage:"zoteroThesis",zoteroInterview:"zoteroThesis",zoteroLetter:"zoteroThesis",
zoteroMagazineArticle:"zoteroThesis",zoteroWebpage:"zoteroThesis",
zoteroaddeditcitation:"insertauthoritiesentry",zoteroaddnote:"addcitationnote",
zoterorefresh:"updateall",zoterounlink:"unlinkcitation",
zoteroaddeditbibliography:"addeditbibliography",zoteroeditbibliography:"addeditbibliography",
zoterosetdocprefs:"formproperties","sidebardeck.propertydeck":"sidebar",
"downloadas-pdf":"exportpdf","downloadas-direct-pdf":"exportdirectpdf",
"downloadas-epub":"exportepub",languagestatusmenu:"languagemenu",cancelsearch:"cancel",
printoptions:"print",togglesheetgrid:"show",toggleprintgrid:"printgrid","hamburger-tablet":"fold",
exportdirectpdf:"exportpdf",textcolumnspropertypanel:"entirecolumn",
"sidebardeck.stylelistdeck":"editstyle",assignlayout3fwhatlayout3along3d20:"layout00",
assignlayout3fwhatlayout3along3d0:"layout01",assignlayout3fwhatlayout3along3d1:"layout02",
assignlayout3fwhatlayout3along3d3:"layout03",assignlayout3fwhatlayout3along3d19:"layout04",
assignlayout3fwhatlayout3along3d32:"layout05",assignlayout3fwhatlayout3along3d15:"layout06",
assignlayout3fwhatlayout3along3d12:"layout07",assignlayout3fwhatlayout3along3d16:"layout08",
assignlayout3fwhatlayout3along3d14:"layout09",assignlayout3fwhatlayout3along3d18:"layout10",
assignlayout3fwhatlayout3along3d34:"layout11",assignlayout3fwhatlayout3along3d27:"layout12",
assignlayout3fwhatlayout3along3d28:"layout13",assignlayout3fwhatlayout3along3d29:"layout02",
assignlayout3fwhatlayout3along3d30:"layout03",insertpage3fwhatlayout3along3d20:"layout00",
insertpage3fwhatlayout3along3d0:"layout01",insertpage3fwhatlayout3along3d1:"layout02",
insertpage3fwhatlayout3along3d3:"layout03",insertpage3fwhatlayout3along3d19:"layout04",
insertpage3fwhatlayout3along3d32:"layout05",insertpage3fwhatlayout3along3d15:"layout06",
insertpage3fwhatlayout3along3d12:"layout07",insertpage3fwhatlayout3along3d16:"layout08",
insertpage3fwhatlayout3along3d14:"layout09",insertpage3fwhatlayout3along3d18:"layout10",
insertpage3fwhatlayout3along3d34:"layout11",insertpage3fwhatlayout3along3d27:"layout12",
insertpage3fwhatlayout3along3d28:"layout13",insertpage3fwhatlayout3along3d29:"layout02",
insertpage3fwhatlayout3along3d30:"layout03",graphicfilterinvert:"graphicfilterinvert",
graphicfilterpopart:"graphicfilterpopart",graphicfilterremovenoise:"graphicfilterremovenoise",
graphicfiltersharpen:"graphicfiltersharpen",graphicfiltersobel:"graphicfiltersobel",
effects:"pictureeffectsmenu"};if(iconURLAliases[cleanName]){cleanName=iconURLAliases[cleanName]}
return"lc_"+cleanName+".svg"};LOUtil.checkIfImageExists=function(imageElement,imageIsLayoutCritical
){imageElement.addEventListener("error",function(e){if(e.loUtilProcessed){return}if(
imageElement.src&&imageElement.src.includes("/images/branding/dark/")){
imageElement.src=imageElement.src.replace("/images/branding/dark/","/images/dark/");
e.loUtilProcessed=true;return}if(imageElement.src&&(imageElement.src.includes("/images/dark/"
)||imageElement.src.includes("/images/branding/"))){imageElement.src=imageElement.src.replace(
"/images/dark/","/images/");imageElement.src=imageElement.src.replace("/images/branding/","/images/"
);e.loUtilProcessed=true;return}if(imageIsLayoutCritical){
imageElement.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="
e.loUtilProcessed=true;return}imageElement.style.display="none";e.loUtilProcessed=true})};
LOUtil.generateNewFileName=function(oldFileName,suffix){var idx=oldFileName.lastIndexOf(".");
return oldFileName.substring(0,idx)+suffix+oldFileName.substring(idx)};
LOUtil.existsIconForCommand=function(command,docType){var commandName=command.startsWith(".uno:"
)?command.substring(".uno:".length):command;var res=!LOUtil.commandWithoutIcon.find(function(el){
return el.startsWith(commandName)});if(commandName.indexOf("?")!==-1){if(commandName.indexOf(
"SpellCheckIgnore")!==-1||commandName.indexOf("SpellCheckIgnoreAll")!==-1)return true;if((
docType==="spreadsheet"||docType==="presentation")&&commandName.indexOf("LanguageStatus")!==-1
)return true;if(
commandName==="LanguageStatus?Language:string=Current_LANGUAGE_NONE"||commandName==="LanguageStatus?Language:string=Current_RESET_LANGUAGES"||commandName==="LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE"||commandName==="LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES"
)return true;return false}return res};LOUtil.findItemWithAttributeRecursive=function(node,idName,
idValue){var found=null;if(node[idName]===idValue)return node;if(node.children){for(
var i=0;!found&&i<node.children.length;i++)found=LOUtil.findItemWithAttributeRecursive(
node.children[i],idName,idValue)}return found};LOUtil.findIndexInParentByAttribute=function(node,
idName,idValue){if(node.children){for(var i=0;i<node.children.length;i++)if(node.children[i][idName
]===idValue)return i}return-1};LOUtil._doRectanglesIntersect=function(rectangle1,rectangle2){if(
Math.abs(rectangle1[0]+rectangle1[2]*.5-(rectangle2[0]+rectangle2[2]*.5))<.5*(rectangle1[2
]+rectangle2[2])){if(Math.abs(rectangle1[1]+rectangle1[3]*.5-(rectangle2[1]+rectangle2[3]*.5))<.5*(
rectangle1[3]+rectangle2[3]))return true;else return false}else return false};
LOUtil._getIntersectionRectangle=function(rectangle1,rectangle2){if(this._doRectanglesIntersect(
rectangle1,rectangle2)){var x=rectangle1[0]>rectangle2[0]?rectangle1[0]:rectangle2[0];
var y=rectangle1[1]>rectangle2[1]?rectangle1[1]:rectangle2[1];var w=rectangle1[0]+rectangle1[2
]<rectangle2[0]+rectangle2[2]?rectangle1[0]+rectangle1[2]-x:rectangle2[0]+rectangle2[2]-x;
var h=rectangle1[1]+rectangle1[3]<rectangle2[1]+rectangle2[3]?rectangle1[1]+rectangle1[3
]-y:rectangle2[1]+rectangle2[3]-y;return[x,y,w,h]}else return null};
LOUtil.getFileExtension=function(map){var filename=map["wopi"].BaseFileName;
return filename.substring(filename.lastIndexOf(".")+1)};LOUtil.isFileODF=function(map){
var ext=LOUtil.getFileExtension(map);return ext==="odt"||ext==="ods"||ext==="odp"||ext=="odg"};
LOUtil.containsDOMRect=function(viewRect,rect){
return rect.top>=viewRect.top&&rect.right<=viewRect.right&&rect.bottom<=viewRect.bottom&&rect.left>=viewRect.left
};LOUtil.sanitize=function(html){if(DOMPurify.isSupported){return DOMPurify.sanitize(html,{
USE_PROFILES:{html:true}})}return""};LOUtil.darkColors=[[198,146,0],[6,70,162],[87,157,28],[105,43,
157],[197,0,11],[0,128,128],[140,132,0],[53,85,107],[209,118,0]];LOUtil.onlydarkModeItems=[
"invertbackground"];LOUtil.commonItems=["serverauditok","serverauditerror"];
LOUtil.commandWithoutIcon=["InsertPageHeader","InsertPageFooter","FLD_COL_NUMBER",
"MTR_FLD_COL_SPACING","rows","cols","None"];LOUtil.Rectangle=cool.Rectangle;
LOUtil.createRectangle=cool.createRectangle;return LOUtil}();app.LOUtil=LOUtil;
var IconUtil=function(){function IconUtil(){}IconUtil.toSnakeCase=function(text){
return text.replace(/[ _]/gi,"-").replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()};
IconUtil.createMenuItemLink=function(name,iconCommand){
var iconHtml='<span class="context-menu-icon-spacer"></span>';if(
IconUtil.commandsWithIcons.includes(iconCommand)){var iconName=LOUtil.getIconNameOfCommand(
iconCommand);var iconUrl=LOUtil.getImageURL(iconName);
iconHtml='<img class="context-menu-icon" src="'+iconUrl+'" alt>'}return LOUtil.sanitize(
'<a class="context-menu-link '+IconUtil.toSnakeCase(iconCommand
)+'" href="#"> '+iconHtml+" "+name+" </a>")};IconUtil.commandsWithIcons=["Cut","Copy","Paste",
"Delete","CompressGraphic","Crop","FormatPaintbrush","ResetAttributes","NextTrackedChange",
"PreviousTrackedChange","PageDialog","MergeCells","DeleteCell","InsertCell","InsertRowsBefore",
"InsertRowsAfter","InsertColumnsBefore","InsertColumnsAfter","InsertColumnsMenu","DeleteRows",
"DeleteColumns","DeleteTable","SetOptimalColumnWidth","TableDialog","GraphicDialog",
"InsertAnnotation","SpellingAndGrammarDialog","DecrementLevel","TransformDialog","FormatLine",
"FormatArea","SetAnchorToPara","SetAnchorAtChar","SetAnchorToChar","WrapOff","WrapOn","WrapIdeal",
"WrapLeft","WrapRight","WrapThrough","WrapThroughTransparencyToggle","WrapAnchorOnly","WrapContour",
"BringToFront","ObjectForwardOne","ObjectBackOne","SendToBack","SetObjectToForeground",
"SetObjectToBackground","InsertCaptionDialog","OpenHyperlinkOnCursor","EditHyperlink",
"CopyHyperlinkLocation","RemoveHyperlink","RotateRight","RotateLeft","SetAnchorToCell",
"SetAnchorToCellResize","SetAnchorToPage","FormatCellDialog","InsertSparkline","AcceptTrackedChange"
,"RejectTrackedChange","ReinstateTrackedChange","SetDefault","AnimationEffects","ChangeBezier",
"InsertHyperlink","FreezePanes","InsertSheetBefore","InsertSheetAfter","Remove","Protect","Show",
"Hide","MoveSheetLeft","MoveSheetRight","RowHeight","SetOptimalRowHeight","HideRow","ShowRow",
"InsertPage","DuplicatePage","DeletePage","PageSetup","ShowSlide","Hideslide","ColumnWidth",
"HideColumn","ShowColumn","GroupSparklines","UngroupSparklines"];return IconUtil}();
app.IconUtil=IconUtil;var Logger=function(){function Logger(){this._logs=[];this.startTime=null}
Logger.prototype.log=function(msg,direction){var time=Date.now();if(!this.startTime
)this.startTime=time;var maxEntries=100;if(window.enableDebug)maxEntries=1e3;if(
time-this.startTime<60*1e3)maxEntries=500;while(this._logs.length>maxEntries)this._logs.shift();
var maxMsgLen=128;if(msg.length>maxMsgLen)msg=msg.substring(0,maxMsgLen);msg=msg.replace(
/(\r\n|\n|\r)/gm," ");this._logs.push({msg:msg,direction:direction,time:time})};
Logger.prototype._getEntries=function(){this._logs.sort(function(a,b){if(a.time<b.time){return-1}if(
a.time>b.time){return 1}return 0});var data="";for(var i=0;i<this._logs.length;i++){
data+=this._logs[i].time+"."+this._logs[i].direction+"."+this._logs[i].msg;data+="\n"}return data};
Logger.prototype.print=function(){window.app.console.log("Queued log messages:");
window.app.console.log(this._getEntries());window.app.console.log("End of queued log messages:")};
Logger.prototype.save=function(){var blob=new Blob([this._getEntries()],{type:"text/csv"});
var a=document.createElement("a");a.download=Date.now()+".csv";a.href=window.URL.createObjectURL(
blob);a.dataset.downloadurl=["text/csv",a.download,a.href].join(":");var e=new MouseEvent("click",{
bubbles:true,cancelable:false,view:window,detail:0,screenX:0,screenY:0,clientX:0,clientY:0,
ctrlKey:false,altKey:false,shiftKey:false,metaKey:false,button:0,relatedTarget:null});
a.dispatchEvent(e)};Logger.prototype.clear=function(){this._logs=[]};return Logger}();
app.Log=new Logger;var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var DebugManager=function(){function DebugManager(map){this._map=map;this._docLayer=null;
this._painter=null;this.debugOn=false;this.debugNeverStarted=true}
DebugManager.prototype.toggle=function(){if(!this.debugOn){this._start()}else{this._stop()}
this._painter.update()};DebugManager.prototype._start=function(){this._docLayer=this._map._docLayer;
this._painter=this._map._docLayer._painter;this.debugOn=true;this.debugNeverStarted=false;
this._controls={};this._controls["header"]=window.L.control.layers({},{},{collapsed:false}).addTo(
this._map);var b=document.createElement("b");b.append(_("Debug Tools"));this._controls["header"
]._container.prepend(b);this._controls["header"]._container.append(_("Ctrl+Shift+Alt+D to exit"));
this._toolLayers=[];this._addDebugTools();this._automatedUserQueue=[];this._automatedUserTasks={};
var wopiHostId=document.getElementById("wopi-host-id-cloned");if(wopiHostId
)wopiHostId.style.display="block";var servedBy=document.getElementById("served-by-cloned");if(
servedBy)servedBy.style.display="flex"};DebugManager.prototype._stop=function(){var e_1,_a,e_2,_b;
this.debugOn=false;try{for(var _c=__values(this._toolLayers),_d=_c.next();!_d.done;_d=_c.next()){
var tool=_d.value;this._map.removeLayer(tool)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
_d&&!_d.done&&(_a=_c.return))_a.call(_c)}finally{if(e_1)throw e_1.error}}var keys=Object.keys(
this._controls);try{for(var keys_1=__values(keys),keys_1_1=keys_1.next(
);!keys_1_1.done;keys_1_1=keys_1.next()){var category=keys_1_1.value;this._controls[category
].remove()}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(keys_1_1&&!keys_1_1.done&&(
_b=keys_1.return))_b.call(keys_1)}finally{if(e_2)throw e_2.error}}this._controls={};
var wopiHostId=document.getElementById("wopi-host-id-cloned");if(wopiHostId
)wopiHostId.style.display="none";var servedBy=document.getElementById("served-by-cloned");if(
servedBy)servedBy.style.display="none"};DebugManager.prototype._addDebugTool=function(tool){if(!(
tool.category in this._controls)){this._controls[tool.category]=window.L.control.layers({},{},{
collapsed:false}).addTo(this._map);var b=document.createElement("b");b.append(tool.category);
this._controls[tool.category]._container.prepend(b)}var layer=new window.L.LayerGroup;
this._toolLayers.push(layer);this._controls[tool.category]._addLayer(layer,tool.name,true);
this._controls[tool.category]._update();this._map.on("layeradd",function(e){if(e.layer===layer){
tool.onAdd()}},this);this._map.on("layerremove",function(e){if(e.layer===layer){tool.onRemove()}},
this);if(tool.startsOn){this._map.addLayer(layer)}};DebugManager.prototype._addDebugTools=function(
){var self=this;this._addDebugTool({name:"Data Overlay",category:"Display",startsOn:true,
onAdd:function(){self.overlayOn=true;self._overlayData={};self._painter._addDebugOverlaySection()},
onRemove:function(){self.overlayOn=false;self._overlayData={};
self._painter._removeDebugOverlaySection()}});this._addDebugTool({name:"Tile Overlays",
category:"Display",startsOn:false,onAdd:function(){self.tileOverlaysOn=true;self._painter.update()},
onRemove:function(){self.tileOverlaysOn=false;self._painter.update()}});this._addDebugTool({
name:"Tile Invalidations",category:"Display",startsOn:false,onAdd:function(){
self.tileInvalidationsOn=true;self._tileInvalidationMessages=new Map;self._tileInvalidationId=0;
self._tileInvalidationKeypressQueue=[];self._tileInvalidationKeypressTimes=self.getTimeArray();
self._tileInvalidationTimeout()},onRemove:function(){self.tileInvalidationsOn=false;
self.clearOverlayMessage("tileInvalidationMessages");self.clearOverlayMessage("tileInvalidationTime"
);clearTimeout(self._tileInvalidationTimeoutId);self._painter.update()}});this._addDebugTool({
name:"Tile data",category:"Display",startsOn:true,onAdd:function(){self.tileDataOn=true;
self._tileDataTotalMessages=0;self._tileDataTotalLoads=0;self._tileDataTotalUpdates=0;
self._tileDataTotalDeltas=0;self._tileDataTotalInvalidates=0},onRemove:function(){
self.tileDataOn=false;self.clearOverlayMessage("top-tileData")}});this._addDebugTool({
name:"Show Clipboard",category:"Display",startsOn:false,onAdd:function(){self._map._textInput.debug(
true)},onRemove:function(){self._map._textInput.debug(false)}});this._addDebugTool({
name:"Tile pixel grid section",category:"Display",startsOn:false,onAdd:function(){
self._painter._addTilePixelGridSection()},onRemove:function(){
self._painter._removeTilePixelGridSection()}});this._addDebugTool({name:"Tile preload map",
category:"Display",startsOn:false,onAdd:function(){self._painter._addPreloadMap()},
onRemove:function(){self._painter._removePreloadMap()}});if(this._docLayer.isCalc()){
this._addDebugTool({name:"Splits section",category:"Display",startsOn:false,onAdd:function(){
self._painter._addSplitsSection()},onRemove:function(){self._painter._removeSplitsSection()}})}
this._addDebugTool({name:"Ping",category:"Display",startsOn:false,onAdd:function(){self.pingOn=true;
self._pingQueue=[];self._pingTimes=self.getTimeArray();self._pingTimeout()},onRemove:function(){
self.pingOn=false;self.clearOverlayMessage("rendercount");self.clearOverlayMessage("ping");
clearTimeout(self._pingTimeoutId)}});this._addDebugTool({name:"Performance Tracing",
category:"Logging",startsOn:app.socket.traceEventRecordingToggle,onAdd:function(){
app.socket.setTraceEventLogging(true)},onRemove:function(){app.socket.setTraceEventLogging(false)}})
this._addDebugTool({name:"Protocol Logging",category:"Logging",startsOn:true,onAdd:function(){
window.setLogging(true);app.Log.print()},onRemove:function(){window.setLogging(false)}});
this._addDebugTool({name:"Log incoming messages",category:"Logging",startsOn:true,onAdd:function(){
self.logIncomingMessages=true},onRemove:function(){self.logIncomingMessages=false}});
this._addDebugTool({name:"Log outgoing messages",category:"Logging",startsOn:true,onAdd:function(){
self.logOutgoingMessages=true},onRemove:function(){self.logOutgoingMessages=false}});
this._addDebugTool({name:"Log keyboard events",category:"Logging",startsOn:true,onAdd:function(){
self.logKeyboardEvents=true},onRemove:function(){self.logKeyboardEvents=false}});this._addDebugTool(
{name:"Log Trace",category:"Logging",startsOn:false,onAdd:function(){self.logTrace=true},
onRemove:function(){self.logTrace=false}});this._addDebugTool({name:"Tile Dumping",
category:"Logging",startsOn:false,onAdd:function(){app.socket.sendMessage("toggletiledumping true")
},onRemove:function(){app.socket.sendMessage("toggletiledumping false")}});this._addDebugTool({
name:"Debug Deltas",category:"Logging",startsOn:false,onAdd:function(){TileManager.setDebugDeltas(
true)},onRemove:function(){TileManager.setDebugDeltas(false)}});this._addDebugTool({
name:"Event delay watchdog",category:"Logging",startsOn:true,onAdd:function(){
self.eventDelayWatchdog=true;self._eventDelayTimeout=null;self._lastEventDelayTime=0;
self._lastEventDelay=0},onRemove:function(){self.eventDelayWatchdog=false;self.clearOverlayMessage(
"eventDelayTime");if(self._eventDelayTimeout)clearTimeout(self._eventDelayTimeout);
delete self._eventDelayTimeout;delete self._eventDelayWatchStart;delete self._lastEventDelayTime;
delete self._lastEventDelay}});this._addDebugTool({name:"Typer",category:"Functionality",
startsOn:false,onAdd:function(){
self._typerLorem="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n"
self._typerLoremPos=0;self._typerTimeout()},onRemove:function(){clearTimeout(self._typerTimeoutId)}}
);this._addDebugTool({name:"Randomize user settings",category:"Functionality",
startsOn:!!window.coolParams.get("randomUser"),onAdd:function(){self._randomizeSettings()},
onRemove:function(){}});this._addDebugTool({name:"Enable automated user",category:"Automated User",
startsOn:false,onAdd:function(){self._automatedUserTimeout()},onRemove:function(){clearTimeout(
self._automatedUserTimeoutId);self._automatedUserTask=undefined;self._automatedUserPhase=0}});if(
this._docLayer.isCalc()){this._addDebugTool({name:"Click, type, delete, cells & formulas",
category:"Automated User",startsOn:false,onAdd:function(){self._automatedUserAddTask(this.name,
self._automatedUserTypeCellFormula.bind(self))},onRemove:function(){self._automatedUserRemoveTask(
this.name)}})}this._addDebugTool({name:"Insert and delete shape",category:"Automated User",
startsOn:false,onAdd:function(){self._automatedUserAddTask(this.name,
self._automatedUserInsertTypeShape.bind(self))},onRemove:function(){self._automatedUserRemoveTask(
this.name)}});if(this._docLayer.isCalc()){this._addDebugTool({name:"Resize rows and columns",
category:"Automated User",startsOn:false,onAdd:function(){self._automatedUserAddTask(this.name,
self._automatedUserResizeRowsColumns.bind(self))},onRemove:function(){self._automatedUserRemoveTask(
this.name)}})}if(this._docLayer.isCalc()){this._addDebugTool({name:"Insert rows and columns",
category:"Automated User",startsOn:false,onAdd:function(){self._automatedUserAddTask(this.name,
self._automatedUserInsertRowsColumns.bind(self))},onRemove:function(){self._automatedUserRemoveTask(
this.name)}})}if(this._docLayer.isCalc()){this._addDebugTool({name:"Delete rows and columns",
category:"Automated User",startsOn:false,onAdd:function(){self._automatedUserAddTask(this.name,
self._automatedUserDeleteRowsColumns.bind(self))},onRemove:function(){self._automatedUserRemoveTask(
this.name)}})}};DebugManager.prototype._randomizeSettings=function(){
var isDark=window.prefs.getBoolean("darkTheme");if(Math.random()<.5){window.app.console.log(
"Randomize Settings: Toggle dark mode to "+(isDark?"Light":"Dark"));
this._map.uiManager.toggleDarkMode()}else{window.app.console.log(
"Randomize Settings: Leave dark mode as "+(isDark?"Dark":"Light"))}var targetZoom=Math.floor(
Math.random()*9)+6;window.app.console.log("Randomize Settings: Set zoom to "+targetZoom);
this._map.setZoom(targetZoom,null,false);var isSpellCheck=this._map["stateChangeHandler"
].getItemValue(".uno:SpellOnline");if(Math.random()<.5){window.app.console.log(
"Randomize Settings: Toggle spell check to "+(isSpellCheck=="true"?"off":"on"));
this._map.sendUnoCommand(".uno:SpellOnline")}else{window.app.console.log(
"Randomize Settings: Leave spell check as "+(isSpellCheck=="true"?"on":"off"))}if(
this._docLayer.isWriter()){if(Math.random()<.5){window.app.console.log(
"Randomize Settings: Toggle formatting marks");this._map.sendUnoCommand(".uno:ControlCodes")}else{
window.app.console.log("Randomize Settings: Leave formatting marks")}}if(this._docLayer.isCalc()){
var docSize=this._map.getDocSize();var maxX=docSize.x;var maxY=docSize.y;var positions=[{x:maxX,y:0}
,{x:0,y:maxY},{x:maxX,y:maxY},{x:maxX/2,y:maxY/2}];var pos=positions[Math.floor(Math.random(
)*positions.length)];var viewSize=this._map.getSize();var centerPos={x:pos.x+viewSize.x/2,
y:pos.y+viewSize.y/2};var centerTwips=this._docLayer._pixelsToTwips(centerPos);
window.app.console.log("Randomize Settings: Move to ",pos," click at ",centerPos,centerTwips);
app.map._docLayer.scrollToPos(pos);this._docLayer._postMouseEvent("buttondown",centerTwips.x,
centerTwips.y,1,1,0);this._docLayer._postMouseEvent("buttonup",centerTwips.x,centerTwips.y,1,1,0)}
if(!this._map._docLoadedOnce){setTimeout(this._randomizeSidebar.bind(this),1e3)}else{
this._randomizeSidebar()}this._painter.update()};DebugManager.prototype._randomizeSidebar=function(
){var sidebars=["none",".uno:SidebarDeck.PropertyDeck",".uno:Navigator"];if(
this._docLayer.isImpress()){sidebars=sidebars.concat([".uno:CustomAnimation",".uno:ModifyPage"])}
var sidebar=sidebars[Math.floor(Math.random()*sidebars.length)];window.app.console.log(
"Randomize Settings: Target sidebar: "+sidebar);if(this._map.sidebar&&this._map.sidebar.isVisible()
){var currentSidebar=this._map.sidebar.getTargetDeck();if(sidebar=="none"){window.app.console.log(
"Randomize Settings: Remove sidebar");this._map.sendUnoCommand(currentSidebar)}else if(
sidebar==currentSidebar){window.app.console.log("Randomize Settings: Leave sidebar as "+sidebar)
}else{window.app.console.log("Randomize Settings: Switch sidebar to "+sidebar);
this._map.sendUnoCommand(sidebar)}}else{if(sidebar=="none"){window.app.console.log(
"Randomize Settings: Leave sidebar off")}else{window.app.console.log(
"Randomize Settings: Open sidebar "+sidebar);this._map.sendUnoCommand(sidebar)}}};
DebugManager.prototype._automatedUserAddTask=function(name,taskFn){this._automatedUserTasks[name
]=taskFn;if(!this._automatedUserQueue.includes(name)){this._automatedUserQueue.push(name)}};
DebugManager.prototype._automatedUserRemoveTask=function(name){if(this._automatedUserQueue.includes(
name)){this._automatedUserQueue.splice(this._automatedUserQueue.indexOf(name),1)}};
DebugManager.prototype._automatedUserTimeout=function(){if(!this._automatedUserTask){
window.app.console.log("Automated User: Pick a new task. Current queue: ",this._automatedUserQueue);
this._automatedUserTask=this._automatedUserQueue.shift();this._automatedUserPhase=0}if(
this._automatedUserTask&&this._automatedUserPhase==0){window.app.console.log(
"Automated User: Starting task "+this._automatedUserTask);this._automatedUserQueue.push(
this._automatedUserTask)}if(this._automatedUserTask){window.app.console.log(
"Automated User: Current task: "+this._automatedUserTask+" Current phase: "+this._automatedUserPhase
);var taskFn=this._automatedUserTasks[this._automatedUserTask];var waitTime=taskFn(
this._automatedUserPhase);this._automatedUserPhase++;if(waitTime==0){window.app.console.log(
"Automated User: Task complete: "+this._automatedUserTask);this._automatedUserTask=undefined;
this._automatedUserPhase=0}this._automatedUserTimeoutId=setTimeout(this._automatedUserTimeout.bind(
this),waitTime)}else{window.app.console.log("Automated User: Waiting for tasks");
this._automatedUserTimeoutId=setTimeout(this._automatedUserTimeout.bind(this),1e3)}};
DebugManager.prototype._automatedUserTypeCellFormula=function(phase){var waitTime=0;switch(phase){
case 0:{window.app.console.log("Automated User: Click in center");
var pos=this._docLayer._latLngToTwips(this._map.getCenter());this._docLayer._postMouseEvent(
"buttondown",pos.x,pos.y,1,1,0);this._docLayer._postMouseEvent("buttonup",pos.x,pos.y,1,1,0);
waitTime=500}break;case 1:{window.app.console.log("Automated User: Type text");this._typeText(
"asdf\nqwer\n",100);waitTime=1e3}break;case 2:{window.app.console.log(
"Automated User: Click formula bar");this._map.sendUnoCommand(".uno:StartFormula");waitTime=500}
break;case 3:{window.app.console.log("Automated User: Type formula");this._typeText("A1\n",100);
waitTime=1e3}break;case 4:{window.app.console.log("Automated User: Delete row");
this._docLayer.postKeyboardEvent("input",0,1025);this._docLayer.postKeyboardEvent("input",0,1025);
this._map.sendUnoCommand(".uno:DeleteRows");waitTime=1e3}break;case 5:{window.app.console.log(
"Automated User: Delete cells");app.socket.sendMessage("removetextcontext id=0 before=0 after=1");
this._docLayer.postKeyboardEvent("input",0,1025);app.socket.sendMessage(
"removetextcontext id=0 before=0 after=1");waitTime=500}break}return waitTime};
DebugManager.prototype._automatedUserInsertTypeShape=function(phase){var waitTime=0;switch(phase){
case 0:{window.app.console.log("Automated User: Insert Shape");var shapes=["rectangle","circle",
"diamond","pentagon"];var shape=shapes[Math.floor(Math.random()*shapes.length)];
this._map.sendUnoCommand(".uno:BasicShapes."+shape);waitTime=1e3}break;case 1:{
window.app.console.log("Automated User: Type in Shape");this._docLayer.postKeyboardEvent("input",0,
1280);this._typeText("textinshape",100);waitTime=1500}break;case 2:{window.app.console.log(
"Automated User: Type Escape");this._docLayer.postKeyboardEvent("input",0,1281);waitTime=500}break;
case 3:{window.app.console.log("Automated User: Select Shape");
var pos=this._docLayer._latLngToTwips(this._map.getCenter());this._docLayer._postMouseEvent(
"buttondown",pos.x,pos.y,1,1,0);this._docLayer._postMouseEvent("buttonup",pos.x,pos.y,1,1,0);
waitTime=1e3}break;case 4:{window.app.console.log("Automated User: Delete Shape");
app.socket.sendMessage("removetextcontext id=0 before=0 after=1");waitTime=1e3}break}return waitTime
};DebugManager.prototype._automatedUserResizeRowsColumns=function(phase){var waitTime=0;switch(phase
){case 0:{window.app.console.log("Automated User: Resize row smaller");
app.sectionContainer.getSectionWithName("row header")._selectRow(1,0);this._map.sendUnoCommand(
'.uno:RowHeight {"RowHeight":{"type":"unsigned short","value":200},"Row":{"type":"long","value":2}}'
);waitTime=2e3}break;case 1:{window.app.console.log("Automated User: Resize row larger");
app.sectionContainer.getSectionWithName("row header")._selectRow(1,0);this._map.sendUnoCommand(
'.uno:RowHeight {"RowHeight":{"type":"unsigned short","value":2000},"Row":{"type":"long","value":2}}'
);waitTime=2e3}break;case 2:{window.app.console.log("Automated User: Resize row auto");
app.sectionContainer.getSectionWithName("row header")._selectRow(1,0);this._map.sendUnoCommand(
'.uno:SetOptimalRowHeight {"aExtraHeight":{"type":"unsigned short","value":0}}');waitTime=2e3}break;
case 3:{window.app.console.log("Automated User: Resize column smaller");
app.sectionContainer.getSectionWithName("column header")._selectColumn(1,0);
this._map.sendUnoCommand(
'.uno:ColumnWidth {"ColumnWidth":{"type":"unsigned short","value":400},"Column":{"type":"long","value":2}}'
);waitTime=2e3}break;case 4:{window.app.console.log("Automated User: Resize column larger");
app.sectionContainer.getSectionWithName("column header")._selectColumn(1,0);
this._map.sendUnoCommand(
'.uno:ColumnWidth {"ColumnWidth":{"type":"unsigned short","value":8000},"Column":{"type":"long","value":2}}'
);waitTime=2e3}break;case 5:{window.app.console.log("Automated User: Resize column auto");
app.sectionContainer.getSectionWithName("column header")._selectColumn(1,0);
this._map.sendUnoCommand(
'.uno:SetOptimalColumnWidthDirect {"aExtraHeight":{"type":"unsigned short","value":0}}');
waitTime=2e3}break}return waitTime};DebugManager.prototype._automatedUserInsertRowsColumns=function(
phase){var waitTime=0;switch(phase){case 0:{window.app.console.log("Automated User: Insert row");
app.sectionContainer.getSectionWithName("row header")._selectRow(1,0);
app.sectionContainer.getSectionWithName("row header").insertRowAbove(1);waitTime=2e3}break;case 1:{
window.app.console.log("Automated User: Delete column");app.sectionContainer.getSectionWithName(
"column header")._selectColumn(1,0);app.sectionContainer.getSectionWithName("column header"
).insertColumnBefore(1);waitTime=2e3}break}return waitTime};
DebugManager.prototype._automatedUserDeleteRowsColumns=function(phase){var waitTime=0;switch(phase){
case 0:{window.app.console.log("Automated User: Delete row");
app.sectionContainer.getSectionWithName("row header")._selectRow(1,0);
app.sectionContainer.getSectionWithName("row header").deleteRow(1);waitTime=2e3}break;case 1:{
window.app.console.log("Automated User: Delete column");app.sectionContainer.getSectionWithName(
"column header")._selectColumn(1,0);app.sectionContainer.getSectionWithName("column header"
).deleteColumn(1);waitTime=2e3}break}return waitTime};DebugManager.prototype._typerTimeout=function(
){var letter=this._typerLorem.charCodeAt(this._typerLoremPos%this._typerLorem.length);
this._typeChar(letter);this._typerLoremPos++;this._typerTimeoutId=setTimeout(
this._typerTimeout.bind(this),50)};DebugManager.prototype._typeText=function(text,delayMs){for(
var i=0;i<text.length;i++){if(delayMs){setTimeout(window.L.bind(this._typeChar,this,text.charCodeAt(
i)),i*delayMs)}else{this._typeChar(text.charCodeAt(i))}}};DebugManager.prototype._typeChar=function(
charCode){if(this.tileInvalidationsOn){this.addTileInvalidationKeypress()}if(
charCode==="\n".charCodeAt(0)){this._docLayer.postKeyboardEvent("input",0,1280)}else{
this._docLayer.postKeyboardEvent("input",charCode,0)}};
DebugManager.prototype.setOverlayMessage=function(id,message){if(this.overlayOn){this._overlayData[
id]=message}};DebugManager.prototype.clearOverlayMessage=function(id){if(
this.overlayOn&&this._overlayData[id]){delete this._overlayData[id]}};
DebugManager.prototype.getOverlayMessages=function(){if(this.tileDataOn)this._tileDataUpdateOverlay(
);return this._overlayData};DebugManager.prototype.getTimeArray=function(){return{count:0,ms:0,
best:Number.MAX_SAFE_INTEGER,worst:0,date:0}};DebugManager.prototype.updateTimeArray=function(times,
value){if(value<times.best){times.best=value}if(value>times.worst){times.worst=value}times.ms+=value
times.count++;return"best: "+times.best+" ms, worst: "+times.worst+" ms, avg: "+Math.round(
times.ms/times.count)+" ms, last: "+value+" ms"};
DebugManager.prototype._tileDataUpdateOverlay=function(){var messages=this._tileDataTotalMessages;
var loads=this._tileDataTotalLoads;var deltas=this._tileDataTotalDeltas;
var updates=this._tileDataTotalUpdates;var invalidates=this._tileDataTotalInvalidates;
this.setOverlayMessage("top-tileData",
"Total tile messages: "+messages+"\n"+"loads: "+loads+" "+"deltas: "+deltas+" "+"updates: "+updates+"\n"+"invalidates: "+invalidates+"\n"+"Tile update waste: "+Math.round(
100*updates/(updates+deltas))+"%\n"+"New Tile ratio: "+Math.round(100*loads/(loads+updates+deltas)
)+"%")};DebugManager.prototype.tileDataAddMessage=function(){this._tileDataTotalMessages++};
DebugManager.prototype.tileDataAddLoad=function(){this._tileDataTotalLoads++};
DebugManager.prototype.tileDataAddUpdate=function(){this._tileDataTotalUpdates++};
DebugManager.prototype.tileDataAddDelta=function(){this._tileDataTotalDeltas++};
DebugManager.prototype.tileDataAddInvalidate=function(){this._tileDataTotalInvalidates++};
DebugManager.prototype._tileInvalidationTimeout=function(){var e_3,_a;
var keys=this._tileInvalidationMessages.keys();try{for(var keys_2=__values(keys),
keys_2_1=keys_2.next();!keys_2_1.done;keys_2_1=keys_2.next()){var key=keys_2_1.value;if(
key<this._tileInvalidationId-5){this._tileInvalidationMessages.delete(key)}}}catch(e_3_1){e_3={
error:e_3_1}}finally{try{if(keys_2_1&&!keys_2_1.done&&(_a=keys_2.return))_a.call(keys_2)}finally{if(
e_3)throw e_3.error}}this._tileInvalidationTimeoutId=setTimeout(window.L.bind(
this._tileInvalidationTimeout,this),50)};
DebugManager.prototype.addTileInvalidationKeypress=function(){if(!this.tileInvalidationsOn){return}
this._tileInvalidationKeypressQueue.push(+new Date)};
DebugManager.prototype.addTileInvalidationMessage=function(message){if(!this.tileInvalidationsOn){
return}this._tileInvalidationMessages.set(this._tileInvalidationId-1,message);var messages="";for(
var i=this._tileInvalidationId-1;i>this._tileInvalidationId-6;i--){if(
i>=0&&this._tileInvalidationMessages.has(i)){messages+=""+i+": "+this._tileInvalidationMessages.get(
i)+"\n"}}this.setOverlayMessage("tileInvalidationMessages",messages)};
DebugManager.prototype.addTileInvalidationRectangle=function(rectangleArray,command){if(
!this.tileInvalidationsOn){return}var signX=this._docLayer.isCalcRTL()?-1:1;
var absTopLeftTwips=cool.Point.toPoint(rectangleArray[0]*signX,rectangleArray[1]);
var absBottomRightTwips=cool.Point.toPoint((rectangleArray[0]+rectangleArray[2])*signX,
rectangleArray[1]+rectangleArray[3]);this._tileInvalidationMessages.set(this._tileInvalidationId,
command);this._tileInvalidationId++;var x=absTopLeftTwips.x*app.twipsToPixels;
var y=absTopLeftTwips.y*app.twipsToPixels;var w=(absBottomRightTwips.x-absTopLeftTwips.x
)*app.twipsToPixels;var h=(absBottomRightTwips.y-absTopLeftTwips.y)*app.twipsToPixels;
InvalidationRectangleSection.setRectangle(x,y,w,h);var now=+new Date;var oldestKeypress;do{
oldestKeypress=this._tileInvalidationKeypressQueue.shift()}while(
oldestKeypress&&now-oldestKeypress>1e3);if(oldestKeypress){var timeText=this.updateTimeArray(
this._tileInvalidationKeypressTimes,now-oldestKeypress);this.setOverlayMessage(
"tileInvalidationTime","Tile invalidation time: "+timeText)}};
DebugManager.prototype._pingTimeout=function(){this._pingQueue.push(+new Date);
app.socket.sendMessage("ping");this._pingTimeoutId=setTimeout(this._pingTimeout.bind(this),2e3)};
DebugManager.prototype.reportPong=function(rendercount){if(!this.pingOn){return}
this.setOverlayMessage("rendercount","Server rendered tiles: "+rendercount);
var oldestPing=this._pingQueue.shift();if(oldestPing){var now=+new Date;
var timeText=this._map._debug.updateTimeArray(this._pingTimes,now-oldestPing);
this.setOverlayMessage("ping","Server ping time: "+timeText)}};
DebugManager.prototype.timeEventDelay=function(){var _this=this;if(
!this.eventDelayWatchdog||this._eventDelayTimeout!==null)return;
this._eventDelayWatchStart=performance.now();this._eventDelayTimeout=setTimeout(function(){
_this._eventDelayTimeout=null;_this.reportEventDelay(performance.now()-_this._eventDelayWatchStart)}
,0)};DebugManager.prototype.reportEventDelay=function(delayMs){if(!this.eventDelayWatchdog)return;
var slow_time_display_timeout=3e3;var slow_time_threshold=50;var very_slow_time_threshold=250;
var currentTime=performance.now();if(
this._lastEventDelay<slow_time_threshold||delayMs>this._lastEventDelay||currentTime-this._lastEventDelayTime>slow_time_display_timeout
){this._lastEventDelayTime=currentTime;this._lastEventDelay=delayMs;this.setOverlayMessage(
"top-eventDelayTime","Event handling delay: "+Math.ceil(delayMs)+"ms");if(
delayMs>very_slow_time_threshold){var msg=_(
"Event handling has been delayed for an unexpectedly long time: {0}ms");
this._map.uiManager.showInfoModal("cool_alert","",msg.replace("{0}",delayMs.toString()),"",_("OK"))}
}};return DebugManager}();app.DebugManager=DebugManager;window.L.version="0.8-dev";
var errorMessages={};var lang=window.coolParams.get("lang");if(lang){String.locale=lang}else{
String.locale="en-US"}errorMessages.diskfull=_("No disk space left on server.");
errorMessages.emptyhosturl=_(
"The host URL is empty. The coolwsd server is probably misconfigured, please contact the administrator."
);errorMessages.limitreached=_(
"This is an unsupported version of {productname}. To avoid the impression that it is suitable for deployment in enterprises, this message appears when more than {docs} documents or {connections} connections are in use concurrently."
);errorMessages.infoandsupport=_("More information and support");errorMessages.limitreachedprod=_(
"This service is limited to {0} documents, and {1} connections total by the admin. This limit has been reached. Please try again later."
);errorMessages.serviceunavailable=_(
"Service is unavailable. Please try again later and report to your administrator if the issue persists."
);errorMessages.unauthorized=_(
"Unauthorized WOPI host. Please try again later and report to your administrator if the issue persists."
);errorMessages.verificationerror=_("Authorization error was: '{errormessage}'.");
errorMessages.wrongwopisrc=_("Wrong or missing WOPISrc parameter, please contact support.");
errorMessages.sessionexpiry=_(
"Your session will expire in {time}. Please save your work and refresh the session (or webpage) to continue. You might need to login again."
);errorMessages.sessionexpired=_(
"Your session has expired. Further changes to the document might not be saved. Please refresh the session (or webpage) to continue. You might need to login again."
);errorMessages.faileddocloading=_(
"Failed to load the document. Please ensure the file type is supported and not corrupted, and try again."
);errorMessages.invalidLink=_("Invalid link: '{url}'");errorMessages.leaving=_(
"You are leaving the document. The following web page will open in a new tab: ");
errorMessages.docloadtimeout=_(
"Failed to load the document. This document is either malformed or is taking more resources than allowed. Please contact the administrator."
);errorMessages.docunloadingretry=_("Cleaning up the document from the last session.");
errorMessages.docunloadinggiveup=_(
"We are in the process of cleaning up this document from the last session, please try again later.")
errorMessages.clusterconfiguration=_(
"Your {productname} cluster appear to be mis-configured or scaling rapidly - please contact your system administrator. Continuing with editing may result in multiple users not seeing each other, conflicts in the document storage and/or copy/paste problems. Expected serverId {0} for routeToken {1} but connected to serverId {2}"
);errorMessages.websocketproxyfailure=_(
"Failed to establish socket connection or socket connection closed unexpectedly. The reverse proxy might be misconfigured, please contact the administrator."
);errorMessages.websocketgenericfailure=_(
"Failed to establish socket connection or socket connection closed unexpectedly.");if(
window.ThisIsAMobileApp){errorMessages.storage={loadfailed:_("Failed to load document."),
savediskfull:_("Save failed due to no disk space left. Document will now be read-only."),
savetoolarge:_(
"The document is too large or no disk space left to save. Document will now be read-only."),
saveunauthorized:_(
"Document cannot be saved due to expired session, please reopen the document to continue."),
savefailed:_("Document cannot be saved."),renamefailed:_("Document cannot be renamed.")}}else{
errorMessages.storage={loadfailed:_(
"Failed to read document from storage, please try to load the document again."),savediskfull:_(
"Save failed due to no storage space left. Document will now be read-only. Please make sure enough disk space is available and try to save again."
),savetoolarge:_(
"Save failed because the document is too large or exceeds the remaining storage space. The document will now be read-only but you may still download it now to preserve a copy locally."
),saveunauthorized:_(
"Document cannot be saved due to expired session, please reload the page to continue."),
savefailed:_("Document cannot be saved, please check your permissions."),renamefailed:_(
"Document cannot be renamed, please check your permissions."),saveasfailed:_(
"Document cannot be exported. Please try again.")}}errorMessages.uploadfile={notfound:_(
"Uploading file to server failed, file not found."),toolarge:_(
"Uploading file to server failed, the file is too large.")};if(typeof window!=="undefined"){
window.errorMessages=errorMessages}var unoCommandsArray={AcceptAllTrackedChanges:{text:{context:_(
"Accept All Changes"),menu:_("Accept All")}},AcceptTrackedChange:{text:{context:_("Accept Change"),
menu:_("Accept")}},AcceptTrackedChangeToNext:{text:{context:_(
"Accept Track Change and select the next one"),menu:_("Accept and Move to Next")}},
AcceptTrackedChanges:{text:{context:_("Manage Track Changes"),menu:_("~Manage...")}},
AccessibilityCheck:{text:{menu:_("~Accessibility Check...")}},AddName:{spreadsheet:{menu:_(
"~Define...")}},AddPrintArea:{spreadsheet:{menu:_("~Add")}},AddToWordbook:{global:{menu:_(
"Add To Dictionary")}},AlignBlock:{spreadsheet:{menu:_("Justified")}},AlignBottom:{spreadsheet:{
menu:_("Align Bottom")},text:{menu:_("Align Bottom to Anchor")}},AlignCenter:{global:{menu:_(
"~Centered")}},AlignDown:{global:{menu:_("~Bottom")}},AlignHorizontalCenter:{spreadsheet:{menu:_(
"Align Center")},text:{menu:_("Center Horizontal")}},AlignLeft:{spreadsheet:{menu:_("Align Left")},
text:{menu:_("Align Left")}},AlignMiddle:{global:{menu:_("~Middle")}},AlignRight:{spreadsheet:{
menu:_("Align Right")},text:{menu:_("Align Right")}},AlignTop:{spreadsheet:{menu:_("Align Top")},
text:{menu:_("Align Top to Anchor")}},AlignUp:{global:{menu:_("~Top")}},AlignVCenter:{spreadsheet:{
menu:_("Center Vertically")}},AnalysisOfVarianceDialog:{spreadsheet:{menu:_(
"~Analysis of Variance (ANOVA)...")}},AnchorMenu:{global:{menu:_("Anc~hor")}},AnimationEffects:{
presentation:{menu:_("~Interaction...")}},ArrangeFrameMenu:{text:{menu:_("Arrange")}},ArrangeMenu:{
global:{menu:_("A~rrange")},presentation:{menu:_("~Arrange")}},"ArrowShapes.chevron":{global:{
menu:_("Chevron")}},"ArrowShapes.circular-arrow":{global:{menu:_("Circular Arrow")}},
"ArrowShapes.corner-right-arrow":{global:{menu:_("Corner Right Arrow")}},"ArrowShapes.down-arrow":{
global:{menu:_("Down Arrow")}},"ArrowShapes.down-arrow-callout":{global:{menu:_("Down Arrow Callout"
)}},"ArrowShapes.left-arrow":{global:{menu:_("Left Arrow")}},"ArrowShapes.left-arrow-callout":{
global:{menu:_("Left Arrow Callout")}},"ArrowShapes.left-right-arrow":{global:{menu:_(
"Left and Right Arrow")}},"ArrowShapes.left-right-arrow-callout":{global:{menu:_(
"Left and Right Arrow Callout")}},"ArrowShapes.notched-right-arrow":{global:{menu:_(
"Notched Right Arrow")}},"ArrowShapes.pentagon-right":{global:{menu:_("Pentagon")}},
"ArrowShapes.quad-arrow":{global:{menu:_("4-way Arrow")}},"ArrowShapes.quad-arrow-callout":{global:{
menu:_("4-way Arrow Callout")}},"ArrowShapes.right-arrow":{global:{menu:_("Right Arrow")}},
"ArrowShapes.right-arrow-callout":{global:{menu:_("Right Arrow Callout")}},
"ArrowShapes.s-sharped-arrow":{global:{menu:_("S-shaped Arrow")}},"ArrowShapes.split-arrow":{
global:{menu:_("Split Arrow")}},"ArrowShapes.split-round-arrow":{global:{menu:_(
"Right or Left Arrow")}},"ArrowShapes.striped-right-arrow":{global:{menu:_("Striped Right Arrow")}},
"ArrowShapes.up-arrow":{global:{menu:_("Up Arrow")}},"ArrowShapes.up-arrow-callout":{global:{menu:_(
"Up Arrow Callout")}},"ArrowShapes.up-down-arrow":{global:{menu:_("Up and Down Arrow")}},
"ArrowShapes.up-down-arrow-callout":{global:{menu:_("Up and Down Arrow Callout")}},
"ArrowShapes.up-right-arrow":{global:{menu:_("Up and Right Arrow")}},
"ArrowShapes.up-right-arrow-callout":{global:{menu:_("Up and Right Arrow Callout")}},
"ArrowShapes.up-right-down-arrow":{global:{menu:_("Up, Right and Down Arrow")}},AssignLayout:{
presentation:{menu:_("Slide Layout")}},AutoFill:{spreadsheet:{menu:_(
"AutoFill Data Series: automatic")}},AutoFormatMenu:{text:{menu:_("AutoCorr~ect")}},
BackgroundColor:{global:{menu:_("Background Color")}},"BasicShapes.block-arc":{global:{menu:_(
"Block Arc")}},"BasicShapes.can":{global:{menu:_("Cylinder")}},"BasicShapes.circle":{global:{menu:_(
"Circle")}},"BasicShapes.circle-pie":{global:{menu:_("Circle Pie")}},"BasicShapes.cross":{global:{
menu:_("Cross")}},"BasicShapes.cube":{global:{menu:_("Cuboid")}},"BasicShapes.diamond":{global:{
menu:_("Diamond")}},"BasicShapes.ellipse":{global:{context:_(
"Ellipse (double click for multi-selection)"),menu:_("Ellipse")}},"BasicShapes.frame":{global:{
menu:_("Frame")}},"BasicShapes.hexagon":{global:{menu:_("Hexagon")}},
"BasicShapes.isosceles-triangle":{global:{menu:_("Isosceles Triangle")}},"BasicShapes.octagon":{
global:{menu:_("Octagon")}},"BasicShapes.paper":{global:{menu:_("Folded Corner")}},
"BasicShapes.parallelogram":{global:{menu:_("Parallelogram")}},"BasicShapes.pentagon":{global:{
menu:_("Pentagon")}},"BasicShapes.quadrat":{global:{menu:_("Square")}},"BasicShapes.rectangle":{
global:{context:_("Rectangle (double click for multi-selection)"),menu:_("Rectangle")}},
"BasicShapes.right-triangle":{global:{menu:_("Right Triangle")}},"BasicShapes.ring":{global:{menu:_(
"Ring")}},"BasicShapes.round-quadrat":{global:{menu:_("Square, Rounded")}},
"BasicShapes.round-rectangle":{global:{menu:_("Rectangle, Rounded")}},"BasicShapes.trapezoid":{
global:{menu:_("Trapezoid")}},Bezier_Unfilled:{global:{menu:_("Curve")}},Bold:{global:{menu:_("Bold"
)}},BringToFront:{global:{menu:_("~Bring to Front")}},Calculate:{spreadsheet:{menu:_("~Recalculate")
}},"CalloutShapes.cloud-callout":{global:{menu:_("Cloud")}},"CalloutShapes.line-callout-1":{global:{
menu:_("Line Callout 1")}},"CalloutShapes.line-callout-2":{global:{menu:_("Line Callout 2")}},
"CalloutShapes.line-callout-3":{global:{menu:_("Line Callout 3")}},
"CalloutShapes.rectangular-callout":{global:{menu:_("Rectangular Callout")}},
"CalloutShapes.round-callout":{global:{menu:_("Round Callout")}},
"CalloutShapes.round-rectangular-callout":{global:{menu:_("Rounded Rectangular Callout")}},
CellVertBottom:{global:{context:_("Align Bottom"),menu:_("Bottom")}},CellVertCenter:{global:{
context:_("Center Vertically"),menu:_("Center")}},CellVertTop:{global:{context:_("Align Top"),
menu:_("Top")}},CenterPara:{global:{context:_("Align Center"),menu:_("Center")}},ChangeAlignment:{
global:{menu:_("A~lignment...")}},ChangeBezier:{presentation:{menu:_("To ~Curve")}},
ChangeCaseRotateCase:{global:{menu:_("Cycle Case")}},ChangeCaseToLower:{global:{menu:_("~lowercase")
}},ChangeCaseToSentenceCase:{global:{menu:_("~Sentence case")}},ChangeCaseToTitleCase:{global:{
menu:_("~Capitalize Every Word")}},ChangeCaseToToggleCase:{global:{menu:_("~tOGGLEcASE")}},
ChangeCaseToUpper:{global:{menu:_("~UPPERCASE")}},ChangeDistance:{global:{menu:_("~Spacing...")}},
ChangeFont:{global:{menu:_("~Fonts...")}},ChangeFontSize:{global:{menu:_("F~ont Size...")}},
ChangesMenu:{global:{menu:_("Track Chan~ges")}},ChapterNumberingDialog:{text:{context:_(
"Set Heading Numbering"),menu:_("Heading ~Numbering...")}},CharBackColor:{global:{menu:_(
"Character Highlighting Color")}},CharmapControl:{global:{context:_("Insert Special Characters"),
menu:_("Symbol")}},ChiSquareTestDialog:{spreadsheet:{menu:_("~Chi-square Test...")}},ClearOutline:{
global:{menu:_("~Remove Outline")}},CloseMasterView:{presentation:{menu:_("Close Master View")}},
Color:{global:{menu:_("Font Color")}},ColorScaleFormatDialog:{spreadsheet:{menu:_("Color Scale...")}
},ColumnOperations:{spreadsheet:{menu:_("Column")}},ColumnWidth:{spreadsheet:{context:_(
"Column ~Width..."),menu:_("~Width...")}},CommonAlignBottom:{global:{menu:_("Bottom")}},
CommonAlignHorizontalCenter:{global:{menu:_("Centered")}},CommonAlignJustified:{global:{menu:_(
"Justified")}},CommonAlignLeft:{global:{menu:_("Left")}},CommonAlignRight:{global:{menu:_("Right")}
},CommonAlignTop:{global:{menu:_("Top")}},CommonAlignVerticalCenter:{global:{menu:_("Center")}},
CompressGraphic:{global:{menu:_("Co~mpress...")},presentation:{menu:_("Co~mpress...")}},
CondDateFormatDialog:{spreadsheet:{menu:_("Date...")}},ConditionalFormatManagerDialog:{spreadsheet:{
menu:_("Manage...")}},ConditionalFormatMenu:{spreadsheet:{menu:_("C~onditional")}},Connector:{
presentation:{menu:_("Connector")}},ConnectorArrowEnd:{presentation:{menu:_(
"Connector Ends with Arrow")}},ConnectorArrows:{presentation:{menu:_("Connector with Arrows")}},
ConnectorCurve:{presentation:{menu:_("Curved Connector")}},ConnectorCurveArrowEnd:{presentation:{
menu:_("Curved Connector Ends with Arrow")}},ConnectorCurveArrows:{presentation:{menu:_(
"Curved Connector with Arrows")}},ConnectorLine:{presentation:{menu:_("Straight Connector")}},
ConnectorLineArrowEnd:{presentation:{menu:_("Straight Connector ends with Arrow")}},
ConnectorLineArrows:{presentation:{menu:_("Straight Connector with Arrows")}},ConnectorLines:{
presentation:{menu:_("Line Connector")}},ConnectorLinesArrowEnd:{presentation:{menu:_(
"Line Connector Ends with Arrow")}},ConnectorToolbox:{presentation:{context:_(
"Connectors (double click for multi-selection)"),menu:_("Connectors")}},ContentControlProperties:{
text:{context:_("Content Control Properties"),menu:_("Properties")}},ContinueNumbering:{text:{
menu:_("~Add to List")}},ContourDialog:{global:{menu:_("~Edit Contour...")}},ControlCodes:{text:{
context:_("Toggle Formatting Marks"),menu:_("For~matting Marks")}},ConvertFormulaToValue:{
spreadsheet:{menu:_("Formula to Value")}},ConvertMenu:{presentation:{menu:_("~Convert")}},Copy:{
global:{menu:_("Cop~y")}},CopyHyperlinkLocation:{global:{menu:_("Copy Hyperlink Location")}},
CorrelationDialog:{spreadsheet:{menu:_("~Correlation...")}},CovarianceDialog:{spreadsheet:{menu:_(
"~Covariance...")}},Crop:{global:{context:_("Crop Image"),menu:_("Crop")}},CustomAnimation:{
presentation:{menu:_("Animation")}},Cut:{global:{menu:_("~Cut")}},DataAreaRefresh:{spreadsheet:{
menu:_("R~efresh Range")}},DataBarFormatDialog:{spreadsheet:{menu:_("Data Bar...")}},
DataDataPilotRun:{spreadsheet:{context:_("~Properties..."),menu:_("Pi~vot Table...")}},
DataFilterAutoFilter:{spreadsheet:{menu:_("Auto~Filter")}},DataFilterHideAutoFilter:{spreadsheet:{
menu:_("~Hide AutoFilter")}},DataFilterRemoveFilter:{spreadsheet:{menu:_("~Reset Filter")}},
DataFilterSpecialFilter:{spreadsheet:{menu:_("~Advanced Filter...")}},DataFilterStandardFilter:{
spreadsheet:{menu:_("~Standard Filter...")}},DataMenu:{global:{menu:_("~Data")}},DataPilotMenu:{
spreadsheet:{menu:_("~Pivot Table")}},DataRanges:{global:{menu:_("~Data Ranges...")}},DataSort:{
spreadsheet:{menu:_("~Sort...")}},DecrementIndent:{global:{context:_("Decrease Indent"),menu:_(
"Decrease Indent")}},DecrementLevel:{text:{menu:_("Demote Outline Level")}},DecrementSubLevels:{
text:{menu:_("Demote Outline Level with Subpoints")}},DefaultBullet:{global:{context:_(
"Toggle Unordered List"),menu:_("~Unordered List")}},DefaultNumbering:{global:{context:_(
"Toggle Ordered List"),menu:_("~Ordered List")}},DefineDBName:{spreadsheet:{menu:_(
"~Define Range...")}},DefineName:{spreadsheet:{menu:_("~Manage...")}},DefinePrintArea:{spreadsheet:{
menu:_("~Define")}},Delete:{global:{menu:_("Delete C~ontents...")},spreadsheet:{context:_(
"Cl~ear Contents..."),menu:_("Cle~ar Cells...")}},DeleteAllAnnotation:{presentation:{menu:_(
"Delete ~All Comments")}},DeleteAllNotes:{global:{menu:_("Delete All Comments")},spreadsheet:{
menu:_("Delete All Comments")}},DeleteAuthor:{global:{menu:_("Delete All Comments by This Author")}
},DeleteAxis:{global:{menu:_("Delete Axis")}},DeleteCell:{spreadsheet:{context:_("De~lete..."),
menu:_("Delete C~ells...")}},DeleteColumns:{global:{context:_("Delete selected columns"),menu:_(
"Delete ~Columns")},text:{context:_("Delete selected columns"),menu:_("~Columns")}},DeleteComment:{
global:{menu:_("Delete Comment")}},DeleteContentControl:{text:{context:_("Delete Content Control"),
menu:_("Delete Content Control")}},DeleteDataLabel:{global:{menu:_("Delete Single Data Label")}},
DeleteDataLabels:{global:{menu:_("Delete Data Labels")}},DeleteLegend:{global:{menu:_(
"Delete Legend")}},DeleteMajorGrid:{global:{menu:_("Delete Major Grid")}},DeleteMinorGrid:{global:{
menu:_("Delete Minor Grid")}},DeleteNote:{spreadsheet:{menu:_("Delete Comment")}},DeletePage:{
presentation:{menu:_("D~elete Page")}},DeletePivotTable:{spreadsheet:{menu:_("~Delete")}},
DeletePrintArea:{spreadsheet:{menu:_("~Clear")}},DeleteRows:{presentation:{menu:_("Delete Row")},
spreadsheet:{menu:_("Delete Rows")},text:{context:_("Delete selected rows"),menu:_("~Rows")}},
DeleteSlide:{presentation:{menu:_("~Delete Slide")}},DeleteSparkline:{spreadsheet:{menu:_(
"Delete Sparkline")}},DeleteSparklineGroup:{spreadsheet:{menu:_("Delete Sparkline Group")}},
DeleteTable:{presentation:{menu:_("Delete Table")},text:{context:_("Delete table"),menu:_("~Table")}
},DescriptiveStatisticsDialog:{spreadsheet:{menu:_("~Descriptive Statistics...")}},DiagramData:{
global:{menu:_("~Data Table...")}},DiagramType:{global:{menu:_("Chart T~ype...")}},
DistributeHorzCenter:{global:{menu:_("Horizontally ~Center")}},DistributeHorzDistance:{global:{
menu:_("Horizontally ~Spacing")}},DistributeHorzLeft:{global:{menu:_("Horizontally ~Left")}},
DistributeHorzRight:{global:{menu:_("Horizontally ~Right")}},DistributeVertBottom:{global:{menu:_(
"Vertically ~Bottom")}},DistributeVertCenter:{global:{menu:_("Vertically C~enter")}},
DistributeVertDistance:{global:{menu:_("Vertically S~pacing")}},DistributeVertTop:{global:{menu:_(
"Vertically ~Top")}},DownSearch:{global:{menu:_("Find Next")}},DrawText:{global:{context:_(
"Insert Text Box"),menu:_("~Text Box")}},DuplicatePage:{presentation:{menu:_("Duplicate Page")}},
DuplicateSlide:{presentation:{menu:_("Duplicate ~Slide")}},EditCurrentRegion:{text:{menu:_(
"Edit Section...")}},EditHeaderAndFooter:{spreadsheet:{menu:_("~Headers and Footers...")}},
EditHyperlink:{global:{context:_("Edit Hyperlink..."),menu:_("~Hyperlink")}},EditMenu:{global:{
menu:_("~Edit")}},EditPrintArea:{spreadsheet:{menu:_("~Edit...")}},EditRegion:{text:{menu:_(
"~Sections...")}},EditSparkline:{spreadsheet:{menu:_("Edit Sparkline...")}},EditSparklineGroup:{
spreadsheet:{menu:_("Edit Sparkline Group...")}},EnterGroup:{global:{menu:_("~Enter Group")}},
EntireCell:{text:{context:_("Select Cell"),menu:_("C~ell")}},EntireColumn:{presentation:{menu:_(
"Select Column")},text:{menu:_("~Column")}},EntireRow:{presentation:{menu:_("Select Row")},text:{
menu:_("~Row")}},ExecuteAnimationEffect:{presentation:{menu:_("E~xecute Interaction...")}},
ExponentialSmoothingDialog:{spreadsheet:{menu:_("~Exponential Smoothing...")}},FTestDialog:{
spreadsheet:{menu:_("~F-test...")}},FillColor:{global:{menu:_("Fill Color")}},FilterMenu:{
spreadsheet:{menu:_("More ~Filters")}},FlipHorizontal:{global:{menu:_("Flip Horizontally")}},
FlipVertical:{global:{menu:_("Flip Vertically")}},"FlowChartShapes.flowchart-alternate-process":{
global:{menu:_("Flowchart: Alternate Process")}},"FlowChartShapes.flowchart-card":{global:{menu:_(
"Flowchart: Card")}},"FlowChartShapes.flowchart-collate":{global:{menu:_("Flowchart: Collate")}},
"FlowChartShapes.flowchart-connector":{global:{menu:_("Flowchart: Connector")}},
"FlowChartShapes.flowchart-data":{global:{menu:_("Flowchart: Data")}},
"FlowChartShapes.flowchart-decision":{global:{menu:_("Flowchart: Decision")}},
"FlowChartShapes.flowchart-delay":{global:{menu:_("Flowchart: Delay")}},
"FlowChartShapes.flowchart-direct-access-storage":{global:{menu:_("Flowchart: Direct Access Storage"
)}},"FlowChartShapes.flowchart-display":{global:{menu:_("Flowchart: Display")}},
"FlowChartShapes.flowchart-document":{global:{menu:_("Flowchart: Document")}},
"FlowChartShapes.flowchart-extract":{global:{menu:_("Flowchart: Extract")}},
"FlowChartShapes.flowchart-internal-storage":{global:{menu:_("Flowchart: Internal Storage")}},
"FlowChartShapes.flowchart-magnetic-disk":{global:{menu:_("Flowchart: Magnetic Disc")}},
"FlowChartShapes.flowchart-manual-input":{global:{menu:_("Flowchart: Manual Input")}},
"FlowChartShapes.flowchart-manual-operation":{global:{menu:_("Flowchart: Manual Operation")}},
"FlowChartShapes.flowchart-merge":{global:{menu:_("Flowchart: Merge")}},
"FlowChartShapes.flowchart-multidocument":{global:{menu:_("Flowchart: Multidocument")}},
"FlowChartShapes.flowchart-off-page-connector":{global:{menu:_("Flowchart: Off-page Connector")}},
"FlowChartShapes.flowchart-or":{global:{menu:_("Flowchart: Or")}},
"FlowChartShapes.flowchart-predefined-process":{global:{menu:_("Flowchart: Predefined Process")}},
"FlowChartShapes.flowchart-preparation":{global:{menu:_("Flowchart: Preparation")}},
"FlowChartShapes.flowchart-process":{global:{menu:_("Flowchart: Process")}},
"FlowChartShapes.flowchart-punched-tape":{global:{menu:_("Flowchart: Punched Tape")}},
"FlowChartShapes.flowchart-sequential-access":{global:{menu:_("Flowchart: Sequential Access")}},
"FlowChartShapes.flowchart-sort":{global:{menu:_("Flowchart: Sort")}},
"FlowChartShapes.flowchart-stored-data":{global:{menu:_("Flowchart: Stored Data")}},
"FlowChartShapes.flowchart-summing-junction":{global:{menu:_("Flowchart: Summing Junction")}},
"FlowChartShapes.flowchart-terminator":{global:{menu:_("Flowchart: Terminator")}},FontColor:{
global:{menu:_("Font Color")},text:{menu:_("Font Color")}},FontDialog:{global:{menu:_(
"C~haracter...")}},FontworkGalleryFloater:{global:{context:_("Insert Fontwork Text"),menu:_(
"Fontwork...")}},FontworkShapeType:{global:{menu:_("Fontwork Shape")}},
"FontworkShapeType.fontwork-arch-down-curve":{global:{menu:_("Arch Down (Curve)")}},
"FontworkShapeType.fontwork-arch-down-pour":{global:{menu:_("Arch Down (Pour)")}},
"FontworkShapeType.fontwork-arch-left-curve":{global:{menu:_("Arch Left (Curve)")}},
"FontworkShapeType.fontwork-arch-right-curve":{global:{menu:_("Arch Right (Curve)")}},
"FontworkShapeType.fontwork-arch-right-pour":{global:{menu:_("Arch Right (Pour)")}},
"FontworkShapeType.fontwork-arch-up-curve":{global:{menu:_("Arch Up (Curve)")}},
"FontworkShapeType.fontwork-arch-up-pour":{global:{menu:_("Arch Up (Pour)")}},
"FontworkShapeType.fontwork-chevron-down":{global:{menu:_("Chevron Down")}},
"FontworkShapeType.fontwork-chevron-up":{global:{menu:_("Chevron Up")}},
"FontworkShapeType.fontwork-circle-curve":{global:{menu:_("Circle (Curve)")}},
"FontworkShapeType.fontwork-circle-pour":{global:{menu:_("Circle (Pour)")}},
"FontworkShapeType.fontwork-curve-down":{global:{menu:_("Curve Down")}},
"FontworkShapeType.fontwork-curve-up":{global:{menu:_("Curve Up")}},
"FontworkShapeType.fontwork-fade-down":{global:{menu:_("Fade Down")}},
"FontworkShapeType.fontwork-fade-left":{global:{menu:_("Fade Left")}},
"FontworkShapeType.fontwork-fade-right":{global:{menu:_("Fade Right")}},
"FontworkShapeType.fontwork-fade-up":{global:{menu:_("Fade Up")}},
"FontworkShapeType.fontwork-fade-up-and-left":{global:{menu:_("Fade Up and Left")}},
"FontworkShapeType.fontwork-fade-up-and-right":{global:{menu:_("Fade Up and Right")}},
"FontworkShapeType.fontwork-inflate":{global:{menu:_("Inflate")}},
"FontworkShapeType.fontwork-open-circle-curve":{global:{menu:_("Open Circle (Curve)")}},
"FontworkShapeType.fontwork-open-circle-pour":{global:{menu:_("Open Circle (Pour)")}},
"FontworkShapeType.fontwork-plain-text":{global:{menu:_("Plain Text")}},
"FontworkShapeType.fontwork-slant-down":{global:{menu:_("Slant Down")}},
"FontworkShapeType.fontwork-slant-up":{global:{menu:_("Slant Up")}},
"FontworkShapeType.fontwork-stop":{global:{menu:_("Stop")}},
"FontworkShapeType.fontwork-triangle-down":{global:{menu:_("Triangle Down")}},
"FontworkShapeType.fontwork-triangle-up":{global:{menu:_("Triangle Up")}},
"FontworkShapeType.fontwork-wave":{global:{menu:_("Wave")}},FootnoteDialog:{text:{menu:_(
"~Footnote/Endnote Settings...")}},FormatArea:{global:{menu:_("A~rea...")}},FormatAxis:{global:{
menu:_("Format Axis...")}},FormatBulletsMenu:{global:{menu:_("Lis~ts")}},FormatCellDialog:{
spreadsheet:{context:_("~Format Cells..."),menu:_("Ce~lls...")}},FormatChartArea:{global:{menu:_(
"Format Chart Area...")}},FormatColumns:{text:{menu:_("Co~lumns...")}},FormatDataLabel:{global:{
menu:_("Format Single Data Label...")}},FormatDataLabels:{global:{menu:_("Format Data Labels...")}},
FormatDataPoint:{global:{menu:_("Format Data Point...")}},FormatDataSeries:{global:{menu:_(
"Format Data Series...")}},FormatFloor:{global:{menu:_("Format Floor...")}},FormatFormMenu:{global:{
menu:_("Fo~rm")}},FormatGroup:{global:{menu:_("~Group")}},FormatLegend:{global:{menu:_(
"Format Legend...")}},FormatLine:{global:{menu:_("L~ine...")}},FormatMajorGrid:{global:{menu:_(
"Format Major Grid...")}},FormatMeanValue:{global:{menu:_("Format Mean Value Line...")}},
FormatMenu:{global:{menu:_("F~ormat")}},FormatMinorGrid:{global:{menu:_("Format Minor Grid...")}},
FormatPaintbrush:{global:{menu:_("Clone Formatting")},text:{menu:_("Clone Formatting")}},
FormatSelection:{global:{menu:_("Format Selection...")}},FormatSpacingMenu:{global:{menu:_(
"~Spacing")}},FormatSparklineMenu:{spreadsheet:{menu:_("Sparklines")}},FormatStockGain:{global:{
menu:_("Format Stock Gain...")}},FormatStockLoss:{global:{menu:_("Format Stock Loss...")}},
FormatTextMenu:{global:{menu:_("Te~xt")}},FormatTitle:{global:{menu:_("Format Title...")}},
FormatTrendline:{global:{menu:_("Format Trend Line...")}},FormatTrendlineEquation:{global:{menu:_(
"Format Trend Line Equation...")}},FormatWall:{global:{menu:_("Format Wall...")}},FormatXErrorBars:{
global:{menu:_("Format X Error Bars...")}},FormatYErrorBars:{global:{menu:_("Format Y Error Bars..."
)}},FormattingMarkMenu:{global:{menu:_("Formatting Mark")}},FourierAnalysisDialog:{spreadsheet:{
menu:_("F~ourier Analysis...")}},FrameDialog:{text:{menu:_("~Properties...")}},FreezeCellsMenu:{
spreadsheet:{menu:_("Freeze ~Cells")}},FreezePanes:{spreadsheet:{context:_("Freeze Rows and Columns"
),menu:_("Freeze Rows and Columns")}},FreezePanesColumn:{spreadsheet:{menu:_("Freeze First Column")}
},FreezePanesRow:{spreadsheet:{menu:_("Freeze First Row")}},FullScreen:{global:{menu:_(
"F~ull Screen")}},FunctionDialog:{spreadsheet:{menu:_("~Function...")}},GoalSeekDialog:{
spreadsheet:{menu:_("~Goal Seek...")}},GotoPage:{presentation:{menu:_("Go t~o Page...")},text:{
menu:_("Go t~o Page...")}},GotoSlide:{presentation:{menu:_("Go t~o Slide...")}},GrafContrast:{
global:{menu:_("Contrast")}},GrafLuminance:{global:{menu:_("Brightness")}},GrafMode:{global:{menu:_(
"Image Mode")}},GrafTransparence:{global:{menu:_("Transparency")}},GraphicDialog:{text:{menu:_(
"~Properties...")}},GraphicFilterInvert:{global:{menu:_("Invert")}},GraphicFilterPopart:{global:{
menu:_("Pop Art")}},GraphicFilterRemoveNoise:{global:{menu:_("Remove Noise")}},
GraphicFilterSharpen:{global:{menu:_("Sharpen")}},GraphicFilterSobel:{global:{menu:_(
"Charcoal Sketch")}},GridUse:{global:{menu:_("Snap to Grid")}},GridVisible:{global:{context:_(
"Display Grid"),menu:_("~Display Grid")}},Group:{global:{menu:_("~Group...")}},GroupOutlineMenu:{
spreadsheet:{menu:_("~Group and Outline")}},GroupSparklines:{spreadsheet:{menu:_("Group Sparklines")
}},Grow:{global:{context:_("Increase Font Size"),menu:_("Increase Size")}},HeaderAndFooter:{
presentation:{menu:_("~Header and Footer...")}},HelpMenu:{global:{menu:_("~Help")}},Hide:{
spreadsheet:{menu:_("~Hide Sheet")}},HideColumn:{spreadsheet:{context:_("H~ide Columns"),menu:_(
"~Hide")}},HideDetail:{global:{menu:_("~Hide Details")}},HideRow:{spreadsheet:{context:_(
"H~ide Rows"),menu:_("H~ide")}},HideSlide:{presentation:{menu:_("~Hide Slide")}},HyperlinkDialog:{
global:{context:_("Insert Hyperlink"),menu:_("~Hyperlink...")}},Hyphenate:{spreadsheet:{menu:_(
"~Hyphenation...")},text:{context:_("Insert Soft Hyphen..."),menu:_("~Hyphenation...")}},
Hyphenation:{presentation:{menu:_("~Hyphenation")}},IconSetFormatDialog:{spreadsheet:{menu:_(
"Icon Set...")}},IncrementIndent:{global:{context:_("Increase Indent"),menu:_("Increase Indent")}},
IncrementLevel:{text:{menu:_("Promote Outline Level")}},IncrementSubLevels:{text:{menu:_(
"Promote Outline Level with Subpoints")}},IndexesMenu:{text:{menu:_("Table of Contents and Inde~x")}
},InsertAVMedia:{global:{context:_("Insert Audio or Video"),menu:_("Media")}},InsertAnnotation:{
global:{context:_("Insert Comment"),menu:_("Comme~nt")}},InsertAuthorField:{presentation:{menu:_(
"~Author")},text:{menu:_("First ~Author")}},InsertAxis:{global:{menu:_("Insert Axis")}},
InsertAxisTitle:{global:{menu:_("Insert Axis Title")}},InsertBookmark:{text:{context:_(
"Insert Bookmark"),menu:_("Bookmar~k...")}},InsertBreak:{text:{menu:_("Manual ~Break...")}},
InsertCaptionDialog:{text:{context:_("Insert Caption..."),menu:_("Caption...")}},InsertCell:{
spreadsheet:{context:_("~Insert..."),menu:_("Insert ~Cells...")}},InsertColumnBreak:{spreadsheet:{
menu:_("~Column Break")},text:{menu:_("Insert Column Break")}},InsertColumnsAfter:{presentation:{
menu:_("Insert Column After")},spreadsheet:{context:_("Insert Columns ~After"),menu:_(
"Columns ~After")},text:{context:_("Insert columns after"),menu:_("Columns A~fter")}},
InsertColumnsBefore:{presentation:{menu:_("Insert Column Before")},spreadsheet:{context:_(
"Insert Columns ~Before"),menu:_("Columns ~Before")},text:{context:_("Insert columns before"),
menu:_("Columns B~efore")}},InsertColumnsMenu:{spreadsheet:{menu:_("Insert Co~lumns")}},
InsertCurrentDate:{spreadsheet:{menu:_("~Date")}},InsertCurrentTime:{spreadsheet:{menu:_("~Time")}},
InsertDataLabel:{global:{menu:_("Insert Single Data Label")}},InsertDataLabels:{global:{menu:_(
"Insert Data Labels")}},InsertDateField:{text:{menu:_("~Date (fixed)")}},InsertDateFieldFix:{
presentation:{menu:_("~Date (fixed)")}},InsertDateFieldVar:{presentation:{menu:_("Dat~e (variable)")
},text:{menu:_("~Date (variable)")}},InsertEndnote:{text:{context:_("Insert Endnote"),menu:_(
"~Endnote")}},InsertField:{text:{menu:_("~More Fields...")}},InsertFieldCtrl:{text:{context:_(
"Insert Field"),menu:_("Fiel~d")}},InsertFootnote:{text:{context:_("Insert Footnote"),menu:_(
"~Footnote")}},InsertFrame:{text:{context:_("Insert Frame"),menu:_("F~rame...")}},InsertGraphic:{
global:{context:_("Insert Image..."),menu:_("~Image...")}},InsertHardHyphen:{global:{menu:_(
"Non-breaking ~Hyphen")}},InsertHeaderFooterMenu:{text:{menu:_("He~ader and Footer")}},
InsertHyperlink:{global:{context:_("Insert Hyperlink..."),menu:_("~Hyperlink")}},
InsertIndexesEntry:{text:{context:_("Insert Index Entry"),menu:_("~Index Entry...")}},InsertLRM:{
global:{menu:_("~Left-to-Right Mark")}},InsertMajorGrid:{global:{menu:_("Insert Major Grid")}},
InsertMeanValue:{global:{menu:_("Insert Mean ~Value Line")}},InsertMenu:{global:{menu:_("~Insert")}
},InsertMinorGrid:{global:{menu:_("Insert Minor Grid")}},InsertNeutralParagraph:{text:{menu:_(
"Insert Unnumbered Entry")}},InsertNonBreakingSpace:{global:{menu:_("~No-break Space")}},
InsertObjectChart:{global:{context:_("Insert Chart"),menu:_("~Chart...")}},InsertObjectStarMath:{
spreadsheet:{menu:_("~Formula Object...")},text:{menu:_("~Formula Object...")}},InsertPage:{
presentation:{menu:_("New Page")}},InsertPageCountField:{text:{menu:_("Page ~Count")}},
InsertPageField:{presentation:{menu:_("~Page Number")}},InsertPageFooter:{text:{menu:_("Foote~r")}},
InsertPageHeader:{text:{menu:_("He~ader")}},InsertPageNumberField:{global:{menu:_("~Page Numbers..."
)},text:{context:_("Insert Page Number"),menu:_("~Page Number")}},InsertPageTitleField:{
presentation:{menu:_("Page Tit~le")}},InsertPagebreak:{text:{context:_("Insert Page Break"),menu:_(
"~Page Break")}},InsertPagesField:{presentation:{menu:_("Page ~Count")}},InsertPivotTable:{
spreadsheet:{menu:_("~Insert or Edit...")}},InsertQrCode:{global:{menu:_("QR and ~Barcode...")}},
InsertRLM:{global:{menu:_("~Right-to-Left Mark")}},InsertReferenceField:{text:{context:_(
"Insert Cross-reference"),menu:_("Cross-~reference...")}},InsertRemoveAxes:{global:{menu:_(
"Insert/Delete Axes...")}},InsertRowsAfter:{presentation:{menu:_("Insert Row Below")},spreadsheet:{
context:_("Insert Rows ~Below"),menu:_("Rows ~Below")},text:{context:_("Insert rows below"),menu:_(
"Rows ~Below")}},InsertRowsBefore:{presentation:{menu:_("Insert Row Above")},spreadsheet:{context:_(
"Insert Rows ~Above"),menu:_("Rows ~Above")},text:{context:_("Insert rows above"),menu:_(
"Rows ~Above")}},InsertRowsMenu:{spreadsheet:{menu:_("Insert ~Rows")}},InsertSection:{text:{menu:_(
"Se~ction...")}},InsertSignatureLine:{global:{menu:_("Signat~ure Line...")}},InsertSlide:{
presentation:{menu:_("~New Slide")}},InsertSlideField:{presentation:{menu:_("~Slide Number")}},
InsertSlideTitleField:{presentation:{menu:_("Slide Tit~le")}},InsertSlidesField:{presentation:{
menu:_("Slide ~Count")}},InsertSoftHyphen:{global:{menu:_("~Soft Hyphen")}},InsertSparkline:{
spreadsheet:{menu:_("Sparkline...")}},InsertSymbol:{global:{context:_("Insert Special Character"),
menu:_("S~pecial Character...")}},InsertTable:{presentation:{menu:_("~Table...")},text:{menu:_(
"Insert ~Table...")}},InsertTimeField:{global:{menu:_("Time Field")},text:{menu:_("~Time (fixed)")}
},InsertTimeFieldFix:{presentation:{menu:_("~Time (fixed)")}},InsertTimeFieldVar:{presentation:{
menu:_("T~ime (variable)")},text:{menu:_("~Time (variable)")}},InsertTitleField:{text:{menu:_(
"T~itle")}},InsertTitles:{global:{menu:_("Insert Titles...")}},InsertTopicField:{text:{menu:_(
"~Subject")}},InsertTrendline:{global:{menu:_("Insert Tre~nd Line...")}},InsertWJ:{global:{menu:_(
"~Word Joiner")}},InsertXErrorBars:{global:{menu:_("Insert ~X Error Bars...")}},InsertYErrorBars:{
global:{menu:_("Insert ~Y Error Bars...")}},InsertZWSP:{global:{menu:_("~Zero-width Space")}},
Italic:{global:{menu:_("Italic")}},JumpDownThisLevel:{text:{menu:_("To Next Paragraph in Level")}},
JumpToTable:{spreadsheet:{menu:_("~Go to Sheet...")}},JumpUpThisLevel:{text:{menu:_(
"To Previous Paragraph in Level")}},JustifyPara:{global:{menu:_("Justified")}},LanguageMenu:{
global:{menu:_("Language")}},LanguageStatus:{global:{menu:_("Language Status")}},LayoutStatus:{
presentation:{menu:_("Layout")}},LeaveGroup:{global:{menu:_("E~xit Group")}},LeftPara:{global:{
context:_("Align Left"),menu:_("Left")}},Line:{global:{context:_(
"Insert Line (double click for multi-selection)"),menu:_("Line")}},LineNumberingDialog:{text:{
menu:_("~Line Numbering...")}},LineSpacing:{global:{context:_("Set Line Spacing"),menu:_(
"Line Spacing")}},MasterSlidesPanel:{presentation:{menu:_("Master Slides")}},MergeCells:{global:{
menu:_("Merge Cells")}},ModifyPage:{presentation:{menu:_("Slide ~Layout")}},Move:{spreadsheet:{
menu:_("~Move or Copy Sheet...")}},MoveDown:{text:{menu:_("Move Item Down")}},MoveDownSubItems:{
text:{menu:_("Move Item Down with Subpoints")}},MoveUp:{text:{menu:_("Move Item Up")}},
MoveUpSubItems:{text:{menu:_("Move Item Up with Subpoints")}},MovingAverageDialog:{spreadsheet:{
menu:_("~Moving Average...")}},NameGroup:{global:{context:_("Give a label to identify an object"),
menu:_("Name...")}},NamesMenu:{spreadsheet:{menu:_("~Named Ranges and Expressions")}},Navigator:{
global:{context:_("Show Navigator Window"),menu:_("Na~vigator")}},NextTrackedChange:{text:{
context:_("Next Track Change"),menu:_("Next")}},NumberFormatCurrency:{spreadsheet:{context:_(
"Format as Currency"),menu:_("Currency")},text:{menu:_("Number Format: Currency")}},
NumberFormatDate:{spreadsheet:{context:_("Format as Date"),menu:_("Date")},text:{menu:_(
"Number Format: Date")}},NumberFormatDecDecimals:{spreadsheet:{menu:_("Delete Decimal Place")}},
NumberFormatDecimal:{spreadsheet:{context:_("Format as Number"),menu:_("Number")},text:{menu:_(
"Number Format: Decimal")}},NumberFormatIncDecimals:{spreadsheet:{menu:_("Add Decimal Place")}},
NumberFormatMenu:{spreadsheet:{menu:_("Number Format")}},NumberFormatPercent:{spreadsheet:{
context:_("Format as Percent"),menu:_("Percent")},text:{menu:_("Number Format: Percent")}},
NumberFormatScientific:{spreadsheet:{context:_("Format as Scientific"),menu:_("Scientific")},text:{
menu:_("Number Format: Exponential")}},NumberFormatStandard:{spreadsheet:{context:_(
"Format as General"),menu:_("General")},text:{menu:_("Number Format: Standard")}},
NumberFormatThousands:{spreadsheet:{menu:_("Thousands Separator")}},NumberFormatTime:{spreadsheet:{
context:_("Format as Time"),menu:_("Time")},text:{menu:_("Number Format: Time")}},NumberingStart:{
text:{menu:_("Restart Numbering")}},ObjectAlignLeft:{global:{menu:_("~Left")}},ObjectAlignRight:{
global:{menu:_("~Right")}},ObjectBackOne:{global:{menu:_("Back One")}},ObjectForwardOne:{global:{
menu:_("Forward One")}},ObjectTitleDescription:{global:{context:_(
"Add descriptions of non-text content (for accessibility)"),menu:_("Alt Text...")}},
OnlineAutoFormat:{text:{menu:_("~While Typing")}},OpenHyperlinkOnCursor:{global:{menu:_(
"Open Hyperlink")}},Orientation:{text:{menu:_("Orientation")}},OutlineBullet:{global:{menu:_(
"~Bullets and Numbering...")}},OutlineFont:{global:{menu:_("Outline Font Effect")}},Overline:{
global:{menu:_("Overline")}},PageDialog:{global:{menu:_("~Page...")},text:{menu:_("~Page Style...")}
},PageDown:{text:{menu:_("Next Page")}},PageFormatDialog:{spreadsheet:{context:_("Format Pa~ge..."),
menu:_("~Page Style...")}},PageMenu:{presentation:{menu:_("~Page")}},PageNumberWizard:{text:{
context:_("Insert page number"),menu:_("~Page Number...")}},PageSetup:{presentation:{menu:_(
"Page Properties...")}},PageUp:{text:{menu:_("Previous Page")}},ParaLeftToRight:{global:{menu:_(
"Left-To-Right")}},ParaRightToLeft:{global:{menu:_("Right-To-Left")}},ParagraphDialog:{global:{
menu:_("P~aragraph...")}},ParaspaceDecrease:{global:{context:_("Decrease Paragraph Spacing"),menu:_(
"Decrease Paragraph Spacing")}},ParaspaceIncrease:{global:{context:_("Increase Paragraph Spacing"),
menu:_("Increase Paragraph Spacing")}},Paste:{global:{menu:_("~Paste")}},PasteSpecial:{global:{
menu:_("Paste ~Special...")},presentation:{menu:_("Paste ~Special...")},spreadsheet:{menu:_(
"Paste ~Special...")},text:{context:_("~More Options..."),menu:_("Paste ~Special...")}},PickList:{
global:{menu:_("~File")}},PreviousTrackedChange:{text:{context:_("Previous Track Change"),menu:_(
"Pr~evious")}},Print:{global:{menu:_("~Print...")}},PrintRangesMenu:{spreadsheet:{menu:_(
"Prin~t Ranges")}},Protect:{spreadsheet:{menu:_("Protect ~Sheet...")},text:{menu:_("Protect Cells")}
},RecalcPivotTable:{spreadsheet:{menu:_("~Refresh")}},Redo:{global:{menu:_("~Redo")}},
RegressionDialog:{spreadsheet:{menu:_("~Regression...")}},ReinstateTrackedChange:{text:{context:_(
"Reinstate Change"),menu:_("Reinstate")}},RejectAllTrackedChanges:{text:{context:_(
"Reject All Changes"),menu:_("Reject All")}},RejectTrackedChange:{text:{context:_("Reject Change"),
menu:_("Reject")}},RejectTrackedChangeToNext:{text:{context:_(
"Reject Track Change and select the next one"),menu:_("Reject and Move to Next")}},Remove:{
spreadsheet:{menu:_("~Delete Sheet...")}},RemoveBullets:{text:{menu:_("No List")}},RemoveHyperlink:{
global:{menu:_("~Remove Hyperlink")}},RemoveTableOf:{text:{menu:_("Delete Index")}},
RenameMasterPage:{presentation:{menu:_("Rename Master")}},RenameTable:{spreadsheet:{menu:_(
"Rename S~heet...")}},ReplyComment:{global:{menu:_("Reply Comment")}},ResetAllDataPoints:{global:{
menu:_("Reset all Data Points")}},ResetAttributes:{global:{menu:_("~Clear Direct Formatting")},
spreadsheet:{context:_("Clear Direct Formatting"),menu:_("Clear ~Direct Formatting")},text:{
context:_("Clear Direct Formatting"),menu:_("Clear ~Direct Formatting")}},ResetDataPoint:{global:{
menu:_("Reset Data Point")}},RightPara:{global:{context:_("Align Right"),menu:_("Right")}},
RotateLeft:{text:{menu:_("Rotate 90° ~Left")}},RotateMenu:{global:{menu:_("Rot~ate")}},RotateRight:{
text:{menu:_("Rotate 90° ~Right")}},RowHeight:{spreadsheet:{context:_("Row ~Height..."),menu:_(
"~Height...")}},RowOperations:{spreadsheet:{menu:_("Row")}},RunMacro:{global:{menu:_("R~un Macro..."
)}},SamplingDialog:{spreadsheet:{menu:_("~Sampling...")}},Save:{global:{menu:_("~Save")}},SaveAs:{
global:{menu:_("Save ~As...")}},SearchDialog:{global:{menu:_("Find and Rep~lace...")}},SelectAll:{
global:{menu:_("Select ~All")}},SelectBackground:{presentation:{menu:_("Set Background Image...")}},
SelectDB:{spreadsheet:{menu:_("Select ~Range...")}},SelectTable:{presentation:{context:_(
"Select Table"),menu:_("~Select Table")},text:{context:_("Select Table"),menu:_("~Table")}},
SendToBack:{global:{menu:_("~Send to Back")}},SetAnchorAtChar:{text:{menu:_("To ~Character")}},
SetAnchorToCell:{spreadsheet:{menu:_("To ~Cell")}},SetAnchorToCellResize:{spreadsheet:{menu:_(
"To Cell (~resize with cell)")}},SetAnchorToChar:{text:{menu:_("As C~haracter")}},SetAnchorToFrame:{
text:{menu:_("To ~Frame")}},SetAnchorToPage:{spreadsheet:{menu:_("To P~age")},text:{menu:_(
"To P~age")}},SetAnchorToPara:{text:{menu:_("To ~Paragraph")}},SetBorderStyle:{global:{menu:_(
"Borders (Shift to overwrite)")}},SetDefault:{global:{context:_("Clear Direct Formatting"),menu:_(
"Clear ~Direct Formatting")}},SetDocumentProperties:{global:{menu:_("Propert~ies...")}},
SetLanguageAllTextMenu:{global:{menu:_("For All Text")}},SetLanguageParagraphMenu:{global:{menu:_(
"For Paragraph")}},SetLanguageSelectionMenu:{global:{menu:_("For Selection")}},
SetObjectToBackground:{global:{menu:_("To Background")}},SetObjectToForeground:{global:{menu:_(
"To Foreground")}},SetOptimalColumnWidth:{presentation:{menu:_("Optimal Column Width")},
spreadsheet:{menu:_("~Optimal Width...")},text:{menu:_("Optimal Column Width")}},
SetOptimalRowHeight:{presentation:{menu:_("Optimal Row Height")},spreadsheet:{menu:_(
"~Optimal Height...")},text:{menu:_("Optimal Row Height")}},Shadowed:{global:{context:_(
"Toggle Shadow"),menu:_("Shadow")}},ShapesMenu:{global:{menu:_("~Shape")}},SheetMenu:{spreadsheet:{
menu:_("~Sheet")}},SheetRightToLeft:{spreadsheet:{context:_("Sheet R~ight-To-Left"),menu:_(
"R~ight-To-Left")}},Show:{spreadsheet:{menu:_("~Show Sheet...")}},ShowAnnotations:{global:{menu:_(
"Comments")}},ShowColumn:{spreadsheet:{context:_("S~how Columns"),menu:_("~Show")}},ShowDetail:{
global:{menu:_("~Show Details")}},ShowResolvedAnnotations:{text:{menu:_("Resolved Comments")}},
ShowRow:{spreadsheet:{context:_("Sho~w Rows"),menu:_("~Show")}},ShowSlide:{presentation:{menu:_(
"Sho~w Slide")}},ShowTrackedChanges:{text:{context:_("Show track changes"),menu:_("Show")}},Shrink:{
global:{context:_("Decrease Font Size"),menu:_("Decrease Size")}},Sidebar:{global:{menu:_("Sidebar")
}},"SidebarDeck.ElementsDeck":{global:{menu:_("Open the Elements Deck")}},
"SidebarDeck.StyleListDeck":{global:{menu:_("Open the Styles Deck")}},Signature:{global:{menu:_(
"Digital Signatu~res...")}},SlideChangeWindow:{presentation:{menu:_("Slide Transition")}},
SlideMenu:{presentation:{menu:_("S~lide")}},SlideSetup:{presentation:{menu:_("Slide Properties...")}
},SmallCaps:{global:{menu:_("Small capitals")}},SortAscending:{spreadsheet:{menu:_("Sort Ascending")
}},SortDescending:{spreadsheet:{menu:_("Sort Descending")}},SpacePara1:{global:{menu:_(
"Line Spacing: 1")}},SpacePara15:{global:{menu:_("Line Spacing: 1.5")}},SpacePara2:{global:{menu:_(
"Line Spacing: 2")}},Spacing:{global:{context:_("Set Character Spacing"),menu:_("Character Spacing")
}},SpellCheckApplySuggestion:{global:{menu:_("Apply Suggestion")}},SpellCheckIgnore:{global:{menu:_(
"Ignore")}},SpellCheckIgnoreAll:{global:{menu:_("Ignore All")}},SpellDialog:{global:{menu:_(
"~Spelling...")}},SpellOnline:{global:{context:_("Toggle Automatic Spell Checking"),menu:_(
"~Automatic Spell Checking")}},SpellingAndGrammarDialog:{global:{context:_("Check Spelling"),menu:_(
"~Spelling...")}},SplitCell:{global:{menu:_("Split Cells...")},spreadsheet:{menu:_("Unmerge Cells")}
},SplitTable:{text:{menu:_("Split Table...")}},"StarShapes.bang":{global:{menu:_("Explosion")}},
"StarShapes.concave-star6":{global:{menu:_("6-Point Star, Concave")}},"StarShapes.doorplate":{
global:{menu:_("Doorplate")}},"StarShapes.horizontal-scroll":{global:{menu:_("Horizontal Scroll")}},
"StarShapes.signet":{global:{menu:_("Signet")}},"StarShapes.star12":{global:{menu:_("12-Point Star")
}},"StarShapes.star24":{global:{menu:_("24-Point Star")}},"StarShapes.star4":{global:{menu:_(
"4-Point Star")}},"StarShapes.star5":{global:{menu:_("5-Point Star")}},"StarShapes.star6":{global:{
menu:_("6-Point Star")}},"StarShapes.star8":{global:{menu:_("8-Point Star")}},
"StarShapes.vertical-scroll":{global:{menu:_("Vertical Scroll")}},StatisticsMenu:{spreadsheet:{
menu:_("Statistics")}},Strikeout:{global:{menu:_("Strikethrough")}},SubScript:{global:{menu:_(
"Subscript")},text:{menu:_("Subscript")}},SuperScript:{global:{menu:_("Superscript")},text:{menu:_(
"Superscript")}},"SymbolShapes.brace-pair":{global:{menu:_("Double Brace")}},
"SymbolShapes.bracket-pair":{global:{menu:_("Double Bracket")}},"SymbolShapes.cloud":{global:{
menu:_("Cloud")}},"SymbolShapes.diamond-bevel":{global:{menu:_("Diamond Bevel")}},
"SymbolShapes.flower":{global:{menu:_("Flower")}},"SymbolShapes.forbidden":{global:{menu:_(
"Prohibited")}},"SymbolShapes.heart":{global:{menu:_("Heart")}},"SymbolShapes.left-brace":{global:{
menu:_("Left Brace")}},"SymbolShapes.left-bracket":{global:{menu:_("Left Bracket")}},
"SymbolShapes.lightning":{global:{menu:_("Lightning Bolt")}},"SymbolShapes.moon":{global:{menu:_(
"Moon")}},"SymbolShapes.octagon-bevel":{global:{menu:_("Octagon Bevel")}},"SymbolShapes.puzzle":{
global:{menu:_("Puzzle")}},"SymbolShapes.quad-bevel":{global:{menu:_("Square Bevel")}},
"SymbolShapes.right-brace":{global:{menu:_("Right Brace")}},"SymbolShapes.right-bracket":{global:{
menu:_("Right Bracket")}},"SymbolShapes.smiley":{global:{menu:_("Smiley Face")}},
"SymbolShapes.sun":{global:{menu:_("Sun")}},TTestDialog:{spreadsheet:{menu:_("Paired ~t-test...")}},
TableCellBackgroundColor:{text:{menu:_("Table Cell Background Color")}},TableDeleteMenu:{global:{
menu:_("~Delete")}},TableDialog:{presentation:{context:_("Ta~ble Properties..."),menu:_(
"~Properties...")},text:{context:_("~Table Properties..."),menu:_("~Properties...")}},
TableInsertMenu:{global:{menu:_("~Insert")}},TableMenu:{global:{menu:_("T~able")}},
TableNumberFormatDialog:{text:{menu:_("Number Format...")}},TableSelectMenu:{text:{menu:_("~Select")
}},TableSort:{presentation:{menu:_("So~rt...")},text:{menu:_("So~rt...")}},TaskPaneInsertPage:{
presentation:{menu:_("Insert Slide")}},Text:{global:{context:_(
"Insert Text Box (double click for multi-selection)"),menu:_("~Text Box")}},TextAlign:{global:{
menu:_("Align Tex~t")}},TextWrap:{text:{menu:_("Text Wrap...")}},ThemeDialog:{global:{menu:_(
"Theme...")}},ThesaurusDialog:{global:{menu:_("~Thesaurus...")},text:{menu:_("~Thesaurus...")}},
TitlePageDialog:{text:{menu:_("Title Page...")}},ToggleMergeCells:{spreadsheet:{context:_(
"Merge and center or unmerge cells depending on the current toggle state"),menu:_(
"M~erge and Center Cells")}},TogglePrintGrid:{spreadsheet:{menu:_("Print Grid Lines")}},
ToggleSheetGrid:{spreadsheet:{menu:_("View Grid Lines")}},ToolsMenu:{global:{menu:_("~Tools")}},
TrackChanges:{text:{context:_("Record Track Changes"),menu:_("~Record")}},TransformDialog:{global:{
menu:_("Position and Si~ze...")}},Translate:{text:{menu:_("Translate...")}},Underline:{global:{
menu:_("Underline")}},UnderlineDouble:{global:{menu:_("Double Underline")}},Undo:{global:{menu:_(
"~Undo")}},UnfloatFrame:{text:{menu:_("Unfloat Frame Content")}},Ungroup:{global:{menu:_(
"~Ungroup...")}},UngroupSparklines:{spreadsheet:{menu:_("Ungroup Sparklines")}},UnsetCellsReadOnly:{
text:{menu:_("Unprotect Cells")}},UpSearch:{global:{menu:_("Find Previous")}},UpdateAll:{text:{
menu:_("~Update All")}},UpdateCurIndex:{text:{context:_("Update ~Index"),menu:_("Current ~Index")}},
Validation:{spreadsheet:{menu:_("~Validity...")}},VerticalText:{global:{context:_(
"Insert Vertical Text"),menu:_("Vertical Text")}},View3D:{global:{menu:_("~3D View...")}},ViewMenu:{
global:{menu:_("~View")}},Watermark:{text:{menu:_("Watermark...")}},WordCountDialog:{text:{menu:_(
"~Word Count...")}},WrapAnchorOnly:{text:{menu:_("~First Paragraph")}},WrapContour:{text:{menu:_(
"~Contour")}},WrapIdeal:{text:{menu:_("~Optimal")}},WrapLeft:{text:{menu:_("Before")}},WrapMenu:{
text:{menu:_("~Wrap")}},WrapOff:{text:{menu:_("None")}},WrapOn:{text:{menu:_("~Parallel")}},
WrapRight:{text:{menu:_("After")}},WrapText:{spreadsheet:{menu:_("Wrap Text")}},WrapThrough:{text:{
menu:_("~Through")}},WrapThroughTransparencyToggle:{text:{menu:_("In ~Background")}},XLineColor:{
global:{menu:_("Line Color")}},ZTestDialog:{spreadsheet:{menu:_("~Z-test...")}},ZoomMinus:{global:{
menu:_("Zoom Out")}},ZoomPlus:{global:{menu:_("Zoom In")}}};window._UNO=function(string,component,
isContext){var command=string.substr(5);var context="menu";if(isContext===true){context="context"}
var entry=unoCommandsArray[command];if(entry===undefined){return command}if(component=="drawing"){
component="presentation"}var componentEntry=entry[component];if(componentEntry===undefined){
componentEntry=entry["global"];if(componentEntry===undefined){return command}}
var text=componentEntry[context];if(text===undefined){text=componentEntry["menu"];if(
text===undefined){return command}}return this.removeAccessKey(text)};
window.removeAccessKey=function(text){text=text.replace(/\(~[A-Za-z]\)/,"");text=text.replace("~",""
);return text};window.UNOKey={NUM0:256,NUM1:257,NUM2:258,NUM3:259,NUM4:260,NUM5:261,NUM6:262,
NUM7:263,NUM8:264,NUM9:265,A:512,B:513,C:514,D:515,E:516,F:517,G:518,H:519,I:520,J:521,K:522,L:523,
M:524,N:525,O:526,P:527,Q:528,R:529,S:530,T:531,U:532,V:533,W:534,X:535,Y:536,Z:537,F1:768,F2:769,
F3:770,F4:771,F5:772,F6:773,F7:774,F8:775,F9:776,F10:777,F11:778,F12:779,F13:780,F14:781,F15:782,
F16:783,F17:784,F18:785,F19:786,F20:787,F21:788,F22:789,F23:790,F24:791,F25:792,F26:793,DOWN:1024,
UP:1025,LEFT:1026,RIGHT:1027,HOME:1028,END:1029,PAGEUP:1030,PAGEDOWN:1031,RETURN:1280,ESCAPE:1281,
TAB:1282,BACKSPACE:1283,SPACE:1284,INSERT:1285,DELETE:1286,ADD:1287,SUBTRACT:1288,MULTIPLY:1289,
DIVIDE:1290,POINT:1291,COMMA:1292,LESS:1293,GREATER:1294,EQUAL:1295,OPEN:1296,CUT:1297,COPY:1298,
PASTE:1299,UNDO:1300,REPEAT:1301,FIND:1302,PROPERTIES:1303,FRONT:1304,CONTEXTMENU:1305,HELP:1306,
MENU:1307,HANGUL_HANJA:1308,DECIMAL:1309,TILDE:1310,QUOTELEFT:1311,CAPSLOCK:1312,NUMLOCK:1313,
SCROLLLOCK:1314,DELETE_TO_BEGIN_OF_LINE:1536,DELETE_TO_END_OF_LINE:1537,
DELETE_TO_BEGIN_OF_PARAGRAPH:1538,BRACKETLEFT:1315,BRACKETRIGHT:1316,SEMICOLON:1317,QUOTERIGHT:1318,
DELETE_TO_END_OF_PARAGRAPH:1539,DELETE_WORD_BACKWARD:1540,DELETE_WORD_FORWARD:1541,
INSERT_LINEBREAK:1542,INSERT_PARAGRAPH:1543,MOVE_WORD_BACKWARD:1544,MOVE_WORD_FORWARD:1545,
MOVE_TO_BEGIN_OF_LINE:1546,MOVE_TO_END_OF_LINE:1547,MOVE_TO_BEGIN_OF_PARAGRAPH:1548,
MOVE_TO_END_OF_PARAGRAPH:1549,SELECT_BACKWARD:1550,SELECT_FORWARD:1551,SELECT_WORD_BACKWARD:1552,
SELECT_WORD_FORWARD:1553,SELECT_WORD:1554,SELECT_LINE:1555,SELECT_PARAGRAPH:1556,SELECT_ALL:1557,
SELECT_TO_BEGIN_OF_LINE:1558,SELECT_TO_END_OF_LINE:1559,MOVE_TO_BEGIN_OF_DOCUMENT:1560,
MOVE_TO_END_OF_DOCUMENT:1561,SELECT_TO_BEGIN_OF_DOCUMENT:1562,SELECT_TO_END_OF_DOCUMENT:1563,
SELECT_TO_BEGIN_OF_PARAGRAPH:1564,SELECT_TO_END_OF_PARAGRAPH:1565};window.UNOModifier={SHIFT:4096,
CTRL:8192,ALT:16384,CTRLMAC:32768};window.L.Util={extend:function(dest){var i,j,len,src;for(j=1,
len=arguments.length;j<len;j++){src=arguments[j];for(i in src){dest[i]=src[i]}}return dest},
create:Object.create||function(){function F(){}return function(proto){F.prototype=proto;return new F
}}(),bind:function(fn,obj){var slice=Array.prototype.slice;if(fn.bind){return fn.bind.apply(fn,
slice.call(arguments,1))}var args=slice.call(arguments,2);return function(){return fn.apply(obj,
args.length?args.concat(slice.call(arguments)):arguments)}},setOptions:function(obj,options){if(
!Object.prototype.hasOwnProperty.call(obj,"options")){obj.options=obj.options?window.L.Util.create(
obj.options):{}}for(var i in options){obj.options[i]=options[i]}return obj.options},
sanitizeElementId:function(id){return CSS.escape(id.replaceAll(" ",""))}};if(
!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){
position=position||0;return this.substr(position,searchString.length)===searchString}}if(
!Element.prototype.remove){Element.prototype.remove=function(){if(this.parentNode){
this.parentNode.removeChild(this)}}}if(Number.EPSILON===undefined){Number.EPSILON=Math.pow(2,-52)}
if(!Number.MAX_SAFE_INTEGER){Number.MAX_SAFE_INTEGER=9007199254740991}
window.L.extend=window.L.Util.extend;window.L.bind=window.L.Util.bind;
window.L.setOptions=window.L.Util.setOptions;window.L.Class=function(){};
window.L.Class.extend=function(props){var NewClass=function(){if(this.initialize){
this.initialize.apply(this,arguments)}this.callInitHooks()};
var parentProto=NewClass.__super__=this.prototype;var proto=window.L.Util.create(parentProto);
proto.constructor=NewClass;NewClass.prototype=proto;for(var i in this){if(
Object.prototype.hasOwnProperty.call(this,i)&&i!=="prototype"){NewClass[i]=this[i]}}if(props.statics
){window.L.extend(NewClass,props.statics);delete props.statics}if(props.includes){
window.L.Util.extend.apply(null,[proto].concat(props.includes));delete props.includes}if(
proto.options){props.options=window.L.Util.extend(window.L.Util.create(proto.options),props.options)
}window.L.extend(proto,props);proto._initHooks=[];proto.callInitHooks=function(){if(
this._initHooksCalled){return}if(parentProto.callInitHooks){parentProto.callInitHooks.call(this)}
this._initHooksCalled=true;for(var i=0,len=proto._initHooks.length;i<len;i++){proto._initHooks[i
].call(this)}};return NewClass};window.L.Class.include=function(props){window.L.extend(
this.prototype,props)};window.L.Class.mergeOptions=function(options){window.L.extend(
this.prototype.options,options)};window.L.Class.addInitHook=function(fn){
var args=Array.prototype.slice.call(arguments,1);var init=typeof fn==="function"?fn:function(){this[
fn].apply(this,args)};this.prototype._initHooks=this.prototype._initHooks||[];
this.prototype._initHooks.push(init)};window.L.Evented=window.L.Class.extend({initialize:function(){
this._evented=new app.Evented(this)},on:function(types,fn,context){this._evented.on(types,fn,context
);return this},off:function(types,fn,context){this._evented.off(types,fn,context);return this},
fire:function(type,data,propagate){this._evented.fire(type,data,propagate);return this},
listens:function(type,propagate){return this._evented.listens(type,propagate)},once:function(types,
fn,context){this._evented.once(types,fn,context);return this},_getTypedInner:function(){
return this._evented},addEventParent:function(obj){var inner=obj._getTypedInner?obj._getTypedInner(
):obj;this._evented.addEventParent(inner);return this},removeEventParent:function(obj){
var inner=obj._getTypedInner?obj._getTypedInner():obj;this._evented.removeEventParent(inner);
return this}});var proto=window.L.Evented.prototype;proto.addEventListener=proto.on;
proto.removeEventListener=proto.clearAllEventListeners=proto.off;
proto.addOneTimeEventListener=proto.once;proto.fireEvent=proto.fire;
proto.hasEventListeners=proto.listens;window.L.Mixin={Events:proto};
app.definitions.Socket=window.L.Class.extend({ProtocolVersionNumber:"0.1",ReconnectCount:0,
WasShownLimitDialog:false,WSDServer:{},IndirectSocketReconnectCount:0,enableTraceEventLogging:false,
TunnelledDialogImageCacheSize:0,getParameterValue:function(s){var i=s.indexOf("=");if(i===-1
)return undefined;return s.substring(i+1)},initialize:function(map){window.app.console.debug(
"socket.initialize:");this._map=map;this._msgQueue=[];this._delayedMessages=[];
this._handlingDelayedMessages=false;this._inLayerTransaction=false;
this._slurpDuringTransaction=false},getWebSocketBaseURI:function(map){
return window.makeWsUrlWopiSrc("/cool/",map.options.doc+"?"+$.param(map.options.docParams))},
connect:function(socket){var map=this._map;map.options.docParams["permission"]=app.getPermission();
if(this.socket){this.close()}if(socket&&(socket.readyState===1||socket.readyState===0)){
this.socket=socket}else if(window.ThisIsAMobileApp){}else{try{this.socket=window.createWebSocket(
this.getWebSocketBaseURI(map));window.socket=this.socket}catch(e){this._map.fire("error",{msg:_(
"Oops, there is a problem connecting to {productname}: ").replace("{productname}",
typeof brandProductName!=="undefined"?brandProductName:"F7 Office (unbranded)"
)+e,cmd:"socket",kind:"failed",id:3});return}}this.socket.onerror=window.L.bind(this._onSocketError,
this);this.socket.onclose=window.L.bind(this._onSocketClose,this);this.socket.onopen=window.L.bind(
this._onSocketOpen,this);this.socket.onmessage=window.L.bind(this._slurpMessage,this);
this.socket.binaryType="arraybuffer";if(map.options.docParams.access_token&&parseInt(
map.options.docParams.access_token_ttl)){var tokenExpiryWarning=900*1e3;clearTimeout(
this._accessTokenExpireTimeout);this._accessTokenExpireTimeout=setTimeout(window.L.bind(
this._sessionExpiredWarning,this),parseInt(map.options.docParams.access_token_ttl)-Date.now(
)-tokenExpiryWarning)}this._emptyQueue()},_emptyQueue:function(){if(
window.queueMsg&&window.queueMsg.length>0){for(var it=0;it<window.queueMsg.length;it++){
this._slurpMessage({data:window.queueMsg[it],textMsg:window.queueMsg[it]})}window.queueMsg=[]}},
_sessionExpiredWarning:function(){clearTimeout(this._accessTokenExpireTimeout);
var expirymsg=errorMessages.sessionexpiry;if(parseInt(this._map.options.docParams.access_token_ttl
)-Date.now()<=0){expirymsg=errorMessages.sessionexpired}var dateTime=new Date(parseInt(
this._map.options.docParams.access_token_ttl));var dateOptions={year:"numeric",month:"short",
day:"numeric",hour:"2-digit",minute:"2-digit"};var timerepr=dateTime.toLocaleDateString(
String.locale,dateOptions);this._map.fire("warn",{msg:expirymsg.replace("{time}",timerepr)});
this._accessTokenExpireTimeout=setTimeout(window.L.bind(this._sessionExpiredWarning,this),120*1e3)},
setUnloading:function(){if(this.socket.setUnloading)this.socket.setUnloading()},close:function(){
this.socket.onerror=function(){};this.socket.onclose=function(){};this.socket.onmessage=function(){}
this.socket.close();this._map["wopi"].resetAppLoaded();this._map.fire("docloaded",{status:false});
clearTimeout(this._accessTokenExpireTimeout)},connected:function(){
return this.socket&&this.socket.readyState===1},sendMessage:function(msg){if(
this._map._debug.eventDelayWatchdog)this._map._debug.timeEventDelay();if(this._map._fatal){return}
if(!app.idleHandler._active){if(typeof msg!=="string")return;if(!msg.startsWith("useractive"
)&&!msg.startsWith("userinactive")){window.app.console.log(
'Ignore outgoing message due to inactivity: "'+msg+'"');return}}if(
this._map.uiManager&&this._map.uiManager.isUIBlocked())return;var socketState=this.socket.readyState
if(socketState===2||socketState===3){this._map.loadDocument()}if(socketState===1){this._doSend(msg)
}else{this._msgQueue.push(msg)}},sendTraceEvent:function(name,ph,timeRange,args,id,tid){if(
timeRange===undefined)timeRange="ts="+Math.round(performance.now()*1e3);if(!id)id=1;if(!tid)tid=1;
this.sendMessage("TRACEEVENT name="+JSON.stringify(name
)+" ph="+ph+" "+timeRange+" id="+id+" tid="+tid+this._stringifyArgs(args))},_doSend:function(msg){
if(typeof msg==="string")this._logSocket("OUTGOING",msg);this.socket.send(msg)},
_getParameterByName:function(url,name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");
var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(url);
return results===null?"":results[1].replace(/\+/g," ")},_onSocketOpen:function(){
window.app.console.debug("_onSocketOpen:");app.idleHandler._serverRecycling=false;
app.idleHandler._documentIdle=false;var now0=Date.now();var now1=performance.now();
var now2=Date.now();this._doSend("coolclient "+this.ProtocolVersionNumber+" "+(now0+now2)/2+" "+now1
);var msg="load url="+encodeURIComponent(this._map.options.doc);if(this._map._docLayer){
this._reconnecting=true;msg+=" part="+this._map.getCurrentPartNumber()}if(
this._map.options.timestamp){msg+=" timestamp="+this._map.options.timestamp}if(
this._map._docPassword){msg+=" password="+this._map._docPassword}if(String.locale){
msg+=" lang="+String.locale}if(window.deviceFormFactor){
msg+=" deviceFormFactor="+window.deviceFormFactor}msg+=" timezone="+Intl.DateTimeFormat(
).resolvedOptions().timeZone;if(this._map.options.renderingOptions){var options={
rendering:this._map.options.renderingOptions};msg+=" options="+JSON.stringify(options)}
var spellOnline=window.prefs.get("SpellOnline");if(spellOnline){msg+=" spellOnline="+spellOnline}
const darkTheme=window.prefs.getBoolean("darkTheme");msg+=" darkTheme="+darkTheme;
const darkBackground=window.prefs.getBoolean("darkBackgroundForTheme."+(darkTheme?"dark":"light"),
darkTheme);msg+=" darkBackground="+darkBackground;this._map.uiManager.initDarkBackgroundUI(
darkBackground);msg+=" accessibilityState="+window.getAccessibilityState();
msg+=" clientvisiblearea="+window.makeClientVisibleArea();this._doSend(msg);for(
var i=0;i<this._msgQueue.length;i++){this._doSend(this._msgQueue[i])}this._msgQueue=[];
app.idleHandler._activate()},_utf8ToString:function(data){var strBytes="";for(
var it=0;it<data.length;it++){strBytes+=String.fromCharCode(data[it])}return strBytes},
_isReady:function(){if(window.bundlejsLoaded==false||window.fullyLoadedAndReady==false){return false
}if(typeof this._map=="undefined"||isNaN(this._map.options.tileWidthTwips)||isNaN(
this._map.options.tileHeightTwips)){return false}var center=this._map.getCenter();if(isNaN(
center.lat)||isNaN(center.lng)||isNaN(this._map.getZoom())){return false}return true},
_logSocket:function(type,msg){
var logMessage=this._map._debug.debugNeverStarted||this._map._debug.logIncomingMessages;if(
!logMessage)return;if(window.ThisIsTheGtkApp)window.postMobileDebug(type+" "+msg);
var debugOn=this._map._debug.debugOn;if(this._map._debug.overlayOn){
this._map._debug.setOverlayMessage("postMessage",type+": "+msg)}if(!debugOn&&msg.length>256
)msg=msg.substring(0,256)+"<truncated "+(msg.length-256)+"chars>";var status="";if(
!window.fullyLoadedAndReady)status+="[!fullyLoadedAndReady]";if(!window.bundlejsLoaded
)status+="[!bundlejsLoaded]";app.Log.log(msg,type+status);if(!window.protocolDebug&&!debugOn)return;
var color=type==="OUTGOING"?"color:red":"color:#2e67cf";window.app.console.log(
+new Date+" %c"+type+status+"%c: "+msg.concat(" ").replace(" ","%c "),"background:#ddf;color:black",
color,"color:")},_queueSlurpEventEmission:function(delayMS){if(
this._slurpTimer&&this._slurpTimerDelay!=delayMS){clearTimeout(this._slurpTimer);
this._slurpTimer=null;this._slurpTimerDelay=delayMS;var now=Date.now();
var sinceLaunchMS=now-this._slurpTimerLaunchTime;delayMS-=sinceLaunchMS;if(delayMS<=0)delayMS=1}if(
!this._slurpTimer){var that=this;if(!that._slurpTimerLaunchTime){that._slurpTimerLaunchTime=now;
that._slurpTimerDelay=delayMS}that._slurpTimer=setTimeout(function(){that._slurpTimer=undefined;
that._slurpTimerLaunchTime=undefined;that._slurpTimerDelay=undefined;if(that._inLayerTransaction){
that._slurpDuringTransaction=true;return}that._emitSlurpedEvents()},delayMS)}},
_emitSlurpedEvents:function(){if(this._map._debug.eventDelayWatchdog
)this._map._debug.timeEventDelay();var queueLength=this._slurpQueue.length;
var completeEventWholeFunction=this.createCompleteTraceEvent("emitSlurped-"+String(queueLength),{
"_slurpQueue.length":String(queueLength)});if(this._map&&this._map._docLayer){
TileManager.beginTransaction();this._inLayerTransaction=true;if(this.traceEventRecordingToggle){
var that=this;if(!that._renderEventTimer)that._renderEventTimer=setTimeout(function(){
var now=performance.now();var delta=now-that._renderEventTimerStart;if(delta>=2){
that.sendTraceEvent(name,"X","ts="+Math.round(that._renderEventTimerStart*1e3)+" dur="+Math.round((
now-that._renderEventTimerStart)*1e3));that._renderEventTimerStart=undefined}
that._renderEventTimer=undefined},0)}}var complete=true;try{for(var i=0;i<queueLength;++i){
var evt=this._slurpQueue[i];if(evt.isComplete()){var textMsg;if(typeof evt.data==="string"){
textMsg=evt.data.replace(/\s+/g,".")}else if(typeof evt.data==="object"){
textMsg=evt.textMsg.replace(/\s+/g,".")}
var completeEventOneMessage=this.createCompleteTraceEventFromEvent(textMsg);try{this._onMessage(evt)
}catch(e){let msg="Exception "+e+" emitting event "+evt.data+"\n"+e.stack;window.app.console.error(
msg);if(window.enableDebug||window.L.Browser.cypressTest)this._map.uiManager.showInfoModal(
"cool_alert","",msg,"",_("Close"),function(){},false);if(
window.L.Browser.cypressTest&&window.parent!==window&&e!==null){console.log(
"Sending event error to Cypress...",e);window.parent.postMessage(e)}}finally{if(
completeEventOneMessage)completeEventOneMessage.finish()}}else{
this._slurpQueue=this._slurpQueue.slice(i,queueLength);complete=false;break}}}finally{if(
completeEventWholeFunction)completeEventWholeFunction.finish()}if(complete)this._slurpQueue=[];if(
this._map){var completeCallback=()=>{this._map.fire("messagesdone");
this._renderEventTimerStart=performance.now();this._inLayerTransaction=false;if(
this._slurpDuringTransaction){this._slurpDuringTransaction=false;this._queueSlurpEventEmission(1)}};
if(this._inLayerTransaction&&this._map._docLayer){TileManager.endTransaction(completeCallback)}else{
completeCallback()}}},_slurpMessage:function(e){this._extractTextImg(e);
var docLayer=this._map?this._map._docLayer:undefined;if(docLayer&&docLayer.filterSlurpedMessage(e)
)return;var predictedTiles=TileManager.predictTilesToSlurp();var delayMS=Math.max(Math.min(
predictedTiles,50),1);if(!this._slurpQueue)this._slurpQueue=[];this._slurpQueue.push(e);
this._queueSlurpEventEmission(delayMS)},_extractCopyObject:function(e){var index;
e.imgBytes=new Uint8Array(e.data);index=e.imgBytes.indexOf(10);if(index<0)index=e.imgBytes.length;
e.textMsg=String.fromCharCode.apply(null,e.imgBytes.subarray(0,index));e.imgIndex=index+1},
_strFromUint8:function(prefix,data){var i,chunk=4096;var strBytes=prefix;for(
i=0;i<data.length;i+=chunk)strBytes+=String.fromCharCode.apply(null,data.slice(i,i+chunk));
strBytes+=String.fromCharCode.apply(null,data.slice(i));return strBytes},_extractImage:function(e){
var img;var data=e.imgBytes.subarray(e.imgIndex);var prefix="";if(data[0]!=137
)prefix=String.fromCharCode(137);img="data:image/png;base64,"+window.btoa(this._strFromUint8(prefix,
data));if(window.L.Browser.cypressTest&&window.prefs.getBoolean("image_validation_test")){if(
!window.imgDatas)window.imgDatas=[];window.imgDatas.push(img)}return img},_extractTextImg:function(e
){if((window.ThisIsTheiOSApp||window.ThisIsTheEmscriptenApp)&&typeof e.data==="string"){if(
e.data.startsWith("tile:")||e.data.startsWith("tilecombine:")||e.data.startsWith("delta:"
)||e.data.startsWith("renderfont:")||e.data.startsWith("rendersearchlist:")||e.data.startsWith(
"slidelayer:")||e.data.startsWith("windowpaint:")){var index;index=e.data.indexOf("\n");if(index<0
)index=e.data.length;e.imgBytes=new Uint8Array(e.data.length);for(var i=0;i<e.data.length;i++){
e.imgBytes[i]=e.data.charCodeAt(i)}e.imgIndex=index+1;e.textMsg=e.data.substring(0,index)}else{
e.textMsg=e.data}}else if(typeof e.data==="string"){e.textMsg=e.data}else if(
typeof e.data==="object"){this._extractCopyObject(e)}e.isComplete=function(){if(this.image
)return!!this.imageIsComplete;return true};var isSlideLayer=e.textMsg.startsWith("slidelayer:");
var isSlideRenderComplete=e.textMsg.startsWith("sliderenderingcomplete:");
var isZstdSlideshowEnabled=app.isExperimentalMode();if(isZstdSlideshowEnabled&&(
isSlideLayer||isSlideRenderComplete))return;var isTile=e.textMsg.startsWith("tile:");
var isDelta=e.textMsg.startsWith("delta:");if(!isTile&&!isDelta&&!e.textMsg.startsWith("renderfont:"
)&&!e.textMsg.startsWith("slidelayer:")&&!e.textMsg.startsWith("windowpaint:"))return;if(
e.textMsg.indexOf(" nopng")!==-1)return;if(e.imgBytes&&(isTile||isDelta)&&e.imgBytes[e.imgIndex]!=80
){e.image={rawData:e.imgBytes.subarray(e.imgIndex),isKeyframe:isTile};e.imageIsComplete=true;return}
var img=this._extractImage(e);if(isTile){e.image={src:img};e.imageIsComplete=true;return}
var that=this;e.image=new Image;e.image.onload=function(){e.imageIsComplete=true;
that._queueSlurpEventEmission(1);if(e.image.completeTraceEvent)e.image.completeTraceEvent.finish()};
e.image.onerror=function(err){window.app.console.log("Failed to load image "+img+" fun "+err);
e.imageIsComplete=true;that._queueSlurpEventEmission(1);if(e.image.completeTraceEvent
)e.image.completeTraceEvent.abort()};e.image.completeTraceEvent=this.createAsyncTraceEvent(
"loadTile");e.image.src=img},_buildUnauthorizedMessage:function(command){
var unauthorizedMsg=errorMessages.unauthorized;if(command.errorCode){var authError=window.atob(
command.errorCode);var verifyError=errorMessages.verificationerror.replace("{errormessage}",
authError);unauthorizedMsg+=" "+verifyError}return unauthorizedMsg},_onMessage:function(e){
var imgBytes,textMsg;textMsg=e.textMsg;imgBytes=e.imgBytes;if(window.L.Browser.cypressTest){
window.L.initial._stubMessage(textMsg)}this._logSocket("INCOMING",textMsg);
var command=this.parseServerCmd(textMsg);if(textMsg.startsWith("coolserver ")){var oldVersion=null;
var sameFile=true;if(this.WSDServer&&this.WSDServer.Id){oldVersion=this.WSDServer.Version;
window.app.console.assert(this._map.options.wopiSrc===window.wopiSrc,
"wopiSrc mismatch!: "+this._map.options.wopiSrc+" != "+window.wopiSrc);if(
this._map.options.previousWopiSrc&&this._map.options.wopiSrc){if(
this._map.options.previousWopiSrc!==this._map.options.wopiSrc)sameFile=false}}
this.WSDServer=JSON.parse(textMsg.substring(textMsg.indexOf("{")));if(oldVersion&&sameFile){if(
this.WSDServer.Version!==oldVersion){var reloadMessage=_(
"Server is now reachable. We have to refresh the page now.");if(window.mode.isMobile()
)reloadMessage=_("Server is now reachable...");var reloadFunc=function(){window.location.reload()};
if(!this._map["wopi"].DisableInactiveMessages)this._map.uiManager.showSnackbar(reloadMessage,_(
"RELOAD"),reloadFunc);else this._map.fire("postMessage",{msgId:"Reloading",args:{
Reason:"Reconnected"}});setTimeout(reloadFunc,5e3)}}if(window.indirectSocket){if(
window.expectedServerId&&window.expectedServerId!=this.WSDServer.Id){if(
this.IndirectSocketReconnectCount++>=3){var msg=errorMessages.clusterconfiguration.replace(
"{productname}",
typeof brandProductName!=="undefined"?brandProductName:"F7 Office (unbranded)"
);msg=msg.replace("{0}",window.expectedServerId);msg=msg.replace("{1}",window.routeToken);
msg=msg.replace("{2}",this.WSDServer.Id);this._map.uiManager.showInfoModal("wrong-server-modal",_(
"Cluster configuration warning"),msg,"",_("OK"),null,false);this.IndirectSocketReconnectCount=0
}else{this._map.showBusy(_("Wrong server, reconnecting..."),false);this.manualReconnect(3e3);
this.sendMessage("routetokensanitycheck");return}}}document.getElementById("coolwsd-version-label"
).textContent=_("COOLWSD version:");var h=this.WSDServer.Hash;if(parseInt(h,16).toString(16
)===h.toLowerCase().replace(/^0+/,"")){const anchor=document.createElement("a");anchor.setAttribute(
"href","#");anchor.setAttribute("target","_blank"
);anchor.textContent=h;const versionContainer=document.getElementById("coolwsd-version");
versionContainer.replaceChildren();versionContainer.appendChild(document.createTextNode(
this.WSDServer.Version));let span=document.createElement("span");span.appendChild(
document.createTextNode("git hash: "));span.appendChild(anchor);span.appendChild(
document.createTextNode(this.WSDServer.Options));versionContainer.appendChild(span)}else{
document.getElementById("coolwsd-version").textContent=this.WSDServer.Version}if(
!window.ThisIsAMobileApp){var idUri=window.makeHttpUrl("/hosting/discovery");$("#served-by-label"
).text(_("Served by:"));$("#coolwsd-id").html(
'<a target="_blank" href="'+idUri+'">'+this.WSDServer.Id+"</a>")}if(
this.WSDServer.Protocol!==this.ProtocolVersionNumber){this._map.fire("error",{msg:_(
"Unsupported server version.")})}}else if(textMsg.startsWith("lokitversion ")){
document.getElementById("lokit-version-label").textContent=_("LOKit version:");
const lokitVersionObj=JSON.parse(textMsg.substring(textMsg.indexOf("{")));
const versionContainer=document.getElementById("lokit-version");versionContainer.replaceChildren();
versionContainer.appendChild(document.createTextNode(
lokitVersionObj.ProductName+" "+lokitVersionObj.ProductVersion+lokitVersionObj.ProductExtension));
h=lokitVersionObj.BuildId.substring(0,10);if(parseInt(h,16).toString(16)===h.toLowerCase().replace(
/^0+/,"")){const anchor=document.createElement("a");anchor.setAttribute("target","_blank");
anchor.setAttribute("href","https://git.libreoffice.org/core/+log/"+lokitVersionObj.BuildId+"/");
anchor.textContent="git hash: "+h;const span=document.createElement("span");span.appendChild(anchor)
versionContainer.appendChild(span)}else{const span=document.createElement("span");
span.textContent="git hash: "+h;versionContainer.appendChild(span)}
this.TunnelledDialogImageCacheSize=lokitVersionObj.tunnelled_dialog_image_cache_size}else if(
textMsg.startsWith("enabletraceeventlogging ")){this.enableTraceEventLogging=true}else if(
textMsg.startsWith("osinfo ")){var osInfo=textMsg.replace("osinfo ","");
var osInfoElement=document.getElementById("os-info");if(osInfoElement)osInfoElement.innerText=osInfo
}else if(textMsg.startsWith("clipboardkey: ")){var key=textMsg.substring("clipboardkey: ".length);
if(this._map._clip)this._map._clip.setKey(key)}else if(textMsg.startsWith("perm:")){
var perm=textMsg.substring("perm:".length).trim();if(!app.isReadOnly())app.setPermission(perm);if(
this._map._docLayer)this._map.setPermission(app.file.permission);
app.file.disableSidebar=app.isReadOnly();return}else if(textMsg.startsWith("filemode:")){
var json=JSON.parse(textMsg.substring("filemode:".length).trim());if(!app.isReadOnly(
)&&json.readOnly){app.setPermission("readonly")}if(this._map._docLayer){this._map.setPermission(
app.file.permission)}app.setCommentEditingPermission(json.editComment);
app.setRedlineManagementAllowed(json.manageRedlines)}else if(textMsg.startsWith("lockfailed:")){
this._map.onLockFailed(textMsg.substring("lockfailed:".length).trim());return}else if(
textMsg.startsWith("wopi: ")){var wopiInfo=JSON.parse(textMsg.substring(textMsg.indexOf("{")));
this._map.fire("wopiprops",wopiInfo);return}else if(textMsg.startsWith("loadstorage: ")){if(
textMsg.substring(textMsg.indexOf(":")+2)==="failed"){window.app.console.debug(
"Loading document from a storage failed");this._map.fire("postMessage",{msgId:"App_LoadingStatus",
args:{Status:"Failed"}})}}else if(textMsg.startsWith("lastmodtime: ")){var time=textMsg.substring(
textMsg.indexOf(" ")+1);this._map.updateModificationIndicator(time);return}else if(
textMsg.startsWith("commandresult: ")){var commandresult=JSON.parse(textMsg.substring(
textMsg.indexOf("{")));if(commandresult["command"]==="savetostorage"||commandresult["command"
]==="save"){var postMessageObj={success:commandresult["success"],result:commandresult["result"],
errorMsg:commandresult["errorMsg"]};this._map.fire("postMessage",{msgId:"Action_Save_Resp",
args:postMessageObj})}else if(commandresult["command"]==="load"){postMessageObj={
success:commandresult["success"],result:commandresult["result"],errorMsg:commandresult["errorMsg"]};
this._map.fire("postMessage",{msgId:"Action_Load_Resp",args:postMessageObj})}return}else if(
textMsg.startsWith("migrate:")&&window.indirectSocket){var migrate=JSON.parse(textMsg.substring(
textMsg.indexOf("{")));var afterSave=migrate.afterSave;app.idleHandler._serverRecycling=false;if(
!afterSave){window.migrating=true;this._map.uiManager.closeAll();if(this._map.isEditMode()){
this._map.setPermission("view");this._map.uiManager.showSnackbar(_("Document is getting migrated"),
null,null,3e3)}if(migrate.saved){window.routeToken=migrate.routeToken;
window.expectedServerId=migrate.serverId;this.manualReconnect(2e3)}return}if(migrate.saved){
window.routeToken=migrate.routeToken;window.expectedServerId=migrate.serverId;this.manualReconnect(
2e3)}else{this._map.setPermission(app.file.permission);window.migrating=false}return}else if(
textMsg.startsWith("close: ")){textMsg=textMsg.substring("close: ".length);msg="";var postMsgData={}
var showMsgAndReload=false;if(textMsg==="ownertermination"){msg=_(
"Session terminated by document owner");postMsgData["Reason"]="OwnerTermination"}else if(
textMsg==="idle"||textMsg==="oom"){app.idleHandler._documentIdle=true;
this._map._docLayer._documentInfo=undefined;postMsgData["Reason"]="DocumentIdle";if(textMsg==="oom"
)postMsgData["Reason"]="OOM"}else if(textMsg==="shuttingdown"){msg=_(
"Server is shutting down for maintenance (auto-saving)");postMsgData["Reason"]="ShuttingDown";
app.idleHandler._active=false;app.idleHandler._serverRecycling=true}else if(
textMsg==="docdisconnected"){msg=_("Oops, there is a problem connecting the document");postMsgData[
"Reason"]="DocumentDisconnected"}else if(textMsg==="recycling"){msg=_(
"Server is down, restarting automatically. Please wait.");app.idleHandler._active=false;
app.idleHandler._serverRecycling=true;var min=5e3;var max=1e4;var timeoutMs=Math.floor(Math.random(
)*(max-min)+min);var socket=this;var map=this._map;clearTimeout(this.timer);this.timer=setInterval(
function(){if(socket.connected()){clearTimeout(this.timer);return}try{map.loadDocument(map)}catch(
error){window.app.console.warn("Cannot load document.")}},timeoutMs)}else if(textMsg.startsWith(
"documentconflict")){msg=_(
"Document has changed in storage. Loading the new document. Your version is available as revision.")
showMsgAndReload=true}else if(textMsg.startsWith("versionrestore:")){textMsg=textMsg.substring(
"versionrestore:".length).trim();if(textMsg==="prerestore_ack"){msg=_(
"Restoring older revision. Any unsaved changes will be available in version history");
this._map.fire("postMessage",{msgId:"App_VersionRestore",args:{Status:"Pre_Restore_Ack"}});
showMsgAndReload=true}}else if(textMsg.startsWith("reloadafterrename")){msg=_(
"Reloading the document after rename");showMsgAndReload=true}if(showMsgAndReload){if(
this._map._docLayer){this._map._docLayer.removeAllViews()}this.close();app.idleHandler._active=false
map=this._map;var that=this;clearTimeout(this.timer);this.timer=setInterval(function(){try{
app.idleHandler._activate();that._map.uiManager.documentNameInput.hideLoadingAnimation()}catch(error
){window.app.console.warn("Cannot activate map")}},3e3)}this._map.uiManager.closeAll();if(
textMsg==="idle"||textMsg==="oom"){app.idleHandler._dim();TileManager.discardAllCache()}if(
postMsgData["Reason"]){this._map.fire("postMessage",{msgId:"Session_Closed",args:postMsgData})}if(
textMsg==="ownertermination"){this._map.remove()}return}else if(textMsg.startsWith("error:")&&(
command.errorCmd==="storage"||command.errorCmd==="saveas"
)||command.errorCmd==="downloadas"||command.errorCmd==="exportas"){if(command.errorCmd==="saveas"){
this._map.fire("postMessage",{msgId:"Action_Save_Resp",args:{success:false,result:command.errorKind}
})}this._map.hideBusy();var storageError;if(command.errorKind==="savediskfull"){
storageError=errorMessages.storage.savediskfull}else if(command.errorKind==="savetoolarge"){
storageError=errorMessages.storage.savetoolarge}else if(command.errorKind==="savefailed"){
storageError=errorMessages.storage.savefailed}else if(command.errorKind==="renamefailed"){
storageError=errorMessages.storage.renamefailed}else if(command.errorKind==="saveunauthorized"){
storageError=errorMessages.storage.saveunauthorized}else if(command.errorKind==="saveasfailed"){
storageError=errorMessages.storage.saveasfailed}else if(command.errorKind==="loadfailed"){
storageError=errorMessages.storage.loadfailed;this.close()}else if(
command.errorKind==="documentconflict"){if(this._map.isReadOnlyMode()
)return;else this._showDocumentConflictPopUp();return}if(storageError&&storageError!=""){
var tmpLink=document.createElement("a");tmpLink.href=this._map.options.doc;
storageError=storageError.replace("%storageserver",tmpLink.host);this._map.fire("warn",{
msg:storageError});var postMessageObj={success:false,cmd:command.errorCmd,result:command.errorKind,
errorMsg:storageError};this._map.fire("postMessage",{msgId:"Action_Save_Resp",args:postMessageObj});
return}}else if(textMsg.startsWith("error:")&&command.errorCmd==="internal"){this._map.hideBusy();
this._map._fatal=true;if(command.errorKind==="diskfull"){this._map.fire("error",{
msg:errorMessages.diskfull})}else if(command.errorKind==="unauthorized"){var postMessageObj={
errorType:"websocketunauthorized",success:false,errorMsg:this._buildUnauthorizedMessage(command),
result:""};this._map.fire("postMessage",{msgId:"Action_Load_Resp",args:postMessageObj})}if(
this._map._docLayer){this._map._docLayer.removeAllViews();this._map._docLayer._resetClientVisArea()}
this.close();return}else if(textMsg.startsWith("error:")&&command.errorCmd==="load"){
this._map.hideBusy();this.close();var errorKind=command.errorKind;var passwordNeeded=false;if(
errorKind.startsWith("passwordrequired")){passwordNeeded=true;var msg="";
var passwordType=errorKind.split(":")[1];if(passwordType==="to-view"){msg+=_(
"Document requires password to view.")}else if(passwordType==="to-modify"){msg+=_(
"Document requires password to modify.");msg+=" ";msg+=_("Hit Cancel to open in view-only mode.")}
}else if(errorKind.startsWith("wrongpassword")){passwordNeeded=true;msg=_(
"Wrong password provided. Please try again.")}else if(errorKind.startsWith("faileddocloading")){
this._map._fatal=true;this._map.fire("error",{msg:errorMessages.faileddocloading})}else if(
errorKind.startsWith("docloadtimeout")){this._map._fatal=true;this._map.fire("error",{
msg:errorMessages.docloadtimeout})}else if(errorKind.startsWith("docunloading")){
app.idleHandler._active=false;clearTimeout(this.timer);if(this.ReconnectCount++>=10){this._map.fire(
"error",{msg:errorMessages.docunloadinggiveup});return}this.timer=setInterval(function(){try{
app.idleHandler._activate()}catch(error){window.app.console.warn("Cannot activate map")}},
500*this.ReconnectCount*this.ReconnectCount);if(this.ReconnectCount>1){this._map.showBusy(
errorMessages.docunloadingretry,false)}}if(passwordNeeded){this._askForDocumentPassword(passwordType
,msg);return}}else if(textMsg.startsWith("error:"
)&&command.errorCmd==="dialogevent"&&command.errorKind==="cantchangepass"){var msg=_(
"Only the document owner can change the password.");this._map.uiManager.showInfoModal("cool_alert",
"",msg,"",_("OK"));return}else if(textMsg.startsWith("error:")&&!this._map._docLayer){
textMsg=textMsg.substring(6);if(command.errorKind==="hardlimitreached"){
textMsg=errorMessages.limitreachedprod;textMsg=textMsg.replace("{0}",command.params[0]);
textMsg=textMsg.replace("{1}",command.params[1])}else if(command.errorKind==="serviceunavailable"){
textMsg=errorMessages.serviceunavailable}this._map._fatal=true;app.idleHandler._active=false;
this._map.fire("error",{msg:textMsg})}else if(textMsg.startsWith("fontsmissing:")){
var fontsMissingObj=JSON.parse(textMsg.substring(textMsg.indexOf("{")));var msg=" ";for(
var i=0;i<fontsMissingObj.fontsmissing.length;++i){if(i>0)msg+=", ";
msg+=fontsMissingObj.fontsmissing[i]}if(this._map.welcome&&!this._map.welcome.isGuest(
)&&this._map.welcome.shouldWelcome()&&window.autoShowWelcome){setTimeout(function(){
this._map.uiManager.showInfoModal("fontsmissing",_("Missing Fonts"),msg,null,_("Close"))}.bind(this)
,6e4)}else{this._map.uiManager.showInfoModal("fontsmissing",_("Missing Fonts"),msg,null,_("Close"))}
}else if(textMsg.startsWith("info:")&&command.errorCmd==="socket"){if(
command.errorKind==="limitreached"&&!this.WasShownLimitDialog){this.WasShownLimitDialog=true;
textMsg=errorMessages.limitreached;textMsg=textMsg.replace("{docs}",command.params[0]);
textMsg=textMsg.replace("{connections}",command.params[1]);textMsg=textMsg.replace("{productname}",
typeof brandProductName!=="undefined"?brandProductName:"F7 Office (unbranded)"
);this._map.fire("infobar",{msg:textMsg,action:app.util.getProduct(),
actionLabel:errorMessages.infoandsupport})}}else if(textMsg.startsWith("pong "
)&&this._map._debug.pingOn){this._map._debug.reportPong(command.rendercount)}else if(
textMsg.startsWith("saveas:")||textMsg.startsWith("renamefile:")){this._renameOrSaveAsCallback(
textMsg,command)}else if(textMsg.startsWith("exportas:")){this._exportAsCallback(command)}else if(
textMsg.startsWith("warn:")){var len="warn: ".length;textMsg=textMsg.substring(len);if(
textMsg.startsWith("saveas:")){var userName=command.username?command.username:_("Someone");
var message=_("{username} saved this document as {filename}. Do you want to join?").replace(
"{username}",userName).replace("{filename}",command.filename);this._map.uiManager.showConfirmModal(
"save-as-warning","",message,_("OK"),function(){this._renameOrSaveAsCallback(textMsg,command)}.bind(
this))}}else if(window.ThisIsAMobileApp&&textMsg.startsWith("mobile:")){
var mobileEvent=textMsg.substring("mobile: ".length);this._map.fire(mobileEvent)}else if(
textMsg.startsWith("blockui:")){textMsg=textMsg.substring("blockui:".length).trim();msg=null;if(
textMsg==="rename"){msg=_("The document is being renamed and will reload shortly")}else if(
textMsg==="switchingtooffline"){msg=_(
"The document is switching to Offline mode and will reload shortly")}this._map.fire("blockUI",{
message:msg});return}else if(textMsg.startsWith("unblockui:")){this._map.fire("unblockUI");return
}else if(textMsg.startsWith("featurelock: ")){var lockInfo=JSON.parse(textMsg.substring(
textMsg.indexOf("{")));this._map._setLockProps(lockInfo);return}else if(textMsg.startsWith(
"restrictedCommands: ")){var restrictionInfo=JSON.parse(textMsg.substring(textMsg.indexOf("{")));
this._map._setRestrictions(restrictionInfo);return}else if(textMsg.startsWith("blockedcommand: ")){
var blockedInfo=app.socket.parseServerCmd(textMsg.substring(16));if(
blockedInfo.errorKind==="restricted")window.app.console.log(
'Restricted command "'+blockedInfo.errorCmd+'" was blocked');else if(
blockedInfo.errorKind==="locked")this._map.openUnlockPopup(blockedInfo.errorCmd);return}else if(
textMsg.startsWith("updateroutetoken")&&window.indirectSocket){window.routeToken=textMsg.split(" ")[
1];window.app.console.log("updated routeToken: "+window.routeToken)}else if(textMsg.startsWith(
"reload")){window.location.reload(false)}else if(textMsg.startsWith("slidelayer:")){if(
app.isExperimentalMode()){SlideBitmapManager.handleRenderSlideEvent(e)}else{
const content=JSON.parse(textMsg.substring("slidelayer:".length+1));this._map.fire("slidelayer",{
message:content,image:e.image})}return}else if(textMsg.startsWith("sliderenderingcomplete:")){if(
app.isExperimentalMode()){SlideBitmapManager.handleSlideRenderingComplete(e)}else{
const status=textMsg.substring("sliderenderingcomplete:".length+1);this._map.fire(
"sliderenderingcomplete",{success:status==="success"})}return}else if(!textMsg.startsWith("tile:"
)&&!textMsg.startsWith("delta:")&&!textMsg.startsWith("renderfont:")&&!textMsg.startsWith(
"slidelayer:")&&!textMsg.startsWith("windowpaint:")){if(imgBytes!==undefined){try{
textMsg=String.fromCharCode.apply(null,imgBytes)}catch(error){textMsg=this._utf8ToString(imgBytes)}}
if(typeof e.data==="object"){textMsg=decodeURIComponent(window.escape(textMsg))}}if(
textMsg.startsWith("status:")){this._onStatusMsg(textMsg,JSON.parse(textMsg.replace("status:",""
).replace("statusupdate:","")));return}if(textMsg.startsWith("progress:")){var info=JSON.parse(
textMsg.substring(textMsg.indexOf("{")));if(!info){window.app.console.error(
"Missing info in progress: message");return}info.statusType=info.id;info.background=info.type=="bg";
if(info.id=="find"||info.id=="connect"||info.id=="ready"){this._map.showBusy(
window.ThisIsAMobileApp?_("Loading..."):_("Connecting..."),true);if(info.id=="ready"){
this.ReconnectCount=0;clearTimeout(this.timer)}}else if(info.id=="start"||info.id=="setvalue"
)this._map.fire("statusindicator",info);else if(info.id=="finish"){this._map.fire("statusindicator",
info);this._map._fireInitComplete("statusindicatorfinish");if(app.idleHandler._serverRecycling){
this._map.showBusy(_("Server is shutting down"),false)}}else window.app.console.error(
"Unknown progress status "+info.id);return}else if(textMsg.startsWith("jsdialog:")){
this._onJSDialog(textMsg,e.callback)}else if(textMsg.startsWith("hyperlinkclicked:")){
this._onHyperlinkClickedMsg(textMsg)}else if(textMsg.startsWith("browsersetting:")){
window.prefs._initializeBrowserSetting(textMsg)}else if(textMsg.startsWith("viewsetting:")){
const settingJSON=JSON.parse(textMsg.substring("viewsetting:".length+1));
app.serverConnectionService.onViewSetting(settingJSON)}if(textMsg.startsWith("downloadas:")){
var postMessageObj={success:true,result:"exportas",errorMsg:""};this._map.fire("postMessage",{
msgId:"Action_Save_Resp",args:postMessageObj})}if(
!this._map._docLayer||this._handlingDelayedMessages){this._delayMessage(textMsg)}else{
this._map._docLayer._onMessage(textMsg,e.image)}},_exportAsCallback:function(command){
this._map.hideBusy();this._map.uiManager.showInfoModal("exported-success",_("Exported to storage"),
_("Successfully exported: ")+decodeURIComponent(command.filename),"",_("OK"))},
_askForDocumentPassword:function(passwordType,msg){this._map.uiManager.showInputModal(
"password-popup","",msg,"",_("OK"),function(data){if(data){this._map._docPassword=data;if(
window.ThisIsAMobileApp){window.postMobileMessage("loadwithpassword password="+data)}
this._map.loadDocument()}else if(passwordType==="to-modify"){this._map._docPassword="";
this._map.loadDocument()}else{this._map.fire("postMessage",{msgId:"UI_Cancel_Password"});
this._map.hideBusy()}}.bind(this),true)},_showDocumentConflictPopUp:function(){var buttonList=[];
var callbackList=[];buttonList.push({id:"cancel-conflict-popup",text:_("Cancel")});
callbackList.push({id:"cancel-conflict-popup",func_:null});buttonList.push({id:"discard-button",
text:_("Discard")});buttonList.push({id:"overwrite-button",text:_("Overwrite")});callbackList.push({
id:"discard-button",func_:function(){this.sendMessage("closedocument")}.bind(this)});
callbackList.push({id:"overwrite-button",func_:function(){this.sendMessage("savetostorage force=1")
}.bind(this)});if(!this._map["wopi"].UserCanNotWriteRelative){buttonList.push({
id:"save-to-new-file",text:_("Save to new file")});callbackList.push({id:"save-to-new-file",
func_:function(){var filename=this._map["wopi"].BaseFileName;if(filename){
filename=app.LOUtil.generateNewFileName(filename,"_new");this._map.saveAs(filename)}}.bind(this)})}
var title=_("Document has been changed");var message=_(
"Document has been changed in storage. What would you like to do with your unsaved changes?");
this._map.uiManager.showModalWithCustomButtons("document-conflict-popup",title,message,false,
buttonList,callbackList)},_renameOrSaveAsCallback:function(textMsg,command){this._map.hideBusy();if(
command!==undefined&&command.url!==undefined&&command.url!==""){var url=command.url;
var docUrl=url.split("?")[0];this._map.options.doc=docUrl;
this._map.options.previousWopiSrc=this._map.options.wopiSrc;this._map.options.wopiSrc=docUrl;
window.wopiSrc=this._map.options.wopiSrc;if(textMsg.startsWith("renamefile:")){
this._map.uiManager.documentNameInput.showLoadingAnimation();this._map.fire("postMessage",{
msgId:"File_Rename",args:{NewName:command.filename}})}else if(textMsg.startsWith("saveas:")){
var accessToken=this._getParameterByName(url,"access_token");
var accessTokenTtl=this._getParameterByName(url,"access_token_ttl");
let noAuthHeader=this._getParameterByName(url,"no_auth_header");if(accessToken!==undefined){if(
accessTokenTtl===undefined){accessTokenTtl=0}this._map.options.docParams={access_token:accessToken,
access_token_ttl:accessTokenTtl};if(noAuthHeader=="1"||noAuthHeader=="true"){
this._map.options.docParams.no_auth_header=noAuthHeader}}else{this._map.options.docParams={}}
app.setPermission("edit");this.close();this._map.loadDocument();this._map.sendInitUNOCommands();
this._map.fire("postMessage",{msgId:"Action_Save_Resp",args:{success:true,
fileName:decodeURIComponent(command.filename)}})}}},_delayMessage:function(textMsg){var message={
msg:textMsg};this._delayedMessages.push(message)},_handleDelayedMessages:function(docLayer){
this._handlingDelayedMessages=true;while(this._delayedMessages.length){
var message=this._delayedMessages.shift();try{docLayer._onMessage(message.msg)}catch(e){
window.app.console.error("Exception "+e+" emitting event "+message,e.stack)}}
this._handlingDelayedMessages=false},_onStatusMsg:function(textMsg,command){var that=this;if(
!this._isReady()){setTimeout(function(){that._onStatusMsg(textMsg,command)},10);return}if(
!this._map._docLayer){this._map.initTextInput(command.type);if(window.prefs.useBrowserSetting){if(
!window.mode.isMobile()&&this._map.uiManager.getCurrentMode()==="notebookbar"
)this._map.uiManager.removeClassicUI();else if(!this._map.menubar
)this._map.uiManager.initializeMenubarAndTopToolbar()}
var tileWidthTwips=this._map.options.tileWidthTwips;
var tileHeightTwips=this._map.options.tileHeightTwips;if(
this._map.options.zoom!==this._map.options.defaultZoom){var scale=this._map.options.crs.scale(
this._map.options.defaultZoom-this._map.options.zoom);tileWidthTwips=Math.round(tileWidthTwips*scale
);tileHeightTwips=Math.round(tileHeightTwips*scale)}var docLayer=null;var options={
tileWidthTwips:tileWidthTwips/app.dpiScale,tileHeightTwips:tileHeightTwips/app.dpiScale,
docType:command.type,viewId:command.viewid};if(command.type==="text"
)docLayer=new window.L.WriterTileLayer(options);else if(command.type==="spreadsheet"
)docLayer=new window.L.CalcTileLayer(options);else if(
command.type==="presentation"||command.type==="drawing")docLayer=new window.L.ImpressTileLayer(
options);this._map._docLayer=docLayer;this._map.addLayer(docLayer);this._map.fire("doclayerinit")
}else if(this._reconnecting){this._map._docLayer._resetClientVisArea();
TileManager.refreshTilesInBackground();this._map.fire("statusindicator",{statusType:"reconnected"});
var darkTheme=window.prefs.getBoolean("darkTheme");this._map.uiManager.activateDarkModeInCore(
darkTheme);this._map.uiManager.applyInvert();this._map.uiManager.setCanvasColorAfterModeChange();if(
!window.mode.isMobile())this._map.uiManager.initializeNotebookbarInCore();
this._map.uiManager.closeAll();this._map.setPermission(app.file.permission);window.migrating=false;
this._map.uiManager.initializeSidebar();this._map.uiManager.refreshTheme()}this._map.fire(
"docloaded",{status:true});if(this._map._docLayer){this._map._docLayer._onMessage(textMsg);if(
!this._map._docLayer._getViewId())this._map.fire("updateviewslist");this._reconnecting=false;
this._handleDelayedMessages(docLayer)}},_onJSDialog:function(textMsg,callback){
var msgData=JSON.parse(textMsg.substring("jsdialog:".length+1));if(
msgData.children&&!app.util.isArray(msgData.children)){window.app.console.warn(
"_onJSDialogMsg: The children's data should be created of array type");return}
JSDialog.MessageRouter.processMessage(msgData,callback)},_onHyperlinkClickedMsg:function(textMsg){
var link=null;var coords=null;var hyperlinkMsgStart="hyperlinkclicked: ";
var coordinatesMsgStart=" coordinates: ";if(textMsg.indexOf(coordinatesMsgStart)!==-1){
var coordpos=textMsg.indexOf(coordinatesMsgStart);link=textMsg.substring(hyperlinkMsgStart.length,
coordpos);coords=textMsg.substring(coordpos+coordinatesMsgStart.length)}else link=textMsg.substring(
hyperlinkMsgStart.length);this._map.fire("hyperlinkclicked",{url:link,coordinates:coords})},
_onSocketError:function(event){window.app.console.warn("_onSocketError:",event);this._map.hideBusy()
},_onSocketClose:function(event){window.app.console.debug("_onSocketClose:");if(
!this._map._docLoadedOnce&&this.ReconnectCount===0){var errorMsg,errorType="";
var reason=event.reason;if(reason&&reason.startsWith("error:")){var command=this.parseServerCmd(
reason);if(command.errorCmd==="internal"&&command.errorKind==="unauthorized"){
errorType="websocketunauthorized";errorMsg=this._buildUnauthorizedMessage(command)}else if(
command.errorCmd==="storage"&&command.errorKind==="loadfailed"){errorType="websocketloadfailed";
errorMsg=errorMessages.storage.loadfailed}else{errorType="websocketgenericfailure";
errorMsg=errorMessages.websocketgenericfailure}}else{errorType="websocketproxyfailure";
errorMsg=errorMessages.websocketproxyfailure}this._map.fire("error",{msg:errorMsg,cmd:"socket",
kind:"closed",id:4});var postMessageObj={errorType:errorType,success:false,errorMsg:errorMsg,
result:""};this._map.fire("postMessage",{msgId:"Action_Load_Resp",args:postMessageObj});return}if(
this.ReconnectCount>0)return;var isActive=app.idleHandler._active;this._map.hideBusy();
app.idleHandler._active=false;app.idleHandler._serverRecycling=false;if(this._map._docLayer){
this._map._docLayer.removeAllViews();this._map._docLayer._resetClientVisArea();if(
GraphicSelection.hasActiveSelection())GraphicSelection.rectangle=null;if(
this._map._docLayer._docType==="presentation")app.setCursorVisibility(false);
this._map._docLayer._resetCanonicalIdStatus();this._map._docLayer._resetViewId();
this._map._docLayer._resetDocumentInfo()}if(isActive&&this._reconnecting){this._map.fire("error",{
msg:_("Well, this is embarrassing, we cannot connect to your document. Please try again."),
cmd:"socket",kind:"closed",id:4})}this._map["wopi"].resetAppLoaded();this._map.fire("docloaded",{
status:false});var that=this;setTimeout(function(){if(!that._reconnecting){that._reconnecting=true;
if(!app.idleHandler._documentIdle)that._map.showBusy(_("Reconnecting..."),false);
app.idleHandler._activate()}},1);if(this._map.isEditMode()){this._map.setPermission("view")}if(
!this._map["wopi"].DisableInactiveMessages&&app.sectionContainer&&!app.sectionContainer.testing
)this._map.uiManager.showSnackbar(_("The server has been disconnected."))},parseServerCmd:function(
msg){var tokens=msg.split(/[ \n]+/);var command={};for(var i=0;i<tokens.length;i++){if(tokens[i
].substring(0,9)==="tileposx="){command.x=parseInt(tokens[i].substring(9))}else if(tokens[i
].substring(0,9)==="tileposy="){command.y=parseInt(tokens[i].substring(9))}else if(tokens[i
].substring(0,2)==="x="){command.x=parseInt(tokens[i].substring(2))}else if(tokens[i].substring(0,2
)==="y="){command.y=parseInt(tokens[i].substring(2))}else if(tokens[i].substring(0,10
)==="tilewidth="){command.tileWidth=parseInt(tokens[i].substring(10))}else if(tokens[i].substring(0,
11)==="tileheight="){command.tileHeight=parseInt(tokens[i].substring(11))}else if(tokens[i
].substring(0,6)==="width="){command.width=parseInt(tokens[i].substring(6))}else if(tokens[i
].substring(0,7)==="height="){command.height=parseInt(tokens[i].substring(7))}else if(tokens[i
].substring(0,5)==="part="){command.part=parseInt(tokens[i].substring(5))}else if(tokens[i
].substring(0,6)==="parts="){command.parts=parseInt(tokens[i].substring(6))}else if(tokens[i
].substring(0,5)==="mode="){command.mode=parseInt(tokens[i].substring(5))}else if(tokens[i
].substring(0,8)==="current="){command.selectedPart=parseInt(tokens[i].substring(8))}else if(tokens[
i].substring(0,3)==="id="){command.id=tokens[i].substring(3).replace(/(\r\n|\n|\r)/gm,"")}else if(
tokens[i].substring(0,5)==="type="){command.type=tokens[i].substring(5).replace(/(\r\n|\n|\r)/gm,"")
}else if(tokens[i].substring(0,4)==="cmd="){command.errorCmd=tokens[i].substring(4)}else if(tokens[i
].substring(0,5)==="code="){command.errorCode=tokens[i].substring(5)}else if(tokens[i].substring(0,5
)==="kind="){command.errorKind=tokens[i].substring(5)}else if(tokens[i].substring(0,5)==="jail="){
command.jail=tokens[i].substring(5)}else if(tokens[i].substring(0,4)==="dir="){command.dir=tokens[i
].substring(4)}else if(tokens[i].substring(0,11)==="downloadid="){command.downloadid=tokens[i
].substring(11)}else if(tokens[i].substring(0,5)==="name="){command.name=tokens[i].substring(5)
}else if(tokens[i].substring(0,9)==="filename="){command.filename=tokens[i].substring(9)}else if(
tokens[i].substring(0,5)==="port="){command.port=tokens[i].substring(5)}else if(tokens[i].substring(
0,5)==="font="){command.font=tokens[i].substring(5)}else if(tokens[i].substring(0,5)==="char="){
command.char=tokens[i].substring(5)}else if(tokens[i].substring(0,4)==="url="){command.url=tokens[i
].substring(4)}else if(tokens[i].substring(0,7)==="viewid="){command.viewid=tokens[i].substring(7)
}else if(tokens[i].substring(0,8)==="nviewid="){command.nviewid=tokens[i].substring(8)}else if(
tokens[i].substring(0,7)==="params="){command.params=tokens[i].substring(7).split(",")}else if(
tokens[i].substring(0,12)==="rendercount="){command.rendercount=parseInt(tokens[i].substring(12))
}else if(tokens[i].startsWith("wid=")){command.wireId=this.getParameterValue(tokens[i])}else if(
tokens[i].substring(0,6)==="title="){command.title=tokens[i].substring(6)}else if(tokens[i
].substring(0,12)==="dialogwidth="){command.dialogwidth=tokens[i].substring(12)}else if(tokens[i
].substring(0,13)==="dialogheight="){command.dialogheight=tokens[i].substring(13)}else if(tokens[i
].substring(0,10)==="rectangle="){command.rectangle=tokens[i].substring(10)}else if(tokens[i
].substring(0,12)==="hiddenparts="){var hiddenparts=tokens[i].substring(12).split(",");
command.hiddenparts=[];hiddenparts.forEach(function(item){command.hiddenparts.push(parseInt(item))})
}else if(tokens[i].startsWith("rtlparts=")){var rtlParts=tokens[i].substring(9).split(",");
command.rtlParts=[];rtlParts.forEach(function(item){command.rtlParts.push(parseInt(item))})}else if(
tokens[i].startsWith("protectedparts=")){var protectedParts=tokens[i].substring(15).split(",");
command.protectedParts=[];protectedParts.forEach(function(item){command.protectedParts.push(
parseInt(item))})}else if(tokens[i].startsWith("hash=")){command.hash=tokens[i].substring(
"hash=".length)}else if(tokens[i]==="nopng"){command.nopng=true}else if(tokens[i].substring(0,9
)==="username="){command.username=tokens[i].substring(9)}else if(tokens[i].startsWith(
"pagerectangles=")){command.pageRectangleList=tokens[i].substring(15).split(";");
command.pageRectangleList=command.pageRectangleList.map(function(element){element=element.split(",")
return[parseInt(element[0]),parseInt(element[1]),parseInt(element[2]),parseInt(element[3])]})
}else if(tokens[i].startsWith("lastcolumn=")){command.lastcolumn=parseInt(tokens[i].substring(11))
}else if(tokens[i].startsWith("lastrow=")){command.lastrow=parseInt(tokens[i].substring(8))}else if(
tokens[i].startsWith("readonly=")){command.readonly=parseInt(tokens[i].substring(9))}}if(
command.tileWidth&&command.tileHeight&&this._map._docLayer){var defaultZoom=this._map.options.zoom;
var scale=command.tileWidth/this._map._docLayer.options.tileWidthTwips;command.zoom=Math.round(
defaultZoom-Math.log(scale)/Math.log(1.2))}return command},setTraceEventLogging:function(enabled){
this.traceEventRecordingToggle=enabled;this.sendMessage("traceeventrecording "+(
this.traceEventRecordingToggle?"start":"stop"))},traceEventRecordingToggle:false,
_stringifyArgs:function(args){return args==null?"":" args="+JSON.stringify(args)},
asyncTraceEventCounter:0,asyncTracePseudoThread:1,createAsyncTraceEvent:function(name,args){if(
!this.traceEventRecordingToggle)return null;var result={};result.id=this.asyncTraceEventCounter++;
result.tid=this.asyncTracePseudoThread++;result.active=true;result.args=args;this.sendTraceEvent(
name,"S",undefined,args,result.id,result.tid);var that=this;result.finish=function(){
that.asyncTracePseudoThread--;if(this.active){that.sendTraceEvent(name,"F",undefined,this.args,
this.id,this.tid);this.active=false}};result.abort=function(){that.asyncTracePseudoThread--;
this.active=false};return result},createCompleteTraceEvent:function(name,args){if(
!this.traceEventRecordingToggle)return null;var result={};result.active=true;
result.begin=performance.now();result.args=args;var that=this;result.finish=function(){if(
this.active){var now=performance.now();that.sendTraceEvent(name,"X","ts="+Math.round(this.begin*1e3
)+" dur="+Math.round((now-this.begin)*1e3),args);this.active=false}};result.abort=function(){
this.active=false};return result},createCompleteTraceEventFromEvent:function(textMsg){if(
!this.traceEventRecordingToggle)return null;var pretty;if(!textMsg)pretty="blob";else{
var idx=textMsg.indexOf(":");if(idx>0)pretty=textMsg.substring(0,idx);else if(textMsg.length<25
)pretty=textMsg;else pretty=textMsg.substring(0,25)}return this.createCompleteTraceEvent(pretty,{
message:textMsg})},manualReconnect:function(timeout){if(this._map._docLayer){
this._map._docLayer.removeAllViews()}app.idleHandler._active=false;this.close();clearTimeout(
this.timer);setTimeout(function(){try{app.idleHandler._activate()}catch(error){
window.app.console.warn("Cannot activate map")}},timeout)},threadLocalLoggingLevelToggle:false});
var cool;(function(cool){var Point=function(){function Point(x,y,round){if(round===void 0){
round=false}this.x=round?Math.round(x):x;this.y=round?Math.round(y):y}Point.parse=function(
pointString){if(typeof pointString!=="string"){console.error("invalid point string");
return undefined}var pointParts=pointString.match(/\d+/g);if(pointParts===null||pointParts.length<2
){console.error("incomplete point");return undefined}return new Point(parseInt(pointParts[0]),
parseInt(pointParts[1]))};Point.prototype.clone=function(){return new Point(this.x,this.y)};
Point.prototype.add=function(point){return this.clone()._add(Point.toPoint(point))};
Point.prototype._add=function(point){this.x+=point.x;this.y+=point.y;return this};
Point.prototype.subtract=function(point){return this.clone()._subtract(Point.toPoint(point))};
Point.prototype._subtract=function(point){this.x-=point.x;this.y-=point.y;return this};
Point.prototype.divideBy=function(num){return this.clone()._divideBy(num)};
Point.prototype._divideBy=function(num){this.x/=num;this.y/=num;return this};
Point.prototype.multiplyBy=function(num){return this.clone()._multiplyBy(num)};
Point.prototype._multiplyBy=function(num){this.x*=num;this.y*=num;return this};
Point.prototype.round=function(){return this.clone()._round()};Point.prototype._round=function(){
this.x=Math.round(this.x);this.y=Math.round(this.y);return this};Point.prototype.floor=function(){
return this.clone()._floor()};Point.prototype._floor=function(){this.x=Math.floor(this.x);
this.y=Math.floor(this.y);return this};Point.prototype.ceil=function(){return this.clone()._ceil()};
Point.prototype._ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};
Point.prototype.distanceTo=function(point){point=Point.toPoint(point);var x=point.x-this.x;
var y=point.y-this.y;return Math.sqrt(x*x+y*y)};Point.prototype.equals=function(point){
point=Point.toPoint(point);return Math.abs(point.x-this.x)<Number.EPSILON&&Math.abs(point.y-this.y
)<Number.EPSILON};Point.prototype.contains=function(point){point=Point.toPoint(point);
return Math.abs(point.x)<=Math.abs(this.x)&&Math.abs(point.y)<=Math.abs(this.y)};
Point.prototype.assign=function(point){var xChanged=this.setX(point.x);var yChanged=this.setY(
point.y);return xChanged||yChanged};Point.prototype.setX=function(x){if(x===this.x){return false}
this.x=x;return true};Point.prototype.setY=function(y){if(y===this.y){return false}this.y=y;
return true};Point.prototype.toString=function(){return"Point("+Point.formatNum(this.x
)+", "+Point.formatNum(this.y)+")"};Point.toPoint=function(x,y,round){if(x instanceof Point){
return x}if(x instanceof cool.SimplePoint){return new Point(x.x,x.y)}if(Array.isArray(x)){var arr=x;
return new Point(arr[0],arr[1])}if(x===undefined||x===null){return undefined}if(
Object.prototype.hasOwnProperty.call(x,"x")&&Object.prototype.hasOwnProperty.call(x,"y")){x=x;
return new Point(x.x,x.y)}x=x;return new Point(x,y,round)};Point.formatNum=function(num){
var pow=Math.pow(10,5);return Math.round(num*pow)/pow};return Point}();cool.Point=Point})(cool||(
cool={}));var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var cool;(function(cool){function PointConstruct(x,y,round){return new cool.Point(x,y,round)}
function toPoint(x,y,round){return cool.Point.toPoint(x,y,round)}var Bounds=function(){
function Bounds(a,b){var e_1,_a;if(!a)return;if(b){this.min=a instanceof cool.Point?a.clone(
):toPoint(a);var maybeMax=b instanceof cool.Point?b.clone():toPoint(b);if(
maybeMax.x>=this.min.x&&maybeMax.y>=this.min.y)this.max=maybeMax;else{this.max=this.min.clone();
this.extend(maybeMax)}}else try{for(var _b=__values(a),_c=_b.next();!_c.done;_c=_b.next()){
var point=_c.value;this.extend(point)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(_c&&!_c.done&&(
_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}}}Bounds.parse=function(rectString){if(
typeof rectString!=="string"){console.error("invalid input type, expected string");return undefined}
var rectParts=rectString.match(/\d+/g);if(rectParts===null||rectParts.length<4){console.error(
"incomplete rectangle");return undefined}var refPoint1=PointConstruct(parseInt(rectParts[0]),
parseInt(rectParts[1]));var offset=PointConstruct(parseInt(rectParts[2]),parseInt(rectParts[3]));
var refPoint2=refPoint1.add(offset);return new Bounds(refPoint1,refPoint2)};
Bounds.parseArray=function(rectListString){if(typeof rectListString!=="string"){console.error(
"invalid input type, expected string");return undefined}var parts=rectListString.match(/\d+/g);if(
parts===null||parts.length<4){return[]}var rectangles=[];for(var i=0;i+3<parts.length;i+=4){
var refPoint1=PointConstruct(parseInt(parts[i]),parseInt(parts[i+1]));var offset=PointConstruct(
parseInt(parts[i+2]),parseInt(parts[i+3]));var refPoint2=refPoint1.add(offset);rectangles.push(
new Bounds(refPoint1,refPoint2))}return rectangles};Bounds.prototype.extend=function(pointSrc){
var point=toPoint(pointSrc);if(!this.min&&!this.max){this.min=point.clone();this.max=point.clone()
}else{this.min.x=Math.min(point.x,this.min.x);this.max.x=Math.max(point.x,this.max.x);
this.min.y=Math.min(point.y,this.min.y);this.max.y=Math.max(point.y,this.max.y)}return this};
Bounds.prototype.clone=function(){return new Bounds(this.min,this.max)};
Bounds.prototype.getCenter=function(round){return PointConstruct((this.min.x+this.max.x)/2,(
this.min.y+this.max.y)/2,round)};Bounds.prototype.round=function(){this.min.x=Math.round(this.min.x)
this.min.y=Math.round(this.min.y);this.max.x=Math.round(this.max.x);this.max.y=Math.round(this.max.y
)};Bounds.prototype.translate=function(x,y){this.min.x+=x;this.min.y+=y;this.max.x+=x;this.max.y+=y}
Bounds.prototype.getBottomLeft=function(){return PointConstruct(this.min.x,this.max.y)};
Bounds.prototype.getTopRight=function(){return PointConstruct(this.max.x,this.min.y)};
Bounds.prototype.getTopLeft=function(){return PointConstruct(this.min.x,this.min.y)};
Bounds.prototype.getBottomRight=function(){return PointConstruct(this.max.x,this.max.y)};
Bounds.prototype.getSize=function(){return this.max.subtract(this.min)};
Bounds.prototype.contains=function(obj){var min,max;if(Array.isArray(obj
)||obj instanceof cool.Point||obj instanceof cool.SimplePoint){var point=toPoint(obj);min=max=point
}else{var bounds=Bounds.toBounds(obj);min=bounds.min;max=bounds.max}
return min.x>=this.min.x&&max.x<=this.max.x&&min.y>=this.min.y&&max.y<=this.max.y};
Bounds.prototype.intersects=function(boundsSrc){var bounds=Bounds.toBounds(boundsSrc);
var min=this.min;var max=this.max;var min2=bounds.min;var max2=bounds.max;
var xIntersects=max2.x>=min.x&&min2.x<=max.x;var yIntersects=max2.y>=min.y&&min2.y<=max.y;
return xIntersects&&yIntersects};Bounds.prototype.distanceTo=function(bounds){var min=this.min;
var max=this.max;var min2=bounds.min;var max2=bounds.max;
var xIntersects=max2.x>=min.x&&min2.x<=max.x;var yIntersects=max2.y>=min.y&&min2.y<=max.y;if(
xIntersects){if(yIntersects)return 0;if(max2.y<min.y)return min.y-max2.y;return min2.y-max.y}if(
yIntersects){if(max2.x<min.x)return min.x-max2.x;return min2.x-max.x}
var xdist=min.x>max2.x?min.x-max2.x:min2.x-max.x;var ydist=min.y>max2.y?min.y-max2.y:min2.y-max.y;
return Math.sqrt(xdist*xdist+ydist*ydist)};Bounds.prototype.add=function(point){return this.clone(
)._add(point)};Bounds.prototype._add=function(point){this.min._add(point);this.max._add(point);
return this};Bounds.prototype.getPointArray=function(){return[this.getBottomLeft(),
this.getBottomRight(),this.getTopLeft(),this.getTopRight()]};Bounds.prototype.toString=function(){
return"["+this.min.toString()+", "+this.max.toString()+"]"};Bounds.prototype.isValid=function(){
return!!(this.min&&this.max)};Bounds.prototype.intersectsAny=function(boundsArray){for(
var i=0;i<boundsArray.length;++i){if(boundsArray[i].intersects(this)){return true}}return false};
Bounds.prototype.clampX=function(x){return Math.max(this.min.x,Math.min(this.max.x,x))};
Bounds.prototype.clampY=function(y){return Math.max(this.min.y,Math.min(this.max.y,y))};
Bounds.prototype.clamp=function(obj){if(obj instanceof cool.Point){return PointConstruct(
this.clampX(obj.x),this.clampY(obj.y))}if(obj instanceof Bounds){return new Bounds(PointConstruct(
this.clampX(obj.min.x),this.clampY(obj.min.y)),PointConstruct(this.clampX(obj.max.x),this.clampY(
obj.max.y)))}console.error("invalid argument type")};Bounds.prototype.equals=function(bounds){
return this.min.equals(bounds.min)&&this.max.equals(bounds.max)};
Bounds.prototype.toRectangle=function(){return[this.min.x,this.min.y,this.max.x-this.min.x,
this.max.y-this.min.y]};Bounds.prototype.toCoreString=function(){
return this.min.x+", "+this.min.y+", "+(this.max.x-this.min.x)+", "+(this.max.y-this.min.y)};
Bounds.toBounds=function(a,b){if(!a||a instanceof Bounds){return a}return new Bounds(a,b)};
return Bounds}();cool.Bounds=Bounds})(cool||(cool={}));var cool;(function(cool){
var Transformation=function(){function Transformation(a,b,c,d){this.a=a;this.b=b;this.c=c;this.d=d}
Transformation.prototype.transform=function(point,scale){return this._transform(point.clone(),scale)
};Transformation.prototype._transform=function(point,scale){scale=scale||1;point.x=scale*(
this.a*point.x+this.b);point.y=scale*(this.c*point.y+this.d);return point};
Transformation.prototype.untransform=function(point,scale){scale=scale||1;return new cool.Point((
point.x/scale-this.b)/this.a,(point.y/scale-this.d)/this.c)};return Transformation}();
cool.Transformation=Transformation})(cool||(cool={}));window.L.DomUtil={get:function(id){
return typeof id==="string"?document.getElementById(id):id},getStyle:function(el,style){
var value=el.style[style]||el.currentStyle&&el.currentStyle[style];if((!value||value==="auto"
)&&document.defaultView){var css=document.defaultView.getComputedStyle(el,null);value=css?css[style
]:null}return value==="auto"?null:value},setStyle:function(el,style,value){if(el!==undefined
)el.style[style]=value},create:function(tagName,className,container){var el=document.createElement(
tagName);el.className=className;if(container){container.appendChild(el)}return el},
createWithId:function(tagName,id,container){var el=document.createElement(tagName);el.id=id;if(
container){container.appendChild(el)}return el},remove:function(el){if(!el){return}
var parent=el.parentNode;if(parent){parent.removeChild(el)}},empty:function(el){while(el.firstChild
){el.removeChild(el.firstChild)}},toFront:function(el){el.parentNode.appendChild(el)},
toBack:function(el){var parent=el.parentNode;parent.insertBefore(el,parent.firstChild)},
hasClass:function(el,name){if(el.classList!==undefined){return el.classList.contains(name)}
var className=window.L.DomUtil.getClass(el);return className.length>0&&new RegExp(
"(^|\\s)"+name+"(\\s|$)").test(className)},addClass:function(el,name){if(!el){return}if(
el.classList!==undefined){var classes=app.util.splitWords(name);for(var i=0,
len=classes.length;i<len;i++){el.classList.add(classes[i])}}else if(!window.L.DomUtil.hasClass(el,
name)){var className=window.L.DomUtil.getClass(el);window.L.DomUtil.setClass(el,(
className?className+" ":"")+name)}},removeClass:function(el,name){if(!el){return}if(
el.classList!==undefined){el.classList.remove(name)}else{window.L.DomUtil.setClass(el,app.util.trim(
(" "+window.L.DomUtil.getClass(el)+" ").replace(" "+name+" "," ")))}},removeChildNodes:function(el){
while(el.hasChildNodes()){el.removeChild(el.lastChild)}},setClass:function(el,name){if(
el.className.baseVal===undefined){el.className=name}else{el.className.baseVal=name}},
getClass:function(el){return el.className.baseVal===undefined?el.className:el.className.baseVal},
setOpacity:function(el,value){if("opacity"in el.style){el.style.opacity=value}else if(
"filter"in el.style){window.L.DomUtil._setOpacityIE(el,value)}},_setOpacityIE:function(el,value){
var filter=false,filterName="DXImageTransform.Microsoft.Alpha";try{filter=el.filters.item(filterName
)}catch(e){if(value===1){return}}value=Math.round(value*100);if(filter){filter.Enabled=value!==100;
filter.Opacity=value}else{el.style.filter+=" progid:"+filterName+"(opacity="+value+")"}},
testProp:function(props){var style=document.documentElement.style;for(var i=0;i<props.length;i++){
if(props[i]in style){return props[i]}}return false},setTransform:function(el,offset,scale){
var pos=offset||new cool.Point(0,0);el.style[window.L.DomUtil.TRANSFORM
]="translate3d("+pos.x+"px,"+pos.y+"px"+",0)"+(scale?" scale("+scale+")":"")},setPosition:function(
el,point,no3d){el._leaflet_pos=point;if(window.L.Browser.any3d&&!no3d){
window.L.DomUtil.setTransform(el,point)}else{el.style.left=point.x+"px";el.style.top=point.y+"px"}},
getPosition:function(el){return el._leaflet_pos},isPortrait:function(){
return window.matchMedia&&window.matchMedia("(orientation: portrait)").matches},
updateElementsOrientation:function(elements){var remove="portrait";var add="landscape";if(
window.L.DomUtil.isPortrait()){remove="landscape";add="portrait"}for(var i=0;i<elements.length;++i){
var element=elements[i];var domElement=window.L.DomUtil.get(element);window.L.DomUtil.removeClass(
domElement,remove);window.L.DomUtil.addClass(domElement,add)}}};(function(){
window.L.DomUtil.TRANSFORM=window.L.DomUtil.testProp(["transform","WebkitTransform","OTransform",
"MozTransform","msTransform"]);window.L.DomUtil.TRANSFORM_ORIGIN=window.L.DomUtil.testProp([
"transformOrigin","msTransformOrigin","WebkitTransformOrigin"]);
var transition=window.L.DomUtil.TRANSITION=window.L.DomUtil.testProp(["webkitTransition",
"transition","OTransition","MozTransition","msTransition"]);
window.L.DomUtil.TRANSITION_END=transition==="webkitTransition"||transition==="OTransition"?transition+"End":"transitionend"
if("onselectstart"in document){window.L.DomUtil.disableTextSelection=function(){
window.L.DomEvent.on(window,"selectstart",window.L.DomEvent.preventDefault)};
window.L.DomUtil.enableTextSelection=function(){window.L.DomEvent.off(window,"selectstart",
window.L.DomEvent.preventDefault)}}else{var userSelectProperty=window.L.DomUtil.testProp([
"userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);
window.L.DomUtil.disableTextSelection=function(){if(userSelectProperty){
var style=document.documentElement.style;this._userSelect=style[userSelectProperty];style[
userSelectProperty]="none"}};window.L.DomUtil.enableTextSelection=function(){if(userSelectProperty){
document.documentElement.style[userSelectProperty]=this._userSelect;delete this._userSelect}}}
window.L.DomUtil.disableImageDrag=function(){window.L.DomEvent.on(window,"dragstart",
window.L.DomEvent.preventDefault)};window.L.DomUtil.enableImageDrag=function(){
window.L.DomEvent.off(window,"dragstart",window.L.DomEvent.preventDefault)};
window.L.DomUtil.preventOutline=function(element){window.L.DomUtil.restoreOutline();
this._outlineElement=element;this._outlineStyle=element.style.outline;element.style.outline="none";
window.L.DomEvent.on(window,"keydown",window.L.DomUtil.restoreOutline,this)};
window.L.DomUtil.restoreOutline=function(){if(!this._outlineElement){return}
this._outlineElement.style.outline=this._outlineStyle;delete this._outlineElement;
delete this._outlineStyle;window.L.DomEvent.off(window,"keydown",window.L.DomUtil.restoreOutline,
this)}})();window.L.LatLng=function(lat,lng,alt){if(isNaN(lat)||isNaN(lng)){throw new Error(
"Invalid LatLng object: ("+lat+", "+lng+")")}this.lat=+lat;this.lng=+lng;if(alt!==undefined){
this.alt=+alt}};window.L.LatLng.prototype={equals:function(obj,maxMargin){if(!obj){return false}
obj=window.L.latLng(obj);var margin=Math.max(Math.abs(this.lat-obj.lat),Math.abs(this.lng-obj.lng));
return margin<=(maxMargin===undefined?1e-9:maxMargin)},toString:function(precision){
return"LatLng("+app.util.formatNum(this.lat,precision)+", "+app.util.formatNum(this.lng,precision
)+")"},distanceTo:function(){return 0},wrap:function(){return null}};window.L.latLng=function(a,b,c
){if(a instanceof window.L.LatLng){return a}if(app.util.isArray(a)&&typeof a[0]!=="object"){if(
a.length===3){return new window.L.LatLng(a[0],a[1],a[2])}if(a.length===2){
return new window.L.LatLng(a[0],a[1])}return null}if(a===undefined||a===null){return a}if(
typeof a==="object"&&"lat"in a){return new window.L.LatLng(a.lat,"lng"in a?a.lng:a.lon,a.alt)}if(
b===undefined){return null}return new window.L.LatLng(a,b,c)};window.L.LatLngBounds=function(
southWest,northEast){if(!southWest){return}var latlngs=northEast?[southWest,northEast]:southWest;
for(var i=0,len=latlngs.length;i<len;i++){this.extend(latlngs[i])}};
window.L.LatLngBounds.prototype={extend:function(obj){var sw=this._southWest,ne=this._northEast,sw2,
ne2;if(obj instanceof window.L.LatLng){sw2=obj;ne2=obj}else if(obj instanceof window.L.LatLngBounds
){sw2=obj._southWest;ne2=obj._northEast;if(!sw2||!ne2){return this}}else{return obj?this.extend(
window.L.latLng(obj)||window.L.latLngBounds(obj)):this}if(!sw&&!ne){
this._southWest=new window.L.LatLng(sw2.lat,sw2.lng);this._northEast=new window.L.LatLng(ne2.lat,
ne2.lng)}else{sw.lat=Math.min(sw2.lat,sw.lat);sw.lng=Math.min(sw2.lng,sw.lng);ne.lat=Math.max(
ne2.lat,ne.lat);ne.lng=Math.max(ne2.lng,ne.lng)}return this},padVertically:function(bufferRatio){
var sw=this._southWest,ne=this._northEast,heightBuffer=Math.abs(sw.lat-ne.lat)*bufferRatio;
return new window.L.LatLngBounds(new window.L.LatLng(sw.lat-heightBuffer,sw.lng),
new window.L.LatLng(ne.lat+heightBuffer,ne.lng))},getCenter:function(){return new window.L.LatLng((
this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},
getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},
getNorthWest:function(){return new window.L.LatLng(this.getNorth(),this.getWest())},
getSouthEast:function(){return new window.L.LatLng(this.getSouth(),this.getEast())},
getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},
getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},
getWidth:function(){return Math.abs(this.getEast()-this.getWest())},getHeight:function(){
return Math.abs(this.getNorth()-this.getSouth())},_getAsLatLngOrBounds(obj){if(typeof obj[0
]==="number"||obj instanceof window.L.LatLng){obj=window.L.latLng(obj)}else{
obj=window.L.latLngBounds(obj)}return obj},contains:function(obj){obj=this._getAsLatLngOrBounds(obj)
var sw=this._southWest,ne=this._northEast,sw2,ne2;if(obj instanceof window.L.LatLngBounds){
sw2=obj.getSouthWest();ne2=obj.getNorthEast()}else{sw2=ne2=obj}
return sw2.lat>=sw.lat&&ne2.lat<=ne.lat&&sw2.lng>=sw.lng&&ne2.lng<=ne.lng},inBand:function(obj){
obj=this._getAsLatLngOrBounds(obj);var sw=this._southWest,ne=this._northEast,sw2,ne2;if(
obj instanceof window.L.LatLngBounds){sw2=obj.getSouthWest();ne2=obj.getNorthEast()}else{sw2=ne2=obj
}return sw2.lat>=sw.lat&&ne2.lat<=ne.lat},intersects:function(bounds){bounds=window.L.latLngBounds(
bounds);var sw=this._southWest,ne=this._northEast,sw2=bounds.getSouthWest(),ne2=bounds.getNorthEast(
),latIntersects=ne2.lat>=sw.lat&&sw2.lat<=ne.lat,lngIntersects=ne2.lng>=sw.lng&&sw2.lng<=ne.lng;
return latIntersects&&lngIntersects},equals:function(bounds){if(!bounds){return false}
bounds=window.L.latLngBounds(bounds);return this._southWest.equals(bounds.getSouthWest()
)&&this._northEast.equals(bounds.getNorthEast())},isValid:function(){return!!(
this._southWest&&this._northEast)},isInAny:function(latLngBoundsArray){window.app.console.assert(
Array.isArray(latLngBoundsArray),"invalid argument type");for(var i=0;i<latLngBoundsArray.length;++i
){if(latLngBoundsArray[i].contains(this)){return true}}return false},toString:function(){
return"LatLngBounds("+this._southWest.toString()+","+this._northEast.toString()+")"}};
window.L.LatLngBounds.createDefault=function(){return new window.L.LatLngBounds(new window.L.LatLng(
0,0),new window.L.LatLng(0,0))};window.L.latLngBounds=function(a,b){if(
!a||a instanceof window.L.LatLngBounds){return a}return new window.L.LatLngBounds(a,b)};
window.L.Projection={};window.L.Projection.LonLat={project:function(latlng){return new cool.Point(
latlng.lng,latlng.lat)},unproject:function(point){return new window.L.LatLng(point.y,point.x)},
bounds:cool.Bounds.toBounds([-180,-90],[180,90])};window.L.CRS={
projection:window.L.Projection.LonLat,transformation:new cool.Transformation(1,0,-1,0),
latLngToPoint:function(latlng,zoom){var projectedPoint=this.projection.project(latlng),
scale=this.scale(zoom);return this.transformation._transform(projectedPoint,scale)},
pointToLatLng:function(point,zoom){var scale=this.scale(zoom),
untransformedPoint=this.transformation.untransform(point,scale);return this.projection.unproject(
untransformedPoint)},project:function(latlng){return this.projection.project(latlng)},
unproject:function(point){return this.projection.unproject(point)},scale:function(zoom){
return Math.pow(1.2,zoom)},rescale:function(point,oldZoom,newZoom){return cool.Point.toPoint(
point.x*this.scale(newZoom-oldZoom),point.y*this.scale(newZoom-oldZoom))},distance:function(latlng1,
latlng2){var dx=latlng2.lng-latlng1.lng,dy=latlng2.lat-latlng1.lat;return Math.sqrt(dx*dx+dy*dy)},
infinite:true};window.L.IFrameDialog=window.L.Class.extend({options:{prefix:"iframe-none",
method:"get"},initialize:function(url,params,element,options){var content,form;this._loading=false;
window.L.setOptions(this,options);const containerCss=this.options.dialogCssClass;
this._container=window.L.DomUtil.create("div",this.options.prefix+"-wrap "+containerCss);if(
this.options.titlebar){const titlebar=window.L.DomUtil.create("div",
"ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix",this._container);
const title=window.L.DomUtil.create("h2","ui-dialog-title",titlebar);title.innerText=_("Options");
const closeButton=window.L.DomUtil.create("button",
"ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close",titlebar);
window.L.DomUtil.create("span","ui-button-icon ui-icon ui-icon-closethick",closeButton);
window.L.DomEvent.on(closeButton,"click",()=>this.remove(this._container))}
content=window.L.DomUtil.create("div",this.options.prefix+"-content",this._container);
this._container.style.display="none";this._container.tabIndex=-1;form=window.L.DomUtil.create("form"
,"",content);this.fillParams(url,params,form);this._iframe=window.L.DomUtil.create("iframe",
this.options.prefix+"-modal",content);this._iframe.name=form.target;if(this.options.id){
this._iframe.id=this.options.id}const modalButtons=this.options.modalButtons;if(modalButtons){
const buttonBox=window.L.DomUtil.create("div","jsdialog ui-button-box end",content);
const buttonBoxLeft=window.L.DomUtil.create("div","jsdialog ui-button-box-left",buttonBox);
const buttonBoxRight=window.L.DomUtil.create("div","jsdialog ui-button-box-right",buttonBox);for(
const i in modalButtons){const wrapper=window.L.DomUtil.create("div","ui-pushbutton-wrapper",
modalButtons[i].align==="left"?buttonBoxLeft:buttonBoxRight);const button=window.L.DomUtil.create(
"button","ui-pushbutton",wrapper);button.id=modalButtons[i].id;button.innerText=modalButtons[i].text
}}if(element){document.body.insertBefore(this._container,element)}else{document.body.appendChild(
this._container)}form.submit();this._iframe.addEventListener("load",window.L.bind(this.onLoad,this))
},fillParams:function(url,params,form){var input,keys;form.action=url;
form.target=this.options.prefix+"-form";form.method=this.options.method;for(var item in params){
keys=Object.keys(params[item]);if(keys.length>0){input=window.L.DomUtil.create("input","",form);
input.type="hidden";input.name=String(keys[0]);input.value=String(params[item][keys[0]])}}},
onLoad:function(){var msg=this.options.prefix+"-load";var that=this;this._loading=true;
this._errorTimer=setTimeout(function(){if(!that.isVisible()){window.postMessage(
'{"MessageId":"'+msg+'"}')}},1e3);if(this.options.stylesheets){this.addStyleSheets(
this.options.stylesheets)}},addStyleSheet:function(href){if(
!this._iframe||!this._iframe.contentDocument){console.error("Cannot access iframe element");
return false}const head=this._iframe.contentDocument.head;
const link=this._iframe.contentDocument.createElement("link");link.rel="stylesheet";
link.type="text/css";link.href=href;head.appendChild(link);return true},addStyleSheets:function(
stylesheets){for(const i in stylesheets){this.addStyleSheet(stylesheets[i])}},clearTimeout:function(
){clearTimeout(this._errorTimer)},focus:function(){if(this._container){this._container.focus()}},
remove:function(){window.L.DomEvent.off(this._iframe,"load",this.onLoad,this);
window.L.DomUtil.remove(this._container);this._container=this._iframe=null},hasLoaded:function(){
return this.queryContainer()&&this._loading},queryContainer:function(){
return document.body.querySelector("."+this.options.prefix+"-wrap")},postMessage:function(msg){
this._iframe.contentWindow.postMessage(JSON.stringify(msg),"*")},isVisible:function(){
var elem=this.queryContainer();return elem&&elem.style.display!=="none"},show:function(){
this._container.style.display="";this.focus()}});window.addEventListener("keyup",
function iframeKeyupListener(e){if(e.keyCode===27||e.key==="Escape"){window.postMessage(
'{"MessageId":"welcome-close"}',"*");window.postMessage('{"MessageId":"settings-cancel"}',"*")}});
window.L.iframeDialog=function(url,params,element,options){return new window.L.IFrameDialog(url,
params,element,options)};window.L.Map=window.L.Evented.extend({statics:{THIS:undefined},options:{
crs:window.L.CRS,center:[0,0],docParams:{},zoom:10,minZoom:1,maxZoom:18,
maxBounds:window.L.latLngBounds([0,0],[-100,100]),fadeAnimation:false,markerZoomAnimation:true,
defaultZoom:10,tileWidthTwips:window.tileSize*15,tileHeightTwips:window.tileSize*15,
urlPrefix:"cool",wopiSrc:"",cursorURL:app.LOUtil.getURL("cursors")},uiManager:null,dialog:null,
jsdialog:null,context:{context:""},initialize:function(id,options){
window.L.Evented.prototype.initialize.call(this);options=window.L.setOptions(this,options);if(
this.options.documentContainer){this.options.documentContainer=window.L.DomUtil.get(
this.options.documentContainer)}this._clip=window.L.clipboard(this);this._initContainer(id);
this._initLayout();if(window.mode.isDesktop()){window.L.DomUtil.addClass(window.L.DomUtil.get(
"toolbar-wrapper"),"readonly")}this._initEvents();this._cacheSVG=[];if(options.maxBounds){
this.setMaxBounds(options.maxBounds)}if(options.zoom!==undefined){this._zoom=this._limitZoom(
options.zoom)}if(options.center&&options.zoom!==undefined){this.setView(window.L.latLng(
options.center),options.zoom,true)}Cursor.imagePath=options.cursorURL;this._handlers=[];
this._layers={};this._zoomBoundLayers={};this._sizeChanged=true;this._bDisableKeyboard=false;
this._fatal=false;this._enabled=true;this._debugAlwaysActive=false;this._disableDefaultAction={};
this.showSidebar=false;this._previewQueue=[];this._previewRequestsOnFly=0;
this._timeToEmptyQueue=new Date;this._partsDirection=1;this._lockAccessibilityOn=false;
app.setCursorVisibility(true);this._winId=0;this._activeDialog=null;this._isSearching=false;
this.callInitHooks();this.addHandler("keyboard",window.L.Map.Keyboard);this.addHandler("dragging",
window.L.Map.Drag);this.dragging.disable();this.addHandler("mouse",window.L.Map.Mouse);
this.addHandler("scrollHandler",window.L.Map.Scroll);this.addHandler("doubleClickZoom",
window.L.Map.DoubleClickZoom);this.addHandler("touchGesture",window.L.Map.TouchGesture);
this.dragging._draggable._manualDrag=window.touch.isTouchEvent;if(this.options.imagePath){
window.L.Icon.Default.imagePath=this.options.imagePath}this._addLayers(this.options.layers);
app.socket=new app.definitions.Socket(this);this._progressBar=window.L.progressOverlay(
new cool.Point.toPoint(150,25));this._debug=new app.DebugManager(this);this.on("docloaded",function(
){if(this.options.debug&&!this._debug.debugOn){this._debug.toggle()}
app.serverConnectionService.onDocumentLoaded()});this.on("modificationindicatorinitialized",
function(){this._modIndicatorInitialized=true});this.initConditions={doclayerinit:false,
statusindicatorfinish:false,StyleApply:false,CharFontName:false,updatepermission:false};
this.initComplete=false;app.events.on("updatepermission",function(e){if(!this.initComplete){
this._fireInitComplete("updatepermission")}if(e.detail.perm==="readonly"){window.L.DomUtil.addClass(
this._container.parentElement,"readonly");if(window.mode.isDesktop()||window.mode.isTablet()){
window.L.DomUtil.addClass(window.L.DomUtil.get("toolbar-wrapper"),"readonly")}
window.L.DomUtil.addClass(window.L.DomUtil.get("main-menu"),"readonly");window.L.DomUtil.addClass(
window.L.DomUtil.get("presentation-controls-wrapper"),"readonly")}else{window.L.DomUtil.removeClass(
this._container.parentElement,"readonly");if(window.mode.isDesktop()||window.mode.isTablet()){
window.L.DomUtil.removeClass(window.L.DomUtil.get("toolbar-wrapper"),"readonly")}
window.L.DomUtil.removeClass(window.L.DomUtil.get("main-menu"),"readonly");
window.L.DomUtil.removeClass(window.L.DomUtil.get("presentation-controls-wrapper"),"readonly")}
}.bind(this));this.on("doclayerinit",function(){if(!this.initComplete){this._fireInitComplete(
"doclayerinit")}if(window.mode.isMobile()){document.getElementById("document-container"
).classList.add("mobile");this._size=new cool.Point(0,0);this.showCalcInputBar()}});this.on(
"updatetoolbarcommandvalues",function(e){if(this.initComplete){return}if(
e.commandName===".uno:StyleApply"){this._fireInitComplete("StyleApply")}else if(
e.commandName===".uno:CharFontName"){this._fireInitComplete("CharFontName")}});if(
window.ThisIsTheAndroidApp){this.on("readonlymode",function(){this.setPermission("edit")})}
this.showBusy(_("Initializing..."),false);this.on("statusindicator",this._onUpdateProgress,this);
this.on("editorgotfocus",this._onEditorGotFocus,this);this.on("changefocuswidget",
this._onChangeFocusWidget,this);this.on("searchstart",this._onSearchStart,this);this._viewInfo={};
this._viewInfoByUserName={};this._viewColors={};this._everModified=false;this._renameFilename="";
this._docLoaded=false;this._docLoadedOnce=false;this._lastModDateValue="";this.on(
"commandstatechanged",function(e){if(e.commandName===".uno:ModifiedStatus"){
this._everModified=this._everModified||e.state==="true";this.fire("postMessage",{
msgId:"Doc_ModifiedStatus",args:{Modified:e.state==="true"}});if(this._everModified){this.fire(
"updatemodificationindicator",{status:e.state==="true"?"MODIFIED":"SAVED"})}}},this);this.on(
"commandvalues",function(e){if(e.commandName===".uno:LanguageStatus"&&app.util.isArray(
e.commandValues)){app.languages=[];e.commandValues.forEach(function(language){
var split=language.split(";");language=split[0];var code="";if(split.length>1)code=split[1];
app.languages.push({translated:_(language),neutral:language,iso:code})});app.languages.sort(
function(a,b){return a.translated<b.translated?-1:a.translated>b.translated?1:0});this.fire(
"languagesupdated")}});this.on("docloaded",function(e){this._docLoaded=e.status;if(this._docLoaded){
app.idleHandler.notifyActive();app.dispatcher=new app.definitions["dispatcher"];if(
!document.hasFocus()){this.fire("editorgotfocus");this.focus()}app.idleHandler._activate();if(
window.ThisIsTheAndroidApp){window.postMobileMessage("hideProgressbar")}
app.activeDocument.activeView.sendClientVisibleArea(true)}else if(
this._docLayer&&app.sectionContainer){var commentSection=app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name);if(commentSection)commentSection.clearList()}if(
!window.mode.isMobile())this.initializeModificationIndicator();if(!this._docLoadedOnce){
this._docLoadedOnce=this._docLoaded}},this);this.fire("postMessage",{msgId:"App_LoadingStatus",
args:{Status:"Initialized"}})},initTextInput:function(docType){
var hasAccessibilitySupport=window.enableAccessibility&&window.prefs.getBoolean("accessibilityState"
);hasAccessibilitySupport=hasAccessibilitySupport&&(
docType==="text"||docType==="presentation"||docType==="spreadsheet");this.setupCoreAccessibility(
hasAccessibilitySupport);this.createTextInput(hasAccessibilitySupport)},createTextInput:function(
enableA11y){this._textInput=enableA11y?window.L.a11yTextInput():window.L.textInput();this.addLayer(
this._textInput)},setupCoreAccessibility:function(enableA11y){app.socket.sendMessage(
"a11ystate "+enableA11y)},setAccessibilityState:function(enable){if(window.prefs.getBoolean(
"accessibilityState")===enable)return;window.prefs.set("accessibilityState",enable);
this.setupCoreAccessibility(enable);this.removeLayer(this._textInput);this.createTextInput(enable);
this.fire("a11ystatechanged");if(enable)this._textInput._requestFocusedParagraph();
this._textInput.showCursor()},lockAccessibilityOn:function(){this.setAccessibilityState(true);
this._lockAccessibilityOn=true;this.fire("a11ystatechanged")},loadDocument:function(socket){
app.socket.connect(socket);if(this._clip)this._clip.clearSelection()},
sendInitNotebookbarCommands:function(){app.socket.sendMessage(
"commandvalues command=.uno:LanguageStatus");this._docLayer._getToolbarCommandsValues()},
sendInitUNOCommands:function(){this.sendInitNotebookbarCommands();if(
this._docLayer._docType==="spreadsheet"){if(this._docLayer.options.sheetGeometryDataEnabled
)this._docLayer.requestSheetGeometryData();this._docLayer.refreshViewData();TileManager.update()}
app.socket.sendMessage("commandvalues command=.uno:ViewAnnotations")},getViewId:function(username){
for(var idx in this._viewInfo){if(this._viewInfo[idx].username===username){return this._viewInfo[idx
].id}}return-1},addView:function(viewInfo){this._viewInfo[viewInfo.id]=viewInfo;if(
viewInfo.userextrainfo!==undefined&&viewInfo.userextrainfo.avatar!==undefined){
this._viewInfoByUserName[viewInfo.username]=viewInfo}this.fire("postMessage",{msgId:"View_Added",
args:{Deprecated:true,ViewId:viewInfo.id,UserId:viewInfo.userid,UserName:viewInfo.username,
UserExtraInfo:viewInfo.userextrainfo,Color:app.LOUtil.rgbToHex(viewInfo.color),
ReadOnly:viewInfo.readonly}});this.fire("addview",{viewId:viewInfo.id,username:viewInfo.username,
extraInfo:viewInfo.userextrainfo,readonly:this.isViewReadOnly(viewInfo.id)});this.updateAvatars()},
removeView:function(viewid){var username=this._viewInfo[viewid].username;
delete this._viewInfoByUserName[this._viewInfo[viewid].username];delete this._viewInfo[viewid];
this.fire("postMessage",{msgId:"View_Removed",args:{Deprecated:true,ViewId:viewid}});this.fire(
"removeview",{viewId:viewid,username:username})},panBy:function(offset){offset=cool.Point.toPoint(
offset).round();if(!offset.x&&!offset.y)return this;if(!this.getSize().contains(offset)){
this._resetView(this.unproject(this.project(this.getCenter()).add(offset)),this.getZoom());
return this}this.fire("movestart");window.L.DomUtil.setPosition(this._mapPane,this._getMapPanePos(
).subtract(offset));this.fire("move").fire("moveend");return this},setView:function(center,zoom,
reset){zoom=zoom===undefined?this._zoom:this._limitZoom(zoom);center=this._limitCenter(
window.L.latLng(center),zoom,this.options.maxBounds);if(this._loaded&&!reset&&zoom===this._zoom){
var offset=this._getCenterOffset(center)._floor();this.panBy(offset);return this}else{
this._resetView(center,zoom);return this}},updateAvatars:function(){if(
this._docLayer&&this._docLayer._annotations&&this._docLayer._annotations._items){for(
var idxAnno in this._docLayer._annotations._items){
var annotation=this._docLayer._annotations._items[idxAnno];var username=annotation._data.author;if(
this._viewInfoByUserName[username])annotation._data.avatar=this._viewInfoByUserName[username
].userextrainfo.avatar;annotation._updateContent()}}},initializeModificationIndicator:function(){
this.fire("initmodificationindicator",this._lastmodtime);this.updateModificationIndicator(
this._lastmodtime)},updateModificationIndicator:function(newModificationTime){var timeout;if(
typeof newModificationTime==="string"){this._lastmodtime=newModificationTime}clearTimeout(
this._modTimeout);if(this._modIndicatorInitialized&&this._lastmodtime){var dateTime=new Date(
this._lastmodtime.replace(/,.*/,"Z"));var dateValue;var elapsed=Date.now()-dateTime;
var rtf1=new Intl.RelativeTimeFormat(String.locale,{style:"narrow"});if(
"minSavedMessageTimeoutSecs"in window&&elapsed<window.minSavedMessageTimeoutSecs*1e3){
timeout=window.minSavedMessageTimeoutSecs*1e3;dateValue=""}else if(elapsed<6e4){dateValue=_(
"Last saved:")+" "+rtf1.format(-Math.round(elapsed/1e3),"second");timeout=6e3}else if(elapsed<36e5){
dateValue=_("Last saved:")+" "+rtf1.format(-Math.round(elapsed/6e4),"minute");timeout=6e4}else if(
elapsed<36e5*24){dateValue=_("Last saved:")+" "+rtf1.format(-Math.round(elapsed/36e5),"hour");
timeout=6e4}else{dateValue=_("Last saved:")+" "+dateTime.toLocaleDateString(String.locale,{
year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});timeout=6e4}this.fire(
"updatemodificationindicator",{lastSaved:dateValue});if(timeout){this._modTimeout=setTimeout(
window.L.bind(this.updateModificationIndicator,this,-1),timeout)}}if(
this.lastModIndicator!==null&&this.lastModIndicator!==undefined
)this.lastModIndicator.innerHTML=dateValue;this.setLastModDateValue(dateValue);
this._modTimeout=setTimeout(window.L.bind(this.updateModificationIndicator,this,-1),timeout)},
setLastModDateValue:function(dateValue){this._lastModDateValue=dateValue},
getLastModDateValue:function(){return this._lastModDateValue},showBusy:function(label,bar){if(
window.ThisIsTheAndroidApp)return;if(this._docLayer){this.fire("showbusy",{label:label});return}
this._progressBar.delayedStart(this,label,bar)},hideBusy:function(){if(window.ThisIsTheAndroidApp
)return;this.fire("hidebusy");this._progressBar.end(this)},zoomToFactor:function(zoom){
return Math.pow(1.2,zoom-this.options.zoom)},getDesktopCalcZoomCenter:function(){
const docLayer=this._docLayer;if(app.calc.cellCursorRectangle){const twipsTopLeft=[
app.calc.cellCursorRectangle.x1,app.calc.cellCursorRectangle.y1];
const cursorInBounds=app.activeDocument.activeView.viewedRectangle.containsPoint(twipsTopLeft);if(
cursorInBounds){return new cool.Point(...twipsTopLeft)}}if(docLayer._cellSelectionArea){
const twipsCenter=docLayer._cellSelectionArea.center;
const selectionInBounds=app.activeDocument.activeView.viewedRectangle.containsPoint(twipsCenter);if(
selectionInBounds){return new cool.Point(...twipsCenter)}}const viewBounds=this.getPixelBoundsCore()
return docLayer._corePixelsToTwips(viewBounds.getCenter())},setDesktopCalcViewOnZoom:function(zoom,
animate){zoom=this._limitZoom(zoom);if(zoom===this.getZoom()){return}const docLayer=this._docLayer;
if(!docLayer.options.sheetGeometryDataEnabled||!docLayer.sheetGeometry)return false;
const typing=app.file.textCursor.visible;const tsManager=docLayer._painter;
const ctx=tsManager._paintContext();const splitPos=ctx.splitPos;const viewBounds=ctx.viewBounds;
const freePaneBounds=new cool.Bounds(viewBounds.min.add(splitPos),viewBounds.max);
const zoomCenter=docLayer._twipsToCorePixels(this.getDesktopCalcZoomCenter());
tsManager._offset=new cool.Point(0,0);const docPos=docLayer._painter._getZoomDocPos(zoomCenter,
zoomCenter,freePaneBounds,{freezeX:false,freezeY:false},splitPos,this.getZoomScale(zoom),true);
const newCenterLatLng=this.unproject(docPos.center.divideBy(app.dpiScale),zoom);
this._ignoreCursorUpdate=true;const mapUpdater=animationCalculatedNewCenter=>{if(
animationCalculatedNewCenter){this._resetView(window.L.latLng(animationCalculatedNewCenter),zoom);
return}this._resetView(window.L.latLng(newCenterLatLng),zoom)};const runAtFinish=()=>{
this._ignoreCursorUpdate=false;if(typing){docLayer.activateCursor()}};if(animate){
this._docLayer.runZoomAnimation(zoom,this.unproject(zoomCenter.divideBy(app.dpiScale),this.getZoom()
),mapUpdater,runAtFinish);return}mapUpdater(newCenterLatLng);runAtFinish()},
ignoreCursorUpdate:function(){return this._ignoreCursorUpdate},enableTextInput:function(){
this._setTextInputState(true)},disableTextInput:function(){this._setTextInputState(false)},
_setTextInputState:function(enable){var docLayer=this._docLayer;if(!docLayer)return;
this._ignoreCursorUpdate=!enable;if(!app.file.textCursor.visible)return;if(!enable){
this._textInput.disable()}else{this._textInput.enable();docLayer._updateCursorPos()}},
setZoom:function(zoom,options,animate){if(animate&&window.L.Browser.cypressTest)animate=false;if(
this._docLayer instanceof window.L.CanvasTileLayer){if(!zoom
)zoom=this._clientZoom||this.options.zoom;else this._clientZoom=zoom}if(!this._loaded){
this._zoom=this._limitZoom(zoom);return this}var curCenter=this.getCenter();if(
this._docLayer&&this._docLayer._docType==="spreadsheet"){this._docLayer._checkSpreadSheetBounds(zoom
);if(window.mode.isDesktop()){return this.setDesktopCalcViewOnZoom(zoom,animate)}}
this._docLayer.setZoomChanged(true);var thisObj=this;var cssBounds=this.getPixelBounds();
var mapUpdater;var runAtFinish;if(
this._docLayer&&app.file.textCursor.visible&&app.activeDocument.activeView.viewedRectangle.containsPoint(
app.file.textCursor.rectangle.center)){var zoomScale=1/this.getZoomScale(zoom,this._zoom);
var caretPos=this._docLayer._twipsToLatLng({x:app.file.textCursor.rectangle.center[0],
y:app.file.textCursor.rectangle.center[1]});var newCenter=new window.L.LatLng(curCenter.lat+(
caretPos.lat-curCenter.lat)*(1-zoomScale),curCenter.lng+(caretPos.lng-curCenter.lng)*(1-zoomScale));
mapUpdater=function(){thisObj.setView(newCenter,zoom)};runAtFinish=function(){
thisObj._docLayer.setZoomChanged(false)};if(animate){this._docLayer.runZoomAnimation(zoom,
new window.L.LatLng(cssBounds.min.y<0?curCenter.lat:caretPos.lat,
cssBounds.min.x<0?curCenter.lng:caretPos.lng),mapUpdater,runAtFinish)}else{mapUpdater();runAtFinish(
)}return}mapUpdater=function(){thisObj.setView(curCenter,zoom)};runAtFinish=function(){
thisObj._docLayer.setZoomChanged(false)};if(animate){this._docLayer.runZoomAnimation(zoom,curCenter,
mapUpdater,runAtFinish)}else{mapUpdater();runAtFinish()}},zoomIn:function(delta,options,animate){
return this.setZoom(this._zoom+(delta||1),options,animate)},zoomOut:function(delta,options,animate){
return this.setZoom(this._zoom-(delta||1),options,animate)},setZoomAround:function(latlng,zoom){
var scale=this.getZoomScale(zoom),viewHalf=this.getSize().divideBy(2),
containerPoint=latlng instanceof cool.Point?latlng:this.latLngToContainerPointIgnoreSplits(latlng),
centerOffset=containerPoint.subtract(viewHalf).multiplyBy(1-1/scale),
newCenter=this.containerPointToLatLngIgnoreSplits(viewHalf.add(centerOffset));return this.setView(
newCenter,zoom)},panTo:function(center){return this.setView(center,this._zoom)},
setMaxBounds:function(bounds){bounds=window.L.latLngBounds(bounds);this.options.maxBounds=bounds;if(
this._loaded){this.panInsideBounds(this.options.maxBounds)}},setDocBounds:function(bounds){
bounds=window.L.latLngBounds(bounds);this.options.docBounds=bounds},hasDocBounds:function(){
return this.options.docBounds},getCorePxDocBounds:function(){if(!this.options.docBounds
)return new cool.Bounds(0,0);var topleft=this.project(this.options.docBounds.getNorthWest());
var bottomRight=this.project(this.options.docBounds.getSouthEast());return new cool.Bounds(
this._docLayer._cssPixelsToCore(topleft),this._docLayer._cssPixelsToCore(bottomRight))},
panInsideBounds:function(bounds){var center=this.getCenter(),newCenter=this._limitCenter(center,
this._zoom,bounds);if(center.equals(newCenter)){return this}if(this.distance(center,newCenter)<1e-7
){return this}return this.panTo(newCenter)},invalidateSize:function(debounceMoveend,oldSize){if(
!this._loaded){return this}if(!oldSize)oldSize=this.getSize();this._sizeChanged=true;
var newSize=this.getSize(),oldCenter=oldSize.divideBy(2).round(),newCenter=newSize.divideBy(2
).round(),offset=oldCenter.subtract(newCenter);if(!offset.x&&!offset.y){return this}this.fire("move"
);if(debounceMoveend){clearTimeout(this._sizeTimer);this._sizeTimer=setTimeout(window.L.bind(
this.fire,this,"moveend"),200)}else{this.fire("moveend")}return this.fire("resize",{oldSize:oldSize,
newSize:newSize})},stop:function(){app.util.cancelAnimFrame(this._flyToFrame);if(this._panAnim){
this._panAnim.stop()}return this},addHandler:function(name,HandlerClass){if(!HandlerClass){
return this}var handler=this[name]=new HandlerClass(this);this._handlers.push(handler);if(
this.options[name]){handler.enable()}if(name==="wopi"&&this.options["notWopiButIframe"]){
handler.addHooks()}return this},remove:function(){this._initEvents(true);try{
delete this._container._leaflet}catch(e){this._container._leaflet=undefined}window.L.DomUtil.remove(
this._mapPane);if(this._clearControlPos){this._clearControlPos()}this._clearHandlers();if(
this._loaded){this.fire("unload")}if(this._docLayer){this.removeLayer(this._docLayer)}
app.socket.close();return this},createPane:function(name,container){var className="leaflet-pane"+(
name?" leaflet-"+name.replace("Pane","")+"-pane":""),pane=window.L.DomUtil.create("div",className,
container||this._mapPane);if(name){this._panes[name]=pane}return pane},hasInfoForView:function(
viewid){return viewid in this._viewInfo},getViewName:function(viewid){if(this._viewInfo[viewid
]!==undefined)return this._viewInfo[viewid].username;else return null},getViewColor:function(viewid
){return this._viewInfo[viewid].color},isViewReadOnly:function(viewid){return this._viewInfo[viewid
].readonly!=="0"},getCenter:function(){this._checkIfLoaded();return this.layerPointToLatLng(
this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getZoomPercent:function(){
let zoomPercent=100;switch(this._zoom){case 1:zoomPercent=20;break;case 2:zoomPercent=25;break;
case 3:zoomPercent=30;break;case 4:zoomPercent=35;break;case 5:zoomPercent=40;break;case 6:
zoomPercent=50;break;case 7:zoomPercent=60;break;case 8:zoomPercent=70;break;case 9:zoomPercent=85;
break;case 10:zoomPercent=100;break;case 11:zoomPercent=120;break;case 12:zoomPercent=150;break;
case 13:zoomPercent=170;break;case 14:zoomPercent=200;break;case 15:zoomPercent=235;break;case 16:
zoomPercent=280;break;case 17:zoomPercent=335;break;case 18:zoomPercent=400;break;default:
var zoomRatio=this.getZoomScale(this.getZoom(),this.options.zoom);zoomPercent=this.getZoomPercent(
Math.round(this.getScaleZoom(zoomRatio)));break}return zoomPercent},getBounds:function(){
var bounds=this.getPixelBounds(),sw=this.unproject(bounds.getBottomLeft()),ne=this.unproject(
bounds.getTopRight());return new window.L.LatLngBounds(sw,ne)},getMinZoom:function(){
return this.options.minZoom===undefined?this._layersMinZoom||0:this.options.minZoom},
getMaxZoom:function(){
return this.options.maxZoom===undefined?this._layersMaxZoom===undefined?Infinity:this._layersMaxZoom:this.options.maxZoom
},getLayerMaxBounds:function(){return cool.Bounds.toBounds(this.latLngToLayerPoint(
this.options.maxBounds.getNorthWest()),this.latLngToLayerPoint(this.options.maxBounds.getSouthEast()
))},getLayerDocBounds:function(){return cool.Bounds.toBounds(this.latLngToLayerPoint(
this.options.docBounds.getNorthWest()),this.latLngToLayerPoint(this.options.docBounds.getSouthEast()
))},getSize:function(){if(!this._size||this._sizeChanged){this._size=new cool.Point(
this._container.clientWidth,this._container.clientHeight);this._sizeChanged=false}
return this._size.clone()},getPixelBounds:function(center,zoom){
var topLeftPoint=this._getTopLeftPoint(center,zoom);return new cool.Bounds(topLeftPoint,
topLeftPoint.add(this.getSize()))},getPixelBoundsCore:function(center,zoom){
var bounds=this.getPixelBounds(center,zoom);bounds.min=bounds.min.multiplyBy(app.dpiScale);
bounds.max=bounds.max.multiplyBy(app.dpiScale);return bounds},getPixelOrigin:function(){
this._checkIfLoaded();return this._pixelOrigin},getPane:function(pane){
return typeof pane==="string"?this._panes[pane]:pane},getContainer:function(){return this._container
},setWinId:function(id){if(typeof id==="string")id=parseInt(id);this._winId=id},getWinId:function(){
if(this.formulabar&&this.formulabar.hasFocus())return 0;return this._winId},editorHasFocus:function(
){return this.getWinId()===0&&!this.calcInputBarHasFocus()},calcInputBarHasFocus:function(){
return this.formulabar&&this.formulabar.hasFocus()},getZoomScale:function(toZoom,fromZoom){
var crs=this.options.crs;fromZoom=fromZoom===undefined?this.getZoom():fromZoom;return crs.scale(
toZoom)/crs.scale(fromZoom)},getScaleZoom:function(scale,fromZoom){
fromZoom=fromZoom===undefined?this.getZoom():fromZoom;return fromZoom+Math.log(scale)/Math.log(1.2)
},project:function(latlng,zoom){zoom=zoom===undefined?this.getZoom():zoom;
var projectedPoint=this.options.crs.latLngToPoint(window.L.latLng(latlng),zoom);
return new cool.Point(app.util.round(projectedPoint.x,1e-6),app.util.round(projectedPoint.y,1e-6))},
unproject:function(point,zoom){zoom=zoom===undefined?this.getZoom():zoom;
return this.options.crs.pointToLatLng(new cool.Point(point.x,point.y),zoom)},rescale:function(point,
oldZoom,newZoom){oldZoom=oldZoom===undefined?this.getZoom():oldZoom;
newZoom=newZoom===undefined?this.getZoom():newZoom;return this.options.crs.rescale(point,oldZoom,
newZoom)},layerPointToLatLng:function(point){var projectedPoint=cool.Point.toPoint(point).add(
this.getPixelOrigin());return this.unproject(projectedPoint)},latLngToLayerPoint:function(latlng){
var projectedPoint=this.project(window.L.latLng(latlng))._round();return projectedPoint._subtract(
this.getPixelOrigin())},distance:function(latlng1,latlng2){return this.options.crs.distance(
window.L.latLng(latlng1),window.L.latLng(latlng2))},containerPointToLayerPoint:function(point){
var splitPanesContext=this.getSplitPanesContext();if(!splitPanesContext){
return this.containerPointToLayerPointIgnoreSplits(point)}
var splitPos=splitPanesContext.getSplitPos();var pixelOrigin=this.getPixelOrigin();
var mapPanePos=this._getMapPanePos();var result=cool.Point.toPoint(point).clone();var pointX=point.x
if(this._docLayer.isCalcRTL()){pointX=this._container.clientWidth-pointX;result.x=pointX}if(
pointX<=splitPos.x){result.x-=pixelOrigin.x}else{result.x-=mapPanePos.x}if(point.y<=splitPos.y){
result.y-=pixelOrigin.y}else{result.y-=mapPanePos.y}return result},
containerPointToLayerPointIgnoreSplits:function(point){return cool.Point.toPoint(point).subtract(
this._getMapPanePos())},layerPointToContainerPoint:function(point){
var splitPanesContext=this.getSplitPanesContext();if(!splitPanesContext){
return this.layerPointToContainerPointIgnoreSplits(point)}
var splitPos=splitPanesContext.getSplitPos();var pixelOrigin=this.getPixelOrigin();
var mapPanePos=this._getMapPanePos();var result=cool.Point.toPoint(point).add(pixelOrigin);if(
result.x>splitPos.x){result.x-=pixelOrigin.x-mapPanePos.x}if(result.y>splitPos.y){
result.y-=pixelOrigin.y-mapPanePos.y}return result},layerPointToContainerPointIgnoreSplits:function(
point){return cool.Point.toPoint(point).add(this._getMapPanePos())},
containerPointToLatLngIgnoreSplits:function(point){
var layerPoint=this.containerPointToLayerPointIgnoreSplits(cool.Point.toPoint(point));
return this.layerPointToLatLng(layerPoint)},latLngToContainerPointIgnoreSplits:function(latlng){
return this.layerPointToContainerPointIgnoreSplits(this.latLngToLayerPoint(window.L.latLng(latlng)))
},latLngToContainerPoint:function(latlng){return this.layerPointToContainerPoint(
this.latLngToLayerPoint(window.L.latLng(latlng)))},mouseEventToContainerPoint:function(e){
return window.L.DomEvent.getMousePosition(e,this._container)},mouseEventToLayerPoint:function(e){
return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},
mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},
focus:function(acceptInput){if(this._textInput)this._textInput.focus(acceptInput)},
setAcceptInput:function(acceptInput){this._textInput._setAcceptInput(acceptInput)},blur:function(){
this._textInput.blur()},hasFocus:function(){
return this._textInput&&document.activeElement===this._textInput.activeElement()},
canAcceptKeyboardInput:function(){return this._textInput.canAcceptKeyboardInput()},
isSearching:function(){return this._isSearching},_fireInitComplete:function(condition){if(
this.initComplete){return}this.initConditions[condition]=true;for(var key in this.initConditions){
if(!this.initConditions[key]){return}}this.fire("statusindicator",{
statusType:"initializationcomplete"});this.initComplete=true;window.L.DomUtil.addClass(
this._container,"initialized")},_initContainer:function(id){
var container=this._container=window.L.DomUtil.get(id);window.L.DomUtil.removeClass(this._container,
"initialized");if(!container){throw new Error("Map container not found.")}else if(container._leaflet
){throw new Error("Map container is already initialized.")}
this._fileDownloader=window.L.DomUtil.create("iframe","",container);window.L.DomUtil.setStyle(
this._fileDownloader,"display","none");window.L.DomEvent.on(this._fileDownloader.contentWindow,
"contextmenu",window.L.DomEvent.preventDefault);window.L.DomEvent.addListener(container,"scroll",
this._onScroll,this);container._leaflet=true},_onScroll:function(){this._container.scrollTop=0;
this._container.scrollLeft=0},_initLayout:function(){var container=this._container;
this._fadeAnimated=this.options.fadeAnimation&&window.L.Browser.any3d;window.L.DomUtil.addClass(
container,"leaflet-container"+(window.touch.hasAnyTouchscreen()?" leaflet-touch":"")+(
window.L.Browser.retina?" leaflet-retina":"")+(window.L.Browser.safari?" leaflet-safari":"")+(
this._fadeAnimated?" leaflet-fade-anim":""));var position=window.L.DomUtil.getStyle(container,
"position");if(position!=="absolute"&&position!=="relative"&&position!=="fixed"){
container.style.position="absolute"}this._initPanes();if(this._initControlPos){this._initControlPos(
)}},_initPanes:function(){var panes=this._panes={};this._paneRenderers={};
this._mapPane=this.createPane("mapPane",this._container);this.createPane("shadowPane");
this.createPane("overlayPane");this.createPane("markerPane");this.createPane("formfieldPane");if(
!this.options.markerZoomAnimation){window.L.DomUtil.addClass(panes.markerPane,"leaflet-zoom-hide");
window.L.DomUtil.addClass(panes.shadowPane,"leaflet-zoom-hide")}},_resetView:function(center,zoom,
preserveMapOffset,afterZoomAnim){var zoomChanged=this._zoom!==zoom;if(!afterZoomAnim){this.fire(
"movestart");if(zoomChanged){this.fire("zoomstart")}}this._zoom=zoom;if(!preserveMapOffset){
window.L.DomUtil.setPosition(this._mapPane,new cool.Point(0,0))}
this._pixelOrigin=this._getNewPixelOrigin(center);var loading=!this._loaded;this._loaded=true;
this.fire("viewreset",{hard:!preserveMapOffset});if(loading){this.fire("load")}this.fire("move");if(
zoomChanged||afterZoomAnim){this.fire("zoomend");this.fire("zoomlevelschange")}
var backupFollowed=app.getFollowedViewId();this.fire("moveend",{hard:!preserveMapOffset});
app.setFollowingUser(backupFollowed)},_getZoomSpan:function(){return this.getMaxZoom(
)-this.getMinZoom()},_checkIfLoaded:function(){if(!this._loaded){throw new Error(
"Set map center and zoom first.")}},_mainEvents:function(onOff){window.L.DomEvent[onOff](
this._container,
"click dblclick mousedown mouseup "+"mouseover mouseout mousemove dragover drop "+"trplclick qdrplclick"
,window.touch.mouseOnly(this._handleDOMEvent),this)},_initEvents:function(remove){if(
!window.L.DomEvent){return}this._targets={};this._mouseOut=false;var onOff=remove?"off":"on";
this._mainEvents(onOff);window.L.DomEvent[onOff](window,"blur",this._onLostFocus,this);
window.L.DomEvent[onOff](window,"focus",this._onGotFocus,this)},showCalcInputBar:function(){if(
this.formulabar)this.formulabar.showFormulabar()},_changeFocusWidget:function(dialog,winId,
acceptInput){if(!this._loaded){return}this.setWinId(winId);this._activeDialog=dialog;
this._isSearching=false;if(this.editorHasFocus()){var doclayer=this._docLayer;if(doclayer
)doclayer._updateCursorAndOverlay()}else if(acceptInput!==undefined){this.focus(acceptInput);
this._textInput.hideCursor()}},_onLostFocus:function(){
window.prefs.sendPendingBrowserSettingsUpdate();if(!JSDialog.isDnDActive()
)app.idleHandler._deactivate()},_onEditorGotFocus:function(){this._changeFocusWidget(null,0);if(
this.formulabar)this.onFormulaBarBlur()},_onGotFocus:function(){if(this.editorHasFocus()){this.fire(
"editorgotfocus")}else if(this._activeDialog){this._activeDialog.focus(this.getWinId())}
app.idleHandler._activate();if(app.definitions.CommentSection.needFocus){
app.definitions.CommentSection.needFocus.focus();app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name).select(app.needFocus);app.definitions.CommentSection.needFocus=null}
},_onChangeFocusWidget:function(e){if(e.winId===0){this._onEditorGotFocus()}else{
this._changeFocusWidget(e.dialog,e.winId,e.acceptInput)}},_onSearchStart:function(){
this._isSearching=true},_onUpdateProgress:function(e){if(e.background){switch(e.statusType){
case"start":this.uiManager.documentNameInput.showProgressBar();if(this.saveState
)this.saveState.showSavingStatus();break;case"setvalue":
this.uiManager.documentNameInput.setProgressBarValue(e.value);break;case"finish":
this.uiManager.documentNameInput.hideProgressBar();if(this.saveState)this.saveState.showSavedStatus(
);break}}else{switch(e.statusType){case"start":this.showBusy(e.text?e.text:_("Please wait!"));if(
e.forceid)this._progressBar.forceid=e.forceid;break;case"setvalue":this._progressBar.setBar(true);
this._progressBar.setValue(e.value);break;case"finish":case"coolloaded":case"reconnected":if(
this._progressBar.forceid!==e.forceid)return;this.hideBusy();this._progressBar.forceid=undefined;
break}}},_isMouseEnteringLeaving:function(e){var target=e.target||e.srcElement,
related=e.relatedTarget;if(!target){return false}return(
target.id==="map"||target.classList.contains("leaflet-layer"))&&!(related&&(
window.L.DomUtil.hasClass(related,"leaflet-tile")||window.L.DomUtil.hasClass(related,
"leaflet-cursor")))},_handleDOMEvent:function(e){app.idleHandler.notifyActive();if(
!this._docLayer||!this._loaded||!this._enabled||window.L.DomEvent._skipped(e)){return}
var target=this._targets[app.util.stamp(e.target||e.srcElement)],type=e.type;if(
type==="click"||type==="dblclick"){if(this.isEditMode()){this.fire("editorgotfocus");this.focus()}
if(app.sectionContainer.doesSectionExist(app.CSections.CommentList.name)){
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).unselect()}}
this._mouseEnteringLeaving=false;if(!target&&!this._mouseOut&&type==="mouseout"){
this._mouseEnteringLeaving=this._isMouseEnteringLeaving(e);this._mouseOut=this._mouseEnteringLeaving
}if(!target&&this._mouseOut&&type==="mouseover"){
this._mouseEnteringLeaving=this._isMouseEnteringLeaving(e);
this._mouseOut=!this._mouseEnteringLeaving}if(!target&&!this._mouseEnteringLeaving&&(
type==="mouseover"||type==="mouseout")&&!window.L.DomEvent._checkMouse(this._container,e)){return}
if(type==="mousedown"){window.L.DomUtil.preventOutline(e.target||e.srcElement);e.preventDefault()}
if(target!==undefined&&target._path!==undefined&&type==="mousemove"){target=undefined}
this._fireDOMEvent(target||this,e,type)},_fireDOMEvent:function(target,e,type){if(
this.uiManager.isUIBlocked())return;if(!target.listens(type,true)&&(type!=="click"||!target.listens(
"preclick",true))){return}if(type==="contextmenu"){window.L.DomEvent.preventDefault(e)}if(
e.type==="click"&&!e._simulated&&this._draggableMoved(target)){return}var data={originalEvent:e};if(
e.type!=="keypress"&&e.type!=="keyup"&&e.type!=="keydown"&&e.type!=="copy"&&e.type!=="cut"&&e.type!=="paste"&&e.type!=="compositionstart"&&e.type!=="compositionupdate"&&e.type!=="compositionend"&&e.type!=="textInput"
){data.containerPoint=target instanceof window.L.Marker?this.latLngToContainerPoint(
target.getLatLng()):this.mouseEventToContainerPoint(e);
data.layerPoint=this.containerPointToLayerPoint(data.containerPoint);
data.latlng=this.layerPointToLatLng(data.layerPoint)}if(type==="click"){target.fire("preclick",data,
true)}target.fire(type,data,true)},_draggableMoved:function(obj){obj=obj.options.draggable?obj:this;
return obj.dragging&&obj.dragging.moved()},_clearHandlers:function(){for(var i=0,
len=this._handlers.length;i<len;i++){this._handlers[i].disable()}},whenReady:function(callback,
context){if(this._loaded){callback.call(context||this,{target:this})}else{this.on("load",callback,
context)}return this},_getMapPanePos:function(){return window.L.DomUtil.getPosition(this._mapPane
)||new cool.Point(0,0)},_getTopLeftPoint:function(center,zoom){
var pixelOrigin=center&&zoom!==undefined?this._getNewPixelOrigin(center,zoom):this.getPixelOrigin();
return pixelOrigin.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(center,zoom){
var viewHalf=this.getSize()._divideBy(2);return this.project(center,zoom)._subtract(viewHalf)._add(
this._getMapPanePos())._floor()},_getCenterLayerPoint:function(){
return this.containerPointToLayerPointIgnoreSplits(this.getSize()._divideBy(2))},
_getCenterOffset:function(latlng){return this.latLngToLayerPoint(latlng).subtract(
this._getCenterLayerPoint())},_limitCenter:function(center,zoom,bounds){if(!bounds){return center}
var centerPoint=this.project(center,zoom),viewHalf=this.getSize().divideBy(2),
viewBounds=new cool.Bounds(centerPoint.subtract(viewHalf),centerPoint.add(viewHalf)),
offset=this._getBoundsOffset(viewBounds,bounds,zoom);return this.unproject(centerPoint.add(offset),
zoom)},_getBoundsOffset:function(pxBounds,maxBounds,zoom){var nwOffset=this.project(
maxBounds.getNorthWest(),zoom).subtract(pxBounds.min),seOffset=this.project(maxBounds.getSouthEast()
,zoom).subtract(pxBounds.max),dx=this._rebound(nwOffset.x,-seOffset.x),dy=this._rebound(nwOffset.y,
-seOffset.y);return new cool.Point(dx,dy)},_rebound:function(left,right){
return left+right>0?Math.round(left-right)/2:Math.max(0,Math.ceil(left))-Math.max(0,Math.floor(right
))},_limitZoom:function(zoom){var min=this.getMinZoom(),max=this.getMaxZoom();return Math.max(min,
Math.min(max,zoom))},_goToViewId:function(id){if(id===-1)return;if(this.getDocType()==="spreadsheet"
){this._docLayer.goToCellViewCursor(id)}else if(this.getDocType()==="text"||this.getDocType(
)==="presentation"){this._docLayer.goToViewCursor(id)}},_setFollowing:function(followingState,viewId
,instantJump){var userDefined=viewId!==null&&viewId!==undefined;
var followDefined=followingState!==null&&followingState!==undefined;var followEditor=true;
var followUser=false;if(userDefined&&viewId!==-1){followUser=true;followEditor=false}if(
followDefined&&followingState===false){followEditor=false;followUser=false}if(followUser){if(
instantJump)this._goToViewId(viewId);app.setFollowingUser(viewId)}else if(followEditor){
var editorId=this._docLayer._editorId;if(editorId!==-1&&editorId!==this._docLayer.viewId){if(
instantJump)this._goToViewId(editorId);app.setFollowingEditor(editorId)}}else{this.fire(
"deselectuser",{viewId:app.getFollowedViewId()});app.setFollowingOff()}this.fire("postMessage",{
msgId:"FollowUser_Changed",args:{FollowedViewId:app.getFollowedViewId(),IsFollowUser:followUser,
IsFollowEditor:followEditor}})},getSplitPanesContext:function(){var docLayer=this._docLayer;if(
docLayer){return docLayer.getSplitPanesContext()}return undefined},_setPaneOpacity:function(
paneClassString,opacity){var panes=document.getElementsByClassName(paneClassString);if(panes.length
)panes[0].style.opacity=opacity},setOverlaysOpacity:function(opacity){this._setPaneOpacity(
"leaflet-pane leaflet-overlay-pane",opacity)},setMarkersOpacity:function(opacity){
this._setPaneOpacity("leaflet-pane leaflet-marker-pane",opacity)},getTileSectionMgr:function(){if(
this._docLayer)return this._docLayer._painter;return undefined},getCursorOverlayContainer:function(
){if(this._docLayer)return this._docLayer._cursorOverlayDiv;return undefined}});
window.L.map=function(id,options){return new window.L.Map(id,options)};
app.idleHandlerId="inactive_user_message";var IdleHandler=function(){function IdleHandler(){
this._serverRecycling=false;this._documentIdle=false;this._lastActivity=Date.now();
this._inactivityTimer=null;this._outOfFocusTimer=null;this._active=true;this.dimId=app.idleHandlerId
}IdleHandler.prototype.getIdleMessage=function(){if(this.map["wopi"]&&this.map["wopi"
].DisableInactiveMessages){return""}else if(window.mode.isDesktop()){return _(
"Idle document - please click to reload and resume editing")}else{return _(
"Idle document - please tap to reload and resume editing")}};
IdleHandler.prototype.isDimActive=function(){return!!document.getElementById(
this.map.uiManager.generateModalId(this.dimId))};
IdleHandler.prototype.getElapsedFromActivity=function(){return(Date.now()-this._lastActivity)/1e3};
IdleHandler.prototype.refreshAnnotations=function(){var docLayer=this.map._docLayer;if(
docLayer.isCalc()&&docLayer.options.sheetGeometryDataEnabled){docLayer.requestSheetGeometryData()}
app.socket.sendMessage("commandvalues command=.uno:ViewAnnotations")};
IdleHandler.prototype._activate=function(){window.app.console.debug("IdleHandler: _activate()");if(
this._serverRecycling||this._documentIdle){return false}this._startInactiveTimer();
this._stopOutOfFocusTimer();if(!this._active){if(app.socket.connected()){app.socket.sendMessage(
"useractive");this._active=true;if(this.map._docLayer){this.map._docLayer.allowDrawing();
this.refreshAnnotations()}else{this.map.once("doclayerinit",this.refreshAnnotations,this)}if(
this.isDimActive()){this.map.jsdialog.closeDialog(this.dimId,false);return true}}else{
this.map.loadDocument()}}if(window.mode.isDesktop()&&!this.map.uiManager.isAnyDialogOpen(
)&&!cool.Comment.isAnyEdit()&&(this.map.formulabar&&!this.map.formulabar.hasFocus())&&$(
"input:focus").length===0){this.map.focus()}return false};
IdleHandler.prototype._startInactiveTimer=function(){var _this=this;if(
this._serverRecycling||this._documentIdle||!this.map._docLoaded){return}clearTimeout(
this._inactivityTimer);this._inactivityTimer=setTimeout(function(){_this._dimIfInactive()},
window.L.Browser.cypressTest?1e3:1*60*1e3)};IdleHandler.prototype._startOutOfFocusTimer=function(){
var _this=this;if(this._serverRecycling||this._documentIdle||!this.map._docLoaded){return}
this._stopOutOfFocusTimer();this._outOfFocusTimer=setTimeout(function(){_this._dim()},
window.outOfFocusTimeoutSecs*1e3)};IdleHandler.prototype._stopOutOfFocusTimer=function(){
clearTimeout(this._outOfFocusTimer)};IdleHandler.prototype._dimIfInactive=function(){if(
this.map._docLoaded&&this.getElapsedFromActivity()>=window.idleTimeoutSecs){this._dim()}else{
this._startInactiveTimer()}};IdleHandler.prototype._dim=function(){var _this=this;if(
this.map.slideShowPresenter&&this.map.slideShowPresenter._checkAlreadyPresenting())return;
this.map.fire("closealldialogs");var message=this.getIdleMessage();window.app.console.debug(
"IdleHandler: _dim()");if(document.getElementById(this.dimId))return;this._active=false;
var map=this.map;var restartConnectionFn=function(){if(app.idleHandler._documentIdle){
window.app.console.debug("idleness: reactivating");map.fire("postMessage",{msgId:"User_Active"});
app.idleHandler._documentIdle=false;app.setCursorVisibility(true)}return app.idleHandler._activate()
};this.map._textInput.hideCursor();var uiManager=this.map.uiManager;
var dialogId=uiManager.generateModalId(this.dimId);uiManager.showInfoModal(this.dimId);
app.layoutingService.appendLayoutingTask(function(){var dimNode=document.getElementById(_this.dimId)
if(!dimNode)return;dimNode.textContent=message;var restartConnection=function(){restartConnectionFn(
)};if(message===""){var dialogNode=document.getElementById(dialogId);if(dialogNode
)dialogNode.style.display="none";app.LOUtil.onRemoveHTMLElement(dimNode,restartConnection)}else{
var overlayId=dialogId+"-overlay";var overlay=document.getElementById(overlayId);if(overlay
)overlay.onmouseover=function(){restartConnection();uiManager.closeModal(dialogId)};
app.LOUtil.onRemoveHTMLElement(overlay,restartConnection)}});this._sendInactiveMessage();
TileManager.clearPreFetch()};IdleHandler.prototype.notifyActive=function(){
this._lastActivity=Date.now();if(window.ThisIsTheAndroidApp){window.postMobileMessage("LIGHT_SCREEN"
)}};IdleHandler.prototype._sendInactiveMessage=function(){
this.map._doclayer&&this.map._docLayer._onMessage("textselection:",null);this.map.fire("postMessage"
,{msgId:"User_Idle"});if(app.socket.connected()){app.socket.sendMessage("userinactive")}};
IdleHandler.prototype._deactivate=function(){window.app.console.debug("IdleHandler: _deactivate()");
if(this._serverRecycling||this._documentIdle||!this.map._docLoaded){return}if(window.mode.isDesktop(
)&&(!this._active||this.isDimActive())){this._active=false;this._sendInactiveMessage();return}if(
app.map&&app.map.formulabar&&(app.map.formulabar.hasFocus()||app.map.formulabar.isInEditMode())
)app.dispatcher.dispatch("acceptformula");this._startOutOfFocusTimer()};return IdleHandler}();
app.idleHandler=new IdleHandler;window.L.Clipboard=window.L.Class.extend({initialize:function(map){
this._map=map;this._selectionContent="";this._selectionPlainTextContent="";this._selectionType=null;
this._accessKey=["",""];this._clipboardSerial=0;this._failedTimer=null;
this._dummyDivName="copy-paste-container";this._unoCommandForCopyCutPaste=null;
this._navigatorClipboardPasteSpecial=false;var div=document.createElement("div");this._dummyDiv=div;
this._dummyPlainDiv=null;this._dummyClipboard={};this._commandCompletion=[];this._map.on(
"commandresult",this._onCommandResult,this);this._map.on("clipboardchanged",this._onCommandResult,
this);div.setAttribute("id",this._dummyDivName);div.style.userSelect="text !important";
div.style.opacity="0";div.setAttribute("contenteditable","true");div.setAttribute("type","text");
div.style.position="fixed";div.style.left="0px";div.style.top="-200px";div.style.width="15000px";
div.style.height="200px";div.style.overflow="hidden";div.style.zIndex="-1000";div.style[
"-webkit-user-select"]="text !important";div.style.display="block";div.style.fontSize="6pt";
var parent=document.getElementById("map");parent.appendChild(div);if(window.L.Browser.cypressTest){
this._dummyPlainDiv=document.createElement("div");this._dummyPlainDiv.id="copy-plain-container";
this._dummyPlainDiv.style="position: fixed; left: 0px; top: -400px; width: 15000px; height: 200px; "+"overflow: hidden; z-index: -1000; -webkit-user-select: text !important; display: block; "+"font-size: 6pt"
parent.appendChild(this._dummyPlainDiv)}this._resetDiv();var that=this;var beforeSelect=function(ev
){return that._beforeSelect(ev)};document.oncut=function(ev){return that.cut(ev)};
document.oncopy=function(ev){return that.copy(ev)};document.onpaste=function(ev){return that.paste(
ev)};document.onbeforecut=beforeSelect;document.onbeforecopy=beforeSelect;
document.onbeforepaste=beforeSelect},isHtmlImage:function(html){const startsWithMeta=html.substring(
0,5)=="<meta";if(startsWithMeta){const metaEnd=html.indexOf(">");if(metaEnd!=-1){
html=html.substring(metaEnd+1)}}if(html.substring(0,4)==="<img"){return true}return false},
setKey:function(key){if(this._accessKey[0]===key)return;this._accessKey[1]=this._accessKey[0];
this._accessKey[0]=key},getMetaBase:function(){if(window.ThisIsAMobileApp){
return"f7-office-mobile"}return window.makeHttpUrl("")},getMetaPath:function(idx){if(!idx
)idx=0;if(this._accessKey[idx]==="")return"";
var metaPath="/cool/clipboard?WOPISrc="+encodeURIComponent(this._map.options.doc
)+"&ServerId="+app.socket.WSDServer.Id+"&ViewId="+this._map._docLayer._viewId+"&Tag="+this._accessKey[
idx];if(window.routeToken!=="")metaPath+="&RouteToken="+window.routeToken;return metaPath},
getMetaURL:function(idx){return this.getMetaBase()+this.getMetaPath(idx)},
_getHtmlStubMarker:function(){return"<title>Stub HTML Message</title>"},_isStubHtml:function(text){
return text.indexOf(this._getHtmlStubMarker())>0},_originWrapBody:function(body,isStub){
var lang="en_US";var encodedOrigin=encodeURIComponent(this.getMetaURL());
var text='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">\n'+"<html>\n"+"  <head>\n";
if(isStub)text+="    "+this._getHtmlStubMarker()+"\n";
text+='    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>\n'+"  </head>\n"+'  <body lang="'+lang+'" dir="ltr"><div id="meta-origin" data-coolorigin="'+encodedOrigin+'">\n'+body+"  </div></body>\n"+"</html>"
return text},_getStubHtml:function(){return this._substProductName(this._originWrapBody("    <p>"+_(
"To paste outside {productname}, please first click the 'download' button")+"</p>\n",true))},
_getDisabledCopyStubHtml:function(){return this._substProductName(this._originWrapBody("    <p>"+_(
"Copying from the document disabled")+"</p>\n",true))},_getMetaOrigin:function(html,prefix){
var start=html.indexOf(prefix);if(start<0){return""}var end=html.indexOf('"',start+prefix.length);
if(end<0){return""}var meta=html.substring(start+prefix.length,end);if(meta.indexOf(
"%2Fclipboard%3FWOPISrc%3D")>=0&&meta.indexOf("%26ServerId%3D")>0&&meta.indexOf("%26ViewId%3D"
)>0&&meta.indexOf("%26Tag%3D")>0)return decodeURIComponent(meta);else window.app.console.log(
'Mis-understood foreign origin: "'+meta+'"');return""},_encodeHtmlToBlob:function(text){
var content=[];var data=new Blob([text]);content.push("text/html\n");content.push(
data.size.toString(16)+"\n");content.push(data);content.push("\n");return new Blob(content)},
_readContentSyncToBlob:function(dataTransfer){var content=[];var types=dataTransfer.types;for(
var t=0;t<types.length;++t){if(types[t]==="Files")continue;var dataStr=dataTransfer.getData(types[t]
);if(!dataStr.length)continue;var data=new Blob([dataStr]);window.app.console.log("type "+types[t
]+" length "+data.size+" -> 0x"+data.size.toString(16)+"\n");content.push((types[t
]==="text"?"text/plain":types[t])+"\n");content.push(data.size.toString(16)+"\n");content.push(data)
content.push("\n")}if(content.length>0)return new Blob(content,{type:"application/octet-stream",
endings:"transparent"});else return null},_doAsyncDownload:async function(type,url,optionalFormData,
forClipboard,progressFn){var request=new XMLHttpRequest;if(
!this._downloadProgress||this._downloadProgress.isClosed()){this._startProgress(false);
this._downloadProgress.startProgressMode()}return await new Promise((resolve,reject)=>{
request.onload=()=>{this._downloadProgress._onComplete();if(!forClipboard){
this._downloadProgress._onClose()}if(request.status==200){resolve(request.response)}else{reject(
request.response)}};request.onerror=error=>{reject(error);this._downloadProgress._onComplete();
this._downloadProgress._onClose()};request.ontimeout=()=>{this._map.uiManager.showSnackbar(_(
"warning: copy/paste request timed out"));this._downloadProgress._onClose();reject(
"request timed out")};request.upload.addEventListener("progress",e=>{if(e.lengthComputable){
var percent=progressFn(e.loaded/e.total*100);var progress={statusType:"setvalue",value:percent};
this._downloadProgress._onUpdateProgress(progress)}},false);if("processCoolUrl"in window){
url=window.processCoolUrl({url:url,type:"clipboard"})}request.open(type,url,true);
request.timeout=30*1e3;request.responseType="blob";if(optionalFormData!==null)request.send(
optionalFormData);else request.send()})},_dataTransferDownloadAndPasteAsync:async function(src,
fallbackHtml){let response;try{response=await this._doAsyncDownload("GET",src,null,false,function(
progress){return progress/2})}catch(_error){window.app.console.log(
"failed to download clipboard using fallback html");if(this._isStubHtml(fallbackHtml)){
this._map.uiManager.showInfoModal("data transfer warning","",_(
"Failed to download clipboard, please re-copy"));return}var formData=new FormData;
let commandName=null;if(this._checkAndDisablePasteSpecial()){commandName=".uno:PasteSpecial"}else{
commandName=".uno:Paste"}const data=JSON.stringify({url:src,commandName:commandName});
formData.append("data",new Blob([data]),"clipboard");try{await this._doAsyncDownload("POST",
this.getMetaURL(),formData,false,function(progress){return 50+progress/2})}catch(_error){
await this.dataTransferToDocumentFallback(null,fallbackHtml)}return}window.app.console.log(
"download done - response "+response);var formData=new FormData;formData.append("data",response,
"clipboard");await this._doAsyncDownload("POST",this.getMetaURL(),formData,false,function(progress){
return 50+progress/2});if(this._checkAndDisablePasteSpecial()){window.app.console.log(
"up-load done, now paste special");app.socket.sendMessage("uno .uno:PasteSpecial")}else{
window.app.console.log("up-load done, now paste");app.socket.sendMessage("uno .uno:Paste")}},
_onImageLoadFunc:function(file){var that=this;return function(e){that._pasteTypedBlob(file.type,
e.target.result)}},_pasteTypedBlob:function(fileType,fileBlob){var blob=new Blob([
"paste mimetype="+fileType+"\n",fileBlob]);app.socket.sendMessage(blob)},
_asyncReadPasteFile:function(file){if(file.type.match(/image.*/)){return this._asyncReadPasteImage(
file)}if(file.type.match(/audio.*/)||file.type.match(/video.*/)){return this._asyncReadPasteAVMedia(
file)}return false},_asyncReadPasteImage:function(file){var reader=new FileReader;
reader.onload=this._onImageLoadFunc(file);reader.readAsArrayBuffer(file);return true},
_asyncReadPasteAVMedia:function(file){this._map.insertMultimedia(file);return true},
dataTransferToDocument:function(dataTransfer,preferInternal,htmlText,usePasteKeyEvent){
var meta=this._getMetaOrigin(htmlText,'<div id="meta-origin" data-coolorigin="');
var id=this.getMetaPath(0);var idOld=this.getMetaPath(1);if(preferInternal===true&&(
id!==""&&meta.indexOf(id)>=0||idOld!==""&&meta.indexOf(idOld)>=0)){window.app.console.log(
"short-circuit, internal paste");this._doInternalPaste(this._map,usePasteKeyEvent);return true}if(
meta!==""){window.app.console.log('Transfer between servers\n\t"'+meta+'" vs. \n\t"'+id+'"');
this._dataTransferDownloadAndPasteAsync(meta,htmlText);return false}
this.dataTransferToDocumentFallback(dataTransfer,htmlText,usePasteKeyEvent);return true},
_sendToInternalClipboard:async function(content){if(window.ThisIsTheiOSApp){
await window.webkit.messageHandlers.clipboard.postMessage(`sendToInternal ${await content.text()}`)
}else{var formData=new FormData;formData.append("file",content);return await this._doAsyncDownload(
"POST",this.getMetaURL(),formData,false,function(progress){return progress})}},
dataTransferToDocumentFallback:async function(dataTransfer,htmlText,usePasteKeyEvent){var content;
if(dataTransfer){content=this._readContentSyncToBlob(dataTransfer)}if(!content&&htmlText!=""){
content=this._encodeHtmlToBlob(htmlText)}if((content==null&&htmlText===""||this.isHtmlImage(htmlText
))&&dataTransfer!=null){var types=dataTransfer.types;window.app.console.log(
"Attempting to paste image(s)");for(var t=0;t<types.length;++t){window.app.console.log(
"\ttype"+types[t]);if(types[t]==="Files"){var files=dataTransfer.files;if(files!==null){for(
var f=0;f<files.length;++f)this._asyncReadPasteFile(files[f])}else this._asyncReadPasteFile(
dataTransfer.items[t].getAsFile())}}this._checkAndDisablePasteSpecial();return}if(content==null){
window.app.console.log("Nothing we can paste on the clipboard");return}window.app.console.log(
"Normal HTML, so smart paste not possible");await this._sendToInternalClipboard(content);
window.app.console.log("clipboard: Sent "+content.size+" bytes successfully");this._doInternalPaste(
this._map,usePasteKeyEvent)},_checkSelection:function(){var checkSelect=document.getSelection();if(
checkSelect&&checkSelect.isCollapsed)window.app.console.log(
"Error: collapsed selection - cannot copy/paste")},_getHtmlForClipboard:function(){var text;if(
this._selectionType==="complex"||GraphicSelection.hasActiveSelection()){window.app.console.log(
"Copy/Cut with complex/graphical selection");if(
this._selectionType==="text"&&this._selectionContent!==""){text=this._selectionContent;
window.app.console.log("Use downloaded selection.")}else{window.app.console.log(
"Downloaded that selection.");text=this._getStubHtml();this._onDownloadOnLargeCopyPaste();
this._downloadProgress.setURI(this.getMetaURL()+"&MimeType=text/html,text/plain;charset=utf-8")}
}else if(this._selectionType===null){window.app.console.log("Copy/Cut with no selection!");
text=this._getStubHtml()}else{window.app.console.log("Copy/Cut with simple text selection");
text=this._selectionContent}return text},populateClipboard:function(ev){
var text=this._getHtmlForClipboard();var plainText=DocUtil.stripHTML(text);if(
text==this._selectionContent&&this._selectionPlainTextContent!=""){
plainText=this._selectionPlainTextContent}if(ev.clipboardData){if(
this._unoCommandForCopyCutPaste===".uno:CopyHyperlinkLocation"){var ess="s";var re=new RegExp(
'^(.*)(<a href=")([^"]+)(">.*</a>)(</p>\n</body>\n</html>)$',ess);var match=re.exec(text);if(
match!==null&&match.length===6){text=match[1]+match[3]+match[5];plainText=DocUtil.stripHTML(text)}}
ev.clipboardData.setData("text/plain",plainText?plainText:" ");ev.clipboardData.setData("text/html",
text);window.app.console.log('Put "'+text+'" on the clipboard');this._clipboardSerial++}},
_isAnyInputFieldSelected:function(forCopy=false){if($("#search-input").is(":focus"))return true;if(
$(".ui-edit").is(":focus"))return true;if($(".ui-textarea").is(":focus"))return true;if($(
"input.ui-combobox-content").is(":focus"))return true;if(this._map.uiManager.isAnyDialogOpen(
)&&!this.isCopyPasteDialogReadyForCopy()&&!this.isPasteSpecialDialogOpen())return true;if(
cool.Comment.isAnyFocus())return true;if(forCopy){let selection=window.getSelection();
selection=selection&&selection.toString();if(selection&&selection.length!==0)return true}
return false},_isFormulabarSelected:function(){if($("#sc_input_window").is(":focus"))return true;
return false},_beforeSelect:function(ev){window.app.console.log(
"Got event "+ev.type+" setting up selection");if(this._isAnyInputFieldSelected(
ev.type==="beforecopy"))return;this._beforeSelectImpl()},_beforeSelectImpl:function(){if(
this._selectionType==="slide")return;this._resetDiv();var sel=document.getSelection();if(!sel)return
var selected=false;var selectRange;if(!selected){sel.removeAllRanges();
selectRange=document.createRange();selectRange.selectNodeContents(this._dummyDiv);sel.addRange(
selectRange);var checkSelect=document.getSelection();if(checkSelect.isCollapsed
)window.app.console.log("Error: failed to select - cannot copy/paste")}return false},
_resetDiv:function(){this._dummyDiv.replaceChildren();let bElement=document.createElement("b");
bElement.style.fontWeight="normal";bElement.style.backgroundColor="transparent";
bElement.style.color="transparent";let span=document.createElement("span");span.textContent="  ";
bElement.appendChild(span);this._dummyDiv.appendChild(bElement)},_execOnElement:function(operation){
var serial=this._clipboardSerial;this._resetDiv();var success=false;var active=null;
active=document.activeElement;success=document.execCommand(operation
)&&serial!==this._clipboardSerial;if(active!==null&&active!==document.activeElement)active.focus();
window.app.console.log("fallback "+operation+" "+(success?"success":"fail"));return success},
_execCopyCutPaste:function(operation,cmd,params){var serial=this._clipboardSerial;
this._unoCommandForCopyCutPaste=cmd;if(
operation!=="paste"&&cmd!==undefined&&this._navigatorClipboardWrite(params)){return}if(
!window.ThisIsTheiOSApp&&document.execCommand(operation)&&serial!==this._clipboardSerial){
window.app.console.log("copied successfully");this._unoCommandForCopyCutPaste=null;return}if(
operation=="paste"&&this._navigatorClipboardRead(false)){return}this._afterCopyCutPaste(operation)},
_afterCopyCutPaste:function(operation){var serial=this._clipboardSerial;
this._unoCommandForCopyCutPaste=null;if(this._execOnElement(operation)){window.app.console.log(
"copied on element successfully");return}if(operation==="paste"){try{window.app.console.warn(
"Asked parent for a paste event");this._map.fire("postMessage",{msgId:"UI_Paste"})}catch(error){
window.app.console.warn("Failed to post-message: "+error)}}var that=this;clearTimeout(
this._failedTimer);setTimeout(function(){if(that._clipboardSerial!==serial){window.app.console.log(
"successful "+operation);if(operation==="paste")that._stopHideDownload()}else{
window.app.console.log("help did not arrive for "+operation);that._warnCopyPaste()}},150)},
_navigatorClipboardGetTypeCallback:async function(clipboardContent,blob,type){if(type=="image/png"){
this._pasteTypedBlob(type,blob);return}let text;try{text=await blob.text()}catch(error){
window.app.console.log("blob.text() failed: "+error.message);return}if(
type!=="text/html"||!this.isHtmlImage(text)){this._navigatorClipboardTextCallback(text,type);return}
let image;try{image=await clipboardContent.getType("image/png")}catch(error){window.app.console.log(
"clipboardContent.getType(image/png) failed: "+error.message);return}
this._navigatorClipboardGetTypeCallback(clipboardContent,image,"image/png")},
_navigatorClipboardTextCallback:function(text,textType){var ev={clipboardData:{getData:function(type
){if(type===textType){return text}return""},types:[textType]},preventDefault:function(){}};
this.paste(ev)},_onCommandResult:function(e){if(
e.commandName===".uno:Copy"||e.commandName===".uno:Cut"||e.commandName===".uno:CopyHyperlinkLocation"||e.commandName===".uno:CopySlide"
){window.app.console.log("Resolve clipboard command promise "+e.commandName);while(
this._commandCompletion.length>0){let a=this._commandCompletion.shift();a.resolve()}}},
_sendCommandAndWaitForCompletion:function(command,params){if(
command!==".uno:Copy"&&command!==".uno:Cut"&&command!==".uno:CopyHyperlinkLocation"&&command!==".uno:CopySlide"
){console.error(
`_sendCommandAndWaitForCompletion was called with '${command}', but anything except Copy or Cut will never complete`
);return null}if(this._commandCompletion.length>0){console.warn(
"Already have "+this._commandCompletion.length+" pending clipboard command(s)");return null}if(
!params)app.socket.sendMessage("uno "+command);else app.map.sendUnoCommand(command,params);
return new Promise((resolve,reject)=>{window.app.console.log("New "+command+" promise");
this._commandCompletion.push({resolve:resolve,reject:reject})})},
_parseClipboardFetchResult:async function(text,mimetype,shorttype){
const content=this.parseClipboard(await text)[shorttype];const blob=new Blob([content],{
type:mimetype});console.log("Generate blob of type "+mimetype+" from "+shorttype+" text: "+content);
return blob},_navigatorClipboardWrite:function(params){if(
!window.L.Browser.clipboardApiAvailable&&!window.ThisIsTheiOSApp){return false}if(
this._selectionType!=="text"&&this._selectionType!=="slide"){return false}
this._asyncAttemptNavigatorClipboardWrite(params);return true},
_asyncAttemptNavigatorClipboardWrite:async function(params){
const command=this._unoCommandForCopyCutPaste;const check_=this._sendCommandAndWaitForCompletion(
command,params);if(window.ThisIsTheiOSApp){if(await check_===null)return;
await window.webkit.messageHandlers.clipboard.postMessage(`write`)}else{const url=this.getMetaURL(
)+"&MimeType=text/html,text/plain;charset=utf-8";const text=(async()=>{if(await check_===null
)throw new Error("Failed check, either wrong command or pending event");const result=await fetch(url
);return await result.text()})();const clipboardItem=new ClipboardItem({
"text/html":this._parseClipboardFetchResult(text,"text/html","html"),
"text/plain":this._parseClipboardFetchResult(text,"text/plain","plain")});
let clipboard=navigator.clipboard;if(window.L.Browser.cypressTest){clipboard=this._dummyClipboard}
try{await clipboard.write([clipboardItem])}catch(error){if(!document.hasFocus()){
window.app.console.warn("navigator.clipboard.write() failed: "+error.message);return}if(
await check_===null){window.app.console.warn(
"navigator.clipboard.write() failed due to a failing check");return}window.app.console.error(
"navigator.clipboard.write() failed: "+error.message);this._warnCopyPaste();app.socket.sendMessage(
"gettextselection mimetype=text/html,text/plain;charset=utf-8")}}},parseClipboard:function(text){
let textHtml;let textPlain="";if(text.startsWith("{")){let textJson=JSON.parse(text);
textHtml=textJson["text/html"];textPlain=textJson["text/plain;charset=utf-8"]}else{
var idx=text.indexOf("<!DOCTYPE HTML");if(idx===-1){idx=text.indexOf("<!DOCTYPE html")}if(idx>0
)text=text.substring(idx,text.length);textHtml=text}if(!app.sectionContainer.testing
)textHtml=DocUtil.stripStyle(textHtml);return{html:textHtml,plain:textPlain}},
_navigatorClipboardRead:function(isSpecial){if(
!window.L.Browser.clipboardApiAvailable&&!window.ThisIsTheiOSApp){return false}
this._asyncAttemptNavigatorClipboardRead(isSpecial);return true},_iOSReadClipboard:async function(){
const encodedClipboardData=await window.webkit.messageHandlers.clipboard.postMessage("read");if(
encodedClipboardData==="(internal)"){return null}const clipboardData=Array.from(
encodedClipboardData.split(" ")).map(encoded=>encoded==="(null)"?"":window.b64d(encoded));
const dataByMimeType={};if(clipboardData[0]){dataByMimeType["text/plain"]=new Blob([clipboardData[0]
])}if(clipboardData[1]){dataByMimeType["text/html"]=new Blob([clipboardData[1]])}if(Object.keys(
dataByMimeType).length===0){return[]}return[new ClipboardItem(dataByMimeType)]},
_asyncAttemptNavigatorClipboardRead:async function(isSpecial){var clipboard=navigator.clipboard;if(
window.L.Browser.cypressTest){clipboard=this._dummyClipboard}let clipboardContents;try{
clipboardContents=window.ThisIsTheiOSApp?await this._iOSReadClipboard():await clipboard.read();if(
clipboardContents===null){this._doInternalPaste(this._map,false);return}}catch(error){
window.app.console.log("navigator.clipboard.read() failed: "+error.message);if(isSpecial){
this._openPasteSpecialPopup()}else{this._afterCopyCutPaste("paste")}return}if(isSpecial){
this._navigatorClipboardPasteSpecial=true}if(clipboardContents.length<1){window.app.console.log(
"clipboard has no items");return}var clipboardContent=clipboardContents[0];if(
clipboardContent.types.includes("text/html")){let blob;try{blob=await clipboardContent.getType(
"text/html")}catch(error){window.app.console.log(
"clipboardContent.getType(text/html) failed: "+error.message);return}
this._navigatorClipboardGetTypeCallback(clipboardContent,blob,"text/html")}else if(
clipboardContent.types.includes("text/plain")){let blob;try{blob=await clipboardContent.getType(
"text/plain")}catch(error){window.app.console.log(
"clipboardContent.getType(text/plain) failed: "+error.message);return}
this._navigatorClipboardGetTypeCallback(clipboardContent,blob,"text/plain")}else{
window.app.console.log("navigator.clipboard has no text/html or text/plain");return}},
filterExecCopyPaste:function(cmd,params){if(this._map["wopi"].DisableCopy&&(
cmd===".uno:Copy"||cmd===".uno:Cut"||cmd===".uno:CopyHyperlinkLocation")){app.socket.sendMessage(
"uno "+cmd);return true}if(window.ThisIsTheAndroidApp){app.socket.sendMessage("uno "+cmd);
return true}if(cmd===".uno:Copy"||cmd===".uno:CopyHyperlinkLocation"||cmd===".uno:CopySlide"){
this._execCopyCutPaste("copy",cmd,params)}else if(cmd===".uno:Cut"){this._execCopyCutPaste("cut",cmd
)}else if(cmd===".uno:Paste"){this._execCopyCutPaste("paste",cmd)}else if(cmd===".uno:PasteSpecial"
){if(this._navigatorClipboardRead(true)){return true}this._openPasteSpecialPopup()}else{return false
}window.app.console.log("filtered uno command "+cmd);return true},_doCopyCut:function(ev,unoName){
if(this._selectionType==="slide")unoName="CopySlide";window.app.console.log(unoName);if(
this._isAnyInputFieldSelected(unoName==="Copy"))return;if(this._downloadProgressStatus(
)==="downloadButton")this._stopHideDownload();var preventDefault=true;if(this._map["wopi"
].DisableCopy===true){var text=this._getDisabledCopyStubHtml();var plainText=DocUtil.stripHTML(text)
if(ev.clipboardData){window.app.console.log("Copying disabled: put stub message on the clipboard");
ev.clipboardData.setData("text/plain",plainText?plainText:" ");ev.clipboardData.setData("text/html",
text);this._clipboardSerial++}}else{this._unoCommandForCopyCutPaste=`.uno:${unoName}`;
this._checkSelection();if(!this._navigatorClipboardWrite()){app.socket.sendMessage(
"uno .uno:"+unoName);this.populateClipboard(ev)}}if(ev.clipboardData&&unoName==="Cut"){
this._map._textInput._abortComposition(ev)}if(preventDefault){ev.preventDefault();return false}},
_doInternalPaste:function(map,usePasteKeyEvent){if(usePasteKeyEvent){var KEY_PASTE=1299;
map._textInput._sendKeyEvent(0,KEY_PASTE)}else if(this._checkAndDisablePasteSpecial()){
app.socket.sendMessage("uno .uno:PasteSpecial")}else{app.socket.sendMessage("uno .uno:Paste")}},
cut:function(ev){return this._doCopyCut(ev,"Cut")},copy:function(ev){return this._doCopyCut(ev,
"Copy")},paste:function(ev){if(this._map.isReadOnlyMode())return;window.app.console.log("Paste");if(
this._isAnyInputFieldSelected()&&!this._isFormulabarSelected())return;if(this._map.isSearching()
)return;if(this._downloadProgressStatus()==="downloadButton")this._stopHideDownload();if(
this._map._activeDialog)ev.usePasteKeyEvent=true;if(ev.clipboardData){ev.preventDefault();
var usePasteKeyEvent=ev.usePasteKeyEvent;var htmlText=ev.clipboardData.getData("text/html");
var hasFinished=this.dataTransferToDocument(ev.clipboardData,true,htmlText,usePasteKeyEvent);
this._map._textInput._abortComposition(ev);this._clipboardSerial++;if(hasFinished
)this._stopHideDownload()}return false},clearSelection:function(){this._selectionContent="";
this._selectionPlainTextContent="";this._selectionType=null;this._scheduleHideDownload()},
setTextSelectionHTML:function(html,plainText=""){this._selectionType="text";
this._selectionContent=html;this._selectionPlainTextContent=plainText;if(
window.L.Browser.cypressTest){this._dummyDiv.innerHTML=html;this._dummyPlainDiv.innerText=plainText}
this._scheduleHideDownload()},setTextSelectionType:function(selectionType){
this._selectionType=selectionType},setTextSelectionText:function(text){if(this._map.getDocType(
)==="spreadsheet"&&text.startsWith("=")){app.socket.sendMessage(
"gettextselection mimetype=text/html");return}this._selectionType="text";
this._selectionContent=this._originWrapBody(text);this._selectionPlainTextContent=text;
this._scheduleHideDownload()},onComplexSelection:function(){this._selectionType="complex";
this._scheduleHideDownload()},_startProgress:function(isLargeCopy){if(!this._downloadProgress){
this._downloadProgress=window.L.control.downloadProgress();this._map.addControl(
this._downloadProgress)}this._downloadProgress.show(isLargeCopy)},
_onDownloadOnLargeCopyPaste:function(){if(this._downloadProgress&&this._downloadProgress.isStarted()
){this._warnLargeCopyPasteAlreadyStarted()}else{this._startProgress(true)}},
_downloadProgressStatus:function(){if(this._downloadProgress
)return this._downloadProgress.currentStatus()},_scheduleHideDownload:function(){if(
!this._downloadProgress||this._downloadProgress.isClosed())return;if(["downloadButton",
"confirmPasteButton"].includes(this._downloadProgressStatus()))this._stopHideDownload()},
_stopHideDownload:function(){if(!this._downloadProgress||this._downloadProgress.isClosed())return;
this._downloadProgress._onClose()},_warnCopyPaste:function(){var id="copy_paste_warning";if(
!JSDialog.shouldShowAgain(id))return;this._map.uiManager.showYesNoButton(id+"-box","","",_("OK"),_(
"Don’t show this again"),null,function(){JSDialog.setShowAgain(id,false)},true);
this._warnCopyPasteImpl(id)},_warnCopyPasteImpl:function(id){var box=document.getElementById(
id+"-box");if(!box){setTimeout(()=>{this._warnCopyPasteImpl(id)},10);return}
var innerDiv=window.L.DomUtil.create("div","",null);box.insertBefore(innerDiv,box.firstChild);if(
window.mode.isMobile()||window.mode.isTablet()){const p=document.createElement("p");p.textContent=_(
"Your browser has very limited access to the clipboard, so please use the paste buttons on your on-screen keyboard instead."
);innerDiv.appendChild(p)}else{const ctrlText=app.util.replaceCtrlAltInMac("Ctrl");
const p=document.createElement("p");
p.textContent="Your browser has very limited access to the clipboard, so use these keyboard shortcuts:"
innerDiv.appendChild(p);const table=document.createElement("table");
table.className="warn-copy-paste";innerDiv.appendChild(table);let row=document.createElement("tr");
table.appendChild(row);for(let i=0;i<3;i++){const cell=document.createElement("td");row.appendChild(
cell);let kbd=document.createElement("kbd");kbd.textContent=ctrlText;cell.appendChild(kbd);
const span=document.createElement("span");span.textContent="+";span.className="kbd--plus";
cell.appendChild(span);kbd=document.createElement("kbd");kbd.textContent=i===0?"C":i===1?"X":"V";
cell.appendChild(kbd)}row=document.createElement("tr");table.appendChild(row);for(let i=0;i<3;i++){
const cell=document.createElement("td");cell.textContent=i===0?"Copy":i===1?"Cut":"Paste";
row.appendChild(cell)}}},_substProductName:function(msg){
var productName=typeof brandProductName!=="undefined"?brandProductName:"F7 Office (unbranded)"
return msg.replace("{productname}",productName)},_warnLargeCopyPasteAlreadyStarted:function(){
this._map.uiManager.showInfoModal("large copy paste started warning");
const container=document.getElementById("large copy paste started warning");
container.replaceChildren();const p=document.createElement("p");p.textContent=_(
"A download due to a large copy/paste operation has already started. Please, wait for the current download or cancel it before starting a new one"
);container.appendChild(p)},isPasteSpecialDialogOpen:function(){if(!this.pasteSpecialDialogId
)return false;else{var result=document.getElementById(this.pasteSpecialDialogId);
return result!==undefined&&result!==null?true:false}},isCopyPasteDialogReadyForCopy:function(){
return this._downloadProgress&&this._downloadProgress.isComplete()},_openPasteSpecialPopup:function(
){this.pasteSpecialDialogId=this._map.uiManager.generateModalId("paste_special_dialog")+"-box";
var id="paste_special_dialog";this._map.uiManager.showYesNoButton(id+"-box","","",_(
"Paste from this document"),_("Cancel paste special"),function(){app.socket.sendMessage(
"uno .uno:PasteSpecial")},null,true);this._openPasteSpecialPopupImpl(id)},
_openPasteSpecialPopupImpl:function(id){var box=document.getElementById(id+"-box");if(!box){
setTimeout(()=>{this._openPasteSpecialPopupImpl(id)},10);return}
var innerDiv=window.L.DomUtil.create("div","",null);box.insertBefore(innerDiv,box.firstChild);
const ctrlText=app.util.replaceCtrlAltInMac("Ctrl");let p=document.createElement("p");
p.textContent=_("Your browser has very limited access to the clipboard");innerDiv.appendChild(p);
p=document.createElement("p");innerDiv.appendChild(p);const bold=document.createElement("b");
bold.textContent=_("Please use following combination to see more options:");p.appendChild(bold);
p=document.createElement("p");innerDiv.appendChild(p);let kbd=document.createElement("kbd");
kbd.textContent=ctrlText;p.appendChild(kbd);const span=document.createElement("span");
span.className="kbd--plus";span.textContent="+";p.appendChild(span);kbd=document.createElement("kbd"
);kbd.textContent="V";p.appendChild(kbd);p=document.createElement("p");innerDiv.appendChild(p);
p.textContent=_("Close popup to ignore paste special");var label=document.getElementById(
"modal-dialog-"+id+"-box-label");label.style.display="none"},_checkAndDisablePasteSpecial:function(
){if(this._navigatorClipboardPasteSpecial){this._navigatorClipboardPasteSpecial=false;return true}
if(this.isPasteSpecialDialogOpen()){this._map.jsdialog.closeDialog(this.pasteSpecialDialogId,false);
return true}return false}});window.L.clipboard=function(map){if(window.ThisIsTheAndroidApp
)window.app.console.log(
"======> Assertion failed!? No window.L.Clipboard object should be needed in the Android app");
return new window.L.Clipboard(map)};var cool;(function(cool){var SheetSwitchViewRestore=function(){
function SheetSwitchViewRestore(map){this.map=map;this.docLayer=this.map._docLayer;
this.centerOfSheet=new Map;this.mayRestore=false;this.restorePart=-1;this.setPartRecvd=false;
this.currentSheetIndexReassigned=false}SheetSwitchViewRestore.prototype.save=function(toPart){if(
!this.currentSheetIndexReassigned){this.centerOfSheet.set(this.docLayer._selectedPart,
this.map.getCenter())}else{this.currentSheetIndexReassigned=false}
this.mayRestore=this.centerOfSheet.has(toPart);this.restorePart=this.mayRestore?toPart:-1;
this.setPartRecvd=false};SheetSwitchViewRestore.prototype.updateOnSheetMoved=function(oldIndex,
newIndex){if(oldIndex<0||newIndex<0||oldIndex===newIndex)return;
var movedSheetCenter=this.centerOfSheet.get(oldIndex);if(oldIndex<newIndex){for(
var i=oldIndex;i<newIndex;++i){var center=this.centerOfSheet.get(i+1);if(center
)this.centerOfSheet.set(i,center);else this.centerOfSheet.delete(i)}}else{for(
var i=oldIndex;i>newIndex;--i){var center=this.centerOfSheet.get(i-1);if(center
)this.centerOfSheet.set(i,center);else this.centerOfSheet.delete(i)}}if(movedSheetCenter
)this.centerOfSheet.set(newIndex,movedSheetCenter);else this.centerOfSheet.delete(newIndex)};
SheetSwitchViewRestore.prototype.updateOnSheetInsertion=function(index){if(index<0)return;
this.centerOfSheet.set(this.docLayer._selectedPart,this.map.getCenter());
var numberOfSheets=this.map.getNumberOfParts();for(var i=numberOfSheets;i>index;--i){
var center=this.centerOfSheet.get(i-1);if(center)this.centerOfSheet.set(i,center
);else this.centerOfSheet.delete(i)}this.centerOfSheet.delete(index);
var currentSheetNumber=this.map.getCurrentPartNumber();
this.currentSheetIndexReassigned=index<=currentSheetNumber;if(this.currentSheetIndexReassigned){
this.centerOfSheet.set(currentSheetNumber+1,this.map.getCenter())}};
SheetSwitchViewRestore.prototype.updateOnSheetDeleted=function(index){if(index<0)return;
var numberOfSheets=this.map.getNumberOfParts();for(var i=index;i<numberOfSheets;++i){
var center=this.centerOfSheet.get(i+1);if(center)this.centerOfSheet.set(i,center
);else this.centerOfSheet.delete(i)}var currentSheetNumber=this.map.getCurrentPartNumber();
this.currentSheetIndexReassigned=index<=currentSheetNumber;if(index<currentSheetNumber){
this.centerOfSheet.set(currentSheetNumber-1,this.map.getCenter())}};
SheetSwitchViewRestore.prototype.gotSetPart=function(part){this.setPartRecvd=part===this.restorePart
};SheetSwitchViewRestore.prototype.reset=function(){this.restorePart=-1;this.mayRestore=false};
SheetSwitchViewRestore.prototype.restoreView=function(){var center=this.centerOfSheet.get(
this.restorePart);if(center===undefined){this.reset();return}this.map._resetView(center,
this.map._zoom);if(this.setPartRecvd)this.reset()};
SheetSwitchViewRestore.prototype.tryRestore=function(duplicateCursor,currentPart){
var shouldScrollToCursor=false;var attemptRestore=this.mayRestore&&currentPart===this.restorePart;
if(attemptRestore){if(this.setPartRecvd&&duplicateCursor)this.reset();if(!this.setPartRecvd
)this.restoreView()}if((!attemptRestore||this.setPartRecvd)&&!duplicateCursor
)shouldScrollToCursor=true;return shouldScrollToCursor};return SheetSwitchViewRestore}();
cool.SheetSwitchViewRestore=SheetSwitchViewRestore})(cool||(cool={}));
window.L.Layer=window.L.Evented.extend({options:{pane:"overlayPane"},initialize:function(){
window.L.Evented.prototype.initialize.call(this)},addTo:function(map){map.addLayer(this);return this
},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(obj){if(
obj){obj.removeLayer(this)}return this},getPane:function(name){return this._map.getPane(
name?this.options[name]||name:this.options.pane)},addInteractiveTarget:function(targetEl){
this._map._targets[app.util.stamp(targetEl)]=this;return this},removeInteractiveTarget:function(
targetEl){delete this._map._targets[app.util.stamp(targetEl)];return this},_layerAdd:function(e){
var map=e.target;if(!map.hasLayer(this)){return}this._map=map;this._zoomAnimated=map._zoomAnimated;
this.onAdd(map);if(this.getEvents){map.on(this.getEvents(),this)}this.fire("add");map.fire(
"layeradd",{layer:this})}});window.L.Map.include({addLayer:function(layer){var id=app.util.stamp(
layer);if(this._layers[id]){return layer}this._layers[id]=layer;layer._mapToAdd=this;if(
layer.beforeAdd){layer.beforeAdd(this)}this.whenReady(layer._layerAdd,layer);return this},
removeLayer:function(layer){var id=app.util.stamp(layer);if(!this._layers[id]){return this}if(
this._loaded){layer.onRemove(this)}if(layer.getEvents){this.off(layer.getEvents(),layer)}
delete this._layers[id];if(this._loaded){this.fire("layerremove",{layer:layer});layer.fire("remove")
}layer._map=layer._mapToAdd=null;return this},hasLayer:function(layer){
return!!layer&&app.util.stamp(layer)in this._layers},eachLayer:function(method,context){for(
var i in this._layers){method.call(context,this._layers[i])}return this},_addLayers:function(layers
){layers=layers?app.util.isArray(layers)?layers:[layers]:[];for(var i=0,len=layers.length;i<len;i++
){this.addLayer(layers[i])}},_addZoomLimit:function(layer){if(isNaN(layer.options.maxZoom)||!isNaN(
layer.options.minZoom)){this._zoomBoundLayers[app.util.stamp(layer)]=layer;this._updateZoomLevels()}
},_removeZoomLimit:function(layer){var id=app.util.stamp(layer);if(this._zoomBoundLayers[id]){
delete this._zoomBoundLayers[id];this._updateZoomLevels()}},_updateZoomLevels:function(){
var minZoom=Infinity,maxZoom=-Infinity,oldZoomSpan=this._getZoomSpan();for(
var i in this._zoomBoundLayers){var options=this._zoomBoundLayers[i].options;
minZoom=options.minZoom===undefined?minZoom:Math.min(minZoom,options.minZoom);
maxZoom=options.maxZoom===undefined?maxZoom:Math.max(maxZoom,options.maxZoom)}
this._layersMaxZoom=maxZoom===-Infinity?undefined:maxZoom;
this._layersMinZoom=minZoom===Infinity?undefined:minZoom;if(oldZoomSpan!==this._getZoomSpan()){
this.fire("zoomlevelschange")}}});window.L.Layer.getLayerPositionVisibility=function(latlng,
boundingClientRect,map,offset){var splitPanesContext=map.getSplitPanesContext();if(
!splitPanesContext){return{position:map.latLngToLayerPoint(latlng).round(),visibility:"visible"}}
var splitPos=splitPanesContext.getSplitPos();var docPos=map.project(latlng);
var docPosWithOffset=docPos.clone();if(offset){docPosWithOffset._add(offset)}
var pixelOrigin=map.getPixelOrigin();var mapPanePos=map._getMapPanePos();
var mirrorX=map._docLayer.isCalcRTL();var layerSplitPos=splitPos.subtract(mapPanePos);if(mirrorX
)layerSplitPos.x=map._size.x-splitPos.x-mapPanePos.x;var makeHidden=false;if(splitPos.x){
layerSplitPos.x+=mirrorX?-1:1}if(splitPos.y){layerSplitPos.y+=1}var layerPos=new cool.Point(0,0);
var layerPosWithOffset=new cool.Point(0,0);var eps=new cool.Point(boundingClientRect.width,
boundingClientRect.height);if(docPosWithOffset.x<=splitPos.x){layerPos.x=(
mirrorX?map._size.x-docPosWithOffset.x:docPos.x)-mapPanePos.x;layerPosWithOffset.x=(
mirrorX?map._size.x-docPos.x:docPosWithOffset.x)-mapPanePos.x;if(
splitPos.x-docPosWithOffset.x<=eps.x){makeHidden=mapPanePos.x!==pixelOrigin.x}}else{
layerPos.x=mirrorX?map._size.x-(docPosWithOffset.x-pixelOrigin.x+mapPanePos.x
)-mapPanePos.x:docPos.x-pixelOrigin.x;layerPosWithOffset.x=mirrorX?map._size.x-(
docPos.x-pixelOrigin.x+mapPanePos.x)-mapPanePos.x:docPosWithOffset.x-pixelOrigin.x;if(
!mirrorX&&layerPosWithOffset.x<layerSplitPos.x||mirrorX&&layerPosWithOffset.x>=layerSplitPos.x){
makeHidden=true}}if(docPosWithOffset.y<=splitPos.y){layerPos.y=docPos.y-mapPanePos.y;
layerPosWithOffset.y=docPosWithOffset.y-mapPanePos.y;if(splitPos.y-docPosWithOffset.y<=eps.y){
makeHidden=mapPanePos.y!==pixelOrigin.y}}else{layerPos.y=docPos.y-pixelOrigin.y;
layerPosWithOffset.y=docPosWithOffset.y-pixelOrigin.y;if(layerPosWithOffset.y<layerSplitPos.y){
makeHidden=true}}return{position:layerPos,visibility:makeHidden?"hidden":"visible"}};var cool;(
function(cool){var SheetGeometry=function(){function SheetGeometry(sheetGeomJSON,tileWidthTwips,
tileHeightTwips,tileSizePixels,part){if(
typeof sheetGeomJSON!=="object"||typeof tileWidthTwips!=="number"||typeof tileHeightTwips!=="number"||typeof tileSizePixels!=="number"||typeof part!=="number"
){console.error("Incorrect constructor argument types or missing required arguments");return}
this._part=-1;this._columns=new SheetDimension;this._rows=new SheetDimension;
this._unoCommand=".uno:SheetGeometryData";this.setTileGeometryData(tileWidthTwips,tileHeightTwips,
tileSizePixels,false);this.update(sheetGeomJSON,true,part)}
SheetGeometry.prototype.checkMaxIndex=function(sheetGeomJSON,column){
var hiddenInfo=column?sheetGeomJSON.columns.hidden.trim():sheetGeomJSON.rows.hidden.trim();
var isFirstHidden=hiddenInfo.indexOf("1")===0;var splitted=hiddenInfo.split(" ");
var isLastHidden=splitted.length%2===0&&!isFirstHidden||splitted.length%2===1&&isFirstHidden;if(
splitted.length===1){if(isFirstHidden)return 0;else return parseInt(splitted[0].split(":")[1])
}else if(!isLastHidden){return parseInt(splitted[splitted.length-1])}else if(splitted.length===2){
return parseInt(splitted[0].split(":")[1])}else{return parseInt(splitted[splitted.length-2])}};
SheetGeometry.prototype.update=function(sheetGeomJSON,checkCompleteness,part){if(
!this._testValidity(sheetGeomJSON,checkCompleteness)){return false}var updateOK=true;if(
sheetGeomJSON.columns){if(!this._columns.update(sheetGeomJSON.columns)){console.error(
this._unoCommand+": columns update failed.");updateOK=false}if(sheetGeomJSON.columns.hidden
)this.maxVisibleColumnIndex=this.checkMaxIndex(sheetGeomJSON,true
);else this.maxVisibleColumnIndex=parseInt(sheetGeomJSON.maxtiledcolumn)}if(sheetGeomJSON.rows){if(
!this._rows.update(sheetGeomJSON.rows)){console.error(this._unoCommand+": rows update failed.");
updateOK=false}if(sheetGeomJSON.rows.hidden)this.maxVisibleRowIndex=this.checkMaxIndex(sheetGeomJSON
,false);else this.maxVisibleRowIndex=parseInt(sheetGeomJSON.maxtiledrow)}if(updateOK){
console.assert(typeof part==="number","part must be a number");if(part!==this._part){this._part=part
}}this._columns.setMaxIndex(+sheetGeomJSON.maxtiledcolumn);this._rows.setMaxIndex(
+sheetGeomJSON.maxtiledrow);return updateOK};SheetGeometry.prototype.setTileGeometryData=function(
tileWidthTwips,tileHeightTwips,tileSizePixels,updatePositions){this._columns.setTileGeometryData(
tileWidthTwips,tileSizePixels,updatePositions);this._rows.setTileGeometryData(tileHeightTwips,
tileSizePixels,updatePositions);if(app.map)app.map.fire("sheetgeometrychanged")};
SheetGeometry.prototype.setViewArea=function(topLeftTwipsPoint,sizeTwips){if(!(
topLeftTwipsPoint instanceof cool.Point)||!(sizeTwips instanceof cool.Point)){console.error(
"invalid argument types");return false}var left=topLeftTwipsPoint.x;var top=topLeftTwipsPoint.y;
var right=left+sizeTwips.x;var bottom=top+sizeTwips.y;this._columns.setViewLimits(left,right);
this._rows.setViewLimits(top,bottom);return true};SheetGeometry.prototype.getPart=function(){
return this._part};SheetGeometry.prototype.getColumnsGeometry=function(){return this._columns};
SheetGeometry.prototype.getRowsGeometry=function(){return this._rows};
SheetGeometry.prototype.getViewColumnRange=function(){return this._columns.getViewElementRange()};
SheetGeometry.prototype.getViewRowRange=function(){return this._rows.getViewElementRange()};
SheetGeometry.prototype.getViewCellRange=function(){return{columnrange:this.getViewColumnRange(),
rowrange:this.getViewRowRange()}};SheetGeometry.prototype.getRowData=function(rowIndex){
return this._rows.getElementData(rowIndex)};SheetGeometry.prototype.getColumnGroupLevels=function(){
return this._columns.getGroupLevels()};SheetGeometry.prototype.getRowGroupLevels=function(){
return this._rows.getGroupLevels()};SheetGeometry.prototype.getColumnGroupsDataInView=function(){
return this._columns.getGroupsDataInView()};SheetGeometry.prototype.getRowGroupsDataInView=function(
){return this._rows.getGroupsDataInView()};SheetGeometry.prototype.getTileTwipsAtZoom=function(point
,zoomScale){if(!(point instanceof cool.Point)){console.error(
"Bad argument type, expected cool.Point");return point}return new cool.Point(
this._columns.getTileTwipsAtZoom(point.x,zoomScale),this._rows.getTileTwipsAtZoom(point.y,zoomScale)
)};SheetGeometry.prototype.getCorePixelsAtZoom=function(point,zoomScale){if(!(
point instanceof cool.Point)){console.error("Bad argument type, expected cool.Point");return point}
return new cool.Point(this._columns.getCorePixelsAtZoom(point.x,zoomScale),
this._rows.getCorePixelsAtZoom(point.y,zoomScale))};
SheetGeometry.prototype.getCorePixelsFromZoom=function(point,zoomScale){if(!(
point instanceof cool.Point)){console.error("Bad argument type, expected cool.Point");return point}
return new cool.Point(this._columns.getCorePixelsFromZoom(point.x,zoomScale),
this._rows.getCorePixelsFromZoom(point.y,zoomScale))};
SheetGeometry.prototype.getTileTwipsPointFromPrint=function(point){if(!(point instanceof cool.Point)
){console.error("Bad argument type, expected cool.Point");return point}return new cool.Point(
this._columns.getTileTwipsPosFromPrint(point.x),this._rows.getTileTwipsPosFromPrint(point.y))};
SheetGeometry.prototype.convertToTileTwips=function(simplePoint){
simplePoint.x=this._columns.getTileTwipsPosFromPrint(simplePoint.x);
simplePoint.y=this._rows.getTileTwipsPosFromPrint(simplePoint.y)};
SheetGeometry.prototype.convertRectangleToTileTwips=function(simpleRectangle){
simpleRectangle.x1=this._columns.getTileTwipsPosFromPrint(simpleRectangle.x1);
simpleRectangle.y1=this._rows.getTileTwipsPosFromPrint(simpleRectangle.y1)};
SheetGeometry.prototype.getPrintTwipsPointFromTile=function(point){if(!(point instanceof cool.Point)
){console.warn("Bad argument type, expected cool.Point")}return new cool.Point(
this._columns.getPrintTwipsPosFromTile(point.x),this._rows.getPrintTwipsPosFromTile(point.y))};
SheetGeometry.prototype.getTileTwipsSheetAreaFromPrint=function(rectangle){if(!(
rectangle instanceof cool.Bounds)){console.error("Bad argument type, expected cool.Bounds");
return rectangle}var topLeft=rectangle.getTopLeft();var bottomRight=rectangle.getBottomRight();
var horizBounds=this._columns.getTileTwipsRangeFromPrint(topLeft.x,bottomRight.x);
var vertBounds=this._rows.getTileTwipsRangeFromPrint(topLeft.y,bottomRight.y);
topLeft=new cool.Point(horizBounds.startpos,vertBounds.startpos);bottomRight=new cool.Point(
horizBounds.endpos,vertBounds.endpos);return new cool.Bounds(topLeft,bottomRight)};
SheetGeometry.prototype.getSize=function(unit){return new cool.Point(this._columns.getSize(unit),
this._rows.getSize(unit))};SheetGeometry.prototype.getCellSimpleRectangle=function(columnIndex,
rowIndex,zoomScale){if(zoomScale===void 0){zoomScale=null}
var horizPosSize=this._columns.getElementData(columnIndex,zoomScale);
var vertPosSize=this._rows.getElementData(rowIndex,zoomScale);return new cool.SimpleRectangle(
horizPosSize.startpos*15/zoomScale,vertPosSize.startpos*15/zoomScale,horizPosSize.size*15/zoomScale,
vertPosSize.size*15/zoomScale)};SheetGeometry.prototype.getCellRect=function(columnIndex,rowIndex,
zoomScale){var horizPosSize=this._columns.getElementData(columnIndex,zoomScale);
var vertPosSize=this._rows.getElementData(rowIndex,zoomScale);var topLeft=new cool.Point(
horizPosSize.startpos,vertPosSize.startpos);var size=new cool.Point(horizPosSize.size,
vertPosSize.size);return new cool.Bounds(topLeft,topLeft.add(size))};
SheetGeometry.prototype.getCellFromPos=function(pos,unit){console.assert(pos instanceof cool.Point);
return new cool.Point(this._columns.getIndexFromPos(pos.x,unit),this._rows.getIndexFromPos(pos.y,
unit))};SheetGeometry.prototype.getSnapDocPosX=function(posX,unit){return this._columns.getSnapPos(
posX,unit)};SheetGeometry.prototype.getSnapDocPosY=function(posY,unit){return this._rows.getSnapPos(
posY,unit)};SheetGeometry.prototype._testValidity=function(sheetGeomJSON,checkCompleteness){if(
!sheetGeomJSON.commandName){console.error(
this._unoCommand+' response has no property named "commandName".');return false}if(
sheetGeomJSON.commandName!==this._unoCommand){console.error(
"JSON response has wrong commandName: "+sheetGeomJSON.commandName+" expected: "+this._unoCommand);
return false}if(typeof sheetGeomJSON.maxtiledcolumn!=="string"||!/^\d+$/.test(
sheetGeomJSON.maxtiledcolumn)){console.error("JSON is missing/unreadable maxtiledcolumn property");
return false}if(typeof sheetGeomJSON.maxtiledrow!=="string"||!/^\d+$/.test(sheetGeomJSON.maxtiledrow
)){console.error("JSON is missing/unreadable maxtiledrow property");return false}if(
checkCompleteness){if(!sheetGeomJSON.rows||!sheetGeomJSON.columns){console.error(
this._unoCommand+" response is incomplete.");return false}if(
typeof sheetGeomJSON.rows!=="object"||typeof sheetGeomJSON.columns!=="object"){console.error(
this._unoCommand+" response has invalid rows/columns children.");return false}var expectedFields=[
"sizes","hidden","filtered"];for(var idx=0;idx<expectedFields.length;idx++){
var fieldName=expectedFields[idx];var encodingForCols=SheetGeometry.getDimensionDataField(
sheetGeomJSON.columns,fieldName);var encodingForRows=SheetGeometry.getDimensionDataField(
sheetGeomJSON.rows,fieldName);if(typeof encodingForRows!=="string"||!encodingForRows){console.error(
this._unoCommand+" response has invalid value for rows."+fieldName);return false}if(
typeof encodingForCols!=="string"||!encodingForCols){console.error(
this._unoCommand+" response has invalid value for columns."+fieldName);return false}}}return true};
SheetGeometry.getDimensionDataField=function(dimData,fieldName){switch(fieldName){case"sizes":
return dimData.sizes;case"hidden":return dimData.hidden;case"filtered":return dimData.filtered;
case"groups":return dimData.groups;default:return undefined}};return SheetGeometry}();
cool.SheetGeometry=SheetGeometry;var SheetDimension=function(){function SheetDimension(){
this._sizes=new SpanList;this._hidden=new BoolSpanList;this._filtered=new BoolSpanList;
this._outlines=new DimensionOutlines;this._visibleSizes=undefined}
SheetDimension.prototype.update=function(jsonObject){if(typeof jsonObject!=="object"){return false}
var regenerateVisibleSizes=false;var loadsOK=true;if(jsonObject.sizes!==undefined){
loadsOK=this._sizes.load(jsonObject.sizes);regenerateVisibleSizes=true}if(
jsonObject.hidden!==undefined){var thisLoadOK=this._hidden.load(jsonObject.hidden);
loadsOK=loadsOK&&thisLoadOK;regenerateVisibleSizes=true}if(jsonObject.filtered!==undefined){
thisLoadOK=this._filtered.load(jsonObject.filtered);loadsOK=loadsOK&&thisLoadOK;
regenerateVisibleSizes=true}if(jsonObject.groups!==undefined){thisLoadOK=this._outlines.load(
jsonObject.groups);loadsOK=loadsOK&&thisLoadOK}if(loadsOK&&regenerateVisibleSizes){
this._updateVisible()}return loadsOK};SheetDimension.prototype.setMaxIndex=function(maxIndex){
this._maxIndex=maxIndex};SheetDimension.prototype.setTileGeometryData=function(tileSizeTwips,
tileSizePixels,updatePositions){if(updatePositions===void 0){updatePositions=true}if(
this._tileSizeTwips===tileSizeTwips&&this._tileSizePixels===tileSizePixels){return}
this._tileSizeTwips=tileSizeTwips;this._tileSizePixels=tileSizePixels;
this._coreZoomFactor=this._tileSizePixels*15/this._tileSizeTwips;
this._twipsPerCorePixel=this._tileSizeTwips/this._tileSizePixels;if(updatePositions){
this._updatePositions()}};SheetDimension.prototype._updateVisible=function(){
var invisibleSpanList=this._hidden.union(this._filtered);
this._visibleSizes=this._sizes.applyZeroValues(invisibleSpanList);this._updatePositions()};
SheetDimension.prototype._updatePositions=function(){var posCorePx=0;var posPrintTwips=0;
this._visibleSizes.addCustomDataForEachSpan(function(index,size,spanLength){
var sizeCorePxOne=Math.floor(size/this._twipsPerCorePixel);posCorePx+=sizeCorePxOne*spanLength;
var posTileTwips=Math.floor(posCorePx*this._twipsPerCorePixel);posPrintTwips+=size*spanLength;
var customData={sizecore:sizeCorePxOne,poscorepx:posCorePx,postiletwips:posTileTwips,
posprinttwips:posPrintTwips};return customData}.bind(this))};
SheetDimension.prototype.getElementData=function(index,zoomScale){if(zoomScale!==undefined){
var startpos=0;var size=0;this._visibleSizes.forEachSpanInRange(0,index,function(spanData){
var count=spanData.end-spanData.start+1;var sizeOneCorePx=Math.floor(spanData.size*zoomScale/15);if(
index>spanData.end){startpos+=sizeOneCorePx*count}else if(index>=spanData.start&&index<=spanData.end
){startpos+=sizeOneCorePx*(index-spanData.start);size=sizeOneCorePx}});return{startpos:startpos,
size:size}}var span=this._visibleSizes.getSpanDataByIndex(index);if(span===undefined){
return undefined}return this._getElementDataFromSpanByIndex(index,span)};
SheetDimension.prototype.getElementDataAny=function(index,unitName){
var span=this._visibleSizes.getSpanDataByIndex(index);if(span===undefined){return undefined}
return this._getElementDataAnyFromSpanByIndex(index,span,unitName)};
SheetDimension.prototype._getElementDataFromSpanByIndex=function(index,span){
return this._getElementDataAnyFromSpanByIndex(index,span,"corepixels")};
SheetDimension.prototype._getElementDataAnyFromSpanByIndex=function(index,span,unitName){if(
span===undefined||index<span.start||span.end<index){return undefined}if(
unitName!=="corepixels"&&unitName!=="tiletwips"&&unitName!=="printtwips"){console.error(
"unsupported unitName: "+unitName);return undefined}var numSizes=span.end-index+1;
var inPixels=unitName==="corepixels";if(inPixels){return{
startpos:span.data.poscorepx-span.data.sizecore*numSizes,size:span.data.sizecore}}if(
unitName==="printtwips"){return{startpos:span.data.posprinttwips-span.size*numSizes,size:span.size}}
var twipsPerCorePixel=this._twipsPerCorePixel;return{startpos:Math.floor((
span.data.poscorepx-span.data.sizecore*numSizes)*twipsPerCorePixel),size:Math.floor(
span.data.sizecore*twipsPerCorePixel)}};SheetDimension.prototype.forEachInRange=function(start,end,
callback){this._visibleSizes.forEachSpanInRange(start,end,function(span){var first=Math.max(
span.start,start);var last=Math.min(span.end,end);for(var index=first;index<=last;++index){callback(
index,this._getElementDataFromSpanByIndex(index,span))}}.bind(this))};
SheetDimension.prototype.forEachInCorePixelRange=function(startPix,endPix,callback){
this._visibleSizes.forEachSpan(function(spanData){
var spanFirstCorePx=spanData.data.poscorepx-spanData.data.sizecore*(spanData.end-spanData.start+1);
if(spanFirstCorePx<endPix&&spanData.data.poscorepx>startPix){var firstCorePx=Math.max(
spanFirstCorePx,startPix+spanData.data.sizecore-(startPix-spanFirstCorePx)%spanData.data.sizecore);
var lastCorePx=Math.min(endPix,spanData.data.poscorepx);var index=spanData.start+Math.floor((
firstCorePx-spanFirstCorePx)/spanData.data.sizecore);for(
var pos=firstCorePx;pos<=lastCorePx;pos+=spanData.data.sizecore){callback(pos,index);index+=1}}})};
SheetDimension.prototype._getSpanAndIndexFromTileTwipsPos=function(pos){var result={};
var span=this._visibleSizes.getSpanDataByCustomDataField(pos,"postiletwips");result.span=span;if(
span===undefined){result.index=pos>=0?this._maxIndex:0;
result.span=this._visibleSizes.getSpanDataByIndex(result.index);return result}
var elementCount=span.end-span.start+1;var posStart=(
span.data.poscorepx-span.data.sizecore*elementCount)*this._twipsPerCorePixel;
var posEnd=span.data.postiletwips;var sizeOne=(posEnd-posStart)/elementCount;
var relativeIndex=Math.floor((pos-posStart)/sizeOne);result.index=span.start+relativeIndex;
return result};SheetDimension.prototype._getIndexFromTileTwipsPos=function(pos){
return this._getSpanAndIndexFromTileTwipsPos(pos).index};
SheetDimension.prototype._getSpanAndIndexFromPrintTwipsPos=function(pos){var result={};
var span=this._visibleSizes.getSpanDataByCustomDataField(pos,"posprinttwips");result.span=span;if(
span===undefined){result.index=pos>=0?this._maxIndex:0;
result.span=this._visibleSizes.getSpanDataByIndex(result.index);return result}
var elementCount=span.end-span.start+1;var posStart=span.data.posprinttwips-span.size*elementCount;
var sizeOne=span.size;var relativeIndex=Math.floor((pos-posStart)/sizeOne);
result.index=span.start+relativeIndex;return result};
SheetDimension.prototype.setViewLimits=function(startPosTileTwips,endPosTileTwips){
this._viewStartIndex=Math.max(0,this._getIndexFromTileTwipsPos(startPosTileTwips));
this._viewEndIndex=Math.min(this._maxIndex,this._getIndexFromTileTwipsPos(endPosTileTwips))};
SheetDimension.prototype.getViewElementRange=function(){return{start:this._viewStartIndex,
end:this._viewEndIndex}};SheetDimension.prototype.getGroupLevels=function(){
return this._outlines.getLevels()};SheetDimension.prototype.getGroupsDataInView=function(){
var groupsData=[];var levels=this._outlines.getLevels();if(!levels){return groupsData}
this._outlines.forEachGroupInRange(0,this._viewEndIndex,function(levelIdx,groupIdx,start,end,hidden
){var startElementData=this.getElementData(start);var endElementData=this.getElementData(end);
groupsData.push({level:(levelIdx+1).toString(),index:groupIdx.toString(),
startPos:startElementData.startpos.toString(),endPos:(endElementData.startpos+endElementData.size
).toString(),hidden:hidden?"1":"0"})}.bind(this));return groupsData};
SheetDimension.prototype.getMaxIndex=function(){return this._maxIndex};
SheetDimension.prototype.getTileTwipsAtZoom=function(posTT,zoomScale){if(
typeof posTT!=="number"||typeof zoomScale!=="number"){console.error("Wrong argument types");return}
var posPT=this.getPrintTwipsPosFromTile(posTT);return this.getTileTwipsPosFromPrint(posPT,zoomScale)
};SheetDimension.prototype.getCorePixelsAtZoom=function(posCP,zoomScale){if(
typeof posCP!=="number"||typeof zoomScale!=="number"){console.error("Wrong argument types");return}
var posCPZ=0;var posCPRem=posCP;this._visibleSizes.forEachSpan(function(span){
var elementCount=span.end-span.start+1;var sizeOneCP=span.data.sizecore;var sizeOneCPZ=Math.floor(
span.size/15*zoomScale);var sizeCP=sizeOneCP*elementCount;var sizeCPZ=sizeOneCPZ*elementCount;if(
posCPRem<sizeOneCP){return}if(posCPRem>=sizeCP){posCPRem-=sizeCP;posCPZ+=sizeCPZ;return}
var elems=Math.floor(posCPRem/sizeOneCP);posCPRem-=elems*sizeOneCP;posCPZ+=elems*sizeOneCPZ});
return posCPZ+posCPRem*zoomScale/this._coreZoomFactor};
SheetDimension.prototype.getCorePixelsFromZoom=function(posCPZ,zoomScale){if(
typeof posCPZ!=="number"||typeof zoomScale!=="number"){console.error("Wrong argument types");return}
var posCP=0;var posCPZRem=posCPZ;this._visibleSizes.forEachSpan(function(span){
var elementCount=span.end-span.start+1;var sizeOneCP=span.data.sizecore;var sizeOneCPZ=Math.floor(
span.size/15*zoomScale);var sizeCP=sizeOneCP*elementCount;var sizeCPZ=sizeOneCPZ*elementCount;if(
posCPZRem<sizeOneCPZ){return}if(posCPZRem>=sizeCPZ){posCPZRem-=sizeCPZ;posCP+=sizeCP;return}
var elems=Math.floor(posCPZRem/sizeOneCPZ);posCPZRem-=elems*sizeOneCPZ;posCP+=elems*sizeOneCP});
return posCP+posCPZRem*this._coreZoomFactor/zoomScale};
SheetDimension.prototype.getTileTwipsPosFromPrint=function(posPT,zoomScale){if(
typeof posPT!=="number"){console.error("Wrong argument type");return}if(typeof zoomScale==="number"
){var posTT=0;var posPTInc=0;this._visibleSizes.forEachSpan(function(spanData){
var count=spanData.end-spanData.start+1;var sizeSpanPT=spanData.size*count;
var sizeOneCorePx=Math.floor(spanData.size*zoomScale/15);var sizeSpanTT=Math.floor(
sizeOneCorePx*count*15/zoomScale);if(posPTInc>=posPT){return}if(posPTInc+sizeSpanPT<posPT){
posPTInc+=sizeSpanPT;posTT+=sizeSpanTT;return}var remainingPT=posPT-posPTInc;
var elemCountFinalSpan=Math.floor(remainingPT/spanData.size);
var extra=remainingPT-elemCountFinalSpan*spanData.size;posTT+=Math.floor(
elemCountFinalSpan*sizeSpanTT/count)+extra;posPTInc=posPT});return posTT}
var element=this._getSpanAndIndexFromPrintTwipsPos(posPT);
var elementDataTT=this._getElementDataAnyFromSpanByIndex(element.index,element.span,"tiletwips");
var elementDataPT=this._getElementDataAnyFromSpanByIndex(element.index,element.span,"printtwips");
var offset=posPT-elementDataPT.startpos;console.assert(offset>=0,"offset should not be negative");
return elementDataTT.startpos+offset};SheetDimension.prototype.getPrintTwipsPosFromTile=function(
posTT){if(typeof posTT!=="number"){console.error("Wrong argument type");return}
var element=this._getSpanAndIndexFromTileTwipsPos(posTT);
var elementDataTT=this._getElementDataAnyFromSpanByIndex(element.index,element.span,"tiletwips");
var elementDataPT=this._getElementDataAnyFromSpanByIndex(element.index,element.span,"printtwips");
var offset=posTT-elementDataTT.startpos;console.assert(offset>=0,"offset should not be negative");
return elementDataPT.startpos+offset};SheetDimension.prototype.getTileTwipsRangeFromPrint=function(
posStartPT,posEndPT){var startElement=this._getSpanAndIndexFromPrintTwipsPos(posStartPT);
var startData=this._getElementDataAnyFromSpanByIndex(startElement.index,startElement.span,
"tiletwips");if(posStartPT===posEndPT){var rangeSize=Math.floor(this._twipsPerCorePixel);return{
startpos:startData.startpos,endpos:startData.startpos+rangeSize}}
var endElement=this._getSpanAndIndexFromPrintTwipsPos(posEndPT);
var endData=this._getElementDataAnyFromSpanByIndex(endElement.index,endElement.span,"tiletwips");
var startPos=startData.startpos;var endPos=endData.startpos+endData.size;if(endPos<startPos){
endPos=startPos}return{startpos:startPos,endpos:endPos}};SheetDimension.prototype.getSize=function(
unit){var posSize=this.getElementDataAny(this._maxIndex,unit);if(!posSize){return undefined}
return posSize.startpos+posSize.size};SheetDimension.prototype.isUnitSupported=function(unitName){
return unitName==="corepixels"||unitName==="tiletwips"||unitName==="printtwips"};
SheetDimension.prototype.getSnapPos=function(pos,unit){console.assert(typeof pos==="number",
"pos is not a number");console.assert(this.isUnitSupported(unit),"unit: "+unit+" is not supported");
var origUnit=unit;if(unit==="corepixels"){pos=pos*this._twipsPerCorePixel;unit="tiletwips"}
console.assert(unit==="tiletwips"||unit==="printtwips","wrong unit assumption");
var result=unit==="tiletwips"?this._getSpanAndIndexFromTileTwipsPos(pos
):this._getSpanAndIndexFromPrintTwipsPos(pos);return this._getElementDataAnyFromSpanByIndex(
result.index,result.span,origUnit).startpos};SheetDimension.prototype.getIndexFromPos=function(pos,
unit){console.assert(typeof pos==="number","pos is not a number");console.assert(
this.isUnitSupported(unit),"unit: "+unit+" is not supported");if(unit==="corepixels"){
pos=pos*this._twipsPerCorePixel;unit="tiletwips"}console.assert(
unit==="tiletwips"||unit==="printtwips","wrong unit assumption");
var result=unit==="tiletwips"?this._getSpanAndIndexFromTileTwipsPos(pos
):this._getSpanAndIndexFromPrintTwipsPos(pos);return result.index};return SheetDimension}();
cool.SheetDimension=SheetDimension;var SpanList=function(){function SpanList(encoding){
this._spanlist=[];if(typeof encoding!=="string"){return}this.load(encoding)}
SpanList.prototype.load=function(encoding){if(typeof encoding!=="string"){return false}
var result=parseSpanListEncoding(encoding,false);if(result===undefined){return false}
this._spanlist=result.spanlist;return true};SpanList.prototype.applyZeroValues=function(other){if(!(
other instanceof BoolSpanList)){return undefined}if(this._spanlist[this._spanlist.length-1
].index!==other._spanlist[other._spanlist.length-1]){return undefined}var maxElement=this._spanlist[
this._spanlist.length-1].index;var result=new SpanList;var thisIdx=0;var otherIdx=0;
var zeroBit=other._startBit;var resultValue=zeroBit?0:this._spanlist[thisIdx].value;while(
thisIdx<this._spanlist.length&&otherIdx<other._spanlist.length){var thisElement=this._spanlist[
thisIdx].index;var otherElement=other._spanlist[otherIdx];var lastElement=otherElement;if(
thisElement<otherElement){lastElement=thisElement;++thisIdx}else if(otherElement<thisElement){
zeroBit=!zeroBit;++otherIdx}else{zeroBit=!zeroBit;++thisIdx;++otherIdx}
var nextResultValue=resultValue;if(thisIdx<this._spanlist.length){
nextResultValue=zeroBit?0:this._spanlist[thisIdx].value}if(
resultValue!=nextResultValue||lastElement>=maxElement){result._spanlist.push({index:lastElement,
value:resultValue});resultValue=nextResultValue}}return result};
SpanList.prototype.addCustomDataForEachSpan=function(getCustomDataCallback){if(
typeof getCustomDataCallback!="function"){return}var prevIndex=-1;this._spanlist.forEach(function(
span){span.data=getCustomDataCallback(span.index,span.value,span.index-prevIndex);
prevIndex=span.index})};SpanList.prototype.getSpanDataByIndex=function(index){if(
typeof index!="number"){return undefined}var spanid=this._searchByIndex(index);if(spanid==-1){
return undefined}return this._getSpanData(spanid)};
SpanList.prototype.getSpanDataByCustomDataField=function(value,fieldName){if(
typeof value!="number"||typeof fieldName!="string"||!fieldName){return undefined}
var spanid=this._searchByCustomDataField(value,fieldName);if(spanid==-1){return undefined}
return this._getSpanData(spanid)};SpanList.prototype.forEachSpanInRange=function(start,end,callback
){if(typeof start!="number"||typeof end!="number"||typeof callback!="function"||start>end){return}
var id=this._searchByIndex(start);if(id==-1)return;do{var span=this._getSpanData(id++);callback(span
)}while(id<this._spanlist.length&&span.index<=end)};SpanList.prototype.forEachSpan=function(callback
){for(var id=0;id<this._spanlist.length;++id){callback(this._getSpanData(id))}};
SpanList.prototype._getSpanData=function(spanid){var span=this._spanlist[spanid];var clone={
index:span.index,value:span.value,data:span.data,start:spanid>0?this._spanlist[spanid-1].index+1:0,
end:span.index,size:span.value};return clone};SpanList.prototype._searchByIndex=function(index){
return binarySearch(this._spanlist,index,function directionProvider(testIndex,prevSpan,curSpan){
var spanStart=prevSpan?prevSpan.index+1:0;var spanEnd=curSpan.index;
return testIndex<spanStart?-1:spanEnd<testIndex?1:0})};
SpanList.prototype._searchByCustomDataField=function(value,fieldName){return binarySearch(
this._spanlist,value,function directionProvider(testValue,prevSpan,curSpan,nextSpan){
var valueStart=prevSpan?prevSpan.data[fieldName]:0;var valueEnd=curSpan.data[fieldName]-(
nextSpan?1:0);if(valueStart===undefined||valueEnd===undefined){return-1}
return testValue<valueStart?-1:valueEnd<testValue?1:0},true)};return SpanList}();
var BoolSpanList=function(){function BoolSpanList(encoding){this._spanlist=[];this._startBit=false;
if(typeof encoding!=="string"){return}this.load(encoding)}BoolSpanList.prototype.load=function(
encoding){if(typeof encoding!=="string"){return false}var result=parseSpanListEncoding(encoding,true
);if(result===undefined){return false}this._spanlist=result.spanlist;this._startBit=result.startBit;
return true};BoolSpanList.prototype.union=function(other){if(!(other instanceof BoolSpanList)){
return undefined}if(this._spanlist[this._spanlist.length-1]!==other._spanlist[
other._spanlist.length-1]){return undefined}var maxElement=this._spanlist[this._spanlist.length-1];
var result=new BoolSpanList;var thisBit=this._startBit;var otherBit=other._startBit;
var resultBit=thisBit||otherBit;result._startBit=resultBit;var thisIdx=0;var otherIdx=0;while(
thisIdx<this._spanlist.length&&otherIdx<other._spanlist.length){var thisElement=this._spanlist[
thisIdx];var otherElement=other._spanlist[otherIdx];var lastElement=otherElement;if(
thisElement<otherElement){lastElement=thisElement;thisBit=!thisBit;++thisIdx}else if(
otherElement<thisElement){otherBit=!otherBit;++otherIdx}else{thisBit=!thisBit;otherBit=!otherBit;
++thisIdx;++otherIdx}var nextResultBit=thisBit||otherBit;if(
resultBit!=nextResultBit||lastElement>=maxElement){result._spanlist.push(lastElement);
resultBit=nextResultBit}}return result};return BoolSpanList}();function parseSpanListEncoding(
encoding,booleanValue){var spanlist=[];var boolspanlist=[];var splits=encoding.split(" ");if(
splits.length<2){return undefined}var startBitInt=0;if(booleanValue){var parts=splits[0].split(":");
if(parts.length!=2){return undefined}startBitInt=parseInt(parts[0]);var first=parseInt(parts[1]);if(
isNaN(startBitInt)||isNaN(first)){return undefined}boolspanlist.push(first)}var startBit=Boolean(
startBitInt);for(var idx=0;idx<splits.length-1;++idx){if(booleanValue){if(!idx){continue}
var entry=parseInt(splits[idx]);if(isNaN(entry)){return undefined}boolspanlist.push(entry);continue}
var spanParts=splits[idx].split(":");if(spanParts.length!=2){return undefined}var span={
index:parseInt(spanParts[1]),value:parseInt(spanParts[0])};if(isNaN(span.index)||isNaN(span.value)){
return undefined}spanlist.push(span)}if(booleanValue){return{spanlist:boolspanlist,startBit:startBit
}}return{spanlist:spanlist}}var DimensionOutlines=function(){function DimensionOutlines(encoding){
this._outlines=[];if(typeof encoding!=="string"){return}this.load(encoding)}
DimensionOutlines.prototype.load=function(encoding){if(typeof encoding!=="string"){return false}
var levels=encoding.split(" ");if(levels.length<2){this._outlines=[];return true}var outlines=[];
for(var levelIdx=0;levelIdx<levels.length-1;++levelIdx){var collectionSplits=levels[levelIdx].split(
",");var collections=[];if(collectionSplits.length<2){return false}for(
var collIdx=0;collIdx<collectionSplits.length-1;++collIdx){var entrySplits=collectionSplits[collIdx
].split(":");if(entrySplits.length<4){return false}var olineEntry={start:parseInt(entrySplits[0]),
end:parseInt(entrySplits[1]),hidden:parseInt(entrySplits[2]),visible:parseInt(entrySplits[3])};if(
isNaN(olineEntry.start)||isNaN(olineEntry.end)||isNaN(olineEntry.hidden)||isNaN(olineEntry.visible)
){return false}olineEntry.end+=olineEntry.start-1;collections.push(olineEntry)}outlines.push(
collections)}this._outlines=outlines;return true};DimensionOutlines.prototype.getLevels=function(){
return this._outlines.length};DimensionOutlines.prototype.forEachGroupInRange=function(start,end,
callback){if(typeof start!="number"||typeof end!="number"||typeof callback!="function"){return}if(
!this._outlines.length||start>end){return}var directionProvider=function(elementIdx,prevGroup,
curGroup){var direction=elementIdx<curGroup.start?-1:curGroup.end<elementIdx?1:0;if(direction>=0){
return direction}if(!prevGroup||prevGroup.end<elementIdx){return 0}return-1};for(
var levelIdx=this._outlines.length-1;levelIdx>=0;--levelIdx){var groupsInLevel=this._outlines[
levelIdx];var startGroupIdx=binarySearch(groupsInLevel,start,directionProvider);if(startGroupIdx==-1
){continue}var startGroup=groupsInLevel[startGroupIdx];if(end<startGroup.start){continue}for(
var groupIdx=startGroupIdx;groupIdx<groupsInLevel.length;++groupIdx){var group=groupsInLevel[
groupIdx];if(end<group.start){continue}callback(levelIdx,groupIdx,group.start,group.end,group.hidden
)}}};return DimensionOutlines}();cool.DimensionOutlines=DimensionOutlines;function binarySearch(
array,key,directionProvider,firstMatch){if(firstMatch===void 0){firstMatch=false}if(!Array.isArray(
array)||!array.length){return-1}if(typeof directionProvider!="function"){directionProvider=function(
key,prevvalue,testvalue){return key===testvalue?0:key<testvalue?-1:1}}firstMatch=firstMatch===true;
var start=0;var end=array.length-1;var startDir=directionProvider(key,undefined,array[0],array[1]);
if(startDir<=0){return startDir}var endDir=directionProvider(key,array[end-1],array[end]);if(
endDir>=0){if(endDir===1){return-1}return firstMatch?_findFirstMatch(array,key,directionProvider,end
):end}var mid=-1;while(start<=end){mid=Math.round((start+end)/2);var direction=directionProvider(key
,array[mid-1],array[mid],array[mid+1]);if(direction==0){break}if(direction==-1){end=mid-1}else{
start=mid+1}}return start>end?-1:firstMatch?_findFirstMatch(array,key,directionProvider,mid):mid}
function _findFirstMatch(array,key,directionProvider,randomMatchingIndex){if(randomMatchingIndex===0
){return 0}var index=randomMatchingIndex-1;while(index>=0&&directionProvider(key,array[index-1],
array[index],array[index+1])==0){--index}return index+1}})(cool||(cool={}));var cool;(function(cool
){var RawDelta=function(){function RawDelta(delta,id,isKeyframe){this._delta=delta;this._id=id;
this._isKeyframe=isKeyframe}Object.defineProperty(RawDelta.prototype,"length",{get:function(){
return this.delta.length},enumerable:false,configurable:true});Object.defineProperty(
RawDelta.prototype,"delta",{get:function(){return this._delta},enumerable:false,configurable:true});
Object.defineProperty(RawDelta.prototype,"id",{get:function(){return this._id},enumerable:false,
configurable:true});Object.defineProperty(RawDelta.prototype,"isKeyframe",{get:function(){
return this._isKeyframe},enumerable:false,configurable:true});return RawDelta}();
cool.RawDelta=RawDelta;var CanvasTileUtils=function(){function CanvasTileUtils(){}
CanvasTileUtils.unrle=function(data,width,height,output,outputOffset){if(outputOffset===void 0){
outputOffset=0}var offset=0;for(var y=0;y<height;++y){var rleSize=data[offset]+data[offset+1]*256;
offset+=2;var rleMask=offset;var rleMaskSizeBytes=256/8;offset+=rleMaskSizeBytes;
this.lastPixel.fill(0);var lastMask=0;var bitToCheck=256;var rleMaskOffset=rleMask;
var pixOffset=y*width*4+outputOffset;var pixSrc=offset;for(var x=0;x<width;++x){if(bitToCheck>128){
bitToCheck=1;lastMask=data[rleMaskOffset++]}if(!(lastMask&bitToCheck)){this.lastPixel[0]=data[pixSrc
];this.lastPixel[1]=data[pixSrc+1];this.lastPixel[2]=data[pixSrc+2];this.lastPixel[3]=data[pixSrc+3]
pixSrc+=4}bitToCheck=bitToCheck<<1;output.set(this.lastPixel,pixOffset);pixOffset+=4}
offset+=rleSize*4}return offset};CanvasTileUtils.updateImageFromDeltas=function(imageData,deltas,
keyframeDeltaSize,tileSize,debug){if(debug===void 0){debug=false}var nDelta=0;
var offset=keyframeDeltaSize;while(offset<deltas.length){if(debug)console.debug(
"Next delta at "+offset+" length "+(deltas.length-offset));var delta=!offset?deltas:deltas.subarray(
offset);var susDeltaSize=tileSize*tileSize*4;if(debug&&delta.length>=susDeltaSize){console.warn(
"Unusual delta possibly mis-tagged, suspicious size vs. type "+delta.length+" vs. "+susDeltaSize)}
var oldData=new Uint8Array(imageData);if(debug)console.debug(
"Applying delta chunk "+nDelta+++" of total size "+delta.length+" at stream offset "+offset);
var len=this.applyDeltaChunk(imageData,delta,oldData,tileSize,tileSize,debug);if(debug
)console.debug("Applied delta chunk of size "+len);offset+=len}};
CanvasTileUtils.applyDeltaChunk=function(imgData,delta,oldData,width,height,debug){if(debug===void 0
){debug=false}var pixSize=width*height*4;var offset=0;if(0){for(var i_1=0;i_1<pixSize;++i_1)oldData[
i_1*4+1]=128}if(0){for(var i_2=0;i_2<pixSize*4;++i_2)imgData[i_2]=128}var i=0;for(
var stop_1=false;i<delta.length&&!stop_1;){switch(delta[i]){case 99:{var count=delta[i+1];
var srcRow=delta[i+2];var destRow=delta[i+3];if(debug)console.debug(
"["+i+"]: copy "+count+" row(s) "+srcRow+" to "+destRow);i+=4;for(var cnt=0;cnt<count;++cnt){
var src=(srcRow+cnt)*width*4;var dest=(destRow+cnt)*width*4;for(var j=0;j<width*4;++j){imgData[
dest+j]=oldData[src+j]}}break}case 100:{var destRow=delta[i+1];var destCol=delta[i+2];
var span=delta[i+3];offset=destRow*width*4+destCol*4;if(debug)console.debug(
"["+i+"]: apply new span of size "+span+" at pos "+destCol+", "+destRow+" into delta at byte: "+offset
);i+=4;span*=4;for(var j=0;j<span;++j)imgData[offset++]=delta[i+j];i+=span;break}case 116:{
stop_1=true;i++;break}default:{console.error("["+i+"]: ERROR: Unknown delta code "+delta[i]);
i=delta.length;break}}}return i};CanvasTileUtils.lastPixel=new Uint8Array(4);return CanvasTileUtils
}();cool.CanvasTileUtils=CanvasTileUtils})(cool||(cool={}));app.CSections.Debug={};
app.CSections.CommentList={name:"comment list",zIndex:5};app.CSections.Tiles={name:"tiles",zIndex:5}
app.CSections.Overlays={name:"overlay",zIndex:5};app.CSections.CalcGrid={name:"calc grid",zIndex:5};
app.CSections.Debug.Splits={name:"splits",zIndex:5};app.CSections.Debug.TilePixelGrid={
name:"tile pixel grid",zIndex:5};app.CSections.Debug.DebugOverlay={name:"debug overlay",zIndex:5};
app.CSections.Debug.PreloadMap={name:"preload map",zIndex:5};app.CSections.ColumnHeader={
name:"column header",zIndex:5};app.CSections.RowHeader={name:"row header",zIndex:5};
app.CSections.Splitter={name:"splitter",zIndex:5};app.CSections.CornerHeader={name:"corner header",
zIndex:5};app.CSections.OtherViewCellCursor={zIndex:5};app.CSections.ColumnGroup={
name:"column group",zIndex:5};app.CSections.RowGroup={name:"row group",zIndex:5};
app.CSections.CornerGroup={name:"corner group",zIndex:5};app.CSections.Comment={name:"comment",
zIndex:7};app.CSections.AutoFillMarker={name:"auto fill marker",zIndex:5};app.CSections.CellCursor={
name:"OwnCellCursor",zIndex:5};app.CSections.FocusCell={name:"focus cell",zIndex:5};
app.CSections.DefaultForDocumentObjects={zIndex:9};app.CSections.HTMLObject={zIndex:9};
app.CSections.ContentControl={name:"content control",zIndex:11};app.CSections.CalcValidityDropDown={
name:"calc validity dropdown",zIndex:11};app.CSections.Scroll={name:"scroll",zIndex:13};
app.CSections.CommentList.processingOrder=24;app.CSections.CornerGroup.processingOrder=25;
app.CSections.RowGroup.processingOrder=27;app.CSections.ColumnGroup.processingOrder=29;
app.CSections.CornerHeader.processingOrder=30;app.CSections.RowHeader.processingOrder=40;
app.CSections.ColumnHeader.processingOrder=50;app.CSections.Tiles.processingOrder=60;
app.CSections.FocusCell.processingOrder=61;app.CSections.OtherViewCellCursor.processingOrder=62;
app.CSections.CellCursor.processingOrder=63;app.CSections.AutoFillMarker.processingOrder=64;
app.CSections.Overlays.processingOrder=65;app.CSections.Debug.TilePixelGrid.processingOrder=66;
app.CSections.Debug.DebugOverlay.processingOrder=67;
app.CSections.Debug.PreloadMap.processingOrder=68;app.CSections.CalcGrid.processingOrder=69;
app.CSections.Debug.Splits.processingOrder=70;app.CSections.Splitter.processingOrder=80;
app.CSections.CalcGrid.drawingOrder=40;app.CSections.Tiles.drawingOrder=50;
app.CSections.CommentList.drawingOrder=55;app.CSections.Debug.TilePixelGrid.drawingOrder=60;
app.CSections.Debug.DebugOverlay.drawingOrder=60;app.CSections.Debug.PreloadMap.drawingOrder=60;
app.CSections.Overlays.drawingOrder=71;app.CSections.Debug.Splits.drawingOrder=90;
app.CSections.FocusCell.drawingOrder=91;app.CSections.OtherViewCellCursor.drawingOrder=92;
app.CSections.CellCursor.drawingOrder=93;app.CSections.AutoFillMarker.drawingOrder=94;
app.CSections.RowGroup.drawingOrder=100;app.CSections.ColumnGroup.drawingOrder=110;
app.CSections.CornerGroup.drawingOrder=120;app.CSections.CornerHeader.drawingOrder=130;
app.CSections.RowHeader.drawingOrder=140;app.CSections.ColumnHeader.drawingOrder=150;
app.CSections.Splitter.drawingOrder=160;app.CSections.Comment.processingOrder=1;
app.CSections.Comment.drawingOrder=1;app.CSections.HTMLObject.drawingOrder=55;
app.CSections.HTMLObject.processingOrder=1;
app.CSections.DefaultForDocumentObjects.processingOrder=10;
app.CSections.DefaultForDocumentObjects.drawingOrder=10;
app.CSections.ContentControl.processingOrder=1;app.CSections.ContentControl.drawingOrder=1;
app.CSections.Scroll.processingOrder=1;app.CSections.Scroll.drawingOrder=1;
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var __spreadArray=this&&this.__spreadArray||function(to,from,pack){
if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar
)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var CanvasSectionContainer=function(){
function CanvasSectionContainer(canvasDOMElement,disableDrawing){this.sections=new Array(0);
this.sectionsByName=new Map;this.needsResize=false;this.positionOnMouseDown=null;
this.positionOnMouseUp=null;this.positionOnClick=null;this.positionOnDoubleClick=null;
this.mousePosition=null;this.dragDistance=null;this.draggingSomething=false;
this.sectionOnMouseDown=null;this.sectionUnderMouse=null;this.draggingTolerance=5;
this.multiTouch=false;this.touchCenter=null;this.longPressTimer=null;this.clearColor="#f8f9fa";
this.documentBackgroundColor="#ffffff";this.useCSSForBackgroundColor=true;
this.touchEventInProgress=false;this.testing=false;this.lowestPropagatedBoundSection=null;
this.targetSection=null;this.activeSection=null;this.scrollLineHeight=30;this.mouseIsInside=false;
this.inZoomAnimation=false;this.zoomChanged=false;this.documentAnchorSectionName=null;
this.documentAnchor=null;this.drawRequest=null;this.drawingPaused=0;this.drawingEnabled=true;
this.sectionsDirty=false;this.framesRendered=0;this.windowSectionList=[];
this.animatingSectionName=null;this.lastFrameStamp=null;this.continueAnimating=null;
this.frameCount=null;this.duration=null;this.elapsedTime=null;this.canvas=canvasDOMElement;
this.context=canvasDOMElement.getContext("2d",{alpha:false});this.context.setTransform(1,0,0,1,0,0);
document.addEventListener("mousemove",this.onMouseMove.bind(this));
this.canvas.onmousedown=this.onMouseDown.bind(this);document.addEventListener("mouseup",
this.onMouseUp.bind(this));this.canvas.onclick=this.onClick.bind(this);
this.canvas.ondblclick=this.onDoubleClick.bind(this);
this.canvas.oncontextmenu=this.onContextMenu.bind(this);this.canvas.onwheel=this.onMouseWheel.bind(
this);this.canvas.onmouseleave=this.onMouseLeave.bind(this);
this.canvas.onmouseenter=this.onMouseEnter.bind(this);
this.canvas.ontouchstart=this.onTouchStart.bind(this);this.canvas.ontouchmove=this.onTouchMove.bind(
this);this.canvas.ontouchend=this.onTouchEnd.bind(this);
this.canvas.ontouchcancel=this.onTouchCancel.bind(this);var tempElement=document.createElement("div"
);tempElement.style.fontSize="initial";tempElement.style.display="none";document.body.appendChild(
tempElement);this.scrollLineHeight=parseInt(window.getComputedStyle(tempElement).fontSize);
document.body.removeChild(tempElement);this.clearColor=window.getComputedStyle(
document.documentElement).getPropertyValue("--color-canvas");
this.documentBackgroundColor=window.getComputedStyle(document.documentElement).getPropertyValue(
"--color-background-document");if(disableDrawing){this.clearColor=this.documentBackgroundColor;
this.disableDrawing()}}CanvasSectionContainer.prototype.clearCanvas=function(){
this.context.fillStyle=this.clearColor;this.context.clearRect(0,0,this.canvas.width,
this.canvas.height);this.context.fillRect(0,0,this.canvas.width,this.canvas.height)};
CanvasSectionContainer.prototype.getContext=function(){return this.context};
CanvasSectionContainer.prototype.setDocumentAnchorSection=function(sectionName){
var section=this.getSectionWithName(sectionName);if(section){
this.documentAnchorSectionName=sectionName}else{this.documentAnchorSectionName=null;
this.documentAnchor=null}};CanvasSectionContainer.prototype.getDocumentAnchorSection=function(){
return this.getSectionWithName(this.documentAnchorSectionName)};
CanvasSectionContainer.prototype.getViewSize=function(){return[this.width,this.height]};
CanvasSectionContainer.prototype.setBackgroundColorMode=function(useCSSVars){if(useCSSVars===void 0
){useCSSVars=true}this.useCSSForBackgroundColor=useCSSVars};
CanvasSectionContainer.prototype.setClearColor=function(color){if(!this.useCSSForBackgroundColor
)this.clearColor=color};CanvasSectionContainer.prototype.getClearColor=function(){
return this.clearColor};CanvasSectionContainer.prototype.setDocumentBackgroundColor=function(color){
this.documentBackgroundColor=color};
CanvasSectionContainer.prototype.getDocumentBackgroundColor=function(){
return this.documentBackgroundColor};CanvasSectionContainer.prototype.getCanvasStyle=function(){
return this.canvas.style};CanvasSectionContainer.prototype.setInZoomAnimation=function(
inZoomAnimation){this.inZoomAnimation=inZoomAnimation};
CanvasSectionContainer.prototype.isInZoomAnimation=function(){return this.inZoomAnimation};
CanvasSectionContainer.prototype.setZoomChanged=function(zoomChanged){this.zoomChanged=zoomChanged};
CanvasSectionContainer.prototype.isZoomChanged=function(){return this.zoomChanged};
CanvasSectionContainer.prototype.drawingAllowed=function(){
return this.drawingEnabled&&this.drawingPaused<=0};
CanvasSectionContainer.prototype.disableDrawing=function(){if(this.drawRequest){
cancelAnimationFrame(this.drawRequest);this.drawRequest=null}this.drawingEnabled=false};
CanvasSectionContainer.prototype.enableDrawing=function(){if(this.drawingEnabled)return;
this.drawingEnabled=true;if(this.drawingPaused===0){this.paintOnResumeOrEnable()}};
CanvasSectionContainer.prototype.pauseDrawing=function(){if(this.drawRequest){cancelAnimationFrame(
this.drawRequest);this.drawRequest=null}this.drawingPaused++};
CanvasSectionContainer.prototype.resumeDrawing=function(topLevel){
var wasNonZero=this.drawingPaused!==0;if(topLevel)this.drawingPaused=0;else if(this.drawingPaused>0
)this.drawingPaused--;if(this.drawingEnabled&&wasNonZero&&this.drawingPaused===0){
this.paintOnResumeOrEnable()}};CanvasSectionContainer.prototype.paintOnResumeOrEnable=function(){if(
this.sectionsDirty){this.updateBoundSectionLists();this.reNewAllSections(false);
this.sectionsDirty=false}var scrollSection=this.getSectionWithName(app.CSections.Scroll.name);if(
scrollSection)scrollSection.completePendingScroll();this.requestReDraw()};
CanvasSectionContainer.prototype.clearMousePositions=function(){
this.positionOnClick=this.positionOnDoubleClick=this.positionOnMouseDown=this.positionOnMouseUp=this.dragDistance=this.sectionOnMouseDown=null
this.touchCenter=null;this.draggingSomething=false;this.touchEventInProgress=false;
this.lowestPropagatedBoundSection=null;this.targetSection=null};
CanvasSectionContainer.prototype.convertPositionToSectionLocale=function(section,point){return[
point[0]-section.myTopLeft[0],point[1]-section.myTopLeft[1]]};
CanvasSectionContainer.prototype.convertPositionToCanvasLocale=function(e){
var rect=this.canvas.getBoundingClientRect();var x,y;if(e.touches!==undefined&&e.touches.length>0){
x=e.touches[0].clientX-rect.left;y=e.touches[0].clientY-rect.top}else if(
e.changedTouches!==undefined&&e.changedTouches.length>0){x=e.changedTouches[0].clientX-rect.left;
y=e.changedTouches[0].clientY-rect.top}else{x=e.clientX-rect.left;y=e.clientY-rect.top}return[
Math.round(x*app.dpiScale),Math.round(y*app.dpiScale)]};
CanvasSectionContainer.prototype.convertPointToCanvasLocale=function(point){
var rect=this.canvas.getBoundingClientRect();var x,y;x=point[0]-rect.left;y=point[1]-rect.top;
return[Math.round(x*app.dpiScale),Math.round(y*app.dpiScale)]};
CanvasSectionContainer.prototype.getSectionWithName=function(name){if(name){
var section=this.sectionsByName.get(name);if(section){return section}return null}else{return null}};
CanvasSectionContainer.prototype.getDocumentAnchor=function(){return[this.documentAnchor[0],
this.documentAnchor[1]]};CanvasSectionContainer.prototype.getCanvasBoundingClientRect=function(){
return this.canvas.getBoundingClientRect()};CanvasSectionContainer.prototype.getWidth=function(){
return this.width};CanvasSectionContainer.prototype.getHeight=function(){return this.height};
CanvasSectionContainer.prototype.isDraggingSomething=function(){return this.draggingSomething};
CanvasSectionContainer.prototype.getDragDistance=function(){return __spreadArray([],__read(
this.dragDistance),false)};CanvasSectionContainer.prototype.getPositionOnMouseUp=function(){
return __spreadArray([],__read(this.positionOnMouseUp),false)};
CanvasSectionContainer.prototype.isDocumentObjectVisible=function(section){
return app.isRectangleVisibleInTheDisplayedArea([Math.round(section.position[0]*app.pixelsToTwips),
Math.round(section.position[1]*app.pixelsToTwips),Math.round(section.size[0]*app.pixelsToTwips),
Math.round(section.size[1]*app.pixelsToTwips)])};
CanvasSectionContainer.prototype.targetBoundSectionListContains=function(sectionName){if(
!this.targetSection)return false;else{var section=this.getSectionWithName(this.targetSection);if(
section&&section.boundsList){for(var i=0;i<section.boundsList.length;i++){if(section.boundsList[i
].name===sectionName)return true}return false}else return false}};
CanvasSectionContainer.prototype.updateBoundSectionList=function(section,sectionList){if(
sectionList===void 0){sectionList=null}if(sectionList===null)sectionList=new Array(0);
sectionList.push(section);var tempSectionList=new Array(0);if(section.boundToSection){
var tempSection=this.getSectionWithName(section.boundToSection);if(
tempSection&&tempSection.isLocated){if(!sectionList.includes(tempSection))tempSectionList.push(
tempSection)}}for(var i=0;i<this.sections.length;i++){if(this.sections[i].isLocated&&this.sections[i
].boundToSection===section.name){if(!sectionList.includes(this.sections[i]))tempSectionList.push(
this.sections[i])}}for(var i=0;i<tempSectionList.length;i++){this.updateBoundSectionList(
tempSectionList[i],sectionList)}return sectionList};
CanvasSectionContainer.prototype.orderBoundsList=function(section){for(
var i=0;i<section.boundsList.length-1;i++){for(var j=i+1;j<section.boundsList.length;j++){if(
section.boundsList[i].zIndex>section.boundsList[j].zIndex||section.boundsList[i
].zIndex===section.boundsList[j].zIndex&&section.boundsList[i].drawingOrder>section.boundsList[j
].drawingOrder){var temp=section.boundsList[i];section.boundsList[i]=section.boundsList[j];
section.boundsList[j]=temp}}}for(var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i
].name!==section.name){section.boundsList.splice(i,1)}else{break}}};
CanvasSectionContainer.prototype.updateBoundSectionLists=function(){for(
var i=0;i<this.sections.length;i++){this.sections[i].boundsList=null;this.sections[i
].boundsList=this.updateBoundSectionList(this.sections[i]);this.orderBoundsList(this.sections[i])}};
CanvasSectionContainer.prototype.flushLayoutingTasks=function(){
var layoutingService=app.layoutingService;if(layoutingService.hasTasksPending()
)layoutingService.cancelFrame();while(layoutingService.runTheTopTask());};
CanvasSectionContainer.prototype.resizeCanvas=function(){if(!this.needsResize){return}
this.needsResize=false;this.canvas.width=this.width;this.canvas.height=this.height;
var cssWidth=this.width/app.dpiScale;var cssHeight=this.height/app.dpiScale;
this.canvas.style.width=cssWidth.toFixed(4)+"px";this.canvas.style.height=cssHeight.toFixed(4)+"px";
this.clearCanvas()};CanvasSectionContainer.prototype.redrawCallback=function(timestamp){
this.drawRequest=null;this.resizeCanvas();this.drawSections();this.flushLayoutingTasks();
this.canvas.style.visibility="unset"};CanvasSectionContainer.prototype.requestReDraw=function(){if(
!this.drawingAllowed())return;if(this.drawRequest===null)this.drawRequest=requestAnimationFrame(
this.redrawCallback.bind(this))};
CanvasSectionContainer.prototype.propagateCursorPositionChanged=function(){var propagate=true;for(
var j=0;j<this.windowSectionList.length;j++){var windowSection=this.windowSectionList[j];if(
windowSection.interactable)windowSection.onCursorPositionChanged(
app.file.textCursor.rectangle.clone());if(this.lowestPropagatedBoundSection===windowSection.name
)propagate=false}if(propagate){for(var i=this.sections.length-1;i>-1;i--){if(this.sections[i
].interactable)this.sections[i].onCursorPositionChanged(app.file.textCursor.rectangle.clone())}}};
CanvasSectionContainer.prototype.propagateCellAddressChanged=function(){var propagate=true;for(
var j=0;j<this.windowSectionList.length;j++){var windowSection=this.windowSectionList[j];
windowSection.onCellAddressChanged();if(this.lowestPropagatedBoundSection===windowSection.name
)propagate=false}if(propagate){for(var i=this.sections.length-1;i>-1;i--){this.sections[i
].onCellAddressChanged()}}};CanvasSectionContainer.prototype.propagateOnClick=function(section,
position,e){this.targetSection=section.name;var propagate=true;
var windowPosition=position?cool.SimplePoint.fromCorePixels([position[0]+section.myTopLeft[0],
position[1]+section.myTopLeft[1]]):null;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable)windowSection.onClick(
windowPosition,e);if(this.lowestPropagatedBoundSection===windowSection.name)propagate=false}if(
propagate){for(var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i].interactable
)section.boundsList[i].onClick(position?cool.SimplePoint.fromCorePixels([position[0],position[1]]
):null,e);if(section.boundsList[i].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnDoubleClick=function(section,position,e){
this.targetSection=section.name;var propagate=true;
var windowPosition=position?cool.SimplePoint.fromCorePixels([position[0]+section.myTopLeft[0],
position[1]+section.myTopLeft[1]]):null;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable
)windowSection.onDoubleClick(windowPosition,e);if(
this.lowestPropagatedBoundSection===windowSection.name)propagate=false}if(propagate){for(
var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i].interactable
)section.boundsList[i].onDoubleClick(position?cool.SimplePoint.fromCorePixels([position[0],position[
1]]):null,e);if(section.boundsList[i].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnMouseLeave=function(section,position,e){
this.targetSection=section.name;var windowPosition=position?cool.SimplePoint.fromCorePixels([
position[0]+section.myTopLeft[0],position[1]+section.myTopLeft[1]]):null;if(!windowPosition){for(
var j=0;j<this.windowSectionList.length;j++){var windowSection=this.windowSectionList[j];if(
windowSection.interactable)windowSection.onMouseLeave(windowPosition,e)}}for(
var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i].interactable
)section.boundsList[i].onMouseLeave(position?cool.SimplePoint.fromCorePixels([position[0],position[1
]]):null,e);if(section.boundsList[i].name===this.lowestPropagatedBoundSection)break}};
CanvasSectionContainer.prototype.propagateOnMouseEnter=function(section,position,e){
this.targetSection=section.name;for(var i=section.boundsList.length-1;i>-1;i--){if(
section.boundsList[i].interactable)section.boundsList[i].onMouseEnter(
position?cool.SimplePoint.fromCorePixels([position[0],position[1]]):null,e);if(section.boundsList[i
].name===this.lowestPropagatedBoundSection)break}};
CanvasSectionContainer.prototype.propagateOnMouseMove=function(section,position,dragDistance,e){
this.targetSection=section.name;var propagate=true;
var windowPosition=position?cool.SimplePoint.fromCorePixels([position[0]+section.myTopLeft[0],
position[1]+section.myTopLeft[1]]):null;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable)windowSection.onMouseMove(
windowPosition,dragDistance,e);if(this.lowestPropagatedBoundSection===windowSection.name
)propagate=false}if(propagate){for(var i=section.boundsList.length-1;i>-1;i--){if(
section.boundsList[i].interactable)section.boundsList[i].onMouseMove(
position?cool.SimplePoint.fromCorePixels([position[0],position[1]]):null,dragDistance,e);if(
section.boundsList[i].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnMouseDown=function(section,position,e){
this.targetSection=section.name;var propagate=true;
var windowPosition=position?cool.SimplePoint.fromCorePixels([position[0]+section.myTopLeft[0],
position[1]+section.myTopLeft[1]]):null;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable)windowSection.onMouseDown(
windowPosition,e);if(this.lowestPropagatedBoundSection===windowSection.name)propagate=false}if(
propagate){for(var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i].interactable
)section.boundsList[i].onMouseDown(position?cool.SimplePoint.fromCorePixels([position[0],position[1]
]):null,e);if(section.boundsList[i].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnMouseUp=function(section,position,e){
this.targetSection=section.name;var propagate=true;
var windowPosition=position?cool.SimplePoint.fromCorePixels([position[0]+section.myTopLeft[0],
position[1]+section.myTopLeft[1]]):null;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable)windowSection.onMouseUp(
windowPosition,e);if(this.lowestPropagatedBoundSection===windowSection.name)propagate=false}if(
propagate){for(var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i].interactable
)section.boundsList[i].onMouseUp(position?cool.SimplePoint.fromCorePixels([position[0],position[1]]
):null,e);if(section.boundsList[i].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnContextMenu=function(section,e){
this.targetSection=section.name;var propagate=true;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable
)windowSection.onContextMenu(e);if(this.lowestPropagatedBoundSection===windowSection.name
)propagate=false}if(propagate){for(var i=section.boundsList.length-1;i>-1;i--){if(
section.boundsList[i].interactable)section.boundsList[i].onContextMenu(e);if(section.boundsList[i
].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnMouseWheel=function(section,position,delta,e){
this.targetSection=section.name;var propagate=true;
var windowPosition=position?cool.SimplePoint.fromCorePixels([position[0]+section.myTopLeft[0],
position[1]+section.myTopLeft[1]]):null;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable
)windowSection.onMouseWheel(windowPosition,delta,e);if(
this.lowestPropagatedBoundSection===windowSection.name)propagate=false}if(propagate){for(
var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i].interactable
)section.boundsList[i].onMouseWheel(position?cool.SimplePoint.fromCorePixels([position[0],position[1
]]):null,delta,e);if(section.boundsList[i].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnMultiTouchStart=function(section,e){
this.targetSection=section.name;var propagate=true;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable
)windowSection.onMultiTouchStart(e);if(this.lowestPropagatedBoundSection===windowSection.name
)propagate=false}if(propagate){for(var i=section.boundsList.length-1;i>-1;i--){if(
section.boundsList[i].interactable)section.boundsList[i].onMultiTouchStart(e);if(section.boundsList[
i].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.propagateOnMultiTouchMove=function(section,position,distance,e){
this.targetSection=section.name;var propagate=true;
var windowPosition=position?cool.SimplePoint.fromCorePixels([position[0]+section.myTopLeft[0],
position[1]+section.myTopLeft[1]]):null;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable
)windowSection.onMultiTouchMove(windowPosition,distance,e);if(
this.lowestPropagatedBoundSection===windowSection.name)propagate=false}if(propagate){for(
var i=section.boundsList.length-1;i>-1;i--){if(section.boundsList[i].interactable
)section.boundsList[i].onMultiTouchMove(position?cool.SimplePoint.fromCorePixels([position[0],
position[1]]):null,distance,e);if(section.boundsList[i].name===this.lowestPropagatedBoundSection
)break}}};CanvasSectionContainer.prototype.propagateOnMultiTouchEnd=function(section,e){
this.targetSection=section.name;var propagate=true;for(var j=0;j<this.windowSectionList.length;j++){
var windowSection=this.windowSectionList[j];if(windowSection.interactable
)windowSection.onMultiTouchEnd(e);if(this.lowestPropagatedBoundSection===windowSection.name
)propagate=false}if(propagate){for(var i=section.boundsList.length-1;i>-1;i--){if(
section.boundsList[i].interactable)section.boundsList[i].onMultiTouchEnd(e);if(section.boundsList[i
].name===this.lowestPropagatedBoundSection)break}}};
CanvasSectionContainer.prototype.onCursorPositionChanged=function(){if(
app.map._docLayer._docType==="text"){this.propagateCursorPositionChanged()}};
CanvasSectionContainer.prototype.onNewDocumentTopLeft=function(){for(
var i=0;i<this.sections.length;i++){var section=this.sections[i];if(section.documentObject===true){
section.myTopLeft=[this.documentAnchor[0]+section.position[0]-(app.isXOrdinateInFrozenPane(
section.position[0])?0:app.activeDocument.activeView.viewedRectangle.pX1),this.documentAnchor[1
]+section.position[1]-(app.isYOrdinateInFrozenPane(section.position[1]
)?0:app.activeDocument.activeView.viewedRectangle.pY1)];var isVisible=this.isDocumentObjectVisible(
section);if(isVisible!==section.isVisible){section.isVisible=isVisible;
section.onDocumentObjectVisibilityChange()}if(this.testing)this.createUpdateSingleDivElement(section
)}this.sections[i].onNewDocumentTopLeft()}};
CanvasSectionContainer.prototype.onCellAddressChanged=function(){if(
app.map._docLayer._docType==="spreadsheet"){this.propagateCellAddressChanged()}};
CanvasSectionContainer.prototype.onClick=function(e){if(!this.draggingSomething){if(
this.positionOnMouseDown!==null&&this.positionOnMouseUp!==null){
this.positionOnClick=this.convertPositionToCanvasLocale(e);var s1=this.findSectionContainingPoint(
this.positionOnMouseDown);var s2=this.findSectionContainingPoint(this.positionOnMouseUp);if(
s1&&s2&&s1==s2){var section=this.findSectionContainingPoint(this.positionOnClick);if(section){
this.propagateOnClick(section,this.convertPositionToSectionLocale(section,this.positionOnClick),e)}}
}this.requestReDraw()}this.clearMousePositions()};
CanvasSectionContainer.prototype.onDoubleClick=function(e){
this.positionOnDoubleClick=this.convertPositionToCanvasLocale(e);
var section=this.findSectionContainingPoint(this.positionOnDoubleClick);if(section){
this.propagateOnDoubleClick(section,this.convertPositionToSectionLocale(section,
this.positionOnDoubleClick),e)}this.clearMousePositions();this.requestReDraw()};
CanvasSectionContainer.prototype.isLongPressActive=function(){return!!this.longPressTimer};
CanvasSectionContainer.prototype.startLongPress=function(e){this.stopLongPress();
this.longPressTimer=setTimeout(function(){e.clientX=e.touches[0].clientX;e.clientY=e.touches[0
].clientY;this.onMouseMove(e)}.bind(this),550)};
CanvasSectionContainer.prototype.stopLongPress=function(){if(this.longPressTimer){clearTimeout(
this.longPressTimer);this.longPressTimer=null}};
CanvasSectionContainer.prototype.onMouseMove=function(e){if(
!this.mouseIsInside&&!this.draggingSomething)return;if(!this.isLongPressActive()){if(
!this.touchEventInProgress){this.mousePosition=this.convertPositionToCanvasLocale(e);if(
this.positionOnMouseDown!==null&&!this.draggingSomething){var dragDistance=[this.mousePosition[0
]-this.positionOnMouseDown[0],this.mousePosition[1]-this.positionOnMouseDown[1]];if(Math.abs(
dragDistance[0])>=this.draggingTolerance||Math.abs(dragDistance[1])>=this.draggingTolerance){
this.draggingSomething=true}}var section;if(this.draggingSomething){this.dragDistance=[
this.mousePosition[0]-this.positionOnMouseDown[0],this.mousePosition[1]-this.positionOnMouseDown[1]]
section=this.getSectionWithName(this.sectionOnMouseDown)}else{
section=this.findSectionContainingPoint(this.mousePosition)}if(section&&section.boundsList){if(
section.name!==this.sectionUnderMouse){if(this.sectionUnderMouse!==null){
var previousSection=this.getSectionWithName(this.sectionUnderMouse);if(previousSection
)this.propagateOnMouseLeave(previousSection,this.convertPositionToSectionLocale(previousSection,
this.mousePosition),e)}this.sectionUnderMouse=section.name;this.propagateOnMouseEnter(section,
this.convertPositionToSectionLocale(section,this.mousePosition),e)}this.propagateOnMouseMove(section
,this.convertPositionToSectionLocale(section,this.mousePosition),this.dragDistance,e)}else if(
this.sectionUnderMouse!==null){var previousSection=this.getSectionWithName(this.sectionUnderMouse);
if(previousSection)this.propagateOnMouseLeave(previousSection,this.convertPositionToSectionLocale(
previousSection,this.mousePosition),e);this.sectionUnderMouse=null}}}else{
this.mousePosition=this.convertPositionToCanvasLocale(e);
var section=this.findSectionContainingPoint(this.mousePosition);if(section){this.stopLongPress();
this.propagateOnContextMenu(section,e)}}};CanvasSectionContainer.prototype.onMouseDown=function(e){
if(e.button===0&&!this.touchEventInProgress){this.clearMousePositions();
this.positionOnMouseDown=this.convertPositionToCanvasLocale(e);
var section=this.findSectionContainingPoint(this.positionOnMouseDown);if(section){
this.sectionOnMouseDown=section.name;this.propagateOnMouseDown(section,
this.convertPositionToSectionLocale(section,this.positionOnMouseDown),e)}}};
CanvasSectionContainer.prototype.onMouseUp=function(e){if(!this.positionOnMouseDown){
this.clearMousePositions();return}if(e.button===0&&!this.touchEventInProgress){
this.positionOnMouseUp=this.convertPositionToCanvasLocale(e);var section;if(!this.draggingSomething
){section=this.findSectionContainingPoint(this.positionOnMouseUp)}else{
section=this.getSectionWithName(this.sectionOnMouseDown)}if(section){this.propagateOnMouseUp(section
,this.convertPositionToSectionLocale(section,this.positionOnMouseUp),e)}}if(!this.mouseIsInside){
this.clearMousePositions()}};CanvasSectionContainer.prototype.onContextMenu=function(e){
var mousePosition=this.convertPositionToCanvasLocale(e);var section=this.findSectionContainingPoint(
mousePosition);if(section){this.propagateOnContextMenu(section,e)}if(this.isLongPressActive()){
e.preventDefault();e.stopPropagation();return false}};
CanvasSectionContainer.prototype.extendAnimationDuration=function(extendMs){if(
this.getAnimatingSectionName()){this.duration+=extendMs}};
CanvasSectionContainer.prototype.getAnimationDuration=function(){return this.duration};
CanvasSectionContainer.prototype.getScrollLineHeight=function(){return this.scrollLineHeight};
CanvasSectionContainer.prototype.onMouseWheel=function(e){
var point=this.convertPositionToCanvasLocale(e);var delta;if(e.deltaMode===1)delta=[
e.deltaX*this.scrollLineHeight,e.deltaY*this.scrollLineHeight];else delta=[e.deltaX,e.deltaY];
var section=this.findSectionContainingPoint(point);if(section)this.propagateOnMouseWheel(section,
this.convertPositionToSectionLocale(section,point),delta,e);app.idleHandler.notifyActive()};
CanvasSectionContainer.prototype.onMouseLeave=function(e){if(!this.draggingSomething){if(
this.sectionUnderMouse!==null){var section=this.getSectionWithName(this.sectionUnderMouse);if(
section)this.propagateOnMouseLeave(section,null,e);this.sectionUnderMouse=null}
this.clearMousePositions();this.mousePosition=null}this.mouseIsInside=false};
CanvasSectionContainer.prototype.onMouseEnter=function(e){this.mouseIsInside=true;for(
var i=0;i<this.windowSectionList.length;i++){var windowSection=this.windowSectionList[i];if(
windowSection.interactable)windowSection.onMouseEnter(null,e)}};
CanvasSectionContainer.prototype.onTouchStart=function(e){if(e.touches.length===1){
this.clearMousePositions();this.startLongPress(e);
this.positionOnMouseDown=this.convertPositionToCanvasLocale(e);
var section=this.findSectionContainingPoint(this.positionOnMouseDown);if(section){
this.sectionOnMouseDown=section.name;this.propagateOnMouseDown(section,
this.convertPositionToSectionLocale(section,this.positionOnMouseDown),e)}}else if(!this.multiTouch){
this.stopLongPress();this.multiTouch=true;var section=this.getSectionWithName(
this.sectionOnMouseDown);if(section)this.propagateOnMultiTouchStart(section,e)}};
CanvasSectionContainer.prototype.onTouchMove=function(e){if(this.positionOnMouseDown===null)return;
this.stopLongPress();if(!this.multiTouch){this.mousePosition=this.convertPositionToCanvasLocale(e);
this.dragDistance=[this.mousePosition[0]-this.positionOnMouseDown[0],this.mousePosition[1
]-this.positionOnMouseDown[1]];if(Math.pow(this.dragDistance[0],2)+Math.pow(this.dragDistance[1],2
)>.1)this.draggingSomething=true;var section=this.getSectionWithName(this.sectionOnMouseDown);if(
section){this.propagateOnMouseMove(section,this.convertPositionToSectionLocale(section,
this.mousePosition),this.dragDistance,e)}}else if(e.touches.length===2){
var section=this.getSectionWithName(this.sectionOnMouseDown);if(section){var diffX=Math.abs(
e.touches[0].clientX-e.touches[1].clientX);var diffY=Math.abs(e.touches[0].clientY-e.touches[1
].clientY);if(!this.touchCenter){this.touchCenter=[(e.touches[0].clientX+e.touches[1].clientX)*.5,(
e.touches[0].clientY+e.touches[1].clientY)*.5];this.touchCenter=this.convertPointToCanvasLocale(
this.touchCenter)}var distance=Math.sqrt(Math.pow(diffX,2)+Math.pow(diffY,2));
this.propagateOnMultiTouchMove(section,this.convertPositionToSectionLocale(section,this.touchCenter)
,distance,e)}}app.idleHandler.notifyActive()};CanvasSectionContainer.prototype.onTouchEnd=function(e
){this.stopLongPress();if(!this.multiTouch){
this.positionOnMouseUp=this.convertPositionToCanvasLocale(e);var section;if(!this.draggingSomething
){section=this.findSectionContainingPoint(this.positionOnMouseUp)}else{
section=this.getSectionWithName(this.sectionOnMouseDown)}if(section){this.propagateOnMouseUp(section
,this.convertPositionToSectionLocale(section,this.positionOnMouseUp),e)}}else if(
e.touches.length===0){this.multiTouch=false;var section=this.getSectionWithName(
this.sectionOnMouseDown);if(section){this.propagateOnMultiTouchEnd(section,e)}}
this.touchEventInProgress=true};CanvasSectionContainer.prototype.onTouchCancel=function(e){
this.clearMousePositions();this.stopLongPress()};CanvasSectionContainer.prototype.onResize=function(
newWidth,newHeight){var container=this.canvas.parentNode;var cRect=container.getBoundingClientRect()
if(!newWidth)newWidth=cRect.right-cRect.left;if(!newHeight)newHeight=cRect.bottom-cRect.top;
app.dpiScale=window.devicePixelRatio;app.roundedDpiScale=Math.round(window.devicePixelRatio);
newWidth=Math.floor(newWidth*app.dpiScale);newHeight=Math.floor(newHeight*app.dpiScale);if(
this.width===newWidth&&this.height===newHeight&&this.documentAnchor){this.reNewAllSections(false);
return}this.clearMousePositions();this.width=newWidth;this.height=newHeight;this.needsResize=true;
this.reNewAllSections(true)};CanvasSectionContainer.prototype.findSectionContainingPoint=function(
point,interactable){if(interactable===void 0){interactable=true}for(
var i=this.sections.length-1;i>-1;i--){if(this.sections[i].isLocated&&!this.sections[i
].windowSection&&this.sections[i].showSection&&(!this.sections[i].documentObject||this.sections[i
].isVisible)&&this.doesSectionIncludePoint(this.sections[i],point)&&(interactable?this.sections[i
].interactable:true))return this.sections[i]}return null};
CanvasSectionContainer.prototype.doesSectionIncludePoint=function(section,point){return point[0
]>=section.myTopLeft[0]&&point[0]<=section.myTopLeft[0]+section.size[0]&&(point[1
]>=section.myTopLeft[1]&&point[1]<=section.myTopLeft[1]+section.size[1])};
CanvasSectionContainer.prototype.doSectionsIntersectOnYAxis=function(section1,section2){
var y11=section1.myTopLeft[1];var y12=section1.myTopLeft[1]+section1.size[1];
var y21=section2.myTopLeft[1];var y22=section2.myTopLeft[1]+section2.size[1];if(
y11>=y21&&y11<=y22||y12>=y21&&y12<=y22||(y21>=y11&&y21<=y12||y22>=y11&&y22<=y12)
)return true;else return false};
CanvasSectionContainer.prototype.doSectionsIntersectOnXAxis=function(section1,section2){
var x11=section1.myTopLeft[0];var x12=section1.myTopLeft[0]+section1.size[0];
var x21=section2.myTopLeft[0];var x22=section2.myTopLeft[0]+section2.size[0];if(
x11>=x21&&x11<x22||x12>=x21&&x12<=x22||(x21>=x11&&x21<=x12||x22>=x11&&x22<=x12)
)return true;else return false};CanvasSectionContainer.prototype.hitLeft=function(section){
var maxX=-Infinity;for(var i=0;i<this.sections.length;i++){if(this.sections[i
].isLocated&&this.sections[i].zIndex===section.zIndex&&this.sections[i].name!==section.name){
var currentLeft=this.sections[i].myTopLeft[0]+this.sections[i].size[0];if(
currentLeft>maxX&&currentLeft<section.myTopLeft[0]){if(this.doSectionsIntersectOnYAxis(
this.sections[i],section)){maxX=currentLeft}}}}if(maxX===-Infinity
)return 0;else return maxX+app.roundedDpiScale};CanvasSectionContainer.prototype.hitRight=function(
section){var minX=Infinity;for(var i=0;i<this.sections.length;i++){if(this.sections[i
].isLocated&&this.sections[i].zIndex===section.zIndex&&this.sections[i].name!==section.name){
var currentRight=this.sections[i].myTopLeft[0];if(currentRight<minX&&currentRight>section.myTopLeft[
0]){if(this.doSectionsIntersectOnYAxis(this.sections[i],section)){minX=currentRight}}}}if(
minX===Infinity)return this.width;else return minX-app.roundedDpiScale};
CanvasSectionContainer.prototype.hitTop=function(section){var maxY=-Infinity;for(
var i=0;i<this.sections.length;i++){if(this.sections[i].isLocated&&this.sections[i
].zIndex===section.zIndex&&this.sections[i].name!==section.name){var currentTop=this.sections[i
].myTopLeft[1]+this.sections[i].size[1];if(currentTop>maxY&&currentTop<section.myTopLeft[1]){if(
this.doSectionsIntersectOnXAxis(this.sections[i],section)){maxY=currentTop}}}}if(maxY===-Infinity
)return 0;else return maxY+app.roundedDpiScale};CanvasSectionContainer.prototype.hitBottom=function(
section){var minY=Infinity;for(var i=0;i<this.sections.length;i++){if(this.sections[i
].isLocated&&this.sections[i].zIndex===section.zIndex&&this.sections[i].name!==section.name){
var currentBottom=this.sections[i].myTopLeft[1];if(
currentBottom<minY&&currentBottom>section.myTopLeft[1]){if(this.doSectionsIntersectOnXAxis(
this.sections[i],section)){minY=currentBottom}}}}if(minY===Infinity
)return this.height;else return minY-app.roundedDpiScale};
CanvasSectionContainer.prototype.createUpdateSingleDivElement=function(section){
var bcr=this.canvas.getBoundingClientRect();var element=document.getElementById(
"test-div-"+section.name);if((!section.documentObject||section.isVisible)&&section.isSectionShown()
){if(!element){element=document.createElement("div");element.id="test-div-"+section.name;
document.body.appendChild(element)}element.style.position="fixed";element.style.zIndex="-1";
element.style.left=String(bcr.left+Math.round(section.myTopLeft[0]/app.dpiScale))+"px";
element.style.top=String(bcr.top+Math.round(section.myTopLeft[1]/app.dpiScale))+"px";
element.style.width=String(Math.round(section.size[0]/app.dpiScale))+"px";
element.style.height=String(Math.round(section.size[1]/app.dpiScale))+"px";if(section.name==="tiles"
){element.innerText=JSON.stringify({top:Math.round(app.activeDocument.activeView.viewedRectangle.pY1
),left:Math.round(app.activeDocument.activeView.viewedRectangle.pX1),width:Math.round(section.size[0
]),height:Math.round(section.size[1])})}}else if(element)element.remove()};
CanvasSectionContainer.prototype.createUpdateDivElements=function(){for(
var i=0;i<this.sections.length;i++){this.createUpdateSingleDivElement(this.sections[i])}};
CanvasSectionContainer.prototype.reNewAllSections=function(redraw){if(redraw===void 0){redraw=true}
this.orderSections();this.locateSections();for(var i=0;i<this.sections.length;i++){this.sections[i
].onResize()}this.applyDrawingOrders();if(this.testing)this.createUpdateDivElements();if(
redraw&&this.drawingAllowed())this.requestReDraw();else if(
window.L&&window.L.Browser.safari&&window.L.Browser.mobile)this.resizeCanvas()};
CanvasSectionContainer.prototype.roundPositionAndSize=function(section){section.myTopLeft[0
]=Math.round(section.myTopLeft[0]);section.myTopLeft[1]=Math.round(section.myTopLeft[1]);
section.size[0]=Math.round(section.size[0]);section.size[1]=Math.round(section.size[1])};
CanvasSectionContainer.prototype.calculateSectionInitialPosition=function(section,index){if(
typeof section.anchor[index]==="string"||section.anchor[index].length===1){
var anchor=typeof section.anchor[index]==="string"?section.anchor[index]:section.anchor[index][0];
if(index===0)return anchor==="top"?section.position[1]:this.height-(section.position[1
]+section.size[1]);else return anchor==="left"?section.position[0]:this.width-(section.position[0
]+section.size[0])}else{if(section.anchor[index].length%2===0){console.error(
"Section: "+section.name+". Wrong anchor definition.");return 0}else{var count=section.anchor[index
].length;var targetSection=null;var targetEdge=null;for(var i=0;i<count-1;i++){
targetSection=this.getSectionWithName(section.anchor[index][i]);if(targetSection){
targetEdge=section.anchor[index][i+1];break}}if(targetSection){if(!targetSection.isLocated){
console.error(
"Section: "+section.name+". Target section for anchor should be located before this section."+" It means that target section's (if zIndex is the same) processing order should be less or its zIndex should be less than this section."
);return 0}else{if(targetEdge==="top"){return targetSection.myTopLeft[1]-app.roundedDpiScale
}else if(targetEdge==="bottom"){return targetSection.myTopLeft[1]+targetSection.size[1
]+app.roundedDpiScale}else if(targetEdge==="left"){return targetSection.myTopLeft[0
]-app.roundedDpiScale}else if(targetEdge==="right"){return targetSection.myTopLeft[0
]+targetSection.size[0]+app.roundedDpiScale}else if(targetEdge==="-left"){if(section.expand[0
]==="left"&&section.origSizeHint){section.size[0]=section.origSizeHint[0]}
return targetSection.myTopLeft[0]-section.size[0]}}}else{var anchor=section.anchor[index][count-1];
if(index===0){return anchor==="top"?section.position[1]:this.height-(section.position[1
]+section.size[1])}else{return anchor==="left"?section.position[0]:this.width-(section.position[0
]+section.size[0])}}}}};CanvasSectionContainer.prototype.expandSection=function(section){if(
section.expand.includes("left")){var initialX=section.myTopLeft[0];section.myTopLeft[0
]=this.hitLeft(section);section.size[0]=initialX-section.myTopLeft[0]}if(section.expand.includes(
"right")){section.size[0]=this.hitRight(section)-section.myTopLeft[0]}if(section.expand.includes(
"top")){var initialY=section.myTopLeft[1];section.myTopLeft[1]=this.hitTop(section);section.size[1
]=initialY-section.myTopLeft[1]}if(section.expand.includes("bottom")){section.size[1
]=this.hitBottom(section)-section.myTopLeft[1]}};
CanvasSectionContainer.prototype.locateSections=function(){for(var i=0;i<this.sections.length;i++){
var section=this.sections[i];section.isLocated=false;section.myTopLeft=null;if(
typeof section.origSizeHint==="undefined"){section.origSizeHint=__spreadArray([],__read(section.size
),false)}}this.documentAnchor=null;this.windowSectionList=[];for(var i=0;i<this.sections.length;i++
){var section=this.sections[i];if(section.documentObject===true){if(section.size&&section.position){
section.isLocated=true;section.myTopLeft=[this.documentAnchor[0]+section.position[0]-(
app.isXOrdinateInFrozenPane(section.position[0])?0:app.activeDocument.activeView.viewedRectangle.pX1
),this.documentAnchor[1]+section.position[1]-(app.isYOrdinateInFrozenPane(section.position[1]
)?0:app.activeDocument.activeView.viewedRectangle.pY1)]}}else if(section.boundToSection){
var parentSection=this.getSectionWithName(section.boundToSection);if(parentSection){
section.myTopLeft=[0,0];section.size=[0,0];section.size[0]=parentSection.size[0];section.size[1
]=parentSection.size[1];section.myTopLeft[0]=parentSection.myTopLeft[0];section.myTopLeft[1
]=parentSection.myTopLeft[1];this.roundPositionAndSize(section);section.isLocated=true}}else if(
section.windowSection){section.myTopLeft=[0,0];section.size=[this.width,this.height];
section.isLocated=true;this.windowSectionList.push(section)}else{section.myTopLeft=[
this.calculateSectionInitialPosition(section,1),this.calculateSectionInitialPosition(section,0)];if(
section.expand.length!==0)this.expandSection(section);this.roundPositionAndSize(section);
section.isLocated=true}if(section.name===this.documentAnchorSectionName){this.documentAnchor=[
section.myTopLeft[0],section.myTopLeft[1]]}}};
CanvasSectionContainer.prototype.orderSections=function(){function compareSections(a,b){
var zIndexDiff=a.zIndex-b.zIndex;if(zIndexDiff!=0)return zIndexDiff;
return a.processingOrder-b.processingOrder}this.sections.sort(compareSections)};
CanvasSectionContainer.prototype.applyDrawingOrders=function(){function compareSections(a,b){
var zIndexDiff=a.zIndex-b.zIndex;if(zIndexDiff!=0)return zIndexDiff;
var drawingOrderDiff=a.drawingOrder-b.drawingOrder;if(drawingOrderDiff!=0)return drawingOrderDiff;
return a.processingOrder-b.processingOrder}this.sections.sort(compareSections)};
CanvasSectionContainer.prototype.drawSectionBorders=function(){this.context.lineWidth=2*app.dpiScale
this.context.strokeStyle="blue";for(var i=0;i<this.sections.length;i++){var section=this.sections[i]
if(section.isLocated&&section.showSection&&(!section.documentObject||section.isVisible)){
var xStart=section.myTopLeft[0];var xEnd=xStart+section.size[0];var yStart=section.myTopLeft[1];
var yEnd=yStart+section.size[1];this.context.beginPath();this.context.moveTo(xStart,yStart);
this.context.lineTo(xEnd,yStart);this.context.stroke();this.context.beginPath();this.context.moveTo(
xEnd,yStart);this.context.lineTo(xEnd,yEnd);this.context.stroke();this.context.beginPath();
this.context.moveTo(xEnd,yEnd);this.context.lineTo(xStart,yEnd);this.context.stroke();
this.context.beginPath();this.context.moveTo(xStart,yEnd);this.context.lineTo(xStart,yStart);
this.context.stroke()}}};CanvasSectionContainer.prototype.setPenPosition=function(section){
this.context.setTransform(1,0,0,1,0,0);this.context.translate(section.myTopLeft[0],
section.myTopLeft[1])};CanvasSectionContainer.prototype.shouldDrawSection=function(section){
return section.isLocated&&section.showSection&&(!section.documentObject||section.isVisible)};
CanvasSectionContainer.prototype.drawSections=function(frameCount,elapsedTime){if(
frameCount===void 0){frameCount=null}if(elapsedTime===void 0){elapsedTime=null}if(
app.map&&app.map._debug)app.map._debug.setOverlayMessage("top-frames",
"Frames: "+this.framesRendered++);this.context.setTransform(1,0,0,1,0,0);if(!this.zoomChanged){
this.clearCanvas()}this.context.font=String(20*app.dpiScale)+"px Verdana";for(
var i=0;i<this.sections.length;i++){if(this.shouldDrawSection(this.sections[i])){
this.context.translate(this.sections[i].myTopLeft[0],this.sections[i].myTopLeft[1]);if(
this.sections[i].backgroundColor){this.context.globalAlpha=this.sections[i].backgroundOpacity;
this.context.fillStyle=this.sections[i].backgroundColor;this.context.fillRect(0,0,this.sections[i
].size[0],this.sections[i].size[1]);this.context.globalAlpha=1}this.sections[i].onDraw(frameCount,
elapsedTime);if(this.sections[i].borderColor){var offset=this.sections[i].getLineOffset();
this.context.lineWidth=this.sections[i].getLineWidth();this.context.strokeStyle=this.sections[i
].borderColor;this.context.strokeRect(offset,offset,this.sections[i].size[0],this.sections[i].size[1
])}this.context.translate(-this.sections[i].myTopLeft[0],-this.sections[i].myTopLeft[1])}}};
CanvasSectionContainer.prototype.doesSectionExist=function(name){if(name&&typeof name==="string"){
return this.sectionsByName.has(name)}else{return false}};
CanvasSectionContainer.prototype.checkNewSectionName=function(options){if(
options.name!==undefined&&typeof options.name==="string"&&options.name.trim()!==""){if(
this.doesSectionExist(options.name)){console.error(
"There is a section with the same name: "+options.name+". Use doesSectionExist for existancy checks."
);return false}else if(["top","left","bottom","right"].includes(options.name.trim())){console.error(
'"top", "left", "bottom" and "right" words are reserved. Choose another name for the section.');
return false}else{return true}}else{console.error('Sections should have a "name" property.');
return false}};CanvasSectionContainer.prototype.checkSectionProperties=function(options){if(
options.anchor===undefined||options.position===undefined||options.size===undefined||options.expand===undefined||options.processingOrder===undefined||options.drawingOrder===undefined||options.zIndex===undefined||options.interactable===undefined
){console.error('Section has missing properties. See "checkSectionProperties" function.');
return false}else{if(options.showSection===undefined)options.showSection=true;if(
options.windowSection===undefined)options.windowSection=false;return true}};
CanvasSectionContainer.prototype.newSectionChecks=function(options){if(!this.checkNewSectionName(
options))return false;else if(!this.checkSectionProperties(options))return false;else return true};
CanvasSectionContainer.prototype.addSectionFunctions=function(section){section.isCalcRTL=function(){
var docLayer=this.sectionProperties.docLayer;if(docLayer&&docLayer.isCalcRTL())return true;
return false}.bind(section)};CanvasSectionContainer.prototype.addSection=function(newSection){if(
this.newSectionChecks(newSection)){this.pushSection(newSection);return true}else{return false}};
CanvasSectionContainer.prototype.pushSection=function(newSection){newSection.context=this.context;
newSection.containerObject=this;newSection.sectionProperties.section=newSection;this.sections.push(
newSection);this.sectionsByName.set(newSection.name,newSection);this.addSectionFunctions(newSection)
newSection.onInitialize();if(this.drawingAllowed()){this.updateBoundSectionLists();
this.reNewAllSections()}else this.sectionsDirty=true};
CanvasSectionContainer.prototype.removeSection=function(name){var found=false;for(
var i=0;i<this.sections.length;i++){if(this.sections[i].name===name){
var element=document.getElementById("test-div-"+this.sections[i].name);if(element
)document.body.removeChild(element);this.sections[i].onRemove();this.sectionsByName.delete(name);
this.sections[i]=null;this.sections.splice(i,1);found=true;break}}if(found){if(!this.drawingAllowed(
))this.sectionsDirty=true;else{this.updateBoundSectionLists();this.reNewAllSections()}return true
}else{return false}};CanvasSectionContainer.prototype.setAnimatingSectionName=function(sectionName){
this.animatingSectionName=sectionName};
CanvasSectionContainer.prototype.getAnimatingSectionName=function(){return this.animatingSectionName
};CanvasSectionContainer.prototype.animate=function(timeStamp){if(this.lastFrameStamp>0
)this.elapsedTime+=Math.max(0,timeStamp-this.lastFrameStamp);this.lastFrameStamp=timeStamp;if(
this.duration&&this.elapsedTime>=this.duration){this.continueAnimating=false}
var section=this.getSectionWithName(this.getAnimatingSectionName());if(this.continueAnimating){if(
section)section.onAnimate(this.frameCount,this.elapsedTime);this.frameCount++;requestAnimationFrame(
this.animate.bind(this))}else{if(section){section.isAnimating=false;section.onAnimationEnded(
this.frameCount,this.elapsedTime)}this.setAnimatingSectionName(null);
this.frameCount=this.elapsedTime=null}};CanvasSectionContainer.prototype.resetAnimation=function(
sectionName){if(sectionName===this.getAnimatingSectionName()){this.lastFrameStamp=0;
this.elapsedTime=0;this.frameCount=0}};CanvasSectionContainer.prototype.stopAnimating=function(){
this.continueAnimating=false};CanvasSectionContainer.prototype.startAnimating=function(sectionName,
options){if(!this.getAnimatingSectionName()){this.setAnimatingSectionName(sectionName);
this.getSectionWithName(sectionName).isAnimating=true;this.lastFrameStamp=0;
this.continueAnimating=true;this.duration=options.duration?options.duration:null;this.elapsedTime=0;
this.frameCount=0;if(options.defer)requestAnimationFrame(this.animate.bind(this));else this.animate(
document.timeline.currentTime);return true}else{return false}};return CanvasSectionContainer}();
var CanvasSectionObject=function(){function CanvasSectionObject(name){this.myTopLeft=[0,0];
this.containerObject=null;this.name=null;this.backgroundColor=null;this.backgroundOpacity=1;
this.borderColor=null;this.boundToSection=null;this.anchor=[];this.isVisible=false;
this.showSection=true;this.position=[0,0];this.size=[0,0];this.expand=[];this.interactable=true;
this.isAnimating=false;this.windowSection=false;this.sectionProperties={};this.boundsList=[];
this.name=name}CanvasSectionObject.prototype.onInitialize=function(){return};
CanvasSectionObject.prototype.onCursorPositionChanged=function(newPosition){return};
CanvasSectionObject.prototype.onCellAddressChanged=function(){return};
CanvasSectionObject.prototype.onMouseMove=function(point,dragDistance,e){return};
CanvasSectionObject.prototype.onMouseDown=function(point,e){return};
CanvasSectionObject.prototype.onMouseUp=function(point,e){return};
CanvasSectionObject.prototype.setShowSection=function(show){this.showSection=show;if(
this.onSectionShowStatusChange)this.onSectionShowStatusChange();if(this.containerObject){
this.isVisible=this.containerObject.isDocumentObjectVisible(this);
this.onDocumentObjectVisibilityChange()}if(this.containerObject.testing){
this.containerObject.createUpdateSingleDivElement(this)}};
CanvasSectionObject.prototype.onSectionShowStatusChange=function(){return};
CanvasSectionObject.prototype.isSectionShown=function(){return this.showSection};
CanvasSectionObject.prototype.onDocumentObjectVisibilityChange=function(){return};
CanvasSectionObject.prototype.onMouseEnter=function(point,e){return};
CanvasSectionObject.prototype.onMouseLeave=function(point,e){return};
CanvasSectionObject.prototype.onClick=function(point,e){return};
CanvasSectionObject.prototype.onDoubleClick=function(point,e){return};
CanvasSectionObject.prototype.onContextMenu=function(e){return};
CanvasSectionObject.prototype.onMouseWheel=function(point,delta,e){return};
CanvasSectionObject.prototype.onMultiTouchStart=function(e){return};
CanvasSectionObject.prototype.onMultiTouchMove=function(point,dragDistance,e){return};
CanvasSectionObject.prototype.onMultiTouchEnd=function(e){return};
CanvasSectionObject.prototype.onResize=function(){return};
CanvasSectionObject.prototype.onDraw=function(frameCount,elapsedTime){return};
CanvasSectionObject.prototype.onDrawArea=function(area,paneTopLeft,canvasContext){return};
CanvasSectionObject.prototype.onAnimate=function(frameCount,elapsedTime){return};
CanvasSectionObject.prototype.onAnimationEnded=function(frameCount,elapsedTime){return};
CanvasSectionObject.prototype.onNewDocumentTopLeft=function(){return};
CanvasSectionObject.prototype.onRemove=function(){return};
CanvasSectionObject.prototype.setDrawingOrder=function(drawingOrder){this.drawingOrder=drawingOrder;
this.containerObject.updateBoundSectionLists();this.containerObject.reNewAllSections()};
CanvasSectionObject.prototype.setZIndex=function(zIndex){this.zIndex=zIndex;
this.containerObject.updateBoundSectionLists();this.containerObject.reNewAllSections()};
CanvasSectionObject.prototype.bindToSection=function(sectionName){this.boundToSection=sectionName;
this.containerObject.updateBoundSectionLists();this.containerObject.reNewAllSections()};
CanvasSectionObject.prototype.stopPropagating=function(){
this.containerObject.lowestPropagatedBoundSection=this.name};
CanvasSectionObject.prototype.startAnimating=function(options){
return this.containerObject.startAnimating(this.name,options)};
CanvasSectionObject.prototype.resetAnimation=function(){this.containerObject.resetAnimation(
this.name)};CanvasSectionObject.prototype.getTestDiv=function(){var element=document.getElementById(
"test-div-"+this.name);if(element)return element;return null};
CanvasSectionObject.prototype.setPosition=function(x,y){if(
this.documentObject!==true||!this.containerObject)return;x=Math.round(x);y=Math.round(y);
var sectionXcoord=x;var positionAddition=app.activeDocument.activeView.viewedRectangle.clone();if(
this.isCalcRTL()){var docLayer=this.sectionProperties.docLayer;
var docSize=docLayer._map.getPixelBoundsCore().getSize();
sectionXcoord=docSize.x-sectionXcoord-this.size[0]}if(app.isXOrdinateInFrozenPane(sectionXcoord)
)positionAddition.pX1=0;if(app.isYOrdinateInFrozenPane(y))positionAddition.pY1=0;this.myTopLeft[0
]=this.containerObject.getDocumentAnchor()[0]+sectionXcoord-positionAddition.pX1;this.myTopLeft[1
]=this.containerObject.getDocumentAnchor()[1]+y-positionAddition.pY1;this.position[0]=sectionXcoord;
this.position[1]=y;var isVisible=this.containerObject.isDocumentObjectVisible(this);if(
isVisible!==this.isVisible){this.isVisible=isVisible;this.onDocumentObjectVisibilityChange()}if(
this.containerObject.testing)this.containerObject.createUpdateSingleDivElement(this)};
CanvasSectionObject.prototype.isCalcRTL=function(){return};
CanvasSectionObject.prototype.setViewResolved=function(on){return};
CanvasSectionObject.prototype.setView=function(on){return};
CanvasSectionObject.prototype.scrollVerticalWithOffset=function(offset){return};
CanvasSectionObject.prototype.remove=function(id){return};
CanvasSectionObject.prototype.deleteThis=function(){return};
CanvasSectionObject.prototype.getActiveEdit=function(){return};
CanvasSectionObject.prototype.isMobileCommentActive=function(){return false};
CanvasSectionObject.prototype.getMobileCommentModalId=function(){return""};
CanvasSectionObject.prototype.rejectAllTrackedCommentChanges=function(){return};
CanvasSectionObject.prototype.removeHighlighters=function(){return};
CanvasSectionObject.prototype.showUsernamePopUp=function(){return};
CanvasSectionObject.prototype._selectColumn=function(colNumber,modifier){return};
CanvasSectionObject.prototype._selectRow=function(row,modifier){return};
CanvasSectionObject.prototype.insertColumnBefore=function(index){return};
CanvasSectionObject.prototype.insertRowAbove=function(index){return};
CanvasSectionObject.prototype.deleteColumn=function(index){return};
CanvasSectionObject.prototype.deleteRow=function(index){return};
CanvasSectionObject.prototype.resetStrokeStyle=function(){return};
CanvasSectionObject.prototype.hasAnyComments=function(){return false};
CanvasSectionObject.prototype.getLineWidth=function(){if(app.dpiScale>1){return app.roundedDpiScale
}else{return app.dpiScale}};CanvasSectionObject.prototype.getLineOffset=function(){if(app.dpiScale>1
){return app.roundedDpiScale%2===0?0:.5}else{return.5}};return CanvasSectionObject}();
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var HTMLObjectSection=function(_super){__extends(
HTMLObjectSection,_super);function HTMLObjectSection(sectionName,objectWidth,objectHeight,
documentPosition,extraClass,showSection){if(extraClass===void 0){extraClass=""}if(
showSection===void 0){showSection=true}var _this=_super.call(this,sectionName)||this;
_this.processingOrder=app.CSections.HTMLObject.processingOrder;
_this.drawingOrder=app.CSections.HTMLObject.drawingOrder;
_this.zIndex=app.CSections.HTMLObject.zIndex;_this.documentObject=true;_this.size=[
objectWidth*app.dpiScale,objectHeight*app.dpiScale];_this.position=[documentPosition.pX,
documentPosition.pY];_this.sectionProperties.objectWidth=objectWidth;
_this.sectionProperties.objectHeight=objectHeight;
_this.sectionProperties.objectDiv=document.createElement("div");
_this.sectionProperties.objectDiv.className="html-object-section";if(objectWidth===null
)_this.sectionProperties.objectDiv.style.width="auto";else _this.sectionProperties.objectDiv.style.width=objectWidth+"px"
if(objectHeight===null
)_this.sectionProperties.objectDiv.style.height="auto";else _this.sectionProperties.objectDiv.style.height=objectHeight+"px"
if(extraClass)_this.sectionProperties.objectDiv.classList.add(extraClass);document.getElementById(
"canvas-container").appendChild(_this.sectionProperties.objectDiv);if(!showSection){
_this.sectionProperties.objectDiv.style.display="none";_this.showSection=false}return _this}
HTMLObjectSection.prototype.onInitialize=function(){this.setPosition(this.position[0],this.position[
1]);this.adjustHTMLObjectPosition()};HTMLObjectSection.prototype.onSectionShowStatusChange=function(
){if(this.showSection
)this.sectionProperties.objectDiv.style.display="";else this.sectionProperties.objectDiv.style.display="none"
};HTMLObjectSection.prototype.adjustHTMLObjectPosition=function(){var leftAddition=0;
var topAddition=0;if(this.sectionProperties.objectDiv.parentNode.id==="map"){
var clientRectMap=document.getElementById("map").getBoundingClientRect();
var clientRectCanvas=document.getElementById("canvas-container").getBoundingClientRect();
leftAddition=clientRectMap.width-clientRectCanvas.width;
topAddition=clientRectMap.height-clientRectCanvas.height}var left=Math.round((this.myTopLeft[0
]+leftAddition)/app.dpiScale)+"px";var top=Math.round((this.myTopLeft[1]+topAddition)/app.dpiScale
)+"px";if(this.sectionProperties.objectDiv.style.left!==left
)this.sectionProperties.objectDiv.style.left=left;if(
this.sectionProperties.objectDiv.style.top!==top)this.sectionProperties.objectDiv.style.top=top};
HTMLObjectSection.prototype.onDraw=function(frameCount,elapsedTime){this.adjustHTMLObjectPosition()}
HTMLObjectSection.prototype.getHTMLObject=function(){return this.sectionProperties.objectDiv};
HTMLObjectSection.prototype.onNewDocumentTopLeft=function(){this.adjustHTMLObjectPosition();if(
this.isVisible&&this.isSectionShown()){if(this.sectionProperties.objectDiv.style.display!==""
)this.sectionProperties.objectDiv.style.display=""
}else this.sectionProperties.objectDiv.style.display="none"};
HTMLObjectSection.prototype.getPosition=function(){var twips=[Math.round(this.position[0
]*app.pixelsToTwips),Math.round(this.position[1]*app.pixelsToTwips)];return new cool.SimplePoint(
twips[0],twips[1])};HTMLObjectSection.prototype.onRemove=function(){
this.sectionProperties.objectDiv.remove()};return HTMLObjectSection}(CanvasSectionObject);
app.definitions.htmlObjectSection=HTMLObjectSection;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var CommentMarkerSubSection=function(_super){__extends(CommentMarkerSubSection,_super);
function CommentMarkerSubSection(sectionName,objectWidth,objectHeight,documentPosition,extraClass,
showSection,parentSection,data){if(extraClass===void 0){extraClass=""}if(showSection===void 0){
showSection=false}var _this=_super.call(this,sectionName,objectWidth,objectHeight,documentPosition,
extraClass,showSection)||this;_this.sectionProperties.parentSection=parentSection;
_this.sectionProperties.data=data;_this.sectionProperties.dragStartPosition=null;return _this}
CommentMarkerSubSection.prototype.sendAnnotationPositionChange=function(newPosition){if(
app.file.fileBasedView){app.map.setPart(this.sectionProperties.docLayer._selectedPart,false);
newPosition[1]-=this.sectionProperties.data.yAddition}var comment={Id:{type:"string",
value:this.sectionProperties.data.id},PositionX:{type:"int32",value:newPosition[0]},PositionY:{
type:"int32",value:newPosition[1]}};app.map.sendUnoCommand(".uno:EditAnnotation",comment);if(
app.file.fileBasedView)app.setPart(0,false)};CommentMarkerSubSection.prototype.onMouseMove=function(
point,dragDistance,e){if(this.sectionProperties.parentSection===null)return;if(
app.sectionContainer.isDraggingSomething()){window.IgnorePanning=true;if(
this.sectionProperties.parent===null)return;if(this.sectionProperties.dragStartPosition===null
)this.sectionProperties.dragStartPosition=this.position.slice();this.setPosition(
this.sectionProperties.dragStartPosition[0]+dragDistance[0],
this.sectionProperties.dragStartPosition[1]+dragDistance[1])}};
CommentMarkerSubSection.prototype.onDragEnd=function(){window.IgnorePanning=undefined;
this.sectionProperties.dragStartPosition=null;var twips=[this.position[0]*app.pixelsToTwips,
this.position[1]*app.pixelsToTwips];this.sendAnnotationPositionChange(twips)};
CommentMarkerSubSection.prototype.onClick=function(point,e){e.stopPropagation();
this.stopPropagating();
this.sectionProperties.parentSection.sectionProperties.commentListSection.selectById(
this.sectionProperties.data.id)};CommentMarkerSubSection.prototype.onMouseDown=function(point,e){
e.stopPropagation();this.stopPropagating()};CommentMarkerSubSection.prototype.onMouseUp=function(
point,e){e.stopPropagation();if(this.containerObject.isDraggingSomething()){this.stopPropagating();
this.onDragEnd()}};return CommentMarkerSubSection}(HTMLObjectSection);
app.definitions.commentMarkerSubSection=CommentMarkerSubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __read=this&&this.__read||function(o,n){
var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{
while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}
}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar};
DOMPurify.addHook("afterSanitizeAttributes",function(node){if(
node.tagName==="A"&&!node.classList.contains("context-menu-link")){node.setAttribute("target",
"_blank");node.setAttribute("rel","noopener")}});var cool;(function(cool){var CommentLayoutStatus;(
function(CommentLayoutStatus){CommentLayoutStatus[CommentLayoutStatus["INVISIBLE"]=0]="INVISIBLE";
CommentLayoutStatus[CommentLayoutStatus["VISIBLE"]=1]="VISIBLE";CommentLayoutStatus[
CommentLayoutStatus["INSERTED"]=2]="INSERTED";CommentLayoutStatus[CommentLayoutStatus["DELETED"]=3
]="DELETED";CommentLayoutStatus[CommentLayoutStatus["NONE"]=4]="NONE";CommentLayoutStatus[
CommentLayoutStatus["HIDDEN"]=5]="HIDDEN"})(CommentLayoutStatus=cool.CommentLayoutStatus||(
cool.CommentLayoutStatus={}));var Comment=function(_super){__extends(Comment,_super);
function Comment(name,data,options,commentListSectionPointer){var _this=_super.call(this,name)||this
_this.processingOrder=app.CSections.Comment.processingOrder;
_this.drawingOrder=app.CSections.Comment.drawingOrder;_this.zIndex=app.CSections.Comment.zIndex;
_this.valid=true;_this.pendingInit=true;_this.cachedCommentHeight=null;_this.cachedIsEdit=false;
_this.hidden=null;_this.myTopLeft=[0,0];_this.documentObject=true;_this.map=window.L.Map.THIS;if(
!options)options={};_this.sectionProperties.commentListSection=commentListSectionPointer;
_this.sectionProperties.docLayer=_this.map._docLayer;_this.sectionProperties.selectedAreaPoint=null;
_this.sectionProperties.cellCursorPoint=null;_this.sectionProperties.draggingStarted=false;
_this.sectionProperties.dragStartPosition=null;
_this.sectionProperties.minWidth=options.minWidth?options.minWidth:160;
_this.sectionProperties.maxHeight=options.maxHeight?options.maxHeight:50;
_this.sectionProperties.imgSize=options.imgSize?options.imgSize:[32,32];
_this.sectionProperties.margin=options.margin?options.margin:[40,40];
_this.sectionProperties.noMenu=options.noMenu?options.noMenu:false;if(data.parent===undefined
)data.parent="0";_this.sectionProperties.data=data;
_this.sectionProperties.possibleParentCommentId=null;_this.sectionProperties.wrapper=null;
_this.sectionProperties.container=null;_this.sectionProperties.author=null;
_this.sectionProperties.resolvedTextElement=null;_this.sectionProperties.authorAvatarImg=null;
_this.sectionProperties.authorAvatartdImg=null;_this.sectionProperties.contentAuthor=null;
_this.sectionProperties.contentDate=null;_this.sectionProperties.acceptButton=null;
_this.sectionProperties.rejectButton=null;_this.sectionProperties.menu=null;
_this.sectionProperties.captionNode=null;_this.sectionProperties.captionText=null;
_this.sectionProperties.contentNode=null;_this.sectionProperties.nodeModify=null;
_this.sectionProperties.nodeModifyText=null;_this.sectionProperties.contentText=null;
_this.sectionProperties.nodeReply=null;_this.sectionProperties.nodeReplyText=null;
_this.sectionProperties.contextMenu=false;_this.sectionProperties.highlightedTextColor="#777777";
_this.sectionProperties.usedTextColor=_this.sectionProperties.data.color;
_this.sectionProperties.showSelectedCoordinate=true;if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){
_this.sectionProperties.parthash=parseInt(_this.sectionProperties.data.parthash);
_this.sectionProperties.partIndex=app.impress.getIndexFromSlideHash(_this.sectionProperties.parthash
)}_this.sectionProperties.isHighlighted=false;_this.sectionProperties.commentContainerRemoved=false;
_this.sectionProperties.children=[];_this.sectionProperties.childLinesNode=null;
_this.sectionProperties.childLines=[];_this.sectionProperties.childCommentOffset=8;
_this.sectionProperties.commentMarkerSubSection=null;_this.convertRectanglesToCoreCoordinates();
app.map.on("sheetgeometrychanged",_this.setPositionAndSize.bind(_this));return _this}
Comment.makeName=function(data){return data.id==="new"?"new comment":"comment "+data.id};
Comment.prototype.doPendingInitializationInView=function(force){if(force===void 0){force=false}if(
!this.pendingInit)return;if(!force){if(!this.convertRectanglesToViewCoordinates())return;if(
app.map._docLayer._docType==="spreadsheet"&&parseInt(this.sectionProperties.data.tab
)!==app.map._docLayer._selectedPart)return}var button=window.L.DomUtil.create("div",
"annotation-btns-container",this.sectionProperties.nodeModify);window.L.DomEvent.on(
this.sectionProperties.nodeModifyText,"input",this.textAreaInput,this);window.L.DomEvent.on(
this.sectionProperties.nodeReplyText,"input",this.textAreaInput,this);window.L.DomEvent.on(
this.sectionProperties.nodeModifyText,"keydown",this.textAreaKeyDown,this);window.L.DomEvent.on(
this.sectionProperties.nodeReplyText,"keydown",this.textAreaKeyDown,this);this.createButton(button,
"annotation-cancel-"+this.sectionProperties.data.id,"annotation-button button-secondary",_("Cancel")
,this.handleCancelCommentButton);this.createButton(button,
"annotation-save-"+this.sectionProperties.data.id,"annotation-button button-primary",_("Save"),
this.handleSaveCommentButton);button=window.L.DomUtil.create("div","",
this.sectionProperties.nodeReply);this.createButton(button,
"annotation-cancel-reply-"+this.sectionProperties.data.id,"annotation-button button-secondary",_(
"Cancel"),this.handleCancelCommentButton);this.createButton(button,
"annotation-reply-"+this.sectionProperties.data.id,"annotation-button button-primary",_("Reply"),
this.handleReplyCommentButton);window.L.DomEvent.disableScrollPropagation(
this.sectionProperties.container);if(
app.map._docLayer._docType!=="text"||this.sectionProperties.commentListSection.isCollapsed===true
)this.sectionProperties.container.style.visibility="hidden";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="none";var events=["click","dblclick","mousedown",
"mouseup","mouseover","mouseout","keydown","keypress","keyup","touchstart","touchmove","touchend"];
window.L.DomEvent.on(this.sectionProperties.container,"click",this.onMouseClick,this);
window.L.DomEvent.on(this.sectionProperties.container,"keydown",this.onEscKey,this);for(
var it=0;it<events.length;it++){window.L.DomEvent.on(this.sectionProperties.container,events[it],
window.L.DomEvent.stopPropagation,this)}window.L.DomEvent.on(this.sectionProperties.container,
"touchstart",function(e){if(e&&e.touches.length>1){window.L.DomEvent.preventDefault(e)}},this);
this.update();this.pendingInit=false};Comment.prototype.onInitialize=function(){
this.createContainerAndWrapper();this.createAuthorTable();if(
this.sectionProperties.data.trackchange&&!this.map.isReadOnlyMode()){this.createTrackChangeButtons()
}if(this.sectionProperties.noMenu!==true&&app.isCommentEditingAllowed()){this.createMenu()}if(
this.sectionProperties.data.trackchange){this.sectionProperties.captionNode=window.L.DomUtil.create(
"div","cool-annotation-caption",this.sectionProperties.wrapper);
this.sectionProperties.captionText=window.L.DomUtil.create("div","",
this.sectionProperties.captionNode)}this.sectionProperties.contentNode=window.L.DomUtil.create("div"
,"cool-annotation-content cool-dont-break",this.sectionProperties.wrapper);
this.sectionProperties.contentNode.id="annotation-content-area-"+this.sectionProperties.data.id;
this.sectionProperties.nodeModify=window.L.DomUtil.create("div",
"cool-annotation-edit"+" modify-annotation",this.sectionProperties.wrapper);
this.sectionProperties.nodeModifyText=window.L.DomUtil.create("div","cool-annotation-textarea",
this.sectionProperties.nodeModify);this.createReplyHint(this.sectionProperties.nodeModify);
this.sectionProperties.nodeModifyText.setAttribute("contenteditable","true");
this.sectionProperties.nodeModifyText.setAttribute("role","textbox");
this.sectionProperties.nodeModifyText.setAttribute("aria-label",Comment.editCommentLabel);
this.sectionProperties.nodeModifyText.id="annotation-modify-textarea-"+this.sectionProperties.data.id
this.sectionProperties.contentText=window.L.DomUtil.create("div","",
this.sectionProperties.contentNode);this.sectionProperties.nodeReply=window.L.DomUtil.create("div",
"cool-annotation-edit"+" reply-annotation",this.sectionProperties.wrapper);
this.sectionProperties.nodeReplyText=window.L.DomUtil.create("div","cool-annotation-textarea",
this.sectionProperties.nodeReply);this.createReplyHint(this.sectionProperties.nodeReply);
this.sectionProperties.nodeReplyText.setAttribute("contenteditable","true");
this.sectionProperties.nodeReplyText.setAttribute("role","textbox");
this.sectionProperties.nodeReplyText.setAttribute("aria-label",Comment.replyCommentLabel);
this.sectionProperties.nodeReplyText.id="annotation-reply-textarea-"+this.sectionProperties.data.id;
this.createChildLinesNode();this.sectionProperties.container.style.visibility="hidden";if(
this.sectionProperties.commentMarkerSubSection===null&&app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)this.createMarkerSubSection();this.doPendingInitializationInView();if(!window.mode.isMobile()
)document.getElementById("document-container").appendChild(this.sectionProperties.container)};
Comment.prototype.createContainerAndWrapper=function(){
var isRTL=document.documentElement.dir==="rtl";
this.sectionProperties.container=window.L.DomUtil.create("div","cool-annotation"+(isRTL?" rtl":""));
this.sectionProperties.container.id="comment-container-"+this.sectionProperties.data.id;
window.L.DomEvent.on(this.sectionProperties.container,"focusout",this.onLostFocus,this);
var mobileClass=window.mode.isMobile()?" wizard-comment-box":"";if(
this.sectionProperties.data.trackchange){this.sectionProperties.wrapper=window.L.DomUtil.create(
"div","cool-annotation-redline-content-wrapper"+mobileClass,this.sectionProperties.container)}else{
this.sectionProperties.wrapper=window.L.DomUtil.create("div",
"cool-annotation-content-wrapper"+mobileClass,this.sectionProperties.container)}
this.sectionProperties.wrapper.style.marginLeft=this.sectionProperties.childCommentOffset*this.getChildLevel(
)+"px";if(document.documentElement.dir==="rtl")this.sectionProperties.wrapper.dir="rtl";if(
cool.CommentSection.autoSavedComment)this.sectionProperties.container.style.visibility="hidden"};
Comment.prototype.createAuthorTable=function(){
this.sectionProperties.author=window.L.DomUtil.create("table","cool-annotation-table",
this.sectionProperties.wrapper);var tbody=window.L.DomUtil.create("tbody","",
this.sectionProperties.author);var rowResolved=window.L.DomUtil.create("tr","",tbody);
var tdResolved=window.L.DomUtil.create("td","cool-annotation-resolved",rowResolved);
var pResolved=window.L.DomUtil.create("div","cool-annotation-content-resolved",tdResolved);
this.sectionProperties.resolvedTextElement=pResolved;this.updateResolvedField(
this.sectionProperties.data.resolved);var tr=window.L.DomUtil.create("tr","",tbody);
this.sectionProperties.authorRow=tr;tr.id="author table row "+this.sectionProperties.data.id;
var tdImg=window.L.DomUtil.create("td","cool-annotation-img",tr);
var tdAuthor=window.L.DomUtil.create("td","cool-annotation-author",tr);
var imgAuthor=window.L.DomUtil.create("img","avatar-img",tdImg);imgAuthor.setAttribute("alt",
this.sectionProperties.data.author);var viewId=this.map.getViewId(this.sectionProperties.data.author
);app.LOUtil.setUserImage(imgAuthor,this.map,viewId);imgAuthor.setAttribute("width",
this.sectionProperties.imgSize[0]);imgAuthor.setAttribute("height",this.sectionProperties.imgSize[1]
);if(app.map._docLayer._docType!=="spreadsheet"){
this.sectionProperties.collapsedInfoNode=window.L.DomUtil.create("div",
"cool-annotation-info-collapsed",tdImg);
this.sectionProperties.collapsedInfoNode.style.display="none"}
this.sectionProperties.authorAvatarImg=imgAuthor;this.sectionProperties.authorAvatartdImg=tdImg;
this.sectionProperties.contentAuthor=window.L.DomUtil.create("div","cool-annotation-content-author",
tdAuthor);this.sectionProperties.contentDate=window.L.DomUtil.create("div","cool-annotation-date",
tdAuthor);this.sectionProperties.autoSave=window.L.DomUtil.create("div",
"cool-annotation-autosavelabel",tdAuthor)};Comment.prototype.createMenu=function(){
var tdMenu=window.L.DomUtil.create("td","cool-annotation-menubar",this.sectionProperties.authorRow);
this.sectionProperties.menu=window.L.DomUtil.create("div",
this.sectionProperties.data.trackchange?"cool-annotation-menu-redline":"cool-annotation-menu",tdMenu
);this.sectionProperties.menu.id="comment-annotation-menu-"+this.sectionProperties.data.id;
this.sectionProperties.menu.tabIndex=0;
this.sectionProperties.menu.onclick=this.menuOnMouseClick.bind(this);
this.sectionProperties.menu.onkeypress=this.menuOnKeyPress.bind(this);
this.sectionProperties.menu.dataset.title=Comment.openMenuLabel;
this.sectionProperties.menu.setAttribute("aria-label",Comment.openMenuLabel);
this.sectionProperties.menu.annotation=this};Comment.prototype.createReplyHint=function(commentType
){this.sectionProperties.replyHint=window.L.DomUtil.create("p","",commentType);
var small=document.createElement("small");small.classList.add("cool-font");small.innerText=_(
"Press Ctrl + Enter to post");this.sectionProperties.replyHint.appendChild(small)};
Comment.prototype.createChildLinesNode=function(){
this.sectionProperties.childLinesNode=window.L.DomUtil.create("div","",
this.sectionProperties.container);
this.sectionProperties.childLinesNode.id="annotation-child-lines-"+this.sectionProperties.data.id;
this.sectionProperties.childLinesNode.style.width=this.sectionProperties.childCommentOffset*(
this.getChildLevel()+1)+"px"};Comment.prototype.getContainerPosX=function(){return parseInt(
this.sectionProperties.container.style.left.replace("px",""))};
Comment.prototype.getContainerPosY=function(){return parseInt(
this.sectionProperties.container.style.top.replace("px",""))};
Comment.prototype.updateChildLines=function(){if(!this.isContainerVisible())return;
this.sectionProperties.wrapper.style.marginLeft=this.sectionProperties.childCommentOffset*this.getChildLevel(
)+"px";this.sectionProperties.childLinesNode.style.width=this.sectionProperties.childCommentOffset*(
this.getChildLevel()+1)+"px";var childPositions=[];for(
var i_1=0;i_1<this.sectionProperties.children.length;i_1++){if(this.sectionProperties.children[i_1
].isContainerVisible())childPositions.push({id:this.sectionProperties.children[i_1
].sectionProperties.data.id,posY:this.getContainerPosY()})}childPositions.sort(function(a,b){
return a.posY-b.posY});var lastPosY=this.getContainerPosY()+this.getCommentHeight(false);var i=0;
for(;i<childPositions.length;i++){if(this.sectionProperties.childLines[i]===undefined){
this.sectionProperties.childLines[i]=window.L.DomUtil.create("div","cool-annotation-child-line",
this.sectionProperties.childLinesNode);this.sectionProperties.childLines[i
].id="annotation-child-line-"+this.sectionProperties.data.id+"-"+i;
this.sectionProperties.childLines[i].style.width=this.sectionProperties.childCommentOffset/2+"px"}
this.sectionProperties.childLines[i
].style.marginLeft=this.sectionProperties.childCommentOffset*this.getChildLevel()+4+"px";
this.sectionProperties.childLines[i].style.height=childPositions[i].posY+24-lastPosY+"px";
lastPosY=childPositions[i].posY+24}if(i<this.sectionProperties.childLines.length){for(
var j=i;j<this.sectionProperties.childLines.length;j++){
this.sectionProperties.childLinesNode.removeChild(this.sectionProperties.childLines[i]);
this.sectionProperties.childLines.splice(i)}}};Comment.prototype.setData=function(data){
this.sectionProperties.data=data};Comment.prototype.createTrackChangeButtons=function(){
var tdAccept=window.L.DomUtil.create("td","cool-annotation-menubar",this.sectionProperties.authorRow
);var acceptButton=this.sectionProperties.acceptButton=window.L.DomUtil.create("button",
"cool-redline-accept-button",tdAccept);var tdReject=window.L.DomUtil.create("td",
"cool-annotation-menubar",this.sectionProperties.authorRow);
var rejectButton=this.sectionProperties.rejectButton=window.L.DomUtil.create("button",
"cool-redline-reject-button",tdReject);acceptButton.dataset.title=_("Accept change");
acceptButton.setAttribute("aria-label",_("Accept change"));window.L.DomEvent.on(acceptButton,"click"
,function(){this.map.fire("RedlineAccept",{id:this.sectionProperties.data.id})},this);
rejectButton.dataset.title=_("Reject change");rejectButton.setAttribute("aria-label",_(
"Reject change"));window.L.DomEvent.on(rejectButton,"click",function(){this.map.fire("RedlineReject"
,{id:this.sectionProperties.data.id})},this)};Comment.prototype.createButton=function(container,id,
cssClass,value,handler){var button=window.L.DomUtil.create("input",cssClass,container);button.id=id;
button.type="button";button.value=value;window.L.DomEvent.on(button,"mousedown",
window.L.DomEvent.preventDefault);window.L.DomEvent.on(button,"click",handler,this)};
Comment.prototype.parentOf=function(comment){
return this.sectionProperties.data.id===comment.sectionProperties.data.parent};
Comment.prototype.updateResolvedField=function(state){
this.sectionProperties.resolvedTextElement.innerText=state==="true"?_("Resolved"):""};
Comment.prototype.isNewPara=function(){var selection=window.getSelection();if(!selection.rangeCount
)return;var range=selection.getRangeAt(0);var cursorPosition=range.startOffset;
var node=range.startContainer;var beforeCursor=node.textContent.slice(0,cursorPosition);
return/^\s*$/.test(beforeCursor.slice(0,-1))};Comment.prototype.textAreaInput=function(ev){var _a;
this.sectionProperties.autoSave.innerText="";if(ev&&app.map._docLayer._docType==="text"){(
_a=this.map)===null||_a===void 0?void 0:_a.mention.handleMentionInput(ev,this.isNewPara())}};
Comment.prototype.handleKeyDownForPopup=function(ev,id){
var popup=this.map._textInput._handleKeyDownForPopup(ev,id);if(
popup&&id==="mentionPopup"&&ev.key==="Escape"){ev.preventDefault();ev.stopPropagation()}};
Comment.prototype.textAreaKeyDown=function(ev){var _a;if(ev&&ev.ctrlKey&&ev.key==="Enter"){(
_a=this.map.mention)===null||_a===void 0?void 0:_a.closeMentionPopup(false);if(
this.sectionProperties.nodeReplyText.id==ev.srcElement.id){this.handleReplyCommentButton(ev)}else{
this.handleSaveCommentButton(ev)}return}this.handleKeyDownForPopup(ev,"mentionPopup")};
Comment.prototype.updateContent=function(){if(this.sectionProperties.data.html
)this.sectionProperties.contentText.innerHTML=app.LOUtil.sanitize(this.sectionProperties.data.html
);else this.sectionProperties.contentText.innerText=this.sectionProperties.data.text?this.sectionProperties.data.text:""
var linkedText=Autolinker.link(this.sectionProperties.contentText.outerHTML);
this.sectionProperties.contentText.innerHTML=app.LOUtil.sanitize(linkedText);
this.sectionProperties.contentText.origText=this.sectionProperties.data.text?this.sectionProperties.data.text:""
this.sectionProperties.contentText.origHTML=this.sectionProperties.data.html?this.sectionProperties.data.html:""
this.sectionProperties.nodeModifyText.innerText=this.sectionProperties.data.text?this.sectionProperties.data.text:""
if(this.sectionProperties.data.html){
this.sectionProperties.nodeModifyText.innerHTML=app.LOUtil.sanitize(this.sectionProperties.data.html
)}this.sectionProperties.contentAuthor.innerText=this.sectionProperties.data.author;
this.updateResolvedField(this.sectionProperties.data.resolved);if(this.sectionProperties.data.avatar
){this.sectionProperties.authorAvatarImg.setAttribute("src",this.sectionProperties.data.avatar)
}else{$(this.sectionProperties.authorAvatarImg).css("padding-top","4px")}
var user=this.map.getViewId(this.sectionProperties.data.author);if(user>=0){
var color=app.LOUtil.rgbToHex(this.map.getViewColor(user));
this.sectionProperties.authorAvatartdImg.style.borderColor=color}var d=new Date(
this.sectionProperties.data.dateTime.replace(/,.*/,""));var dateOptions={weekday:"short",
year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"};
this.sectionProperties.contentDate.innerText=isNaN(d.getTime()
)?this.sectionProperties.data.dateTime:d.toLocaleDateString(String.locale,dateOptions);if(
this.sectionProperties.data.trackchange){
this.sectionProperties.captionText.innerText=this.sectionProperties.data.description}};
Comment.prototype.updateLayout=function(){var style=this.sectionProperties.wrapper.style;
style.width="";style.whiteSpace="nowrap";style.whiteSpace=""};
Comment.prototype.setPositionAndSize=function(){
var rectangles=this.sectionProperties.data.rectanglesOriginal;if(
rectangles&&app.map._docLayer._docType==="text"){var xMin=Infinity,yMin=Infinity,xMax=0,yMax=0;for(
var i=0;i<rectangles.length;i++){if(rectangles[i][0]<xMin)xMin=rectangles[i][0];if(rectangles[i][1
]<yMin)yMin=rectangles[i][1];if(rectangles[i][0]+rectangles[i][2]>xMax)xMax=rectangles[i][0
]+rectangles[i][2];if(rectangles[i][1]+rectangles[i][3]>yMax)yMax=rectangles[i][1]+rectangles[i][3]}
xMin=Math.round(xMin*app.twipsToPixels);yMin=Math.round(yMin*app.twipsToPixels);xMax=Math.round(
xMax*app.twipsToPixels);yMax=Math.round(yMax*app.twipsToPixels);this.setPosition(xMin,yMin);
this.size=[xMax-xMin,yMax-yMin];if(this.size[0]<5)this.size[0]=5}else if(
this.sectionProperties.data.cellRange&&app.map._docLayer._docType==="spreadsheet"){
this.size=this.calcCellSize();var cellPos=app.map._docLayer._cellRangeToTwipRect(
this.sectionProperties.data.cellRange).toRectangle();var startX=cellPos[0];if(this.isCalcRTL()){
var sizeX=cellPos[2];startX+=sizeX}this.setShowSection(true);var position=[Math.round(cellPos[0
]*app.twipsToPixels),Math.round(cellPos[1]*app.twipsToPixels)];this.setPosition(position[0],
position[1])}else if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){this.size=[
Math.round(this.sectionProperties.imgSize[0]*app.dpiScale),Math.round(
this.sectionProperties.imgSize[1]*app.dpiScale)];this.setPosition(Math.round(
this.sectionProperties.data.rectangle[0]*app.twipsToPixels),Math.round(
this.sectionProperties.data.rectangle[1]*app.twipsToPixels))}};
Comment.prototype.removeHighlight=function(){if(app.map._docLayer._docType==="text"){
this.sectionProperties.usedTextColor=this.sectionProperties.data.color;
this.sectionProperties.isHighlighted=false}else if(app.map._docLayer._docType==="spreadsheet"){
this.backgroundColor=null;this.backgroundOpacity=1}};Comment.prototype.highlight=function(){if(
app.map._docLayer._docType==="text"){
this.sectionProperties.usedTextColor=this.sectionProperties.highlightedTextColor;var x=Math.round(
this.position[0]/app.dpiScale);var y=Math.round(this.position[1]/app.dpiScale);
this.containerObject.getSectionWithName(app.CSections.Scroll.name).onScrollTo({x:x,y:y})}else if(
app.map._docLayer._docType==="spreadsheet"){this.backgroundColor="#777777";
this.backgroundOpacity=.25;var x=Math.round(this.position[0]/app.dpiScale);var y=Math.round(
this.position[1]/app.dpiScale);this.containerObject.getSectionWithName(app.CSections.Scroll.name
).onScrollTo({x:x,y:y})}else if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){
var x=Math.round(this.position[0]/app.dpiScale);var y=Math.round(this.position[1]/app.dpiScale);
this.containerObject.getSectionWithName(app.CSections.Scroll.name).onScrollTo({x:x,y:y})}
this.containerObject.requestReDraw();this.sectionProperties.isHighlighted=true};
Comment.doesRectIntersectView=function(pos,size,viewContext){
var paneBoundsList=viewContext.paneBoundsList;var endPos=[pos[0]+size[0],pos[1]+size[1]];for(
var i=0;i<paneBoundsList.length;++i){var paneBounds=paneBoundsList[i];var rectInvisible=endPos[0
]<paneBounds.min.x||endPos[1]<paneBounds.min.y||pos[0]>paneBounds.max.x||pos[1]>paneBounds.max.y;if(
!rectInvisible)return true}return false};
Comment.prototype.convertRectanglesToCoreCoordinates=function(){
var pixelBasedOrgRectangles=new Array;var originals=this.sectionProperties.data.rectanglesOriginal;
var pos,size;if(originals){for(var i=0;i<originals.length;i++){pos=[Math.round(originals[i][0
]*app.twipsToPixels),Math.round(originals[i][1]*app.twipsToPixels)];size=[Math.round(originals[i][2
]*app.twipsToPixels),Math.round(originals[i][3]*app.twipsToPixels)];pixelBasedOrgRectangles.push([
pos[0],pos[1],size[0],size[1]])}
this.sectionProperties.pixelBasedOrgRectangles=pixelBasedOrgRectangles}};
Comment.prototype.convertRectanglesToViewCoordinates=function(){
var rectangles=this.sectionProperties.data.rectangles;
var originals=this.sectionProperties.data.rectanglesOriginal;
var viewContext=this.map.getTileSectionMgr()._paintContext();var intersectsVisibleArea=false;var pos
,size;if(rectangles){var documentAnchorSection=this.containerObject.getDocumentAnchorSection();
var diff=[documentAnchorSection.myTopLeft[0]-app.activeDocument.activeView.viewedRectangle.pX1,
documentAnchorSection.myTopLeft[1]-app.activeDocument.activeView.viewedRectangle.pY1];for(
var i=0;i<rectangles.length;i++){pos=[Math.round(originals[i][0]*app.twipsToPixels),Math.round(
originals[i][1]*app.twipsToPixels)];size=[Math.round(originals[i][2]*app.twipsToPixels),Math.round(
originals[i][3]*app.twipsToPixels)];if(!intersectsVisibleArea&&Comment.doesRectIntersectView(pos,
size,viewContext))intersectsVisibleArea=true;rectangles[i][0]=pos[0]+diff[0];rectangles[i][1]=pos[1
]+diff[1];rectangles[i][2]=size[0];rectangles[i][3]=size[1]}}else if(
this.sectionProperties.data.trackchange&&this.sectionProperties.data.anchorPos){
pos=this.getPosition();size=this.getSize();intersectsVisibleArea=Comment.doesRectIntersectView(pos,
size,viewContext)}return intersectsVisibleArea};Comment.prototype.getPosition=function(){if(
this.sectionProperties.data.trackchange&&this.sectionProperties.data.anchorPos){
var anchorPos=this.sectionProperties.data.anchorPos;return[Math.round(anchorPos[0]*app.twipsToPixels
),Math.round(anchorPos[1]*app.twipsToPixels)]}else{return this.position}};
Comment.prototype.getSize=function(){if(
this.sectionProperties.data.trackchange&&this.sectionProperties.data.anchorPos){
var anchorPos=this.sectionProperties.data.anchorPos;return[Math.round(anchorPos[2]*app.twipsToPixels
),Math.round(anchorPos[3]*app.twipsToPixels)]}else{return this.size}};
Comment.prototype.updatePosition=function(){this.convertRectanglesToViewCoordinates();
this.convertRectanglesToCoreCoordinates();this.setPositionAndSize();if(
app.map._docLayer._docType==="spreadsheet")this.positionCalcComment();else if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){if(
this.sectionProperties.commentMarkerSubSection!==null){
this.sectionProperties.commentMarkerSubSection.sectionProperties.data=this.sectionProperties.data;
this.sectionProperties.commentMarkerSubSection.setPosition(this.sectionProperties.data.anchorPos[0
]*app.twipsToPixels,this.sectionProperties.data.anchorPos[1]*app.twipsToPixels)}}};
Comment.prototype.createMarkerSubSection=function(){if(this.sectionProperties.data.rectangle===null
)return;var showMarker=app.impress.partList[app.map._docLayer._selectedPart
].hash===this.sectionProperties.data.parthash||app.file.fileBasedView;
this.sectionProperties.commentMarkerSubSection=new CommentMarkerSubSection(
this.name+this.sectionProperties.data.id+String(Math.random()),28,28,new cool.SimplePoint(
this.sectionProperties.data.anchorPos[0],this.sectionProperties.data.anchorPos[1]),
"annotation-marker",showMarker,this,this.sectionProperties.data);app.sectionContainer.addSection(
this.sectionProperties.commentMarkerSubSection)};Comment.prototype.isContainerVisible=function(){
return this.sectionProperties.container.style&&this.sectionProperties.container.style.display!=="none"&&(
this.sectionProperties.container.style.visibility==="visible"||this.sectionProperties.container.style.visibility===""
)};Comment.prototype.update=function(){this.updateContent();this.updateLayout();this.updatePosition(
)};Comment.prototype.showMarker=function(){if(this.sectionProperties.commentMarkerSubSection!=null){
this.sectionProperties.commentMarkerSubSection.showSection=true;
this.sectionProperties.commentMarkerSubSection.onSectionShowStatusChange()}};
Comment.prototype.hideMarker=function(){if(this.sectionProperties.commentMarkerSubSection!=null){
this.sectionProperties.commentMarkerSubSection.showSection=false;
this.sectionProperties.commentMarkerSubSection.onSectionShowStatusChange()}};
Comment.prototype.showWriter=function(){if(!this.isCollapsed||this.isSelected()){
this.sectionProperties.container.style.visibility="";
this.sectionProperties.container.style.display=""}if(
this.sectionProperties.data.resolved!=="true"||this.sectionProperties.commentListSection.sectionProperties.showResolved
){window.L.DomUtil.addClass(this.sectionProperties.container,"cool-annotation-collapsed-show");
this.sectionProperties.showSelectedCoordinate=true}
this.sectionProperties.contentNode.style.display="";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="none";
this.sectionProperties.collapsedInfoNode.style.visibility="";this.cachedIsEdit=false};
Comment.prototype.showCalc=function(){this.sectionProperties.container.style.display="";
this.sectionProperties.contentNode.style.display="";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="none";this.cachedIsEdit=false;
this.positionCalcComment();if(!window.mode.isMobile()){
this.sectionProperties.commentListSection.select(this)}
this.sectionProperties.container.style.visibility=""};Comment.prototype.getCommentWidth=function(){
return parseFloat(getComputedStyle(this.sectionProperties.container).width)*app.dpiScale};
Comment.prototype.positionCalcComment=function(){if(!window.mode.isMobile()){
var cellPos=app.map._docLayer._cellRangeToTwipRect(this.sectionProperties.data.cellRange
).toRectangle();var originalSize=[Math.round(cellPos[2]*app.twipsToPixels),Math.round(cellPos[3
]*app.twipsToPixels)];var startX=this.isCalcRTL()?this.myTopLeft[0]-this.getCommentWidth(
):this.myTopLeft[0]+originalSize[0]-3;var pos=[Math.round(startX/app.dpiScale),Math.round(
this.myTopLeft[1]/app.dpiScale)];
this.sectionProperties.container.style.transform="translate3d("+pos[0]+"px, "+pos[1]+"px, 0px)"}};
Comment.prototype.showImpressDraw=function(){if(this.isInsideActivePart()){
this.sectionProperties.container.style.display="";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="none";
this.sectionProperties.contentNode.style.display="";this.cachedIsEdit=false;if(this.isSelected(
)||!this.isCollapsed){this.sectionProperties.container.style.visibility=""}else{
this.sectionProperties.container.style.visibility="hidden"}window.L.DomUtil.addClass(
this.sectionProperties.container,"cool-annotation-collapsed-show")}};
Comment.prototype.setLayoutClass=function(){this.sectionProperties.container.classList.remove(
"tracked-deleted-comment-show");this.sectionProperties.container.classList.remove(
"tracked-deleted-comment-hide");var showTrackedChanges=this.map["stateChangeHandler"].getItemValue(
".uno:ShowTrackedChanges")==="true";
var layoutClass=showTrackedChanges?"tracked-deleted-comment-show":"tracked-deleted-comment-hide";if(
this.sectionProperties.data.layoutStatus===CommentLayoutStatus.DELETED){
this.sectionProperties.container.classList.add(layoutClass)}};Comment.prototype.show=function(){
this.doPendingInitializationInView(true);if(this.hidden===false&&!this.isEdit())return;
this.showMarker();if(window.mode.isMobile(
)&&this.sectionProperties.container.parentElement===document.getElementById("document-container")
)this.sectionProperties.container.style.visibility="hidden";if(
cool.CommentSection.commentWasAutoAdded)return;if(app.map._docLayer._docType==="text"){
this.showWriter();this.hidden=false}else if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){
this.showImpressDraw();this.hidden=false}else if(app.map._docLayer._docType==="spreadsheet"
)this.showCalc();this.setLayoutClass()};Comment.prototype.hideWriter=function(){
this.sectionProperties.container.style.visibility="hidden";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="none";
this.sectionProperties.showSelectedCoordinate=false;window.L.DomUtil.removeClass(
this.sectionProperties.container,"cool-annotation-collapsed-show");this.cachedIsEdit=false;
this.hidden=true};Comment.prototype.hideCalc=function(){
this.sectionProperties.container.style.visibility="hidden";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="none";this.cachedIsEdit=false;if(
this.sectionProperties.commentListSection.sectionProperties.selectedComment===this
)this.sectionProperties.commentListSection.sectionProperties.selectedComment=null};
Comment.prototype.hideImpressDraw=function(){if(!this.isInsideActivePart()){
this.sectionProperties.container.style.display="none";this.hideMarker()}else{
this.sectionProperties.container.style.display="";if(this.isCollapsed
)this.sectionProperties.container.style.visibility="hidden";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="none";this.cachedIsEdit=false}
window.L.DomUtil.removeClass(this.sectionProperties.container,"cool-annotation-collapsed-show");
this.hidden=true};Comment.prototype.isAutoSaved=function(){
var autoSavedComment=cool.CommentSection.autoSavedComment;if(!autoSavedComment)return false;
var authorMatch=this.sectionProperties.data.author===this.map.getViewName(app.map._docLayer._viewId)
return authorMatch};Comment.prototype.hide=function(){if(this.hidden===true||this.isEdit()){return}
if(this.sectionProperties.data.id==="new"){this.sectionProperties.commentListSection.removeItem(
this.sectionProperties.data.id);return}if(app.map._docLayer._docType==="text")this.hideWriter(
);else if(app.map._docLayer._docType==="spreadsheet")this.hideCalc();else if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)this.hideImpressDraw()};Comment.prototype.isInsideActivePart=function(){
return this.sectionProperties.partIndex===app.map._docLayer._selectedPart};
Comment.prototype.menuOnMouseClick=function(e){$(this.sectionProperties.menu).contextMenu();
window.L.DomEvent.stopPropagation(e)};Comment.prototype.menuOnKeyPress=function(e){if(
e.code==="Space"||e.code==="Enter")$(this.sectionProperties.menu).contextMenu();
window.L.DomEvent.stopPropagation(e)};Comment.prototype.onMouseClick=function(e){if((
window.mode.isMobile()||window.mode.isTablet())&&this.map.getDocType(
)=="spreadsheet"&&!this.map.uiManager.mobileWizard.isOpen()){this.hide()}
window.L.DomEvent.stopPropagation(e);this.sectionProperties.commentListSection.click(this)};
Comment.prototype.onEscKey=function(e){if(window.mode.isDesktop()){if(e.keyCode===27){
this.onCancelClick(e)}else if(e.keyCode===33||e.keyCode===34){window.L.DomEvent.preventDefault(e);
var pos=e.keyCode===33?0:e.target.textLength;var currentPos=e.target.selectionStart;if(e.shiftKey){
var _a=__read(currentPos<=pos?[currentPos,pos]:[pos,currentPos],2),start=_a[0],end=_a[1];
e.target.setSelectionRange(start,end,currentPos>pos?"backward":"forward")}else{
e.target.setSelectionRange(pos,pos)}}}};Comment.prototype.handleReplyCommentButton=function(e){
cool.CommentSection.autoSavedComment=null;cool.CommentSection.commentWasAutoAdded=false;
this.textAreaInput(null);this.onReplyClick(e)};Comment.prototype.onReplyClick=function(e){
window.L.DomEvent.stopPropagation(e);if(window.mode.isMobile()){
this.sectionProperties.data.reply=this.sectionProperties.data.text;
this.sectionProperties.commentListSection.saveReply(this)}else{this.removeLastBRTag(
this.sectionProperties.nodeReplyText);
this.sectionProperties.data.reply=this.sectionProperties.nodeReplyText.innerText;
this.sectionProperties.data.html=this.sectionProperties.nodeReplyText.innerHTML;
this.sectionProperties.nodeReplyText.innerText="";this.show();
this.sectionProperties.commentListSection.saveReply(this)}};
Comment.prototype.handleCancelCommentButton=function(e){if(cool.CommentSection.commentWasAutoAdded){
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).remove(
this.sectionProperties.data.id)}if(cool.CommentSection.autoSavedComment){
this.sectionProperties.contentText.origText=this.sectionProperties.contentText.uneditedText;
this.sectionProperties.contentText.uneditedText=null;
this.sectionProperties.contentText.origHTML=this.sectionProperties.contentText.uneditedHTML;
this.sectionProperties.contentText.uneditedHTML=null}if(this.sectionProperties.contentText.origHTML
){this.sectionProperties.nodeModifyText.innerHTML=app.LOUtil.sanitize(
this.sectionProperties.contentText.origHTML)}else{
this.sectionProperties.nodeModifyText.innerText=this.sectionProperties.contentText.origText}
this.sectionProperties.nodeReplyText.innerText="";if(cool.CommentSection.autoSavedComment
)this.handleSaveCommentButton(e);this.onCancelClick(e);if(app.map._docLayer._docType==="spreadsheet"
)this.hideCalc();cool.CommentSection.commentWasAutoAdded=false;
cool.CommentSection.autoSavedComment=null};Comment.prototype.onCancelClick=function(e){if(e
)window.L.DomEvent.stopPropagation(e);if(this.sectionProperties.contentText.origHTML){
this.sectionProperties.nodeModifyText.innerHTML=app.LOUtil.sanitize(
this.sectionProperties.contentText.origHTML)}else{
this.sectionProperties.nodeModifyText.innerText=this.sectionProperties.contentText.origText}
this.sectionProperties.nodeReplyText.innerText="";if(app.map._docLayer._docType!=="spreadsheet"
)this.show();this.sectionProperties.commentListSection.cancel(this)};
Comment.prototype.handleSaveCommentButton=function(e){cool.CommentSection.autoSavedComment=null;
cool.CommentSection.commentWasAutoAdded=false;this.sectionProperties.contentText.uneditedText=null;
this.sectionProperties.contentText.uneditedHTML=null;this.textAreaInput(null);this.onSaveComment(e)}
Comment.prototype.onSaveComment=function(e){this.sectionProperties.commentContainerRemoved=true;
window.L.DomEvent.stopPropagation(e);this.removeLastBRTag(this.sectionProperties.nodeModifyText);
this.sectionProperties.data.text=this.sectionProperties.nodeModifyText.innerText;
this.sectionProperties.data.html=this.sectionProperties.nodeModifyText.innerHTML;this.updateContent(
);if(!cool.CommentSection.autoSavedComment)this.show();
this.sectionProperties.commentListSection.save(this)};Comment.prototype.removeLastBRTag=function(
element){if(!window.L.Browser.gecko)return;var brElements=element.querySelectorAll("br");if(
brElements.length>0)brElements[brElements.length-1].remove()};
Comment.prototype.isNodeEmpty=function(){this.removeLastBRTag(this.sectionProperties.nodeModifyText)
if(
this.sectionProperties.nodeModifyText.innerText==""&&this.sectionProperties.nodeModifyText.innerHTML==""
)return true;return false};Comment.prototype.onLostFocus=function(e){var _a;if(!this.isEdit(
)||this.sectionProperties.container.contains(e.relatedTarget))return;if(
this.sectionProperties.nodeReply.contains(e.target)){this.onLostFocusReply(e);return}if(
app.map._docLayer._docType==="text"&&((_a=this.map.mention
)===null||_a===void 0?void 0:_a.isTypingMention())){return}if(
!this.sectionProperties.commentContainerRemoved){this.cachedIsEdit=false;$(
this.sectionProperties.container).removeClass(
"annotation-active reply-annotation-container modify-annotation-container");this.removeLastBRTag(
this.sectionProperties.nodeModifyText);if(
this.sectionProperties.contentText.origText!==this.sectionProperties.nodeModifyText.innerText||this.sectionProperties.contentText.origHTML!==this.sectionProperties.nodeModifyText.innerHTML
){if(!document.hasFocus())app.definitions.CommentSection.needFocus=this;if(
!this.sectionProperties.contentText.uneditedHTML
)this.sectionProperties.contentText.uneditedHTML=this.sectionProperties.contentText.origHTML;if(
!this.sectionProperties.contentText.uneditedText
)this.sectionProperties.contentText.uneditedText=this.sectionProperties.contentText.origText;
cool.CommentSection.autoSavedComment=this;this.onSaveComment(e)}else if(this.containerObject.testing
){var insertButton=document.getElementById("menu-insertcomment");if(insertButton){if(
window.getComputedStyle(insertButton).display==="none"){this.onCancelClick(e)}}}else if(
app.map._docLayer._docType==="text"&&this.isNodeEmpty())this.onCancelClick(e)}};
Comment.prototype.onLostFocusReply=function(e){var _a;if(app.map._docLayer._docType==="text"&&((
_a=this.map.mention)===null||_a===void 0?void 0:_a.isTypingMention())){return}if(
this.sectionProperties.nodeReplyText.innerText!==""){if(!document.hasFocus()
)app.definitions.CommentSection.needFocus=this;if(!this.sectionProperties.contentText.uneditedHTML
)this.sectionProperties.contentText.uneditedHTML=this.sectionProperties.contentText.origHTML;if(
!this.sectionProperties.contentText.uneditedText
)this.sectionProperties.contentText.uneditedText=this.sectionProperties.contentText.origText;
cool.CommentSection.autoSavedComment=this;this.onReplyClick(e)}else{
this.sectionProperties.nodeReply.style.display="none";if(
!this.sectionProperties.nodeModify||this.sectionProperties.nodeModify.style.display==="none"
)this.cachedIsEdit=false}};Comment.prototype.focus=function(){
this.sectionProperties.container.classList.add("annotation-active");
this.sectionProperties.nodeModifyText.focus({focusVisible:true});
this.sectionProperties.nodeReplyText.focus({focusVisible:true});if(this.isModifying(
)&&this.sectionProperties.nodeModifyText.childNodes.length>0){var range=document.createRange();
var sel=document.getSelection();range.setStartAfter(this.sectionProperties.nodeModifyText.lastChild)
range.collapse(true);sel.removeAllRanges();sel.addRange(range)}};Comment.prototype.reply=function(){
this.sectionProperties.container.classList.add("reply-annotation-container");
this.sectionProperties.container.style.visibility="";
this.sectionProperties.contentNode.style.display="";
this.sectionProperties.nodeModify.style.display="none";
this.sectionProperties.nodeReply.style.display="";this.cachedIsEdit=true;return this};
Comment.prototype.edit=function(){this.doPendingInitializationInView(true);
this.sectionProperties.container.classList.add("modify-annotation-container");
this.sectionProperties.nodeModify.style.display="";
this.sectionProperties.nodeReply.style.display="none";
this.sectionProperties.container.style.visibility="";
this.sectionProperties.contentNode.style.display="none";this.cachedIsEdit=true;return this};
Comment.prototype.isEdit=function(){return this.cachedIsEdit};
Comment.prototype.isModifying=function(){
return!this.pendingInit&&this.sectionProperties.nodeModify&&this.sectionProperties.nodeModify.style.display!=="none"
};Comment.isAnyEdit=function(){
var section=app.sectionContainer&&app.sectionContainer instanceof CanvasSectionContainer?app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name):null;if(!section){return null}
var commentList=section.sectionProperties.commentList;for(var i in commentList){
var modifyNode=commentList[i].sectionProperties.nodeModify;var replyNode=commentList[i
].sectionProperties.nodeReply;if(!commentList[i].pendingInit&&(
modifyNode&&modifyNode.style.display!=="none"||replyNode&&replyNode.style.display!=="none")
)return commentList[i]}return null};Comment.isAnyFocus=function(){var comment_=Comment.isAnyEdit();
if(comment_&&(
document.activeElement===comment_.sectionProperties.nodeModifyText||document.activeElement===comment_.sectionProperties.nodeReplyText
))return true;return false};Comment.prototype.isDisplayed=function(){
return this.sectionProperties.container.style&&this.sectionProperties.container.style.visibility===""
};Comment.prototype.onResize=function(){this.updatePosition()};
Comment.prototype.isSelected=function(){
return this.sectionProperties.commentListSection.sectionProperties.selectedComment===this};
Comment.prototype.doesRectangleContainPoint=function(rectangle,point){if(point[0]>=rectangle[0
]&&point[0]<=rectangle[0]+rectangle[2]){if(point[1]>=rectangle[1]&&point[1]<=rectangle[1]+rectangle[
3]){return true}}return false};Comment.prototype.checkIfCursorIsOnThisCommentWriter=function(
rectangles,point){for(var i=0;i<rectangles.length;i++){if(this.doesRectangleContainPoint(rectangles[
i],point)){if(!this.isSelected()){this.sectionProperties.commentListSection.selectById(
this.sectionProperties.data.id)}this.stopPropagating();return}}if(this.isSelected()){if(
this.isCollapsed)this.setCollapsed();this.sectionProperties.commentListSection.unselect()}};
Comment.prototype.onCursorPositionChanged=function(newPosition){var x=newPosition.pX1;
var y=Math.round(newPosition.pCenter[1]);if(this.sectionProperties.pixelBasedOrgRectangles){
this.checkIfCursorIsOnThisCommentWriter(this.sectionProperties.pixelBasedOrgRectangles,[x,y])}};
Comment.prototype.onCellAddressChanged=function(){if(this.sectionProperties.data.rectangles){
var midX=this.containerObject.getDocumentAnchor()[0]+Math.round(
app.calc.cellCursorRectangle.pCenter[0]);var midY=this.containerObject.getDocumentAnchor()[1
]+Math.round(app.calc.cellCursorRectangle.pCenter[1]);if(
midX>this.sectionProperties.data.rectangles[0][0]&&midX<this.sectionProperties.data.rectangles[0][0
]+this.sectionProperties.data.rectangles[0][2]&&midY>this.sectionProperties.data.rectangles[0][1
]&&midY<this.sectionProperties.data.rectangles[0][1]+this.sectionProperties.data.rectangles[0][3]){
this.sectionProperties.commentListSection.sectionProperties.calcCurrentComment=this}else if(
this.isSelected()){this.hide();
this.sectionProperties.commentListSection.sectionProperties.calcCurrentComment=null}else if(
this.sectionProperties.commentListSection.sectionProperties.calcCurrentComment==this
)this.sectionProperties.commentListSection.sectionProperties.calcCurrentComment=null}};
Comment.prototype.onClick=function(point,e){if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){
this.sectionProperties.commentListSection.selectById(this.sectionProperties.data.id);
e.stopPropagation();this.stopPropagating()}};Comment.prototype.onDraw=function(){if(
this.sectionProperties.showSelectedCoordinate){if(app.map._docLayer._docType==="text"){
var rectangles=this.sectionProperties.data.rectangles;if(rectangles){
this.context.fillStyle=this.sectionProperties.usedTextColor;this.context.globalAlpha=.25;for(
var i=0;i<this.sectionProperties.data.rectangles.length;i++){var x=rectangles[i][0]-this.myTopLeft[0
];var y=rectangles[i][1]-this.myTopLeft[1];var w=rectangles[i][2]>3?rectangles[i][2]:3;
var h=rectangles[i][3];this.context.fillRect(x,y,w,h)}this.context.globalAlpha=1}}else if(
app.map._docLayer._docType==="spreadsheet"&&parseInt(this.sectionProperties.data.tab
)===app.map._docLayer._selectedPart){var cellSize=this.calcCellSize();if(cellSize[0]!==0&&cellSize[1
]!==0){var margin=1;var baseSize=2;var zoom=this.map.getZoom();var squareDim=baseSize+zoom;
var isRTL=this.isCalcRTL();var x=isRTL?margin:cellSize[0]-squareDim-margin;
var commentColor=getComputedStyle(document.body).getPropertyValue("--color-calc-comment");
this.context.fillStyle=commentColor;var region=new Path2D;region.moveTo(x,0);region.lineTo(
x+squareDim,0);region.lineTo(x+(isRTL?0:squareDim),squareDim);region.closePath();this.context.fill(
region)}}}};Comment.prototype.onMouseUp=function(point,e){if(
!this.containerObject.isDraggingSomething()&&window.mode.isMobile()||window.mode.isTablet()){if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)app.map._docLayer._openCommentWizard(this);this.onMouseEnter();this.onClick(point,e)}};
Comment.prototype.calcContinueWithMouseEvent=function(){if(
app.map._docLayer._docType==="spreadsheet"){var conditions=!this.isEdit();if(conditions){
var sc=this.sectionProperties.commentListSection.sectionProperties.selectedComment;if(sc
)conditions=sc.sectionProperties.data.id!=="new"}return conditions}else{return false}};
Comment.prototype.calcCellSize=function(){var cellPos=app.map._docLayer._cellRangeToTwipRect(
this.sectionProperties.data.cellRange).toRectangle();return[Math.round(cellPos[2]*app.twipsToPixels)
,Math.round(cellPos[3]*app.twipsToPixels)]};Comment.prototype.onMouseEnter=function(){if(
this.calcContinueWithMouseEvent()){if(parseInt(this.sectionProperties.data.tab
)===app.map._docLayer._selectedPart){
var sc=this.sectionProperties.commentListSection.sectionProperties.selectedComment;if(sc){if(
!sc.isEdit())sc.hide();else return}
var containerWidth=this.sectionProperties.container.getBoundingClientRect().width;
var cellPos=app.map._docLayer._cellRangeToTwipRect(this.sectionProperties.data.cellRange
).toRectangle();this.size=[Math.round(cellPos[2]*app.twipsToPixels+containerWidth),Math.round(
cellPos[3]*app.twipsToPixels)];this.sectionProperties.commentListSection.selectById(
this.sectionProperties.data.id);this.show()}}};Comment.prototype.onMouseLeave=function(point){if(
this.calcContinueWithMouseEvent()){if(parseInt(this.sectionProperties.data.tab
)===app.map._docLayer._selectedPart){this.size=this.calcCellSize();if(point){this.hide()}}}};
Comment.prototype.onNewDocumentTopLeft=function(){this.doPendingInitializationInView();
this.updatePosition()};Comment.prototype.onCommentDataUpdate=function(){
this.doPendingInitializationInView();this.updatePosition()};Comment.prototype.onRemove=function(){
this.sectionProperties.commentContainerRemoved=true;if(
this.sectionProperties.commentListSection.sectionProperties.selectedComment===this
)this.sectionProperties.commentListSection.sectionProperties.selectedComment=null;
this.sectionProperties.commentListSection.hideArrow();var container=this.sectionProperties.container
if(this.sectionProperties.commentMarkerSubSection!==null)app.sectionContainer.removeSection(
this.sectionProperties.commentMarkerSubSection.name);if(container&&container.parentElement){var c=0;
while(c<10){try{container.parentElement.removeChild(container);break}catch(e){c++}}}};
Comment.prototype.isRootComment=function(){return this.sectionProperties.data.parent==="0"};
Comment.prototype.setAsRootComment=function(){this.sectionProperties.data.parent="0";if(
app.map._docLayer._docType==="text")this.sectionProperties.data.parentId="0"};
Comment.prototype.getChildrenLength=function(){return this.sectionProperties.children.length};
Comment.prototype.getChildByIndex=function(index){if(this.sectionProperties.children.length>index
)return this.sectionProperties.children[index];else return null};
Comment.prototype.removeChildByIndex=function(index){if(this.sectionProperties.children.length>index
)this.sectionProperties.children.splice(index,1)};Comment.prototype.getParentCommentId=function(){
if(this.sectionProperties.data.parent&&this.sectionProperties.data.parent!=="0"
)return this.sectionProperties.data.parent;else return null};
Comment.prototype.getIndexOfChild=function(comment){return this.sectionProperties.children.indexOf(
comment)};Comment.prototype.getChildLevel=function(){if(this.isRootComment())return 0;
var parentComment=this.sectionProperties.commentListSection.getComment(this.getParentCommentId());
if(parentComment)return parentComment.getChildLevel()+1;return 1};
Comment.prototype.getCommentHeight=function(invalidateCache){if(invalidateCache===void 0){
invalidateCache=true}if(invalidateCache)this.cachedCommentHeight=null;if(
this.cachedCommentHeight===null
)this.cachedCommentHeight=this.sectionProperties.container.getBoundingClientRect(
).height-this.sectionProperties.childLinesNode.getBoundingClientRect().height;
return this.cachedCommentHeight};Comment.prototype.setCollapsed=function(){this.isCollapsed=true;if(
!this.isEdit())this.show();if(this.isRootComment(
)||app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){
this.sectionProperties.container.style.display="";
this.sectionProperties.container.style.visibility="hidden"}this.updateThreadInfoIndicator();if(
this.sectionProperties.data.resolved==="false"||this.sectionProperties.commentListSection.sectionProperties.showResolved||app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)window.L.DomUtil.addClass(this.sectionProperties.container,"cool-annotation-collapsed-show")};
Comment.prototype.updateThreadInfoIndicator=function(replycount){if(replycount===void 0){
replycount=-1}if(app.map._docLayer._docType==="spreadsheet")return;var innerText;if(this.isEdit()
)innerText="!";else if(replycount==="!"||typeof replycount==="number"&&replycount>0
)innerText=replycount;else innerText="";if(
this.sectionProperties.collapsedInfoNode.innerText!=innerText
)this.sectionProperties.collapsedInfoNode.innerText=innerText;if(
innerText===""||this.isContainerVisible()
)this.sectionProperties.collapsedInfoNode.style.display="none";else if(!this.isContainerVisible(
)&&this.sectionProperties.collapsedInfoNode.innerText!==""
)this.sectionProperties.collapsedInfoNode.style.display=""};Comment.prototype.setExpanded=function(
){if(!this.isCollapsed)return;this.isCollapsed=false;if(app.map.getDocType(
)!=="text"||this.sectionProperties.data.resolved==="false"||this.sectionProperties.commentListSection.sectionProperties.showResolved
){this.sectionProperties.container.style.display="";
this.sectionProperties.container.style.visibility=""}if(app.map._docLayer._docType==="text"
)this.sectionProperties.collapsedInfoNode.style.display="none";window.L.DomUtil.removeClass(
this.sectionProperties.container,"cool-annotation-collapsed-show")};
Comment.prototype.selectText=function(startParagraph,startIndex,endParagraph,endIndex){
var selection=window.getSelection();selection.removeAllRanges();var paragraphElements=Array.from(
this.sectionProperties.contentText.firstChild.children);if(paragraphElements.length===0){return}if(
startParagraph>paragraphElements.length-1||endParagraph>paragraphElements.length-1){return}
var startElement=paragraphElements[startParagraph];var startWalker=document.createTreeWalker(
startElement,NodeFilter.SHOW_TEXT,null);var startTextNode=startWalker.nextNode();if(!startTextNode){
return}var endElement=paragraphElements[endParagraph];var endWalker=document.createTreeWalker(
endElement,NodeFilter.SHOW_TEXT,null);var endTextNode=endWalker.nextNode();if(!endTextNode)return;
var range=document.createRange();range.setStart(startTextNode,startIndex);range.setEnd(endTextNode,
endIndex);selection.addRange(range);this.sectionProperties.contentText.focus()};
Comment.prototype.autoCompleteMention=function(username,profileLink,replacement){var _a,_b,_c;
var selection=window.getSelection();if(!selection.rangeCount)return;var range=selection.getRangeAt(0
);var cursorPosition=range.endOffset;var container=range.startContainer;
var containerText=container.textContent||"";var mentionStart=containerText.lastIndexOf(replacement,
cursorPosition);if(mentionStart!==-1){var mentionEnd=mentionStart+replacement.length;
var beforeMention=containerText.substring(0,mentionStart);var afterMention=containerText.substring(
mentionEnd);var hyperlink=document.createElement("a");hyperlink.href=profileLink;
hyperlink.textContent="@"+username;container.textContent=beforeMention;(_a=container.parentNode
)===null||_a===void 0?void 0:_a.insertBefore(hyperlink,container.nextSibling);
var afterTextNode=document.createTextNode(afterMention);var extraSpaceNode=document.createTextNode(
" ");(_b=hyperlink.parentNode)===null||_b===void 0?void 0:_b.insertBefore(extraSpaceNode,
hyperlink.nextSibling);(_c=hyperlink.parentNode)===null||_c===void 0?void 0:_c.insertBefore(
afterTextNode,extraSpaceNode.nextSibling);var newRange=document.createRange();
newRange.setStartAfter(extraSpaceNode);newRange.setEndAfter(extraSpaceNode);
selection.removeAllRanges();selection.addRange(newRange)}};Comment.editCommentLabel=_("Edit comment"
);Comment.replyCommentLabel=_("Reply comment");Comment.openMenuLabel=_("Open menu");return Comment}(
CanvasSectionObject);cool.Comment=Comment})(cool||(cool={}));app.definitions.Comment=cool.Comment;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
window.L.Map.include({insertComment:function(){if(this.stateChangeHandler.getItemValue(
"InsertAnnotation")==="disabled")return;if(cool.Comment.isAnyEdit()){
cool.CommentSection.showCommentEditingWarning();return}var avatar=undefined;
var author=this.getViewName(this._docLayer._viewId);if(author in this._viewInfoByUserName){
avatar=this._viewInfoByUserName[author].userextrainfo.avatar}this._docLayer.newAnnotation({text:"",
textrange:"",author:author,dateTime:(new Date).toISOString(),id:"new",avatar:avatar})},
showResolvedComments:function(on){var unoCommand=".uno:ShowResolvedAnnotations";this.sendUnoCommand(
unoCommand);app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).setViewResolved(
on);this.uiManager.setDocTypePref("ShowResolved",on?true:false)},showComments:function(on){
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).setView(on);
this.uiManager.setDocTypePref("showannotations",on?true:false);this.fire("commandstatechanged",{
commandName:"showannotations",state:on?"true":"false"});this.fire("showannotationschanged",{
state:on?"true":"false"})}});var cool;(function(cool){var CommentSection=function(_super){__extends(
CommentSection,_super);function CommentSection(){var _this=_super.call(this,
app.CSections.CommentList.name)||this;_this.backgroundColor=app.sectionContainer.getClearColor();
_this.expand=["bottom"];_this.processingOrder=app.CSections.CommentList.processingOrder;
_this.drawingOrder=app.CSections.CommentList.drawingOrder;
_this.zIndex=app.CSections.CommentList.zIndex;_this.interactable=false;
_this.disableLayoutAnimation=false;_this.mobileCommentId="new-annotation-dialog";
_this.map=window.L.Map.THIS;_this.anchor=["top","right"];
_this.sectionProperties.docLayer=_this.map._docLayer;_this.sectionProperties.commentList=new Array(0
);_this.sectionProperties.selectedComment=null;_this.sectionProperties.arrow=null;
_this.sectionProperties.show=null;_this.sectionProperties.showResolved=null;
_this.sectionProperties.marginY=10*app.dpiScale;_this.sectionProperties.offset=5*app.dpiScale;
_this.sectionProperties.width=Math.round(1*app.dpiScale);
_this.sectionProperties.scrollAnnotation=null;
_this.sectionProperties.commentWidth=200*1.3*app.dpiScale;
_this.sectionProperties.collapsedCommentWidth=32*1.5*app.dpiScale;
_this.sectionProperties.collapsedMarginToTheEdge=120;
_this.sectionProperties.deflectionOfSelectedComment=160;
_this.sectionProperties.showSelectedBigger=false;_this.sectionProperties.calcCurrentComment=null;
_this.sectionProperties.reLayout=true;_this.sectionProperties.commentsAreListed=(
app.map._docLayer._docType==="text"||app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)&&!window.mode.isMobile();_this.idIndexMap=new Map;
_this.mobileCommentModalId=_this.map.uiManager.generateModalId(_this.mobileCommentId);
_this.annotationMinSize=Number(getComputedStyle(document.documentElement).getPropertyValue(
"--annotation-min-size"));_this.annotationMaxSize=Number(getComputedStyle(document.documentElement
).getPropertyValue("--annotation-max-size"));return _this}
CommentSection.prototype.onInitialize=function(){this.checkCollapseState();this.map.on(
"RedlineAccept",this.onRedlineAccept,this);this.map.on("RedlineReject",this.onRedlineReject,this);
this.map.on("updateparts",this.showHideComments,this);this.map.on("AnnotationScrollUp",
this.onAnnotationScrollUp,this);this.map.on("AnnotationScrollDown",this.onAnnotationScrollDown,this)
this.map.on("commandstatechanged",function(event){if(
event.commandName===".uno:ShowResolvedAnnotations")this.setViewResolved(event.state==="true"
);else if(event.commandName==="showannotations")this.setView(event.state==="true");else if(
event.commandName===".uno:ShowTrackedChanges"&&event.state==="true")app.socket.sendMessage(
"commandvalues command=.uno:ViewAnnotations")},this);this.map.on("zoomend",function(){
this.checkCollapseState();this.layout(true)},this);
this.backgroundColor=this.containerObject.getClearColor();this.initializeContextMenus();if(
window.mode.isMobile()){this.setShowSection(false);this.size[0]=0}};
CommentSection.showCommentEditingWarning=function(){window.L.Map.THIS.uiManager.showInfoModal(
"annotation-editing",_("A comment is being edited"),_(
"Please save or discard the comment currently being edited."),null,_("Close"))};
CommentSection.prototype.checkCollapseState=function(){if(!window.mode.isMobile(
)&&app.map._docLayer._docType!=="spreadsheet"){if(this.shouldCollapse()){
this.sectionProperties.deflectionOfSelectedComment=180;this.setCollapsed()}else{
this.sectionProperties.deflectionOfSelectedComment=70;this.setExpanded()}if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)this.showHideComments()}};CommentSection.prototype.findNextPartWithComment=function(currentPart){
for(var i=0;i<this.sectionProperties.commentList.length;i++){if(this.sectionProperties.commentList[i
].sectionProperties.partIndex>currentPart){return this.sectionProperties.commentList[i
].sectionProperties.partIndex}}return-1};
CommentSection.prototype.findPreviousPartWithComment=function(currentPart){for(
var i=this.sectionProperties.commentList.length-1;i>-1;i--){if(this.sectionProperties.commentList[i
].sectionProperties.partIndex<currentPart){return this.sectionProperties.commentList[i
].sectionProperties.partIndex}}return-1};CommentSection.prototype.onAnnotationScrollDown=function(){
var index=this.findNextPartWithComment(app.map._docLayer._selectedPart);if(index>=0){
this.map.setPart(index)}};CommentSection.prototype.onAnnotationScrollUp=function(){
var index=this.findPreviousPartWithComment(app.map._docLayer._selectedPart);if(index>=0){
this.map.setPart(index)}};CommentSection.prototype.checkSize=function(){if(
app.map._docLayer._docType==="spreadsheet"||window.mode.isMobile(
)||this.sectionProperties.commentList.length===0){if(
app.map._docLayer._docType==="presentation"&&this.sectionProperties.scrollAnnotation){
this.map.removeControl(this.sectionProperties.scrollAnnotation);
this.sectionProperties.scrollAnnotation=null}}else if(app.map._docLayer._docType==="presentation"){
if(!this.sectionProperties.scrollAnnotation){
this.sectionProperties.scrollAnnotation=window.L.control.scrollannotation();
this.sectionProperties.scrollAnnotation.addTo(this.map)}}};
CommentSection.prototype.isEditing=function(){
var textBoxes=this.sectionProperties.commentList.flatMap(function(section){return[
section.sectionProperties.nodeModifyText,section.sectionProperties.nodeReplyText]}).filter(function(
textBox){return textBox!==undefined});return textBoxes.includes(document.activeElement)};
CommentSection.prototype.getActiveEdit=function(){if(!this.sectionProperties.selectedComment){
return null}if(this.sectionProperties.selectedComment.isEdit()){
return this.sectionProperties.selectedComment}var openArray=[];this.getChildren(
this.sectionProperties.selectedComment,openArray);for(var i=0;i<openArray.length;i++){if(openArray[i
].isEdit()){return openArray[i]}}return null};CommentSection.prototype.setCollapsed=function(){if(
this.isEditing()){return}this.isCollapsed=true;this.unselect();for(
var i=0;i<this.sectionProperties.commentList.length;i++){if(this.sectionProperties.commentList[i
].sectionProperties.data.id!=="new")this.sectionProperties.commentList[i].setCollapsed();$(
this.sectionProperties.commentList[i].sectionProperties.container).addClass("collapsed-comment");if(
this.sectionProperties.commentList[i].isRootComment())this.collapseReplies(i,
this.sectionProperties.commentList[i].sectionProperties.data.id)}};
CommentSection.prototype.setExpanded=function(){this.isCollapsed=false;for(
var i=0;i<this.sectionProperties.commentList.length;i++){this.sectionProperties.commentList[i
].setExpanded();$(this.sectionProperties.commentList[i].sectionProperties.container).removeClass(
"collapsed-comment")}};CommentSection.prototype.calculateAvailableSpace=function(){
var availableSpace=(this.containerObject.getDocumentAnchorSection().size[0
]-app.activeDocument.fileSize.pX)*.5;availableSpace=Math.round(availableSpace/app.dpiScale);
return availableSpace};CommentSection.prototype.shouldCollapse=function(){if(
!this.containerObject.getDocumentAnchorSection(
)||app.map._docLayer._docType==="spreadsheet"||window.mode.isMobile())return false;
var availableSpace=this.calculateAvailableSpace();
return availableSpace<this.sectionProperties.commentWidth&&availableSpace>this.sectionProperties.collapsedCommentWidth
};CommentSection.prototype.hideAllComments=function(){for(
var i=0;i<this.sectionProperties.commentList.length;i++){this.sectionProperties.commentList[i].hide(
);var part=app.map._docLayer._selectedPart;if(app.map._docLayer._docType==="spreadsheet"){if(
parseInt(this.sectionProperties.commentList[i].sectionProperties.data.tab)===part){
this.sectionProperties.commentList[i].drawingOrder=2}else{this.sectionProperties.commentList[i
].drawingOrder=1}}}if(app.map._docLayer._docType==="spreadsheet"
)this.containerObject.applyDrawingOrders()};CommentSection.prototype.getChildren=function(comment,
array){for(var i=0;i<comment.sectionProperties.children.length;i++){array.push(
comment.sectionProperties.children[i]);if(comment.sectionProperties.children[i
].sectionProperties.children.length>0)this.getChildren(comment.sectionProperties.children[i],array)}
};CommentSection.prototype.getCommentListOneDimensionalArray=function(){var openArray=[];for(
var i=0;i<this.sectionProperties.commentList.length;i++){if(this.sectionProperties.commentList[i
].isRootComment()){openArray.push(this.sectionProperties.commentList[i]);if(
this.sectionProperties.commentList[i].sectionProperties.children.length>0)this.getChildren(
this.sectionProperties.commentList[i],openArray)}}return openArray};
CommentSection.prototype.createCommentStructureWriter=function(menuStructure,threadOnly){
var rootComment,comment;var commentList=this.getCommentListOneDimensionalArray();
var showResolved=this.sectionProperties.showResolved;if(threadOnly){if(
!threadOnly.sectionProperties.data.trackchange&&threadOnly.sectionProperties.data.parent!=="0"
)threadOnly=commentList[this.getIndexOf(threadOnly.sectionProperties.data.parent)]}for(
var i=0;i<commentList.length;i++){if(commentList[i].isRootComment()||commentList[i
].sectionProperties.data.trackchange){var commentThread=[];do{comment={id:"comment"+commentList[i
].sectionProperties.data.id,enable:true,data:commentList[i].sectionProperties.data,type:"comment",
text:commentList[i].sectionProperties.data.text,annotation:commentList[i],children:[]};if(
showResolved||comment.data.resolved!=="true"){commentThread.unshift(comment)}i++}while(commentList[i
]&&commentList[i].sectionProperties.data.parent!=="0");i--;if(commentThread.length>0){rootComment={
id:commentThread[commentThread.length-1].id,enable:true,data:commentThread[commentThread.length-1
].data,type:"rootcomment",text:commentThread[commentThread.length-1].data.text,
annotation:commentThread[commentThread.length-1].annotation,children:commentThread};
var matchingThread=threadOnly&&threadOnly.sectionProperties.data.id===commentThread[0].data.id;if(
matchingThread)menuStructure["children"]=commentThread;else if(!threadOnly)menuStructure["children"
].push(rootComment)}}}};CommentSection.prototype.createCommentStructureImpress=function(
menuStructure,threadOnly){var rootComment;for(var i in this.sectionProperties.commentList){
var matchingThread=!threadOnly||threadOnly&&threadOnly.sectionProperties.data.id===this.sectionProperties.commentList[
i].sectionProperties.data.id;if(matchingThread&&(this.sectionProperties.commentList[i
].sectionProperties.partIndex===app.map._docLayer._selectedPart||app.file.fileBasedView)){
rootComment={id:"comment"+this.sectionProperties.commentList[i].sectionProperties.data.id,
enable:true,data:this.sectionProperties.commentList[i].sectionProperties.data,
type:threadOnly?"comment":"rootcomment",text:this.sectionProperties.commentList[i
].sectionProperties.data.text,annotation:this.sectionProperties.commentList[i],children:[]};
menuStructure["children"].push(rootComment)}}};
CommentSection.prototype.createCommentStructureCalc=function(menuStructure,threadOnly){
var rootComment;var commentList=this.sectionProperties.commentList;
var selectedTab=app.map._docLayer._selectedPart;for(var i=0;i<commentList.length;i++){
var matchingThread=!threadOnly||threadOnly&&threadOnly.sectionProperties.data.id===commentList[i
].sectionProperties.data.id;if(parseInt(commentList[i].sectionProperties.data.tab
)===selectedTab&&matchingThread){rootComment={id:"comment"+commentList[i].sectionProperties.data.id,
enable:true,data:commentList[i].sectionProperties.data,type:threadOnly?"comment":"rootcomment",
text:commentList[i].sectionProperties.data.text,annotation:commentList[i],children:[]};
menuStructure["children"].push(rootComment)}}};
CommentSection.prototype.createCommentStructure=function(menuStructure,threadOnly){if(
app.map._docLayer._docType==="text"){this.createCommentStructureWriter(menuStructure,threadOnly)
}else if(app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){
this.createCommentStructureImpress(menuStructure,threadOnly)}else if(
app.map._docLayer._docType==="spreadsheet"){this.createCommentStructureCalc(menuStructure,threadOnly
)}};CommentSection.prototype.isMobileCommentActive=function(){
var newComment=document.getElementById(this.mobileCommentId);if(!newComment)return false;
return newComment.style.display!=="none"};CommentSection.prototype.getMobileCommentModalId=function(
){return this.mobileCommentModalId};CommentSection.prototype.newAnnotationMobile=function(comment,
addCommentFn,isMod){var _this=this;var commentData=comment.sectionProperties.data;
var callback=function(div){if(div.textContent||div.innerHTML){var annotation=comment;
annotation.sectionProperties.data.text=div.textContent;
annotation.sectionProperties.data.html=div.innerHTML;comment.text=div.textContent;addCommentFn.call(
annotation,annotation,comment);if(!isMod)this.containerObject.removeSection(annotation)}else{
this.cancel(comment)}}.bind(this);var listId="mentionPopupList";if(this.map.mention
)listId=this.map.mention.getPopupId()+"List";var json=this.map.uiManager._modalDialogJSON(
this.mobileCommentId,"",true,[{id:"input-modal-input",type:"multilineedit",
text:commentData.text&&isMod?commentData.text:"",html:commentData.html&&isMod?commentData.html:"",
contenteditable:true},{id:listId,type:"treelistbox",text:"",enabled:true,singleclickactivate:false,
fireKeyEvents:true,hideIfEmpty:true,entries:[]},{id:"",type:"buttonbox",text:"",enabled:true,
children:[{id:"response-cancel",type:"pushbutton",text:_("Cancel")},{id:"response-ok",
type:"pushbutton",text:_("Save"),has_default:true}],vertical:false,layoutstyle:"end"}]);
var cancelFunction=function(){this.cancel(comment);this.map.uiManager.closeModal(
this.mobileCommentModalId)}.bind(this);var mentionListCallback=function(objectType,eventType,object,
index){var _a;var mention=this.map.mention;if(eventType==="close")mention.closeMentionPopup(false
);else if(eventType==="select"||eventType==="activate"){var item=mention.getMentionUserData(index);
var replacement="@"+mention.getPartialMention();var uid=(_a=item.label
)!==null&&_a!==void 0?_a:item.username;if(uid!==""&&item.profile!=="")comment.autoCompleteMention(
uid,item.profile,replacement);mention.closeMentionPopup(false)}}.bind(this);
this.map.uiManager.showModal(json,[{id:"response-ok",func:function(){if(typeof callback==="function"
){var input=document.getElementById("input-modal-input");callback(input)}
this.map.uiManager.closeModal(this.mobileCommentModalId)}.bind(this)},{id:"response-cancel",
func:cancelFunction},{id:"__POPOVER__",func:cancelFunction},{id:"__DIALOG__",func:cancelFunction},{
id:listId,func:mentionListCallback}]);app.layoutingService.appendLayoutingTask(function(){
var multilineEditDiv=document.getElementById("input-modal-input");multilineEditDiv.addEventListener(
"input",function(ev){var _a;if(ev&&app.map._docLayer._docType==="text"){(_a=this.map
)===null||_a===void 0?void 0:_a.mention.handleMentionInput(ev,comment.isNewPara())}}.bind(_this));
var tagTd="td",empty="",tagDiv="div";var author=window.L.DomUtil.create("table",
"cool-annotation-table");var tbody=window.L.DomUtil.create("tbody",empty,author);
var tr=window.L.DomUtil.create("tr",empty,tbody);var tdImg=window.L.DomUtil.create(tagTd,
"cool-annotation-img",tr);var tdAuthor=window.L.DomUtil.create(tagTd,"cool-annotation-author",tr);
var imgAuthor=window.L.DomUtil.create("img","avatar-img",tdImg);var user=_this.map.getViewId(
commentData.author);app.LOUtil.setUserImage(imgAuthor,_this.map,user);imgAuthor.setAttribute("width"
,32);imgAuthor.setAttribute("height",32);var authorAvatarImg=imgAuthor;
var contentAuthor=window.L.DomUtil.create(tagDiv,"cool-annotation-content-author",tdAuthor);
var contentDate=window.L.DomUtil.create(tagDiv,"cool-annotation-date",tdAuthor);$(contentAuthor
).text(commentData.author);$(authorAvatarImg).attr("src",commentData.avatar);if(user>=0){
var color=app.LOUtil.rgbToHex(_this.map.getViewColor(user));$(authorAvatarImg).css("border-color",
color)}if(commentData.dateTime){var d=new Date(commentData.dateTime.replace(/,.*/,"Z"));
var dateOptions={weekday:"short",year:"numeric",month:"short",day:"numeric"};$(contentDate).text(
isNaN(d.getTime())?comment.dateTime:d.toLocaleDateString(String.locale,dateOptions))}
var newAnnotationDialog=document.getElementById(_this.mobileCommentId);$(newAnnotationDialog).css(
"width","100%");var dialogInput=newAnnotationDialog.children[0];$(dialogInput).css("height","30vh");
var parent=newAnnotationDialog.parentElement;parent.insertBefore(author,parent.childNodes[0]);
document.getElementById("input-modal-input").focus()})};
CommentSection.prototype.highlightComment=function(comment){this.removeHighlighters();
var commentList=this.sectionProperties.commentList;var lastChild=this.getLastChildIndexOf(
comment.sectionProperties.data.id);while(true&&lastChild>=0){commentList[lastChild].highlight();if(
commentList[lastChild].isRootComment())break;lastChild=this.getIndexOf(commentList[lastChild
].sectionProperties.data.parent)}};CommentSection.prototype.removeHighlighters=function(){
var commentList=this.sectionProperties.commentList;for(var i=0;i<commentList.length;i++){if(
commentList[i].sectionProperties.isHighlighted){commentList[i].removeHighlight()}}};
CommentSection.prototype.removeItem=function(id){var annotation;for(
var i=0;i<this.sectionProperties.commentList.length;i++){
annotation=this.sectionProperties.commentList[i];if(annotation.sectionProperties.data.id===id){
this.containerObject.removeSection(annotation.name);this.sectionProperties.commentList.splice(i,1);
this.updateIdIndexMap();break}}this.checkSize()};CommentSection.prototype.click=function(annotation
){this.select(annotation)};CommentSection.prototype.save=function(annotation){var comment;if(
annotation.sectionProperties.data.id==="new"){comment=__assign({Author:{type:"string",
value:annotation.sectionProperties.data.author}},
app.map._docLayer._docType==="text"&&annotation.sectionProperties.data.html?{Html:{type:"string",
value:annotation.sectionProperties.data.html}}:{Text:{type:"string",
value:annotation.sectionProperties.data.text}});if(app.file.fileBasedView){this.map.setPart(
app.map._docLayer._selectedPart,false);this.map.sendUnoCommand(".uno:InsertAnnotation",comment,true)
this.map.setPart(0,false)}else{this.map.sendUnoCommand(".uno:InsertAnnotation",comment,true)}if(
!CommentSection.autoSavedComment)this.removeItem(annotation.sectionProperties.data.id)}else if(
annotation.sectionProperties.data.trackchange){comment={ChangeTrackingId:{type:"long",
value:annotation.sectionProperties.data.index},Text:{type:"string",
value:annotation.sectionProperties.data.text}};this.map.sendUnoCommand(".uno:CommentChangeTracking",
comment,true)}else{comment=__assign({Id:{type:"string",value:annotation.sectionProperties.data.id},
Author:{type:"string",value:annotation.sectionProperties.data.author}},
app.map._docLayer._docType==="text"&&annotation.sectionProperties.data.html?{Html:{type:"string",
value:annotation.sectionProperties.data.html}}:{Text:{type:"string",
value:annotation.sectionProperties.data.text}});this.map.sendUnoCommand(".uno:EditAnnotation",
comment,true)}this.unselect();this.map.focus()};CommentSection.prototype.reply=function(annotation){
if(cool.Comment.isAnyEdit()){cool.CommentSection.showCommentEditingWarning();return}if(
window.mode.isMobile()){var avatar=undefined;var author=this.map.getViewName(
app.map._docLayer._viewId);if(author in this.map._viewInfoByUserName){
avatar=this.map._viewInfoByUserName[author].userextrainfo.avatar}if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){
this.newAnnotationMobile(annotation,annotation.onReplyClick,false)}else{var replyAnnotation={
text:"",textrange:"",author:author,dateTime:(new Date).toDateString(),
id:annotation.sectionProperties.data.id,avatar:avatar,
parent:annotation.sectionProperties.data.parent,anchorPos:[
annotation.sectionProperties.data.anchorPos[0],annotation.sectionProperties.data.anchorPos[1]]};
var name_1=cool.Comment.makeName(replyAnnotation)+"-reply";
var replyAnnotationSection=new cool.Comment(name_1,replyAnnotation,replyAnnotation.id==="new"?{
noMenu:true}:{},this);this.newAnnotationMobile(replyAnnotationSection,annotation.onReplyClick,false)
}}else{annotation.reply();this.select(annotation,true);annotation.focus()}};
CommentSection.prototype.modify=function(annotation){if(cool.Comment.isAnyEdit()){
cool.CommentSection.showCommentEditingWarning();return}if(window.mode.isMobile()){
this.newAnnotationMobile(annotation,function(annotation){this.save(annotation)}.bind(this),true)
}else{var tempFunction=function(){setTimeout(function(){if(
annotation.sectionProperties.container&&annotation.sectionProperties.contextMenu===true){
tempFunction()}else{annotation.edit();this.select(annotation,true);annotation.focus()}}.bind(this),1
)}.bind(this);tempFunction()}};CommentSection.prototype.showCollapsedReplies=function(rootIndex){if(
!this.sectionProperties.commentList.length)return;var lastIndex=this.getLastChildIndexOf(
this.sectionProperties.commentList[rootIndex].sectionProperties.data.id);
var rootComment=this.sectionProperties.commentList[rootIndex];while(rootIndex<=lastIndex){
this.sectionProperties.commentList[rootIndex].sectionProperties.container.style.display="";
this.sectionProperties.commentList[rootIndex].sectionProperties.container.style.visibility="";$(
this.sectionProperties.commentList[rootIndex].sectionProperties.container).removeClass(
"collapsed-comment");rootIndex++}rootComment.updateThreadInfoIndicator()};
CommentSection.prototype.collapseReplies=function(rootIndex,rootId){
var lastChild=this.getLastChildIndexOf(rootId);$(this.sectionProperties.commentList[rootIndex
].sectionProperties.container).addClass("collapsed-comment");for(var i=lastChild;i>rootIndex;i--){
this.sectionProperties.commentList[i].sectionProperties.container.style.display="none";$(
this.sectionProperties.commentList[i].sectionProperties.container).addClass("collapsed-comment")}
this.sectionProperties.commentList[i].updateThreadInfoIndicator()};
CommentSection.prototype.cssToCorePixels=function(cssPixels){return cssPixels*app.dpiScale};
CommentSection.prototype.select=function(annotation,force){if(force===void 0){force=false}if(
force||annotation&&!annotation.pendingInit&&annotation!==this.sectionProperties.selectedComment&&(
annotation.sectionProperties.data.resolved!=="true"||this.sectionProperties.showResolved)){
var idx=this.getRootIndexOf(annotation.sectionProperties.data.id);if(
this.sectionProperties.selectedComment===this.sectionProperties.commentList[idx]){this.update();
return}if(this.sectionProperties.selectedComment)this.unselect();
this.sectionProperties.selectedComment=this.sectionProperties.commentList[idx];if(
this.sectionProperties.selectedComment&&!$(
this.sectionProperties.selectedComment.sectionProperties.container).hasClass("annotation-active")){
$(this.sectionProperties.selectedComment.sectionProperties.container).addClass("annotation-active")}
if(app.map._docLayer._docType==="text"&&this.sectionProperties.showSelectedBigger){
this.setThreadPopup(this.sectionProperties.selectedComment,true)}this.scrollCommentIntoView(
annotation);var selectedComment=this.sectionProperties.selectedComment;if(this.isCollapsed){
this.showCollapsedReplies(idx);selectedComment.updateThreadInfoIndicator()}this.update()}};
CommentSection.prototype.scrollCommentIntoView=function(comment){if(CommentSection.importingComments
)return;var docType=app.map._docLayer._docType;var anchorPosition=null;
var rootComment=this.sectionProperties.commentList[this.getRootIndexOf(
comment.sectionProperties.data.id)];switch(docType){case"text":{
anchorPosition=this.numberArrayToCorePixFromTwips(rootComment.sectionProperties.data.anchorPos,0,2);
break}case"spreadsheet":{anchorPosition=rootComment.getPosition();break}default:break}if(
anchorPosition&&anchorPosition[1]>0){var annotationTop=anchorPosition[1];
var firstIdx=this.getIndexOf(rootComment.sectionProperties.data.id);var lastIdx=this.getIndexOf(
comment.sectionProperties.data.id);for(var i=firstIdx;i<lastIdx;i++){
annotationTop+=this.cssToCorePixels(this.sectionProperties.commentList[i].getCommentHeight())}
var annotationBottom=annotationTop+this.cssToCorePixels(comment.getCommentHeight());if(
!this.isInViewPort([annotationTop,annotationBottom])){
var scrollSection=app.sectionContainer.getSectionWithName(app.CSections.Scroll.name);
var screenTopBottom=this.getScreenTopBottom();if(annotationTop<screenTopBottom[0]){
scrollSection.scrollVerticalWithOffset(annotationTop-screenTopBottom[0])
}else scrollSection.scrollVerticalWithOffset(annotationBottom-screenTopBottom[1]);if(
docType==="spreadsheet"&&rootComment){rootComment.positionCalcComment();rootComment.focus()}}}};
CommentSection.prototype.getScreenTopBottom=function(){
var screenTop=app.activeDocument.activeView.viewedRectangle.pY1;
var screenBottom=screenTop+this.cssToCorePixels($("#map").height());return[screenTop,screenBottom]};
CommentSection.prototype.isInViewPort=function(positionTopBotton){
var screenTopBottom=this.getScreenTopBottom();var top=positionTopBotton[0];
var bottom=positionTopBotton[1];return screenTopBottom[0]<=top&&screenTopBottom[1]>=bottom};
CommentSection.prototype.unselect=function(){if(
this.sectionProperties.selectedComment&&this.sectionProperties.selectedComment.sectionProperties.data.id!="new"
){if(this.sectionProperties.selectedComment&&$(
this.sectionProperties.selectedComment.sectionProperties.container).hasClass("annotation-active"))$(
this.sectionProperties.selectedComment.sectionProperties.container).removeClass("annotation-active")
if(app.map._docLayer._docType==="spreadsheet")this.sectionProperties.selectedComment.hide();if(
this.sectionProperties.commentsAreListed&&this.isCollapsed){
this.sectionProperties.selectedComment.setCollapsed();this.collapseReplies(this.getRootIndexOf(
this.sectionProperties.selectedComment.sectionProperties.data.id),
this.sectionProperties.selectedComment.sectionProperties.data.id)}if(
app.map._docLayer._docType==="text"&&this.sectionProperties.showSelectedBigger){this.setThreadPopup(
this.sectionProperties.selectedComment,false);this.sectionProperties.showSelectedBigger=false}
this.sectionProperties.selectedComment=null;this.update()}};
CommentSection.prototype.setThreadPopup=function(comment,popup){var e_1,_a;if(popup&&!$(
comment.sectionProperties.container).hasClass("annotation-pop-up"))$(
comment.sectionProperties.container).addClass("annotation-pop-up");else if(!popup&&$(
comment.sectionProperties.container).hasClass("annotation-pop-up"))$(
comment.sectionProperties.container).removeClass("annotation-pop-up");try{for(var _b=__values(
comment.sectionProperties.children),_c=_b.next();!_c.done;_c=_b.next()){var childComment=_c.value;
this.setThreadPopup(childComment,popup)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}}};
CommentSection.prototype.toggleShowBigger=function(comment){
var rootComment=this.sectionProperties.commentList[this.getRootIndexOf(
comment.sectionProperties.data.id)];
var isSelected=this.sectionProperties.selectedComment===rootComment;if(
this.sectionProperties.showSelectedBigger&&isSelected){
this.sectionProperties.showSelectedBigger=false;this.setThreadPopup(
this.sectionProperties.selectedComment,false)}else if(!isSelected){if(
this.sectionProperties.selectedComment)this.unselect();
this.sectionProperties.showSelectedBigger=true;this.select(comment)}else{
this.sectionProperties.showSelectedBigger=true;this.setThreadPopup(rootComment,true);
this.scrollCommentIntoView(comment)}this.update()};
CommentSection.prototype.showInNavigator=function(comment){if(app.map.getDocType()==="text"){
app.dispatcher.dispatch("showcommentsnavigator",comment.sectionProperties.data.id)}};
CommentSection.prototype.saveReply=function(annotation){var comment=__assign({Id:{type:"string",
value:annotation.sectionProperties.data.id}},
app.map._docLayer._docType==="text"&&annotation.sectionProperties.data.html?{Html:{type:"string",
value:annotation.sectionProperties.data.html}}:{Text:{type:"string",
value:annotation.sectionProperties.data.reply}});if(
app.map._docLayer._docType==="text"||app.map._docLayer._docType==="spreadsheet"
)this.map.sendUnoCommand(".uno:ReplyComment",comment);else if(
app.map._docLayer._docType==="presentation")this.map.sendUnoCommand(".uno:ReplyToAnnotation",comment
);this.unselect();this.map.focus()};CommentSection.prototype.cancel=function(annotation){if(
annotation.sectionProperties.data.id==="new"){this.removeItem(annotation.sectionProperties.data.id)}
if(this.sectionProperties.selectedComment===annotation){this.unselect()}else{this.update()}
this.map.focus()};CommentSection.prototype.onRedlineAccept=function(e){var command={
AcceptTrackedChange:{type:"unsigned short",value:e.id.substring("change-".length)}};
this.map.sendUnoCommand(".uno:AcceptTrackedChange",command);this.unselect();this.map.focus()};
CommentSection.prototype.onRedlineReject=function(e){var command={RejectTrackedChange:{
type:"unsigned short",value:e.id.substring("change-".length)}};this.map.sendUnoCommand(
".uno:RejectTrackedChange",command);this.unselect();this.map.focus()};
CommentSection.prototype.remove=function(id){var comment={Id:{type:"string",value:id}};
var removedComment=this.getComment(id);if(removedComment){
removedComment.sectionProperties.selfRemoved=true}if(app.file.fileBasedView)this.map.setPart(
app.map._docLayer._selectedPart,false);if(app.map._docLayer._docType==="text"
)this.map.sendUnoCommand(".uno:DeleteComment",comment);else if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)this.map.sendUnoCommand(".uno:DeleteAnnotation",comment);else if(
app.map._docLayer._docType==="spreadsheet")this.map.sendUnoCommand(".uno:DeleteNote",comment);if(
app.file.fileBasedView)this.map.setPart(0,false);this.unselect();this.map.focus()};
CommentSection.prototype.removeThread=function(id){var comment={Id:{type:"string",value:id}};
this.map.sendUnoCommand(".uno:DeleteCommentThread",comment);this.unselect();this.map.focus()};
CommentSection.prototype.resolve=function(annotation){var comment={Id:{type:"string",
value:annotation.sectionProperties.data.id}};this.map.sendUnoCommand(".uno:ResolveComment",comment)}
CommentSection.prototype.resolveThread=function(annotation){var comment={Id:{type:"string",
value:annotation.sectionProperties.data.id}};this.map.sendUnoCommand(".uno:ResolveCommentThread",
comment)};CommentSection.prototype.promote=function(annotation){var comment={Id:{type:"string",
value:annotation.sectionProperties.data.id}};this.map.sendUnoCommand(".uno:PromoteComment",comment)}
CommentSection.prototype.getIndexOf=function(id){var index=this.idIndexMap.get(id);
return index===undefined?-1:index};CommentSection.prototype.isThreadResolved=function(annotation){
if(annotation.sectionProperties.children.length>0){for(
var i=0;i<annotation.sectionProperties.children.length;i++){if(
annotation.sectionProperties.children[i].sectionProperties.data.resolved!=="true")return false}
return true}else if(annotation.sectionProperties.data.parent!=="0"){
var index=this.getSubRootIndexOf(annotation.sectionProperties.data.parent);
var comment=this.sectionProperties.commentList[index];if(
comment.sectionProperties.data.resolved!=="true")return false;else if(
comment.sectionProperties.children.length>0){for(
var i=0;i<comment.sectionProperties.children.length;i++){if(comment.sectionProperties.children[i
].sectionProperties.data.resolved!=="true")return false}return true}}};
CommentSection.prototype.initializeContextMenus=function(){var docLayer=app.map._docLayer;
window.L.installContextMenu({selector:".cool-annotation-menu",trigger:"none",zIndex:1500,
className:"cool-font",build:function($trigger){
var blockChangeFromDifferentAuthor=this.map.isReadOnlyMode(
)&&docLayer._docType==="text"&&this.map.getViewName(docLayer._viewId)!==$trigger[0
].annotation.sectionProperties.data.author;
var isShownBig=this.sectionProperties.showSelectedBigger&&this.sectionProperties.selectedComment===this.sectionProperties.commentList[
this.getRootIndexOf($trigger[0].annotation.sectionProperties.data.id)];return{autoHide:true,items:{
modify:blockChangeFromDifferentAuthor?undefined:{name:_("Modify"),callback:function(key,options){
this.modify.call(this,options.$trigger[0].annotation)}.bind(this)},
reply:docLayer._docType!=="text"&&docLayer._docType!=="presentation"?undefined:{name:_("Reply"),
callback:function(key,options){this.reply.call(this,options.$trigger[0].annotation)}.bind(this)},
remove:blockChangeFromDifferentAuthor?undefined:{name:_("Remove"),callback:function(key,options){
this.remove.call(this,options.$trigger[0].annotation.sectionProperties.data.id)}.bind(this)},
removeThread:docLayer._docType!=="text"||!$trigger[0].annotation.isRootComment(
)||blockChangeFromDifferentAuthor?undefined:{name:_("Remove Thread"),callback:function(key,options){
this.removeThread.call(this,options.$trigger[0].annotation.sectionProperties.data.id)}.bind(this)},
resolve:docLayer._docType!=="text"?undefined:{name:$trigger[0
].annotation.sectionProperties.data.resolved==="false"?_("Resolve"):_("Unresolve"),
callback:function(key,options){this.resolve.call(this,options.$trigger[0].annotation)}.bind(this)},
resolveThread:docLayer._docType!=="text"||!$trigger[0].annotation.isRootComment()?undefined:{
name:this.isThreadResolved($trigger[0].annotation)?_("Unresolve Thread"):_("Resolve Thread"),
callback:function(key,options){this.resolveThread.call(this,options.$trigger[0].annotation)}.bind(
this)},promote:docLayer._docType!=="text"||$trigger[0].annotation.isRootComment(
)||blockChangeFromDifferentAuthor?undefined:{name:_("Promote to top comment"),callback:function(key,
options){this.promote.call(this,options.$trigger[0].annotation)}.bind(this)},
showBigger:docLayer._docType!=="text"||window.mode.isMobile()?undefined:{name:isShownBig?_(
"Show on the side"):_("Open in full view"),callback:function(key,options){
this.toggleShowBigger.call(this,options.$trigger[0].annotation)}.bind(this)},
showInNavigator:docLayer._docType!=="text"||window.mode.isMobile()?undefined:{name:_(
"Show in navigator"),callback:function(key,options){this.showInNavigator.call(this,options.$trigger[
0].annotation)}.bind(this)}}}}.bind(this),events:{show:function(options){options.$trigger[0
].annotation.sectionProperties.contextMenu=true;setTimeout(function(){options.items.modify.$node[0
].tabIndex=0;options.items.modify.$node[0].focus()}.bind(this),10)},hide:function(options){
options.$trigger[0].annotation.sectionProperties.contextMenu=false}}});window.L.installContextMenu({
selector:".cool-annotation-menu-redline",trigger:"none",zIndex:1500,className:"cool-font",items:{
modify:{name:_("Comment"),callback:function(key,options){this.modify.call(this,options.$trigger[0
].annotation)}.bind(this)}},events:{show:function(options){options.$trigger[0
].annotation.sectionProperties.contextMenu=true},hide:function(options){options.$trigger[0
].annotation.sectionProperties.contextMenu=false}}})};CommentSection.prototype.onResize=function(){
this.checkCollapseState();this.removeHighlighters();this.update()};
CommentSection.prototype.onNewDocumentTopLeft=function(){if(
app.map._docLayer._docType==="spreadsheet"){if(this.sectionProperties.selectedComment
)this.sectionProperties.selectedComment.hide()}
var previousAnimationState=this.disableLayoutAnimation;this.disableLayoutAnimation=true;this.update(
false);this.disableLayoutAnimation=previousAnimationState};
CommentSection.prototype.showHideComments=function(){for(
var i=0;i<this.sectionProperties.commentList.length;i++){this.showHideComment(
this.sectionProperties.commentList[i])}};CommentSection.prototype.showHideComment=function(
annotation){if(!this.sectionProperties.showResolved&&app.map._docLayer._docType==="text"){if(
annotation.isContainerVisible()&&annotation.sectionProperties.data.resolved==="true"){if(
this.sectionProperties.selectedComment==annotation){this.unselect()}annotation.hide();
annotation.update()}else if(!annotation.isContainerVisible(
)&&annotation.sectionProperties.data.resolved==="false"){annotation.show();annotation.update()}
this.update()}else if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"){if(
annotation.sectionProperties.partIndex===app.map._docLayer._selectedPart||app.file.fileBasedView){
if(!annotation.isContainerVisible()){annotation.show();annotation.update();this.update()}}else{
annotation.hide();annotation.update();this.update()}}};CommentSection.prototype.add=function(comment
){if(!comment.sectionProperties){var name_2=cool.Comment.makeName(comment);
var temp=new cool.Comment(name_2,comment,comment.id==="new"?{noMenu:true}:{},this);
temp.sectionProperties.data=comment;comment=temp}
comment.sectionProperties.noMenu=comment.sectionProperties.data.id==="new"?true:false;if(
this.containerObject.doesSectionExist(comment.name))this.removeItem(comment.name);
this.containerObject.addSection(comment);this.sectionProperties.commentList.push(comment);
this.adjustParentAdd(comment);this.orderCommentList();this.checkSize();if(
this.isCollapsed&&comment.sectionProperties.data.id!=="new")comment.setCollapsed(
);else comment.setExpanded();var authorName=this.map.getViewName(app.map._docLayer._viewId);
var newComment=comment.sectionProperties.data.id==="new";if(
!newComment&&authorName===comment.sectionProperties.data.author){this.select(comment)}return comment
};CommentSection.prototype.adjustRedLine=function(redline){if(!redline.textRange){console.warn(
"Redline received has invalid textRange");return false}redline.id="change-"+redline.index;
redline.parent="0";redline.anchorPos=this.stringToRectangles(redline.textRange)[0];
redline.anchorPix=this.numberArrayToCorePixFromTwips(redline.anchorPos,0,2);redline.trackchange=true
redline.text=redline.comment;var rectangles=window.L.PolyUtil.rectanglesToPolygons(
app.LOUtil.stringToRectangles(redline.textRange),app.map._docLayer);if(rectangles.length>0){
redline.textSelected=window.L.polygon(rectangles,{pointerEvents:"all",interactive:false,
fillOpacity:0,opacity:0});redline.textSelected.addEventParent(this.map);redline.textSelected.on(
"click",function(){this.selectById(redline.id)},this)}return true};
CommentSection.prototype.getComment=function(id){var index=this.getIndexOf(id);
return index==-1?null:this.sectionProperties.commentList[index]};
CommentSection.prototype.checkIfCommentHasPreAssignedChildren=function(comment){for(
var i=0;i<this.sectionProperties.commentList.length;i++){
var possibleChild=this.sectionProperties.commentList[i];if(
possibleChild.sectionProperties.possibleParentCommentId!==null){if(
possibleChild.sectionProperties.possibleParentCommentId===comment.sectionProperties.data.id){if(
!comment.sectionProperties.children.includes(possibleChild))comment.sectionProperties.children.push(
possibleChild)}}}};CommentSection.prototype.adjustParentAdd=function(comment){if(
comment.sectionProperties.data.parent===undefined)comment.sectionProperties.data.parent="0";if(
comment.sectionProperties.data.parent!=="0"){var parentIdx=this.getIndexOf(
comment.sectionProperties.data.parent);if(parentIdx===-1){console.warn(
"adjustParentAdd: No parent comment to attach received comment to. "+"Parent comment ID sought is :"+comment.sectionProperties.data.parent+" for current comment with ID : "+comment.sectionProperties.data.id
);comment.sectionProperties.possibleParentCommentId=comment.sectionProperties.data.parent;
comment.setAsRootComment()}else{var parentComment=this.sectionProperties.commentList[parentIdx];if(
parentComment&&!parentComment.sectionProperties.children.includes(comment)
)parentComment.sectionProperties.children.unshift(comment)}}
this.checkIfCommentHasPreAssignedChildren(comment)};
CommentSection.prototype.adjustParentRemove=function(comment){var parentIdx=this.getIndexOf(
comment.getParentCommentId());var parentComment=this.sectionProperties.commentList[parentIdx];if(
parentComment){var index=parentComment.getIndexOfChild(comment);if(index>=0
)parentComment.removeChildByIndex(index)}for(var i=0;i<comment.getChildrenLength();i++){
var childComment=comment.getChildByIndex(i);if(childComment)childComment.setAsRootComment()}};
CommentSection.prototype.overWriteCommentChanges=function(obj,editComment){this.clearAutoSaveStatus(
);editComment.onCancelClick(null);this.onACKComment(obj)};
CommentSection.prototype.handleCommentConflict=function(obj,editComment){var _this=this;if(
document.getElementById(this.map.uiManager.generateModalId("comments-update")))return;if(
obj.comment.action==="Remove"||obj.comment.action==="RedlinedDeletion"){
JSDialog.showInfoModalWithOptions("comments-update",{title:_("Comments Updated"),messages:[_(
"Another user has removed this comment.")],buttons:[{text:_("OK"),callback:function(){
_this.overWriteCommentChanges(obj,editComment)}}],withCancel:false});return}
this.map.uiManager.showYesNoButton("comments-update",_("Comments Updated"),_(
"Another user has updated the comment. Would you like to overwrite those changes?"),_("Overwrite"),
_("Update"),null,function(){_this.overWriteCommentChanges(obj,editComment)},false)};
CommentSection.prototype.checkIfOnlyAnchorPosChanged=function(obj,editComment){if(
obj.comment.action!=="Modify")return false;var newComment=obj.comment;
var editCommentData=editComment.sectionProperties.data;if(
newComment.author!==editCommentData.author||newComment.dateTime!==editCommentData.dateTime||newComment.html!==editCommentData.html||newComment.layoutStatus!==editCommentData.layoutStatus.toString(

)||newComment.parentId!==editCommentData.parentId||newComment.resolved!==editCommentData.resolved||newComment.textRange!==editCommentData.textRange
)return false;if(newComment.anchorPos.replaceAll(" ","")!==editCommentData.anchorPos.toString()
)return true;return false};CommentSection.prototype.actionPerformedByCurrentUser=function(obj){
return obj.comment.author===this.map._viewInfo[this.map._docLayer._editorId].username};
CommentSection.prototype.onACKComment=function(obj){var id;var anyEdit=cool.Comment.isAnyEdit();if(
anyEdit&&!this.checkIfOnlyAnchorPosChanged(obj,anyEdit
)&&!anyEdit.sectionProperties.selfRemoved&&anyEdit.sectionProperties.data.id===obj.comment.id&&CommentSection.autoSavedComment!==anyEdit&&!this.actionPerformedByCurrentUser(
obj)){this.handleCommentConflict(obj,anyEdit);return}var changetrack=obj.redline?true:false;
var dataroot=changetrack?"redline":"comment";if(changetrack){
obj.redline.id="change-"+obj.redline.index}
var action=changetrack?obj.redline.action:obj.comment.action;if(
!changetrack&&obj.comment.parent===undefined){if(obj.comment.parentId)obj.comment.parent=String(
obj.comment.parentId);else obj.comment.parent="0"}if(
changetrack&&obj.redline.author in this.map._viewInfoByUserName){
obj.redline.avatar=this.map._viewInfoByUserName[obj.redline.author].userextrainfo.avatar}else if(
!changetrack&&obj.comment.author in this.map._viewInfoByUserName){
obj.comment.avatar=this.map._viewInfoByUserName[obj.comment.author].userextrainfo.avatar}if(
window.mode.isMobile()){var annotation=this.sectionProperties.commentList[this.getRootIndexOf(obj[
dataroot].id)];if(!annotation)annotation=this.sectionProperties.commentList[this.getRootIndexOf(obj[
dataroot].parent)]}if(action==="Add"){if(changetrack){if(!this.adjustRedLine(obj.redline)){return}
this.add(obj.redline)}else{var currentComment=this.getComment(obj[dataroot].id);if(
currentComment!==null){if(obj[dataroot].layoutStatus!==undefined){
currentComment.sectionProperties.data.layoutStatus=parseInt(obj[dataroot].layoutStatus);
currentComment.setLayoutClass()}return}this.adjustComment(obj.comment);annotation=this.add(
obj.comment);if(app.map._docLayer._docType==="spreadsheet")annotation.hide();
var autoSavedComment=CommentSection.autoSavedComment;if(autoSavedComment){
var isOurComment=annotation.isAutoSaved();if(isOurComment){if(
app.definitions.CommentSection.needFocus){app.definitions.CommentSection.needFocus=annotation}
annotation.sectionProperties.container.style.visibility="visible";
annotation.sectionProperties.autoSave.innerText=_("Autosaved");if(
app.map._docLayer._docType==="spreadsheet")annotation.show();if(
autoSavedComment.sectionProperties.data.id==="new")this.removeItem(
autoSavedComment.sectionProperties.data.id);annotation.edit();if(this.shouldCollapse()
)annotation.setCollapsed();CommentSection.autoSavedComment=null;
CommentSection.commentWasAutoAdded=true}}}if(
this.sectionProperties.selectedComment&&!this.sectionProperties.selectedComment.isEdit()){
this.map.focus()}}else if(action==="Remove"){id=obj[dataroot].id;var removed=this.getComment(id);if(
removed){this.adjustParentRemove(removed);if(this.sectionProperties.selectedComment===removed){
this.unselect();this.removeItem(id)}else{this.removeItem(id);this.update()}}}else if(
action==="RedlinedDeletion"){id=obj[dataroot].id;var _redlined=this.getComment(id);if(
_redlined&&_redlined.sectionProperties.data.layoutStatus===cool.CommentLayoutStatus.INSERTED){obj[
dataroot].action="Remove";this.onACKComment(obj);return}if(_redlined){
_redlined.sectionProperties.data.layoutStatus=cool.CommentLayoutStatus.DELETED;
_redlined.setLayoutClass()}}else if(action==="Modify"){id=obj[dataroot].id;
var modified=this.getComment(id);if(modified){var modifiedObj;if(changetrack){if(
!this.adjustRedLine(obj.redline)){return}modifiedObj=obj.redline}else{this.adjustComment(obj.comment
);modifiedObj=obj.comment}var oldParent=modified.getParentCommentId();modified.setData(modifiedObj);
modified.update();if(oldParent!==null&&modified.isRootComment()){var parentIdx=this.getIndexOf(
oldParent);var parentComment=this.sectionProperties.commentList[parentIdx];if(parentComment){
var index=parentComment.getIndexOfChild(modified);if(index>=0)parentComment.removeChildByIndex(index
)}}this.update();if(CommentSection.autoSavedComment){
CommentSection.autoSavedComment.sectionProperties.autoSave.innerText=_("Autosaved");if(
app.map._docLayer._docType==="spreadsheet")modified.show();modified.edit();if(this.shouldCollapse()
)modified.setCollapsed()}}}else if(action==="Resolve"){id=obj[dataroot].id;
var resolved=this.getComment(id);if(resolved){var resolvedObj;if(changetrack){if(
!this.adjustRedLine(obj.redline)){return}resolvedObj=obj.redline}else{this.adjustComment(obj.comment
);resolvedObj=obj.comment}resolved.setData(resolvedObj);resolved.update();this.showHideComment(
resolved);this.update()}}else if(action==="SearchHighlight"){id=obj[dataroot].id;
var comment=this.getComment(id);if(comment){var selection=obj[dataroot].searchSelection.split(",");
comment.selectText(parseInt(selection[0]),parseInt(selection[1]),parseInt(selection[2]),parseInt(
selection[3]));this.showHideComment(comment)}}if(window.mode.isMobile()){var shouldOpenWizard=false;
var wePerformedAction=obj.comment.author===this.map.getViewName(app.map._docLayer._viewId);if(
window.commentWizard||action==="Add"&&wePerformedAction)shouldOpenWizard=true;if(shouldOpenWizard){
app.map._docLayer._openCommentWizard(annotation)}}if(app.map._docLayer._docType==="text"){
this.updateThreadInfoIndicator()}if(CommentSection.pendingImport){app.socket.sendMessage(
"commandvalues command=.uno:ViewAnnotations");CommentSection.pendingImport=false}};
CommentSection.prototype.selectById=function(commentId){var idx=this.getRootIndexOf(commentId);
var annotation=this.sectionProperties.commentList[idx];this.select(annotation)};
CommentSection.prototype.stringToRectangles=function(str){
var strString=typeof str!=="string"?String(str):str;var matches=strString.match(/\d+/g);
var rectangles=[];if(matches!==null){for(var i=0;i<matches.length;i+=4){rectangles.push([parseInt(
matches[i]),parseInt(matches[i+1]),parseInt(matches[i+2]),parseInt(matches[i+3])])}}
return rectangles};CommentSection.prototype.onPartChange=function(){for(
var i=0;i<this.sectionProperties.commentList.length;i++){this.showHideComment(
this.sectionProperties.commentList[i])}if(this.sectionProperties.selectedComment
)this.sectionProperties.selectedComment.onCancelClick(null);this.checkSize()};
CommentSection.prototype.numberArrayToCorePixFromTwips=function(numberArray,startIndex,length){if(
startIndex===void 0){startIndex=0}if(length===void 0){length=null}if(!length
)length=numberArray.length;if(startIndex<0)startIndex=0;if(length<0)length=0;if(
startIndex+length>numberArray.length)length=numberArray.length-startIndex;var result=new Array(
length);for(var i=startIndex;i<length;i++){result[i]=Math.round(numberArray[i]*app.twipsToPixels)}
return result};CommentSection.prototype.adjustCommentFileBasedView=function(comment){
var partHeightTwips=app.map._docLayer._partHeightTwips+app.map._docLayer._spaceBetweenParts;
var index=app.impress.getIndexFromSlideHash(parseInt(comment.parthash));
var yAddition=index*partHeightTwips;comment.yAddition=yAddition;comment.trackchange=false;
comment.rectangles=this.stringToRectangles(comment.textRange||comment.anchorPos||comment.rectangle);
comment.rectangles[0][1]+=yAddition;comment.rectanglesOriginal=this.stringToRectangles(
comment.textRange||comment.anchorPos||comment.rectangle);comment.rectanglesOriginal[0][1]+=yAddition
comment.anchorPos=this.stringToRectangles(comment.anchorPos||comment.rectangle)[0];
comment.anchorPos[1]+=yAddition;if(comment.rectangle){comment.rectangle=this.stringToRectangles(
comment.rectangle)[0];comment.rectangle[1]+=yAddition}
comment.anchorPix=this.numberArrayToCorePixFromTwips(comment.anchorPos,0,2);
comment.parthash=comment.parthash?comment.parthash:null;var viewId=this.map.getViewId(comment.author
);var color=viewId>=0?app.LOUtil.rgbToHex(this.map.getViewColor(viewId)):"#43ACE8";
comment.color=color};CommentSection.prototype.adjustCommentNormal=function(comment){
comment.trackchange=false;if(comment.cellRange){comment.cellRange=app.map._docLayer._parseCellRange(
comment.cellRange)}var cellPos=comment.cellRange?app.map._docLayer._cellRangeToTwipRect(
comment.cellRange).toRectangle():null;comment.rectangles=this.stringToRectangles(
comment.textRange||comment.anchorPos||comment.rectangle||cellPos);
comment.rectanglesOriginal=this.stringToRectangles(
comment.textRange||comment.anchorPos||comment.rectangle||cellPos);
comment.anchorPos=this.stringToRectangles(comment.anchorPos||comment.rectangle||cellPos)[0];
comment.anchorPix=this.numberArrayToCorePixFromTwips(comment.anchorPos,0,2);
comment.parthash=comment.parthash?comment.parthash:null;
comment.tab=comment.tab||comment.tab===0?comment.tab:null;
comment.layoutStatus=comment.layoutStatus!==undefined?parseInt(comment.layoutStatus):null;if(
comment.parentId)comment.parent=String(comment.parentId);if(comment.rectangle){
comment.rectangle=this.stringToRectangles(comment.rectangle)[0]}var viewId=this.map.getViewId(
comment.author);var color=viewId>=0?app.LOUtil.rgbToHex(this.map.getViewColor(viewId)):"#43ACE8";
comment.color=color};CommentSection.prototype.adjustComment=function(comment){if(
!app.file.fileBasedView)this.adjustCommentNormal(comment);else this.adjustCommentFileBasedView(
comment)};CommentSection.prototype.getLastChildIndexOf=function(id){var index=this.getIndexOf(id);
index=this.getRootIndexOf(this.sectionProperties.commentList[index].sectionProperties.data.id);
while(this.sectionProperties.commentList[index+1
]&&index+1<this.sectionProperties.commentList.length&&this.sectionProperties.commentList[index+1
].sectionProperties.data.parent!=="0"){index++}return index};
CommentSection.prototype.mustCheckSelectedPart=function(){return(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)&&!app.file.fileBasedView};CommentSection.prototype.layoutUp=function(subList,actualPosition,lastY,
relayout){if(relayout===void 0){relayout=true}var height;for(var i=0;i<subList.length;i++){
height=subList[i].getCommentHeight(relayout);lastY=subList[i].sectionProperties.data.anchorPix[1
]+height<lastY?subList[i].sectionProperties.data.anchorPix[1]:lastY-height*app.dpiScale;subList[i
].sectionProperties.container.style.left=String(Math.round(actualPosition[0]/app.dpiScale
)+this.sectionProperties.canvasContainerLeft)+"px";subList[i
].sectionProperties.container.style.top=String(Math.round(lastY/app.dpiScale
)+this.sectionProperties.canvasContainerTop)+"px";if(!subList[i].isEdit())subList[i].show()}
return lastY};CommentSection.prototype.loopUp=function(startIndex,x,startY,relayout){if(
relayout===void 0){relayout=true}var tmpIdx=0;var checkSelectedPart=this.mustCheckSelectedPart();
startY-=this.sectionProperties.marginY;for(var i=startIndex;i>-1;){var subList=[];tmpIdx=i;do{
this.sectionProperties.commentList[tmpIdx
].sectionProperties.data.anchorPix=this.numberArrayToCorePixFromTwips(
this.sectionProperties.commentList[tmpIdx].sectionProperties.data.anchorPos,0,2);
this.sectionProperties.commentList[tmpIdx].sectionProperties.data.anchorPix[1
]-=app.activeDocument.activeView.viewedRectangle.pY1;if(this.sectionProperties.commentList[tmpIdx
].sectionProperties.data.resolved!=="true"||this.sectionProperties.showResolved){if(
!checkSelectedPart||app.map._docLayer._selectedPart===this.sectionProperties.commentList[tmpIdx
].sectionProperties.partIndex)subList.push(this.sectionProperties.commentList[tmpIdx])}
tmpIdx=tmpIdx-1}while(tmpIdx>-1&&this.sectionProperties.commentList[tmpIdx
].sectionProperties.data.parent===this.sectionProperties.commentList[tmpIdx+1
].sectionProperties.data.id);if(subList.length>0){startY=this.layoutUp(subList,[x,subList[0
].sectionProperties.data.anchorPix[1]],startY,relayout);i=i-subList.length}else{i=tmpIdx}
startY-=this.sectionProperties.marginY}return startY};CommentSection.prototype.layoutDown=function(
subList,actualPosition,lastY,relayout){if(relayout===void 0){relayout=true}
var selectedComment=subList[0]===this.sectionProperties.selectedComment;for(
var i=0;i<subList.length;i++){lastY=subList[i].sectionProperties.data.anchorPix[1]>lastY?subList[i
].sectionProperties.data.anchorPix[1]:lastY;var isRTL=document.documentElement.dir==="rtl";if(
selectedComment){var posX=this.sectionProperties.showSelectedBigger?Math.round((
document.getElementById("document-container").getBoundingClientRect().width-subList[i
].sectionProperties.container.getBoundingClientRect().width)/2):Math.round(actualPosition[0
]/app.dpiScale)-this.sectionProperties.deflectionOfSelectedComment*(isRTL?-1:1);subList[i
].sectionProperties.container.style.left=String(posX+this.sectionProperties.canvasContainerLeft
)+"px";subList[i].sectionProperties.container.style.top=String(Math.round(lastY/app.dpiScale
)+this.sectionProperties.canvasContainerTop)+"px"}else{subList[i
].sectionProperties.container.style.left=String(
this.sectionProperties.canvasContainerLeft+Math.round(actualPosition[0]/app.dpiScale))+"px";subList[
i].sectionProperties.container.style.top=String(Math.round(lastY/app.dpiScale
)+this.sectionProperties.canvasContainerTop)+"px"}lastY+=subList[i].getCommentHeight(relayout
)*app.dpiScale;if(!subList[i].isEdit())subList[i].show()}return lastY};
CommentSection.prototype.loopDown=function(startIndex,x,startY,relayout){if(relayout===void 0){
relayout=true}var tmpIdx=0;var checkSelectedPart=this.mustCheckSelectedPart();for(
var i=startIndex;i<this.sectionProperties.commentList.length;){var subList=[];tmpIdx=i;do{
this.sectionProperties.commentList[tmpIdx
].sectionProperties.data.anchorPix=this.numberArrayToCorePixFromTwips(
this.sectionProperties.commentList[tmpIdx].sectionProperties.data.anchorPos,0,2);
this.sectionProperties.commentList[tmpIdx].sectionProperties.data.anchorPix[1
]-=app.activeDocument.activeView.viewedRectangle.pY1;if(this.sectionProperties.commentList[tmpIdx
].sectionProperties.data.resolved!=="true"||this.sectionProperties.showResolved){if(
!checkSelectedPart||app.map._docLayer._selectedPart===this.sectionProperties.commentList[tmpIdx
].sectionProperties.partIndex)subList.push(this.sectionProperties.commentList[tmpIdx])}
tmpIdx=tmpIdx+1}while(
tmpIdx<this.sectionProperties.commentList.length&&this.sectionProperties.commentList[tmpIdx
].sectionProperties.data.parent!=="0");if(subList.length>0){startY=this.layoutDown(subList,[x,
subList[0].sectionProperties.data.anchorPix[1]],startY,relayout);i=i+subList.length}else{i=tmpIdx}
startY+=this.sectionProperties.marginY}return startY};CommentSection.prototype.hideArrow=function(){
if(this.sectionProperties.arrow){document.getElementById("document-container").removeChild(
this.sectionProperties.arrow);this.sectionProperties.arrow=null;app.sectionContainer.requestReDraw()
}};CommentSection.prototype.showArrow=function(startPoint,endPoint){
var anchorSection=this.containerObject.getDocumentAnchorSection();startPoint[0
]-=anchorSection.myTopLeft[0]+app.activeDocument.activeView.viewedRectangle.pX1;startPoint[1
]-=anchorSection.myTopLeft[1]+app.activeDocument.activeView.viewedRectangle.pY1;endPoint[1
]-=anchorSection.myTopLeft[1]+app.activeDocument.activeView.viewedRectangle.pY1;startPoint[0
]=Math.floor(startPoint[0]/app.dpiScale);startPoint[1]=Math.floor(startPoint[1]/app.dpiScale);
endPoint[0]=Math.floor(endPoint[0]/app.dpiScale);endPoint[1]=Math.floor(endPoint[1]/app.dpiScale);
if(this.sectionProperties.arrow!==null){var line=this.sectionProperties.arrow.firstElementChild;
line.setAttribute("x1",String(startPoint[0]));line.setAttribute("y1",String(startPoint[1]));
line.setAttribute("x2",String(endPoint[0]));line.setAttribute("y2",String(endPoint[1]))}else{
var svg=document.createElementNS("http://www.w3.org/2000/svg","svg");svg.setAttribute("version",
"1.1");svg.style.zIndex="9";svg.id="comment-arrow-container";svg.style.position="absolute";
svg.style.top=svg.style.left=svg.style.right=svg.style.bottom="0";svg.setAttribute("width",String(
this.context.canvas.width));svg.setAttribute("height",String(this.context.canvas.height));
var line=document.createElementNS("http://www.w3.org/2000/svg","line");line.id="comment-arrow-line";
line.setAttribute("x1",String(startPoint[0]));line.setAttribute("y1",String(startPoint[1]));
line.setAttribute("x2",String(endPoint[0]));line.setAttribute("y2",String(endPoint[1]));
line.setAttribute("stroke","darkblue");line.setAttribute("stroke-width","1");svg.appendChild(line);
document.getElementById("document-container").appendChild(svg);this.sectionProperties.arrow=svg}};
CommentSection.prototype.layout=function(relayout){if(relayout===void 0){relayout=true}if(
window.mode.isMobile()||app.map._docLayer._docType==="spreadsheet"){if(
this.sectionProperties.commentList.length>0)this.orderCommentList();return}
this.sectionProperties.canvasContainerLeft=document.getElementById("document-container"
).getBoundingClientRect().left;this.sectionProperties.canvasContainerTop=document.getElementById(
"document-container").getBoundingClientRect().top;var availableSpace=this.calculateAvailableSpace();
if(this.sectionProperties.commentList.length>0){this.orderCommentList();if(relayout
)this.resetCommentsSize();var isRTL=document.documentElement.dir==="rtl";var topRight=[
this.myTopLeft[0],this.myTopLeft[1
]+this.sectionProperties.marginY-app.activeDocument.activeView.viewedRectangle.pY1];var yOrigin=null
var selectedIndex=null;var x=isRTL?0:topRight[0];if(isRTL
)x=availableSpace-this.sectionProperties.commentWidth;else{x=(
app.activeDocument.fileSize.cX-app.activeDocument.activeView.viewedRectangle.cX1-app.sectionContainer.getCanvasBoundingClientRect(
).x)*app.dpiScale;x+=app.map.navigator?app.map.navigator.navigationPanel.offsetWidth*app.dpiScale:0}
if(this.sectionProperties.selectedComment){selectedIndex=this.getRootIndexOf(
this.sectionProperties.selectedComment.sectionProperties.data.id);
this.sectionProperties.commentList[selectedIndex
].sectionProperties.data.anchorPix=this.numberArrayToCorePixFromTwips(
this.sectionProperties.commentList[selectedIndex].sectionProperties.data.anchorPos,0,2);
yOrigin=this.sectionProperties.commentList[selectedIndex].sectionProperties.data.anchorPix[1
]-app.activeDocument.activeView.viewedRectangle.pY1;var tempCrd=this.sectionProperties.commentList[
selectedIndex].sectionProperties.data.anchorPix;var resolved=this.sectionProperties.commentList[
selectedIndex].sectionProperties.data.resolved;if(
!resolved||resolved==="false"||this.sectionProperties.showResolved){
var posX=isRTL?this.containerObject.getDocumentAnchorSection().size[0]+x+15:x;this.showArrow([
tempCrd[0],tempCrd[1]],[posX,tempCrd[1]])}}else this.hideArrow();var lastY=0;if(selectedIndex){
this.loopUp(selectedIndex-1,x,yOrigin,relayout);lastY=this.loopDown(selectedIndex,x,yOrigin,relayout
)}else{lastY=this.loopDown(0,x,topRight[1],relayout)}}if(relayout)this.resizeComments();
lastY+=app.activeDocument.activeView.viewedRectangle.pY1;
var horizontalScroll=app.activeDocument.fileSize.x;if(
availableSpace<this.sectionProperties.commentWidth&&!this.isCollapsed)horizontalScroll=(
app.activeDocument.fileSize.cX+this.sectionProperties.commentWidth)*app.pixelsToTwips*app.dpiScale;
if(lastY>app.activeDocument.fileSize.pY){
app.activeDocument.activeView.viewSize=new cool.SimplePoint(horizontalScroll,lastY*app.pixelsToTwips
);this.containerObject.requestReDraw()
}else app.activeDocument.activeView.viewSize=new cool.SimplePoint(horizontalScroll,
app.activeDocument.fileSize.y);this.disableLayoutAnimation=false};
CommentSection.prototype.update=function(reLayout){if(reLayout===void 0){reLayout=true}
this.sectionProperties.reLayout=reLayout;this.updateDOM()};
CommentSection.prototype.updateDOM=function(){var _this=this;if(!this.sectionProperties.firstImport
)return;app.layoutingService.appendLayoutingTask(function(){if(
_this.sectionProperties.reLayout&&app.map._docLayer._docType==="text"
)_this.updateThreadInfoIndicator();_this.layout(_this.sectionProperties.reLayout)});
app.sectionContainer.requestReDraw()};CommentSection.prototype.updateThreadInfoIndicator=function(){
for(var i=0;i<this.sectionProperties.commentList.length;i++){
var comment=this.sectionProperties.commentList[i];var replyCount=0;var anyEdit=false;if(
comment&&comment.isRootComment()){var lastIndex=this.getLastChildIndexOf(
comment.sectionProperties.data.id);var j=i;while(this.sectionProperties.commentList[j]&&j<=lastIndex
){anyEdit=this.sectionProperties.commentList[j].isEdit()||anyEdit;if(
this.sectionProperties.commentList[j].sectionProperties.data.parent!=="0"){if((
this.sectionProperties.commentList[j
].sectionProperties.data.layoutStatus!==cool.CommentLayoutStatus.DELETED||this.map[
"stateChangeHandler"].getItemValue(".uno:ShowTrackedChanges")==="true"
)&&this.sectionProperties.commentList[j].sectionProperties.data.resolved!=="true"){replyCount++}}j++
}}if(anyEdit)comment.updateThreadInfoIndicator("!");else comment.updateThreadInfoIndicator(
replyCount)}};CommentSection.prototype.updateChildLines=function(){for(
var i=0;i<this.sectionProperties.commentList.length;i++){this.sectionProperties.commentList[i
].updateChildLines()}};CommentSection.prototype.getRootIndexOf=function(id){
var index=this.getIndexOf(id);while(index>=0){if(this.sectionProperties.commentList[index
].sectionProperties.data.parent!=="0")index--;else break}return index};
CommentSection.prototype.getSubRootIndexOf=function(id){var index=this.getIndexOf(id);if(index!==-1
){var comment=this.sectionProperties.commentList[index];
var parentId=comment.sectionProperties.data.parent;while(index>=0){if(
this.sectionProperties.commentList[index
].sectionProperties.data.id!==parentId&&this.sectionProperties.commentList[index
].sectionProperties.data.parent!=="0")index--;else break}}return index};
CommentSection.prototype.setViewResolved=function(state){this.sectionProperties.showResolved=state;
for(var idx=0;idx<this.sectionProperties.commentList.length;idx++){if(
this.sectionProperties.commentList[idx].sectionProperties.data.resolved==="true"){if(state==false){
if(this.sectionProperties.selectedComment==this.sectionProperties.commentList[idx]){this.unselect()}
this.sectionProperties.commentList[idx].hide()}else{this.sectionProperties.commentList[idx].show()}}
this.sectionProperties.commentList[idx].update()}this.update()};
CommentSection.prototype.setView=function(state){this.sectionProperties.show=state;for(
var idx=0;idx<this.sectionProperties.commentList.length;idx++){if(state==false
)this.sectionProperties.commentList[idx].hide();else this.sectionProperties.commentList[idx].show()}
};CommentSection.prototype.orderCommentList=function(){this.sectionProperties.commentList.sort(
function(a,b){return Math.abs(a.sectionProperties.data.anchorPos[1])-Math.abs(
b.sectionProperties.data.anchorPos[1])||Math.abs(a.sectionProperties.data.anchorPos[0])-Math.abs(
b.sectionProperties.data.anchorPos[0])});if(app.map._docLayer._docType==="text"
)this.orderTextComments();this.updateIdIndexMap()};
CommentSection.prototype.resetCommentsSize=function(){if(app.map._docLayer._docType==="text"){for(
var i=0;i<this.sectionProperties.commentList.length;i++){if(this.sectionProperties.commentList[i
].sectionProperties.contentNode.style.display!=="none"){
var maxHeight=this.sectionProperties.commentList[i
]===this.sectionProperties.selectedComment?this.annotationMaxSize:this.annotationMinSize;
this.sectionProperties.commentList[i].sectionProperties.contentNode.style.maxHeight=maxHeight+"px"}}
}};CommentSection.prototype.resizeComments=function(){var growUp=false;if(
app.map._docLayer._docType==="text"){var minMaxHeight=Number(getComputedStyle(
document.documentElement).getPropertyValue("--annotation-min-size"));var maxMaxHeight=Number(
getComputedStyle(document.documentElement).getPropertyValue("--annotation-max-size"));for(
var i=0;i<this.sectionProperties.commentList.length;i++){if(this.sectionProperties.commentList[i
].sectionProperties.contentNode.style.display!=="none"&&!this.sectionProperties.commentList[i
].isEdit()){var actHeight=this.sectionProperties.commentList[i
].sectionProperties.contentText.getBoundingClientRect().height;if(actHeight>minMaxHeight){if(
actHeight>maxMaxHeight){actHeight=maxMaxHeight}if(i+1>=this.sectionProperties.commentList.length){
var maxSize=maxMaxHeight;if(i+1<this.sectionProperties.commentList.length
)maxSize=this.sectionProperties.commentList[i+1].getContainerPosY(
)-this.sectionProperties.commentList[i].getContainerPosY()-this.sectionProperties.commentList[i
].sectionProperties.author.getBoundingClientRect().height-3*this.sectionProperties.marginY-2;if(
maxSize>maxMaxHeight){maxSize=maxMaxHeight}else if(growUp&&actHeight>maxSize){
var spaceBefore=this.sectionProperties.commentList[i].getContainerPosY();if(i>0){
spaceBefore-=this.sectionProperties.commentList[i-1].getContainerPosY(
)+this.sectionProperties.commentList[i-1].getCommentHeight()+this.sectionProperties.marginY}else{
spaceBefore+=app.activeDocument.activeView.viewedRectangle.pY1}if(spaceBefore>0){var moveUp=0;if(
actHeight-maxSize<spaceBefore){moveUp=actHeight-maxSize}else{moveUp=spaceBefore}
var posX=this.sectionProperties.commentList[i].getContainerPosX();
var posY=this.sectionProperties.commentList[i].getContainerPosY()-moveUp;
this.sectionProperties.commentList[i].sectionProperties.container.style.left=Math.round(posX)+"px";
this.sectionProperties.commentList[i].sectionProperties.container.style.top=Math.round(posY)+"px";
maxSize+=moveUp}}if(maxSize>minMaxHeight)this.sectionProperties.commentList[i
].sectionProperties.contentNode.style.maxHeight=Math.round(maxSize)+"px"}}}}this.updateChildLines()}
};CommentSection.prototype.updateIdIndexMap=function(){this.idIndexMap.clear();
var commentList=this.sectionProperties.commentList;for(var idx=0;idx<commentList.length;idx++){
var comment=commentList[idx];console.assert(
comment.sectionProperties&&comment.sectionProperties.data,"no sectionProperties.data!");
this.idIndexMap.set(comment.sectionProperties.data.id,idx)}};
CommentSection.prototype.turnIntoAList=function(commentList){var newArray;if(!Array.isArray(
commentList)){newArray=new Array(0);for(var prop in commentList){if(
Object.prototype.hasOwnProperty.call(commentList,prop)){newArray.push(commentList[prop])}}}else{
newArray=commentList}return newArray};CommentSection.prototype.addUpdateChildGroups=function(){
var parentCommentList=[];for(var i=0;i<this.sectionProperties.commentList.length;i++){
var comment=this.sectionProperties.commentList[i];comment.sectionProperties.children=[];if(
comment.sectionProperties.data.parent!=="0"){if(!parentCommentList.includes(
comment.sectionProperties.data.parent))parentCommentList.push(comment.sectionProperties.data.parent)
}}for(var i=0;i<parentCommentList.length;i++){var parentComment;for(
var j=0;j<this.sectionProperties.commentList.length;j++){if(this.sectionProperties.commentList[j
].sectionProperties.data.id===parentCommentList[i]){
parentComment=this.sectionProperties.commentList[j];break}}if(parentComment){for(
var j=0;j<this.sectionProperties.commentList.length;j++){if(this.sectionProperties.commentList[j
].sectionProperties.data.parent===parentCommentList[i]
)parentComment.sectionProperties.children.push(this.sectionProperties.commentList[j])}
}else console.warn("Couldn't find parent comment.")}};
CommentSection.prototype.addChildrenCommentsToList=function(comment,newOrder){
comment.sectionProperties.children.forEach(function(element){newOrder.push(element);if(
element.sectionProperties.children.length>0)this.addChildrenCommentsToList(element,newOrder)}.bind(
this))};CommentSection.prototype.orderTextComments=function(){var newOrder=[];for(
var i=0;i<this.sectionProperties.commentList.length;i++){
var comment=this.sectionProperties.commentList[i];if(comment.isRootComment()){newOrder.push(comment)
if(comment.sectionProperties.children.length>0)this.addChildrenCommentsToList(comment,newOrder)}}
this.sectionProperties.commentList=newOrder};CommentSection.prototype.importComments=function(
commentList){this.disableLayoutAnimation=true;var comment;if(cool.Comment.isAnyEdit()){
CommentSection.pendingImport=true;return}CommentSection.importingComments=true;this.clearList();
commentList=this.turnIntoAList(commentList);if(commentList.length>0){for(
var i=0;i<commentList.length;i++){comment=commentList[i];this.adjustComment(comment);if(
comment.author in this.map._viewInfoByUserName){comment.avatar=this.map._viewInfoByUserName[
comment.author].userextrainfo.avatar}var name_3=cool.Comment.makeName(comment);
var commentSection=new cool.Comment(name_3,comment,{},this);if(!this.containerObject.addSection(
commentSection))continue;this.sectionProperties.commentList.push(commentSection);
this.idIndexMap.set(commentSection.sectionProperties.data.id,i)}if(
app.map._docLayer._docType==="text")this.addUpdateChildGroups();this.orderCommentList();
this.checkSize();this.update()}var show=this.map.stateChangeHandler.getItemValue("showannotations");
this.setView(show===true||show==="true");var showResolved=this.map.stateChangeHandler.getItemValue(
"ShowResolvedAnnotations");this.setViewResolved(showResolved===true||showResolved==="true");if(
app.map._docLayer._docType==="spreadsheet")this.hideAllComments();if(
app.map._docLayer._docType==="presentation"||app.map._docLayer._docType==="drawing"
)this.showHideComments();this.sectionProperties.reLayout=true;
this.sectionProperties.firstImport=true;this.updateDOM();CommentSection.importingComments=false};
CommentSection.prototype.importChanges=function(changesList){var changeComment;this.clearChanges();
changesList=this.turnIntoAList(changesList);if(changesList.length>0){for(
var i=0;i<changesList.length;i++){changeComment=changesList[i];if(!this.adjustRedLine(changeComment)
)continue;if(changeComment.author in this.map._viewInfoByUserName){
changeComment.avatar=this.map._viewInfoByUserName[changeComment.author].userextrainfo.avatar}
var name_4=cool.Comment.makeName(changeComment);var commentSection=new cool.Comment(name_4,
changeComment,{},this);if(!this.containerObject.addSection(commentSection))continue;
this.sectionProperties.commentList.push(commentSection)}this.orderCommentList();this.checkSize();
this.update()}if(app.map._docLayer._docType==="spreadsheet")this.hideAllComments()};
CommentSection.prototype.clearChanges=function(){this.containerObject.pauseDrawing();for(
var i=this.sectionProperties.commentList.length-1;i>-1;i--){if(this.sectionProperties.commentList[i
].sectionProperties.data.trackchange){this.containerObject.removeSection(
this.sectionProperties.commentList[i].name);this.sectionProperties.commentList.splice(i,1)}}
this.updateIdIndexMap();this.containerObject.resumeDrawing();
this.sectionProperties.selectedComment=null;this.checkSize()};
CommentSection.prototype.clearAutoSaveStatus=function(){CommentSection.autoSavedComment=null;
CommentSection.commentWasAutoAdded=false};CommentSection.prototype.clearList=function(){
this.containerObject.pauseDrawing();for(var i=this.sectionProperties.commentList.length-1;i>-1;i--){
if(!this.sectionProperties.commentList[i].sectionProperties.data.trackchange){
this.containerObject.removeSection(this.sectionProperties.commentList[i].name);
this.sectionProperties.commentList.splice(i,1)}}this.updateIdIndexMap();
this.containerObject.resumeDrawing();this.sectionProperties.selectedComment=null;this.checkSize();
this.clearAutoSaveStatus()};CommentSection.prototype.onCommentsDataUpdate=function(){for(
var i=this.sectionProperties.commentList.length-1;i>-1;i--){
var comment=this.sectionProperties.commentList[i];if(
!comment.valid&&comment.sectionProperties.data.id!=="new"){
comment.sectionProperties.commentListSection.removeItem(comment.sectionProperties.data.id)}
comment.onCommentDataUpdate()}};CommentSection.prototype.rejectAllTrackedCommentChanges=function(){
for(var i=0;i<this.sectionProperties.commentList.length;i++){
var comment=this.sectionProperties.commentList[i];if(
comment.sectionProperties.data.layoutStatus===cool.CommentLayoutStatus.DELETED){
comment.sectionProperties.data.layoutStatus=cool.CommentLayoutStatus.VISIBLE;
comment.sectionProperties.container.classList.remove("tracked-deleted-comment-show")}}};
CommentSection.prototype.hasAnyComments=function(){
return this.sectionProperties.commentList.length>0};CommentSection.commentWasAutoAdded=false;
CommentSection.pendingImport=false;CommentSection.importingComments=false;return CommentSection}(
CanvasSectionObject);cool.CommentSection=CommentSection})(cool||(cool={}));
app.definitions.CommentSection=cool.CommentSection;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var CalcGridSection=function(_super){__extends(CalcGridSection,_super);function CalcGridSection(){
var _this=_super.call(this,app.CSections.CalcGrid.name)||this;_this.interactable=false;
_this.anchor=["top","left"];_this.processingOrder=app.CSections.CalcGrid.processingOrder,
_this.drawingOrder=app.CSections.CalcGrid.drawingOrder,_this.zIndex=app.CSections.CalcGrid.zIndex,
_this.boundToSection="tiles";_this.sectionProperties={docLayer:app.map._docLayer,
strokeStyle:getComputedStyle(document.body).getPropertyValue("--color-calc-grid"),tsManager:null};
return _this}CalcGridSection.prototype.resetStrokeStyle=function(){
this.sectionProperties.strokeStyle=getComputedStyle(document.body).getPropertyValue(
"--color-calc-grid")};CalcGridSection.prototype.onDrawArea=function(area,paneTopLeft){if(
!this.sectionProperties.docLayer.sheetGeometry)return;var tsManager=this.sectionProperties.tsManager
this.context.strokeStyle=this.sectionProperties.strokeStyle;this.context.lineWidth=1;var scale=1;if(
tsManager._inZoomAnim&&tsManager._zoomFrameScale)scale=tsManager._zoomFrameScale;
var ctx=tsManager._paintContext();var isRTL=this.sectionProperties.docLayer.isLayoutRTL();
var sectionWidth=this.size[0];var xTransform=function(xcoord){
return isRTL?sectionWidth-xcoord:xcoord}.bind(this);var startEndDash=function(ctx2D,end){
var dashLen=5;var gapLen=5;ctx2D.closePath();ctx2D.beginPath();ctx2D.setLineDash(end?[]:[dashLen,
gapLen])}.bind(this);var docLayer=this.sectionProperties.docLayer;
var currentPart=docLayer._selectedPart;var printRange=[];if(
docLayer._printRanges&&docLayer._printRanges.length>currentPart&&docLayer._printRanges[currentPart
].length==1)printRange=docLayer._printRanges[currentPart][0];for(
var i=0;i<ctx.paneBoundsList.length;++i){var paneBounds=ctx.paneBoundsList[i];
var viewBounds=ctx.viewBounds;paneBounds.round();viewBounds.round();var paneOffset;
var doOnePane=false;if(!area||!paneTopLeft){area=paneBounds;paneOffset=paneBounds.getTopLeft();
paneOffset.x=Math.min(paneOffset.x,viewBounds.min.x);paneOffset.y=Math.min(paneOffset.y,
viewBounds.min.y)}else{doOnePane=true;paneOffset=paneTopLeft.clone()}var bandSize=256;
var printRangeLine=false;var drawPrintLine=function(ctx,x1,y1,x2,y2){ctx.moveTo(x1+.5,y1+.5);
ctx.lineTo(x2-.5,y2-.5);ctx.stroke()};var drawHairLine=function(ctx,x1,y1,x2,y2){ctx.fillRect(x1,y1,
x2-x1,y2-y1)};this.context.fillStyle=this.sectionProperties.strokeStyle;for(
var miny=area.min.y;miny<area.max.y;miny+=bandSize){var maxy=Math.min(area.max.y,miny+bandSize);
this.context.beginPath();
this.sectionProperties.docLayer.sheetGeometry._columns.forEachInCorePixelRange(area.min.x,area.max.x
,function(pos,colIndex){var xcoord=xTransform(Math.floor(scale*(pos-paneOffset.x)));
printRangeLine=false;var drawLine=drawHairLine;if(printRange.length===4&&(printRange[0
]===colIndex||printRange[2]+1===colIndex)){printRangeLine=true;startEndDash(this.context,false);
drawLine=drawPrintLine}drawLine(this.context,xcoord-1,Math.floor(scale*(miny-paneOffset.y))-1,xcoord
,Math.floor(scale*(maxy-paneOffset.y)));if(printRangeLine)startEndDash(this.context,true)}.bind(this
));this.sectionProperties.docLayer.sheetGeometry._rows.forEachInCorePixelRange(miny,maxy,function(
pos,rowIndex){printRangeLine=false;var drawLine=drawHairLine;if(printRange.length===4&&(printRange[1
]===rowIndex||printRange[3]+1===rowIndex)){printRangeLine=true;startEndDash(this.context,false);
drawLine=drawPrintLine}drawLine(this.context,xTransform(Math.floor(scale*(area.min.x-paneOffset.x))
)-1,Math.floor(scale*(pos-paneOffset.y))-1,xTransform(Math.floor(scale*(area.max.x-paneOffset.x))),
Math.floor(scale*(pos-paneOffset.y)));if(printRangeLine)startEndDash(this.context,true)}.bind(this))
this.context.closePath()}if(doOnePane)break}};CalcGridSection.prototype.onDraw=function(frameCount,
elapsedTime){if(this.containerObject.isInZoomAnimation(
)||this.sectionProperties.tsManager.waitForTiles())return;if(
!this.sectionProperties.docLayer._sheetGrid)return;this.onDrawArea()};return CalcGridSection}(
CanvasSectionObject);app.definitions.calcGridSection=CalcGridSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var SplitSection=function(_super){__extends(SplitSection,_super
);function SplitSection(){var _this=_super.call(this,app.CSections.Debug.Splits.name)||this;
_this.interactable=false;_this.anchor=["top","left"];
_this.processingOrder=app.CSections.Debug.Splits.processingOrder;
_this.drawingOrder=app.CSections.Debug.Splits.drawingOrder;
_this.zIndex=app.CSections.Debug.Splits.zIndex;_this.boundToSection="tiles";
_this.sectionProperties={docLayer:app.map._docLayer};return _this}
SplitSection.prototype.onDraw=function(){
var splitPanesContext=this.sectionProperties.docLayer.getSplitPanesContext();if(splitPanesContext){
var splitPos=splitPanesContext.getSplitPos();this.context.strokeStyle="red";this.context.strokeRect(
0,0,splitPos.x*app.dpiScale,splitPos.y*app.dpiScale)}};return SplitSection}(CanvasSectionObject);
app.definitions.splitSection=SplitSection;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var SplitterLinesSection=function(_super){__extends(SplitterLinesSection,_super);
function SplitterLinesSection(){var _this=_super.call(this,app.CSections.Splitter.name)||this;
_this.interactable=false;_this.processingOrder=app.CSections.Splitter.processingOrder;
_this.drawingOrder=app.CSections.Splitter.drawingOrder;_this.zIndex=app.CSections.Splitter.zIndex;
_this.documentObject=true;return _this}SplitterLinesSection.prototype.onInitialize=function(){
var splittersDataDiv=document.createElement("div");splittersDataDiv.className="splitters-data";
var canvasContainer=document.getElementById("canvas-container");if(canvasContainer
)canvasContainer.appendChild(splittersDataDiv);this.size=[1e6,1e6];this.position=[0,0];
this.sectionProperties={fillColor:"rgba(0, 0, 0, 0)",fillOpacity:0,thickness:0};
this.readCSSProperties()};SplitterLinesSection.prototype.readCSSProperties=function(){
var splittersDataDiv=document.querySelector(".splitters-data");if(splittersDataDiv){
this.sectionProperties.fillColor=getComputedStyle(splittersDataDiv).getPropertyValue("color");
this.sectionProperties.fillOpacity=getComputedStyle(splittersDataDiv).getPropertyValue("opacity");
this.sectionProperties.thickness=parseFloat(getComputedStyle(splittersDataDiv).getPropertyValue(
"border-top-width").replace("px",""))*app.dpiScale}};
SplitterLinesSection.prototype.setBoxGradient=function(splitPos,isVertical){
var selectionBackgroundGradient=null;var spanlist=app.map._docLayer.sheetGeometry.getRowsGeometry(
)._visibleSizes._spanlist;var rowData=spanlist[spanlist.length-1];
var deafultRowSize=rowData.data.sizecore;var gradientWidth=Math.ceil(deafultRowSize/2);
splitPos.x=this.isCalcRTL()?this.size[0]-splitPos.x:splitPos.x;
selectionBackgroundGradient=this.createSplitLineGradient(splitPos,gradientWidth,isVertical);return{
selectionBackgroundGradient:selectionBackgroundGradient,gradientWidth:gradientWidth}};
SplitterLinesSection.prototype.createSplitLineGradient=function(splitPos,gradientWidth,
isVertSplitter){var sPx=splitPos.x*app.dpiScale;var sPy=splitPos.y*app.dpiScale;
var linearGradient=null;var colorStops=[{colorCode:this.sectionProperties.fillColor,offset:0},{
colorCode:"rgba(240, 240, 240, 0)",offset:1}];if(isVertSplitter){
linearGradient=this.context.createLinearGradient(0,sPy,0,sPy+gradientWidth)}else{var x0=sPx;
var x1=sPx+gradientWidth;if(this.isCalcRTL()){x0=sPx-gradientWidth;x1=sPx}
linearGradient=this.context.createLinearGradient(x0,0,x1,0)}for(var i=0;i<colorStops.length;i++){
var offset=!isVertSplitter&&this.isCalcRTL()?colorStops[colorStops.length-i-1].offset:colorStops[i
].offset;linearGradient.addColorStop(offset,colorStops[i].colorCode)}return linearGradient};
SplitterLinesSection.prototype.GetColumnHeaderHeight=function(){if(
this.containerObject.getSectionWithName(app.CSections.ColumnHeader.name)){
return this.containerObject.getSectionWithName(app.CSections.ColumnHeader.name).size[1]
}else return 0};SplitterLinesSection.prototype.GetRowHeaderWidth=function(){if(
this.containerObject.getSectionWithName(app.CSections.RowHeader.name)){
return this.containerObject.getSectionWithName(app.CSections.RowHeader.name).size[0]}else return 0};
SplitterLinesSection.prototype.onDraw=function(){
var splitPanesContext=app.map._docLayer.getSplitPanesContext();if(splitPanesContext){
var splitPos=splitPanesContext.getSplitPos();if(splitPos.x||splitPos.y){
this.context.globalAlpha=this.sectionProperties.fillOpacity;
this.context.lineWidth=this.sectionProperties.thickness;if(splitPos.x){var width=void 0,style=void 0
if(app.activeDocument.activeView.viewedRectangle.pX1===0){width=this.sectionProperties.thickness;
style=this.sectionProperties.fillColor}else{var temp=this.setBoxGradient(splitPos.clone(),false);
width=temp.gradientWidth;style=temp.selectionBackgroundGradient}this.context.fillStyle=style;
this.context.fillRect(splitPos.x*app.dpiScale,-this.GetColumnHeaderHeight(),width,this.size[1])}if(
splitPos.y){var width=void 0,style=void 0;if(app.activeDocument.activeView.viewedRectangle.pY1===0){
width=this.sectionProperties.thickness;style=this.sectionProperties.fillColor}else{
var temp=this.setBoxGradient(splitPos.clone(),true);width=temp.gradientWidth;
style=temp.selectionBackgroundGradient}this.context.fillStyle=style;this.context.fillRect(
-this.GetRowHeaderWidth(),splitPos.y*app.dpiScale,this.size[0],width)}}}this.context.globalAlpha=1};
return SplitterLinesSection}(CanvasSectionObject);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var PixelGridSection=function(_super){__extends(PixelGridSection,_super);function PixelGridSection(
){var _this=_super.call(this,app.CSections.Debug.TilePixelGrid.name)||this;_this.interactable=false;
_this.anchor=["top","left"];_this.processingOrder=app.CSections.Debug.TilePixelGrid.processingOrder;
_this.drawingOrder=app.CSections.Debug.TilePixelGrid.drawingOrder;
_this.zIndex=app.CSections.Debug.TilePixelGrid.zIndex;_this.boundToSection="tiles";return _this}
PixelGridSection.prototype.onDraw=function(frameCount,elapsedTime){var offset=8;var count;
this.context.lineWidth=1;var currentPos;this.context.strokeStyle="#ff0000";currentPos=0;
count=Math.round(this.context.canvas.height/offset);for(var i=0;i<count;i++){this.context.beginPath(
);this.context.moveTo(.5,currentPos+.5);this.context.lineTo(this.context.canvas.width+.5,
currentPos+.5);this.context.stroke();currentPos+=offset}currentPos=0;count=Math.round(
this.context.canvas.width/offset);for(var i=0;i<count;i++){this.context.beginPath();
this.context.moveTo(currentPos+.5,.5);this.context.lineTo(currentPos+.5,
this.context.canvas.height+.5);this.context.stroke();currentPos+=offset}};return PixelGridSection}(
CanvasSectionObject);app.definitions.pixelGridSection=PixelGridSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __read=this&&this.__read||function(o,n){
var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{
while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}
}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar};
var DebugOverlaySection=function(_super){__extends(DebugOverlaySection,_super);
function DebugOverlaySection(debug){var _this=_super.call(this,app.CSections.Debug.DebugOverlay.name
)||this;_this.interactable=false;_this.anchor=["top","left"];
_this.processingOrder=app.CSections.Debug.DebugOverlay.processingOrder;
_this.drawingOrder=app.CSections.Debug.DebugOverlay.drawingOrder;
_this.zIndex=app.CSections.Debug.DebugOverlay.zIndex;_this.boundToSection="tiles";_this._debug=debug
return _this}DebugOverlaySection.prototype.onDraw=function(frameCount,elapsedTime,subsetBounds){
TileManager.updateOverlayMessages();var msgs=this._debug.getOverlayMessages();if(!msgs)return;
var topValues=Object.entries(msgs).filter(function(_a){var _b=__read(_a,1),key=_b[0];
return key.startsWith("top-")}).map(function(_a){var _b=__read(_a,2),value=_b[1];
return value.toString()});var bottomValues=Object.entries(msgs).filter(function(_a){var _b=__read(_a
,1),key=_b[0];return!key.startsWith("top-")}).map(function(_a){var _b=__read(_a,2),value=_b[1];
return value.toString()});var drawValues=function(ctx,top,lines){var textLines=lines.join("\n"
).split("\n");if(textLines.length<1)return;var lineHeight=22;ctx.font="18px Arial";var ybase;if(top
)ybase=lineHeight*2;else ybase=ctx.canvas.height-lineHeight*textLines.length;ctx.textAlign="left";
ctx.fillStyle="rgba(255.0, 255.0, 255.0, 0.7)";textLines.forEach(function(txt,i){var xpad=lineHeight
var y=ybase+i*lineHeight;var metrics=ctx.measureText(txt);ctx.fillRect(0,y-lineHeight,
metrics.width+xpad,lineHeight*1.5)});ctx.fillStyle="rgba(0, 0, 0, 0.7)";textLines.forEach(function(
txt,i){var xpad=lineHeight;var y=ybase+i*lineHeight;ctx.fillText(txt,xpad,y)})};drawValues(
this.context,true,topValues);drawValues(this.context,false,bottomValues)};return DebugOverlaySection
}(CanvasSectionObject);app.definitions.debugOverlaySection=DebugOverlaySection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var PreloadMapSection=function(_super){__extends(
PreloadMapSection,_super);function PreloadMapSection(){var _this=_super.call(this,
app.CSections.Debug.PreloadMap.name)||this;_this.interactable=false;_this.anchor=["top","left"];
_this.processingOrder=app.CSections.Debug.PreloadMap.processingOrder;
_this.drawingOrder=app.CSections.Debug.PreloadMap.drawingOrder;
_this.zIndex=app.CSections.Debug.PreloadMap.zIndex;_this.boundToSection="tiles";return _this}
PreloadMapSection.prototype.onDraw=function(frameCount,elapsedTime,subsetBounds){
var docLayer=app.map._docLayer;var ctx=docLayer._painter._paintContext();var zoom=Math.round(
app.map.getZoom());var part=docLayer._selectedPart;var tileRanges=ctx.paneBoundsList.map(
TileManager.pxBoundsToTileRange,TileManager);var viewRange=tileRanges.length==4?tileRanges[3
]:tileRanges[0];var canvas=this.context;var tileRange=new cool.Bounds(viewRange.min,viewRange.max);
var viewWidth=Math.floor((app.map.getPixelBoundsCore().getSize().x+TileManager.tileSize-1
)/TileManager.tileSize);var viewHeight=Math.floor((app.map.getPixelBoundsCore().getSize(
).y+TileManager.tileSize-1)/TileManager.tileSize);var sizePix=3;var numParts=1;var enlargeX=.1;
var enlargeY=2;var mainYMultiply=10;if(docLayer.isCalc()){enlargeX=2;enlargeY=2;sizePix=6;numParts=3
mainYMultiply=2}else if(docLayer.isImpress()){enlargeX=.5;enlargeY=.5;mainYMultiply=0;sizePix=6;
numParts=7}tileRange.min.x=tileRange.min.x-Math.floor(viewWidth*enlargeX);
tileRange.max.x=tileRange.max.x+Math.floor(viewWidth*enlargeX);
tileRange.min.y=tileRange.min.y-Math.floor(viewHeight*enlargeY);
tileRange.max.y=tileRange.max.y+Math.floor(viewHeight*enlargeY);var preParts=(numParts-1)/2;
var partBounds=new Array(numParts);for(var i=0;i<partBounds.length;++i){partBounds[i
]=new cool.Bounds(tileRange.min,tileRange.max);partBounds[i].part=part+i-preParts}partBounds[
preParts].min.y-=viewHeight*mainYMultiply;partBounds[preParts].max.y+=viewHeight*mainYMultiply;
var offx=50;var offy=200;var voffset=0;for(var p=0;p<partBounds.length;++p){var range=partBounds[p];
for(var j=range.min.y;j<=range.max.y;++j){for(var i=range.min.x;i<=range.max.x;++i){if(
i>=0&&j>=0&&range.part>=0){var coords=new TileCoordData(i*TileManager.tileSize,
j*TileManager.tileSize,zoom,range.part,docLayer._selectedMode);var tile=TileManager.get(coords);if(
!tile)canvas.fillStyle="rgba(128, 128, 128, 0.5)";else if(!tile.hasContent()
)canvas.fillStyle="rgba(255, 0, 0, 0.8)";else if(tile.needsFetch()
)canvas.fillStyle="rgba(255, 255, 0, 0.8)";else if(!tile.image
)canvas.fillStyle="rgba(0, 96, 0, 0.8)";else if(tile.distanceFromView<=0
)canvas.fillStyle="rgba(0, 255, 0, 0.5)";else{var expFactor=TileManager.getExpiryFactor(tile);if(
expFactor>=0)canvas.fillStyle="rgba(0, "+Math.round(192*(1-expFactor))+", "+Math.round(96*expFactor
)+", 0.8)"}}else canvas.fillStyle="rgba(0, 0, 0, 0.3)";canvas.fillRect(offx+(i-range.min.x)*sizePix,
offy+(j-range.min.y)*sizePix+voffset,sizePix,sizePix)}}if(range.part==part){
canvas.strokeStyle="rgba(0, 0, 0, 0.5)";canvas.lineWidth=1;canvas.strokeRect(offx+(
viewRange.min.x-range.min.x)*sizePix,offy+(viewRange.min.y-range.min.y)*sizePix+voffset,
viewWidth*sizePix,viewHeight*sizePix)}voffset+=sizePix*(range.max.y-range.min.y+4)}};
return PreloadMapSection}(CanvasSectionObject);app.definitions.preloadMapSection=PreloadMapSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var cool;(function(cool){var TilesSection=function(_super){__extends(TilesSection,_super);
function TilesSection(){var _this=_super.call(this,app.CSections.Tiles.name)||this;_this.anchor=[[
app.CSections.ColumnHeader.name,"bottom","top"],[app.CSections.RowHeader.name,"right","left"]];
_this.expand=["top","left","bottom","right"];
_this.processingOrder=app.CSections.Tiles.processingOrder;
_this.drawingOrder=app.CSections.Tiles.drawingOrder;_this.zIndex=app.CSections.Tiles.zIndex;
_this.isJSDOM=false;_this.map=window.L.Map.THIS;_this.sectionProperties.docLayer=_this.map._docLayer
_this.sectionProperties.tsManager=_this.sectionProperties.docLayer._painter;
_this.sectionProperties.pageBackgroundInnerMargin=0;
_this.sectionProperties.pageBackgroundBorderColor="lightgrey";
_this.sectionProperties.pageBackgroundTextColor="grey";
_this.sectionProperties.pageBackgroundFont=String(40*app.roundedDpiScale)+"px Arial";
_this.isJSDOM=typeof window==="object"&&window.name==="nodejs";
_this.checkpattern=_this.makeCheckPattern();return _this}
TilesSection.prototype.makeCheckPattern=function(){var canvas=document.createElement("canvas");
canvas.width=256;canvas.height=256;var drawctx=canvas.getContext("2d");var patternOn=true;for(
var y=0;y<256;y+=32){for(var x=0;x<256;x+=32){if(patternOn
)drawctx.fillStyle="darkgray";else drawctx.fillStyle="gray";patternOn=!patternOn;drawctx.fillRect(x,
y,32,32)}patternOn=!patternOn}return canvas};TilesSection.prototype.paintWithPanes=function(tile,ctx
,async){var tileTopLeft=tile.coords.getPos();var tileBounds=new cool.Bounds(tileTopLeft,
tileTopLeft.add(new cool.Point(TileManager.tileSize,TileManager.tileSize)));for(
var i=0;i<ctx.paneBoundsList.length;++i){var paneBounds=ctx.paneBoundsList[i];
var viewBounds=ctx.viewBounds;paneBounds.round();viewBounds.round();if(paneBounds.intersects(
tileBounds)){var paneOffset=paneBounds.getTopLeft();paneOffset.x=Math.min(paneOffset.x,
viewBounds.min.x);paneOffset.y=Math.min(paneOffset.y,viewBounds.min.y);this.drawTileInPane(tile,
tileBounds,paneBounds,paneOffset,this.context,async)}}};TilesSection.prototype.beforeDraw=function(
canvasCtx){var mirrorTile=this.isCalcRTL();if(mirrorTile){canvasCtx.save();canvasCtx.translate(
this.size[0],0);canvasCtx.scale(-1,1)}};TilesSection.prototype.afterDraw=function(canvasCtx){
var mirrorTile=this.isCalcRTL();if(mirrorTile){canvasCtx.restore()}};
TilesSection.prototype.getSubsetBounds=function(canvasCtx,tileSubset){var e_1,_a;if(
app.file.fileBasedView)return null;var ctx=this.sectionProperties.tsManager._paintContext();
var bounds;try{for(var _b=__values(Array.from(tileSubset)),_c=_b.next();!_c.done;_c=_b.next()){
var coords=_c.value;var topLeft=new cool.Point(coords.getPos().x,coords.getPos().y);
var rightBottom=new cool.Point(topLeft.x+TileManager.tileSize,topLeft.y+TileManager.tileSize);if(
bounds===undefined)bounds=new cool.Bounds(topLeft,rightBottom);else{bounds.extend(topLeft).extend(
rightBottom)}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b
)}finally{if(e_1)throw e_1.error}}return bounds};TilesSection.prototype.clipSubsetBounds=function(
canvasCtx,subsetBounds){var ctx=this.sectionProperties.tsManager._paintContext();
ctx.viewBounds.round();canvasCtx.beginPath();var rect=subsetBounds.toRectangle();this.beforeDraw(
canvasCtx);canvasCtx.rect(rect[0]-ctx.viewBounds.min.x,rect[1]-ctx.viewBounds.min.y,rect[2],rect[3])
this.afterDraw(canvasCtx);canvasCtx.clip()};TilesSection.prototype.drawTileInPane=function(tile,
tileBounds,paneBounds,paneOffset,canvasCtx,clearBackground){var crop=new cool.Bounds(tileBounds.min,
tileBounds.max);crop.min.x=Math.max(paneBounds.min.x,tileBounds.min.x);crop.min.y=Math.max(
paneBounds.min.y,tileBounds.min.y);crop.max.x=Math.min(paneBounds.max.x,tileBounds.max.x);
crop.max.y=Math.min(paneBounds.max.y,tileBounds.max.y);var cropWidth=crop.max.x-crop.min.x;
var cropHeight=crop.max.y-crop.min.y;if(cropWidth&&cropHeight){if(
clearBackground||this.containerObject.isZoomChanged()||canvasCtx!==this.context){
canvasCtx.fillStyle=this.containerObject.getClearColor();this.beforeDraw(canvasCtx);
canvasCtx.fillRect(crop.min.x-paneOffset.x,crop.min.y-paneOffset.y,cropWidth,cropHeight);
this.afterDraw(canvasCtx);var gridSection=this.containerObject.getSectionWithName(
app.CSections.CalcGrid.name);gridSection.onDrawArea(crop,paneOffset,canvasCtx)}this.beforeDraw(
canvasCtx);this.drawTileToCanvasCrop(tile,canvasCtx,crop.min.x-tileBounds.min.x,
crop.min.y-tileBounds.min.y,cropWidth,cropHeight,crop.min.x-paneOffset.x,crop.min.y-paneOffset.y,
cropWidth,cropHeight);this.afterDraw(canvasCtx)}};
TilesSection.prototype.pdfViewDrawTileBorders=function(tile,offset,tileSize){
this.context.strokeStyle="red";this.context.strokeRect(offset.x,offset.y,tileSize,tileSize);
this.context.font="20px Verdana";this.context.fillStyle="black";this.context.fillText(
tile.coords.x+" "+tile.coords.y+" "+tile.coords.part,Math.round(offset.x+tileSize*.5),Math.round(
offset.y+tileSize*.5))};TilesSection.prototype.paintSimple=function(tile,ctx,async){
ctx.viewBounds.round();var offset=new cool.Point(tile.coords.getPos().x-ctx.viewBounds.min.x,
tile.coords.getPos().y-ctx.viewBounds.min.y);if((async||this.containerObject.isZoomChanged()
)&&!app.file.fileBasedView){this.context.fillStyle=this.containerObject.getClearColor();
this.context.fillRect(offset.x,offset.y,TileManager.tileSize,TileManager.tileSize)}if(
app.file.fileBasedView){var partHeightPixels=Math.round((
this.sectionProperties.docLayer._partHeightTwips+this.sectionProperties.docLayer._spaceBetweenParts
)*app.twipsToPixels);
offset.y=tile.coords.part*partHeightPixels+tile.coords.y-app.activeDocument.activeView.viewedRectangle.pY1
}this.drawTileToCanvas(tile,this.context,offset.x,offset.y,TileManager.tileSize,TileManager.tileSize
)};TilesSection.prototype.paint=function(tile,ctx,async){if(this.containerObject.isInZoomAnimation(
)||this.sectionProperties.tsManager.waitForTiles())return;if(!ctx
)ctx=this.sectionProperties.tsManager._paintContext();this.containerObject.setPenPosition(this);if(
ctx.paneBoundsActive===true)this.paintWithPanes(tile,ctx,async);else this.paintSimple(tile,ctx,async
)};TilesSection.prototype.forEachTileInView=function(zoom,part,mode,ctx,callback){
var tileRanges=ctx.paneBoundsList.map(TileManager.pxBoundsToTileRange,TileManager);if(
app.file.fileBasedView){var coordList=TileManager.updateFileBasedView(true);for(
var k=0;k<coordList.length;k++){var tile=TileManager.get(coordList[k]);if(!callback(tile,coordList[k
]))return}}else{for(var rangeIdx=0;rangeIdx<tileRanges.length;++rangeIdx){var tileRange=tileRanges[
rangeIdx];for(var j=tileRange.min.y;j<=tileRange.max.y;++j){for(
var i=tileRange.min.x;i<=tileRange.max.x;++i){var coords=new TileCoordData(i*TileManager.tileSize,
j*TileManager.tileSize,zoom,part,mode);var tile=TileManager.get(coords);if(!callback(tile,coords)
)return}}}}};TilesSection.prototype.haveAllTilesInView=function(zoom,part,mode,ctx){
zoom=zoom||Math.round(this.map.getZoom());part=part||this.sectionProperties.docLayer._selectedPart;
ctx=ctx||this.sectionProperties.tsManager._paintContext();var allTilesFetched=true;
this.forEachTileInView(zoom,part,mode,ctx,function(tile){if(!tile||tile.needsFetch()){
allTilesFetched=false;return false}return true});return allTilesFetched};
TilesSection.prototype.drawPageBackgroundWriter=function(ctx){var viewRectangleTwips=[
app.activeDocument.activeView.viewedRectangle.pX1,app.activeDocument.activeView.viewedRectangle.pY1,
this.containerObject.getDocumentAnchorSection().size[0],
this.containerObject.getDocumentAnchorSection().size[1]];viewRectangleTwips=viewRectangleTwips.map(
function(element){return Math.round(element*app.pixelsToTwips)});
this.context.fillStyle=this.containerObject.getDocumentBackgroundColor();for(
var i=0;i<app.file.writer.pageRectangleList.length;i++){
var rectangle=app.file.writer.pageRectangleList[i];if(rectangle[1]>viewRectangleTwips[1]&&rectangle[
1]<viewRectangleTwips[1]+viewRectangleTwips[3]||rectangle[1]+rectangle[3]>viewRectangleTwips[1
]&&rectangle[1]+rectangle[3]<viewRectangleTwips[1]+viewRectangleTwips[3]||rectangle[1
]<viewRectangleTwips[1]&&rectangle[1]+rectangle[3]>viewRectangleTwips[1]+viewRectangleTwips[3]){
rectangle=[Math.round(rectangle[0]*app.twipsToPixels),Math.round(rectangle[1]*app.twipsToPixels),
Math.round(rectangle[2]*app.twipsToPixels),Math.round(rectangle[3]*app.twipsToPixels)];
this.context.fillRect(rectangle[0
]-ctx.viewBounds.min.x+this.sectionProperties.pageBackgroundInnerMargin,rectangle[1
]-ctx.viewBounds.min.y+this.sectionProperties.pageBackgroundInnerMargin,rectangle[2
]-this.sectionProperties.pageBackgroundInnerMargin,rectangle[3
]-this.sectionProperties.pageBackgroundInnerMargin)}}};
TilesSection.prototype.drawPageBackgroundFileBasedView=function(ctx){
var partHeightPixels=Math.round((
this.map._docLayer._partHeightTwips+this.map._docLayer._spaceBetweenParts)*app.twipsToPixels);
var visibleBounds=app.activeDocument.activeView.viewedRectangle.pToArray();
var topVisible=Math.floor(visibleBounds[1]/partHeightPixels);var bottomVisible=Math.ceil((
visibleBounds[1]+visibleBounds[3])/partHeightPixels);topVisible=topVisible>=0?topVisible:0;
bottomVisible=bottomVisible<this.map._docLayer._parts?bottomVisible:this.map._docLayer._parts-1;if(
!isNaN(partHeightPixels)&&partHeightPixels>0){var partHeightPixels=Math.round(
this.map._docLayer._partHeightTwips*app.twipsToPixels);var gap=Math.round(
this.map._docLayer._spaceBetweenParts*app.twipsToPixels);var partWidthPixels=Math.round(
this.map._docLayer._partWidthTwips*app.twipsToPixels);var startY=(partHeightPixels+gap)*(
topVisible>0?topVisible:0);var rectangle;for(var i=0;i<=bottomVisible-topVisible;i++){rectangle=[0,
startY,partWidthPixels,partHeightPixels];this.context.strokeRect(rectangle[0
]-ctx.viewBounds.min.x+this.sectionProperties.pageBackgroundInnerMargin,rectangle[1
]-ctx.viewBounds.min.y+this.sectionProperties.pageBackgroundInnerMargin,rectangle[2
]-this.sectionProperties.pageBackgroundInnerMargin,rectangle[3
]-this.sectionProperties.pageBackgroundInnerMargin);this.context.fillText(String(i+topVisible+1),
Math.round((2*rectangle[0]+rectangle[2])*.5)-ctx.viewBounds.min.x,Math.round((2*rectangle[1
]+rectangle[3])*.5)-ctx.viewBounds.min.y,rectangle[2]*.4);startY+=partHeightPixels+gap}}};
TilesSection.prototype.drawPageBackgroundsMultiPageView=function(){
this.context.fillStyle=this.containerObject.getDocumentBackgroundColor();
this.context.strokeStyle="red";for(
var i=0;i<app.activeDocument.activeView.layoutRectangles.length;i++){
var rectangle=app.activeDocument.activeView.layoutRectangles[i];var coords=[
rectangle.layoutX-app.activeDocument.activeView.viewedRectangle.pX1,
rectangle.layoutY-app.activeDocument.activeView.viewedRectangle.pY1,rectangle.pWidth,
rectangle.pHeight];this.context.strokeRect(coords[0],coords[1],coords[2],coords[3]);
this.context.fillRect(coords[0],coords[1],coords[2],coords[3])}};
TilesSection.prototype.drawPageBackgrounds=function(ctx){if(
!app.file.fileBasedView&&!app.file.writer.multiPageView&&this.map._docLayer._docType!=="text")return
if(!this.containerObject.getDocumentAnchorSection())return;
this.context.fillStyle=this.sectionProperties.pageBackgroundTextColor;
this.context.strokeStyle=this.sectionProperties.pageBackgroundBorderColor;
this.context.lineWidth=app.roundedDpiScale;
this.context.font=this.sectionProperties.pageBackgroundFont;if(app.file.fileBasedView
)this.drawPageBackgroundFileBasedView(ctx);else if(app.file.writer.multiPageView
)this.drawPageBackgroundsMultiPageView();else if(this.map._docLayer._docType==="text"
)this.drawPageBackgroundWriter(ctx)};TilesSection.prototype.drawForMultiPageView=function(){
var visibleCoordList=TileManager.getVisibleCoordList(
app.activeDocument.activeView.getVisibleAreaRectangle());for(var i=0;i<visibleCoordList.length;i++){
var coords=visibleCoordList[i];var firstIntersection=-1;for(
var j=0;j<app.activeDocument.activeView.layoutRectangles.length;j++){
var layoutRectangle=app.activeDocument.activeView.layoutRectangles[j];var coordsRectangle=[coords.x,
coords.y,TileManager.tileSize,TileManager.tileSize];
var intersection=LOUtil._getIntersectionRectangle(layoutRectangle.pToArray(),coordsRectangle);if(
intersection){firstIntersection=j;var viewX=Math.round(layoutRectangle.layoutX+(intersection[0
]-layoutRectangle.pX1)-app.activeDocument.activeView.viewedRectangle.pX1);var viewY=Math.round(
layoutRectangle.layoutY+(intersection[1]-layoutRectangle.pY1
)-app.activeDocument.activeView.viewedRectangle.pY1);var sX=Math.round(intersection[0]-coords.x);
var sY=Math.round(intersection[1]-coords.y);this.drawTileToCanvasCrop(TileManager.get(coords),
this.context,sX,sY,intersection[2],intersection[3],viewX,viewY,intersection[2],intersection[3])}if(
firstIntersection>-1&&j-firstIntersection>1)break}}};TilesSection.prototype.onDraw=function(
frameCount,elapsedTime){if(frameCount===void 0){frameCount=null}if(elapsedTime===void 0){
elapsedTime=null}if(this.containerObject.isInZoomAnimation())return;if(this.containerObject.testing
){this.containerObject.createUpdateSingleDivElement(this)}if(app.file.writer.multiPageView===true){
this.drawPageBackgroundsMultiPageView();this.drawForMultiPageView();return}var zoom=Math.round(
this.map.getZoom());var part=this.sectionProperties.docLayer._selectedPart;
var mode=this.sectionProperties.docLayer._selectedMode;
var ctx=this.sectionProperties.tsManager._paintContext();if(
this.sectionProperties.tsManager.waitForTiles()){if(!this.haveAllTilesInView(zoom,part,mode,ctx)
)return}else if(!this.containerObject.isZoomChanged()){this.drawPageBackgrounds(ctx)}
var docLayer=this.sectionProperties.docLayer;var doneTiles=new Set;this.forEachTileInView(zoom,part,
mode,ctx,function(tile,coords){if(doneTiles.has(coords.key()))return true;if(
tile&&TileManager.isValidTile(coords)){if(!this.isJSDOM){if(tile.isReadyToDraw(
)||this.map._debug.tileOverlaysOn){this.paint(tile,ctx,false)}}}doneTiles.add(coords.key());
return true}.bind(this))};TilesSection.prototype.onClick=function(point,e){if(
this.map._docLayer._docType==="presentation"||this.map._docLayer._docType==="drawing"
)this.map._docLayer._preview.partsFocused=false};
TilesSection.getTileIntersectionAreaFraction=function(tileBounds,viewBounds){
var size=tileBounds.getSize();if(size.x<=0||size.y<=0)return 0;var intersection=new cool.Bounds(
new cool.Point(Math.max(tileBounds.min.x,viewBounds.min.x),Math.max(tileBounds.min.y,
viewBounds.min.y)),new cool.Point(Math.min(tileBounds.max.x,viewBounds.max.x),Math.min(
tileBounds.max.y,viewBounds.max.y)));var interSize=intersection.getSize();return Math.max(0,
interSize.x)*Math.max(0,interSize.y)/(size.x*size.y)};
TilesSection.prototype.forEachTileInArea=function(area,zoom,part,mode,ctx,callback){if(
app.file.fileBasedView){var coordList=TileManager.updateFileBasedView(true,area,zoom);for(
var k=0;k<coordList.length;k++){var coords=coordList[k];var tile=TileManager.get(coords);if(tile
)callback(tile,coords,this)}return}var tileRange=TileManager.pxBoundsToTileRange(area);for(
var j=tileRange.min.y;j<=tileRange.max.y;++j){for(var i=tileRange.min.x;i<=tileRange.max.x;++i){
var coords=new TileCoordData(i*TileManager.tileSize,j*TileManager.tileSize,zoom,part,mode);
var tile=TileManager.get(coords);if(tile)callback(tile,coords,this)}}};
TilesSection.prototype.zoomLevelWithMaxContentInArea=function(area,areaZoom,part,mode,ctx){
var frameScale=this.sectionProperties.tsManager._zoomFrameScale;
var docLayer=this.sectionProperties.docLayer;var targetZoom=Math.round(this.map.getScaleZoom(
frameScale,areaZoom));var bestZoomLevel=targetZoom;var availAreaScoreAtBestZL=-Infinity;
var area=area.clone();if(area.min.x<0)area.min.x=0;if(area.min.y<0)area.min.y=0;
var minZoom=this.map.options.minZoom;var maxZoom=this.map.options.maxZoom;for(
var zoom=minZoom;zoom<=maxZoom;++zoom){var availAreaScore=0;var hasTiles=false;
var dimensionCorrection=this.map.zoomToFactor(maxZoom-zoom+this.map.options.zoom);
var areaAtZoom=this.scaleBoundsForZoom(area,zoom,areaZoom);var relScale=this.map.getZoomScale(zoom,
areaZoom);this.forEachTileInArea(areaAtZoom,zoom,part,mode,ctx,function(tile,coords,section){if(
tile&&tile.image){var tilePos=coords.getPos();if(app.file.fileBasedView){
var ratio=TileManager.tileSize*relScale/app.tile.size.y;var partHeightPixels=Math.round((
docLayer._partHeightTwips+docLayer._spaceBetweenParts)*ratio);
tilePos.y=coords.part*partHeightPixels+tilePos.y}var tileBounds=new cool.Bounds(tilePos,tilePos.add(
new cool.Point(TileManager.tileSize,TileManager.tileSize)));
var interFrac=TilesSection.getTileIntersectionAreaFraction(tileBounds,areaAtZoom);
availAreaScore+=interFrac;if(!hasTiles)hasTiles=true}return true});
availAreaScore=hasTiles?Math.round(availAreaScore*dimensionCorrection*dimensionCorrection/10
):-Infinity;if(
availAreaScore>availAreaScoreAtBestZL||availAreaScore==availAreaScoreAtBestZL&&Math.abs(
targetZoom-bestZoomLevel)>Math.abs(targetZoom-zoom)){availAreaScoreAtBestZL=availAreaScore;
bestZoomLevel=zoom}}return bestZoomLevel};TilesSection.prototype.drawTileToCanvas=function(tile,
canvas,dx,dy,dWidth,dHeight){this.drawTileToCanvasCrop(tile,canvas,0,0,TileManager.tileSize,
TileManager.tileSize,dx,dy,dWidth,dHeight)};TilesSection.prototype.drawDebugHistogram=function(
canvas,x,y,value,offset){var tSize=256;var deltaSize=4;var maxDeltas=(tSize-16)/deltaSize;
var yoff=Math.floor(offset/maxDeltas);y+=yoff*deltaSize;offset-=yoff*maxDeltas;
var firstRowFill=Math.min(value,maxDeltas-offset);if(firstRowFill>0)canvas.fillRect(
x+offset*deltaSize,y,firstRowFill*deltaSize,deltaSize);value=value-firstRowFill;
var rowBlock=Math.floor(value/maxDeltas);if(rowBlock>0)canvas.fillRect(x,y+deltaSize,
maxDeltas*deltaSize,rowBlock*deltaSize);var rowLeft=value%maxDeltas;if(rowLeft>0)canvas.fillRect(x,
y+rowBlock*deltaSize+deltaSize,rowLeft*deltaSize,deltaSize)};
TilesSection.prototype.drawTileToCanvasCrop=function(tile,canvas,sx,sy,sWidth,sHeight,dx,dy,dWidth,
dHeight){TileManager.touchImage(tile);if(tile.image)canvas.drawImage(tile.image,sx,sy,sWidth,sHeight
,dx,dy,dWidth,dHeight);if(this.map._debug.tileOverlaysOn){this.beforeDraw(canvas);canvas.save();
var clipRegion=new Path2D;clipRegion.rect(dx,dy,dWidth,dHeight);canvas.clip(clipRegion);var ox=-sx;
var oy=-sy;var tSize=256;canvas.lineWidth=1;canvas.strokeStyle="rgba(0, 0, 255, 0.8)";
canvas.beginPath();canvas.moveTo(ox+dx+.5,oy+dy+.5);canvas.lineTo(ox+dx+.5,oy+dy+tSize+.5);
canvas.lineTo(ox+dx+tSize+.5,oy+dy+tSize+.5);canvas.lineTo(ox+dx+tSize+.5,oy+dy+.5);canvas.lineTo(
ox+dx+.5,oy+dy+.5);canvas.stroke();if(!tile.hasContent()
)canvas.fillStyle="rgba(255, 0, 0, 0.8)";else if(tile.needsFetch()
)canvas.fillStyle="rgba(255, 255, 0, 0.8)";else if(!tile.isReady()
)canvas.fillStyle="rgba(0, 160, 0, 0.8)";else canvas.fillStyle="rgba(0, 255, 0, 0.5)";
canvas.fillRect(ox+dx+1.5,oy+dy+1.5,12,12);if(tile.deltaCount){
canvas.fillStyle="rgba(0, 0, 256, 0.3)";this.drawDebugHistogram(canvas,ox+dx+1.5+14,oy+dy+1.5,
tile.deltaCount,0);canvas.fillStyle="rgba(256, 256, 0, 0.3)";this.drawDebugHistogram(canvas,
ox+dx+1.5+14,oy+dy+1.5,tile.updateCount,tile.deltaCount)}var lines=["wireId: "+tile.wireId,
"invalidFrom: "+tile.invalidFrom,"nviewid: "+tile.viewId,"invalidates: "+tile.invalidateCount,
"tile: "+tile.loadCount+" Δ: "+tile.deltaCount+" upd: "+tile.updateCount,
"misses: "+tile.missingContent+" gce: "+tile.gcErrors,"dlta size/kB: "+((
tile.rawDeltas?tile.rawDeltas.length:0)/1024).toFixed(2)];var startY=tSize-12*lines.length;
canvas.fillStyle="rgba(220, 220, 220, 0.5)";canvas.fillRect(ox+dx+1.5,oy+dy+startY-12,100,
12*lines.length+8);canvas.font="12px sans";canvas.fillStyle="rgba(0, 0, 0, 1.0)";
canvas.textAlign="left";for(var i=0;i<lines.length;++i)canvas.fillText(lines[i],ox+dx+5.5,
oy+dy+startY+i*12);canvas.restore();this.afterDraw(canvas)}};
TilesSection.prototype.drawZoomFrame=function(ctx){var e_2,_a;
var tsManager=this.sectionProperties.tsManager;if(!tsManager._inZoomAnim)return;
var scale=tsManager._zoomFrameScale;if(!scale||!tsManager._newCenter)return;
ctx=ctx||this.sectionProperties.tsManager._paintContext();
var docLayer=this.sectionProperties.docLayer;var zoom=Math.round(this.map.getZoom());
var part=docLayer._selectedPart;var mode=docLayer._selectedMode;var splitPos=ctx.splitPos;
this.containerObject.setPenPosition(this);var viewSize=ctx.viewBounds.getSize();
this.context.fillStyle=this.containerObject.getClearColor();this.context.fillRect(0,0,viewSize.x,
viewSize.y);var paneBoundsList=ctx.paneBoundsList;var maxXBound=0;var maxYBound=0;try{for(
var paneBoundsList_1=__values(paneBoundsList),paneBoundsList_1_1=paneBoundsList_1.next(
);!paneBoundsList_1_1.done;paneBoundsList_1_1=paneBoundsList_1.next()){
var paneBounds_1=paneBoundsList_1_1.value;maxXBound=Math.max(maxXBound,paneBounds_1.min.x);
maxYBound=Math.max(maxYBound,paneBounds_1.min.y)}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(
paneBoundsList_1_1&&!paneBoundsList_1_1.done&&(_a=paneBoundsList_1.return))_a.call(paneBoundsList_1)
}finally{if(e_2)throw e_2.error}}for(var k=0;k<paneBoundsList.length;++k){
var paneBounds=paneBoundsList[k];var paneSize=paneBounds.getSize();var destPos=new cool.Point(0,0);
var docAreaSize=paneSize.divideBy(scale);var freezeX=void 0;var freezeY=void 0;if(
paneBounds.min.x===0&&maxXBound!==0){docAreaSize.x=paneSize.x;freezeX=true}else{destPos.x=splitPos.x
docAreaSize.x+=splitPos.x/scale;freezeX=false}if(paneBounds.min.y===0&&maxYBound!==0){
docAreaSize.y=paneSize.y;freezeY=true}else{destPos.y=splitPos.y;docAreaSize.y+=splitPos.y/scale;
freezeY=false}var docPos=tsManager._getZoomDocPos(tsManager._newCenter,
tsManager._layer._pinchStartCenter,paneBounds,{freezeX:freezeX,freezeY:freezeY},splitPos,scale,false
);if(!freezeX){tsManager._zoomAtDocEdgeX=docPos.topLeft.x==splitPos.x}if(!freezeY){
tsManager._zoomAtDocEdgeY=docPos.topLeft.y==splitPos.y}var docRange=new cool.Bounds(docPos.topLeft,
docPos.topLeft.add(docAreaSize));if(tsManager._calcGridSection){
tsManager._calcGridSection.onDrawArea(docRange,docRange.min.subtract(destPos),this.context)}
var canvasContext=this.context;var bestZoomSrc=zoom;var sheetGeometry=docLayer.sheetGeometry;
var useSheetGeometry=false;if(scale<1){useSheetGeometry=!!sheetGeometry;
bestZoomSrc=this.zoomLevelWithMaxContentInArea(docRange,zoom,part,mode,ctx)}
var docRangeScaled=bestZoomSrc==zoom?docRange:this.scaleBoundsForZoom(docRange,bestZoomSrc,zoom);
var destPosScaled=bestZoomSrc==zoom?destPos:this.scalePosForZoom(destPos,bestZoomSrc,zoom);
var relScale=bestZoomSrc==zoom?1:this.map.getZoomScale(bestZoomSrc,zoom);this.beforeDraw(
canvasContext);this.forEachTileInArea(docRangeScaled,bestZoomSrc,part,mode,ctx,function(tile,coords,
section){if(!tile||!tile.isReadyToDraw()||!TileManager.isValidTile(coords))return false;
var tileCoords=tile.coords.getPos();if(app.file.fileBasedView){
var ratio=TileManager.tileSize*relScale/app.tile.size.y;var partHeightPixels=Math.round((
docLayer._partHeightTwips+docLayer._spaceBetweenParts)*ratio);
tileCoords.y=tile.coords.part*partHeightPixels+tileCoords.y}var tileBounds=new cool.Bounds(
tileCoords,tileCoords.add(new cool.Point(TileManager.tileSize,TileManager.tileSize)));
var crop=new cool.Bounds(tileBounds.min,tileBounds.max);crop.min.x=Math.max(docRangeScaled.min.x,
tileBounds.min.x);crop.min.y=Math.max(docRangeScaled.min.y,tileBounds.min.y);crop.max.x=Math.min(
docRangeScaled.max.x,tileBounds.max.x);crop.max.y=Math.min(docRangeScaled.max.y,tileBounds.max.y);
var cropWidth=crop.max.x-crop.min.x;var cropHeight=crop.max.y-crop.min.y;
var tileOffset=crop.min.subtract(tileBounds.min);var paneOffset=crop.min.subtract(
docRangeScaled.min.subtract(destPosScaled));if(cropWidth&&cropHeight){section.drawTileToCanvasCrop(
tile,canvasContext,tileOffset.x,tileOffset.y,cropWidth,cropHeight,Math.floor(
paneOffset.x/relScale*scale)+.5,Math.floor(paneOffset.y/relScale*scale)+.5,Math.floor(
cropWidth/relScale*scale)+1.5,Math.floor(cropHeight/relScale*scale)+1.5)}return true});
this.afterDraw(canvasContext)}};TilesSection.prototype.scalePosForZoom=function(pos,toZoom,fromZoom
){var docLayer=this.sectionProperties.docLayer;var convScale=this.map.getZoomScale(toZoom,fromZoom);
if(docLayer.sheetGeometry){var toScale=convScale*TileManager.tileSize*15/app.tile.size.x;
toScale=TileManager.tileSize*15/Math.round(15*TileManager.tileSize/toScale);
var posScaled=docLayer.sheetGeometry.getCorePixelsAtZoom(pos,toScale);return posScaled}
return pos.multiplyBy(convScale)};TilesSection.prototype.scaleBoundsForZoom=function(corePxBounds,
toZoom,fromZoom){var docLayer=this.sectionProperties.docLayer;var convScale=this.map.getZoomScale(
toZoom,fromZoom);if(docLayer.sheetGeometry){var topLeft=this.scalePosForZoom(corePxBounds.min,toZoom
,fromZoom);var size=corePxBounds.getSize().multiplyBy(convScale);return new cool.Bounds(topLeft,
topLeft.add(size))}return new cool.Bounds(corePxBounds.min.multiplyBy(convScale),
corePxBounds.max.multiplyBy(convScale))};return TilesSection}(CanvasSectionObject);
cool.TilesSection=TilesSection})(cool||(cool={}));var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
app.definitions.AutoFillMarkerSection=function(_super){__extends(AutoFillMarkerSection,_super);
function AutoFillMarkerSection(){var _this=_super.call(this,app.CSections.AutoFillMarker.name)||this
_this.processingOrder=app.CSections.AutoFillMarker.processingOrder;
_this.drawingOrder=app.CSections.AutoFillMarker.drawingOrder;
_this.zIndex=app.CSections.AutoFillMarker.zIndex;_this.cursorBorderWidth=2;
_this.selectionBorderWidth=1;_this._showSection=true;_this.documentObject=true;
_this.map=window.L.Map.THIS;_this.sectionProperties.docLayer=_this.map._docLayer;
_this.sectionProperties.selectedAreaPoint=null;_this.sectionProperties.cellCursorPoint=null;
_this.sectionProperties.inMouseDown=false;_this.sectionProperties.draggingStarted=false;
_this.sectionProperties.dragStartPosition=null;
_this.sectionProperties.mapPane=document.querySelectorAll(".leaflet-map-pane")[0];
var cursorStyle=getComputedStyle(_this.sectionProperties.docLayer._cursorDataDiv);
var selectionStyle=getComputedStyle(_this.sectionProperties.docLayer._selectionsDataDiv);
var cursorColor=cursorStyle.getPropertyValue("border-top-color");
_this.backgroundColor=cursorColor?cursorColor:_this.backgroundColor;
_this.cursorBorderWidth=Math.round(window.devicePixelRatio*parseInt(cursorStyle.getPropertyValue(
"border-top-width")));_this.selectionBorderWidth=Math.round(window.devicePixelRatio*parseInt(
selectionStyle.getPropertyValue("border-top-width")));return _this}
AutoFillMarkerSection.prototype.onInitialize=function(){if(window.mode.isDesktop()){this.size=[
Math.round(6*app.dpiScale),Math.round(6*app.dpiScale)]}else{this.size=[Math.round(16*app.dpiScale),
Math.round(16*app.dpiScale)]}app.events.on("updatepermission",this.showHideOnPermissionChange.bind(
this))};AutoFillMarkerSection.prototype.setMarkerPosition=function(){var center=0;if(
!window.mode.isDesktop()){center=app.calc.cellCursorRectangle.pWidth*.5}var position=[0,0];
this.setShowSection(true);if(this.sectionProperties.selectedAreaPoint!==null)position=[
this.sectionProperties.selectedAreaPoint[0]-center,this.sectionProperties.selectedAreaPoint[1]
];else if(this.sectionProperties.cellCursorPoint!==null)position=[
this.sectionProperties.cellCursorPoint[0]-center,this.sectionProperties.cellCursorPoint[1]
];else this.setShowSection(false);this.setPosition(position[0],position[1])};
AutoFillMarkerSection.prototype.calculatePositionFromPoint=function(point){var calcPoint;if(
point===null){calcPoint=null}else{var translation=[Math.floor(this.size[0]*.5),Math.floor(this.size[
1]*.5)];calcPoint=[point[0]-translation[0],point[1]-translation[1]]}return calcPoint};
AutoFillMarkerSection.prototype.calculatePositionViaCellSelection=function(point){
this.sectionProperties.selectedAreaPoint=this.calculatePositionFromPoint(point);
this.setMarkerPosition()};AutoFillMarkerSection.prototype.calculatePositionViaCellCursor=function(
point){this.sectionProperties.cellCursorPoint=this.calculatePositionFromPoint(point);
this.setMarkerPosition()};AutoFillMarkerSection.prototype.drawWhiteOuterBorders=function(){
var _this=this;this.context.strokeStyle="white";this.context.lineCap="square";
this.context.lineWidth=1;var desktop=window.mode.isDesktop();var translation=desktop?[this.size[0],
this.size[1]]:[Math.floor(this.size[0]*.5),Math.floor(this.size[1]*.5)];
var adjustForRTL=app.map._docLayer.isCalcRTL();var transformX=function(xcoord){
return adjustForRTL?_this.size[0]-xcoord:xcoord};this.context.beginPath();this.context.moveTo(
transformX(-.5),-.5);
var borderWidth=this.sectionProperties.selectedAreaPoint?this.selectionBorderWidth:this.cursorBorderWidth
this.context.lineTo(transformX(this.size[0]+.5-(desktop?borderWidth:0)),-.5);this.context.stroke();
if(!desktop){this.context.beginPath();this.context.moveTo(transformX(this.size[0]-.5),-.5);
this.context.lineTo(transformX(this.size[0]-.5),translation[1]-.5-borderWidth);this.context.stroke()
}this.context.beginPath();this.context.moveTo(transformX(-.5),-.5);this.context.lineTo(transformX(
-.5),translation[1]+.5-borderWidth);this.context.stroke()};
AutoFillMarkerSection.prototype.showHideOnPermissionChange=function(){this.setShowSection(null)};
AutoFillMarkerSection.prototype.setShowSection=function(show){if(show!==null)this._showSection=show;
if(app.map._permission==="readonly"){_super.prototype.setShowSection.call(this,false)}else{
_super.prototype.setShowSection.call(this,this._showSection)}};
AutoFillMarkerSection.prototype.onDraw=function(){this.drawWhiteOuterBorders()};
AutoFillMarkerSection.prototype.onMouseMove=function(point,dragDistance,e){if(window.mode.isDesktop(
))return;if(dragDistance===null||!this.sectionProperties.docLayer._cellAutoFillAreaPixels)return;
var pos;if(!this.sectionProperties.draggingStarted){this.sectionProperties.draggingStarted=true;
this.sectionProperties.dragStartPosition=this.sectionProperties.docLayer._cellAutoFillAreaPixels.getCenter(
);pos=new cool.Point(this.sectionProperties.dragStartPosition[0],
this.sectionProperties.dragStartPosition[1]);pos=this.sectionProperties.docLayer._corePixelsToTwips(
pos);this.sectionProperties.docLayer._postMouseEvent("buttondown",pos.x,pos.y,1,1,0)}
point.pX=this.sectionProperties.dragStartPosition[0]+dragDistance[0];
point.pY=this.sectionProperties.dragStartPosition[1]+dragDistance[1];
this.sectionProperties.docLayer._postMouseEvent("move",point.x,point.y,1,1,0);
this.map.scrollingIsHandled=true;this.stopPropagating();e.stopPropagation()};
AutoFillMarkerSection.prototype.onMouseUp=function(point,e){if(
this.sectionProperties.draggingStarted){this.sectionProperties.draggingStarted=false;
point.pX+=this.myTopLeft[0]+this.size[0]*.5;point.pY+=this.myTopLeft[1]+this.size[1]*.5;
this.sectionProperties.docLayer._postMouseEvent("buttonup",point.x,point.y,1,1,0)}
this.map.scrollingIsHandled=false;this.stopPropagating();e.stopPropagation();
window.IgnorePanning=false};AutoFillMarkerSection.prototype.onMouseDown=function(point,e){if(
window.mode.isDesktop()){if(this.sectionProperties.inMouseDown)return;
this.sectionProperties.inMouseDown=true;
var canvasClientRect=this.containerObject.getCanvasBoundingClientRect();point.pX=(this.myTopLeft[0
]+this.size[0]*.5+1)/app.dpiScale+canvasClientRect.left;point.pY=(this.myTopLeft[1]+this.size[1
]*.5+1)/app.dpiScale+canvasClientRect.top;var newPoint={clientX:point.pX,clientY:point.pY};
var newEvent=this.sectionProperties.docLayer._createNewMouseEvent("mousedown",newPoint);
this.sectionProperties.mapPane.dispatchEvent(newEvent)}this.stopPropagating();e.stopPropagation();
window.IgnorePanning=true;this.sectionProperties.inMouseDown=false};
AutoFillMarkerSection.prototype.onMouseEnter=function(){var grid=document.querySelector(
".leaflet-map-pane");grid.classList.remove("spreadsheet-cursor");grid.style.cursor="crosshair"};
AutoFillMarkerSection.prototype.onMouseLeave=function(){var grid=document.querySelector(
".leaflet-map-pane");grid.classList.add("spreadsheet-cursor")};
AutoFillMarkerSection.prototype.onNewDocumentTopLeft=function(){this.setMarkerPosition()};
AutoFillMarkerSection.prototype.onDoubleClick=function(point,e){
this.sectionProperties.dragStartPosition=this.sectionProperties.docLayer._cellAutoFillAreaPixels.getCenter(
);var pos=new cool.Point(this.sectionProperties.dragStartPosition[0],
this.sectionProperties.dragStartPosition[1]);pos=this.sectionProperties.docLayer._corePixelsToTwips(
pos);this.sectionProperties.docLayer._postMouseEvent("buttondown",pos.x,pos.y,2,1,0);
this.stopPropagating();e.stopPropagation()};return AutoFillMarkerSection}(CanvasSectionObject);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var FocusCellSection=function(_super){__extends(
FocusCellSection,_super);function FocusCellSection(){var _this=_super.call(this,
app.CSections.FocusCell.name)||this;_this.processingOrder=app.CSections.FocusCell.processingOrder;
_this.drawingOrder=app.CSections.FocusCell.drawingOrder;_this.zIndex=app.CSections.FocusCell.zIndex;
_this.documentObject=true;_this.interactable=false;_this.sectionProperties.columnRectangle=null;
_this.sectionProperties.rowRectangle=null;_this.sectionProperties.maxCol=268435455;
_this.sectionProperties.maxRow=20971124;return _this}
FocusCellSection.prototype.onCellAddressChanged=function(){this.size[0
]=app.calc.cellCursorRectangle.pWidth;this.size[1]=app.calc.cellCursorRectangle.pHeight;
this.setPosition(app.calc.cellCursorRectangle.pX1,app.calc.cellCursorRectangle.pY1)};
FocusCellSection.addFocusCellSection=function(){if(FocusCellSection.instance===null){
FocusCellSection.instance=new FocusCellSection;app.sectionContainer.addSection(
FocusCellSection.instance)}if(!this.instance.showSection)this.instance.setShowSection(true);
this.instance.onCellAddressChanged()};FocusCellSection.hideFocusCellSection=function(){if(
FocusCellSection.instance)FocusCellSection.instance.setShowSection(false)};
FocusCellSection.showFocusCellSection=function(){if(FocusCellSection.instance
)FocusCellSection.instance.setShowSection(true);else{this.addFocusCellSection()}};
FocusCellSection.prototype.onDraw=function(){var style=getComputedStyle(document.documentElement
).getPropertyValue("--column-row-highlight");this.context.fillStyle=style;
this.context.strokeStyle=style;this.context.globalAlpha=.3;this.context.fillRect(0,-this.position[1]
,app.calc.cellCursorRectangle.pWidth,this.sectionProperties.maxCol);this.context.fillRect(
-this.position[0],0,this.sectionProperties.maxRow,app.calc.cellCursorRectangle.pHeight);
this.context.globalAlpha=1;this.context.lineWidth=2*app.dpiScale;this.context.strokeRect(0,
-this.position[1],app.calc.cellCursorRectangle.pWidth,this.sectionProperties.maxCol);
this.context.strokeRect(-this.position[0],0,this.sectionProperties.maxRow,
app.calc.cellCursorRectangle.pHeight)};FocusCellSection.instance=null;return FocusCellSection}(
CanvasSectionObject);var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var URLPopUpSection=function(_super){__extends(URLPopUpSection,
_super);function URLPopUpSection(url,documentPosition,linkPosition,linkIsClientSide){if(
linkIsClientSide===void 0){linkIsClientSide=false}var _this=_super.call(this,
URLPopUpSection.sectionName,null,null,documentPosition,URLPopUpSection.cssClass)||this;
_this.containerId="hyperlink-pop-up-preview";_this.linkId="hyperlink-pop-up";
_this.copyButtonId="hyperlink-pop-up-copy";_this.editButtonId="hyperlink-pop-up-edit";
_this.removeButtonId="hyperlink-pop-up-remove";var objectDiv=_this.getHTMLObject();objectDiv.remove(
);document.getElementById("document-container").appendChild(objectDiv);
_this.sectionProperties.url=url;_this.sectionProperties.linkIsClientSide=linkIsClientSide;
_this.createUIElements(url);_this.setUpCallbacks(linkPosition);document.getElementById(
"hyperlink-pop-up").title=url;if(app.map["wopi"].EnableRemoteLinkPicker)app.map.fire("postMessage",{
msgId:"Action_GetLinkPreview",args:{url:url}});
_this.sectionProperties.documentPosition=documentPosition.clone();return _this}
URLPopUpSection.prototype.getPopUpWidth=function(){return this.getHTMLObject(
).getBoundingClientRect().width};URLPopUpSection.prototype.getPopUpHeight=function(){
return this.getHTMLObject().getBoundingClientRect().height};
URLPopUpSection.prototype.getPopUpBoundingRectangle=function(){return this.getHTMLObject(
).getBoundingClientRect()};URLPopUpSection.prototype.createUIElements=function(url){
var parent=this.getHTMLObject();window.L.DomUtil.createWithId("div",this.containerId,parent);
var link=window.L.DomUtil.createWithId("a",this.linkId,parent);link.innerText=url;
var copyLinkText=_("Copy link location");var copyBtn=window.L.DomUtil.createWithId("div",
this.copyButtonId,parent);window.L.DomUtil.addClass(copyBtn,"hyperlink-popup-btn");
copyBtn.setAttribute("title",copyLinkText);copyBtn.setAttribute("role","button");
copyBtn.setAttribute("aria-label",copyLinkText);var imgCopyBtn=window.L.DomUtil.create("img",
"hyperlink-pop-up-copyimg",copyBtn);app.LOUtil.setImage(imgCopyBtn,"lc_copyhyperlinklocation.svg",
app.map);imgCopyBtn.setAttribute("width",18);imgCopyBtn.setAttribute("height",18);
imgCopyBtn.setAttribute("alt",copyLinkText);imgCopyBtn.style.padding="4px";var editLinkText=_(
"Edit link");var editBtn=window.L.DomUtil.createWithId("div",this.editButtonId,parent);
window.L.DomUtil.addClass(editBtn,"hyperlink-popup-btn");editBtn.setAttribute("title",editLinkText);
editBtn.setAttribute("role","button");editBtn.setAttribute("aria-label",copyLinkText);
var imgEditBtn=window.L.DomUtil.create("img","hyperlink-pop-up-editimg",editBtn);
app.LOUtil.setImage(imgEditBtn,"lc_edithyperlink.svg",app.map);imgEditBtn.setAttribute("width",18);
imgEditBtn.setAttribute("height",18);imgEditBtn.setAttribute("alt",editLinkText);
imgEditBtn.style.padding="4px";var removeLinkText=_("Remove link");
var removeBtn=window.L.DomUtil.createWithId("div",this.removeButtonId,parent);
window.L.DomUtil.addClass(removeBtn,"hyperlink-popup-btn");removeBtn.setAttribute("title",
removeLinkText);removeBtn.setAttribute("role","button");removeBtn.setAttribute("aria-label",
removeLinkText);var imgRemoveBtn=window.L.DomUtil.create("img","hyperlink-pop-up-removeimg",
removeBtn);app.LOUtil.setImage(imgRemoveBtn,"lc_removehyperlink.svg",app.map);
imgRemoveBtn.setAttribute("width",18);imgRemoveBtn.setAttribute("height",18);
imgRemoveBtn.setAttribute("alt",removeLinkText);imgRemoveBtn.style.padding="4px";
this.arrowDiv=document.createElement("div");this.arrowDiv.className="arrow-div";parent.appendChild(
this.arrowDiv)};URLPopUpSection.prototype.setUpCallbacks=function(linkPosition){var _this=this;
document.getElementById(this.linkId).onclick=function(){if(!_this.sectionProperties.url.startsWith(
"#"))app.map.fire("warn",{url:_this.sectionProperties.url,map:app.map,cmd:"openlink"}
);else app.map.sendUnoCommand(".uno:JumpToMark?Bookmark:string="+encodeURIComponent(
_this.sectionProperties.url.substring(1)))};var params;if(linkPosition){params={PositionX:{
type:"long",value:linkPosition.x},PositionY:{type:"long",value:linkPosition.y}}}
document.getElementById(this.copyButtonId).onclick=function(){if(
_this.sectionProperties.linkIsClientSide){app.map._clip.setTextSelectionText(
_this.sectionProperties.url);app.map._clip._execCopyCutPaste("copy")}else if(
window.L.Browser.clipboardApiAvailable||window.ThisIsTheiOSApp)app.map._clip.filterExecCopyPaste(
".uno:CopyHyperlinkLocation",params);else app.map.sendUnoCommand(".uno:CopyHyperlinkLocation",params
)};document.getElementById(this.editButtonId).onclick=function(){if(
!_this.sectionProperties.linkIsClientSide)app.map.sendUnoCommand(".uno:EditHyperlink",params)};
document.getElementById(this.removeButtonId).onclick=function(){if(
!_this.sectionProperties.linkIsClientSide)app.map.sendUnoCommand(".uno:RemoveHyperlink",params);
URLPopUpSection.closeURLPopUp()}};URLPopUpSection.prototype.reLocateArrow=function(arrowAtTop){if(
arrowAtTop)this.arrowDiv.classList.add("reverse");else this.arrowDiv.classList.remove("reverse");
var clientRect=this.getPopUpBoundingRectangle();
var arrowCSSLeft=this.sectionProperties.documentPosition.pX-app.activeDocument.activeView.viewedRectangle.pX1+this.containerObject.getDocumentAnchor(
)[0]-URLPopUpSection.arrowHalfWidth;arrowCSSLeft/=app.dpiScale;
arrowCSSLeft+=document.getElementById("canvas-container").getBoundingClientRect().left;
arrowCSSLeft-=clientRect.left;this.arrowDiv.style.left=(
arrowCSSLeft>URLPopUpSection.horizontalPadding?arrowCSSLeft:URLPopUpSection.horizontalPadding)+"px"}
URLPopUpSection.resetPosition=function(section){if(!section
)section=app.sectionContainer.getSectionWithName(URLPopUpSection.sectionName);if(!section)return;
var originalLeft=section.sectionProperties.documentPosition.pX-section.getPopUpWidth(
)*.5*app.dpiScale;var originalTop=section.sectionProperties.documentPosition.pY-(
section.getPopUpHeight()+URLPopUpSection.popupVerticalMargin)*app.dpiScale;
var checkLeft=originalLeft-app.activeDocument.activeView.viewedRectangle.pX1;
var checkTop=originalTop-app.activeDocument.activeView.viewedRectangle.pY1;var arrowAtTop=false;if(
checkTop<0){
originalTop=section.sectionProperties.documentPosition.pY+URLPopUpSection.popupVerticalMargin*2*app.dpiScale
arrowAtTop=true}if(checkLeft<0)originalLeft=app.activeDocument.activeView.viewedRectangle.pX1;
section.setPosition(originalLeft,originalTop);section.adjustHTMLObjectPosition();
section.reLocateArrow(arrowAtTop);section.containerObject.requestReDraw()};
URLPopUpSection.showURLPopUP=function(url,documentPosition,linkPosition,linkIsClientSide){if(
URLPopUpSection.isOpen())URLPopUpSection.closeURLPopUp();var section=new URLPopUpSection(url,
documentPosition,linkPosition,linkIsClientSide);app.sectionContainer.addSection(section);
this.resetPosition(section)};URLPopUpSection.closeURLPopUp=function(){if(URLPopUpSection.isOpen()
)app.sectionContainer.removeSection(URLPopUpSection.sectionName)};URLPopUpSection.isOpen=function(){
return app.sectionContainer.doesSectionExist(URLPopUpSection.sectionName)};
URLPopUpSection.sectionName="URL PopUp";URLPopUpSection.cssClass="hyperlink-pop-up-container";
URLPopUpSection.arrowHalfWidth=10;URLPopUpSection.horizontalPadding=6;
URLPopUpSection.popupVerticalMargin=20;return URLPopUpSection}(HTMLObjectSection);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var sectionName="TileInvalidationRectangle";
var InvalidationRectangleSection=function(_super){__extends(InvalidationRectangleSection,_super);
function InvalidationRectangleSection(){var _this=_super.call(this,sectionName)||this;
_this.windowSection=true;_this.showSection=true;
_this.zIndex=app.CSections.DefaultForDocumentObjects.zIndex;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.interactable=false;_this.sectionProperties.rectangleList=[];return _this}
InvalidationRectangleSection.prototype.addRectangle=function(x,y,width,height){
var rectangleList=this.sectionProperties.rectangleList;if(rectangleList.length===5
)rectangleList.pop();rectangleList.unshift([x,y,width,height])};
InvalidationRectangleSection.prototype.onDraw=function(frameCount,elapsedTime,subsetBounds){
var rectangleList=this.sectionProperties.rectangleList;this.context.strokeStyle="red";
var anchor=this.containerObject.getDocumentAnchor();var xDiff=anchor[0
]-app.activeDocument.activeView.viewedRectangle.pX1;var yDiff=anchor[1
]-app.activeDocument.activeView.viewedRectangle.pY1;for(var i=0;i<rectangleList.length;i++){
this.context.globalAlpha=1-.15*i;this.context.strokeRect(xDiff+rectangleList[i][0],
yDiff+rectangleList[i][1],rectangleList[i][2],rectangleList[i][3])}this.context.globalAlpha=1};
InvalidationRectangleSection.prototype.checkDeletion=function(){var _this=this;if(
this.sectionProperties.rectangleList.length>0){this.sectionProperties.rectangleList.pop();
setTimeout(function(){_this.checkDeletion()},1e3)}else{app.sectionContainer.removeSection(this.name)
}};InvalidationRectangleSection.getSection=function(){var section;if(
app.sectionContainer.doesSectionExist(sectionName))section=app.sectionContainer.getSectionWithName(
sectionName);else{section=new InvalidationRectangleSection;app.sectionContainer.addSection(section);
setTimeout(function(){section.checkDeletion()},2e3)}return section};
InvalidationRectangleSection.setRectangle=function(x,y,width,height){var section=this.getSection();
section.addRectangle(x,y,width,height)};return InvalidationRectangleSection}(CanvasSectionObject);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __read=this&&this.__read||function(o,n){
var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{
while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}
}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar};
var __spreadArray=this&&this.__spreadArray||function(to,from,pack){if(pack||arguments.length===2
)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar)ar=Array.prototype.slice.call(
from,0,i);ar[i]=from[i]}}return to.concat(ar||Array.prototype.slice.call(from))};
var HelperLineStyles=function(){function HelperLineStyles(){}HelperLineStyles.addListener=function(
){app.map.on("darkmodechanged",function(){this.gridSolidStyle=null;this.gridDashedStyle=null;
this.smartGuidesStyle=null}.bind(this));this.darkModeListenerAdded=true};
HelperLineStyles.initiate=function(){if(!this.darkModeListenerAdded)this.addListener();
var tempElement=document.createElement("div");tempElement.style.display="none";
document.body.appendChild(tempElement);tempElement.style.color="var(--color-grid-helper-line-solid)"
var computedStyle=window.getComputedStyle(tempElement);this.gridSolidStyle=computedStyle.color;
tempElement.style.color="var(--color-grid-helper-line-dashed)";
computedStyle=window.getComputedStyle(tempElement);this.gridDashedStyle=computedStyle.color;
tempElement.style.color="var(--color-smart-guides-helper-line)";
computedStyle=window.getComputedStyle(tempElement);this.smartGuidesStyle=computedStyle.color;
tempElement.remove()};HelperLineStyles.gridSolidStyle=null;HelperLineStyles.gridDashedStyle=null;
HelperLineStyles.smartGuidesStyle=null;HelperLineStyles.darkModeListenerAdded=false;
return HelperLineStyles}();var ShapeHandlesSection=function(_super){__extends(ShapeHandlesSection,
_super);function ShapeHandlesSection(info){var _this=_super.call(this,"shapeHandlesSection")||this;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder;
_this.zIndex=app.CSections.DefaultForDocumentObjects.zIndex;_this.documentObject=true;
_this.showSection=false;_this.sectionProperties.info=null;_this.sectionProperties.handles=[];
_this.sectionProperties.subSections=[];_this.sectionProperties.activeHandleIndex=null;
_this.sectionProperties.mouseIsInside=false;_this.sectionProperties.handleWidth=12*app.dpiScale;
_this.sectionProperties.handleHeight=12*app.dpiScale;
_this.sectionProperties.anchorWidth=20*app.dpiScale;
_this.sectionProperties.anchorHeight=20*app.dpiScale;
_this.sectionProperties.rotationHandleWidth=15*app.dpiScale;
_this.sectionProperties.rotationHandleHeight=15*app.dpiScale;
_this.sectionProperties.gluePointRadius=10*app.dpiScale;
_this.sectionProperties.subSectionPrefix="shape-handle-";
_this.sectionProperties.previousCursorStyle=null;_this.sectionProperties.svg=null;
_this.sectionProperties.hasVideo=false;_this.sectionProperties.shapeRectangleProperties=null;
_this.sectionProperties.lastDragDistance=[0,0];_this.sectionProperties.pickedIndexX=0;
_this.sectionProperties.pickedIndexY=0;_this.sectionProperties.mathObjectBorderColor="red";
_this.sectionProperties.closestX=null;_this.sectionProperties.closestY=null;_this.refreshInfo(info);
if(HelperLineStyles.gridDashedStyle===null)HelperLineStyles.initiate();return _this}
ShapeHandlesSection.prototype.refreshInfo=function(info){var _a;this.sectionProperties.info=info;
this.convertToTileTwipsIfNeeded();this.getHandles();this.updateSize();if(((
_a=GraphicSelection===null||GraphicSelection===void 0?void 0:GraphicSelection.extraInfo
)===null||_a===void 0?void 0:_a.isMathObject)===true){
this.borderColor=this.sectionProperties.mathObjectBorderColor}else{this.addSubSections();
this.sectionProperties.shapeRectangleProperties=this.getShapeRectangleProperties();
this.calculateInitialAnglesOfShapeHandlers();this.borderColor=null}};
ShapeHandlesSection.prototype.convertToTileTwipsIfNeeded=function(){var _a,_b,_c;if(
app.map._docLayer._docType==="spreadsheet"&&((_c=(_b=(_a=this.sectionProperties.info
)===null||_a===void 0?void 0:_a.handles)===null||_b===void 0?void 0:_b.kinds
)===null||_c===void 0?void 0:_c.rectangle)){var kindList=["1","2","3","4","5","6","7","8","16","22",
"9"];for(var i=0;i<kindList.length;i++){if(this.sectionProperties.info.handles.kinds.rectangle[
kindList[i]]){var point=new cool.SimplePoint(parseInt(
this.sectionProperties.info.handles.kinds.rectangle[kindList[i]][0].point.x),parseInt(
this.sectionProperties.info.handles.kinds.rectangle[kindList[i]][0].point.y));
app.map._docLayer.sheetGeometry.convertToTileTwips(point);
this.sectionProperties.info.handles.kinds.rectangle[kindList[i]][0].point.x=point.x;
this.sectionProperties.info.handles.kinds.rectangle[kindList[i]][0].point.y=point.y}}}};
ShapeHandlesSection.prototype.calculateInitialAnglesOfShapeHandlers=function(shapeRecProps){var _a,
_b,_c;if((_c=(_b=(_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.rectangle){if(!shapeRecProps
)shapeRecProps=this.sectionProperties.shapeRectangleProperties;var halfDiagonal=Math.pow(Math.pow(
shapeRecProps.width*.5,2)+Math.pow(shapeRecProps.height*.5,2),.5);for(
var i=0;i<this.sectionProperties.subSections.length;i++){
var subSection=this.sectionProperties.subSections[i];if(
subSection.sectionProperties.ownInfo.kind==="1"){
subSection.sectionProperties.distanceToCenter=halfDiagonal;
subSection.sectionProperties.initialAngle=Math.atan2(shapeRecProps.height*.5,-shapeRecProps.width*.5
)}else if(subSection.sectionProperties.ownInfo.kind==="2"){
subSection.sectionProperties.distanceToCenter=shapeRecProps.height*.5;
subSection.sectionProperties.initialAngle=Math.atan2(shapeRecProps.height*.5,0)}else if(
subSection.sectionProperties.ownInfo.kind==="3"){
subSection.sectionProperties.distanceToCenter=halfDiagonal;
subSection.sectionProperties.initialAngle=Math.atan2(shapeRecProps.height*.5,shapeRecProps.width*.5)
}else if(subSection.sectionProperties.ownInfo.kind==="4"){
subSection.sectionProperties.distanceToCenter=shapeRecProps.width*.5;
subSection.sectionProperties.initialAngle=Math.atan2(0,-shapeRecProps.width*.5)}else if(
subSection.sectionProperties.ownInfo.kind==="5"){
subSection.sectionProperties.distanceToCenter=shapeRecProps.width*.5;
subSection.sectionProperties.initialAngle=Math.atan2(0,shapeRecProps.width*.5)}else if(
subSection.sectionProperties.ownInfo.kind==="6"){
subSection.sectionProperties.distanceToCenter=halfDiagonal;
subSection.sectionProperties.initialAngle=Math.atan2(-shapeRecProps.height*.5,
-shapeRecProps.width*.5)}else if(subSection.sectionProperties.ownInfo.kind==="7"){
subSection.sectionProperties.distanceToCenter=shapeRecProps.height*.5;
subSection.sectionProperties.initialAngle=Math.atan2(-shapeRecProps.height*.5,0)}else if(
subSection.sectionProperties.ownInfo.kind==="8"){
subSection.sectionProperties.distanceToCenter=halfDiagonal;
subSection.sectionProperties.initialAngle=Math.atan2(-shapeRecProps.height*.5,shapeRecProps.width*.5
)}}}};ShapeHandlesSection.moveHTMLObjectToMapElement=function(htmlObjectSection){
htmlObjectSection.getHTMLObject().remove();document.getElementById("map").appendChild(
htmlObjectSection.getHTMLObject())};
ShapeHandlesSection.mirrorEventsFromSourceToCanvasSectionContainer=function(sourceElement){
sourceElement.addEventListener("mousedown",function(e){app.sectionContainer.onMouseDown(e);
e.stopPropagation()},true);sourceElement.addEventListener("click",function(e){
app.sectionContainer.onClick(e);e.stopPropagation()},true);sourceElement.addEventListener("dblclick"
,function(e){app.sectionContainer.onDoubleClick(e);e.stopPropagation()},true);
sourceElement.addEventListener("contextmenu",function(e){app.sectionContainer.onContextMenu(e);
e.stopPropagation()},true);sourceElement.addEventListener("wheel",function(e){
app.sectionContainer.onMouseWheel(e);e.stopPropagation()},true);sourceElement.addEventListener(
"mouseleave",function(e){app.sectionContainer.onMouseLeave(e);e.stopPropagation()},true);
sourceElement.addEventListener("mouseenter",function(e){app.sectionContainer.onMouseEnter(e);
e.stopPropagation()},true);sourceElement.addEventListener("touchstart",function(e){
app.sectionContainer.onTouchStart(e);e.stopPropagation()},true);sourceElement.addEventListener(
"touchmove",function(e){app.sectionContainer.onTouchMove(e);e.stopPropagation()},true);
sourceElement.addEventListener("touchend",function(e){app.sectionContainer.onTouchEnd(e);
e.stopPropagation()},true);sourceElement.addEventListener("touchcancel",function(e){
app.sectionContainer.onTouchCancel(e);e.stopPropagation()},true)};
ShapeHandlesSection.prototype.getShapeWidth=function(twips){if(twips===void 0){twips=true}
var middleLeft=this.sectionProperties.info.handles.kinds.rectangle["4"][0];
middleLeft=new cool.SimplePoint(parseInt(middleLeft.point.x),parseInt(middleLeft.point.y));
var middleRight=this.sectionProperties.info.handles.kinds.rectangle["5"][0];
middleRight=new cool.SimplePoint(parseInt(middleRight.point.x),parseInt(middleRight.point.y));if(
twips)return Math.abs(middleLeft.distanceTo(middleRight.toArray()));else return Math.abs(
middleLeft.pDistanceTo(middleRight.pToArray()))};
ShapeHandlesSection.prototype.getShapeHeight=function(twips){if(twips===void 0){twips=true}
var topMiddle=this.sectionProperties.info.handles.kinds.rectangle["2"][0];
topMiddle=new cool.SimplePoint(parseInt(topMiddle.point.x),parseInt(topMiddle.point.y));
var bottomMiddle=this.sectionProperties.info.handles.kinds.rectangle["7"][0];
bottomMiddle=new cool.SimplePoint(parseInt(bottomMiddle.point.x),parseInt(bottomMiddle.point.y));if(
twips)return Math.abs(topMiddle.distanceTo(bottomMiddle.toArray()));else return Math.abs(
topMiddle.pDistanceTo(bottomMiddle.pToArray()))};
ShapeHandlesSection.prototype.getShapeAngleRadians=function(){
var topMiddle=this.sectionProperties.info.handles.kinds.rectangle["2"][0];
topMiddle=new cool.SimplePoint(parseInt(topMiddle.point.x),parseInt(topMiddle.point.y));
var center=this.getShapeCenter();var radians=Math.atan2(center[1]-topMiddle.y,topMiddle.x-center[0])
return radians-Math.PI*.5};ShapeHandlesSection.prototype.getShapeCenter=function(twips){if(
twips===void 0){twips=true}var topLeft=this.sectionProperties.info.handles.kinds.rectangle["1"][0];
topLeft=new cool.SimplePoint(parseInt(topLeft.point.x),parseInt(topLeft.point.y));
var bottomRight=this.sectionProperties.info.handles.kinds.rectangle["8"][0];
bottomRight=new cool.SimplePoint(parseInt(bottomRight.point.x),parseInt(bottomRight.point.y));if(
twips)return[Math.round((topLeft.x+bottomRight.x)/2),Math.round((topLeft.y+bottomRight.y)/2)
];else return[Math.round((topLeft.pX+bottomRight.pX)/2),Math.round((topLeft.pY+bottomRight.pY)/2)]};
ShapeHandlesSection.prototype.getShapeRectangleProperties=function(){var _a,_b;if(!((_b=(
_a=this.sectionProperties.info.handles)===null||_a===void 0?void 0:_a.kinds
)===null||_b===void 0?void 0:_b.rectangle))return null;return{angleRadian:this.getShapeAngleRadians(
),center:this.getShapeCenter(false),height:this.getShapeHeight(false),width:this.getShapeWidth(false
)}};ShapeHandlesSection.prototype.getScalingHandles=function(halfWidth,halfHeight){var _a,_b,_c;if((
_c=(_b=(_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.rectangle){
var topLeft=this.sectionProperties.info.handles.kinds.rectangle["1"][0];
var topMiddle=this.sectionProperties.info.handles.kinds.rectangle["2"][0];
var topRight=this.sectionProperties.info.handles.kinds.rectangle["3"][0];
var middleLeft=this.sectionProperties.info.handles.kinds.rectangle["4"][0];
var middleRight=this.sectionProperties.info.handles.kinds.rectangle["5"][0];
var bottomLeft=this.sectionProperties.info.handles.kinds.rectangle["6"][0];
var bottomMiddle=this.sectionProperties.info.handles.kinds.rectangle["7"][0];
var bottomRight=this.sectionProperties.info.handles.kinds.rectangle["8"][0];
this.sectionProperties.handles.push({info:topLeft,point:new cool.SimplePoint(
topLeft.point.x-halfWidth,topLeft.point.y-halfHeight)});this.sectionProperties.handles.push({
info:topMiddle,point:new cool.SimplePoint(topMiddle.point.x-halfWidth,topMiddle.point.y-halfHeight)}
);this.sectionProperties.handles.push({info:topRight,point:new cool.SimplePoint(
topRight.point.x-halfWidth,topRight.point.y-halfHeight)});this.sectionProperties.handles.push({
info:middleLeft,point:new cool.SimplePoint(middleLeft.point.x-halfWidth,
middleLeft.point.y-halfHeight)});this.sectionProperties.handles.push({info:middleRight,
point:new cool.SimplePoint(middleRight.point.x-halfWidth,middleRight.point.y-halfHeight)});
this.sectionProperties.handles.push({info:bottomLeft,point:new cool.SimplePoint(
bottomLeft.point.x-halfWidth,bottomLeft.point.y-halfHeight)});this.sectionProperties.handles.push({
info:bottomMiddle,point:new cool.SimplePoint(bottomMiddle.point.x-halfWidth,
bottomMiddle.point.y-halfHeight)});this.sectionProperties.handles.push({info:bottomRight,
point:new cool.SimplePoint(bottomRight.point.x-halfWidth,bottomRight.point.y-halfHeight)})}};
ShapeHandlesSection.prototype.getAnchorHandle=function(halfWidth,halfHeight){var _a,_b,_c;if((_c=(
_b=(_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.anchor){
var anchor=this.sectionProperties.info.handles.kinds.anchor["16"][0];
this.sectionProperties.handles.push({info:anchor,point:new cool.SimplePoint(anchor.point.x-halfWidth
,anchor.point.y-halfHeight)})}};ShapeHandlesSection.prototype.getRotationInfo=function(){var _a,_b,
_c;if(!((_c=(_b=(_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.rectangle))return;
var coreAngle=GraphicSelection.selectionAngle;if(this.sectionProperties.svg
)coreAngle=this.sectionProperties.svg.innerHTML.includes('class="Group"')?0:coreAngle;if(
coreAngle!==undefined&&coreAngle!==null){coreAngle=coreAngle/100;coreAngle=coreAngle*Math.PI/180;
while(coreAngle>Math.PI*2)coreAngle-=Math.PI*2;while(coreAngle<0)coreAngle+=Math.PI*2
}else coreAngle=null;var result={kind:"ShapeRotationHandle",coreAngle:coreAngle};return result};
ShapeHandlesSection.prototype.getRotationHandlePosition=function(rotationInfo){var centerX=parseInt(
this.sectionProperties.info.handles.kinds.rectangle["2"][0].point.x
)*app.twipsToPixels-this.position[0];var centerY=parseInt(
this.sectionProperties.info.handles.kinds.rectangle["2"][0].point.y
)*app.twipsToPixels-this.position[1];var diff=30*app.dpiScale;var y=centerY-diff*Math.sin(
rotationInfo.coreAngle+Math.PI*.5);var x=centerX+diff*Math.cos(rotationInfo.coreAngle+Math.PI*.5);
x-=this.sectionProperties.rotationHandleWidth*.5;y-=this.sectionProperties.rotationHandleHeight*.5;
return new cool.SimplePoint((this.position[0]+x)*app.pixelsToTwips,(this.position[1]+y
)*app.pixelsToTwips)};ShapeHandlesSection.prototype.getRotationHandle=function(){var _a,_b,_c;if(((
_c=(_b=(_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.rectangle
)&&!this.sectionProperties.hasVideo){var rotationInfo=this.getRotationInfo();
var rotationHandlePosition=this.getRotationHandlePosition(rotationInfo);
rotationInfo.initialPosition=rotationHandlePosition.clone();this.sectionProperties.handles.push({
info:rotationInfo,point:rotationHandlePosition})}};
ShapeHandlesSection.prototype.getCustomHandles=function(halfWidth,halfHeight){var _a,_b,_c;if((_c=(
_b=(_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.custom){
var customHandleList=this.sectionProperties.info.handles.kinds.custom["22"];if(
customHandleList&&customHandleList.length>0){for(var i=0;i<customHandleList.length;i++){
var customHandler=customHandleList[i];this.sectionProperties.handles.push({info:customHandler,
point:new cool.SimplePoint(customHandler.point.x-halfWidth,customHandler.point.y-halfHeight)})}}}};
ShapeHandlesSection.prototype.getPolyHandles=function(halfWidth,halfHeight){var _a,_b,_c;if((_c=(
_b=(_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.handles
)===null||_b===void 0?void 0:_b.kinds)===null||_c===void 0?void 0:_c.poly){if(Array.isArray(
this.sectionProperties.info.handles.kinds.poly["9"])){
var polyArray=this.sectionProperties.info.handles.kinds.poly["9"];for(var i=0;i<polyArray.length;i++
){var poly=polyArray[i];this.sectionProperties.handles.push({info:poly,point:new cool.SimplePoint(
poly.point.x-halfWidth,poly.point.y-halfHeight)})}}}};
ShapeHandlesSection.prototype.getGluePoints=function(){var _a,_b;if((_b=(
_a=this.sectionProperties.info)===null||_a===void 0?void 0:_a.GluePoints
)===null||_b===void 0?void 0:_b.shapes){if(Array.isArray(
this.sectionProperties.info.GluePoints.shapes)){
var shapeArray=this.sectionProperties.info.GluePoints.shapes;for(var i=0;i<shapeArray.length;i++){
var shape=shapeArray[i];shape.kind="GluePoint";var glueArray=shape.gluepoints;for(
var j=0;j<glueArray.length;j++){var info=Object.assign({},shape);info.id=String(i)+String(j);
this.sectionProperties.handles.push({info:info,point:new cool.SimplePoint(glueArray[j].point.x,
glueArray[j].point.y)})}}}}};ShapeHandlesSection.prototype.getHandles=function(){
this.sectionProperties.handles=[];var halfWidth=app.pixelsToTwips*(
this.sectionProperties.handleWidth*.5);var halfHeight=app.pixelsToTwips*(
this.sectionProperties.handleHeight*.5);this.getScalingHandles(halfWidth,halfHeight);
this.getAnchorHandle(halfWidth,halfHeight);this.getRotationHandle();this.getCustomHandles(halfWidth,
halfHeight);this.getPolyHandles(halfWidth,halfHeight);this.getGluePoints()};
ShapeHandlesSection.prototype.updateSize=function(){this.size=[0,0];if(
GraphicSelection.hasActiveSelection())this.size=[GraphicSelection.rectangle.pWidth,
GraphicSelection.rectangle.pHeight]};ShapeHandlesSection.prototype.isSVGVisible=function(){if(
this.sectionProperties.svg)return this.sectionProperties.svg.style.display==="";else return false};
ShapeHandlesSection.prototype.removeSVG=function(){if(this.sectionProperties.svg
)this.sectionProperties.svg.remove()};
ShapeHandlesSection.prototype.addVideoSupportHandlers=function(videos){if(!videos)return;for(
var i=0;i<videos.length;i++){var video=videos[i];var sources=video.getElementsByTagName("source");
video.addEventListener("playing",function(){window.setTimeout(function(){if(
video.webkitDecodedFrameCount===0&&video.webkitAudioDecodedByteCount===0){
this.showUnsupportedMediaWarning()}}.bind(this),1e3)}.bind(this));video.addEventListener("error",
function(){this.showUnsupportedMediaWarning()}.bind(this));if(sources.length){sources[0
].addEventListener("error",function(error){this.showUnsupportedMediaWarning()}.bind(this))}}};
ShapeHandlesSection.prototype.showUnsupportedMediaWarning=function(){var videoWarning=_(
"Document contains unsupported media");window.L.Map.THIS.uiManager.showSnackbar(videoWarning)};
ShapeHandlesSection.prototype.addEmbeddedVideo=function(svgString){
this.sectionProperties.hasVideo=true;this.setSVG(svgString);this.sectionProperties.svg.remove();
document.getElementById("map").appendChild(this.sectionProperties.svg);
this.sectionProperties.svg.style.zIndex=11;if(!this.sectionProperties.svg.innerHTML.includes(
"foreignobject")){console.error("Failed to parse svg for embedded video");return}
var videoContainer=this.sectionProperties.svg;
var videos=this.sectionProperties.svg.getElementsByTagName("video");
var source=this.sectionProperties.svg.getElementsByTagName("source");source[0
].src=decodeURIComponent(source[0].src);this.addVideoSupportHandlers(videos)};
ShapeHandlesSection.prototype.removeTagFromHTML=function(data,startString,endString){
var startIndex=data.indexOf(startString);var endIndex=data.indexOf(endString,startIndex+1);while(
startIndex!==-1&&endIndex!==-1){var toRemove=data.substring(startIndex,endIndex+endString.length);
data=data.replace(toRemove,"");startIndex=data.indexOf(startString);endIndex=data.indexOf(endString,
startIndex+1)}return data};ShapeHandlesSection.prototype.getTagFromHTML=function(data,startString,
endString){var startIndex=data.indexOf(startString);var endIndex=data.indexOf(endString,startIndex+1
);if(startIndex!==-1&&endIndex!==-1){var pickedData=data.substring(startIndex,
endIndex+endString.length);return pickedData}else{return""}};
ShapeHandlesSection.prototype.setSVG=function(data){this.removeSVG();data=this.removeTagFromHTML(
data,' style="','"');this.sectionProperties.svg=document.createElement("svg");
document.getElementById("canvas-container").appendChild(this.sectionProperties.svg);
this.sectionProperties.svg.innerHTML=data;this.sectionProperties.svg.style.position="absolute";
this.sectionProperties.svg.children[0].style.width=this.sectionProperties.svg.children[0
].style.height="auto";this.sectionProperties.svg.children[0].style.transformOrigin="center";
this.sectionProperties.svg.children[0].setAttribute("preserveAspectRatio","none");
this.adjustSVGProperties()};ShapeHandlesSection.prototype.showSVG=function(){if(
this.sectionProperties.svg)this.sectionProperties.svg.style.display=""};
ShapeHandlesSection.prototype.hideSVG=function(){if(
this.sectionProperties.svg&&!this.sectionProperties.hasVideo
)this.sectionProperties.svg.style.display="none"};
ShapeHandlesSection.prototype.onSectionShowStatusChange=function(){for(
var i=0;i<this.sectionProperties.subSections.length;i++)this.sectionProperties.subSections[i
].setShowSection(this.showSection);if(this.showSection)this.showSVG();else this.hideSVG()};
ShapeHandlesSection.prototype.checkAnchorSubSection=function(handle){
var newSubSection=app.sectionContainer.getSectionWithName(
this.sectionProperties.subSectionPrefix+handle.info.id);if(!newSubSection){
newSubSection=new app.definitions.shapeHandleAnchorSubSection(this,
this.sectionProperties.subSectionPrefix+handle.info.id,[
this.sectionProperties.anchorWidth/app.dpiScale,this.sectionProperties.anchorHeight/app.dpiScale],
handle.point.clone(),handle.info);return newSubSection}else{
newSubSection.sectionProperties.ownInfo=handle.info;newSubSection.setPosition(handle.point.pX,
handle.point.pY);return null}};ShapeHandlesSection.prototype.checkScalingSubSection=function(handle
){var newSubSection=app.sectionContainer.getSectionWithName(
this.sectionProperties.subSectionPrefix+handle.info.id);if(!newSubSection){
newSubSection=new app.definitions.shapeHandleScalingSubSection(this,
this.sectionProperties.subSectionPrefix+handle.info.id,[this.sectionProperties.handleWidth,
this.sectionProperties.handleHeight],handle.point.clone(),handle.info,
GraphicSelection.extraInfo.isCropMode);return newSubSection}else{
newSubSection.sectionProperties.ownInfo=handle.info;newSubSection.setPosition(handle.point.pX,
handle.point.pY);if(
GraphicSelection.extraInfo.isCropMode&&!newSubSection.sectionProperties.cropModeEnabled){
newSubSection.sectionProperties.cropModeEnabled=GraphicSelection.extraInfo.isCropMode}return null}};
ShapeHandlesSection.prototype.checkRotationSubSection=function(handle){
var newSubSection=app.sectionContainer.getSectionWithName(
this.sectionProperties.subSectionPrefix+"rotation");if(!newSubSection){
newSubSection=new app.definitions.shapeHandleRotationSubSection(this,
this.sectionProperties.subSectionPrefix+"rotation",[this.sectionProperties.rotationHandleWidth,
this.sectionProperties.rotationHandleHeight],handle.point.clone(),handle.info);return newSubSection
}else{newSubSection.sectionProperties.ownInfo=handle.info;newSubSection.setPosition(handle.point.pX,
handle.point.pY);return null}};ShapeHandlesSection.prototype.checkCustomSubSection=function(handle){
var newSubSection=app.sectionContainer.getSectionWithName(
this.sectionProperties.subSectionPrefix+handle.info.id);if(!newSubSection){
newSubSection=new app.definitions.shapeHandleCustomSubSection(this,
this.sectionProperties.subSectionPrefix+handle.info.id,[this.sectionProperties.handleWidth,
this.sectionProperties.handleHeight],handle.point.clone(),handle.info);return newSubSection}else{
newSubSection.sectionProperties.ownInfo=handle.info;newSubSection.setPosition(handle.point.pX,
handle.point.pY);return null}};ShapeHandlesSection.prototype.checkPolySubSection=function(handle){
var newSubSection=app.sectionContainer.getSectionWithName(
this.sectionProperties.subSectionPrefix+handle.info.id);if(!newSubSection){
newSubSection=new app.definitions.shapeHandlePolySubSection(this,
this.sectionProperties.subSectionPrefix+handle.info.id,[this.sectionProperties.handleWidth,
this.sectionProperties.handleHeight],handle.point.clone(),handle.info);return newSubSection}else{
newSubSection.sectionProperties.ownInfo=handle.info;newSubSection.setPosition(handle.point.pX,
handle.point.pY);return null}};ShapeHandlesSection.prototype.checkGluePointSubSection=function(
handle){var newSubSection=app.sectionContainer.getSectionWithName(
this.sectionProperties.subSectionPrefix+handle.info.id);if(!newSubSection){
newSubSection=new app.definitions.shapeHandleGluePointSubSection(this,
this.sectionProperties.subSectionPrefix+handle.info.id,[this.sectionProperties.gluePointRadius,
this.sectionProperties.gluePointRadius],handle.point.clone(),handle.info);return newSubSection}else{
newSubSection.sectionProperties.ownInfo=handle.info;newSubSection.setPosition(handle.point.pX,
handle.point.pY);return null}};ShapeHandlesSection.prototype.addSubSections=function(){for(
var i=0;i<this.sectionProperties.handles.length;i++){var newSubSection=null;if(
this.sectionProperties.handles[i].info.kind==="16")newSubSection=this.checkAnchorSubSection(
this.sectionProperties.handles[i]);else if(["1","2","3","4","5","6","7","8"].includes(
this.sectionProperties.handles[i].info.kind))newSubSection=this.checkScalingSubSection(
this.sectionProperties.handles[i]);else if(this.sectionProperties.handles[i
].info.kind==="ShapeRotationHandle")newSubSection=this.checkRotationSubSection(
this.sectionProperties.handles[i]);else if(this.sectionProperties.handles[i].info.kind==="22"
)newSubSection=this.checkCustomSubSection(this.sectionProperties.handles[i]);else if(
this.sectionProperties.handles[i].info.kind==="9")newSubSection=this.checkPolySubSection(
this.sectionProperties.handles[i]);else if(this.sectionProperties.handles[i].info.kind==="GluePoint"
)newSubSection=this.checkGluePointSubSection(this.sectionProperties.handles[i]);if(newSubSection){
this.containerObject.addSection(newSubSection);this.sectionProperties.subSections.push(newSubSection
)}}};ShapeHandlesSection.prototype.onMouseEnter=function(){
this.sectionProperties.previousCursorStyle=this.context.canvas.style.cursor;
this.context.canvas.style.cursor="move";this.sectionProperties.mouseIsInside=true};
ShapeHandlesSection.prototype.onMouseLeave=function(){
this.context.canvas.style.cursor=this.sectionProperties.previousCursorStyle;
this.sectionProperties.mouseIsInside=false};
ShapeHandlesSection.prototype.adjustSnapTransformCoordinate=function(x,y){if(x!==null&&[0,3
].includes(this.sectionProperties.pickedIndexX))x-=this.size[0];if(y!==null&&[0,3].includes(
this.sectionProperties.pickedIndexY))y-=this.size[1];return x!==null?x:y};
ShapeHandlesSection.prototype.sendTransformCommand=function(point){
var x=this.sectionProperties.closestX;if(!x)x=this.sectionProperties.lastDragDistance[0
]+this.position[0];else x=this.adjustSnapTransformCoordinate(x,null);
var y=this.sectionProperties.closestY;if(!y)y=this.sectionProperties.lastDragDistance[1
]+this.position[1];else y=this.adjustSnapTransformCoordinate(null,y);var yTwips=y*app.pixelsToTwips;
var docLayer=app.map._docLayer;var verticalOffset=docLayer.getFiledBasedViewVerticalOffset();if(
verticalOffset){yTwips-=verticalOffset}var parameters={TransformPosX:{type:"long",value:Math.round(
x*app.pixelsToTwips)},TransformPosY:{type:"long",value:Math.round(yTwips)}};app.map.sendUnoCommand(
".uno:TransformDialog",parameters);docLayer.requestNewFiledBasedViewTiles()};
ShapeHandlesSection.prototype.onMouseUp=function(point,e){var _this=this;if(
this.sectionProperties.svg)this.sectionProperties.svg.style.opacity=1;this.hideSVG();
window.IgnorePanning=false;if(this.containerObject.isDraggingSomething()){if(window.mode.isTablet(
)||window.mode.isMobile())this.sendTransformCommand(point);else if(window.mode.isDesktop()&&(
this.sectionProperties.closestX||this.sectionProperties.closestY)){setTimeout(function(){
_this.sendTransformCommand(point)},1)}}};ShapeHandlesSection.prototype.findClosestX=function(xList){
var closest=1e3;var pickX=null;this.sectionProperties.pickedIndexX=0;if(
GraphicSelection.extraInfo.ObjectRectangles){var ordNum=GraphicSelection.extraInfo.OrdNum;
var rectangles=GraphicSelection.extraInfo.ObjectRectangles;for(var i=0;i<rectangles.length;i++){if(
rectangles[i][4]!==ordNum){var distances=[];for(var j=0;j<xList.length;j++){distances.unshift(
Math.abs(rectangles[i][0]-xList[j]));distances.push(Math.abs(rectangles[i][0]+rectangles[i][2
]-xList[j]))}var min=Math.min.apply(Math,__spreadArray([],__read(distances),false));
var index=distances.indexOf(min);if(min<closest){closest=min;pickX=index<xList.length?rectangles[i][
0]:rectangles[i][0]+rectangles[i][2];this.sectionProperties.pickedIndexX=index}}}}if(
closest<10*app.dpiScale
)this.sectionProperties.closestX=pickX;else this.sectionProperties.closestX=null};
ShapeHandlesSection.prototype.findClosestY=function(yList){var closest=1e3;var pickY=null;if(
GraphicSelection.extraInfo.ObjectRectangles){var ordNum=GraphicSelection.extraInfo.OrdNum;
var rectangles=GraphicSelection.extraInfo.ObjectRectangles;this.sectionProperties.pickedIndexY=0;
for(var i=0;i<rectangles.length;i++){if(rectangles[i][4]!==ordNum){var distances=[];for(
var j=0;j<yList.length;j++){distances.unshift(Math.abs(rectangles[i][1]-yList[j]));distances.push(
Math.abs(rectangles[i][1]+rectangles[i][3]-yList[j]))}var min=Math.min.apply(Math,__spreadArray([],
__read(distances),false));var index=distances.indexOf(min);if(min<closest){closest=min;
pickY=index<yList.length?rectangles[i][1]:rectangles[i][1]+rectangles[i][3];
this.sectionProperties.pickedIndexY=index}}}}if(closest<10*app.dpiScale
)this.sectionProperties.closestY=pickY;else this.sectionProperties.closestY=null};
ShapeHandlesSection.prototype.cloneSelectedPartInfoForGridSnap=function(){
var selectedPart=Object.assign({},app.impress.partList[app.map._docLayer._selectedPart]);
selectedPart.leftBorder*=app.impress.twipsCorrection;
selectedPart.upperBorder*=app.impress.twipsCorrection;
selectedPart.rightBorder*=app.impress.twipsCorrection;
selectedPart.lowerBorder*=app.impress.twipsCorrection;
selectedPart.gridCoarseWidth*=app.impress.twipsCorrection;
selectedPart.gridCoarseHeight*=app.impress.twipsCorrection;return selectedPart};
ShapeHandlesSection.prototype.getInnerRecrangleForGridSnap=function(selectedPart){
return new cool.SimpleRectangle(selectedPart.leftBorder,selectedPart.upperBorder,
selectedPart.width-selectedPart.leftBorder-selectedPart.rightBorder,
selectedPart.height-selectedPart.upperBorder-selectedPart.lowerBorder)};
ShapeHandlesSection.prototype.getCornerPointsForGridSnap=function(size,position,dragDistance){
return[new cool.SimplePoint((position[0]+dragDistance[0])*app.pixelsToTwips,(position[1
]+dragDistance[1])*app.pixelsToTwips),new cool.SimplePoint((size[0]+position[0]+dragDistance[0]
)*app.pixelsToTwips,(position[1]+dragDistance[1])*app.pixelsToTwips),new cool.SimplePoint((position[
0]+dragDistance[0])*app.pixelsToTwips,(size[1]+position[1]+dragDistance[1])*app.pixelsToTwips),
new cool.SimplePoint((size[0]+position[0]+dragDistance[0])*app.pixelsToTwips,(size[1]+position[1
]+dragDistance[1])*app.pixelsToTwips)]};ShapeHandlesSection.prototype.findClosestGridPoint=function(
size,position,dragDistance){var selectedPart=this.cloneSelectedPartInfoForGridSnap();
var checkList=this.getCornerPointsForGridSnap(size,position,dragDistance);
var innerRectangle=this.getInnerRecrangleForGridSnap(selectedPart);
var gapX=selectedPart.gridCoarseWidth/(selectedPart.innerSpacesX>0?selectedPart.innerSpacesX:1);
var gapY=selectedPart.gridCoarseHeight/(selectedPart.innerSpacesY>0?selectedPart.innerSpacesY:1);
var minX=1e5;var minY=1e5;for(var i=0;i<1;i++){if(innerRectangle.containsPoint(checkList[i].toArray(
))){var countX=Math.round((checkList[i].x-innerRectangle.x1)/gapX);var countY=Math.round((checkList[
i].y-innerRectangle.y1)/gapY);var diffX=Math.abs(checkList[i].x-innerRectangle.x1-gapX*countX);
var diffY=Math.abs(checkList[i].y-innerRectangle.y1-gapY*countY);if(diffX<minX){minX=diffX;
this.sectionProperties.closestX=innerRectangle.x1+countX*gapX;this.sectionProperties.pickedIndexX=[1
,3].includes(i)?0:1}if(diffY<minY){minY=diffY;
this.sectionProperties.closestY=innerRectangle.y1+countY*gapY;this.sectionProperties.pickedIndexY=[2
,3].includes(i)?0:1}}}this.sectionProperties.closestX*=app.twipsToPixels;
this.sectionProperties.closestY*=app.twipsToPixels};
ShapeHandlesSection.prototype.checkObjectsBoundaries=function(xListToCheck,yListToCheck){if(
app.map._docLayer._docType==="presentation"){this.findClosestX(xListToCheck);this.findClosestY(
yListToCheck)}};ShapeHandlesSection.prototype.checkHelperLinesAndSnapPoints=function(size,position,
dragDistance){this.sectionProperties.closestX=null;this.sectionProperties.closestY=null;if(
app.map.stateChangeHandler.getItemValue(".uno:GridUse")==="true"){this.findClosestGridPoint(size,
position,dragDistance)}else{this.checkObjectsBoundaries([position[0]+dragDistance[0],position[0
]+dragDistance[0]+size[0]],[position[1]+dragDistance[1],position[1]+dragDistance[1]+size[1]])}
this.containerObject.requestReDraw()};ShapeHandlesSection.prototype.onMouseMove=function(position,
dragDistance){var canDrag=!app.file.textCursor.visible;if(canDrag&&app.map.getDocType(
)==="presentation"){var deleteRowsState=app.map.stateChangeHandler.getItemValue(".uno:DeleteRows");
canDrag=deleteRowsState?deleteRowsState==="disabled":true}if(
this.containerObject.isDraggingSomething()&&canDrag){window.IgnorePanning=true;if(
this.sectionProperties.svg){this.sectionProperties.svg.style.left=String((this.myTopLeft[0
]+dragDistance[0])/app.dpiScale)+"px";this.sectionProperties.svg.style.top=String((this.myTopLeft[1
]+dragDistance[1])/app.dpiScale)+"px";this.sectionProperties.svg.style.opacity=.5}
this.sectionProperties.lastDragDistance=[dragDistance[0],dragDistance[1]];
this.checkHelperLinesAndSnapPoints(this.size,this.position,dragDistance);this.showSVG()
}else window.IgnorePanning=false};ShapeHandlesSection.prototype.getViewBox=function(svg){
var viewBox=svg.getAttribute("viewBox");if(viewBox){viewBox=viewBox.split(" ");for(
var i=0;i<viewBox.length;i++)viewBox[i]=parseInt(viewBox[i])}else viewBox=null;return viewBox};
ShapeHandlesSection.prototype.adjustSVGProperties=function(){if(
this.sectionProperties.svg&&this.sectionProperties.svg.style.display===""&&GraphicSelection.hasActiveSelection(
)){var widthText=GraphicSelection.rectangle.cWidth+"px";
var heightText=GraphicSelection.rectangle.cHeight+"px";var viewBox=this.getViewBox(
this.sectionProperties.svg.children[0]);var isImage=this.sectionProperties.svg.querySelectorAll(
".Graphic").length>0;var clientRect=this.sectionProperties.svg.children[0].getBoundingClientRect();
if(viewBox&&!isImage&&clientRect.width>0&&clientRect.height>0){this.sectionProperties.svg.children[0
].style.width=widthText;this.sectionProperties.svg.children[0].style.height=heightText}else{
this.sectionProperties.svg.style.width=widthText;this.sectionProperties.svg.style.height=heightText;
if(isImage){this.sectionProperties.svg.children[0].style.width=widthText;
this.sectionProperties.svg.children[0].style.height=heightText}}
var left=GraphicSelection.rectangle.pX1;var top_1=GraphicSelection.rectangle.pY1;
this.sectionProperties.svg.style.left=Math.round((
left-app.activeDocument.activeView.viewedRectangle.pX1+this.containerObject.getDocumentAnchor()[0]
)/app.dpiScale)+"px";this.sectionProperties.svg.style.top=Math.round((
top_1-app.activeDocument.activeView.viewedRectangle.pY1+this.containerObject.getDocumentAnchor()[1]
)/app.dpiScale)+"px";this.sectionProperties.svgPosition=[left,top_1]}this.hideSVG()};
ShapeHandlesSection.prototype.onNewDocumentTopLeft=function(){if(this.sectionProperties.svgPosition
){this.sectionProperties.svg.style.left=this.sectionProperties.svgPosition[0]-(
app.activeDocument.activeView.viewedRectangle.pX1+this.containerObject.getDocumentAnchor()[0]
)/app.dpiScale+"px";this.sectionProperties.svg.style.top=this.sectionProperties.svgPosition[1]-(
app.activeDocument.activeView.viewedRectangle.pY1+this.containerObject.getDocumentAnchor()[1]
)/app.dpiScale+"px"}};ShapeHandlesSection.prototype.drawXAxis=function(x){this.context.moveTo(x,0);
this.context.lineTo(x,this.context.canvas.height);this.context.stroke()};
ShapeHandlesSection.prototype.drawYAxis=function(y){this.context.moveTo(0,y);this.context.lineTo(
this.context.canvas.width,y);this.context.stroke()};
ShapeHandlesSection.prototype.drawShapeAlignmentHelperLines=function(){this.context.save();
this.context.setLineDash([4,3]);this.context.strokeStyle=HelperLineStyles.smartGuidesStyle;
this.context.translate(-this.myTopLeft[0],-this.myTopLeft[1]);this.context.beginPath();if(
this.sectionProperties.closestX!==null)this.drawXAxis(this.containerObject.getDocumentAnchor()[0
]+this.sectionProperties.closestX-app.activeDocument.activeView.viewedRectangle.pX1);if(
this.sectionProperties.closestY!==null)this.drawYAxis(this.containerObject.getDocumentAnchor()[1
]+this.sectionProperties.closestY-app.activeDocument.activeView.viewedRectangle.pY1);
this.context.closePath();this.context.restore()};
ShapeHandlesSection.prototype.drawGridHelperLines=function(){this.context.save();
this.context.translate(-this.myTopLeft[0],-this.myTopLeft[1]);this.context.beginPath();if(
this.sectionProperties.closestX!==null){this.context.strokeStyle=HelperLineStyles.gridSolidStyle;
this.context.setLineDash([]);var x=this.containerObject.getDocumentAnchor()[0
]+this.sectionProperties.closestX-app.activeDocument.activeView.viewedRectangle.pX1;this.drawXAxis(x
);this.context.setLineDash([4,3]);this.context.strokeStyle=HelperLineStyles.gridDashedStyle;
this.drawXAxis(x)}if(this.sectionProperties.closestY!==null){
this.context.strokeStyle=HelperLineStyles.gridSolidStyle;this.context.setLineDash([]);
var y=this.containerObject.getDocumentAnchor()[1
]+this.sectionProperties.closestY-app.activeDocument.activeView.viewedRectangle.pY1;this.drawYAxis(y
);this.context.setLineDash([4,3]);this.context.strokeStyle=HelperLineStyles.gridDashedStyle;
this.drawYAxis(y)}this.context.closePath();this.context.restore()};
ShapeHandlesSection.prototype.anythingToDraw=function(){
return this.sectionProperties.closestX!==null||this.sectionProperties.closestY!==null};
ShapeHandlesSection.prototype.drawSelectionFrame=function(){this.context.beginPath();
this.context.strokeStyle="black";this.context.setLineDash([3,3]);this.context.strokeRect(0,0,
this.size[0],this.size[1]);this.context.setLineDash([]);this.context.closePath()};
ShapeHandlesSection.prototype.onDraw=function(){this.drawSelectionFrame();if(
!this.showSection||!this.isVisible)this.hideSVG();else if(this.anythingToDraw()){if(
app.map.stateChangeHandler.getItemValue(".uno:GridUse")==="true")this.drawGridHelperLines(
);else this.drawShapeAlignmentHelperLines()}};
ShapeHandlesSection.prototype.removeSubSections=function(){this.removeSVG();for(
var i=0;i<this.sectionProperties.subSections.length;i++){this.containerObject.removeSection(
this.sectionProperties.subSections[i].name)}};return ShapeHandlesSection}(CanvasSectionObject);
app.definitions.shapeHandlesSection=ShapeHandlesSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ShapeHandleCustomSubSection=function(_super){__extends(
ShapeHandleCustomSubSection,_super);function ShapeHandleCustomSubSection(parentHandlerSection,
sectionName,size,documentPosition,ownInfo){var _this=_super.call(this,sectionName)||this;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder+1;
_this.zIndex=app.CSections.DefaultForDocumentObjects.zIndex;_this.documentObject=true;
_this.size=size;_this.sectionProperties.position=documentPosition.clone();
_this.sectionProperties.parentHandlerSection=parentHandlerSection;
_this.sectionProperties.ownInfo=ownInfo;_this.sectionProperties.previousCursorStyle=null;
_this.sectionProperties.mousePointerType="grab";
_this.sectionProperties.mapPane=document.querySelectorAll(".leaflet-map-pane")[0];return _this}
ShapeHandleCustomSubSection.prototype.onDraw=function(frameCount,elapsedTime){
this.context.fillStyle="yellow";this.context.strokeStyle="black";this.context.beginPath();
this.context.arc(this.size[0]*.5,this.size[1]*.5,this.size[0]*.5,0,Math.PI*2);
this.context.closePath();this.context.fill();this.context.stroke()};
ShapeHandleCustomSubSection.prototype.onInitialize=function(){this.setPosition(
this.sectionProperties.position.pX,this.sectionProperties.position.pY)};
ShapeHandleCustomSubSection.prototype.onMouseEnter=function(point,e){app.map.dontHandleMouse=true;
this.sectionProperties.previousCursorStyle=this.sectionProperties.mapPane.style.cursor;
this.sectionProperties.mapPane.style.cursor=this.sectionProperties.mousePointerType;
this.stopPropagating();e.stopPropagation();this.containerObject.requestReDraw()};
ShapeHandleCustomSubSection.prototype.onMouseLeave=function(point,e){app.map.dontHandleMouse=false;
this.sectionProperties.mapPane.style.cursor=this.sectionProperties.previousCursorStyle;
this.stopPropagating();e.stopPropagation();this.containerObject.requestReDraw()};
ShapeHandleCustomSubSection.prototype.onMouseDown=function(point,e){window.IgnorePanning=true};
ShapeHandleCustomSubSection.prototype.onMouseUp=function(point,e){if(
this.containerObject.isDraggingSomething()){var parameters={HandleNum:{type:"long",
value:this.sectionProperties.ownInfo.id},NewPosX:{type:"long",value:Math.round((
point.pX+this.position[0])*app.pixelsToTwips)},NewPosY:{type:"long",value:Math.round((
point.pY+this.position[1])*app.pixelsToTwips)}};app.map.sendUnoCommand(".uno:MoveShapeHandle",
parameters);this.stopPropagating();e.stopPropagation()}window.IgnorePanning=false};
ShapeHandleCustomSubSection.prototype.onMouseMove=function(point,dragDistance,e){if(
this.containerObject.isDraggingSomething()){this.stopPropagating();e.stopPropagation()}};
return ShapeHandleCustomSubSection}(CanvasSectionObject);
app.definitions.shapeHandleCustomSubSection=ShapeHandleCustomSubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ShapeHandlePolySubSection=function(_super){__extends(
ShapeHandlePolySubSection,_super);function ShapeHandlePolySubSection(parentHandlerSection,
sectionName,size,documentPosition,ownInfo){var _this=_super.call(this,parentHandlerSection,
sectionName,size,documentPosition,ownInfo)||this;_this.sectionProperties.mousePointerType="move";
return _this}return ShapeHandlePolySubSection}(ShapeHandleCustomSubSection);
app.definitions.shapeHandlePolySubSection=ShapeHandlePolySubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ShapeHandleGluePointSubSection=function(_super){__extends(
ShapeHandleGluePointSubSection,_super);function ShapeHandleGluePointSubSection(parentHandlerSection,
sectionName,size,documentPosition,ownInfo){var _this=_super.call(this,sectionName)||this;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder+1;
_this.zIndex=app.CSections.DefaultForDocumentObjects.zIndex;_this.documentObject=true;
_this.size=size;_this.position=[documentPosition.pX,documentPosition.pY];
_this.sectionProperties.parentHandlerSection=parentHandlerSection;
_this.sectionProperties.ownInfo=ownInfo;return _this}
ShapeHandleGluePointSubSection.prototype.onDraw=function(frameCount,elapsedTime){
this.context.fillStyle="#EE3E3E";this.context.beginPath();this.context.arc(0,0,this.size[0]*.5,0,
Math.PI*2);this.context.fill()};return ShapeHandleGluePointSubSection}(CanvasSectionObject);
app.definitions.shapeHandleGluePointSubSection=ShapeHandleGluePointSubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ShapeHandleAnchorSubSection=function(_super){__extends(
ShapeHandleAnchorSubSection,_super);function ShapeHandleAnchorSubSection(parentHandlerSection,
sectionName,size,documentPosition,ownInfo){var _this=_super.call(this,sectionName,size[0],size[1],
documentPosition,"anchor-marker")||this;_this.getHTMLObject().style.opacity=1;_this.getHTMLObject(
).remove();document.getElementById("map").appendChild(_this.getHTMLObject());
app.definitions.shapeHandlesSection.mirrorEventsFromSourceToCanvasSectionContainer(
_this.getHTMLObject());_this.sectionProperties.parentHandlerSection=parentHandlerSection;
_this.sectionProperties.ownInfo=ownInfo;_this.sectionProperties.mouseIsInside=false;return _this}
ShapeHandleAnchorSubSection.prototype.onMouseEnter=function(){this.backgroundColor="grey";
this.containerObject.requestReDraw()};ShapeHandleAnchorSubSection.prototype.onMouseLeave=function(){
this.backgroundColor=null;this.containerObject.requestReDraw()};
ShapeHandleAnchorSubSection.prototype.tableMouseUp=function(point,e){var parameters={TransformPosX:{
type:"long",value:Math.round((point.pX+this.position[0])*app.pixelsToTwips)},TransformPosY:{
type:"long",value:Math.round((point.pY+this.position[1])*app.pixelsToTwips)}};
app.map.sendUnoCommand(".uno:TransformDialog",parameters)};
ShapeHandleAnchorSubSection.prototype.shapeMouseUp=function(point,e){var parameters={HandleNum:{
type:"long",value:this.sectionProperties.ownInfo.id},NewPosX:{type:"long",value:Math.round((
point.pX+this.position[0])*app.pixelsToTwips)},NewPosY:{type:"long",value:Math.round((
point.pY+this.position[1])*app.pixelsToTwips)}};app.map.sendUnoCommand(".uno:MoveShapeHandle",
parameters)};ShapeHandleAnchorSubSection.prototype.onMouseUp=function(point,e){if(
this.containerObject.isDraggingSomething()){if(this.sectionProperties.parentHandlerSection){
this.shapeMouseUp(point,e)}else{this.tableMouseUp(point,e)}}};
ShapeHandleAnchorSubSection.prototype.onMouseMove=function(point,dragDistance,e){if(
this.containerObject.isDraggingSomething()){var svg=void 0;var initialPosition=void 0;if(
this.sectionProperties.parentHandlerSection){this.sectionProperties.parentHandlerSection.showSVG();
svg=this.sectionProperties.parentHandlerSection.sectionProperties.svg;
initialPosition=this.sectionProperties.parentHandlerSection.sectionProperties.svgPosition}else{
svg=document.getElementById("canvas-container").querySelector("svg");svg.style.display="";if(
!this.sectionProperties.initialPosition){this.sectionProperties.initialPosition=[parseFloat(
svg.style.left.replace("px",""))*app.dpiScale,parseFloat(svg.style.top.replace("px","")
)*app.dpiScale]}initialPosition=this.sectionProperties.initialPosition}svg.style.left=(dragDistance[
0]+initialPosition[0])/app.dpiScale+"px";svg.style.top=(dragDistance[1]+initialPosition[1]
)/app.dpiScale+"px";this.stopPropagating();e.stopPropagation()}};
ShapeHandleAnchorSubSection.tableAnchorIconSize=[20,20];return ShapeHandleAnchorSubSection}(
HTMLObjectSection);app.definitions.shapeHandleAnchorSubSection=ShapeHandleAnchorSubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ShapeHandleRotationSubSection=function(_super){__extends(
ShapeHandleRotationSubSection,_super);function ShapeHandleRotationSubSection(parentHandlerSection,
sectionName,size,documentPosition,ownInfo){var _this=_super.call(this,sectionName)||this;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder+1;
_this.zIndex=app.CSections.DefaultForDocumentObjects.zIndex;_this.documentObject=true;
_this.size=size;_this.sectionProperties.position=documentPosition.clone();
_this.sectionProperties.parentHandlerSection=parentHandlerSection;
_this.sectionProperties.ownInfo=ownInfo;_this.sectionProperties.mouseIsInside=false;
_this.sectionProperties.previousCursorStyle=null;_this.sectionProperties.lastDraggingDistance=null;
_this.sectionProperties.mapPane=document.querySelectorAll(".leaflet-map-pane")[0];
_this.sectionProperties.previousCursorStyle=null;_this.sectionProperties.cursorStyle="pointer";
app.events.on("TextCursorVisibility",_this.onTextCursorVisibility.bind(_this));return _this}
ShapeHandleRotationSubSection.prototype.onTextCursorVisibility=function(event){if(
event.detail.visible){this.setShowSection(false);this.interactable=false}else{this.setShowSection(
true);this.interactable=true}};ShapeHandleRotationSubSection.prototype.calculateAngle=function(
center,target){var angle=Math.atan2(target.y-center.y,target.x-center.x);while(angle<0
)angle+=2*Math.PI;while(angle>Math.PI*2)angle-=Math.PI*2;angle=angle*180/Math.PI;angle*=100;
return angle};ShapeHandleRotationSubSection.prototype.onInitialize=function(){this.setPosition(
this.sectionProperties.position.pX,this.sectionProperties.position.pY)};
ShapeHandleRotationSubSection.prototype.onMouseEnter=function(point,e){app.map.dontHandleMouse=true;
this.sectionProperties.previousCursorStyle=this.sectionProperties.mapPane.style.cursor;
this.sectionProperties.mapPane.style.cursor=this.sectionProperties.cursorStyle};
ShapeHandleRotationSubSection.prototype.onMouseLeave=function(point,e){app.map.dontHandleMouse=false
this.sectionProperties.mapPane.style.cursor=this.sectionProperties.previousCursorStyle};
ShapeHandleRotationSubSection.prototype.onDraw=function(frameCount,elapsedTime){
this.context.fillStyle="white";this.context.strokeStyle="black";this.context.beginPath();
this.context.arc(this.size[0]*.5,this.size[1]*.5,this.size[0]*.5,0,Math.PI*2);
this.context.closePath();this.context.fill();this.context.stroke()};
ShapeHandleRotationSubSection.prototype.getAngleDifference=function(){var dragDistanceInTwips=[
this.sectionProperties.lastDraggingDistance[0]*app.pixelsToTwips,
this.sectionProperties.lastDraggingDistance[1]*app.pixelsToTwips];
var draggedToPoint=new cool.SimplePoint(dragDistanceInTwips[0],dragDistanceInTwips[1]);
draggedToPoint.pX+=this.position[0];draggedToPoint.pY+=this.position[1];
var selectionCenter=new cool.SimplePoint(GraphicSelection.rectangle.center[0],
GraphicSelection.rectangle.center[1]);
var initialPoint=this.sectionProperties.ownInfo.initialPosition;
var initialAngle=this.calculateAngle(selectionCenter,initialPoint);var newAngle=this.calculateAngle(
selectionCenter,draggedToPoint);return initialAngle-newAngle};
ShapeHandleRotationSubSection.prototype.onMouseDown=function(point,e){window.IgnorePanning=true};
ShapeHandleRotationSubSection.prototype.onMouseUp=function(point,e){if(
this.containerObject.isDraggingSomething()){if(this.sectionProperties.lastDraggingDistance){
var center=GraphicSelection.rectangle.center;var commandParameters={TransformRotationDeltaAngle:{
type:"long",value:this.getAngleDifference()},TransformRotationX:{type:"long",value:center[0]},
TransformRotationY:{type:"long",value:center[1]}};app.map.sendUnoCommand(".uno:TransformDialog ",
commandParameters)}this.sectionProperties.parentHandlerSection.hideSVG()}window.IgnorePanning=false}
ShapeHandleRotationSubSection.prototype.onMouseMove=function(position,distance){if(
this.containerObject.isDraggingSomething()){this.sectionProperties.lastDraggingDistance=distance;if(
this.containerObject.isDraggingSomething(
)&&this.sectionProperties.parentHandlerSection.sectionProperties.svg){
this.sectionProperties.parentHandlerSection.sectionProperties.svg.style.opacity=.5;
var angleDifference=-this.getAngleDifference()/100;
this.sectionProperties.parentHandlerSection.sectionProperties.svg.style.transform="rotate("+angleDifference+"deg)"
this.containerObject.requestReDraw();this.sectionProperties.parentHandlerSection.showSVG()}}};
return ShapeHandleRotationSubSection}(CanvasSectionObject);
app.definitions.shapeHandleRotationSubSection=ShapeHandleRotationSubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __read=this&&this.__read||function(o,n){
var m=typeof Symbol==="function"&&o[Symbol.iterator];if(!m)return o;var i=m.call(o),r,ar=[],e;try{
while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(r.value)}catch(error){e={error:error}
}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{if(e)throw e.error}}return ar};
var ShapeHandleScalingSubSection=function(_super){__extends(ShapeHandleScalingSubSection,_super);
function ShapeHandleScalingSubSection(parentHandlerSection,sectionName,size,documentPosition,ownInfo
,cropModeEnabled){var _this=_super.call(this,sectionName)||this;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder+1;
_this.zIndex=app.CSections.DefaultForDocumentObjects.zIndex;_this.documentObject=true;
_this.size=size;_this.sectionProperties.position=documentPosition.clone();
_this.sectionProperties.parentHandlerSection=parentHandlerSection;
_this.sectionProperties.ownInfo=ownInfo;_this.sectionProperties.mousePointerType=null;
_this.sectionProperties.previousCursorStyle=null;_this.sectionProperties.initialAngle=null;
_this.sectionProperties.distanceToCenter=null;
_this.sectionProperties.mapPane=document.querySelectorAll(".leaflet-map-pane")[0];
_this.sectionProperties.cropModeEnabled=cropModeEnabled;
_this.sectionProperties.cropCursor="url("+app.LOUtil.getURL("images/cursors/crop.png")+") 8 8, auto"
_this.setMousePointerType();app.events.on("TextCursorVisibility",_this.onTextCursorVisibility.bind(
_this));return _this}ShapeHandleScalingSubSection.prototype.onInitialize=function(){
this.setPosition(this.sectionProperties.position.pX,this.sectionProperties.position.pY)};
ShapeHandleScalingSubSection.prototype.onTextCursorVisibility=function(event){if(
event.detail.visible){this.setShowSection(false);this.interactable=false}else{this.setShowSection(
true);this.interactable=true}};ShapeHandleScalingSubSection.prototype.onDraw=function(frameCount,
elapsedTime){this.context.fillStyle="white";this.context.strokeStyle="black";this.context.beginPath(
);if(this.sectionProperties.cropModeEnabled)this.drawCropHandles();else this.context.rect(0,0,
this.size[0],this.size[1]);this.context.closePath();this.context.fill();this.context.stroke()};
ShapeHandleScalingSubSection.prototype.drawCropCornerHandle=function(){var markerWidth=this.size[0];
var halfMarkerWidth=markerWidth*.5;
var shapeAngle=this.sectionProperties.parentHandlerSection.sectionProperties.shapeRectangleProperties.angleRadian
var x=halfMarkerWidth,y=halfMarkerWidth;this.context.translate(x,y);this.context.rotate(
shapeAngle*-1);this.context.translate(-x,-y);this.context.moveTo(x,y);x+=markerWidth;
this.context.lineTo(x,y);y+=halfMarkerWidth;this.context.lineTo(x,y);x-=halfMarkerWidth;
this.context.lineTo(x,y);y+=halfMarkerWidth;this.context.lineTo(x,y);x-=halfMarkerWidth;
this.context.lineTo(x,y)};ShapeHandleScalingSubSection.prototype.drawCropSideHandle=function(){
var markerWidth=this.size[0];var halfMarkerWidth=markerWidth*.5;
var shapeAngle=this.sectionProperties.parentHandlerSection.sectionProperties.shapeRectangleProperties.angleRadian
var x=halfMarkerWidth,y=halfMarkerWidth;this.context.translate(x,y);this.context.rotate(
shapeAngle*-1);this.context.translate(-x,-y);this.context.moveTo(x,y);x+=markerWidth;
this.context.lineTo(x,y);y+=halfMarkerWidth;this.context.lineTo(x,y);x-=markerWidth;
this.context.lineTo(x,y)};ShapeHandleScalingSubSection.prototype.drawCropHandles=function(){
var markerWidth=this.size[0];this.context.save();switch(this.sectionProperties.ownInfo.kind){
case"1":this.drawCropCornerHandle();break;case"2":this.drawCropSideHandle();break;case"3":
this.context.rotate(Math.PI/2);this.context.translate(0,-markerWidth);this.drawCropCornerHandle();
break;case"4":this.context.rotate(-Math.PI/2);this.context.translate(-markerWidth,0);
this.drawCropSideHandle();break;case"5":this.context.rotate(Math.PI/2);this.context.translate(0,
-markerWidth);this.drawCropSideHandle();break;case"6":this.context.rotate(-Math.PI/2);
this.context.translate(-markerWidth,0);this.drawCropCornerHandle();break;case"7":
this.context.rotate(Math.PI);this.context.translate(-markerWidth,-markerWidth);
this.drawCropSideHandle();break;case"8":this.context.rotate(Math.PI);this.context.translate(
-markerWidth,-markerWidth);this.drawCropCornerHandle();break}this.context.restore()};
ShapeHandleScalingSubSection.prototype.setMousePointerType=function(){if(
this.sectionProperties.ownInfo.kind==="1"
)this.sectionProperties.mousePointerType="nwse-resize";else if(
this.sectionProperties.ownInfo.kind==="2"
)this.sectionProperties.mousePointerType="ns-resize";else if(
this.sectionProperties.ownInfo.kind==="3"
)this.sectionProperties.mousePointerType="nesw-resize";else if(
this.sectionProperties.ownInfo.kind==="4"
)this.sectionProperties.mousePointerType="ew-resize";else if(
this.sectionProperties.ownInfo.kind==="5"
)this.sectionProperties.mousePointerType="ew-resize";else if(
this.sectionProperties.ownInfo.kind==="6"
)this.sectionProperties.mousePointerType="nesw-resize";else if(
this.sectionProperties.ownInfo.kind==="7"
)this.sectionProperties.mousePointerType="ns-resize";else if(
this.sectionProperties.ownInfo.kind==="8")this.sectionProperties.mousePointerType="nwse-resize"};
ShapeHandleScalingSubSection.prototype.onMouseEnter=function(point,e){app.map.dontHandleMouse=true;
e.stopPropagation();this.stopPropagating();
this.sectionProperties.previousCursorStyle=this.sectionProperties.mapPane.style.cursor;if(
this.sectionProperties.cropModeEnabled
)this.sectionProperties.mapPane.style.cursor=this.sectionProperties.cropCursor;else this.sectionProperties.mapPane.style.cursor=this.sectionProperties.mousePointerType
this.containerObject.requestReDraw()};ShapeHandleScalingSubSection.prototype.onMouseLeave=function(
point,e){app.map.dontHandleMouse=false;e.stopPropagation();this.stopPropagating();
this.sectionProperties.mapPane.style.cursor=this.sectionProperties.previousCursorStyle;
this.containerObject.requestReDraw()};
ShapeHandleScalingSubSection.prototype.overrideHandle=function(kind){var handle={
id:this.sectionProperties.ownInfo.id,x:this.position[0],y:this.position[1]};
var subSections=this.sectionProperties.parentHandlerSection.sectionProperties.subSections;if(
kind==="5"){handle.id="7";handle.y=subSections["7"].position[1]}else if(kind==="4"){handle.id="5";
handle.y=subSections["5"].position[1]}else if(kind==="2"){handle.id="2";handle.x=subSections["2"
].position[0]}else if(kind==="7"){handle.id="7";handle.x=subSections["7"].position[0]}return[
handle.id,handle.x,handle.y]};ShapeHandleScalingSubSection.prototype.doWeKeepRatio=function(e){
var keep=e.ctrlKey&&e.shiftKey;if(app.map.context.context==="Graphic")keep=!keep;return keep};
ShapeHandleScalingSubSection.prototype.onMouseUp=function(point,e){var _a;var _b,_c;if(
this.containerObject.isDraggingSomething()){this.stopPropagating();e.stopPropagation();
var keepRatio=this.doWeKeepRatio(e);var handleId=this.sectionProperties.ownInfo.id;
var parentHandlerSection=this.sectionProperties.parentHandlerSection;var x=(
_b=parentHandlerSection.sectionProperties.closestX)!==null&&_b!==void 0?_b:point.pX+this.position[0]
var y=(_c=parentHandlerSection.sectionProperties.closestY
)!==null&&_c!==void 0?_c:point.pY+this.position[1];if(keepRatio){_a=__read(this.overrideHandle(
this.sectionProperties.ownInfo.kind),3),handleId=_a[0],x=_a[1],y=_a[2]}var parameters={HandleNum:{
type:"long",value:handleId},NewPosX:{type:"long",value:Math.round(x*app.pixelsToTwips)},NewPosY:{
type:"long",value:Math.round(y*app.pixelsToTwips)}};app.map.sendUnoCommand(".uno:MoveShapeHandle",
parameters);parentHandlerSection.hideSVG()}window.IgnorePanning=false};
ShapeHandleScalingSubSection.prototype.adjustSVGProperties=function(shapeRecProps){if(
this.sectionProperties.parentHandlerSection.sectionProperties.svg){
var svg=this.sectionProperties.parentHandlerSection.sectionProperties.svg;
var scaleX=shapeRecProps.width/this.sectionProperties.parentHandlerSection.sectionProperties.shapeRectangleProperties.width
var scaleY=shapeRecProps.height/this.sectionProperties.parentHandlerSection.sectionProperties.shapeRectangleProperties.height
var diffX=shapeRecProps.center[0
]-this.sectionProperties.parentHandlerSection.sectionProperties.shapeRectangleProperties.center[0];
var diffY=shapeRecProps.center[1
]-this.sectionProperties.parentHandlerSection.sectionProperties.shapeRectangleProperties.center[1];
diffX=diffX/app.dpiScale;diffY=diffY/app.dpiScale;svg.children[0
].style.transform="translate("+Math.round(diffX)+"px, "+Math.round(diffY
)+"px)"+"rotate("+-shapeRecProps.angleRadian+"rad) scale("+scaleX+", "+scaleY+") rotate("+shapeRecProps.angleRadian+"rad)"
this.sectionProperties.parentHandlerSection.showSVG()}};
ShapeHandleScalingSubSection.prototype.calculateRatioPoint=function(point,shapeRecProps){
var isVerticalHandler=["2","7"].includes(this.sectionProperties.ownInfo.kind);
var primaryDelta=isVerticalHandler?point[1]-shapeRecProps.center[1]:point[0]-shapeRecProps.center[0]
var aspectRatio=isVerticalHandler?shapeRecProps.width/shapeRecProps.height:shapeRecProps.height/shapeRecProps.width
var secondaryDelta=primaryDelta*aspectRatio;var direction=["3","4","6","2"].includes(
this.sectionProperties.ownInfo.kind)?-1:1;if(isVerticalHandler){point[0]=shapeRecProps.center[0
]+secondaryDelta*direction}else{point[1]=shapeRecProps.center[1]+secondaryDelta*direction}
return point};ShapeHandleScalingSubSection.prototype.calculateNewShapeRectangleProperties=function(
point,e){var shapeRecProps=JSON.parse(JSON.stringify(
this.sectionProperties.parentHandlerSection.sectionProperties.shapeRectangleProperties));
var keepRatio=this.doWeKeepRatio(e);if(keepRatio){point=this.calculateRatioPoint(point,shapeRecProps
)}var diff=[point[0]-shapeRecProps.center[0],-(point[1]-shapeRecProps.center[1])];
var length=Math.pow(Math.pow(diff[0],2)+Math.pow(diff[1],2),.5);var pointAngle=Math.atan2(diff[1],
diff[0]);point[0]=shapeRecProps.center[0]+length*Math.cos(pointAngle-shapeRecProps.angleRadian);
point[1]=shapeRecProps.center[1]-length*Math.sin(pointAngle-shapeRecProps.angleRadian);
var rectangle=new cool.SimpleRectangle((shapeRecProps.center[0]-shapeRecProps.width*.5
)*app.pixelsToTwips,(shapeRecProps.center[1]-shapeRecProps.height*.5)*app.pixelsToTwips,
shapeRecProps.width*app.pixelsToTwips,shapeRecProps.height*app.pixelsToTwips);
var oldpCenter=rectangle.pCenter;if(["1","4","6"].includes(this.sectionProperties.ownInfo.kind)){
var pX2=rectangle.pX2;rectangle.pX1=point[0];rectangle.pX2=pX2}else if(["3","5","8"].includes(
this.sectionProperties.ownInfo.kind))rectangle.pX2=point[0];if(["1","2","3"].includes(
this.sectionProperties.ownInfo.kind)){var pY2=rectangle.pY2;rectangle.pY1=point[1];rectangle.pY2=pY2
}else if(["6","7","8"].includes(this.sectionProperties.ownInfo.kind))rectangle.pY2=point[1];if(
keepRatio){if(["4","5"].includes(this.sectionProperties.ownInfo.kind)){rectangle.pY2=point[1]
}else if(["2","7"].includes(this.sectionProperties.ownInfo.kind)){rectangle.pX2=point[0]}}
var centerAngle=Math.atan2(oldpCenter[1]-rectangle.pCenter[1],rectangle.pCenter[0]-oldpCenter[0]);
var centerLength=Math.pow(Math.pow(rectangle.pCenter[1]-oldpCenter[1],2)+Math.pow(rectangle.pCenter[
0]-oldpCenter[0],2),.5);var x=centerLength*Math.cos(shapeRecProps.angleRadian+centerAngle);
var y=centerLength*Math.sin(shapeRecProps.angleRadian+centerAngle);shapeRecProps.center[0]+=x;
shapeRecProps.center[1]-=y;shapeRecProps.width=rectangle.pWidth;
shapeRecProps.height=rectangle.pHeight;return shapeRecProps};
ShapeHandleScalingSubSection.prototype.moveHandlesOnDrag=function(point,e){
var shapeRecProps=this.calculateNewShapeRectangleProperties([point.pX+this.myTopLeft[0
]+app.activeDocument.activeView.viewedRectangle.pX1-this.containerObject.getDocumentAnchor()[0],
point.pY+this.myTopLeft[1
]+app.activeDocument.activeView.viewedRectangle.pY1-this.containerObject.getDocumentAnchor()[1]],e);
this.sectionProperties.parentHandlerSection.calculateInitialAnglesOfShapeHandlers(shapeRecProps);
var halfWidth=this.sectionProperties.parentHandlerSection.sectionProperties.handleWidth*.5;
var halfHeight=this.sectionProperties.parentHandlerSection.sectionProperties.handleHeight*.5;
var subSections=this.sectionProperties.parentHandlerSection.sectionProperties.subSections;var x=0,
y=0;var pointAngle=0;for(var i=0;i<subSections.length;i++){var subSection=subSections[i];
pointAngle=subSection.sectionProperties.initialAngle+shapeRecProps.angleRadian;
x=shapeRecProps.center[0]+subSection.sectionProperties.distanceToCenter*Math.cos(pointAngle);
y=shapeRecProps.center[1]-subSection.sectionProperties.distanceToCenter*Math.sin(pointAngle);
subSection.setPosition(x-halfWidth,y-halfHeight)}if(!this.sectionProperties.cropModeEnabled
)this.adjustSVGProperties(shapeRecProps)};
ShapeHandleScalingSubSection.prototype.onMouseMove=function(point,dragDistance,e){if(
this.containerObject.isDraggingSomething()){window.IgnorePanning=true;this.stopPropagating();
e.stopPropagation();
this.sectionProperties.parentHandlerSection.sectionProperties.svg.style.opacity=.5;
this.moveHandlesOnDrag(point,e);
this.sectionProperties.parentHandlerSection.checkHelperLinesAndSnapPoints([0,0],this.position,[0,0])
this.containerObject.requestReDraw();this.sectionProperties.parentHandlerSection.showSVG()
}else window.IgnorePanning=false};return ShapeHandleScalingSubSection}(CanvasSectionObject);
app.definitions.shapeHandleScalingSubSection=ShapeHandleScalingSubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ValidityInputHelpSection=function(_super){__extends(
ValidityInputHelpSection,_super);function ValidityInputHelpSection(sectionName,objectWidth,
objectHeight,documentPosition,extraClass,showSection){if(extraClass===void 0){extraClass=""}if(
showSection===void 0){showSection=true}return _super.call(this,sectionName,objectWidth,objectHeight,
documentPosition,extraClass,showSection)||this}
ValidityInputHelpSection.showValidityInputHelp=function(textMsg,documentPosition){
var message=textMsg.replace("validityinputhelp: ","");message=JSON.parse(message);
var section=new ValidityInputHelpSection(ValidityInputHelpSection.sectionName,null,null,
documentPosition,ValidityInputHelpSection.className,true);app.sectionContainer.addSection(section);
var objectDiv=section.getHTMLObject();var title=document.createElement("h4");
title.textContent=message.title;objectDiv.appendChild(title);var content=document.createElement("p")
content.textContent=message.content;objectDiv.appendChild(content)};
ValidityInputHelpSection.removeValidityInputHelp=function(){if(
app.sectionContainer.doesSectionExist(ValidityInputHelpSection.sectionName)
)app.sectionContainer.removeSection(ValidityInputHelpSection.sectionName)};
ValidityInputHelpSection.sectionName="Validity Input Help";
ValidityInputHelpSection.className="input-help";return ValidityInputHelpSection}(HTMLObjectSection);
app.definitions.validityInputHelpSection=ValidityInputHelpSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CellCursorSection=function(_super){__extends(
CellCursorSection,_super);function CellCursorSection(color,weight,viewId){var _this=_super.call(this
,app.CSections.CellCursor.name)||this;_this.zIndex=app.CSections.CellCursor.zIndex;
_this.drawingOrder=app.CSections.CellCursor.drawingOrder;
_this.processingOrder=app.CSections.CellCursor.processingOrder;_this.documentObject=true;
_this.sectionProperties.viewId=viewId;_this.sectionProperties.weight=weight;
_this.sectionProperties.color=color;_this.sectionProperties.mouseInside=true;return _this}
CellCursorSection.prototype.getViewId=function(){return this.sectionProperties.viewId};
CellCursorSection.prototype.setViewId=function(viewId){this.sectionProperties.viewId=viewId};
CellCursorSection.adjustSizePos=function(defaultSizePos){
var splitPos=app.map._docLayer._splitPanesContext?app.map._docLayer._splitPanesContext.getSplitPos(
):null;if(
!splitPos||splitPos.x===0&&splitPos.y===0||!app.activeDocument||app.activeDocument.activeView.viewedRectangle.pX1===0&&app.activeDocument.activeView.viewedRectangle.pY1===0
)return defaultSizePos;if(defaultSizePos[0]<splitPos.x&&defaultSizePos[0]+defaultSizePos[2
]>splitPos.x)defaultSizePos[2]=Math.max(splitPos.x-defaultSizePos[0],defaultSizePos[2
]-app.activeDocument.activeView.viewedRectangle.pX1);if(defaultSizePos[0
]>=splitPos.x&&app.activeDocument.activeView.viewedRectangle.pX1+splitPos.x>defaultSizePos[0]){
defaultSizePos[2]=defaultSizePos[0]+defaultSizePos[2]-(
app.activeDocument.activeView.viewedRectangle.pX1+splitPos.x);defaultSizePos[0
]=splitPos.x+app.activeDocument.activeView.viewedRectangle.pX1}if(defaultSizePos[1
]<splitPos.y&&defaultSizePos[1]+defaultSizePos[3]>splitPos.y)defaultSizePos[3]=Math.max(
splitPos.y-defaultSizePos[1],defaultSizePos[3]-app.activeDocument.activeView.viewedRectangle.pY1);
if(defaultSizePos[1
]>=splitPos.y&&app.activeDocument.activeView.viewedRectangle.pY1+splitPos.y>defaultSizePos[1]){
defaultSizePos[3]=defaultSizePos[1]+defaultSizePos[3]-(
app.activeDocument.activeView.viewedRectangle.pY1+splitPos.y);defaultSizePos[1
]=splitPos.y+app.activeDocument.activeView.viewedRectangle.pY1}return defaultSizePos};
CellCursorSection.prototype.onDraw=function(){if(app.calc.cellCursorVisible){
this.context.lineJoin="miter";this.context.lineCap="butt";this.context.lineWidth=1;
this.context.strokeStyle=this.sectionProperties.color;
var tempSizePos=CellCursorSection.adjustSizePos([this.position[0],this.position[1],this.size[0],
this.size[1]]);var x=tempSizePos[0]-this.position[0];var y=tempSizePos[1]-this.position[1];if(
app.calc.isRTL()){var rightMost=this.containerObject.getDocumentAnchor()[0
]+this.containerObject.getDocumentAnchorSection().size[0];x=rightMost-tempSizePos[2]+(tempSizePos[0
]-this.position[0])}for(var i=0;i<this.sectionProperties.weight;i++)this.context.strokeRect(x+-.5-i,
y-.5-i,tempSizePos[2]+i*2,tempSizePos[3]+i*2);if(window.prefs.getBoolean("darkTheme")){
this.context.strokeStyle="white";var diff=1;this.context.strokeRect(x+-.5+diff,y-.5+diff,
tempSizePos[2]-2*diff,tempSizePos[3]-2*diff);this.context.strokeRect(x+-.5+diff,y-.5+diff,
tempSizePos[2]-2*diff,tempSizePos[3]-2*diff)}}};CellCursorSection.prototype.onMouseEnter=function(
point,e){this.sectionProperties.mouseInside=true;if(!app.file.textCursor.visible)return;
var grid=document.querySelector(".leaflet-map-pane");grid.classList.remove("spreadsheet-cursor");
grid.style.cursor="text"};CellCursorSection.prototype.onMouseLeave=function(point,e){
this.sectionProperties.mouseInside=false;var grid=document.querySelector(".leaflet-map-pane");
grid.classList.add("spreadsheet-cursor");grid.style.cursor=""};
CellCursorSection.prototype.onClick=function(point,e){this.sectionProperties.mouseInside=true};
return CellCursorSection}(CanvasSectionObject);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var CellSelectionHandle=function(_super){__extends(CellSelectionHandle,_super);
function CellSelectionHandle(name){var _this=_super.call(this,name)||this;_this.showSection=false;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder;
_this.zIndex=app.CSections.DefaultForDocumentObjects.zIndex;_this.documentObject=true;
_this.sectionProperties.circleRadius=10*app.dpiScale;_this.size=[
_this.sectionProperties.circleRadius*2,_this.sectionProperties.circleRadius*2];return _this}
CellSelectionHandle.prototype.onDragEnd=function(point){app.map.focus();app.map.fire(
"scrollvelocity",{vx:0,vy:0});point.pX+=this.position[0];point.pY+=this.position[1];
this.sharedOnDragAndEnd(point);CellSelectionMarkers.update();app.map.scrollingIsHandled=false};
CellSelectionHandle.prototype.sharedOnDragAndEnd=function(point){
var type=this.name==="cell_selection_handle_start"?"start":"end";
app.map._docLayer._postSelectTextEvent(type,point.x,point.y)};
CellSelectionHandle.prototype.onDrag=function(point){point.pX+=this.position[0];
point.pY+=this.position[1];app.map.fire("handleautoscroll",{pos:{x:point.cX,y:point.cY},map:app.map}
);this.sharedOnDragAndEnd(point)};CellSelectionHandle.prototype.onDraw=function(){
this.context.strokeStyle=window.prefs.getBoolean("darkTheme")?"white":"black";
this.context.lineWidth=2;this.context.beginPath();this.context.arc(
this.sectionProperties.circleRadius,this.sectionProperties.circleRadius,
this.sectionProperties.circleRadius,0,2*Math.PI);this.context.stroke()};
CellSelectionHandle.prototype.onMouseMove=function(point,dragDistance,e){e.stopPropagation();if(
this.containerObject.isDraggingSomething()){app.map.scrollingIsHandled=true;this.stopPropagating();
this.onDrag(point)}};CellSelectionHandle.prototype.onMouseDown=function(point,e){e.stopPropagation()
this.stopPropagating()};CellSelectionHandle.prototype.onMouseUp=function(point,e){e.stopPropagation(
);if(this.containerObject.isDraggingSomething()){this.stopPropagating();this.onDragEnd(point)}};
return CellSelectionHandle}(CanvasSectionObject);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var CalcValidityDropDown=function(_super){__extends(CalcValidityDropDown,_super);
function CalcValidityDropDown(documentPosition,visible){if(visible===void 0){visible=true}
var _this=_super.call(this,app.CSections.CalcValidityDropDown.name,
CalcValidityDropDown.dropDownArrowSize,CalcValidityDropDown.dropDownArrowSize,documentPosition,
"spreadsheet-drop-down-marker",visible)||this;_this.zIndex=app.CSections.CalcValidityDropDown.zIndex
_this.sectionProperties.mouseEntered=false;return _this}
CalcValidityDropDown.prototype.onMouseEnter=function(point,e){
this.sectionProperties.mouseEntered=true};CalcValidityDropDown.prototype.onMouseLeave=function(){
this.sectionProperties.mouseEntered=false};CalcValidityDropDown.prototype.onClick=function(point,e){
e.stopPropagation();e.preventDefault();this.stopPropagating();point.pX=this.position[0]+this.size[0
]/2;point.pY=this.position[1]+this.size[1]/2;app.map._docLayer._postMouseEvent("buttondown",point.x,
point.y,1,1,0);app.map._docLayer._postMouseEvent("buttonup",point.x,point.y,1,1,0)};
CalcValidityDropDown.dropDownArrowSize=16;return CalcValidityDropDown}(HTMLObjectSection);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var TextSelectionHandle=function(_super){__extends(
TextSelectionHandle,_super);function TextSelectionHandle(sectionName,objectWidth,objectHeight,
documentPosition,extraClass,showSection){if(extraClass===void 0){extraClass=""}if(
showSection===void 0){showSection=false}var _this=_super.call(this,sectionName,objectWidth,
objectHeight,documentPosition,extraClass,showSection)||this;_this._showSection=true;return _this}
TextSelectionHandle.prototype.onDrag=function(point){window.IgnorePanning=true;
var candidateX=Math.round((this.myTopLeft[0]+point.pX)/app.dpiScale);var candidateY=Math.round((
this.myTopLeft[1]+point.pY)/app.dpiScale);
this.sectionProperties.objectDiv.style.left=candidateX+"px";
this.sectionProperties.objectDiv.style.top=candidateY+"px";app.map.fire("handleautoscroll",{pos:{
x:candidateX,y:candidateY},map:app.map})};TextSelectionHandle.prototype.setShowSection=function(show
){this._showSection=show;if(!window.touch.currentlyUsingTouchscreen()){
_super.prototype.setShowSection.call(this,false)}else{_super.prototype.setShowSection.call(this,
this._showSection)}};TextSelectionHandle.prototype.setOpacity=function(value){this.getHTMLObject(
).style.opacity=value};TextSelectionHandle.prototype.onDragEnd=function(point){
window.IgnorePanning=undefined;var x=this.position[0]+point.pX;var y=this.position[1]+point.pY;
this.setPosition(x,y);app.map.fire("scrollvelocity",{vx:0,vy:0});
var type=this.name==="selection_start_handle"?"start":"end";if(type==="start")x+=30/app.dpiScale;if(
!app.map._docLayer.isCalcRTL()){app.map._docLayer._postSelectTextEvent(type,Math.round(
x*app.pixelsToTwips),Math.round(y*app.pixelsToTwips))}else{
var referenceX=app.activeDocument.activeView.viewedRectangle.pX1+(
app.activeDocument.activeView.viewedRectangle.pX2-this.position[0]);
app.map._docLayer._postSelectTextEvent(type,Math.round(referenceX*app.pixelsToTwips),Math.round(
y*app.pixelsToTwips))}};TextSelectionHandle.prototype.onMouseMove=function(point,dragDistance,e){
e.stopPropagation();if(this.containerObject.isDraggingSomething()){this.stopPropagating();
this.onDrag(point)}};TextSelectionHandle.prototype.onDocumentObjectVisibilityChange=function(){if(
this.showSection&&this.isVisible
)this.sectionProperties.objectDiv.style.display="";else this.sectionProperties.objectDiv.style.display="none"
};TextSelectionHandle.prototype.onClick=function(point,e){e.stopPropagation();this.stopPropagating()
};TextSelectionHandle.prototype.onMouseDown=function(point,e){e.stopPropagation();
this.stopPropagating()};TextSelectionHandle.prototype.onMouseUp=function(point,e){e.stopPropagation(
);if(this.containerObject.isDraggingSomething()){this.stopPropagating();this.onDragEnd(point)}};
return TextSelectionHandle}(HTMLObjectSection);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var OtherViewGraphicSelectionSection=function(_super){__extends(OtherViewGraphicSelectionSection,
_super);function OtherViewGraphicSelectionSection(viewId,rectangle,part,mode){var _this=_super.call(
this,OtherViewGraphicSelectionSection.sectionNamePrefix+viewId)||this;_this.documentObject=true;
_this.interactable=false;_this.zIndex=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;_this.size=[
rectangle.pWidth,rectangle.pHeight];_this.position=[rectangle.pX1,rectangle.pY1];
_this.sectionProperties.color=app.LOUtil.rgbToHex(app.LOUtil.getViewIdColor(viewId));
_this.sectionProperties.viewId=viewId;_this.sectionProperties.part=part;
_this.sectionProperties.mode=mode;return _this}
OtherViewGraphicSelectionSection.prototype.onDraw=function(frameCount,elapsedTime){
this.context.strokeStyle=this.sectionProperties.color;this.context.lineWidth=2;
this.context.strokeRect(-.5,-.5,this.size[0],this.size[1])};
OtherViewGraphicSelectionSection.prototype.checkMyVisibility=function(){var result=this.size[0
]>0&&this.size[1]>0;if(result){if(!app.map._docLayer.isWriter()){if(
this.sectionProperties.part!==app.map._docLayer._selectedPart||this.sectionProperties.mode!==app.map._docLayer._selectedMode
)result=false}}return result};
OtherViewGraphicSelectionSection.addOrUpdateGraphicSelectionIndicator=function(viewId,rectangleData,
part,mode){var rectangle=new cool.SimpleRectangle(0,0,0,0);if(rectangleData
)rectangle=new cool.SimpleRectangle(parseInt(rectangleData[0]),parseInt(rectangleData[1]),parseInt(
rectangleData[2]),parseInt(rectangleData[3]));
var sectionName=OtherViewGraphicSelectionSection.sectionNamePrefix+viewId;var section;if(
app.sectionContainer.doesSectionExist(sectionName)){section=app.sectionContainer.getSectionWithName(
sectionName);section.sectionProperties.part=part;section.sectionProperties.mode=mode;section.size[0
]=rectangle.pWidth;section.size[1]=rectangle.pHeight;section.setPosition(rectangle.pX1,rectangle.pY1
)}else{section=new OtherViewGraphicSelectionSection(viewId,rectangle,part,mode);
app.sectionContainer.addSection(section);OtherViewGraphicSelectionSection.sectionPointers.push(
section)}section.setShowSection(section.checkMyVisibility());app.sectionContainer.requestReDraw()};
OtherViewGraphicSelectionSection.removeView=function(viewId){
var sectionName=OtherViewGraphicSelectionSection.sectionNamePrefix+viewId;if(
app.sectionContainer.doesSectionExist(sectionName)){
var section=app.sectionContainer.getSectionWithName(sectionName);
OtherViewGraphicSelectionSection.sectionPointers.splice(
OtherViewGraphicSelectionSection.sectionPointers.indexOf(section),1);
app.sectionContainer.removeSection(sectionName);app.sectionContainer.requestReDraw()}};
OtherViewGraphicSelectionSection.updateVisibilities=function(){for(
var i=0;i<OtherViewGraphicSelectionSection.sectionPointers.length;i++){
var section=OtherViewGraphicSelectionSection.sectionPointers[i];section.setShowSection(
section.checkMyVisibility())}app.sectionContainer.requestReDraw()};
OtherViewGraphicSelectionSection.sectionNamePrefix="OtherViewGraphicSelection ";
OtherViewGraphicSelectionSection.sectionPointers=[];return OtherViewGraphicSelectionSection}(
CanvasSectionObject);
app.definitions.otherViewGraphicSelectionSection=OtherViewGraphicSelectionSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var OtherViewCellCursorSection=function(_super){__extends(
OtherViewCellCursorSection,_super);function OtherViewCellCursorSection(viewId,rectangle,part){
var _this=_super.call(this,OtherViewCellCursorSection.sectionNamePrefix+viewId)||this;
_this.documentObject=true;_this.interactable=false;_this.zIndex=app.CSections.ColumnHeader.zIndex;
_this.drawingOrder=app.CSections.OtherViewCellCursor.drawingOrder;
_this.processingOrder=app.CSections.OtherViewCellCursor.processingOrder;_this.size=[rectangle.pWidth
,rectangle.pHeight];_this.position=[rectangle.pX1,rectangle.pY1];
_this.sectionProperties.color=app.LOUtil.rgbToHex(app.LOUtil.getViewIdColor(viewId));
_this.sectionProperties.viewId=viewId;_this.sectionProperties.part=part;
_this.sectionProperties.popUpContainer=null;_this.sectionProperties.popUpShown=false;
_this.sectionProperties.username=null;_this.sectionProperties.popUpTimer=null;return _this}
OtherViewCellCursorSection.prototype.onDraw=function(frameCount,elapsedTime){if(
app.map._docLayer._isZooming)return;this.adjustPopUpPosition();
var tempSizePos=CellCursorSection.adjustSizePos([this.position[0],this.position[1],this.size[0],
this.size[1]]);var x=tempSizePos[0]-this.position[0];var y=tempSizePos[1]-this.position[1];
this.context.strokeStyle=this.sectionProperties.color;this.context.lineWidth=2;
this.context.strokeRect(x-.5,y-.5,tempSizePos[2],tempSizePos[3])};
OtherViewCellCursorSection.prototype.checkMyVisibility=function(){if(
app.map._docLayer._selectedPart!==this.sectionProperties.part)return false;else return true};
OtherViewCellCursorSection.prototype.adjustPopUpPosition=function(){
var width=this.sectionProperties.popUpContainer.getBoundingClientRect().width;
var height=this.sectionProperties.popUpContainer.getBoundingClientRect().height;var pos=[
this.myTopLeft[0]/app.dpiScale+this.size[0]*.5/app.dpiScale-width*.5,this.myTopLeft[1
]/app.dpiScale-(height+15)];this.sectionProperties.popUpContainer.style.left=pos[0]+"px";
this.sectionProperties.popUpContainer.style.top=pos[1]+"px";if(!this.showSection
)this.hideUsernamePopUp()};OtherViewCellCursorSection.prototype.onNewDocumentTopLeft=function(){
this.adjustPopUpPosition()};OtherViewCellCursorSection.prototype.prepareUsernamePopUp=function(){if(
this.sectionProperties.popUpContainer===null){var popUpContainer=document.createElement("div");
popUpContainer.className="username-pop-up";var nameContainer=document.createElement("div");
popUpContainer.appendChild(nameContainer);var nameParagraph=document.createElement("p");
nameContainer.appendChild(nameParagraph);nameParagraph.textContent=this.sectionProperties.username;
var arrowDiv=document.createElement("div");arrowDiv.className="arrow-div";
popUpContainer.appendChild(arrowDiv);
popUpContainer.style.backgroundColor=nameContainer.style.backgroundColor=this.sectionProperties.color
arrowDiv.style.backgroundColor=nameParagraph.style.backgroundColor=this.sectionProperties.color;
document.getElementById("document-container").appendChild(popUpContainer);
this.sectionProperties.popUpContainer=popUpContainer;this.hideUsernamePopUp()}};
OtherViewCellCursorSection.prototype.clearPopUpTimer=function(){if(this.sectionProperties.popUpTimer
){clearTimeout(this.sectionProperties.popUpTimer);this.sectionProperties.popUpTimer=null}};
OtherViewCellCursorSection.prototype.showUsernamePopUp=function(){var _this=this;
var textCursorSectionName=CursorHeaderSection.namePrefix+this.sectionProperties.viewId;if(
app.sectionContainer.doesSectionExist(textCursorSectionName))return;if(
this.sectionProperties.popUpContainer&&this.isVisible){this.adjustPopUpPosition();
this.sectionProperties.popUpShown=true;this.sectionProperties.popUpContainer.style.display="";
this.clearPopUpTimer();this.sectionProperties.popUpTimer=setTimeout(function(){
_this.hideUsernamePopUp()},3e3)}};OtherViewCellCursorSection.prototype.hideUsernamePopUp=function(){
if(this.sectionProperties.popUpContainer){this.sectionProperties.popUpShown=false;if(
this.sectionProperties.popUpContainer.style.display!=="none"
)this.sectionProperties.popUpContainer.style.display="none"}this.clearPopUpTimer()};
OtherViewCellCursorSection.prototype.onDocumentObjectVisibilityChange=function(){if(
this.sectionProperties.popUpShown&&!this.isVisible)this.hideUsernamePopUp()};
OtherViewCellCursorSection.addOrUpdateOtherViewCellCursor=function(viewId,username,rectangleData,
part){var rectangle=new cool.SimpleRectangle(0,0,0,0);if(rectangleData
)rectangle=new cool.SimpleRectangle(parseInt(rectangleData[0]),parseInt(rectangleData[1]),parseInt(
rectangleData[2]),parseInt(rectangleData[3]));
var sectionName=OtherViewCellCursorSection.sectionNamePrefix+viewId;var section;var newSection=false
if(app.sectionContainer.doesSectionExist(sectionName)){
section=app.sectionContainer.getSectionWithName(sectionName);section.sectionProperties.part=part;
section.size[0]=rectangle.pWidth;section.size[1]=rectangle.pHeight;section.setPosition(rectangle.pX1
,rectangle.pY1)}else{section=new OtherViewCellCursorSection(viewId,rectangle,part);
app.sectionContainer.addSection(section);OtherViewCellCursorSection.sectionPointers.push(section);
newSection=true}section.sectionProperties.username=username;section.prepareUsernamePopUp();
section.setShowSection(section.checkMyVisibility());if(section.showSection&&!newSection
)section.showUsernamePopUp();if(!section.showSection)section.hideUsernamePopUp();
app.sectionContainer.requestReDraw()};OtherViewCellCursorSection.removeView=function(viewId){
var sectionName=OtherViewCellCursorSection.sectionNamePrefix+viewId;if(
app.sectionContainer.doesSectionExist(sectionName)){
var section=app.sectionContainer.getSectionWithName(sectionName);
OtherViewCellCursorSection.sectionPointers.splice(
OtherViewCellCursorSection.sectionPointers.indexOf(section),1);app.sectionContainer.removeSection(
sectionName);app.sectionContainer.requestReDraw()}};
OtherViewCellCursorSection.updateVisibilities=function(){for(
var i=0;i<OtherViewCellCursorSection.sectionPointers.length;i++){
var section=OtherViewCellCursorSection.sectionPointers[i];var newState=section.checkMyVisibility();
if(newState!==section.showSection){section.setShowSection(newState);if(newState===false
)section.hideUsernamePopUp()}}app.sectionContainer.requestReDraw()};
OtherViewCellCursorSection.closePopups=function(){for(
var i=0;i<OtherViewCellCursorSection.sectionPointers.length;i++
)OtherViewCellCursorSection.sectionPointers[i].hideUsernamePopUp()};
OtherViewCellCursorSection.getViewCursorSection=function(viewId){
var name=OtherViewCellCursorSection.sectionNamePrefix+viewId;
return app.sectionContainer.getSectionWithName(name)};
OtherViewCellCursorSection.doesViewCursorExist=function(viewId){
var name=OtherViewCellCursorSection.sectionNamePrefix+viewId;
return app.sectionContainer.doesSectionExist(name)};
OtherViewCellCursorSection.showPopUpForView=function(viewId){if(
OtherViewCellCursorSection.doesViewCursorExist(viewId)){
var section=OtherViewCellCursorSection.getViewCursorSection(viewId);section.showUsernamePopUp()}};
OtherViewCellCursorSection.sectionNamePrefix="OtherViewCellCursorSection ";
OtherViewCellCursorSection.sectionPointers=[];return OtherViewCellCursorSection}(CanvasSectionObject
);app.definitions.otherViewCellCursorSection=OtherViewCellCursorSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var OtherViewCursorSection=function(_super){__extends(
OtherViewCursorSection,_super);function OtherViewCursorSection(viewId,color,rectangle,part,mode){
var _this=_super.call(this,OtherViewCursorSection.sectionNamePrefix+viewId,
rectangle.pWidth/app.dpiScale,rectangle.pHeight/app.dpiScale,new cool.SimplePoint(rectangle.x1,
rectangle.y1))||this;_this.documentObject=true;_this.interactable=false;
_this.zIndex=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.drawingOrder=app.CSections.DefaultForDocumentObjects.drawingOrder;
_this.processingOrder=app.CSections.DefaultForDocumentObjects.processingOrder;
_this.sectionProperties.color=color;_this.sectionProperties.viewId=viewId;
_this.sectionProperties.part=part;_this.sectionProperties.mode=mode;
_this.sectionProperties.showCursor=true;_this.showSection=true;_this.getHTMLObject(
).style.backgroundColor=_this.sectionProperties.color;return _this}
OtherViewCursorSection.prototype.checkMyVisibility=function(){
var result=this.sectionProperties.showCursor&&this.size[1]>0;if(result){if(
!app.map._docLayer.isWriter()){if(
this.sectionProperties.part!==app.map._docLayer._selectedPart||this.sectionProperties.mode!==app.map._docLayer._selectedMode
)result=false}}if(result&&app.file.textCursor.visible){var pos=[app.file.textCursor.rectangle.pX1,
app.file.textCursor.rectangle.pY1];if(this.position[0]===pos[0]&&this.position[1]===pos[1]
)result=false}if(result&&app.map.isViewReadOnly(this.sectionProperties.viewId))result=false;
return result};OtherViewCursorSection.addOrUpdateOtherViewCursor=function(viewId,username,
rectangleData,part,mode){var rectangle=new cool.SimpleRectangle(0,0,0,0);
var color=app.LOUtil.rgbToHex(app.LOUtil.getViewIdColor(viewId));if(rectangleData){
rectangle=new cool.SimpleRectangle(parseInt(rectangleData[0]),parseInt(rectangleData[1]),parseInt(
rectangleData[2]),parseInt(rectangleData[3]))}rectangle.pWidth=2*app.dpiScale;
var sectionName=OtherViewCursorSection.sectionNamePrefix+viewId;var section;if(
app.sectionContainer.doesSectionExist(sectionName)){section=app.sectionContainer.getSectionWithName(
sectionName);section.sectionProperties.part=part;section.sectionProperties.mode=mode;section.size[0
]=rectangle.pWidth;section.size[1]=rectangle.pHeight;section.getHTMLObject(
).style.width=section.size[0]/app.dpiScale+"px";section.getHTMLObject().style.height=section.size[1
]/app.dpiScale+"px";section.setPosition(rectangle.pX1,rectangle.pY1)}else{
section=new OtherViewCursorSection(viewId,color,rectangle,part,mode);
app.sectionContainer.addSection(section);OtherViewCursorSection.sectionPointers.push(section)}
section.setShowSection(section.checkMyVisibility());section.onNewDocumentTopLeft();
section.adjustHTMLObjectPosition();var documentPosition=new cool.SimplePoint(section.position[0
]*app.pixelsToTwips,(section.position[1]-20)*app.pixelsToTwips);if(
section.showSection&&section.isVisible)app.definitions.cursorHeaderSection.showCursorHeader(viewId,
username,documentPosition,color);app.sectionContainer.requestReDraw()};
OtherViewCursorSection.removeView=function(viewId){
var sectionName=OtherViewCursorSection.sectionNamePrefix+viewId;if(
app.sectionContainer.doesSectionExist(sectionName)){
var section=app.sectionContainer.getSectionWithName(sectionName);
OtherViewCursorSection.sectionPointers.splice(OtherViewCursorSection.sectionPointers.indexOf(section
),1);app.sectionContainer.removeSection(sectionName);app.sectionContainer.requestReDraw()}};
OtherViewCursorSection.doesViewCursorSectionExist=function(viewId){
var name=OtherViewCursorSection.sectionNamePrefix+viewId;
return app.sectionContainer.doesSectionExist(name)};
OtherViewCursorSection.getViewCursorSection=function(viewId){if(
OtherViewCursorSection.doesViewCursorSectionExist(viewId)){
var name_1=OtherViewCursorSection.sectionNamePrefix+viewId;
return app.sectionContainer.getSectionWithName(name_1)}else return null};
OtherViewCursorSection.updateVisibilities=function(hideCursors){if(hideCursors===void 0){
hideCursors=false}for(var i=0;i<OtherViewCursorSection.sectionPointers.length;i++){
var section=OtherViewCursorSection.sectionPointers[i];section.setShowSection(
section.checkMyVisibility());if(hideCursors)section.getHTMLObject(
).style.opacity="0";else section.getHTMLObject().style.opacity="1"}
app.sectionContainer.requestReDraw()};OtherViewCursorSection.sectionNamePrefix="OtherViewCursor ";
OtherViewCursorSection.sectionPointers=[];return OtherViewCursorSection}(HTMLObjectSection);
app.definitions.otherViewCursorSection=OtherViewCursorSection;var CEventsHandler=function(){
function CEventsHandler(){this.supportedEventNames=["add","remove","mouseenter","mouseleave"];
this.handlers=new Map;var handlers=this.handlers;this.supportedEventNames.forEach(function(eName){
handlers.set(eName,new Set)})}CEventsHandler.prototype.addSupportedEvents=function(eventNames){for(
var i=0;i<eventNames.length;++i){var eName=eventNames[i];if(this.handlers.has(eName))continue;
this.supportedEventNames.push(eName);this.handlers.set(eName,new Set)}};
CEventsHandler.prototype.on=function(eventName,handler){var handlerSet=this.handlers.get(eventName);
if(handlerSet===undefined){console.warn(
"Unknown event type: "+eventName+" used to register a handler");return false}handlerSet.add(handler)
};CEventsHandler.prototype.off=function(eventName,handler){var handlerSet=this.handlers.get(
eventName);if(handlerSet===undefined){console.warn(
"Unknown event type: "+eventName+" used to unregister a handler");return false}
var removed=handlerSet.delete(handler);if(!removed){console.warn("Unregistered handler!");
return false}return true};CEventsHandler.prototype.fire=function(eventName,eventData){
var handlerSet=this.handlers.get(eventName);if(handlerSet===undefined){console.warn(
"Unknown event type: "+eventName);return false}handlerSet.forEach(function(handler){handler.call(
this,eventData)},this)};return CEventsHandler}();var CPointSet=function(){function CPointSet(){}
CPointSet.fromPointArray=function(array){var ps=new CPointSet;ps.points=array;return ps};
CPointSet.fromSetArray=function(array){var ps=new CPointSet;ps.pointSets=array;return ps};
CPointSet.fromBounds=function(bounds){var ps=new CPointSet;ps.points=[bounds.getTopLeft(),
bounds.getTopRight(),bounds.getBottomRight(),bounds.getBottomLeft()];return ps};
CPointSet.prototype.isFlat=function(){return this.points!==undefined};
CPointSet.prototype.empty=function(){
return this.points===undefined&&this.pointSets===undefined||this.pointSets===undefined&&this.points.length==0
};CPointSet.prototype.getPointArray=function(){return this.points};
CPointSet.prototype.getSetArray=function(){return this.pointSets};
CPointSet.prototype.setPointArray=function(array){this.points=array;this.pointSets=undefined};
CPointSet.prototype.setSetArray=function(array){this.points=undefined;this.pointSets=array};
CPointSet.prototype.applyOffset=function(offset,centroidSymmetry,preRound){if(
centroidSymmetry===void 0){centroidSymmetry=false}if(preRound===void 0){preRound=true}
CPointSet.applyOffsetImpl(this,offset,centroidSymmetry,preRound)};
CPointSet.prototype.clone=function(){return CPointSet.cloneImpl(this)};CPointSet.cloneImpl=function(
source){var newPointSet=new CPointSet;if(source.points){newPointSet.points=[];source.points.forEach(
function(point){newPointSet.points.push(point.clone())})}else if(source.pointSets){
newPointSet.pointSets=[];source.pointSets.forEach(function(childPointSet){
var clonedChild=CPointSet.cloneImpl(childPointSet);newPointSet.pointSets.push(clonedChild)})}
return newPointSet};CPointSet.applyOffsetImpl=function(pointSet,offset,centroidSymmetry,preRound){
if(pointSet.empty())return;if(pointSet.isFlat()){var refPoint_1=new cool.Point(Infinity,Infinity);
if(centroidSymmetry){refPoint_1.x=0;refPoint_1.y=0;pointSet.points.forEach(function(point){
refPoint_1._add(point)});refPoint_1._divideBy(pointSet.points.length)}pointSet.points.forEach(
function(point,index){if(preRound)pointSet.points[index]._round();if(point.x<refPoint_1.x
)pointSet.points[index].x-=offset.x;else pointSet.points[index].x+=offset.x;if(point.y<refPoint_1.y
)pointSet.points[index].y-=offset.y;else pointSet.points[index].y+=offset.y});return}
pointSet.pointSets.forEach(function(childPointSet){CPointSet.applyOffsetImpl(childPointSet,offset,
centroidSymmetry,preRound)})};return CPointSet}();var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};var CPath=function(_super){
__extends(CPath,_super);function CPath(options){var _this=_super.call(this)||this;_this.name="";
_this.stroke=true;_this.color="#3388ff";_this.weight=3;_this.opacity=1;_this.lineCap="round";
_this.lineJoin="round";_this.fill=false;_this.fillGradient=false;_this.fillColor=_this.color;
_this.fillOpacity=.2;_this.fillRule="evenodd";_this.interactive=true;_this.fixed=false;
_this.thickness=2;_this.viewId=-1;_this.groupType=PathGroupType.Other;_this.radius=0;_this.radiusY=0
_this.zIndex=0;_this.isDeleted=false;_this.renderer=null;_this.underMouse=false;
_this.popupHandlersAdded=false;_this.setStyleOptions(options);
_this.radius=options.radius!==undefined?options.radius:_this.radius;
_this.radiusY=options.radiusY!==undefined?options.radiusY:_this.radiusY;
_this.point=options.point!==undefined?options.point:_this.point;
_this.toCompatUnits=options.toCompatUnits!==undefined?options.toCompatUnits:_this.toCompatUnits;
_this.viewId=CPath.getViewId(options);if(options.groupType!==undefined
)_this.groupType=options.groupType;CPath.countObjects+=1;_this.id=CPath.countObjects;
_this.zIndex=_this.id;_this.addSupportedEvents(["popupopen","popupclose"]);return _this}
CPath.getViewId=function(options){if(options.viewId===undefined||options.viewId===null
)return-1;else return parseInt(options.viewId)};CPath.prototype.setStyleOptions=function(options){
this.name=options.name!==undefined?options.name:this.name;
this.stroke=options.stroke!==undefined?options.stroke:this.stroke;
this.color=options.color!==undefined?options.color:this.color;
this.weight=options.weight!==undefined?options.weight:this.weight;
this.opacity=options.opacity!==undefined?options.opacity:this.opacity;
this.lineCap=options.lineCap!==undefined?options.lineCap:this.lineCap;
this.lineJoin=options.lineJoin!==undefined?options.lineJoin:this.lineJoin;
this.fill=options.fill!==undefined?options.fill:this.fill;
this.fillColor=options.fillColor!==undefined?options.fillColor:this.fillColor;
this.fillOpacity=options.fillOpacity!==undefined?options.fillOpacity:this.fillOpacity;
this.fillRule=options.fillRule!==undefined?options.fillRule:this.fillRule;
this.cursorType=options.cursorType!==undefined?options.cursorType:this.cursorType;
this.thickness=options.thickness!==undefined?options.thickness:this.thickness;
this.interactive=options.interactive!==undefined?options.interactive:this.interactive;
this.fixed=options.fixed!==undefined?options.fixed:this.fixed};CPath.prototype.setRenderer=function(
rendererObj){this.renderer=rendererObj;if(this.renderer){this.addPathTestDiv()}this.fire("add",{})};
CPath.prototype.addPathTestDiv=function(){var testContainer=this.renderer.getTestDiv();if(
testContainer&&!this.testDiv){this.testDiv=document.createElement("div");
this.testDiv.id="test-div-overlay-"+this.name;testContainer.appendChild(this.testDiv)}};
CPath.prototype.updateTestData=function(){if(!this.testDiv)return;var bounds=this.getBounds();if(
this.empty()||!bounds.isValid()){this.testDiv.innerText="{}";return}var topLeft=bounds.getTopLeft();
var size=bounds.getSize();this.testDiv.innerText=JSON.stringify({top:Math.round(topLeft.y),
left:Math.round(topLeft.x),width:Math.round(size.x),height:Math.round(size.y)})};
CPath.prototype.getId=function(){return this.id};CPath.prototype.setDeleted=function(){this.fire(
"remove",{});this.isDeleted=true;if(this.testDiv){this.testDiv.remove();this.testDiv=undefined}};
CPath.prototype.isUnderMouse=function(){return this.underMouse};
CPath.prototype.setUnderMouse=function(isUnder){this.underMouse=isUnder};
CPath.prototype.onMouseEnter=function(position){this.fire("mouseenter",{position:position})};
CPath.prototype.onMouseLeave=function(position){this.fire("mouseleave",{position:position})};
CPath.prototype.redraw=function(oldBounds){if(this.renderer)this.renderer.updatePath(this,oldBounds)
};CPath.prototype.setStyle=function(style){var oldBounds=this.getBounds();this.setStyleOptions(style
);if(this.renderer){this.renderer.updateStyle(this,oldBounds)}};
CPath.prototype.updatePathAllPanes=function(paintArea){var e_1,_a;
var viewBounds=this.renderer.getBounds().clone();if(this.fixed){var fixedMapArea=new cool.Bounds(
new cool.Point(0,0),viewBounds.getSize());this.updatePath(fixedMapArea,fixedMapArea);
this.updateTestData();return}var splitPanesContext=this.renderer.getSplitPanesContext();
var paneBoundsList=splitPanesContext?splitPanesContext.getPxBoundList():[viewBounds];var maxXBound=0
var maxYBound=0;try{for(var paneBoundsList_1=__values(paneBoundsList),
paneBoundsList_1_1=paneBoundsList_1.next(
);!paneBoundsList_1_1.done;paneBoundsList_1_1=paneBoundsList_1.next()){
var paneBounds=paneBoundsList_1_1.value;maxXBound=Math.max(maxXBound,paneBounds.min.x);
maxYBound=Math.max(maxYBound,paneBounds.min.y)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
paneBoundsList_1_1&&!paneBoundsList_1_1.done&&(_a=paneBoundsList_1.return))_a.call(paneBoundsList_1)
}finally{if(e_1)throw e_1.error}}for(var i=0;i<paneBoundsList.length;++i){
var panePaintArea=paintArea?paintArea.clone():paneBoundsList[i].clone();var paneArea=paneBoundsList[
i];if(paintArea){if(!paneArea.intersects(panePaintArea))continue;panePaintArea.min.x=Math.max(
panePaintArea.min.x,paneArea.min.x);panePaintArea.min.y=Math.max(panePaintArea.min.y,paneArea.min.y)
panePaintArea.max.x=Math.min(panePaintArea.max.x,paneArea.max.x);panePaintArea.max.y=Math.min(
panePaintArea.max.y,paneArea.max.y)}var freezeX=void 0;var freezeY=void 0;if(
paneArea.min.x===0&&maxXBound!==0){freezeX=true}else{freezeX=false}if(
paneArea.min.y===0&&maxYBound!==0){freezeY=true}else{freezeY=false}this.updatePath(panePaintArea,
paneArea,{freezeX:freezeX,freezeY:freezeY})}this.updateTestData()};
CPath.prototype.updatePath=function(paintArea,paneBounds,freezePane){};
CPath.prototype.bringToFront=function(){if(this.renderer){this.renderer.bringToFront(this)}};
CPath.prototype.bringToBack=function(){if(this.renderer){this.renderer.bringToBack(this)}};
CPath.prototype.getBounds=function(){return undefined};CPath.prototype.empty=function(){return true}
CPath.prototype.getParts=function(){return Array()};CPath.prototype.clickTolerance=function(){
return(this.stroke?this.weight/2:0)+(window.touch.currentlyUsingTouchscreen()?10:0)};
CPath.prototype.setCursorType=function(cursorType){this.cursorType=cursorType};
CPath.prototype.onResize=function(){};CPath.prototype.getMap=function(){if(this.renderer){
return this.renderer.getMap()}};CPath.countObjects=0;return CPath}(CEventsHandler);var PathGroupType
;(function(PathGroupType){PathGroupType[PathGroupType["CellSelection"]=0]="CellSelection";
PathGroupType[PathGroupType["TextSelection"]=1]="TextSelection";PathGroupType[PathGroupType[
"CellCursor"]=2]="CellCursor";PathGroupType[PathGroupType["Other"]=3]="Other"})(PathGroupType||(
PathGroupType={}));var CPathGroup=function(){function CPathGroup(paths){this.paths=paths}
CPathGroup.prototype.forEach=function(callback){this.paths.forEach(callback)};
CPathGroup.prototype.push=function(path){this.paths.push(path)};return CPathGroup}();var CLineUtil;(
function(CLineUtil){var _lastCode=0;function simplify(points,tolerance){if(
!tolerance||!points.length){return points.slice()}var sqTolerance=tolerance*tolerance;
points=_reducePoints(points,sqTolerance);points=_simplifyDP(points,sqTolerance);return points}
CLineUtil.simplify=simplify;function pointToSegmentDistance(p,p1,p2){return Math.sqrt(
_sqDistToClosestPointOnSegment(p,p1,p2))}function _simplifyDP(points,sqTolerance){
var len=points.length;var markers=typeof Uint8Array!==undefined+""?new Uint8Array(len):Array(len);
markers[0]=markers[len-1]=true;_simplifyDPStep(points,markers,sqTolerance,0,len-1);var i;
var newPoints=Array();for(i=0;i<len;i++){if(markers[i]){newPoints.push(points[i])}}return newPoints}
function _simplifyDPStep(points,markers,sqTolerance,first,last){var maxSqDist=0;var index;var i;
var sqDist;for(i=first+1;i<=last-1;i++){sqDist=_sqDistToClosestPointOnSegment(points[i],points[first
],points[last]);if(sqDist>maxSqDist){index=i;maxSqDist=sqDist}}if(maxSqDist>sqTolerance){markers[
index]=true;_simplifyDPStep(points,markers,sqTolerance,first,index);_simplifyDPStep(points,markers,
sqTolerance,index,last)}}function _reducePoints(points,sqTolerance){var reducedPoints=[points[0]];
for(var i=1,prev=0,len=points.length;i<len;i++){if(_sqDist(points[i],points[prev])>sqTolerance){
reducedPoints.push(points[i]);prev=i}}if(prev<len-1){reducedPoints.push(points[len-1])}
return reducedPoints}function clipSegment(a,b,bounds,useLastCode,round){
var codeA=useLastCode?_lastCode:_getBitCode(a,bounds);var codeB=_getBitCode(b,bounds);var codeOut;
var p;var newCode;_lastCode=codeB;while(true){if(!(codeA|codeB)){return[a,b]}else if(codeA&codeB){
return[]}else{codeOut=codeA||codeB;p=_getEdgeIntersection(a,b,codeOut,bounds,round);
newCode=_getBitCode(p,bounds);if(codeOut===codeA){a=p;codeA=newCode}else{b=p;codeB=newCode}}}}
CLineUtil.clipSegment=clipSegment;function _getEdgeIntersection(a,b,code,bounds,round){
var dx=b.x-a.x;var dy=b.y-a.y;var min=bounds.min;var max=bounds.max;var x;var y;if(code&8){
x=a.x+dx*(max.y-a.y)/dy;y=max.y}else if(code&4){x=a.x+dx*(min.y-a.y)/dy;y=min.y}else if(code&2){
x=max.x;y=a.y+dy*(max.x-a.x)/dx}else if(code&1){x=min.x;y=a.y+dy*(min.x-a.x)/dx}
return new cool.Point(x,y,round)}function _getBitCode(p,bounds){var code=0;if(p.x<bounds.min.x){
code|=1}else if(p.x>bounds.max.x){code|=2}if(p.y<bounds.min.y){code|=4}else if(p.y>bounds.max.y){
code|=8}return code}function _sqDist(p1,p2){var dx=p2.x-p1.x;var dy=p2.y-p1.y;return dx*dx+dy*dy}
function _sqClosestPointOnSegment(p,p1,p2){var x=p1.x;var y=p1.y;var dx=p2.x-x;var dy=p2.y-y;
var dot=dx*dx+dy*dy;var t;if(dot>0){t=((p.x-x)*dx+(p.y-y)*dy)/dot;if(t>1){x=p2.x;y=p2.y}else if(t>0
){x+=dx*t;y+=dy*t}}return new cool.Point(x,y)}function _sqDistToClosestPointOnSegment(p,p1,p2){
return _sqDist(_sqClosestPointOnSegment(p,p1,p2),p)}})(CLineUtil||(CLineUtil={}));
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CPolyline=function(_super){__extends(CPolyline,_super);
function CPolyline(pointSet,options){var _this=_super.call(this,options)||this;_this.smoothFactor=1;
_this.noClip=false;
_this.smoothFactor=options.smoothFactor!==undefined?options.smoothFactor:_this.smoothFactor;
_this.setPointSet(pointSet);return _this}CPolyline.prototype.getPointSet=function(){
return this.pointSet};CPolyline.prototype.setPointSet=function(pointSet){var oldBounds;if(
this.bounds)oldBounds=this.bounds.clone();else oldBounds=new cool.Bounds(undefined);
this.pointSet=pointSet;this.updateRingsBounds();if(this.renderer)this.renderer.setPenOnOverlay();
return this.redraw(oldBounds)};CPolyline.prototype.updateRingsBounds=function(){this.rings=new Array
var bounds=this.bounds=new cool.Bounds(undefined);if(this.pointSet.empty()){return}
CPolyline.calcRingsBounds(this.pointSet,this.rings,function(pt){bounds.extend(pt)})};
CPolyline.calcRingsBounds=function(pset,rings,updateBounds){if(pset.isFlat()){
var srcArray=pset.getPointArray();if(srcArray===undefined){rings.push([]);return}var array=Array(
srcArray.length);srcArray.forEach(function(pt,index){array[index]=pt.clone();updateBounds(pt)});
rings.push(array);return}var psetArray=pset.getSetArray();if(psetArray){psetArray.forEach(function(
psetNext){CPolyline.calcRingsBounds(psetNext,rings,updateBounds)})}};CPolyline.getPoints=function(
pset){if(pset.isFlat()){var parray=pset.getPointArray();return parray===undefined?[]:parray}
var psetArray=pset.getSetArray();if(psetArray&&psetArray.length){return CPolyline.getPoints(
psetArray[0])}return[]};CPolyline.prototype.getCenter=function(){var i;var halfDist;var segDist;
var dist;var p1;var p2;var ratio;var points=CPolyline.getPoints(this.pointSet);var len=points.length
for(i=0,halfDist=0;i<len-1;i++){halfDist+=points[i].distanceTo(points[i+1])/2}for(i=0,
dist=0;i<len-1;i++){p1=points[i];p2=points[i+1];segDist=p1.distanceTo(p2);dist+=segDist;if(
dist>halfDist){ratio=(dist-halfDist)/segDist;return new cool.Point(p2.x-ratio*(p2.x-p1.x),
p2.y-ratio*(p2.y-p1.y))}}};CPolyline.prototype.getBounds=function(){return this.bounds};
CPolyline.prototype.getHitBounds=function(){if(!this.bounds.isValid())return this.bounds;
var w=this.clickTolerance();var p=new cool.Point(w,w);return new cool.Bounds(this.bounds.getTopLeft(
).subtract(p),this.bounds.getBottomRight().add(p))};CPolyline.prototype.updatePath=function(
paintArea,paneBounds,freezePane){this.clipPoints(paintArea);this.simplifyPoints();
this.renderer.updatePoly(this,false,paintArea,paneBounds,freezePane)};
CPolyline.prototype.clipPoints=function(paintArea){if(this.noClip){this.parts=this.rings;return}
this.parts=new Array;var parts=this.parts;var bounds=paintArea?paintArea:this.renderer.getBounds();
var i;var j;var k;var len;var len2;var segment;var points;for(i=0,k=0,
len=this.rings.length;i<len;i++){points=this.rings[i];for(j=0,len2=points.length;j<len2-1;j++){
segment=CLineUtil.clipSegment(points[j],points[j+1],bounds,j!=0,true);if(!segment.length){continue}
parts[k]=parts[k]||[];parts[k].push(segment[0]);if(segment[1]!==points[j+1]||j===len2-2){parts[k
].push(segment[1]);k++}}}};CPolyline.prototype.simplifyPoints=function(){var parts=this.parts;
var tolerance=this.smoothFactor;for(var i=0,len=parts.length;i<len;i++){parts[i]=CLineUtil.simplify(
parts[i],tolerance)}};CPolyline.prototype.getParts=function(){return this.parts};
CPolyline.prototype.empty=function(){return this.pointSet.empty()};return CPolyline}(CPath);
var CPolyUtil;(function(CPolyUtil){function rectanglesToPointSet(rectangles,unitConverter){
var eps=20;for(var i=0;i<rectangles.length-1;i++){for(var j=i+1;j<rectangles.length;j++){for(
var k=0;k<rectangles[i].length;k++){for(var l=0;l<rectangles[j].length;l++){if(Math.abs(rectangles[i
][k].x-rectangles[j][l].x)<eps){rectangles[j][l].x=rectangles[i][k].x}if(Math.abs(rectangles[i][k
].y-rectangles[j][l].y)<eps){rectangles[j][l].y=rectangles[i][k].y}}}}}var points=new Map;for(
i=0;i<rectangles.length;i++){for(j=0;j<rectangles[i].length;j++){if(points.has(rectangles[i][j])){
points.delete(rectangles[i][j])}else{points.set(rectangles[i][j],rectangles[i][j])}}}
function getKeys(points){var keys=[];points.forEach(function(_,key){keys.push(key)});return keys}
function xThenY(ap,bp){if(ap.x<bp.x||ap.x===bp.x&&ap.y<bp.y){return-1}else if(
ap.x===bp.x&&ap.y===bp.y){return 0}else{return 1}}function yThenX(ap,bp){if(
ap.y<bp.y||ap.y===bp.y&&ap.x<bp.x){return-1}else if(ap.x===bp.x&&ap.y===bp.y){return 0}else{return 1
}}var sortX=getKeys(points).sort(xThenY);var sortY=getKeys(points).sort(yThenX);var edgesH=new Map;
var edgesV=new Map;var len=getKeys(points).length;i=0;while(i<len){var currY=points.get(sortY[i]).y;
while(i<len&&points.get(sortY[i]).y===currY){edgesH.set(sortY[i],sortY[i+1]);edgesH.set(sortY[i+1],
sortY[i]);i+=2}}i=0;while(i<len){var currX=points.get(sortX[i]).x;while(i<len&&points.get(sortX[i]
).x===currX){edgesV.set(sortX[i],sortX[i+1]);edgesV.set(sortX[i+1],sortX[i]);i+=2}}
var polygons=new Array;var edgesHKeys=getKeys(edgesH);while(edgesHKeys.length>0){var p=[[edgesHKeys[
0],0]];while(true){var curr=p[p.length-1][0];var e=p[p.length-1][1];if(e===0){
var nextVertex=edgesV.get(curr);edgesV.delete(curr);p.push([nextVertex,1])}else{
var nextVertex=edgesH.get(curr);edgesH.delete(curr);p.push([nextVertex,0])}if(p[p.length-1][0
].equals(p[0][0])&&p[p.length-1][1]===p[0][1]){p.pop();break}}var polygon=new Array;for(
i=0;i<p.length;i++){polygon.push(unitConverter(points.get(p[i][0])));edgesH.delete(p[i][0]);
edgesV.delete(p[i][0])}polygon.push(unitConverter(points.get(p[0][0])));edgesHKeys=getKeys(edgesH);
polygons.push(CPointSet.fromPointArray(polygon))}return CPointSet.fromSetArray(polygons)}
CPolyUtil.rectanglesToPointSet=rectanglesToPointSet})(CPolyUtil||(CPolyUtil={}));
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CPolygon=function(_super){__extends(CPolygon,_super);
function CPolygon(pointSet,options){var _this=_super.call(this,pointSet,options)||this;if(
options.fill===undefined)_this.fill=true;return _this}CPolygon.prototype.getCenter=function(){var i;
var j;var len;var p1;var p2;var f;var area;var x;var y;var points=this.rings[0];area=x=y=0;for(i=0,
len=points.length,j=len-1;i<len;j=i++){p1=points[i];p2=points[j];f=p1.y*p2.x-p2.y*p1.x;x+=(p1.x+p2.x
)*f;y+=(p1.y+p2.y)*f;area+=f*3}return new cool.Point(x/area,y/area)};
CPolygon.prototype.updatePath=function(paintArea,paneBounds,freezePane){this.parts=this.rings;for(
var i=0,len=this.rings.length;i<len;i++){var ring=this.rings[i];var ringlen=ring.length;if(
ring.length>=2&&ring[0].equals(ring[ringlen-1])){ring.pop()}}this.simplifyPoints();
this.renderer.updatePoly(this,true,paintArea,paneBounds,freezePane)};
CPolygon.prototype.anyRingBoundContains=function(corePxPoint){for(var i=0;i<this.rings.length;++i){
var ringBound=new cool.Bounds(undefined);var ring=this.rings[i];for(
var pointIdx=0;pointIdx<ring.length;++pointIdx){ringBound.extend(ring[pointIdx])}if(
ring.length&&ringBound.contains(corePxPoint))return true}return false};return CPolygon}(CPolyline);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CRectangle=function(_super){__extends(CRectangle,_super);
function CRectangle(bounds,options){return _super.call(this,CRectangle.boundsToPointSet(bounds),
options)||this}CRectangle.prototype.setBounds=function(bounds){this.setPointSet(
CRectangle.boundsToPointSet(bounds))};CRectangle.boundsToPointSet=function(bounds){if(
!bounds.isValid()){return new CPointSet}return CPointSet.fromPointArray([bounds.getTopLeft(),
bounds.getTopRight(),bounds.getBottomRight(),bounds.getBottomLeft(),bounds.getTopLeft()])};
return CRectangle}(CPolygon);function getOptionsClone(baseOpts){var newOpt={};for(
var prop in baseOpts){if(Object.prototype.hasOwnProperty.call(baseOpts,prop)){newOpt[prop]=baseOpts[
prop]}}return newOpt}var CCellSelection=function(_super){__extends(CCellSelection,_super);
function CCellSelection(pointSet,options){var _this=_super.call(this,[])||this;
_this.selectionWeight=2;_this.selectionWeight=Math.round(options.weight);options.weight=1;
_this.options=options;_this.options.lineJoin="miter";_this.options.lineCap="butt";
_this.options.viewId=CPath.getViewId(options);_this.options.groupType=PathGroupType.CellSelection;
_this.setPointSet(pointSet);return _this}CCellSelection.prototype.setPointSet=function(pointSet){
var outerPointSet=pointSet;outerPointSet.applyOffset(new cool.Point(.5,.5),false,true);
var borderPointSets=[];for(var idx=0;idx<this.selectionWeight;++idx){var pixels=idx;
var borderPset=outerPointSet.clone();borderPset.applyOffset(new cool.Point(-pixels,-pixels),true,
false);borderPointSets.push(borderPset)}var contrastBorderPointSet=outerPointSet.clone();
contrastBorderPointSet.applyOffset(new cool.Point(-this.selectionWeight,-this.selectionWeight),true,
false);if(this.borderPaths&&this.innerContrastBorder){console.assert(
this.borderPaths.length===this.selectionWeight);this.borderPaths.forEach(function(borderPath,index){
borderPath.setPointSet(borderPointSets[index])});this.innerContrastBorder.setPointSet(
contrastBorderPointSet)}else{this.borderPaths=[];for(var index=0;index<this.selectionWeight;++index
){var borderOpt=getOptionsClone(this.options);borderOpt.fillColor=undefined;
borderOpt.fillOpacity=undefined;borderOpt.fill=false;borderOpt.name+="-border-"+index;
var borderPath=new CPolygon(borderPointSets[index],borderOpt);this.borderPaths.push(borderPath);
this.push(borderPath)}var contrastBorderOpt=getOptionsClone(this.options);
contrastBorderOpt.name+="-contrast-border";contrastBorderOpt.color="white";
contrastBorderOpt.fill=true;this.innerContrastBorder=new CPolygon(contrastBorderPointSet,
contrastBorderOpt);this.push(this.innerContrastBorder)}};
CCellSelection.prototype.getBounds=function(){if(!this.borderPaths||!this.borderPaths.length
)return new cool.Bounds(undefined);return this.borderPaths[0].getBounds()};
CCellSelection.prototype.anyRingBoundContains=function(corePxPoint){if(
!this.borderPaths||!this.borderPaths.length)return false;return this.borderPaths[0
].anyRingBoundContains(corePxPoint)};return CCellSelection}(CPathGroup);var Cursor=function(){
function Cursor(position,size,map,options){var _this=this;this.opacity=1;this.zIndex=1e3;
this.blink=false;this.header=false;this.headerTimeout=3e3;this.visible=false;this.domAttached=false;
this.onFocusBlur=function(ev){_this.addCursorClass(ev.type!=="blur")};this.onResize=function(){if(
window.devicePixelRatio!==1
)_this.cursor.style.width=_this.width/window.devicePixelRatio+"px";else _this.cursor.style.removeProperty(
"width")};this.opacity=options.opacity!==undefined?options.opacity:this.opacity;
this.zIndex=options.zIndex!==undefined?options.zIndex:this.zIndex;
this.blink=options.blink!==undefined?options.blink:this.blink;
this.color=options.color!==undefined?options.color:this.color;
this.header=options.header!==undefined?options.header:this.header;
this.headerName=options.headerName!==undefined?options.headerName:this.headerName;
this.headerTimeout=options.headerTimeout!==undefined?options.headerTimeout:this.headerTimeout;
this.position=position;this.size=size;this.map=map;this.initLayout()}Cursor.prototype.add=function(
){if(!this.container){this.initLayout()}this.setMouseCursor();this.map.getCursorOverlayContainer(
).appendChild(this.container);this.visible=true;this.domAttached=true;this.update();if(
this.map._docLayer.isCalc())this.map.on("splitposchanged move",this.update,this);else this.map.on(
"move",this.update,this);window.addEventListener("blur",this.onFocusBlur);window.addEventListener(
"focus",this.onFocusBlur);window.addEventListener("resize",this.onResize)};
Cursor.prototype.setMouseCursor=function(){if(
this.domAttached&&this.container&&this.container.querySelector(".blinking-cursor")!==null){if(
this.map._docLayer._docType==="presentation"){$(".leaflet-interactive").css("cursor","text")}else{$(
".leaflet-pane.leaflet-map-pane").css("cursor","text")}}};
Cursor.prototype.setMouseCursorForTextBox=function(){if(
this.domAttached&&this.container&&this.container.querySelector(".blinking-cursor")!==null){$(
".leaflet-interactive").css("cursor","text")}this.addCursorClass(app.file.textCursor.visible);
this.setOpacity(app.file.textCursor.visible?1:0)};Cursor.prototype.remove=function(){this.map.off(
"splitposchanged",this.update,this);if(this.map._docLayer._docType==="presentation"){$(
".leaflet-interactive").css("cursor","")}else{$(".leaflet-pane.leaflet-map-pane").css("cursor","")}
if(this.container&&this.domAttached){this.map.getCursorOverlayContainer().removeChild(this.container
)}this.visible=false;this.domAttached=false;window.removeEventListener("blur",this.onFocusBlur);
window.removeEventListener("focus",this.onFocusBlur);window.removeEventListener("resize",
this.onResize)};Cursor.prototype.isDomAttached=function(){return this.domAttached};
Cursor.prototype.addCursorClass=function(visible){if(visible)window.L.DomUtil.removeClass(
this.cursor,"blinking-cursor-hidden");else window.L.DomUtil.addClass(this.cursor,
"blinking-cursor-hidden")};Cursor.prototype.isVisible=function(){return this.visible};
Cursor.prototype.setPositionSize=function(position,size){this.position=position;this.size=size;
this.update()};Cursor.prototype.getPosition=function(){return this.position};
Cursor.prototype.update=function(){if(!this.container||!this.map||!this.map.hasDocBounds())return;
var docBounds=this.map.getCorePxDocBounds();var inDocCursor=docBounds.contains(this.position);
var viewBounds=this.map.getPixelBoundsCore();var spCxt=this.map.getSplitPanesContext();
var origin=viewBounds.min.clone();var paneSize=viewBounds.getSize();var splitPos=new cool.Point(0,0)
if(inDocCursor&&spCxt){splitPos=spCxt.getSplitPos().multiplyBy(app.dpiScale);if(
this.position.x<=splitPos.x&&this.position.x>=0){origin.x=0;paneSize.x=splitPos.x}else{
paneSize.x-=splitPos.x}if(this.position.y<=splitPos.y&&this.position.y>=0){origin.y=0;
paneSize.y=splitPos.y}else{paneSize.y-=splitPos.y}}var canvasOffset=this.position.subtract(origin);
if(inDocCursor){if(!app.isRectangleVisibleInTheDisplayedArea(app.file.textCursor.rectangle.toArray()
)){this.container.style.visibility="hidden";this.visible=false;this.addCursorClass(this.visible);
this.showCursorHeader();return}}this.container.style.visibility="visible";this.visible=true;
this.addCursorClass(this.visible);var tileSectionPos=this.map._docLayer.getTileSectionPos();
var pos=canvasOffset.add(tileSectionPos)._divideBy(app.dpiScale)._round();
var size=this.size.divideBy(app.dpiScale)._round();this.setSize(size);this.setPos(pos);
this.showCursorHeader()};Cursor.prototype.setOpacity=function(opacity){if(this.container
)window.L.DomUtil.setOpacity(this.cursor,opacity);if(this.cursorHeader)window.L.DomUtil.setOpacity(
this.cursorHeader,opacity)};Cursor.prototype.showCursorHeader=function(){if(this.cursorHeader){if(
!this.visible||this.map._docLayer._isZooming){this.hideCursorHeader();return}
window.L.DomUtil.setStyle(this.cursorHeader,"visibility","visible");clearTimeout(this.blinkTimeout);
this.blinkTimeout=setTimeout(window.L.bind(function(){this.hideCursorHeader()},this),
this.headerTimeout)}};Cursor.prototype.hideCursorHeader=function(){if(this.cursorHeader
)window.L.DomUtil.setStyle(this.cursorHeader,"visibility","hidden")};
Cursor.prototype.initLayout=function(){this.container=window.L.DomUtil.create("div",
"leaflet-cursor-container");if(this.header){this.cursorHeader=window.L.DomUtil.create("div",
"leaflet-cursor-header",this.container);this.cursorHeader.textContent=this.headerName;clearTimeout(
this.blinkTimeout);this.blinkTimeout=setTimeout(window.L.bind(function(){window.L.DomUtil.setStyle(
this._cursorHeader,"visibility","hidden")},this),this.headerTimeout)}
this.cursor=window.L.DomUtil.create("div","leaflet-cursor",this.container);if(this.blink){
window.L.DomUtil.addClass(this.cursor,"blinking-cursor")}if(this.color){window.L.DomUtil.setStyle(
this.cursorHeader,"background",this.color);window.L.DomUtil.setStyle(this.cursor,"background",
this.color)}window.L.DomEvent.disableClickPropagation(this.cursor).disableScrollPropagation(
this.container);var cursorCss=getComputedStyle(this.cursor,null);this.width=parseFloat(
cursorCss.getPropertyValue("width"))};Cursor.prototype.transformX=function(xpos){if(
!this.map._docLayer.isCalcRTL()){return xpos}return this.map._size.x-xpos};
Cursor.prototype.setPos=function(pos){this.container.style.top=pos.y+"px";
this.container.style.left=this.transformX(pos.x)+"px";this.container.style.zIndex=this.zIndex+"";if(
this.blink){window.L.DomUtil.removeClass(this.cursor,"blinking-cursor");window.L.DomUtil.addClass(
this.cursor,"blinking-cursor")}};Cursor.prototype.setSize=function(size){
this.cursor.style.height=size.y+"px";this.container.style.top="-"+(
this.container.clientHeight-size.y-2)/2+"px"};Cursor.isCustomCursor=function(cursorName){
return Cursor.customCursors.indexOf(cursorName)!==-1};Cursor.getCustomCursor=function(cursorName){
var customCursor;if(Cursor.isCustomCursor(cursorName)){var cursorHotSpot=Cursor.hotSpot.get(
cursorName)||new cool.Point(0,0);
customCursor=window.L.Browser.ie?"url("+Cursor.imagePath+"/"+cursorName+".cur), default":"url("+Cursor.imagePath+"/"+cursorName+".png) "+cursorHotSpot.x+" "+cursorHotSpot.y+", default"
}return customCursor};Cursor.hotSpot=new Map([["fill",new cool.Point(7,16)]]);Cursor.customCursors=[
"fill"];return Cursor}();var __extends=this&&this.__extends||function(){var extendStatics=function(d
,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var OverlayTransform=function(){function OverlayTransform(){
this.translationAmount=new cool.Point(0,0);this.scaleAmount=new cool.Point(1,1)}
OverlayTransform.prototype.translate=function(x,y){this.translationAmount.x=x;
this.translationAmount.y=y};OverlayTransform.prototype.scale=function(sx,sy){this.scaleAmount.x=sx;
this.scaleAmount.y=sy};OverlayTransform.prototype.reset=function(){this.translationAmount.x=0;
this.translationAmount.y=0;this.scaleAmount.x=1;this.scaleAmount.y=1};
OverlayTransform.prototype.applyToPoint=function(point){return new cool.Point(
point.x*this.scaleAmount.x-this.translationAmount.x,
point.y*this.scaleAmount.y-this.translationAmount.y)};
OverlayTransform.prototype.applyToBounds=function(bounds){return new cool.Bounds(this.applyToPoint(
bounds.min),this.applyToPoint(bounds.max))};return OverlayTransform}();
var TransformationsList=function(){function TransformationsList(){this.list=[]}
TransformationsList.prototype.add=function(tx){this.list.push(tx)};
TransformationsList.prototype.addNew=function(translate,scale){var tx=new OverlayTransform;
tx.translate(translate.x,translate.y);tx.scale(scale.x,scale.y);this.add(tx)};
TransformationsList.prototype.reset=function(){this.list=[]};
TransformationsList.prototype.applyToPoint=function(point){var tPoint=point.clone();
this.list.forEach(function(tx){tPoint=tx.applyToPoint(tPoint)});return tPoint};
TransformationsList.prototype.applyToBounds=function(bounds){var tBounds=bounds.clone();
this.list.forEach(function(tx){tBounds=tx.applyToBounds(tBounds)});return tBounds};
return TransformationsList}();var CanvasOverlay=function(_super){__extends(CanvasOverlay,_super);
function CanvasOverlay(mapObject,canvasContext){var _this=_super.call(this,
app.CSections.Overlays.name)||this;_this.processingOrder=app.CSections.Overlays.processingOrder;
_this.drawingOrder=app.CSections.Overlays.drawingOrder;_this.zIndex=app.CSections.Overlays.zIndex;
_this.anchor=["top","left"];_this.boundToSection="tiles";_this.map=mapObject;_this.ctx=canvasContext
_this.tsManager=_this.map.getTileSectionMgr();_this.sectionProperties.docLayer=_this.map._docLayer;
_this.sectionProperties.tsManager=_this.tsManager;_this.paths=new Map;
_this.transformList=new TransformationsList;_this.updateCanvasBounds();return _this}
CanvasOverlay.prototype.onResize=function(){this.paths.forEach(function(path){path.onResize()});
this.onDraw()};CanvasOverlay.prototype.onDraw=function(){this.draw()};
CanvasOverlay.prototype.onMouseMove=function(position){var mousePos=new cool.Point(position.pX,
position.pY);var overlaySectionBounds=this.bounds.clone();var splitPos=this.tsManager.getSplitPos();
if(this.isCalcRTL()){mousePos.x=overlaySectionBounds.max.x-overlaySectionBounds.min.x-mousePos.x}if(
mousePos.x>splitPos.x)mousePos.x+=overlaySectionBounds.min.x;if(mousePos.y>splitPos.y
)mousePos.y+=overlaySectionBounds.min.y;this.paths.forEach(function(path){
var pathBounds=path.getBounds();if(!pathBounds.isValid())return;
var mouseOverPath=pathBounds.contains(mousePos);if(mouseOverPath&&!path.isUnderMouse()){
path.onMouseEnter(mousePos);path.setUnderMouse(true)}else if(!mouseOverPath&&path.isUnderMouse()){
path.onMouseLeave(mousePos);path.setUnderMouse(false)}})};
CanvasOverlay.prototype.setPenOnOverlay=function(){this.containerObject.setPenPosition(this)};
CanvasOverlay.prototype.initPath=function(path){var pathId=path.getId();this.paths.set(pathId,path);
path.setRenderer(this);this.setPenOnOverlay();path.updatePathAllPanes()};
CanvasOverlay.prototype.initPathGroup=function(pathGroup){pathGroup.forEach(function(path){
this.initPath(path)}.bind(this))};CanvasOverlay.prototype.removePath=function(path){path.setDeleted(
);this.paths.delete(path.getId());this.containerObject.requestReDraw()};
CanvasOverlay.prototype.removePathGroup=function(pathGroup){pathGroup.forEach(function(path){
this.removePath(path)}.bind(this))};CanvasOverlay.prototype.updatePath=function(path,oldBounds){
this.redraw(path,oldBounds)};CanvasOverlay.prototype.updateStyle=function(path,oldBounds){
this.redraw(path,oldBounds)};CanvasOverlay.prototype.paintRegion=function(paintArea){this.draw(
paintArea)};CanvasOverlay.prototype.getSplitPanesContext=function(){
return this.map.getSplitPanesContext()};CanvasOverlay.prototype.isPathVisible=function(path){
var pathBounds=path.getBounds();if(!pathBounds.isValid())return false;return this.intersectsVisible(
pathBounds)};CanvasOverlay.prototype.intersectsVisible=function(queryBounds){
this.updateCanvasBounds();var spc=this.getSplitPanesContext();return spc?spc.intersectsVisible(
queryBounds):this.bounds.intersects(queryBounds)};CanvasOverlay.renderOrderComparator=function(a,b){
if(a.viewId===-1&&b.viewId===-1){if(a.groupType===b.groupType)return a.zIndex-b.zIndex;
return a.groupType-b.groupType}else if(a.viewId===-1){return 1}else if(b.viewId===-1){return-1}if(
a.viewId===b.viewId){if(a.groupType===b.groupType)return a.zIndex-b.zIndex;
return a.groupType-b.groupType}return a.viewId-b.viewId};CanvasOverlay.prototype.draw=function(
paintArea){var _this=this;if(this.tsManager&&this.tsManager.waitForTiles()){return}
var orderedPaths=Array();this.paths.forEach(function(path){orderedPaths.push(path)});
orderedPaths.sort(CanvasOverlay.renderOrderComparator);orderedPaths.forEach(function(path){if(
_this.isPathVisible(path))path.updatePathAllPanes(paintArea)},this)};
CanvasOverlay.prototype.redraw=function(path,oldBounds){if(
this.tsManager&&this.tsManager.waitForTiles()){return}if(!this.isPathVisible(path)&&(
!oldBounds.isValid()||!this.intersectsVisible(oldBounds)))return;this.containerObject.requestReDraw(
)};CanvasOverlay.prototype.updateCanvasBounds=function(){var viewBounds=this.map.getPixelBoundsCore(
);this.bounds=new cool.Bounds(new cool.Point(viewBounds.min.x,viewBounds.min.y),new cool.Point(
viewBounds.max.x,viewBounds.max.y))};CanvasOverlay.prototype.getBounds=function(){
this.updateCanvasBounds();return this.bounds};CanvasOverlay.prototype.ctStart=function(clipArea,
paneBounds,fixed,freezePane){this.updateCanvasBounds();this.transformList.reset();this.ctx.save();
if(!paneBounds)paneBounds=this.bounds.clone();var transform=new OverlayTransform;
var _a=freezePane!==null&&freezePane!==void 0?freezePane:{freezeX:false,freezeY:false},
freezeX=_a.freezeX,freezeY=_a.freezeY;if(this.tsManager._inZoomAnim&&!fixed){
var splitPos=this.tsManager.getSplitPos();var scale=this.tsManager._zoomFrameScale;
var docPos=this.tsManager._getZoomDocPos(this.tsManager._newCenter,
this.tsManager._layer._pinchStartCenter,paneBounds,{freezeX:freezeX,freezeY:freezeY},splitPos,scale,
false);var clipTopLeft=new cool.Point(docPos.topLeft.x,docPos.topLeft.y);
var paneSize=paneBounds.getSize();var clipSize=paneSize.clone();if(!freezeX){clipSize.x=(
paneSize.x-splitPos.x*(scale-1))/scale;docPos.topLeft.x-=splitPos.x}if(!freezeY){clipSize.y=(
paneSize.y-splitPos.y*(scale-1))/scale;docPos.topLeft.y-=splitPos.y}clipArea=new cool.Bounds(
clipTopLeft,clipTopLeft.add(clipSize));transform.scale(scale,scale);transform.translate(
scale*docPos.topLeft.x,scale*docPos.topLeft.y)}else if(this.tsManager._inZoomAnim&&fixed){
var scale=this.tsManager._zoomFrameScale;transform.scale(scale,scale);if(clipArea){
clipArea=new cool.Bounds(clipArea.min.divideBy(scale),clipArea.max.divideBy(scale))}}else{
transform.translate(paneBounds.min.x?this.bounds.min.x:0,paneBounds.min.y?this.bounds.min.y:0)}
this.transformList.add(transform);if(this.isCalcRTL()){var sectionWidth=this.size[0];
this.transformList.addNew(new cool.Point(-sectionWidth,0),new cool.Point(-1,1))}if(clipArea){
this.ctx.beginPath();clipArea=this.transformList.applyToBounds(clipArea);
var clipSize=clipArea.getSize();this.ctx.rect(clipArea.min.x,clipArea.min.y,clipSize.x,clipSize.y);
this.ctx.clip()}};CanvasOverlay.prototype.ctEnd=function(){this.ctx.restore()};
CanvasOverlay.prototype.updatePoly=function(path,closed,clipArea,paneBounds,freezePane){if(
closed===void 0){closed=false}var i;var j;var len2;var part;var parts=path.getParts();
var len=parts.length;if(!len)return;this.ctStart(clipArea,paneBounds,path.fixed,freezePane);
this.ctx.beginPath();for(i=0;i<len;i++){for(j=0,len2=parts[i].length;j<len2;j++){
part=this.transformList.applyToPoint(parts[i][j]);this.ctx[j?"lineTo":"moveTo"](part.x,part.y)}if(
closed){this.ctx.closePath()}}this.fillStroke(path);this.ctEnd()};
CanvasOverlay.prototype.updateCircle=function(path,clipArea,paneBounds,freezePane){if(path.empty()
)return;this.ctStart(clipArea,paneBounds,path.fixed,freezePane);
var point=this.transformList.applyToPoint(path.point);var r=path.radius;var s=(path.radiusY||r)/r;
if(s!==1){this.ctx.save();this.ctx.scale(1,s)}this.ctx.beginPath();this.ctx.arc(point.x,point.y/s,r,
0,Math.PI*2,false);if(s!==1){this.ctx.restore()}this.fillStroke(path);this.ctEnd()};
CanvasOverlay.prototype.fillStroke=function(path){if(path.fill){
this.ctx.globalAlpha=path.fillOpacity;this.ctx.fillStyle=path.fillColor||path.color;this.ctx.fill(
path.fillRule||"evenodd")}if(path.stroke&&path.weight!==0){this.ctx.globalAlpha=path.opacity;
this.ctx.lineWidth=path.weight;this.ctx.strokeStyle=path.color;this.ctx.lineCap=path.lineCap;
this.ctx.lineJoin=path.lineJoin;this.ctx.stroke()}};CanvasOverlay.prototype.bringToFront=function(
path){};CanvasOverlay.prototype.bringToBack=function(path){};
CanvasOverlay.prototype.getMap=function(){return this.map};return CanvasOverlay}(CanvasSectionObject
);var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var ScrollSection=function(_super){
__extends(ScrollSection,_super);function ScrollSection(isRTL){var _this=_super.call(this,
app.CSections.Scroll.name)||this;_this.processingOrder=app.CSections.Scroll.processingOrder;
_this.drawingOrder=app.CSections.Scroll.drawingOrder;_this.zIndex=app.CSections.Scroll.zIndex;
_this.windowSection=true;_this.pendingScrollEvent=null;_this.stepByStepScrolling=false;
_this.map=window.L.Map.THIS;_this.isRTL=isRTL!==null&&isRTL!==void 0?isRTL:function(){return false};
_this.map.on("scrollby",_this.onScrollBy,_this);_this.map.on("scrollvelocity",_this.onScrollVelocity
,_this);_this.map.on("handleautoscroll",_this.onHandleAutoScroll,_this);return _this}
ScrollSection.prototype.onInitialize=function(){
this.sectionProperties.mapPane=document.querySelectorAll(".leaflet-map-pane")[0];
this.sectionProperties.defaultCursorStyle=this.sectionProperties.mapPane.style.cursor;
this.sectionProperties.previousDragDistance=null;
this.sectionProperties.scrollBarThickness=6*app.roundedDpiScale;
this.sectionProperties.drawScrollBarRailway=true;
this.sectionProperties.scrollBarRailwayThickness=6*app.roundedDpiScale;
this.sectionProperties.scrollBarRailwayAlpha=this.map._docLayer._docType==="spreadsheet"?1:.5;
this.sectionProperties.scrollBarRailwayColor="#EFEFEF";
this.sectionProperties.drawVerticalScrollBar=window.mode.isDesktop()?true:false;
this.sectionProperties.drawHorizontalScrollBar=window.mode.isDesktop()?true:false;
this.sectionProperties.clickScrollVertical=false;this.sectionProperties.clickScrollHorizontal=false;
this.sectionProperties.mouseIsOnVerticalScrollBar=false;
this.sectionProperties.mouseIsOnHorizontalScrollBar=false;
this.sectionProperties.minimumScrollSize=80*app.roundedDpiScale;
this.sectionProperties.circleSliderRadius=24*app.roundedDpiScale;
this.sectionProperties.arrowCornerLength=10*app.roundedDpiScale;
this.sectionProperties.alphaWhenVisible=.5;this.sectionProperties.alphaWhenBeingUsed=.8;
this.sectionProperties.currentAlpha=1;this.sectionProperties.idleDuration=2e3;
this.sectionProperties.fadeOutStartingTime=1800;
this.sectionProperties.fadeOutDuration=this.sectionProperties.idleDuration-this.sectionProperties.fadeOutStartingTime
this.sectionProperties.animatingScroll=false;
this.sectionProperties.animateWheelScroll=window.mode.isDesktop();
this.sectionProperties.lastElapsedTime=0;this.sectionProperties.scrollAnimationDelta=[0,0];
this.sectionProperties.scrollAnimationAcc=[0,0];this.sectionProperties.scrollAnimationVelocity=[0,0]
this.sectionProperties.scrollAnimationDirection=[0,0];
this.sectionProperties.scrollAnimationDisableTimeout=null;this.sectionProperties.scrollWheelDelta=[0
,0];this.sectionProperties.pointerSyncWithVerticalScrollBar=true;
this.sectionProperties.pointerSyncWithHorizontalScrollBar=true;
this.sectionProperties.pointerReCaptureSpacer=null;this.sectionProperties.stepDuration=50;
this.sectionProperties.quickScrollHorizontalTimer=null;this.sectionProperties.scrollQuirks=true;
this.sectionProperties.alwaysDrawVerticalScrollBar=this.map._docLayer._docType==="spreadsheet"&&!window.mode.isDesktop(
)};ScrollSection.prototype.completePendingScroll=function(){if(this.pendingScrollEvent){
this.onScrollTo(this.pendingScrollEvent);this.pendingScrollEvent=null}};
ScrollSection.prototype.onScrollTo=function(e){if(!this.containerObject.drawingAllowed()){
this.pendingScrollEvent=e;return}app.activeDocument.activeView.scrollTo(e.x,e.y)};
ScrollSection.prototype.onScrollBy=function(e){app.activeDocument.activeView.scroll(e.x,e.y)};
ScrollSection.prototype.onScrollVelocity=function(e){if(e.vx===0&&e.vy===0){clearInterval(
this.autoScrollTimer);this.autoScrollTimer=null;this.map.isAutoScrolling=false}else{clearInterval(
this.autoScrollTimer);this.map.isAutoScrolling=true;this.autoScrollTimer=setInterval(window.L.bind(
function(){this.onScrollBy({x:e.vx,y:e.vy});if(
window.L.Map.THIS.mouse&&window.L.Map.THIS.mouse._mouseDown&&this.containerObject.targetBoundSectionListContains(
app.CSections.Tiles.name)&&window.mode.isDesktop()&&this.containerObject.isDraggingSomething(
)&&window.L.Map.THIS._docLayer._docType==="spreadsheet"){var temp=[e.pos.x,e.pos.y];var tempPos=[(
this.isRTL()?this.map._size.x-temp[0]:temp[0])*app.dpiScale,temp[1]*app.dpiScale];tempPos=[tempPos[0
]+app.activeDocument.activeView.viewedRectangle.pX1,tempPos[1
]+app.activeDocument.activeView.viewedRectangle.pY1];tempPos=[Math.round(tempPos[0
]*app.pixelsToTwips),Math.round(tempPos[1]*app.pixelsToTwips)];
window.L.Map.THIS._docLayer._postMouseEvent("move",tempPos[0],tempPos[1],1,1,0)}},this),100)}};
ScrollSection.prototype.onHandleAutoScroll=function(e){var vx=0;var vy=0;if(e.pos.y>e.map._size.y-50
){vy=50}else if(e.pos.y<50&&e.map._getTopLeftPoint().y>50){vy=-50}var mousePosX=this.isRTL(
)?e.map._size.x-e.pos.x:e.pos.x;var mapLeft=this.isRTL()?e.map._size.x-e.map._getTopLeftPoint(
).x:e.map._getTopLeftPoint().x;if(mousePosX>e.map._size.x-50){vx=50}else if(mousePosX<50&&mapLeft>50
){vx=-50}this.onScrollVelocity({vx:vx,vy:vy,pos:e.pos})};
ScrollSection.prototype.onUpdateScrollOffset=function(){if(
this.map._docLayer._docType==="spreadsheet"){this.map._docLayer.refreshViewData();
this.map._docLayer._restrictDocumentSize()}};
ScrollSection.prototype.DrawVerticalScrollBarMobile=function(){
var scrollProps=app.activeDocument.activeView.scrollProperties;
this.context.globalAlpha=this.sectionProperties.clickScrollVertical?this.sectionProperties.alphaWhenBeingUsed:this.sectionProperties.alphaWhenVisible
this.context.strokeStyle="#7E8182";this.context.fillStyle="white";
var circleStartY=scrollProps.startY+this.sectionProperties.circleSliderRadius;
var circleStartX=this.isRTL()?this.sectionProperties.circleSliderRadius*.5:this.size[0
]-this.sectionProperties.circleSliderRadius*.5;this.context.beginPath();this.context.arc(
circleStartX,circleStartY,this.sectionProperties.circleSliderRadius,0,Math.PI*2,true);
this.context.fill();this.context.stroke();this.context.fillStyle="#7E8182";this.context.beginPath();
var x=circleStartX-this.sectionProperties.arrowCornerLength*.5;
var y=circleStartY-5*app.roundedDpiScale;this.context.moveTo(x,y);
x+=this.sectionProperties.arrowCornerLength;this.context.lineTo(x,y);
x-=this.sectionProperties.arrowCornerLength*.5;y-=Math.sin(Math.PI/3
)*this.sectionProperties.arrowCornerLength;this.context.lineTo(x,y);
x-=this.sectionProperties.arrowCornerLength*.5;y+=Math.sin(Math.PI/3
)*this.sectionProperties.arrowCornerLength;this.context.lineTo(x,y);this.context.fill();
x=circleStartX-this.sectionProperties.arrowCornerLength*.5;y=circleStartY+5*app.roundedDpiScale;
this.context.moveTo(x,y);x+=this.sectionProperties.arrowCornerLength;this.context.lineTo(x,y);
x-=this.sectionProperties.arrowCornerLength*.5;y+=Math.sin(Math.PI/3
)*this.sectionProperties.arrowCornerLength;this.context.lineTo(x,y);
x-=this.sectionProperties.arrowCornerLength*.5;y-=Math.sin(Math.PI/3
)*this.sectionProperties.arrowCornerLength;this.context.lineTo(x,y);this.context.fill();
this.context.globalAlpha=1};ScrollSection.prototype.drawVerticalScrollBar=function(){
var scrollProps=app.activeDocument.activeView.scrollProperties;
var isDarkBackground=this.map.uiManager.isBackgroundDark();var docType=app.map._docLayer._docType;
var startX=this.isRTL()?scrollProps.edgeOffset:this.size[0
]-this.sectionProperties.scrollBarThickness-scrollProps.edgeOffset;if(isDarkBackground&&(
docType==="text"||docType==="drawing")){this.sectionProperties.scrollBarRailwayColor="transparent"}
if(this.sectionProperties.drawScrollBarRailway){
this.context.globalAlpha=this.sectionProperties.scrollBarRailwayAlpha;
this.context.fillStyle=this.sectionProperties.scrollBarRailwayColor;this.context.fillRect(
this.myTopLeft[0]+this.size[0
]-scrollProps.edgeOffset-this.sectionProperties.scrollBarRailwayThickness,scrollProps.yOffset,
this.sectionProperties.scrollBarRailwayThickness,scrollProps.verticalScrollLength)}
this.context.globalAlpha=this.sectionProperties.clickScrollVertical?this.sectionProperties.alphaWhenBeingUsed:this.sectionProperties.alphaWhenVisible
this.context.fillStyle="#7E8182";this.context.fillRect(startX,scrollProps.startY,
this.sectionProperties.scrollBarThickness,
scrollProps.verticalScrollSize-this.sectionProperties.scrollBarThickness);this.context.globalAlpha=1
if(this.containerObject.testing){var element=document.getElementById("test-div-vertical-scrollbar");
if(!element){element=document.createElement("div");element.id="test-div-vertical-scrollbar";
document.body.appendChild(element)}element.textContent=String(scrollProps.startY);
element.style.display="none";element.style.position="fixed";element.style.zIndex="-1"}};
ScrollSection.prototype.drawHorizontalScrollBar=function(){
var scrollProps=app.activeDocument.activeView.scrollProperties;var startY=this.size[1
]-this.sectionProperties.scrollBarThickness-scrollProps.edgeOffset;
var sizeX=scrollProps.horizontalScrollSize-this.sectionProperties.scrollBarThickness;
var docWidth=this.map.getPixelBoundsCore().getSize().x;var startX=this.isRTL(
)?docWidth-scrollProps.startX-sizeX:scrollProps.startX;if(
this.sectionProperties.drawScrollBarRailway){
this.context.globalAlpha=this.sectionProperties.scrollBarRailwayAlpha;
this.context.fillStyle=this.sectionProperties.scrollBarRailwayColor;this.context.fillRect(
scrollProps.xOffset,this.myTopLeft[1]+this.size[1
]-scrollProps.edgeOffset-this.sectionProperties.scrollBarRailwayThickness,
scrollProps.horizontalScrollLength,this.sectionProperties.scrollBarRailwayThickness)}
this.context.globalAlpha=this.sectionProperties.clickScrollHorizontal?this.sectionProperties.alphaWhenBeingUsed:this.sectionProperties.alphaWhenVisible
this.context.fillStyle="#7E8182";this.context.fillRect(startX,startY,sizeX,
this.sectionProperties.scrollBarThickness);this.context.globalAlpha=1;if(
this.containerObject.testing){var element=document.getElementById("test-div-horizontal-scrollbar");
if(!element){element=document.createElement("div");element.id="test-div-horizontal-scrollbar";
document.body.appendChild(element)}element.textContent=String(scrollProps.startX);
element.style.display="none";element.style.position="fixed";element.style.zIndex="-1"}};
ScrollSection.prototype.calculateCurrentAlpha=function(elapsedTime){if(
elapsedTime>=this.sectionProperties.fadeOutStartingTime){
this.sectionProperties.currentAlpha=Math.max((1-(
elapsedTime-this.sectionProperties.fadeOutStartingTime)/this.sectionProperties.fadeOutDuration
)*this.sectionProperties.alphaWhenVisible,.1)}else{
this.sectionProperties.currentAlpha=this.sectionProperties.alphaWhenVisible}};
ScrollSection.prototype.doMove=function(){var _this=this;
var scrollProps=app.activeDocument.activeView.scrollProperties;
app.layoutingService.appendLayoutingTask(function(){_this.map.panBy(new cool.Point(
scrollProps.moveBy[0]/app.dpiScale,scrollProps.moveBy[1]/app.dpiScale));scrollProps.moveBy=null;
_this.onUpdateScrollOffset();if(app&&app.file.fileBasedView===true
)app.map._docLayer._checkSelectedPart();app.activeDocument.activeView.refreshScrollProperties()})};
ScrollSection.prototype.onDraw=function(frameCount,elapsedTime){if(
app.activeDocument.activeView.scrollProperties.moveBy!==null)this.doMove(
);else app.activeDocument.activeView.refreshScrollProperties();if(this.isAnimating&&frameCount>=0
)this.calculateCurrentAlpha(elapsedTime);if(
this.sectionProperties.drawVerticalScrollBar||this.sectionProperties.alwaysDrawVerticalScrollBar){
if(window.mode.isMobile())this.DrawVerticalScrollBarMobile();else this.drawVerticalScrollBar()}if(
this.sectionProperties.drawHorizontalScrollBar){this.drawHorizontalScrollBar()}};
ScrollSection.prototype.onAnimate=function(frameCount,elapsedTime){var timeDelta=(
elapsedTime-this.sectionProperties.lastElapsedTime)/(1e3/60);if(
this.sectionProperties.animatingScroll){var lineHeight=this.containerObject.getScrollLineHeight();
var accel=lineHeight*ScrollSection.scrollAnimationAcceleration*timeDelta*app.dpiScale;var deltas=[0,
0];for(var i=0;i<2;++i){var sign=this.sectionProperties.scrollAnimationDirection[i];
this.sectionProperties.scrollAnimationAcc[i]+=this.sectionProperties.scrollAnimationDelta[i];
this.sectionProperties.scrollAnimationDelta[i]=0;this.sectionProperties.scrollAnimationVelocity[i
]+=this.sectionProperties.scrollAnimationAcc[i]!=0?accel:-accel;
this.sectionProperties.scrollAnimationVelocity[i]=Math.max(0,
this.sectionProperties.scrollAnimationVelocity[i]);deltas[i
]=this.sectionProperties.scrollAnimationVelocity[i]*sign;if(Math.abs(deltas[i])>=Math.abs(
this.sectionProperties.scrollAnimationAcc[i]))this.sectionProperties.scrollAnimationAcc[i
]=0;else this.sectionProperties.scrollAnimationAcc[i]-=deltas[i]}if(deltas[0]!==0
)this.scrollHorizontalWithOffset(deltas[0]);if(deltas[1]!==0)this.scrollVerticalWithOffset(deltas[1]
)}else{if(this.sectionProperties.scrollWheelDelta[0]!==0){
var delta=this.sectionProperties.scrollWheelDelta[0];this.sectionProperties.scrollWheelDelta[0]=0;
this.scrollHorizontalWithOffset(delta)}if(this.sectionProperties.scrollWheelDelta[1]!==0){
var delta=this.sectionProperties.scrollWheelDelta[1];this.sectionProperties.scrollWheelDelta[1]=0;
this.scrollVerticalWithOffset(delta)}}this.sectionProperties.lastElapsedTime=elapsedTime;
var animatingScrollbar=elapsedTime&&elapsedTime<this.sectionProperties.fadeOutDuration;
var animatingScroll=this.sectionProperties.animatingScroll&&(
timeDelta<=0||this.sectionProperties.scrollAnimationVelocity.reduce(function(a,x){return a+x},0)!==0
);if(!animatingScrollbar&&!animatingScroll)this.containerObject.stopAnimating()};
ScrollSection.prototype.onAnimationEnded=function(frameCount,elapsedTime){
this.sectionProperties.animatingScroll=false;this.sectionProperties.scrollAnimationAcc=[0,0];
this.sectionProperties.scrollAnimationVelocity=[0,0];
this.sectionProperties.scrollAnimationDirection=[0,0]};
ScrollSection.prototype.increaseScrollBarThickness=function(){
this.sectionProperties.scrollBarThickness=this.sectionProperties.scrollBarRailwayThickness=8*app.roundedDpiScale
this.containerObject.requestReDraw()};ScrollSection.prototype.decreaseScrollBarThickness=function(){
this.sectionProperties.scrollBarThickness=this.sectionProperties.scrollBarRailwayThickness=6*app.roundedDpiScale
this.containerObject.requestReDraw()};ScrollSection.prototype.hideHorizontalScrollBar=function(){
this.sectionProperties.drawHorizontalScrollBar=false;if(
this.sectionProperties.mouseIsOnHorizontalScrollBar){
this.sectionProperties.mouseIsOnHorizontalScrollBar=false}this.decreaseScrollBarThickness();if(
this.map._docLayer._cursorMarker)this.map._docLayer._cursorMarker.setMouseCursor()};
ScrollSection.prototype.hideVerticalScrollBar=function(){if(
this.sectionProperties.mouseIsOnVerticalScrollBar){
this.sectionProperties.mouseIsOnVerticalScrollBar=false}this.decreaseScrollBarThickness();if(
!window.mode.isDesktop()||app.map._docLayer._docType!=="spreadsheet"){
this.sectionProperties.drawVerticalScrollBar=false}if(this.map._docLayer._cursorMarker
)this.map._docLayer._cursorMarker.setMouseCursor()};
ScrollSection.prototype.showHorizontalScrollBar=function(){var _this=this;
this.sectionProperties.drawHorizontalScrollBar=true;setTimeout(function(){if(
_this.sectionProperties.mouseIsOnHorizontalScrollBar){_this.increaseScrollBarThickness()}},100);if(
!this.containerObject.isDraggingSomething()&&!window.mode.isDesktop()
)this.containerObject.requestReDraw()};ScrollSection.prototype.showVerticalScrollBar=function(){
var _this=this;this.sectionProperties.drawVerticalScrollBar=true;setTimeout(function(){if(
_this.sectionProperties.mouseIsOnVerticalScrollBar){_this.increaseScrollBarThickness()}},100);if(
!this.containerObject.isDraggingSomething()&&!window.mode.isDesktop()
)this.containerObject.requestReDraw()};ScrollSection.prototype.isMouseOnScrollBar=function(point){
var scrollProps=app.activeDocument.activeView.scrollProperties;
var documentAnchor=app.sectionContainer.getSectionWithName(app.CSections.Tiles.name);
var mirrorX=this.isRTL();var temp=point.pY>=this.size[1]-scrollProps.usableThickness;temp=temp&&(
!mirrorX&&point.pX<=this.size[0
]-scrollProps.horizontalScrollRightOffset&&point.pX>=scrollProps.xOffset||mirrorX&&point.pX>=scrollProps.horizontalScrollRightOffset&&point.pX>=scrollProps.xOffset
);this.sectionProperties.mouseIsOnHorizontalScrollBar=temp;if(
app.activeDocument.activeView.canScrollHorizontal(documentAnchor)){if(window.mode.isDesktop(
)||this.sectionProperties.mouseIsOnHorizontalScrollBar)this.showHorizontalScrollBar(
);else this.hideHorizontalScrollBar()}else this.hideHorizontalScrollBar();temp=point.pX>=this.size[0
]-scrollProps.usableThickness;temp=temp&&(!mirrorX&&point.pX>=this.size[0
]-scrollProps.usableThickness)||mirrorX&&point.pX<=scrollProps.usableThickness;
this.sectionProperties.mouseIsOnVerticalScrollBar=temp;if(
app.activeDocument.activeView.canScrollVertical(documentAnchor)){if(window.mode.isDesktop(
)||this.sectionProperties.mouseIsOnVerticalScrollBar)this.showVerticalScrollBar(
);else this.hideVerticalScrollBar()}else this.hideVerticalScrollBar();if(
this.sectionProperties.mouseIsOnHorizontalScrollBar||this.sectionProperties.mouseIsOnVerticalScrollBar
)this.sectionProperties.mapPane.style.cursor="pointer";else this.sectionProperties.mapPane.style.cursor=this.sectionProperties.defaultCursorStyle
};ScrollSection.prototype.onMouseLeave=function(){this.hideVerticalScrollBar();
this.hideHorizontalScrollBar()};ScrollSection.prototype.scrollVerticalWithOffset=function(offset){
if(!app.activeDocument.activeView.canScrollVertical(app.sectionContainer.getSectionWithName(
app.CSections.Tiles.name)))return;app.activeDocument.activeView.scroll(0,offset);if(
app.file.fileBasedView)this.map._docLayer._checkSelectedPart();return true};
ScrollSection.prototype.scrollHorizontalWithOffset=function(offset){if(
!app.activeDocument.activeView.canScrollHorizontal(app.sectionContainer.getSectionWithName(
app.CSections.Tiles.name)))return;app.activeDocument.activeView.scroll(offset,0);return true};
ScrollSection.prototype.isMouseInsideDocumentAnchor=function(point){
var docSection=this.containerObject.getDocumentAnchorSection();
return this.containerObject.doesSectionIncludePoint(docSection,point.pToArray())};
ScrollSection.prototype.isMousePointerSyncedWithVerticalScrollBar=function(scrollProps,position){if(
!window.mode.isDesktop())return true;var spacer=0;if(
!this.sectionProperties.pointerSyncWithVerticalScrollBar){
spacer=this.sectionProperties.pointerReCaptureSpacer}var pointerIsSyncWithScrollBar=false;if(
this.sectionProperties.pointerSyncWithVerticalScrollBar){
pointerIsSyncWithScrollBar=scrollProps.startY<position.pX&&scrollProps.startY+scrollProps.scrollSize-this.sectionProperties.scrollBarThickness>position.pY
pointerIsSyncWithScrollBar=pointerIsSyncWithScrollBar||this.isMouseInsideDocumentAnchor(position
)&&spacer===0}else{var docAncSectionY=this.containerObject.getDocumentAnchorSection().myTopLeft[1];
if(scrollProps.startY<30*window.app.roundedDpiScale+docAncSectionY){
pointerIsSyncWithScrollBar=scrollProps.startY+spacer<position.pY}else{
pointerIsSyncWithScrollBar=scrollProps.startY+spacer>position.pY}}
this.sectionProperties.pointerSyncWithVerticalScrollBar=pointerIsSyncWithScrollBar;
return pointerIsSyncWithScrollBar};
ScrollSection.prototype.isMousePointerSyncedWithHorizontalScrollBar=function(scrollProps,position){
if(!window.mode.isDesktop())return true;var spacer=0;if(
!this.sectionProperties.pointerSyncWithHorizontalScrollBar){
spacer=this.sectionProperties.pointerReCaptureSpacer}
var sizeX=scrollProps.scrollSize-this.sectionProperties.scrollBarThickness;
var docWidth=this.map.getPixelBoundsCore().getSize().x;var startX=this.isRTL(
)?docWidth-scrollProps.startX-sizeX:scrollProps.startX;var endX=startX+sizeX;
var pointerIsSyncWithScrollBar=false;if(this.sectionProperties.pointerSyncWithHorizontalScrollBar){
pointerIsSyncWithScrollBar=position.pX>startX&&position.pX<endX;
pointerIsSyncWithScrollBar=pointerIsSyncWithScrollBar||this.isMouseInsideDocumentAnchor(position
)&&spacer===0}else{var docAncSectionX=this.containerObject.getDocumentAnchorSection().myTopLeft[0];
if(startX<30*window.app.roundedDpiScale+docAncSectionX){
pointerIsSyncWithScrollBar=startX+spacer<position.pX}else{
pointerIsSyncWithScrollBar=startX+spacer>position.pX}}
this.sectionProperties.pointerSyncWithHorizontalScrollBar=pointerIsSyncWithScrollBar;
return pointerIsSyncWithScrollBar};ScrollSection.prototype.onMouseMove=function(position,
dragDistance,e){var scrollProps=app.activeDocument.activeView.scrollProperties;
this.clearQuickScrollTimeout();if(
this.sectionProperties.clickScrollVertical&&this.containerObject.isDraggingSomething()){if(
!this.sectionProperties.previousDragDistance){this.sectionProperties.previousDragDistance=[0,0]}
this.showVerticalScrollBar();var diffY=dragDistance[1]-this.sectionProperties.previousDragDistance[1
];if(this.isMousePointerSyncedWithVerticalScrollBar(scrollProps,position)
)this.scrollVerticalWithOffset(diffY*scrollProps.verticalScrollRatio);
this.sectionProperties.previousDragDistance[1]=dragDistance[1];e.stopPropagation();
this.stopPropagating()}else if(
this.sectionProperties.clickScrollHorizontal&&this.containerObject.isDraggingSomething()){if(
!this.sectionProperties.previousDragDistance){this.sectionProperties.previousDragDistance=[0,0]}
this.showHorizontalScrollBar();var diffX=dragDistance[0
]-this.sectionProperties.previousDragDistance[0];
var actualDistance=scrollProps.horizontalScrollRatio*diffX;if(
this.isMousePointerSyncedWithHorizontalScrollBar(scrollProps,position)
)this.scrollHorizontalWithOffset(actualDistance);this.sectionProperties.previousDragDistance[0
]=dragDistance[0];e.stopPropagation();this.stopPropagating()}else{this.isMouseOnScrollBar(position)}
};ScrollSection.prototype.quickScrollVertical=function(point,originalSign){var _this=this;if(
!window.mode.isDesktop())return;window.L.DomUtil.addClass(document.documentElement,"prevent-select")
var scrollProps=app.activeDocument.activeView.scrollProperties;if(this.stepByStepScrolling){
var sign=point.pY-(scrollProps.startY+scrollProps.verticalScrollSize
)>0?1:point.pY-scrollProps.startY<0?-1:0;var offset=scrollProps.verticalScrollStep*sign;if(
this.sectionProperties.quickScrollVerticalTimer)clearTimeout(
this.sectionProperties.quickScrollVerticalTimer);if(this.sectionProperties.clickScrollVertical
)this.sectionProperties.quickScrollVerticalTimer=setTimeout(function(){if(
!originalSign||originalSign===sign){_this.quickScrollVertical(point,sign)}},
this.sectionProperties.stepDuration)}else{offset=(point.pY-(
scrollProps.startY+scrollProps.verticalScrollSize*.5))*scrollProps.verticalScrollRatio}
this.scrollVerticalWithOffset(offset)};ScrollSection.prototype.quickScrollHorizontal=function(point,
originalSign){var _this=this;if(!window.mode.isDesktop())return;window.L.DomUtil.addClass(
document.documentElement,"prevent-select");
var scrollProps=app.activeDocument.activeView.scrollProperties;
var sizeX=scrollProps.horizontalScrollSize-this.sectionProperties.scrollBarThickness;
var docWidth=this.map.getPixelBoundsCore().getSize().x;var startX=this.isRTL(
)?docWidth-scrollProps.startX-sizeX:scrollProps.startX;if(this.stepByStepScrolling){
var sign=point.pX-(startX+sizeX)>0?1:point.pX-startX<0?-1:0;
var offset=scrollProps.horizontalScrollStep*sign;if(
this.sectionProperties.quickScrollHorizontalTimer)clearTimeout(
this.sectionProperties.quickScrollHorizontalTimer);if(this.sectionProperties.clickScrollHorizontal
)this.sectionProperties.quickScrollHorizontalTimer=setTimeout(function(){if(
!originalSign||originalSign===sign){_this.quickScrollHorizontal(point,sign)}},
this.sectionProperties.stepDuration)}else{offset=(point.pX-(
scrollProps.startX+scrollProps.horizontalScrollSize*.5))*scrollProps.horizontalScrollRatio}
this.scrollHorizontalWithOffset(offset)};
ScrollSection.prototype.getLocalYOnVerticalScrollBar=function(point){
return point.pY-app.activeDocument.activeView.scrollProperties.startY};
ScrollSection.prototype.getLocalXOnHorizontalScrollBar=function(point){
return point.pX-app.activeDocument.activeView.scrollProperties.startX};
ScrollSection.prototype.clearQuickScrollTimeout=function(){if(
this.sectionProperties.quickScrollVerticalTimer){clearTimeout(
this.sectionProperties.quickScrollVerticalTimer);
this.sectionProperties.quickScrollVerticalTimer=null}if(
this.sectionProperties.quickScrollHorizontalTimer){clearTimeout(
this.sectionProperties.quickScrollHorizontalTimer);
this.sectionProperties.quickScrollHorizontalTimer=null}};
ScrollSection.prototype.onMouseDown=function(point,e){
var scrollProps=app.activeDocument.activeView.scrollProperties;this.clearQuickScrollTimeout();
this.onMouseMove(point,null,e);this.isMouseOnScrollBar(point);var mirrorX=this.isRTL();if(
app.activeDocument.activeView.viewedRectangle.pY1>=0){if(!mirrorX&&point.pX>=this.size[0
]-scrollProps.usableThickness||mirrorX&&point.pY<=scrollProps.usableThickness){if(
point.pY>scrollProps.yOffset){this.sectionProperties.clickScrollVertical=true;
this.map.scrollingIsHandled=true;this.quickScrollVertical(point);
this.sectionProperties.pointerReCaptureSpacer=this.getLocalYOnVerticalScrollBar(point);
e.stopPropagation();this.stopPropagating()}else{this.sectionProperties.clickScrollVertical=false}
}else{this.sectionProperties.clickScrollVertical=false}}if(
app.activeDocument.activeView.viewedRectangle.pX1>=0){if(point.pY>=this.size[1
]-scrollProps.usableThickness){if(!mirrorX&&point.pX>=scrollProps.xOffset&&point.pX<=this.size[0
]-scrollProps.horizontalScrollRightOffset||mirrorX&&point.pX>=scrollProps.xOffset&&point.pX>=scrollProps.horizontalScrollRightOffset
){this.sectionProperties.clickScrollHorizontal=true;this.map.scrollingIsHandled=true;
this.quickScrollHorizontal(point);
this.sectionProperties.pointerReCaptureSpacer=this.getLocalXOnHorizontalScrollBar(point);
e.stopPropagation();this.stopPropagating()}else{this.sectionProperties.clickScrollHorizontal=false}
}else{this.sectionProperties.clickScrollHorizontal=false}}};
ScrollSection.prototype.onMouseUp=function(point,e){window.L.DomUtil.removeClass(
document.documentElement,"prevent-select");this.map.scrollingIsHandled=false;
this.clearQuickScrollTimeout();if(this.sectionProperties.clickScrollVertical){e.stopPropagation();
this.stopPropagating();this.sectionProperties.clickScrollVertical=false;
this.sectionProperties.pointerSyncWithVerticalScrollBar=true}else if(
this.sectionProperties.clickScrollHorizontal){e.stopPropagation();this.stopPropagating();
this.sectionProperties.clickScrollHorizontal=false;
this.sectionProperties.pointerSyncWithHorizontalScrollBar=true}else if(
window.L.Map.THIS.mouse&&window.L.Map.THIS.mouse._mouseDown&&this.containerObject.targetBoundSectionListContains(
app.CSections.Tiles.name)&&window.mode.isDesktop()&&this.containerObject.isDraggingSomething(
)&&window.L.Map.THIS._docLayer._docType==="spreadsheet"){
var temp=this.containerObject.getPositionOnMouseUp();var tempPos=[temp[0]*app.dpiScale,temp[1
]*app.dpiScale];tempPos=[tempPos[0]+app.activeDocument.activeView.viewedRectangle.pX1,tempPos[1
]+app.activeDocument.activeView.viewedRectangle.pY1];tempPos=[Math.round(tempPos[0
]*app.pixelsToTwips),Math.round(tempPos[1]*app.pixelsToTwips)];this.onScrollVelocity({vx:0,vy:0});
window.L.Map.THIS.mouse._mouseDown=false;window.L.Map.THIS._docLayer._postMouseEvent("buttonup",
tempPos[0],tempPos[1],1,1,0)}this.sectionProperties.previousDragDistance=null;this.onMouseMove(point
,null,e)};ScrollSection.prototype.onClick=function(point,e){if(
this.isAnimating&&this.sectionProperties.animatingWheelScrollVertical
)this.containerObject.stopAnimating()};ScrollSection.prototype.animateScroll=function(delta){
var lineHeight=this.containerObject.getScrollLineHeight();for(var i=0;i<2;++i){if(Math.abs(delta[i]
)===0)continue;var sign=delta[i]>0?1:-1;if(sign!==this.sectionProperties.scrollAnimationDirection[i]
){this.sectionProperties.scrollAnimationVelocity[i]=0;this.sectionProperties.scrollAnimationAcc[i]=0
this.sectionProperties.scrollAnimationDirection[i]=sign}this.sectionProperties.scrollAnimationDelta[
i]=lineHeight*ScrollSection.scrollWheelDelta*sign*app.dpiScale}if(
!this.sectionProperties.animatingScroll){this.sectionProperties.animatingScroll=true;
this.sectionProperties.lastElapsedTime=0;if(!this.startAnimating({defer:true}))this.resetAnimation()
}};ScrollSection.prototype.onMouseWheel=function(point,delta,e){var _this=this;if(e.ctrlKey)return;
this.map.fire("closepopups");var hscroll=0,vscroll=0;if(Math.abs(delta[1])>Math.abs(delta[0])){if(
e.shiftKey)hscroll=delta[1];else vscroll=delta[1]}else hscroll=delta[0];
var shouldAnimate=this.sectionProperties.animateWheelScroll&&!this.sectionProperties.scrollAnimationDisableTimeout
if(shouldAnimate){if(e.deltaMode!==WheelEvent.DOM_DELTA_PIXEL){
this.sectionProperties.scrollQuirks=false;if(Math.abs(e.wheelDeltaY)<=32&&Math.abs(e.wheelDeltaX
)<=32)shouldAnimate=false}else if(!this.sectionProperties.scrollQuirks)shouldAnimate=false;if(
e.deltaX!==0&&e.deltaY!==0){shouldAnimate=false}else if(this.sectionProperties.scrollQuirks){
var nowIsAccurate=performance.now()%1!==0;var hasFractionalComponent=e.deltaX%1!==0||e.deltaY%1!==0;
var deltaMaybeDiscrete=Math.abs(e.wheelDelta)%60===0;if(hasFractionalComponent&&(
!nowIsAccurate||!deltaMaybeDiscrete)){shouldAnimate=false}else if(nowIsAccurate&&!deltaMaybeDiscrete
){shouldAnimate=false}}}hscroll*=app.dpiScale;vscroll*=app.dpiScale;if(shouldAnimate
)this.animateScroll([hscroll,vscroll]);else{this.sectionProperties.animatingScroll=false;if(
this.sectionProperties.scrollAnimationDisableTimeout)clearTimeout(
this.sectionProperties.scrollAnimationDisableTimeout);
this.sectionProperties.scrollAnimationDisableTimeout=setTimeout(function(){
_this.sectionProperties.scrollAnimationDisableTimeout=null},ScrollSection.scrollDirectTimeoutMs);
this.sectionProperties.scrollWheelDelta[0]+=hscroll;this.sectionProperties.scrollWheelDelta[1
]+=vscroll;if(!this.isAnimating)this.startAnimating({})}};
ScrollSection.scrollAnimationAcceleration=.1;ScrollSection.scrollWheelDelta=3;
ScrollSection.scrollDirectTimeoutMs=100;return ScrollSection}(CanvasSectionObject);
cool.ScrollSection=ScrollSection})(cool||(cool={}));function clamp(num,min,max){return Math.min(
Math.max(num,min),max)}var CStyleData=window.L.Class.extend({initialize:function(styleDataDiv){
this._div=styleDataDiv},getPropValue:function(name){return getComputedStyle(this._div
).getPropertyValue(name)},getIntPropValue:function(name){return parseInt(this.getPropValue(name))},
getFloatPropValue:function(name){return parseFloat(this.getPropValue(name))},
getFloatPropWithoutUnit:function(name){var value=this.getPropValue(name);if(value.indexOf("px")
)value=value.split("px")[0];return parseFloat(value)}});var CSelections=window.L.Class.extend({
initialize:function(pointSet,canvasOverlay,selectionsDataDiv,map,isView,viewId,selectionType){
this._pointSet=pointSet?pointSet:new CPointSet;this._overlay=canvasOverlay;
this._styleData=new CStyleData(selectionsDataDiv);this._map=map;this._name="selections"+(
isView?"-viewid-"+viewId:"");this._isView=isView;this._viewId=viewId;
this._isText=selectionType==="text";this._isOle=selectionType==="ole";this._selection=undefined;
this._updateSelection();this._selectedMode=0},empty:function(){
return!this._pointSet||this._pointSet.empty()},clear:function(){this.setPointSet(new CPointSet)},
setPointSet:function(pointSet){this._pointSet=pointSet;this._updateSelection()},contains:function(
corePxPoint){if(!this._selection)return false;return this._selection.anyRingBoundContains(
corePxPoint)},getBounds:function(){return this._selection.getBounds()},_updateSelection:function(){
if(!this._selection){if(!this._isOle){var fillColor=this._isView?app.LOUtil.rgbToHex(
this._map.getViewColor(this._viewId)):this._styleData.getPropValue("background-color");
var opacity=this._styleData.getFloatPropValue("opacity");
var weight=this._styleData.getFloatPropWithoutUnit("border-top-width");var attributes=this._isText?{
viewId:this._isView?this._viewId:undefined,groupType:PathGroupType.TextSelection,name:this._name,
pointerEvents:"none",fillColor:fillColor,fillOpacity:opacity,color:fillColor,opacity:.6,stroke:true,
fill:true,weight:1}:{viewId:this._isView?this._viewId:undefined,name:this._name,
pointerEvents:"none",color:fillColor,fillColor:fillColor,fillOpacity:opacity,opacity:1,
weight:Math.round(weight*app.dpiScale)}}else{var attributes={pointerEvents:"none",fillColor:"black",
fillOpacity:.25,weight:0,opacity:.25}}if(this._isText){this._selection=new CPolygon(this._pointSet,
attributes)}else if(this._isOle){this._selection=new CDarkOverlay(this._pointSet,attributes)}else{
this._selection=new CCellSelection(this._pointSet,attributes)}if(this._isText
)this._overlay.initPath(this._selection);else this._overlay.initPathGroup(this._selection);return}
this._selection.setPointSet(this._pointSet)},remove:function(){if(!this._selection)return;if(
this._isText)this._overlay.removePath(this._selection);else this._overlay.removePathGroup(
this._selection)}});var CReferences=window.L.Class.extend({initialize:function(canvasOverlay){
this._overlay=canvasOverlay;this._marks=[]},addMark:function(mark){this._overlay.initPath(mark);
this._marks.push(mark)},hasMark:function(mark){for(var i=0;i<this._marks.length;++i){if(
mark.getBounds().equals(this._marks[i].getBounds()))return true}return false},clear:function(){for(
var i=0;i<this._marks.length;++i)this._overlay.removePath(this._marks[i]);this._marks=[]}});
window.L.TileSectionManager=window.L.Class.extend({initialize:function(layer){this._layer=layer;
this._canvas=this._layer._canvas;this._map=this._layer._map;
var mapSize=this._map.getPixelBoundsCore().getSize();this._tilesSection=null;if(
window.L.Browser.cypressTest)app.sectionContainer.testing=true;app.sectionContainer.onResize(
mapSize.x,mapSize.y);var splitPanesContext=this._layer.getSplitPanesContext();
this._splitPos=splitPanesContext?splitPanesContext.getSplitPos():new cool.Point(0,0);
this._updatesRunning=false;this._mirrorEventsFromSourceToCanvasSectionContainer(
document.getElementById("map"));var canvasContainer=document.getElementById("document-container");
var that=this;this.resObserver=new ResizeObserver(function(){that._layer._syncTileContainerSize()});
this.resObserver.observe(canvasContainer);this._zoomAtDocEdgeX=true;this._zoomAtDocEdgeY=true},
_mirrorEventsFromSourceToCanvasSectionContainer:function(sourceElement){
sourceElement.addEventListener("mousedown",function(e){app.sectionContainer.onMouseDown(e)},true);
sourceElement.addEventListener("click",function(e){app.sectionContainer.onClick(e)},true);
sourceElement.addEventListener("dblclick",function(e){app.sectionContainer.onDoubleClick(e)},true);
sourceElement.addEventListener("contextmenu",function(e){app.sectionContainer.onContextMenu(e)},true
);sourceElement.addEventListener("wheel",function(e){app.sectionContainer.onMouseWheel(e)},true);
sourceElement.addEventListener("mouseleave",function(e){app.sectionContainer.onMouseLeave(e)},true);
sourceElement.addEventListener("mouseenter",function(e){app.sectionContainer.onMouseEnter(e)},true);
sourceElement.addEventListener("touchstart",function(e){app.sectionContainer.onTouchStart(e)},true);
sourceElement.addEventListener("touchmove",function(e){app.sectionContainer.onTouchMove(e)},true);
sourceElement.addEventListener("touchend",function(e){app.sectionContainer.onTouchEnd(e)},true);
sourceElement.addEventListener("touchcancel",function(e){app.sectionContainer.onTouchCancel(e)},true
)},getSplitPos:function(){var splitPanesContext=this._layer.getSplitPanesContext();
return splitPanesContext?splitPanesContext.getSplitPos().multiplyBy(app.dpiScale):new cool.Point(0,0
)},_paintContext:function(){var viewBounds=this._map.getPixelBoundsCore();
var splitPanesContext=this._layer.getSplitPanesContext();
var paneBoundsList=splitPanesContext?splitPanesContext.getPxBoundList(viewBounds):[viewBounds];
return{viewBounds:viewBounds,paneBoundsList:paneBoundsList,
paneBoundsActive:splitPanesContext?true:false,splitPos:this.getSplitPos()}},
_addSplitsSection:function(){const splitSection=new SplitSection;app.sectionContainer.addSection(
splitSection)},_removeSplitsSection:function(){var section=app.sectionContainer.getSectionWithName(
"calc grid");if(section){section.setDrawingOrder(app.CSections.CalcGrid.drawingOrder);
section.sectionProperties.strokeStyle="#c0c0c0"}app.sectionContainer.removeSection(
app.CSections.Debug.Splits.name)},_addTilePixelGridSection:function(){
app.sectionContainer.addSection(new app.definitions.pixelGridSection)},
_removeTilePixelGridSection:function(){app.sectionContainer.removeSection(
app.CSections.Debug.TilePixelGrid.name)},_addDebugOverlaySection:function(){
app.sectionContainer.addSection(new app.definitions.debugOverlaySection(this._map._debug))},
_removeDebugOverlaySection:function(){app.sectionContainer.removeSection(
app.CSections.Debug.DebugOverlay.name)},_addPreloadMap:function(){app.sectionContainer.addSection(
new app.definitions.preloadMapSection)},_removePreloadMap:function(){
app.sectionContainer.removeSection(app.CSections.Debug.PreloadMap.name)},update:function(){
app.sectionContainer.requestReDraw()},_getZoomDocPos:function(pinchCenter,pinchStartCenter,
paneBounds,freezePane,splitPos,scale,findFreePaneCenter){let xMin=0;
const hasXMargin=!this._layer.isCalc();if(hasXMargin){xMin=-Infinity}else if(paneBounds.min.x>0){
xMin=splitPos.x}let yMin=0;if(paneBounds.min.y<0){yMin=-Infinity}else if(paneBounds.min.y>0){
yMin=splitPos.y}const minTopLeft=new cool.Point(xMin,yMin);const paneSize=paneBounds.getSize();
pinchCenter=pinchCenter.subtract(this._offset);let centerOffset={x:pinchCenter.x-pinchStartCenter.x,
y:pinchCenter.y-pinchStartCenter.y};const panePortion={x:(
pinchStartCenter.x-this._offset.x-paneBounds.min.x)/paneSize.x,y:(
pinchStartCenter.y-this._offset.y-paneBounds.min.y)/paneSize.y};let docTopLeft=new cool.Point(
pinchStartCenter.x+(centerOffset.x-paneSize.x*panePortion.x)/scale,pinchStartCenter.y+(
centerOffset.y-paneSize.y*panePortion.y)/scale);const clampedDocTopLeft=new cool.Point(Math.max(
minTopLeft.x,docTopLeft.x),Math.max(minTopLeft.y,docTopLeft.y));
const offset=clampedDocTopLeft.subtract(docTopLeft);if(freezePane.freezeX){
docTopLeft.x=paneBounds.min.x}else{this._offset.x=Math.round(Math.max(this._offset.x,offset.x));
docTopLeft.x+=this._offset.x}if(freezePane.freezeY){docTopLeft.y=paneBounds.min.y}else{
this._offset.y=Math.round(Math.max(this._offset.y,offset.y));docTopLeft.y+=this._offset.y}if(
!findFreePaneCenter){return{offset:this._offset,topLeft:docTopLeft}}
const newPaneCenter=new cool.Point(docTopLeft.x-splitPos.x+(paneSize.x+splitPos.x)*.5/scale,
docTopLeft.y-splitPos.y+(paneSize.y+splitPos.y)*.5/scale);return{offset:this._offset,
topLeft:docTopLeft.add(this._offset),center:this._map.rescale(newPaneCenter,this._map.getZoom(),
this._map.getScaleZoom(scale))}},_getZoomMapCenter:function(zoom){
var scale=this._calcZoomFrameScale(zoom);var ctx=this._paintContext();var splitPos=ctx.splitPos;
var viewBounds=ctx.viewBounds;var freePaneBounds=new cool.Bounds(viewBounds.min.add(splitPos),
viewBounds.max);return this._getZoomDocPos(this._newCenter,this._layer._pinchStartCenter,
freePaneBounds,{freezeX:false,freezeY:false},splitPos,scale,true).center},_zoomAnimation:function(){
var painter=this;var ctx=this._paintContext();var canvasOverlay=this._layer._canvasOverlay;
var rafFunc=function(timeStamp,final){painter._layer._refreshRowColumnHeaders();
painter._tilesSection.drawZoomFrame(ctx);canvasOverlay.onDraw();if(!final
)painter._zoomRAF=requestAnimationFrame(rafFunc)};this.rafFunc=rafFunc;rafFunc()},
_calcZoomFrameScale:function(zoom){zoom=this._layer._map._limitZoom(zoom);
var origZoom=this._layer._map.getZoom();return this._layer._map.zoomToFactor(
zoom-origZoom+this._layer._map.options.zoom)},_calcZoomFrameParams:function(zoom,newCenter){
this._zoomFrameScale=this._calcZoomFrameScale(zoom);this._newCenter=this._layer._map.project(
newCenter).multiplyBy(app.dpiScale)},setWaitForTiles:function(wait){this._waitForTiles=wait},
waitForTiles:function(){return this._waitForTiles},zoomStep:function(zoom,newCenter){if(
this._finishingZoom)return;this._calcZoomFrameParams(zoom,newCenter);if(!this._inZoomAnim){
app.sectionContainer.setInZoomAnimation(true);this._inZoomAnim=true;this._zoomAnimation()}},
zoomStepEnd:function(zoom,newCenter,mapUpdater,runAtFinish,noGap){if(
!this._inZoomAnim||this._finishingZoom)return;this._finishingZoom=true;this._map.disableTextInput();
var steps=10;var stepId=noGap?steps:0;var startZoom=this._zoomFrameScale;
var endZoom=this._calcZoomFrameScale(zoom);var painter=this;var map=this._map;
var newMapCenter=this._getZoomMapCenter(zoom).divideBy(app.dpiScale);
var newMapCenterLatLng=map.unproject(newMapCenter,zoom);app.sectionContainer.setZoomChanged(true);
var stopAnimation=noGap?true:false;var waitForTiles=false;var waitTries=30;
var finishingRAF=undefined;var finishAnimation=function(){if(stepId<steps){
painter._zoomFrameScale=startZoom+(endZoom-startZoom)*stepId/steps;stepId+=1;if(stepId>=steps
)stopAnimation=true}if(stopAnimation){stopAnimation=false;cancelAnimationFrame(painter._zoomRAF);
painter._calcZoomFrameParams(zoom,newCenter);painter.rafFunc(undefined,true);
painter._zoomFrameScale=undefined;app.sectionContainer.setInZoomAnimation(false);
painter._inZoomAnim=false;painter.setWaitForTiles(true);mapUpdater(newMapCenterLatLng);
waitForTiles=true}if(waitForTiles){if(waitTries<=0||painter._tilesSection.haveAllTilesInView()){
waitForTiles=false;cancelAnimationFrame(finishingRAF);painter.setWaitForTiles(false);
app.sectionContainer.setZoomChanged(false);map.enableTextInput();map.focus(
map.canAcceptKeyboardInput());app.sectionContainer.requestReDraw();painter._finishingZoom=false;
runAtFinish();return}else waitTries-=1}finishingRAF=requestAnimationFrame(finishAnimation)};
finishAnimation()},getTileSectionPos:function(){return new cool.Point(this._tilesSection.myTopLeft[0
],this._tilesSection.myTopLeft[1])}});window.L.CanvasTileLayer=window.L.Layer.extend({options:{
tileSize:window.tileSize,opacity:1,updateWhenIdle:window.mode.isMobile()||window.mode.isTablet(),
updateInterval:200,attribution:null,zIndex:null,bounds:null,previewInvalidationTimeout:1e3},
_pngCache:[],initialize:function(options){window.L.Layer.prototype.initialize.call(this);
options=window.L.setOptions(this,options);this._docType=options.docType;this._documentInfo="";if(
this._docType!=="text")app.setCursorVisibility(false);this.lastCursorPos=null;this._isZooming=false;
app.calc.cellCursorVisible=false;this._prevCellCursorAddress=null;
this._shapeGridOffset=new cool.SimplePoint(0,0);this._viewSelections={};this._lastValidPart=-1;
this._cursorMarker=null;this._initializeTableOverlay();this._msgQueue=[];
this._toolbarCommandValues={};this._previewInvalidations=[];this._editorId=-1;app.setFollowingUser(
options.viewId);this._selectedTextContent="";this._moveInProgress=false;this._moveTileRequests=[];
this._canonicalIdInitialized=false;TileManager.initialize()},_initContainer:function(){if(
this._canvasContainer){window.app.console.error(
"called _initContainer() when this._canvasContainer is present!")}if(this._container){return}
this._container=window.L.DomUtil.create("div","leaflet-layer");this._updateZIndex();this.getPane(
).appendChild(this._container);var mapContainer=document.getElementById("document-container");
var canvasContainerClass="leaflet-canvas-container";this._canvasContainer=window.L.DomUtil.create(
"div",canvasContainerClass,mapContainer);this._canvasContainer.id="canvas-container";this._setup()},
_setup:function(){if(!this._canvasContainer){window.app.console.error(
"canvas container not found. _initContainer failed ?")}this._canvas=window.L.DomUtil.createWithId(
"canvas","document-canvas",this._canvasContainer);this._canvas.style.visibility="hidden";
app.sectionContainer=new CanvasSectionContainer(this._canvas,this.isCalc());
app.activeDocument=new DocumentBase;this._container.style.position="absolute";
this._cursorDataDiv=window.L.DomUtil.create("div","cell-cursor-data",this._canvasContainer);
this._selectionsDataDiv=window.L.DomUtil.create("div","selections-data",this._canvasContainer);
this._splittersDataDiv=window.L.DomUtil.create("div","splitters-data",this._canvasContainer);
this._cursorOverlayDiv=window.L.DomUtil.create("div","cursor-overlay",this._canvasContainer);if(
window.L.Browser.cypressTest){this._emptyDeltaDiv=window.L.DomUtil.create("div","empty-deltas",
this._canvasContainer);this._emptyDeltaDiv.innerText=0}this._splittersStyleData=new CStyleData(
this._splittersDataDiv);this._painter=new window.L.TileSectionManager(this);
app.sectionContainer.addSection(new cool.TilesSection);
this._painter._tilesSection=app.sectionContainer.getSectionWithName("tiles");
app.sectionContainer.setDocumentAnchorSection(app.CSections.Tiles.name);
app.sectionContainer.getSectionWithName("tiles").onResize();this._canvasOverlay=new CanvasOverlay(
this._map,app.sectionContainer.getContext());app.sectionContainer.addSection(this._canvasOverlay);
app.sectionContainer.addSection(new cool.ScrollSection(()=>this.isCalcRTL()));if(
window.mode.isMobile()||window.mode.isTablet()){this._map.on("move",this._painter.update,
this._painter);this._map.on("moveend",function(){setTimeout(this.update.bind(this),200)},
this._painter)}this._map.on("zoomend",this._painter.update,this._painter);this._map.on(
"splitposchanged",function(){TileManager.update()},this);this._map.on("sheetgeometrychanged",
this._painter.update,this._painter);this._map.on("move",this._syncTilePanePos,this);this._map.on(
"viewrowcolumnheaders",this._painter.update,this._painter);this._map.on("messagesdone",
TileManager.sendProcessedResponse,TileManager);if(this._docType==="spreadsheet"){
const calcGridSection=new app.definitions.calcGridSection;
calcGridSection.sectionProperties.tsManager=this._painter;
this._painter._calcGridSection=calcGridSection;app.sectionContainer.addSection(calcGridSection)}
app.sectionContainer.addSection(new app.definitions.CommentSection);this._syncTileContainerSize();
this._setupTableOverlay()},isWriter:function(){return this._docType==="text"},isCalc:function(){
return this._docType==="spreadsheet"},isImpress:function(){return this._docType==="presentation"},
getContainer:function(){return this._container},_updateZIndex:function(){if(
this._container&&this.options.zIndex!==undefined&&this.options.zIndex!==null){
this._container.style.zIndex=this.options.zIndex}},_reset:function(hard){var tileZoom=Math.round(
this._map.getZoom()),tileZoomChanged=this._tileZoom!==tileZoom;if(hard||tileZoomChanged){
this._resetClientVisArea();this._tileZoom=tileZoom;if(tileZoomChanged){this._updateTileTwips();
this._updateMaxBounds()}if(app.tile.size.x===0||app.tile.size.y===0){
let tileWidthTwips=this.options.tileWidthTwips;app.twipsToPixels=TileManager.tileSize/tileWidthTwips
app.pixelsToTwips=1/app.twipsToPixels;app.tile.size.pX=app.tile.size.pY=TileManager.tileSize}if(
!window.L.Browser.mobileWebkit)TileManager.update(this._map.getCenter(),tileZoom);if(tileZoomChanged
)TileManager.pruneTiles();if(this._docType==="spreadsheet")this._syncTileContainerSize()}},
_resetClientVisArea:function(){this._clientZoom="";
app.activeDocument.activeView.resetClientVisibleArea()},_resetCanonicalIdStatus:function(){
this._canonicalIdInitialized=false},_resetViewId:function(){this._viewId=undefined},
_resetDocumentInfo:function(){this._documentInfo=""},_getViewId:function(){return this._viewId},
_updateTileTwips:function(){const factor=Math.pow(1.2,this._map.options.zoom-this._tileZoom);
const tileWidthTwips=Math.round(this.options.tileWidthTwips*factor);
app.twipsToPixels=TileManager.tileSize/tileWidthTwips;app.pixelsToTwips=1/app.twipsToPixels;
app.tile.size.pX=app.tile.size.pY=TileManager.tileSize;if(this._docType==="spreadsheet"
)this._syncTileContainerSize()},_checkSpreadSheetBounds:function(newZoom){
var viewSize=this._map.getSize();var scale=this._map.getZoomScale(newZoom);
var width=app.activeDocument.fileSize.x/app.tile.size.x*TileManager.tileSize*scale;
var height=app.activeDocument.fileSize.y/app.tile.size.y*TileManager.tileSize*scale;if(
width<viewSize.x||height<viewSize.y){width=Math.max(width,viewSize.x);height=Math.max(height,
viewSize.y);if(!this._map.options._origMaxBounds){
this._map.options._origMaxBounds=this._map.options.maxBounds}scale=this._map.options.crs.scale(1);
this._map.setMaxBounds(new window.L.LatLngBounds(this._map.unproject(new cool.Point(0,0)),
this._map.unproject(new cool.Point(width*scale,height*scale))))}else if(
this._map.options._origMaxBounds){this._map.setMaxBounds(this._map.options._origMaxBounds);
this._map.options._origMaxBounds=null}},_moveStart:function(){TileManager.resetPreFetching();
this._moveInProgress=true;this._moveTileRequests=[]},_move:function(){if(!this._moveInProgress
)return;TileManager.update();TileManager.resetPreFetching(true)},_isLatLngInView:function(position){
var centerOffset=this._map._getCenterOffset(position);var viewHalf=this._map.getSize()._divideBy(2);
var positionInView=centerOffset.x>-viewHalf.x&&centerOffset.x<viewHalf.x&&centerOffset.y>-viewHalf.y&&centerOffset.y<viewHalf.y
return positionInView},_moveEnd:function(){this._move();this._moveInProgress=false;
this._moveTileRequests=[];app.updateFollowingUsers()},_requestNewTiles:function(){
this.handleInvalidateTilesMsg("invalidatetiles: EMPTY");TileManager.update()},
_sendClientZoom:function(forceUpdate){if(!this._map._docLoaded)return;
var newClientZoom="tilepixelwidth="+TileManager.tileSize+" "+"tilepixelheight="+TileManager.tileSize+" "+"tiletwipwidth="+app.tile.size.x+" "+"tiletwipheight="+app.tile.size.y+" "+"dpiscale="+window.devicePixelRatio+" "+"zoompercent="+this._map.getZoomPercent(
);if(this._clientZoom!==newClientZoom||forceUpdate){app.socket.sendMessage(
"clientzoom "+newClientZoom);if(!this._map._fatal&&app.idleHandler._active&&app.socket.connected()
)this._clientZoom=newClientZoom}},_twipsRectangleToPixelBounds:function(strRectangle){
var strTwips=strRectangle.match(/\d+/g);if(!strTwips){return null}var topLeftTwips=new cool.Point(
parseInt(strTwips[0]),parseInt(strTwips[1]));var offset=new cool.Point(parseInt(strTwips[2]),
parseInt(strTwips[3]));var bottomRightTwips=topLeftTwips.add(offset);return new cool.Bounds(
this._twipsToPixels(topLeftTwips),this._twipsToPixels(bottomRightTwips))},
_twipsRectanglesToPixelBounds:function(strRectangles){strRectangles=strRectangles.split(";");
var boundsList=[];for(var i=0;i<strRectangles.length;i++){
var bounds=this._twipsRectangleToPixelBounds(strRectangles[i]);if(bounds){boundsList.push(bounds)}}
return boundsList},getMaxDocSize:function(){return undefined},getSnapDocPosX:function(docPosPixX){
return docPosPixX},getSnapDocPosY:function(docPosPixY){return docPosPixY},
getSplitPanesContext:function(){return undefined},_createNewMouseEvent:function(type,inputEvent){
var event=inputEvent;if(inputEvent.type=="touchstart"||inputEvent.type=="touchmove"){
event=inputEvent.touches[0]}else if(inputEvent.type=="touchend"){event=inputEvent.changedTouches[0]}
var newEvent=document.createEvent("MouseEvents");newEvent.initMouseEvent(type,true,true,window,1,
event.screenX,event.screenY,event.clientX,event.clientY,false,false,false,false,0,null);
return newEvent},_getToolbarCommandsValues:function(){for(
var i=0;i<this._map.unoToolbarCommands.length;i++){var command=this._map.unoToolbarCommands[i];
app.socket.sendMessage("commandvalues command="+command)}},_parseCellRange:function(cellRange){
var strTwips=cellRange.match(/\d+/g);var startCellAddress=[parseInt(strTwips[0]),parseInt(strTwips[1
])];var endCellAddress=[parseInt(strTwips[2]),parseInt(strTwips[3])];return new cool.Bounds(
startCellAddress,endCellAddress)},_cellRangeToTwipRect:function(cellRange){
var startCell=cellRange.getTopLeft();var startCellRectPixel=this.sheetGeometry.getCellRect(
startCell.x,startCell.y);var topLeftTwips=this._corePixelsToTwips(startCellRectPixel.min);
var endCell=cellRange.getBottomRight();var endCellRectPixel=this.sheetGeometry.getCellRect(endCell.x
,endCell.y);var bottomRightTwips=this._corePixelsToTwips(endCellRectPixel.max);
return new cool.Bounds(topLeftTwips,bottomRightTwips)},_onMessage:function(textMsg,img){
this._saveMessageForReplay(textMsg);if(textMsg.startsWith("tile:")||textMsg.startsWith("delta:")){
TileManager.onTileMsg(textMsg,img)}else if(textMsg.startsWith("commandvalues:")){
this._onCommandValuesMsg(textMsg)}else if(textMsg.startsWith("cursorvisible:")){
this._onCursorVisibleMsg(textMsg)}else if(textMsg.startsWith("downloadas:")){this._onDownloadAsMsg(
textMsg)}else if(textMsg.startsWith("error:")){this._onErrorMsg(textMsg)}else if(textMsg.startsWith(
"getchildid:")){this._onGetChildIdMsg(textMsg)}else if(textMsg.startsWith("shapeselectioncontent:")
){GraphicSelection.onShapeSelectionContent(textMsg)}else if(textMsg.startsWith("graphicselection:")
){this._map.fire("resettopbottompagespacing");GraphicSelection.onMessage(textMsg)}else if(
textMsg.startsWith("graphicinnertextarea:")){return}else if(textMsg.startsWith("cellcursor:")){
this._onCellCursorMsg(textMsg)}else if(textMsg.startsWith("celladdress:")){this._onCellAddressMsg(
textMsg)}else if(textMsg.startsWith("cellformula:")){this._onCellFormulaMsg(textMsg)}else if(
textMsg.startsWith("referencemarks:")){this._onReferencesMsg(textMsg)}else if(textMsg.startsWith(
"referenceclear:")){this._clearReferences()}else if(textMsg.startsWith("invalidatecursor:")){
this._onInvalidateCursorMsg(textMsg)}else if(textMsg.startsWith("invalidatetiles:")){console.error(
"Message should be filterd during slurp")}else if(textMsg.startsWith("mousepointer:")){
this._onMousePointerMsg(textMsg)}else if(textMsg.startsWith("renderfont:")){this._onRenderFontMsg(
textMsg,img)}else if(textMsg.startsWith("searchnotfound:")){this._onSearchNotFoundMsg(textMsg)
}else if(textMsg.startsWith("searchresultselection:")){this._onSearchResultSelection(textMsg)
}else if(textMsg.startsWith("setpart:")){this._onSetPartMsg(textMsg)}else if(textMsg.startsWith(
"statechanged:")){this._onStateChangedMsg(textMsg)}else if(textMsg.startsWith("status:"
)||textMsg.startsWith("statusupdate:")){this._onStatusMsg(textMsg);TileManager.update();
app.definitions.otherViewGraphicSelectionSection.updateVisibilities();
app.definitions.otherViewCursorSection.updateVisibilities();this.updateAllTextViewSelection()
}else if(textMsg.startsWith("textselection:")){this._onTextSelectionMsg(textMsg)}else if(
textMsg.startsWith("textselectioncontent:")){let textMsgContent=textMsg.substr(22);
let textMsgHtml="";let textMsgPlainText="";if(textMsgContent.startsWith("{")){
let textMsgJson=JSON.parse(textMsgContent);textMsgHtml=textMsgJson["text/html"];
textMsgPlainText=textMsgJson["text/plain;charset=utf-8"]}else{textMsgHtml=textMsgContent}if(
this._map._clip){this._map._clip.setTextSelectionHTML(textMsgHtml,textMsgPlainText)
}else this._selectedTextContent=textMsgHtml}else if(textMsg.startsWith("clipboardchanged")){
var jMessage=textMsg.substr(17);jMessage=JSON.parse(jMessage);if(jMessage.mimeType==="text/plain"){
this._map._clip.setTextSelectionHTML(jMessage.content);if(
window.L.Browser.clipboardApiAvailable||window.ThisIsTheiOSApp)this._map.fire("clipboardchanged",{
commandName:".uno:CopyHyperlinkLocation"});else this._map._clip._execCopyCutPaste("copy")}}else if(
textMsg.startsWith("textselectionend:")){this._onTextSelectionEndMsg(textMsg)}else if(
textMsg.startsWith("textselectionstart:")){this._onTextSelectionStartMsg(textMsg)}else if(
textMsg.startsWith("cellselectionarea:")){this._onCellSelectionAreaMsg(textMsg)}else if(
textMsg.startsWith("cellautofillarea:")){this._onCellAutoFillAreaMsg(textMsg)}else if(
textMsg.startsWith("complexselection:")){if(this._map._clip)this._map._clip.onComplexSelection(
textMsg.substr("complexselection:".length))}else if(textMsg.startsWith("windowpaint:")){
this._onDialogPaintMsg(textMsg,img)}else if(textMsg.startsWith("window:")){this._onDialogMsg(textMsg
)}else if(textMsg.startsWith("unocommandresult:")){this._onUnoCommandResultMsg(textMsg)}else if(
textMsg.startsWith("hrulerupdate:")){this._onRulerUpdate(textMsg)}else if(textMsg.startsWith(
"vrulerupdate:")){this._onRulerUpdate(textMsg)}else if(textMsg.startsWith("contextmenu:")){
this._onContextMenuMsg(textMsg)}else if(textMsg.startsWith("invalidateviewcursor:")){
this._onInvalidateViewCursorMsg(textMsg)}else if(textMsg.startsWith("viewcursorvisible:")){
this._onViewCursorVisibleMsg(textMsg)}else if(textMsg.startsWith("cellviewcursor:")){
this._onCellViewCursorMsg(textMsg)}else if(textMsg.startsWith("viewinfo:")){this._onViewInfoMsg(
textMsg)}else if(textMsg.startsWith("textviewselection:")){this._onTextViewSelectionMsg(textMsg)
}else if(textMsg.startsWith("graphicviewselection:")){this._onGraphicViewSelectionMsg(textMsg)
}else if(textMsg.startsWith("tableselected:")){this._onTableSelectedMsg(textMsg)}else if(
textMsg.startsWith("editor:")){this._updateEditor(textMsg)}else if(textMsg.startsWith(
"validitylistbutton:")){this._onValidityListButtonMsg(textMsg)}else if(textMsg.startsWith(
"validityinputhelp:")){this._onValidityInputHelpMsg(textMsg)}else if(textMsg.startsWith(
"signaturestatus:")){var signstatus=textMsg.substring("signaturestatus:".length+1);
this._map.onChangeSignStatus(signstatus)}else if(textMsg.startsWith("removesession")){
var viewId=parseInt(textMsg.substring("removesession".length+1));if(
this._map._docLayer._viewId===viewId)app.dispatcher.dispatch("closeapp")}else if(textMsg.startsWith(
"calcfunctionlist:")){this._onCalcFunctionListMsg(textMsg.substring("calcfunctionlist:".length+1))
}else if(textMsg.startsWith("tooltip:")){var tooltipInfo=JSON.parse(textMsg.substring(
"tooltip:".length+1));if(tooltipInfo.type==="formulausage"){this._onCalcFunctionUsageMsg(
tooltipInfo.text)}else if(tooltipInfo.type==="generaltooltip"){var tooltipInfo=JSON.parse(
textMsg.substring(textMsg.indexOf("{")));this._map.uiManager.showDocumentTooltip(tooltipInfo)
}else if(tooltipInfo.type==="autofillpreviewtooltip"){var strTwips=textMsg.match(/\d+/g);if(
strTwips!=null&&this._map.isEditMode())this._map.fire("openautofillpreviewpopup",{data:tooltipInfo})
}else{console.error("unknown tooltip type")}}else if(textMsg.startsWith("tabstoplistupdate:")){
this._onTabStopListUpdate(textMsg)}else if(textMsg.startsWith("context:")){
var message=textMsg.substring("context:".length+1);message=message.split(" ");if(message.length>1){
var old=this._map.context||{};var newContext={appId:message[0],context:message[1]};if(
old.appId!==newContext.appId||old.context!==newContext.context){this._map.context=newContext;
app.events.fire("contextchange",{appId:newContext.appId,context:newContext.context,
oldAppId:old.appId,oldContext:old.context})}}}else if(textMsg.startsWith("formfieldbutton:")){
this._onFormFieldButtonMsg(textMsg)}else if(textMsg.startsWith("canonicalidchange:")){
var payload=textMsg.substring("canonicalidchange:".length+1);var viewRenderedState=payload.split("="
)[3].split(" ")[0];if(this._debug.overlayOn){var viewId=payload.split("=")[1].split(" ")[0];
var canonicalId=payload.split("=")[2].split(" ")[0];this._debug.setOverlayMessage("canonicalViewId",
"Canonical id changed to: "+canonicalId+" for view id: "+viewId+" with view renderend state: "+viewRenderedState
)}if(!this._canonicalIdInitialized){this._canonicalIdInitialized=true;TileManager.update()}else{
this._requestNewTiles();this._invalidateAllPreviews();TileManager.redraw()}}else if(
textMsg.startsWith("comment:")){var obj=JSON.parse(textMsg.substring("comment:".length+1));
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).onACKComment(obj)}else if(
textMsg.startsWith("redlinetablemodified:")){obj=JSON.parse(textMsg.substring(
"redlinetablemodified:".length+1));app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name).onACKComment(obj)}else if(textMsg.startsWith("redlinetablechanged:")
){obj=JSON.parse(textMsg.substring("redlinetablechanged:".length+1));
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).onACKComment(obj)}else if(
textMsg.startsWith("applicationbackgroundcolor:")){app.sectionContainer.setClearColor(
"#"+textMsg.substring("applicationbackgroundcolor:".length+1).trim());
app.sectionContainer.requestReDraw()}else if(textMsg.startsWith("documentbackgroundcolor:")){
app.sectionContainer.setDocumentBackgroundColor("#"+textMsg.substring(
"documentbackgroundcolor:".length+1).trim())}else if(textMsg.startsWith("contentcontrol:")){
textMsg=textMsg.substring("contentcontrol:".length+1);if(!app.sectionContainer.doesSectionExist(
app.CSections.ContentControl.name)){app.sectionContainer.addSection(new cool.ContentControlSection)}
var section=app.sectionContainer.getSectionWithName(app.CSections.ContentControl.name);
section.drawContentControl(JSON.parse(textMsg))}else if(textMsg.startsWith("versionbar:")){
obj=JSON.parse(textMsg.substring("versionbar:".length+1));this._map.fire("versionbar",obj)}else if(
textMsg.startsWith("lockaccessibilityon")){this._map.lockAccessibilityOn()}else if(
textMsg.startsWith("a11y")){if(!window.prefs.getBoolean("accessibilityState")
)throw"A11y events come from the core while it is disabled in the client session.";if(
textMsg.startsWith("a11yfocuschanged:")){obj=JSON.parse(textMsg.substring(
"a11yfocuschanged:".length+1));var listPrefixLength=obj.listPrefixLength!==undefined?parseInt(
obj.listPrefixLength):0;if(typeof this._map._textInput.onAccessibilityFocusChanged==="function"){
this._map._textInput.onAccessibilityFocusChanged(obj.content,parseInt(obj.position),parseInt(
obj.start),parseInt(obj.end),listPrefixLength,parseInt(obj.force)>0)}}else if(textMsg.startsWith(
"a11ycaretchanged:")){obj=JSON.parse(textMsg.substring("a11yfocuschanged:".length+1));if(
typeof this._map._textInput.onAccessibilityCaretChanged==="function"
)this._map._textInput.onAccessibilityCaretChanged(parseInt(obj.position))}else if(
textMsg.startsWith("a11ytextselectionchanged:")){obj=JSON.parse(textMsg.substring(
"a11ytextselectionchanged:".length+1));this._map._textInput.onAccessibilityTextSelectionChanged(
parseInt(obj.start),parseInt(obj.end))}else if(textMsg.startsWith("a11yfocusedcellchanged:")){
obj=JSON.parse(textMsg.substring("a11yfocusedcellchanged:".length+1));
var outCount=obj.outCount!==undefined?parseInt(obj.outCount):0;
var inList=obj.inList!==undefined?obj.inList:[];var row=parseInt(obj.row);var col=parseInt(obj.col);
var rowSpan=obj.rowSpan!==undefined?parseInt(obj.rowSpan):1;
var colSpan=obj.colSpan!==undefined?parseInt(obj.colSpan):1;
this._map._textInput.onAccessibilityFocusedCellChanged(outCount,inList,row,col,rowSpan,colSpan,
obj.paragraph)}else if(textMsg.startsWith("a11yeditinginselectionstate:")){obj=JSON.parse(
textMsg.substring("a11yeditinginselectionstate:".length+1));
this._map._textInput.onAccessibilityEditingInSelectionState(parseInt(obj.cell)>0,parseInt(
obj.enabled)>0,obj.selection,obj.paragraph)}else if(textMsg.startsWith("a11yselectionchanged:")){
obj=JSON.parse(textMsg.substring("a11yselectionchanged:".length+1));
this._map._textInput.onAccessibilitySelectionChanged(parseInt(obj.cell)>0,obj.action,obj.name,
obj.text)}else if(textMsg.startsWith("a11yfocusedparagraph:")){obj=JSON.parse(textMsg.substring(
"a11yfocusedparagraph:".length+1));this._map._textInput.setA11yFocusedParagraph(obj.content,
parseInt(obj.position),parseInt(obj.start),parseInt(obj.end))}else if(textMsg.startsWith(
"a11ycaretposition:")){var pos=textMsg.substring("a11ycaretposition:".length+1);
this._map._textInput.setA11yCaretPosition(parseInt(pos))}}else if(textMsg.startsWith(
"colorpalettes:")){var json=JSON.parse(textMsg.substring("colorpalettes:".length+1));for(
var key in json){if(key==="ColorNames"){window.app.colorNames=json[key];continue}if(
app.colorPalettes[key]){app.colorPalettes[key].colors=json[key]}else{window.app.console.warn(
'Unknown palette: "'+key+'"')}}for(var key in app.colorPalettes){if(!app.colorPalettes[key
].colors||!app.colorPalettes[key].colors.length){delete app.colorPalettes[key]}}}else if(
textMsg.startsWith("serveraudit:")){var serverAudit=textMsg.substr(12).trim();if(
serverAudit!=="disabled"){if(app.isAdminUser!==false){
this._map.serverAuditDialog=JSDialog.serverAuditDialog(this._map);if(this._map.uiManager.notebookbar
){this._map.uiManager.notebookbar.showItem("server-audit");this._map.uiManager.notebookbar.showItem(
"help-serveraudit-break")}}var json=JSON.parse(serverAudit);app.setServerAuditFromCore(
json.serverAudit)}}else if(textMsg.startsWith("adminuser:")){var value=textMsg.substr(10).trim();if(
value==="true")app.isAdminUser=true;else if(value==="false"
)app.isAdminUser=false;else app.isAdminUser=null;this._map.fire("adminuser")}else if(
textMsg.startsWith("presentationinfo:")){var content=JSON.parse(textMsg.substring(
"presentationinfo:".length+1));this._map.fire("presentationinfo",content)}else if(
textMsg.startsWith("slideshowfollow")){const eventInfo=textMsg.substr("slideshowfollow ".length);
const parameterStartIndex=eventInfo.indexOf("{");if(parameterStartIndex===-1){this._map.fire(
eventInfo)}else{const event=eventInfo.substring(0,parameterStartIndex).trim();
const parameter=JSON.parse(eventInfo.substring(parameterStartIndex));this._map.fire(event,parameter)
}}},_onInvalidateTilesMsg:function(textMsg){const command=app.socket.parseServerCmd(textMsg);if(
command.x===undefined||command.y===undefined||command.part===undefined){var strTwips=textMsg.match(
/\d+/g);command.x=parseInt(strTwips[0]);command.y=parseInt(strTwips[1]);command.width=parseInt(
strTwips[2]);command.height=parseInt(strTwips[3]);command.part=this._selectedPart}if(isNaN(
command.mode))command.mode=this._selectedMode;const invalidArea=new cool.SimpleRectangle(command.x,
command.y,command.width,command.height);TileManager.overlapInvalidatedRectangleWithView(command.part
,command.mode,command.wireId,invalidArea,textMsg);if(
this._docType==="presentation"||this._docType==="drawing"){if(
command.part===this._selectedPart&&command.mode===this._selectedMode&&command.part!==this._lastValidPart
){this._map.fire("updatepart",{part:this._lastValidPart,docType:this._docType});
this._lastValidPart=command.part;this._map.fire("updatepart",{part:command.part,
docType:this._docType})}const preview=this._map._docPreviews?this._map._docPreviews[command.part
]:null;if(preview){preview.invalid=true}const topLeftTwips=new cool.Point(command.x,command.y);
const offset=new cool.Point(command.width,command.height);const bottomRightTwips=topLeftTwips.add(
offset);this._previewInvalidations.push(new cool.Bounds(topLeftTwips,bottomRightTwips));
clearTimeout(this._previewInvalidator);this._previewInvalidator=setTimeout(window.L.bind(
this._invalidatePreviews,this),this.options.previewInvalidationTimeout)}},
handleInvalidateTilesMsg:function(textMsg){var payload=textMsg.substring("invalidatetiles:".length+1
);if(!payload.startsWith("EMPTY")){this._onInvalidateTilesMsg(textMsg)}else{
var msg="invalidatetiles: ";var tmp=payload.substring("EMPTY".length).replaceAll(","," , ");
var tokens=tmp.split(/[ \n]+/);var wireIdToken=undefined;var commaargs=[];var commaarg=false;for(
var i=0;i<tokens.length;i++){if(tokens[i]===","){commaarg=true;continue}if(commaarg){commaargs.push(
tokens[i]);commaarg=false}else if(tokens[i].startsWith("wid=")){wireIdToken=tokens[i]}else if(
tokens[i])console.error("unsupported invalidatetile token: "+tokens[i])}if(this.isWriter()){
msg+="part=0 "}else{var part=parseInt(commaargs.length>0?commaargs[0]:"");var mode=parseInt(
commaargs.length>1?commaargs[1]:"");mode=isNaN(mode)?this._selectedMode:mode;msg+="part="+(isNaN(
part)?this._selectedPart:part)+(mode&&mode!==0?" mode="+mode:"")+" "}msg+="x=0 y=0 ";
msg+="width="+Number.MAX_SAFE_INTEGER+" ";msg+="height="+Number.MAX_SAFE_INTEGER;if(
wireIdToken!==undefined)msg+=" "+wireIdToken;this._onInvalidateTilesMsg(msg)}},
filterSlurpedMessage:function(evt){var textMsg=evt.textMsg;if(textMsg.startsWith("invalidatetiles:")
){app.socket._logSocket("INCOMING",textMsg);this.handleInvalidateTilesMsg(textMsg);return true}
return false},_onTabStopListUpdate:function(textMsg){textMsg=textMsg.substring(
"tabstoplistupdate:".length+1);var json=JSON.parse(textMsg);this._map.fire("tabstoplistupdate",json)
},_onCommandValuesMsg:function(textMsg){var jsonIdx=textMsg.indexOf("{");if(jsonIdx===-1){return}
var obj=JSON.parse(textMsg.substring(jsonIdx));if(obj.commandName===".uno:DocumentRepair"){
this._onDocumentRepair(obj)}else if(obj.commandName===".uno:CellCursor"){this._onCellCursorMsg(
obj.commandValues)}else if(this._map.unoToolbarCommands.indexOf(obj.commandName)!==-1){
this._toolbarCommandValues[obj.commandName]=obj.commandValues;this._map.fire(
"updatetoolbarcommandvalues",{commandName:obj.commandName,commandValues:obj.commandValues})}else{
this._map.fire("commandvalues",{commandName:obj.commandName,commandValues:obj.commandValues})}},
_onCellAddressMsg:function(textMsg){var address=textMsg.substring(13);if(
this._map._clip&&!this._map["wopi"].DisableCopy){this._map._clip.setTextSelectionText(
this._lastFormula)}this._map.fire("celladdress",{address:address})},_onCellFormulaMsg:function(
textMsg){let newFormula=textMsg.substring(13);if(this._lastFormula){let minLength=Math.min(
newFormula.length,this._lastFormula.length);let index=-1;for(let i=0;i<minLength;i++){if(
newFormula.charAt(i)!==this._lastFormula.charAt(i)){index=i;break}}if(index===-1
)index=newFormula.length-1;this._newFormulaDiffIndex=index}this._lastFormula=newFormula;
this._map.fire("cellformula",{formula:newFormula})},_onCalcFunctionUsageMsg:function(textMsg){
this._map.fire("closepopup");this._map.fire("sendformulausagetext",{data:textMsg})},
_onCalcFunctionListMsg:function(textMsg){if(textMsg.startsWith("hidetip")){this._map.fire(
"closepopup")}else{var funcData=JSON.parse(textMsg);if(window.mode.isMobile()){
this._closeMobileWizard();var data={id:"funclist",type:"",text:_("Functions"),enabled:true,
children:[]};if(funcData.categories)this._onCalcFunctionListWithCategories(funcData,data
);else this._onCalcFunctionList(funcData,data);if(funcData.wholeList
)this._map._functionWizardData=data;this._openMobileWizard(data)}else{
var functionList=this._getFunctionList(textMsg);this._map.fire("sendformulatext",{data:functionList}
)}}},_getCalcFunctionListEntry:function(name,category,index,signature,description){return{id:"",
type:"calcfuncpanel",text:name,functionName:name,index:index,category:category,enabled:true,
children:[{id:"",type:"fixedtext",
html:'<div class="func-info-sig">'+signature+"</div>"+'<div class="func-info-desc">'+description+"</div>",
enabled:true,style:"func-info"}]}},_onCalcFunctionList:function(funcList,data){
var entries=data.children;for(var idx=0;idx<funcList.length;++idx){var func=funcList[idx];
var name=func.signature.split("(")[0];entries.push(this._getCalcFunctionListEntry(name,undefined,
func.index,func.signature,func.description))}},_onCalcFunctionListWithCategories:function(funcData,
data){var categoryList=funcData.categories;var categoryEntries=data.children;for(
var idx=0;idx<categoryList.length;++idx){var category=categoryList[idx];var categoryEntry={id:"",
type:"panel",text:category.name,index:idx,enabled:true,children:[]};categoryEntries.push(
categoryEntry)}var funcList=funcData.functions;for(idx=0;idx<funcList.length;++idx){
var func=funcList[idx];var name=func.signature.split("(")[0];var funcEntries=categoryEntries[
func.category].children;funcEntries.push(this._getCalcFunctionListEntry(name,func.category,
func.index,func.signature,func.description))}},_onCursorVisibleMsg:function(textMsg){
var command=textMsg.match("cursorvisible: true");app.setCursorVisibility(command?true:false);
this._onUpdateCursor();app.events.fire("TextCursorVisibility",{visible:app.file.textCursor.visible})
},_onDownloadAsMsg:function(textMsg){var command=app.socket.parseServerCmd(textMsg);
var parser=document.createElement("a");parser.href=window.host;var url=window.makeHttpUrlWopiSrc(
"/"+this._map.options.urlPrefix+"/",this._map.options.doc,"/download/"+command.downloadid);
this._map.hideBusy();if(this._map["wopi"].DownloadAsPostMessage){this._map.fire("postMessage",{
msgId:"Download_As",args:{Type:command.id,URL:url}})}else if(command.id==="print"){if(
this._map.options.print===false||window.L.Browser.cypressTest){url=window.makeHttpUrlWopiSrc(
"/"+this._map.options.urlPrefix+"/",this._map.options.doc,"/download/"+command.downloadid,
"attachment=0");if("processCoolUrl"in window){url=window.processCoolUrl({url:url,type:"print"})}
window.open(url,"_blank")}else{if("processCoolUrl"in window){url=window.processCoolUrl({url:url,
type:"print"})}this._map.fire("filedownloadready",{url:url})}}else if(command.id==="slideshow"){
this._map.fire("slidedownloadready",{url:url})}else if(command.id==="export"){if(
"processCoolUrl"in window){url=window.processCoolUrl({url:url,type:"export"})}if(
!window.L.Browser.cypressTest
)this._map._fileDownloader.src=url;else this._map._fileDownloader.setAttribute("data-src",url)}},
_onErrorMsg:function(textMsg){var command=app.socket.parseServerCmd(textMsg);var errorId=1;if(
command.errorCmd==="load"){errorId=2}else if(command.errorCmd==="save"||command.errorCmd==="saveas"
){errorId=5}var errorCode=-1;if(command.errorCode!==undefined){errorCode=command.errorCode}
this._map.fire("error",{cmd:command.errorCmd,kind:command.errorKind,id:errorId,code:errorCode})},
_onGetChildIdMsg:function(textMsg){var command=app.socket.parseServerCmd(textMsg);this._map.fire(
"childid",{id:command.id})},_openMobileWizard:function(data){this._map.fire("mobilewizard",{
data:data})},_closeMobileWizard:function(){this._map.fire("closemobilewizard")},
_onGraphicViewSelectionMsg:function(textMsg){var obj=JSON.parse(textMsg.substring(
"graphicviewselection:".length+1));var viewId=parseInt(obj.viewId);if(
viewId===this._viewId||!this._map._viewInfo[viewId]){return}var strTwips=obj.selection.match(/\d+/g)
app.definitions.otherViewGraphicSelectionSection.addOrUpdateGraphicSelectionIndicator(viewId,
strTwips,parseInt(obj.part),obj.mode!==undefined?parseInt(obj.mode):0);if(this.isCalc()){
this._saveMessageForReplay(textMsg,viewId)}},_onCellCursorMsg:function(textMsg){
var autofillMarkerSection=app.sectionContainer.getSectionWithName(app.CSections.AutoFillMarker.name)
var oldCursorAddress=app.calc.cellAddress.clone();if(textMsg.match("EMPTY")){
app.calc.cellCursorVisible=false;if(autofillMarkerSection
)autofillMarkerSection.calculatePositionViaCellCursor(null);if(this._map._clip
)this._map._clip.clearSelection()}else{var strTwips=textMsg.match(/\d+/g);
var topLeftTwips=new cool.Point(parseInt(strTwips[0]),parseInt(strTwips[1]));
var offset=new cool.Point(parseInt(strTwips[2]),parseInt(strTwips[3]));
var bottomRightTwips=topLeftTwips.add(offset);
let _cellCursorTwips=this._convertToTileTwipsSheetArea(new cool.Bounds(topLeftTwips,bottomRightTwips
));app.calc.cellAddress=new cool.SimplePoint(parseInt(strTwips[4]),parseInt(strTwips[5]));
let tempRectangle=_cellCursorTwips.toRectangle();
app.calc.cellCursorRectangle=new cool.SimpleRectangle(tempRectangle[0],tempRectangle[1],
tempRectangle[2],tempRectangle[3]);this._cellCursorSection.size[0
]=app.calc.cellCursorRectangle.pWidth;this._cellCursorSection.size[1
]=app.calc.cellCursorRectangle.pHeight;this._cellCursorSection.setPosition(
app.calc.cellCursorRectangle.pX1,app.calc.cellCursorRectangle.pY1);app.calc.cellCursorVisible=true;
app.sectionContainer.onCellAddressChanged();if(autofillMarkerSection
)autofillMarkerSection.calculatePositionViaCellCursor([app.calc.cellCursorRectangle.pX2,
app.calc.cellCursorRectangle.pY2])}var sameAddress=oldCursorAddress.equals(
app.calc.cellAddress.toArray());var isFollowingOwnCursor=parseInt(app.getFollowedViewId()
)===parseInt(this._viewId);var notJump=sameAddress||!isFollowingOwnCursor;
var scrollToCursor=this._sheetSwitch.tryRestore(notJump,this._selectedPart);
this._onUpdateCellCursor(scrollToCursor,notJump);
app.definitions.validityInputHelpSection.removeValidityInputHelp()},_onDocumentRepair:function(
textMsg){if(!this._docRepair){this._docRepair=window.L.control.documentRepair()}if(
!this._docRepair.isVisible()){this._docRepair.addTo(this._map);this._docRepair.fillActions(textMsg);
this._docRepair.show()}},_onMousePointerMsg:function(textMsg){textMsg=textMsg.substring(14);
textMsg=Cursor.getCustomCursor(textMsg)||textMsg;var mapPane=$(".leaflet-pane.leaflet-map-pane");if(
mapPane.css("cursor")!==textMsg){mapPane.css("cursor",textMsg)}},_getFunctionList:function(textMsg){
var resultList=[];var suggestionArray=JSON.parse(textMsg);for(var i=0;i<suggestionArray.length;i++){
var signature=suggestionArray[i].signature;var namedRange=suggestionArray[i].namedRange;var name,
description;if(namedRange){name=signature;description=_("Named Range")}else{
name=signature.substring(0,signature.indexOf("("));description=suggestionArray[i].description}
resultList.push({name:name,description:description,namedRange:namedRange})}return resultList},
_onInvalidateCursorMsg:function(textMsg){textMsg=textMsg.substring("invalidatecursor:".length+1);
var obj=JSON.parse(textMsg);var recCursor=this._getEditCursorRectangle(obj);if(
recCursor===undefined||this.persistCursorPositionInWriter){this.persistCursorPositionInWriter=false;
return}var grid=document.querySelector(".leaflet-map-pane");if(this.isCalc(
)&&grid.style.cursor!="text"&&this._cellCursorSection.sectionProperties.mouseInside){
grid.classList.remove("spreadsheet-cursor");grid.style.cursor="text"}var modifierViewId=parseInt(
obj.viewId);var weAreModifier=modifierViewId===this._viewId;if(weAreModifier&&app.isFollowingOff()
)app.setFollowingUser(this._viewId);this._cursorAtMispelledWord=obj.mispelledWord?Boolean(parseInt(
obj.mispelledWord)).valueOf():false;if(obj.controlEvent===true
)this._formID=obj.windowId;else this._formID=null;
this._cursorPreviousPositionCorePixels=app.file.textCursor.rectangle.clone();
app.file.textCursor.rectangle=new cool.SimpleRectangle(recCursor.getTopLeft().x,
recCursor.getTopLeft().y,recCursor.getSize().x,recCursor.getSize().y);if(this._docType==="text"){
app.sectionContainer.onCursorPositionChanged()}this._map.hyperlinkUnderCursor=obj.hyperlink;
URLPopUpSection.closeURLPopUp();if(obj.hyperlink&&obj.hyperlink.link)URLPopUpSection.showURLPopUP(
obj.hyperlink.link,new cool.SimplePoint(app.file.textCursor.rectangle.x1,
app.file.textCursor.rectangle.y1));if(!this._map.editorHasFocus(
)&&app.file.textCursor.visible&&weAreModifier){if(!this._map.calcInputBarHasFocus())this._map.fire(
"editorgotfocus")}if(!this.lastCursorPos)this.lastCursorPos=app.file.textCursor.rectangle.clone();
var updateCursor=false;if(!this.lastCursorPos.equals(app.file.textCursor.rectangle.toArray())){
updateCursor=true;this.lastCursorPos=app.file.textCursor.rectangle.clone()}this._onUpdateCursor(
updateCursor&&weAreModifier,undefined,!weAreModifier);
this._lastVisibleCursorRef=app.file.textCursor.rectangle.clone()},_updateEditor:function(textMsg){
textMsg=textMsg.substring("editor:".length+1);var editorId=parseInt(textMsg);
var docLayer=this._map._docLayer;docLayer._editorId=editorId;if(app.isFollowingEditor()){
app.setFollowingEditor(editorId)}if(this._map._viewInfo[editorId])this._map.fire("updateEditorName",
{username:this._map._viewInfo[editorId].username})},_onInvalidateViewCursorMsg:function(textMsg){
var obj=JSON.parse(textMsg.substring("invalidateviewcursor:".length+1));var viewId=parseInt(
obj.viewId);if(viewId===this._viewId||!this._map._viewInfo[viewId]){return}
const username=this._map._viewInfo[viewId].username;const mode=obj.mode?parseInt(obj.mode):0;
let rectangle;if(obj.refpoint){let refPoint=obj.refpoint.split(",");refPoint=new cool.SimplePoint(
parseInt(refPoint[0]),parseInt(refPoint[1]));if(this.sheetGeometry){
this.sheetGeometry.convertToTileTwips(refPoint);rectangle=obj.relrect.split(",");for(
let i=0;i<rectangle.length;i++)rectangle[i]=parseInt(rectangle[i]);rectangle[0]+=refPoint.x;
rectangle[1]+=refPoint.y}}else{rectangle=obj.rectangle.split(",");for(let i=0;i<rectangle.length;i++
)rectangle[i]=parseInt(rectangle[i])}
app.definitions.otherViewCursorSection.addOrUpdateOtherViewCursor(viewId,username,rectangle,
parseInt(obj.part),mode);if(app.getFollowedViewId()===viewId&&(app.isFollowingEditor(
)||app.isFollowingUser())){if(this._map.getDocType()==="text"||this._map.getDocType(
)==="presentation"){this.goToViewCursor(viewId)}else if(this._map.getDocType()==="spreadsheet"){
this.goToCellViewCursor(viewId)}}this._saveMessageForReplay(textMsg,viewId)},
_convertRawTwipsToTileTwips:function(strTwips){if(!strTwips)return null;
var topLeftTwips=new cool.Point(parseInt(strTwips[0]),parseInt(strTwips[1]));
var offset=new cool.Point(parseInt(strTwips[2]),parseInt(strTwips[3]));
var bottomRightTwips=topLeftTwips.add(offset);strTwips=this._convertToTileTwipsSheetArea(
new cool.Bounds(topLeftTwips,bottomRightTwips)).toRectangle();return strTwips},
_onCellViewCursorMsg:function(textMsg){var obj=JSON.parse(textMsg.substring(
"cellviewcursor:".length+1));var viewId=parseInt(obj.viewId);if(viewId===this._viewId){return}if(
obj.rectangle.match("EMPTY"))OtherViewCellCursorSection.removeView(viewId);else{
let strTwips=obj.rectangle.match(/\d+/g);strTwips=this._convertRawTwipsToTileTwips(strTwips);
OtherViewCellCursorSection.addOrUpdateOtherViewCellCursor(viewId,this._map.getViewName(viewId),
strTwips,parseInt(obj.part));CursorHeaderSection.deletePopUpNow(viewId)}if(this.isCalc()){
this._saveMessageForReplay(textMsg,viewId)}},goToCellViewCursor:function(viewId){if(
OtherViewCellCursorSection.doesViewCursorExist(viewId)){
const viewCursorSection=OtherViewCellCursorSection.getViewCursorSection(viewId);if(
this._selectedPart!==viewCursorSection.sectionProperties.part)this._map.setPart(
viewCursorSection.sectionProperties.part);if(!viewCursorSection.isVisible){
const scrollX=viewCursorSection.position[0];const scrollY=viewCursorSection.position[1];
this.scrollToPos(new cool.SimplePoint(scrollX*app.pixelsToTwips,scrollY*app.pixelsToTwips))}
OtherViewCellCursorSection.showPopUpForView(viewId)}},_onViewCursorVisibleMsg:function(textMsg){
textMsg=textMsg.substring("viewcursorvisible:".length+1);var obj=JSON.parse(textMsg);
var viewId=parseInt(obj.viewId);if(viewId===this._viewId||!this._map._viewInfo[viewId]){return}
const section=app.definitions.otherViewCursorSection.getViewCursorSection(viewId);if(section){
const showCursor=obj.visible==="true";section.sectionProperties.showCursor=showCursor;
section.setShowSection(showCursor)}},_addView:function(viewInfo){if(
viewInfo.color===0&&this._map.getDocType()!=="text"){viewInfo.color=app.LOUtil.getViewIdColor(
viewInfo.id)}this._map.addView(viewInfo)},_removeView:function(viewId){if(this._viewSelections[
viewId]){if(this._viewSelections[viewId].selection){this._viewSelections[viewId].selection.remove();
this._viewSelections[viewId].selection=undefined}delete this._viewSelections[viewId]}
app.definitions.otherViewCursorSection.removeView(viewId);OtherViewCellCursorSection.removeView(
viewId);app.definitions.otherViewGraphicSelectionSection.removeView(viewId);this._map.removeView(
viewId)},removeAllViews:function(){for(var viewInfoIdx in this._map._viewInfo){this._removeView(
parseInt(viewInfoIdx))}},_onViewInfoMsg:function(textMsg){textMsg=textMsg.substring(
"viewinfo: ".length);var viewInfo=JSON.parse(textMsg);this._map.fire("viewinfo",viewInfo);
var viewIds=[];for(var viewInfoIdx in viewInfo){if(!(parseInt(viewInfo[viewInfoIdx].id
)in this._map._viewInfo)){this._addView(viewInfo[viewInfoIdx])}viewIds.push(viewInfo[viewInfoIdx].id
)}for(viewInfoIdx in this._map._viewInfo){if(viewIds.indexOf(parseInt(viewInfoIdx))===-1){
this._removeView(parseInt(viewInfoIdx))}}this._map.fire("updateviewslist")},
_onRenderFontMsg:function(textMsg,img){var command=app.socket.parseServerCmd(textMsg);
this._map.fire("renderfont",{font:command.font,char:command.char,img:img})},
_onSearchNotFoundMsg:function(textMsg){this._clearSearchResults();
var originalPhrase=textMsg.substring(16);this._map.fire("search",{originalPhrase:originalPhrase,
count:0})},_getSearchResultRectangles:function(obj,results){for(
var i=0;i<obj.searchResultSelection.length;i++){results.push({part:parseInt(
obj.searchResultSelection[i].part),rectangles:this._twipsRectanglesToPixelBounds(
obj.searchResultSelection[i].rectangles),twipsRectangles:obj.searchResultSelection[i].rectangles})}
},_getSearchResultRectanglesFileBasedView:function(obj,results){
var additionPerPart=this._partHeightTwips+this._spaceBetweenParts;for(
var i=0;i<obj.searchResultSelection.length;i++){var rectangles=obj.searchResultSelection[i
].rectangles;var part=parseInt(obj.searchResultSelection[i].part);rectangles=rectangles.split(",");
rectangles=rectangles.map(function(element,index){element=parseInt(element);if(index<2
)element+=additionPerPart*part;return element});rectangles=String(rectangles[0])+", "+String(
rectangles[1])+", "+String(rectangles[2])+", "+String(rectangles[3]);results.push({part:parseInt(
obj.searchResultSelection[i].part),rectangles:this._twipsRectanglesToPixelBounds(rectangles),
twipsRectangles:rectangles})}},_onSearchResultSelection:function(textMsg){textMsg=textMsg.substring(
23);var obj=JSON.parse(textMsg);var originalPhrase=obj.searchString;
var count=obj.searchResultSelection.length;var highlightAll=obj.highlightAll;var results=[];if(
!app.file.fileBasedView)this._getSearchResultRectangles(obj,results
);else this._getSearchResultRectanglesFileBasedView(obj,results);if(count>1){
this._clearSearchResults();this._searchResults=results;if(!app.file.fileBasedView)this._map.setPart(
results[0].part);else this._map._docLayer._preview._scrollViewToPartPosition(results[0].part)
}else if(count===1){this._lastSearchResult=results[0]}this._searchTerm=originalPhrase;
this._map.fire("search",{originalPhrase:originalPhrase,count:count,highlightAll:highlightAll,
results:results});app.setFollowingUser(this._viewId);if(app.file.textCursor.visible
)this._onUpdateCursor(true);else if(app.calc.cellCursorVisible)this._onUpdateCellCursor(true)},
_clearSearchResults:function(){if(this._searchTerm){this._textCSelections.clear()}
this._lastSearchResult=null;this._searchResults=null;this._searchTerm=null;
this._searchResultsLayer.clearLayers()},_onStateChangedMsg:function(textMsg){textMsg=textMsg.substr(
14);var isPureJSON=textMsg.indexOf("=")===-1&&textMsg.indexOf("{")!==-1;if(isPureJSON){
var json=JSON.parse(textMsg);if(json.commandName&&json.state!==undefined){this._map.fire(
"commandstatechanged",json)}}else{var index=textMsg.indexOf("=");
var commandName=index!==-1?textMsg.substr(0,index):"";var state=index!==-1?textMsg.substr(index+1
):"";this._map.fire("commandstatechanged",{commandName:commandName,state:state})}},
_onUnoCommandResultMsg:function(textMsg){textMsg=textMsg.substring(18);var obj=JSON.parse(textMsg);
var commandName=obj.commandName;if(obj.success==="true"||obj.success===true){var success=true
}else if(obj.success==="false"||obj.success===false){success=false}this._map.hideBusy();
this._map.fire("commandresult",{commandName:commandName,success:success,result:obj.result});if(
this._map.CallPythonScriptSource!=null){this._map.CallPythonScriptSource.postMessage(JSON.stringify(
{MessageId:"CallPythonScript-Result",SendTime:Date.now(),Values:obj}),"*");
this._map.CallPythonScriptSource=null}},_onRulerUpdate:function(textMsg){var horizontalRuler=true;
if(textMsg.startsWith("vrulerupdate:")){horizontalRuler=false}textMsg=textMsg.substring(13);
var obj=JSON.parse(textMsg);if(!horizontalRuler){this._map.fire("vrulerupdate",obj)}else{
this._map.fire("rulerupdate",obj)}},_onContextMenuMsg:function(textMsg){textMsg=textMsg.substring(13
);var obj=JSON.parse(textMsg);this._map.fire("locontextmenu",obj)},_convertToPointSet(rectangleArray
){const result=CPolyUtil.rectanglesToPointSet(rectangleArray,function(twipsPoint){
var corePxPt=app.map._docLayer._twipsToCorePixels(twipsPoint);corePxPt.round();return corePxPt});
return result},_onTextSelectionMsg:function(textMsg){var rectArray=this._getTextSelectionRectangles(
textMsg);if(rectArray.length){TextSelections.activate();var rectangles=rectArray.map(function(rect){
return rect.getPointArray()});if(app.file.fileBasedView&&this._lastSearchResult){
var additionPerPart=this._partHeightTwips+this._spaceBetweenParts;for(
var i=0;i<rectangles.length;i++){for(var j=0;j<rectangles[i].length;j++){rectangles[i][j
].y+=additionPerPart*this._lastSearchResult.part}}
this._map._docLayer._preview._scrollViewToPartPosition(this._lastSearchResult.part);
TileManager.updateFileBasedView();setTimeout(function(){app.sectionContainer.requestReDraw()},100)}
var pointSet=this._convertToPointSet(rectangles);this._textCSelections.setPointSet(pointSet);
this._map.removeLayer(this._map._textInput._cursorHandler);if(window.L.Browser.clipboardApiAvailable
){this._map._clip.setTextSelectionType("text")}else{if(this._selectionContentRequest){clearTimeout(
this._selectionContentRequest)}this._selectionContentRequest=setTimeout(window.L.bind(function(){
app.socket.sendMessage("gettextselection mimetype=text/html,text/plain;charset=utf-8")},this),100)}
if(this._map.contextToolbar)this._map.contextToolbar.showContextToolbar()}else{
TextSelections.deactivate();this._textCSelections.clear();this._selectedTextContent="";if(
this._map.contextToolbar)this._map.contextToolbar.hideContextToolbar();if(
this._map._clip&&this._map._clip._selectionType==="complex")this._map._clip.clearSelection()}},
_onTextViewSelectionMsg:function(textMsg){var obj=JSON.parse(textMsg.substring(
"textviewselection:".length+1));var viewId=parseInt(obj.viewId);var viewPart=parseInt(obj.part);
var viewMode=obj.mode!==undefined?parseInt(obj.mode):0;if(
viewId===this._viewId||!this._map._viewInfo[viewId]){return}
var rectArray=this._getTextSelectionRectangles(obj.selection);this._viewSelections[viewId
]=this._viewSelections[viewId]||{};if(rectArray.length){var rectangles=rectArray.map(function(rect){
return rect.getPointArray()});this._viewSelections[viewId].part=viewPart;this._viewSelections[viewId
].mode=viewMode;var docLayer=this;this._viewSelections[viewId
].pointSet=CPolyUtil.rectanglesToPointSet(rectangles,function(twipsPoint){
var corePxPt=docLayer._twipsToCorePixels(twipsPoint);corePxPt.round();return corePxPt})}else{
this._viewSelections[viewId].pointSet=new CPointSet}this._onUpdateTextViewSelection(viewId);
this._saveMessageForReplay(textMsg,viewId)},_updateReferenceMarks:function(){this._clearReferences()
if(!this._referencesAll)return;for(var i=0;i<this._referencesAll.length;i++){if(
!this._references.hasMark(this._referencesAll[i].mark)&&this._selectedPart===this._referencesAll[i
].part){this._references.addMark(this._referencesAll[i].mark)}}},_onReferencesMsg:function(textMsg){
textMsg=textMsg.substr(textMsg.indexOf(" ")+1);var marks=JSON.parse(textMsg);marks=marks.marks;
var references=[];this._referencesAll=[];for(var mark=0;mark<marks.length;mark++){
var strTwips=marks[mark].rectangle.match(/\d+/g);var strColor=marks[mark].color;var part=parseInt(
marks[mark].part);if(strTwips!=null){var rectangles=[];for(var i=0;i<strTwips.length;i+=4){
var topLeftTwips=new cool.Point(parseInt(strTwips[i]),parseInt(strTwips[i+1]));
var offset=new cool.Point(parseInt(strTwips[i+2]),parseInt(strTwips[i+3]));
var boundsTwips=this._convertToTileTwipsSheetArea(new cool.Bounds(topLeftTwips,topLeftTwips.add(
offset)));rectangles.push([boundsTwips.getBottomLeft(),boundsTwips.getBottomRight(),
boundsTwips.getTopLeft(),boundsTwips.getTopRight()])}var docLayer=this;
var pointSet=CPolyUtil.rectanglesToPointSet(rectangles,function(twipsPoint){
var corePxPt=docLayer._twipsToCorePixels(twipsPoint);corePxPt.round();return corePxPt});
var reference=new CPolygon(pointSet,{pointerEvents:"none",fillColor:"#"+strColor,fillOpacity:.25,
weight:2*app.dpiScale,opacity:.25});references.push({mark:reference,part:part})}}for(
i=0;i<references.length;i++){this._referencesAll.push(references[i])}this._updateReferenceMarks()},
_getStringPart:function(string){var code="";var i=0;while(i<string.length){if(string.charCodeAt(i
)<48||string.charCodeAt(i)>57){code+=string.charAt(i)}i++}return code},_getNumberPart:function(
string){var number="";var i=0;while(i<string.length){if(string.charCodeAt(i)>=48&&string.charCodeAt(
i)<=57){number+=string.charAt(i)}i++}return parseInt(number)},_isWholeColumnSelected:function(
cellAddress){if(!cellAddress)cellAddress=document.querySelector("#addressInput input").value;
var startEnd=cellAddress.split(":");if(startEnd.length===1)return false;
var rangeStart=this._getNumberPart(startEnd[0]);if(rangeStart!==1)return false;
var rangeEnd=this._getNumberPart(startEnd[1]);if(rangeEnd===1048576)return true;else return false},
_isWholeRowSelected:function(cellAddress){if(!cellAddress)cellAddress=document.querySelector(
"#addressInput input").value;var startEnd=cellAddress.split(":");if(startEnd.length===1)return false
var rangeStart=this._getStringPart(startEnd[0]);if(rangeStart!=="A")return false;
var rangeEnd=this._getStringPart(startEnd[1]);if(rangeEnd==="XFD")return true;else return false},
_updateScrollOnCellSelection:function(oldSelection,newSelection){if(!oldSelection)return;if(
newSelection.equals(oldSelection.toArray()))return;
const viewedRectangle=app.activeDocument.activeView.viewedRectangle;
const directionDownOrRight=newSelection.pX2!==oldSelection.pX2||newSelection.pY2!==oldSelection.pY2;
let needsScroll=false;let xVisible;let yVisible;if(directionDownOrRight){
xVisible=app.isXVisibleInTheDisplayedArea(newSelection.x2);
yVisible=app.isYVisibleInTheDisplayedArea(newSelection.y2);needsScroll=!xVisible||!yVisible}else{
xVisible=app.isXVisibleInTheDisplayedArea(newSelection.x1);
yVisible=app.isYVisibleInTheDisplayedArea(newSelection.y1);needsScroll=!xVisible||!yVisible}if(
needsScroll){const spacingX=Math.abs(app.calc.cellCursorRectangle.pWidth)/4;const spacingY=Math.abs(
app.calc.cellCursorRectangle.pHeight)/2;let scrollX=0,scrollY=0;if(directionDownOrRight){if(
!xVisible)scrollX=newSelection.pX2-viewedRectangle.pX2+spacingX;if(!yVisible
)scrollY=newSelection.pY2-viewedRectangle.pY2+spacingY}else{if(!xVisible
)scrollX=newSelection.pX1-viewedRectangle.pX1-spacingX;if(!yVisible
)scrollY=newSelection.pY1-viewedRectangle.pY1-spacingY}if(
!this._map.wholeColumnSelected&&!this._map.wholeRowSelected){const address=document.querySelector(
"#addressInput input").value;if(!this._isWholeColumnSelected(address)&&!this._isWholeRowSelected(
address)){app.activeDocument.activeView.scroll(scrollX,scrollY)}}}},_onTextSelectionEndMsg:function(
textMsg){var rectangles=this._getTextSelectionRectangles(textMsg);if(rectangles.length){
var topLeftTwips=rectangles[0].getTopLeft();var bottomRightTwips=rectangles[0].getBottomRight();
TextSelections.setEndRectangle(new cool.SimpleRectangle(topLeftTwips.x,topLeftTwips.y,
bottomRightTwips.x-topLeftTwips.x,bottomRightTwips.y-topLeftTwips.y))
}else TextSelections.setEndRectangle(null)},_onTextSelectionStartMsg:function(textMsg){
var rectangles=this._getTextSelectionRectangles(textMsg);if(rectangles.length){
var topLeftTwips=rectangles[0].getTopLeft();var bottomRightTwips=rectangles[0].getBottomRight();
TextSelections.setStartRectangle(new cool.SimpleRectangle(topLeftTwips.x,topLeftTwips.y,
bottomRightTwips.x-topLeftTwips.x,bottomRightTwips.y-topLeftTwips.y))
}else TextSelections.setStartRectangle(null)},_refreshRowColumnHeaders:function(){if(
app.sectionContainer.doesSectionExist(app.CSections.RowHeader.name)
)app.sectionContainer.getSectionWithName(app.CSections.RowHeader.name)._updateCanvas();if(
app.sectionContainer.doesSectionExist(app.CSections.ColumnHeader.name)
)app.sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name)._updateCanvas()},
_onCellSelectionAreaMsg:function(textMsg){
var autofillMarkerSection=app.sectionContainer.getSectionWithName(app.CSections.AutoFillMarker.name)
var strTwips=textMsg.match(/\d+/g);if(strTwips!=null){var topLeftTwips=new cool.Point(parseInt(
strTwips[0]),parseInt(strTwips[1]));var offset=new cool.Point(parseInt(strTwips[2]),parseInt(
strTwips[3]));var bottomRightTwips=topLeftTwips.add(offset);
var boundsTwips=this._convertToTileTwipsSheetArea(new cool.Bounds(topLeftTwips,bottomRightTwips));
var oldSelection=this._cellSelectionArea?this._cellSelectionArea.clone():null;
const adjustedTwipsWidth=boundsTwips.max.x-boundsTwips.min.x;
const adjustedTwipsHeight=boundsTwips.max.y-boundsTwips.min.y;
this._cellSelectionArea=new cool.SimpleRectangle(boundsTwips.min.x,boundsTwips.min.y,
adjustedTwipsWidth,adjustedTwipsHeight);if(autofillMarkerSection
)autofillMarkerSection.calculatePositionViaCellSelection([this._cellSelectionArea.pX2,
this._cellSelectionArea.pY2]);this._updateScrollOnCellSelection(oldSelection,this._cellSelectionArea
);CellSelectionMarkers.update()}else{this._cellSelectionArea=null;if(autofillMarkerSection
)autofillMarkerSection.calculatePositionViaCellSelection(null);this._cellSelections=Array(0);
this._map.wholeColumnSelected=false;this._map.wholeRowSelected=false;if(
this._refreshRowColumnHeaders)this._refreshRowColumnHeaders()}},_onCellAutoFillAreaMsg:function(
textMsg){var strTwips=textMsg.match(/\d+/g);if(strTwips!=null&&this._map.isEditMode()){
var topLeftTwips=new cool.Point(parseInt(strTwips[0]),parseInt(strTwips[1]));
var offset=new cool.Point(parseInt(strTwips[2]),parseInt(strTwips[3]));
var topLeftPixels=this._twipsToCorePixels(topLeftTwips);var offsetPixels=this._twipsToCorePixels(
offset);this._cellAutoFillAreaPixels=app.LOUtil.createRectangle(topLeftPixels.x,topLeftPixels.y,
offsetPixels.x,offsetPixels.y)}else{this._cellAutoFillAreaPixels=null}},_onDialogPaintMsg:function(
textMsg,img){var command=app.socket.parseServerCmd(textMsg);if(command.nopng){var found=false;for(
var i=0;i<this._pngCache.length;i++){if(this._pngCache[i].hash==command.hash){found=true;
img=this._pngCache[i].img;this._pngCache.splice(i,1);break}}if(!found){
var message="windowpaint: message assumed PNG for hash "+command.hash+" is cached here in the client but not found"
if(window.L.Browser.cypressTest)throw new Error(message);app.socket.sendMessage("ERROR "+message)}
}else{for(i=0;i<this._pngCache.length;i++){if(this._pngCache[i].hash==command.hash){
message="windowpaint: message included PNG for hash "+command.hash+" even if it was already cached here in the client"
if(window.L.Browser.cypressTest)throw new Error(message);app.socket.sendMessage("ERROR "+message);
this._pngCache.splice(i,1);break}}}if(
this._pngCache.length==app.socket.TunnelledDialogImageCacheSize){this._pngCache.pop()}
this._pngCache.unshift({hash:command.hash,img:img});this._map.fire("windowpaint",{id:command.id,
img:img,width:command.width,height:command.height,rectangle:command.rectangle,hash:command.hash})},
_onDialogMsg:function(textMsg){textMsg=textMsg.substring("window: ".length);
var dialogMsg=JSON.parse(textMsg);dialogMsg.winType=dialogMsg.type;this._map.fire("window",dialogMsg
)},_mapOnError:function(e){if(e.msg&&this._map.isEditMode()&&e.critical!==false){
this._map.setPermission("view")}},_clearSelections:function(calledFromSetPartHandler){
this._onUpdateCursor(calledFromSetPartHandler);this._textCSelections.clear();
this._oleCSelections.clear();this._onUpdateCellCursor();if(this._map._clip
)this._map._clip.clearSelection();else this._selectedTextContent=""},containsSelection:function(
latlng){var corepxPoint=this._map.project(latlng);return this._textCSelections.contains(corepxPoint)
},_clearReferences:function(){this._references.clear()},_resetReferencesMarks:function(type){
this._clearReferences();if(type===undefined)this._referencesAll=[];else if(type==="focuscell"
)this._referencesAll=this._referencesAll.filter(function(e){return e.type!=="focuscell"});
this._updateReferenceMarks()},_postMouseEvent:function(type,x,y,count,buttons,modifier){if(
!this._map._docLoaded)return;if(this._map.calcInputBarHasFocus()&&type==="move"){return}
const verticalOffset=this.getFiledBasedViewVerticalOffset();if(verticalOffset){y-=verticalOffset}if(
this._map.contextToolbar)this._map.contextToolbar.setLastInputEventType({input:"mouse",type:type});
app.socket.sendMessage(
"mouse type="+type+" x="+x+" y="+y+" count="+count+" buttons="+buttons+" modifier="+modifier);
const tempPageLinks=this._map["stateChangeHandler"].getItemValue("PageLinks");
const thereArePageLinks=tempPageLinks&&tempPageLinks.length>0;if(
type==="buttonup"&&thereArePageLinks){URLPopUpSection.closeURLPopUp();for(const link of this._map[
"stateChangeHandler"].getItemValue("PageLinks")){if(link.rectangle.containsPoint([x,y])){
URLPopUpSection.showURLPopUP(link.uri,new cool.SimplePoint(x,y+this.getFiledBasedViewVerticalOffset(
)),undefined,true)}}}if(type==="buttondown")this._clearSearchResults();if(
this._map&&this._map._docLayer&&(type==="buttondown"||type==="buttonup")
)this._map.userList.followUser(this._map._docLayer._getViewId(),false)},
getFiledBasedViewVerticalOffset:function(){if(!app.file.fileBasedView){return}
const additionPerPart=this._partHeightTwips+this._spaceBetweenParts;
const verticalOffset=additionPerPart*this._selectedPart;return verticalOffset},
requestNewFiledBasedViewTiles:function(){if(!app.file.fileBasedView){return}this._requestNewTiles();
TileManager.redraw()},postKeyboardEvent:function(type,charCode,unoKeyCode){if(!this._map._docLoaded
)return;if(window.L.Browser.mac){if(unoKeyCode==UNOKey.UP+UNOModifier.CTRL
)unoKeyCode=UNOKey.HOME+UNOModifier.CTRL;else if(unoKeyCode==UNOKey.DOWN+UNOModifier.CTRL
)unoKeyCode=UNOKey.END+UNOModifier.CTRL;else if(unoKeyCode==UNOKey.LEFT+UNOModifier.CTRL
)unoKeyCode=UNOKey.HOME;else if(unoKeyCode==UNOKey.RIGHT+UNOModifier.CTRL
)unoKeyCode=UNOKey.END;else if(unoKeyCode==UNOKey.LEFT+UNOModifier.ALT
)unoKeyCode=UNOKey.LEFT+UNOModifier.CTRL;else if(unoKeyCode==UNOKey.RIGHT+UNOModifier.ALT
)unoKeyCode=UNOKey.RIGHT+UNOModifier.CTRL}var completeEvent=app.socket.createCompleteTraceEvent(
"L.TileSectionManager.postKeyboardEvent",{type:type,charCode:charCode});if(this._map.contextToolbar
)this._map.contextToolbar.setLastInputEventType({input:"key",type:type});
var winId=this._map.getWinId();if(this.isCalc()&&type==="input"&&winId===0){if(
unoKeyCode===UNOKey.SPACE+UNOModifier.CTRL){this._map.wholeColumnSelected=true}else if(
unoKeyCode===UNOKey.SPACE+UNOModifier.SHIFT){this._map.wholeRowSelected=true}}if(winId===0){
app.socket.sendMessage("key"+" type="+type+" char="+charCode+" key="+unoKeyCode+"\n")}else{
app.socket.sendMessage("windowkey id="+winId+" type="+type+" char="+charCode+" key="+unoKeyCode+"\n"
)}if(completeEvent)completeEvent.finish()},_postSelectTextEvent:function(type,x,y){
app.socket.sendMessage("selecttext type="+type+" x="+x+" y="+y)},_isEmptyRectangle:function(bounds){
if(!bounds){return true}return bounds.getSouthWest().equals(new window.L.LatLng(0,0)
)&&bounds.getNorthEast().equals(new window.L.LatLng(0,0))},_onZoomStart:function(){
this._isZooming=true},_onZoomEnd:function(){this._isZooming=false;if(!this.isCalc()
)this._replayPrintTwipsMsgs(false);this._onUpdateCursor(null,true);
app.definitions.otherViewCursorSection.updateVisibilities()},_updateCursorPos:function(){
var cursorPos=new cool.Point(app.file.textCursor.rectangle.pX1,app.file.textCursor.rectangle.pY1);
var cursorSize=new cool.Point(app.file.textCursor.rectangle.pWidth,
app.file.textCursor.rectangle.pHeight);if(!this._cursorMarker){this._cursorMarker=new Cursor(
cursorPos,cursorSize,this._map,{blink:true})}else{this._cursorMarker.setPositionSize(cursorPos,
cursorSize)}},goToTarget:function(target){var command={Name:{type:"string",value:"URL"},URL:{
type:"string",value:"#"+target}};this._map.sendUnoCommand(".uno:OpenHyperlink",command)},
_allowViewJump:function(){return!this._map._clip||this._map._clip._selectionType!=="complex"},
scrollToPos:function(pos){if(pos instanceof cool.SimplePoint)pos=this._twipsToLatLng({x:pos.x,
y:pos.y});var center=this._map.project(pos);let needsXScroll=false;let needsYScroll=false;
const CSSPixelsToTwips=app.dpiScale*app.pixelsToTwips;if(app.isXVisibleInTheDisplayedArea(
Math.round(center.x*CSSPixelsToTwips))
)center.x=app.activeDocument.activeView.viewedRectangle.cX1;else{center.x-=this._map.getSize(
).divideBy(2).x;center.x=Math.round(center.x<0?0:center.x);needsXScroll=true}
const controlYDown=center.y+(
app.file.textCursor.visible?app.file.textCursor.rectangle.cHeight:app.calc.cellCursorVisible?app.calc.cellCursorRectangle.cHeight:0
);const controlYUp=center.y-(
app.file.textCursor.visible?app.file.textCursor.rectangle.cHeight:app.calc.cellCursorVisible?app.calc.cellCursorRectangle.cHeight:0
);if(app.isYVisibleInTheDisplayedArea(Math.round(controlYDown*CSSPixelsToTwips)
)&&app.isYVisibleInTheDisplayedArea(Math.round(controlYUp*CSSPixelsToTwips))
)center.y=app.activeDocument.activeView.viewedRectangle.cY1;else{center.y-=this._map.getSize(
).divideBy(2).y;center.y=Math.round(center.y<0?0:center.y);needsYScroll=true}if(
needsXScroll||needsYScroll){const section=app.sectionContainer.getSectionWithName(
app.CSections.Scroll.name);if(section){section.onScrollTo({x:center.x*app.dpiScale,
y:center.y*app.dpiScale})}}},scrollByPoint:function(offset){this._map.fire("scrollby",{x:offset.cX,
y:offset.cY})},_onUpdateCursor:function(scroll,zoom,keepCaretPositionRelativeToScreen){if(
this._map.ignoreCursorUpdate()){return}if(!app.file.textCursor.visible){
this._updateCursorAndOverlay();app.definitions.otherViewCursorSection.updateVisibilities(true);
return}if(!zoom&&scroll!==false&&(app.file.textCursor.visible||GraphicSelection.hasActiveSelection()
)&&(!this.isCalc()||this._lastVisibleCursorRef&&!this._lastVisibleCursorRef.equals(
app.file.textCursor.rectangle.toArray()))&&this._allowViewJump()){
app.sectionContainer.getSectionWithName(app.CSections.Scroll.name).pendingScrollEvent=null;
var correctedCursor=app.file.textCursor.rectangle.clone();if(this._docType==="text"){
correctedCursor.x1=clamp(correctedCursor.x1,0,app.activeDocument.activeView.viewSize.x);
correctedCursor.x2=clamp(correctedCursor.x2,0,app.activeDocument.activeView.viewSize.x)}if(
!app.isPointVisibleInTheDisplayedArea(new cool.SimplePoint(correctedCursor.x1,correctedCursor.y1
).toArray())||!app.isPointVisibleInTheDisplayedArea(new cool.SimplePoint(correctedCursor.x2,
correctedCursor.y2).toArray())){if(app.isFollowingUser()&&app.getFollowedViewId(
)===this._viewId&&!this._map.calcInputBarHasFocus()){this.scrollToPos(new cool.SimplePoint(
correctedCursor.x1,correctedCursor.y1))}}}else if(keepCaretPositionRelativeToScreen){var that=this;
var isCursorVisible=app.isPointVisibleInTheDisplayedArea(app.file.textCursor.rectangle.toArray());
if(!isCursorVisible){setTimeout(function(){
var y=app.file.textCursor.rectangle.pY1-that._cursorPreviousPositionCorePixels.pY1;if(y){
app.sectionContainer.getSectionWithName(app.CSections.Scroll.name).scrollVerticalWithOffset(y)}},0)}
}this._updateCursorAndOverlay();app.definitions.otherViewCursorSection.updateVisibilities()},
activateCursor:function(){this._replayPrintTwipsMsg("invalidatecursor")},
_updateCursorAndOverlay:function(){if(app.file.textCursor.visible&&this._map.editorHasFocus(
)&&!this._map.isSearching()&&!this._isZooming&&this._map._permission!=="readonly"){
this._updateCursorPos();var scrollSection=app.sectionContainer.getSectionWithName(
app.CSections.Scroll.name);if(
!scrollSection.sectionProperties.mouseIsOnVerticalScrollBar&&!scrollSection.sectionProperties.mouseIsOnHorizontalScrollBar
){this._map._textInput.showCursor()}
var hasMobileWizardOpened=this._map.uiManager.mobileWizard?this._map.uiManager.mobileWizard.isOpen(
):false;var hasIframeModalOpened=$(".iframe-dialog-modal").is(":visible");if(
!window.mobileWizard&&!window.pageMobileWizard&&!window.insertionMobileWizard&&!hasMobileWizardOpened&&!JSDialog.IsAnyInputFocused(
)&&!hasIframeModalOpened){if(this._docType==="text"){
var section=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);if(
!section||!section.sectionProperties.selectedComment||!section.sectionProperties.selectedComment.isEdit(
))this._map.focus(true)}else this._map.focus(true)}}else{this._map._textInput.hideCursor();if(
this._map.editorHasFocus()&&!this._map.uiManager.isAnyDialogOpen()&&!this._map.isSearching(
)&&!JSDialog.IsAnyInputFocused()&&(
this._map._docLayer._preview&&!this._map._docLayer._preview.partsFocused))this._map.focus(false)}if(
this._map.options.docTarget!==""){this.goToTarget(this._map.options.docTarget);
this._map.options.docTarget=""}},updateAllTextViewSelection:function(){this.eachView(
this._viewSelections,this._onUpdateTextViewSelection,this,false)},goToViewCursor:function(viewId){
if(viewId===this._viewId){this._onUpdateCursor();return}
const section=app.definitions.otherViewCursorSection.getViewCursorSection(viewId);if(
section&&section.showSection){const point=new cool.SimplePoint(section.position[0]*app.pixelsToTwips
,section.position[1]*app.pixelsToTwips);var isNewCursorVisible=app.isPointVisibleInTheDisplayedArea(
point.toArray());if(!isNewCursorVisible)this.scrollToPos(point);
app.definitions.cursorHeaderSection.showCursorHeader(viewId)}},_onUpdateTextViewSelection:function(
viewId){viewId=parseInt(viewId);var viewPointSet=this._viewSelections[viewId].pointSet;
var viewSelection=this._viewSelections[viewId].selection;var viewPart=this._viewSelections[viewId
].part;var viewMode=this._viewSelections[viewId].mode?this._viewSelections[viewId].mode:0;if(
viewPointSet&&(this.isWriter()||this._selectedPart===viewPart&&this._selectedMode===viewMode)){if(
viewSelection){if(!this._map.hasInfoForView(viewId)){viewSelection.clear();return}
viewSelection.setPointSet(viewPointSet)}else{viewSelection=new CSelections(viewPointSet,
this._canvasOverlay,this._selectionsDataDiv,this._map,true,viewId,true);this._viewSelections[viewId
].selection=viewSelection}}else if(viewSelection){viewSelection.clear()}},eachView:function(views,
method,context,item){for(var key in views){method.call(context,item?views[key]:key)}},
_onUpdateCellCursor:function(scrollToCursor,sameAddress){CellSelectionMarkers.update();if(
app.calc.cellCursorVisible){if(scrollToCursor&&!this._map.calcInputBarHasFocus()){
const scroll=this._calculateScrollForNewCellCursor();if(scroll.x!==0||scroll.y!==0){
scroll.x+=app.activeDocument.activeView.viewedRectangle.x1;
scroll.y+=app.activeDocument.activeView.viewedRectangle.y1;app.activeDocument.activeView.scrollTo(
scroll.pX,scroll.pY)}this._prevCellCursorAddress=app.calc.cellAddress.clone()}
this._addCellDropDownArrow();var focusOutOfDocument=document.activeElement===document.body;
var dontFocusDocument=JSDialog.IsAnyInputFocused()||focusOutOfDocument;
var dontStealFocus=sameAddress&&this._map.calcInputBarHasFocus();
dontFocusDocument=dontFocusDocument||dontStealFocus;if(!dontFocusDocument)this._map.fire(
"editorgotfocus")}this._removeCellDropDownArrow();URLPopUpSection.closeURLPopUp()},
_onValidityListButtonMsg:function(textMsg){var strXY=textMsg.match(/\d+/g);
var validatedCellAddress=new cool.SimplePoint(parseInt(strXY[0]),parseInt(strXY[1]));
var show=parseInt(strXY[2])===1;if(show){if(
this._validatedCellAddress&&!validatedCellAddress.equals(this._validatedCellAddress.toArray())){
this._validatedCellAddress=null;this._removeCellDropDownArrow()}
this._validatedCellAddress=validatedCellAddress;this._addCellDropDownArrow()}else if(
this._validatedCellAddress&&validatedCellAddress.equals(this._validatedCellAddress.toArray())){
this._validatedCellAddress=null;this._removeCellDropDownArrow()}},_onValidityInputHelpMsg:function(
textMsg){app.definitions.validityInputHelpSection.removeValidityInputHelp();
app.definitions.validityInputHelpSection.showValidityInputHelp(textMsg,new cool.SimplePoint(
app.calc.cellCursorRectangle.x2,app.calc.cellCursorRectangle.y1))},_addCellDropDownArrow:function(){
if(this._validatedCellAddress&&app.calc.cellCursorVisible&&this._validatedCellAddress.equals(
app.calc.cellAddress.toArray())){let position;if(this.sheetGeometry){
position=this.sheetGeometry.getCellRect(this._validatedCellAddress.x,this._validatedCellAddress.y);
position=new cool.SimplePoint(app.calc.cellCursorRectangle.x2,(
position.max.y-CalcValidityDropDown.dropDownArrowSize*app.dpiScale)*app.pixelsToTwips)
}else position=new cool.SimplePoint(app.calc.cellCursorRectangle.x2,
app.calc.cellCursorRectangle.y2-CalcValidityDropDown.dropDownArrowSize*app.dpiScale*app.pixelsToTwips
);if(!app.sectionContainer.getSectionWithName(app.CSections.CalcValidityDropDown.name)){
let dropDownSection=new CalcValidityDropDown(position);app.sectionContainer.addSection(
dropDownSection)}else{app.sectionContainer.getSectionWithName(
app.CSections.CalcValidityDropDown.name).setPosition(position.pX,position.pY)}}},
_removeCellDropDownArrow:function(){if(!this._validatedCellAddress
)app.sectionContainer.removeSection(app.CSections.CalcValidityDropDown.name)},
_removeSelection:function(){this._selectedTextContent="";this._textCSelections.clear()},
_onDragOver:function(e){e=e.originalEvent;e.preventDefault()},_onDrop:function(e){
var latlng=e.latlng;var docLayer=this._map._docLayer;var mousePos=docLayer._latLngToTwips(latlng);
var count=1;var buttons=1;var modifier=this._map.keyboard.modifier;this._postMouseEvent("buttondown"
,mousePos.x,mousePos.y,count,buttons,modifier);this._postMouseEvent("buttonup",mousePos.x,mousePos.y
,count,buttons,modifier);e=e.originalEvent;e.preventDefault();if(this._map._clip){
var htmlText=e.dataTransfer.getData("text/html");this._map._clip.dataTransferToDocument(
e.dataTransfer,false,htmlText)}},_fitWidthZoom:function(e,maxZoom){if(this.isCalc())return;if(
app.activeDocument.fileSize.x===0){return}var oldSize=e?e.oldSize:this._map.getSize();
var newSize=e?e.newSize:this._map.getSize();newSize.x*=app.dpiScale;newSize.y*=app.dpiScale;
oldSize.x*=app.dpiScale;oldSize.y*=app.dpiScale;if(this.isWriter()&&newSize.x-oldSize.x===0){return}
var widthTwips=newSize.x*app.tile.size.x/TileManager.tileSize;
var ratio=widthTwips/app.activeDocument.fileSize.x;maxZoom=maxZoom?maxZoom:10;
var zoom=this._map.getScaleZoom(ratio,10);zoom=Math.min(maxZoom,Math.max(.1,zoom));if(
this._firstFitDone)zoom=this._map._zoom;this._firstFitDone=true;if(zoom>1)zoom=Math.floor(zoom);
this._map.setZoom(zoom,{animate:false})},_onCellCursorShift:function(force){if(
this._cellCursorSection&&!this.options.sheetGeometryDataEnabled||force){this.requestCellCursor()}},
requestCellCursor:function(){app.socket.sendMessage(
"commandvalues command=.uno:CellCursor"+"?outputHeight="+TileManager.tileSize+"&outputWidth="+TileManager.tileSize+"&tileHeight="+app.tile.size.x+"&tileWidth="+app.tile.size.y
)},_invalidateAllPreviews:function(){this._previewInvalidations=[];for(
var key in this._map._docPreviews){var preview=this._map._docPreviews[key];preview.invalid=true;
this._previewInvalidations.push(new cool.Bounds(new cool.Point(0,0),new cool.Point(preview.maxWidth,
preview.maxHeight)))}this._invalidatePreviews()},_invalidatePreviews:function(){if(
this._map&&this._map._docPreviews&&this._previewInvalidations.length>0){var toInvalidate={};for(
var i=0;i<this._previewInvalidations.length;i++){var invalidBounds=this._previewInvalidations[i];
for(var key in this._map._docPreviews){var preview=this._map._docPreviews[key];if(preview.index>=0){
if(
preview.invalid||preview.index===this._selectedPart||preview.index===this._prevSelectedPart&&this._prevSelectedPartNeedsUpdate
){if(preview.index===this._prevSelectedPart){this._prevSelectedPartNeedsUpdate=false}toInvalidate[
key]=true}}else{var bounds=new cool.Bounds(new cool.Point(preview.tilePosX,preview.tilePosY),
new cool.Point(preview.tilePosX+preview.tileWidth,preview.tilePosY+preview.tileHeight));if(
preview.invalid||(
preview.part===this._selectedPart||preview.part===this._prevSelectedPart&&this._prevSelectedPartNeedsUpdate
)&&invalidBounds.intersects(bounds)){if(preview.index===this._prevSelectedPart){
this._prevSelectedPartNeedsUpdate=false}toInvalidate[key]=true}}}}for(key in toInvalidate){
preview=this._map._docPreviews[key];if(preview.autoUpdate){if(preview.index>=0){
this._map.getPreview(preview.id,preview.index,preview.maxWidth,preview.maxHeight,{autoUpdate:true})
}else{this._map.getCustomPreview(preview.id,preview.part,preview.width,preview.height,
preview.tilePosX,preview.tilePosY,preview.tileWidth,preview.tileHeight,{autoUpdate:true})}}}}
this._previewInvalidations=[]},_onFormFieldButtonMsg:function(textMsg){textMsg=textMsg.substring(
"formfieldbutton:".length+1);var json=JSON.parse(textMsg);if(json.action==="show"){
this._formFieldButton=new window.L.FormFieldButton(json);this._map.addLayer(this._formFieldButton)
}else if(this._formFieldButton){this._map.removeLayer(this._formFieldButton)}},
_convertToTileTwipsSheetArea:function(rectangle){if(!(rectangle instanceof cool.Bounds
)||!this.options.printTwipsMsgsEnabled||!this.sheetGeometry){return rectangle}
return this.sheetGeometry.getTileTwipsSheetAreaFromPrint(rectangle)},_convertCalcTileTwips:function(
point,offset){if(!this.options.printTwipsMsgsEnabled||!this.sheetGeometry)return point;
var newPoint=new cool.Point(parseInt(point.x),parseInt(point.y));var _offset=offset?new cool.Point(
parseInt(offset.x),parseInt(offset.y)):new cool.Point(this._shapeGridOffset.x,
this._shapeGridOffset.y);return newPoint.add(_offset)},_getEditCursorRectangle:function(msgObj){if(
typeof msgObj!=="object"||!Object.prototype.hasOwnProperty.call(msgObj,"rectangle")){
window.app.console.error("invalid edit cursor message");return undefined}return cool.Bounds.parse(
msgObj.rectangle)},_getTextSelectionRectangles:function(textMsg){if(typeof textMsg!=="string"){
window.app.console.error("invalid text selection message");return[]}return cool.Bounds.parseArray(
textMsg)},getCursorPos:function(){window.app.console.error(
"No implementations available for getCursorPos!");return new cool.Point(0,0)},
getCommentWizardStructure:function(menuStructure,onlyThread){
var customTitleBar=window.L.DomUtil.create("div");window.L.DomUtil.addClass(customTitleBar,
"mobile-wizard-titlebar-btn-container");var title=window.L.DomUtil.create("span","",customTitleBar);
title.innerText=_("Comment");var button=window.L.DomUtil.createWithId("button","insert_comment",
customTitleBar);window.L.DomUtil.addClass(button,"mobile-wizard-titlebar-btn");button.innerText="+";
button.onclick=this._map.insertComment.bind(this._map);if(menuStructure===undefined){menuStructure={
id:"comment",type:"mainmenu",enabled:true,text:_("Comment"),executionType:"menu",data:[],children:[]
};if(app.isCommentEditingAllowed())menuStructure["customTitle"]=customTitleBar}
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).createCommentStructure(
menuStructure,onlyThread);if(menuStructure.children.length===0){var noComments={id:"emptyWizard",
enable:true,type:"emptyCommentWizard",text:_("No Comments"),children:[]};menuStructure["children"
].push(noComments)}return menuStructure},_openCommentWizard:function(annotation){
window.commentWizard=true;var menuData=this._map._docLayer.getCommentWizardStructure();
this._map.fire("mobilewizard",{data:menuData});if(annotation){$(
"#comment"+annotation.sectionProperties.data.id).click()}},_saveMessageForReplay:function(textMsg,
viewId){if(!this._printTwipsMessagesForReplay){var ownViewTypes=this.isCalc()?["cellcursor",
"referencemarks","cellselectionarea","textselection","invalidatecursor","textselectionstart",
"textselectionend","graphicselection"]:["invalidatecursor","textselection","graphicselection"];if(
this.isWriter())ownViewTypes.push("contentcontrol");var otherViewTypes=this.isCalc()?[
"cellviewcursor","textviewselection","invalidateviewcursor","graphicviewselection"]:[
"textviewselection","invalidateviewcursor"];
this._printTwipsMessagesForReplay=new window.L.MessageStore(ownViewTypes,otherViewTypes)}
var colonIndex=textMsg.indexOf(":");if(colonIndex===-1){return}var msgType=textMsg.substring(0,
colonIndex);this._printTwipsMessagesForReplay.save(msgType,textMsg,viewId)},
_clearMsgReplayStore:function(notOtherMsg){if(!this._printTwipsMessagesForReplay){return}
this._printTwipsMessagesForReplay.clear(notOtherMsg)},_replayPrintTwipsMsgs:function(differentSheet
){if(!this._printTwipsMessagesForReplay){return}this._printTwipsMessagesForReplay.forEach(function(
msg){var skipMessage=differentSheet&&msg.startsWith("graphicselection:");if(!skipMessage
)this._onMessage(msg)}.bind(this))},_replayPrintTwipsMsg:function(msgType){
var msg=this._printTwipsMessagesForReplay.get(msgType);this._onMessage(msg)},
_replayPrintTwipsMsgAllViews:function(msgType){Object.keys(this._map._viewInfo).forEach(function(
viewId){var msg=this._printTwipsMessagesForReplay.get(msgType,parseInt(viewId));if(msg
)this._onMessage(msg)}.bind(this))},_syncTilePanePos:function(){if(this._container){
var mapPanePos=this._map._getMapPanePos();window.L.DomUtil.setPosition(this._container,
new cool.Point(-mapPanePos.x,-mapPanePos.y))}var documentBounds=this._map.getPixelBoundsCore();
var documentPos=documentBounds.min;var documentEndPos=documentBounds.max;const size=[
documentEndPos.x-documentPos.x,documentEndPos.y-documentPos.y];
app.activeDocument.activeView.viewedRectangle=new cool.SimpleRectangle(
documentPos.x*app.pixelsToTwips,documentPos.y*app.pixelsToTwips,size[0]*app.pixelsToTwips,size[1
]*app.pixelsToTwips)},pauseDrawing:function(){if(this._painter&&app.sectionContainer
)app.sectionContainer.pauseDrawing()},resumeDrawing:function(topLevel){if(
this._painter&&app.sectionContainer)app.sectionContainer.resumeDrawing(topLevel)},
allowDrawing:function(){},enableDrawing:function(){if(this._painter&&app.sectionContainer
)app.sectionContainer.enableDrawing()},_getUIWidth:function(){
var section=app.sectionContainer.getSectionWithName(app.CSections.RowHeader.name);if(section){
return Math.round(section.size[0]/app.dpiScale)}else{return 0}},_getUIHeight:function(){
var section=app.sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name);if(section){
return Math.round(section.size[1]/app.dpiScale)}else{return 0}},_getGroupWidth:function(){
var section=app.sectionContainer.getSectionWithName(app.CSections.RowGroup.name);if(section){
return Math.round(section.size[0]/app.dpiScale)}else{return 0}},_getGroupHeight:function(){
var section=app.sectionContainer.getSectionWithName(app.CSections.ColumnGroup.name);if(section){
return Math.round(section.size[1]/app.dpiScale)}else{return 0}},_getTilesSectionRectangle:function(
){var section=app.sectionContainer.getSectionWithName(app.CSections.Tiles.name);if(section){
return app.LOUtil.createRectangle(section.myTopLeft[0]/app.dpiScale,section.myTopLeft[1
]/app.dpiScale,section.size[0]/app.dpiScale,section.size[1]/app.dpiScale)}else{
return app.LOUtil.createRectangle(0,0,0,0)}},_getRealMapSize:function(){this._map._sizeChanged=true;
return this._map.getPixelBounds().getSize()},_getDocumentContainerSize:function(){
let documentContainerSize=document.getElementById("document-container").getBoundingClientRect();
documentContainerSize=[documentContainerSize.width,documentContainerSize.height];
return documentContainerSize},_resizeMapElementAndTilesLayer:function(sizeRectangle){
const mapElement=document.getElementById("map");mapElement.style.left=sizeRectangle.getPxX1()+"px";
mapElement.style.top=sizeRectangle.getPxY1()+"px";mapElement.style.width=sizeRectangle.getPxWidth(
)+"px";mapElement.style.height=sizeRectangle.getPxHeight()+"px";
this._container.style.width=sizeRectangle.getPxWidth()+"px";
this._container.style.height=sizeRectangle.getPxHeight()+"px"},
_mobileChecksAfterResizeEvent:function(heightIncreased){if(!window.mode.isMobile())return;
const hasMobileWizardOpened=this._map.uiManager.mobileWizard?this._map.uiManager.mobileWizard.isOpen(
):false;const hasIframeModalOpened=$(".iframe-dialog-modal").is(":visible");
const focusedUI=document.activeElement===document.body;if(
!hasMobileWizardOpened&&!hasIframeModalOpened&&!focusedUI){if(heightIncreased){
this._map.setAcceptInput(false)}else this._onUpdateCursor(true)}},
_nonDesktopChecksAfterResizeEvent:function(heightIncreased){if(!window.mode.isMobile(
)&&!window.mode.isTablet())return;
const hasVisibleCursor=app.file.textCursor.visible&&this._map._docLayer._cursorMarker&&this._map._docLayer._cursorMarker.isDomAttached(
);if(!heightIncreased&&this._map._docLoaded&&hasVisibleCursor){
const cursorPos=this._map._docLayer._twipsToLatLng({x:app.file.textCursor.rectangle.x1,
y:app.file.textCursor.rectangle.y2});const cursorPositionInView=this._isLatLngInView(cursorPos);if(
!cursorPositionInView)this._map.panTo(cursorPos)}},_syncTileContainerSize:function(){if(!this._map
)return;if(this._docType==="presentation"||this._docType==="drawing")this.onResizeImpress();if(
!this._container)return;const documentContainerSize=this._getDocumentContainerSize();
app.sectionContainer.onResize(documentContainerSize[0],documentContainerSize[1]);
const oldSize=this._getRealMapSize();this._resizeMapElementAndTilesLayer(
this._getTilesSectionRectangle());const newSize=this._getRealMapSize();
const heightIncreased=oldSize.y<newSize.y;const widthIncreased=oldSize.x<newSize.x;if(
oldSize.x!==newSize.x||oldSize.y!==newSize.y)this._map.invalidateSize(false,oldSize);
this._mobileChecksAfterResizeEvent(heightIncreased);this._fitWidthZoom();this._map.setView(
this._map.getCenter());this._nonDesktopChecksAfterResizeEvent(heightIncreased);if(
heightIncreased||widthIncreased){app.sectionContainer.requestReDraw();this._map.fire("sizeincreased"
)}},hasSplitPanesSupport:function(){if(this.isCalc()&&this.options.sheetGeometryDataEnabled){
return true}return false},setZoomChanged:function(zoomChanged){app.sectionContainer.setZoomChanged(
zoomChanged)},onAdd:function(map){this._initContainer();this._formID=null;TextSelections.initiate();
CellSelectionMarkers.initiate();if(this.isCalc()){var cursorStyle=new CStyleData(this._cursorDataDiv
);var weight=cursorStyle.getFloatPropWithoutUnit("border-top-width")*app.dpiScale;
var color=cursorStyle.getPropValue("border-top-color");
this._cellCursorSection=new CellCursorSection(color,weight);app.sectionContainer.addSection(
this._cellCursorSection)}this._getToolbarCommandsValues();this._textCSelections=new CSelections(
undefined,this._canvasOverlay,this._selectionsDataDiv,this._map,false,undefined,"text");
this._oleCSelections=new CSelections(undefined,this._canvasOverlay,this._selectionsDataDiv,this._map
,false,undefined,"ole");this._references=new CReferences(this._canvasOverlay);this._referencesAll=[]
this._viewLayerGroup=new window.L.LayerGroup;if(!app.isReadOnly()){map.addLayer(this._viewLayerGroup
)}this._debug=map._debug;this._searchResultsLayer=new window.L.LayerGroup;map.addLayer(
this._searchResultsLayer);app.socket.sendMessage("commandvalues command=.uno:AcceptTrackedChanges");
map._fadeAnimated=false;this._viewReset();map.on("dragover",this._onDragOver,this);map.on("drop",
this._onDrop,this);map.on("zoomstart",this._onZoomStart,this);map.on("zoomend",this._onZoomEnd,this)
if(this._docType==="spreadsheet"){map.on("zoomend",this._onCellCursorShift,this)}map.on("error",
this._mapOnError,this);if(map.options.autoFitWidth!==false){map.on("resize",this._fitWidthZoom,this)
}this._map.on("resize",this._syncTileContainerSize,this);map.on("statusindicator",function(e){if(
e.statusType==="alltilesloaded"&&this._docType==="spreadsheet"){if(
!this._map.uiManager.isAnyDialogOpen())this._onCellCursorShift(true)}},this);app.events.on(
"updatepermission",function(e){if(e.detail.perm!=="edit"){this._clearSelections()}}.bind(this));
map.setPermission(app.file.permission);map.fire("statusindicator",{statusType:"coolloaded"});
this._map.sendInitUNOCommands();this._resetClientVisArea();this._requestNewTiles();map.setZoom();
map.on("sizeincreased",function(){TileManager.update()}.bind(this))},onRemove:function(map){
window.L.DomUtil.remove(this._container);map._removeZoomLimit(this);this._container=null;
this._tileZoom=null;TileManager.clearPreFetch();clearTimeout(this._previewInvalidator);if(
!this._textCSelections.empty()){this._textCSelections.clear()}if(!this._oleCSelections.empty()){
this._oleCSelections.clear()}if(this._cursorMarker&&this._cursorMarker.isDomAttached()){
this._cursorMarker.remove()}TextSelections.dispose();this._removeSplitters();
window.L.DomUtil.remove(this._canvasContainer)},getEvents:function(){var events={
viewreset:this._viewReset,movestart:this._moveStart,move:app.util.throttle(this._move,
this.options.updateInterval,this),moveend:this._moveEnd,splitposchanged:this._move};return events},
zoomStep:function(zoom,newCenter){this._painter.zoomStep(zoom,newCenter)},zoomStepEnd:function(zoom,
newCenter,mapUpdater,runAtFinish,noGap){this._painter.zoomStepEnd(zoom,newCenter,mapUpdater,
runAtFinish,noGap)},preZoomAnimation:function(pinchStartCenter){
this._pinchStartCenter=this._map.project(pinchStartCenter).multiplyBy(app.dpiScale);
this._painter._offset=new cool.Point(0,0);if(this._cursorMarker&&app.file.textCursor.visible){
this._cursorMarker.setOpacity(0)}if(this._map._textInput._cursorHandler){
this._map._textInput._cursorHandler.setOpacity(0)}if(this.isCalc()){
this._cellCursorSection.setShowSection(false)}TextSelections.hideHandles();
app.definitions.otherViewCursorSection.updateVisibilities(true)},postZoomAnimation:function(){if(
app.file.textCursor.visible){this._cursorMarker.setOpacity(1)}if(this._map._textInput._cursorHandler
){this._map._textInput._cursorHandler.setOpacity(1)}if(this.isCalc()){
this._cellCursorSection.setShowSection(true)}TextSelections.showHandles();if(this._annotations){
var annotations=this._annotations;if(annotations.update)setTimeout(function(){annotations.update()},
250)}},runZoomAnimation:function(zoomEnd,pinchCenter,mapUpdater,runAtFinish){if(
this._map.getDocType()==="spreadsheet")OtherViewCellCursorSection.closePopups();
this.preZoomAnimation(pinchCenter);this.zoomStep(this._map.getZoom(),pinchCenter);var thisObj=this;
this.zoomStepEnd(zoomEnd,pinchCenter,mapUpdater,function(){thisObj.postZoomAnimation();runAtFinish()
})},_viewReset:function(e){this._reset(e&&e.hard);if(
this._docType==="spreadsheet"&&this._annotations!==undefined){app.socket.sendMessage(
"commandvalues command=.uno:ViewAnnotationsPosition")}},_removeSplitters:function(){if(
this._xSplitter){this._canvasOverlay.removePath(this._xSplitter);this._xSplitter=undefined}if(
this._ySplitter){this._canvasOverlay.removePath(this._ySplitter);this._ySplitter=undefined}},
_cssPixelsToCore:function(cssPixels){return cssPixels.multiplyBy(app.dpiScale)},
_twipsToCorePixels:function(twips){return new cool.Point(twips.x*app.twipsToPixels,
twips.y*app.twipsToPixels)},_twipsToCorePixelsBounds:function(twips){return new cool.Bounds(
this._twipsToCorePixels(twips.min),this._twipsToCorePixels(twips.max))},_corePixelsToTwips:function(
corePixels){return new cool.Point(corePixels.x*app.pixelsToTwips,corePixels.y*app.pixelsToTwips)},
_twipsToCssPixels:function(twips){return new cool.Point(twips.x/app.tile.size.x*(
TileManager.tileSize/app.dpiScale),twips.y/app.tile.size.y*(TileManager.tileSize/app.dpiScale))},
_cssPixelsToTwips:function(pixels){return new cool.Point(pixels.x*app.dpiScale*app.pixelsToTwips,
pixels.y*app.dpiScale*app.pixelsToTwips)},_twipsToLatLng:function(twips,zoom){
var pixels=this._twipsToCssPixels(twips);return this._map.unproject(pixels,zoom)},
_latLngToTwips:function(latLng,zoom){var pixels=this._map.project(latLng,zoom);
return this._cssPixelsToTwips(pixels)},_twipsToPixels:function(twips){return this._twipsToCssPixels(
twips)},_pixelsToTwips:function(pixels){return this._cssPixelsToTwips(pixels)},
_updateMaxBounds:function(sizeChanged){if(
app.activeDocument.fileSize.x===0||app.activeDocument.fileSize.y===0){return}
var docPixelLimits=new cool.Point(app.activeDocument.fileSize.pX/app.dpiScale,
app.activeDocument.fileSize.pY/app.dpiScale);var scrollPixelLimits=new cool.Point(
app.activeDocument.activeView.viewSize.pX/app.dpiScale,
app.activeDocument.activeView.viewSize.pY/app.dpiScale);var topLeft=this._map.unproject(
new cool.Point(0,0));if(this._documentInfo===""||sizeChanged){this._map.setDocBounds(
new window.L.LatLngBounds(topLeft,this._map.unproject(docPixelLimits)));this._map.setMaxBounds(
new window.L.LatLngBounds(topLeft,this._map.unproject(scrollPixelLimits)))}this._docPixelSize={
x:docPixelLimits.x,y:docPixelLimits.y};this._map.fire("scrolllimits",{})},
_getMostVisiblePart:function(queue){var parts=[];var found=false;for(var i=0;i<queue.length;i++){
for(var j=0;j<parts.length;j++){if(parts[j].part===queue[i].part){found=true;break}}if(!found
)parts.push({part:queue[i].part});found=false}var ratio=TileManager.tileSize/app.tile.size.y;
var partHeightPixels=Math.round((this._partHeightTwips+this._spaceBetweenParts)*ratio);
var partWidthPixels=Math.round(this._partWidthTwips*ratio);var rectangle;var maxArea=-1;
var mostVisiblePart=0;const viewedRectangle=app.activeDocument.activeView.viewedRectangle.pToArray()
for(i=0;i<parts.length;i++){rectangle=[0,partHeightPixels*parts[i].part,partWidthPixels,
partHeightPixels];rectangle=app.LOUtil._getIntersectionRectangle(rectangle,viewedRectangle);if(
rectangle){if(rectangle[2]*rectangle[3]>maxArea){maxArea=rectangle[2]*rectangle[3];
mostVisiblePart=parts[i].part}}}return mostVisiblePart},highlightCurrentPart:function(part){
var previews=document.getElementsByClassName("preview-frame");for(var i=0;i<previews.length;i++){
const img=previews[i].querySelector("img");if(parseInt(previews[i].id.replace("preview-frame-part-",
""))===part){window.L.DomUtil.addClass(img,"preview-img-currentpart")}else{
window.L.DomUtil.removeClass(img,"preview-img-currentpart")}}},_checkSelectedPart:function(){
var queue=TileManager.updateFileBasedView(true);if(queue.length>0){
var partToSelect=this._getMostVisiblePart(queue);if(this._selectedPart!==partToSelect){
this._selectedPart=partToSelect;this._preview._scrollToPart();this.highlightCurrentPart(partToSelect
);app.socket.sendMessage("setclientpart part="+this._selectedPart)}}},_showDebugForTile:function(key
){if(!this._debug.debugOn)return;const tile=TileManager.get(key);
tile._debugTime=this._debug.getTimeArray()},_coordsToPixBounds:function(coords){
var topLeft=new cool.Point(coords.x,coords.y);var bottomRight=topLeft.add(new cool.Point(
TileManager.tileSize,TileManager.tileSize));return new cool.Bounds(topLeft,bottomRight)},
hasXSplitter:function(){return!!this._xSplitter},hasYSplitter:function(){return!!this._ySplitter},
getTileSectionPos:function(){return this._painter.getTileSectionPos()},isLayoutRTL:function(){
return!!this._layoutIsRTL},isCalcRTL:function(){return this.isCalc()&&this.isLayoutRTL()}});
window.L.MessageStore=window.L.Class.extend({initialize:function(ownViewTypes,otherViewTypes){if(
!Array.isArray(ownViewTypes)||!Array.isArray(otherViewTypes)){window.app.console.error(
"Unexpected argument types");return}var ownMessages={};ownViewTypes.forEach(function(msgType){
ownMessages[msgType]=""});this._ownMessages=ownMessages;var othersMessages={};
otherViewTypes.forEach(function(msgType){othersMessages[msgType]=[]});
this._othersMessages=othersMessages},clear:function(notOtherMsg){var msgs=this._ownMessages;
Object.keys(msgs).forEach(function(msgType){msgs[msgType]=""});if(!notOtherMsg){
msgs=this._othersMessages;Object.keys(msgs).forEach(function(msgType){msgs[msgType]=[]})}},
save:function(msgType,textMsg,viewId){var othersMessage=typeof viewId==="number";if(
!othersMessage&&Object.prototype.hasOwnProperty.call(this._ownMessages,msgType)){this._ownMessages[
msgType]=textMsg;return}if(othersMessage&&Object.prototype.hasOwnProperty.call(this._othersMessages,
msgType)){this._othersMessages[msgType][viewId]=textMsg}},get:function(msgType,viewId){
var othersMessage=typeof viewId==="number";if(!othersMessage&&Object.prototype.hasOwnProperty.call(
this._ownMessages,msgType)){return this._ownMessages[msgType]}if(
othersMessage&&Object.prototype.hasOwnProperty.call(this._othersMessages,msgType)){
return this._othersMessages[msgType][viewId]}},forEach:function(callback){if(
typeof callback!=="function"){window.app.console.error("Invalid callback type");return}
this._cleanUpSelectionMessages(this._ownMessages);var ownMessages=this._ownMessages;Object.keys(
this._ownMessages).forEach(function(msgType){callback(ownMessages[msgType])});
var othersMessages=this._othersMessages;Object.keys(othersMessages).forEach(function(msgType){
othersMessages[msgType].forEach(callback)})},_cleanUpSelectionMessages:function(messages){if(
!messages&&!messages["textselection"]&&messages["textselection"]!=="textselection: ")return;
messages["textselectionstart"]="textselectionstart: ";messages["textselectionend"
]="textselectionend: "}});var __extends=this&&this.__extends||function(){var extendStatics=function(
d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){
d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]}
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var Bounds=cool.Bounds;var CDarkOverlay=function(_super){
__extends(CDarkOverlay,_super);function CDarkOverlay(pointSet,options){var _this=_super.call(this,[]
)||this;_this.rectangles=[];_this.options=options;_this.rectangles=_this.createRectangles(4);
_this.setPointSet(pointSet);return _this}CDarkOverlay.prototype.setPointSet=function(pointSet){
var points=pointSet.getPointArray();if(!points){for(var i=0;i<this.rectangles.length;i++){
this.rectangles[i].setBounds(new cool.Bounds(new cool.Point(0,0),new cool.Point(0,1)));this.push(
this.rectangles[i])}return}var rectangleBounds=this.invertOleBounds(new cool.Bounds(points[0],
points[2]));for(var i=0;i<this.rectangles.length;i++){this.rectangles[i].setBounds(rectangleBounds[i
]);this.push(this.rectangles[i])}};CDarkOverlay.prototype.invertOleBounds=function(oleBounds){
var rectanglesBounds=[];var minWidth=0;var minHeight=0;var fullWidth=1e6;var fullHeight=1e6;
rectanglesBounds.push(new cool.Bounds(new cool.Point(minWidth,minHeight),new cool.Point(fullWidth,
oleBounds.min.y)));rectanglesBounds.push(new cool.Bounds(new cool.Point(minWidth,oleBounds.min.y),
oleBounds.getBottomLeft()));rectanglesBounds.push(new cool.Bounds(oleBounds.getTopRight(),
new cool.Point(fullWidth,oleBounds.max.y)));rectanglesBounds.push(new cool.Bounds(new cool.Point(
minWidth,oleBounds.max.y),new cool.Point(fullWidth,fullHeight)));return rectanglesBounds};
CDarkOverlay.prototype.createRectangles=function(quantity){var rectangles=[];for(
var i=0;i<quantity;i++){rectangles.push(new CRectangle(new cool.Bounds(new cool.Point(0,0),
new cool.Point(0,1)),this.options))}return rectangles};return CDarkOverlay}(CPathGroup);var cool;(
function(cool){var SplitPanesContext=function(){function SplitPanesContext(docLayer){console.assert(
docLayer,"no docLayer!");console.assert(docLayer._map,"no map!");this._docLayer=docLayer;
this._map=docLayer._map;this._setDefaults()}SplitPanesContext.prototype._setDefaults=function(){
this._splitPos=new cool.Point(0,0)};Object.defineProperty(SplitPanesContext.prototype,"options",{
get:function(){return SplitPanesContext.options},enumerable:false,configurable:true});
SplitPanesContext.prototype.getMaxSplitPosX=function(){var rawMax=Math.floor(
app.sectionContainer.getWidth()*this.options.maxHorizontalSplitPercent/100);
return this._docLayer.getSnapDocPosX(rawMax)};SplitPanesContext.prototype.getMaxSplitPosY=function(
){var rawMax=Math.floor(app.sectionContainer.getHeight()*this.options.maxVerticalSplitPercent/100);
return this._docLayer.getSnapDocPosY(rawMax)};SplitPanesContext.prototype.setSplitPos=function(
splitX,splitY,forceUpdate){if(forceUpdate===void 0){forceUpdate=false}
var xchanged=this.setHorizSplitPos(splitX,forceUpdate,true);var ychanged=this.setVertSplitPos(splitY
,forceUpdate,true);if(xchanged||ychanged){this._map.fire("splitposchanged");
var section=app.sectionContainer.getSectionWithName(app.CSections.Splitter.name);if(section){
section.setPosition(0,0)}}};SplitPanesContext.prototype.getSplitPos=function(){
return this._splitPos.divideBy(app.dpiScale)};SplitPanesContext.prototype.justifySplitPos=function(
split,isHoriz){if(split<=0){return 0}var maxSplitPos=isHoriz?this.getMaxSplitPosX(
):this.getMaxSplitPosY();if(split>=maxSplitPos){return maxSplitPos}
return isHoriz?this._docLayer.getSnapDocPosX(split):this._docLayer.getSnapDocPosY(split)};
SplitPanesContext.prototype.setHorizSplitPos=function(splitX,forceUpdate,noFire){console.assert(
typeof splitX==="number","splitX must be a number");if(this._splitPos.x===splitX){return false}
var changed=false;var newX=this.justifySplitPos(splitX,true);if(newX!==this._splitPos.x){
this._splitPos.x=newX;changed=true}app.calc.splitCoordinate.pX=newX;if(!noFire)this._map.fire(
"splitposchanged");return changed};SplitPanesContext.prototype.setVertSplitPos=function(splitY,
forceUpdate,noFire){console.assert(typeof splitY==="number","splitY must be a number");if(
this._splitPos.y===splitY){return false}var changed=false;var newY=this.justifySplitPos(splitY,false
);if(newY!==this._splitPos.y){this._splitPos.y=newY;changed=true}app.calc.splitCoordinate.pY=newY;
if(!noFire)this._map.fire("splitposchanged");return changed};
SplitPanesContext.prototype.getPanesProperties=function(){var paneStatusList=[];if(
this._splitPos.x&&this._splitPos.y){paneStatusList.push({xFixed:true,yFixed:true})}if(
this._splitPos.y){paneStatusList.push({xFixed:false,yFixed:true})}if(this._splitPos.x){
paneStatusList.push({xFixed:true,yFixed:false})}paneStatusList.push({xFixed:false,yFixed:false});
return paneStatusList};SplitPanesContext.prototype.getViewRectangles=function(){
var viewRectangles=new Array;viewRectangles.push(
app.activeDocument.activeView.viewedRectangle.clone());if(this._splitPos.x){viewRectangles[0].pX1=0;
viewRectangles[0].pX2=this._splitPos.x;
var topRightPane=app.activeDocument.activeView.viewedRectangle.clone();
var width=app.activeDocument.activeView.viewedRectangle.pWidth-viewRectangles[0].pWidth;
topRightPane.pX1=app.activeDocument.activeView.viewedRectangle.pX2-width;topRightPane.pWidth=width;
viewRectangles.push(topRightPane)}if(this._splitPos.y){viewRectangles[0].pY1=0;viewRectangles[0
].pY2=this._splitPos.y;var bottomLeftPane=app.activeDocument.activeView.viewedRectangle.clone();
var height=app.activeDocument.activeView.viewedRectangle.pHeight-viewRectangles[0].pHeight;
bottomLeftPane.pY1=app.activeDocument.activeView.viewedRectangle.pY2-height;
bottomLeftPane.pHeight=height;viewRectangles.push(bottomLeftPane)}if(
this._splitPos.x&&this._splitPos.y){viewRectangles[1].pY1=0;viewRectangles[1].pY2=this._splitPos.y;
viewRectangles[2].pX1=0;viewRectangles[2].pX2=this._splitPos.x;
var bottomRightPane=app.activeDocument.activeView.viewedRectangle.clone();
var width=app.activeDocument.activeView.viewedRectangle.pWidth-viewRectangles[0].pWidth;
var height=app.activeDocument.activeView.viewedRectangle.pHeight-viewRectangles[0].pHeight;
bottomRightPane.pX1=app.activeDocument.activeView.viewedRectangle.pX2-width;
bottomRightPane.pWidth=width;
bottomRightPane.pY1=app.activeDocument.activeView.viewedRectangle.pY2-height;
bottomRightPane.pHeight=height;viewRectangles.push(bottomRightPane)}return viewRectangles};
SplitPanesContext.prototype.getPxBoundList=function(pxBounds){if(!pxBounds){
pxBounds=this._map.getPixelBoundsCore()}var topLeft=pxBounds.getTopLeft();
var bottomRight=pxBounds.getBottomRight();var boundList=[];if(this._splitPos.x&&this._splitPos.y){
boundList.push(new cool.Bounds(new cool.Point(0,0),this._splitPos))}if(this._splitPos.y){
boundList.push(new cool.Bounds(new cool.Point(topLeft.x+this._splitPos.x,0),new cool.Point(
bottomRight.x,this._splitPos.y)))}if(this._splitPos.x){boundList.push(new cool.Bounds(
new cool.Point(0,topLeft.y+this._splitPos.y),new cool.Point(this._splitPos.x,bottomRight.y)))}if(
!boundList.length){boundList.push(new cool.Bounds(topLeft,bottomRight))}else{boundList.push(
new cool.Bounds(topLeft.add(this._splitPos),bottomRight))}return boundList};
SplitPanesContext.prototype.getTwipsBoundList=function(pxBounds){var bounds=this.getPxBoundList(
pxBounds);var docLayer=this._docLayer;return bounds.map(function(bound){return new cool.Bounds(
docLayer._corePixelsToTwips(bound.min),docLayer._corePixelsToTwips(bound.max))})};
SplitPanesContext.prototype.intersectsVisible=function(areaPx){
var pixBounds=this._map.getPixelBoundsCore();var boundList=this.getPxBoundList(pixBounds);for(
var i=0;i<boundList.length;++i){if(areaPx.intersects(boundList[i])){return true}}return false};
SplitPanesContext.options={maxHorizontalSplitPercent:70,maxVerticalSplitPercent:70};
return SplitPanesContext}();cool.SplitPanesContext=SplitPanesContext})(cool||(cool={}));
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var CalcSplitPanesContext=function(
_super){__extends(CalcSplitPanesContext,_super);function CalcSplitPanesContext(){
return _super!==null&&_super.apply(this,arguments)||this}
CalcSplitPanesContext.prototype._setDefaults=function(){this._part=this._docLayer.getSelectedPart();
this._splitPos=new cool.Point(0,0);this._splitCell=new cool.Point(0,0)};
CalcSplitPanesContext.prototype.setSplitCol=function(splitCol){console.assert(
typeof splitCol==="number","invalid argument type");return this._splitCell.setX(splitCol)};
CalcSplitPanesContext.prototype.setSplitRow=function(splitRow){console.assert(
typeof splitRow==="number","invalid argument type");return this._splitCell.setY(splitRow)};
CalcSplitPanesContext.prototype.setSplitPosFromCell=function(forceSplittersUpdate){if(
this._docLayer.sheetGeometry.getPart()!==this._docLayer._selectedPart)return;
var newSplitPos=this._docLayer.sheetGeometry.getCellRect(this._splitCell.x,this._splitCell.y).min;
this.setSplitPos(newSplitPos.x,newSplitPos.y,forceSplittersUpdate);this.setSplitCellFromPos()};
CalcSplitPanesContext.prototype.setSplitCellFromPos=function(){
var newSplitCell=this._docLayer.sheetGeometry.getCellFromPos(this._splitPos,"corepixels");if(
!this._docLayer.dontSendSplitPosToCore){this.setSplitCol(newSplitCell.x
)&&this._docLayer.sendSplitIndex(newSplitCell.x,true);this.setSplitRow(newSplitCell.y
)&&this._docLayer.sendSplitIndex(newSplitCell.y,false)}};return CalcSplitPanesContext}(
cool.SplitPanesContext);cool.CalcSplitPanesContext=CalcSplitPanesContext})(cool||(cool={}));
window.L.CanvasTileLayer.include({_initializeTableOverlay:function(){this._tableColumnMarkers=[];
this._tableRowMarkers=[];this._tableMarkersDragged=false;this._tableSelectionColumnMarkers=[];
this._tableSelectionRowMarkers=[];this._selectionHeaderDistanceFromTable=6;
this._selectionHeaderHeight=16;this._tableAddMarkers=[]},_setupTableOverlay:function(){this._map.on(
"messagesdone",this._updateTableMarkers,this);this._map.on("zoomend",this._onZoomForTableMarkers,
this)},_convertPixelToTwips:function(pixel){var point=this._latLngToTwips(this._map.unproject(
new cool.Point(pixel,0)));return point.x},_convertTwipsToPixels:function(twips){
var point=this._twipsToLatLng(twips);point=this._map.project(point);return point},
hasTableSelection:function(){if(!this._currentTableData)return false;
return this._currentTableData.rows!=null||this._currentTableData.columns!=null},
_setMarkerPosition:function(marker){var point=this._twipsToLatLng(marker._positionTwips,
this._map.getZoom());point=this._map.project(point);
var markerRect=marker._icon.getBoundingClientRect();var raiseDelta;
var aboveSelectionHeaders=this._selectionHeaderDistanceFromTable+this._selectionHeaderHeight;
aboveSelectionHeaders=this._convertPixelToTwips(aboveSelectionHeaders);if(marker._type.startsWith(
"column")){point=point.subtract(new cool.Point(markerRect.width/2,markerRect.height));
raiseDelta=new cool.Point(0,aboveSelectionHeaders)}else{point=point.subtract(new cool.Point(
markerRect.width,markerRect.height/2));raiseDelta=new cool.Point(aboveSelectionHeaders,0)}
raiseDelta=this._map.project(this._twipsToLatLng(raiseDelta,this._map.getZoom()));
point=point.subtract(raiseDelta);point=this._map.unproject(point);marker.setLatLng(point);if(
marker._type.startsWith("column"))marker.dragging.freezeY(true);else marker.dragging.freezeX(true)},
_createMarker:function(markerType,entry,left,right){var className;if(markerType==="column"
)className="table-column-resize-marker";else className="table-row-resize-marker";
var marker=window.L.marker(new window.L.LatLng(0,0),{icon:window.L.divIcon({className:className,
iconSize:null}),draggable:true});this._map.addLayer(marker);marker._type=markerType+"-"+entry.type;
marker._position=parseInt(entry.position);marker._initialPosition=marker._position;
marker._min=parseInt(entry.min);marker._max=parseInt(entry.max);marker._index=parseInt(entry.index);
if(markerType==="column"){marker._positionTwips=new cool.Point(
this._tablePositionColumnOffset+marker._position,left);marker._topBorderPoint=new cool.Point(
this._tablePositionColumnOffset+marker._position,left);marker._topBorderPoint=this._twipsToLatLng(
marker._topBorderPoint,this._map.getZoom());marker._bottomBorderPoint=new cool.Point(
this._tablePositionColumnOffset+marker._position,right);
marker._bottomBorderPoint=this._twipsToLatLng(marker._bottomBorderPoint,this._map.getZoom())}else{
marker._positionTwips=new cool.Point(left,this._tablePositionRowOffset+marker._position);
marker._topBorderPoint=new cool.Point(left,this._tablePositionRowOffset+marker._position);
marker._topBorderPoint=this._twipsToLatLng(marker._topBorderPoint,this._map.getZoom());
marker._bottomBorderPoint=new cool.Point(right,this._tablePositionRowOffset+marker._position);
marker._bottomBorderPoint=this._twipsToLatLng(marker._bottomBorderPoint,this._map.getZoom())}
this._setMarkerPosition(marker);marker.on("dragstart drag dragend",
this._onTableBorderResizeMarkerDrag,this);return marker},_addMoveMarker(){let x=parseInt(
this._currentTableData.rectangle.x);let y=parseInt(this._currentTableData.rectangle.y);
const anchorSize=ShapeHandleAnchorSubSection.tableAnchorIconSize;x-=Math.round(anchorSize[0
]*app.pixelsToTwips);y-=Math.round(anchorSize[1]*app.pixelsToTwips);
this._tableAnchorSection=new app.definitions.shapeHandleAnchorSubSection(null,"table-anchor",
anchorSize,new cool.SimplePoint(x,y),null);app.sectionContainer.addSection(this._tableAnchorSection)
},_removeMoveMarker(){if(this._tableAnchorSection)app.sectionContainer.removeSection(
this._tableAnchorSection.name)},_clearTableMarkers:function(){var markerIndex;for(
markerIndex=0;markerIndex<this._tableColumnMarkers.length;markerIndex++){this._map.removeLayer(
this._tableColumnMarkers[markerIndex])}this._tableColumnMarkers=[];for(
markerIndex=0;markerIndex<this._tableRowMarkers.length;markerIndex++){this._map.removeLayer(
this._tableRowMarkers[markerIndex])}this._tableRowMarkers=[];for(
markerIndex=0;markerIndex<this._tableSelectionColumnMarkers.length;markerIndex++){
this._map.removeLayer(this._tableSelectionColumnMarkers[markerIndex])}
this._tableSelectionColumnMarkers=[];for(
markerIndex=0;markerIndex<this._tableSelectionRowMarkers.length;markerIndex++){
this._map.removeLayer(this._tableSelectionRowMarkers[markerIndex])}this._tableSelectionRowMarkers=[]
for(markerIndex=0;markerIndex<this._tableAddMarkers.length;markerIndex++){
app.sectionContainer.removeSection(this._tableAddMarkers[markerIndex].section.name)}
this._tableAddMarkers=[];this._removeMoveMarker()},_updateTableMoveMarkerVisibility:function(){if(
this._currentTableData&&this._currentTableMarkerJson===this._lastTableMarkerJson&&this._currentTableData.rows&&this._currentTableData.columns&&this._map.getDocType(
)==="presentation"&&this._currentTableData.rectangle&&!this._tableAnchorSection)this._addMoveMarker(
)},_updateTableMarkers:function(){if(this._currentTableData===undefined)return;if(
this._currentTableMarkerJson===this._lastTableMarkerJson){this._updateTableMoveMarkerVisibility();
return}this._lastTableMarkerJson=this._currentTableMarkerJson;this._clearTableMarkers();if(
this._currentTableData.rows&&this._currentTableData.columns){
this._tablePositionColumnOffset=parseInt(this._currentTableData.columns.tableOffset);
this._tablePositionRowOffset=parseInt(this._currentTableData.rows.tableOffset);
var firstRowPosition=parseInt(this._currentTableData.rows.left)+this._tablePositionRowOffset;
var lastRowPosition=parseInt(this._currentTableData.rows.right)+this._tablePositionRowOffset;
var firstColumnPosition=parseInt(this._currentTableData.columns.left
)+this._tablePositionColumnOffset;var lastColumnPosition=parseInt(
this._currentTableData.columns.right)+this._tablePositionColumnOffset;var markerX,i,entry;
var columnPositions=[];var rowPositions=[];columnPositions.push(parseInt(
this._currentTableData.columns.left));if(this._map.getDocType()!=="presentation"){entry={
type:"left",position:this._currentTableData.columns.left,index:0};markerX=this._createMarker(
"column",entry,firstRowPosition,lastRowPosition);this._tableColumnMarkers.push(markerX)}for(
i=0;i<this._currentTableData.columns.entries.length;i++){
entry=this._currentTableData.columns.entries[i];columnPositions.push(parseInt(entry.position));
entry.type="middle";entry.index=i;markerX=this._createMarker("column",entry,firstRowPosition,
lastRowPosition);this._tableColumnMarkers.push(markerX)}columnPositions.push(parseInt(
this._currentTableData.columns.right));entry={type:"right",
position:this._currentTableData.columns.right,index:0};markerX=this._createMarker("column",entry,
firstRowPosition,lastRowPosition);this._tableColumnMarkers.push(markerX);this._addSelectionMarkers(
"column",columnPositions,firstRowPosition,lastRowPosition);rowPositions.push(parseInt(
this._currentTableData.rows.left));for(i=0;i<this._currentTableData.rows.entries.length;i++){
entry=this._currentTableData.rows.entries[i];rowPositions.push(parseInt(entry.position));
entry.type="middle";entry.index=i;markerX=this._createMarker("row",entry,firstColumnPosition,
lastColumnPosition);this._tableRowMarkers.push(markerX)}rowPositions.push(parseInt(
this._currentTableData.rows.right));entry={type:"right",position:this._currentTableData.rows.right};
markerX=this._createMarker("row",entry,firstColumnPosition,lastColumnPosition);
this._tableRowMarkers.push(markerX);this._addSelectionMarkers("row",rowPositions,firstColumnPosition
,lastColumnPosition);this._addInsertMarkers("column",firstRowPosition);this._addInsertMarkers("row",
firstColumnPosition);if(this._map.getDocType()==="presentation"&&this._currentTableData.rectangle){
this._addMoveMarker();this._updateTableMoveMarkerVisibility()}}},_onZoomForTableMarkers:function(){
this._lastTableMarkerJson="foo";this._updateTableMarkers()},_onTableSelectedMsg:function(textMsg){
if(!this._map.isEditMode()){this._clearTableMarkers();return}if(this._tableMarkersDragged==true){
return}textMsg=textMsg.substring("tableselected:".length+1);var message=JSON.parse(textMsg);
this._currentTableMarkerJson=textMsg;this._currentTableData=message;this._map.fire(
"resettopbottompagespacing",{disableMarker:this._map._docLayer.hasTableSelection()})},
_addSelectionMarkers:function(type,positions,start,end){if(positions.length<2)return;var startX,endX
,startY,endY;var point1;var delta1=this._convertPixelToTwips(this._selectionHeaderDistanceFromTable)
var height=24;var width=height;var selectionMarkerNominalSize=this._convertPixelToTwips(width);
var classNameMarker="table-select-marker";for(var i=0;i<positions.length-1;i++){if(type==="column"){
classNameMarker+=" table-select-marker--column";startX=this._tablePositionColumnOffset+positions[i];
endX=this._tablePositionColumnOffset+positions[i+1];startY=start;endY=end;
point1=this._twipsToLatLng(new cool.Point(startX,startY-delta1-selectionMarkerNominalSize),
this._map.getZoom());width=this._convertTwipsToPixels(new cool.Point(endX-startX,0)).x-2}else{
classNameMarker+=" table-select-marker--row";startX=start;endX=end;
startY=this._tablePositionRowOffset+positions[i];endY=this._tablePositionRowOffset+positions[i+1];
point1=this._twipsToLatLng(new cool.Point(startX-delta1-selectionMarkerNominalSize,startY),
this._map.getZoom());height=this._convertTwipsToPixels(new cool.Point(0,endY-startY)).y-2}
var selectionRectangle=window.L.marker(point1,{icon:window.L.divIcon({className:classNameMarker,
iconSize:[width,height],iconAnchor:[0,0]}),draggable:true});selectionRectangle._start={x:startX,
y:startY};selectionRectangle._end={x:endX,y:endY};if(type==="column"
)this._tableSelectionColumnMarkers.push(selectionRectangle
);else this._tableSelectionRowMarkers.push(selectionRectangle);selectionRectangle.on("click",
this._onSelectRowColumnClick,this);selectionRectangle.on("dragstart drag dragend",
this._onSelectRowColumnDrag,this);this._map.addLayer(selectionRectangle)}},
_onSelectRowColumnClick:function(e){this._postSelectTextEvent("start",e.target._start.x+5,
e.target._start.y+5);this._postSelectTextEvent("end",e.target._end.x-5,e.target._end.y-5)},
_onSelectRowColumnDrag:function(e){e.target.dragging.freezeX(true);e.target.dragging.freezeY(true)},
_addInsertMarkers:function(type,start){const markersDistanceFromTable=10;
const delta1=this._convertPixelToTwips(markersDistanceFromTable);let documentPosition;
let markerWidth;let markerHeight;if(type==="column"){const tableRightEdge=parseInt(
this._currentTableData.columns.right);
const columnPosition=this._tablePositionColumnOffset+tableRightEdge+delta1;
documentPosition=new cool.SimplePoint(columnPosition,start);
const rowStart=this._tablePositionRowOffset+parseInt(this._currentTableData.rows.left);
const rowEnd=this._tablePositionRowOffset+parseInt(this._currentTableData.rows.right);
const totalHeightTwips=rowEnd-rowStart;markerHeight=this._convertTwipsToPixels(new cool.Point(0,
totalHeightTwips)).y;markerWidth=16}else{const tableBottomEdge=parseInt(
this._currentTableData.rows.right);
const rowPosition=this._tablePositionRowOffset+tableBottomEdge+delta1;
documentPosition=new cool.SimplePoint(start,rowPosition);
const colStart=this._tablePositionColumnOffset+parseInt(this._currentTableData.columns.left);
const colEnd=this._tablePositionColumnOffset+parseInt(this._currentTableData.columns.right);
const totalWidthTwips=colEnd-colStart;markerWidth=this._convertTwipsToPixels(new cool.Point(
totalWidthTwips,0)).x;markerHeight=16}const markerSection=new TableInsertMarkerSection(type,
documentPosition);markerSection.setMarkerSize(markerWidth,markerHeight);
app.sectionContainer.addSection(markerSection);this._tableAddMarkers.push({type:type,
section:markerSection})},_onTableBorderResizeMarkerDrag:function(e){if(e.type==="dragstart"){
e.target.isDragged=true;this._tableMarkersDragged=true}else if(e.type==="dragend"){
e.target.isDragged=false;this._tableMarkersDragged=false}var aMousePosition=e.target.getLatLng();
aMousePosition=this._map.project(aMousePosition);var size=e.target._icon.getBoundingClientRect();
aMousePosition=aMousePosition.add(new cool.Point(size.width/2,size.height/2));
aMousePosition=this._map.unproject(aMousePosition);var aLatLonPosition=aMousePosition;
aMousePosition=this._latLngToTwips(aMousePosition);var newPosition;if(e.target._type.startsWith(
"column")){newPosition=aMousePosition.x-this._tablePositionColumnOffset;
e.target._topBorderPoint.lng=aLatLonPosition.lng;e.target._bottomBorderPoint.lng=aLatLonPosition.lng
}else{newPosition=aMousePosition.y-this._tablePositionRowOffset;
e.target._topBorderPoint.lat=aLatLonPosition.lat;e.target._bottomBorderPoint.lat=aLatLonPosition.lat
}e.target._position=newPosition;var bounds=new window.L.LatLngBounds(e.target._topBorderPoint,
e.target._bottomBorderPoint);if(e.type==="dragstart"){this._rectangle=new window.L.Rectangle(bounds)
this._map.addLayer(this._rectangle)}else if(e.type==="drag"){this._rectangle.setBounds(bounds)
}else if(e.type==="dragend"){this._map.removeLayer(this._rectangle);this._rectangle=null;
var offset=newPosition-e.target._initialPosition;e.target._initialPosition=e.target._position;
var params={BorderType:{type:"string",value:e.target._type},Index:{type:"uint16",
value:e.target._index},Offset:{type:"int32",value:offset}};this._map.sendUnoCommand(
".uno:TableChangeCurrentBorderPosition",params)}if(e.originalEvent)e.originalEvent.preventDefault()}
});window.L.WriterTileLayer=window.L.CanvasTileLayer.extend({newAnnotation:function(commentData){
const name=cool.Comment.makeName(commentData);const comment=new cool.Comment(name,commentData,{},
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name));if(
app.file.textCursor.visible){comment.sectionProperties.data.anchorPos=[
app.file.textCursor.rectangle.x2,app.file.textCursor.rectangle.y1]}else if(
GraphicSelection.hasActiveSelection()){comment.sectionProperties.data.anchorPos=[
GraphicSelection.rectangle.x1,GraphicSelection.rectangle.y2]}
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).add(comment);
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).modify(comment)},
beforeAdd:function(map){map.uiManager.initializeSpecializedUI("text")},_onCommandValuesMsg:function(
textMsg){var braceIndex=textMsg.indexOf("{");if(braceIndex<0){return}var values=JSON.parse(
textMsg.substring(braceIndex));if(!values){return}if(values.comments){values.comments.forEach(
function(comment){comment.id=comment.id.toString();comment.parent=comment.parentId.toString()});
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).importComments(
values.comments)}else if(values.redlines&&values.redlines.length>0){
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).importChanges(
values.redlines)}else if(this._map.zotero&&values.userDefinedProperties){
this._map.zotero.handleCustomProperty(values.userDefinedProperties)}else if(
this._map.zotero&&values.fields){this._map.zotero.onFieldValue(values.fields)}else if(
this._map.zotero&&values.field){this._map.zotero.handleFieldUnderCursor(values.field)}else if(
this._map.zotero&&values.setRefs){this._map.zotero.onFieldValue(values.setRefs)}else if(
this._map.zotero&&values.setRef){this._map.zotero.handleFieldUnderCursor(values.setRef)}else if(
this._map.zotero&&values.bookmarks){this._map.zotero.handleBookmark(values.bookmarks)}else if(
this._map.zotero&&values.bookmark){this._map.zotero.fetchCustomProperty(values.bookmark.name)
}else if(this._map.zotero&&values.sections){this._map.zotero.onFieldValue(values.sections)}else{
window.L.CanvasTileLayer.prototype._onCommandValuesMsg.call(this,textMsg)}},_onSetPartMsg:function(
textMsg){var part=parseInt(textMsg.match(/\d+/g)[0]);if(part!==this._currentPage){
this._currentPage=part;this._map.fire("pagenumberchanged",{currentPage:part,pages:this._pages,
docType:this._docType})}},_onStatusMsg:function(textMsg){const statusJSON=JSON.parse(
textMsg.replace("status:","").replace("statusupdate:",""));if(app.socket._reconnecting){
this.persistCursorPositionInWriter=true;this._postMouseEvent("buttondown",this.lastCursorPos.center[
0],this.lastCursorPos.center[1],1,1,0);this._postMouseEvent("buttonup",this.lastCursorPos.center[0],
this.lastCursorPos.center[1],1,1,0)}if(
!statusJSON.width||!statusJSON.height||this._documentInfo===textMsg)return;
var sizeChanged=statusJSON.width!==app.activeDocument.fileSize.x||statusJSON.height!==app.activeDocument.fileSize.y
if(statusJSON.viewid!==undefined)this._viewId=statusJSON.viewid;console.assert(this._viewId>=0,
"Incorrect viewId received: "+this._viewId);if(sizeChanged){
app.activeDocument.fileSize=new cool.SimplePoint(statusJSON.width,statusJSON.height);
app.activeDocument.activeView.viewSize=app.activeDocument.fileSize.clone();
this._docType=statusJSON.type;this._updateMaxBounds(true)}this._documentInfo=textMsg;
this._selectedPart=0;this._selectedMode=statusJSON.mode!==undefined?statusJSON.mode:0;this._parts=1;
this._currentPage=statusJSON.selectedpart;this._pages=statusJSON.partscount;
app.file.writer.pageRectangleList=statusJSON.pagerectangles.slice();this._map.fire(
"pagenumberchanged",{currentPage:this._currentPage,pages:this._pages,docType:this._docType});
TileManager.resetPreFetching(true)}});window.L.ImpressTileLayer=window.L.CanvasTileLayer.extend({
initialize:function(options){window.L.CanvasTileLayer.prototype.initialize.call(this,options);if(
window.mode.isMobile()){this._putPCWOutsideFlex()}this._preview=window.L.control.partsPreview();if(
window.mode.isMobile()){this._addButton=window.L.control.mobileSlide();window.L.DomUtil.addClass(
window.L.DomUtil.get("mobile-edit-button"),"impress")}this._spaceBetweenParts=300;if(!app.file
)app.file={};if(app.file.readOnly)app.file.fileBasedView=true;else app.file.partBasedView=true;
this._partHeightTwips=0;this._partWidthTwips=0;app.events.on("contextchange",
this._onContextChange.bind(this))},_onContextChange(e){const newContext=e.detail.context;
const oldContext=e.detail.oldContext;const isDrawOrNotesPage=["DrawPage","NotesPage"].includes(
newContext);if(isDrawOrNotesPage)app.impress.notesMode=newContext==="NotesPage";if(
app.map.uiManager.getCurrentMode()==="notebookbar"&&isDrawOrNotesPage){
const targetElement=document.getElementById("notesmode");if(!targetElement)return;if(
newContext==="NotesPage")targetElement.classList.add("selected"
);else targetElement.classList.remove("selected")}if(isDrawOrNotesPage){
this._selectedMode=newContext==="NotesPage"?2:0;TileManager.refreshTilesInBackground();
TileManager.update()}if(newContext==="MasterPage"||oldContext==="MasterPage"){
app.socket.sendMessage("status");this.invalidatePreviewsUponContextChange=true}},
_isPCWInsideFlex:function(){var PCW=document.getElementById("main-document-content").querySelector(
"#presentation-controls-wrapper");return PCW?true:false},_putPCWOutsideFlex:function(){if(
this._isPCWInsideFlex()){var pcw=document.getElementById("presentation-controls-wrapper");if(
pcw&&pcw.parentNode){pcw.parentNode.removeChild(pcw);var frc=document.getElementById(
"main-document-content");frc.parentNode.insertBefore(pcw,frc.nextSibling)}}},
_putPCWInsideFlex:function(){if(!this._isPCWInsideFlex()){var pcw=document.getElementById(
"presentation-controls-wrapper");if(pcw){var frc=document.getElementById("main-document-content");
document.body.removeChild(pcw);document.getElementById("document-container"
).parentNode.insertBefore(pcw,frc.children[0])}}},newAnnotation:function(commentData){
commentData.anchorPos=[app.activeDocument.activeView.viewedRectangle.x1,
app.activeDocument.activeView.viewedRectangle.y1];commentData.rectangle=[
app.activeDocument.activeView.viewedRectangle.x1,app.activeDocument.activeView.viewedRectangle.y1,
566,566];commentData.parthash=app.impress.partList[this._selectedPart].hash;
const name=cool.Comment.makeName(commentData);const comment=new cool.Comment(name,commentData,{},
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name));
var annotation=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).add(comment);
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).modify(annotation)},
beforeAdd:function(map){this._map=map;map.addControl(this._preview);map.on("updateparts",
this.onUpdateParts,this);app.events.on("updatepermission",this.onUpdatePermission.bind(this));if(
!map._docPreviews)map._docPreviews={};map.uiManager.initializeSpecializedUI(this._docType)},
onResizeImpress:function(){window.L.DomUtil.updateElementsOrientation([
"presentation-controls-wrapper","document-container","slide-sorter"]);
var mobileEditButton=document.getElementById("mobile-edit-button");if(window.mode.isMobile()){if(
window.L.DomUtil.isPortrait()){this._putPCWOutsideFlex();if(mobileEditButton
)mobileEditButton.classList.add("portrait")}else{this._putPCWInsideFlex();if(mobileEditButton
)mobileEditButton.classList.remove("portrait")}}else{var container=window.L.DomUtil.get(
"main-document-content");var slideSorter=window.L.DomUtil.get("slide-sorter");
var navigationOptions=window.L.DomUtil.get("navigation-options-wrapper");if(
container&&slideSorter&&toolbar){$(slideSorter).height($(container).height()-$(navigationOptions
).height())}}},onRemove:function(){clearTimeout(this._previewInvalidator)},
_openMobileWizard:function(data){window.L.CanvasTileLayer.prototype._openMobileWizard.call(this,data
)},onUpdateParts:function(){if(this._map.uiManager.isAnyDialogOpen())return;
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).onPartChange()},
onUpdatePermission:function(e){if(window.mode.isMobile()){if(e.detail.perm==="edit"){
this._addButton.addTo(this._map)}else{this._addButton.remove()}}},_onCommandValuesMsg:function(
textMsg){try{var values=JSON.parse(textMsg.substring(textMsg.indexOf("{")))}catch(e){values=null}if(
!values){return}if(values.comments){app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name).importComments(values.comments)}else{
window.L.CanvasTileLayer.prototype._onCommandValuesMsg.call(this,textMsg)}},_onSetPartMsg:function(
textMsg){var part=parseInt(textMsg.match(/\d+/g)[0]);if(part!==this._selectedPart){
this._map.deselectAll();this._map.setPart(part,true);this._map.fire("setpart",{
selectedPart:this._selectedPart})}},_onStatusMsg:function(textMsg){const statusJSON=JSON.parse(
textMsg.replace("status:","").replace("statusupdate:",""));textMsg=textMsg.replace("status: ","");
textMsg=textMsg.replace("statusupdate: ","");if(
statusJSON.width&&statusJSON.height&&this._documentInfo!==textMsg){
app.activeDocument.fileSize=new cool.SimplePoint(statusJSON.width,statusJSON.height);
this._docType=statusJSON.type;if(this._docType==="drawing"){window.L.DomUtil.addClass(
window.L.DomUtil.get("presentation-controls-wrapper"),"drawing")}this._parts=statusJSON.partscount;
this._partHeightTwips=app.activeDocument.fileSize.y;
this._partWidthTwips=app.activeDocument.fileSize.x;if(app.file.fileBasedView){
var totalHeight=this._parts*app.activeDocument.fileSize.y;
totalHeight+=this._parts*this._spaceBetweenParts;app.activeDocument.fileSize.y=totalHeight}
app.activeDocument.activeView.viewSize=app.activeDocument.fileSize.clone();
app.impress.partList=Object.assign([],statusJSON.parts);this._updateMaxBounds(true);
this._viewId=statusJSON.viewid;console.assert(this._viewId>=0,
"Incorrect viewId received: "+this._viewId);if(app.socket._reconnecting){app.socket.sendMessage(
"setclientpart part="+this._selectedPart)}else{this._selectedPart=statusJSON.selectedpart}
this._selectedMode=statusJSON.mode!==undefined?statusJSON.mode:statusJSON.parts.length>0&&statusJSON.parts[
0].mode!==undefined?statusJSON.parts[0].mode:0;this._map.fire("impressmodechanged",{
mode:this._selectedMode});if(statusJSON.gridSnapEnabled===true
)app.map.stateChangeHandler.setItemValue(".uno:GridUse","true");else if(
statusJSON.parts.length>0&&statusJSON.parts[0].gridSnapEnabled===true
)app.map.stateChangeHandler.setItemValue(".uno:GridUse","true");if(statusJSON.gridVisible===true
)app.map.stateChangeHandler.setItemValue(".uno:GridVisible","true");else if(
statusJSON.parts.length>0&&statusJSON.parts[0].gridVisible===true
)app.map.stateChangeHandler.setItemValue(".uno:GridVisible","true");TileManager.resetPreFetching(
true);var refreshAnnotation=this._documentInfo!==textMsg;this._documentInfo=textMsg;this._map.fire(
"updateparts",{});if(refreshAnnotation)app.socket.sendMessage(
"commandvalues command=.uno:ViewAnnotations")}if(app.file.fileBasedView
)TileManager.updateFileBasedView();if(this.invalidatePreviewsUponContextChange===true){
this._invalidateAllPreviews();this.invalidatePreviewsUponContextChange=false}},
_invalidateAllPreviews:function(){window.L.CanvasTileLayer.prototype._invalidateAllPreviews.call(
this);this._map.fire("invalidateparts")}});window.L.CalcTileLayer=window.L.CanvasTileLayer.extend({
options:{sheetGeometryDataEnabled:true,printTwipsMsgsEnabled:true,syncSplits:true},
twipsToHMM:function(twips){return(twips*127+36)/72},newAnnotation:function(comment){
var commentList=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name
).sectionProperties.commentList;var comment=null;for(var i=0;i<commentList.length;i++){if(
commentList[i].sectionProperties.data.tab==this._selectedPart){if(commentList[i
].sectionProperties.data.cellRange.contains(app.calc.cellAddress.toArray())){comment=commentList[i];
break}}}if(!comment){var pixelStart=new cool.Point(app.calc.cellCursorRectangle.pX1,
app.calc.cellCursorRectangle.pY1);var rangeStart=this.sheetGeometry.getCellFromPos(pixelStart,
"corepixels");var pixelEnd=new cool.Point(app.calc.cellCursorRectangle.pX2-1,
app.calc.cellCursorRectangle.pY2-1);var rangeEnd=this.sheetGeometry.getCellFromPos(pixelEnd,
"corepixels");var newComment={cellRange:new cool.Bounds(rangeStart,rangeEnd),
anchorPos:app.calc.cellCursorRectangle.toArray(),id:"new",tab:this._selectedPart,dateTime:(new Date
).toISOString(),author:this._map.getViewName(this._viewId)};if(
app.sectionContainer.doesSectionExist("new comment"))app.sectionContainer.removeSection(
"new comment");comment=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).add(
newComment);comment.positionCalcComment()}app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name).modify(comment);comment.focus()},beforeAdd:function(map){
map._addZoomLimit(this);map.on("zoomend",this._onZoomRowColumns,this);map.on("updateparts",
this._onUpdateParts,this);map.on("splitposchanged",this.setSplitCellFromPos,this);map.on(
"commandstatechanged",this._onCommandStateChanged,this);map.uiManager.initializeSpecializedUI(
"spreadsheet");window.keyboard.hintOnscreenKeyboard(window.keyboard.guessOnscreenKeyboard())},
onAdd:function(map){map.addControl(window.L.control.tabs());
window.L.CanvasTileLayer.prototype.onAdd.call(this,map);map.on("resize",function(){if(
app.file.textCursor.visible){this._onUpdateCursor(true)}}.bind(this));
app.sectionContainer.addSection(new app.definitions.AutoFillMarkerSection);
app.sectionContainer.addSection(new SplitterLinesSection);this.insertMode=false;
this._resetInternalState();this._sheetSwitch=new cool.SheetSwitchViewRestore(map);
this._sheetGrid=true;if(window.prefs.getBoolean("ColumnRowHighlightEnabled",false)
)FocusCellSection.addFocusCellSection()},_resetInternalState:function(){this._cellSelections=Array(0
);app.calc.cellCursorVisible=false;this._gotFirstCellCursor=false;this._lastColumn=0;this._lastRow=0
this.requestCellCursor()},_onUpdateParts:function(e){if(
typeof this._prevSelectedPart==="number"&&!e.source){this.refreshViewData(undefined,false,true);
this._switchSplitPanesContext()}},_onMessage:function(textMsg,img){if(textMsg.startsWith(
"invalidateheader: column")){this.refreshViewData({x:this._map._getTopLeftPoint().x,y:0,offset:{
x:undefined,y:0}},true)}else if(textMsg.startsWith("invalidateheader: row")){this.refreshViewData({
x:0,y:this._map._getTopLeftPoint().y,offset:{x:0,y:undefined}},true)}else if(textMsg.startsWith(
"invalidateheader: all")){this.refreshViewData({x:this._map._getTopLeftPoint().x,
y:this._map._getTopLeftPoint().y,offset:{x:undefined,y:undefined}},true)}else if(
this.options.sheetGeometryDataEnabled&&textMsg.startsWith("invalidatesheetgeometry:")){
var params=textMsg.substring("invalidatesheetgeometry:".length).trim().split(" ");var flags={};
params.forEach(function(param){flags[param]=true});this.requestSheetGeometryData(flags)}else if(
textMsg.startsWith("printranges:")){this._onPrintRangesMsg(textMsg)}else{
window.L.CanvasTileLayer.prototype._onMessage.call(this,textMsg,img)}},_onPrintRangesMsg:function(
textMsg){textMsg=textMsg.substr("printranges:".length);var msgData=JSON.parse(textMsg);if(!msgData[
"printranges"]||!Array.isArray(msgData["printranges"]))return;if(!this._printRanges){
this._printRanges=[]}msgData["printranges"].forEach(function(sheetPrintRange){if(
typeof sheetPrintRange["sheet"]!=="number"||!Array.isArray(sheetPrintRange["ranges"])){return}
this._printRanges[sheetPrintRange["sheet"]]=sheetPrintRange["ranges"]},this)},
_onSetPartMsg:function(textMsg){var part=parseInt(textMsg.match(/\d+/g)[0]);if(
!app.calc.isPartHidden(part)){this.refreshViewData(undefined,true,false);
this._replayPrintTwipsMsgAllViews("cellviewcursor");this._replayPrintTwipsMsgAllViews(
"textviewselection");app.sectionContainer.getSectionWithName(app.CSections.CommentList.name
).hideAllComments();this._sheetSwitch.gotSetPart(part);this._syncTileContainerSize()}},
_onZoomRowColumns:function(){this._sendClientZoom();if(this.sheetGeometry){
this.sheetGeometry.setTileGeometryData(app.tile.size.x,app.tile.size.y,TileManager.tileSize)}
this._restrictDocumentSize();this.setSplitPosFromCell();this._map.fire("zoomchanged");
this.refreshViewData();this._replayPrintTwipsMsgs(false)},_restrictDocumentSize:function(){if(
!this.sheetGeometry||!this._lastColumn||!this._lastRow){return}
var maxDocSize=this.sheetGeometry.getSize("tiletwips");var newDocWidth=Math.min(maxDocSize.x,
app.activeDocument.fileSize.x);var newDocHeight=Math.min(maxDocSize.y,app.activeDocument.fileSize.y)
var lastCellPixel=this.sheetGeometry.getCellRect(this._lastColumn,this._lastRow);
var isCalcRTL=this._map._docLayer.isCalcRTL();lastCellPixel=isCalcRTL?lastCellPixel.getBottomRight(
):lastCellPixel.getBottomLeft();var lastCellTwips=this._corePixelsToTwips(lastCellPixel);
var mapSizeTwips=this._pixelsToTwips(this._map.getSize());var mapPosTwips=this._pixelsToTwips(
this._map._getTopLeftPoint());var limitMargin=mapSizeTwips;if(!window.mode.isDesktop()){
limitMargin.x*=8;limitMargin.y*=8}
var limitWidth=mapPosTwips.x+mapSizeTwips.x<lastCellTwips.x&&!this.widthShrinked;
var limitHeight=mapPosTwips.y+mapSizeTwips.y<lastCellTwips.y&&!this.heightShrinked;if(limitWidth
)newDocWidth=lastCellTwips.x+limitMargin.x;if(limitHeight)newDocHeight=lastCellTwips.y+limitMargin.y
var extendedLimit=false;if(!limitWidth&&maxDocSize.x>app.activeDocument.fileSize.x){
newDocWidth=Math.min(app.activeDocument.fileSize.x+mapSizeTwips.x,maxDocSize.x);extendedLimit=true}
if(!limitHeight&&maxDocSize.y>app.activeDocument.fileSize.y){newDocHeight=Math.min(
app.activeDocument.fileSize.y+mapSizeTwips.y,maxDocSize.y);extendedLimit=true}
var shouldRestrict=newDocWidth!==app.activeDocument.fileSize.x||newDocHeight!==app.activeDocument.fileSize.y
if(!shouldRestrict){return}var newSizePx=this._twipsToPixels(new cool.Point(newDocWidth,newDocHeight
));var topLeft=this._map.unproject(new cool.Point(0,0));var bottomRight=this._map.unproject(
newSizePx);this._docPixelSize=newSizePx.clone();app.activeDocument.fileSize=new cool.SimplePoint(
newDocWidth,newDocHeight);app.activeDocument.activeView.viewSize=app.activeDocument.fileSize.clone()
this._map.setMaxBounds(new window.L.LatLngBounds(topLeft,bottomRight));this._map.fire("scrolllimits"
,newSizePx.clone());if(!this._syncTileContainerSize()&&(limitWidth||limitHeight||extendedLimit)
)app.sectionContainer.requestReDraw()},_getCursorPosSize:function(){var x=-1,y=-1;
var size=new cool.Point(0,0);if(app.calc.cellCursorVisible){x=app.calc.cellAddress.x+1;
y=app.calc.cellAddress.y+1;size={x:app.calc.cellCursorRectangle.width,
y:app.calc.cellCursorRectangle.height}}return{curX:x,curY:y,width:size.x,height:size.y}},
_hasPartsCountOrNamesChanged(lastStatusJSON,statusJSON){if(!lastStatusJSON)return true;if(
lastStatusJSON.parts.length!==statusJSON.parts.length)return true;else{for(
let i=0;i<statusJSON.parts.length;i++){if(statusJSON.parts[i].name!==lastStatusJSON.parts[i].name
)return true}return false}},_refreshPartNames(statusJSON){this._partNames=[];for(
let i=0;i<statusJSON.parts.length;i++){this._partNames.push(statusJSON.parts[i].name)}},
_refreshPartHashes(statusJSON){app.calc.partHashes=[];for(let i=0;i<statusJSON.parts.length;i++){
app.calc.partHashes.push(statusJSON.parts[i].hash)}},_getMarginPropertiesForTheMap:function(){
const rowHeaderSection=app.sectionContainer.getSectionWithName(app.CSections.RowHeader.name);
const columnHeaderSection=app.sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name);
const rowGroupSection=app.sectionContainer.getSectionWithName(app.CSections.RowGroup.name);
const columnGroupSection=app.sectionContainer.getSectionWithName(app.CSections.ColumnGroup.name);
const scrollSection=app.sectionContainer.getSectionWithName(app.CSections.Scroll.name);
const scrollBarThickness=scrollSection?scrollSection.sectionProperties.scrollBarThickness:0;
const marginLeft=(rowHeaderSection?rowHeaderSection.size[0]:0)+(
rowGroupSection?rowGroupSection.size[0]:0);const marginTop=(
columnHeaderSection?columnHeaderSection.size[1]:0)+(columnGroupSection?columnGroupSection.size[1]:0)
return{marginLeft:marginLeft,marginTop:marginTop,scrollBarThickness:scrollBarThickness}},
_calculateNewCanvasAndMapSizes:function(documentContainerSize,availableSpace,marginLeft,marginTop,
scrollBarThickness){let newMapSize=availableSpace.slice();
let newCanvasSize=documentContainerSize.slice();
const fileSizePixels=app.activeDocument.fileSize.pToArray();if(fileSizePixels[0]<availableSpace[0]){
newMapSize[0]=fileSizePixels[0];newCanvasSize[0]=fileSizePixels[0]+marginLeft+scrollBarThickness;
this.widthShrinked=true}else this.widthShrinked=false;if(fileSizePixels[1]<availableSpace[1]){
newMapSize[1]=fileSizePixels[1];newCanvasSize[1]=fileSizePixels[1]+marginTop+scrollBarThickness;
this.heightShrinked=true}else this.heightShrinked=false;newMapSize=[Math.round(newMapSize[0
]/app.dpiScale),Math.round(newMapSize[1]/app.dpiScale)];newCanvasSize=[Math.round(newCanvasSize[0
]/app.dpiScale),Math.round(newCanvasSize[1]/app.dpiScale)];return{newMapSize:newMapSize,
newCanvasSize:newCanvasSize}},_resizeMapElementAndTilesLayer:function(mapElement,marginLeft,
marginTop,newMapSize){mapElement.style.left=Math.round(marginLeft/app.dpiScale)+"px";
mapElement.style.top=Math.round(marginTop/app.dpiScale)+"px";mapElement.style.width=newMapSize[0
]+"px";mapElement.style.height=newMapSize[1]+"px";this._container.style.width=newMapSize[0]+"px";
this._container.style.height=newMapSize[1]+"px"},_updateHeaderSections:function(){if(
app.sectionContainer.doesSectionExist(app.CSections.RowHeader.name)){
app.sectionContainer.getSectionWithName(app.CSections.RowHeader.name)._updateCanvas();
app.sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name)._updateCanvas()}},
_syncTileContainerSize:function(){if(!this._map)return false;if(!this._container)return false;
const documentContainerSize=this._getDocumentContainerSize();documentContainerSize[0]*=app.dpiScale;
documentContainerSize[1]*=app.dpiScale;const{marginLeft,marginTop,scrollBarThickness
}=this._getMarginPropertiesForTheMap();const availableSpace=[documentContainerSize[0
]-marginLeft-scrollBarThickness,documentContainerSize[1]-marginTop-scrollBarThickness];const{
newMapSize,newCanvasSize}=this._calculateNewCanvasAndMapSizes(documentContainerSize,availableSpace,
marginLeft,marginTop,scrollBarThickness);const mapElement=document.getElementById("map");
const oldMapSize=[mapElement.clientWidth,mapElement.clientHeight];const widthIncreased=oldMapSize[0
]<newMapSize[0];const heightIncreased=oldMapSize[1]<newMapSize[1];const sizeChanged=oldMapSize[0
]!==newMapSize[0]||oldMapSize[1]!==newMapSize[1];if(sizeChanged){
this._resizeMapElementAndTilesLayer(mapElement,marginLeft,marginTop,newMapSize);
this._map.invalidateSize(false,new cool.Point(oldMapSize[0],oldMapSize[1]));
app.sectionContainer.onResize(newCanvasSize[0],newCanvasSize[1]);this._updateHeaderSections();
this._mobileChecksAfterResizeEvent(heightIncreased)}this._map.setView(this._map.getCenter());if(
sizeChanged){this._nonDesktopChecksAfterResizeEvent(heightIncreased);if(
heightIncreased||widthIncreased){app.sectionContainer.requestReDraw();this._map.fire("sizeincreased"
);return true}}return false},_onStatusMsg:function(textMsg){console.log(
"DEBUG: onStatusMsg: "+textMsg);const statusJSON=JSON.parse(textMsg.replace("status:","").replace(
"statusupdate:",""));if(statusJSON.width&&statusJSON.height&&this._documentInfo!==textMsg){
const temp=this._lastStatusJSON?Object.assign({},this._lastStatusJSON):null;
this._lastStatusJSON=statusJSON;this._documentInfo=textMsg;
var firstSelectedPart=typeof this._selectedPart!=="number";if(statusJSON.readonly
)this._map.setPermission("readonly");app.activeDocument.fileSize=new cool.SimplePoint(
statusJSON.width,statusJSON.height);
app.activeDocument.activeView.viewSize=app.activeDocument.fileSize.clone();if(app.map._docLoaded
)this._syncTileContainerSize();this._docType=statusJSON.type;this._parts=statusJSON.partscount;if(
app.socket._reconnecting){app.socket.sendMessage("setclientpart part="+this._selectedPart);
this._resetInternalState();window.keyboard.hintOnscreenKeyboard(
window.keyboard.guessOnscreenKeyboard())}else{this._selectedPart=statusJSON.selectedpart}
this._lastColumn=statusJSON.lastcolumn;this._lastRow=statusJSON.lastrow;
this._selectedMode=statusJSON.mode!==undefined?statusJSON.mode:0;if(
this.sheetGeometry&&this._selectedPart!=this.sheetGeometry.getPart()){this.requestSheetGeometryData(
)}this._viewId=statusJSON.viewid;console.assert(this._viewId>=0,
"Incorrect viewId received: "+this._viewId);var mapSize=this._map.getSize();
var sizePx=this._twipsToPixels(new cool.Point(app.activeDocument.fileSize.x,
app.activeDocument.fileSize.y));var width=sizePx.x;var height=sizePx.y;if(
width<mapSize.x||height<mapSize.y){width=Math.max(width,mapSize.x);height=Math.max(height,mapSize.y)
var topLeft=this._map.unproject(new cool.Point(0,0));var bottomRight=this._map.unproject(
new cool.Point(width,height));this._map.setMaxBounds(new window.L.LatLngBounds(topLeft,bottomRight))
this._docPixelSize={x:width,y:height};this._map.fire("scrolllimits",{x:width,y:height})}else{
this._updateMaxBounds(true)}this._adjustCanvasSectionsForLayoutChange();this._refreshPartNames(
statusJSON);this._refreshPartHashes(statusJSON);if(this._hasPartsCountOrNamesChanged(temp,statusJSON
))app.socket.sendMessage("commandvalues command=.uno:ViewAnnotationsPosition");this._map.fire(
"updateparts",{selectedPart:this._selectedPart,parts:this._parts,docType:this._docType,
source:"status",partNames:this._partNames});TileManager.resetPreFetching(true);if(
statusJSON.printranges&&statusJSON.printranges.printranges){this._printRanges=[];
const info=statusJSON.printranges.printranges;for(let i=0;i<info.length;i++)this._printRanges[info[i
]["sheet"]]=info[i]["ranges"]}if(firstSelectedPart)this._switchSplitPanesContext()}else{
this._adjustCanvasSectionsForLayoutChange()}
var scrollSection=app.sectionContainer.getSectionWithName(app.CSections.Scroll.name);
scrollSection.stepByStepScrolling=true},refreshViewData:function(coordinatesData,compatDataSrcOnly,
sheetGeometryChanged){if(this.options.sheetGeometryDataEnabled&&compatDataSrcOnly){return}if(
typeof coordinatesData!="object"){coordinatesData={}}var offset=coordinatesData.offset||{};
var topLeftPoint=new cool.Point(coordinatesData.x,coordinatesData.y);var sizePx=this._map.getSize();
if(topLeftPoint.x===undefined){topLeftPoint.x=this._map._getTopLeftPoint().x}if(
topLeftPoint.y===undefined){topLeftPoint.y=this._map._getTopLeftPoint().y}var updateRows=true;
var updateCols=true;if(offset.x===0){updateCols=false;if(!this.options.sheetGeometryDataEnabled){
topLeftPoint.x=-1;sizePx.x=0}}if(offset.y===0){updateRows=false;if(
!this.options.sheetGeometryDataEnabled){topLeftPoint.y=-1;sizePx.y=0}}var pos=this._pixelsToTwips(
topLeftPoint);var size=this._pixelsToTwips(sizePx);if(!this.options.sheetGeometryDataEnabled){
this.requestViewRowColumnData(pos,size);return}if(sheetGeometryChanged||!this.sheetGeometry){
this.requestSheetGeometryData({columns:updateCols,rows:updateRows});return}if(this.sheetGeometry){
this.sheetGeometry.setViewArea(pos,size);this._updateHeadersGridLines(undefined,updateCols,
updateRows)}},requestViewRowColumnData:function(pos,size){
var payload="commandvalues command=.uno:ViewRowColumnHeaders?x="+Math.round(pos.x)+"&y="+Math.round(
pos.y)+"&width="+Math.round(size.x)+"&height="+Math.round(size.y);app.socket.sendMessage(payload)},
requestSheetGeometryData:function(flags){if(!this.sheetGeometry){if(this._sheetGeomFirstWait===true
){return}this._sheetGeomFirstWait=true}var unoCmd=".uno:SheetGeometryData";
var haveArgs=typeof flags=="object"&&(flags.columns===true||flags.rows===true||flags.all===true);
var payload="commandvalues command="+unoCmd;if(haveArgs){var argList=[];var both=flags.all===true;
if(both||flags.columns===true){argList.push("columns=1")}if(both||flags.rows===true){argList.push(
"rows=1")}var dataTypeFlagNames=["sizes","hidden","filtered","groups"];var dataTypesPresent=false;
dataTypeFlagNames.forEach(function(name){if(flags[name]===true){argList.push(name+"=1");
dataTypesPresent=true}});if(!dataTypesPresent){dataTypeFlagNames.forEach(function(name){
argList.push(name+"=1")})}payload+="?"+argList.join("&")}app.socket.sendMessage(payload)},
_updateHeadersGridLines:function(viewAreaData,updateCols,updateRows){this._map.fire(
"viewrowcolumnheaders",{data:viewAreaData,updaterows:updateRows,updatecolumns:updateCols,
cursor:this._getCursorPosSize(),context:this})},_addRemoveGroupSections:function(){if(
this.sheetGeometry._rows._outlines._outlines.length>0&&this.sheetGeometry._columns._outlines._outlines.length>0
){if(!app.sectionContainer.doesSectionExist(app.CSections.CornerGroup.name)
)app.sectionContainer.addSection(new cool.CornerGroup)}else{app.sectionContainer.removeSection(
app.CSections.CornerGroup.name)}if(this.sheetGeometry._rows._outlines._outlines.length>0){if(
!app.sectionContainer.doesSectionExist(app.CSections.RowGroup.name))app.sectionContainer.addSection(
new cool.RowGroup)}else{app.sectionContainer.removeSection(app.CSections.RowGroup.name)}if(
this.sheetGeometry._columns._outlines._outlines.length>0){if(!app.sectionContainer.doesSectionExist(
app.CSections.ColumnGroup.name)){app.sectionContainer.addSection(new cool.ColumnGroup);
app.sectionContainer.canvas.style.border="1px solid darkgrey"}}else{
app.sectionContainer.removeSection(app.CSections.ColumnGroup.name);
app.sectionContainer.canvas.style.border="0px solid darkgrey"}},_setAnchor:function(name,section,
value){if(!section){console.debug('_setAnchor: no section found: "'+name+'"');return}
section.anchor=value},_adjustCanvasSectionsForLayoutChange:function(){var sheetIsRTL=app.calc.isRTL(
);if(sheetIsRTL&&this._layoutIsRTL!==true){console.log(
"debug: in LTR -> RTL canvas section adjustments");var sectionContainer=app.sectionContainer;
var tilesSection=sectionContainer.getSectionWithName(app.CSections.Tiles.name);
var rowHeaderSection=sectionContainer.getSectionWithName(app.CSections.RowHeader.name);
var columnHeaderSection=sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name);
var cornerHeaderSection=sectionContainer.getSectionWithName(app.CSections.CornerHeader.name);
var columnGroupSection=sectionContainer.getSectionWithName(app.CSections.ColumnGroup.name);
var rowGroupSection=sectionContainer.getSectionWithName(app.CSections.RowGroup.name);
var cornerGroupSection=sectionContainer.getSectionWithName(app.CSections.CornerGroup.name);
this._setAnchor("cornerGroupSection",cornerGroupSection,["top","right"]);this._setAnchor(
"rowGroupSection",rowGroupSection,[[app.CSections.CornerGroup.name,"bottom","top"],"right"]);
this._setAnchor("columnGroupSection",columnGroupSection,["top",[app.CSections.CornerGroup.name,
"-left","right"]]);this._setAnchor("cornerHeaderSection",cornerHeaderSection,[[
app.CSections.ColumnGroup.name,"bottom","top"],[app.CSections.RowGroup.name,"-left","right"]]);
this._setAnchor("rowHeaderSection",rowHeaderSection,[[app.CSections.CornerHeader.name,"bottom","top"
],[app.CSections.RowGroup.name,"-left","right"]]);this._setAnchor("columnHeaderSection",
columnHeaderSection,[[app.CSections.ColumnGroup.name,"bottom","top"],[
app.CSections.CornerHeader.name,"-left","right"]]);if(columnHeaderSection
)columnHeaderSection.expand=["left"];this._setAnchor("tilesSection",tilesSection,[[
app.CSections.ColumnHeader.name,"bottom","top"],[app.CSections.RowHeader.name,"-left","right"]]);if(
rowHeaderSection)this._layoutIsRTL=true;sectionContainer.reNewAllSections(true);
this._syncTileContainerSize()}else if(!sheetIsRTL&&this._layoutIsRTL===true){console.log(
"debug: in RTL -> LTR canvas section adjustments");var sectionContainer=app.sectionContainer;
var tilesSection=sectionContainer.getSectionWithName(app.CSections.Tiles.name);
var rowHeaderSection=sectionContainer.getSectionWithName(app.CSections.RowHeader.name);
var columnHeaderSection=sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name);
var cornerHeaderSection=sectionContainer.getSectionWithName(app.CSections.CornerHeader.name);
var columnGroupSection=sectionContainer.getSectionWithName(app.CSections.ColumnGroup.name);
var rowGroupSection=sectionContainer.getSectionWithName(app.CSections.RowGroup.name);
var cornerGroupSection=sectionContainer.getSectionWithName(app.CSections.CornerGroup.name);if(
cornerGroupSection){cornerGroupSection.anchor=["top","left"]}if(rowGroupSection){
rowGroupSection.anchor=[[app.CSections.CornerGroup.name,"bottom","top"],"left"]}if(
columnGroupSection){columnGroupSection.anchor=["top",[app.CSections.CornerGroup.name,"right","left"]
]}cornerHeaderSection.anchor=[[app.CSections.ColumnGroup.name,"bottom","top"],[
app.CSections.RowGroup.name,"right","left"]];rowHeaderSection.anchor=[[
app.CSections.CornerHeader.name,"bottom","top"],[app.CSections.RowGroup.name,"right","left"]];
columnHeaderSection.anchor=[[app.CSections.ColumnGroup.name,"bottom","top"],[
app.CSections.CornerHeader.name,"right","left"]];columnHeaderSection.expand=["right"];if(
rowHeaderSection)this._layoutIsRTL=false;tilesSection.anchor=[[app.CSections.ColumnHeader.name,
"bottom","top"],[app.CSections.RowHeader.name,"right","left"]];sectionContainer.reNewAllSections(
true);this._syncTileContainerSize()}},_handleSheetGeometryDataMsg:function(jsonMsgObj,differentSheet
){if(!this.sheetGeometry){this._sheetGeomFirstWait=false;this.sheetGeometry=new cool.SheetGeometry(
jsonMsgObj,app.tile.size.x,app.tile.size.y,TileManager.tileSize,this._selectedPart);
app.sectionContainer.addSection(new cool.CornerHeader);app.sectionContainer.addSection(
new app.definitions.rowHeader);app.sectionContainer.addSection(new app.definitions.columnHeader)
}else{this.sheetGeometry.update(jsonMsgObj,false,this._selectedPart)}this._replayPrintTwipsMsgs(
differentSheet);this.sheetGeometry.setViewArea(this._pixelsToTwips(this._map._getTopLeftPoint()),
this._pixelsToTwips(this._map.getSize()));this._addRemoveGroupSections();console.log(
"debug: got sheetGeometry: this._rtlParts = "+this._rtlParts+" this._selectedPart = "+this._selectedPart
);this._adjustCanvasSectionsForLayoutChange();this._updateHeadersGridLines(undefined,true,true);
this.dontSendSplitPosToCore=true;this.setSplitPosFromCell();this.dontSendSplitPosToCore=false;
app.sectionContainer.reNewAllSections(true);this._syncTileContainerSize();this._map.fire(
"sheetgeometrychanged")},setSplitPosFromCell:function(forceSplittersUpdate){if(
!this.sheetGeometry||!this._splitPanesContext){return}this._splitPanesContext.setSplitPosFromCell(
forceSplittersUpdate)},setSplitCellFromPos:function(){if(
!this.sheetGeometry||!this._splitPanesContext){return}this._splitPanesContext.setSplitCellFromPos()
},_switchSplitPanesContext:function(){if(!this.hasSplitPanesSupport()){return}if(
!this._splitPaneCache){this._splitPaneCache={}}window.app.console.assert(
typeof this._selectedPart==="number","invalid selectedPart");var spContext=this._splitPaneCache[
this._selectedPart];if(!spContext){spContext=new cool.CalcSplitPanesContext(this);
this._splitPaneCache[this._selectedPart]=spContext}this._splitPanesContext=spContext;if(
this.sheetGeometry){this.setSplitPosFromCell(true)}},_onRowColSelCount:function(state){if(
state.trim()!==""){var rowCount=parseInt(state.split(", ")[0].trim().split(" ")[0].replace(",",""
).replace(",",""));var columnCount=parseInt(state.split(", ")[1].trim().split(" ")[0].replace(",",""
).replace(",",""));if(rowCount>1e6
)this._map.wholeColumnSelected=true;else this._map.wholeColumnSelected=false;if(columnCount===1024
)this._map.wholeRowSelected=true;else this._map.wholeRowSelected=false}else{
this._map.wholeColumnSelected=false;this._map.wholeRowSelected=false}},
_onCommandStateChanged:function(e){if(e.commandName===".uno:FreezePanesColumn"){
this._onSplitStateChanged(e,true)}else if(e.commandName===".uno:FreezePanesRow"){
this._onSplitStateChanged(e,false)}else if(e.commandName===".uno:RowColSelCount"){if(e.state.trim(
)===""||e.state.startsWith("Selected"))this._onRowColSelCount(e.state.replace("Selected:",""
).replace("row","").replace("column","").replace("s",""))}else if(e.commandName===".uno:InsertMode"
){this.insertMode=e.state.trim()===""?false:true;if(!this.insertMode){app.setCursorVisibility(false)
if(this._map._docLayer._cursorMarker)this._map._docLayer._cursorMarker.remove();
var grid=document.querySelector(".leaflet-map-pane");grid.classList.add("spreadsheet-cursor");
grid.style.cursor=""}}else if(e.commandName===".uno:ToggleSheetGrid"){let trimmedState=e.state.trim(
);if(trimmedState!="disabled"){let newState=trimmedState==="true";if(this._sheetGrid!=newState){
this._sheetGrid=newState;app.sectionContainer.requestReDraw()}}}else if(
e.commandName==="AutoFilterInfo"){app.calc.autoFilterCell={row:e.state.row,column:e.state.column}
}else if(e.commandName==="PivotTableFilterInfo"){app.calc.pivotTableFilterCell={row:e.state.row,
column:e.state.column}}},_onSplitStateChanged:function(e,isSplitCol){if(!this._splitPanesContext){
return}if(!this._splitCellState){this._splitCellState=new cool.Point(-1,-1)}if(
!e.state||e.state.length===0){window.app.console.warn("Empty argument for "+e.commandName);return}
var values=e.state.split("/");var newSplitIndex=Math.floor(parseInt(values[0]));
window.app.console.assert(!isNaN(newSplitIndex)&&newSplitIndex>=0,
"invalid argument for "+e.commandName);this._splitCellState[isSplitCol?"x":"y"]=newSplitIndex;if(
!this.options.syncSplits){return}var changed=isSplitCol?this._splitPanesContext.setSplitCol(
newSplitIndex):this._splitPanesContext.setSplitRow(newSplitIndex);if(changed){
this.setSplitPosFromCell()}},sendSplitIndex:function(newSplitIndex,isSplitCol){if(
!this._map.isEditMode()||!this._splitCellState||!this.options.syncSplits){return false}
var splitColState=this._splitCellState.x;var splitRowState=this._splitCellState.y;if(
splitColState===-1||splitRowState===-1){return false}
var currentState=isSplitCol?splitColState:splitRowState;if(currentState===newSplitIndex){
return false}var unoName=isSplitCol?"FreezePanesColumn":"FreezePanesRow";var command={};command[
"Index"]={type:"int32",value:newSplitIndex};this._map.sendUnoCommand(".uno:"+unoName,command);
return true},_onCommandValuesMsg:function(textMsg){var jsonIdx=textMsg.indexOf("{");if(jsonIdx===-1
)return;var values=JSON.parse(textMsg.substring(jsonIdx));if(!values){return}var comment;if(
values.commandName===".uno:ViewRowColumnHeaders"){this._updateHeadersGridLines(values)}else if(
values.commandName===".uno:SheetGeometryData"){
var differentSheet=this.sheetGeometry===undefined||this._selectedPart!==this.sheetGeometry.getPart()
if(this._oldSheetGeomMsg===textMsg&&!differentSheet)return;this._oldSheetGeomMsg=textMsg;
this._handleSheetGeometryDataMsg(values,differentSheet);this._syncTileContainerSize()}else if(
values.comments){app.sectionContainer.getSectionWithName(app.CSections.CommentList.name
).importComments(values.comments)}else if(values.commentsPos){
var section=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);
section.sectionProperties.commentList.forEach(function(comment){comment.valid=false});for(
var index in values.commentsPos){comment=values.commentsPos[index];
var commentObject=section.getComment(comment.id);if(commentObject){if(
commentObject.sectionProperties.data.tab!==comment.tab){
commentObject.sectionProperties.data.tab=comment.tab}commentObject.valid=true;
commentObject.sectionProperties.data.cellRange=this._parseCellRange(comment.cellRange)}}
section.onCommentsDataUpdate()}else{window.L.CanvasTileLayer.prototype._onCommandValuesMsg.call(this
,textMsg)}},_onTextSelectionMsg:function(textMsg){
window.L.CanvasTileLayer.prototype._onTextSelectionMsg.call(this,textMsg);if((
this.insertMode===false||app.file.textCursor.visible===false)&&app.calc.cellCursorVisible){
textMsg=textMsg.replace("textselection:","");if(textMsg.trim()!=="EMPTY"&&textMsg.trim()!==""){
this._cellSelections=textMsg.split(";");var that=this;this._cellSelections=this._cellSelections.map(
function(element){element=element.split(",");var topLeftTwips=new cool.Point(parseInt(element[0]),
parseInt(element[1]));var offset=new cool.Point(parseInt(element[2]),parseInt(element[3]));
var bottomRightTwips=topLeftTwips.add(offset);var boundsTwips=that._convertToTileTwipsSheetArea(
new cool.Bounds(topLeftTwips,bottomRightTwips));element=app.LOUtil.createRectangle(
boundsTwips.min.x*app.twipsToPixels,boundsTwips.min.y*app.twipsToPixels,boundsTwips.getSize(
).x*app.twipsToPixels,boundsTwips.getSize().y*app.twipsToPixels);return element})}else{
this._cellSelections=Array(0)}this._refreshRowColumnHeaders()}},allowDrawing:function(){
this._gotFirstCellCursor=true},_onCellCursorMsg:function(textMsg){
window.L.CanvasTileLayer.prototype._onCellCursorMsg.call(this,textMsg);
this._refreshRowColumnHeaders();if(!this._gotFirstCellCursor){this.allowDrawing();
TileManager.update();this.enableDrawing()}},_getEditCursorRectangle:function(msgObj){if(
!this.options.printTwipsMsgsEnabled||!this.sheetGeometry||!Object.prototype.hasOwnProperty.call(
msgObj,"relrect")||!Object.prototype.hasOwnProperty.call(msgObj,"refpoint")){
return window.L.CanvasTileLayer.prototype._getEditCursorRectangle.call(this,msgObj)}if(
typeof msgObj!=="object"){window.app.console.error("invalid edit cursor message");return undefined}
var relrect=cool.Bounds.parse(msgObj.relrect);var refpoint=cool.Point.parse(msgObj.refpoint);
refpoint=this.sheetGeometry.getTileTwipsPointFromPrint(refpoint);return relrect.add(refpoint)},
_getTextSelectionRectangles:function(textMsg){if(
!this.options.printTwipsMsgsEnabled||!this.sheetGeometry){
return window.L.CanvasTileLayer.prototype._getTextSelectionRectangles.call(this,textMsg)}if(
typeof textMsg!=="string"){window.app.console.error("invalid text selection message");return[]}
var refpointDelim="::";var delimIndex=textMsg.indexOf(refpointDelim);if(delimIndex===-1){
var rangeRectArray=cool.Bounds.parseArray(textMsg);rangeRectArray=rangeRectArray.map(function(rect){
return this._convertToTileTwipsSheetArea(rect)},this);return rangeRectArray}
var refpoint=cool.Point.parse(textMsg.substring(delimIndex+refpointDelim.length));
refpoint=this.sheetGeometry.getTileTwipsPointFromPrint(refpoint);
var rectArray=cool.Bounds.parseArray(textMsg.substring(0,delimIndex));rectArray.forEach(function(
rect){rect._add(refpoint)});return rectArray},getSnapDocPosX:function(docPosX,unit){if(
!this.options.sheetGeometryDataEnabled){return docPosX}unit=unit||"corepixels";
return this.sheetGeometry.getSnapDocPosX(docPosX,unit)},getSnapDocPosY:function(docPosY,unit){if(
!this.options.sheetGeometryDataEnabled){return docPosY}unit=unit||"corepixels";
return this.sheetGeometry.getSnapDocPosY(docPosY,unit)},getSplitPanesContext:function(){if(
!this.hasSplitPanesSupport()){return undefined}return this._splitPanesContext},
getMaxDocSize:function(){if(this.sheetGeometry){return this.sheetGeometry.getSize("corepixels")}
return this._twipsToPixels(new cool.Point(app.activeDocument.fileSize.x,
app.activeDocument.fileSize.y))},_calculateScrollForNewCellCursor:function(){
var scroll=new cool.SimplePoint(0,0);if(!app.calc.cellCursorVisible){return scroll}
let paneRectangles=app.getViewRectangles();let contained=false;for(
let i=0;i<paneRectangles.length;i++){if(paneRectangles[i].containsRectangle(
app.calc.cellCursorRectangle.toArray()))contained=true}if(contained)return scroll;
var noSplit=!this._splitPanesContext||this._splitPanesContext.getSplitPos().equals(new cool.Point(0,
0));if(noSplit&&app.calc.cellCursorRectangle.intersectsRectangle(paneRectangles[0].toArray())){if(
app.calc.cellCursorRectangle.width>paneRectangles[0
].width||app.calc.cellCursorRectangle.height>paneRectangles[0].height)return scroll}
let freePane=paneRectangles[paneRectangles.length-1];if(
app.calc.cellCursorRectangle.x2>app.calc.splitCoordinate.x){if(
app.calc.cellCursorRectangle.width>freePane.width)return scroll;if(
app.calc.cellCursorRectangle.x1<freePane.x1){scroll.x=app.calc.cellCursorRectangle.x1-freePane.x1
}else if(app.calc.cellCursorRectangle.x2>freePane.x2){
scroll.x=app.calc.cellCursorRectangle.x2-freePane.x2}}if(
app.calc.cellCursorRectangle.y2>app.calc.splitCoordinate.y){if(
app.calc.cellCursorRectangle.height>freePane.height)return scroll;if(
app.calc.cellCursorRectangle.y1<freePane.y1)scroll.y=app.calc.cellCursorRectangle.y1-freePane.y1;if(
app.calc.cellCursorRectangle.y2>freePane.y2+scroll.y)scroll.y=scroll.y+(
app.calc.cellCursorRectangle.y2-freePane.y2)}return scroll},getSelectedPart:function(){
return this._selectedPart}});var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var CursorHeaderSection=function(_super){__extends(CursorHeaderSection,_super);
function CursorHeaderSection(viewId,username,documentPosition,color){var _this=_super.call(this,
CursorHeaderSection.namePrefix+viewId,null,null,documentPosition)||this;
_this.sectionProperties.deletionTimeout=null;_this.sectionProperties.viewId=viewId;
_this.sectionProperties.color=color;_this.sectionProperties.username=username;
var div=_this.getHTMLObject();div.textContent=username;div.style.color="white";
div.style.backgroundColor=color;return _this}CursorHeaderSection.prototype.deleteThis=function(force
){var _this=this;if(force===void 0){force=false}if(this.sectionProperties.deletionTimeout
)clearTimeout(this.sectionProperties.deletionTimeout);
this.sectionProperties.deletionTimeout=setTimeout(function(){app.sectionContainer.removeSection(
_this.name)},force?10:CursorHeaderSection.duration)};CursorHeaderSection.deletePopUpNow=function(
viewId){var name=CursorHeaderSection.namePrefix+viewId;if(app.sectionContainer.doesSectionExist(name
)){var section=app.sectionContainer.getSectionWithName(name);section.deleteThis(true)}};
CursorHeaderSection.showCursorHeader=function(viewId,username,documentPosition,color){
var sectionName=CursorHeaderSection.namePrefix+viewId;var section;if(viewId&&!username){
section=app.sectionContainer.getSectionWithName(sectionName);if(section)section.deleteThis()}else{
section=app.sectionContainer.getSectionWithName(sectionName);if(!section){
section=new CursorHeaderSection(viewId,username,documentPosition,color);
app.sectionContainer.addSection(section)}section.setPosition(documentPosition.pX,documentPosition.pY
);section.deleteThis()}if(app.map._docLayer._docType==="spreadsheet"){
var cellCursorSection=OtherViewCellCursorSection.getViewCursorSection(viewId);if(cellCursorSection
)cellCursorSection.hideUsernamePopUp()}};CursorHeaderSection.namePrefix="CursorHeader ";
CursorHeaderSection.duration=3e3;return CursorHeaderSection}(HTMLObjectSection);
app.definitions.cursorHeaderSection=CursorHeaderSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var TableInsertMarkerSection=function(_super){__extends(
TableInsertMarkerSection,_super);function TableInsertMarkerSection(type,documentPosition){
var _this=_super.call(this,TableInsertMarkerSection.namePrefix+type,0,0,documentPosition,
"table-add-col-row-marker",true)||this;_this.sectionProperties.markerType=type;
_this.sectionProperties.mouseEntered=false;var div=_this.getHTMLObject();div.classList.add(
"table-add-col-row-marker");return _this}TableInsertMarkerSection.prototype.onMouseEnter=function(){
var _a;this.sectionProperties.mouseEntered=true;(_a=this.getHTMLObject()
)===null||_a===void 0?void 0:_a.classList.add("hovered")};
TableInsertMarkerSection.prototype.onMouseLeave=function(){var _a;
this.sectionProperties.mouseEntered=false;(_a=this.getHTMLObject()
)===null||_a===void 0?void 0:_a.classList.remove("hovered")};
TableInsertMarkerSection.prototype.onMouseDown=function(point,e){e.preventDefault();
this.stopPropagating();e.stopPropagation()};TableInsertMarkerSection.prototype.onClick=function(
point,e){e.preventDefault();this.stopPropagating();e.stopPropagation();this.handleClick()};
TableInsertMarkerSection.prototype.getMarkerType=function(){return this.sectionProperties.markerType
};TableInsertMarkerSection.prototype.setMarkerSize=function(width,height){this.size=[width,height];
var container=this.getHTMLObject();if(container){container.style.width=width+"px";
container.style.height=height+"px"}};TableInsertMarkerSection.prototype.handleClick=function(){if(
this.sectionProperties.markerType==="column"){app.socket.sendMessage("uno .uno:InsertColumnsAfter")
}else{app.socket.sendMessage("uno .uno:InsertRowsAfter")}};
TableInsertMarkerSection.namePrefix="TableInsertMarker_";return TableInsertMarkerSection}(
HTMLObjectSection);var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ContentControlDropdownSubSection=function(_super){
__extends(ContentControlDropdownSubSection,_super);function ContentControlDropdownSubSection(
sectionName,documentPosition,visible,dropdownMarkerWidth,dropdownMarkerHeight){if(visible===void 0){
visible=true}return _super.call(this,sectionName,dropdownMarkerWidth,dropdownMarkerHeight,
documentPosition,"writer-drop-down-marker",visible)||this}
ContentControlDropdownSubSection.prototype.callback=function(objectType,eventType,object,data,
builder){var fireEvent="jsdialog";if(window.mode.isMobile()){fireEvent="mobilewizard"}
var closeDropdownJson={jsontype:"dialog",type:"modalpopup",action:"close",id:builder.windowId};if(
eventType==="close"){app.map.fire(fireEvent,{data:closeDropdownJson,callback:undefined})}else if(
eventType==="select"){app.socket.sendMessage("contentcontrolevent type=drop-down selected="+data);
app.map.fire(fireEvent,{data:closeDropdownJson,callback:undefined})}};
ContentControlDropdownSubSection.prototype.showDatePicker=function(){if($("#datepicker").is(
":visible")){$("#datepicker").hide()}else{var datePicker=document.getElementById("datepicker");
datePicker.style.left=String(this.myTopLeft[0]/app.dpiScale)+"px";datePicker.style.top=String((
this.myTopLeft[1]+this.size[1])/app.dpiScale)+"px";$("#datepicker").show()}};
ContentControlDropdownSubSection.prototype.getDropdownJson=function(){if(
!this.sectionProperties.json.items)return;var json={children:[{id:"container-dropdown",
type:"container",text:"",enabled:true,children:[{id:"contentControlList",type:"treelistbox",text:"",
enabled:true,singleclickactivate:true}],vertical:true}],jsontype:"dialog",type:"modalpopup",
cancellable:true,popupParent:"_POPOVER_",clickToClose:"_POPOVER_",id:"contentControlModalpopup",
isPopupPartialScreen:true};var entries=[];var items=this.sectionProperties.json.items;for(
var i in items){var entry={text:items[i],columns:[{text:items[i]}],row:i.toString()};entries.push(
entry)}json.children[0].children[0].entries=entries;json.posx=(this.myTopLeft[0
]-this.sectionProperties.parent.size[0])/app.dpiScale;json.posy=(this.myTopLeft[1]+this.size[1]
)/app.dpiScale;return json};ContentControlDropdownSubSection.prototype.onMouseEnter=function(point,e
){app.map.dontHandleMouse=true};ContentControlDropdownSubSection.prototype.onMouseLeave=function(
point,e){app.map.dontHandleMouse=false};
ContentControlDropdownSubSection.prototype.containsPoint=function(point){if(this.position[0]<=point[
0]&&this.position[0]+this.size[0]>=point[0]){if(this.position[1]<=point[1]&&this.position[1
]+this.size[1]>=point[1])return true}return false};
ContentControlDropdownSubSection.prototype.onClick=function(point,e){if(e){e.preventDefault();
e.stopPropagation()}this.stopPropagating();if(this.sectionProperties.datePicker){
this.showDatePicker()}else if(this.sectionProperties.json.items){var fireEvent="jsdialog";if(
window.mode.isMobile()){fireEvent="mobilewizard"}app.map.fire(fireEvent,{data:this.getDropdownJson(
),callback:this.callback})}};return ContentControlDropdownSubSection}(HTMLObjectSection);
app.definitions.contentControlDropdownSubSection=ContentControlDropdownSubSection;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var ContentControlSection=function(
_super){__extends(ContentControlSection,_super);function ContentControlSection(){
var _this=_super.call(this,app.CSections.ContentControl.name)||this;
_this.processingOrder=app.CSections.ContentControl.processingOrder;
_this.drawingOrder=app.CSections.ContentControl.drawingOrder;
_this.zIndex=app.CSections.ContentControl.zIndex;_this.interactable=false;_this.documentObject=true;
_this.map=window.L.Map.THIS;_this.sectionProperties.json=null;
_this.sectionProperties.datePicker=false;_this.sectionProperties.picturePicker=null;
_this.sectionProperties.polygon=null;_this.sectionProperties.dropdownSection=null;
_this.sectionProperties.dropdownMarkerWidth=22;_this.sectionProperties.dropdownMarkerHeight=22;
return _this}ContentControlSection.prototype.onInitialize=function(){this.map.on("darkmodechanged",
this.changeBorderStyle,this);var container=window.L.DomUtil.createWithId("div","datepicker");
container.style.zIndex="12";container.style.position="absolute";document.getElementById(
"document-container").appendChild(container);this.sectionProperties.picturePicker=false};
ContentControlSection.prototype.setDatePickerVisibility=function(visible){
this.sectionProperties.datePicker=visible;if(this.sectionProperties.dropdownSection
)this.sectionProperties.dropdownSection.sectionProperties.datePicker=visible};
ContentControlSection.prototype.drawContentControl=function(json){this.removeDropdownSection();
this.sectionProperties.json=json;this.setDatePickerVisibility(false);
this.sectionProperties.picturePicker=false;if(json.date){$.datepicker.setDefaults(
$.datepicker.regional[window.langParamLocale.language]);$("#datepicker").datepicker({
onSelect:function(date,datepicker){if(date!=""){app.socket.sendMessage(
"contentcontrolevent type=date selected="+date)}}});$("#datepicker").hide()}else $("#datepicker"
).datepicker("destroy");if(json.action==="show")this.preparePolygon();else if(json.action==="hide"
)this.sectionProperties.polygon=null;else if(json.action==="change-picture"){
this.sectionProperties.picturePicker=true;if(!this.map.wopi.EnableInsertRemoteImage
)window.L.DomUtil.get("insertgraphic").click();else this.map.fire("postMessage",{
msgId:"UI_InsertGraphic"})}this.setPositionAndSize();if(this.sectionProperties.json.items||json.date
){this.addDropDownSection();if(json.date)this.setDatePickerVisibility(true)}
app.sectionContainer.requestReDraw()};ContentControlSection.prototype.setPositionAndSize=function(){
if(!this.sectionProperties.json||!this.sectionProperties.json.rectangles)return;
var rectangles=this.getRectangles(this.sectionProperties.json.rectangles);var xMin=Infinity,
yMin=Infinity,xMax=0,yMax=0;for(var i=0;i<rectangles.length;i++){if(rectangles[i][0]<xMin
)xMin=rectangles[i][0];if(rectangles[i][1]<yMin)yMin=rectangles[i][1];if(rectangles[i][0
]+rectangles[i][2]>xMax)xMax=rectangles[i][0]+rectangles[i][2];if(rectangles[i][1]+rectangles[i][3
]>yMax)yMax=rectangles[i][1]+rectangles[i][3]}xMin=Math.round(xMin*app.twipsToPixels);
yMin=Math.round(yMin*app.twipsToPixels);xMax=Math.round(xMax*app.twipsToPixels);yMax=Math.round(
yMax*app.twipsToPixels);this.setPosition(xMin,yMin);this.size=[xMax-xMin,yMax-yMin];if(this.size[0
]<5)this.size[0]=5};ContentControlSection.prototype.onResize=function(){this.setPositionAndSize()};
ContentControlSection.prototype.preparePolygon=function(){if(!this.sectionProperties.json.rectangles
)return;var rectangleArray=this.getRectangles(this.sectionProperties.json.rectangles);
this.sectionProperties.polygon=cool.rectanglesToPolygon(rectangleArray,app.twipsToPixels);
this.changeBorderStyle()};ContentControlSection.prototype.drawPolygon=function(){
this.context.strokeStyle=this.sectionProperties.polygonColor;this.context.beginPath();
this.context.moveTo(this.sectionProperties.polygon[0]-this.position[0],
this.sectionProperties.polygon[0+1]-this.position[1]);for(
var i=0;i<this.sectionProperties.polygon.length-1;i++){this.context.lineTo(
this.sectionProperties.polygon[i]-this.position[0],this.sectionProperties.polygon[i+1
]-this.position[1]);i+=1}this.context.closePath();this.context.stroke()};
ContentControlSection.prototype.onDraw=function(){if(!this.sectionProperties.json)return;if(
this.sectionProperties.polygon)this.drawPolygon();var text=this.sectionProperties.json.alias;if(text
){var rectangles=this.getRectangles(this.sectionProperties.json.rectangles);var x=rectangles[
rectangles.length-1][0]*app.twipsToPixels;var y=rectangles[rectangles.length-1][1]*app.twipsToPixels
var h=20;var startX=x-this.position[0]+5;var startY=y-this.position[1];var padding=10;
var fontStyle=getComputedStyle(document.body).getPropertyValue("--docs-font").split(",")[0].replace(
/'/g,"");var fontSize=getComputedStyle(document.body).getPropertyValue("--default-font-size");
var font=fontSize+" "+fontStyle;var textWidth=app.util.getTextWidth(text,font)+padding;
this.context.beginPath();this.context.fillStyle="#E6FFFF";this.context.font=font;
this.context.fillRect(startX,startY-h,textWidth,h);this.context.textAlign="center";
this.context.textBaseline="middle";this.context.fillStyle="#026296";this.context.fillText(text,
startX+textWidth/2,startY-h/2);this.context.strokeStyle="#026296";
this.context.lineWidth=app.dpiScale;this.context.strokeRect(startX-.5,startY-h-.5,textWidth,h)}};
ContentControlSection.prototype.onNewDocumentTopLeft=function(){this.setPositionAndSize()};
ContentControlSection.prototype.removeDropdownSection=function(){if(
this.sectionProperties.dropdownSection)app.sectionContainer.removeSection(
this.sectionProperties.dropdownSection.name)};
ContentControlSection.prototype.addDropDownSection=function(){
this.sectionProperties.dropdownSection=new ContentControlDropdownSubSection("dropdown"+String(
Math.random()),new cool.SimplePoint((this.position[0]+this.size[0])*app.pixelsToTwips,this.position[
1]*app.pixelsToTwips),true,this.sectionProperties.dropdownMarkerWidth,
this.sectionProperties.dropdownMarkerHeight);this.sectionProperties.dropdownSection.size[0
]=this.sectionProperties.dropdownMarkerWidth*app.dpiScale;
this.sectionProperties.dropdownSection.size[1]=this.size[1];
this.sectionProperties.dropdownSection.sectionProperties.json=this.sectionProperties.json;
this.sectionProperties.dropdownSection.sectionProperties.parent=this;
app.sectionContainer.addSection(this.sectionProperties.dropdownSection);
this.sectionProperties.dropdownSection.adjustHTMLObjectPosition();
this.sectionProperties.dropdownSection.setShowSection(true)};
ContentControlSection.prototype.getRectangles=function(rect){var rectangles=[];
var matches=rect.match(/\d+/g);if(matches!==null){for(var i=0;i<matches.length;i+=4){
rectangles.push([parseInt(matches[i]),parseInt(matches[i+1]),parseInt(matches[i+2]),parseInt(
matches[i+3])])}}return rectangles};ContentControlSection.prototype.changeBorderStyle=function(){
var polygonColor=window.prefs.getBoolean("darkTheme")?"white":"black";if(
this.sectionProperties.polygonColor!==polygonColor)this.sectionProperties.polygonColor=polygonColor}
return ContentControlSection}(CanvasSectionObject);cool.ContentControlSection=ContentControlSection}
)(cool||(cool={}));app.definitions.ContentControlSection=cool.ContentControlSection;
L.ProgressOverlay=window.L.Layer.extend({options:{spinnerSpeed:30},initialize:function(size){
window.L.Layer.prototype.initialize.call(this);this._size=size;this._percent=0;this._initLayout();
this.intervalTimer=undefined},_initLayout:function(){this._container=window.L.DomUtil.create("div",
"leaflet-progress-layer");this._spinner=window.L.DomUtil.create("div","leaflet-progress-spinner",
this._container);this._spinnerCanvas=window.L.DomUtil.create("canvas",
"leaflet-progress-spinner-canvas",this._spinner);var productName;if(window.ThisIsAMobileApp){
productName=window.MobileAppName}else{
productName=typeof brandProductName!=="undefined"?brandProductName:"F7 Office (unbranded)"
}this._brandLabel=window.L.DomUtil.create("div","leaflet-progress-label brand-label",this._container
);this._brandLabel.innerHTML=productName;this._label=window.L.DomUtil.create("div",
"leaflet-progress-label",this._container);this._progress=window.L.DomUtil.create("div",
"leaflet-progress",this._container);this._bar=window.L.DomUtil.create("span","",this._progress);
this._value=window.L.DomUtil.create("span","",this._bar);window.L.DomUtil.setStyle(this._value,
"line-height",this._size.y+"px");this._container.style.width=this._size.x+"px";
window.L.DomEvent.disableClickPropagation(this._progress).disableScrollPropagation(this._container)
},shutdownTimer:function(){if(this.intervalTimer)clearInterval(this.intervalTimer);
this.intervalTimer=undefined;if(this._spinnerInterval)clearInterval(this._spinnerInterval);
this._spinnerInterval=undefined},showSpinner:function(){window.L.DomUtil.get("document-container"
).appendChild(this._container);this._spinnerInterval=app.LOUtil.startSpinner(this._spinnerCanvas,
this.options.spinnerSpeed)},hideSpinner:function(){if(this._container)$(this._container).remove()},
delayedStart:function(map,label,bar){this.setLabel(label);this.setBar(false);this.setValue(0);
this.shutdownTimer();var self=this;self.state=0;this.intervalTimer=setInterval(function(){
self.state=self.state+1;switch(self.state){case 1:self.showSpinner();break;case 4:if(
self._percent<80)self.setBar(bar);break;case 6:self.setBar(bar);break}},500)},end:function(){
this.shutdownTimer();this.hideSpinner()},setLabel:function(label){if(
this._container&&this._label.innerHTML!==label){this._label.innerHTML=label}},setBar:function(bar){
if(this._container){if(bar){this._progress.style.visibility=""}else{
this._progress.style.visibility="hidden"}}},setValue:function(value){if(this._container){
this._percent=value;this._bar.style.width=value+"%";this._value.innerHTML=value+"%"}}});
window.L.progressOverlay=function(size){return new window.L.ProgressOverlay(size)};
window.L.TextInput=window.L.Layer.extend({initialize:function(){
window.L.Layer.prototype.initialize.call(this);this._className="TextInput";this._isComposing=false;
this._deleteHint="";this._newlineHint=false;this._linebreakHint=false;this._ignoreInputCount=0;
this._setAcceptInput(false);this._lastContent=[];this._hasWorkingSelectionStart=undefined;
this._ignoreNextBackspace=false;this._preSpaceChar='<img id="pre-space" alt=" " aria-hidden="true">'
this._postSpaceChar='<img id="post-space" alt=" " aria-hidden="true">';
this._initialContent=this._preSpaceChar+this._postSpaceChar;this._isDebugOn=false;this._initLayout()
this._cursorHandler=window.L.marker(new window.L.LatLng(0,0),{icon:window.L.divIcon({
className:"leaflet-cursor-handler",iconSize:null}),draggable:true}).on("dragend",
this._onCursorHandlerDragEnd,this);this._autoCorrectChars={" ":[32,0,0,1284],"!":[33,0,0,4353],'"':[
34,0,0,4353],"%":[37,0,0,4357],"'":[39,0,0,192],"*":[42,0,0,4360],",":[44,0,0,1291],"-":[45,0,0,1288
],".":[46,0,0,190],"/":[47,0,0,191],":":[58,0,0,5413],";":[59,0,0,1317],"?":[63,0,0,4287],_:[95,0,0,
5384]};this._unoKeyMap={48:96,49:97,50:98,51:99,52:100,53:101,54:102,55:103,56:104,57:105}},
hasAccessibilitySupport:function(){return false},onAdd:function(){if(this._container){this.getPane(
).appendChild(this._container);this.update()}if(!this.hasAccessibilitySupport()){this._emptyArea();
this._map.on("commandresult",this._onCommandResult,this)}app.events.on("updatepermission",
this._onPermission.bind(this));window.L.DomEvent.on(this._textArea,"focus blur",this._onFocusBlur,
this);if(document.activeElement===this._textArea){this._onFocusBlur({type:"focus"})}if(
window.ThisIsTheiOSApp){var that=this;window.MagicToGetHWKeyboardWorking=function(){var that2=that;
window.MagicKeyDownHandler=function(e){that2._onKeyDown(e)};window.MagicKeyUpHandler=function(e){
that2._onKeyUp(e)}};window.postMobileMessage("FOCUSIFHWKBD")}window.L.DomEvent.on(
this._map.getContainer(),"mousedown touchstart",this._abortComposition,this)},onRemove:function(){
window.MagicToGetHWKeyboardWorking=null;window.MagicKeyDownHandler=null;
window.MagicKeyUpHandler=null;if(this._container){this.getPane().removeChild(this._container)}if(
!this.hasAccessibilitySupport()){this._map.off("commandresult",this._onCommandResult,this)}
window.L.DomEvent.off(this._textArea,"focus blur",this._onFocusBlur,this);window.L.DomEvent.off(
this._map.getContainer(),"mousedown touchstart",this._abortComposition,this);this._map.removeLayer(
this._cursorHandler)},disable:function(){this._textArea.setAttribute("disabled",true)},
enable:function(){this._textArea.removeAttribute("disabled")},_onPermission:function(e){if(
e.detail.perm==="edit"){this._textArea.removeAttribute("disabled")}else{this._textArea.setAttribute(
"disabled",true)}},_onCommandResult:function(e){if(this.hasAccessibilitySupport())return;if(
e.commandName===".uno:Undo"||e.commandName===".uno:Redo"){this._emptyArea()}},hasFocus:function(){
return this._textArea&&this._textArea===document.activeElement},_onFocusBlur:function(ev){
this._fancyLog(ev.type,"");this._statusLog("_onFocusBlur");var onoff=(
ev.type==="focus"?window.L.DomEvent.on:window.L.DomEvent.off).bind(window.L.DomEvent);onoff(
this._textArea,
"copy cut compositionstart compositionupdate compositionend select keydown keypress keyup beforeinput textInput textinput input"
,this._onEvent,this);if(ev.type==="focus"){if(!this._isSelectionValid()||this._isCursorAtBeginning()
){if(this.hasAccessibilitySupport()){this._setSelectionRange(this._lastSelectionStart,
this._lastSelectionEnd)}else{this._emptyArea()}}else if(this.hasAccessibilitySupport()){
this._updateFocusedParagraph()}}onoff(this._textArea,"input",this._onInput,this);onoff(
this._textArea,"beforeinput",this._onBeforeInput,this);onoff(this._textArea,"compositionstart",
this._onCompositionStart,this);onoff(this._textArea,"compositionupdate",this._onCompositionUpdate,
this);onoff(this._textArea,"compositionend",this._onCompositionEnd,this);onoff(this._textArea,
"keydown",this._onKeyDown,this);onoff(this._textArea,"keyup",this._onKeyUp,this);onoff(
this._textArea,"copy cut paste",this._map._handleDOMEvent,this._map);app.idleHandler.notifyActive();
if(ev.type==="blur"&&this._isComposing){this._abortComposition(ev)}},focus:function(acceptInput){if(
!this._map.isEditMode()){this._setAcceptInput(false);this._map.getContainer().focus();return}if(
!window.ThisIsTheiOSApp&&navigator.platform!=="iPhone"&&!window.mode.isChromebook()){if(
window.keyboard.guessOnscreenKeyboard()&&acceptInput!==true)this._textArea.setAttribute("readonly",
true)}if(
!window.ThisIsTheiOSApp&&navigator.platform!=="iPhone"&&!window.keyboard.guessOnscreenKeyboard()){
this._textArea.focus()}else if(acceptInput===true){this._textArea.focus()}if(
!window.ThisIsTheiOSApp&&navigator.platform!=="iPhone"&&!window.mode.isChromebook()){if(
window.keyboard.guessOnscreenKeyboard()&&acceptInput!==true){this._setAcceptInput(false);
this._textArea.blur();this._textArea.removeAttribute("readonly")}else{this._setAcceptInput(true)}
}else if(acceptInput!==false){this._setAcceptInput(true)}else{this._setAcceptInput(false)}},
blur:function(){this._setAcceptInput(false);if(
!window.ThisIsTheiOSApp&&navigator.platform!=="iPhone"&&!window.mode.isChromebook()
)this._textArea.blur()},canAcceptKeyboardInput:function(){return this._acceptInput},select:function(
){this._setSelectionRange(0,this.getPlainTextContent().length)},getValue:function(){
return this.getPlainTextContent()},getPlainTextContent:function(){return this._textArea.textContent
},getHTML:function(){return this._textArea.innerHTML},_wrapContent:function(content){
var wrappedContent=this.hasAccessibilitySupport(
)?'<span id="readable-content" aria-hidden="false">'+content+"</span>":content;
return content.length===0?this._initialContent:this._preSpaceChar+wrappedContent+this._postSpaceChar
},resetContent:function(){this._textArea.innerHTML=this._initialContent},
codePointsToString:function(codePoints){var result="";for(var i=0;i<codePoints.length;++i){if(
codePoints[i]<=65535)result=result+String.fromCharCode(codePoints[i]
);else result=result+String.fromCharCode((codePoints[i]-65536>>10)+55296)+String.fromCharCode((
codePoints[i]-65536)%1024+56320)}return result},getValueAsCodePoints:function(value){var arr=[];
var code;for(var i=0;i<value.length;++i){code=value.charCodeAt(i);arr.push(code)}return arr},
update:function(){if(this._container&&this._map&&this._latlng){
var position=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(position)}},
_initLayout:function(){this._container=window.L.DomUtil.create("div","clipboard-container");
this._container.id="doc-clipboard-container";this._textArea=window.L.DomUtil.create("div",
"clipboard",this._container);this._textArea.id="clipboard-area";this._textArea.setAttribute(
"contenteditable","true");this._textArea.setAttribute("autocapitalize","off");
this._textArea.setAttribute("autofocus","true");this._textArea.setAttribute("autocorrect","off");
this._textArea.setAttribute("autocomplete","off");this._textArea.setAttribute("spellcheck","false");
this._textAreaLabel=window.L.DomUtil.create("label","visuallyhidden",this._container);
this._textAreaLabel.setAttribute("for","clipboard-area");
this._textAreaLabel.innerHTML="clipboard area";if(this.hasAccessibilitySupport()){
this._setSelectionFlag(false)}this._textArea.setAttribute("wrap","off");this._textArea.setAttribute(
"disabled",true);if(window.L.Browser.cypressTest){var that=this;
this._textArea._hasAccessibilitySupport=function(){return that.hasAccessibilitySupport()};
this._textArea._wrapContent=function(content){return that._wrapContent(content)};
this._textArea._getSelectionStart=function(){return that._getSelectionStart()};
this._textArea._getSelectionEnd=function(){return that._getSelectionEnd()}}this._setupStyles();
this._emptyArea();if(!this.hasAccessibilitySupport()){var warningMessage=_(
"Screen reader support for text content is disabled. ")+_(
"You need to enable it both at server level and in the UI. ")+_(
"Look for the accessibility section in coolwsd.xml for server setting. ")+_(
"Also check the voice over toggle under {parentControl}.").replace("{parentControl}",
window.userInterfaceMode==="notebookbar"?_("the Help tab"):_("the View menu"));
this._textArea.setAttribute("aria-description",warningMessage)}},_setupStyles:function(){if(
this._isDebugOn){this._container.style.opacity=.5;
this._textArea.style.cssText="border:1px solid red !important";
this._textArea.style.width=window.L.Browser.cypressTest?"1px":"120px";
this._textArea.style.height=window.L.Browser.cypressTest?"1px":"50px";
this._textArea.style.overflow="display";this._textArea.style.fontSize="20px";
this._textArea.style.position="relative";this._textArea.style.left="10px"}else{
this._container.style.opacity=0;this._textArea.style.width="1px";this._textArea.style.height="1px";
this._textArea.style.caretColor="transparent";this._textArea.style.resize="none"}
this._textArea.style["white-space"]="pre"},debug:function(debugOn){this._isDebugOn=!!debugOn;
this._setupStyles()},activeElement:function(){return this._textArea},showCursor:function(){if(
!this._map._docLayer._cursorMarker||app.tile.size.x===0||!this._map._docLayer._textCSelections){
return}var top=this._map._docLayer._twipsToLatLng({x:app.file.textCursor.rectangle.x1,
y:app.file.textCursor.rectangle.y1});var bottom=this._map._docLayer._twipsToLatLng({
x:app.file.textCursor.rectangle.x1,y:app.file.textCursor.rectangle.y2});if(
!this._map._docLayer._cursorMarker.isDomAttached()){this._map._docLayer._cursorMarker.add()}
this._map._docLayer._cursorMarker.setMouseCursorForTextBox();if(
window.touch.currentlyUsingTouchscreen()&&this._map._docLayer._textCSelections.empty()){
this._cursorHandler.setLatLng(bottom).addTo(this._map)}else{this._map.removeLayer(
this._cursorHandler)}this._latlng=window.L.latLng(top);this.update();this._map.fire("handlerstatus",
{hidden:true});if(this._map._docLoaded&&this._map.getDocType()==="spreadsheet"
)this._map.onFormulaBarFocus()},hideCursor:function(){if(!this._map._docLayer._cursorMarker){return}
if(this._map._docLayer._cursorMarker.isDomAttached())this._map._docLayer._cursorMarker.remove();
this._map.removeLayer(this._cursorHandler);this._map.fire("handlerstatus",{hidden:false})},
_setPos:function(pos){if(window.L.Browser.cypressTest){pos.x+=10;pos.y+=10}else{
pos.y+=this._isDebugOn?50:200}window.L.DomUtil.setPosition(this._container,pos)},_onEvent:function(
ev){if(this._map.uiManager.isUIBlocked())return;var msg={inputType:ev.inputType,data:ev.data,
key:ev.key,isComposing:ev.isComposing};if("key"in ev){msg.key=ev.key;msg.keyCode=ev.keyCode;
msg.code=ev.code;msg.which=ev.which}this._fancyLog(ev.type,msg)},_fancyLog:function(type,payload){
if(payload===undefined)payload="undefined";else if(payload===null)payload="null";if(this._isDebugOn
){var state=this._isComposing?"C":"N";state+=this._hasWorkingSelectionStart?"S":"-";
state+=this._ignoreNextBackspace?"I":"-";state+=" ";var textSel=this._getSelectionStart(
)+"!"+this._getSelectionEnd();state+=textSel+" ";var sel=window.getSelection();
var content=this.getValue();if(sel===null)state+="-1";else{state+=sel.rangeCount;state+=" ";
var cursorPos=-1;for(var i=0;i<sel.rangeCount;++i){var range=sel.getRangeAt(i);
state+=range.startOffset+"-"+range.endOffset+" ";if(cursorPos<0)cursorPos=range.startOffset}if(
sel.toString()!=="")state+=': "'+sel.toString()+'" ';if(cursorPos>=0)content=content.slice(0,
cursorPos)+"|"+content.slice(cursorPos)}state+="["+this._deleteHint+"] ";window.app.console.log(
+new Date+" %cINPUT%c: "+state+'"'+content+'" '+type+"%c ","background:#bfb;color:black",
"color:green","color:black",JSON.stringify(payload))}},_handleMisplacedCursorAtBeginning:function(ev
){window.app.console.log("Oh dear, gboard sabotaged our cursor position, fixing");if(
ev.inputType&&ev.inputType==="deleteContentBackward"){this._removeTextContent(1,0);
this._ignoreNextBackspace=true}else if(this.hasAccessibilitySupport()){this._setCursorPosition(
this._getLastCursorPosition())}if(!this.hasAccessibilitySupport()){this._emptyArea()}},
_onBeforeInput:function(ev){if(this._map.uiManager.isUIBlocked())return;this._statusLog(
"_onBeforeInput [");this._ignoreNextBackspace=false;if(!this._isSelectionValid()){this._emptyArea()
}else if(this._isInitialContent()&&this._isCursorAtBeginning()){
this._handleMisplacedCursorAtBeginning(ev)}if(window.L.Browser.gecko&&this._isCursorAtEnd(
)&&this._deleteHint==="delete"){if(this._map._debug.logKeyboardEvents){window.app.console.log(
"Sending delete")}this._removeTextContent(0,1);this._emptyArea()}this._statusLog("_onBeforeInput ]")
},_isDigit:function(asciiChar){return asciiChar>=48&&asciiChar<=57},_hasFormulaBarFocus:function(){
return this._map&&this._map.formulabar&&this._map.formulabar.hasFocus()},_onInput:function(ev){if(
this._map.uiManager.isUIBlocked())return;this._statusLog("_onInput [");app.idleHandler.notifyActive(
);if(this._ignoreInputCount>0){window.app.console.log(
"ignoring synthetic input "+this._ignoreInputCount);return}if(this._deleteHint===""&&ev.inputType){
if(ev.inputType==="deleteContentForward")this._deleteHint="delete";else if(
ev.inputType==="deleteContentBackward")this._deleteHint="backspace"}
var ignoreBackspace=this._ignoreNextBackspace;this._ignoreNextBackspace=false;if(this._newlineHint){
this._sendNewlineEvent();return}if(!this._hasPreSpace()){if(this._map._debug.logKeyboardEvents){
window.app.console.log("Sending backspace")}if(!ignoreBackspace)this._removeTextContent(1,0);
this._emptyArea();return}if(!this._hasPostSpace()){if(this._map._debug.logKeyboardEvents){
window.app.console.log("Sending delete")}this._removeTextContent(0,1);this._emptyArea();return}
var value=this.getValue();var content=this.getValueAsCodePoints(value);if(window.mode.isMobile(
)&&content.length===1&&this._lastContent.length===0)this._setCursorPosition(1);var matchTo=0;
var sharedLength=Math.min(content.length,this._lastContent.length);while(
matchTo<sharedLength&&content[matchTo]===this._lastContent[matchTo])matchTo++;if(
this._map._debug.logKeyboardEvents){window.app.console.log(
"Comparison matchAt "+matchTo+"\n"+'\tnew "'+this.codePointsToString(content
)+'" ('+content.length+")"+"\n"+'\told "'+this.codePointsToString(this._lastContent
)+'" ('+this._lastContent.length+")")}var removeBefore=this._lastContent.length-matchTo;
var removeAfter=0;if(this._lastContent.length>content.length){if(this._deleteHint==="delete"){
removeBefore--;removeAfter++}}if(removeBefore>0||removeAfter>0)this._removeTextContent(removeBefore,
removeAfter);var newText=content;if(matchTo>0)newText=newText.slice(matchTo);
this._lastContent=content;if(newText.length>0){this._sendNewText(ev,content,newText)}if(
removeAfter>0)this._emptyArea();this._finishFormulabarEditing(content,matchTo);if(
this._map.getDocType()==="text"){const contentStr=this.codePointsToString(content);
const newPara=contentStr.length===1;this._map.mention.handleMentionInput(ev,newPara)}
this._statusLog("_onInput ]")},_sendNewText:function(ev,content,newText){if(this._map.getDocType(
)==="spreadsheet"&&content.length===1&&ev.inputType==="insertText"&&this._isDigit(newText
)&&window.mode.isDesktop()){this._sendKeyEvent(newText,this._unoKeyMap[newText],"input")}else{
this._sendText(this.codePointsToString(newText))}},_finishFormulabarEditing:function(content,matchTo
){if(this._hasFormulaBarFocus()&&content.length){var contentString=this.codePointsToString(content);
if(contentString[matchTo]==="\n"||contentString.charCodeAt(matchTo)===13){app.dispatcher.dispatch(
"acceptformula")}}},_sendText:function(text){this._fancyLog("send-text-to-coolwsd",text);if(
text==="\n"||text.length===1&&text.charCodeAt(0)===13){this._sendNewlineEvent()}else{
var parts=text.split(/[\n\r]/);var l=parts.length;for(var i=0;i<l;i++){if(i!==0){this._sendKeyEvent(
13,1280);if(!this.hasAccessibilitySupport()){this._emptyArea()}}if(parts[i].length>0){
this._sendCompositionEvent(parts[i])}}}},_emptyArea:function(noSelect){this._statusLog(
"_emptyArea [");this._fancyLog("empty-area");this._ignoreInputCount++;this._lastContent=[];if(
this.hasAccessibilitySupport()){this._setLastCursorPosition(0)}this.resetContent();if(
!noSelect&&document.getElementById(this._textArea.id)){this._setCursorPosition(0);if(
this._hasWorkingSelectionStart===undefined)this._hasWorkingSelectionStart=this._getSelectionStart(
)===0}this._fancyLog("empty-area-end");this._statusLog("_emptyArea ]");this._ignoreInputCount--},
_onCompositionStart:function(){this._isComposing=true},_onCompositionUpdate:function(ev){
app.idleHandler.notifyActive();this._onInput(ev)},_onCompositionEnd:function(ev){
app.idleHandler.notifyActive();this._isComposing=false;if(ev.data&&ev.data.charCodeAt(
ev.data.length-1)===10)this._newlineHint=true;if(this.hasAccessibilitySupport()){if(
!this._isWrappedBySpan()){this._restoreSpanWrapper()}}this._onInput(ev);if(
this.hasAccessibilitySupport()){this._updateFocusedParagraph()}},_abortComposition:function(ev){
this._fancyLog("abort-composition",ev.type);if(this._isComposing)this._isComposing=false;if(
this.hasAccessibilitySupport()){this._isLeftRightArrow=0;this._updateFocusedParagraph();
this._requestFocusedParagraph()}else{this._emptyArea(document.activeElement!==this._textArea)}},
_handleKeyDownForPopup:function(ev,id){var popup=window.L.DomUtil.get(id);if(popup){
const entries=document.querySelectorAll("#"+id+" span.ui-treeview-cell");if(ev.key==="ArrowDown"){
const initialFocusElement=entries[0];if(initialFocusElement){initialFocusElement.tabIndex=0;
initialFocusElement.focus();ev.preventDefault();ev.stopPropagation()}}else if(
ev.key==="Enter"&&entries.length===1){const event=new KeyboardEvent("keydown",{key:"Enter",
bubbles:true,cancelable:true});entries[0].dispatchEvent(event);ev.preventDefault();
ev.stopPropagation()}else if(
ev.key==="ArrowLeft"||ev.key==="ArrowRight"||ev.key==="ArrowUp"||ev.key==="Home"||ev.key==="End"||ev.key==="PageUp"||ev.key==="PageDown"||ev.key==="Enter"||ev.key==="Escape"||ev.key==="Control"||ev.key==="Tab"
){if(id==="mentionPopup")this._map.mention.closeMentionPopup(false);else if(
id==="formulaautocompletePopup")this._map.fire("closepopup")}}return popup},_onKeyDown:function(ev){
if(this._map.uiManager.isUIBlocked())return;if(app.UI.notebookbarAccessibility
)app.UI.notebookbarAccessibility.onDocumentKeyDown(ev);if(ev.keyCode===8
)this._deleteHint="backspace";else if(ev.keyCode===46)this._deleteHint="delete";else{
this._deleteHint=""}this._newlineHint=ev.keyCode===13;
this._linebreakHint=this._newlineHint&&ev.shiftKey;if(!this.hasAccessibilitySupport(
)&&!window.L.Browser.win&&window.L.Browser.gecko&&window.L.Browser.geckoVersion>="117.0"&&window.L.Browser.geckoVersion<="120.0"&&ev.ctrlKey&&window.getSelection(
).isCollapsed){if(ev.key==="c"){document.execCommand("copy")}else if(ev.key==="x"){
document.execCommand("cut")}}if(this.hasAccessibilitySupport()){if(
this._hasAnySelection&&!this._isEditingInSelection&&this._map.getDocType(
)!=="spreadsheet"||!this._hasAnySelection&&this._map.getDocType()==="presentation"){if(
!window.L.Browser.cypressTest){var allowedKeyEvent=this._map.keyboard.allowedKeyCodeWhenNotEditing[
ev.keyCode]||ev.ctrlKey||ev.altKey||this._newlineHint&&ev.shiftKey;if(!allowedKeyEvent){
window.console.log(
"TextInput._onKeyDown: any input default prevented since no shape editing is active.");
ev.preventDefault()}}}else{this._isLeftRightArrow=0;if(ev.key==="ArrowLeft"){
this._isLeftRightArrow=-1}else if(ev.key==="ArrowRight"){this._isLeftRightArrow=1}if(
this._isLeftRightArrow){clearTimeout(this._onNavigationEndTimeout);if(!this._isSelectionValid(
)||this._isComposing||this._isLeftRightArrow>0&&this._isCursorAtEnd(
)||this._isLeftRightArrow<0&&this._isCursorAtStart()){this._log("_onKeyDown: preventDefault");
ev.preventDefault()}}if(this._isLeftRightArrow){if(this._listPrefixLength>0){
var cursorPosition=this._getSelectionEnd();if(
cursorPosition===this._listPrefixLength&&this._isLeftRightArrow<0){ev.preventDefault();if(
!ev.shiftKey){this._updateCursorPosition(0)}}if(cursorPosition===0&&this._isLeftRightArrow>0){
ev.preventDefault();this._updateCursorPosition(this._listPrefixLength)}}if(!ev.shiftKey){
var selection=window.getSelection();if(!selection.isCollapsed){if(!(
this._listPrefixLength>0&&this._lastCursorPosition===this._listPrefixLength&&this._isLeftRightArrow<0
)){this._log("_onKeyDown: pressed left/right arrows with selected text");ev.preventDefault();
var pos=this._lastCursorPosition+this._isLeftRightArrow;this._updateCursorPosition(pos)}}}}}}if(
ev.code==="Space"||ev.code==="Enter"){if(this._map["stateChangeHandler"].getItemValue(
".uno:ContentControlProperties")==="enabled"){if(app.sectionContainer.doesSectionExist(
app.CSections.ContentControl.name)){var section=app.sectionContainer.getSectionWithName(
app.CSections.ContentControl.name);if(section.sectionProperties.dropdownSection
)section.sectionProperties.dropdownSection.onClick(null,ev)}}}if(ev.altKey&&ev.code==="KeyC"){
section=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);if(section){if(
section.sectionProperties.selectedComment){
var id=section.sectionProperties.selectedComment.sectionProperties.menu.id;
var element=document.getElementById(id);if(element)element.focus()}else if(
this._map._docLayer._docType==="spreadsheet"){if(section.sectionProperties.calcCurrentComment!==null
)section.sectionProperties.calcCurrentComment.show()}}}this._handleKeyDownForPopup(ev,"mentionPopup"
);this._handleKeyDownForPopup(ev,"formulaautocompletePopup")},_onKeyUp:function(ev){if(
this._map.uiManager.isUIBlocked())return;app.idleHandler.notifyActive();if(
!this.hasAccessibilitySupport()&&!this._isComposing&&(
ev.key==="ArrowLeft"||ev.key==="ArrowRight"||ev.key==="ArrowUp"||ev.key==="ArrowDown"||ev.key==="Home"||ev.key==="End"||ev.key==="PageUp"||ev.key==="PageDown"||ev.key==="Escape"
)){this._emptyArea()}if(this.hasAccessibilitySupport()){if(
ev.key==="ArrowLeft"||ev.key==="ArrowRight"){clearTimeout(this._onNavigationEndTimeout);
this._onNavigationEndTimeout=setTimeout(function(){if(this._isLeftRightArrow){
this._isLeftRightArrow=0;this._updateFocusedParagraph()}}.bind(this),1e3)}else if(ev.key==="Shift"){
if(this._isLeftRightArrow){this._isLeftRightArrow=0;this._updateFocusedParagraph()}}}if(
app.UI.notebookbarAccessibility)app.UI.notebookbarAccessibility.onDocumentKeyUp(ev)},
_removeTextContent:function(before,after){if(this._map._debug.logKeyboardEvents){
window.app.console.log("Remove "+before+" before, and "+after+" after")}this._followMyCursor();
const windowId=app.map._docLayer._formID!==null?app.map._docLayer._formID:this._map.getWinId();
app.socket.sendMessage("removetextcontext id="+windowId+" before="+before+" after="+after)},
_followMyCursor:function(){if(this._map&&this._map.userList)this._map.userList.followUser(
this._map._docLayer._getViewId())},_sendCompositionEvent:function(text){if(!window.mode.isMobile(
)&&!window.mode.isTablet()&&this._autoCorrectChars[text]){let codes;if(
app.calc.decimalSeparator&&this._map.numPadDecimalPressed){this._map.numPadDecimalPressed=false;
codes=this._autoCorrectChars[app.calc.decimalSeparator]}else codes=this._autoCorrectChars[text];
this._sendKeyEvent(codes[0],codes[1],"input");this._sendKeyEvent(codes[2],codes[3],"up")}else{
var encodedText=encodeURIComponent(text);var winId=this._map.getWinId();this._followMyCursor();
app.socket.sendMessage("textinput id="+winId+" text="+encodedText)}},_sendKeyEvent:function(charCode
,unoKeyCode,type){this._followMyCursor();if(!type){type="input"}if(this._map.editorHasFocus(
)||this._hasFormulaBarFocus()){app.socket.sendMessage(
"key type="+type+" char="+charCode+" key="+unoKeyCode+"\n")}else{app.socket.sendMessage(
"windowkey id="+this._map.getWinId()+" type="+type+" char="+charCode+" key="+unoKeyCode+"\n")}},
_sendNewlineEvent:function(){var unoKeyCode=this._linebreakHint?5376:1280;this._sendKeyEvent(13,
unoKeyCode);this._newlineHint=false;if(this.hasAccessibilitySupport()){
var pos=this._getLastCursorPosition();var empty=this._lastContent.length===0}this._emptyArea();if(
this.hasAccessibilitySupport()){this._setSelectionFlag(false);if(pos===0&&!empty
)this._requestFocusedParagraph()}},_onCursorHandlerDragEnd:function(ev){
var cursorPos=this._map._docLayer._latLngToTwips(ev.target.getLatLng());
this._map._docLayer._postMouseEvent("buttondown",cursorPos.x,cursorPos.y,1,1,0);
this._map._docLayer._postMouseEvent("buttonup",cursorPos.x,cursorPos.y,1,1,0)},
_setCursorPosition:function(pos){try{this._setSelectionRange(pos,pos)}catch(err){}},
setSwitchedToEditMode:function(){if(this.hasAccessibilitySupport()){
this._justSwitchedToEditMode=true}},_setAcceptInput:function(accept){if(
window.L.Browser.cypressTest&&this._textArea){this._textArea.setAttribute("data-accept-input",accept
)}if(!this.hasAccessibilitySupport()){this._acceptInput=accept}else if(this._acceptInput!==accept){
this._acceptInput=accept;if(this._justSwitchedToEditMode&&accept&&this._isInitialContent()){
this._justSwitchedToEditMode=false;if(this._map._docLayer&&app.file.textCursor.visible){
window.app.console.log(
"A11yTextInput._setAcceptInput: going to emit a synthetic click after switching to edit mode.");
let center=app.file.textCursor.rectangle.center;center[0]=Math.round(center[0]);center[1
]=Math.round(center[1]);this._map._docLayer._postMouseEvent("buttondown",center[0],center[1],1,1,0);
this._map._docLayer._postMouseEvent("buttonup",center[0],center[1],1,1,0)}}}},_hasPreSpace:function(
){var child=this._textArea.firstChild;return child&&child.id==="pre-space"},_hasPostSpace:function(
){var child=this._textArea.lastChild;return child&&child.id==="post-space"},
_isInitialContent:function(){var children=this._textArea.childNodes;
return children.length===2&&this._hasPreSpace()&&this._hasPostSpace()},
_isCursorAtBeginning:function(){var selection=window.getSelection();
return selection.isCollapsed&&this._getSelectionStart()===-1},_isSelectionValid:function(){
return typeof this._getSelectionStart()==="number"&&typeof this._getSelectionEnd()==="number"},
_isCursorAtStart:function(){var selection=window.getSelection();
return selection.isCollapsed&&this._getSelectionStart()===0},_isCursorAtEnd:function(){
var selection=window.getSelection();return selection.isCollapsed&&this._getSelectionEnd(
)===this.getPlainTextContent().length},_getSelection:function(isStart){
var selection=window.getSelection();var node,offset;if(isStart){node=selection.anchorNode;
offset=selection.anchorOffset}else{node=selection.focusNode;offset=selection.focusOffset}if(!node
)return;if(node.id==="pre-space")return-1;if(node.id==="post-space")return-2;if(
node.id===this._textArea.id){if(this._hasPreSpace()){if(offset===0)return-1;else if(offset===1
)return 0}else if(this._hasPostSpace()){if(offset===node.childNodes.length)return-2}}if(
node.nodeType!==Node.TEXT_NODE)return;var walker=document.createTreeWalker(this._textArea,
NodeFilter.SHOW_TEXT);var currentNode=walker.nextNode();var pos=0;while(currentNode){if(
currentNode===node){return pos+offset}pos+=currentNode.textContent.length;
currentNode=walker.nextNode()}},_getSelectionStart:function(){return this._getSelection(true)},
_getSelectionEnd:function(){return this._getSelection(false)},_setSelectionRange:function(start,end
){this._statusLog("_setSelectionRange [");var selection=window.getSelection();
selection.removeAllRanges();var range=document.createRange();if(this._isInitialContent()){
range.setStart(this._textArea,1);range.setEnd(this._textArea,1);selection.addRange(range);
this._statusLog("_setSelectionRange ]");return}var l=this.getPlainTextContent().length;if(start<0
)start=0;if(end<0)end=0;if(start>l)start=l;if(end>l)end=l;if(start>end){var t=start;start=end;end=t}
var msg="_setSelectionRange:\n"+"    start: "+start+", end: "+end+"\n";var startContainer=null;
var walker=document.createTreeWalker(this._textArea,NodeFilter.SHOW_TEXT);
var currentNode=walker.nextNode();var pos=0;while(currentNode){
msg+="    current node: "+currentNode+', text content: "'+currentNode.textContent+'"\n';
var len=currentNode.textContent.length;msg+="    pos: "+pos+", len: "+len+"\n";if(
!startContainer&&start<=pos+len){startContainer=currentNode;range.setStart(currentNode,start-pos);
msg+="    current node set as start: offset: "+(start-pos)+"\n"}if(startContainer&&end<=pos+len){
range.setEnd(currentNode,end-pos);msg+="    current node set as end:   offset: "+(end-pos)+"\n";
break}pos+=len;currentNode=walker.nextNode()}selection.addRange(range);window.console.log(msg);
this._statusLog("_setSelectionRange ]")},_logCharCodeSequence:function(text){var s="[";for(
var ii=0;ii<text.length;++ii){if(ii>0)s=s+",";s=s+"0x"+text.charCodeAt(ii).toString(16)}s=s+"]";
window.app.console.log("L."+this._className+"._sendText: "+s)},_log:function(msg){if(
!this._isDebugOn)return;window.app.console.log(msg)},_statusLog:function(header){if(!this._isDebugOn
)return;var msg=this._className+" "+header+"\n";msg+="  _lastContent: "+this._lastContent+"\n";
msg+="  _lastContent: >"+this.codePointsToString(this._lastContent)+"<\n";if(
this.hasAccessibilitySupport()){msg+="  _remotePosition: "+this._remotePosition+"\n";
msg+="  _lastCursorPosition: "+this._getLastCursorPosition()+"\n";
msg+="  _lastSelectionStart: "+this._lastSelectionStart+"\n";
msg+="  _lastSelectionEnd: "+this._lastSelectionEnd+"\n";
msg+="  _hasSelection: "+this._hasSelection+"\n"}msg+="  SelectionStart: "+this._getSelectionStart(
)+"\n";msg+="  SelectionEnd: "+this._getSelectionEnd()+"\n";
msg+="  active element: "+document.activeElement+"\n";msg+="  _isComposing: "+this._isComposing+"\n"
var textArea=this._textArea;msg+="  editable element: "+"\n";
msg+="    innerHTML: >"+textArea.innerHTML+"<\n";msg+="    innerText: >"+textArea.innerText+"<\n";
msg+="    textContent: >"+textArea.textContent+"<\n";msg+="    has focus: "+(
textArea===document.activeElement)+"\n";msg+="    has pre space: "+this._hasPreSpace()+"\n";
msg+="    has post space: "+this._hasPostSpace()+"\n";var children=textArea.childNodes;for(
var i=0;i<children.length;++i){var child=children[i];msg+="    child: "+child+"\n";if(child){
msg+="      name: "+child.nodeName+"\n";msg+="      textContent: >"+child.textContent+"<\n"}}
var selection=window.getSelection();msg+="  selection: \n";msg+="    content: >"+selection.toString(
)+"<\n";msg+="    range count: "+selection.rangeCount+"\n";
msg+="    anchorNode: "+selection.anchorNode+"\n";if(selection.anchorNode){
msg+="      name: "+selection.anchorNode.nodeName+"\n";
msg+="      textContent: >"+selection.anchorNode.textContent+"<\n";for(i=0;i<children.length;++i){
if(children[i]===selection.anchorNode){msg+="      equal to child: "+i+"\n"}else if(children[i
].contains(selection.anchorNode)){msg+="      contained in child: "+i+"\n"}}}
msg+="    focusNode: "+selection.focusNode+"\n";if(selection.focusNode){
msg+="      name: "+selection.focusNode.nodeName+"\n";
msg+="      textContent: >"+selection.focusNode.textContent+"<\n";for(i=0;i<children.length;++i){if(
children[i]===selection.focusNode){msg+="      equal to child: "+i+"\n"}else if(children[i
].contains(selection.focusNode)){msg+="      contained in child: "+i+"\n"}}}
msg+="    editable element contains anchorNode: "+textArea.contains(selection.anchorNode)+"\n";
msg+="    anchorNode == focusNode ? "+(selection.anchorNode===selection.focusNode)+"\n";
msg+="    anchorOffset: "+selection.anchorOffset+"\n";
msg+="    focusOffset: "+selection.focusOffset+"\n";
msg+="    is collapsed: "+selection.isCollapsed+"\n";window.app.console.log(msg)}});
window.L.textInput=function(){return new window.L.TextInput};
window.L.A11yTextInput=window.L.TextInput.extend({initialize:function(){
window.L.TextInput.prototype.initialize.call(this);this._className="A11yTextInput";
this._justSwitchedToEditMode=false;this._isEditingInSelection=false;this._hasAnySelection=false;
this._hasSelection=false;this._lastCursorPosition=0;this._lastSelectionStart=0;
this._lastSelectionEnd=0;this._listPrefixLength=0;this._isLeftRightArrow=0},
hasAccessibilitySupport:function(){return true},setHTML:function(content){
this._textArea.innerHTML=this._wrapContent(content)},_prependSpace:function(){
this._textArea.innerHTML=this._preSpaceChar+this._textArea.innerHTML},_appendSpace:function(){
this._textArea.innerHTML=this._textArea.innerHTML+this._postSpaceChar},
_getLastCursorPosition:function(){return this._lastCursorPosition},_setLastCursorPosition:function(
nPos){this._lastCursorPosition=nPos;this._lastSelectionStart=this._lastSelectionEnd=nPos},
_setLastSelection:function(nStart,nEnd){this._lastSelectionStart=nStart;
this._lastSelectionEnd=this._lastCursorPosition=nEnd},_isLastSelectionEmpty:function(){
return this._lastSelectionStart===this._lastSelectionEnd},_isLastSelection:function(start,end){
return this._hasSelection&&this._lastSelectionStart===start&&this._lastSelectionEnd===end},
_updateCursorPosition:function(pos){if(typeof pos!=="number")return;var l=this.getPlainTextContent(
).length;if(pos<0)pos=0;if(pos>l)pos=l;this._setLastCursorPosition(pos);this._setCursorPosition(pos)
},_updateSelection:function(pos,start,end,forced){window.app.console.log(
"_updateSelection: pos: "+pos+", start: "+start+", end: "+end);if(
typeof pos!=="number"||typeof start!=="number"||typeof end!=="number")return;var hasSelection=!(
start===-1&&end===-1);if(!hasSelection){this._updateCursorPosition(pos)}else if(
forced||!this._isLastSelection(start,end)){if(
forced||start!==end||!this._hasSelection||!this._isLastSelectionEmpty()){this._setLastSelection(
start,end);this._setSelectionRange(start,end)}}this._setSelectionFlag(hasSelection)},
_setSelectionFlag:function(flag){this._hasSelection=flag;if(window.L.Browser.cypressTest
)this._textArea.isSelectionNull=!flag},_setFocusedParagraph:function(content,pos,start,end){
window.app.console.log(
"_setFocusedParagraph:"+'\n    content "'+content+'"'+"\n    pos: "+pos+"\n    start: "+start+", end: "+end
);this._isComposing=false;this._isLeftRightArrow=0;if(!this._hasFormulaBarFocus()){this.setHTML(
content);this.updateLastContent();this._updateSelection(pos,start,end,true)}},
_updateFocusedParagraph:function(){this._log("_updateFocusedParagraph");if(
this._remoteContent!==undefined){this._setFocusedParagraph(this._remoteContent,this._remotePosition,
this._remoteSelectionStart,this._remoteSelectionEnd)}else if(this._remoteSelectionEnd!==undefined){
this._updateSelection(this._remotePosition,this._remoteSelectionStart,this._remoteSelectionEnd)
}else if(this._remotePosition!==undefined){this._updateCursorPosition(this._remotePosition)}
this._remoteContent=undefined;this._remotePosition=undefined;this._remoteSelectionStart=undefined;
this._remoteSelectionEnd=undefined},onAccessibilityFocusChanged:function(content,pos,start,end,
listPrefixLength,force){this._listPrefixLength=listPrefixLength;if(!this.hasFocus(
)||this._isComposing&&!force){this._log(
"onAccessibilityFocusChanged: skipped updating: "+"\n  hasFocus: "+this.hasFocus(
)+"\n  _isComposing: "+this._isComposing+"\n  force: "+force);this._remoteContent=content;
this._remotePosition=pos;this._remoteSelectionStart=start;this._remoteSelectionEnd=end}else{
this._setFocusedParagraph(content,pos,start,end)}},setA11yFocusedParagraph:function(content,pos,
start,end){this._setFocusedParagraph(content,pos,start,end)},onAccessibilityCaretChanged:function(
nPos){this._log(
"onAccessibilityCaretChanged: \n"+"    position: "+nPos+"\n"+"    _isComposing: "+this._isComposing)
if(this._isLeftRightArrow||!this.hasFocus()||this._isComposing){this._log(
"onAccessibilityCaretChanged: skip updating");this._remotePosition=nPos}else if(
!this._hasFormulaBarFocus()){this._updateCursorPosition(nPos)}},setA11yCaretPosition:function(nPos){
if(this._isLastSelectionEmpty()){this.onAccessibilityCaretChanged(nPos)}},
onAccessibilityTextSelectionChanged:function(start,end){if(this._isLeftRightArrow||!this.hasFocus(
)||this._isComposing){this._remoteSelectionStart=start;this._remoteSelectionEnd=end;
var hasSelection=!(start===-1&&end===-1);this._setSelectionFlag(hasSelection);if(hasSelection){
this._remotePosition=end}this._statusLog("onAccessibilityTextSelectionChanged: skip updating")}else{
this._updateSelection(this._lastCursorPosition,start,end)}},_setDescription:function(text){
this._log("setDescription: "+text);this._textArea.setAttribute("aria-description",text)},
_updateTable:function(outCount,inList,row,col,rowSpan,colSpan){this._log(
"_updateTable: "+"\n outCount: "+outCount+"\n inList: "+inList.toString(
)+"\n row: "+row+", rowSpan: "+rowSpan+"\n col: "+col+", colSpan: "+colSpan);if(
this._timeoutForA11yDescription)clearTimeout(this._timeoutForA11yDescription);
var eventDescription="";if(outCount>0||inList.length>0){this._lastRowIndex=0;this._lastColIndex=0;
this._lastRowSpan=1;this._lastColSpan=1}for(var i=0;i<outCount;i++){eventDescription+=_(
"Out of table")+". "}for(i=0;i<inList.length;i++){eventDescription+=_(
"Table with {0} rows and {1} columns").replace("{0}",inList[i].rowCount).replace("{1}",inList[i
].colCount)+". "}if(this._lastRowIndex!==row||this._lastRowSpan!==rowSpan){this._lastRowIndex=row;
if(this._lastRowSpan!==rowSpan&&rowSpan>1){eventDescription+=_("Row {0} through {1}").replace("{0}",
row).replace("{1}",row+rowSpan-1)}else{eventDescription+=_("Row {0}").replace("{0}",row)}
eventDescription+=". ";this._lastRowSpan=rowSpan}if(
this._lastColIndex!==col||this._lastColSpan!==colSpan){this._lastColIndex=col;if(
this._lastColSpan!==colSpan&&colSpan>1){eventDescription+=_("Column {0} through {1}").replace("{0}",
col).replace("{1}",col+colSpan-1)}else{eventDescription+=_("Column {0}").replace("{0}",col)}
eventDescription+=". ";this._lastColSpan=colSpan}this._setDescription(eventDescription);
var that=this;this._timeoutForA11yDescription=setTimeout(function(){that._setDescription("")},1e3)},
onAccessibilityFocusedCellChanged:function(outCount,inList,row,col,rowSpan,colSpan,paragraph){
this._setFocusedParagraph(paragraph.content,parseInt(paragraph.position),parseInt(paragraph.start),
parseInt(paragraph.end));this._updateTable(outCount,inList,row+1,col+1,rowSpan,colSpan)},
onAccessibilityEditingInSelectionState:function(cell,enabled,selectionDescr,paragraph){this._log(
"onAccessibilityEditingInSelectionState: cell: "+cell+", enabled: "+enabled);if(!cell){
this._isEditingInSelection=enabled}if(enabled){clearTimeout(this._timeoutForA11yDescription);
var eventDescription="";if(typeof selectionDescr==="string"&&selectionDescr.length>0
)eventDescription+=selectionDescr+". ";eventDescription+=_("Editing activated. ");if(
typeof paragraph==="string"&&paragraph.length>0)eventDescription+=paragraph;this._setDescription(
eventDescription);this._timeoutForA11yDescription=setTimeout(function(){this._setDescription("")
}.bind(this),1e3)}},onAccessibilitySelectionChanged:function(cell,action,name,textContent){
this._log("onAccessibilitySelectionChanged: cell: "+cell+", action: "+action+", name: "+name);if(
this._timeoutForA11yDescription)clearTimeout(this._timeoutForA11yDescription);if(!this._isFormula()
)this._emptyArea();var eventDescription="";if(action==="create"||action==="add"){
this._hasAnySelection=true;eventDescription=_("{0} selected").replace("{0}",name)+". ";if(
typeof textContent==="string"&&textContent.length>0){eventDescription+=(cell?"":_("Has text: ")
)+textContent}}else if(action==="remove"){this._hasAnySelection=false;eventDescription=_(
"{0} unselected").replace("{0}",name)}else if(action==="delete"){this._hasAnySelection=false;
eventDescription=_("{0} deleted").replace("{0}",name)}this._setDescription(eventDescription);if(
action!=="create"&&action!=="add"){this._timeoutForA11yDescription=setTimeout(function(){
this._setDescription("")}.bind(this),1e3)}},_isSurrogatePair:function(hi,lo){
return hi>=55296&&hi<=56319&&lo>=56320&&lo<=57343},_onBeforeInput:function(ev){if(
this._map.uiManager.isUIBlocked())return;this._statusLog("_onBeforeInput [");
this._ignoreNextBackspace=false;if(!this._isSelectionValid()){this._setCursorPosition(
this._getLastCursorPosition())}else if(this._isCursorAtBeginning()){
this._handleMisplacedCursorAtBeginning(ev)}else if(!this._isLastSelectionEmpty(
)&&!this._hasFormulaBarFocus()&&this._isFormula()){this._updateCursorPosition(this._lastSelectionEnd
)}if(!this._isComposing&&!this._isLeftRightArrow&&this._remotePosition!==undefined){
this._updateFocusedParagraph()}if(window.L.Browser.gecko&&(
!this._hasSelection||this._isLastSelectionEmpty())&&this._getLastCursorPosition(
)===this.getPlainTextContent().length&&this._deleteHint==="delete"){if(
this._map._debug.logKeyboardEvents){window.app.console.log("Sending delete")}
this._removeEmptySelectionIfAny();this._removeTextContent(0,1)}this._statusLog("_onBeforeInput ]")},
updateLastContent:function(){var value=this.getValue();this._lastContent=this.getValueAsCodePoints(
value)},_isFormula:function(){var content=this.getValue();
return this._map._docLoaded&&this._map.getDocType()==="spreadsheet"&&content.length>0&&content[0
]==="="},_requestFocusedParagraph:function(){app.socket.sendMessage("geta11yfocusedparagraph")},
_restoreSpanWrapper:function(){var children=this._textArea.childNodes;if(
children.length>=3&&children[1].nodeName==="#text"){if(children.length===3){
var htmlContent=this.getHTML();htmlContent=htmlContent.slice(this._preSpaceChar.length,
-this._postSpaceChar.length);this.setHTML(htmlContent)}else if(children.length===4&&children[2
].id==="readable-content"){var newText=children[1].textContent;children[2
].innerHTML=newText+children[2].innerHTML;this._textArea.removeChild(children[1])}}},
_onInput:function(ev){if(this._map.uiManager.isUIBlocked())return;this._statusLog("_onInput [");
app.idleHandler.notifyActive();if(this._ignoreInputCount>0){window.app.console.log(
"ignoring synthetic input "+this._ignoreInputCount);return}if(this._deleteHint===""&&ev.inputType){
if(ev.inputType==="deleteContentForward")this._deleteHint="delete";else if(
ev.inputType==="deleteContentBackward")this._deleteHint="backspace"}
var ignoreBackspace=this._ignoreNextBackspace;this._ignoreNextBackspace=false;if(this._newlineHint){
this._sendNewlineEvent();return}if(!this._hasPreSpace()){if(this._map._debug.logKeyboardEvents){
window.app.console.log("Sending backspace")}if(!ignoreBackspace){this._removeEmptySelectionIfAny();
this._removeTextContent(1,0)}this._prependSpace();this._updateCursorPosition(0);return}if(
!this._hasPostSpace()){if(this._map._debug.logKeyboardEvents){window.app.console.log(
"Sending delete")}this._removeTextContent(0,this._hasSelection&&this._isLastSelectionEmpty()?2:1);
this._appendSpace();var pos=this._getLastCursorPosition();this._updateCursorPosition(pos);return}
var cursorPosition=this._getSelectionEnd();var lastCursorPosition=this._getLastCursorPosition();
var value=this.getValue();if(
lastCursorPosition===0&&cursorPosition<1&&value.length-this._lastContent.length===1){
cursorPosition=1;if(!this._isComposing)this._setCursorPosition(1)}
var contentTailLength=value.length-cursorPosition;
var lastContentTailLength=this._lastContent.length-lastCursorPosition;
var guessedBackMatchTo=Math.min(lastContentTailLength,contentTailLength);
var contentEnd=value.length-guessedBackMatchTo;var content=this.getValueAsCodePoints(value.slice(0,
contentEnd));var lastContentEnd=this._lastContent.length-guessedBackMatchTo;
var lastContent=this._lastContent.slice(0,lastContentEnd);window.app.console.log(
"_onInput: cursorPosition: "+cursorPosition+", lastContentEnd: "+lastContentEnd);var matchTo=0;
var compareUpTo=Math.min(content.length,lastContent.length);if(!this._isLastSelectionEmpty()){
compareUpTo=Math.min(compareUpTo,this._lastSelectionStart)}while(matchTo<compareUpTo&&content[
matchTo]===lastContent[matchTo])matchTo++;if(this._map._debug.logKeyboardEvents){
window.app.console.log("Comparison matchAt "+matchTo+"\n"+'\tnew "'+this.codePointsToString(content
)+'" ('+content.length+")"+"\n"+'\told "'+this.codePointsToString(lastContent
)+'" ('+lastContent.length+")")}if(matchTo===content.length&&matchTo===lastContent.length)return;
matchTo=Math.min(matchTo,lastCursorPosition);var removeAfter=0;var removeBefore=0;if(
!this._hasSelection){removeAfter=lastContent.length-lastCursorPosition;
removeBefore=lastContent.length-matchTo-removeAfter}else if(this._deleteHint==="backspace"){
this._removeEmptySelectionIfAny();this._setSelectionFlag(false);removeBefore=1}else if(
this._deleteHint==="delete"){this._setSelectionFlag(false);removeAfter=this._isLastSelectionEmpty(
)?2:1}if(removeBefore>1){var start=lastCursorPosition-removeBefore;for(
var i=start;i<lastCursorPosition;i++){if(this._isSurrogatePair(lastContent[i],lastContent[i+1])){
removeBefore--;i++}}}if(removeAfter>1){var end=lastCursorPosition+removeAfter;for(
var j=lastCursorPosition;j<end;j++){if(this._isSurrogatePair(lastContent[j],lastContent[j+1])){
removeAfter--;j++}}}if(removeBefore>0||removeAfter>0)this._removeTextContent(removeBefore,
removeAfter);var newText=content;if(matchTo>0)newText=newText.slice(matchTo);
var head=this._lastContent.slice(0,matchTo);var tail=this._lastContent.slice(lastContentEnd);
this._lastContent=head.concat(newText,tail);window.app.console.log(
"_onInput: \n"+'head: "'+this.codePointsToString(head)+'"\n'+'newText: "'+this.codePointsToString(
newText)+'"\n'+'tail: "'+this.codePointsToString(tail)+'"');this._setLastCursorPosition(
cursorPosition);if(newText.length>0){if(!this._isComposing&&!this._isWrappedBySpan()){
this._restoreSpanWrapper();this._setCursorPosition(cursorPosition)}this._sendNewText(ev,content,
newText)}this._finishFormulabarEditing(content,matchTo);if(this._map.getDocType()==="text"
)this._map.mention.handleMentionInput(ev);this._statusLog("_onInput ]")},
_removeEmptySelectionIfAny:function(){if(this._hasSelection&&this._isLastSelectionEmpty()){
this._sendDelete()}},_sendDelete:function(){this._sendKeyEvent(46,1286,"input")},
_hasPreSpace:function(){var child=this._textArea.firstChild;while(child&&child.tagName!=="img"){if(
child.id==="pre-space")return true;child=child.firstChild}return false},_hasPostSpace:function(){
var child=this._textArea.lastChild;while(child){if(child.id==="post-space")return true;
child=child.lastChild}return false},_isWrappedBySpan:function(){
var children=this._textArea.childNodes;return children.length===3&&children[1].nodeName==="SPAN"}});
L.a11yTextInput=function(){return new window.L.A11yTextInput};window.L.Icon=window.L.Class.extend({
initialize:function(options){window.L.setOptions(this,options)},createIcon:function(oldIcon){
return this._createIcon("icon",oldIcon)},createShadow:function(oldIcon){return this._createIcon(
"shadow",oldIcon)},_createIcon:function(name,oldIcon){var src=this._getIconUrl(name);if(!src){if(
name==="icon"){throw new Error("iconUrl not set in Icon options (see the docs).")}return null}
var img=this._createImg(src,oldIcon&&oldIcon.tagName==="IMG"?oldIcon:null);this._setIconStyles(img,
name);return img},_setIconStyles:function(img,name){var options=this.options;
var size=cool.Point.toPoint(options[name+"Size"]);var anchor=cool.Point.toPoint(
name==="shadow"&&options.shadowAnchor||options.iconAnchor||size&&size.x!==undefined&&size.y!==undefined&&size.divideBy(
2,true));img.className="leaflet-marker-"+name+" "+(options.className||"");if(anchor){
img.style.marginLeft=-anchor.x+"px";img.style.marginTop=-anchor.y+"px"}if(size){if(
size.x!==undefined)img.style.width=size.x+"px";if(size.y!==undefined)img.style.height=size.y+"px"}},
_createImg:function(src,el){el=el||document.createElement("img");el.src=src;return el},
_getIconUrl:function(name){return window.L.Browser.retina&&this.options[name+"RetinaUrl"
]||this.options[name+"Url"]}});window.L.icon=function(options){return new window.L.Icon(options)};
window.L.Icon.Default=window.L.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],
popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(name){var key=name+"Url";if(
this.options[key]){return this.options[key]}var path=window.L.Icon.Default.imagePath;if(!path){
throw new Error("Couldn't autodetect window.L.Icon.Default.imagePath, set it manually.")}
return path+"/marker-"+name+(window.L.Browser.retina&&name==="icon"?"-2x":"")+".png"}});
window.L.Icon.Default.imagePath=function(){var scripts=document.getElementsByTagName("script"),
leafletRe=/[\/^]cool/;var i,len,src,path;for(i=0,len=scripts.length;i<len;i++){src=scripts[i].src;
if(src.match(leafletRe)){path=src.substring(0,src.lastIndexOf("/"));return(path?path+"/":""
)+"images"}}}();window.L.Marker=window.L.Layer.extend({options:{pane:"markerPane",
icon:new window.L.Icon.Default,interactive:true,draggable:false,keyboard:true,zIndexOffset:0,
opacity:1,riseOffset:250},initialize:function(latlng,options){
window.L.Layer.prototype.initialize.call(this);window.L.setOptions(this,options);
this._latlng=window.L.latLng(latlng);this.on("down",this.onDown);this.on("up",this.onUp)},
onAdd:function(){this._initIcon();this.update()},onRemove:function(){if(
this.dragging&&this.dragging.enabled()){this.dragging.removeHooks()}this._removeIcon();
this._removeShadow()},onDown:function(){if(this._map&&this._map.touchGesture){
window.IgnorePanning=true}},onUp:function(){if(this._map&&this._map.touchGesture){
window.IgnorePanning=undefined}},getEvents:function(){var events={viewreset:this.update};
var splitPanesPossible=this._map._docLayer.hasSplitPanesSupport();if(splitPanesPossible){
events.moveend=this.update;events.drag=this.update;events.splitposchanged=this.update}return events
},getLatLng:function(){return this._latlng},setLatLng:function(latlng){var oldLatLng=this._latlng;
this._latlng=window.L.latLng(latlng);this.update();return this.fire("move",{oldLatLng:oldLatLng,
latlng:this._latlng})},setIcon:function(icon){this.options.icon=icon;if(this._map){this._initIcon();
this.update()}return this},_updateIconPosition:function(){if(!this._icon){return}
var posVis=window.L.Layer.getLayerPositionVisibility(this._latlng,this._icon.getBoundingClientRect()
,this._map);if(this._icon.style.visibility!=posVis.visibility){
this._icon.style.visibility=posVis.visibility}this._setPos(posVis.position)},update:function(){
this._updateIconPosition();return this},_initIcon:function(){var options=this.options,
classToAdd="leaflet-zoom-hide";var icon=options.icon.createIcon(this._icon),addIcon=false;if(
icon!==this._icon){if(this._icon){this._removeIcon()}addIcon=true;if(options.title){
icon.title=options.title}if(options.alt){icon.alt=options.alt}}window.L.DomUtil.addClass(icon,
classToAdd);if(options.keyboard){icon.tabIndex="0"}this._icon=icon;this._initInteraction();if(
options.riseOnHover){this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex})}
var newShadow=options.icon.createShadow(this._shadow),addShadow=false;if(newShadow!==this._shadow){
this._removeShadow();addShadow=true}if(newShadow){window.L.DomUtil.addClass(newShadow,classToAdd)}
this._shadow=newShadow;if(options.opacity<1){this._updateOpacity()}if(addIcon){this.getPane(
).appendChild(this._icon)}if(newShadow&&addShadow){this.getPane("shadowPane").appendChild(
this._shadow)}},_removeIcon:function(){if(this.options.riseOnHover){this.off({
mouseover:this._bringToFront,mouseout:this._resetZIndex})}window.L.DomUtil.remove(this._icon);
this.removeInteractiveTarget(this._icon);this._icon=null},_removeShadow:function(){if(this._shadow){
window.L.DomUtil.remove(this._shadow)}this._shadow=null},_setPos:function(pos){
window.L.DomUtil.setPosition(this._icon,pos);if(this._shadow){window.L.DomUtil.setPosition(
this._shadow,pos)}this._zIndex=pos.y+this.options.zIndexOffset;this._resetZIndex()},
_updateZIndex:function(offset){this._icon.style.zIndex=this._zIndex+offset},
_initInteraction:function(){if(!this.options.interactive){return}window.L.DomUtil.addClass(
this._icon,"leaflet-interactive");this.addInteractiveTarget(this._icon);if(
window.L.Handler.MarkerDrag){var draggable=this.options.draggable;if(this.dragging){
draggable=this.dragging.enabled();this.dragging.disable()}
this.dragging=new window.L.Handler.MarkerDrag(this);if(draggable){this.dragging.enable()}}},
setOpacity:function(opacity){this.options.opacity=opacity;if(this._map){this._updateOpacity()}
return this},_updateOpacity:function(){var opacity=this.options.opacity;window.L.DomUtil.setOpacity(
this._icon,opacity);if(this._shadow){window.L.DomUtil.setOpacity(this._shadow,opacity)}},
_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){
this._updateZIndex(0)}});window.L.marker=function(latlng,options){return new window.L.Marker(latlng,
options)};window.L.DivIcon=window.L.Icon.extend({options:{iconSize:[12,12],
className:"leaflet-div-icon",html:false},createIcon:function(oldIcon){
var div=oldIcon&&oldIcon.tagName==="DIV"?oldIcon:document.createElement("div"),options=this.options;
div.innerHTML=options.html!==false?options.html:"";if(options.bgPos){
div.style.backgroundPosition=-options.bgPos.x+"px "+-options.bgPos.y+"px"}this._setIconStyles(div,
"icon");return div},createShadow:function(){return null}});window.L.divIcon=function(options){
return new window.L.DivIcon(options)};window.L.LayerGroup=window.L.Layer.extend({
initialize:function(layers){window.L.Layer.prototype.initialize.call(this);this._layers={};var i,len
if(layers){for(i=0,len=layers.length;i<len;i++){this.addLayer(layers[i])}}},addLayer:function(layer
){var id=this.getLayerId(layer);this._layers[id]=layer;if(this._map){this._map.addLayer(layer)}
return this},removeLayer:function(layer){var id=layer in this._layers?layer:this.getLayerId(layer);
if(this._map&&this._layers[id]){this._map.removeLayer(this._layers[id])}delete this._layers[id];
return this},hasLayer:function(layer){return!!layer&&(layer in this._layers||this.getLayerId(layer
)in this._layers)},clearLayers:function(){for(var i in this._layers){this.removeLayer(this._layers[i
])}return this},invoke:function(methodName){var args=Array.prototype.slice.call(arguments,1),i,layer
for(i in this._layers){layer=this._layers[i];if(layer[methodName]){layer[methodName].apply(layer,
args)}}return this},onAdd:function(map){for(var i in this._layers){map.addLayer(this._layers[i])}},
onRemove:function(map){for(var i in this._layers){map.removeLayer(this._layers[i])}},
eachLayer:function(method,context){for(var i in this._layers){method.call(context,this._layers[i])}
return this},getLayers:function(){var layers=[];for(var i in this._layers){layers.push(this._layers[
i])}return layers},setZIndex:function(zIndex){return this.invoke("setZIndex",zIndex)},
getLayerId:function(layer){return app.util.stamp(layer)}});window.L.layerGroup=function(layers){
return new window.L.LayerGroup(layers)};window.L.Renderer=window.L.Layer.extend({options:{padding:0
},initialize:function(options){window.L.Layer.prototype.initialize.call(this);window.L.setOptions(
this,options);app.util.stamp(this)},setParentRenderer:function(parent){window.app.console.assert(
parent!==this,"self reference");this._parentRenderer=parent},onAdd:function(){if(!this._container){
this._initContainer()}if(this._parentRenderer){this._parentRenderer.getContainer().appendChild(
this._container)}else{this.getPane().appendChild(this._container)}if(this.rendererId
)window.L.DomUtil.addClass(this._container,this.rendererId+"-svg-pane");this._update()},
onRemove:function(){window.L.DomUtil.remove(this._container)},getEvents:function(){var events={
moveend:this._update};return events},_update:function(){if(this._parentRenderer){
var posBounds=this._parentRenderer.getChildPosBounds(this);this._position=posBounds.position;
this._bounds=posBounds.bounds;return}var p=this.options.padding,size=this._map.getSize(),
min=this._map.containerPointToLayerPointIgnoreSplits(size.multiplyBy(-p)).round();
this._bounds=new cool.Bounds(min,min.add(size.multiplyBy(1+p*2)).round());
this._position=this._bounds.min},getContainer:function(){return this._container},getBounds:function(
){return this._bounds},intersectsBounds:function(pxBounds){return this._bounds.intersects(pxBounds)
},addContainerClass:function(className){window.L.DomUtil.addClass(this._container,className)},
removeContainerClass:function(className){window.L.DomUtil.removeClass(this._container,className)}});
window.L.Map.include({getRenderer:function(layer){
var renderer=layer.options.renderer||this._getPaneRenderer(layer.options.pane
)||this.options.renderer||this._renderer;if(!renderer){if(this.getSplitPanesContext()){
renderer=this._renderer=L.SVG&&window.L.SplitPanesSVG&&window.L.splitPanesSVG(
)||window.L.Canvas&&window.L.SplitPanesCanvas&&window.L.splitPanesCanvas()}else{
renderer=this._renderer=L.SVG&&window.L.svg()||window.L.Canvas&&window.L.canvas()}}
window.app.console.assert(renderer,"Could create a renderer!");if(!this.hasLayer(renderer)){
this.addLayer(renderer)}return renderer},_getPaneRenderer:function(name){if(
name==="overlayPane"||name===undefined){return false}var renderer=this._paneRenderers[name];if(
renderer===undefined){if(this.getSplitPanesContext()){
renderer=L.SVG&&window.L.SplitPanesSVG&&window.L.splitPanesSVG({pane:name}
)||window.L.Canvas&&window.L.SplitPanesCanvas&&window.L.splitPanesCanvas({pane:name})}else{
renderer=L.SVG&&window.L.svg({pane:name})||window.L.Canvas&&window.L.canvas({pane:name})}
window.app.console.assert(renderer,"Could create a renderer!");this._paneRenderers[name]=renderer}
return renderer}});window.L.Path=window.L.Layer.extend({options:{stroke:true,color:"#3388ff",
weight:3,opacity:1,lineCap:"round",lineJoin:"round",fillOpacity:.2,fillRule:"evenodd",
interactive:true,fixed:false},initialize:function(){window.L.Layer.prototype.initialize.call(this)},
onAdd:function(){this._pathNodeCollection=new window.L.Path.PathNodeCollection;
this._renderer=this._map.getRenderer(this);this._renderer._initPath(this);this._reset();
this._renderer._addPath(this)},onRemove:function(){if(this._renderer)this._renderer._removePath(this
);else console.debug("Path.onRemove: this._renderer missing")},getEvents:function(){return{
viewreset:this._project,moveend:this._update}},redraw:function(){if(this._map){
this._renderer._updatePath(this)}return this},setStyle:function(style){window.L.setOptions(this,
style);if(this._renderer){this._renderer._updateStyle(this)}return this},bringToFront:function(){if(
this._renderer){this._renderer._bringToFront(this)}return this},bringToBack:function(){if(
this._renderer){this._renderer._bringToBack(this)}return this},_reset:function(){this._project();
this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(
window.touch.currentlyUsingTouchscreen()?10:0)},addPathNode:function(pathNode,actualRenderer){
this._path=undefined;if(!this._pathNodeCollection){
this._pathNodeCollection=new window.L.Path.PathNodeCollection}this._pathNodeCollection.add(
new window.L.Path.PathNodeData(pathNode,actualRenderer))},getPathNode:function(actualRenderer){
return this._pathNodeCollection.getPathNode(actualRenderer)},addClass:function(className){
this._pathNodeCollection.addOrRemoveClass(className,true)},removeClass:function(className){
this._pathNodeCollection.addOrRemoveClass(className,false)},setCursorType:function(cursorType){
this._pathNodeCollection.setCursorType(cursorType)}});
window.L.Path.PathNodeData=window.L.Class.extend({initialize:function(pathNode,actualRenderer){
window.app.console.assert(pathNode,"invalid pathNode argument!");window.app.console.assert(
actualRenderer,"invalid actualRenderer argument!");if(!(pathNode instanceof Node)){
window.app.console.error("Not a node instance!")}this._pathNode=pathNode;
this._actualRenderer=actualRenderer;this._data={}},key:function(){
return window.L.Path.PathNodeData.key(this._actualRenderer)},getNode:function(){if(!(
this._pathNode instanceof Node)){window.app.console.error("Not a node instance!")}
return this._pathNode},getActualRenderer:function(){return this._actualRenderer},
setCustomField:function(fieldName,value){window.app.console.assert(
typeof fieldName==="string"&&fieldName,"invalid fieldName");this._data[fieldName]=value},
getCustomField:function(fieldName){window.app.console.assert(typeof fieldName==="string"&&fieldName,
"invalid fieldName");return this._data[fieldName]},clearCustomField:function(fieldName){
window.app.console.assert(typeof fieldName==="string"&&fieldName,"invalid fieldName");
delete this._data[fieldName]},addOrRemoveClass:function(className,add){if(add){
window.L.DomUtil.addClass(this._pathNode,className)}else{window.L.DomUtil.removeClass(this._pathNode
,className)}},setCursorType:function(cursorType){this._pathNode.style.cursor=cursorType}});
window.L.Path.PathNodeData.key=function(layer){return app.util.stamp(layer)};
window.L.Path.PathNodeCollection=window.L.Class.extend({initialize:function(){this.clear()},
add:function(pathNodeData){window.app.console.assert(
pathNodeData instanceof window.L.Path.PathNodeData,"invalid pathNodeData argument!");
this._collection[pathNodeData.key()]=pathNodeData},clear:function(){this._collection={}},
getPathNode:function(actualRenderer){window.app.console.assert(actualRenderer,
"invalid actualRenderer argument!");var key=window.L.Path.PathNodeData.key(actualRenderer);
var nodeData=this._collection[key];window.app.console.assert(nodeData,"cannot find path node!");
return nodeData.getNode()},forEachNode:function(callback){var that=this;Object.keys(this._collection
).forEach(function(key){callback(that._collection[key])})},addOrRemoveClass:function(className,add){
window.app.console.assert(className,"className not provided!");this.forEachNode(function(nodeData){
nodeData.addOrRemoveClass(className,add)})},setCursorType:function(cursorType){this.forEachNode(
function(nodeData){nodeData.setCursorType(cursorType)})}});window.L.LineUtil={simplify:function(
points,tolerance){if(!tolerance||!points.length){return points.slice()}
var sqTolerance=tolerance*tolerance;points=this._reducePoints(points,sqTolerance);
points=this._simplifyDP(points,sqTolerance);return points},pointToSegmentDistance:function(p,p1,p2){
return Math.sqrt(this._sqClosestPointOnSegment(p,p1,p2,true))},_simplifyDP:function(points,
sqTolerance){var len=points.length,
ArrayConstructor=typeof Uint8Array!==undefined+""?Uint8Array:Array,markers=new ArrayConstructor(len)
markers[0]=markers[len-1]=1;this._simplifyDPStep(points,markers,sqTolerance,0,len-1);var i,
newPoints=[];for(i=0;i<len;i++){if(markers[i]){newPoints.push(points[i])}}return newPoints},
_simplifyDPStep:function(points,markers,sqTolerance,first,last){var maxSqDist=0,index,i,sqDist;for(
i=first+1;i<=last-1;i++){sqDist=this._sqClosestPointOnSegment(points[i],points[first],points[last],
true);if(sqDist>maxSqDist){index=i;maxSqDist=sqDist}}if(maxSqDist>sqTolerance){markers[index]=1;
this._simplifyDPStep(points,markers,sqTolerance,first,index);this._simplifyDPStep(points,markers,
sqTolerance,index,last)}},_reducePoints:function(points,sqTolerance){var reducedPoints=[points[0]];
for(var i=1,prev=0,len=points.length;i<len;i++){if(this._sqDist(points[i],points[prev])>sqTolerance
){reducedPoints.push(points[i]);prev=i}}if(prev<len-1){reducedPoints.push(points[len-1])}
return reducedPoints},clipSegment:function(a,b,bounds,useLastCode,round){
var codeA=useLastCode?this._lastCode:this._getBitCode(a,bounds),codeB=this._getBitCode(b,bounds),
codeOut,p,newCode;this._lastCode=codeB;while(true){if(!(codeA|codeB)){return[a,b]}else if(
codeA&codeB){return false}else{codeOut=codeA||codeB;p=this._getEdgeIntersection(a,b,codeOut,bounds,
round);newCode=this._getBitCode(p,bounds);if(codeOut===codeA){a=p;codeA=newCode}else{b=p;
codeB=newCode}}}},_getEdgeIntersection:function(a,b,code,bounds,round){var dx=b.x-a.x,dy=b.y-a.y,
min=bounds.min,max=bounds.max,x,y;if(code&8){x=a.x+dx*(max.y-a.y)/dy;y=max.y}else if(code&4){
x=a.x+dx*(min.y-a.y)/dy;y=min.y}else if(code&2){x=max.x;y=a.y+dy*(max.x-a.x)/dx}else if(code&1){
x=min.x;y=a.y+dy*(min.x-a.x)/dx}return new cool.Point(x,y,round)},_getBitCode:function(p,bounds){
var code=0;if(p.x<bounds.min.x){code|=1}else if(p.x>bounds.max.x){code|=2}if(p.y<bounds.min.y){
code|=4}else if(p.y>bounds.max.y){code|=8}return code},_sqDist:function(p1,p2){var dx=p2.x-p1.x,
dy=p2.y-p1.y;return dx*dx+dy*dy},_sqClosestPointOnSegment:function(p,p1,p2,sqDist){var x=p1.x,y=p1.y
,dx=p2.x-x,dy=p2.y-y,dot=dx*dx+dy*dy,t;if(dot>0){t=((p.x-x)*dx+(p.y-y)*dy)/dot;if(t>1){x=p2.x;y=p2.y
}else if(t>0){x+=dx*t;y+=dy*t}}dx=p.x-x;dy=p.y-y;return sqDist?dx*dx+dy*dy:new cool.Point(x,y)}};
window.L.Polyline=window.L.Path.extend({options:{smoothFactor:1},initialize:function(latlngs,options
){window.L.Path.prototype.initialize.call(this);window.L.setOptions(this,options);this._setLatLngs(
latlngs)},getLatLngs:function(){return this._latlngs},setLatLngs:function(latlngs){this._setLatLngs(
latlngs);return this.redraw()},getCenter:function(){var i,halfDist,segDist,dist,p1,p2,ratio,
points=this._rings[0],len=points.length;for(i=0,halfDist=0;i<len-1;i++){halfDist+=points[i
].distanceTo(points[i+1])/2}for(i=0,dist=0;i<len-1;i++){p1=points[i];p2=points[i+1];
segDist=p1.distanceTo(p2);dist+=segDist;if(dist>halfDist){ratio=(dist-halfDist)/segDist;
return this._map.layerPointToLatLng([p2.x-ratio*(p2.x-p1.x),p2.y-ratio*(p2.y-p1.y)])}}},
getBounds:function(){return this._bounds},_setLatLngs:function(latlngs){
this._bounds=new window.L.LatLngBounds;this._latlngs=this._convertLatLngs(latlngs)},
_convertLatLngs:function(latlngs){var result=[],flat=this._flat(latlngs);for(var i=0,
len=latlngs.length;i<len;i++){if(flat){result[i]=window.L.latLng(latlngs[i]);this._bounds.extend(
result[i])}else{result[i]=this._convertLatLngs(latlngs[i])}}return result},_flat:function(latlngs){
return!app.util.isArray(latlngs[0])||typeof latlngs[0][0]!=="object"},_project:function(){
this._rings=[];this._projectLatlngs(this._latlngs,this._rings);var w=this._clickTolerance(),
p=new cool.Point(w,-w);if(this._latlngs.length){this._pxBounds=new cool.Bounds(this._latLngToPoint(
this._bounds.getSouthWest())._subtract(p),this._latLngToPoint(this._bounds.getNorthEast())._add(p))}
},_projectLatlngs:function(latlngs,result){var flat=latlngs[0]instanceof window.L.LatLng,
len=latlngs.length,i,ring;if(flat){ring=[];for(i=0;i<len;i++){ring[i]=this._latLngToPoint(latlngs[i]
)}result.push(ring)}else{for(i=0;i<len;i++){this._projectLatlngs(latlngs[i],result)}}},
_latLngToPoint:function(latlng){if(this.options.fixed){return this._map.project(latlng)}
return this._map.latLngToLayerPoint(latlng)},_clipPoints:function(){if(this.options.noClip){
this._parts=this._rings;return}this._parts=[];var parts=this._parts,bounds=this._renderer._bounds,i,
j,k,len,len2,segment,points;for(i=0,k=0,len=this._rings.length;i<len;i++){points=this._rings[i];for(
j=0,len2=points.length;j<len2-1;j++){segment=window.L.LineUtil.clipSegment(points[j],points[j+1],
bounds,j,true);if(!segment){continue}parts[k]=parts[k]||[];parts[k].push(segment[0]);if(segment[1
]!==points[j+1]||j===len2-2){parts[k].push(segment[1]);k++}}}},_simplifyPoints:function(){
var parts=this._parts,tolerance=this.options.smoothFactor;for(var i=0,len=parts.length;i<len;i++){
parts[i]=window.L.LineUtil.simplify(parts[i],tolerance)}},_update:function(){if(!this._map){return}
this._clipPoints();this._simplifyPoints();this._updatePath()},_updatePath:function(){
this._renderer._updatePoly(this)}});window.L.polyline=function(latlngs,options){
return new window.L.Polyline(latlngs,options)};window.L.PolyUtil={};
window.L.PolyUtil.clipPolygon=function(points,bounds,round){var clippedPoints,edges=[1,4,2,8],i,j,k,
a,b,len,edge,p,lu=window.L.LineUtil;for(i=0,len=points.length;i<len;i++){points[i
]._code=lu._getBitCode(points[i],bounds)}for(k=0;k<4;k++){edge=edges[k];clippedPoints=[];for(i=0,
len=points.length,j=len-1;i<len;j=i++){a=points[i];b=points[j];if(!(a._code&edge)){if(b._code&edge){
p=lu._getEdgeIntersection(b,a,edge,bounds,round);p._code=lu._getBitCode(p,bounds);
clippedPoints.push(p)}clippedPoints.push(a)}else if(!(b._code&edge)){p=lu._getEdgeIntersection(b,a,
edge,bounds,round);p._code=lu._getBitCode(p,bounds);clippedPoints.push(p)}}points=clippedPoints}
return points};window.L.PolyUtil.rectanglesToPolygons=function(rectangles,docLayer,dontConvert){
var eps=20;for(var i=0;i<rectangles.length-1;i++){for(var j=i+1;j<rectangles.length;j++){for(
var k=0;k<rectangles[i].length;k++){for(var l=0;l<rectangles[j].length;l++){if(Math.abs(rectangles[i
][k].x-rectangles[j][l].x)<eps){rectangles[j][l].x=rectangles[i][k].x}if(Math.abs(rectangles[i][k
].y-rectangles[j][l].y)<eps){rectangles[j][l].y=rectangles[i][k].y}}}}}var points={};for(
i=0;i<rectangles.length;i++){for(j=0;j<rectangles[i].length;j++){if(points[rectangles[i][j]]){
delete points[rectangles[i][j]]}else{points[rectangles[i][j]]=rectangles[i][j]}}}function getKeys(
points){var keys=[];for(var key in points){if(Object.prototype.hasOwnProperty.call(points,key)){
keys.push(key)}}return keys}function xThenY(aStr,bStr){var a=aStr.match(/\d+/g);a[0]=parseInt(a[0]);
a[1]=parseInt(a[1]);var b=bStr.match(/\d+/g);b[0]=parseInt(b[0]);b[1]=parseInt(b[1]);if(a[0]<b[0
]||a[0]===b[0]&&a[1]<b[1]){return-1}else if(a[0]===b[0]&&a[1]===b[1]){return 0}else{return 1}}
function yThenX(aStr,bStr){var a=aStr.match(/\d+/g);a[0]=parseInt(a[0]);a[1]=parseInt(a[1]);
var b=bStr.match(/\d+/g);b[0]=parseInt(b[0]);b[1]=parseInt(b[1]);if(a[1]<b[1]||a[1]===b[1]&&a[0]<b[0
]){return-1}else if(a[0]===b[0]&&a[1]===b[1]){return 0}else{return 1}}var sortX=getKeys(points
).sort(xThenY);var sortY=getKeys(points).sort(yThenX);var edgesH={};var edgesV={};var len=getKeys(
points).length;i=0;while(i<len){var currY=points[sortY[i]].y;while(i<len&&points[sortY[i]].y===currY
){edgesH[sortY[i]]=sortY[i+1];edgesH[sortY[i+1]]=sortY[i];i+=2}}i=0;while(i<len){var currX=points[
sortX[i]].x;while(i<len&&points[sortX[i]].x===currX){edgesV[sortX[i]]=sortX[i+1];edgesV[sortX[i+1]
]=sortX[i];i+=2}}var polygons=[];var edgesHKeys=getKeys(edgesH);while(edgesHKeys.length>0){var p=[[
edgesHKeys[0],0]];while(true){var curr=p[p.length-1][0];var e=p[p.length-1][1];if(e===0){
var nextVertex=edgesV[curr];delete edgesV[curr];p.push([nextVertex,1])}else{nextVertex=edgesH[curr];
delete edgesH[curr];p.push([nextVertex,0])}if(p[p.length-1][0]===p[0][0]&&p[p.length-1][1]===p[0][1]
){p.pop();break}}var polygon=[];for(i=0;i<p.length;i++){if(!dontConvert)polygon.push(
docLayer._twipsToLatLng(points[p[i][0]]));else polygon.push(points[p[i][0]]);delete edgesH[p[i][0]];
delete edgesV[p[i][0]]}if(!dontConvert)polygon.push(docLayer._twipsToLatLng(points[p[0][0]])
);else polygon.push(points[p[0][0]]);edgesHKeys=getKeys(edgesH);polygons.push(polygon)}
return polygons};window.L.Polygon=window.L.Polyline.extend({options:{fill:true},getCenter:function(
){var i,j,len,p1,p2,f,area,x,y,points=this._rings[0];area=x=y=0;for(i=0,len=points.length,
j=len-1;i<len;j=i++){p1=points[i];p2=points[j];f=p1.y*p2.x-p2.y*p1.x;x+=(p1.x+p2.x)*f;y+=(p1.y+p2.y
)*f;area+=f*3}return this._map.layerPointToLatLng([x/area,y/area])},_convertLatLngs:function(latlngs
){var result=window.L.Polyline.prototype._convertLatLngs.call(this,latlngs),len=result.length;if(
len>=2&&result[0]instanceof window.L.LatLng&&result[0].equals(result[len-1])){result.pop()}
return result},_clipPoints:function(){if(this.options.noClip){this._parts=this._rings;return}
var bounds=this._renderer._bounds,w=this.options.weight,p=new cool.Point(w,w);
bounds=new cool.Bounds(bounds.min.subtract(p),bounds.max.add(p));this._parts=[];for(var i=0,
len=this._rings.length,clipped;i<len;i++){clipped=window.L.PolyUtil.clipPolygon(this._rings[i],
bounds,true);if(clipped.length){this._parts.push(clipped)}}},_updatePath:function(){
this._renderer._updatePoly(this,true)}});window.L.polygon=function(latlngs,options){
return new window.L.Polygon(latlngs,options)};window.L.Rectangle=window.L.Polygon.extend({
initialize:function(latLngBounds,options){window.L.Polygon.prototype.initialize.call(this,
this._boundsToLatLngs(latLngBounds),options)},setBounds:function(latLngBounds){this.setLatLngs(
this._boundsToLatLngs(latLngBounds))},_boundsToLatLngs:function(latLngBounds){
latLngBounds=window.L.latLngBounds(latLngBounds);return[latLngBounds.getSouthWest(),
latLngBounds.getNorthWest(),latLngBounds.getNorthEast(),latLngBounds.getSouthEast()]}});
window.L.rectangle=function(latLngBounds,options){return new window.L.Rectangle(latLngBounds,options
)};window.L.Handler=window.L.Class.extend({initialize:function(map){this._map=map},enable:function(
){if(this._enabled){return}this._enabled=true;this.addHooks()},disable:function(){if(!this._enabled
){return}this._enabled=false;this.removeHooks()},enabled:function(){return!!this._enabled}});
window.L.Path.include({_transform:function(matrix){if(this._renderer){if(matrix){
this._renderer.transformPath(this,matrix)}else{this._renderer._resetTransformPath(this);
this._update()}}return this},_onMouseClick:function(e){if(this.dragging&&this.dragging.moved(
)||this._map.dragging&&this._map.dragging.moved()){return}this._fireMouseEvent(e)}});var END={
mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"};
var MOVE={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",
MSPointerDown:"touchmove"};function distance(a,b){var dx=a.x-b.x,dy=a.y-b.y;return Math.sqrt(
dx*dx+dy*dy)}window.L.Handler.PathDrag=window.L.Handler.extend({statics:{
DRAGGING_CLS:"leaflet-path-draggable"},initialize:function(path){this._path=path;this._matrix=null;
this._startPoint=null;this._dragStartPoint=null;this._mapDraggingWasEnabled=false},
noManualDrag:window.memo.decorator(function(f){if("noManualDrag"in this._path){
return this._path.noManualDrag.bind(this._path)(f).bind(this._path)}else{return f}}),
addHooks:function(){this._path.on("mousedown",this._onDragStart,this);
this._path.options.className=this._path.options.className?this._path.options.className+" "+window.L.Handler.PathDrag.DRAGGING_CLS:window.L.Handler.PathDrag.DRAGGING_CLS
this._path.addClass(window.L.Handler.PathDrag.DRAGGING_CLS)},removeHooks:function(){this._path.off(
"mousedown",this._onDragStart,this);
this._path.options.className=this._path.options.className.replace(new RegExp(
"\\s+"+window.L.Handler.PathDrag.DRAGGING_CLS),"");this._path.removeClass(
window.L.Handler.PathDrag.DRAGGING_CLS);window.L.DomEvent.off(document,"mousemove touchmove",
this.noManualDrag(window.memo.bind(this._onDrag,this)),this);window.L.DomEvent.off(document,
"mouseup touchend",this.noManualDrag(window.memo.bind(this._onDragEnd,this)),this)},moved:function(
){return this._path._dragMoved},_onDragStart:function(evt){
var eventType=evt.originalEvent._simulated?"touchstart":evt.originalEvent.type;if(!MOVE[eventType]
)return;this._mouseDown=evt.originalEvent;this._mapDraggingWasEnabled=false;
this._startPoint=evt.containerPoint.clone();this._dragStartPoint=evt.containerPoint.clone();
this._matrix=[1,0,0,1,0,0];window.L.DomEvent.stop(evt.originalEvent);
this._path._renderer.addContainerClass("leaflet-interactive");window.L.DomEvent.on(document,MOVE[
eventType],this.noManualDrag(window.memo.bind(this._onDrag,this)),this).on(document,END[eventType],
this.noManualDrag(window.memo.bind(this._onDragEnd,this)),this);if(this._path._map.dragging.enabled(
)){this._path._map.dragging.disable();this._mapDraggingWasEnabled=true}this._path._dragMoved=false;
if(this._path._popup){this._path._popup._close()}this._replaceCoordGetters(evt)},_onDrag:function(
evt){if(!this._startPoint)return;window.L.DomEvent.stop(evt);
var first=evt.touches&&evt.touches.length>=1?evt.touches[0]:evt;
var containerPoint=this._path._map.mouseEventToContainerPoint(first);if(
evt.type==="touchmove"&&!this._path._dragMoved){
var totalMouseDragDistance=this._dragStartPoint.distanceTo(containerPoint);if(
totalMouseDragDistance<=this._path._map.options.tapTolerance){return}}if(this._startPoint===null
)return;var x=containerPoint.x;var y=containerPoint.y;var dx=x-this._startPoint.x;
var dy=y-this._startPoint.y;if(isNaN(dx)||isNaN(dy))return;if(this.constraint){if(
this.constraint.dragMethod==="PieSegmentDragging"){var initialOffset=this.constraint.initialOffset;
var dragDirection=this.constraint.dragDirection;var dsx=x-this._dragStartPoint.x;
var dsy=y-this._dragStartPoint.y;var additionalOffset=(dsx*dragDirection.x+dsy*dragDirection.y
)/this.constraint.range2;var currentOffset=(dx*dragDirection.x+dy*dragDirection.y
)/this.constraint.range2;if(additionalOffset<-initialOffset&&currentOffset<0
)currentOffset=0;else if(additionalOffset>1-initialOffset&&currentOffset>0)currentOffset=0;
dx=currentOffset*dragDirection.x;dy=currentOffset*dragDirection.y;x=this._startPoint.x+dx;
y=this._startPoint.y+dy}}if(dx||dy){if(!this._path._dragMoved){this._path._dragMoved=true;
this._path.fire("dragstart",evt);this._path.bringToFront()}this._matrix[4]+=dx;this._matrix[5]+=dy;
this._startPoint.x=x;this._startPoint.y=y;this._path.fire("predrag",evt);this._path._transform(
this._matrix);this._path.fire("drag",evt)}},_onDragEnd:function(evt){window.L.DomEvent.stop(evt);
var containerPoint=this._path._map.mouseEventToContainerPoint(evt);var moved=this.moved();if(moved){
this._transformPoints(this._matrix);this._path._updatePath();this._path._project();
this._path._transform(null)}window.L.DomEvent.off(document,"mousemove touchmove",this.noManualDrag(
window.memo.bind(this._onDrag,this)),this);window.L.DomEvent.off(document,"mouseup touchend",
this.noManualDrag(window.memo.bind(this._onDragEnd,this)),this);this._restoreCoordGetters();if(moved
){this._path.fire("dragend",{distance:distance(this._dragStartPoint,containerPoint)});
var contains=this._path._containsPoint;this._path._containsPoint=app.util.falseFn;
app.util.requestAnimFrame(function(){window.L.DomEvent._skipped({type:"click"});
this._path._containsPoint=contains},this)}this._matrix=null;this._startPoint=null;
this._dragStartPoint=null;this._path._dragMoved=false;if(this._mapDraggingWasEnabled){if(moved
)window.L.DomEvent._fakeStop({type:"click"});this._path._map.dragging.enable()}if(
!moved&&this._mouseDown&&!this._path.options.manualDrag(this._mouseDown)){
this._path._map._handleDOMEvent(this._mouseDown);this._path._map._handleDOMEvent(evt)}},
_transformPoints:function(matrix,dest){var path=this._path;var i,len,latlng;
var px=cool.Point.toPoint(matrix[4],matrix[5]);var crs=path._map.options.crs;
var transformation=crs.transformation;var scale=crs.scale(path._map.getZoom());
var projection=crs.projection;var diff=transformation.untransform(px,scale).subtract(
transformation.untransform(cool.Point.toPoint(0,0),scale));var applyTransform=!dest;
path._bounds=new window.L.LatLngBounds;if(path._point){dest=projection.unproject(projection.project(
path._latlng)._add(diff));if(applyTransform){path._latlng=dest;path._point._add(px)}}else if(
path._rings||path._parts){var rings=path._rings||path._parts;var latlngs=path._latlngs;
dest=dest||latlngs;if(!app.util.isArray(latlngs[0])){latlngs=[latlngs];dest=[dest]}for(i=0,
len=rings.length;i<len;i++){dest[i]=dest[i]||[];for(var j=0,jj=rings[i].length;j<jj;j++){
latlng=latlngs[i][j];dest[i][j]=projection.unproject(projection.project(latlng)._add(diff));if(
applyTransform){path._bounds.extend(latlngs[i][j]);rings[i][j]._add(px)}}}}return dest},
_replaceCoordGetters:function(){if(this._path.getLatLng){this._path.getLatLng_=this._path.getLatLng;
this._path.getLatLng=function(){return this.dragging._transformPoints(this.dragging._matrix,{})
}.bind(this._path)}else if(this._path.getLatLngs){this._path.getLatLngs_=this._path.getLatLngs;
this._path.getLatLngs=function(){return this.dragging._transformPoints(this.dragging._matrix,[])
}.bind(this._path)}},_restoreCoordGetters:function(){if(this._path.getLatLng_){
this._path.getLatLng=this._path.getLatLng_;delete this._path.getLatLng_}else if(
this._path.getLatLngs_){this._path.getLatLngs=this._path.getLatLngs_;delete this._path.getLatLngs_}}
});window.L.Handler.PathDrag.makeDraggable=function(layer){
layer.dragging=new window.L.Handler.PathDrag(layer);return layer};
window.L.Path.prototype.makeDraggable=function(){return window.L.Handler.PathDrag.makeDraggable(this
)};window.L.PathTransform={};window.L.PathTransform.pointOnLine=function(start,final,distPx){
var ratio=1+distPx/start.distanceTo(final);return new cool.Point(start.x+(final.x-start.x)*ratio,
start.y+(final.y-start.y)*ratio)};window.L.PathTransform.merge=function(){var i=1;var key,val;
var obj=arguments[i];function isObject(object){return Object.prototype.toString.call(object
)==="[object Object]"}var target=arguments[0];while(obj){obj=arguments[i++];for(key in obj){if(
!Object.prototype.hasOwnProperty.call(obj,key)){continue}val=obj[key];if(isObject(val)&&isObject(
target[key])){target[key]=app.util.merge(target[key],val)}else{target[key]=val}}}return target};
window.L.Canvas=window.L.Renderer.extend({onAdd:function(){window.L.Renderer.prototype.onAdd.call(
this);this._layers=this._layers||{};this._draw()},_initContainer:function(){
var container=this._container=document.createElement("canvas");window.L.DomEvent.on(container,
"mousemove",this._onMouseMove,this).on(container,"click dblclick mousedown mouseup contextmenu",
this._onClick,this);this._ctx=container.getContext("2d")},_update:function(){
window.L.Renderer.prototype._update.call(this);var b=this._bounds,container=this._container,
size=b.getSize(),m=window.app.dpiScale;window.L.DomUtil.setPosition(container,b.min);
container.width=m*size.x;container.height=m*size.y;container.style.width=size.x+"px";
container.style.height=size.y+"px";this._ctx.scale(m,m);this._ctx.translate(-b.min.x,-b.min.y)},
_initPath:function(layer){this._layers[app.util.stamp(layer)]=layer},_addPath:app.util.falseFn,
_removePath:function(layer){layer._removed=true;this._requestRedraw(layer)},_updatePath:function(
layer){this._redrawBounds=layer._pxBounds;this._draw(true);layer._project();layer._update();
this._draw();this._redrawBounds=null},_updateStyle:function(layer){this._requestRedraw(layer)},
_requestRedraw:function(layer){if(!this._map){return}
this._redrawBounds=this._redrawBounds||new cool.Bounds;this._redrawBounds.extend(layer._pxBounds.min
).extend(layer._pxBounds.max);this._redrawRequest=this._redrawRequest||app.util.requestAnimFrame(
this._redraw,this)},_redraw:function(){this._redrawRequest=null;this._draw(true);this._draw();
this._redrawBounds=null},_draw:function(clear){this._clear=clear;var layer;for(
var id in this._layers){layer=this._layers[id];if(!this._redrawBounds||layer._pxBounds.intersects(
this._redrawBounds)){layer._updatePath()}if(clear&&layer._removed){delete layer._removed;
delete this._layers[id]}}},_updatePoly:function(layer,closed){var i,j,len2,p,parts=layer._parts,
len=parts.length,ctx=this._ctx;if(!len){return}ctx.beginPath();for(i=0;i<len;i++){for(j=0,
len2=parts[i].length;j<len2;j++){p=parts[i][j];ctx[j?"lineTo":"moveTo"](p.x,p.y)}if(closed){
ctx.closePath()}}this._fillStroke(ctx,layer)},_updateCircle:function(layer){if(layer._empty()){
return}var p=layer._point,ctx=this._ctx,r=layer._radius,s=(layer._radiusY||r)/r;if(s!==1){ctx.save()
ctx.scale(1,s)}ctx.beginPath();ctx.arc(p.x,p.y/s,r,0,Math.PI*2,false);if(s!==1){ctx.restore()}
this._fillStroke(ctx,layer)},_fillStroke:function(ctx,layer){var clear=this._clear,
options=layer.options;ctx.globalCompositeOperation=clear?"destination-out":"source-over";if(
options.fill){ctx.globalAlpha=clear?1:options.fillOpacity;
ctx.fillStyle=options.fillColor||options.color;ctx.fill(options.fillRule||"evenodd")}if(
options.stroke&&options.weight!==0){ctx.globalAlpha=clear?1:options.opacity;
layer._prevWeight=ctx.lineWidth=clear?layer._prevWeight+1:options.weight;
ctx.strokeStyle=options.color;ctx.lineCap=options.lineCap;ctx.lineJoin=options.lineJoin;ctx.stroke()
}},_onClick:function(e){var point=this._map.mouseEventToLayerPoint(e);for(var id in this._layers){
if(this._layers[id]._containsPoint(point)){window.L.DomEvent._fakeStop(e);this._fireEvent(
this._layers[id],e)}}},_onMouseMove:function(e){if(!this._map){return}
var point=this._map.mouseEventToLayerPoint(e);for(var id in this._layers){this._handleHover(
this._layers[id],e,point)}},_handleHover:function(layer,e,point){if(!layer.options.interactive){
return}if(layer._containsPoint(point)){if(!layer._mouseInside){window.L.DomUtil.addClass(
this._container,"leaflet-interactive");this._fireEvent(layer,e,"mouseover");layer._mouseInside=true}
this._fireEvent(layer,e)}else if(layer._mouseInside){window.L.DomUtil.removeClass(this._container,
"leaflet-interactive");this._fireEvent(layer,e,"mouseout");layer._mouseInside=false}},
_fireEvent:function(layer,e,type){this._map._fireDOMEvent(layer,e,type||e.type)},
_bringToFront:app.util.falseFn,_bringToBack:app.util.falseFn});window.L.Browser.canvas=function(){
return!!document.createElement("canvas").getContext}();window.L.canvas=function(options){
return window.L.Browser.canvas?new window.L.Canvas(options):null};
window.L.Polyline.prototype._containsPoint=function(p,closed){var i,j,k,len,len2,part,
w=this._clickTolerance();if(!this._pxBounds.contains(p)){return false}for(i=0,
len=this._parts.length;i<len;i++){part=this._parts[i];for(j=0,len2=part.length,k=len2-1;j<len2;k=j++
){if(!closed&&j===0){continue}if(window.L.LineUtil.pointToSegmentDistance(p,part[k],part[j])<=w){
return true}}}return false};window.L.Polygon.prototype._containsPoint=function(p){var inside=false,
part,p1,p2,i,j,k,len,len2;if(!this._pxBounds.contains(p)){return false}for(i=0,
len=this._parts.length;i<len;i++){part=this._parts[i];for(j=0,len2=part.length,k=len2-1;j<len2;k=j++
){p1=part[j];p2=part[k];if(p1.y>p.y!==p2.y>p.y&&p.x<(p2.x-p1.x)*(p.y-p1.y)/(p2.y-p1.y)+p1.x){
inside=!inside}}}return inside||window.L.Polyline.prototype._containsPoint.call(this,p,true)};
window.L.FormFieldButton=window.L.Layer.extend({options:{pane:"formfieldPane"},initialize:function(
data){window.L.Layer.prototype.initialize.call(this);window.app.console.assert(
data.type==="drop-down");this._buttonData=data},onAdd:function(map){this.map=map;this._clearButton()
this._buildFormButton(map)},_buildFormButton:function(map){var container=window.L.DomUtil.create(
"div","form-field-button-container",this.getPane("formfieldPane"));
var buttonArea=this._calculateButtonArea(map);var frameData=this._buildButtonFrame(container,
buttonArea);var framePos=frameData[0];var frameWidth=frameData[1];var frameHeight=frameData[2];
container.style.height=frameHeight+"px";this._buildDropDownButton(container,framePos,frameWidth);
this._buildDropDownList(framePos,frameWidth,frameHeight);map.on("zoomstart",this._onZoomStart,this);
map.on("zoomend",this._onZoomEnd,this)},_calculateButtonArea:function(map){
var strTwips=this._buttonData.textArea.match(/\d+/g);var topLeftTwips=new cool.Point(parseInt(
strTwips[0]),parseInt(strTwips[1]));var offset=new cool.Point(parseInt(strTwips[2]),parseInt(
strTwips[3]));var bottomRightTwips=topLeftTwips.add(offset);var buttonAreaTwips=[topLeftTwips,
bottomRightTwips];var buttonAreaLatLng=new window.L.LatLngBounds(map._docLayer._twipsToLatLng(
buttonAreaTwips[0],this._map.getZoom()),map._docLayer._twipsToLatLng(buttonAreaTwips[1],
this._map.getZoom()));var buttonAreaLayer=new cool.Bounds(map.latLngToLayerPoint(
buttonAreaLatLng.getNorthWest()),map.latLngToLayerPoint(buttonAreaLatLng.getSouthEast()));
return buttonAreaLayer},_buildButtonFrame:function(container,buttonArea){
var buttonFrame=window.L.DomUtil.create("div","form-field-frame",container);var extraPadding=2;
var size=buttonArea.getSize();var frameWidth=size.x+1.5*extraPadding;
var frameHeight=size.y+1.5*extraPadding;buttonFrame.style.width=frameWidth+"px";
var framePos=new cool.Point(buttonArea.min.x-extraPadding,buttonArea.min.y-extraPadding);
window.L.DomUtil.setPosition(buttonFrame,framePos);return[framePos,frameWidth,frameHeight]},
_buildDropDownButton:function(container,framePos,frameWidth){var button=window.L.DomUtil.create(
"button","form-field-button",container);var buttonPos=new cool.Point(framePos.x+frameWidth,
framePos.y);window.L.DomUtil.setPosition(button,buttonPos);button.style.width=container.style.height
var image=window.L.DomUtil.create("img","form-field-button-image",button);image.setAttribute("alt",
_("Unfold"));app.LOUtil.setImage(image,"unfold.svg",this.map);button.addEventListener("click",
this._onClickDropDown);button.addEventListener("mouseup",function(event){event.stopPropagation()});
button.addEventListener("mousedown",function(event){event.stopPropagation()})},
_buildDropDownList:function(framePos,frameWidth,frameHeight){
var dropDownList=window.L.DomUtil.create("div","drop-down-field-list",this.getPane("formfieldPane"))
$(".drop-down-field-list").hide();window.L.DomUtil.setPosition(dropDownList,framePos);
dropDownList.style.minWidth=frameWidth+frameHeight+"px";var itemList=this._buttonData.params.items;
var selected=parseInt(this._buttonData.params.selected);for(var i=0;i<itemList.length;++i){
this._buildListItem(dropDownList,itemList[i],frameHeight,i===selected)}if(
this._buttonData.params.items.length===0){this._buildListItem(dropDownList,
this._buttonData.params.placeholderText,frameHeight,false)}},_buildListItem:function(parent,text,
frameHeight,selected){var option=window.L.DomUtil.create("div","drop-down-field-list-item",parent);
option.innerHTML=text;option.style.fontSize=frameHeight*.7+"px";option.addEventListener("click",
this._onListItemSelect);option.map=this.map;option._buttonData=this._buttonData;
option.addEventListener("mouseup",function(event){event.stopPropagation()});option.addEventListener(
"mousedown",function(event){event.stopPropagation()});if(selected===true)option.classList.add(
"selected")},onRemove:function(){this._clearButton();this.map.off("zoomstart",this._onZoomStart,this
);this.map.off("zoomend",this._onZoomEnd,this)},_onClickDropDown:function(event){$(
".drop-down-field-list").show();event.stopPropagation()},_onListItemSelect:function(event){$(
".drop-down-field-list").hide();event.stopPropagation();if(this._buttonData.params.items.length===0
)return;$(".drop-down-field-list-item.selected").removeClass("selected");event.target.classList.add(
"selected");var index=$(event.target).index();
var message='formfieldevent {"type": "drop-down",'+'"cmd": "selected",'+'"data":"'+index.toString(
)+'"}';app.socket.sendMessage(message)},_onZoomStart:function(){$(".drop-down-field-list").hide();
this._clearButton()},_onZoomEnd:function(){this.onAdd(this.map)},_clearButton:function(){
this.getPane("formfieldPane").replaceChildren()}});var eventsKey="_leaflet_events";
window.L.DomEvent={on:function(obj,types,fn,context){if(typeof types==="object"){for(
var type in types){this._on(obj,type,types[type],fn)}}else{types=app.util.splitWords(types);for(
var i=0,len=types.length;i<len;i++){this._on(obj,types[i],fn,context)}}return this},off:function(obj
,types,fn,context){if(typeof types==="object"){for(var type in types){this._off(obj,type,types[type]
,fn)}}else{types=app.util.splitWords(types);for(var i=0,len=types.length;i<len;i++){this._off(obj,
types[i],fn,context)}}return this},_on:function(obj,type,fn,context){var id=type+app.util.stamp(fn
)+(context?"_"+app.util.stamp(context):"");if(obj[eventsKey]&&obj[eventsKey][id]){return this}
var handler=function(e){return fn.call(context||obj,e||window.event)};var originalHandler=handler;
if(window.L.Browser.pointer&&type.indexOf("touch")===0){this.addPointerListener(obj,type,handler,id)
}else if(type==="dblclick"&&this.addDoubleTapListener){this.addDoubleTapListener(obj,
window.touch.touchOnly(handler),id)}else if(type==="trplclick"||type==="qdrplclick"){
this.addMultiClickListener(obj,handler,id,type)}else if("addEventListener"in obj){if(
type==="mousewheel"){obj.addEventListener("DOMMouseScroll",handler,false);obj.addEventListener(type,
handler,false)}else if(type==="mouseenter"||type==="mouseleave"){handler=function(e){
e=e||window.event;if(window.L.DomEvent._checkMouse(obj,e)){originalHandler(e)}};
obj.addEventListener(type==="mouseenter"?"mouseover":"mouseout",handler,false)}else{if(
type==="click"&&window.L.Browser.android){handler=function(e){return window.L.DomEvent._filterClick(
e,originalHandler)}}obj.addEventListener(type,handler,false)}}else if("attachEvent"in obj){
obj.attachEvent("on"+type,handler)}obj[eventsKey]=obj[eventsKey]||{};obj[eventsKey][id]=handler;
return this},_off:function(obj,type,fn,context){var id=type+app.util.stamp(fn)+(
context?"_"+app.util.stamp(context):""),handler=obj[eventsKey]&&obj[eventsKey][id];if(!handler){
return this}if(window.L.Browser.pointer&&type.indexOf("touch")===0){this.removePointerListener(obj,
type,id)}else if(type==="dblclick"&&this.removeDoubleTapListener){this.removeDoubleTapListener(obj,
id)}else if(type==="trplclick"||type==="qdrplclick"){this.removeMultiClickListener(obj,id,type)
}else if("removeEventListener"in obj){if(type==="mousewheel"){obj.removeEventListener(
"DOMMouseScroll",handler,false);obj.removeEventListener(type,handler,false)}else{
obj.removeEventListener(type==="mouseenter"?"mouseover":type==="mouseleave"?"mouseout":type,handler,
false)}}else if("detachEvent"in obj){obj.detachEvent("on"+type,handler)}obj[eventsKey][id]=null;
return this},stopPropagation:function(e){if(e.stopPropagation){e.stopPropagation()}else{
e.cancelBubble=true}window.L.DomEvent._skipped(e);return this},
disableMouseClickPropagation:function(el){var stop=window.touch.mouseOnly(
window.L.DomEvent.stopPropagation);window.L.DomEvent.on(el,window.L.Draggable.START.join(" "),stop);
return window.L.DomEvent.on(el,{click:window.touch.mouseOnly(window.L.DomEvent._fakeStop),
dblclick:stop})},disableScrollPropagation:function(el){return window.L.DomEvent.on(el,
"mousewheel MozMousePixelScroll",window.L.DomEvent.stopPropagation)},
disableClickPropagation:function(el){var stop=window.L.DomEvent.stopPropagation;
window.L.DomEvent.on(el,window.L.Draggable.START.join(" "),stop);return window.L.DomEvent.on(el,{
click:window.L.DomEvent._fakeStop,dblclick:stop})},preventDefault:function(e){if(e.preventDefault){
e.preventDefault()}else{e.returnValue=false}return this},stop:function(e){
return window.L.DomEvent.preventDefault(e).stopPropagation(e)},getMousePosition:function(e,container
){if(!container){if(e.clientX===undefined&&e.touches!==undefined)return new cool.Point(e.touches[0
].clientX,e.touches[0].clientY);return new cool.Point(e.clientX,e.clientY)}
var rect=container.getBoundingClientRect(),left=rect.left,top=rect.top;if(
e.currentTarget&&e.currentTarget.frameElement&&window.L.DomUtil.hasClass(
e.currentTarget.frameElement,"resize-detector")){left=top=0}if(
e.clientX===undefined&&e.touches!==undefined&&e.touches.length>0)return new cool.Point(e.touches[0
].clientX-left-container.clientLeft,e.touches[0].clientY-top-container.clientTop);else if(
e.clientX===undefined&&e.changedTouches!==undefined&&e.changedTouches.length>0
)return new cool.Point(e.changedTouches[0].clientX-left-container.clientLeft,e.changedTouches[0
].clientY-top-container.clientTop);return new cool.Point(e.clientX-left-container.clientLeft,
e.clientY-top-container.clientTop)},getWheelDelta:function(e){var delta=0;if(e.wheelDelta){
delta=e.wheelDelta/120}if(e.detail){delta=-e.detail/3}return delta},_skipEvents:{},
_fakeStop:function(e){window.L.DomEvent._skipEvents[e.type]=true},_skipped:function(e){
var skipped=this._skipEvents[e.type];this._skipEvents[e.type]=false;return skipped},
_checkMouse:function(el,e){var related=e.relatedTarget;if(!related){return true}try{while(
related&&related!==el){related=related.parentNode}}catch(err){return false}return related!==el},
_filterClick:function(e,handler){var timeStamp=e.timeStamp||e.originalEvent.timeStamp,
elapsed=window.L.DomEvent._lastClick&&timeStamp-window.L.DomEvent._lastClick;if(
elapsed&&elapsed>100&&elapsed<500||e.target._simulatedClick&&!e._simulated){window.L.DomEvent.stop(e
);return}window.L.DomEvent._lastClick=timeStamp;handler(e)}};
window.L.DomEvent.addListener=window.L.DomEvent.on;
window.L.DomEvent.removeListener=window.L.DomEvent.off;window.L.Draggable=window.L.Evented.extend({
statics:{START:["touchstart","mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",
pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",
pointerdown:"touchmove",MSPointerDown:"touchmove"}},_manualDrag:function(){return false},
noManualDrag:window.memo.decorator(function(f){return function(e){if(!this._manualDrag(e)){
return f.apply(this,arguments)}}}),initialize:function(element,dragStartTarget,preventOutline,no3d){
window.L.Evented.prototype.initialize.call(this);this._element=element;
this._dragStartTarget=dragStartTarget||element;this._preventOutline=preventOutline;
this._freezeX=false;this._freezeY=false;this._no3d=no3d},freezeX:function(boolChoice){
this._freezeX=boolChoice},freezeY:function(boolChoice){this._freezeY=boolChoice},enable:function(){
if(this._enabled){return}window.L.DomEvent.on(this._dragStartTarget,window.L.Draggable.START.join(
" "),this.noManualDrag(this._onDown),this);this._enabled=true},disable:function(){if(!this._enabled
){return}window.L.DomEvent.off(this._dragStartTarget,window.L.Draggable.START.join(" "),
this.noManualDrag(this._onDown),this);this._enabled=false;this._moved=false},_onDown:function(e){
this._moved=false;if(e.shiftKey||e.which!==1&&e.button!==0&&!e.touches){return}if(
!window.L.DomUtil.hasClass(this._element,"leaflet-map-pane")){window.L.DomEvent.stopPropagation(e)}
if(this._preventOutline){window.L.DomUtil.preventOutline(this._element)}
window.L.DomUtil.disableImageDrag();window.L.DomUtil.disableTextSelection();if(this._moving){return}
this.fire("down");var first=e.touches?e.touches[0]:e;this._startPoint=new cool.Point(first.clientX,
first.clientY);this._startPos=this._newPos=window.L.DomUtil.getPosition(this._element);
var startBoundingRect=this._element.getBoundingClientRect();
this.startOffset=this._startPoint.subtract(new cool.Point(startBoundingRect.left,
startBoundingRect.top));window.L.DomEvent.on(document,window.L.Draggable.MOVE[e.type],
this.noManualDrag(this._onMove),this).on(document,window.L.Draggable.END[e.type],this.noManualDrag(
this._onUp),this)},_onMove:function(e){if(!this._startPoint){return}if(e.touches&&e.touches.length>1
){this._moved=true;return}var first=e.touches&&e.touches.length===1?e.touches[0]:e,
newPoint=new cool.Point(first.clientX,first.clientY),offset=newPoint.subtract(this._startPoint);if(
this._map){if(this._map._docLayer.isCalcRTL()){offset.x=-offset.x}if(
e.currentTarget&&e.currentTarget.frameElement&&window.L.DomUtil.hasClass(
e.currentTarget.frameElement,"resize-detector")){
var rect=this._map._container.getBoundingClientRect(),correction=new cool.Point(rect.left,rect.top);
offset=offset.add(correction)}if(this._map.getDocSize().x<this._map.getSize().x){offset.x=0}if(
this._map.getDocSize().y<this._map.getSize().y){offset.y=0}}if(!offset.x&&!offset.y){return}if(
window.touch.isTouchEvent(e)&&Math.abs(offset.x)+Math.abs(offset.y)<3&&!e.autoscroll){return}
window.L.DomEvent.preventDefault(e);if(!this._moved){this.fire("dragstart",{originalEvent:e});
this._moved=true;this._startPos=window.L.DomUtil.getPosition(this._element).subtract(offset);
window.L.DomUtil.addClass(document.body,"leaflet-dragging");this._lastTarget=e.target||e.srcElement;
window.L.DomUtil.addClass(this._lastTarget,"leaflet-drag-target")}this._newPos=this._startPos.add(
offset);if(this._freezeY)this._newPos.y=this._startPos.y;if(this._freezeX
)this._newPos.x=this._startPos.x;this._moving=true;app.util.cancelAnimFrame(this._animRequest);
this._lastEvent=e;this._animRequest=app.util.requestAnimFrame(this._updatePosition,this)},
_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e);
window.L.DomUtil.setPosition(this._element,this._newPos,this._no3d);this.fire("drag",e)},
_onUp:function(e){window.L.DomUtil.removeClass(document.body,"leaflet-dragging");if(this._lastTarget
){window.L.DomUtil.removeClass(this._lastTarget,"leaflet-drag-target");this._lastTarget=null}for(
var i in window.L.Draggable.MOVE){window.L.DomEvent.off(document,window.L.Draggable.MOVE[i],
this.noManualDrag(this._onMove),this).off(document,window.L.Draggable.END[i],this.noManualDrag(
this._onUp),this)}window.L.DomUtil.enableImageDrag();window.L.DomUtil.enableTextSelection();if(
this._moved&&this._moving){app.util.cancelAnimFrame(this._animRequest);this.fire("dragend",{
originalEvent:e,distance:this._newPos.distanceTo(this._startPos)})}else{this.fire("up",{
originalEvent:e})}this._moving=false;this._startPoint=undefined}});
var NotebookbarAccessibilityDefinitions=function(){this.cleanMenuName=function(id){if(!id){
console.debug("No id found for Notebookbar Accesibility item");return id}
var separatorPos=id.indexOf(":");if(separatorPos===-1)return id;return id.substr(0,separatorPos)};
this.getContentListRecursive=function(rawList,list,language){if(Array.isArray(rawList)){for(
var i=0;i<rawList.length;i++){if(rawList[i].accessibility){var combination=language&&rawList[i
].accessibility[language]?rawList[i].accessibility[language]:rawList[i].accessibility.combination;
var id=this.cleanMenuName(rawList[i].id);var overflow=document.querySelector(
"#"+id+".ui-overflow-group");var arrow=document.querySelector("#"+id+" .arrowbackground");
var element=document.getElementById(id+"-button");if(overflow){if(
typeof overflow.isCollapsed==="function"&&overflow.isCollapsed()){list.push({id:id,
focusBack:rawList[i].accessibility.focusBack,combination:combination})}else if(rawList[i].children){
this.getContentListRecursive(rawList[i].children,list,language);if(rawList[i].more&&rawList[i
].more.accessibility){const moreAccessibility=rawList[i].more.accessibility;
combination=language&&moreAccessibility[language]?moreAccessibility[language
]:moreAccessibility.combination;list.push({id:id+"-more-button",
focusBack:moreAccessibility.focusBack,combination:combination})}}}else if(arrow){list.push({id:id,
focusBack:rawList[i].accessibility.focusBack,combination:combination})}else if(element){list.push({
id:id+"-button",focusBack:rawList[i].accessibility.focusBack,combination:combination})}else{
list.push({id:id,focusBack:rawList[i].accessibility.focusBack,combination:combination})}}else if(
rawList[i].children&&Array.isArray(rawList[i].children)&&rawList[i].children.length>0){
this.getContentListRecursive(rawList[i].children,list,language)}}}else if(
rawList.children&&Array.isArray(rawList.children)&&rawList.children.length>0){
this.getContentListRecursive(rawList.children,list,language)}else return};
this.getTabsAndContents=function(){var tabs=app.map.uiManager.notebookbar.getTabs();
var rawDefinitions=app.map.uiManager.notebookbar.getFullJSON();var contextContainer=null;while(
rawDefinitions.children&&Array.isArray(rawDefinitions.children)&&rawDefinitions.children[0
]&&contextContainer===null){if(rawDefinitions.children[0].id==="ContextContainer"
)contextContainer=rawDefinitions.children[0];else rawDefinitions=rawDefinitions.children[0]}if(
!contextContainer||!Array.isArray(tabs))return;else{for(var i=0;i<tabs.length;i++){var tabName=tabs[
i].id.split("-")[0];tabs[i].rawContentList=[];for(var j=0;j<contextContainer.children.length;j++){
if(contextContainer.children[j].children[0].id===tabName+"-container"){tabs[i
].rawContentList=contextContainer.children[j].children[0].children;break}}}}var defs={};
var language=this.getLanguage();for(i=0;i<tabs.length;i++){if(tabs[i].accessibility&&tabs[i
].accessibility.focusBack!==undefined){defs[tabs[i].id]=tabs[i];defs[tabs[i].id].focusBack=tabs[i
].accessibility.focusBack;defs[tabs[i].id].combination=language&&tabs[i].accessibility[language
]?tabs[i].accessibility[language]:tabs[i].accessibility.combination;defs[tabs[i].id].contentList=[];
this.getContentListRecursive(defs[tabs[i].id].rawContentList,defs[tabs[i].id].contentList,language);
delete defs[tabs[i].id].rawContentList}}return defs};this.getLanguage=function(){if(
app.UI.language.fromURL&&app.UI.language.fromURL!==""){return app.UI.language.fromURL
}else return null};this.checkIntegratorButtons=function(selectedDefinitions){var containerList=[
"save","userListHeader","shortcutstoolbox","closebuttonwrapper","navigator-floating-icon"];for(
var i=0;i<containerList.length;i++){var container=document.getElementById(containerList[i]);if(
container){var buttonList=Array.from(container.querySelectorAll("button"));if(buttonList.length){
for(var j=0;j<buttonList.length;j++){var button=buttonList[j];if(button.accessKey&&button.id){if(
selectedDefinitions[button.id]===undefined){selectedDefinitions[button.id]={focusBack:true,
combination:button.accessKey,contentList:[]}}}}}}}};this.optionsToolButtons=function(
selectedDefinitions){const optionsToolSectionData=app.map.uiManager.notebookbar.getDefaultToolItems(
);const language=this.getLanguage();for(let option=0;option<optionsToolSectionData.length;option++){
let toolOption=optionsToolSectionData[option];toolOption.id=(
toolOption.id==null?toolOption.command.replace(".uno:",""):toolOption.id)+"-button";
selectedDefinitions[toolOption.id]={focusBack:toolOption.accessibility.focusBack,
combination:language&&toolOption.accessibility[language]?toolOption.accessibility[language
]:toolOption.accessibility.combination,contentList:[]}}};this.getDefinitions=function(){
var selectedDefinitions=this.getTabsAndContents();this.checkIntegratorButtons(selectedDefinitions);
this.optionsToolButtons(selectedDefinitions);return selectedDefinitions}};
var NotebookbarAccessibility=function(){this.initialized=false;this.activeTabPointers={id:"",
contentList:[],infoBoxList:[]},this.definitions=new NotebookbarAccessibilityDefinitions;
this.tabInfoList=null;this.combination=null;this.filteredItem=null;this.state=0;
this.addInfoBox=function(anchorElement){var visible=anchorElement.id.replace("-button","");
visible=document.getElementById(visible);if(visible)visible=visible.style.display!=="none";if(
visible){var infoBox=document.createElement("div");infoBox.classList.add("accessibility-info-box");
infoBox.textContent=anchorElement.accessKey;var rectangle=anchorElement.getBoundingClientRect();
infoBox.style.top=rectangle.bottom-5+"px";infoBox.style.left=rectangle.left+"px";
document.body.appendChild(infoBox);return infoBox}else{return null}};
this.setupAcceleratorsForCurrentTab=function(id){if(id===undefined)id=this.activeTabPointers.id;
this.removeAllInfoBoxes();this.activeTabPointers.id=id;
this.activeTabPointers.contentList=this.tabInfoList[id].contentList;
this.activeTabPointers.infoBoxList=[];for(var i=0;i<this.activeTabPointers.contentList.length;i++){
var element=document.getElementById(this.activeTabPointers.contentList[i].id);if(
element&&element.offsetParent!==null){element.accessKey=this.activeTabPointers.contentList[i
].combination;this.activeTabPointers.infoBoxList.push(this.addInfoBox(element))}else if(!element
)console.warn("NotebookbarAccessibility: Element with id "+this.activeTabPointers.contentList[i
].id+" doesn't exist.")}};this.mayShowAcceleratorInfoBoxes=false;this.onDocumentKeyDown=function(
event){if(this.initialized&&(event.keyCode===18||event.keyCode===18&&event.shiftKey)){
this.mayShowAcceleratorInfoBoxes=true}};this.onDocumentKeyUp=function(event){if(this.initialized){
if(app.map&&app.map.jsdialog&&app.map.jsdialog.hasDialogOpened()){if(event.keyCode===18
)document.body.classList.remove("activate-underlines")}else if(this.mayShowAcceleratorInfoBoxes&&(
event.keyCode===18||event.keyCode===18&&event.shiftKey)){this.resetState();this.setTabDescription(
this.getCurrentSelectedTab());this.addTabAccelerators();this.accessibilityInputElement.focus()
}else if(event.keyCode===16)return;else{this.resetState()}}};this.onInputFocus=function(){
this.addTabFocus();document.body.classList.add("activate-info-boxes")};this.onInputBlur=function(){
document.body.classList.remove("activate-info-boxes");this.removeFocusFromTab();this.resetState()};
this.isAllFilteredOut=function(){var count=document.querySelectorAll(
".accessibility-info-box:not(.filtered_out)");count=count.length;return count===0};
this.filterOutNonMatchingInfoBoxes=function(){var keyList=document.getElementsByClassName(
"accessibility-info-box");for(var i=0;i<keyList.length;i++)keyList[i].classList.remove(
"filtered_out");if(this.combination!==null){for(var i=0;i<keyList.length;i++){if(!keyList[i
].textContent.startsWith(this.combination))keyList[i].classList.add("filtered_out")}}};
this.checkTabAccelerators=function(){for(var tabId in this.tabInfoList){if(
Object.prototype.hasOwnProperty.call(this.tabInfoList,tabId)){var element=document.getElementById(
tabId);if(element&&!element.classList.contains("hidden")){if(this.tabInfoList[tabId
].combination===this.combination){this.filteredItem=this.tabInfoList[tabId];
this.filteredItem.id=tabId;break}}}}};this.checkContentAccelerators=function(){for(
var i=0;i<this.activeTabPointers.contentList.length;i++){
var item=this.activeTabPointers.contentList[i];if(this.combination===item.combination){
this.filteredItem=this.activeTabPointers.contentList[i];break}}};
this.checkCombinationAgainstAcccelerators=function(){this.filteredItem=null;if(this.state===0
)this.checkTabAccelerators();else if(this.state===1)this.checkContentAccelerators()};
this.clickOnFilteredItem=function(){var itemWasClicked=false;if(this.filteredItem!==null){
var element=document.getElementById(this.filteredItem.id);if(element){
var dropdownArrow=element.querySelector(".arrowbackground");if(dropdownArrow){element=dropdownArrow}
if(this.state===0){this.removeFocusFromTab();element.click();this.addTabFocus();
this.setupAcceleratorsForCurrentTab(element.id);this.combination=null;
this.accessibilityInputElement.value="";this.setTabDescription(element);
this.accessibilityInputElement.focus();this.state=1}else if(this.state===1){itemWasClicked=true;
this.setTabItemDescription(element);element.click();if(
this.filteredItem&&this.filteredItem.focusBack===true){this.focusToMap()}}}this.filteredItem=null
}else this.focusToMap();return itemWasClicked};this.addTabFocus=function(){
var element=this.getCurrentSelectedTab();if(element){element.classList.add("add-focus-to-tab")}};
this.removeFocusFromTab=function(){var element=this.getCurrentSelectedTab();if(element){
element.classList.remove("add-focus-to-tab")}};this.focusToMap=function(){app.map.focus();
this.mayShowAcceleratorInfoBoxes=false;this.removeFocusFromTab()};
this.getCurrentSelectedTab=function(){return document.querySelector(
"button.ui-tab.notebookbar.selected")};this.setTabDescription=function(tabElem){
var tabDescr=tabElem?_("{0} tab selected").replace("{0}",tabElem.textContent):"";
this.accessibilityInputElement.setAttribute("aria-description",tabDescr)};
this.setTabItemDescription=function(element){var descr="";if(element){
var button=element.hasAttribute("alt")?element:element.querySelector("button[alt]");if(button){
descr=button.getAttribute("alt")}}this.accessibilityInputElement.setAttribute("aria-description",
descr)};this.getCurrentSelectedTabPage=function(){return document.querySelector(
"div.ui-content.level-0.notebookbar:not(.hidden)")};this.resetState=function(){
this.removeAllInfoBoxes();this.state=0;this.accessibilityInputElement.value="";
this.accessibilityInputElement.setAttribute("aria-description","");this.combination=null;
this.mayShowAcceleratorInfoBoxes=false;this.filteredItem=null;for(
var i=0;i<this.activeTabPointers.contentList.length;i++){if(document.getElementById(
this.activeTabPointers.contentList[i].id))document.getElementById(
this.activeTabPointers.contentList[i].id).accessKey=null;else console.warn(
"Accessibility - no element with id:"+this.activeTabPointers.contentList[i].id)}};
this.onInputKeyDown=function(event){if(event.ctrlKey){this.resetState()}};
this.onInputKeyUp=function(event){var key=event.key.toUpperCase();event.preventDefault();
event.stopPropagation();if(key==="ESCAPE"||key==="ALT"){if(this.combination===null)this.focusToMap(
);else{this.resetState()}}else if(event.keyCode===16)return;else if(key==="ARROWUP"){
this.removeFocusFromTab();var currentSelectedTabButton=this.getCurrentSelectedTab();
currentSelectedTabButton.focus()}else if(key==="ARROWDOWN"){
var currentSelectedTabPage=this.getCurrentSelectedTabPage();
var firstSelectableElement=JSDialog.FindFocusableElement(currentSelectedTabPage,"next");
firstSelectableElement.focus()}else if(key==="ARROWRIGHT"){this.getNextTab("right")}else if(
key==="ARROWLEFT"){this.getNextTab("left")}else{if(this.combination===null){this.combination=key;
this.checkCombinationAgainstAcccelerators();this.filterOutNonMatchingInfoBoxes()}else{
this.combination+=key;this.checkCombinationAgainstAcccelerators();
this.filterOutNonMatchingInfoBoxes()}if(this.filteredItem!==null&&this.clickOnFilteredItem())return;
if(this.isAllFilteredOut()===true)this.focusToMap()}};this.getNextTab=function(move){
var currentSelectedTab=this.getCurrentSelectedTab();var isLeftMovement=move==="left"?true:false;
var tab=isLeftMovement?currentSelectedTab.previousElementSibling:currentSelectedTab.nextElementSibling
if(!tab){var tabs=document.querySelectorAll(".ui-tab.notebookbar:not(.hidden)");
tab=isLeftMovement?tabs[tabs.length-1]:tabs[0]}while(tab){if(!tab.classList.contains("hidden")){
break}tab=isLeftMovement?tab.previousElementSibling:tab.nextElementSibling}this.removeFocusFromTab()
tab.click();tab.focus()};this.removeAllInfoBoxes=function(){
var infoBoxes=document.getElementsByClassName("accessibility-info-box");for(
var i=infoBoxes.length-1;i>-1;i--){document.body.removeChild(infoBoxes[i])}};
this.addTabAccelerators=function(){this.removeAllInfoBoxes();
this.tabInfoList=this.definitions.getDefinitions();for(var tabId in this.tabInfoList){if(
Object.prototype.hasOwnProperty.call(this.tabInfoList,tabId)){var element=document.getElementById(
tabId);if(element&&element.offsetParent!==null){element.accessKey=this.tabInfoList[tabId
].combination;this.addInfoBox(element)}}}};this.initTabListeners=function(){Object.keys(
this.tabInfoList).forEach(function(tabId){var element=document.getElementById(tabId);if(element){
element.addEventListener("keydown",function(event){if(event.key==="Alt"){this.focusToMap()}}.bind(
this))}}.bind(this))};this.initAccessibilityInputElement=function(){
this.accessibilityInputElement=document.createElement("input");
this.accessibilityInputElement.type="submit";this.accessibilityInputElement.setAttribute("role",
"tablist");
this.accessibilityInputElement.style.width=this.accessibilityInputElement.style.height="0";
this.accessibilityInputElement.id="accessibilityInputElement";
this.accessibilityInputElement.onfocus=this.onInputFocus.bind(this);
this.accessibilityInputElement.onblur=this.onInputBlur.bind(this);
this.accessibilityInputElement.onkeyup=this.onInputKeyUp.bind(this);
this.accessibilityInputElement.onkeydown=this.onInputKeyDown.bind(this);
this.accessibilityInputElement.autocomplete="off";var container=document.createElement("div");
container.style.width=container.style.height="0";container.style.overflow="hidden";
container.appendChild(this.accessibilityInputElement);document.body.insertBefore(container,
document.body.firstChild)};this.initialize=function(){setTimeout(function(){if(
window.mode.isDesktop()&&!this.initialized){if(
document.body.dataset.userinterfacemode==="notebookbar"){
this.tabInfoList=this.definitions.getDefinitions();if(this.tabInfoList!==null){
this.initTabListeners();this.initAccessibilityInputElement();this.initialized=true}}}}.bind(this),
3e3)}};app.definitions.NotebookbarAccessibility=NotebookbarAccessibility;
app.UI.notebookbarAccessibility=new app.definitions.NotebookbarAccessibility;
window.L.Map.mergeOptions({dragging:true});window.L.Map.Drag=window.L.Handler.extend({
addHooks:function(){if(!this._draggable){var map=this._map;this._draggable=new window.L.Draggable(
map._mapPane,map._container);this._draggable._map=map;this._draggable.on({down:this._onDown,
dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this)
}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){
return this._draggable&&this._draggable._moved},_onDown:function(){this._map.stop()},
_onDragStart:function(){this._dragEdgeOffset=new cool.Point(0,0);var map=this._map;map.fire(
"movestart").fire("dragstart")},_onDrag:function(e){if(window.IgnorePanning)return;this._map.fire(
"move",e).fire("drag",e)},_onPreDrag:function(){var org=this._map.getPixelOrigin();
var pos=this._map._getMapPanePos();var size=this._map.getLayerMaxBounds().getSize().subtract(
this._map.getSize());this._draggable._newPos=this._draggable._newPos.add(this._dragEdgeOffset);if(
this._draggable._newPos.x!==pos.x){let clampedX=Math.max(Math.min(org.x,this._draggable._newPos.x),
org.x-Math.max(size.x,0));this._dragEdgeOffset.x+=clampedX-this._draggable._newPos.x;
this._draggable._newPos.x=clampedX}if(this._draggable._newPos.y!==pos.y){let clampedY=Math.max(
Math.min(org.y,this._draggable._newPos.y),org.y-Math.max(size.y,0));
this._dragEdgeOffset.y+=clampedY-this._draggable._newPos.y;this._draggable._newPos.y=clampedY}},
_onDragEnd:function(e){var map=this._map;map.fire("dragend",e);map.fire("moveend")}});
window.L.Map.mergeOptions({scrollHandler:true,wheelDebounceTime:40,wheelZoomStepEndAfter:500,
zoomLevelStepSize:.3});window.L.Map.Scroll=window.L.Handler.extend({
_mouseOnlyPreventDefault:window.touch.mouseOnly(window.L.DomEvent.preventDefault),addHooks:function(
){window.L.DomEvent.on(this._map._container,{wheel:this._onWheelScroll,
mousewheel:this._onWheelScroll,MozMousePixelScroll:this._mouseOnlyPreventDefault},this);
this._delta=0;this._vertical=1;this.lastY=0;this.lastX=0},removeHooks:function(){
window.L.DomEvent.off(this._map._container,{mousewheel:this._onWheelScroll,
MozMousePixelScroll:this._mouseOnlyPreventDefault},this)},_onWheelScroll:window.touch.mouseOnly(
function(e){var delta=-1*e.deltaY;var debounce=this._map.options.wheelDebounceTime;this._delta=delta
var viewCenter=this._map.getCenter();var mousePos=this._map.mouseEventToLatLng(e);
var docLayer=this._map._docLayer;if(docLayer&&docLayer.isCalc()){this._zoomCenter=mousePos}else if(
docLayer&&docLayer.isWriter()){var part=docLayer._currentPage;
var rectangle=app.file.writer.pageRectangleList[part];var minX=Math.round(rectangle[0
]*app.twipsToPixels);var maxX=minX+Math.round(rectangle[2]*app.twipsToPixels);
var viewBounds=this._map.getPixelBoundsCore();
var useMouseXCenter=viewBounds.min.x>=0&&viewBounds.max.x<=maxX;
this._zoomCenter=new window.L.LatLng(mousePos.lat,useMouseXCenter?mousePos.lng:viewCenter.lng)}else{
this._zoomCenter=viewCenter}if(!this._startTime){this._startTime=+new Date}var left=Math.max(
debounce-(+new Date-this._startTime),0);clearTimeout(this._timer);if(e.ctrlKey){
this._timer=setTimeout(window.L.bind(this._performZoom,this),left)}window.L.DomEvent.stop(e)}),
_performZoom:function(){if(this._map.getDocType()==="spreadsheet"
)OtherViewCellCursorSection.closePopups();var lastScrollTime=this._zoomScrollTime;
this._zoomScrollTime=new Date;var map=this._map;var mapZoom=map.getZoom();
var newAnimation=!lastScrollTime||this._zoomScrollTime-lastScrollTime>this._map.options.wheelZoomStepEndAfter
if(newAnimation&&this._inZoomAnimation){this._zoomScrollTime=undefined;return}var delta=this._delta;
map.stop();delta=delta>0?Math.ceil(delta):Math.floor(delta);delta=Math.max(Math.min(delta,1),-1);
this._delta=0;this._startTime=null;if(!delta){return}var prevZoom=newAnimation?mapZoom:this._zoom;
this._zoom=map._limitZoom(prevZoom+delta);if(newAnimation&&this._zoom===mapZoom){
this._zoomScrollTime=undefined;return}this._stopZoomInterpolateRAFAt=this._zoomScrollTime.valueOf(
)+this._map.options.wheelZoomStepEndAfter;if(newAnimation){this._inZoomAnimation=true;
this._map._docLayer.preZoomAnimation(this._zoomCenter);
this._zoomInterpolateRAF=requestAnimationFrame(this._zoomInterpolateRAFFunc.bind(this))}},
_zoomInterpolateRAFFunc:function(){var lastZoom=this._lastFrameZoom||this._map.getZoom();
var toZoom=this._zoom;var step=this._map.options.zoomLevelStepSize;var zoomOut=toZoom<lastZoom;
var frameZoom=zoomOut?Math.max(toZoom,lastZoom-step):Math.min(toZoom,lastZoom+step);if(
frameZoom!==toZoom)this._map._docLayer.zoomStep(frameZoom,this._zoomCenter);
this._lastFrameZoom=frameZoom;var now=(new Date).valueOf();if(now<this._stopZoomInterpolateRAFAt
)this._zoomInterpolateRAF=requestAnimationFrame(this._zoomInterpolateRAFFunc.bind(this)
);else this._stopZoomAnimation()},_stopZoomAnimation:function(){cancelAnimationFrame(
this._zoomInterpolateRAF);var zoom=this._zoom;var lastCenter=new window.L.LatLng(
this._zoomCenter.lat,this._zoomCenter.lng);var map=this._map;map._docLayer.zoomStepEnd(zoom,
lastCenter,function(newMapCenter){map.setView(newMapCenter||lastCenter,zoom)},function(){
map._docLayer.postZoomAnimation();this._inZoomAnimation=false}.bind(this),true)}});
window.L.Map.mergeOptions({doubleClickZoom:false});
window.L.Map.DoubleClickZoom=window.L.Handler.extend({addHooks:function(){this._map.on("dblclick",
this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)
},_onDoubleClick:window.touch.mouseOnly(function(e){var map=this._map,oldZoom=map.getZoom(),
zoom=e.originalEvent.shiftKey?Math.ceil(oldZoom)-1:Math.floor(oldZoom)+1;if(
map.options.doubleClickZoom==="center"){map.setZoom(zoom)}else{map.setZoomAround(e.containerPoint,
zoom)}})});window.L.extend(window.L.DomEvent,{
POINTER_DOWN:window.L.Browser.msPointer?"MSPointerDown":"pointerdown",
POINTER_MOVE:window.L.Browser.msPointer?"MSPointerMove":"pointermove",
POINTER_UP:window.L.Browser.msPointer?"MSPointerUp":"pointerup",
POINTER_CANCEL:window.L.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:{},
_pointersCount:0,addPointerListener:function(obj,type,handler,id){if(type==="touchstart"){
this._addPointerStart(obj,handler,id)}else if(type==="touchmove"){this._addPointerMove(obj,handler,
id)}else if(type==="touchend"){this._addPointerEnd(obj,handler,id)}return this},
removePointerListener:function(obj,type,id){var handler=obj["_leaflet_"+type+id];if(
type==="touchstart"){obj.removeEventListener(this.POINTER_DOWN,handler,false)}else if(
type==="touchmove"){obj.removeEventListener(this.POINTER_MOVE,handler,false)}else if(
type==="touchend"){obj.removeEventListener(this.POINTER_UP,handler,false);obj.removeEventListener(
this.POINTER_CANCEL,handler,false)}return this},_addPointerStart:function(obj,handler,id){
var onDown=window.L.bind(function(e){window.L.DomEvent.preventDefault(e);this._handlePointer(e,
handler)},this);obj["_leaflet_touchstart"+id]=onDown;obj.addEventListener(this.POINTER_DOWN,onDown,
false);if(!this._pointerDocListener){var pointerUp=window.L.bind(this._globalPointerUp,this);
document.documentElement.addEventListener(this.POINTER_DOWN,window.L.bind(this._globalPointerDown,
this),true);document.documentElement.addEventListener(this.POINTER_MOVE,window.L.bind(
this._globalPointerMove,this),true);document.documentElement.addEventListener(this.POINTER_UP,
pointerUp,true);document.documentElement.addEventListener(this.POINTER_CANCEL,pointerUp,true);
this._pointerDocListener=true}},_globalPointerDown:function(e){this._pointers[e.pointerId]=e;
this._pointersCount++},_globalPointerMove:function(e){if(this._pointers[e.pointerId]){
this._pointers[e.pointerId]=e}},_globalPointerUp:function(e){delete this._pointers[e.pointerId];
this._pointersCount--},_handlePointer:function(e,handler){e.touches=[];for(var i in this._pointers){
e.touches.push(this._pointers[i])}e.changedTouches=[e];handler(e)},_addPointerMove:function(obj,
handler,id){var onMove=window.L.bind(function(e){if((
e.pointerType===e.MSPOINTER_TYPE_MOUSE||e.pointerType==="mouse")&&e.buttons===0){return}
this._handlePointer(e,handler)},this);obj["_leaflet_touchmove"+id]=onMove;obj.addEventListener(
this.POINTER_MOVE,onMove,false)},_addPointerEnd:function(obj,handler,id){var onUp=window.L.bind(
function(e){this._handlePointer(e,handler)},this);obj["_leaflet_touchend"+id]=onUp;
obj.addEventListener(this.POINTER_UP,onUp,false);obj.addEventListener(this.POINTER_CANCEL,onUp,false
)}});window.L.Map.mergeOptions({touchGesture:true});
window.L.Map.TouchGesture=window.L.Handler.extend({statics:{MAP:1,CURSOR:2,GRAPHIC:4,MARKER:8,
TABLE:16},initialize:function(map){window.L.Handler.prototype.initialize.call(this,map);
this._state=window.L.Map.TouchGesture.MAP;if(!this._hammer){this._hammer=new Hammer(
this._map._mapPane);this._hammer.get("swipe").set({direction:Hammer.DIRECTION_ALL});
this._hammer.get("pan").set({direction:Hammer.DIRECTION_ALL});this._hammer.get("pinch").set({
enable:true});this._hammer.get("press").set({time:500});this._hammer.get("swipe").set({threshold:5})
var singleTap=this._hammer.get("tap");var doubleTap=this._hammer.get("doubletap");
var posThreshold=100;doubleTap.options.posThreshold=posThreshold;var tripleTap=new Hammer.Tap({
event:"tripletap",taps:3,posThreshold:posThreshold});this._hammer.add(tripleTap);
tripleTap.recognizeWith([doubleTap,singleTap]);var hammer=this._hammer;window.L.DomEvent.on(
this._map._mapPane,"touchstart touchmove touchcancel",window.touch.touchOnly(
window.L.DomEvent.preventDefault));window.L.DomEvent.on(this._map._mapPane,"touchend",
window.touch.touchOnly(function(e){if(hammer.input){if(hammer.input.store){hammer.input.store=[]}}
window.L.DomEvent.preventDefault(e)}));if(Hammer.prefixed(window,"PointerEvent")!==undefined){
window.L.DomEvent.on(this._map._mapPane,"pointerdown pointermove pointerup pointercancel",
window.touch.touchOnly(window.L.DomEvent.preventDefault))}if(
window.MSPointerEvent&&!window.PointerEvent){window.L.DomEvent.on(this._map._mapPane,
"MSPointerDown MSPointerMove MSPointerUp MSPointerCancel",window.touch.touchOnly(
window.L.DomEvent.preventDefault))}window.L.DomEvent.on(this._map._mapPane,
"mousedown mousemove mouseup",window.L.DomEvent.preventDefault);window.L.DomEvent.on(document,
"touchmove",window.L.DomEvent.preventDefault)}for(var events in window.L.Draggable.MOVE){
window.L.DomEvent.on(document,window.L.Draggable.END[events],this._onDocUp,this)}if(
this._hammer.input instanceof Hammer.TouchInput){var $doc=$(document);$doc.on("click.contextMenu",
".context-menu-item",function(e){var $elem=$(this);if($elem.data(
).contextMenu.selector===".leaflet-layer"){$.contextMenu.handle.itemClick.apply(this,[e])}})}},
addHooks:function(){this._hammer.on("hammer.input",window.memo.bind(window.touch.touchOnly(
this._onHammer),this));this._hammer.on("tap",window.memo.bind(window.touch.touchOnly(this._onTap),
this));this._hammer.on("panstart",window.memo.bind(window.touch.touchOnly(this._onPanStart),this));
this._hammer.on("pan",window.memo.bind(window.touch.touchOnly(this._onPan),this));this._hammer.on(
"panend",window.memo.bind(window.touch.touchOnly(this._onPanEnd),this));this._hammer.on("pinchstart"
,window.memo.bind(window.touch.touchOnly(this._onPinchStart),this));this._hammer.on("pinchmove",
window.memo.bind(window.touch.touchOnly(this._onPinch),this));this._hammer.on("pinchend",
window.memo.bind(window.touch.touchOnly(this._onPinchEnd),this));this._hammer.on("tripletap",
window.memo.bind(window.touch.touchOnly(this._onTripleTap),this));this._hammer.on("swipe",
window.memo.bind(window.touch.touchOnly(this._onSwipe),this));app.events.on("updatepermission",
this._onPermission.bind(this));this._onPermission({detail:{perm:this._map._permission}})},
removeHooks:function(){this._hammer.off("hammer.input",window.memo.bind(window.touch.touchOnly(
this._onHammer),this));this._hammer.off("tap",window.memo.bind(window.touch.touchOnly(this._onTap),
this));this._hammer.off("panstart",window.memo.bind(window.touch.touchOnly(this._onPanStart),this));
this._hammer.off("pan",window.memo.bind(window.touch.touchOnly(this._onPan),this));this._hammer.off(
"panend",window.memo.bind(window.touch.touchOnly(this._onPanEnd),this));this._hammer.off(
"pinchstart",window.memo.bind(window.touch.touchOnly(this._onPinchStart),this));this._hammer.off(
"pinchmove",window.memo.bind(window.touch.touchOnly(this._onPinch),this));this._hammer.off(
"pinchend",window.memo.bind(window.touch.touchOnly(this._onPinchEnd),this));this._hammer.off(
"doubletap",window.memo.bind(window.touch.touchOnly(this._onDoubleTap),this));this._hammer.off(
"press",window.memo.bind(window.touch.touchOnly(this._onPress),this));this._hammer.off("tripletap",
window.memo.bind(window.touch.touchOnly(this._onTripleTap),this));this._hammer.off("swipe",
window.memo.bind(window.touch.touchOnly(this._onSwipe),this))},_onPermission:function(e){if(
e.detail.perm=="edit"){this._hammer.on("doubletap",window.memo.bind(window.touch.touchOnly(
this._onDoubleTap),this));this._hammer.on("press",window.memo.bind(window.touch.touchOnly(
this._onPress),this))}else{this._hammer.off("doubletap",window.memo.bind(window.touch.touchOnly(
this._onDoubleTap),this));this._hammer.off("press",window.memo.bind(window.touch.touchOnly(
this._onPress),this))}},_onHammer:function(e){if(this._map.uiManager.isUIBlocked())return;
app.idleHandler.notifyActive();function getFuncWizRangeBounds(obj){for(var i in obj._map._layers){
if(obj._map._layers[i].options&&obj._map._layers[i].options.fillColor&&obj._map._layers[i
].options.fillOpacity){if(obj._map._layers[i].options.fillColor==="#ef0fff"&&obj._map._layers[i
].options.fillOpacity===.25){return obj._map._layers[i]._bounds}}}}if(e.isFirst){
var point=e.pointers[0],containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),funcWizardRangeBounds=getFuncWizRangeBounds(this);
let twipsPoint=this._map._docLayer._latLngToTwips(latlng);twipsPoint=new cool.SimplePoint(
twipsPoint.x,twipsPoint.y);if(
app.calc.cellCursorVisible&&app.calc.cellCursorRectangle.containsPoint(twipsPoint.toArray())){
this._state=window.L.Map.TouchGesture.CURSOR}else if(
app.calc.cellCursorVisible&&funcWizardRangeBounds&&funcWizardRangeBounds.contains(latlng)){
this._state=window.L.Map.TouchGesture.CURSOR}else{this._state=window.L.Map.TouchGesture.MAP}
this._moving=false}if(e.isLast&&this._state!==window.L.Map.TouchGesture.MAP){
this._state=window.L.Map.TouchGesture.hitTest.MAP;this._moving=false}if($(e.srcEvent.target).has(
this._map._mapPane)){window.L.DomEvent.preventDefault(e.srcEvent);window.L.DomEvent.stopPropagation(
e.srcEvent)}},_onDocUp:function(){if(!this._map.touchGesture.enabled()){
this._map.touchGesture.enable()}window.IgnorePanning=undefined},_onPress:function(e){if(
this._map.uiManager.isUIBlocked())return;var point=e.pointers[0],
containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),mousePos=this._map._docLayer._latLngToTwips(latlng);let posInTwips=new cool.SimplePoint(
mousePos.x,mousePos.y);if(this._moving){return}this._map.fire("closepopups");var that=this;
var docLayer=this._map._docLayer;var singleClick=function(){docLayer._postMouseEvent("buttondown",
mousePos.x,mousePos.y,1,1,0);docLayer._postMouseEvent("buttonup",mousePos.x,mousePos.y,1,1,0)};
var doubleClick=function(){docLayer._postMouseEvent("buttondown",mousePos.x,mousePos.y,2,1,0);
docLayer._postMouseEvent("buttonup",mousePos.x,mousePos.y,2,1,0)};var rightClick=function(){
docLayer._postMouseEvent("buttondown",mousePos.x,mousePos.y,1,4,0)};
var waitForSelectionMsg=function(){var graphicSelection=GraphicSelection.rectangle;if(
!docLayer._cursorAtMispelledWord&&(!graphicSelection||!graphicSelection.containsPoint(
posInTwips.toArray()))&&(!app.calc.cellCursorVisible||!app.calc.cellCursorRectangle.containsPoint(
posInTwips.toArray()))){doubleClick()}that._map._contextMenu._onMouseDown({originalEvent:e.srcEvent}
);rightClick()};var graphicSelection=GraphicSelection.rectangle;var bContainsSel=false;if(
app.calc.cellCursorVisible)bContainsSel=docLayer.containsSelection(latlng);var textSelection;if(
TextSelections.getStartRectangle()&&TextSelections.getEndRectangle()){
textSelection=new cool.SimpleRectangle(0,TextSelections.getEndRectangle().y1,
app.activeDocument.fileSize.x,0);textSelection.height=TextSelections.getEndRectangle(
).rectangle.y2-TextSelections.getStartRectangle().y1}if(textSelection&&textSelection.containsPoint(
posInTwips.toArray())||graphicSelection&&graphicSelection.containsPoint(posInTwips.toArray()
)||app.calc.cellCursorVisible&&app.calc.cellCursorRectangle.containsPoint(posInTwips.toArray()
)||bContainsSel){this._map._contextMenu._onMouseDown({originalEvent:e.srcEvent});rightClick()}else{
singleClick();setTimeout(waitForSelectionMsg,300)}app.idleHandler.notifyActive();e.preventDefault()
},_onTap:function(e){if(this._map.uiManager.isUIBlocked())return;if(e.tapCount>1)return;
var point=e.pointers[0],containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),mousePos=this._map._docLayer._latLngToTwips(latlng);let posInTwips=new cool.SimplePoint(
mousePos.x,mousePos.y);this._map.fire("closemobilewizard");var dropDownMarkers;if(
this._map._docLayer.isWriter()){dropDownMarkers=document.getElementsByClassName(
"html-object-section writer-drop-down-marker")}else if(this._map._docLayer.isCalc()){
dropDownMarkers=document.getElementsByClassName("leaflet-marker-icon spreadsheet-drop-down-marker")}
if(dropDownMarkers&&dropDownMarkers.length==1&&dropDownMarkers[0]&&e.target){if(
e.target==dropDownMarkers[0])return;else{let section=app.sectionContainer.getSectionWithName(
app.CSections.ContentControl.name);if(section){section=section.sectionProperties.dropdownSection;if(
section&&section.containsPoint(posInTwips.pToArray())){section.onClick();return}}}}this._map.fire(
"closepopups");this._map.fire("editorgotfocus");var docLayer=this._map._docLayer;if(
app.sectionContainer.doesSectionExist(app.CSections.CommentList.name)){
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).unselect()}
this._map._contextMenu._onMouseDown({originalEvent:e.srcEvent});var acceptInput=false;
var sendMouseEvents=true;if(docLayer){if(GraphicSelection.hasActiveSelection()){
acceptInput=app.file.textCursor.visible}else if(docLayer._docType==="text"){acceptInput=true
}else if(docLayer._docType==="spreadsheet"){
acceptInput=app.calc.cellCursorVisible&&app.calc.cellCursorRectangle.containsPoint(
posInTwips.toArray());if(acceptInput){if(this._map.isEditMode()){docLayer.postKeyboardEvent("input",
0,769);sendMouseEvents=false}}}}if(sendMouseEvents){docLayer._postMouseEvent("buttondown",mousePos.x
,mousePos.y,1,1,0);docLayer._postMouseEvent("buttonup",mousePos.x,mousePos.y,1,1,0)}
this._cancelAutoScroll=true;this._map.focus(acceptInput)},_onDoubleTap:function(e){if(
this._map.uiManager.isUIBlocked())return;var point=e.pointers[0],
containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),mousePos=this._map._docLayer._latLngToTwips(latlng);var docLayer=this._map._docLayer;if(
docLayer){if(docLayer._docType==="spreadsheet"&&!GraphicSelection.hasActiveSelection()){if(
this._map.isEditMode()){docLayer.postKeyboardEvent("input",0,769)}}else{docLayer._postMouseEvent(
"buttondown",mousePos.x,mousePos.y,2,1,0);docLayer._postMouseEvent("buttonup",mousePos.x,mousePos.y,
2,1,0)}var acceptInput=!GraphicSelection.hasActiveSelection()||app.file.textCursor.visible;if(
navigator.platform==="iPhone"&&docLayer._docType==="presentation")acceptInput=true;this._map.focus(
acceptInput)}},_onTripleTap:function(e){if(this._map.uiManager.isUIBlocked())return;
var point=e.pointers[0],containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),mousePos=this._map._docLayer._latLngToTwips(latlng);this._map._docLayer._postMouseEvent(
"buttondown",mousePos.x,mousePos.y,1,1,8192);this._map._docLayer._postMouseEvent("buttonup",
mousePos.x,mousePos.y,1,1,8192)},_onPanStart:function(e){if(this._map.uiManager.isUIBlocked())return
if(window.IgnorePanning)return;app.util.cancelAnimFrame(this.autoscrollAnimReq);
var point=e.pointers[0],containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),mousePos=this._map._docLayer._latLngToTwips(latlng);let posInTwips=new cool.SimplePoint(
mousePos.x,mousePos.y);let increaseRatio=.4;let increasedCellCursor=null;if(
app.calc.cellCursorVisible){increasedCellCursor=app.calc.cellCursorRectangle.clone();
increasedCellCursor.y1-=increasedCellCursor.height*increaseRatio;
increasedCellCursor.y2+=increasedCellCursor.height*increaseRatio}if(
increasedCellCursor&&increasedCellCursor.containsPoint(posInTwips.toArray())){if(
!app.calc.cellCursorRectangle.containsPoint(posInTwips.toArray())){let y=posInTwips.y;
let x=posInTwips.x;let heightBuffer=Math.abs(app.calc.cellCursorRectangle.pHeight)*increaseRatio;if(
y<app.calc.cellCursorRectangle.y2){y=y+heightBuffer}if(y>app.calc.cellCursorRectangle.y1){
y=y-heightBuffer}mousePos=new cool.Point(x,y)}}if(this._state===window.L.Map.TouchGesture.CURSOR){
this._map._docLayer._postMouseEvent("buttondown",mousePos.x,mousePos.y,1,1,0)}else{
this._map.dragging._draggable._onDown(this._constructFakeEvent(point,"mousedown"))}
var acceptInput=this._map.canAcceptKeyboardInput();this._map.focus(acceptInput)},_onPan:function(e){
if(this._map.uiManager.isUIBlocked())return;if(window.IgnorePanning)return;if(
this._inSwipeAction&&Math.abs(e.velocity)<this._hammer.get("swipe").options.velocity){
this._cancelAutoscrollRAF()}var point=e.pointers[0],
containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),mousePos=this._map._docLayer._latLngToTwips(latlng);if(
this._state===window.L.Map.TouchGesture.CURSOR){this._map._docLayer._postMouseEvent("move",
mousePos.x,mousePos.y,1,1,0)}else if(this._map.scrollingIsHandled===false){
this._map.dragging._draggable._onMove(this._constructFakeEvent(point,"mousemove"))}
app.idleHandler.notifyActive()},_onPanEnd:function(e){if(this._map.uiManager.isUIBlocked())return;
if(window.IgnorePanning)return;var point=e.pointers[0],
containerPoint=this._map.mouseEventToContainerPoint(point),
layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(
layerPoint),mousePos=this._map._docLayer._latLngToTwips(latlng);if(
this._state===window.L.Map.TouchGesture.CURSOR){this._map._docLayer._postMouseEvent("buttonup",
mousePos.x,mousePos.y,1,1,0)}else{this._map.dragging._draggable._onUp(this._constructFakeEvent(point
,"mouseup"))}var acceptInput=this._map.canAcceptKeyboardInput();this._map.focus(acceptInput)},
_onPinchStart:function(e){if(this._map.uiManager.isUIBlocked())return;if(this._inSwipeAction){
this._cancelAutoscrollRAF()}if(isNaN(e.center.x)||isNaN(e.center.y))return;this._pinchStartCenter={
x:e.center.x,y:e.center.y};const _pinchStartLatLng=this._map.mouseEventToLatLng({clientX:e.center.x,
clientY:e.center.y});this._map._docLayer.preZoomAnimation(_pinchStartLatLng)},_onPinch:function(e){
if(this._map.uiManager.isUIBlocked())return;if(!this._pinchStartCenter||isNaN(e.center.x)||isNaN(
e.center.y))return;var offset={x:e.center.x-this._pinchStartCenter.x,
y:e.center.y-this._pinchStartCenter.y};var center={x:this._pinchStartCenter.x-offset.x,
y:this._pinchStartCenter.y-offset.y};this._zoom=this._map._limitZoom(this._map.getScaleZoom(e.scale)
);this._origCenter=this._map.mouseEventToLatLng({clientX:center.x,clientY:center.y});if(
this._map._docLayer.zoomStep){this._map._docLayer.zoomStep(this._zoom,this._origCenter)}
app.idleHandler.notifyActive()},_onPinchEnd:function(){if(this._map.uiManager.isUIBlocked())return;
if(!this._pinchStartCenter)return;var oldZoom=this._map.getZoom();var zoomDelta=this._zoom-oldZoom;
var finalZoom=this._map._limitZoom(zoomDelta>0?Math.ceil(this._zoom):Math.floor(this._zoom));
this._pinchStartCenter=undefined;if(this._map._docLayer.zoomStepEnd){var thisObj=this;
this._map._docLayer.zoomStepEnd(finalZoom,this._origCenter,function(newMapCenter){
thisObj._map.setView(newMapCenter,finalZoom)},function(){thisObj._map._docLayer.postZoomAnimation()}
)}},_constructFakeEvent:function(evt,type){var fakeEvt={type:type,canBubble:false,cancelable:true,
screenX:evt.screenX,screenY:evt.screenY,clientX:evt.clientX,clientY:evt.clientY,ctrlKey:false,
altKey:false,shiftKey:false,metaKey:false,button:0,target:evt.target,preventDefault:function(){}};
return fakeEvt},_onSwipe:function(e){if(this._map.uiManager.isUIBlocked())return;if(
window.IgnorePanning)return;let velocityX=this._map._docLayer.isCalcRTL()?-e.velocityX:e.velocityX;
let pointVelocity=new cool.Point(velocityX,e.velocityY);if(this._inSwipeAction){
this._velocity=this._velocity.add(pointVelocity)}else{this._velocity=pointVelocity}
this._amplitude=this._velocity.multiplyBy(32);this._newPos=window.L.DomUtil.getPosition(
this._map._mapPane);var evt=this._constructFakeEvent({clientX:e.center.x,clientY:e.center.y,
target:this._map._mapPane},"mousedown");this._startSwipePoint=new cool.Point(evt.clientX,evt.clientY
);this._map.dragging._draggable._onDown(evt);this._timeStamp=Date.now();this._inSwipeAction=true;
this.autoscrollAnimReq=app.util.requestAnimFrame(this._autoscroll,this);
app.idleHandler.notifyActive()},_cancelAutoscrollRAF:function(){this._cancelAutoScroll=false;
this._inSwipeAction=false;if(app.file.fileBasedView)this._map._docLayer._checkSelectedPart();
app.util.cancelAnimFrame(this.autoscrollAnimReq);return},_autoscroll:function(){if(
this._cancelAutoScroll===true){this._cancelAutoscrollRAF();return}var elapsed,delta;
elapsed=Date.now()-this._timeStamp;delta=this._amplitude.multiplyBy(Math.exp(-elapsed/650));
var e=this._constructFakeEvent({clientX:delta.x+this._startSwipePoint.x,
clientY:delta.y+this._startSwipePoint.y,target:this._map._mapPane},"mousemove");e.autoscroll=true;
if(delta.x>.2||delta.x<-.2||delta.y>.2||delta.y<-.2){var org=this._map.getPixelOrigin();
var docSize=this._map.getLayerMaxBounds().getSize().subtract(this._map.getSize());var horizontalEnd,
verticalEnd;if(this._map.getDocSize().x<this._map.getSize().x){delta.x=0;horizontalEnd=true}else{
horizontalEnd=Math.max(Math.min(org.x,this._newPos.x),org.x-Math.max(docSize.x,0))!==this._newPos.x}
if(this._map.getDocSize().y<this._map.getSize().y){delta.y=0;verticalEnd=true}else{
verticalEnd=Math.max(Math.min(org.y,this._newPos.y),org.y-Math.max(docSize.y,0))!==this._newPos.y}
this._map.dragging._draggable._startPoint=this._startSwipePoint;
this._map.dragging._draggable._startPos=this._newPos;this._newPos._add(delta);
this._map.dragging._draggable._onMove(e);TileManager.clearPreFetch();TileManager.preFetchTiles(true)
if(!horizontalEnd||!verticalEnd){this.autoscrollAnimReq=app.util.requestAnimFrame(this._autoscroll,
this)}else{this._inSwipeAction=false;if(app.file.fileBasedView
)this._map._docLayer._checkSelectedPart()}}else{this._map.dragging._draggable._onUp(e);
this._inSwipeAction=false;if(app.file.fileBasedView)this._map._docLayer._checkSelectedPart()}}});
window.L.Map.mergeOptions({keyboard:true,keyboardPanOffset:20,keyboardZoomOffset:1});
window.L.Map.Keyboard=window.L.Handler.extend({keymap:{8:UNOKey.BACKSPACE,9:UNOKey.TAB,
13:UNOKey.RETURN,16:null,17:null,18:null,19:null,20:null,27:UNOKey.ESCAPE,32:UNOKey.SPACE,
33:UNOKey.PAGEUP,34:UNOKey.PAGEDOWN,35:UNOKey.END,36:UNOKey.HOME,37:UNOKey.LEFT,38:UNOKey.UP,
39:UNOKey.RIGHT,40:UNOKey.DOWN,45:UNOKey.INSERT,46:UNOKey.DELETE,48:UNOKey.NUM0,49:UNOKey.NUM1,
50:UNOKey.NUM2,51:UNOKey.NUM3,52:UNOKey.NUM4,53:UNOKey.NUM5,54:UNOKey.NUM6,55:UNOKey.NUM7,
56:UNOKey.NUM8,57:UNOKey.NUM9,65:UNOKey.A,66:UNOKey.B,67:UNOKey.C,68:UNOKey.D,69:UNOKey.E,
70:UNOKey.F,71:UNOKey.G,72:UNOKey.H,73:UNOKey.I,74:UNOKey.J,75:UNOKey.K,76:UNOKey.L,77:UNOKey.M,
78:UNOKey.N,79:UNOKey.O,80:UNOKey.P,81:UNOKey.Q,82:UNOKey.R,83:UNOKey.S,84:UNOKey.T,85:UNOKey.U,
86:UNOKey.V,87:UNOKey.W,88:UNOKey.X,89:UNOKey.Y,90:UNOKey.Z,91:null,92:null,93:UNOKey.CONTEXTMENU,
96:UNOKey.NUM0,97:UNOKey.NUM1,98:UNOKey.NUM2,99:UNOKey.NUM3,100:UNOKey.NUM4,101:UNOKey.NUM5,
102:UNOKey.NUM6,103:UNOKey.NUM7,104:UNOKey.NUM8,105:UNOKey.NUM9,106:UNOKey.MULTIPLY,107:UNOKey.ADD,
109:UNOKey.SUBTRACT,110:UNOKey.DECIMAL,111:UNOKey.DIVIDE,112:UNOKey.F1,113:UNOKey.F2,114:UNOKey.F3,
115:UNOKey.F4,116:UNOKey.F5,117:UNOKey.F6,118:UNOKey.F7,119:UNOKey.F8,120:UNOKey.F9,121:UNOKey.F10,
122:UNOKey.F11,123:UNOKey.F12,144:UNOKey.NUMLOCK,145:UNOKey.SCROLLLOCK,173:UNOKey.SUBTRACT,
186:UNOKey.SEMICOLON,187:UNOKey.EQUAL,188:UNOKey.COMMA,189:UNOKey.SUBTRACT,190:null,191:null,
192:null,219:null,220:null,221:null,222:null},handleOnKeyDownKeys:{9:true,19:true,20:true,27:true,
33:true,34:true,35:true,36:true,37:true,38:true,39:true,40:true,45:true,93:true,113:true},keyCodes:{
pageUp:33,pageDown:34,enter:13,BACKSPACE:8,TAB:9,SPACE:32,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,
CAPSLOCK:20,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46,
NUM0:[48,96],NUM1:[49,97],NUM2:[50,98],NUM3:[51,99],NUM4:[52,100],NUM5:[53,101],NUM6:[54,102],NUM7:[
55,103],NUM8:[56,103],NUM9:[57,104],A:65,B:66,C:[67,99],D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,
L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:[86,118],W:87,X:[88,120],Y:89,Z:90,
LEFTWINDOWKEY:[91,91],RIGHTWINDOWKEY:[92,93],CONTEXTMENU:93,MULTIPLY:106,ADD:107,DECIMAL:110,
DIVIDE:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,
NUMLOCK:144,SCROLLLOCK:145,SUBTRACT:[109,173,189],SEMICOLON:186,EQUAL:187,COMMA:188,PERIOD:190,
FORWARDSLASH:191,GRAVEACCENT:192,OPENBRACKET:219,BACKSLASH:220,CLOSEBRACKET:221,SINGLEQUOTE:222},
navigationKeyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,
173]},allowedKeyCodeWhenNotEditing:{27:true,33:true,34:true,13:true,8:true,16:true,17:true,18:true,
19:true,20:true,35:true,36:true,45:true,46:true,91:true,92:true,93:true,112:true,113:true,114:true,
115:true,116:true,117:true,118:true,119:true,120:true,121:true,122:true,123:true,144:true,145:true},
initialize:function(map){this._map=map;this._setPanOffset(map.options.keyboardPanOffset);
this._setZoomOffset(map.options.keyboardZoomOffset);this.modifier=0;
window.KeyboardShortcuts.initialize(map)},addHooks:function(){var container=this._map._container;if(
container.tabIndex===-1){container.tabIndex="0"}window.L.DomEvent.on(this._map.getContainer(),
"keydown keyup keypress",this._onKeyDown,this);window.L.DomEvent.on(window.document,"keydown",
this._globalKeyEvent,this)},removeHooks:function(){window.L.DomEvent.off(this._map.getContainer(),
"keydown keyup keypress",this._onKeyDown,this);window.L.DomEvent.off(window.document,"keydown",
this._globalKeyEvent,this)},_ignoreKeyEvent:function(ev){var shift=ev.shiftKey?UNOModifier.SHIFT:0;
if(shift&&(ev.keyCode===this.keyCodes.INSERT||ev.keyCode===this.keyCodes.DELETE)){return true}},
_setPanOffset:function(pan){var keys={},codes=this.navigationKeyCodes,i,len;for(i=0,
len=codes.left.length;i<len;i++){keys[codes.left[i]]=[-1*pan,0]}for(i=0,
len=codes.right.length;i<len;i++){keys[codes.right[i]]=[pan,0]}for(i=0,
len=codes.down.length;i<len;i++){keys[codes.down[i]]=[0,pan]}for(i=0,len=codes.up.length;i<len;i++){
keys[codes.up[i]]=[0,-1*pan]}},_setZoomOffset:function(zoom){var keys=this._zoomKeys={},
codes=this.navigationKeyCodes,i,len;for(i=0,len=codes.zoomIn.length;i<len;i++){keys[codes.zoomIn[i]
]=zoom}for(i=0,len=codes.zoomOut.length;i<len;i++){keys[codes.zoomOut[i]]=-zoom}},
_toUNOKeyCode:function(keyCode){return this.keymap[keyCode]||keyCode},_onKeyDown:function(ev){if(
this._map.uiManager.isUIBlocked()||this._map._docLayer&&(
this._map._docLayer._docType==="presentation"||this._map._docLayer._docType==="drawing"
)&&this._map._docLayer._preview.partsFocused===true)return;if(this._map._debug.logKeyboardEvents){
window.app.console.log("keyboard handler:",ev.type,ev.key,ev.charCode,this._expectingInput,ev)}
var completeEvent=app.socket.createCompleteTraceEvent("L.Map.Keyboard._onKeyDown",{type:ev.type,
charCode:ev.charCode});if(ev.charCode==0){this._handleKeyEvent(ev)}if(this._map._docLayer)if(
ev.shiftKey&&ev.type==="keydown")this._map._docLayer.shiftKeyPressed=true;else if(
ev.keyCode===this.keyCodes.SHIFT&&ev.type==="keyup")this._map._docLayer.shiftKeyPressed=false;if(
completeEvent)completeEvent.finish()},_globalKeyEvent:function(ev){if(
this._map.uiManager.isUIBlocked())return;if(ev.shortCutActivated===true){window.app.console.log(
"Shortcut for: "+ev.code+" already handled");return}if(window.KeyboardShortcuts.processEvent(
app.UI.language.fromURL,ev)){return}if(this._map.jsdialog&&(this._map.jsdialog.hasDialogOpened(
)||this._map.jsdialog.hasSnackbarOpened()||this._map.jsdialog.hasDropdownOpened()
)&&this._map.jsdialog.handleKeyEvent(ev)){ev.preventDefault();return}else if(this._map._docLayer&&(
this._map._docLayer._docType==="presentation"||this._map._docLayer._docType==="drawing"
)&&this._map._docLayer._preview.partsFocused===true){if(!this.modifier&&(
ev.keyCode===this.keyCodes.DOWN||ev.keyCode===this.keyCodes.UP||ev.keyCode===this.keyCodes.RIGHT||ev.keyCode===this.keyCodes.LEFT||ev.keyCode===this.keyCodes.PAGEDOWN||ev.keyCode===this.keyCodes.PAGEUP||ev.keyCode===this.keyCodes.DELETE||ev.keyCode===this.keyCodes.BACKSPACE
)&&ev.type==="keydown"){
var deletePart=ev.keyCode===this.keyCodes.DELETE||ev.keyCode===this.keyCodes.BACKSPACE?true:false;
if(!deletePart){
var partToSelect=ev.keyCode===this.keyCodes.UP||ev.keyCode===this.keyCodes.LEFT||ev.keyCode===this.keyCodes.PAGEUP?"prev":"next"
this._map.deselectAll();this._map.setPart(partToSelect);if(app.file.fileBasedView
)this._map._docLayer._checkSelectedPart()}else if(this._map.isEditMode(
)&&!app.file.fileBasedView&&this._map.jsdialog&&!this._map.jsdialog.hasDialogOpened()){
this._map.deletePage(this._map._docLayer._selectedPart)}ev.preventDefault();return}else if(
ev.ctrlKey){if(!ev.altKey&&ev.keyCode===this.keyCodes.HOME)this._map.setPart(0);else if(
!ev.altKey&&ev.keyCode===this.keyCodes.END)this._map.setPart(this._map._docLayer._parts-1);else{
this._handleCtrlCommand(ev);return}}else{this._map._docLayer._preview.partsFocused=false}}else if(
this._isCtrlKey(ev)&&ev.keyCode===this.keyCodes.S){if(!this._map.isReadOnlyMode()&&!this._map["wopi"
].HideSaveOption){this._map.fire("postMessage",{msgId:"UI_Save",args:{source:"keyboard"}});if(
!this._map._disableDefaultAction["UI_Save"]){this._map.save(false,false)}}ev.preventDefault()}},
_handleKeyEvent:function(ev,keyEventFn){if(this._map.uiManager.isUIBlocked())return;
app.idleHandler.notifyActive();if(
this._map.slideShow&&this._map.slideShow.fullscreen||this._map.slideShowPresenter&&this._map.slideShowPresenter.isFullscreen(
)){return}if(ev.code==="NumpadDecimal"
)this._map.numPadDecimalPressed=true;else this._map.numPadDecimalPressed=false;
var docLayer=this._map._docLayer;if(docLayer)this._map.userList.followUser(docLayer._viewId,false);
if(window.KeyboardShortcuts.processEvent(app.UI.language.fromURL,ev)){ev.shortCutActivated=true;
return}if(!keyEventFn&&docLayer&&docLayer.postKeyboardEvent){keyEventFn=window.L.bind(
docLayer.postKeyboardEvent,docLayer)}this.modifier=0;var shift=ev.shiftKey?UNOModifier.SHIFT:0;
var ctrl=ev.ctrlKey||ev.metaKey?UNOModifier.CTRL:0;var alt=ev.altKey?UNOModifier.ALT:0;
var location=ev.location;this.modifier=shift|ctrl|alt;if(ctrl&&alt){if(
ev.type==="keydown"&&location===2){this._prevCtrlAltLocation=location;return}else if(location===1){
this._prevCtrlAltLocation=undefined}if(this._prevCtrlAltLocation===2&&location===0){if(
ev.type==="keypress"){ctrl=alt=this.modifier=0}else{return}}}if(ctrl){if(this._handleCtrlCommand(ev)
){return}}var charCode=ev.charCode;var keyCode=ev.keyCode;var DEFAULT=0;if((
this.modifier==UNOModifier.ALT||this.modifier==UNOModifier.SHIFT+UNOModifier.ALT
)&&keyCode>=this.keyCodes.NUM0[DEFAULT]){this.modifier-=alt;alt=0}var unoKeyCode=this._toUNOKeyCode(
keyCode);if(this.modifier){unoKeyCode|=this.modifier;if(ev.type!=="keyup"&&(
this.modifier!==shift||keyCode===this.keyCodes.SPACE&&!app.file.textCursor.visible)){if(keyEventFn){
keyEventFn("input",charCode,unoKeyCode);ev.preventDefault()}return}}if(
this._map.stateChangeHandler._items[".uno:SlideMasterPage"]==="true"){ev.preventDefault();return}if(
this._map.isEditMode()){TileManager.resetPreFetching();if(this._ignoreKeyEvent(ev)){}else if(
ev.type==="keydown"){if(this.handleOnKeyDownKeys[keyCode]&&charCode===0){if(keyEventFn){keyEventFn(
"input",charCode,unoKeyCode);if(!(this._map._textInput.hasAccessibilitySupport(
)&&this._map._textInput.hasFocus()&&(keyCode===this.keyCodes.LEFT||keyCode===this.keyCodes.RIGHT))){
ev.preventDefault()}else{window.app.console.log(
"Map.Keyboard._handleKeyEvent: default not prevented for left or right arrow.")}}}if(
this._map._debug.tileInvalidationsOn){this._map._debug.addTileInvalidationKeypress()}}else if(
ev.type==="keypress"&&(!this.handleOnKeyDownKeys[keyCode]||charCode!==0)){if(
keyCode===this.keyCodes.BACKSPACE||keyCode===this.keyCodes.DELETE||keyCode===this.keyCodes.enter){
window.app.console.log("Ignore backspace/delete/enter keypress");return}if(
charCode===keyCode&&charCode!==this.keyCodes.enter){keyCode=0;unoKeyCode=this._toUNOKeyCode(keyCode)
}if(this._map._debug.tileInvalidationsOn){this._map._debug.addTileInvalidationKeypress()}if(
keyEventFn){keyEventFn("input",charCode,unoKeyCode)}}else if(ev.type==="keyup"){if(
this.handleOnKeyDownKeys[keyCode]&&charCode===0||this.modifier||unoKeyCode===UNOKey.RETURN){if(
keyEventFn){keyEventFn("up",charCode,unoKeyCode)}}else{}}if(keyCode===this.keyCodes.TAB){
ev.preventDefault()}}else if(ev.type==="keydown"){var key=ev.keyCode;var map=this._map;if([
"ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(ev.code)){keyEventFn("input",
charCode,unoKeyCode)}else if(key in this._zoomKeys){map.setZoom(map.getZoom()+(ev.shiftKey?3:1
)*this._zoomKeys[key],null,true)}}window.L.DomEvent.stopPropagation(ev)},_isCtrlKey:function(e){if(
window.ThisIsTheiOSApp||window.L.Browser.mac)return e.metaKey;else return e.ctrlKey},
_handleCtrlCommand:function(e){var DEFAULT=0;var MAC=1;if(this._map.uiManager.isUIBlocked())return;
if(e.keyCode==this.keyCodes.CTRL)return true;if(e.type!=="keydown"&&e.keyCode!==this.keyCodes.C[
DEFAULT]&&e.keyCode!==this.keyCodes.V[DEFAULT]&&e.keyCode!==this.keyCodes.X[DEFAULT
]&&e.keyCode!==this.keyCodes.C[MAC]&&e.keyCode!==this.keyCodes.V[MAC]&&e.keyCode!==this.keyCodes.X[
MAC]){e.preventDefault();return true}if(this._isCtrlKey(e)&&e.keyCode===this.keyCodes.INSERT){
return true}if(e.keyCode!==this.keyCodes.C[DEFAULT]&&e.keyCode!==this.keyCodes.V[DEFAULT
]&&e.keyCode!==this.keyCodes.X[DEFAULT]&&e.keyCode!==this.keyCodes.C[MAC
]&&e.keyCode!==this.keyCodes.V[MAC]&&e.keyCode!==this.keyCodes.X[MAC]){e.preventDefault()}if(
this._isCtrlKey(e)&&e.altKey&&e.keyCode===this.keyCodes.N){this._map.fire("postMessage",{
msgId:"UI_CreateFile",args:{DocumentType:this._map.getDocType()}});e.preventDefault();return true}
if(this._isCtrlKey(e)&&e.shiftKey&&e.keyCode===this.keyCodes.L&&this._map.getDocType(
)!=="text"&&this._map.getDocType()!=="spreadsheet"){app.socket.sendMessage("uno .uno:DefaultBullet")
e.preventDefault();return true}if(this._isCtrlKey(e)&&e.altKey&&e.keyCode===this.keyCodes.O){
this._map.fire("postMessage",{msgId:"UI_OpenDocument"});e.preventDefault();return true}if(
this._isCtrlKey(e)&&e.shiftKey&&e.key==="?"){this._map.showHelp("keyboard-shortcuts-content");
e.preventDefault();return true}if(
!window.ThisIsAMobileApp&&e.ctrlKey&&e.shiftKey&&e.altKey&&this.keyCodes.V.includes(e.keyCode)){
this._map._clip._openPasteSpecialPopup();return true}if(this._isCtrlKey(e
)&&e.shiftKey&&this.keyCodes.V.includes(e.keyCode)){return true}if(this._isCtrlKey(e
)&&e.keyCode===this.keyCodes.F1){if(this._map.uiManager.getCurrentMode()==="notebookbar"){if(
this._map.uiManager.isNotebookbarCollapsed())this._map.uiManager.extendNotebookbar(
);else this._map.uiManager.collapseNotebookbar()}return true}if(this._isCtrlKey(e
)&&!e.shiftKey&&e.keyCode===this.keyCodes.K){this._map.sendUnoCommand(".uno:HyperlinkDialog");
e.preventDefault();return true}if(this._isCtrlKey(e)&&e.keyCode===this.keyCodes.Y||this._isCtrlKey(e
)&&e.shiftKey&&e.keyCode===this.keyCodes.Z){app.socket.sendMessage("uno .uno:Redo");
e.preventDefault();return true}if(this._isCtrlKey(e)&&e.keyCode===this.keyCodes.Z){
app.socket.sendMessage("uno .uno:Undo");e.preventDefault();return true}if(e.altKey||e.shiftKey){if((
this.keyCodes.C.includes(e.keyCode)||e.keyCode===this.keyCodes.R)&&e.altKey){
this._map.insertComment();return true}if(!e.shiftKey){switch(e.keyCode){case this.keyCodes.NUM5[
DEFAULT]:app.socket.sendMessage("uno .uno:Strikeout");return true;case this.keyCodes.F:
app.socket.sendMessage("uno .uno:InsertFootnote");return true;case this.keyCodes.C[DEFAULT]:
case this.keyCodes.M:this._map.insertComment();return true;case this.keyCodes.D:
app.socket.sendMessage("uno .uno:InsertEndnote");return true;case this.keyCodes.pageUp:
case this.keyCodes.pageDown:if(this._map.getDocType()==="spreadsheet"){
var currentSelectedPart=this._map._docLayer._selectedPart;var parts=this._map._docLayer._parts;
var partToSelect=0;this._map._docLayer._clearReferences();if(e.keyCode===this.keyCodes.pageDown){
partToSelect=currentSelectedPart!=parts-1?currentSelectedPart+1:0}else{
partToSelect=currentSelectedPart!=0?currentSelectedPart-1:parts-1}this._map.setPart(parseInt(
partToSelect),false,true);return}}}else if(e.altKey){switch(e.keyCode){case this.keyCodes.D:
this._map._debug.toggle()}}return false}if(e.type==="keydown"&&window.ThisIsAMobileApp){if(
this.keyCodes.C.includes(e.keyCode)){app.socket.sendMessage("uno .uno:Copy");return true}else if(
this.keyCodes.V.includes(e.keyCode)){app.socket.sendMessage("uno .uno:Paste");return true}else if(
this.keyCodes.X.includes(e.keyCode)){app.socket.sendMessage("uno .uno:Cut");return true}if(
window.ThisIsTheAndroidApp)e.preventDefault()}switch(e.keyCode){case this.keyCodes.NUM3[DEFAULT]:if(
this._map.getDocType()==="spreadsheet"){app.socket.sendMessage(
"uno .uno:SetOptimalColumnWidthDirect");app.socket.sendMessage(
"commandvalues command=.uno:ViewRowColumnHeaders");return true}return false;case this.keyCodes.NUM5[
DEFAULT]:if(this._map.getDocType()==="spreadsheet"){app.socket.sendMessage("uno .uno:Strikeout");
return true}return false;case this.keyCodes.C[DEFAULT]:case this.keyCodes.X[DEFAULT]:
case this.keyCodes.C[MAC]:case this.keyCodes.X[MAC]:case this.keyCodes.LEFTWINDOWKEY[MAC]:
case this.keyCodes.RIGHTWINDOWKEY[MAC]:
var slidePreviewFocused=this._map._docLayer._preview&&this._map._docLayer._preview.partsFocused;if(
!slidePreviewFocused)this._map.focus();return true;case this.keyCodes.P:this._map.print();
return true;case this.keyCodes.S:return true;case this.keyCodes.V[DEFAULT]:case this.keyCodes.V[MAC
]:return true;case this.keyCodes.F1:app.socket.sendMessage("uno .uno:NoteVisible");return true;
case this.keyCodes.COMMA:app.socket.sendMessage("uno .uno:SubScript");return true;
case this.keyCodes.PERIOD:app.socket.sendMessage("uno .uno:SuperScript");return true}if(
e.type==="keypress"&&(e.ctrlKey||e.metaKey)&&(this.keyCodes.C.includes(e.keyCode
)||this.keyCodes.V.includes(e.keyCode)||this.keyCodes.X.includes(e.keyCode))){return true}
return false}});var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
function isCtrlKey(e){if(window.ThisIsTheiOSApp||window.L.Browser.mac
)return e.metaKey;else return e.ctrlKey}function isMacCtrlKey(e){if(
window.ThisIsTheiOSApp||window.L.Browser.mac)return e.ctrlKey;else return false}var Mod;(function(
Mod){Mod[Mod["NONE"]=0]="NONE";Mod[Mod["CTRL"]=1]="CTRL";Mod[Mod["ALT"]=2]="ALT";Mod[Mod["SHIFT"]=4
]="SHIFT";Mod[Mod["MACCTRL"]=8]="MACCTRL"})(Mod||(Mod={}));var ViewType;(function(ViewType){
ViewType[ViewType["Edit"]=0]="Edit";ViewType[ViewType["ReadOnly"]=1]="ReadOnly"})(ViewType||(
ViewType={}));var Platform;(function(Platform){Platform[Platform["ANDROIDAPP"]=1]="ANDROIDAPP";
Platform[Platform["IOSAPP"]=2]="IOSAPP";Platform[Platform["MAC"]=4]="MAC";Platform[Platform[
"WINDOWS"]=8]="WINDOWS";Platform[Platform["LINUX"]=16]="LINUX";Platform[Platform["CHROMEOSAPP"]=32
]="CHROMEOSAPP"})(Platform||(Platform={}));var ShortcutDescriptor=function(){
function ShortcutDescriptor(_a){var _b=_a.docType,docType=_b===void 0?null:_b,eventType=_a.eventType
,_c=_a.modifier,modifier=_c===void 0?Mod.NONE:_c,_d=_a.keyCode,keyCode=_d===void 0?null:_d,_e=_a.key
,key=_e===void 0?null:_e,_f=_a.unoAction,unoAction=_f===void 0?null:_f,_g=_a.dispatchAction,
dispatchAction=_g===void 0?null:_g,_h=_a.viewType,viewType=_h===void 0?null:_h,_j=_a.preventDefault,
preventDefault=_j===void 0?true:_j,_k=_a.platform,platform=_k===void 0?null:_k;app.console.assert(
keyCode!==null||key!==null,
"registering a keyboard shortcut without specifying either a key or a keyCode - this will result in an untriggerable shortcut"
);this.docType=docType;this.eventType=eventType;this.modifier=modifier;this.keyCode=keyCode;
this.key=key;this.unoAction=unoAction;this.dispatchAction=dispatchAction;this.viewType=viewType;
this.preventDefault=preventDefault;this.platform=platform}return ShortcutDescriptor}();
var KeyboardShortcuts=function(){function KeyboardShortcuts(){this.definitions=new Map}
KeyboardShortcuts.prototype.findShortcut=function(language,eventType,modifier,keyCode,key,platform){
var descriptors=this.definitions.get(language);if(!descriptors){return undefined}
var docType=this.map._docLayer?this.map._docLayer._docType:"";var viewType=this.map.isEditMode(
)?ViewType.Edit:ViewType.ReadOnly;var shortcuts=descriptors.filter(function(descriptor){
var keyMatches=descriptor.key===key;var keyCodeMatches=Array.isArray(descriptor.keyCode
)?descriptor.keyCode.includes(keyCode):descriptor.keyCode===keyCode;return(
!descriptor.docType||descriptor.docType===docType)&&(Array.isArray(descriptor.eventType
)?descriptor.eventType.includes(eventType):descriptor.eventType===eventType
)&&descriptor.modifier===modifier&&(descriptor.viewType===null||descriptor.viewType===viewType)&&(
!descriptor.platform||descriptor.platform&platform)&&(keyMatches||keyCodeMatches)});if(
shortcuts.length>1){throw"Multiple definitions of the same keyboard shortcut"}if(shortcuts.length){
return shortcuts[0]}return undefined};KeyboardShortcuts.prototype.processEventImpl=function(language
,event){var eventType=event.type;var ctrl=isCtrlKey(event);var shift=event.shiftKey;
var alt=event.altKey;var keyCode=event.which;var key=event.key;var macctrl=isMacCtrlKey(event);
var modifier=(ctrl?Mod.CTRL:Mod.NONE)|(shift?Mod.SHIFT:Mod.NONE)|(alt?Mod.ALT:Mod.NONE)|(
macctrl?Mod.MACCTRL:Mod.NONE);var platform=window.mode.isChromebook(
)?Platform.CHROMEOSAPP:window.ThisIsTheAndroidApp?Platform.ANDROIDAPP:window.ThisIsTheiOSApp?Platform.IOSAPP:window.L.Browser.mac?Platform.MAC:window.L.Browser.win?Platform.WINDOWS:Platform.LINUX
var shortcut=this.findShortcut(language,eventType,modifier,keyCode,key,platform);if(shortcut){
var action="disabled";if(shortcut.unoAction){action=shortcut.unoAction;this.map.sendUnoCommand(
action)}else if(shortcut.dispatchAction){action=shortcut.dispatchAction;app.dispatcher.dispatch(
action)}if(shortcut.preventDefault){event.preventDefault()}console.debug(
"handled keyboard shortcut: "+action);return true}return false};
KeyboardShortcuts.prototype.initialize=function(map){this.map=map;if(window.L.Browser.cypressTest){
this.map.on("docloaded",function(){keyboardShortcuts.verifyShortcuts()})}};
KeyboardShortcuts.prototype.processEvent=function(language,event){if(!this.map){
throw"KeyboardShortcuts not initialized"}if(this.processEventImpl(language,event)){return true}
return this.processEventImpl("default",event)};KeyboardShortcuts.prototype.verifyShortcuts=function(
){var _this=this;console.debug("KeyboardShortcuts.verifyShortcuts start");this.definitions.forEach(
function(shortcuts,language){shortcuts.forEach(function(shortcut){var e_1,_a,e_2,_b;
var shortcutEventTypes=Array.isArray(shortcut.eventType)?shortcut.eventType:[shortcut.eventType];
var shortcutKeyCodes=Array.isArray(shortcut.keyCode)?shortcut.keyCode:[shortcut.keyCode];try{for(
var shortcutEventTypes_1=__values(shortcutEventTypes),
shortcutEventTypes_1_1=shortcutEventTypes_1.next(
);!shortcutEventTypes_1_1.done;shortcutEventTypes_1_1=shortcutEventTypes_1.next()){
var eventType=shortcutEventTypes_1_1.value;try{for(var shortcutKeyCodes_1=(e_2=void 0,__values(
shortcutKeyCodes)),shortcutKeyCodes_1_1=shortcutKeyCodes_1.next(
);!shortcutKeyCodes_1_1.done;shortcutKeyCodes_1_1=shortcutKeyCodes_1.next()){
var keyCode=shortcutKeyCodes_1_1.value;if(keyCode===null){continue}_this.findShortcut(language,
eventType,shortcut.modifier,keyCode,undefined,shortcut.platform)}}catch(e_2_1){e_2={error:e_2_1}
}finally{try{if(shortcutKeyCodes_1_1&&!shortcutKeyCodes_1_1.done&&(_b=shortcutKeyCodes_1.return)
)_b.call(shortcutKeyCodes_1)}finally{if(e_2)throw e_2.error}}if(shortcut.key===null){continue}
_this.findShortcut(language,eventType,shortcut.modifier,undefined,shortcut.key,shortcut.platform)}
}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
shortcutEventTypes_1_1&&!shortcutEventTypes_1_1.done&&(_a=shortcutEventTypes_1.return))_a.call(
shortcutEventTypes_1)}finally{if(e_1)throw e_1.error}}})});console.debug(
"KeyboardShortcuts.verifyShortcuts finished")};return KeyboardShortcuts}();
var keyboardShortcuts=new KeyboardShortcuts;keyboardShortcuts.definitions.set("default",new Array(
new ShortcutDescriptor({eventType:"keydown",key:"F1",dispatchAction:"showhelp"}),
new ShortcutDescriptor({eventType:"keydown",modifier:Mod.ALT,key:"F1",
dispatchAction:"focustonotebookbar"}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,
key:"а",dispatchAction:"home-search"}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,
key:"f",dispatchAction:"home-search"}),new ShortcutDescriptor({docType:"spreadsheet",
eventType:"keydown",modifier:Mod.CTRL|Mod.SHIFT,key:"PageUp"}),new ShortcutDescriptor({
docType:"spreadsheet",eventType:"keydown",modifier:Mod.CTRL|Mod.SHIFT,key:"PageDown"}),
new ShortcutDescriptor({docType:"spreadsheet",eventType:"keydown",key:"F5"}),new ShortcutDescriptor(
{docType:"spreadsheet",eventType:"keydown",modifier:Mod.CTRL,key:",",
unoAction:".uno:InsertCurrentDate"}),new ShortcutDescriptor({docType:"spreadsheet",
eventType:"keydown",modifier:Mod.CTRL,key:";",unoAction:".uno:InsertCurrentDate"}),
new ShortcutDescriptor({docType:"text",eventType:"keydown",key:"F2"}),new ShortcutDescriptor({
docType:"text",eventType:"keydown",key:"F3",unoAction:".uno:ExpandGlossary"}),
new ShortcutDescriptor({docType:"text",eventType:"keydown",modifier:Mod.CTRL,key:"F3"}),
new ShortcutDescriptor({docType:"text",eventType:"keydown",key:"F5"}),new ShortcutDescriptor({
docType:"presentation",eventType:"keydown",key:"F5",dispatchAction:"presentation"}),
new ShortcutDescriptor({docType:"presentation",eventType:"keydown",key:"PageUp",
dispatchAction:"previouspart",viewType:ViewType.ReadOnly}),new ShortcutDescriptor({
docType:"presentation",eventType:"keydown",key:"PageDown",dispatchAction:"nextpart",
viewType:ViewType.ReadOnly}),new ShortcutDescriptor({docType:"drawing",eventType:"keydown",key:"F5"}
),new ShortcutDescriptor({docType:"drawing",eventType:"keydown",key:"PageUp",
dispatchAction:"previouspart",viewType:ViewType.ReadOnly}),new ShortcutDescriptor({
docType:"drawing",eventType:"keydown",key:"PageDown",dispatchAction:"nextpart",
viewType:ViewType.ReadOnly}),new ShortcutDescriptor({docType:"drawing",eventType:"keydown",
key:"End",dispatchAction:"lastpart",viewType:ViewType.ReadOnly}),new ShortcutDescriptor({
docType:"drawing",eventType:"keydown",key:"Home",dispatchAction:"firstpart",
viewType:ViewType.ReadOnly}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.ALT|Mod.CTRL,
key:"p",dispatchAction:"userlist"}),new ShortcutDescriptor({eventType:"keydown",
modifier:Mod.CTRL|Mod.SHIFT,key:"I",preventDefault:false,platform:Platform.WINDOWS|Platform.LINUX}),
new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL|Mod.ALT,keyCode:73,
preventDefault:false,platform:Platform.MAC}),new ShortcutDescriptor({eventType:["keydown","keypress"
],modifier:Mod.CTRL|Mod.MACCTRL,key:" ",preventDefault:false,platform:Platform.MAC|Platform.IOSAPP})
,new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,key:"r",preventDefault:false,
platform:Platform.MAC}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL|Mod.SHIFT,
key:"R",preventDefault:false,platform:Platform.WINDOWS|Platform.LINUX}),new ShortcutDescriptor({
eventType:"keydown",modifier:Mod.CTRL,key:"m",preventDefault:false,platform:Platform.MAC}),
new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,key:"q",preventDefault:false,
platform:Platform.MAC}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,key:"w",
preventDefault:false}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,key:"n",
preventDefault:false}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,key:"t",
preventDefault:false}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL,key:"`",
preventDefault:false,platform:Platform.MAC})));keyboardShortcuts.definitions.set("de",new Array(
new ShortcutDescriptor({eventType:"keydown",key:"F12",dispatchAction:"saveas"}),
new ShortcutDescriptor({docType:"presentation",eventType:"keydown",modifier:Mod.SHIFT,key:"F9",
unoAction:".uno:GridVisible"}),new ShortcutDescriptor({docType:"presentation",eventType:"keydown",
modifier:Mod.SHIFT,key:"F3",unoAction:".uno:ChangeCaseRotateCase"}),new ShortcutDescriptor({
docType:"presentation",eventType:"keydown",modifier:Mod.SHIFT,key:"F5",dispatchAction:"presentation"
}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.SHIFT|Mod.CTRL,key:"F",
unoAction:".uno:Bold"}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.SHIFT|Mod.CTRL,
key:"K",unoAction:".uno:Italic"}),new ShortcutDescriptor({eventType:"keydown",
modifier:Mod.SHIFT|Mod.CTRL,key:"U",unoAction:".uno:Underline"}),new ShortcutDescriptor({
docType:"text",eventType:"keydown",modifier:Mod.SHIFT,key:"F3",unoAction:".uno:ChangeCaseRotateCase"
}),new ShortcutDescriptor({docType:"text",eventType:"keydown",key:"F5",unoAction:".uno:GoToPage"}),
new ShortcutDescriptor({docType:"text",eventType:"keydown",modifier:Mod.ALT|Mod.CTRL,key:"s",
dispatchAction:"home-search"}),new ShortcutDescriptor({docType:"spreadsheet",eventType:"keydown",
modifier:Mod.SHIFT,key:"F3",unoAction:".uno:FunctionDialog"}),new ShortcutDescriptor({
docType:"spreadsheet",eventType:"keydown",modifier:Mod.SHIFT,key:"F2",dispatchAction:"insertcomment"
}),new ShortcutDescriptor({docType:"spreadsheet",eventType:"keydown",key:"F4",
dispatchAction:"togglerelative"}),new ShortcutDescriptor({docType:"spreadsheet",eventType:"keydown",
key:"F9",unoAction:".uno:Calculate"}),new ShortcutDescriptor({docType:"spreadsheet",
eventType:"keydown",key:"F5",dispatchAction:"focusonaddressinput"}),new ShortcutDescriptor({
docType:"spreadsheet",eventType:"keydown",modifier:Mod.ALT,key:"0",unoAction:".uno:FormatCellDialog"
}),new ShortcutDescriptor({eventType:"keydown",modifier:Mod.CTRL|Mod.SHIFT,key:"`",
preventDefault:false,platform:Platform.MAC})));window.KeyboardShortcuts=keyboardShortcuts;
window.L.Map.mergeOptions({welcome:true});window.L.Map.Welcome=window.L.Handler.extend({
_getLocalWelcomeUrl:function(){var welcomeLocation=app.LOUtil.getURL("/welcome/welcome.html");if(
window.socketProxy)welcomeLocation=window.makeWsUrl(welcomeLocation);return welcomeLocation},
initialize:function(map){window.L.Handler.prototype.initialize.call(this,map);this._map.on(
"updateviewslist",this.onUpdateList,this);this._url=this._getLocalWelcomeUrl();this._retries=2;
this._fallback=false},addHooks:function(){window.L.DomEvent.on(window,"message",this.onMessage,this)
this.remove()},isGuest:function(){var docLayer=this._map._docLayer||{};
var viewInfo=this._map._viewInfo[docLayer._viewId];
return viewInfo&&viewInfo.userextrainfo&&viewInfo.userextrainfo.is_guest},onUpdateList:function(){
if(!this.isGuest()&&window.autoShowWelcome&&this.shouldWelcome()){this.showWelcomeDialog()}},
shouldWelcome:function(){let storedVersion=window.prefs.get("WSDWelcomeVersion");
let currentVersion=app.socket.WSDServer.Version;let welcomeDisabledCookie=window.prefs.getBoolean(
"WSDWelcomeDisabled");let welcomeDisabledDate=window.prefs.get("WSDWelcomeDisabledDate");if(
welcomeDisabledDate)welcomeDisabledDate=welcomeDisabledDate.replaceAll("-"," ");
let isWelcomeDisabled=false;if(welcomeDisabledCookie&&welcomeDisabledDate){var currentDate=new Date;
if(welcomeDisabledDate===currentDate.toDateString())isWelcomeDisabled=true;else{window.prefs.remove(
"WSDWelcomeDisabled");window.prefs.remove("WSDWelcomeDisabledDate")}}if((
!storedVersion||storedVersion!==currentVersion)&&!isWelcomeDisabled){return true}return false},
showWelcomeDialog:function(){if(this._iframeWelcome&&this._iframeWelcome.queryContainer()
)this.remove();var uiTheme=window.prefs.getBoolean("darkTheme")?"dark":"light";var params=[{
ui_theme:uiTheme}];this._iframeWelcome=window.L.iframeDialog(this._url,params,null,{
prefix:"iframe-welcome"});this._iframeWelcome._iframe.title=_("Welcome Dialog")},
removeHooks:function(){window.L.DomEvent.off(window,"message",this.onMessage,this);this.remove()},
remove:function(){if(this._iframeWelcome){this._iframeWelcome.remove();delete this._iframeWelcome}},
onMessage:function(e){if(typeof e.data!=="string")return;if(e.data.startsWith("updatecheck-show")
)return;var data=JSON.parse(e.data);if(data.MessageId==="welcome-show"){this._iframeWelcome.show()
}else if(data.MessageId=="welcome-translate"){this._iframeWelcome.clearTimeout();
var keys=Object.keys(data.strings);for(var it in keys){data.strings[keys[it]]=_(keys[it]).replace(
"{coolversion}",window.coolwsdVersion)}this._iframeWelcome.postMessage(data)}else if(
data.MessageId==="welcome-close"){window.prefs.set("WSDWelcomeVersion",app.socket.WSDServer.Version)
this.remove()}else if(data.MessageId=="iframe-welcome-load"&&!this._iframeWelcome.isVisible()){if(
this._retries-- >0){this.remove();setTimeout(window.L.bind(this.showWelcomeDialog,this),200)
}else if(this._fallback){var currentDate=new Date;window.prefs.set("WSDWelcomeDisabled",true);
window.prefs.set("WSDWelcomeDisabledDate",currentDate.toDateString().replaceAll(" ","-"));
this.remove()}else{this._url=this._getLocalWelcomeUrl();this._fallback=true;setTimeout(
window.L.bind(this.showWelcomeDialog,this),200)}}}});if(
!window.L.Browser.cypressTest&&window.enableWelcomeMessage&&window.prefs.canPersist){
window.L.Map.addInitHook("addHandler","welcome",window.L.Map.Welcome)}window.L.Map.mergeOptions({
feedback:!window.ThisIsAMobileApp,feedbackTimeout:3e4});
window.L.Map.Feedback=window.L.Handler.extend({addHooks:function(){this.initialized=false;if(
this._map.wopi)this._map.on("updateviewslist",this.onUpdateList,this);else this._map.on("docloaded",
this.onDocLoaded,this);window.L.DomEvent.on(window,"message",this.onMessage,this)},
removeHooks:function(){window.L.DomEvent.off(window,"message",this.onMessage,this)},
removeIframe:function(){if(this._iframeDialog)this._iframeDialog.remove()},onUpdateList:function(){
var docLayer=this._map._docLayer||{};if(docLayer&&docLayer._viewId==0)this.onDocLoaded()},
onDocLoaded:function(){if(this.initialized)return;this.initialized=true;if(window.prefs.getBoolean(
"WSDFeedbackEnabled",true)){var laterDate=new Date;var currentDate=new Date;
var timeValue=window.prefs.getNumber("WSDFeedbackLaterDate");var docCount=window.prefs.getNumber(
"WSDFeedbackCount",0);docCount++;window.prefs.set("WSDFeedbackCount",docCount);if(isNaN(timeValue)){
laterDate.setTime(currentDate.getTime()-5e3)}else{laterDate.setTime(timeValue+432e6)}if(
docCount>15&&currentDate>laterDate&&window.autoShowFeedback)setTimeout(window.L.bind(this.onFeedback
,this),this._map.options.feedbackTimeout)}},onFeedback:function(){if(
this._map.welcome&&this._map.welcome.isVisible&&this._map.welcome.isVisible()){setTimeout(
window.L.bind(this.onFeedback,this),this._map.options.feedbackTimeout);return}if(
this._map.welcome&&this._map.welcome.isVisible&&this._map.welcome.isVisible())setTimeout(
window.L.bind(this.onFeedback,this),3e3);else{this.askForFeedbackDialog()}},
askForFeedbackDialog:function(){this._map.uiManager.showSnackbar(_("Please send us your feedback"),
_("OK"),this.showFeedbackDialog.bind(this))},showFeedbackDialog:function(){if(
this._iframeDialog&&this._iframeDialog.hasLoaded())this.removeIframe();
var lokitHash=document.querySelector("#lokit-version a");lokitHash=lokitHash?lokitHash.innerText:"";
var wopiHostId=document.querySelector("#wopi-host-id");wopiHostId=wopiHostId?wopiHostId.innerText:""
var proxyPrefixEnabled=window.socketProxy?"True":"False";var cssVar=getComputedStyle(
document.documentElement).getPropertyValue("--co-primary-element");var params=[{
mobile:window.mode.isMobile()},{cssvar:cssVar},{wsdhash:window.app.socket.WSDServer.Hash},{
lokit_hash:lokitHash},{wopi_host_id:wopiHostId},{proxy_prefix_enabled:proxyPrefixEnabled},{
doc_type:this._map.getDocType()}];var options={prefix:"iframe-dialog",id:"iframe-feedback"};
this._iframeDialog=window.L.iframeDialog(window.feedbackUrl,params,null,options)},onError:function(
){window.prefs.remove("WSDFeedbackEnabled");this.removeIframe()},onMessage:function(e){if(
typeof e.data!=="string")return;if(e.data.startsWith("updatecheck-show"))return;var data=e.data;
data=JSON.parse(data).MessageId;if(data=="feedback-show"){this._iframeDialog.show()}else if(
data=="feedback-never"){window.prefs.set("WSDFeedbackEnabled",false);window.prefs.remove(
"WSDFeedbackCount");this.removeIframe()}else if(data=="feedback-later"){var currentDate=new Date;
this.removeIframe();window.prefs.set("WSDFeedbackLaterDate",currentDate.getTime());
window.prefs.remove("WSDFeedbackCount")}else if(data=="feedback-submit"){window.prefs.set(
"WSDFeedbackEnabled",false);window.prefs.remove("WSDFeedbackCount");var that=this;setTimeout(
function(){that._iframeDialog.remove()},400)}else if(
data=="iframe-feedback-load"&&!this._iframeDialog.isVisible()){this.removeIframe();setTimeout(
window.L.bind(this.onFeedback,this),this._map.options.feedbackTimeout)}else if(data.endsWith("close"
)){this.removeIframe()}}});if(window.feedbackUrl&&window.prefs.canPersist){window.L.Map.addInitHook(
"addHandler","feedback",window.L.Map.Feedback)}window.L.Map.mergeOptions({settings:true});
window.L.Map.Settings=window.L.Handler.extend({_iframeDialog:null,_url:"",
_getLocalSettingsUrl:function(){var settingsLocation=app.LOUtil.getURL(
"/admin/adminIntegratorSettings.html");return settingsLocation},initialize:function(map){
window.L.Handler.prototype.initialize.call(this,map);this._url=this._getLocalSettingsUrl()},
addHooks:function(){window.L.DomEvent.on(window,"message",this.onMessage,this)},
removeHooks:function(){window.L.DomEvent.off(window,"message",this.onMessage,this)},
removeIframe:function(){if(this._iframeDialog)this._iframeDialog.remove()},
showSettingsDialog:function(){var _this=this;if(this._iframeDialog&&this._iframeDialog.hasLoaded()
)this.removeIframe();var theme=window.prefs.getBoolean("darkTheme")?"dark":"light";var params=[{
ui_theme:theme},{lang:window.langParam},{mobile:window.mode.isMobile()},{
access_token:window.accessToken},{access_token_ttl:window.accessTokenTTL},{
wopi_setting_base_url:window.wopiSettingBaseUrl}];var options={prefix:"iframe-settings",
stylesheets:[app.LOUtil.getURL("settings.css")],titlebar:_("Options"),modalButtons:[{
id:"iframe-settings-cancel",text:_("Cancel"),align:"right"},{id:"iframe-settings-save",text:_("Save"
),align:"right"}],
dialogCssClass:"jsdialog-container ui-dialog lokdialog_container ui-widget-content",
method:window.socketProxy?"post":"get"};this._iframeDialog=window.L.iframeDialog(this._url,params,
null,options);var cancelButton=document.getElementById("iframe-settings-cancel");
var saveButton=document.getElementById("iframe-settings-save");window.L.DomEvent.on(cancelButton,
"click",function(){_this.removeIframe()},this);window.L.DomEvent.on(saveButton,"click",function(){
_this._iframeDialog.postMessage({MessageId:"settings-save-all"});setTimeout(function(){
_this.removeIframe()},300)},this)},onMessage:function(e){if(typeof e.data!=="string")return;
var data=JSON.parse(e.data);if(data.MessageId==="settings-show"){this._iframeDialog.show()}else if(
data.MessageId==="settings-cancel"){this.removeIframe()}else if(data.MessageId==="settings-ready"){
this._iframeDialog.postMessage(data)}}});if(window.prefs.canPersist){window.L.Map.addInitHook(
"addHandler","settings",window.L.Map.Settings)}window.L.Map.VersionBar=window.L.Handler.extend({
onAdd:function(){this._map.on("adminuser",this.onUpdateInfo,this);this._map.on("versionbar",
this.onversionbar,this)},onRemove:function(){this._map.off("versionbar",this.onversionbar,this);
this._map.off("adminuser",this.onUpdateInfo,this)},onUpdateInfo:function(){if(app.isAdminUser){
var laterDate=new Date;var currentDate=new Date;var timeValue=window.prefs.getNumber(
"InfoBarLaterDate");if(isNaN(timeValue)){laterDate.setTime(currentDate.getTime()-5e3)}else{
timeValue=Number(timeValue);laterDate.setTime(timeValue+432e6)}if(currentDate>laterDate
)app.socket.sendMessage("versionbar")}},onversionbar:function(e){if(e&&e.coolwsd_version){
var latestVersion=e.coolwsd_version.split(".");
var currentVersion=app.socket.WSDServer.Version.split(".");var snackbarMessage=_(
"Your F7 Office server needs updating. Version {0} is available.");var length=Math.max(
latestVersion.length,currentVersion.length);for(var i=0;i<length;i++){
var v1=i<latestVersion.length?parseInt(latestVersion[i]):0;var v2=i<currentVersion.length?parseInt(
currentVersion[i]):0;if(v1>v2){var currentDate=new Date;window.prefs.set("InfoBarLaterDate",
currentDate.getTime());snackbarMessage=snackbarMessage.replace("{0}",e.coolwsd_version);
this._map.uiManager.showSnackbar(snackbarMessage);break}if(v1<v2){break}}}}});if(
window.prefs.canPersist){window.L.Map.versionBar=new window.L.Map.VersionBar}window.L.extend(
window.L.DomEvent,{addMultiClickListener:function(obj,handler,id,type){var last=[],delay=250;
function onClick(e){var now=Date.now();var delta=0;if(last){delta=now-(last[last.length-1]||now)}
var doubleTap=delta>0&&delta<=delay;var tripleTap=false;if(last.length>1&&doubleTap){
var delta2=last[last.length-1]-last[last.length-2];tripleTap=delta2>0&&delta2<=delay}if(tripleTap){
var quadTap=false;if(last.length>2&&tripleTap){var delta3=last[last.length-2]-last[last.length-3];
quadTap=delta3>0&&delta3<=delay}var eOut={type:quadTap?"qdrplclick":"trplclick",clientX:e.clientX,
clientY:e.clientY,button:e.button,target:e.target,pointerType:e.pointerType,
isMouseEvent:e instanceof MouseEvent};if(type==eOut.type)handler(eOut)}last.push(now);while(
last.length>3){last.shift()}}obj["_leaflet_click"+id]=onClick;obj.addEventListener("click",onClick,
false);return this},removeMultiClickListener:function(obj,id){obj.removeEventListener("click",obj[
"_leaflet_click"+id],false);return this}});window.L.Map.mergeOptions({mouse:true});
window.L.Map.Mouse=window.L.Handler.extend({initialize:function(map){this._map=map;
this._mouseEventsQueue=[]},addHooks:function(){this._map.on(
"mousedown mouseup mouseover mouseout mousemove dblclick trplclick qdrplclick",this._onMouseEvent,
this)},removeHooks:function(){this._map.off(
"mousedown mouseup mouseover mouseout mousemove dblclick trplclick qdrplclick",this._onMouseEvent,
this)},LOButtons:{left:1,middle:2,right:4},JSButtons:{left:0,middle:1,right:2},
_isMouseOnValidityDropdown:function(){if(app.sectionContainer){
const section=app.sectionContainer.getSectionWithName(app.CSections.CalcValidityDropDown.name);if(
section)return section.sectionProperties.mouseEntered}return null},
_onMouseEvent:window.touch.mouseOnly(function(e){if(this._map.uiManager.isUIBlocked(
)||app.map.dontHandleMouse)return;if(this._isMouseOnValidityDropdown())return;
app.idleHandler.notifyActive();var docLayer=this._map._docLayer;if(
!docLayer||this._map.rulerActive||this._map.slideShow&&this._map.slideShow.fullscreen||this._map.slideShowPresenter&&this._map.slideShowPresenter.isFullscreen(
)){return}var modifier=0;var shift=e.originalEvent.shiftKey?UNOModifier.SHIFT:0;
var ctrl=e.originalEvent.ctrlKey?UNOModifier.CTRL:0;var alt=e.originalEvent.altKey?UNOModifier.ALT:0
var cmd=e.originalEvent.metaKey?UNOModifier.CTRLMAC:0;modifier=shift|ctrl|alt|cmd;var buttons=0;
buttons|=e.originalEvent.button===this.JSButtons.left?this.LOButtons.left:0;
buttons|=e.originalEvent.button===this.JSButtons.middle?this.LOButtons.middle:0;
buttons|=e.originalEvent.button===this.JSButtons.right?this.LOButtons.right:0;if(
window.L.Browser.mac){if(modifier==UNOModifier.CTRL&&buttons==this.LOButtons.left){modifier=0;
buttons=this.LOButtons.right}}var mouseEnteringLeavingMap=this._map._mouseEnteringLeaving;if(
mouseEnteringLeavingMap&&e.type==="mouseover"&&this._mouseDown){window.L.DomEvent.off(document,
"mousemove",this._onMouseMoveOutside,this);window.L.DomEvent.off(document,"mouseup",
this._onMouseUpOutside,this)}else if(e.type==="mousedown"){TileManager.resetPreFetching();
this._mouseDown=true;this._buttonDown=buttons;if(this._holdMouseEvent){clearTimeout(
this._holdMouseEvent)}var mousePos=docLayer._latLngToTwips(e.latlng);this._mouseEventsQueue.push(
window.L.bind(function(){this._postMouseEvent("buttondown",mousePos.x,mousePos.y,1,buttons,modifier)
},docLayer));this._holdMouseEvent=setTimeout(window.L.bind(this._executeMouseEvents,this),500)
}else if(e.type==="mouseup"){this._mouseDown=false;if(this._map.dragging.enabled()){if(
this._mouseEventsQueue.length===0){return}}
var scrollSection=app.sectionContainer.getSectionWithName(app.CSections.Scroll.name);if(
scrollSection.sectionProperties.mouseIsOnVerticalScrollBar||scrollSection.sectionProperties.mouseIsOnHorizontalScrollBar
)return;if(this._buttonDown===this.LOButtons.right&&modifier===0)return;clearTimeout(
this._holdMouseEvent);this._holdMouseEvent=null;var timeDiff=Date.now()-this._clickTime;if(
this._clickTime&&timeDiff>1&&timeDiff<=250){this._mouseEventsQueue=[];this._clickCount++;if(
this._clickCount<4){this._clickTime=Date.now()}return}else{this._clickTime=Date.now();
this._clickCount=1;mousePos=docLayer._latLngToTwips(e.latlng);var timeOut=0;
this._mouseEventsQueue.push(window.L.bind(function(){var docLayer=this._map._docLayer;
this._mouseEventsQueue=[];docLayer._postMouseEvent("buttonup",mousePos.x,mousePos.y,1,buttons,
modifier);this._map.focus()},this));this._holdMouseEvent=setTimeout(window.L.bind(
this._executeMouseEvents,this),timeOut)}this._map.fire("scrollvelocity",{vx:0,vy:0})}else if(
e.type==="mousemove"&&this._mouseDown){if(this._mouseOverTimeout)clearTimeout(this._mouseOverTimeout
);if(this._holdMouseEvent){clearTimeout(this._holdMouseEvent);this._holdMouseEvent=null;if(
this._map.dragging.enabled()){this._mouseEventsQueue=[];return}for(
var i=0;i<this._mouseEventsQueue.length;i++){this._mouseEventsQueue[i]()}this._mouseEventsQueue=[]}
if(!this._map.dragging.enabled()){mousePos=docLayer._latLngToTwips(e.latlng);
docLayer._postMouseEvent("move",mousePos.x,mousePos.y,1,buttons,modifier);this._map.fire(
"handleautoscroll",{pos:e.containerPoint,map:this._map})}}else if(
e.type==="mousemove"&&!this._mouseDown){clearTimeout(this._mouseOverTimeout);
mousePos=docLayer._latLngToTwips(e.latlng);this._mouseOverTimeout=setTimeout(window.L.bind(function(
){docLayer._postMouseEvent("move",mousePos.x,mousePos.y,1,0,modifier)},this),100)}else if(
e.type==="dblclick"||e.type==="trplclick"||e.type==="qdrplclick"){mousePos=docLayer._latLngToTwips(
e.latlng);var clicks={dblclick:2,trplclick:3,qdrplclick:4};var count=clicks[e.type];
docLayer._postMouseEvent("buttondown",mousePos.x,mousePos.y,count,buttons,modifier);
docLayer._postMouseEvent("buttonup",mousePos.x,mousePos.y,count,buttons,modifier)}else if(
mouseEnteringLeavingMap&&e.type==="mouseout"&&this._mouseDown){window.L.DomEvent.on(document,
"mousemove",this._onMouseMoveOutside,this);window.L.DomEvent.on(document,"mouseup",
this._onMouseUpOutside,this)}}),_executeMouseEvents:function(){this._holdMouseEvent=null;for(
var i=0;i<this._mouseEventsQueue.length;i++){this._mouseEventsQueue[i]()}this._mouseEventsQueue=[]},
_onMouseMoveOutside:window.touch.mouseOnly(function(e){this._map._handleDOMEvent(e);if(
this._map.dragging.enabled()){this._map.dragging._draggable._onMove(e)}}),
_onMouseUpOutside:window.touch.mouseOnly(function(e){this._mouseDown=false;window.L.DomEvent.off(
document,"mousemove",this._onMouseMoveOutside,this);window.L.DomEvent.off(document,"mouseup",
this._onMouseUpOutside,this);this._map._handleDOMEvent(e);if(this._map.dragging.enabled()){
this._map.dragging._draggable._onUp(e)}else if(this._map._docLayer){
const mousePos=this._map._docLayer._latLngToTwips(this._map.mouseEventToLatLng(e));
this._map._docLayer._postMouseEvent("buttonup",mousePos.x,mousePos.y,1,1,0);
const section=app.sectionContainer.getSectionWithName(app.CSections.Scroll.name);if(section
)section.onScrollVelocity({vx:0,vy:0})}})});window.L.Map.mergeOptions({printHandler:true});
window.L.Map.Print=window.L.Handler.extend({initialize:function(map){this._map=map},
addHooks:function(){this._map.on("filedownloadready",this._onFileReady,this)},removeHooks:function(
){this._map.off("filedownloadready",this._onFileReady,this)},_onFileReady:function(e){
var xmlHttp=new XMLHttpRequest;xmlHttp.onreadystatechange=window.L.bind(function(){if(
xmlHttp.readyState===4&&xmlHttp.status===200){this._onInitPrint(xmlHttp)}},this);xmlHttp.open("GET",
e.url,true);xmlHttp.responseType="blob";xmlHttp.send()},_onInitPrint:function(e){var blob=new Blob([
e.response],{type:"application/pdf"});var url=URL.createObjectURL(blob);
this._printIframe=window.L.DomUtil.create("iframe","",document.body);this._printIframe.title=_(
"Print dialog");this._printIframe.onload=window.L.bind(this._onIframeLoaded,this);
window.L.DomUtil.setStyle(this._printIframe,"visibility","hidden");window.L.DomUtil.setStyle(
this._printIframe,"position","fixed");window.L.DomUtil.setStyle(this._printIframe,"right","0");
window.L.DomUtil.setStyle(this._printIframe,"bottom","0");this._printIframe.src=url},
_onIframeLoaded:function(){this._printIframe.contentWindow.focus();
this._printIframe.contentWindow.print();setTimeout(window.L.bind(this._closePrintIframe,this,
this._printIframe),300*1e3)},_closePrintIframe:function(printIframe){window.L.DomUtil.remove(
printIframe);this._map.focus()}});window.L.Map.addInitHook("addHandler","printHandler",
window.L.Map.Print);window.L.Map.mergeOptions({slideShow:true});
window.L.Map.SlideShow=window.L.Handler.extend({_slideURL:"",_presentInWindow:false,
_cypressSVGPresentationTest:false,_slideShowWindowProxy:null,initialize:function(map){this._map=map;
window.app.console.log("window.L.Map.SlideShow: Cypress in window: "+("Cypress"in window));
this._cypressSVGPresentationTest=window.L.Browser.cypressTest&&"Cypress"in window&&window.Cypress.spec.name==="impress/fullscreen_presentation_spec.js"
},addHooks:function(){this._map.on("fullscreen",this._onFullScreen,this);this._map.on(
"presentinwindow",this._onPresentWindow,this);this._map.on("slidedownloadready",
this._onSlideDownloadReady,this)},removeHooks:function(){this._map.off("fullscreen",
this._onFullScreen,this);this._map.off("presentinwindow",this._onPresentWindow,this);this._map.off(
"slidedownloadready",this._onSlideDownloadReady,this)},_onFullScreen:function(e){if(
this._checkPresentationDisabled()){this._notifyPresentationDisabled();return}if(
this._checkAlreadyPresenting()){this._notifyAlreadyPresenting();return}if(
app.impress.areAllSlidesHidden()){this._map.uiManager.showInfoModal("allslidehidden-modal",_(
"Empty Slide Show"),"All slides are hidden!","",_("OK"),function(){},false,
"allslidehidden-modal-response");return}let doPresentation=function(that,e){
that._presentInWindow=false;that._startSlideNumber=0;if(typeof e.startSlideNumber!=="undefined"){
that._startSlideNumber=e.startSlideNumber}that.fullscreen=!that._cypressSVGPresentationTest;
that._map.downloadAs("slideshow.svg","svg",null,"slideshow");window.L.DomEvent.on(document,
"fullscreenchange",that._onFullScreenChange,that)};let fallback=function(that,e){if(that._slideShow
){window.L.DomUtil.remove(that._slideShow);that._slideShow=null}doPresentation(that,e)};if(!(
this._cypressSVGPresentationTest||this._map["wopi"].DownloadAsPostMessage)){
this._slideShow=window.L.DomUtil.create("iframe","leaflet-slideshow",this._map._container);if(
this._slideShow.requestFullscreen){let that=this;this._slideShow.requestFullscreen().then(function(
){doPresentation(that,e)}).catch(function(){fallback(that,e)});return}}fallback(this,e)},
_onPresentWindow:function(e){if(this._checkPresentationDisabled()){this._notifyPresentationDisabled(
);return}if(this._checkAlreadyPresenting()){this._notifyAlreadyPresenting();return}
this._presentInWindow=true;this._startSlideNumber=0;if(e.startSlideNumber!==undefined){
this._startSlideNumber=e.startSlideNumber}this._map.downloadAs("slideshow.svg","svg",null,
"slideshow")},_onFullScreenChange:function(){if(this._map["wopi"].DownloadAsPostMessage){return}
this.fullscreen=document.fullscreenElement;if(!this.fullscreen){this._stopFullScreen()}},
_stopFullScreen:function(){window.L.DomUtil.remove(this._slideShow);this._slideShow=null;
this._map.focus()},_onSlideDownloadReady:function(e){if("processCoolUrl"in window){
e.url=window.processCoolUrl({url:e.url,type:"slideshow"})}const embedURL=new URL(e.url);
embedURL.searchParams.append("attachment",0);this._slideURL=embedURL.toString();
window.app.console.debug("slide file url : ",this._slideURL);this._startPlaying()},
_startPlaying:function(){if(this._presentInWindow){this._slideShowWindowProxy=window.open("",
"_blank","popup");if(!this._slideShowWindowProxy){this._map.uiManager.showInfoModal(
"popup-blocked-modal",_("Windowed Presentation Blocked"),_(
"Presentation was blocked. Please allow pop-ups in your browser. This lets slide shows to be displayed in separated windows, allowing for easy screen sharing."
),"",_("OK"),null,false)}var popupTitle=_("Windowed Presentation: ")+this._map["wopi"].BaseFileName;
this._slideShowWindowProxy.document.title=popupTitle;
this._slideShowWindowProxy.document.body.style.margin="0";
this._slideShowWindowProxy.document.body.style.padding="0";
this._slideShowWindowProxy.document.body.style.height="100%";
this._slideShowWindowProxy.document.body.style.overflow="hidden";
const iFrame=this._slideShowWindowProxy.document.createElement("iframe");iFrame.src=sanitizeUrl(
this._slideURL);iFrame.style.width="100%";iFrame.style.height="100%";iFrame.style.border="none";
this._slideShowWindowProxy.document.body.appendChild(iFrame);this._slideShow=iFrame;if(
"processCoolUrl"in window){this._processSlideshowLinks()}this._processSlideshowVideoForSafari();
this._slideShowWindowProxy.document.close();this._slideShowWindowProxy.focus();
this._slideShowWindowProxy.onload=this._handleSlideWindowLoaded.bind(this);
this._slideShowWindowProxy.addEventListener("keydown",this._onSlideWindowKeyPress.bind(this));
var slideShowWindow=this._slideShowWindowProxy;this._map.uiManager.showSnackbar(_(
"Presenting in window"),_("Close Presentation"),function(){slideShowWindow.close()},-1,false,true);
this._windowCloseInterval=setInterval(function(){if(slideShowWindow.closed){clearInterval(
this._windowCloseInterval);this._map.uiManager.closeSnackbar();this._slideShowWindowProxy=null;
this._slideShow=null}}.bind(this),500);return}if("processCoolUrl"in window){
this._processSlideshowLinks()}this._processSlideshowVideoForSafari();if(
this._cypressSVGPresentationTest||!this._slideShow){window.open(this._slideURL,"_self");return}
this._map.uiManager.showSnackbar(_("Presenting in fullscreen"),_("End Presentation"),function(){
this._stopFullScreen()},null,false,true);var separator=this._slideURL.indexOf("?")===-1?"?":"&";
this._slideShow.src=this._slideURL+separator+"StartSlideNumber="+this._startSlideNumber;
this._slideShow.contentWindow.focus()},_handleSlideWindowLoaded:function(){
const iframe=this._slideShowWindowProxy.document.querySelector("iframe");if(iframe){
iframe.contentWindow.focus();iframe.contentWindow.addEventListener("keydown",
this._onSlideWindowKeyPress.bind(this))}},_processSlideshowLinks:function(){
this._slideShow.addEventListener("load",function onLoadSlideshow(){var linkElements=[].slice.call(
this._slideShow.contentDocument.querySelectorAll("a")).filter(function(el){return el.getAttribute(
"href")||el.getAttribute("xlink:href")}).map(function(el){return{el:el,link:el.getAttribute("href"
)||el.getAttribute("xlink:href"),parent:el.parentNode}});var setAttributeNs=function(el,link){
link=window.processCoolUrl({url:link,type:"slide"});el.setAttributeNS("http://www.w3.org/1999/xlink"
,"href",link);el.setAttribute("target","_blank")};linkElements.forEach(function(item){
setAttributeNs(item.el,item.link);var parentLink=item.parent.getAttribute("xlink:href");if(
parentLink){setAttributeNs(item.parent,parentLink)}item.parent.parentNode.insertBefore(
item.parent.cloneNode(true),item.parent.nextSibling);item.parent.parentNode.removeChild(item.parent)
})}.bind(this))},_checkAlreadyPresenting:function(){if(
this._slideShowWindowProxy&&!this._slideShowWindowProxy.closed)return true;if(this._slideShow
)return true;return false},_notifyAlreadyPresenting:function(){this._map.uiManager.showInfoModal(
"already-presenting-modal",_("Already presenting"),_("You are already presenting this document"),"",
_("OK"),null,false)},_checkPresentationDisabled:function(){return this._map["wopi"
].DisablePresentation},_notifyPresentationDisabled:function(){this._map.uiManager.showInfoModal(
"presentation-disabled-modal",_("Presentation disabled"),_(
"Presentation mode has been disabled for this document"),"",_("OK"),null,false)},
_onSlideWindowKeyPress:function(e){if(e.code==="Escape"){this._slideShowWindowProxy.opener.focus();
this._slideShowWindowProxy.close();this._map.uiManager.closeSnackbar()}},
_processSlideshowVideoForSafari:function(){if(!window.L.Browser.safari){return}if(!this._slideShow){
console.error("In Safari without fixing slideshow videos, this may cause videos to be offset");
return}this._slideShow.addEventListener("load",function onLoadSlideshow(){
var videos=this._slideShow.contentDocument.querySelectorAll("video");var fixSVGPos=function(video){
var videoContainer=video.parentNode;var foreignObject=videoContainer.parentNode;
var svg=foreignObject.closest("svg");return function(){
var widthRatio=svg.width.baseVal.value/svg.viewBox.baseVal.width;
var heightRatio=svg.height.baseVal.value/svg.viewBox.baseVal.height;var minRatio=Math.min(widthRatio
,heightRatio);var leftRightBorders=svg.width.baseVal.value-minRatio*svg.viewBox.baseVal.width;
var topBottomBorders=svg.height.baseVal.value-minRatio*svg.viewBox.baseVal.height;
var offsetX=-foreignObject.width.baseVal.value/2;var offsetY=-foreignObject.height.baseVal.value/2;
offsetX=offsetX-foreignObject.x.baseVal.value+leftRightBorders/4;
offsetY=offsetY-foreignObject.y.baseVal.value+topBottomBorders/4;
offsetX=offsetX+foreignObject.width.baseVal.value*widthRatio/2;
offsetY=offsetY+foreignObject.height.baseVal.value*heightRatio/2;
offsetX=offsetX+foreignObject.x.baseVal.value*widthRatio;
offsetY=offsetY+foreignObject.y.baseVal.value*heightRatio;var scaleString="scale("+minRatio+")";
var translateString="translate("+offsetX+"px, "+offsetY+"px)";
videoContainer.style.transform=translateString+" "+scaleString}};for(var i=0;i<videos.length;i++){
var fixThisVideoPos=fixSVGPos(videos[i]);fixThisVideoPos();var observer=new MutationObserver(
fixThisVideoPos);observer.observe(this._slideShow,{attributes:true});
this._slideShow.contentDocument.defaultView.addEventListener("resize",fixThisVideoPos)}}.bind(this))
}});window.L.Map.addInitHook("addHandler","slideShow",window.L.Map.SlideShow);
window.L.Map.mergeOptions({fileInserter:true});window.L.Map.FileInserter=window.L.Handler.extend({
initialize:function(map){this._map=map;this._childId=null;this._toInsertGraphic={};
this._toInsertMultimedia={};this._toInsertURL={};this._toInsertBackground={};
var parser=document.createElement("a");parser.href=window.host},getWopiUrl:function(map){
return window.makeHttpUrlWopiSrc("/"+map.options.urlPrefix+"/",map.options.doc,"/insertfile")},
addHooks:function(){this._map.on("insertgraphic",this._onInsertGraphic,this);this._map.on(
"insertmultimedia",this._onInsertMultimedia,this);this._map.on("inserturl",this._onInsertURL,this);
this._map.on("childid",this._onChildIdMsg,this);this._map.on("selectbackground",
this._onSelectBackground,this)},removeHooks:function(){this._map.off("insertgraphic",
this._onInsertGraphic,this);this._map.off("insertmultimedia",this._onInsertMultimedia,this);
this._map.off("inserturl",this._onInsertURL,this);this._map.off("childid",this._onChildIdMsg,this);
this._map.off("selectbackground",this._onSelectBackground,this)},_onInsertGraphic:function(e){if(
!this._childId){app.socket.sendMessage("getchildid");this._toInsertGraphic[Date.now()]=e.file}else{
this._sendFile(Date.now(),e.file,"graphic")}},_onInsertMultimedia:function(e){if(!this._childId){
app.socket.sendMessage("getchildid");this._toInsertMultimedia[Date.now()]=e.file}else{
this._sendFile(Date.now(),e.file,"multimedia")}},_onInsertURL:function(e){if(!this._childId){
app.socket.sendMessage("getchildid");this._toInsertURL[Date.now()]=e}else{this._sendURL(Date.now(),e
)}},_onSelectBackground:function(e){if(!this._childId){app.socket.sendMessage("getchildid");
this._toInsertBackground[Date.now()]=e.file}else{this._sendFile(Date.now(),e.file,"selectbackground"
)}},_onChildIdMsg:function(e){this._childId=e.id;for(var name in this._toInsertGraphic){
this._sendFile(name,this._toInsertGraphic[name],"graphic")}this._toInsertGraphic={};for(
var name in this._toInsertMultimedia){this._sendFile(name,this._toInsertMultimedia[name],
"multimedia")}this._toInsertMultimedia={};for(name in this._toInsertURL){this._sendURL(name,
this._toInsertURL[name])}this._toInsertURL={};for(name in this._toInsertBackground){this._sendFile(
name,this._toInsertBackground[name],"selectbackground")}this._toInsertBackground={}},
_sendFile:async function(name,file,type){var socket=app.socket;var map=this._map;
var sectionContainer=app.sectionContainer;var url=this.getWopiUrl(map);var size;if(
type==="multimedia"){const videoElement=document.createElement("video");
const objectURL=window.URL.createObjectURL(file);videoElement.src=objectURL;
const videoLoadPromise=new Promise((resolve,reject)=>{videoElement.addEventListener("loadedmetadata"
,resolve);videoElement.addEventListener("error",reject)});videoElement.load();let videoLoaded=false;
try{await videoLoadPromise;videoLoaded=true}catch(_error){size={width:0,height:0}}if(videoLoaded){
size={width:videoElement.videoWidth,height:videoElement.videoHeight};const maxSize={
width:app.activeDocument.fileSize.cX*map.getZoomScale(10),
height:app.activeDocument.fileSize.cY*map.getZoomScale(10)};const shrinkToFitFactor=Math.min(1,
maxSize.width/size.width,maxSize.height/size.height);size.width*=shrinkToFitFactor;
size.height*=shrinkToFitFactor}videoElement.src=undefined;window.URL.revokeObjectURL(objectURL)}if(
"processCoolUrl"in window){url=window.processCoolUrl({url:url,type:"insertfile"})}if(!(
file.filename&&file.url)&&(file.name===""||file.size===0)){var errMsg=_(
"The file of type: {0} cannot be uploaded to server since the file has no name");if(file.size===0
)errMsg=_("The file of type: {0} cannot be uploaded to server since the file is empty");
errMsg=errMsg.replace("{0}",file.type);map.fire("error",{msg:errMsg,critical:false});return}
this._toInsertBackground={};if(window.ThisIsAMobileApp){var reader=new FileReader;
reader.onload=function(aFile){return function(e){var byteBuffer=new Uint8Array(e.target.result);
var strBytes="";for(var i=0;i<byteBuffer.length;i++){strBytes+=String.fromCharCode(byteBuffer[i])}
if(type==="multimedia"){window.postMobileMessage(
"insertfile name="+aFile.name+" type="+type+" data="+window.btoa(strBytes
)+" width="+size.width+" height="+size.height)}else{window.postMobileMessage(
"insertfile name="+aFile.name+" type="+type+" data="+window.btoa(strBytes))}}}(file);
reader.onerror=function(e){window.postMobileError("Error when reading file: "+e)};
reader.onprogress=function(e){window.postMobileDebug("FileReader progress: "+Math.round(
e.loaded*100/e.total)+"%")};reader.readAsArrayBuffer(file)}else{var xmlHttp=new XMLHttpRequest;
this._map.showBusy(_("Uploading..."),false);xmlHttp.onreadystatechange=function(){if(
xmlHttp.readyState===4){map.hideBusy();if(xmlHttp.status===200){
var sectionName=app.CSections.ContentControl.name;var section;if(sectionContainer.doesSectionExist(
sectionName)){section=sectionContainer.getSectionWithName(sectionName)}if(
section&&section.sectionProperties.picturePicker&&type==="graphic"){socket.sendMessage(
"contentcontrolevent type=picture"+" name="+name)}else if(type==="multimedia"){socket.sendMessage(
"insertfile name="+name+" type="+type+" width="+size.width+" height="+size.height)}else{
socket.sendMessage("insertfile name="+name+" type="+type)}}else if(xmlHttp.status===404){map.fire(
"error",{msg:errorMessages.uploadfile.notfound})}else if(xmlHttp.status===413){map.fire("error",{
msg:errorMessages.uploadfile.toolarge})}else{var msg=_(
"Uploading file to server failed with status: {0}");msg=msg.replace("{0}",xmlHttp.status);map.fire(
"error",{msg:msg})}}};xmlHttp.open("POST",url,true);var formData=new FormData;formData.append("name"
,name);formData.append("childid",this._childId);if(file.filename&&file.url){formData.append("url",
file.url);formData.append("filename",file.filename)}else{formData.append("file",file)}xmlHttp.send(
formData);this._childId=null}},_sendURL:function(name,e){
var sectionName=app.CSections.ContentControl.name;var section;if(
app.sectionContainer.doesSectionExist(sectionName)){section=app.sectionContainer.getSectionWithName(
sectionName)}if(e.urltype=="graphicurl"&&section&&section.sectionProperties.picturePicker){
app.socket.sendMessage("contentcontrolevent type=pictureurl name="+encodeURIComponent(e.url))}else{
app.socket.sendMessage("insertfile name="+encodeURIComponent(e.url)+" type="+e.urltype)}}});
window.L.Map.addInitHook("addHandler","fileInserter",window.L.Map.FileInserter);
window.L.Map.mergeOptions({stateChangeHandler:true});
window.L.Map.StateChangeHandler=window.L.Handler.extend({initialize:function(map){this._map=map;
this._items={}},addHooks:function(){this._map.on("commandstatechanged",this._onStateChanged,this)},
removeHooks:function(){this._map.off("commandstatechanged",this._onStateChanged,this)},
_onStateChanged:function(e){var slideMasterPageItem=this._map["stateChangeHandler"].getItemValue(
".uno:SlideMasterPage");var state;if(typeof e.state=="object"){state=e.state}else if(
typeof e.state=="string"){state=e.state;var firstIndex=state.indexOf("{");
var lastIndex=state.lastIndexOf("}");if(firstIndex!==-1&&lastIndex!==-1){
const substring=state.substring(firstIndex,lastIndex+1);try{state=JSON.parse(substring)}catch(e){
console.error('Failed to parse state JSON: "'+substring+'" : '+e)}}}
const commandName=this.ensureUnoCommandPrefix(e.commandName);this._items[commandName]=state;if(
e.commandName===".uno:CurrentTrackedChangeId"){var redlineId="change-"+state;
const annotations=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);if(
annotations)annotations.selectById(redlineId);else console.error(
'_onStateChanged: section "CommentList" missing')}if(e.commandName===".uno:SlideMasterPage"){
this._map._docLayer._selectedMode=state===true||state==="true"?1:0}if(
e.commandName===".uno:FormatPaintbrush"){if(state==="true")$(".leaflet-pane.leaflet-map-pane"
).addClass("bucket-cursor");else $(".leaflet-pane.leaflet-map-pane").removeClass("bucket-cursor")}
if(e.commandName===".uno:StartWithPresentation"&&(state===true||state==="true")){
let startPresentationParam=window.coolParams.get("startPresentation");if(
startPresentationParam===""||startPresentationParam==="true"||startPresentationParam==="1"){
app.dispatcher.dispatch("presentation")}}if(commandName==".uno:PageLinks"){let links=[];if(
state&&state.links){for(const link of state.links){const end1=link.rectangle.indexOf("x");
const end2=link.rectangle.indexOf("@");const end3=link.rectangle.indexOf(",");const new_link={
rectangle:new cool.SimpleRectangle(parseFloat(link.rectangle.substring(end2+2,end3)),parseFloat(
link.rectangle.substring(end3+1)),parseFloat(link.rectangle.substring(0,end1)),parseFloat(
link.rectangle.substring(end1+1,end2))),uri:link.uri};links.push(new_link)}}this._items[commandName
]=links}$("#document-container").removeClass("slide-master-mode");$("#document-container").addClass(
"slide-normal-mode");if(slideMasterPageItem){$("#document-container").removeClass(
"slide-normal-mode");$("#document-container").addClass("slide-master-mode")}if(
!slideMasterPageItem||slideMasterPageItem=="false"||slideMasterPageItem=="undefined"){$(
"#document-container").removeClass("slide-master-mode");$("#document-container").addClass(
"slide-normal-mode")}},getItems:function(){return this._items},getItemValue:function(unoCmd){
unoCmd=this.ensureUnoCommandPrefix(unoCmd);return this._items[unoCmd]},setItemValue:function(unoCmd,
value){unoCmd=this.ensureUnoCommandPrefix(unoCmd);this._items[unoCmd]=value},ensureUnoCommandPrefix(
unoCmd){if(unoCmd&&unoCmd.substring(0,5)!==".uno:"){return".uno:"+unoCmd}return unoCmd}});
window.L.Map.addInitHook("addHandler","stateChangeHandler",window.L.Map.StateChangeHandler);
window.L.Map.WOPI=window.L.Handler.extend({PostMessageOrigin:window.postmessageOriginExt||"*",
BaseFileName:"",BreadcrumbDocName:"",DocumentLoadedTime:false,HidePrintOption:false,
HideSaveOption:false,HideExportOption:false,HideRepairOption:false,HideChangeTrackingControls:false,
DisablePrint:false,DisableExport:false,DisableCopy:false,DisableInactiveMessages:false,
DownloadAsPostMessage:false,UserCanNotWriteRelative:true,EnableInsertRemoteImage:false,
EnableInsertRemoteFile:false,DisableInsertLocalImage:false,EnableInsertRemoteLink:false,
EnableRemoteAIContent:false,EnableShare:false,HideUserList:null,CallPythonScriptSource:null,
SupportsRename:false,UserCanRename:false,UserCanWrite:false,DisablePresentation:false,
_appLoadedConditions:{docloaded:false,updatepermission:false,viewinfo:false,initializedui:false},
_appLoaded:false,_insertImageMenuSetupDone:false,initialize:function(map){this._map=map},
addHooks:function(){this._map.on("postMessage",this._postMessage,this);this._map.on("docloaded",
this._postLoaded,this);app.events.on("updatepermission",this._postLoaded.bind(this));this._map.on(
"viewinfo",this._postLoaded,this);this._map.on("initializedui",this._postLoaded,this);this._map.on(
"wopiprops",this._setWopiProps,this);window.L.DomEvent.on(window,"message",this._postMessageListener
,this);this._map.on("updateviewslist",function(){this._postViewsMessage("Views_List")},this);if(
!window.ThisIsAMobileApp){var that=this;window.open=function(open){return function(url,name,features
){const eSignature=that._map.eSignature;const eSignInProgress=eSignature&&eSignature.signInProgress;
if(eSignInProgress){return open.call(window,url,name,features)}that._map.fire("postMessage",{
msgId:"UI_Hyperlink",args:{Url:url,Name:name,Features:features}});if(
!that._map._disableDefaultAction["UI_Hyperlink"])return open.call(window,url,name,features
);else return null}}(window.open)}},removeHooks:function(){this._map.off("postMessage",
this._postMessage,this);this._map.off("docloaded",this._postLoaded,this);this._map.off("viewinfo",
this._postLoaded,this);this._map.off("wopiprops",this._setWopiProps,this);window.L.DomEvent.off(
window,"message",this._postMessageListener,this);this._map.off("updateviewslist")},
_supportsRename:function(){return!!this.SupportsRename||!this.UserCanNotWriteRelative},
_setWopiProps:function(wopiInfo){var overridenFileInfo=window.checkFileInfoOverride;if(wopiInfo[
"PostMessageOrigin"]){this.PostMessageOrigin=wopiInfo["PostMessageOrigin"]}
this.BaseFileName=wopiInfo["BaseFileName"];this.BreadcrumbDocName=wopiInfo["BreadcrumbDocName"];if(
this.BreadcrumbDocName===undefined)this.BreadcrumbDocName=this.BaseFileName;
this.HidePrintOption=!!wopiInfo["HidePrintOption"];this.HideSaveOption=!!wopiInfo["HideSaveOption"];
this.HideExportOption=!!wopiInfo["HideExportOption"];this.HideRepairOption=!!wopiInfo[
"HideRepairOption"];this.HideChangeTrackingControls=!!wopiInfo["HideChangeTrackingControls"];
this.DisablePrint=!!wopiInfo["DisablePrint"];this.DisableExport=!!wopiInfo["DisableExport"];
this.DisableCopy=!!wopiInfo["DisableCopy"];this.DisableInactiveMessages=!!wopiInfo[
"DisableInactiveMessages"];this.DownloadAsPostMessage=Object.prototype.hasOwnProperty.call(
overridenFileInfo,"DownloadAsPostMessage")?overridenFileInfo.DownloadAsPostMessage:!!wopiInfo[
"DownloadAsPostMessage"];this.UserCanNotWriteRelative=!!wopiInfo["UserCanNotWriteRelative"];
this.EnableInsertRemoteImage=!!wopiInfo["EnableInsertRemoteImage"];
this.EnableInsertRemoteFile=!!wopiInfo["EnableInsertRemoteFile"];
this.DisableInsertLocalImage=!!wopiInfo["DisableInsertLocalImage"];
this.EnableRemoteLinkPicker=!!wopiInfo["EnableRemoteLinkPicker"];
this.EnableRemoteAIContent=!!wopiInfo["EnableRemoteAIContent"];this.SupportsRename=!!wopiInfo[
"SupportsRename"];this.UserCanRename=!!wopiInfo["UserCanRename"];this.EnableShare=!!wopiInfo[
"EnableShare"];this.UserCanWrite=!!wopiInfo["UserCanWrite"];this.DisablePresentation=wopiInfo[
"DisablePresentation"];if(this.UserCanWrite&&!app.isReadOnly())app.setPermission("edit");
this.IsOwner=!!wopiInfo["IsOwner"];if(wopiInfo["HideUserList"])this.HideUserList=wopiInfo[
"HideUserList"].split(",");this.sendFrameReady();if("TemplateSaveAs"in wopiInfo){this._map.showBusy(
_("Creating new file from template..."),false);this._map.saveAs(wopiInfo["TemplateSaveAs"])}
this.setupImageInsertionMenu()},sendFrameReady:function(){this._map.fire("postMessage",{
msgId:"App_LoadingStatus",args:{Status:"Frame_Ready",Features:{VersionStates:true}}})},
sendDocumentLoaded:function(){this._map.fire("postMessage",{msgId:"App_LoadingStatus",args:{
Status:"Document_Loaded",DocumentLoadedTime:this.DocumentLoadedTime}})},
setupImageInsertionMenu:function(){if(this._insertImageMenuSetupDone){return}if(
this.DisableInsertLocalImage){JSDialog.MenuDefinitions.set("InsertImageMenu",[]);
JSDialog.MenuDefinitions.set("InsertMultimediaMenu",[])}
var menuEntriesImage=JSDialog.MenuDefinitions.get("InsertImageMenu");
var menuEntriesMultimedia=JSDialog.MenuDefinitions.get("InsertMultimediaMenu");if(
this.EnableInsertRemoteImage){menuEntriesImage.push({action:"remotegraphic",text:_UNO(
".uno:InsertGraphic","",true)})}if(this.EnableInsertRemoteFile){menuEntriesMultimedia.push({
action:"remotemultimedia",text:_UNO(".uno:InsertAVMedia","",true)})}
this._insertImageMenuSetupDone=true},resetAppLoaded:function(){this._appLoaded=false;for(
var key in this._appLoadedConditions){this._appLoadedConditions[key]=false}},_postLoaded:function(e
){app.console.debug("PostMessage: _postLoaded - "+e.type);if(this._appLoaded){return}if(
e.type==="docloaded"){if(!e.status){this._appLoadedConditions[e.type]=false;return}
this.DocumentLoadedTime=Date.now()}this._appLoadedConditions[e.type]=true;for(
var key in this._appLoadedConditions){if(!this._appLoadedConditions[key])return}this._appLoaded=true
this.sendDocumentLoaded()},_allowMessageOrigin:function(e){if(e.origin==="null")return false;if(
this._cachedGoodOrigin&&this._cachedGoodOrigin===e.origin)return true;try{if(
e.origin===window.parent.origin)return true}catch(secErr){}var i;if(
!this._allowedOrigins&&window.frameAncestors){var ancestors=window.frameAncestors.trim().split(" ");
this._allowedOrigins=ancestors;for(i=0;i<ancestors.length;i++){this._allowedOrigins[i
]="(http|https)://"+ancestors[i].replace(/:\*/,":?.*")}}if(this._allowedOrigins){for(
i=0;i<this._allowedOrigins.length;i++){if(e.origin.match(this._allowedOrigins[i])){
this._cachedGoodOrigin=e.origin;return true}}}if(
window.location.ancestorOrigins&&window.location.ancestorOrigins.contains(e.origin)){
this._cachedGoodOrigin=e.origin;return true}const eSignature=this._map.eSignature;if(
eSignature&&eSignature.url===e.origin){return true}return false},_postMessageListener:function(e){
if(!this._allowMessageOrigin(e)){window.app.console.error(
"PostMessage not allowed due to incorrect origin.");return}var msg;if(
"data"in e&&Object.hasOwnProperty.call(e.data,"MessageId")){msg=e.data}else if(
typeof e.data==="object"){msg=e.data}else{try{msg=JSON.parse(e.data)}catch(e){
window.app.console.error(e);return}}if(msg.MessageId==="Close_Session"){app.socket.sendMessage(
"closedocument");return}if(
msg.MessageId==="Show_Button"||msg.MessageId==="Hide_Button"||msg.MessageId==="Remove_Button"){if(
!msg.Values){window.app.console.error('Property "Values" not set');return}if(!msg.Values.id){
window.app.console.error('Property "Values.id" not set');return}
var show=msg.MessageId==="Show_Button";this._map.uiManager.showButton(msg.Values.id,show);return
}else if(msg.MessageId==="Show_Command"||msg.MessageId==="Hide_Command"){if(!msg.Values){
window.app.console.error('Property "Values" not set');return}if(!msg.Values.id){
window.app.console.error('Property "Values.id" not set');return}
var show=msg.MessageId==="Show_Command";this._map.uiManager.showCommand(msg.Values.id,show);return
}else if(msg.MessageId==="Remove_Statusbar_Element"){if(!msg.Values){window.app.console.error(
'Property "Values" not set');return}if(!msg.Values.id){window.app.console.error(
'Property "Values.id" not set');return}window.app.map.statusBar.showItem(msg.Values.id,false);return
}else if(msg.MessageId==="Show_Menubar"){this._map.uiManager.showMenubar();return}else if(
msg.MessageId==="Hide_Menubar"){this._map.uiManager.hideMenubar();return}else if(
msg.MessageId==="Show_Ruler"){this._map.uiManager.showRuler();return}else if(
msg.MessageId==="Hide_Ruler"){this._map.uiManager.hideRuler();return}else if(
msg.MessageId==="Show_StatusBar"){this._map.uiManager.showStatusBar();return}else if(
msg.MessageId==="Hide_StatusBar"){this._map.uiManager.hideStatusBar(false);return}else if(
msg.MessageId==="Collapse_Notebookbar"){this._map.uiManager.collapseNotebookbar();return}else if(
msg.MessageId==="Extend_Notebookbar"){this._map.uiManager.extendNotebookbar();return}else if(
msg.MessageId==="Show_NotebookTab"||msg.MessageId==="Hide_NotebookTab"){if(!msg.Values){
window.app.console.error('Property "Values" not set');return}if(!msg.Values.id){
window.app.console.error('Property "Values.id" not set');return}
let show=msg.MessageId==="Show_NotebookTab";this._map.uiManager.showNotebookTab(msg.Values.id,show);
return}else if(msg.MessageId==="Show_Sidebar"){if(msg.Values){switch(msg.Values.id){case"Navigator":
case"ModifyPage":case"CustomAnimation":this._map.sendUnoCommand(`.uno:${msg.Values.id}`);return}}
this._map.sendUnoCommand(".uno:SidebarDeck.PropertyDeck");return}else if(
msg.MessageId==="Hide_Sidebar"){this._map.sendUnoCommand(".uno:SidebarHide");return}else if(
msg.MessageId==="Show_Menu_Item"||msg.MessageId==="Hide_Menu_Item"){if(!msg.Values){
window.app.console.error('Property "Values" not set');return}if(!msg.Values.id){
window.app.console.error('Property "Values.id" not set');return}if(
!this._map.menubar||!this._map.menubar.hasItem(msg.Values.id)){window.app.console.error(
'Menu item with id "'+msg.Values.id+'" not found.');if(this._map.uiManager.getCurrentMode(
)==="notebookbar"){window.app.console.error("No menu items in notebookbar")}return}if(
msg.MessageId==="Show_Menu_Item"){if(!this._map.menubar.showItem(msg.Values.id)){
window.app.console.error('Menu entry with id "'+msg.Values.id+'" not found.')}}else if(
!this._map.menubar.hideItem(msg.Values.id)){window.app.console.error(
'Menu entry with id "'+msg.Values.id+'" not found.')}return}else if(
msg.MessageId==="Insert_Button"&&msg.Values&&msg.Values.id){this._map.uiManager.insertButton(
msg.Values);return}else if(msg.MessageId==="Insert_ContextualButton"&&msg.Values&&msg.Values.id){
this._map.uiManager.map.contextToolbar.insertAdditionalContextButton(msg.Values);return}else if(
msg.MessageId==="Send_UNO_Command"&&msg.Values&&msg.Values.Command){this._map.sendUnoCommand(
msg.Values.Command,msg.Values.Args||"");return}else if(msg.MessageId==="Hint_OnscreenKeyboard"){
window.keyboard.hintOnscreenKeyboard(true);return}else if(msg.MessageId==="Hint_NoOnscreenKeyboard"
){window.keyboard.hintOnscreenKeyboard(false);return}else if(
msg.MessageId==="Disable_Default_UIAction"){if(
msg.Values&&msg.Values.action&&msg.Values.disable!==undefined){this._map._disableDefaultAction[
msg.Values.action]=msg.Values.disable}return}else if(msg.MessageId==="Error_Messages"){if(
msg.Values&&msg.Values.list){msg.Values.list.forEach(function(item){if(
Object.prototype.hasOwnProperty.call(errorMessages.storage,item.type)){errorMessages.storage[
item.type]=item.msg}else if(Object.prototype.hasOwnProperty.call(errorMessages.uploadfile,item.type)
){errorMessages.uploadfile[item.type]=item.msg}else if(Object.prototype.hasOwnProperty.call(
errorMessages,item.type)){errorMessages[item.type]=item.msg}})}}if(!window.WOPIPostmessageReady){
window.app.console.error("PostMessage ignored: not ready.");return}if(
msg.MessageId==="Host_PostmessageReady"){return}if(msg.MessageId==="Grab_Focus"){
app.idleHandler._activate();return}if(msg.MessageId==="Close_Session"){app.socket.sendMessage(
"closedocument");return}if(msg.MessageId==="Get_User_State"){var isIdle=app.idleHandler.isDimActive(
);this._postMessage({msgId:"Get_User_State_Resp",args:{State:isIdle?"idle":"active",
Elapsed:app.idleHandler.getElapsedFromActivity()}})}if(!this._appLoaded){window.app.console.error(
"F7 Office not loaded yet. Listen for App_LoadingStatus (Document_Loaded) event before using PostMessage API. Ignoring post message '"+msg.MessageId+"'."
);return}if(msg.MessageId==="Set_Settings"){if(msg.Values){var alwaysActive=msg.Values.AlwaysActive;
this._map.options.alwaysActive=!!alwaysActive}}else if(msg.MessageId==="Get_Views"){
this._postViewsMessage("Get_Views_Resp")}else if(msg.MessageId==="Reset_Access_Token"){
app.socket.sendMessage("resetaccesstoken "+msg.Values.token)}else if(msg.MessageId==="Action_Save"){
var dontTerminateEdit=msg.Values&&msg.Values["DontTerminateEdit"];
var dontSaveIfUnmodified=msg.Values&&msg.Values["DontSaveIfUnmodified"];
var extendedData=msg.Values&&msg.Values["ExtendedData"];extendedData=encodeURIComponent(extendedData
);this._notifySave=msg.Values&&msg.Values["Notify"];this._map.save(dontTerminateEdit,
dontSaveIfUnmodified,extendedData)}else if(msg.MessageId==="Action_Close"){this._map.remove()
}else if(msg.MessageId==="Action_Fullscreen"){app.util.toggleFullScreen()}else if(
msg.MessageId==="Action_FullscreenPresentation"&&this._map.getDocType()==="presentation"){if(
msg.Values){var slideNumber;if(typeof msg.Values.StartSlideNumber!="undefined"){
slideNumber=msg.Values.StartSlideNumber}else if(msg.Values.CurrentSlide){
slideNumber=this._map.getCurrentPartNumber()}this._map.fire("fullscreen",{
startSlideNumber:slideNumber})}else{this._map.fire("fullscreen")}}else if(
msg.MessageId==="Action_Print"){this._map.print()}else if(msg.MessageId==="Action_Export"){if(
msg.Values){this._notifySave=msg.Values["Notify"];var format=msg.Values.Format;
var fileName=this._map["wopi"].BaseFileName;fileName=fileName.substr(0,fileName.lastIndexOf("."));
fileName=fileName===""?"document":fileName;this._map.downloadAs(fileName+"."+format,format)}
}else if(msg.MessageId=="Action_InsertGraphic"){if(msg.Values){this._map.insertURL(msg.Values.url,
"graphicurl")}}else if(msg.MessageId=="Action_InsertMultimedia"){if(msg.Values){this._map.insertURL(
msg.Values.url,"multimediaurl")}}else if(msg.MessageId=="Action_InsertLink"){if(msg.Values){
var link=this._map.makeURLFromStr(msg.Values.url);var text=this._map.getTextForLink();
text=text?text.trim():link;var command={"Hyperlink.Text":{type:"string",value:text},
"Hyperlink.URL":{type:"string",value:link}};this._map.sendUnoCommand(".uno:SetHyperlink",command);
this._map.focus()}}else if(msg.MessageId=="Action_GetLinkPreview_Resp"){
var preview=document.querySelector("#hyperlink-pop-up-preview");if(preview){if(
preview.nextSibling&&preview.nextSibling.innerText!==msg.Values.url)return;preview.innerText="";if(
msg.Values.image&&msg.Values.image.indexOf("data:")===0){var image=window.L.DomUtil.create("img","",
preview);image.src=msg.Values.image;image.alt=msg.Values.title;image.onload=function(){
URLPopUpSection.resetPosition()}}else{window.L.DomUtil.addClass(preview,"no-preview")}if(
msg.Values.title){var title=window.L.DomUtil.create("p","",preview);title.innerText=msg.Values.title
URLPopUpSection.resetPosition()}}}else if(msg.MessageId==="Action_InsertFile"){if(
msg.Values&&msg.Values.File instanceof Blob){this._map.fire("insertfile",{file:msg.Values.File})}
}else if(msg.MessageId=="Action_Paste"){if(msg.Values&&msg.Values.Mimetype&&msg.Values.Data){
var blob=new Blob(["paste mimetype="+msg.Values.Mimetype+"\n",msg.Values.Data]);
app.socket.sendMessage(blob)}}else if(msg.MessageId==="Action_ShowBusy"){if(
msg.Values&&msg.Values.Label){this._map.fire("showbusy",{label:msg.Values.Label})}}else if(
msg.MessageId==="Action_HideBusy"){this._map.fire("hidebusy")}else if(
msg.MessageId==="Get_Export_Formats"){var exportFormatsResp=[];for(
var index in app.file.exportFormats){exportFormatsResp.push({Label:app.file.exportFormats[index
].label,Format:app.file.exportFormats[index].format})}this._postMessage({
msgId:"Get_Export_Formats_Resp",args:exportFormatsResp})}else if(msg.MessageId==="Action_SaveAs"){
if(msg.Values){if(msg.Values.Filename!==null&&msg.Values.Filename!==undefined){
this._notifySave=msg.Values["Notify"];var nameParts=msg.Values.Filename.split(".");
var format=undefined;if(nameParts.length>1)format=nameParts.pop();else{
this._map.uiManager.showInfoModal("error",_("Error"),_("File name should contain an extension."),"",
_("OK"));return}var isExport=format==="pdf"||format==="epub";if(isExport){this._map.exportAs(
msg.Values.Filename)}else{this._map.showBusy(_("Creating copy..."),false);this._map.saveAs(
msg.Values.Filename,format)}}}}else if(msg.MessageId==="Action_FollowUser"){if(msg.Values){
this._map._setFollowing(msg.Values.Follow,msg.Values.ViewId)}else{this._map._setFollowing(true,null)
}}else if(msg.MessageId==="Host_VersionRestore"){if(msg.Values.Status==="Pre_Restore"){
app.socket.sendMessage("versionrestore prerestore")}}else if(
msg.MessageId==="CallPythonScript"&&Object.prototype.hasOwnProperty.call(msg,"ScriptFile"
)&&Object.prototype.hasOwnProperty.call(msg,"Function")){this._map.CallPythonScriptSource=e.source;
this._map.sendUnoCommand(
"vnd.sun.star.script:"+msg.ScriptFile+"$"+msg.Function+"?language=Python&location=share",msg.Values)
}else if(msg.MessageId==="Action_RemoveView"){if(
msg.Values&&msg.Values.ViewId!==null&&msg.Values.ViewId!==undefined){app.socket.sendMessage(
"removesession "+msg.Values.ViewId)}}else if(msg.MessageId==="Action_ChangeUIMode"){
this._map.uiManager.onChangeUIMode({mode:msg.Values.Mode,force:true})}else if(
msg.MessageId==="Action_Mention"){var list=msg.Values.list;this._map.mention.openMentionPopup(list)
}else if(msg.sender==="EIDEASY_SINGLE_METHOD_SIGNATURE"){const eSignature=this._map.eSignature;if(
eSignature){eSignature.handleSigned(msg)}}},_postMessage:function(e){if(!this.enabled){return}
var msgId=e.msgId;var values=e.args||{};if(!!this.PostMessageOrigin&&window.parent!==window.self){
if(msgId==="Action_Save_Resp"){if(!this._notifySave)return;this._notifySave=false}var msg={
MessageId:msgId,SendTime:Date.now(),Values:values};window.parent.postMessage(JSON.stringify(msg),
this.PostMessageOrigin)}},_postViewsMessage:function(messageId){var getMembersRespVal=[];for(
var viewInfoIdx in this._map._viewInfo){getMembersRespVal.push({ViewId:viewInfoIdx,
UserName:this._map._viewInfo[viewInfoIdx].username,UserId:this._map._viewInfo[viewInfoIdx].userid,
UserExtraInfo:this._map._viewInfo[viewInfoIdx].userextrainfo,Color:this._map._viewInfo[viewInfoIdx
].color,ReadOnly:this._map._viewInfo[viewInfoIdx].readonly,
IsCurrentView:this._map._docLayer._viewId===parseInt(viewInfoIdx,10)})}this._postMessage({
msgId:messageId,args:getMembersRespVal})}});window.L.Map.addInitHook("addHandler","wopi",
window.L.Map.WOPI);window.L.Handler.MarkerDrag=window.L.Handler.extend({initialize:function(marker){
this._marker=marker},addHooks:function(){var icon=this._marker._icon;if(!this._draggable){
this._draggable=new window.L.Draggable(icon,icon,true)}this._draggable.on({down:this._onDown,
dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd,up:this._onUp},this).enable();
window.L.DomUtil.addClass(icon,"leaflet-marker-draggable")},removeHooks:function(){
this._draggable.off({down:this._onDown,dragstart:this._onDragStart,drag:this._onDrag,
dragend:this._onDragEnd,up:this._onUp},this).disable();if(this._marker._icon){
window.L.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")}},moved:function(){
return this._draggable&&this._draggable._moved},freezeX:function(boolChoice){if(this._draggable
)this._draggable.freezeX(boolChoice)},freezeY:function(boolChoice){if(this._draggable
)this._draggable.freezeY(boolChoice)},_onDown:function(e){this._marker.fire("down",e)},
_onDragStart:function(e){this._marker.fire("movestart",e).fire("dragstart",e)},_onDrag:function(e){
var marker=this._marker,shadow=marker._shadow,iconPos=window.L.DomUtil.getPosition(marker._icon),
latlng=marker._map.layerPointToLatLng(iconPos);if(shadow){window.L.DomUtil.setPosition(shadow,
iconPos)}marker._latlng=latlng;e.latlng=latlng;marker.fire("move",e).fire("drag",e)},
_onDragEnd:function(e){this._marker.fire("moveend",e).fire("dragend",e)},_onUp:function(e){
this._marker.fire("up",e)}});var AboutDialog=function(){function AboutDialog(map){this.map=map}
AboutDialog.prototype.aboutDialogClickHandler=function(e){if(e.detail===3){this.map._debug.toggle()}
};AboutDialog.prototype.adjustIDs=function(content){var servedBy=content.querySelector(
":scope #served-by");if(servedBy)servedBy.id+="-cloned";var wopiHostId=content.querySelector(
":scope #wopi-host-id");if(wopiHostId)wopiHostId.id+="-cloned"};
AboutDialog.prototype.hideElementsHiddenByDefault=function(content){
var servedBy=content.querySelector(":scope #served-by-cloned");if(servedBy
)servedBy.style.display="none";var wopiHostId=content.querySelector(":scope #wopi-host-id-cloned");
if(wopiHostId)wopiHostId.style.display="none"};AboutDialog.prototype.show=function(){
var windowAny=window;var aboutDialogId="about-dialog";var content=document.getElementById(
aboutDialogId).cloneNode(true);content.style.display="block";this.adjustIDs(content);
this.hideElementsHiddenByDefault(content);if(content.querySelector("#js-dialog")){
content.querySelector("#js-dialog").onclick=function(){app.socket.sendMessage(
"uno .uno:WidgetTestDialog");app.map.uiManager.closeModal("modal-dialog-about-dialog-box",false)}}
var productName;if(windowAny.ThisIsAMobileApp){productName=windowAny.MobileAppName}else{
productName=typeof brandProductName==="string"&&brandProductName.length>0?brandProductName:"F7 Office"
}
var productURL=typeof brandProductURL==="string"&&brandProductURL.length>0?brandProductURL:"#"
var productNameElement=content.querySelector("#product-name");
productNameElement.innerText=productName;content.classList.add("product-"+productName.split(/[ ()]+/
).join("-").toLowerCase());var productString=_("This version of {productname} is powered by");
var productNameWithURL;if(!windowAny.ThisIsAMobileApp)productNameWithURL='<a href="'+sanitizeUrl(
productURL)+'" target="_blank">'+productName+"</a>";else productNameWithURL=productName;
var productStringElement=content.querySelector("#product-string");if(productStringElement
)productStringElement.innerText=productString.replace("{productname}",productNameWithURL);
var slowProxyElement=content.querySelector("#slow-proxy");if(windowAny.socketProxy
)slowProxyElement.innerText=_('"Slow Proxy"');if(windowAny.indirectSocket){
var routeTokenElement=content.querySelector("#routeToken");
routeTokenElement.innerText="RouteToken: "+windowAny.routeToken;if(windowAny.geolocationSetup){
var timezoneElement=content.querySelector("#timeZone");timezoneElement.innerText=_("Time zone:"
)+" "+app.socket.WSDServer.TimeZone}}this.map.uiManager.showYesNoButton(aboutDialogId+"-box",
productName,"",_("OK"),null,null,null,true);this.showImpl(aboutDialogId,content)};
AboutDialog.prototype.showImpl=function(aboutDialogId,content){var _this=this;
var box=document.getElementById(aboutDialogId+"-box");if(!box){setTimeout(function(){_this.showImpl(
aboutDialogId,content)},10);return}var innerDiv=window.L.DomUtil.create("div","",null);
box.insertBefore(innerDiv,box.firstChild);innerDiv.appendChild(content);
var form=document.getElementById("about-dialog-box");form.addEventListener("click",
this.aboutDialogClickHandler.bind(this));form.addEventListener("keyup",
this.aboutDialogKeyHandler.bind(this));form.querySelector("#coolwsd-version").querySelector("a"
).focus();var copyVersionText=_("Copy all version information in English");
var copyVersion=window.L.DomUtil.create("button","ui-pushbutton jsdialog",null);
copyVersion.setAttribute("id","modal-dialog-about-dialog-box-copybutton");copyVersion.setAttribute(
"aria-label",copyVersionText);copyVersion.setAttribute("data-cooltip",copyVersionText);
var img=window.L.DomUtil.create("img",null,null);app.LOUtil.setImage(img,"lc_copy.svg",this.map);
copyVersion.innerHTML='<img src="'+sanitizeUrl(img.src)+'" width="18px" height="18px">';
copyVersion.addEventListener("click",this.copyVersionInfoToClipboard.bind(this));
window.L.control.attachTooltipEventListener(copyVersion,this.map);
var aboutOk=document.getElementById("modal-dialog-about-dialog-box-yesbutton");if(aboutOk){
aboutOk.before(copyVersion)}};AboutDialog.prototype.aboutDialogKeyHandler=function(e){if(e.key==="d"
){this.map._debug.toggle()}else if(e.key==="l"){
app.socket.threadLocalLoggingLevelToggle=!app.socket.threadLocalLoggingLevelToggle;
var newLogLevel=app.socket.threadLocalLoggingLevelToggle?"verbose":"default";app.socket.sendMessage(
"loggingleveloverride "+newLogLevel);
var logLevelInformation=app.socket.threadLocalLoggingLevelToggle?"most verbose (from coolwsd.xml)":"default (from coolwsd.xml)"
console.debug("Log level: "+logLevelInformation)}};
AboutDialog.prototype.copyVersionInfoToClipboard=function(){
var text="COOLWSD version: "+this.getVersionInfoFromClass("coolwsd-version")+"\n";
text+="LOKit version: "+this.getVersionInfoFromClass("lokit-version")+"\n";
text+="Served by: "+document.getElementById("os-info").innerText+"\n";
text+="Server ID: "+document.getElementById("coolwsd-id").innerText+"\n";
text+="WOPI host: "+document.getElementById("wopi-host-id").innerText+"\n";text=text.replace(
/\u00A0/g," ");if(navigator.clipboard&&window.isSecureContext){navigator.clipboard.writeText(text
).then(function(){window.console.log("Text copied to clipboard");
this.contentHasBeenCopiedShowSnackbar()}.bind(this)).catch(function(error){window.console.error(
"Error copying text to clipboard:",error)})}else{var textArea=document.createElement("textarea");
textArea.style.position="absolute";textArea.style.opacity="0";textArea.value=text;
document.body.appendChild(textArea);textArea.select();try{document.execCommand("copy");
window.console.log("Text copied to clipboard");this.contentHasBeenCopiedShowSnackbar()}catch(error){
window.console.error("Error copying text to clipboard:",error)}finally{document.body.removeChild(
textArea)}}};AboutDialog.prototype.contentHasBeenCopiedShowSnackbar=function(){var _this=this;
var timeout=1e3;this.map.uiManager.showSnackbar("Version information has been copied",null,null,
timeout);var copybutton=document.querySelector("#modal-dialog-about-dialog-box-copybutton > img");
app.LOUtil.setImage(copybutton,"lc_clipboard-check.svg",this.map);setTimeout(function(){
app.LOUtil.setImage(copybutton,"lc_copy.svg",_this.map)},timeout)};
AboutDialog.prototype.getVersionInfoFromClass=function(className){
var versionElement=document.getElementById(className);var versionInfo=versionElement.innerText;
var gitHashIndex=versionInfo.indexOf("git hash");if(gitHashIndex>-1){versionInfo=versionInfo.slice(0
,gitHashIndex)+"("+versionInfo.slice(gitHashIndex)+")"}return versionInfo};return AboutDialog}();
JSDialog.aboutDialog=function(map){return new AboutDialog(map)};(function(global){var map;
function getUNOCommand(unoData){if(typeof unoData!=="object")return unoData;if(!map._clip
)return unoData.textCommand;var selectionType=map._clip._selectionType;if(
!selectionType||selectionType==="text")return unoData.textCommand;return unoData.objectCommand}
function _setBorders(left,right,bottom,top,horiz,vert,color){map.sendUnoCommand(
getBorderStyleUNOCommand(left,right,bottom,top,horiz,vert,color))}function getBorderStyleUNOCommand(
left,right,bottom,top,horiz,vert,color){const params={OuterBorder:{type:"[]any",value:[{
type:"com.sun.star.table.BorderLine2",value:{Color:{type:"com.sun.star.util.Color",value:color},
InnerLineWidth:{type:"short",value:0},OuterLineWidth:{type:"short",value:left},LineDistance:{
type:"short",value:0},LineStyle:{type:"short",value:0},LineWidth:{type:"unsigned long",value:0}}},{
type:"com.sun.star.table.BorderLine2",value:{Color:{type:"com.sun.star.util.Color",value:color},
InnerLineWidth:{type:"short",value:0},OuterLineWidth:{type:"short",value:right},LineDistance:{
type:"short",value:0},LineStyle:{type:"short",value:0},LineWidth:{type:"unsigned long",value:0}}},{
type:"com.sun.star.table.BorderLine2",value:{Color:{type:"com.sun.star.util.Color",value:color},
InnerLineWidth:{type:"short",value:0},OuterLineWidth:{type:"short",value:bottom},LineDistance:{
type:"short",value:0},LineStyle:{type:"short",value:0},LineWidth:{type:"unsigned long",value:0}}},{
type:"com.sun.star.table.BorderLine2",value:{Color:{type:"com.sun.star.util.Color",value:color},
InnerLineWidth:{type:"short",value:0},OuterLineWidth:{type:"short",value:top},LineDistance:{
type:"short",value:0},LineStyle:{type:"short",value:0},LineWidth:{type:"unsigned long",value:0}}},{
type:"long",value:0},{type:"long",value:0},{type:"long",value:0},{type:"long",value:0},{type:"long",
value:0}]},InnerBorder:{type:"[]any",value:[{type:"com.sun.star.table.BorderLine2",value:{Color:{
type:"com.sun.star.util.Color",value:color},InnerLineWidth:{type:"short",value:0},OuterLineWidth:{
type:"short",value:horiz},LineDistance:{type:"short",value:0},LineStyle:{type:"short",value:0},
LineWidth:{type:"unsigned long",value:0}}},{type:"com.sun.star.table.BorderLine2",value:{Color:{
type:"com.sun.star.util.Color",value:color},InnerLineWidth:{type:"short",value:0},OuterLineWidth:{
type:"short",value:vert},LineDistance:{type:"short",value:0},LineStyle:{type:"short",value:0},
LineWidth:{type:"unsigned long",value:0}}},{type:"short",value:0},{type:"short",value:127},{
type:"long",value:0}]}};const jsonParams=JSON.stringify(params);
return`.uno:SetBorderStyle ${jsonParams}`}global.getBorderStyleUNOCommand=getBorderStyleUNOCommand;
var lastClosePopupCallback=undefined;function closePopup(){if(lastClosePopupCallback){
lastClosePopupCallback();lastClosePopupCallback=undefined}map.focus()}function setBorderStyle(num,
color){if(color===undefined)color=0;else if(color.startsWith("#"))color=parseInt(
"0x"+color.substring(1,color.length));switch(num){case 0:map.sendUnoCommand(".uno:FormatCellBorders"
);break;case 1:_setBorders(0,0,0,0,0,0,color);break;case 2:_setBorders(1,0,0,0,0,0,color);break;
case 3:_setBorders(0,1,0,0,0,0,color);break;case 4:_setBorders(1,1,0,0,0,0,color);break;case 5:
_setBorders(0,0,0,1,0,0,color);break;case 6:_setBorders(0,0,1,0,0,0,color);break;case 7:_setBorders(
0,0,1,1,0,0,color);break;case 8:_setBorders(1,1,1,1,0,0,color);break;case 9:_setBorders(0,0,1,1,1,0,
color);break;case 10:_setBorders(1,1,1,1,1,0,color);break;case 11:_setBorders(1,1,1,1,0,1,color);
break;case 12:_setBorders(1,1,1,1,1,1,color);break;default:window.app.console.log(
"ignored border: "+num)}closePopup()}global.setBorderStyle=setBorderStyle;
function setConditionalFormat(num,unoCommand,jsdialogDropdown){var params={IconSet:{type:"short",
value:num}};map.sendUnoCommand(unoCommand,params);if(jsdialogDropdown)JSDialog.CloseAllDropdowns(
);else closePopup()}global.setConditionalFormat=setConditionalFormat;function moreConditionalFormat(
unoCommand,jsdialogDropdown){map.sendUnoCommand(unoCommand);if(jsdialogDropdown
)JSDialog.CloseAllDropdowns();else closePopup()}global.moreConditionalFormat=moreConditionalFormat;
function getConditionalFormatMenuElementsImpl(more,type,count,unoCommand,jsdialogDropdown){
const table=document.createElement("table");table.id="conditionalformatmenu-grid";for(
let i=0;i<count;i+=3){for(let j=i;j<i+3;j++){let number=j;if(type==="iconset"&&number>=7)number++;
const iconClass=type+(number<10?"0":"")+number;const button=document.createElement("button");
button.className="w2ui-tb-image w2ui-icon "+iconClass;button.onclick=function(){
setConditionalFormat(number,unoCommand,!!jsdialogDropdown)};table.appendChild(button)}}if(more){
const button=document.createElement("button");button.id="more";button.onclick=function(){
moreConditionalFormat(unoCommand,!!jsdialogDropdown)};button.textContent=_("More...");
table.appendChild(button)}return table}function getConditionalFormatMenuElements(more,
jsdialogDropdown){return getConditionalFormatMenuElementsImpl(more,"iconset",21,
".uno:IconSetFormatDialog",jsdialogDropdown)}
global.getConditionalFormatMenuElements=getConditionalFormatMenuElements;
function getConditionalColorScaleMenuElements(more,jsdialogDropdown){
return getConditionalFormatMenuElementsImpl(more,"scaleset",12,".uno:ColorScaleFormatDialog",
jsdialogDropdown)}global.getConditionalColorScaleMenuElements=getConditionalColorScaleMenuElements;
function getConditionalDataBarMenuElements(more,jsdialogDropdown){
return getConditionalFormatMenuElementsImpl(more,"databarset",12,".uno:DataBarFormatDialog",
jsdialogDropdown)}global.getConditionalDataBarMenuElements=getConditionalDataBarMenuElements;
var sendInsertTableFunction=function(event){if(event.target.tagName!=="BUTTON")return;var col=$(
event.target).index()+1;var row=$(event.target).parent().index()+1;$(".col").removeClass("bright");
var status=$("#inserttable-status");status.html("<br/>");
var msg="uno .uno:InsertTable {"+' "Columns": { "type": "long","value": '+col+' }, "Rows": { "type": "long","value": '+row+" }}"
app.socket.sendMessage(msg);closePopup()};var highlightTableFunction=function(event){if(
event.target.tagName!=="BUTTON")return;var col=$(event.target).index()+1;var row=$(event.target
).parent().index()+1;$(".col").removeClass("bright");$(".col").removeAttr("title");var elements=$(
".row:nth-child(-n+"+row+") .col:nth-child(-n+"+col+")").addClass("bright");
var lastHighlightedCell=elements.last();lastHighlightedCell.attr("title",`${col} x ${row}`)};
function getInsertTablePopupElements(closeCallback){lastClosePopupCallback=closeCallback;
const container=document.createElement("div");const grid=document.createElement("div");
grid.className="inserttable-grid";grid.onmouseover=highlightTableFunction;
grid.onclick=sendInsertTableFunction;container.textContent="\n";container.appendChild(grid);
insertTable(container.children[0]);const wrapperContainer=document.createElement("div");
const wrapper=document.createElement("div");wrapper.id="inserttable-wrapper";
const popUp=document.createElement("div");popUp.id="inserttable-popup";
popUp.className="inserttable-pop ui-widget ui-corner-all";popUp.tabIndex=0;
wrapperContainer.appendChild(wrapper);wrapperContainer.appendChild(popUp);popUp.appendChild(grid);
return wrapperContainer}function insertTable(grid=document.getElementsByClassName("inserttable-grid"
)[0]){var rows=10;var cols=10;for(var r=0;r<rows;r++){const row=document.createElement("div");
row.className="row";grid.appendChild(row);for(var c=0;c<cols;c++){const col=document.createElement(
"button");col.setAttribute("aria-label",1+r+"x"+(1+c));col.onfocus=highlightTableFunction;
col.className="col";row.appendChild(col)}}}var shapes={insertshapes:{"Basic Shapes":[{
img:"basicshapes_rectangle",uno:"BasicShapes.rectangle",text:_UNO(".uno:BasicShapes.rectangle")},{
img:"basicshapes_round-rectangle",uno:"BasicShapes.round-rectangle",text:_UNO(
".uno:BasicShapes.round-rectangle")},{img:"basicshapes_quadrat",uno:"BasicShapes.quadrat",text:_UNO(
".uno:BasicShapes.quadrat")},{img:"basicshapes_round-quadrat",uno:"BasicShapes.round-quadrat",
text:_UNO(".uno:BasicShapes.round-quadrat")},{img:"basicshapes_circle",uno:"BasicShapes.circle",
text:_UNO(".uno:BasicShapes.circle")},{img:"basicshapes_ellipse",uno:"BasicShapes.ellipse",
text:_UNO(".uno:BasicShapes.ellipse")},{img:"basicshapes_circle-pie",uno:"BasicShapes.circle-pie",
text:_UNO(".uno:BasicShapes.circle-pie")},{img:"basicshapes_isosceles-triangle",
uno:"BasicShapes.isosceles-triangle",text:_UNO(".uno:BasicShapes.isosceles-triangle")},{
img:"basicshapes_right-triangle",uno:"BasicShapes.right-triangle",text:_UNO(
".uno:BasicShapes.right-triangle")},{img:"basicshapes_trapezoid",uno:"BasicShapes.trapezoid",
text:_UNO(".uno:BasicShapes.trapezoid")},{img:"basicshapes_diamond",uno:"BasicShapes.diamond",
text:_UNO(".uno:BasicShapes.diamond")},{img:"basicshapes_parallelogram",
uno:"BasicShapes.parallelogram",text:_UNO(".uno:BasicShapes.parallelogram")},{
img:"basicshapes_pentagon",uno:"BasicShapes.pentagon",text:_UNO(".uno:BasicShapes.pentagon")},{
img:"basicshapes_hexagon",uno:"BasicShapes.hexagon",text:_UNO(".uno:BasicShapes.hexagon")},{
img:"basicshapes_octagon",uno:"BasicShapes.octagon",text:_UNO(".uno:BasicShapes.octagon")},{
img:"basicshapes_cross",uno:"BasicShapes.cross",text:_UNO(".uno:BasicShapes.cross")},{
img:"basicshapes_ring",uno:"BasicShapes.ring",text:_UNO(".uno:BasicShapes.ring")},{
img:"basicshapes_block-arc",uno:"BasicShapes.block-arc",text:_UNO(".uno:BasicShapes.block-arc")},{
img:"basicshapes_can",uno:"BasicShapes.can",text:_UNO(".uno:BasicShapes.can")},{
img:"basicshapes_cube",uno:"BasicShapes.cube",text:_UNO(".uno:BasicShapes.cube")},{
img:"basicshapes_paper",uno:"BasicShapes.paper",text:_UNO(".uno:BasicShapes.paper")},{
img:"basicshapes_frame",uno:"BasicShapes.frame",text:_UNO(".uno:BasicShapes.frame")}],
"Symbol Shapes":[{img:"symbolshapes",uno:"SymbolShapes.smiley",text:_UNO(".uno:SymbolShapes.smiley")
},{img:"symbolshapes_sun",uno:"SymbolShapes.sun",text:_UNO(".uno:SymbolShapes.sun")},{
img:"symbolshapes_moon",uno:"SymbolShapes.moon",text:_UNO(".uno:SymbolShapes.moon")},{
img:"symbolshapes_lightning",uno:"SymbolShapes.lightning",text:_UNO(".uno:SymbolShapes.lightning")},
{img:"symbolshapes_heart",uno:"SymbolShapes.heart",text:_UNO(".uno:SymbolShapes.heart")},{
img:"symbolshapes_flower",uno:"SymbolShapes.flower",text:_UNO(".uno:SymbolShapes.flower")},{
img:"symbolshapes_cloud",uno:"SymbolShapes.cloud",text:_UNO(".uno:SymbolShapes.cloud")},{
img:"symbolshapes_forbidden",uno:"SymbolShapes.forbidden",text:_UNO(".uno:SymbolShapes.forbidden")},
{img:"symbolshapes_puzzle",uno:"SymbolShapes.puzzle",text:_UNO(".uno:SymbolShapes.puzzle")},{
img:"symbolshapes_bracket-pair",uno:"SymbolShapes.bracket-pair",text:_UNO(
".uno:SymbolShapes.bracket-pair")},{img:"symbolshapes_left-bracket",uno:"SymbolShapes.left-bracket",
text:_UNO(".uno:SymbolShapes.left-bracket")},{img:"symbolshapes_right-bracket",
uno:"SymbolShapes.right-bracket",text:_UNO(".uno:SymbolShapes.right-bracket")},{
img:"symbolshapes_brace-pair",uno:"SymbolShapes.brace-pair",text:_UNO(".uno:SymbolShapes.brace-pair"
)},{img:"symbolshapes_left-brace",uno:"SymbolShapes.left-brace",text:_UNO(
".uno:SymbolShapes.left-brace")},{img:"symbolshapes_right-brace",uno:"SymbolShapes.right-brace",
text:_UNO(".uno:SymbolShapes.right-brace")},{img:"symbolshapes_quad-bevel",
uno:"SymbolShapes.quad-bevel",text:_UNO(".uno:SymbolShapes.quad-bevel")},{
img:"symbolshapes_octagon-bevel",uno:"SymbolShapes.octagon-bevel",text:_UNO(
".uno:SymbolShapes.octagon-bevel")},{img:"symbolshapes_diamond-bevel",
uno:"SymbolShapes.diamond-bevel",text:_UNO(".uno:SymbolShapes.diamond-bevel")}],"Block Arrows":[{
img:"arrowshapes_left-arrow",uno:"ArrowShapes.left-arrow",text:_UNO(".uno:ArrowShapes.left-arrow")},
{img:"arrowshapes_right-arrow",uno:"ArrowShapes.right-arrow",text:_UNO(
".uno:ArrowShapes.right-arrow")},{img:"arrowshapes_up-arrow",uno:"ArrowShapes.up-arrow",text:_UNO(
".uno:ArrowShapes.up-arrow")},{img:"arrowshapes_down-arrow",uno:"ArrowShapes.down-arrow",text:_UNO(
".uno:ArrowShapes.down-arrow")},{img:"arrowshapes_left-right-arrow",
uno:"ArrowShapes.left-right-arrow",text:_UNO(".uno:ArrowShapes.left-right-arrow")},{
img:"arrowshapes_up-down-arrow",uno:"ArrowShapes.up-down-arrow",text:_UNO(
".uno:ArrowShapes.up-down-arrow")},{img:"arrowshapes_up-right-arrow",
uno:"ArrowShapes.up-right-arrow",text:_UNO(".uno:ArrowShapes.up-right-arrow")},{
img:"arrowshapes_up-right-down-arrow",uno:"ArrowShapes.up-right-down-arrow",text:_UNO(
".uno:ArrowShapes.up-right-down-arrow")},{img:"arrowshapes_quad-arrow",uno:"ArrowShapes.quad-arrow",
text:_UNO(".uno:ArrowShapes.quad-arrow")},{img:"arrowshapes_corner-right-arrow",
uno:"ArrowShapes.corner-right-arrow",text:_UNO(".uno:ArrowShapes.corner-right-arrow")},{
img:"arrowshapes_split-arrow",uno:"ArrowShapes.split-arrow",text:_UNO(".uno:ArrowShapes.split-arrow"
)},{img:"arrowshapes_striped-right-arrow",uno:"ArrowShapes.striped-right-arrow",text:_UNO(
".uno:ArrowShapes.striped-right-arrow")},{img:"arrowshapes_notched-right-arrow",
uno:"ArrowShapes.notched-right-arrow",text:_UNO(".uno:ArrowShapes.notched-right-arrow")},{
img:"arrowshapes_pentagon-right",uno:"ArrowShapes.pentagon-right",text:_UNO(
".uno:ArrowShapes.pentagon-right")},{img:"arrowshapes_chevron",uno:"ArrowShapes.chevron",text:_UNO(
".uno:ArrowShapes.chevron")},{img:"arrowshapes_right-arrow-callout",
uno:"ArrowShapes.right-arrow-callout",text:_UNO(".uno:ArrowShapes.right-arrow-callout")},{
img:"arrowshapes_left-arrow-callout",uno:"ArrowShapes.left-arrow-callout",text:_UNO(
".uno:ArrowShapes.left-arrow-callout")},{img:"arrowshapes_up-arrow-callout",
uno:"ArrowShapes.up-arrow-callout",text:_UNO(".uno:ArrowShapes.up-arrow-callout")},{
img:"arrowshapes_down-arrow-callout",uno:"ArrowShapes.down-arrow-callout",text:_UNO(
".uno:ArrowShapes.down-arrow-callout")},{img:"arrowshapes_left-right-arrow-callout",
uno:"ArrowShapes.left-right-arrow-callout",text:_UNO(".uno:ArrowShapes.left-right-arrow-callout")},{
img:"arrowshapes_up-down-arrow-callout",uno:"ArrowShapes.up-down-arrow-callout",text:_UNO(
".uno:ArrowShapes.up-down-arrow-callout")},{img:"arrowshapes_up-right-arrow-callout",
uno:"ArrowShapes.up-right-arrow-callout",text:_UNO(".uno:ArrowShapes.up-right-arrow-callout")},{
img:"arrowshapes_quad-arrow-callout",uno:"ArrowShapes.quad-arrow-callout",text:_UNO(
".uno:ArrowShapes.quad-arrow-callout")},{img:"arrowshapes_circular-arrow",
uno:"ArrowShapes.circular-arrow",text:_UNO(".uno:ArrowShapes.circular-arrow")},{
img:"arrowshapes_split-round-arrow",uno:"ArrowShapes.split-round-arrow",text:_UNO(
".uno:ArrowShapes.split-round-arrow")},{img:"arrowshapes_s-sharped-arrow",
uno:"ArrowShapes.s-sharped-arrow",text:_UNO(".uno:ArrowShapes.s-sharped-arrow")}],
"Stars and Banners":[{img:"starshapes_bang",uno:"StarShapes.bang",text:_UNO(".uno:StarShapes.bang")}
,{img:"starshapes_star4",uno:"StarShapes.star4",text:_UNO(".uno:StarShapes.star4")},{
img:"starshapes_star5",uno:"StarShapes.star5",text:_UNO(".uno:StarShapes.star5")},{
img:"starshapes_star6",uno:"StarShapes.star6",text:_UNO(".uno:StarShapes.star6")},{
img:"starshapes_star8",uno:"StarShapes.star8",text:_UNO(".uno:StarShapes.star8")},{
img:"starshapes_star12",uno:"StarShapes.star12",text:_UNO(".uno:StarShapes.star12")},{
img:"starshapes_star24",uno:"StarShapes.star24",text:_UNO(".uno:StarShapes.star24")},{
img:"starshapes_concave-star6",uno:"StarShapes.concave-star6",text:_UNO(
".uno:StarShapes.concave-star6")},{img:"starshapes_vertical-scroll",
uno:"StarShapes.vertical-scroll",text:_UNO(".uno:StarShapes.vertical-scroll")},{
img:"starshapes_horizontal-scroll",uno:"StarShapes.horizontal-scroll",text:_UNO(
".uno:StarShapes.horizontal-scroll")},{img:"starshapes_signet",uno:"StarShapes.signet",text:_UNO(
".uno:StarShapes.signet")},{img:"starshapes_doorplate",uno:"StarShapes.doorplate",text:_UNO(
".uno:StarShapes.doorplate")}],Callouts:[{img:"calloutshapes_rectangular-callout",
uno:"CalloutShapes.rectangular-callout",text:_UNO(".uno:CalloutShapes.rectangular-callout")},{
img:"calloutshapes_round-rectangular-callout",uno:"CalloutShapes.round-rectangular-callout",
text:_UNO(".uno:CalloutShapes.round-rectangular-callout")},{img:"calloutshapes_round-callout",
uno:"CalloutShapes.round-callout",text:_UNO(".uno:CalloutShapes.round-callout")},{
img:"calloutshapes_cloud-callout",uno:"CalloutShapes.cloud-callout",text:_UNO(
".uno:CalloutShapes.cloud-callout")},{img:"calloutshapes_line-callout-1",
uno:"CalloutShapes.line-callout-1",text:_UNO(".uno:CalloutShapes.line-callout-1")},{
img:"calloutshapes_line-callout-2",uno:"CalloutShapes.line-callout-2",text:_UNO(
".uno:CalloutShapes.line-callout-2")},{img:"calloutshapes_line-callout-3",
uno:"CalloutShapes.line-callout-3",text:_UNO(".uno:CalloutShapes.line-callout-3")}],Flowchart:[{
img:"flowchartshapes_flowchart-process",uno:"FlowchartShapes.flowchart-process",text:_UNO(
".uno:FlowChartShapes.flowchart-process")},{img:"flowchartshapes_flowchart-alternate-process",
uno:"FlowchartShapes.flowchart-alternate-process",text:_UNO(
".uno:FlowChartShapes.flowchart-alternate-process")},{img:"flowchartshapes_flowchart-decision",
uno:"FlowchartShapes.flowchart-decision",text:_UNO(".uno:FlowChartShapes.flowchart-decision")},{
img:"flowchartshapes_flowchart-data",uno:"FlowchartShapes.flowchart-data",text:_UNO(
".uno:FlowChartShapes.flowchart-data")},{img:"flowchartshapes_flowchart-predefined-process",
uno:"FlowchartShapes.flowchart-predefined-process",text:_UNO(
".uno:FlowChartShapes.flowchart-predefined-process")},{
img:"flowchartshapes_flowchart-internal-storage",uno:"FlowchartShapes.flowchart-internal-storage",
text:_UNO(".uno:FlowChartShapes.flowchart-internal-storage")},{
img:"flowchartshapes_flowchart-document",uno:"FlowchartShapes.flowchart-document",text:_UNO(
".uno:FlowChartShapes.flowchart-document")},{img:"flowchartshapes_flowchart-multidocument",
uno:"FlowchartShapes.flowchart-multidocument",text:_UNO(
".uno:FlowChartShapes.flowchart-multidocument")},{img:"flowchartshapes_flowchart-terminator",
uno:"FlowchartShapes.flowchart-terminator",text:_UNO(".uno:FlowChartShapes.flowchart-terminator")},{
img:"flowchartshapes_flowchart-preparation",uno:"FlowchartShapes.flowchart-preparation",text:_UNO(
".uno:FlowChartShapes.flowchart-preparation")},{img:"flowchartshapes_flowchart-manual-input",
uno:"FlowchartShapes.flowchart-manual-input",text:_UNO(".uno:FlowChartShapes.flowchart-manual-input"
)},{img:"flowchartshapes_flowchart-manual-operation",
uno:"FlowchartShapes.flowchart-manual-operation",text:_UNO(
".uno:FlowChartShapes.flowchart-manual-operation")},{img:"flowchartshapes_flowchart-connector",
uno:"FlowchartShapes.flowchart-connector",text:_UNO(".uno:FlowChartShapes.flowchart-connector")},{
img:"flowchartshapes_flowchart-off-page-connector",
uno:"FlowchartShapes.flowchart-off-page-connector",text:_UNO(
".uno:FlowChartShapes.flowchart-off-page-connector")},{img:"flowchartshapes_flowchart-card",
uno:"FlowchartShapes.flowchart-card",text:_UNO(".uno:FlowChartShapes.flowchart-card")},{
img:"flowchartshapes_flowchart-punched-tape",uno:"FlowchartShapes.flowchart-punched-tape",text:_UNO(
".uno:FlowChartShapes.flowchart-punched-tape")},{img:"flowchartshapes_flowchart-summing-junction",
uno:"FlowchartShapes.flowchart-summing-junction",text:_UNO(
".uno:FlowChartShapes.flowchart-summing-junction")},{img:"flowchartshapes_flowchart-or",
uno:"FlowchartShapes.flowchart-or",text:_UNO(".uno:FlowChartShapes.flowchart-or")},{
img:"flowchartshapes_flowchart-collate",uno:"FlowchartShapes.flowchart-collate",text:_UNO(
".uno:FlowChartShapes.flowchart-collate")},{img:"flowchartshapes_flowchart-sort",
uno:"FlowchartShapes.flowchart-sort",text:_UNO(".uno:FlowChartShapes.flowchart-sort")},{
img:"flowchartshapes_flowchart-extract",uno:"FlowchartShapes.flowchart-extract",text:_UNO(
".uno:FlowChartShapes.flowchart-extract")},{img:"flowchartshapes_flowchart-merge",
uno:"FlowchartShapes.flowchart-merge",text:_UNO(".uno:FlowChartShapes.flowchart-merge")},{
img:"flowchartshapes_flowchart-stored-data",uno:"FlowchartShapes.flowchart-stored-data",text:_UNO(
".uno:FlowChartShapes.flowchart-stored-data")},{img:"flowchartshapes_flowchart-delay",
uno:"FlowchartShapes.flowchart-delay",text:_UNO(".uno:FlowChartShapes.flowchart-delay")},{
img:"flowchartshapes_flowchart-sequential-access",uno:"FlowchartShapes.flowchart-sequential-access",
text:_UNO(".uno:FlowChartShapes.flowchart-sequential-access")},{
img:"flowchartshapes_flowchart-magnetic-disk",uno:"FlowchartShapes.flowchart-magnetic-disk",
text:_UNO(".uno:FlowChartShapes.flowchart-magnetic-disk")},{
img:"flowchartshapes_flowchart-direct-access-storage",
uno:"FlowchartShapes.flowchart-direct-access-storage",text:_UNO(
".uno:FlowChartShapes.flowchart-direct-access-storage")},{img:"flowchartshapes_flowchart-display",
uno:"FlowchartShapes.flowchart-display",text:_UNO(".uno:FlowChartShapes.flowchart-display")}]},
insertconnectors:{Connectors:[{img:"connectors_connector",uno:"Connector",text:_UNO(".uno:Connector"
,"presentation")},{img:"connectors_connectorarrows",uno:"ConnectorArrows",text:_UNO(
".uno:ConnectorArrows","presentation")},{img:"connectors_connectorarrowend",uno:"ConnectorArrowEnd",
text:_UNO(".uno:ConnectorArrowEnd","presentation")},{img:"connectors_connectorlinearrowend",
uno:"ConnectorLineArrowEnd",text:_UNO(".uno:ConnectorLineArrowEnd","presentation")},{
img:"connectors_connectorcurvearrowend",uno:"ConnectorCurveArrowEnd",text:_UNO(
".uno:ConnectorCurveArrowEnd","presentation")},{img:"connectors_connectorlinesarrowend",
uno:"ConnectorLinesArrowEnd",text:_UNO(".uno:ConnectorLinesArrowEnd","presentation")},{
img:"connectors_connectorline",uno:"ConnectorLine",text:_UNO(".uno:ConnectorLine","presentation")},{
img:"connectors_connectorcurve",uno:"ConnectorCurve",text:_UNO(".uno:ConnectorCurve","presentation")
},{img:"connectors_connectorlines",uno:"ConnectorLines",text:_UNO(".uno:ConnectorLines",
"presentation")},{img:"connectors_connectorlinearrows",uno:"ConnectorLineArrows",text:_UNO(
".uno:ConnectorLineArrows","presentation")},{img:"connectors_connectorcurvearrows",
uno:"ConnectorCurvearrows",text:_UNO(".uno:ConnectorCurveArrows","presentation")}]}};
function createShapesPanel(shapeType){const wrapper=document.createElement("div");
wrapper.className="ui-grid-cell";wrapper.id="insertshape-wrapper";const grid=document.createElement(
"div");grid.className="insertshape-grid insertshapes";var collection=shapes[shapeType];for(
var s in collection){const rowHeader=document.createElement("div");
rowHeader.className="row-header cool-font";rowHeader.textContent=_(s);grid.appendChild(rowHeader);
const row=document.createElement("div");row.className="row";grid.appendChild(row);for(
let idx=0;idx<collection[s].length;++idx){const shape=collection[s][idx];
const col=document.createElement("div");col.className="col w2ui-icon "+shape.img;
col.dataset.uno=shape.uno;row.appendChild(col)}}grid.onclick=function(e){map.sendUnoCommand(
".uno:"+e.target.dataset.uno);map._docLayer._closeMobileWizard()};wrapper.appendChild(grid);
return wrapper}var onShapeClickFunction=function(e){let name=$(e.target).data().uno;if(!name)return;
app.map.sendUnoCommand(".uno:"+name);closePopup();e.stopPropagation()};
var onShapeKeyUpFunction=function(event){if(event.code==="Enter"||event.code==="Space"){
app.map.sendUnoCommand(".uno:"+event.target.dataset.uno);closePopup()}event.stopPropagation()};
var onShapeKeyDownFunction=function(event){if(event.code==="Escape"){closePopup();app.map.focus()}};
function insertShapes(shapeType,grid=document.getElementsByClassName("insertshape-grid")[0],width){
grid.classList.add(shapeType);if(window.mode.isDesktop()||window.mode.isTablet()
)grid.style.marginBottom="0px";if(grid.firstChild)return;var collection=shapes[shapeType];for(
let s in collection){const rowHeader=document.createElement("div");
rowHeader.className="row-header cool-font";rowHeader.textContent=_(s);grid.appendChild(rowHeader);
var rows=Math.ceil(collection[s].length/width);var idx=0;const row=document.createElement("div");
row.className="row";grid.appendChild(row);for(let r=0;r<rows;r++){for(let c=0;c<width;c++){if(
idx>=collection[s].length){break}const shape=collection[s][idx++];const col=document.createElement(
"div");col.className="col w2ui-icon "+shape.img;col.dataset.uno=shape.uno;col.setAttribute(
"data-cooltip",shape.text);window.L.control.attachTooltipEventListener(col,map);col.tabIndex=0;
col.setAttribute("index",r+":"+c);row.appendChild(col)}if(idx>=collection[s].length)break}}}
function getShapesPopupElements(closeCallback){lastClosePopupCallback=closeCallback;
const grid=document.createElement("div");grid.className="insertshape-grid";
grid.onclick=onShapeClickFunction;grid.onkeyup=onShapeKeyUpFunction;
grid.onkeydown=onShapeKeyDownFunction;const container=document.createElement("div");
container.appendChild(grid);insertShapes("insertshapes",container.children[0],10);
const wrapperContainer=document.createElement("div");const wrapper=document.createElement("div");
wrapper.id="insertshape-wrapper";wrapperContainer.appendChild(wrapper);
const popUp=document.createElement("div");popUp.id="insertshape-popup";
popUp.className="insertshape-pop ui-widget ui-corner-all";wrapperContainer.appendChild(popUp);
popUp.appendChild(grid);return wrapperContainer}function getConnectorsPopupElements(closeCallback){
lastClosePopupCallback=closeCallback;const gridContainer=document.createElement("div");
const grid=document.createElement("div");grid.className="insertshape-grid";
grid.onclick=onShapeClickFunction;grid.onkeyup=onShapeKeyUpFunction;
grid.onkeydown=onShapeKeyDownFunction;gridContainer.appendChild(grid);insertShapes(
"insertconnectors",gridContainer.children[0],2);const wrapperContainer=document.createElement("div")
const wrapper=document.createElement("div");wrapper.id="insertshape-wrapper";
const popUp=document.createElement("div");popUp.id="insertshape-popup";
popUp.className="insertshape-pop ui-widget ui-corner-all";wrapperContainer.appendChild(wrapper);
wrapperContainer.appendChild(popUp);popUp.appendChild(grid);return wrapperContainer}
function getColorPickerData(type){var uno;if(type==="Font Color"){if(map.getDocType(
)==="spreadsheet"||map.getDocType()==="presentation")uno=".uno:Color";else uno=".uno:FontColor"
}else if(type==="Highlight Color"){if(map.getDocType()==="spreadsheet"
)uno=".uno:BackgroundColor";else uno=".uno:CharBackColor"}var data={id:"colorpicker",type:"window",
text:_(type),enabled:"true",children:[{type:"toolitem",text:"",command:uno,nosubmenu:true}],
vertical:"true"};return data}function unoCmdToToolbarId(commandname){var id=commandname.toLowerCase(
).substr(5);var selectionType="text";if(map._clip&&map._clip._selectionType
)selectionType=map._clip._selectionType;if(map.getDocType()==="spreadsheet"){switch(id){
case"alignleft":id="leftpara";break;case"alignhorizontalcenter":id="centerpara";break;
case"alignright":id="rightpara";break}}else if(selectionType=="complex"){if(
id==="leftpara"||id==="rightpara"||id==="centerpara"){id=""}switch(id){case"objectalignleft":
id="leftpara";break;case"aligncenter":id="centerpara";break;case"objectalignright":id="rightpara";
break}}else if(id==="objectalignleft"||id==="aligncenter"||id==="objectalignright"){id=""}if(
id==="hyperlinkdialog")id="link";return id}function onInsertGraphic(){
var insertGraphic=window.L.DomUtil.get("insertgraphic");if("files"in insertGraphic){for(
var i=0;i<insertGraphic.files.length;i++){var file=insertGraphic.files[i];map.insertGraphic(file)}}
insertGraphic.value=null;return false}function onInsertMultimedia(){
var insertMultimedia=window.L.DomUtil.get("insertmultimedia");if("files"in insertMultimedia){for(
var i=0;i<insertMultimedia.files.length;i++){var file=insertMultimedia.files[i];
map.insertMultimedia(file)}}insertMultimedia.value=null;return false}function onInsertBackground(){
var selectBackground=window.L.DomUtil.get("selectbackground");if("files"in selectBackground){for(
var i=0;i<selectBackground.files.length;i++){var file=selectBackground.files[i];
map.selectBackground(file)}}selectBackground.value=null;return false}function onWopiProps(e){if(
e.DisableCopy){$("#addressInput input").bind("copy",function(evt){evt.preventDefault()})}}
function processStateChangedCommand(commandName,state){var toolbar=window.mode.isMobile(
)?app.map.mobileBottomBar:app.map.topToolbar;if(!toolbar)return;var color,div;if(!commandName)return
if(commandName===".uno:AssignLayout"){$(".styles-select").val(state).trigger("change")}else if(
commandName===".uno:FontColor"||commandName===".uno:Color"){color=parseInt(state);if(color===-1){
color="transparent"}else{color=color.toString(16);color="#"+Array(7-color.length).join("0")+color}
div=window.L.DomUtil.get("fontcolorindicator");if(div){window.L.DomUtil.setStyle(div,"background",
color)}}else if(commandName===".uno:BackgroundColor"||commandName===".uno:CharBackColor"){
color=parseInt(state);if(color===-1){color="transparent"}else{color=color.toString(16);
color="#"+Array(7-color.length).join("0")+color}div=window.L.DomUtil.get("backcolorindicator");if(
div){window.L.DomUtil.setStyle(div,"background",color)}}else if(commandName===".uno:ModifiedStatus"
){if(document.getElementById("save")){if(state==="true"&&map.saveState
)map.saveState.showModifiedStatus();else document.getElementById("save").classList.remove(
"savemodified")}state=""}else if(commandName===".uno:DocumentRepair"){if(state==="true"){
toolbar.enableItem("repair",true)}else{toolbar.enableItem("repair",false)}}if(
commandName===".uno:SpacePara1"||commandName===".uno:SpacePara15"||commandName===".uno:SpacePara2"
){}var id=unoCmdToToolbarId(commandName);if(id==="")return;if(state==="true"){if(map.isEditMode()){
toolbar.enableItem(id,true)}}else if(state==="false"){if(map.isEditMode()){toolbar.enableItem(id,
true)}}else if(map.isEditMode()&&(state==="enabled"||state==="disabled")){if(state==="enabled"){
toolbar.enableItem(id,true)}else{toolbar.enableItem(id,false)}}}function onCommandStateChanged(e){
processStateChangedCommand(e.commandName,e.state)}function onCommandResult(e){
var commandName=e.commandName;if(commandName===".uno:Save"){if(e.success){map._everModified=true;if(
map._renameFilename){var renameFilename=map._renameFilename;map._renameFilename="";map.renameFile(
renameFilename)}}var postMessageObj={success:e.success};if(!e.success){postMessageObj["result"
]=e.result&&e.result.value}map.fire("postMessage",{msgId:"Action_Save_Resp",args:postMessageObj})
}else if((commandName===".uno:Undo"||commandName===".uno:Redo"
)&&e.success===true&&e.result.value&&!isNaN(e.result.value)){var alertOptions={messages:[_(
"Conflict Undo/Redo with multiple users. Please use document repair to resolve")]};
JSDialog.showInfoModalWithOptions("undo-conflict-error",alertOptions)}else if(map.zotero&&(
commandName===".uno:DeleteTextFormField"&&e.result.DeleteTextFormField.startsWith("ADDIN ZOTERO_"
)||commandName===".uno:DeleteField"&&e.result.DeleteField.startsWith("ZOTERO_"
)||commandName===".uno:DeleteSection"&&e.result.DeleteSection.startsWith("ZOTERO_BIBL"))){if(
commandName===".uno:DeleteSection")map.zotero.markBibliographyStyleHasBeenSet(true);
map.zotero.handleRefreshCitationsAndBib(false)}else if(
map.zotero&&commandName===".uno:DeleteBookmark"&&e.result.DeleteBookmark.startsWith("ZOTERO_BREF_")
){map.zotero.setCustomProperty(e.result.DeleteBookmark,"");map.zotero.handleRefreshCitationsAndBib(
false)}else if(commandName===".uno:OpenHyperlink"){setTimeout(function(){map._docLayer.scrollToPos(
new cool.SimplePoint(app.file.textCursor.rectangle.x1,app.file.textCursor.rectangle.y1))},0)}}
function onUpdatePermission(e){var toolbar=window.mode.isMobile(
)?app.map.mobileBottomBar:app.map.topToolbar;if(toolbar){var enabledButtons=["closemobile","undo",
"redo","hamburger-tablet"];var items=toolbar.getToolItems(app.map.getDocType()).slice();for(
var idx in items){var found=enabledButtons.filter(function(id){return id===items[idx].id});
var alwaysEnable=found.length!==0;if(e.detail.perm==="edit"){var unoCmd=map.getDocType(
)==="spreadsheet"?items[idx].unosheet:getUNOCommand(items[idx].uno);var keepDisabled=map[
"stateChangeHandler"].getItemValue(unoCmd)==="disabled";if(!keepDisabled||alwaysEnable
)toolbar.enableItem(items[idx].id,true);$(".main-nav").removeClass("readonly");$("#toolbar-down"
).removeClass("readonly")}else if(!alwaysEnable){$(".main-nav").addClass("readonly");$(
"#toolbar-down").addClass("readonly");toolbar.enableItem(items[idx].id,false)}}if(
e.detail.perm==="edit"){$("#toolbar-mobile-back").removeClass("editmode-off");$(
"#toolbar-mobile-back").addClass("editmode-on");toolbar.updateItem({id:"closemobile",
type:"customtoolitem",w2icon:"editmode"})}else{$("#toolbar-mobile-back").removeClass("editmode-on");
$("#toolbar-mobile-back").addClass("editmode-off");toolbar.updateItem({id:"closemobile",
type:"customtoolitem",w2icon:"closemobile"})}}}function editorUpdate(e){var docLayer=map._docLayer;
if(e.target.checked){var editorId=docLayer._editorId;app.setFollowingEditor(editorId);if(
editorId!==-1&&editorId!==docLayer._viewId)map._goToViewId(editorId)}else app.setFollowingOff();
map.userList.hideTooltip()}global.editorUpdate=editorUpdate;$(document).ready(function(){$(
"#insertgraphic").on("change",onInsertGraphic);$("#insertmultimedia").on("change",onInsertMultimedia
);$("#selectbackground").on("change",onInsertBackground)});function setupToolbar(e){map=e;map.on(
"search",function(e){var searchInput=window.L.DomUtil.get("search-input");
var toolbar=window.mode.isMobile()?app.map.mobileSearchBar:app.map.statusBar;if(!toolbar){
console.debug("Cannot find search bar");return}if(e.count===0){toolbar.enableItem("searchprev",false
);toolbar.enableItem("searchnext",false);toolbar.showItem("cancelsearch",false);
window.L.DomUtil.addClass(searchInput,"search-not-found");$("#findthis").addClass("search-not-found"
);const searchbox=document.getElementById("searchbox");if(searchbox&&!searchbox.hasAttribute(
"aria-live"))searchbox.setAttribute("aria-live","polite");app.searchService.resetSelection();
setTimeout(function(){$("#findthis").removeClass("search-not-found");window.L.DomUtil.removeClass(
searchInput,"search-not-found")},800)}});map.on("hyperlinkclicked",function(e){if(e.url){if(
e.coordinates){var strTwips=e.coordinates.match(/\d+/g);var linkPosition;if(strTwips.length>7){
linkPosition=new cool.SimplePoint(parseInt(strTwips[6]),parseInt(strTwips[7]))}
URLPopUpSection.showURLPopUP(e.url,new cool.SimplePoint(parseInt(strTwips[6]),parseInt(strTwips[1]))
,linkPosition)}else{map.fire("warn",{url:e.url,map:map,cmd:"openlink"})}}});app.events.on(
"updatepermission",onUpdatePermission);map.on("wopiprops",onWopiProps);map.on("commandresult",
onCommandResult);if(map.options.wopi&&window.L.Params.closeButtonEnabled&&!window.mode.isMobile()){
$("#closebuttonwrapper").css("display","flex");var button=window.L.DomUtil.get("closebutton");if(
button){const closeButtonText=_("Close document");button.setAttribute("aria-label",closeButtonText);
button.setAttribute("data-cooltip",closeButtonText);window.L.control.attachTooltipEventListener(
button,map)}}else if(!window.L.Params.closeButtonEnabled){$("#closebuttonwrapper").hide();$(
"#closebuttonwrapperseparator").hide()}else if(
window.L.Params.closeButtonEnabled&&!window.mode.isMobile()){$("#closebuttonwrapper").css("display",
"flex")}$("#closebutton").click(function(){let dispatcher=global.app.dispatcher;if(!dispatcher
)dispatcher=new app.definitions["dispatcher"]("global");dispatcher.dispatch("closeapp")})}
global.setupToolbar=setupToolbar;global.getInsertTablePopupElements=getInsertTablePopupElements;
global.getShapesPopupElements=getShapesPopupElements;
global.getConnectorsPopupElements=getConnectorsPopupElements;
global.createShapesPanel=createShapesPanel;global.getUNOCommand=getUNOCommand;
global.unoCmdToToolbarId=unoCmdToToolbarId;global.onCommandStateChanged=onCommandStateChanged;
global.processStateChangedCommand=processStateChangedCommand;
global.getColorPickerData=getColorPickerData})(window);window.L.Map.include({Locking:{
isLockedUser:false,isLockReadOnly:false,lockedCommandList:[],unlockTitle:"",unlockLink:"",
unlockDescription:"",writerHighlights:"",calcHighlights:"",impressHighlights:"",drawHighlights:""},
_setLockProps:function(lockInfo){this.Locking.isLockedUser=!!lockInfo["IsLockedUser"];
this.Locking.isLockReadOnly=!!lockInfo["IsLockReadOnly"];this.Locking.lockedCommandList=lockInfo[
"LockedCommandList"];this.Locking.unlockTitle=_(lockInfo["UnlockTitle"]);this.Locking.unlockLink=_(
lockInfo["UnlockLink"]);this.Locking.unlockDescription=_(lockInfo["UnlockDescription"]);
this.Locking.writerHighlights=_(lockInfo["WriterHighlights"]);this.Locking.calcHighlights=_(
lockInfo["CalcHighlights"]);this.Locking.impressHighlights=_(lockInfo["ImpressHighlights"]);
this.Locking.drawHighlights=_(lockInfo["DrawHighlights"]);this.Locking.unlockImageUrlPath=lockInfo[
"UnlockImageUrlPath"]},disableLockedItem:function(item,DOMParentElement,buttonToDisable){if(
this.isLockedUser()&&this.isLockedItem(item)){$(DOMParentElement).data("locked",true);$(
DOMParentElement).addClass("locking-disabled");$(buttonToDisable).off("click");var that=this;if(
window.mode.isMobile()){var overlay=window.L.DomUtil.create("div","locking-overlay",DOMParentElement
);var lock=window.L.DomUtil.create("img","locking-overlay-lock",overlay);app.LOUtil.setImage(lock,
"lc_lock.svg",this)}$(DOMParentElement).click(function(event){event.stopPropagation();
that.openUnlockPopup("")})}},openUnlockPopup:function(cmd){if(this.isRestrictedUser(
)&&this.isRestrictedItem(cmd)||this.uiManager.isAnyDialogOpen())return;var message=[
'<div class="container">','<img id="unlock-image">','<div class="item">',
"<h1>"+this.Locking.unlockTitle+"</h1>","<p>"+this.Locking.unlockDescription+"<p>","<ul>"];
var highlights=[this.Locking.writerHighlights,this.Locking.calcHighlights,
this.Locking.impressHighlights,this.Locking.drawHighlights];highlights.forEach(function(highlight){
if(highlight)message.push("<li>"+highlight+"</li>")});message.push("</ul>","</div>","</div>");
message=message.join("");const modalId="unlock-features-popup";this.uiManager.showInfoModal(modalId,
null," "," ",_("Unlock"),()=>{window.open(this.Locking.unlockLink,"_blank");
this.uiManager.closeModal(this.uiManager.generateModalId("unlock-features-popup"))},true);
app.layoutingService.appendLayoutingTask(()=>{let modal=document.getElementById(modalId);
let paraTag=modal.querySelectorAll("p")[0];if(paraTag)paraTag.outerHTML=message;else{
var el=document.createElement("p");modal.insertBefore(el,modal.firstChild);el.outerHTML=message}
let unlockImage=document.getElementById("unlock-image");if(this.Locking.unlockImageUrlPath){
unlockImage.src="remote/static"+this.Locking.unlockImageUrlPath}else{
unlockImage.src="images/lock-illustration.svg"}})},isLockedItem:function(item){
var commands=this._extractCommand(item);for(var i in commands){if(
this.Locking.lockedCommandList.indexOf(commands[i])>=0)return true}return false},
isLockedUser:function(){return this.Locking.isLockedUser},Restriction:{isRestrictedUser:false,
restrictedCommandList:[]},_setRestrictions:function(restrictionInfo){
this.Restriction.isRestrictedUser=!!restrictionInfo["IsRestrictedUser"];
this.Restriction.restrictedCommandList=restrictionInfo["RestrictedCommandList"]},
isRestrictedUser:function(){return this.Restriction.isRestrictedUser},hideRestrictedItems:function(
item,DOMParentElement,buttonToDisable){if(this.isRestrictedUser()&&this.isRestrictedItem(item)){$(
buttonToDisable).addClass("restricted-item");window.app.console.log()}},isRestrictedItem:function(
item){var commands=this._extractCommand(item);for(var i in commands){if(
this.Restriction.restrictedCommandList.indexOf(commands[i])>=0)return true}return false},
isLockReadOnly:function(){return this.Locking.isLockReadOnly},isLockedReadOnlyUser:function(){
return this.Locking.isLockedUser&&this.Locking.isLockReadOnly},_extractCommand:function(item){if(
!item)return"";var commandArray=[];if(item.lockUno||item.uno){
var uno=item.lockUno?item.lockUno:item.uno;if(typeof uno==="string")commandArray.push(uno);else{
commandArray.push(uno.textCommand);commandArray.push(uno.objectCommand);if(item.unosheet
)commandArray.push(item.unosheet)}}else if(item.command)commandArray.push(item.command);else if(
item.id)commandArray.push(item.id);else if(typeof item==="string")commandArray.push(item);for(
var command in commandArray){if(!commandArray[command].startsWith(".uno:"))commandArray[command
]=".uno:"+commandArray[command]}return commandArray}});window.L.Control=window.L.Class.extend({
options:{position:"topright"},initialize:function(options){window.L.setOptions(this,options)},
getPosition:function(){return this.options.position},setPosition:function(position){
var map=this._map;if(map){map.removeControl(this)}this.options.position=position;if(map){
map.addControl(this)}return this},getContainer:function(){return this._container},addTo:function(map
){this.remove();this._map=map;var container=this._container=this.onAdd(map),pos=this.getPosition(),
corner=map._controlCorners[pos];window.L.DomUtil.addClass(container,"leaflet-control");if(
pos.indexOf("bottom")!==-1){corner.insertBefore(container,corner.firstChild)}else{
corner.appendChild(container)}if(this.onAdded){this.onAdded(this._map)}return this},remove:function(
){if(!this._map){return this}window.L.DomUtil.remove(this._container);if(this.onRemove){
this.onRemove(this._map)}this._map=null;return this},isVisible:function(){if(!this._map){
return false}var corner=this._map._controlCorners[this.options.position];
return corner.hasChildNodes()}});window.L.control=function(options){return new window.L.Control(
options)};window.L.Map.include({addControl:function(control){control._map=this;control.onAdd(this);
return this},removeControl:function(control){control.remove();return this},_initControlPos:function(
){var corners=this._controlCorners={},l="leaflet-",
container=this._controlContainer=window.L.DomUtil.create("div",l+"control-container",this._container
);function createCorner(vSide,hSide){var className=l+vSide+" "+l+hSide;corners[vSide+hSide
]=window.L.DomUtil.create("div",className,container)}createCorner("top","left");createCorner("top",
"right");createCorner("bottom","left");createCorner("bottom","right")},_clearControlPos:function(){
window.L.DomUtil.remove(this._controlContainer)}});
window.L.Control.PartsPreview=window.L.Control.extend({options:{fetchThumbnail:true,autoUpdate:true,
imageClass:"",frameClass:"",axis:"",allowOrientation:true,maxWidth:window.mode.isDesktop(
)?180:window.mode.isTablet()?120:60,maxHeight:window.mode.isDesktop()?180:window.mode.isTablet(
)?120:60},partsFocused:false,initialize:function(container,preview,options){window.L.setOptions(this
,options);if(!container){container=window.L.DomUtil.get("presentation-controls-wrapper")}if(!preview
){preview=window.L.DomUtil.get("slide-sorter")}this._container=container;
this._partsPreviewCont=preview;this._partsPreviewCont.onscroll=this._onScroll.bind(this);
this._idNum=0;this._width=0;this._height=0},onAdd:function(map){this._previewInitialized=false;
this._previewTiles=[];this._direction=this.options.allowOrientation?!window.mode.isDesktop(
)&&window.L.DomUtil.isPortrait()?"x":"y":this.options.axis;map.on("updateparts",this._updateDisabled
,this);map.on("updatepart",this._updatePart,this);map.on("invalidateparts",this._invalidateParts,
this);map.on("tilepreview",this._updatePreview,this);map.on("insertpage",this._insertPreview,this);
map.on("deletepage",this._deletePreview,this);map.on("scrolllimits",this._invalidateParts,this);
map.on("scrolltopart",this._scrollToPart,this);map.on("beforerequestpreview",
this._beforeRequestPreview,this);window.addEventListener("resize",window.L.bind(this._resize,this))
},createScrollbar:function(){this._partsPreviewCont.style.whiteSpace="nowrap"},
_updateDisabled:function(){const selectedPart=app.map._docLayer._selectedPart;
const docType=app.map._docLayer._docType;if(docType==="presentation"||docType==="drawing"){if(
!this._previewInitialized){var docContainer=this._map.options.documentContainer;if(
!window.L.DomUtil.hasClass(docContainer,"parts-preview-document"))window.L.DomUtil.addClass(
docContainer,"parts-preview-document");var frameClass="preview-frame "+this.options.frameClass;
var frame=window.L.DomUtil.create("div",frameClass,this._partsPreviewCont);this._addDnDHandlers(
frame);frame.setAttribute("draggable",false);frame.setAttribute("id","first-drop-site");if(
window.mode.isDesktop()){window.L.DomUtil.setStyle(frame,"height","20px");window.L.DomUtil.setStyle(
frame,"margin","0em")}for(var i=0;i<app.impress.partList.length;i++){this._previewTiles.push(
this._createPreview(i,app.impress.partList[i].hash))}if(!app.file.fileBasedView
)window.L.DomUtil.addClass(this._previewTiles[selectedPart],"preview-img-currentpart");
this._onScroll();this._previewInitialized=true}else{this._syncPreviews();if(!app.file.fileBasedView
){for(let j=0;j<app.impress.partList.length;j++){window.L.DomUtil.removeClass(this._previewTiles[j],
"preview-img-currentpart");window.L.DomUtil.removeClass(this._previewTiles[j],
"preview-img-selectedpart");if(j===selectedPart)window.L.DomUtil.addClass(this._previewTiles[j],
"preview-img-currentpart");else if(app.impress.partList[j].selected)window.L.DomUtil.addClass(
this._previewTiles[j],"preview-img-selectedpart")}}}if(!this.options.allowOrientation){return}
var removePreviewImg="preview-img-portrait";var addPreviewImg="preview-img-landscape";
var removePreviewFrame="preview-frame-portrait";var addPreviewFrame="preview-frame-landscape";if(
window.L.DomUtil.isPortrait()){removePreviewImg="preview-img-landscape";
addPreviewImg="preview-img-portrait";removePreviewFrame="preview-frame-landscape";
addPreviewFrame="preview-frame-portrait"}for(i=0;i<app.impress.partList.length;i++){
window.L.DomUtil.removeClass(this._previewTiles[i],removePreviewImg);window.L.DomUtil.addClass(
this._previewTiles[i],addPreviewImg);if(app.impress.isSlideHidden(i))window.L.DomUtil.addClass(
this._previewTiles[i],"hidden-slide");else window.L.DomUtil.removeClass(this._previewTiles[i],
"hidden-slide")}var previewFrame=$(this._partsPreviewCont).find(".preview-frame");
previewFrame.removeClass(removePreviewFrame);previewFrame.addClass(addPreviewFrame);
this._direction=!window.mode.isDesktop()&&!window.mode.isTablet()&&window.L.DomUtil.isPortrait(
)?"x":"y"}},isPaddingClick:function(element,e,part){var style=window.getComputedStyle(element,null);
var nTop=parseInt(style.getPropertyValue("padding-top"));var nRight=parseFloat(
style.getPropertyValue("padding-right"));var nLeft=parseFloat(style.getPropertyValue("padding-left")
);var nBottom=parseFloat(style.getPropertyValue("padding-bottom"));var width=element.offsetWidth;
var height=element.offsetHeight;var x=parseFloat(e.offsetX);var y=parseFloat(e.offsetY);if(
part==="top")return!(y>nTop);else if(part==="bottom")return!(y<height-nBottom);else return!(
x>nLeft&&x<width-nRight&&(y>nTop&&y<height-nBottom))},_createPreview:function(i,hashCode){
var frameClass="preview-frame "+this.options.frameClass;var frame=window.L.DomUtil.create("div",
frameClass,this._partsPreviewCont);frame.id="preview-frame-part-"+this._idNum;this._addDnDHandlers(
frame);window.L.DomUtil.create("span","preview-helper",frame);
var imgClassName="preview-img "+this.options.imageClass;var img=window.L.DomUtil.create("img",
imgClassName,frame);img.setAttribute("alt",_("preview of page %1").replace("%1",String(i+1)));
img.setAttribute("tabindex","0");img.setAttribute("data-cooltip",_("Slide %1").replace("%1",String(
i+1)));window.L.control.attachTooltipEventListener(img,this._map);
img.id="preview-img-part-"+this._idNum;img.hash=hashCode;img.src=document.querySelector(
'meta[name="previewSmile"]').content;img.fetched=false;if(!window.mode.isDesktop()){new Hammer(img,{
recognizers:[[Hammer.Press]]}).on("press",function(e){if(this._map.isEditMode()){
this._addDnDTouchHandlers(e)}}.bind(this))}window.L.DomEvent.on(img,"click",function(e){
window.L.DomEvent.stopPropagation(e);window.L.DomEvent.stop(e);var part=this._findClickedPart(
e.target.parentNode);if(part!==null)var partId=parseInt(part)-1;if(!window.mode.isDesktop(
)&&partId===this._map._docLayer._selectedPart&&!app.file.fileBasedView){if(
this._map._permission==="edit"){app.socket.sendMessage("resetselection");setTimeout(function(){
app.dispatcher.dispatch("mobile_wizard")},0)}}else{this._setPart(e);if(!window.mode.isDesktop()){
document.activeElement.blur()}}if(app.file.fileBasedView)this._map._docLayer._checkSelectedPart();
img.focus()},this);var that=this;img.onfocus=function(){that._map._clip.clearSelection();
that._map._clip.setTextSelectionType("slide");that.partsFocused=true};img.onblur=function(){
that._map._clip.clearSelection();that.partsFocused=false};var that=this;window.L.DomEvent.on(frame,
"contextmenu",function(e){var isMasterView=this._map["stateChangeHandler"].getItemValue(
".uno:SlideMasterPage");var pcw=document.getElementById("presentation-controls-wrapper");
var $trigger=$(pcw);if(isMasterView==="true"){$trigger.contextMenu(false);return}var nPos=undefined;
if(this.isPaddingClick(frame,e,"top"))nPos=that._findClickedPart(frame)-1;else if(
this.isPaddingClick(frame,e,"bottom"))nPos=that._findClickedPart(frame);$trigger.contextMenu(true);
if(!that._isSelected(e))that._setPart(e);$.contextMenu({selector:"#"+frame.id,className:"cool-font",
items:{paste:{name:app.IconUtil.createMenuItemLink(_("Paste Slide"),"Paste"),isHtmlName:true,
callback:function(key,options){var part=that._findClickedPart(options.$trigger[0].parentNode);if(
part!==null){that._setPart(that.copiedSlide);that._map.duplicatePage(parseInt(part))}},
visible:function(){return that.copiedSlide}},newslide:{name:app.IconUtil.createMenuItemLink(_UNO(
that._map._docLayer._docType=="presentation"?".uno:InsertSlide":".uno:InsertPage","presentation"),
"InsertPage"),isHtmlName:true,callback:function(){that._map.insertPage(nPos)}}}})},this);
window.L.DomEvent.on(img,"contextmenu",function(e){var isMasterView=this._map["stateChangeHandler"
].getItemValue(".uno:SlideMasterPage");var $trigger=$("#"+img.id);if(isMasterView==="true"){
$trigger.contextMenu(false);return}$trigger.contextMenu(true);if(!that._isSelected(e))that._setPart(
e);$.contextMenu({selector:"#"+img.id,className:"cool-font",items:{copy:{
name:app.IconUtil.createMenuItemLink(_("Copy"),"Copy"),isHtmlName:true,callback:function(){
that.copiedSlide=e;that._map._clip.clearSelection();that._map._clip.setTextSelectionType("slide");
that._map._clip._execCopyCutPaste("copy",".uno:CopySlide")},visible:function(){return true}},paste:{
name:app.IconUtil.createMenuItemLink(_("Paste"),"Paste"),isHtmlName:true,callback:function(){
that._map._clip._execCopyCutPaste("paste",".uno:Paste")}},newslide:{
name:app.IconUtil.createMenuItemLink(_UNO(
that._map._docLayer._docType=="presentation"?".uno:InsertSlide":".uno:InsertPage","presentation"),
"InsertPage"),isHtmlName:true,callback:function(){that._map.insertPage()}},duplicateslide:{
name:app.IconUtil.createMenuItemLink(_UNO(
that._map._docLayer._docType=="presentation"?".uno:DuplicateSlide":".uno:DuplicatePage",
"presentation"),"DuplicatePage"),isHtmlName:true,callback:function(){that._map.duplicatePage()}},
delete:{name:app.IconUtil.createMenuItemLink(_UNO(
that._map._docLayer._docType=="presentation"?".uno:DeleteSlide":".uno:DeletePage","presentation"),
"DeletePage"),isHtmlName:true,callback:function(){app.dispatcher.dispatch("deletepage")},
visible:function(){return that._map._docLayer._parts>1}},slideproperties:{
name:app.IconUtil.createMenuItemLink(_UNO(
that._map._docLayer._docType=="presentation"?".uno:SlideSetup":".uno:PageSetup","presentation"),
"PageSetup"),isHtmlName:true,callback:function(){app.socket.sendMessage("uno .uno:PageSetup")}},
showslide:{name:app.IconUtil.createMenuItemLink(_UNO(".uno:ShowSlide","presentation"),"ShowSlide"),
isHtmlName:true,callback:function(key,options){var part=that._findClickedPart(options.$trigger[0
].parentNode);if(part!==null){that._map.showSlide()}},visible:function(key,options){
var part=that._findClickedPart(options.$trigger[0].parentNode);
return that._map._docLayer._docType==="presentation"&&app.impress.isSlideHidden(parseInt(part)-1)}},
hideslide:{name:app.IconUtil.createMenuItemLink(_UNO(".uno:HideSlide","presentation"),"Hideslide"),
isHtmlName:true,callback:function(key,options){var part=that._findClickedPart(options.$trigger[0
].parentNode);if(part!==null){that._map.hideSlide()}},visible:function(key,options){
var part=that._findClickedPart(options.$trigger[0].parentNode);
return that._map._docLayer._docType==="presentation"&&!app.impress.isSlideHidden(parseInt(part)-1)}}
}})},this);var imgSize=this._map.getPreview(i,i,this.options.maxWidth,this.options.maxHeight,{
autoUpdate:this.options.autoUpdate,fetchThumbnail:false});window.L.DomUtil.setStyle(img,"width",
imgSize.width+"px");window.L.DomUtil.setStyle(img,"height",imgSize.height+"px");this._idNum++;
return img},_scrollToPart:function(){var partNo=this._map.getCurrentPartNumber();
var node=this._partsPreviewCont.children[partNo];if(node&&(!this._previewTiles[partNo
]||!this._isPreviewVisible(partNo))){var nodePos=this._direction==="x"?$(node).position().left:$(
node).position().top;var scrollDirection=window.mode.isDesktop()||window.mode.isTablet(
)?"scrollTop":window.L.DomUtil.isPortrait()?"scrollLeft":"scrollTop";var that=this;if(
this._map._partsDirection<0){setTimeout(function(){that._partsPreviewCont[scrollDirection]+=nodePos}
,50)}else{setTimeout(function(){that._partsPreviewCont[scrollDirection]+=nodePos},50)}}},
_findClickedPart:function(element){for(var i=0;i<this._partsPreviewCont.children.length;i++){if(
this._partsPreviewCont.children[i]===element||this._partsPreviewCont.children[i
]===element.parentNode){return i}}return-1},_scrollViewToPartPosition:function(partNumber,fromBottom
){if(this._map._docLayer&&this._map._docLayer._isZooming)return;var partHeightPixels=Math.round((
this._map._docLayer._partHeightTwips+this._map._docLayer._spaceBetweenParts)*app.twipsToPixels);
var scrollTop=partHeightPixels*partNumber;var viewHeight=app.sectionContainer.getViewSize()[1];
var currentScrollX=app.activeDocument.activeView.viewedRectangle.cX1;if(
viewHeight>partHeightPixels&&partNumber>0)scrollTop-=Math.round((viewHeight-partHeightPixels)*.5);
if(fromBottom)scrollTop+=partHeightPixels-viewHeight;scrollTop=Math.round(scrollTop/app.dpiScale);
app.sectionContainer.getSectionWithName(app.CSections.Scroll.name).onScrollTo({x:currentScrollX,
y:scrollTop})},_scrollViewByDirection:function(buttonType){if(
this._map._docLayer&&this._map._docLayer._isZooming)return;
var ratio=TileManager.tileSize/app.tile.size.y;var partHeightPixels=Math.round((
this._map._docLayer._partHeightTwips+this._map._docLayer._spaceBetweenParts)*ratio);
var scroll=Math.floor(partHeightPixels/app.dpiScale);var viewHeight=Math.floor(
app.sectionContainer.getViewSize()[1]);var viewHeightScaled=Math.round(Math.floor(viewHeight
)/app.dpiScale);var scrollBySize=Math.floor(viewHeightScaled*.75);
var topPx=app.activeDocument.activeView.viewedRectangle.cY1;
var currentScrollX=app.activeDocument.activeView.viewedRectangle.cX1;if(buttonType==="prev"){if(
this._map.getCurrentPartNumber()==0){if(topPx-scrollBySize<=0){this._scrollViewToPartPosition(0);
return}}}else if(buttonType==="next"){if(this._map._docLayer._parts==this._map.getCurrentPartNumber(
)+1){scroll*=this._map.getCurrentPartNumber();var veryEnd=scroll+(Math.floor(
partHeightPixels/app.dpiScale)-viewHeightScaled);if(topPx+viewHeightScaled>=veryEnd){
this._scrollViewToPartPosition(this._map.getCurrentPartNumber(),true);return}}}
app.sectionContainer.getSectionWithName(app.CSections.Scroll.name).onScrollBy({x:currentScrollX,
y:buttonType==="prev"?-scrollBySize:scrollBySize})},_isSelected:function(e){
var part=this._findClickedPart(e.target.parentNode);var partId=parseInt(part)-1;if(partId<0
)return false;else return app.impress.isSlideSelected(partId)},_setPart:function(e){if(
cool.Comment.isAnyEdit()){cool.CommentSection.showCommentEditingWarning();return}
var part=this._findClickedPart(e.target.parentNode);if(part!==-1){var partId=parseInt(part)-1;if(
app.file.fileBasedView){this._map.setPart(partId);this._scrollViewToPartPosition(part-1);return}if(
e.ctrlKey){this._map.selectPart(partId,2,false);if(this.firstSelection===undefined
)this.firstSelection=this._map._docLayer._selectedPart}else if(e.altKey){window.app.console.log(
"alt")}else if(e.shiftKey){if(this.firstSelection===undefined
)this.firstSelection=this._map._docLayer._selectedPart;this._map.deselectAll();this._map.setPart(
this.firstSelection);this._map.selectPart(this.firstSelection,1,false);if(this.firstSelection<partId
){for(var id=this.firstSelection+1;id<=partId;++id){this._map.selectPart(id,2,false)}}else if(
this.firstSelection>partId){for(id=this.firstSelection-1;id>=partId;--id){this._map.selectPart(id,2,
false)}}}else{this._map.deselectAll();this._map.setPart(partId);this._map.selectPart(partId,1,false)
this.firstSelection=partId}}},_updatePart:function(e){if((
e.docType==="presentation"||e.docType==="drawing")&&e.part>=0){this._map.getPreview(e.part,e.part,
this.options.maxWidth,this.options.maxHeight,{autoUpdate:this.options.autoUpdate})}},
_syncPreviews:function(){var it=0;if(app.impress.partList.length!==this._previewTiles.length){if(
Math.abs(app.impress.partList.length-this._previewTiles.length)===1){if(
app.impress.partList.length>this._previewTiles.length){for(it=0;it<app.impress.partList.length;it++
){if(it===this._previewTiles.length){this._insertPreview({selectedPart:it-1,
hashCode:app.impress.partList[it].hash});break}if(this._previewTiles[it
].hash!==app.impress.partList[it].hash){this._insertPreview({selectedPart:it,
hashCode:app.impress.partList[it].hash});break}}}else{for(it=0;it<this._previewTiles.length;it++){
if(it===app.impress.partList.length||this._previewTiles[it].hash!==app.impress.partList[it].hash){
this._deletePreview({selectedPart:it});break}}}}else{while(
this._previewTiles.length<app.impress.partList.length){this._insertPreview({
selectedPart:this._previewTiles.length-1,hashCode:app.impress.partList[this._previewTiles.length
].hash})}while(this._previewTiles.length>app.impress.partList.length){this._deletePreview({
selectedPart:this._previewTiles.length-1})}for(it=0;it<app.impress.partList.length;it++){
this._previewTiles[it].hash=app.impress.partList[it].hash;this._previewTiles[it
].src=document.querySelector('meta[name="previewSmile"]').content;this._previewTiles[it
].fetched=false}}}else{for(it=0;it<app.impress.partList.length;it++){if(this._previewTiles[it
].hash!==app.impress.partList[it].hash){this._previewTiles[it].hash=app.impress.partList[it].hash;
this._map.getPreview(it,it,this.options.maxWidth,this.options.maxHeight,{
autoUpdate:this.options.autoUpdate})}}}},_resize:function(){if(
this._height==window.innerHeight&&this._width==window.innerWidth)return;if(this._previewInitialized
){clearTimeout(this._resizeTimer);this._resizeTimer=setTimeout(window.L.bind(this._onScroll,this),50
)}this._height=window.innerHeight;this._width=window.innerWidth},_beforeRequestPreview:function(e){
if(e.part!==undefined&&e.part>=0&&e.part<this._previewTiles.length&&this._previewTiles[e.part
].src===document.querySelector('meta[name="previewSmile"]').content)this._previewTiles[e.part
].src=document.querySelector('meta[name="previewImg"]').content},_updatePreview:function(e){if(
this._map.isPresentationOrDrawing()){this._map._previewRequestsOnFly--;if(
this._map._previewRequestsOnFly<0){this._map._previewRequestsOnFly=0;
this._map._timeToEmptyQueue=new Date}this._map._processPreviewQueue();if(!this._previewInitialized
)return;if(this._previewTiles[e.id]){this._previewTiles[e.id].src=e.tile.src;this._previewTiles[e.id
].fetched=true;window.app.console.debug("PREVIEW: part fetched : "+e.id)}}},_insertPreview:function(
e){if(this._map.isPresentationOrDrawing()){var newIndex=e.selectedPart+1;
var newPreview=this._createPreview(newIndex,e.hashCode===undefined?null:e.hashCode);
this._previewTiles.splice(newIndex,0,newPreview);var selectedFrame=this._previewTiles[e.selectedPart
].parentNode;var newFrame=newPreview.parentNode;selectedFrame.parentNode.insertBefore(newFrame,
selectedFrame.nextSibling)}},_deletePreview:function(e){if(this._map.isPresentationOrDrawing()){
var selectedFrame=this._previewTiles[e.selectedPart].parentNode;window.L.DomUtil.remove(
selectedFrame);this._previewTiles.splice(e.selectedPart,1);this.focusCurrentSlide()}},
_onScroll:function(){setTimeout(window.L.bind(function(){for(var i=0;i<this._previewTiles.length;++i
){if(this._isPreviewVisible(i)){var img=this._previewTiles[i];if(img&&!img.fetched){
this._map.getPreview(i,i,this.options.maxWidth,this.options.maxHeight,{
autoUpdate:this.options.autoUpdate})}}}},this),0)},_isPreviewVisible:function(part){
var el=this._previewTiles[part];if(!el)return false;var elemRect=el.getBoundingClientRect();
var viewRect=new DOMRect(0,0,window.innerWidth,window.innerHeight);
return elemRect.left<=viewRect.right&&viewRect.left<=elemRect.right&&elemRect.top<=viewRect.bottom&&viewRect.top<=elemRect.bottom
},_addDnDHandlers:function(elem){if(app.file.fileBasedView)return;if(elem){elem.setAttribute(
"draggable",true);elem.addEventListener("dragstart",this._handleDragStart,false);
elem.addEventListener("dragenter",this._handleDragEnter,false);elem.addEventListener("dragover",
this._handleDragOver,false);elem.addEventListener("dragleave",this._handleDragLeave,false);
elem.addEventListener("drop",this._handleDrop,false);elem.addEventListener("dragend",
this._handleDragEnd,false);elem.partsPreview=this}},_addDnDTouchHandlers:function(e){$(e.target
).bind("touchmove",this._handleTouchMove.bind(this));$(e.target).bind("touchcancel",
this._handleTouchCancel.bind(this));$(e.target).bind("touchend",this._handleTouchEnd.bind(this));
var part=this._findClickedPart(e.target.parentNode);if(part!==null){var partId=parseInt(part)-1;
this._map.setPart(partId);this._map.selectPart(partId,1,false)}
this.draggedSlide=window.L.DomUtil.create("img","",document.body);this.draggedSlide.setAttribute(
"src",e.target.currentSrc);$(this.draggedSlide).css("position","absolute");$(this.draggedSlide).css(
"height",e.target.height);$(this.draggedSlide).css("width",e.target.width);$(this.draggedSlide).css(
"left",e.center.x-e.target.width/2);$(this.draggedSlide).css("top",e.center.y-e.target.height);$(
this.draggedSlide).css("z-index","10");$(this.draggedSlide).css("opacity","75%");$(this.draggedSlide
).css("pointer-events","none");$(".preview-img").css("pointer-events","none");this.currentNode=null;
this.previousNode=null},_removeDnDTouchHandlers:function(e){$(e.target).unbind("touchmove");$(
e.target).unbind("touchcancel");$(e.target).unbind("touchend");$(".preview-img").css(
"pointer-events","")},_handleTouchMove:function(e){if(e.preventDefault){e.preventDefault()}
this.currentNode=document.elementFromPoint(e.originalEvent.touches[0].clientX,
e.originalEvent.touches[0].clientY);if(
this.currentNode!==this.previousNode&&this.previousNode!==null){$(".preview-frame").removeClass(
"preview-img-dropsite")}if(this.currentNode.draggable||this.currentNode.id==="first-drop-site"){
this.currentNode.classList.add("preview-img-dropsite")}this.previousNode=this.currentNode;$(
this.draggedSlide).css("left",e.originalEvent.touches[0].clientX-e.target.width/2);$(
this.draggedSlide).css("top",e.originalEvent.touches[0].clientY-e.target.height);return false},
_handleTouchCancel:function(e){$(".preview-frame").removeClass("preview-img-dropsite");$(
this.draggedSlide).remove();this._removeDnDTouchHandlers(e)},_handleTouchEnd:function(e){if(
e.stopPropagation){e.stopPropagation()}if(this.currentNode){var part=this._findClickedPart(
this.currentNode);if(part!==null){var partId=parseInt(part)-1;if(partId<0)partId=-1;
app.socket.sendMessage("moveselectedclientparts position="+partId)}}$(".preview-frame").removeClass(
"preview-img-dropsite");$(this.draggedSlide).remove();this._removeDnDTouchHandlers(e);return false},
_handleDragStart:function(e){const targetNode=e.target.id.startsWith("preview"
)?e.target:e.target.parentNode;var part=this.partsPreview._findClickedPart(targetNode);if(
part!==null){var partId=parseInt(part)-1;if(
this.partsPreview._map._docLayer&&!app.impress.isSlideSelected(partId)){
this.partsPreview._map.setPart(partId);this.partsPreview._map.selectPart(partId,1,false)}}
e.dataTransfer.effectAllowed="move"},_handleDragOver:function(e){if(e.preventDefault){
e.preventDefault()}e.dataTransfer.dropEffect="move";this.classList.add("preview-img-dropsite");
return false},_handleDragEnter:function(){},_handleDragLeave:function(){this.classList.remove(
"preview-img-dropsite")},_handleDrop:function(e){if(e.stopPropagation){e.stopPropagation()}
var target=e.target.classList.contains("preview-img")?e.target.parentNode:e.target;
var part=this.partsPreview._findClickedPart(target);if(part!==null){var partId=parseInt(part)-1;if(
partId<0)partId=-1;app.socket.sendMessage("moveselectedclientparts position="+partId)}
this.classList.remove("preview-img-dropsite");return false},_handleDragEnd:function(){
this.classList.remove("preview-img-dropsite")},_invalidateParts:function(){if(
!this._container||!this._partsPreviewCont||!this._previewInitialized||!this._previewTiles)return;
for(var part=0;part<this._previewTiles.length;part++){this._previewTiles[part].fetched=false;
this._map.getPreview(part,part,this.options.maxWidth,this.options.maxHeight,{
autoUpdate:this.options.autoUpdate,fetchThumbnail:this.options.fetchThumbnail})}},
focusCurrentSlide:function(){if(this._previewTiles[this._map._docLayer._selectedPart]
)this._previewTiles[this._map._docLayer._selectedPart].focus()}});
window.L.control.partsPreview=function(container,preview,options){
return new window.L.Control.PartsPreview(container,preview,options)};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var GroupBase=function(_super){
__extends(GroupBase,_super);function GroupBase(name){var _this=_super.call(this,name)||this;
_this.isRemoved=false;return _this}GroupBase.prototype.onInitialize=function(){
this._map=window.L.Map.THIS;this.sectionProperties.docLayer=this._map._docLayer;this._groups=null;
this._groupHeadSize=Math.round(12*app.dpiScale);this._levelSpacing=app.roundedDpiScale;this._map.on(
"sheetgeometrychanged",this.update,this);this._map.on("viewrowcolumnheaders",this.update,this);
this._map.on("darkmodechanged",this._groupBaseColors,this);this._createFont();this._groupBaseColors(
);this.update();this.isRemoved=false};GroupBase.prototype._createFont=function(){
var baseElem=document.getElementsByTagName("body")[0];var elem=window.L.DomUtil.create("div",
"spreadsheet-header-row",baseElem);var fontFamily=window.L.DomUtil.getStyle(elem,"font-family");
var fontSize=parseInt(window.L.DomUtil.getStyle(elem,"font-size"));this._getFont=function(){
return Math.round(fontSize*app.dpiScale)+"px "+fontFamily};window.L.DomUtil.remove(elem)};
GroupBase.prototype.getColors=function(){var baseElem=document.getElementsByTagName("body")[0];
var elem=window.L.DomUtil.create("div","spreadsheet-header-row",baseElem);
var isDark=window.prefs.getBoolean("darkTheme");this.backgroundColor=window.L.DomUtil.getStyle(elem,
"background-color");this.borderColor=this.backgroundColor;this._textColor=window.L.DomUtil.getStyle(
elem,"color");window.L.DomUtil.remove(elem);return{backgroundColor:this.backgroundColor,
borderColor:this.borderColor,textColor:this._textColor,strokeColor:isDark?"white":"black"}};
GroupBase.prototype._groupBaseColors=function(){var colors=this.getColors();
this.backgroundColor=colors.backgroundColor;this.borderColor=colors.borderColor;
this._textColor=colors.textColor};GroupBase.prototype._computeSectionWidth=function(){
return this._levelSpacing+(this._groupHeadSize+this._levelSpacing)*(this._groups.length+1)};
GroupBase.prototype._collectGroupsData=function(groups){var level,groupEntry;
var lastGroupIndex=new Array(groups.length);var firstChildGroupIndex=new Array(groups.length);
var lastLevel=-1;for(var i=0;i<groups.length;++i){var groupData=groups[i];level=parseInt(
groupData.level)-1;if(!this._groups[level]){this._groups[level]=[]}var startPos=parseInt(
groupData.startPos);var endPos=parseInt(groupData.endPos);var isHidden=!!parseInt(groupData.hidden);
if(!isHidden){var moved=false;if(level<lastLevel&&firstChildGroupIndex[lastLevel]!==undefined){
var childGroupEntry=this._groups[lastLevel][firstChildGroupIndex[lastLevel]];if(
childGroupEntry.hidden){if(startPos>childGroupEntry.startPos&&startPos<childGroupEntry.endPos){
startPos=childGroupEntry.startPos;moved=true}}}if(!moved&&lastGroupIndex[level]!==undefined){
var prevGroupEntry=this._groups[level][lastGroupIndex[level]];if(prevGroupEntry.hidden){if(
startPos<=prevGroupEntry.endPos){startPos=prevGroupEntry.endPos+this._groupHeadSize}}}}groupEntry={
level:level,index:parseInt(groupData.index),startPos:startPos,endPos:endPos,hidden:isHidden};
this._groups[level][parseInt(groupData.index)]=groupEntry;lastGroupIndex[level]=groupData.index;if(
level>lastLevel){firstChildGroupIndex[level]=groupData.index;lastLevel=level}else if(
level===lastLevel){firstChildGroupIndex[level+1]=undefined}}};
GroupBase.prototype._isParentGroupVisible=function(group_){if(group_.hidden===false){if(
group_.level>0){if(this._isPreviousGroupVisible(group_.level,group_.startPos,group_.endPos,
group_.hidden)){return true}else{return false}}else{return true}}else{return false}};
GroupBase.prototype._isPreviousGroupVisible=function(level,startPos,endPos,hidden){for(
var i=0;i<this._groups.length;i++){var parentGroup;if(i==level-1){for(var group in this._groups[i]){
if(Object.prototype.hasOwnProperty.call(this._groups[i],group)){var group_=this._groups[i][group];
if(startPos!=endPos&&(startPos>=group_.startPos&&endPos<=group_.endPos)){
return this._isParentGroupVisible(group_)}else if(startPos==endPos&&hidden==false){if(
startPos==group_.startPos&&endPos==group_.endPos){parentGroup=group_;
return this._isParentGroupVisible(parentGroup)}else if(
startPos==group_.startPos&&endPos!=group_.endPos){parentGroup=group_}else if(
startPos!=group_.startPos&&endPos==group_.endPos){parentGroup=group_}else if(
startPos>group_.startPos&&endPos<group_.endPos){parentGroup=group_}}else if(
startPos==endPos&&hidden==true){if(startPos==group_.startPos&&endPos==group_.endPos){
parentGroup=group_}else if(startPos==group_.startPos&&endPos!=group_.endPos){parentGroup=group_
}else if(startPos!=group_.startPos&&endPos==group_.endPos){parentGroup=group_}else if(
startPos>group_.startPos&&endPos<group_.endPos){parentGroup=group_}}}}if(parentGroup!==undefined){
return this._isParentGroupVisible(parentGroup)}}}};GroupBase.prototype.drawGroupControl=function(
entry){return};GroupBase.prototype.drawOutline=function(){if(this._groups){for(
var i=0;i<this._groups.length;i++){if(this._groups[i]){for(var group in this._groups[i]){if(
Object.prototype.hasOwnProperty.call(this._groups[i],group)){if(this._groups[i][group].level==0){
this.drawGroupControl(this._groups[i][group])}else if(this._isPreviousGroupVisible(this._groups[i][
group].level,this._groups[i][group].startPos,this._groups[i][group].endPos,this._groups[i][group
].hidden)){this.drawGroupControl(this._groups[i][group])}}}}}}};
GroupBase.prototype.drawLevelHeader=function(level){return};
GroupBase.prototype.drawLevelHeaders=function(){for(var i=0;i<this._groups.length+1;++i){
this.drawLevelHeader(i)}};GroupBase.prototype.transformRectX=function(xcoord,rectWidth){
return this.isCalcRTL()?this.size[0]-xcoord-rectWidth:xcoord};
GroupBase.prototype.transformX=function(xcoord){return this.isCalcRTL()?this.size[0]-xcoord:xcoord};
GroupBase.prototype.isPointInRect=function(point,startX,startY,endX,endY,mirrorX){
var x=mirrorX?this.size[0]-point.pX:point.pX;var y=point.pY;
return x>startX&&x<endX&&y>startY&&y<endY};GroupBase.prototype.onDraw=function(){this.drawOutline();
this.drawLevelHeaders()};GroupBase.prototype.findClickedGroup=function(point){return null};
GroupBase.prototype.findClickedLevel=function(point){return-1};
GroupBase.prototype.onMouseMove=function(point){if(this.findClickedGroup(point
)!==null||this.findClickedLevel(point)!==-1
)this.context.canvas.style.cursor="pointer";else this.context.canvas.style.cursor="default"};
GroupBase.prototype.onMouseLeave=function(){this.context.canvas.style.cursor="default"};
GroupBase.prototype._updateOutlineState=function(group){return};
GroupBase.prototype.onClick=function(point){var level=this.findClickedLevel(point);if(level!==-1){
this._updateOutlineState({level:level,index:-1})}else{var group=this.findClickedGroup(point);if(
group){this._updateOutlineState(group)}}};GroupBase.prototype.getTailsGroupRect=function(group){
return[0,0,0,0]};GroupBase.prototype.findTailsGroup=function(point){var mirrorX=this.isCalcRTL();
for(var i=0;i<this._groups.length;i++){if(this._groups[i]){for(var group in this._groups[i]){if(
Object.prototype.hasOwnProperty.call(this._groups[i],group)){var group_=this._groups[i][group];
var rect=this.getTailsGroupRect(group_);var startX=rect[0];var startY=rect[2];var endX=rect[1];
var endY=rect[3];if(this.isPointInRect(point,startX,startY,endX,endY,mirrorX)){return group_}}}}}};
GroupBase.prototype.onDoubleClick=function(point){var group=this.findTailsGroup(point);if(group
)this._updateOutlineState(group)};GroupBase.prototype.onMouseEnter=function(){$.contextMenu(
"destroy","#document-canvas")};GroupBase.prototype.onRemove=function(){this.isRemoved=true;
this.containerObject.getSectionWithName(app.CSections.RowHeader.name).position[0]=0;
this.containerObject.getSectionWithName(app.CSections.CornerHeader.name).position[0]=0};
return GroupBase}(CanvasSectionObject);cool.GroupBase=GroupBase})(cool||(cool={}));
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var CornerGroup=function(_super){
__extends(CornerGroup,_super);function CornerGroup(){var _this=_super.call(this,
app.CSections.CornerGroup.name)||this;_this.anchor=["top","left"];
_this.processingOrder=app.CSections.CornerGroup.processingOrder;
_this.drawingOrder=app.CSections.CornerGroup.drawingOrder;
_this.zIndex=app.CSections.CornerGroup.zIndex;_this.sectionProperties={cursor:"pointer"};
return _this}CornerGroup.prototype.onInitialize=function(){this._map=window.L.Map.THIS;this._map.on(
"sheetgeometrychanged",this.update,this);this._map.on("viewrowcolumnheaders",this.update,this);
this._map.on("darkmodechanged",this._cornerGroupColors,this);this._cornerGroupColors()};
CornerGroup.prototype._cornerGroupColors=function(){var colors=this.getColors();
this.backgroundColor=colors.backgroundColor;this.borderColor=colors.borderColor};
CornerGroup.prototype.update=function(){var rowGroupSection=this.containerObject.getSectionWithName(
app.CSections.RowGroup.name);if(rowGroupSection){rowGroupSection.update();this.size[0
]=rowGroupSection.size[0]}var columnGroupSection=this.containerObject.getSectionWithName(
app.CSections.ColumnGroup.name);if(columnGroupSection){columnGroupSection.update();this.size[1
]=columnGroupSection.size[1]}};CornerGroup.prototype.onClick=function(){
this._map.wholeRowSelected=true;this._map.wholeColumnSelected=true;this._map.sendUnoCommand(
".uno:SelectAll");var docLayer=this._map._docLayer;if(docLayer)docLayer._updateCursorAndOverlay()};
CornerGroup.prototype.onMouseEnter=function(){this.containerObject.getCanvasStyle().cursor="pointer"
$.contextMenu("destroy","#document-canvas")};CornerGroup.prototype.onMouseLeave=function(){
this.containerObject.getCanvasStyle().cursor="default"};CornerGroup.prototype.onDraw=function(){
return};CornerGroup.prototype.onDoubleClick=function(){return};return CornerGroup}(cool.GroupBase);
cool.CornerGroup=CornerGroup})(cool||(cool={}));var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var cool;(function(cool
){var RowGroup=function(_super){__extends(RowGroup,_super);function RowGroup(){
var _this=_super.call(this,app.CSections.RowGroup.name)||this;_this.anchor=[[
app.CSections.CornerGroup.name,"bottom","top"],"left"];_this.expand=["top","bottom"];
_this.processingOrder=app.CSections.RowGroup.processingOrder;
_this.drawingOrder=app.CSections.RowGroup.drawingOrder;_this.zIndex=app.CSections.RowGroup.zIndex;
return _this}RowGroup.prototype.update=function(){if(this.isRemoved)return;
this._sheetGeometry=this._map._docLayer.sheetGeometry;this._groups=Array(
this._sheetGeometry.getRowGroupLevels());this.size[0]=this._computeSectionWidth();
this._cornerHeaderHeight=this.containerObject.getSectionWithName(app.CSections.CornerHeader.name
).size[1];this._splitPos=this._map._docLayer._splitPanesContext.getSplitPos();
this._collectGroupsData(this._sheetGeometry.getRowGroupsDataInView())};
RowGroup.prototype._computeSectionWidth=function(){return this._levelSpacing+(
this._groupHeadSize+this._levelSpacing)*(this._groups.length+1)};
RowGroup.prototype.isGroupHeaderVisible=function(startY,startPos){if(startPos>this._splitPos.y){
return startY>this._splitPos.y+this._cornerHeaderHeight}else{return startY>=this._cornerHeaderHeight
}};RowGroup.prototype.getEndPosition=function(endPos){if(endPos<=this._splitPos.y
)return endPos;else{return Math.max(
endPos+this._cornerHeaderHeight-app.activeDocument.activeView.viewedRectangle.pY1,
this._splitPos.y+this._cornerHeaderHeight)}};RowGroup.prototype.getRelativeY=function(docPos){if(
docPos<this._splitPos.y)return docPos+this._cornerHeaderHeight;else return Math.max(
docPos-app.activeDocument.activeView.viewedRectangle.pY1,this._splitPos.y)+this._cornerHeaderHeight}
RowGroup.prototype.drawGroupControl=function(group){var startX=this._levelSpacing+(
this._groupHeadSize+this._levelSpacing)*group.level;var startY=this.getRelativeY(group.startPos);
var endY=this.getEndPosition(group.endPos);var strokeColor=this.getColors().strokeColor;if(
this.isGroupHeaderVisible(startY,group.startPos)){this.context.beginPath();
this.context.fillStyle=this.backgroundColor;this.context.fillRect(this.transformRectX(startX,
this._groupHeadSize),startY,this._groupHeadSize,this._groupHeadSize);
this.context.strokeStyle=strokeColor;this.context.lineWidth=1;this.context.strokeRect(
this.transformRectX(startX+.5,this._groupHeadSize),startY+.5,this._groupHeadSize,this._groupHeadSize
);if(!group.hidden){this.context.beginPath();this.context.moveTo(this.transformX(
startX+this._groupHeadSize*.25),startY+this._groupHeadSize/2+.5);this.context.lineTo(
this.transformX(startX+this._groupHeadSize*.75+app.roundedDpiScale),startY+this._groupHeadSize/2+.5)
this.context.stroke()}else{this.context.beginPath();this.context.moveTo(this.transformX(
startX+this._groupHeadSize*.25),startY+this._groupHeadSize/2+.5);this.context.lineTo(
this.transformX(startX+this._groupHeadSize*.75+app.roundedDpiScale),startY+this._groupHeadSize/2+.5)
this.context.stroke();this.context.moveTo(this.transformX(startX+this._groupHeadSize*.5+.5),
startY+this._groupHeadSize*.25);this.context.lineTo(this.transformX(startX+this._groupHeadSize*.5+.5
),startY+this._groupHeadSize*.75+app.roundedDpiScale);this.context.stroke()}}if(
!group.hidden&&endY>this._cornerHeaderHeight+this._groupHeadSize&&endY>startY){
this.context.beginPath();startY+=this._groupHeadSize;
startY=startY>=this._cornerHeaderHeight+this._groupHeadSize?startY:this._cornerHeaderHeight+this._groupHeadSize
startX+=this._groupHeadSize*.5;startX=Math.round(startX);startY=Math.round(startY)+1;
this.context.strokeStyle=strokeColor;this.context.lineWidth=2;this.context.moveTo(this.transformX(
startX),startY);this.context.lineTo(this.transformX(startX),endY-app.roundedDpiScale);
this.context.stroke();this.context.lineTo(Math.round(this.transformX(startX+this._groupHeadSize/2)),
endY-app.roundedDpiScale);this.context.stroke()}};RowGroup.prototype.drawLevelHeader=function(level
){this.context.beginPath();var ctx=this.context;var ctrlHeadSize=this._groupHeadSize;
var levelSpacing=this._levelSpacing;var startX=levelSpacing+(ctrlHeadSize+levelSpacing)*level;
var startY=Math.round((this._cornerHeaderHeight-ctrlHeadSize)*.5);ctx.strokeStyle=this.getColors(
).strokeColor;ctx.lineWidth=1;ctx.strokeRect(this.transformRectX(startX+.5,ctrlHeadSize),startY+.5,
ctrlHeadSize,ctrlHeadSize);ctx.fillStyle=this._textColor;ctx.font=this._getFont();
ctx.textAlign="center";ctx.textBaseline="middle";ctx.fillText((level+1).toString(),this.transformX(
startX+ctrlHeadSize/2),startY+ctrlHeadSize/2+2*app.dpiScale)};
RowGroup.prototype._updateOutlineState=function(group){var state=group.hidden?"visible":"hidden";
var payload="outlinestate type=row"+" level="+group.level+" index="+group.index+" state="+state;
app.socket.sendMessage(payload)};RowGroup.prototype.findClickedLevel=function(point){if(
point.pY<this._cornerHeaderHeight){var index=this.transformX(point.pX)/this.size[0]*100;
var levelPercentage=1/(this._groups.length+1)*100;index=Math.floor(index/levelPercentage);
return index}return-1};RowGroup.prototype.findClickedGroup=function(point){
var mirrorX=this.isCalcRTL();for(var i=0;i<this._groups.length;i++){if(this._groups[i]){for(
var group in this._groups[i]){if(Object.prototype.hasOwnProperty.call(this._groups[i],group)){
var group_=this._groups[i][group];var startX=this._levelSpacing+(
this._groupHeadSize+this._levelSpacing)*group_.level;var startY=this.getRelativeY(group_.startPos);
var endX=startX+this._groupHeadSize;var endY=startY+this._groupHeadSize;if(
group_.level==0&&this.isPointInRect(point,startX,startY,endX,endY,mirrorX))return group_;else if(
this._isPreviousGroupVisible(group_.level,group_.startPos,group_.endPos,group_.hidden
)&&this.isPointInRect(point,startX,startY,endX,endY,mirrorX)){return group_}}}}}return null};
RowGroup.prototype.getTailsGroupRect=function(group){var startX=this._levelSpacing+(
this._groupHeadSize+this._levelSpacing)*group.level;var startY=this.getRelativeY(group.startPos);
var endX=startX+this._groupHeadSize;
var endY=group.endPos+this._cornerHeaderHeight-app.activeDocument.activeView.viewedRectangle.pY1;
return[startX,endX,startY,endY]};RowGroup.prototype.onRemove=function(){this.isRemoved=true;
this.containerObject.getSectionWithName(app.CSections.RowHeader.name).position[0]=0;
this.containerObject.getSectionWithName(app.CSections.CornerHeader.name).position[0]=0};
return RowGroup}(cool.GroupBase);cool.RowGroup=RowGroup})(cool||(cool={}));
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var ColumnGroup=function(_super){
__extends(ColumnGroup,_super);function ColumnGroup(){var _this=_super.call(this,
app.CSections.ColumnGroup.name)||this;_this.anchor=["top",[app.CSections.CornerGroup.name,"right",
"left"]];_this.expand=["left","right"];
_this.processingOrder=app.CSections.ColumnGroup.processingOrder;
_this.drawingOrder=app.CSections.ColumnGroup.drawingOrder;
_this.zIndex=app.CSections.ColumnGroup.zIndex;return _this}ColumnGroup.prototype.update=function(){
if(this.isRemoved)return;this._sheetGeometry=this._map._docLayer.sheetGeometry;this._groups=Array(
this._sheetGeometry.getColumnGroupLevels());this.size[1]=this._computeSectionHeight();
this._cornerHeaderWidth=this.containerObject.getSectionWithName(app.CSections.CornerHeader.name
).size[0];this._splitPos=this._map._docLayer._splitPanesContext.getSplitPos();
this._collectGroupsData(this._sheetGeometry.getColumnGroupsDataInView())};
ColumnGroup.prototype._computeSectionHeight=function(){return this._levelSpacing+(
this._groupHeadSize+this._levelSpacing)*(this._groups.length+1)};
ColumnGroup.prototype.isGroupHeaderVisible=function(startX,startPos){if(startPos>this._splitPos.x){
return startX>this._splitPos.x+this._cornerHeaderWidth}else{
return startX>=this._cornerHeaderWidth&&(
startX>app.activeDocument.activeView.viewedRectangle.pX1||startX<this._splitPos.x)}};
ColumnGroup.prototype.getEndPosition=function(endPos){if(endPos<=this._splitPos.x
)return endPos;else{return Math.max(
endPos+this._cornerHeaderWidth-app.activeDocument.activeView.viewedRectangle.pX1,
this._splitPos.x+this._cornerHeaderWidth)}};ColumnGroup.prototype.getRelativeX=function(docPos){if(
docPos<this._splitPos.x)return docPos+this._cornerHeaderWidth;else return Math.max(
docPos-app.activeDocument.activeView.viewedRectangle.pX1,this._splitPos.x)+this._cornerHeaderWidth};
ColumnGroup.prototype.drawGroupControl=function(group){var startX=this.getRelativeX(group.startPos);
var startY=this._levelSpacing+(this._groupHeadSize+this._levelSpacing)*group.level;
var strokeColor=this.getColors().strokeColor;var endX=this.getEndPosition(group.endPos);if(
this.isGroupHeaderVisible(startX,group.startPos)){this.context.beginPath();
this.context.fillStyle=this.backgroundColor;this.context.fillRect(this.transformRectX(startX,
this._groupHeadSize),startY,this._groupHeadSize,this._groupHeadSize);
this.context.strokeStyle=strokeColor;this.context.lineWidth=1;this.context.strokeRect(
this.transformRectX(startX+.5,this._groupHeadSize),startY+.5,this._groupHeadSize,this._groupHeadSize
);if(!group.hidden){this.context.beginPath();this.context.moveTo(this.transformX(
startX+this._groupHeadSize*.25),startY+this._groupHeadSize*.5+.5);this.context.lineTo(
this.transformX(startX+this._groupHeadSize*.75+app.roundedDpiScale),startY+this._groupHeadSize*.5+.5
);this.context.stroke()}else{this.context.beginPath();this.context.moveTo(this.transformX(
startX+this._groupHeadSize*.25),startY+this._groupHeadSize*.5+.5);this.context.lineTo(
this.transformX(startX+this._groupHeadSize*.75+app.roundedDpiScale),startY+this._groupHeadSize*.5+.5
);this.context.stroke();this.context.moveTo(this.transformX(startX+this._groupHeadSize*.5+.5),
startY+this._groupHeadSize*.25);this.context.lineTo(this.transformX(startX+this._groupHeadSize*.5+.5
),startY+this._groupHeadSize*.75+app.roundedDpiScale);this.context.stroke()}}if(
!group.hidden&&endX>this._cornerHeaderWidth+this._groupHeadSize&&endX>startX){
this.context.beginPath();startX+=this._groupHeadSize;
startX=startX>=this._cornerHeaderWidth+this._groupHeadSize?startX:this._cornerHeaderWidth+this._groupHeadSize
startY+=this._groupHeadSize*.5;startX=Math.round(startX)+1;startY=Math.round(startY);
this.context.strokeStyle=strokeColor;this.context.lineWidth=2;this.context.moveTo(this.transformX(
startX),startY);this.context.lineTo(this.transformX(endX-app.roundedDpiScale),startY);
this.context.stroke()}};ColumnGroup.prototype.drawLevelHeader=function(level){
this.context.beginPath();var ctx=this.context;var ctrlHeadSize=this._groupHeadSize;
var levelSpacing=this._levelSpacing;var startX=Math.round((this._cornerHeaderWidth-ctrlHeadSize)*.5)
var startY=levelSpacing+(ctrlHeadSize+levelSpacing)*level;ctx.strokeStyle=this.getColors(
).strokeColor;ctx.lineWidth=1;ctx.strokeRect(this.transformRectX(startX+.5,ctrlHeadSize),startY+.5,
ctrlHeadSize,ctrlHeadSize);ctx.fillStyle=this._textColor;ctx.font=this._getFont();
ctx.textAlign="center";ctx.textBaseline="middle";ctx.fillText((level+1).toString(),this.transformX(
startX+ctrlHeadSize/2),startY+ctrlHeadSize/2+2*app.dpiScale)};
ColumnGroup.prototype._updateOutlineState=function(group){var state=group.hidden?"visible":"hidden";
var payload="outlinestate type=column"+" level="+group.level+" index="+group.index+" state="+state;
app.socket.sendMessage(payload)};ColumnGroup.prototype.findClickedLevel=function(point){
var mirrorX=this.isCalcRTL();if(
!mirrorX&&point.pX<this._cornerHeaderWidth||mirrorX&&point.pX>this.size[0]-this._cornerHeaderWidth){
var index=point.pY/this.size[1]*100;var levelPercentage=1/(this._groups.length+1)*100;
index=Math.floor(index/levelPercentage);return index}return-1};
ColumnGroup.prototype.findClickedGroup=function(point){var mirrorX=this.isCalcRTL();for(
var i=0;i<this._groups.length;i++){if(this._groups[i]){for(var group in this._groups[i]){if(
Object.prototype.hasOwnProperty.call(this._groups[i],group)){var group_=this._groups[i][group];
var startX=this.getRelativeX(group_.startPos);var startY=this._levelSpacing+(
this._groupHeadSize+this._levelSpacing)*group_.level;var endX=startX+this._groupHeadSize;
var endY=startY+this._groupHeadSize;if(group_.level==0&&this.isPointInRect(point,startX,startY,endX,
endY,mirrorX))return group_;else if(this._isPreviousGroupVisible(group_.level,group_.startPos,
group_.endPos,group_.hidden)&&this.isPointInRect(point,startX,startY,endX,endY,mirrorX)){
return group_}}}}}return null};ColumnGroup.prototype.getTailsGroupRect=function(group){
var startX=this.getRelativeX(group.startPos);var startY=this._levelSpacing+(
this._groupHeadSize+this._levelSpacing)*group.level;
var endX=group.endPos+this._cornerHeaderWidth-app.activeDocument.activeView.viewedRectangle.pX1;
var endY=startY+this._groupHeadSize;return[startX,endX,startY,endY]};
ColumnGroup.prototype.onRemove=function(){this.isRemoved=true;
this.containerObject.getSectionWithName(app.CSections.ColumnHeader.name).position[1]=0;
this.containerObject.getSectionWithName(app.CSections.CornerHeader.name).position[1]=0};
return ColumnGroup}(cool.GroupBase);cool.ColumnGroup=ColumnGroup})(cool||(cool={}));
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var CornerHeader=function(_super){
__extends(CornerHeader,_super);function CornerHeader(){var _this=_super.call(this,
app.CSections.CornerHeader.name)||this;_this.anchor=[[app.CSections.ColumnGroup.name,"bottom","top"]
,[app.CSections.RowGroup.name,"right","left"]];_this.size=[48*app.dpiScale,19*app.dpiScale];
_this.processingOrder=app.CSections.CornerHeader.processingOrder;
_this.drawingOrder=app.CSections.CornerHeader.drawingOrder;
_this.zIndex=app.CSections.CornerHeader.zIndex;_this.sectionProperties={cursor:"pointer"};
return _this}CornerHeader.prototype.onInitialize=function(){this._map=window.L.Map.THIS;
this._map.on("darkmodechanged",this._initCornerHeaderStyle,this);this._initCornerHeaderStyle()};
CornerHeader.prototype.onClick=function(){this._map.wholeRowSelected=true;
this._map.wholeColumnSelected=true;this._map.sendUnoCommand(".uno:SelectAll");
var docLayer=this._map._docLayer;if(docLayer)docLayer._updateCursorAndOverlay()};
CornerHeader.prototype.onMouseEnter=function(){this.containerObject.getCanvasStyle(
).cursor=this.sectionProperties.cursor;$.contextMenu("destroy","#document-canvas")};
CornerHeader.prototype.onMouseLeave=function(){this.containerObject.getCanvasStyle(
).cursor="default"};CornerHeader.prototype._initCornerHeaderStyle=function(){
var baseElem=document.getElementsByTagName("body")[0];var elem=window.L.DomUtil.create("div",
"spreadsheet-header-row",baseElem);this._textColor=window.L.DomUtil.getStyle(elem,"color");
this.backgroundColor=window.L.DomUtil.getStyle(elem,"background-color");
this.borderColor=window.L.DomUtil.getStyle(elem,"border-top-color");window.L.DomUtil.remove(elem)};
return CornerHeader}(CanvasSectionObject);cool.CornerHeader=CornerHeader})(cool||(cool={}));
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var cool;(function(cool){var Header=function(_super){__extends(
Header,_super);function Header(name){return _super.call(this,name)||this}
Header.prototype._initHeaderEntryStyles=function(className){
var baseElem=document.getElementsByTagName("body")[0];var elem=window.L.DomUtil.create("div",
className,baseElem);this._textColor=window.L.DomUtil.getStyle(elem,"color");
this._backgroundColor=window.L.DomUtil.getStyle(elem,"background-color");
var fontFamily=window.L.DomUtil.getStyle(elem,"font-family");this.getFont=function(){
var selectedSize=this._getFontSize();return selectedSize+"px "+fontFamily}.bind(this);
this._borderColor=window.L.DomUtil.getStyle(elem,"border-top-color");
var borderWidth=window.L.DomUtil.getStyle(elem,"border-top-width");this._borderWidth=Math.round(
parseFloat(borderWidth));this._cursor=window.L.DomUtil.getStyle(elem,"cursor");
window.L.DomUtil.remove(elem)};Header.prototype._getFontSize=function(){var map=this._map;
var zoomScale=map.getZoomScale(map.getZoom(),map.options.defaultZoom);if(zoomScale<.68
)return Math.round(8*app.dpiScale);else if(zoomScale<.8)return Math.round(10*app.dpiScale
);else return Math.round(12*app.dpiScale)};Header.prototype._initHeaderEntryHoverStyles=function(
className){var baseElem=document.getElementsByTagName("body")[0];var elem=window.L.DomUtil.create(
"div",className,baseElem);this._hoverColor=window.L.DomUtil.getStyle(elem,"background-color");
window.L.DomUtil.remove(elem)};Header.prototype._initHeaderEntrySelectedStyles=function(className){
var baseElem=document.getElementsByTagName("body")[0];var elem=window.L.DomUtil.create("div",
className,baseElem);this._selectionTextColor=window.L.DomUtil.getStyle(elem,"color");
var selectionBackgroundGradient=[];var gradientColors=window.L.DomUtil.getStyle(elem,
"background-image");gradientColors=gradientColors.slice("linear-gradient(".length,-1);while(
gradientColors){var color=gradientColors.split(",",3);var colorJoin=color.join(",");
selectionBackgroundGradient.push(colorJoin);gradientColors=gradientColors.substr(color.length);
gradientColors=gradientColors.substr(gradientColors.indexOf("r"))}if(
selectionBackgroundGradient.length){this._selectionBackgroundGradient=selectionBackgroundGradient}
window.L.DomUtil.remove(elem)};Header.prototype._initHeaderEntryResizeStyles=function(className){if(
this.cursor){this._resizeCursor=this.cursor}else{var baseElem=document.getElementsByTagName("body")[
0];var elem=window.L.DomUtil.create("div",className,baseElem);
this._resizeCursor=window.L.DomUtil.getStyle(elem,"cursor");window.L.DomUtil.remove(elem)}};
Header.prototype._isRowColumnInSelectedRange=function(index){var _a,_b;return!!((
_a=this._headerInfo.getElementData(index))===null||_a===void 0?void 0:_a.isCurrent)||!!((
_b=this._headerInfo.getElementData(index))===null||_b===void 0?void 0:_b.isHighlighted)};
Header.prototype.onContextMenu=function(evt){if(window.mode.isMobile()&&this._map.isEditMode()){
window.contextMenuWizard=true;this._map.fire("mobilewizard",{data:this._menuData})}else if(
this._map.isEditMode()){this._bindContextMenu();$("#canvas-container").contextMenu({x:evt.clientX,
y:evt.clientY})}};Header.prototype._updateCanvas=function(){if(this._headerInfo){
this._headerInfo.update(this);this.containerObject.requestReDraw()}};
Header.prototype._reInitRowColumnHeaderStylesAfterModeChange=function(){if(this._isColumn){
this._initHeaderEntryStyles("spreadsheet-header-column");this._initHeaderEntryHoverStyles(
"spreadsheet-header-column-hover");this._initHeaderEntrySelectedStyles(
"spreadsheet-header-column-selected");this._initHeaderEntryResizeStyles(
"spreadsheet-header-column-resize")}else{this._initHeaderEntryStyles("spreadsheet-header-row");
this._initHeaderEntryHoverStyles("spreadsheet-header-row-hover");
this._initHeaderEntrySelectedStyles("spreadsheet-header-row-selected");
this._initHeaderEntryResizeStyles("spreadsheet-header-row-resize")}};
Header.prototype.optimalHeight=function(index){if(!this._isRowColumnInSelectedRange(index)){
this._selectRow(index,0)}this._map.sendUnoCommand(".uno:SetOptimalRowHeight")};
Header.prototype.insertRowAbove=function(index){if(!this._isRowColumnInSelectedRange(index)){
this._selectRow(index,0)}this._map.sendUnoCommand(".uno:InsertRows")};
Header.prototype.insertRowBelow=function(index){if(!this._isRowColumnInSelectedRange(index)){
this._selectRow(index,0)}this._map.sendUnoCommand(".uno:InsertRowsAfter")};
Header.prototype.deleteRow=function(index){if(!this._isRowColumnInSelectedRange(index)){
this._selectRow(index,0)}this._map.sendUnoCommand(".uno:DeleteRows")};
Header.prototype.hideRow=function(index){if(!this._isRowColumnInSelectedRange(index)){
this._selectRow(index,0)}this._map.sendUnoCommand(".uno:HideRow")};
Header.prototype.showRow=function(index){if(!this._isRowColumnInSelectedRange(index)){
this._selectRow(index,0)}this._map.sendUnoCommand(".uno:ShowRow")};
Header.prototype._selectRow=function(row,modifier){if(this._map.dialog.hasOpenedDialog(
)&&this._map.dialog.getCurrentDialogContainer()){
var dialogContainer=this._map.dialog.getCurrentDialogContainer();if(
dialogContainer.dataset.uniqueId==="FormulaDialog"){var alpha=String(row+1);var text=alpha+":"+alpha
this._map._textInput._sendText(text)}return}var command={Row:{type:"long",value:row},Modifier:{
type:"unsigned short",value:modifier}};this._map.wholeRowSelected=true;this._map.sendUnoCommand(
".uno:SelectRow ",command);this._map.focus()};Header.prototype._insertRowAbove=function(){
var index=this._lastMouseOverIndex;if(index!==undefined){this.insertRowAbove.call(this,index)}};
Header.prototype._insertRowBelow=function(){var index=this._lastMouseOverIndex;if(index!==undefined
){this.insertRowBelow.call(this,index)}};Header.prototype._deleteSelectedRow=function(){
var index=this._lastMouseOverIndex;if(index!==undefined){this.deleteRow.call(this,index)}};
Header.prototype._rowHeight=function(){this._map.sendUnoCommand(".uno:RowHeight")};
Header.prototype._optimalHeight=function(){var index=this._lastMouseOverIndex;if(index!==undefined){
this.optimalHeight.call(this,index)}};Header.prototype._hideRow=function(){
var index=this._lastMouseOverIndex;if(index!==undefined){this.hideRow.call(this,index)}};
Header.prototype._showRow=function(){var index=this._lastMouseOverIndex;if(index!==undefined){
this.showRow.call(this,index)}};Header.prototype.optimalWidth=function(index){if(
!this._isRowColumnInSelectedRange(index)){this._selectColumn(index,0)}this._map.sendUnoCommand(
".uno:SetOptimalColumnWidth")};Header.prototype.insertColumnBefore=function(index){if(
!this._isRowColumnInSelectedRange(index)){this._selectColumn(index,0)}this._map.sendUnoCommand(
".uno:InsertColumns");this._updateColumnHeader()};Header.prototype.insertColumnAfter=function(index
){if(!this._isRowColumnInSelectedRange(index)){this._selectColumn(index,0)}this._map.sendUnoCommand(
".uno:InsertColumnsAfter");this._updateColumnHeader()};Header.prototype.deleteColumn=function(index
){if(!this._isRowColumnInSelectedRange(index)){this._selectColumn(index,0)}this._map.sendUnoCommand(
".uno:DeleteColumns");this._updateColumnHeader()};Header.prototype.hideColumn=function(index){if(
!this._isRowColumnInSelectedRange(index)){this._selectColumn(index,0)}this._map.sendUnoCommand(
".uno:HideColumn");this._updateColumnHeader()};Header.prototype.showColumn=function(index){if(
!this._isRowColumnInSelectedRange(index)){this._selectColumn(index,0)}this._map.sendUnoCommand(
".uno:ShowColumn");this._updateColumnHeader()};Header.prototype._updateColumnHeader=function(){
this._map._docLayer.refreshViewData({x:this._map._getTopLeftPoint().x,y:0,offset:{x:undefined,y:0}})
};Header.prototype._colIndexToAlpha=function(columnNumber){var offset="A".charCodeAt(0);
var dividend=columnNumber;var columnName="";while(dividend>0){var modulo=(dividend-1)%26;
columnName=String.fromCharCode(offset+modulo)+columnName;dividend=Math.floor((dividend-modulo)/26)}
return columnName};Header.prototype._selectColumn=function(colNumber,modifier){if(
this._map.dialog.hasOpenedDialog()&&this._map.dialog.getCurrentDialogContainer()){
var dialogContainer=this._map.dialog.getCurrentDialogContainer();if(
dialogContainer.dataset.uniqueId==="FormulaDialog"){var alpha=this._colIndexToAlpha(colNumber+1);
var text=alpha+":"+alpha;this._map._textInput._sendText(text)}return}var command={Col:{
type:"unsigned short",value:colNumber},Modifier:{type:"unsigned short",value:modifier}};
this._map.wholeColumnSelected=true;this._map.sendUnoCommand(".uno:SelectColumn ",command);
this._map.focus()};Header.prototype._insertColBefore=function(){var index=this._lastMouseOverIndex;
if(index!==undefined){this.insertColumnBefore.call(this,index)}};
Header.prototype._insertColAfter=function(){var index=this._lastMouseOverIndex;if(index!==undefined
){this.insertColumnAfter.call(this,index)}};Header.prototype._deleteSelectedCol=function(){
var index=this._lastMouseOverIndex;if(index!==undefined){this.deleteColumn.call(this,index)}};
Header.prototype._columnWidth=function(){this._map.sendUnoCommand(".uno:ColumnWidth")};
Header.prototype._optimalWidth=function(){var index=this._lastMouseOverIndex;if(index!==undefined){
this.optimalWidth.call(this,index)}};Header.prototype._hideColumn=function(){
var index=this._lastMouseOverIndex;if(index!==undefined){this.hideColumn.call(this,index)}};
Header.prototype._showColumn=function(){var index=this._lastMouseOverIndex;if(index!==undefined){
this.showColumn.call(this,index)}};Header.prototype._freezePanes=function(){
this._map.sendUnoCommand(".uno:FreezePanes")};Header.prototype._entryAtPoint=function(point){if(
!this._headerInfo)return undefined;var isColumn=this._headerInfo._isColumn;
var position=isColumn?point.pX:point.pY;var result=null;var isRTL=isColumn&&this.isCalcRTL();
this._headerInfo.forEachElement(function(entry){var end=isRTL?this.size[0
]-entry.pos+entry.size:entry.pos;var start=end-entry.size;if(position>=start&&position<end){
var resizeAreaStart=isRTL?Math.min(start+3*app.dpiScale,end):Math.max(start,end-3*app.dpiScale);if(
entry.isCurrent||window.mode.isMobile()){
resizeAreaStart=isRTL?start+this._resizeHandleSize:end-this._resizeHandleSize}
var isMouseOverResizeArea=isRTL?position<resizeAreaStart:position>resizeAreaStart;result={
entry:entry,hit:isMouseOverResizeArea};return true}}.bind(this));return result};
Header.prototype.drawHeaderEntry=function(entry){return};Header.prototype.onDraw=function(){
this._headerInfo.forEachElement(function(elemData){this.drawHeaderEntry(elemData);return false
}.bind(this));this.drawResizeLineIfNeeded()};Header.prototype.onDragEnd=function(dragDistance){
return};Header.prototype.onMouseEnter=function(){this.containerObject.getCanvasStyle(
).cursor=this._cursor;this._bindContextMenu()};Header.prototype.onMouseLeave=function(point){if(
point===null){if(this.containerObject.isDraggingSomething()&&this._dragEntry){this.onDragEnd(
this.containerObject.getDragDistance())}}if(this._mouseOverEntry){
this.containerObject.setPenPosition(this);this._mouseOverEntry.isOver=false;this.drawHeaderEntry(
this._mouseOverEntry);this._mouseOverEntry=null}this._hitResizeArea=false;
this.containerObject.getCanvasStyle().cursor="default"};Header.prototype._bindContextMenu=function(
){if(window.mode.isMobile()||this._map.isReadOnlyMode()){return}this._unBindContextMenu();
$.contextMenu({selector:"#canvas-container",className:"cool-font",zIndex:1500,items:this._menuItem,
callback:function(){return}});$("#canvas-container").contextMenu("update");
this._map._contextMenu.stopRightMouseUpEvent()};Header.prototype._unBindContextMenu=function(){
$.contextMenu("destroy","#canvas-container")};Header.prototype.inResize=function(){
return this.containerObject.isDraggingSomething()&&this._dragEntry&&this._dragDistance!==null};
Header.prototype.drawResizeLineIfNeeded=function(){if(!this.inResize())return;
this.containerObject.setPenPosition(this);var isRTL=this.isCalcRTL();var x=this._isColumn?(
isRTL?this.size[0]-this._dragEntry.pos:this._dragEntry.pos)+this._dragDistance[0]:isRTL?0:this.size[
0];var y=this._isColumn?this.size[1]:this._dragEntry.pos+this._dragDistance[1];
this.context.lineWidth=app.dpiScale;this.context.strokeStyle="darkblue";this.context.beginPath();
this.context.moveTo(x,y);this.context.lineTo(this._isColumn?x:isRTL?-this.myTopLeft[0
]:this.containerObject.getWidth(),this._isColumn?this.containerObject.getHeight():y);
this.context.stroke()};Header.prototype.onMouseMove=function(point,dragDistance){
var result=this._entryAtPoint(point);if(result){this._prevMouseOverEntry=this._mouseOverEntry;
this._mouseOverEntry=result.entry}else return;if(!this.containerObject.isDraggingSomething()){
this._dragDistance=null;if(this._prevMouseOverEntry&&(
result&&result.entry.index!==this._prevMouseOverEntry.index)){this.containerObject.setPenPosition(
this);this._prevMouseOverEntry.isOver=false;this.drawHeaderEntry(this._prevMouseOverEntry)}
var isMouseOverResizeArea=false;this._mouseOverEntry.isOver=true;
this._lastMouseOverIndex=this._mouseOverEntry.index;this.containerObject.setPenPosition(this);
this.drawHeaderEntry(result.entry);isMouseOverResizeArea=result.hit;if(window.L.Browser.cypressTest
)return;if(isMouseOverResizeArea!==this._hitResizeArea){
var cursor=isMouseOverResizeArea?this._resizeCursor:this._cursor;
this.containerObject.getCanvasStyle().cursor=cursor;this._hitResizeArea=isMouseOverResizeArea}}else{
this._dragDistance=dragDistance;this.containerObject.requestReDraw();if(
this._prevMouseOverEntry&&this._lastSelectedIndex==this._prevMouseOverEntry.index)return;if(
this._dragEntry)return;
var modifier=typeof this._lastSelectedIndex==="number"&&this._lastSelectedIndex>=0?UNOModifier.SHIFT:0
this._lastSelectedIndex=this._mouseOverEntry.index;this.selectIndex(this._mouseOverEntry.index,
modifier)}};Header.prototype.selectIndex=function(index,modifier){return};
Header.prototype.setOptimalWidthAuto=function(){return};
Header.prototype.setOptimalHeightAuto=function(){return};Header.prototype.onDoubleClick=function(){
this._isColumn?this.setOptimalWidthAuto():this.setOptimalHeightAuto()};
Header.prototype.onMouseDown=function(point){this.onMouseMove(point);if(this._hitResizeArea){
window.L.DomUtil.disableImageDrag();window.L.DomUtil.disableTextSelection();this._dragEntry={
index:this._mouseOverEntry.index,origsize:this._mouseOverEntry.origsize,
pos:this._mouseOverEntry.pos,size:this._mouseOverEntry.size}}else{this._dragEntry=null}
this._startSelectionEntry=this._mouseOverEntry;this._lastSelectedIndex=null};
Header.prototype.onMouseUp=function(){window.L.DomUtil.enableImageDrag();
window.L.DomUtil.enableTextSelection();this._map.fire("closepopups");if(
this.containerObject.isDraggingSomething()&&this._dragEntry){this.onDragEnd(
this.containerObject.getDragDistance());this._dragEntry=null}};return Header}(CanvasSectionObject);
cool.Header=Header;var HeaderInfo=function(){function HeaderInfo(map,_isColumn){
window.app.console.assert(map&&_isColumn!==undefined,"map and isCol required");this._map=map;
this._isColumn=_isColumn;window.app.console.assert(this._map._docLayer.sheetGeometry,
"no sheet geometry data-structure found!");var sheetGeom=this._map._docLayer.sheetGeometry;
this._dimGeom=this._isColumn?sheetGeom.getColumnsGeometry():sheetGeom.getRowsGeometry()}
HeaderInfo.prototype.findXInCellSelections=function(cellSelections,ordinate){for(
var i=0;i<cellSelections.length;i++){if(cellSelections[i].containsPixelOrdinateX(ordinate)
)return true}return false};HeaderInfo.prototype.findYInCellSelections=function(cellSelections,
ordinate){for(var i=0;i<cellSelections.length;i++){if(cellSelections[i].containsPixelOrdinateY(
ordinate))return true}return false};HeaderInfo.prototype.isHeaderEntryHighLighted=function(
cellSelections,ordinate){if(this._isColumn&&this._map.wholeRowSelected)return true;else if(
!this._isColumn&&this._map.wholeColumnSelected)return true;else if(
this._isColumn&&cellSelections.length>0){return this.findXInCellSelections(cellSelections,ordinate)
}else if(!this._isColumn&&cellSelections.length>0){return this.findYInCellSelections(cellSelections,
ordinate)}else return false};HeaderInfo.prototype.update=function(section){var _this=this;
var cellSelections=this._map._docLayer._cellSelections;var currentIndex;if(
app.calc.cellCursorVisible){
currentIndex=this._isColumn?app.calc.cellAddress.x:app.calc.cellAddress.y}else{currentIndex=-1}
var tsManager=this._map._docLayer._painter;var ctx=tsManager._paintContext();
var splitPos=this._isColumn?ctx.splitPos.x:ctx.splitPos.y;var startPx;var scale;if(
tsManager._inZoomAnim){var viewBounds=ctx.viewBounds;var freePaneBounds=new cool.Bounds(
viewBounds.min.add(ctx.splitPos),viewBounds.max);scale=tsManager._zoomFrameScale;
var zoomPos=tsManager._getZoomDocPos(tsManager._newCenter,tsManager._layer._pinchStartCenter,
freePaneBounds,{freezeX:false,freezeY:false},ctx.splitPos,scale,false);
startPx=this._isColumn?zoomPos.topLeft.x:zoomPos.topLeft.y}else{
startPx=this._isColumn?app.activeDocument.activeView.viewedRectangle.pX1+splitPos:app.activeDocument.activeView.viewedRectangle.pY1+splitPos
scale=1}var endPx=this._isColumn?startPx+section.size[0]/scale:startPx+section.size[1]/scale;
this._docVisStart=startPx;var startIdx=this._dimGeom.getIndexFromPos(startPx,"corepixels");
var maxIndex=this._isColumn?this._map._docLayer.sheetGeometry.maxVisibleColumnIndex:this._map._docLayer.sheetGeometry.maxVisibleRowIndex
var endIdx=Math.min(this._dimGeom.getIndexFromPos(endPx-1,"corepixels"),1048576-1,maxIndex);
this._elements=[];this._hasSplits=false;this._splitIndex=0;if(splitPos){
var splitIndex=this._dimGeom.getIndexFromPos(splitPos+1,"corepixels");if(splitIndex){
this._splitPos=splitPos;this._dimGeom.forEachInRange(0,splitIndex-1,function(idx,data){
_this._elements[idx]={index:idx,pos:(data.startpos+data.size)*scale,size:data.size*scale,
origsize:data.size,isHighlighted:_this.isHeaderEntryHighLighted(cellSelections,
data.startpos+data.size*.5),isCurrent:idx===currentIndex}});this._hasSplits=true;
this._splitIndex=splitIndex;var freeStartPos=startPx;
var freeStartIndex=this._dimGeom.getIndexFromPos(freeStartPos+1,"corepixels");
startIdx=freeStartIndex}}var dataFirstFree=this._dimGeom.getElementData(startIdx);
var firstFreeEnd=dataFirstFree.startpos+dataFirstFree.size-startPx+splitPos;
var firstFreeStart=splitPos;var firstFreeSize=Math.max(0,firstFreeEnd-firstFreeStart);
this._elements[startIdx]={index:startIdx,pos:firstFreeEnd*scale,size:firstFreeSize*scale,
origsize:dataFirstFree.size,isHighlighted:this.isHeaderEntryHighLighted(cellSelections,
dataFirstFree.startpos+dataFirstFree.size*.5),isCurrent:startIdx===currentIndex};
this._dimGeom.forEachInRange(startIdx+1,endIdx,function(idx,data){_this._elements[idx]={index:idx,
pos:(data.startpos-startPx+splitPos+data.size)*scale,size:data.size*scale,origsize:data.size,
isHighlighted:_this.isHeaderEntryHighLighted(cellSelections,data.startpos+data.size*.5),
isCurrent:idx===currentIndex}});this._startIndex=startIdx;this._endIndex=endIdx};
HeaderInfo.prototype.docToHeaderPos=function(docPos){if(!this._hasSplits){
return docPos-this._docVisStart}if(docPos<=this._splitPos){return docPos}return Math.max(
docPos-this._docVisStart,this._splitPos)};HeaderInfo.prototype.headerToDocPos=function(hdrPos){if(
!this._hasSplits){return hdrPos+this._docVisStart}if(hdrPos<=this._splitPos){return hdrPos}
return hdrPos+this._docVisStart};HeaderInfo.prototype.isZeroSize=function(i){
var elem=this._elements[i];window.app.console.assert(elem,
"queried a non existent row/col in the header : "+i);return elem.size===0};
HeaderInfo.prototype.getMinIndex=function(){return this._hasSplits?0:this._startIndex};
HeaderInfo.prototype.getMaxIndex=function(){return this._endIndex};
HeaderInfo.prototype.getElementData=function(index){return this._elements[index]};
HeaderInfo.prototype.getRowData=function(index){window.app.console.assert(!this._isColumn,
"this is a column header instance!");return this.getElementData(index)};
HeaderInfo.prototype.getColData=function(index){window.app.console.assert(this._isColumn,
"this is a row header instance!");return this.getElementData(index)};
HeaderInfo.prototype.getPreviousIndex=function(index){var prevIndex;if(
this._splitIndex&&index===this._startIndex){prevIndex=this._splitIndex-1}else{prevIndex=index-1}
return prevIndex};HeaderInfo.prototype.getNextIndex=function(index){var nextIndex;if(
this._splitIndex&&index===this._splitIndex-1){nextIndex=this._startIndex}else{nextIndex=index+1}
return nextIndex};HeaderInfo.prototype.forEachElement=function(callback){var idx;if(this._hasSplits
){for(idx=0;idx<this._splitIndex;++idx){window.app.console.assert(this._elements[idx],
"forEachElement failed");if(callback(this._elements[idx])){return}}}for(
idx=this._startIndex;idx<=this._endIndex;++idx){window.app.console.assert(this._elements[idx],
"forEachElement failed");if(callback(this._elements[idx])){return}}};return HeaderInfo}();
cool.HeaderInfo=HeaderInfo})(cool||(cool={}));var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var cool;(function(cool
){var ColumnHeader=function(_super){__extends(ColumnHeader,_super);function ColumnHeader(cursor){
var _this=_super.call(this,app.CSections.ColumnHeader.name)||this;_this.anchor=[[
app.CSections.ColumnGroup.name,"bottom","top"],[app.CSections.CornerHeader.name,"right","left"]];
_this.position=[0,0];_this.size=[0,19*app.dpiScale];_this.expand=["right"];
_this.processingOrder=app.CSections.ColumnHeader.processingOrder;
_this.drawingOrder=app.CSections.ColumnHeader.drawingOrder;
_this.zIndex=app.CSections.ColumnHeader.zIndex;_this.cursor="col-resize";if(cursor
)_this.cursor=cursor;return _this}ColumnHeader.prototype.onInitialize=function(){
this._map=window.L.Map.THIS;this._isColumn=true;this._current=-1;
this._resizeHandleSize=15*app.dpiScale;this._selection={start:-1,end:-1};this._mouseOverEntry=null;
this._lastMouseOverIndex=undefined;this._hitResizeArea=false;
this.sectionProperties.docLayer=this._map._docLayer;this._selectionBackgroundGradient=["#3465A4",
"#729FCF","#004586"];this._map.on("move zoomchanged sheetgeometrychanged splitposchanged",
this._updateCanvas,this);this._map.on("darkmodechanged",
this._reInitRowColumnHeaderStylesAfterModeChange,this);this._initHeaderEntryStyles(
"spreadsheet-header-column");this._initHeaderEntryHoverStyles("spreadsheet-header-column-hover");
this._initHeaderEntrySelectedStyles("spreadsheet-header-column-selected");
this._initHeaderEntryResizeStyles("spreadsheet-header-column-resize");this._menuItem={
".uno:InsertColumnsBefore":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:InsertColumnsBefore",
"spreadsheet",true),"InsertColumnsBefore"),isHtmlName:true,callback:this._insertColBefore.bind(this)
},".uno:InsertColumnsAfter":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:InsertColumnsAfter",
"spreadsheet",true),"InsertColumnsAfter"),isHtmlName:true,callback:this._insertColAfter.bind(this)},
".uno:DeleteColumns":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:DeleteColumns","spreadsheet",
true),"DeleteColumns"),isHtmlName:true,callback:this._deleteSelectedCol.bind(this)},
".uno:ColumnWidth":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:ColumnWidth","spreadsheet",true)
,"ColumnWidth"),isHtmlName:true,callback:this._columnWidth.bind(this)},
".uno:SetOptimalColumnWidth":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:SetOptimalColumnWidth"
,"spreadsheet",true),"SetOptimalColumnWidth"),isHtmlName:true,callback:this._optimalWidth.bind(this)
},".uno:HideColumn":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:HideColumn","spreadsheet",true)
,"HideColumn"),isHtmlName:true,callback:this._hideColumn.bind(this)},".uno:ShowColumn":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:ShowColumn","spreadsheet",true),"ShowColumn"),
isHtmlName:true,callback:this._showColumn.bind(this)},".uno:FreezePanes":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:FreezePanes","spreadsheet",true),"FreezePanes"),
isHtmlName:true,callback:this._freezePanes.bind(this)}};
this._menuData=window.L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(this._menuItem,true,
"");this._headerInfo=new cool.HeaderInfo(this._map,true)};
ColumnHeader.prototype.drawHeaderEntry=function(entry){if(!entry)return;var isRTL=this.isCalcRTL();
var content=this._colIndexToAlpha(entry.index+1);var startX=isRTL?this.size[0
]-entry.pos:entry.pos-entry.size;if(entry.size<=0)return;
var highlight=entry.isCurrent||entry.isHighlighted;var selectionBackgroundGradient=null;if(highlight
){selectionBackgroundGradient=this.context.createLinearGradient(startX,0,startX,this.size[1]);
selectionBackgroundGradient.addColorStop(0,this._selectionBackgroundGradient[0]);
selectionBackgroundGradient.addColorStop(.5,this._selectionBackgroundGradient[1]);
selectionBackgroundGradient.addColorStop(1,this._selectionBackgroundGradient[2])}
this.context.beginPath();
this.context.fillStyle=highlight?selectionBackgroundGradient:entry.isOver?this._hoverColor:this._backgroundColor
this.context.fillRect(startX,0,entry.size,this.size[1]);var handleSize=this._resizeHandleSize;if(
entry.isCurrent&&entry.size>2*handleSize&&!this.inResize()){
var center=isRTL?startX+handleSize/2:startX+entry.size-handleSize/2;var y=2*app.dpiScale;
var h=this.size[1]-4*app.dpiScale;var size=2*app.dpiScale;var offset_1=1*app.dpiScale;
this.context.fillStyle="#BBBBBB";this.context.beginPath();this.context.fillRect(center-size-offset_1
,y+2*app.dpiScale,size,h-4*app.dpiScale);this.context.beginPath();this.context.fillRect(
center+offset_1,y+2*app.dpiScale,size,h-4*app.dpiScale)}
this.context.fillStyle=highlight?this._selectionTextColor:this._textColor;
this.context.font=this.getFont();this.context.textAlign="center";this.context.textBaseline="middle";
this.context.fillText(content,isRTL?startX+entry.size/2:entry.pos-entry.size/2,this.size[1]/2+1);
this.context.strokeStyle=this._borderColor;var offset=this.getLineOffset();
this.context.lineWidth=this.getLineWidth();this.context.strokeRect(startX-offset,offset,entry.size,
this.size[1])};ColumnHeader.prototype.getHeaderEntryBoundingClientRect=function(index){
var entry=this._mouseOverEntry;if(index){entry=this._headerInfo.getColData(index)}if(!entry)return;
var rect=this.containerObject.getCanvasBoundingClientRect();var colStart=(entry.pos-entry.size
)/app.dpiScale;var colEnd=entry.pos/app.dpiScale;var isRTL=this.isCalcRTL();
var left=isRTL?rect.right-colEnd:rect.left+colStart;
var right=isRTL?rect.right-colStart:rect.left+colEnd;var top=rect.top;var bottom=rect.bottom;return{
left:left,right:right,top:top,bottom:bottom}};ColumnHeader.prototype.onClick=function(point,e){if(
!this._mouseOverEntry)return;if(this._hitResizeArea)return;var col=this._mouseOverEntry.index;
var modifier=0;if(e.shiftKey){modifier+=UNOModifier.SHIFT}if(e.ctrlKey){modifier+=UNOModifier.CTRL}
this._selectColumn(col,modifier)};ColumnHeader.prototype._onDialogResult=function(e){if(
e.type==="submit"&&!isNaN(e.value)){var extra={aExtraWidth:{type:"unsigned short",value:e.value}};
this._map.sendUnoCommand(".uno:SetOptimalColumnWidth",extra)}};
ColumnHeader.prototype.onDragEnd=function(dragDistance){if(dragDistance[0]===0)return;
var width=this._dragEntry.size;var column=this._dragEntry.index;
var nextCol=this._headerInfo.getNextIndex(this._dragEntry.index);if(this._headerInfo.isZeroSize(
nextCol)){column=nextCol;width=0}var isRTL=this.isCalcRTL();if(isRTL){width-=dragDistance[0]}else{
width+=dragDistance[0]}width/=app.dpiScale;width=this._map._docLayer._pixelsToTwips({x:width,y:0}).x
var command={ColumnWidth:{type:"unsigned short",value:this._map._docLayer.twipsToHMM(Math.max(width,
0))},Column:{type:"unsigned short",value:column+1}};this._map.sendUnoCommand(".uno:ColumnWidth",
command);this._mouseOverEntry=null};ColumnHeader.prototype.onMouseUp=function(){
_super.prototype.onMouseUp.call(this);if(!(this.containerObject.isDraggingSomething(
)&&this._dragEntry)){this._lastSelectedIndex=null;this._startSelectionEntry=null}};
ColumnHeader.prototype.setOptimalWidthAuto=function(){if(this._mouseOverEntry){var extra={
aExtraHeight:{type:"unsigned short",value:0}};this._map.sendUnoCommand(
".uno:SetOptimalColumnWidthDirect",extra)}};ColumnHeader.prototype._getParallelPos=function(point){
return point.x};ColumnHeader.prototype._getOrthogonalPos=function(point){return point.y};
ColumnHeader.prototype.selectIndex=function(index,modifier){this._selectColumn(index,modifier)};
return ColumnHeader}(cool.Header);cool.ColumnHeader=ColumnHeader})(cool||(cool={}));
app.definitions.columnHeader=cool.ColumnHeader;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var cool;(function(cool
){var RowHeader=function(_super){__extends(RowHeader,_super);function RowHeader(cursor){
var _this=_super.call(this,app.CSections.RowHeader.name)||this;_this.anchor=[[
app.CSections.CornerHeader.name,"bottom","top"],[app.CSections.RowGroup.name,"right","left"]];
_this.position=[0,0];_this.size=[48*app.dpiScale,0];_this.expand=["top","bottom"];
_this.processingOrder=app.CSections.RowHeader.processingOrder;
_this.drawingOrder=app.CSections.RowHeader.drawingOrder;_this.zIndex=app.CSections.RowHeader.zIndex;
_this.cursor="row-resize";if(cursor)_this.cursor=cursor;return _this}
RowHeader.prototype.onInitialize=function(){this._map=window.L.Map.THIS;this._isColumn=false;
this._current=-1;this._resizeHandleSize=15*app.dpiScale;this._selection={start:-1,end:-1};
this._mouseOverEntry=null;this._lastMouseOverIndex=undefined;this._hitResizeArea=false;
this.sectionProperties.docLayer=this._map._docLayer;this._selectionBackgroundGradient=["#3465A4",
"#729FCF","#004586"];this._map.on("move zoomchanged sheetgeometrychanged splitposchanged",
this._updateCanvas,this);this._map.on("darkmodechanged",
this._reInitRowColumnHeaderStylesAfterModeChange,this);this._initHeaderEntryStyles(
"spreadsheet-header-row");this._initHeaderEntryHoverStyles("spreadsheet-header-row-hover");
this._initHeaderEntrySelectedStyles("spreadsheet-header-row-selected");
this._initHeaderEntryResizeStyles("spreadsheet-header-row-resize");this._menuItem={
".uno:InsertRowsBefore":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:InsertRowsBefore",
"spreadsheet",true),"InsertRowsBefore"),isHtmlName:true,callback:this._insertRowAbove.bind(this)},
".uno:InsertRowsAfter":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:InsertRowsAfter",
"spreadsheet",true),"InsertRowsAfter"),isHtmlName:true,callback:this._insertRowBelow.bind(this)},
".uno:DeleteRows":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:DeleteRows","spreadsheet",true),
"DeleteRows"),isHtmlName:true,callback:this._deleteSelectedRow.bind(this)},".uno:RowHeight":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:RowHeight","spreadsheet",true),"RowHeight"),
isHtmlName:true,callback:this._rowHeight.bind(this)},".uno:SetOptimalRowHeight":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:SetOptimalRowHeight","spreadsheet",true),
"SetOptimalRowHeight"),isHtmlName:true,callback:this._optimalHeight.bind(this)},".uno:HideRow":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:HideRow","spreadsheet",true),"HideRow"),
isHtmlName:true,callback:this._hideRow.bind(this)},".uno:ShowRow":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:ShowRow","spreadsheet",true),"ShowRow"),
isHtmlName:true,callback:this._showRow.bind(this)},".uno:FreezePanes":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:FreezePanes","spreadsheet",true),"FreezePanes"),
isHtmlName:true,callback:this._freezePanes.bind(this)}};
this._menuData=window.L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(this._menuItem,true,
"");this._headerInfo=new cool.HeaderInfo(this._map,false)};
RowHeader.prototype.drawHeaderEntry=function(entry){if(!entry)return;var content=entry.index+1;
var startY=entry.pos-entry.size;if(entry.size<=0)return;
var highlight=entry.isCurrent||entry.isHighlighted;var selectionBackgroundGradient=null;if(highlight
){selectionBackgroundGradient=this.context.createLinearGradient(0,startY,0,startY+entry.size);
selectionBackgroundGradient.addColorStop(0,this._selectionBackgroundGradient[0]);
selectionBackgroundGradient.addColorStop(.5,this._selectionBackgroundGradient[1]);
selectionBackgroundGradient.addColorStop(1,this._selectionBackgroundGradient[2])}
this.context.beginPath();
this.context.fillStyle=highlight?selectionBackgroundGradient:entry.isOver?this._hoverColor:this._backgroundColor
this.context.fillRect(0,startY,this.size[0],entry.size);var handleSize=this._resizeHandleSize;if(
entry.isCurrent&&entry.size>2*handleSize&&!this.inResize()){
var center=startY+entry.size-handleSize/2;var x=2*app.dpiScale;var w=this.size[0]-4*app.dpiScale;
var size=2*app.dpiScale;var offsetOnePixel=1*app.dpiScale;this.context.fillStyle="#BBBBBB";
this.context.beginPath();this.context.fillRect(x+2*app.dpiScale,center-size-offsetOnePixel,
w-4*app.dpiScale,size);this.context.beginPath();this.context.fillRect(x+2*app.dpiScale,
center+offsetOnePixel,w-4*app.dpiScale,size)}
this.context.fillStyle=highlight?this._selectionTextColor:this._textColor;
this.context.font=this.getFont();this.context.textAlign="center";this.context.textBaseline="middle";
this.context.fillText(content.toString(),this.size[0]/2,entry.pos-entry.size/2+app.roundedDpiScale);
this.context.strokeStyle=this._borderColor;var offset=this.getLineOffset();
this.context.lineWidth=this.getLineWidth();this.context.strokeRect(offset,startY-offset,this.size[0]
,entry.size)};RowHeader.prototype.getHeaderEntryBoundingClientRect=function(index){
var entry=this._mouseOverEntry;if(index)entry=this._headerInfo.getRowData(index);if(!entry)return;
var rect=this.containerObject.getCanvasBoundingClientRect();var rowStart=(entry.pos-entry.size
)/app.dpiScale;var rowEnd=entry.pos/app.dpiScale;var left=rect.left;var right=rect.right;
var top=rect.top+rowStart;var bottom=rect.top+rowEnd;return{left:left,right:right,top:top,
bottom:bottom}};RowHeader.prototype.onClick=function(point,e){if(!this._mouseOverEntry)return;if(
this._hitResizeArea)return;var row=this._mouseOverEntry.index;var modifier=0;if(e.shiftKey){
modifier+=UNOModifier.SHIFT}if(e.ctrlKey){modifier+=UNOModifier.CTRL}this._selectRow(row,modifier)};
RowHeader.prototype._onDialogResult=function(e){if(e.type==="submit"&&!isNaN(e.value)){var extra={
aExtraHeight:{type:"unsigned short",value:e.value}};this._map.sendUnoCommand(
".uno:SetOptimalRowHeight",extra)}};RowHeader.prototype.onDragEnd=function(dragDistance){if(
dragDistance[1]===0)return;var height=this._dragEntry.size;var row=this._dragEntry.index;
var nextRow=this._headerInfo.getNextIndex(this._dragEntry.index);if(this._headerInfo.isZeroSize(
nextRow)){row=nextRow;height=0}height+=dragDistance[1];height/=app.dpiScale;
height=this._map._docLayer._pixelsToTwips({x:0,y:height}).y;var command={RowHeight:{
type:"unsigned short",value:this._map._docLayer.twipsToHMM(Math.max(height,0))},Row:{type:"long",
value:row+1}};this._map.sendUnoCommand(".uno:RowHeight",command);this._mouseOverEntry=null};
RowHeader.prototype.onMouseUp=function(){_super.prototype.onMouseUp.call(this);if(!(
this.containerObject.isDraggingSomething()&&this._dragEntry)){this._lastSelectedIndex=null;
this._startSelectionEntry=null}};RowHeader.prototype.setOptimalHeightAuto=function(){if(
this._mouseOverEntry){var extra={aExtraHeight:{type:"unsigned short",value:0}};
this._map.sendUnoCommand(".uno:SetOptimalRowHeight",extra)}};
RowHeader.prototype._getParallelPos=function(point){return point.y};
RowHeader.prototype._getOrthogonalPos=function(point){return point.x};
RowHeader.prototype.selectIndex=function(index,modifier){this._selectRow(index,modifier)};
return RowHeader}(cool.Header);cool.RowHeader=RowHeader})(cool||(cool={}));
app.definitions.rowHeader=cool.RowHeader;window.L.Control.DocumentRepair=window.L.Control.extend({
builder:null,actions:null,selected:null,addTo:function(map){this.remove();var data={
id:"DocumentRepairDialog",dialogid:"DocumentRepairDialog",type:"dialog",text:_("Repair Document"),
title:_("Repair Document"),jsontype:"dialog",responses:[{id:"ok",response:1},{id:"cancel",response:0
}],init_focus_id:"ok",enabled:true,children:[{id:"dialog-vbox1",type:"container",text:"",
enabled:true,vertical:true,children:[{type:"treelistbox",id:"versions",enabled:false},{
id:"dialog-action_area1",type:"container",text:"",enabled:true,vertical:true,children:[{id:"",
type:"buttonbox",text:"",enabled:true,children:[{id:"cancel",type:"pushbutton",text:_("Cancel"),
enabled:true},{id:"ok",type:"pushbutton",text:_("OK"),enabled:true,has_default:true}],
vertical:false,layoutstyle:"end"}]}]}]};this._map=map;this.actions=[];var dialogBuildEvent={
data:data,callback:this._onAction.bind(this)};this._map.fire(window.mode.isMobile(
)?"mobilewizard":"jsdialog",dialogBuildEvent);return this},createAction:function(type,index,comment,
viewId,dateTime,action){this.actions.push({text:comment,columns:[type,comment,viewId,dateTime].map(
function(item){return{text:item}}),row:index,action:action})},fillAction:function(actions,type,
action){for(var iterator=0;iterator<actions.length;++iterator){var userName=actions[iterator
].userName?actions[iterator].userName:"";if(parseInt(actions[iterator].viewId
)===this._map._docLayer._viewId){userName=_("You")}this.createAction(type,actions[iterator].index,
actions[iterator].comment,userName,this.transformTimestamp(actions[iterator].dateTime),action)}},
show:function(){if(this.actions.length!==0){var dialogUpdateEvent={data:{jsontype:"dialog",
action:"update",id:"DocumentRepairDialog",control:{id:"versions",type:"treelistbox",headers:[_(
"Type"),_("What?"),_("Who?"),_("When?")].map(function(item){return{text:item}}),text:"",
enabled:true,entries:this.actions}},callback:this._onAction.bind(this)}}else{var dialogUpdateEvent={
data:{jsontype:"dialog",action:"update",id:"DocumentRepairDialog",control:{id:"versions",
type:"fixedtext",text:_("You have not done anything to rollback yet...")}}}}if(window.mode.isMobile(
))window.mobileDialogId=dialogUpdateEvent.data.id;this._map.fire("jsdialogupdate",dialogUpdateEvent)
},fillActions:function(data){this.fillAction(data.Redo.actions,_("Redo"),"Redo");this.fillAction(
data.Undo.actions,_("Undo"),"Undo")},_onAction:function(element,action,data,index){if(
element==="dialog"&&action==="close")return;if(element==="treeview"){var entry=data.entries[
parseInt(index)];this.selected={action:entry.action,index:parseInt(entry.row)};return}if(
element==="responsebutton"&&data.id=="ok"&&this.selected){this._onOk(this.selected.action,
this.selected.index)}var closeEvent={data:{action:"close",id:"DocumentRepairDialog"}};
this._map.fire(window.mode.isMobile()?"closemobilewizard":"jsdialog",closeEvent);console.log(
"Closed after"+element+" "+action)},_onOk:function(action,index){var command={Repair:{
type:"boolean",value:true}};command[action]={type:"unsigned short",value:index+1};
this._map.sendUnoCommand(".uno:"+action,command,true)},transformTimestamp:function(timestamp){
var d=new Date(timestamp.split(",")[0]+"Z");var dateOptions={year:"numeric",month:"2-digit",
day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:true};
var formattedDateTime=d.toLocaleString(String.locale,dateOptions);return formattedDateTime}});
window.L.control.documentRepair=function(options){return new window.L.Control.DocumentRepair(options
)};window.L.Control.DownloadProgress=window.L.Control.extend({options:{snackbarTimeout:2e4,
userWarningKey:"warnedAboutLargeCopy"},initialize:function(options){window.L.setOptions(this,options
)},onAdd:function(map){this._map=map;this._started=false;this._complete=false;this._closed=false;
this._isLargeCopy=false;this._infinite=true},_userAlreadyWarned:function(){
return window.prefs.getBoolean(this.options.userWarningKey)},_setUserAlreadyWarned:function(){
window.prefs.set(this.options.userWarningKey,true)},_getDialogTitle:function(){return _(
"Download Selection")},_getLargeCopyPasteMessage:function(){
return this._map._clip._substProductName(_(
"If you want to share large elements outside of {productname} it's necessary to first download them."
))},_getDownloadProgressDialogId:function(){return"copy_paste_download_progress"},
_showLargeCopyPasteWarning:function(inSnackbar){var modalId=this._getDownloadProgressDialogId();
var msg=this._getLargeCopyPasteMessage();var buttonText=_("Download")+app.util.replaceCtrlAltInMac(
" (Ctrl + C)");if(inSnackbar){this._map.uiManager.showSnackbar(msg,buttonText,
this._onStartDownload.bind(this),this.options.snackbarTimeout);
this.setupKeyboardShortcutForSnackbar()}else{this._map.uiManager.showInfoModal(modalId,
this._getDialogTitle(),msg,"",buttonText,this._onStartDownload.bind(this),true,modalId+"-response");
app.layoutingService.appendLayoutingTask(()=>{this.setupKeyboardShortcutForDialog(modalId)})}},
_showDownloadProgress:function(inSnackbar){var modalId=this._getDownloadProgressDialogId();
var msg=_("Downloading clipboard content");var buttonText=_("Cancel");if(inSnackbar){
this._map.uiManager.showProgressBar(msg,buttonText,this._onClose.bind(this),undefined,undefined,
this._infinite)}else if(this._isLargeCopy){buttonText=_("Copy")+app.util.replaceCtrlAltInMac(
" (Ctrl + C)");this._map.uiManager.showProgressBarDialog(modalId,this._getDialogTitle(),msg,
buttonText,this._onConfirmCopyAction.bind(this),0,this._onClose.bind(this),this._infinite);
JSDialog.enableButtonInModal(modalId,modalId+"-response",false)}else{
this._map.uiManager.showProgressBarDialog(modalId,this._getDialogTitle(),msg,"",this._onClose.bind(
this),0,this._onClose.bind(this),this._infinite)}},_closeDownloadProgressDialog:function(){
var modalId=this._getDownloadProgressDialogId();if(!this._userAlreadyWarned()
)this._map.uiManager.closeModal(this._map.uiManager.generateModalId(modalId))},
_showDownloadComplete:function(inSnackbar){var modalId=this._getDownloadProgressDialogId();
var snackbarMsg=_("Download completed and ready to be copied to clipboard.");
var dialogMsg=snackbarMsg+" "+_(
"From now on clipboard notifications will discreetly appear at the bottom.");var buttonText=_("Copy"
)+app.util.replaceCtrlAltInMac(" (Ctrl + C)");if(inSnackbar){
this._map.uiManager.setSnackbarProgress(100);this._map.uiManager.showSnackbar(snackbarMsg,buttonText
,this._onConfirmCopyAction.bind(this),this.options.snackbarTimeout);setTimeout(()=>{
this.setupKeyboardShortcutForSnackbar()},100)}else{JSDialog.setMessageInModal(modalId,dialogMsg,"");
JSDialog.enableButtonInModal(modalId,modalId+"-response",true);this.setupKeyboardShortcutForDialog(
modalId)}},_setupKeyboardShortcutForElement:function(eventTargetId,buttonId){
var keyDownCallback=function(e){var modifierKeys=!e.altKey&&!e.shiftKey;if(window.L.Browser.mac){
modifierKeys=modifierKeys&&e.metaKey&&!e.ctrlKey}else{
modifierKeys=modifierKeys&&e.ctrlKey&&!e.metaKey}if(modifierKeys&&e.key==="c"){
document.getElementById(buttonId).click();e.preventDefault()}};if(document.getElementById(
eventTargetId))document.getElementById(eventTargetId).onkeydown=keyDownCallback.bind(this)},
setupKeyboardShortcutForDialog:function(modalId){var dialogId=this._map.uiManager.generateModalId(
modalId);var buttonId=modalId+"-response";this._setupKeyboardShortcutForElement(dialogId,buttonId);
document.getElementById(buttonId).focus()},setupKeyboardShortcutForSnackbar:function(){
this._setupKeyboardShortcutForElement("snackbar-container","button");if(document.getElementById(
"button"))document.getElementById("button").focus()},show:function(isLargeCopy){
window.app.console.log("DownloadProgress.show");this._started=false;this._complete=false;
this._closed=false;this._isLargeCopy=isLargeCopy;if(isLargeCopy)this._showLargeCopyPasteWarning(
this._userAlreadyWarned());else this._showDownloadProgress(this._userAlreadyWarned())},
isClosed:function(){return this._closed},isStarted:function(){return this._started},
isComplete:function(){return this._complete},currentStatus:function(){if(this._closed)return"closed"
if(!this._started&&!this._complete)return"downloadButton";if(this._started)return"progress";if(
this._complete)return"confirmPasteButton"},setURI:function(uri){this._uri=uri},setValue:function(
value){if(this._userAlreadyWarned())this._map.uiManager.setSnackbarProgress(Math.round(value),
this._infinite);else{var modalId=this._getDownloadProgressDialogId();
this._map.uiManager.setDialogProgress(modalId,Math.round(value),this._infinite)}},
_setProgressCursor:function(){$("#map").css("cursor","progress")},_setNormalCursor:function(){$(
"#map").css("cursor","default")},startProgressMode:function(){this._setProgressCursor();
this._started=true;this.setValue(0)},_onStartDownload:function(){if(!this._uri)return;
this._showDownloadProgress(this._userAlreadyWarned());this.startProgressMode();this._download();
return true},_onUpdateProgress:function(e){if(e.statusType==="setvalue"){this.setValue(e.value)
}else if(e.statusType==="finish"){this._onComplete()}},_onComplete:function(){if(this._complete
)return;this.setValue(100);this._setNormalCursor();this._complete=true;this._started=false;if(
this._isLargeCopy)this._showDownloadComplete(this._userAlreadyWarned()
);else this._closeDownloadProgressDialog()},_onConfirmCopyAction:function(){
this._map._clip.filterExecCopyPaste(".uno:Copy");this._onClose();this._setUserAlreadyWarned();
var msg=_("Content copied to clipboard");this._map.uiManager.showSnackbar(msg)},_onClose:function(){
if(this._userAlreadyWarned())this._map.uiManager.closeSnackbar();if(this._started
)this._closeDownloadProgressDialog();this._started=false;this._complete=false;this._closed=true;
this._setNormalCursor();this._cancelDownload();if(this._map)this._map.focus()},
_download:async function(){let response;try{response=await this._map._clip._doAsyncDownload("GET",
this._uri,null,true,function(progress){return progress/2})}catch(error){this._onClose();
app.showAsyncDownloadError(error,_("Download failed"));return}window.app.console.log(
"clipboard async download done");var reader=new FileReader;reader.onload=()=>{var text=reader.result
window.app.console.log("async clipboard parse done: "+text.substring(0,256));
let result=this._map._clip.parseClipboard(text);this._map._clip.setTextSelectionHTML(result["html"],
result["plain"])};reader.readAsText(response)},_cancelDownload:function(){this._setNormalCursor();
if(!this._started||this._complete)return}});window.L.control.downloadProgress=function(options){
return new window.L.Control.DownloadProgress(options)};
window.L.Control.ContextMenu=window.L.Control.extend({options:{SEPARATOR:"---------",whitelist:{
general:["Cut","Copy","Paste","PasteSpecial","Delete","FormatPaintbrush","ResetAttributes",
"NumberingStart","ContinueNumbering","IncrementLevel","DecrementLevel","OpenHyperlinkOnCursor",
"InsertHyperlink","EditHyperlink","CopyHyperlinkLocation","RemoveHyperlink","AnchorMenu",
"SetAnchorToPage","SetAnchorToPara","SetAnchorAtChar","SetAnchorToChar","SetAnchorToFrame","Crop",
"WrapMenu","WrapOff","WrapOn","WrapIdeal","WrapLeft","WrapRight","WrapThrough",
"WrapThroughTransparencyToggle","WrapContour","WrapAnchorOnly","ConvertMenu","ChangeBezier",
"DistributeHorzCenter","DistributeHorzDistance","DistributeHorzLeft","DistributeHorzRight",
"DistributeVertBottom","DistributeVertCenter","DistributeVertDistance","DistributeVertTop",
"ArrangeFrameMenu","ArrangeMenu","BringToFront","ObjectForwardOne","ObjectBackOne","SendToBack",
"RotateMenu","RotateLeft","RotateRight","TransformDialog","FormatLine","FormatArea",
"FormatChartArea","InsertTitles","InsertRemoveAxes","DeleteLegend","DiagramType","DataRanges",
"DiagramData","View3D","FormatWall","FormatFloor","FormatLegend","FormatTitle","FormatDataSeries",
"FormatAxis","FormatMajorGrid","FormatMinorGrid","FormatDataLabels","FormatDataLabel",
"FormatDataPoint","FormatMeanValue","FormatXErrorBars","FormatYErrorBars","FormatTrendline",
"FormatTrendlineEquation","FormatSelection","FormatStockLoss","FormatStockGain","InsertDataLabel",
"InsertDataLabels","DeleteDataLabel","DeleteDataLabels","ResetDataPoint","InsertTrendline",
"InsertMeanValue","InsertXErrorBars","InsertYErrorBars","ResetAllDataPoints","DeleteAxis",
"InsertAxisTitle","InsertMinorGrid","InsertMajorGrid","InsertAxis","DeleteMajorGrid",
"DeleteMinorGrid","SpellCheckIgnoreAll","LanguageStatus","SpellCheckApplySuggestion","PageDialog",
"CompressGraphic","GraphicDialog","InsertCaptionDialog","AnimationEffects","ExecuteAnimationEffect",
"NextTrackedChange","PreviousTrackedChange","RejectTrackedChange","AcceptTrackedChange",
"ReinstateTrackedChange","InsertAnnotation"],text:["TableInsertMenu","InsertRowsBefore",
"InsertRowsAfter","InsertColumnsBefore","InsertColumnsAfter","TableDeleteMenu",
"SetObjectToBackground","SetObjectToForeground","DeleteRows","DeleteColumns","DeleteTable",
"EditCurrentRegion","MergeCells","SetOptimalColumnWidth","SetOptimalRowHeight","UpdateCurIndex",
"RemoveTableOf","ReplyComment","DeleteComment","DeleteAuthor","DeleteAllNotes",
"SpellingAndGrammarDialog","FontDialog","FontDialogForParagraph","TableDialog","SpellCheckIgnore",
"FrameDialog","UnfloatFrame","ContentControlProperties","DeleteContentControl","AddToWordbook"],
spreadsheet:["MergeCells","SplitCell","InsertCell","DeleteCell","RecalcPivotTable",
"DataDataPilotRun","DeletePivotTable","FormatCellDialog","DeleteNote","SetAnchorToCell",
"SetAnchorToCellResize","FormatSparklineMenu","InsertSparkline","DeleteSparkline",
"DeleteSparklineGroup","EditSparklineGroup","EditSparkline","GroupSparklines","UngroupSparklines",
"AutoFill"],presentation:["SetDefault"],drawing:[]},mobileBlackList:["PasteSpecial",
"TransformDialog","FormatLine","FormatArea","InsertTitles","InsertRemoveAxes","DiagramType",
"DataRanges","FormatWall","FormatDataSeries","FormatXErrorBars","FormatYErrorBars","FormatDataPoint"
,"FormatAxis","FormatMajorGrid","FormatMinorGrid","InsertTrendline","InsertXErrorBars",
"InsertYErrorBars","FormatChartArea","FormatMeanValue","DiagramData","FormatLegend",
"FormatTrendline","FormatTrendlineEquation","FormatStockLoss","FormatStockGain","LanguageStatus",
"PageDialog","SpellingAndGrammarDialog","FontDialog","FontDialogForParagraph","FormatCellDialog",
"DataDataPilotRun","GroupSparklines","UngroupSparklines","AutoFill"]},onAdd:function(map){
this._prevMousePos=null;this._autoFillContextMenu=false;map._contextMenu=this;map.on("locontextmenu"
,this._onContextMenu,this);map.on("mousedown",this._onMouseDown,this);map.on("mouseup",
this._onMouseUp,this);map.on("keydown",this._onKeyDown,this);map.on("closepopups",this._onClosePopup
,this)},_onClosePopup:function(){if(this._autoFillContextMenu){this._autoFillContextMenu=false;
app.map._docLayer._resetReferencesMarks()}$.contextMenu("destroy",".leaflet-layer");
this.hasContextMenu=false},_onMouseDown:function(e){this._prevMousePos={x:e.originalEvent.pageX,
y:e.originalEvent.pageY};this._onClosePopup()},_onMouseUp:function(e){this._currMousePos={
x:e.originalEvent.pageX,y:e.originalEvent.pageY}},_onKeyDown:function(e){if(
e.originalEvent.keyCode===27){$.contextMenu("destroy",".leaflet-layer");this.hasContextMenu=false}},
_onContextMenu:function(obj){var map=this._map;if(!map.isEditMode()){return}if(this.hasContextMenu){
this._onClosePopup()}this._amendContextMenuData(obj);
var contextMenu=this._createContextMenuStructure(obj);if(Object.keys(contextMenu).length==0){return}
var spellingContextMenu=false;var autoFillContextMenu=false;for(var menuItem in contextMenu){if(
menuItem.indexOf(".uno:SpellCheckIgnore")!==-1){spellingContextMenu=true;break}else if(
menuItem.indexOf(".uno:AutoFill")!==-1){map.fire("closeautofillpreviewpopup");
this._autoFillContextMenu=autoFillContextMenu=true;break}}if(window.mode.isMobile()){
window.contextMenuWizard=true;
var menuData=window.L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(contextMenu,true,"");
map.fire("mobilewizard",{data:menuData})}else{window.L.installContextMenu({
selector:".leaflet-layer",className:"cool-font on-the-fly-context-menu",trigger:"none",zIndex:1500,
build:function(){return{callback:function(key){if(key===".uno:InsertAnnotation"){
app.map.insertComment()}else if(map._clip===undefined||!map._clip.filterExecCopyPaste(key)){
map.sendUnoCommand(key);if(spellingContextMenu)map._docLayer._clearSelections();map.focus()}},
items:contextMenu}},events:{show:function(opt){var $menu=opt.$menu;$menu.attr("tabindex",0)},
activated:function(opt){if(autoFillContextMenu){var $layer=opt.$layer;$layer.css("pointer-events",
"none")}},hide:function(){if(autoFillContextMenu)app.map._docLayer._resetReferencesMarks();
map.focus()}}});if(autoFillContextMenu)$(".leaflet-layer").contextMenu(this._currMousePos);else $(
".leaflet-layer").contextMenu(this._prevMousePos);$(".context-menu-root").focus();
this.hasContextMenu=true}},_amendContextMenuData:function(obj){if(
GraphicSelection.hasActiveSelection()){var insertIndex=-1;obj.menu.forEach(function(item,index){if(
item.command===".uno:Paste"){insertIndex=index+1}});if(insertIndex!=-1){obj.menu.splice(insertIndex,
0,{text:_("Delete"),type:"command",command:".uno:Delete",enabled:true})}}},
_createContextMenuStructure:function(obj){var docType=this._map.getDocType();var contextMenu={};
var sepIdx=1,itemName;var subMenuIdx=1;var isLastItemText=false;for(var idx in obj.menu){
var item=obj.menu[idx];if(item.enabled==="false"){continue}if(this._map.uiManager.hiddenCommands[
item.command]){continue}if(item.type==="menu"&&item.text&&item.text.replace("~",""
)==="Paste Special"&&item.menu&&item.menu.length){item.text=_("Paste Special");
item.command=".uno:PasteSpecial";item.type=item.menu[0].type;item.menu=undefined}if(
item.type==="command"&&item.text&&item.text.replace("~","")==="Copy Cells"){item.text=_("Copy Cells"
);item.command=".uno:AutoFill?Copy:bool=true"}if(
item.type==="command"&&item.text&&item.text.replace("~","")==="Fill Series"){item.text=_(
"Fill Series");item.command=".uno:AutoFill?Copy:bool=false"}if(item.type==="separator"){if(
isLastItemText){contextMenu["sep"+sepIdx++]=this.options.SEPARATOR}isLastItemText=false}else if(
item.type==="command"){var commandName=item.command.substring(5);var hasParam=false;if(
commandName.indexOf("?")!==-1){commandName=commandName.substring(0,commandName.indexOf("?"));
hasParam=true}if(commandName==="FontDialog"&&!hasParam)continue;if(
commandName!=="None"&&this.options.whitelist.general.indexOf(commandName)===-1&&!(
docType==="text"&&this.options.whitelist.text.indexOf(commandName)!==-1)&&!(
docType==="spreadsheet"&&this.options.whitelist.spreadsheet.indexOf(commandName)!==-1)&&!(
docType==="presentation"&&this.options.whitelist.presentation.indexOf(commandName)!==-1)&&!(
docType==="drawing"&&this.options.whitelist.drawing.indexOf(commandName)!==-1)){continue}if(
window.mode.isMobile()&&this.options.mobileBlackList.indexOf(commandName)!==-1)continue;if(
commandName=="None"&&!item.text)continue;if(
hasParam||commandName==="None"||commandName==="FontDialogForParagraph"||commandName==="Delete"||commandName=="PasteSpecial"
){itemName=window.removeAccessKey(item.text);itemName=itemName.replace(" "," ")}else{itemName=_UNO(
item.command,docType,true)}contextMenu[item.command]={name:window.mode.isMobile()?_(itemName
):app.IconUtil.createMenuItemLink(itemName,commandName),isHtmlName:true};if(
item.checktype==="checkmark"){if(item.checked==="true"){contextMenu[item.command]["icon"
]="lo-checkmark"}}else if(item.checktype==="radio"){if(item.checked==="true"){contextMenu[
item.command]["icon"]="radio"}}isLastItemText=true}else if(item.type==="menu"){itemName=item.text;
var submenu=this._createContextMenuStructure(item);if(Object.keys(submenu).length===0){continue}
contextMenu["submenu"+subMenuIdx++]={name:_(itemName).replace(/\(~[A-Za-z]\)/,"").replace("~",""),
command:item.command,items:submenu};isLastItemText=true}}var lastItem=Object.keys(contextMenu)[
Object.keys(contextMenu).length-1];if(lastItem!==undefined&&lastItem.startsWith("sep")){
delete contextMenu[lastItem]}return contextMenu},stopRightMouseUpEvent:function(){
var menuItems=document.getElementsByClassName("context-menu-item");for(
var i=0;i<menuItems.length;i++){menuItems[i].addEventListener("mouseup",function(e){if(e.button==2
)e.stopPropagation()})}}});window.L.control.contextMenu=function(options){
return new window.L.Control.ContextMenu(options)};window.L.installContextMenu=function(options){
var rewrite=function(items){if(items===undefined)return;var keys=Object.keys(items);for(
var i=0;i<keys.length;i++){var key=keys[i];if(items[key]===undefined)continue;if(!items[key
].isHtmlName){items[key].name='<a href="#" class="context-menu-link">'+items[key].name+"</a>";items[
key].isHtmlName=true}rewrite(items[key].items)}};rewrite(options.items);if(
document.documentElement.dir==="rtl"){options.positionSubmenu=function($menu){if(
typeof $menu==="undefined"){return}$menu.css("right","auto");
$.contextMenu.defaults.positionSubmenu.call(this,$menu);$menu.css("right",$menu.css("left"))}}
$.contextMenu(options)};var __extends=this&&this.__extends||function(){var extendStatics=function(d,
b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var Menubar=function(_super){__extends(Menubar,_super);
function Menubar(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.options={
initial:[{name:_UNO(".uno:PickList")},{name:_UNO(".uno:EditMenu")},{name:_UNO(".uno:ViewMenu")},{
name:_UNO(".uno:InsertMenu")},{name:_UNO(".uno:ToolsMenu")}],text:[{name:_UNO(".uno:PickList","text"
),id:"file",type:"menu",menu:[{name:_UNO(".uno:Save","text"),id:"save",type:"action"},{name:_UNO(
".uno:SaveAs","text"),id:"saveas",type:window.prefs.get("saveAsMode")==="group"?"menu":"action",
menu:[{name:_("ODF text document (.odt)"),id:"saveas-odt",type:"action"},{name:_(
"Word 2003 Document (.doc)"),id:"saveas-doc",type:"action"},{name:_("Word Document (.docx)"),
id:"saveas-docx",type:"action"},{name:_("Rich Text (.rtf)"),id:"saveas-rtf",type:"action"}]},{
name:_("Export as"),id:"exportas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:"exportas-pdf",type:"action"},{name:_("EPUB (.epub)"),id:"exportas-epub",type:"action"}]},{
name:_("Rename Document"),id:"renamedocument",type:"action"},{name:_("Share..."),id:"shareas",
type:"action"},{name:_("See revision history"),id:"rev-history",type:"action"},{
name:!window.ThisIsAMobileApp?_("Download as"):_("Export as"),id:"downloadas",type:"menu",menu:[{
name:_("PDF Document (.pdf)"),id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",
type:"action"},{name:_("PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_(
"ODF text document (.odt)"),id:"downloadas-odt",type:"action"},{name:_("Word 2003 Document (.doc)"),
id:"downloadas-doc",type:"action"},{name:_("Word Document (.docx)"),id:"downloadas-docx",
type:"action"},{name:_("Rich Text (.rtf)"),id:"downloadas-rtf",type:"action"},{name:_("EPUB (.epub)"
),id:!window.ThisIsAMobileApp?"exportepub":"downloadas-epub",type:"action"},{name:_(
"HTML file (.html)"),id:"downloadas-html",type:"action"}]},{name:_UNO(".uno:SetDocumentProperties",
"text"),uno:".uno:SetDocumentProperties",id:"properties"},{name:_UNO(".uno:Signature","text"),
uno:".uno:Signature",id:"signature"},{name:_("Options"),id:"settings-dialog",type:"action",
mobileapp:false},{type:"separator"},{name:"ечать",id:"print",type:"action"},{
name:_("Close document"),id:"closedocument",type:"action"}]},{name:_UNO(".uno:EditMenu","text"),
id:"editmenu",type:"menu",menu:[{name:_UNO(".uno:Undo","text"),uno:".uno:Undo"},{name:_UNO(
".uno:Redo","text"),uno:".uno:Redo"},{name:_("Repair"),id:"repair",type:"action"},{type:"separator"}
,{name:_UNO(".uno:Cut","text"),uno:".uno:Cut"},{name:_UNO(".uno:Copy","text"),uno:".uno:Copy"},{
name:_UNO(".uno:Paste","text"),uno:".uno:Paste"},{name:_UNO(".uno:PasteSpecial","text"),
uno:".uno:PasteSpecial"},{name:_UNO(".uno:SelectAll","text"),uno:".uno:SelectAll"},{type:"separator"
},{uno:".uno:SearchDialog"},{type:"separator"},{name:_UNO(".uno:ChangesMenu","text"),
id:"changesmenu",type:"menu",menu:[{uno:".uno:TrackChanges"},{uno:".uno:ShowTrackedChanges"},{
type:"separator"},{uno:".uno:AcceptTrackedChanges"},{uno:".uno:AcceptTrackedChange"},{
uno:".uno:AcceptTrackedChangeToNext"},{type:"action",id:"acceptalltrackedchanges",
uno:".uno:AcceptAllTrackedChanges"},{uno:".uno:RejectTrackedChange"},{
uno:".uno:RejectTrackedChangeToNext"},{type:"action",id:"rejectalltrackedchanges",
uno:".uno:RejectAllTrackedChanges"},{uno:".uno:ReinstateTrackedChange"},{
uno:".uno:PreviousTrackedChange"},{uno:".uno:NextTrackedChange"}]},{type:"separator"},{name:_UNO(
".uno:GotoPage","text"),uno:".uno:GotoPage"}]},{name:_UNO(".uno:ViewMenu","text"),id:"view",
type:"menu",menu:(window.mode.isTablet()?[{name:_("Reset zoom"),id:"zoomreset",type:"action"}]:[{
name:_UNO(".uno:FullScreen","text"),id:"fullscreen",type:"action"},{type:"separator"},{name:_UNO(
".uno:ZoomPlus","text"),id:"zoomin",type:"action"},{name:_UNO(".uno:ZoomMinus","text"),id:"zoomout",
type:"action"},{name:_("Reset zoom"),id:"zoomreset",type:"action"}]).concat([{type:"separator"},{
name:_("Toggle UI Mode"),id:"toggleuimode",type:"action"},{name:_("Show Ruler"),id:"showruler",
type:"action"},{name:_("Show Status Bar"),id:"showstatusbar",type:"action"},{name:_("Hide Menu Bar"
),id:"togglemenubar",type:"action"},{name:_("Dark Mode"),id:"toggledarktheme",type:"action"},{
name:_("Invert Background"),id:"invertbackground",type:"action"},{
uno:".uno:SidebarDeck.PropertyDeck",id:"view-sidebar-property-deck",name:_UNO(".uno:Sidebar")},{
uno:".uno:SidebarDeck.StyleListDeck",name:_("Style list")},{uno:".uno:Navigator",id:"navigator"},{
type:"separator"},{name:_UNO(".uno:ShowAnnotations","text"),id:"showannotations",type:"action"},{
name:_UNO(".uno:ShowResolvedAnnotations","text"),id:"showresolved",type:"action"},{
uno:".uno:ControlCodes"}])},{name:_UNO(".uno:InsertMenu","text"),id:"insert",type:"menu",menu:[{
name:_("Local Image..."),id:"insertgraphic",type:"action"},{name:_UNO(".uno:InsertGraphic","text"),
id:"insertgraphicremote",type:"action"},{name:_UNO(".uno:InsertAnnotation","text"),
id:"insertcomment",type:"action"},{uno:".uno:InsertObjectChart"},{name:_UNO(
".uno:FontworkGalleryFloater"),uno:".uno:FontworkGalleryFloater",id:"fontworkgalleryfloater"},{
name:_UNO(".uno:DrawText"),uno:".uno:DrawText"},{name:_UNO(".uno:InsertFrame","text"),
uno:".uno:InsertFrame"},{name:_UNO(".uno:VerticalText"),uno:".uno:VerticalText"},{type:"separator"},
{uno:".uno:InsertSection",id:"insertsection"},{uno:".uno:PageNumberWizard",id:"pagenumberwizard"},{
name:_UNO(".uno:InsertFieldCtrl","text"),type:"menu",menu:[{uno:".uno:InsertPageNumberField"},{
uno:".uno:InsertPageCountField"},{uno:".uno:InsertDateField"},{uno:".uno:InsertTimeField"},{
uno:".uno:InsertTitleField"},{uno:".uno:InsertAuthorField"},{uno:".uno:InsertTopicField"},{
type:"separator"},{uno:".uno:InsertField"}]},{name:_UNO(".uno:InsertHeaderFooterMenu","text"),
type:"menu",menu:[{name:_UNO(".uno:InsertPageHeader","text"),type:"menu",menu:[{name:_("All"),
disabled:true,id:"insertheader",tag:"_ALL_",uno:".uno:InsertPageHeader?"}]},{name:_UNO(
".uno:InsertPageFooter","text"),type:"menu",menu:[{name:_("All"),disabled:true,id:"insertfooter",
tag:"_ALL_",uno:".uno:InsertPageFooter?"}]}]},{name:_UNO(".uno:InsertFootnote","text"),
uno:".uno:InsertFootnote"},{name:_UNO(".uno:InsertEndnote","text"),uno:".uno:InsertEndnote"},{
type:"separator"},{uno:".uno:InsertPagebreak"},{uno:".uno:InsertBreak"},{name:_UNO(
".uno:InsertColumnBreak","spreadsheet"),uno:".uno:InsertColumnBreak"},{type:"separator"},{name:_UNO(
".uno:HyperlinkDialog"),id:"inserthyperlink",type:"action"},{name:_("Smart Picker"),id:"remotelink",
type:"action"},{name:_("AI Assistant"),id:"remoteaicontent",type:"action"},{type:"separator"},{
uno:".uno:InsertQrCode"},{uno:".uno:InsertSymbol"},{uno:".uno:InsertObjectStarMath"},{name:_UNO(
".uno:FormattingMarkMenu","text"),type:"menu",menu:[{uno:".uno:InsertNonBreakingSpace"},{
uno:".uno:InsertHardHyphen"},{uno:".uno:InsertSoftHyphen"},{uno:".uno:InsertZWSP"},{
uno:".uno:InsertWJ"},{uno:".uno:InsertLRM"},{uno:".uno:InsertRLM"}]}]},{name:_UNO(".uno:FormatMenu",
"text"),id:"format",type:"menu",menu:[{name:_UNO(".uno:FormatTextMenu","text"),type:"menu",menu:[{
name:_UNO(".uno:Bold","text"),uno:".uno:Bold"},{name:_UNO(".uno:Italic","text"),uno:".uno:Italic"},{
name:_UNO(".uno:Underline","text"),uno:".uno:Underline"},{name:_UNO(".uno:UnderlineDouble","text"),
uno:".uno:UnderlineDouble"},{name:_UNO(".uno:Strikeout","text"),uno:".uno:Strikeout"},{
uno:".uno:Overline"},{type:"separator"},{name:_UNO(".uno:SuperScript","text"),uno:".uno:SuperScript"
},{name:_UNO(".uno:SubScript","text"),uno:".uno:SubScript"},{type:"separator"},{uno:".uno:Shadowed"}
,{uno:".uno:OutlineFont"},{type:"separator"},{uno:".uno:Grow"},{uno:".uno:Shrink"},{type:"separator"
},{uno:".uno:ChangeCaseToUpper"},{uno:".uno:ChangeCaseToLower"},{uno:".uno:ChangeCaseRotateCase"},{
type:"separator"},{uno:".uno:ChangeCaseToSentenceCase"},{uno:".uno:ChangeCaseToTitleCase"},{
uno:".uno:ChangeCaseToToggleCase"},{type:"separator"},{uno:".uno:SmallCaps"}]},{name:_(
"Text orientation"),type:"menu",menu:[{uno:".uno:ParaLeftToRight"},{uno:".uno:ParaRightToLeft"}]},{
name:_UNO(".uno:FormatSpacingMenu","text"),type:"menu",menu:[{uno:".uno:SpacePara1"},{
uno:".uno:SpacePara15"},{uno:".uno:SpacePara2"},{type:"separator"},{uno:".uno:ParaspaceIncrease"},{
uno:".uno:ParaspaceDecrease"},{type:"separator"},{uno:".uno:IncrementIndent"},{
uno:".uno:DecrementIndent"}]},{name:_UNO(".uno:TextAlign","text"),type:"menu",menu:[{name:_UNO(
".uno:CommonAlignLeft","text"),uno:".uno:CommonAlignLeft"},{name:_UNO(
".uno:CommonAlignHorizontalCenter","text"),uno:".uno:CommonAlignHorizontalCenter"},{name:_UNO(
".uno:CommonAlignRight","text"),uno:".uno:CommonAlignRight"},{name:_UNO(".uno:CommonAlignJustified",
"text"),uno:".uno:CommonAlignJustified"},{type:"separator"},{uno:".uno:CommonAlignTop"},{
uno:".uno:CommonAlignVerticalCenter"},{uno:".uno:CommonAlignBottom"}]},{name:_UNO(
".uno:FormatBulletsMenu","text"),type:"menu",menu:[{uno:".uno:DefaultBullet"},{
uno:".uno:DefaultNumbering"},{type:"separator"},{uno:".uno:DecrementLevel"},{
uno:".uno:IncrementLevel"},{uno:".uno:DecrementSubLevels"},{uno:".uno:IncrementSubLevels"},{
type:"separator"},{uno:".uno:MoveDown"},{uno:".uno:MoveUp"},{uno:".uno:MoveDownSubItems"},{
uno:".uno:MoveUpSubItems"},{type:"separator"},{uno:".uno:InsertNeutralParagraph"},{
uno:".uno:NumberingStart"},{uno:".uno:RemoveBullets"},{type:"separator"},{
uno:".uno:JumpDownThisLevel"},{uno:".uno:JumpUpThisLevel"},{uno:".uno:ContinueNumbering"}]},{
type:"separator"},{uno:".uno:FormatPaintbrush"},{uno:".uno:ResetAttributes"},{type:"separator"},{
uno:".uno:FontDialog"},{uno:".uno:ParagraphDialog"},{uno:".uno:SidebarDeck.StyleListDeck"},{
uno:".uno:OutlineBullet"},{uno:".uno:ThemeDialog"},{type:"separator"},{uno:".uno:PageDialog"},{
uno:".uno:TitlePageDialog"},{uno:".uno:FormatColumns"},{uno:".uno:Watermark"},{uno:".uno:EditRegion"
},{type:"separator"},{uno:".uno:TransformDialog"},{uno:".uno:FormatLine"},{uno:".uno:FormatArea"},{
uno:".uno:NameGroup"},{uno:".uno:ObjectTitleDescription"},{type:"separator"},{uno:".uno:ChangeFont"}
,{uno:".uno:ChangeFontSize"},{uno:".uno:ChangeDistance"},{uno:".uno:ChangeAlignment"}]},{name:_(
"References"),id:"references",type:"menu",menu:[{name:_UNO(".uno:IndexesMenu","text"),
uno:".uno:InsertMultiIndex"},{uno:".uno:InsertIndexesEntry"},{name:_("Update Index"),
uno:".uno:UpdateCurIndex"},{type:"separator"},{uno:".uno:InsertFootnote"},{uno:".uno:InsertEndnote"}
,{uno:".uno:FootnoteDialog"},{type:"separator"},{uno:".uno:InsertBookmark"},{
uno:".uno:InsertReferenceField"},{id:"zoteroseparator",type:"separator",hidden:!window.zoteroEnabled
},{name:_("Add Citation"),id:"zoteroaddeditcitation",type:"action",hidden:!window.zoteroEnabled},{
name:_("Add Citation Note"),id:"zoteroaddnote",type:"action",hidden:!window.zoteroEnabled},{name:_(
"Add Bibliography"),id:"zoteroaddeditbibliography",type:"action",hidden:!window.zoteroEnabled},{
id:"zoteroseparator2",type:"separator",hidden:!window.zoteroEnabled},{name:_("Refresh Citations"),
id:"zoterorefresh",type:"action",hidden:!window.zoteroEnabled},{name:_("Unlink Citations"),
id:"zoterounlink",type:"action",hidden:!window.zoteroEnabled},{name:_("Citation Preferences"),
id:"zoterosetdocprefs",type:"action",iosapp:false,hidden:!window.zoteroEnabled}]},{name:_UNO(
".uno:TableMenu","text"),type:"menu",id:"table",menu:[{uno:".uno:InsertTable"},{name:_UNO(
".uno:TableInsertMenu","text"),type:"menu",menu:[{uno:".uno:InsertRowsBefore"},{
uno:".uno:InsertRowsAfter"},{type:"separator"},{uno:".uno:InsertColumnsBefore"},{
uno:".uno:InsertColumnsAfter"}]},{name:_UNO(".uno:TableDeleteMenu","text"),type:"menu",menu:[{
uno:".uno:DeleteRows"},{uno:".uno:DeleteColumns"},{uno:".uno:DeleteTable"}]},{name:_UNO(
".uno:TableSelectMenu","text"),type:"menu",menu:[{uno:".uno:SelectTable"},{uno:".uno:EntireRow"},{
uno:".uno:EntireColumn"},{uno:".uno:EntireCell"}]},{uno:".uno:SplitCell"},{uno:".uno:MergeCells"},{
type:"separator"},{uno:".uno:Protect"},{uno:".uno:UnsetCellsReadOnly"},{type:"separator"},{
uno:".uno:TableDialog"}]},{name:_UNO(".uno:FormatFormMenu","text"),id:"form",type:"menu",menu:[{
name:_("Insert Rich Text"),uno:".uno:InsertContentControl"},{name:_("Insert Checkbox"),
uno:".uno:InsertCheckboxContentControl"},{name:_("Insert Dropdown"),
uno:".uno:InsertDropdownContentControl"},{name:_("Insert Picture"),
uno:".uno:InsertPictureContentControl"},{name:_("Insert Date"),uno:".uno:InsertDateContentControl"},
{name:_("Properties"),uno:".uno:ContentControlProperties"}]},{name:_UNO(".uno:ToolsMenu","text"),
id:"tools",type:"menu",menu:[{uno:".uno:SpellingAndGrammarDialog"},{uno:".uno:SpellOnline"},
window.deeplEnabled?{uno:".uno:Translate"}:{},{uno:".uno:ThesaurusDialog"},{name:_UNO(
".uno:LanguageMenu"),type:"menu",menu:[{name:_UNO(".uno:SetLanguageSelectionMenu","text"),
type:"menu",menu:[{name:_("None (Do not check spelling)"),id:"noneselection",
uno:".uno:LanguageStatus?Language:string=Current_LANGUAGE_NONE"}]},{name:_UNO(
".uno:SetLanguageParagraphMenu","text"),type:"menu",menu:[{name:_("None (Do not check spelling)"),
id:"noneparagraph",uno:".uno:LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE"}]},{name:_UNO(
".uno:SetLanguageAllTextMenu","text"),type:"menu",menu:[{name:_("None (Do not check spelling)"),
id:"nonelanguage",uno:".uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE"}]}]},{
uno:".uno:WordCountDialog"},window.enableAccessibility?{name:_("Screen Reading"),
id:"togglea11ystate",type:"action"}:{},{uno:".uno:AccessibilityCheck"},{type:"separator"},{
name:_UNO(".uno:AutoFormatMenu","text"),type:"menu",menu:[{uno:".uno:OnlineAutoFormat"}]},{
type:"separator"},{uno:".uno:ChapterNumberingDialog"},{uno:".uno:LineNumberingDialog"},{
uno:".uno:FootnoteDialog"},{type:"separator"},{name:_UNO(".uno:RunMacro"),id:"runmacro",
uno:".uno:RunMacro"}]},{name:_UNO(".uno:HelpMenu","text"),id:"help",type:"menu",menu:[{name:_(
"Forum"),id:"forum",type:"action"},{name:_("Online Help"),id:"online-help",type:"action",
iosapp:false},{name:_("Keyboard shortcuts"),id:"keyboard-shortcuts",type:"action",iosapp:false},{
name:_("Report an issue"),id:"report-an-issue",type:"action",iosapp:false},{name:_("Latest Updates"
),id:"latestupdates",type:"action",iosapp:false},{name:_("Send Feedback"),id:"feedback",
type:"action",mobileapp:false},{name:_("Server audit"),id:"serveraudit",type:"action",
mobileapp:false},{name:_("About"),id:"about",type:"action"}]},{name:_("Last modification"),
id:"last-mod",type:"action",tablet:false}],presentation:[{name:_UNO(".uno:PickList","presentation"),
id:"file",type:"menu",menu:[{name:_UNO(".uno:Save","presentation"),id:"save",type:"action"},{
name:_UNO(".uno:SaveAs","presentation"),id:"saveas",type:window.prefs.get("saveAsMode"
)==="group"?"menu":"action",menu:[{name:_("ODF presentation (.odp)"),id:"saveas-odp",type:"action"},
{name:_("PowerPoint 2003 Presentation (.ppt)"),id:"saveas-ppt",type:"action"},{name:_(
"PowerPoint Presentation (.pptx)"),id:"saveas-pptx",type:"action"}]},{name:_("Export as"),
id:"exportas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),id:"exportas-pdf",type:"action"}]},{
name:_("Save Comments"),id:"savecomments",type:"action"},{name:_("Share..."),id:"shareas",
type:"action"},{name:_("See revision history"),id:"rev-history",type:"action"},{
name:!window.ThisIsAMobileApp?_("Download as"):_("Export as"),id:"downloadas",type:"menu",menu:[{
name:_("PDF Document (.pdf)"),id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",
type:"action"},{name:_("PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_(
"ODF presentation (.odp)"),id:"downloadas-odp",type:"action"},{name:_(
"PowerPoint 2003 Presentation (.ppt)"),id:"downloadas-ppt",type:"action"},{name:_(
"PowerPoint Presentation (.pptx)"),id:"downloadas-pptx",type:"action"},{name:_(
"HTML Document (.html)"),id:"downloadas-html",type:"action"},{name:_("Shockwave Flash (.swf)"),
id:"downloadas-swf",type:"action"},{name:_("Scalable Vector Graphics (.svg)"),id:"downloadas-svg",
type:"action"},{name:_("Current slide as Bitmap (.bmp)"),id:"downloadas-bmp",type:"action"},{name:_(
"Current slide as Graphics Interchange Format (.gif)"),id:"downloadas-gif",type:"action"},{name:_(
"Current slide as Portable Network Graphics (.png)"),id:"downloadas-png",type:"action"},{name:_(
"Current slide as Tag Image File Format (.tiff)"),id:"downloadas-tiff",type:"action"}]},{name:_UNO(
".uno:SetDocumentProperties","presentation"),uno:".uno:SetDocumentProperties",id:"properties"},{
name:_UNO(".uno:Signature","presentation"),uno:".uno:Signature",id:"signature"},{name:_("Options"),
id:"settings-dialog",type:"action",mobileapp:false},{type:"separator"},{name:"Печать",id:"print",type:"menu",menu:[{name:_("Full Page Slides"),id:"print",type:"action"},{
name:_("Notes Pages"),id:"print-notespages",type:"action"}]},{name:_("Close document"),
id:"closedocument",type:"action"}]},{name:_UNO(".uno:EditMenu","presentation"),id:"editmenu",
type:"menu",menu:[{name:_UNO(".uno:Undo","presentation"),uno:".uno:Undo"},{name:_UNO(".uno:Redo",
"presentation"),uno:".uno:Redo"},{name:_("Repair"),id:"repair",type:"action"},{type:"separator"},{
name:_UNO(".uno:Cut","presentation"),uno:".uno:Cut"},{name:_UNO(".uno:Copy","presentation"),
uno:".uno:Copy"},{name:_UNO(".uno:Paste","presentation"),uno:".uno:Paste"},{name:_UNO(
".uno:PasteSpecial","presentation"),uno:".uno:PasteSpecial"},{name:_UNO(".uno:SelectAll",
"presentation"),uno:".uno:SelectAll"},{type:"separator"},{uno:".uno:SearchDialog"}]},{name:_UNO(
".uno:ViewMenu","presentation"),id:"view",type:"menu",menu:(window.mode.isTablet()?[{name:_(
"Reset zoom"),id:"zoomreset",type:"action"}]:[{name:_UNO(".uno:FullScreen","presentation"),
id:"fullscreen",type:"action"},{type:"separator"},{name:_UNO(".uno:ZoomPlus","presentation"),
id:"zoomin",type:"action"},{name:_UNO(".uno:ZoomMinus","presentation"),id:"zoomout",type:"action"},{
name:_("Reset zoom"),id:"zoomreset",type:"action"}]).concat([{type:"separator"},{
uno:".uno:GridVisible",name:_UNO(".uno:GridVisible")},{uno:".uno:GridUse",name:_UNO(".uno:GridUse")}
,{type:"separator"},{name:_("Toggle UI Mode"),id:"toggleuimode",type:"action"},{name:_("Show Ruler"
),id:"showruler",type:"action"},{name:_("Show Status Bar"),id:"showstatusbar",type:"action"},{
name:_("Notes View"),id:"notesmode",type:"action"},{name:_("Hide Menu Bar"),id:"togglemenubar",
type:"action"},{name:_("Dark Mode"),id:"toggledarktheme",type:"action"},{name:_("Invert Background"
),id:"invertbackground",type:"action"},{name:_("Master View"),uno:".uno:SlideMasterPage"},{
uno:".uno:SidebarDeck.PropertyDeck",name:_UNO(".uno:Sidebar")},{uno:".uno:Navigator",id:"navigator"}
,{type:"separator"},{uno:".uno:ModifyPage"},{uno:".uno:CustomAnimation"}])},{name:_UNO(
".uno:InsertMenu","presentation"),id:"insert",type:"menu",menu:[{name:_("Local Image..."),
id:"insertgraphic",type:"action"},{name:_UNO(".uno:InsertGraphic","presentation"),
id:"insertgraphicremote",type:"action"},{name:_("Local Multimedia..."),id:"insertmultimedia",
type:"action"},{name:_UNO(".uno:SelectBackground","presentation"),id:"selectbackground",
type:"action"},{name:_UNO(".uno:InsertAnnotation","presentation"),id:"insertcomment",type:"action"},
{uno:".uno:InsertObjectChart"},{name:_UNO(".uno:FontworkGalleryFloater"),
uno:".uno:FontworkGalleryFloater",id:"fontworkgalleryfloater"},{name:_UNO(".uno:Text","presentation"
),id:"inserttextbox",type:"action"},{name:_UNO(".uno:VerticalText"),uno:".uno:VerticalText"},{
type:"separator"},{name:_UNO(".uno:HyperlinkDialog"),id:"inserthyperlink",type:"action"},{name:_(
"Smart Picker"),id:"remotelink",type:"action"},{name:_("AI Assistant"),id:"remoteaicontent",
type:"action"},{type:"separator"},{uno:".uno:InsertSymbol"},{type:"separator"},{
uno:".uno:HeaderAndFooter"},{type:"separator"},{name:_UNO(".uno:InsertField","text"),
id:"insertfield",type:"menu",menu:[{uno:".uno:InsertDateFieldFix"},{uno:".uno:InsertDateFieldVar"},{
uno:".uno:InsertTimeFieldFix"},{uno:".uno:InsertTimeFieldVar"},{type:"separator"},{name:_UNO(
".uno:InsertSlideField","presentation"),uno:".uno:InsertPageField"},{name:_UNO(
".uno:InsertSlideTitleField","presentation"),uno:".uno:InsertPageTitleField"},{name:_UNO(
".uno:InsertSlidesField","presentation"),uno:".uno:InsertPagesField"}]}]},{name:_UNO(
".uno:FormatMenu","presentation"),id:"format",type:"menu",menu:[{uno:".uno:FontDialog"},{
uno:".uno:ParagraphDialog"},{name:_UNO(".uno:SlideSetup","presentation"),uno:".uno:PageSetup"},{
type:"separator"},{uno:".uno:TransformDialog"},{uno:".uno:FormatLine"},{uno:".uno:FormatArea"},{
uno:".uno:NameGroup"},{uno:".uno:ObjectTitleDescription"},{type:"separator"},{
uno:".uno:OutlineBullet"},{uno:".uno:ThemeDialog"}]},{name:_UNO(".uno:TableMenu","text"),id:"table",
type:"menu",menu:[{name:_UNO(".uno:InsertTable","text"),uno:".uno:InsertTable"},{name:_UNO(
".uno:TableInsertMenu","text"),type:"menu",menu:[{uno:".uno:InsertRowsBefore"},{
uno:".uno:InsertRowsAfter"},{type:"separator"},{uno:".uno:InsertColumnsBefore"},{
uno:".uno:InsertColumnsAfter"}]},{name:_UNO(".uno:TableDeleteMenu","text"),type:"menu",menu:[{
uno:".uno:DeleteRows"},{uno:".uno:DeleteColumns"},{uno:".uno:DeleteTable"}]},{name:_UNO(
".uno:TableSelectMenu","text"),type:"menu",menu:[{uno:".uno:SelectTable"},{uno:".uno:EntireRow"},{
uno:".uno:EntireColumn"}]},{uno:".uno:MergeCells"},{uno:".uno:TableDialog"}]},{name:_UNO(
".uno:SlideMenu","presentation"),id:"slide",type:"menu",menu:[{name:_UNO(".uno:InsertSlide",
"presentation"),id:"insertpage",type:"action"},{name:_UNO(".uno:DuplicateSlide","presentation"),
id:"duplicatepage",type:"action"},{name:_UNO(".uno:DeleteSlide","presentation"),id:"deletepage",
type:"action"},{name:_UNO(".uno:ShowSlide","presentation"),id:"showslide",type:"action"},{name:_UNO(
".uno:HideSlide","presentation"),id:"hideslide",type:"action"},{type:"separator"},{name:_UNO(
".uno:GotoSlide","presentation"),uno:".uno:GotoPage"},{type:"separator",
id:"fullscreen-presentation-separator"},{name:_("Fullscreen presentation"),
id:"fullscreen-presentation",type:"action"},{name:_("Present current slide"),
id:"presentation-currentslide",type:"action"},{name:_("Present in new window"),
id:"present-in-window",type:"action"},{name:_("Presenter Console"),id:"presentation-in-console",
type:"action"}]},{name:_UNO(".uno:ToolsMenu","presentation"),id:"tools",type:"menu",menu:[{
uno:".uno:SpellDialog"},{uno:".uno:SpellOnline"},{name:_UNO(".uno:LanguageMenu"),type:"menu",menu:[{
name:_("None (Do not check spelling)"),id:"nonelanguage",
uno:".uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE"}]},{type:"separator"},{name:_UNO(
".uno:RunMacro"),id:"runmacro",uno:".uno:RunMacro"}]},{name:_UNO(".uno:HelpMenu","presentation"),
id:"help",type:"menu",menu:[{name:_("Online Help"),id:"online-help",type:"action",iosapp:false},{
name:_("Keyboard shortcuts"),id:"keyboard-shortcuts",type:"action",iosapp:false},{name:_(
"Report an issue"),id:"report-an-issue",type:"action",iosapp:false},{name:_("Latest Updates"),
id:"latestupdates",type:"action",iosapp:false},{name:_("Send Feedback"),id:"feedback",type:"action",
mobileapp:false},{name:_("Server audit"),id:"serveraudit",type:"action",mobileapp:false},{name:_(
"About"),id:"about",type:"action"}]},{name:_("Last modification"),id:"last-mod",type:"action",
tablet:false}],drawing:[{name:_UNO(".uno:PickList","presentation"),id:"file",type:"menu",menu:[{
name:_UNO(".uno:Save","presentation"),id:"save",type:"action"},{name:_UNO(".uno:SaveAs",
"presentation"),id:"saveas",type:"action"},{name:_("Export as"),id:"exportas",type:"menu",menu:[{
name:_("PDF Document (.pdf)"),id:"exportas-pdf",type:"action"}]},{name:_("Save Comments"),
id:"savecomments",type:"action"},{name:_("Share..."),id:"shareas",type:"action"},{name:_UNO(
".uno:Print","presentation"),id:"print",type:"action"},{name:_("See revision history"),
id:"rev-history",type:"action"},{name:!window.ThisIsAMobileApp?_("Download as"):_("Export as"),
id:"downloadas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",type:"action"},{name:_(
"PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_("ODF Drawing (.odg)"),
id:"downloadas-odg",type:"action"}]},{name:_UNO(".uno:SetDocumentProperties","presentation"),
uno:".uno:SetDocumentProperties",id:"properties"},{name:_UNO(".uno:Signature","presentation"),
uno:".uno:Signature",id:"signature"},{name:_("Options"),id:"settings-dialog",type:"action",
mobileapp:false},{type:"separator"},{name:_("Close document"),id:"closedocument",type:"action"}]},{
name:_UNO(".uno:EditMenu","presentation"),id:"editmenu",type:"menu",menu:[{name:_UNO(".uno:Undo",
"presentation"),uno:".uno:Undo"},{name:_UNO(".uno:Redo","presentation"),uno:".uno:Redo"},{name:_(
"Repair"),id:"repair",type:"action"},{type:"separator"},{name:_UNO(".uno:Cut","presentation"),
uno:".uno:Cut"},{name:_UNO(".uno:Copy","presentation"),uno:".uno:Copy"},{name:_UNO(".uno:Paste",
"presentation"),uno:".uno:Paste"},{name:_UNO(".uno:PasteSpecial","presentation"),
uno:".uno:PasteSpecial"},{name:_UNO(".uno:SelectAll","presentation"),uno:".uno:SelectAll"},{
type:"separator"},{uno:".uno:SearchDialog"}]},{name:_UNO(".uno:ViewMenu","presentation"),id:"view",
type:"menu",menu:(window.mode.isTablet()?[{name:_("Reset zoom"),id:"zoomreset",type:"action"}]:[{
name:_UNO(".uno:FullScreen","presentation"),id:"fullscreen",type:"action"},{type:"separator"},{
name:_UNO(".uno:ZoomPlus","presentation"),id:"zoomin",type:"action"},{name:_UNO(".uno:ZoomMinus",
"presentation"),id:"zoomout",type:"action"},{name:_("Reset zoom"),id:"zoomreset",type:"action"}]
).concat([{type:"separator"},{uno:".uno:GridVisible",name:_UNO(".uno:GridVisible")},{
uno:".uno:GridUse",name:_UNO(".uno:GridUse")},{type:"separator"},{name:_("Toggle UI Mode"),
id:"toggleuimode",type:"action"},{name:_("Dark Mode"),id:"toggledarktheme",type:"action"},{name:_(
"Invert Background"),id:"invertbackground",type:"action"},{uno:".uno:SidebarDeck.PropertyDeck",
name:_UNO(".uno:Sidebar")},{uno:".uno:Navigator",id:"navigator"},{name:_("Show Status Bar"),
id:"showstatusbar",type:"action"},{name:_("Hide Menu Bar"),id:"togglemenubar",type:"action"}])},{
name:_UNO(".uno:InsertMenu","presentation"),id:"insert",type:"menu",menu:[{name:_("Local Image..."),
id:"insertgraphic",type:"action"},{name:_UNO(".uno:InsertGraphic","presentation"),
id:"insertgraphicremote",type:"action"},{name:_UNO(".uno:SelectBackground","presentation"),
id:"selectbackground",type:"action"},{name:_UNO(".uno:InsertAnnotation","presentation"),
id:"insertcomment",type:"action"},{uno:".uno:InsertObjectChart"},{type:"separator"},{name:_UNO(
".uno:HyperlinkDialog"),id:"inserthyperlink",type:"action"},{name:_("Smart Picker"),id:"remotelink",
type:"action"},{name:_("AI Assistant"),id:"remoteaicontent",type:"action"},{type:"separator"},{
uno:".uno:InsertSymbol"},{type:"separator"},{name:_UNO(".uno:InsertField","text"),id:"insertfield",
type:"menu",menu:[{name:_UNO(".uno:InsertDateFieldFix","presentation"),uno:".uno:InsertDateFieldFix"
},{name:_UNO(".uno:InsertDateFieldVar","presentation"),uno:".uno:InsertDateFieldVar"},{name:_UNO(
".uno:InsertTimeFieldFix","presentation"),uno:".uno:InsertTimeFieldFix"},{name:_UNO(
".uno:InsertTimeFieldVar","presentation"),uno:".uno:InsertTimeFieldVar"},{type:"separator"},{
name:_UNO(".uno:InsertPageField","presentation"),uno:".uno:InsertPageField"},{name:_UNO(
".uno:InsertPageTitleField","presentation"),uno:".uno:InsertPageTitleField"},{name:_UNO(
".uno:InsertPagesField","presentation"),uno:".uno:InsertPagesField"}]},{name:_UNO(
".uno:InsertSignatureLine"),id:"insert-signatureline",type:"action"}]},{name:_UNO(".uno:FormatMenu",
"presentation"),id:"format",type:"menu",menu:[{uno:".uno:FontDialog"},{uno:".uno:ParagraphDialog"},{
name:_UNO(".uno:PageSetup","presentation"),uno:".uno:PageSetup"},{type:"separator"},{
uno:".uno:TransformDialog"},{uno:".uno:FormatLine"},{uno:".uno:FormatArea"},{uno:".uno:NameGroup"},{
uno:".uno:ObjectTitleDescription"},{type:"separator"},{uno:".uno:OutlineBullet"},{
uno:".uno:ThemeDialog"}]},{name:_UNO(".uno:TableMenu","text"),id:"table",type:"menu",menu:[{
name:_UNO(".uno:InsertTable","text"),uno:".uno:InsertTable"},{name:_UNO(".uno:TableInsertMenu",
"text"),type:"menu",menu:[{name:_UNO(".uno:InsertRowsBefore","presentation"),
uno:".uno:InsertRowsBefore"},{name:_UNO(".uno:InsertRowsAfter","presentation"),
uno:".uno:InsertRowsAfter"},{type:"separator"},{name:_UNO(".uno:InsertColumnsBefore","presentation"
),uno:".uno:InsertColumnsBefore"},{name:_UNO(".uno:InsertColumnsAfter","presentation"),
uno:".uno:InsertColumnsAfter"}]},{name:_UNO(".uno:TableDeleteMenu","text"),type:"menu",menu:[{
name:_UNO(".uno:DeleteRows","presentation"),uno:".uno:DeleteRows"},{name:_UNO(".uno:DeleteColumns",
"presentation"),uno:".uno:DeleteColumns"},{name:_UNO(".uno:DeleteTable","presentation"),
uno:".uno:DeleteTable"}]},{name:_UNO(".uno:TableSelectMenu","text"),type:"menu",menu:[{name:_UNO(
".uno:SelectTable","presentation"),uno:".uno:SelectTable"},{name:_UNO(".uno:EntireRow",
"presentation"),uno:".uno:EntireRow"},{name:_UNO(".uno:EntireColumn","presentation"),
uno:".uno:EntireColumn"}]},{name:_UNO(".uno:MergeCells","presentation"),uno:".uno:MergeCells"},{
name:_UNO(".uno:TableDialog","presentation"),uno:".uno:TableDialog"}]},{name:_UNO(".uno:PageMenu",
"presentation"),type:"menu",menu:[{name:_UNO(".uno:InsertPage","presentation"),id:"insertpage",
type:"action"},{name:_UNO(".uno:DuplicatePage","presentation"),id:"duplicatepage",type:"action"},{
name:_UNO(".uno:DeletePage","presentation"),id:"deletepage",type:"action"},{name:_UNO(
".uno:GotoPage","presentation"),uno:".uno:GotoPage"}]},{name:_UNO(".uno:ToolsMenu","presentation"),
id:"tools",type:"menu",menu:[{uno:".uno:SpellDialog"},{uno:".uno:SpellOnline"},{name:_UNO(
".uno:LanguageMenu"),type:"menu",menu:[{name:_("None (Do not check spelling)"),id:"nonelanguage",
uno:".uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE"}]}]},{name:_UNO(".uno:HelpMenu",
"presentation"),id:"help",type:"menu",menu:[{name:_("Online Help"),id:"online-help",type:"action",
iosapp:false},{name:_("Keyboard shortcuts"),id:"keyboard-shortcuts",type:"action",iosapp:false},{
name:_("Report an issue"),id:"report-an-issue",type:"action",iosapp:false},{name:_("Latest Updates"
),id:"latestupdates",type:"action",iosapp:false},{name:_("Send Feedback"),id:"feedback",
type:"action",mobileapp:false},{name:_("Server audit"),id:"serveraudit",type:"action",
mobileapp:false},{name:_("About"),id:"about",type:"action"}]},{name:_("Last modification"),
id:"last-mod",type:"action",tablet:false}],spreadsheet:[{name:_UNO(".uno:PickList","spreadsheet"),
id:"file",type:"menu",menu:[{name:_UNO(".uno:Save","spreadsheet"),id:"save",type:"action"},{
name:_UNO(".uno:SaveAs","spreadsheet"),id:"saveas",type:window.prefs.get("saveAsMode"
)==="group"?"menu":"action",menu:[{name:_("ODF spreadsheet (.ods)"),id:"saveas-ods",type:"action"},{
name:_("Excel 2003 Spreadsheet (.xls)"),id:"saveas-xls",type:"action"},{name:_(
"Excel Spreadsheet (.xlsx)"),id:"saveas-xlsx",type:"action"}]},{name:_("Export as"),id:"exportas",
type:"menu",menu:[{name:_("PDF Document (.pdf)"),id:"exportas-pdf",type:"action"}]},{name:_(
"Share..."),id:"shareas",type:"action"},{name:_("See revision history"),id:"rev-history",
type:"action"},{name:!window.ThisIsAMobileApp?_("Download as"):_("Export as"),id:"downloadas",
type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",type:"action"},{name:_(
"PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_("ODF spreadsheet (.ods)"),
id:"downloadas-ods",type:"action"},{name:_("Excel 2003 Spreadsheet (.xls)"),id:"downloadas-xls",
type:"action"},{name:_("Excel Spreadsheet (.xlsx)"),id:"downloadas-xlsx",type:"action"},{name:_(
"CSV file (.csv)"),id:"downloadas-csv",type:"action"},{name:_("HTML file (.html)"),
id:"downloadas-html",type:"action"}]},{name:_UNO(".uno:SetDocumentProperties","spreadsheet"),
uno:".uno:SetDocumentProperties",id:"properties"},{name:_UNO(".uno:Signature","spreadsheet"),
uno:".uno:Signature",id:"signature"},{name:_("Options"),id:"settings-dialog",type:"action",
mobileapp:false},{type:"separator"},{name:"Печать",id:"print",type:"menu",
menu:[{name:_("Active sheet"),id:"print-active-sheet",type:"action"},{name:_("All Sheets"),
id:"print-all-sheets",type:"action"}]},{name:_("Close document"),id:"closedocument",type:"action"}]}
,{name:_UNO(".uno:EditMenu","spreadsheet"),id:"editmenu",type:"menu",menu:[{name:_UNO(".uno:Undo",
"text"),uno:".uno:Undo"},{name:_UNO(".uno:Redo","text"),uno:".uno:Redo"},{name:_("Repair"),
id:"repair",type:"action"},{type:"separator"},{name:_UNO(".uno:Cut","text"),uno:".uno:Cut"},{
name:_UNO(".uno:Copy","text"),uno:".uno:Copy"},{name:_UNO(".uno:Paste","text"),uno:".uno:Paste"},{
name:_UNO(".uno:PasteSpecial","text"),uno:".uno:PasteSpecial"},{name:_UNO(".uno:SelectAll","text"),
uno:".uno:SelectAll"},{type:"separator"},{uno:".uno:SearchDialog"}]},{name:_UNO(".uno:ViewMenu",
"spreadsheet"),id:"view",type:"menu",menu:(window.mode.isTablet()?[{name:_("Reset zoom"),
id:"zoomreset",type:"action"}]:[{name:_UNO(".uno:FullScreen","spreadsheet"),id:"fullscreen",
type:"action"},{type:"separator"},{name:_UNO(".uno:ZoomPlus","text"),id:"zoomin",type:"action"},{
name:_UNO(".uno:ZoomMinus","text"),id:"zoomout",type:"action"},{name:_("Reset zoom"),id:"zoomreset",
type:"action"}]).concat([{type:"separator"},{name:_("Toggle UI Mode"),id:"toggleuimode",
type:"action"},{name:_("Show Status Bar"),id:"showstatusbar",type:"action"},{name:_("Hide Menu Bar"
),id:"togglemenubar",type:"action"},{name:_("Dark Mode"),id:"toggledarktheme",type:"action"},{
name:_("Invert Background"),id:"invertbackground",type:"action"},{
uno:".uno:SidebarDeck.PropertyDeck",name:_UNO(".uno:Sidebar")},{uno:".uno:Navigator",id:"navigator"}
,{uno:".uno:SidebarDeck.StyleListDeck",name:_("Style list")},{type:"separator"},{name:_UNO(
".uno:ToggleSheetGrid","spreadsheet",true),uno:".uno:ToggleSheetGrid",id:"sheetgrid"},{name:_(
"Focus Cell"),type:"action",id:"columnrowhighlight"},{name:_UNO(".uno:FreezePanes","spreadsheet",
true),id:"FreezePanes",uno:".uno:FreezePanes"},{name:_UNO(".uno:FreezeCellsMenu","spreadsheet",true
),id:"FreezeCellsMenu",type:"menu",uno:".uno:FreezeCellsMenu",menu:[{name:_UNO(
".uno:FreezePanesColumn","spreadsheet",true),id:"FreezePanesColumn",uno:".uno:FreezePanesColumn"},{
name:_UNO(".uno:FreezePanesRow","spreadsheet",true),id:"FreezePanesRow",uno:".uno:FreezePanesRow"}]}
])},{name:_UNO(".uno:InsertMenu","spreadsheet"),id:"insert",type:"menu",menu:[{name:_(
"Local Image..."),id:"insertgraphic",type:"action"},{name:_UNO(".uno:InsertGraphic","spreadsheet"),
id:"insertgraphicremote",type:"action"},{name:_UNO(".uno:DataDataPilotRun","spreadsheet"),
uno:".uno:DataDataPilotRun"},{name:_UNO(".uno:InsertSparkline","spreadsheet"),
uno:".uno:InsertSparkline"},{name:_UNO(".uno:InsertAnnotation","spreadsheet"),id:"insertcomment",
type:"action"},{uno:".uno:InsertObjectChart"},{name:_UNO(".uno:FontworkGalleryFloater"),
uno:".uno:FontworkGalleryFloater",id:"fontworkgalleryfloater"},{name:_UNO(".uno:DrawText"),
uno:".uno:DrawText"},{name:_UNO(".uno:VerticalText"),uno:".uno:VerticalText"},{
uno:".uno:FunctionDialog"},{type:"separator"},{name:_UNO(".uno:HyperlinkDialog"),
uno:".uno:HyperlinkDialog"},{name:_("Smart Picker"),id:"remotelink",type:"action"},{name:_(
"AI Assistant"),id:"remoteaicontent",type:"action"},{uno:".uno:InsertSymbol"},{type:"separator"},{
name:_UNO(".uno:InsertField","text"),type:"menu",menu:[{uno:".uno:InsertCurrentDate"},{
uno:".uno:InsertCurrentTime"}]},{uno:".uno:EditHeaderAndFooter"}]},{name:_UNO(".uno:FormatMenu",
"spreadsheet"),id:"format",type:"menu",menu:[{name:_UNO(".uno:FormatTextMenu","spreadsheet"),
type:"menu",menu:[{name:_UNO(".uno:Bold","spreadsheet"),uno:".uno:Bold"},{name:_UNO(".uno:Italic",
"spreadsheet"),uno:".uno:Italic"},{name:_UNO(".uno:Underline","spreadsheet"),uno:".uno:Underline"},{
name:_UNO(".uno:UnderlineDouble","spreadsheet"),uno:".uno:UnderlineDouble"},{name:_UNO(
".uno:Strikeout","spreadsheet"),uno:".uno:Strikeout"},{uno:".uno:Overline"},{type:"separator"},{
name:_UNO(".uno:SuperScript","spreadsheet"),uno:".uno:SuperScript"},{name:_UNO(".uno:SubScript",
"spreadsheet"),uno:".uno:SubScript"},{type:"separator"},{uno:".uno:Shadowed"},{
uno:".uno:OutlineFont"},{type:"separator"},{uno:".uno:WrapText"},{type:"separator"},{
uno:".uno:ChangeCaseToUpper"},{uno:".uno:ChangeCaseToLower"},{uno:".uno:ChangeCaseRotateCase"},{
type:"separator"},{uno:".uno:ChangeCaseToSentenceCase"},{uno:".uno:ChangeCaseToTitleCase"},{
uno:".uno:ChangeCaseToToggleCase"}]},{name:_UNO(".uno:TextAlign","spreadsheet"),type:"menu",menu:[{
uno:".uno:CommonAlignLeft"},{uno:".uno:CommonAlignHorizontalCenter"},{uno:".uno:CommonAlignRight"},{
uno:".uno:CommonAlignJustified"},{type:"separator"},{uno:".uno:CommonAlignTop"},{
uno:".uno:CommonAlignVerticalCenter"},{uno:".uno:CommonAlignBottom"},{type:"separator"},{
uno:".uno:ParaLeftToRight"},{uno:".uno:ParaRightToLeft"}]},{name:_UNO(".uno:NumberFormatMenu",
"spreadsheet"),type:"menu",menu:[{uno:".uno:NumberFormatStandard"},{uno:".uno:NumberFormatDecimal"},
{uno:".uno:NumberFormatPercent"},{uno:".uno:NumberFormatCurrency"},{uno:".uno:NumberFormatDate"},{
uno:".uno:NumberFormatTime"},{uno:".uno:NumberFormatScientific"},{type:"separator"},{
uno:".uno:NumberFormatThousands"}]},{type:"separator"},{uno:".uno:FormatPaintbrush"},{
uno:".uno:ResetAttributes"},{name:_UNO(".uno:PrintRangesMenu","spreadsheet"),type:"menu",menu:[{
uno:".uno:DefinePrintArea"},{uno:".uno:AddPrintArea"},{uno:".uno:EditPrintArea"},{
uno:".uno:DeletePrintArea"}]},{name:_UNO(".uno:FormatSparklineMenu","spreadsheet"),type:"menu",
menu:[{uno:".uno:InsertSparkline"},{uno:".uno:DeleteSparkline"},{uno:".uno:DeleteSparklineGroup"},{
uno:".uno:EditSparklineGroup"},{uno:".uno:EditSparkline"},{uno:".uno:GroupSparklines"},{
uno:".uno:UngroupSparklines"}]},{name:_UNO(".uno:ConditionalFormatMenu","spreadsheet"),type:"menu",
menu:[{name:_("Highlight cells with..."),type:"menu",menu:[{name:_("Values greater than..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=2"},{name:_("Values less than..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=1"},{name:_("Values equal to..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=0"},{name:_("Values between..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=6"},{name:_("Values duplicate..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=8"},{name:_("Containing text..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=23"},{type:"separator"},{name:_(
"More highlights..."),uno:".uno:ConditionalFormatDialog"}]},{name:_("Top/Bottom Rules..."),
type:"menu",menu:[{name:_("Top N elements..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=11"}
,{name:_("Top N percent..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=13"},{name:_(
"Bottom N elements..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=12"},{name:_(
"Bottom N percent..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=14"},{name:_(
"Above Average..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=15"},{name:_("Below Average..."
),uno:".uno:ConditionalFormatEasy?FormatRule:short=16"},{type:"separator"},{name:_(
"More highlights..."),uno:".uno:ConditionalFormatDialog"}]},{uno:".uno:ColorScaleFormatDialog"},{
uno:".uno:DataBarFormatDialog"},{uno:".uno:IconSetFormatDialog"},{uno:".uno:CondDateFormatDialog"},{
type:"separator"},{uno:".uno:ConditionalFormatManagerDialog"}]},{type:"separator"},{
uno:".uno:FormatCellDialog"},{name:_("Rows"),type:"menu",menu:[{uno:".uno:RowHeight"},{
uno:".uno:SetOptimalRowHeight"}]},{name:_("Columns"),type:"menu",menu:[{uno:".uno:ColumnWidth"},{
uno:".uno:SetOptimalColumnWidth"}]},{uno:".uno:FontDialog"},{uno:".uno:ParagraphDialog"},{
uno:".uno:SidebarDeck.StyleListDeck"},{uno:".uno:PageFormatDialog"},{type:"separator"},{
uno:".uno:TransformDialog"},{uno:".uno:FormatLine"},{uno:".uno:FormatArea"},{uno:".uno:ThemeDialog"}
]},{name:_UNO(".uno:SheetMenu","spreadsheet"),id:"sheet",type:"menu",menu:[{uno:".uno:InsertCell"},{
name:_UNO(".uno:InsertRowsMenu","spreadsheet"),type:"menu",menu:[{uno:".uno:InsertRowsBefore"},{
uno:".uno:InsertRowsAfter"}]},{name:_UNO(".uno:InsertColumnsMenu","spreadsheet"),type:"menu",menu:[{
uno:".uno:InsertColumnsBefore"},{uno:".uno:InsertColumnsAfter"}]},{type:"separator"},{
uno:".uno:DeleteCell"},{uno:".uno:DeleteRows"},{uno:".uno:DeleteColumns"},{
uno:".uno:SheetRightToLeft"},{type:"separator"},{name:_UNO(".uno:JumpToTable","spreadsheet"),
uno:".uno:JumpToTable"}]},{name:_UNO(".uno:DataMenu","spreadsheet"),id:"data",type:"menu",menu:[{
uno:".uno:DataSort"},{uno:".uno:SortAscending"},{uno:".uno:SortDescending"},{uno:".uno:Validation"},
{uno:".uno:Calculate"},{uno:".uno:ConvertFormulaToValue"},{type:"separator"},{
uno:".uno:DataFilterAutoFilter"},{name:_UNO(".uno:FilterMenu","spreadsheet"),type:"menu",menu:[{
uno:".uno:DataFilterStandardFilter"},{uno:".uno:DataFilterSpecialFilter"},{type:"separator"},{
uno:".uno:DataFilterRemoveFilter"},{uno:".uno:DataFilterHideAutoFilter"}]},{type:"separator"},{
name:_UNO(".uno:DataPilotMenu","spreadsheet"),type:"menu",menu:[{name:_UNO(".uno:InsertPivotTable",
"spreadsheet"),uno:".uno:DataDataPilotRun"},{name:_UNO(".uno:RecalcPivotTable","spreadsheet"),
uno:".uno:RecalcPivotTable"},{name:_UNO(".uno:DeletePivotTable","spreadsheet"),
uno:".uno:DeletePivotTable"}]},{type:"separator"},{name:_UNO(".uno:NamesMenu","spreadsheet"),
type:"menu",menu:[{name:_UNO(".uno:AddName","spreadsheet"),uno:".uno:AddName"},{name:_UNO(
".uno:DefineName","spreadsheet"),uno:".uno:DefineName"}]},{name:_UNO(".uno:DefineDBName",
"spreadsheet"),uno:".uno:DefineDBName"},{name:_UNO(".uno:SelectDB","spreadsheet"),
uno:".uno:SelectDB"},{name:_UNO(".uno:DataAreaRefresh","spreadsheet"),uno:".uno:DataAreaRefresh"},{
type:"separator"},{name:_UNO(".uno:GroupOutlineMenu","spreadsheet"),type:"menu",menu:[{
uno:".uno:Group"},{uno:".uno:Ungroup"},{type:"separator"},{uno:".uno:ClearOutline"},{
type:"separator"},{uno:".uno:HideDetail"},{uno:".uno:ShowDetail"}]},{type:"separator"},{name:_UNO(
".uno:StatisticsMenu","spreadsheet"),type:"menu",menu:[{name:_UNO(".uno:SamplingDialog",
"spreadsheet"),uno:".uno:SamplingDialog"},{name:_UNO(".uno:DescriptiveStatisticsDialog",
"spreadsheet"),uno:".uno:DescriptiveStatisticsDialog"},{name:_UNO(".uno:AnalysisOfVarianceDialog",
"spreadsheet"),uno:".uno:AnalysisOfVarianceDialog"},{name:_UNO(".uno:CorrelationDialog",
"spreadsheet"),uno:".uno:CorrelationDialog"},{name:_UNO(".uno:CovarianceDialog","spreadsheet"),
uno:".uno:CovarianceDialog"},{name:_UNO(".uno:ExponentialSmoothingDialog","spreadsheet"),
uno:".uno:ExponentialSmoothingDialog"},{name:_UNO(".uno:MovingAverageDialog","spreadsheet"),
uno:".uno:MovingAverageDialog"},{name:_UNO(".uno:RegressionDialog","spreadsheet"),
uno:".uno:RegressionDialog"},{name:_UNO(".uno:TTestDialog","spreadsheet"),uno:".uno:TTestDialog"},{
name:_UNO(".uno:FTestDialog","spreadsheet"),uno:".uno:FTestDialog"},{name:_UNO(".uno:ZTestDialog",
"spreadsheet"),uno:".uno:ZTestDialog"},{name:_UNO(".uno:ChiSquareTestDialog","spreadsheet"),
uno:".uno:ChiSquareTestDialog"},{name:_UNO(".uno:FourierAnalysisDialog","spreadsheet"),
uno:".uno:FourierAnalysisDialog"}]}]},{name:_UNO(".uno:ToolsMenu","spreadsheet"),id:"tools",
type:"menu",menu:[{uno:".uno:SpellDialog"},{uno:".uno:SpellOnline"},{name:_UNO(".uno:LanguageMenu"),
type:"menu",menu:[{name:_("None (Do not check spelling)"),id:"nonelanguage",
uno:".uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE"}]},{uno:".uno:GoalSeekDialog"},{
uno:".uno:Protect"},{type:"separator"},{name:_UNO(".uno:RunMacro"),id:"runmacro",uno:".uno:RunMacro"
}]},{name:_UNO(".uno:HelpMenu","spreadsheet"),id:"help",type:"menu",menu:[{name:_("Online Help"),
id:"online-help",type:"action",iosapp:false},{name:_("Keyboard shortcuts"),id:"keyboard-shortcuts",
type:"action",iosapp:false},{name:_("Report an issue"),id:"report-an-issue",type:"action",
iosapp:false},{name:_("Latest Updates"),id:"latestupdates",type:"action",iosapp:false},{name:_(
"Send Feedback"),id:"feedback",type:"action",mobileapp:false},{name:_("Server audit"),
id:"serveraudit",type:"action",mobileapp:false},{name:_("About"),id:"about",type:"action"}]},{
name:_("Last modification"),id:"last-mod",type:"action",tablet:false}],mobiletext:[{name:_("Search"
),id:"searchdialog",type:"action"},{name:_UNO(".uno:PickList","text"),id:"file",type:"menu",menu:[{
name:_UNO(".uno:Save","text"),id:"save",type:"action"},{name:_UNO(".uno:SaveAs","text"),id:"saveas",
type:"action"},{name:_("Export as"),id:"exportas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:"exportas-pdf",type:"action"},{name:_("EPUB (.epub)"),id:"exportas-epub",type:"action"}]},{
name:_("Share..."),id:"shareas",type:"action"},{name:_("See revision history"),id:"rev-history",
type:"action"},{type:"separator"},{name:"Печать",id:"print",type:"action"}]},{
name:!window.ThisIsAMobileApp?_("Download as"):_("Export as"),id:"downloadas",type:"menu",menu:[{
name:_("PDF Document (.pdf)"),id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",
type:"action"},{name:_("PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_(
"ODF text document (.odt)"),id:"downloadas-odt",type:"action"},{name:_("Word 2003 Document (.doc)"),
id:"downloadas-doc",type:"action"},{name:_("Word Document (.docx)"),id:"downloadas-docx",
type:"action"},{name:_("Rich Text (.rtf)"),id:"downloadas-rtf",type:"action"},{name:_("EPUB (.epub)"
),id:!window.ThisIsAMobileApp?"exportepub":"downloadas-epub",type:"action"}]},{name:_UNO(
".uno:EditMenu","text"),id:"editmenu",type:"menu",menu:[{uno:".uno:Undo"},{uno:".uno:Redo"},{name:_(
"Repair"),id:"repair",type:"action"},{type:"separator"},{uno:".uno:Cut"},{uno:".uno:Copy"},{
uno:".uno:Paste"},{uno:".uno:SelectAll"}]},{name:_UNO(".uno:ChangesMenu","text"),id:"changesmenu",
type:"menu",menu:[{uno:".uno:TrackChanges"},{uno:".uno:ShowTrackedChanges"},{type:"separator"},{
type:"action",id:"acceptalltrackedchanges",uno:".uno:AcceptAllTrackedChanges"},{type:"action",
id:"rejectalltrackedchanges",uno:".uno:RejectAllTrackedChanges"},{uno:".uno:PreviousTrackedChange"},
{uno:".uno:NextTrackedChange"}]},{name:_UNO(".uno:ViewMenu","text"),id:"view",type:"menu",menu:[{
name:_UNO(".uno:FullScreen","text"),id:"fullscreen",type:"action",mobileapp:false},{
uno:".uno:ControlCodes",id:"formattingmarks"},{uno:".uno:SpellOnline"},{name:_UNO(
".uno:ShowResolvedAnnotations","text"),id:"showresolved",uno:".uno:ShowResolvedAnnotations"},{
name:_("Dark Mode"),id:"toggledarktheme",type:"action"},{name:_("Invert Background"),
id:"invertbackground",type:"action"}]},window.enableAccessibility?{name:_("Screen Reading"),
id:"togglea11ystate",type:"action"}:{},{id:"watermark",uno:".uno:Watermark"},{name:_("Page Setup"),
id:"pagesetup",type:"action"},{uno:".uno:WordCountDialog"},window.deeplEnabled?{uno:".uno:Translate"
}:{},{name:_UNO(".uno:RunMacro"),id:"runmacro",uno:".uno:RunMacro"},{name:_("Latest Updates"),
id:"latestupdates",type:"action",iosapp:false},{name:_("Send Feedback"),id:"feedback",type:"action",
mobileapp:false},{name:_("About"),id:"about",type:"action"}],mobilepresentation:[{name:_("Search"),
id:"searchdialog",type:"action"},{name:_UNO(".uno:PickList","presentation"),id:"file",type:"menu",
menu:[{name:_UNO(".uno:Save","presentation"),id:"save",type:"action"},{name:_UNO(".uno:SaveAs",
"presentation"),id:"saveas",type:"action"},{name:_("Export as"),id:"exportas",type:"menu",menu:[{
name:_("PDF Document (.pdf)"),id:"exportas-pdf",type:"action"}]},{name:_("Share..."),id:"shareas",
type:"action"},{name:_("See revision history"),id:"rev-history",type:"action"},{type:"separator"},{
name:"Печать",id:"print",type:"action"}]},{name:!window.ThisIsAMobileApp?_(
"Download as"):_("Export as"),id:"downloadas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",type:"action"},{name:_(
"PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_("ODF presentation (.odp)"),
id:"downloadas-odp",type:"action"},{name:_("PowerPoint 2003 Presentation (.ppt)"),
id:"downloadas-ppt",type:"action"},{name:_("PowerPoint Presentation (.pptx)"),id:"downloadas-pptx",
type:"action"},{name:_("ODF Drawing (.odg)"),id:"downloadas-odg",type:"action"}]},{name:_UNO(
".uno:EditMenu","presentation"),id:"editmenu",type:"menu",menu:[{uno:".uno:Undo"},{uno:".uno:Redo"},
{name:_("Repair"),id:"repair",type:"action"},{type:"separator"},{uno:".uno:Cut"},{uno:".uno:Copy"},{
uno:".uno:Paste"},{uno:".uno:SelectAll"}]},{name:_UNO(".uno:ViewMenu","presentation"),id:"view",
type:"menu",menu:[{uno:".uno:SpellOnline"},{name:_UNO(".uno:FullScreen","presentation"),
id:"fullscreen",type:"action",mobileapp:false},{name:_("Dark Mode"),id:"toggledarktheme",
type:"action"},{name:_("Invert Background"),id:"invertbackground",type:"action"}]},{name:_UNO(
".uno:TableMenu","text"),id:"tablemenu",type:"menu",menu:[{uno:".uno:InsertRowsBefore"},{
uno:".uno:InsertRowsAfter"},{type:"separator"},{uno:".uno:InsertColumnsBefore"},{
uno:".uno:InsertColumnsAfter"},{uno:".uno:SelectTable"},{uno:".uno:EntireRow"},{
uno:".uno:EntireColumn"},{uno:".uno:MergeCells"},{uno:".uno:DeleteRows"},{uno:".uno:DeleteColumns"},
{uno:".uno:DeleteTable"}]},{name:_UNO(".uno:SlideMenu","presentation"),id:"slidemenu",type:"menu",
menu:[{name:_UNO(".uno:InsertSlide","presentation"),id:"insertpage",type:"action"},{name:_UNO(
".uno:DuplicateSlide","presentation"),id:"duplicatepage",type:"action"},{name:_UNO(
".uno:DeleteSlide","presentation"),id:"deletepage",type:"action"}]},{name:_UNO(".uno:RunMacro"),
id:"runmacro",uno:".uno:RunMacro"},{name:_("Fullscreen presentation"),id:"fullscreen-presentation",
type:"action"},{name:_("Latest Updates"),id:"latestupdates",type:"action",iosapp:false},{name:_(
"Send Feedback"),id:"feedback",type:"action",mobileapp:false},{name:_("About"),id:"about",
type:"action"}],mobiledrawing:[{name:_("Search"),id:"searchdialog",type:"action"},{name:_UNO(
".uno:PickList","presentation"),id:"file",type:"menu",menu:[{name:_UNO(".uno:Save","presentation"),
id:"save",type:"action"},{name:_UNO(".uno:SaveAs","presentation"),id:"saveas",type:"action"},{
name:_("Export as"),id:"exportas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:"exportas-pdf",type:"action"}]},{name:_("Share..."),id:"shareas",type:"action"},{name:_UNO(
".uno:Print","presentation"),id:"print",type:"action"},{name:_("See revision history"),
id:"rev-history",type:"action"}]},{name:!window.ThisIsAMobileApp?_("Download as"):_("Export as"),
id:"downloadas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",type:"action"},{name:_(
"PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_("ODF Drawing (.odg)"),
id:"downloadas-odg",type:"action"}]},{name:_UNO(".uno:EditMenu","presentation"),id:"editmenu",
type:"menu",menu:[{uno:".uno:Undo"},{uno:".uno:Redo"},{name:_("Repair"),id:"repair",type:"action"},{
type:"separator"},{uno:".uno:Cut"},{uno:".uno:Copy"},{uno:".uno:Paste"},{uno:".uno:SelectAll"}]},{
name:_UNO(".uno:ViewMenu","presentation"),id:"view",type:"menu",menu:[{uno:".uno:SpellOnline"},{
name:_UNO(".uno:FullScreen","presentation"),id:"fullscreen",type:"action",mobileapp:false},{name:_(
"Dark Mode"),id:"toggledarktheme",type:"action"},{name:_("Invert Background"),id:"invertbackground",
type:"action"}]},{name:_UNO(".uno:TableMenu","text"),id:"tablemenu",type:"menu",menu:[{name:_UNO(
".uno:InsertRowsBefore","presentation"),uno:".uno:InsertRowsBefore"},{name:_UNO(
".uno:InsertRowsAfter","presentation"),uno:".uno:InsertRowsAfter"},{type:"separator"},{name:_UNO(
".uno:InsertColumnsBefore","presentation"),uno:".uno:InsertColumnsBefore"},{name:_UNO(
".uno:InsertColumnsAfter","presentation"),uno:".uno:InsertColumnsAfter"},{name:_UNO(
".uno:DeleteRows","presentation"),uno:".uno:DeleteRows"},{name:_UNO(".uno:DeleteColumns",
"presentation"),uno:".uno:DeleteColumns"},{name:_UNO(".uno:MergeCells","presentation"),
uno:".uno:MergeCells"}]},{name:_UNO(".uno:PageMenu","presentation"),id:"pagemenu",type:"menu",menu:[
{name:_UNO(".uno:InsertPage","presentation"),id:"insertpage",type:"action"},{name:_UNO(
".uno:DuplicatePage","presentation"),id:"duplicatepage",type:"action"},{name:_UNO(".uno:DeletePage",
"presentation"),id:"deletepage",type:"action"}]},{name:_UNO(".uno:RunMacro"),id:"runmacro",
uno:".uno:RunMacro"},{name:_("Latest Updates"),id:"latestupdates",type:"action",iosapp:false},{
name:_("Send Feedback"),id:"feedback",type:"action",mobileapp:false},{name:_("About"),id:"about",
type:"action"}],mobilespreadsheet:[{name:_("Search"),id:"searchdialog",type:"action"},{name:_UNO(
".uno:PickList","spreadsheet"),id:"file",type:"menu",menu:[{name:_UNO(".uno:Save","spreadsheet"),
id:"save",type:"action"},{name:_UNO(".uno:SaveAs","spreadsheet"),id:"saveas",type:"action"},{name:_(
"Export as"),id:"exportas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),id:"exportas-pdf",
type:"action"}]},{name:_("Share..."),id:"shareas",type:"action"},{name:_("See revision history"),
id:"rev-history",type:"action"},{type:"separator"},{name:"Печать",
id:"print",type:"action"},{name:_("Define print area"),uno:".uno:DefinePrintArea"},{name:_(
"Remove print area"),uno:".uno:DeletePrintArea"}]},{name:!window.ThisIsAMobileApp?_("Download as"
):_("Export as"),id:"downloadas",type:"menu",menu:[{name:_("PDF Document (.pdf)"),
id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",type:"action"},{name:_(
"PDF Document (.pdf) as..."),id:"exportpdf",type:"action"},{name:_("ODF spreadsheet (.ods)"),
id:"downloadas-ods",type:"action"},{name:_("Excel 2003 Spreadsheet (.xls)"),id:"downloadas-xls",
type:"action"},{name:_("Excel Spreadsheet (.xlsx)"),id:"downloadas-xlsx",type:"action"}]},{
name:_UNO(".uno:EditMenu","spreadsheet"),id:"editmenu",type:"menu",menu:[{uno:".uno:Undo"},{
uno:".uno:Redo"},{name:_("Repair"),id:"repair",type:"action"},{type:"separator"},{uno:".uno:Cut"},{
uno:".uno:Copy"},{uno:".uno:Paste"},{uno:".uno:SelectAll"}]},{name:_UNO(".uno:ViewMenu",
"spreadsheet"),id:"view",type:"menu",menu:[{uno:".uno:SpellOnline"},{name:_UNO(".uno:FullScreen",
"presentation"),id:"fullscreen",type:"action",mobileapp:false},{name:_("Dark Mode"),
id:"toggledarktheme",type:"action"},{name:_("Invert Background"),id:"invertbackground",type:"action"
}]},{name:_UNO(".uno:SheetMenu","spreadsheet"),id:"sheetmenu",type:"menu",menu:[{name:_UNO(
".uno:InsertRowsMenu","spreadsheet"),id:"insertrowsmenu",type:"menu",menu:[{
uno:".uno:InsertRowsBefore"},{uno:".uno:InsertRowsAfter"}]},{name:_UNO(".uno:InsertColumnsMenu",
"spreadsheet"),id:"insertcolumnsmenu",type:"menu",menu:[{uno:".uno:InsertColumnsBefore"},{
uno:".uno:InsertColumnsAfter"}]},{type:"separator"},{uno:".uno:DeleteRows"},{
uno:".uno:DeleteColumns"},{type:"separator"},{name:_UNO(".uno:FreezePanes","spreadsheet"),
uno:".uno:FreezePanes"},{name:_UNO(".uno:FreezePanesColumn","spreadsheet"),
uno:".uno:FreezePanesColumn"},{name:_UNO(".uno:FreezePanesRow","spreadsheet"),
uno:".uno:FreezePanesRow"}]},{name:_UNO(".uno:DataMenu","spreadsheet"),id:"datamenu",type:"menu",
menu:[{uno:".uno:Validation"},{type:"separator"},{uno:".uno:SortAscending"},{
uno:".uno:SortDescending"},{type:"separator"},{name:_UNO(".uno:GroupOutlineMenu","spreadsheet"),
id:"groupoutlinemenu",type:"menu",menu:[{uno:".uno:Group"},{uno:".uno:Ungroup"},{type:"separator"},{
uno:".uno:ClearOutline"},{type:"separator"},{uno:".uno:HideDetail"},{uno:".uno:ShowDetail"}]}]},{
name:_UNO(".uno:RunMacro"),id:"runmacro",uno:".uno:RunMacro"},{name:_("Latest Updates"),
id:"latestupdates",type:"action",iosapp:false},{name:_("Send Feedback"),id:"feedback",type:"action",
mobileapp:false},{name:_("About"),id:"about",type:"action"}],mobileInsertMenu:{text:{name:_UNO(
".uno:InsertMenu","text"),id:"insert",type:"menu",menu:[{name:_("Local Image..."),
id:"insertgraphic",type:"action"},{name:_UNO(".uno:InsertGraphic","text"),id:"insertgraphicremote",
type:"action"},{uno:".uno:InsertObjectChart"},{name:_UNO(".uno:InsertAnnotation","text"),
id:"insertcomment",type:"action"},{name:_UNO(".uno:TableMenu"),id:"inserttable",type:"action"},{
type:"separator"},{name:_UNO(".uno:InsertField","text"),id:"insertfield",type:"menu",menu:[{
uno:".uno:InsertPageNumberField"},{uno:".uno:InsertPageCountField"},{uno:".uno:InsertDateField"},{
uno:".uno:InsertTimeField"},{uno:".uno:InsertTitleField"},{uno:".uno:InsertAuthorField"},{
uno:".uno:InsertTopicField"}]},{name:_UNO(".uno:InsertHeaderFooterMenu","text"),
id:"insertheaderfooter",type:"menu",menu:[{name:_UNO(".uno:InsertPageHeader","text"),
id:"insertpageheader",type:"menu",menu:[{name:_("All"),disabled:true,id:"insertheader",tag:"_ALL_",
uno:".uno:InsertPageHeader?On:bool=true"}]},{name:_UNO(".uno:InsertPageFooter","text"),
id:"insertpagefooter",type:"menu",menu:[{name:_("All"),disabled:true,id:"insertfooter",tag:"_ALL_",
uno:".uno:InsertPageFooter?On:bool=true"}]}]},{uno:".uno:InsertFootnote"},{uno:".uno:InsertEndnote"}
,{type:"separator"},{uno:".uno:InsertPagebreak"},{name:_UNO(".uno:InsertColumnBreak","spreadsheet"),
uno:".uno:InsertColumnBreak"},{type:"separator"},{name:_UNO(".uno:HyperlinkDialog"),
id:"inserthyperlink",type:"action"},{name:_UNO(".uno:ShapesMenu"),id:"insertshape",type:"action"},{
name:_UNO(".uno:FontworkGalleryFloater"),uno:".uno:FontworkGalleryFloater",
id:"fontworkgalleryfloater"},{name:_UNO(".uno:FormattingMarkMenu","text"),id:"formattingmark",
type:"menu",menu:[{uno:".uno:InsertNonBreakingSpace"},{uno:".uno:InsertHardHyphen"},{
uno:".uno:InsertSoftHyphen"},{uno:".uno:InsertZWSP"},{uno:".uno:InsertWJ"},{uno:".uno:InsertLRM"},{
uno:".uno:InsertRLM"}]},{name:_UNO(".uno:FormatFormMenu","text"),id:"formatformmenu",type:"menu",
menu:[{name:_("Insert Rich Text"),uno:".uno:InsertContentControl"},{name:_("Insert Checkbox"),
uno:".uno:InsertCheckboxContentControl"},{name:_("Insert Dropdown"),
uno:".uno:InsertDropdownContentControl"},{name:_("Insert Picture"),
uno:".uno:InsertPictureContentControl"},{name:_("Insert Date"),uno:".uno:InsertDateContentControl"},
{name:_("Properties"),uno:".uno:ContentControlProperties"}]}]},spreadsheet:{name:_UNO(
".uno:InsertMenu","spreadsheet"),id:"insert",type:"menu",menu:[{name:_("Local Image..."),
id:"insertgraphic",type:"action"},{name:_UNO(".uno:InsertGraphic","spreadsheet"),
id:"insertgraphicremote",type:"action"},{uno:".uno:InsertObjectChart"},{name:_UNO(
".uno:InsertAnnotation","spreadsheet"),id:"insertcomment",type:"action"},{type:"separator"},{
name:_UNO(".uno:HyperlinkDialog"),id:"inserthyperlink",type:"action"},{name:_UNO(".uno:ShapesMenu"),
id:"insertshape",type:"action"},{uno:".uno:InsertCurrentDate"},{uno:".uno:InsertCurrentTime"}]},
presentation:{name:_UNO(".uno:InsertMenu","presentation"),id:"insert",type:"menu",menu:[{name:_(
"Local Image..."),id:"insertgraphic",type:"action"},{name:_UNO(".uno:InsertGraphic","presentation"),
id:"insertgraphicremote",type:"action"},{uno:".uno:InsertObjectChart"},{name:_UNO(
".uno:InsertAnnotation","presentation"),id:"insertcomment",type:"action"},{name:_UNO(
".uno:TableMenu"),id:"inserttable",type:"action"},{name:_UNO(".uno:HyperlinkDialog"),
id:"inserthyperlink",type:"action"},{name:_UNO(".uno:ShapesMenu"),id:"insertshape",type:"action"},{
name:_UNO(".uno:FontworkGalleryFloater"),uno:".uno:FontworkGalleryFloater",
id:"fontworkgalleryfloater"},{name:_UNO(".uno:Text","presentation"),id:"inserttextbox",type:"action"
},{name:_UNO(".uno:InsertField","text"),id:"insertfield",type:"menu",menu:[{
uno:".uno:InsertDateFieldFix"},{uno:".uno:InsertDateFieldVar"},{uno:".uno:InsertTimeFieldFix"},{
uno:".uno:InsertTimeFieldVar"},{type:"separator"},{name:_UNO(".uno:InsertSlideField","presentation"
),uno:".uno:InsertPageField"},{name:_UNO(".uno:InsertSlideTitleField","presentation"),
uno:".uno:InsertPageTitleField"},{name:_UNO(".uno:InsertSlidesField","presentation"),
uno:".uno:InsertPagesField"}]}]},drawing:{name:_UNO(".uno:InsertMenu","presentation"),id:"insert",
type:"menu",menu:[{name:_("Local Image..."),id:"insertgraphic",type:"action"},{name:_UNO(
".uno:InsertGraphic","presentation"),id:"insertgraphicremote",type:"action"},{
uno:".uno:InsertObjectChart"},{name:_UNO(".uno:InsertAnnotation","presentation"),id:"insertcomment",
type:"action"},{name:_UNO(".uno:TableMenu"),id:"inserttable",type:"action"},{name:_UNO(
".uno:HyperlinkDialog"),id:"inserthyperlink",type:"action"},{name:_UNO(".uno:ShapesMenu"),
id:"insertshape",type:"action"},{name:_UNO(".uno:FontworkGalleryFloater"),
uno:".uno:FontworkGalleryFloater",id:"fontworkgalleryfloater"},{name:_UNO(".uno:Text","presentation"
),id:"inserttextbox",type:"action"},{name:_UNO(".uno:InsertField","text"),id:"insertfield",
type:"menu",menu:[{name:_UNO(".uno:InsertDateFieldFix","presentation"),uno:".uno:InsertDateFieldFix"
},{name:_UNO(".uno:InsertDateFieldVar","presentation"),uno:".uno:InsertDateFieldVar"},{name:_UNO(
".uno:InsertTimeFieldFix","presentation"),uno:".uno:InsertTimeFieldFix"},{name:_UNO(
".uno:InsertTimeFieldVar","presentation"),uno:".uno:InsertTimeFieldVar"},{type:"separator"},{
name:_UNO(".uno:InsertPageField","presentation"),uno:".uno:InsertPageField"},{name:_UNO(
".uno:InsertPageTitleField","presentation"),uno:".uno:InsertPageTitleField"},{name:_UNO(
".uno:InsertPagesField","presentation"),uno:".uno:InsertPagesField"}]}]}},commandStates:{},
allowedReadonlyMenus:["file","downloadas","view","insert","slide","help","print"],
allowedRedlineManagementMenus:["editmenu","changesmenu"],math:[".uno:ChangeFont",
".uno:ChangeFontSize",".uno:ChangeDistance",".uno:ChangeAlignment"],allowedViewModeCommands:[
".uno:Signature"],allowedViewModeActions:[function(){return app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name).hasAnyComments()?"savecomments":undefined},"shareas","print",
"print-active-sheet","print-all-sheets","print-notespages","downloadas-odt","downloadas-doc",
"downloadas-docx","downloadas-rtf","downloadas-odp","downloadas-ppt","downloadas-pptx",
"downloadas-odg","exportpdf",!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",
!window.ThisIsAMobileApp?"exportepub":"downloadas-epub","downloadas-ods","downloadas-xls",
"downloadas-xlsx","downloadas-csv","closedocument",function(){return!(
window.L.Browser.ie||window.L.Browser.edge)?"fullscreen":undefined},"zoomin","zoomout","zoomreset",
"showstatusbar","showresolved","showannotations","toggledarktheme","insert-signatureline","about",
"keyboard-shortcuts","latestupdates","feedback","serveraudit","online-help","report-an-issue",
"insertcomment"],allowedRedlineManagementModeCommands:[".uno:ShowTrackedChanges",
".uno:AcceptTrackedChanges",".uno:AcceptTrackedChange",".uno:RejectTrackedChange",
".uno:AcceptAllTrackedChanges",".uno:RejectAllTrackedChanges",".uno:AcceptTrackedChangeToNext",
".uno:RejectTrackedChangeToNext",".uno:CommentChangeTracking",".uno:PreviousTrackedChange",
".uno:NextTrackedChange"],allowedRedlineManagementModeActions:["acceptalltrackedchanges",
"rejectalltrackedchanges"]};_this._initialized=false;_this._hiddenItems=[];_this._menubarCont=null;
_this._isFileODF=true;_this.lastModIndicator=null;return _this}Menubar.prototype.onAdd=function(map
){this._initialized=false;this._hiddenItems=[];this._menubarCont=window.L.DomUtil.get("main-menu");
this._isFileODF=true;this._map=map;if(this._menubarCont)this._menubarCont.remove();
this._menubarCont=map.mainMenuTemplate.cloneNode(true);if(this._menubarCont!=null)$(
"#main-menu-state").after(this._menubarCont);if(!this._map["wopi"].DisablePresentation
)this.options.allowedViewModeActions=this.options.allowedViewModeActions.concat([
"fullscreen-presentation","presentation-currentslide","present-in-window","presentation-in-console"]
);this._initializeMenu(this.options.initial);map.on("doclayerinit",this._onDocLayerInit,this);
this._onRefresh=this._onRefresh.bind(this);app.events.on("updatepermission",this._onRefresh);map.on(
"addmenu",this._addMenu,this);map.on("languagesupdated",this._onInitLanguagesMenu,this);map.on(
"updatetoolbarcommandvalues",this._onStyleMenu,this);map.on("initmodificationindicator",
this._onInitModificationIndicator,this);map.on("updatemodificationindicator",
this._onUpdateModificationIndicator,this)};Menubar.prototype.onRemove=function(){var _a;
this._map.off("doclayerinit",this._onDocLayerInit,this);this._map.off("addmenu",this._addMenu,this);
this._map.off("languagesupdated",this._onInitLanguagesMenu,this);this._map.off(
"updatetoolbarcommandvalues",this._onStyleMenu,this);this._map.off("initmodificationindicator",
this._onInitModificationIndicator,this);this._map.off("updatemodificationindicator",
this._onUpdateModificationIndicator,this);app.events.off("updatepermission",this._onRefresh);(
_a=this._menubarCont)===null||_a===void 0?void 0:_a.remove();this._menubarCont=null};
Menubar.prototype._addMenu=function(e){var _a;var alreadyExists=window.L.DomUtil.get("menu-"+e.id);
if(alreadyExists)return;var liItem=window.L.DomUtil.create("li","");liItem.setAttribute("role",
"menuitem");liItem.id="menu-"+e.id;if(this._map.isReadOnlyMode()){window.L.DomUtil.addClass(liItem,
"readonly")}var aItem=window.L.DomUtil.create("a","",liItem);$(aItem).text(e.label);$(aItem).data(
"id",e.id);$(aItem).data("type","action");$(aItem).data("postmessage","true");aItem.tabIndex=0;(
_a=this._menubarCont)===null||_a===void 0?void 0:_a.insertBefore(liItem,this._menubarCont.firstChild
)};Menubar.prototype._createUnoMenuItem=function(caption,command,tag){var liItem,aItem;
liItem=window.L.DomUtil.create("li","");liItem.setAttribute("role","menuitem");
aItem=window.L.DomUtil.create("a","",liItem);$(aItem).text(caption);$(aItem).data("type",
"unocommand");$(aItem).data("uno",command);if(tag!==undefined)$(aItem).data("tag",tag);
aItem.tabIndex=0;return liItem};Menubar.prototype._createActionMenuItem=function(caption,id){
var liItem,aItem;liItem=window.L.DomUtil.create("li","");liItem.setAttribute("role","menuitem");
aItem=window.L.DomUtil.create("a","",liItem);$(aItem).text(caption);$(aItem).data("type","action");
$(aItem).data("id",id);aItem.tabIndex=0;return liItem};
Menubar.prototype._onInitLanguagesMenu=function(){var translated,neutral;
var constDefa="Default_RESET_LANGUAGES";var constCurr="Current_RESET_LANGUAGES";
var constPara="Paragraph_RESET_LANGUAGES";var constLang=".uno:LanguageStatus?Language:string=";
var resetLang=_("Reset to Default Language");var languages=app.languages;var $menuSelection=$(
"#menu-noneselection").parent();var $menuParagraph=$("#menu-noneparagraph").parent();
var $menuDefault=$("#menu-nonelanguage").parent();var noneselection=$("#menu-noneselection").detach(
);var fontlanguage=$("#menu-fontlanguage").detach();var noneparagraph=$("#menu-noneparagraph"
).detach();var paragraphlanguage=$("#menu-paragraphlanguage").detach();var nonelanguage=$(
"#menu-nonelanguage").detach();$menuSelection.empty();$menuParagraph.empty();$menuDefault.empty();
for(var lang in languages){if(languages.length>10&&app.favouriteLanguages.indexOf(languages[lang
].iso)<0)continue;translated=languages[lang].translated;neutral=languages[lang].neutral;
$menuSelection.append(this._createUnoMenuItem(translated,constLang+encodeURIComponent(
"Current_"+neutral)));$menuParagraph.append(this._createUnoMenuItem(translated,
constLang+encodeURIComponent("Paragraph_"+neutral)));$menuDefault.append(this._createUnoMenuItem(
translated,constLang+encodeURIComponent("Default_"+neutral)))}$menuSelection.append(
this._createActionMenuItem(_("More..."),"morelanguages-selection"));$menuParagraph.append(
this._createActionMenuItem(_("More..."),"morelanguages-paragraph"));$menuDefault.append(
this._createActionMenuItem(_("More..."),"morelanguages-all"));$menuSelection.append(
this._createMenu([{type:"separator"}]));$menuParagraph.append(this._createMenu([{type:"separator"}])
);$menuDefault.append(this._createMenu([{type:"separator"}]));$menuSelection.append(
this._createUnoMenuItem(resetLang,constLang+constCurr));$menuParagraph.append(
this._createUnoMenuItem(resetLang,constLang+constPara));$menuDefault.append(this._createUnoMenuItem(
resetLang,constLang+constDefa));$menuSelection.append(noneselection);$menuSelection.append(
fontlanguage);$menuParagraph.append(noneparagraph);$menuParagraph.append(paragraphlanguage);
$menuDefault.append(nonelanguage)};Menubar.prototype._addTabIndexPropsToMainMenu=function(){
var mainMenu=document.getElementById("main-menu");if(mainMenu==null)return;for(
var i=0;i<mainMenu.children.length;i++){if(mainMenu.children[i].children[0].getAttribute(
"aria-haspopup")==="true"){mainMenu.children[i].children[0].tabIndex=0}}};
Menubar.prototype._onRefresh=function(){var _a;if(!this._initialized){this._initialized=true;
this._onDocLayerInit()}if(this._menubarCont)window.L.DomUtil.removeChildNodes(this._menubarCont);
var docType=this._map.getDocType();if(docType==="text"){this._initializeMenu(this.options.text)
}else if(docType==="spreadsheet"){this._initializeMenu(this.options.spreadsheet)}else if(
docType==="presentation"){this._initializeMenu(this.options.presentation)}else if(
docType==="drawing"){this._initializeMenu(this.options.drawing)}$("#main-menu").smartmenus({
hideOnClick:true,showOnClick:true,hideTimeout:0,hideDuration:0,hideFunction:null,showDuration:0,
showFunction:null,showTimeout:0,collapsibleHideDuration:0,collapsibleHideFunction:null,
subIndicatorsPos:"append",subIndicatorsText:"&#8250;"});$("#main-menu").attr("tabindex",0);(
_a=document.getElementById("main-menu"))===null||_a===void 0?void 0:_a.setAttribute("role","menubar"
);this._addTabIndexPropsToMainMenu();this._createFileIcon()};
Menubar.prototype._bindEventIfNotBound=function(element,eventType,namespace,data,handler){
var _this=this;var eventName=eventType+(namespace?"."+namespace:"");$(element).off(eventName).on(
eventName,data,function(e,menu){return handler.call(_this,e,menu)})};
Menubar.prototype._onStyleMenu=function(e){if(e.commandName===".uno:StyleApply"){var style;
var constArg="&";var constHeader=".uno:InsertPageHeader?PageStyle:string=";
var constFooter=".uno:InsertPageFooter?PageStyle:string=";var $menuHeader=$("#menu-insertheader"
).parent();var $menuFooter=$("#menu-insertfooter").parent();var pageStyles=e.commandValues[
"HeaderFooter"];for(var iterator in pageStyles){style=pageStyles[iterator];if(!window.mode.isMobile(
)){$menuHeader.append(this._createUnoMenuItem(_(style),constHeader+encodeURIComponent(style
)+constArg,style));$menuFooter.append(this._createUnoMenuItem(_(style),
constFooter+encodeURIComponent(style)+constArg,style))}else{var docType=this._map.getDocType();
var target=this.options.mobileInsertMenu[docType];var findFunction=function(item){
return item.name===_(style)};var foundMenu=this._findSubMenuByName(target,_UNO(
".uno:InsertPageHeader","text"));if(foundMenu&&foundMenu.menu.find(findFunction)===undefined
)foundMenu.menu.push({name:_(style),tag:style,uno:constHeader+encodeURIComponent(style)+constArg});
foundMenu=this._findSubMenuByName(target,_UNO(".uno:InsertPageFooter","text"));if(
foundMenu&&foundMenu.menu.find(findFunction)===undefined)foundMenu.menu.push({name:_(style),
tag:style,uno:constFooter+encodeURIComponent(style)+constArg})}}}};
Menubar.prototype._createDocument=function(e){var self=e.data.self;var docType=self._map.getDocType(
);self._map.fire("postMessage",{msgId:"UI_CreateFile",args:{DocumentType:docType}})};
Menubar.prototype._onDocLayerInit=function(){var _this=this;this._onRefresh();
this._bindEventIfNotBound("#main-menu","select","smapi",{self:this},this._onItemSelected);
this._bindEventIfNotBound("#main-menu","beforeshow","smapi",{self:this},this._beforeShow);
this._bindEventIfNotBound("#main-menu","click","smapi",{self:this},this._onClicked);
this._bindEventIfNotBound("#main-menu","keydown","",{self:this},this._onKeyDown);if(
window.mode.isMobile()){$("#main-menu").parent().css("height","0");$("#toolbar-wrapper").addClass(
"mobile")}$(function(){var $mainMenuState=$("#main-menu-state");if($mainMenuState.length){
$mainMenuState.change(function(event){var $menu=$("#main-menu");var $nav=$menu.parent();if(
event.target.checked){if(!window.mode.isMobile()){window.app.console.log(
"======> Assertion failed!? Not window.mode.isMobile()? Control.Menubar.js #1");$nav.css({
height:"initial",bottom:"38px"});$menu.hide().slideDown(250,function(){$menu.css("display","")})
}else{window.mobileMenuWizard=true;var menuData=_this._map.menubar.generateFullMenuStructure();
_this._map.fire("mobilewizard",{data:menuData});$("#toolbar-hamburger").removeClass(
"menuwizard-closed").addClass("menuwizard-opened");$("#toolbar-mobile-back").css("visibility",
"hidden");$("#formulabar").hide()}}else if(!window.mode.isMobile()){window.app.console.log(
"======> Assertion failed!? Not window.mode.isMobile()? Control.Menubar.js #2");$menu.show(
).slideUp(250,function(){$menu.css("display","")});$nav.css({height:"",bottom:""})}else{
window.mobileMenuWizard=false;_this._map.fire("closemobilewizard");$("#toolbar-hamburger"
).removeClass("menuwizard-opened").addClass("menuwizard-closed");$("#toolbar-mobile-back").css(
"visibility","");if(_this._map.getDocType()==="spreadsheet"){$("#formulabar").show()}}});$(window
).bind("beforeunload unload",function(){if($mainMenuState[0].checked){$mainMenuState[0].click()}})}}
);this._initialized=true};Menubar.prototype._onClicked=function(e,menu){if($(menu).hasClass(
"highlighted")){$("#main-menu").smartmenus("menuHideAll")}var $mainMenuState=$("#main-menu-state");
if(!$(menu).hasClass("has-submenu")&&$mainMenuState[0].checked){$mainMenuState[0].click()}};
Menubar.prototype._checkedMenu=function(uno,item){var constChecked="lo-menu-item-checked";
var state=this._map["stateChangeHandler"].getItemValue(uno);var data=$(item).data("tag");
state=state[data]||false;if(state){$(item).addClass(constChecked)}else{$(item).removeClass(
constChecked)}};Menubar.prototype._beforeShow=function(e,menu){var _this=this;var items=$(menu
).children().children("a").not(".has-submenu");$(items).each(function(index,aItem){var type=$(aItem
).data("type");var id=$(aItem).data("id");var uno=$(aItem).data("uno");
var constChecked="lo-menu-item-checked";if(_this._map.isEditMode()){if(type==="unocommand"){var data
,lang,languageAndCode;var constUno="uno";var constState="stateChangeHandler";
var constLanguage=".uno:LanguageStatus";var constPageHeader=".uno:InsertPageHeader";
var constPageFooter=".uno:InsertPageFooter";var unoCommand=$(aItem).data(constUno);
var itemState=_this._map[constState].getItemValue(unoCommand);if(itemState==="disabled"){if(
unoCommand.startsWith(".uno:Paste")){window.app.console.log(
"do not disable paste based on server side data")}else{$(aItem).addClass("disabled")}}else{$(aItem
).removeClass("disabled")}if(unoCommand.startsWith(constLanguage)){unoCommand=constLanguage;
languageAndCode=_this._map[constState].getItemValue(unoCommand);lang=languageAndCode.split(";")[0];
data=decodeURIComponent($(aItem).data(constUno));if(data.indexOf(lang)!==-1){$(aItem).addClass(
constChecked)}else if(data.indexOf("LANGUAGE_NONE")!==-1&&lang==="[None]"){$(aItem).addClass(
constChecked)}else{$(aItem).removeClass(constChecked)}}else if(unoCommand.startsWith(constPageHeader
)){unoCommand=constPageHeader;_this._checkedMenu(unoCommand,_this)}else if(unoCommand.startsWith(
constPageFooter)){unoCommand=constPageFooter;_this._checkedMenu(unoCommand,_this)}else if(
itemState==="true"){$(aItem).addClass(constChecked)}else{$(aItem).removeClass(constChecked)}if(
_this.options.math.includes(unoCommand)&&app.map.context.context!=="Math"){$(aItem).addClass(
"disabled")}}else if(type==="action"){if(id==="fullscreen"){if(
window.L.Browser.ie||window.L.Browser.edge){$(aItem).addClass("disabled")}else if(
_this._map.uiManager.isFullscreen()){$(aItem).addClass(constChecked)}else{$(aItem).removeClass(
constChecked)}}else if(id==="showruler"){if(_this._map.uiManager.isRulerVisible()){$(aItem
).addClass(constChecked)}else{$(aItem).removeClass(constChecked)}}else if(id=="toggledarktheme"){if(
window.prefs.getBoolean("darkTheme")){$(aItem).addClass(constChecked);$("#menu-invertbackground"
).show()}else{$(aItem).removeClass(constChecked);$("#menu-invertbackground").hide()}}else if(
id==="showstatusbar"){if(_this._map.uiManager.isStatusBarVisible()){$(aItem).addClass(constChecked)
}else{$(aItem).removeClass(constChecked)}}else if(id==="notesmode"){if(app.impress.notesMode)$(aItem
).addClass(constChecked);else $(aItem).removeClass(constChecked)}else if(id==="toggleuimode"){if(
_this._map.uiManager.shouldUseNotebookbarMode()){$(aItem).text(_("Use Compact view"))}else{$(aItem
).text(_("Use Tabbed view"))}}else if(id==="showslide"){if(!app.impress.isSlideHidden(
_this._map.getCurrentPartNumber()))$(aItem).hide();else $(aItem).show()}else if(id==="hideslide"){
if(app.impress.isSlideHidden(_this._map.getCurrentPartNumber()))$(aItem).hide();else $(aItem).show()
}else if(id==="togglea11ystate"){var enabled=window.prefs.getBoolean("accessibilityState");if(
enabled){$(aItem).addClass(constChecked)}else{$(aItem).removeClass(constChecked)}}else if(
_this._map.getDocType()==="presentation"&&(
id==="deletepage"||id==="insertpage"||id==="duplicatepage")){if(id==="deletepage"){
itemState=_this._map["stateChangeHandler"].getItemValue(".uno:DeletePage")}else if(id==="insertpage"
){itemState=_this._map["stateChangeHandler"].getItemValue(".uno:InsertPage")}else{
itemState=_this._map["stateChangeHandler"].getItemValue(".uno:DuplicatePage")}if(
itemState==="disabled"){$(aItem).addClass("disabled")}else{$(aItem).removeClass("disabled")}
}else if(id==="showannotations"){var section=app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name);if(section){itemState=_this._map["stateChangeHandler"].getItemValue(
"showannotations");if(itemState==="true")$(aItem).addClass(constChecked);else $(aItem).removeClass(
constChecked)}}else if(id==="showresolved"){var section=app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name);if(section){if(
section.sectionProperties.commentList.length===0||!section.sectionProperties.show){$(aItem
).addClass("disabled")}else if(section.sectionProperties.showResolved){$(aItem).removeClass(
"disabled");$(aItem).addClass(constChecked)}else{$(aItem).removeClass("disabled");$(aItem
).removeClass(constChecked)}}}else if(id==="acceptalltrackedchanges"||id==="rejectalltrackedchanges"
){itemState=_this._map["stateChangeHandler"].getItemValue(uno);if(itemState==="disabled"){$(aItem
).addClass("disabled")}else{$(aItem).removeClass("disabled")}}else if(id==="serveraudit"&&(
app.isAdminUser===false||!_this._map.serverAuditDialog)){$(aItem).css("display","none")}else if(
id==="columnrowhighlight"){itemState=app.map.uiManager.getHighlightMode();if(itemState)$(aItem
).addClass(constChecked);else $(aItem).removeClass(constChecked)}else{$(aItem).removeClass(
"disabled")}}if(id&&id.indexOf("zotero")>=0){if(window.zoteroEnabled&&_this._map.zotero)$(aItem
).show();else $(aItem).hide()}}else{if(type==="unocommand"){
var allowed=_this.options.allowedViewModeCommands.includes(uno);if(
!allowed&&app.isRedlineManagementAllowed()){
allowed=_this.options.allowedRedlineManagementModeCommands.includes(uno)}if(!allowed){$(aItem).hide(
)}else{var itemState=_this._map["stateChangeHandler"].getItemValue(uno);if(itemState==="disabled"){
$(aItem).addClass("disabled")}else{$(aItem).removeClass("disabled");if(itemState==="true")$(aItem
).addClass(constChecked);else $(aItem).removeClass(constChecked)}}}else if(type==="action"){
var allowed=false;for(var i in _this.options.allowedViewModeActions){
var action=_this.options.allowedViewModeActions[i];if(typeof action==="string"&&action===id){
allowed=true;break}else if(typeof action==="function"&&action()===id){allowed=true;break}}if(
!allowed&&app.isRedlineManagementAllowed()
)allowed=_this.options.allowedRedlineManagementModeActions.includes(id);if(id==="insertcomment"&&(
_this._map.getDocType()!=="drawing"&&!app.isCommentEditingAllowed()))allowed=false;if(
id==="serveraudit"&&(app.isAdminUser===false||!_this._map.serverAuditDialog))allowed=false;if(
!allowed){$(aItem).hide()}else if(uno!==undefined){itemState=_this._map["stateChangeHandler"
].getItemValue(uno);if(itemState==="disabled"){$(aItem).addClass("disabled")}else{$(aItem
).removeClass("disabled")}}}}if(id==="remotelink"){if(_this._map["wopi"].EnableRemoteLinkPicker)$(
aItem).show();else $(aItem).hide()}if(id==="remoteaicontent"){if(_this._map["wopi"
].EnableRemoteAIContent)$(aItem).show();else $(aItem).hide()}})};
Menubar.prototype._openInsertShapesWizard=function(){var content=window.createShapesPanel(
"insertshapes");var data={id:"insertshape",type:"",text:_("Insert Shape"),enabled:true,children:[]};
var container={id:"",type:"htmlcontrol",content:content,enabled:true};data.children.push(container);
this._map._docLayer._openMobileWizard(data)};Menubar.prototype._executeAction=function(itNode,
itWizard){var id,postmessage,type,command;if(itNode===undefined){id=itWizard.id;postmessage=false;
command=itWizard.command}else{id=$(itNode).data("id");type=$(itNode).data("type");postmessage=$(
itNode).data("postmessage")==="true";command=$(itNode).data("uno")}if(id==="save"){if(
!this._map.isReadOnlyMode()){this._map.fire("postMessage",{msgId:"UI_Save",args:{source:"filemenu"}}
);if(!this._map._disableDefaultAction["UI_Save"]){this._map.save(false,false)}}}else if(
id==="saveas"&&type!=="menu"){this._map.openSaveAs()}else if(id==="savecomments"){
app.dispatcher.dispatch("savecomments")}else if(id==="shareas"||id==="ShareAs"){
app.dispatcher.dispatch("shareas")}else if(id==="print"||id==="print-notespages"){
app.dispatcher.dispatch(id)}else if(id.startsWith("downloadas-")||id.startsWith("saveas-"
)||id.startsWith("export")||id==="renamedocument"||id.startsWith("zotero"
)||id==="deletepage"||id==="remotelink"||id==="remoteaicontent"||id==="toggledarktheme"||id==="invertbackground"||id==="home-search"||id==="print-active-sheet"||id==="print-all-sheets"||id==="serveraudit"
){app.dispatcher.dispatch(id)}else if(id==="settings-dialog"){this._map.settings.showSettingsDialog(
)}else if(id==="insertcomment"){this._map.insertComment()}else if(id==="insert-signatureline"){if(
this._map.eSignature){var args={External:{type:"boolean",value:true}};app.map.sendUnoCommand(
".uno:InsertSignatureLine",args);var finishMessage=_(
"The signature line can now be moved or resized as needed.");var finishFunc=function(){
return app.map.eSignature.insert()};app.map.uiManager.showSnackbar(finishMessage,_(
"Finish electronic signing"),finishFunc,-1)}else{app.map.sendUnoCommand(".uno:InsertSignatureLine")}
app.map._docLayer.requestNewFiledBasedViewTiles()}else if(id==="insertgraphic"){
window.L.DomUtil.get("insertgraphic").click()}else if(id==="insertgraphicremote"){this._map.fire(
"postMessage",{msgId:"UI_InsertGraphic"})}else if(id==="insertmultimedia"){window.L.DomUtil.get(
"insertmultimedia").click()}else if(id==="remotemultimedia"){this._map.fire("postMessage",{
msgId:"UI_InsertFile",args:{callback:"Action_InsertMultimedia",mimeTypeFilter:["video/MP2T",
"video/mp4","video/mpeg","video/ogg","video/quicktime","video/webm","video/x-matroska",
"video/x-ms-wmv","video/x-msvideo","audio/aac","audio/flac","audio/mp4","audio/mpeg","audio/ogg",
"audio/x-wav"]}})}else if(id==="selectbackground"){app.dispatcher.dispatch("selectbackground")
}else if(id==="zoomin"&&this._map.getZoom()<this._map.getMaxZoom()){app.dispatcher.dispatch("zoomin"
)}else if(id==="showannotations"){app.dispatcher.dispatch("showannotations")}else if(
id==="showresolved"){app.dispatcher.dispatch(".uno:ShowResolvedAnnotations")}else if(
id==="zoomout"&&this._map.getZoom()>this._map.getMinZoom()){app.dispatcher.dispatch("zoomout")
}else if(id==="zoomreset"){app.dispatcher.dispatch("zoomreset")}else if(id==="fullscreen"){
app.util.toggleFullScreen()}else if(id==="showruler"){app.dispatcher.dispatch("showruler")}else if(
id==="togglea11ystate"){app.dispatcher.dispatch("togglea11ystate")}else if(id==="toggleuimode"){
app.dispatcher.dispatch("toggleuimode")}else if(id==="showstatusbar"){app.dispatcher.dispatch(
"showstatusbar")}else if(id==="notesmode"){app.dispatcher.dispatch("notesmode")}else if(
id==="togglemenubar"){this._map.uiManager.toggleMenubar()}else if(id==="collapsenotebookbar"){
app.dispatcher.dispatch("collapsenotebookbar")}else if(
id==="fullscreen-presentation"&&this._map.getDocType()==="presentation"){app.dispatcher.dispatch(
"fullscreen-presentation")}else if(id==="presentation-currentslide"&&this._map.getDocType(
)==="presentation"){app.dispatcher.dispatch("presentation-currentslide")}else if(
id==="present-in-window"&&this._map.getDocType()==="presentation"){app.dispatcher.dispatch(
"present-in-window")}else if(id==="presentation-in-console"){app.dispatcher.dispatch(
"presenterconsole")}else if(id==="insertpage"){this._map.insertPage()}else if(id==="insertshape"){
this._openInsertShapesWizard()}else if(id==="duplicatepage"){this._map.duplicatePage()}else if(
id==="about"){this._map.showLOAboutDialog()}else if(id==="latestupdates"&&this._map.welcome){
this._map.welcome.showWelcomeDialog()}else if(id==="feedback"&&this._map.feedback){
this._map.feedback.showFeedbackDialog()}else if(id==="report-an-issue"){}else if(id==="forum"){}else if(id==="inserthyperlink"
){app.dispatcher.dispatch("hyperlinkdialog")}else if(id==="keyboard-shortcuts"||id==="online-help"){
this._map.showHelp(id+"-content")}else if(window.L.Params.revHistoryEnabled&&(
id==="rev-history"||id==="Rev-History"||id==="last-mod")){app.dispatcher.dispatch("rev-history")
}else if(id==="closedocument"){app.dispatcher.dispatch("closeapp")}else if(id==="repair"){
app.dispatcher.dispatch("repair")}else if(id==="searchdialog"){if(this._map.isReadOnlyMode()){$(
"#toolbar-down").hide();$("#toolbar-search").show();$("#mobile-edit-button").hide();
window.L.DomUtil.get("search-input").focus()}else{this._map.sendUnoCommand(".uno:SearchDialog")}
}else if(id==="inserttextbox"){this._map.sendUnoCommand(".uno:Text?CreateDirectly:bool=true")
}else if(id==="pagesetup"){this._map.sendUnoCommand(".uno:SidebarShow");this._map.sendUnoCommand(
".uno:LOKSidebarWriterPage");this._map.fire("showwizardsidebar",{noRefresh:true});
window.pageMobileWizard=true}else if(id==="showslide"){app.dispatcher.dispatch("showslide")}else if(
id==="hideslide"){app.dispatcher.dispatch("hideslide")}else if(id.indexOf("morelanguages-")!=-1){
this._map.fire("morelanguages",{applyto:id.substr("morelanguages-".length)})}else if(
id==="acceptalltrackedchanges"||id==="rejectalltrackedchanges"){app.dispatcher.dispatch(command)
}else if(id==="columnrowhighlight"){app.dispatcher.dispatch("columnrowhighlight")}if(postmessage
)this._map.fire("postMessage",{msgId:"Clicked_Button",args:{Id:id}})};
Menubar.prototype._sendCommand=function(item){var unoCommand=$(item).data("uno");if(
unoCommand.startsWith(".uno:InsertPageHeader")||unoCommand.startsWith(".uno:InsertPageFooter")){
unoCommand=unoCommand+($(item).hasClass("lo-menu-item-checked")?"On:bool=false":"On:bool=true")
}else if(unoCommand.startsWith(".uno:SlideMasterPage")){unoCommand=$(item).hasClass(
"lo-menu-item-checked")?".uno:CloseMasterView":".uno:SlideMasterPage"}else if(
this._map._clip&&this._map._clip.filterExecCopyPaste(unoCommand)){return}this._map.sendUnoCommand(
unoCommand)};Menubar.prototype._onItemSelected=function(e,item){if($(item).data("locked")===true
)return;var type=$(item).data("type");if(type==="unocommand"){this._sendCommand(item)}else if(
type==="action"){this._executeAction(item)}if(!window.mode.isMobile()&&$(item).data("id"
)!=="insertcomment"&&self&&this._map)this._map.focus()};Menubar.prototype._onKeyDown=function(e,self
){if(e.type==="keydown"&&!e.shiftKey&&!e.ctrlKey&&!e.altKey&&e.keyCode==112){self._map.showHelp(
"online-help-content")}};Menubar.prototype._createFileIcon=function(){
var liItem=window.L.DomUtil.create("li","");liItem.id="document-header";liItem.setAttribute("role",
"menuitem");var aItem=window.L.DomUtil.create("div","document-logo",liItem);$(aItem).data("id",
"document-logo");$(aItem).data("type","action");aItem.setAttribute("role","img");aItem.setAttribute(
"aria-label",_("file type icon"));if(this._menubarCont!=null)this._menubarCont.insertBefore(liItem,
this._menubarCont.firstChild);var $docLogo=$(aItem);$docLogo.bind("click",{self:this},
this._createDocument);$docLogo.bind("click",this._createDocument.bind(this))};
Menubar.prototype._checkItemVisibility=function(menuItem){if(
window.ThisIsAMobileApp&&menuItem.mobileapp===false){return false}if(
window.ThisIsTheiOSApp&&menuItem.iosapp===false){return false}if(
menuItem.id==="about"&&window.L.DomUtil.get("about-dialog")===null){return false}if(
menuItem.id==="fontworkgalleryfloater"&&!this._isFileODF){return false}if(this._map.isReadOnlyMode(
)&&menuItem.type==="menu"){var found=this.options.allowedReadonlyMenus.includes(menuItem.id);if(
!found&&app.isRedlineManagementAllowed())found=this.options.allowedRedlineManagementMenus.includes(
menuItem.id);if(!found)return false}if(this._map.isReadOnlyMode()){switch(menuItem.id){
case"last-mod":case"save":case"runmacro":case"pagesetup":case"watermark":case"properties":
case"formattingmarks":return false;case"insertcomment":case"savecomments":if(
!app.isCommentEditingAllowed()){return false}}}if(this._map.isEditMode()){switch(menuItem.id){
case"savecomments":return false}}if(menuItem.id==="runmacro"&&!window.enableMacrosExecution
)return false;if(menuItem.type==="action"){if((
menuItem.id==="rev-history"||menuItem.id==="Rev-History"
)&&!window.L.Params.revHistoryEnabled||menuItem.id==="closedocument"&&!window.L.Params.closeButtonEnabled||menuItem.id==="latestupdates"&&!window.enableWelcomeMessage
){return false}}if(menuItem.id==="print"&&this._map["wopi"].HidePrintOption)return false;if(
menuItem.id==="save"&&this._map["wopi"].HideSaveOption)return false;if(menuItem.id&&(
menuItem.id==="saveas"||menuItem.id.startsWith("saveas-"))&&this._map["wopi"
].UserCanNotWriteRelative)return false;if(menuItem.id&&menuItem.id.startsWith("exportas"
)&&this._map["wopi"].UserCanNotWriteRelative)return false;if(
menuItem.id&&menuItem.id==="exportpdf"&&window.ThisIsTheAndroidApp)return false;if((
menuItem.id==="shareas"||menuItem.id==="ShareAs")&&!this._map["wopi"].EnableShare)return false;if(
menuItem.id==="insertgraphicremote"&&!this._map["wopi"].EnableInsertRemoteImage)return false;if(
menuItem.id==="renamedocument"&&!(this._map["wopi"]._supportsRename()&&this._map["wopi"
].UserCanRename))return false;if(menuItem.id==="insertgraphic"&&this._map["wopi"
].DisableInsertLocalImage)return false;if(menuItem.id==="insertmultimedia"&&this._map["wopi"
].DisableInsertLocalImage)return false;if(menuItem.id==="remotemultimedia"&&!this._map["wopi"
].EnableInsertRemoteFile)return false;if(menuItem.id&&menuItem.id.startsWith(
"fullscreen-presentation")&&this._map["wopi"].HideExportOption)return false;if(
menuItem.id==="repair"&&this._map["wopi"].HideRepairOption)return false;if(
menuItem.id==="changesmenu"&&this._map["wopi"].HideChangeTrackingControls)return false;if(
menuItem.id==="invertbackground"&&!window.prefs.getBoolean("darkTheme"))return false;if(
menuItem.id&&menuItem.id.startsWith("downloadas-")){var format=menuItem.id.substring(
"downloadas-".length);var docType=this._map.getDocType();var extraFormats=docType==="presentation"?[
"swf","svg","bmp","gif","png","tiff"]:[];var appNames={presentation:"impress"};if(
extraFormats.includes(format)&&!window.extraExportFormats.includes(format+"_"+appNames[docType])){
return false}app.registerExportFormat(menuItem.name,format);if(this._map["wopi"].HideExportOption
)return false}if(menuItem.id&&menuItem.id.startsWith("export")){if(!menuItem.id.startsWith(
"exportas-")){var format=menuItem.id.substring("export".length);app.registerExportFormat(
menuItem.name,format)}if(this._map["wopi"].HideExportOption)return false}if(
this._hiddenItems&&$.inArray(menuItem.id,this._hiddenItems)!==-1)return false;if(
menuItem.id==="settings-dialog"&&!window.wopiSettingBaseUrl)return false;return true};
Menubar.prototype._createMenu=function(menu){var itemList=[];var docType=this._map.getDocType();
var isReadOnly=this._map.isReadOnlyMode();if(isReadOnly&&!app.file.editComment){
this._hiddenItems.push("insert")}if(!window.documentSigningEnabled){this._hiddenItems.push(
"signature")}for(var i in menu){if(this._checkItemVisibility(menu[i])===false)continue;
var liItem=window.L.DomUtil.create("li","");liItem.setAttribute("role","menuitem");if(menu[i].id){
liItem.id="menu-"+menu[i].id;if(menu[i].id==="closedocument"&&this._map.isReadOnlyMode()){
window.L.DomUtil.addClass(liItem,"readonly")}}var aItem=window.L.DomUtil.create("a",menu[i
].disabled?"disabled":"",liItem);if(menu[i].name!==undefined){aItem.innerHTML=menu[i].name}else if(
menu[i].uno!==undefined){aItem.innerHTML=_UNO(menu[i].uno,docType)}else{aItem.replaceChildren()}if(
menu[i].uno&&(JSDialog.ShortcutsUtil.hasShortcut(menu[i].uno)||JSDialog.ShortcutsUtil.hasShortcut(
menu[i].id))){aItem.innerHTML=JSDialog.ShortcutsUtil.getShortcut(aItem.innerHTML,menu[i].uno?menu[i
].uno:menu[i].id)}if(menu[i].type==="menu"){var ulItem=window.L.DomUtil.create("ul","",liItem);
var subitemList=this._createMenu(menu[i].menu);if(!subitemList.length){continue}for(
var idx in subitemList){ulItem.appendChild(subitemList[idx])}aItem.tabIndex=0}else if(menu[i
].type==="unocommand"||!menu[i].type&&menu[i].uno!==undefined){$(aItem).data("type","unocommand");$(
aItem).data("uno",menu[i].uno);$(aItem).data("tag",menu[i].tag);aItem.tabIndex=0}else if(menu[i
].type==="separator"){$(aItem).addClass("separator");aItem.tabIndex=-1}else if(menu[i
].type==="action"){if(menu[i].id=="feedback"&&!this._map.feedback)continue;$(aItem).data("type",
"action");$(aItem).data("id",menu[i].id);if(menu[i].uno!==undefined)$(aItem).data("uno",menu[i].uno)
aItem.tabIndex=0}if(menu[i].hidden==true)$(aItem).css("display","none");if(menu[i
].tablet==false&&window.mode.isTablet()){$(aItem).css("display","none")}if(
this._hiddenItems&&$.inArray(menu[i].id,this._hiddenItems)!==-1){$(aItem).css("display","none")}
this._map.hideRestrictedItems(menu[i],aItem,aItem);this._map.disableLockedItem(menu[i],aItem,aItem);
itemList.push(liItem)}return itemList};Menubar.prototype._getItems=function(){if(
this._menubarCont==null)return null;var $cont=$(this._menubarCont);return $cont.children().children(
"ul").children("li").add($cont.children("li"))};Menubar.prototype._getItem=function(targetId){
var items=this._getItems();if(items==null)return null;var found=$(items).filter(function(_,item){
var id=$(item).attr("id");if(id&&id=="menu-"+targetId){return true}return false});
return found.length?found:null};Menubar.prototype.hasItem=function(targetId){return this._getItem(
targetId)!=null};Menubar.prototype.hideItem=function(targetId){var item=this._getItem(targetId);if(
item){if($.inArray(targetId,this._hiddenItems)==-1)this._hiddenItems.push(targetId);$(item).css(
"display","none");return true}else{return false}};Menubar.prototype.showItem=function(targetId){
var item=this._getItem(targetId);if(item){if($.inArray(targetId,this._hiddenItems)!==-1
)this._hiddenItems.splice(this._hiddenItems.indexOf(targetId),1);$(item).css("display","");
return true}else{return false}};Menubar.prototype._getItemsForCommand=function(commandId){
var items=this._getItems();if(items==null)return null;var found=$(items).filter(function(){
var item=$(this.children[0]);var type=item.data("type");var id=null;if(type=="unocommand"){id=$(item
).data("uno")}else if(type=="action"){id=$(item).data("id")}if(id&&id==commandId){return true}
return false});return found.length?found:null};Menubar.prototype.hideUnoItem=function(targetId){
var _this=this;var items=this._getItemsForCommand(targetId);if(items){$(items).each(function(_,item
){if($.inArray(item.id,_this._hiddenItems)==-1){_this._hiddenItems.push(item.id)}});$(items).css(
"display","none");return true}return false};Menubar.prototype.showUnoItem=function(targetId){
var _this=this;var items=this._getItemsForCommand(targetId);if(items){$(items).each(function(_,item
){if($.inArray(item.id,_this._hiddenItems)!==-1){_this._hiddenItems.splice(
_this._hiddenItems.indexOf(item.id),1)}});$(items).css("display","");return true}return false};
Menubar.prototype._initializeMenu=function(menu){var _a;this._isFileODF=app.LOUtil.isFileODF(
this._map);var menuHtml=this._createMenu(menu);for(var i in menuHtml){(_a=this._menubarCont
)===null||_a===void 0?void 0:_a.appendChild(menuHtml[i])}};
Menubar.prototype.generateFullMenuStructure=function(){var topMenu={type:"menubar",enabled:true,
id:"menubar",children:[]};var docType="mobile"+this._map.getDocType();var items=this.options[docType
];if(!Array.isArray(items))return topMenu;for(var i=0;i<items.length;i++){if(
this._checkItemVisibility(items[i])===true){var item=this._generateMenuStructure(items[i],docType,
false);if(item)topMenu.children.push(item)}}return topMenu};
Menubar.prototype.generateInsertMenuStructure=function(){var docType=this._map.getDocType();
var target=this.options["mobileInsertMenu"][docType];var menuStructure=this._generateMenuStructure(
target,docType,true);return menuStructure};Menubar.prototype._generateMenuStructure=function(item,
docType,mainMenu){var itemType;if(mainMenu){itemType="mainmenu"}else{if(
item.mobileapp==true&&!window.ThisIsAMobileApp)return undefined;if(
item.mobileapp===false&&window.ThisIsAMobileApp)return undefined;if(!item.menu){itemType="menuitem"
}else{itemType="submenu"}}if(item.id==="feedback"&&!this._map.feedback)return undefined;var itemName
if(item.name)itemName=item.name;else if(item.uno)itemName=_UNO(item.uno,docType
);else return undefined;var menuStructure={id:item.id,type:itemType,enabled:!item.disabled,
text:itemName,command:item.uno,executionType:item.type,data:item,checked:false,children:[]};
var insertHeaderString=".uno:InsertPageHeader?PageStyle:string=";
var insertFooterString=".uno:InsertPageFooter?PageStyle:string=";if(item.uno&&(item.uno.startsWith(
insertHeaderString)||item.uno.startsWith(insertFooterString))){var style=decodeURIComponent(
item.uno.slice(item.uno.search("=")+1));style=style.slice(0,style.length-1);
var shortUno=item.uno.slice(0,item.uno.search("\\?"));var state=this._map["stateChangeHandler"
].getItemValue(shortUno);if(state&&state[style]){menuStructure["checked"]=true}}else if(
item.uno===".uno:TrackChanges"||item.uno===".uno:ShowTrackedChanges"||item.uno===".uno:ControlCodes"||item.uno===".uno:SpellOnline"||item.uno===".uno:ShowResolvedAnnotations"||item.uno===".uno:FreezePanes"
){if(this._map["stateChangeHandler"].getItemValue(item.uno)==="true"){menuStructure["checked"]=true}
}else if(item.id==="togglea11ystate"){if(window.prefs.getBoolean("accessibilityState")
)menuStructure["checked"]=true}else if(item.id==="toggledarktheme"&&window.prefs.getBoolean(
"darkTheme")){menuStructure["checked"]=true}else if(
item.id==="invertbackground"&&window.prefs.getBoolean("darkTheme")){menuStructure["checked"
]=!this._map.uiManager.isBackgroundDark()}if(item.menu){for(var i=0;i<item.menu.length;i++){if(
this._checkItemVisibility(item.menu[i])===true){var element=this._generateMenuStructure(item.menu[i]
,docType,false);if(element)menuStructure["children"].push(element)}}}return menuStructure};
Menubar.prototype._findSubMenuByName=function(menuTarget,nameString){if(menuTarget.name===nameString
)return menuTarget;if(menuTarget.menu){for(var i=0;i<menuTarget.menu.length;i++){
var foundItem=this._findSubMenuByName(menuTarget.menu[i],nameString);if(foundItem)return foundItem}}
return null};Menubar.prototype._onInitModificationIndicator=function(lastmodtime){
var lastModButton=window.L.DomUtil.get("menu-last-mod");if(
lastModButton!==null&&lastModButton!==undefined&&lastModButton.firstChild&&lastModButton.firstChild.innerHTML!==null&&lastModButton.firstChild.childElementCount==0
){if(lastmodtime==null){window.L.DomUtil.setStyle(lastModButton,"display","none");return}
var mainSpan=document.createElement("span");this.lastModIndicator=document.createElement("span");
mainSpan.appendChild(this.lastModIndicator);lastModButton.firstChild.replaceChildren();
lastModButton.firstChild.appendChild(mainSpan);if(window.L.Params.revHistoryEnabled){
window.L.DomUtil.setStyle(lastModButton,"cursor","pointer")}this._map.fire(
"modificationindicatorinitialized")}};Menubar.prototype._onUpdateModificationIndicator=function(e){
if(this.lastModIndicator!==null&&this.lastModIndicator!==undefined){
this.lastModIndicator.textContent=e.lastSaved}};return Menubar}(window.L.Control);
window.L.Control.Tabs=window.L.Control.extend({onAdd:function(){app.events.on("updatepermission",
this._onUpdatePermission.bind(this));this._initialized=false},_onUpdatePermission:function(e){if(
this._map.getDocType()!=="spreadsheet"){return}if(!this._initialized){this._initialize()}setTimeout(
function(){$(".spreadsheet-tab").contextMenu(e.detail.perm==="edit")},100)},_initialize:function(){
this._initialized=true;this._spreadsheetTabs={};this._tabForContextMenu=0;var map=this._map;
var tableCell=document.getElementById("spreadsheet-toolbar");this._tabsCont=window.L.DomUtil.create(
"div","spreadsheet-tabs-container",tableCell);function areTabsMultiple(){var numItems=$(
".spreadsheet-tab").length;if(numItems===1){return false}return true}this._menuItem={
insertsheetbefore:{name:app.IconUtil.createMenuItemLink(_("Insert sheet before this"),
"InsertSheetBefore"),isHtmlName:true,callback:this._insertSheetBefore.bind(this)},insertsheetafter:{
name:app.IconUtil.createMenuItemLink(_("Insert sheet after this"),"InsertSheetAfter"),
isHtmlName:true,callback:this._insertSheetAfter.bind(this)},".uno:Remove":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:Remove","spreadsheet",true),"Remove"),
isHtmlName:true,callback:this._deleteSheet.bind(this),visible:function(){return areTabsMultiple(
)&&!this._isProtectedSheet(this._tabForContextMenu)}.bind(this)},".uno:Name":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:RenameTable","spreadsheet",true),"Name"),
callback:this._renameSheet.bind(this),visible:function(){return!this._isProtectedSheet(
this._tabForContextMenu)}.bind(this)},".uno:Protect":{name:app.IconUtil.createMenuItemLink(_UNO(
".uno:Protect","spreadsheet",true),"Protect"),isHtmlName:true,callback:this._protectSheet.bind(this)
},".uno:Show":{name:app.IconUtil.createMenuItemLink(_UNO(".uno:Show","spreadsheet",true),"Show"),
isHtmlName:true,callback:this._showSheet.bind(this),visible:function(){
return app.calc.isAnyPartHidden()}},".uno:Hide":{name:app.IconUtil.createMenuItemLink(_UNO(
".uno:Hide","spreadsheet",true),"Hide"),isHtmlName:true,callback:this._hideSheet.bind(this),
visible:areTabsMultiple},movesheetleft:{name:app.IconUtil.createMenuItemLink(_("Move Sheet Left"),
"MoveSheetLeft"),isHtmlName:true,callback:this._moveSheetLeft.bind(this),visible:areTabsMultiple},
movesheetright:{name:app.IconUtil.createMenuItemLink(_("Move Sheet Right"),"MoveSheetRight"),
isHtmlName:true,callback:this._moveSheetRight.bind(this),visible:areTabsMultiple},".uno:Move":{
name:app.IconUtil.createMenuItemLink(_UNO(".uno:Move","spreadsheet",true),"Move"),
callback:this._moveOrCopySheet.bind(this),visible:areTabsMultiple},".uno:CopyTab":{
name:app.IconUtil.createMenuItemLink(_("Copy Sheet..."),"CopyTab"),isHtmlName:true,
callback:function(){this._map.sendUnoCommand(".uno:Move")}.bind(this),visible:function(){
return!areTabsMultiple()}}};if(!window.mode.isMobile()&&!this._map.isReadOnlyMode(
)||window.mode.isTablet()){window.L.installContextMenu({selector:".spreadsheet-tab",
className:"cool-font",items:this._menuItem,zIndex:1e3})}map.on("updateparts",this._updateDisabled,
this)},_updateDisabled:function(e){var parts=e.parts;var selectedPart=e.selectedPart;
var docType=e.docType;if(docType==="text"){return}if(docType==="spreadsheet"){var horizScrollPos=0;
var scrollDiv=window.L.DomUtil.get("spreadsheet-tab-scroll");if(scrollDiv){
horizScrollPos=scrollDiv.scrollLeft}if("partNames"in e){while(this._tabsCont.firstChild){
this._tabsCont.removeChild(this._tabsCont.firstChild)}var ssTabScroll=window.L.DomUtil.create("div",
"spreadsheet-tab-scroll",this._tabsCont);ssTabScroll.id="spreadsheet-tab-scroll";if(
!window.mode.isMobile())ssTabScroll.style.overflowX="scroll";this._tabsCont.style.display="grid";
var menuItemMobile={};Object.assign(menuItemMobile,{insertsheetbefore:this._menuItem[
"insertsheetbefore"],insertsheetafter:this._menuItem["insertsheetafter"],Name:this._menuItem[
".uno:Name"]});if(app.calc.isAnyPartHidden()){Object.assign(menuItemMobile,{Show:this._menuItem[
".uno:Show"]})}if(app.calc.getVisiblePartCount()!==1){Object.assign(menuItemMobile,{
Remove:this._menuItem[".uno:Remove"],Hide:this._menuItem[".uno:Hide"],movesheetleft:this._menuItem[
"movesheetleft"],movesheetright:this._menuItem["movesheetright"],Move:this._menuItem[".uno:Move"]})
}else{Object.assign(menuItemMobile,{CopyTab:this._menuItem[".uno:CopyTab"]})}if(
window.mode.isMobile()){
var menuData=window.L.Control.JSDialogBuilder.getMenuStructureForMobileWizard(menuItemMobile,true,""
)}for(var i=0;i<parts;i++){if(app.calc.isPartHidden(i))continue;
var dropZoneIndicator=window.L.DomUtil.create("div","tab-drop-area",ssTabScroll);
dropZoneIndicator.id="drop-zone-"+i;var id="spreadsheet-tab"+i;var tab=window.L.DomUtil.create(
"button","spreadsheet-tab",ssTabScroll);window.L.DomUtil.create("div","lock",tab);
var label=window.L.DomUtil.create("div","",tab);if(window.mode.isMobile()||window.mode.isTablet()){
new Hammer(tab,{recognizers:[[Hammer.Press]]}).on("press",function(j){return function(e){
this._tabForContextMenu=j;if(!this._map.isReadOnlyMode()){if(window.mode.isMobile()){
window.contextMenuWizard=true;this._map.fire("mobilewizard",{data:menuData})}else{$(e.target
).trigger("contextmenu")}}}}(i).bind(this))}if(!scrollDiv&&i===selectedPart){
horizScrollPos=tab.offsetLeft}if(!window.mode.isMobile()){window.L.DomEvent.on(tab,"dblclick",
function(j){return function(){this._tabForContextMenu=j;this._renameSheet()}}(i).bind(this));
window.L.DomEvent.on(tab,"contextmenu",function(j){return function(){this._tabForContextMenu=j}}(i
).bind(this))}if(app.calc.isPartProtected(i)){window.L.DomUtil.addClass(tab,
"spreadsheet-tab-protected")}else{window.L.DomUtil.removeClass(tab,"spreadsheet-tab-protected")}
label.textContent=e.partNames[i];tab.id=id;window.L.DomEvent.on(tab,"click",
window.L.DomEvent.stopPropagation).on(tab,"click",window.L.DomEvent.stop).on(tab,"click",
this._setPart,this).on(tab,"click",this._map.focus,this._map);this._addDnDHandlers(tab);
this._spreadsheetTabs[id]=tab}var dropZoneIndicatorForTheLastTab=window.L.DomUtil.create("div",
"tab-drop-area",ssTabScroll);dropZoneIndicatorForTheLastTab.id="drop-zone-end";
var dropZoneEndContainer=window.L.DomUtil.create("div","",ssTabScroll);
dropZoneEndContainer.id="drop-zone-end-container";this._addDnDHandlers(dropZoneEndContainer);
dropZoneEndContainer.setAttribute("draggable",false)}for(var key in this._spreadsheetTabs){
var part=parseInt(key.match(/\d+/g)[0]);window.L.DomUtil.removeClass(this._spreadsheetTabs[key],
"spreadsheet-tab-selected");if(part===selectedPart){this._map.fire("closeAutoFilterDialog");
this._map.fire("closepopups");window.L.DomUtil.addClass(this._spreadsheetTabs[key],
"spreadsheet-tab-selected")}}scrollDiv=window.L.DomUtil.get("spreadsheet-tab-scroll");if(scrollDiv){
if(this._map.insertPage&&this._map.insertPage.scrollToEnd){this._map.insertPage.scrollToEnd=false;
scrollDiv.scrollLeft=scrollDiv.scrollWidth}else{scrollDiv.scrollLeft=horizScrollPos}}}},
_addDnDHandlers:function(element){if(!this._map.isReadOnlyMode()){element.setAttribute("draggable",
true);element.addEventListener("dragstart",this._handleDragStart.bind(this),false);
element.addEventListener("dragenter",this._handleDragEnter,false);element.addEventListener(
"dragover",this._handleDragOver,false);element.addEventListener("dragleave",this._handleDragLeave,
false);element.addEventListener("drop",this._handleDrop.bind(this),false);element.addEventListener(
"dragend",this._handleDragEnd,false)}},_setPartIndex:function(index){if(cool.Comment.isAnyEdit()){
cool.CommentSection.showCommentEditingWarning();return true}this._map._docLayer._clearReferences();
this._map.setPart(index,false,true)},_setPart:function(e){var part=e.currentTarget.id.match(/\d+/g)[
0];if(part==null){return}part=parseInt(part);if(part!==this._map._docLayer._selectedPart){
this._setPartIndex(part)}},_moveSheet:function(newIndex){
var currentTab=this._map.getCurrentPartNumber();
var newIndexZeroBased=newIndex>currentTab?newIndex-2:newIndex-1;
this._map._docLayer._sheetSwitch.updateOnSheetMoved(currentTab,newIndexZeroBased);
this._map.sendUnoCommand(".uno:Move?Copy:bool=false&UseCurrentDocument:bool=true&Index="+newIndex)},
_moveOrCopySheet:function(){var contextMenuTab=this._tabForContextMenu;this._map.sendUnoCommand(
".uno:Move?FromContextMenu:bool=true&MoveOrCopySheetDialog:bool=true&ContextMenuIndex="+contextMenuTab
)},_moveSheetLR:function(contextMenuTab,newIndex){if(contextMenuTab!==undefined&&contextMenuTab>=0
)this._map.sendUnoCommand(
".uno:Move?Copy:bool=false&UseCurrentDocument:bool=true&FromContextMenu:bool=true&ContextMenuIndex="+contextMenuTab+"&Index="+newIndex
)},_moveSheetLeft:function(){var contextMenuTab=this._tabForContextMenu;if(contextMenuTab<=0)return;
this._map._docLayer._sheetSwitch.updateOnSheetMoved(contextMenuTab,contextMenuTab-1);
this._moveSheetLR(contextMenuTab,contextMenuTab)},_moveSheetRight:function(){
var contextMenuTab=this._tabForContextMenu;this._map._docLayer._sheetSwitch.updateOnSheetMoved(
contextMenuTab,contextMenuTab+1);this._moveSheetLR(contextMenuTab,contextMenuTab+3)},
_insertSheetBefore:function(){this._map.insertPage(this._tabForContextMenu)},
_insertSheetAfter:function(){this._map.insertPage(this._tabForContextMenu+1)},_deleteSheet:function(
){var nPos=this._tabForContextMenu;var message=_("Are you sure you want to delete sheet, {sheet}?"
).replace("{sheet}",$("#spreadsheet-tab"+this._tabForContextMenu).text());
this._map.uiManager.showInfoModal("delete-sheet-modal","",message,"",_("OK"),function(){
this._map.deletePage(nPos)}.bind(this),true,"delete-sheet-modal-response")},_renameSheet:function(){
var map=this._map;var nPos=this._tabForContextMenu;var tabName=$(
"#spreadsheet-tab"+this._tabForContextMenu).text();this._map.uiManager.showInputModal(
"rename-calc-sheet",_("Rename sheet"),_("Enter new sheet name"),tabName,_("OK"),function(value){
map.renamePage(value,nPos)})},_protectSheet:function(){if(!this._setPartIndex(
this._tabForContextMenu)){this._map.sendUnoCommand(".uno:Protect")}},_isProtectedSheet:function(idx
){var tab=window.L.DomUtil.get("spreadsheet-tab"+idx);return tab&&window.L.DomUtil.hasClass(tab,
"spreadsheet-tab-protected")},_showSheet:function(){this._map.showPage()},_hideSheet:function(){
this._map.hidePage(this._tabForContextMenu)},_handleDragStart:function(e){this._setPart(e);
e.dataTransfer.effectAllowed="move"},_handleDragEnter:function(){},_handleDragOver:function(e){if(
e.preventDefault){e.preventDefault()}e.dataTransfer.dropEffect="move";
e.currentTarget.previousElementSibling.classList.add("tab-drop-area-active");return false},
_handleDragLeave:function(e){if($(e.target).hasClass("spreadsheet-tab")||e.target.getAttribute("id"
)=="drop-zone-end-container")e.currentTarget.previousElementSibling.classList.remove(
"tab-drop-area-active")},_handleDrop:function(e){if(e.stopPropagation){e.stopPropagation()}
e.currentTarget.previousElementSibling.classList.remove("tab-drop-area-active");
var targetIndex=this._map._docLayer._partNames.indexOf(e.target.innerText);this._moveSheet(
targetIndex+1)},_handleDragEnd:function(e){e.currentTarget.previousElementSibling.classList.remove(
"tab-drop-area-active")}});window.L.control.tabs=function(options){return new window.L.Control.Tabs(
options)};window.L.Control.PermissionSwitch=window.L.Control.extend({options:{position:"topleft"},
onAdd:function(){var partName="leaflet-control-editviewswitch",container=window.L.DomUtil.create(
"label",partName+" leaflet-bar");this._checkBox=window.L.DomUtil.create("input","editview-cb",
container);this._checkBox.type="checkbox";window.L.DomEvent.on(this._checkBox,"change",
this._onChange,this);app.events.on("updatepermission",this._onUpdatePermission.bind(this));
container.appendChild(document.createTextNode("Enable editing"));return container},
_onChange:function(){if(this._checkBox.checked){this._map.setPermission("edit")}else{
this._map.setPermission("view")}this._map.focus()},_onUpdatePermission:function(e){if(
e.detail.perm==="edit"){this._checkBox.checked=true;this._checkBox.disabled=false}else if(
e.detail.perm==="view"){this._checkBox.checked=false;this._checkBox.disabled=false}else if(
e.detail.perm==="readonly"){this._checkBox.checked=false;this._checkBox.disabled=true}}});
window.L.control.permissionSwitch=function(options){return new window.L.Control.PermissionSwitch(
options)};window.L.Control.Selection=window.L.Control.extend({options:{position:"topleft"},
onAdd:function(){var partName="leaflet-control-editviewswitch",container=window.L.DomUtil.create(
"label",partName+" leaflet-bar");this._checkBox=window.L.DomUtil.create("input","editview-cb",
container);this._checkBox.type="checkbox";window.L.DomEvent.on(this._checkBox,"change",
this._onChange,this);app.events.on("updatepermission",this._onUpdatePermission.bind(this));
container.appendChild(document.createTextNode("Enable Selection"));return container},
_onChange:function(){this._map.focus()},_onUpdatePermission:function(e){if(e.detail.perm==="edit"){
this._checkBox.checked=false;this._checkBox.disabled=true}else if(e.detail.perm==="view"){
this._checkBox.checked=false;this._checkBox.disabled=false}else if(e.detail.perm==="readonly"){
this._checkBox.checked=false;this._checkBox.disabled=false}}});window.L.control.selection=function(
options){return new window.L.Control.Selection(options)};var ClientAuditor=function(){
function ClientAuditor(){}ClientAuditor.checkPostMessages=function(entries){if(
window.WOPIPostmessageReady)entries.push({code:"postmessage",status:"ok"});else entries.push({
code:"postmessage",status:"hostnotready"})};ClientAuditor.checkProxyProtocol=function(entries){if(
window.socketProxy)entries.push({code:"proxy",status:"slow"});else entries.push({code:"proxy",
status:"ok"})};ClientAuditor.performClientAudit=function(){var entries=new Array;
ClientAuditor.checkPostMessages(entries);ClientAuditor.checkProxyProtocol(entries);return entries};
return ClientAuditor}();var ServerAuditDialog=function(){function ServerAuditDialog(map){
this.id="ServerAuditDialog";this.map=map;this.map.on("receivedserveraudit",this.onServerAudit.bind(
this),this);this.errorCodes={certwarning:{priority:1,sslverifyfail:[_(
"Your WOPI server is not secure: SSL verification failed"),"SDK: ssl-configuration",
""],ok:[_("No problems with SSL verification detected"),"SDK: ssl-configuration",
""]},contained:{priority:2,uncontained:[_(
"Documents are not effectively contained: missing capabilities or namespaces."),"SDK: nocaps",""],
ok:[_("Each document is securely contained"),"SDK: nocaps",""]},seccomp:{priority:3,none:[_(
"BPF filtering of potentially risky system calls (seccomp) is not enabled; a security hazard."),
"SDK: seccomp",""],ok:[_("system call security filtering enabled"),"SDK: seccomp",""]},
hardwarewarning:{priority:10,lowresources:[_(
"Your server is configured with insufficient hardware resources, which may lead to poor performance."
),"SDK: hardware-requirements",
""],ok:[_(
"Hardware resources are sufficient for optimal performance"),"SDK: hardware-requirements",
""]},bindmounted:{
priority:11,slow:[_("Slow Kit jail setup with copying, cannot bind-mount."),"SDK: bindmount",""],
ok:[_("Fast kit jail bind mounting enabled"),"SDK: bindmount",""]},proxy:{priority:12,slow:[_(
"Poorly performing proxying of all network requests."),"",""],ok:[_("direct network connection"),"",
""]},is_admin:{priority:20,missing:[_("The IsAdminUser property is not set by integration"),
"SDK: IsAdminUser",
""],deprecated:[_("Used deprecated is_admin field, integration should use IsAdminUser property instead")
,"SDK: IsAdminUser",
""],ok:[_("The IsAdminUser user property is set by integration"),"SDK: IsAdminUser",
""]},postmessage:{priority:21,ok:[_("PostMessage API is initialized"),
"SDK: post-message-initialization",
""],hostnotready:[_(
"Integrator is not ready for PostMessage calls"),"SDK: post-message-initialization",
""]},info_namespaces:{
priority:30,true:[_("Using namespaces."),"SDK: nocaps",""],false:[_("Not using namespaces"),
"SDK: nocaps",""]}}}ServerAuditDialog.prototype.open=function(){var serverEntries=this.getEntries(
app.serverAudit);var clientEntries=this.getEntries(ClientAuditor.performClientAudit());
var allEntries=serverEntries.concat(clientEntries);var dialogBuildEvent={data:this.getJSON(
allEntries),callback:this.callback.bind(this)};this.map.fire(window.mode.isMobile(
)?"mobilewizard":"jsdialog",dialogBuildEvent)};ServerAuditDialog.prototype.getEntries=function(
sourceUnsorted){var _this=this;var entries=new Array;if(!sourceUnsorted)return entries;
var errorIcon={collapsed:"serverauditerror.svg"};var okIcon={collapsed:"serverauditok.svg"};
var source=sourceUnsorted.sort(function(x,y){return(_this.errorCodes[x.code]?_this.errorCodes[x.code
].priority:100)-(_this.errorCodes[y.code]?_this.errorCodes[y.code].priority:100)});source.forEach(
function(entry){var found=_this.errorCodes[entry.code];if(found){var status_1=found[entry.status];
if(status_1){entries.push({row:0,columns:[entry.status==="ok"||_this.isInfoEntry(entry
)?okIcon:errorIcon,{text:status_1[0]},status_1[1]&&status_1[2]?{text:status_1[1],link:status_1[2]}:{
text:""}]})}}else if(_this.isInfoEntry(entry)){if(entry.code==="info_setup_ms"){
var ms=Number.parseInt(entry.status);var good=ms<3e3;entries.push({row:0,columns:[
good?okIcon:errorIcon,{text:_("Document container started in")},{text:entry.status+" ms"}]})
}else console.warn("Unknown server audit info: "+entry.code)}else{console.warn(
"Unknown server audit entry: "+entry.code)}});return entries};
ServerAuditDialog.prototype.hasErrors=function(){var _this=this;var hasErrors=false;if(
app.serverAudit){app.serverAudit.forEach(function(entry){if(_this.isErrorEntry(entry))hasErrors=true
})}if(app.clientAudit){app.clientAudit.forEach(function(entry){if(entry.status!=="ok")hasErrors=true
})}return hasErrors};ServerAuditDialog.prototype.countErrors=function(){var _this=this;var _a,_b,_c,
_d;return((_b=(_a=app.serverAudit)===null||_a===void 0?void 0:_a.filter(function(entry){
return _this.isErrorEntry(entry)}).length)!==null&&_b!==void 0?_b:0)+((_d=(_c=app.clientAudit
)===null||_c===void 0?void 0:_c.filter(function(entry){return entry.status!=="ok"}).length
)!==null&&_d!==void 0?_d:0)};ServerAuditDialog.prototype.getJSON=function(entries){
var hasErrors=this.hasErrors();var countErrors=this.countErrors();return{id:this.id,
dialogid:this.id,type:"dialog",text:_("Server audit"),title:_("Server audit"),jsontype:"dialog",
responses:[{id:"ok",response:1}],children:[{id:this.id+"-mainbox",type:"container",vertical:true,
children:[{id:"auditlist",type:"treelistbox",headers:[{text:_("Status"),sortable:false},{text:_(
"Help"),sortable:false}],entries:entries,enabled:entries.length>0},!hasErrors?{id:"auditsuccess",
type:"fixedtext",text:_("No issues found")}:{id:"auditerror",type:"fixedtext",text:_("Alerts:"
)+" "+countErrors},{id:this.id+"-buttonbox",type:"buttonbox",children:[{id:"ok",type:"pushbutton",
text:_("OK")}],layoutstyle:"end"}]}]}};ServerAuditDialog.prototype.close=function(){var closeEvent={
data:{action:"close",id:this.id}};this.map.fire(window.mode.isMobile(
)?"closemobilewizard":"jsdialog",closeEvent)};ServerAuditDialog.prototype.isInfoEntry=function(entry
){return entry.code.startsWith("info_")};ServerAuditDialog.prototype.isErrorEntry=function(entry){
return!this.isInfoEntry(entry)&&entry.status!=="ok"};
ServerAuditDialog.prototype.onServerAudit=function(){var _this=this;if(app.serverAudit.length){
var hasErrors_1=false;app.serverAudit.forEach(function(entry){if(_this.isErrorEntry(entry)
)hasErrors_1=true});if(hasErrors_1&&app.isAdminUser){this.map.uiManager.showSnackbar(_(
"Check security warnings of your server"),_("OPEN"),this.open.bind(this))}}};
ServerAuditDialog.prototype.callback=function(objectType,eventType,object,data,builder){if(
eventType==="response"||object.id==="ok")this.close()};return ServerAuditDialog}();
JSDialog.serverAuditDialog=function(map){return new ServerAuditDialog(map)};window.L.WinUtil={};
var firstTouchPositionX=null;var firstTouchPositionY=null;var previousTouchType=null;
function updateTransformation(target){if(target!==null&&target!==undefined){var value=[
"translate3d("+target.transformation.translate.x+"px, "+target.transformation.translate.y+"px, 0)",
"scale("+target.transformation.scale+", "+target.transformation.scale+")"];value=value.join(" ");
target.value.style.webkitTransform=value;target.value.style.mozTransform=value;
target.value.style.transform=value;if(target.transformation.origin){target.value.style[
window.L.DomUtil.TRANSFORM_ORIGIN]=target.transformation.origin}}}var draggedObject=null;
var zoomTargets=[];function findZoomTarget(id){for(var item in zoomTargets){if(zoomTargets[item
].key===id||zoomTargets[item].titlebar.id===id){return zoomTargets[item]}}return null}
function removeZoomTarget(id){for(var item in zoomTargets){if(zoomTargets[item
].key===id||zoomTargets[item].titlebar.id===id){delete zoomTargets[item]}}}function toZoomTargetId(
id){return id.replace("-canvas","")}window.L.Control.LokDialog=window.L.Control.extend({
dialogIdPrefix:"lokdialog-",hasDialogInMobilePanelOpened:function(){
return window.mobileDialogId!==undefined},onPan:function(ev){if(!draggedObject)return;
var id=toZoomTargetId(draggedObject.id);var target=findZoomTarget(id);if(target){
var newX=target.initialState.startX+ev.deltaX;var newY=target.initialState.startY+ev.deltaY;if(
window.mode.isDesktop()&&(
newX<-target.width/2||newY<-target.height/2||newX>window.innerWidth-target.width/2||newY>window.innerHeight-target.height/2
)){var dialog=$(".lokdialog_container");var left=parseFloat(dialog.css("left"));var top=parseFloat(
dialog.css("top"));newX=Math.max(newX,-left);newY=Math.max(newY,-top)}
target.transformation.translate={x:newX,y:newY};target.transformation.translate={x:newX,y:newY};
updateTransformation(target)}},onPinch:function(ev){var id=toZoomTargetId(ev.target.id);
var target=findZoomTarget(id);if(target){if(ev.type=="pinchstart"){
target.initialState.initScale=target.transformation.scale||1}if(
target.initialState.initScale*ev.scale>.4){
target.transformation.scale=target.initialState.initScale*ev.scale}updateTransformation(target)}},
onAdd:function(map){map.on("window",this._onDialogMsg,this);map.on("windowpaint",this._onDialogPaint
,this);map.on("docloaded",this._docLoaded,this);map.on("closepopup",this.onCloseCurrentPopUp,this);
map.on("closepopups",this._onClosePopups,this);map.on("editorgotfocus",this._onEditorGotFocus,this);
map.on("changefocuswidget",this._changeFocusWidget,this);window.L.DomEvent.on(document,"mouseup",
this.onCloseCurrentPopUp,this)},_dialogs:{},hasOpenedDialog:function(){return Object.keys(
this._dialogs).length>0},getCurrentDialogContainer:function(){if(this._currentId
)return document.getElementById(this._dialogs[this._currentId].strId);else return null},
blinkOpenDialog:function(){$(".lokdialog_container").addClass("lokblink");setTimeout(function(){$(
".lokdialog_container").removeClass("lokblink")},600)},_docLoaded:function(e){if(!e.status){$(
".lokdialog_container:not(.jsdialog-container)").remove();$(".lokdialogchild-canvas").remove()}},
_getParentId:function(id){id=parseInt(id);for(var winId in this._dialogs){if(this._dialogs[winId
].childid&&this._dialogs[winId].childid===id){return winId}}return null},_isOpen:function(id){
return id in this._dialogs&&this._dialogs[id]&&$("#"+this._toStrId(id)).length>0},
isCursorVisible:function(id){return id in this._dialogs&&this._dialogs[id].cursorVisible},
_isSelectionHandle:function(el){return window.L.DomUtil.hasClass(el,"text-selection-handle-start"
)||window.L.DomUtil.hasClass(el,"text-selection-handle-end")},_toIntId:function(id){if(
typeof id==="string")return parseInt(id.replace(this.dialogIdPrefix,""));return id},
_toStrId:function(id){return this.dialogIdPrefix+id},_createRectStr:function(id,x,y,width,height){
if(!width&&id!==null)width=this._dialogs[parseInt(id)].width;if(!width||width<=0)return null;if(
!height&&id!==null)height=this._dialogs[parseInt(id)].height;if(!height||height<=0)return null;if(!x
)x=0;if(!y)y=0;return[x*app.roundedDpiScale,y*app.roundedDpiScale,width*app.roundedDpiScale,
height*app.roundedDpiScale].join(",")},_sendPaintWindowRect:function(id,x,y,width,height){
this._sendPaintWindow(id,this._createRectStr(id,x,y,width,height))},_debugPaintWindow:function(id,
rectangle){var strId=this._toStrId(id);var canvas=document.getElementById(strId+"-canvas");if(
!canvas)return;var ctx=canvas.getContext("2d");ctx.beginPath();var rect=rectangle.split(",");
ctx.rect(rect[0],rect[1],rect[2],rect[3]);ctx.fillStyle="rgba(255, 0, 0, 0.5)";ctx.fill()},
_sendPaintWindow:function(id,rectangle){if(!rectangle)return;rectangle=rectangle.replace(/ /g,"");
if(!rectangle)return;app.socket.sendMessage(
"paintwindow "+id+" rectangle="+rectangle+" dpiscale="+app.roundedDpiScale);if(
this._map._debug.debugOn)this._debugPaintWindow(id,rectangle)},_sendCloseWindow:function(id){
app.socket.sendMessage("windowcommand "+id+" close");if(
!this._map._docLoaded&&!window._firstDialogHandled){app.dispatcher.dispatch("closeapp")}},
_isRectangleValid:function(rect){rect=rect.split(",");return!isNaN(parseInt(rect[0]))&&!isNaN(
parseInt(rect[1]))&&parseInt(rect[2])>=0&&parseInt(rect[3])>=0},_onDialogMsg:function(e){if(
e.winType!=undefined&&e.winType!=="dialog"&&e.winType!=="calc-input-win"&&e.winType!=="child"&&e.winType!=="deck"&&e.winType!=="tooltip"&&e.winType!=="dropdown"
){return}e.id=parseInt(e.id);var strId=this._toStrId(e.id);var width=0;var height=0;if(e.size){
width=parseInt(e.size.split(",")[0]);height=parseInt(e.size.split(",")[1])}var left;var top;if(
e.position){left=parseInt(e.position.split(",")[0]);top=parseInt(e.position.split(",")[1])}if(
e.title&&typeof brandProductName!=="undefined"){e.title=e.title.replace("F7 Office",
brandProductName)}if(e.action==="created"){if((e.winType==="dialog"||e.winType==="dropdown"
)&&!window.mode.isMobile()){this._launchDialog(e.id,left,top,width,height,e.title,null,e.unique_id)
}else if(e.winType==="child"||e.winType==="tooltip"){var parentId=parseInt(e.parentId);if(
!this._isOpen(parentId))return;if(e.winType==="tooltip"&&this._dialogs[parentId
].childid!==undefined&&this._dialogs[parentId].childistooltip!==true)return;if(!left)left=0;if(!top
)top=0;this._removeDialogChild(parentId);this._dialogs[parentId].childid=e.id;this._dialogs[parentId
].childwidth=width;this._dialogs[parentId].childheight=height;this._dialogs[parentId].childx=left;
this._dialogs[parentId].childy=top;if(e.winType==="tooltip")this._dialogs[parentId
].childistooltip=true;else this._dialogs[parentId].childistooltip=false;this._createDialogChild(e.id
,parentId,top,left);this._sendPaintWindow(e.id,this._createRectStr(null,0,0,width,height))}}if(!(
this._isOpen(e.id)||this._getParentId(e.id))){if(e.action=="close"&&window.mobileDialogId==e.id){
window.mobileDialogId=undefined}return}if(window.mode.isMobile())return;if(e.action==="invalidate"){
this.wasInvalidated=true;var parent=this._getParentId(e.id);var rectangle=e.rectangle;if(parent){if(
e.rectangle&&this._dialogs[parent].childistooltip===true){this._removeDialogChild(parent);
left=this._dialogs[parent].childx;top=this._dialogs[parent].childy;width=parseInt(e.rectangle.split(
",")[2]);height=parseInt(e.rectangle.split(",")[3]);this._dialogs[parent].childwidth=width;
this._dialogs[parent].childheight=height;this._createDialogChild(e.id,parent,top,left)}
rectangle=this._createRectStr(null,0,0,this._dialogs[parent].childwidth,this._dialogs[parent
].childheight)}else if(rectangle){if(this._isRectangleValid(rectangle)){rectangle=e.rectangle.split(
",");x=parseInt(rectangle[0]);y=parseInt(rectangle[1]);width=parseInt(rectangle[2]);height=parseInt(
rectangle[3]);rectangle=this._createRectStr(null,x,y,width,height)}else{return}}else{
rectangle=this._createRectStr(e.id)}this._sendPaintWindow(e.id,rectangle)}else if(
e.action==="size_changed"){$("#"+strId).remove();this._launchDialog(e.id,null,null,width,height,
this._dialogs[parseInt(e.id)].title,null,e.unique_id);if(
this._map._docLayer&&this._map._docLayer._docType==="spreadsheet"){if(
app.sectionContainer.doesSectionExist(app.CSections.RowHeader.name)){
app.sectionContainer.getSectionWithName(app.CSections.RowHeader.name)._updateCanvas();
app.sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name)._updateCanvas()}}}else if(
e.action==="cursor_invalidate"){if(this._isOpen(e.id)&&!!e.rectangle){rectangle=e.rectangle.split(
",");var x=parseInt(rectangle[0]);var y=parseInt(rectangle[1]);height=parseInt(rectangle[3]);
this._updateDialogCursor(e.id,x,y,height)}}else if(e.action==="text_selection"){if(this._isOpen(e.id
)){var rectangles=[];var startHandleVisible,endHandleVisible;if(e.rectangles){
var dataList=e.rectangles.match(/\d+/g);if(dataList!=null){for(var i=0;i<dataList.length;i+=4){
var rect={};rect.x=parseInt(dataList[i]);rect.y=parseInt(dataList[i+1]);rect.width=parseInt(
dataList[i+2]);rect.height=parseInt(dataList[i+3]);rectangles.push(rect)}}}if(e.startHandleVisible){
startHandleVisible=e.startHandleVisible==="true"}if(e.endHandleVisible){
endHandleVisible=e.endHandleVisible==="true"}this._updateTextSelection(e.id,rectangles,
startHandleVisible,endHandleVisible)}}else if(e.action==="title_changed"){if(e.title&&this._dialogs[
parseInt(e.id)]){this._dialogs[parseInt(e.id)].title=e.title;$("#"+strId).dialog("option","title",
e.title)}}else if(e.action==="cursor_visible"){var visible=e.visible==="true";this._dialogs[e.id
].cursorVisible=visible;if(visible){$("#"+strId+"-cursor").css({display:"block"});this._map.fire(
"changefocuswidget",{winId:e.id,dialog:this,acceptInput:true})}else{$("#"+strId+"-cursor").css({
display:"none"})}}else if(e.action==="close"){parent=this._getParentId(e.id);if(parent
)this._onDialogChildClose(parent);else this._onDialogClose(e.id,false)}else if(e.action==="hide"){$(
"#"+strId).parent().css({display:"none"})}else if(e.action==="show"){$("#"+strId).parent().css({
display:"block"})}},_updateDialogCursor:function(dlgId,x,y,height){var strId=this._toStrId(dlgId);
var dialogCursor=window.L.DomUtil.get(strId+"-cursor");var cursorVisible=this.isCursorVisible(dlgId)
window.L.DomUtil.setStyle(dialogCursor,"height",height+"px");window.L.DomUtil.setStyle(dialogCursor,
"display",cursorVisible?"block":"none");window.L.DomUtil.setStyle(this._dialogs[dlgId].cursor,"left"
,x+"px");window.L.DomUtil.setStyle(this._dialogs[dlgId].cursor,"top",y+"px");if(cursorVisible
)this._map.focus(true)},_createDialogCursor:function(dialogId){var id=this._toIntId(dialogId);
this._dialogs[id].cursor=window.L.DomUtil.create("div","leaflet-cursor-container",
window.L.DomUtil.get(dialogId));var cursor=window.L.DomUtil.create("div",
"leaflet-cursor lokdialog-cursor",this._dialogs[id].cursor);cursor.id=dialogId+"-cursor";
window.L.DomUtil.addClass(cursor,"blinking-cursor")},_updateTextSelection:function(dlgId,rectangles,
startHandleVisible,endHandleVisible){var strId=this._toIntId(dlgId);var selections=this._dialogs[
strId].textSelection.rectangles;window.L.DomUtil.empty(selections);var handles=this._dialogs[strId
].textSelection.handles;var startHandle,endHandle;if(startHandleVisible){startHandle=this._dialogs[
strId].textSelection.startHandle}else if(handles.start){window.L.DomUtil.remove(handles.start);
handles.start=null}if(endHandleVisible){endHandle=this._dialogs[strId].textSelection.endHandle
}else if(handles.end){window.L.DomUtil.remove(handles.end);handles.end=null}if(
!handles.start&&!handles.end)handles.draggingStopped=true;if(!rectangles||rectangles.length<1){
return}for(var i=0;i<rectangles.length;++i){var container=window.L.DomUtil.create("div",
"leaflet-text-selection-container",selections);var selection=window.L.DomUtil.create("div",
"leaflet-text-selection",container);var rect=rectangles[i];window.L.DomUtil.setStyle(selection,
"width",rect.width+"px");window.L.DomUtil.setStyle(selection,"height",rect.height+"px");
window.L.DomUtil.setStyle(container,"left",rect.x+"px");window.L.DomUtil.setStyle(container,"top",
rect.y+"px")}var startPos;if(startHandle){var startRect=rectangles[0];if(startRect.width<1)return;
startRect={x:startRect.x,y:startRect.y,width:1,height:startRect.height};startPos=cool.Point.toPoint(
startRect.x,startRect.y+startRect.height);startPos=startPos.subtract(cool.Point.toPoint(0,2));
startHandle.lastPos=startPos;startHandle.rowHeight=startRect.height}var endPos;if(endHandle){
var endRect=rectangles[rectangles.length-1];if(endRect.width<1)return;endRect={
x:endRect.x+endRect.width-1,y:endRect.y,width:1,height:endRect.height};endPos=cool.Point.toPoint(
endRect.x,endRect.y+endRect.height);endPos=endPos.subtract(cool.Point.toPoint(0,2));
endHandle.lastPos=endPos;endHandle.rowHeight=endRect.height}if(startHandle&&handles.draggingStopped
){if(!handles.start)handles.start=handles.appendChild(startHandle);startHandle.pos=startPos;
window.L.DomUtil.setStyle(startHandle,"left",startPos.x+"px");window.L.DomUtil.setStyle(startHandle,
"top",startPos.y+"px")}if(endHandle&&handles.draggingStopped){if(!handles.end
)handles.end=handles.appendChild(endHandle);endHandle.pos=endPos;window.L.DomUtil.setStyle(endHandle
,"left",endPos.x+"px");window.L.DomUtil.setStyle(endHandle,"top",endPos.y+"px")}},focus:function(
dlgId,acceptInput){this._map.setWinId(dlgId);if(dlgId in this._dialogs){this._map.focus(acceptInput)
}},_setCanvasWidthHeight:function(canvas,width,height){var newWidth=width*app.roundedDpiScale;
var changed=false;if(canvas.width!=newWidth){window.L.DomUtil.setStyle(canvas,"width",width+"px");
canvas.width=newWidth;changed=true}var newHeight=height*app.roundedDpiScale;if(
canvas.height!=newHeight){window.L.DomUtil.setStyle(canvas,"height",height+"px");
canvas.height=newHeight;changed=true}return changed},_launchDialog:function(id,leftTwips,topTwips,
width,height,title,type,uniqueId){if(window.ThisIsTheiOSApp&&app.map.mobileTopBar
)app.map.mobileTopBar.enableItem("closemobile",false);this.onCloseCurrentPopUp();
var dialogContainer=window.L.DomUtil.create("div","lokdialog",document.body);
window.L.DomUtil.setStyle(dialogContainer,"padding","0px");window.L.DomUtil.setStyle(dialogContainer
,"margin","0px");window.L.DomUtil.setStyle(dialogContainer,"touch-action","manipulate");
var strId=this._toStrId(id);dialogContainer.id=strId;if(uniqueId
)dialogContainer.dataset.uniqueId=uniqueId;var dialogCanvas=window.L.DomUtil.create("canvas",
"lokdialog_canvas",dialogContainer);this._setCanvasWidthHeight(dialogCanvas,width,height);
dialogCanvas.id=strId+"-canvas";var dialogClass="lokdialog_container";if(!title
)dialogClass+=" lokdialog_notitle";var that=this;var size=$(window).width();$(dialogContainer
).dialog({minWidth:Math.min(width,size.x),width:Math.min(width,size.x),maxHeight:$(window).height(),
height:"auto",title:title?title:"",modal:false,closeOnEscape:true,draggable:false,resizable:false,
dialogClass:dialogClass,close:function(){that._onDialogClose(id,true)}});if(
leftTwips!=null&&topTwips!=null){var pixels=this._map._docLayer._twipsToPixels(new cool.Point(
leftTwips,topTwips));var origin=this._map.getPixelOrigin();var panePos=this._map._getMapPanePos();
var left=pixels.x+panePos.x-origin.x;var top=pixels.y+panePos.y-origin.y;if(left>=0&&top>=0){$(
dialogContainer).dialog("option","position",{my:"left top",at:"left+"+left+" top+"+top,
of:type==="dropdown"?"#map":"#document-container"})}}$(dialogContainer).parent().hide();
window.L.DomUtil.setStyle(dialogContainer,"minHeight",height+"px");
var titleBar=dialogContainer.previousSibling;var leftPadding=window.getComputedStyle(titleBar
).getPropertyValue("padding-left").slice(0,-2);var rightPadding=window.getComputedStyle(titleBar
).getPropertyValue("padding-right").slice(0,-2);window.L.DomUtil.setStyle(titleBar,"maxWidth",
width-(+leftPadding+ +rightPadding)+"px");this._dialogs[id]={id:id,strId:strId,width:width,
height:height,cursor:null,title:title};$(".lokdialog_container button.ui-dialog-titlebar-close"
).attr("tabindex","-1").blur();this._createDialogCursor(strId);this._setupWindowEvents(id,
dialogCanvas);this._setupGestures(dialogContainer,id,dialogCanvas);this._currentId=id;
this._sendPaintWindow(id,this._createRectStr(id))},_postLaunch:function(id,panelContainer,
panelCanvas){if(window.mode.isDesktop()){this._setupWindowEvents(id,panelCanvas)}
this._sendPaintWindowRect(id)},_setupWindowEvents:function(id,canvas){window.L.DomEvent.on(canvas,
"contextmenu",window.L.DomEvent.preventDefault);window.L.DomEvent.on(canvas,"mousemove",function(e){
var pos=this._isSelectionHandle(e.target)?window.L.DomEvent.getMousePosition(e,canvas):{x:e.offsetX,
y:e.offsetY};this._postWindowMouseEvent("move",id,pos.x,pos.y,1,0,0)},this);window.L.DomEvent.on(
canvas,"mousedown mouseup",function(e){window.L.DomEvent.preventDefault(e);if(
this._map.uiManager.isUIBlocked())return;if(canvas.lastDraggedHandle)canvas.lastDraggedHandle=null;
var buttons=0;if(this._map["mouse"]){buttons|=e.button===this._map["mouse"
].JSButtons.left?this._map["mouse"].LOButtons.left:0;buttons|=e.button===this._map["mouse"
].JSButtons.middle?this._map["mouse"].LOButtons.middle:0;buttons|=e.button===this._map["mouse"
].JSButtons.right?this._map["mouse"].LOButtons.right:0}else{buttons=1}var modifier=0;
var shift=e.shiftKey?UNOModifier.SHIFT:0;var ctrl=e.ctrlKey?UNOModifier.CTRL:0;
var alt=e.altKey?UNOModifier.ALT:0;var cmd=e.metaKey?UNOModifier.CTRLMAC:0;
modifier=shift|ctrl|alt|cmd;var lokEventType=e.type.replace("mouse","button");
var pos=this._isSelectionHandle(e.target)?window.L.DomEvent.getMousePosition(e,canvas):{x:e.offsetX,
y:e.offsetY};this._postWindowMouseEvent(lokEventType,id,pos.x,pos.y,1,buttons,modifier);
this._map.setWinId(id)},this);window.L.DomEvent.on(canvas,"click",function(ev){
window.L.DomEvent.stop(ev)})},_setupGestures:function(dialogContainer,id,canvas){
var targetId=toZoomTargetId(canvas.id);var zoomTarget=$("#"+targetId).parent().get(0);
var titlebar=$("#"+targetId).prev().children().get(0);var ratio=1;var width=this._dialogs[id].width;
var height=this._dialogs[id].height;var offsetX=0;var offsetY=0;if((window.mode.isMobile(
)||window.mode.isTablet())&&width>window.screen.width){ratio=window.screen.width/(width+40);
offsetX=-(width-window.screen.width)/2;offsetY=-(height-window.screen.height)/2}var state={
startX:offsetX,startY:offsetY,initScale:ratio};var transformation={translate:{x:offsetX,y:offsetY},
scale:ratio,angle:0,rx:0,ry:0,rz:0};if(window.mode.isMobile()){$(dialogContainer).dialog("option",
"position",{my:"center top",at:"center top",of:"#document-container"});
transformation.origin="center top";transformation.translate.y=0}if(findZoomTarget(targetId)!=null){
removeZoomTarget(targetId)}zoomTargets.push({key:targetId,value:zoomTarget,titlebar:titlebar,
transformation:transformation,initialState:state,width:width,height:height});var that=this;
var hammerTitlebar=new Hammer(titlebar);hammerTitlebar.add(new Hammer.Pan({threshold:20,pointers:0})
);hammerTitlebar.add(new Hammer.Pinch({threshold:0})).recognizeWith([hammerTitlebar.get("pan")]);
hammerTitlebar.on("panstart",this.onPan);hammerTitlebar.on("panmove",this.onPan);hammerTitlebar.on(
"pinchstart pinchmove",this.onPinch);hammerTitlebar.on("hammer.input",function(ev){if(ev.isFirst){
draggedObject=ev.target}if(ev.isFinal&&draggedObject){var id=toZoomTargetId(draggedObject.id);
var target=findZoomTarget(id);if(target){
target.initialState.startX=target.transformation.translate.x;
target.initialState.startY=target.transformation.translate.y}draggedObject=null}});
var hammerContent=new Hammer(canvas);hammerContent.add(new Hammer.Pan({threshold:20,pointers:0}));
hammerContent.add(new Hammer.Pinch({threshold:0})).recognizeWith([hammerContent.get("pan")]);
hammerContent.on("panstart",this.onPan);hammerContent.on("panmove",this.onPan);hammerContent.on(
"pinchstart pinchmove",this.onPinch);hammerContent.on("hammer.input",function(ev){if(ev.isFirst){
that.wasInvalidated=false;draggedObject=ev.target}else if(that.wasInvalidated){draggedObject=null;
that.wasInvalidated=false;return}if(ev.isFinal&&draggedObject){var id=toZoomTargetId(
draggedObject.id);var target=findZoomTarget(id);if(target){
target.initialState.startX=target.transformation.translate.x;
target.initialState.startY=target.transformation.translate.y}draggedObject=null}});
updateTransformation(findZoomTarget(targetId))},_postWindowMouseEvent:function(type,winid,x,y,count,
buttons,modifier){app.socket.sendMessage(
"windowmouse id="+winid+" type="+type+" x="+x+" y="+y+" count="+count+" buttons="+buttons+" modifier="+modifier
)},_postWindowGestureEvent:function(winid,type,x,y,offset){app.socket.sendMessage(
"windowgesture id="+winid+" type="+type+" x="+x+" y="+y+" offset="+offset)},
_closeChildWindows:function(dialogId){var that=this;var foundCurrent=false;Object.keys(this._dialogs
).forEach(function(id){if(foundCurrent)that._onDialogClose(id,true);if(id==dialogId
)foundCurrent=true})},_onDialogClose:function(dialogId,notifyBackend){this._closeChildWindows(
dialogId);if(window.ThisIsTheiOSApp&&app.map.mobileTopBar)app.map.mobileTopBar.enableItem(
"closemobile",true);if(notifyBackend)this._sendCloseWindow(dialogId);$("#"+this._toStrId(dialogId)
).remove();this._map.fire("editorgotfocus");this._map.focus();delete this._dialogs[dialogId];
this._currentId=null;removeZoomTarget(this._toStrId(dialogId))},_onClosePopups:function(){for(
var dialogId in this._dialogs){this._onDialogClose(dialogId,true)}if(
this.hasDialogInMobilePanelOpened()){this._onDialogClose(window.mobileDialogId,true)}},
onCloseCurrentPopUp:function(){if(this._currentId&&this._isOpen(this._currentId)&&!this._dialogs[
this._currentId].title)this._onDialogClose(this._currentId,true)},_onEditorGotFocus:function(){for(
var winId in this._dialogs){$("#"+this._dialogs[winId].strId+"-cursor").css({display:"none"})}},
_changeFocusWidget:function(e){if(e.winId===0){this._onEditorGotFocus()}else{this.focus(e.winId,
e.acceptInput);if(this._map.formulabar)this._map.onFormulaBarFocus()}},_paintDialog:function(
parentId,rectangle,img){var strId=this._toStrId(parentId);var canvas=document.getElementById(
strId+"-canvas");if(!canvas)return;this._dialogs[parentId].isPainting=true;
var ctx=canvas.getContext("2d");var that=this;var x=0;var y=0;if(rectangle){
rectangle=rectangle.split(",");x=parseInt(rectangle[0]);y=parseInt(rectangle[1])}
var container=window.L.DomUtil.get(strId);ctx.drawImage(img,x,y);if(container)$(container).parent(
).show();if(parentId in that._dialogs){that._dialogs[parentId].isPainting=false;that._map.fire(
"changefocuswidget",{winId:parentId,dialog:that})}},_onDialogPaint:function(e){var id=parseInt(e.id)
var parentId=this._getParentId(id);if(parentId){this._paintDialogChild(parentId,e.img)}else{
this._paintDialog(id,e.rectangle,e.img)}},_paintDialogChild:function(parentId,img){
var strId=this._toStrId(parentId);var canvas=window.L.DomUtil.get(strId+"-floating");if(!canvas
)return;var width=this._dialogs[parentId].childwidth;var left=parseInt(canvas.style.left);
var leftPos=left+width;if(leftPos>window.innerWidth){var newLeft=window.innerWidth-width-20;
window.L.DomUtil.setStyle(canvas,"left",newLeft+"px")}var top=parseInt(canvas.style.top);
var height=this._dialogs[parentId].childheight;var bottomPos=top+height;if(
bottomPos>window.innerHeight){var newTop=top-height-20;window.L.DomUtil.setStyle(canvas,"top",
newTop+"px")}this._setCanvasWidthHeight(canvas,this._dialogs[parentId].childwidth,this._dialogs[
parentId].childheight);var ctx=canvas.getContext("2d");ctx.drawImage(img,0,0);$(canvas).show()},
_onDialogChildClose:function(dialogId){$("#"+this._toStrId(dialogId)+"-floating").remove();
var canvas=document.getElementById(dialogId+"-canvas");if(!canvas){canvas=document.getElementById(
this._toStrId(dialogId)+"-canvas");if(!canvas)return}var canvasHeight=canvas.height;$("#"+dialogId
).height(canvasHeight+"px");this._dialogs[dialogId].childid=undefined;this._dialogs[dialogId
].childx=undefined;this._dialogs[dialogId].childy=undefined},_removeDialogChild:function(id){$(
"#"+this._toStrId(id)+"-floating").remove();this._dialogs[id].childid=undefined;this._dialogs[id
].childx=undefined;this._dialogs[id].childy=undefined},_createDialogChild:function(childId,parentId,
top,left){var strId=this._toStrId(parentId);var dialogContainer=window.L.DomUtil.get(strId);
var floatingCanvas=window.L.DomUtil.create("canvas","lokdialogchild-canvas",dialogContainer);$(
floatingCanvas).hide();floatingCanvas.id=strId+"-floating";window.L.DomUtil.setStyle(floatingCanvas,
"position","fixed");window.L.DomUtil.setStyle(floatingCanvas,"z-index","11");
window.L.DomUtil.setStyle(floatingCanvas,"width","0px");window.L.DomUtil.setStyle(floatingCanvas,
"height","0px");var addition=40;window.L.DomUtil.setStyle(floatingCanvas,"margin-inline-start",
left+"px");window.L.DomUtil.setStyle(floatingCanvas,"top",top+addition+"px");this._setupChildEvents(
childId,floatingCanvas)},_setupChildEvents:function(childId,canvas){window.L.DomEvent.on(canvas,
"contextmenu",window.L.DomEvent.preventDefault);window.L.DomEvent.on(canvas,
"touchstart touchmove touchend",function(e){window.L.DomEvent.preventDefault(e);
var rect=canvas.getBoundingClientRect();var touchX=e.type==="touchend"?e.changedTouches[0
].clientX:e.targetTouches[0].clientX;var touchY=e.type==="touchend"?e.changedTouches[0
].clientY:e.targetTouches[0].clientY;touchX=touchX-rect.x;touchY=touchY-rect.y;if(
e.type==="touchstart"){firstTouchPositionX=touchX;firstTouchPositionY=touchY;
this._postWindowGestureEvent(childId,"panBegin",firstTouchPositionX,firstTouchPositionY,0)}else if(
e.type==="touchend"){this._postWindowGestureEvent(childId,"panEnd",firstTouchPositionX,
firstTouchPositionY,firstTouchPositionY-touchY);if(previousTouchType==="touchstart"){if(this._map[
"mouse"]){this._postWindowMouseEvent("buttondown",childId,firstTouchPositionX,firstTouchPositionY,1,
this._map["mouse"].LOButtons.left,0);this._postWindowMouseEvent("buttonup",childId,
firstTouchPositionX,firstTouchPositionY,1,this._map["mouse"].LOButtons.left,0)}else{
this._postWindowMouseEvent("buttondown",childId,firstTouchPositionX,firstTouchPositionY,1,1,0);
this._postWindowMouseEvent("buttonup",childId,firstTouchPositionX,firstTouchPositionY,1,1,0)}}
firstTouchPositionX=null;firstTouchPositionY=null}else if(e.type==="touchmove"){
this._postWindowGestureEvent(childId,"panUpdate",firstTouchPositionX,firstTouchPositionY,
firstTouchPositionY-touchY)}previousTouchType=e.type},this);window.L.DomEvent.on(canvas,
"mousedown mouseup",function(e){var buttons=0;if(this._map["mouse"]){buttons|=e.button===this._map[
"mouse"].JSButtons.left?this._map["mouse"].LOButtons.left:0;buttons|=e.button===this._map["mouse"
].JSButtons.middle?this._map["mouse"].LOButtons.middle:0;buttons|=e.button===this._map["mouse"
].JSButtons.right?this._map["mouse"].LOButtons.right:0}else{buttons=1}
var lokEventType=e.type.replace("mouse","button");this._postWindowMouseEvent(lokEventType,childId,
e.offsetX,e.offsetY,1,buttons,0)},this);window.L.DomEvent.on(canvas,"mousemove",function(e){
this._postWindowMouseEvent("move",childId,e.offsetX,e.offsetY,1,0,0)},this);window.L.DomEvent.on(
canvas,"contextmenu",function(){return false})}});window.L.control.lokDialog=function(options){
return new window.L.Control.LokDialog(options)};
window.L.Control.AlertDialog=window.L.Control.extend({onAdd:function(map){map.on("error",
this._onError,this);map.on("warn",this._onError,this)},_onError:function(e){if(
!this._map._fatal&&e.cmd!=="notasync"&&e.type!=="warn"){this._map.uiManager.closeAll()}if(e.msg){if(
window.ThisIsAMobileApp&&this._map._fatal){this._map.uiManager.showConfirmModal("cool_alert","",
e.msg,_("Close"),function(){window.postMobileMessage("BYE");this._map.uiManager.closeAll()}.bind(
this),true)}else this._map.uiManager.showConfirmModal("cool_alert","",e.msg,_("Close"),function(){},
true)}else if(e.cmd=="load"&&e.kind=="docunloading"){return}else if(e.cmd=="openlink"){var url=e.url
var messageText=window.errorMessages.leaving;var isLinkValid=sanitizeUrl(url)!=="about:blank";if(
!isLinkValid){messageText=window.errorMessages.invalidLink}this._map.uiManager.showInfoModal(
"openlink",_("External link"),messageText,url,isLinkValid?_("Open link"):_("OK"),function(){if(
!isLinkValid)return;if("processCoolUrl"in window){url=window.processCoolUrl({url:url,type:"doc"})}
window.open(url,"_blank")})}else if(e.kind=="network"&&e.code==24581){if(e.cmd=="paste"){
var alertId="paste_network_access_error";var title=_("Copied external sources are not allowed");
var message1=_("It seems you have copied a selection that includes external images.");
var message2=_(
'Downloading external resources is forbidden but pasting images is still possible. Please right click in the image, choose "Copy Image" and paste it into the document instead.'
)}else{alertId="insert_network_access_error";title=_("External data source not allowed");message1=_(
"It seems you have tried to insert external data.");message2=_(
"Selected external data source is forbidden. Please contact the system administrator.")}if(
JSDialog.shouldShowAgain(alertId)){var alertOptions={title:title,messages:[message1,message2],
buttons:[{text:_("Don’t show this again"),callback:function(){JSDialog.setShowAgain(alertId,false);
return false}}],withCancel:false,focusId:JSDialog.generateModalId(alertId)+"-cancel"};
JSDialog.showInfoModalWithOptions(alertId,alertOptions)}}else if(e.cmd=="notasync"){
this._map.uiManager.showInfoModal("cool_alert","","This dialog is non-async","",_("Close"),function(
){},false)}else if(e.cmd&&e.kind){this._map.fire("hidebusy");var msg=_(
"The server encountered a {0} error while parsing the {1} command.");msg=msg.replace("{0}",e.kind);
msg=msg.replace("{1}",e.cmd);this._map.uiManager.showInfoModal("cool_alert","",msg,"",_("Close"),
function(){},false)}}});window.L.control.alertDialog=function(options){
return new window.L.Control.AlertDialog(options)};class Tooltip{constructor(options){
this._options=window.L.extend({timeout:150},options);
let win=this._options.window?this._options.window:window;
this._container=this._options.container?this._options.container:window.L.DomUtil.create("div",
"cooltip-text",win.document.body);this._container.id="cooltip";this._container.addEventListener(
"mouseenter",window.L.bind(this.mouseEnter,this));this._container.addEventListener("mouseleave",
window.L.bind(this.mouseLeave,this));win.addEventListener("keydown",window.L.bind(this.keyDown,this)
,{capture:true,passive:true})}beginShow(elem){if(this._cancel)return;
let win=this._options.window?this._options.window:window;win.clearTimeout(this._showTimeout);
this._showTimeout=win.setTimeout(window.L.bind(this.show,this,elem),this._options.timeout)}
beginHide(elem){if(this._cancel)return;let win=this._options.window?this._options.window:window;
win.clearTimeout(this._showTimeout);win.clearTimeout(this._hideTimeout);if(this._current
)this._hideTimeout=win.setTimeout(window.L.bind(this.hide,this,elem),this._options.timeout/8)}
position(elem,popup,index){let rect=new DOMRect;switch(index){case 0:rect.x=elem.left;
rect.y=elem.bottom+12;break;case 1:rect.x=elem.right-popup.width;rect.y=elem.bottom+12;break;case 2:
rect.x=elem.left;rect.y=elem.top-popup.height-8;break;case 3:rect.x=elem.right-popup.width;
rect.y=elem.top-popup.height-8;break;case 4:rect.x=elem.right;rect.y=elem.bottom+4;break;case 5:
rect.x=elem.left-popup.width;rect.y=elem.bottom+4;break;case 6:rect.x=elem.right;
rect.y=elem.top-popup.height-4;break;case 7:rect.x=elem.left-popup.width;
rect.y=elem.top-popup.height-4;break;default:break}rect.width=popup.width;rect.height=popup.height;
return rect}show(elem,textContent){let content=textContent?textContent:elem.dataset.cooltip,
rectView=new DOMRect(0,0,window.innerWidth,window.innerHeight),rectElem=elem.getBoundingClientRect()
,rectCont,rectTooltip,index=0;this._container.textContent=content;if(!this._container.textContent
)return;rectCont=this._container.getBoundingClientRect();do{rectTooltip=this.position(rectElem,
rectCont,index++)}while(index<8&&!app.LOUtil.containsDOMRect(rectView,rectTooltip));
this._container.style.left=rectTooltip.left+"px";this._container.style.top=rectTooltip.top+"px";
this._container.style.visibility="visible";this._current=elem}hide(){if(this._cancel)return;
this._container.style.visibility="hidden";this._current=null}mouseEnter(){if(this._current){
let win=this._options.window?this._options.window:window;this._cancel=true;win.clearTimeout(
this._hideTimeout);win.clearTimeout(this._showTimeout)}}mouseLeave(){this._cancel=false;
this.beginHide()}keyDown(e){let key=e.key.toUpperCase();if(key==="ESCAPE"){this.mouseLeave()}}
static attachEventListener(elem,map){if(!map.tooltip){return}elem.addEventListener("mouseenter",
function(){map.tooltip.beginShow(elem)});elem.addEventListener("mouseleave",function(){
map.tooltip.beginHide(elem)})}}window.L.control.tooltip=function(options){return new Tooltip(options
)};window.L.control.attachTooltipEventListener=Tooltip.attachEventListener;
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var __spreadArray=this&&this.__spreadArray||function(to,from,pack){
if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar
)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var cool;(function(cool){var ESignature=function(){
function ESignature(url,clientId){var _this=this;this.signatureTime=0;this.docId="";this.popup=null;
this.showSignaturesOnNextUpdate=false;this.signInProgress=false;this.closePopup=function(){try{
window.removeEventListener("beforeunload",_this.closePopup);if(_this.popup){_this.popup.close()}
}catch(error){app.console.log("failed to close the signing popup: "+error);return false}return true}
this.url=url;this.clientId=clientId;app.map.on("commandvalues",this.onCommandValues.bind(this));
app.map.on("commandresult",this.onCommandResult.bind(this));if(!ESignature.countryNames){
ESignature.countryNames={AD:_("Andorra"),AE:_("United Arab Emirates"),AL:_("Albania"),AM:_("Armenia"
),AR:_("Argentina"),AT:_("Austria"),AU:_("Australia"),AX:_("Åland Islands"),AZ:_("Azerbaijan"),BA:_(
"Bosnia and Herzegovina"),BE:_("Belgium"),BG:_("Bulgaria"),BR:_("Brazil"),BY:_("Belarus"),CA:_(
"Canada"),CH:_("Switzerland"),CL:_("Chile"),CN:_("China"),CY:_("Cyprus"),CZ:_("Czech Republic"),
DE:_("Germany"),DK:_("Denmark"),EE:_("Estonia"),ES:_("Spain"),FI:_("Finland"),FR:_("France"),GB:_(
"United Kingdom"),GE:_("Georgia"),GG:_("Guernsey"),GR:_("Greece"),HR:_("Croatia"),HU:_("Hungary"),
ID:_("Indonesia"),IE:_("Ireland"),IL:_("Israel"),IN:_("India"),IS:_("Iceland"),IT:_("Italy"),JP:_(
"Japan"),KE:_("Kenya"),KR:_("South Korea"),KZ:_("Kazakhstan"),LI:_("Liechtenstein"),LT:_("Lithuania"
),LU:_("Luxembourg"),LV:_("Latvia"),MC:_("Monaco"),MD:_("Moldova, Republic of"),ME:_("Montenegro"),
MK:_("North Macedonia, Republic of"),MT:_("Malta"),MX:_("Mexico"),NL:_("Netherlands"),NO:_("Norway"
),NZ:_("New Zealand"),PH:_("Philippines"),PL:_("Poland"),PT:_("Portugal"),QA:_("Qatar"),RO:_(
"Romania"),RS:_("Serbia"),RU:_("Russian Federation"),SA:_("Saudi Arabia"),SE:_("Sweden"),SG:_(
"Singapore"),SI:_("Slovenia"),SK:_("Slovakia"),SM:_("San Marino"),TR:_("Turkey"),TW:_(
"Taiwan, Province of China"),UA:_("Ukraine"),US:_("United States of America"),VA:_(
"Holy See (Vatican City State)"),XK:_("Kosovo"),ZA:_("South Africa")}}}
ESignature.prototype.insert=function(){app.socket.sendMessage("commandvalues command=.uno:Signature"
)};ESignature.prototype.onCommandResult=function(event){if(
event.commandName==".uno:PrepareSignature"){var response=event.result;this.handleSendHashResponse(
event.success,response)}else if(event.commandName==".uno:DownloadSignature"){
var response=event.result;this.handleReceiveSignatureResponse(response)}};
ESignature.prototype.onCommandValues=function(event){if(event.commandName!=".uno:Signature"){return}
var signatureResponse=event.commandValues;this.signatureTime=signatureResponse.signatureTime;
var digest=signatureResponse.digest;var redirectUrl=window.makeHttpUrl("/cool/signature");
var documentName=document.querySelector("#document-name-input");var fileName=documentName.value;
var body={client_id:this.clientId,container_type:"cades",files:[{fileName:fileName,
mimeType:"application/pdf",fileContent:digest}],return_available_methods:true,
return_method_configs:true,signature_redirect:redirectUrl,nodownload:true};var args={body:body};
app.map.sendUnoCommand(".uno:PrepareSignature",args)};
ESignature.prototype.handleSendHashResponse=function(ok,response){if(!ok){app.console.log(
"/api/signatures/prepare-files-for-signing failed: "+response.message);return}
this.docId=response.doc_id;var availableProviderIDs=response.available_methods;
var availableProviderConfigs=response.method_configs;var countries=this.createCountryList(
availableProviderConfigs);var providers=this.createProviders(availableProviderIDs,
availableProviderConfigs);var dialog=JSDialog.eSignatureDialog(countries,providers);
var defaultProviderId=window.prefs.get("eSignatureDefaultProviderId","d-trust-sign-me-qes-signature"
);dialog.setDefaultProviderId(defaultProviderId);var defaultCountryCode=window.prefs.get(
"eSignatureDefaultCountryCode","DE");dialog.setDefaultCountryCode(defaultCountryCode);dialog.open()}
ESignature.prototype.handleSelectedProvider=function(countryCode,providerId){app.console.log(
'attempting to esign using the "'+providerId+'" provider');window.prefs.set(
"eSignatureDefaultCountryCode",countryCode);window.prefs.set("eSignatureDefaultProviderId",
providerId);var url=this.url+"/single-method-signature";url+="?client_id="+this.clientId;
url+="&doc_id="+this.docId;url+="&method="+providerId;url+="&country="+countryCode;
var lang=window.coolParams.get("lang");if(lang){url+="&lang="+lang}var features="popup";
features+=", left="+window.screen.width/4;features+=", top="+window.screen.height/4;
features+=", width="+window.screen.width/2;features+=", height="+window.screen.height/2;
this.signInProgress=true;this.popup=window.open(url,"_blank",features);var message=_(
"The document is being signed and will be availably shortly");app.map.fire("showbusy",{label:message
});window.addEventListener("beforeunload",this.closePopup)};
ESignature.prototype.handleSigned=function(response){app.map.fire("hidebusy");if(
response.type!="SUCCESS"){app.console.log("failed to sign: "+response.error);return}if(
!this.closePopup()){return}this.signInProgress=false;var body={client_id:this.clientId,
doc_id:this.docId};var args={body:body};app.map.sendUnoCommand(".uno:DownloadSignature",args,true)};
ESignature.prototype.handleReceiveSignatureResponse=function(response){if(response.status!="OK"){
app.console.log("received signature status is not OK: "+response.status);return}
this.showSignaturesOnNextUpdate=true;var args={SignatureTime:{type:"string",value:String(
this.signatureTime)},SignatureValue:{type:"string",value:response.signed_file_contents}};
app.map.sendUnoCommand(".uno:Signature",args,true)};ESignature.prototype.createProviders=function(
providerIds,providerConfigs){return providerIds.map(function(id){
var providerName=ESignature.providerNames[id];if(!providerName){app.console.log(
'failed to find a human-readable name for provider "'+id+'"');providerName=id}
var providerConfig=providerConfigs.find(function(i){return i.action_type==id});var countryCodes=[];
if(providerConfig){countryCodes=providerConfig.supported_countries}return{action_type:id,
name:providerName,countryCodes:countryCodes}})};ESignature.prototype.createCountryList=function(
availableProviderConfigs){var e_1,_a,e_2,_b;var codes=new Array;try{for(
var availableProviderConfigs_1=__values(availableProviderConfigs),
availableProviderConfigs_1_1=availableProviderConfigs_1.next(
);!availableProviderConfigs_1_1.done;availableProviderConfigs_1_1=availableProviderConfigs_1.next()
){var config=availableProviderConfigs_1_1.value;try{for(var _c=(e_2=void 0,__values(
config.supported_countries)),_d=_c.next();!_d.done;_d=_c.next()){var code=_d.value;codes.push(code)}
}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(_d&&!_d.done&&(_b=_c.return))_b.call(_c)}finally{if(
e_2)throw e_2.error}}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
availableProviderConfigs_1_1&&!availableProviderConfigs_1_1.done&&(
_a=availableProviderConfigs_1.return))_a.call(availableProviderConfigs_1)}finally{if(e_1
)throw e_1.error}}codes=__spreadArray([],__read(new Set(codes)),false);return codes.map(function(
code){var countryName=ESignature.countryNames?ESignature.countryNames[code]:null;if(countryName){
return{code:code,name:countryName}}app.console.log(
'failed to find a human-readable name for country "'+code+'"');return{code:code,name:code}})};
ESignature.providerNames={"id-signature":"Estonian ID card","mid-signature":"Estonian Mobile-ID",
"lt-mid-signature":"Lithuanian Mobile-ID","smart-id-signature":"Smart-ID",
"be-id-signature":"Belgian ID card","lt-id-signature":"Lithuanian ID card",
"lv-id-signature":"Latvian ID card","lv-eparaksts-mobile-signature":"Latvian eParaksts Mobile",
"fi-id-signature":"Finnish ID card","at-handy-signatur-signature":"Austrian Handy-Signatur",
"evrotrust-signature":"Evrotrust","d-trust-sign-me-qes-signature":"D-Trust sign-me",
"certeurope-usb-token-signature":"CertEurope USB token",
"certsign-usb-token-signature":"certSIGN USB token","zealid-signature":"ZealID app",
"audkenni-qes-signature":"Audkenni","simply-sign-qes-signature":"SimplySign",
"halcom-qes-signature":"Halcom","hr-id-signature":"Croatian ID Card",
"uanataca-qes-signature":"Uanataca","itsme-qes-signature":"Itsme","harica-qes-signature":"Harica",
"lt-id-qes-signature":"LT ID","trust-asia-signature":"TrustAsia","buypass-qes-signature":"Buypass",
"cert-store-qes-signature":"Local Certificate",
"fi-ftn-intesi-adv-signature":"Finnish Trust Network / Luottamusverkosto",
"cz-id-signature":"Czech ID Card","es-lleida-advanced-signature":"Lleida",
"serpro-id-advanced-signature":"SerproID"};ESignature.countryNames=null;return ESignature}();
cool.ESignature=ESignature})(cool||(cool={}));var cool;(function(cool){
var ESignatureDialog=function(){function ESignatureDialog(countries,providers){
this.id="ESignatureDialog";this.defaultCountryCode="";this.defaultProviderId="";
this.filteredProviders=[];this.availableCountries=countries;this.availableCountries.sort(function(a,
b){return a.name.localeCompare(b.name)});this.availableProviders=providers;
this.availableProviders.sort(function(a,b){return a.name.localeCompare(b.name)})}
ESignatureDialog.prototype.getProviderLbJSON=function(providers,defaultProviderIndex){return{
id:"providerlb",type:"listbox",enabled:true,children:[{id:"",type:"control",enabled:true,children:[]
},{type:"pushbutton",enabled:true,symbol:"SPIN_DOWN"}],labelledBy:"providerft",entries:providers,
selectedCount:1,selectedEntries:[String(defaultProviderIndex)]}};
ESignatureDialog.prototype.getChildrenJSON=function(countries,defaultCountryIndex,providers,
defaultProviderIndex){return[{id:"countryft",type:"fixedtext",text:_("Country:"),enabled:true,
labelFor:"countrylb"},{id:"countrylb",type:"listbox",enabled:true,children:[{id:"",type:"control",
enabled:true,children:[]},{type:"pushbutton",enabled:true,symbol:"SPIN_DOWN"}],
labelledBy:"countryft",entries:countries,selectedCount:1,selectedEntries:[String(defaultCountryIndex
)]},{id:"providerft",type:"fixedtext",text:_("Provider:"),enabled:true,labelFor:"providerlb"},
this.getProviderLbJSON(providers,defaultProviderIndex),{id:this.id+"-buttonbox",type:"buttonbox",
children:[{id:"ok",type:"pushbutton",text:_("OK")}],layoutstyle:"end"}]};
ESignatureDialog.prototype.getDefaultProviderIndex=function(){var _this=this;
this.filteredProviders=this.availableProviders.filter(function(provider){
return provider.countryCodes.includes(_this.defaultCountryCode)});
var defaultProviderIndex=this.filteredProviders.map(function(entry){return entry.action_type}
).indexOf(this.defaultProviderId);if(defaultProviderIndex==-1){defaultProviderIndex=0}
return defaultProviderIndex};ESignatureDialog.prototype.getJSON=function(){
var countries=this.availableCountries.map(function(entry){return entry.name});
var defaultCountryIndex=this.availableCountries.map(function(entry){return entry.code}).indexOf(
this.defaultCountryCode);if(defaultCountryIndex==-1){defaultCountryIndex=0}
var defaultProviderIndex=this.getDefaultProviderIndex();var providers=this.filteredProviders.map(
function(entry){return entry.name});var children=this.getChildrenJSON(countries,defaultCountryIndex,
providers,defaultProviderIndex);return{id:this.id,dialogid:this.id,type:"dialog",text:_(
"Insert Electronic Signature"),title:_("Insert Electronic Signature"),jsontype:"dialog",responses:[{
id:"ok",response:1}],children:[{id:this.id+"-mainbox",type:"container",vertical:true,
children:children}]}};ESignatureDialog.prototype.close=function(){var closeEvent={data:{
action:"close",id:this.id}};app.map.fire("jsdialog",closeEvent)};
ESignatureDialog.prototype.callback=function(objectType,eventType,object,data,builder){if(
eventType==="response"||object.id==="ok"){var providers=document.querySelector(
"#ESignatureDialog select#providerlb-input");var providerId=this.filteredProviders[
providers.selectedIndex].action_type;var countries=document.querySelector(
"#ESignatureDialog select#countrylb-input");var countryCode=this.availableCountries[
countries.selectedIndex].code;this.close();app.map.eSignature.handleSelectedProvider(countryCode,
providerId)}else if(eventType==="selected"&&object.id==="countrylb"){var countryIndex=parseInt(
data.split(";")[0]);this.defaultCountryCode=this.availableCountries[countryIndex].code;
var defaultProviderIndex=this.getDefaultProviderIndex();var providers=this.filteredProviders.map(
function(entry){return entry.name});var providerLbJSON=this.getProviderLbJSON(providers,
defaultProviderIndex);app.map.fire("jsdialogupdate",{data:{jsontype:"dialog",action:"update",
id:"ESignatureDialog",control:providerLbJSON},callback:this.callback.bind(this)})}};
ESignatureDialog.prototype.open=function(){var dialogBuildEvent={data:this.getJSON(),
callback:this.callback.bind(this)};app.map.fire("jsdialog",dialogBuildEvent)};
ESignatureDialog.prototype.setDefaultCountryCode=function(countryCode){
this.defaultCountryCode=countryCode};ESignatureDialog.prototype.setDefaultProviderId=function(
providerId){this.defaultProviderId=providerId};return ESignatureDialog}();
cool.ESignatureDialog=ESignatureDialog})(cool||(cool={}));JSDialog.eSignatureDialog=function(
countries,providers){return new cool.ESignatureDialog(countries,providers)};
var ColorPicker=function(){function ColorPicker(selectedColorSample,options){var _this=this;
this.statics={ID:0,ID_TAG:"color-picker-",BASIC_COLORS:["#000000","#980000","#ff0000","#ff9900",
"#ffff00","#00ff00","#00ffff","#0000ff","#9900ff","#ff00ff"],TINTS:{"#000000":["#000000","#434343",
"#666666","#888888","#bbbbbb","#dddddd","#eeeeee","#ffffff"],"#980000":["#5b0f00","#85200c",
"#a61c00","#980000","#cc4125","#dd7e6b","#e6b8af","#ffffff"],"#ff0000":["#660000","#990000",
"#cc0000","#ff0000","#e06666","#ea9999","#f4cccc","#ffffff"],"#ff9900":["#783f04","#b45f06",
"#e69138","#ff9900","#f6b26b","#f9cb9c","#fce5cd","#ffffff"],"#ffff00":["#7f6000","#bf9000",
"#f1c232","#ffff00","#ffd966","#ffe599","#fff2cc","#ffffff"],"#00ff00":["#274e13","#38761d",
"#6aa84f","#00ff00","#93c47d","#b6d7a8","#d9ead3","#ffffff"],"#00ffff":["#0c343d","#134f5c",
"#45818e","#00ffff","#76a5af","#a2c4c9","#d0e0e3","#ffffff"],"#0000ff":["#073763","#0b5394",
"#3d85c6","#0000ff","#6fa8dc","#9fc5e8","#cfe2f3","#ffffff"],"#9900ff":["#20124d","#351c75",
"#674ea7","#9900ff","#8e7cc3","#b4a7d6","#d9d2e9","#ffffff"],"#ff00ff":["#4c1130","#741b47",
"#a64d79","#ff00ff","#c27ba0","#d5a6bd","#ead1dc","#ffffff"]}};this.onShow=function(){if(
!_this._initialized||_this._selectedColor==="#")return;_this._initIndexes();_this._updateTintsView()
};this.options=Object.assign({selectedColor:"#ff0000",noColorControl:true,autoColorControl:false,
selectionCallback:function(_){}},options);if(
this.options.noColorControl&&this.options.autoColorControl){this.options.autoColorControl=false;
window.app.console.warn("ColorPicker: requested both no color and auto color control")}
this._selectedBasicColorIndex=0;this._selectedTintIndex=0;var pickerID=this.statics.ID++;
this._basicColorSampleIdTag=this.statics.ID_TAG+pickerID+"-basic-color-";
this._tintSampleIdTag=this.statics.ID_TAG+pickerID+"-tint-";
this._noColorControlId=this.statics.ID_TAG+pickerID+"-no-color";
this._autoColorControlId=this.statics.ID_TAG+pickerID+"-auto-color";
this._createBasicColorSelectionMark();this._selectedColorElement=selectedColorSample;
this._selectedColor=this.options.selectedColor;
this._selectionCallback=this.options.selectionCallback;this._initIndexes();
this._container=this._createControl();this._initialized=true}
ColorPicker.prototype.getContainer=function(){return this._container};
ColorPicker.prototype._initIndexes=function(){for(var i=0;i<this._getBasicColorCount();++i){
var tintSet=this._getTintSet(i);if(!tintSet)return;for(var j=0;j<tintSet.length;++j){
var tint=tintSet[j];if(tint===this._selectedColor){this._selectedBasicColorIndex=i;
this._selectedTintIndex=j;return}}}};ColorPicker.prototype._createControl=function(){var children=[]
if(this.options.noColorControl||this.options.autoColorControl)children.push(
this._createPseudoColorControl());children.push(this._createBasicColorSamples());children.push(
this._createTintSamples());return{type:"divcontainer",style:"colors-container",children:children}};
ColorPicker.prototype._createPseudoColorControl=function(){
var noColorControl=this.options.noColorControl;var icon={type:"fixedtext",text:"",
style:noColorControl?"no-color-control-icon":"auto-color-control-icon"};var label=noColorControl?{
type:"fixedtext",style:"no-color-control-label",text:_("No color")}:{type:"fixedtext",
style:"auto-color-control-label",text:_("Automatic color")};var description={type:"divcontainer",
children:[icon,label]};var checked=noColorControl?{type:"fixedtext",id:this._noColorControlId,
style:"no-color-control-mark",text:""}:{type:"fixedtext",id:this._autoColorControlId,
style:"auto-color-control-mark",text:""};var container={type:"divcontainer",
style:noColorControl?"colors-container-no-color-row":"colors-container-auto-color-row",handlers:[{
event:"click",handler:window.L.bind(this.onClickPseudoColor,this)}],children:[description,checked]};
return container};ColorPicker.prototype._createBasicColorSamples=function(){var colorEntries=[];for(
var k=0;k<this._getBasicColorCount();++k){var selected=k===this._selectedBasicColorIndex;var entry={
type:"colorsample",id:this._basicColorSampleIdTag+k,selected:selected,color:this._getBasicColor(k),
size:"small",handlers:[{event:"click",handler:window.L.bind(this.onClickBasicColorSample,this)}]};
if(selected){entry.mark=this._basicColorSelectionMark}colorEntries.push(entry)}return{
type:"divcontainer",style:"colors-container-basic-colors-row",children:colorEntries}};
ColorPicker.prototype._createTintSamples=function(){var tints=this._getTintSet(
this._selectedBasicColorIndex);var k,selected,entry,tintRowLength=tints.length/2;var tintsEntries1=[
];for(k=0;k<tintRowLength;++k){selected=tints[k]===this._selectedColor;entry={type:"colorsample",
id:this._tintSampleIdTag+k,selected:selected,color:tints[k],size:"big",handlers:[{event:"click",
handler:window.L.bind(this.onClickTintSample,this)}]};tintsEntries1.push(entry)}var tintsRow1={
type:"divcontainer",style:"colors-container-tints",children:tintsEntries1};var tintsEntries2=[];for(
k=tintRowLength;k<tints.length;++k){selected=tints[k]===this._selectedColor;entry={
type:"colorsample",id:this._tintSampleIdTag+k,selected:selected,color:tints[k],size:"big",handlers:[
{event:"click",handler:window.L.bind(this.onClickTintSample,this)}]};tintsEntries2.push(entry)}
var tintsRow2={type:"divcontainer",style:"colors-container-tints",children:tintsEntries2};return{
type:"divcontainer",children:[tintsRow1,tintsRow2]}};
ColorPicker.prototype._createBasicColorSelectionMark=function(){
this._basicColorSelectionMark=window.L.DomUtil.create("div","colors-container-basic-color-mark",null
)};ColorPicker.prototype._getBasicColorCount=function(){return this.statics.BASIC_COLORS.length};
ColorPicker.prototype._getBasicColor=function(index){if(!(
index>=0&&index<this.statics.BASIC_COLORS.length)){return""}return this.statics.BASIC_COLORS[index]}
ColorPicker.prototype._getTintSet=function(basicColorIndex){var basicColor=this._getBasicColor(
basicColorIndex);if(basicColor==="")return[];return this.statics.TINTS[basicColor]};
ColorPicker.prototype._extractBasicColorIndex=function(sampleId){if(!sampleId.startsWith(
this._basicColorSampleIdTag))return-1;var index=parseInt(sampleId.substring(
this._basicColorSampleIdTag.length));if(index<0||index>=this._getBasicColorCount())return-1;
return index};ColorPicker.prototype._extractTintIndex=function(sampleId){if(!sampleId.startsWith(
this._tintSampleIdTag))return-1;var index=parseInt(sampleId.substring(this._tintSampleIdTag.length))
if(index<0||index>=this._getTintSet(this._selectedBasicColorIndex).length)return-1;return index};
ColorPicker.prototype._getColorCode=function(colorIndex,colorType){
var sampleElem=this._getSampleElement(colorIndex,colorType);return sampleElem.name};
ColorPicker.prototype.onClickPseudoColor=function(){this._selectedColor="#";this._unselectSample(
this._selectedTintIndex,"TINT");this._updatePseudoColorControl(true);this._selectionCallback(
"transparent")};ColorPicker.prototype.onClickBasicColorSample=function(e){
var basicColorIndex=this._extractBasicColorIndex(e.id);if(basicColorIndex<0)return;
this._selectedBasicColorIndex=this._updateSelectedSample(basicColorIndex,
this._selectedBasicColorIndex,"BASIC_COLOR");this._updateTintsView();this._selectTintIndex(3)};
ColorPicker.prototype.onClickTintSample=function(e){var tintIndex=this._extractTintIndex(e.id);if(
tintIndex<0)return;this._selectTintIndex(tintIndex)};
ColorPicker.prototype._selectTintIndex=function(tintIndex){
this._selectedTintIndex=this._updateSelectedSample(tintIndex,this._selectedTintIndex,"TINT");
this._selectedColor="#"+this._getColorCode(this._selectedTintIndex,"TINT");
this._updatePseudoColorControl(false);this._updateSelectedColorElement();this._selectionCallback(
this._getColorCode(this._selectedTintIndex,"TINT"))};
ColorPicker.prototype._updateSelectedSample=function(colorIndex,selectedColorIndex,colorType){
this._unselectSample(selectedColorIndex,colorType);this._selectSample(colorIndex,colorType);
return colorIndex};ColorPicker.prototype._unselectSample=function(colorIndex,colorType){
var sampleElem=this._getSampleElement(colorIndex,colorType);if(sampleElem&&sampleElem.firstChild){
if(colorType==="BASIC_COLOR"){sampleElem.removeChild(sampleElem.firstChild);
window.L.DomUtil.removeClass(sampleElem,"colors-container-selected-basic-color")}else if(
colorType==="TINT"){var child=sampleElem.firstChild;if(!("style"in child)){throw new Error(
"Assertion failed: sampleElem.firstChild is not a HTMLElement")}child.style.visibility="hidden"}}};
ColorPicker.prototype._selectSample=function(colorIndex,colorType){
var sampleElem=this._getSampleElement(colorIndex,colorType);if(sampleElem){if(
colorType==="BASIC_COLOR"){sampleElem.appendChild(this._basicColorSelectionMark);
window.L.DomUtil.addClass(sampleElem,"colors-container-selected-basic-color")}else if(
colorType==="TINT"&&sampleElem.firstChild){var child=sampleElem.firstChild;if(!("style"in child)){
throw new Error("Assertion failed: sampleElem.firstChild is not a HTMLElement")}
child.style.visibility="visible"}}};ColorPicker.prototype._updateTintsView=function(){
var tintSet=this._getTintSet(this._selectedBasicColorIndex);if(!tintSet)return;for(
var i=0;i<tintSet.length;++i){var tint=tintSet[i];var sampleElem=this._getSampleElement(i,"TINT");
if(sampleElem){sampleElem.style.backgroundColor=tint;sampleElem.name=tint.substring(1);if(
sampleElem.firstChild){var child=sampleElem.firstChild;if(!("style"in child)){throw new Error(
"Assertion failed: sampleElem.firstChild is not a HTMLElement")}if(tint===this._selectedColor){
child.style.visibility="visible"}else{child.style.visibility="hidden"}}}}};
ColorPicker.prototype._updatePseudoColorControl=function(checked){if(this.options.noColorControl
)this._updateNoColorControl(checked);else if(this.options.autoColorControl
)this._updateAutoColorControl(checked)};ColorPicker.prototype._updateNoColorControl=function(checked
){var noColorElem=window.L.DomUtil.get(this._noColorControlId);if(noColorElem){if(
noColorElem.checked!==checked){noColorElem.checked=checked;if(this._selectedColorElement){if(checked
){noColorElem.innerHTML="&#10004;";window.L.DomUtil.addClass(this._selectedColorElement,
"no-color-selected");this._selectedColorElement.innerHTML="\\"}else{noColorElem.replaceChildren();
window.L.DomUtil.removeClass(this._selectedColorElement,"no-color-selected");
this._selectedColorElement.replaceChildren()}}}}};
ColorPicker.prototype._updateAutoColorControl=function(checked){
var autoColorElem=window.L.DomUtil.get(this._autoColorControlId);if(autoColorElem){if(
autoColorElem.checked!==checked){autoColorElem.checked=checked;if(this._selectedColorElement){if(
checked){autoColorElem.innerHTML="&#10004;";window.L.DomUtil.addClass(this._selectedColorElement,
"auto-color-selected");this._selectedColorElement.innerHTML="\\"}else{autoColorElem.replaceChildren(
);window.L.DomUtil.removeClass(this._selectedColorElement,"auto-color-selected");
this._selectedColorElement.replaceChildren()}}}}};ColorPicker.prototype._getSampleElement=function(
index,type){var sampleId;if(type==="BASIC_COLOR"){sampleId=this._basicColorSampleIdTag+index
}else if(type==="TINT"){sampleId=this._tintSampleIdTag+index}return window.L.DomUtil.get(sampleId)};
ColorPicker.prototype._updateSelectedColorElement=function(){if(this._selectedColorElement){
this._selectedColorElement.style.backgroundColor=this._selectedColor}};return ColorPicker}();
var ShortcutsUtil=function(){function ShortcutsUtil(){this.shortcutMap=new Map;this.SAVE="Ctrl + S";
this.UNDO="Ctrl + Z";this.REDO="Ctrl + Y";this.PRINT="Ctrl + P";this.CUT="Ctrl + X";
this.COPY="Ctrl + C";this.PASTE="Ctrl + V";this.PASTE_SPECIAL="Ctrl + Shift + Alt + V";
this.SELECT_ALL="Ctrl + A";this.COMMENT="Ctrl + Alt + C";this.FOOTNOTE="Ctrl + Alt + F";
this.ENDNOTE="Ctrl + Alt + D";this.BOLD="Ctrl + B";this.ITALIC="Ctrl + I";this.UNDERLINE="Ctrl + U";
this.DOUBLE_UNDERLINE="Ctrl + D";this.STRIKETHROUGH="Ctrl + Alt + 5";
this.SUPERSCRIPT="Ctrl + Shift + P";this.SUBSCRIPT="Ctrl + Shift + B";this.LEFT="Ctrl + L";
this.CENTERED="Ctrl + E";this.RIGHT="Ctrl + R";this.JUSTIFIED="Ctrl + J";
this.KEYBOARD_SHORTCUTS="Ctrl + Shift + ?";this.HYPERLINK="Ctrl + K";
this.CLEAR_FORMATTING="Ctrl + M";this.INSERT_TABLE="Ctrl + F12";
this.INSERT_PAGEBREAK="Ctrl + Return";this.FIND="Ctrl + F";this.FIND_REPLACE="Ctrl + H";
this.FORMAT_CELL="Ctrl + 1";this.shortcutMap.set(".uno:Save",this.SAVE);this.shortcutMap.set("save",
this.SAVE);this.shortcutMap.set(".uno:Undo",this.UNDO);this.shortcutMap.set(".uno:Redo",this.REDO);
this.shortcutMap.set(".uno:Print",this.PRINT);this.shortcutMap.set("print",this.PRINT);
this.shortcutMap.set(".uno:Cut",this.CUT);this.shortcutMap.set(".uno:Copy",this.COPY);
this.shortcutMap.set(".uno:Paste",this.PASTE);this.shortcutMap.set(".uno:PasteSpecial",
this.PASTE_SPECIAL);this.shortcutMap.set(".uno:SelectAll",this.SELECT_ALL);this.shortcutMap.set(
".uno:InsertAnnotation",this.COMMENT);this.shortcutMap.set("insertcomment",this.COMMENT);
this.shortcutMap.set(".uno:InsertFootnote",this.FOOTNOTE);this.shortcutMap.set(".uno:InsertEndnote",
this.ENDNOTE);this.shortcutMap.set(".uno:Bold",this.BOLD);this.shortcutMap.set(".uno:Italic",
this.ITALIC);this.shortcutMap.set(".uno:Underline",this.UNDERLINE);this.shortcutMap.set(
".uno:UnderlineDouble",this.DOUBLE_UNDERLINE);this.shortcutMap.set(".uno:Strikeout",
this.STRIKETHROUGH);this.shortcutMap.set(".uno:SuperScript",this.SUPERSCRIPT);this.shortcutMap.set(
".uno:SubScript",this.SUBSCRIPT);this.shortcutMap.set(".uno:LeftPara",this.LEFT);
this.shortcutMap.set(".uno:AlignLeft",this.LEFT);this.shortcutMap.set(".uno:CommonAlignLeft",
this.LEFT);this.shortcutMap.set(".uno:AlignHorizontalCenter",this.CENTERED);this.shortcutMap.set(
".uno:CenterPara",this.CENTERED);this.shortcutMap.set(".uno:CommonAlignHorizontalCenter",
this.CENTERED);this.shortcutMap.set(".uno:AlignRight",this.RIGHT);this.shortcutMap.set(
".uno:RightPara",this.RIGHT);this.shortcutMap.set(".uno:CommonAlignRight",this.RIGHT);
this.shortcutMap.set(".uno:AlignBlock",this.JUSTIFIED);this.shortcutMap.set(".uno:JustifyPara",
this.JUSTIFIED);this.shortcutMap.set(".uno:CommonAlignJustified",this.JUSTIFIED);
this.shortcutMap.set(".uno:KeyboardShortcuts",this.KEYBOARD_SHORTCUTS);this.shortcutMap.set(
"keyboard-shortcuts",this.KEYBOARD_SHORTCUTS);this.shortcutMap.set("hyperlinkdialog",this.HYPERLINK)
this.shortcutMap.set("inserthyperlink",this.HYPERLINK);this.shortcutMap.set(".uno:ResetAttributes",
this.CLEAR_FORMATTING);this.shortcutMap.set(".uno:InsertTable",this.INSERT_TABLE);
this.shortcutMap.set(".uno:InsertPagebreak",this.INSERT_PAGEBREAK);this.shortcutMap.set("search",
this.FIND);this.shortcutMap.set("home-search",this.FIND);this.shortcutMap.set(".uno:SearchDialog",
this.FIND_REPLACE);this.shortcutMap.set(".uno:FormatCellDialog",this.FORMAT_CELL)}
ShortcutsUtil.prototype.hasShortcut=function(command){return this.shortcutMap.has(command)};
ShortcutsUtil.prototype.getShortcut=function(text,command){var shortcut=this.shortcutMap.get(command
);if(!shortcut)return text;if(String.locale.startsWith("de")||String.locale.startsWith("dsb"
)||String.locale.startsWith("hsb")){shortcut=shortcut.replace("Ctrl","Strg")}if(
String.locale.startsWith("lt")){shortcut=shortcut.replace("Ctrl","Vald")}if(
String.locale.startsWith("sl")){shortcut=shortcut.replace("Ctrl","Krmilka").replace("Alt",
"izmenjalka").replace("Shift","dvigalka")}var newText=_(text).replace("~",""
)+" ("+app.util.replaceCtrlAltInMac(shortcut)+")";return newText};return ShortcutsUtil}();
JSDialog.ShortcutsUtil=new ShortcutsUtil;var JSDialogModelState=function(){
function JSDialogModelState(componentName){app.console.debug(
"JSDialogModelState: created new for component: "+componentName);this.componentName=componentName;
this.model=null}JSDialogModelState.prototype.copyObject=function(obj){if(window.structuredClone){
try{return window.structuredClone(obj)}catch(e){app.console.debug("JSDialogModelState: "+e)}}try{
app.console.debug("JSDialogModelState: fallback copy by JSON.parse");return JSON.parse(
JSON.stringify(obj))}catch(e){app.console.debug("JSDialogModelState: failed to clone the model: "+e)
}try{app.console.debug("JSDialogModelState: fallback copy by Object.assign");return Object.assign({}
,obj)}catch(e){app.console.debug("JSDialogModelState: "+e)}return null};
JSDialogModelState.prototype.safeStringify=function(obj){try{return JSON.stringify(obj)}catch(e){
app.console.debug("JSDialogModelState: "+e)}return"Bad Object"};
JSDialogModelState.prototype.getSnapshot=function(){if(this.model){var snapshot=this.copyObject(
this.model);if(snapshot){return snapshot}else{app.console.debug(
"JSDialogModelState: cannot copy object, use original model");return this.model}}return null};
JSDialogModelState.prototype.fullUpdate=function(data){app.console.debug(
"JSDialogModelState: set model for component: "+this.componentName);this.model=data};
JSDialogModelState.prototype.widgetUpdate=function(data){if(!data||!data.control||!data.control.id){
app.console.error("JSDialogModelState: bad syntax in widgetUpdate: "+this.safeStringify(data));
return}var found=this.getById(data.control.id);if(found){var id=found.id;
var before_1=this.safeStringify(found);Object.assign(found,data.control);if(JSDialog.verbose){
app.console.debug(
"JSDialogModelState: widgetUpdate\n\nBEFORE: "+before_1+"\n\nAFTER: "+this.safeStringify(
this.getById(id)))}}};JSDialogModelState.prototype.widgetAction=function(data){if(
!data||!data.data||!data.data.control_id){app.console.error(
"JSDialogModelState: bad syntax in widgetAction: "+this.safeStringify(data));return}
var found=this.getById(data.data.control_id);if(found){if(JSDialog.verbose){app.console.debug(
"JSDialogModelState: widgetAction "+data.data.control_id)}if(data.data.action_type==="show"
)found.visible=true;else if(data.data.action_type==="hide")found.visible=false}};
JSDialogModelState.prototype.getById=function(widgetId){if(!this.model){app.console.debug(
"JSDialogModelState: model missing in component: "+this.componentName);return null}
var found=JSDialogModelState.findWidgetById(widgetId,this.model);if(!found)app.console.debug(
"JSDialogModelState: not found id: "+widgetId);return found};
JSDialogModelState.findWidgetById=function(id,model){if(model.id===id){return model}else if(
model.children){for(var i in model.children){var found=JSDialogModelState.findWidgetById(id,
model.children[i]);if(found)return found}}return null};return JSDialogModelState}();
var JSDialogComponent=function(){function JSDialogComponent(map,name,allowedJsonType){this.map=map;
this.name=name;this.allowedJsonType=allowedJsonType;this.model=new JSDialogModelState(name)}
JSDialogComponent.prototype.registerMessageHandlers=function(){this.map.on("jsdialogupdate",
this.onJSUpdate,this);this.map.on("jsdialogaction",this.onJSAction,this)};
JSDialogComponent.prototype.unregisterMessageHandlers=function(){this.map.off("jsdialogupdate",
this.onJSUpdate,this);this.map.off("jsdialogaction",this.onJSAction,this)};
JSDialogComponent.prototype.onJSUpdate=function(e){var data=e.data;if(
data.jsontype!==this.allowedJsonType)return false;if(this.model)this.model.widgetUpdate(data);if(
!this.container)return false;if(!this.builder)return false;app.console.debug(
"Component "+this.name+" handles update message: "+JSDialog.verbose?this.model.safeStringify(
data.control):data.control.id);this.builder.updateWidget(this.container,data.control);return true};
JSDialogComponent.prototype.onJSAction=function(e){var data=e.data;if(
data.jsontype!==this.allowedJsonType)return false;if(this.model)this.model.widgetAction(data);if(
!this.builder)return false;if(!this.container)return false;app.console.debug(
"Component "+this.name+" handles action message: "+JSDialog.verbose?this.model.safeStringify(
data.data):data.data.control_id);this.builder.executeAction(this.container,data.data);return true};
JSDialogComponent.prototype.getTabs=function(){return[]};
JSDialogComponent.prototype.setTabs=function(tabs){};JSDialogComponent.prototype.showTabs=function(
){};JSDialogComponent.prototype.hideTabs=function(){};JSDialogComponent.prototype.showItem=function(
id,show){};JSDialogComponent.prototype.hideItem=function(id){};return JSDialogComponent}();
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var Toolbar=function(_super){__extends(Toolbar,_super);
function Toolbar(map,name,toolbarElementId){var _this=_super.call(this,map,name,"toolbar")||this;
_this.docType=map.getDocType();_this.customItems=[];_this.toolbarElementId=toolbarElementId;
_this.createBuilder();_this.reset();_this.create();_this.updateVisibilityForToolbar("");return _this
}Toolbar.prototype.getToolItems=function(){return[]};Toolbar.prototype.createBuilder=function(){
this.builder=new window.L.control.jsDialogBuilder({mobileWizard:this,map:this.map,
cssClass:"jsdialog",noLabelsForUnoButtons:true,callback:this.callback?this.callback.bind(this
):undefined,suffix:"toolbar"})};Toolbar.prototype.setupContainer=function(parentContainer){
this.container=this.parentContainer=window.L.DomUtil.get(this.toolbarElementId);if(
this.parentContainer)this.parentContainer.replaceChildren();window.L.DomUtil.addClass(
this.parentContainer,"ui-toolbar")};Toolbar.prototype.reset=function(){this.setupContainer(undefined
)};Toolbar.prototype.create=function(){this.reset();var items=this.getToolItems();var json={
id:this.toolbarElementId,dialogid:this.toolbarElementId,jsontype:"toolbar",type:"toolbox",
children:items};this.model.fullUpdate(json);this.builder.build(this.parentContainer,
this.model.getSnapshot().children,undefined);JSDialog.MakeScrollable(this.parentContainer,
this.parentContainer.querySelector("div"));JSDialog.RefreshScrollables();if(
this.map.isRestrictedUser()){for(var i=0;i<items.length;i++){var it=items[i];var item=$("#"+it.id)[0
];this.map.hideRestrictedItems(it,item,item)}}if(this.map.isLockedUser()){for(
var i=0;i<items.length;i++){var it=items[i];var item=$("#"+it.id)[0];this.map.disableLockedItem(it,
item,item)}}};Toolbar.prototype.hasItem=function(id){return this.getToolItems().filter(function(item
){return item.id===id}).length>0};Toolbar.prototype.insertItem=function(beforeId,items){
this.customItems.push({id:"custom-before-"+beforeId,type:"toolitem",beforeId:beforeId,items:items});
this.create()};Toolbar.prototype.isItemHidden=function(id){var _a;var item=(_a=this.parentContainer
)===null||_a===void 0?void 0:_a.querySelector('[id="'+id+'"]');if(!item)return true;
return item.classList.contains("hidden")};Toolbar.prototype.showItem=function(command,show){if(
!command)return;if(this.isItemHidden(command)===!show)return;this.builder.executeAction(
this.parentContainer,{control_id:command,control:{id:command},action_type:show?"show":"hide"});
app.layoutingService.appendLayoutingTask(function(){JSDialog.RefreshScrollables()})};
Toolbar.prototype.isItemDisabled=function(id){var item=this.parentContainer.querySelector(
'[id="'+id+'"]');if(!item)return true;return item.hasAttribute("disabled")&&item.getAttribute(
"disabled")!=="false"};Toolbar.prototype.enableItem=function(command,enable){if(!command)return;if(
this.isItemDisabled(command)===!enable)return;this.builder.executeAction(this.parentContainer,{
control_id:command,action_type:enable?"enable":"disable"})};Toolbar.prototype.selectItem=function(
command,select){if(!command)return;this.builder.executeAction(this.parentContainer,{
control_id:command,action_type:select?"select":"unselect"})};Toolbar.prototype.updateItem=function(
data){this.builder.updateWidget(this.parentContainer,data);this.updateVisibilityForToolbar("");
app.layoutingService.appendLayoutingTask(function(){JSDialog.RefreshScrollables()})};
Toolbar.prototype.updateVisibilityForToolbar=function(context){var _this=this;var toShow=[];
var toHide=[];var items=this.getToolItems();items.forEach(function(item){if(
window.ThisIsTheiOSApp&&window.mode.isTablet()&&item.iosapptablet===false){toHide.push(item.id)
}else if((window.mode.isMobile()&&item.mobile===false||window.mode.isTablet(
)&&item.tablet===false||window.mode.isDesktop(
)&&item.desktop===false||!window.ThisIsAMobileApp&&item.mobilebrowser===false)&&!item.hidden){
toHide.push(item.id)}else if((window.mode.isMobile()&&item.mobile===true||window.mode.isTablet(
)&&item.tablet===true||window.mode.isDesktop(
)&&item.desktop===true||window.ThisIsAMobileApp&&item.mobilebrowser===true)&&item.hidden){
toShow.push(item.id)}if(context&&item.context){if(item.context.indexOf(context)>=0)toShow.push(
item.id);else toHide.push(item.id)}else if(!context&&item.context){if(item.context.indexOf("default"
)>=0)toShow.push(item.id);else toHide.push(item.id)}});window.app.console.log(
"explicitly hiding: "+toHide);window.app.console.log("explicitly showing: "+toShow);toHide.forEach(
function(item){_this.showItem(item,false)});toShow.forEach(function(item){_this.showItem(item,true)}
)};return Toolbar}(JSDialogComponent);JSDialog.Toolbar=Toolbar;
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};var menuDefinitions=new Map;
var Paper;(function(Paper){Paper[Paper["PAPER_A0"]=0]="PAPER_A0";Paper[Paper["PAPER_A1"]=1
]="PAPER_A1";Paper[Paper["PAPER_A2"]=2]="PAPER_A2";Paper[Paper["PAPER_A3"]=3]="PAPER_A3";Paper[
Paper["PAPER_A4"]=4]="PAPER_A4";Paper[Paper["PAPER_A5"]=5]="PAPER_A5";Paper[Paper["PAPER_B4_ISO"]=6
]="PAPER_B4_ISO";Paper[Paper["PAPER_B5_ISO"]=7]="PAPER_B5_ISO";Paper[Paper["PAPER_LETTER"]=8
]="PAPER_LETTER";Paper[Paper["PAPER_LEGAL"]=9]="PAPER_LEGAL";Paper[Paper["PAPER_TABLOID"]=10
]="PAPER_TABLOID";Paper[Paper["PAPER_USER"]=11]="PAPER_USER";Paper[Paper["PAPER_B6_ISO"]=12
]="PAPER_B6_ISO";Paper[Paper["PAPER_ENV_C4"]=13]="PAPER_ENV_C4";Paper[Paper["PAPER_ENV_C5"]=14
]="PAPER_ENV_C5";Paper[Paper["PAPER_ENV_C6"]=15]="PAPER_ENV_C6";Paper[Paper["PAPER_ENV_C65"]=16
]="PAPER_ENV_C65";Paper[Paper["PAPER_ENV_DL"]=17]="PAPER_ENV_DL";Paper[Paper["PAPER_SLIDE_DIA"]=18
]="PAPER_SLIDE_DIA";Paper[Paper["PAPER_SCREEN_4_3"]=19]="PAPER_SCREEN_4_3";Paper[Paper["PAPER_C"]=20
]="PAPER_C";Paper[Paper["PAPER_D"]=21]="PAPER_D";Paper[Paper["PAPER_E"]=22]="PAPER_E";Paper[Paper[
"PAPER_EXECUTIVE"]=23]="PAPER_EXECUTIVE";Paper[Paper["PAPER_FANFOLD_LEGAL_DE"]=24
]="PAPER_FANFOLD_LEGAL_DE";Paper[Paper["PAPER_ENV_MONARCH"]=25]="PAPER_ENV_MONARCH";Paper[Paper[
"PAPER_ENV_PERSONAL"]=26]="PAPER_ENV_PERSONAL";Paper[Paper["PAPER_ENV_9"]=27]="PAPER_ENV_9";Paper[
Paper["PAPER_ENV_10"]=28]="PAPER_ENV_10";Paper[Paper["PAPER_ENV_11"]=29]="PAPER_ENV_11";Paper[Paper[
"PAPER_ENV_12"]=30]="PAPER_ENV_12";Paper[Paper["PAPER_KAI16"]=31]="PAPER_KAI16";Paper[Paper[
"PAPER_KAI32"]=32]="PAPER_KAI32";Paper[Paper["PAPER_KAI32BIG"]=33]="PAPER_KAI32BIG";Paper[Paper[
"PAPER_B4_JIS"]=34]="PAPER_B4_JIS";Paper[Paper["PAPER_B5_JIS"]=35]="PAPER_B5_JIS";Paper[Paper[
"PAPER_B6_JIS"]=36]="PAPER_B6_JIS";Paper[Paper["PAPER_LEDGER"]=37]="PAPER_LEDGER";Paper[Paper[
"PAPER_STATEMENT"]=38]="PAPER_STATEMENT";Paper[Paper["PAPER_QUARTO"]=39]="PAPER_QUARTO";Paper[Paper[
"PAPER_10x14"]=40]="PAPER_10x14";Paper[Paper["PAPER_ENV_14"]=41]="PAPER_ENV_14";Paper[Paper[
"PAPER_ENV_C3"]=42]="PAPER_ENV_C3";Paper[Paper["PAPER_ENV_ITALY"]=43]="PAPER_ENV_ITALY";Paper[Paper[
"PAPER_FANFOLD_US"]=44]="PAPER_FANFOLD_US";Paper[Paper["PAPER_FANFOLD_DE"]=45]="PAPER_FANFOLD_DE";
Paper[Paper["PAPER_POSTCARD_JP"]=46]="PAPER_POSTCARD_JP";Paper[Paper["PAPER_9x11"]=47]="PAPER_9x11";
Paper[Paper["PAPER_10x11"]=48]="PAPER_10x11";Paper[Paper["PAPER_15x11"]=49]="PAPER_15x11";Paper[
Paper["PAPER_ENV_INVITE"]=50]="PAPER_ENV_INVITE";Paper[Paper["PAPER_A_PLUS"]=51]="PAPER_A_PLUS";
Paper[Paper["PAPER_B_PLUS"]=52]="PAPER_B_PLUS";Paper[Paper["PAPER_LETTER_PLUS"]=53
]="PAPER_LETTER_PLUS";Paper[Paper["PAPER_A4_PLUS"]=54]="PAPER_A4_PLUS";Paper[Paper[
"PAPER_DOUBLEPOSTCARD_JP"]=55]="PAPER_DOUBLEPOSTCARD_JP";Paper[Paper["PAPER_A6"]=56]="PAPER_A6";
Paper[Paper["PAPER_12x11"]=57]="PAPER_12x11";Paper[Paper["PAPER_A7"]=58]="PAPER_A7";Paper[Paper[
"PAPER_A8"]=59]="PAPER_A8";Paper[Paper["PAPER_A9"]=60]="PAPER_A9";Paper[Paper["PAPER_A10"]=61
]="PAPER_A10";Paper[Paper["PAPER_B0_ISO"]=62]="PAPER_B0_ISO";Paper[Paper["PAPER_B1_ISO"]=63
]="PAPER_B1_ISO";Paper[Paper["PAPER_B2_ISO"]=64]="PAPER_B2_ISO";Paper[Paper["PAPER_B3_ISO"]=65
]="PAPER_B3_ISO";Paper[Paper["PAPER_B7_ISO"]=66]="PAPER_B7_ISO";Paper[Paper["PAPER_B8_ISO"]=67
]="PAPER_B8_ISO";Paper[Paper["PAPER_B9_ISO"]=68]="PAPER_B9_ISO";Paper[Paper["PAPER_B10_ISO"]=69
]="PAPER_B10_ISO";Paper[Paper["PAPER_ENV_C2"]=70]="PAPER_ENV_C2";Paper[Paper["PAPER_ENV_C7"]=71
]="PAPER_ENV_C7";Paper[Paper["PAPER_ENV_C8"]=72]="PAPER_ENV_C8";Paper[Paper["PAPER_ARCHA"]=73
]="PAPER_ARCHA";Paper[Paper["PAPER_ARCHB"]=74]="PAPER_ARCHB";Paper[Paper["PAPER_ARCHC"]=75
]="PAPER_ARCHC";Paper[Paper["PAPER_ARCHD"]=76]="PAPER_ARCHD";Paper[Paper["PAPER_ARCHE"]=77
]="PAPER_ARCHE";Paper[Paper["PAPER_SCREEN_16_9"]=78]="PAPER_SCREEN_16_9";Paper[Paper[
"PAPER_SCREEN_16_10"]=79]="PAPER_SCREEN_16_10";Paper[Paper["PAPER_16K_195x270"]=80
]="PAPER_16K_195x270";Paper[Paper["PAPER_16K_197x273"]=81]="PAPER_16K_197x273";Paper[Paper[
"PAPER_WIDESCREEN"]=82]="PAPER_WIDESCREEN";Paper[Paper["PAPER_ONSCREENSHOW_4_3"]=83
]="PAPER_ONSCREENSHOW_4_3";Paper[Paper["PAPER_ONSCREENSHOW_16_9"]=84]="PAPER_ONSCREENSHOW_16_9";
Paper[Paper["PAPER_ONSCREENSHOW_16_10"]=85]="PAPER_ONSCREENSHOW_16_10"})(Paper||(Paper={}));
var pageMarginOptions={normal:{title:_("Normal"),icon:"pagemargin",details:{Top:.79,Left:.79,
Bottom:.79,Right:.79}},wide:{title:_("Wide"),icon:"pagemarginwide",details:{Top:1,Left:2,Bottom:1,
Right:2}},narrow:{title:_("Narrow"),icon:"pagemarginnarrow",details:{Top:.5,Left:.5,Bottom:.5,
Right:.5}}};var LO_BorderLineWidth;(function(LO_BorderLineWidth){LO_BorderLineWidth[
LO_BorderLineWidth["Hairline"]=1]="Hairline";LO_BorderLineWidth[LO_BorderLineWidth["VeryThin"]=10
]="VeryThin";LO_BorderLineWidth[LO_BorderLineWidth["Thin"]=15]="Thin";LO_BorderLineWidth[
LO_BorderLineWidth["Medium"]=30]="Medium";LO_BorderLineWidth[LO_BorderLineWidth["Thick"]=45]="Thick"
LO_BorderLineWidth[LO_BorderLineWidth["ExtraThick"]=90]="ExtraThick"})(LO_BorderLineWidth||(
LO_BorderLineWidth={}));var UNO_BorderLineStyle;(function(UNO_BorderLineStyle){UNO_BorderLineStyle[
UNO_BorderLineStyle["NONE"]=32767]="NONE";UNO_BorderLineStyle[UNO_BorderLineStyle["SOLID"]=1
]="SOLID";UNO_BorderLineStyle[UNO_BorderLineStyle["DOUBLE"]=3]="DOUBLE"})(UNO_BorderLineStyle||(
UNO_BorderLineStyle={}));function getLineStyleModificationCommand(LineStyle,n1,n2,n3){
var borderLine2Properties={LineStyle:{type:"short",value:LineStyle},InnerLineWidth:{type:"short",
value:n1},OuterLineWidth:{type:"short",value:n2},LineDistance:{type:"short",value:n3}};
var jsonParams=JSON.stringify(borderLine2Properties);return".uno:LineStyle "+jsonParams}
menuDefinitions.set("AutoSumMenu",[{text:_("Sum"),uno:".uno:AutoSum"},{text:_("Average"),
uno:".uno:AutoSum?Function:string=average"},{text:_("Min"),uno:".uno:AutoSum?Function:string=min"},{
text:_("Max"),uno:".uno:AutoSum?Function:string=max"},{text:_("Count"),
uno:".uno:AutoSum?Function:string=count"}]);var functionCategories;(function(functionCategories){
functionCategories[functionCategories["DATABASE"]=1]="DATABASE";functionCategories[
functionCategories["DATEnTIME"]=2]="DATEnTIME";functionCategories[functionCategories["FINANCIAL"]=3
]="FINANCIAL";functionCategories[functionCategories["INFORMATION"]=4]="INFORMATION";
functionCategories[functionCategories["LOGICAL"]=5]="LOGICAL";functionCategories[functionCategories[
"MATHEMATICAL"]=6]="MATHEMATICAL";functionCategories[functionCategories["ARRAY"]=7]="ARRAY";
functionCategories[functionCategories["STATISTICAL"]=8]="STATISTICAL";functionCategories[
functionCategories["SPREADSHEET"]=9]="SPREADSHEET";functionCategories[functionCategories["TEXT"]=10
]="TEXT"})(functionCategories||(functionCategories={}));var financialFunctions=[{en:"ACCRINT",
de:"AUFGELZINS",fr:"INTERET.ACC",es:"INT.ACUM"},{en:"ACCRINTM",de:"AUFGELZINSF",
fr:"INTERET.ACC.MAT",es:"INT.ACUM.V"},{en:"AMORDEGRC",de:"AMORDEGRK",fr:"AMORDEGRC",
es:"AMORTIZ.PROGRE"},{en:"AMORLINC",de:"AMORLINEARK",fr:"AMORLINC",es:"AMORTIZ.LIN"},{
en:"COUPDAYBS",de:"ZINSTERMTAGVA",fr:"NB.JOURS.COUPON.PREC",es:"CUPON.DIAS.L1"},{en:"COUPDAYS",
de:"ZINSTERMTAGE",fr:"NB.JOURS.COUPONS",es:"CUPON.DIAS"},{en:"COUPDAYSNC",de:"ZINSTERMTAGNZ",
fr:"NB.JOURS.COUPON.SUIV",es:"CUPON.DIAS.L2"},{en:"COUPNUM",de:"ZINSTERMZAHL",fr:"NB.COUPONS",
es:"CUPON.NUM"},{en:"COUPPCD",de:"ZINSTERMVZ",fr:"DATE.COUPON.PREC",es:"CUPON.FECHA.L1"},{
en:"CUMIPMT",de:"KUMZINSZ",fr:"CUMUL.INTER",es:"PAGO.INT.ENTRE"},{en:"CUMIPMT_ADD",de:"KUMZINSZ_ADD"
},{en:"CUMPRINC",de:"KUMKAPITAL",fr:"CUMUL.PRINCPER",es:"PAGO.PRINC.ENTRE"},{en:"CUMPRINC_ADD",
de:"KUMKAPITAL_ADD"},{en:"DB",de:"GDA2",fr:"DB",es:"DB"},{en:"DDB",de:"GDA",fr:"DDB",es:"DDB"},{
en:"DISC",de:"DISAGIO",fr:"TAUX.ESCOMPTE",es:"TASA.DESC"},{en:"DOLLARDE",de:"NOTIERUNGDEZ",
fr:"PRIX.DEC",es:"MONEDA.DEC"},{en:"DOLLARFR",de:"NOTIERUNGBRU",fr:"PRIX.FRAC",es:"MONEDA.FRAC"},{
en:"DURATION",de:"LAUFZEIT",fr:"DUREE",es:"DURACION"},{en:"EFFECT",de:"EFFEKTIV",fr:"TAUX.EFFECTIF",
es:"INT.EFECTIVO"},{en:"EFFECT_ADD",de:"EFFEKTIV_ADD"},{en:"FV",de:"Zielwert",fr:"VC",es:"vf"},{
en:"FVSCHEDULE",de:"ZW2",fr:"VC.PAIEMENTS",es:"VF.PLAN"},{en:"INTRATE",de:"ZINSSATZ",
fr:"TAUX.INTERET",es:"TASA.INT"},{en:"IPMT",de:"ZINSZ",fr:"INTPER",es:"PAGOINT"},{en:"IRR",de:"IKV",
fr:"TAUXRI",es:"TIR"},{en:"ISPMT",de:"ISPMT",fr:"ISPMT",es:"INT.PAGO.DIR"},{en:"MDURATION",
de:"MLAUFZEIT",fr:"DUREE.MODIFIEE",es:"DURACION.MODIF"},{en:"MIRR",de:"QIKV",fr:"TRIM",es:"TIRM"},{
en:"NOMINAL",de:"NOMINAL",fr:"TAUX.NOMINAL",es:"TASA.NOMINAL"},{en:"NOMINAL_ADD",de:"NOMINAL_ADD"},{
en:"NPER",de:"Zeitraum",fr:"NPER",es:"NPER"},{en:"NPV",de:"NBW",fr:"VAN",es:"VNA"},{en:"ODDFPRICE",
de:"UNREGERKURS",fr:"PRIX.PCOUPON.IRREG",es:"PRECIO.PER.IRREGULAR.1"},{en:"ODDFYIELD",
de:"UNREGERREND",fr:"REND.PCOUPON.IRREG",es:"RENDTO.PER.IRREGULAR.1"},{en:"ODDLPRICE",
de:"UNREGLEKURS",fr:"PRIX.DCOUPON.IRREG",es:"PRECIO.PER.IRREGULAR.2"},{en:"ODDLYIELD",
de:"UNREGLEREND",fr:"REND.DCOUPON.IRREG",es:"RENDTO.PER.IRREGULAR.2"},{en:"OPT_BARRIER",
de:"OPT_BARRIER",fr:"OPT_BARRIER",es:"OPT_BARRIER"},{en:"OPT_PROB_HIT",de:"OPT_PROB_HIT",
fr:"OPT_PROB_HIT",es:"OPT_PROB_HIT"},{en:"OPT_PROB_INMONEY",de:"OPT_PROB_INMONEY",
fr:"OPT_PROB_INMONEY",es:"OPT_PROB_INMONEY"},{en:"OPT_TOUCH",de:"OPT_TOUCH",fr:"OPT_TOUCH",
es:"OPT_TOUCH"},{en:"PDURATION",de:"PLAUFZEIT",fr:"DUREE.PERIODE",es:"P.DURACION"},{en:"PMT",
de:"Zahlungen",fr:"VPM",es:"PAGO"},{en:"PPMT",de:"KAPZ",fr:"PRINCPER",es:"PAGOPRIN"},{en:"PRICE",
de:"KURS",fr:"PRIX.TITRE",es:"PRECIO"},{en:"PRICEDISC",de:"KURSDISAGIO",fr:"VALEUR.ENCAISSEMENT",
es:"PRECIO.DESCUENTO"},{en:"PRICEMAT",de:"KURSFÄLLIG",fr:"PRIX.TITRE.ECHEANCE",
es:"PRECIO.VENCIMIENTO"},{en:"PV",de:"BW",fr:"VA",es:"VA"},{en:"RATE",de:"ZINS",fr:"TAUX",es:"TASA"}
,{en:"RECEIVED",de:"AUSZAHLUNG",fr:"VALEUR.NOMINALE",es:"CANTIDAD.RECIBIDA"},{en:"RRI",de:"ZGZ",
fr:"RENTINVEST",es:"INT.RENDIMIENTO"},{en:"SLN",de:"LIA",fr:"AMORLIN",es:"SLN"},{en:"SYD",de:"DIA",
fr:"SYD",es:"SYD"},{en:"TBILLEQ",de:"TBILLÄQUIV",fr:"TAUX.ESCOMPTE.R",es:"LETRA.DE.TES.EQV.A.BONO"},
{en:"TBILLPRICE",de:"TBILLKURS",fr:"PRIX.BON.TRESOR",es:"LETRA.DE.TES.PRECIO"},{en:"TBILLYIELD",
de:"TBILLRENDITE",fr:"RENDEMENT.BON.TRESOR",es:"LETRA.DE.TES.RENDTO"},{en:"XIRR",de:"XINTZINSFUSS",
fr:"TRI.PAIEMENTS",es:"TIR.NO.PER"},{en:"XNPV",de:"XKAPITALWERT",fr:"VAN.PAIEMENTS",es:"VNA.NO.PER"}
,{en:"YIELD",de:"RENDITE",fr:"RENDEMENT.TITRE",es:"RENDTO"},{en:"YIELDDISC",de:"RENDITEDIS",
fr:"RENDEMENT.SIMPLE",es:"RENDTO.DESC"},{en:"YIELDMAT",de:"RENDITEFÄLL",
fr:"RENDEMENT.TITRE.ECHEANCE",es:"RENDTO.VENCTO"}];var logicalFunctions=[{en:"AND",de:"UND",fr:"ET",
es:"Y"},{en:"FALSE",de:"FALSCH",fr:"FAUX",es:"FALSO"},{en:"IF",de:"WENN",fr:"SI",es:"SI"},{
en:"IFERROR",de:"WENNFEHLER",fr:"SIERREUR",es:"SI.ERROR"},{en:"IFNA",de:"WENNNV",fr:"SINA",
es:"SI.ND"},{en:"IFS",de:"WENNS",fr:"SI.CONDITIONS",es:"SI.CONJUNTO"},{en:"NOT",de:"NICHT",fr:"NON",
es:"NO"},{en:"OR",de:"ODER",fr:"OU",es:"O"},{en:"SWITCH",de:"SCHALTER",fr:"SI.MULTIPLE",es:"CAMBIAR"
},{en:"TRUE",de:"WAHR",fr:"VRAI",es:"VERDADERO"},{en:"XOR",de:"XODER",fr:"XOR",es:"XO"}];
var textFunctions=[{en:"ARABIC",de:"ARABISCH",fr:"ARABE",es:"NUMERO.ARABE"},{en:"ASC",de:"ASC",
fr:"ASC",es:"ASC"},{en:"BAHTTEXT",de:"BAHTTEXT",fr:"BAHTTEXTE",es:"TEXTOBAHT"},{en:"BASE",
de:"BASIS",fr:"BASE",es:"BASE"},{en:"CHAR",de:"ZEICHEN",fr:"CAR",es:"CARACTER"},{en:"CLEAN",
de:"SÄUBERN",fr:"EPURAGE",es:"LIMPIAR"},{en:"CODE",de:"CODE",fr:"CODE",es:"CODIGO"},{en:"CONCAT",
de:"TEXTKETTE",fr:"CONCAT",es:"CONCAT"},{en:"CONCATENATE",de:"VERKETTEN",fr:"CONCATENER",
es:"CONCATENAR"},{en:"DECIMAL",de:"DEZIMAL",fr:"DECIMAL",es:"DECIMAL"},{en:"DOLLAR",de:"EUR",
fr:"FRANC",es:"MONEDA"},{en:"ENCODEURL",de:"URLCODIEREN",fr:"ENCODEURL",es:"URLCODIF"},{
en:"FILTERXML",de:"XMLFILTERN",fr:"FILTREXML",es:"XMLFILTRO"},{en:"FIND",de:"FINDEN",fr:"TROUVE",
es:"ENCONTRAR"},{en:"FINDB",de:"FINDENB",fr:"TROUVEB",es:"ENCONTRARB"},{en:"FIXED",de:"FEST",
fr:"CTXT",es:"FIJO"},{en:"JIS",de:"JIS",fr:"JIS",es:"JIS"},{en:"LEFT",de:"LINKS",fr:"GAUCHE",
es:"IZQUIERDA"},{en:"LEFTB",de:"LINKSB",fr:"GAUCHEB",es:"IZQUIERDAB"},{en:"LEN",de:"LÄNGE",
fr:"NBCAR",es:"LARGO"},{en:"LENB",de:"LÄNGEB",fr:"NBCARB",es:"LARGOB"},{en:"LOWER",de:"KLEIN",
fr:"MINUSCULE",es:"MINUSC"},{en:"MID",de:"TEIL",fr:"STXT",es:"EXTRAE"},{en:"MIDB",de:"TEILB",
fr:"STXTB",es:"EXTRAEB"},{en:"NUMBERVALUE",de:"ZAHLWERT",fr:"VALEUR.NOMBRE",es:"VALOR.NUMERO"},{
en:"PROPER",de:"GROSS2",fr:"NOMPROPRE",es:"NOMPROPIO"},{en:"REGEX",de:"REGAUS",fr:"REGEX",
es:"EXP.REG"},{en:"REPLACE",de:"ERSETZEN",fr:"REMPLACER",es:"REEMPLAZAR"},{en:"REPLACEB",
de:"ERSETZENB",fr:"REMPLACERB",es:"REEMPLAZARB"},{en:"REPT",de:"WIEDERHOLEN",fr:"REPT",es:"REPETIR"}
,{en:"RIGHT",de:"RECHTS",fr:"DROITE",es:"DERECHA"},{en:"RIGHTB",de:"RECHTSB",fr:"DROITEB",
es:"DERECHAB"},{en:"ROMAN",de:"RÖMISCH",fr:"ROMAIN",es:"ROMANO"},{en:"ROT13",de:"ROT13",fr:"ROT13",
es:"ROT13"},{en:"SEARCH",de:"SUCHEN",fr:"CHERCHE",es:"HALLAR"},{en:"SEARCHB",de:"SUCHENB",
fr:"CHERCHEB",es:"HALLARB"},{en:"SUBSTITUTE",de:"WECHSELN",fr:"SUBSTITUE",es:"SUSTITUIR"},{en:"T",
de:"T",fr:"T",es:"T"},{en:"TEXT",de:"TEXT",fr:"TEXTE",es:"TEXTO"},{en:"TEXTJOIN",de:"VERBINDEN",
fr:"JOINDRE.TEXTE",es:"UNIRCADENAS"},{en:"TRIM",de:"GLÄTTEN",fr:"SUPPRESPACE",es:"ESPACIOS"},{
en:"UNICHAR",de:"UNIZEICHEN",fr:"UNICAR",es:"UNICAR"},{en:"UNICODE",de:"UNICODE",fr:"UNICODE",
es:"UNICODE"},{en:"UPPER",de:"GROSS",fr:"MAJUSCULE",es:"MAYUSC"},{en:"VALUE",de:"WERT",fr:"CNUM",
es:"VALOR"},{en:"WEBSERVICE",de:"WEBDIENST",fr:"SERVICEWEB",es:"SERVICIOWEB"}];
var dateAndTimeFunctions=[{en:"DATE",de:"DATUM",fr:"DATE",es:"FECHA"},{en:"DATEDIF",de:"DATUMDIF",
fr:"DATEDIF",es:"SIFECHA"},{en:"DATEVALUE",de:"DATUMWERT",fr:"DATEVAL",es:"FECHANUMERO"},{en:"DAY",
de:"TAG",fr:"JOUR",es:"DIA"},{en:"DAYS",de:"TAGE",fr:"JOURS",es:"DIAS"},{en:"DAYS360",de:"TAGE360",
fr:"JOURS360",es:"DIAS360"},{en:"DAYSINMONTH",de:"TAGEIMMONAT",fr:"JOURSDANSMOIS",es:"DIASENMES"},{
en:"DAYSINYEAR",de:"TAGEIMJAHR",fr:"JOURSDANSANNEE",es:"DIASENAÑO"},{en:"EASTERSUNDAY",
de:"OSTERSONNTAG",fr:"DIMANCHEDEPAQUES",es:"DOMINGOPASCUA"},{en:"EDATE",de:"EDATUM",
fr:"MOIS.DECALER",es:"FECHA.MES"},{en:"EOMONTH",de:"MONATSENDE",fr:"FIN.MOIS",es:"FIN.MES"},{
en:"HOUR",de:"STUNDE",fr:"HEURE",es:"HORA"},{en:"ISLEAPYEAR",de:"ISTSCHALTJAHR",fr:"ESTBISSEXTILE",
es:"ESAÑOBISIESTO"},{en:"ISOWEEKNUM",de:"ISOKALENDERWOCHE",fr:"NO.SEMAINE.ISO",
es:"ISO.NUM.DE.SEMANA"},{en:"MINUTE",de:"MINUTE",fr:"MINUTE",es:"MINUTO"},{en:"MONTH",de:"MONAT",
fr:"MOIS",es:"MES"},{en:"MONTHS",de:"MONATE",fr:"NB.MOIS",es:"MESES"},{en:"NETWORKDAYS",
de:"NETTOARBEITSTAGE",fr:"NB.JOURS.OUVRES",es:"DIAS.LAB"},{en:"NETWORKDAYS.INTL",
de:"NETTOARBEITSTAGE.INTL",fr:"NB.JOURS.OUVRES.INTL",es:"DIAS.LAB.INTL"},{en:"NOW",de:"JETZT",
fr:"MAINTENANT",es:"AHORA"},{en:"SECOND",de:"SEKUNDE",fr:"SECONDE",es:"SEGUNDO"},{en:"TIME",
de:"ZEIT",fr:"TEMPS",es:"NSHORA"},{en:"TIMEVALUE",de:"ZEITWERT",fr:"TEMPSVAL",es:"HORANUMERO"},{
en:"TODAY",de:"HEUTE",fr:"AUJOURDHUI",es:"HOY"},{en:"WEEKDAY",de:"WOCHENTAG",fr:"JOURSEM",
es:"DIASEM"},{en:"WEEKNUM",de:"KALENDERWOCHE",fr:"NO.SEMAINE",es:"NUM.DE.SEMANA"},{
en:"WEEKNUM_EXCEL2003",de:"KALENDERWOCHE_EXCEL2003"},{en:"WEEKNUM_OOO",de:"KALENDERWOCHE_OOO",
fr:"NO.SEMAINE_OOO",es:"NUM.DE.SEMANA_OOO"},{en:"WEEKS",de:"WOCHEN",fr:"SEMAINES",es:"SEMANAS"},{
en:"WEEKSINYEAR",de:"WOCHENIMJAHR",fr:"SEMAINESDANSANNEE",es:"SEMANASENAÑO"},{en:"WORKDAY",
de:"ARBEITSTAG",fr:"SERIE.JOUR.OUVRE",es:"DIA.LAB"},{en:"WORKDAY.INTL",de:"ARBEITSTAG.INTL",
fr:"SERIE.JOUR.OUVRE.INTL",es:"DIA.LAB.INTL"},{en:"YEAR",de:"JAHR",fr:"ANNEE",es:"AÑO"},{
en:"YEARFRAC",de:"BRTEILJAHRE",fr:"FRACTION.ANNEE",es:"FRAC.AÑO"},{en:"YEARS",de:"JAHRE",
fr:"ANNEES",es:"AÑOS"}];var lookupFunctions=[{en:"HLOOKUP",de:"WVERWEIS",fr:"RECHERCHEH",
es:"BUSCARH"},{en:"LOOKUP",de:"VERWEIS",fr:"RECHERCHE",es:"BUSCAR"},{en:"VLOOKUP",de:"SVERWEIS",
fr:"RECHERCHEV",es:"BUSCARV"},{en:"XLOOKUP",de:"XVERWEIS",fr:"RECHERCHEX",es:"BUSCARX"}];
var refFunctions=[{en:"ISREF",de:"ISTBEZUG",fr:"ESTREF",es:"ESREF"}];var mathAndTrigFunctions=[{
en:"ABS",de:"BETRAG",fr:"ABS",es:"ABS"},{en:"ACOS",de:"ARCCOS",fr:"ACOS",es:"ACOS"},{en:"ACOSH",
de:"ARCCOSHYP",fr:"ACOSH",es:"ACOSH"},{en:"ACOT",de:"ARCCOT",fr:"ACOT",es:"ACOT"},{en:"ACOTH",
de:"ARCCOTHYP",fr:"ACOTH",es:"ACOTH"},{en:"AGGREGATE",de:"AGGREGAT",fr:"AGREGAT",es:"AGREGAR"},{
en:"ASIN",de:"ARCSIN",fr:"ASIN",es:"ASEN"},{en:"ASINH",de:"ARCSINHYP",fr:"ASINH",es:"ASENH"},{
en:"ATAN",de:"ARCTAN",fr:"ATAN",es:"ATAN"},{en:"ATAN2",de:"ARCTAN2",fr:"ATAN2",es:"ATAN2"},{
en:"ATANH",de:"ARCTANHYP",fr:"ATANH",es:"ATANH"},{en:"BITAND",de:"BITUND",fr:"BITAND",es:"BIT.Y"},{
en:"BITLSHIFT",de:"BITLVERSCHIEB",fr:"BITLSHIFT",es:"BIT.DESPLIZQDA"},{en:"BITOR",de:"BITODER",
fr:"BITOR",es:"BIT.O"},{en:"BITRSHIFT",de:"BITRVERSCHIEB",fr:"BITRSHIFT",es:"BIT.DESPLDCHA"},{
en:"BITXOR",de:"BITXODER",fr:"BITXOR",es:"BIT.XO"},{en:"CEILING",de:"OBERGRENZE",fr:"PLAFOND",
es:"MULTIPLO.SUPERIOR"},{en:"CEILING.MATH",de:"OBERGRENZE.MATHEMATIK",fr:"PLAFOND.MATH",
es:"MULTIPLO.SUPERIOR.MAT"},{en:"CEILING.PRECISE",de:"OBERGRENZE.GENAU",fr:"PLAFOND.PRECIS",
es:"MULTIPLO.SUPERIOR.EXACTO"},{en:"CEILING.XCL",de:"OBERGRENZE.EXCEL",fr:"PLAFOND.XCL",
es:"MULTIPLO.SUPERIOR.XCL"},{en:"COLOR",de:"FARBE",fr:"COULEUR",es:"COLOR"},{en:"COMBIN",
de:"KOMBINATIONEN",fr:"COMBIN",es:"COMBINAT"},{en:"COMBINA",de:"KOMBINATIONEN2",fr:"COMBINA",
es:"COMBINATA"},{en:"CONVERT_OOO",de:"UMRECHNEN_OOO",fr:"CONVERTIR_OOO",es:"CONVERTIR_OOO"},{
en:"COS",de:"COS",fr:"COS",es:"COS"},{en:"COSH",de:"COSHYP",fr:"COSH",es:"COSH"},{en:"COT",de:"COT",
fr:"COT",es:"COT"},{en:"COTH",de:"COTHYP",fr:"COTH",es:"COTH"},{en:"CSC",de:"COSEC",fr:"CSC",
es:"CSC"},{en:"CSCH",de:"COSECHYP",fr:"CSCH",es:"CSCH"},{en:"DEGREES",de:"GRAD",fr:"DEGRES",
es:"GRADOS"},{en:"EUROCONVERT",de:"EUROUMRECHNEN",fr:"EUROCONVERT",es:"EUROCONVERT"},{en:"EVEN",
de:"GERADE",fr:"PAIR",es:"REDONDEA.PAR"},{en:"EXP",de:"EXP",fr:"EXP",es:"EXP"},{en:"FACT",
de:"FAKULTÄT",fr:"FACT",es:"FACT"},{en:"FLOOR",de:"UNTERGRENZE",fr:"PLANCHER",es:"MULTIPLO.INFERIOR"
},{en:"FLOOR.MATH",de:"UNTERGRENZE.MATHEMATIK",fr:"PLANCHER.MATH",es:"MULTIPLO.INFERIOR.MAT"},{
en:"FLOOR.PRECISE",de:"UNTERGRENZE.GENAU",fr:"PLANCHER.PRECIS",es:"MULTIPLO.INFERIOR.EXACTO"},{
en:"FLOOR.XCL",de:"UNTERGRENZE.EXCEL",fr:"PLANCHER.XCL",es:"MULTIPLO.INFERIOR.XCL"},{en:"GCD",
de:"GGT",fr:"PGCD",es:"M.C.D"},{en:"GCD_EXCEL2003",de:"GGT_EXCEL2003"},{en:"INT",de:"GANZZAHL",
fr:"ENT",es:"ENTERO"},{en:"ISO.CEILING",de:"ISO.OBERGRENZE",fr:"ISO.PLAFOND",
es:"MULTIPLO.SUPERIOR.ISO"},{en:"LCM",de:"KGV",fr:"PPCM",es:"M.C.M"},{en:"LCM_EXCEL2003",
de:"KGV_EXCEL2003"},{en:"LN",de:"LN",fr:"LN",es:"LN"},{en:"LOG",de:"LOG",fr:"LOG",es:"LOG"},{
en:"LOG10",de:"LOG10",fr:"LOG10",es:"LOG10"},{en:"MOD",de:"REST",fr:"MOD",es:"RESIDUO"},{
en:"MROUND",de:"VRUNDEN",fr:"ARRONDI.AU.MULTIPLE",es:"REDOND.MULT"},{en:"MULTINOMIAL",
de:"POLYNOMIAL",fr:"MULTINOMIALE",es:"MULTINOMIAL"},{en:"ODD",de:"UNGERADE",fr:"IMPAIR",
es:"REDONDEA.IMPAR"},{en:"PI",de:"PI",fr:"PI",es:"PI"},{en:"POWER",de:"POTENZ",fr:"PUISSANCE",
es:"POTENCIA"},{en:"PRODUCT",de:"PRODUKT",fr:"PRODUIT",es:"PRODUCTO"},{en:"QUOTIENT",de:"QUOTIENT",
fr:"QUOTIENT",es:"COCIENTE"},{en:"RADIANS",de:"BOGENMASS",fr:"RADIANS",es:"RADIANES"},{en:"RAND",
de:"ZUFALLSZAHL",fr:"ALEA",es:"ALEATORIO"},{en:"RAND.NV",de:"ZUFALLSZAHL.NF",fr:"ALEA.NV",
es:"ALEATORIO.NV"},{en:"RANDARRAY",de:"ZUFALLSMATRIX",fr:"TABLEAU.ALEA",es:"MATRIZALEAT"},{
en:"RANDBETWEEN",de:"ZUFALLSBEREICH",fr:"ALEA.ENTRE.BORNES",es:"ALEATORIO.ENTRE"},{
en:"RANDBETWEEN.NV",de:"ZUFALLSBEREICH.NF",fr:"ALEA.ENTRE.BORNES.NV",es:"ALEATORIO.ENTRE.NV"},{
en:"ROUND",de:"RUNDEN",fr:"ARRONDI",es:"REDONDEAR"},{en:"ROUNDDOWN",de:"ABRUNDEN",fr:"ARRONDI.INF",
es:"REDONDEAR.MENOS"},{en:"ROUNDSIG",de:"RUNDENSIG",fr:"ARRONDI_PRECISION",es:"REDONDEAR.PRECISION"}
,{en:"ROUNDUP",de:"AUFRUNDEN",fr:"ARRONDI.SUP",es:"REDONDEAR.MAS"},{en:"SEC",de:"SEC",fr:"SEC",
es:"SEC"},{en:"SECH",de:"SECHYP",fr:"SECH",es:"SECH"},{en:"SERIESSUM",de:"POTENZREIHE",
fr:"SOMME.SERIES",es:"SUMA.SERIES"},{en:"SIGN",de:"VORZEICHEN",fr:"SIGNE",es:"SIGNO"},{en:"SIN",
de:"SIN",fr:"SIN",es:"SEN"},{en:"SINH",de:"SINHYP",fr:"SINH",es:"SENH"},{en:"SQRT",de:"WURZEL",
fr:"RACINE",es:"RAIZ"},{en:"SQRTPI",de:"WURZELPI",fr:"RACINE.PI",es:"RAIZ2PI"},{en:"SUBTOTAL",
de:"TEILERGEBNIS",fr:"SOUS.TOTAL",es:"SUBTOTALES"},{en:"SUM",de:"SUMME",fr:"SOMME",es:"SUMA"},{
en:"SUMIF",de:"SUMMEWENN",fr:"SOMME.SI",es:"SUMAR.SI"},{en:"SUMIFS",de:"SUMMEWENNS",
fr:"SOMME.SI.ENS",es:"SUMAR.SI.CONJUNTO"},{en:"SUMSQ",de:"QUADRATESUMME",fr:"SOMME.CARRES",
es:"SUMA.CUADRADOS"},{en:"TAN",de:"TAN",fr:"TAN",es:"TAN"},{en:"TANH",de:"TANHYP",fr:"TANH",
es:"TANH"},{en:"TRUNC",de:"KÜRZEN",fr:"TRONQUE",es:"TRUNCAR"}];var statisticalFunctions=[{
en:"AVEDEV",de:"MITTELABW",fr:"ECART.MOYEN",es:"DESVPROM"},{en:"AVERAGE",de:"MITTELWERT",
fr:"MOYENNE",es:"PROMEDIO"},{en:"AVERAGEA",de:"MITTELWERTA",fr:"MOYENNEA",es:"PROMEDIOA"},{
en:"AVERAGEIF",de:"MITTELWERTWENN",fr:"MOYENNE.SI",es:"PROMEDIO.SI"},{en:"AVERAGEIFS",
de:"MITTELWERTWENNS",fr:"MOYENNE.SI.ENS",es:"PROMEDIO.SI.CONJUNTO"},{en:"B",de:"B",fr:"B",es:"B"},{
en:"BETA.DIST",de:"BETA.VERT",fr:"LOI.BETA",es:"DISTR.BETA.N"},{en:"BETA.INV",de:"BETA.INV",
fr:"BETA.INVERSE",es:"INV.BETA.N"},{en:"BETADIST",de:"BETAVERT",fr:"LOIBETA",es:"DISTR.BETA"},{
en:"BETAINV",de:"BETAINV",fr:"BETAINVERSE",es:"DISTR.BETA.INV"},{en:"BINOM.DIST",de:"BINOM.VERT",
fr:"LOI.BINOMIALE",es:"DISTR.BINOM.N"},{en:"BINOM.INV",de:"BINOM.INV",fr:"LOI.BINOMIALE.INVERSE.N",
es:"INV.BINOM"},{en:"BINOMDIST",de:"BINOMVERT",fr:"LOIBINOMIALE",es:"DISTR.BINOM"},{en:"CHIDIST",
de:"CHIVERT",fr:"LOIKHIDEUX",es:"DISTR.CHI"},{en:"CHIINV",de:"CHIINV",fr:"KHIDEUX.INVERSE",
es:"PRUEBA.CHI.INV"},{en:"CHISQ.DIST",de:"CHIQU.VERT",fr:"LOI.KHIDEUX.N",es:"DISTR.CHICUAD"},{
en:"CHISQ.DIST.RT",de:"CHIQU.VERT.RE",fr:"LOI.KHIDEUX.DROITE",es:"DISTR.CHICUAD.CD"},{
en:"CHISQ.INV",de:"CHIQU.INV",fr:"LOIKHIDEUX.INVERSE",es:"INV.CHICUAD"},{en:"CHISQ.INV.RT",
de:"CHIQU.INV.RE",fr:"LOI.KHIDEUX.INVERSE.DROITE",es:"INV.CHICUAD.CD"},{en:"CHISQ.TEST",
de:"CHIQU.TEST",fr:"TEST.LOI.KHIDEUX",es:"PRUEBA.CHICUAD"},{en:"CHISQDIST",de:"CHIQUVERT",
fr:"LOI.KHIDEUX",es:"CHISQDIST"},{en:"CHISQINV",de:"CHIQUINV",fr:"LOIKHIDEUXINVERSE",es:"CHISQINV"},
{en:"CHITEST",de:"CHITEST",fr:"TEST.KHIDEUX",es:"PRUEBA.CHI"},{en:"CONFIDENCE",de:"KONFIDENZ",
fr:"INTERVALLE.CONFIANCE",es:"CONFIANZA"},{en:"CONFIDENCE.NORM",de:"KONFIDENZ.NORM",
fr:"INTERVALLE.CONFIANCE.NORMAL",es:"INTERVALO.CONFIANZA.NORM"},{en:"CONFIDENCE.T",de:"KONFIDENZ.T",
fr:"INTERVALLE.CONFIANCE.T",es:"INTERVALO.CONFIANZA.T"},{en:"CORREL",de:"KORREL",
fr:"COEFFICIENT.CORRELATION",es:"COEF.DE.CORREL"},{en:"COUNT",de:"ANZAHL",fr:"NB",es:"CONTAR"},{
en:"COUNTA",de:"ANZAHL2",fr:"NBVAL",es:"CONTARA"},{en:"COUNTBLANK",de:"ANZAHLLEEREZELLEN",
fr:"NB.VIDE",es:"CONTAR.BLANCO"},{en:"COUNTIF",de:"ZÄHLENWENN",fr:"NB.SI",es:"CONTAR.SI"},{
en:"COUNTIFS",de:"ZÄHLENWENNS",fr:"NB.SI.ENS",es:"CONTAR.SI.CONJUNTO"},{en:"COVAR",de:"KOVARIANZ",
fr:"COVARIANCE",es:"COVAR"},{en:"COVARIANCE.P",de:"KOVARIANZ.P",fr:"COVARIANCE.PEARSON",
es:"COVARIANZA.P"},{en:"COVARIANCE.S",de:"KOVARIANZ.S",fr:"COVARIANCE.S",es:"COVARIANZA.M"},{
en:"CRITBINOM",de:"KRITBINOM",fr:"CRITERE.LOI.BINOMIALE",es:"BINOM.CRIT"},{en:"DEVSQ",
de:"SUMQUADABW",fr:"SOMME.CARRES.ECARTS",es:"DESVIA2"},{en:"ERF.PRECISE",de:"GAUSSF.GENAU",
fr:"ERF.PRECIS",es:"FUN.ERROR.EXACTO"},{en:"ERFC.PRECISE",de:"GAUSSFKOMPL.GENAU",fr:"ERFC.PRECIS",
es:"FUN.ERROR.COMPL.EXACTO"},{en:"EXPON.DIST",de:"EXPON.VERT",fr:"LOI.EXPONENTIELLE",
es:"DISTR.EXP.N"},{en:"EXPONDIST",de:"EXPONVERT",fr:"LOIEXPONENTIELLE",es:"DISTR.EXP"},{en:"F.DIST",
de:"F.VERT",fr:"LOI.F",es:"DIST.F"},{en:"F.DIST.RT",de:"F.VERT.RE",fr:"LOI.F.DROITE",es:"DISTR.F.CD"
},{en:"F.INV",de:"F.INV",fr:"INVERSE.LOI.F",es:"F.INV"},{en:"F.INV.RT",de:"F.INV.RE",
fr:"INVERSE.LOI.F.DROITE",es:"INV.F.CD"},{en:"F.TEST",de:"F.TEST",fr:"TEST.F",es:"PRUEBA.F.N"},{
en:"F.DIST",de:"F.VERT",fr:"LOI.F",es:"DIST.F"},{en:"F.INV",de:"F.INV",fr:"INVERSE.LOI.F",es:"F.INV"
},{en:"FISHER",de:"FISHER",fr:"FISHER",es:"FISHER"},{en:"FISHERINV",de:"FISHERINV",
fr:"FISHER.INVERSE",es:"PRUEBA.FISHER.INV"},{en:"FORECAST",de:"PROGNOSE",fr:"PREVISION",
es:"PRONOSTICO"},{en:"FORECAST.ETS.ADD",de:"PROGNOSE.EXP.ADD",fr:"PREVISION.ETS.ADD",
es:"PRONOSTICO.ETS.SUM"},{en:"FORECAST.ETS.MULT",de:"PROGNOSE.EXP.MULT",fr:"PREVISION.ETS.MULT",
es:"PRONOSTICO.ETS.MULT"},{en:"FORECAST.ETS.PI.ADD",de:"PROGNOSE.EXP.VOR.ADD",
fr:"PREVISION.ETS.PI.ADD",es:"PRONOSTICO.ETS.PI.SUM"},{en:"FORECAST.ETS.PI.MULT",
de:"PROGNOSE.EXP.VOR.MULT",fr:"PREVISION.ETS.PI.MULT",es:"PRONOSTICO.ETS.PI.MULT"},{
en:"FORECAST.ETS.SEASONALITY",de:"PROGNOSE.EXP.SAISONAL",fr:"PREVISION.ETS.CARACTERESAISONNIER",
es:"PRONOSTICO.ETS.ESTACIONALIDAD"},{en:"FORECAST.ETS.STAT.ADD",de:"PROGNOSE.EXP.STAT.ADD",
fr:"PREVISION.ETS.STAT.ADD",es:"PRONOSTICO.ETS.ESTADISTICA.SUM"},{en:"FORECAST.ETS.STAT.MULT",
de:"PROGNOSE.EXP.STAT.MULT",fr:"PREVISION.ETS.STAT.MULT",es:"PRONOSTICO.ETS.ESTADISTICA.MULT"},{
en:"FORECAST.LINEAR",de:"PROGNOSE.LINEAR",fr:"PREVISION.LINEAIRE",es:"PRONOSTICO.LINEAL"},{
en:"FTEST",de:"FTEST",fr:"TESTF",es:"PRUEBA.F"},{en:"GAMMA",de:"GAMMA",fr:"GAMMA",es:"GAMMA"},{
en:"GAMMA.DIST",de:"GAMMA.VERT",fr:"LOI.GAMMA",es:"DISTR.GAMMA.N"},{en:"GAMMA.INV",de:"GAMMA.INV",
fr:"LOI.GAMMA.INVERSE",es:"INV.GAMMA"},{en:"GAMMADIST",de:"GAMMAVERT",fr:"LOIGAMMA",es:"DISTR.GAMMA"
},{en:"GAMMAINV",de:"GAMMAINV",fr:"LOIGAMMAINVERSE",es:"DISTR.GAMMA.INV"},{en:"GAMMALN",
de:"GAMMALN",fr:"LNGAMMA",es:"GAMMA.LN"},{en:"GAMMALN.PRECISE",de:"GAMMALN.GENAU",
fr:"LNGAMMA.PRECIS",es:"GAMMA.LN.EXACTO"},{en:"GAUSS",de:"GAUSS",fr:"GAUSS",es:"GAUSS"},{
en:"GEOMEAN",de:"GEOMITTEL",fr:"MOYENNE.GEOMETRIQUE",es:"MEDIA.GEOM"},{en:"HARMEAN",de:"HARMITTEL",
fr:"MOYENNE.HARMONIQUE",es:"MEDIA.ARMO"},{en:"HYPGEOM.DIST",de:"HYPGEOM.VERT",
fr:"LOI.HYPERGEOMETRIQUE",es:"DISTR.HIPERGEOM.N"},{en:"HYPGEOMDIST",de:"HYPGEOMVERT",
fr:"LOIHYPERGEOMETRIQUE",es:"DISTR.HIPERGEOM"},{en:"INTERCEPT",de:"ACHSENABSCHNITT",
fr:"ORDONNEE.ORIGINE",es:"INTERSECCION.EJE"},{en:"KURT",de:"KURT",fr:"KURTOSIS",es:"CURTOSIS"},{
en:"LARGE",de:"KGRÖSSTE",fr:"GRANDE.VALEUR",es:"K.ESIMO.MAYOR"},{en:"LOGINV",de:"LOGINV",
fr:"LOI.LOGNORMALE.INVERSE",es:"INV.LOG"},{en:"LOGNORM.DIST",de:"LOGNORM.VERT",fr:"LOI.LOGNORMALE",
es:"DISTR.LOGNORM"},{en:"LOGNORM.INV",de:"LOGNORM.INV",fr:"LOI.LOGNORMALE.INVERSE.N",
es:"INV.LOGNORM"},{en:"LOGNORMDIST",de:"LOGNORMVERT",fr:"LOILOGNORMALE",es:"DISTR.LOG.NORM"},{
en:"MAX",de:"MAX",fr:"MAX",es:"MAX"},{en:"MAXA",de:"MAXA",fr:"MAXA",es:"MAXA"},{en:"MAXIFS",
de:"MAXWENNS",fr:"MAX.SI",es:"MAX.SI.CONJUNTO"},{en:"MEDIAN",de:"MEDIAN",fr:"MEDIANE",es:"MEDIANA"},
{en:"MIN",de:"MIN",fr:"MIN",es:"MIN"},{en:"MINA",de:"MINA",fr:"MINA",es:"MINA"},{en:"MINIFS",
de:"MINWENNS",fr:"MIN.SI",es:"MIN.SI.CONJUNTO"},{en:"MODE",de:"MODALWERT",fr:"MODE",es:"MODO"},{
en:"MODE.SNGL",de:"MODUS.EINF",fr:"MODE.SIMPLE",es:"MODA.UNO"},{en:"NEGBINOM.DIST",
de:"NEGBINOM.VERT",fr:"LOI.BINOMIALE.NEG",es:"NEGBINOM.DIST"},{en:"NEGBINOMDIST",de:"NEGBINOMVERT",
fr:"LOIBINOMIALENEG",es:"NEGBINOMDIST"},{en:"NORMSDIST",de:"STANDNORMVERT",fr:"LOINORMALESTANDARD",
es:"DISTR.NORM.ESTAND"},{en:"NORM.DIST",de:"NORM.VERT",fr:"LOI.NORMALE",es:"DISTR.NORM.N"},{
en:"NORMSDIST",de:"STANDNORMVERT",fr:"LOINORMALESTANDARD",es:"DISTR.NORM.ESTAND"},{en:"NORMSINV",
de:"STANDNORMINV",fr:"LOINORMALESTANDARDINVERSE",es:"DISTR.NORM.ESTAND.INV"},{en:"NORM.INV",
de:"NORM.INV",fr:"LOI.NORMALE.INVERSE",es:"INV.NORM"},{en:"NORMSINV",de:"STANDNORMINV",
fr:"LOINORMALESTANDARDINVERSE",es:"DISTR.NORM.ESTAND.INV"},{en:"NORM.S.DIST",de:"NORM.S.VERT",
fr:"LOI.NORMALE.STANDARD",es:"DISTR.NORM.ESTAND.N"},{en:"NORM.S.INV",de:"NORM.S.INV",
fr:"LOI.NORMALE.STANDARD.INVERSE",es:"INV.NORM.ESTAND"},{en:"NORMDIST",de:"NORMVERT",
fr:"LOINORMALE",es:"DISTR.NORM"},{en:"NORMINV",de:"NORMINV",fr:"LOINORMALEINVERSE",
es:"DISTR.NORM.INV"},{en:"NORMSDIST",de:"STANDNORMVERT",fr:"LOINORMALESTANDARD",
es:"DISTR.NORM.ESTAND"},{en:"NORMSINV",de:"STANDNORMINV",fr:"LOINORMALESTANDARDINVERSE",
es:"DISTR.NORM.ESTAND.INV"},{en:"PEARSON",de:"PEARSON",fr:"PEARSON",es:"PEARSON"},{en:"PERCENTILE",
de:"QUANTIL",fr:"CENTILE",es:"PERCENTIL"},{en:"PERCENTILE.EXC",de:"QUANTIL.EXKL",
fr:"CENTILE.EXCLURE",es:"PERCENTIL.EXC"},{en:"PERCENTILE.INC",de:"QUANTIL.INKL",
fr:"CENTILE.INCLURE",es:"PERCENTIL.INC"},{en:"PERCENTRANK",de:"QUANTILSRANG",fr:"RANG.POURCENTAGE",
es:"RANGO.PERCENTIL"},{en:"PERCENTRANK.EXC",de:"QUANTILSRANG.EXKL",fr:"RANG.POURCENTAGE.EXCLURE",
es:"RANGO.PERCENTIL.EXC"},{en:"PERCENTRANK.INC",de:"QUANTILSRANG.INKL",
fr:"RANG.POURCENTAGE.INCLURE",es:"RANGO.PERCENTIL.INC"},{en:"PERMUT",de:"VARIATIONEN",
fr:"PERMUTATION",es:"PERMUTACIONES"},{en:"PERMUTATIONA",de:"VARIATIONEN2",fr:"PERMUTATIONA",
es:"PERMUTACIONESA"},{en:"PHI",de:"PHI",fr:"PHI",es:"FI"},{en:"PROB",de:"WAHRSCHBEREICH",
fr:"PROBABILITE",es:"PROBABILIDAD"},{en:"QUARTILE",de:"QUARTILE",fr:"QUARTILE",es:"CUARTIL"},{
en:"QUARTILE.EXC",de:"QUARTILE.EXKL",fr:"QUARTILE.EXCLURE",es:"CUARTIL.EXC"},{en:"QUARTILE.INC",
de:"QUARTILE.INKL",fr:"QUARTILE.INCLURE",es:"CUARTIL.INC"},{en:"RANK",de:"RANG",fr:"RANG",
es:"JERARQUIA"},{en:"RANK.AVG",de:"RANG.MITTELW",fr:"MOYENNE.RANG",es:"JERARQUIA.MEDIA"},{
en:"RANK.EQ",de:"RANG.GLEICH",fr:"EQUATION.RANG",es:"JERARQUIA.EQV"},{en:"RSQ",
de:"BESTIMMTHEITSMASS",fr:"COEFFICIENT.DETERMINATION",es:"COEFICIENTE.R2"},{en:"SKEW",de:"SCHIEFE",
fr:"COEFFICIENT.ASYMETRIE",es:"COEFICIENTE.ASIMETRIA"},{en:"SKEWP",de:"SCHIEFEP",
fr:"COEFFICIENTASYMETRIEP",es:"COEFICIENTE.ASIMETRIA.P"},{en:"SLOPE",de:"STEIGUNG",fr:"PENTE",
es:"PENDIENTE"},{en:"SMALL",de:"KKLEINSTE",fr:"PETITE.VALEUR",es:"K.ESIMO.MENOR"},{en:"STANDARDIZE",
de:"STANDARDISIERUNG",fr:"CENTREE.REDUITE",es:"NORMALIZACION"},{en:"STDEV",de:"STABW",fr:"ECARTYPE",
es:"DESVEST"},{en:"STDEV.P",de:"STABW.N",fr:"ECARTYPE.P",es:"DESVEST.P"},{en:"STDEV.S",de:"STABW.S",
fr:"ECARTYPE.S",es:"DESVEST.M"},{en:"STDEVA",de:"STABWA",fr:"ECARTYPEA",es:"DESVESTA"},{en:"STDEVP",
de:"STABWN",fr:"ECARTYPEP",es:"DESVESTP"},{en:"STDEVPA",de:"STABWNA",fr:"ECARTYPEPA",es:"DESVESTPA"}
,{en:"STEYX",de:"STFEHLERYX",fr:"ERREUR.TYPE.XY",es:"ERROR.TIPICO.XY"},{en:"T.DIST",de:"T.VERT",
fr:"LOI.STUDENT.N",es:"DISTR.T.N"},{en:"T.DIST.2T",de:"T.VERT.2S",fr:"LOI.STUDENT.BILATERALE",
es:"DISTR.T.2C"},{en:"T.DIST.RT",de:"T.VERT.RE",fr:"LOI.STUDENT.DROITE",es:"DISTR.T.CD"},{
en:"T.INV",de:"T.INV",fr:"LOI.STUDENT.INVERSE",es:"INV.T"},{en:"T.INV.2T",de:"T.INV.2S",
fr:"LOI.STUDENT.INVERSE.BILATERALE",es:"INV.T.2C"},{en:"T.TEST",de:"T.TEST",fr:"TEST.STUDENT",
es:"PRUEBA.T.N"},{en:"TDIST",de:"TVERT",fr:"LOI.STUDENT",es:"DISTR.T"},{en:"TINV",de:"TINV",
fr:"LOISTUDENTINVERSE",es:"DISTR.T.INV"},{en:"TRIMMEAN",de:"GESTUTZTMITTEL",fr:"MOYENNE.REDUITE",
es:"MEDIA.ACOTADA"},{en:"TTEST",de:"TTEST",fr:"TESTSTUDENT",es:"PRUEBA.T"},{en:"VAR",de:"VARIANZ",
fr:"VAR",es:"VAR"},{en:"VAR.P",de:"VAR.P",fr:"VAR.P",es:"VAR.P"},{en:"VAR.S",de:"VAR.S",fr:"VAR.S",
es:"VAR.S"},{en:"VARA",de:"VARIANZA",fr:"VARA",es:"VARA"},{en:"VARP",de:"VARIANZEN",fr:"VARP",
es:"VARP"},{en:"VARPA",de:"VARIANZENA",fr:"VAR.PA",es:"VARPA"},{en:"WEIBULL",de:"WEIBULL",
fr:"LOIWEIBULL",es:"DIST.WEIBULL"},{en:"WEIBULL.DIST",de:"WEIBULL.VERT",fr:"LOI.WEIBULL",
es:"DISTR.WEIBULL"},{en:"Z.TEST",de:"G.TEST",fr:"TEST.Z",es:"PRUEBA.Z.N"},{en:"ZTEST",de:"GTEST",
fr:"TESTZ",es:"PRUEBA.Z"}];var databaseFunctions=[{en:"DAVERAGE",de:"DBMITTELWERT",fr:"BDMOYENNE",
es:"BDPROMEDIO"},{en:"DCOUNT",de:"DBANZAHL",fr:"BDNB",es:"BDCONTAR"},{en:"DCOUNTA",de:"DBANZAHL2",
fr:"BDNBVAL",es:"BDCONTARA"},{en:"DGET",de:"DBAUSZUG",fr:"BDLIRE",es:"BDEXTRAER"},{en:"DMAX",
de:"DBMAX",fr:"BDMAX",es:"BDMAX"},{en:"DMIN",de:"DBMIN",fr:"BDMIN",es:"BDMIN"},{en:"DPRODUCT",
de:"DBPRODUKT",fr:"BDPRODUIT",es:"BDPRODUCTO"},{en:"DSTDEV",de:"DBSTDABW",fr:"BDECARTYPE",
es:"BDDESVEST"},{en:"DSUM",de:"DBSUMME",fr:"BDSOMME",es:"BDSUMA"},{en:"DVAR",de:"DBVARIANZ",
fr:"BDVAR",es:"BDVAR"},{en:"DVARP",de:"DBVARIANZEN",fr:"BDVARP",es:"BDVARP"}];
var informationFunctions=[{en:"CELL",de:"ZELLE",fr:"CELLULE",es:"CELDA"},{en:"CURRENT",de:"AKTUELL",
fr:"ACTUELLE",es:"ACTUAL"},{en:"FORMULA",de:"FORMEL",fr:"FORMULE",es:"FORMULA"},{en:"INFO",
de:"INFO",fr:"INFO",es:"INFO"},{en:"ISBLANK",de:"ISTLEER",fr:"ESTVIDE",es:"ESBLANCO"},{en:"ISERR",
de:"ISTFEHL",fr:"ESTERR",es:"ESERR"},{en:"ISERROR",de:"ISTFEHLER",fr:"ESTERREUR",es:"ESERROR"},{
en:"ISEVEN",de:"ISTGERADE",fr:"EST.PAIR",es:"ESPAR"},{en:"ISEVEN_ADD",de:"ISTGERADE_ADD"},{
en:"ISFORMULA",de:"ISTFORMEL",fr:"ESTFORMULE",es:"ESFORMULA"},{en:"ISLOGICAL",de:"ISTLOGISCH",
fr:"ESTLOGIQUE",es:"ESLOGICO"},{en:"ISNA",de:"ISTNV",fr:"ESTNA",es:"ESNOD"},{en:"ISNONTEXT",
de:"ISTKEINTEXT",fr:"ESTNONTEXTE",es:"ESNOTEXTO"},{en:"ISNUMBER",de:"ISTZAHL",fr:"ESTNUM",
es:"ESNUMERO"},{en:"ISODD",de:"ISTUNGERADE",fr:"EST.IMPAIR",es:"ES.IMPAR"},{en:"ISODD_ADD",
de:"ISTUNGERADE_ADD"},{en:"ISTEXT",de:"ISTTEXT",fr:"ESTTEXTE",es:"ESTEXTO"},{en:"N",de:"N",fr:"N",
es:"N"},{en:"NA",de:"NV",fr:"NA",es:"NOD"},{en:"TYPE",de:"TYP",fr:"TYPE",es:"TIPO"}];
var arrayFunctions=[{en:"FOURIER",de:"FOURIER",fr:"FOURIER",es:"FOURIER"},{en:"FREQUENCY",
de:"HÄUFIGKEIT",fr:"FREQUENCE",es:"FRECUENCIA"},{en:"GROWTH",de:"VARIATION",fr:"CROISSANCE",
es:"CRECIMIENTO"},{en:"LINEST",de:"RGP",fr:"DROITEREG",es:"ESTIMACION.LINEAL"},{en:"LOGEST",
de:"RKP",fr:"LOGREG",es:"ESTIMACION.LOGARITMICA"},{en:"MDETERM",de:"MDET",fr:"DETERMAT",es:"MDETERM"
},{en:"MINVERSE",de:"MINV",fr:"INVERSEMAT",es:"MINVERSA"},{en:"MMULT",de:"MMULT",fr:"PRODUITMAT",
es:"MMULT"},{en:"MUNIT",de:"EINHEITSMATRIX",fr:"MUNIT",es:"MUNITARIA"},{en:"SEQUENCE",de:"FOLGE",
fr:"SEQUENCE",es:"SECUENCIA"},{en:"SUMPRODUCT",de:"SUMMENPRODUKT",fr:"SOMMEPROD",es:"SUMA.PRODUCTO"}
,{en:"SUMX2MY2",de:"SUMMEX2MY2",fr:"SOMME.X2MY2",es:"SUMAX2MENOSY2"},{en:"SUMX2PY2",de:"SUMMEX2PY2",
fr:"SOMME.X2PY2",es:"SUMAX2MASY2"},{en:"SUMXMY2",de:"SUMMEXMY2",fr:"SOMME.XMY2",es:"SUMAXMENOSY2"},{
en:"TRANSPOSE",de:"MTRANS",fr:"TRANSPOSE",es:"TRANSPONER"},{en:"TREND",de:"TREND",fr:"TENDANCE",
es:"TENDENCIA"}];var spreadsheetFunctions=[{en:"ADDRESS",de:"ADRESSE",fr:"ADRESSE",es:"DIRECCION"},{
en:"AREAS",de:"BEREICHE",fr:"ZONES",es:"AREAS"},{en:"CHOOSE",de:"WAHL",fr:"CHOISIR",es:"ELEGIR"},{
en:"COLUMN",de:"SPALTE",fr:"COLONNE",es:"COLUMNA"},{en:"COLUMNS",de:"SPALTEN",fr:"COLONNES",
es:"COLUMNAS"},{en:"DDE",de:"DDE",fr:"DDE",es:"DDE"},{en:"ERROR.TYPE",de:"FEHLER.TYP",
fr:"TYPE.ERREUR",es:"TIPO.DE.ERROR"},{en:"ERRORTYPE",de:"FEHLERTYP",fr:"TYPEERREUR",
es:"TIPO.DE.ERROR.OOO"},{en:"FILTER",de:"FILTERN",fr:"FILTRE",es:"FILTRAR"},{en:"GETPIVOTDATA",
de:"PIVOTDATENZUORDNEN",fr:"EXTRAIRE.DONNEES.PILOTE",es:"IMPORTARDATOSDINAMICOS"},{en:"HYPERLINK",
de:"HYPERLINK",fr:"LIEN.HYPERTEXTE",es:"HIPERVINCULO"},{en:"INDEX",de:"INDEX",fr:"INDEX",es:"INDICE"
},{en:"INDIRECT",de:"INDIREKT",fr:"INDIRECT",es:"INDIRECTO"},{en:"LET",de:"LET",fr:"LET",es:"LET"},{
en:"MATCH",de:"VERGLEICH",fr:"EQUIV",es:"COINCIDIR"},{en:"OFFSET",de:"VERSCHIEBUNG",fr:"DECALER",
es:"DESREF"},{en:"ROW",de:"ZEILE",fr:"LIGNE",es:"FILA"},{en:"ROWS",de:"ZEILEN",fr:"LIGNES",
es:"FILAS"},{en:"SHEET",de:"TABELLE",fr:"FEUILLE",es:"HOJA"},{en:"SHEETS",de:"TABELLEN",
fr:"FEUILLES",es:"HOJAS"},{en:"SORT",de:"SORTIEREN",fr:"TRI",es:"ORDENAR"},{en:"SORTBY",
de:"SORTIERENNACH",fr:"TRIERPAR",es:"ORDENARPOR"},{en:"STYLE",de:"VORLAGE",fr:"STYLE",es:"ESTILO"},{
en:"UNIQUE",de:"EINZIGARTIG",fr:"UNIQUE",es:"UNICOS"}];function getLocalizedFuncName(funcNameList){
if(String.locale.toLowerCase().startsWith("de")&&funcNameList.de)return funcNameList.de;else if(
String.locale.toLowerCase().startsWith("fr")&&funcNameList.fr)return funcNameList.fr;else if(
String.locale.toLowerCase().startsWith("es")&&funcNameList.es)return funcNameList.es;
return funcNameList.en}function getFunctionsMenuArray(funcs,category){var e_1,_a;var functionsMenu=[
];try{for(var funcs_1=__values(funcs),funcs_1_1=funcs_1.next(
);!funcs_1_1.done;funcs_1_1=funcs_1.next()){var func=funcs_1_1.value;
var localizedFunc=getLocalizedFuncName(func);functionsMenu.push({text:localizedFunc,
uno:".uno:InsertFunction?FunctionName:string="+localizedFunc+"&FunctionCategory:short="+category})}
}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(funcs_1_1&&!funcs_1_1.done&&(_a=funcs_1.return)
)_a.call(funcs_1)}finally{if(e_1)throw e_1.error}}return functionsMenu}menuDefinitions.set(
"FinancialFunctionsMenu",getFunctionsMenuArray(financialFunctions,functionCategories.FINANCIAL));
menuDefinitions.set("LogicalFunctionsMenu",getFunctionsMenuArray(logicalFunctions,
functionCategories.LOGICAL));menuDefinitions.set("TextFunctionsMenu",getFunctionsMenuArray(
textFunctions,functionCategories.TEXT));menuDefinitions.set("DateAndTimeFunctionsMenu",
getFunctionsMenuArray(dateAndTimeFunctions,functionCategories.DATEnTIME));menuDefinitions.set(
"LookupAndRefFunctionsMenu",getFunctionsMenuArray(lookupFunctions,functionCategories.SPREADSHEET
).concat(getFunctionsMenuArray(refFunctions,functionCategories.INFORMATION)));menuDefinitions.set(
"MathAndTrigFunctionsMenu",getFunctionsMenuArray(mathAndTrigFunctions,
functionCategories.MATHEMATICAL).concat(getFunctionsMenuArray(statisticalFunctions,
functionCategories.STATISTICAL)));menuDefinitions.set("MoreFunctionsMenu",getFunctionsMenuArray(
databaseFunctions,functionCategories.DATABASE).concat(getFunctionsMenuArray(informationFunctions,
functionCategories.INFORMATION),getFunctionsMenuArray(arrayFunctions,functionCategories.ARRAY),
getFunctionsMenuArray(spreadsheetFunctions,functionCategories.SPREADSHEET)));menuDefinitions.set(
"Menu Statistic",[{text:_UNO(".uno:SamplingDialog","spreadsheet"),uno:".uno:SamplingDialog"},{
text:_UNO(".uno:DescriptiveStatisticsDialog","spreadsheet"),uno:".uno:DescriptiveStatisticsDialog"},
{text:_UNO(".uno:AnalysisOfVarianceDialog","spreadsheet"),uno:".uno:AnalysisOfVarianceDialog"},{
text:_UNO(".uno:CorrelationDialog","spreadsheet"),uno:".uno:CorrelationDialog"},{text:_UNO(
".uno:CovarianceDialog","spreadsheet"),uno:".uno:CovarianceDialog"},{text:_UNO(
".uno:ExponentialSmoothingDialog","spreadsheet"),uno:".uno:ExponentialSmoothingDialog"},{text:_UNO(
".uno:MovingAverageDialog","spreadsheet"),uno:".uno:MovingAverageDialog"},{text:_UNO(
".uno:RegressionDialog","spreadsheet"),uno:".uno:RegressionDialog"},{text:_UNO(".uno:TTestDialog",
"spreadsheet"),uno:".uno:TTestDialog"},{text:_UNO(".uno:FTestDialog","spreadsheet"),
uno:".uno:FTestDialog"},{text:_UNO(".uno:ZTestDialog","spreadsheet"),uno:".uno:ZTestDialog"},{
text:_UNO(".uno:ChiSquareTestDialog","spreadsheet"),uno:".uno:ChiSquareTestDialog"},{text:_UNO(
".uno:FourierAnalysisDialog","spreadsheet"),uno:".uno:FourierAnalysisDialog"}]);menuDefinitions.set(
"EditSparklineMenu",[{text:_UNO(".uno:EditSparklineGroup","spreadsheet"),uno:"EditSparklineGroup"},{
text:_("Edit Single Sparkline"),uno:"EditSparkline"}]);menuDefinitions.set("DeleteSparklineMenu",[{
text:_UNO(".uno:DeleteSparklineGroup","spreadsheet"),uno:"DeleteSparklineGroup"},{text:_(
"Delete Single Sparkline"),uno:"DeleteSparkline"}]);menuDefinitions.set("MenuPrintRanges",[{
text:_UNO(".uno:DefinePrintArea","spreadsheet"),uno:".uno:DefinePrintArea"},{text:_UNO(
".uno:AddPrintArea","spreadsheet"),uno:".uno:AddPrintArea"},{text:_UNO(".uno:EditPrintArea",
"spreadsheet"),uno:".uno:EditPrintArea"},{text:_UNO(".uno:DeletePrintArea","spreadsheet"),
uno:".uno:DeletePrintArea"}]);menuDefinitions.set("MenuMargins",[{type:"json",content:{
id:"Layout-MarginMenu",type:"pagemarginentry",options:pageMarginOptions}},{type:"separator"}]);
menuDefinitions.set("MenuOrientation",[{id:"portrait",img:"portrait",text:_("Portrait"),
uno:".uno:Orientation?isLandscape:bool=false"},{id:"landscape",img:"landscape",text:_("Landscape"),
uno:".uno:Orientation?isLandscape:bool=true"}]);var pageSizes=[{id:"A6",text:_("A6"),
paper:Paper.PAPER_A6},{id:"A5",text:_("A5"),paper:Paper.PAPER_A5},{id:"A4",text:_("A4"),
paper:Paper.PAPER_A4},{id:"A3",text:_("A3"),paper:Paper.PAPER_A3},{id:"B6ISO",text:_("B6 (ISO)"),
paper:Paper.PAPER_B6_ISO},{id:"B5ISO",text:_("B5 (ISO)"),paper:Paper.PAPER_B5_ISO},{id:"B4ISO",
text:_("B4 (ISO)"),paper:Paper.PAPER_B4_ISO},{id:"Letter",text:_("Письмо"),paper:Paper.PAPER_LETTER}
,{id:"Legal",text:_("Планшет"),paper:Paper.PAPER_LEGAL},{id:"LongBond",text:_("Длинный документный"),
paper:Paper.PAPER_FANFOLD_LEGAL_DE},{id:"Tabloid",text:_("Таблоид"),paper:Paper.PAPER_TABLOID},{
id:"B6JIS",text:_("B6 (JIS)"),paper:Paper.PAPER_B6_JIS},{id:"B5JIS",text:_("B5 (JIS)"),
paper:Paper.PAPER_B5_JIS},{id:"B4JIS",text:_("B4 (JIS)"),paper:Paper.PAPER_B4_JIS},{id:"16Kai",
text:_("16 Kai"),paper:Paper.PAPER_KAI16},{id:"32Kai",text:_("32 Kai"),paper:Paper.PAPER_KAI32},{
id:"Big32Kai",text:_("Big 32 Kai"),paper:Paper.PAPER_KAI32BIG},{id:"User",text:_("User"),
paper:Paper.PAPER_USER},{id:"DLEnvelope",text:_("DL Envelope"),paper:Paper.PAPER_ENV_DL},{
id:"C6Envelope",text:_("C6 Envelope"),paper:Paper.PAPER_ENV_C6},{id:"C6_5Envelope",text:_(
"C6/5 Envelope"),paper:Paper.PAPER_ENV_C65},{id:"C5Envelope",text:_("C5 Envelope"),
paper:Paper.PAPER_ENV_C5},{id:"C4Envelope",text:_("C4 Envelope"),paper:Paper.PAPER_ENV_C4},{
id:"No6_3_4Envelope",text:_("#6¾ Envelope"),paper:Paper.PAPER_ENV_PERSONAL},{
id:"No7_3_4MonarchEnvelope",text:_("#7¾ (Monarch) Envelope"),paper:Paper.PAPER_ENV_MONARCH},{
id:"No9Envelope",text:_("#9 Envelope"),paper:Paper.PAPER_ENV_9},{id:"No10Envelope",text:_(
"#10 Envelope"),paper:Paper.PAPER_ENV_10},{id:"No11Envelope",text:_("#11 Envelope"),
paper:Paper.PAPER_ENV_11},{id:"No12Envelope",text:_("#12 Envelope"),paper:Paper.PAPER_ENV_12},{
id:"JapanesePostcard",text:_("Japanese Postcard"),paper:Paper.PAPER_POSTCARD_JP}];
menuDefinitions.set("MenuPageSizesCalc",[{type:"json",content:{id:"Layout-PageSizeMenu",
type:"pagesizeentry",options:pageSizes.map(function(item){return{id:item.id,text:item.text,
uno:".uno:CalcPageSize?PaperFormat:long="+item.paper}})}},{type:"separator"}]);menuDefinitions.set(
"MenuPageSizesWriter",pageSizes.map(function(item){return{id:item.id,text:item.text,
uno:".uno:AttributePageSize?PaperFormat:short="+item.paper}}));menuDefinitions.set("Print",[{text:_(
"Active sheet"),action:"print-active-sheet"},{text:_("All Sheets"),action:"print-all-sheets"}]);
menuDefinitions.set("MenuRowHeight",[{text:_UNO(".uno:RowHeight","spreadsheet"),uno:".uno:RowHeight"
},{text:_UNO(".uno:SetOptimalRowHeight","spreadsheet"),uno:".uno:SetOptimalRowHeight"}]);
menuDefinitions.set("MenuColumnWidth",[{text:_UNO(".uno:ColumnWidth","spreadsheet"),
uno:".uno:ColumnWidth"},{text:_UNO(".uno:SetOptimalColumnWidth","spreadsheet"),
uno:".uno:SetOptimalColumnWidth"}]);menuDefinitions.set("FormattingMarkMenu",[{text:_UNO(
".uno:InsertNonBreakingSpace","text"),uno:"InsertNonBreakingSpace"},{text:_UNO(
".uno:InsertHardHyphen","text"),uno:"InsertHardHyphen"},{text:_UNO(".uno:InsertSoftHyphen","text"),
uno:"InsertSoftHyphen"},{text:_UNO(".uno:InsertZWSP","text"),uno:"InsertZWSP"},{text:_UNO(
".uno:InsertWJ","text"),uno:"InsertWJ"},{text:_UNO(".uno:InsertLRM","text"),uno:"InsertLRM"},{
text:_UNO(".uno:InsertRLM","text"),uno:"InsertRLM"}]);menuDefinitions.set("FormatMenu",[{text:_UNO(
".uno:Bold","text"),uno:"Bold"},{text:_UNO(".uno:Italic","text"),uno:"Italic"},{text:_UNO(
".uno:Underline","text"),uno:"Underline"},{text:_UNO(".uno:UnderlineDouble","text"),
uno:"UnderlineDouble"},{text:_UNO(".uno:Strikeout","text"),uno:"Strikeout"},{text:_UNO(
".uno:Overline","text"),uno:"Overline"},{type:"separator"},{text:_UNO(".uno:SuperScript","text"),
uno:"SuperScript"},{text:_UNO(".uno:SubScript","text"),uno:"SubScript"},{type:"separator"},{
text:_UNO(".uno:Shadowed","text"),uno:"Shadowed"},{text:_UNO(".uno:OutlineFont","text"),
uno:"OutlineFont"},{type:"separator"},{text:_UNO(".uno:Grow","text"),uno:"Grow"},{text:_UNO(
".uno:Shrink","text"),uno:"Shrink"},{type:"separator"},{text:_UNO(".uno:ChangeCaseToUpper","text"),
uno:"ChangeCaseToUpper"},{text:_UNO(".uno:ChangeCaseToLower","text"),uno:"ChangeCaseToLower"},{
text:_UNO(".uno:ChangeCaseRotateCase","text"),uno:"ChangeCaseRotateCase"},{type:"separator"},{
text:_UNO(".uno:ChangeCaseToSentenceCase","text"),uno:"ChangeCaseToSentenceCase"},{text:_UNO(
".uno:ChangeCaseToTitleCase","text"),uno:"ChangeCaseToTitleCase"},{text:_UNO(
".uno:ChangeCaseToToggleCase","text"),uno:"ChangeCaseToToggleCase"},{type:"separator"},{text:_UNO(
".uno:SmallCaps","text"),uno:"SmallCaps"}]);menuDefinitions.set("FormatBulletsMenu",[{text:_UNO(
".uno:DefaultBullet","text"),uno:"DefaultBullet"},{type:"separator"},{text:_UNO(
".uno:DecrementLevel","text"),uno:"DecrementLevel"},{text:_UNO(".uno:IncrementLevel","text"),
uno:"IncrementLevel"},{text:_UNO(".uno:DecrementSubLevels","text"),uno:"DecrementSubLevels"},{
text:_UNO(".uno:IncrementSubLevels","text"),uno:"IncrementSubLevels"},{type:"separator"},{text:_UNO(
".uno:MoveDown","text"),uno:"MoveDown"},{text:_UNO(".uno:MoveUp","text"),uno:"MoveUp"},{text:_UNO(
".uno:MoveDownSubItems","text"),uno:"MoveDownSubItems"},{text:_UNO(".uno:MoveUpSubItems","text"),
uno:"MoveUpSubItems"},{type:"separator"},{text:_UNO(".uno:InsertNeutralParagraph","text"),
uno:"InsertNeutralParagraph"},{text:_UNO(".uno:NumberingStart","text"),uno:"NumberingStart"},{
text:_UNO(".uno:RemoveBullets","text"),uno:"RemoveBullets"},{type:"separator"},{text:_UNO(
".uno:JumpDownThisLevel","text"),uno:"JumpDownThisLevel"},{text:_UNO(".uno:JumpUpThisLevel","text"),
uno:"JumpUpThisLevel"},{text:_UNO(".uno:ContinueNumbering","text"),uno:"ContinueNumbering"}]);
menuDefinitions.set("LineSpacingMenu",[{id:"spacepara1",img:"spacepara1",text:_UNO(".uno:SpacePara1"
),uno:"SpacePara1"},{id:"spacepara15",img:"spacepara15",text:_UNO(".uno:SpacePara15"),
uno:"SpacePara15"},{id:"spacepara2",img:"spacepara2",text:_UNO(".uno:SpacePara2"),uno:"SpacePara2"},
{type:"separator"},{id:"paraspaceincrease",img:"paraspaceincrease",text:_UNO(
".uno:ParaspaceIncrease"),uno:"ParaspaceIncrease"},{id:"paraspacedecrease",img:"paraspacedecrease",
text:_UNO(".uno:ParaspaceDecrease"),uno:"ParaspaceDecrease"}]);menuDefinitions.set("LanguageMenu",[{
action:"morelanguages-selection",text:_UNO(".uno:SetLanguageSelectionMenu","text")},{
action:"morelanguages-paragraph",text:_UNO(".uno:SetLanguageParagraphMenu","text")},{
action:"morelanguages-all",text:_UNO(".uno:SetLanguageAllTextMenu","text")}]);menuDefinitions.set(
"InsertImageMenu",[{action:"localgraphic",text:_("Insert Local Image")}]);menuDefinitions.set(
"InsertMultimediaMenu",[{action:"insertmultimedia",text:_("Insert Local Multimedia")}]);
menuDefinitions.set("CharSpacingMenu",[{id:"space1",text:_("Very Tight"),
uno:"Spacing?Spacing:short=-60"},{id:"space1",text:_("Tight"),uno:"Spacing?Spacing:short=-30"},{
id:"space15",text:_("Normal"),uno:"Spacing?Spacing:short=0"},{id:"space2",text:_("Loose"),
uno:"Spacing?Spacing:short=60"},{id:"space2",text:_("Very Loose"),uno:"Spacing?Spacing:short=120"}])
menuDefinitions.set("PasteMenu",[{text:_UNO(".uno:Paste","text"),action:".uno:Paste",
hint:JSDialog.ShortcutsUtil.getShortcut(_UNO(".uno:Paste","text"),".uno:Paste")},{text:_UNO(
".uno:PasteSpecial","text"),action:".uno:PasteSpecial",hint:JSDialog.ShortcutsUtil.getShortcut(_UNO(
".uno:PasteSpecial","text"),".uno:PasteSpecial")}]);menuDefinitions.set("RecordTrackedChangesMenu",[
{id:"review-track-changes-off",text:_("Off"),uno:".uno:TrackChanges?TrackChanges:bool=false"},{
id:"review-track-changes-all-views",text:_("All users"),uno:".uno:TrackChangesInAllViews"},{
id:"review-track-changes-this-view",text:_("This user"),uno:".uno:TrackChangesInThisView"}]);
menuDefinitions.set("AcceptTrackedChangesMenu",[{id:"review-accept-tracked-change",text:_UNO(
".uno:AcceptTrackedChange","text"),uno:".uno:AcceptTrackedChange"},{
id:"review-accept-tracked-change-to-next",text:_UNO(".uno:AcceptTrackedChangeToNext","text"),
uno:".uno:AcceptTrackedChangeToNext"},{id:"acceptalltrackedchanges",text:_UNO(
".uno:AcceptAllTrackedChanges","text"),uno:".uno:AcceptAllTrackedChanges"}]);menuDefinitions.set(
"RejectTrackedChangesMenu",[{id:"review-reject-tracked-change",text:_UNO(".uno:RejectTrackedChange",
"text"),uno:".uno:RejectTrackedChange"},{id:"review-reject-tracked-change-to-next",text:_UNO(
".uno:RejectTrackedChangeToNext","text"),uno:".uno:RejectTrackedChangeToNext"},{
id:"rejectalltrackedchanges",text:_UNO(".uno:RejectAllTrackedChanges","text"),
uno:".uno:RejectAllTrackedChanges"}]);menuDefinitions.set("ConditionalFormatMenu",[{text:_(
"Highlight cells with..."),items:[{text:_("Values greater than..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=2"},{text:_("Values less than..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=1"},{text:_("Values equal to..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=0"},{text:_("Values between..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=6"},{text:_("Values duplicate..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=8"},{text:_("Containing text..."),
uno:".uno:ConditionalFormatEasy?FormatRule:short=23"},{type:"separator"},{text:_(
"More highlights..."),uno:".uno:ConditionalFormatDialog"}]},{text:_("Top/Bottom Rules..."),items:[{
text:_("Top N elements..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=11"},{text:_(
"Top N percent..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=13"},{text:_(
"Bottom N elements..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=12"},{text:_(
"Bottom N percent..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=14"},{text:_(
"Above Average..."),uno:".uno:ConditionalFormatEasy?FormatRule:short=15"},{text:_("Below Average..."
),uno:".uno:ConditionalFormatEasy?FormatRule:short=16"},{type:"separator"},{text:_(
"More highlights..."),uno:".uno:ConditionalFormatDialog"}]},{type:"separator"},{id:"scaleset",
text:_UNO(".uno:ColorScaleFormatDialog","spreadsheet"),items:[{type:"html",htmlId:"scaleset"}]},{
id:"databarset",text:_UNO(".uno:DataBarFormatDialog","spreadsheet"),items:[{type:"html",
htmlId:"databarset"}]},{id:"iconset",text:_UNO(".uno:IconSetFormatDialog","spreadsheet"),items:[{
type:"html",htmlId:"iconset"}]},{text:_UNO(".uno:CondDateFormatDialog","spreadsheet"),
uno:".uno:CondDateFormatDialog"},{type:"separator"},{text:_UNO(".uno:ConditionalFormatManagerDialog"
,"spreadsheet"),uno:".uno:ConditionalFormatManagerDialog"}]);menuDefinitions.set("BorderStyleMenu",[
{id:"noborders",img:"fr01",text:_("No Borders"),uno:window.getBorderStyleUNOCommand(0,0,0,0,0,0,0)},
{id:"leftborder",img:"fr02",text:_("Left Border"),uno:window.getBorderStyleUNOCommand(1,0,0,0,0,0,0)
},{id:"rightborder",img:"fr03",text:_("Right Border"),uno:window.getBorderStyleUNOCommand(0,1,0,0,0,
0,0)},{id:"leftandrightborders",img:"fr04",text:_("Left And Right Borders"),
uno:window.getBorderStyleUNOCommand(1,1,0,0,0,0,0)},{id:"topborder",img:"fr05",text:_("Top Border"),
uno:window.getBorderStyleUNOCommand(0,0,0,1,0,0,0)},{id:"bottomborder",img:"fr06",text:_(
"Bottom Border"),uno:window.getBorderStyleUNOCommand(0,0,1,0,0,0,0)},{id:"topandbottomborder",
img:"fr07",text:_("Top And Bottom Border"),uno:window.getBorderStyleUNOCommand(0,0,1,1,0,0,0)},{
id:"outerborder",img:"fr08",text:_("Outer Border"),uno:window.getBorderStyleUNOCommand(1,1,1,1,0,0,0
)},{id:"allhorizontallines",img:"fr09",text:_("All Horizontal Lines"),
uno:window.getBorderStyleUNOCommand(0,0,1,1,1,0,0)},{id:"outerborderandhorizontallines",img:"fr010",
text:_("Outer Border And Horizontal Lines"),uno:window.getBorderStyleUNOCommand(1,1,1,1,1,0,0)},{
id:"outerborderandverticallines",img:"fr011",text:_("Outer Border and Vertical Lines"),
uno:window.getBorderStyleUNOCommand(1,1,1,1,0,1,0)},{id:"outerbordersandalllines",img:"fr012",
text:_("Outer Borders And All Inner lines"),uno:window.getBorderStyleUNOCommand(1,1,1,1,1,1,0)},{
type:"separator"},{text:_("Line color"),items:[{id:"colorpickerwidget",type:"colorpicker",
command:".uno:FrameLineColor"},{type:"separator"}]},{text:_("Line style"),items:[{text:_(
"Hairline (0.05 pt)"),uno:getLineStyleModificationCommand(UNO_BorderLineStyle.SOLID,
LO_BorderLineWidth.Hairline,0,0)},{text:_("Very thin (0.50 pt)"),
uno:getLineStyleModificationCommand(UNO_BorderLineStyle.SOLID,LO_BorderLineWidth.VeryThin,0,0)},{
text:_("Thin (0.75 pt)"),uno:getLineStyleModificationCommand(UNO_BorderLineStyle.SOLID,
LO_BorderLineWidth.Thin,0,0)},{text:_("Medium (1.50 pt)"),uno:getLineStyleModificationCommand(
UNO_BorderLineStyle.SOLID,LO_BorderLineWidth.Medium,0,0)},{text:_("Thick (2.25 pt)"),
uno:getLineStyleModificationCommand(UNO_BorderLineStyle.SOLID,LO_BorderLineWidth.Thick,0,0)},{
text:_("Extra thick (4.50 pt)"),uno:getLineStyleModificationCommand(UNO_BorderLineStyle.SOLID,
LO_BorderLineWidth.ExtraThick,0,0)},{text:_("Double Hairline (1.10 pt)"),
uno:getLineStyleModificationCommand(UNO_BorderLineStyle.DOUBLE,LO_BorderLineWidth.Hairline,
LO_BorderLineWidth.Hairline,LO_BorderLineWidth.Medium)},{text:_("Double Hairline (2.35 pt)"),
uno:getLineStyleModificationCommand(UNO_BorderLineStyle.DOUBLE,LO_BorderLineWidth.Hairline,
LO_BorderLineWidth.Hairline,LO_BorderLineWidth.Thick)},{text:_("Thin/Medium (3.00 pt)"),
uno:getLineStyleModificationCommand(UNO_BorderLineStyle.DOUBLE,LO_BorderLineWidth.Thin,
LO_BorderLineWidth.Medium,LO_BorderLineWidth.Thin)},{text:_("Medium/Hairline (3.05 pt)"),
uno:getLineStyleModificationCommand(UNO_BorderLineStyle.DOUBLE,LO_BorderLineWidth.Medium,
LO_BorderLineWidth.Hairline,LO_BorderLineWidth.Medium)},{text:_("Medium/Medium (4.50 pt)"),
uno:getLineStyleModificationCommand(UNO_BorderLineStyle.DOUBLE,LO_BorderLineWidth.Medium,
LO_BorderLineWidth.Medium,LO_BorderLineWidth.Medium)},{type:"separator"}]},{type:"separator"},{
id:"more",text:_("More..."),uno:".uno:FormatCellBorders"},{type:"separator"}]);menuDefinitions.set(
"BorderStyleMenuWriter",(menuDefinitions.get("BorderStyleMenu")||[]).filter(function(item){
return item.uno!==".uno:FormatCellBorders"}));menuDefinitions.set("InsertShapesMenu",[{type:"html",
htmlId:"insertshapespopup"},{type:"separator"}]);menuDefinitions.set("InsertConnectorsMenu",[{
type:"html",htmlId:"insertconnectorspopup"},{type:"separator"}]);menuDefinitions.set(
"InsertTableMenu",[{type:"html",htmlId:"inserttablepopup"},{type:"separator"}]);menuDefinitions.set(
"UsersListMenu",[{type:"html",htmlId:"userslistpopup"},{type:"separator"}]);menuDefinitions.set(
"ColorPickerMenu",[{id:"colorpickerwidget",type:"colorpicker"},{type:"separator"}]);
menuDefinitions.set("LanguageStatusMenu",[{type:"separator"},{type:"separator"}]);
menuDefinitions.set("SlideSizeMenu",[{text:_("Standard (4:3)"),img:"standard-size",
uno:".uno:AttributePageSize?AttributePageSize.Width:long=28000&AttributePageSize.Height:long=21000"}
,{text:_("Widescreen (16:9)"),img:"widescreen-size",
uno:".uno:AttributePageSize?AttributePageSize.Width:long=28000&AttributePageSize.Height:long=15750"}
]);function generateLayoutPopupGrid(unoCommand){var layoutMap=[{layout:20,text:_("Blank Slide")},{
layout:0,text:_("Title Slide")},{layout:1,text:_("Title, Content")},{layout:3,text:_(
"Title and 2 Content")},{layout:19,text:_("Title Only")},{layout:32,text:_("Centered Text")},{
layout:15,text:_("Title, 2 Content and Content")},{layout:12,text:_("Title, Content and 2 Content")}
,{layout:16,text:_("Title, 2 Content over Content")},{layout:14,text:_("Title, Content over Content"
)},{layout:18,text:_("Title, 4 Content")},{layout:34,text:_("Title, 6 Content")},{layout:27,text:_(
"Vertical Title, Text, Chart")},{layout:28,text:_("Vertical Title, Vertical Text")},{layout:29,
text:_("Title, Vertical Text")},{layout:30,text:_("Title, Vertical Text, Clipart")}];var grid={
id:"slidelayoutgrid",type:"grid",cols:4,rows:4,children:new Array};for(var i=0;i<16;i+=4){for(
var j=i;j<i+4;j++){grid.children.push({id:"layout"+j,type:"toolitem",
command:".uno:"+unoCommand+"?WhatLayout:long="+layoutMap[j].layout,text:layoutMap[j].text,
noLabel:true,left:j%4,top:i/4%4,tabIndex:0,index:Math.floor(i/4)+":"+j%4})}}return grid}
function generatePictureBrightnessMenu(unoCommand){var brightnessValues=[-40,-20,0,20,40];
var menuItems=[];for(var i=0;i<brightnessValues.length;i++){menuItems.push({
id:"brightness"+brightnessValues[i],uno:".uno:"+unoCommand+"?Brightness:short="+brightnessValues[i],
text:brightnessValues[i]+"%",img:"insertgraphic"})}return menuItems}
function generatePictureContrastMenu(unoCommand){var contrastValues=[-40,-20,0,20,40];
var menuItems=[];for(var i=0;i<contrastValues.length;i++){menuItems.push({
id:"contrast"+contrastValues[i],uno:".uno:"+unoCommand+"?Contrast:short="+contrastValues[i],
text:contrastValues[i]+"%",img:"insertgraphic"})}return menuItems}
function generatePictureTransparencyMenu(unoCommand){var transparencyValues=[0,15,30,50,65,80,95];
var menuItems=[];for(var i=0;i<transparencyValues.length;i++){menuItems.push({
id:"transparency"+transparencyValues[i],
uno:".uno:"+unoCommand+"?Transparency:short="+transparencyValues[i],text:transparencyValues[i]+"%",
img:"insertgraphic"})}return menuItems}menuDefinitions.set("NewSlideLayoutMenu",[{type:"json",
content:generateLayoutPopupGrid("InsertPage")},{type:"separator"}]);menuDefinitions.set(
"ChangeSlideLayoutMenu",[{type:"json",content:generateLayoutPopupGrid("AssignLayout")},{
type:"separator"}]);menuDefinitions.set("PictureBrightness",generatePictureBrightnessMenu(
"GrafLuminance"));menuDefinitions.set("PictureContrast",generatePictureContrastMenu("GrafContrast"))
menuDefinitions.set("PictureTransparency",generatePictureTransparencyMenu("GrafTransparence"));
menuDefinitions.set("PictureColorMode",[{text:_("Default"),img:"insertgraphic",
uno:".uno:GrafMode?ColorMode:short=0"},{text:_("Grayscale"),img:"insertgraphic",
uno:".uno:GrafMode?ColorMode:short=1"},{text:_("Black/White"),img:"insertgraphic",
uno:".uno:GrafMode?ColorMode:short=2"},{text:_("Watermark"),img:"insertgraphic",
uno:".uno:GrafMode?ColorMode:short=3"}]);menuDefinitions.set("AnnotationMenu",[{text:_(
"Insert comment"),action:"insertcomment"},{text:_("Comments list"),action:"showcommentsnavigator"}])
menuDefinitions.set("PictureEffectsMenu",[{text:_UNO(".uno:GraphicFilterInvert"),
uno:".uno:GraphicFilterInvert",img:"graphicfilterinvert"},{text:_UNO(".uno:GraphicFilterSharpen"),
uno:".uno:GraphicFilterSharpen",img:"graphicfiltersharpen"},{text:_UNO(
".uno:GraphicFilterRemoveNoise"),uno:".uno:GraphicFilterRemoveNoise",img:"graphicfilterremovenoise"}
,{text:_UNO(".uno:GraphicFilterPopart"),uno:".uno:GraphicFilterPopart",img:"graphicfilterpopart"},{
text:_UNO(".uno:GraphicFilterSobel"),uno:".uno:GraphicFilterSobel",img:"graphicfiltersobel"}]);
JSDialog.MenuDefinitions=menuDefinitions;var dialogModifications=new Map;dialogModifications.set(
"FindReplaceDialog",function(instance){if(!instance.container)return;
instance.container.addEventListener("keydown",function(e){if(e.code!=="Enter")return;
var activeElement=document.activeElement;if(!activeElement)return;if(activeElement.tagName==="INPUT"
){var inputElement=activeElement;if(inputElement.type==="text"){var activeId=inputElement.id;
var pushButtonWrapperId=null;if(activeId.includes("searchterm")){
pushButtonWrapperId=e.shiftKey?"backsearch":"search"}else if(activeId.includes("replaceterm")){
pushButtonWrapperId="replace"}if(pushButtonWrapperId){
var pushButtonWrapper=instance.container.querySelector("#"+pushButtonWrapperId);
var button=pushButtonWrapper?pushButtonWrapper.firstChild:null;if(button&&!button.disabled){
button.click();e.preventDefault()}}}else if(inputElement.type==="checkbox"){inputElement.click();
e.preventDefault()}}})});JSDialog.getDialogModificationCallback=function(dialogId){
return dialogModifications.get(dialogId)};var WindowId;(function(WindowId){WindowId[WindowId[
"Sidebar"]=-1]="Sidebar";WindowId[WindowId["Notebookbar"]=-2]="Notebookbar";WindowId[WindowId[
"Formulabar"]=-3]="Formulabar";WindowId[WindowId["AddressInput"]=-4]="AddressInput";WindowId[
WindowId["QuickFind"]=-5]="QuickFind"})(WindowId||(WindowId={}));function _createDropdownId(id){
return id+"-dropdown"}JSDialog.CreateDropdownEntriesId=function(id){return id+"-entries"};
JSDialog.OpenDropdown=function(id,popupParent,entries,innerCallback,popupAnchor,isSubmenu){
var json={id:_createDropdownId(id),type:"dropdown",isSubmenu:isSubmenu,jsontype:"dialog",
popupParent:popupParent,popupAnchor:popupAnchor,gridKeyboardNavigation:false,cancellable:true,
children:[{id:JSDialog.CreateDropdownEntriesId(id),type:"grid",allyRole:"listbox",cols:1,
rows:entries.length,children:[]}]};if(popupParent&&typeof popupParent._onDropDown==="function"){
popupParent._onDropDown(true)}var isChecked=function(unoCommand){var items=window.L.Map.THIS[
"stateChangeHandler"];var val=items.getItemValue(unoCommand);if(val&&(val===true||val==="true")
)return true;else return false};for(var i in entries){var checkedValue=entries[i
].checked===undefined?undefined:entries[i].uno&&isChecked(".uno"+entries[i].uno);var entry;if(
entries[i].type==="json"){json.children[0]=entries[i].content;if(json.children[0].type==="grid"
)json.gridKeyboardNavigation=true;break}switch(entries[i].type){case"html":entry={id:id+"-entry-"+i,
type:"htmlcontent",htmlId:entries[i].htmlId,closeCallback:function(){JSDialog.CloseDropdown(id)}};
json.gridKeyboardNavigation=true;break;case"colorpicker":entry=entries[i];
json.gridKeyboardNavigation=true;break;case"json":entry=entries[i].content;
json.gridKeyboardNavigation=true;break;case"separator":entry={id:id+"-entry-"+i,type:"separator",
orientation:"horizontal"};break;case"action":case"menu":default:entry={id:id+"-entry-"+i,
type:"comboboxentry",customRenderer:entries[i].customRenderer,comboboxId:id,pos:i,text:entries[i
].text,hint:entries[i].hint,w2icon:entries[i].icon,icon:entries[i].img,checked:entries[i
].checked||checkedValue,selected:entries[i].selected,hasSubMenu:!!entries[i].items};break}
json.children[0].children.push(entry)}var lastSubMenuOpened=null;var generateCallback=function(
targetEntries){return function(objectType,eventType,object,data){var pos=data?parseInt(data.substr(0
,data.indexOf(";"))):null;var entry=targetEntries&&pos!==null?targetEntries[pos]:null;if(
eventType==="selected"||eventType==="showsubmenu"){if(entry&&entry.items){if(lastSubMenuOpened){
var submenu=JSDialog.GetDropdown(lastSubMenuOpened);if(submenu){JSDialog.CloseDropdown(
lastSubMenuOpened);lastSubMenuOpened=null}}var dropdown=JSDialog.GetDropdown(object.id);
var subMenuId=object.id+"-"+pos;var targetEntry=dropdown.querySelectorAll(".ui-grid-cell")[pos+1];
JSDialog.OpenDropdown(subMenuId,targetEntry,entry.items,generateCallback(entry.items),"top-end",true
);lastSubMenuOpened=subMenuId;app.layoutingService.appendLayoutingTask(()=>{
var dropdown=JSDialog.GetDropdown(subMenuId);if(!dropdown){console.debug(
"Dropdown: missing :"+subMenuId);return}var container=dropdown.querySelector(".ui-grid");
JSDialog.MakeFocusCycle(container);var focusables=JSDialog.GetFocusableElements(container);if(
focusables&&focusables.length)focusables[0].focus()})}else if(
eventType==="selected"&&entry&&entry.uno){var uno=entry.uno.indexOf(".uno:"
)===0?entry.uno:".uno:"+entry.uno;window.L.Map.THIS.sendUnoCommand(uno);JSDialog.CloseDropdown(id);
return}}else if(eventType==="hidedropdown"){if(lastSubMenuOpened)JSDialog.CloseDropdown(
lastSubMenuOpened);JSDialog.CloseDropdown(id)}if(innerCallback&&innerCallback(objectType,eventType,
object,data,entry))return;if(eventType==="selected")JSDialog.CloseDropdown(id);else console.debug(
'Dropdown: unhandled action: "'+eventType+'"')}};window.L.Map.THIS.fire("closepopups");
window.L.Map.THIS.fire("jsdialog",{data:json,callback:generateCallback(entries)})};
JSDialog.CloseDropdown=function(id){window.L.Map.THIS.fire("jsdialog",{data:{id:_createDropdownId(id
),jsontype:"dialog",action:"close"}})};JSDialog.CloseAllDropdowns=function(){
window.L.Map.THIS.jsdialog.closeAllDropdowns()};JSDialog.GetDropdown=function(id){
return document.body.querySelector("#"+_createDropdownId(id))};function addOnClick(element,callback
){["click","keypress"].forEach(function(eventType){element.addEventListener(eventType,function(event
){if(eventType==="keypress"){var keyEvent=event;if(
keyEvent.key!=="Enter"&&keyEvent.key!=="Space"&&keyEvent.key!==" "){return}}callback(event)})})}
JSDialog.AddOnClick=addOnClick;function isTabVisible(tab){return!tab.classList.contains("hidden")}
function findNextVisibleTab(tabs,currentIndex,backwards){var diff=backwards?-1:1;
var total=tabs.length;for(var i=1;i<=total;i++){var nextIndex=(currentIndex+diff*i+total)%total;
var nextTab=tabs[nextIndex];if(isTabVisible(nextTab)){return nextTab}}return tabs[currentIndex]}
function moveFocusToPreviousTab(tabs,currentIndex){var currentTab=tabs[currentIndex];
currentTab.setAttribute("aria-selected","false");currentTab.setAttribute("tabindex","-1");
var nextTab=findNextVisibleTab(tabs,currentIndex,true);nextTab.setAttribute("aria-selected","true");
nextTab.removeAttribute("tabindex");nextTab.click();nextTab.focus()}function moveFocusToNextTab(tabs
,currentIndex){var currentTab=tabs[currentIndex];currentTab.setAttribute("aria-selected","false");
currentTab.setAttribute("tabindex","-1");var nextTab=findNextVisibleTab(tabs,currentIndex,false);
nextTab.setAttribute("aria-selected","true");nextTab.removeAttribute("tabindex");nextTab.click();
nextTab.focus()}function moveFocusIntoTabPage(contentDivs,currentTab){if(!currentTab.hasAttribute(
"aria-controls")){console.warn("Current tab has no aria-controls attribute");return}
var controlledId=currentTab.getAttribute("aria-controls");var controlledDiv=contentDivs.find(
function(div){return div.id===controlledId});if(controlledDiv){
var firstFocusableElement=JSDialog.FindFocusableWithin(controlledDiv,"next");if(
firstFocusableElement!==null){firstFocusableElement.focus()}}}function handleTabKeydown(event,tabs,
contentDivs){var currentTab=event.currentTarget;var currentIndex=tabs.indexOf(currentTab);if(
currentIndex===-1)return;switch(event.key){case"ArrowLeft":moveFocusToPreviousTab(tabs,currentIndex)
break;case"ArrowRight":moveFocusToNextTab(tabs,currentIndex);break;case"ArrowDown":
moveFocusIntoTabPage(contentDivs,currentTab);break;case"Home":{var firstIndex=0;var firstTab=tabs[
firstIndex];if(!isTabVisible(firstTab))firstTab=findNextVisibleTab(tabs,firstIndex,false);
firstTab.focus();break}case"End":{var lastIndex=tabs.length-1;var lastTab=tabs[lastIndex];if(
!isTabVisible(lastTab))lastTab=findNextVisibleTab(tabs,lastIndex,true);lastTab.focus();break}
case"Escape":if(window.app&&window.app.map&&window.app.map.focus){window.app.map.focus()}break}}
JSDialog.KeyboardTabNavigation=function(tabs,contentDivs){tabs.forEach(function(tab){
tab.addEventListener("keydown",function(event){handleTabKeydown(event,tabs,contentDivs)})})};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};function handleKeyboardNavigation(event,currentElement,
parentContainer){switch(event.key){case"ArrowRight":moveFocus(parentContainer,currentElement,"next",
"horizontal");event.preventDefault();break;case"ArrowLeft":moveFocus(parentContainer,currentElement,
"previous","horizontal");event.preventDefault();break;case"ArrowDown":moveFocus(parentContainer,
currentElement,"next","vertical");event.preventDefault();break;case"ArrowUp":moveFocus(
parentContainer,currentElement,"previous","vertical");event.preventDefault();break;default:break}}
function moveFocus(parentContainer,currentElement,direction,axis){var focusableElements=Array.from(
JSDialog.GetFocusableElements(parentContainer));var _a=__read(getRowColumn(currentElement),2),
currentRow=_a[0],currentColumn=_a[1];var targetRow=currentRow;var targetColumn=currentColumn;if(
axis==="horizontal"){if(direction==="next"){targetColumn++;if(!focusableElements.find(function(el){
return getRowColumn(el)[0]===currentRow&&getRowColumn(el)[1]===targetColumn})){targetColumn=0}}else{
targetColumn--;if(targetColumn<0){targetColumn=focusableElements.filter(function(el){
return getRowColumn(el)[0]===currentRow}).length-1}}}else if(axis==="vertical"){if(
direction==="next"){targetRow++}else{targetRow--}var elementsInTargetRow=focusableElements.filter(
function(el){return getRowColumn(el)[0]===targetRow});if(elementsInTargetRow.length>0){if(
targetColumn>=elementsInTargetRow.length){targetColumn=elementsInTargetRow.length-1}}}
var updateAriaSelected=function(elem,value){if(elem.hasAttribute("aria-selected")){
elem.setAttribute("aria-selected",value)}};var targetElement=focusableElements.find(function(el){
return getRowColumn(el)[0]===targetRow&&getRowColumn(el)[1]===targetColumn});updateAriaSelected(
currentElement,"false");if(targetElement){updateAriaSelected(targetElement,"true");
targetElement.focus()}else{
var potentialCurrentElement=axis==="vertical"?parentContainer:currentElement;
var nextElement=direction==="next"?JSDialog.FindFocusableElement(
potentialCurrentElement.nextElementSibling,"next"):JSDialog.FindFocusableElement(
potentialCurrentElement.previousElementSibling,"previous");if(nextElement){updateAriaSelected(
nextElement,"true");nextElement.focus()}}}function getRowColumn(element){
var index=element.getAttribute("index");if(!index)return[-1,-1];var _a=__read(index.split(":").map(
Number),2),row=_a[0],column=_a[1];return[row,column]}JSDialog.KeyboardGridNavigation=function(
container){container.addEventListener("keydown",function(event){
var activeElement=document.activeElement;if(!JSDialog.IsTextInputField(activeElement)){
handleKeyboardNavigation(event,activeElement,activeElement.parentElement)}})};
function KeyboardListNavigation(event,currentElement){switch(event.key){case"ArrowDown":
moveToFocusableEntry(currentElement,"next");event.preventDefault();break;case"ArrowUp":
moveToFocusableEntry(currentElement,"previous");event.preventDefault();break;case"Tab":if(
event.shiftKey){moveToFocusableEntry(currentElement,"previous");event.preventDefault()}else{
moveToFocusableEntry(currentElement,"next");event.preventDefault()}break;default:break}}
function moveToFocusableEntry(currentElement,direction){var updateAriaSelected=function(elem,value){
if(elem.hasAttribute("aria-selected")){elem.setAttribute("aria-selected",value)}};if(
document.activeElement===currentElement&&!currentElement.classList.contains("selected"
)&&direction==="next"){currentElement.classList.add("selected");updateAriaSelected(currentElement,
"true");return}var siblingElement=JSDialog.FindNextFocusableSiblingElement(currentElement,direction)
if(siblingElement){siblingElement.focus();siblingElement.classList.add("selected");
updateAriaSelected(siblingElement,"true");currentElement.classList.remove("selected");
updateAriaSelected(currentElement,"false")}}JSDialog.KeyboardListNavigation=function(container){
container.addEventListener("keydown",function(event){var activeElement=document.activeElement;if(
!JSDialog.IsTextInputField(activeElement)){KeyboardListNavigation(event,activeElement)}})};
function isAnyInputFocused(){if(!app.map)return false;if(app.map.hasFocus())return false;
var hasTunneledDialogOpened=app.map.dialog?app.map.dialog.hasOpenedDialog():false;
var hasJSDialogOpened=app.map.jsdialog?app.map.jsdialog.hasDialogOpened():false;
var hasJSDialogFocused=window.L.DomUtil.hasClass(document.activeElement,"jsdialog");
var commentHasFocus=cool.Comment.isAnyFocus();var inputHasFocus=$("input:focus").length>0||$(
"textarea.jsdialog:focus").length>0;
return hasTunneledDialogOpened||hasJSDialogOpened||hasJSDialogFocused||commentHasFocus||inputHasFocus
}function getFocusableElements(container){if(!container)return null;
var ret=container.querySelectorAll(
'[tabIndex="0"]:not(.jsdialog-begin-marker, .jsdialog-end-marker):not([disabled]):not(.hidden)');if(
!ret.length)ret=container.querySelectorAll("input:not([disabled]):not(.hidden)");if(!ret.length
)ret=container.querySelectorAll("textarea:not([disabled]):not(.hidden)");if(!ret.length
)ret=container.querySelectorAll("select:not([disabled]):not(.hidden)");if(!ret.length
)ret=container.querySelectorAll("button:not([disabled]):not(.hidden)");return ret}
function isFocusable(element){if(!element)return false;const focusableElements=[
"a[href]:not([disabled]):not(.hidden)","button:not([disabled]):not(.hidden)",
"textarea:not([disabled]):not(.hidden)",'input[type="text"]:not([disabled]):not(.hidden)',
"input:not([type]):not([disabled]):not(.hidden)",'input[type="radio"]:not([disabled]):not(.hidden)',
'input[type="checkbox"]:not([disabled]):not(.hidden)',"select:not([disabled]):not(.hidden)",
'[tabindex]:not([tabindex="-1"]):not(.jsdialog-begin-marker):not(.jsdialog-end-marker):not([disabled]):not(.hidden)'
];return focusableElements.some(selector=>element.matches(selector))}function makeFocusCycle(
container,failedToFindFocusFunc){var beginMarker=window.L.DomUtil.create("div",
"jsdialog autofilter jsdialog-begin-marker");var endMarker=window.L.DomUtil.create("div",
"jsdialog autofilter jsdialog-end-marker");beginMarker.tabIndex=0;endMarker.tabIndex=0;
container.insertBefore(beginMarker,container.firstChild);container.appendChild(endMarker);
container.addEventListener("focusin",function(event){if(event.target==endMarker){
var focusables=getFocusableElements(container);if(focusables&&focusables.length){focusables[0
].focus();return}}else if(event.target==beginMarker){var focusables=getFocusableElements(container);
if(focusables&&focusables.length){focusables[focusables.length-1].focus();return}}if((
event.target==endMarker||event.target==beginMarker)&&failedToFindFocusFunc)failedToFindFocusFunc()})
}function findFocusableElement(element,direction){if(!element)return null;if(isFocusable(element)
)return element;const focusableInSibling=findFocusableWithin(element,direction);if(
focusableInSibling)return focusableInSibling;return findNextFocusableSiblingElement(element,
direction)}function findFocusableWithin(element,direction){const focusableElements=Array.from(
element.querySelectorAll("*"));return direction==="next"?focusableElements.find(isFocusable
):focusableElements.reverse().find(isFocusable)}function findNextFocusableSiblingElement(element,
direction){
const sibling=direction==="next"?element.nextElementSibling:element.previousElementSibling;
return findFocusableElement(sibling,direction)}function isTextInputField(currentActiveElement){
return currentActiveElement.tagName==="INPUT"&&currentActiveElement.type==="text"||currentActiveElement.tagName==="TEXTAREA"
}function findFocusableParent(container,currentElement,element,arrowUp){if(!element
)return null;else if(element.tagName==="NAV"&&arrowUp){return element}else if(
element.tabIndex===-1||element.tagName=="A"){return findFocusableParent(container,currentElement,
element.parentNode,arrowUp)}else if(container.contains(element
)&&currentElement!==element&&!currentElement.contains(element)&&!element.disabled){return element
}else return null}function rayCastToNextElement(container,currentElement,boundingRectangle,startX,
startY,diffX,diffY,arrowUp){let count=0;let foundElement;while(count<=60){count++;startX+=diffX;
startY+=diffY;foundElement=document.elementFromPoint(startX,startY);
foundElement=findFocusableParent(container,currentElement,foundElement,arrowUp);if(foundElement
)break;if(diffX===0){foundElement=document.elementFromPoint(boundingRectangle.left,startY);
foundElement=findFocusableParent(container,currentElement,foundElement,arrowUp);if(foundElement
)break;foundElement=document.elementFromPoint(boundingRectangle.right,startY);
foundElement=findFocusableParent(container,currentElement,foundElement,arrowUp);if(foundElement
)break}else if(diffY===0){foundElement=document.elementFromPoint(startX,boundingRectangle.top);
foundElement=findFocusableParent(container,currentElement,foundElement,arrowUp);if(foundElement
)break;foundElement=document.elementFromPoint(startX,boundingRectangle.bottom);
foundElement=findFocusableParent(container,currentElement,foundElement,arrowUp);if(foundElement
)break}}if(count===60)return null;else return foundElement}function findNextElementInContainer(
container,currentElement,direction){let boundingRectangle=currentElement.getBoundingClientRect();
let startX=boundingRectangle.left+(boundingRectangle.right-boundingRectangle.left)/2;
let startY=boundingRectangle.top+(boundingRectangle.bottom-boundingRectangle.top)/2;let diffX=0;
let diffY=0;var rayCastingSensitivity=10;if(direction==="ArrowLeft"||direction==="ArrowRight"
)diffX=direction==="ArrowRight"?rayCastingSensitivity:rayCastingSensitivity*-1;if(
direction==="ArrowUp"||direction==="ArrowDown"
)diffY=direction==="ArrowDown"?rayCastingSensitivity:rayCastingSensitivity*-1;
return rayCastToNextElement(container,currentElement,boundingRectangle,startX,startY,diffX,diffY,
direction==="ArrowUp")}JSDialog.IsAnyInputFocused=isAnyInputFocused;
JSDialog.GetFocusableElements=getFocusableElements;JSDialog.MakeFocusCycle=makeFocusCycle;
JSDialog.FindFocusableElement=findFocusableElement;JSDialog.FindFocusableWithin=findFocusableWithin;
JSDialog.FindNextFocusableSiblingElement=findNextFocusableSiblingElement;
JSDialog.IsFocusable=isFocusable;JSDialog.IsTextInputField=isTextInputField;
JSDialog.FindFocusableParent=findFocusableParent;JSDialog.RayCastToNextElement=rayCastToNextElement;
JSDialog.FindNextElementInContainer=findNextElementInContainer;
var FormulaBarSelectionHandle=function(){function FormulaBarSelectionHandle(wrapper,handleLayer,side
){var _this=this;this.width=30;this.visible=false;this.side=side;
this.element=window.L.DomUtil.create("div","formulabar-selection-handle-"+side,handleLayer);
this.wrapper=wrapper;this.wrapper.addEventListener("scroll",function(){return _this.requestVisible()
});this.draggable=new window.L.Draggable(this.element,this.element,true,true);this.draggable.on({
dragstart:this.onDragStart.bind(this),drag:this._onDrag.bind(this),dragend:this._onDragEnd.bind(this
)},this).enable()}FormulaBarSelectionHandle.prototype.setPosition=function(point){var offsetX=0;if(
this.side==="start"){offsetX=-this.width}var lPoint=new cool.Point(point.x+offsetX,point.y);
window.L.DomUtil.setPosition(this.element,lPoint,true)};
FormulaBarSelectionHandle.prototype.onDragStart=function(){window.IgnorePanning=true};
FormulaBarSelectionHandle.prototype._onDrag=function(event){if(this.onDrag){
var point=window.L.DomUtil.getPosition(this.element);this.onDrag(point)}};
FormulaBarSelectionHandle.prototype._onDragEnd=function(_){window.IgnorePanning=undefined;if(
this.onDragEnd){var point=window.L.DomUtil.getPosition(this.element);this.onDragEnd(point)}};
FormulaBarSelectionHandle.prototype.requestVisible=function(visible){var _this=this;if(
visible!==undefined){this.visible=visible}app.layoutingService.appendLayoutingTask(function(){if(
!_this.visible||!window.touch.currentlyUsingTouchscreen()){_this.element.style.visibility="hidden";
return}var wrapperRect=_this.wrapper.getBoundingClientRect();
var elementRect=_this.element.getBoundingClientRect();if(
wrapperRect.top>elementRect.top||wrapperRect.bottom<elementRect.top){
_this.element.style.visibility="hidden";return}_this.element.style.visibility="visible"})};
return FormulaBarSelectionHandle}();var JSDialogMessageRouter=function(){
function JSDialogMessageRouter(){}JSDialogMessageRouter.prototype._preProcessMessageDialog=function(
msgData){if(!msgData.children)return;for(var i in msgData.children){var child=msgData.children[i];
if(child.type==="multilineedit")child.type="fixedtext";else if(child.children
)this._preProcessMessageDialog(child)}};JSDialogMessageRouter.prototype.processMessage=function(
msgData,callbackFn){if(msgData.action){var fireJSDialogEvent=function(){switch(msgData.action){
case"update":app.socket._map.fire("jsdialogupdate",{data:msgData});return true;case"action":
app.socket._map.fire("jsdialogaction",{data:msgData});return true}return false};
var isNotebookbarInitialized=app.socket._map.uiManager&&app.socket._map.uiManager.notebookbar;if(
msgData.jsontype==="notebookbar"&&!isNotebookbarInitialized||msgData.jsontype==="addressinputfield"&&!app.socket._map.addressInputField
){setTimeout(fireJSDialogEvent,1e3);return}else if(fireJSDialogEvent()===true){return}}if(
msgData.type==="messagebox")this._preProcessMessageDialog(msgData);if(msgData.jsontype==="popup"
)return;if(window.mode.isMobile()){if(
msgData.type==="dropdown"||msgData.type==="snackbar"||msgData.type==="modalpopup"&&msgData.id===JSDialog.generateModalId(
app.idleHandlerId)){app.socket._map.fire("jsdialog",{data:msgData,callback:callbackFn});return}if(
msgData.type=="borderwindow")return;if(msgData.jsontype==="formulabar"){app.socket._map.fire(
"formulabar",{data:msgData});return}if(
msgData.enabled||msgData.jsontype==="dialog"||msgData.type==="modalpopup"){app.socket._map.fire(
"mobilewizard",{data:msgData,callback:callbackFn})}else{console.warn(
'jsdialog: unhandled jsdialog mobile message: {jsontype: "'+msgData.jsontype+'", type: "'+msgData.type+'" ... }'
)}}else if(msgData.jsontype==="dialog"){app.socket._map.fire("jsdialog",{data:msgData,
callback:callbackFn})}else if(msgData.jsontype==="sidebar"){app.socket._map.fire("sidebar",{
data:msgData})}else if(msgData.jsontype==="navigator"){app.socket._map.fire("navigator",{
data:msgData})}else if(msgData.jsontype==="formulabar"){app.socket._map.fire("formulabar",{
data:msgData})}else if(msgData.jsontype==="notebookbar"){if(msgData.children){for(
var i=0;i<msgData.children.length;i++){if(msgData.children[i].type==="control"){msgData.children[i
].id=msgData.id;app.socket._map.fire("notebookbar",msgData.children[i]);return}}}}else if(
msgData.jsontype==="quickfind"){app.socket._map.fire("quickfind",{data:msgData})}else{console.warn(
'Unhandled jsdialog message: {jsontype: "'+msgData.jsontype+'", type: "'+msgData.type+'" ... }')}};
return JSDialogMessageRouter}();JSDialog.MessageRouter=new JSDialogMessageRouter;
var modalIdPretext="modal-dialog-";function generateModalId(givenId){return modalIdPretext+givenId}
function sendJSON(json){if(!app.socket)return;app.socket._onMessage({
textMsg:"jsdialog: "+JSON.stringify(json)})}function setMessageInModal(id,msg1){
var dialogId=generateModalId(id);var json={id:dialogId,jsontype:"dialog",type:"modalpopup",
action:"update",control:{id:"info-modal-label1",type:"fixedtext",text:msg1}};sendJSON(json)}
function enableButtonInModal(id,buttonId,enable){var dialogId=generateModalId(id);var json={
id:dialogId,jsontype:"dialog",type:"modalpopup",action:"action",data:{control_id:buttonId,
action_type:enable?"enable":"disable"}};sendJSON(json)}function shouldShowAgain(id){
return window.prefs.getBoolean(`UIShowAgain_${id}`,true)}function setShowAgain(id,state){
window.prefs.set(`UIShowAgain_${id}`,state)}function showInfoModalWithOptions(id,options){if(app.map
){var title=options.title;var message1=options.messages.length?options.messages[0]:undefined;
var message2=options.messages.length>1?options.messages[1]:undefined;
var buttonText=options.buttons&&options.buttons.length?options.buttons[0].text:undefined;
var callback=options.buttons&&options.buttons.length?options.buttons[0].callback:undefined;
var withCancel=options.withCancel;var focusId=options.focusId;app.map.uiManager.showInfoModal(id,
title,message1,message2,buttonText,callback,withCancel,focusId)}}function isWidgetInModalPopup(
widgetData){if(widgetData.type=="modalpopup")return true;while(widgetData.parent){
widgetData=widgetData.parent;if(widgetData.type=="modalpopup")return true}return false}
JSDialog.generateModalId=generateModalId;JSDialog.sendJSON=sendJSON;
JSDialog.setMessageInModal=setMessageInModal;JSDialog.enableButtonInModal=enableButtonInModal;
JSDialog.shouldShowAgain=shouldShowAgain;JSDialog.setShowAgain=setShowAgain;
JSDialog.showInfoModalWithOptions=showInfoModalWithOptions;
JSDialog.isWidgetInModalPopup=isWidgetInModalPopup;function onDemandRenderer(builder,controlId,
controlType,entryId,placeholder,parentContainer,entryText){var setupOnDemandRenderer=function(){
var cachedComboboxEntries=builder.rendersCache[controlId];var requestRender=true;if(
cachedComboboxEntries&&cachedComboboxEntries.images[entryId]){window.L.DomUtil.remove(placeholder);
placeholder=window.L.DomUtil.create("img","",parentContainer);var placeholderImg=placeholder;
placeholderImg.src=cachedComboboxEntries.images[entryId];placeholderImg.alt=entryText;
placeholderImg.title=entryText;requestRender=!cachedComboboxEntries.persistent}if(requestRender){
var onIntersection=function(entries){entries.forEach(function(entry){if(entry.isIntersecting){
builder.callback(controlType,"render_entry",{id:controlId},entryId+";"+Math.floor(
100*window.devicePixelRatio)+";"+Math.floor(100*window.devicePixelRatio),builder)}})};
var observer=new IntersectionObserver(onIntersection,{root:null,threshold:.01});observer.observe(
placeholder)}};if(TileManager.isReceivedFirstTile()){setupOnDemandRenderer()}else{
TileManager.appendAfterFirstTileTask(setupOnDemandRenderer)}}
JSDialog.OnDemandRenderer=onDemandRenderer;var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
function createScrollButtons(parent,scrollable){window.L.DomUtil.addClass(scrollable,
"ui-scroll-wrapper");var left=window.L.DomUtil.create("div","ui-scroll-left",parent);
var right=window.L.DomUtil.create("div","ui-scroll-right",parent);JSDialog.AddOnClick(left,function(
){var scroll=$(scrollable).scrollLeft()-300;$(scrollable).animate({scrollLeft:scroll},300);
setTimeout(function(){JSDialog.RefreshScrollables()},350)});JSDialog.AddOnClick(right,function(){
var scroll=$(scrollable).scrollLeft()+300;$(scrollable).animate({scrollLeft:scroll},300);setTimeout(
function(){JSDialog.RefreshScrollables()},350)})}function showArrow(arrow,show){if(show
)arrow.style.setProperty("display","block");else arrow.style.setProperty("display","none")}
function setupResizeHandler(container,scrollable){var left=container.querySelector(".ui-scroll-left"
);var right=container.querySelector(".ui-scroll-right");
var isRTL=document.documentElement.dir==="rtl";var timer;var handler=function(){
var rootContainer=scrollable.querySelector("div");if(!rootContainer)return;if(
rootContainer.scrollWidth>window.innerWidth){var direction=isRTL?-1:1;if(
direction*scrollable.scrollLeft>0){if(isRTL)showArrow(right,true);else showArrow(left,true)}else if(
isRTL)showArrow(right,false);else showArrow(left,false);if(
direction*scrollable.scrollLeft<rootContainer.scrollWidth-window.innerWidth-1){if(isRTL)showArrow(
left,true);else showArrow(right,true)}else if(isRTL)showArrow(left,false);else showArrow(right,false
)}else{showArrow(left,false);showArrow(right,false)}}.bind(this);var wheelHandler=function(e){
var rootContainer=scrollable.querySelector("div");if(!rootContainer||!e.shiftKey&&e.deltaX==0)return
clearTimeout(timer);timer=setTimeout(function(){JSDialog.RefreshScrollables()},350)};
window.addEventListener("resize",handler);window.addEventListener("scroll",handler);
scrollable.addEventListener("wheel",wheelHandler)}function setupPriorityStatusHandler(scrollable,
toolItems){var handler=function(){var e_1,_a;var rootContainer=scrollable.querySelector("div");if(
!rootContainer)return;var statusBarItems=Array.from(rootContainer.children);statusBarItems.forEach(
function(domItem){var toolItem=toolItems.find(function(item){var itemIdBase=item.id.split(":")[0];
return itemIdBase===domItem.id||item.id+"-container"===domItem.id});if(
toolItem&&toolItem.dataPriority){domItem.setAttribute("data-priority",toolItem.dataPriority)}else{
domItem.removeAttribute("data-priority")}});statusBarItems.forEach(function(item){
item.classList.remove("status-hidden")});var availableWidth=window.innerWidth;
var contentWidth=rootContainer.scrollWidth;if(contentWidth>availableWidth){
var itemsByPriorityLevel_1={};statusBarItems.forEach(function(item){if(item.hasAttribute(
"data-priority")){var priority=item.getAttribute("data-priority")||"0";if(!itemsByPriorityLevel_1[
priority]){itemsByPriorityLevel_1[priority]=[]}itemsByPriorityLevel_1[priority].push(item)}});
var priorityLevels=Object.keys(itemsByPriorityLevel_1).map(Number).sort(function(a,b){return b-a});
var remainingWidthToFit=contentWidth-availableWidth;try{for(var priorityLevels_1=__values(
priorityLevels),priorityLevels_1_1=priorityLevels_1.next(
);!priorityLevels_1_1.done;priorityLevels_1_1=priorityLevels_1.next()){
var priority=priorityLevels_1_1.value;var itemsAtPriority=itemsByPriorityLevel_1[priority];if(
!itemsAtPriority)continue;var combinedWidthAtPriority=itemsAtPriority.reduce(function(sum,item){
return sum+item.offsetWidth},0);if(remainingWidthToFit>0){itemsAtPriority.forEach(function(item){
item.classList.add("status-hidden")});remainingWidthToFit-=combinedWidthAtPriority;
contentWidth-=combinedWidthAtPriority}else{break}}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
priorityLevels_1_1&&!priorityLevels_1_1.done&&(_a=priorityLevels_1.return))_a.call(priorityLevels_1)
}finally{if(e_1)throw e_1.error}}}}.bind(this);window.addEventListener("resize",handler)}
JSDialog.MakeScrollable=function(parent,scrollable){window.L.DomUtil.addClass(scrollable,
"ui-scrollable-content");createScrollButtons(parent,scrollable);setupResizeHandler(parent,scrollable
)};JSDialog.MakeStatusPriority=function(scrollable,toolItems){window.L.DomUtil.addClass(scrollable,
"ui-scrollable-content");setupPriorityStatusHandler(scrollable,toolItems)};
JSDialog.RefreshScrollables=function(){window.dispatchEvent(new Event("resize"))};
JSDialog.ScrollIntoViewBlockOption=function(option){if(option==="nearest"||option==="center"){
var match=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./);var firefoxVer=match?parseInt(
match[1]):58;var blockOption=firefoxVer>=58?option:"start";return blockOption}return option};
var SnackbarController=function(){function SnackbarController(){this.snackbarTimeout=1e4;
this.showingSnackbar=false;this.snackbarQueue=new Array}
SnackbarController.prototype.closeSnackbar=function(){var closeMessage={id:"snackbar",
jsontype:"dialog",type:"snackbar",action:"close"};app.socket._onMessage({
textMsg:"jsdialog: "+JSON.stringify(closeMessage)});this.showingSnackbar=false;
this.scheduleSnackbar()};SnackbarController.prototype.showSnackbar=function(label,action,callback,
timeout,hasProgress,withDismiss,infinite){if(!app.socket)return;this.snackbarQueue.push({
label:label,action:action,callback:callback,timeout:timeout,hasProgress:hasProgress,
withDismiss:withDismiss,infinite:infinite});this.scheduleSnackbar()};
SnackbarController.prototype.extractTimeout=function(snackbarData){
return snackbarData.timeout||this.snackbarTimeout};
SnackbarController.prototype.scheduleSnackbar=function(){if(
this.showingSnackbar||!this.snackbarQueue.length)return;var snackbarData=this.snackbarQueue.shift();
this.showSnackbarImpl(snackbarData);this.showingSnackbar=true};
SnackbarController.prototype.showSnackbarImpl=function(snackbarData){var _this=this;
var buttonId="button";var labelId="label";var json={id:"snackbar",jsontype:"dialog",type:"snackbar",
timeout:this.extractTimeout(snackbarData),init_focus_id:snackbarData.action?buttonId:undefined,
children:[{id:snackbarData.hasProgress?"snackbar-container-progress":"snackbar-container",
type:"container",children:[snackbarData.action?{id:labelId,type:"fixedtext",text:snackbarData.label,
labelFor:buttonId}:{id:"label-no-action",type:"fixedtext",text:snackbarData.label},
snackbarData.withDismiss?{id:"snackbar-dismiss-button",type:"pushbutton",text:_("Dismiss")}:{},
snackbarData.hasProgress?{id:"progress",type:"progressbar",value:0,maxValue:100,
infinite:snackbarData.infinite}:{},snackbarData.action?{id:buttonId,type:"pushbutton",
text:snackbarData.action,labelledBy:labelId}:{}]}]};var builderCallback=function(objectType,
eventType,object,data,builder){window.app.console.debug(
"control: '"+objectType+"' id:'"+object.id+"' event: '"+eventType+"' state: '"+data+"'");if(
object.id===buttonId&&objectType==="pushbutton"&&eventType==="click"){if(
typeof snackbarData.callback==="function")snackbarData.callback();_this.closeSnackbar()}else if(
object.id==="__POPOVER__"&&objectType==="popover"&&eventType==="close"){_this.closeSnackbar()}if(
object.id==="snackbar-dismiss-button"&&objectType==="pushbutton"&&eventType==="click"){
_this.closeSnackbar()}};app.socket._onMessage({textMsg:"jsdialog: "+JSON.stringify(json),
callback:builderCallback})};SnackbarController.prototype.setSnackbarProgress=function(value,infinite
){if(!app.socket)return;var json={id:"snackbar",jsontype:"dialog",type:"snackbar",action:"update",
control:{id:"progress",type:"progressbar",value:value,maxValue:100,infinite:infinite}};
app.socket._onMessage({textMsg:"jsdialog: "+JSON.stringify(json)})};return SnackbarController}();
JSDialog.SnackbarController=new SnackbarController;function onStateChange(element,callback){
var enabledCallback=function(mutations){for(var i in mutations){if(mutations[i
].attributeName==="disabled"){var htmlElement=mutations[i].target;
var enable=htmlElement.getAttribute("disabled")!=="true";callback(enable)}}};
var enableObserver=new MutationObserver(enabledCallback);enableObserver.observe(element,{
attributeFilter:["disabled"],attributeOldValue:true})}function synchronizeDisabledState(source,
targets){var enabledCallback=function(enable){app.layoutingService.appendLayoutingTask(function(){
for(var i in targets){if(enable){targets[i].removeAttribute("disabled")}else{targets[i
].setAttribute("disabled","true")}}})};onStateChange(source,enabledCallback)}
JSDialog.OnStateChange=onStateChange;JSDialog.SynchronizeDisabledState=synchronizeDisabledState;
JSDialog.buttonBox=function(parentContainer,data,builder){var container=window.L.DomUtil.create(
"div",builder.options.cssClass+" ui-button-box "+(data.layoutstyle?data.layoutstyle:""),
parentContainer);container.id=data.id;var leftAlignButtons=[];var rightAlignButton=[];if(
data.children){for(var i in data.children){var child=data.children[i];if(child.id==="help"
)leftAlignButtons.push(child);else rightAlignButton.push(child)}}var left=window.L.DomUtil.create(
"div",builder.options.cssClass+" ui-button-box-left",container);for(var i in leftAlignButtons){
var child=leftAlignButtons[i];if(builder._controlHandlers[child.type]){builder._controlHandlers[
child.type](left,child,builder);builder.postProcess(left,child)}}var right=window.L.DomUtil.create(
"div",builder.options.cssClass+" ui-button-box-right",container);if(
data.layoutstyle&&data.layoutstyle==="end")window.L.DomUtil.addClass(container,"end");for(
var i in rightAlignButton){var child=rightAlignButton[i];if(builder._controlHandlers[child.type]){
builder._controlHandlers[child.type](right,child,builder);builder.postProcess(right,child)}}if(
data.vertical===true){left.style.display="grid";left.style.margin="auto";right.style.display="grid";
right.style.margin="auto"}return false};function _calendarControl(parentContainer,data,builder){
const container=window.L.DomUtil.create("div","ui-calendar "+builder.options.cssClass,
parentContainer);container.id=data.id;$.datepicker.setDefaults($.datepicker.regional[
window.langParamLocale.language]);$(container).datepicker({defaultDate:new Date(data.year,
data.month-1,data.day),dateFormat:"mm/dd/yy",onSelect:function(date){if(date!=""){builder.callback(
"calendar","selectdate",container,date,builder);$(container).datepicker("destroy")}}});return false}
JSDialog.calendar=function(parentContainer,data,builder){const buildInnerData=_calendarControl(
parentContainer,data,builder);return buildInnerData};function parseHexColor(color){if(
color==="transparent")return-1;else return parseInt("0x"+color)}function getDefaultColorForCommand(
command){if(command==".uno:CharBackColor")return-1;else if(command==".uno:BackgroundColor")return-1;
return 0}function toHexColor(colorInt){var colorInt=parseInt(colorInt);if(colorInt<0
)return""+colorInt;var colorHex=colorInt.toString(16);while(colorHex!="#"&&colorHex.length<6
)colorHex="0"+colorHex;if(colorHex[0]!="#")colorHex="#"+colorHex;return colorHex}
JSDialog.getCurrentColor=function(data,builder){var selectedColor=builder.map["stateChangeHandler"
].getItemValue(data.command);if(!selectedColor||selectedColor<0
)selectedColor=builder._getUnoStateForItemId(data.id,builder);if(!selectedColor||selectedColor<0
)selectedColor=getDefaultColorForCommand(data.command);return toHexColor(parseInt(selectedColor))};
JSDialog.sendColorCommand=function(builder,data,color,themeData){var gradientItem;if(
data.id==="fillgrad1"){gradientItem=builder.map["stateChangeHandler"].getItemValue(
".uno:FillGradient");gradientItem.startcolor=color;builder.map.sendUnoCommand(
".uno:FillGradient?FillGradientJSON:string="+JSON.stringify(gradientItem));return}else if(
data.id==="fillgrad2"){gradientItem=builder.map["stateChangeHandler"].getItemValue(
".uno:FillGradient");gradientItem.endcolor=color;builder.map.sendUnoCommand(
".uno:FillGradient?FillGradientJSON:string="+JSON.stringify(gradientItem));return}else if(
data.id==="fillattr2"){gradientItem=builder.map["stateChangeHandler"].getItemValue(
".uno:FillPageGradient");gradientItem.startcolor=color;builder.map.sendUnoCommand(
".uno:FillPageGradient?FillPageGradientJSON:string="+JSON.stringify(gradientItem));return}else if(
data.id==="fillattr3"){gradientItem=builder.map["stateChangeHandler"].getItemValue(
".uno:FillPageGradient");gradientItem.endcolor=color;builder.map.sendUnoCommand(
".uno:FillPageGradient?FillPageGradientJSON:string="+JSON.stringify(gradientItem));return}if(
data.id==="fillattr"){data.command=".uno:FillPageColor"}else if(data.id==="LB_GLOW_COLOR"){
data.id="GlowColor"}else if(data.id==="LB_SHADOW_COLOR"){data.command=".uno:FillShadowColor"}
var params={};var colorParameterID=data.command.replace(".uno:","")+".Color";
var themeParameterID=data.command.replace(".uno:","")+".ComplexColorJSON";var parsed=parseHexColor(
color);params[colorParameterID]={type:"long",value:parsed?parsed:parseInt(color)};if(themeData!=null
){params[themeParameterID]={type:"string",value:themeData}}builder.map["stateChangeHandler"
].setItemValue(data.command,params[colorParameterID].value);builder.map.sendUnoCommand(data.command,
params);app.colorLastSelection[data.command]=color};JSDialog.colorPickerButton=function(
parentContainer,data,builder){
var commandOverride=data.command===".uno:Color"&&builder.map.getDocType()==="text";if(
commandOverride)data.command=".uno:FontColor";var titleOverride=builder._getTitleForControlWithId(
data.id);if(titleOverride)data.text=titleOverride;
data.id=data.id?data.id:data.command?data.command.replace(".uno:",""):undefined;
data.text=builder._cleanText(data.text);if(data.command){var applyFunction=function(event){
event.preventDefault();event.stopPropagation();var colorToApply=app.colorLastSelection[data.command]
if(!colorToApply||colorToApply==="#")return;var color=colorToApply.indexOf("#"
)===0?colorToApply.substr(1):colorToApply;JSDialog.sendColorCommand(builder,data,color)};if(
data.id.indexOf(":ColorPickerMenu")===-1)data.id=data.id+":ColorPickerMenu";data.noLabel=true;
data.applyCallback=applyFunction;var menubutton=builder._controlHandlers["menubutton"](
parentContainer,data,builder);if(typeof menubutton==="object"){window.L.DomUtil.addClass(
menubutton.container,data.class?data.class+" has-colorpicker":"has-colorpicker");
var valueNode=window.L.DomUtil.create("span","selected-color",menubutton.button);
valueNode.addEventListener("click",applyFunction);var updateFunction=function(){if(
app.colorLastSelection[data.command]!==undefined){var selectedColor=app.colorLastSelection[
data.command]}else{selectedColor=JSDialog.getCurrentColor(data,builder);app.colorLastSelection[
data.command]=selectedColor}if(parseInt(selectedColor)===-1)selectedColor="transparent";
valueNode.style.backgroundColor=selectedColor[0
]!=="#"&&selectedColor!=="transparent"?"#"+selectedColor:selectedColor;if(
valueNode.style.backgroundColor=="#000000"||valueNode.style.backgroundColor=="rgb(0, 0, 0)"){
valueNode.style.borderColor="#6a6a6a"}else{valueNode.style.borderColor="var(--color-border)"}};
builder.map.on("commandstatechanged",function(e){if(e.commandName===data.command){updateFunction()}}
,this);updateFunction()}}return false};function findColorName(hexCode){
var color=window.app.colorNames.find(function(c){return c.hexCode.toLowerCase(
)===hexCode.toLowerCase()});return color?color.name:_("Unknown color")}
function getCurrentPaletteName(){var palette=window.prefs.get("colorPalette");if(
palette===undefined||window.app.colorPalettes[palette]===undefined){return"StandardColors"}
return palette}function toW2Palette(corePalette){var pal=[];if(!corePalette)return pal;for(
var i=0;i<corePalette.length;i++){var row=[];for(var j=0;j<corePalette[i].length;j++){row.push(
String(corePalette[i][j].Value).toUpperCase())}pal.push(row)}return pal}function sanitizePaletteRow(
row){if(row!==undefined){try{var json=JSON.parse(row);return json.filter(function(color){
return color!==null})}catch(e){console.error('Cannot parse palette row from cache: "'+row+'" :'+e)}}
return null}function generatePalette(paletteName){var colorPalette=toW2Palette(
window.app.colorPalettes[paletteName].colors);var customColorRow=sanitizePaletteRow(
window.prefs.get("customColor"));var recentRow=sanitizePaletteRow(window.prefs.get("recentColor"));
if(customColorRow)colorPalette.push(customColorRow);else colorPalette.push(["F2F2F2","F2F2F2",
"F2F2F2","F2F2F2","F2F2F2"]);if(recentRow){colorPalette.push(recentRow)}else{colorPalette.push([
"F2F2F2","F2F2F2","F2F2F2","F2F2F2","F2F2F2","F2F2F2","F2F2F2","F2F2F2"])}return colorPalette}
function createColor(parentContainer,builder,colorItem,index,themeData,widgetData,isCurrent,
themeColors){var color=window.L.DomUtil.create("input",
builder.options.cssClass+" ui-color-picker-entry",parentContainer);color.type="radio";
color.name="color";color.value=colorItem;color.style.backgroundColor="#"+colorItem;
color.setAttribute("index",index);color.innerHTML=isCurrent?"&#149;":"&#160;";if(themeData
)color.setAttribute("theme",themeData);var colorTooltip;var found=themeColors.find(function(item){
return item.Value.toLowerCase()===colorItem.toLowerCase()});if(found
)colorTooltip=found.Name;else if(window.app.colorNames)colorTooltip=findColorName(colorItem
);else colorTooltip=_("Unknown color");if(window.enableAccessibility){color.setAttribute(
"aria-label",colorTooltip)}else{color.setAttribute("data-cooltip",colorTooltip)}
color.addEventListener("click",function(event){handleColorSelection(event.target,builder,widgetData)
});color.addEventListener("keydown",function(event){if(event.code==="Enter"){handleColorSelection(
event.target,builder,widgetData)}});window.L.control.attachTooltipEventListener(color,builder.map);
return color}function handleColorSelection(target,builder,widgetData){var palette=generatePalette(
getCurrentPaletteName());var colorCode=target.getAttribute("value");
var themeData=target.getAttribute("theme");if(colorCode!=null){JSDialog.sendColorCommand(builder,
widgetData,colorCode,themeData);builder.callback("colorpicker","hidedropdown",widgetData,
themeData?themeData:colorCode,builder)}else{JSDialog.sendColorCommand(builder,widgetData,
"transparent");builder.callback("colorpicker","hidedropdown",widgetData,"transparent",builder)}
var recentRow=palette[palette.length-1];if(recentRow.indexOf(colorCode)!==-1)recentRow.splice(
recentRow.indexOf(colorCode),1);recentRow.unshift(colorCode);window.prefs.set("recentColor",
JSON.stringify(recentRow))}function createAutoColorButton(parentContainer,data,builder){
var buttonContainer=window.L.DomUtil.create("div","auto-color-button-container",parentContainer);
var hasTransparent=data.command!==".uno:FontColor"&&data.command!==".uno:Color";
var buttonText=hasTransparent?_("No fill"):_("Automatic");var autoButton=window.L.DomUtil.create(
"button",builder.options.cssClass+" ui-pushbutton auto-color-button",buttonContainer);
autoButton.id="transparent-color-button";autoButton.innerText=buttonText;autoButton.tabIndex="0";
autoButton.focus();autoButton.addEventListener("click",function(){JSDialog.sendColorCommand(builder,
data,"transparent");builder.callback("colorpicker","hidedropdown",data,"-1",builder)})}
function createPaletteSwitch(parentContainer,builder){var paletteListbox=window.L.DomUtil.create(
"div",builder.options.cssClass+" ui-listbox-container color-palette-selector",parentContainer);
var listbox=window.L.DomUtil.create("select",builder.options.cssClass+" ui-listbox",paletteListbox);
listbox.setAttribute("aria-labelledby","color-palette");listbox.setAttribute("tabindex","0");for(
var i in window.app.colorPalettes){var paletteOption=window.L.DomUtil.create("option","",listbox);
if(i===getCurrentPaletteName())paletteOption.setAttribute("selected","selected");
paletteOption.value=i;paletteOption.innerText=window.app.colorPalettes[i].name}
window.L.DomUtil.create("span",builder.options.cssClass+" ui-listbox-arrow",paletteListbox);
return listbox}function updatePalette(paletteName,data,builder,paletteContainer,customContainer,
recentContainer){var hexColor=String(JSDialog.getCurrentColor(data,builder));
var currentColor=hexColor.toUpperCase().replace("#","");var palette=generatePalette(paletteName);
var detailedPalette=window.app.colorPalettes[paletteName].colors;
var themeColors=window.app.colorPalettes["ThemeColors"].colors.flat();
paletteContainer.style.gridTemplateRows="repeat("+(palette.length-2)+", auto)";
paletteContainer.style.gridTemplateColumns="repeat("+palette[0].length+", auto)";
paletteContainer.replaceChildren();for(var i=0;i<palette.length-2;i++){for(var j=0;j<palette[i
].length;j++){var themeData=detailedPalette[i][j].Data?JSON.stringify(detailedPalette[i][j].Data
):undefined;createColor(paletteContainer,builder,palette[i][j],i+":"+j,themeData,data,
currentColor==palette[i][j],themeColors)}}customContainer.replaceChildren();
var customInput=window.L.DomUtil.create("input","",customContainer);
customInput.placeholder="#FFF000";customInput.maxlength=7;customInput.type="text";
customInput.addEventListener("change",function(){var color=customInput.value;if(color.indexOf("#"
)===0)color=color.substr(1);if(color.length!=6){customInput.value="";return}
var customColorRow=palette[palette.length-2];if(customColorRow.indexOf(color)!==-1){
customColorRow.splice(customColorRow.indexOf(color),1)}customColorRow.unshift(color.toUpperCase());
window.prefs.set("customColor",JSON.stringify(customColorRow));updatePalette(paletteName,data,
builder,paletteContainer,customContainer,recentContainer)});var customColors=palette[
palette.length-2];for(var i=0;i<customColors.length&&i<4;i++){createColor(customContainer,builder,
customColors[i],"8:"+i,undefined,data,currentColor==customColors[i],themeColors)}
recentContainer.replaceChildren();var recentColors=palette[palette.length-1];for(
var i=0;i<recentColors.length&&i<8;i++){createColor(recentContainer,builder,recentColors[i],"9:"+i,
undefined,data,currentColor==recentColors[i],themeColors)}}JSDialog.colorPicker=function(
parentContainer,data,builder){var container=window.L.DomUtil.create("div","ui-color-picker",
parentContainer);container.id=data.id;container.tabIndex="-1";createAutoColorButton(container,data,
builder);var listbox=createPaletteSwitch(container,builder);
var paletteContainer=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-color-picker-palette",container);
var customContainer=window.L.DomUtil.createWithId("div","ui-color-picker-custom",container);
var recentLabel=window.L.DomUtil.create("label","",container);recentLabel.innerText=_("Recent");
recentLabel.htmlFor="ui-color-picker-recent";var recentContainer=window.L.DomUtil.createWithId("div"
,"ui-color-picker-recent",container);updatePalette(getCurrentPaletteName(),data,builder,
paletteContainer,customContainer,recentContainer);listbox.addEventListener("change",function(){
var newPaletteName=listbox.value;window.prefs.set("colorPalette",newPaletteName);updatePalette(
newPaletteName,data,builder,paletteContainer,customContainer,recentContainer)});
JSDialog.MakeFocusCycle(container);return false};function createPageMarginEntryWidget(data,builder){
var inchesToHMM=function(inches){return Math.round(inches*25.4*100)};var options=data.options;
var container=document.createElement("div");var map=builder.map;var isCalc=map._docLayer.isCalc();
container.className="margins-popup-container";container.setAttribute("role","listbox");
container.setAttribute("aria-label",_("Page margin options"));var onMarginClick=function(evt){
var elm=evt.currentTarget;var key=elm.id;if(!key||!options[key])return;var opt=options[key];if(
map.getDocType()==="spreadsheet"){var cmd=".uno:CalcPageMargin"+(
"?Page.LeftMargin:long="+inchesToHMM(opt.details.Left))+("&Page.RightMargin="+inchesToHMM(
opt.details.Right))+("&Page.TopMargin:long="+inchesToHMM(opt.details.Top))+(
"&Page.BottomMargin="+inchesToHMM(opt.details.Bottom));map.sendUnoCommand(cmd)}else if(
map.getDocType()==="text"){var cmdLR=".uno:PageLRMargin"+("?Page.Left:long="+inchesToHMM(
opt.details.Left))+("&Page.Right:long="+inchesToHMM(opt.details.Right));
var cmdUL=".uno:PageULMargin"+("?Page.Upper:long="+inchesToHMM(opt.details.Top))+(
"&Page.Lower:long="+inchesToHMM(opt.details.Bottom));map.sendUnoCommand(cmdLR);map.sendUnoCommand(
cmdUL)}builder.callback("dialog","close",{id:data.id},null)};Object.keys(options).forEach(function(
key){var opt=options[key];var item=document.createElement("div");item.className="margin-item";
item.id=key;item.setAttribute("role","option");item.setAttribute("tabindex","0");item.setAttribute(
"aria-selected","false");item.addEventListener("click",onMarginClick);
var img=document.createElement("img");img.className="margin-icon";img.setAttribute("alt","");
var iconName=app.LOUtil.getIconNameOfCommand(opt.icon,true);app.LOUtil.setImage(img,iconName,app.map
);var textWrap=document.createElement("div");textWrap.className="margin-text-content";
var title=document.createElement("div");title.className="margin-title";title.textContent=opt.title;
var values=document.createElement("div");values.className="margin-values";
var col1=document.createElement("div");col1.className="margin-col";
var topSpan=document.createElement("span");topSpan.textContent=_("Top: {top}").replace("{top}",
opt.details.Top+'"');var leftSpan=document.createElement("span");leftSpan.textContent=_(
"Left: {left}").replace("{left}",opt.details.Left+'"');col1.appendChild(topSpan);col1.appendChild(
leftSpan);var col2=document.createElement("div");col2.className="margin-col";
var bottomSpan=document.createElement("span");bottomSpan.textContent=_("Bottom: {bottom}").replace(
"{bottom}",opt.details.Bottom+'"');var rightSpan=document.createElement("span");
rightSpan.textContent=_("Right: {right}").replace("{right}",opt.details.Right+'"');col2.appendChild(
bottomSpan);col2.appendChild(rightSpan);values.appendChild(col1);values.appendChild(col2);
textWrap.appendChild(title);textWrap.appendChild(values);item.appendChild(img);item.appendChild(
textWrap);container.appendChild(item)});var hr=document.createElement("hr");
hr.className="jsdialog ui-separator horizontal";container.appendChild(hr);
var custom=document.createElement("div");custom.className="margin-item custom-margins-link";
custom.id="customMarginsLink";custom.textContent=_("Custom Margins…");custom.setAttribute("role",
"button");custom.setAttribute("tabindex","0");custom.addEventListener("click",function(evt){
map.sendUnoCommand(isCalc?".uno:PageFormatDialog":".uno:PageDialog");builder.callback("dialog",
"close",{id:data.id},null)});container.appendChild(custom);return container}
JSDialog.pageMarginEntry=function(parentContainer,data,builder){
var element=createPageMarginEntryWidget(data,builder);parentContainer.appendChild(element);
return false};function createPageSizeEntryWidget(data,builder){var sizes=data.options||[];
var container=document.createElement("div");container.className="jsdialog ui-grid";
var list=document.createElement("div");list.className="jsdialog pagesize-list";
container.appendChild(list);var map=builder.map;sizes.forEach(function(opt){
var item=document.createElement("div");item.className="ui-combobox-entry jsdialog ui-grid-cell";
item.id=opt.id;item.addEventListener("click",function(evt){map.sendUnoCommand(opt.uno);
builder.callback("dialog","close",{id:data.id},null)});var text=document.createElement("span");
text.textContent=opt.text;item.appendChild(text);list.appendChild(item)});
var hr=document.createElement("hr");hr.className="jsdialog ui-separator horizontal";
container.appendChild(hr);var moreSizeContainer=document.createElement("div");
moreSizeContainer.className="ui-combobox-entry jsdialog ui-grid-cell";
moreSizeContainer.id="page-size-more";moreSizeContainer.addEventListener("click",function(evt){
map.sendUnoCommand(".uno:PageFormatDialog");builder.callback("dialog","close",{id:data.id},null)});
var text=document.createElement("span");text.textContent=_("More Paper Sizes...");
moreSizeContainer.appendChild(text);container.appendChild(moreSizeContainer);return container}
JSDialog.pageSizeEntry=function(parentContainer,data,builder){var element=createPageSizeEntryWidget(
data,builder);parentContainer.appendChild(element);return false};JSDialog.comboboxEntry=function(
parentContainer,data,builder){var entry=window.L.DomUtil.create("div",
"ui-combobox-entry "+builder.options.cssClass,parentContainer);entry.id=data.id;entry.setAttribute(
"role","option");if(data.hasSubMenu)window.L.DomUtil.addClass(entry,"ui-has-menu");if(data.w2icon){
window.L.DomUtil.create("div","w2ui-icon ui-combobox-icon "+data.w2icon,entry)}if(data.icon){
var icon=window.L.DomUtil.create("img","ui-combobox-icon",entry);icon.alt="";
builder._isStringCloseToURL(data.icon)?icon.src=data.icon:app.LOUtil.setImage(icon,
app.LOUtil.getIconNameOfCommand(data.icon),builder.map)}if(data.hint){entry.title=data.hint}
var content=window.L.DomUtil.create("span","",entry);content.innerText=data.text;if(data.selected){
entry.setAttribute("aria-selected","true");window.L.DomUtil.addClass(entry,"selected")}if(
data.checked)window.L.DomUtil.addClass(entry,"checked");else if(data.checked!==undefined
)window.L.DomUtil.addClass(entry,"notchecked");if(data.customRenderer)JSDialog.OnDemandRenderer(
builder,data.comboboxId,"combobox",data.pos,content,entry,data.text);
var entryData=data.pos+";"+data.text;var clickFunction=function(){builder.callback("combobox",
"selected",{id:data.comboboxId},entryData,builder)};entry.addEventListener("click",clickFunction);
entry.addEventListener("keypress",function(event){if(event.key==="Enter"||event.key===" "){
clickFunction();event.preventDefault()}});if(data.hasSubMenu){entry.setAttribute("aria-haspopup",
true);entry.setAttribute("aria-expanded",false);entry._onDropDown=function(open){entry.setAttribute(
"aria-expanded",open)};entry.addEventListener("mouseover",function(){builder.callback("combobox",
"showsubmenu",{id:data.comboboxId},entryData,builder)})}return false};
JSDialog.mobileComboboxEntry=function(parentContainer,data,builder){
var comboboxEntry=window.L.DomUtil.create("p",builder.options.cssClass,parentContainer);
comboboxEntry.textContent=builder._cleanText(data.text);comboboxEntry.parent=data.parent;if(
data.style&&data.style.length)window.L.DomUtil.addClass(comboboxEntry,data.style);
comboboxEntry.addEventListener("click",function(){builder.refreshSidebar=true;if(builder.wizard
)builder.wizard.goLevelUp();builder.callback("combobox","selected",comboboxEntry.parent,
data.pos+";"+comboboxEntry.textContent,builder)});return false};JSDialog.mobileCombobox=function(
parentContainer,data,builder){var container=window.L.DomUtil.create("div",
"ui-explorable-entry level-"+builder._currentDepth+" "+builder.options.cssClass+" ui-widget",
parentContainer);if(data&&data.id)container.id=data.id;var sectionTitle=window.L.DomUtil.create(
"div","ui-header level-"+builder._currentDepth+" "+builder.options.cssClass+" ui-widget",container);
$(sectionTitle).css("justify-content","space-between");var leftDiv=window.L.DomUtil.create("div",
"ui-header-left combobox",sectionTitle);var editCallback=function(value){builder.callback("combobox"
,"change",data,value,builder)};builder._controlHandlers["edit"](leftDiv,data,builder,editCallback);
var rightDiv=window.L.DomUtil.create("div","ui-header-right",sectionTitle);
var arrowSpan=window.L.DomUtil.create("span","sub-menu-arrow",rightDiv);arrowSpan.textContent=">";
var contentDiv=window.L.DomUtil.create("div",
"ui-content level-"+builder._currentDepth+" "+builder.options.cssClass,container);
contentDiv.title=data.text;var entries=[];if(data.entries){for(var index in data.entries){
var style="ui-combobox-text";if(data.selectedEntries&&index==data.selectedEntries[0]||data.entries[
index]==data.text){style+=" selected"}var entry={type:"comboboxentry",text:data.entries[index],
pos:index,parent:data,style:style};entries.push(entry)}}var contentNode={type:"container",
children:entries};builder._currentDepth++;builder.build(contentDiv,[contentNode]);
builder._currentDepth--;if(!data.nosubmenu){$(contentDiv).hide();if(builder.wizard){$(container
).click(function(event,data){builder.wizard.goLevelDown(container,data);if(
contentNode&&contentNode.onshow)contentNode.onshow()})}else{window.app.console.debug(
"Builder used outside of mobile wizard: please implement the click handler")}}else $(container
).hide();container.onSelect=function(pos){console.error("Not implemented: select entry: "+pos)};
container.onSetText=function(text){console.error("Not implemented: setText: "+text)}};
function _extractPos(selectCommandData){return selectCommandData.substr(0,selectCommandData.indexOf(
";"))}function _extractText(selectCommandData){return selectCommandData.substr(
selectCommandData.indexOf(";")+1)}JSDialog.combobox=function(parentContainer,data,builder){
var container=window.L.DomUtil.create("div","ui-combobox "+builder.options.cssClass,parentContainer)
container.id=data.id;var content=window.L.DomUtil.create("input",
"ui-combobox-content "+builder.options.cssClass,container);
content.id=data.id+"-input-"+builder.options.suffix;content.value=data.text;content.role="combobox";
content.setAttribute("autocomplete","off");if(data.aria){content.setAttribute("aria-label",
data.aria.label)}var dropDownId=JSDialog.CreateDropdownEntriesId(data.id);content.setAttribute(
"aria-haspopup",true);content.setAttribute("aria-expanded",false);content.setAttribute(
"aria-controls",dropDownId);var button=window.L.DomUtil.create("button",
"ui-combobox-button "+builder.options.cssClass,container);button.setAttribute("aria-haspopup",true);
button.setAttribute("aria-expanded",false);button.setAttribute("aria-controls",dropDownId);if(
data.aria)button.setAttribute("aria-label",_("Open ")+data.aria.label+_(" list"));
var arrow=window.L.DomUtil.create("span",builder.options.cssClass+" ui-listbox-arrow",button);
arrow.id="listbox-arrow-"+data.id;container._onDropDown=function(open){content.setAttribute(
"aria-expanded",open);button.setAttribute("aria-expanded",open)};if(data.selectedCount>0
)var selectedEntryPos=parseInt(data.selectedEntries[0]);var entries=[];for(var i in data.entries){
entries.push({text:data.entries[i].toString(),selected:parseInt(i)===selectedEntryPos,
customRenderer:data.customEntryRenderer})}var resetSelection=function(){for(var i in entries){
entries[i].selected=false}};if(data.enabled===false){container.disabled=true;content.disabled=true}
JSDialog.SynchronizeDisabledState(container,[content]);container.addEventListener("click",function(
){content.focus()});content.addEventListener("keyup",function(event){
const shouldTriggerChange=data.changeOnEnterOnly?event.key==="Enter":true;if(shouldTriggerChange){
builder.callback("combobox","change",data,this.value,builder);if(
data.focusMapOnEnter&&event.key==="Enter"){builder.map.focus()}}resetSelection();for(
var i in entries){if(entries[i]==this.value||entries[i].text==this.value){entries[i].selected=true;
break}}if(event.key==="ArrowDown"&&builder.map.jsdialog.hasDropdownOpened()){
const comboboxEntries=JSDialog.GetDropdown(data.id);
const selectedElement=comboboxEntries.querySelector(".selected");if(selectedElement){
selectedElement.focus();return}}});var comboboxId=data.id;var clickFunction=function(){if(
container.hasAttribute("disabled"))return;var parentBuilder=builder;var callback=function(objectType
,eventType,object,data){if(eventType!=="close")parentBuilder.callback(objectType,eventType,object,
data,parentBuilder);if(eventType==="selected"){container.onSelect(_extractPos(data));
container.onSetText(_extractText(data));JSDialog.CloseDropdown(comboboxId)}return true};
JSDialog.OpenDropdown(data.id,container,entries,callback)};button.addEventListener("click",
clickFunction);button.addEventListener("keypress",function(event){if(
event.key==="Enter"||event.key===" ")clickFunction()});container.updateRenders=function(pos){
var dropdownRoot=JSDialog.GetDropdown(data.id);if(!dropdownRoot)return;
var dropdown=dropdownRoot.querySelectorAll(".ui-combobox-entry");if(dropdown[pos]){dropdown[pos
].replaceChildren();var img=window.L.DomUtil.create("img","",dropdown[pos]);
img.src=builder.rendersCache[data.id].images[pos];img.alt=entries[pos].text;img.title=entries[pos
].text}};container.onSelect=function(pos){resetSelection();if(pos>=0&&entries[pos])entries[pos
].selected=true;else if(!entries[pos])console.warn(
'Cannot find entry with pos: "'+pos+'" in "'+data.id+'"')};container.onSetText=function(text){if(
document.activeElement===content)return;content.value=text};return false};function _getGridChild(
children,row,col){for(var index in children){if(parseInt(children[index].top)==row&&parseInt(
children[index].left)==col)return children[index]}return null}JSDialog.container=function(
parentContainer,data,builder){if(data.cols&&data.rows)return JSDialog.grid(parentContainer,data,
builder);if(parentContainer&&!parentContainer.id)parentContainer.id=data.id;return true};
JSDialog.grid=function(parentContainer,data,builder){var rows=builder._getGridRows(data.children);
var cols=builder._getGridColumns(data.children);var processedChildren=[];
var isSingleChild=data.children&&data.children.length===1;var table=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-grid"+(isSingleChild?" single-child-grid":""),parentContainer);
table.id=data.id;if(data.allyRole){table.role=data.allyRole}
var gridRowColStyle="grid-template-rows: repeat("+rows+", auto); \t\tgrid-template-columns: repeat("+cols+", auto);"
table.style=gridRowColStyle;for(var row=0;row<rows;row++){var prevChild=null;for(
var col=0;col<cols;col++){var child=_getGridChild(data.children,row,col);
var isMergedCell=prevChild&&prevChild.width&&parseInt(prevChild.left)+parseInt(prevChild.width)>col;
if(child){if(!child.id||child.id==="")child.id=table.id+"-cell-"+row+"-"+col;
var sandbox=window.L.DomUtil.create("div");builder.build(sandbox,[child],false);
var control=sandbox.firstChild;if(control){window.L.DomUtil.addClass(control,"ui-grid-cell");
table.appendChild(control)}processedChildren.push(child);prevChild=child}else if(!isMergedCell){
window.L.DomUtil.create("div","ui-grid-cell",table)}}}for(var i=0;i<(data.children||[]).length;i++){
var child=data.children[i];if(processedChildren.indexOf(child)===-1){
var sandbox=window.L.DomUtil.create("div");builder.build(sandbox,[child],false);
var control=sandbox.firstChild;if(control){window.L.DomUtil.addClass(control,"ui-grid-cell");
table.appendChild(control)}processedChildren.push(child)}}return false};JSDialog.toolbox=function(
parentContainer,data,builder){
var levelClass=builder._currentDepth!==undefined?" level-"+builder._currentDepth:"";
var toolbox=window.L.DomUtil.create("div",builder.options.cssClass+" horizontal toolbox"+levelClass,
parentContainer);toolbox.id=data.id;if(data.enabled===false){toolbox.disabled=true;for(
var index in data.children){data.children[index].enabled=false}}var enabledCallback=function(enable
){for(var j in data.children){var childId=data.children[j].id;
var toolboxChild=toolbox.querySelector("#"+childId);if(!toolboxChild)continue;if(enable){
toolboxChild.removeAttribute("disabled");toolboxChild.classList.remove("disabled")}else{
toolboxChild.disabled=true;toolboxChild.classList.add("disabled")}}};JSDialog.OnStateChange(toolbox,
enabledCallback);var noLabels=builder.options.noLabelsForUnoButtons;
builder.options.noLabelsForUnoButtons=true;
var inlineLabels=builder.options.useInLineLabelsForUnoButtons;if(
data.hasVerticalParent===true&&data.children.length===1
)builder.options.useInLineLabelsForUnoButtons=true;builder.build(toolbox,data.children,false);
builder.options.useInLineLabelsForUnoButtons=inlineLabels;
builder.options.noLabelsForUnoButtons=noLabels;return false};JSDialog.spacer=function(
parentContainer,data,builder){var spacer=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-spacer",parentContainer);spacer.id=data.id;return false};
JSDialog.Dropdown=function(parentContainer,data,builder){builder.build(parentContainer,data.children
,data.vertical===true);if(data.gridKeyboardNavigation){JSDialog.KeyboardGridNavigation(
parentContainer)}else{JSDialog.KeyboardListNavigation(parentContainer)}return false};
function _drawingAreaControl(parentContainer,data,builder){var container=window.L.DomUtil.create(
"div",builder.options.cssClass+" ui-drawing-area-container",parentContainer);container.id=data.id;
if(!data.image)return;var image=window.L.DomUtil.create("img",
builder.options.cssClass+" ui-drawing-area",container);var imageId=data.id+"-img";image.id=imageId;
image.src=data.image.replace(/\\/g,"");image.alt=data.text;image.tabIndex=0;image.draggable=false;
image.ondragstart=function(){return false};if(data.text){image.setAttribute("data-cooltip",data.text
);if(builder.map){window.L.control.attachTooltipEventListener(image,builder.map)}}else if(
data.aria&&data.aria.label){image.setAttribute("aria-label",data.aria.label)}if(
JSDialog.isWidgetInModalPopup(data)&&image.width==0&&image.height==0){image.width=data.imagewidth;
image.height=data.imageheight}if(data.loading&&data.loading==="true"){
var loaderContainer=window.L.DomUtil.create("div","ui-drawing-area-loader-container",container);
window.L.DomUtil.create("div","ui-drawing-area-loader",loaderContainer)}if(
data.placeholderText&&data.placeholderText==="true"){var spanContainer=window.L.DomUtil.create("div"
,"ui-drawing-area-placeholder-container",container);var span=window.L.DomUtil.create("span",
"ui-drawing-area-placeholder",spanContainer);span.innerText=data.text}
var getCoordinatesFromEvent=function(e){var imageElement=document.getElementById(imageId);var ret=[0
,0];if(e.offsetX){ret[0]=e.offsetX;ret[1]=e.offsetY}else if(
e.changedTouches&&e.changedTouches.length){ret[0]=e.changedTouches[e.changedTouches.length-1
].pageX-$(imageElement).offset().left;ret[1]=e.changedTouches[e.changedTouches.length-1].pageY-$(
imageElement).offset().top}ret[0]=ret[0]/imageElement.offsetWidth;ret[1]=ret[1
]/imageElement.offsetHeight;return ret};var moveTimer=null;var moveFunc=null;window.L.DomEvent.on(
image,"dblclick",function(e){var pos=getCoordinatesFromEvent(e);var coordinates=pos[0]+";"+pos[1];
clearTimeout(moveTimer);moveTimer=null;moveFunc=null;builder.callback("drawingarea","dblclick",
container,coordinates,builder)},this);window.L.DomEvent.on(image,"click touchend",function(e){
var pos=getCoordinatesFromEvent(e);var coordinates=pos[0]+";"+pos[1];clearTimeout(moveTimer);
moveTimer=null;moveFunc=null;builder.callback("drawingarea","click",container,coordinates,builder)},
this);var onMove=function(e){if(moveTimer&&moveFunc){clearTimeout(moveTimer);moveTimer=null;
moveFunc();moveFunc=null}var pos=getCoordinatesFromEvent(e);var coordinates=pos[0]+";"+pos[1];
builder.callback("drawingarea","mousemove",container,coordinates,builder)};var endMove=function(e){
clearTimeout(moveTimer);moveTimer=null;moveFunc=null;window.removeEventListener("mousemove",onMove);
window.removeEventListener("mouseup",endMove);var pos=getCoordinatesFromEvent(e);
var coordinates=pos[0]+";"+pos[1];builder.callback("drawingarea","mouseup",container,coordinates,
builder)};image.addEventListener("mousedown",function(e){moveFunc=function(){
var pos=getCoordinatesFromEvent(e);var coordinates=pos[0]+";"+pos[1];builder.callback("drawingarea",
"mousedown",container,coordinates,builder)};moveTimer=setTimeout(function(){moveFunc();moveFunc=null
moveTimer=null},200);window.addEventListener("mousemove",onMove);window.addEventListener("mouseup",
endMove)});var modifier=0;image.addEventListener("keydown",function(event){if(event.key==="Enter"){
builder.callback("drawingarea","keypress",container,UNOKey.RETURN|modifier,builder);
event.preventDefault()}else if(event.key==="Escape"||event.key==="Esc"){builder.callback(
"drawingarea","keypress",container,UNOKey.ESCAPE|modifier,builder);event.preventDefault()}else if(
event.key==="Left"||event.key==="ArrowLeft"){builder.callback("drawingarea","keypress",container,
UNOKey.LEFT|modifier,builder);event.preventDefault()}else if(
event.key==="Right"||event.key==="ArrowRight"){builder.callback("drawingarea","keypress",container,
UNOKey.RIGHT|modifier,builder);event.preventDefault()}else if(
event.key==="Up"||event.key==="ArrowUp"){builder.callback("drawingarea","keypress",container,
UNOKey.UP|modifier,builder);event.preventDefault()}else if(
event.key==="Down"||event.key==="ArrowDown"){builder.callback("drawingarea","keypress",container,
UNOKey.DOWN|modifier,builder);event.preventDefault()}else if(event.key==="Home"){builder.callback(
"drawingarea","keypress",container,UNOKey.HOME|modifier,builder);event.preventDefault()}else if(
event.key==="End"){builder.callback("drawingarea","keypress",container,UNOKey.END|modifier,builder);
event.preventDefault()}else if(event.key==="Backspace"){builder.callback("drawingarea","keypress",
container,UNOKey.BACKSPACE|modifier,builder);event.preventDefault()}else if(event.key==="Delete"){
builder.callback("drawingarea","keypress",container,UNOKey.DELETE|modifier,builder);
event.preventDefault()}else if(event.key==="Space"){builder.callback("drawingarea","keypress",
container,UNOKey.SPACE|modifier,builder);event.preventDefault()}else if(event.key==="Tab"){
builder.callback("drawingarea","keypress",container,UNOKey.TAB|modifier,builder)}else if(
event.key==="Shift"){modifier=modifier|UNOModifier.SHIFT;event.preventDefault()}else if(
event.key==="Control"){modifier=modifier|UNOModifier.CTRL;event.preventDefault()}else if(
event.key==="a"&&event.ctrlKey){builder.callback("drawingarea","keypress",container,
UNOKey.A|UNOModifier.CTRL,builder)}});image.addEventListener("keyup",function(event){if(
event.key==="Shift"){modifier=modifier&~UNOModifier.SHIFT;event.preventDefault()}else if(
event.key==="Control"){modifier=modifier&~UNOModifier.CTRL;event.preventDefault()}});
image.addEventListener("blur",function(){modifier=0});image.addEventListener("keypress",function(
event){if(
event.key==="Enter"||event.key==="Escape"||event.key==="Esc"||event.key==="Left"||event.key==="ArrowLeft"||event.key==="Right"||event.key==="ArrowRight"||event.key==="Up"||event.key==="ArrowUp"||event.key==="Down"||event.key==="ArrowDown"||event.key==="Home"||event.key==="End"||event.key==="Backspace"||event.key==="Delete"||event.key==="Space"||event.key==="Tab"
){}else{var keyCode=event.keyCode;if(event.ctrlKey){keyCode=event.key.toUpperCase().charCodeAt(0);
keyCode=builder.map.keyboard._toUNOKeyCode(keyCode);keyCode|=UNOModifier.CTRL}builder.callback(
"drawingarea","keypress",container,keyCode,builder)}event.preventDefault()});return false}
JSDialog.drawingArea=function(parentContainer,data,builder){var buildInnerData=_drawingAreaControl(
parentContainer,data,builder);return buildInnerData};var EditWidget=function(){function EditWidget(
parentContainer,data,builder,callback){this.parentContainer=parentContainer;this.data=data;
this.builder=builder;this.callback=callback}EditWidget.buildImpl=function(parentContainer,data,
builder){var result={container:null,input:null};var container=window.L.DomUtil.create("div",
"ui-edit-container "+builder.options.cssClass,parentContainer);container.id=data.id;
result.container=container;var edit=window.L.DomUtil.create("input",
"ui-edit "+builder.options.cssClass,container);edit.value=data.text;edit.id=data.id+"-input";
edit.dir="auto";edit.setAttribute("autocomplete","off");result.input=edit;if(data.password===true
)edit.type="password";if(data.enabled===false){container.setAttribute("disabled","true");
edit.disabled=true}JSDialog.SynchronizeDisabledState(container,[edit]);if(data.hidden)$(edit).hide()
if(data.placeholder){edit.setAttribute("placeholder",data.placeholder);edit.setAttribute(
"aria-label",data.placeholder)}return result};EditWidget.prototype.onKeyUp=function(e){
var callbackToUse=e.key==="Enter"&&this.data.changedCallback?this.data.changedCallback:null;if(
this.callback)callbackToUse=this.callback;if(typeof callbackToUse==="function")callbackToUse(
this.edit.input.value);else{var eventType="change";if(e.key==="Enter")eventType="activate";
this.builder.callback("edit",eventType,this.edit.container,this.edit.input.value,this.builder)}};
EditWidget.prototype.onClick=function(e){e.stopPropagation()};
EditWidget.prototype.setupEventListeners=function(){this.edit.input.addEventListener("keyup",
this.onKeyUp.bind(this));this.edit.input.addEventListener("click",this.onClick.bind(this))};
EditWidget.prototype.build=function(){this.edit=EditWidget.buildImpl(this.parentContainer,this.data,
this.builder);this.setupEventListeners();return false};return EditWidget}();JSDialog.edit=function(
parentContainer,data,builder,callback){var widget=new EditWidget(parentContainer,data,builder,
callback);return widget.build()};var scrollToCursorTimeout=null;var startHandle;var endHandle;
function _sendSelection(edit,builder,id){if(document.activeElement!=edit)return;
var selection=document.getSelection();var startPos=0;var anchorOffset=selection.anchorOffset;
var endPos=0;var focusOffset=selection.focusOffset;var startPara=0;var endPara=0;
var startElement=selection.anchorNode;var endElement=selection.focusNode;if(
selection.anchorNode==edit){startPos=endPos=0;for(var i in edit.childNodes){if(
i==selection.anchorOffset)break;if(edit.childNodes[i].tagName=="BR"){startPara++;endPara++}}}else{
for(var i in edit.childNodes){if(edit.childNodes[i]!=startElement&&edit.childNodes[i
].firstChild!=startElement){if(edit.childNodes[i].tagName=="BR"){startPara++;startPos=0}else{
startPos++}}else{break}}for(var i in edit.childNodes){if(edit.childNodes[i
]!=endElement&&edit.childNodes[i].firstChild!=endElement){if(edit.childNodes[i].tagName=="BR"){
endPara++;endPos=0}else{endPos++}}else{break}}}var selection=startPos+anchorOffset+";"+(
endPos+focusOffset)+";"+startPara+";"+endPara;builder.callback("edit","textselection",{id:id},
selection,builder)}function _appendText(cursorLayer,text,style){var span=window.L.DomUtil.create(
"span",style);span.innerText=text;cursorLayer.appendChild(span);return span}function _appendNewLine(
cursorLayer){cursorLayer.appendChild(window.L.DomUtil.create("br",""))}function _appendCursor(
cursorLayer){var cursor=window.L.DomUtil.create("span","cursor");cursorLayer.appendChild(cursor);
return cursor}function _onSelectionHandleDragEnd(start,builder,container,wrapper,cursorLayer,
handleLayer,textLayer,text,startX,endX,startY,endY){const resetSelection=()=>{_setSelection(builder,
container,wrapper,cursorLayer,handleLayer,textLayer,text,startX,endX,startY,endY)};return point=>{
const cursorLayerPosition=cursorLayer.getBoundingClientRect();
const newY=cursorLayerPosition.top+point.y-1;let newX;if(start){
newX=cursorLayerPosition.left+point.x+startHandle.width}else{newX=cursorLayerPosition.left+point.x}
let node;if(document.caretPositionFromPoint){const position=document.caretPositionFromPoint(newX,
newY);if(!position){resetSelection();return}node=position.offsetNode}else{
const range=document.caretRangeFromPoint(newX,newY);if(!range){resetSelection();return}
node=range.startContainer}if(!textLayer.contains(node)||textLayer===node){resetSelection();return}
if(node instanceof Text){node=node.parentElement}let newCharX=0;let newCharY=0;for(
const child of textLayer.children){if(child===node&&start){break}if(child.tagName==="BR"){newCharX=0
newCharY++}else{newCharX++}if(child===node){break}}let selection;if(start){_setSelection(builder,
container,wrapper,cursorLayer,handleLayer,textLayer,text,newCharX,endX,newCharY,endY);
selection=`${newCharX};${endX};${newCharY};${endY}`}else{_setSelection(builder,container,wrapper,
cursorLayer,handleLayer,textLayer,text,startX,newCharX,startY,newCharY);
selection=`${startX};${newCharX};${startY};${newCharY}`}builder.callback("edit","textselection",{
id:container.id},selection,builder)}}function _setSelection(builder,container,wrapper,cursorLayer,
handleLayer,textLayer,text,startX,endX,startY,endY){
var newCursorLayer=document.createDocumentFragment();var reversedSelection=false;if(
endY==startY&&endX<startX){reversedSelection=true;var tmp=startX;startX=endX;endX=tmp}if(endY<startY
){reversedSelection=true;var tmp=startY;startY=endY;endY=tmp;tmp=startX;startX=endX;endX=tmp}
let selectionTexts=[];for(var i in text){var line=text[i];if(i<startY){_appendText(newCursorLayer,
line,"");_appendNewLine(newCursorLayer)}else if(i==startY){_appendText(newCursorLayer,line.substr(0,
startX),"");if(reversedSelection)var cursor=_appendCursor(newCursorLayer);selectionTexts.push(
_appendText(newCursorLayer,line.substr(startX,startY==endY?endX-startX:undefined),
startX!=endX||startY!=endY?"selection":""));if(startY==endY){if(!reversedSelection
)cursor=_appendCursor(newCursorLayer);_appendText(newCursorLayer,line.substr(endX),"");
_appendNewLine(newCursorLayer)}else _appendNewLine(newCursorLayer)}else if(i>startY&&i<endY){
selectionTexts.push(_appendText(newCursorLayer,line,"selection"));_appendNewLine(newCursorLayer)
}else if(i==endY&&endY!=startY){selectionTexts.push(_appendText(newCursorLayer,line.substr(0,endX),
"selection"));if(!reversedSelection)cursor=_appendCursor(newCursorLayer);_appendText(newCursorLayer,
line.substr(endX),"");_appendNewLine(newCursorLayer)}else if(i>endY){_appendText(newCursorLayer,line
,"");_appendNewLine(newCursorLayer)}}cursorLayer.textContent="";cursorLayer.appendChild(
newCursorLayer);if(cursor){if(scrollToCursorTimeout)clearTimeout(scrollToCursorTimeout);
scrollToCursorTimeout=setTimeout(function(){var blockOption=JSDialog.ScrollIntoViewBlockOption(
"nearest");cursor.scrollIntoView({behavior:"smooth",block:blockOption,inline:"nearest"});
scrollToCursorTimeout=null},0)}if(!handleLayer){return}if(startX===endX&&startY===endY){if(
startHandle)startHandle.requestVisible(false);if(endHandle)endHandle.requestVisible(false);return}
if(!startHandle){startHandle=new FormulaBarSelectionHandle(wrapper,handleLayer,"start")}
const selectionPositions=selectionTexts.flatMap(selectionText=>Array.from(
selectionText.getClientRects()));const selectionStartPosition=selectionPositions[0];
const selectionEndPosition=selectionPositions[selectionPositions.length-1];
const cursorLayerPosition=cursorLayer.getBoundingClientRect();startHandle.setPosition(
new cool.SimplePoint(selectionStartPosition.left-cursorLayerPosition.left,
selectionStartPosition.bottom-cursorLayerPosition.top));startHandle.requestVisible(true);
startHandle.onDragEnd=_onSelectionHandleDragEnd(true,builder,container,wrapper,cursorLayer,
handleLayer,textLayer,text,startX,endX,startY,endY);if(!endHandle){
endHandle=new FormulaBarSelectionHandle(wrapper,handleLayer,"end")}endHandle.setPosition(
new cool.SimplePoint(selectionEndPosition.right-cursorLayerPosition.left,
selectionEndPosition.bottom-cursorLayerPosition.top));endHandle.requestVisible(true);
endHandle.onDragEnd=_onSelectionHandleDragEnd(false,builder,container,wrapper,cursorLayer,
handleLayer,textLayer,text,startX,endX,startY,endY)}function _formulabarEditControl(parentContainer,
data,builder){var container=window.L.DomUtil.create("div",
"ui-custom-textarea "+builder.options.cssClass,parentContainer);var wrapper=window.L.DomUtil.create(
"div","ui-custom-textarea-overflow-wrapper "+builder.options.cssClass,container);
container.id=data.id;var textLayer=window.L.DomUtil.create("div",
"ui-custom-textarea-text-layer "+builder.options.cssClass,wrapper);if(data.enabled!==false
)textLayer.setAttribute("contenteditable","true");var cursorLayer=window.L.DomUtil.create("div",
"ui-custom-textarea-cursor-layer "+builder.options.cssClass,wrapper);
var handleLayer=window.L.DomUtil.create("div",
"ui-custom-textarea-handle-layer "+builder.options.cssClass,wrapper);wrapper.addEventListener(
"scroll",()=>{requestAnimationFrame(()=>{handleLayer.style.top=`${-wrapper.scrollTop}px`})});
container.setText=function(text,selection){var newTextLayer=document.createDocumentFragment();for(
var c=0;c<text.length;c++){if(text[c]=="\n")_appendNewLine(newTextLayer);else _appendText(
newTextLayer,text[c],"")}textLayer.textContent="";textLayer.appendChild(newTextLayer);
var startX=parseInt(selection[0]);var endX=parseInt(selection[1]);var startY=parseInt(selection[2]);
var endY=parseInt(selection[3]);text=text.split("\n");_setSelection(builder,container,wrapper,
cursorLayer,handleLayer,textLayer,text,startX,endX,startY,endY)};container.enable=function(){
window.L.DomUtil.removeClass(container,"disabled");textLayer.setAttribute("contenteditable","true")}
container.disable=function(){window.L.DomUtil.addClass(container,"disabled");textLayer.setAttribute(
"contenteditable","false")};var textSelectionHandler=function(event){if(window.L.DomUtil.hasClass(
container,"disabled")){event.preventDefault();return}builder.callback("edit","grab_focus",container,
null,builder);_sendSelection(textLayer,builder,container.id);builder.map.setWinId(0);
builder.map._textInput._emptyArea();builder.map._textInput.focus(true);event.preventDefault()};[
"click","dblclick","contextmenu"].forEach(function(ev){textLayer.addEventListener(ev,
textSelectionHandler)});textLayer.addEventListener("mousedown",function(){
textLayer.addEventListener("mouseup",textSelectionHandler,{once:true});builder.callback("edit",
"grab_focus",container,null,builder);cursorLayer.querySelectorAll(".selection").forEach(function(
element){window.L.DomUtil.addClass(element,"hidden")});var cursor=cursorLayer.querySelector(
".cursor");if(cursor)window.L.DomUtil.addClass(cursor,"hidden")});var text=builder._cleanText(
data.text);container.setText(text,[0,0,0,0]);if(data.enabled===false)window.L.DomUtil.addClass(
container,"disabled");if(data.hidden)window.L.DomUtil.addClass(container,"hidden");return false}
JSDialog.formulabarEdit=function(parentContainer,data,builder){
var buildInnerData=_formulabarEditControl(parentContainer,data,builder);return buildInnerData};
function _extractLabelText(data){if(data.type==="fixedtext"&&data.text!==undefined){return data.text
}for(var i=0;i<data.children.length;i++){var label=_extractLabelText(data.children[i]);if(label
)return label}return""}JSDialog.frame=function _frameHandler(parentContainer,data,builder){if(
data.children.length>1){buildFrame(parentContainer,data,builder,isFormControlGroup(data))}else{
return builder._controlHandlers["container"](parentContainer,data,builder)}return false};
function isFormControlGroup(data){if(!data.children||data.children.length<2)return false;if(
data.children[0].type!=="fixedtext")return false;const formControlTypes=new Set(["spinfield","edit",
"formattedfield","metricfield","combobox","radiobutton","checkbox","time"]);let formControlCount=0;
const minRequiredControls=2;function countFormControls(node){if(!node.children)return 0;let count=0;
for(const child of node.children){if(formControlTypes.has(child.type)){count++}else{
count+=countFormControls(child)}if(count>=minRequiredControls)return count}return count}for(
let i=1;i<data.children.length;i++){formControlCount+=countFormControls(data.children[i]);if(
formControlCount>=minRequiredControls)return true}return false}function buildFrame(parentContainer,
data,builder,isFormControlGroup){let container,frame,label;if(isFormControlGroup){
container=window.L.DomUtil.create("fieldset",
"ui-frame-container ui-fieldset "+builder.options.cssClass,parentContainer);container.id=data.id;
frame=container;label=window.L.DomUtil.create("legend",
"ui-frame-label ui-legend "+builder.options.cssClass,frame)}else{container=window.L.DomUtil.create(
"div","ui-frame-container "+builder.options.cssClass,parentContainer);container.id=data.id;
frame=window.L.DomUtil.create("div","ui-frame "+builder.options.cssClass,container);
frame.id=data.id+"-frame";label=window.L.DomUtil.create("label",
"ui-frame-label "+builder.options.cssClass,frame);label.htmlFor=data.id+"-content"}
label.innerText=builder._cleanText(_extractLabelText(data.children[0]));label.id=data.children[0].id
if(data.children[0].visible===false)window.L.DomUtil.addClass(label,"hidden");builder.postProcess(
frame,data.children[0]);const frameChildren=window.L.DomUtil.create("div",
"ui-expander-content "+builder.options.cssClass,container);frameChildren.id=data.id+"-content";$(
frameChildren).addClass("expanded");const children=data.children.slice(1);builder.build(
frameChildren,children)}function sanitizeString(text){var sanitizer=document.createElement("div");
sanitizer.innerText=text;return sanitizer.innerHTML}function getPermissionModeElements(
isReadOnlyMode,canUserWrite,map){var permissionModeDiv=document.createElement("div");
permissionModeDiv.className="jsdialog ui-badge";if(isReadOnlyMode&&!canUserWrite){
permissionModeDiv.classList.add("status-readonly-mode");permissionModeDiv.textContent=_("Read-only")
permissionModeDiv.setAttribute("data-cooltip",_("Permission Mode"));
window.L.control.attachTooltipEventListener(permissionModeDiv,map)}else if(
isReadOnlyMode&&canUserWrite){permissionModeDiv.classList.add("status-readonly-transient-mode");
permissionModeDiv.style.display="none"}else{permissionModeDiv.classList.add("status-edit-mode");
permissionModeDiv.textContent=_("Edit mode");permissionModeDiv.setAttribute("data-cooltip",_(
"Permission Mode"));window.L.control.attachTooltipEventListener(permissionModeDiv,map)}
return permissionModeDiv}function getStatusbarItemElement(id,title,text,builder,renderAsButton){if(
renderAsButton===void 0){renderAsButton=false}var element=document.createElement(
renderAsButton?"button":"div");element.id=id;element.className="jsdialog ui-badge"+(
renderAsButton?" unobutton":"");element.textContent=text;element.setAttribute("data-cooltip",title);
window.L.control.attachTooltipEventListener(element,builder.map);return element}
function getPageNumberElements(text,builder){var button=getStatusbarItemElement("StatePageNumber",_(
"Number of Pages. Click to open the Go to Page dialog box."),text,builder,true);
button.onclick=function(){return app.map.sendUnoCommand(".uno:GotoPage")};return button}
function getWordCountElements(text,builder){return getStatusbarItemElement("StateWordCount",_(
"Word Counter"),text,builder)}function getStatusDocPosElements(text,builder){
var button=getStatusbarItemElement("StatusDocPos",_("Number of Sheets"),text,builder,true);
button.onclick=function(){return app.map.sendUnoCommand(".uno:JumpToTable")};return button}
function getInsertModeElements(text,builder){return getStatusbarItemElement("InsertMode",_(
"Entering text mode"),text,builder)}function getSelectionModeElements(text,builder){
return getStatusbarItemElement("StatusSelectionMode",_("Selection Mode"),text,builder)}
function getRowColSelCountElements(text,builder){return getStatusbarItemElement("RowColSelCount",_(
"Selected range of cells"),text,builder)}function getStateTableCellElements(text,builder){
return getStatusbarItemElement("StateTableCell",_("Choice of functions"),text,builder)}
function getSlideStatusElements(text,builder){var button=getStatusbarItemElement("SlideStatus",_(
"Number of Slides"),text,builder,true);button.onclick=function(){return app.map.sendUnoCommand(
".uno:GotoPage")};return button}function getPageStatusElements(text,builder){
var button=getStatusbarItemElement("PageStatus",_("Number of Pages"),text,builder,true);
button.onclick=function(){return app.map.sendUnoCommand(".uno:GotoPage")};return button}
function getDocumentStatusElements(text,builder){var docstat=getStatusbarItemElement(
"DocumentStatus",_("Your changes have been saved"),"",builder);if(text==="SAVING"
)docstat.textContent=_("Saving...");else if(text==="SAVED"){var lastSaved=document.createElement(
"span");lastSaved.id="last-saved";lastSaved.textContent="";lastSaved.setAttribute("data-cooltip",_(
"Your changes have been saved")+".");window.L.control.attachTooltipEventListener(lastSaved,
builder.map);docstat.appendChild(lastSaved)}return docstat}function getShowCommentsStatusElements(
text,builder){return getStatusbarItemElement("ShowComments",_("Show Comments"),text,builder)}
var getElementsFromId=function(id,closeCallback,data,builder){if(id==="iconset"
)return window.getConditionalFormatMenuElements("iconsetoverlay",true);else if(id==="scaleset"
)return window.getConditionalColorScaleMenuElements("iconsetoverlay",true);else if(id==="databarset"
)return window.getConditionalDataBarMenuElements("iconsetoverlay",true);else if(
id==="inserttablepopup")return window.getInsertTablePopupElements(closeCallback);else if(
id==="insertshapespopup")return window.getShapesPopupElements(closeCallback);else if(
id==="insertconnectorspopup")return window.getConnectorsPopupElements(closeCallback);else if(
id==="userslistpopup")return window.L.control.createUserListWidget();else if(id==="permissionmode"
)return getPermissionModeElements(data.isReadOnlyMode,data.canUserWrite,builder.map);else if(
id==="statepagenumber")return getPageNumberElements(data.text,builder);else if(id==="statewordcount"
)return getWordCountElements(data.text,builder);else if(id==="showcomments"
)return getShowCommentsStatusElements(data.text,builder);else if(id==="statusdocpos"
)return getStatusDocPosElements(data.text,builder);else if(id==="insertmode"
)return getInsertModeElements(data.text,builder);else if(id==="statusselectionmode"
)return getSelectionModeElements(data.text,builder);else if(id==="rowcolselcount"
)return getRowColSelCountElements(data.text,builder);else if(id==="statetablecell"
)return getStateTableCellElements(data.text,builder);else if(id==="slidestatus"
)return getSlideStatusElements(data.text,builder);else if(id==="pagestatus"
)return getPageStatusElements(data.text,builder);else if(id==="documentstatus"
)return getDocumentStatusElements(data.text,builder)};function htmlContent(parentContainer,data,
builder){parentContainer.replaceChildren();var elements=getElementsFromId(data.htmlId,
data.closeCallback,data,builder);parentContainer.appendChild(elements);if(
data.htmlId==="userslistpopup")setTimeout(function(){return builder.map.userList.renderAll()},0);if(
data.enabled===false&&parentContainer.firstChild)parentContainer.firstChild.setAttribute("disabled",
"true")}JSDialog.htmlContent=htmlContent;function _createEntryImage(parent,builder,entryData,image){
var img=window.L.DomUtil.create("img",builder.options.cssClass,parent);if(image)img.src=image;if(
entryData.text){img.alt=entryData.text}else if(entryData.tooltip){img.alt=entryData.tooltip}else{
img.alt=""}if(entryData.tooltip)img.title=entryData.tooltip;else if(entryData.text
)img.title=entryData.text;else img.title=""}function _createEntryText(parent,entryData){
window.L.DomUtil.addClass(parent,"icon-view-item-container");
var placeholder=window.L.DomUtil.create("span","ui-iconview-entry-title",parent);
placeholder.innerText=entryData.text?entryData.text:""}function _iconViewEntry(parentContainer,
parentData,entry,builder){var disabled=parentData.enabled===false;
var hasText=entry.text&&parentData.textWithIconEnabled;if(entry.separator&&entry.separator===true){
window.L.DomUtil.create("hr",builder.options.cssClass+" ui-iconview-separator",parentContainer);
return}var entryContainer=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-iconview-entry",parentContainer);
entryContainer.id=parentData.id+"_"+entry.row;entryContainer.setAttribute("role","option");
entryContainer.setAttribute("aria-selected","false");if(entry.selected&&entry.selected===true){$(
entryContainer).addClass("selected");entryContainer.setAttribute("aria-selected","true")}if(
entry.ondemand){var placeholder=window.L.DomUtil.create("span",builder.options.cssClass,
entryContainer);placeholder.innerText=entry.text?entry.text:"";if(entry.tooltip
)placeholder.title=entry.tooltip;else if(entry.text
)placeholder.title=entry.text;else placeholder.title="";entryContainer.setAttribute("tabindex","0");
JSDialog.OnDemandRenderer(builder,parentData.id,"iconview",entry.row,placeholder,entryContainer,
entry.text)}else{_createEntryImage(entryContainer,builder,entry,entry.image)}if(hasText
)_createEntryText(entryContainer,entry);if(!disabled){
var singleClick_1=parentData.singleclickactivate===true;$(entryContainer).click(function(){
entryContainer.setAttribute("tabindex","0");entryContainer.focus();if($(entryContainer).hasClass(
"selected"))return;$("#"+parentData.id+" .ui-iconview-entry").each(function(){$(this).removeClass(
"selected");this.setAttribute("aria-selected","false")});builder.callback("iconview","select",
parentData,entry.row,builder);if(singleClick_1){builder.callback("iconview","activate",parentData,
entry.row,builder)}});entryContainer.addEventListener("contextmenu",function(e){$(
"#"+parentData.id+" .ui-iconview-entry").each(function(){$(this).removeClass("selected");
this.setAttribute("aria-selected","false")});builder.callback("iconview","select",parentData,
entry.row,builder);$(entryContainer).addClass("selected");entryContainer.setAttribute(
"aria-selected","true");builder.callback("iconview","contextmenu",parentData,entry.row,builder);
e.preventDefault()});if(!singleClick_1){$(entryContainer).dblclick(function(){builder.callback(
"iconview","activate",parentData,entry.row,builder)})}builder._preventDocumentLosingFocusOnClick(
entryContainer)}}JSDialog.iconView=function(parentContainer,data,builder){
var container=window.L.DomUtil.create("div",builder.options.cssClass+" ui-iconview",parentContainer)
container.id=data.id;container.setAttribute("role","listbox");if(data.labelledBy
)container.setAttribute("aria-labelledby",data.labelledBy);var disabled=data.enabled===false;if(
disabled)window.L.DomUtil.addClass(container,"disabled");for(var i in data.entries){_iconViewEntry(
container,data,data.entries[i],builder)}var updateAllIndexes=function(){
var gridTemplateColumns=getComputedStyle(container).gridTemplateColumns;
var columns=gridTemplateColumns.split(" ").filter(Boolean).length;if(columns>0){
var entries=container.querySelectorAll(".ui-iconview-entry");entries.forEach(function(entry,
flatIndex){var row=Math.floor(flatIndex/columns);var column=flatIndex%columns;entry.setAttribute(
"index",row+":"+column)})}};var resizeObserver=new ResizeObserver(function(){updateAllIndexes()});
resizeObserver.observe(container);var firstSelected=$(container).children(".selected").get(0);if(
firstSelected){var offsetTop=firstSelected.offsetTop;container.scrollTop=offsetTop}
container.onSelect=function(position){$(container).children(".selected").each(function(){$(this
).removeClass("selected");this.setAttribute("aria-selected","false")});
var entry=container.children.length>position?container.children[position]:null;if(entry){
window.L.DomUtil.addClass(entry,"selected");entry.setAttribute("aria-selected","true");if(
builder.options.useScrollAnimation!==false){var blockOption=JSDialog.ScrollIntoViewBlockOption(
"nearest");entry.scrollIntoView({behavior:"smooth",block:blockOption,inline:"nearest"})}else{
var offsetTop=entry.offsetTop;container.scrollTop=offsetTop}}else if(position!=-1)app.console.warn(
'not found entry: "'+position+'" in: "'+container.id+'"')};container.updateRenders=function(pos){
var dropdown=container.querySelectorAll(".ui-iconview-entry, .ui-iconview-separator");if(dropdown[
pos]){var container_1=dropdown[pos];var entry=data.entries[pos];var image=builder.rendersCache[
data.id].images[pos];var hasText=entry.text&&data.textWithIconEnabled;container_1.replaceChildren();
if(hasText){container_1=window.L.DomUtil.create("div",builder.options.cssClass,dropdown[pos])}
_createEntryImage(container_1,builder,entry,image);if(hasText)_createEntryText(container_1,entry)}};
JSDialog.KeyboardGridNavigation(container);container.addEventListener("keydown",function(e){if(
e.key!=="Enter"&&e.key!==" "&&e.code!=="Space")return;var active=document.activeElement;if(
!active||!active.classList.contains("ui-iconview-entry"))return;var iconViewEntries=Array.from(
container.querySelectorAll(".ui-iconview-entry"));var selectedIndex=iconViewEntries.indexOf(active);
if(selectedIndex===-1)return;if(e.key===" "||e.code==="Space")builder.callback("iconview","select",
data,selectedIndex,builder);else if(e.key==="Enter")builder.callback("iconview","activate",data,
selectedIndex,builder)});container.addEventListener("focusin",function(e){var target=e.target;if(
!target.classList.contains("ui-iconview-entry")||target.getAttribute("aria-selected")==="true"
)return;var previouslySelected=container.querySelector('.ui-iconview-entry[aria-selected="true"]');
if(previouslySelected){previouslySelected.setAttribute("aria-selected","false")}target.setAttribute(
"aria-selected","true")});return false};function _menubuttonControl(parentContainer,data,builder){
var ids;var menuId=null;if(data.id.includes(":")){ids=data.id.split(":");menuId=ids[1];data.id=ids[0
]}else if(data.id.includes("-")){ids=data.id.split("-");if(ids.length===2){menuId=ids[1];
data.id=ids[0]}else if(!data.menu){console.error("Menubutton without correct menu id: "+data.id)}
}else menuId=data.id;if(data.menu){if(!data.command)data.command=data.id;menuId=data.id+"-menu";
var builtMenu=[];for(var i in data.menu)builtMenu.push(data.menu[i]);builder._menus.set(menuId,
builtMenu)}var menuEntries=menuId?builder._menus.get(menuId):null;if(menuEntries){
var noLabels=builder.options.noLabelsForUnoButtons;
builder.options.noLabelsForUnoButtons=data.noLabel?data.noLabel:false;if(!data.command
)data.command=menuId;var options={hasDropdownArrow:menuEntries.length>1};
var control=builder._unoToolButton(parentContainer,data,builder,options);
var isSplitButton=!!data.applyCallback;
const applyCallback=typeof data.applyCallback==="function"?data.applyCallback:()=>{if(
data.applyCallback.indexOf(".uno:")===0)app.map.sendUnoCommand(data.applyCallback
);else app.dispatcher.dispatch(data.applyCallback)};if(menuEntries.length==0){
control.container.setAttribute("disabled",true)}$(control.container).addClass("menubutton"+(
isSplitButton?" splitbutton":""));$(control.button).unbind("click");$(control.label).unbind("click")
var dropdownId=data.id;var clickFunction=function(){if(control.container.hasAttribute("disabled")
)return;var callback=function(objectType,eventType,object,data,entry){if(
eventType==="selected"&&entry.items||eventType==="showsubmenu"){return true}else if(
eventType==="selected"&&entry.uno){var uno=entry.uno.indexOf(".uno:"
)===0?entry.uno:".uno:"+entry.uno;builder.map.sendUnoCommand(uno);JSDialog.CloseDropdown(dropdownId)
return true}else if(eventType==="selected"&&entry.action){app.dispatcher.dispatch(entry.action);
JSDialog.CloseDropdown(dropdownId);return true}else if(eventType==="selected"){builder.callback(
"menubutton","select",control.container,entry.id,builder);JSDialog.CloseDropdown(dropdownId);
return true}else if(!entry){builder.callback(objectType,eventType,object,data,builder);
JSDialog.CloseDropdown(dropdownId);return true}return false};var freshMenu=builder._menus.get(menuId
);if(freshMenu.length&&freshMenu[0].type==="colorpicker"){freshMenu=JSON.parse(JSON.stringify(
freshMenu));freshMenu[0].command=data.command;freshMenu[0].id=data.id}if(freshMenu.length===1){
callback(null,"selected",null,null,freshMenu[0])}else{JSDialog.OpenDropdown(dropdownId,
control.container,freshMenu,callback)}};if(isSplitButton){JSDialog.AddOnClick(control.button,
applyCallback);if(control.label)JSDialog.AddOnClick(control.label,applyCallback);if(control.arrow
)control.arrow.tabIndex=0}else{JSDialog.AddOnClick(control.button,clickFunction);if(control.label
)JSDialog.AddOnClick(control.label,clickFunction)}if(control.arrow)JSDialog.AddOnClick(control.arrow
,clickFunction);builder._preventDocumentLosingFocusOnClick(control.container);
builder.options.noLabelsForUnoButtons=noLabels;return control}else if(
data.text!==undefined||data.image){var button=window.L.DomUtil.create("button",
"menubutton "+builder.options.cssClass,parentContainer);button.id=data.id;button.title=data.text;
button.setAttribute("aria-haspopup",true);if(data.image){var image=window.L.DomUtil.create("img","",
button);image.src=data.image;image.setAttribute("alt","")}var label=window.L.DomUtil.create("span",
"",button);label.innerText=data.text?data.text:"";window.L.DomUtil.create("i","arrow",button);$(
button).click(function(){if(!button.hasAttribute("disabled")){builder.callback("menubutton","toggle"
,button,undefined,builder)}});var enabled=Boolean(data.enabled);button.setAttribute("aria-disabled",
!enabled);if(data.enabled===false)button.disabled=true}else{window.app.console.warn(
'Not found menu "'+menuId+'"')}return false}JSDialog.menubuttonControl=function(parentContainer,data
,builder){var buildInnerData=_menubuttonControl(parentContainer,data,builder);return buildInnerData}
function _getCurrentBorderNumber(builder){var outer=builder.map["stateChangeHandler"].getItemValue(
".uno:BorderOuter");var inner=builder.map["stateChangeHandler"].getItemValue(".uno:BorderInner");if(
!outer||!inner)return 0;var left=outer.left==="true";var right=outer.right==="true";
var bottom=outer.bottom==="true";var top=outer.top==="true";var horiz=inner.horizontal==="true";
var vert=inner.vertical==="true";if(left&&!right&&!bottom&&!top&&!horiz&&!vert){return 2}else if(
!left&&right&&!bottom&&!top&&!horiz&&!vert){return 3}else if(
left&&right&&!bottom&&!top&&!horiz&&!vert){return 4}else if(
!left&&!right&&!bottom&&top&&!horiz&&!vert){return 5}else if(
!left&&!right&&bottom&&!top&&!horiz&&!vert){return 6}else if(
!left&&!right&&bottom&&top&&!horiz&&!vert){return 7}else if(left&&right&&bottom&&top&&!horiz&&!vert
){return 8}else if(!left&&!right&&bottom&&top&&horiz&&!vert){return 9}else if(
left&&right&&bottom&&top&&horiz&&!vert){return 10}else if(left&&right&&bottom&&top&&!horiz&&vert){
return 11}else if(left&&right&&bottom&&top&&horiz&&vert){return 12}return 1}
function _borderControlItem(parentContainer,data,builder,i,selected){var button=null;
var div=builder._createIdentifiable("div","unotoolbutton mobile-wizard ui-content unospan",
parentContainer,data);var buttonId="border-"+i;button=window.L.DomUtil.create("img",
"ui-content borderbutton",div);app.LOUtil.setImage(button,"lc_fr0"+i+".svg",builder.map);
button.id=buttonId;if(selected)$(button).addClass("selected");$(div).click(function(){var color=0;
var item=app.LOUtil.findItemWithAttributeRecursive(data.parent,"command",".uno:FrameLineColor");if(
item)color=JSDialog.getCurrentColor(item,builder);window.setBorderStyle(i,color)})}
JSDialog.mobileBorderSelector=function(parentContainer,data,builder){
var mainContainer=window.L.DomUtil.create("div",builder.options.cssClass+" ui-mobileborderselector",
parentContainer);mainContainer.id=data.id;if(data.enabled===false){mainContainer.disabled=true}
var bordercontrollabel=window.L.DomUtil.create("label",builder.options.cssClass+" ui-text",
mainContainer);bordercontrollabel.textContent=_("Cell borders");
bordercontrollabel.id=data.id+"label";var current=_getCurrentBorderNumber(builder);for(
var i=1;i<13;++i)_borderControlItem(mainContainer,data,builder,i,i===current);
var updateFunction=function(){var current=_getCurrentBorderNumber(builder);for(var i=1;i<13;++i){if(
i!==current)$("#border-"+i).removeClass("selected");else $("#border-"+i).addClass("selected")}};
builder.map.on("commandstatechanged",function(e){if(
e.commandName===".uno:BorderOuter"||e.commandName===".uno:BorderInner")updateFunction()},this);
return false};function _panelTabsHandler(parentContainer,data,builder,tabTooltip,isTabControl){if(
!builder.options.useSetTabs)console.warn(
"mobile panelTabsHandler: setTabs will be used ignoring useSetTabs property");
var tabsContainer=window.L.DomUtil.create("div","ui-tabs "+builder.options.cssClass+" ui-widget");
var contentsContainer=window.L.DomUtil.create("div",
"ui-tabs-content "+builder.options.cssClass+" ui-widget",parentContainer);var tabIdx,item;if(
!isTabControl){for(var tabIdx=data.length-1;tabIdx>=0;tabIdx--){var item=data[tabIdx];if(
item.hidden===true)data.splice(tabIdx,1)}}var tabs=[];var contentDivs=[];var labels=[];for(
tabIdx=0;tabIdx<data.length;tabIdx++){item=data[tabIdx];var title=builder._cleanText(item.text);
var tab=window.L.DomUtil.create("div","ui-tab "+builder.options.cssClass,tabsContainer);tab.id=title
tabs[tabIdx]=tab;var label=window.L.DomUtil.create("span",
"ui-tab-content "+builder.options.cssClass+" unolabel",tab);label.textContent=title;labels[tabIdx
]=title;var contentDiv=window.L.DomUtil.create("div",
"ui-content level-"+builder._currentDepth+" "+builder.options.cssClass,contentsContainer);
contentDiv.title=title;builder._currentDepth++;if(item.children){for(
var i=0;i<item.children.length;i++){builder.build(contentDiv,[item.children[i]])}}else{
builder.build(contentDiv,[item])}builder._currentDepth--;$(contentDiv).addClass("hidden");
contentDivs[tabIdx]=contentDiv}if(builder.wizard){builder.wizard.setTabs(tabsContainer,builder);for(
var t=0;t<tabs.length;t++){var fn=builder._createTabClick(builder,t,tabs,contentDivs,labels);$(tabs[
t]).click(fn)}}else{window.app.console.debug(
"Builder used outside of mobile wizard: please implement the click handler")}$(tabs[0]).click();
builder.wizard.goLevelDown(contentsContainer);return false}function _tabsToPanelConverter(
parentContainer,data,builder,tabTooltip){var tabs=0;var tabObjects=[];for(
var tabIdx=0;data.children&&tabIdx<data.children.length;tabIdx++){if(data.children[tabIdx
].type==="tabpage"||data.vertical){tabs++;tabObjects.push(data.children[tabIdx])}}
var isMultiTabJSON=tabs>1;if(data.tabs){for(tabIdx=0;data.tabs&&tabIdx<data.tabs.length;tabIdx++){
var isSelectedTab=data.selected==data.tabs[tabIdx].id;if(isSelectedTab){var singleTabId=tabIdx}}}if(
isMultiTabJSON){var tabId=0;for(tabIdx=0;tabIdx<data.children.length;tabIdx++){
var tab=data.children[tabIdx];if(tab.type!=="tabpage"&&!data.vertical)continue;tabObjects[tabId
].text=data.tabs[tabId].text;tabId++}}else{for(tabIdx=0;tabIdx<data.children.length;tabIdx++){
tab=data.children[tabIdx];if(tab.type!=="tabpage"&&!data.vertical)continue;tabObjects[singleTabId
].text=data.tabs[singleTabId].text;break}}_panelTabsHandler(parentContainer,tabObjects,builder,
tabTooltip,true);return false}function _tabsToSubmenuConverter(parentContainer,data,builder){
const submenuChildren=[];for(const[index,tab]of Object.entries(data.children)){if(
tab.type!=="tabpage"){continue}submenuChildren.push({children:tab.children,command:tab.command,
enabled:true,executionType:"menu",id:tab.id,parent:parentContainer,text:data.tabs[index].text,
type:"submenu"})}data.children=submenuChildren;return JSDialog.container(parentContainer,data,
builder)}JSDialog.mobileTabControl=function(parentContainer,data,builder){
var buildInnerData=_tabsToPanelConverter(parentContainer,data,builder);return buildInnerData};
JSDialog.mobilePanelControl=function(parentContainer,data,builder){
var buildInnerData=_panelTabsHandler(parentContainer,data,builder);return buildInnerData};
JSDialog.mobileSubmenuTabControl=function(parentContainer,data,builder){
var buildInnerData=_tabsToSubmenuConverter(parentContainer,data,builder);return buildInnerData};
function _sendSimpleSelection(edit,builder){var startPos=edit.selectionStart;
var endPos=edit.selectionEnd;var selection=startPos+";"+endPos;builder.callback("edit",
"textselection",edit,selection,builder)}function _multiLineEditControl(parentContainer,data,builder,
callback){var controlType="textarea";if(data.contenteditable)controlType="div";else if(
data.cursor&&(data.cursor==="false"||data.cursor===false))controlType="p";
let edit=window.L.DomUtil.create(controlType,"ui-textarea "+builder.options.cssClass,parentContainer
);if(data.contenteditable)edit.setAttribute("contenteditable","true");if(controlType==="textarea"
)edit.value=builder._cleanText(data.text);else if(controlType==="p"){data.text=data.text.replace(
/(?:\r\n|\r|\n)/g,"<br>");edit.textContent=builder._cleanText(data.text)}else if(controlType==="div"
){if(data.html)edit.innerHTML=data.html;else edit.textContent=builder._cleanText(data.text)}
edit.id=data.id;if(data.enabled===false){edit.disabled=true}function _keyupChangeHandler(){if(
callback)callback(this.value);builder.callback("edit","change",edit,this.value,builder);setTimeout(
function(){_sendSimpleSelection(edit,builder)},0)}edit.addEventListener("keyup",_keyupChangeHandler)
edit.addEventListener("change",_keyupChangeHandler);edit.addEventListener("mouseup",function(event){
if(edit.disabled){event.preventDefault();return}_sendSimpleSelection(event.target,builder)});if(
data.hidden)window.L.DomUtil.addClass(edit,"hidden");return false}JSDialog.multilineEdit=function(
parentContainer,data,builder){var buildInnerData=_multiLineEditControl(parentContainer,data,builder)
return buildInnerData};var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
function migrateItems(from,to){if(!from){app.console.debug(
"overflow manager: no source for migration");return}var items=from.querySelectorAll(":scope > *");
items.forEach(function(button){var htmlButton=button;to.appendChild(htmlButton)});
var parentContainerData=to.getBoundingClientRect();if(parentContainerData.right>window.innerWidth){
setupOverflowMenuPosition(parentContainerData,to)}}function setupOverflowMenuPosition(
parentContainerData,overflowDialog){var overflowAmount=parentContainerData.right-window.innerWidth;
var currentMarginInlineStart=parseFloat(overflowDialog.style.marginInlineStart||"0");
var newMarginInlineStart=currentMarginInlineStart-overflowAmount-4;
overflowDialog.style.marginInlineStart=newMarginInlineStart+"px"}function createMoreButton(id,more,
groupLabel){var moreOptionsButton=document.createElement("button");
moreOptionsButton.className="ui-content unobutton";moreOptionsButton.id=id+"-more-button";
moreOptionsButton.setAttribute("aria-label","More options for "+id);moreOptionsButton.setAttribute(
"aria-pressed","false");var img=document.createElement("img");img.alt="";app.LOUtil.setImage(img,
"lc_overflow-morebutton.svg",app.map);moreOptionsButton.appendChild(img);
var unoToolButtonDiv=document.createElement("div");unoToolButtonDiv.id=id+"-more";
unoToolButtonDiv.className="unotoolbutton ui-overflow-group-more";unoToolButtonDiv.tabIndex=-1;
unoToolButtonDiv.setAttribute("data-cooltip","More options for "+id);unoToolButtonDiv.appendChild(
moreOptionsButton);var expanderIconRightDiv=document.createElement("div");
expanderIconRightDiv.className="ui-expander-icon-right jsdialog sidebar";
expanderIconRightDiv.appendChild(unoToolButtonDiv);if(groupLabel.parentElement){
groupLabel.parentElement.appendChild(expanderIconRightDiv)}moreOptionsButton.addEventListener(
"click",function(e){e.stopPropagation();e.preventDefault();app.map.sendUnoCommand(more.command)});
return expanderIconRightDiv}function setupOverflowMenu(overflowGroupContainer,
overflowGroupContentContainer,bottomBar,id,more){
var overflowMenuButton=overflowGroupContainer.querySelector('[id^="overflow-button"]');
overflowMenuButton.style.display="none";var groupLabel=overflowGroupContainer.querySelector(
".ui-overflow-group-label");if(more){createMoreButton(id,more,groupLabel)}
var hiddenItems=window.L.DomUtil.create("div","hidden-overflow-container",overflowGroupContainer);
hiddenItems.style.display="none";overflowGroupContainer.classList.add(
"ui-overflow-group-container-with-label");
var originalTopbar=overflowGroupContentContainer.querySelectorAll(":scope > *");
var overflowMenuHandler=function(hideContent){overflowGroupContentContainer.replaceChildren();
hiddenItems.replaceChildren();if(hideContent){var topRow_1=document.createElement("div");
topRow_1.classList.add("top-row-overflow-group");originalTopbar.forEach(function(el){
return topRow_1.append(el)});overflowGroupContentContainer.append(topRow_1,
bottomBar!==null&&bottomBar!==void 0?bottomBar:null);migrateItems(overflowGroupContentContainer,
hiddenItems)}else{originalTopbar.forEach(function(el){return overflowGroupContentContainer.append(el
)});hiddenItems.replaceChildren();if(bottomBar){
overflowGroupContainer===null||overflowGroupContainer===void 0?void 0:overflowGroupContainer.append(
bottomBar)}}};var dropdownId="overflow-button-"+id;var isCollapsed=false;
overflowGroupContainer.isCollapsed=function(){return isCollapsed};
overflowGroupContainer.foldGroup=function(){if(isCollapsed)return;app.console.debug(
"overflow manager: fold group: "+id);JSDialog.CloseDropdown(dropdownId);overflowMenuHandler(true);
overflowGroupContainer.classList.remove("ui-overflow-group-container-with-label");
overflowMenuButton.style.display="";isCollapsed=true};overflowGroupContainer.unfoldGroup=function(){
if(!isCollapsed)return;app.console.debug("overflow manager: unfold group: "+id);
JSDialog.CloseDropdown(dropdownId);overflowMenuButton.style.display="none";
overflowGroupContainer.classList.add("ui-overflow-group-container-with-label");overflowMenuHandler(
false);isCollapsed=false};overflowMenuButton._onDropDown=function(opened){if(opened){
app.layoutingService.appendLayoutingTask(function(){app.layoutingService.appendLayoutingTask(
function(){var menu=JSDialog.GetDropdown(dropdownId);if(!menu){app.console.error(
'overflow manager: menu missing: "'+dropdownId+'"');return}
var hiddenItemsChildren=hiddenItems.querySelectorAll(":scope > *");if(hiddenItemsChildren.length===0
){app.console.debug('overflow manager: no items to migrate for "'+dropdownId+'"');return}
var overflowNode=menu.parentNode;overflowNode.style.position="fixed";
overflowNode.style.zIndex="20000";overflowGroupContainer.appendChild(overflowNode);
menu===null||menu===void 0?void 0:menu.replaceChildren();
menu===null||menu===void 0?void 0:menu.classList.add("ui-toolbar");
menu===null||menu===void 0?void 0:menu.classList.add("ui-overflow-group-popup");migrateItems(
hiddenItems,menu);menu.addEventListener("keydown",function(e){var key;if(e.key==="Tab"){
key=e.shiftKey?"ArrowLeft":"ArrowRight"}else{key=e.key}if(["ArrowUp","ArrowDown","ArrowLeft",
"ArrowRight"].includes(key)){var currentElement=e.target;
var isElementOfTypeInput=currentElement.tagName==="INPUT"||currentElement.tagName==="TEXTAREA";if(
!isElementOfTypeInput||isElementOfTypeInput&&e.key==="Tab"){
var elementToFocus=JSDialog.FindNextElementInContainer(menu,currentElement,key);if(elementToFocus){
elementToFocus.focus()}else{var focusables=Array.from(menu.querySelectorAll(
'[tabindex="-1"]:not([disabled])'));if(focusables.length){var targetIndex=void 0;if(
key==="ArrowRight"||key==="ArrowDown"){targetIndex=0}else if(key==="ArrowLeft"||key==="ArrowUp"){
targetIndex=focusables.length-1}if(targetIndex!==undefined){focusables[targetIndex].focus()}}}
e.stopPropagation();e.preventDefault()}}})})})}else{var menu=JSDialog.GetDropdown(dropdownId);
migrateItems(menu,hiddenItems)}}}function findFirstToolitem(items){var e_1,_a;if(!items)return null;
try{for(var items_1=__values(items),items_1_1=items_1.next();!items_1_1.done;items_1_1=items_1.next(
)){var item=items_1_1.value;if(item.type.indexOf("toolitem")>=0||item.type.indexOf("colorlistbox"
)>=0||item.type.indexOf("menubutton")>=0)return item;else if(item.children&&item.children.length){
var innerItem=findFirstToolitem(item.children);if(innerItem!==null)return innerItem}}}catch(e_1_1){
e_1={error:e_1_1}}finally{try{if(items_1_1&&!items_1_1.done&&(_a=items_1.return))_a.call(items_1)
}finally{if(e_1)throw e_1.error}}return null}function getToolitemIcon(item){if(!item
)return"lc_menuoverflow.svg";if(item.icon!==undefined
)return item.icon;else return app.LOUtil.getIconNameOfCommand(item.command)}
JSDialog.OverflowGroup=function(parentContainer,data,builder){
var overflowGroupContainer=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-overflow-group"+(data.nofold?" nofold":""),parentContainer);
overflowGroupContainer.id=data.id;var overflowGroupInnerContainer=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-overflow-group-inner",overflowGroupContainer);
overflowGroupInnerContainer.id=data.id+"-inner";var contentContainer=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-overflow-group-content",overflowGroupInnerContainer);
contentContainer.classList.add(data.vertical?"vertical":"horizontal");
overflowGroupInnerContainer.id=data.id+"-content";var bottomBar=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-overflow-group-bottom",overflowGroupContainer);
bottomBar.id=data.id+"-bottom";var label=window.L.DomUtil.create("span",
builder.options.cssClass+" ui-overflow-group-label",bottomBar);if(data.name
)label.innerText=data.name;if(data.children)builder.build(contentContainer,data.children,false
);else app.console.error("OverflowGroup: no content provided");var firstItem=findFirstToolitem(
data.children);if(!firstItem){app.console.warn(
"OverflowGroup: First toolitem inside overflow group not found")}var builtMenu=[{type:"json",
content:{id:"overflow-group-placeholder-"+data.id,type:"toolbox",children:[{
id:"dummy-overflow-button-required-for-focus",type:"pushbutton",text:"X"}]}},{type:"separator"}];
builder._menus.set(data.id,builtMenu);if(data.nofold===true)return false;
var id="overflow-button-"+data.id;builder.build(overflowGroupInnerContainer,[{type:"menubutton",
id:id,text:data.name?data.name:firstItem?firstItem.text:"",icon:data.icon?data.icon:getToolitemIcon(
firstItem),command:firstItem?firstItem.command:"",noLabel:!data.name,menu:builtMenu,
applyCallback:firstItem&&firstItem.type==="toolitem"?function(){firstItem.type.includes("custom"
)?app.dispatcher.dispatch(firstItem.command):app.map.sendUnoCommand(firstItem.command)}:undefined}],
false);setupOverflowMenu(overflowGroupContainer,contentContainer,bottomBar,data.id,data.more);
return false};var OverflowManager=function(){function OverflowManager(parentContainer,data){
this.lastMaxWidth=-1;this.parentContainer=parentContainer;this.data=data;window.addEventListener(
"resize",this.onResize.bind(this));if(app.map)app.map.on("refreshoverflows",this.onRefresh,this
);else app.console.error("OverflowManager: no app.map available")}
OverflowManager.prototype.calculateMaxWidth=function(){var margin=20;
var nextElement=this.parentContainer.nextSibling;if(nextElement&&nextElement.classList.contains(
"ui-spacer"))nextElement=nextElement.nextSibling;
var nextElementPosition=nextElement?nextElement.offsetLeft:0;if(nextElementPosition<=0
)nextElementPosition=this.parentContainer.offsetWidth+margin+1;if(
nextElementPosition>window.innerWidth)nextElementPosition=window.innerWidth;
var startPosition=this.parentContainer.offsetLeft;return nextElementPosition-startPosition-margin};
OverflowManager.prototype.hasOverflow=function(maxWidth){
var requiredWidth=this.parentContainer.scrollWidth;app.console.debug(
'overflow manager: "'+this.data.id+'" max: '+maxWidth+" req: "+requiredWidth);
return maxWidth<requiredWidth};OverflowManager.prototype.onResize=function(event){var _this=this;
app.layoutingService.appendLayoutingTask(function(){return _this.onRefresh(event)})};
OverflowManager.prototype.onRefresh=function(event){var _a;if(!this.parentContainer)return;if(
this.lastMaxWidth===window.innerWidth)return;var parentNode=this.parentContainer;while(parentNode){
if((_a=parentNode===null||parentNode===void 0?void 0:parentNode.classList
)===null||_a===void 0?void 0:_a.contains("hidden"))return;parentNode=parentNode.parentNode}
this.lastMaxWidth=window.innerWidth;var groups=this.parentContainer.querySelectorAll(
".ui-overflow-group");groups.forEach(function(element){if(typeof element.unfoldGroup==="function"
)element.unfoldGroup()});var maxWidth=this.calculateMaxWidth();for(var i=groups.length-1;i>=0;i--){
var element=groups[i];if(maxWidth>=0&&this.hasOverflow(maxWidth)){if(
typeof element.foldGroup==="function")element.foldGroup()}}};return OverflowManager}();
JSDialog.OverflowManager=function(parentContainer,data,builder){parentContainer.classList.add(
"ui-overflow-manager");new OverflowManager(parentContainer,data);app.console.debug(
'Create OverflowManager for: "'+data.id+'"');return true};JSDialog.progressbar=function(
parentContainer,data,builder){const div=window.L.DomUtil.createWithId("div",data.id,parentContainer)
window.L.DomUtil.addClass(div,"ui-progressbar");window.L.DomUtil.addClass(div,
builder.options.cssClass);const progressbar=window.L.DomUtil.create("progress",
builder.options.cssClass,div);progressbar.id=data.id+"-progress";progressbar.tabIndex="0";if(
data.value!==undefined)progressbar.value=data.value;else progressbar.value=0;if(
data.maxValue!==undefined)progressbar.max=data.maxValue;else progressbar.max=100;
const isComplete=progressbar.value===progressbar.max;if(data.infinite===true&&!isComplete){
window.L.DomUtil.addClass(div,"infinite");div.setAttribute("data-progress-type","infinite")}else{
div.removeAttribute("data-progress-type");div.classList.remove("infinite")}if(
data.enabled==="false"||data.enabled===false){$(progressbar).prop("disabled",true)}if(data.hidden)$(
progressbar).hide();return false};function radiobuttonControl(parentContainer,data,builder){
var container=window.L.DomUtil.createWithId("div",data.id,parentContainer);
window.L.DomUtil.addClass(container,"radiobutton ui-radiobutton");window.L.DomUtil.addClass(
container,builder.options.cssClass);var radiobutton=window.L.DomUtil.create("input","",container);
radiobutton.type="radio";radiobutton.id=data.id+"-input";radiobutton.tabIndex="0";if(data.image){
var image=window.L.DomUtil.create("img","",radiobutton);image.src=data.image;
window.L.DomUtil.addClass(container,"has-image")}if(data.group)radiobutton.name=data.group;
var radiobuttonLabel=window.L.DomUtil.createWithId("label",data.id+"-label",container);
radiobuttonLabel.textContent=builder._cleanText(data.text);radiobuttonLabel.htmlFor=data.id+"-input"
var toggleFunction=function(){builder.callback("radiobutton","change",container,$(radiobutton).prop(
"checked"),builder)};$(radiobuttonLabel).click(function(){if(radiobutton.hasAttribute("disabled")
)return;$(radiobutton).prop("checked",true);toggleFunction.bind({checked:true})()});
var isDisabled=data.enabled===false;if(isDisabled){radiobutton.setAttribute("disabled","disabled");
radiobutton.setAttribute("aria-disabled",isDisabled)}if(data.checked===true)$(radiobutton).prop(
"checked",true);radiobutton.addEventListener("change",toggleFunction);if(data.hidden)$(radiobutton
).hide();return false}JSDialog.RadioButton=function(parentContainer,data,builder){
return radiobuttonControl(parentContainer,data,builder)};function _hasDrawingAreaInside(children){
if(!children)return false;for(var i in children){if(children[i].type==="drawingarea")return true;if(
_hasDrawingAreaInside(children[i].children))return true}return false}
function _scrolledWindowControl(parentContainer,data,builder){
var scrollwindow=window.L.DomUtil.create("div",builder.options.cssClass+" ui-scrollwindow",
parentContainer);if(data.id)scrollwindow.id=data.id;if(_hasDrawingAreaInside(data.children)
)window.L.DomUtil.addClass(scrollwindow,"has-ui-drawing-area");var content=window.L.DomUtil.create(
"div",builder.options.cssClass+" ui-scrollwindow-content",scrollwindow);builder.build(content,
data.children,false);if(!data.vertical&&!data.horizontal)return false;
var noVertical=data.vertical.policy==="never";if(noVertical)scrollwindow.style.overflowY="hidden";
if(data.vertical.policy==="always")scrollwindow.style.overflowY="scroll";
var noHorizontal=data.horizontal.policy==="never";if(noHorizontal
)scrollwindow.style.overflowX="hidden";if(data.horizontal.policy==="always"
)scrollwindow.style.overflowX="scroll";var realContentHeight=scrollwindow.scrollHeight;
var realContentWidth=scrollwindow.scrollwidth;var margin=15;var verticalSteps=(
data.vertical.upper-data.vertical.lower-data.vertical.page_size)*10;if(verticalSteps<0||noVertical
)verticalSteps=0;var horizontalSteps=(
data.horizontal.upper-data.horizontal.lower-data.horizontal.page_size)*10;if(
horizontalSteps<0||noHorizontal)horizontalSteps=0;var timeoutLimit=2;var updateSize=function(){
realContentHeight=scrollwindow.scrollHeight;realContentWidth=scrollwindow.scrollwidth;if(
realContentHeight===0||realContentWidth===0){if(timeoutLimit--)setTimeout(updateSize,100);return}if(
!noVertical){content.style.height=realContentHeight+verticalSteps+"px";
scrollwindow.style.height=realContentHeight+margin+"px"}if(!noHorizontal){
content.style.width=realContentWidth+horizontalSteps+"px";
scrollwindow.style.width=realContentWidth+margin+"px"}content.scrollTop=data.vertical.value*10;
content.scrollLeft=data.horizontal.value*10;
content.style.margin=content.scrollTop+"px "+margin+"px "+margin+"px "+content.scrollLeft+"px"};if(
data.user_managed_scrolling!==false)setTimeout(updateSize,0);var sendTimer=null;if(
!noVertical&&verticalSteps||!noHorizontal&&horizontalSteps){scrollwindow.addEventListener("scroll",
function(){var scrollTop=scrollwindow.scrollTop;var scrollLeft=scrollwindow.scrollLeft;if(
data.user_managed_scrolling!==false){
content.style.margin=scrollTop+"px "+margin+"px "+margin+"px "+scrollLeft+"px";
content.style.height=realContentHeight-scrollTop+verticalSteps+"px";
content.style.width=realContentWidth-scrollLeft+horizontalSteps+"px"}if(sendTimer)clearTimeout(
sendTimer);sendTimer=setTimeout(function(){builder.callback("scrolledwindow","scrollv",scrollwindow,
Math.round(scrollTop/10),builder);builder.callback("scrolledwindow","scrollh",scrollwindow,
Math.round(scrollLeft/10),builder)},50)})}return false}JSDialog.scrolledWindow=function(
parentContainer,data,builder){var buildInnerData=_scrolledWindowControl(parentContainer,data,builder
);return buildInnerData};var __extends=this&&this.__extends||function(){var extendStatics=function(d
,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var SearchEditWidget=function(_super){__extends(
SearchEditWidget,_super);function SearchEditWidget(parentContainer,data,builder,callback){
return _super.call(this,parentContainer,data,builder,callback)||this}
SearchEditWidget.prototype.onSearchInput=function(){this.updateSearchButtons();if(
window.L.Map.THIS.getDocType()==="text"){app.searchService.search(this.edit.input.value,false,"",0,
true)}};SearchEditWidget.prototype.onSearchKeyDown=function(e){var entry=this.edit.input;if(
e.keyCode===71&&e.ctrlKey||e.keyCode===114||e.keyCode===13){if(e.shiftKey){app.searchService.search(
entry.value,true)}else{app.searchService.search(entry.value)}e.preventDefault()}else if(
e.ctrlKey&&e.keyCode===70){entry.focus();entry.select();e.preventDefault()}else if(e.keyCode===27){
window.L.Map.THIS.cancelSearch()}};SearchEditWidget.prototype.onSearchFocus=function(){
window.L.Map.THIS.fire("searchstart");this.updateSearchButtons()};
SearchEditWidget.prototype.onSearchBlur=function(){window.L.Map.THIS._onGotFocus()};
SearchEditWidget.prototype.updateSearchButtons=function(){var toolbar=window.mode.isMobile(
)?app.map.mobileSearchBar:app.map.statusBar;if(!toolbar){console.debug("Cannot find search bar");
return}if(this.edit.input.value===""){toolbar.enableItem("searchprev",false);toolbar.enableItem(
"searchnext",false);toolbar.showItem("cancelsearch",false)}else{toolbar.enableItem("searchprev",true
);toolbar.enableItem("searchnext",true);toolbar.showItem("cancelsearch",true)}};
SearchEditWidget.prototype.setupEventListeners=function(){_super.prototype.setupEventListeners.call(
this);this.edit.input.addEventListener("input",this.onSearchInput.bind(this));
this.edit.input.addEventListener("keydown",this.onSearchKeyDown.bind(this));
this.edit.input.addEventListener("focus",this.onSearchFocus.bind(this));
this.edit.input.addEventListener("blur",this.onSearchBlur.bind(this))};return SearchEditWidget}(
EditWidget);JSDialog.searchEdit=function(parentContainer,data,builder,callback){
var widget=new SearchEditWidget(parentContainer,data,builder,callback);return widget.build()};
JSDialog.deck=function(parentContainer,data,builder){var deck=window.L.DomUtil.create("div",
"deck "+builder.options.cssClass,parentContainer);deck.id=data.id;deck.tabIndex="-1";for(
var i=0;i<data.children.length;i++){builder.build(deck,[data.children[i]],undefined)}return false};
JSDialog.panel=function(parentContainer,data,builder){var expanderData=data;
expanderData.type="expander";expanderData.children=[{text:data.text}].concat(data.children);
builder._controlHandlers["expander"](parentContainer,expanderData,builder,function(){});
var expander=$(parentContainer).children("#"+expanderData.id);if(data.name
)window.L.DomUtil.addClass(expander.get(0),data.name);if(expanderData.hidden===true)expander.hide();
if(expanderData.command){var iconParent=expander.children(".ui-expander").get(0);
var icon=window.L.DomUtil.create("div","ui-expander-icon-right "+builder.options.cssClass,iconParent
);var moreOptionsText=expanderData.children[0].text?_("More options for {1}").replace("{1}",
expanderData.children[0].text):"";builder._controlHandlers["toolitem"](icon,{type:"toolitem",
command:expanderData.command,aria:{label:moreOptionsText},icon:app.LOUtil.getIconNameOfCommand(
"morebutton"),tooltip:moreOptionsText},builder)}return false};function staticTextControl(
parentContainer,data,builder){var statictext=window.L.DomUtil.create("span",builder.options.cssClass
,parentContainer);if(data.text)statictext.textContent=builder._cleanText(data.text);else if(
data.html)statictext.innerHTML=data.html;statictext.id=data.id;if(data.style&&data.style.length){
window.L.DomUtil.addClass(statictext,data.style)}else{window.L.DomUtil.addClass(statictext,"ui-text"
)}if(data.hidden)$(statictext).hide();return false}JSDialog.StaticText=function(parentContainer,data
,builder){return staticTextControl(parentContainer,data,builder)};JSDialog.timeField=function(
parentContainer,data,builder){var inputTimeField=window.L.DomUtil.create("input",
builder.options.cssClass+" ui-timefield",parentContainer);inputTimeField.setAttribute("type","time")
inputTimeField.setAttribute("step",1);inputTimeField.setAttribute("id",data.id);
inputTimeField.value=data.text;inputTimeField.addEventListener("change",function(event){
var timefield=event.target;var attrdisabled=timefield.getAttribute("disabled");if(
attrdisabled!=="disabled"){builder.callback("spinfield","change",timefield,timefield.value,builder)}
});if(data.enabled===false){inputTimeField.disabled=true}return false};
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};var lastClickHelperRow=-1;
var lastClickHelperId="";var TreeViewControl=function(){function TreeViewControl(data,builder){
this._thead=null;this.PAGE_ENTRY_PREFIX="-$#~";this.PAGE_ENTRY_SUFFIX="~#$-";
this.PAGE_DIVIDER_ROW_CLASS="page-divider-row";this._ignoreFocus=false;
this._container=window.L.DomUtil.create("div",builder.options.cssClass+" ui-treeview");
this._container.id=data.id;this._rows=new Map;if(data.labelledBy)this._container.setAttribute(
"aria-labelledby",data.labelledBy);if(data.ignoreFocus!==undefined
)this._ignoreFocus=data.ignoreFocus}Object.defineProperty(TreeViewControl.prototype,"Container",{
get:function(){return this._container},enumerable:false,configurable:true});
TreeViewControl.countColumns=function(data){if(!data.entries||!data.entries.length
)return data.headers?data.headers.length:1;var maxColumns=0;for(var e in data.entries){
var entry=data.entries[e];var count=entry.columns?entry.columns.length:0;if(count>maxColumns
)maxColumns=count}return maxColumns};TreeViewControl.hasState=function(data){for(
var e in data.entries){var entry=data.entries[e];if(entry.state!==undefined)return true}return false
};TreeViewControl.hasIcon=function(data){for(var e in data.entries){var entry=data.entries[e];for(
var i in entry.columns){if(entry.columns[i].collapsed!==undefined||entry.columns[i
].expanded!==undefined||entry.columns[i].collapsedimage!==undefined||entry.columns[i
].expandedimage!==undefined){return true}}}return false};
TreeViewControl.prototype.findEntryWithRow=function(entries,row){for(var i in entries){if(entries[i
].row==row)return entries[i];else if(entries[i].children){var found=this.findEntryWithRow(entries[i
].children,row);if(found)return found}}return null};
TreeViewControl.prototype.changeCheckboxStateOnClick=function(checkbox,treeViewData,builder,entry){
var foundEntry;if(checkbox.checked){foundEntry=this.findEntryWithRow(treeViewData.entries,entry.row)
if(foundEntry)checkbox.checked=foundEntry.state=true;builder.callback("treeview","change",
treeViewData,{row:entry.row,value:true},builder)}else{foundEntry=this.findEntryWithRow(
treeViewData.entries,entry.row);if(foundEntry)checkbox.checked=foundEntry.state=false;
builder.callback("treeview","change",treeViewData,{row:entry.row,value:false},builder)}};
TreeViewControl.prototype.createCheckbox=function(parent,treeViewData,builder,entry){
var checkbox=window.L.DomUtil.create("input",builder.options.cssClass+" ui-treeview-checkbox",parent
);checkbox.type="checkbox";checkbox.tabIndex=-1;if(entry.state===true
)checkbox.checked=true;else checkbox.checked=false;return checkbox};
TreeViewControl.prototype.createRadioButton=function(parent,treeViewData,builder,entry){
var radioButton=window.L.DomUtil.create("input",builder.options.cssClass+" ui-treeview-checkbox",
parent);radioButton.type="radio";radioButton.tabIndex=-1;if(entry.state===true
)radioButton.checked=true;else radioButton.checked=false;return radioButton};
TreeViewControl.prototype.createSelectionElement=function(parent,treeViewData,entry,builder){
var _this=this;var selectionElement;var checkboxtype=treeViewData.checkboxtype;if(
checkboxtype=="radio"){selectionElement=this.createRadioButton(parent,treeViewData,builder,entry)
}else{selectionElement=this.createCheckbox(parent,treeViewData,builder,entry)}if(
entry.enabled===false)selectionElement.disabled=true;if(treeViewData.enabled!==false){
selectionElement.addEventListener("change",function(){_this.changeCheckboxStateOnClick(
selectionElement,treeViewData,builder,entry)})}return selectionElement};
TreeViewControl.prototype.isSeparator=function(element){if(!element.text)return false;
return element.text.toLowerCase()==="separator"};TreeViewControl.isSingleClickActivate=function(
treeViewData){return treeViewData.singleclickactivate===true};
TreeViewControl.prototype.isNavigator=function(data){
return data.id&&typeof data.id==="string"&&data.id.startsWith("Navigator")};
TreeViewControl.prototype.getCellIconId=function(cellData){
var iconId=cellData.collapsed?cellData.collapsed:cellData.expanded;var newLength=iconId.lastIndexOf(
".");if(newLength>0)iconId=iconId.substr(0,newLength).replaceAll("/",""
);else iconId=iconId.replaceAll("/","");return iconId};
TreeViewControl.prototype.createImageColumn=function(parentContainer,builder,imageUrl){
var image=window.L.DomUtil.create("img",
builder.options.cssClass+" ui-treeview-checkbox ui-treeview-image",parentContainer);
image.src=imageUrl;image.tabIndex=-1;image.alt="";return image};
TreeViewControl.prototype.isExpanded=function(entry){for(var i in entry.columns)if(entry.columns[i
].expanded===true)return true;return false};TreeViewControl.prototype.fillHeader=function(header,
builder){if(!header)return;var th=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-treeview-header",this._thead);var span=window.L.DomUtil.create("span",
builder.options.cssClass+" ui-treeview-header-text",th);span.innerText=header.text;if(
header.sortable!==false){window.L.DomUtil.create("span",
builder.options.cssClass+" ui-treeview-header-sort-icon",span)}};
TreeViewControl.prototype.fillRow=function(data,entry,builder,level,parent){var highlight=false;if(
data.highlightTerm&&data.highlightTerm.trim().length>0){
highlight=entry.text&&entry.text.toLowerCase().indexOf(data.highlightTerm.toLowerCase())>=0}
var tr=window.L.DomUtil.create("div",builder.options.cssClass+" ui-treeview-entry"+(
highlight?" highlighted":""),parent);this._rows.set(String(entry.row),tr);tr.setAttribute("level",
String(level));tr.setAttribute("role","row");var dummyColumns=0;if(this._hasState)dummyColumns++;
tr.style.gridColumn="1 / "+(this._columns+dummyColumns+1);if(this.isPageDivider(entry,
this.PAGE_ENTRY_PREFIX,this.PAGE_ENTRY_SUFFIX)){window.L.DomUtil.addClass(tr,
this.PAGE_DIVIDER_ROW_CLASS)}else{tr.setAttribute("tabindex","0")}var selectionElement;if(
this._hasState){var td=window.L.DomUtil.create("div","",tr);
selectionElement=this.createSelectionElement(td,data,entry,builder);if(this._isRealTree
)td.setAttribute("aria-level",level)}this.fillCells(entry,builder,data,tr,level,selectionElement);
this.setupRowProperties(tr,entry,level,selectionElement);this.setupRowDragAndDrop(tr,data,entry,
builder);return tr};TreeViewControl.prototype.highlightAllTreeViews=function(highlight){if(highlight
){document.querySelectorAll(".ui-treeview").forEach(function(item){window.L.DomUtil.addClass(item,
"droptarget")})}else{document.querySelectorAll(".ui-treeview").forEach(function(item){
window.L.DomUtil.removeClass(item,"droptarget")})}};
TreeViewControl.prototype.setupDragAndDrop=function(treeViewData,builder){var _this=this;if(
treeViewData.enabled!==false){this._container.ondrop=function(ev){ev.preventDefault();
var row=ev.dataTransfer.getData("text");builder.callback("treeview","dragend",treeViewData,row,
builder);_this.highlightAllTreeViews(false)};this._container.ondragover=function(event){
event.preventDefault()}}};TreeViewControl.prototype.setupRowDragAndDrop=function(tr,treeViewData,
entry,builder){var _this=this;if(treeViewData.enabled!==false&&entry.state==null){
tr.draggable=treeViewData.draggable===false?false:true;tr.ondragstart=function(ev){
ev.dataTransfer.setData("text",""+entry.row);builder.callback("treeview","dragstart",treeViewData,
entry.row,builder);_this.highlightAllTreeViews(true)};tr.ondragend=function(){
_this.highlightAllTreeViews(false)};tr.ondragover=function(event){event.preventDefault()}}};
TreeViewControl.prototype.setupRowProperties=function(tr,entry,level,selectionElement){if(
entry.children)tr.setAttribute("aria-expanded","true");if(level!==undefined&&this._isRealTree
)tr.setAttribute("aria-level",""+level);if(entry.selected===true)this.selectEntry(tr,
selectionElement);var disabled=entry.enabled===false;if(disabled)window.L.DomUtil.addClass(tr,
"disabled");if(entry.ondemand||entry.collapsed){window.L.DomUtil.addClass(tr,"collapsed");
tr.setAttribute("aria-expanded","false")}};
TreeViewControl.prototype.createExpandableIconCell=function(parent,entry,index,builder){
var icon=window.L.DomUtil.create("img","ui-treeview-icon",parent);if(this._isNavigator
)icon.draggable=false;var iconId=this.getCellIconId(entry.columns[index]);window.L.DomUtil.addClass(
icon,iconId+"img");var iconName=app.LOUtil.getIconNameOfCommand(iconId,true);app.LOUtil.setImage(
icon,iconName,builder.map);icon.tabIndex=-1;icon.alt=""};
TreeViewControl.prototype.createTextCell=function(treeViewData,parent,entry,index,builder){
var text=builder._cleanText(entry.columns[index].text)||builder._cleanText(entry.text);
var hasRenderer=entry.columns[index].customEntryRenderer;
var hasCache=hasRenderer&&builder.rendersCache[treeViewData.id];
var hasCachedImage=hasCache&&builder.rendersCache[treeViewData.id].images[entry.row];if(
hasCachedImage){var image=builder.rendersCache[treeViewData.id].images[entry.row];
var cell=window.L.DomUtil.create("span",builder.options.cssClass+(
" ui-treeview-cell-text ui-treeview-cell-text-content ui-treeview-"+entry.row+"-"+index),parent);
var img=window.L.DomUtil.create("img","ui-treeview-custom-render",cell);img.src=image;img.alt=text
}else{var cell=void 0;if(this.isPageDivider(entry,this.PAGE_ENTRY_PREFIX,this.PAGE_ENTRY_SUFFIX)){
cell=window.L.DomUtil.create("span",
builder.options.cssClass+" ui-treeview-cell-text-content page-divider",parent);
cell.innerText=this.getPageEntryText(entry.text,this.PAGE_ENTRY_PREFIX,this.PAGE_ENTRY_SUFFIX)
}else if(treeViewData.highlightTerm!==undefined){cell=this.createHighlightedCell(parent,entry,index,
builder,treeViewData.highlightTerm)}else{cell=window.L.DomUtil.create("span",
builder.options.cssClass+" ui-treeview-cell-text-content",parent);cell.innerText=text}if(hasRenderer
){JSDialog.OnDemandRenderer(builder,treeViewData.id,"treeview",entry.row,cell,parent,entry.text)}}};
TreeViewControl.prototype.createHighlightedCell=function(parent,entry,index,builder,searchTerm){
var sourceText=entry.text;var searchPattern="["+searchTerm+"]";var mainSpan=window.L.DomUtil.create(
"span",builder.options.cssClass+" ui-treeview-cell-text-content",parent);
var fragments=this.caseInsensitiveSplit(sourceText,searchPattern);if(fragments.length===1){
mainSpan.appendChild(document.createTextNode(sourceText))}else{for(var i=0;i<fragments.length-1;i+=2
){mainSpan.appendChild(document.createTextNode(fragments[i]));
var highlightSpan=window.L.DomUtil.create("span",builder.options.cssClass+" highlighted",mainSpan);
highlightSpan.innerText=fragments[i+1].substring(1,fragments[i+1].length-1);mainSpan.appendChild(
highlightSpan)}mainSpan.appendChild(document.createTextNode(fragments[fragments.length-1]))}
return mainSpan};TreeViewControl.prototype.isPageDivider=function(entry,pageEntryPrefix,
pageEntrySuffix){return entry.text&&entry.text.startsWith(pageEntryPrefix)&&entry.text.endsWith(
pageEntrySuffix)};TreeViewControl.prototype.getPageEntryText=function(text,pageEntryPrefix,
pageEntrySuffix){return text.substring(pageEntryPrefix.length,text.length-pageEntrySuffix.length)};
TreeViewControl.prototype.caseInsensitiveSplit=function(text,delimeter){
var escapedPattern=delimeter.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");var regex=new RegExp(
"("+escapedPattern+")","gi");return text.split(regex)};
TreeViewControl.prototype.createLinkCell=function(parent,entry,index,builder){
var cell=window.L.DomUtil.create("span",builder.options.cssClass+" ui-treeview-cell-text",parent);
var link=window.L.DomUtil.create("a","",cell);link.href=entry.columns[index].link||entry.columns[
index].text;link.innerText=entry.columns[index].text||entry.text;link.target="_blank";
link.rel="noopener"};TreeViewControl.prototype.fillCells=function(entry,builder,treeViewData,tr,
level,selectionElement){var td,expander,span,text,img;var rowElements=[];if(this.isSeparator(entry)
)window.L.DomUtil.addClass(tr,"context-menu-separator");if(this._isRealTree){
td=window.L.DomUtil.create("div","ui-treeview-expander-column",tr);rowElements.push(td);if(
entry.children&&entry.children.length)expander=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-treeview-expander",td)}for(var index in entry.columns){
td=window.L.DomUtil.create("div","",tr);rowElements.push(td);span=window.L.DomUtil.create("span",
builder.options.cssClass+" ui-treeview-cell",td);text=window.L.DomUtil.create("span",
builder.options.cssClass+" ui-treeview-cell-text",span);if(entry.text=="<dummy>")continue;
img=entry.columns[index].collapsedimage?entry.columns[index].collapsedimage:entry.columns[index
].expandedimage;if(img){window.L.DomUtil.addClass(td,"ui-treeview-icon-column");
this.createImageColumn(text,builder,img)}else if(entry.columns[index].collapsed||entry.columns[index
].expanded){window.L.DomUtil.addClass(td,"ui-treeview-icon-column");window.L.DomUtil.addClass(span,
"ui-treeview-expandable-with-icon");this.createExpandableIconCell(text,entry,index,builder)}else if(
entry.columns[index].link&&!this.isSeparator(entry.columns[index])){this.createLinkCell(text,entry,
index,builder)}else if(entry.columns[index].text&&!this.isSeparator(entry.columns[index])){
this.createTextCell(treeViewData,text,entry,index,builder)}for(var i in rowElements){
var element=rowElements[i];element.setAttribute("role","gridcell")}}if(!this.isPageDivider(entry,
this.PAGE_ENTRY_PREFIX,this.PAGE_ENTRY_SUFFIX)){var clickFunction=this.createClickFunction(tr,
selectionElement,true,this._singleClickActivate,builder,treeViewData,entry);
var doubleClickFunction=this.createClickFunction(tr,selectionElement,false,true,builder,treeViewData
,entry);this.setupEntryMouseEvents(tr,entry,treeViewData,builder,selectionElement,expander,
clickFunction,doubleClickFunction);this.setupEntryKeyboardEvents(tr,entry,selectionElement,expander,
clickFunction);this.setupEntryContextMenuEvent(tr,entry,treeViewData,builder)}};
TreeViewControl.prototype.setupEntryContextMenuEvent=function(tr,entry,treeViewData,builder){
tr.addEventListener("contextmenu",function(e){builder.callback("treeview","contextmenu",treeViewData
,entry.row,builder);e.preventDefault()})};TreeViewControl.prototype.setupEntryMouseEvents=function(
tr,entry,treeViewData,builder,selectionElement,expander,clickFunction,doubleClickFunction){
var _this=this;tr.addEventListener("click",clickFunction);if(!this._singleClickActivate){if(
window.ThisIsTheiOSApp){tr.addEventListener("click",function(event){if(window.L.DomUtil.hasClass(tr,
"disabled"))return;if(entry.row==lastClickHelperRow&&treeViewData.id==lastClickHelperId
)doubleClickFunction(event);else{lastClickHelperRow=entry.row;lastClickHelperId=treeViewData.id;
setTimeout(function(){lastClickHelperRow=-1},300)}})}else{$(tr).dblclick(doubleClickFunction)}}
var toggleFunction=function(e){_this.toggleEntry(tr,treeViewData,entry,builder);e.preventDefault()};
var expandFunction=function(e){_this.expandEntry(tr,treeViewData,entry,builder);e.preventDefault()};
if(expander&&entry.children&&entry.children.length){if(entry.ondemand){window.L.DomEvent.on(expander
,"click",expandFunction)}else{$(expander).click(function(e){if(
entry.state&&e.target===selectionElement)e.preventDefault();toggleFunction(e.originalEvent)})}}};
TreeViewControl.prototype.setupEntryKeyboardEvents=function(tr,entry,selectionElement,expander,
clickFunction){var _this=this;if(entry.enabled===false)return;tr.addEventListener("keydown",
function(event){var preventDef=false;if(event.key===" "&&expander){expander.click();tr.focus();
preventDef=true}else if(event.key==="Enter"||event.key===" "){clickFunction(event);if(
selectionElement)selectionElement.click();if(expander){expander.click()}tr.focus();preventDef=true
}else if(event.key==="ArrowLeft"){if(expander&&!window.L.DomUtil.hasClass(tr,"collapsed")){
expander.click();tr.focus();preventDef=true}}else if(event.key==="ArrowRight"){if(
expander&&window.L.DomUtil.hasClass(tr,"collapsed")){expander.click();tr.focus();preventDef=true}
}else if(event.key==="Tab"){if(!window.L.DomUtil.hasClass(tr,"selected"))_this.unselectEntry(tr)}if(
preventDef){event.preventDefault();event.stopPropagation()}})};
TreeViewControl.prototype.toggleEntry=function(span,treeViewData,entry,builder){if(
entry.enabled===false)return;if(window.L.DomUtil.hasClass(span,"collapsed"))builder.callback(
"treeview","expand",treeViewData,entry.row,builder);else builder.callback("treeview","collapse",
treeViewData,entry.row,builder);$(span).toggleClass("collapsed")};
TreeViewControl.prototype.expandEntry=function(span,treeViewData,entry,builder){if(
entry.enabled===false)return;if(entry.ondemand&&window.L.DomUtil.hasClass(span,"collapsed")
)builder.callback("treeview","expand",treeViewData,entry.row,builder);$(span).toggleClass(
"collapsed")};TreeViewControl.prototype.selectEntry=function(span,checkbox){
window.L.DomUtil.addClass(span,"selected");span.setAttribute("aria-selected","true");span.tabIndex=0
if(!this._ignoreFocus)span.focus();if(checkbox)checkbox.removeAttribute("tabindex")};
TreeViewControl.prototype.selectEntryByRow=function(row){var _this=this;
var rowElement=this._rows.get(String(row));if(!rowElement){console.warn(
'TreeView onSelect: row "'+row+'" not found');return}this._container.querySelectorAll(
".ui-treeview-entry.selected").forEach(function(item){_this.unselectEntry(item)});
var checkbox=rowElement.querySelector("input");this.selectEntry(rowElement,checkbox)};
TreeViewControl.prototype.unselectEntry=function(item){window.L.DomUtil.removeClass(item,"selected")
item.removeAttribute("aria-selected");item.removeAttribute("tabindex");
var itemCheckbox=item.querySelector("input");if(itemCheckbox)itemCheckbox.tabIndex=-1};
TreeViewControl.prototype.createClickFunction=function(parentContainer,checkbox,select,activate,
builder,treeViewData,entry){var _this=this;return function(e){if(e&&e.target===checkbox)return;if(
e&&window.L.DomUtil.hasClass(parentContainer,"disabled")){e.preventDefault();return}
_this._container.querySelectorAll(".ui-treeview-entry.selected").forEach(function(item){
_this.unselectEntry(item)});_this.selectEntry(parentContainer,checkbox);if(checkbox&&(
!e||e.target===checkbox))_this.changeCheckboxStateOnClick(checkbox,treeViewData,builder,entry);
var cell=_this.getTextCellForElement(e.target);var column;var editable=false;if(cell){
column=_this.getColumnForCell(entry,cell);editable=_this.canEdit(entry,column)}if(select
)builder.callback("treeview","select",treeViewData,entry.row,builder);if(!editable&&activate
)builder.callback("treeview","activate",treeViewData,entry.row,builder);if(editable&&activate
)_this.startEditing(builder,cell,column,entry,parentContainer,treeViewData)}};
TreeViewControl.prototype.getTextCellForElement=function(element){var textCells=Array.from(
element.getElementsByClassName("ui-treeview-cell-text-content"));if(element.classList.contains(
"ui-treeview-cell-text-content")){textCells.push(element)}if(textCells.length!==1){return null}
var cell=textCells[0];return cell};TreeViewControl.prototype.getColumnForCell=function(entry,cell){
var e_1,_a;var column;try{for(var _b=__values(Array.from(cell.classList)),_c=_b.next(
);!_c.done;_c=_b.next()){var className=_c.value;var prefix="ui-treeview-"+entry.row+"-";if(
className.startsWith(prefix)){column=parseInt(className.slice(prefix.length))}}}catch(e_1_1){e_1={
error:e_1_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}
}if(column===undefined||Number.isNaN(column)){return null}if(column>=entry.columns.length){
return null}return column};TreeViewControl.prototype.canEdit=function(entry,column){if(
column===null||entry.columns[column].text===undefined){return false}return!!entry.columns[column
].editable};TreeViewControl.prototype.startEditing=function(builder,cell,column,entry,
parentContainer,treeViewData){var e_2,_a,e_3,_b;var _this=this;try{for(var _c=__values(Array.from(
cell.childNodes)),_d=_c.next();!_d.done;_d=_c.next()){var child=_d.value;child.remove()}}catch(e_2_1
){e_2={error:e_2_1}}finally{try{if(_d&&!_d.done&&(_a=_c.return))_a.call(_c)}finally{if(e_2
)throw e_2.error}}var rowShouldBeDraggable=parentContainer.draggable;
var input=document.createElement("input");input.style.width="100%";
input.style.boxSizing="border-box";input.value=entry.columns[column].text;input.enterKeyHint="done";
var cancelledUpdate=false;input.addEventListener("keydown",function(e){if(e.code==="Enter"){
input.blur()}else if(e.code==="Escape"){cancelledUpdate=true;input.blur()}
e.stopImmediatePropagation()},{capture:true});var conflictingEventTypes=["click","dblclick"];try{
for(var conflictingEventTypes_1=__values(conflictingEventTypes),
conflictingEventTypes_1_1=conflictingEventTypes_1.next(
);!conflictingEventTypes_1_1.done;conflictingEventTypes_1_1=conflictingEventTypes_1.next()){
var eventType=conflictingEventTypes_1_1.value;input.addEventListener(eventType,function(e){
e.stopPropagation()})}}catch(e_3_1){e_3={error:e_3_1}}finally{try{if(
conflictingEventTypes_1_1&&!conflictingEventTypes_1_1.done&&(_b=conflictingEventTypes_1.return)
)_b.call(conflictingEventTypes_1)}finally{if(e_3)throw e_3.error}}input.addEventListener("blur",
function(){_this.endEditing(builder,cancelledUpdate,cell,column,entry,input,parentContainer,
rowShouldBeDraggable,treeViewData)});parentContainer.draggable=false;
parentContainer.parentElement.onFocus=function(){};cell.appendChild(input);input.focus()};
TreeViewControl.prototype.endEditing=function(builder,cancelledUpdate,cell,column,entry,input,
parentContainer,rowShouldBeDraggable,treeViewData){var e_4,_a;
parentContainer.draggable=rowShouldBeDraggable;parentContainer.parentElement.onFocus=undefined;try{
for(var _b=__values(Array.from(cell.childNodes)),_c=_b.next();!_c.done;_c=_b.next()){
var child=_c.value;child.remove()}}catch(e_4_1){e_4={error:e_4_1}}finally{try{if(_c&&!_c.done&&(
_a=_b.return))_a.call(_b)}finally{if(e_4)throw e_4.error}}if(cancelledUpdate){cell.append(
entry.columns[column].text);return}cell.append(input.value);builder.callback("treeview","editend",
treeViewData,{row:entry.row,column:column,value:input.value},builder)};
TreeViewControl.prototype.filterEntries=function(filter){if(this._filterTimer)clearTimeout(
this._filterTimer);var entriesToHide=[];var allEntries=this._container.querySelectorAll(
".ui-treeview-entry");filter=filter.trim();allEntries.forEach(function(entry){if(filter==="")return;
var cells=entry.querySelectorAll("div");for(var i in cells){var entryText=cells[i].innerText;if(
entryText&&entryText.toLowerCase().indexOf(filter.toLowerCase())>=0){return}}entriesToHide.push(
entry)});this._filterTimer=setTimeout(function(){allEntries.forEach(function(entry){
window.L.DomUtil.removeClass(entry,"hidden")});entriesToHide.forEach(function(entry){
window.L.DomUtil.addClass(entry,"hidden")})},100)};
TreeViewControl.prototype.highlightEntries=function(searchTerm){var _this=this;
app.layoutingService.appendLayoutingTask(function(){var entriesToHighlight=[];
var allEntries=_this._container.querySelectorAll(".ui-treeview-entry");searchTerm=searchTerm.trim();
allEntries.forEach(function(entry){if(searchTerm==="")return;var cells=entry.querySelectorAll("div")
for(var i in cells){var entryText=cells[i].innerText;if(entryText&&entryText.toLowerCase().indexOf(
searchTerm.toLowerCase())>=0){entriesToHighlight.push(entry)}}return});allEntries.forEach(function(
entry){window.L.DomUtil.removeClass(entry,"highlighted")});entriesToHighlight.forEach(function(entry
){window.L.DomUtil.addClass(entry,"highlighted")})})};
TreeViewControl.prototype.setupKeyEvents=function(data,builder){var _this=this;
this._container.addEventListener("keydown",function(event){
var listElements=_this._container.querySelectorAll(
".ui-treeview-entry:not(."+_this.PAGE_DIVIDER_ROW_CLASS+")");_this.handleKeyEvent(event,listElements
,builder,data)})};TreeViewControl.prototype.setupFocusOutHandler=function(){var _this=this;
this._container.addEventListener("focusout",function(event){
app.layoutingService.appendLayoutingTask(function(){var activeElement=document.activeElement;
var isFocusInTreeView=activeElement&&_this._container.contains(activeElement);if(!isFocusInTreeView
){var listElements=_this._container.querySelectorAll(
".ui-treeview-entry:not(."+_this.PAGE_DIVIDER_ROW_CLASS+")");_this.restoreInitialTabIndexes(
Array.from(listElements))}})})};TreeViewControl.prototype.restoreInitialTabIndexes=function(
listElements){listElements.forEach(function(entry){entry.tabIndex=0})};
TreeViewControl.prototype.changeFocusedRow=function(listElements,fromIndex,toIndex){
var nextElement=listElements.at(toIndex);nextElement.tabIndex=0;nextElement.focus();
var nextInput=Array.from(listElements.at(toIndex).querySelectorAll(
".ui-treeview-entry > div > input"));if(nextInput&&nextInput.length)nextInput.at(0).removeAttribute(
"tabindex");if(fromIndex>=0){var oldElement=listElements.at(fromIndex);if(window.L.DomUtil.hasClass(
oldElement,"selected"))return;oldElement.removeAttribute("tabindex");var oldInput=Array.from(
listElements.at(fromIndex).querySelectorAll(".ui-treeview-entry > div > input"));if(
oldInput&&oldInput.length)oldInput.at(0).tabIndex=-1}};
TreeViewControl.prototype.getCurrentEntry=function(listElements){
var focusedElement=document.activeElement;var currIndex=listElements.indexOf(focusedElement);if(
currIndex<0)currIndex=listElements.indexOf(focusedElement.parentNode.parentNode);if(currIndex<0){
var selected=listElements.filter(function(o){return o.classList.contains("selected")});if(
selected&&selected.length)currIndex=listElements.indexOf(selected[0])}if(currIndex<0){for(
var i in listElements){var parent=listElements[i].parentNode;if(parent
)parent=parent.parentNode;else break;if(parent&&window.L.DomUtil.hasClass(parent,"selected")){
currIndex=listElements.indexOf(listElements[i]);break}}}return currIndex};
TreeViewControl.prototype.handleKeyEvent=function(event,nodeList,builder,data){var preventDef=false;
var listElements=Array.from(nodeList);var treeLength=listElements.length;
var currIndex=this.getCurrentEntry(listElements);if(event.key==="ArrowDown"){if(currIndex<0
)this.changeFocusedRow(listElements,currIndex,0);else{var nextIndex=currIndex+1;while(
nextIndex<treeLength-1&&listElements[nextIndex].clientHeight<=0)nextIndex++;if(nextIndex<treeLength
)this.changeFocusedRow(listElements,currIndex,nextIndex)}preventDef=true}else if(
event.key==="ArrowUp"){if(currIndex<0)this.changeFocusedRow(listElements,currIndex,treeLength-1
);else{var nextIndex=currIndex-1;while(nextIndex>=0&&listElements[nextIndex].clientHeight<=0
)nextIndex--;if(nextIndex>=0)this.changeFocusedRow(listElements,currIndex,nextIndex)}preventDef=true
}else if(data.fireKeyEvents&&builder.callback("treeview","keydown",{id:data.id,key:event.key},
currIndex,builder)){preventDef=true}if(preventDef){event.preventDefault();event.stopPropagation()}};
TreeViewControl.prototype.isRealTree=function(data){var isRealTreeView=false;for(
var i in data.entries){if(data.entries[i].children&&data.entries[i].children.length){
isRealTreeView=true;break}}return isRealTreeView};
TreeViewControl.prototype.getSortComparator=function(columnIndex,up){return function(a,b){if(!a||!b
)return 0;var tda=a.querySelectorAll("div").item(columnIndex);var tdb=b.querySelectorAll("div"
).item(columnIndex);if(tda.querySelector("input")){if(tda.querySelector("input"
).checked===tdb.querySelector("input").checked)return 0;if(up){if(tda.querySelector("input"
).checked>tdb.querySelector("input").checked)return 1;else return-1}else if(tdb.querySelector(
"input").checked>tda.querySelector("input").checked)return 1;else return-1}if(up
)return tdb.innerText.toLowerCase().localeCompare(tda.innerText.toLowerCase()
);else return tda.innerText.toLowerCase().localeCompare(tdb.innerText.toLowerCase())}};
TreeViewControl.prototype.sortByColumn=function(icon,columnIndex,up){this.clearSorting();
window.L.DomUtil.addClass(icon,up?"up":"down");var toSort=[];var container=this._container;
container.querySelectorAll(":not(.ui-treeview-expanded-content) .ui-treeview-entry").forEach(
function(item){toSort.push(item);container.removeChild(item)});toSort.sort(this.getSortComparator(
columnIndex,up));toSort.forEach(function(item){container.insertBefore(item,
container.lastChild.nextSibling)})};TreeViewControl.prototype.clearSorting=function(){
var icons=this._thead.querySelectorAll(".ui-treeview-header-sort-icon");icons.forEach(function(icon
){window.L.DomUtil.removeClass(icon,"down");window.L.DomUtil.removeClass(icon,"up")})};
TreeViewControl.prototype.fillHeaders=function(headers,builder){var _this=this;if(!headers)return;
this._thead=window.L.DomUtil.create("div","ui-treeview-headers",this._container);
var dummyCells=this._columns-headers.length;if(this._hasState)dummyCells++;
this._thead.style.gridColumn="1 / "+(this._columns+dummyCells+1);for(
var index=0;index<dummyCells;index++){this.fillHeader({text:"",sortable:false},builder);if(
index===0&&this._hasState)window.L.DomUtil.addClass(this._thead.lastChild,"ui-treeview-state-column"
);else window.L.DomUtil.addClass(this._thead.lastChild,"ui-treeview-icon-column")}for(
var index in headers){this.fillHeader(headers[index],builder);if(headers[index].sortable===false
)continue;var clickFunction=function(columnIndex,icon){return function(){if(
window.L.DomUtil.hasClass(icon,"down"))_this.sortByColumn(icon,columnIndex+dummyCells,true
);else _this.sortByColumn(icon,columnIndex+dummyCells,false)}};var last=this._thead.lastChild;
last.onclick=clickFunction(parseInt(index),last.querySelector(".ui-treeview-header-sort-icon"))}};
TreeViewControl.prototype.makeEmptyList=function(data,builder){if(data.id==="contenttree"){
var tr=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-treview-entry ui-treeview-placeholder",this._container);
tr.innerText=_("Headings and objects that you add to the document will appear here")}else{
window.L.DomUtil.addClass(this._container,"empty");if(data.hideIfEmpty)window.L.DomUtil.addClass(
this._container,"hidden")}};TreeViewControl.prototype.makeTreeViewFocusable=function(enable){
var firstElement=this._container.querySelector(
".ui-treeview-entry:not(."+this.PAGE_DIVIDER_ROW_CLASS+")");if(firstElement){if(enable
)firstElement.tabIndex=0;else firstElement.removeAttribute("tabindex")}};
TreeViewControl.prototype.fillEntries=function(data,entries,builder,level,parent){
var hasSelectedEntry=false;for(var index in entries){hasSelectedEntry=hasSelectedEntry||entries[
index].selected;this.fillEntry(data,entries[index],builder,level,parent)}if(
entries&&entries.length===0)this.makeEmptyList(data,builder);if(level===1&&!hasSelectedEntry
)this.makeTreeViewFocusable(true)};TreeViewControl.prototype.fillEntry=function(data,entry,builder,
level,parent){var entryElements=new Array;var row=this.fillRow(data,entry,builder,level,parent);
entryElements.push(row);if(entry.children&&entry.children.length){window.L.DomUtil.addClass(row,
"ui-treeview-expandable");var subGrid=window.L.DomUtil.create("div","ui-treeview-expanded-content",
parent);entryElements.push(subGrid);var dummyColumns=0;if(this._hasState)dummyColumns++;
subGrid.style.gridColumn="1 / "+(this._columns+dummyColumns+1);this.fillEntries(data,entry.children,
builder,level+1,subGrid)}return entryElements};TreeViewControl.prototype.getColumnType=function(
column){var isString=column.link||column.text;
var isIcon=column.collapsed||column.collapsedimage||column.expanded||column.expandedimage;
var columnType="unknown";if(this.isSeparator(column))columnType="separator";else if(isString
)columnType="string";else if(isIcon)columnType="icon";return columnType};
TreeViewControl.prototype.preprocessColumnData=function(entires){var _this=this;if(
!entires||!entires.length)return;var columnTypes=entires.map(function(entry){
var currentTypes=new Array;entry.columns.forEach(function(column){currentTypes.push(
_this.getColumnType(column))});return currentTypes}).reduce(function(prev,next){if(
!next||prev.length>next.length)return prev;return next});entires.forEach(function(entry){
var existingColumns=entry.columns;var missingColumns=columnTypes.length-existingColumns.length;if(
missingColumns<=0)return;var newColumns=Array();var targetIndex=0;var existingIndex=0;while(
targetIndex<columnTypes.length){var isExistingColumn=existingIndex<existingColumns.length;
var currentType=isExistingColumn?_this.getColumnType(existingColumns[existingIndex]):"unknown";if(
currentType==="separator")break;if(!isExistingColumn||currentType!==columnTypes[targetIndex]){
newColumns.push({text:""})}else{newColumns.push(existingColumns[existingIndex]);existingIndex++}
targetIndex++}entry.columns=newColumns})};TreeViewControl.prototype.build=function(data,builder,
parentContainer){var _this=this;this._isRealTree=this.isRealTree(data);
this._columns=TreeViewControl.countColumns(data);this._hasState=TreeViewControl.hasState(data);
this._hasIcon=TreeViewControl.hasIcon(data);this._isNavigator=this.isNavigator(data);
this._singleClickActivate=TreeViewControl.isSingleClickActivate(data);this._tbody=this._container;
this._container.onSelect=function(position){_this.selectEntryByRow(position)};
this._container.filterEntries=this.filterEntries.bind(this);
this._container.highlightEntries=this.highlightEntries.bind(this);this._container.onFocus=function(
){};this.setupDragAndDrop(data,builder);this.setupKeyEvents(data,builder);this.setupFocusOutHandler(
);if(this._isRealTree){this._container.setAttribute("role","treegrid");if(
!data.headers||data.headers.length===0)window.L.DomUtil.addClass(this._container,"ui-treeview-tree")
}else this._container.setAttribute("role","grid");this.preprocessColumnData(data.entries);
this.fillHeaders(data.headers,builder);this.fillEntries(data,data.entries,builder,1,this._tbody);
return true};return TreeViewControl}();JSDialog.treeView=function(parentContainer,data,builder){
var treeView=new TreeViewControl(data,builder);treeView.build(data,builder,parentContainer);
parentContainer.appendChild(treeView._container);var updateRenders=function(pos){
var row=treeView.findEntryWithRow(data.entries,pos);if(!row){console.error(
'treeview updateRenders: row "'+pos+'" not found');return}var originalRow=treeView._rows.get(String(
pos));if(!originalRow){console.error("treeview updateRenders: missing original row");return}
var level=parseInt(originalRow.getAttribute("level"));var dummyParent=document.createElement("div");
var newRow=treeView.fillEntry(data,row,builder,level,dummyParent);if(originalRow.classList.contains(
"ui-treeview-expandable")){originalRow.nextSibling.replaceWith(newRow[1]);originalRow.replaceWith(
newRow[0])}else{originalRow.replaceWith(newRow[0])}treeView._rows.set(String(pos),newRow[0])};
treeView._container.updateRenders=updateRenders;return false};JSDialog.isDnDActive=function(){
var dndElements=document.querySelectorAll(".droptarget");return dndElements&&dndElements.length};
window.L.Control.JSDialog=window.L.Control.extend({options:{},dialogs:{},draggingObject:null,
onAdd:function(map){this.map=map;this.map.on("jsdialog",this.onJSDialog,this);this.map.on(
"jsdialogupdate",this.onJSUpdate,this);this.map.on("jsdialogaction",this.onJSAction,this);
this.map.on("zoomend",this.onZoomEnd,this);this.map.on("closealldialogs",this.onCloseAll,this);
this.map.on("closeAutoFilterDialog",this.closePopupsOnTabChange,this);window.L.DomEvent.on(
window.document,"keyup",this.onKeyUp,this)},onRemove:function(){this.map.off("jsdialog",
this.onJSDialog,this);this.map.off("jsdialogupdate",this.onJSUpdate,this);this.map.off(
"jsdialogaction",this.onJSAction,this);this.map.off("zoomend",this.onZoomEnd,this);this.map.off(
"closealldialogs",this.onCloseAll,this);this.map.off("closeAutoFilterDialog",
this.closePopupsOnTabChange,this);window.L.DomEvent.off(window.document,"keyup",this.onKeyUp,this)},
hasDialogOpened:function(){var dialogs=this.dialogs;return Object.keys(dialogs).filter(function(key
){return key!="snackbar"&&dialogs[key].isDropdown!==true}).length>0},hasDropdownOpened:function(){
return Object.values(this.dialogs).filter(function(dialog){return dialog.isDropdown===true}
).length>0},hasSnackbarOpened:function(){return Object.keys(this.dialogs).filter(function(key){
return key=="snackbar"}).length>0},clearDialog:function(id){const dialogInfo=this.dialogs[id];
const builder=dialogInfo.builder;app.layoutingService.appendLayoutingTask(()=>{
window.L.DomUtil.remove(dialogInfo.container);if(dialogInfo.overlay&&!dialogInfo.isSubmenu
)window.L.DomUtil.remove(dialogInfo.overlay);delete this.dialogs[id]});return builder},
close:function(id,sendCloseEvent){if(id!==undefined&&this.dialogs[id]){const dialog=this.dialogs[id]
if(!sendCloseEvent&&dialog.overlay&&!dialog.isSubmenu){app.layoutingService.appendLayoutingTask((
)=>{window.L.DomUtil.remove(dialog.overlay)})}if(dialog.timeoutId)clearTimeout(dialog.timeoutId);if(
dialog.isPopup)this.closePopover(id,sendCloseEvent);else this.closeDialog(id,sendCloseEvent)}},
closeAll:function(leaveSnackbar){var dialogs=Object.keys(this.dialogs);for(
var i=0;i<dialogs.length;i++){if(leaveSnackbar&&dialogs[i]&&dialogs[i]==="snackbar")continue;
this.close(dialogs[i],app.idleHandler._active)}},closeAllDropdowns:function(){
var dialogs=Object.values(this.dialogs);for(var i=0;i<dialogs.length;i++){if(dialogs[i]&&!dialogs[i
].isDropdown)continue;this.close(dialogs[i].id,false)}},closeDialog:function(id,sendCloseEvent){if(
id===undefined||!this.dialogs[id]){app.console.warn("missing dialog data");return}
this.focusToLastElement(id);var builder=this.clearDialog(id);if(sendCloseEvent!==false&&builder
)builder.callback("dialog","close",{id:"__DIALOG__"},null,builder)},closePopover:function(id,
sendCloseEvent){if(id===undefined||!this.dialogs[id]){app.console.warn("missing popover data");
return}var clickToClose=this.dialogs[id].clickToClose;var builder=this.dialogs[id].builder;if(
sendCloseEvent){if(clickToClose&&typeof clickToClose.closeDropdown==="function"
)clickToClose.closeDropdown();if(clickToClose&&window.L.DomUtil.hasClass(clickToClose,"menubutton")
)clickToClose.click();else if(builder)builder.callback("popover","close",{id:"__POPOVER__"},null,
builder);else app.console.warn("closePopover: no builder")}else{const popupParent=this.dialogs[id
].popupParent;if(popupParent&&typeof popupParent._onDropDown==="function")popupParent._onDropDown(
false);this.focusToLastElement(id);this.clearDialog(id);return}this.focusToLastElement(id)},
onCloseAll:function(){this.closeAll(true);this.closeAllDropdowns()},focusToLastElement:function(id){
if(id===undefined)return;const dialog=this.dialogs[id];app.layoutingService.appendLayoutingTask((
)=>{if(!dialog.lastFocusedElement){this.map.focus();return}try{dialog.lastFocusedElement.focus()
}catch(error){app.console.debug("Cannot focus last element in dialog with id: "+id);this.map.focus()
}})},setTabs:function(){app.console.error("setTabs: not implemented in dialogs.")},
selectedTab:function(){},_getDefaultButtonId:function(widgets){for(var i in widgets){if(widgets[i
].type==="pushbutton"||widgets[i].type==="okbutton"){if(widgets[i].has_default===true
)return widgets[i].id}if(widgets[i].children){var found=this._getDefaultButtonId(widgets[i].children
);if(found)return found}}return null},fadeOutDialog:function(instance){if(!instance.id)return;
const dialogInfo=this.dialogs[instance.id];if(!dialogInfo)return;
const container=dialogInfo.container;app.layoutingService.appendLayoutingTask(()=>{
window.L.DomUtil.addClass(container,"fadeout");let timeoutId=null;const finallyClose=()=>{
instance.that.close(instance.id,false);clearTimeout(timeoutId)};
container.onanimationend=finallyClose;timeoutId=setTimeout(finallyClose,700)})},
getOrCreateOverlay:function(instance){if(instance.isDropdown&&instance.isSubmenu){
instance.overlay=document.body.querySelector(".jsdialog-overlay");return}
var overlay=window.L.DomUtil.get(instance.id+"-overlay");if(!overlay){if(instance.noOverlay)return;
overlay=window.L.DomUtil.create("div","jsdialog-overlay "+(
instance.cancellable&&!instance.hasOverlay?"cancellable":""),instance.containerParent);
overlay.id=instance.id+"-overlay";if(instance.cancellable){overlay.onclick=()=>{
var hasToNotifyServer=!instance.isDropdown;if(instance.isDropdown){instance.builder.callback(
"dropdown","hidedropdown",{id:instance.id},null,instance.builder)}this.close(instance.id,
hasToNotifyServer)}}}instance.overlay=overlay},isOnlyChild:function(instance){
const isMenu=instance.children&&instance.children.length&&instance.children[0].id==="__MENU__";
const isOnlyChild=instance.children&&instance.children.length&&instance.children[0
].children&&instance.children[0].children.length===1;return isMenu||isOnlyChild},
createContainer:function(instance,documentFragment){instance.container=window.L.DomUtil.create("div"
,"jsdialog-window",documentFragment);instance.container.id=instance.id;
instance.form=window.L.DomUtil.create("form",
"jsdialog-container ui-dialog ui-widget-content lokdialog_container",instance.container);
instance.form.setAttribute("role","dialog");instance.form.setAttribute("aria-labelledby",
instance.title);instance.form.setAttribute("autocomplete","off");if(!instance.clickToDismiss){
instance.container.onclick=function(e){e.stopPropagation()}}if(instance.collapsed&&(
instance.collapsed==="true"||instance.collapsed===true))window.L.DomUtil.addClass(instance.container
,"collapsed");instance.form.addEventListener("submit",event=>{event.preventDefault()});
instance.defaultButtonId=this._getDefaultButtonId(instance.children);if(this.isOnlyChild(instance)
)instance.isOnlyChild=true;var defaultButton=window.L.DomUtil.createWithId("button","default-button"
,instance.form);defaultButton.style.display="none";defaultButton.onclick=function(){if(
instance.defaultButtonId){var button=instance.form.querySelector("#"+instance.defaultButtonId);if(
button)button.click()}};if(instance.haveTitlebar){instance.titlebar=window.L.DomUtil.create("div",
"ui-dialog-titlebar ui-corner-all ui-widget-header ui-helper-clearfix",instance.form);
let title=window.L.DomUtil.create("h2","ui-dialog-title",instance.titlebar);title.setAttribute("id",
instance.title);title.innerText=instance.title;instance.titleCloseButton=window.L.DomUtil.create(
"button","ui-button ui-corner-all ui-widget ui-button-icon-only ui-dialog-titlebar-close",
instance.titlebar);const titleCloseButtonText=_("Close dialog");
instance.titleCloseButton.setAttribute("aria-label",titleCloseButtonText);
instance.titleCloseButton.setAttribute("title",titleCloseButtonText);
instance.titleCloseButton.tabIndex="0";window.L.DomUtil.create("span",
"ui-button-icon ui-icon ui-icon-closethick",instance.titleCloseButton)}if(
instance.isModalPopUp||instance.isDocumentAreaPopup||instance.isSnackbar)window.L.DomUtil.addClass(
instance.container,"modalpopup");if(instance.isModalPopUp&&!instance.popupParent
)instance.overlay.classList.add("dimmed");if(instance.isSnackbar){window.L.DomUtil.addClass(
instance.container,"snackbar");window.L.DomUtil.addClass(instance.form,"snackbar")}
instance.content=window.L.DomUtil.create("div",
"jsdialog lokdialog ui-dialog-content ui-widget-content"+(instance.isOnlyChild?" one-child-popup":""
),instance.form);this.dialogs[instance.id]={}},createDialog:function(instance){
instance.builder=new window.L.control.jsDialogBuilder({windowId:instance.id,mobileWizard:this,
map:this.map,cssClass:"jsdialog"+(instance.isAutoPopup?" autofilter":"")+(
instance.isOnlyChild?" one-child-popup":""),callback:instance.callback,suffix:"dialog"});
instance.builder.build(instance.content,[instance]);instance.builder.setContainer(instance.content);
var primaryBtn=instance.content.querySelector("#"+instance.defaultButtonId+" button");if(primaryBtn
)window.L.DomUtil.addClass(primaryBtn,"button-primary")},addFocusHandler:function(instance){if(
!instance.canHaveFocus)return;const elementToFocus=document.getElementById(instance.init_focus_id);
if(instance.init_focus_id==="input-modal-input"&&elementToFocus){elementToFocus.select()}
const failedToFindFocus=()=>{if(elementToFocus)elementToFocus.focus();else{app.console.error(
"There is no focusable element in the modal. Either focusId should be given or modal should have a response button."
);instance.that.close(instance.id,true);instance.that.map.focus()}};JSDialog.MakeFocusCycle(
instance.container,failedToFindFocus)},addHandlers:function(instance){var onInput=ev=>{if(ev.isFirst
)instance.that.draggingObject=instance.that.dialogs[instance.id];if(
ev.isFinal&&instance.that.draggingObject&&instance.that.draggingObject.translateX&&instance.that.draggingObject.translateY
){instance.that.draggingObject.startX=instance.that.draggingObject.translateX;
instance.that.draggingObject.startY=instance.that.draggingObject.translateY;
instance.that.draggingObject.translateX=0;instance.that.draggingObject.translateY=0;
instance.that.draggingObject=null}};if(instance.haveTitlebar){instance.titleCloseButton.onclick=(
)=>{instance.that.close(instance.id,true)}}if(instance.nonModal&&instance.haveTitlebar){
instance.titleCloseButton.onclick=()=>{var newestDialog=Math.max.apply(null,Object.keys(
instance.that.dialogs).map(function(i){return parseInt(i)}));if(newestDialog>parseInt(instance.id)
)return;instance.that.closeDialog(instance.id,true)};var hammerTitlebar=new Hammer(instance.titlebar
);hammerTitlebar.add(new Hammer.Pan({threshold:20,pointers:0}));hammerTitlebar.on("panstart",
this.onPan.bind(this));hammerTitlebar.on("panmove",this.onPan.bind(this));hammerTitlebar.on(
"hammer.input",onInput)}var popupParent=instance.popupParent?window.L.DomUtil.get(
instance.popupParent):null;this.addFocusHandler(instance);
var clickToCloseId=instance.clickToClose?window.L.Util.sanitizeElementId(instance.clickToClose):null
if(clickToCloseId&&clickToCloseId.indexOf(".uno:")===0)clickToCloseId=clickToCloseId.substr(
".uno:".length);var clickToCloseElement=null;if(clickToCloseId&&popupParent){
clickToCloseElement=popupParent.querySelector("[id='"+clickToCloseId+"']");if(!clickToCloseElement
)clickToCloseElement=popupParent.querySelector(".uno"+clickToCloseId);if(!clickToCloseElement
)instance.clickToCloseText=instance.clickToClose}else if(clickToCloseId){
clickToCloseElement=window.L.DomUtil.get(clickToCloseId)}instance.clickToClose=clickToCloseElement;
app.layoutingService.appendLayoutingTask(()=>{this.setupInitialFocus(instance)});if(
instance.isDropdown&&instance.isSubmenu){instance.container.addEventListener("mouseleave",()=>{
instance.builder.callback("combobox","hidedropdown",{id:instance.id},null,instance.builder)})}},
setupInitialFocus:function(instance){var initialFocusElement=JSDialog.GetFocusableElements(
instance.container);if(instance.canHaveFocus&&initialFocusElement&&initialFocusElement.length
)initialFocusElement[0].focus();const tabControlWidget=this.findTabControl(instance);let focusWidget
,firstFocusableElement;if(tabControlWidget&&!instance.init_focus_id){
focusWidget=instance.content.querySelector('[id="'+tabControlWidget.id+'"]');
firstFocusableElement=JSDialog.GetFocusableElements(focusWidget)}else{
firstFocusableElement=instance.init_focus_id?instance.container.querySelector(
"[id='"+instance.init_focus_id+"']"):null;if(!firstFocusableElement){
const focusables=JSDialog.GetFocusableElements(instance.container);if(focusables&&focusables.length
)firstFocusableElement=focusables[0]}if(firstFocusableElement&&!JSDialog.IsFocusable(
firstFocusableElement)){firstFocusableElement=JSDialog.FindFocusableWithin(firstFocusableElement,
"next")}}if(
firstFocusableElement&&document.activeElement!==firstFocusableElement&&instance.canHaveFocus){
firstFocusableElement=firstFocusableElement.length>0?firstFocusableElement[0]:firstFocusableElement;
firstFocusableElement.focus()}else if(instance.canHaveFocus!==false&&instance.init_focus_id
)app.console.error(
'JSDialog: Cannot get focus for dialog: "'+instance.id+'" with initial id: "'+instance.init_focus_id+'"'
)},findTabControl:function(obj){if(obj.type==="tabcontrol"){return obj}if(
obj.children&&obj.children.length>0){for(let child of obj.children){
const result=this.findTabControl(child);if(result)return result}}return null},setPosition:function(
instance,updatedPos){var calculated=false;var isRTL=document.documentElement.dir==="rtl";if(
instance.isSnackbar){calculated=true;instance.posx=window.innerWidth/2-instance.form.offsetWidth/2;
instance.posy=window.innerHeight-instance.form.offsetHeight-40}else if(
instance.nonModal||instance.popupParent){if(updatedPos){calculated=true;instance.posx=updatedPos.x;
instance.posy=updatedPos.y}var parent=window.L.DomUtil.get(instance.popupParent);if(
instance.clickToCloseId&&parent){var childButton=parent.querySelector(
"[id='"+instance.clickToCloseId+"']");if(childButton)parent=childButton}else if(
instance.clickToCloseText&&parent){var matchingElements;if((
matchingElements=parent.querySelectorAll("span.ui-treeview-cell-text")).length){parent=Array.from(
matchingElements).find(
value=>value.innerText===instance.clickToCloseText||value.firstChild&&value.firstChild.alt===instance.clickToCloseText
)}else if((matchingElements=parent.querySelectorAll("div.ui-iconview-entry > img")).length){
parent=Array.from(matchingElements).find(img=>img.title===instance.clickToCloseText)}}if(
!parent&&instance.popupParent==="_POPOVER_"){if(instance.isAutoPopup){return}else{app.console.warn(
"other popup than autofilter in the document area")}}if(parent){calculated=true;
instance.posx=parent.getBoundingClientRect().left;instance.posy=parent.getBoundingClientRect(
).bottom;if(instance.popupAnchor&&instance.popupAnchor.indexOf("top")>=0
)instance.posy=parent.getBoundingClientRect().top;
instance.container.style.minWidth=parent.getBoundingClientRect().width+"px";if(isRTL
)instance.posx=window.innerWidth-instance.posx;if(
instance.popupAnchor&&instance.popupAnchor.indexOf("end")>=0)instance.posx+=(isRTL?0:1
)*parent.clientWidth-15;if(instance.content.clientWidth>window.innerWidth
)instance.container.style.maxWidth=window.innerWidth-instance.posx-20+"px";else if(
instance.posx+instance.content.clientWidth>window.innerWidth
)instance.posx-=instance.posx+instance.content.clientWidth+10-window.innerWidth;if(
instance.content.clientHeight>window.innerHeight
)instance.container.style.maxHeight=window.innerHeight-instance.posy-20+"px";else if(
instance.posy+instance.content.clientHeight>window.innerHeight
)instance.posy-=instance.posy+instance.content.clientHeight+10-window.innerHeight}else{
var height=instance.form.getBoundingClientRect().height;if(
instance.posy+height>instance.containerParent.getBoundingClientRect().height){calculated=true;
var newTopPosition=instance.posy-height;if(newTopPosition<0)newTopPosition=0;
instance.posy=newTopPosition}var width=instance.form.getBoundingClientRect().width;if(isRTL
)width=width*-1;if(instance.posx+width>instance.containerParent.getBoundingClientRect().width){
calculated=true;var newLeftPosition=instance.posx-width;if(newLeftPosition<0)newLeftPosition=0;
instance.posx=newLeftPosition}}}
var positionNotSet=!instance.container.style||!instance.container.style.marginInlineStart;if(
calculated||positionNotSet)this.setNewPosition(instance.container,instance.posx,instance.posy)},
centerDialogPosition:function(instance){var isRTL=document.documentElement.dir==="rtl";
var height=instance.form.getBoundingClientRect().height;
var width=instance.form.getBoundingClientRect().width;instance.startX=instance.posx=(
window.innerWidth-(isRTL?-1*width:width))/2;instance.startY=instance.posy=(window.innerHeight-height
)/2;instance.updatePos({x:instance.posx,y:instance.posy})},parentAutofilter:null,
calculateAutoFilterPosition:function(instance){if(this.isChildAutoFilter(instance)){
this.calculateSubmenuAutoFilterPosition(instance,this.parentAutofilter);return}if(
!app.map._docLayer.sheetGeometry)return;let cellRectangle;this.parentAutofilter=instance.form;if(
app.calc.autoFilterCell){cellRectangle=app.map._docLayer.sheetGeometry.getCellSimpleRectangle(
app.calc.autoFilterCell.column,app.calc.autoFilterCell.row,app.getScale())}else if(
app.calc.pivotTableFilterCell){cellRectangle=app.map._docLayer.sheetGeometry.getCellSimpleRectangle(
app.calc.pivotTableFilterCell.column,app.calc.pivotTableFilterCell.row,app.getScale())}else{
cellRectangle=app.calc.cellCursorRectangle.clone()}
const documentAnchor=app.sectionContainer.getDocumentAnchor();if(!app.isXOrdinateInFrozenPane(
cellRectangle.pX1))cellRectangle.pX1+=documentAnchor[0
]-app.activeDocument.activeView.viewedRectangle.pX1;else cellRectangle.pX1+=documentAnchor[0];if(
!app.isYOrdinateInFrozenPane(cellRectangle.pY1))cellRectangle.pY1+=documentAnchor[1
]-app.activeDocument.activeView.viewedRectangle.pY1;else cellRectangle.pY1+=documentAnchor[1];
app.calc.autoFilterCell=null;app.calc.pivotTableFilterCell=null;
const canvasEl=this.map._docLayer._canvas.getBoundingClientRect();
instance.posy=cellRectangle.cY2+canvasEl.top;
instance.posx=cellRectangle.cX2+canvasEl.left-instance.container.offsetWidth;
this.updateAutoPopPosition(instance.container,instance.posx,instance.posy)},
isChildAutoFilter:function(instance){var rootChild=instance.children[0];if(rootChild){
var firstWidget=rootChild.children[0];
return firstWidget?firstWidget.id==="menu"&&firstWidget.type==="treelistbox":false}return false},
calculateSubmenuAutoFilterPosition:function(instance,parentAutofilter){
var parentAutofilter=parentAutofilter.getElementsByClassName("ui-treeview-entry selected")[0
].getBoundingClientRect();instance.posx=parentAutofilter.right;instance.posy=parentAutofilter.top;
var isSpreadsheetRTL=this.map._docLayer.isCalcRTL();if(isSpreadsheetRTL){
var rtlPosx=parentAutofilter.left-instance.form.getBoundingClientRect().width;
instance.posx=rtlPosx<0?0:rtlPosx}var width=instance.content.clientWidth;if(
instance.posx+width>window.innerWidth)instance.posx-=instance.posx+width-window.innerWidth;
var height=instance.form.getBoundingClientRect().height;if(instance.posy+height>window.innerHeight
)instance.posy=window.innerHeight-height;this.updateAutoPopPosition(instance.container,instance.posx
,instance.posy)},closePopupsOnTabChange:function(){var dialogKeys=Object.keys(this.dialogs);for(
var i=0;i<dialogKeys.length;i++){var autoFilterDialogId=dialogKeys[i];var dialog=this.dialogs[
autoFilterDialogId];if(dialog.isAutoPopup){this.close(autoFilterDialogId,true)}}},
getAutoPopupParentContainer(instance){if(
instance.isAutofilter||instance.isAutoCompletePopup||!instance.isDocumentAreaPopup
)return document.body;return document.getElementById("document-container")},onJSDialog:function(e){
var instance=e.data;if(this.dialogs[instance.id]&&this.dialogs[instance.id].lastFocusedElement){
instance.lastFocusedElement=this.dialogs[instance.id].lastFocusedElement}else if(!this.dialogs[
instance.id]||!this.dialogs[instance.id].lastFocusedElement){
instance.lastFocusedElement=document.activeElement}instance.callback=e.callback;
instance.isSnackbar=e.data.type==="snackbar";instance.isDropdown=e.data.type==="dropdown";
instance.isModalPopUp=e.data.type==="modalpopup"||instance.isDropdown;
instance.snackbarTimeout=e.data.timeout;instance.isOnlyChild=false;instance.that=this;
instance.startX=e.data.posx;instance.startY=e.data.posy;instance.updatePos=null;
instance.canHaveFocus=!instance.isSnackbar&&instance.id!=="busypopup"&&!instance.isAutoCompletePopup
instance.isDocumentAreaPopup=instance.popupParent==="_POPOVER_"&&instance.posx!==undefined&&instance.posy!==undefined
instance.isPopup=instance.isModalPopUp||instance.isDocumentAreaPopup||instance.isSnackbar;
instance.isAutoPopup=instance.isDocumentAreaPopup&&this.map._docLayer.isCalc();
instance.isAutofilter=instance.isAutoPopup&&!instance.isAutoFillPreviewTooltip&&!instance.isAutoCompletePopup
instance.containerParent=this.getAutoPopupParentContainer(instance);
instance.hasClose=!!instance.hasClose;
instance.haveTitlebar=instance.hasClose||!instance.isModalPopUp&&!instance.isSnackbar&&instance.hasClose||instance.title&&instance.title!==""
instance.nonModal=!instance.isModalPopUp&&!instance.isDocumentAreaPopup&&!instance.isSnackbar;if(
instance.isDocumentAreaPopup)instance.isModalPopUp=false;if(instance.popupParent==="_POPOVER_"&&(
instance.posx===undefined||instance.posy===undefined))app.console.error(
"There is a POPOVER dialogue without position information.");if(instance.action==="fadeout"){
app.console.debug('JSDialog: fadeout "'+(instance?instance.id:"-")+'"');this.fadeOutDialog(instance)
}else if(instance.action==="close"){app.console.debug('JSDialog: close "'+(instance?instance.id:"-"
)+'"');const dialogs=Object.keys(this.dialogs);const hadOpenedDialog=dialogs.length>0;this.close(
instance.id,false);if(hadOpenedDialog&&dialogs.length){var lastKey=dialogs[dialogs.length-1];
const lastDialog=this.dialogs[lastKey];const lastContainer=lastDialog.container;if(
lastDialog.canHaveFocus&&lastContainer){var initialFocusElement=JSDialog.GetFocusableElements(
lastContainer);if(initialFocusElement&&initialFocusElement.length)initialFocusElement[0].focus(
);else lastContainer.focus()}}else if(hadOpenedDialog){this.map.focus()}}else{app.console.debug(
'JSDialog: full dialog "'+(instance?instance.id:"-")+'"');if(
instance.isModalPopUp||instance.isDocumentAreaPopup)this.getOrCreateOverlay(instance);
const existingNode=this.dialogs[instance.id];if(existingNode){instance.posx=existingNode.startX;
instance.posy=existingNode.startY}if(this.map)this.map._progressBar.end();
const dialogDomParent=instance.overlay?instance.overlay:instance.containerParent;
const documentFragment=new DocumentFragment;this.createContainer(instance,documentFragment);
this.createDialog(instance);const modifyCallback=JSDialog.getDialogModificationCallback(
instance.dialogid);if(modifyCallback)modifyCallback(instance);
instance.updatePos=this.setPosition.bind(this,instance);app.layoutingService.appendLayoutingTask((
)=>{app.console.debug('JSDialog: put items inside container for "'+instance.id+'"');if(existingNode
){existingNode.container.replaceWith(instance.container)}else{instance.container.classList.add(
"fadein");dialogDomParent.append(instance.container)}this.addHandlers(instance);if(
instance.nonModal&&!(instance.startX&&instance.startY)){this.centerDialogPosition(instance)}else{
instance.updatePos()}if(instance.isAutofilter&&!instance.isAutoFillPreviewTooltip
)this.calculateAutoFilterPosition(instance);else if(
instance.isAutoFillPreviewTooltip||instance.isAutoCompletePopup){this.updateAutoPopPosition(
instance.container,instance.posx,instance.posy)}});this.dialogs[instance.id]=instance;if(
instance.isSnackbar&&instance.snackbarTimeout>0){instance.timeoutId=setTimeout(()=>{
app.map.uiManager.closeSnackbar()},instance.snackbarTimeout)}}},onJSUpdate:function(e){
var data=e.data;if(data.jsontype!=="dialog"&&data.jsontype!=="popup")return;var dialog=this.dialogs[
data.id]?this.dialogs[data.id].container:null;if(!dialog)return;
var builder=new window.L.control.jsDialogBuilder({windowId:data.id,mobileWizard:this,map:this.map,
cssClass:"jsdialog",callback:e.callback,suffix:"dialog"});builder.updateWidget(dialog,data.control);
const dialogInfos=this.dialogs;app.layoutingService.appendLayoutingTask(()=>{
var dialogInfo=dialogInfos[data.id];if(!dialogInfo){app.console.debug(
'JSDialog: dialog info with id: "'+data.id+'" not found.');if(dialog)app.console.debug(
"JSDialog: old data was: "+JSON.stringify(dialog));return}if(dialogInfo.isDocumentAreaPopup){
dialogInfo.updatePos(new cool.Point(data.posx,data.posy))}else{dialogInfo.updatePos()}})},
onJSAction:function(e){var data=e.data;var innerData=data.data;if(
data.jsontype==="formulabar"&&innerData&&innerData.separator
)app.calc.decimalSeparator=innerData.separator;if(data.jsontype!=="dialog"&&data.jsontype!=="popup"
)return;var dialog=this.dialogs[data.id];if(!dialog)return;var builder=dialog.builder;if(!builder
)return;var dialogContainer=dialog.container;if(!dialogContainer)return;
const entryChanges=data.jsontype==="popup"&&innerData.action_type&&innerData.action_type==="rendered_entry"
if(innerData.action_type==="grab_focus"){app.layoutingService.appendLayoutingTask(()=>{
var control=dialogContainer.querySelector("[id='"+innerData.control_id+"']");
var controlPosition=control?control.getBoundingClientRect():null;if(controlPosition&&(
controlPosition.bottom>window.innerHeight||controlPosition.right>window.innerWidth)){
this.centerDialogPosition(dialog)}})}builder.executeAction(dialogContainer,innerData);if(
entryChanges){app.layoutingService.appendLayoutingTask(()=>{dialog.updatePos(dialog)})}},
_clamp:function(value,min,max){return Math.min(Math.max(value,min),max)},onPan:function(ev){
const target=this.draggingObject;if(target){const isRTL=document.documentElement.dir==="rtl";
const dialogBounds=target.form.getBoundingClientRect();const width=dialogBounds.width;
const height=dialogBounds.height;const startX=target.startX?target.startX:0;
const startY=target.startY?target.startY:0;let newX=startX+ev.deltaX*(isRTL?-1:1);
let newY=startY+ev.deltaY;if(newX<0&&newX+width<window.innerWidth){newX=Math.min(0,
window.innerWidth-width)}if(newX+width>window.innerWidth&&newX>0){newX=Math.max(
window.innerWidth-width,0)}newY=this._clamp(newY,0,window.innerHeight-height);target.translateX=newX
target.translateY=newY;this.setNewPosition(target.container,newX,newY)}},
updateAutoPopPosition:function(target,newX,newY){var width=target.getBoundingClientRect().width;
var dialogBottom=newY+target.getBoundingClientRect().height;var windowBottom=window.innerHeight;if(
newX+width>window.innerWidth)newX=window.innerWidth-width;else if(newX<10)newX=10;if(
dialogBottom>windowBottom)newY=newY-(dialogBottom-windowBottom+10);this.setNewPosition(target,newX,
newY)},setNewPosition(target,newX,newY){target.style.marginInlineStart=newX+"px";
target.style.marginTop=newY+"px"},handleKeyEvent:function(event){var keyCode=event.keyCode;switch(
keyCode){case 27:var dialogKeys=Object.keys(this.dialogs);if(dialogKeys.length){
var lastKey=dialogKeys[dialogKeys.length-1];var sendCloseToServer=this.dialogs[lastKey
].isDropdown!==true;this.close(lastKey,sendCloseToServer);return true}break;case 18:if(
app.map&&app.map.jsdialog&&app.map.jsdialog.hasDialogOpened()){document.body.classList.add(
"activate-underlines")}}return false},onKeyUp:function(ev){if(
ev.keyCode===18&&app.map&&app.map.jsdialog&&app.map.jsdialog.hasDialogOpened()){
document.body.classList.remove("activate-underlines")}},onZoomEnd:function(){
var dialogs=Object.keys(this.dialogs);if(dialogs.length){var lastKey=dialogs[dialogs.length-1];
var dialogInfo=this.dialogs[lastKey];if(dialogInfo.isPopup){this.close(lastKey,true);this.map.focus(
)}}}});window.L.control.jsDialog=function(options){return new window.L.Control.JSDialog(options)};
window.L.Control.JSDialogBuilder=window.L.Control.extend({options:{windowId:null,map:null,
mobileWizard:null,cssClass:"mobile-wizard",useSetTabs:false,noLabelsForUnoButtons:false,
useInLineLabelsForUnoButtons:false},windowId:null,_controlHandlers:null,_toolitemHandlers:null,
_menuItemHandlers:null,_menus:null,_colorPickers:null,_decimal:".",_minusSign:"-",_responses:{},
_currentDepth:0,rendersCache:{fontnamecombobox:{persistent:true,images:[]},layoutpanel_icons:{
persistent:true,images:[]},transitions_icons:{persistent:true,images:[]},iconview_theme_colors:{
persistent:true,images:[]},ctlFavoriteswin:{persistent:true,images:[]}},setWindowId:function(id){
this.windowId=id},_setup:function(options){this._clearColorPickers();
this.wizard=options.mobileWizard;this.map=options.map;this.windowId=options.windowId;
this.dialogId=null;this.callback=options.callback?options.callback:this._defaultCallbackHandler;
this._colorPickers=[];this._nonContainerType=["buttonbox","treelistbox","iconview","combobox",
"listbox","scrollwindow","grid","tabcontrol","multilineedit","formulabaredit","frame"];
this._controlHandlers={};this._controlHandlers["overflowgroup"]=JSDialog.OverflowGroup;
this._controlHandlers["overflowmanager"]=JSDialog.OverflowManager;this._controlHandlers[
"radiobutton"]=JSDialog.RadioButton;this._controlHandlers["progressbar"]=JSDialog.progressbar;
this._controlHandlers["pagemarginentry"]=JSDialog.pageMarginEntry;this._controlHandlers[
"pagesizeentry"]=JSDialog.pageSizeEntry;this._controlHandlers["checkbox"]=this._checkboxControl;
this._controlHandlers["basespinfield"]=this.baseSpinField;this._controlHandlers["spinfield"
]=this._spinfieldControl;this._controlHandlers["metricfield"]=this._metricfieldControl;
this._controlHandlers["time"]=JSDialog.timeField;this._controlHandlers["formattedfield"
]=this._formattedfieldControl;this._controlHandlers["edit"]=JSDialog.edit;this._controlHandlers[
"searchedit"]=JSDialog.searchEdit;this._controlHandlers["formulabaredit"]=JSDialog.formulabarEdit;
this._controlHandlers["multilineedit"]=JSDialog.multilineEdit;this._controlHandlers["pushbutton"
]=this._pushbuttonControl;this._controlHandlers["okbutton"]=this._pushbuttonControl;
this._controlHandlers["helpbutton"]=this._pushbuttonControl;this._controlHandlers["cancelbutton"
]=this._pushbuttonControl;this._controlHandlers["combobox"]=JSDialog.combobox;this._controlHandlers[
"comboboxentry"]=JSDialog.comboboxEntry;this._controlHandlers["listbox"]=this._listboxControl;
this._controlHandlers["valueset"]=this._valuesetControl;this._controlHandlers["fixedtext"
]=this._fixedtextControl;this._controlHandlers["linkbutton"]=this._linkButtonControl;
this._controlHandlers["htmlcontrol"]=this._htmlControl;this._controlHandlers["expander"
]=this._expanderHandler;this._controlHandlers["grid"]=JSDialog.grid;this._controlHandlers[
"alignment"]=this._alignmentHandler;this._controlHandlers["buttonbox"]=JSDialog.buttonBox;
this._controlHandlers["frame"]=JSDialog.frame;this._controlHandlers["deck"]=JSDialog.deck;
this._controlHandlers["panel"]=JSDialog.panel;this._controlHandlers["calcfuncpanel"
]=this._calcFuncListPanelHandler;this._controlHandlers["tabcontrol"]=this._tabsControlHandler;
this._controlHandlers["tabpage"]=this._tabPageHandler;this._controlHandlers["singlepanel"
]=this._singlePanelHandler;this._controlHandlers["container"]=JSDialog.container;
this._controlHandlers["dialog"]=JSDialog.container;this._controlHandlers["messagebox"
]=JSDialog.container;this._controlHandlers["window"]=JSDialog.container;this._controlHandlers[
"borderwindow"]=this._borderwindowHandler;this._controlHandlers["control"]=JSDialog.container;
this._controlHandlers["scrollbar"]=this._ignoreHandler;this._controlHandlers["toolbox"
]=JSDialog.toolbox;this._controlHandlers["spacer"]=JSDialog.spacer;this._controlHandlers["toolitem"
]=this._toolitemHandler;this._controlHandlers["colorsample"]=this._colorSampleControl;
this._controlHandlers["divcontainer"]=this._divContainerHandler;this._controlHandlers["colorlistbox"
]=JSDialog.colorPickerButton;this._controlHandlers["treelistbox"]=JSDialog.treeView;
this._controlHandlers["iconview"]=JSDialog.iconView;this._controlHandlers["drawingarea"
]=JSDialog.drawingArea;this._controlHandlers["rootcomment"]=this._rootCommentControl;
this._controlHandlers["comment"]=this._commentControl;this._controlHandlers["emptyCommentWizard"
]=this._rootCommentControl;this._controlHandlers["separator"]=this._separatorControl;
this._controlHandlers["menubutton"]=JSDialog.menubuttonControl;this._controlHandlers["spinner"
]=this._spinnerControl;this._controlHandlers["spinnerimg"]=this._spinnerImgControl;
this._controlHandlers["image"]=this._imageHandler;this._controlHandlers["scrollwindow"
]=JSDialog.scrolledWindow;this._controlHandlers["customtoolitem"]=this._mapDispatchToolItem;
this._controlHandlers["bigcustomtoolitem"]=this._mapBigDispatchToolItem;this._controlHandlers[
"calendar"]=JSDialog.calendar;this._controlHandlers["htmlcontent"]=JSDialog.htmlContent;
this._controlHandlers["colorpicker"]=JSDialog.colorPicker;this._controlHandlers["dropdown"
]=JSDialog.Dropdown;this._controlHandlers["menu"]=JSDialog.treeView;this._controlHandlers["mainmenu"
]=JSDialog.container;this._controlHandlers["submenu"]=this._subMenuHandler;this._controlHandlers[
"menuitem"]=this._menuItemHandler;this._menuItemHandlers={};this._menuItemHandlers["inserttable"
]=this._insertTableMenuItem;this._toolitemHandlers={};this._toolitemHandlers[".uno:XLineColor"
]=JSDialog.colorPickerButton;this._toolitemHandlers[".uno:FontColor"]=JSDialog.colorPickerButton;
this._toolitemHandlers[".uno:CharBackColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[
".uno:BackgroundColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[
".uno:TableCellBackgroundColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[
".uno:FrameLineColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[".uno:Color"
]=JSDialog.colorPickerButton;this._toolitemHandlers[".uno:FillColor"]=JSDialog.colorPickerButton;
this._toolitemHandlers[".uno:InsertFormula"]=function(){};this._menus=JSDialog.MenuDefinitions;
this._currentDepth=0;app.localeService.initializeNumberFormatting();
this._decimal=app.localeService.getDecimalSeparator();
this._minusSign=app.localeService.getMinusSign()},reportValidity:function(){var isValid=true;if(
!this._container)return isValid;var inputs=this._container.querySelectorAll('input[type="number"]');
for(var item=0;item<inputs.length;item++){if(!inputs[item].checkVisibility())continue;
isValid=inputs[item].reportValidity();if(!isValid)break}return isValid},isContainerType:function(
type){return this._nonContainerType.indexOf(type)<0},setContainer:function(container){
this._container=container},_clearColorPickers:function(){this._colorPickers=[];ColorPicker.ID=0},
_preventDocumentLosingFocusOnClick:function(div){$(div).on("mousedown",function(e){e.preventDefault(
);e.stopPropagation()})},_toolitemHandler:function(parentContainer,data,builder){if(
data.command||data.postmessage){var handler=builder._toolitemHandlers[data.command];if(handler
)handler(parentContainer,data,builder);else if(data.text||data.command||data.postmessage){
builder._unoToolButton(parentContainer,data,builder)}else window.app.console.warn(
'Unsupported toolitem type: "'+data.command+'"')}builder.postProcess(parentContainer,data);
return false},_preventNonNumericalInput:function(e){e=e||window.event;
var charCode=typeof e.which=="undefined"?e.keyCode:e.which;var charStr=String.fromCharCode(charCode)
var regex=new RegExp("^[0-9\\"+this._decimal+"\\"+this._minusSign+"]+$");if(!charStr.match(regex)
)return e.preventDefault();var value=e.target.value;if(!value)return e.preventDefault();if(
this._decimal===charStr||this._minusSign===charStr){if(value.indexOf(charStr)>-1
)return e.preventDefault()}},_defaultCallbackHandler:function(objectType,eventType,object,data,
builder){if(builder.map.uiManager.isUIBlocked())return;if(
objectType==="responsebutton"&&data===1&&!builder.reportValidity())return;console.assert(
typeof object.id==="number"||typeof object.id==="string"&&object.id.length>0,
"Trying to send command without valid id");if(JSDialog.verbose){window.app.console.debug(
"control: '"+objectType+"' id:'"+object.id+"' event: '"+eventType+"' state: '"+data+"'")}
var viewId=builder.map&&builder.map._docLayer?builder.map._docLayer._getViewId():-1;if(viewId>=0
)app.setFollowingUser(viewId);if(builder.wizard.setCurrentScrollPosition
)builder.wizard.setCurrentScrollPosition();if(
objectType=="toolbutton"&&eventType=="click"&&data.indexOf(".uno:")>=0){
var encodedCommand=data.replace(" ","%20");builder.map.sendUnoCommand(encodedCommand)}else if(object
){if(!builder.map._docLoaded&&!window._firstDialogHandled&&(
eventType==="close"||objectType==="responsebutton"&&data==7)){let dispatcher=app.dispatcher;if(
!dispatcher)dispatcher=new app.definitions["dispatcher"]("global");dispatcher.dispatch("closeapp")}
switch(typeof data){case"string":data=JSON.stringify(data).slice(1,-1);break;case"object":
data=encodeURIComponent(JSON.stringify(data));break}
var windowId=builder.windowId!==null&&builder.windowId!==undefined?builder.windowId:window.mobileDialogId!==undefined?window.mobileDialogId:window.sidebarId!==undefined?window.sidebarId:-1
var message="dialogevent "+windowId+' {"id":"'+object.id+'", "cmd": "'+eventType+'", "data": "'+data+'", "type": "'+objectType+'"}'
app.socket.sendMessage(message);window._firstDialogHandled=true}},baseSpinField:function(
parentContainer,data,builder,customCallback){var controls={};if(data.label){var fixedTextData={
text:data.label};builder._fixedtextControl(parentContainer,fixedTextData,builder)}
var div=window.L.DomUtil.create("div",builder.options.cssClass+" spinfieldcontainer",parentContainer
);div.id=data.id;controls["container"]=div;var spinfield=window.L.DomUtil.create("input",
builder.options.cssClass+" spinfield",div);spinfield.id=data.id+"-input";spinfield.type="number";
spinfield.dir=document.documentElement.dir;spinfield.tabIndex="0";spinfield.setAttribute(
"autocomplete","off");if(!data.labelledBy){builder._addAriaLabel(spinfield,data,builder)}controls[
"spinfield"]=spinfield;if(data.unit&&data.unit!==":"){var unit=window.L.DomUtil.create("span",
builder.options.cssClass+" spinfieldunit",div);unit.textContent=builder._unitToVisibleString(
data.unit)}var getPrecision=function(data){data=Math.abs(data);var str=""+data;var dot=str.indexOf(
".");return dot>0?1/Math.pow(10,str.length-dot-1):1};if(data.min!=undefined)$(spinfield).attr("min",
data.min);if(data.max!=undefined)$(spinfield).attr("max",data.max);if(data.step!=undefined){
var step=getPrecision(data.step);var value=data.value?getPrecision(data.value):1;
var minStep=getPrecision(data.min);var maxStep=getPrecision(data.max);step=Math.min(step,value,
minStep,maxStep);$(spinfield).attr("step",step)}const isDisabled=data.enabled===false;if(isDisabled
){div.disabled=true;spinfield.setAttribute("disabled","true")}spinfield.setAttribute("aria-disabled"
,isDisabled);JSDialog.SynchronizeDisabledState(div,[spinfield]);if(data.readOnly===true)$(spinfield
).attr("readOnly","true");if(data.hidden)$(spinfield).hide();spinfield.addEventListener("change",
function(){const isCurrentlyDisabled=div.hasAttribute("disabled");var isValid=this.checkValidity();
if(!isCurrentlyDisabled&&isValid){if(customCallback)customCallback("spinfield","change",div,
this.value,builder);else builder.callback("spinfield","change",div,this.value,builder)}});
return controls},listenNumericChanges:function(data,builder,controls,customCallback){
controls.spinfield.addEventListener("change",function(){if(!this.checkValidity())return;if(
customCallback)customCallback();else builder.callback("spinfield","value",controls.container,
this.value,builder)})},_setupHandlers:function(controlElement,handlers){if(handlers){for(
var i=0;i<handlers.length;++i){var event=handlers[i].event;var handler=handlers[i].handler;if(
!app.util.isEmpty(event)&&handler){if(event==="click"){var eventData={id:controlElement.id};$(
controlElement).click(function(lhandler,leventData){return function(){lhandler(leventData)}}(handler
,eventData))}}}}},_stressAccessKey:function(element,accessKey){if(!accessKey||window.mode.isMobile(
)||window.getAccessibilityState())return;var text=element.textContent;
        var text = element.textContent;

// Наши ручные переводы для проблемных ярлыков
        var replacements = {
            "Contributor:": { text: "Соавтор:",       key: "т" },
            "Coverage:":    { text: "Охват:",         key: "х" },
            "Identifier:":  { text: "Идентификатор:", key: "и" },
            "Publisher:":   { text: "Издатель:",      key: "д" },
            "Relation:":    { text: "Связь:",         key: "з" },
            "Rights:":      { text: "Права:",         key: "п" },
            "Source:":      { text: "Источник:",      key: "и" },
            "Type:":        { text: "Тип:",           key: "т" },
        };

// Если текст входит в словарь — подменяем и текст, и accessKey
        var rep = replacements[text];
        if (rep) {
            text = rep.text;
            accessKey = rep.key;
            // обновляем «сырой» текст на элементе,
            // чтобы дальше underline делался уже по русской строке
            element.textContent = text;
        }

        var index = text.indexOf(accessKey);

var index=text.indexOf(
accessKey);if(index>=0){var title=text.replace(accessKey,'<u class="access-key">'+accessKey.replace(
"~","")+"</u>");element.innerHTML=title}},_setAccessKey:function(element,key){if(key
)element.accessKey=key},_getAccessKeyFromText:function(text){var nextChar=null;if(
text&&text.includes("~")){var index=text.indexOf("~");if(index<text.length-1){nextChar=text.charAt(
index+1)}}return nextChar},_cleanText:function(text){if(!text)return"";if(text.endsWith("...")
)text=text.slice(0,-3);if(text.endsWith("…"))text=text.slice(0,-1);return text.replace("~","")},
_extractUnits:function(text){if(!text)return"";return text.replace(/[\d.-]/g,"").trim()},
_cleanValueFromUnits:function(text){if(!text)return"";return text.replace(/[^\d.-]/g,"").trim()},
_gradientStyleToLabel:function(state){switch(state){case"NONE":return _("None");case"SOLID":
return _("Solid");case"LINEAR":return _("Linear");case"AXIAL":return _("Axial");case"RADIAL":
return _("Radial");case"ELLIPTICAL":return _("Ellipsoid");case"SQUARE":return _("Quadratic");
case"RECT":return _("Square");case"MAKE_FIXED_SIZE":return _("Fixed size")}return""},
_borderwindowHandler:function(parentContainer,data,builder){if(data.visible===false){for(
var i in data.children)data.children[i].visible=false}return JSDialog.container(parentContainer,data
,builder)},_handleResponses:function(data,builder){if(data.responses){for(var i in data.responses){
builder._responses[data.responses[i].id]=data.responses[i].response}}},_tabPageHandler:function(
parentContainer,data,builder){var page=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-tabpage",parentContainer);page.id=data.id;builder.build(page,
data.children,false);return false},_alignmentHandler:function(parentContainer,data,builder){
window.L.DomUtil.addClass(parentContainer,"ui-alignment");return JSDialog.container(parentContainer,
data,builder)},_ignoreHandler:function(){return false},_getGridColumns:function(children){
var columns=0;for(var index in children){if(parseInt(children[index].left)>columns)columns=parseInt(
children[index].left)}return columns+1},_getGridRows:function(children){var rows=0;for(
var index in children){if(parseInt(children[index].top)>rows)rows=parseInt(children[index].top)}
return rows+1},_explorableEntry:function(parentContainer,data,content,builder,valueNode,iconURL,
updateCallback){var mainContainer=window.L.DomUtil.create("div",
"ui-explorable-entry level-"+builder._currentDepth+" "+builder.options.cssClass,parentContainer);if(
data){if(data.id)mainContainer.id=data.id;if(data.name)mainContainer.id=data.name}
var sectionTitle=window.L.DomUtil.create("div",
"ui-header level-"+builder._currentDepth+" "+builder.options.cssClass+" ui-widget",mainContainer);$(
sectionTitle).css("justify-content","space-between");if(data.enabled==="false"||data.enabled===false
){mainContainer.disabled=true;$(mainContainer).addClass("disabled")}
var leftDiv=window.L.DomUtil.create("div","ui-header-left",sectionTitle);var titleClass="";switch(
sectionTitle.id){case"paperformat":case"orientation":case"masterslide":case"SdTableDesignPanel":
case"ChartTypePanel":case"rotation":iconURL="lc_"+sectionTitle.id.toLowerCase()+".svg";break}if(
iconURL){var icon=window.L.DomUtil.create("img","menu-entry-icon",leftDiv);app.LOUtil.setImage(icon,
iconURL,builder.map);icon.alt="";titleClass="menu-entry-with-icon"}
var titleSpan=window.L.DomUtil.create("span",titleClass,leftDiv);if(!valueNode&&data.command){
var items=builder.map["stateChangeHandler"];var val=items.getItemValue(data.command);if(val
)valueNode=window.L.DomUtil.create("div","",null)}var rightDiv=window.L.DomUtil.create("div",
"ui-header-right",sectionTitle);if(valueNode){var valueDiv=window.L.DomUtil.create("div",
"entry-value",rightDiv);valueDiv.appendChild(valueNode)}var arrowSpan=window.L.DomUtil.create("span"
,"sub-menu-arrow",rightDiv);arrowSpan.textContent=">";var updateFunction=function(titleSpan){
titleSpan.innerHTML=data.text};updateCallback?updateCallback(titleSpan):updateFunction(titleSpan);
var contentDiv=window.L.DomUtil.create("div",
"ui-content level-"+builder._currentDepth+" "+builder.options.cssClass,mainContainer);
contentDiv.title=data.text;var contentData=content.length?content:[content];
var contentNode=contentData.length===1?contentData[0]:null;builder._currentDepth++;builder.build(
contentDiv,contentData);builder._currentDepth--;if(!data.nosubmenu){$(contentDiv).hide();if(
builder.wizard){$(sectionTitle).click(function(event,data){if(!mainContainer.hasAttribute("disabled"
)){builder.wizard.goLevelDown(mainContainer,data);if(
contentNode&&contentNode.onshow&&!builder.wizard._inBuilding)contentNode.onshow()}});if(
mainContainer.hasAttribute("disabled")){$(arrowSpan).hide()}}else{window.app.console.debug(
"Builder used outside of mobile wizard: please implement the click handler")}}else $(sectionTitle
).hide()},_calcFunctionEntry:function(parentContainer,data,contentNode,builder){
var mainContainer=window.L.DomUtil.create("div",
"ui-explorable-entry level-"+builder._currentDepth+" "+builder.options.cssClass,parentContainer);
var sectionTitle=window.L.DomUtil.create("div",
"func-entry ui-header level-"+builder._currentDepth+" "+builder.options.cssClass+" ui-widget",
mainContainer);$(sectionTitle).css("justify-content","space-between");if(data&&data.id
)sectionTitle.id=data.id;var leftDiv=window.L.DomUtil.create("div","ui-header-left",sectionTitle);
var titleClass="func-name";var titleSpan=window.L.DomUtil.create("span",titleClass,leftDiv);
titleSpan.textContent=data.text;var rightDiv=window.L.DomUtil.create("div","ui-header-right",
sectionTitle);var arrowSpan=window.L.DomUtil.create("div","func-info-icon",rightDiv);
arrowSpan.textContent="";var contentDiv=window.L.DomUtil.create("div",
"ui-content level-"+builder._currentDepth+" "+builder.options.cssClass,mainContainer);
contentDiv.title=data.text;builder._currentDepth++;builder.build(contentDiv,[contentNode]);
builder._currentDepth--;$(contentDiv).hide();if(builder.wizard){var that=this;
var functionName=data.functionName;$(rightDiv).click(()=>{builder.wizard.goLevelDown(mainContainer);
if(contentNode.onshow)contentNode.onshow()});$(leftDiv).click(()=>{if(functionName!==""){
app.socket.sendMessage("completefunction name="+functionName);that.map.fire("closemobilewizard")}})
}else{window.app.console.debug(
"Builder used outside of mobile wizard: please implement the click handler")}},
_expanderHandler:function(parentContainer,data,builder,customCallback){if(data.children.length>0){
var container=window.L.DomUtil.create("div","ui-expander-container "+builder.options.cssClass,
parentContainer);container.id=data.id;var expanded=data.expanded===true||data.children[0
]&&data.children[0].checked===true;if(data.children[0].text&&data.children[0].text!==""){
var prefix=data.children[0].id?data.children[0].id:data.id;var expander=window.L.DomUtil.create(
"button","ui-expander "+builder.options.cssClass,container);expander.tabIndex="0";
expander.setAttribute("aria-controls",prefix+"-children");var label=window.L.DomUtil.create("span",
"ui-expander-label "+builder.options.cssClass,expander);label.innerText=builder._cleanText(
data.children[0].text);label.id=prefix+"-label";if(data.children[0].visible===false
)window.L.DomUtil.addClass(label,"hidden");builder.postProcess(expander,data.children[0]);
var state=data.children.length>1&&expanded;if(state){window.L.DomUtil.addClass(label,"expanded")}
expander.setAttribute("aria-expanded",state);var toggleFunction=function(){if(customCallback
)customCallback();else builder.callback("expander","toggle",data,null,builder);
var state=expander.getAttribute("aria-expanded")==="true";expander.setAttribute("aria-expanded",
!state);$(label).toggleClass("expanded");$(expander).siblings().toggleClass("expanded");
const currentState=expander.getAttribute("aria-expanded")==="true";expander.setAttribute(
"aria-expanded",(!currentState).toString())};$(expander).click(toggleFunction);$(expander).keypress(
function(event){if(event.which===13){toggleFunction();event.preventDefault()}})}
var expanderChildren=window.L.DomUtil.create("div","ui-expander-content "+builder.options.cssClass,
container);expanderChildren.id=prefix+"-children";if(expanded){if(data.children.length>1){
label.classList.add("expanded");expander.setAttribute("aria-expanded","true")}
expanderChildren.classList.add("expanded")}else{expander.setAttribute("aria-expanded","false")}
var children=[];var startPos=1;if(data.children[0].type==="grid"||data.children[0
].type==="container"){startPos=0}for(var i=startPos;i<data.children.length;i++){if(data.children[i
].visible===false)data.children[i].visible=true;children.push(data.children[i])}builder.build(
expanderChildren,children)}else{return true}return false},_generateMenuIconName:function(commandName
){if(commandName.indexOf("?")===-1){if(commandName.indexOf("InsertDateContentControl")!==-1
)return"insertdatefield";return commandName.toLowerCase()}if(commandName.indexOf(
"SpellCheckIgnoreAll")!==-1)return"spellcheckignoreall";if(commandName.indexOf("SpellCheckIgnore"
)!==-1)return"spellcheckignore";if(
commandName==="LanguageStatus?Language:string=Current_LANGUAGE_NONE")return"selectionlanugagenone";
if(commandName==="LanguageStatus?Language:string=Current_RESET_LANGUAGES"
)return"selectionlanugagedefault";if(
commandName==="LanguageStatus?Language:string=Paragraph_LANGUAGE_NONE")return"paragraphlanugagenone"
if(commandName==="LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES"
)return"paragraphlanugagedefault";if((this.map.getDocType()==="spreadsheet"||this.map.getDocType(
)==="presentation")&&commandName.indexOf("LanguageStatus?Language:string=Paragraph_")!==-1
)return"paragraphlanugagesuggestion";if((this.map.getDocType()==="spreadsheet"||this.map.getDocType(
)==="presentation")&&commandName.indexOf("LanguageStatus?Language:string=Current_")!==-1
)return"selectionlanugagesuggestion";return commandName.toLowerCase()},_explorableMenu:function(
parentContainer,title,children,builder,customContent,dataid){dataid=dataid||0;var icon=null;
var mainContainer=window.L.DomUtil.create("div",
"ui-explorable-entry level-"+builder._currentDepth+" "+builder.options.cssClass,parentContainer);
var sectionTitle=window.L.DomUtil.create("div",
"ui-header level-"+builder._currentDepth+" "+builder.options.cssClass+" ui-widget",mainContainer);$(
sectionTitle).css("justify-content","space-between");var commandName=dataid;if(
commandName&&commandName.length&&app.LOUtil.existsIconForCommand(commandName,builder.map.getDocType(
))){var iconName=builder._generateMenuIconName(commandName);var iconSpan=window.L.DomUtil.create(
"span","menu-entry-icon "+iconName,sectionTitle);iconName=app.LOUtil.getIconNameOfCommand(iconName,
true);icon=window.L.DomUtil.create("img","",iconSpan);app.LOUtil.setImage(icon,iconName,builder.map)
icon.alt="";var titleSpan2=window.L.DomUtil.create("span","menu-entry-with-icon flex-fullwidth",
sectionTitle);titleSpan2.innerHTML=title}else{var titleSpan=window.L.DomUtil.create("span",
"sub-menu-title",sectionTitle);titleSpan.innerHTML=title}var arrowSpan=window.L.DomUtil.create(
"span","sub-menu-arrow",sectionTitle);arrowSpan.textContent=">";
var contentDiv=window.L.DomUtil.create("div",
"ui-content level-"+builder._currentDepth+" "+builder.options.cssClass,mainContainer);
contentDiv.title=title;if(customContent){contentDiv.appendChild(customContent)}else{
builder._currentDepth++;for(var i=0;i<children.length;i++){builder.build(contentDiv,[children[i]])}
builder._currentDepth--}$(contentDiv).hide();if(builder.wizard){$(sectionTitle).click(()=>{
builder.wizard.goLevelDown(mainContainer)})}else{window.app.console.debug(
"Builder used outside of mobile wizard: please implement the click handler")}},
_calcFuncListPanelHandler:function(parentContainer,data,builder){var contentNode=data.children[0];
builder._calcFunctionEntry(parentContainer,data,contentNode,builder);return false},
_createTabClick:function(builder,t,tabs,contentDivs,tabIds){return function(){$(tabs[t]).addClass(
"selected");tabs[t].tabIndex="0";tabs[t].setAttribute("aria-selected","true");for(
var i=0;i<tabs.length;i++){if(i!==t){$(tabs[i]).removeClass("selected");$(contentDivs[i]).addClass(
"hidden");tabs[i].setAttribute("aria-selected","false");tabs[i].tabIndex=-1}}$(contentDivs[t]
).removeClass("hidden");builder.wizard.selectedTab(tabIds[t])}},_tabsControlHandler:function(
parentContainer,data,builder,tabTooltip){if(tabTooltip===undefined){tabTooltip=""}if(data.tabs){
var tabs=0;for(var tabIdx=0;data.children&&tabIdx<data.children.length;tabIdx++){if(data.children[
tabIdx].type==="tabpage"||data.vertical)tabs++}var isMultiTabJSON=tabs>1;
var tabWidgetRootContainer=window.L.DomUtil.create("div","ui-tabs-root "+builder.options.cssClass,
parentContainer);tabWidgetRootContainer.id=data.id;var tabsContainer=window.L.DomUtil.create("div",
"ui-tabs "+builder.options.cssClass+" ui-widget",
builder.options.useSetTabs?undefined:tabWidgetRootContainer);tabsContainer.setAttribute("role",
"tablist");var contentsContainer=window.L.DomUtil.create("div",
"ui-tabs-content "+builder.options.cssClass,tabWidgetRootContainer);var tabs=[];var contentDivs=[];
var tabIds=[];var singleTabId=null;for(var tabIdx=0;tabIdx<data.tabs.length;tabIdx++){
var item=data.tabs[tabIdx];var contentDiv=window.L.DomUtil.create("div",
"ui-content level-"+builder._currentDepth+" "+builder.options.cssClass,contentsContainer);
contentDiv.id=item.name;contentDiv.setAttribute("role","tabpanel");var title=builder._cleanText(
item.text);var tab=window.L.DomUtil.create("button","ui-tab "+builder.options.cssClass,tabsContainer
);tab.id=Number.isInteger(parseInt(item.id))?data.id+"-"+item.id:item.id;contentDiv.setAttribute(
"aria-labelledby",tab.id);tab.textContent=title;tab.setAttribute("role","tab");tab.setAttribute(
"aria-controls",contentDiv.id);builder._addAriaLabel(tab,item,builder);builder._setAccessKey(tab,
builder._getAccessKeyFromText(item.text));builder._stressAccessKey(tab,tab.accessKey);
var isSelectedTab=data.selected==item.id;if(isSelectedTab){$(tab).addClass("selected");
tab.setAttribute("aria-selected","true");tab.tabIndex="0";tab.setAttribute("data-cooltip",tabTooltip
);singleTabId=tabIdx}else{tab.setAttribute("aria-selected","false");tab.tabIndex=-1}
var tabContext=item.context;if(tabContext){
var tabHasCurrentContext=builder.map.context.context!==""&&tabContext.indexOf(
builder.map.context.context)!==-1;var tabHasDefultContext=tabContext.indexOf("default")!==-1;if(
!tabHasCurrentContext&&!tabHasDefultContext){$(tab).addClass("hidden")}}tabs[tabIdx]=tab;tabIds[
tabIdx]=item.name;if(!isSelectedTab)$(contentDiv).addClass("hidden");contentDivs[tabIdx]=contentDiv}
if(builder.wizard){if(builder.options.useSetTabs)builder.wizard.setTabs(tabsContainer,builder);
tabs.forEach(function(tab,index){var eventHandler=builder._createTabClick(builder,index,tabs,
contentDivs,tabIds);tab.addEventListener("click",function(event){eventHandler(event);if(
!data.noCoreEvents){builder.callback("tabcontrol","selecttab",tabWidgetRootContainer,index,builder)}
})});JSDialog.KeyboardTabNavigation(tabs,contentDivs)}else{window.app.console.debug(
"Builder used outside of mobile wizard: please implement the click handler")}}if(isMultiTabJSON){
var tabId=0;for(var tabIdx=0;tabIdx<data.children.length;tabIdx++){var tab=data.children[tabIdx];if(
tab.type!=="tabpage"&&!data.vertical)continue;builder.build(contentDivs[tabId],[tab],false,false);
tabId++}}else{for(var tabIdx=0;tabIdx<data.children.length;tabIdx++){var tab=data.children[tabIdx];
if(tab.type!=="tabpage"&&!data.vertical)continue;builder.build(contentDivs[singleTabId],[tab],false,
false);break}}if(data.tabs&&data.isNotebookbar){let that=this;contentDivs.forEach(function(tabPage){
tabPage.addEventListener("keydown",function(e){let key;if(e.key==="Tab"){
key=e.shiftKey?"ArrowLeft":"ArrowRight"}else{key=e.key}if(["ArrowUp","ArrowDown","ArrowLeft",
"ArrowRight"].includes(key)){var currentElement=e.srcElement;if(!(
currentElement.tagName==="INPUT"||currentElement.tagName==="TEXTAREA")){if(e.key==="Tab"
)e.preventDefault();let container=document.getElementsByClassName("ui-tabs-content notebookbar");
let elementToFocus=JSDialog.FindNextElementInContainer(container[0],currentElement,key);if(
elementToFocus&&elementToFocus.tagName!=="NAV")elementToFocus.focus();else if(elementToFocus
)document.querySelector(".ui-tab.notebookbar.selected").focus();else{
let visibleContainer=Array.from(container[0].children).find(child=>!child.classList.contains(
"hidden")&&child.offsetParent!==null);let focusables=visibleContainer?Array.from(
visibleContainer.querySelectorAll('[tabindex="-1"]:not([disabled])')):[];if(focusables.length){
let first=focusables[0];let last=focusables[focusables.length-1];if(
e.shiftKey&&currentElement===first)last.focus();else if(!e.shiftKey&&currentElement===last
)first.focus();else(e.shiftKey?last:first).focus()}}}}}.bind(that))})}return false},
_singlePanelHandler:function(parentContainer,data,builder){var item=data[0];if(item.children){
var child=item.children[0];builder.build(parentContainer,[child])}return false},
_checkboxControl:function(parentContainer,data,builder){var div=window.L.DomUtil.createWithId("div",
data.id,parentContainer);window.L.DomUtil.addClass(div,"checkbutton");window.L.DomUtil.addClass(div,
builder.options.cssClass);var checkbox=window.L.DomUtil.create("input",builder.options.cssClass,div)
checkbox.type="checkbox";checkbox.id=data.id+"-input";checkbox.tabIndex="0";
var checkboxLabel=window.L.DomUtil.create("label",builder.options.cssClass,div);
checkboxLabel.id=data.id+"-label";checkboxLabel.textContent=builder._cleanText(data.text);
checkboxLabel.htmlFor=data.id+"-input";var toggleFunction=function(){if(div.hasAttribute("disabled")
)return;builder.callback("checkbox","change",div,this.checked,builder)};
const isDisabled=data.enabled===false;if(isDisabled){div.setAttribute("disabled","true");
div.disabled=true;checkbox.setAttribute("disabled","true");checkbox.disabled=true;
checkbox.setAttribute("aria-disabled",true)}JSDialog.SynchronizeDisabledState(div,[checkbox,
checkboxLabel]);checkbox.addEventListener("change",toggleFunction);var updateFunction=function(){if(
div.hasAttribute("disabled"))return;var state=data.checked;if(
state&&state==="true"||state===true||state===1||state==="1")$(checkbox).prop("checked",true
);else if(state)$(checkbox).prop("checked",false)};updateFunction();if(data.hidden)$(checkbox).hide(
);return false},_unitToVisibleString:function(unit){if(unit=="inch"){return'"'}else if(
unit=="percent"){return"%"}else if(unit=="degree"){return"°"}return unit},
_getUnoStateForItemId:function(id,builder){var items=builder.map["stateChangeHandler"];
var state=null;switch(id){case"fillattr":state=items.getItemValue(".uno:FillPageColor");if(state){
return state}break;case"fillattr2":state=items.getItemValue(".uno:FillPageGradient");if(state){
return state.startcolor}break;case"fillattr3":state=items.getItemValue(".uno:FillPageGradient");if(
state){return state.endcolor}break;case"gradientstyle":state=items.getItemValue(".uno:FillGradient")
if(state){return builder._gradientStyleToLabel(state.style)}break;case"gradangle":
state=items.getItemValue(".uno:FillGradient");if(state){return state.angle}break;case"fillgrad1":
state=items.getItemValue(".uno:FillGradient");if(state){return state.startcolor}break;
case"fillgrad2":state=items.getItemValue(".uno:FillGradient");if(state){return state.endcolor}break;
case"LB_SHADOW_COLOR":state=items.getItemValue(".uno:FillShadowColor");if(state){return state}break}
return null},_getTitleForControlWithId:function(id){switch(id){case"fillgrad1":return _("From");
case"fillgrad2":return _("To");case"LB_SHADOW_COLOR":return _("Color")}return null},
_spinfieldControl:function(parentContainer,data,builder,customCallback){
var controls=builder._controlHandlers["basespinfield"](parentContainer,data,builder,customCallback);
var updateFunction=function(){if(data.text!=undefined)var value=data.text;else if(
data.children&&data.children.length)value=data.children[0].text;$(controls.spinfield).val(
builder._cleanValueFromUnits(value))};controls.spinfield.addEventListener("change",function(){if(
customCallback)customCallback();else builder.callback("spinfield","set",controls.container,
this.value,builder)});updateFunction();return false},_formattedfieldControl:function(parentContainer
,data,builder,customCallback){var value,units,controls;if(!data.unit&&data.text){
var units=data.text.split(" ");if(units.length==2){data.unit=units[1]}}if(!data.unit&&data.text){
data.unit=builder._extractUnits(data.text.toString())}controls=builder._controlHandlers[
"basespinfield"](parentContainer,data,builder,customCallback);if(
!window.L.Browser.cypressTest&&!window.L.Browser.chrome){
controls.spinfield.onkeypress=window.L.bind(builder._preventNonNumericalInput,builder)}
builder.listenNumericChanges(data,builder,controls,customCallback);value=parseFloat(data.value);$(
controls.spinfield).val(value);return false},_metricfieldControl:function(parentContainer,data,
builder,customCallback){var value;var controls=builder._controlHandlers["basespinfield"](
parentContainer,data,builder,customCallback);if(
!window.L.Browser.cypressTest&&!window.L.Browser.chrome){
controls.spinfield.onkeypress=window.L.bind(builder._preventNonNumericalInput,builder)}
builder.listenNumericChanges(data,builder,controls,customCallback);value=parseFloat(data.value);$(
controls.spinfield).val(value);return false},_customPushButtonTextForId:function(buttonId){if(
buttonId=="validref")return _("Select range");return""},_pushbuttonControl:function(parentContainer,
data,builder,customCallback){if(data.id&&data.id==="changepass"&&builder.map["wopi"].IsOwner===false
){data.enabled=false}var wrapperClass=window.mode.isMobile()?"":"d-flex justify-content-center";
var wrapper=window.L.DomUtil.create("div",
wrapperClass+" ui-pushbutton-wrapper "+builder.options.cssClass,parentContainer);wrapper.id=data.id;
var pushbutton=window.L.DomUtil.create("button","ui-pushbutton "+builder.options.cssClass,wrapper);
pushbutton.setAttribute("tabindex","0");builder._setAccessKey(pushbutton,
builder._getAccessKeyFromText(data.text));var pushbuttonText=builder._customPushButtonTextForId(
data.id)!==""?builder._customPushButtonTextForId(data.id):builder._cleanText(data.text);var image;
if(data.image&&pushbuttonText!==""){window.L.DomUtil.addClass(pushbutton,
"has-img d-flex align-content-center justify-content-center align-items-center");
image=window.L.DomUtil.create("img","",pushbutton);image.src=data.image;
var text=window.L.DomUtil.create("span","",pushbutton);text.innerText=pushbuttonText;
builder._stressAccessKey(text,pushbutton.accessKey)}else if(data.image){window.L.DomUtil.addClass(
pushbutton,"has-img d-flex align-content-center justify-content-center align-items-center");
image=window.L.DomUtil.create("img","",pushbutton);builder._isStringLCIcon(data.image
)?app.LOUtil.setImage(image,data.image,builder.map):image.src=data.image}else if(data.symbol){
window.L.DomUtil.addClass(pushbutton,
"has-img d-flex align-content-center justify-content-center align-items-center");
image=window.L.DomUtil.create("img","",pushbutton);app.LOUtil.setImage(image,
"symbol_"+data.symbol+".svg",builder.map)}else{pushbutton.innerText=pushbuttonText;
builder._stressAccessKey(pushbutton,pushbutton.accessKey)}if(image)image.alt="";
const isDisabled=data.enabled===false;if(isDisabled){wrapper.setAttribute("disabled","disabled");
wrapper.setAttribute("aria-disabled",true)}JSDialog.SynchronizeDisabledState(wrapper,[pushbutton]);
if(data.isToggle){wrapper.classList.add("ui-toggle");if(data.checked===true)wrapper.classList.add(
"checked")}if(customCallback)pushbutton.onclick=customCallback;else if(builder._responses[data.id
]!==undefined)pushbutton.onclick=builder.callback.bind(builder,"responsebutton","click",{id:data.id}
,builder._responses[data.id],builder);else pushbutton.onclick=builder.callback.bind(builder,
"pushbutton",data.isToggle?"toggle":"click",wrapper,data.command,builder);if(data.labelledBy){
pushbutton.setAttribute("aria-labelledby",data.labelledBy)}else{builder._addAriaLabel(pushbutton,
data,builder)}const tooltipText=data.aria&&data.aria.label||data.text;if(
!pushbuttonText&&tooltipText){pushbutton.setAttribute("data-cooltip",builder._cleanText(tooltipText)
);window.L.control.attachTooltipEventListener(pushbutton,builder.map)}
builder.map.hideRestrictedItems(data,wrapper,pushbutton);builder.map.disableLockedItem(data,wrapper,
pushbutton);if(data.hidden)$(wrapper).hide();return false},_linkButtonControl:function(
parentContainer,data,builder){var textContent=window.L.DomUtil.create("label",
builder.options.cssClass+" ui-linkbutton",parentContainer);if(data.labelFor
)textContent.htmlFor=data.labelFor+"-input";if(data.text)textContent.textContent=builder._cleanText(
data.text);else if(data.html)textContent.innerHTML=data.html;
var accKey=builder._getAccessKeyFromText(data.text);builder._stressAccessKey(textContent,accKey);
app.layoutingService.appendLayoutingTask(function(){var labelledControl=document.getElementById(
data.labelFor);if(labelledControl){var target=labelledControl;
var input=labelledControl.querySelector("input");if(input)target=input;
var select=labelledControl.querySelector("select");if(select)target=select;builder._setAccessKey(
target,accKey)}});textContent.id=data.id;if(data.style&&data.style.length){
window.L.DomUtil.addClass(textContent,data.style)}else{window.L.DomUtil.addClass(textContent,
"ui-text")}if(data.hidden)$(textContent).hide();var clickFunction=function(){builder.callback(
"linkbutton","click",data,null,builder)};$(textContent).click(clickFunction);return false},
_setIconAndNameForCombobox:function(data){if(data.command==".uno:CharFontName"){data.text=_(
"Font Name")}else if(data.command==".uno:FontHeight"){data.text=_("Font Size")}else if(
data.command==".uno:StyleApply"){data.text=_("Style")}},_listboxControl:function(parentContainer,
data,builder){var title=data.text;var selectedEntryIsString=false;if(data.selectedEntries){
selectedEntryIsString=isNaN(parseInt(data.selectedEntries[0]));if(title&&title.length){}else if(
selectedEntryIsString)title=builder._cleanText(data.selectedEntries[0]);else if(
data.entries&&data.entries.length>data.selectedEntries[0])title=data.entries[data.selectedEntries[0]
]}title=builder._cleanText(title);var container=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-listbox-container ",parentContainer);container.id=data.id;
var listbox=window.L.DomUtil.create("select",builder.options.cssClass+" ui-listbox ",container);
listbox.id=data.id+"-input";if(data.labelledBy)listbox.setAttribute("aria-labelledby",
data.labelledBy);var listboxArrow=window.L.DomUtil.create("span",
builder.options.cssClass+" ui-listbox-arrow",container);listboxArrow.id="listbox-arrow-"+data.id;if(
data.enabled===false){container.disabled=true;listbox.disabled=true;container.setAttribute(
"disabled","true")}JSDialog.SynchronizeDisabledState(container,[listbox]);$(listbox).change(()=>{if(
$(listbox).val())builder.callback("combobox","selected",data,$(listbox).val()+";"+$(listbox
).children("option:selected").text(),builder)});var hasSelectedEntry=false;if(
typeof data.entries==="object"){for(var index in data.entries){var isSelected=false;if(
data.selectedEntries&&index==data.selectedEntries[0
]||data.selectedEntries&&selectedEntryIsString&&data.entries[index]===data.selectedEntries[0
]||data.entries[index]==title){isSelected=true}var option=window.L.DomUtil.create("option","",
listbox);option.value=index;option.innerText=data.entries[index];if(isSelected){option.selected=true
hasSelectedEntry=true}}}if(!hasSelectedEntry){if(title){var newOption=window.L.DomUtil.create(
"option","",listbox);newOption.value=++index;newOption.innerText=title;newOption.selected=true
}else $(listbox).val("")}return false},_valuesetControl:function(parentContainer,data,builder){
var elem;var image;var image64;if(!data.entries||data.entries.length===0){return false}for(
var index in data.entries){image=data.entries[index].image;image64=data.entries[index].image64;if(
image){image=image.substr(0,image.lastIndexOf("."));image=image.substr(image.lastIndexOf("/")+1);
image='url("'+app.LOUtil.getImageURL(image+".svg")+'")'}if(image64){image='url("'+image64+'")'}
app.LOUtil.checkIfImageExists(image);elem=window.L.DomUtil.create("div","layout "+(data.entries[
index].selected?" cool-context-down":""),parentContainer);$(elem).data("id",data.entries[index].id);
$(elem).click(function(){builder.callback("valueset","selected",{id:data.id},$(this).data("id"),
builder)});elem.style.setProperty("background",image+" no-repeat center","important")}return false},
_fixedtextControl:function(parentContainer,data,builder){if(data.renderAsStatic
)return JSDialog.StaticText(parentContainer,data,builder);var fixedtext=window.L.DomUtil.create(
"label",builder.options.cssClass,parentContainer);if(data.labelFor
)fixedtext.htmlFor=data.labelFor+"-input";if(data.text)fixedtext.textContent=builder._cleanText(
data.text);else if(data.html)fixedtext.innerHTML=data.html;var accKey=builder._getAccessKeyFromText(
data.text);builder._stressAccessKey(fixedtext,accKey);const labelableElements=["INPUT","SELECT",
"TEXTAREA","BUTTON","METER","OUTPUT","PROGRESS"];const updateLabelForAttribute=function(label,
labelledControl){if(labelledControl.hasAttribute("aria-labelledby")){label.removeAttribute("for")
}else if(!labelableElements.includes(labelledControl.nodeName
)||labelledControl.nodeName==="INPUT"&&labelledControl.type==="hidden"){
labelledControl.setAttribute("aria-labelledby",label.id);label.removeAttribute("for")}else{
label.htmlFor=labelledControl.id}};app.layoutingService.appendLayoutingTask(function(){if(
!data.labelFor)return;var labelledControl=document.getElementById(data.labelFor);if(labelledControl
){var target=labelledControl;var input=labelledControl.querySelector("input");if(input)target=input;
var select=labelledControl.querySelector("select");if(select)target=select;builder._setAccessKey(
target,accKey)}app.layoutingService.appendLayoutingTask(function(){
var targetElement=document.getElementById(data.labelFor+"-input-"+builder.options.suffix
)||document.getElementById(data.labelFor+"-input")||document.getElementById(data.labelFor);if(
targetElement)updateLabelForAttribute(fixedtext,targetElement)})});fixedtext.id=data.id;if(
data.style&&data.style.length){window.L.DomUtil.addClass(fixedtext,data.style)}else{
window.L.DomUtil.addClass(fixedtext,"ui-text")}if(data.hidden)$(fixedtext).hide();return false},
_separatorControl:function(parentContainer,data,builder){if(
data.orientation&&data.orientation==="vertical"){var separator=window.L.DomUtil.create("div",
builder.options.cssClass+" ui-separator vertical",parentContainer)}else{
separator=window.L.DomUtil.create("hr",builder.options.cssClass+" ui-separator horizontal",
parentContainer)}separator.id=data.id;return false},_spinnerControl:function(parentContainer,data,
builder){var spinner=window.L.DomUtil.create("div",builder.options.cssClass+" spinner",
parentContainer);spinner.id=data.id;return false},_spinnerImgControl:function(parentContainer,data,
builder){var svgElement=document.createElementNS("http://www.w3.org/2000/svg","svg");
svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg");svgElement.setAttribute("width","298")
svgElement.setAttribute("height","192");
svgElement.innerHTML='<defs> <linearGradient id="spinner-shadow-bottom-linearGradient" x1="131.73" x2="184.28" y1="124.94" y2="177.49" gradientUnits="userSpaceOnUse"> <stop stop-color="#e6e6e6" offset="0"/> <stop stop-color="#ccc" stop-opacity="0" offset="1"/> </linearGradient> <linearGradient id="spinner-shadow-top-linearGradient" x1="130.72" x2="203.26" y1="151.3" y2="118.61" gradientUnits="userSpaceOnUse"> <stop stop-color="#e6e6e6" offset="0"/> <stop stop-color="#b3b3b3" stop-opacity="0" offset="1"/> </linearGradient> <linearGradient id="spinner-paper-linearGradient" x1="166.04" x2="106.19" y1="71.233" y2="36.679" gradientUnits="userSpaceOnUse"> <stop stop-color="#b3d3e5" offset="0"/> <stop stop-color="#d9e9f2" offset="1"/> </linearGradient> <linearGradient id="spinner-paper-fold-linearGradient" x1="167.16" x2="175.12" y1="46.783" y2="51.379" gradientUnits="userSpaceOnUse"> <stop stop-color="#68a7ca" offset="0"/> <stop stop-color="#4290bd" offset="1"/> </linearGradient> <linearGradient id="spinner-inner-left-linearGradient" x1="114.56" x2="142.35" y1="103.94" y2="103.94" gradientUnits="userSpaceOnUse"> <stop stop-color="#4290bd" offset="0"/> <stop stop-color="#4290bd" stop-opacity="0" offset="1"/> </linearGradient> </defs> <g id="spinner-box-g" transform="translate(9.8904)"> <g id="spinner-shadow-g"> <path id="spinner-shadow-top" d="m196.39 151.18 16.366-9.4488-81.829-47.244-16.366 9.4488z" fill="url(#spinner-shadow-top-linearGradient)"/> <path id="spinner-shadow-bottom" d="m130.93 188.98 65.463-37.795 16.366 9.4488-65.463 37.795z" fill="url(#spinner-shadow-bottom-linearGradient)"/> </g> <path id="spinner-box-back" d="m130.93 56.693-65.463 37.795 65.463 37.795 65.463-37.795z" fill="#b4d3e4" fill-opacity=".97667"/> <g> <path id="spinner-box-f-right-bg" d="m130.93 132.28v56.693l65.463-37.795v-56.693z" fill="white"/> <path id="spinner-box-f-right" d="m130.93 132.28v56.693l65.463-37.795v-56.693z" fill="#8ebdd7"/> <path id="spinner-box-f-left" d="m130.93 132.28v56.693l-65.463-37.795v-56.693z" fill="#d9e9f2"/> <path id="spinner-inner-right-bg" d="m81.829 103.94 49.098-28.346 49.098 28.346-49.098 28.346z" fill="white"/> <path id="spinner-inner-right" d="m81.829 103.94 49.098-28.346 49.098 28.346-49.098 28.346z" fill="#68a7ca"/> <path id="spinner-inner-left-bg" d="m130.93 75.591v56.693l-49.098-28.346z" fill="white"/> <path id="spinner-inner-left" d="m130.93 75.591v56.693l-49.098-28.346z" fill="url(#spinner-inner-left-linearGradient)"/> </g> <path id="spinner-handle" d="m114.56 153.07-6.5463 3.7795-32.732-18.898 6.5463-3.7795" fill="none" stroke="#4290bd" stroke-linecap="round" stroke-width="3"/> </g> <g id="spinner-paper-g" transform="translate(9.8904)"> <path id="spinner-paper-bg" d="m130.93 18.898s-14.524 12.927-49.098 28.346l49.098 28.346c16.428-6.7073 29.159-14.202 37.537-19.8 7.5473-5.0432 6.4305-9.2141 6.4305-9.2141-0.42453-2.5692-4.7288-5.0245-4.7288-5.0245z" fill="white"/> <path id="spinner-paper" d="m130.93 18.898s-14.524 12.927-49.098 28.346l49.098 28.346c16.428-6.7073 29.159-14.202 37.537-19.8 7.5473-5.0432 6.4305-9.2141 6.4305-9.2141-0.42453-2.5692-4.7288-5.0245-4.7288-5.0245z" fill="url(#spinner-paper-linearGradient)"/> <path id="spinner-paper-fold-bg" d="m168.46 55.791c7.5473-5.0432-1.2989-9.0071-1.2989-9.0071-0.42453-2.5692 3.0006-5.2315 3.0006-5.2315 4.4877 2.646 4.7288 5.0245 4.7288 5.0245 1.0076 4.4201-6.4305 9.2141-6.4305 9.2141z" fill="white"/> <path id="spinner-paper-fold" d="m168.46 55.791c7.5473-5.0432-1.2989-9.0071-1.2989-9.0071-0.42453-2.5692 3.0006-5.2315 3.0006-5.2315 4.4877 2.646 4.7288 5.0245 4.7288 5.0245 1.0076 4.4201-6.4305 9.2141-6.4305 9.2141z" fill="url(#spinner-paper-fold-linearGradient)"/> </g>'
var spinner=window.L.DomUtil.create("div",builder.options.cssClass+" spinner-img ",parentContainer);
spinner.appendChild(svgElement);spinner.id=data.id;return false},_imageHandler:function(
parentContainer,data,builder){if(!data.id)return false;var image=window.L.DomUtil.create("img",
builder.options.cssClass+" ui-image",parentContainer);image.id=data.id;
image.src=data.image?data.image.replace(/\\/g,""):"";image.alt=data.text;return false},
_htmlControl:function(parentContainer,data,builder){var container=window.L.DomUtil.create("div",
builder.options.cssClass,parentContainer);container.appendChild(data.content);container.id=data.id;
if(data.style&&data.style.length){window.L.DomUtil.addClass(container,data.style)}if(data.hidden)$(
container).hide();return false},_createComment:function(container,data){container.appendChild(
data.annotation.sectionProperties.container);data.annotation.show();data.annotation.update();
data.annotation.setExpanded()},_rootCommentControl:function(parentContainer,data,builder){if(
data.type==="emptyCommentWizard"){builder._emptyCommentWizard(parentContainer,data,builder);return}
var mainContainer=document.getElementById(
"explorable-entry level-"+builder._currentDepth+" "+data.id);if(!mainContainer
)mainContainer=window.L.DomUtil.create("div",
"ui-explorable-entry level-"+builder._currentDepth+" "+builder.options.cssClass,parentContainer);
mainContainer.id="explorable-entry level-"+builder._currentDepth+" "+data.id;
var container=document.getElementById(data.id);if(!container)container=window.L.DomUtil.create("div"
,
"ui-header cool-annotation-header level-"+builder._currentDepth+" "+builder.options.cssClass+" ui-widget"
,mainContainer);container.annotation=data.annotation;container.id=data.id;builder._createComment(
container,data);if(data.children.length>1&&mainContainer.id!=="comment-thread"+data.id){
var numberOfReplies=data.children.length-1;if(numberOfReplies>0){
var replyCountNode=document.getElementById("reply-count-node-"+data.id);if(!replyCountNode
)replyCountNode=window.L.DomUtil.create("div","cool-annotation-reply-count cool-annotation-content",
$(container).find(".cool-annotation-content-wrapper")[0]);
replyCountNode.id="reply-count-node-"+data.id;replyCountNode.style.display="block";
var replyCountText;if(numberOfReplies===1){replyCountText=numberOfReplies+" "+_("reply")}else{
replyCountText=numberOfReplies+" "+_("replies")}$(replyCountNode).text(replyCountText)}
var childContainer=document.getElementById("comment-thread"+data.id);if(!childContainer
)childContainer=window.L.DomUtil.create("div",
"ui-content level-"+builder._currentDepth+" "+builder.options.cssClass,mainContainer);
childContainer.id="comment-thread"+data.id;childContainer.title=_("Comment");$(childContainer).hide(
);if(builder.wizard){if($(container).find(".cool-annotation-menubar").length>0)$(container).find(
".cool-annotation-menubar")[0].style.display="none";var arrowSpan=container.querySelector(
"[id='arrow span "+data.id+"']");if(!arrowSpan)arrowSpan=window.L.DomUtil.create("span",
"sub-menu-arrow",$(container).find(".cool-annotation-content-wrapper")[0]);
arrowSpan.style.display="block";arrowSpan.textContent=">";arrowSpan.style.padding="0px";
arrowSpan.id="arrow span "+data.id;$(container).find(".cool-annotation")[0].onclick=function(){
builder.wizard.goLevelDown(mainContainer);childContainer.style.display="block";if(
!childContainer.childNodes.length)builder.build(childContainer,data.children)};
var backButton=document.getElementById("mobile-wizard-back");backButton.onclick=function(){if(
backButton.className!=="close-button"){if(!mainContainer.childNodes.length)builder.build(
mainContainer,data);if(data.type==="rootcomment"){var temp=document.getElementById(
"comment-thread"+data.id);if(temp)temp.style.display="block"}}}}}$(container).find(
".cool-annotation")[0].addEventListener("click",function(){app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name).highlightComment(data.annotation)});return false},
_commentControl:function(parentContainer,data,builder){builder._createComment(parentContainer,data,
false);return false},_emptyCommentWizard:function(parentContainer,data,builder){
window.L.DomUtil.addClass(parentContainer,"content-has-no-comments");
var emptyCommentWizard=window.L.DomUtil.create("figure","empty-comment-wizard-container",
parentContainer);var imgNode=window.L.DomUtil.create("img","empty-comment-wizard-img",
emptyCommentWizard);app.LOUtil.setImage(imgNode,"lc_showannotations.svg",builder.map);
imgNode.alt=data.text;var textNode=window.L.DomUtil.create("figcaption","empty-comment-wizard",
emptyCommentWizard);textNode.innerText=data.text;window.L.DomUtil.create("br","empty-comment-wizard"
,textNode);if(app.isCommentEditingAllowed()){var linkNode=window.L.DomUtil.create("div",
"empty-comment-wizard-link",textNode);linkNode.innerText=_("Insert Comment");
linkNode.onclick=builder.map.insertComment.bind(builder.map)}},_addAriaLabel(element,data,builder){
if(data.aria)element.setAttribute("aria-label",data.aria.label);else if(data.text
)element.setAttribute("aria-label",builder._cleanText(data.text))},_createIdentifiable:function(type
,classNames,parentContainer,data){return window.L.DomUtil.create(type,classNames+this._getParentId(
data),parentContainer)},_isStringCloseToURL:function(str){return str.indexOf("http")!==-1},
_isStringLCIcon:function(str){return str.indexOf("lc_")===0},_makeIdUnique:function(id){
var counter=0;var found=document.querySelector('[id="'+id+'"]');while(found){counter++;
found=document.querySelector('[id="'+id+counter+'"]')}if(counter)id=id+counter;return id},
_unoToolButton:function(parentContainer,data,builder,options){var button=null;var controls={};
let div=window.L.DomUtil.create("div",
"unotoolbutton "+builder.options.cssClass+" ui-content unospan",parentContainer,data);controls[
"container"]=div;div.tabIndex=data.tabIndex!==undefined?data.tabIndex:-1;if(data.index
)div.setAttribute("index",data.index);if(data.class)div.classList.add(data.class);
const hasDropdownArrow=!!(options&&options.hasDropdownArrow);
const isSplitButton=!!data.applyCallback;const isDropdownButton=!!data.dropdown;
const isArrowInteractive=hasDropdownArrow&&isSplitButton||isDropdownButton;var isRealUnoCommand=true
var hasPopUp=false;var hasImage=true;if(data.text&&data.text.endsWith("...")){
data.text=data.text.replace("...","");hasPopUp=true}if(data&&data.image===false){hasImage=false}
const itemsToSyncWithContainer=[];if(data.command||data.postmessage===true){
var id=data.id?data.id:data.command&&data.command!==""?data.command.replace(".uno:",""):data.text;
var isUnoCommand=data.command&&data.command.indexOf(".uno:")>=0;isRealUnoCommand=isUnoCommand;if(id
)id.replace(/\%/g,"").replace(/\./g,"-").replace(" ","");else console.warn(
"_unoToolButton: no id provided");if(data.command)window.L.DomUtil.addClass(div,
data.command.replace(":","").replace(".",""));if(isRealUnoCommand)id=builder._makeIdUnique(id);
div.id=id;data.id=id;var buttonId=id+"-button";button=window.L.DomUtil.create("button",
"ui-content unobutton",div);if(div.tabIndex==0)button.tabIndex=-1;button.id=buttonId;
itemsToSyncWithContainer.push(button);builder._addAriaLabel(button,data,builder);if(!data.accessKey
)builder._setAccessKey(button,builder._getAccessKeyFromText(data.text)
);else button.accessKey=data.accessKey;if(hasPopUp&&!isArrowInteractive)button.setAttribute(
"aria-haspopup",true);if(data.w2icon){var buttonImage=window.L.DomUtil.create("div",
"w2ui-icon "+data.w2icon,button)}else if(hasImage!==false){if(data.icon){
buttonImage=window.L.DomUtil.create("img","",button);this._isStringCloseToURL(data.icon
)?buttonImage.src=data.icon:app.LOUtil.setImage(buttonImage,data.icon,builder.map)}else if(
data.image){buttonImage=window.L.DomUtil.create("img","",button);buttonImage.src=data.image}else{
buttonImage=window.L.DomUtil.create("img","",button);app.LOUtil.setImage(buttonImage,
app.LOUtil.getIconNameOfCommand(data.command),builder.map)}}else{buttonImage=false}controls["button"
]=button;var span;if(data.noLabel&&data.type!="menubutton")$(div).addClass("no-label");else if(
builder.options.noLabelsForUnoButtons!==true&&data.text){span=window.L.DomUtil.create("span",
"ui-content unolabel",button);span.textContent=builder._cleanText(data.text);
builder._stressAccessKey(span,button.accessKey);controls["label"]=span;$(div).addClass("has-label")
}else if(builder.options.useInLineLabelsForUnoButtons===true&&data.text){$(div).addClass("inline");
span=window.L.DomUtil.create("span","ui-content unolabel",div);span.textContent=builder._cleanText(
data.text);controls["label"]=span}else{$(div).addClass("no-label")}if(button.getAttribute(
"aria-label")){buttonImage.alt=""}else if(buttonImage!==false){if(data.aria){
buttonImage.alt=data.aria.label}else{buttonImage.alt=builder._cleanText(data.text)}}
let tooltip=builder._cleanText(data.tooltip)||builder._cleanText(data.text);if(data.command
)tooltip=JSDialog.ShortcutsUtil.getShortcut(tooltip,data.command);div.setAttribute("data-cooltip",
tooltip);var isDisabled=data.enabled===false;if(data.command){var updateFunction=function(){
var items=builder.map["stateChangeHandler"];var state=items.getItemValue(data.command);if(
state&&state==="true"){$(button).addClass("selected");$(div).addClass("selected");
button.setAttribute("aria-pressed",true)}else{$(button).removeClass("selected");$(div).removeClass(
"selected");button.setAttribute("aria-pressed",false)}if(isDisabled){div.setAttribute("disabled",
"true");div.setAttribute("aria-disabled",true)}else{div.removeAttribute("disabled");
div.removeAttribute("aria-disabled")}};updateFunction();builder.map.on("commandstatechanged",
function(e){isDisabled=false;if(e.commandName===data.command){
isDisabled=e.disabled||e.state=="disabled";updateFunction()}},this)}if(isDisabled){div.setAttribute(
"disabled","true");div.setAttribute("aria-disabled",true)}var selectFn=function(){
window.L.DomUtil.addClass(button,"selected");window.L.DomUtil.addClass(div,"selected");
button.setAttribute("aria-pressed",true)};var unSelectFn=function(){window.L.DomUtil.removeClass(
button,"selected");window.L.DomUtil.removeClass(div,"selected");button.setAttribute("aria-pressed",
false)};div.onSelect=selectFn;div.onUnSelect=unSelectFn;if(data.selected===true)selectFn()}else{
var span=window.L.DomUtil.create("span","ui-content unolabel",div);
span.textContent=builder._cleanText(data.text);controls["button"]=button;controls["label"]=span}if(
hasDropdownArrow||isDropdownButton){$(div).addClass("has-dropdown");div.setAttribute("role","group")
var arrowbackground;if(isArrowInteractive){arrowbackground=window.L.DomUtil.create("button",
"arrowbackground",div)}else{arrowbackground=window.L.DomUtil.create("div","arrowbackground",div);
arrowbackground.setAttribute("aria-hidden","true")}window.L.DomUtil.create("i","unoarrow",
arrowbackground);controls["arrow"]=arrowbackground;if(!hasDropdownArrow&&isDropdownButton){
arrowbackground.addEventListener("click",function(event){openToolBoxMenu(event)});
arrowbackground.addEventListener("keydown",function(event){switch(event.key){case"Enter":
openToolBoxMenu(event);break}});div.closeDropdown=function(){builder.callback("toolbox","closemenu",
parentContainer,data.command,builder)}}itemsToSyncWithContainer.push(arrowbackground)}if(
arrowbackground){isSplitButton?arrowbackground.tabIndex="0":arrowbackground.tabIndex="-1";if(
isArrowInteractive){const buttonText=data.aria&&data.aria.label?data.aria.label:builder._cleanText(
data.text);const dropdownAriaLabelText=_("Open {name}").replace("{name}",buttonText);
arrowbackground.setAttribute("aria-label",dropdownAriaLabelText);arrowbackground.setAttribute(
"aria-haspopup",true);arrowbackground.setAttribute("aria-expanded",false)}else{button.setAttribute(
"aria-expanded",false)}}JSDialog.SynchronizeDisabledState(div,itemsToSyncWithContainer);
div._onDropDown=function(open){if(!isArrowInteractive)button.setAttribute("aria-expanded",open);
arrowbackground.setAttribute("aria-expanded",open)};var openToolBoxMenu=function(event){if(
!div.hasAttribute("disabled")){builder.callback("toolbox","openmenu",parentContainer,data.command,
builder);event.stopPropagation()}};var clickFunction=function(e){if(!div.hasAttribute("disabled")){
builder.refreshSidebar=true;if(data.postmessage){
let isContextualButton=e.target.offsetParent.id==="context-toolbar";
const msgId=isContextualButton?"Clicked_ContextualButton":"Clicked_Button";builder.map.fire(
"postMessage",{msgId:msgId,args:{Id:data.id}})}else if(isRealUnoCommand&&data.dropdown!==true
)builder.callback("toolbutton","click",button,data.command,builder);else{builder.callback("toolbox",
"click",parentContainer,data.command,builder)}}e.preventDefault();e.stopPropagation()};
const hasLabel=!!controls.label;const hasShortcut=JSDialog.ShortcutsUtil.hasShortcut(data.command);
var mouseEnterFunction=window.touch.mouseOnly(function(){if(builder.map.tooltip
)builder.map.tooltip.beginShow(div)});var mouseLeaveFunction=function(){if(builder.map.tooltip
)builder.map.tooltip.beginHide(div)};$(controls.button).on("click",clickFunction);$(controls.label
).on("click",clickFunction);if(data.isCustomTooltip){this._handleCutomTooltip(div,builder)}else if(
!hasLabel||hasShortcut){$(div).on("mouseenter",mouseEnterFunction);$(div).on("mouseleave",
mouseLeaveFunction)}else{div.removeAttribute("data-cooltip")}div.addEventListener("keydown",
function(e){switch(e.key){case"Escape":builder.map.focus();break}});
builder._preventDocumentLosingFocusOnClick(div);if(isDisabled){div.setAttribute("disabled","true");
div.setAttribute("aria-disabled",true)}builder.map.hideRestrictedItems(data,controls["container"],
controls["container"]);builder.map.disableLockedItem(data,controls["container"],controls["container"
]);return controls},_handleCutomTooltip:function(elem,builder){switch(elem.id){case"save":$(elem
).on("mouseenter",window.touch.mouseOnly(function(){if(builder.map.tooltip)builder.map.tooltip.show(
elem,builder.map.getLastModDateValue())}));$(elem).on("mouseleave",function(){if(builder.map.tooltip
)builder.map.tooltip.hide(elem)})}},_mapDispatchToolItem:function(parentContainer,data,builder){if(
!data.command)data.command=data.id;if(data.id&&data.id!=="exportas"&&data.id.startsWith("export")){
var format=data.id.substring("export".length);app.registerExportFormat(data.text,format);if(
builder.map["wopi"].HideExportOption)return false}if(data.inlineLabel!==undefined){
var backupInlineText=builder.options.useInLineLabelsForUnoButtons;
builder.options.useInLineLabelsForUnoButtons=data.inlineLabel}var control=builder._unoToolButton(
parentContainer,data,builder);if(data.inlineLabel!==undefined
)builder.options.useInLineLabelsForUnoButtons=backupInlineText;$(control.button).unbind("click");$(
control.label).unbind("click");if(!builder.map.isLockedItem(data)){var handlePressAndHold=function(
data){const scrollingInterval=setInterval(function(){app.dispatcher.dispatch(data.command)},100);$(
document).one("mouseup",function(){clearInterval(scrollingInterval)})};if(data.pressAndHold){$(
control.container).on("mousedown",e=>{if(e.button!==0||control.container.getAttribute("disabled"
)!==null)return;const pressAndHoldTimer=setTimeout(()=>{handlePressAndHold(data)},500);$(document
).one("mouseup",()=>{clearTimeout(pressAndHoldTimer)})})}$(control.container).click(function(){if(
control.container.getAttribute("disabled")===null)app.dispatcher.dispatch(data.command)})}
builder._preventDocumentLosingFocusOnClick(control.container)},_mapBigDispatchToolItem:function(
parentContainer,data,builder){if(!data.command)data.command=data.id;
var noLabels=builder.options.noLabelsForUnoButtons;builder.options.noLabelsForUnoButtons=false;
var control=builder._unoToolButton(parentContainer,data,builder);
builder.options.noLabelsForUnoButtons=noLabels;$(control.button).unbind("click");$(control.label
).unbind("click");if(!builder.map.isLockedItem(data)){$(control.container).click(function(e){
e.preventDefault();app.dispatcher.dispatch(data.command)})}
builder._preventDocumentLosingFocusOnClick(control.container)},_divContainerHandler:function(
parentContainer,data,builder){if(!(data.children&&data.children.length))return false;
var divElem=window.L.DomUtil.create("div",builder.options.cssClass,parentContainer);if(
data.style&&data.style.length)window.L.DomUtil.addClass(divElem,data.style);for(
var i=0;i<data.children.length;++i){var entry=data.children[i];var handle=builder._controlHandlers[
entry.type];if(handle){handle(divElem,entry,builder)}}builder._setupHandlers(divElem,data.handlers);
return false},_colorSampleControl:function(parentContainer,data,builder){
var sampleSizeClass="color-sample-small";if(data.size==="big")sampleSizeClass="color-sample-big";
var colorSample=window.L.DomUtil.create("div",builder.options.cssClass+" "+sampleSizeClass,
parentContainer);colorSample.id=data.id;colorSample.style.backgroundColor=data.color;
colorSample.name=data.color.substring(1);if(data.size==="big"){
var selectionMarker=window.L.DomUtil.create("div","colors-container-tint-mark",colorSample);if(
data.selected){selectionMarker.style.visibility="visible"}else{
selectionMarker.style.visibility="hidden"}}else if(data.selected&&data.mark){
colorSample.appendChild(data.mark);window.L.DomUtil.addClass(colorSample,
"colors-container-selected-basic-color")}builder._setupHandlers(colorSample,data.handlers);
return false},_subMenuHandler:function(parentContainer,data,builder){var title=data.text;
builder._explorableMenu(parentContainer,title,data.children,builder,undefined,data.id);return false
},_menuItemHandler:function(parentContainer,data,builder){var title=data.text;
var cssClassHeader="ui-header";if(title===""){return false}var id=data.id;if(id){
cssClassHeader+=" ui-header-"+id;var handler=builder._menuItemHandlers[id];if(handler){handler(
parentContainer,data,builder);return}}var menuEntry=window.L.DomUtil.create("div",
cssClassHeader+" level-"+builder._currentDepth+" "+builder.options.cssClass+" ui-widget",
parentContainer);if(data.hyperlink){menuEntry=window.L.DomUtil.create("a","context-menu-link",
menuEntry);menuEntry.href="#"}var icon=null;var commandName=data.command&&data.command.startsWith(
".uno:")?data.command.substring(".uno:".length):data.id;if(
commandName&&commandName.length&&app.LOUtil.existsIconForCommand(commandName,builder.map.getDocType(
))){var iconName=builder._generateMenuIconName(commandName);var iconSpan=window.L.DomUtil.create(
"span","menu-entry-icon "+iconName,menuEntry);iconName=app.LOUtil.getIconNameOfCommand(iconName,true
);icon=window.L.DomUtil.create("img","",iconSpan);app.LOUtil.setImage(icon,iconName,builder.map);
icon.alt=""}if(data.checked&&data.checked===true){window.L.DomUtil.addClass(menuEntry,
"menu-entry-checked")}var titleSpan=window.L.DomUtil.create("span","",menuEntry);
titleSpan.innerHTML=title;
var paddingClass=icon?"menu-entry-with-icon flex-fullwidth":"menu-entry-no-icon";
window.L.DomUtil.addClass(titleSpan,paddingClass);if(builder.wizard){$(menuEntry).click(()=>{if(
window.insertionMobileWizard)app.dispatcher.dispatch("insertion_mobile_wizard");else if(
window.mobileMenuWizard)$("#main-menu-state").click();else if(window.contextMenuWizard){
window.contextMenuWizard=false;builder.map.fire("closemobilewizard")}if(
data.executionType==="action"){builder.map.menubar._executeAction(undefined,data)}else if(
data.executionType==="callback"){data.callback()}else if(
!builder.map._clip||!builder.map._clip.filterExecCopyPaste(data.command)){if((
data.command.startsWith(".uno:InsertPageHeader")||data.command.startsWith(".uno:InsertPageFooter")
)&&data.checked&&data.checked===true){return}builder.map.sendUnoCommand(data.command)}})}else{
window.app.console.debug("Builder used outside of mobile wizard: please implement the click handler"
)}builder.map.hideRestrictedItems(data,menuEntry,menuEntry);builder.map.disableLockedItem(data,
menuEntry,menuEntry);return false},_insertTableMenuItem:function(parentContainer,data,builder){
var title=data.text;var content=window.L.DomUtil.create("div","inserttablecontrols");var rowsData={
min:0,id:"rows",text:"2",label:_("Rows")};var colsData={min:0,id:"cols",text:"2",label:_("Columns")}
var callbackFunction=function(objectType,eventType,object){if(eventType=="plus"){$(object).find(
"input").val(function(i,oldval){return parseInt(oldval,10)+1})}else if(eventType=="minus"){$(object
).find("input").val(function(i,oldval){if(oldval>0)return parseInt(oldval,10)-1;else return 0})}};
builder._spinfieldControl(content,rowsData,builder,callbackFunction);builder._spinfieldControl(
content,colsData,builder,callbackFunction);var buttonData={text:_("Insert Table")};
builder._pushbuttonControl(content,buttonData,builder,function(){var rowsCount=parseInt($(
"#rows > input.spinfield").get(0).value);var colsCount=parseInt($("#cols > input.spinfield").get(0
).value);builder.map.sendUnoCommand(".uno:InsertTable?Columns="+colsCount+"&Rows="+rowsCount);
builder.map.fire("closemobilewizard")});builder._explorableMenu(parentContainer,title,data.children,
builder,content,data.id)},executeAction:function(container,data){
app.layoutingService.appendLayoutingTask(()=>{this.executeActionImpl(container,data)})},
executeActionImpl:function(container,data){var control=container.querySelector(
"[id='"+this._removeMenuId(data.control_id)+"']");if(!control&&data.control
)control=container.querySelector("[id='"+this._removeMenuId(data.control.id)+"']");if(!control){
window.app.console.warn('executeAction: not found control with id: "'+data.control_id+'"');return}
switch(data.action_type){case"grab_focus":if(typeof control.onFocus==="function")control.onFocus(
);else control.focus();break;case"select":if(typeof control.onSelect==="function")control.onSelect(
parseInt(data.position));else window.app.console.warn(
'widget "'+data.control_id+'" doesn\'t support "select" action');break;case"unselect":if(
typeof control.onUnSelect==="function")control.onUnSelect(parseInt(data.position)
);else window.app.console.warn('widget "'+data.control_id+'" doesn\'t support "unselect" action');
break;case"show":$(control).removeClass("hidden");$(control).show();break;case"hide":$(control
).addClass("hidden");break;case"enable":control.disabled=false;control.removeAttribute("disabled");
break;case"disable":control.setAttribute("disabled","true");control.disabled=true;break;
case"setText":if(typeof control.onSetText==="function"){control.onSetText(data.text);break}
var innerInput=control.querySelector("input");if(innerInput)control=innerInput;
var currentText=this._cleanText(data.text);control.value=currentText;if(data.selection){
var selection=data.selection.split(";");if(selection.length===2){var start=parseInt(selection[0]);
var end=parseInt(selection[1]);if(start>end){var tmp=start;start=end;end=tmp}if(
document.activeElement===control)control.setSelectionRange(start,end)}else if(selection.length===4){
var startPos=parseInt(selection[0]);var endPos=parseInt(selection[1]);var startPara=parseInt(
selection[2]);var endPara=parseInt(selection[3]);var start=0;var end=0;var row=0;for(
;row<startPara;row++){var found=currentText.indexOf("\n",start);if(found===-1)break;start=found+1}
start+=startPos;row=0;for(;row<endPara;row++){found=currentText.indexOf("\n",end);if(found===-1
)break;end=found+1}end+=endPos;if(start>end){var tmp=start;start=end;end=tmp}if(
document.activeElement===control)control.setSelectionRange(start,end)}}break;case"rendered_entry":
case"rendered_combobox_entry":if(!this.rendersCache[control.id])this.rendersCache[control.id]={
persistent:false,images:[]};this.rendersCache[control.id].images[data.pos]=data.image;if(
typeof control.updateRenders=="function")control.updateRenders(data.pos);else console.error(
"widget doesn't support custom entries");break;default:console.error(
'unknown action: "'+data.action_type+'"');break}},_removeMenuId:function(rawId){var elementId=rawId;
var separatorPos=elementId?elementId.indexOf(":"):0;if(separatorPos>0)elementId=elementId.substr(0,
separatorPos);return elementId},_updateWidgetImpl:function(container,data,buildFunc){
var elementId=this._removeMenuId(data.id);var control=container.querySelector("[id='"+elementId+"']"
);if(!control){window.app.console.warn('jsdialogupdate: not found control with id: "'+elementId+'"')
return}var parent=control.parentNode;if(!parent)return;var scrollTop=control.scrollTop;
var focusedElement=document.activeElement;
var focusedElementInDialog=focusedElement?container.querySelector("[id='"+focusedElement.id+"']"
):null;var focusedId=focusedElementInDialog?focusedElementInDialog.id:null;
var temporaryParent=new DocumentFragment;control.id="";buildFunc.bind(this)(temporaryParent,[data],
false);var backupGridSpan=control.style.gridColumn;control.replaceWith(temporaryParent.firstChild);
var newControl=container.querySelector("[id='"+elementId+"']");if(newControl){
newControl.scrollTop=scrollTop;newControl.style.gridColumn=backupGridSpan;if(
data.has_default===true&&(data.type==="pushbutton"||data.type==="okbutton")){
const buttonNode=newControl.querySelector("button");if(buttonNode)window.L.DomUtil.addClass(
buttonNode,"button-primary")}}if(focusedId){var found=container.querySelector("[id='"+focusedId+"']"
);if(found)found.focus()}},updateWidget:function(container,data){
app.layoutingService.appendLayoutingTask(()=>{this._updateWidgetImpl(container,data,this.build)})},
postProcess:function(parent,data){if(!parent||!data||!data.id||data.id==="")return;
var control=parent.querySelector("[id='"+data.id+"']");if(
data.visible==="false"||data.visible===false){if(control)window.L.DomUtil.addClass(control,"hidden"
);else if(parent.id===data.id)window.L.DomUtil.addClass(parent,"hidden")}if(control&&data.width){
control.style.gridColumn="span "+parseInt(data.width)}if(control&&!control.hasAttribute("tabIndex"
)&&control.querySelectorAll("[tabindex]"
).length===0&&data.type!=="container"&&data.type!=="tabpage"&&data.type!=="tabcontrol"&&data.type!=="drawingarea"&&data.type!=="grid"&&data.type!=="image"&&data.type!=="toolbox"&&data.type!=="listbox"&&data.type!=="combobox"&&data.type!=="radiobutton"&&data.type!=="checkbox"&&data.type!=="spinfield"&&data.type!=="metricfield"&&data.type!=="formattedfield"&&data.type!=="fixedtext"&&data.type!=="frame"&&data.type!=="expander"&&data.type!=="panel"&&data.type!=="buttonbox"&&data.type!=="treelistbox"&&data.type!=="time"&&data.type!=="separator"&&data.type!=="spacer"&&data.type!=="edit"&&data.type!=="deck"&&data.type!=="pushbutton"
)control.setAttribute("tabIndex","0")},isHyperlinkTarget:function(builder,data){
return data.type==="combobox"&&(data.id==="target"||data.id==="receiver")},
requiresOverwriting:function(builder,data){if(builder.isHyperlinkTarget(builder,data))return true;
return false},overwriteHandler:function(parentContainer,data,builder){if(builder.isHyperlinkTarget(
builder,data)){var callback=function(value){builder.callback("combobox","change",data,value,builder)
};return builder._controlHandlers["edit"](parentContainer,data,builder,callback)}console.error(
"It seems widget doesn't require overwriting.")},build:function(parent,data,hasVerticalParent){if(
hasVerticalParent===undefined){parent=window.L.DomUtil.create("div",
"root-container "+this.options.cssClass,parent);parent=window.L.DomUtil.create("div",
"vertical "+this.options.cssClass,parent)}for(var childIndex in data){var childData=data[childIndex]
if(!childData)continue;var childType=childData.type;this._handleResponses(childData,this);
var containerToInsert=parent;if(childData.dialogid){containerToInsert.id=childData.dialogid;
this.dialogId=childData.dialogid}
var isVertical=childData.vertical==="true"||childData.vertical===true?true:false;
var processChildren=true;if((childData.id===undefined||childData.id===""||childData.id===null)&&(
childType=="checkbox"||childType=="radiobutton")){continue}
var hasManyChildren=childData.children&&childData.children.length>1;
var isContainer=this.isContainerType(childData.type);if(hasManyChildren&&isContainer){
var table=window.L.DomUtil.createWithId("div",childData.id,containerToInsert);$(table).addClass(
this.options.cssClass);if(!isVertical){var rows=this._getGridRows(childData.children);
var cols=this._getGridColumns(childData.children);if(rows>1&&cols>1){
var gridRowColStyle="grid-template-rows: repeat("+rows+"); \t\t\t\t\t\t\tgrid-template-columns: repeat("+cols+");"
table.style=gridRowColStyle}else{$(table).css("grid-auto-flow","column")}$(table).css("display",
"grid")}$(table).addClass("ui-grid-cell");if(childData.width){
table.style.gridColumn="span "+parseInt(childData.width)}var childObject=table;this.postProcess(
containerToInsert,childData)}else{childObject=containerToInsert}var handler=this._controlHandlers[
childType];if(handler){if(this.requiresOverwriting(this,childData)
)processChildren=this.overwriteHandler(childObject,childData,this);else processChildren=handler(
childObject,childData,this);this.postProcess(childObject,childData)}else window.app.console.warn(
'JSDialogBuilder: Unsupported control type: "'+childType+'"');if(
processChildren&&childData.children!=undefined)this.build(childObject,childData.children,isVertical
);else if(childData.visible&&(childData.visible===false||childData.visible==="false")){$(
"#"+childData.id).addClass("hidden-from-event")}}}});
window.L.Control.JSDialogBuilder.getMenuStructureForMobileWizard=function(menu,mainMenu,itemCommand
){if(itemCommand.indexOf("sep")>=0)return null;var itemText="";if(menu.name)itemText=menu.name;
var itemType="submenu";var executionType="menu";if(mainMenu){itemType="mainmenu";
executionType="menu"}else if(menu.callback){itemType="menuitem";executionType="callback"}else if(
!menu.items){itemType="menuitem";executionType="command"}var menuStructure={type:itemType,
enabled:true,text:itemText,executionType:executionType,children:[]};if(itemCommand)menuStructure[
"command"]=itemCommand;if(menu.icon)menuStructure["checked"]=true;if(menu.callback)menuStructure[
"callback"]=menu.callback;if(menu.isHtmlName)menuStructure["hyperlink"]=true;if(mainMenu){for(
var menuItem in menu){var subItemCommand=menu[menuItem].command?menu[menuItem].command:menuItem;
var element=this.getMenuStructureForMobileWizard(menu[menuItem],false,subItemCommand);if(element
)menuStructure["children"].push(element)}}else if(itemType=="submenu"){for(menuItem in menu.items){
element=this.getMenuStructureForMobileWizard(menu.items[menuItem],false,menuItem);if(element
)menuStructure["children"].push(element)}if(menu.command){menuStructure.id=menu.command.substring(5
).toLowerCase()}}return menuStructure};window.L.control.jsDialogBuilder=function(options){
var builder=new window.L.Control.JSDialogBuilder(options);builder._setup(options);return builder};
window.L.Control.MobileWizardBuilder=window.L.Control.JSDialogBuilder.extend({
_customizeOptions:function(){this.options.noLabelsForUnoButtons=true;
this.options.useInLineLabelsForUnoButtons=false;this.options.cssClass="mobile-wizard"},
_overrideHandlers:function(){this._controlHandlers["basespinfield"]=this.baseSpinField;
this._controlHandlers["checkbox"]=this._checkboxControl;this._controlHandlers["combobox"
]=JSDialog.mobileCombobox;this._controlHandlers["comboboxentry"]=JSDialog.mobileComboboxEntry;
this._controlHandlers["edit"]=this._editControl;this._controlHandlers["frame"]=this._frameHandler;
this._controlHandlers["grid"]=this._gridHandler;this._controlHandlers["listbox"
]=this._listboxControl;this._controlHandlers["mobile-popup-container"]=this._mobilePopupContainer;
this._controlHandlers["panel"]=this._panelHandler;this._controlHandlers["paneltabs"
]=JSDialog.mobilePanelControl;this._controlHandlers["radiobutton"]=this._radiobuttonControl;
this._controlHandlers["scrollwindow"]=undefined;this._controlHandlers["submenutabs"
]=JSDialog.mobileSubmenuTabControl;this._controlHandlers["tabcontrol"]=JSDialog.mobileTabControl;
this._controlHandlers["borderstyle"]=JSDialog.mobileBorderSelector;this._controlHandlers[
"colorlistbox"]=this._colorControl;this._toolitemHandlers[".uno:XLineColor"]=this._colorControl;
this._toolitemHandlers[".uno:FontColor"]=this._colorControl;this._toolitemHandlers[
".uno:CharBackColor"]=this._colorControl;this._toolitemHandlers[".uno:BackgroundColor"
]=this._colorControl;this._toolitemHandlers[".uno:TableCellBackgroundColor"]=this._colorControl;
this._toolitemHandlers[".uno:FrameLineColor"]=this._colorControl;this._toolitemHandlers[".uno:Color"
]=this._colorControl;this._toolitemHandlers[".uno:FillColor"]=this._colorControl;
this._toolitemHandlers[".uno:FontworkAlignmentFloater"]=function(){return false};
this._toolitemHandlers[".uno:FontworkCharacterSpacingFloater"]=function(){return false};
this._toolitemHandlers[".uno:ExtrusionToggle"]=function(){return false};this._toolitemHandlers[
".uno:Grow"]=function(){return false};this._toolitemHandlers[".uno:Shrink"]=function(){return false}
this._toolitemHandlers[".uno:StyleUpdateByExampleimg"]=function(){return false};
this._toolitemHandlers[".uno:StyleNewByExampleimg"]=function(){return false};this._toolitemHandlers[
".uno:LineEndStyle"]=function(){return false};this._toolitemHandlers[".uno:SetOutline"]=function(){
return false};this._toolitemHandlers[".uno:FontworkShapeType"]=this._fontworkShapeControl;
this._toolitemHandlers["SelectWidth"]=this._lineWidthControl;this._toolitemHandlers[
".uno:XLineStyle"]=this._explorableToolItemHandler},_getParentId:function(it){while(
it.parent&&!it.id)it=it.parent;if(it&&it.id)return"-"+it.id;else return""},_parentize:function(data,
parent){if(data.parent)return;if(data.children!==undefined){for(var idx in data.children){
this._parentize(data.children[idx],data)}}data.parent=parent},baseSpinField:function(parentContainer
,data,builder,customCallback){var controls={};if(data.label){var fixedTextData={text:data.label};
builder._fixedtextControl(parentContainer,fixedTextData,builder)}var div=window.L.DomUtil.create(
"div","spinfieldcontainer",parentContainer);div.id=data.id;controls["container"]=div;
var commandName=data.id&&data.id.startsWith(".uno:")?data.id.substring(".uno:".length):data.id;if(
commandName&&commandName.length&&app.LOUtil.existsIconForCommand(commandName,builder.map.getDocType(
))){var image=window.L.DomUtil.create("img","spinfieldimage",div);
var icon=data.id==="Transparency"?app.LOUtil.getIconNameOfCommand("settransparency"
):app.LOUtil.getIconNameOfCommand(data.id);app.LOUtil.setImage(image,icon,builder.map);icon.alt=""}
var spinfield=window.L.DomUtil.create("input","spinfield",div);spinfield.type="number";
spinfield.onkeypress=builder._preventNonNumericalInput;spinfield.dir=document.documentElement.dir;
controls["spinfield"]=spinfield;if(data.labelledBy)spinfield.setAttribute("aria-labelledby",
data.labelledBy);if(data.unit){var unit=window.L.DomUtil.create("span","spinfieldunit",div);
unit.textContent=builder._unitToVisibleString(data.unit)}
var controlsContainer=window.L.DomUtil.create("div","spinfieldcontrols",div);
var minus=window.L.DomUtil.create("div","minus",controlsContainer);minus.textContent="-";
var plus=window.L.DomUtil.create("div","plus",controlsContainer);plus.textContent="+";if(
data.min!=undefined)$(spinfield).attr("min",data.min);if(data.max!=undefined)$(spinfield).attr("max"
,data.max);if(data.step!=undefined)$(spinfield).attr("step",data.step);if(
data.enabled==="false"||data.enabled===false){$(spinfield).attr("disabled","disabled");$(image
).addClass("disabled")}if(data.readOnly===true)$(spinfield).attr("readOnly","true");if(data.hidden
)$(spinfield).hide();plus.addEventListener("click",function(){var attrdisabled=$(spinfield).attr(
"disabled");if(attrdisabled!=="disabled"){if(customCallback)customCallback("spinfield","plus",div,
this.value,builder);else builder.callback("spinfield","plus",div,this.value,builder)}});
minus.addEventListener("click",function(){var attrdisabled=$(spinfield).attr("disabled");if(
attrdisabled!=="disabled"){if(customCallback)customCallback("spinfield","minus",div,this.value,
builder);else builder.callback("spinfield","minus",div,this.value,builder)}});return controls},
_preventNonNumericalInput:function(e){e=e||window.event;
var charCode=e.which===undefined?e.keyCode:e.which;var charStr=String.fromCharCode(charCode);if(
!charStr.match(/^[0-9.,]+$/)&&charCode!==13)e.preventDefault()},_swapControls:function(controls,
indexA,indexB){var tmp=controls[indexA];controls[indexA]=controls[indexB];controls[indexB]=tmp},
_gridHandler:function(parentContainer,data,builder){var children=data.children;if(children){
var count=children.length;for(var i=0;i<count-2;i++){if(children[i].type=="fixedtext"&&children[i+1
].type=="fixedtext"){builder._swapControls(children,i+1,i+2)}}}return true},_frameHandler:function(
parentContainer,data,builder){if(data.children.length>2){data.text=builder._cleanText(data.children[
0].text);var contentNode=data.children[1];builder._explorableEntry(parentContainer,data,contentNode,
builder)}else{return true}return false},_listboxControl:function(parentContainer,data,builder){if(
!data.entries||data.entries.length===0)return false;builder._setIconAndNameForCombobox(data);if(
data.id==="FontBox")data.text="";var title=data.text;var valueNode=null;
var selectedEntryIsString=false;if(data.selectedEntries){selectedEntryIsString=isNaN(parseInt(
data.selectedEntries[0]));if(title&&title.length){var value=data.entries[data.selectedEntries[0]];
valueNode=window.L.DomUtil.create("div","",null);valueNode.textContent=value}else if(
selectedEntryIsString)title=builder._cleanText(data.selectedEntries[0]);else title=data.entries[
data.selectedEntries[0]]}title=builder._cleanText(title);data.text=title;var entries=[];for(
var index in data.entries){var style="ui-combobox-text";if(
data.selectedEntries&&index==data.selectedEntries[0
]||data.selectedEntries&&selectedEntryIsString&&data.entries[index]===data.selectedEntries[0
]||data.entries[index]==title){style+=" selected"}var entry={type:"comboboxentry",text:data.entries[
index],pos:index,parent:data,style:style};entries.push(entry)}var contentNode={type:"container",
children:entries};var iconPath=null;if(data.command)iconPath=app.LOUtil.getIconNameOfCommand(
data.command);builder._explorableEntry(parentContainer,data,contentNode,builder,valueNode,iconPath);
return false},_checkboxControl:function(parentContainer,data,builder){
var div=window.L.DomUtil.createWithId("div",data.id,parentContainer);window.L.DomUtil.addClass(div,
"checkbutton");var checkboxLabel=window.L.DomUtil.create("label","",div);
checkboxLabel.textContent=builder._cleanText(data.text);checkboxLabel.htmlFor=data.id;
var checkbox=window.L.DomUtil.createWithId("input",data.id,div);checkbox.type="checkbox";if(
data.enabled==="false"||data.enabled===false){$(checkbox).attr("disabled","disabled");
div.disabled=true;div.setAttribute("disabled","disabled")}JSDialog.SynchronizeDisabledState(div,[
checkbox,checkboxLabel]);checkbox.addEventListener("change",function(){builder.callback("checkbox",
"change",div,this.checked,builder)});if(data.checked===true)$(checkbox).prop("checked",true);if(
data.hidden)$(checkbox).hide();return false},_radiobuttonControl:function(parentContainer,data,
builder){var container=window.L.DomUtil.createWithId("div",data.id,parentContainer);
window.L.DomUtil.addClass(container,"radiobutton");window.L.DomUtil.addClass(container,
builder.options.cssClass);var radiobuttonLabel=window.L.DomUtil.create("label","",container);
radiobuttonLabel.textContent=builder._cleanText(data.text);radiobuttonLabel.htmlFor=data.id;
var radiobutton=window.L.DomUtil.create("input","",container);radiobutton.type="radio";if(data.group
)radiobutton.name=data.group;if(data.enabled==="false"||data.enabled===false){$(radiobutton).attr(
"disabled","disabled");container.disabled=true;container.setAttribute("disabled","disabled")}
JSDialog.SynchronizeDisabledState(container,[radiobutton,radiobuttonLabel]);if(
data.checked==="true"||data.checked===true)$(radiobutton).prop("checked",true);
radiobutton.addEventListener("change",function(){builder.callback("radiobutton","change",container,
this.checked,builder)});if(data.hidden)$(radiobutton).hide();return false},_editControl:function(
parentContainer,data,builder,callback){var container=window.L.DomUtil.create("div",
"ui-edit-container "+builder.options.cssClass,parentContainer);container.id=data.id;
var edit=window.L.DomUtil.create("input","ui-edit "+builder.options.cssClass,container);
edit.value=builder._cleanText(data.text);edit.id=data.id+"-input";edit.dir="auto";if(data.password
)edit.type="password";if(data.enabled==="false"||data.enabled===false)$(edit).prop("disabled",true);
edit.addEventListener("change",function(){if(callback)callback(this.value);else builder.callback(
"edit","change",container,this.value,builder)});edit.addEventListener("click",function(e){
e.stopPropagation()});if(data.hidden)$(edit).hide();if(data.placeholder)$(edit).attr("placeholder",
data.placeholder);return false},_fontworkShapeControl:function(parentContainer,data,builder){
var json=[{id:"fontworkproperties",type:"frame",children:[{text:_UNO(".uno:FontworkShapeType")},{
id:"fontworkshape",type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-plain-text"),command:".uno:FontworkShapeType.fontwork-plain-text"},
{type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-wave"),
command:".uno:FontworkShapeType.fontwork-wave"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-inflate"),command:".uno:FontworkShapeType.fontwork-inflate"},{
type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-stop"),
command:".uno:FontworkShapeType.fontwork-stop"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-curve-up"),command:".uno:FontworkShapeType.fontwork-curve-up"},{
type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-curve-down"),
command:".uno:FontworkShapeType.fontwork-curve-down"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-triangle-up"),command:".uno:FontworkShapeType.fontwork-triangle-up"
},{type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-triangle-down"),
command:".uno:FontworkShapeType.fontwork-triangle-down"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-fade-right"),command:".uno:FontworkShapeType.fontwork-fade-right"},
{type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-fade-left"),
command:".uno:FontworkShapeType.fontwork-fade-left"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-fade-up"),command:".uno:FontworkShapeType.fontwork-fade-up"},{
type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-fade-down"),
command:".uno:FontworkShapeType.fontwork-fade-down"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-slant-up"),command:".uno:FontworkShapeType.fontwork-slant-up"},{
type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-slant-down"),
command:".uno:FontworkShapeType.fontwork-slant-down"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-fade-up-and-right"),
command:".uno:FontworkShapeType.fontwork-fade-up-and-right"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-fade-up-and-left"),
command:".uno:FontworkShapeType.fontwork-fade-up-and-left"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-chevron-up"),command:".uno:FontworkShapeType.fontwork-chevron-up"},
{type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-chevron-down"),
command:".uno:FontworkShapeType.fontwork-chevron-down"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-up-curve"),
command:".uno:FontworkShapeType.fontwork-arch-up-curve"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-down-curve"),
command:".uno:FontworkShapeType.fontwork-arch-down-curve"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-left-curve"),
command:".uno:FontworkShapeType.fontwork-arch-left-curve"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-right-curve"),
command:".uno:FontworkShapeType.fontwork-arch-right-curve"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-circle-curve"),
command:".uno:FontworkShapeType.fontwork-circle-curve"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-open-circle-curve"),
command:".uno:FontworkShapeType.fontwork-open-circle-curve"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-up-pour"),
command:".uno:FontworkShapeType.fontwork-arch-up-pour"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-down-pour"),
command:".uno:FontworkShapeType.fontwork-arch-down-pour"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-down-pour"),
command:".uno:FontworkShapeType.fontwork-arch-down-pour"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-arch-right-pour"),
command:".uno:FontworkShapeType.fontwork-arch-right-pour"},{type:"toolitem",text:_UNO(
".uno:FontworkShapeType.fontwork-circle-pour"),command:".uno:FontworkShapeType.fontwork-circle-pour"
},{type:"toolitem",text:_UNO(".uno:FontworkShapeType.fontwork-open-circle-pour"),
command:".uno:FontworkShapeType.fontwork-open-circle-pour"}]}]}];builder.build(parentContainer,json)
},_colorControl:function(parentContainer,data,builder){
var titleOverride=builder._getTitleForControlWithId(data.id);if(titleOverride
)data.text=titleOverride;data.id=data.id?data.id:data.command?data.command.replace(".uno:",""
):undefined;data.text=builder._cleanText(data.text);var valueNode=window.L.DomUtil.create("div",
"color-sample-selected",null);var selectedColor=null;var updateFunction=function(titleSpan){
selectedColor=JSDialog.getCurrentColor(data,builder);valueNode.style.backgroundColor=selectedColor;
if(titleSpan){if(data.id==="fillattr")data.text=_("Background Color");else if(data.id==="fillattr2"
)data.text=_("Gradient Start");else if(data.id==="fillattr3")data.text=_("Gradient End");
titleSpan.textContent=data.text}}.bind(this);updateFunction(null);
var iconPath=app.LOUtil.getIconNameOfCommand(data.command);
var noColorControl=data.command!==".uno:FontColor"&&data.command!==".uno:Color";
var autoColorControl=data.command===".uno:FontColor"||data.command===".uno:Color";
var callback=function(color){JSDialog.sendColorCommand(builder,data,color)};
var colorPickerControl=new ColorPicker(valueNode,{selectedColor:selectedColor,
noColorControl:noColorControl,autoColorControl:autoColorControl,selectionCallback:callback});
builder._colorPickers.push(colorPickerControl);var colorsContainer=colorPickerControl.getContainer()
var contentNode={type:"container",children:[colorsContainer],onshow:window.L.bind(
colorPickerControl.onShow,colorPickerControl)};builder._explorableEntry(parentContainer,data,
contentNode,builder,valueNode,iconPath,updateFunction);return false},_lineWidthControl:function(
parentContainer,data,builder){var values=[0,.5,.8,1,1.5,2.3,3,4.5,6];var currentWidth=parseInt(
builder.map["stateChangeHandler"].getItemValue(".uno:LineWidth"));
var currentWidthText=currentWidth?String(parseFloat(currentWidth)/100):"0.5";var lineData={min:.5,
max:5,id:"linewidth",text:currentWidthText,enabled:data.enabled,readOnly:true};
var callbackFunction=function(objectType,eventType,object){var newValue=0;if(eventType=="plus"){$(
object).find("input").val(function(i,oldVal){var index=1;newValue=values[0];while(
newValue<=oldVal&&index<values.length)newValue=values[index++];return newValue})}else if(
eventType=="minus"){$(object).find("input").val(function(i,oldVal){if(oldVal>0){
var index=values.length-1;newValue=values[index];while(newValue>=oldVal&&index>0)newValue=values[
index--]}else newValue=0;return newValue})}var command=".uno:LineWidth";var params={LineWidth:{
type:"long",value:(newValue*100).toFixed(0)}};builder.map.sendUnoCommand(command,params)};
builder._spinfieldControl(parentContainer,lineData,builder,callbackFunction)},
_panelHandler:function(parentContainer,data,builder){if(data.children&&data.children.length
)data.children[0].visible=true;var content=data.children;var iconPath=null;
var entryId=data.name?data.name:data.id;if(entryId&&entryId.length){
iconPath=app.LOUtil.getIconNameOfCommand(entryId)}builder._explorableEntry(parentContainer,data,
content,builder,null,iconPath);if(data.hidden===true){var control=parentContainer.querySelector(
"[id='"+data.id+"']");if(control)window.L.DomUtil.addClass(control,"hidden")}return false},
_mobilePopupContainer:function(parentContainer,data){var container=window.L.DomUtil.create("div",
"mobile-popup-container",parentContainer);container.id="popup-"+data.id;return false},
_explorableToolItemHandler:function(parentContainer,data,builder){data.text=builder._cleanText(
data.text);var onShow=function(){builder.callback("toolbox","togglemenu",{id:data.parent.id},
data.command,builder)};var nodeId=data.command.indexOf(".uno:")===0?data.command.substr(
".uno:".length):data.command;var contentNode={id:nodeId,type:"mobile-popup-container",children:[],
onshow:onShow};var iconPath=app.LOUtil.getIconNameOfCommand(data.command);builder._explorableEntry(
parentContainer,data,contentNode,builder,null,iconPath);return false},_modifySidebarNodes:function(
data){for(var i=data.length-1;i>=0;i--){if(data[i].type==="menubutton"&&(data[i
].id==="fillgrad1"||data[i].id==="fillgrad2"||data[i].id==="fillattr"||data[i
].id==="fillattr2"||data[i].id==="fillattr3"||data[i].id==="LB_SHADOW_COLOR"||data[i
].id==="LB_GLOW_COLOR")){if(data[i].id==="LB_GLOW_COLOR")data[i].command=".uno:GlowColor";data[i
].type="colorlistbox"}else if(data[i].command==="sidebargradient"&&data[i].type==="toolitem"||data[i
].id==="radiusglow"&&data[i].type==="fixedtext"||data[i].id==="radiussoftedge"&&data[i
].type==="fixedtext"){data.splice(i,1)}}},_countVisiblePanels:function(panels){var count=0;for(
var i in panels)if(panels[i].type==="panel"&&(!panels[i].hidden||panels[i].hidden===false))count++;
return count},isHyperlinkTarget:function(builder,data){return data.type==="combobox"&&(
data.id==="target"||data.id==="receiver")},isFindReplaceComboox:function(builder,data){
return data.type==="combobox"&&(data.id==="searchterm"||data.id==="replaceterm")},
shouldBeListbox:function(builder,data){return data.type==="combobox"&&(
data.id==="applystyle"||data.id==="fontnamecombobox"||data.id==="fontsizecombobox"||data.id==="fontsize"||data.id==="FontBox"
)},requiresOverwriting:function(builder,data){if(builder.isHyperlinkTarget(builder,data
)||builder.isFindReplaceComboox(builder,data)||builder.shouldBeListbox(builder,data))return true;
return false},overwriteHandler:function(parentContainer,data,builder){if(builder.isHyperlinkTarget(
builder,data)||builder.isFindReplaceComboox(builder,data)){var callback=function(value){
builder.callback("combobox","change",data,value,builder)};return builder._controlHandlers["edit"](
parentContainer,data,builder,callback)}else if(builder.shouldBeListbox(builder,data)){
return builder._listboxControl(parentContainer,data,builder)}console.error(
"It seems widget doesn't require overwriting.")},build:function(parent,data){
this._modifySidebarNodes(data);for(var childIndex in data){if(!data[childIndex])continue;
var childData=data[childIndex];if(!childData)continue;this._handleResponses(childData,this);
this._parentize(childData);var childType=childData.type;var processChildren=true;if((
childData.id===undefined||childData.id===""||childData.id===null)&&(
childType=="checkbox"||childType=="radiobutton")){continue}if(
childType==="deck"&&childData.visible===false)continue;var childObject=parent;if(childData.dialogid
){var dialog=window.L.DomUtil.createWithId("div",childData.dialogid,childObject);childObject=dialog}
if(this.wizard._dialogid==="ContentControlDialog"&&childData.id!==""){
var div=window.L.DomUtil.createWithId("div",childData.id,childObject);childObject=div}
var handler=this._controlHandlers[childType];if(childData.children&&this._countVisiblePanels(
childData.children)==1){handler=this._controlHandlers["singlepanel"];processChildren=handler(
childObject,childData.children,this)}else if(childData.children&&this._countVisiblePanels(
childData.children)==2){handler=this._controlHandlers["paneltabs"];processChildren=handler(
childObject,childData.children,this)}else if(childType=="tabcontrol"&&childData.children.length>3){
handler=this._controlHandlers["submenutabs"];handler(childObject,childData,this);this.postProcess(
childObject,childData);this.build(childObject,childData.children)}else{if(handler){if(
this.requiresOverwriting(this,childData))processChildren=this.overwriteHandler(childObject,childData
,this);else processChildren=handler(childObject,childData,this);this.postProcess(childObject,
childData)}else window.app.console.warn('JSDialogBuilder: Unsupported control type: "'+childType+'"'
);if(processChildren&&childData.children!=undefined)this.build(childObject,childData.children
);else if(childData.visible&&(childData.visible===false||childData.visible==="false")){$(
"#"+childData.id).addClass("hidden-from-event")}}if((
childType==="mobilewizard"||childType==="dialog"||childType==="messagebox"||childType==="modelessdialog"
)&&childData.responses){for(var i in childData.responses){var buttonId=childData.responses[i].id;
var response=childData.responses[i].response;var button=parent.querySelector("[id='"+buttonId+"']");
var isHelp=response==="-11"||response===-11||buttonId==="help";
var isClose=response==="7"||response===7;var isCancel=response==="0"||response===0;if(button&&(
isHelp||isClose||isCancel))button.style.display="none"}}}}});
window.L.control.mobileWizardBuilder=function(options){
var builder=new window.L.Control.MobileWizardBuilder(options);builder._setup(options);
builder._overrideHandlers();builder._customizeOptions();return builder};
window.L.Control.MobileWizardWindow=window.L.Control.extend({options:{maxHeight:"45vh",
snackbarTimeout:6e3},_builder:null,_inMainMenu:true,_isActive:false,_inBuilding:false,
_currentDepth:0,_mainTitle:"",_customTitle:false,_isTabMode:false,_currentPath:[],
_currentScrollPosition:0,initialize:function(mobileWizard,id){window.L.setOptions(this,this.options)
this.id=id;this.parent=mobileWizard;this.tabs=null;this.isVisible=false;this.isPopup=false;
this.isSnackBar=false;this.isBusyPopUp=false;this.isFunctionMenu=false;this.isHamburgerMenu=false;
this.isShapesWizard=false;this.title="";this.cusomTitle=null;this.mobileWizard=$("#mobile-wizard");
this.backButton=$("#mobile-wizard-back");this.titleBar=$("#mobile-wizard-titlebar");
this.titleNode=$("#mobile-wizard-title");this.tabsContainer=$("#mobile-wizard-tabs");
var parentNode=document.getElementById("mobile-wizard-content");
this.content=window.L.DomUtil.create("div","mobile-wizard mobile-wizard-content",parentNode);
this.content.id=this.id;this.scrollPositions=[]},onAdd:function(map){this.map=map;if(
!window.mode.isMobile())return;this.content.replaceChildren();this._setupBackButton()},
onRemove:function(){window.L.DomUtil.remove(this.content);this.content=undefined},
_removeSpecialClasses:function(){this.mobileWizard.removeClass("shapeswizard");
this.mobileWizard.removeClass("menuwizard");this.mobileWizard.removeClass("funcwizard");
this.mobileWizard.removeClass("popup");this.mobileWizard.removeClass("snackbar");
this.mobileWizard.removeClass("busypopup")},_applySpecialClasses:function(){if(this.isShapesWizard
)this.mobileWizard.addClass("shapeswizard");if(this.isHamburgerMenu)this.mobileWizard.addClass(
"menuwizard");if(this.isFunctionMenu)this.mobileWizard.addClass("funcwizard");if(
this.isPopup&&!this.isAutoCompletePopup&&!this.isPopupPartialScreen)this.mobileWizard.addClass(
"popup");if(this.isSnackBar)this.mobileWizard.addClass("snackbar");if(this.isBusyPopUp
)this.mobileWizard.addClass("busypopup")},_softReset:function(){this._setupBackButton();
this.tabsContainer.children().detach();this.tabsContainer.hide();this.titleBar.css("top","0px");
this.titleBar.show();this.titleNode[0].replaceChildren();this._removeSpecialClasses()},
_reset:function(){this._softReset();this._currentDepth=0;this._inMainMenu=true;
this.content.replaceChildren();this._isTabMode=false;this._currentPath=[];this.tabs=null;
this._currentScrollPosition=0;this.isPopup=false},_setupBackButton:function(){this.backButton.show()
this.backButton.addClass("close-button")},hideWindow:function(){this.isVisible=false;$(this.content
).hide();this._removeSpecialClasses()},showWindow:function(){this._softReset();this.isVisible=true;
$(this.content).show();this.restoreTitle();this.restoreTabs();this._applySpecialClasses()},
_createScrollIndicator(){const container=document.createElement("div");
container.className="mobile-wizard-scroll-indicator";
container.id="mobile-wizard-scroll-indicator-"+this.id;container.style.width="100%";
container.style.height="0px";container.style.position="fixed";container.style.zIndex=2;
container.style.bottom="-7px";
container.style.boxShadow="0 -8px 20px 4px #0b87e770, 0 1px 10px 6px #0b87e7";return container},
_showWizard:function(){if(this.snackBarTimout)clearTimeout(this.snackBarTimout);this.isVisible=true;
this.scrollIndicator=this._createScrollIndicator();this.content.appendChild(this.scrollIndicator);
var wizard=$("#mobile-wizard");wizard.show();var that=this;wizard.on("scroll",function(){
var mWizardContentScroll=wizard.scrollTop();var height=wizard.prop("scrollHeight");
var contentHeight=wizard.prop("clientHeight");var scrollLeft=height-mWizardContentScroll;if(
scrollLeft<contentHeight+1||!that.isVisible){that.scrollIndicator.style.display="none"}else{
that.scrollIndicator.style.display="block"}});$("#toolbar-down").hide();if(
window.ThisIsTheAndroidApp)window.postMobileMessage("MOBILEWIZARD show");if(window.mobileMenuWizard
)this.map.showSidebar=false;if(this.map.uiManager.sheetsBar)this.map.uiManager.sheetsBar.hide();if(
!document.getElementById("document-container").classList.contains("landscape")){
var pcw=document.getElementById("presentation-controls-wrapper");if(pcw)pcw.style.display="none"}},
isOpen:function(){return $("#mobile-wizard").is(":visible")},_hideKeyboard:function(){this.map.blur(
)},getCurrentLevel:function(){return this._currentDepth},setTabs:function(tabs){this.tabs=tabs;
this.tabsContainer.show();this.tabsContainer.children().detach();this.tabsContainer.append(tabs);
this.titleBar.hide();this._isTabMode=true},restoreTabs:function(){if(this.tabs)this.setTabs(
this.tabs)},setCurrentScrollPosition:function(){this._currentScrollPosition=$(this.content
).scrollTop()},goLevelDown:function(contentToShow,options){
var animate=options&&options.animate!=undefined?options.animate:true;if(
!this._isTabMode||this._currentDepth>0)this.backButton.removeClass("close-button");if(
this._isTabMode&&this._currentDepth>0){this.titleBar.show();this.tabsContainer.hide()}$(
"#mobile-wizard .ui-effects-placeholder").hide();var nodesToHide=$(contentToShow).siblings(
":visible").not(".mobile-wizard-scroll-indicator");var parent=$(contentToShow).parent();if(
parent.hasClass("toolbox"))nodesToHide=nodesToHide.add(parent.siblings(
":visible:not(.mobile-wizard-scroll-indicator)"));var duration=10;if(animate){nodesToHide.hide(
"slide",{direction:"left"},duration);setTimeout(function(){nodesToHide.hide()},duration+5)
}else nodesToHide.hide();$(contentToShow).children(".ui-header").hide();$(
"#mobile-wizard.funcwizard div#mobile-wizard-content").removeClass("hideHelpBG");$(
"#mobile-wizard.funcwizard div#mobile-wizard-content").addClass("showHelpBG");if(animate)$(
contentToShow).children(".ui-content").first().show("slide",{direction:"right"},"fast");else $(
contentToShow).children(".ui-content").first().show();
const currentScroll=this.mobileWizard.scrollTop();this.scrollPositions.push(currentScroll);
this.mobileWizard.scrollTop(0);this._currentDepth++;if(!this._inBuilding)history.pushState({
context:"mobile-wizard",level:this._currentDepth},"mobile-wizard-level-"+this._currentDepth);
var content=$(contentToShow).children(".ui-content").get(0);var title=content?content.title:"";if(
this._customTitle)this._setCustomTitle(this._customTitle);else this._setTitle(title);
this._inMainMenu=false;this._currentPath.push(title)},goLevelUp:function(){this._currentPath.pop();
if(
this._inMainMenu||this._isTabMode&&this._currentDepth==1&&!this.map.dialog.hasDialogInMobilePanelOpened
){this.parent.removeWindow(this);this._currentDepth=0;if(window.mobileWizard===true){
app.dispatcher.dispatch("mobile_wizard")}else if(window.insertionMobileWizard===true){
app.dispatcher.dispatch("insertion_mobile_wizard")}else if(window.mobileMenuWizard===true){$(
"#main-menu-state").click()}else if(window.commentWizard===true){app.dispatcher.dispatch(
"comment_wizard")}else if(window.contextMenuWizard){window.contextMenuWizard=false;this.map.fire(
"closemobilewizard")}}else{this._currentDepth--;var parent=$(".ui-content.mobile-wizard:visible");
if(this._currentDepth>0&&parent)this._customTitle?this._setCustomTitle(parent.get(0).customTitleBar
):this._setTitle(parent.get(0).title);else this._customTitle?this._setCustomTitle(this._customTitle
):this._setTitle(this._mainTitle);var currentNode=$(
".ui-explorable-entry.level-"+this._currentDepth+".mobile-wizard:visible");
var headers=currentNode.siblings().filter(function(){var styleAttributeValue=$(this).attr("style");
return styleAttributeValue&&styleAttributeValue.includes("display: none;")});
var currentHeader=currentNode.children(".ui-header");headers=headers.add(currentHeader);
var parent=currentNode.parent();if(parent.hasClass("toolbox"))parent.siblings().each(function(){
var styleAttributeValue=$(this).attr("style");if(styleAttributeValue&&styleAttributeValue.includes(
"display: none;")){headers=headers.add($(this))}});headers=headers.not(".hidden");$(
".ui-content.level-"+this._currentDepth+".mobile-wizard:visible").hide();$(
"#mobile-wizard.funcwizard div#mobile-wizard-content").removeClass("showHelpBG");$(
"#mobile-wizard.funcwizard div#mobile-wizard-content").addClass("hideHelpBG");headers.show("slide",{
direction:"left"},"fast");const prevScroll=this.scrollPositions.pop();this.mobileWizard.scrollTop(
prevScroll);if(this._currentDepth==0||this._isTabMode&&this._currentDepth==1){this._inMainMenu=true;
this.backButton.addClass("close-button");if(this._isTabMode){this.titleBar.hide();
this.tabsContainer.show()}}if(window.commentWizard===true){app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name).removeHighlighters()}}},restoreTitle:function(){if(this.cusomTitle
)this._setCustomTitle(this.cusomTitle);else this._setTitle(this.title)},_setTitle:function(title){
this.title=title;this.titleNode.text(this.title)},_setCustomTitle:function(title){
this.cusomTitle=title;this.titleNode.html(this.cusomTitle)},_scrollToPosition:function(position){if(
this._currentScrollPosition){$(this.content).animate({scrollTop:position},0)}},selectedTab:function(
tabText){if(this._currentPath&&this._currentPath.length){this._currentPath=[tabText]}},
_selectTab:function(tabId){if(this.tabs&&tabId){for(var index in this.tabs.children){if(
this.tabs.children[index].id===tabId){$(this.tabs.children[index]).trigger("click",{animate:false});
break}}}},_goToPath:function(path){if(
this.tabs&&path&&path.length&&!this.map.dialog.hasDialogInMobilePanelOpened())this._selectTab(path[0
]);var _path=[];var goBack=false;for(var index in path){var elem=$("[title='"+path[index]+"'").prev(
);if(elem.length){$(elem).trigger("click",{animate:false});_path.push(path[index])}else goBack=true}
if(goBack){this._currentScrollPosition=0;$(this.content).animate({scrollTop:0},0)}
this._currentPath=_path},_onMobileWizard:function(data,callback){if(data){if(
data.jsontype==="dialog"&&data.action==="close"){this.parent.removeWindow(this,false);return}
this._inBuilding=true;
var isDocumentAreaPopup=data.popupParent==="_POPOVER_"&&data.posx!==undefined&&data.posy!==undefined
var isCalc=this.map._docLayer?this.map._docLayer._docType==="spreadsheet":false;
var isAutofilter=isDocumentAreaPopup&&isCalc;
var isPopupJson=data.jsontype==="popup"||data.type==="modalpopup"||data.type==="snackbar";
var isPopup=!isAutofilter&&isPopupJson;var isSidebar=false;if(data.children){for(
var i in data.children){if(data.children[i].type=="deck")isSidebar=true}}if(
!this._isActive&&isSidebar){if(this.map.showSidebar==false)return}if(
isSidebar&&!this.map.showSidebar){return}var isMobileDialog=data.id&&!isNaN(data.id)&&!isSidebar;if(
isMobileDialog){window.mobileDialogId=data.id;if(data.dialogid)this._dialogid=data.dialogid}
this._isActive=true;var currentPath=null;var lastScrollPosition=null;var alreadyOpen=this.isOpen();
if(this._currentPath)currentPath=this._currentPath;if(this._currentScrollPosition
)lastScrollPosition=this._currentScrollPosition;if(isPopup){var popupContainer=$(
".mobile-popup-container:visible");if(popupContainer.length){if(
data.action==="close"||data.action==="fadeout"){this.goLevelUp();popupContainer.empty()}else{
this.backButton.hide();popupContainer.empty();if(!this._builder){
this._builder=window.L.control.mobileWizardBuilder({windowId:data.id,mobileWizard:this,map:this.map,
cssClass:"mobile-wizard",useSetTabs:true})}this._builder.build(popupContainer.get(0),[data])}
this._inBuilding=false;return}else if(data.action==="close"||data.action==="fadeout"){
this.parent.removeWindow(this);return}else{var overlay=window.L.DomUtil.create("div",
"mobile-wizard jsdialog-overlay "+(data.cancellable?"cancellable":""),document.body);var that=this;
if(data.cancellable){overlay.onclick=function(){that.parent.removeWindow(that);
that._builder.callback("popover","close",{id:"__POPOVER__"},null,that._builder)}}}}this._reset();
this.isPopup=isPopupJson;this.isAutoCompletePopup=data.isAutoCompletePopup;
this.isPopupPartialScreen=data.isPopupPartialScreen;this.persistKeyboard=data.persistKeyboard;
this._showWizard();if(this.map._docLayer&&!this.map._docLayer.isCalc()&&!this.persistKeyboard){
this._hideKeyboard()}if(isSidebar)this._modifySidebarLayout(data);if(!alreadyOpen){
history.pushState({context:"mobile-wizard"},"mobile-wizard-opened");history.pushState({
context:"mobile-wizard",level:0},"mobile-wizard-level-0");this.mobileWizard.scrollTop(0)}if(
!this._builder){this._builder=window.L.control.mobileWizardBuilder({windowId:data.id,
mobileWizard:this,map:this.map,cssClass:"mobile-wizard",callback:callback,useSetTabs:true})}
this._builder.build(this.content,[data]);if(window.ThisIsTheAndroidApp)window.postMobileMessage(
"hideProgressbar");this._mainTitle=data.text?data.text:"";this._customTitle=data.customTitle;
this._customTitle?this._setCustomTitle(this._customTitle):this._setTitle(this._mainTitle);if(
data.id==="menubar"||data.id==="insertshape"){document.getElementById("mobile-wizard"
).style.height="100vh";if(data.id==="menubar")this.isHamburgerMenu=true;else if(
data.id==="insertshape"){this.isShapesWizard=true}$("#mobile-wizard").css("top",$(
"#document-container").css("top"))}else if(data.id==="funclist"){document.getElementById(
"mobile-wizard").style.height="100vh";$("#mobile-wizard").css("top",$("#document-container").css(
"top"));this.isFunctionMenu=true}else if(
data.id==="modal-dialog-about-dialog-box"||data.id==="modal-dialog-unlock-features-popup"){
isPopup=true}else{document.getElementById("mobile-wizard").style.height=this.options.maxHeight;$(
"#mobile-wizard").css("top","")}if(!this.map._docLoaded&&!isPopup){$("#mobile-wizard").height("100%"
);this.backButton.removeClass("close-button")}if(this._isActive&&currentPath&&currentPath.length){
this._goToPath(currentPath);this._scrollToPosition(lastScrollPosition)}if(isPopup){$(
".mobile-wizard-scroll-indicator").hide();this.titleBar.hide();if(data.type==="snackbar"){
var that=this;this.isSnackBar=true;this.snackBarTimout=setTimeout(function(){
that.parent.removeWindow(that)},data.timeout?data.timeout:this.options.snackbarTimeout)}else if(
data.id==="busypopup"){var that=this;this.isBusyPopUp=true}}this._applySpecialClasses();
this._inBuilding=false}},_isSlidePropertyPanel:function(data){
var backgroundPanel=app.LOUtil.findItemWithAttributeRecursive(data,"id","SlideBackgroundPanel");
var layoutPanel=app.LOUtil.findItemWithAttributeRecursive(data,"id","SdLayoutsPanel");
return backgroundPanel&&layoutPanel},_insertCalcBorders:function(deck){
var replaceMe=app.LOUtil.findItemWithAttributeRecursive(deck,"id","cellbordertype");if(replaceMe){
replaceMe.id="borderstyle";replaceMe.type="borderstyle";replaceMe.text="";replaceMe.enabled="true";
replaceMe.children=[]}},_modifySidebarLayout:function(data){if(
data.children&&data.children.length&&data.children[0].type!=="deck")data.children.splice(0,1);
var deck=app.LOUtil.findItemWithAttributeRecursive(data,"type","deck");if(deck){
var stylesIdx=app.LOUtil.findIndexInParentByAttribute(deck,"name","StylesPropertyPanel");
var textIdx=app.LOUtil.findIndexInParentByAttribute(deck,"name","TextPropertyPanel");if(
stylesIdx>=0&&this.map.getDocType()==="spreadsheet"){deck.children.splice(stylesIdx,1)}else if(
stylesIdx>=0&&textIdx>=0){var moveContent=deck.children[stylesIdx].children[0].children;
deck.children[textIdx].children[0].children=moveContent.concat(deck.children[textIdx].children[0
].children);deck.children.splice(stylesIdx,1)}var removeItems=["borderlinestyle","editcontour",
"spacingbar","linespacing","stylenew","styleupdate","beginarrowstyle","endarrowstyle"];if(
this.map.getDocType()==="presentation")removeItems.push("indentfieldbox");this._removeItems(deck,
removeItems);this._insertCalcBorders(deck)}},_removeItems:function(data,items){if(data.children){
for(var i=0;i<data.children.length;){var childRemoved=false;for(var j=0;j<items.length;j++){if(
data.children[i].id===items[j]){data.children.splice(i,1);childRemoved=true;break}}if(!childRemoved
){if(data.children[i])this._removeItems(data.children[i],items);i++}}}},onJSUpdate:function(e){
var data=e.data;if(data.jsontype==="notebookbar")return;var container=this.content;if(!container
)return;var control=container.querySelector("[id='"+data.control.id+"']");if(!control){
window.app.console.warn('jsdialogupdate: not found control with id: "'+data.control.id+'"');return}
var parent=control.parentNode;if(!parent)return;var scrollTop=control.scrollTop;
var wasHidden=control.style.display==="none";control.style.visibility="hidden";if(!this._builder
)return;this._inBuilding=true;var classList=control.className.split(" ");var currentLevel=null;for(
var i in classList){if(classList[i].indexOf("level-")>=0){currentLevel=classList[i];break}}if(
currentLevel){currentLevel=parseInt(currentLevel.substring("level-".length));
this._builder._currentDepth=currentLevel}var temporaryParent=window.L.DomUtil.create("div");
this._builder.build(temporaryParent,[data.control],false);parent.insertBefore(
temporaryParent.firstChild,control.nextSibling);var backupGridSpan=control.style.gridColumn;
window.L.DomUtil.remove(control);this._builder._currentDepth=0;if(this._currentPath.length){
var elem=$("[title='"+this._currentPath[this._currentPath.length-1]+"'").prev(":visible");if(
elem.length){this._currentPath.pop();this._currentDepth--;$(elem).trigger("click",{animate:false})}}
var newControl=container.querySelector("[id='"+data.control.id+"']");if(newControl){if(wasHidden
)newControl.style.display="none";newControl.scrollTop=scrollTop;
newControl.style.gridColumn=backupGridSpan}$(this.content).animate({
scrollTop:this._currentScrollPosition},0);this._inBuilding=false},onJSAction:function(e){
var data=e.data;if(data.jsontype==="notebookbar")return;if(!this._builder)return;if(!this.content
)return;if(data.data&&data.jsontype==="sidebar"&&(
data.data.control_id==="contents"||data.data.control_id==="Panel"||data.data.control_id==="titlebar"
)){window.app.console.log(
"Ignored action: "+data.data.action_type+" for control: "+data.data.control_id);return}
this._builder.executeAction(this.content,data.data)}});window.L.control.mobileWizardWindow=function(
mobileWizard,id){return new window.L.Control.MobileWizardWindow(mobileWizard,id)};
window.L.Control.MobileWizard=window.L.Control.extend({initialize:function(options){
window.L.setOptions(this,options)},onAdd:function(map){this.map=map;if(!window.mode.isMobile()
)return;this.contents=[];map.on("mobilewizard",this._onMobileWizard,this);map.on("closemobilewizard"
,this._closeWizard,this);map.on("showwizardsidebar",this._showWizardSidebar,this);map.on(
"mobilewizardback",this.goLevelUp,this);map.on("resize",this._onResize,this);map.on("jsdialogupdate"
,this.onJSUpdate,this);map.on("jsdialogaction",this.onJSAction,this);this._setupBackButton()},
onRemove:function(){this.map.off("mobilewizard",this._onMobileWizard,this);this.map.off(
"closemobilewizard",this._closeWizard,this);this.map.off("showwizardsidebar",this._showWizardSidebar
,this);this.map.off("mobilewizardback",this.goLevelUp,this);this.map.off("resize",this._onResize,
this);this.map.off("jsdialogupdate",this.onJSUpdate,this);this.map.off("jsdialogaction",
this.onJSAction,this)},_setupBackButton:function(){this.backButton=$("#mobile-wizard-back");
this.backButton.click(function(){history.back()})},_showWizardSidebar:function(event){
this.map.showSidebar=true;if(!event||!event.noRefresh)this._refreshSidebar()},_closeWizard:function(
){var items=this.contents.length;while(items--)this.removeWindow(this.contents[0])},
_hideWizard:function(){$(".jsdialog-overlay").remove();if(
this.map.dialog.hasDialogInMobilePanelOpened()){this.map.dialog._onDialogClose(window.mobileDialogId
,true);window.mobileDialogId=undefined}if(window.commentWizard===true&&app.sectionContainer){
app.sectionContainer.getSectionWithName(app.CSections.CommentList.name).removeHighlighters()}if(
!this.contents.length)$("#mobile-wizard").hide();document.getElementById("mobile-wizard"
).classList.remove("menuwizard");document.getElementById("mobile-wizard").classList.remove(
"shapeswizard");if(!document.getElementById("document-container").classList.contains("landscape")){
var pcw=document.getElementById("presentation-controls-wrapper");if(pcw)pcw.style.display="block"}
if(this.map.isEditMode()){$("#toolbar-down").show()}if(window.ThisIsTheAndroidApp
)window.postMobileMessage("MOBILEWIZARD hide");this.map.showSidebar=false;this._isActive=false;
this._dialogid="";this._currentPath=[];window.pageMobileWizard=false;if(window.mobileWizard===true
)window.mobileWizard=false;if(window.insertionMobileWizard===true)window.insertionMobileWizard=false
if(window.pageMobileWizard===true)window.pageMobilewizard=false;if(window.commentWizard===true
)window.commentWizard=false;this._updateToolbarItemStateByClose();if(!this.map.hasFocus()){
this.map.focus()}if(this.map.uiManager.sheetsBar)this.map.uiManager.sheetsBar.show()},
isOpen:function(){return $("#mobile-wizard").is(":visible")},
_updateToolbarItemStateByClose:function(){const mobileWizard=document.getElementById("mobile_wizard"
);if(window.mobileWizard===false&&mobileWizard&&mobileWizard.classList.contains("selected")
)mobileWizard.classList.remove("selected");const insertionMobileWizard=document.getElementById(
"insertion_mobile_wizard");if(
window.insertionMobileWizard===false&&insertionMobileWizard&&insertionMobileWizard.classList.contains(
"selected"))insertionMobileWizard.classList.remove("selected");
const commentWizard=document.getElementById("comment_wizard");if(
window.commentWizard===false&&commentWizard&&commentWizard.classList.contains("selected")
)commentWizard.classList.remove("selected")},goLevelDown:function(contentToShow,options){if(
this.contents.length)this.contents[this.contents.length-1].goLevelDown(contentToShow,options)},
goLevelUp:function(){if(this.contents.length)this.contents[this.contents.length-1].goLevelUp()},
_onResize:function(){window.L.DomUtil.updateElementsOrientation(["mobile-wizard",
"mobile-wizard-content"])},selectedTab:function(tabText){
var topWindow=this.contents.length?this.contents[this.contents.length-1]:null;if(topWindow
)topWindow.selectedTab(tabText)},_getContentForWindowId:function(id){for(var i in this.contents){if(
this.contents[i].id==="mobile-wizard-content-"+id)return this.contents[i]}return null},
_refreshSidebar:function(ms){ms=ms!==undefined?ms:400;setTimeout(function(){
var message="dialogevent "+(window.sidebarId!==undefined?window.sidebarId:-1)+' {"id":"-1"}';
app.socket.sendMessage(message)},ms)},_onMobileWizard:function(data){var callback=data.callback;
data=data.data;if(data){var existingWindow=this._getContentForWindowId(data.id);if(existingWindow){
existingWindow._onMobileWizard(data,callback)}else{
var newWindow=window.L.control.mobileWizardWindow(this,"mobile-wizard-content-"+data.id);for(
var i in this.contents)this.contents[i].hideWindow();this.contents.push(newWindow);
this.map.addControl(newWindow);newWindow._onMobileWizard(data,callback)}}},removeWindow:function(
window){var pos=this.contents.indexOf(window);if(pos>=0){var wasPopup=false;if(pos>0&&this.contents[
pos].isPopup){wasPopup=true}this.map.removeControl(window);this.contents.splice(pos,1);if(
this.contents.length){var parentWindow=this.contents[this.contents.length-1];
parentWindow.showWindow();if(wasPopup)parentWindow.goLevelUp()}this._hideWizard()}},
onJSUpdate:function(e){var data=e.data;if(data.jsontype==="notebookbar")return;
var existingWindow=this._getContentForWindowId(data.id);if(existingWindow){
existingWindow.onJSUpdate(e)}},onJSAction:function(e){var data=e.data;if(
data.jsontype==="notebookbar")return;var existingWindow=this._getContentForWindowId(data.id);if(
existingWindow){existingWindow.onJSAction(e)}}});window.L.control.mobileWizard=function(options){
return new window.L.Control.MobileWizard(options)};
window.L.Control.LanguageDialog=window.L.Control.extend({onAdd:function(map){this.map=map;map.on(
"morelanguages",this._onLanguageDialog,this)},onRemove:function(map){map.off("morelanguages",
this._onLanguageDialog,this)},_onItemSelected:function(language){
var unoCommand=".uno:LanguageStatus?Language:string="+this.applyTo+"_"+language;
this.map.sendUnoCommand(unoCommand,null,true)},_getSelectedLanguage:function(){
var languageAndCode=this._map["stateChangeHandler"].getItemValue(".uno:LanguageStatus");
var split=languageAndCode.split(";");var language="";if(split.length>1)language=split[0
];else window.app.console.error("Language not found");return language},_onLanguageDialog:function(e
){var languageEntries=[];this.selectedLanguage=this._getSelectedLanguage();switch(e.applyto){
case"all":this.applyTo="Default";break;case"paragraph":this.applyTo="Paragraph";break;
case"selection":this.applyTo="Current";break;default:this.applyTo="Default";break}
languageEntries.push({columns:[{text:_("None (Do not check spelling)")}],row:"LANGUAGE_NONE",
selected:"LANGUAGE_NONE"===this.selectedLanguage});var that=this;app.languages.forEach(function(
language){languageEntries.push({columns:[{text:language.neutral}],row:language.neutral,
selected:language.neutral===that.selectedLanguage})});var data={id:"LanguageDialog",
dialogid:"LanguageDialog",type:"dialog",title:_("Select language"),jsontype:"dialog",responses:[{
id:"ok",response:1},{id:"cancel",response:0}],children:[{id:"LanguageDialog-mainbox",
type:"container",vertical:true,children:[{type:"treelistbox",id:"languages",headers:[{text:_(
"Language")}],entries:languageEntries},{id:"LanguageDialog-buttonbox",type:"buttonbox",children:[{
id:"cancel",type:"pushbutton",text:_("Cancel")},{id:"ok",has_default:true,type:"pushbutton",text:_(
"OK")}],vertical:false,layoutstyle:"end"}]}]};var dialogBuildEvent={data:data,
callback:this._onAction.bind(this)};this.map.fire(window.mode.isMobile()?"mobilewizard":"jsdialog",
dialogBuildEvent)},_onAction:function(element,action,data,index){if(
element==="responsebutton"&&data.id==="ok")this._onItemSelected(this.selectedLanguage);else if(
element==="treeview"){if(action=="select")this.selectedLanguage=index;return}var closeEvent={data:{
action:"close",id:"LanguageDialog"}};this.map.fire(window.mode.isMobile(
)?"closemobilewizard":"jsdialog",closeEvent)}});window.L.control.languageDialog=function(options){
return new window.L.Control.LanguageDialog(options)};
window.L.Control.MobileSlide=window.L.Control.extend({options:{position:"bottomright"},
onAdd:function(map){this._map=map;if(!this._container){this._initLayout()}return this._container},
onRemove:function(){this._map=undefined},_onAddSlide:function(){this._map.insertPage()},
_initLayout:function(){this._container=window.L.DomUtil.create("div",
"leaflet-control-zoom leaflet-bar");this._createButton("+","","leaflet-control-zoom-in",
this._container,this._onAddSlide,this);return this._container},_createButton:function(html,title,
className,container,fnOnClick,context){var button=window.L.DomUtil.create("a",className,container);
button.innerHTML=html;button.href="#";button.title=title;window.L.DomEvent.on(button,"click",
window.L.DomEvent.stopPropagation).on(button,"mousedown",window.L.DomEvent.stopPropagation).on(
button,"click",window.L.DomEvent.preventDefault).on(button,"click",this._map.focus,this._map).on(
button,"click",fnOnClick,context);return button}});window.L.control.mobileSlide=function(options){
return new window.L.Control.MobileSlide(options)};class StatusBar extends JSDialog.Toolbar{
constructor(map){super(map,"Statusbar","toolbar-down");map.on("doclayerinit",this.onDocLayerInit,
this);map.on("languagesupdated",this.onLanguagesUpdated,this);map.on("commandstatechanged",
this.onCommandStateChanged,this);app.events.on("contextchange",this.onContextChange.bind(this));
app.events.on("updatepermission",this.onPermissionChanged.bind(this));map.on("updatestatepagenumber"
,this.onPageChange,this);map.on("search",this.onSearch,this);map.on("zoomend",this.onZoomEnd,this);
map.on("initmodificationindicator",this.onInitModificationIndicator,this);map.on(
"updatemodificationindicator",this.onUpdateModificationIndicator,this)}isSaveIndicatorActive(){
return window.useStatusbarSaveIndicator}localizeStateTableCell(text){var stateArray=text.split(";");
var stateArrayLength=stateArray.length;var localizedText="";for(var i=0;i<stateArrayLength;i++){
var labelValuePair=stateArray[i].split(":");localizedText+=_(labelValuePair[0].trim()
)+":"+labelValuePair[1];if(stateArrayLength>1&&i<stateArrayLength-1){localizedText+="; "}}
return localizedText}toLocalePattern(pattern,regex,text,sub1,sub2){var matches=new RegExp(regex,"g"
).exec(text);if(matches){text=pattern.toLocaleString().replace(sub1,parseInt(matches[1].replace(/,/g
,"")).toLocaleString(String.locale)).replace(sub2,parseInt(matches[2].replace(/,/g,"")
).toLocaleString(String.locale))}return text}_updateToolbarsVisibility(context){
var isReadOnly=this.map.isReadOnlyMode();if(isReadOnly){this.enableItem("languagestatus",false);
this.showItem("insertmode-container",false);this.showItem("statusselectionmode-container",false)
}else{this.enableItem("languagestatus",true)}this.updateVisibilityForToolbar(context)}
onContextChange(event){this._updateToolbarsVisibility(event.detail.context)}callback(objectType,
eventType,object,data,builder){if(object.id==="search-input"||object.id==="search"){return}else if(
object.id==="zoom"){var selected=this._generateZoomItems().filter(item=>{return item.id===data});if(
selected.length)this.map.setZoom(selected[0].scale,null,true);return}else if(
object.id==="StateTableCellMenu"){var selected=[];if(data==="1"){selected=["1"]}else{selected=[data]
}var value=0;for(var it=0;it<selected.length;it++){value=+value+parseInt(selected[it])}var command={
StatusBarFunc:{type:"unsigned short",value:value}};this.map.sendUnoCommand(".uno:StatusBarFunc",
command);return}this.builder._defaultCallbackHandler(objectType,eventType,object,data,builder)}
onSearch(e){var searchInput=window.L.DomUtil.get("search-input");if(e.count===0){this.enableItem(
"searchprev",false);this.enableItem("searchnext",false);this.showItem("cancelsearch",false);
window.L.DomUtil.addClass(searchInput,"search-not-found");$("#findthis").addClass("search-not-found"
);app.searchService.resetSelection();setTimeout(function(){$("#findthis").removeClass(
"search-not-found");window.L.DomUtil.removeClass(searchInput,"search-not-found")},800)}}onZoomEnd(){
var zoomPercent=this.map.getZoomPercent();var zoomSelected="zoom"+zoomPercent;
this.builder.updateWidget(this.parentContainer,{id:"zoom",type:"menubutton",text:""+zoomPercent,
selected:zoomSelected,menu:this._generateZoomItems(),image:false})}onPageChange(e){var state=e.state
state=this.toLocalePattern("Page %1 of %2","Page (\\d+) of (\\d+)",state,"%1","%2");
this.updateHtmlItem("StatePageNumber",state?state:" ")}onShowCommentsChange(e){var state=e.state;
var statemsg;if(state==="true")statemsg=_UNO(".uno:ShowAnnotations")+": "+_("On");else if(
state==="false")statemsg=_UNO(".uno:ShowAnnotations")+": "+_("Off");$("#showcomments-container"
).attr("default-state",state||null);this.updateHtmlItem("ShowComments",state?statemsg:" ")}
_generateHtmlItem(id,dataPriority){var isReadOnlyMode=app.map?app.map.isReadOnlyMode():true;
var canUserWrite=!app.isReadOnly();const item={type:"container",id:id+"-container",children:[{
type:"htmlcontent",id:id,htmlId:id,text:" ",isReadOnlyMode:isReadOnlyMode,canUserWrite:canUserWrite}
,{type:"separator",id:id+"break",orientation:"vertical"}],vertical:false,visible:false};if(
dataPriority){item.dataPriority=dataPriority}return item}_generateStateMenuEntry(id,text,selection){
return{id:id,text:text,selected:!!(selection&parseInt(id))}}_generateStateTableCellMenuItem(
selection,visible){var submenu=[this._generateStateMenuEntry("2",_("Average"),selection),
this._generateStateMenuEntry("8",_("CountA"),selection),this._generateStateMenuEntry("4",_("Count"),
selection),this._generateStateMenuEntry("16",_("Maximum"),selection),this._generateStateMenuEntry(
"32",_("Minimum"),selection),this._generateStateMenuEntry("512",_("Sum"),selection),
this._generateStateMenuEntry("8192",_("Selection count"),selection),this._generateStateMenuEntry("1"
,_("None"),selection)];var selected=submenu.filter(item=>{return item.selected}).map(item=>{
return item.text});var text=selected.length?selected.join("; "):_("None");return{type:"menubutton",
id:"StateTableCellMenu",text:text,image:false,menu:submenu,visible:visible,dataPriority:5}}
_generateZoomItems(){return[{id:"zoom20",text:"20",scale:1},{id:"zoom25",text:"25",scale:2},{
id:"zoom30",text:"30",scale:3},{id:"zoom35",text:"35",scale:4},{id:"zoom40",text:"40",scale:5},{
id:"zoom50",text:"50",scale:6},{id:"zoom60",text:"60",scale:7},{id:"zoom70",text:"70",scale:8},{
id:"zoom85",text:"85",scale:9},{id:"zoom100",text:"100",scale:10},{id:"zoom120",text:"120",scale:11}
,{id:"zoom150",text:"150",scale:12},{id:"zoom170",text:"170",scale:13},{id:"zoom200",text:"200",
scale:14},{id:"zoom235",text:"235",scale:15},{id:"zoom280",text:"280",scale:16},{id:"zoom335",
text:"335",scale:17},{id:"zoom400",text:"400",scale:18}]}getToolItems(){return[
this._generateHtmlItem("statusdocpos"),this._generateHtmlItem("rowcolselcount",1),
this._generateHtmlItem("statepagenumber"),this._generateHtmlItem("statewordcount",1),
this._generateHtmlItem("insertmode",5),this._generateHtmlItem("showcomments",4),
this._generateHtmlItem("statusselectionmode",6),this._generateHtmlItem("slidestatus"),
this._generateHtmlItem("pagestatus"),{type:"menubutton",id:"languagestatus:LanguageStatusMenu",
dataPriority:3},{type:"separator",id:"languagestatusbreak",orientation:"vertical",visible:false,
dataPriority:3},this._generateHtmlItem("statetablecell",4),this._generateStateTableCellMenuItem(2,
false),{type:"separator",id:"statetablebreak",orientation:"vertical",visible:false,dataPriority:7},
this._generateHtmlItem("permissionmode"),{type:"toolitem",id:"signstatus",command:".uno:Signature",
w2icon:"",text:_UNO(".uno:Signature"),visible:false},{type:"spacer",id:"permissionspacer"},
this._generateHtmlItem("documentstatus",2),{type:"customtoolitem",id:"prev",command:"prev",
text:_UNO(".uno:PageUp","text"),pressAndHold:true,dataPriority:9},{type:"customtoolitem",id:"next",
command:"next",text:_UNO(".uno:PageDown","text"),pressAndHold:true,dataPriority:9},{
type:"separator",id:"prevnextbreak",orientation:"vertical",dataPriority:9}].concat(
window.mode.isTablet()?[]:[{type:"customtoolitem",id:"zoomreset",command:"zoomreset",text:_(
"Reset zoom"),icon:"zoomreset.svg",dataPriority:8},{type:"customtoolitem",id:"zoomout",
command:"zoomout",text:_UNO(".uno:ZoomMinus"),icon:"minus.svg"},{type:"menubutton",id:"zoom",
text:"100",selected:"zoom100",menu:this._generateZoomItems(),image:false},{type:"customtoolitem",
id:"zoomin",command:"zoomin",text:_UNO(".uno:ZoomPlus"),icon:"plus.svg"}])}create(){if(
this.parentContainer.firstChild)return;this.parentContainer.replaceChildren();this.builder.build(
this.parentContainer,this.getToolItems());this.onLanguagesUpdated();JSDialog.MakeStatusPriority(
this.parentContainer.querySelector("div"),this.getToolItems());JSDialog.RefreshScrollables()}
onDocLayerInit(){var showStatusbar=this.map.uiManager.getBooleanDocTypePref("ShowStatusbar",true);
if(showStatusbar)this.map.uiManager.showStatusBar();else this.map.uiManager.hideStatusBar(true);
var docType=this.map.getDocType();switch(docType){case"spreadsheet":this.showItem("prev",false);
this.showItem("next",false);this.showItem("prevnextbreak",false);if(!window.mode.isMobile()){
this.showItem("statusdocpos-container",true);this.showItem("rowcolselcount-container",true);
this.showItem("insertmode-container",true);this.showItem("statusselectionmode-container",true);
this.showItem("languagestatus",!app.map.isReadOnlyMode());this.showItem("languagestatusbreak",
!app.map.isReadOnlyMode());this.showItem("statetablecell-container",true);this.showItem(
"StateTableCellMenu",!app.map.isReadOnlyMode());this.showItem("statetablebreak",
!app.map.isReadOnlyMode());this.showItem("permissionmode-container",true);this.showItem(
"documentstatus-container",true)}break;case"text":if(!window.mode.isMobile()){this.showItem(
"statepagenumber-container",true);this.showItem("statewordcount-container",true);this.showItem(
"insertmode-container",true);this.showItem("statusselectionmode-container",true);this.showItem(
"languagestatus",!app.map.isReadOnlyMode());this.showItem("languagestatusbreak",
!app.map.isReadOnlyMode());this.showItem("permissionmode-container",true);this.showItem(
"showcomments-container",true);this.showItem("documentstatus-container",true)}break;
case"presentation":if(!window.mode.isMobile()){this.showItem("slidestatus-container",true);
this.showItem("languagestatus",!app.map.isReadOnlyMode());this.showItem("languagestatusbreak",
!app.map.isReadOnlyMode());this.showItem("permissionmode-container",true);this.showItem(
"documentstatus-container",true)}break;case"drawing":if(!window.mode.isMobile()){this.showItem(
"pagestatus-container",true);this.showItem("languagestatus",!app.map.isReadOnlyMode());
this.showItem("languagestatusbreak",!app.map.isReadOnlyMode());this.showItem(
"permissionmode-container",true);this.showItem("documentstatus-container",true)}break}
var language=app.map["stateChangeHandler"].getItemValue(".uno:LanguageStatus");if(language
)this.updateLanguageItem(this.extractLanguageFromStatus(language));this._updateToolbarsVisibility();
JSDialog.RefreshScrollables()}show(){this.parentContainer.style.display="";
JSDialog.RefreshScrollables()}hide(){this.parentContainer.style.display="none"}updateHtmlItem(id,
text,disabled){this.builder.updateWidget(this.parentContainer,{id:id,type:"htmlcontent",
htmlId:id.toLowerCase(),text:text,enabled:!disabled});JSDialog.RefreshScrollables()}
updateLanguageItem(language){if(app.map.isReadOnlyMode())return;this.builder.updateWidget(
this.parentContainer,{type:"menubutton",id:"languagestatus:LanguageStatusMenu",noLabel:false,
text:language});JSDialog.RefreshScrollables()}showSigningItem(icon,text){this.builder.updateWidget(
this.parentContainer,{type:"toolitem",id:"signstatus",command:".uno:Signature",w2icon:icon,
text:text?text:_UNO(".uno:Signature")});JSDialog.RefreshScrollables()}onPermissionChanged(event){
var isReadOnlyMode=event.detail.perm==="readonly";if(isReadOnlyMode){$("#toolbar-down").addClass(
"readonly")}else{$("#toolbar-down").removeClass("readonly")}
var canUserWrite=window.ThisIsAMobileApp?!app.isReadOnly():this.map["wopi"].UserCanWrite;
var NotEditDocMode=false;if(app.map["stateChangeHandler"].getItemValue("EditDoc")!==undefined){
NotEditDocMode=app.map["stateChangeHandler"].getItemValue("EditDoc")==="false";if(NotEditDocMode
)app.map.uiManager.showSnackbar(_(
"To prevent accidental changes, the author has set this file to open as view-only"))}
canUserWrite=canUserWrite&&!NotEditDocMode;var permissionContainer=document.getElementById(
"permissionmode-container");if(permissionContainer){while(permissionContainer.firstChild
)permissionContainer.removeChild(permissionContainer.firstChild);permissionContainer.appendChild(
getPermissionModeElements(isReadOnlyMode,canUserWrite,this.map))}this.builder.updateWidget(
this.parentContainer,{id:"PermissionMode",type:"htmlcontent",htmlId:"permissionmode",
isReadOnlyMode:isReadOnlyMode,canUserWrite:canUserWrite});JSDialog.RefreshScrollables()}
extractLanguageFromStatus(state){var code=state;var language=_(state);var split=code.split(";");if(
split.length>1)language=_(split[0]);return language}onCommandStateChanged(e){
var commandName=e.commandName;var state=e.state;if(!commandName)return;if(
commandName===".uno:StatusDocPos"){state=this.toLocalePattern("Sheet %1 of %2",
"Sheet (\\d+) of (\\d+)",state,"%1","%2");this.updateHtmlItem("StatusDocPos",state?state:" ")
}else if(commandName===".uno:LanguageStatus"){var language=this.extractLanguageFromStatus(state);
this.updateLanguageItem(language)}else if(commandName===".uno:RowColSelCount"){
state=this.toLocalePattern("$1 rows, $2 columns selected","(\\d+) rows, (\\d+) columns selected",
state,"$1","$2");state=this.toLocalePattern("$1 of $2 records found",
"(\\d+) of (\\d+) records found",state,"$1","$2");this.updateHtmlItem("RowColSelCount",
state?state:_("Select multiple cells"),!state)}else if(commandName===".uno:InsertMode"){
this.updateHtmlItem("InsertMode",state?window.L.Styles.insertMode[state].toLocaleString():" ",!state
);$("#InsertMode").removeClass();$("#InsertMode").addClass("jsdialog ui-badge insert-mode-"+state);
var isDefaultState=state==="true"||state==="";$("#insertmode-container").attr("default-state",
isDefaultState||null);if((state==="false"||!state)&&URLPopUpSection.isOpen()){
this.map.hyperlinkUnderCursor=null;URLPopUpSection.closeURLPopUp()}}else if(
commandName===".uno:StatusSelectionMode"||commandName===".uno:SelectionMode"){$(
"#statusselectionmode-container").attr("default-state",state==="0"||null);this.updateHtmlItem(
"StatusSelectionMode",state?window.L.Styles.selectionMode[state].toLocaleString():_(
"Selection mode: inactive"),!state)}else if(commandName==".uno:StateTableCell"){this.updateHtmlItem(
"StateTableCell",state?this.localizeStateTableCell(state):" ")}else if(
commandName===".uno:StatusBarFunc"){if(app.map.isReadOnlyMode())return;if(state==="0")state="1";try{
state=parseInt(state)}catch(e){console.error(e);state=1}this.builder.updateWidget(
this.parentContainer,this._generateStateTableCellMenuItem(state,true));JSDialog.RefreshScrollables()
}else if(commandName===".uno:StatePageNumber"){this.onPageChange(e);return}else if(
commandName==="showannotations"){this.onShowCommentsChange(e);return}else if(
commandName===".uno:StateWordCount"){state=this.toLocalePattern("%1 words, %2 characters",
"([\\d,]+) words, ([\\d,]+) characters",state,"%1","%2");this.updateHtmlItem("StateWordCount",
state?state:" ")}else if(commandName===".uno:PageStatus"){if(this.map.getDocType()==="presentation"
){state=this.toLocalePattern("Slide %1 of %2","Slide (\\d+) of (\\d+)",state,"%1","%2");
this.updateHtmlItem("SlideStatus",state?state:" ")}else{state=this.toLocalePattern("Page %1 of %2",
"Slide (\\d+) of (\\d+)",state,"%1","%2");this.updateHtmlItem("PageStatus",state?state:" ")}
}else if(commandName===".uno:EditDoc"){state=state!=="false";$("#permissionmode-container").attr(
"default-state",this.map.isEditMode()||null);this.onPermissionChanged({detail:{
perm:state&&this.map.isEditMode()?"edit":"readonly"}})}else if(commandName===".uno:Signature"){
this.map.onChangeSignStatus(state)}}onLanguagesUpdated(){var menuEntries=[];var translated,neutral;
var constLang=".uno:LanguageStatus?Language:string=";var constDefault="Default_RESET_LANGUAGES";
var constNone="Default_LANGUAGE_NONE";var resetLang=_("Reset to Default Language");var noneLang=_(
"None (Do not check spelling)");var languages=app.languages;menuEntries.push({id:"nonelanguage",
uno:constLang+constNone,text:noneLang});for(var lang in languages){if(
languages.length>10&&app.favouriteLanguages.indexOf(languages[lang].iso)<0)continue;
translated=languages[lang].translated;neutral=languages[lang].neutral;
var splitNeutral=neutral.split(";");menuEntries.push({id:neutral,text:translated,
uno:constLang+encodeURIComponent("Default_"+splitNeutral[0])})}menuEntries.push({id:"reset",
text:resetLang,uno:constLang+constDefault});menuEntries.push({id:"morelanguages",
action:"morelanguages-all",text:_("Set Language for All text")});if(this.map.getDocType()==="text"){
menuEntries.push({id:"langpara",action:"morelanguages-paragraph",text:_("Set Language for Paragraph"
)});menuEntries.push({id:"langselection",action:"morelanguages-selection",text:_(
"Set Language for Selection")})}JSDialog.MenuDefinitions.set("LanguageStatusMenu",menuEntries)}
updateDefaultStateAttribute(){const docstatcontainer=document.getElementById(
"documentstatus-container");const documentStatus=document.getElementById("DocumentStatus");if(
documentStatus&&(!documentStatus.textContent||documentStatus.textContent.trim()==="")){
docstatcontainer.setAttribute("default-state","true")}else if(docstatcontainer.hasAttribute(
"default-state")){docstatcontainer.removeAttribute("default-state")}}onInitModificationIndicator(
lastmodtime){if(!this.isSaveIndicatorActive())return;const docstatcontainer=document.getElementById(
"documentstatus-container");if(lastmodtime==null){if(
docstatcontainer!==null&&docstatcontainer!==undefined){docstatcontainer.classList.add("hidden")}
return}docstatcontainer.classList.remove("hidden");this.updateDefaultStateAttribute();this.map.fire(
"modificationindicatorinitialized")}onUpdateModificationIndicator(e){if(!this.isSaveIndicatorActive(
))return;if(this._lastModstatus!==e.status){this.updateHtmlItem("DocumentStatus",e.status);
this._lastModStatus=e.status;this.updateDefaultStateAttribute()}if(
e.lastSaved!==null&&e.lastSaved!==undefined){const lastSaved=document.getElementById("last-saved");
if(lastSaved!==null&&lastSaved!==undefined){lastSaved.textContent=e.lastSaved}}}}
JSDialog.StatusBar=function(map){return new StatusBar(map)};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var MobileSearchBar=function(_super){__extends(MobileSearchBar,
_super);function MobileSearchBar(map){return _super.call(this,map,"MobileSearchBar","toolbar-search"
)||this}MobileSearchBar.prototype.getToolItems=function(){return[{type:"customtoolitem",
id:"hidesearchbar",w2icon:"unfold",text:_("Hide the search bar")},{type:"searchedit",id:"search",
placeholder:_("Search"),text:""},{type:"customtoolitem",id:"searchprev",text:_UNO(".uno:UpSearch"),
enabled:false,pressAndHold:true},{type:"customtoolitem",id:"searchnext",text:_UNO(".uno:DownSearch"
),enabled:false,pressAndHold:true},{type:"customtoolitem",id:"cancelsearch",text:_(
"Clear the search field"),visible:false},{type:"spacer",id:"left"}]};
MobileSearchBar.prototype.create=function(){var items=this.getToolItems();this.builder.build(
this.parentContainer,items,undefined)};return MobileSearchBar}(Toolbar);
JSDialog.MobileSearchBar=function(map){return new MobileSearchBar(map)};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var MobileTopBar=function(_super){__extends(MobileTopBar,_super
);function MobileTopBar(map){var _this=_super.call(this,map,"MobileTopBar","toolbar-up")||this;
app.events.on("updatepermission",_this.onUpdatePermission.bind(_this));map.on("commandstatechanged",
_this.onCommandStateChanged,_this);return _this}MobileTopBar.prototype.getToolItems=function(){if(
this.docType=="text"){return[{type:"toolitem",id:"signstatus",command:".uno:Signature",w2icon:"",
text:_UNO(".uno:Signature"),visible:false},{type:"toolitem",id:"undo",text:_UNO(".uno:Undo"),
command:".uno:Undo",enabled:false},{type:"toolitem",id:"redo",text:_UNO(".uno:Redo"),
command:".uno:Redo",enabled:false},{type:"spacer",id:"before-permissionmode"},
this._generateHtmlItem("permissionmode"),{type:"spacer",id:"after-permissionmode"},{
type:"customtoolitem",id:"mobile_wizard",command:"mobile_wizard"},{type:"customtoolitem",
id:"insertion_mobile_wizard",command:"insertion_mobile_wizard"},{type:"customtoolitem",
id:"comment_wizard",command:"comment_wizard",w2icon:"viewcomments"},{type:"menubutton",
id:"userlist:UsersListMenu",visible:false}]}else if(this.docType=="spreadsheet"){return[{
type:"toolitem",id:"signstatus",command:".uno:Signature",w2icon:"",text:_UNO(".uno:Signature"),
visible:false},{type:"toolitem",id:"undo",text:_UNO(".uno:Undo"),command:".uno:Undo",enabled:false},
{type:"toolitem",id:"redo",text:_UNO(".uno:Redo"),command:".uno:Redo",enabled:false},{
type:"customtoolitem",visible:false,id:"acceptformula",command:"acceptformula",text:_("Accept")},{
type:"customtoolitem",visible:false,id:"cancelformula",command:"cancelformula",text:_("Cancel")},{
type:"spacer",id:"before-PermissionMode"},this._generateHtmlItem("permissionmode"),{type:"spacer",
id:"after-PermissionMode"},{type:"customtoolitem",id:"mobile_wizard",command:"mobile_wizard"},{
type:"customtoolitem",id:"insertion_mobile_wizard",command:"insertion_mobile_wizard"},{
type:"customtoolitem",id:"comment_wizard",command:"comment_wizard",w2icon:"viewcomments"},{
type:"menubutton",id:"userlist:UsersListMenu",visible:false}]}else if(this.docType=="presentation"){
return[{type:"toolitem",id:"signstatus",command:".uno:Signature",w2icon:"",text:_UNO(
".uno:Signature"),visible:false},{type:"toolitem",id:"undo",text:_UNO(".uno:Undo"),
command:".uno:Undo",enabled:false},{type:"toolitem",id:"redo",text:_UNO(".uno:Redo"),
command:".uno:Redo",enabled:false},{type:"spacer",id:"before-permissionmode"},
this._generateHtmlItem("permissionmode"),{type:"spacer",id:"after-permissionmode"},{
type:"customtoolitem",id:"mobile_wizard",command:"mobile_wizard"},{type:"customtoolitem",
id:"insertion_mobile_wizard",command:"insertion_mobile_wizard"},{type:"customtoolitem",
id:"comment_wizard",command:"comment_wizard",w2icon:"viewcomments"},{type:"customtoolitem",
id:"fullscreen-"+this.docType,text:_UNO(".uno:FullScreen",this.docType)},{type:"menubutton",
id:"userlist:UsersListMenu",visible:false}]}else if(this.docType=="drawing"){return[{
type:"toolitem",id:"signstatus",command:".uno:Signature",w2icon:"",text:_UNO(".uno:Signature"),
visible:false},{type:"toolitem",id:"undo",text:_UNO(".uno:Undo"),command:".uno:Undo",enabled:false},
{type:"toolitem",id:"redo",text:_UNO(".uno:Redo"),command:".uno:Redo",enabled:false},{type:"spacer",
id:"before-PermissionMode"},this._generateHtmlItem("permissionmode"),{type:"spacer",
id:"after-PermissionMode"},{type:"customtoolitem",id:"mobile_wizard",command:"mobile_wizard"},{
type:"customtoolitem",id:"insertion_mobile_wizard",command:"insertion_mobile_wizard"},{
type:"customtoolitem",id:"comment_wizard",command:"comment_wizard",w2icon:"viewcomments"},{
type:"menubutton",id:"userlist:UsersListMenu",visible:false}]}};
MobileTopBar.prototype.create=function(){var items=this.getToolItems();this.builder.build(
this.parentContainer,items)};MobileTopBar.prototype.onUpdatePermission=function(e){var _this=this;
var toolbarButtons=["undo","redo","mobile_wizard","insertion_mobile_wizard","comment_wizard"];if(
e.detail.perm==="edit"){toolbarButtons.forEach(function(id){_this.showItem(id,true)});this.showItem(
"PermissionMode",false)}else{toolbarButtons.forEach(function(id){_this.showItem(id,false)});
this.showItem("comment_wizard",true);if($("#mobile-edit-button").is(":hidden")){this.showItem(
"PermissionMode",true)}}};MobileTopBar.prototype.onCommandStateChanged=function(e){
var commandName=e.commandName;var state=e.state;if(this.map.isEditMode()&&(
state==="enabled"||state==="disabled")){var id=window.unoCmdToToolbarId(commandName);if(
state==="enabled"){this.enableItem(id,true)}else{this.enableItem(id,false)}}};
MobileTopBar.prototype._generateHtmlItem=function(id){var isReadOnlyMode=app.map?app.isReadOnly(
):true;var canUserWrite=!app.isReadOnly();return{type:"container",id:id+"-container",children:[{
type:"htmlcontent",id:id,htmlId:id,text:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp",
isReadOnlyMode:isReadOnlyMode,canUserWrite:canUserWrite,visible:false},{type:"spacer",id:id+"-break"
}],vertical:false}};return MobileTopBar}(JSDialog.Toolbar);JSDialog.MobileTopBar=function(map){
return new MobileTopBar(map)};class MobileBottomBar extends JSDialog.Toolbar{constructor(map){super(
map,"MobileBottomBar","toolbar-down");map.on("commandstatechanged",window.onCommandStateChanged);
map.on("updatetoolbarcommandvalues",window.onCommandStateChanged);app.events.on("contextchange",
this.onContextChange.bind(this))}getToolItems(){if(this.docType=="text"){return[{
type:"customtoolitem",id:"showsearchbar",w2icon:"search",text:_("Show the search bar")},{
type:"separator"},{type:"toolitem",id:"bold",text:_UNO(".uno:Bold"),command:".uno:Bold",context:[
"default","Text","DrawText","Table"]},{type:"toolitem",id:"italic",text:_UNO(".uno:Italic"),
command:".uno:Italic",context:["default","Text","DrawText","Table"]},{type:"toolitem",
id:"underline",text:_UNO(".uno:Underline"),command:".uno:Underline",context:["default","Text",
"DrawText","Table"]},{type:"separator",id:"breakcolor",context:["default","Text","DrawText","Table"]
},{type:"customtoolitem",id:"fontcolor",text:_UNO(".uno:FontColor"),lockUno:".uno:FontColor",
context:["default","Text","DrawText","Table"]},{type:"customtoolitem",id:"backcolor",text:_UNO(
".uno:CharBackColor","text"),lockUno:".uno:CharBackColor",context:["default","Text","DrawText",
"Table"]},{type:"menubutton",id:"setborderstyle:BorderStyleMenu",noLabel:true,
command:".uno:SetBorderStyle",text:_("Borders"),hidden:true,context:["Table"]},{type:"separator",
id:"breakalign-text",context:["default","Text","DrawText"]},{type:"menubutton",id:"aligntext",
noLabel:true,command:"alignblock",text:_UNO(".uno:TextAlign"),lockUno:".uno:TextAlign",context:[
"default","Text"],menu:[{type:"comboboxentry",id:"alignleft",text:_UNO(".uno:LeftPara","text",true),
uno:".uno:LeftPara"},{type:"comboboxentry",id:"centerpara",text:_UNO(".uno:CenterPara","text",true),
uno:".uno:CenterPara"},{type:"comboboxentry",id:"alignright",text:_UNO(".uno:RightPara","text",true
),uno:".uno:RightPara"},{type:"comboboxentry",id:"alignblock",text:_UNO(".uno:JustifyPara","text",
true),uno:".uno:JustifyPara"}]},{type:"separator",id:"breakalign-table",context:["Table"]},{
type:"menubutton",id:"aligntable",noLabel:true,command:"alignblock",text:_UNO(".uno:TextAlign"),
lockUno:".uno:TextAlign",context:["Table","DrawText"],menu:[{type:"comboboxentry",id:"alignleft",
text:_UNO(".uno:LeftPara","text",true),uno:".uno:LeftPara"},{type:"comboboxentry",id:"centerpara",
text:_UNO(".uno:CenterPara","text",true),uno:".uno:CenterPara"},{type:"comboboxentry",
id:"alignright",text:_UNO(".uno:RightPara","text",true),uno:".uno:RightPara"},{type:"comboboxentry",
id:"alignblock",text:_UNO(".uno:JustifyPara","text",true),uno:".uno:JustifyPara"},{type:"separator"}
,{type:"comboboxentry",id:"cellverttop",text:_UNO(".uno:CellVertTop","text",true),
uno:".uno:CellVertTop"},{type:"comboboxentry",id:"cellvertcenter",text:_UNO(".uno:CellVertCenter",
"text",true),uno:".uno:CellVertCenter"},{type:"comboboxentry",id:"cellvertbottom",text:_UNO(
".uno:CellVertBottom","text",true),uno:".uno:CellVertBottom"}]},{type:"toolitem",
id:"defaultnumbering-text",text:_UNO(".uno:DefaultNumbering","",true),
command:".uno:DefaultNumbering",disabled:true,context:["default","Text","DrawText","Table"]},{
type:"toolitem",id:"defaultbullet-text",text:_UNO(".uno:DefaultBullet","",true),
command:".uno:DefaultBullet",disabled:true,context:["default","Text","DrawText","Table"]},{
type:"toolitem",id:"incrementindent-text",text:_UNO(".uno:IncrementIndent","",true),
command:".uno:IncrementIndent",disabled:true,context:["default","Text","DrawText","Table"]},{
type:"toolitem",id:"decrementindent-text",text:_UNO(".uno:DecrementIndent","",true),
command:".uno:DecrementIndent",disabled:true,context:["default","Text","DrawText","Table"]},{
type:"separator",context:["Table"]},{type:"menubutton",id:"insertrowsbefore",noLabel:true,text:_UNO(
".uno:InsertRowsBefore"),lockUno:".uno:InsertRowsBefore",context:["Table"],menu:[{
type:"comboboxentry",id:"insertrowsbefore",text:_UNO(".uno:InsertRowsBefore","text",true),
uno:".uno:InsertRowsBefore"},{type:"comboboxentry",id:"insertrowsafter",text:_UNO(
".uno:InsertRowsAfter","text",true),uno:".uno:InsertRowsAfter"},{type:"comboboxentry",
id:"deleterows",text:_UNO(".uno:DeleteRows","text",true),uno:".uno:DeleteRows"},{type:"separator"},{
type:"comboboxentry",id:"entirecell",text:_UNO(".uno:EntireCell","text",true),uno:".uno:EntireCell"}
,{type:"comboboxentry",id:"entirerow",text:_UNO(".uno:EntireRow","text",true),uno:".uno:EntireRow"},
{type:"comboboxentry",id:"selecttable",text:_UNO(".uno:SelectTable","text",true),
uno:".uno:SelectTable"},{type:"separator"},{type:"comboboxentry",id:"setoptimalrowheight",text:_UNO(
".uno:SetOptimalRowHeight","text",true),command:".uno:SetOptimalRowHeight"}]},{type:"menubutton",
id:"insertcolumnsbefore",noLabel:true,text:_UNO(".uno:InsertColumnsBefore"),
lockUno:".uno:InsertColumnsBefore",context:["Table"],menu:[{type:"comboboxentry",
id:"insertcolumnsbefore",text:_UNO(".uno:InsertColumnsBefore","text",true),
uno:".uno:InsertColumnsBefore"},{type:"comboboxentry",id:"insertcolumnsafter",text:_UNO(
".uno:InsertColumnsAfter","text",true),uno:".uno:InsertColumnsAfter"},{type:"comboboxentry",
id:"deletecolumns",text:_UNO(".uno:DeleteColumns","text",true),uno:".uno:DeleteColumns"},{
type:"separator"},{type:"comboboxentry",id:"entirecell",text:_UNO(".uno:EntireCell","text",true),
uno:".uno:EntireCell"},{type:"comboboxentry",id:"entirecolumn",text:_UNO(".uno:EntireColumn","text",
true),uno:".uno:EntireColumn"},{type:"comboboxentry",id:"selecttable",text:_UNO(".uno:SelectTable",
"text",true),uno:".uno:SelectTable"},{type:"separator"},{type:"comboboxentry",
id:"setoptimalcolumnwidth",text:_UNO(".uno:SetOptimalColumnWidth","text",true),
uno:".uno:SetOptimalColumnWidth"}]},{type:"toolitem",id:"togglemergecells",text:_UNO(
".uno:ToggleMergeCells","text",true),command:".uno:MergeCells",context:["Table"]},{
type:"menubutton",id:"wrapmenu",noLabel:true,text:_UNO(".uno:WrapMenu"),lockUno:".uno:WrapMenu",
context:["Draw","DrawLine","3DObject","MultiObject","Graphic","DrawFontwork"],menu:[{
type:"comboboxentry",id:"wrapoff",text:_UNO(".uno:WrapOff","text",true),uno:".uno:WrapOff"},{
type:"comboboxentry",id:"wrapon",text:_UNO(".uno:WrapOn","text",true),uno:".uno:WrapOn"},{
type:"comboboxentry",id:"wrapideal",text:_UNO(".uno:WrapIdeal","text",true),uno:".uno:WrapIdeal"},{
type:"separator"},{type:"comboboxentry",id:"wrapleft",text:_UNO(".uno:WrapLeft","text",true),
uno:".uno:WrapLeft"},{type:"comboboxentry",id:"wrapright",text:_UNO(".uno:WrapRight","text",true),
uno:".uno:WrapRight"},{type:"comboboxentry",id:"wrapthrough",text:_UNO(".uno:WrapThrough","text",
true),uno:".uno:WrapThrough"},{type:"separator"},{type:"comboboxentry",
id:"wrapthroughtransparencytoggle",text:_UNO(".uno:WrapThroughTransparencyToggle","text",true),
uno:".uno:WrapThroughTransparencyToggle"},{type:"comboboxentry",id:"wrapcontour",text:_UNO(
".uno:WrapContour","text",true),uno:".uno:WrapContour"},{type:"comboboxentry",id:"wrapanchoronly",
text:_UNO(".uno:WrapAnchorOnly","text",true),uno:".uno:WrapAnchorOnly"}]},{type:"separator",
context:["Draw","DrawLine","3DObject","MultiObject","Graphic","DrawFontwork"]},{type:"menubutton",
id:"aligncenter",noLabel:true,text:_UNO(".uno:AlignCenter"),lockUno:".uno:AlignCenter",context:[
"Draw","DrawLine","3DObject","MultiObject","Graphic","DrawFontwork"],menu:[{type:"comboboxentry",
id:"objectalignleft",text:_UNO(".uno:ObjectAlignLeft","text",true),uno:".uno:ObjectAlignLeft"},{
type:"comboboxentry",id:"aligncenter",text:_UNO(".uno:AlignCenter","text",true),
uno:".uno:AlignCenter"},{type:"comboboxentry",id:"objectalignright",text:_UNO(
".uno:ObjectAlignRight","text",true),uno:".uno:ObjectAlignRight"},{type:"separator"},{
type:"comboboxentry",id:"alignup",text:_UNO(".uno:AlignUp","text",true),uno:".uno:AlignUp"},{
type:"comboboxentry",id:"alignmiddle",text:_UNO(".uno:AlignMiddle","text",true),
uno:".uno:AlignMiddle"},{type:"comboboxentry",id:"aligndown",text:_UNO(".uno:AlignDown","text",true
),uno:".uno:AlignDown"}]},{type:"menubutton",id:"arrangemenu",noLabel:true,text:_UNO(
".uno:ArrangeMenu"),lockUno:".uno:ArrangeMenu",context:["Draw","DrawLine","3DObject","MultiObject",
"Graphic","DrawFontwork"],menu:[{type:"comboboxentry",id:"bringtofront",text:_UNO(
".uno:BringToFront","text",true),uno:".uno:BringToFront"},{type:"separator"},{type:"comboboxentry",
id:"objectforwardone",text:_UNO(".uno:ObjectForwardOne","text",true),uno:".uno:ObjectForwardOne"},{
type:"comboboxentry",id:"objectbackone",text:_UNO(".uno:ObjectBackOne","text",true),
uno:".uno:ObjectBackOne"},{type:"separator"},{type:"comboboxentry",id:"sendtoback",text:_UNO(
".uno:SendToBack","text",true),uno:".uno:SendToBack"}]},{type:"toolitem",id:"flipvertical",
text:_UNO(".uno:FlipVertical","text",true),command:".uno:FlipVertical",context:["Draw","DrawLine",
"3DObject","MultiObject","Graphic","DrawFontwork"]},{type:"toolitem",id:"fliphorizontal",text:_UNO(
".uno:FlipHorizontal","text",true),command:".uno:FlipHorizontal",context:["Draw","DrawLine",
"3DObject","MultiObject","Graphic","DrawFontwork"]},{type:"toolitem",id:"crop",text:_UNO(".uno:Crop"
),command:".uno:Crop",context:["Graphic"]}]}else if(this.docType=="spreadsheet"){return[{
type:"customtoolitem",id:"showsearchbar",w2icon:"search",text:_("Show the search bar")},{
type:"separator"},{type:"toolitem",id:"bold",text:_UNO(".uno:Bold"),command:".uno:Bold"},{
type:"toolitem",id:"italic",text:_UNO(".uno:Italic"),command:".uno:Italic"},{type:"toolitem",
id:"underline",text:_UNO(".uno:Underline"),command:".uno:Underline"},{type:"separator"},{
type:"customtoolitem",id:"fontcolor",text:_UNO(".uno:FontColor"),lockUno:".uno:FontColor"},{
type:"customtoolitem",id:"backcolor",text:_UNO(".uno:BackgroundColor"),
lockUno:".uno:BackgroundColor"},{type:"separator"},{type:"menubutton",id:"textalign",noLabel:true,
command:"alignblock",text:_UNO(".uno:TextAlign"),lockUno:".uno:TextAlign",menu:[{
type:"comboboxentry",id:"alignleft",text:_UNO(".uno:AlignLeft","spreadsheet",true),
uno:".uno:AlignLeft"},{type:"comboboxentry",id:"alignhorizontalcenter",text:_UNO(
".uno:AlignHorizontalCenter","spreadsheet",true),uno:".uno:AlignHorizontalCenter"},{
type:"comboboxentry",id:"alignright",text:_UNO(".uno:AlignRight","spreadsheet",true),
uno:".uno:AlignRight"},{type:"comboboxentry",id:"alignblock",text:_UNO(".uno:AlignBlock",
"spreadsheet",true),uno:".uno:AlignBlock"},{type:"separator"},{type:"comboboxentry",id:"aligntop",
text:_UNO(".uno:AlignTop","spreadsheet",true),uno:".uno:AlignTop"},{type:"comboboxentry",
id:"alignvcenter",text:_UNO(".uno:AlignVCenter","spreadsheet",true),uno:".uno:AlignVCenter"},{
type:"comboboxentry",id:"alignbottom",text:_UNO(".uno:AlignBottom","spreadsheet",true),
uno:".uno:AlignBottom"}]},{type:"toolitem",id:"wraptext",text:_UNO(".uno:WrapText","spreadsheet",
true),command:".uno:WrapText",disabled:true},{type:"separator"},{type:"menubutton",
id:"insertrowsbefore",noLabel:true,text:_UNO(".uno:InsertRowsBefore"),
lockUno:".uno:InsertRowsBefore",menu:[{type:"comboboxentry",id:"insertrowsbefore",text:_UNO(
".uno:InsertRowsBefore","spreadsheet",true),uno:".uno:InsertRowsBefore"},{type:"comboboxentry",
id:"insertrowsafter",text:_UNO(".uno:InsertRowsAfter","spreadsheet",true),uno:".uno:InsertRowsAfter"
},{type:"comboboxentry",id:"deleterows",text:_UNO(".uno:DeleteRows","spreadsheet",true),
uno:".uno:DeleteRows"},{type:"separator"},{type:"comboboxentry",id:"hiderow",text:_UNO(
".uno:HideRow","spreadsheet",true),uno:".uno:HideRow"},{type:"comboboxentry",id:"showrow",text:_UNO(
".uno:ShowRow","spreadsheet",true),uno:".uno:ShowRow"},{type:"separator"},{type:"comboboxentry",
id:"freezepanesrow",text:_UNO(".uno:FreezePanesRow","spreadsheet",true),uno:".uno:FreezePanesRow"}]}
,{type:"menubutton",id:"insertcolumnsbefore",noLabel:true,text:_UNO(".uno:InsertColumnsBefore"),
lockUno:".uno:InsertColumnsBefore",menu:[{type:"comboboxentry",id:"insertcolumnsbefore",text:_UNO(
".uno:InsertColumnsBefore","spreadsheet",true),uno:".uno:InsertColumnsBefore"},{
type:"comboboxentry",id:"insertcolumnsafter",text:_UNO(".uno:InsertColumnsAfter","spreadsheet",true
),uno:".uno:InsertColumnsAfter"},{type:"comboboxentry",id:"deletecolumns",text:_UNO(
".uno:DeleteColumns","spreadsheet",true),uno:".uno:DeleteColumns"},{type:"separator"},{
type:"comboboxentry",id:"hidecolumn",text:_UNO(".uno:HideColumn","spreadsheet",true),
uno:".uno:HideColumn"},{type:"comboboxentry",id:"showcolumn",text:_UNO(".uno:ShowColumn",
"spreadsheet",true),uno:".uno:ShowColumn"},{type:"separator"},{type:"comboboxentry",
id:"freezepanescolumn",text:_UNO(".uno:FreezePanesColumn","spreadsheet",true),
uno:".uno:FreezePanesColumn"}]},{type:"toolitem",id:"togglemergecells",text:_UNO(
".uno:ToggleMergeCells","spreadsheet",true),command:".uno:ToggleMergeCells",disabled:true},{
type:"separator"},{type:"menubutton",id:"conditionalformatdialog:ConditionalFormatMenu",
noLabel:true,text:_UNO(".uno:ConditionalFormatMenu","spreadsheet",true),
command:".uno:ConditionalFormatMenu"},{type:"toolitem",id:"sortascending",text:_UNO(
".uno:SortAscending","spreadsheet",true),command:".uno:SortAscending"},{type:"toolitem",
id:"sortdescending",text:_UNO(".uno:SortDescending","spreadsheet",true),
command:".uno:SortDescending"},{type:"separator"},{type:"menubutton",id:"numberformatstandard",
noLabel:true,text:_UNO(".uno:NumberFormatStandard"),lockUno:".uno:NumberFormatStandard",menu:[{
type:"comboboxentry",id:"numberformatstandard",text:_UNO(".uno:NumberFormatStandard","spreadsheet",
true),uno:".uno:NumberFormatStandard"},{type:"comboboxentry",id:"numberformatdecimal",text:_UNO(
".uno:NumberFormatDecimal","spreadsheet",true),uno:".uno:NumberFormatDecimal"},{
type:"comboboxentry",id:"numberformatpercent",text:_UNO(".uno:NumberFormatPercent","spreadsheet",
true),uno:".uno:NumberFormatPercent"},{type:"comboboxentry",id:"numberformatcurrency",text:_UNO(
".uno:NumberFormatCurrency","spreadsheet",true),uno:".uno:NumberFormatCurrency"},{
type:"comboboxentry",id:"numberformatdate",text:_UNO(".uno:NumberFormatDate","spreadsheet",true),
uno:".uno:NumberFormatDate"},{type:"comboboxentry",id:"numberformattime",text:_UNO(
".uno:NumberFormatTime","spreadsheet",true),uno:".uno:NumberFormatTime"},{type:"comboboxentry",
id:"numberformatscientific",text:_UNO(".uno:NumberFormatScientific","spreadsheet",true),
uno:".uno:NumberFormatScientific"},{type:"separator"},{type:"comboboxentry",
id:"numberformatthousands",text:_UNO(".uno:NumberFormatThousands","spreadsheet",true),
uno:".uno:NumberFormatThousands"}]},{type:"toolitem",id:"numberformatincdecimals",text:_UNO(
".uno:NumberFormatIncDecimals","spreadsheet",true),command:".uno:NumberFormatIncDecimals",
disabled:true},{type:"toolitem",id:"numberformatdecdecimals",text:_UNO(
".uno:NumberFormatDecDecimals","spreadsheet",true),command:".uno:NumberFormatDecDecimals",
disabled:true},{type:"toolitem",id:"crop",text:_UNO(".uno:Crop"),command:".uno:Crop",context:[
"Graphic"]}]}else if(this.docType=="presentation"||this.docType=="drawing"){return[{
type:"customtoolitem",id:"showsearchbar",w2icon:"search",text:_("Show the search bar")},{
type:"separator"},{type:"toolitem",id:"insertpage",text:_UNO(".uno:InsertPage","presentation",true),
command:".uno:InsertPage",context:["DrawPage"]},{type:"toolitem",id:"duplicatepage",text:_UNO(
".uno:DuplicatePage","presentation",true),command:".uno:DuplicatePage",context:["DrawPage"]},{
type:"toolitem",id:"deletepage",text:_UNO(".uno:DeletePage","presentation",true),
command:".uno:DeletePage",context:["DrawPage"]},{type:"separator",context:["DrawPage"]},{
type:"customtoolitem",id:"fullscreen",command:"fullscreen-"+this.docType,text:_UNO(".uno:FullScreen"
,this.docType),context:["DrawPage"]},{type:"toolitem",id:"bold",text:_UNO(".uno:Bold"),
command:".uno:Bold",context:["default","Text","DrawText","TextObject","Table"]},{type:"toolitem",
id:"italic",text:_UNO(".uno:Italic"),command:"Italic",context:["default","Text","DrawText",
"TextObject","Table"]},{type:"toolitem",id:"underline",text:_UNO(".uno:Underline"),
command:".uno:Underline",context:["default","Text","DrawText","TextObject","Table"]},{
type:"separator",context:["default","Text","DrawText","TextObject","Table"]},{type:"customtoolitem",
id:"fontcolor",text:_UNO(".uno:FontColor"),lockUno:".uno:FontColor",context:["default","Text",
"DrawText","TextObject","Table"]},{type:"customtoolitem",id:"backcolor",text:_UNO(
".uno:BackgroundColor"),lockUno:".uno:BackgroundColor",context:["default","Text","DrawText",
"TextObject","Table"]},{type:"separator",context:["default","Text","DrawText","TextObject","Table"]}
,{type:"menubutton",id:"textalign",noLabel:true,command:"alignblock",text:_UNO(".uno:TextAlign"),
lockUno:".uno:TextAlign",context:["default","Text","DrawText","TextObject","Table"],menu:[{
type:"comboboxentry",id:"alignleft",text:_UNO(".uno:LeftPara","",true),uno:".uno:LeftPara"},{
type:"comboboxentry",id:"centerpara",text:_UNO(".uno:CenterPara","",true),uno:".uno:CenterPara"},{
type:"comboboxentry",id:"alignright",text:_UNO(".uno:RightPara","",true),uno:".uno:RightPara"},{
type:"comboboxentry",id:"alignblock",text:_UNO(".uno:JustifyPara","",true),uno:".uno:JustifyPara"},{
type:"separator"},{type:"comboboxentry",id:"cellverttop",text:_UNO(".uno:CellVertTop","",true),
uno:".uno:CellVertTop"},{type:"comboboxentry",id:"cellvertcenter",text:_UNO(".uno:CellVertCenter",""
,true),uno:".uno:CellVertCenter"},{type:"comboboxentry",id:"cellvertbottom",text:_UNO(
".uno:CellVertBottom","",true),uno:".uno:CellVertBottom"}]},{type:"separator",context:["default",
"Text","DrawText","TextObject","Table"]},{type:"toolitem",id:"defaultnumbering-text",text:_UNO(
".uno:DefaultNumbering","",true),command:".uno:DefaultNumbering",disabled:true,context:["default",
"Text","DrawText","TextObject","Table"]},{type:"toolitem",id:"defaultbullet",text:_UNO(
".uno:DefaultBullet","",true),command:".uno:DefaultBullet",disabled:true,context:["default","Text",
"DrawText","TextObject","Table"]},{type:"separator",context:["Table"]},{type:"menubutton",
id:"insertrowsbefore",noLabel:true,text:_UNO(".uno:InsertRowsBefore"),
lockUno:".uno:InsertRowsBefore",context:["Table"],menu:[{type:"comboboxentry",id:"insertrowsbefore",
text:_UNO(".uno:InsertRowsBefore","presentation",true),uno:".uno:InsertRowsBefore"},{
type:"comboboxentry",id:"insertrowsafter",text:_UNO(".uno:InsertRowsAfter","presentation",true),
uno:".uno:InsertRowsAfter"},{type:"comboboxentry",id:"deleterows",text:_UNO(".uno:DeleteRows",
"presentation",true),uno:".uno:DeleteRows"},{type:"separator"},{type:"comboboxentry",id:"entirerow",
text:_UNO(".uno:EntireRow","presentation",true),uno:".uno:EntireRow"},{type:"comboboxentry",
id:"selecttable",text:_UNO(".uno:SelectTable","presentation",true),uno:".uno:SelectTable"},{
type:"separator"},{type:"comboboxentry",id:"setoptimalrowheight",text:_UNO(
".uno:SetOptimalRowHeight","presentation",true),uno:".uno:SetOptimalRowHeight"}]},{
type:"menubutton",id:"insertcolumnsbefore",noLabel:true,text:_UNO(".uno:InsertColumnsBefore"),
lockUno:".uno:InsertColumnsBefore",context:["Table"],menu:[{type:"comboboxentry",
id:"insertcolumnsbefore",text:_UNO(".uno:InsertColumnsBefore","presentation",true),
uno:".uno:InsertColumnsBefore"},{type:"comboboxentry",id:"insertcolumnsafter",text:_UNO(
".uno:InsertColumnsAfter","presentation",true),uno:".uno:InsertColumnsAfter"},{type:"comboboxentry",
id:"deletecolumns",text:_UNO(".uno:DeleteColumns","presentation",true),uno:".uno:DeleteColumns"},{
type:"separator"},{type:"comboboxentry",id:"entirecolumn",text:_UNO(".uno:EntireColumn",
"presentation",true),uno:".uno:EntireColumn"},{type:"comboboxentry",id:"selecttable",text:_UNO(
".uno:SelectTable","presentation",true),uno:".uno:SelectTable"},{type:"separator"},{
type:"comboboxentry",id:"setoptimalcolumnwidth",text:_UNO(".uno:SetOptimalColumnWidth",
"presentation",true),uno:".uno:SetOptimalColumnWidth"}]},{type:"toolitem",id:"togglemergecells",
text:_UNO(".uno:ToggleMergeCells","presentation",true),command:".uno:ToggleMergeCells",context:[
"Table"]},{type:"menubutton",id:"aligncenter",noLabel:true,text:_UNO(".uno:AlignCenter"),
lockUno:".uno:AlignCenter",context:["Draw","DrawLine","3DObject","MultiObject","Graphic",
"DrawFontwork"],menu:[{type:"comboboxentry",id:"objectalignleft",text:_UNO(".uno:ObjectAlignLeft",""
,true),uno:".uno:ObjectAlignLeft"},{type:"comboboxentry",id:"aligncenter",text:_UNO(
".uno:AlignCenter","",true),uno:".uno:AlignCenter"},{type:"comboboxentry",id:"objectalignright",
text:_UNO(".uno:ObjectAlignRight","",true),uno:".uno:ObjectAlignRight"},{type:"separator"},{
type:"comboboxentry",id:"alignup",text:_UNO(".uno:AlignUp","",true),uno:".uno:AlignUp"},{
type:"comboboxentry",id:"alignmiddle",text:_UNO(".uno:AlignMiddle","",true),uno:".uno:AlignMiddle"},
{type:"comboboxentry",id:"aligndown",text:_UNO(".uno:AlignDown","",true),uno:".uno:AlignDown"}]},{
type:"menubutton",id:"arrangemenu",noLabel:true,text:_UNO(".uno:ArrangeMenu"),
lockUno:".uno:ArrangeMenu",context:["Draw","DrawLine","3DObject","MultiObject","Graphic",
"DrawFontwork"],menu:[{type:"comboboxentry",id:"bringtofront",text:_UNO(".uno:BringToFront","",true
),uno:".uno:BringToFront"},{type:"separator"},{type:"comboboxentry",id:"objectforwardone",text:_UNO(
".uno:ObjectForwardOne","",true),uno:".uno:ObjectForwardOne"},{type:"comboboxentry",
id:"objectbackone",text:_UNO(".uno:ObjectBackOne","",true),uno:".uno:ObjectBackOne"},{
type:"separator"},{type:"comboboxentry",id:"sendtoback",text:_UNO(".uno:SendToBack","",true),
uno:".uno:SendToBack"}]},{type:"toolitem",id:"flipvertical",text:_UNO(".uno:FlipVertical","",true),
command:".uno:FlipVertical",context:["Draw","DrawLine","3DObject","MultiObject","Graphic",
"DrawFontwork"]},{type:"toolitem",id:"fliphorizontal",text:_UNO(".uno:FlipHorizontal","",true),
command:".uno:FlipHorizontal",context:["Draw","DrawLine","3DObject","MultiObject","Graphic",
"DrawFontwork"]},{type:"toolitem",id:"crop",text:_UNO(".uno:Crop"),command:".uno:Crop",context:[
"Graphic"]}]}}onContextChange(event){this.updateVisibilityForToolbar(event.detail.context)}}
JSDialog.MobileBottomBar=function(map){return new MobileBottomBar(map)};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __generator=this&&this.__generator||function(thisArg,body){
var _={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},f,y,t,g;return g={
next:verb(0),throw:verb(1),return:verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(
){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f
)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"
]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(
y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1
],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;
default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0
]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];
t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();
continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{
value:op[0]?op[1]:void 0,done:true}}};var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var __spreadArray=this&&this.__spreadArray||function(to,from,pack){
if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar
)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var UserList=function(_super){__extends(UserList,_super);
function UserList(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.options={
userLimitHeader:6,userLimitHeaderWhenFollowing:3,userPopupTimeout:null,userJoinedPopupMessage:_(
"{user} has joined"),userLeftPopupMessage:_("{user} has left"),followingChipTextUser:_(
"Following {user}"),followingChipTextEditor:_("Following the editor"),followingChipTooltipText:_(
"Stop following"),userAvatarAlt:_("Avatar for {user}"),nUsers:undefined,oneUser:undefined,
noUser:undefined};_this.users=new Map;return _this}UserList.prototype.onAdd=function(map){
this.map=map;map.on("addview",this.onAddView,this);map.on("removeview",this.onRemoveView,this);
map.on("deselectuser",this.deselectUser,this);if(window.mode.isMobile()||window.mode.isTablet()){
this.options.nUsers="%n";this.options.oneUser="1";this.options.noUser="0"}else{
this.options.nUsers=_("%n users");this.options.oneUser=_("1 user");this.options.noUser=_("0 users")}
var userListElement=document.getElementById("userListSummary");userListElement.setAttribute(
"aria-label",_("User List Summary"));this.registerHeaderAvatarEvents()};
UserList.prototype.selectUser=function(viewId){var user=this.users.get(viewId);if(user===undefined){
console.debug("User doesn't exist: "+viewId);return}this.renderAll()};
UserList.prototype.getFollowedUser=function(){var followedId=app.getFollowedViewId();
var myViewId=this.map&&this.map._docLayer&&this.map._docLayer._viewId;if(
myViewId===followedId||followedId===-1||!app.isFollowingUser()){return undefined}
var followedUser=this.users.get(followedId);if(followedUser===undefined){return undefined}return[
followedId,followedUser]};UserList.prototype.unfollowAll=function(){app.setFollowingOff()};
UserList.prototype.followUser=function(viewId,instantJump){if(instantJump===void 0){instantJump=true
}var myViewId=this.map._docLayer._viewId;var followingViewId=app.getFollowedViewId();
var followMyself=viewId===myViewId;if(followingViewId===viewId)return;app.setFollowingUser(viewId);
if(followMyself){this.map._setFollowing(true,myViewId,instantJump)}else if(viewId!==-1){
this.map._setFollowing(true,viewId,instantJump)}else{this.unfollowAll();this.map._setFollowing(false
,-1)}this.selectUser(viewId)};UserList.prototype.createAvatar=function(cachedElement,viewId,username
,extraInfo,color,zIndex){if(zIndex===undefined){zIndex="auto"}var img=cachedElement;if(
img===undefined){img=window.L.DomUtil.create("img","avatar-img")}app.LOUtil.setUserImage(img,
this.map,viewId);img.alt=this.options.userAvatarAlt.replace("{user}",username);
img.style.zIndex=zIndex.toString();img.style.borderColor=color;
img.style.backgroundColor="var(--color-background-lighter)";img.setAttribute("data-view-id",
viewId.toString());return img};UserList.prototype.getUserItem=function(viewId,username,extraInfo,
color){var content=window.L.DomUtil.create("tr","useritem");content.id="user-"+viewId;$(document
).on("click","#"+content.id,this.onUseritemClicked.bind(this));var iconTd=window.L.DomUtil.create(
"td","usercolor",content);var nameTd=window.L.DomUtil.create("td","username cool-font",content);
var avatarElement=this.createAvatar(undefined,viewId,username,extraInfo,color);iconTd.appendChild(
avatarElement);nameTd.textContent=username;return content};UserList.prototype.openDropdown=function(
){var userListSummary=document.getElementById("userListSummaryBackground");
var userListPopover=document.getElementById("userlist-dropdown");
var canShowDropdown=!userListPopover&&userListSummary&&userListSummary.style.display!=="none";if(
canShowDropdown){JSDialog.OpenDropdown("userlist",document.getElementById("userListSummary"),
JSDialog.MenuDefinitions.get("UsersListMenu"))}};
UserList.prototype.registerHeaderAvatarEvents=function(){document.getElementById("userListSummary"
).addEventListener("click",function(e){e.stopPropagation();this.openDropdown()}.bind(this))};
UserList.prototype.hideUserList=function(){return window.ThisIsAMobileApp||this.map["wopi"
].HideUserList!==null&&this.map["wopi"].HideUserList!==undefined&&$.inArray("true",this.map["wopi"
].HideUserList)>=0||window.mode.isMobile()&&$.inArray("mobile",this.map["wopi"].HideUserList
)>=0||window.mode.isTablet()&&$.inArray("tablet",this.map["wopi"].HideUserList
)>=0||window.mode.isDesktop()&&$.inArray("desktop",this.map["wopi"].HideUserList)>=0};
UserList.prototype.getSortedUsers=function(){return function(){var self,followedUser,readonlyUsers,
_a,_b,_c,viewId,user,isSelf,isFollowed,e_1_1;var e_1,_d;return __generator(this,function(_e){switch(
_e.label){case 0:self=this.users.get(this.map._docLayer._viewId);if(this.users.get(
this.map._docLayer._viewId)===undefined){return[2]}followedUser=this.getFollowedUser();if(!(
followedUser!==undefined))return[3,2];return[4,followedUser];case 1:_e.sent();_e.label=2;case 2:
return[4,[this.map._docLayer._viewId,self]];case 3:_e.sent();readonlyUsers=[];_e.label=4;case 4:
_e.trys.push([4,9,10,11]);_a=__values(Array.from(this.users.entries()).reverse()),_b=_a.next();
_e.label=5;case 5:if(!!_b.done)return[3,8];_c=__read(_b.value,2),viewId=_c[0],user=_c[1];
isSelf=viewId===this.map._docLayer._viewId;
isFollowed=followedUser!==undefined&&viewId===followedUser[0];if(isSelf||isFollowed){return[3,7]}if(
user.readonly){readonlyUsers.push([viewId,user]);return[3,7]}return[4,[viewId,user]];case 6:_e.sent(
);_e.label=7;case 7:_b=_a.next();return[3,5];case 8:return[3,11];case 9:e_1_1=_e.sent();e_1={
error:e_1_1};return[3,11];case 10:try{if(_b&&!_b.done&&(_d=_a.return))_d.call(_a)}finally{if(e_1
)throw e_1.error}return[7];case 11:return[5,__values(readonlyUsers)];case 12:_e.sent();return[2]}})
}.bind(this)()};UserList.prototype.renderHeaderAvatars=function(){var _this=this;
var userListElementBackground=document.getElementById("userListSummaryBackground");
var userListElement=document.getElementById("userListSummary");if(window.mode.isMobile(
)||this.hideUserList()||this.users.size===1){userListElement.removeAttribute("accesskey");
userListElementBackground.style.display="none";return}var displayCount;if(this.getFollowedUser(
)===undefined&&!app.isFollowingEditor()){displayCount=this.options.userLimitHeader}else{
displayCount=this.options.userLimitHeaderWhenFollowing}var avatarUsers=Array.from(
this.getSortedUsers()).slice(0,displayCount);var followed=this.getFollowedUser();
userListElement.setAttribute("accesskey","UP");userListElement.replaceChildren.apply(userListElement
,__spreadArray([],__read(avatarUsers.map(function(_a,index){var _b=__read(_a,2),viewId=_b[0],
user=_b[1];var img=_this.createAvatar(user.cachedHeaderAvatar,viewId,user.username,user.extraInfo,
user.color,displayCount-index);user.cachedHeaderAvatar=img;if(followed!==undefined&&followed[0
]===viewId){img.classList.add("following")}else{img.classList.remove("following")}return img})),
false));userListElementBackground.style.display="block"};
UserList.prototype.updateUserListCount=function(){var count=this.users.size;var text="";if(count>1){
text=this.options.nUsers.replace("%n",count.toString())}else if(count===1){text=this.options.oneUser
}else{text=this.options.noUser}if(this.map.mobileTopBar){if(!this.hideUserList()&&count>1
)this.map.mobileTopBar.showItem("userlist",true);else this.map.mobileTopBar.showItem("userlist",
false)}};UserList.prototype.deselectUser=function(e){var user=this.users.get(e.viewId);if(
user===undefined){console.debug("User doesn't exist: "+e.viewId);return}this.renderAll()};
UserList.prototype.onAddView=function(e){var color;var username;var you;if(
e.viewId===this.map._docLayer._viewId){username=_("You");color="var(--color-main-text)";you=true
}else{username=e.username;color=app.LOUtil.rgbToHex(this.map.getViewColor(e.viewId));you=false}
this.users.set(e.viewId,{you:you,username:username,extraInfo:e.extraInfo,color:color,
readonly:e.readonly});this.showJoinLeaveMessage("join",e.viewId,username,color);this.renderAll()};
UserList.prototype.onRemoveView=function(e){var user=this.users.get(e.viewId);this.users.delete(
e.viewId);if(e.viewId===app.getFollowedViewId()){this.unfollowAll()}if(user!==undefined){
this.showJoinLeaveMessage("leave",e.viewId,user.username,user.color)}this.renderAll()};
UserList.prototype.renderAll=function(){this.updateUserListCount();this.renderHeaderAvatars();
var popoverElement=document.getElementById("userlist-entries");if(popoverElement
)this.renderHeaderAvatarPopover(popoverElement);this.renderFollowingChip()};
UserList.prototype.showTooltip=function(text){var userList=$("#userListHeader");if(userList){
userList.get(0).title=text;userList.tooltip({content:text});userList.tooltip("enable");
userList.tooltip("open")}};UserList.prototype.hideTooltip=function(){var userList=$(
"#userListHeader");if(userList){userList.get(0).title=undefined;userList.tooltip("option","disabled"
,true)}};UserList.prototype.showJoinLeaveMessage=function(type,viewId,username,_color){
var _this=this;var message;if(viewId===this.map._docLayer._viewId){return}if(type==="join"){
message=this.options.userJoinedPopupMessage.replace("{user}",username)}else{
message=this.options.userLeftPopupMessage.replace("{user}",username)}
var sanitizer=document.createElement("div");sanitizer.innerText=message;this.showTooltip(
sanitizer.innerHTML);clearTimeout(this.options.userPopupTimeout);
this.options.userPopupTimeout=setTimeout(function(){_this.hideTooltip()},3e3)};
UserList.prototype.renderHeaderAvatarPopover=function(popoverElement){var _this=this;
var users=Array.from(this.getSortedUsers());var following=this.getFollowedUser();
var userElements=users.map(function(_a){var _b=__read(_a,2),viewId=_b[0],user=_b[1];
var userLabel=window.L.DomUtil.create("div","user-list-item--name");
userLabel.innerText=user.username;var userFollowingLabel=window.L.DomUtil.create("div",
"user-list-item--following-label");userFollowingLabel.innerText=_("Following");
var userLabelContainer=window.L.DomUtil.create("div","user-list-item--name-container");
userLabelContainer.appendChild(userLabel);userLabelContainer.appendChild(userFollowingLabel);
var listItem=window.L.DomUtil.create("div","user-list-item");listItem.setAttribute("data-view-id",
viewId);listItem.setAttribute("role","button");if(following!==undefined&&viewId==following[0]){$(
listItem).addClass("selected-user")}var avatar=_this.createAvatar(user.cachedUserListAvatar,viewId,
user.username,user.extraInfo,user.color);user.cachedUserListAvatar=avatar;listItem.appendChild(
avatar);listItem.appendChild(userLabelContainer);listItem.addEventListener("click",function(){
_this.followUser(viewId);JSDialog.CloseDropdown("userlist")});return listItem});
var followEditorWrapper=window.L.DomUtil.create("div","");followEditorWrapper.id="follow-editor";
var followEditorCheckbox=window.L.DomUtil.create("input",
"follow-editor-checkbox jsdialog ui-checkbox",followEditorWrapper);
followEditorCheckbox.id="follow-editor-checkbox";followEditorCheckbox.setAttribute("type","checkbox"
);followEditorCheckbox.onchange=function(event){window.editorUpdate(event);_this.renderAll()};
followEditorCheckbox.checked=app.isFollowingEditor();
var followEditorCheckboxLabel=window.L.DomUtil.create("label","follow-editor-label",
followEditorWrapper);followEditorCheckboxLabel.innerText=_("Always follow the editor");
followEditorCheckboxLabel.setAttribute("for","follow-editor-checkbox");
popoverElement.replaceChildren.apply(popoverElement,__spreadArray(__spreadArray([],__read(
userElements),false),[followEditorWrapper],false))};UserList.prototype.renderFollowingChip=function(
){var _this=this;var followingChipBackground=document.getElementById("followingChipBackground");
var followingChip=document.getElementById("followingChip");var following=this.getFollowedUser();if(
following===undefined&&!app.isFollowingEditor()){followingChipBackground.style.display="none";return
}var topAvatarZIndex=this.options.userLimitHeaderWhenFollowing;if(app.isFollowingEditor()){
followingChip.innerText=this.options.followingChipTextEditor;
followingChip.style.borderColor="var(--color-main-text)"}else{
followingChip.innerText=this.options.followingChipTextUser.replace("{user}",following[1].username);
followingChip.style.borderColor=following[1].color}followingChip.onclick=function(){
_this.unfollowAll();_this.renderAll()};followingChip.title=this.options.followingChipTooltipText;$(
followingChip).tooltip();followingChipBackground.style.display="block";
followingChipBackground.style.zIndex=topAvatarZIndex.toString()};return UserList}(window.L.Control);
window.L.control.userList=function(){return new UserList};
window.L.control.createUserListWidget=function(){var userlistElement=window.L.DomUtil.create("div");
app.map.userList.renderHeaderAvatarPopover(userlistElement);return userlistElement};
const EXPAND_FORMULA_BAR_TEXT=_("Expand Formula Bar");const FUNCTION_WIZARD_TEXT=_("Function Wizard"
);class FormulaBar{constructor(map){this.map=map;this.parentContainer=window.L.DomUtil.get(
"formulabar");this.map.on("formulabar",this.onFormulaBar,this);this.map.on("jsdialogupdate",
this.onJSUpdate,this);this.map.on("jsdialogaction",this.onJSAction,this);this.map.on("doclayerinit",
this.onDocLayerInit,this);this.builder=new window.L.control.jsDialogBuilder({mobileWizard:this,
map:this.map,windowId:WindowId.Formulabar,cssClass:"formulabar jsdialog",
callback:this.callback.bind(this),suffix:"formulabar"});this.createFormulabar("")}onRemove(){
this.map.off("formulabar",this.onFormulaBar,this);this.map.off("jsdialogupdate",this.onJSUpdate,this
);this.map.off("jsdialogaction",this.onJSAction,this);this.map.off("doclayerinit",
this.onDocLayerInit,this)}onDocLayerInit(){var docType=this.map.getDocType();if(
docType=="spreadsheet")this.showFormulabar()}createFormulabar(text){if(!window.mode.isMobile()){
var data=[{id:"formulabar-buttons-toolbox",type:"toolbox",children:[{id:"functiondialog",
type:"toolitem",text:FUNCTION_WIZARD_TEXT,command:".uno:FunctionDialog"},{
id:"AutoSumMenu:AutoSumMenu",type:"menubutton",class:"AutoSumMenu",noLabel:true,text:_(
"Select Function"),command:".uno:AutoSumMenu"},{id:"startformula",type:"customtoolitem",text:_(
"Formula")},{id:"acceptformula",type:"customtoolitem",text:_("Accept"),visible:false},{
id:"cancelformula",type:"customtoolitem",text:_UNO(".uno:Cancel","spreadsheet"),visible:false}]},{
id:"formulabar-toolbox",type:"toolbox",children:[{id:"sc_input_window",type:"formulabaredit",
text:text?text:""},{id:"expand",type:"pushbutton",text:EXPAND_FORMULA_BAR_TEXT,symbol:"SPIN_DOWN"}]}
]}else{var data=[{id:"formulabar-toolbox",type:"toolbox",children:[{id:"functiondialog",
type:"toolitem",text:FUNCTION_WIZARD_TEXT,command:".uno:FunctionDialog"},{id:"sc_input_window",
type:"formulabaredit",text:text?text:""},{id:"expand",type:"pushbutton",
text:EXPAND_FORMULA_BAR_TEXT,symbol:"SPIN_DOWN"}]}]}this.parentContainer.replaceChildren();
this.builder.build(this.parentContainer,data)}toggleMultiLine(input){if(window.L.DomUtil.hasClass(
input,"expanded")){window.L.DomUtil.removeClass(input,"expanded");window.L.DomUtil.removeClass(
this.parentContainer,"expanded");this.onJSUpdate({data:{jsontype:"formulabar",
id:this.builder.windowId,control_id:"expand",control:{id:"expand",type:"pushbutton",
text:EXPAND_FORMULA_BAR_TEXT,symbol:"SPIN_DOWN"}}})}else{window.L.DomUtil.addClass(input,"expanded")
window.L.DomUtil.addClass(this.parentContainer,"expanded");this.onJSUpdate({data:{
jsontype:"formulabar",id:this.builder.windowId,control_id:"expand",control:{id:"expand",
type:"pushbutton",text:_("Collapse Formula Bar"),symbol:"SPIN_UP"}}})}}callback(objectType,eventType
,object,data,builder){if(object.id==="expand"){var input=this.getInputField();if(input
)this.toggleMultiLine(input);return}if(object.id.indexOf("sc_input_window")===0){
const map=builder.map;objectType="drawingarea";if(
eventType==="keypress"&&data===UNOKey.RETURN||data===UNOKey.ESCAPE)map.focus();else if(
eventType==="grab_focus"){this.focusField();map.onFormulaBarFocus()}map.userList.followUser(
map._docLayer._getViewId(),false)}builder._defaultCallbackHandler(objectType,eventType,object,data,
builder)}focusField(){window.L.DomUtil.addClass(this.getInputField(),"focused")}blurField(){
window.L.DomUtil.removeClass(this.getInputField(),"focused")}enable(){var input=this.getInputField()
if(!input)return;input.enable()}disable(){var input=this.getInputField();if(!input)return;
input.disable()}hasFocus(){var input=this.getInputField();if(!input)return false;
return window.L.DomUtil.hasClass(input,"focused")}isInEditMode(){
var acceptButton=this.parentContainer.querySelector("#acceptformula");if(acceptButton
)return!acceptButton.classList.contains("hidden");return false}showFormulabar(){if(
this.parentContainer)this.parentContainer.style.setProperty("display","table-cell")}show(action){
this.showButton(action,true)}hide(action){this.showButton(action,false)}showButton(action,show){
this.onJSAction({data:{jsontype:"formulabar",id:this.builder.windowId,data:{control_id:action,
action_type:show?"show":"hide"}}})}getControl(controlId){if(!this.parentContainer)return;
var control=this.parentContainer.querySelector("[id='"+controlId+"']");if(!control
)window.app.console.warn('formulabar update: not found control with id: "'+controlId+'"');
return control}getInputField(){return this.getControl("sc_input_window")}onFormulaBar(e){
var data=e.data;if(data.jsontype!=="formulabar")return;console.warn(
"formulabar: old style formulabar full update - to fix in core");return}onJSUpdate(e){
var data=e.data;if(data.jsontype!=="formulabar")return;var control=this.getControl(data.control.id);
if(!control)return;var parent=control.parentNode;if(!parent)return;control.style.visibility="hidden"
var temporaryParent=window.L.DomUtil.create("div");this.builder.build(temporaryParent,[data.control]
,false);parent.insertBefore(temporaryParent.firstChild,control.nextSibling);window.L.DomUtil.remove(
control)}onJSAction(e){var data=e.data;if(data.jsontype!=="formulabar")return;if(!this.builder
)return;this.builder.setWindowId(data.id);var innerData=data?data.data:null;if(
this.parentContainer.firstChild){
var messageForInputField=innerData&&innerData.control_id==="sc_input_window";
var isSetTextMessage=innerData&&innerData.action_type==="setText";
var isGrabFocusMessage=innerData&&innerData.action_type==="grab_focus";if(
messageForInputField&&isGrabFocusMessage){this.focusField();return}if(
messageForInputField&&isSetTextMessage){var customEditArea=this.getInputField();if(customEditArea){
var selection=innerData.selection.split(";");customEditArea.setText(innerData.text,selection)}return
}this.builder.executeAction(this.parentContainer,innerData)}else if(innerData){
this.createFormulabar(innerData.text)}}}JSDialog.FormulaBar=function(map){return new FormulaBar(map)
};class SheetsBar{constructor(map,showNavigation=true){this.showNavigation=showNavigation;
this.onAdd(map)}onAdd(map){this.map=map;this.parentContainer=window.L.DomUtil.get(
"spreadsheet-toolbar");this.builder=new window.L.control.jsDialogBuilder({mobileWizard:this,
map:this.map,cssClass:"jsdialog",suffix:"spreadsheet-toolbar"});this.create();map.on("doclayerinit",
this.onDocLayerInit,this);app.events.on("updatepermission",this.onUpdatePermission.bind(this))}
create(){var data=[{id:"sheets-buttons-toolbox",type:"toolbox",children:[{id:"firstrecord",
type:"customtoolitem",text:_("Scroll to the first sheet"),command:"firstrecord",
visible:this.showNavigation},{id:"prevrecord",type:"customtoolitem",text:_("Scroll left"),
command:"prevrecord",visible:this.showNavigation,pressAndHold:true},{id:"nextrecord",
type:"customtoolitem",text:_("Scroll right"),command:"nextrecord",visible:this.showNavigation,
pressAndHold:true},{id:"lastrecord",type:"customtoolitem",text:_("Scroll to the last sheet"),
command:"lastrecord",visible:this.showNavigation},{id:"insertsheet",type:"customtoolitem",text:_(
"Insert sheet"),command:"insertsheet"}]}];this.parentContainer.replaceChildren();this.builder.build(
this.parentContainer,data)}onDocLayerInit(){var docType=this.map.getDocType();if(
docType=="spreadsheet"){if(!window.mode.isMobile()){this.show()}}}onUpdatePermission(e){if(
e.detail.perm==="edit"){this.enableInsertion(true)}else{this.enableInsertion(false)}}
enableInsertion(enable){this.builder.executeAction(this.parentContainer,{control_id:"insertsheet",
action_type:enable?"enable":"disable"})}show(){this.parentContainer.style.display="grid"}hide(){
this.parentContainer.style.display="none"}}JSDialog.SheetsBar=function(map,showNavigation){
return new SheetsBar(map,showNavigation)};class PresentationBar{constructor(map){this.map=map;
this.parentContainer=window.L.DomUtil.get("presentation-toolbar");
this.builder=new window.L.control.jsDialogBuilder({mobileWizard:this,map:this.map,
cssClass:"jsdialog",suffix:"presentation-toolbar"});this.create();map.on("wopiprops",
this.onWopiProps,this);map.on("doclayerinit",this.onDocLayerInit,this);app.events.on(
"updatepermission",this.onUpdatePermission.bind(this));map.on("commandstatechanged",
this.onCommandStateChanged,this);if(this.map.getDocType()==="presentation"){this.map.on(
"updateparts",this.onSlideHideToggle,this);this.map.on("toggleslidehide",this.onSlideHideToggle,this
)}}create(){if(this.parentContainer.firstChild)return;var data=[{id:"presentation-buttons-toolbar",
type:"toolbox",children:[{id:"presentation",type:"customtoolitem",text:this._getItemUnoName(
"presentation"),command:"presentation"},{id:"insertpage",type:"customtoolitem",
text:this._getItemUnoName("insertpage"),command:"insertpage"},{id:"duplicatepage",
type:"customtoolitem",text:this._getItemUnoName("duplicatepage"),command:"duplicatepage"},{
id:"deletepage",type:"customtoolitem",text:this._getItemUnoName("deletepage"),command:"deletepage"},
{id:"showslide",type:"customtoolitem",text:_UNO(".uno:ShowSlide","presentation"),
command:"showslide",visible:this.map.getDocType()==="presentation"},{id:"hideslide",
type:"customtoolitem",text:_UNO(".uno:HideSlide","presentation"),command:"hideslide",
visible:this.map.getDocType()==="presentation"}]}];this.parentContainer.replaceChildren();
this.builder.build(this.parentContainer,data);if(this.map.getDocType()==="drawing"){this.showItem(
"presentation",false)}}enableItem(command,enable){this.builder.executeAction(this.parentContainer,{
control_id:command,action_type:enable?"enable":"disable"})}showItem(command,show){
this.builder.executeAction(this.parentContainer,{control_id:command,action_type:show?"show":"hide"})
}uncheck(){}show(){this.parentContainer.style.display="grid"}_getItemUnoName(id){
var docType=this.map.getDocType();switch(id){case"presentation":return docType==="presentation"?_(
"Fullscreen presentation"):"";case"insertpage":return docType==="presentation"?_UNO(
".uno:TaskPaneInsertPage","presentation"):_UNO(".uno:InsertPage","presentation");
case"duplicatepage":return docType==="presentation"?_UNO(".uno:DuplicateSlide","presentation"):_UNO(
".uno:DuplicatePage","presentation");case"deletepage":return docType==="presentation"?_UNO(
".uno:DeleteSlide","presentation"):_UNO(".uno:DeletePage","presentation")}return""}onWopiProps(e){
if(e.HideExportOption){this.showItem("presentation",false)}}onDocLayerInit(){if(!this.map["wopi"
].HideExportOption&&this.map.getDocType()!=="drawing"){this.showItem("presentation",true)}if(
!window.mode.isMobile())this.show()}onUpdatePermission(e){var presentationButtons=["insertpage",
"duplicatepage","deletepage"];if(e.detail.perm==="edit"){presentationButtons.forEach(id=>{
this.enableItem(id,true)});presentationButtons.forEach(id=>{if(id==="deletepage"){
var itemState=this.map["stateChangeHandler"].getItemValue(".uno:DeletePage")}else if(
id==="insertpage"){itemState=this.map["stateChangeHandler"].getItemValue(".uno:InsertPage")}else if(
id==="duplicatepage"){itemState=this.map["stateChangeHandler"].getItemValue(".uno:DuplicatePage")
}else{itemState="enabled"}if(itemState==="enabled"){this.enableItem(id,true)}else{this.enableItem(id
,false)}})}else{presentationButtons.forEach(id=>{this.enableItem(id,false)})}}onCommandStateChanged(
e){var commandName=e.commandName;var state=e.state;if(this.map.isEditMode()&&(
state==="enabled"||state==="disabled")){var id=window.unoCmdToToolbarId(commandName);if(
id==="deletepage"||id==="insertpage"||id==="duplicatepage"){if(state==="enabled"){this.enableItem(id
,true)}else{this.uncheck(id);this.enableItem(id,false)}}}}onSlideHideToggle(){if(
this.map.getDocType()!=="presentation")return;if(!app.impress.isSlideHidden(
this.map.getCurrentPartNumber())){this.showItem("showslide",false);this.showItem("hideslide",false)
}else{this.showItem("showslide",true);this.showItem("hideslide",true)}}}
JSDialog.PresentationBar=function(map){return new PresentationBar(map)};
class TopToolbar extends JSDialog.Toolbar{constructor(map){super(map,"TopToolbar","toolbar-up");
this.stylesSelectValue=null;map.on("doclayerinit",this.onDocLayerInit,this);
this.onUpdatePermission=this.onUpdatePermission.bind(this);app.events.on("updatepermission",
this.onUpdatePermission);map.on("wopiprops",this.onWopiProps,this);map.on("commandstatechanged",
this.onCommandStateChanged,this);app.events.on("contextchange",this.onContextChange.bind(this));if(
!window.mode.isMobile()){map.on("updatetoolbarcommandvalues",this.updateCommandValues,this)}}
onRemove(){if(this.parentContainer){this.parentContainer.outerHTML="";this.parentContainer=null}
this.map.off("doclayerinit",this.onDocLayerInit,this);app.events.off("updatepermission",
this.onUpdatePermission);this.map.off("wopiprops",this.onWopiProps,this);this.map.off(
"commandstatechanged",this.onCommandStateChanged,this);if(!window.mode.isMobile()){this.map.off(
"updatetoolbarcommandvalues",this.updateCommandValues,this)}}reset(){
this.parentContainer=window.L.DomUtil.get("toolbar-up");if(this.parentContainer){
this.parentContainer.outerHTML="";this.parentContainer=null}$("#toolbar-logo").after(
this.map.toolbarUpTemplate.cloneNode(true));this.parentContainer=window.L.DomUtil.get("toolbar-up");
window.L.DomUtil.addClass(this.parentContainer,"ui-toolbar")}callback(objectType,eventType,object,
data,builder){if(
object.id==="fontnamecombobox"||object.id==="fontsizecombobox"||object.id==="styles"){return}
this.builder._defaultCallbackHandler(objectType,eventType,object,data,builder)}onStyleSelect(e){
var style=e.target.value;if(style.startsWith(".uno:")){this.map.sendUnoCommand(style)}else if(
this.map.getDocType()==="text"){this.map.applyStyle(style,"ParagraphStyles")}else if(
this.map.getDocType()==="spreadsheet"){this.map.applyStyle(style,"CellStyles")}else if(
this.map.getDocType()==="presentation"||this.map.getDocType()==="drawing"){this.map.applyLayout(
style)}this.map.focus()}onContextChange(event){this.updateVisibilityForToolbar(event.detail.context)
}getToolItems(){var saveGroup=[{type:"customtoolitem",id:"closemobile",desktop:false,mobile:false,
tablet:true,visible:false},{type:"customtoolitem",id:"save",command:"save",text:_UNO(".uno:Save"),
lockUno:".uno:Save"},{type:"customtoolitem",id:"print",command:"print",text:_UNO(".uno:Print"),
mobile:false,tablet:false,lockUno:".uno:Print"},{type:"menubutton",id:"printoptions",
command:"printoptions",noLabel:true,text:"Печать",mobile:false,tablet:false,
lockUno:".uno:Print",menu:[{id:"print-active-sheet",action:"print-active-sheet",text:_(
"Active Sheet")},{id:"print-all-sheets",action:"print-all-sheets",text:_("All Sheets")}]}];
var undoGroup=[{type:"toolitem",id:"undo",text:_UNO(".uno:Undo"),command:".uno:Undo",mobile:false},{
type:"toolitem",id:"redo",text:_UNO(".uno:Redo"),command:".uno:Redo",mobile:false}];var fontGroup=[{
type:"toolitem",id:"formatpaintbrush",text:_UNO(".uno:FormatPaintbrush"),
command:".uno:FormatPaintbrush",mobile:false},{type:"toolitem",id:"reset",text:_UNO(
".uno:ResetAttributes","text"),visible:false,command:".uno:ResetAttributes",mobile:false},{
type:"toolitem",id:"resetimpress",class:"unoResetAttributes",text:_UNO(".uno:SetDefault",
"presentation","true"),visible:false,command:".uno:SetDefault",mobile:false},{type:"separator",
orientation:"vertical",id:"breakreset",invisible:true,mobile:false,tablet:false},{type:"listbox",
id:"styles",text:_("Default Style"),desktop:true,mobile:false,tablet:false},{type:"listbox",
id:"fontnamecombobox",text:"Carlito",command:".uno:CharFontName",mobile:false},{type:"listbox",
id:"fontsizecombobox",text:"12 pt",command:".uno:FontHeight",mobile:false}];var formatGroup=[{
type:"toolitem",id:"bold",text:_UNO(".uno:Bold"),command:".uno:Bold"},{type:"toolitem",id:"italic",
text:_UNO(".uno:Italic"),command:".uno:Italic"},{type:"toolitem",id:"underline",text:_UNO(
".uno:Underline"),command:".uno:Underline"},{type:"toolitem",id:"strikeout",text:_UNO(
".uno:Strikeout"),command:".uno:Strikeout"}];const fontColorGroup=[{type:"colorlistbox",
id:"fontcolorwriter:ColorPickerMenu",command:".uno:FontColor",text:_UNO(".uno:FontColor"),
visible:false,lockUno:".uno:FontColor"},{type:"colorlistbox",id:"fontcolor:ColorPickerMenu",
command:".uno:Color",text:_UNO(".uno:FontColor"),lockUno:".uno:FontColor"},{type:"colorlistbox",
id:"backcolor:ColorPickerMenu",command:".uno:CharBackColor",text:_UNO(".uno:CharBackColor","text"),
visible:false,lockUno:".uno:CharBackColor"},{type:"colorlistbox",
id:"backgroundcolor:ColorPickerMenu",command:".uno:BackgroundColor",text:_UNO(".uno:BackgroundColor"
),visible:false,lockUno:".uno:BackgroundColor"}];const indentGroup=[{type:"toolitem",id:"leftpara",
command:".uno:LeftPara",text:_UNO(".uno:LeftPara","",true),visible:false},{type:"toolitem",
id:"centerpara",command:".uno:CenterPara",text:_UNO(".uno:CenterPara","",true),visible:false},{
type:"toolitem",id:"rightpara",command:".uno:RightPara",text:_UNO(".uno:RightPara","",true),
visible:false},{type:"toolitem",id:"justifypara",command:".uno:JustifyPara",text:_UNO(
".uno:JustifyPara","",true),visible:false},{type:"separator",orientation:"vertical",id:"breakpara",
visible:false},{type:"menubutton",id:"setborderstyle:BorderStyleMenu",noLabel:true,
command:".uno:SetBorderStyle",text:_("Borders"),visible:false},{type:"toolitem",
id:"togglemergecells",text:_UNO(".uno:ToggleMergeCells","spreadsheet",true),visible:false,
command:".uno:ToggleMergeCells"},{type:"separator",orientation:"vertical",id:"breakmergecells",
visible:false},{type:"menubutton",id:"textalign",command:"justifypara",noLabel:true,text:_UNO(
".uno:TextAlign"),visible:false,lockUno:".uno:TextAlign",menu:[{id:"alignleft",text:_UNO(
".uno:AlignLeft","spreadsheet",true),icon:"alignleft",uno:".uno:AlignLeft"},{
id:"alignhorizontalcenter",text:_UNO(".uno:AlignHorizontalCenter","spreadsheet",true),
icon:"alignhorizontal",uno:".uno:AlignHorizontalCenter"},{id:"alignright",text:_UNO(
".uno:AlignRight","spreadsheet",true),icon:"alignright",uno:".uno:AlignRight"},{id:"alignblock",
text:_UNO(".uno:AlignBlock","spreadsheet",true),icon:"alignblock",uno:".uno:AlignBlock"},{
type:"separator"},{id:"aligntop",text:_UNO(".uno:AlignTop","spreadsheet",true),icon:"aligntop",
uno:".uno:AlignTop"},{id:"alignvcenter",text:_UNO(".uno:AlignVCenter","spreadsheet",true),
icon:"alignvcenter",uno:".uno:AlignVCenter"},{id:"alignbottom",text:_UNO(".uno:AlignBottom",
"spreadsheet",true),icon:"alignbottom",uno:".uno:AlignBottom"}]},{type:"menubutton",
id:"linespacing",command:"linespacing",noLabel:true,text:_UNO(".uno:FormatSpacingMenu"),
visible:false,lockUno:".uno:FormatSpacingMenu",menu:[{id:"spacepara1",text:_UNO(".uno:SpacePara1"),
uno:".uno:SpacePara1"},{id:"spacepara15",text:_UNO(".uno:SpacePara15"),uno:".uno:SpacePara15"},{
id:"spacepara2",text:_UNO(".uno:SpacePara2"),uno:".uno:SpacePara2"},{type:"separator"},{
id:"paraspaceincrease",text:_UNO(".uno:ParaspaceIncrease"),uno:".uno:ParaspaceIncrease"},{
id:"paraspacedecrease",text:_UNO(".uno:ParaspaceDecrease"),uno:".uno:ParaspaceDecrease"}]},{
type:"toolitem",id:"wraptextbutton",text:_UNO(".uno:WrapText","spreadsheet",true),visible:false,
command:".uno:WrapText"}];var otherGroup=[{type:"toolitem",id:"defaultnumbering",text:_UNO(
".uno:DefaultNumbering","",true),visible:false,command:".uno:DefaultNumbering"},{type:"toolitem",
id:"defaultbullet",text:_UNO(".uno:DefaultBullet","",true),visible:false,
command:".uno:DefaultBullet"},{type:"separator",orientation:"vertical",id:"breakbullet",
visible:false},{type:"toolitem",id:"incrementindent",text:_UNO(".uno:IncrementIndent","",true),
command:".uno:IncrementIndent",visible:false},{type:"toolitem",id:"decrementindent",text:_UNO(
".uno:DecrementIndent","",true),command:".uno:DecrementIndent",visible:false},{type:"separator",
orientation:"vertical",id:"breakindent",visible:false},{type:"menubutton",
id:"conditionalformatdialog:ConditionalFormatMenu",noLabel:true,text:_UNO(
".uno:ConditionalFormatMenu","spreadsheet",true),visible:false,lockUno:".uno:ConditionalFormatMenu"}
,{type:"toolitem",id:"sortascending",text:_UNO(".uno:SortAscending","spreadsheet",true),
command:".uno:SortAscending",visible:false},{type:"toolitem",id:"sortdescending",text:_UNO(
".uno:SortDescending","spreadsheet",true),command:".uno:SortDescending",visible:false},{
type:"separator",orientation:"vertical",id:"breaksorting",visible:false},{type:"toolitem",
id:"numberformatcurrency",text:_UNO(".uno:NumberFormatCurrency","spreadsheet",true),visible:false,
command:".uno:NumberFormatCurrency"},{type:"toolitem",id:"numberformatpercent",text:_UNO(
".uno:NumberFormatPercent","spreadsheet",true),visible:false,command:".uno:NumberFormatPercent"},{
type:"toolitem",id:"numberformatdecdecimals",text:_UNO(".uno:NumberFormatDecDecimals","spreadsheet",
true),visible:false,command:".uno:NumberFormatDecDecimals"},{type:"toolitem",
id:"numberformatincdecimals",text:_UNO(".uno:NumberFormatIncDecimals","spreadsheet",true),
visible:false,command:".uno:NumberFormatIncDecimals"},{type:"separator",orientation:"vertical",
id:"break-number",visible:false},{type:"button",id:"gridvisible",img:"gridvisible",hint:_UNO(
".uno:GridVisible"),uno:"GridVisible",hidden:true},{type:"button",id:"griduse",img:"griduse",
hint:_UNO(".uno:GridUse"),uno:"GridUse",hidden:true},{type:"menubutton",
id:"inserttable:InsertTableMenu",command:"inserttable",noLabel:true,text:_("Insert table"),
visible:false,lockUno:".uno:InsertTable"},{type:"menubutton",id:"menugraphic:InsertImageMenu",
noLabel:true,command:".uno:InsertGraphic",text:_UNO(".uno:InsertGraphic","",true),visible:false,
lockUno:".uno:InsertGraphic"},{type:"toolitem",id:"insertobjectchart",text:_UNO(
".uno:InsertObjectChart","",true),command:".uno:InsertObjectChart"},{type:"menubutton",
id:"insertshapes:InsertShapesMenu",command:".uno:BasicShapes",noLabel:true,text:_("Insert shapes")},
{type:"toolitem",id:"insertline",text:_UNO(".uno:Line","",true),command:".uno:Line"},{
type:"menubutton",id:"insertconnectors:InsertConnectorsMenu",command:"connector",noLabel:true,
text:_("Insert connectors"),visible:false},{type:"separator",orientation:"vertical",
id:"breakinsert",desktop:true},{type:"customtoolitem",id:"inserttextbox",text:_UNO(".uno:Text","",
true),command:"inserttextbox",visible:false},{type:"customtoolitem",id:"insertannotation",text:_UNO(
".uno:InsertAnnotation","",true),visible:false,lockUno:".uno:InsertAnnotation"},{
type:"customtoolitem",id:"inserthyperlink",command:"inserthyperlink",text:_UNO(
".uno:HyperlinkDialog","",true),lockUno:".uno:HyperlinkDialog"},{type:"toolitem",id:"insertsymbol",
text:_UNO(".uno:InsertSymbol","",true),command:".uno:InsertSymbol"}];var items=[{
type:"overflowmanager",id:"overflow-manager-toptoolbar",children:[{type:"overflowgroup",
id:"save-toptoolbar",children:saveGroup},{type:"separator",orientation:"vertical",id:"savebreak",
mobile:false},{type:"overflowgroup",id:"undo-toptoolbar",children:undoGroup},{type:"separator",
orientation:"vertical",id:"redobreak",mobile:false,tablet:false},{type:"overflowgroup",
id:"font-toptoolbar",children:fontGroup},{type:"separator",orientation:"vertical",
id:"breakfontsizes",invisible:true,mobile:false,tablet:false},{type:"overflowgroup",
id:"format-toptoolbar",children:formatGroup},{type:"separator",orientation:"vertical",
id:"breakformatting"},{type:"overflowgroup",id:"fontcolor-toptoolbar",children:fontColorGroup},{
type:"separator",orientation:"vertical",id:"breakcolor",mobile:false},{type:"overflowgroup",
id:"indent-toptoolbar",children:indentGroup},{type:"separator",orientation:"vertical",
id:"breakspacing",visible:false},{type:"overflowgroup",id:"other-toptoolbar",children:otherGroup}]},
{type:"spacer",id:"topspacer"},{type:"separator",orientation:"vertical",id:"breaksidebar",
visible:false},{type:"toolitem",id:"sidebar",text:_UNO(".uno:Sidebar","",true),
command:".uno:SidebarDeck.PropertyDeck",visible:false},{type:"toolitem",id:"modifypage",text:_UNO(
".uno:ModifyPage","presentation",true),command:".uno:ModifyPage",visible:false},{type:"toolitem",
id:"customanimation",text:_UNO(".uno:CustomAnimation","presentation",true),
command:".uno:CustomAnimation",visible:false},{type:"customtoolitem",id:"fold",text:_("Hide Menu"),
desktop:true,mobile:false,visible:true},{type:"customtoolitem",id:"hamburger-tablet",desktop:false,
mobile:false,tablet:true,iosapptablet:false,visible:false}];this.customItems.forEach(customButton=>{
var found=items.find(item=>{return item.id.toLowerCase()===customButton.beforeId.toLowerCase()});
var position=items.indexOf(found);customButton.items.forEach(item=>{items.splice(position,0,item)})}
);return items}updateControlsState(){if(this.map["stateChangeHandler"]){var items=this.map[
"stateChangeHandler"].getItems();if(items){for(var item in items){this.processStateChangedCommand(
item,items[item])}}}}create(){this.reset();var items=this.getToolItems();this.builder.build(
this.parentContainer,items);if(window.mode.isMobile()){JSDialog.MakeScrollable(this.parentContainer,
this.parentContainer.querySelector("div"));JSDialog.RefreshScrollables()}if(
this.map.isRestrictedUser()){for(var i=0;i<items.length;i++){var it=items[i];var item=$("#"+it.id)[0
];this.map.hideRestrictedItems(it,item,item)}}if(this.map.isLockedUser()){for(
var i=0;i<items.length;i++){var it=items[i];var item=$("#"+it.id)[0];this.map.disableLockedItem(it,
item,item)}}this.map.createFontSelector("#fontnamecombobox-input");if(this.map._docLoadedOnce
)this.onDocLayerInit();this.map.saveState=new app.definitions.saveState(this.map)}onDocLayerInit(){
var docType=this.map.getDocType();switch(docType){case"spreadsheet":if(this.parentContainer){[
"reset","textalign","wraptextbutton","breakspacing","insertannotation","conditionalformatdialog",
"numberformatcurrency","numberformatpercent","numberformatincdecimals","numberformatdecdecimals",
"break-number","togglemergecells","breakmergecells","setborderstyle","sortascending",
"sortdescending","breaksorting","backgroundcolor","breaksidebar","sidebar","printoptions"].forEach(
id=>{this.showItem(id,true)});this.showItem("print",false);this.showItem("styles",false)}$(
"#toolbar-wrapper").addClass("spreadsheet");if(window.mode.isTablet()){$(
this.map.options.documentContainer).addClass("tablet");$("#toolbar-wrapper").addClass("tablet")}
break;case"text":if(this.parentContainer){["fontcolorwriter","reset","leftpara","centerpara",
"rightpara","justifypara","breakpara","linespacing","breakspacing","defaultbullet",
"defaultnumbering","breakbullet","incrementindent","decrementindent","breakindent","inserttable",
"insertannotation","backcolor","breaksidebar","sidebar"].forEach(id=>{this.showItem(id,true)});
this.showItem("printoptions",false);this.showItem("fontcolor",false)}break;case"presentation":if($(
"#styles-input")[0]&&$("#styles-input")[0].length===1){var data=[""];data=data.concat({
text:"──────",enabled:false});window.L.Styles.impressLayout.forEach(function(layout){
data=data.concat({id:layout.id,text:_(layout.text)})},this);$("#styles-input").select2({data:data,
placeholder:_UNO(".uno:LayoutStatus","presentation")});$("#styles-input").on("select2:select",
this.onStyleSelect.bind(this))}if(this.parentContainer){["resetimpress","breaksidebar","modifypage",
"leftpara","centerpara","rightpara","justifypara","breakpara","linespacing","gridvisible","griduse",
"breakspacing","defaultbullet","defaultnumbering","breakbullet","inserttextbox","inserttable",
"insertannotation","backcolor","breaksidebar","modifypage","slidechangewindow","customanimation",
"masterslidespanel","navigator"].forEach(id=>{this.showItem(id,true)});this.showItem("printoptions",
false)}break;case"drawing":if(this.parentContainer){["leftpara","centerpara","rightpara",
"justifypara","breakpara","linespacing","gridvisible","griduse","breakspacing","defaultbullet",
"defaultnumbering","breakbullet","inserttextbox","inserttable","backcolor","breaksidebar","sidebar",
"insertconnectors"].forEach(id=>{this.showItem(id,true)});this.showItem("printoptions",false)}break}
this.updateVisibilityForToolbar();this.map.createFontSizeSelector("#fontsizecombobox-input");
JSDialog.RefreshScrollables()}onUpdatePermission(e){if(e.detail.perm==="edit"){$("#styles-input"
).prop("disabled",false);$("#fontnamecombobox-input").prop("disabled",false);$(
"#fontsizecombobox-input").prop("disabled",false)}else{$("#styles-input").prop("disabled",true);$(
"#fontnamecombobox-input").prop("disabled",true);$("#fontsizecombobox-input").prop("disabled",true)}
}onWopiProps(e){if(e.HideSaveOption){this.showItem("save",false)}if(e.HidePrintOption){
this.showItem("print",false)}if(window.mode.isDesktop()&&e.HideSaveOption&&e.HidePrintOption){
this.showItem("savebreak",false)}if(this.parentContainer){if(
e.EnableInsertRemoteImage||!e.DisableInsertLocalImage){this.showItem("menugraphic",true)}else{
this.showItem("menugraphic",false)}}}updateCommandValues(e){var data=[];var commandValues;if(
e.commandName===".uno:StyleApply"){var styles=[];var topStyles=[];
commandValues=this.map.getToolbarCommandValues(e.commandName);if(typeof commandValues==="undefined"
)return;var commands=commandValues.Commands;if(commands&&commands.length>0){commands.forEach(
function(command){var translated=command.text;if(window.L.Styles.styleMappings[command.text]){
translated=window.L.Styles.styleMappings[command.text].toLocaleString()}data=data.concat({
id:command.id,text:translated})},this)}if(this.map.getDocType()==="text"){
styles=commandValues.ParagraphStyles.slice(7);topStyles=commandValues.ParagraphStyles.slice(0,7)
}else if(this.map.getDocType()==="spreadsheet"){styles=commandValues.CellStyles}else if(
this.map.getDocType()==="presentation"){return}if(topStyles.length>0){data=data.concat({
text:"──────",enabled:false});topStyles.forEach(function(style){data=data.concat({id:style,
text:window.L.Styles.styleMappings[style].toLocaleString()})},this)}if(
styles!==undefined&&styles.length>0){data=data.concat({text:"──────",enabled:false});styles.forEach(
function(style){var localeStyle;if(style.startsWith("outline")){var outlineLevel=style.split(
"outline")[1];localeStyle="Outline".toLocaleString()+" "+outlineLevel}else{
localeStyle=window.L.Styles.styleMappings[style];
localeStyle=localeStyle===undefined?style:localeStyle.toLocaleString()}data=data.concat({id:style,
text:localeStyle})},this)}$("#styles-input").select2({data:data,placeholder:_("Style")});$(
"#styles-input").val(this.stylesSelectValue).trigger("change");$("#styles-input").on(
"select2:select",this.onStyleSelect.bind(this))}}processStateChangedCommand(commandName,state){
var found=false;if(commandName===".uno:StyleApply"){if(!state){return}if(this.map.getDocType(
)==="presentation"){return}$("#styles-input option").each(function(){var value=this.value;if(
state&&value.toLowerCase()===state.toLowerCase()){state=value;found=true;return}});if(!found){$(
"#styles-input").append($("<option></option>").text(state))}this.stylesSelectValue=state;$(
"#styles-input").val(state).trigger("change")}window.processStateChangedCommand(commandName,state)}
onCommandStateChanged(e){this.processStateChangedCommand(e.commandName,e.state)}}
JSDialog.TopToolbar=function(map){return new TopToolbar(map)};var SaveState=function(){
function SaveState(map){this.map=map;this.saveEle=document.getElementById("save");
this.saveIconEl=document.querySelector("#save img")}SaveState.prototype.showSavingStatus=function(){
if(window.mode.isMobile())return;if(this.saveEle.classList.contains("savemodified")){
this.saveEle.classList.remove("savemodified");var savingText=_("Saving");
this.saveEle.style.setProperty("--save-state",'"'+savingText+'"');this.saveEle.classList.add(
"saving");this.saveIconEl.classList.add("rotate-icon");this.saveEle.setAttribute("disabled","true")}
};SaveState.prototype.showSavedStatus=function(){var _this=this;if(window.mode.isMobile())return;if(
!this.saveEle.classList.contains("savemodified")){this.saveEle.classList.remove("saving");
this.saveIconEl.classList.remove("rotate-icon");var savedText=_("Saved");
this.saveEle.style.setProperty("--save-state",'"'+savedText+'"');this.saveEle.classList.add("saved")
setTimeout(function(){_this.saveEle.classList.remove("saved");_this.saveEle.removeAttribute(
"disabled")},2e3)}};SaveState.prototype.showModifiedStatus=function(){this.saveEle.classList.remove(
"saving");this.saveEle.classList.remove("saved");this.saveIconEl.classList.remove("rotate-icon");
this.saveEle.removeAttribute("disabled");this.saveEle.classList.add("savemodified")};
return SaveState}();app.definitions.saveState=SaveState;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var NotebookbarBase=function(_super){__extends(NotebookbarBase,
_super);function NotebookbarBase(map,impl){var _this=_super.call(this,map,"Notebookbar",
"notebookbar")||this;_this.impl=null;_this.impl=impl;_this.createBuilder();_this.impl.setBuilder(
_this.builder,_this.model);_this.map.addControl(_this.impl);_this.registerMessageHandlers();
return _this}NotebookbarBase.prototype.onAdd=function(){this.setupContainer(undefined);
this.impl.create(this.container);if(this.builder){this.map.on("commandstatechanged",
this.builder.onCommandStateChanged,this.builder)}};NotebookbarBase.prototype.onRemove=function(){if(
this.builder)this.map.off("commandstatechanged",this.builder.onCommandStateChanged,this.builder);if(
this.impl)this.impl.onRemove()};NotebookbarBase.prototype.createBuilder=function(){
this.builder=new window.L.control.notebookbarBuilder({windowId:WindowId.Notebookbar,
mobileWizard:this.impl,map:this.map,cssClass:"notebookbar",useSetTabs:true,suffix:"notebookbar"})};
NotebookbarBase.prototype.setupContainer=function(parentContainer){var toolbar=window.L.DomUtil.get(
"toolbar-up");if(toolbar)toolbar.outerHTML="";$("#toolbar-logo").after(
this.map.toolbarUpTemplate.cloneNode(true));toolbar=window.L.DomUtil.get("toolbar-up");
this.container=window.L.DomUtil.create("div","notebookbar-scroll-wrapper",toolbar)};
NotebookbarBase.prototype.onJSUpdate=function(e){var _a;if(_super.prototype.onJSUpdate.call(this,e)
){(_a=this.impl)===null||_a===void 0?void 0:_a.setInitialized(true);return true}return false};
NotebookbarBase.prototype.onJSAction=function(e){var _a;if(_super.prototype.onJSAction.call(this,e)
){(_a=this.impl)===null||_a===void 0?void 0:_a.setInitialized(true);return true}return false};
NotebookbarBase.prototype.getFullJSON=function(){var _a;return(_a=this.impl
)===null||_a===void 0?void 0:_a.getFullJSON()};
NotebookbarBase.prototype.getDefaultToolItems=function(){var _a;return(_a=this.impl
)===null||_a===void 0?void 0:_a.getDefaultToolItems()};
NotebookbarBase.prototype.insertButtonToShortcuts=function(button){var _a;(_a=this.impl
)===null||_a===void 0?void 0:_a.insertButtonToShortcuts(button)};
NotebookbarBase.prototype.reloadShortcutsBar=function(){var _a;(_a=this.impl
)===null||_a===void 0?void 0:_a.reloadShortcutsBar()};
NotebookbarBase.prototype.showNotebookbarButton=function(buttonId,show){var _a;(_a=this.impl
)===null||_a===void 0?void 0:_a.showNotebookbarButton(buttonId,show)};
NotebookbarBase.prototype.showNotebookbarCommand=function(commandId,show){var _a;(_a=this.impl
)===null||_a===void 0?void 0:_a.showNotebookbarCommand(commandId,show)};
NotebookbarBase.prototype.getTabs=function(){var _a;return(_a=this.impl
)===null||_a===void 0?void 0:_a.getTabs()};NotebookbarBase.prototype.setTabs=function(tabs){var _a;(
_a=this.impl)===null||_a===void 0?void 0:_a.setTabs()};NotebookbarBase.prototype.showTabs=function(
){var _a;(_a=this.impl)===null||_a===void 0?void 0:_a.showTabs()};
NotebookbarBase.prototype.hideTabs=function(){var _a;(_a=this.impl
)===null||_a===void 0?void 0:_a.hideTabs()};NotebookbarBase.prototype.showItem=function(id,show){
var _a;(_a=this.impl)===null||_a===void 0?void 0:_a.showItem(id)};
NotebookbarBase.prototype.hideItem=function(id){var _a;(_a=this.impl
)===null||_a===void 0?void 0:_a.hideItem(id)};return NotebookbarBase}(JSDialogComponent);
JSDialog.NotebookbarBase=function(map,impl){return new NotebookbarBase(map,impl)};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var UIManager=function(_super){__extends(UIManager,_super);
function UIManager(){var _this=_super!==null&&_super.apply(this,arguments)||this;
_this.mobileWizard=null;_this.documentNameInput=null;_this.blockedUI=false;_this.busyPopupTimer=null
_this.customButtons=[];_this.hiddenButtons={};_this.hiddenCommands={};_this.hiddenTabs={};
return _this}UIManager.prototype.onAdd=function(map){var _this=this;this.map=map;
this.notebookbar=null;this.map.toolbarUpTemplate=$("#toolbar-up")[0].cloneNode(true);
this.map.mainMenuTemplate=$("#main-menu")[0].cloneNode(true);map.on("infobar",this.showInfoBar,this)
app.events.on("updatepermission",this.onUpdatePermission.bind(this));if(window.mode.isMobile()){
window.addEventListener("popstate",this.onGoBack.bind(this));history.pushState({
context:"app-started"},"app-started");history.pushState({context:"app-started"},"app-started")}
map.on("blockUI",this.blockUI,this);map.on("unblockUI",this.unblockUI,this);$("#toolbar-wrapper"
).on("click",function(event){var _a;var target=event.target;if(((_a=target.parentElement
)===null||_a===void 0?void 0:_a.id)==="toolbar-up")_this.map.fire("editorgotfocus")});$(".main-nav"
).on("click",function(event){var _a,_b;var target=event.target;if(((_a=target.parentElement
)===null||_a===void 0?void 0:_a.nodeName)==="NAV"||target.nodeName==="NAV"||((
_b=target.parentElement)===null||_b===void 0?void 0:_b.id)==="document-titlebar"){_this.map.fire(
"editorgotfocus")}});var mainNav=document.querySelector(".main-nav");mainNav.addEventListener(
"wheel",function(e){var el=this;if(e.shiftKey||el.scrollWidth<=el.clientWidth)return;
this.scrollLeft+=e.deltaY;e.preventDefault()},{passive:false});this.map.on("updateviewslist",
this.onUpdateViews,this);this.map["stateChangeHandler"].setItemValue("toggledarktheme","false");
this.map["stateChangeHandler"].setItemValue("invertbackground","false");this.map[
"stateChangeHandler"].setItemValue("showannotations","true")};
UIManager.prototype.getCurrentMode=function(){if(window.mode.isMobile())return"classic";
return this.shouldUseNotebookbarMode()?"notebookbar":"classic"};
UIManager.prototype.getHighlightMode=function(){return window.prefs.getBoolean(
"ColumnRowHighlightEnabled",false)};UIManager.prototype.setHighlightMode=function(newState){
window.prefs.set("ColumnRowHighlightEnabled",newState);var highlightState=newState?"true":"false";
this.map["stateChangeHandler"].setItemValue("columnrowhighlight",highlightState);this._map.fire(
"commandstatechanged",{commandName:"columnrowhighlight",state:highlightState})};
UIManager.prototype.shouldUseNotebookbarMode=function(){var forceCompact=window.prefs.get(
"compactMode",null);
var shouldUseClassic=window.userInterfaceMode==="classic"&&forceCompact==null||forceCompact==="true"
return!shouldUseClassic};UIManager.prototype.loadLightMode=function(){
document.documentElement.setAttribute("data-theme","light");this._map.fire("commandstatechanged",{
commandName:"toggledarktheme",state:"false"});this.map.fire("darkmodechanged")};
UIManager.prototype.loadDarkMode=function(){document.documentElement.setAttribute("data-theme",
"dark");this._map.fire("commandstatechanged",{commandName:"toggledarktheme",state:"true"});
this.map.fire("darkmodechanged")};UIManager.prototype.setCanvasColorAfterModeChange=function(){if(
app.sectionContainer){app.sectionContainer.setBackgroundColorMode(false);if(this.map.getDocType(
)=="spreadsheet"){app.sectionContainer.setClearColor(window.getComputedStyle(
document.documentElement).getPropertyValue("--color-background-document"))}else{
app.sectionContainer.setClearColor(window.getComputedStyle(document.documentElement
).getPropertyValue("--color-canvas"))}app.sectionContainer.setBackgroundColorMode(true)}};
UIManager.prototype.setDarkBackground=function(activate){var cmd={NewTheme:{type:"string",value:""}}
activate?cmd.NewTheme.value="Dark":cmd.NewTheme.value="Light";app.socket.sendMessage(
"uno .uno:InvertBackground "+JSON.stringify(cmd));this.initDarkBackgroundUI(activate)};
UIManager.prototype.initDarkBackgroundUI=function(activate){document.documentElement.setAttribute(
"data-bg-theme",activate?"dark":"light");if(activate){this._map.fire("commandstatechanged",{
commandName:"invertbackground",state:"false"})}else{this._map.fire("commandstatechanged",{
commandName:"invertbackground",state:"true"})}this.setCanvasColorAfterModeChange()};
UIManager.prototype.applyInvert=function(skipCore){if(skipCore===void 0){skipCore=false}
var backgroundDark=this.isBackgroundDark();if(skipCore){this.initDarkBackgroundUI(backgroundDark)
}else{this.setDarkBackground(backgroundDark)}};UIManager.prototype.isBackgroundDark=function(){
var inDarkTheme=window.prefs.getBoolean("darkTheme");
var darkBackgroundPrefName="darkBackgroundForTheme."+(inDarkTheme?"dark":"light");
var backgroundDark=window.prefs.getBoolean(darkBackgroundPrefName,inDarkTheme);return backgroundDark
};UIManager.prototype.toggleInvert=function(){var inDarkTheme=window.prefs.getBoolean("darkTheme");
var darkBackgroundPrefName="darkBackgroundForTheme."+(inDarkTheme?"dark":"light");
var backgroundDark=window.prefs.getBoolean(darkBackgroundPrefName,inDarkTheme);if(backgroundDark){
window.prefs.set(darkBackgroundPrefName,false);this.setDarkBackground(false)}else{window.prefs.set(
darkBackgroundPrefName,true);this.setDarkBackground(true)}};
UIManager.prototype.toggleDarkMode=function(){var inDarkTheme=window.prefs.getBoolean("darkTheme");
if(inDarkTheme){window.prefs.set("darkTheme",false);this.loadLightMode();
this.activateDarkModeInCore(false)}else{window.prefs.set("darkTheme",true);this.loadDarkMode();
this.activateDarkModeInCore(true)}this.applyInvert();this.setCanvasColorAfterModeChange();if(
!window.mode.isMobile())this.refreshAfterThemeChange();if(app.map._docLayer._docType==="spreadsheet"
){var calcGridSection=app.sectionContainer.getSectionWithName(app.CSections.CalcGrid.name);if(
calcGridSection)calcGridSection.resetStrokeStyle()}this.map.fire("themechanged")};
UIManager.prototype.initDarkModeFromSettings=function(){var inDarkTheme=window.prefs.getBoolean(
"darkTheme");if(inDarkTheme){this.loadDarkMode()}else{this.loadLightMode()}this.applyInvert(true)};
UIManager.prototype.activateDarkModeInCore=function(activate){var cmd={NewTheme:{type:"string",
value:""}};activate?cmd.NewTheme.value="Dark":cmd.NewTheme.value="Light";app.socket.sendMessage(
"uno .uno:ChangeTheme "+JSON.stringify(cmd))};UIManager.prototype.renameDocument=function(){
var docNameInput=this.documentNameInput;var fileName=this.map["wopi"].BaseFileName?this.map["wopi"
].BaseFileName:"";this.showInputModal("rename-modal",_("Rename Document"),_("Enter new name"),
fileName,_("Rename"),function(newName){docNameInput.documentNameConfirm(newName)})};
UIManager.prototype.toggleWasm=function(){if(window.ThisIsTheEmscriptenApp){}else{
app.socket.sendMessage("switch_request offline")}};
UIManager.prototype.initializeMenubarAndTopToolbar=function(){
var enableNotebookbar=this.shouldUseNotebookbarMode();var isMobile=window.mode.isMobile();if(
isMobile||!enableNotebookbar){var menubar=new Menubar;this.map.menubar=menubar;this.map.addControl(
menubar)}if(!isMobile&&!enableNotebookbar)this.map.topToolbar=JSDialog.TopToolbar(this.map)};
UIManager.prototype.initializeBasicUI=function(){var _this=this;app.console.debug(
"UIManager: initialize basic UI");this.initializeMenubarAndTopToolbar();if(window.mode.isMobile()){
$("#toolbar-mobile-back").on("click",function(){_this.enterReadonlyOrClose()})}if(
!window.mode.isMobile()){this.map.statusBar=JSDialog.StatusBar(this.map);
this.map.sidebar=JSDialog.Sidebar(this.map);this.map.navigator=JSDialog.NavigatorPanel(this.map);
this.map.formulaautocomplete=new FormulaAutoCompletePopup(this.map);
this.map.formulausage=new FormulaUsagePopup(this.map);
this.map.autofillpreviewtooltip=new AutoFillPreviewTooltip(this.map)}
this.map.jsdialog=window.L.control.jsDialog();this.map.addControl(this.map.jsdialog);
window.setupToolbar(this.map);this.documentNameInput=window.L.control.documentNameInput();
this.map.addControl(this.documentNameInput);this.map.addControl(window.L.control.alertDialog());if(
window.mode.isMobile()){this.mobileWizard=window.L.control.mobileWizard();this.map.addControl(
this.mobileWizard)}this.map.addControl(window.L.control.languageDialog());
this.map.dialog=window.L.control.lokDialog();this.map.addControl(this.map.dialog);
this.map.addControl(window.L.control.contextMenu());this.map.userList=window.L.control.userList();
this.map.addControl(this.map.userList);this.map.aboutDialog=JSDialog.aboutDialog(this.map);if(
window.L.Map.versionBar&&false)this.map.addControl(window.L.Map.versionBar)
var openBusyPopup=function(label){_this.busyPopupTimer=window.setTimeout(function(){var json={
id:"busypopup",jsontype:"dialog",type:"modalpopup",children:[{id:"busycontainer",type:"container",
vertical:"true",children:[{id:"busyspinner",type:"spinnerimg"},{id:"busylabel",type:"fixedtext",
text:label}]}]};if(app.socket){var builderCallback=function(){};app.socket._onMessage({
textMsg:"jsdialog: "+JSON.stringify(json),callback:builderCallback})}},700)};
var fadeoutBusyPopup=function(){if(_this.busyPopupTimer!=null)window.clearTimeout(
_this.busyPopupTimer);var json={id:"busypopup",jsontype:"dialog",type:"modalpopup",action:"fadeout"}
if(app.socket)app.socket._onMessage({textMsg:"jsdialog: "+JSON.stringify(json)})};this.map.on(
"showbusy",function(e){fadeoutBusyPopup();openBusyPopup(e.label)});this.map.on("hidebusy",function(e
){fadeoutBusyPopup()});app.serverConnectionService.onBasicUI()};
UIManager.prototype.initializeSpecializedUI=function(docType){var _a,_b,_c,_d;app.console.debug(
"UIManager: initialize specialized UI for: "+docType);var isDesktop=window.mode.isDesktop();
var currentMode=this.getCurrentMode();
var enableNotebookbar=currentMode==="notebookbar"&&!app.isReadOnly();
var hasShare=this.map.wopi.EnableShare;document.body.setAttribute("data-userInterfaceMode",
currentMode);document.body.setAttribute("data-docType",docType);if(hasShare
)document.body.setAttribute("data-integratorSidebar","true");if(window.mode.isMobile()){$(
"#mobile-edit-button").css("display","flex");this.map.mobileBottomBar=JSDialog.MobileBottomBar(
this.map);this.map.mobileTopBar=JSDialog.MobileTopBar(this.map);
this.map.mobileSearchBar=JSDialog.MobileSearchBar(this.map)}else{this.createNotebookbarControl(
docType,enableNotebookbar)}if(!window.prefs.getBoolean(docType+".ShowToolbar",true)){
this.collapseNotebookbar()}this.initDarkModeFromSettings();if(docType==="spreadsheet"){
this.sheetsBar=JSDialog.SheetsBar(this.map,isDesktop||window.mode.isTablet());
var formulabarRow=document.getElementById("formulabar-row");
var spreadsheetToolbar=document.getElementById("spreadsheet-toolbar");(
_a=spreadsheetToolbar===null||spreadsheetToolbar===void 0?void 0:spreadsheetToolbar.classList
)===null||_a===void 0?void 0:_a.remove("hidden");(
_b=formulabarRow===null||formulabarRow===void 0?void 0:formulabarRow.classList
)===null||_b===void 0?void 0:_b.remove("hidden");this.map.formulabar=JSDialog.FormulaBar(this.map);
this.map.addressInputField=JSDialog.AddressInputField(this.map);$("#toolbar-wrapper").addClass(
"spreadsheet");window.L.DomUtil.remove(window.L.DomUtil.get("presentation-controls-wrapper"));
var selectBackground=document.getElementById("selectbackground");if(selectBackground!=null)(
_c=selectBackground.parentNode)===null||_c===void 0?void 0:_c.removeChild(selectBackground);
var highlightState=this.getHighlightMode()?"true":"false";this.map["stateChangeHandler"
].setItemValue("columnrowhighlight",highlightState);this._map.fire("commandstatechanged",{
commandName:"columnrowhighlight",state:highlightState})}if(this.map.isPresentationOrDrawing()){
window.L.DomUtil.remove(window.L.DomUtil.get("spreadsheet-toolbar"));$(
"#presentation-controls-wrapper").show();this.initializeRuler();
this.map.slideShowPresenter=new SlideShow.SlideShowPresenter(this.map,window.enableAccessibility);
this.map.presenterConsole=new SlideShow.PresenterConsole(this.map,this.map.slideShowPresenter)}if(
docType==="text"){window.L.DomUtil.remove(window.L.DomUtil.get("spreadsheet-toolbar"));
window.L.DomUtil.remove(window.L.DomUtil.get("presentation-controls-wrapper"));
var selectBackground=document.getElementById("selectbackground");if(selectBackground!=null)(
_d=selectBackground.parentNode)===null||_d===void 0?void 0:_d.removeChild(selectBackground);
this.initializeRuler();var showResolved=this.getBooleanDocTypePref("ShowResolved",true);if(
showResolved===false)this.map.sendUnoCommand(".uno:ShowResolvedAnnotations");
var initialCommentState=this.map["stateChangeHandler"].getItemValue("showannotations");
this._map.fire("commandstatechanged",{commandName:"showannotations",state:initialCommentState});
this.map.mention=new Mention(this.map);if(!window.mode.isMobile()){
this.map.quickFindPanel=JSDialog.QuickFindPanel(this.map);this.map.addControl(
this.map.quickFindPanel)}}if(this.map.isPresentationOrDrawing()&&(isDesktop||window.mode.isTablet())
){JSDialog.PresentationBar(this.map)}if((window.mode.isTablet()||window.mode.isDesktop()
)&&!app.isReadOnly()){this.map.navigator.initializeNavigator(docType)}this.map.on("changeuimode",
this.onChangeUIMode,this);this.refreshTheme();
var startPresentationGet=this.map.isPresentationOrDrawing()&&window.coolParams.get(
"startPresentation");this.map.on("docloaded",function(){if(
startPresentationGet==="true"||startPresentationGet==="1"){app.dispatcher.dispatch("presentation")}}
);this.map.contextToolbar=new ContextToolbar(this.map);app.serverConnectionService.onSpecializedUI(
docType)};UIManager.prototype.initializeLateComponents=function(){app.console.debug(
"UIManager: late components init");this.initializeNotebookbarInCore();this.initializeSidebar();
this.initializeQuickFindInCore()};UIManager.prototype.initializeSidebar=function(){if(
window.mode.isDesktop()&&!window.ThisIsAMobileApp){var showSidebar=this.getBooleanDocTypePref(
"ShowSidebar",true);if(showSidebar&&this.getBooleanDocTypePref("PropertyDeck",true)){
app.socket.sendMessage("uno .uno:SidebarShow");this.map.sidebar.setAsInitialized()}if(
showSidebar&&this.map.getDocType()==="presentation"){if(this.getBooleanDocTypePref(
"SdSlideTransitionDeck",false)){app.socket.sendMessage("uno .uno:SidebarShow");
app.socket.sendMessage("uno .uno:SlideChangeWindow");this.map.sidebar.setupTargetDeck(
".uno:SlideChangeWindow")}else if(this.getBooleanDocTypePref("SdCustomAnimationDeck",false)){
app.socket.sendMessage("uno .uno:SidebarShow");app.socket.sendMessage("uno .uno:CustomAnimation");
this.map.sidebar.setupTargetDeck(".uno:CustomAnimation")}}else if(
showSidebar&&this.getBooleanDocTypePref("StyleListDeck",false)){app.socket.sendMessage(
"uno .uno:SidebarShow");app.socket.sendMessage("uno .uno:SidebarDeck.StyleListDeck");
this.map.sidebar.setupTargetDeck(".uno:SidebarDeck.StyleListDeck")}if(showSidebar
)this.map.sidebar.setAsInitialized();else app.socket.sendMessage("uno .uno:SidebarHide")}else if(
window.mode.isChromebook()){app.socket.sendMessage("uno .uno:SidebarHide")}};
UIManager.prototype.initializeRuler=function(){if((window.mode.isTablet()||window.mode.isDesktop()
)&&!app.isReadOnly()){var showRuler=this.getBooleanDocTypePref("ShowRuler");
var interactiveRuler=this.map.isEditMode();app.definitions.ruler.initializeRuler(this.map,{
interactive:interactiveRuler,showruler:showRuler})}};UIManager.prototype.removeClassicUI=function(){
if(this.map.menubar){this.map.removeControl(this.map.menubar);this.map.menubar=null}if(
this.map.topToolbar){this.map.topToolbar.onRemove();this.map.topToolbar=null}};
UIManager.prototype.addClassicUI=function(){this.map.menubar=new Menubar;this.map.addControl(
this.map.menubar);this.map.topToolbar=JSDialog.TopToolbar(this.map);this.map.topToolbar.onWopiProps(
this.map.wopi);this.map.menubar._onDocLayerInit();this.map.topToolbar.onDocLayerInit();
this.map.sendInitUNOCommands();this.map._docLayer._resetClientVisArea();
this.map._docLayer._requestNewTiles();this.map.topToolbar.updateControlsState();if(
this._menubarShouldBeHidden)this.hideMenubar()};
UIManager.prototype.createNotebookbarControl=function(docType,showUI){if(docType==="spreadsheet"){
var notebookbar=window.L.control.notebookbarCalc()}else if(docType==="presentation"){
notebookbar=window.L.control.notebookbarImpress()}else if(docType==="drawing"){
notebookbar=window.L.control.notebookbarDraw()}else{notebookbar=window.L.control.notebookbarWriter()
}this.notebookbar=JSDialog.NotebookbarBase(this.map,notebookbar);if(showUI
)this.showNotebookbarControl()};UIManager.prototype.showNotebookbarControl=function(){
this.notebookbar.onAdd();this.map.fire("a11ystatechanged");
app.UI.notebookbarAccessibility.initialize()};UIManager.prototype.refreshAfterThemeChange=function(
){if(this.getCurrentMode()==="classic"||this.map.isReadOnlyMode()){this.refreshMenubar();
this.refreshToolbar()}};UIManager.prototype.refreshNotebookbar=function(){var selectedTab=$(
'.ui-tab.notebookbar[aria-selected="true"]').attr("id")||"Home-tab-label";this.removeNotebookbarUI()
this.showNotebookbarControl();if(this._map._permission==="edit"){$(".main-nav").removeClass(
"readonly")}$("#"+selectedTab).click();this.makeSpaceForNotebookbar();
this.notebookbar._showNotebookbar=true;this.notebookbar.showTabs();$("#map").addClass(
"notebookbar-opened");this.insertCustomButtons();this.map.sendInitNotebookbarCommands();if(
this.map.getDocType()==="presentation")this.map.fire("toggleslidehide")};
UIManager.prototype.refreshMenubar=function(){if(this.map.menubar)this.map.menubar._onRefresh()};
UIManager.prototype.refreshSidebar=function(ms){ms=ms!==undefined?ms:400;setTimeout(function(){
var message="dialogevent "+(window.sidebarId!==undefined?window.sidebarId:-1)+' {"id":"-1"}';
app.socket.sendMessage(message)},ms)};UIManager.prototype.refreshToolbar=function(){};
UIManager.prototype.addNotebookbarUI=function(){this.refreshNotebookbar();
this.map._docLayer._resetClientVisArea();this.map._docLayer._requestNewTiles();
var menubarWasHidden=this.isMenubarHidden();this.showMenubar();
this._menubarShouldBeHidden=menubarWasHidden};UIManager.prototype.removeNotebookbarUI=function(){
this.notebookbar.onRemove();$("#map").removeClass("notebookbar-opened")};
UIManager.prototype.onChangeUIMode=function(uiMode){if(window.mode.isMobile())return;
var currentMode=this.getCurrentMode();if(uiMode.mode===currentMode&&!uiMode.force)return;if(
uiMode.mode!=="classic"&&uiMode.mode!=="notebookbar")return;document.body.setAttribute(
"data-userInterfaceMode",uiMode.mode);this.map.fire("postMessage",{msgId:"Action_ChangeUIMode_Resp",
args:{Mode:uiMode.mode}});switch(currentMode){case"classic":this.removeClassicUI();break;
case"notebookbar":this.removeNotebookbarUI();break}window.userInterfaceMode=uiMode.mode;switch(
uiMode.mode){case"classic":this.addClassicUI();break;case"notebookbar":this.addNotebookbarUI();break
}window.prefs.set("compactMode",uiMode.mode==="classic");this.initializeLateComponents();
this.insertCustomButtons();this.map.fire("rulerchanged");this.map.fire("statusbarchanged");if(
typeof window.initializedUI==="function")window.initializedUI();this.map.fire("darkmodechanged");
this.map.fire("rulerchanged");this.map.fire("statusbarchanged");this.map.fire("a11ystatechanged");
JSDialog.RefreshScrollables()};UIManager.prototype.insertButtonToClassicToolbar=function(button){if(
this.map.isEditMode()){var insertBefore=button.insertBefore||"save";var newButton=[{type:"button",
uno:button.unoCommand,id:button.id,img:button.id,hint:_(button.hint.replaceAll('"',"&quot;")),
postmessage:!Object.prototype.hasOwnProperty.call(button,"unoCommand")}];
var topToolbar=window.app.map.topToolbar;if(topToolbar&&!topToolbar.hasItem(button.id)){newButton[0
].command=newButton[0].uno;newButton[0].type="toolitem";newButton[0].w2icon=newButton[0].img;
newButton[0].text=newButton[0].hint;topToolbar.insertItem(insertBefore,newButton);
this.setCssRulesForCustomButtons()}}if(this.map.isReadOnlyMode()){this.map.fire("addmenu",{
id:button.id,label:button.hint})}};UIManager.prototype.setCssRulesForCustomButtons=function(){
var e_1,_a;try{for(var _b=__values(this.customButtons),_c=_b.next();!_c.done;_c=_b.next()){
var button=_c.value;var item=document.querySelector(".w2ui-icon."+encodeURIComponent(button.id));
var imgUrl=button.imgurl;if(item){if(button.imgurl===undefined||button.imgurl===""){
var iconName=app.LOUtil.getIconNameOfCommand(button.unoCommand);imgUrl=app.LOUtil.getImageURL(
iconName)}item.style.background='url("'+encodeURI(imgUrl)+'")';
item.style.backgroundRepeat="no-repeat";item.style.backgroundPosition="center"}}}catch(e_1_1){e_1={
error:e_1_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}
}};UIManager.prototype.insertButton=function(button){for(var i in this.customButtons){
var item=this.customButtons[i];if(item.id===button.id)return}this.customButtons.push(button);
this.insertCustomButton(button)};UIManager.prototype.insertCustomButton=function(button){if(
button.tablet===false&&window.mode.isTablet())return;if(this.getCurrentMode()==="classic"
)this.insertButtonToClassicToolbar(button);if(this.notebookbar
)this.notebookbar.insertButtonToShortcuts(button);else app.console.error(
"UIManager: no notebookbar yet to insert button: "+JSON.stringify(button))};
UIManager.prototype.insertCustomButtons=function(){for(var i in this.customButtons
)this.insertCustomButton(this.customButtons[i])};
UIManager.prototype.showButtonInClassicToolbar=function(buttonId,show){var toolbars=[];
var found=false;toolbars.forEach(function(toolbar){if(toolbar&&toolbar.get(buttonId)){found=true;
toolbar.showItem(buttonId,show)}});var topToolbarHas=window.app.map.topToolbar.hasItem(buttonId);
found=found||topToolbarHas;if(topToolbarHas)window.app.map.topToolbar.showItem(buttonId,show);
return found};UIManager.prototype.showButton=function(buttonId,show){var found=false;if(show
)delete this.hiddenButtons[buttonId];else this.hiddenButtons[buttonId]=true;if(this.getCurrentMode(
)==="classic")found=this.showButtonInClassicToolbar(buttonId,show);if(this.notebookbar){if(
this.getCurrentMode()==="notebookbar")this.notebookbar.reloadShortcutsBar();
found=show?this.notebookbar.showItem(buttonId):this.notebookbar.hideItem(buttonId)}if(!found
)window.app.console.error('UIManager: Button with id "'+buttonId+'" not found.')};
UIManager.prototype.isButtonVisible=function(buttonId){return!(buttonId in this.hiddenButtons)};
UIManager.prototype.showCommandInMenubar=function(command,show){var menubar=this._map.menubar;if(
show){return menubar.showUnoItem(command)}else{return menubar.hideUnoItem(command)}};
UIManager.prototype.showCommandInClassicToolbar=function(command,show){var _this=this;var toolbars=[
];var found=false;toolbars.forEach(function(toolbar){if(!toolbar)return;toolbar.items.forEach(
function(item){var commands=_this.map._extractCommand(item);if(commands.indexOf(command)!=-1){
found=true;if(show){toolbar.showItem(item.id,true)}else{toolbar.showItem(item.id,false)}}})});
return found};UIManager.prototype.showCommand=function(command,show){if(show
)delete this.hiddenCommands[command];else this.hiddenCommands[command]=true;var found=false;if(
this.getCurrentMode()==="classic"){found||(found=this.showCommandInClassicToolbar(command,show));
found||(found=this.showCommandInMenubar(command,show))}if(this.notebookbar){if(this.getCurrentMode(
)==="notebookbar")this.notebookbar.reloadShortcutsBar();found||(
found=this.notebookbar.showNotebookbarCommand(command,show))}if(!found)window.app.console.error(
'UIManager: Item with command "'+command+'" not found.')};
UIManager.prototype.isCommandVisible=function(command){return!(command in this.hiddenCommands)};
UIManager.prototype.showMenubar=function(){this._menubarShouldBeHidden=false;if(
!this.isMenubarHidden())return;$(".main-nav").show();if(
window.L.Params.closeButtonEnabled&&!window.mode.isTablet()){$("#closebuttonwrapper").show();$(
"#closebuttonwrapperseparator").show()}var obj=document.getElementById("fold-button");if(obj!=null
)obj.style.transform="rotate(0deg)";$("#fold").prop("title",_("Hide Menu"));if(
this._notebookbarShouldBeCollapsed)this.collapseNotebookbar()};
UIManager.prototype.hideMenubar=function(){this._menubarShouldBeHidden=true;if(this.isMenubarHidden(
)||this.shouldUseNotebookbarMode())return;var notebookbarWasCollapsed=this.isNotebookbarCollapsed();
this.extendNotebookbar();this._notebookbarShouldBeCollapsed=notebookbarWasCollapsed;$(".main-nav"
).hide();if(window.L.Params.closeButtonEnabled){$("#closebuttonwrapper").hide();$(
"#closebuttonwrapperseparator").hide()}var obj=document.getElementById("fold-button");if(obj!=null
)obj.style.transform="rotate(180deg)";$("#fold").prop("title",_("Show Menu"))};
UIManager.prototype.isMenubarHidden=function(){return $(".main-nav").css("display")==="none"};
UIManager.prototype.toggleMenubar=function(){if(this.isMenubarHidden())this.showMenubar(
);else this.hideMenubar()};UIManager.prototype.showRuler=function(){this._map.sendUnoCommand(
".uno:ShowRuler");$(".cool-ruler").show();$("#map").addClass("hasruler");this.setDocTypePref(
"ShowRuler",true);this.map.fire("rulerchanged")};UIManager.prototype.hideRuler=function(){$(
".cool-ruler").hide();$("#map").removeClass("hasruler");this.setDocTypePref("ShowRuler",false);
this.map.fire("rulerchanged")};UIManager.prototype.toggleRuler=function(){if(this.isRulerVisible()
)this.hideRuler();else this.showRuler()};UIManager.prototype.isRulerVisible=function(){return $(
".cool-ruler").is(":visible")};UIManager.prototype.isFullscreen=function(){if(
!document.fullscreenElement&&!document.mozFullscreenElement&&!document.msFullscreenElement&&!document.webkitFullscreenElement
)return false;else return true};UIManager.prototype.initializeNotebookbarInCore=function(){if(
window.mode.isMobile())return;if(!this.notebookbar.impl.initialized){this.map.sendUnoCommand(
".uno:ToolbarMode?Mode:string=Default");this.map.sendUnoCommand(
".uno:ToolbarMode?Mode:string=notebookbar_online.ui")}};
UIManager.prototype.initializeQuickFindInCore=function(){if(!this.map.quickFindPanel)return;
app.socket.sendMessage("uno .uno:QuickFind")};UIManager.prototype.hasNotebookbarShown=function(){
return $("#map").hasClass("notebookbar-opened")};
UIManager.prototype.makeSpaceForNotebookbar=function(){if(this.hasNotebookbarShown())return;$("#map"
).addClass("notebookbar-opened")};UIManager.prototype.collapseNotebookbar=function(){
this._notebookbarShouldBeCollapsed=true;if(this.isNotebookbarCollapsed()||this.isMenubarHidden()
)return;this.moveObjectVertically($("#formulabar"),-1);$("#toolbar-wrapper").css("display","none");
$("#document-container").addClass("tabs-collapsed")};UIManager.prototype.extendNotebookbar=function(
){this._notebookbarShouldBeCollapsed=false;if(!this.isNotebookbarCollapsed())return;
this.moveObjectVertically($("#formulabar"),1);$("#toolbar-wrapper").css("display","");$(
"#document-container").removeClass("tabs-collapsed")};UIManager.prototype.showNotebookTab=function(
id,show){if(show){delete this.hiddenTabs[id]}else{this.hiddenTabs[id]=true}if(this.notebookbar){
this.notebookbar.refreshContextTabsVisibility()}};UIManager.prototype.isTabVisible=function(name){
return!(name in this.hiddenTabs)};UIManager.prototype.isNotebookbarCollapsed=function(){return $(
"#document-container").hasClass("tabs-collapsed")};UIManager.prototype.showStatusBar=function(){$(
"#document-container").css("bottom",this.documentBottom);this.map.statusBar.show();
this.setDocTypePref("ShowStatusbar",true);this.map.fire("statusbarchanged")};
UIManager.prototype.showNavigator=function(){app.socket.sendMessage("uno .uno:Navigator")};
UIManager.prototype.hideStatusBar=function(firstStart){if(!firstStart&&!this.isStatusBarVisible()
)return;this.documentBottom=$("#document-container").css("bottom");$("#document-container").css(
"bottom","0px");this.map.statusBar.hide();if(!firstStart)this.setDocTypePref("ShowStatusbar",false);
this.map.fire("statusbarchanged")};UIManager.prototype.toggleStatusBar=function(){if(
this.isStatusBarVisible())this.hideStatusBar();else this.showStatusBar()};
UIManager.prototype.focusSearch=function(){var isTextDoc=this.map.isText();if(
isTextDoc&&!app.showNavigator){this.map.navigator.preFocusQuickFind();this.showNavigator()}else if(
!isTextDoc){app.socket.sendMessage("uno .uno:SearchDialog")}this.map.fire("focussearch")};
UIManager.prototype.isStatusBarVisible=function(){var _a,_b;return((_b=(_a=document.getElementById(
"toolbar-down"))===null||_a===void 0?void 0:_a.style)===null||_b===void 0?void 0:_b.display
)!=="none"};UIManager.prototype.onUpdatePermission=function(e){if(window.mode.isMobile()){if(
e.detail.perm==="edit"){history.pushState({context:"app-started"},"edit-mode");$("#toolbar-down"
).show()}else{history.pushState({context:"app-started"},"readonly-mode");$("#toolbar-down").hide()}}
var enableNotebookbar=this.shouldUseNotebookbarMode();if(enableNotebookbar&&!window.mode.isMobile()
){if(e.detail.perm==="edit"){if(this.map.menubar){this.map.removeControl(this.map.menubar);
this.map.menubar=null}this.makeSpaceForNotebookbar()}else if(e.detail.perm==="readonly"){if(
!this.map.menubar){var menubar=new Menubar;this.map.menubar=menubar;this.map.addControl(menubar)}if(
this.notebookbar&&$("#mobile-edit-button").is(":hidden")){this.notebookbar.onRemove()}}else{
app.socket.sendMessage("uno .uno:SidebarHide")}}};UIManager.prototype.refreshTheme=function(){if(
typeof window.initializedUI==="function"){window.initializedUI()}};
UIManager.prototype.onUpdateViews=function(){if(
!this.map._docLayer||typeof this.map._docLayer._viewId==="undefined")return;
var myViewId=this.map._docLayer._viewId;var myViewData=this.map._viewInfo[myViewId];if(!myViewData){
console.error('Not found view data for viewId: "'+myViewId+'"');return}
var userPrivateInfo=myViewData.userprivateinfo;if(window.documentSigningEnabled){if(
userPrivateInfo&&this.getCurrentMode()==="notebookbar"){
var show=userPrivateInfo.SignatureCert&&userPrivateInfo.SignatureKey;this.showButton("signature",
show)}var serverPrivateInfo=myViewData.serverprivateinfo;if(serverPrivateInfo){
var baseUrl=serverPrivateInfo.ESignatureBaseUrl;var clientId=serverPrivateInfo.ESignatureClientId;
if(baseUrl!==undefined&&!this.map.eSignature){this.map.eSignature=new cool.ESignature(baseUrl,
clientId)}}}};UIManager.prototype.enterReadonlyOrClose=function(){if(this.map.isEditMode()){
this.map.setPermission("edit");var toolbar=app.map.topToolbar;if(toolbar){toolbar.selectItem(
"closemobile",false);toolbar.selectItem("close",false)}}else{app.dispatcher.dispatch("closeapp")}};
UIManager.prototype.onGoBack=function(popStateEvent){if(
popStateEvent.state&&popStateEvent.state.context){if(
popStateEvent.state.context==="mobile-wizard"&&this.mobileWizard){if(this.mobileWizard.isOpen()){
this.mobileWizard.goLevelUp(true)}else{this.enterReadonlyOrClose()}}else if(
popStateEvent.state.context==="app-started"){this.enterReadonlyOrClose()}}};
UIManager.prototype.isUIBlocked=function(){return this.blockedUI};
UIManager.prototype.blockUI=function(event){this.blockedUI=true;this.map.fire("showbusy",{
label:event?event.message:null})};UIManager.prototype.unblockUI=function(){this.blockedUI=false;
this.map.fire("hidebusy")};UIManager.prototype._setTooltipText=function(element,text){
var dummyNode=window.L.DomUtil.create("div");dummyNode.innerText=text;element.tooltip("option",
"content",dummyNode.innerHTML)};UIManager.prototype.showDocumentTooltip=function(tooltipInfo){
var split=tooltipInfo.rectangle.split(",");var latlng=this.map._docLayer._twipsToLatLng(
new cool.Point(+split[0],+split[1]));var pt=this.map.latLngToContainerPoint(latlng);var elem=$(
".leaflet-layer");elem.tooltip();elem.tooltip("enable");this._setTooltipText(elem,tooltipInfo.text);
elem.tooltip("option","items",elem[0]);elem.tooltip("option","position",{my:"left bottom",
at:"left+"+pt.x+" top+"+pt.y,collision:"fit fit"});elem.tooltip("open");document.addEventListener(
"mousemove",function(){elem.tooltip("close");elem.tooltip("disable")},{once:true})};
UIManager.prototype.closeSnackbar=function(){JSDialog.SnackbarController.closeSnackbar()};
UIManager.prototype.showSnackbar=function(label,action,callback,timeout,hasProgress,withDismiss){
JSDialog.SnackbarController.showSnackbar(label,action,callback,timeout,hasProgress,withDismiss)};
UIManager.prototype.showProgressBar=function(message,buttonText,callback,timeout,withDismiss,
infinite){JSDialog.SnackbarController.showSnackbar(message,buttonText,callback,timeout?timeout:-1,
true,withDismiss,infinite)};UIManager.prototype.setSnackbarProgress=function(value,infinite){
JSDialog.SnackbarController.setSnackbarProgress(value,infinite)};
UIManager.prototype.showModal=function(json,callbacks,cancelButtonId){var _this=this;
var builderCallback=function(objectType,eventType,object,data){window.app.console.debug(
"modal action: '"+objectType+"' id:'"+object.id+"' event: '"+eventType+"' state: '"+data+"'");
callbacks.push({id:cancelButtonId?cancelButtonId:"response-cancel",func:function(){_this.closeModal(
json.id)}});callbacks.push({id:"__POPOVER__",func:function(){_this.closeModal(json.id)}});for(
var i in callbacks){var callback=callbacks[i];if(object.id===callback.id&&(
!callback.type||eventType===callback.type)){callback.func(objectType,eventType,object,data)}}};
app.socket._onMessage({textMsg:"jsdialog: "+JSON.stringify(json),callback:builderCallback})};
UIManager.prototype.closeModal=function(dialogId){var closeMessage={id:dialogId,jsontype:"dialog",
type:"modalpopup",action:"close"};app.socket._onMessage({textMsg:"jsdialog: "+JSON.stringify(
closeMessage)})};UIManager.prototype.closeAll=function(){if(this.map.jsdialog
)this.map.jsdialog.closeAll();else this.mobileWizard._closeWizard()};
UIManager.prototype.isAnyDialogOpen=function(){if(this.map.jsdialog
)return this.map.jsdialog.hasDialogOpened();else return this.mobileWizard.isOpen()};
UIManager.prototype.generateModalId=function(givenId){return JSDialog.generateModalId(givenId)};
UIManager.prototype._modalDialogJSON=function(id,title,cancellable,widgets,focusId,clickToDismiss){
var dialogId=this.generateModalId(id);focusId=focusId?focusId:"response";return{id:dialogId,
dialogid:id,type:"modalpopup",title:title,hasClose:title!==undefined,hasOverlay:true,
cancellable:cancellable,jsontype:"dialog",init_focus_id:focusId,clickToDismiss:clickToDismiss,
children:[{id:"info-modal-container",type:"container",vertical:true,children:widgets}]}};
UIManager.prototype.showInfoModal=function(id,title,message1,message2,buttonText,callback,withCancel
,focusId){var _this=this;var dialogId=this.generateModalId(id);var responseButtonId=id+"-response";
var cancelButtonId=id+"-cancel";var clickToDismiss=arguments.length<2;
var json=this._modalDialogJSON(id,title,true,[{id:"info-modal-tile-m",type:"fixedtext",text:title,
hidden:!window.mode.isMobile()},{id:"info-modal-label1",type:"fixedtext",text:message1},{
id:"info-modal-label2",type:"fixedtext",text:message2},{id:"",type:"buttonbox",text:"",enabled:true,
children:[withCancel?{id:cancelButtonId,type:"pushbutton",text:_("Cancel")}:{type:"container"},{
id:responseButtonId,type:"pushbutton",text:buttonText,has_default:true,hidden:buttonText?false:true}
],vertical:false,layoutstyle:"end"}],focusId,clickToDismiss);this.showModal(json,[{
id:responseButtonId,func:function(){var dontClose=false;if(typeof callback==="function"
)dontClose=callback();if(!dontClose)_this.closeModal(dialogId)}}],cancelButtonId);if(
!buttonText&&!withCancel){var dialogElement=document.getElementById(dialogId);if(dialogElement!=null
){dialogElement.tabIndex=-1;dialogElement.focus();dialogElement.className+=" focus-hidden"}}};
UIManager.prototype.showProgressBarDialog=function(id,title,message,buttonText,callback,value,
cancelCallback,infinite){var _this=this;if(infinite===void 0){infinite=false}
var dialogId=this.generateModalId(id);var responseButtonId=id+"-response";
var cancelButtonId=id+"-cancel";var json=this._modalDialogJSON(id,title,true,[{
id:"info-modal-tile-m",type:"fixedtext",text:title,hidden:!window.mode.isMobile()},{
id:"info-modal-label1",type:"fixedtext",text:message},{id:dialogId+"-progressbar",
type:"progressbar",value:value!==undefined&&value!==null?value:0,maxValue:100,infinite:infinite},{
id:"",type:"buttonbox",text:"",enabled:true,children:[{id:cancelButtonId,type:"pushbutton",text:_(
"Cancel")},{id:responseButtonId,type:"pushbutton",text:buttonText,has_default:true,
hidden:buttonText?false:true}],vertical:false,layoutstyle:"end"}],
buttonText?responseButtonId:cancelButtonId);this.showModal(json,[{id:responseButtonId,func:function(
){var dontClose=false;if(typeof callback==="function")dontClose=callback();if(!dontClose
)_this.closeModal(dialogId)}},{id:cancelButtonId,func:function(){if(
typeof cancelCallback==="function")cancelCallback()}}],cancelButtonId)};
UIManager.prototype.setDialogProgress=function(id,value,infinite){if(!app.socket)return;
var dialogId=this.generateModalId(id);var json={id:dialogId,jsontype:"dialog",type:"modalpopup",
action:"update",control:{id:dialogId+"-progressbar",type:"progressbar",value:value,maxValue:100,
infinite:infinite}};app.socket._onMessage({textMsg:"jsdialog: "+JSON.stringify(json)})};
UIManager.prototype.showModalWithCustomButtons=function(id,title,message,cancellable,
buttonObjectList,callbackList){var _this=this;var dialogId=this.generateModalId(id);for(
var i=0;i<buttonObjectList.length;i++)buttonObjectList[i].type="pushbutton";
var json=this._modalDialogJSON(id,title,!!cancellable,[{id:"info-modal-tile-m",type:"fixedtext",
text:title,hidden:!window.mode.isMobile()},{id:"info-modal-label1",type:"fixedtext",text:message},{
id:"",type:"buttonbox",text:"",enabled:true,children:buttonObjectList,vertical:false,
layoutstyle:"end"}]);buttonObjectList.forEach(function(button){callbackList.forEach(function(
callback){if(button.id===callback.id){if(typeof callback.func_==="function"){callback.func=function(
){callback.func_();_this.closeModal(dialogId)}}else callback.func=function(){_this.closeModal(
dialogId)}}})});this.showModal(json,callbackList)};UIManager.prototype.showInputModal=function(id,
title,message,defaultValue,buttonText,callback,passwordInput){var _this=this;
var dialogId=this.generateModalId(id);var json=this._modalDialogJSON(id,title,
!window.mode.isDesktop(),[{id:"info-modal-label1",type:"fixedtext",text:message,
labelFor:"input-modal"},{id:"input-modal",type:"edit",password:!!passwordInput,text:defaultValue,
labelledBy:"info-modal-label1"},{id:"",type:"buttonbox",text:"",enabled:true,children:[{
id:"response-cancel",type:"pushbutton",text:_("Cancel")},{id:"response-ok",type:"pushbutton",
text:buttonText,has_default:true}],vertical:false,layoutstyle:"end"}],"input-modal-input");
this.showModal(json,[{id:"response-ok",func:function(){if(typeof callback==="function"){
var input=document.getElementById("input-modal-input");callback(input.value)}_this.closeModal(
dialogId)}}])};UIManager.prototype.showInfoBar=function(e){var message=e.msg;var link=e.action;
var linkText=e.actionLabel;var id="infobar"+Math.round(Math.random()*10);
var dialogId=this.generateModalId(id);var json=this._modalDialogJSON(id," ",!window.mode.isDesktop()
,[{id:dialogId+"-text",type:"fixedtext",text:message},{id:"",type:"buttonbox",text:"",enabled:true,
children:[{id:dialogId+"-response",type:"pushbutton",text:_(linkText),has_default:true}],
vertical:false,layoutstyle:"end"}]);this.showModal(json,[{id:dialogId+"-response",func:function(){
if(!link||!linkText)return;var win=window.open(window.sanitizeUrl(link),"_blank");
win===null||win===void 0?void 0:win.focus()}}]);if(!window.mode.isMobile()){
var dialogElement=document.getElementById(dialogId);if(dialogElement!=null){
dialogElement.style.marginRight="0";dialogElement.style.marginBottom="0"}}};
UIManager.prototype.showYesNoButton=function(id,title,message,yesButtonText,noButtonText,yesFunction
,noFunction,cancellable){var _this=this;var dialogId=this.generateModalId(id);
var json=this._modalDialogJSON(id,title,cancellable,[{id:dialogId+"-title",type:"fixedtext",
text:title,hidden:!window.mode.isMobile()},{id:dialogId+"-label",type:"fixedtext",text:message},{
id:"",type:"buttonbox",text:"",enabled:true,children:[noButtonText?{id:dialogId+"-nobutton",
type:"pushbutton",text:noButtonText}:{type:"container"},{id:dialogId+"-yesbutton",type:"pushbutton",
text:yesButtonText}],vertical:false,layoutstyle:"end"}]);this.showModal(json,[{
id:dialogId+"-nobutton",func:function(){if(typeof noFunction==="function")noFunction();
_this.closeModal(dialogId)}},{id:dialogId+"-yesbutton",func:function(){if(
typeof yesFunction==="function")yesFunction();_this.closeModal(dialogId)}}])};
UIManager.prototype.showConfirmModal=function(id,title,message,buttonText,callback,hideCancelButton
){var _this=this;var dialogId=this.generateModalId(id);var json=this._modalDialogJSON(id,title,
!window.mode.isDesktop(),[{id:"info-modal-label1",type:"fixedtext",text:message},{id:"",
type:"buttonbox",text:"",enabled:true,children:[{id:"response-cancel",type:"pushbutton",text:_(
"Cancel"),hidden:hideCancelButton===true?true:false},{id:"response-ok",type:"pushbutton",
text:buttonText,has_default:true}],vertical:false,layoutstyle:"end"}]);this.showModal(json,[{
id:"response-ok",func:function(){if(typeof callback==="function"){callback()}_this.closeModal(
dialogId)}}])};UIManager.prototype.moveObjectVertically=function(obj,diff){if(obj){
var prevTop=obj.css("top");if(prevTop){prevTop=parseInt(prevTop.slice(0,-2))+diff+"px"}else{
prevTop=diff+"px"}obj.css({top:prevTop})}};UIManager.prototype.setDocTypePref=function(name,value){
var docType=this.map.getDocType();return window.prefs.set(docType+"."+name,value)};
UIManager.prototype.setDocTypeMultiplePrefs=function(prefs){var e_2,_a;
var docType=this.map.getDocType();var deckPrefs={};try{for(var _b=__values(Object.entries(prefs)),
_c=_b.next();!_c.done;_c=_b.next()){var _d=__read(_c.value,2),key=_d[0],value=_d[1];deckPrefs[
docType+"."+key]=value}}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return)
)_a.call(_b)}finally{if(e_2)throw e_2.error}}window.prefs.setMultiple(deckPrefs)};
UIManager.prototype.getBooleanDocTypePref=function(name,defaultValue){if(defaultValue===void 0){
defaultValue=false}var docType=this.map.getDocType();return window.prefs.getBoolean(docType+"."+name
,defaultValue)};return UIManager}(window.L.Control);
window.L.Control.DocumentNameInput=window.L.Control.extend({onAdd:function(map){this.map=map;if(
window.mode.isMobile())this.progressBar=document.getElementById("mobile-progress-bar"
);else this.progressBar=document.getElementById("document-name-input-progress-bar");map.on(
"doclayerinit",this.onDocLayerInit,this);map.on("wopiprops",this.onWopiProps,this)},
documentNameConfirm:function(value){if(value!==null&&value!=""&&value!=this.map["wopi"].BaseFileName
){this._renaming=true;if(this.map["wopi"].UserCanRename&&this.map["wopi"].SupportsRename){if(
value.lastIndexOf(".")>0){var fname=this.map["wopi"].BaseFileName;var ext=fname.substr(
fname.lastIndexOf(".")+1,fname.length);if(ext!=value.substr(value.lastIndexOf(".")+1,value.length)){
this.map.saveAs(value)}else{value=value.substr(0,value.lastIndexOf("."));this.map.renameFile(value)}
}else{this.map.renameFile(value)}}else{this.map.saveAs(value)}}this.map._onGotFocus()},
documentNameCancel:function(){if(this._renaming)return;$("#document-name-input").val(this.map["wopi"
].BreadcrumbDocName);this.map._onGotFocus()},disableDocumentNameInput:function(){$(
"#document-name-input").prop("disabled",true);$("#document-name-input").removeClass("editable");$(
"#document-name-input").off("keypress",this.onDocumentNameKeyPress)},
enableDocumentNameInput:function(){$("#document-name-input").prop("disabled",false);$(
"#document-name-input").addClass("editable");$("#document-name-input").off("keypress",
this.onDocumentNameKeyPress).on("keypress",this.onDocumentNameKeyPress.bind(this));$(
"#document-name-input").off("focus",this.onDocumentNameFocus).on("focus",
this.onDocumentNameFocus.bind(this));$("#document-name-input").off("blur",this.documentNameCancel
).on("blur",this.documentNameCancel.bind(this))},onDocumentNameKeyPress:function(e){if(
e.keyCode===13){var value=$("#document-name-input").val();this.documentNameConfirm(value)}else if(
e.keyCode===27){this.documentNameCancel()}},onDocumentNameFocus:function(){delete this._renaming;
this.map._onLostFocus();var name=this.map["wopi"].BaseFileName;var extn=name.lastIndexOf(".");if(
extn<0)extn=name.length;$("#document-name-input").val(name);$("#document-name-input")[0
].setSelectionRange(0,extn)},onDocLayerInit:function(){var el=$("#document-name-input");try{
var fileNameFullPath=new URL(new URLSearchParams(window.location.search).get("WOPISrc")
).pathname.replace("/wopi/files","");var basePath=fileNameFullPath.replace(this.map["wopi"
].BaseFileName,"").replace(/\/$/,"");var title=this.map["wopi"].BaseFileName+"\n"+_("Path"
)+": "+basePath;el.prop("title",title)}catch(e){}if(window.ThisIsTheAndroidApp){el.hide()}else{
el.show()}if(window.ThisIsAMobileApp){el.prop("disabled",false);el.removeClass("editable");el.focus(
function(){$(this).blur()});el.val(decodeURIComponent(decodeURIComponent(
this.map.options.doc.replace(/.*\//,""))))}if(this.map.isReadOnlyMode()){
this.disableDocumentNameInput()}},onWopiProps:function(e){if(e.BaseFileName!==null){$(
"#document-name-input").val(e.BreadcrumbDocName!==undefined?e.BreadcrumbDocName:e.BaseFileName);
var input=window.L.DomUtil.get("document-name-input");input.setAttribute("data-cooltip",input.value)
window.L.control.attachTooltipEventListener(input,this.map)}if(
!e.UserCanNotWriteRelative&&!this.map.isReadOnlyMode()){this.enableDocumentNameInput()}else{
this.disableDocumentNameInput()}},showProgressBar:function(){this.disableDocumentNameInput();
this.progressBar.style.display="block"},hideProgressBar:function(){this.enableDocumentNameInput();
this.progressBar.style.display="none"},setProgressBarValue:function(value){
this.progressBar.value=value},showLoadingAnimation:function(){this.disableDocumentNameInput();$(
"#document-name-input-loading-bar").css("display","block")},hideLoadingAnimation:function(){
this.enableDocumentNameInput();$("#document-name-input-loading-bar").css("display","none")},
_getMaxAvailableWidth:function(){var x=$("#document-titlebar").prop("offsetLeft")+$(
".document-title").prop("offsetLeft")+$("#document-name-input").prop("offsetLeft");
var containerWidth=parseInt($(".main-nav").css("width"));var maxWidth=Math.max(containerWidth-x-30,0
);maxWidth=Math.max(maxWidth,300);return maxWidth}});window.L.control.documentNameInput=function(){
return new window.L.Control.DocumentNameInput};var ImpressTransitionTab=function(){
function ImpressTransitionTab(){}ImpressTransitionTab.prototype.getName=function(){
return"Transition"};ImpressTransitionTab.prototype.getEntry=function(){return{
id:"Transition-tab-label",text:_("Transition"),name:this.getName(),accessibility:{focusBack:false,
combination:"A",de:null}}};ImpressTransitionTab.prototype.getContent=function(){var content=[{
id:"transitions-group",type:"overflowgroup",nofold:true,name:_("Transitions"),children:[{
id:"transitions_icons",type:"iconview"}]},{id:"transitions-icons-separator",type:"separator",
orientation:"vertical"},{id:"transition-modify-group",type:"grid",rows:2,cols:2,children:[{
id:"variant_label",type:"fixedtext",text:_("Variant"),top:"0",left:"0"},{id:"variant_list",
type:"listbox",text:"",entries:[],top:"0",left:"1"},{id:"duration_label",type:"fixedtext",text:_(
"Duration"),top:"1",left:"0"},{id:"transition_duration",type:"spinfield",text:"",top:"1",left:"1"}]}
,{id:"transition-modify-separator",type:"separator",orientation:"vertical"},{
id:"Transition-advance-group",type:"grid",rows:2,cols:2,children:[{id:"rb_mouse_click",
type:"radiobutton",text:_("On mouse click"),top:"0",left:"0",width:"2"},{id:"rb_auto_after",
type:"radiobutton",text:_("After"),top:"1",left:"0"},{id:"auto_after_value",type:"spinfield",
text:"",top:"1",left:"1"}]},{id:"transition-advance-separator",type:"separator",
orientation:"vertical"}];return content};return ImpressTransitionTab}();
JSDialog.ImpressTransitionTab=new ImpressTransitionTab;var WriterReferencesTab=function(){
function WriterReferencesTab(){}WriterReferencesTab.prototype.getName=function(){return"References"}
WriterReferencesTab.prototype.getEntry=function(){return{id:this.getName()+"-tab-label",text:_(
"References"),name:this.getName(),accessibility:{focusBack:true,combination:"S",de:"C"}}};
WriterReferencesTab.prototype.getContent=function(){var content=[{type:"overflowgroup",
id:"Reference-TOC",name:_("Table of content"),accessibility:{focusBack:false,combination:"T",de:"LA"
},children:[{id:"references-insert-multi-index",type:"bigtoolitem",text:_UNO(".uno:IndexesMenu",
"text"),command:".uno:InsertMultiIndex",accessibility:{focusBack:false,combination:"T",de:"LA"}},{
type:"container",children:[{type:"toolbox",children:[{id:"references-insert-indexes-entry",
type:"toolitem",text:_UNO(".uno:InsertIndexesEntry","text"),command:".uno:InsertIndexesEntry",
accessibility:{focusBack:false,combination:"IE"}}]},{type:"toolbox",children:[{
id:"references-update-current-index",type:"toolitem",text:_("Update Index"),
command:".uno:UpdateCurIndex",accessibility:{focusBack:false,combination:"UI",de:"T"}}]}],
vertical:"true"}]},{type:"separator",id:"references-updatecurindex-break",orientation:"vertical"},{
type:"overflowgroup",id:"reference-footnote",name:_("Footnote/Endnote"),accessibility:{
focusBack:false,combination:"F",de:"U"},children:[{id:"references-insert-foot-note",
type:"bigtoolitem",text:_UNO(".uno:InsertFootnote","text"),command:".uno:InsertFootnote",
accessibility:{focusBack:true,combination:"F",de:"U"}},{type:"container",children:[{type:"toolbox",
children:[{id:"references-insert-end-note",type:"toolitem",text:_UNO(".uno:InsertEndnote","text"),
command:".uno:InsertEndnote",accessibility:{focusBack:true,combination:"E",de:"E"}}]},{
type:"toolbox",children:[{id:"references-foot-note-dialog",type:"toolitem",text:_UNO(
".uno:FootnoteDialog","text"),command:".uno:FootnoteDialog",accessibility:{focusBack:false,
combination:"H",de:"I"}}]}],vertical:"true"}]},{type:"separator",
id:"references-footnotedialog-break",orientation:"vertical"},{type:"container",children:[{
type:"toolbox",children:[{id:"references-insert-bookmark",type:"toolitem",text:_UNO(
".uno:InsertBookmark","text"),command:".uno:InsertBookmark",accessibility:{focusBack:false,
combination:"IB",de:null}}]},{type:"toolbox",children:[{id:"references-insert-reference-field",
type:"toolitem",text:_UNO(".uno:InsertReferenceField","text"),command:".uno:InsertReferenceField",
accessibility:{focusBack:false,combination:"IR",de:null}}]}],vertical:"true"},{type:"separator",
id:"references-insertreferencefield-break",orientation:"vertical"}];content=content.concat([{
id:"zoteroaddeditbibliography",class:"unozoteroaddeditbibliography",type:"bigcustomtoolitem",text:_(
"Add Bibliography"),command:"zoteroaddeditbibliography",visible:!!app.map.zotero,accessibility:{
focusBack:true,combination:"AB",de:null}},{id:"zoterocontaineradd",visible:!!app.map.zotero,
type:"container",children:[{type:"toolbox",children:[{id:"zoteroAddEditCitation",
class:"unozoteroAddEditCitation",type:"customtoolitem",text:_("Add Citation"),
command:"zoteroaddeditcitation",accessibility:{focusBack:true,combination:"AC",de:null}}]},{
type:"toolbox",children:[{id:"zoteroaddnote",class:"unozoteroaddnote",type:"customtoolitem",text:_(
"Add Citation Note"),command:"zoteroaddnote",accessibility:{focusBack:true,combination:"CN",de:null}
}]}],vertical:"true"},{id:"zoterocontainerrefresh",visible:!!app.map.zotero,type:"container",
children:[{type:"toolbox",children:[{id:"zoterorefresh",class:"unozoterorefresh",
type:"customtoolitem",text:_("Refresh Citations"),command:"zoterorefresh",accessibility:{
focusBack:true,combination:"RC",de:null}}]},{type:"toolbox",children:[{id:"zoterounlink",
class:"unozoterounlink",type:"customtoolitem",text:_("Unlink Citations"),command:"zoterounlink",
accessibility:{focusBack:true,combination:"UC",de:null}}]}],vertical:"true"},{
id:"zoteroSetDocPrefs",class:"unozoteroSetDocPrefs",type:"bigcustomtoolitem",text:_(
"Citation Preferences"),command:"zoterosetdocprefs",visible:!!app.map.zotero,accessibility:{
focusBack:true,combination:"CP",de:null}},{type:"separator",id:"references-zoterosetdocprefs-break",
visible:!!app.map.zotero}]);content=content.concat([{type:"overflowgroup",id:"reference-field",
name:_("Field"),accessibility:{focusBack:false,combination:"IF",de:null},children:[{
id:"references-insert-field-control",type:"bigtoolitem",text:_UNO(".uno:InsertFieldCtrl","text"),
command:".uno:InsertFieldCtrl",accessibility:{focusBack:false,combination:"IF",de:null}},{
type:"container",children:[{type:"toolbox",children:[{id:"references-inset-page-number-field",
type:"toolitem",text:_UNO(".uno:InsertPageNumberField"),command:".uno:InsertPageNumberField",
accessibility:{focusBack:true,combination:"PN",de:null}},{id:"references-insert-page-count-field",
type:"toolitem",text:_UNO(".uno:InsertPageCountField","text"),command:".uno:InsertPageCountField",
accessibility:{focusBack:true,combination:"PC",de:null}}]},{type:"toolbox",children:[{
id:"references-insert-date-field",type:"toolitem",text:_UNO(".uno:InsertDateField","text"),
command:".uno:InsertDateField",accessibility:{focusBack:true,combination:"ID",de:null}},{
id:"references-insert-title-field",type:"toolitem",text:_UNO(".uno:InsertTitleField","text"),
command:".uno:InsertTitleField",accessibility:{focusBack:true,combination:"IT",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"references-inserttitlefield-break",orientation:"vertical"},
{id:"references-update-all",type:"bigtoolitem",text:_UNO(".uno:UpdateAll","text"),
command:".uno:UpdateAll",accessibility:{focusBack:true,combination:"UA"}}]);return content};
return WriterReferencesTab}();JSDialog.WriterReferencesTab=new WriterReferencesTab;
window.L.Control.Notebookbar=window.L.Control.extend({_showNotebookbar:false,_RTL:false,
_lastContext:null,_lastSelectedTabName:null,container:null,builder:null,model:null,
HOME_TAB_ID:"Home-tab-label",FORMULAS_TAB_ID:"Formula-tab-label",additionalShortcutButtons:[],
hiddenItems:[],setBuilder:function(builder,model){this.builder=builder;this.model=model},
onAdd:function(map){this.map=map;this.additionalShortcutButtons=[];if(this.model.getSnapshot(
)===null)this.model.fullUpdate(this.getFullJSON(this.HOME_TAB_ID));this.map.on("notebookbar",
this.onNotebookbar,this)},create:function(container){var docType=this._map.getDocType();if(
document.documentElement.dir==="rtl")this._RTL=true;this.container=container;this.loadTab();
this.onContextChange=this.onContextChange.bind(this);app.events.on("contextchange",
this.onContextChange);app.events.on("updatepermission",this.onUpdatePermission.bind(this));
this.map.on("statusbarchanged",this.onStatusbarChange,this);this.map.on("rulerchanged",
this.onRulerChange,this);this.map.on("darkmodechanged",this.onDarkModeToggleChange,this);
this.map.on("showannotationschanged",this.onShowAnnotationsChange,this);this.map.on(
"a11ystatechanged",this.onAccessibilityToggleChange,this);if(docType==="presentation"){this.map.on(
"updateparts",this.onSlideHideToggle,this);this.map.on("toggleslidehide",this.onSlideHideToggle,this
)}$("#toolbar-wrapper").addClass("hasnotebookbar");$(".main-nav").addClass("hasnotebookbar");
this.floatingNavIcon=document.querySelector(".navigator-btn-wrapper");if(this.floatingNavIcon
)this.floatingNavIcon.classList.add("hasnotebookbar");document.getElementById("document-container"
).classList.add("notebookbar-active");var docLogoHeader=window.L.DomUtil.create("div","");
docLogoHeader.id="document-header";var iconClass="document-logo";var iconTooltip;if(docType==="text"
){iconClass+=" writer-icon-img";iconTooltip="Writer"}else if(docType==="spreadsheet"){
iconClass+=" calc-icon-img";iconTooltip="Calc"}else if(docType==="presentation"){
iconClass+=" impress-icon-img";iconTooltip="Impress"}else if(docType==="drawing"){
iconClass+=" draw-icon-img";iconTooltip="Draw"}var docLogo=window.L.DomUtil.create("div",iconClass,
docLogoHeader);$(docLogo).data("id","document-logo");$(docLogo).data("type","action");
docLogo.setAttribute("data-cooltip",iconTooltip);window.L.control.attachTooltipEventListener(docLogo
,this.map);$(".main-nav").prepend(docLogoHeader);var isDarkMode=window.prefs.getBoolean("darkTheme")
if(!isDarkMode)$("#invertbackground").hide();if(!this.map.serverAuditDialog){this.hideItem(
"server-audit");this.hideItem("help-serveraudit-break")}},onRemove:function(){app.events.off(
"contextchange",this.onContextChange);$(".main-nav #document-header").remove();$(".main-nav"
).removeClass("hasnotebookbar");$("#toolbar-wrapper").removeClass("hasnotebookbar");if(
this.floatingNavIcon)this.floatingNavIcon.classList.remove("hasnotebookbar");$(
".main-nav #document-header").remove();this.clearNotebookbar();$(this.container).remove()},
onUpdatePermission:function(e){if(e.detail.perm==="edit"){this._showNotebookbar=true;this.showTabs()
$(".main-nav").removeClass("readonly")}else{this.hideTabs()}},onNotebookbar:function(data){
this.setInitialized(true);this.builder.setWindowId(data.id)},setInitialized:function(initialized){
if(this._isNotebookbarLoadedOnCore===initialized)return;this._isNotebookbarLoadedOnCore=initialized;
app.console.debug("Notebookbar: set initialized: "+initialized);if(this.container){if(initialized
)this.container.classList.add("initialized");else this.container.classList.remove("initialized")}if(
initialized){app.serverConnectionService.onNotebookbarInCoreInit()}},showTabs:function(){$(
".ui-tabs.notebookbar").show();$(".notebookbar-shortcuts-bar").show();this.extend();$(window
).resize()},hideTabs:function(){$(".ui-tabs.notebookbar").hide();$(".notebookbar-shortcuts-bar"
).hide();$(".main-nav").addClass("readonly");this.collapse()},collapse:function(){if(
this._showNotebookbar!==false)this.map.uiManager.collapseNotebookbar()},extend:function(){if(
this._showNotebookbar!==false)this.map.uiManager.extendNotebookbar()},isCollapsed:function(){
return this.map.uiManager.isNotebookbarCollapsed()},clearNotebookbar:function(){$(
".root-container.notebookbar").remove();$(".notebookbar-tabs-container").remove();$(
".notebookbar-shortcuts-bar").remove()},loadTab:function(){app.console.debug("Notebookbar: loadTab")
this.clearNotebookbar();this.builder.build(this.container,[this.model.getSnapshot()]);if(
this._showNotebookbar===false)this.hideTabs();if(window.mode.isDesktop()||window.mode.isTablet()
)this.createOptionsSection();JSDialog.RefreshScrollables()},setTabs:function(tabs){
var container=window.L.DomUtil.create("div","notebookbar-tabs-container");container.appendChild(tabs
);for(let tab of tabs.children){if(tab.id.endsWith("-tab-label")){let name=tab.id.substring(0,
tab.id.length-10);if(!this.map.uiManager.isTabVisible(name)){$(tab).hide()}}}$("#document-titlebar"
).before(container);this.createShortcutsBar()},selectedTab:function(tabName){
this._lastSelectedTabName=tabName},isTabSelected:function(tabName){
return this._lastSelectedTabName===tabName},getTabs:function(){return[]},getTabsJSON:function(){
return[]},getShortcutsBarData:function(){var hasSave=!this._map["wopi"].HideSaveOption;return[{
id:"shortcutstoolbox",type:"toolbox",children:[hasSave?{id:"save",type:"toolitem",text:_("Save"),
command:".uno:Save",accessKey:"1",isCustomTooltip:true}:{}]}]},createShortcutsBar:function(){
var shortcutsBar=window.L.DomUtil.create("div","notebookbar-shortcuts-bar");$("#main-menu-state"
).after(shortcutsBar);var shortcutsBarData=this.getShortcutsBarData();
var toolitems=shortcutsBarData[0].children;for(var i in this.additionalShortcutButtons){
var item=this.additionalShortcutButtons[i];toolitems.push(item)}for(var j in toolitems){
item=toolitems[j];var hidden=false;var commands=this.map._extractCommand(item);commands.forEach(
function(command){if(!this.map.uiManager.isCommandVisible(command)){toolitems.splice(j,1);
hidden=true}}.bind(this));if(hidden){break}if(!this.map.uiManager.isButtonVisible(item.id)){
toolitems.splice(j,1);break}}this.builder.build(shortcutsBar,shortcutsBarData);
this.map.saveState=new app.definitions.saveState(this.map)},reloadShortcutsBar:function(){if(
!document.querySelector(".notebookbar-shortcuts-bar"))return;
app.layoutingService.appendLayoutingTask(()=>{$(".notebookbar-shortcuts-bar").remove();
this.createShortcutsBar()})},insertButtonToShortcuts:function(button){for(
var i in this.additionalShortcutButtons){var item=this.additionalShortcutButtons[i];if(
item.id===button.id)return}var isUnoCommand=button.unoCommand&&button.unoCommand.indexOf(".uno:")>=0
if(button.unoCommand&&!isUnoCommand)button.unoCommand=".uno:"+button.unoCommand;
this.additionalShortcutButtons.push({id:button.id,type:"toolitem",
text:button.label?button.label:button.hint?_(button.hint):" ",icon:button.imgurl,
command:button.unoCommand,accessKey:button.accessKey?button.accessKey:null,
postmessage:button.unoCommand?undefined:true,cssClass:"integrator-shortcut"});
this.reloadShortcutsBar()},showNotebookbarButton:function(buttonId,show){var button=$(this.container
).find("#"+buttonId);if(button){if(show){button.show()}else{button.hide()}return true}else{
return false}},showNotebookbarCommand:function(commandId,show){var cssClass;if(commandId.indexOf(
".uno:")==0){cssClass="uno"+commandId.substring(5)}else{cssClass=commandId}var button=$(
this.container).find("div."+cssClass);if(button){if(show){button.show()}else{button.hide()}
return true}return false},shouldIgnoreContextChange(contexts,appId){let ignored=[["NotesPage",
"DrawPage"],["DrawPage","NotesPage"]];if(appId==="com.sun.star.text.TextDocument"){ignored.push([
"Text",""])}for(let i=0;i<ignored.length;i++){if(contexts[0]===ignored[i][0]&&contexts[1]===ignored[
i][1])return true}return false},refreshContextTabsVisibility:function(){
this.updateTabsVisibilityForContext(this._lastContext)},updateButtonVisibilityForContext:function(
context,tabId){const tabsJSON=this.getTabsJSON();const splitTabId=tabId.split("-");if(
splitTabId.length!==3)return;const tabName=splitTabId[0];const toShow=[];const toHide=[];
tabsJSON.forEach(tabContent=>{if(!tabContent||!tabContent.children[0]||!tabContent.children[0
].children)return;const tabPageId=tabContent.children[0].id;const tabPageName=tabPageId.split("-")[0
];if(tabPageName!==tabName)return;const children=tabContent.children[0].children;
const requiredContext=context||"default";children.forEach(item=>{if(!item.context)return;if(
item.context.indexOf(requiredContext)>=0){toShow.push(item.command.replace(".uno:",""))}else{
toHide.push(item.command.replace(".uno:",""))}})});toHide.forEach(item=>{this.showButton(item,false)
});toShow.forEach(item=>{this.showButton(item,true)})},showButton:function(id,show){if(!id)return;
this.builder.executeAction(this.container,{id:this.builder.windowId,action:"action",
jsontype:"notebookbar",data:{control_id:id,action_type:show?"show":"hide"}});
JSDialog.RefreshScrollables()},updateTabsVisibilityForContext:function(requestedContext){
var tabs=this.getTabs();var contextTab=null;var defaultTab=null;let alreadySelected=null;
let currentlySelectedTabName=null;for(var tab in tabs){var tabElement=$("#"+tabs[tab
].name+"-tab-label");if(tabElement.hasClass("selected")){currentlySelectedTabName=tabs[tab].name}if(
tabs[tab].context){tabElement.hide();var contexts=tabs[tab].context.split("|");for(
var context in contexts){if(!this.map.uiManager.isTabVisible(tabs[tab].name)){continue}if(contexts[
context]===requestedContext){tabElement.show();tabElement.removeClass("hidden");if(
!tabElement.hasClass("selected"))contextTab=tabElement;else alreadySelected=tabElement}else if(
contexts[context]==="default"){tabElement.show();if(!tabElement.hasClass("selected")
)defaultTab=tabElement}}}else if(!this.map.uiManager.isTabVisible(tabs[tab].name)){tabElement.hide()
}else{tabElement.show()}}if(alreadySelected){const tabId=alreadySelected.attr("id");
this.updateButtonVisibilityForContext(requestedContext,tabId);return}
const docType=this._map.getDocType();if(docType==="spreadsheet"&&this.isTabSelected("Formulas")){
this.updateButtonVisibilityForContext(requestedContext,this.FORMULAS_TAB_ID);return}if(contextTab){
if(docType!=="text"||currentlySelectedTabName!=="Review"){contextTab.click()}
const tabId=contextTab.attr("id");this.updateButtonVisibilityForContext(requestedContext,tabId);
return}if(defaultTab){defaultTab.click();const tabId=defaultTab.attr("id");
this.updateButtonVisibilityForContext(requestedContext,tabId);return}},onContextChange:function(
event){const detail=event.detail;if(detail.appId!==detail.oldAppId){var childrenArray=undefined;if(
detail.appId==="com.sun.star.formula.FormulaProperties"){childrenArray=[{type:"toolitem",text:_UNO(
".uno:SidebarDeck.ElementsDeck","",true),command:".uno:SidebarDeck.ElementsDeck"}]}
this.createOptionsSection(childrenArray)}if(detail.context===detail.oldContext)return;if(
this.shouldIgnoreContextChange([detail.context,detail.oldContext],detail.appId))return;
this.updateTabsVisibilityForContext(detail.context);this._lastContext=detail.context},
onSlideHideToggle:function(){if(!app.impress.isSlideHidden(this.map.getCurrentPartNumber()))$(
"#showslide").hide();else $("#showslide").show();if(app.impress.isSlideHidden(
this.map.getCurrentPartNumber()))$("#hideslide").hide();else $("#hideslide").show()},
onStatusbarChange:function(){if(this.map.uiManager.isStatusBarVisible()){$("#showstatusbar"
).addClass("selected")}else{$("#showstatusbar").removeClass("selected")}},onRulerChange:function(){
if(this.map.uiManager.isRulerVisible()){$("#showruler").addClass("selected")}else{$("#showruler"
).removeClass("selected")}},onDarkModeToggleChange:function(){if(window.prefs.getBoolean("darkTheme"
)){$("#invertbackground").show()}else{$("#invertbackground").hide()}},
onShowAnnotationsChange:function(e){if(e.state==="true"){$("#review-show-resolved-annotations"
).removeClass("disabled");$("#review-show-resolved-annotations").attr("disabled",false);$(
"#review-show-resolved-annotations-button").attr("disabled",false)}else{$(
"#review-show-resolved-annotations").addClass("disabled");$("#review-show-resolved-annotations"
).attr("disabled",true);$("#review-show-resolved-annotations-button").attr("disabled",true)}},
onAccessibilityToggleChange:function(){if(window.prefs.getBoolean("accessibilityState")){$(
"#togglea11ystate").addClass("selected")}else{$("#togglea11ystate").removeClass("selected")}if(
this._map&&this._map._lockAccessibilityOn){$("#togglea11ystate").addClass("disabled");$(
"#togglea11ystate").attr("disabled",true);$("#togglea11ystate-button").attr("disabled",true)}},
buildOptionsSectionData:function(childrenArray){return[{id:"optionscontainer",type:"container",
children:[{id:"optionstoolboxdown",type:"toolbox",children:childrenArray}]}]},
getOptionsSectionData:function(){return this.buildOptionsSectionData(this.getDefaultToolItems())},
getDefaultToolItems:function(){const optionsToolItems=[{type:"toolitem",text:_UNO(".uno:Sidebar","",
true),command:".uno:SidebarDeck.PropertyDeck",accessibility:{focusBack:false,combination:"ZB",
de:null},useInLineLabelsForUnoButtons:false}];if(this._map&&this._map["wopi"].EnableShare){
optionsToolItems.push({type:"customtoolitem",text:_("Share"),command:"shareas",inlineLabel:true,
accessibility:{focusBack:false,combination:"ZS",de:null}})}return optionsToolItems},
createOptionsSection:function(childrenArray){$(".notebookbar-options-section").remove();
var optionsSection=window.L.DomUtil.create("div","notebookbar-options-section");$(optionsSection
).insertBefore("#closebuttonwrapperseparator");var builderOptions={mobileWizard:this,map:this.map,
cssClass:"notebookbar",suffix:"notebookbar"};var builder=new window.L.control.notebookbarBuilder(
builderOptions);if(childrenArray===undefined)childrenArray=this.getOptionsSectionData();
builder.build(optionsSection,childrenArray)},hideItem:function(itemId){app.console.debug(
"Notebookbar: hide item: "+itemId);if(!this.hiddenItems.includes(itemId)){this.hiddenItems.push(
itemId);this.showItemImpl(itemId,false)}},showItem:function(itemId){app.console.debug(
"Notebookbar: show item: "+itemId);if(this.hiddenItems.includes(itemId)){this.hiddenItems.splice(
this.hiddenItems.indexOf(itemId),1);this.showItemImpl(itemId,true)}},showItemImpl:function(itemId,
show){app.map.fire("jsdialogaction",{data:{jsontype:"notebookbar",action:"action",data:{
control_id:itemId,action_type:show?"show":"hide"}}})}});var fileTabName="File";
var homeTabName="Home";var insertTabName="Insert";var layoutTabName="Layout";
var reviewTabName="Review";var formatTabName="Format";var formTabName="Form";
var tableTabName="Table";var shapeTabName="Shape";var pictureTabName="Picture";
var viewTabName="View";var helpTabName="Help";var formulaTabName="Formula";
window.L.Control.NotebookbarWriter=window.L.Control.Notebookbar.extend({getTabs:function(){return[{
text:_("File"),id:fileTabName+"-tab-label",name:fileTabName,accessibility:{focusBack:true,
combination:"F",de:"D"}},{text:_("Home"),id:this.HOME_TAB_ID,name:homeTabName,
context:"default|Text|DrawText",accessibility:{focusBack:true,combination:"H",de:"R"}},{text:_(
"Insert"),id:insertTabName+"-tab-label",name:insertTabName,accessibility:{focusBack:true,
combination:"N",de:"I"}},{text:_("Layout"),id:layoutTabName+"-tab-label",name:layoutTabName,
accessibility:{focusBack:true,combination:"P",de:"S"}},JSDialog.WriterReferencesTab.getEntry(),{
text:_("Review"),id:reviewTabName+"-tab-label",name:reviewTabName,accessibility:{focusBack:true,
combination:"R",de:"P"}},{text:_("Format"),id:formatTabName+"-tab-label",name:formatTabName,
accessibility:{focusBack:true,combination:"O"}},{text:_("Form"),id:formTabName+"-tab-label",
name:formTabName,accessibility:{focusBack:true,combination:"M"}},{text:_("Table"),
id:tableTabName+"-tab-label",name:tableTabName,context:"Table",accessibility:{focusBack:true,
combination:"T"}},{text:_("Shape"),id:shapeTabName+"-tab-label",name:shapeTabName,
context:"Draw|DrawLine|3DObject|MultiObject|DrawFontwork",accessibility:{focusBack:true,
combination:"JI",de:"JI"}},{text:_("Picture"),id:pictureTabName+"-tab-label",name:pictureTabName,
context:"Graphic",accessibility:{focusBack:true,combination:"PI",de:"PI"}},{text:_("View"),
id:viewTabName+"-tab-label",name:viewTabName,accessibility:{focusBack:true,combination:"W",de:"F"}},
{text:_("Help"),id:helpTabName+"-tab-label",name:helpTabName,accessibility:{focusBack:true,
combination:"Y",de:"E"}},{text:_("Formula"),id:formulaTabName+"-tab-label",name:formulaTabName,
context:"Math",accessibility:{focusBack:true,combination:"V",de:"Y"}}]},getTabsJSON:function(){
return[this.getFileTab(),this.getHomeTab(),this.getInsertTab(),this.getLayoutTab(),
this.getReferencesTab(),this.getReviewTab(),this.getFormatTab(),this.getFormTab(),this.getTableTab()
,this.getShapeTab(),this.getPictureTab(),this.getViewTab(),this.getHelpTab(),this.getFormulaTab()]},
getFullJSON:function(selectedId){return this.getNotebookbar(this.getTabsJSON(),selectedId)},
getFileTab:function(){var hasRevisionHistory=window.L.Params.revHistoryEnabled;
var hasPrint=!this.map["wopi"].HidePrintOption;var hasRepair=!this.map["wopi"].HideRepairOption;
var hasSaveAs=!this.map["wopi"].UserCanNotWriteRelative;var hasShare=this.map["wopi"].EnableShare;
var hideDownload=this.map["wopi"].HideExportOption;var hasGroupedSaveAs=window.prefs.get(
"saveAsMode")==="group";var hasRunMacro=window.enableMacrosExecution;var hasSave=!this.map["wopi"
].HideSaveOption;var content=[];if(hasSave){content.push({type:"container",children:[{
id:"file-save",type:"bigtoolitem",text:_UNO(".uno:Save"),command:".uno:Save",accessibility:{
focusBack:true,combination:"SV",de:null}}]})}if(hasSaveAs){if(hasGroupedSaveAs){content.push({
id:"saveas:SaveAsMenu",command:"saveas",type:"exportmenubutton",text:_("Save As"),accessibility:{
focusBack:true,combination:"SA"}})}else{content.push({id:"file-saveas",type:"bigtoolitem",text:_UNO(
".uno:SaveAs","text"),command:".uno:SaveAs",accessibility:{focusBack:true,combination:"SA"}})}}if(
hasSaveAs){content.push({id:"exportas:ExportAsMenu",command:"exportas",class:"unoexportas",
type:"exportmenubutton",text:_("Export As"),accessibility:{focusBack:true,combination:"EA"}})}if(
hasShare&&hasRevisionHistory){content.push({id:"file-exportas-break",type:"separator",
orientation:"vertical"},{type:"container",children:[{id:"ShareAs",class:"unoShareAs",
type:"customtoolitem",text:_("Share"),command:"shareas",inlineLabel:true,accessibility:{
focusBack:true,combination:"SH"}},{id:"Rev-History",class:"unoRev-History",type:"customtoolitem",
text:_("See history"),command:"rev-history",inlineLabel:true,accessibility:{focusBack:true,
combination:"RH"}}],vertical:true},{id:"file-revhistory-break",type:"separator",
orientation:"vertical"})}else if(hasShare){content.push({id:"file-exportas-break",type:"separator",
orientation:"vertical"},{type:"container",children:[{id:"ShareAs",class:"unoShareAs",
type:"bigcustomtoolitem",text:_("Share"),command:"shareas",accessibility:{focusBack:true,
combination:"SH"}}]},{id:"file-shareas-break",type:"separator",orientation:"vertical"})}else if(
hasRevisionHistory){content.push({id:"file-exportas-break",type:"separator",orientation:"vertical"},
{type:"container",children:[{id:"Rev-History",class:"unoRev-History",type:"bigcustomtoolitem",
text:_("See history"),command:"rev-history",accessibility:{focusBack:true,combination:"RH"}}]},{
id:"file-revhistory-break",type:"separator",orientation:"vertical"})}if(hasPrint){content.push({
id:"print",type:"bigtoolitem",text:"Печать",command:".uno:Print",accessibility:{
focusBack:true,combination:"P",de:"P"}})}if(hasRunMacro){content.push({type:"toolbox",children:[{
id:"runmacro",type:"bigtoolitem",text:_UNO(".uno:RunMacro","text"),command:".uno:RunMacro"}]})}if(
!hideDownload){content.push({id:"downloadas:DownloadAsMenu",command:"downloadas",
class:"unodownloadas",type:"exportmenubutton",text:!window.ThisIsAMobileApp?_("Download"):_(
"Save As"),accessibility:{focusBack:true,combination:"A",de:"M"}})}content.push({
id:"file-downloadas-break",type:"separator",orientation:"vertical"});if(hasRepair){content.push({
type:"container",children:[{id:"repair",class:"unorepair",type:"bigcustomtoolitem",text:_("Repair"),
accessibility:{focusBack:true,combination:"RF",de:null}}],vertical:"true"})}content.push({
type:"container",children:[{id:"properties",type:"bigtoolitem",text:_("Properties"),
command:".uno:SetDocumentProperties",accessibility:{focusBack:true,combination:"FP",de:"I"}}]});if(
window.documentSigningEnabled){content.push({type:"container",children:[{id:"signature",
type:"bigtoolitem",text:_("Signature"),command:".uno:Signature",accessibility:{focusBack:true,
combination:"SN"}}]})}if(this._map["wopi"]._supportsRename()&&this._map["wopi"].UserCanRename){
content.push({type:"container",children:[{id:"renamedocument",class:"unoRenameDocument",
type:"bigcustomtoolitem",text:_("Rename"),accessibility:{focusBack:true,combination:"RN"}}]})}if(
window.wasmEnabled){content.push({type:"container",children:[{type:"separator",
id:"file-renamedocument-break",orientation:"vertical"},{id:"togglewasm",class:"togglewasm",
type:"bigcustomtoolitem",text:_(window.ThisIsTheEmscriptenApp?_("Go Online"):_("Go Offline")),
accessibility:{focusBack:true,combination:"RN"}}]})}if(window.wopiSettingBaseUrl){content.push({
type:"separator",id:"file-properties-break",orientation:"vertical"});content.push({
id:"settings-dialog",type:"bigtoolitem",text:_("Options"),command:".uno:Settings",accessibility:{
focusBack:false,combination:"T",de:null}})}return this.getTabPage(fileTabName,content)},
getHelpTab:function(){var hasLatestUpdates=window.enableWelcomeMessage;
var hasFeedback=this.map.feedback;var hasAccessibilitySupport=window.enableAccessibility;
var hasAccessibilityCheck=this.map.getDocType()==="text";var hasAbout=window.L.DomUtil.get(
"about-dialog")!==null;var hasServerAudit=!this.hiddenItems.includes("server-audit");var content=[{
type:"toolbox",children:[{id:"forum",type:"bigtoolitem",text:_("Forum"),command:".uno:ForumHelp",
accessibility:{focusBack:true,combination:"C",de:null}}]},{type:"toolbox",children:[{
id:"online-help",type:"bigtoolitem",text:_("Online Help"),command:".uno:OnlineHelp",accessibility:{
focusBack:false,combination:"H",de:null}}]},{type:"separator",id:"help-onlinehelp-break",
orientation:"vertical"},{type:"toolbox",children:[{id:"keyboard-shortcuts",type:"bigtoolitem",
text:_("Keyboard shortcuts"),command:".uno:KeyboardShortcuts",accessibility:{focusBack:false,
combination:"S",de:null}}]},{type:"separator",id:"help-keyboardshortcuts-break",
orientation:"vertical"},hasAccessibilitySupport?{id:"togglea11ystate",type:"bigcustomtoolitem",
text:_("Screen Reading"),accessibility:{focusBack:true,combination:"SR",de:null}}:{},
hasAccessibilityCheck?{id:"accessibility-check",class:"unoAccessibilityCheck",type:"bigtoolitem",
text:_UNO(".uno:AccessibilityCheck","text"),command:".uno:SidebarDeck.A11yCheckDeck",accessibility:{
focusBack:false,combination:"A",de:null}}:{},hasAccessibilitySupport||hasAccessibilityCheck?{
id:"help-accessibility-break",type:"separator",orientation:"vertical"}:{},hasServerAudit?{
id:"server-audit",type:"bigcustomtoolitem",text:_("Server audit"),command:"serveraudit",
accessibility:{focusBack:false,combination:"SA",de:null}}:{},hasServerAudit?{
id:"help-serveraudit-break",type:"separator",orientation:"vertical"}:{},{type:"toolbox",children:[{
id:"report-an-issue",type:"bigtoolitem",text:_("Report an issue"),command:".uno:ReportIssue",
accessibility:{focusBack:true,combination:"K",de:null}}]},{type:"separator",
id:"help-reportissue-break",orientation:"vertical"},hasLatestUpdates?{type:"toolbox",children:[{
id:"latestupdates",type:"bigtoolitem",text:_("Latest Updates"),command:".uno:LatestUpdates",
accessibility:{focusBack:true,combination:"LU",de:null}}]}:{},hasFeedback?{type:"toolbox",children:[
{id:"feedback",type:"bigtoolitem",text:_("Send Feedback"),command:".uno:Feedback",accessibility:{
focusBack:true,combination:"SF",de:null}}]}:{},hasAbout?{type:"toolbox",children:[{id:"about",
type:"bigtoolitem",text:_("About"),command:".uno:About",accessibility:{focusBack:false,
combination:"W",de:null}}]}:{}];return this.getTabPage(helpTabName,content)},getHomeTab:function(){
var content=[{id:"home-undo-redo",type:"container",children:[{id:"home-undo",type:"toolitem",
text:_UNO(".uno:Undo"),command:".uno:Undo",accessibility:{focusBack:true,combination:"ZZ",de:"ZZ"}},
{id:"home-redo",type:"toolitem",text:_UNO(".uno:Redo"),command:".uno:Redo",accessibility:{
focusBack:true,combination:"O",de:"W"}}],vertical:"true"},{type:"separator",
id:"home-undoredo-break",orientation:"vertical"},{type:"overflowgroup",id:"home-clipboard",name:_(
"Clipboard"),accessibility:{focusBack:false,combination:"V",de:null},children:[{
id:"home-paste:PasteMenu",type:"menubutton",text:_UNO(".uno:Paste"),command:".uno:Paste",
accessibility:{focusBack:false,combination:"V",de:null}},{type:"container",children:[{
type:"toolbox",children:[{id:"home-cut",type:"customtoolitem",text:_UNO(".uno:Cut"),
command:".uno:Cut",accessibility:{focusBack:true,combination:"X",de:"X"}},{id:"home-brush",
type:"toolitem",text:_UNO(".uno:FormatPaintbrush"),command:".uno:FormatPaintbrush",accessibility:{
focusBack:true,combination:"FP",de:null}}]},{type:"toolbox",children:[{id:"home-copy",
type:"customtoolitem",text:_UNO(".uno:Copy"),command:".uno:Copy",accessibility:{focusBack:true,
combination:"C",de:"C"}},{id:"home-reset-attributes",type:"toolitem",text:_UNO(
".uno:ResetAttributes"),command:".uno:ResetAttributes",accessibility:{focusBack:true,
combination:"E",de:"Q"}}]}],vertical:"true"}]},{type:"separator",id:"home-resertattributes-break",
orientation:"vertical"},{type:"overflowgroup",id:"home-font",name:_("Font"),more:{
command:".uno:FontDialog",accessibility:{focusBack:true,combination:"MF",de:null}},accessibility:{
focusBack:false,combination:"FF",de:null},children:[{type:"container",children:[{type:"container",
children:[{id:"fontnamecombobox",type:"combobox",text:"Carlito",entries:["Carlito"],
selectedCount:"1",selectedEntries:["0"],command:".uno:CharFontName",accessibility:{focusBack:false,
combination:"FF",de:null}},{id:"fontsizecombobox",type:"combobox",text:"12 pt",entries:["12 pt"],
selectedCount:"1",selectedEntries:["0"],command:".uno:FontHeight",accessibility:{focusBack:false,
combination:"FS",de:null}},{id:"home-grow",type:"toolitem",text:_UNO(".uno:Grow"),
command:".uno:Grow",accessibility:{focusBack:true,combination:"FG",de:"SV"}},{id:"home-shrink",
type:"toolitem",text:_UNO(".uno:Shrink"),command:".uno:Shrink",accessibility:{focusBack:true,
combination:"FK",de:"J"}}],vertical:"false"},{type:"container",children:[{type:"toolbox",children:[{
id:"home-bold",type:"toolitem",text:_UNO(".uno:Bold"),command:".uno:Bold",accessibility:{
focusBack:true,combination:"1",de:"1"}},{id:"home-italic",type:"toolitem",text:_UNO(".uno:Italic"),
command:".uno:Italic",accessibility:{focusBack:true,combination:"2",de:"2"}},{id:"home-underline",
type:"toolitem",text:_UNO(".uno:Underline"),command:".uno:Underline",accessibility:{focusBack:true,
combination:"3",de:"3"}},{id:"home-strikeout",type:"toolitem",text:_UNO(".uno:Strikeout"),
command:".uno:Strikeout",accessibility:{focusBack:true,combination:"4",de:"4"}},{
id:"home-subscript",type:"toolitem",text:_UNO(".uno:SubScript"),command:".uno:SubScript",
accessibility:{focusBack:true,combination:"5",de:"5"}},{id:"home-superscript",type:"toolitem",
text:_UNO(".uno:SuperScript"),command:".uno:SuperScript",accessibility:{focusBack:true,
combination:"6",de:"6"}},{id:"home-spacing:CharSpacingMenu",type:"menubutton",noLabel:true,
text:_UNO(".uno:Spacing"),command:".uno:CharSpacing",accessibility:{focusBack:false,
combination:"FT",de:null}},{id:"home-back-color:ColorPickerMenu",class:"unospan-CharBackColor",
type:"toolitem",noLabel:true,text:_UNO(".uno:CharBackColor","text"),command:".uno:CharBackColor",
accessibility:{focusBack:true,combination:"HC",de:null}},{id:"home-color:ColorPickerMenu",
class:"unospan-FontColor",type:"toolitem",noLabel:true,text:_UNO(".uno:Color"),command:".uno:Color",
accessibility:{focusBack:true,combination:"FC",de:null}}]}],vertical:"false"}],vertical:"true"}]},{
type:"separator",id:"home-fontcombobox-break",orientation:"vertical"},{type:"overflowgroup",
id:"home-paragraph",name:_("Paragraph"),accessibility:{focusBack:false,combination:"U",de:"AA"},
more:{command:".uno:ParagraphDialog",accessibility:{focusBack:true,combination:"MP",de:null}},
children:[{type:"container",children:[{type:"toolbox",children:[{id:"home-default-bullet",
type:"toolitem",text:_UNO(".uno:DefaultBullet"),command:".uno:DefaultBullet",accessibility:{
focusBack:true,combination:"U",de:"AA"}},{id:"home-default-numbering",type:"toolitem",text:_UNO(
".uno:DefaultNumbering"),command:".uno:DefaultNumbering",accessibility:{focusBack:true,
combination:"N",de:"GN"}},{id:"home-increment-indent",type:"toolitem",text:_UNO(
".uno:IncrementIndent"),command:".uno:IncrementIndent",accessibility:{focusBack:true,
combination:"AI",de:"ÖI"}},{id:"home-decrement-indent",type:"toolitem",text:_UNO(
".uno:DecrementIndent"),command:".uno:DecrementIndent",accessibility:{focusBack:true,
combination:"AO",de:"PI"}},{id:"home-control-codes",type:"toolitem",text:_UNO(".uno:ControlCodes",
"text"),command:".uno:ControlCodes",accessibility:{focusBack:true,combination:"FM",de:"FM"}},{
id:"home-para-left-to-right",type:"toolitem",text:_UNO(".uno:ParaLeftToRight"),
command:".uno:ParaLeftToRight",accessibility:{focusBack:true,combination:"TL",de:"EB"}},{
id:"home-para-right-to-left",type:"toolitem",text:_UNO(".uno:ParaRightToLeft"),
command:".uno:ParaRightToLeft",accessibility:{focusBack:true,combination:"TR",de:null}}]}],
vertical:"false"},{type:"container",children:[{type:"toolbox",children:[{id:"home-left-para",
type:"toolitem",text:_UNO(".uno:LeftPara"),command:".uno:LeftPara",accessibility:{focusBack:true,
combination:"AL",de:"AL"}},{id:"home-center-para",type:"toolitem",text:_UNO(".uno:CenterPara"),
command:".uno:CenterPara",accessibility:{focusBack:true,combination:"AC",de:"RZ"}},{
id:"home-right-para",type:"toolitem",text:_UNO(".uno:RightPara"),command:".uno:RightPara",
accessibility:{focusBack:true,combination:"AR",de:"RE"}},{id:"home-justify-para",type:"toolitem",
text:_UNO(".uno:JustifyPara"),command:".uno:JustifyPara",accessibility:{focusBack:true,
combination:"AJ",de:"OL"}},{id:"home-line-spacing:LineSpacingMenu",type:"menubutton",noLabel:true,
text:_UNO(".uno:LineSpacing"),command:".uno:LineSpacing",accessibility:{focusBack:false,
combination:"K",de:null}},{id:"home-background-color:ColorPickerMenu",
class:"unospan-BackgroundColor",noLabel:true,type:"toolitem",text:_UNO(".uno:BackgroundColor"),
command:".uno:BackgroundColor",accessibility:{focusBack:true,combination:"BC",de:null}}]}],
vertical:"false"}],vertical:"true"},{type:"overflowgroup",id:"home-stylesview-group",nofold:true,
name:_("Styles"),children:[{id:"stylesview",type:"iconview",entries:[],vertical:"false"}]},{
id:"stylesview-btn",type:"container",children:[{id:"scroll-up",type:"customtoolitem",text:_(
"Scroll up"),command:"scrollpreviewup",icon:"lc_searchprev.svg"},{id:"scroll-down",
type:"customtoolitem",text:_("Scroll down"),command:"scrollpreviewdown",icon:"lc_searchnext.svg"},{
id:"format-style-list-dialog",type:"toolitem",text:_("Style list"),
command:".uno:SidebarDeck.StyleListDeck",icon:"lc_stylepreviewmore.svg",accessibility:{
focusBack:true,combination:"SD",de:null}}],vertical:"true"},{type:"overflowgroup",id:"home-insert",
name:_("Insert"),accessibility:{focusBack:false,combination:"IT",de:null},children:[{type:"toolbox",
children:[{id:"home-insert-table:InsertTableMenu",type:"menubutton",noLabel:true,text:_UNO(
".uno:InsertTable","text"),command:".uno:InsertTable",accessibility:{focusBack:false,
combination:"IT",de:null}},{id:"home-insert-graphic:InsertImageMenu",type:"menubutton",noLabel:true,
text:_UNO(".uno:InsertGraphic"),command:".uno:InsertGraphic",accessibility:{focusBack:true,
combination:"IG",de:null}}]},{type:"toolbox",children:[{id:"home-insert-page-break",type:"toolitem",
text:_UNO(".uno:InsertPagebreak","text"),command:".uno:InsertPagebreak",accessibility:{
focusBack:true,combination:"IP",de:null}},{id:"CharmapControl",class:"unoCharmapControl",
type:"customtoolitem",text:_UNO(".uno:CharmapControl"),command:"charmapcontrol",accessibility:{
focusBack:false,combination:"IS",de:null}}]}],vertical:"true"},{type:"separator",
id:"home-charmapcontrol-break",orientation:"vertical"},{type:"overflowgroup",id:"home-search",
name:_("Search"),accessibility:{focusBack:false,combination:"SS",de:"SS"},children:[{
type:"container",children:[{type:"toolbox",children:[{id:"home-search",class:"unoSearch",
type:"customtoolitem",text:_("Search"),accessibility:{focusBack:false,combination:"SS",de:"SS"}}]},{
type:"toolbox",children:[{id:"home-search-dialog",type:"toolitem",text:_("Replace"),
command:".uno:SearchDialog?InitialFocusReplace:bool=true",accessibility:{focusBack:false,
combination:"FD",de:"US"}}]}],vertical:"true"}]}];return this.getTabPage(homeTabName,content)},
getFormatTab:function(){var content=[{type:"overflowgroup",id:"format-style",name:_("Style"),
accessibility:{focusBack:false,combination:"A",de:null},children:[{id:"format-font-dialog",
type:"bigtoolitem",text:_UNO(".uno:FontDialog","text"),command:".uno:FontDialog",accessibility:{
focusBack:false,combination:"A",de:null}},{id:"format-FormatMenu:FormatMenu",type:"menubutton",
text:_UNO(".uno:FormatMenu","text"),command:".uno:FormatMenu",accessibility:{focusBack:false,
combination:"FT",de:null}},{id:"format-paragraph-dialog",type:"bigtoolitem",text:_UNO(
".uno:ParagraphDialog","text"),command:".uno:ParagraphDialog",accessibility:{focusBack:false,
combination:"B",de:null}},{id:"format-style-dialog",type:"bigtoolitem",text:_("Style list"),
command:".uno:SidebarDeck.StyleListDeck",accessibility:{focusBack:false,combination:"SD",de:null}}]}
,{type:"separator",id:"format-styledialog-break",orientation:"vertical"},{type:"overflowgroup",
id:"format-bullets",name:_("Lists/Bullets"),accessibility:{focusBack:false,combination:"FB",de:null
},children:[{id:"format-FormatBulletsMenu:FormatBulletsMenu",type:"menubutton",text:_UNO(
".uno:FormatBulletsMenu","text"),command:".uno:FormatBulletsMenu",
applyCallback:".uno:DefaultNumbering",accessibility:{focusBack:false,combination:"FB",de:null}},{
id:"format-outline-bullet",type:"bigtoolitem",text:_UNO(".uno:OutlineBullet","text"),
command:".uno:OutlineBullet",accessibility:{focusBack:false,combination:"C",de:null}}]},{
type:"separator",id:"format-outlinebullet-break",orientation:"vertical"},{id:"format-page-dialog",
type:"bigtoolitem",text:_UNO(".uno:PageDialog","text"),command:".uno:PageDialog",accessibility:{
focusBack:false,combination:"D",de:null}},{type:"separator",id:"format-pagedialog-break",
orientation:"vertical"},{id:"format-format-columns",type:"bigtoolitem",text:_UNO(
".uno:FormatColumns","text"),command:".uno:FormatColumns",accessibility:{focusBack:false,
combination:"E",de:null}},{id:"format-edit-region",type:"bigtoolitem",text:_UNO(".uno:EditRegion",
"text"),command:".uno:EditRegion",accessibility:{focusBack:false,combination:"F",de:null}},{
id:"format-format-line",type:"bigtoolitem",text:_UNO(".uno:FormatLine"),command:".uno:FormatLine",
accessibility:{focusBack:false,combination:"G",de:null}},{id:"format-format-area",
type:"bigtoolitem",text:_UNO(".uno:FormatArea"),command:".uno:FormatArea"},{type:"separator",
id:"format-formatarea-break",orientation:"vertical"},{id:"format-transform-dialog",
type:"bigtoolitem",text:_UNO(".uno:TransformDialog"),command:".uno:TransformDialog",accessibility:{
focusBack:false,combination:"H",de:null}},{type:"separator",id:"format-transformdialog-break",
orientation:"vertical"},{id:"format-chapter-numbering-dialog",type:"bigtoolitem",text:_UNO(
".uno:ChapterNumberingDialog","text"),command:".uno:ChapterNumberingDialog",accessibility:{
focusBack:false,combination:"I",de:null}},{type:"separator",
id:"format-chapternumberingdialog-break",orientation:"vertical"},{id:"format-name-description",
type:"container",children:[{type:"toolbox",children:[{id:"format-name-group",type:"toolitem",
text:_UNO(".uno:NameGroup","text"),command:".uno:NameGroup",accessibility:{focusBack:false,
combination:"NG",de:null}}]},{type:"toolbox",children:[{id:"format-object-title-description",
type:"toolitem",text:_UNO(".uno:ObjectTitleDescription","text"),
command:".uno:ObjectTitleDescription",accessibility:{focusBack:false,combination:"DS",de:null}}]}],
vertical:"true"},{type:"separator",id:"format-objecttitledescription-break",orientation:"vertical"},
{id:"format-theme-dialog",type:"bigtoolitem",text:_UNO(".uno:ThemeDialog"),
command:".uno:ThemeDialog",accessibility:{focusBack:false,combination:"J",de:null}}];
return this.getTabPage(formatTabName,content)},getInsertTab:function(){
var isODF=app.LOUtil.isFileODF(this.map);var content=[{type:"overflowgroup",
id:"insert-page-control",name:_("Page"),accessibility:{focusBack:false,combination:"B",de:"SU"},
children:[{id:"insert-insert-page-break",type:"bigtoolitem",text:_UNO(".uno:InsertPagebreak","text"
),command:".uno:InsertPagebreak",accessibility:{focusBack:true,combination:"B",de:"SU"}},{
id:"insert-insert-title-page-dialog",type:"bigtoolitem",text:_UNO(".uno:TitlePageDialog","text"),
command:".uno:TitlePageDialog",accessibility:{focusBack:false,combination:"TI",de:null}}]},{
type:"separator",id:"insert-insertpagebreak-break",orientation:"vertical"},{
id:"insert-insert-table:InsertTableMenu",type:"menubutton",text:_("Table"),
command:".uno:InsertTable",accessibility:{focusBack:false,combination:"IT",de:null}},{
type:"separator",id:"insert-inserttable-break",orientation:"vertical"},{type:"overflowgroup",
id:"insert-illustrations",name:_("Illustrations"),icon:"lc_insertgraphic.svg",accessibility:{
focusBack:false,combination:"P",de:"BI"},children:[{type:"container",children:[{type:"toolbox",
children:[{id:"insert-insert-graphic:InsertImageMenu",type:"menubutton",noLabel:true,text:_UNO(
".uno:InsertGraphic"),command:".uno:InsertGraphic",accessibility:{focusBack:true,combination:"P",
de:"BI"}}]},{type:"toolbox",children:[{id:"insert-insert-line",type:"toolitem",text:_UNO(".uno:Line"
,"text"),command:".uno:Line",accessibility:{focusBack:true,combination:"IL",de:null}}]}],
vertical:"true"},{type:"container",children:[{type:"toolbox",children:[{
id:"insert-insert-shapes:InsertShapesMenu",type:"menubutton",noLabel:true,text:_("Shapes"),
command:".uno:BasicShapes",accessibility:{focusBack:false,combination:"IH",de:null}}]},{
type:"toolbox",children:[{id:"insert-insert-object-chart",type:"toolitem",text:_UNO(
".uno:InsertObjectChart"),command:".uno:InsertObjectChart",accessibility:{focusBack:false,
combination:"C",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"insert-insertobjectchart-break",orientation:"vertical"},this.map["wopi"
].EnableRemoteLinkPicker?{type:"container",children:[{type:"toolbox",children:[{
id:"insert-hyperlink-dialog",class:"unoHyperlinkDialog",type:"customtoolitem",text:_UNO(
".uno:HyperlinkDialog"),command:"hyperlinkdialog",accessibility:{focusBack:false,combination:"ZL",
de:"8"}}]},{type:"toolbox",children:[{id:"insert-insert-remote-link",class:"unoremotelink",
type:"customtoolitem",text:_("Smart Picker"),command:"remotelink",accessibility:{focusBack:true,
combination:"RL",de:null}}]}],vertical:"true"}:{id:"insert-hyperlink-dialog",
class:"unoHyperlinkDialog",type:"bigcustomtoolitem",text:_UNO(".uno:HyperlinkDialog"),
command:"hyperlinkdialog",accessibility:{focusBack:false,combination:"ZL",de:"8"}},{
type:"separator",id:"insert-hyperlinkdialog-break",orientation:"vertical"},this.map["wopi"
].EnableRemoteAIContent?{id:"insert-insert-remote-ai-content",class:"unoremoteaicontent",
type:"bigcustomtoolitem",text:_("Assistant"),command:"remoteaicontent",accessibility:{
focusBack:true,combination:"RL",de:null}}:{},this.map["wopi"].EnableRemoteAIContent?{
type:"separator",id:"insert-remoteaicontent-break",orientation:"vertical"}:{},{
id:"insert-insert-annotation",type:"bigtoolitem",text:_UNO(".uno:InsertAnnotation","text"),
command:".uno:InsertAnnotation",accessibility:{focusBack:false,combination:"ZC",de:"ZC"}},{
type:"separator",id:"insert-insertannotation-break",orientation:"vertical"},{type:"overflowgroup",
id:"insert-header-footer",name:_("Header & Footer"),accessibility:{focusBack:false,combination:"H",
de:"H"},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"insert-insert-page-header",type:"toolitem",text:_UNO(".uno:InsertPageHeader","text"),
command:".uno:InsertPageHeader",accessibility:{focusBack:true,combination:"H",de:"H"}}]},{
type:"toolbox",children:[{id:"insert-insert-page-footer",type:"toolitem",text:_UNO(
".uno:InsertPageFooter","text"),command:".uno:InsertPageFooter",accessibility:{focusBack:true,
combination:"O",de:null}}]}],vertical:"true"},{type:"container",children:[{type:"toolbox",children:[
{id:"insert-insert-page-number-wizard",type:"toolitem",text:_UNO(".uno:PageNumberWizard","text"),
command:".uno:PageNumberWizard",accessibility:{focusBack:false,combination:"NU",de:null}}]},{
type:"toolbox",children:[{id:"insert-insert-field-control",type:"toolitem",text:_UNO(
".uno:InsertFieldCtrl","text"),command:".uno:InsertFieldCtrl",accessibility:{focusBack:false,
combination:"IE",de:null}}]}],vertical:"true"}]},{type:"separator",id:"header-footer-break",
orientation:"vertical"},{type:"overflowgroup",id:"insert-section",name:_("Section"),accessibility:{
focusBack:false,combination:"IS",de:null},children:[{type:"container",children:[{type:"toolbox",
children:[{id:"insert-insert-section",type:"toolitem",text:_UNO(".uno:InsertSection","text"),
command:".uno:InsertSection",accessibility:{focusBack:false,combination:"IS",de:null}}]},{
type:"toolbox",children:[{id:"insert-frame",type:"toolitem",text:_UNO(".uno:InsertFrame","text"),
command:".uno:InsertFrame",accessibility:{focusBack:false,combination:"PT",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"insert-insertsection-break",orientation:"vertical"},{
type:"overflowgroup",id:"insert-text",name:_("Text"),accessibility:{focusBack:false,combination:"X",
de:null},children:[{id:"insert-draw-text",type:"bigtoolitem",text:_UNO(".uno:DrawText"),
command:".uno:DrawText",accessibility:{focusBack:true,combination:"X",de:null}},{
id:"insert-insert-vertical-text",type:"bigtoolitem",text:_UNO(".uno:VerticalText","text"),
command:".uno:VerticalText",accessibility:{focusBack:false,combination:"VT",de:null}}]},{
type:"separator",id:"insert-insertline-break",orientation:"vertical"},{
id:"insert-font-gallery-floater",type:"bigtoolitem",text:_UNO(".uno:FontworkGalleryFloater"),
command:".uno:FontworkGalleryFloater",visible:isODF?"true":"false",accessibility:{focusBack:false,
combination:"FG",de:null}},{type:"separator",visible:isODF?"true":"false",
id:"insert-fontgalleryfloater-break",orientation:"vertical"},{
id:"insert-FormattingMarkMenu:FormattingMarkMenu",type:"menubutton",text:_UNO(
".uno:FormattingMarkMenu","text"),command:".uno:FormattingMarkMenu",accessibility:{focusBack:false,
combination:"FM",de:null}},{type:"separator",id:"insert-formattingmarkmenu-break",
orientation:"vertical"},{type:"overflowgroup",id:"insert-symbols",name:_("Symbols"),accessibility:{
focusBack:false,combination:"ZS",de:null},children:[{type:"container",children:[{type:"toolbox",
children:[{id:"insert-insert-char",class:"unoCharmapControl",type:"customtoolitem",text:_UNO(
".uno:CharmapControl"),command:"charmapcontrol",accessibility:{focusBack:false,combination:"ZS",
de:null}}]},{type:"toolbox",children:[{id:"insert-insert-objects-star-math",type:"toolitem",text:_(
"Formula"),command:".uno:InsertObjectStarMath",accessibility:{focusBack:true,combination:"ET",
de:null}}]}],vertical:"true"},{id:"insert-QrCode",type:"bigtoolitem",text:_UNO(".uno:InsertQrCode",
"text"),command:".uno:InsertQrCode",accessibility:{focusBack:false,combination:"IQ",de:null}}]}];
return this.getTabPage(insertTabName,content)},getFormTab:function(){var content=[{
id:"form-insert-content-control",type:"bigtoolitem",text:_("Rich Text"),
command:".uno:InsertContentControl",accessibility:{focusBack:true,combination:"A",de:null}},{
type:"separator",id:"form-insertcontentcontrol-break",orientation:"vertical"},{
id:"form-insert-checkbox-control",type:"bigtoolitem",text:_("Checkbox"),
command:".uno:InsertCheckboxContentControl",accessibility:{focusBack:true,combination:"B",de:null}},
{type:"separator",id:"form-insertcheckboxcontrol-break",orientation:"vertical"},{
id:"form-insert-dropdown-control",type:"bigtoolitem",text:_("Dropdown"),
command:".uno:InsertDropdownContentControl",accessibility:{focusBack:true,combination:"C",de:null}},
{type:"separator",id:"form-insertdropdowncontrol-break",orientation:"vertical"},{
id:"form-insert-picture-control",type:"bigtoolitem",text:_("Picture"),
command:".uno:InsertPictureContentControl",accessibility:{focusBack:true,combination:"D",de:null}},{
type:"separator",id:"form-insertdropdowncontrol-break",orientation:"vertical"},{
id:"form-insert-date-content-control",type:"bigtoolitem",text:_("Date"),
command:".uno:InsertDateContentControl",accessibility:{focusBack:true,combination:"E",de:null}},{
type:"separator",id:"form-insertdatecontentcontrol-break",orientation:"vertical"},{
id:"form-content-control-properties",type:"bigtoolitem",text:_("Properties"),
command:".uno:ContentControlProperties",accessibility:{focusBack:false,combination:"F",de:null}}];
return this.getTabPage(formTabName,content)},getViewTab:function(){
var isTablet=window.mode.isTablet();var content=[isTablet?{id:"closemobile",
type:"bigcustomtoolitem",text:_("Read mode"),command:"closetablet"}:{},{id:"view-control-codes",
type:"bigtoolitem",text:_UNO(".uno:ControlCodes","text"),command:".uno:ControlCodes",accessibility:{
focusBack:true,combination:"CC",de:null}},{type:"separator",id:"view-controlcodes-break",
orientation:"vertical"},{type:"overflowgroup",id:"view-zoom",name:_("Zoom"),accessibility:{
focusBack:false,combination:"F",de:"E"},children:[{id:"fullscreen",type:"bigtoolitem",text:_UNO(
".uno:FullScreen"),command:".uno:FullScreen",accessibility:{focusBack:true,combination:"F",de:"E"}},
{id:"zoomreset",class:"unozoomreset",type:"bigcustomtoolitem",text:_("Reset zoom"),accessibility:{
focusBack:true,combination:"J",de:"O"}},{type:"container",children:[{type:"toolbox",children:[{
id:"zoomout",class:"unozoomout",type:"customtoolitem",text:_UNO(".uno:ZoomMinus"),accessibility:{
focusBack:true,combination:"ZO",de:null}}]},{type:"toolbox",children:[{id:"zoomin",
class:"unozoomin",type:"customtoolitem",text:_UNO(".uno:ZoomPlus"),accessibility:{focusBack:true,
combination:"ZI",de:null}}]}],vertical:"true"}]},{type:"separator",id:"view-zoomin-break",
orientation:"vertical"},{id:"toggleuimode",class:"unotoggleuimode",type:"bigcustomtoolitem",text:_(
"Compact view"),accessibility:{focusBack:false,combination:"UI",de:null}},{type:"container",
children:[{type:"toolbox",children:[{id:"showruler",class:"unoshowruler",type:"customtoolitem",
text:_("Ruler"),accessibility:{focusBack:true,combination:"R",de:"L"}}]},{type:"toolbox",children:[{
id:"showstatusbar",class:"unoshowstatusbar",type:"customtoolitem",text:_("Status Bar"),
accessibility:{focusBack:true,combination:"AH",de:null}}]}],vertical:"true"},{
id:"collapsenotebookbar",class:"unocollapsenotebookbar",type:"bigcustomtoolitem",text:_(
"Collapse Tabs"),accessibility:{focusBack:true,combination:"CT",de:null}},{type:"separator",
id:"view-collapsenotebookbar-break",orientation:"vertical"},{id:"toggledarktheme",
class:"unotoggledarktheme",type:"bigcustomtoolitem",text:_("Dark Mode"),accessibility:{
focusBack:true,combination:"D",de:null}},{id:"invertbackground",class:"unoinvertbackground",
type:"bigcustomtoolitem",text:_("Invert Background"),accessibility:{focusBack:true,combination:"BG",
de:null}},{type:"separator",id:"view-invertbackground-break",orientation:"vertical"},{
id:"view-sidebar-property-deck",type:"bigtoolitem",text:_UNO(".uno:Sidebar"),
command:".uno:SidebarDeck.PropertyDeck",accessibility:{focusBack:true,combination:"SB",de:null}},{
id:"view-navigator",type:"bigtoolitem",text:_UNO(".uno:Navigator"),command:".uno:Navigator",
accessibility:{focusBack:true,combination:"K",de:"V"}}];return this.getTabPage(viewTabName,content)
},getLayoutTab:function(){var content=[{type:"overflowgroup",id:"layout-page",name:_("Page Setup"),
accessibility:{focusBack:true,combination:"SP",de:"T"},more:{command:".uno:PageDialog",
accessibility:{focusBack:false,combination:"SP",de:"T"}},children:[{
id:"Layout-MarginMenu:MenuMargins",type:"menubutton",text:_("Margin"),enabled:"true",accessibility:{
focusBack:true,combination:"M",de:"8"}},{id:"Layout-SizeMenu:MenuPageSizesWriter",type:"menubutton",
text:_("Size"),enabled:"true",accessibility:{focusBack:true,combination:"SZ",de:"R"}},{
id:"Layout-OrientationMenu:MenuOrientation",type:"menubutton",text:"Ориентация",
enabled:"true",accessibility:{focusBack:true,combination:"O",de:"4"}}]},{type:"separator",
id:"layout-pagedialog-break",orientation:"vertical"},{id:"layout-format-columns",type:"bigtoolitem",
text:_UNO(".uno:FormatColumns","text"),command:".uno:FormatColumns",accessibility:{focusBack:false,
combination:"J",de:"HS"}},{type:"separator",id:"layout-formatcolumns-break",orientation:"vertical"},
{type:"container",children:[{type:"toolbox",children:[{id:"layout-insert-page-break",
type:"toolitem",text:_UNO(".uno:InsertPagebreak","text"),command:".uno:InsertPagebreak",
accessibility:{focusBack:true,combination:"IB",de:null}}]},{type:"toolbox",children:[{
id:"layout-insert-break",type:"toolitem",text:_UNO(".uno:InsertBreak","text"),
command:".uno:InsertBreak",accessibility:{focusBack:false,combination:"IK",de:null}}]}],
vertical:"true"},{type:"separator",id:"layout-insertbreak-break",orientation:"vertical"},{
type:"container",children:[{type:"toolbox",children:[{id:"layout-hyphenate",type:"toolitem",
text:_UNO(".uno:Hyphenate","text"),command:".uno:Hyphenate",accessibility:{focusBack:true,
combination:"H",de:"I"}}]},{type:"toolbox",children:[{id:"layout-line-numbering-dialog",
type:"toolitem",text:_UNO(".uno:LineNumberingDialog","text"),command:".uno:LineNumberingDialog",
accessibility:{focusBack:true,combination:"LN",de:null}}]}],vertical:"true"},{type:"separator",
id:"layout-linenumberingdialog-break",orientation:"vertical"},{type:"container",children:[{
type:"toolbox",children:[{id:"layout-title-page-dialog",type:"toolitem",text:_UNO(
".uno:TitlePageDialog","text"),command:".uno:TitlePageDialog",accessibility:{focusBack:true,
combination:"TP",de:null}}]},{type:"toolbox",children:[{id:"layout-watermark",type:"toolitem",
text:_UNO(".uno:Watermark","text"),command:".uno:Watermark",accessibility:{focusBack:false,
combination:"WM",de:null}}]}],vertical:"true"},{type:"separator",id:"layout-watermark-break",
orientation:"vertical"},{id:"layout-select-all",type:"bigtoolitem",text:_UNO(".uno:SelectAll"),
command:".uno:SelectAll",accessibility:{focusBack:true,combination:"SA",de:null}},{type:"separator",
id:"layout-selectall-break",orientation:"vertical"},{type:"overflowgroup",id:"layout-wrap",name:_(
"Wrap"),accessibility:{focusBack:false,combination:"TW",de:null},children:[{type:"container",
children:[{type:"toolbox",children:[{id:"layout-wrap-off",type:"toolitem",text:_UNO(".uno:WrapOff",
"text"),command:".uno:WrapOff",accessibility:{focusBack:true,combination:"TW",de:null}},{
id:"layout-wrap-on",type:"toolitem",text:_UNO(".uno:WrapOn","text"),command:".uno:WrapOn",
accessibility:{focusBack:true,combination:"WO",de:null}},{id:"layout-wrap-ideal",type:"toolitem",
text:_UNO(".uno:WrapIdeal","text"),command:".uno:WrapIdeal",accessibility:{focusBack:true,
combination:"WI",de:null}}]},{type:"toolbox",children:[{id:"layout-wrap-left",type:"toolitem",
text:_UNO(".uno:WrapLeft","text"),command:".uno:WrapLeft",accessibility:{focusBack:true,
combination:"WL",de:null}},{id:"layout-wrap-through",type:"toolitem",text:_UNO(".uno:WrapThrough",
"text"),command:".uno:WrapThrough",accessibility:{focusBack:true,combination:"WT",de:null}},{
id:"layout-wrap-right",type:"toolitem",text:_UNO(".uno:WrapRight","text"),command:".uno:WrapRight",
accessibility:{focusBack:true,combination:"WR",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"layout-wrapright-break",orientation:"vertical"},{type:"container",children:[{type:"toolbox",
children:[{id:"layout-contour-dialog",type:"toolitem",text:_UNO(".uno:ContourDialog"),
command:".uno:ContourDialog"}]},{type:"toolbox",children:[{id:"layout-text-wrap",type:"toolitem",
text:_UNO(".uno:TextWrap"),command:".uno:TextWrap"}]}],vertical:"true"},{type:"overflowgroup",
id:"layout-align",name:_("Align"),accessibility:{focusBack:false,combination:"OL",de:null},more:{
command:".uno:TransformDialog",accessibility:{focusBack:true,combination:"MA",de:null}},children:[{
type:"container",children:[{type:"toolbox",children:[{id:"layout-object-align-left",type:"toolitem",
text:_UNO(".uno:ObjectAlignLeft","text"),command:".uno:ObjectAlignLeft",accessibility:{
focusBack:true,combination:"OL",de:null}},{id:"layout-align-center",type:"toolitem",text:_UNO(
".uno:AlignCenter","text"),command:".uno:AlignCenter",accessibility:{focusBack:true,
combination:"AC",de:null}},{id:"layout-object-align-right",type:"toolitem",text:_UNO(
".uno:ObjectAlignRight","text"),command:".uno:ObjectAlignRight",accessibility:{focusBack:true,
combination:"OR",de:null}}]},{type:"toolbox",children:[{id:"layout-align-up",type:"toolitem",
text:_UNO(".uno:AlignUp","text"),command:".uno:AlignUp",accessibility:{focusBack:true,
combination:"OU",de:null}},{id:"layout-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle",
"text"),command:".uno:AlignMiddle",accessibility:{focusBack:true,combination:"AM",de:null}},{
id:"layout-align-down",type:"toolitem",text:_UNO(".uno:AlignDown","text"),command:".uno:AlignDown",
accessibility:{focusBack:true,combination:"AD",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"layout-aligndown-break",orientation:"vertical"},{type:"overflowgroup",id:"layout-arrange",
name:_("Arrange"),accessibility:{focusBack:false,combination:"OF",de:null},more:{
command:".uno:TransformDialog",accessibility:{focusBack:true,combination:"MR",de:null}},children:[{
type:"container",children:[{type:"toolbox",children:[{id:"layout-object-forward-one",
type:"toolitem",text:_UNO(".uno:ObjectForwardOne","text"),command:".uno:ObjectForwardOne",
accessibility:{focusBack:true,combination:"OF",de:null}},{id:"layout-bring-to-front",
type:"toolitem",text:_UNO(".uno:BringToFront","text"),command:".uno:BringToFront",accessibility:{
focusBack:true,combination:"BF",de:null}}]},{type:"toolbox",children:[{id:"layout-object-back-one",
type:"toolitem",text:_UNO(".uno:ObjectBackOne","text"),command:".uno:ObjectBackOne",accessibility:{
focusBack:true,combination:"OB",de:null}},{id:"layout-send-to-back",type:"toolitem",text:_UNO(
".uno:SendToBack","text"),command:".uno:SendToBack",accessibility:{focusBack:true,combination:"SB",
de:null}}]}],vertical:"true"}]}];return this.getTabPage(layoutTabName,content)},
getReferencesTab:function(){const tab=JSDialog.WriterReferencesTab;return this.getTabPage(
tab.getName(),tab.getContent())},getReviewTab:function(){var content=[{
id:"review-spelling-and-grammar-dialog",type:"bigtoolitem",text:_UNO(".uno:SpellingAndGrammarDialog"
),command:".uno:SpellingAndGrammarDialog",accessibility:{focusBack:false,combination:"SP",de:"C"}},{
id:"review-thesaurus-dialog",type:"bigtoolitem",text:_UNO(".uno:ThesaurusDialog"),
command:".uno:ThesaurusDialog",accessibility:{focusBack:false,combination:"E",de:null}},{
id:"LanguageMenu:LanguageMenu",type:"menubutton",text:_UNO(".uno:LanguageMenu"),
command:".uno:LanguageMenu",accessibility:{focusBack:false,combination:"ZL",de:null}},
window.deeplEnabled?{id:"review-translate",type:"bigtoolitem",text:_UNO(".uno:Translate","text"),
command:".uno:Translate"}:{},{type:"container",children:[{type:"toolbox",children:[{
id:"review-spell-online",type:"toolitem",text:_UNO(".uno:SpellOnline"),command:".uno:SpellOnline",
accessibility:{focusBack:true,combination:"SO",de:null}}]},{type:"toolbox",children:[{
id:"review-word-count-dialog",type:"toolitem",text:_UNO(".uno:WordCountDialog","text"),
command:".uno:WordCountDialog",accessibility:{focusBack:false,combination:"W",de:"W"}}]}],
vertical:"true"},{type:"separator",id:"review-wordcountdialog-break",orientation:"vertical"},{
type:"overflowgroup",id:"review-comments",name:_("Comments"),accessibility:{focusBack:false,
combination:"C",de:"N"},children:[{id:"review-insert-annotation:AnnotationMenu",type:"menubutton",
text:_UNO(".uno:InsertAnnotation"),applyCallback:"insertcomment",command:".uno:InsertAnnotation",
accessibility:{focusBack:false,combination:"C",de:"N"}},{type:"container",children:[{type:"toolbox",
children:[{id:"showannotations",type:"customtoolitem",text:_UNO(".uno:ShowAnnotations","text"),
command:"showannotations",accessibility:{focusBack:true,combination:"SA",de:null}}]},{
type:"toolbox",children:[{id:"review-show-resolved-annotations",type:"toolitem",text:_UNO(
".uno:ShowResolvedAnnotations","text"),command:".uno:ShowResolvedAnnotations",accessibility:{
focusBack:true,combination:"RA",de:null}}]}],vertical:"true"},{type:"container",children:[{
type:"toolbox",children:[{id:"review-reply-comment",type:"toolitem",text:_UNO(".uno:ReplyComment"),
command:".uno:ReplyComment"}]},{type:"toolbox",children:[{id:"review-delete-comment",
type:"toolitem",text:_UNO(".uno:DeleteComment"),command:".uno:DeleteComment"}]}],vertical:"true"}]},
{type:"separator",id:"review-deletecomment-break",orientation:"vertical"},{type:"overflowgroup",
id:"review-tracking",name:_("Tracking"),accessibility:{focusBack:false,combination:"TC",de:null},
children:[{id:"review-track-changes:RecordTrackedChangesMenu",type:"menubutton",text:_UNO(
".uno:TrackChanges","text"),applyCallback:"toggletracking",command:".uno:TrackChanges",
accessibility:{focusBack:true,combination:"TC",de:null}},{id:"review-show-tracked-changes",
type:"bigtoolitem",text:_UNO(".uno:ShowTrackedChanges","text"),command:".uno:ShowTrackedChanges",
accessibility:{focusBack:true,combination:"SC",de:null}},{type:"container",children:[{
type:"toolbox",children:[{id:"review-next-tracked-change",type:"toolitem",text:_UNO(
".uno:NextTrackedChange","text"),command:".uno:NextTrackedChange",accessibility:{focusBack:true,
combination:"H",de:"H"}}]},{type:"toolbox",children:[{id:"review-previous-tracked-change",
type:"toolitem",text:_UNO(".uno:PreviousTrackedChange","text"),command:".uno:PreviousTrackedChange",
accessibility:{focusBack:true,combination:"F",de:"F"}}]}],vertical:"true"},{
id:"review-accept-tracked-change:AcceptTrackedChangesMenu",type:"menubutton",text:_UNO(
".uno:AcceptTrackedChange","text"),applyCallback:"acceptTrackedChangeToNext",
command:".uno:AcceptTrackedChangeToNext",accessibility:{focusBack:true,combination:"AC",de:"AC"}},{
id:"review-reject-tracked-change:RejectTrackedChangesMenu",type:"menubutton",text:_UNO(
".uno:RejectTrackedChange","text"),applyCallback:"rejectTrackedChangeToNext",
command:".uno:RejectTrackedChangeToNext",accessibility:{focusBack:true,combination:"JR",de:"JR"}},{
type:"container",children:[{type:"toolbox",children:[{id:"review-reinstate-tracked-change",
type:"toolitem",text:_UNO(".uno:ReinstateTrackedChange","text"),
command:".uno:ReinstateTrackedChange",accessibility:{focusBack:true,combination:"RR"}}]},{
type:"toolbox",children:[{id:"review-accept-tracked-changes",type:"toolitem",text:_UNO(
".uno:AcceptTrackedChanges","text"),command:".uno:AcceptTrackedChanges",accessibility:{
focusBack:false,combination:"AA",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"review-accepttrackedchanges-break",orientation:"vertical"},{id:"review-accessibility-check",
class:"unoAccessibilityCheck",type:"bigtoolitem",text:_UNO(".uno:AccessibilityCheck","text"),
command:".uno:SidebarDeck.A11yCheckDeck",accessibility:{focusBack:false,combination:"A1",de:"B"}}];
return this.getTabPage(reviewTabName,content)},getTableTab:function(){var content=[{
type:"bigtoolitem",text:_UNO(".uno:TableDialog","text",true),command:".uno:TableDialog"},{
type:"separator",id:"table-bigtoolitem-break",orientation:"vertical"},{type:"overflowgroup",
id:"table-insert",name:_("Insert"),accessibility:{focusBack:false,combination:"TI",de:null},
children:[{type:"container",children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:InsertColumnsBefore","text",true),command:".uno:InsertColumnsBefore"},{type:"toolitem",
text:_UNO(".uno:InsertColumnsAfter","text",true),command:".uno:InsertColumnsAfter"},{
type:"toolitem",text:_UNO(".uno:DeleteColumns","text",true),command:".uno:DeleteColumns"}]},{
type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:InsertRowsBefore","text",true),
command:".uno:InsertRowsBefore"},{type:"toolitem",text:_UNO(".uno:InsertRowsAfter","text",true),
command:".uno:InsertRowsAfter"},{type:"toolitem",text:_UNO(".uno:DeleteRows","text",true),
command:".uno:DeleteRows"}]}],vertical:"true"}]},{type:"separator",id:"table-deleterows-break",
orientation:"vertical"},{type:"bigtoolitem",text:_UNO(".uno:MergeCells","text"),
command:".uno:MergeCells"},{type:"separator",id:"table-mergecells-break",orientation:"vertical"},{
type:"overflowgroup",id:"table-split",name:_("Split"),accessibility:{focusBack:false,
combination:"TS",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
type:"toolitem",text:_UNO(".uno:SplitCell","text"),command:".uno:SplitCell"}]},{type:"toolbox",
children:[{type:"toolitem",text:_UNO(".uno:SplitTable","text"),command:".uno:SplitTable"}]}],
vertical:"true"}]},{type:"separator",id:"table-splittable-break",orientation:"vertical"},{
type:"container",children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:Protect",
"text"),command:".uno:Protect"}]},{type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:UnsetCellsReadOnly","text"),command:".uno:UnsetCellsReadOnly"}]}],vertical:"true"},{
type:"separator",id:"table-unsetcellsreadonly-break",orientation:"vertical"},{type:"overflowgroup",
id:"table-select",name:_("Select"),accessibility:{focusBack:false,combination:"TC",de:null},
children:[{type:"bigtoolitem",text:_UNO(".uno:EntireCell","text",true),command:".uno:EntireCell"},{
type:"container",children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:EntireColumn",
"presentation"),command:".uno:EntireColumn"},{type:"toolitem",text:_UNO(".uno:SelectTable","text",
true),command:".uno:SelectTable"}]},{type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:EntireRow","presentation"),command:".uno:EntireRow"},{type:"toolitem",text:_UNO(
".uno:DeleteTable","text",true),command:".uno:DeleteTable"}]}],vertical:"true"}]},{type:"separator",
id:"table-deletetable-break",orientation:"vertical"},{type:"overflowgroup",
id:"table-paragraph-table",name:_("Paragraph"),accessibility:{focusBack:false,combination:"TB",
de:null},children:[{type:"container",children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:CellVertTop"),command:".uno:CellVertTop"},{type:"toolitem",text:_UNO(".uno:CellVertCenter"),
command:".uno:CellVertCenter"},{type:"toolitem",text:_UNO(".uno:CellVertBottom"),
command:".uno:CellVertBottom"}]},{type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:LeftPara"),command:".uno:LeftPara"},{type:"toolitem",text:_UNO(".uno:CenterPara"),
command:".uno:CenterPara"},{type:"toolitem",text:_UNO(".uno:RightPara"),command:".uno:RightPara"},{
type:"toolitem",text:_UNO(".uno:JustifyPara"),command:".uno:JustifyPara"}]}],vertical:"true"}]},{
type:"separator",id:"table-justifypara-break",orientation:"vertical"},{type:"bigtoolitem",text:_UNO(
".uno:TableSort","text"),command:".uno:TableSort"},{type:"separator",id:"table-tablesort-break",
orientation:"vertical"},{type:"bigtoolitem",text:_UNO(".uno:TableNumberFormatDialog","text"),
command:".uno:TableNumberFormatDialog"},{type:"separator",id:"table-tablenumberformatdialog-break",
orientation:"vertical"},{type:"overflowgroup",id:"table-number-format",name:_("Number Format"),
accessibility:{focusBack:false,combination:"TN",de:null},children:[{type:"container",children:[{
type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:NumberFormatCurrency","text"),
command:".uno:NumberFormatCurrency"},{type:"toolitem",text:_UNO(".uno:NumberFormatDate","text"),
command:".uno:NumberFormatDate"},{type:"toolitem",text:_UNO(".uno:NumberFormatPercent","text"),
command:".uno:NumberFormatPercent"}]}],vertical:"true"},{type:"toolbox",children:[{type:"toolitem",
text:_UNO(".uno:TableCellBackgroundColor","text"),command:".uno:TableCellBackgroundColor"},{
id:"set-border-style:BorderStyleMenuWriter",type:"menubutton",noLabel:true,text:_UNO(
".uno:SetBorderStyle","text"),command:".uno:SetBorderStyle"}]}],vertical:"true"},{type:"separator",
id:"table-numberformatpercent-break",orientation:"vertical"},{type:"bigtoolitem",text:_UNO(
".uno:InsertCaptionDialog","text"),command:".uno:InsertCaptionDialog"}];return this.getTabPage(
tableTabName,content)},getFormulaTab:function(){var content=[{type:"bigtoolitem",text:_UNO(
".uno:ChangeFont","text"),command:".uno:ChangeFont",icon:"lc_fontdialog.svg"},{type:"separator",
id:"formula-changefont-break",orientation:"vertical"},{type:"bigtoolitem",text:_UNO(
".uno:ChangeFontSize","text"),command:".uno:ChangeFontSize",icon:"lc_fontheight.svg"},{
type:"separator",id:"formula-changefontsize-break",orientation:"vertical"},{type:"bigtoolitem",
text:_UNO(".uno:ChangeDistance","text"),command:".uno:ChangeDistance",icon:"lc_spacing.svg"},{
type:"separator",id:"formula-changedistance-break",orientation:"vertical"},{type:"bigtoolitem",
text:_UNO(".uno:ChangeAlignment","text"),command:".uno:ChangeAlignment",
icon:"lc_fontworkalignmentfloater.svg"}];return this.getTabPage(formulaTabName,content)},
getShapeTab:function(){var content=[{type:"bigtoolitem",text:_UNO(".uno:TransformDialog","text"),
command:".uno:TransformDialog"},{type:"separator",id:"shape-transformdialog-break",
orientation:"vertical"},{type:"container",children:[{type:"toolbox",children:[{type:"toolitem",
text:_UNO(".uno:FlipVertical"),command:".uno:FlipVertical"}]},{type:"toolbox",children:[{
type:"toolitem",text:_UNO(".uno:FlipHorizontal"),command:".uno:FlipHorizontal"}]}],vertical:"true"},
{type:"separator",id:"shape-fliphorizontal-break",orientation:"vertical"},{type:"container",
children:[{type:"toolbox",children:[{id:"shape-tab-xlinecolor:ColorPickerMenu",noLabel:true,
type:"toolitem",text:_UNO(".uno:XLineColor"),command:".uno:XLineColor"}]},{type:"toolbox",children:[
{id:"shape-tab-fillcolor:ColorPickerMenu",noLabel:true,type:"toolitem",text:_UNO(".uno:FillColor"),
command:".uno:FillColor"}]}],vertical:"true"},{type:"separator",id:"shape-fillcolor-break",
orientation:"vertical"},{type:"overflowgroup",id:"shape-wrap",name:_("Wrap"),accessibility:{
focusBack:false,combination:"SW",de:null},children:[{type:"container",children:[{type:"toolbox",
children:[{type:"toolitem",text:_UNO(".uno:WrapOff","text"),command:".uno:WrapOff"},{
type:"toolitem",text:_UNO(".uno:WrapOn","text"),command:".uno:WrapOn"},{type:"toolitem",text:_UNO(
".uno:WrapIdeal","text"),command:".uno:WrapIdeal"}]},{type:"toolbox",children:[{type:"toolitem",
text:_UNO(".uno:WrapLeft","text"),command:".uno:WrapLeft"},{type:"toolitem",text:_UNO(
".uno:WrapThrough","text"),command:".uno:WrapThrough"},{type:"toolitem",text:_UNO(".uno:WrapRight",
"text"),command:".uno:WrapRight"}]}],vertical:"true"}]},{type:"separator",
id:"shape-wrapright-break",orientation:"vertical"},{type:"overflowgroup",id:"shape-align",name:_(
"Align"),accessibility:{focusBack:false,combination:"SA",de:null},more:{
command:".uno:TransformDialog",accessibility:{focusBack:true,combination:"MS",de:null}},children:[{
type:"container",children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:ObjectAlignLeft"),command:".uno:ObjectAlignLeft"},{type:"toolitem",text:_UNO(
".uno:AlignCenter"),command:".uno:AlignCenter"},{type:"toolitem",text:_UNO(".uno:ObjectAlignRight"),
command:".uno:ObjectAlignRight"}]},{type:"toolbox",children:[{type:"toolitem",text:_UNO(
".uno:AlignUp"),command:".uno:AlignUp"},{type:"toolitem",text:_UNO(".uno:AlignMiddle"),
command:".uno:AlignMiddle"},{type:"toolitem",text:_UNO(".uno:AlignDown"),command:".uno:AlignDown"}]}
],vertical:"true"}]},{type:"separator",id:"shape-aligndown-break",orientation:"vertical"},{
type:"overflowgroup",id:"shape-arrange",name:_("Arrange"),accessibility:{focusBack:false,
combination:"AR",de:null},more:{command:".uno:TransformDialog",accessibility:{focusBack:true,
combination:"MR",de:null}},children:[{type:"container",children:[{type:"toolbox",children:[{
type:"toolitem",text:_UNO(".uno:BringToFront"),command:".uno:BringToFront"},{type:"toolitem",
text:_UNO(".uno:SendToBack"),command:".uno:SendToBack"}]},{type:"toolbox",children:[{
type:"toolitem",text:_UNO(".uno:ObjectForwardOne"),command:".uno:ObjectForwardOne"},{
type:"toolitem",text:_UNO(".uno:ObjectBackOne"),command:".uno:ObjectBackOne"}]}],vertical:"true"}]},
{type:"separator",id:"shape-objectbackone-break",orientation:"vertical"},{type:"overflowgroup",
id:"shape-group",name:_("Group"),accessibility:{focusBack:false,combination:"FG",de:null},children:[
{type:"bigtoolitem",text:_UNO(".uno:FormatGroup"),command:".uno:FormatGroup"},{type:"container",
children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:EnterGroup"),
command:".uno:EnterGroup"}]},{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:LeaveGroup"
),command:".uno:LeaveGroup"}]}],vertical:"true"}]}];return this.getTabPage(shapeTabName,content)},
getPictureTab:function(){var content=[{type:"overflowgroup",id:"picture-adjustments",name:_(
"Image Controls"),accessibility:{focusBack:false,combination:"BN",de:null},more:{
command:".uno:GraphicDialog",accessibility:{focusBack:true,combination:"MG",de:null}},children:[{
type:"container",children:[{id:"picture-brightness:PictureBrightness",type:"menubutton",
command:".uno:GrafLuminance",text:_UNO(".uno:GrafLuminance"),icon:"lc_setbrightness.svg",
accessibility:{focusBack:true,combination:"BN",de:null}},{id:"picture-contrast:PictureContrast",
type:"menubutton",command:".uno:GrafContrast",text:_UNO(".uno:GrafContrast"),
icon:"lc_setcontrast.svg",accessibility:{focusBack:true,combination:"CN",de:null}},{
id:"picture-colormode:PictureColorMode",type:"menubutton",command:".uno:GrafMode",text:_UNO(
".uno:GrafMode"),icon:"lc_setgraphtransparency.svg",accessibility:{focusBack:true,combination:"CO",
de:null}},{id:"picture-transparency:PictureTransparency",type:"menubutton",
command:".uno:GrafTransparence",text:_UNO(".uno:GrafTransparence"),
icon:"lc_setgraphtransparency.svg",accessibility:{focusBack:true,combination:"TP",de:null}}]}]},{
type:"separator",id:"picture-transparency-break",orientation:"vertical"},{type:"container",
children:[{type:"toolbox",children:[{id:"picture-tab-xlinecolor:ColorPickerMenu",type:"menubutton",
noLabel:true,text:_UNO(".uno:XLineColor"),command:".uno:XLineColor"}]},{type:"toolbox",children:[{
id:"picture-tab-fillcolor:ColorPickerMenu",type:"menubutton",noLabel:true,text:_UNO(".uno:FillColor"
),command:".uno:FillColor"}]}],vertical:"true"},{type:"separator",id:"picture-fillcolor-break",
orientation:"vertical"},{type:"bigtoolitem",text:_UNO(".uno:TransformDialog","text"),
command:".uno:TransformDialog"},{type:"separator",id:"picture-transformdialog-break",
orientation:"vertical"},{type:"container",children:[{type:"toolbox",children:[{type:"toolitem",
text:_UNO(".uno:FlipVertical"),command:".uno:FlipVertical"}]},{type:"toolbox",children:[{
type:"toolitem",text:_UNO(".uno:FlipHorizontal"),command:".uno:FlipHorizontal"}]}],vertical:"true"},
{type:"separator",id:"picture-fliphorizontal-break",orientation:"vertical"},{type:"overflowgroup",
id:"picture-wrap",name:_("Wrap"),accessibility:{focusBack:false,combination:"WR",de:null},children:[
{type:"container",children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:WrapOff",
"text"),command:".uno:WrapOff"},{type:"toolitem",text:_UNO(".uno:WrapOn","text"),
command:".uno:WrapOn"},{type:"toolitem",text:_UNO(".uno:WrapIdeal","text"),command:".uno:WrapIdeal"}
]},{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:WrapLeft","text"),
command:".uno:WrapLeft"},{type:"toolitem",text:_UNO(".uno:WrapThrough","text"),
command:".uno:WrapThrough"},{type:"toolitem",text:_UNO(".uno:WrapRight","text"),
command:".uno:WrapRight"}]}],vertical:"true"}]},{type:"separator",id:"picture-wrapright-break",
orientation:"vertical"},{type:"overflowgroup",id:"picture-align",name:_("Align"),accessibility:{
focusBack:false,combination:"BP",de:null},more:{command:".uno:GraphicDialog",accessibility:{
focusBack:true,combination:"MA",de:null}},children:[{type:"container",children:[{type:"toolbox",
children:[{type:"toolitem",text:_UNO(".uno:ObjectAlignLeft"),command:".uno:ObjectAlignLeft"},{
type:"toolitem",text:_UNO(".uno:AlignCenter"),command:".uno:AlignCenter"},{type:"toolitem",
text:_UNO(".uno:ObjectAlignRight"),command:".uno:ObjectAlignRight"}]},{type:"toolbox",children:[{
type:"toolitem",text:_UNO(".uno:AlignUp"),command:".uno:AlignUp"},{type:"toolitem",text:_UNO(
".uno:AlignMiddle"),command:".uno:AlignMiddle"},{type:"toolitem",text:_UNO(".uno:AlignDown"),
command:".uno:AlignDown"}]}],vertical:"true"}]},{type:"separator",id:"picture-aligndown-break",
orientation:"vertical"},{type:"overflowgroup",id:"picture-arrange",name:_("Arrange"),accessibility:{
focusBack:false,combination:"AB",de:null},more:{command:".uno:GraphicDialog",accessibility:{
focusBack:true,combination:"MR",de:null}},children:[{type:"container",children:[{type:"toolbox",
children:[{type:"toolitem",text:_UNO(".uno:BringToFront"),command:".uno:BringToFront"},{
type:"toolitem",text:_UNO(".uno:SendToBack"),command:".uno:SendToBack"}]},{type:"toolbox",children:[
{type:"toolitem",text:_UNO(".uno:ObjectForwardOne"),command:".uno:ObjectForwardOne"},{
type:"toolitem",text:_UNO(".uno:ObjectBackOne"),command:".uno:ObjectBackOne"}]}],vertical:"true"}]},
{type:"separator",id:"picture-objectbackone-break",orientation:"vertical"},{type:"overflowgroup",
id:"picture-group",name:_("Group"),accessibility:{focusBack:false,combination:"EG",de:null},
children:[{type:"bigtoolitem",text:_UNO(".uno:FormatGroup"),command:".uno:FormatGroup"},{
type:"container",children:[{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:EnterGroup"),
command:".uno:EnterGroup"}]},{type:"toolbox",children:[{type:"toolitem",text:_UNO(".uno:LeaveGroup"
),command:".uno:LeaveGroup"}]}],vertical:"true"}]},{type:"separator",id:"picture-leavegroup-break",
orientation:"vertical"},{type:"bigtoolitem",text:_UNO(".uno:Crop"),command:".uno:Crop",
context:"Graphic"}];return this.getTabPage(pictureTabName,content)},getNotebookbar:function(tabPages
,selectedPage){return{id:"",type:"control",text:"",enabled:"true",children:[{id:"NotebookBar",
type:"container",text:"",enabled:"true",children:[{id:"ContextContainer",type:"tabcontrol",
noCoreEvents:true,text:"",enabled:"true",selected:selectedPage,children:tabPages}]}]}},
cleanOpts:function(children){var that=this;return children.map(function(c){if(!c.type){return null}
var uiManager=that.map.uiManager;if(!uiManager.isButtonVisible(c.id)){return null}if(
!uiManager.isCommandVisible(c.command)){return null}var opts=Object.assign(c,{});if(
c.children&&c.children.length){opts.children=that.cleanOpts(c.children)}return opts}).filter(
function(c){return c!==null})},getTabPage:function(tabName,content){return{id:"",type:"tabpage",
text:"",enabled:"true",children:[{id:tabName+"-container",type:"overflowmanager",text:"",
enabled:"true",children:this.cleanOpts(content)}]}}});window.L.control.notebookbarWriter=function(
options){return new window.L.Control.NotebookbarWriter(options)};
window.L.Control.NotebookbarCalc=window.L.Control.NotebookbarWriter.extend({getTabs:function(){
return[{id:"File-tab-label",text:_("File"),name:"File",accessibility:{focusBack:true,
combination:"F",de:null}},{id:this.HOME_TAB_ID,text:_("Home"),name:"Home",
context:"default|Cell|Text|DrawText",accessibility:{focusBack:true,combination:"H",de:null}},{
id:"Insert-tab-label",text:_("Insert"),name:"Insert",accessibility:{focusBack:true,combination:"N",
de:null}},{id:"Layout-tab-label",text:_("Page Layout"),name:"Layout",accessibility:{focusBack:true,
combination:"P",de:null}},{id:"Formula-tab-label",text:_("Formulas"),name:"Formulas",accessibility:{
focusBack:true,combination:"Z",de:null}},{id:"Data-tab-label",text:_("Data"),name:"Data",
accessibility:{focusBack:true,combination:"A",de:null}},{id:"Review-tab-label",text:_("Review"),
name:"Review",accessibility:{focusBack:true,combination:"R",de:null}},{id:"Format-tab-label",text:_(
"Format"),name:"Format",accessibility:{focusBack:true,combination:"M",de:null}},{
id:"Shape-tab-label",text:_("Shape"),name:"Shape",
context:"Draw|DrawLine|3DObject|MultiObject|DrawFontwork",accessibility:{focusBack:true,
combination:"D",de:null}},{id:"Picture-tab-label",text:_("Picture"),name:"Picture",
context:"Graphic",accessibility:{focusBack:true,combination:"G",de:null}},{id:"View-tab-label",
text:_("View"),name:"View",accessibility:{focusBack:true,combination:"W",de:null}},{
id:"Sparkline-tab-label",text:_("Sparkline"),name:"Sparkline",context:"Sparkline",accessibility:{
focusBack:true,combination:"K",de:null}},{id:"Help-tab-label",text:_("Help"),name:"Help",
accessibility:{focusBack:true,combination:"Y",de:null}}]},getTabsJSON:function(){return[
this.getFileTab(),this.getHomeTab(),this.getInsertTab(),this.getLayoutTab(),this.getFormulaTab(),
this.getDataTab(),this.getReviewTab(),this.getFormatTab(),this.getShapeTab(),this.getPictureTab(),
this.getViewTab(),this.getSparklineTab(),this.getHelpTab()]},getFullJSON:function(selectedId){
return this.getNotebookbar(this.getTabsJSON(),selectedId)},getFileTab:function(){var content=[];
var hasSave=!this.map["wopi"].HideSaveOption;var hasSaveAs=!this.map["wopi"].UserCanNotWriteRelative
var hasShare=this.map["wopi"].EnableShare;var hasRevisionHistory=window.L.Params.revHistoryEnabled;
if(hasSave){content.push({type:"container",children:[{id:"file-save",type:"bigtoolitem",text:_UNO(
".uno:Save"),command:".uno:Save",accessibility:{focusBack:true,combination:"S",de:null}}]})}if(
hasSaveAs){content.push(window.prefs.get("saveAsMode")==="group"?{id:"saveas:SaveAsMenu",
command:"saveas",class:"unosaveas",type:"exportmenubutton",text:_("Save As"),accessibility:{
focusBack:true,combination:"A",de:null}}:{id:"file-saveas",type:"bigtoolitem",text:_UNO(
".uno:SaveAs","spreadsheet"),command:".uno:SaveAs",accessibility:{focusBack:true,combination:"A",
de:null}})}if(hasSaveAs){content.push({id:"exportas:ExportAsMenu",command:"exportas",
class:"unoexportas",type:"exportmenubutton",text:_("Export As"),accessibility:{focusBack:true,
combination:"E",de:null}})}if(hasShare&&hasRevisionHistory){content.push({id:"file-exportas-break",
type:"separator",orientation:"vertical"},{type:"container",children:[{id:"ShareAs",
class:"unoShareAs",type:"customtoolitem",text:_("Share"),command:"shareas",inlineLabel:true,
accessibility:{focusBack:true,combination:"SH"}},{id:"Rev-History",class:"unoRev-History",
type:"customtoolitem",text:_("See history"),command:"rev-history",inlineLabel:true,accessibility:{
focusBack:true,combination:"RH"}}],vertical:true},{id:"file-revhistory-break",type:"separator",
orientation:"vertical"})}else if(hasShare){content.push({id:"file-exportas-break",type:"separator",
orientation:"vertical"},{type:"container",children:[{id:"ShareAs",class:"unoShareAs",
type:"bigcustomtoolitem",text:_("Share"),command:"shareas",accessibility:{focusBack:true,
combination:"SH"}}]},{id:"file-shareas-break",type:"separator",orientation:"vertical"})}else if(
hasRevisionHistory){content.push({id:"file-exportas-break",type:"separator",orientation:"vertical"},
{type:"container",children:[{id:"Rev-History",class:"unoRev-History",type:"bigcustomtoolitem",
text:_("See history"),command:"rev-history",accessibility:{focusBack:true,combination:"RH"}}]},{
id:"file-revhistory-break",type:"separator",orientation:"vertical"})}if(!this.map["wopi"
].HidePrintOption){content.push({id:"Data-Print:Print",type:"menubutton",text:"Печать",command:".uno:Print",applyCallback:"print",accessibility:{focusBack:true,
combination:"PT",de:null}})}if(window.enableMacrosExecution){content.push({type:"toolbox",children:[
{id:"runmacro",type:"bigtoolitem",text:_UNO(".uno:RunMacro","text"),command:".uno:RunMacro",
accessibility:{focusBack:true,combination:"M",de:null}}]})}if(!this.map["wopi"].HideExportOption){
content.push({id:"downloadas:DownloadAsMenu",command:"downloadas",class:"unodownloadas",
type:"exportmenubutton",text:_("Download"),accessibility:{focusBack:true,combination:"DA",de:null}})
}content.push({type:"separator",id:"file-downloadas-break",orientation:"vertical"});if(!this.map[
"wopi"].HideRepairOption){content.push({type:"container",children:[{id:"repair",class:"unorepair",
type:"bigcustomtoolitem",text:_("Repair"),accessibility:{focusBack:true,combination:"RP",de:null}}],
vertical:"true"})}content.push({type:"container",children:[{id:"properties",type:"bigtoolitem",
text:_("Properties"),command:".uno:SetDocumentProperties",accessibility:{focusBack:true,
combination:"FP",de:"I"}}]});if(window.documentSigningEnabled){content.push({type:"container",
children:[{id:"signature",type:"bigtoolitem",text:_("Signature"),command:".uno:Signature",
accessibility:{focusBack:true,combination:"SN"}}]})}if(this._map["wopi"]._supportsRename(
)&&this._map["wopi"].UserCanRename){content.push({type:"container",children:[{id:"renamedocument",
class:"unoRenameDocument",type:"bigcustomtoolitem",text:_("Rename"),accessibility:{focusBack:true,
combination:"RN",de:null}}]})}if(window.wopiSettingBaseUrl){content.push({type:"separator",
id:"file-properties-break",orientation:"vertical"});content.push({id:"settings-dialog",
type:"bigtoolitem",text:_("Options"),command:".uno:Settings",accessibility:{focusBack:false,
combination:"T",de:null}})}return this.getTabPage("File",content)},getHomeTab:function(){
var content=[{id:"home-undo-redo",type:"container",children:[{id:"home-undo",type:"toolitem",
text:_UNO(".uno:Undo"),command:".uno:Undo",accessibility:{focusBack:true,combination:"ZZ",de:null}},
{id:"home-redo",type:"toolitem",text:_UNO(".uno:Redo"),command:".uno:Redo",accessibility:{
focusBack:true,combination:"O",de:null}}],vertical:"true"},{type:"separator",
id:"home-undoredo-break",orientation:"vertical"},{type:"overflowgroup",id:"home-clipboard",name:_(
"Clipboard"),accessibility:{focusBack:true,combination:"V",de:null},children:[{
id:"home-paste:PasteMenu",type:"menubutton",text:_UNO(".uno:Paste"),command:".uno:Paste",
accessibility:{focusBack:true,combination:"V",de:null}},{type:"container",children:[{type:"toolbox",
children:[{id:"home-cut",type:"customtoolitem",text:_UNO(".uno:Cut",true),command:".uno:Cut",
accessibility:{focusBack:true,combination:"X",de:null}},{id:"home-format-paint-brush",
type:"toolitem",text:_UNO(".uno:FormatPaintbrush"),command:".uno:FormatPaintbrush",accessibility:{
focusBack:true,combination:"FP",de:null}}]},{type:"toolbox",children:[{id:"home-copy",
type:"customtoolitem",text:_UNO(".uno:Copy",true),command:".uno:Copy",accessibility:{focusBack:true,
combination:"C",de:null}},{id:"home-reset-attributes",type:"toolitem",text:_UNO(
".uno:ResetAttributes"),command:".uno:ResetAttributes",accessibility:{focusBack:true,
combination:"E",de:null}}]}],vertical:"true"}]},{type:"separator",id:"home-resertattributes-break",
orientation:"vertical"},{type:"overflowgroup",id:"home-font",name:_("Font"),accessibility:{
focusBack:true,combination:"FF",de:null},more:{command:".uno:CellTextDlg",accessibility:{
focusBack:true,combination:"MF",de:null}},children:[{id:"Home-Section-Format",type:"container",
children:[{id:"box76",type:"container",children:[{id:"fontnamecombobox",type:"combobox",
text:"Carlito",entries:["Carlito"],selectedCount:"1",selectedEntries:["71"],
command:".uno:CharFontName",accessibility:{focusBack:true,combination:"FF",de:null}},{
id:"fontsizecombobox",type:"combobox",text:"10 pt",entries:["10 pt"],selectedCount:"1",
selectedEntries:["4"],command:".uno:FontHeight",accessibility:{focusBack:true,combination:"FS",
de:null}},{id:"home-grow",type:"toolitem",text:_UNO(".uno:Grow"),command:".uno:Grow",accessibility:{
focusBack:true,combination:"FG",de:null}},{id:"home-shrink",type:"toolitem",text:_UNO(".uno:Shrink"
),command:".uno:Shrink",accessibility:{focusBack:true,combination:"FK",de:null}}],vertical:"false"},
{id:"GroupB11",type:"container",children:[{id:"home-bold",type:"toolitem",text:_UNO(".uno:Bold"),
command:".uno:Bold",accessibility:{focusBack:true,combination:"1",de:null}},{id:"home-italic",
type:"toolitem",text:_UNO(".uno:Italic"),command:".uno:Italic",accessibility:{focusBack:true,
combination:"2",de:null}},{id:"home-underline",type:"toolitem",text:_UNO(".uno:Underline"),
command:".uno:Underline",accessibility:{focusBack:true,combination:"3",de:null}},{
id:"home-strikeout",type:"toolitem",text:_UNO(".uno:Strikeout"),command:".uno:Strikeout",
accessibility:{focusBack:true,combination:"4",de:null}},{id:"home-subscript",type:"toolitem",
text:_UNO(".uno:SubScript"),command:".uno:SubScript",accessibility:{focusBack:true,combination:"5",
de:null}},{id:"home-superscript",type:"toolitem",text:_UNO(".uno:SuperScript"),
command:".uno:SuperScript",accessibility:{focusBack:true,combination:"6",de:null}},{
id:"home-set-border-style:BorderStyleMenu",type:"menubutton",noLabel:true,text:_UNO(
".uno:SetBorderStyle"),command:".uno:SetBorderStyle",applyCallback:"defaultborderstyle",
accessibility:{focusBack:true,combination:"B",de:null}},{id:"home-background-color:ColorPickerMenu",
noLabel:true,class:"unospan-BackgroundColor",type:"toolitem",text:_UNO(".uno:BackgroundColor"),
command:".uno:BackgroundColor",accessibility:{focusBack:true,combination:"H",de:null}},{
id:"home-color:ColorPickerMenu",noLabel:true,class:"unospan-FontColor",type:"toolitem",text:_UNO(
".uno:Color"),command:".uno:Color",accessibility:{focusBack:true,combination:"FC",de:null}}],
vertical:"false"}],vertical:"true"}]},{type:"separator",id:"home-fontcombobox-break",
orientation:"vertical"},{type:"overflowgroup",id:"home-alignment",name:_("Alignment"),
accessibility:{focusBack:true,combination:"AT",de:null},more:{command:".uno:Hyphenate",
accessibility:{focusBack:true,combination:"MA",de:null}},children:[{id:"Home-Section-Align",
type:"container",children:[{id:"GroupB15",type:"container",children:[{id:"first6",type:"toolbox",
children:[{id:"home-align-top",type:"toolitem",text:_UNO(".uno:AlignTop","spreadsheet"),
command:".uno:AlignTop",accessibility:{focusBack:true,combination:"AT",de:null}},{
id:"home-align-vertical-center",type:"toolitem",text:_UNO(".uno:AlignVCenter","spreadsheet"),
command:".uno:AlignVCenter",accessibility:{focusBack:true,combination:"AM",de:null}},{
id:"home-align-bottom",type:"toolitem",text:_UNO(".uno:AlignBottom","spreadsheet"),
command:".uno:AlignBottom",accessibility:{focusBack:true,combination:"AB",de:null}},{
id:"home-increment-indent",type:"toolitem",text:_UNO(".uno:IncrementIndent"),
command:".uno:IncrementIndent",accessibility:{focusBack:true,combination:"7",de:null}},{
id:"home-decrement-indent",type:"toolitem",text:_UNO(".uno:DecrementIndent"),
command:".uno:DecrementIndent",accessibility:{focusBack:true,combination:"8",de:null}},{
id:"home-para-left-to-right",type:"toolitem",text:_UNO(".uno:ParaLeftToRight"),
command:".uno:ParaLeftToRight",accessibility:{focusBack:true,combination:"RL",de:null}}]}],
vertical:"false"},{id:"GroupB16",type:"container",children:[{id:"second6",type:"toolbox",children:[{
id:"home-align-left",type:"toolitem",text:_UNO(".uno:AlignLeft","spreadsheet"),
command:".uno:AlignLeft",accessibility:{focusBack:true,combination:"AL",de:null}},{
id:"home-align-horizontal-center",type:"toolitem",text:_UNO(".uno:AlignHorizontalCenter",
"spreadsheet"),command:".uno:AlignHorizontalCenter",accessibility:{focusBack:true,combination:"AC",
de:null}},{id:"home-align-right",type:"toolitem",text:_UNO(".uno:AlignRight","spreadsheet"),
command:".uno:AlignRight",accessibility:{focusBack:true,combination:"AR",de:null}},{
id:"home-align-block",type:"toolitem",text:_UNO(".uno:AlignBlock","spreadsheet"),
command:".uno:AlignBlock",accessibility:{focusBack:true,combination:"AO",de:null}},{
id:"home-wrap-text",type:"toolitem",text:_UNO(".uno:WrapText","spreadsheet"),
command:".uno:WrapText",accessibility:{focusBack:true,combination:"W",de:null}},{
id:"home-para-right-to-left",type:"toolitem",text:_UNO(".uno:ParaRightToLeft"),
command:".uno:ParaRightToLeft",accessibility:{focusBack:true,combination:"RR",de:null}}]}],
vertical:"false"}],vertical:"true"},{id:"home-merge-cells",type:"bigtoolitem",text:_(
"Merge & Center"),command:".uno:ToggleMergeCells",accessibility:{focusBack:true,combination:"MC",
de:null}}]},{type:"separator",id:"home-pararighttoleft-break",orientation:"vertical"},{
type:"overflowgroup",id:"home-number-format",name:_("Number"),accessibility:{focusBack:true,
combination:"N",de:null},more:{command:".uno:FormatCellDialog",accessibility:{focusBack:true,
combination:"MN",de:null}},children:[{id:"Home-Section-Number",type:"container",children:[{
id:"numbertype",type:"listbox",entries:[_("General"),_("Number"),_("Percent"),_("Currency"),_("Date"
),_("Time"),_("Scientific"),_("Fraction"),_("Boolean Value"),_("Text")],selectedCount:"1",
selectedEntries:["0"],accessibility:{focusBack:true,combination:"N",de:null}},{id:"GroupB22",
type:"container",children:[{id:"WeldedToolbar",type:"toolbox",children:[{
id:"home-number-format-currency",type:"toolitem",dropdown:true,text:_UNO(".uno:NumberFormatCurrency"
,"spreadsheet"),command:".uno:NumberFormatCurrency",accessibility:{focusBack:true,combination:"P",
de:null}}]},{id:"home-number-format-percent-decimal",type:"toolbox",children:[{
id:"home-number-format-percent",type:"toolitem",text:_UNO(".uno:NumberFormatPercent","spreadsheet"),
command:".uno:NumberFormatPercent",accessibility:{focusBack:true,combination:"AN",de:null}},{
id:"home-number-format-decimal",type:"toolitem",text:_UNO(".uno:NumberFormatDecimal","spreadsheet"),
command:".uno:NumberFormatDecimal",accessibility:{focusBack:true,combination:"K",de:null}}]},{
id:"second2",type:"toolbox",children:[{id:"home-number-format-increment-decimals",type:"toolitem",
text:_UNO(".uno:NumberFormatIncDecimals","spreadsheet"),command:".uno:NumberFormatIncDecimals",
accessibility:{focusBack:true,combination:"0",de:null}},{id:"home-number-format-decrement-decimals",
type:"toolitem",text:_UNO(".uno:NumberFormatDecDecimals","spreadsheet"),
command:".uno:NumberFormatDecDecimals",accessibility:{focusBack:true,combination:"9",de:null}}]}],
vertical:"false"}],vertical:"true"}]},{type:"separator",
id:"home-numberformatdecrementdecimals-break",orientation:"vertical"},{type:"overflowgroup",
id:"home-insert-table",name:_("Cells"),accessibility:{focusBack:true,combination:"RB",de:null},
children:[{id:"Home-Section-Cell1",type:"container",children:[{id:"LineA10",type:"toolbox",
children:[{id:"home-insert-rows-before",type:"toolitem",text:_UNO(".uno:InsertRowsBefore",
"spreadsheet",true),command:".uno:InsertRowsBefore",accessibility:{focusBack:true,combination:"RB",
de:null}},{id:"home-insert-rows-after",type:"toolitem",text:_UNO(".uno:InsertRowsAfter",
"spreadsheet",true),command:".uno:InsertRowsAfter",accessibility:{focusBack:true,combination:"RA",
de:null}},{id:"home-delete-rows",type:"toolitem",text:_UNO(".uno:DeleteRows","spreadsheet"),
command:".uno:DeleteRows",accessibility:{focusBack:true,combination:"RD",de:null}},{
id:"home-row-operations",type:"toolitem",text:_UNO(".uno:RowOperations","spreadsheet"),
command:".uno:RowOperations"}]},{id:"LineB11",type:"toolbox",children:[{
id:"home-insert-columns-before",type:"toolitem",text:_UNO(".uno:InsertColumnsBefore","spreadsheet",
true),command:".uno:InsertColumnsBefore",accessibility:{focusBack:true,combination:"UB",de:null}},{
id:"home-insert-columns-after",type:"toolitem",text:_UNO(".uno:InsertColumnsAfter","spreadsheet",
true),command:".uno:InsertColumnsAfter",accessibility:{focusBack:true,combination:"UA",de:null}},{
id:"home-delete-columns",type:"toolitem",text:_UNO(".uno:DeleteColumns","spreadsheet"),
command:".uno:DeleteColumns",accessibility:{focusBack:true,combination:"UD",de:null}},{
id:"home-column-operations",type:"toolitem",text:_UNO(".uno:ColumnOperations","spreadsheet"),
command:".uno:ColumnOperations"}]}],vertical:"true"}]},{type:"separator",
id:"home-columnoperations-break",orientation:"vertical"},{type:"overflowgroup",id:"home-style",
name:_("Style"),accessibility:{focusBack:true,combination:"L",de:null},children:[{
id:"home-conditional-format-menu:ConditionalFormatMenu",type:"menubutton",text:_UNO(
".uno:ConditionalFormatMenu","spreadsheet"),command:".uno:ConditionalFormatMenu",accessibility:{
focusBack:true,combination:"L",de:null}},{id:"Home-Section-Style2",type:"container",children:[{
id:"SectionBottom102",type:"toolbox",children:[{id:"StyleApplyDefault",type:"toolitem",text:_(
"Default"),command:".uno:StyleApply?Style:string=Default&FamilyName:string=CellStyles",
accessibility:{focusBack:true,combination:"AD",de:null}},{id:"StyleApplyHeading1",type:"toolitem",
text:_("Heading 1"),command:".uno:StyleApply?Style:string=Heading 1&FamilyName:string=CellStyles",
accessibility:{focusBack:true,combination:"D1",de:null}},{id:"StyleApplyHeading2",type:"toolitem",
text:_("Heading 2"),command:".uno:StyleApply?Style:string=Heading 2&FamilyName:string=CellStyles",
accessibility:{focusBack:true,combination:"D2",de:null}}]},{id:"SectionBottom7",type:"toolbox",
children:[{id:"StyleApplyGood",type:"toolitem",text:_("Good"),
command:".uno:StyleApply?Style:string=Good&FamilyName:string=CellStyles",accessibility:{
focusBack:true,combination:"TG",de:null}},{id:"StyleApplyNeutral",type:"toolitem",text:_("Neutral"),
command:".uno:StyleApply?Style:string=Neutral&FamilyName:string=CellStyles",accessibility:{
focusBack:true,combination:"TN",de:null}},{id:"StyleApplyBad",type:"toolitem",text:_("Bad"),
command:".uno:StyleApply?Style:string=Bad&FamilyName:string=CellStyles",accessibility:{
focusBack:true,combination:"TB",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"home-styleapplybad-break",orientation:"vertical"},{type:"overflowgroup",id:"home-find-n-filter",
name:_("Editing"),accessibility:{focusBack:true,combination:"SS",de:null},children:[{
type:"container",children:[{type:"toolbox",children:[{id:"home-search",class:"unoSearch",
type:"customtoolitem",text:_("Search"),accessibility:{focusBack:false,combination:"SS",de:"SS"}}]},{
type:"toolbox",children:[{id:"home-search-dialog",type:"toolitem",text:_("Replace"),
command:".uno:SearchDialog?InitialFocusReplace:bool=true",accessibility:{focusBack:false,
combination:"FD",de:null}}]}],vertical:"true"},{id:"Home-Section-Find",type:"container",children:[{
id:"LineA17",type:"toolbox",children:[{id:"home-data-sort",type:"toolitem",text:_UNO(".uno:DataSort"
,"spreadsheet"),command:".uno:DataSort",accessibility:{focusBack:true,combination:"S",de:null}}]},{
id:"LineB19",type:"toolbox",children:[{id:"home-data-filter-auto-filter",type:"toolitem",text:_UNO(
".uno:DataFilterAutoFilter","spreadsheet"),command:".uno:DataFilterAutoFilter",accessibility:{
focusBack:true,combination:"FI",de:null}}]}],vertical:"true"}]}];return this.getTabPage("Home",
content)},getLayoutTab:function(){var content=[{type:"overflowgroup",id:"layout-page",name:_(
"Page Setup"),accessibility:{focusBack:true,combination:"PS",de:"K"},more:{
command:".uno:PageFormatDialog",accessibility:{focusBack:true,combination:"PS",de:"K"}},children:[{
id:"Layout-MarginMenu:MenuMargins",type:"menubutton",text:_("Margin"),enabled:"true",accessibility:{
focusBack:true,combination:"M",de:"8"}},{id:"Layout-SizeMenu:MenuPageSizesCalc",type:"menubutton",
text:_("Size"),enabled:"true",accessibility:{focusBack:true,combination:"SZ",de:"R"}},{
id:"Layout-OrientationMenu:MenuOrientation",type:"menubutton",text:"Ориентация",
enabled:"true",accessibility:{focusBack:true,combination:"O",de:"4"}},{
id:"Layout-PrintRangesMenu:MenuPrintRanges",type:"menubutton",text:_UNO(".uno:PrintRangesMenu",
"spreadsheet"),enabled:"true",accessibility:{focusBack:true,combination:"R",de:"H"}}]},{
type:"separator",id:"layout-pageformatdialog-break",orientation:"vertical"},{
id:"layout-sheet-right-to-left",type:"bigtoolitem",text:_UNO(".uno:SheetRightToLeft","spreadsheet"),
command:".uno:SheetRightToLeft",accessibility:{focusBack:true,combination:"RL",de:null}},{
type:"separator",id:"layout-sheetrighttoleft-break",orientation:"vertical"},{type:"overflowgroup",
id:"layout-grid",name:_("Grid"),accessibility:{focusBack:true,combination:"SG",de:null},children:[{
type:"container",children:[{id:"view-togglegrid",type:"bigtoolitem",text:_UNO(".uno:ToggleSheetGrid"
,"spreadsheet"),command:".uno:ToggleSheetGrid",accessibility:{focusBack:true,combination:"SG",
de:null}},{id:"view-toggleprintgrid",type:"bigtoolitem",text:_UNO(".uno:TogglePrintGrid",
"spreadsheet"),command:".uno:TogglePrintGrid",accessibility:{focusBack:true,combination:"PG",de:null
}}]}]},{type:"separator",id:"layout-printrangesmenu-break",orientation:"vertical"},{
id:"Data-RowMenuHeight:MenuRowHeight",class:"unoData-RowMenuHeight",type:"menubutton",text:_(
"Row Height"),enabled:"true",accessibility:{focusBack:true,combination:"RH",de:null}},{
id:"Data-ColumnMenuWidth:MenuColumnWidth",class:"unoData-ColumnMenuWidth",type:"menubutton",text:_(
"Column Width"),enabled:"true",accessibility:{focusBack:true,combination:"CW",de:null}},{
type:"separator",id:"layout-columnmenuwidth-break",orientation:"vertical"},{type:"overflowgroup",
id:"layout-insert-table",name:_("Insert"),accessibility:{focusBack:true,combination:"RB",de:null},
children:[{type:"container",children:[{type:"toolbox",children:[{id:"layout-insert-rows-before",
type:"toolitem",text:_("Insert Rows Above"),command:".uno:InsertRowsBefore",accessibility:{
focusBack:true,combination:"RB",de:null}},{id:"layout-insert-columns-before",type:"toolitem",text:_(
"Insert Columns Before"),command:".uno:InsertColumnsBefore",accessibility:{focusBack:true,
combination:"CB",de:null}},{id:"layout-delete-rows",type:"toolitem",text:_("Delete Rows"),
command:".uno:DeleteRows",accessibility:{focusBack:true,combination:"RD",de:null}}]},{
type:"toolbox",children:[{id:"layout-insert-rows-after",type:"toolitem",text:_("Insert Rows Below"),
command:".uno:InsertRowsAfter",accessibility:{focusBack:true,combination:"RA",de:null}},{
id:"layout-insert-columns-after",type:"toolitem",text:_("Insert Columns After"),
command:".uno:InsertColumnsAfter",accessibility:{focusBack:true,combination:"CA",de:null}},{
id:"layout-delete-columns",type:"toolitem",text:_("Delete Columns"),command:".uno:DeleteColumns",
accessibility:{focusBack:true,combination:"CD",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"layout-deletecolumns-break",orientation:"vertical"},{id:"layout-select-all",type:"bigtoolitem",
text:_UNO(".uno:SelectAll"),command:".uno:SelectAll",accessibility:{focusBack:true,combination:"SA",
de:null}},{type:"separator",id:"layout-selectall-break",orientation:"vertical"},{
type:"overflowgroup",id:"layout-align",name:_("Align"),accessibility:{focusBack:true,
combination:"AL",de:null},children:[{id:"Layout-Section-Align",type:"container",children:[{
id:"Layout-ObjectAlignLeft-ObjectAlignRight",type:"toolbox",children:[{
id:"layout-object-align-left",type:"toolitem",text:_UNO(".uno:ObjectAlignLeft","text"),
command:".uno:ObjectAlignLeft",accessibility:{focusBack:true,combination:"AL",de:null}},{
id:"layout-align-center",type:"toolitem",text:_UNO(".uno:AlignCenter","text"),
command:".uno:AlignCenter",accessibility:{focusBack:true,combination:"AC",de:null}},{
id:"layout-align-right",type:"toolitem",text:_UNO(".uno:ObjectAlignRight","text"),
command:".uno:ObjectAlignRight",accessibility:{focusBack:true,combination:"AR",de:null}}]},{
id:"Layout-AlignUp-AlignDown",type:"toolbox",children:[{id:"layout-align-up",type:"toolitem",
text:_UNO(".uno:AlignUp","text"),command:".uno:AlignUp",accessibility:{focusBack:true,
combination:"AU",de:null}},{id:"layout-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle",
"text"),command:".uno:AlignMiddle",accessibility:{focusBack:true,combination:"AM",de:null}},{
id:"layout-align-down",type:"toolitem",text:_UNO(".uno:AlignDown","text"),command:".uno:AlignDown",
accessibility:{focusBack:true,combination:"AD",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"layout-aligndown-break",orientation:"vertical"},{type:"overflowgroup",id:"layout-arrange",
name:_("Arrange"),accessibility:{focusBack:true,combination:"FO",de:null},children:[{
id:"Layout-Section-ForwardBackward",type:"container",children:[{
id:"Layout-ObjectForwardOne-BringToFront",type:"toolbox",children:[{id:"layout-object-forward-one",
type:"toolitem",text:_UNO(".uno:ObjectForwardOne","text"),command:".uno:ObjectForwardOne",
accessibility:{focusBack:true,combination:"FO",de:null}},{id:"layout-bring-to-front",
type:"toolitem",text:_UNO(".uno:BringToFront","text"),command:".uno:BringToFront",accessibility:{
focusBack:true,combination:"AF",de:null}}]},{id:"Layout-ObjectBackOne-SendToBack",type:"toolbox",
children:[{id:"layout-object-back-one",type:"toolitem",text:_UNO(".uno:ObjectBackOne","text"),
command:".uno:ObjectBackOne",accessibility:{focusBack:true,combination:"BO",de:null}},{
id:"layout-send-to-back",type:"toolitem",text:_UNO(".uno:SendToBack","text"),
command:".uno:SendToBack",accessibility:{focusBack:true,combination:"AE",de:null}}]}],
vertical:"true"}]}];return this.getTabPage("Layout",content)},getViewTab:function(){var content=[{
type:"overflowgroup",id:"view-freeze",name:_("Freeze"),accessibility:{focusBack:true,
combination:"FP",de:null},children:[{id:"layout-freeze-panes",type:"bigtoolitem",text:_UNO(
".uno:FreezePanes","spreadsheet",true),command:".uno:FreezePanes",accessibility:{focusBack:true,
combination:"FP",de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"layout-freeze-panes-column",type:"toolitem",text:_UNO(".uno:FreezePanesColumn","spreadsheet",
true),command:".uno:FreezePanesColumn",accessibility:{focusBack:true,combination:"FC",de:null}}]},{
type:"toolbox",children:[{id:"layout-freeze-panes-row",type:"toolitem",text:_UNO(
".uno:FreezePanesRow","spreadsheet",true),command:".uno:FreezePanesRow",accessibility:{
focusBack:true,combination:"FR",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"layout-freezepanesrow-break",orientation:"vertical"},{id:"colrowhighlight",
type:"bigcustomtoolitem",text:_("Focus Cell"),command:"columnrowhighlight",accessibility:{
focusBack:true,combination:"HL",de:null}},{type:"separator",id:"layout-colrowhighlight-break",
orientation:"vertical"},{type:"overflowgroup",id:"view-zoom",name:_("Zoom"),accessibility:{
focusBack:true,combination:"FS",de:null},children:[window.mode.isTablet()?{id:"closemobile",
type:"bigcustomtoolitem",text:_("Read mode"),command:"closetablet"}:{},{id:"fullscreen",
type:"bigtoolitem",text:_UNO(".uno:FullScreen"),command:".uno:FullScreen",accessibility:{
focusBack:true,combination:"FS",de:null}},{id:"zoomreset",class:"unozoomreset",
type:"bigcustomtoolitem",text:_("Reset zoom"),accessibility:{focusBack:true,combination:"J",de:null}
},{type:"container",children:[{type:"toolbox",children:[{id:"zoomout",class:"unozoomout",
type:"customtoolitem",text:_UNO(".uno:ZoomMinus"),accessibility:{focusBack:true,combination:"ZO",
de:null}}]},{type:"toolbox",children:[{id:"zoomin",class:"unozoomin",type:"customtoolitem",
text:_UNO(".uno:ZoomPlus"),accessibility:{focusBack:true,combination:"ZI",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"layout-zoomin-break",orientation:"vertical"},{
id:"toggleuimode",class:"unotoggleuimode",type:"bigcustomtoolitem",text:_("Compact view"),
accessibility:{focusBack:true,combination:"UI",de:null}},{type:"container",children:[{
type:"toolbox",children:[{id:"collapsenotebookbar",class:"unocollapsenotebookbar",
type:"customtoolitem",text:_("Collapse Tabs"),accessibility:{focusBack:true,combination:"CT",de:null
}}]},{type:"toolbox",children:[{id:"showstatusbar",class:"unoshowstatusbar",type:"customtoolitem",
text:_("Status Bar"),accessibility:{focusBack:true,combination:"SB",de:null}}]}],vertical:"true"},{
type:"separator",id:"layout-showstatusbar-break",orientation:"vertical"},{id:"toggledarktheme",
class:"unotoggledarktheme",type:"bigcustomtoolitem",text:_("Dark Mode"),accessibility:{
focusBack:true,combination:"DT",de:null}},{id:"invertbackground",class:"unoinvertbackground",
type:"bigcustomtoolitem",text:_("Invert Background"),accessibility:{focusBack:true,combination:"BG",
de:null}},{type:"separator",id:"layout-invertbackground-break",orientation:"vertical"},{
id:"view-sidebardeck",type:"bigtoolitem",text:_UNO(".uno:Sidebar"),
command:".uno:SidebarDeck.PropertyDeck",accessibility:{focusBack:true,combination:"SD",de:null}},{
id:"view-navigator",type:"bigtoolitem",text:_UNO(".uno:Navigator"),command:".uno:Navigator",
accessibility:{focusBack:true,combination:"N",de:null}}];return this.getTabPage("View",content)},
getSparklineTab:function(){var content=[{id:"Sparkline-EditSparkline:EditSparklineMenu",
class:"unoData-EditSparkline",type:"menubutton",text:_UNO(".uno:EditSparkline","spreadsheet"),
accessibility:{focusBack:true,combination:"ES",de:null}},{type:"separator",
id:"sparkline-edit-break",orientation:"vertical"},{id:"groupsparklines",type:"bigtoolitem",text:_(
"Group"),command:".uno:GroupSparklines",accessibility:{focusBack:true,combination:"GS",de:null}},{
id:"ungroupsparklines",type:"bigtoolitem",text:_("Ungroup"),command:".uno:UngroupSparklines",
accessibility:{focusBack:true,combination:"US",de:null}},{type:"separator",
id:"sparkline-group-break",orientation:"vertical"},{
id:"Sparkline-DeleteSparkline:DeleteSparklineMenu",class:"unoData-DeleteSparkline",
type:"menubutton",text:_UNO(".uno:DeleteSparkline","spreadsheet"),accessibility:{focusBack:true,
combination:"DS",de:null}}];return this.getTabPage("Sparkline",content)},getInsertTab:function(){
var content=[{type:"overflowgroup",id:"insert-pivot-table",name:_("Pivot Table"),accessibility:{
focusBack:true,combination:"V",de:null},children:[{id:"insert-data-pilot-run",type:"bigtoolitem",
text:_UNO(".uno:DataDataPilotRun","spreadsheet"),command:".uno:DataDataPilotRun",accessibility:{
focusBack:true,combination:"V",de:null}},{id:"Insert-Section-PivotTable-Ext",type:"container",
children:[{id:"LineA152",type:"toolbox",children:[{id:"insert-recalc-pivot-table",type:"toolitem",
text:_UNO(".uno:RecalcPivotTable","spreadsheet"),command:".uno:RecalcPivotTable",accessibility:{
focusBack:true,combination:"R",de:null}}]},{id:"LineB162",type:"toolbox",children:[{
id:"insert-delete-pivot-table",type:"toolitem",text:_UNO(".uno:DeletePivotTable","spreadsheet"),
command:".uno:DeletePivotTable",accessibility:{focusBack:true,combination:"DV",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"insert-deletepivottable-break",orientation:"vertical"},{
type:"overflowgroup",id:"insert-illustrations",name:_("Illustrations"),accessibility:{
focusBack:true,combination:"IC",de:null},children:[{id:"insert-insert-object-chart",
type:"bigtoolitem",text:_UNO(".uno:InsertObjectChart"),command:".uno:InsertObjectChart",
accessibility:{focusBack:true,combination:"IC",de:null}},{id:"insert-insert-sparkline",
type:"bigtoolitem",text:_("Sparkline"),command:".uno:InsertSparkline",accessibility:{focusBack:true,
combination:"IS",de:null}},{id:"insert-function-dialog",type:"bigtoolitem",text:_UNO(
".uno:FunctionDialog","spreadsheet"),command:".uno:FunctionDialog",accessibility:{focusBack:true,
combination:"FD",de:null}},{id:"Insert-Section-PivotTable-Ext",type:"container",children:[{
id:"LineA152",type:"toolbox",children:[{id:"insert-insert-graphic:InsertImageMenu",
type:"menubutton",noLabel:true,text:_UNO(".uno:InsertGraphic"),command:".uno:InsertGraphic",
accessibility:{focusBack:true,combination:"IG",de:null}}]},{id:"LineB162",type:"toolbox",children:[{
id:"insert-function-dialog",type:"toolitem",text:_UNO(".uno:FunctionDialog","spreadsheet"),
command:".uno:FunctionDialog",accessibility:{focusBack:true,combination:"FD",de:null}}]}],
vertical:"true"},{id:"Insert-BasicShapes-Shapes",type:"container",children:[{id:"LineA153",
type:"toolbox",children:[{id:"insert-basic-shapes:InsertShapesMenu",type:"menubutton",noLabel:true,
text:_("Shapes"),command:".uno:BasicShapes",accessibility:{focusBack:true,combination:"IP",de:null}}
]},{id:"LineB163",type:"toolbox",children:[{id:"insert-line",type:"toolitem",text:_UNO(".uno:Line",
"spreadsheet"),command:".uno:Line",accessibility:{focusBack:true,combination:"IL",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"insert-functiondialog-break",orientation:"vertical"},{
id:"HyperlinkDialog",class:"unoHyperlinkDialog",type:"bigtoolitem",text:_UNO(".uno:HyperlinkDialog"
),command:".uno:HyperlinkDialog",accessibility:{focusBack:true,combination:"I2",de:null}},this.map[
"wopi"].EnableRemoteLinkPicker?{id:"insert-smart-picker",class:"unoremotelink",
type:"bigcustomtoolitem",text:_("Smart Picker"),command:"remotelink",accessibility:{focusBack:true,
combination:"LR",de:null}}:{},this.map["wopi"].EnableRemoteAIContent?{
id:"insert-insert-remote-ai-content",class:"unoremoteaicontent",type:"bigcustomtoolitem",text:_(
"Assistant"),command:"remoteaicontent",accessibility:{focusBack:true,combination:"RL",de:null}}:{},{
type:"separator",id:"insert-remoteaicontent-break",orientation:"vertical"},{type:"container",
children:[{type:"toolbox",children:[{id:"insert-insert-current-date",type:"toolitem",text:_UNO(
".uno:InsertCurrentDate","spreadsheet"),command:".uno:InsertCurrentDate",accessibility:{
focusBack:true,combination:"ID",de:null}}]},{type:"toolbox",children:[{
id:"insert-insert-current-time",type:"toolitem",text:_UNO(".uno:InsertCurrentTime","spreadsheet"),
command:".uno:InsertCurrentTime",accessibility:{focusBack:true,combination:"IT",de:null}}]}],
vertical:"true"},{type:"separator",id:"insert-insertcurrenttime-break",orientation:"vertical"},{
id:"Insert-Section-NameRangesTable-Ext",type:"container",children:[{type:"toolbox",children:[{
id:"insert-add-name",type:"toolitem",text:_UNO(".uno:AddName","spreadsheet"),command:".uno:AddName",
accessibility:{focusBack:true,combination:"IN",de:null}}]},{type:"toolbox",children:[{
id:"insert-define-name",type:"toolitem",text:_UNO(".uno:DefineName","spreadsheet"),
command:".uno:DefineName",accessibility:{focusBack:true,combination:"DN",de:null}}]}],
vertical:"true"},{type:"separator",id:"insert-definename-break",orientation:"vertical"},{
type:"overflowgroup",id:"insert-text",name:_("Text"),accessibility:{focusBack:true,combination:"DT",
de:null},children:[{id:"insert-draw-text",type:"bigtoolitem",text:_UNO(".uno:DrawText"),
command:".uno:DrawText",accessibility:{focusBack:true,combination:"DT",de:null}},{
id:"Insert-Text-Fontwork",type:"container",children:[{id:"LineA153",type:"toolbox",children:[{
id:"insert-font-work-gallery-floater",type:"toolitem",text:_UNO(".uno:FontworkGalleryFloater"),
command:".uno:FontworkGalleryFloater",visible:app.LOUtil.isFileODF(this.map)?"true":"false",
accessibility:{focusBack:true,combination:"IF",de:null}}]},{id:"LineB163",type:"toolbox",children:[{
id:"insert-vertical-text",type:app.LOUtil.isFileODF(this.map)?"toolitem":"bigtoolitem",text:_UNO(
".uno:VerticalText","spreadsheet"),command:".uno:VerticalText",accessibility:{focusBack:true,
combination:"IV",de:null}}]}],vertical:"true"}]},{type:"separator",id:"insert-verticaltext-break",
orientation:"vertical"},{id:"insert-edit-header-and-footer",type:"bigtoolitem",text:_UNO(
".uno:EditHeaderAndFooter","spreadsheet"),command:".uno:EditHeaderAndFooter",accessibility:{
focusBack:true,combination:"IH",de:null}},{type:"separator",id:"insert-editheaderandfooter-break",
orientation:"vertical"},{id:"Insert-Charmap-Annotation",type:"container",children:[{id:"LineA153",
type:"toolbox",children:[{id:"CharmapControl",class:"unoCharmapControl",type:"customtoolitem",
text:_UNO(".uno:CharmapControl"),command:"charmapcontrol",accessibility:{focusBack:true,
combination:"ZS",de:null}}]},{id:"LineB163",type:"toolbox",children:[{id:"insert-insert-annotation",
type:"toolitem",text:_UNO(".uno:InsertAnnotation","text"),command:".uno:InsertAnnotation",
accessibility:{focusBack:true,combination:"IA",de:null}}]}],vertical:"true"}];
return this.getTabPage("Insert",content)},getFormulaTab:function(){var content=[{
id:"Formula-InsertFunction",type:"bigtoolitem",text:_("Insert Function"),
command:".uno:FunctionDialog",accessibility:{focusBack:true,combination:"ZF",de:null}},{
type:"separator",id:"formula-insertformula-break",orientation:"vertical"},{type:"overflowgroup",
id:"formula-function-library",name:_("Function Library"),accessibility:{focusBack:true,
combination:"ZA",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"Formula-AutoSumMenu:AutoSumMenu",type:"menubutton",class:"AutoSumMenu",noLabel:true,text:_(
"AutoSum"),command:".uno:AutoSumMenu",accessibility:{focusBack:true,combination:"ZA",de:null}}]},{
type:"toolbox",children:[{id:"Formula-FinancialFunctions:FinancialFunctionsMenu",type:"menubutton",
noLabel:true,text:_("Financial"),accessibility:{focusBack:true,combination:"ZR",de:null}}]}],
vertical:"true"},{type:"container",children:[{type:"toolbox",children:[{
id:"Formula-LogicalFunctions:LogicalFunctionsMenu",type:"menubutton",noLabel:true,text:_("Logical"),
accessibility:{focusBack:true,combination:"ZL",de:null}}]},{type:"toolbox",children:[{
id:"Formula-TextFunctions:TextFunctionsMenu",type:"menubutton",noLabel:true,text:_("Text"),
accessibility:{focusBack:true,combination:"ZT",de:null}}]}],vertical:"true"},{type:"container",
children:[{type:"toolbox",children:[{id:"Formula-DateAndTimeFunctions:DateAndTimeFunctionsMenu",
type:"menubutton",noLabel:true,text:_("Date & Time"),accessibility:{focusBack:true,combination:"ZD",
de:null}}]},{type:"toolbox",children:[{id:"Formula-LookupAndRefFunctions:LookupAndRefFunctionsMenu",
type:"menubutton",noLabel:true,text:_("Lookup & Reference"),accessibility:{focusBack:true,
combination:"ZK",de:null}}]}],vertical:"true"},{type:"container",children:[{type:"toolbox",
children:[{id:"Formula-MathAndTrigFunctions:MathAndTrigFunctionsMenu",type:"menubutton",
noLabel:true,text:_("Math & Trig"),accessibility:{focusBack:true,combination:"ZM",de:null}}]},{
type:"toolbox",children:[{id:"Formula-MoreFunctions:MoreFunctionsMenu",type:"menubutton",
noLabel:true,text:_("More Functions"),accessibility:{focusBack:true,combination:"ZX",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"formula-section-break",orientation:"vertical"},{
type:"container",children:[{type:"toolbox",children:[{id:"formula-add-name",type:"toolitem",
text:_UNO(".uno:AddName","spreadsheet"),command:".uno:AddName",accessibility:{focusBack:true,
combination:"ZD",de:null}}]},{type:"toolbox",children:[{id:"data-define-name",type:"toolitem",
text:_UNO(".uno:DefineName","spreadsheet"),command:".uno:DefineName",accessibility:{focusBack:true,
combination:"ZN",de:null}}]}],vertical:"true"},{type:"separator",id:"formula-nameoperations-break",
orientation:"vertical"},{type:"overflowgroup",id:"formula-range",name:_("Range"),accessibility:{
focusBack:true,combination:"DR",de:null},children:[{id:"formula-define-range",type:"bigtoolitem",
text:_UNO(".uno:DefineDBName","spreadsheet"),command:".uno:DefineDBName",accessibility:{
focusBack:true,combination:"DR",de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"formula-select-range",type:"toolitem",text:_UNO(".uno:SelectDB","spreadsheet"),
command:".uno:SelectDB",accessibility:{focusBack:true,combination:"SR",de:null}}]},{type:"toolbox",
children:[{id:"formula-refresh-range",type:"toolitem",text:_UNO(".uno:DataAreaRefresh","spreadsheet"
),command:".uno:DataAreaRefresh",accessibility:{focusBack:true,combination:"DE",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"formula-rangeoperations-break",orientation:"vertical"},{
type:"container",children:[{type:"toolbox",children:[{id:"formula-convert-formula-to-value",
type:"toolitem",text:_UNO(".uno:ConvertFormulaToValue","spreadsheet"),
command:".uno:ConvertFormulaToValue",accessibility:{focusBack:true,combination:"R",de:null}}]},{
type:"toolbox",children:[{id:"formula-calculate",type:"toolitem",text:_UNO(".uno:Calculate",
"spreadsheet"),command:".uno:Calculate",accessibility:{focusBack:true,combination:"R",de:null}}]}],
vertical:"true"}];return this.getTabPage("Formulas",content)},getDataTab:function(){var content=[{
type:"overflowgroup",id:"data-sort",name:_("Sort"),accessibility:{focusBack:true,combination:"SS",
de:null},children:[{id:"data-data-sort",type:"bigtoolitem",text:_UNO(".uno:DataSort","spreadsheet"),
command:".uno:DataSort",accessibility:{focusBack:true,combination:"SS",de:null}},{type:"container",
children:[{type:"toolbox",children:[{id:"data-sort-ascending",type:"toolitem",text:_UNO(
".uno:SortAscending","spreadsheet"),command:".uno:SortAscending",accessibility:{focusBack:true,
combination:"SA",de:null}}]},{type:"toolbox",children:[{id:"data-sort-descending",type:"toolitem",
text:_UNO(".uno:SortDescending","spreadsheet"),command:".uno:SortDescending",accessibility:{
focusBack:true,combination:"SD",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"data-sortdescending-break",orientation:"vertical"},{type:"overflowgroup",id:"data-filter",
name:_("Filter"),accessibility:{focusBack:true,combination:"T",de:null},children:[{
id:"data-data-filter-auto-filter",type:"bigtoolitem",text:_UNO(".uno:DataFilterAutoFilter",
"spreadsheet"),command:".uno:DataFilterAutoFilter",accessibility:{focusBack:true,combination:"T",
de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"data-data-filter-standart-filter",type:"toolitem",text:_UNO(".uno:DataFilterStandardFilter",
"spreadsheet"),command:".uno:DataFilterStandardFilter",accessibility:{focusBack:true,
combination:"SF",de:null}}]},{type:"toolbox",children:[{id:"data-data-filter-special-filter",
type:"toolitem",text:_UNO(".uno:DataFilterSpecialFilter","spreadsheet"),
command:".uno:DataFilterSpecialFilter",accessibility:{focusBack:true,combination:"Q",de:null}}]}],
vertical:"true"},{type:"container",children:[{type:"toolbox",children:[{
id:"data-data-filter-hide-auto-filter",type:"toolitem",text:_UNO(".uno:DataFilterHideAutoFilter",
"spreadsheet"),command:".uno:DataFilterHideAutoFilter",accessibility:{focusBack:true,
combination:"HF",de:null}}]},{type:"toolbox",children:[{id:"data-data-filter-remove-filter",
type:"toolitem",text:_UNO(".uno:DataFilterRemoveFilter","spreadsheet"),
command:".uno:DataFilterRemoveFilter",accessibility:{focusBack:true,combination:"FR",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"data-datafilterremovefilter-break",orientation:"vertical"},
{type:"overflowgroup",id:"data-group",name:_("Group"),accessibility:{focusBack:true,
combination:"GA",de:null},children:[{id:"data-group",type:"bigtoolitem",text:_UNO(".uno:Group"),
command:".uno:Group",accessibility:{focusBack:true,combination:"GA",de:null}},{type:"container",
children:[{type:"toolbox",children:[{id:"data-ungroup",type:"toolitem",text:_UNO(".uno:Ungroup"),
command:".uno:Ungroup",accessibility:{focusBack:true,combination:"GR",de:null}}]},{type:"toolbox",
children:[{id:"data-clear-outline",type:"toolitem",text:_UNO(".uno:ClearOutline","spreadsheet"),
command:".uno:ClearOutline",accessibility:{focusBack:true,combination:"CO",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"data-clearoutline-break",orientation:"vertical"},{
type:"container",children:[{type:"toolbox",children:[{id:"data-show-detail",type:"toolitem",
text:_UNO(".uno:ShowDetail"),command:".uno:ShowDetail",accessibility:{focusBack:true,
combination:"DS",de:null}}]},{type:"toolbox",children:[{id:"data-hide-detail",type:"toolitem",
text:_UNO(".uno:HideDetail"),command:".uno:HideDetail",accessibility:{focusBack:true,
combination:"DH",de:null}}]}],vertical:"true"},{type:"separator",id:"data-hidedetail-break",
orientation:"vertical"},{type:"container",children:[{type:"toolbox",children:[{
id:"data-goal-seek-dialog",type:"toolitem",text:_UNO(".uno:GoalSeekDialog","spreadsheet"),
command:".uno:GoalSeekDialog",accessibility:{focusBack:true,combination:"SG",de:null}}]},{
type:"toolbox",children:[{id:"data-validation",type:"toolitem",text:_UNO(".uno:Validation",
"spreadsheet"),command:".uno:Validation",accessibility:{focusBack:true,combination:"DV",de:null}}]}
],vertical:"true"},{type:"separator",id:"data-validation-break",orientation:"vertical"},{
id:"Data-StatisticsMenu:Menu Statistic",class:"unoData-StatisticsMenu",type:"menubutton",text:_UNO(
".uno:StatisticsMenu","spreadsheet"),enabled:"true",accessibility:{focusBack:true,combination:"DS",
de:null}}];return this.getTabPage("Data",content)},getReviewTab:function(){var content=[{
id:"review-spell-dialog",type:"bigtoolitem",text:_UNO(".uno:SpellDialog"),
command:".uno:SpellDialog",accessibility:{focusBack:true,combination:"S",de:null}},{
id:"LanguageMenu",type:"bigcustomtoolitem",text:_UNO(".uno:LanguageMenu"),command:"languagemenu",
accessibility:{focusBack:true,combination:"L",de:null}},{id:"Review-Section-Language1",
type:"container",children:[{id:"LineA19",type:"toolbox",children:[{id:"review-spell-online",
type:"toolitem",text:_UNO(".uno:SpellOnline"),command:".uno:SpellOnline",accessibility:{
focusBack:true,combination:"O",de:null}}]},{id:"LineB20",type:"toolbox",children:[{
id:"review-hyphenate",type:"toolitem",text:_UNO(".uno:Hyphenate","spreadsheet"),
command:".uno:Hyphenate",accessibility:{focusBack:true,combination:"H",de:null}}]}],vertical:"true"}
,{type:"separator",id:"review-hyphenate-break",orientation:"vertical"},{type:"overflowgroup",
id:"review-comments",name:_("Comments"),accessibility:{focusBack:true,combination:"IA",de:null},
children:[{id:"review-insert-annotation",type:"bigtoolitem",text:_UNO(".uno:InsertAnnotation"),
command:".uno:InsertAnnotation",accessibility:{focusBack:true,combination:"IA",de:null}},{
id:"Review-Section-Annotation2",type:"container",children:[{id:"LeftParaMargin17",type:"toolbox",
children:[{id:"review-delete-all-notes",type:"toolitem",text:_UNO(".uno:DeleteAllNotes"),
command:".uno:DeleteAllNotes",accessibility:{focusBack:true,combination:"DA",de:null}}]},{
id:"belowspacing15",type:"toolbox",children:[{id:"review-delete-note",type:"toolitem",text:_UNO(
".uno:DeleteNote","spreadsheet"),command:".uno:DeleteNote",accessibility:{focusBack:true,
combination:"DO",de:null}}]}],vertical:"true"}]},{type:"separator",id:"review-deletenote-break",
orientation:"vertical"},{type:"toolbox",children:[{id:"review-protect-sheet",type:"bigtoolitem",
text:_UNO(".uno:Protect","spreadsheet"),command:".uno:Protect",accessibility:{focusBack:true,
combination:"DP",de:null}}]}];return this.getTabPage("Review",content)},getFormatTab:function(){
var content=[{type:"overflowgroup",id:"format-style",name:_("Style"),accessibility:{focusBack:true,
combination:"FD",de:null},children:[{id:"format-font-dialog",type:"bigtoolitem",text:_UNO(
".uno:FontDialog"),command:".uno:FontDialog",accessibility:{focusBack:true,combination:"FD",de:null}
},{id:"FormatMenu:FormatMenu",type:"menubutton",text:_UNO(".uno:FormatMenu","spreadsheet"),
command:".uno:FormatMenu",accessibility:{focusBack:true,combination:"FM",de:null}},{
id:"format-paragraph-dialog",type:"bigtoolitem",text:_UNO(".uno:ParagraphDialog"),
command:".uno:ParagraphDialog",accessibility:{focusBack:true,combination:"PD",de:null}},{
id:"format-style-dialog",type:"bigtoolitem",text:_("Style list"),
command:".uno:SidebarDeck.StyleListDeck",accessibility:{focusBack:false,combination:"SD",de:null}}]}
,{type:"separator",id:"format-styledialog-break",orientation:"vertical"},{type:"overflowgroup",
id:"format-cells",name:_("Format Cells"),accessibility:{focusBack:true,combination:"PD",de:null},
children:[{id:"format-page-format-dialog",type:"bigtoolitem",text:_UNO(".uno:PageFormatDialog",
"spreadsheet",true),command:".uno:PageFormatDialog",accessibility:{focusBack:true,combination:"PD",
de:null}},{id:"format-format-cell-dialog",type:"bigtoolitem",text:_UNO(".uno:FormatCellDialog",
"spreadsheet",true),command:".uno:FormatCellDialog",accessibility:{focusBack:true,combination:"FC",
de:null}},{id:"format-conditional-format-menu:ConditionalFormatMenu",type:"menubutton",text:_UNO(
".uno:ConditionalFormatMenu","spreadsheet"),command:".uno:ConditionalFormatMenu",accessibility:{
focusBack:true,combination:"CF",de:null}}]},{type:"separator",
id:"format-conditionalformatmenu-break",orientation:"vertical"},{id:"format-format-line",
type:"bigtoolitem",text:_UNO(".uno:FormatLine"),command:".uno:FormatLine",accessibility:{
focusBack:true,combination:"FL",de:null}},{id:"format-format-area",type:"bigtoolitem",text:_UNO(
".uno:FormatArea"),command:".uno:FormatArea",accessibility:{focusBack:true,combination:"FA",de:null}
},{id:"format-transform-dialog",type:"bigtoolitem",text:_UNO(".uno:TransformDialog"),
command:".uno:TransformDialog",accessibility:{focusBack:true,combination:"TD",de:null}},{
id:"Format-Sparkline",type:"bigtoolitem",text:_("Sparkline"),command:".uno:InsertSparkline",
enabled:"true",accessibility:{focusBack:true,combination:"SM",de:null}},{type:"separator",
id:"format-sparkline-break",orientation:"vertical"},{id:"format-theme-dialog",type:"bigtoolitem",
text:_UNO(".uno:ThemeDialog"),command:".uno:ThemeDialog",accessibility:{focusBack:false,
combination:"J",de:null}}];return this.getTabPage("Format",content)},getShapeTab:function(){
var content=[{id:"shape-transform-dialog",type:"bigtoolitem",text:_UNO(".uno:TransformDialog","text"
),command:".uno:TransformDialog",accessibility:{focusBack:true,combination:"TD",de:null}},{
type:"separator",id:"shape-transformdialog-break",orientation:"vertical"},{type:"container",
children:[{type:"toolbox",children:[{id:"shape-flip-vertical",type:"toolitem",text:_UNO(
".uno:FlipVertical"),command:".uno:FlipVertical",accessibility:{focusBack:true,combination:"FV",
de:null}}]},{type:"toolbox",children:[{id:"shape-flip-horizontal",type:"toolitem",text:_UNO(
".uno:FlipHorizontal"),command:".uno:FlipHorizontal",accessibility:{focusBack:true,combination:"FH",
de:null}}]}],vertical:"true"},{type:"separator",id:"shape-fliphorizontal-break",
orientation:"vertical"},{type:"container",children:[{type:"toolbox",children:[{
id:"shape-xline-color:ColorPickerMenu",noLabel:true,type:"toolitem",text:_UNO(".uno:XLineColor"),
command:".uno:XLineColor",accessibility:{focusBack:true,combination:"DX",de:null}}]},{
type:"toolbox",children:[{id:"shape-fill-color:ColorPickerMenu",noLabel:true,type:"toolitem",
text:_UNO(".uno:FillColor"),command:".uno:FillColor",accessibility:{focusBack:true,combination:"FC",
de:null}}]}],vertical:"true"},{type:"separator",id:"shape-fillcolor-break",orientation:"vertical"},{
type:"overflowgroup",id:"shape-wrap",name:_("Wrap"),accessibility:{focusBack:true,combination:"WO",
de:null},children:[{type:"container",children:[{type:"toolbox",children:[{id:"shape-wrap-off",
type:"toolitem",text:_UNO(".uno:WrapOff","text"),command:".uno:WrapOff",accessibility:{
focusBack:true,combination:"WO",de:null}},{id:"shape-wrap-on",type:"toolitem",text:_UNO(
".uno:WrapOn","text"),command:".uno:WrapOn",accessibility:{focusBack:true,combination:"WN",de:null}}
,{id:"shape-wrap-ideal",type:"toolitem",text:_UNO(".uno:WrapIdeal","text"),command:".uno:WrapIdeal",
accessibility:{focusBack:true,combination:"WI",de:null}}]},{type:"toolbox",children:[{
id:"shape-wrap-left",type:"toolitem",text:_UNO(".uno:WrapLeft","text"),command:".uno:WrapLeft",
accessibility:{focusBack:true,combination:"WL",de:null}},{id:"shape-wrap-through",type:"toolitem",
text:_UNO(".uno:WrapThrough","text"),command:".uno:WrapThrough",accessibility:{focusBack:true,
combination:"WT",de:null}},{id:"shape-wrap-right",type:"toolitem",text:_UNO(".uno:WrapRight","text"
),command:".uno:WrapRight",accessibility:{focusBack:true,combination:"WR",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"shape-wrapright-break",orientation:"vertical"},{
type:"overflowgroup",id:"shape-align",name:_("Align"),accessibility:{focusBack:true,
combination:"AL",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"shape-object-align-left",type:"toolitem",text:_UNO(".uno:ObjectAlignLeft"),
command:".uno:ObjectAlignLeft",accessibility:{focusBack:true,combination:"AL",de:null}},{
id:"shape-align-center",type:"toolitem",text:_UNO(".uno:AlignCenter"),command:".uno:AlignCenter",
accessibility:{focusBack:true,combination:"AC",de:null}},{id:"shape-object-align-right",
type:"toolitem",text:_UNO(".uno:ObjectAlignRight"),command:".uno:ObjectAlignRight",accessibility:{
focusBack:true,combination:"AR",de:null}}]},{type:"toolbox",children:[{id:"shape-align-up",
type:"toolitem",text:_UNO(".uno:AlignUp"),command:".uno:AlignUp",accessibility:{focusBack:true,
combination:"AU",de:null}},{id:"shape-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle"),
command:".uno:AlignMiddle",accessibility:{focusBack:true,combination:"AM",de:null}},{
id:"shape-align-down",type:"toolitem",text:_UNO(".uno:AlignDown"),command:".uno:AlignDown",
accessibility:{focusBack:true,combination:"AD",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"shape-aligndown-break",orientation:"vertical"},{type:"overflowgroup",id:"shape-arrange",name:_(
"Arrange"),accessibility:{focusBack:true,combination:"BF",de:null},children:[{type:"container",
children:[{type:"toolbox",children:[{id:"shape-bring-to-front",type:"toolitem",text:_UNO(
".uno:BringToFront"),command:".uno:BringToFront",accessibility:{focusBack:true,combination:"BF",
de:null}},{id:"shape-send-to-back",type:"toolitem",text:_UNO(".uno:SendToBack"),
command:".uno:SendToBack",accessibility:{focusBack:true,combination:"SB",de:null}}]},{
type:"toolbox",children:[{id:"shape-object-forward-one",type:"toolitem",text:_UNO(
".uno:ObjectForwardOne"),command:".uno:ObjectForwardOne",accessibility:{focusBack:true,
combination:"FO",de:null}},{id:"shape-object-back-one",type:"toolitem",text:_UNO(
".uno:ObjectBackOne"),command:".uno:ObjectBackOne",accessibility:{focusBack:true,combination:"BO",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"shape-objectbackone-break",
orientation:"vertical"},{type:"overflowgroup",id:"shape-group",name:_("Group"),accessibility:{
focusBack:true,combination:"FG",de:null},children:[{id:"shape-format-group",type:"bigtoolitem",
text:_UNO(".uno:FormatGroup"),command:".uno:FormatGroup",accessibility:{focusBack:true,
combination:"FG",de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"shape-enter-group",type:"toolitem",text:_UNO(".uno:EnterGroup"),command:".uno:EnterGroup",
accessibility:{focusBack:true,combination:"EG",de:null}}]},{type:"toolbox",children:[{
id:"shape-leave-group",type:"toolitem",text:_UNO(".uno:LeaveGroup"),command:".uno:LeaveGroup",
accessibility:{focusBack:true,combination:"LG",de:null}}]}],vertical:"true"}]}];
return this.getTabPage("Shape",content)},getPictureTab:function(){var content=[{
type:"overflowgroup",id:"picture-adjustments",name:_("Image Controls"),accessibility:{
focusBack:true,combination:"BN",de:null},children:[{type:"container",children:[{
id:"picture-brightness:PictureBrightness",type:"menubutton",command:".uno:GrafLuminance",text:_UNO(
".uno:GrafLuminance"),icon:"lc_setbrightness.svg",accessibility:{focusBack:true,combination:"BN",
de:null}},{id:"picture-contrast:PictureContrast",type:"menubutton",command:".uno:GrafContrast",
text:_UNO(".uno:GrafContrast"),icon:"lc_setcontrast.svg",accessibility:{focusBack:true,
combination:"CN",de:null}},{id:"picture-colormode:PictureColorMode",type:"menubutton",
command:".uno:GrafMode",text:_UNO(".uno:GrafMode"),icon:"lc_setgraphtransparency.svg",
accessibility:{focusBack:true,combination:"CO",de:null}},{
id:"picture-transparency:PictureTransparency",type:"menubutton",command:".uno:GrafTransparence",
text:_UNO(".uno:GrafTransparence"),icon:"lc_setgraphtransparency.svg",accessibility:{focusBack:true,
combination:"TP",de:null}}]}]},{type:"separator",id:"picture-transparency-break",
orientation:"vertical"},{type:"container",children:[{type:"toolbox",children:[{
id:"picture-xline-color:ColorPickerMenu",type:"menubutton",noLabel:true,text:_UNO(".uno:XLineColor"
),command:".uno:XLineColor",accessibility:{focusBack:true,combination:"DX",de:null}}]},{
type:"toolbox",children:[{id:"picture-fill-color:ColorPickerMenu",type:"menubutton",noLabel:true,
text:_UNO(".uno:FillColor"),command:".uno:FillColor",accessibility:{focusBack:true,combination:"FC",
de:null}}]}],vertical:"true"},{type:"separator",id:"picture-fillcolor-break",orientation:"vertical"}
,{id:"picture-transform-dialog",type:"bigtoolitem",text:_UNO(".uno:TransformDialog","text"),
command:".uno:TransformDialog",accessibility:{focusBack:true,combination:"TD",de:null}},{
type:"separator",id:"picture-transformdialog-break",orientation:"vertical"},{type:"container",
children:[{type:"toolbox",children:[{id:"picture-flip-vertical",type:"toolitem",text:_UNO(
".uno:FlipVertical"),command:".uno:FlipVertical",accessibility:{focusBack:true,combination:"FV",
de:null}}]},{type:"toolbox",children:[{id:"picture-flip-horizontal",type:"toolitem",text:_UNO(
".uno:FlipHorizontal"),command:".uno:FlipHorizontal",accessibility:{focusBack:true,combination:"FH",
de:null}}]}],vertical:"true"},{type:"separator",id:"picture-fliphorizontal-break",
orientation:"vertical"},{type:"overflowgroup",id:"picture-wrap",name:_("Wrap"),accessibility:{
focusBack:true,combination:"WO",de:null},children:[{type:"container",children:[{type:"toolbox",
children:[{id:"picture-wrap-off",type:"toolitem",text:_UNO(".uno:WrapOff","text"),
command:".uno:WrapOff",accessibility:{focusBack:true,combination:"WO",de:null}},{
id:"picture-wrap-on",type:"toolitem",text:_UNO(".uno:WrapOn","text"),command:".uno:WrapOn",
accessibility:{focusBack:true,combination:"WN",de:null}},{id:"picture-wrap-ideal",type:"toolitem",
text:_UNO(".uno:WrapIdeal","text"),command:".uno:WrapIdeal",accessibility:{focusBack:true,
combination:"WI",de:null}}]},{type:"toolbox",children:[{id:"picture-wrap-left",type:"toolitem",
text:_UNO(".uno:WrapLeft","text"),command:".uno:WrapLeft",accessibility:{focusBack:true,
combination:"WL",de:null}},{id:"picture-wrap-through",type:"toolitem",text:_UNO(".uno:WrapThrough",
"text"),command:".uno:WrapThrough",accessibility:{focusBack:true,combination:"WT",de:null}},{
id:"picture-wrap-right",type:"toolitem",text:_UNO(".uno:WrapRight","text"),command:".uno:WrapRight",
accessibility:{focusBack:true,combination:"WR",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"picture-wrapright-break",orientation:"vertical"},{type:"overflowgroup",id:"picture-align",
name:_("Align"),accessibility:{focusBack:true,combination:"AL",de:null},children:[{type:"container",
children:[{type:"toolbox",children:[{id:"picture-object-align-left",type:"toolitem",text:_UNO(
".uno:ObjectAlignLeft"),command:".uno:ObjectAlignLeft",accessibility:{focusBack:true,
combination:"AL",de:null}},{id:"picture-align-center",type:"toolitem",text:_UNO(".uno:AlignCenter"),
command:".uno:AlignCenter",accessibility:{focusBack:true,combination:"AC",de:null}},{
id:"picture-object-align-right",type:"toolitem",text:_UNO(".uno:ObjectAlignRight"),
command:".uno:ObjectAlignRight",accessibility:{focusBack:true,combination:"AR",de:null}}]},{
type:"toolbox",children:[{id:"picture-align-up",type:"toolitem",text:_UNO(".uno:AlignUp"),
command:".uno:AlignUp",accessibility:{focusBack:true,combination:"AU",de:null}},{
id:"picture-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle"),command:".uno:AlignMiddle",
accessibility:{focusBack:true,combination:"AM",de:null}},{id:"picture-align-down",type:"toolitem",
text:_UNO(".uno:AlignDown"),command:".uno:AlignDown",accessibility:{focusBack:true,combination:"AD",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"picture-aligndown-break",
orientation:"vertical"},{type:"overflowgroup",id:"picture-arrange",name:_("Arrange"),accessibility:{
focusBack:true,combination:"BF",de:null},children:[{type:"container",children:[{type:"toolbox",
children:[{id:"picture-bring-to-front",type:"toolitem",text:_UNO(".uno:BringToFront"),
command:".uno:BringToFront",accessibility:{focusBack:true,combination:"BF",de:null}},{
id:"picture-send-to-back",type:"toolitem",text:_UNO(".uno:SendToBack"),command:".uno:SendToBack",
accessibility:{focusBack:true,combination:"SB",de:null}}]},{type:"toolbox",children:[{
id:"picture-object-forward-one",type:"toolitem",text:_UNO(".uno:ObjectForwardOne"),
command:".uno:ObjectForwardOne",accessibility:{focusBack:true,combination:"FO",de:null}},{
id:"picture-object-back-one",type:"toolitem",text:_UNO(".uno:ObjectBackOne"),
command:".uno:ObjectBackOne",accessibility:{focusBack:true,combination:"BO",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"picture-objectbackone-break",orientation:"vertical"},{
type:"overflowgroup",id:"picture-group",name:_("Group"),accessibility:{focusBack:true,
combination:"FG",de:null},children:[{id:"picture-format-group",type:"bigtoolitem",text:_UNO(
".uno:FormatGroup"),command:".uno:FormatGroup",accessibility:{focusBack:true,combination:"FG",
de:null}},{type:"container",children:[{type:"toolbox",children:[{id:"picture-enter-group",
type:"toolitem",text:_UNO(".uno:EnterGroup"),command:".uno:EnterGroup",accessibility:{
focusBack:true,combination:"EG",de:null}}]},{type:"toolbox",children:[{id:"picture-leave-group",
type:"toolitem",text:_UNO(".uno:LeaveGroup"),command:".uno:LeaveGroup",accessibility:{
focusBack:true,combination:"LG",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"picture-leavegroup-break",orientation:"vertical"},{type:"bigtoolitem",text:_UNO(".uno:Crop"),
command:".uno:Crop",context:"Graphic"}];return this.getTabPage("Picture",content)}});
window.L.control.notebookbarCalc=function(options){return new window.L.Control.NotebookbarCalc(
options)};window.L.Control.NotebookbarImpress=window.L.Control.NotebookbarWriter.extend({
getShortcutsBarData:function(){return[!this.map["wopi"].HideSaveOption?{id:"shortcutstoolbox",
type:"toolbox",children:[{id:"save",type:"toolitem",text:_("Save"),command:".uno:Save",
accessKey:"1",isCustomTooltip:true}]}:{}]},getOptionsSectionData:function(){
return this.buildOptionsSectionData(this.getDefaultToolItems())},getDefaultToolItems:function(){
const optionsToolItems=[{id:"options-modify-page",type:"toolitem",text:_UNO(".uno:ModifyPage",
"presentation",true),command:".uno:ModifyPage",accessibility:{focusBack:true,combination:"ZL",
de:null}},{id:"options-custom-animation",type:"toolitem",text:_UNO(".uno:CustomAnimation",
"presentation",true),command:".uno:CustomAnimation",accessibility:{focusBack:true,combination:"ZA",
de:null}}];if(this._map&&this._map["wopi"].EnableShare){optionsToolItems.push({
type:"customtoolitem",text:_("Share"),command:"shareas",inlineLabel:true,accessibility:{
focusBack:false,combination:"ZS",de:null}})}return optionsToolItems},getTabs:function(){return[{
id:"File-tab-label",text:_("File"),name:"File",accessibility:{focusBack:false,combination:"F",
de:null}},{id:this.HOME_TAB_ID,text:_("Home"),name:"Home",context:"default|DrawText",accessibility:{
focusBack:false,combination:"H",de:null}},{id:"Insert-tab-label",text:_("Insert"),name:"Insert",
accessibility:{focusBack:false,combination:"N",de:null}},{id:"Design-tab-label",text:_("Design"),
name:"Design",accessibility:{focusBack:false,combination:"P",de:null}},
JSDialog.ImpressTransitionTab.getEntry(),{id:"Slideshow-tab-label",text:_("Slide Show"),
name:"Slideshow",accessibility:{focusBack:false,combination:"SE",de:null}},{id:"Review-tab-label",
text:_("Review"),name:"Review",accessibility:{focusBack:false,combination:"R",de:null}},{
id:"Format-tab-label",text:_("Format"),name:"Format",accessibility:{focusBack:false,combination:"O",
de:null}},{id:"Table-tab-label",text:_("Table"),name:"Table",context:"Table",accessibility:{
focusBack:false,combination:"T",de:null}},{id:"Shape-tab-label",text:_("Shape"),name:"Shape",
context:"Draw|DrawLine|3DObject|MultiObject|DrawFontwork",accessibility:{focusBack:false,
combination:"D",de:null}},{id:"Picture-tab-label",text:_("Picture"),name:"Picture",
context:"Graphic",accessibility:{focusBack:false,combination:"I",de:null}},{
id:"MasterPage-tab-label",text:_("Master"),name:"MasterPage",context:"MasterPage",accessibility:{
focusBack:false,combination:"M",de:null}},{id:"View-tab-label",text:_("View"),name:"View",
accessibility:{focusBack:false,combination:"W",de:null}},{id:"Help-tab-label",text:_("Help"),
name:"Help",accessibility:{focusBack:false,combination:"Y",de:null}}]},getTabsJSON:function(){
return[this.getFileTab(),this.getHomeTab(),this.getInsertTab(),this.getDesignTab(),
this.getTransitionTab(),this.getSlideshowTab(),this.getReviewTab(),this.getFormatTab(),
this.getTableTab(),this.getShapeTab(),this.getPictureTab(),this.getMasterTab(),this.getViewTab(),
this.getHelpTab()]},getFullJSON:function(selectedId){return this.getNotebookbar(this.getTabsJSON(),
selectedId)},getFileTab:function(){var content=[];var hasSave=!this.map["wopi"].HideSaveOption;
var hasSaveAs=!this.map["wopi"].UserCanNotWriteRelative;var hasShare=this.map["wopi"].EnableShare;
var hasRevisionHistory=window.L.Params.revHistoryEnabled;if(hasSave){content.push({type:"container",
children:[{id:"file-save",type:"bigtoolitem",text:_UNO(".uno:Save"),command:".uno:Save",
accessibility:{focusBack:true,combination:"SV",de:null}}]})}if(hasSaveAs){content.push(
window.prefs.get("saveAsMode")==="group"?{id:"saveas:SaveAsMenu",command:"saveas",class:"unosaveas",
type:"exportmenubutton",text:_("Save As"),accessibility:{focusBack:true,combination:"SA",de:null}}:{
id:"file-saveas",type:"bigtoolitem",text:_UNO(".uno:SaveAs","presentation"),command:".uno:SaveAs",
accessibility:{focusBack:true,combination:"SA",de:null}})}if(hasSaveAs){content.push({
id:"exportas:ExportAsMenu",command:"exportas",class:"unoexportas",type:"exportmenubutton",text:_(
"Export As"),accessibility:{focusBack:true,combination:"EA",de:null}})}if(
hasShare&&hasRevisionHistory){content.push({id:"file-exportas-break",type:"separator",
orientation:"vertical"},{type:"container",children:[{id:"ShareAs",class:"unoShareAs",
type:"customtoolitem",text:_("Share"),command:"shareas",inlineLabel:true,accessibility:{
focusBack:true,combination:"SH"}},{id:"Rev-History",class:"unoRev-History",type:"customtoolitem",
text:_("See history"),command:"rev-history",inlineLabel:true,accessibility:{focusBack:true,
combination:"RH"}}],vertical:true},{id:"file-revhistory-break",type:"separator",
orientation:"vertical"})}else if(hasShare){content.push({id:"file-exportas-break",type:"separator",
orientation:"vertical"},{type:"container",children:[{id:"ShareAs",class:"unoShareAs",
type:"bigcustomtoolitem",text:_("Share"),command:"shareas",accessibility:{focusBack:true,
combination:"SH"}}]},{id:"file-revhistory-break",type:"separator",orientation:"vertical"})}else if(
hasRevisionHistory){content.push({id:"file-exportas-break",type:"separator",orientation:"vertical"},
{type:"container",children:[{id:"Rev-History",class:"unoRev-History",type:"bigcustomtoolitem",
text:_("See history"),command:"rev-history",accessibility:{focusBack:true,combination:"RH"}}]},{
id:"file-revhistory-break",type:"separator",orientation:"vertical"})}if(!this.map["wopi"
].HidePrintOption){content.push({id:"file-print:PrintOptions",type:"exportmenubutton",text:"Печать",command:".uno:Print",applyCallback:"print",accessibility:{
focusBack:true,combination:"PF",de:null}})}if(window.enableMacrosExecution){content.push({
type:"toolbox",children:[{id:"file-runmacro",type:"bigtoolitem",text:_UNO(".uno:RunMacro","text"),
command:".uno:RunMacro",accessibility:{focusBack:true,combination:"RM",de:null}}]})}if(!this.map[
"wopi"].HideExportOption){content.push({id:"downloadas:DownloadAsMenu",command:"downloadas",
class:"unodownloadas",type:"exportmenubutton",text:_("Download"),accessibility:{focusBack:true,
combination:"DA",de:null}})}content.push({type:"separator",id:"file-downloadas-break",
orientation:"vertical"});if(!this.map["wopi"].HideRepairOption){content.push({type:"container",
children:[{id:"repair",class:"unorepair",type:"bigcustomtoolitem",text:_("Repair"),accessibility:{
focusBack:true,combination:"RF",de:null}}],vertical:"true"})}content.push({type:"container",
children:[{id:"properties",type:"bigtoolitem",text:_("Properties"),
command:".uno:SetDocumentProperties",accessibility:{focusBack:true,combination:"FP",de:"I"}}]});if(
window.documentSigningEnabled){content.push({type:"container",children:[{id:"signature",
type:"bigtoolitem",text:_("Signature"),command:".uno:Signature",accessibility:{focusBack:true,
combination:"SN"}}]})}if(this._map["wopi"]._supportsRename()&&this._map["wopi"].UserCanRename){
content.push({type:"container",children:[{id:"renamedocument",class:"unoRenameDocument",
type:"bigcustomtoolitem",text:_("Rename"),accessibility:{focusBack:true,combination:"RN",de:null}}]}
)}if(window.wopiSettingBaseUrl){content.push({type:"separator",id:"file-properties-break",
orientation:"vertical"});content.push({id:"settings-dialog",type:"bigtoolitem",text:_("Options"),
command:".uno:Settings",accessibility:{focusBack:false,combination:"T",de:null}})}
return this.getTabPage("File",content)},getTransitionTab:function(){
const tab=JSDialog.ImpressTransitionTab;return this.getTabPage(tab.getName(),tab.getContent())},
getSlideshowTab:function(){var content=[window.mode.isTablet()?{id:"closemobile",
type:"bigcustomtoolitem",text:_("Read mode"),command:"closetablet"}:{},{
id:"slide-fullscreen-presentation",type:"bigcustomtoolitem",text:_("From Beginning"),
command:"fullscreen-presentation",accessibility:{focusBack:true,combination:"FB",de:null}},{
id:"slide-presentation-currentslide",type:"bigcustomtoolitem",text:_("From Current Slide"),
command:"presentation-currentslide",accessibility:{focusBack:true,combination:"FC",de:null}},{
type:"separator",id:"slide-show-presentation",orientation:"vertical"},!window.ThisIsAMobileApp?{
id:"slide-presentation-in-window",type:"bigcustomtoolitem",text:_("Present in Window"),
command:"presentinwindow",accessibility:{focusBack:true,combination:"PW",de:null}}:{},
!window.ThisIsAMobileApp&&window.canvasSlideshowEnabled?{id:"slide-presentation-in-console",
type:"bigcustomtoolitem",text:_("Presenter Console"),command:"presenterconsole",accessibility:{
focusBack:true,combination:"PW",de:null}}:{},!window.ThisIsAMobileApp&&false?{
id:"slide-presentation-follow-me",type:"bigcustomtoolitem",text:_("Follow me Presentation"),
command:"followmepresentation",accessibility:{focusBack:true,combination:"PW",de:null}}:{},{
type:"separator",id:"slide-zoomin-break",orientation:"vertical"},{id:"showslide",
type:"bigcustomtoolitem",text:_UNO(".uno:ShowSlide","presentation"),accessibility:{focusBack:true,
combination:"SS",de:null}},{id:"hideslide",class:"unohideslide",type:"bigcustomtoolitem",text:_UNO(
".uno:HideSlide","presentation"),accessibility:{focusBack:true,combination:"HS",de:null}}];
return this.getTabPage("Slideshow",content)},getViewTab:function(){var content=[{
type:"overflowgroup",id:"view-zoom",name:_("Zoom"),accessibility:{focusBack:true,combination:"FS",
de:null},children:[{id:"fullscreen",type:"bigtoolitem",text:_UNO(".uno:FullScreen"),
command:".uno:FullScreen",accessibility:{focusBack:true,combination:"FS",de:null}},{id:"zoomreset",
class:"unozoomreset",type:"bigcustomtoolitem",text:_("Reset zoom"),accessibility:{focusBack:true,
combination:"ZR",de:null}},{type:"container",children:[{type:"toolbox",children:[{id:"zoomout",
class:"unozoomout",type:"customtoolitem",text:_UNO(".uno:ZoomMinus"),accessibility:{focusBack:true,
combination:"ZO",de:null}}]},{type:"toolbox",children:[{id:"zoomin",class:"unozoomin",
type:"customtoolitem",text:_UNO(".uno:ZoomPlus"),accessibility:{focusBack:true,combination:"ZI",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"view-zoomin-break",orientation:"vertical"},{
id:"toggleuimode",class:"unotoggleuimode",type:"bigcustomtoolitem",text:_("Compact view"),
accessibility:{focusBack:true,combination:"TU",de:null}},{type:"container",children:[{
type:"toolbox",children:[{id:"showruler",class:"unoshowruler",type:"customtoolitem",text:_("Ruler"),
accessibility:{focusBack:true,combination:"R",de:"L"}}]},{type:"toolbox",children:[{
id:"showstatusbar",class:"unoshowstatusbar",type:"customtoolitem",text:_("Status Bar"),
accessibility:{focusBack:true,combination:"SB",de:null}}]}],vertical:"true"},{
id:"collapsenotebookbar",class:"unocollapsenotebookbar",type:"bigcustomtoolitem",text:_(
"Collapse Tabs"),accessibility:{focusBack:true,combination:"CT",de:null}},{type:"separator",
id:"view-collapsenotebookbar-break",orientation:"vertical"},{type:"overflowgroup",
id:"view-slide-view",name:_("Slide Views"),accessibility:{focusBack:true,combination:"NV",de:null},
children:[{id:"notesmode",class:"notesmode",type:"bigcustomtoolitem",text:_("Notes View"),
accessibility:{focusBack:false,combination:"NV"}},{id:"view-master-view",type:"bigtoolitem",text:_(
"Master View"),command:".uno:SlideMasterPage",accessibility:{focusBack:true,combination:"MP",de:null
}}]},{type:"separator",id:"view-masterview-break",orientation:"vertical"},{type:"overflowgroup",
id:"view-grid",name:_("Grid"),accessibility:{focusBack:true,combination:"GV",de:null},children:[{
type:"toolbox",children:[{id:"home-grid-visible",type:"bigtoolitem",text:_("Show Grid"),
command:".uno:GridVisible",accessibility:{focusBack:true,combination:"GV",de:null}},{
id:"home-grid-use",type:"bigtoolitem",text:_("Snap to Grid"),command:".uno:GridUse",accessibility:{
focusBack:true,combination:"GU",de:null}}]}]},{type:"separator",id:"view-griduse-break",
orientation:"vertical"},{id:"toggledarktheme",class:"unotoggledarktheme",type:"bigcustomtoolitem",
text:_("Dark Mode"),accessibility:{focusBack:true,combination:"TT",de:null}},{id:"invertbackground",
class:"unoinvertbackground",type:"bigcustomtoolitem",text:_("Invert Background"),accessibility:{
focusBack:true,combination:"BG",de:null}},{type:"separator",id:"view-invertbackground-break",
orientation:"vertical"},{id:"view-side-bar",type:"bigtoolitem",text:_UNO(".uno:Sidebar"),
command:".uno:SidebarDeck.PropertyDeck",accessibility:{focusBack:true,combination:"SD",de:null}}];
return this.getTabPage("View",content)},getHomeTab:function(){var content=[{id:"home-undo-redo",
type:"container",children:[{id:"home-undo",type:"toolitem",text:_UNO(".uno:Undo"),
command:".uno:Undo",accessibility:{focusBack:true,combination:"ZZ",de:null}},{id:"home-redo",
type:"toolitem",text:_UNO(".uno:Redo"),command:".uno:Redo",accessibility:{focusBack:true,
combination:"O",de:null}}],vertical:"true"},{type:"separator",id:"home-undoredo-break",
orientation:"vertical"},{type:"overflowgroup",id:"home-clipboard",name:_("Clipboard"),
accessibility:{focusBack:true,combination:"V",de:null},children:[{id:"home-paste:PasteMenu",
type:"menubutton",text:_UNO(".uno:Paste"),command:".uno:Paste",accessibility:{focusBack:true,
combination:"V",de:null}},{type:"container",children:[{type:"toolbox",children:[{id:"home-cut",
type:"customtoolitem",text:_UNO(".uno:Cut"),command:".uno:Cut",accessibility:{focusBack:true,
combination:"X",de:null}},{id:"home-format-paint-brush",type:"toolitem",text:_UNO(
".uno:FormatPaintbrush"),command:".uno:FormatPaintbrush",accessibility:{focusBack:true,
combination:"FP",de:null}}]},{type:"toolbox",children:[{id:"home-copy",type:"customtoolitem",
text:_UNO(".uno:Copy"),command:".uno:Copy",accessibility:{focusBack:true,combination:"C",de:null}},{
id:"home-set-default",class:"unoResetAttributes",type:"toolitem",text:_UNO(".uno:SetDefault"),
command:".uno:SetDefault",accessibility:{focusBack:true,combination:"SD",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"home-slidefunctions-break",orientation:"vertical"},{
type:"overflowgroup",id:"home-slide-layout",name:_("Slide Layout"),accessibility:{focusBack:true,
combination:"CS",de:null},more:{command:".uno:PageSetup",accessibility:{focusBack:true,
combination:"ML",de:null}},children:[{id:"home-create-slide:NewSlideLayoutMenu",type:"menubutton",
applyCallback:".uno:InsertPage",text:_("New"),command:".uno:InsertPage",accessibility:{
focusBack:true,combination:"CS",de:null}},{type:"container",children:[{
id:"home-change-layout:ChangeSlideLayoutMenu",type:"menubutton",noLabel:true,text:_("Change Layout"
),icon:"lc_changelayout.svg",command:".uno:AssignLayout",accessibility:{focusBack:true,
combination:"CL",de:null}},{id:"home-assign-layout",noLabel:true,text:_("Reset Layout"),
type:"toolitem",command:".uno:AssignLayout",accessibility:{focusBack:true,combination:"RS",de:null}}
],vertical:"true"}]},{type:"separator",id:"home-resertattributes-break",orientation:"vertical"},{
type:"overflowgroup",id:"home-character",name:_("Character"),accessibility:{focusBack:true,
combination:"FN",de:null},more:{command:".uno:FontDialog",accessibility:{focusBack:true,
combination:"MC",de:null}},children:[{type:"container",children:[{type:"container",children:[{
id:"fontnamecombobox",type:"combobox",text:"Carlito",entries:["Carlito"],selectedCount:"1",
selectedEntries:["0"],command:".uno:CharFontName",accessibility:{focusBack:true,combination:"FN",
de:null}},{id:"fontsizecombobox",type:"combobox",text:"12 pt",entries:["12 pt"],selectedCount:"1",
selectedEntries:["0"],command:".uno:FontHeight",accessibility:{focusBack:true,combination:"FS",
de:null}},{id:"home-grow",type:"toolitem",text:_UNO(".uno:Grow"),command:".uno:Grow",accessibility:{
focusBack:true,combination:"FG",de:null}},{id:"home-shrink",type:"toolitem",text:_UNO(".uno:Shrink"
),command:".uno:Shrink",accessibility:{focusBack:true,combination:"FK",de:null}}],vertical:"false"},
{type:"container",children:[{id:"ExtTop4",type:"toolbox",children:[{id:"home-bold",type:"toolitem",
text:_UNO(".uno:Bold"),command:".uno:Bold",accessibility:{focusBack:true,combination:"1",de:null}},{
id:"home-italic",type:"toolitem",text:_UNO(".uno:Italic"),command:".uno:Italic",accessibility:{
focusBack:true,combination:"2",de:null}},{id:"home-underline",type:"toolitem",text:_UNO(
".uno:Underline"),command:".uno:Underline",accessibility:{focusBack:true,combination:"3",de:null}},{
id:"home-strikeout",type:"toolitem",text:_UNO(".uno:Strikeout"),command:".uno:Strikeout",
accessibility:{focusBack:true,combination:"4",de:null}},{id:"home-shadowed",type:"toolitem",
text:_UNO(".uno:Shadowed"),command:".uno:Shadowed",accessibility:{focusBack:true,combination:"SH",
de:null}},{id:"home-fontworkgalleryfloater",type:"toolitem",text:_UNO(".uno:FontworkGalleryFloater"
),command:".uno:FontworkGalleryFloater",visible:app.LOUtil.isFileODF(this.map)?"true":"false",
accessibility:{focusBack:true,combination:"FL",de:null}},{id:"home-charbackcolor:ColorPickerMenu",
noLabel:true,class:"unospan-CharBackColor",type:"toolitem",text:_UNO(".uno:CharBackColor"),
command:".uno:CharBackColor",accessibility:{focusBack:true,combination:"HC",de:null}},{
id:"home-color:ColorPickerMenu",noLabel:true,class:"unospan-FontColor",type:"toolitem",text:_UNO(
".uno:Color"),command:".uno:Color",accessibility:{focusBack:true,combination:"FC",de:null}}]}],
vertical:"false"}],vertical:"true"}]},{type:"separator",id:"home-fontcombobox-break",
orientation:"vertical"},{type:"overflowgroup",id:"home-paragraph",more:{
command:".uno:ParagraphDialog",accessibility:{focusBack:true,combination:"MP",de:null}},name:_(
"Paragraph"),accessibility:{focusBack:true,combination:"DB",de:null},children:[{type:"container",
children:[{type:"container",children:[{type:"toolbox",children:[{id:"home-default-bullet",
type:"toolitem",text:_UNO(".uno:DefaultBullet"),command:".uno:DefaultBullet",accessibility:{
focusBack:true,combination:"DB",de:null}},{id:"home-default-numbering",type:"toolitem",text:_UNO(
".uno:DefaultNumbering"),command:".uno:DefaultNumbering",accessibility:{focusBack:true,
combination:"DN",de:null}},{id:"home-increment-indent",type:"toolitem",text:_UNO(
".uno:IncrementIndent"),command:".uno:IncrementIndent",accessibility:{focusBack:true,
combination:"AI",de:null}},{id:"home-decrement-indent",type:"toolitem",text:_UNO(
".uno:DecrementIndent"),command:".uno:DecrementIndent",accessibility:{focusBack:true,
combination:"AO",de:null}},{id:"home-para-left-to-right",type:"toolitem",text:_UNO(
".uno:ParaLeftToRight"),command:".uno:ParaLeftToRight",accessibility:{focusBack:true,
combination:"TR",de:null}},{id:"home-para-right-to-left",type:"toolitem",text:_UNO(
".uno:ParaRightToLeft"),command:".uno:ParaRightToLeft",accessibility:{focusBack:true,
combination:"TL",de:null}}]}],vertical:"false"},{type:"container",children:[{id:"SectionBottom13",
type:"toolbox",children:[{id:"home-left-paragraph",type:"toolitem",text:_UNO(".uno:LeftPara"),
command:".uno:LeftPara",accessibility:{focusBack:true,combination:"PL",de:null}},{
id:"home-center-paragraph",type:"toolitem",text:_UNO(".uno:CenterPara"),command:".uno:CenterPara",
accessibility:{focusBack:true,combination:"PC",de:null}},{id:"home-right-paragraph",type:"toolitem",
text:_UNO(".uno:RightPara"),command:".uno:RightPara",accessibility:{focusBack:true,combination:"PR",
de:null}},{id:"home-justify-para",type:"toolitem",text:_UNO(".uno:JustifyPara"),
command:".uno:JustifyPara",accessibility:{focusBack:true,combination:"PJ",de:null}},{
id:"home-line-spacing:LineSpacingMenu",type:"menubutton",noLabel:true,text:_UNO(".uno:LineSpacing"),
command:".uno:LineSpacing",accessibility:{focusBack:false,combination:"SL",de:null}}]}],
vertical:"false"}],vertical:"true"}]},{type:"separator",id:"home-linespacingmenu-break",
orientation:"vertical"},{type:"overflowgroup",id:"home-spacing-color",name:_("Spacing & Color"),
accessibility:{focusBack:true,combination:"LT",de:null},children:[{type:"container",children:[{
type:"container",children:[{type:"toolbox",children:[{id:"home-cell-vertical-top",type:"toolitem",
text:_UNO(".uno:CellVertTop"),command:".uno:CellVertTop",accessibility:{focusBack:true,
combination:"LT",de:null}},{id:"home-cell-vertical-center",type:"toolitem",text:_UNO(
".uno:CellVertCenter"),command:".uno:CellVertCenter",accessibility:{focusBack:true,combination:"LC",
de:null}},{id:"home-cell-vertical-bottom",type:"toolitem",text:_UNO(".uno:CellVertBottom"),
command:".uno:CellVertBottom",accessibility:{focusBack:true,combination:"LB",de:null}}]}],
vertical:"false"},{type:"toolbox",children:[{id:"home-xline-color:ColorPickerMenu",noLabel:true,
class:"unospan-XLineColor",type:"toolitem",text:_UNO(".uno:XLineColor"),command:".uno:XLineColor",
accessibility:{focusBack:true,combination:"LR",de:null}},{id:"home-fill-color:ColorPickerMenu",
noLabel:true,class:"unospan-FillColor",type:"toolitem",text:_UNO(".uno:FillColor"),
command:".uno:FillColor",accessibility:{focusBack:true,combination:"BC",de:null}}]}],vertical:"true"
}]},{type:"separator",id:"home-fillcolormenu-break",orientation:"vertical"},{type:"overflowgroup",
id:"illustrations",name:_("Illustrations"),accessibility:{focusBack:true,combination:"IH",de:null},
children:[{type:"container",children:[{id:"LineA6",type:"toolbox",children:[{
id:"home-basic-shapes:InsertShapesMenu",type:"menubutton",noLabel:true,text:_("Shapes"),
command:".uno:BasicShapes",accessibility:{focusBack:true,combination:"IH",de:null}}]},{id:"LineB7",
type:"toolbox",children:[{id:"home-connector-tool-box:InsertConnectorsMenu",type:"menubutton",
noLabel:true,text:_UNO(".uno:ConnectorToolbox","presentation"),command:".uno:ConnectorToolbox",
accessibility:{focusBack:true,combination:"TC",de:null}}]}],vertical:"true"},{type:"container",
children:[{type:"toolbox",children:[{id:"home-insert-graphic:InsertImageMenu",type:"menubutton",
noLabel:true,text:_UNO(".uno:InsertGraphic"),command:".uno:InsertGraphic",accessibility:{
focusBack:true,combination:"IG",de:null}},{id:"home-insert-table:InsertTableMenu",type:"menubutton",
noLabel:true,text:_UNO(".uno:InsertTable","presentation"),command:".uno:InsertTable",accessibility:{
focusBack:true,combination:"IT",de:null}}]},{type:"toolbox",children:[{id:"home-text",
type:"toolitem",text:_UNO(".uno:Text"),command:".uno:Text",accessibility:{focusBack:true,
combination:"TI",de:null}},{id:"home-object-chart",type:"toolitem",text:_UNO(
".uno:InsertObjectChart"),command:".uno:InsertObjectChart",accessibility:{focusBack:true,
combination:"IC",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"home-insertobjectchart-break",orientation:"vertical"},{type:"overflowgroup",id:"home-search",
name:_("Search"),accessibility:{focusBack:true,combination:"SS",de:null},children:[{
type:"container",children:[{type:"toolbox",children:[{id:"home-search",class:"unoSearch",
type:"customtoolitem",text:_("Search"),accessibility:{focusBack:false,combination:"SS",de:"SS"}}]},{
type:"toolbox",children:[{id:"home-search-dialog",type:"toolitem",text:_("Replace"),
command:".uno:SearchDialog?InitialFocusReplace:bool=true",accessibility:{focusBack:false,
combination:"FD",de:null}}]}],vertical:"true"}]}];return this.getTabPage("Home",content)},
getFormatTab:function(){var content=[{type:"overflowgroup",id:"format-style",name:_("Style"),
accessibility:{focusBack:true,combination:"FD",de:null},children:[{id:"format-font-dialog",
type:"bigtoolitem",text:_UNO(".uno:FontDialog"),command:".uno:FontDialog",accessibility:{
focusBack:true,combination:"FD",de:null}},{id:"format-paragraph-dialog",type:"bigtoolitem",
text:_UNO(".uno:ParagraphDialog"),command:".uno:ParagraphDialog",accessibility:{focusBack:true,
combination:"PD",de:null}}]},{type:"separator",id:"format-paragraphdialog-break",
orientation:"vertical"},{id:"format-outline-bullet",type:"bigtoolitem",text:_UNO(
".uno:OutlineBullet"),command:".uno:OutlineBullet",accessibility:{focusBack:true,combination:"OB",
de:null}},{type:"separator",id:"format-outlinebullet-break",orientation:"vertical"},{
id:"format-slide-setup",type:"bigtoolitem",text:_UNO(".uno:SlideSetup","presentation"),
command:".uno:PageSetup",accessibility:{focusBack:true,combination:"SS",de:null}},{type:"separator",
id:"format-slidesetup-break",orientation:"vertical"},{id:"format-format-line",type:"bigtoolitem",
text:_UNO(".uno:FormatLine"),command:".uno:FormatLine",accessibility:{focusBack:true,
combination:"FL",de:null}},{id:"format-format-area",type:"bigtoolitem",text:_UNO(".uno:FormatArea"),
command:".uno:FormatArea",accessibility:{focusBack:true,combination:"FA",de:null}},{
id:"format-transform-dialog",type:"bigtoolitem",text:_UNO(".uno:TransformDialog"),
command:".uno:TransformDialog",accessibility:{focusBack:true,combination:"TD",de:null}},{
type:"separator",id:"format-transformdialog-break",orientation:"vertical"},{
id:"format-name-description",type:"container",children:[{type:"toolbox",children:[{
id:"format-name-group",type:"toolitem",text:_UNO(".uno:NameGroup","text"),command:".uno:NameGroup",
accessibility:{focusBack:false,combination:"NG",de:null}}]},{type:"toolbox",children:[{
id:"format-object-title-description",type:"toolitem",text:_UNO(".uno:ObjectTitleDescription","text"
),command:".uno:ObjectTitleDescription",accessibility:{focusBack:false,combination:"DS",de:null}}]}
],vertical:"true"}];return this.getTabPage("Format",content)},getInsertTab:function(){var content=[{
type:"overflowgroup",id:"insert-slide",name:_("Slides"),accessibility:{focusBack:true,
combination:"IP",de:null},children:[{id:"insert-insert-slide",type:"bigtoolitem",text:_UNO(
".uno:InsertSlide","presentation"),command:".uno:InsertPage",accessibility:{focusBack:true,
combination:"IP",de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"insert-duplicate-slide",type:"toolitem",text:_UNO(".uno:DuplicateSlide","presentation"),
command:".uno:DuplicatePage",accessibility:{focusBack:true,combination:"DP",de:null}}]},{
type:"toolbox",children:[{id:"insert-delete-slide",type:"toolitem",text:_UNO(".uno:DeleteSlide",
"presentation"),command:".uno:DeletePage",accessibility:{focusBack:true,combination:"RP",de:null}}]}
],vertical:"true"}]},{type:"separator",id:"insert-deleteslide-break",orientation:"vertical"},{
type:"overflowgroup",id:"insert-illustrations",name:_("Illustrations"),icon:"lc_insertgraphic.svg",
accessibility:{focusBack:true,combination:"IG",de:null},children:[{type:"container",children:[{
type:"toolbox",children:[{id:"insert-insert-graphic:InsertImageMenu",type:"menubutton",noLabel:true,
text:_UNO(".uno:InsertGraphic"),command:".uno:InsertGraphic",accessibility:{focusBack:true,
combination:"IG",de:null}}]},{type:"toolbox",children:[!window.ThisIsAMobileApp?{
id:"insert-insert-multimedia:InsertMultimediaMenu",type:"menubutton",noLabel:true,text:_UNO(
".uno:InsertAVMedia"),command:"insertmultimedia",accessibility:{focusBack:true,combination:"MM",
de:null}}:{}]}],vertical:"true"},{type:"container",children:[{type:"toolbox",children:[{
id:"insert-insert-table:InsertTableMenu",type:"menubutton",noLabel:true,text:_("Table"),
command:".uno:InsertTable",accessibility:{focusBack:true,combination:"IT",de:null}}]},{
type:"toolbox",children:[{id:"insert-insert-object-chart",type:"toolitem",text:_UNO(
".uno:InsertObjectChart","presentation"),command:".uno:InsertObjectChart",accessibility:{
focusBack:true,combination:"IC",de:null}}]}],vertical:"true"},{type:"container",children:[{
type:"toolbox",children:[{id:"insert-basic-shapes:InsertShapesMenu",type:"menubutton",noLabel:true,
text:_("Shapes"),command:".uno:BasicShapes",accessibility:{focusBack:true,combination:"IS",de:null}}
]},{type:"toolbox",children:[{id:"insert-presentation",type:"toolitem",text:_UNO(".uno:Line",
"presentation"),command:".uno:Line",accessibility:{focusBack:true,combination:"IR",de:null}}]}],
vertical:"true"},{type:"container",children:[{type:"toolbox",children:[{id:"bezier_unfilled",
type:"toolitem",text:_UNO(".uno:Bezier_Unfilled","presentation"),command:".uno:Bezier_Unfilled",
accessibility:{focusBack:true,combination:"CR",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"insert-insertobjectchart-break",orientation:"vertical"},this.map["wopi"
].EnableRemoteLinkPicker?{type:"container",children:[{type:"toolbox",children:[{
id:"insert-hyperlink-dialog",class:"unoHyperlinkDialog",type:"customtoolitem",text:_UNO(
".uno:HyperlinkDialog"),command:"hyperlinkdialog",accessibility:{focusBack:true,combination:"IL",
de:null}}]},{type:"toolbox",children:[{id:"insert-insert-remote-link",class:"unoremotelink",
type:"customtoolitem",text:_("Smart Picker"),command:"remotelink",accessibility:{focusBack:true,
combination:"RL",de:null}}]}],vertical:"true"}:{id:"HyperlinkDialog",class:"unoHyperlinkDialog",
type:"bigcustomtoolitem",text:_UNO(".uno:HyperlinkDialog"),command:"hyperlinkdialog",accessibility:{
focusBack:true,combination:"IL",de:null}},{type:"separator",id:"insert-hyperlinkdialog-break",
orientation:"vertical"},this.map["wopi"].EnableRemoteAIContent?{
id:"insert-insert-remote-ai-content",class:"unoremoteaicontent",type:"bigcustomtoolitem",text:_(
"Assistant"),command:"remoteaicontent",accessibility:{focusBack:true,combination:"RL",de:null}}:{},{
id:"insert-insert-annotation",type:"bigtoolitem",text:_UNO(".uno:InsertAnnotation","text"),
command:".uno:InsertAnnotation",accessibility:{focusBack:false,combination:"ZC",de:"ZC"}},{
type:"separator",id:"insert-insertannotation-break",orientation:"vertical"},{type:"overflowgroup",
id:"insert-field",name:_("Field"),accessibility:{focusBack:true,combination:"DF",de:null},children:[
{type:"container",children:[{type:"toolbox",children:[{id:"insert-insert-date-field-fix",
type:"toolitem",text:_UNO(".uno:InsertDateFieldFix","presentation"),
command:".uno:InsertDateFieldFix",accessibility:{focusBack:true,combination:"DF",de:null}},{
id:"insert-insert-date-field-var",type:"toolitem",text:_UNO(".uno:InsertDateFieldVar","presentation"
),command:".uno:InsertDateFieldVar",accessibility:{focusBack:true,combination:"DV",de:null}},{
id:"insert-insert-slide-field",type:"toolitem",text:_UNO(".uno:InsertSlideField","presentation"),
command:".uno:InsertPageField",accessibility:{focusBack:true,combination:"SF",de:null}},{
id:"insert-insert-slides-field",type:"toolitem",text:_UNO(".uno:InsertSlidesField","presentation"),
command:".uno:InsertPagesField",accessibility:{focusBack:true,combination:"SM",de:null}}]},{
type:"toolbox",children:[{id:"insert-insert-time-field-fix",type:"toolitem",text:_UNO(
".uno:InsertTimeFieldFix","presentation"),command:".uno:InsertTimeFieldFix",accessibility:{
focusBack:true,combination:"TF",de:null}},{id:"insert-insert-time-field-var",type:"toolitem",
text:_UNO(".uno:InsertTimeFieldVar","presentation"),command:".uno:InsertTimeFieldVar",
accessibility:{focusBack:true,combination:"TV",de:null}},{id:"insert-insert-slide-title-field",
type:"toolitem",text:_UNO(".uno:InsertSlideTitleField","presentation"),
command:".uno:InsertPageTitleField",accessibility:{focusBack:true,combination:"PT",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"insert-insertslidetitlefield-break",orientation:"vertical"}
,{type:"overflowgroup",id:"insert-text",name:_("Text"),accessibility:{focusBack:true,
combination:"IX",de:null},children:[{id:"insert-text",type:"bigtoolitem",text:_UNO(".uno:Text"),
command:".uno:Text",accessibility:{focusBack:true,combination:"IX",de:null}},{type:"container",
children:[{type:"toolbox",children:[{id:"insert-fontwork-gallery-floater",type:"toolitem",text:_UNO(
".uno:FontworkGalleryFloater"),command:".uno:FontworkGalleryFloater",visible:app.LOUtil.isFileODF(
this.map)?"true":"false",accessibility:{focusBack:true,combination:"FW",de:null}}]},{type:"toolbox",
children:[{id:"insert-vertical-text",type:app.LOUtil.isFileODF(this.map)?"toolitem":"bigtoolitem",
text:_UNO(".uno:VerticalText","presentation"),command:".uno:VerticalText",accessibility:{
focusBack:true,combination:"VT",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"insert-verticaltext-break",orientation:"vertical"},{type:"container",children:[{type:"toolbox",
children:[{id:"insert-header-and-footer",type:"toolitem",text:_UNO(".uno:HeaderAndFooter",
"presentation"),command:".uno:HeaderAndFooter",accessibility:{focusBack:true,combination:"HF",
de:null}}]},{type:"toolbox",children:[{id:"CharmapControl",class:"unoCharmapControl",
type:"customtoolitem",text:_UNO(".uno:CharmapControl"),command:"charmapcontrol",accessibility:{
focusBack:true,combination:"IM",de:null}}]}],vertical:"true"}];return this.getTabPage("Insert",
content)},getDesignTab:function(){var content=[{id:"design-master-page-group",type:"overflowgroup",
name:_("Master Slide Templates"),nofold:true,icon:"lc_masterslide.svg",children:[{
id:"masterpageall_icons",type:"iconview"}]},{type:"separator",id:"design-masterslides-break",
orientation:"vertical"},{id:"design-theme-dialog",type:"bigtoolitem",text:_UNO(".uno:ThemeDialog"),
command:".uno:ThemeDialog",accessibility:{focusBack:false,combination:"J",de:null}},{
type:"separator",id:"design-themedialog-break",orientation:"vertical"},{type:"overflowgroup",
id:"design-slide-layout",name:_("Slide Layout"),accessibility:{focusBack:true,combination:"CS",
de:null},more:{command:".uno:PageSetup",accessibility:{focusBack:true,combination:"ML",de:null}},
children:[{id:"home-change-layout:ChangeSlideLayoutMenu",type:"menubutton",text:_("Change Layout"),
icon:"lc_changelayout.svg",command:".uno:AssignLayout",accessibility:{focusBack:true,
combination:"CL",de:null}},{id:"home-assign-layout",text:_("Reset Layout"),type:"bigtoolitem",
command:".uno:AssignLayout",accessibility:{focusBack:true,combination:"RS",de:null}}]},{
type:"separator",id:"design-slidelayout-break",orientation:"vertical"},{
id:"design-slide-size:SlideSizeMenu",class:"unoSlideSize",type:"menubutton",text:_("Slide Size"),
command:"slidesize",accessibility:{focusBack:true,combination:"SS",de:null}},{
id:"design-slide-setup",type:"bigtoolitem",text:_UNO(".uno:SlideSetup","presentation"),
command:".uno:PageSetup",accessibility:{focusBack:true,combination:"SP",de:null}},{
id:"design-header-and-footer",type:"bigtoolitem",text:_UNO(".uno:HeaderAndFooter","presentation"),
command:".uno:HeaderAndFooter",accessibility:{focusBack:true,combination:"HF",de:null}},{
type:"separator",id:"design-headerandfooter-break",orientation:"vertical"},{
id:"design-selectbackground",class:"unoselectbackground",type:"bigtoolitem",text:_(
"Background Image"),command:".uno:SelectBackground",accessibility:{focusBack:true,combination:"SB",
de:null}}];return this.getTabPage("Design",content)},getMasterTab:function(){var content=[{
id:"master-slide-setup",type:"bigtoolitem",text:_UNO(".uno:SlideSetup","presentation"),
command:".uno:PageSetup",accessibility:{focusBack:false,combination:"PS",de:null}},{
id:"master-header-and-footer",type:"bigtoolitem",text:_UNO(".uno:HeaderAndFooter","presentation"),
command:".uno:HeaderAndFooter",accessibility:{focusBack:false,combination:"HF",de:null}},{
id:"master-rename-master-page",type:"bigtoolitem",text:_UNO(".uno:RenameMasterPage","presentation"),
command:".uno:RenameMasterPage",accessibility:{focusBack:false,combination:"RP",de:null}},{
id:"master-close-master-view",type:"bigtoolitem",text:_UNO(".uno:CloseMasterView","presentation"),
command:".uno:CloseMasterView",accessibility:{focusBack:false,combination:"CV",de:null}}];
return this.getTabPage("MasterPage",content)},getReviewTab:function(){var content=[{
id:"review-spell-dialog",type:"bigtoolitem",text:_UNO(".uno:SpellDialog"),
command:".uno:SpellDialog",accessibility:{focusBack:false,combination:"SD",de:null}},{
id:"LanguageMenu",type:"bigcustomtoolitem",text:_UNO(".uno:LanguageMenu"),command:"languagemenu",
accessibility:{focusBack:false,combination:"TM",de:null}},{id:"Review-Section-Language1",
type:"container",children:[{id:"LineA19",type:"toolbox",children:[{id:"review-spell-online",
type:"toolitem",text:_UNO(".uno:SpellOnline"),command:".uno:SpellOnline",accessibility:{
focusBack:true,combination:"SO",de:null}}]},{id:"LineB20",type:"toolbox",children:[{
id:"review-hyphenation",type:"toolitem",text:_UNO(".uno:Hyphenation","presentation"),
command:".uno:Hyphenation",accessibility:{focusBack:true,combination:"HY",de:null}}]}],
vertical:"true"},{type:"separator",id:"review-hyphenation-break",orientation:"vertical"},{
type:"overflowgroup",id:"review-comments",name:_("Comments"),accessibility:{focusBack:true,
combination:"L",de:null},children:[{id:"review-insert-annotation",type:"bigtoolitem",text:_UNO(
".uno:InsertAnnotation"),command:".uno:InsertAnnotation",accessibility:{focusBack:true,
combination:"L",de:null}},{id:"review-delete-all-annotations",type:"bigtoolitem",text:_UNO(
".uno:DeleteAllAnnotation","presentation"),command:".uno:DeleteAllAnnotation",accessibility:{
focusBack:true,combination:"RC",de:null}}]}];return this.getTabPage("Review",content)},
getTableTab:function(){var content=[{id:"table-table-dialog",type:"bigtoolitem",text:_UNO(
".uno:TableDialog","presentation",true),command:".uno:TableDialog",accessibility:{focusBack:false,
combination:"SD",de:null}},{type:"separator",id:"table-bigtoolitem-break",orientation:"vertical"},{
type:"overflowgroup",id:"table-insert",name:_("Insert"),accessibility:{focusBack:true,
combination:"CB",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"table-insert-columns-before",type:"toolitem",text:_UNO(".uno:InsertColumnsBefore","presentation"
),command:".uno:InsertColumnsBefore",accessibility:{focusBack:true,combination:"CB",de:null}},{
id:"table-insert-columns-after",type:"toolitem",text:_UNO(".uno:InsertColumnsAfter","presentation"),
command:".uno:InsertColumnsAfter",accessibility:{focusBack:true,combination:"CA",de:null}},{
id:"table-delete-columns",type:"toolitem",text:_UNO(".uno:DeleteColumns","presentation"),
command:".uno:DeleteColumns",accessibility:{focusBack:true,combination:"CD",de:null}}]},{
type:"toolbox",children:[{id:"table-insert-rows-before",type:"toolitem",text:_UNO(
".uno:InsertRowsBefore","presentation"),command:".uno:InsertRowsBefore",accessibility:{
focusBack:true,combination:"RB",de:null}},{id:"table-insert-rows-after",type:"toolitem",text:_UNO(
".uno:InsertRowsAfter","presentation"),command:".uno:InsertRowsAfter",accessibility:{focusBack:true,
combination:"RA",de:null}},{id:"table-delete-rows",type:"toolitem",text:_UNO(".uno:DeleteRows",
"presentation"),command:".uno:DeleteRows",accessibility:{focusBack:true,combination:"RD",de:null}}]}
],vertical:"true"}]},{type:"separator",id:"table-deleterows-break",orientation:"vertical"},{
type:"overflowgroup",id:"table-merge-split",name:_("Merge & Split"),accessibility:{focusBack:true,
combination:"MC",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"table-merge-cells",type:"toolitem",text:_UNO(".uno:MergeCells","presentation"),
command:".uno:MergeCells",accessibility:{focusBack:true,combination:"MC",de:null}}]},{
type:"toolbox",children:[{id:"table-split-cells",type:"toolitem",text:_UNO(".uno:SplitCell",
"presentation"),command:".uno:SplitCell",accessibility:{focusBack:true,combination:"SC",de:null}}]}
],vertical:"true"}]},{type:"separator",id:"table-merge-split-table-break",orientation:"vertical"},{
type:"overflowgroup",id:"table-select",name:_("Select"),accessibility:{focusBack:true,
combination:"ST",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"table-select-table",type:"toolitem",text:_UNO(".uno:SelectTable","presentation"),
command:".uno:SelectTable",accessibility:{focusBack:true,combination:"ST",de:null}}]},{
type:"toolbox",children:[{id:"table-delete-table",type:"toolitem",text:_UNO(".uno:DeleteTable",
"presentation"),command:".uno:DeleteTable",accessibility:{focusBack:true,combination:"TD",de:null}}]
}],vertical:"true"},{type:"container",children:[{type:"toolbox",children:[{id:"table-entire-column",
type:"toolitem",text:_UNO(".uno:EntireColumn","presentation"),command:".uno:EntireColumn",
accessibility:{focusBack:true,combination:"CE",de:null}}]},{type:"toolbox",children:[{
id:"table-entire-row",type:"toolitem",text:_UNO(".uno:EntireRow","presentation"),
command:".uno:EntireRow",accessibility:{focusBack:true,combination:"RE",de:null}}]}],vertical:"true"
}]},{type:"separator",id:"table-select-break",orientation:"vertical"},{type:"overflowgroup",
id:"table-paragraph",name:_("Paragraph"),accessibility:{focusBack:true,combination:"CT",de:null},
children:[{type:"container",children:[{type:"container",children:[{type:"toolbox",children:[{
id:"table-cell-vertical-top",type:"toolitem",text:_UNO(".uno:CellVertTop"),
command:".uno:CellVertTop",accessibility:{focusBack:true,combination:"CT",de:null}},{
id:"table-cell-vertical-center",type:"toolitem",text:_UNO(".uno:CellVertCenter"),
command:".uno:CellVertCenter",accessibility:{focusBack:true,combination:"CC",de:null}},{
id:"table-cell-vertical-bottom",type:"toolitem",text:_UNO(".uno:CellVertBottom"),
command:".uno:CellVertBottom",accessibility:{focusBack:true,combination:"CM",de:null}}]}],
vertical:"false"},{type:"container",children:[{id:"SectionBottom13",type:"toolbox",children:[{
id:"table-left-para",type:"toolitem",text:_UNO(".uno:LeftPara"),command:".uno:LeftPara",
accessibility:{focusBack:true,combination:"PL",de:null}},{id:"table-center-para",type:"toolitem",
text:_UNO(".uno:CenterPara"),command:".uno:CenterPara",accessibility:{focusBack:true,
combination:"PC",de:null}},{id:"table-right-para",type:"toolitem",text:_UNO(".uno:RightPara"),
command:".uno:RightPara",accessibility:{focusBack:true,combination:"PR",de:null}},{
id:"table-justify-para",type:"toolitem",text:_UNO(".uno:JustifyPara"),command:".uno:JustifyPara",
accessibility:{focusBack:true,combination:"PJ",de:null}}]}],vertical:"false"}],vertical:"true"}]},{
type:"separator",id:"table-justifypara-break",orientation:"vertical"},{type:"container",children:[{
type:"toolbox",children:[{id:"table-xline-color:ColorPickerMenu",noLabel:true,type:"toolitem",
text:_UNO(".uno:XLineColor"),command:".uno:XLineColor",accessibility:{focusBack:true,
combination:"LC",de:null}}]},{type:"toolbox",children:[{id:"table-fill-color:ColorPickerMenu",
noLabel:true,type:"toolitem",text:_UNO(".uno:FillColor"),command:".uno:FillColor",accessibility:{
focusBack:true,combination:"FC",de:null}}]}],vertical:"true"},{type:"separator",
id:"table-color-fill-break",orientation:"vertical"},{type:"overflowgroup",id:"table-align",name:_(
"Align"),accessibility:{focusBack:true,combination:"AL",de:null},children:[{type:"container",
children:[{type:"toolbox",children:[{id:"table-object-align-left",type:"toolitem",text:_UNO(
".uno:ObjectAlignLeft"),command:".uno:ObjectAlignLeft",accessibility:{focusBack:true,
combination:"AL",de:null}},{id:"table-align-center",type:"toolitem",text:_UNO(".uno:AlignCenter"),
command:".uno:AlignCenter",accessibility:{focusBack:true,combination:"AC",de:null}},{
id:"table-object-align-right",type:"toolitem",text:_UNO(".uno:ObjectAlignRight"),
command:".uno:ObjectAlignRight",accessibility:{focusBack:true,combination:"AR",de:null}}]},{
type:"toolbox",children:[{id:"table-align-up",type:"toolitem",text:_UNO(".uno:AlignUp"),
command:".uno:AlignUp",accessibility:{focusBack:true,combination:"AU",de:null}},{
id:"table-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle"),command:".uno:AlignMiddle",
accessibility:{focusBack:true,combination:"AM",de:null}},{id:"table-align-down",type:"toolitem",
text:_UNO(".uno:AlignDown"),command:".uno:AlignDown",accessibility:{focusBack:true,combination:"AD",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"table-align-break",orientation:"vertical"},{
type:"overflowgroup",id:"table-arrange",name:_("Arrange"),accessibility:{focusBack:true,
combination:"BF",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"table-bring-to-front",type:"toolitem",text:_UNO(".uno:BringToFront"),
command:".uno:BringToFront",accessibility:{focusBack:true,combination:"BF",de:null}},{
id:"table-send-to-back",type:"toolitem",text:_UNO(".uno:SendToBack"),command:".uno:SendToBack",
accessibility:{focusBack:true,combination:"SB",de:null}}]},{type:"toolbox",children:[{
id:"table-object-forward-one",type:"toolitem",text:_UNO(".uno:ObjectForwardOne"),
command:".uno:ObjectForwardOne",accessibility:{focusBack:true,combination:"FO",de:null}},{
id:"table-object-back-one",type:"toolitem",text:_UNO(".uno:ObjectBackOne"),
command:".uno:ObjectBackOne",accessibility:{focusBack:true,combination:"BO",de:null}}]}],
vertical:"true"}]}];return this.getTabPage("Table",content)},getShapeTab:function(){var content=[{
id:"shape-transform-dialog",type:"bigtoolitem",text:_UNO(".uno:TransformDialog","text"),
command:".uno:TransformDialog",accessibility:{focusBack:false,combination:"TD",de:null}},{
type:"separator",id:"shape-transformdialog-break",orientation:"vertical"},{type:"container",
children:[{type:"toolbox",children:[{id:"shape-flip-vertical",type:"toolitem",text:_UNO(
".uno:FlipVertical"),command:".uno:FlipVertical",accessibility:{focusBack:true,combination:"FV",
de:null}}]},{type:"toolbox",children:[{id:"shape-flip-horizontal",type:"toolitem",text:_UNO(
".uno:FlipHorizontal"),command:".uno:FlipHorizontal",accessibility:{focusBack:true,combination:"FH",
de:null}}]}],vertical:"true"},{type:"separator",id:"shape-fliphorizontal-break",
orientation:"vertical"},{type:"container",children:[{type:"toolbox",children:[{
id:"shape-xline-color:ColorPickerMenu",noLabel:true,type:"toolitem",text:_UNO(".uno:XLineColor"),
command:".uno:XLineColor",accessibility:{focusBack:true,combination:"LC",de:null}}]},{
type:"toolbox",children:[{id:"shape-fill-color:ColorPickerMenu",noLabel:true,type:"toolitem",
text:_UNO(".uno:FillColor"),command:".uno:FillColor",accessibility:{focusBack:true,combination:"FC",
de:null}}]}],vertical:"true"},{type:"separator",id:"shape-fillcolor-break",orientation:"vertical"},{
id:"shape-convert-curve",type:"bigtoolitem",text:_UNO(".uno:ChangeBezier","presentation"),
command:".uno:ChangeBezier",accessibility:{focusBack:true,combination:"CB",de:null}},{
type:"separator",id:"shape-convertcurve-break",orientation:"vertical"},{type:"overflowgroup",
id:"shape-align",name:_("Align"),accessibility:{focusBack:true,combination:"AL",de:null},children:[{
type:"container",children:[{type:"toolbox",children:[{id:"shape-object-align-left",type:"toolitem",
text:_UNO(".uno:ObjectAlignLeft"),command:".uno:ObjectAlignLeft",accessibility:{focusBack:true,
combination:"AL",de:null}},{id:"shape-align-center",type:"toolitem",text:_UNO(".uno:AlignCenter"),
command:".uno:AlignCenter",accessibility:{focusBack:true,combination:"AC",de:null}},{
id:"shape-object-align-right",type:"toolitem",text:_UNO(".uno:ObjectAlignRight"),
command:".uno:ObjectAlignRight",accessibility:{focusBack:true,combination:"AR",de:null}}]},{
type:"toolbox",children:[{id:"shape-align-up",type:"toolitem",text:_UNO(".uno:AlignUp"),
command:".uno:AlignUp",accessibility:{focusBack:true,combination:"AU",de:null}},{
id:"shape-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle"),command:".uno:AlignMiddle",
accessibility:{focusBack:true,combination:"AM",de:null}},{id:"shape-align-down",type:"toolitem",
text:_UNO(".uno:AlignDown"),command:".uno:AlignDown",accessibility:{focusBack:true,combination:"AD",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"shape-aligndown-break",orientation:"vertical"}
,{type:"overflowgroup",id:"shape-arrange",name:_("Arrange"),accessibility:{focusBack:true,
combination:"BF",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"shape-bring-to-front",type:"toolitem",text:_UNO(".uno:BringToFront"),
command:".uno:BringToFront",accessibility:{focusBack:true,combination:"BF",de:null}},{
id:"shape-send-to-back",type:"toolitem",text:_UNO(".uno:SendToBack"),command:".uno:SendToBack",
accessibility:{focusBack:true,combination:"SB",de:null}}]},{type:"toolbox",children:[{
id:"shape-object-forward-one",type:"toolitem",text:_UNO(".uno:ObjectForwardOne"),
command:".uno:ObjectForwardOne",accessibility:{focusBack:true,combination:"FO",de:null}},{
id:"shape-object-back-one",type:"toolitem",text:_UNO(".uno:ObjectBackOne"),
command:".uno:ObjectBackOne",accessibility:{focusBack:true,combination:"BO",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"shape-objectbackone-break",orientation:"vertical"},{
type:"overflowgroup",id:"shape-group",name:_("Group"),accessibility:{focusBack:true,
combination:"FG",de:null},children:[{id:"shape-format-group",type:"bigtoolitem",text:_UNO(
".uno:FormatGroup"),command:".uno:FormatGroup",accessibility:{focusBack:true,combination:"FG",
de:null}},{type:"container",children:[{type:"toolbox",children:[{id:"shape-enter-group",
type:"toolitem",text:_UNO(".uno:EnterGroup"),command:".uno:EnterGroup",accessibility:{
focusBack:true,combination:"EG",de:null}}]},{type:"toolbox",children:[{id:"shape-leave-group",
type:"toolitem",text:_UNO(".uno:LeaveGroup"),command:".uno:LeaveGroup",accessibility:{
focusBack:true,combination:"LG",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"shape-leavegroup-break",orientation:"vertical"},{id:"layout-interaction",type:"bigtoolitem",
text:_UNO(".uno:AnimationEffects","presentation"),command:".uno:AnimationEffects",accessibility:{
focusBack:true,combination:"IA",de:null}}];return this.getTabPage("Shape",content)},
getPictureTab:function(){var content=[{type:"overflowgroup",id:"picture-image-adjustment",name:_(
"Image Controls"),accessibility:{focusBack:true,combination:"BN",de:null},children:[{
type:"container",children:[{id:"picture-brightness:PictureBrightness",type:"menubutton",
command:".uno:GrafLuminance",text:_UNO(".uno:GrafLuminance"),icon:"lc_setbrightness.svg",
accessibility:{focusBack:true,combination:"BN",de:null}},{id:"picture-contrast:PictureContrast",
type:"menubutton",command:".uno:GrafContrast",text:_UNO(".uno:GrafContrast"),
icon:"lc_setcontrast.svg",accessibility:{focusBack:true,combination:"CN",de:null}},{
id:"picture-colormode:PictureColorMode",type:"menubutton",command:".uno:GrafMode",text:_UNO(
".uno:GrafMode"),icon:"lc_setgraphtransparency.svg",accessibility:{focusBack:true,combination:"CO",
de:null}},{id:"picture-effects:PictureEffectsMenu",type:"menubutton",text:_("Effects"),
accessibility:{focusBack:true,combination:"EF",de:null}},{
id:"picture-transparency:PictureTransparency",type:"menubutton",command:".uno:GrafTransparence",
text:_UNO(".uno:GrafTransparence"),icon:"lc_setgraphtransparency.svg",accessibility:{focusBack:true,
combination:"TP",de:null}}]}]},{type:"separator",id:"picture-transparency-break",
orientation:"vertical"},{type:"container",children:[{type:"toolbox",children:[{
id:"picture-xline-color:ColorPickerMenu",type:"menubutton",noLabel:true,text:_UNO(".uno:XLineColor"
),command:".uno:XLineColor",accessibility:{focusBack:true,combination:"LC",de:null}}]},{
type:"toolbox",children:[{id:"picture-fill-color:ColorPickerMenu",type:"menubutton",noLabel:true,
text:_UNO(".uno:FillColor"),command:".uno:FillColor",accessibility:{focusBack:true,combination:"FC",
de:null}}]}],vertical:"true"},{type:"separator",id:"picture-fillcolor-break",orientation:"vertical"}
,{id:"picture-transform-dialog",type:"bigtoolitem",text:_UNO(".uno:TransformDialog","text"),
command:".uno:TransformDialog",accessibility:{focusBack:false,combination:"TD",de:null}},{
type:"separator",id:"picture-transformdialog-break",orientation:"vertical"},{type:"container",
children:[{type:"toolbox",children:[{id:"picture-flip-vertical",type:"toolitem",text:_UNO(
".uno:FlipVertical"),command:".uno:FlipVertical",accessibility:{focusBack:true,combination:"FV",
de:null}}]},{type:"toolbox",children:[{id:"picture-flip-horizontal",type:"toolitem",text:_UNO(
".uno:FlipHorizontal"),command:".uno:FlipHorizontal",accessibility:{focusBack:true,combination:"FH",
de:null}}]}],vertical:"true"},{type:"separator",id:"picture-fliphorizontal-break",
orientation:"vertical"},{type:"overflowgroup",id:"picture-align",name:_("Align"),accessibility:{
focusBack:true,combination:"AL",de:null},children:[{type:"container",children:[{type:"toolbox",
children:[{id:"picture-object-align-left",type:"toolitem",text:_UNO(".uno:ObjectAlignLeft"),
command:".uno:ObjectAlignLeft",accessibility:{focusBack:true,combination:"AL",de:null}},{
id:"picture-align-center",type:"toolitem",text:_UNO(".uno:AlignCenter"),command:".uno:AlignCenter",
accessibility:{focusBack:true,combination:"AC",de:null}},{id:"picture-object-align-right",
type:"toolitem",text:_UNO(".uno:ObjectAlignRight"),command:".uno:ObjectAlignRight",accessibility:{
focusBack:true,combination:"AR",de:null}}]},{type:"toolbox",children:[{id:"picture-align-up",
type:"toolitem",text:_UNO(".uno:AlignUp"),command:".uno:AlignUp",accessibility:{focusBack:true,
combination:"AU",de:null}},{id:"picture-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle"),
command:".uno:AlignMiddle",accessibility:{focusBack:true,combination:"AM",de:null}},{
id:"picture-align-down",type:"toolitem",text:_UNO(".uno:AlignDown"),command:".uno:AlignDown",
accessibility:{focusBack:true,combination:"AD",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"picture-aligndown-break",orientation:"vertical"},{type:"overflowgroup",id:"picture-arrange",
name:_("Arrange"),accessibility:{focusBack:true,combination:"BF",de:null},children:[{
type:"container",children:[{type:"toolbox",children:[{id:"picture-bring-to-front",type:"toolitem",
text:_UNO(".uno:BringToFront"),command:".uno:BringToFront",accessibility:{focusBack:true,
combination:"BF",de:null}},{id:"picture-send-to-back",type:"toolitem",text:_UNO(".uno:SendToBack"),
command:".uno:SendToBack",accessibility:{focusBack:true,combination:"SB",de:null}}]},{
type:"toolbox",children:[{id:"picture-object-forward-one",type:"toolitem",text:_UNO(
".uno:ObjectForwardOne"),command:".uno:ObjectForwardOne",accessibility:{focusBack:true,
combination:"FO",de:null}},{id:"picture-object-back-one",type:"toolitem",text:_UNO(
".uno:ObjectBackOne"),command:".uno:ObjectBackOne",accessibility:{focusBack:true,combination:"BO",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"picture-objectbackone-break",
orientation:"vertical"},{type:"overflowgroup",id:"picture-group",name:_("Group"),accessibility:{
focusBack:true,combination:"FG",de:null},children:[{id:"picture-format-group",type:"bigtoolitem",
text:_UNO(".uno:FormatGroup"),command:".uno:FormatGroup",accessibility:{focusBack:true,
combination:"FG",de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"picture-enter-group",type:"toolitem",text:_UNO(".uno:EnterGroup"),command:".uno:EnterGroup",
accessibility:{focusBack:true,combination:"EG",de:null}}]},{type:"toolbox",children:[{
id:"picture-leave-group",type:"toolitem",text:_UNO(".uno:LeaveGroup"),command:".uno:LeaveGroup",
accessibility:{focusBack:true,combination:"LG",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"picture-leavegroup-break",orientation:"vertical"},{type:"bigtoolitem",text:_UNO(".uno:Crop"),
command:".uno:Crop",context:"Graphic"},{type:"separator",id:"picture-crop-break",
orientation:"vertical"},{id:"layout-interaction",type:"bigtoolitem",text:_UNO(
".uno:AnimationEffects","presentation"),command:".uno:AnimationEffects",accessibility:{
focusBack:true,combination:"IA",de:null}}];return this.getTabPage("Picture",content)}});
window.L.control.notebookbarImpress=function(options){
return new window.L.Control.NotebookbarImpress(options)};
window.L.Control.NotebookbarDraw=window.L.Control.NotebookbarImpress.extend({
getShortcutsBarData:function(){return[!this.map["wopi"].HideSaveOption?{id:"shortcutstoolbox",
type:"toolbox",children:[{id:"save",type:"toolitem",text:_("Save"),command:".uno:Save",
accessKey:"1",isCustomTooltip:true}]}:{}]},getOptionsSectionData:function(){
return this.buildOptionsSectionData([{type:"toolitem",text:_UNO(".uno:Sidebar"),
command:".uno:SidebarDeck.PropertyDeck",accessibility:{focusBack:true,combination:"ZB",de:null}},{
type:"toolitem"}])},getTabs:function(){return[{id:"File-tab-label",text:_("File"),name:"File",
accessibility:{focusBack:true,combination:"F",de:null}},{id:this.HOME_TAB_ID,text:_("Home"),
name:"Home",context:"default|DrawText",accessibility:{focusBack:true,combination:"H",de:null}},{
id:"Insert-tab-label",text:_("Insert"),name:"Insert",accessibility:{focusBack:true,combination:"N",
de:null}},{id:"Layout-tab-label",text:_("Layout"),name:"Layout",accessibility:{focusBack:true,
combination:"P",de:null}},{id:"Review-tab-label",text:_("Review"),name:"Review",accessibility:{
focusBack:true,combination:"R",de:null}},{id:"Format-tab-label",text:_("Format"),name:"Format",
accessibility:{focusBack:true,combination:"M",de:null}},{id:"Table-tab-label",text:_("Table"),
name:"Table",context:"Table",accessibility:{focusBack:true,combination:"T",de:null}},{
id:"Shape-tab-label",text:_("Shape"),name:"Shape",
context:"Draw|DrawLine|3DObject|MultiObject|DrawFontwork",accessibility:{focusBack:true,
combination:"D",de:null}},{id:"Picture-tab-label",text:_("Picture"),name:"Picture",
context:"Graphic",accessibility:{focusBack:true,combination:"G",de:null}},{id:"View-tab-label",
text:_("View"),name:"View",accessibility:{focusBack:true,combination:"V",de:null}},{
id:"Help-tab-label",text:_("Help"),name:"Help",accessibility:{focusBack:true,combination:"Y",de:null
}}]},getTabsJSON:function(){return[this.getFileTab(),this.getHomeTab(),this.getInsertTab(),
this.getLayoutTab(),this.getReviewTab(),this.getFormatTab(),this.getTableTab(),this.getShapeTab(),
this.getPictureTab(),this.getViewTab(),this.getHelpTab()]},getFullJSON:function(selectedId){
return this.getNotebookbar(this.getTabsJSON(),selectedId)},getFileTab:function(){var content=[];
var hasSave=!this.map["wopi"].HideSaveOption;var hasSaveAs=!this.map["wopi"].UserCanNotWriteRelative
var hasShare=this.map["wopi"].EnableShare;var hasRevisionHistory=window.L.Params.revHistoryEnabled;
if(hasSave){content.push({type:"container",children:[{id:"file-save",type:"bigtoolitem",text:_(
"Save"),command:".uno:Save",accessibility:{focusBack:true,combination:"SF",de:null}}]})}if(hasSaveAs
){content.push({id:"file-saveas",type:"bigtoolitem",text:_UNO(".uno:SaveAs","presentation"),
command:".uno:SaveAs",accessibility:{focusBack:true,combination:"SA",de:null}})}if(hasSaveAs){
content.push({id:"exportas:ExportAsMenu",command:"exportas",class:"unoexportas",
type:"exportmenubutton",text:_("Export As"),accessibility:{focusBack:true,combination:"EA",de:null}}
)}if(hasShare&&hasRevisionHistory){content.push({id:"file-exportas-break",type:"separator",
orientation:"vertical"},{type:"container",children:[{id:"ShareAs",class:"unoShareAs",
type:"customtoolitem",text:_("Share"),command:"shareas",inlineLabel:true,accessibility:{
focusBack:true,combination:"SH"}},{id:"Rev-History",class:"unoRev-History",type:"customtoolitem",
text:_("See history"),command:"rev-history",inlineLabel:true,accessibility:{focusBack:true,
combination:"RH"}}],vertical:true},{id:"file-revhistory-break",type:"separator",
orientation:"vertical"})}else if(hasShare){content.push({id:"file-exportas-break",type:"separator",
orientation:"vertical"},{type:"container",children:[{id:"ShareAs",class:"unoShareAs",
type:"bigcustomtoolitem",text:_("Share"),command:"shareas",accessibility:{focusBack:true,
combination:"SH"}}]},{id:"file-shareas-break",type:"separator",orientation:"vertical"})}else if(
hasRevisionHistory){content.push({id:"file-exportas-break",type:"separator",orientation:"vertical"},
{type:"container",children:[{id:"Rev-History",class:"unoRev-History",type:"bigcustomtoolitem",
text:_("See history"),command:"rev-history",accessibility:{focusBack:true,combination:"RH"}}]},{
id:"file-revhistory-break",type:"separator",orientation:"vertical"})}if(!this.map["wopi"
].HidePrintOption){content.push({id:"print",type:"bigtoolitem",text:"Печать",command:".uno:Print",accessibility:{focusBack:true,combination:"P",de:null}})}if(!this.map["wopi"
].HideExportOption){content.push({id:"downloadas:DownloadAsMenu",command:"downloadas",
class:"unodownloadas",type:"exportmenubutton",text:_("Download"),accessibility:{focusBack:true,
combination:"DA",de:null}})}content.push({id:"file-exportpdf",type:"container",children:[{
id:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",class:"unoexportas",
type:"customtoolitem",text:_("PDF Document (.pdf)"),
command:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",inlineLabel:true,accessibility:{
focusBack:true,combination:"EP",de:null}},{id:"exportpdf",class:"unoexportas",type:"customtoolitem",
text:_("PDF Document (.pdf) - Expert"),command:"exportpdf",inlineLabel:true,accessibility:{
focusBack:true,combination:"ES",de:null}}],vertical:"true"});content.push({type:"separator",
id:"file-exportpdf-break",orientation:"vertical"});if(!this.map["wopi"].HideRepairOption){
content.push({type:"container",children:[{id:"repair",class:"unorepair",type:"bigcustomtoolitem",
text:_("Repair"),accessibility:{focusBack:true,combination:"RF",de:null}}]})}content.push({
type:"container",children:[{id:"properties",type:"bigtoolitem",text:_("Properties"),
command:".uno:SetDocumentProperties",accessibility:{focusBack:true,combination:"FP",de:"I"}}]});if(
window.documentSigningEnabled){content.push({type:"container",children:[{id:"signature",
type:"bigtoolitem",text:_("Signature"),command:".uno:Signature",accessibility:{focusBack:true,
combination:"SN"}}]})}if(this._map["wopi"]._supportsRename()&&this._map["wopi"].UserCanRename){
content.push({type:"container",children:[{id:"renamedocument",class:"unoRenameDocument",
type:"bigcustomtoolitem",text:_("Rename"),accessibility:{focusBack:true,combination:"RN",de:null}}]}
)}if(window.wopiSettingBaseUrl){content.push({type:"separator",id:"file-properties-break",
orientation:"vertical"});content.push({id:"settings-dialog",type:"bigtoolitem",text:_("Options"),
command:".uno:Settings",accessibility:{focusBack:false,combination:"T",de:null}})}
return this.getTabPage("File",content)},getViewTab:function(){var content=[{type:"overflowgroup",
id:"view-zoom",name:_("Zoom"),accessibility:{focusBack:true,combination:"FR",de:null},children:[
window.mode.isTablet()?{id:"closemobile",type:"bigcustomtoolitem",text:_("Read mode"),
command:"closetablet"}:{},{id:"view-fullscreen",type:"bigtoolitem",text:_UNO(".uno:FullScreen"),
command:".uno:FullScreen",accessibility:{focusBack:true,combination:"FR",de:null}},{id:"zoomreset",
class:"unozoomreset",type:"bigcustomtoolitem",text:_("Reset zoom"),accessibility:{focusBack:true,
combination:"RZ",de:null}},{type:"container",children:[{type:"toolbox",children:[{id:"zoomout",
class:"unozoomout",type:"customtoolitem",text:_UNO(".uno:ZoomMinus"),accessibility:{focusBack:true,
combination:"ZO",de:null}}]},{type:"toolbox",children:[{id:"zoomin",class:"unozoomin",
type:"customtoolitem",text:_UNO(".uno:ZoomPlus"),accessibility:{focusBack:true,combination:"ZI",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"view-zoomin-break",orientation:"vertical"},{
id:"toggleuimode",class:"unotoggleuimode",type:"bigcustomtoolitem",text:_("Compact view"),
accessibility:{focusBack:true,combination:"UI",de:null}},{type:"container",children:[{
type:"toolbox",children:[{id:"showruler",class:"unoshowruler",type:"customtoolitem",text:_("Ruler"),
accessibility:{focusBack:true,combination:"R",de:"L"}}]},{type:"toolbox",children:[{
id:"showstatusbar",class:"unoshowstatusbar",type:"customtoolitem",text:_("Status Bar"),
accessibility:{focusBack:true,combination:"SB",de:null}}]}],vertical:"true"},{
id:"collapsenotebookbar",class:"unocollapsenotebookbar",type:"bigcustomtoolitem",text:_(
"Collapse Tabs"),accessibility:{focusBack:true,combination:"CT",de:null}},{type:"separator",
id:"view-collapsenotebookbar-break",orientation:"vertical"},{type:"overflowgroup",id:"view-grid",
name:_("Grid"),accessibility:{focusBack:true,combination:"GV",de:null},children:[{type:"toolbox",
children:[{id:"home-grid-visible",type:"toolitem",text:_UNO(".uno:GridVisible"),
command:".uno:GridVisible",accessibility:{focusBack:true,combination:"GV",de:null}},{
id:"home-grid-use",type:"toolitem",text:_UNO(".uno:GridUse"),command:".uno:GridUse",accessibility:{
focusBack:true,combination:"GU",de:null}}],vertical:"true"}]},{type:"separator",
id:"view-griduse-break",orientation:"vertical"},{id:"toggledarktheme",type:"bigcustomtoolitem",
text:_("Dark Mode"),accessibility:{focusBack:true,combination:"DT",de:null}},{id:"invertbackground",
class:"unoinvertbackground",type:"bigcustomtoolitem",text:_("Invert Background"),accessibility:{
focusBack:true,combination:"BG",de:null}},{type:"separator",id:"view-invertbackground-break",
orientation:"vertical"},{id:"view-sidebar",type:"bigtoolitem",text:_UNO(".uno:Sidebar"),
command:".uno:SidebarDeck.PropertyDeck",accessibility:{focusBack:true,combination:"SB",de:null}},{
id:"view-navigator",type:"bigtoolitem",text:_UNO(".uno:Navigator"),command:".uno:Navigator",
accessibility:{focusBack:true,combination:"N",de:null}}];return this.getTabPage("View",content)},
getHomeTab:function(){var content=[{id:"home-undo-redo",type:"container",children:[{id:"home-undo",
type:"toolitem",text:_UNO(".uno:Undo"),command:".uno:Undo",accessibility:{focusBack:true,
combination:"ZZ",de:null}},{id:"home-redo",type:"toolitem",text:_UNO(".uno:Redo"),
command:".uno:Redo",accessibility:{focusBack:true,combination:"O",de:null}}],vertical:"true"},{
type:"separator",id:"home-undoredo-break",orientation:"vertical"},{type:"overflowgroup",
id:"home-clipboard",name:_("Clipboard"),accessibility:{focusBack:true,combination:"V",de:null},
children:[{id:"home-paste:PasteMenu",type:"menubutton",text:_UNO(".uno:Paste"),command:".uno:Paste",
accessibility:{focusBack:true,combination:"V",de:null}},{type:"container",children:[{type:"toolbox",
children:[{id:"home-cut",type:"customtoolitem",text:_UNO(".uno:Cut"),command:".uno:Cut",
accessibility:{focusBack:true,combination:"X",de:null}},{id:"home-format-paint-brush",
type:"toolitem",text:_UNO(".uno:FormatPaintbrush"),command:".uno:FormatPaintbrush",accessibility:{
focusBack:true,combination:"FP",de:null}}]},{type:"toolbox",children:[{id:"home-copy",
type:"customtoolitem",text:_UNO(".uno:Copy"),command:".uno:Copy",accessibility:{focusBack:true,
combination:"C",de:null}},{id:"home-set-default",type:"toolitem",text:_UNO(".uno:SetDefault"),
command:".uno:SetDefault",accessibility:{focusBack:true,combination:"SF",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"home-setdefault-break",orientation:"vertical"},{
type:"overflowgroup",id:"home-font",name:_("Font"),accessibility:{focusBack:true,combination:"FN",
de:null},more:{command:".uno:FontDialog",accessibility:{focusBack:true,combination:"MF",de:null}},
children:[{type:"container",children:[{type:"container",children:[{id:"fontnamecombobox",
type:"combobox",text:"Carlito",entries:["Carlito"],selectedCount:"1",selectedEntries:["0"],
command:".uno:CharFontName",accessibility:{focusBack:true,combination:"FN",de:null}},{
id:"fontsizecombobox",type:"combobox",text:"12 pt",entries:["12 pt"],selectedCount:"1",
selectedEntries:["0"],command:".uno:FontHeight",accessibility:{focusBack:true,combination:"FS",
de:null}},{id:"home-grow",type:"toolitem",text:_UNO(".uno:Grow"),command:".uno:Grow",accessibility:{
focusBack:true,combination:"FG",de:null}},{id:"home-shrink",type:"toolitem",text:_UNO(".uno:Shrink"
),command:".uno:Shrink",accessibility:{focusBack:true,combination:"FK",de:null}}],vertical:"false"},
{type:"container",children:[{id:"ExtTop4",type:"toolbox",children:[{id:"home-bold",type:"toolitem",
text:_UNO(".uno:Bold"),command:".uno:Bold",accessibility:{focusBack:true,combination:"1",de:null}},{
id:"home-italic",type:"toolitem",text:_UNO(".uno:Italic"),command:".uno:Italic",accessibility:{
focusBack:true,combination:"2",de:null}},{id:"home-underline",type:"toolitem",text:_UNO(
".uno:Underline"),command:".uno:Underline",accessibility:{focusBack:true,combination:"3",de:null}},{
id:"home-strikeout",type:"toolitem",text:_UNO(".uno:Strikeout"),command:".uno:Strikeout",
accessibility:{focusBack:true,combination:"4",de:null}},{id:"home-shadowed",type:"toolitem",
text:_UNO(".uno:Shadowed"),command:".uno:Shadowed",accessibility:{focusBack:true,combination:"SH",
de:null}},{id:"home-fontwork-gallery",type:"toolitem",text:_UNO(".uno:FontworkGalleryFloater"),
command:".uno:FontworkGalleryFloater",visible:app.LOUtil.isFileODF(this.map)?"true":"false",
accessibility:{focusBack:true,combination:"FW",de:null}},{id:"home-char-back-color:ColorPickerMenu",
noLabel:true,class:"unospan-CharBackColor",type:"toolitem",text:_UNO(".uno:CharBackColor"),
command:".uno:CharBackColor",accessibility:{focusBack:true,combination:"BC",de:null}},{
id:"home-color:ColorPickerMenu",noLabel:true,class:"unospan-FontColor",type:"toolitem",text:_UNO(
".uno:Color"),command:".uno:Color",accessibility:{focusBack:true,combination:"FC",de:null}}]}],
vertical:"false"}],vertical:"true"}]},{type:"separator",id:"home-font-combobox",
orientation:"vertical"},{type:"overflowgroup",id:"home-alignment",name:_("Alignment"),
accessibility:{focusBack:true,combination:"AT",de:null},children:[{type:"container",children:[{
type:"container",children:[{type:"toolbox",children:[{id:"home-cell-vertical-top",type:"toolitem",
text:_UNO(".uno:CellVertTop"),command:".uno:CellVertTop",accessibility:{focusBack:true,
combination:"AT",de:null}},{id:"home-cell-vertical-center",type:"toolitem",text:_UNO(
".uno:CellVertCenter"),command:".uno:CellVertCenter",accessibility:{focusBack:true,combination:"AC",
de:null}},{id:"home-cell-vertical-bottom",type:"toolitem",text:_UNO(".uno:CellVertBottom"),
command:".uno:CellVertBottom",accessibility:{focusBack:true,combination:"AB",de:null}}]}],
vertical:"false"},{type:"container",children:[{id:"SectionBottom13",type:"toolbox",children:[{
id:"home-left-para",type:"toolitem",text:_UNO(".uno:LeftPara"),command:".uno:LeftPara",
accessibility:{focusBack:true,combination:"PL",de:null}},{id:"home-center-para",type:"toolitem",
text:_UNO(".uno:CenterPara"),command:".uno:CenterPara",accessibility:{focusBack:true,
combination:"PC",de:null}},{id:"home-right-para",type:"toolitem",text:_UNO(".uno:RightPara"),
command:".uno:RightPara",accessibility:{focusBack:true,combination:"PR",de:null}},{
id:"home-justify-para",type:"toolitem",text:_UNO(".uno:JustifyPara"),command:".uno:JustifyPara",
accessibility:{focusBack:true,combination:"PJ",de:null}}]}],vertical:"false"}],vertical:"true"}]},{
type:"separator",id:"home-justifypara-break",orientation:"vertical"},{type:"overflowgroup",
id:"home-paragraph",name:_("Paragraph"),accessibility:{focusBack:true,combination:"BD",de:null},
more:{command:".uno:ParagraphDialog",accessibility:{focusBack:true,combination:"MP",de:null}},
children:[{type:"container",children:[{type:"container",children:[{type:"toolbox",children:[{
id:"home-default-bullet",type:"toolitem",text:_UNO(".uno:DefaultBullet"),
command:".uno:DefaultBullet",accessibility:{focusBack:true,combination:"BD",de:null}},{
id:"home-default-numbering",type:"toolitem",text:_UNO(".uno:DefaultNumbering"),
command:".uno:DefaultNumbering",accessibility:{focusBack:true,combination:"ND",de:null}},{
id:"home-increment-indent",type:"toolitem",text:_UNO(".uno:IncrementIndent"),
command:".uno:IncrementIndent",accessibility:{focusBack:true,combination:"II",de:null}},{
id:"home-decrement-indent",type:"toolitem",text:_UNO(".uno:DecrementIndent"),
command:".uno:DecrementIndent",accessibility:{focusBack:true,combination:"ID",de:null}},{
id:"home-para-left-to-right",type:"toolitem",text:_UNO(".uno:ParaLeftToRight"),
command:".uno:ParaLeftToRight",accessibility:{focusBack:true,combination:"LT",de:null}}]}],
vertical:"false"},{type:"container",children:[{id:"SectionBottom13",type:"toolbox",children:[{
id:"home-para-space-increase",type:"toolitem",text:_UNO(".uno:ParaspaceIncrease"),
command:".uno:ParaspaceIncrease",accessibility:{focusBack:true,combination:"SI",de:null}},{
id:"home-para-space-decrease",type:"toolitem",text:_UNO(".uno:ParaspaceDecrease"),
command:".uno:ParaspaceDecrease",accessibility:{focusBack:true,combination:"SD",de:null}},{
id:"home-line-spacing:LineSpacingMenu",type:"menubutton",noLabel:true,text:_UNO(".uno:LineSpacing"),
command:".uno:LineSpacing",accessibility:{focusBack:false,combination:"LS",de:null}},{
id:"home-para-right-to-left",type:"toolitem",text:_UNO(".uno:ParaRightToLeft"),
command:".uno:ParaRightToLeft",accessibility:{focusBack:true,combination:"RT",de:null}}]}],
vertical:"false"}],vertical:"true"}]},{type:"separator",id:"home-pararighttoleft-break",
orientation:"vertical"},{id:"home-text",type:"bigtoolitem",text:_UNO(".uno:Text"),
command:".uno:Text",accessibility:{focusBack:true,combination:"DT",de:null}},{type:"separator",
id:"home-inserttext-break",orientation:"vertical"},{type:"overflowgroup",id:"home-illustrations",
name:_("Illustrations"),accessibility:{focusBack:true,combination:"IS",de:null},children:[{
type:"container",children:[{id:"LineA6",type:"toolbox",children:[{
id:"home-basic-shapes:InsertShapesMenu",type:"menubutton",noLabel:true,text:_("Shapes"),
command:".uno:BasicShapes",accessibility:{focusBack:true,combination:"IS",de:null}}]},{id:"LineB7",
type:"toolbox",children:[{id:"home-connector-toolbox:InsertConnectorsMenu",type:"menubutton",
noLabel:true,text:_UNO(".uno:ConnectorToolbox","presentation"),command:".uno:ConnectorToolbox",
accessibility:{focusBack:true,combination:"TC",de:null}}]}],vertical:"true"},{type:"container",
children:[{type:"toolbox",children:[{id:"home-insert-graphic:InsertImageMenu",type:"menubutton",
noLabel:true,text:_UNO(".uno:InsertGraphic"),command:".uno:InsertGraphic",accessibility:{
focusBack:true,combination:"IG",de:null}}]},{type:"toolbox",children:[{
id:"home-insert-object-chart",type:"toolitem",text:_UNO(".uno:InsertObjectChart"),
command:".uno:InsertObjectChart",accessibility:{focusBack:true,combination:"IC",de:null}},{
id:"home-insert-table:InsertTableMenu",type:"menubutton",noLabel:true,text:_UNO(".uno:InsertTable",
"presentation"),command:".uno:InsertTable",accessibility:{focusBack:true,combination:"IT",de:null}}]
}],vertical:"true"}]},{type:"separator",id:"home-insertconnectorsmenu-break",orientation:"vertical"}
,{type:"container",children:[{type:"toolbox",children:[{id:"home-xline-color:ColorPickerMenu",
noLabel:true,class:"unospan-XLineColor",type:"toolitem",text:_UNO(".uno:XLineColor"),
command:".uno:XLineColor",accessibility:{focusBack:true,combination:"NC",de:null}}]},{
type:"toolbox",children:[{id:"home-fill-color:ColorPickerMenu",noLabel:true,
class:"unospan-BackgroundColor",type:"toolitem",text:_UNO(".uno:FillColor"),
command:".uno:FillColor",accessibility:{focusBack:true,combination:"LC",de:null}}]}],vertical:"true"
},{type:"separator",id:"home-fillcolorpickermenu-break",orientation:"vertical"},{
type:"overflowgroup",id:"home-page-insert",name:_("Insert"),accessibility:{focusBack:true,
combination:"IP",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"home-insert-page",type:"toolitem",text:_UNO(".uno:InsertPage","presentation"),
command:".uno:InsertPage",accessibility:{focusBack:true,combination:"IP",de:null}}]},{
type:"toolbox",children:[{id:"home-duplicate-page",type:"toolitem",text:_UNO(".uno:DuplicatePage",
"presentation"),command:".uno:DuplicatePage",accessibility:{focusBack:true,combination:"DP",de:null}
}]}],vertical:"true"}]},{type:"separator",id:"home-inserttablemenu-break",orientation:"vertical"},{
type:"overflowgroup",id:"home-search",name:_("Search"),accessibility:{focusBack:true,
combination:"SS",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"home-search",class:"unoSearch",type:"customtoolitem",text:_("Search"),accessibility:{
focusBack:false,combination:"SS",de:"SS"}}]},{type:"toolbox",children:[{id:"home-search-dialog",
type:"toolitem",text:_("Replace"),command:".uno:SearchDialog?InitialFocusReplace:bool=true",
accessibility:{focusBack:false,combination:"FD",de:null}}]}],vertical:"true"}]}];
return this.getTabPage("Home",content)},getLayoutTab:function(){var content=[{
id:"layout-header-and-footer",type:"bigtoolitem",text:_UNO(".uno:HeaderAndFooter","presentation"),
command:".uno:HeaderAndFooter",accessibility:{focusBack:true,combination:"IH",de:null}},{
type:"separator",id:"layout-headerandfooter-break",orientation:"vertical"},{type:"overflowgroup",
id:"layout-page",name:_("Page"),accessibility:{focusBack:true,combination:"IP",de:null},children:[{
id:"layout-insert-page",type:"bigtoolitem",text:_UNO(".uno:InsertPage","presentation"),
command:".uno:InsertPage",accessibility:{focusBack:true,combination:"IP",de:null}},{
type:"container",children:[{type:"toolbox",children:[{id:"layout-duplicate-page",type:"toolitem",
text:_UNO(".uno:DuplicatePage","presentation"),command:".uno:DuplicatePage",accessibility:{
focusBack:true,combination:"DP",de:null}}]},{type:"toolbox",children:[{id:"layout-page-setup",
type:"toolitem",text:_UNO(".uno:PageSetup","presentation"),command:".uno:PageSetup",accessibility:{
focusBack:true,combination:"PS",de:null}}]},{type:"toolbox",children:[{id:"selectbackground",
class:"unoselectbackground",type:"customtoolitem",text:_UNO(".uno:SelectBackground","presentation"),
accessibility:{focusBack:true,combination:"SB",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"layout-selectbackground-break",orientation:"vertical"},{id:"layout-sidebar-deck",
type:"bigtoolitem",text:_("Page Layout"),command:".uno:SidebarDeck.PropertyDeck",accessibility:{
focusBack:true,combination:"PL",de:null}},{type:"separator",id:"layout-sidebardeck-break",
orientation:"vertical"},{id:"layout-select-all",type:"bigtoolitem",text:_UNO(".uno:SelectAll"),
command:".uno:SelectAll",accessibility:{focusBack:true,combination:"SA",de:null}},{type:"separator",
id:"layout-selectall-break",orientation:"vertical"},{type:"overflowgroup",id:"layout-align",name:_(
"Align"),accessibility:{focusBack:true,combination:"AL",de:null},children:[{type:"container",
children:[{type:"toolbox",children:[{id:"layout-object-align-left",type:"toolitem",text:_UNO(
".uno:ObjectAlignLeft"),command:".uno:ObjectAlignLeft",accessibility:{focusBack:true,
combination:"AL",de:null}},{id:"layout-align-center",type:"toolitem",text:_UNO(".uno:AlignCenter"),
command:".uno:AlignCenter",accessibility:{focusBack:true,combination:"AC",de:null}},{
id:"layout-object-align-right",type:"toolitem",text:_UNO(".uno:ObjectAlignRight"),
command:".uno:ObjectAlignRight",accessibility:{focusBack:true,combination:"AR",de:null}}]},{
type:"toolbox",children:[{id:"layout-align-up",type:"toolitem",text:_UNO(".uno:AlignUp"),
command:".uno:AlignUp",accessibility:{focusBack:true,combination:"AU",de:null}},{
id:"layout-align-middle",type:"toolitem",text:_UNO(".uno:AlignMiddle"),command:".uno:AlignMiddle",
accessibility:{focusBack:true,combination:"AM",de:null}},{id:"layout-align-down",type:"toolitem",
text:_UNO(".uno:AlignDown"),command:".uno:AlignDown",accessibility:{focusBack:true,combination:"AD",
de:null}}]}],vertical:"true"}]},{type:"separator",id:"layout-aligndown-break",orientation:"vertical"
},{type:"overflowgroup",id:"layout-arrange",name:_("Arrange"),accessibility:{focusBack:true,
combination:"FO",de:null},children:[{type:"container",children:[{type:"toolbox",children:[{
id:"layout-object-forward-one",type:"toolitem",text:_UNO(".uno:ObjectForwardOne"),
command:".uno:ObjectForwardOne",accessibility:{focusBack:true,combination:"FO",de:null}},{
id:"layout-bring-to-front",type:"toolitem",text:_UNO(".uno:BringToFront"),
command:".uno:BringToFront",accessibility:{focusBack:true,combination:"BF",de:null}}]},{
type:"toolbox",children:[{id:"layout-object-backwards-one",type:"toolitem",text:_UNO(
".uno:ObjectBackOne"),command:".uno:ObjectBackOne",accessibility:{focusBack:true,combination:"BO",
de:null}},{id:"layout-send-to-back",type:"toolitem",text:_UNO(".uno:SendToBack"),
command:".uno:SendToBack",accessibility:{focusBack:true,combination:"SB",de:null}}]}],
vertical:"true"}]}];return this.getTabPage("Layout",content)},getInsertTab:function(){var content=[{
type:"overflowgroup",id:"insert-page",name:_("Page"),accessibility:{focusBack:true,combination:"IP",
de:null},children:[{id:"insert-insert-page",type:"bigtoolitem",text:_UNO(".uno:InsertPage",
"presentation"),command:".uno:InsertPage",accessibility:{focusBack:true,combination:"IP",de:null}},{
type:"container",children:[{type:"toolbox",children:[{id:"insert-duplicate-page",type:"toolitem",
text:_UNO(".uno:DuplicatePage","presentation"),command:".uno:DuplicatePage",accessibility:{
focusBack:true,combination:"DP",de:null}}]},{type:"toolbox",children:[{id:"insert-delete-page",
type:"toolitem",text:_UNO(".uno:DeletePage","presentation"),command:".uno:DeletePage",
accessibility:{focusBack:true,combination:"RP",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"insert-deletepage-break",orientation:"vertical"},{type:"overflowgroup",
id:"insert-illustrations",name:_("Illustrations"),accessibility:{focusBack:true,combination:"IG",
de:null},children:[{id:"insert-insert-graphic:InsertImageMenu",type:"menubutton",text:_UNO(
".uno:InsertGraphic"),command:".uno:InsertGraphic",accessibility:{focusBack:true,combination:"IG",
de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"insert-insert-table:InsertTableMenu",type:"menubutton",noLabel:true,text:_("Table"),
command:".uno:InsertTable",accessibility:{focusBack:true,combination:"IT",de:null}}]},{
type:"toolbox",children:[{id:"insert-insert-object-chart",type:"toolitem",text:_UNO(
".uno:InsertObjectChart","presentation"),command:".uno:InsertObjectChart",accessibility:{
focusBack:true,combination:"IC",de:null}}]}],vertical:"true"},{type:"container",children:[{
type:"toolbox",children:[{id:"insert-basic-shapes:InsertShapesMenu",type:"menubutton",noLabel:true,
text:_("Shapes"),command:".uno:BasicShapes",accessibility:{focusBack:true,combination:"BS",de:null}}
]},{type:"toolbox",children:[{id:"insert-line",type:"toolitem",text:_UNO(".uno:Line","presentation"
),command:".uno:Line",accessibility:{focusBack:true,combination:"IL",de:null}}]}],vertical:"true"},{
type:"container",children:[{type:"toolbox",children:[{id:"bezier_unfilled",type:"toolitem",
text:_UNO(".uno:Bezier_Unfilled","presentation"),command:".uno:Bezier_Unfilled",accessibility:{
focusBack:true,combination:"CR",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"insert-insertobjectchart-break",orientation:"vertical"},{id:"HyperlinkDialog",
class:"unoHyperlinkDialog",type:"bigcustomtoolitem",text:_UNO(".uno:HyperlinkDialog"),
command:"hyperlinkdialog",accessibility:{focusBack:true,combination:"HD",de:null}},{
type:"separator",id:"insert-hyperlinkdialog-break",orientation:"vertical"},{type:"overflowgroup",
id:"insert-field",name:_("Field"),accessibility:{focusBack:true,combination:"RL",de:null},children:[
this.map["wopi"].EnableRemoteLinkPicker?{id:"insert-remote-link",class:"unoremotelink",
type:"bigcustomtoolitem",text:_("Smart Picker"),command:"remotelink",accessibility:{focusBack:true,
combination:"RL",de:null}}:{},this.map["wopi"].EnableRemoteAIContent?{
id:"insert-insert-remote-ai-content",class:"unoremoteaicontent",type:"bigcustomtoolitem",text:_(
"Assistant"),command:"remoteaicontent",accessibility:{focusBack:true,combination:"RL",de:null}}:{},{
type:"container",children:[{type:"toolbox",children:[{id:"insert-innsert-date-field-fix",
type:"toolitem",text:_UNO(".uno:InsertDateFieldFix","presentation"),
command:".uno:InsertDateFieldFix",accessibility:{focusBack:true,combination:"ID",de:null}},{
id:"insert-insert-date-field-var",type:"toolitem",text:_UNO(".uno:InsertDateFieldVar","presentation"
),command:".uno:InsertDateFieldVar",accessibility:{focusBack:true,combination:"IV",de:null}},{
id:"insert-insert-page-field",type:"toolitem",text:_UNO(".uno:InsertPageField","presentation"),
command:".uno:InsertPageField",accessibility:{focusBack:true,combination:"IF",de:null}},{
id:"insert-insert-pages-field",type:"toolitem",text:_UNO(".uno:InsertPagesField","presentation"),
command:".uno:InsertPagesField",accessibility:{focusBack:true,combination:"IS",de:null}}]},{
type:"toolbox",children:[{id:"insert-time-field-fix",type:"toolitem",text:_UNO(
".uno:InsertTimeFieldFix","presentation"),command:".uno:InsertTimeFieldFix",accessibility:{
focusBack:true,combination:"TF",de:null}},{id:"insert-time-field-var",type:"toolitem",text:_UNO(
".uno:InsertTimeFieldVar","presentation"),command:".uno:InsertTimeFieldVar",accessibility:{
focusBack:true,combination:"TV",de:null}},{id:"insert-page-title-field",type:"toolitem",text:_UNO(
".uno:InsertPageTitleField","presentation"),command:".uno:InsertPageTitleField",accessibility:{
focusBack:true,combination:"PT",de:null}}]}],vertical:"true"}]},{type:"separator",
id:"insert-pagetitlefield-break",orientation:"vertical"},{type:"overflowgroup",id:"insert-text",
name:_("Text"),accessibility:{focusBack:true,combination:"TI",de:null},children:[{id:"insert-text",
type:"bigtoolitem",text:_UNO(".uno:Text"),command:".uno:Text",accessibility:{focusBack:true,
combination:"TI",de:null}},{type:"container",children:[{type:"toolbox",children:[{
id:"insert-font-gallery-floater",type:"toolitem",text:_UNO(".uno:FontworkGalleryFloater"),
command:".uno:FontworkGalleryFloater",visible:app.LOUtil.isFileODF(this.map)?"true":"false",
accessibility:{focusBack:true,combination:"FG",de:null}}]},{type:"toolbox",children:[{
id:"insert-vertical-text",type:"toolitem",text:_UNO(".uno:VerticalText","presentation"),
command:".uno:VerticalText",accessibility:{focusBack:true,combination:"VT",de:null}}]}],
vertical:"true"}]},{type:"separator",id:"insert-insertannotation-break",orientation:"vertical"},{
type:"container",children:[{type:"toolbox",children:[{id:"CharmapControl",class:"unoCharmapControl",
type:"customtoolitem",text:_UNO(".uno:CharmapControl"),command:"charmapcontrol",accessibility:{
focusBack:true,combination:"CM",de:null}}]},{type:"toolbox",children:[{
id:"insert-insert-annnotation",type:"toolitem",text:_UNO(".uno:InsertAnnotation","text"),
command:".uno:InsertAnnotation",accessibility:{focusBack:true,combination:"IA",de:null}}]}],
vertical:"true"}];return this.getTabPage("Insert",content)},getFormatTab:function(){var content=[{
type:"overflowgroup",id:"format-style",name:_("Style"),accessibility:{focusBack:true,
combination:"FD",de:null},children:[{id:"format-font-dialog",type:"bigtoolitem",text:_UNO(
".uno:FontDialog"),command:".uno:FontDialog",accessibility:{focusBack:true,combination:"FD",de:null}
},{id:"format-paragraph-dialog",type:"bigtoolitem",text:_UNO(".uno:ParagraphDialog"),
command:".uno:ParagraphDialog",accessibility:{focusBack:true,combination:"PD",de:null}}]},{
type:"separator",id:"font-paragraphdialog-break",orientation:"vertical"},{
id:"format-outline-bullet",type:"bigtoolitem",text:_UNO(".uno:OutlineBullet"),
command:".uno:OutlineBullet",accessibility:{focusBack:true,combination:"OB",de:null}},{
type:"separator",id:"font-outlinebullet-break",orientation:"vertical"},{id:"format-page-setup",
type:"bigtoolitem",text:_UNO(".uno:PageSetup","presentation"),command:".uno:PageSetup",
accessibility:{focusBack:true,combination:"PS",de:null}},{type:"separator",
id:"font-pagesetup-break",orientation:"vertical"},{id:"format-line",type:"bigtoolitem",text:_UNO(
".uno:FormatLine"),command:".uno:FormatLine",accessibility:{focusBack:true,combination:"FL",de:null}
},{id:"format-area",type:"bigtoolitem",text:_UNO(".uno:FormatArea"),command:".uno:FormatArea",
accessibility:{focusBack:true,combination:"FA",de:null}},{type:"separator",
id:"font-formatarea-break",orientation:"vertical"},{id:"format-transform-dialog",type:"bigtoolitem",
text:_UNO(".uno:TransformDialog"),command:".uno:TransformDialog",accessibility:{focusBack:true,
combination:"TD",de:null}},{type:"separator",id:"font-transformdialog-break",orientation:"vertical"}
,{id:"format-name-description",type:"container",children:[{type:"toolbox",children:[{
id:"format-name-group",type:"toolitem",text:_UNO(".uno:NameGroup","text"),command:".uno:NameGroup",
accessibility:{focusBack:false,combination:"NG",de:null}}]},{type:"toolbox",children:[{
id:"format-object-title-description",type:"toolitem",text:_UNO(".uno:ObjectTitleDescription","text"
),command:".uno:ObjectTitleDescription",accessibility:{focusBack:false,combination:"DS",de:null}}]}
],vertical:"true"},{type:"separator",id:"font-objecttitledescription-break",orientation:"vertical"},
{id:"format-theme-dialog",type:"bigtoolitem",text:_UNO(".uno:ThemeDialog"),
command:".uno:ThemeDialog",accessibility:{focusBack:false,combination:"J",de:null}}];
return this.getTabPage("Format",content)}});window.L.control.notebookbarDraw=function(options){
return new window.L.Control.NotebookbarDraw(options)};
window.L.Control.NotebookbarBuilder=window.L.Control.JSDialogBuilder.extend({
_customizeOptions:function(){this.options.noLabelsForUnoButtons=true;
this.options.useInLineLabelsForUnoButtons=false;this.options.cssClass="notebookbar"},
_overrideHandlers:function(){this._controlHandlers["bigtoolitem"]=this._bigtoolitemHandler;
this._controlHandlers["combobox"]=this._comboboxControl;this._controlHandlers["exportmenubutton"
]=this._exportMenuButton;this._controlHandlers["tabcontrol"]=this._overriddenTabsControlHandler;
this._controlHandlers["tabpage"]=this._overriddenTabPageHandler;this._toolitemHandlers[
".uno:XLineColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[".uno:FontColor"
]=JSDialog.colorPickerButton;this._toolitemHandlers[".uno:CharBackColor"]=JSDialog.colorPickerButton
this._toolitemHandlers[".uno:BackgroundColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[
".uno:TableCellBackgroundColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[
".uno:FrameLineColor"]=JSDialog.colorPickerButton;this._toolitemHandlers[".uno:Color"
]=JSDialog.colorPickerButton;this._toolitemHandlers[".uno:FillColor"]=JSDialog.colorPickerButton;
this._toolitemHandlers[".uno:SelectBackground"]=this._selectBackgroundControl;
this._toolitemHandlers[".uno:InsertAnnotation"]=this._insertAnnotationControl;
this._toolitemHandlers[".uno:SetDefault"]=this._formattingControl;this._toolitemHandlers[".uno:Save"
]=this._saveControl;this._toolitemHandlers[".uno:SaveAs"]=this._saveAsControl;
this._toolitemHandlers[".uno:Print"]=this._printControl;this._toolitemHandlers[".uno:Settings"
]=this._onlineHelpControl;this._toolitemHandlers[".uno:InsertPageHeader"]=this._headerFooterControl;
this._toolitemHandlers[".uno:InsertPageFooter"]=this._headerFooterControl;this._toolitemHandlers[
".uno:Text"]=this._insertTextBoxControl;this._toolitemHandlers[".uno:DrawText"
]=this._insertTextBoxControl;this._toolitemHandlers[".uno:VerticalText"]=this._insertTextBoxControl;
this._toolitemHandlers[".uno:OnlineHelp"]=this._onlineHelpControl;this._toolitemHandlers[
".uno:ForumHelp"]=this._onlineHelpControl;this._toolitemHandlers[".uno:KeyboardShortcuts"
]=this._onlineHelpControl;this._toolitemHandlers[".uno:ReportIssue"]=this._onlineHelpControl;
this._toolitemHandlers[".uno:LatestUpdates"]=this._onlineHelpControl;this._toolitemHandlers[
".uno:Feedback"]=this._onlineHelpControl;this._toolitemHandlers[".uno:About"
]=this._onlineHelpControl;this._toolitemHandlers[".uno:FullScreen"]=this._onlineHelpControl;
this._toolitemHandlers[".uno:Zoom"]=function(){};this._toolitemHandlers[".uno:InsertObject"
]=function(){};this._toolitemHandlers[".uno:Gallery"]=function(){};this._toolitemHandlers[
".uno:BasicShapes.ellipse"]=function(){};this._toolitemHandlers[".uno:BasicShapes.rectangle"
]=function(){};this._toolitemHandlers[".uno:SymbolShapes"]=function(){};this._toolitemHandlers[
".uno:ArrowShapes"]=function(){};this._toolitemHandlers[".uno:StarShapes"]=function(){};
this._toolitemHandlers[".uno:CalloutShapes"]=function(){};this._toolitemHandlers[
".uno:FlowChartShapes"]=function(){};this._toolitemHandlers[".uno:EmojiControl"]=function(){};
this._toolitemHandlers[".uno:InsertDraw"]=function(){};this._toolitemHandlers[".uno:PageMargin"
]=function(){};this._toolitemHandlers[".uno:Orientation"]=function(){};this._toolitemHandlers[
".uno:SelectObject"]=function(){};this._toolitemHandlers[".uno:LineStyle"]=function(){};
this._toolitemHandlers[".uno:AutoSum"]=function(){};this._toolitemHandlers[".uno:ReplyComment"
]=function(){};this._toolitemHandlers[".uno:DeleteComment"]=function(){};this._toolitemHandlers[
".uno:CompareDocuments"]=function(){};this._toolitemHandlers[".uno:MergeDocuments"]=function(){};
this._toolitemHandlers[".uno:FunctionBox"]=function(){};this._toolitemHandlers[".uno:EditAnnotation"
]=function(){};this._toolitemHandlers[".uno:ShowAllNotes"]=function(){};this._toolitemHandlers[
".uno:HideAllNotes"]=function(){};this._toolitemHandlers[".uno:ShareDocument"]=function(){};
this._toolitemHandlers[".uno:EditDoc"]=function(){};this._toolitemHandlers[
".uno:PresentationCurrentSlide"]=function(){};this._toolitemHandlers[".uno:PresentationLayout"
]=function(){};this._toolitemHandlers[".uno:CapturePoint"]=function(){};this._toolitemHandlers[
".uno:Objects3DToolbox"]=function(){};this._toolitemHandlers[".uno:InsertMath"]=function(){};
this._toolitemHandlers[".uno:ShowAnnotations"]=function(){};this._toolitemHandlers[
".uno:DeleteAnnotation"]=function(){};this._toolitemHandlers[".uno:NextAnnotation"]=function(){};
this._toolitemHandlers[".uno:PreviousAnnotation"]=function(){};this._toolitemHandlers[
".uno:OptimizeTable"]=function(){};this._toolitemHandlers[".uno:TableDesign"]=function(){};
this._toolitemHandlers[".uno:ContourDialog"]=function(){};this._toolitemHandlers[".uno:TextWrap"
]=function(){};this._toolitemHandlers[".uno:RedactDoc"]=function(){};this._toolitemHandlers[
".uno:FrameLineColor"]=function(){};this._toolitemHandlers[".uno:ProtectTraceChangeMode"]=function(
){};this._toolitemHandlers[".uno:RowOperations"]=function(){};this._toolitemHandlers[
".uno:ColumnOperations"]=function(){};this._toolitemHandlers[".uno:Insert"]=function(){};
this._toolitemHandlers[".uno:InsertCell"]=function(){};this._toolitemHandlers[".uno:AutoFormat"
]=function(){};this._toolitemHandlers[".uno:Spacing"]=function(){};this._toolitemHandlers[
".uno:RotateRight"]=function(){};this._toolitemHandlers[".uno:AnchorMenu"]=function(){};
this._toolitemHandlers[".uno:FontworkShapeType"]=function(){};this._toolitemHandlers[
".uno:FillShadow"]=function(){};this._toolitemHandlers[".uno:ObjectAlign"]=function(){};
this._toolitemHandlers[".uno:GraphicFilterToolbox"]=function(){};this._toolitemHandlers[
".uno:SaveGraphic"]=function(){};this._toolitemHandlers[".uno:InsertCaptionDialog"]=function(){};
this._toolitemHandlers[".uno:CompressGraphic"]=function(){};this._toolitemHandlers[
".uno:GraphicDialog"]=function(){};this._toolitemHandlers[".uno:BorderDialog"]=function(){};
this._toolitemHandlers[".uno:FormatArea"]=function(){};this._toolitemHandlers[
"vnd.sun.star.findbar:FocusToFindbar"]=function(){}},_bigtoolitemHandler:function(parentContainer,
data,builder){var noLabels=builder.options.noLabelsForUnoButtons;
builder.options.noLabelsForUnoButtons=false;builder._toolitemHandler(parentContainer,data,builder);
builder.options.noLabelsForUnoButtons=noLabels;return false},onCommandStateChanged:function(e){
var commandName=e.commandName;var state=e.state;if(commandName===".uno:CharFontName"){if(
window.ThisIsTheiOSApp){if(state==="")$("#fontnamecomboboxios").html(_("Font Name"));else $(
"#fontnamecomboboxios").html(state);window.LastSetiOSFontNameButtonFont=state}}else if(
commandName===".uno:StyleApply"){$("#applystyle").val(state).trigger("change")}else if(
commandName===".uno:ModifiedStatus"){const saveEle=document.getElementById("save");if(saveEle){if(
state==="true"&&this.map.saveState){this.map.saveState.showModifiedStatus();
const button=document.getElementById("file-save");if(button)button.classList.add("savemodified")
}else{const button=document.getElementById("save");if(button)button.classList.remove("savemodified")
const fileButton=document.getElementById("file-save");if(fileButton)fileButton.classList.remove(
"savemodified")}}}},_comboboxControl:function(parentContainer,data,builder){if(
!data.entries||data.entries.length===0)return false;if(
window.ThisIsTheiOSApp&&data.id==="fontnamecombobox"){var table=window.L.DomUtil.createWithId("div",
data.id,parentContainer);var row=window.L.DomUtil.create("div","notebookbar row",table);
var button=window.L.DomUtil.createWithId("button",data.id+"ios",row);$(table).addClass(
"select2 select2-container select2-container--default");$(row).addClass("select2-selection");$(
button).addClass("select2-selection__rendered");if(data.selectedEntries.length&&data.entries[
data.selectedEntries[0]])button.innerText=data.entries[data.selectedEntries[0]];else if(
window.LastSetiOSFontNameButtonFont)button.innerText=window.LastSetiOSFontNameButtonFont;else if(
data.text)button.innerText=data.text;var map=builder.map;window.MagicFontNameCallback=function(font
){button.innerText=font;map.applyFont(font);map.focus()};button.onclick=function(){
window.postMobileMessage("FONTPICKER")};return false}return JSDialog.combobox(parentContainer,data,
builder)},_createTabClick:function(builder,t,tabs,contentDivs,tabIds){var tooltipCollapsed=_(
"Tap to expand");var tooltipExpanded=_("Tap to collapse");tabs[t].setAttribute("data-cooltip",
tooltipExpanded);window.L.control.attachTooltipEventListener(tabs[t],builder.map);return function(
event){var tabIsSelected=$(tabs[t]).hasClass("selected");
var notebookbarIsCollapsed=builder.wizard.isCollapsed();
var accessibilityInputElementHasFocus=app.UI.notebookbarAccessibility&&app.UI.notebookbarAccessibility.accessibilityInputElement===document.activeElement?true:false
if(tabIsSelected&&!notebookbarIsCollapsed&&!accessibilityInputElementHasFocus){
builder.wizard.collapse();tabs[t].setAttribute("data-cooltip",tooltipCollapsed)}else if(
notebookbarIsCollapsed){builder.wizard.extend();tabs[t].setAttribute("data-cooltip",tooltipExpanded)
}$(tabs[t]).addClass("selected");tabs[t].setAttribute("aria-selected","true");tabs[t
].removeAttribute("tabindex");for(var i=0;i<tabs.length;i++){if(i!==t){$(tabs[i]).removeClass(
"selected");tabs[i].setAttribute("aria-selected","false");tabs[i].tabIndex=-1;tabs[i].setAttribute(
"data-cooltip","");$(contentDivs[i]).addClass("hidden")}}$(contentDivs[t]).removeClass("hidden");$(
window).resize();builder.map.fire("refreshoverflows",{force:true});builder.wizard.selectedTab(
tabIds[t]);if(!tabs[t].enterPressed){event.preventDefault();if(!JSDialog.IsAnyInputFocused()
)builder.map.focus();t.enterPressed=false}}},_overriddenTabsControlHandler:function(parentContainer,
data,builder){data.isNotebookbar=true;data.tabs=builder.wizard.getTabs();
return builder._tabsControlHandler(parentContainer,data,builder,_("Tap to collapse"))},
_overriddenTabPageHandler:function(parentContainer,data,builder){var result=builder._tabPageHandler(
parentContainer,data,builder);var tabPage=parentContainer.lastChild;JSDialog.MakeFocusCycle(tabPage)
return result},_exportMenuButton:function(parentContainer,data,builder){if(
data.id&&data.id.startsWith("downloadas-")){var format=data.id.substring("downloadas-".length);
app.registerExportFormat(data.text,format);if(builder.map["wopi"].HideExportOption)return false}
var separatorPos=data.id.indexOf(":");var menuId=data.id.substr(separatorPos+1);
var submenu=builder._getSubmenuOpts(builder.options.map._docLayer._docType,menuId,builder);
JSDialog.MenuDefinitions.set(menuId,submenu);JSDialog.menubuttonControl(parentContainer,data,builder
);for(var i in submenu){var action=submenu[i].action;var text=submenu[i].action;if(
action.startsWith("export")){var format=action.substring("export".length);app.registerExportFormat(
text,format)}else if(action.startsWith("downloadas-")){var format=action.substring(
"downloadas-".length);app.registerExportFormat(text,format)}}return false},_getSubmenuOpts:function(
docType,id,builder){switch(id){case"DownloadAsMenu":return builder._getDownloadAsSubmenuOpts(docType
);case"SaveAsMenu":return builder._getSaveAsSubmenuOpts(docType);case"ExportAsMenu":
return builder._getExportAsSubmenuOpts(docType);case"PrintOptions":
return builder._getPrintSubmenuOpts(docType)}return[]},_getDownloadAsSubmenuOpts:function(docType){
var submenuOpts=[];if(docType==="text"){submenuOpts=[{action:"downloadas-odt",text:_(
"ODF text document (.odt)")},{action:"downloadas-rtf",text:_("Rich Text (.rtf)")},{
action:"downloadas-docx",text:_("Word Document (.docx)")},{action:"downloadas-doc",text:_(
"Word 2003 Document (.doc)")},{action:!window.ThisIsAMobileApp?"exportepub":"downloadas-epub",
text:_("EPUB (.epub)"),command:!window.ThisIsAMobileApp?"exportepub":"downloadas-epub"},{
action:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",text:_("PDF Document (.pdf)"),
command:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf"},{action:"downloadas-html",
text:_("HTML File (.html)")}].concat(!window.ThisIsTheAndroidApp?[{action:"exportpdf",text:_(
"PDF Document (.pdf) as..."),command:"exportpdf"}]:[])}else if(docType==="spreadsheet"){
submenuOpts=[{action:"downloadas-ods",text:_("ODF spreadsheet (.ods)")},{action:"downloadas-xlsx",
text:_("Excel Spreadsheet (.xlsx)")},{action:"downloadas-xls",text:_("Excel 2003 Spreadsheet (.xls)"
)},{action:"downloadas-csv",text:_("CSV File (.csv)")},{action:"downloadas-html",text:_(
"HTML File (.html)")},{action:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",text:_(
"PDF Document (.pdf)"),command:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf"}].concat(
!window.ThisIsTheAndroidApp?[{action:"exportpdf",text:_("PDF Document (.pdf) as..."),
command:"exportpdf"}]:[])}else if(docType==="presentation"){submenuOpts=[{action:"downloadas-odp",
text:_("ODF presentation (.odp)")},{action:"downloadas-odg",text:_("ODF Drawing (.odg)")},{
action:"downloadas-pptx",text:_("PowerPoint Presentation (.pptx)")},{action:"downloadas-ppt",text:_(
"PowerPoint 2003 Presentation (.ppt)")},{action:"downloadas-html",text:_("HTML Document (.html)")},{
action:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf",text:_("PDF Document (.pdf)"),
command:!window.ThisIsAMobileApp?"exportdirectpdf":"downloadas-pdf"}].concat(
!window.ThisIsTheAndroidApp?[{action:"exportpdf",text:_("PDF Document (.pdf) as..."),
command:"exportpdf"}]:[]).concat(window.extraExportFormats.includes("impress_swf")?[{
action:"downloadas-swf",text:_("Shockwave Flash (.swf)")}]:[]).concat(
window.extraExportFormats.includes("impress_svg")?[{action:"downloadas-svg",text:_(
"Scalable Vector Graphics (.svg)")}]:[]).concat(window.extraExportFormats.includes("impress_bmp")?[{
action:"downloadas-bmp",text:_("Current slide as Bitmap (.bmp)")}]:[]).concat(
window.extraExportFormats.includes("impress_gif")?[{action:"downloadas-gif",text:_(
"Current slide as Graphics Interchange Format (.gif)")}]:[]).concat(
window.extraExportFormats.includes("impress_png")?[{action:"downloadas-png",text:_(
"Current slide as Portable Network Graphics (.png)")}]:[]).concat(
window.extraExportFormats.includes("impress_tiff")?[{action:"downloadas-tiff",text:_(
"Current slide as Tag Image File Format (.tiff)")}]:[])}else if(docType==="drawing"){submenuOpts=[{
action:"downloadas-odg",text:_("ODF Drawing (.odg)")},{action:"downloadas-png",text:_("Image (.png)"
)}]}submenuOpts.forEach(function mapIconToItem(menuItem){
menuItem.icon=menuItem.action+"-submenu-icon"});return submenuOpts},_getSaveAsSubmenuOpts:function(
docType){var submenuOpts=[];if(docType==="text"){submenuOpts=[{action:"saveas-odt",text:_(
"ODF text document (.odt)")},{action:"saveas-rtf",text:_("Rich Text (.rtf)")},{action:"saveas-docx",
text:_("Word Document (.docx)")},{action:"saveas-doc",text:_("Word 2003 Document (.doc)")}]}else if(
docType==="spreadsheet"){submenuOpts=[{action:"saveas-ods",text:_("ODF spreadsheet (.ods)")},{
action:"saveas-xlsx",text:_("Excel Spreadsheet (.xlsx)")},{action:"saveas-xls",text:_(
"Excel 2003 Spreadsheet (.xls)")}]}else if(docType==="presentation"){submenuOpts=[{
action:"saveas-odp",text:_("ODF presentation (.odp)")},{action:"saveas-pptx",text:_(
"PowerPoint Presentation (.pptx)")},{action:"saveas-ppt",text:_(
"PowerPoint 2003 Presentation (.ppt)")}]}submenuOpts.forEach(function mapIconToItem(menuItem){
menuItem.icon=menuItem.action+"-submenu-icon"});return submenuOpts},
_getExportAsSubmenuOpts:function(docType){var submenuOpts=[];if(docType==="text"){submenuOpts=[{
action:"exportas-pdf",text:_("PDF Document (.pdf)")},{action:"exportas-epub",text:_("EPUB (.epub)")}
]}else if(docType==="spreadsheet"){submenuOpts=[{action:"exportas-pdf",text:_("PDF Document (.pdf)")
}]}else if(docType==="presentation"){submenuOpts=[{action:"exportas-pdf",text:_(
"PDF Document (.pdf)")}]}else if(docType==="drawing"){submenuOpts=[{action:"exportas-pdf",text:_(
"PDF Document (.pdf)")}]}submenuOpts.forEach(function mapIconToItem(menuItem){
menuItem.icon=menuItem.action+"-submenu-icon"});return submenuOpts},_getPrintSubmenuOpts:function(
docType){var submenuOpts=[];if(docType==="presentation"){submenuOpts=[{action:"print",text:_(
"Full Page Slides")},{action:"print-notespages",text:_("Notes Pages")}]}return submenuOpts},
_headerFooterControl:function(parentContainer,data,builder){var control=builder._unoToolButton(
parentContainer,data,builder);$(control.button).unbind("click");$(control.label).unbind("click");$(
control.container).click(function(){if(!$(control.container).hasClass("disabled")){
builder.refreshSidebar=true;var command=data.command+"?On:bool=true";builder.callback("toolbutton",
"click",control.button,command,builder)}});builder._preventDocumentLosingFocusOnClick(
control.container)},_insertTextBoxControl:function(parentContainer,data,builder){
var control=builder._unoToolButton(parentContainer,data,builder);$(control.button).unbind("click");
$(control.label).unbind("click");$(control.container).click(function(){builder.map.sendUnoCommand(
data.command+"?CreateDirectly:bool=true")});builder._preventDocumentLosingFocusOnClick(
control.container)},_onlineHelpControl:function(parentContainer,data,builder){
var originalDataId=data.id;var control=builder._unoToolButton(parentContainer,data,builder);$(
control.button).unbind("click");$(control.label).unbind("click");$(control.container).click(
function(){(new Menubar)._executeAction.bind({_map:builder.options.map})(undefined,{
id:originalDataId})});builder._preventDocumentLosingFocusOnClick(control.container)},
_selectBackgroundControl:function(parentContainer,data,builder){var options={hasDropdownArrow:false}
var control=builder._unoToolButton(parentContainer,data,builder,options);$(control.button).unbind(
"click");$(control.label).unbind("click");$(control.container).click(function(){
window.L.DomUtil.get("selectbackground").click()});builder._preventDocumentLosingFocusOnClick(
control.container)},_insertAnnotationControl:function(parentContainer,data,builder){
var control=builder._unoToolButton(parentContainer,data,builder);$(control.button).unbind("click");
$(control.label).unbind("click");$(control.container).click(function(e){e.preventDefault();
var docLayer=builder.map._docLayer;if(!(
docLayer._docType==="spreadsheet"&&GraphicSelection.hasActiveSelection())){
builder.map.insertComment()}});builder._preventDocumentLosingFocusOnClick(control.container)},
_saveControl:function(parentContainer,data,builder){var control=builder._unoToolButton(
parentContainer,data,builder);$(control.button).unbind("click");$(control.label).unbind("click");$(
control.container).click(function(){if(!builder.map.isReadOnlyMode()){builder.map.fire("postMessage"
,{msgId:"UI_Save",args:{source:"notebookbar"}});if(!builder.map._disableDefaultAction["UI_Save"]){
builder.map.save(false,false)}}});builder._preventDocumentLosingFocusOnClick(control.container)},
_saveAsControl:function(parentContainer,data,builder){data.text=data.text.replace("...","");
var control=builder._unoToolButton(parentContainer,data,builder);$(control.button).unbind("click");
$(control.label).unbind("click");$(control.container).click(function(){builder.map.openSaveAs()});
builder._preventDocumentLosingFocusOnClick(control.container)},_printControl:function(
parentContainer,data,builder){data.text=data.text.replace("...","");
var control=builder._unoToolButton(parentContainer,data,builder);$(control.button).unbind("click");
$(control.label).unbind("click");$(control.container).click(function(){builder.map.print()});
builder._preventDocumentLosingFocusOnClick(control.container)},buildControl:function(parent,data){
if(!data.length)return;const inlineLabels=this.options.useInLineLabelsForUnoButtons;
this.options.useInLineLabelsForUnoButtons=false;data=data[0];var type=data.type;
var handler=this._controlHandlers[type];var isVertical=data.vertical==="true"||data.vertical===true;
var hasManyChildren=data.children&&data.children.length>1;if(handler)var processChildren=handler(
parent,data,this);else window.app.console.warn(
'NotebookbarBuilder: Unsupported control type: "'+type+'"');if(
processChildren&&data.children!=undefined)this.build(parent,data.children,isVertical,hasManyChildren
);else if(data.visible&&(data.visible===false||data.visible==="false")){$("#"+data.id).addClass(
"hidden-from-event")}this.options.useInLineLabelsForUnoButtons=inlineLabels},updateWidget:function(
container,data){this._updateWidgetImpl(container,data,this.buildControl)},build:function(parent,data
,hasVerticalParent){if(hasVerticalParent===undefined){parent=window.L.DomUtil.create("div",
"root-container "+this.options.cssClass,parent);parent=window.L.DomUtil.create("div",
"vertical "+this.options.cssClass,parent)}for(var childIndex in data){var childData=data[childIndex]
if(!childData)continue;var childType=childData.type;
var isVertical=childData.vertical==="true"||childData.vertical===true?true:false;
var processChildren=true;if((childData.id===undefined||childData.id===""||childData.id===null)&&(
childType=="checkbox"||childType=="radiobutton")){continue}
var hasManyChildren=childData.children&&childData.children.length>1;if(hasManyChildren){if(
childData.id&&childData.id.indexOf(" ")>=0)console.error(
'notebookbar: space in the id: "'+childData.id+'"');var tableId=childData.id?childData.id.replace(
" ",""):"";var table=window.L.DomUtil.createWithId("div",tableId,parent);window.L.DomUtil.addClass(
table,this.options.cssClass);if(isVertical)window.L.DomUtil.addClass(table,"vertical"
);else window.L.DomUtil.addClass(table,"horizontal");var childObject=table}else{childObject=parent}
if(childType==="toolbox")childData.hasVerticalParent=hasVerticalParent;
var handler=this._controlHandlers[childType];
var twoPanelsAsChildren=childData.children&&childData.children.length==2&&childData.children[0
]&&childData.children[0].type=="panel"&&childData.children[1]&&childData.children[1].type=="panel";
try{if(twoPanelsAsChildren){handler=this._controlHandlers["paneltabs"];handler(childObject,
childData.children,this)}else{if(handler){processChildren=handler(childObject,childData,this);
this.postProcess(childObject,childData)}else window.app.console.warn(
'NotebookbarBuilder: Unsupported control type: "'+childType+'"');if(
processChildren&&childData.children!=undefined)this.build(childObject,childData.children,isVertical
);else if(childData.visible&&(childData.visible===false||childData.visible==="false")){$(
"#"+childData.id).addClass("hidden-from-event")}}}catch(ex){window.app.console.error(
'NotebookbarBuilder: exception while building "'+childData.id+'" : '+ex)}}}});
window.L.control.notebookbarBuilder=function(options){
var builder=new window.L.Control.NotebookbarBuilder(options);builder._setup(options);
builder._overrideHandlers();builder._customizeOptions();return builder};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ContextToolbar=function(_super){__extends(ContextToolbar,
_super);function ContextToolbar(map){var _this=_super.call(this,map,"ContextToolbar","notebookbar"
)||this;_this.initialized=false;_this.lastIinputEvent={};_this.pendingShow=false;
_this.disappearingBoundary=150;_this.additionalContextButtons=[];_this.pointerMove=function(e){
app.layoutingService.appendLayoutingTask(function(){var opacity=_this.calculateOpacity(e);if(
opacity===1){_this.makeContextToolbarConstant();return}else if(opacity===0){
_this.hideContextToolbar();return}_this.changeOpacity(opacity)})};_this.createBuilder();
_this.setupContainer(undefined);return _this}ContextToolbar.prototype.createBuilder=function(){
this.builder=new window.L.control.notebookbarBuilder({windowId:-2,mobileWizard:this,map:this.map,
cssClass:"notebookbar",suffix:"context-toolbar"})};ContextToolbar.prototype.setupContainer=function(
parentContainer){this.container=window.L.DomUtil.createWithId("div","context-toolbar",document.body)
window.L.DomUtil.addClass(this.container,"notebookbar horizontal")};
ContextToolbar.prototype.showContextToolbar=function(){var map=this.map;if(map.isReadOnlyMode(
)||!window.mode.isDesktop()||map.getDocType()==="spreadsheet")return;if(
this.lastIinputEvent.input==="mouse")this.pendingShow=true;if(this.lastIinputEvent.type!=="buttonup"
)return;this.showContextToolbarImpl()};ContextToolbar.prototype.showContextToolbarImpl=function(){
var _a;this.pendingShow=false;if(!this.initialized){
var contextToolbarItems=this.getWriterTextContext();for(var i in this.additionalContextButtons){
var item=this.additionalContextButtons[i];contextToolbarItems.push(item)}(_a=this.builder
)===null||_a===void 0?void 0:_a.build(this.container,contextToolbarItems,false);
this.initialized=true}this.registerMessageHandlers();document.addEventListener("pointermove",
this.pointerMove);this.map.on("commandstatechanged",this.onCommandStateChanged,this);
this.changeOpacity(1);this.showHideToolbar(true)};
ContextToolbar.prototype.hideContextToolbar=function(){this.unregisterMessageHandlers();
document.removeEventListener("pointermove",this.pointerMove);this.map.off("commandstatechanged",
this.onCommandStateChanged,this);this.showHideToolbar(false)};
ContextToolbar.prototype.showHideToolbar=function(show){var _this=this;
app.layoutingService.appendLayoutingTask(function(){if(!show){window.L.DomUtil.addClass(
_this.container,"hidden");return}URLPopUpSection.closeURLPopUp();var statRect;if(!TextSelections||!(
statRect=TextSelections.getStartRectangle()))return;var pos={x:statRect.cX1,y:statRect.cY1};pos.x-=(
app.activeDocument.activeView.viewedRectangle.pX1-app.sectionContainer.getDocumentAnchor()[0]
)/app.dpiScale-app.sectionContainer.getCanvasBoundingClientRect().x;pos.y-=(
app.activeDocument.activeView.viewedRectangle.pY1-app.sectionContainer.getDocumentAnchor()[1]
)/app.dpiScale-app.sectionContainer.getCanvasBoundingClientRect().y;window.L.DomUtil.removeClass(
_this.container,"hidden");app.layoutingService.appendLayoutingTask(function(){
var contextualMenu=_this.container.getBoundingClientRect();if(
contextualMenu.width+pos.x>window.innerWidth){pos.x-=contextualMenu.width+pos.x-window.innerWidth+5}
_this.container.style.top=pos.y+"px";_this.container.style.left=pos.x+"px"})})};
ContextToolbar.prototype.getWriterTextContext=function(){var fontEntries=Object.keys(
this.map._docLayer._toolbarCommandValues[".uno:CharFontName"]);var sizeEntries=["6","7","8","9","10"
,"10.5","11","12","13","14","15","16","18","20","21","22","24","26","28","32","36","40","44","48",
"54","60","66","72","80","88","96"];var currentFontName=this.map._getCurrentFontName();
var currentFontSize=this.map["stateChangeHandler"].getItemValue(".uno:FontHeight");return[{
type:"container",children:[{type:"container",children:[{id:"fontnamecombobox",type:"combobox",
text:currentFontName,entries:fontEntries,selectedCount:1,selectedEntries:[fontEntries.findIndex(
function(element){return element===currentFontName})],command:".uno:CharFontName",
customEntryRenderer:true},{id:"fontsizecombobox",type:"combobox",text:currentFontSize,
entries:sizeEntries,selectedCount:1,selectedEntries:[sizeEntries.findIndex(function(element){
return element===currentFontSize})],command:".uno:FontHeight"},{id:"home-grow",type:"toolitem",
text:_UNO(".uno:Grow"),command:".uno:Grow"},{id:"home-shrink",type:"toolitem",text:_UNO(
".uno:Shrink"),command:".uno:Shrink"}],vertical:false},{type:"container",children:[{type:"toolbox",
children:[{id:"home-bold",type:"toolitem",text:_UNO(".uno:Bold"),command:".uno:Bold"},{
id:"home-italic",type:"toolitem",text:_UNO(".uno:Italic"),command:".uno:Italic"},{
id:"home-underline",type:"toolitem",text:_UNO(".uno:Underline"),command:".uno:Underline"},{
id:"home-strikeout",type:"toolitem",text:_UNO(".uno:Strikeout"),command:".uno:Strikeout"},{
id:"home-subscript",type:"toolitem",text:_UNO(".uno:SubScript"),command:".uno:SubScript"},{
id:"home-superscript",type:"toolitem",text:_UNO(".uno:SuperScript"),command:".uno:SuperScript"},{
id:"home-spacing:CharSpacingMenu",type:"menubutton",noLabel:true,text:_UNO(".uno:Spacing"),
command:".uno:CharSpacing"},{id:"home-back-color:ColorPickerMenu",class:"unospan-CharBackColor",
type:"toolitem",noLabel:true,text:_UNO(".uno:CharBackColor","text"),command:".uno:CharBackColor"},{
id:"home-color:ColorPickerMenu",class:"unospan-FontColor",type:"toolitem",noLabel:true,text:_UNO(
".uno:Color"),command:".uno:Color"}]}],vertical:false}],vertical:true},{type:"separator",
id:"home-fontcombobox-break",orientation:"vertical"},{id:"home-insert-annotation",
type:"bigtoolitem",text:_UNO(".uno:InsertAnnotation"),command:".uno:InsertAnnotation"}]};
ContextToolbar.prototype.insertAdditionalContextButton=function(button){var _a;for(
var i in this.additionalContextButtons){var item=this.additionalContextButtons[i];if(
item.id===button.id)return}if(this.additionalContextButtons.length===0){
this.additionalContextButtons.push({type:"separator",id:"home-insertannotation-break",
orientation:"vertical"})}var isUnoCommand=button.unoCommand&&button.unoCommand.indexOf(".uno:")>=0;
if(button.unoCommand&&!isUnoCommand)button.unoCommand=".uno:"+button.unoCommand;var contextButton={
id:button.id,type:"bigtoolitem",text:button.label?button.label:button.hint?_(button.hint):" ",
command:button.unoCommand,icon:button.imgurl,postmessage:button.unoCommand?undefined:true};
this.additionalContextButtons.push(contextButton);(_a=document.getElementById("context-toolbar")
)===null||_a===void 0?void 0:_a.remove();this.setupContainer(undefined);this.initialized=false};
ContextToolbar.prototype.setLastInputEventType=function(e){this.lastIinputEvent=e;if(
e.type==="buttonup"&&e.input==="mouse"&&this.pendingShow){this.showContextToolbarImpl();
this.pendingShow=false}};ContextToolbar.prototype.calculateOpacity=function(e){
var clientRect=this.container.getBoundingClientRect();if(
clientRect.left<e.clientX&&e.clientX<clientRect.right&&clientRect.top<e.clientY&&e.clientY<clientRect.bottom
){return 1}var minX=clientRect.left-this.disappearingBoundary;
var maxX=clientRect.right+this.disappearingBoundary;
var minY=clientRect.top-this.disappearingBoundary;
var maxY=clientRect.bottom+this.disappearingBoundary;var xDistance=0;if(
minX<e.clientX&&e.clientX<clientRect.left)xDistance=e.clientX-minX;else if(
clientRect.right<e.clientX&&e.clientX<maxX)xDistance=maxX-e.clientX;var yDistance=0;if(
minY<e.clientY&&e.clientY<clientRect.top)yDistance=e.clientY-minY;else if(
clientRect.bottom<e.clientY&&e.clientY<maxY)yDistance=maxY-e.clientY;return(xDistance+yDistance)/(
2*this.disappearingBoundary)};ContextToolbar.prototype.makeContextToolbarConstant=function(){
document.removeEventListener("pointermove",this.pointerMove);this.changeOpacity(1)};
ContextToolbar.prototype.changeOpacity=function(opacity){
this.container.style.opacity=opacity.toString()};
ContextToolbar.prototype.onCommandStateChanged=function(e){var commandName=e.commandName;if(
commandName===".uno:CharFontName"){var control=this.container.querySelector("#fontnamecombobox");if(
control&&typeof control.onSetText==="function"){control.onSetText(e.state)}}else if(
commandName===".uno:FontHeight"){var control=this.container.querySelector("#fontsizecombobox");if(
control&&typeof control.onSetText==="function"){control.onSetText(e.state)}}};return ContextToolbar
}(JSDialogComponent);window.L.Control.Layers=window.L.Control.extend({options:{collapsed:true,
position:"topright",autoZIndex:true,hideSingleBase:false},initialize:function(baseLayers,overlays,
options){window.L.setOptions(this,options);this._layers={};this._lastZIndex=0;
this._handlingClick=false;for(var i in baseLayers){this._addLayer(baseLayers[i],i)}for(i in overlays
){this._addLayer(overlays[i],i,true)}},onAdd:function(){this._initLayout();this._update();
return this._container},removeLayer:function(layer){layer.off("add remove",this._onLayerChange,this)
delete this._layers[app.util.stamp(layer)];return this._update()},_initLayout:function(){
var className="leaflet-control-layers",container=this._container=window.L.DomUtil.create("div",
className);container.setAttribute("aria-haspopup",true);
window.L.DomEvent.disableMouseClickPropagation(container).disableScrollPropagation(container);
window.L.DomEvent.on(container,"click",window.touch.touchOnly(window.L.DomEvent.stopPropagation));
var form=this._form=window.L.DomUtil.create("form",className+"-list");if(this.options.collapsed){if(
!window.L.Browser.android){window.L.DomEvent.on(container,{mouseenter:this._expand,
mouseleave:this._collapse},this)}var link=this._layersLink=window.L.DomUtil.create("a",
className+"-toggle",container);link.href="#";link.title="Layers";window.L.DomEvent.on(link,"click",
window.touch.touchOnly(window.L.DomEvent.stop)).on(link,"click",window.touch.touchOnly(this._expand)
,this);window.L.DomEvent.on(link,"focus",window.touch.mouseOnly(this._expand),this);
window.L.DomEvent.on(form,"click",function(){setTimeout(window.L.bind(this._onInputClick,this),0)},
this);this._map.on("click",this._collapse,this)}else{this._expand()}
this._baseLayersList=window.L.DomUtil.create("div",className+"-base",form);
this._separator=window.L.DomUtil.create("div",className+"-separator",form);
this._overlaysList=window.L.DomUtil.create("div",className+"-overlays",form);container.appendChild(
form)},_addLayer:function(layer,name,overlay){layer.on("add remove",this._onLayerChange,this);
var id=app.util.stamp(layer);this._layers[id]={layer:layer,name:name,overlay:overlay};if(
this.options.autoZIndex&&layer.setZIndex){this._lastZIndex++;layer.setZIndex(this._lastZIndex)}},
_update:function(){if(!this._container){return this}window.L.DomUtil.empty(this._baseLayersList);
window.L.DomUtil.empty(this._overlaysList);var baseLayersPresent,overlaysPresent,i,obj,
baseLayersCount=0;for(i in this._layers){obj=this._layers[i];this._addItem(obj);
overlaysPresent=overlaysPresent||obj.overlay;baseLayersPresent=baseLayersPresent||!obj.overlay;
baseLayersCount+=!obj.overlay?1:0}if(this.options.hideSingleBase){
baseLayersPresent=baseLayersPresent&&baseLayersCount>1;
this._baseLayersList.style.display=baseLayersPresent?"":"none"}
this._separator.style.display=overlaysPresent&&baseLayersPresent?"":"none";return this},
_onLayerChange:function(e){if(!this._handlingClick){this._update()}var overlay=this._layers[
app.util.stamp(e.target)].overlay;
var type=overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;
if(type){this._map.fire(type,e.target)}},_createRadioElement:function(name,checked){
var radioHtml='<input type="radio" class="leaflet-control-layers-selector" name="'+name+'"'+(
checked?' checked="checked"':"")+"/>";var radioFragment=document.createElement("div");
radioFragment.innerHTML=radioHtml;return radioFragment.firstChild},_addItem:function(obj){
var label=document.createElement("label"),checked=this._map.hasLayer(obj.layer),input;if(obj.overlay
){input=document.createElement("input");input.type="checkbox";
input.className="leaflet-control-layers-selector";input.defaultChecked=checked}else{
input=this._createRadioElement("leaflet-base-layers",checked)}input.layerId=app.util.stamp(obj.layer
);window.L.DomEvent.on(input,"click",this._onInputClick,this);var name=document.createElement("span"
);name.innerHTML=" "+obj.name;label.appendChild(input);label.appendChild(name);
var container=obj.overlay?this._overlaysList:this._baseLayersList;container.appendChild(label);
return label},_onInputClick:function(){var inputs=this._form.getElementsByTagName("input"),input,
layer,hasLayer;var addedLayers=[],removedLayers=[];this._handlingClick=true;for(var i=0,
len=inputs.length;i<len;i++){input=inputs[i];layer=this._layers[input.layerId].layer;
hasLayer=this._map.hasLayer(layer);if(input.checked&&!hasLayer){addedLayers.push(layer)}else if(
!input.checked&&hasLayer){removedLayers.push(layer)}}for(i=0;i<removedLayers.length;i++){
this._map.removeLayer(removedLayers[i])}for(i=0;i<addedLayers.length;i++){this._map.addLayer(
addedLayers[i])}this._handlingClick=false;this._map.focus()},_expand:function(){
window.L.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){
window.L.DomUtil.removeClass(this._container,"leaflet-control-layers-expanded")}});
window.L.control.layers=function(baseLayers,overlays,options){return new window.L.Control.Layers(
baseLayers,overlays,options)};var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var SidebarType;(
function(SidebarType){SidebarType["Sidebar"]="sidebar";SidebarType["Navigator"]="navigator";
SidebarType["QuickFind"]="quickfind"})(SidebarType||(SidebarType={}));var SidebarBase=function(
_super){__extends(SidebarBase,_super);function SidebarBase(map,type){var _this=_super.call(this,map,
type,type)||this;_this.type=type;_this.onAdd(map);return _this}
SidebarBase.prototype.createBuilder=function(){this.builder=new window.L.control.jsDialogBuilder({
mobileWizard:this,map:this.map,windowId:WindowId.Sidebar,cssClass:"jsdialog sidebar",
useScrollAnimation:false,suffix:"sidebar",callback:this.callback.bind(this)})};
SidebarBase.prototype.setupContainer=function(parentContainer){if(!this.container){
this.container=window.L.DomUtil.createWithId("div",this.type+"-container",$("#"+this.type+"-panel"
).get(0))}this.wrapper=document.getElementById(this.type+"-dock-wrapper");
this.documentContainer=document.querySelector("#document-container")};
SidebarBase.prototype.onAdd=function(map){this.map=map;this.createBuilder();this.setupContainer(
undefined);app.events.on("resize",this.onResize.bind(this));this.registerMessageHandlers()};
SidebarBase.prototype.onRemove=function(){this.unregisterMessageHandlers()};
SidebarBase.prototype.isVisible=function(){return $("#"+this.type+"-dock-wrapper").hasClass(
"visible")};SidebarBase.prototype.closeSidebar=function(){$("#"+this.type+"-dock-wrapper"
).removeClass("visible");if(!this.map.editorHasFocus()){this.map.fire("editorgotfocus");
this.map.focus()}var upperCaseType=this.type[0].toUpperCase()+this.type.slice(1);
this.map.uiManager.setDocTypePref("Show"+upperCaseType,false)};
SidebarBase.prototype.onJSUpdate=function(e){var _a;if(((_a=e===null||e===void 0?void 0:e.data
)===null||_a===void 0?void 0:_a.control.id)==="addonimage"){window.app.console.log(
"Ignored update for control: "+e.data.control.id);return false}
return _super.prototype.onJSUpdate.call(this,e)};SidebarBase.prototype.onJSAction=function(e){var _a
var innerData=(_a=e===null||e===void 0?void 0:e.data)===null||_a===void 0?void 0:_a.data;
var controlId=innerData===null||innerData===void 0?void 0:innerData.control_id;if(controlId){if(
controlId.indexOf("contents")===0||controlId.indexOf("titlebar")===0||controlId.indexOf("expander"
)===0||controlId.indexOf("addonimage")===0){window.app.console.log(
"Ignored action: "+innerData.action_type+" for control: "+controlId);return false}}
return _super.prototype.onJSAction.call(this,e)};
SidebarBase.prototype.markNavigatorTreeView=function(data){if(!data)return false;if(
data.type==="treelistbox"){data.draggable=false;return true}for(var i in data.children){if(
this.markNavigatorTreeView(data.children[i])){return true}}return false};
SidebarBase.prototype.onResize=function(){
this.wrapper.style.maxHeight=this.documentContainer.getBoundingClientRect().height+"px";if(
this.container){this.container.style.height=this.documentContainer.getBoundingClientRect(
).height+"px"}};SidebarBase.prototype.callback=function(objectType,eventType,object,data,builder){
builder._defaultCallbackHandler(objectType,eventType,object,data,builder)};return SidebarBase}(
JSDialogComponent);JSDialog.SidebarBase=SidebarBase;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var Sidebar=function(
_super){__extends(Sidebar,_super);function Sidebar(map){var _this=_super.call(this,map,
SidebarType.Sidebar)||this;_this.isUserRequest=true;return _this}Sidebar.prototype.onAdd=function(
map){_super.prototype.onAdd.call(this,map);this.map.on("sidebar",this.onSidebar,this)};
Sidebar.prototype.onRemove=function(){_super.prototype.onRemove.call(this);this.map.off("sidebar")};
Sidebar.prototype.setAsInitialized=function(){this.isUserRequest=false};
Sidebar.prototype.updateSidebarPrefs=function(currentDeck){var decks=["PropertyDeck",
"SdCustomAnimationDeck","NavigatorDeck","StyleListDeck","A11yCheckDeck"];var deckPref={};
decks.forEach(function(deck){deckPref[deck]=currentDeck===deck?"true":"false"});
this.map.uiManager.setDocTypeMultiplePrefs(deckPref)};Sidebar.prototype.commandForDeck=function(
deckId){if(deckId==="PropertyDeck")return".uno:SidebarDeck.PropertyDeck";else if(
deckId==="SdCustomAnimationDeck")return".uno:CustomAnimation";else if(deckId==="NavigatorDeck"
)return".uno:Navigator";else if(deckId==="StyleListDeck"
)return".uno:SidebarDeck.StyleListDeck";else if(deckId==="A11yCheckDeck"
)return".uno:SidebarDeck.A11yCheckDeck";return""};Sidebar.prototype.setupTargetDeck=function(
unoCommand){this.targetDeckCommand=unoCommand};Sidebar.prototype.getTargetDeck=function(){
return this.targetDeckCommand};Sidebar.prototype.changeDeck=function(unoCommand){if(
unoCommand!==null&&unoCommand!==undefined)app.socket.sendMessage("uno "+unoCommand);
this.setupTargetDeck(unoCommand)};Sidebar.prototype.onSidebar=function(data){var _this=this;
var sidebarData=data.data;this.builder.setWindowId(sidebarData.id);$(this.container).empty();if(
sidebarData.action==="close"||window.app.file.disableSidebar||this.map.isReadOnlyMode()){
this.closeSidebar()}else if(sidebarData.children){for(var i=sidebarData.children.length-1;i>=0;i--){
if(sidebarData.children[i].type!=="deck"){sidebarData.children.splice(i,1);continue}if(
typeof sidebarData.children[i].id==="string"&&sidebarData.children[i].id.startsWith("Navigator")){
this.markNavigatorTreeView(sidebarData)}}if(sidebarData.children.length){this.onResize();if(
sidebarData.children&&sidebarData.children[0]&&sidebarData.children[0].id){
var currentDeck=sidebarData.children[0].id;this.updateSidebarPrefs(currentDeck);if(
this.targetDeckCommand){var stateHandler=this.map["stateChangeHandler"];
var isCurrent=stateHandler?stateHandler.getItemValue(this.targetDeckCommand):false;if(
isCurrent==="false"||!isCurrent)isCurrent=this.targetDeckCommand===this.commandForDeck(currentDeck);
if(this.targetDeckCommand&&(isCurrent==="false"||!isCurrent))this.changeDeck(this.targetDeckCommand)
}else{this.changeDeck(this.targetDeckCommand)}}this.model.fullUpdate(sidebarData);
this.builder.build(this.container,[this.model.getSnapshot()],false);if(!this.isVisible()){$(
"#sidebar-dock-wrapper").addClass("visible");if(this.isUserRequest){setTimeout(function(){
app.layoutingService.appendLayoutingTask(function(){var focusables=JSDialog.GetFocusableElements(
_this.container);if(focusables&&focusables.length){focusables[0].focus()}})},250)}}
this.map.uiManager.setDocTypePref("ShowSidebar",true)}else{this.closeSidebar()}
this.isUserRequest=true}};return Sidebar}(SidebarBase);JSDialog.Sidebar=function(map){
return new Sidebar(map)};var __extends=this&&this.__extends||function(){var extendStatics=function(d
,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var NavigatorPanel=function(_super){__extends(NavigatorPanel,
_super);function NavigatorPanel(map){return _super.call(this,map,SidebarType.Navigator)||this}
NavigatorPanel.prototype.onAdd=function(map){_super.prototype.onAdd.call(this,map);this.map.on(
"navigator",this.onNavigator,this);this.map.on("doclayerinit",this.onDocLayerInit,this);this.map.on(
"focussearch",this.focusSearch,this);this.navigationPanel=document.getElementById(
"navigation-sidebar");this.floatingNavIcon=document.getElementById("navigator-floating-icon");
this.presentationControlsWrapper=this.navigationPanel.querySelector("#presentation-controls-wrapper"
);this.navigatorDockWrapper=this.navigationPanel.querySelector("#navigator-dock-wrapper");
this.quickFindWrapper=this.navigationPanel.querySelector("#quickfind-dock-wrapper");this.map.on(
"zoomend",this.handleFloatingButtonVisibilityOnZoomChange,this)};
NavigatorPanel.prototype.onRemove=function(){_super.prototype.onRemove.call(this);this.map.off(
"navigator");this.map.off("zoomend");this.map.off("doclayerinit")};
NavigatorPanel.prototype.onDocLayerInit=function(){var allowedDocTypes=["presentation","drawing"];
if(allowedDocTypes.includes(app.map.getDocType())&&!window.mode.isMobile()){
this.showNavigationPanel()}};NavigatorPanel.prototype.initializeNavigator=function(docType){
var _this=this;app.layoutingService.appendLayoutingTask(function(){_this.initializeImpl(docType)})};
NavigatorPanel.prototype.initializeImpl=function(docType){var _this=this;
var navContainer=window.L.DomUtil.create("div","navigation-options-container");
navContainer.id="navigation-options-wrapper";if(docType!=="spreadsheet"){
this.createFloatingNavigatorBtn();this.navigationPanel.insertAdjacentElement("afterend",
this.floatingNavIcon)}var navHeader=window.L.DomUtil.create("div","navigation-header",navContainer);
var navTitle=window.L.DomUtil.create("span","navigation-title",navHeader);navTitle.textContent=_(
"Navigation");var navSearchWrapper=window.L.DomUtil.create("div","navigation-search-wrapper");
var closeNavWrapper=window.L.DomUtil.create("div","close-navigation-wrapper",navHeader);
this.closeNavButton=window.L.DomUtil.create("button","close-navigation-button",closeNavWrapper);
var closeNavigationText=_("Close Navigation");this.closeNavButton.setAttribute("aria-label",
closeNavigationText);this.closeNavButton.setAttribute("data-cooltip",closeNavigationText);
window.L.control.attachTooltipEventListener(this.closeNavButton,this.map);
this.closeNavButton.setAttribute("tabindex","0");var clickFunction=function(){this.closeNavigation()
if(app.showNavigator){app.map.sendUnoCommand(".uno:Navigator")}app.map.focus()}.bind(this);
this.closeNavButton.addEventListener("click",clickFunction);this.navigationPanel.addEventListener(
"keydown",function(e){if(e.code==="Escape"){clickFunction();e.preventDefault();e.stopPropagation()}}
);var contentDivs=[];if(this.map.isPresentationOrDrawing()||this.map.isText()){var navigationTabs=[]
var navOptions=window.L.DomUtil.create("div","navigation-tabs",navContainer);
navOptions.id="navigation-options";navOptions.setAttribute("role","tablist");if(
this.map.isPresentationOrDrawing()){var slideSorterTab=window.L.DomUtil.create("button","tab",
navOptions);slideSorterTab.id="tab-slide-sorter";slideSorterTab.textContent=_("Slides");if(
this.presentationControlsWrapper){slideSorterTab.setAttribute("aria-controls",
"presentation-controls-wrapper");this.presentationControlsWrapper.setAttribute("role","tabpanel");
this.presentationControlsWrapper.setAttribute("aria-labelledby","tab-slide-sorter");
contentDivs.push(this.presentationControlsWrapper)}navigationTabs.push(slideSorterTab)}
var navigatorTab=window.L.DomUtil.create("button","tab",navOptions);navigatorTab.id="tab-navigator";
navigatorTab.textContent=_("Outline");if(this.navigatorDockWrapper){navigatorTab.setAttribute(
"aria-controls","navigator-dock-wrapper");this.navigatorDockWrapper.setAttribute("role","tabpanel");
this.navigatorDockWrapper.setAttribute("aria-labelledby","tab-navigator");contentDivs.push(
this.navigatorDockWrapper)}navigationTabs.push(navigatorTab);if(this.map.isText()){
var quickFindTab=window.L.DomUtil.create("button","tab",navOptions);quickFindTab.id="tab-quick-find"
quickFindTab.textContent=_("Results");if(this.quickFindWrapper){quickFindTab.setAttribute(
"aria-controls","quickfind-dock-wrapper");this.quickFindWrapper.setAttribute("role","tabpanel");
this.quickFindWrapper.setAttribute("aria-labelledby","tab-quick-find");contentDivs.push(
this.quickFindWrapper)}navigationTabs.push(quickFindTab)}if(navigationTabs.length>0){
navigationTabs.forEach(function(tab,index){tab.setAttribute("role","tab");if(index===0){
tab.setAttribute("aria-selected","true");tab.classList.add("selected")}else{tab.setAttribute(
"aria-selected","false");tab.setAttribute("tabindex","-1")}});navigationTabs.forEach(function(tab){
tab.addEventListener("click",function(){this.switchNavigationTab(tab.id)}.bind(_this))});
JSDialog.KeyboardTabNavigation(navigationTabs,contentDivs)}}if(this.navigationPanel){
this.navigationPanel.prepend(navContainer);if(this.map.isText()){this.navigationPanel.prepend(
navSearchWrapper);this.createSearchBar(navSearchWrapper)}this.navigationPanel.prepend(navHeader)}};
NavigatorPanel.prototype.createFloatingNavigatorBtn=function(){
this.floatingNavIcon.className="notebookbar unoNavigator unospan-view-navigator unotoolbutton visible"
this.floatingNavIcon.setAttribute("tabindex","-1");var navigatorText=_("Navigator");
this.floatingNavIcon.setAttribute("data-cooltip",navigatorText);
window.L.control.attachTooltipEventListener(this.floatingNavIcon,this.map);
var buttonWrapper=document.createElement("div");buttonWrapper.className="navigator-btn-wrapper";
buttonWrapper.setAttribute("aria-label",navigatorText);var button=document.createElement("button");
button.className="ui-content unobutton";button.id="floating-navigator";button.accessKey="ZN";
button.setAttribute("aria-pressed","false");var img=document.createElement("img");
app.LOUtil.setImage(img,"lc_navigator.svg",this.map);button.appendChild(img);
buttonWrapper.appendChild(button);this.floatingNavIcon.appendChild(buttonWrapper);
this.floatingNavIcon.addEventListener("click",function(){this.showNavigationPanel();if(
app.map.isPresentationOrDrawing()){this.switchNavigationTab("tab-slide-sorter")}else{
app.map.sendUnoCommand(".uno:Navigator")}this.focusSearch()}.bind(this))};
NavigatorPanel.prototype.onNavigator=function(data){var navigatorData=data.data;
this.builder.setWindowId(navigatorData.id);this.container.innerHTML="";if(
navigatorData.action==="close"||window.app.file.disableSidebar||this.map.isReadOnlyMode()){
this.closeSidebar()}else if(navigatorData.children){if(navigatorData.children.length){this.onResize(
)}this.markNavigatorTreeView(navigatorData);this.builder.build(this.container,[navigatorData],false)
this.showNavigationPanel();$("#navigator-dock-wrapper").show(200);app.showNavigator=true;if(
app.map.isPresentationOrDrawing()&&!this.isNavigationPanelVisible()){this.switchNavigationTab(
"tab-slide-sorter")}else{this.switchNavigationTab("tab-navigator")}if(this.focusQuickFind){
this.switchNavigationTab("tab-quick-find");this.focusSearch();this.focusQuickFind=false}}else{
this.closeSidebar()}};NavigatorPanel.prototype.onJSUpdate=function(e){if(
this.highlightTerm&&this.highlightTerm.trim().length>0){
e.data.control.highlightTerm=this.highlightTerm}return _super.prototype.onJSUpdate.call(this,e)};
NavigatorPanel.prototype.closeSidebar=function(){this.closeNavigation();app.showNavigator=false;
_super.prototype.closeSidebar.call(this)};NavigatorPanel.prototype.switchNavigationTab=function(
tabId){this.navigationPanel.querySelectorAll(".navigation-tabs .tab").forEach(function(t){
t.classList.remove("selected");t.setAttribute("aria-selected","false");t.setAttribute("tabindex",
"-1")});var tab=this.navigationPanel.querySelector("#"+tabId);if(tab){tab.classList.add("selected");
tab.setAttribute("aria-selected","true");tab.removeAttribute("tabindex")}if(
tabId==="tab-slide-sorter"){this.presentationControlsWrapper.style.display="block";
this.navigatorDockWrapper.style.display="none";this.quickFindWrapper.style.display="none"}else if(
tabId==="tab-navigator"){if(!app.showNavigator)app.map.sendUnoCommand(".uno:Navigator");
this.presentationControlsWrapper.style.display="none";
this.navigatorDockWrapper.style.display="block";this.quickFindWrapper.style.display="none"}else if(
tabId==="tab-quick-find"){if(!app.showQuickFind)app.map.sendUnoCommand(".uno:QuickFind");
this.presentationControlsWrapper.style.display="none";this.navigatorDockWrapper.style.display="none"
this.quickFindWrapper.style.display="block"}};
NavigatorPanel.prototype.handleFloatingButtonVisibilityOnZoomChange=function(){if(this.map.getZoom(
)>=14||this.map.getZoom()>=13&&this.map.getDocType()==="presentation"){
this.floatingNavIcon.classList.remove("visible")}else if(!this.navigationPanel.classList.contains(
"visible")){this.floatingNavIcon.classList.add("visible")}};
NavigatorPanel.prototype.showNavigationPanel=function(){var _this=this;
app.layoutingService.appendLayoutingTask(function(){_this.navigationPanel.classList.add("visible");
_this.floatingNavIcon.classList.remove("visible");app.map.fire("fixruleroffset")})};
NavigatorPanel.prototype.isNavigationPanelVisible=function(){
return this.navigationPanel.classList.contains("visible")};
NavigatorPanel.prototype.closeNavigation=function(){var _this=this;
app.layoutingService.appendLayoutingTask(function(){_this.navigationPanel.classList.remove("visible"
);_this.floatingNavIcon.classList.add("visible");_this.handleFloatingButtonVisibilityOnZoomChange()}
)};NavigatorPanel.prototype.preFocusQuickFind=function(){this.focusQuickFind=true};
NavigatorPanel.prototype.focusSearch=function(){var searchInput=document.getElementById(
"navigator-search-input");if(!searchInput)return;app.layoutingService.appendLayoutingTask(function(
){searchInput.focus()})};NavigatorPanel.prototype.createSearchBar=function(wrapper){var data={id:"",
type:"container",children:[{id:"navigator-search",type:"edit",placeholder:_("Search..."),text:""},{
id:"",type:"toolbox",text:"",children:[{id:"navigator-search-button",type:"pushbutton",text:"",
image:"lc_recsearch.svg"}]}]};this.builder.build(wrapper,[data],false)};
NavigatorPanel.prototype.useDefaultCallback=function(objectType,eventType,object,data,builder){
_super.prototype.callback.call(this,objectType,eventType,object,data,builder)};
NavigatorPanel.prototype.getSearchTerm=function(){var searchInput=document.getElementById(
"navigator-search-input");if(searchInput)return searchInput.value;else return null};
NavigatorPanel.prototype.useSearchCallback=function(objectType,eventType,object,builder){if(
eventType==="activate"){var resultsTab=this.navigationPanel.querySelector(
"#tab-quick-find:not(.selected)");if(resultsTab)resultsTab.click()}
var nextButton=this.navigationPanel.querySelector("#findnext button");
var nextButtonVisible=nextButton&&nextButton.checkVisibility();var searchTerm=this.getSearchTerm();
if(!searchTerm)return;var termChanged=searchTerm!==this.highlightTerm;this.highlightTerm=searchTerm;
var newSearch=termChanged||!nextButtonVisible;if(newSearch){if(object.id==="navigator-search-button"
)_super.prototype.callback.call(this,"edit","activate",{id:"Find"},searchTerm,builder
);else _super.prototype.callback.call(this,objectType,eventType,{id:"Find"},searchTerm,builder)
}else if(nextButton)nextButton.click();if(eventType==="activate"){
var treeContainer=document.getElementById("contenttree");if(treeContainer
)treeContainer.highlightEntries(searchTerm)}};NavigatorPanel.prototype.callback=function(objectType,
eventType,object,data,builder){if(!["navigator-search-button","navigator-search"].includes(object.id
)){this.useDefaultCallback(objectType,eventType,object,data,builder);return}else{
this.useSearchCallback(objectType,eventType,object,builder)}};return NavigatorPanel}(SidebarBase);
JSDialog.NavigatorPanel=function(map){return new NavigatorPanel(map)};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var QuickFindPanel=function(_super){__extends(QuickFindPanel,
_super);function QuickFindPanel(map){return _super.call(this,map,SidebarType.QuickFind)||this}
QuickFindPanel.prototype.onAdd=function(map){var _a;_super.prototype.onAdd.call(this,map);(
_a=this.builder)===null||_a===void 0?void 0:_a.setWindowId(WindowId.QuickFind);this.map=map;
this.map.on("quickfind",this.onQuickFind,this)};QuickFindPanel.prototype.onRemove=function(){
this.map.off("quickfind",this.onQuickFind,this)};QuickFindPanel.prototype.onJSUpdate=function(e){
var _this=this;var data=e.data;if(data.control.id==="searchfinds"&&data.control.type==="treelistbox"
)e.data.control.ignoreFocus=true;if(!_super.prototype.onJSUpdate.call(this,e))return false;
app.layoutingService.appendLayoutingTask(function(){if(data.control.id==="numberofsearchfinds"){
_this.handleNumberOfSearchFinds(data.control)}else if(
data.control.id==="searchfinds"&&data.control.type==="treelistbox"){
_this.handleSearchFindsTreelistbox(data.control)}});return true};
QuickFindPanel.prototype.handleNumberOfSearchFinds=function(control){var _a;
var placeholder=document.getElementById("quickfind-placeholder");var hasText=((_a=control.text
)!==null&&_a!==void 0?_a:"").trim().length>0;if(placeholder)placeholder.classList.toggle("hidden",
hasText)};QuickFindPanel.prototype.handleSearchFindsTreelistbox=function(control){
var placeholder=document.getElementById("quickfind-placeholder");
var quickFindControls=document.getElementById("quickfind-controls");var isEmpty=!Array.isArray(
control.entries)||control.entries.length===0;if(placeholder)placeholder.classList.toggle("hidden",
!isEmpty);if(quickFindControls)quickFindControls.classList.toggle("hidden",isEmpty)};
QuickFindPanel.prototype.addPlaceholderIfEmpty=function(quickFindData){
var hasEntries=quickFindData.children&&quickFindData.children.some(function(child){
return child.type==="treelistbox"&&child.entries&&child.entries.length>0});if(!hasEntries){
var modifiedData=JSON.parse(JSON.stringify(quickFindData));if(!modifiedData.children
)modifiedData.children=[];modifiedData.children.unshift({id:"quickfind-placeholder",
type:"fixedtext",renderAsStatic:true,text:_(
"Type in the search box to find anything in your document"),visible:true});return modifiedData}
return quickFindData};QuickFindPanel.prototype.onQuickFind=function(data){var _a;
var quickFindData=data.data;if(!this.container){app.console.error("QuickFind: no container");return}
this.container.innerHTML="";var modifiedData=this.addPlaceholderIfEmpty(quickFindData);(
_a=this.builder)===null||_a===void 0?void 0:_a.build(this.container,[modifiedData],false);
app.showQuickFind=true;app.map.fire("fixruleroffset")};return QuickFindPanel}(SidebarBase);
JSDialog.QuickFindPanel=function(map){return new QuickFindPanel(map)};
var AutoCompletePopup=function(){function AutoCompletePopup(popupId,map){this.map=map;
this.popupId=popupId;this.newPopupData={children:[{id:"container",type:"container",enabled:true,
children:new Array,vertical:true}],jsontype:"dialog",type:"modalpopup",cancellable:true,
popupParent:"_POPOVER_",clickToClose:"_POPOVER_",id:this.popupId,persistKeyboard:true};
this.isMobile=window.mode.isMobile();this.onAdd();this.map.on("closepopup",this.closePopup,this)}
AutoCompletePopup.prototype.closePopup=function(){var popupExists=window.L.DomUtil.get(this.popupId)
if(!popupExists)return;this.map.jsdialog.focusToLastElement(this.popupId);
this.map.jsdialog.clearDialog(this.popupId)};AutoCompletePopup.prototype.getPopupJSON=function(
control,framePos){return{jsontype:"dialog",id:this.popupId,action:"update",control:control,
posx:framePos.x,posy:framePos.y,children:undefined}};
AutoCompletePopup.prototype.getTreeJSON=function(){return{id:this.popupId+"List",type:"treelistbox",
text:"",enabled:true,singleclickactivate:false,fireKeyEvents:true,entries:[]}};
AutoCompletePopup.prototype.sendUpdate=function(data){this.map.fire("jsdialogupdate",{data:data,
callback:this.callback.bind(this)})};AutoCompletePopup.prototype.sendJSON=function(data){
var fireEvent=this.isMobile?"mobilewizard":"jsdialog";this.map.fire(fireEvent,{data:data,
callback:this.callback.bind(this)})};AutoCompletePopup.prototype.getCursorPosition=function(){
var commentSection=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);if(
commentSection===null||commentSection===void 0?void 0:commentSection.getActiveEdit()){
var caretRect=window.getSelection().getRangeAt(0).getBoundingClientRect();
var mapRect=this.map._container.getBoundingClientRect();return new cool.Point(
caretRect.left-mapRect.left,caretRect.bottom-mapRect.top)}var currPos={
x:app.file.textCursor.rectangle.cX1,y:app.file.textCursor.rectangle.cY2};
var origin=this.map.getPixelOrigin();var panePos=this.map._getMapPanePos();return new cool.Point(
Math.round(currPos.x+panePos.x-origin.x),Math.round(currPos.y+panePos.y-origin.y))};
AutoCompletePopup.prototype.openPopup=function(ev){var entries=this.getPopupEntries(ev);if(
entries.length===0)return;var cursorPos=this.getCursorPosition();var control=this.getTreeJSON();if(
window.L.DomUtil.get(this.popupId+"List")){var data_1=this.getPopupJSON(control,cursorPos);
data_1.control.entries=entries;this.sendUpdate(data_1);return}if(window.L.DomUtil.get(this.popupId)
)this.closePopup();var data=this.newPopupData;data.children[0].children[0]=control;data.children[0
].children[0].entries=entries;var isSpreadsheetRTL=this.map._docLayer.isCalcRTL();
var canvasEl=this.map._docLayer._canvas.getBoundingClientRect();
var offsetX=isSpreadsheetRTL?0:app.sectionContainer.getSectionWithName(app.CSections.RowHeader.name
).size[0];var offsetY=app.sectionContainer.getSectionWithName(app.CSections.ColumnHeader.name).size[
1];if(isSpreadsheetRTL)cursorPos.x=this.map._size.x-cursorPos.x;
data.posx=cursorPos.x+offsetX+canvasEl.left;data.posy=cursorPos.y+offsetY+canvasEl.top;
this.sendJSON(data)};AutoCompletePopup.prototype.getPopupId=function(){return this.popupId};
AutoCompletePopup.prototype.callback=function(objectType,eventType,object,index){if(
eventType==="keydown"){if(object.key!=="Tab"&&object.key!=="Shift"){this.map.focus();return true}}
return false};return AutoCompletePopup}();var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};var Mention=function(_super){
__extends(Mention,_super);function Mention(map){return _super.call(this,"mentionPopup",map)||this}
Mention.prototype.onAdd=function(){this.newPopupData.isAutoCompletePopup=true;
this.typingMention=false;this.partialMention=[];this.cursorPosAtStart={x:0,y:0}};
Mention.prototype.sendMentionPostMsg=function(partialText){var _this=this;if(this.debouceTimeoutId
)clearTimeout(this.debouceTimeoutId);if(partialText===""){this.closeMentionPopup(true);return}
this.debouceTimeoutId=setTimeout(function(){_this.map.fire("postMessage",{msgId:"UI_Mention",args:{
type:"autocomplete",text:partialText}})},300)};Mention.prototype.getPopupEntries=function(users){
var _a,_b;var entries=[];if(users===null)return entries;var text=this.getPartialMention();if(
text.length>1){this.filteredUsers=users.filter(function(element){var _a;var uid=(_a=element.label
)!==null&&_a!==void 0?_a:element.username;return uid.toLowerCase().includes(text.toLowerCase())})
}else{this.filteredUsers=users}if(this.filteredUsers.length!==0){for(var i in this.filteredUsers){
var currentUser=this.filteredUsers[i];var entry={text:(_a=currentUser.label
)!==null&&_a!==void 0?_a:currentUser.username,columns:[{text:(_b=currentUser.label
)!==null&&_b!==void 0?_b:currentUser.username}],row:i.toString()};entries.push(entry)}}
return entries};Mention.prototype.openMentionPopup=function(users){if(!this.typingMention)return;
var entries=this.getPopupEntries(users);var commentSection=app.sectionContainer.getSectionWithName(
app.CSections.CommentList.name);
var isMobileCommentActive=commentSection===null||commentSection===void 0?void 0:commentSection.isMobileCommentActive(
);
var mobileCommentModalId=commentSection===null||commentSection===void 0?void 0:commentSection.getMobileCommentModalId(
);if(entries.length===0&&this.isMobile&&isMobileCommentActive){var control_1=this.getTreeJSON();
control_1.hideIfEmpty=true;var data_1=this.getPopupJSON(control_1,{x:0,y:0});
data_1.id=mobileCommentModalId;data_1.control.entries=[];this.sendUpdate(data_1);return}
var currentPos=this.getCursorPosition();var cursorPos=__assign({},this.cursorPosAtStart);if(
this.cursorPosAtStart.y!==currentPos.y){cursorPos=currentPos;this.cursorPosAtStart=currentPos}
var canvasEl=this.map._docLayer._canvas.getBoundingClientRect();cursorPos.y+=canvasEl.top;if(
entries.length===0){var noMatchOnSpace=this.getPartialMention().indexOf(" ");if(noMatchOnSpace!==-1
){this.closeMentionPopup(false);return}var control_2=this.getSimpleTextJSON();if(
window.L.DomUtil.get(this.popupId+"fixedtext")){var data_2=this.getPopupJSON(control_2,cursorPos);
this.sendUpdate(data_2);return}if(window.L.DomUtil.get(this.popupId))this.closeMentionPopup(true);
var data_3=this.newPopupData;data_3.children[0].children[0]=control_2;data_3.posx=cursorPos.x;
data_3.posy=cursorPos.y;this.sendJSON(data_3);return}var control=this.getTreeJSON();if(
isMobileCommentActive)control.hideIfEmpty=true;if(window.L.DomUtil.get(this.popupId+"List")){
var data_4=this.getPopupJSON(control,cursorPos);if(isMobileCommentActive
)data_4.id=mobileCommentModalId;data_4.control.entries=entries;this.sendUpdate(data_4);return}if(
window.L.DomUtil.get(this.popupId))this.closeMentionPopup(true);var data=this.newPopupData;
data.children[0].children[0]=control;data.children[0].children[0].entries=entries;
data.posx=cursorPos.x;data.posy=cursorPos.y;this.sendJSON(data)};
Mention.prototype.getSimpleTextJSON=function(){return{id:this.popupId+"fixedtext",type:"fixedtext",
text:_("No search results found!"),enabled:true}};Mention.prototype.closeMentionPopup=function(
typingMention){this.typingMention=typingMention;if(!typingMention)this.partialMention=[];
var mentionPopup=window.L.DomUtil.get(this.popupId)||window.L.DomUtil.get(this.popupId+"List"
)||window.L.DomUtil.get(this.popupId+"fixedtext");if(!mentionPopup)return;
this.map.jsdialog.focusToLastElement(this.popupId);if(this.isMobile){
var commentSection=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);
var isMobileCommentActive=commentSection===null||commentSection===void 0?void 0:commentSection.isMobileCommentActive(
);
var mobileCommentModalId=commentSection===null||commentSection===void 0?void 0:commentSection.getMobileCommentModalId(
);if(isMobileCommentActive){var control=this.getTreeJSON();control.hideIfEmpty=true;
var data=this.getPopupJSON(control,{x:0,y:0});data.id=mobileCommentModalId;data.control.entries=[];
this.sendUpdate(data)}else{this.map.fire("closemobilewizard")}}else this.map.jsdialog.clearDialog(
this.popupId)};Mention.prototype.getPartialMention=function(){return this.partialMention.join(""
).substring(1)};Mention.prototype.isTypingMention=function(){return this.typingMention};
Mention.prototype.handleMentionInput=function(ev,newPara){if(!this.typingMention){
var isAtSymbol=ev.data==="@";
var isLastCharAtOrSpace=this.lastTypedChar===" "||this.lastTypedChar==="@";if(
newPara&&isAtSymbol||isAtSymbol&&isLastCharAtOrSpace){this.partialMention.push(ev.data);
this.typingMention=true;this.cursorPosAtStart=this.getCursorPosition();return}
this.lastTypedChar=ev.data;return}
var deleteEvent=ev.inputType==="deleteContentBackward"||ev.inputType==="deleteContentForward";if(
deleteEvent){var ch=this.partialMention.pop();if(ch==="@")this.closeMentionPopup(false
);else this.sendMentionPostMsg(this.getPartialMention());return}if(
ev.data==="@"&&this.partialMention.length===1){return}var regEx=/^[0-9a-zA-Z ]+$/;if(
ev.data&&ev.data.match(regEx)){this.partialMention.push(ev.data);this.sendMentionPostMsg(
this.getPartialMention())}else{this.closeMentionPopup(false)}};
Mention.prototype.getMentionUserData=function(index){if(index>=this.filteredUsers.length)return{
username:"",profile:"",label:null};return this.filteredUsers[index]};
Mention.prototype.sendHyperlinkUnoCommand=function(uid,profile,replacement){var command={
"Hyperlink.Text":{type:"string",value:"@"+uid},"Hyperlink.URL":{type:"string",value:profile},
"Hyperlink.ReplacementText":{type:"string",value:replacement}};this.map.sendUnoCommand(
".uno:SetHyperlink",command,true)};Mention.prototype.callback=function(objectType,eventType,object,
index){var commentSection=app.sectionContainer.getSectionWithName(app.CSections.CommentList.name);
var comment=commentSection===null||commentSection===void 0?void 0:commentSection.getActiveEdit();if(
eventType==="close"){this.closeMentionPopup(false)}else if(
eventType==="select"||eventType==="activate"){var username=this.filteredUsers[index].username;
var profileLink=this.filteredUsers[index].profile;var label=this.filteredUsers[index].label;
var replacement="@"+this.getPartialMention();if(comment){comment.autoCompleteMention(
label!==null&&label!==void 0?label:username,profileLink,replacement)}else{
this.sendHyperlinkUnoCommand(label!==null&&label!==void 0?label:username,profileLink,replacement);
this.map._textInput._sendText(" ")}this.map.fire("postMessage",{msgId:"UI_Mention",args:{
type:"selected",username:username,label:label}});this.closeMentionPopup(false)}else if(
eventType==="keydown"){if(object.key!=="Tab"&&object.key!=="Shift"){if(comment)comment.focus(
);else this.map.focus();return true}}return false};return Mention}(AutoCompletePopup);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var FormulaUsagePopup=function(_super){__extends(
FormulaUsagePopup,_super);function FormulaUsagePopup(map){var _this=_super.call(this,
"formulausagePopup",map)||this;_this.newPopupData={children:[{id:"container",type:"container",
enabled:true,children:new Array,vertical:true}],jsontype:"dialog",type:"dialog",cancellable:true,
hasClose:false,isAutoCompletePopup:true,popupParent:undefined,clickToClose:undefined,
id:"formulausagePopup",title:""};return _this}FormulaUsagePopup.prototype.onAdd=function(){
this.newPopupData.isAutoCompletePopup=true;this.map.on("openformulausagepopup",
this.openFormulaUsagePopup,this);this.map.on("sendformulausagetext",this.sendFormulaUsageText,this)}
FormulaUsagePopup.prototype.openFormulaUsagePopup=function(ev){this.openPopup({data:ev});
this.map.focus()};FormulaUsagePopup.prototype.sendFormulaUsageText=function(ev){
this.openFormulaUsagePopup(ev)};FormulaUsagePopup.prototype.getPopupEntries=function(ev){
this.usageText=ev.data.data;var chIndex=this.usageText.indexOf(":");
var functionUsage=this.usageText.substring(0,chIndex);var usageDescription=this.usageText.substring(
chIndex+1);var entries=[{row:0,columns:[{text:functionUsage}],collapsed:false,children:[{row:1,
columns:[{text:usageDescription}]}]}];return entries};FormulaUsagePopup.prototype.callback=function(
objectType,eventType,object,index){if(eventType==="close"){this.closePopup()}return false};
return FormulaUsagePopup}(AutoCompletePopup);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var FormulaAutoCompletePopup=function(_super){__extends(FormulaAutoCompletePopup,_super);
function FormulaAutoCompletePopup(map){return _super.call(this,"formulaautocompletePopup",map)||this
}FormulaAutoCompletePopup.prototype.onAdd=function(){this.newPopupData.isAutoCompletePopup=true;
this.map.on("openformulaautocompletepopup",this.openFormulaAutoCompletePopup,this);this.map.on(
"sendformulatext",this.sendFormulaText,this);this.functionList=null};
FormulaAutoCompletePopup.prototype.openFormulaAutoCompletePopup=function(ev){this.map.fire(
"closepopup");this.openPopup({data:ev})};
FormulaAutoCompletePopup.prototype.sendFormulaText=function(ev){this.openFormulaAutoCompletePopup(ev
)};FormulaAutoCompletePopup.prototype.getPopupEntries=function(ev){var entries=[];
this.functionList=ev.data.data;if(this.functionList.length!==0){for(var i in this.functionList){
var entry={text:this.functionList[i].name,columns:[{text:this.functionList[i].name},{
text:"\n"+this.functionList[i].description}],row:i.toString()};entries.push(entry)}}return entries};
FormulaAutoCompletePopup.prototype.getAutocompleteText=function(currentCellFormula,functionName,
endIndex){var openBracketIndex=[];var semicolonIndex=[];var plusIndex=[];var multiplyIndex=[];
var divideIndex=[];var minusIndex=[];var equalIndex=0;for(var i=0;i<currentCellFormula.length;i++){
var char=currentCellFormula.charAt(i);if(char==="(")openBracketIndex.push(i);else if(char===";"
)semicolonIndex.push(i);else if(char==="+")plusIndex.push(i);else if(char==="*")multiplyIndex.push(i
);else if(char==="/")divideIndex.push(i);else if(char==="-")minusIndex.push(i)}
var minDiff=Number.MAX_VALUE;var startIndex;var updateMinDiff=function(index){var tmp=endIndex-index
if(tmp>=0&&tmp<minDiff){minDiff=tmp;startIndex=index+1}};updateMinDiff(equalIndex);
openBracketIndex.forEach(updateMinDiff);semicolonIndex.forEach(updateMinDiff);plusIndex.forEach(
updateMinDiff);minusIndex.forEach(updateMinDiff);multiplyIndex.forEach(updateMinDiff);
divideIndex.forEach(updateMinDiff);var partialText=currentCellFormula.substring(startIndex,
endIndex+1).trim();var autoCompleteFunctionName="";for(var i=0;i<Math.max(partialText.length,
functionName.length);i++){if(partialText.charAt(i).toLowerCase()!=functionName.charAt(i
).toLowerCase()){autoCompleteFunctionName=functionName.substring(i);break}}
return autoCompleteFunctionName};FormulaAutoCompletePopup.prototype.callback=function(objectType,
eventType,object,index){if(eventType==="close"){this.closePopup()}else if(
eventType==="select"||eventType==="activate"){var namedRange=this.functionList[index].namedRange;
var currentText=this.map._docLayer._lastFormula;
var addedCharacterIndex=this.map._docLayer._newFormulaDiffIndex;
var functionName=this.getAutocompleteText(currentText,this.functionList[index].name,
addedCharacterIndex);if(namedRange)this.map._textInput._sendText(functionName
);else this.map._textInput._sendText(functionName+"(");this.closePopup()}else if(
eventType==="keydown"){if(object.key!=="Tab"&&object.key!=="Shift"){this.map.focus();return true}}
return false};return FormulaAutoCompletePopup}(AutoCompletePopup);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var AutoFillPreviewTooltip=function(_super){__extends(
AutoFillPreviewTooltip,_super);function AutoFillPreviewTooltip(map){return _super.call(this,
"autoFillPreviewTooltip",map)||this}AutoFillPreviewTooltip.prototype.getPopupEntries=function(ev){
return[]};AutoFillPreviewTooltip.prototype.onAdd=function(){
this.newPopupData.isAutoFillPreviewTooltip=true;this.newPopupData.noOverlay=true;
this.newPopupData.id="autoFillPreviewTooltip";this.map.on("openautofillpreviewpopup",
this.openAutoFillPreviewPopup,this);this.map.on("closeautofillpreviewpopup",
this.closeAutoFillPreviewPopup,this)};AutoFillPreviewTooltip.prototype.getSimpleTextJSON=function(
cellValue){return{id:this.popupId+"fixedtext",type:"fixedtext",text:cellValue,enabled:false}};
AutoFillPreviewTooltip.prototype.openAutoFillPreviewPopup=function(ev){
var cellRange=this.map._docLayer._parseCellRange(JSON.stringify(ev.data.celladdress));
ev.data.celladdress=this.map._docLayer._cellRangeToTwipRect(cellRange).toRectangle();
ev.data.celladdress=new cool.SimplePoint(parseInt(ev.data.celladdress[0]),parseInt(
ev.data.celladdress[1]));
ev.data.celladdress.pX-=app.activeDocument.activeView.viewedRectangle.pX1-app.sectionContainer.getDocumentAnchor(
)[0];
ev.data.celladdress.pY-=app.activeDocument.activeView.viewedRectangle.pY1-app.sectionContainer.getDocumentAnchor(
)[1];var entry=ev.data.text;var data;if(entry.length>0){this.closeAutoFillPreviewPopup();
var control=this.getSimpleTextJSON(entry);if(window.L.DomUtil.get(this.popupId+"fixedtext")){
data=this.getPopupJSON(control,{x:ev.data.celladdress.cX,y:ev.data.celladdress.cY});this.sendUpdate(
data);return}if(window.L.DomUtil.get(this.popupId))this.closeAutoFillPreviewPopup();
data=Object.assign({},this.newPopupData);data.children[0].children[0]=control;
data.posx=ev.data.celladdress.cX;data.posy=ev.data.celladdress.cY;this.sendJSON(data)}};
AutoFillPreviewTooltip.prototype.closeAutoFillPreviewPopup=function(){
_super.prototype.closePopup.call(this)};return AutoFillPreviewTooltip}(AutoCompletePopup);
var AddressInputField=function(){function AddressInputField(map){this.map=map;
this.parentContainer=window.L.DomUtil.get("addressInput");this.map.on("jsdialogupdate",
this.onJSUpdate,this);this.map.on("jsdialogaction",this.onJSAction,this);this.map.on("doclayerinit",
this.onDocLayerInit,this);this.map.on("celladdress",this.onCellAddress,this);
this.builder=new window.L.control.jsDialogBuilder({mobileWizard:this,map:this.map,
cssClass:"addressInput jsdialog",windowId:WindowId.AddressInput,suffix:"address"});
this.createAddressInputField()}AddressInputField.prototype.onRemove=function(){this.map.off(
"jsdialogupdate",this.onJSUpdate,this);this.map.off("jsdialogaction",this.onJSAction,this);
this.map.off("doclayerinit",this.onDocLayerInit,this);this.map.off("celladdress",this.onCellAddress,
this)};AddressInputField.prototype.onCellAddress=function(event){
var addressInput=document.querySelector("#addressInput input");if(
addressInput&&document.activeElement!==addressInput){addressInput.value=event.address;
addressInput.setAttribute("aria-label",event.address)}this.map.formulabarSetDirty()};
AddressInputField.prototype.createAddressInputField=function(){var data=[{id:"pos_window",
type:"combobox",text:_("cell address"),enabled:true,changeOnEnterOnly:true,focusMapOnEnter:true,
children:[{id:"expand",type:"pushbutton",text:"",symbol:"SPIN_DOWN"},{id:"",type:"edit",text:"",
enabled:true},{id:"",type:"borderwindow",text:"",enabled:true,children:[{type:"edit",id:"",text:"",
enabled:true}]}],selectedEntries:[],selectedCount:0}];this.parentContainer.replaceChildren();
this.builder.build(this.parentContainer,data)};AddressInputField.prototype.onJSUpdate=function(e){
var data=e.data;if(data.jsontype!=="addressinputfield")return;data.control.changeOnEnterOnly=true;
data.control.focusMapOnEnter=true;this.builder.updateWidget(this.parentContainer,data.control)};
AddressInputField.prototype.onDocLayerInit=function(){var docType=this.map.getDocType();if(
docType=="spreadsheet"&&this.parentContainer){this.parentContainer.style.setProperty("display",
"table-cell")}};AddressInputField.prototype.onJSAction=function(e){var data=e.data;if(
data.jsontype!=="addressinputfield")return;var innerData=data.data;this.builder.executeAction(
this.parentContainer,innerData)};return AddressInputField}();JSDialog.AddressInputField=function(map
){return new AddressInputField(map)};window.L.Control.Zotero=window.L.Control.extend({_cachedURL:[],
citations:{},itemsPerPage:15,getCachedOrFetch:function(url,retry=true){var that=this;
var cachedData=this._cachedURL[url];if(cachedData){return new Promise(function(resolve){resolve(
cachedData)})}else{return fetch(url).then(function(response){if(!response.ok&&retry
)return that.getCachedOrFetch(url,false);that._cachedURL[url]=response.json();
return that._cachedURL[url]})}},settings:{hasBibliography:"0",bibliographyStyleHasBeenSet:"0",
style:"",locale:"en-US",bib:{uncited:[],omitted:[],custom:[]}},onAdd:function(map){this.map=map;
this.enable=false;this.fetchStyle()},extractItemKeyFromLink:function(link){return link.substring(
link.lastIndexOf("/")+1)},onFieldValue:function(fields){var resetCitations=true;for(
var index=0;index<fields.length;index++){var field=fields[index];var fieldString;if(
this.getFieldType()==="Field")fieldString=field.command;else if(this.getFieldType(
)==="ReferenceMark")fieldString=field.name;else if(this.getFieldType()==="Bookmark"
)fieldString=field.bookmark;if(fieldString.startsWith("ZOTERO_BIBL")||fieldString.startsWith(
"ADDIN ZOTERO_BIBL")){this.setBibCustomProperty(fieldString);continue}if(resetCitations){
resetCitations=false;this.resetCitation()}var values=this.getJSONfromCitationString(fieldString);if(
!values){continue}var that=this;this.citationCluster[values.citationID]=[];
var citationString=app.util.trim(values.properties.plainCitation,this.settings.layout.prefix,
this.settings.layout.suffix);var citations=citationString.split(this.settings.layout.delimiter);
var itemUriList=[];values.citationItems.forEach(function(item,i){var itemUri=item.uris[0];
var citationId=that.extractItemKeyFromLink(itemUri);that.citationCluster[values.citationID].push(
citationId);that.citations[citationId]=app.util.trim(citations[i],that.settings.group.prefix,
that.settings.group.suffix);that.setCitationNumber(that.citations[citationId]);itemUriList.push(
itemUri)});this.showUnsupportedItemWarning(itemUriList)}if(
this.pendingCitationUpdate||this.previousNumberOfFields&&this.previousNumberOfFields!==fields.length
){delete this.pendingCitationUpdate;this.updateCitations(true)}
this.previousNumberOfFields=fields.length},getCitationKeys:function(){return Object.keys(
this.citations)},getCitationKeysForBib:function(){var uncitedKeys=[];var that=this;
this.settings.bib.uncited.forEach(function(item){uncitedKeys.push(that.extractItemKeyFromLink(item[0
]))});var omittedKeys=new Set;this.settings.bib.omitted.forEach(function(item){omittedKeys.add(
that.extractItemKeyFromLink(item[0]))});var allKeys=Object.keys(this.citations).concat(uncitedKeys);
allKeys=allKeys.filter(function(key){return!omittedKeys.has(key)});return allKeys},
askForApiKey:function(){this.map.fire("postMessage",{msgId:"UI_ZoteroKeyMissing"});if(
this.apiKey!=="")this.map.uiManager.showSnackbar(_("Zotero API key is not configured"))},
updateUserID:function(){app.console.debug("Zotero: updateUserID");if(this.apiKey==="")return;
var that=this;fetch("https://api.zotero.org/keys/"+this.apiKey).then(function(response){
return response.json()}).then(function(data){app.console.debug("Zotero: got user data");
that.userID=data.userID;that.enable=!!that.userID;that.updateGroupIdList()},function(){
that.map.uiManager.showSnackbar(_("Zotero API key is incorrect"))})},updateGroupIdList:function(){
this.groupIdList=new Set;var that=this;this.getCachedOrFetch(
"https://api.zotero.org/users/"+this.userID+"/groups?v=3&key="+this.apiKey).then(function(data){for(
var i=0;i<data.length;i++){that.groupIdList.add(data[i].data.id.toString())}},function(){})},
showUnsupportedItemWarning:function(uriList){if(this.showUnsupportedWarning===false||!this.userID
)return;for(var i in uriList){var uriObject=new URL(uriList[i]);
var catagory=uriObject.pathname.startsWith("/groups/")?"/groups/":"/users/";
var id=uriObject.pathname.substring(catagory.length);id=id.substring(0,id.indexOf("/"));if(
!this.groupIdList.has(id)&&id!==this.userID.toString()){this.showUnsupportedWarning=false;
this.map.uiManager.showInfoModal("zoterounreachablewarn",_("Zotero Warning"),_(
"The document contains some citations which may be unreachable through web API. It may cause some problems while editing citations or bibliography."
),null,_("Close"),function(){});return}}},getTopBarJSON:function(){return{
id:"ZoteroDialog-search-container",type:"container",layoutstyle:"end",children:[{
id:"zoterorefresh-buttonbox",type:"buttonbox",leftaligned:"true",children:[{type:"pushbutton",
id:"zoterorefresh",text:_("Refresh")}],vertical:false,layoutstyle:"end"},{type:"edit",
id:"zoterosearch",placeholder:_("Search"),text:""}]}},getMainControlsJSON:function(showCategories){
return{id:"ZoteroDialog-content",type:"container",children:[{id:"ZoteroDialog-main",
type:"container",children:[showCategories?{type:"treelistbox",id:"zoterocategory",enabled:false,
entries:this.getDefaultCategories()}:{},{type:"treelistbox",id:"zoterolist",enabled:false,entries:[{
columns:[{text:_("Loading...")}]}]}]},{id:"ZoteroDialog-buttonbox",type:"buttonbox",children:[{
id:"previous",type:"pushbutton",text:_("Previous"),enabled:false,visible:false},{id:"pagelabel",
type:"fixedtext",text:"1/1",visible:false},{id:"next",type:"pushbutton",text:_("Next"),visible:false
}],vertical:false,layoutstyle:"start"}],vertical:true}},getOptionsJSON:function(){var that=this;
return{id:"ZoteroDialog-locale-container",type:"container",children:[{type:"fixedtext",
id:"zoterolocale-label",text:_("Language:")},{id:"zoterolocale",type:"combobox",entries:Array.from(
Object.keys(this.availableLanguages),function(langCode){return that.availableLanguages[langCode][0]}
),selectedCount:"1",selectedEntries:[Object.keys(this.availableLanguages).indexOf(
this.settings.locale)],enabled:false},{type:"fixedtext",id:"zoterotype-label",text:_("Store as:")},{
id:"zoterotype",type:"combobox",entries:[_("Fields"),_("Bookmarks")],selectedCount:"1",
selectedEntries:[this.getFieldType()==="Bookmark"||this.settings.wrapper==="Endnote"?1:0],
enabled:false}]}},dialogSetup:function(title,showCategories,showOptions){var data={
id:"ZoteroDialog",dialogid:"ZoteroDialog",type:"dialog",text:title,title:title,jsontype:"dialog",
responses:[{id:"ok",response:1},{id:"cancel",response:0}],children:[{id:"ZoteroDialog-mainbox",
type:"container",vertical:true,children:[this.getTopBarJSON(),this.getMainControlsJSON(
showCategories),showOptions?this.getOptionsJSON():{},{id:"ZoteroDialog-buttonbox",type:"buttonbox",
children:[{id:"cancel",type:"pushbutton",text:_("Cancel")},{id:"ok",type:"pushbutton",text:_("OK"),
enabled:false}],vertical:false,layoutstyle:"end"}]}]};this.items=[];
this.categories=this.getDefaultCategories();this.groups=[];this.collections=[];
var dialogBuildEvent={data:data,callback:this._onAction.bind(this)};this.map.fire(
window.mode.isMobile()?"mobilewizard":"jsdialog",dialogBuildEvent);return this},
updateControl:function(controlJSON){this.map.fire("jsdialogupdate",{data:{jsontype:"dialog",
action:"update",id:"ZoteroDialog",control:controlJSON},callback:this._onAction.bind(this)})},
enableDialogOKButton:function(){this.updateControl({id:"ok",type:"pushbutton",text:_("OK"),
has_default:true})},enableDialogLanguageCombobox:function(locale){var that=this;this.updateControl({
id:"zoterolocale",type:"combobox",entries:Array.from(Object.keys(this.availableLanguages),function(
langCode){return that.availableLanguages[langCode][0]}),selectedCount:"1",selectedEntries:[
Object.keys(this.availableLanguages).indexOf(locale)]})},enableDialogFieldTypeCombobox:function(
citationFormat){var entries=[];if(citationFormat==="note"){entries=[_("Footnotes"),_("Endnotes")]
}else{entries=[_("Fields"),_("Bookmarks")]}this.updateControl({id:"zoterotype",type:"combobox",
entries:entries,selectedCount:"1",selectedEntries:[this.getFieldType(
)==="Bookmark"||this.settings.wrapper==="Endnote"?1:0],enabled:!(this.citations&&Object.keys(
this.citations).length)})},enableDisableNextPrevious:function(hide){this.updateControl({
id:"previous",type:"pushbutton",text:_("Previous"),enabled:this._currentPage>0,
visible:hide?false:true});this.updateControl({id:"pagelabel",type:"fixedtext",
text:this._currentPage+1+"/"+this.totalPages,visible:hide?false:true});this.updateControl({
id:"next",type:"pushbutton",text:_("Next"),enabled:this._currentPage<this.totalPages-1,
visible:hide?false:true})},updateList:function(headerArray,failText){if(this.items.length!==0){
return{data:{jsontype:"dialog",action:"update",id:"ZoteroDialog",control:{id:"zoterolist",
type:"treelistbox",headers:headerArray.map(function(item){return{text:item}}),entries:this.items}},
callback:this._onAction.bind(this)}}else{return{data:{jsontype:"dialog",action:"update",
id:"ZoteroDialog",control:{id:"zoterolist",type:"treelistbox",entries:[{columns:[{text:failText}]}]}
}}}},getZoteroItemQuery:function(limit,start){
var result="?v=3&key="+this.apiKey+"&include=data,citation,csljson&style="+this.settings.style+"&locale="+this.settings.locale
if(limit)result+="&limit="+limit;if(start)result+="&start="+start;return result},
_getDefaultSubCollections:function(){return[{columns:[{text:_("My Publications")}],
row:"https://api.zotero.org/users/"+this.userID+"/publications/items/top"+this.getZoteroItemQuery()}
]},getDefaultCategories:function(){return[{columns:[{text:_("My Library")}],
row:"https://api.zotero.org/users/"+this.userID+"/items/top"+this.getZoteroItemQuery(
this.itemsPerPage,0),children:this._getDefaultSubCollections()},{columns:[{text:_("Group Libraries")
}]}]},updateCategories:function(){this.updateControl({id:"zoterocategory",type:"treelistbox",
entries:this.categories})},resetCitation:function(){this.citationCluster={};this.citations={};
delete this.settings.citationNumber;if(this.getFieldType()==="Bookmark")this.bookmarksOrder=[]},
setCitationNumber:function(number){if(this.settings.citationFormat!=="numeric")return;if(
!this.settings.citationNumber)this.settings.citationNumber=1;
this.settings.citationNumber=this.settings.citationNumber<=parseInt(number)?parseInt(number
)+1:this.settings.citationNumber},getCitationText:function(citationId,text){if(
this.citations&&this.citations[citationId])return this.citations[citationId];if(
this.settings.citationFormat==="numeric"){if(!this.settings.citationNumber
)this.settings.citationNumber=1;this.citations[citationId]=this.settings.citationNumber++}else{
this.citations[citationId]=app.util.trim(text,this.settings.layout.prefix,
this.settings.layout.suffix)}return this.settings.group.prefix+this.citations[citationId
]+this.settings.group.suffix},handleCitationText:function(citationItems){var citationString="";
var citationNode=(new DOMParser).parseFromString(citationItems[0].citation,"text/html").body;
var that=this;citationItems.forEach(function(item){var itemHTML=(new DOMParser).parseFromString(
item.citation,"text/html").body;var innerMostNode=itemHTML.querySelector("*:last-child");
var keys=item["key"]?[item["key"]]:Object.keys(item["citationItems"]).map(function(citationitem){
return that.extractItemKeyFromLink(item["citationItems"][citationitem].id)});keys.forEach(function(
key){citationString+=innerMostNode?that.getCitationText(key,innerMostNode.textContent
):that.getCitationText(key,item.citation.toString());citationString+=that.settings.layout.delimiter}
)});citationString=this.settings.layout.prefix+app.util.trimEnd(citationString,
this.settings.layout.delimiter)+this.settings.layout.suffix;
var innerText=citationNode.querySelector("*:last-child");if(!innerText
)citationNode.textContent=citationString;else innerText.textContent=citationString;
return citationNode},getJSONfromCitationString:function(string){if(!string)return{};
var firstBraceIndex=string.indexOf("{");var lastBraceIndex=string.lastIndexOf("}");if(
firstBraceIndex<0||lastBraceIndex>string.length||lastBraceIndex<0)return{};var values=JSON.parse(
string.substring(firstBraceIndex,lastBraceIndex+1));if(values["properties"]["formattedCitation"]
)values.citation=values["properties"]["formattedCitation"];return values},
getCitationJSONString:function(items){var resultJSON={};resultJSON["citationID"
]=app.util.randomString(10);var citationNode=this.handleCitationText(items);var properties={
formattedCitation:citationNode.innerHTML,plainCitation:citationNode.textContent,noteIndex:"0"};
resultJSON["properties"]=properties;resultJSON["citationItems"]=[];items.forEach(function(item){if(
item["citationItems"]){resultJSON["citationItems"]=resultJSON["citationItems"].concat(item[
"citationItems"]);return}var citationItems={id:item["csljson"].id,uris:Object.keys(item["links"]
).map(function(link){return item["links"][link]["href"]}),itemData:item["csljson"]};resultJSON[
"citationItems"].push(citationItems)});resultJSON["schema"
]="https://raw.githubusercontent.com/citation-style-language/schema/master/schemas/input/csl-citation.json"
return{jsonString:JSON.stringify(resultJSON),citationString:properties.formattedCitation}},
fillCategories:function(){this.categories=this.getDefaultCategories().slice();this.categories[0
].children=this.categories[0].children.concat(this.collections.slice());this.categories[1
].children=this.groups.slice()},createEntry:function(index,columns,entryData,hasIcon){if(hasIcon){
var type=entryData.itemType;type=type.toUpperCase()[0]+type.substr(1);var icon="zotero"+type;
var firstColumn=[{collapsed:icon,expanded:icon}]}else{firstColumn=[]}this.items.push(Object.assign({
columns:firstColumn.concat(columns.map(function(item){return{text:item}})),row:index,
state:this.dialogType==="itemlist"?false:undefined},entryData))},fillItems:function(items){
var index=0;for(var iterator=0;iterator<items.length;++iterator){if(items[iterator
].data.itemType==="note")continue;var creatorArray=[];for(var creator=0;items[iterator
].data.creators&&creator<items[iterator].data.creators.length;++creator){creatorArray.push(items[
iterator].data.creators[creator].name?items[iterator].data.creators[creator].name:items[iterator
].data.creators[creator].firstName+" "+items[iterator].data.creators[creator].lastName)}
var creatorString=creatorArray.join(", ");this.createEntry(index++,[items[iterator].csljson.title,
creatorString,items[iterator].data.date?items[iterator].data.date:items[iterator].data.dateDecided],
{type:"item",itemType:items[iterator].data.itemType,item:items[iterator]},true)}},
fillStyles:function(styles){var styleToSelect=this.settings.style;if(this.settings.style===""
)styleToSelect=window.prefs.get("Zotero_LastUsedStyle","");for(
var iterator=0;iterator<styles.length;++iterator){this.createEntry(iterator,[styles[iterator].title]
,Object.assign({name:styles[iterator].name,type:"style"},styleToSelect===styles[iterator].name?{
selected:true}:null))}},fillNotes:function(items,notesCount){var index=notesCount;for(
var iterator=0;iterator<items.length;++iterator){if(items[iterator].data.itemType!=="note")continue;
var dummyNode=window.L.DomUtil.create("div");dummyNode.innerHTML=items[iterator].data.note;
var note=dummyNode.innerText.replaceAll("\n"," ");this.createEntry(index++,[note],{type:"note",
itemType:items[iterator].data.itemType,item:items[iterator]},true)}return index},
showItemList:function(){if(!this.enable){this.askForApiKey();return}if(!this.settings.style){
this.pendingAction=this.showItemList;this.showStyleList();return}var that=this;
this.dialogType="itemlist";that.dialogSetup(_("My Library"),true);that.updateCategories();
this.getCachedOrFetch("https://api.zotero.org/users/"+this.userID+"/groups?v=3&key="+this.apiKey
).then(function(data){for(var i=0;i<data.length;i++){that.groups.push({columns:[{text:data[i
].data.name}],id:data[i].data.id,row:data[i].links.self.href+"/items/top"+that.getZoteroItemQuery()}
);that.fillCategories();that.updateCategories()}},function(){that.map.uiManager.showSnackbar(_(
"Failed to load groups"))});this.getCachedOrFetch(
"https://api.zotero.org/users/"+this.userID+"/collections"+this.getZoteroItemQuery()).then(function(
data){for(var i=0;i<data.length;i++){that.collections.push({columns:[{text:data[i].data.name}],
id:data[i].data.key,row:data[i].links.self.href+"/items/top"+that.getZoteroItemQuery(),children:[{
text:"<dummy>"}],ondemand:true});that.fillCategories();that.updateCategories()}},function(){
that.map.uiManager.showSnackbar(_("Failed to load collections"))});this.totalItems=-1;
this.totalPages=-1;this._currentPage=0;fetch(
"https://api.zotero.org/users/"+this.userID+"/items/top?v=3&key="+this.apiKey+"&limit=1").then(
function(response){that.map.uiManager.showProgressBar(_("Loading references"),undefined,undefined,
1e4);that.showItemsForUrl(
"https://api.zotero.org/users/"+that.userID+"/items/top"+that.getZoteroItemQuery(that.itemsPerPage,0
),true);that.totalItems=parseInt(response.headers.get("Total-Results"));that.totalPages=Math.ceil(
that.totalItems/that.itemsPerPage);that._currentPage=0;that.enableDisableNextPrevious();
that.asyncItemLoading()})},asyncItemLoading:function(){var that=this;var pagesLoaded=1;for(
var i=this.itemsPerPage;i<that.totalItems;i+=this.itemsPerPage){that.getCachedOrFetch(
"https://api.zotero.org/users/"+that.userID+"/items/top"+that.getZoteroItemQuery(that.itemsPerPage,i
),true).then(function(){++pagesLoaded;var loadPct=pagesLoaded/that.totalPages*100;
that.map.uiManager.setSnackbarProgress(loadPct);if(pagesLoaded===that.totalPages
)that.map.uiManager.closeSnackbar()})}},showStyleList:function(){if(!this.enable){this.askForApiKey(
);return}var that=this;this.dialogType="stylelist";this.dialogSetup(_("Citation Style"),false,true);
this.getCachedOrFetch("https://www.zotero.org/styles-files/styles.json").then(function(data){
that.fillStyles(data);var dialogUpdateEvent=that.updateList([_("Styles")],_(
"An error occurred while fetching style list"));if(window.mode.isMobile()
)window.mobileDialogId=dialogUpdateEvent.data.id;that.map.fire("jsdialogupdate",dialogUpdateEvent);
var styleToBeSelected=that.settings.style&&that.settings.style!==""?that.settings:{
name:window.prefs.get("Zotero_LastUsedStyle","")};if(styleToBeSelected!==""
)that.checkStyleTypeAndEnableOK(styleToBeSelected)},function(){that.map.uiManager.showSnackbar(_(
"Failed to load styles"))})},fetchStyle:function(){this.fetchCustomProperty("ZOTERO_PREF_")},
fetchCustomProperty:function(prefix){app.socket.sendMessage(
"commandvalues command=.uno:SetDocumentProperties?namePrefix="+prefix)},
setFetchedCitationFormat:function(style){if(!style)style=this.settings.style;var that=this;fetch(
"https://www.zotero.org/styles/"+style).then(function(response){return response.text()}).then(
function(html){var csl=(new DOMParser).parseFromString(html,"text/xml");
var categories=csl.getElementsByTagName("category");for(var i=0;i<categories.length;i++){if(
categories[i].getAttribute("citation-format")){that.settings.citationFormat=categories[i
].getAttribute("citation-format");break}}var citation=csl.getElementsByTagName("citation")[0];if(
citation){that.setCitationLayout(citation);that.updateCitations(true);if(
that.settings.bibliographyStyleHasBeenSet==="1"){that.updateBibList();that.handleInsertBibliography(
)}}else{var link=csl.getElementsByTagName("link");for(var i=0;i<link.length;i++){if(link[i
].getAttribute("rel")==="independent-parent"){that.setFetchedCitationFormat(
that.extractItemKeyFromLink(link[i].getAttribute("href")));break}}}})},
makeLanguageAvailable:function(locale){var ret=null;var languages=Object.keys(this.languageNames
).filter(function(value){return value.indexOf(locale)>=0});for(var l in languages){
var language=languages[l];ret=language;this.availableLanguages[language]=this.languageNames[language
]}return ret},checkStyleTypeAndEnableOK:function(selectedStyle){
var style=selectedStyle.name?selectedStyle.name:selectedStyle.style;if(!style)return;var that=this;
fetch("https://www.zotero.org/styles/"+style).then(function(response){return response.text()}).then(
function(html){var csl=(new DOMParser).parseFromString(html,"text/xml");that.availableLanguages={};
var locales=csl.getElementsByTagName("locale");for(var i=0;i<locales.length;i++){if(locales[i
].getAttribute("xml:lang")){var code=locales[i].getAttribute("xml:lang");that.makeLanguageAvailable(
code)}}var style=csl.getElementsByTagName("style");if(style.length){var defaultLocale=style[0
].getAttribute("default-locale");if(defaultLocale&&defaultLocale!==""
)defaultLocale=that.makeLanguageAvailable(defaultLocale)}var availableLocale=Object.keys(
that.availableLanguages).indexOf(that.settings.locale)>=0;that.enableDialogLanguageCombobox(
availableLocale?that.settings.locale:defaultLocale);var categories=csl.getElementsByTagName(
"category");for(var i=0;i<categories.length;i++){if(categories[i].getAttribute("citation-format")){
selectedStyle.citationFormat=categories[i].getAttribute("citation-format");break}}
that.enableDialogFieldTypeCombobox(selectedStyle.citationFormat);that.enableDialogOKButton()})},
setCitationLayout:function(ciatationNode){var layout=ciatationNode.getElementsByTagName("layout")[0]
this.settings.layout={};this.settings.layout["prefix"]=layout&&layout.getAttribute("prefix"
)?layout.getAttribute("prefix"):"";this.settings.layout["suffix"]=layout&&layout.getAttribute(
"suffix")?layout.getAttribute("suffix"):"";this.settings.layout["delimiter"
]=layout&&layout.getAttribute("delimiter")?layout.getAttribute("delimiter"):"";
var group=layout.getElementsByTagName("group")[0];this.settings.group={};this.settings.group[
"prefix"]=group&&group.getAttribute("prefix")?group.getAttribute("prefix"):"";this.settings.group[
"suffix"]=group&&group.getAttribute("suffix")?group.getAttribute("suffix"):"";this.settings.group[
"delimiter"]=group&&group.getAttribute("delimiter")?group.getAttribute("delimiter"):""},
setFetchedStyle:function(valueString){var value=(new DOMParser).parseFromString(valueString,
"text/xml");var styleNode=value.getElementsByTagName("style")[0];
this.settings.style=this.extractItemKeyFromLink(styleNode.id);var locale=styleNode.getAttribute(
"locale");if(locale)this.settings.locale=locale;var fieldTypeNode=value.getElementsByName(
"fieldType");if(fieldTypeNode&&fieldTypeNode[0])this.settings.fieldType=fieldTypeNode[0
].getAttribute("value");else this.settings.fieldType=this.getFieldType();
var noteTypeNode=value.getElementsByName("noteType");if(noteTypeNode&&noteTypeNode[0]
)this.settings.wrapper=noteTypeNode[0].getAttribute("value")==="1"?"Footnote":"Endnote";
this.settings.hasBibliography=styleNode.getAttribute("hasBibliography");
this.settings.bibliographyStyleHasBeenSet=styleNode.getAttribute("bibliographyStyleHasBeenSet");
this.setFetchedCitationFormat();window.prefs.set("Zotero_LastUsedStyle",this.settings.style)},
getStyleXml:function(){var xmlDoc=(new DOMParser).parseFromString("<data></data>","text/xml");
var dataNode=xmlDoc.getElementsByTagName("data")[0];dataNode.setAttribute("data-version","3");
var sessionNode=xmlDoc.createElement("session");sessionNode.setAttribute("id",app.util.randomString(
8));dataNode.appendChild(sessionNode);var styleNode=xmlDoc.createElement("style");
styleNode.setAttribute("id","http://www.zotero.org/styles/"+this.settings.style);if(
this.selectedCitationLangCode)this.settings.locale=this.selectedCitationLangCode;
styleNode.setAttribute("locale",this.settings.locale);styleNode.setAttribute("hasBibliography",
this.settings.hasBibliography);styleNode.setAttribute("bibliographyStyleHasBeenSet",
this.settings.bibliographyStyleHasBeenSet);dataNode.appendChild(styleNode);
var prefsNode=xmlDoc.createElement("prefs");var prefFieldNode=xmlDoc.createElement("pref");
prefFieldNode.setAttribute("name","fieldType");prefFieldNode.setAttribute("value",this.getFieldType(
));prefsNode.appendChild(prefFieldNode);if(this.settings.wrapper){
var prefNotedNode=xmlDoc.createElement("pref");prefNotedNode.setAttribute("name","noteType");if(
this.settings.wrapper==="Footnote")prefNotedNode.setAttribute("value","1"
);else prefNotedNode.setAttribute("value","2");prefsNode.appendChild(prefNotedNode)}
dataNode.appendChild(prefsNode);return dataNode},setStyle:function(style){
this.settings.style=style.name;this.settings.hasBibliography="1";var dataNode=this.getStyleXml();
var valueString=dataNode.outerHTML;this.setCustomProperty("ZOTERO_PREF_",valueString);
this.setFetchedCitationFormat();window.prefs.set("Zotero_LastUsedStyle",this.settings.style)},
markBibliographyStyleHasBeenSet:function(unset){if(unset
)this.settings.bibliographyStyleHasBeenSet="0";else this.settings.bibliographyStyleHasBeenSet="1";
var dataNode=this.getStyleXml();var valueString=dataNode.outerHTML;this.setCustomProperty(
"ZOTERO_PREF_",valueString)},getFieldType:function(){if(this.settings.fieldType
)return this.settings.fieldType;var fileExtension=this.map["wopi"].BaseFileName.substring(this.map[
"wopi"].BaseFileName.lastIndexOf(".")+1);this.settings.fieldType=fileExtension.startsWith("doc"
)?"Field":"ReferenceMark";return this.settings.fieldType},setFieldType:function(field,format){
this.settings.wrapper="";if(field==="Bookmarks")this.settings.fieldType="Bookmark";else{
var fileExtension=this.map["wopi"].BaseFileName.substring(this.map["wopi"].BaseFileName.lastIndexOf(
".")+1);this.settings.fieldType=fileExtension.startsWith("doc")?"Field":"ReferenceMark";if(
format==="note"){this.settings.wrapper="Footnote";if(field==="Endnotes"
)this.settings.wrapper="Endnote"}}},_findEntryWithUrlImpl:function(entry,url){if(entry.row===url
)return entry;for(var i in entry.children){var found=this._findEntryWithUrlImpl(entry.children[i],
url);if(found)return found}return null},_findEntryWithUrl:function(data,url){for(
var i in data.entries){var found=this._findEntryWithUrlImpl(data.entries[i],url);if(found
)return found}return null},_fetchCollectionAndPushTo:function(collectionId,targetCollection){
var that=this;this.getCachedOrFetch(
"https://api.zotero.org/users/"+this.userID+"/collections/"+collectionId+"/collections/?v=3&key="+this.apiKey
).then(function(data){for(var i=0;i<data.length;i++){targetCollection.children.push({columns:[{
text:data[i].data.name}],id:data[i].data.key,row:data[i
].links.self.href+"/items/top"+that.getZoteroItemQuery(),children:[{text:"<dummy>"}],ondemand:true})
}if(!data.length)targetCollection.children=undefined;that.fillCategories();that.updateCategories()},
function(){that.map.uiManager.showSnackbar(_("Failed to load collections"))})},
_expandCollection:function(treeViewData,row){var entry=this._findEntryWithUrl(treeViewData,row);
var searchArray={entries:this.collections};var targetEntry=this._findEntryWithUrl(searchArray,row);
if(entry&&targetEntry){if(
targetEntry.children&&targetEntry.children.length===1&&targetEntry.children[0].text==="<dummy>"){
targetEntry.children=[];targetEntry.ondemand=undefined;this.fillCategories();this.updateCategories()
this._fetchCollectionAndPushTo(entry.id,targetEntry)}}},showItemsForUrl:function(url,checkState){
var that=this;that.items=[];this.getCachedOrFetch(url).then(function(data){that.fillItems(data);
var dialogUpdateEvent=that.updateList([_("Title"),_("Creator(s)"),_("Date")],_(
"Your library is empty"));that.map.fire("jsdialogupdate",dialogUpdateEvent);if(window.mode.isMobile(
))window.mobileDialogId=dialogUpdateEvent.data.id;if(checkState){that.pendingCitationUpdate=false;
that.pendingItemListing=true;that.fetchCitationUnderCursor()}that.enableDisableNextPrevious(
!url.includes("limit="))},function(){that.map.uiManager.showSnackbar(_("Failed to load items"))})},
_onAction:function(element,action,data,index){if(element==="dialog"&&action==="close")return;if(
element==="treeview"){if(action=="keydown")return;if(data.id==="zoterocategory"){var url=index;if(
!url)return;if(action==="expand")this._expandCollection(data,index);this.showItemsForUrl(url);return
}else{if(this.dialogType==="itemlist"){if(action!=="change")return;
this.selected=data.entries.filter(function(e){return e.state===true});this.enableDialogOKButton()
}else{this.selected=data.entries[parseInt(index)];if(this.dialogType==="stylelist"){
this.checkStyleTypeAndEnableOK(this.selected)}else if(this.dialogType==="insertnote"){
this.enableDialogOKButton()}}return}}if(element==="edit"&&data.id==="zoterosearch"){
const query=data.querySelector("input").value;if(query)document.getElementById("zoterolist"
).filterEntries(query);return}if(data.id=="ok"){if(!this.selected||this.selected.type==="style"){
var citationFormat=this.selected?this.selected.citationFormat:this.settings.citationFormat;
var parameters=this.selected?this.selected:{name:window.prefs.get("Zotero_LastUsedStyle",""),
type:"style"};var selectedFieldType=this.selectedFieldType;this.closeZoteroDialog();
this.map.uiManager.showConfirmModal("zoterofieldtypewarn",_("Citation warning"),_(
"Once citations are entered their storage and display type can not be changed."),_("Confirm"),
function(){this.setFieldType(selectedFieldType,citationFormat);this._onOk(parameters);
this.dispatchPendingAction()}.bind(this));return}this._onOk(this.selected);
this.dispatchPendingAction()}if(element==="pushbutton"&&data.id==="zoterorefresh"){this._cachedURL=[
];if(this.dialogType==="itemlist")this.showItemList();else if(this.dialogType==="insertnote"
)this.handleInsertNote();else this.showStyleList();return}if(element==="combobox"){if(
data.id==="zoterolocale"){this.selectedCitationLangCode=Object.keys(this.availableLanguages)[
parseInt(index)];if(this.settings.style)this.enableDialogOKButton()}else if(data.id==="zoterotype"){
this.selectedFieldType=index.substring(index.indexOf(";")+1)}return}if(data.id==="next"){
this.showItemsForUrl(
"https://api.zotero.org/users/"+this.userID+"/items/top"+this.getZoteroItemQuery(this.itemsPerPage,(
this._currentPage+1)*this.itemsPerPage),true);this._currentPage++;this.enableDisableNextPrevious();
return}if(data.id==="previous"){this.showItemsForUrl(
"https://api.zotero.org/users/"+this.userID+"/items/top"+this.getZoteroItemQuery(this.itemsPerPage,(
this._currentPage-1)*this.itemsPerPage),true);this._currentPage--;this.enableDisableNextPrevious();
return}this.closeZoteroDialog();this._currentPage=0},dispatchPendingAction:function(){if(
this.pendingAction){this.pendingAction();delete this.pendingAction}},closeZoteroDialog:function(){
var closeEvent={data:{action:"close",id:"ZoteroDialog"}};this.map.fire(window.mode.isMobile(
)?"closemobilewizard":"jsdialog",closeEvent);delete this.selectedCitationLangCode;
delete this.selected;delete this.selectedFieldType},_onOk:function(selected){if(
this.dialogType==="itemlist"){var citationsToInsert=[];for(var i in selected){
citationsToInsert=citationsToInsert.concat([selected[i].item])}this.insertCitation(citationsToInsert
);this.pendingCitationUpdate=true}else if(selected.type==="style"){this.setStyle(selected)}else if(
selected.type==="note"){if(this.map._clip){this.map._clip.dataTransferToDocumentFallback(null,
selected.item.data.note)}else console.warn("zotero: cannot paste a note")}},handleItemList:function(
){this.showItemList()},handleStyleList:function(){this.showStyleList()},handleInsertNote:function(){
if(!this.enable){this.askForApiKey();return}if(!this.settings.style){
this.pendingAction=this.handleInsertNote;this.showStyleList();return}var that=this;
this.dialogType="insertnote";var notesCount=0;this.dialogSetup(_("Add Note"),false);
var updateDialog=function(){var dialogUpdateEvent=that.updateList([_("Notes")],_(
"An error occurred while fetching notes"));if(window.mode.isMobile()
)window.mobileDialogId=dialogUpdateEvent.data.id;that.map.fire("jsdialogupdate",dialogUpdateEvent)};
this.getCachedOrFetch("https://api.zotero.org/users/"+this.userID+"/items"+this.getZoteroItemQuery()
).then(function(data){notesCount+=that.fillNotes(data,notesCount);updateDialog();
that.getCachedOrFetch("https://api.zotero.org/users/"+that.userID+"/groups?v=3&key="+that.apiKey
).then(function(data){for(var i=0;i<data.length;i++){var groupUrl=data[i
].links.self.href+"/items"+that.getZoteroItemQuery();that.getCachedOrFetch(groupUrl).then(function(
data){notesCount+=that.fillNotes(data,notesCount);updateDialog()})}})})},
insertBibliography:function(){if(!this.enable){this.askForApiKey();return}
this.handleInsertBibliography()},handleInsertBibliography:function(){if(!this.settings.style){
this.pendingAction=this.handleInsertBibliography;this.showStyleList();return}if(!(
this.citations&&Object.keys(this.citations)))return;if(this.getCitationKeys().length===0)return;
var that=this;if(this.settings.citationFormat==="numeric"){this.getCachedOrFetch(
"https://api.zotero.org/users/"+this.userID+"/items?include=bib&itemKey="+this.getCitationKeysForBib(
).join(",")+"&v=3&key="+this.apiKey+"&style="+this.settings.style+"&locale="+this.settings.locale
).then(function(data){var bibList=data.reduce(function(map,item){map[item.key]=item.bib;return map},
{});var html="";that.getCitationKeysForBib().forEach(function(key){var bib=(new DOMParser
).parseFromString(bibList[key],"text/html").body;var numberNode=bib.getElementsByClassName(
"csl-entry")[0].firstElementChild;var number=parseInt(numberNode.textContent.substring(
numberNode.textContent.search(/[0-9]/))).toString();
numberNode.textContent=numberNode.textContent.replace(number,that.citations[key]);
html+=bib.innerHTML});that.sendInsertBibCommand(html);that.markBibliographyStyleHasBeenSet()});
return}fetch(
"https://api.zotero.org/users/"+this.userID+"/items?format=bib&itemKey="+this.getCitationKeys(
).join(",")+"&v=3&key="+this.apiKey+"&style="+this.settings.style+"&locale="+this.settings.locale
).then(function(response){return response.text()}).then(function(html){that.sendInsertBibCommand(
html);that.markBibliographyStyleHasBeenSet()})},updateFieldsList:function(){if(this.getFieldType(
)==="Field")app.socket.sendMessage(
"commandvalues command=.uno:TextFormFields?type=vnd.oasis.opendocument.field.UNHANDLED&commandPrefix=ADDIN%20ZOTERO_ITEM%20CSL_CITATION"
);else if(this.getFieldType()==="ReferenceMark")app.socket.sendMessage(
"commandvalues command=.uno:Fields?typeName=SetRef&namePrefix=ZOTERO_ITEM%20CSL_CITATION");else if(
this.getFieldType()==="Bookmark")app.socket.sendMessage(
"commandvalues command=.uno:Bookmarks?namePrefix=ZOTERO_BREF_")},updateBibList:function(){if(
this.getFieldType()==="Field")app.socket.sendMessage(
"commandvalues command=.uno:TextFormFields?type=vnd.oasis.opendocument.field.UNHANDLED&commandPrefix=ADDIN%20ZOTERO_BIBL"
);else if(this.getFieldType()==="ReferenceMark")app.socket.sendMessage(
"commandvalues command=.uno:Sections?typeName=SetRef&namePrefix=ZOTERO_BIBL");else if(
this.getFieldType()==="Bookmark")app.socket.sendMessage(
"commandvalues command=.uno:SetDocumentProperties?namePrefix="+this.bibBookmarkName)},
updateCitations:function(showSnackbar){if(!this.citations){this.updateFieldsList();return}
var that=this;var citationKeys=this.getCitationKeys();
var citationCluster=this.citationCluster?this.citationCluster:[];this.getCachedOrFetch(
"https://api.zotero.org/users/"+this.userID+"/items/top"+this.getZoteroItemQuery(
)+"&itemKey="+citationKeys.join(",")).then(function(data){that.resetCitation();
var dataMap=data.reduce(function(map,item){map[item.key]=item;return map},{});var newValues=[];
Object.keys(citationCluster).forEach(function(clusterKey){var itemList=citationCluster[clusterKey
].reduce(function(list,item){list.push(dataMap[item]);return list},[]);
var citationData=that.getCitationJSONString(itemList);var updateParameter=that.getFieldParameters(
citationData.jsonString,citationData.citationString);newValues.push(that.getFieldType(
)!=="Bookmark"?updateParameter:{parameter:updateParameter,cslJSON:citationData.jsonString})});
that.sendUpdateCitationCommand(newValues);if(showSnackbar)that.map.uiManager.showSnackbar(_(
"Updated citations"))},function(){that.map.uiManager.showSnackbar(_("Citations update failed"))});
if(showSnackbar)this.map.uiManager.showSnackbar(_("Updating citations"))},
handleUnlinkCitations:function(){var parametes={};var command="";if(this.getFieldType()==="Field"){
parametes={FieldType:{type:"string",value:"vnd.oasis.opendocument.field.UNHANDLED"},
FieldCommandPrefix:{type:"string",value:"ADDIN ZOTERO_"}};command=".uno:DeleteTextFormFields"
}else if(this.getFieldType()==="Bookmark"){parametes={BookmarkNamePrefix:{type:"string",
value:"ZOTERO_BREF_"}};command=".uno:DeleteBookmarks";this.setCustomProperty("ZOTERO_BREF_","")
}else if(this.getFieldType()==="ReferenceMark"){parametes={TypeName:{type:"string",value:"SetRef"},
NamePrefix:{type:"string",value:"ZOTERO_ITEM CSL_CITATION"}};command=".uno:DeleteFields";
var sectionUnlinkParameter={SectionNamePrefix:{type:"string",value:"ZOTERO_BIBL"}};
this.map.sendUnoCommand(".uno:DeleteSections",sectionUnlinkParameter,true)}this.map.sendUnoCommand(
command,parametes,true);this.resetCitation();this.map.uiManager.showSnackbar("Unlinked citations")},
unlinkCitations:function(){this.map.uiManager.showInfoModal("zoterounlinkwarn",_("Unlink Citations")
,_(
"Unlinking citations will prevent F7 Office from updating citations and bibliography in this document."
),null,_("Confirm"),this.handleUnlinkCitations.bind(this))},handleRefreshCitationsAndBib:function(
showSnackbar){this._cachedURL=[];this.updateCitations(showSnackbar);if(
this.settings.bibliographyStyleHasBeenSet==="1")this.handleInsertBibliography()},
refreshCitationsAndBib:function(){if(!this.enable){this.askForApiKey();return}
this.handleRefreshCitationsAndBib(true)},handleInsertCitation:function(){if(
!this.fetchCitationUnderCursor())this.insertCitation({})},fetchCitationUnderCursor:function(){if(
this.getFieldType()==="Field")app.socket.sendMessage(
"commandvalues command=.uno:TextFormField?type=vnd.oasis.opendocument.field.UNHANDLED&commandPrefix=ADDIN%20ZOTERO_ITEM"
);else if(this.getFieldType()==="ReferenceMark")app.socket.sendMessage(
"commandvalues command=.uno:Field?typeName=SetRef&namePrefix=ZOTERO_ITEM%20CSL_CITATION");else if(
this.getFieldType()==="Bookmark")app.socket.sendMessage(
"commandvalues command=.uno:Bookmark?namePrefix=ZOTERO_BREF_");else return false;return true},
handleFieldUnderCursor:function(field){if(!this.pendingItemListing)return;var cslString;if(
this.getFieldType()==="Field"){cslString=field.command}else if(this.getFieldType()=="Bookmark"){
cslString=field.bookmark}else if(this.getFieldType()==="ReferenceMark"){cslString=field.name}
var existingCitationUnderCursor=this.getJSONfromCitationString(cslString);
this.insertNewCitation=!Object.keys(existingCitationUnderCursor).length;
this.pendingItemListing=false;for(var i in existingCitationUnderCursor.citationItems){
var existingItem=existingCitationUnderCursor.citationItems[i];var itemUri=existingItem.uris[0];
var key=this.extractItemKeyFromLink(itemUri);for(var j in this.items){var listItem=this.items[j];if(
listItem.item.key===key){listItem.state=true;break}}}var dialogUpdateEvent=this.updateList([_(
"Title"),_("Creator(s)"),_("Date")],_("Your library is empty"));this.map.fire("jsdialogupdate",
dialogUpdateEvent)},insertCitation:function(citationsToInsert){if(!(
citationsToInsert&&citationsToInsert.length))return;var command="";if(this.getFieldType()==="Field"
){command=this.insertNewCitation?".uno:TextFormField":".uno:UpdateTextFormField"}else if(
this.getFieldType()=="Bookmark"){
command=this.insertNewCitation?".uno:InsertBookmark":".uno:UpdateBookmark"}else if(
this.getFieldType()==="ReferenceMark"){
command=this.insertNewCitation?".uno:InsertField":".uno:UpdateField"}
var citationData=this.getCitationJSONString(citationsToInsert);
var parameters=this.insertNewCitation?this.getFieldParameters(citationData.jsonString,
citationData.citationString):this.getFieldUpdateParameters(citationData.jsonString,
citationData.citationString);if(this.getFieldType()=="Bookmark"){
var prefix=this.insertNewCitation?parameters["Bookmark"].value:parameters["Bookmark"]["value"][
"Bookmark"].value;this.setCustomProperty(prefix+"_",
"ZOTERO_ITEM CSL_CITATION "+citationData.jsonString)}delete this.insertNewCitation;
this.map.sendUnoCommand(command,parameters,true);this.updateFieldsList()},
sendUpdateCitationCommand:function(newValueArray){var updatedCitations;if(this.getFieldType(
)==="Field"){updatedCitations={FieldType:{type:"string",
value:"vnd.oasis.opendocument.field.UNHANDLED"},FieldCommandPrefix:{type:"string",
value:"ADDIN ZOTERO_ITEM CSL_CITATION"},Fields:{type:"[][]com.sun.star.beans.PropertyValue",
value:newValueArray}};this.map.sendUnoCommand(".uno:TextFormFields",updatedCitations,true)}else if(
this.getFieldType()==="ReferenceMark"){updatedCitations={TypeName:{type:"string",value:"SetRef"},
NamePrefix:{type:"string",value:"ZOTERO_ITEM CSL_CITATION"},Fields:{
type:"[][]com.sun.star.beans.PropertyValue",value:newValueArray},NeverExpand:{type:"boolean",
value:true}};this.map.sendUnoCommand(".uno:UpdateFields",updatedCitations,true)}else if(
this.getFieldType()==="Bookmark"){updatedCitations={BookmarkNamePrefix:{type:"string",
value:"ZOTERO_BREF_"},Bookmarks:{type:"[][]com.sun.star.beans.PropertyValue",
value:newValueArray.map(function(value){return value.parameter})}};var that=this;
newValueArray.forEach(function(value){that.setCustomProperty(value.parameter["Bookmark"].value+"_",
"ZOTERO_ITEM CSL_CITATION "+value.cslJSON)});this.map.sendUnoCommand(".uno:UpdateBookmarks",
updatedCitations,true)}this.updateFieldsList()},getFieldParameters:function(cslJSON,citationString){
var field={};if(this.getFieldType()==="Field"){field["FieldType"]={type:"string",
value:"vnd.oasis.opendocument.field.UNHANDLED"};field["FieldCommand"]={type:"string",
value:"ADDIN ZOTERO_ITEM CSL_CITATION "+cslJSON};field["FieldResult"]={type:"string",
value:citationString}}else if(this.getFieldType()==="ReferenceMark"){field["TypeName"]={
type:"string",value:"SetRef"};field["Name"]={type:"string",
value:"ZOTERO_ITEM CSL_CITATION "+cslJSON+" RND"+app.util.randomString(10)};field["Content"]={
type:"string",value:citationString};field["NeverExpand"]={type:"boolean",value:true}}else if(
this.getFieldType()=="Bookmark"){field["Bookmark"]={type:"string",
value:"ZOTERO_BREF_"+app.util.randomString(12)};field["BookmarkText"]={type:"string",
value:citationString}}if(this.settings.wrapper)field["Wrapper"]={type:"string",
value:this.settings.wrapper};return field},getFieldUpdateParameters:function(cslJSON,citationString
){var field={};if(this.getFieldType()==="Field"){field={FieldType:{type:"string",
value:"vnd.oasis.opendocument.field.UNHANDLED"},FieldCommandPrefix:{type:"string",
value:"ADDIN ZOTERO_ITEM"},Field:{type:"[]com.sun.star.beans.PropertyValue",value:{FieldType:{
type:"string",value:"vnd.oasis.opendocument.field.UNHANDLED"},FieldCommand:{type:"string",
value:"ADDIN ZOTERO_ITEM CSL_CITATION "+cslJSON},FieldResult:{type:"string",value:citationString}}}}
}else if(this.getFieldType()==="ReferenceMark"){field={TypeName:{type:"string",value:"SetRef"},
NamePrefix:{type:"string",value:"ZOTERO_ITEM CSL_CITATION"},Field:{
type:"[]com.sun.star.beans.PropertyValue",value:{Name:{type:"string",
value:"ZOTERO_ITEM CSL_CITATION "+cslJSON},Content:{type:"string",value:citationString}}}}}else if(
this.getFieldType()==="Bookmark"){field={BookmarkNamePrefix:{type:"string",value:"ZOTERO_BREF_"},
Bookmark:{type:"[]com.sun.star.beans.PropertyValue",value:{Bookmark:{type:"string",
value:"ZOTERO_BREF_"+app.util.randomString(12)},BookmarkText:{type:"string",value:citationString}}}}
}return field},getBibParameters:function(html){var field={};if(this.getFieldType()==="Field"){field[
"FieldType"]={type:"string",value:"vnd.oasis.opendocument.field.UNHANDLED"};field["FieldCommand"]={
type:"string",value:"ADDIN ZOTERO_BIBL "+JSON.stringify(this.settings.bib)+" CSL_BIBLIOGRAPHY"};
field["FieldResult"]={type:"string",value:html}}else if(this.getFieldType()=="Bookmark"){field[
"Bookmark"]={type:"string",value:"ZOTERO_BREF_"+app.util.randomString(12)};field["BookmarkText"]={
type:"string",value:html}}else{field["RegionName"]={type:"string",
value:"ZOTERO_BIBL "+JSON.stringify(this.settings.bib
)+" CSL_BIBLIOGRAPHY "+" RND"+app.util.randomString(10)};field["Content"]={type:"string",value:html}
}return field},sendInsertBibCommand:function(html){var command="";
var parameters=this.getBibParameters(html);if(this.getFieldType()==="Field"){
command=".uno:TextFormField";if(this.settings.bibliographyStyleHasBeenSet=="1"){parameters={
FieldType:{type:"string",value:"vnd.oasis.opendocument.field.UNHANDLED"},FieldCommandPrefix:{
type:"string",value:"ADDIN ZOTERO_BIBL"},Fields:{type:"[][]com.sun.star.beans.PropertyValue",value:[
parameters]}};command=".uno:TextFormFields"}}else if(this.getFieldType()=="Bookmark"){
command=".uno:InsertBookmark";var newBibBookmarkName=parameters["Bookmark"].value;if(
this.settings.bibliographyStyleHasBeenSet=="1"){command=".uno:UpdateBookmarks";parameters={
BookmarkNamePrefix:{type:"string",value:this.bibBookmarkName},Bookmarks:{
type:"[][]com.sun.star.beans.PropertyValue",value:[parameters]}}}
this.bibBookmarkName=newBibBookmarkName;this.setCustomProperty(this.bibBookmarkName+"_",
"ZOTERO_BIBL "+JSON.stringify(this.settings.bib)+" CSL_BIBLIOGRAPHY")}else{
command=".uno:InsertSection";if(this.settings.bibliographyStyleHasBeenSet=="1"){
var command=".uno:UpdateSections";parameters={SectionNamePrefix:{type:"string",value:"ZOTERO_BIBL"},
Sections:{type:"[][]com.sun.star.beans.PropertyValue",value:[parameters]}}}}this.map.sendUnoCommand(
command,parameters,true)},setCustomProperty:function(prefix,string){var property={
UpdatedProperties:{type:"[]com.sun.star.beans.PropertyValue",value:{NamePrefix:{type:"string",
value:prefix},UserDefinedProperties:{type:"[]com.sun.star.beans.PropertyValue",value:{}}}}};for(
var start=0,end=1;end*255<string.length+255;start++,end++){property["UpdatedProperties"]["value"][
"UserDefinedProperties"]["value"][prefix+end]={type:"string",value:string.slice(start*255,end*255)}}
this.map.sendUnoCommand(".uno:SetDocumentProperties",property,true)},handleCustomProperty:function(
userDefinedProperties){var prefixList=new Set;var nameValueMap={};var resultMap={};for(
var i=0;i<userDefinedProperties.length;i++){prefixList.add(userDefinedProperties[i].name.substring(0
,userDefinedProperties[i].name.lastIndexOf("_")));nameValueMap[userDefinedProperties[i].name
]=userDefinedProperties[i].value}prefixList.forEach(function(prefix){for(i=1;nameValueMap[
prefix+"_"+i];i++){if(resultMap[prefix])resultMap[prefix]+=nameValueMap[prefix+"_"+i
];else resultMap[prefix]=nameValueMap[prefix+"_"+i]}});var resultKeys=Object.keys(resultMap);if(
resultMap.ZOTERO_PREF){this.setFetchedStyle(resultMap.ZOTERO_PREF)}else if(!resultKeys.length){
this.handleFieldUnderCursor({})}else if(resultKeys.length&&resultKeys[0].startsWith("ZOTERO_BREF")){
this.handleFieldUnderCursor({bookmark:resultMap[resultKeys[0]]});var fields=[];var that=this;
this.bookmarksOrder.forEach(function(bookmark){if(resultMap[bookmark].startsWith("ZOTERO_BIBL")){
that.bibBookmarkName=bookmark;that.setBibCustomProperty(resultMap[bookmark]);return}fields.push({
bookmark:resultMap[bookmark]})});this.onFieldValue(fields)}},setBibCustomProperty:function(
bibProperty){if(!bibProperty)return{};var firstBraceIndex=bibProperty.indexOf("{");
var lastBraceIndex=bibProperty.lastIndexOf("}");if(
firstBraceIndex<0||lastBraceIndex>bibProperty.length||lastBraceIndex<0)return{};
var values=JSON.parse(bibProperty.substring(firstBraceIndex,lastBraceIndex+1));
this.settings.bib.uncited=values.uncited;this.settings.bib.omitted=values.omitted;
this.settings.bib.custom=values.custom},handleBookmark:function(bookmarks){this.resetCitation();
var that=this;bookmarks.forEach(function(bookmark){that.bookmarksOrder.push(bookmark.name)});
this.fetchCustomProperty("ZOTERO_BREF_")},_onMessage:function(message){if(message.startsWith(
"itemslist: ")){this.handleItemList(message)}},availableLanguages:{},languageNames:{"af-ZA":[
"Afrikaans","Afrikaans"],ar:["العربية","Arabic"],"bg-BG":["Български","Bulgarian"],"ca-AD":["Català"
,"Catalan"],"cs-CZ":["Čeština","Czech"],"cy-GB":["Cymraeg","Welsh"],"da-DK":["Dansk","Danish"],
"de-AT":["Deutsch (Österreich)","German (Austria)"],"de-CH":["Deutsch (Schweiz)",
"German (Switzerland)"],"de-DE":["Deutsch (Deutschland)","German (Germany)"],"el-GR":["Ελληνικά",
"Greek"],"en-GB":["English (UK)","English (UK)"],"en-US":["English (US)","English (US)"],"es-CL":[
"Español (Chile)","Spanish (Chile)"],"es-ES":["Español (España)","Spanish (Spain)"],"es-MX":[
"Español (México)","Spanish (Mexico)"],"et-EE":["Eesti keel","Estonian"],eu:["Euskara","Basque"],
"fa-IR":["فارسی","Persian"],"fi-FI":["Suomi","Finnish"],"fr-CA":["Français (Canada)",
"French (Canada)"],"fr-FR":["Français (France)","French (France)"],"he-IL":["עברית","Hebrew"],
"hi-IN":["हिंदी","Hindi"],"hr-HR":["Hrvatski","Croatian"],"hu-HU":["Magyar","Hungarian"],"id-ID":[
"Bahasa Indonesia","Indonesian"],"is-IS":["Íslenska","Icelandic"],"it-IT":["Italiano","Italian"],
"ja-JP":["日本語","Japanese"],"km-KH":["ភាសាខ្មែរ","Khmer"],"ko-KR":["한국어","Korean"],la:["Latina",
"Latin"],"lt-LT":["Lietuvių kalba","Lithuanian"],"lv-LV":["Latviešu","Latvian"],"mn-MN":["Монгол",
"Mongolian"],"nb-NO":["Norsk bokmål","Norwegian (Bokmål)"],"nl-NL":["Nederlands","Dutch"],"nn-NO":[
"Norsk nynorsk","Norwegian (Nynorsk)"],"pl-PL":["Polski","Polish"],"pt-BR":["Português (Brasil)",
"Portuguese (Brazil)"],"pt-PT":["Português (Portugal)","Portuguese (Portugal)"],"ro-RO":["Română",
"Romanian"],"ru-RU":["Русский","Russian"],"sk-SK":["Slovenčina","Slovak"],"sl-SI":["Slovenščina",
"Slovenian"],"sr-RS":["Српски / Srpski","Serbian"],"sv-SE":["Svenska","Swedish"],"th-TH":["ไทย",
"Thai"],"tr-TR":["Türkçe","Turkish"],"uk-UA":["Українська","Ukrainian"],"vi-VN":["Tiếng Việt",
"Vietnamese"],"zh-CN":["中文 (中国大陆)","Chinese (PRC)"],"zh-TW":["中文 (台灣)","Chinese (Taiwan)"]}});
window.L.control.zotero=function(map){return new window.L.Control.Zotero(map)};window.L.Map.include(
{readonlyStartingFormats:{txt:{canEdit:true,odfFormat:"odt"},csv:{canEdit:true,odfFormat:"ods"},
xlsb:{canEdit:false,odfFormat:"ods"}},setPermission:function(perm){var button=$(
"#mobile-edit-button");button.off("click");button.attr("tabindex",0);button.attr("role","button");
button.attr("title",_("Edit document"));button.attr("aria-label",_("Edit document"));
var isPDF=app.file.fileBasedView&&app.file.editComment;if(!isPDF&&(this._shouldStartReadOnly(
)||window.mode.isMobile()||window.mode.isTablet())){button.css("display","flex")}else{button.hide()}
var that=this;if(perm==="edit"){if(this._shouldStartReadOnly()||window.mode.isMobile(
)||window.mode.isTablet()){button.on("click",function(){that._switchToEditMode()});
this._enterReadOnlyMode("readonly")}else if(this.options.canTryLock){this._switchToEditMode()}else{
this._enterEditMode(perm)}}else if(perm==="view"||perm==="readonly"){if(this.isLockedReadOnlyUser()
){button.on("click",function(){that.openUnlockPopup()})}else if(window.ThisIsTheAndroidApp){
button.on("click",function(){that._requestFileCopy()})}else if(!window.ThisIsAMobileApp&&!this[
"wopi"].UserCanWrite||!this.options.canTryLock&&(window.mode.isMobile()||window.mode.isTablet())){$(
"#mobile-edit-button").hide()}this._enterReadOnlyMode(perm)}},onLockFailed:function(reason){if(
this.options.canTryLock===undefined){this.options.canTryLock=true;var alertMsg=_(
"The document could not be locked, and is opened in read-only mode.");if(reason){alertMsg+="\n"+_(
"Server returned this reason:")+'\n"'+reason+'"'}this.uiManager.showConfirmModal(
"lock_failed_message","",alertMsg,_("OK"),function(){app.socket.sendMessage("attemptlock")},true)
}else if(this.options.canTryLock){alertMsg=_("The document could not be locked.");if(reason){
alertMsg+="\n"+_("Server returned this reason:")+'\n"'+reason+'"'}this.uiManager.showConfirmModal(
"lock_failed_message","",alertMsg,_("OK"),null,true)}},_getFileExtension:function(filename){
return filename.substring(filename.lastIndexOf(".")+1)},_shouldStartReadOnly:function(){if(
this.isLockedReadOnlyUser())return true;var fileName=this["wopi"].BaseFileName;if(!fileName
)return false;var extension=this._getFileExtension(fileName);if(
!Object.prototype.hasOwnProperty.call(this.readonlyStartingFormats,extension))return false;
return true},_proceedEditMode:function(){var fileName=this["wopi"].BaseFileName;if(fileName){
var extension=this._getFileExtension(fileName);var extensionInfo=this.readonlyStartingFormats[
extension];if(extensionInfo&&!extensionInfo.canEdit)return}this.options.canTryLock=false;$(
"#mobile-edit-button").hide();this._enterEditMode("edit");if(window.mode.isMobile(
)||window.mode.isTablet()){this.fire("editorgotfocus");this.fire("closemobilewizard");if(!(
window.ThisIsTheiOSApp||window.ThisIsTheAndroidApp))this.focus()}},_offerSaveAs:function(){
var fileName=this["wopi"].BaseFileName;if(!fileName)return false;
var extension=this._getFileExtension(fileName);var extensionInfo=this.readonlyStartingFormats[
extension];var saveAsFormat=extensionInfo.odfFormat;var defaultValue=fileName.substring(0,
fileName.lastIndexOf("."))+"."+saveAsFormat;this.uiManager.showInputModal("save-as-modal","",_(
"Enter a file name"),defaultValue,_("OK"),function(){var value=document.getElementById(
"save-as-modal").querySelectorAll("#input-modal-input")[0].value;if(!value)return;else if(
value.substring(value.lastIndexOf(".")+1)!==saveAsFormat){value+="."+saveAsFormat}this.saveAs(value,
saveAsFormat)}.bind(this))},_switchToEditMode:function(){if(this._shouldStartReadOnly(
)&&!window.ThisIsAMobileApp){var fileName=this["wopi"].BaseFileName;
var extension=this._getFileExtension(fileName);var extensionInfo=this.readonlyStartingFormats[
extension];var yesButtonText=!this["wopi"].UserCanNotWriteRelative?_("Save as ODF format"):null;
var noButtonText=extensionInfo.canEdit?_("Continue editing"):_("Continue read only");if(
!yesButtonText){yesButtonText=noButtonText;noButtonText=null}var yesFunction=!noButtonText?function(
){this._proceedEditMode()}.bind(this):function(){this._offerSaveAs()}.bind(this);
var noFunction=function(){this._proceedEditMode()}.bind(this);this.uiManager.showYesNoButton(
"switch-to-edit-mode-modal","",_(
"This document may contain formatting or content that cannot be saved in the current file format."),
yesButtonText,noButtonText,yesFunction,noFunction,false)}else{this._proceedEditMode()}},
_requestFileCopy:function(){if(app.isReadOnly()){window.postMobileMessage("REQUESTFILECOPY")}else{
this._switchToEditMode()}},_enterEditMode:function(perm){this._permission=perm;if((
window.mode.isMobile()||window.mode.isTablet())&&this._textInput&&this.getDocType()==="text"){
this._textInput.setSwitchedToEditMode()}app.events.fire("updatepermission",{perm:perm});if(
this._docLayer._docType==="text"){this.setZoom(10)}if(window.ThisIsTheiOSApp&&window.mode.isTablet(
)&&this._docLayer._docType==="spreadsheet")this.showCalcInputBar();if(window.ThisIsTheAndroidApp
)window.postMobileMessage("EDITMODE on")},_enterReadOnlyMode:function(perm){this._permission=perm;
if(this._docLayer){this._docLayer._onUpdateCursor();this._docLayer._clearSelections()}
app.events.fire("updatepermission",{perm:perm});this.fire("closemobilewizard");this.fire(
"closealldialogs");if(window.ThisIsTheAndroidApp)window.postMobileMessage("EDITMODE off")},
isReadOnlyMode:function(){return this._permission==="readonly"},isEditMode:function(){
return this._permission==="edit"}});window.L.Map.include({unoToolbarCommands:[".uno:StyleApply",
".uno:CharFontName"],_modalDialogOptions:{overlayClose:true,opacity:80,overlayCss:{
backgroundColor:"#000"},containerCss:{overflow:"hidden",backgroundColor:"#fff",padding:"20px",
border:"2px solid #000"}},onFontSelect:function(e){var font=e.target.value;this.applyFont(font);
this.focus()},_getCurrentFontName:function(){return this["stateChangeHandler"].getItemValue(
".uno:CharFontName")},createFontSelector:function(nodeSelector){var that=this;var fontcombobox=$(
nodeSelector);if(!fontcombobox.hasClass("select2")){fontcombobox.select2({placeholder:_("Font")})}
var createSelector=function(){var commandValues=that.getToolbarCommandValues(".uno:CharFontName");
var data=[];if(typeof commandValues==="object"){data=data.concat(Object.keys(commandValues))}
fontcombobox.empty();for(var i=0;i<data.length;++i){if(!data[i])continue;
var option=document.createElement("option");option.text=data[i];option.value=data[i];
fontcombobox.append(option)}fontcombobox.on("select2:select",that.onFontSelect.bind(that));
fontcombobox.val(that._getCurrentFontName()).trigger("change")};createSelector();
var onCommandStateChanged=function(e){var commandName=e.commandName;if(
commandName!==".uno:CharFontName")return;var state=e.state;var found=false;fontcombobox.children(
"option").each(function(){var value=this.value;if(value.toLowerCase()===state.toLowerCase()){
found=true;return}});if(!found&&state){fontcombobox.append($("<option></option>").text(state))}
fontcombobox.val(state).trigger("change");this["stateChangeHandler"].setItemValue(
".uno:CharFontName",state)};var onFontListChanged=function(e){if(e.commandName===".uno:CharFontName"
)createSelector()};this.off("commandstatechanged",onCommandStateChanged);this.on(
"commandstatechanged",onCommandStateChanged);this.off("updatetoolbarcommandvalues",onFontListChanged
);this.on("updatetoolbarcommandvalues",onFontListChanged)},onFontSizeSelect:function(e){
this.applyFontSize(e.target.value);this.focus()},createFontSizeSelector:function(nodeSelector){
var data=[6,7,8,9,10,10.5,11,12,13,14,15,16,18,20,22,24,26,28,32,36,40,44,48,54,60,66,72,80,88,96];
var fontsizecombobox=$(nodeSelector);if(!fontsizecombobox.hasClass("select2")){
fontsizecombobox.select2({dropdownAutoWidth:true,width:"auto",placeholder:_("Font Size"),
createTag:function(query){return{id:query.term,text:query.term,tag:true}},tags:true,sorter:function(
data){return data.sort(function(a,b){return parseFloat(a.text)-parseFloat(b.text)})}})}
fontsizecombobox.empty();for(var i=0;i<data.length;++i){var option=document.createElement("option");
option.text=data[i];option.value=data[i];fontsizecombobox.append(option)}fontsizecombobox.off(
"select2:select",this.onFontSizeSelect.bind(this)).on("select2:select",this.onFontSizeSelect.bind(
this));var onCommandStateChanged=function(e){var commandName=e.commandName;if(
commandName!==".uno:FontHeight")return;var state=e.state;var found=false;if(state==="0"){state=""}
fontsizecombobox.children("option").each(function(i,e){if($(e).text()===state){found=true}});if(
!found){fontsizecombobox.append($("<option>").text(state).val(state))}fontsizecombobox.val(state
).trigger("change");this["stateChangeHandler"].setItemValue(".uno:FontHeight",state)};this.off(
"commandstatechanged",onCommandStateChanged);this.on("commandstatechanged",onCommandStateChanged)},
applyFont:function(fontName){if(!fontName)return;if(this.isEditMode()){
var msg="uno .uno:CharFontName {"+'"CharFontName.FamilyName": '+'{"type": "string", "value": "'+fontName+'"}}'
app.socket.sendMessage(msg)}},applyFontSize:function(fontSize){if(this.isEditMode()){
var msg="uno .uno:FontHeight {"+'"FontHeight.Height": '+'{"type": "float", "value": "'+fontSize+'"}}'
app.socket.sendMessage(msg)}},getToolbarCommandValues:function(command){if(this._docLayer){
return this._docLayer._toolbarCommandValues[command]}return undefined},downloadAs:function(name,
format,options,id){if(this._fatal){return}id=id||"export";if(id==="print"&&this["wopi"
].DisablePrint||id==="export"&&this["wopi"].DisableExport){this.hideBusy();return}if(
format===undefined||format===null){format=""}if(options===undefined||options===null){options=""}if(
id==="print"&&format==="pdf"&&options===""
)options='{"ExportFormFields":{"type":"boolean","value":"false"},'+'"ExportNotes":{"type":"boolean","value":"false"}}'
if(id=="export"&&format==="pdf"&&options===""
)options='{"ExportNotes":{"type":"boolean","value":"false"}}';if(!window.ThisIsAMobileApp
)this.showBusy(_("Downloading..."),false);app.socket.sendMessage(
"downloadas "+"name="+encodeURIComponent(name
)+" "+"id="+id+" "+"format="+format+" "+"options="+options)},print:function(options){if(
window.ThisIsTheiOSApp||window.ThisIsTheAndroidApp){window.postMobileMessage("PRINT")}else{
this.showBusy(_("Downloading..."),false);this.downloadAs("print.pdf","pdf",options,"print")}},
saveAs:function(url,format,options){if(url===undefined||url==null){return}if(
format===undefined||format===null){format=""}if(options===undefined||options===null){options=""}
this.showBusy(_("Saving..."),false);app.socket.sendMessage("saveas "+"url=wopi:"+encodeURIComponent(
url)+" "+"format="+format+" "+"options="+options)},exportAs:function(url){if(
url===undefined||url==null){return}app.socket.sendMessage("exportas url=wopi:"+encodeURIComponent(
url))},renameFile:function(filename){if(!filename){return}this.showBusy(_("Renaming..."),false);
app.socket.sendMessage("renamefile filename="+encodeURIComponent(filename))},applyStyle:function(
style,familyName){if(!style||!familyName){this.fire("error",{cmd:"setStyle",kind:"incorrectparam"});
return}if(this.isEditMode()){
var msg="uno .uno:StyleApply {"+'"Style":{"type":"string", "value": "'+style+'"},'+'"FamilyName":{"type":"string", "value":"'+familyName+'"}'+"}"
app.socket.sendMessage(msg)}},applyLayout:function(layout){if(!layout){this.fire("error",{
cmd:"setLayout",kind:"incorrectparam"});return}if(this.isEditMode()){
var msg="uno .uno:AssignLayout {"+'"WhatPage":{"type":"unsigned short", "value": "'+this.getCurrentPartNumber(
)+'"},'+'"WhatLayout":{"type":"unsigned short", "value": "'+layout+'"}'+"}";app.socket.sendMessage(
msg)}},save:function(dontTerminateEdit,dontSaveIfUnmodified,extendedData){this.fire(
"updatemodificationindicator",{status:"SAVING"});var msg="save"+" dontTerminateEdit="+(
dontTerminateEdit?1:0)+" dontSaveIfUnmodified="+(dontSaveIfUnmodified?1:0);if(
extendedData!==undefined){msg+=" extendedData="+extendedData}app.socket.sendMessage(msg)},
messageNeedsToBeRedirected:function(command){if(command===".uno:EditHyperlink"){this.sendUnoCommand(
".uno:HyperlinkDialog");return true}else{return false}},sendUnoCommand:function(command,json,force){
if(command.indexOf(".uno:")<0&&command.indexOf("vnd.sun.star.script")<0)console.error(
'Trying to send uno command without prefix: "'+command+'"');if(command.startsWith(".uno:Sidebar"
)&&!command.startsWith(".uno:SidebarShow")||command.startsWith(".uno:CustomAnimation"
)||command.startsWith(".uno:ModifyPage")||command.startsWith(".uno:SidebarDeck"
)||command.startsWith(".uno:EditStyle")){if(this.sidebar){if(this.sidebar.isVisible()){
this.sidebar.setupTargetDeck(command)}else{app.socket.sendMessage("uno .uno:SidebarShow");
this.sidebar.setupTargetDeck(command);return}}}var isAllowedInReadOnly=false;var allowedCommands=[
".uno:Save",".uno:WordCountDialog",".uno:Signature",".uno:PrepareSignature",".uno:DownloadSignature"
,".uno:InsertSignatureLine",".uno:ShowResolvedAnnotations",
".uno:ToolbarMode?Mode:string=notebookbar_online.ui",".uno:ToolbarMode?Mode:string=Default",
".uno:ExportToEPUB",".uno:ExportToPDF",".uno:ExportDirectToPDF",".uno:MoveKeepInsertMode",
".uno:ShowRuler"];if(app.isCommentEditingAllowed()){allowedCommands.push(".uno:InsertAnnotation",
".uno:DeleteCommentThread",".uno:DeleteAnnotation",".uno:DeleteNote",".uno:DeleteComment",
".uno:ReplyComment",".uno:ReplyToAnnotation",".uno:PromoteComment",".uno:ResolveComment",
".uno:ResolveCommentThread",".uno:ResolveComment",".uno:EditAnnotation",".uno:ExportToEPUB",
".uno:ExportToPDF",".uno:ExportDirectToPDF");const graphicInfo=GraphicSelection.extraInfo;if(
graphicInfo&&graphicInfo.isSignature){allowedCommands.push(".uno:TransformDialog",
".uno:MoveShapeHandle")}}if(app.isRedlineManagementAllowed()){allowedCommands.push(
".uno:ShowTrackedChanges",".uno:AcceptTrackedChanges",".uno:AcceptTrackedChange",
".uno:RejectTrackedChange",".uno:AcceptAllTrackedChanges",".uno:RejectAllTrackedChanges",
".uno:AcceptTrackedChangeToNext",".uno:RejectTrackedChangeToNext",".uno:CommentChangeTracking",
".uno:PreviousTrackedChange",".uno:NextTrackedChange")}for(var i in allowedCommands){if(
allowedCommands[i]===command){isAllowedInReadOnly=true;break}}var map=this;if(command.startsWith(
".uno:SpellOnline")){var val=map["stateChangeHandler"].getItemValue(".uno:SpellOnline");if(val&&(
json===undefined||json===null)){var state=!(val==="true");window.prefs.set("SpellOnline",state)}}if(
this.uiManager.isUIBlocked())return;if((this.dialog.hasOpenedDialog(
)||this.jsdialog&&this.jsdialog.hasDialogOpened())&&!command.startsWith(".uno:ToolbarMode")&&!force
){console.debug("Cannot execute: "+command+" when dialog is opened.");this.dialog.blinkOpenDialog()
}else if((this.isEditMode()||isAllowedInReadOnly)&&!this.messageNeedsToBeRedirected(command)){
app.socket.sendMessage("uno "+command+(json?" "+JSON.stringify(json):""));if(
map.userList&&map._docLayer&&map._docLayer._viewId)map.userList.followUser(map._docLayer._viewId,
false)}},toggleCommandState:function(unoState){if(this.isEditMode()){if(!unoState.startsWith(".uno:"
)){unoState=".uno:"+unoState}this.sendUnoCommand(unoState)}},insertGraphic:function(file){this.fire(
"insertgraphic",{file:file})},insertMultimedia:function(file){this.fire("insertmultimedia",{
file:file})},insertURL:function(url,urltype){this.fire("inserturl",{url:url,urltype:urltype})},
selectBackground:function(file){this.fire("selectbackground",{file:file})},onHelpOpen:function(id,
map,productName){var i;if(id==="keyboard-shortcuts-content"){document.getElementById(
"online-help-content").classList.add("hide");if(map.getDocType()==="text"){document.getElementById(
"text-shortcuts").classList.add("show")}else if(map.getDocType()==="spreadsheet"){
document.getElementById("spreadsheet-shortcuts").classList.add("show")}else if(map.getDocType(
)==="presentation"){document.getElementById("presentation-shortcuts").classList.add("show")}else if(
map.getDocType()==="drawing"){document.getElementById("drawing-shortcuts").classList.add("show")}
}else{document.getElementById("keyboard-shortcuts-content").classList.add("hide");if(
window.socketProxy){var helpdiv=document.getElementById("online-help-content");
var imgList=helpdiv.querySelectorAll("img");for(var p=0;p<imgList.length;p++){var imgSrc=imgList[p
].src;imgSrc=imgSrc.substring(imgSrc.indexOf("/images"));imgList[p].src=window.makeWsUrl(
"/browser/dist"+imgSrc)}}if(map.getDocType()==="text"){var x=document.getElementsByClassName("text")
for(i=0;i<x.length;i++){x[i].classList.add("show")}}else if(map.getDocType()==="spreadsheet"){
x=document.getElementsByClassName("spreadsheet");for(i=0;i<x.length;i++){x[i].classList.add("show")}
}else if(map.getDocType()==="presentation"||map.getDocType()==="drawing"){
x=document.getElementsByClassName("presentation");for(i=0;i<x.length;i++){x[i].classList.add("show")
}}}var contentElement=document.getElementById(id);var max;
var translatableContent=contentElement.querySelectorAll("h1");for(i=0,
max=translatableContent.length;i<max;i++){translatableContent[i].innerHTML=translatableContent[i
].innerHTML.toLocaleString()}translatableContent=contentElement.querySelectorAll("h2");for(i=0,
max=translatableContent.length;i<max;i++){translatableContent[i].innerHTML=translatableContent[i
].innerHTML.toLocaleString()}translatableContent=contentElement.querySelectorAll("h3");for(i=0,
max=translatableContent.length;i<max;i++){translatableContent[i].innerHTML=translatableContent[i
].innerHTML.toLocaleString()}translatableContent=contentElement.querySelectorAll("h4");for(i=0,
max=translatableContent.length;i<max;i++){translatableContent[i].innerHTML=translatableContent[i
].innerHTML.toLocaleString()}translatableContent=contentElement.querySelectorAll("td");for(i=0,
max=translatableContent.length;i<max;i++){var orig=translatableContent[i].innerHTML;
var trans=translatableContent[i].innerHTML.toLocaleString();if(orig===trans&&orig.indexOf("kbd")!=-1
){var trimmedOrig=orig.replace(/^(<kbd>)/,"").replace(/(<\/kbd>$)/,"");
var trimmedTrans=trimmedOrig.toLocaleString();if(trimmedOrig!==trimmedTrans){
trans="<kbd>"+trimmedTrans+"</kbd>"}}translatableContent[i].innerHTML=trans}
translatableContent=contentElement.querySelectorAll("p");for(i=0,
max=translatableContent.length;i<max;i++){translatableContent[i].innerHTML=translatableContent[i
].innerHTML.toLocaleString()}translatableContent=contentElement.querySelectorAll("button");for(i=0,
max=translatableContent.length;i<max;i++){translatableContent[i].innerHTML=translatableContent[i
].innerHTML.toLocaleString()}var supportedLanguage=["de","fr","it","es","pt-BR"];
var currentLanguage=String.locale;if(supportedLanguage.indexOf(currentLanguage)>=0){
translatableContent=$(contentElement.querySelectorAll(".screenshot img"));for(i=0,
max=translatableContent.length;i<max;i++){translatableContent[i].src=translatableContent[i
].src.replace("/en/","/"+currentLanguage+"/")}}if(id==="online-help-content"){
var productNameContent=contentElement.querySelectorAll("span.productname");for(i=0,
max=productNameContent.length;i<max;i++){productNameContent[i].innerHTML=productNameContent[i
].innerHTML.replace("{productname}",productName)}document.getElementById("online-help-content"
).innerHTML=app.util.replaceCtrlAltInMac(document.getElementById("online-help-content").innerHTML)}
if(id==="keyboard-shortcuts-content"){document.getElementById("keyboard-shortcuts-content"
).innerHTML=app.util.replaceCtrlAltInMac(document.getElementById("keyboard-shortcuts-content"
).innerHTML)}var searchInput=document.getElementById("online-help-search-input");
searchInput.setAttribute("placeholder",_("Search"));searchInput.setAttribute("aria-label",_("Search"
));searchInput.focus();var helpContentParent=document.getElementsByClassName("ui-dialog-content")[0]
var startFilter=false;var isAnyMatchingContent=false;searchInput.addEventListener("input",function(
){if(!startFilter||!isAnyMatchingContent){
helpContentParent.style.backgroundColor="var(--color-background-dark) !important";
document.querySelectorAll("#online-help-content > *:not(a), .link-section p, .product-header"
).forEach(function(element){if(!element.classList.contains("text")&&!element.classList.contains(
"spreadsheet")&&!element.classList.contains("presentation")){this.hide(element)}}.bind(this));
startFilter=true}var searchTerm=searchInput.value.trim();if(searchTerm===""){
this.resetFilterResults();startFilter=false}else{this.filterResults(searchTerm,isAnyMatchingContent,
id)}}.bind(this));const onlineHelpContent=document.getElementById("online-help-content");
const buttons=onlineHelpContent.querySelectorAll(".scroll-button");buttons.forEach(button=>{
button.addEventListener("click",()=>{const targetId=button.dataset.target;if(targetId){
const targetElement=document.getElementById(`${targetId}`);if(targetElement){
targetElement.scrollIntoView()}}})})},filterResults:function(searchTerm,isAnyMatchingContent,id){
var mainDiv=document.getElementById(id);
var mainSectionsQuery=".section:not(div.text .section, div.spreadsheet .section, div.presentation .section)"
var docType=this.getDocType()==="drawing"?"presentation":this.getDocType();
mainSectionsQuery+=", div."+docType+" .section";var mainSections=mainDiv.querySelectorAll(
mainSectionsQuery);isAnyMatchingContent=false;mainSections.forEach(function(mainSection){
var headerText=mainSection.querySelector(".section-header").textContent.toLowerCase();
var containsTermInHeader=headerText.includes(searchTerm.toLowerCase());
var sectionText=mainSection.textContent.toLowerCase();var containsTerm=sectionText.includes(
searchTerm.toLowerCase());var subSections=mainSection.querySelectorAll(".sub-section");
var subSectionContainsTerm=false;if(containsTermInHeader){subSections.forEach(function(subSection){
mainSection.style.backgroundColor="";mainSection.style.paddingInline="";
mainSection.style.borderRadius="";this.show(subSection)}.bind(this));
mainSection.style.backgroundColor="var(--color-background-lighter)";
mainSection.style.paddingInline="12px";mainSection.style.borderRadius="var(--border-radius-large)";
this.show(mainSection)}else{subSections.forEach(function(subSection){if(
subSection.textContent.toLowerCase().includes(searchTerm.toLowerCase())){
subSection.style.color="var(--color-text-darker)";this.show(subSection);
mainSection.style.backgroundColor="var(--color-background-lighter)";
mainSection.style.paddingInline="12px";mainSection.style.borderRadius="var(--border-radius-large)";
this.show(mainSection);subSectionContainsTerm=true}else{subSection.style.color="";this.hide(
subSection)}}.bind(this))}if(!subSectionContainsTerm&&!containsTerm){this.hide(mainSection)}else{
isAnyMatchingContent=true}}.bind(this));if(!isAnyMatchingContent){this.resetFilterResults();$(
"#online-help-search-input").addClass("search-not-found");setTimeout(function(){$(
"#online-help-search-input").removeClass("search-not-found")},800)}},resetFilterResults:function(){
var helpContentParent=document.getElementsByClassName("ui-dialog-content")[0];
helpContentParent.style.backgroundColor="";var mainSections=document.querySelectorAll(".section");
mainSections.forEach(function(mainSection){mainSection.style.backgroundColor="";this.show(
mainSection);var subSections=mainSection.querySelectorAll(".sub-section");subSections.forEach(
function(subSection){this.show(subSection)}.bind(this))}.bind(this));document.querySelectorAll(
".m-v-0, .product-header, .help-dialog-header").forEach(function(element){this.show(element);
element.style.backgroundColor=""}.bind(this))},show:function(element){element.classList.remove(
"hide");element.classList.add("show")},hide:function(element){element.classList.remove("show");
element.classList.add("hide")},_doOpenHelpFile:function(data,id,map){let productName;if(
window.ThisIsAMobileApp){productName=window.MobileAppName}else{
productName=typeof brandProductName!=="undefined"?brandProductName:"F7 Office (unbranded)"
}map.uiManager.showYesNoButton(id+"-box",productName,"",_("OK"),null,null,null,true);
app.layoutingService.appendLayoutingTask(()=>{const box=document.getElementById(id+"-box");
const innerDiv=window.L.DomUtil.create("div","",null);box.insertBefore(innerDiv,box.firstChild);
innerDiv.innerHTML=data;this.onHelpOpen(id,map,productName)})},showHelp:function(id){var map=this;
if(window.ThisIsAMobileApp){map._doOpenHelpFile(window.HelpFile,id,map);return}
var helpLocation="cool-help.html";if(window.socketProxy)helpLocation=window.makeWsUrl(
"/browser/dist/"+helpLocation);$.get(helpLocation,function(data){map._doOpenHelpFile(data,id,map)})
},showLOAboutDialog:function(){this.aboutDialog.show()},extractContent:function(html){
html=DocUtil.stripHTML(html);var parser=new DOMParser;return parser.parseFromString(html,"text/html"
).documentElement.getElementsByTagName("body")[0].textContent},makeURLFromStr:function(str){
str=str.trim();const lowerStr=str.toLowerCase();if(!(lowerStr.startsWith("http://"
)||lowerStr.startsWith("https://")||lowerStr.startsWith("ftp://")||lowerStr.startsWith("mailto:"))){
const emailPattern=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;if(emailPattern.test(str)
)str="mailto:"+str;else str="http://"+str}return str},getTextForLink:function(){var map=this;
var text="";if(this.hyperlinkUnderCursor&&this.hyperlinkUnderCursor.text){
text=this.hyperlinkUnderCursor.text}else if(this._clip&&this._clip._selectionType=="text"){if(map[
"stateChangeHandler"].getItemValue(".uno:Copy")==="enabled"){if(
window.L.Browser.clipboardApiAvailable){app.socket.sendMessage(
"gettextselection mimetype=text/html,text/plain;charset=utf-8")}else{text=this.extractContent(
this._clip._selectionContent)}}}else if(this._docLayer._selectedTextContent){
text=this.extractContent(this._docLayer._selectedTextContent)}return text},cancelSearch:function(){
var toolbar=window.mode.isMobile()?app.map.mobileSearchBar:app.map.statusBar;
var searchInput=window.L.DomUtil.get("search-input");app.searchService.resetSelection();if(toolbar){
toolbar.showItem("cancelsearch",false);toolbar.enableItem("searchprev",false);toolbar.enableItem(
"searchnext",false)}searchInput.value="";if(window.mode.isMobile()){searchInput.focus();
toolbar.showItem("cancelsearch",false)}this._onGotFocus()},openRevisionHistory:function(){
var map=this;map.fire("postMessage",{msgId:"rev-history",args:{Deprecated:true}});map.fire(
"postMessage",{msgId:"UI_FileVersions"})},openShare:function(){var map=this;map.fire("postMessage",{
msgId:"UI_Share"})},openSaveAs:function(format){var map=this;map.fire("postMessage",{
msgId:"UI_SaveAs",args:{format:format}})},onFormulaBarFocus:function(){if(window.mode.isMobile(
)===true){var mobileTopBar=this.mobileTopBar;mobileTopBar.showItem("undo",false);
mobileTopBar.showItem("redo",false);mobileTopBar.showItem("cancelformula",true);
mobileTopBar.showItem("acceptformula",true)}else{var jsdialogFormulabar=this.formulabar;
jsdialogFormulabar.hide("startformula");jsdialogFormulabar.hide("AutoSumMenu");
jsdialogFormulabar.show("cancelformula");jsdialogFormulabar.show("acceptformula")}},
onFormulaBarBlur:function(){var map=this;if(window.mode.isMobile()&&this.isEditMode()){
var mobileTopBar=map.mobileTopBar;mobileTopBar.showItem("cancelformula",false);
mobileTopBar.showItem("acceptformula",false);mobileTopBar.showItem("undo",true);
mobileTopBar.showItem("redo",true)}else{var jsdialogFormulabar=map.formulabar;
jsdialogFormulabar.hide("cancelformula");jsdialogFormulabar.hide("acceptformula");
jsdialogFormulabar.show("startformula");jsdialogFormulabar.show("AutoSumMenu")}$(
"#AutoSumMenu-button").css("margin-inline","0");$("#AutoSumMenu .unoarrow").css("margin","0");
map.formulabar.blurField();$("#addressInput input").blur()},formulabarBlur:function(){if(
!this.uiManager.isAnyDialogOpen())this.focus()},formulabarFocus:function(){
this.formulabar.focusField()},formulabarSetDirty:function(){if(this.formulabar
)this.formulabar.dirty=true}});window.L.Map.include({onChangeSignStatus:function(signstatus){
var statusText=_("The document is not signed.");var statusIcon=" ";switch(signstatus){case"0":break;
case"1":statusText=_("This document is digitally signed and the signature is valid.");
statusIcon="sign_ok";break;case"2":statusText=_("This document has an invalid signature.");
statusIcon="sign_not_ok";break;case"3":statusText=_(
"The signature was valid, but the document has been modified.");statusIcon="sign_not_ok";break;
case"4":statusText=_("The signature is OK, but the certificate could not be validated.");
statusIcon="sign_not_ok";break;case"5":statusText=_(
"The signature is OK, but the document is only partially signed.");statusIcon="sign_not_ok";break;
case"6":statusText=_(
"The signature is OK, but the certificate could not be validated and the document is only partially signed."
);statusIcon="sign_not_ok";break}if(signstatus==="0"){let signstatusElement=document.querySelector(
"#signstatus");if(signstatusElement&&signstatusElement.classList.contains("hidden")){return}}if(
statusText){if(!window.mode.isMobile()){app.map.statusBar.showSigningItem(statusIcon,statusText);
const eSignature=app.map.eSignature;if(eSignature&&eSignature.showSignaturesOnNextUpdate){
eSignature.showSignaturesOnNextUpdate=false;app.map.sendUnoCommand(".uno:Signature")}}else if(
app.map.mobileTopBar.showSigningItem)app.map.mobileTopBar.showSigningItem(statusIcon,statusText)}}})
window.L.Map.include({setPart:function(part,external,calledFromSetPartHandler){if(
cool.Comment.isAnyEdit()){cool.CommentSection.showCommentEditingWarning();return}
var docLayer=this._docLayer;var docType=docLayer._docType;var isTheSamePart=false;if(
docType==="spreadsheet"){isTheSamePart=app.calc.partHashes[docLayer._prevSelectedPart
]===app.calc.partHashes[part]}else if(docType==="presentation"||docType==="drawing"){if(
docLayer._prevSelectedPart!==undefined&&part<app.impress.partList.length&&app.impress.partList[
docLayer._prevSelectedPart])isTheSamePart=app.impress.partList[docLayer._prevSelectedPart
].hash===app.impress.partList[part].hash}else if(docType==="text"){isTheSamePart=true}else{
console.error("Unknown docType: "+docType)}if(docLayer._selectedPart===part&&isTheSamePart){return}
if(docLayer.isCalc())docLayer._sheetSwitch.save(part);docLayer._clearMsgReplayStore(true);
docLayer._prevSelectedPart=docLayer._selectedPart;if(part==="prev"){if(docLayer._selectedPart>0){
docLayer._selectedPart-=1;this._partsDirection=-1}}else if(part==="next"){if(
docLayer._selectedPart<docLayer._parts-1){docLayer._selectedPart+=1;this._partsDirection=1}}else if(
typeof part==="number"&&part>=0&&part<docLayer._parts){
this._partsDirection=part>=docLayer._selectedPart?1:-1;docLayer._selectedPart=part;
docLayer._updateReferenceMarks()}else{return}var notifyServer=function(part){if(!external
)app.socket.sendMessage("setclientpart part="+part)};if(app.file.fileBasedView){
docLayer._selectedPart=docLayer._prevSelectedPart;if(typeof part!=="number"){
docLayer._preview._scrollViewByDirection(part);this._docLayer._checkSelectedPart();return}
docLayer._preview._scrollViewToPartPosition(docLayer._selectedPart);
this._docLayer._checkSelectedPart();notifyServer(part);return}this.fire("scrolltopart");if(
app.file.textCursor.visible){app.socket.sendMessage("resetselection")}notifyServer(
docLayer._selectedPart);this.fire("updateparts",{selectedPart:docLayer._selectedPart,
parts:docLayer._parts,docType:docLayer._docType});OtherViewCellCursorSection.updateVisibilities();
app.definitions.otherViewCursorSection.updateVisibilities();
app.definitions.otherViewGraphicSelectionSection.updateVisibilities();docLayer.eachView(
docLayer._viewSelections,docLayer._onUpdateTextViewSelection,docLayer);docLayer._clearSelections(
calledFromSetPartHandler);TileManager.updateOnChangePart();TileManager.pruneTiles();
docLayer._prevSelectedPartNeedsUpdate=true;if(docLayer._invalidatePreviews){
docLayer._invalidatePreviews()}if(
this._docLayer._docType==="presentation"||this._docLayer._docType==="drawing"){
this._docLayer._preview.focusCurrentSlide()}else{this.focus()}},selectPart:function(part,how,
external,fireEvent=true){const currentSelectedCount=app.impress.getSelectedSlidesCount();
const targetPart=app.impress.partList[part];if(how<2
)targetPart.selected=how;else targetPart.selected=targetPart.selected===1?0:1;if(
currentSelectedCount!==app.impress.getSelectedSlidesCount()){if(fireEvent)this.fire("updateparts",{}
);if(!external){app.socket.sendMessage("selectclientpart part="+part+" how="+how)}}},
deselectAll:function(){for(let i=0;i<app.impress.partList.length;i++){this.selectPart(i,0,false,
false)}this.fire("updateparts",{})},_processPreviewQueue:function(){if(!this._docLayer)return;if(
!this._docLayer._canonicalIdInitialized)return;if(!this._docLayer._preview)return;if(
this._previewRequestsOnFly>1){var now=new Date;if(now-this._timeToEmptyQueue<2e3)return;else{
this._previewRequestsOnFly=0;this._timeToEmptyQueue=now}}var previewParts=[];while(
this._previewRequestsOnFly<3){var tile=this._previewQueue.shift();if(!tile)break;
var isVisible=this._docLayer._preview._isPreviewVisible(tile[0]);if(isVisible!=true&&tile[1
].indexOf("slideshow")<0)continue;this._previewRequestsOnFly++;this.fire("beforerequestpreview",{
part:tile[0]});app.socket.sendMessage(tile[1]);previewParts.push(tile[0])}if(previewParts.length>0
)window.app.console.debug("PREVIEW: request preview parts : "+previewParts.join())},
_addPreviewToQueue:function(part,tileMsg){for(var tile in this._previewQueue)if(this._previewQueue[
tile][0]===part)return;this._previewQueue.push([part,tileMsg])},getPreview:function(id,part,maxWidth
,maxHeight,options){if(!this._docPreviews)this._docPreviews={};
const autoUpdate=options?!!options.autoUpdate:false;
const fetchThumbnail=options&&options.fetchThumbnail!==undefined?options.fetchThumbnail:true;
const isSlideshow=options&&options.slideshow!==undefined?options.slideshow:false;this._docPreviews[
id]={id:id,index:part,maxWidth:maxWidth,maxHeight:maxHeight,autoUpdate:autoUpdate,invalid:false};
let docLayer=this._docLayer;if(docLayer._docType==="text")return;
const tileWidth=docLayer._partWidthTwips?docLayer._partWidthTwips:app.activeDocument.fileSize.x;
const tileHeight=docLayer._partHeightTwips?docLayer._partHeightTwips:app.activeDocument.fileSize.y;
const docRatio=tileWidth/tileHeight;const imgRatio=maxWidth/maxHeight;if(imgRatio>docRatio
)maxWidth=Math.round(tileWidth*maxHeight/tileHeight);else maxHeight=Math.round(
tileHeight*maxWidth/tileWidth);if(fetchThumbnail){var mode=docLayer._selectedMode;
this._addPreviewToQueue(part,"tile "+"nviewid=0"+" "+"part="+String(part)+" "+"mode="+String(mode
)+" "+"width="+String(maxWidth*app.roundedDpiScale)+" "+"height="+String(
maxHeight*app.roundedDpiScale)+" "+"tileposx="+"0 "+"tileposy="+"0 "+"tilewidth="+String(tileWidth
)+" "+"tileheight="+String(tileHeight)+" "+"id="+String(id)+(isSlideshow?" slideshow=1":""));
this._processPreviewQueue()}return{width:maxWidth,height:maxHeight}},getCustomPreview:function(id,
part,width,height,tilePosX,tilePosY,tileWidth,tileHeight,options){if(!this._docPreviews){
this._docPreviews={}}var autoUpdate=options?options.autoUpdate:false;this._docPreviews[id]={id:id,
part:part,width:width,height:height,tilePosX:tilePosX,tilePosY:tilePosY,tileWidth:tileWidth,
tileHeight:tileHeight,autoUpdate:autoUpdate,invalid:false};var mode=this._docLayer._selectedMode;
this._addPreviewToQueue(part,"tile "+"nviewid=0"+" "+"part="+part+" "+(mode!==0?"mode="+mode+" ":""
)+"width="+width*app.roundedDpiScale+" "+"height="+height*app.roundedDpiScale+" "+"tileposx="+tilePosX+" "+"tileposy="+tilePosY+" "+"tilewidth="+tileWidth+" "+"tileheight="+tileHeight+" "+"id="+id
);this._processPreviewQueue()},goToPage:function(page){var docLayer=this._docLayer;if(page==="prev"
){if(docLayer._currentPage>0){docLayer._currentPage-=1}}else if(page==="next"){if(
docLayer._currentPage<docLayer._pages-1){docLayer._currentPage+=1}}else if(
typeof page==="number"&&page>=0&&page<docLayer._pages){docLayer._currentPage=page}if(
!this.isEditMode()&&app.file.writer.pageRectangleList.length>docLayer._currentPage){
const posY=Math.round(app.file.writer.pageRectangleList[docLayer._currentPage][1]/app.dpiScale);
const section=app.sectionContainer.getSectionWithName(app.CSections.Scroll.name);if(section
)section.onScrollTo({x:0,y:posY});var state="Page "+(docLayer._currentPage+1
)+" of "+app.file.writer.pageRectangleList.length;this.fire("updatestatepagenumber",{state:state})
}else{app.socket.sendMessage("setpage page="+docLayer._currentPage)}this.fire("pagenumberchanged",{
currentPage:docLayer._currentPage,pages:docLayer._pages,docType:docLayer._docType})},
insertPage:function(nPos){if(cool.Comment.isAnyEdit()){
cool.CommentSection.showCommentEditingWarning();return}if(this.isPresentationOrDrawing()){if(
nPos===undefined){app.socket.sendMessage("uno .uno:InsertPage")}else{var argument={InsertPos:{
type:"int16",value:nPos}};app.socket.sendMessage("uno .uno:InsertPage "+JSON.stringify(argument))}
}else if(this.getDocType()==="spreadsheet"){this._docLayer._sheetSwitch.updateOnSheetInsertion(nPos)
var command={Name:{type:"string",value:""},Index:{type:"long",value:nPos+1}};app.socket.sendMessage(
"uno .uno:Insert "+JSON.stringify(command))}else{return}var docLayer=this._docLayer;if(
!this.isPresentationOrDrawing()){this.fire("insertpage",{selectedPart:docLayer._selectedPart,
parts:docLayer._parts})}docLayer._parts++;if(this.userList)this.userList.followUser(
docLayer._getViewId());if(typeof nPos==="number"){this.setPart(nPos)}else{this.setPart("next")}},
duplicatePage:function(pos){if(!this.isPresentationOrDrawing()){return}if(pos===undefined){
app.socket.sendMessage("uno .uno:DuplicatePage")}else{var argument={InsertPos:{type:"int16",
value:pos}};app.socket.sendMessage("uno .uno:DuplicatePage "+JSON.stringify(argument))}
var docLayer=this._docLayer;docLayer._parts++;this.setPart("next")},deletePage:function(nPos){if(
this.isPresentationOrDrawing()){app.socket.sendMessage("uno .uno:DeletePage")}else if(
this.getDocType()==="spreadsheet"){this._docLayer._sheetSwitch.updateOnSheetDeleted(nPos);
var command={Index:{type:"long",value:nPos+1}};app.socket.sendMessage(
"uno .uno:Remove "+JSON.stringify(command))}else{return}var docLayer=this._docLayer;if(
docLayer._parts===1){return}if(this.getDocType(
)==="spreadsheet"&&docLayer._parts<=app.calc.getHiddenPartCount()+1){return}if(
!this.isPresentationOrDrawing()){this.fire("deletepage",{selectedPart:docLayer._selectedPart,
parts:docLayer._parts})}docLayer._parts--;if(docLayer._selectedPart>=docLayer._parts){
docLayer._selectedPart--}if(typeof nPos==="number"){this.setPart(nPos)}else{this.setPart(
docLayer._selectedPart)}},renamePage:function(name,nPos){if(this.getDocType()==="spreadsheet"){
var command={Name:{type:"string",value:name},Index:{type:"long",value:nPos+1}};
app.socket.sendMessage("uno .uno:Name "+JSON.stringify(command));this.setPart(this._docLayer)}},
showPage:function(){if(this.getDocType()==="spreadsheet"&&app.calc.isAnyPartHidden()){
const dialogId="show-sheets-modal";const buttonCallback=function(){
var checkboxList=document.querySelectorAll('input[id^="hidden-part-checkbox"]');for(
var i=0;i<checkboxList.length;i++){if(checkboxList[i].checked===true){var partName_=checkboxList[i
].id.replace("hidden-part-checkbox-","");var argument={aTableName:{type:"string",value:partName_}};
app.socket.sendMessage("uno .uno:Show "+JSON.stringify(argument))}}};this.uiManager.showInfoModal(
dialogId,_("Show sheets")," "," ",_("OK"),buttonCallback,true,dialogId+"-response");
this.showPageModalImpl(dialogId)}},showPageModalImpl:function(dialogId){
const modal=document.getElementById(dialogId);if(!modal){setTimeout(()=>{this.showPageModalImpl(
dialogId)},10);return}var hiddenParts=app.calc.getHiddenPartNameArray();if(app.calc.isAnyPartHidden(
)){var container=document.createElement("div");container.style.maxHeight="300px";
container.style.overflowY="auto";for(var i=0;i<hiddenParts.length;i++){
var checkbox=document.createElement("input");checkbox.type="checkbox";
checkbox.id="hidden-part-checkbox-"+hiddenParts[i];var label=document.createElement("label");
label.htmlFor="hidden-part-checkbox-"+hiddenParts[i];label.innerText=hiddenParts[i];
var newLine=document.createElement("br");container.appendChild(checkbox);container.appendChild(label
);container.appendChild(newLine)}}modal.insertBefore(container,modal.children[0]);
JSDialog.enableButtonInModal(dialogId,dialogId+"-response",false);
var checkboxes=document.querySelectorAll('#show-sheets-modal input[type="checkbox"]');
checkboxes.forEach(function(checkbox){checkbox.addEventListener("change",function(){
var anyChecked=false;checkboxes.forEach(function(checkbox){if(checkbox.checked){anyChecked=true}});
JSDialog.enableButtonInModal(dialogId,dialogId+"-response",anyChecked)})})},hidePage:function(
tabNumber){if(this.getDocType()==="spreadsheet"&&app.calc.getVisiblePartCount()>1){var argument={
nTabNumber:{type:"int16",value:tabNumber}};app.socket.sendMessage("uno .uno:Hide "+JSON.stringify(
argument))}},hideSlide:function(){for(let i=0;i<app.impress.partList.length;i++){if(
app.impress.partList[i].selected){app.impress.partList[i].visible=0;window.L.DomUtil.addClass(
this._docLayer._preview._previewTiles[i],"hidden-slide")}}app.socket.sendMessage(
"uno .uno:HideSlide");this.fire("toggleslidehide")},showSlide:function(){for(
let i=0;i<app.impress.partList.length;i++){if(app.impress.partList[i].selected){
app.impress.partList[i].visible=1;window.L.DomUtil.removeClass(
this._docLayer._preview._previewTiles[i],"hidden-slide")}}app.socket.sendMessage(
"uno .uno:ShowSlide");this.fire("toggleslidehide")},getNumberOfParts:function(){
return this._docLayer._parts},getCurrentPartNumber:function(){return this._docLayer._selectedPart},
getDocSize:function(){return this._docLayer._docPixelSize},getDocType:function(){if(!this._docLayer
)return null;return this._docLayer._docType},isPresentationOrDrawing:function(){
return this.getDocType()==="presentation"||this.getDocType()==="drawing"},isText:function(){
return this.getDocType()==="text"}});window.L.Styles={styleMappings:{Default:"Default",
Result:"Result",Result2:"Result2",Heading:"Heading",Heading1:"Heading1",Default:"Default",
Report:"Report",standard:"Default",objectwitharrow:"Object with arrow",
objectwithshadow:"Object with shadow",objectwithoutfill:"Object without fill",
"Object with no fill and no line":"Object with no fill and no line",text:"Text",
textbody:"Text body",textbodyjustfied:"Text body justified",textbodyindent:"First line indent",
title:"Title",title1:"Title1",title2:"Title2",headline:"Heading",headline1:"Heading1",
headline2:"Heading2",measure:"Dimension Line",Normal:"Normal","Heading 1":"Heading 1",
"Heading 2":"Heading 2","Heading 3":"Heading 3","Numbering Symbols":"Numbering Symbols",
Bullets:"Bullets","Table Contents":"Table Contents",Quotations:"Quotations",Index:"Index",
Caption:"Caption",List:"List","Text Body":"Text Body",default:"default",gray1:"gray1",gray2:"gray2",
gray3:"gray3",bw1:"bw1",bw2:"bw2",bw3:"bw3",orange1:"orange1",orange2:"orange2",orange3:"orange3",
turquoise1:"turquoise1",turquoise2:"turquoise2",turquoise3:"turquoise3",blue1:"blue1",blue2:"blue2",
blue3:"blue3",sun1:"sun1",sun2:"sun2",sun3:"sun3",earth1:"earth1",earth2:"earth2",earth3:"earth3",
green1:"green1",green2:"green2",green3:"green3",seetang1:"seetang1",seetang2:"seetang2",
seetang3:"seetang3",lightblue1:"lightblue1",lightblue2:"lightblue2",lightblue3:"lightblue3",
yellow1:"yellow1",yellow2:"yellow2",yellow3:"yellow3",default:"default",bw:"bw",orange:"orange",
turquoise:"turquoise",blue:"blue",sun:"sun",earth:"earth",green:"green",seetang:"seetang",
lightblue:"lightblue",yellow:"yellow",background:"Background",
backgroundobjects:"Background objects",notes:"Notes",outline1:"Outline 1",outline2:"Outline 2",
outline3:"Outline 3",outline4:"Outline 4",outline5:"Outline 5",outline6:"Outline 6",
outline7:"Outline 7",outline8:"Outline 8",outline9:"Outline 9",subtitle:"Subtitle",title:"Title",
"Clear formatting":"Clear formatting","Default Style":"Default Style","Bullet Symbols":"Bullets",
"Numbering Symbols":"Numbering Symbols","Footnote Symbol":"Footnote Characters",
"Page Number":"Page Number","Caption characters":"Caption Characters","Drop Caps":"Drop Caps",
"Internet link":"Internet Link","Visited Internet Link":"Visited Internet Link",
Placeholder:"Placeholder","Index Link":"Index Link","Endnote Symbol":"Endnote Characters",
"Line numbering":"Line Numbering","Main index entry":"Main Index Entry",
"Footnote anchor":"Footnote Anchor","Endnote anchor":"Endnote Anchor",Rubies:"Rubies",
"Vertical Numbering Symbols":"Vertical Numbering Symbols",Emphasis:"Emphasis",Citation:"Quotation",
"Strong Emphasis":"Strong Emphasis","Source Text":"Source Text",Example:"Example",
"User Entry":"User Entry",Variable:"Variable",Definition:"Definition",Teletype:"Teletype",
"Text body":"Text Body",Quotations:"Quotations",Title:"Title",Subtitle:"Subtitle",
"Heading 1":"Heading 1","Heading 2":"Heading 2","Heading 3":"Heading 3",Standard:"Default Style",
Heading:"Heading",List:"List",Caption:"Caption",Index:"Index","Table Contents":"Table Contents",
"First line indent":"First Line Indent","Hanging indent":"Hanging Indent",
"Text body indent":"Text Body Indent",Salutation:"Complimentary Close",Signature:"Signature",
"List Indent":"List Indent",Marginalia:"Marginalia","Heading 4":"Heading 4","Heading 5":"Heading 5",
"Heading 6":"Heading 6","Heading 7":"Heading 7","Heading 8":"Heading 8","Heading 9":"Heading 9",
"Heading 10":"Heading 10","Numbering 1 Start":"Numbering 1 Start","Numbering 1":"Numbering 1",
"Numbering 1 End":"Numbering 1 End","Numbering 1 Cont.":"Numbering 1 Cont.",
"Numbering 2 Start":"Numbering 2 Start","Numbering 2":"Numbering 2",
"Numbering 2 End":"Numbering 2 End","Numbering 2 Cont.":"Numbering 2 Cont.",
"Numbering 3 Start":"Numbering 3 Start","Numbering 3":"Numbering 3",
"Numbering 3 End":"Numbering 3 End","Numbering 3 Cont.":"Numbering 3 Cont.",
"Numbering 4 Start":"Numbering 4 Start","Numbering 4":"Numbering 4",
"Numbering 4 End":"Numbering 4 End","Numbering 4 Cont.":"Numbering 4 Cont.",
"Numbering 5 Start":"Numbering 5 Start","Numbering 5":"Numbering 5",
"Numbering 5 End":"Numbering 5 End","Numbering 5 Cont.":"Numbering 5 Cont.",
"List 1 Start":"List 1 Start","List 1":"List 1","List 1 End":"List 1 End",
"List 1 Cont.":"List 1 Cont.","List 2 Start":"List 2 Start","List 2":"List 2",
"List 2 End":"List 2 End","List 2 Cont.":"List 2 Cont.","List 3 Start":"List 3 Start",
"List 3":"List 3","List 3 End":"List 3 End","List 3 Cont.":"List 3 Cont.",
"List 4 Start":"List 4 Start","List 4":"List 4","List 4 End":"List 4 End",
"List 4 Cont.":"List 4 Cont.","List 5 Start":"List 5 Start","List 5":"List 5",
"List 5 End":"List 5 End","List 5 Cont.":"List 5 Cont.","Index Heading":"Index Heading",
"Index 1":"Index 1","Index 2":"Index 2","Index 3":"Index 3","Index Separator":"Index Separator",
"Contents Heading":"Contents Heading","Contents 1":"Contents 1","Contents 2":"Contents 2",
"Contents 3":"Contents 3","Contents 4":"Contents 4","Contents 5":"Contents 5",
"User Index Heading":"User Index Heading","User Index 1":"User Index 1",
"User Index 2":"User Index 2","User Index 3":"User Index 3","User Index 4":"User Index 4",
"User Index 5":"User Index 5","Contents 6":"Contents 6","Contents 7":"Contents 7",
"Contents 8":"Contents 8","Contents 9":"Contents 9","Contents 10":"Contents 10",
"Illustration Index Heading":"Illustration Index Heading",
"Illustration Index 1":"Illustration Index 1","Object index heading":"Object Index Heading",
"Object index 1":"Object Index 1","Table index heading":"Table Index Heading",
"Table index 1":"Table Index 1","Bibliography Heading":"Bibliography Heading",
"Bibliography 1":"Bibliography 1","User Index 6":"User Index 6","User Index 7":"User Index 7",
"User Index 8":"User Index 8","User Index 9":"User Index 9","User Index 10":"User Index 10",
Header:"Header","Header left":"Header Left","Header right":"Header Right",Footer:"Footer",
"Footer left":"Footer Left","Footer right":"Footer Right","Table Heading":"Table Heading",
Illustration:"Illustration",Table:"Table",Text:"Text","Frame contents":"Frame Contents",
Footnote:"Footnote",Addressee:"Addressee",Sender:"Sender",Endnote:"Endnote",Drawing:"Drawing",
"Preformatted Text":"Preformatted Text","Horizontal Line":"Horizontal Line",
"List Contents":"List Contents","List Heading":"List Heading",Standard:"Default Style",
"First Page":"First Page","Left Page":"Left Page","Right Page":"Right Page",Envelope:"Envelope",
Index:"Index",HTML:"HTML",Footnote:"Footnote",Endnote:"Endnote",Landscape:"Landscape",
Graphics:"Graphics",Frame:"Frame",OLE:"OLE",Formula:"Formula",Marginalia:"Marginalia",
Watermark:"Watermark",Labels:"Labels","Numbering 1":"Numbering 1","Numbering 2":"Numbering 2",
"Numbering 3":"Numbering 3","Numbering 4":"Numbering 4","Numbering 5":"Numbering 5",
"List 1":"List 1","List 2":"List 2","List 3":"List 3","List 4":"List 4","List 5":"List 5"},
impressLayout:[{id:0,text:"Title Slide"},{id:1,text:"Title, Content"},{id:3,
text:"Title and 2 Content"},{id:19,text:"Title Only"},{id:20,text:"Blank Slide"},{id:32,
text:"Centered Text"},{id:12,text:"Title, Content and 2 Content"},{id:15,
text:"Title, 2 Content and Content"},{id:16,text:"Title, 2 Content over Content"},{id:14,
text:"Title, Content over Content"},{id:18,text:"Title, 4 Content"},{id:34,text:"Title, 6 Content"},
{id:27,text:"Vertical Title, Text, Chart"},{id:28,text:"Vertical Title, Vertical Text"},{id:29,
text:"Title, Vertical Text"},{id:30,text:"Title, Vertical Text, Clipart"}],insertMode:{
true:"Insert",false:"Overwrite"},selectionMode:["Standard selection","Extending selection",
"Adding selection","Block selection"]};var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};var Ruler=function(){function Ruler(options){this.options=__assign({
interactive:true,marginSet:false,displayNumber:true,tileMargin:18,margin1:null,margin2:null,
leftOffset:null,pageOffset:null,pageWidth:null,pageTopMargin:null,pageBottomMargin:null,
firstLineIndent:null,leftParagraphIndent:null,rightParagraphIndent:null,tabs:"",unit:null,
DraggableConvertRatio:null,timer:null,showruler:true,position:"topleft",disableMarker:false},options
)}Ruler.prototype._updatePaintTimer=function(){clearTimeout(this.options.timer);
this.options.timer=setTimeout(window.L.bind(this._updateBreakPoints,this),300)};
Ruler.prototype.getWindowProperty=function(propertyName){return window[propertyName]};
Ruler.initializeRuler=function(map,options){var _a;var isRTL=document.documentElement.dir==="rtl";
var interactiveRuler=map.isEditMode();var showRuler=(_a=options.showruler
)!==null&&_a!==void 0?_a:true;new HRuler(map,{position:isRTL?"topright":"topleft",
interactive:interactiveRuler,showruler:showRuler});if(!map.isPresentationOrDrawing()){new VRuler(map
,{position:isRTL?"topright":"topleft",interactive:interactiveRuler,showruler:showRuler})}map.fire(
"rulerchanged")};return Ruler}();app.definitions.ruler=Ruler;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var VRuler=function(_super){__extends(VRuler,_super);
function VRuler(map,options){var _this=_super.call(this,options)||this;Object.assign(_this.options,
options);_this._map=map;_this.onAdd();return _this}VRuler.prototype.onAdd=function(){this._map.on(
"vrulerupdate",this._updateOptions,this);this._map.on("scrolllimits",this._updatePaintTimer,this);
this._map.on("moveend",this._fixOffset,this);app.events.on("updatepermission",
this._changeInteractions.bind(this));this._map.on("resettopbottompagespacing",
this._resetTopBottomPageSpacing,this);this._map.on("commandstatechanged",this.onCommandStateChanged,
this);this._map.on("rulerchanged",this._onRulerChanged,this);window.L.DomUtil.addClass(
this._map.getContainer(),"hasruler");var container=this._initLayout();
var corner=this._map._controlCorners[this.options.position];window.L.DomUtil.addClass(container,
"leaflet-control");if(this.options.position.indexOf("bottom")!==-1){corner.insertBefore(container,
corner.firstChild)}else{corner.appendChild(container)}};VRuler.prototype.onRemove=function(){
this._map.off("vrulerupdate",this._updateOptions,this);this._map.off("scrolllimits",
this._updatePaintTimer,this);this._map.off("moveend",this._fixOffset,this);app.events.off(
"updatepermission",this._changeInteractions.bind(this));this._map.off("resettopbottompagespacing",
this._resetTopBottomPageSpacing,this);this._map.off("commandstatechanged",this.onCommandStateChanged
,this);this._map.off("rulerchanged",this._onRulerChanged,this)};
VRuler.prototype._resetTopBottomPageSpacing=function(e){this.options.pageTopMargin=undefined;
this.options.pageBottomMargin=undefined;if(e)this.options.disableMarker=e.disableMarker};
VRuler.prototype.onCommandStateChanged=function(e){if(e.commandName==".uno:StyleApply"
)this._resetTopBottomPageSpacing()};VRuler.prototype._changeInteractions=function(e){if(
this._tMarginDrag){if(e.detail.perm==="edit"){this._tMarginDrag.style.cursor="e-resize";
this._bMarginDrag.style.cursor="w-resize"}else{this._tMarginDrag.style.cursor="default";
this._bMarginDrag.style.cursor="default"}}};VRuler.prototype._initiateIndentationMarkers=function(){
this._pVerticalStartMarker=document.createElement("div");
this._pVerticalStartMarker.id="lo-vertical-pstart-marker";this._pVerticalStartMarker.classList.add(
"cool-ruler-indentation-marker-up");this._rFace.appendChild(this._pVerticalStartMarker);
this._pVerticalEndMarker=document.createElement("div");
this._pVerticalEndMarker.id="lo-vertical-pend-marker";this._pVerticalEndMarker.classList.add(
"cool-ruler-indentation-marker-up");this._rFace.appendChild(this._pVerticalEndMarker);
this._markerHorizontalLine=window.L.DomUtil.create("div",
"cool-ruler-horizontal-indentation-marker-center");this._rFace.appendChild(
this._markerHorizontalLine);window.L.DomEvent.on(this._pVerticalStartMarker,"mousedown",
window.touch.mouseOnly(this._initiateIndentationDrag),this);window.L.DomEvent.on(
this._pVerticalEndMarker,"mousedown",window.touch.mouseOnly(this._initiateIndentationDrag),this)};
VRuler.prototype._initLayout=function(){this._rWrapper=window.L.DomUtil.create("div",
"cool-ruler leaflet-bar leaflet-control leaflet-control-custom");this._rWrapper.id="vertical-ruler";
this._rWrapper.classList.add("vruler");this._rWrapper.style.visibility="hidden";if(
!this.options.showruler){window.L.DomUtil.setStyle(this._rWrapper,"display","none")}
this._rFace=window.L.DomUtil.create("div","cool-ruler-face",this._rWrapper);
this._rMarginWrapper=window.L.DomUtil.create("div","cool-ruler-marginwrapper",this._rFace);
this._rBPWrapper=window.L.DomUtil.create("div","cool-ruler-breakwrapper",this._rFace);
this._rBPContainer=window.L.DomUtil.create("div","cool-ruler-breakcontainer",this._rBPWrapper);
this._rTSContainer=window.L.DomUtil.create("div","cool-ruler-tabstopcontainer",this._rMarginWrapper)
this._initiateIndentationMarkers();return this._rWrapper};VRuler.prototype._onRulerChanged=function(
){this.options.showruler=this._map.uiManager.getBooleanDocTypePref("ShowRuler",true);if(
this.options.showruler){this._fixOffset()}};VRuler.prototype._updateOptions=function(obj){
this.options.margin1=obj["margin1"];this.options.margin2=obj["margin2"];this.options.leftOffset=obj[
"leftOffset"];this.options.pageOffset=obj["pageOffset"];this.options.pageWidth=obj["pageWidth"];if(
!this.options.pageTopMargin&&!this.options.pageBottomMargin){
this.options.pageTopMargin=this.options.leftOffset;
this.options.pageBottomMargin=this.options.leftOffset}this._rWrapper.style.visibility="";
this._rWrapper.style.transform="rotate(90deg)";
var position=document.documentElement.dir==="rtl"?"top right":"top left";
this._rWrapper.style.transformOrigin=position;this._rWrapper.style.left="var(--ruler-height)";
this._updateBreakPoints()};VRuler.prototype._updateParagraphIndentations=function(){if(
!this.options.showruler)return;var documentTop=document.getElementById("document-container"
).getBoundingClientRect().top;var pStartPosition=this._rTSContainer.getBoundingClientRect(
).top-documentTop;var pEndPosition=this._rTSContainer.getBoundingClientRect().bottom-documentTop;
this._pVerticalStartMarker.style.left=pStartPosition-this._pVerticalStartMarker.getBoundingClientRect(
).width/2+"px";this._pVerticalStartMarker.style.display="block";
this._pVerticalEndMarker.style.left=pEndPosition-this._pVerticalEndMarker.getBoundingClientRect(
).width+"px";this._pVerticalEndMarker.style.display="block";
this._markerHorizontalLine.style.top="-100vw";
this._markerHorizontalLine.style.left=this._pVerticalStartMarker.style.left;if(
this.options.disableMarker){this._pVerticalStartMarker.style.display="none";
this._pVerticalEndMarker.style.display="none"}};VRuler.prototype._updateBreakPoints=function(){if(
this.options.margin1==null||this.options.margin2==null)return;var topMargin=this.options.leftOffset;
var docLayer=this._map._docLayer;var bottomMargin=this.options.pageWidth-(
this.options.leftOffset+this.options.margin2);this.options.pageBottomMargin=bottomMargin;
var scale=this._map.getZoomScale(this._map.getZoom(),10);
var wPixel=docLayer._docPixelSize.y/docLayer._pages-this.options.tileMargin*2*scale;this._fixOffset(
);this.options.DraggableConvertRatio=wPixel/this.options.pageWidth;
this._rFace.style.width=wPixel+"px";this._rBPContainer.style.marginLeft=-1*(
this.options.DraggableConvertRatio*(500-topMargin%1e3))+1+"px";var numCounter=-1*Math.floor(
topMargin/1e3);window.L.DomUtil.removeChildNodes(this._rBPContainer);for(
var num=0;num<=this.options.pageWidth/1e3+1;num++){var marker=window.L.DomUtil.create("div",
"cool-ruler-maj",this._rBPContainer);
marker.style.width=this.options.DraggableConvertRatio*1e3-1+"px";if(this.options.displayNumber){
marker.innerText=Math.abs(numCounter);numCounter++}}if(!this.options.marginSet){
this.options.marginSet=true;this._tMarginMarker=window.L.DomUtil.create("div",
"cool-ruler-margin cool-ruler-left",this._rFace);this._bMarginMarker=window.L.DomUtil.create("div",
"cool-ruler-margin cool-ruler-right",this._rFace);this._tMarginDrag=window.L.DomUtil.create("div",
"cool-ruler-drag cool-ruler-left",this._rMarginWrapper);this._bMarginDrag=window.L.DomUtil.create(
"div","cool-ruler-drag cool-ruler-right",this._rMarginWrapper);var topMarginTooltipText=_(
"Top Margin");var bottomMarginTooltipText=_("Bottom Margin");
this._tMarginDrag.dataset.title=topMarginTooltipText;
this._bMarginDrag.dataset.title=bottomMarginTooltipText}
this._tMarginMarker.style.width=this.options.DraggableConvertRatio*topMargin+"px";
this._bMarginMarker.style.width=this.options.DraggableConvertRatio*bottomMargin+"px";
this._tMarginDrag.style.width=this.options.DraggableConvertRatio*topMargin+"px";
this._bMarginDrag.style.width=this.options.DraggableConvertRatio*bottomMargin+"px";
this._rTSContainer.style.left=this.options.DraggableConvertRatio*topMargin+"px";
this._rTSContainer.style.right=this.options.DraggableConvertRatio*bottomMargin+"px";
this._updateParagraphIndentations();if(this.options.interactive){this._changeInteractions({detail:{
perm:"edit"}})}else{this._changeInteractions({detail:{perm:"readonly"}})}};
VRuler.prototype._fixOffset=function(){if(!this._map.options.docBounds||!this.options.showruler
)return;var currentPage=Math.floor(this.options.pageOffset/this.options.pageWidth);var pageoffset=0;
if(this._map._docLayer._docPixelSize)pageoffset=currentPage*(
this._map._docLayer._docPixelSize.y/this._map._docLayer._pages);
var rulerOffset=-app.activeDocument.activeView.viewedRectangle.cY1+this.options.tileMargin*app.getScale(
)+pageoffset;this._rFace.style.marginInlineStart=rulerOffset+"px";this._updateParagraphIndentations(
)};VRuler.prototype._moveIndentation=function(e){if(e.type==="panmove"){e.clientX=e.center.x}
var element=document.getElementById(this._indentationElementId);
var documentTop=document.getElementById("document-container").getBoundingClientRect().top;
var newLeft=parseInt(element.style.left.replace("px",""))+e.clientY-this._lastposition-documentTop;
element.style.left=String(newLeft)+"px";this._lastposition=e.clientY-documentTop;var halfWidth=(
element.getBoundingClientRect().right-element.getBoundingClientRect().left)*.5;
this._markerHorizontalLine.style.left=String(newLeft+halfWidth)+"px"};
VRuler.prototype._moveIndentationEnd=function(e){this._map.rulerActive=false;if(e.type!=="panend"){
window.L.DomEvent.off(this._rFace,"mousemove",this._moveIndentation,this);window.L.DomEvent.off(
this._map,"mouseup",this._moveIndentationEnd,this)}var element=document.getElementById(
this._indentationElementId);var halfWidth=(element.getBoundingClientRect(
).bottom-element.getBoundingClientRect().top)*.5;var params={};var upperMargin="Space.Upper";
var lowerMargin="Space.Lower";if(this._pVerticalStartMarker.getBoundingClientRect(
).top>this._pVerticalEndMarker.getBoundingClientRect().top){this._fixOffset()}else if(
element.id=="lo-vertical-pstart-marker"){
var topMarginPX=this._pVerticalStartMarker.getBoundingClientRect(
).top-this._rTSContainer.getBoundingClientRect().top+halfWidth;
var top_1=topMarginPX/this.options.DraggableConvertRatio+this.options.pageTopMargin;
this.options.pageTopMargin=top_1<0?this.options.pageTopMargin:top_1}else if(
element.id=="lo-vertical-pend-marker"){var bottomMarginPX=this._rTSContainer.getBoundingClientRect(
).bottom-this._pVerticalEndMarker.getBoundingClientRect().bottom+halfWidth;
var bottom=bottomMarginPX/this.options.DraggableConvertRatio+this.options.pageBottomMargin;
this.options.pageBottomMargin=bottom<0?this.options.pageBottomMargin:bottom}params[upperMargin]={
type:"long",value:this.options.pageTopMargin};params[lowerMargin]={type:"long",
value:this.options.pageBottomMargin};this._map.sendUnoCommand(".uno:SetLongTopBottomMargin",params);
this._indentationElementId="";this._markerHorizontalLine.style.display="none"};
VRuler.prototype._initiateIndentationDrag=function(e){if(this.getWindowProperty("ThisIsTheiOSApp"
)&&!this._map.isEditMode())return;this._map.rulerActive=true;
this._indentationElementId=e.target.id.trim()===""?e.target.parentNode.id:e.target.id;if(
e.type!=="panstart"){window.L.DomEvent.on(this._rFace,"mousemove",this._moveIndentation,this);
window.L.DomEvent.on(this._map,"mouseup",this._moveIndentationEnd,this)}else{e.clientX=e.center.x}
var documentTop=document.getElementById("document-container").getBoundingClientRect().top;
this._initialposition=this._lastposition=e.clientY-documentTop;
this._markerHorizontalLine.style.display="block";
this._markerHorizontalLine.style.left=this._lastposition+"px"};return VRuler}(Ruler);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var HRuler=function(_super){__extends(HRuler,_super);function HRuler(map,options){
var _this=_super.call(this,options)||this;_this._map=map;Object.assign(_this.options,options);
_this.onAdd();if(app.map._docLayer._docType==="presentation")_this.options.tileMargin=0;return _this
}HRuler.prototype.onAdd=function(){this._map.on("rulerupdate",this._updateOptions,this);
this._map.on("tabstoplistupdate",this._updateTabStops,this);this._map.on("scrolllimits",
this._updatePaintTimer,this);this._map.on("moveend fixruleroffset",this._fixOffset,this);
this._map.on("updatepermission",this._changeInteractions,this);window.L.DomUtil.addClass(
this._map.getContainer(),"hasruler");var container=this._initLayout();
var corner=this._map._controlCorners[this.options.position];window.L.DomUtil.addClass(container,
"leaflet-control");if(this.options.position.indexOf("bottom")!==-1){corner.insertBefore(container,
corner.firstChild)}else{corner.appendChild(container)}};HRuler.prototype.onRemove=function(){
this._map.off("rulerupdate",this._updateOptions,this);this._map.off("tabstoplistupdate",
this._updateTabStops,this);this._map.off("scrolllimits",this._updatePaintTimer,this);this._map.off(
"moveend fixruleroffset",this._fixOffset,this);this._map.off("updatepermission",
this._changeInteractions,this)};HRuler.prototype._changeInteractions=function(e){if(
this._lMarginDrag){if(e.perm==="edit"){this._lMarginDrag.style.cursor="e-resize";
this._rMarginDrag.style.cursor="w-resize";if(!this.getWindowProperty("ThisIsTheiOSApp")){
window.L.DomEvent.on(this._rMarginDrag,"mousedown",this._initiateDrag,this);window.L.DomEvent.on(
this._lMarginDrag,"mousedown",this._initiateDrag,this)}}else{
this._lMarginDrag.style.cursor="default";this._rMarginDrag.style.cursor="default";if(
!this.getWindowProperty("ThisIsTheiOSApp")){window.L.DomEvent.off(this._rMarginDrag,"mousedown",
this._initiateDrag,this);window.L.DomEvent.off(this._lMarginDrag,"mousedown",this._initiateDrag,this
)}}}};HRuler.prototype._initiateIndentationMarkers=function(){var _this=this;
this._firstLineMarker=document.createElement("div");this._firstLineMarker.id="lo-fline-marker";
this._firstLineMarker.classList.add("cool-ruler-indentation-marker-down");this._rFace.appendChild(
this._firstLineMarker);this._pStartMarker=document.createElement("div");
this._pStartMarker.id="lo-pstart-marker";this._pStartMarker.classList.add(
"cool-ruler-indentation-marker-up");this._rFace.appendChild(this._pStartMarker);
this._pEndMarker=document.createElement("div");this._pEndMarker.id="lo-pend-marker";
this._pEndMarker.classList.add("cool-ruler-indentation-marker-up");this._rFace.appendChild(
this._pEndMarker);this._markerVerticalLine=window.L.DomUtil.create("div",
"cool-ruler-indentation-marker-center");this._rFace.appendChild(this._markerVerticalLine);
this._firstLineHammer=new Hammer(this._firstLineMarker);this._firstLineHammer.add(new Hammer.Pan({
threshold:0,pointers:0}));this._firstLineHammer.get("press").set({time:500});
this._firstLineHammer.on("panstart",window.touch.touchOnly(function(event){
_this._initiateIndentationDrag(event)}));this._firstLineHammer.on("panmove",window.touch.touchOnly(
function(event){_this._moveIndentation(event)}));this._firstLineHammer.on("panend",
window.touch.touchOnly(function(event){_this._moveIndentationEnd(event)}));
this._pStartHammer=new Hammer(this._pStartMarker);this._pStartHammer.add(new Hammer.Pan({
threshold:0,pointers:0}));this._pStartHammer.get("press").set({time:500});this._pStartHammer.on(
"panstart",window.touch.touchOnly(function(event){_this._initiateIndentationDrag(event)}));
this._pStartHammer.on("panmove",window.touch.touchOnly(function(event){_this._moveIndentation(event)
}));this._pStartHammer.on("panend",window.touch.touchOnly(function(event){_this._moveIndentationEnd(
event)}));this._pEndHammer=new Hammer(this._pEndMarker);this._pEndHammer.add(new Hammer.Pan({
threshold:0,pointers:0}));this._pEndHammer.get("press").set({time:500});this._pEndHammer.on(
"panstart",window.touch.touchOnly(function(event){_this._initiateIndentationDrag(event)}));
this._pEndHammer.on("panmove",window.touch.touchOnly(function(event){_this._moveIndentation(event)})
);this._pEndHammer.on("panend",window.touch.touchOnly(function(event){_this._moveIndentationEnd(
event)}));window.L.DomEvent.on(this._firstLineMarker,"mousedown",window.touch.mouseOnly(
this._initiateIndentationDrag),this);window.L.DomEvent.on(this._pStartMarker,"mousedown",
window.touch.mouseOnly(this._initiateIndentationDrag),this);window.L.DomEvent.on(this._pEndMarker,
"mousedown",window.touch.mouseOnly(this._initiateIndentationDrag),this)};
HRuler.prototype._initLayout=function(){this._rWrapper=window.L.DomUtil.create("div",
"cool-ruler leaflet-bar leaflet-control leaflet-control-custom");
this._rWrapper.style.visibility="hidden";if(!this.options.showruler){window.L.DomUtil.setStyle(
this._rWrapper,"display","none")}this._rFace=window.L.DomUtil.create("div","cool-ruler-face",
this._rWrapper);this._rMarginWrapper=window.L.DomUtil.create("div","cool-ruler-marginwrapper",
this._rFace);this._rBPWrapper=window.L.DomUtil.create("div","cool-ruler-breakwrapper",this._rFace);
this._rBPContainer=window.L.DomUtil.create("div","cool-ruler-breakcontainer",this._rBPWrapper);
this._rTSContainer=window.L.DomUtil.create("div","cool-ruler-horizontal-tabstopcontainer",
this._rMarginWrapper);window.L.DomEvent.on(this._rTSContainer,"mousedown",this._initiateTabstopDrag,
this);this._hammer=new Hammer(this._rTSContainer);this._hammer.add(new Hammer.Pan({threshold:0,
pointers:0}));this._hammer.get("press").set({time:500});this._hammer.on("panstart",
window.touch.touchOnly(function(event){this._initiateTabstopDrag(event)}));this._hammer.on("panmove"
,window.touch.touchOnly(function(event){this._moveTabstop(event)}));this._hammer.on("panend",
window.touch.touchOnly(function(event){this._endTabstopDrag(event)}));this._hammer.on("press",
window.touch.touchOnly(function(event){this._onTabstopContainerLongPress(event)}));
this._initiateIndentationMarkers();return this._rWrapper};HRuler.prototype._updateOptions=function(
obj){this.options.margin1=obj["margin1"];this.options.margin2=obj["margin2"];
this.options.leftOffset=obj["leftOffset"];this.options.pageWidth=obj["pageWidth"];
this._updateBreakPoints();this._rWrapper.style.visibility=""};
HRuler.prototype._updateParagraphIndentations=function(){var items=this._map["stateChangeHandler"];
var state=items.getItemValue(".uno:LeftRightParaMargin");
var conversionFactorToInches=app.map.isPresentationOrDrawing()?1.76:1;if(!state)return;
this.options.firstLineIndent=parseFloat(state.firstline.replace(",","."))/conversionFactorToInches;
this.options.leftParagraphIndent=parseFloat(state.left.replace(",","."))/conversionFactorToInches;
this.options.rightParagraphIndent=parseFloat(state.right.replace(",","."))/conversionFactorToInches;
this.options.unit=state.unit;var pxPerMm100=app.map._docLayer._docPixelSize.x/(
app.activeDocument.fileSize.x*2540/1440);if(this.options.unit==="inch"){
this.options.firstLineIndent=this.options.firstLineIndent*2540;
this.options.leftParagraphIndent=this.options.leftParagraphIndent*2540;
this.options.rightParagraphIndent=this.options.rightParagraphIndent*2540}
this.options.firstLineIndent*=pxPerMm100;this.options.leftParagraphIndent*=pxPerMm100;
this.options.rightParagraphIndent*=pxPerMm100;
var navigationsidebarWidth=this._getNavigationSidebarWidth();
var pStartPosition=this._rTSContainer.getBoundingClientRect(
).left+this.options.leftParagraphIndent-navigationsidebarWidth;
var fLinePosition=pStartPosition+this.options.firstLineIndent;
var pEndPosition=this._rTSContainer.getBoundingClientRect(
).right-this.options.rightParagraphIndent-navigationsidebarWidth;
this._firstLineMarker.style.left=fLinePosition-this._firstLineMarker.getBoundingClientRect(
).width/2+"px";
this._pStartMarker.style.left=pStartPosition-this._pStartMarker.getBoundingClientRect().width/2+"px"
this._pEndMarker.style.left=pEndPosition-this._pEndMarker.getBoundingClientRect().width/2+"px";
this._markerVerticalLine.style.top=this._rTSContainer.getBoundingClientRect().bottom+"px"};
HRuler.prototype._updateTabStops=function(obj){var e_1,_a;this.options.tabs=[];var jsonTabstops=obj[
"tabstops"];if(jsonTabstops==="")return;if(typeof jsonTabstops==="string"||jsonTabstops.length===0
)return;try{for(var jsonTabstops_1=__values(jsonTabstops),jsonTabstops_1_1=jsonTabstops_1.next(
);!jsonTabstops_1_1.done;jsonTabstops_1_1=jsonTabstops_1.next()){
var jsonTabstop=jsonTabstops_1_1.value;this.options.tabs.push({position:parseInt(
jsonTabstop.position),style:parseInt(jsonTabstop.type)});this._updateBreakPoints()}}catch(e_1_1){
e_1={error:e_1_1}}finally{try{if(jsonTabstops_1_1&&!jsonTabstops_1_1.done&&(_a=jsonTabstops_1.return
))_a.call(jsonTabstops_1)}finally{if(e_1)throw e_1.error}}};
HRuler.prototype._updateBreakPointsImpress=function(){if(
this.options.margin1==null||this.options.margin2==null)return;
var leftPageMargin=this.options.leftOffset;var rightPageMargin=this.options.pageWidth-(
this.options.leftOffset+this.options.margin2);var scale=app.map.getZoomScale(this._map.getZoom(),10)
var rulerWidth=app.activeDocument.fileSize.cX-this.options.tileMargin*2*scale;
var rulerWidthCM=Math.floor(rulerWidth*.026458);var pageWidthCM=this.options.pageWidth/1e3;
var numbersPerCM=pageWidthCM/rulerWidthCM;var increaseBy=Math.round(numbersPerCM+.5);
var markerWidthPx=increaseBy/numbersPerCM*(1/.026458);this._fixOffset();
this.options.DraggableConvertRatio=rulerWidth/this.options.pageWidth;
this._rFace.style.width=rulerWidth+"px";this._rBPContainer.style.marginLeft=-1*(
this.options.DraggableConvertRatio*(500-leftPageMargin%1e3))+1+"px";
this._rBPContainer.replaceChildren();var numCounter=-1*Math.floor(leftPageMargin/1e3);for(
var num=0;num<=this.options.pageWidth/1e3+1;num++){var marker=window.L.DomUtil.create("div",
"cool-ruler-maj",this._rBPContainer);marker.style.width=(
numCounter!==0?markerWidthPx:markerWidthPx*.5)-1+"px";if(this.options.displayNumber){if(
numCounter!==0)marker.innerText=numCounter}numCounter+=increaseBy}
this._rTSContainer.replaceChildren();var pxPerMm100=app.map._docLayer._docPixelSize.x/(
app.activeDocument.fileSize.x*2540/1440);this._rTSContainer.tabStops=[];for(
var tabstopIndex=0;tabstopIndex<this.options.tabs.length;tabstopIndex++){var markerClass=null;
var currentTabstop=this.options.tabs[tabstopIndex];switch(currentTabstop.style){case 0:
markerClass="cool-ruler-tabstop-left";break;case 1:markerClass="cool-ruler-tabstop-right";break;
case 2:markerClass="cool-ruler-tabstop-center";break;case 3:markerClass="cool-ruler-tabstop-decimal"
break}if(markerClass!=null){marker=window.L.DomUtil.create("div",markerClass,this._rTSContainer);
var positionPixel=currentTabstop.position*pxPerMm100;var markerWidth=marker.offsetWidth;
var markerHalfWidth=markerWidth/2;marker.tabStopLocation={left:positionPixel-markerHalfWidth,
center:positionPixel,right:positionPixel+markerHalfWidth};
marker.style.left=marker.tabStopLocation.left+"px";marker.tabStopNumber=tabstopIndex;
this._rTSContainer.tabStops[tabstopIndex]=marker;marker.style.cursor="move"}}if(
!this.options.marginSet){this.options.marginSet=true;this._lMarginMarker=window.L.DomUtil.create(
"div","cool-ruler-margin cool-ruler-left",this._rFace);this._rMarginMarker=window.L.DomUtil.create(
"div","cool-ruler-margin cool-ruler-right",this._rFace);this._lMarginDrag=window.L.DomUtil.create(
"div","cool-ruler-drag cool-ruler-left",this._rMarginWrapper);
this._lToolTip=window.L.DomUtil.create("div","cool-ruler-ltooltip",this._lMarginDrag);
this._rMarginDrag=window.L.DomUtil.create("div","cool-ruler-drag cool-ruler-right",
this._rMarginWrapper);this._rToolTip=window.L.DomUtil.create("div","cool-ruler-rtooltip",
this._rMarginDrag);var lMarginTooltipText=_("Left Margin");var rMarginTooltipText=_("Right Margin");
this._lMarginDrag.dataset.title=lMarginTooltipText;
this._rMarginDrag.dataset.title=rMarginTooltipText}
this._lMarginMarker.style.width=this.options.DraggableConvertRatio*leftPageMargin+"px";
this._rMarginMarker.style.width=this.options.DraggableConvertRatio*rightPageMargin+"px";
this._lMarginDrag.style.width=this.options.DraggableConvertRatio*leftPageMargin+"px";
this._rMarginDrag.style.width=this.options.DraggableConvertRatio*rightPageMargin+"px";
this._rTSContainer.style.left=this.options.DraggableConvertRatio*leftPageMargin+"px";
this._rTSContainer.style.right=this.options.DraggableConvertRatio*rightPageMargin+"px";
this._updateParagraphIndentations();if(this.options.interactive){this._changeInteractions({
perm:"edit"})}else{this._changeInteractions({perm:"readonly"})}};
HRuler.prototype._updateBreakPoints=function(){if(
this.options.margin1==null||this.options.margin2==null)return;if(
app.map._docLayer._docType==="presentation"){this._updateBreakPointsImpress();return}var lMargin,
rMargin,wPixel,scale;lMargin=this.options.leftOffset;rMargin=this.options.pageWidth-(
this.options.leftOffset+this.options.margin2);scale=this._map.getZoomScale(this._map.getZoom(),10);
wPixel=this._map._docLayer._docPixelSize.x-this.options.tileMargin*2*scale;this._fixOffset();
this.options.DraggableConvertRatio=wPixel/this.options.pageWidth;this._rFace.style.width=wPixel+"px"
this._rBPContainer.style.marginLeft=-1*(this.options.DraggableConvertRatio*(500-lMargin%1e3))+1+"px"
var numCounter=-1*Math.floor(lMargin/1e3);window.L.DomUtil.removeChildNodes(this._rBPContainer);for(
var num=0;num<=this.options.pageWidth/1e3+1;num++){var marker=window.L.DomUtil.create("div",
"cool-ruler-maj",this._rBPContainer);
marker.style.width=this.options.DraggableConvertRatio*1e3-1+"px";if(this.options.displayNumber){if(
numCounter!==0)marker.innerText=Math.abs(numCounter++);else numCounter++}}
window.L.DomUtil.removeChildNodes(this._rTSContainer);
var pxPerMm100=this._map._docLayer._docPixelSize.x/(app.activeDocument.fileSize.x*2540/1440);
this._rTSContainer.tabStops=[];for(
var tabstopIndex=0;tabstopIndex<this.options.tabs.length;tabstopIndex++){var markerClass=null;
var currentTabstop=this.options.tabs[tabstopIndex];switch(currentTabstop.style){case 0:
markerClass="cool-ruler-tabstop-left";break;case 1:markerClass="cool-ruler-tabstop-right";break;
case 2:markerClass="cool-ruler-tabstop-center";break;case 3:markerClass="cool-ruler-tabstop-decimal"
break}if(markerClass!=null){marker=window.L.DomUtil.create("div",markerClass,this._rTSContainer);
var positionPixel=currentTabstop.position*pxPerMm100;var markerWidth=marker.offsetWidth;
var markerHalfWidth=markerWidth/2;marker.tabStopLocation={left:positionPixel-markerHalfWidth,
center:positionPixel,right:positionPixel+markerHalfWidth};
marker.style.left=marker.tabStopLocation.left+"px";marker.tabStopNumber=tabstopIndex;
this._rTSContainer.tabStops[tabstopIndex]=marker;marker.style.cursor="move"}}if(
!this.options.marginSet){this.options.marginSet=true;this._lMarginMarker=window.L.DomUtil.create(
"div","cool-ruler-margin cool-ruler-left",this._rFace);this._rMarginMarker=window.L.DomUtil.create(
"div","cool-ruler-margin cool-ruler-right",this._rFace);this._lMarginDrag=window.L.DomUtil.create(
"div","cool-ruler-drag cool-ruler-left",this._rMarginWrapper);
this._lToolTip=window.L.DomUtil.create("div","cool-ruler-ltooltip",this._lMarginDrag);
this._rMarginDrag=window.L.DomUtil.create("div","cool-ruler-drag cool-ruler-right",
this._rMarginWrapper);this._rToolTip=window.L.DomUtil.create("div","cool-ruler-rtooltip",
this._rMarginDrag);var lMarginTooltipText=_("Left Margin");var rMarginTooltipText=_("Right Margin");
this._lMarginDrag.dataset.title=lMarginTooltipText;
this._rMarginDrag.dataset.title=rMarginTooltipText}
this._lMarginMarker.style.width=this.options.DraggableConvertRatio*lMargin+"px";
this._rMarginMarker.style.width=this.options.DraggableConvertRatio*rMargin+"px";
this._lMarginDrag.style.width=this.options.DraggableConvertRatio*lMargin+"px";
this._rMarginDrag.style.width=this.options.DraggableConvertRatio*rMargin+"px";
this._rTSContainer.style.left=this.options.DraggableConvertRatio*lMargin+"px";
this._rTSContainer.style.right=this.options.DraggableConvertRatio*rMargin+"px";
this._updateParagraphIndentations();if(this.options.interactive){this._changeInteractions({
perm:"edit"})}else{this._changeInteractions({perm:"readonly"})}};
HRuler.prototype._fixOffset=function(){if(!this._map.options.docBounds)return;
var rulerOffset=-app.activeDocument.activeView.viewedRectangle.cX1+this.options.tileMargin*app.getScale(
);this._rFace.style.marginInlineStart=rulerOffset+"px";this._updateParagraphIndentations()};
HRuler.prototype._moveIndentation=function(e){if(e.type==="panmove"){e.clientX=e.center.x}
var element=document.getElementById(this._indentationElementId);var newLeft=parseInt(
element.style.left.replace("px",""))+e.clientX-this._lastposition;element.style.left=String(newLeft
)+"px";this._lastposition=e.clientX;var halfWidth=(element.getBoundingClientRect(
).right-element.getBoundingClientRect().left)*.5;this._markerVerticalLine.style.left=String(
newLeft+halfWidth+this._getNavigationSidebarWidth())+"px"};
HRuler.prototype._moveIndentationEnd=function(e){this._map.rulerActive=false;if(e.type!=="panend"){
window.L.DomEvent.off(this._rFace,"mousemove",this._moveIndentation,this);window.L.DomEvent.off(
this._map,"mouseup",this._moveIndentationEnd,this)}var unoObj={};
var element=document.getElementById(this._indentationElementId);var halfWidth=(
element.getBoundingClientRect().right-element.getBoundingClientRect().left)*.5;
var firstLineMargin=this.options.firstLineIndent/this.options.DraggableConvertRatio;
var leftValue=this.options.leftParagraphIndent/this.options.DraggableConvertRatio;
var rightValue=this.options.rightParagraphIndent/this.options.DraggableConvertRatio;if(
element.id==="lo-fline-marker"){firstLineMargin=Math.ceil((
this._firstLineMarker.getBoundingClientRect().left-this._pStartMarker.getBoundingClientRect(
).left+halfWidth)/this.options.DraggableConvertRatio);
this.options.firstLineIndent=firstLineMargin*this.options.DraggableConvertRatio}else if(
element.id==="lo-pend-marker"){rightValue=Math.ceil((this._rTSContainer.getBoundingClientRect(
).right-this._pEndMarker.getBoundingClientRect().right+halfWidth)/this.options.DraggableConvertRatio
)}else if(element.id==="lo-pstart-marker"){leftValue=Math.ceil((
this._pStartMarker.getBoundingClientRect().left-this._rTSContainer.getBoundingClientRect(
).left+halfWidth)/this.options.DraggableConvertRatio)}unoObj["LRSpace.FirstLineIndent"]={
type:"long",value:firstLineMargin};unoObj["LRSpace.LeftMargin"]={type:"long",value:leftValue};
unoObj["LRSpace.RightMargin"]={type:"long",value:rightValue};this._map.sendUnoCommand(
".uno:LeftRightParaMargin",unoObj);this._indentationElementId="";
this._markerVerticalLine.style.display="none"};HRuler.prototype._initiateIndentationDrag=function(e
){if(window.ThisIsTheiOSApp&&!this._map.isEditMode())return;this._map.rulerActive=true;
this._indentationElementId=e.target.id.trim()===""?e.target.parentNode.id:e.target.id;if(
e.type!=="panstart"){window.L.DomEvent.on(this._rFace,"mousemove",this._moveIndentation,this);
window.L.DomEvent.on(this._map,"mouseup",this._moveIndentationEnd,this)}else{e.clientX=e.center.x}
this._initialposition=this._lastposition=e.clientX;this._markerVerticalLine.style.display="block";
this._markerVerticalLine.style.left=this._lastposition+"px"};
HRuler.prototype._initiateDrag=function(e){if(e.type==="touchstart"){if(e.touches.length!==1)return;
e.clientX=e.touches[0].clientX}if(this.getWindowProperty("ThisIsTheiOSApp")&&!this._map.isEditMode()
)return;this._map.rulerActive=true;var dragableElem=e.srcElement||e.target;window.L.DomEvent.on(
this._rFace,"mousemove",this._moveMargin,this);window.L.DomEvent.on(this._map,"mouseup",
this._endDrag,this);this._initialposition=e.clientX;this._lastposition=this._initialposition;if(
window.L.DomUtil.hasClass(dragableElem,"cool-ruler-right")){window.L.DomUtil.addClass(
this._rMarginDrag,"leaflet-drag-moving");this._rFace.style.cursor="w-resize"}else{
window.L.DomUtil.addClass(this._lMarginDrag,"leaflet-drag-moving");
this._rFace.style.cursor="e-resize"}};HRuler.prototype._moveMargin=function(e){if(
e.type==="touchmove")e.clientX=e.touches[0].clientX;this._lastposition=e.clientX;
var posChange=e.clientX-this._initialposition;var unit=this.options.unit?this.options.unit:" cm";if(
window.L.DomUtil.hasClass(this._rMarginDrag,"leaflet-drag-moving")){
var rMargin=this.options.pageWidth-(this.options.leftOffset+this.options.margin2);
var newPos=this.options.DraggableConvertRatio*rMargin-posChange;this._rToolTip.style.display="block"
this._rToolTip.style.right=newPos-25+"px";this._rToolTip.innerText=(Math.round(
this.options.pageWidth/100-newPos/(this.options.DraggableConvertRatio*100))/10).toString()+unit;
this._rMarginDrag.style.width=newPos+"px"}else{
newPos=this.options.DraggableConvertRatio*this.options.leftOffset+posChange;
this._lToolTip.style.display="block";this._lToolTip.style.left=newPos-25+"px";
this._lToolTip.innerText=(Math.round(newPos/(this.options.DraggableConvertRatio*100))/10).toString(
)+unit;this._lMarginDrag.style.width=newPos+"px"}};HRuler.prototype._endDrag=function(e){
this._map.rulerActive=false;var posChange;if(e.type==="touchend"
)posChange=this._lastposition-this._initialposition;else posChange=e.originalEvent.clientX-this._initialposition
var unoObj={},marginType,fact;window.L.DomEvent.off(this._rFace,"mousemove",this._moveMargin,this);
window.L.DomEvent.off(this._map,"mouseup",this._endDrag,this);if(window.L.DomUtil.hasClass(
this._rMarginDrag,"leaflet-drag-moving")){marginType="Margin2";fact=-1;window.L.DomUtil.removeClass(
this._rMarginDrag,"leaflet-drag-moving");this._rToolTip.style.display="none"}else{
marginType="Margin1";fact=1;window.L.DomUtil.removeClass(this._lMarginDrag,"leaflet-drag-moving");
this._lToolTip.style.display="none"}this._rFace.style.cursor="default";unoObj[marginType]={};unoObj[
marginType]["type"]="string";unoObj[marginType]["value"]=fact*posChange/(
this.options.DraggableConvertRatio*this.options.pageWidth);app.socket.sendMessage(
"uno .uno:RulerChangeState "+JSON.stringify(unoObj))};HRuler.prototype._getTabStopHit=function(
tabstopContainer,pointX){var tabstop=null;var margin=10;var tabstopDiffFromCenter=1e8;for(
var i=0;i<tabstopContainer.tabStops.length;i++){var current=tabstopContainer.tabStops[i];
var location_1=current.tabStopLocation;if(
pointX>=location_1.left-margin&&pointX<=location_1.right+margin){var diff=Math.abs(
pointX-location_1.center);if(diff<tabstopDiffFromCenter){tabstop=current;tabstopDiffFromCenter=diff}
}}return tabstop};HRuler.prototype._showTabstopContextMenu=function(position,tabstopNumber){
var self=this;this.currentPositionInTwips=position;this.currentTabStopIndex=tabstopNumber;
$.contextMenu({selector:".cool-ruler-horizontal-tabstopcontainer",className:"cool-font",items:{
inserttabstop:{name:_("Insert tabstop"),callback:this._insertTabstop.bind(this),visible:function(){
return self.currentPositionInTwips!=null}},removetabstop:{name:_("Delete tabstop"),
callback:this._deleteTabstop.bind(this),visible:function(){return self.currentTabStopIndex!=null}}}}
)};HRuler.prototype._initiateTabstopDrag=function(event){var tabstopContainer=null;var pointX=null;
if(event.type==="panstart"){tabstopContainer=event.target;
pointX=event.center.x-event.target.getBoundingClientRect().left}else{
tabstopContainer=event.currentTarget;pointX=event.layerX}
tabstopContainer.tabStopMarkerBeingDragged=null;var tabstop=this._getTabStopHit(tabstopContainer,
pointX);if(event.type!=="panstart"){if(event.button===2){if(tabstop==null){
var position=this._map._docLayer._pixelsToTwips({x:pointX,y:0}).x;this._showTabstopContextMenu(
position,null)}else{this._showTabstopContextMenu(null,tabstop.tabStopNumber)}event.stopPropagation()
return}else if(event.button!==0){event.stopPropagation();return}}if(tabstop==null){return}
tabstopContainer.tabStopMarkerBeingDragged=tabstop;tabstopContainer.tabStopInitialPosiiton=pointX;
if(!this.getWindowProperty("ThisIsTheiOSApp")&&event.pointerType!=="touch"){window.L.DomEvent.on(
this._rTSContainer,"mousemove",this._moveTabstop,this);window.L.DomEvent.on(this._rTSContainer,
"mouseup",this._endTabstopDrag,this);window.L.DomEvent.on(this._rTSContainer,"mouseout",
this._endTabstopDrag,this)}};HRuler.prototype._moveTabstop=function(event){var tabstopContainer=null
var pointX=null;if(event.type==="panmove"){tabstopContainer=event.target;
pointX=event.center.x-event.target.getBoundingClientRect().left}else{
tabstopContainer=event.currentTarget;pointX=event.layerX}if(tabstopContainer===null)return;
var marker=tabstopContainer.tabStopMarkerBeingDragged;if(marker===null)return;
var pixelDiff=pointX-tabstopContainer.tabStopInitialPosiiton;
marker.style.left=marker.tabStopLocation.left+pixelDiff+"px"};
HRuler.prototype._endTabstopDrag=function(event){var tabstopContainer=null;var pointX=null;if(
event.type==="panend"){tabstopContainer=event.target;
pointX=event.center.x-event.target.getBoundingClientRect().left}else{
tabstopContainer=event.currentTarget;pointX=event.layerX}if(tabstopContainer===null)return;
var marker=tabstopContainer.tabStopMarkerBeingDragged;if(marker===null)return;if(
event.type=="mouseout"){marker.style.left=marker.tabStopLocation.left+"px"}else{
var positionTwip=this._map._docLayer._pixelsToTwips({x:pointX,y:0}).x;var params={Index:{
type:"int32",value:marker.tabStopNumber},Position:{type:"int32",value:positionTwip},Remove:{
type:"boolean",value:false}};this._map.sendUnoCommand(".uno:ChangeTabStop",params)}
window.L.DomEvent.off(this._rTSContainer,"mousemove",this._moveTabstop,this);window.L.DomEvent.off(
this._rTSContainer,"mouseup",this._endTabstopDrag,this);window.L.DomEvent.off(this._rTSContainer,
"mouseout",this._endTabstopDrag,this)};HRuler.prototype._onTabstopContainerLongPress=function(event
){var tabstopContainer=event.target;
var pointX=event.center.x-tabstopContainer.getBoundingClientRect().left;
var pointXTwip=this._map._docLayer._pixelsToTwips({x:pointX,y:0}).x;var tabstop=this._getTabStopHit(
tabstopContainer,pointX);if(window.mode.isMobile()||window.mode.isTablet()){if(tabstop==null){
this.currentPositionInTwips=pointXTwip;this.currentTabStopIndex=null;this._insertTabstop()}else{
this.currentPositionInTwips=null;this.currentTabStopIndex=tabstop.tabStopNumber;this._deleteTabstop(
)}}else{var tabstopNumber=null;if(tabstop!=null){tabstopNumber=tabstop.tabStopNumber;pointXTwip=null
}this._showTabstopContextMenu(pointXTwip,tabstopNumber)}};HRuler.prototype._deleteTabstop=function(
){if(this.currentTabStopIndex!=null){var params={Index:{type:"int32",value:this.currentTabStopIndex
},Position:{type:"int32",value:0},Remove:{type:"boolean",value:true}};this._map.sendUnoCommand(
".uno:ChangeTabStop",params);this.currentTabStopIndex=null}};
HRuler.prototype._insertTabstop=function(){if(this.currentPositionInTwips!=null){var params={Index:{
type:"int32",value:-1},Position:{type:"int32",value:this.currentPositionInTwips},Remove:{
type:"boolean",value:false}};this._map.sendUnoCommand(".uno:ChangeTabStop",params);
this.currentPositionInTwips=null}};HRuler.prototype._getNavigationSidebarWidth=function(){
var presentationControlsWrapper=document.querySelector("#navigation-sidebar");
var presentationControlsWrapperWidth=0;if(presentationControlsWrapper
)presentationControlsWrapperWidth=presentationControlsWrapper.getBoundingClientRect().width;
return presentationControlsWrapperWidth};return HRuler}(Ruler);var SlideCache=function(){
function SlideCache(){this.renderedSlides=new Map}SlideCache.prototype.has=function(slideHash){
return this.renderedSlides.has(slideHash)};SlideCache.prototype.get=function(slideHash){
return this.renderedSlides.get(slideHash)};SlideCache.prototype.set=function(slideHash,image){
this.renderedSlides.set(slideHash,image)};SlideCache.prototype.invalidate=function(slideHash){
this.renderedSlides.delete(slideHash)};SlideCache.prototype.invalidateAll=function(){
this.renderedSlides.clear()};return SlideCache}();SlideShow.SlideCache=SlideCache;
var SlideCompositor=function(){function SlideCompositor(slideShowPresenter){
this._slideShowPresenter=null;this._initialSlideNumber=0;this._onGotSlideCallback=null;
this._slideShowPresenter=slideShowPresenter;this._addHooks()}
SlideCompositor.prototype.fetchAndRun=function(slideNumber,callback){
this._initialSlideNumber=slideNumber;this._onGotSlideCallback=callback};return SlideCompositor}();
SlideShow.SlideCompositor=SlideCompositor;var LayerRendererGl=function(){function LayerRendererGl(
offscreenCanvas){this.imageBitmapIdCounter=0;this.textureCache=new Map;
this.imageBitmapIdMap=new WeakMap;
this.vertexShaderSource="\n\t\t\tattribute vec2 a_position;\n\t\t\tattribute vec2 a_texCoord;\n\t\t\tvarying vec2 v_texCoord;\n\t\t\tvoid main() {\n\t\t\t\tgl_Position = vec4(a_position, 0, 1);\n\t\t\t\tv_texCoord = a_texCoord;\n\t\t\t}\n\t\t"
this.fragmentShaderSource="\n\t\tprecision mediump float;\n\t\tuniform vec4 fromFillColor;\n\t\tuniform vec4 toFillColor;\n\t\tuniform vec4 fromLineColor;\n\t\tuniform vec4 toLineColor;\n\t\tuniform float alpha;\n\t\tvarying vec2 v_texCoord;\n\t\tuniform sampler2D u_sampler;\n\n\t\t"+GlHelpers.nearestPointOnSegment+"\n\t\t"+GlHelpers.computeColor+"\n\n\t\tvoid main() {\n\t\t\tvec4 color = texture2D(u_sampler, v_texCoord);\n\t\t\tcolor = computeColor(color);\n\t\t\tcolor = color * alpha;\n\t\t\tgl_FragColor = color;\n\t\t}\n\t\t"
this.offscreenCanvas=offscreenCanvas;this.glContext=new RenderContextGl(this.offscreenCanvas);
this.gl=this.glContext.getGl();this.initializeWebGL();this.disposed=false}
LayerRendererGl.prototype.initialize=function(){};LayerRendererGl.prototype.isGlRenderer=function(){
return true};LayerRendererGl.prototype.isDisposed=function(){return this.disposed};
LayerRendererGl.prototype.getRenderContext=function(){return this.glContext};
LayerRendererGl.prototype.initializeWebGL=function(){var gl=this.gl;
var vertexShader=this.glContext.createVertexShader(this.vertexShaderSource);
var fragmentShader=this.glContext.createFragmentShader(this.fragmentShaderSource);
this.program=this.glContext.createProgram(vertexShader,fragmentShader);
this.positionLocation=gl.getAttribLocation(this.program,"a_position");
this.texCoordLocation=gl.getAttribLocation(this.program,"a_texCoord");
this.samplerLocation=gl.getUniformLocation(this.program,"u_sampler");
this.positionBuffer=gl.createBuffer();this.texCoordBuffer=gl.createBuffer();gl.bindBuffer(
gl.ARRAY_BUFFER,this.texCoordBuffer);var texCoords=new Float32Array([0,1,1,1,0,0,1,0]);
gl.bufferData(gl.ARRAY_BUFFER,texCoords,gl.STATIC_DRAW);this.vao=gl.createVertexArray();
gl.bindVertexArray(this.vao);gl.bindBuffer(gl.ARRAY_BUFFER,this.positionBuffer);
gl.enableVertexAttribArray(this.positionLocation);gl.vertexAttribPointer(this.positionLocation,2,
gl.FLOAT,false,0,0);gl.bindBuffer(gl.ARRAY_BUFFER,this.texCoordBuffer);gl.enableVertexAttribArray(
this.texCoordLocation);gl.vertexAttribPointer(this.texCoordLocation,2,gl.FLOAT,false,0,0);gl.enable(
gl.BLEND);gl.blendFunc(gl.ONE,gl.ONE_MINUS_SRC_ALPHA);gl.pixelStorei(
gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true);this.gl.disable(this.gl.DEPTH_TEST)};
LayerRendererGl.prototype.initPositionBuffer=function(bounds){var gl=this.gl;
var vertices=LayerRendererGl.DefaultVertices;if(bounds){vertices=[];for(var i=0;i<bounds.length;++i
){var x=2*bounds[i].x-1;vertices.push(x);var y=-(2*bounds[i].y-1);vertices.push(y)}}gl.bindBuffer(
gl.ARRAY_BUFFER,this.positionBuffer);var positions=new Float32Array(vertices);gl.bufferData(
gl.ARRAY_BUFFER,positions,gl.STATIC_DRAW)};LayerRendererGl.prototype.clearCanvas=function(){if(
!this.disposed){var gl=this.gl;gl.clearColor(1,1,1,1);gl.clear(gl.COLOR_BUFFER_BIT)}};
LayerRendererGl.computeColor=function(properties){var bounds=null;var alpha=1;
var fromFillColor=LayerRendererGl.DefaultFromColor;var toFillColor=LayerRendererGl.DefaultToColor;
var fromLineColor=LayerRendererGl.DefaultFromColor;var toLineColor=LayerRendererGl.DefaultToColor;
if(properties){bounds=properties.bounds;alpha=properties.alpha;var colorMap=properties.colorMap;if(
colorMap){if(colorMap.fromFillColor&&colorMap.toFillColor){
fromFillColor=colorMap.fromFillColor.toFloat32Array();
toFillColor=colorMap.toFillColor.toFloat32Array()}if(colorMap.fromLineColor&&colorMap.toLineColor){
fromLineColor=colorMap.fromLineColor.toFloat32Array();
toLineColor=colorMap.toLineColor.toFloat32Array()}}}return{bounds:bounds,alpha:alpha,
fromFillColor:fromFillColor,toFillColor:toFillColor,fromLineColor:fromLineColor,
toLineColor:toLineColor}};LayerRendererGl.prototype.drawBitmap=function(imageInfo,properties){if(
this.disposed){app.console.log("LayerRenderer is disposed");return}if(!imageInfo){app.console.log(
"LayerRenderer.drawBitmap: no image");return}var _a=LayerRendererGl.computeColor(properties),
bounds=_a.bounds,alpha=_a.alpha,fromFillColor=_a.fromFillColor,toFillColor=_a.toFillColor,
fromLineColor=_a.fromLineColor,toLineColor=_a.toLineColor;var texture;var textureKey;if(
imageInfo instanceof ImageBitmap){if(!this.imageBitmapIdMap.has(imageInfo)){
this.imageBitmapIdMap.set(imageInfo,this.imageBitmapIdCounter++)}
textureKey="imageBitmap_"+this.imageBitmapIdMap.get(imageInfo)}else{textureKey=imageInfo.checksum}
if(this.textureCache.has(textureKey)){texture=this.textureCache.get(textureKey)}else{if(
imageInfo instanceof ImageBitmap){texture=this.glContext.loadTexture(imageInfo)}else{
texture=this.glContext.loadTexture(imageInfo.data)}this.textureCache.set(textureKey,texture)}
this.gl.useProgram(this.program);this.gl.bindVertexArray(this.vao);this.initPositionBuffer(bounds);
this.gl.uniform1f(this.gl.getUniformLocation(this.program,"alpha"),alpha);this.gl.uniform4fv(
this.gl.getUniformLocation(this.program,"fromFillColor"),fromFillColor);this.gl.uniform4fv(
this.gl.getUniformLocation(this.program,"toFillColor"),toFillColor);this.gl.uniform4fv(
this.gl.getUniformLocation(this.program,"fromLineColor"),fromLineColor);this.gl.uniform4fv(
this.gl.getUniformLocation(this.program,"toLineColor"),toLineColor);this.gl.activeTexture(
this.gl.TEXTURE0);this.gl.bindTexture(this.gl.TEXTURE_2D,texture);this.gl.uniform1i(
this.samplerLocation,0);this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)};
LayerRendererGl.prototype.dispose=function(){this.gl=null;this.offscreenCanvas=null;
this.disposed=true};LayerRendererGl.prototype.hexToRgba=function(hex){hex=hex.replace(/^#/,"");
var bigint;if(hex.length===3){var r=parseInt(hex.charAt(0)+hex.charAt(0),16);var g=parseInt(
hex.charAt(1)+hex.charAt(1),16);var b=parseInt(hex.charAt(2)+hex.charAt(2),16);return{r:r,g:g,b:b,
a:0}}else if(hex.length===6){bigint=parseInt(hex,16);var r=bigint>>16&255;var g=bigint>>8&255;
var b=bigint&255;return{r:r,g:g,b:b,a:0}}else if(hex.length===8){bigint=parseInt(hex,16);
var r=bigint>>24&255;var g=bigint>>16&255;var b=bigint>>8&255;var a=bigint&255;return{r:r,g:g,b:b,
a:a}}else if(hex.length===4){var r=parseInt(hex.charAt(0)+hex.charAt(0),16);var g=parseInt(
hex.charAt(1)+hex.charAt(1),16);var b=parseInt(hex.charAt(2)+hex.charAt(2),16);var a=parseInt(
hex.charAt(3)+hex.charAt(2),16);return{r:r,g:g,b:b,a:a}}else{return null}};
LayerRendererGl.prototype.fillColor=function(slideInfo){if(this.disposed)return true;if(
slideInfo.background&&slideInfo.background.fillColor){var fillColor=slideInfo.background.fillColor;
var rgba=this.hexToRgba(fillColor);if(rgba){this.gl.clearColor(rgba.r/255,rgba.g/255,rgba.b/255,
rgba.a/255)}else{this.gl.clearColor(1,1,1,1)}this.gl.clear(this.gl.COLOR_BUFFER_BIT)}else{
this.gl.clearColor(1,1,1,1);this.gl.clear(this.gl.COLOR_BUFFER_BIT)}if(!slideInfo.background
)return true;return false};LayerRendererGl.DefaultVertices=[-1,-1,1,-1,-1,1,1,1];
LayerRendererGl.DefaultFromColor=new Float32Array([0,0,0,0]);
LayerRendererGl.DefaultToColor=new Float32Array([0,0,0,0]);return LayerRendererGl}();
var LayerRenderer2d=function(){function LayerRenderer2d(offscreenCanvas){
this.offscreenCanvas=offscreenCanvas;this.context2d=new RenderContext2d(this.offscreenCanvas);
this.offscreenContext=this.context2d.get2dOffscreen();if(!this.offscreenContext){throw new Error(
"2D Canvas context not available")}this.disposed=false}
LayerRenderer2d.prototype.initialize=function(){};LayerRenderer2d.prototype.isGlRenderer=function(){
return false};LayerRenderer2d.prototype.isDisposed=function(){return this.disposed};
LayerRenderer2d.prototype.getRenderContext=function(){return this.context2d};
LayerRenderer2d.prototype.clearCanvas=function(){if(this.disposed)return;
this.offscreenContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height);
this.offscreenContext.fillStyle="#FFFFFF";this.offscreenContext.fillRect(0,0,
this.offscreenCanvas.width,this.offscreenCanvas.height)};
LayerRenderer2d.prototype.drawBitmap=function(imageInfo,properties){if(this.disposed)return;if(
!imageInfo){app.console.log("Canvas2DRenderer.drawBitmap: no image");return}if(
imageInfo instanceof ImageBitmap){this.offscreenContext.drawImage(imageInfo,0,0)}else if(
imageInfo.type==="png"||imageInfo.data instanceof ImageBitmap){this.offscreenContext.drawImage(
imageInfo.data,0,0)}else{throw"No supported bitmap to draw found"}};
LayerRenderer2d.prototype.dispose=function(){this.disposed=true;this.offscreenContext=null;
this.offscreenCanvas=null};LayerRenderer2d.prototype.fillColor=function(slideInfo){if(this.disposed
)return;this.offscreenContext.fillStyle="#FFFFFF";this.offscreenContext.fillRect(0,0,
this.offscreenCanvas.width,this.offscreenCanvas.height);if(!slideInfo.background)return true;if(
slideInfo.background.fillColor){this.offscreenContext.fillStyle="#"+slideInfo.background.fillColor;
window.app.console.log("LayerDrawing.drawBackground: "+this.offscreenContext.fillStyle);
this.offscreenContext.fillRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height);
return true}return false};return LayerRenderer2d}();SlideShow.LayerRendererGl=LayerRendererGl;
SlideShow.LayerRenderer2d=LayerRenderer2d;var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var LayerDrawing=function(){function LayerDrawing(mapObj,helper){
this.map=null;this.slideCache=new SlideCache;this.compressedSlideCache=new Map;
this.compressedPrefetchSlideHash=null;this.requestedSlideHash=null;this.prefetchedSlideHash=null;
this.nextRequestedSlideHash=null;this.nextPrefetchedSlideHash=null;this.slideRequestTimeout=null;
this.resolutionWidth=960;this.resolutionHeight=540;this.canvasWidth=0;this.canvasHeight=0;
this.backgroundChecksums=new Map;this.cachedBackgrounds=new Map;this.cachedMasterPages=new Map;
this.cachedDrawPages=new Map;this.cachedTextFields=new Map;this.slideTextFieldsMap=new Map;
this.offscreenCanvas=null;this.onSlideRenderingCompleteCallback=null;this.videoRenderers=new Map;
this.isTransitionActive=false;this.queuedLayers=[];this.map=mapObj;this.helper=helper}
LayerDrawing.prototype.addHooks=function(){this.map.on("slidelayer",this.onSlideLayerMsg,this);
this.map.on("sliderenderingcomplete",this.onSlideRenderingComplete,this);this.map.on(
"compressedslide",this.onCompressSlide,this)};LayerDrawing.prototype.removeHooks=function(){
this.map.off("slidelayer",this.onSlideLayerMsg,this);this.map.off("sliderenderingcomplete",
this.onSlideRenderingComplete,this);this.map.off("compressedslide",this.onCompressSlide,this)};
LayerDrawing.prototype.onCompressSlide=function(e){app.console.log(
"CompressedCache: Storing compressed slide in LayerDrawing cache - slideHash: "+e.slideHash+", layers: "+e.layers.length
);this.compressedSlideCache.set(e.slideHash,e.layers)};LayerDrawing.prototype.isDisposed=function(){
return this.layerRenderer&&this.layerRenderer.isDisposed()};
LayerDrawing.prototype.deleteResources=function(){this.requestedSlideHash=null;
this.prefetchedSlideHash=null;this.nextRequestedSlideHash=null;this.nextPrefetchedSlideHash=null;
this.deleteVideosResources();this.layerRenderer.dispose();this.compressedSlideCache.clear()};
LayerDrawing.prototype.getSlideInfo=function(slideHash){return this.helper.getSlideInfo(slideHash)};
LayerDrawing.prototype.getSlide=function(slideNumber){var startSlideHash=this.helper.getSlideHash(
slideNumber);return this.slideCache.get(startSlideHash)};
LayerDrawing.prototype.getLayerBounds=function(slideHash,targetElement){
var layers=this.cachedDrawPages.get(slideHash);if(!layers)return null;for(var i in layers){
var animatedInfo=layers[i].content;if(
animatedInfo&&animatedInfo.hash===targetElement&&animatedInfo.content)return animatedInfo.bounds}
return null};LayerDrawing.prototype.getAnimatedSlide=function(slideIndex){app.console.debug(
"LayerDrawing.getAnimatedSlide: slide index: "+slideIndex);var slideHash=this.helper.getSlideHash(
slideIndex);this.composeLayers(slideHash);return this.offscreenCanvas.transferToImageBitmap()};
LayerDrawing.prototype.composeLayers=function(slideHash){if(this.isDisposed())return;
this.drawBackground(slideHash);this.drawMasterPage(slideHash);this.drawTextField(slideHash);
this.drawDrawPage(slideHash);this.drawVideos(slideHash)};
LayerDrawing.prototype.handleVideos=function(slideHash){var slideInfo=this.getSlideInfo(slideHash);
var videosInfo=slideInfo.videos;if(!videosInfo||videosInfo.length===0)return;
this.videoRenderers.set(slideHash,[]);if(!this.layerRenderer.getRenderContext().is2dGl(
)&&!VideoRendererGl.videoProgramInitialized){VideoRendererGl.createProgram(
this.layerRenderer.getRenderContext())}for(var i=0;i<videosInfo.length;++i){
var videoInfo=videosInfo[i];this.handleVideo(i,slideHash,videoInfo)}};
LayerDrawing.prototype.handleVideo=function(index,slideHash,videoInfo){
var slideShowPresenter=app.map.slideShowPresenter;
var slideRenderer=slideShowPresenter._slideRenderer;
var metaPres=slideShowPresenter._metaPresentation;var videoId=slideHash+index;
var videoRenderer=makeVideoRenderer(videoId,this.layerRenderer.getRenderContext(),slideRenderer);
videoRenderer.prepareVideo(videoInfo,metaPres.docWidth,metaPres.docHeight);this.videoRenderers.get(
slideHash).push(videoRenderer)};LayerDrawing.prototype.drawVideos=function(slideHash){var e_1,_a;
var videoRenderers=this.videoRenderers.get(slideHash);if(!videoRenderers)return;try{for(
var videoRenderers_1=__values(videoRenderers),videoRenderers_1_1=videoRenderers_1.next(
);!videoRenderers_1_1.done;videoRenderers_1_1=videoRenderers_1.next()){
var videoRenderer=videoRenderers_1_1.value;videoRenderer.render()}}catch(e_1_1){e_1={error:e_1_1}
}finally{try{if(videoRenderers_1_1&&!videoRenderers_1_1.done&&(_a=videoRenderers_1.return))_a.call(
videoRenderers_1)}finally{if(e_1)throw e_1.error}}};LayerDrawing.prototype.loadVideos=function(
slideHash){var e_2,_a;var videoRenderers=this.videoRenderers.get(slideHash);if(!videoRenderers
)return;try{for(var videoRenderers_2=__values(videoRenderers),
videoRenderers_2_1=videoRenderers_2.next(
);!videoRenderers_2_1.done;videoRenderers_2_1=videoRenderers_2.next()){
var videoRenderer=videoRenderers_2_1.value;videoRenderer.loadVideo()}}catch(e_2_1){e_2={error:e_2_1}
}finally{try{if(videoRenderers_2_1&&!videoRenderers_2_1.done&&(_a=videoRenderers_2.return))_a.call(
videoRenderers_2)}finally{if(e_2)throw e_2.error}}};LayerDrawing.prototype.pauseVideos=function(
slideHash){var e_3,_a;var videoRenderers=this.videoRenderers.get(slideHash);if(!videoRenderers
)return;try{for(var videoRenderers_3=__values(videoRenderers),
videoRenderers_3_1=videoRenderers_3.next(
);!videoRenderers_3_1.done;videoRenderers_3_1=videoRenderers_3.next()){
var videoRenderer=videoRenderers_3_1.value;videoRenderer.pauseVideo()}}catch(e_3_1){e_3={error:e_3_1
}}finally{try{if(videoRenderers_3_1&&!videoRenderers_3_1.done&&(_a=videoRenderers_3.return))_a.call(
videoRenderers_3)}finally{if(e_3)throw e_3.error}}};
LayerDrawing.prototype.getVideoRenderer=function(slideHash,videoInfo){var e_4,_a;
var videoRenderers=this.videoRenderers.get(slideHash);try{for(var videoRenderers_4=__values(
videoRenderers),videoRenderers_4_1=videoRenderers_4.next(
);!videoRenderers_4_1.done;videoRenderers_4_1=videoRenderers_4.next()){
var videoRenderer=videoRenderers_4_1.value;if(videoRenderer.videoInfoId===videoInfo.id){
return videoRenderer}}}catch(e_4_1){e_4={error:e_4_1}}finally{try{if(
videoRenderers_4_1&&!videoRenderers_4_1.done&&(_a=videoRenderers_4.return))_a.call(videoRenderers_4)
}finally{if(e_4)throw e_4.error}}};LayerDrawing.prototype.deleteVideosResources=function(){
this.videoRenderers.forEach(function(videoRenderers){var e_5,_a;try{for(
var videoRenderers_5=__values(videoRenderers),videoRenderers_5_1=videoRenderers_5.next(
);!videoRenderers_5_1.done;videoRenderers_5_1=videoRenderers_5.next()){
var videoRenderer=videoRenderers_5_1.value;videoRenderer.deleteResources()}}catch(e_5_1){e_5={
error:e_5_1}}finally{try{if(videoRenderers_5_1&&!videoRenderers_5_1.done&&(
_a=videoRenderers_5.return))_a.call(videoRenderers_5)}finally{if(e_5)throw e_5.error}}});
VideoRendererGl.deleteProgram(this.layerRenderer.getRenderContext())};
LayerDrawing.prototype.getAnimatedLayerInfo=function(slideHash,targetElement){app.console.debug(
"LayerDrawing.getAnimatedLayerInfo("+slideHash+", "+targetElement+")");
var layers=this.cachedDrawPages.get(slideHash);if(!layers)return null;for(var i in layers){
var animatedInfo=layers[i].content;if(animatedInfo&&animatedInfo.hash===targetElement
)return animatedInfo}return null};LayerDrawing.prototype.getLayerImage=function(slideHash,
targetElement){var layers=this.cachedDrawPages.get(slideHash);if(!layers)return null;for(
var i in layers){var animatedInfo=layers[i].content;if(
animatedInfo&&animatedInfo.hash===targetElement&&animatedInfo.content
)return animatedInfo.content.data}return null};LayerDrawing.prototype.invalidateAll=function(){
this.slideCache.invalidateAll();this.slideTextFieldsMap.clear();this.cachedTextFields.clear();
this.cachedBackgrounds.clear();this.cachedMasterPages.clear();this.cachedDrawPages.clear();
this.videoRenderers.clear();this.compressedSlideCache.clear()};
LayerDrawing.prototype.getCanvasSize=function(){return[this.canvasWidth,this.canvasHeight]};
LayerDrawing.prototype.onUpdatePresentationInfo=function(){this.computeInitialResolution();
this.initializeCanvas()};LayerDrawing.prototype.requestSlide=function(slideNumber,callback){
this.onSlideRenderingCompleteCallback=callback;var startSlideHash=this.helper.getSlideHash(
slideNumber);this.requestSlideImpl(startSlideHash)};
LayerDrawing.prototype.initializeCanvas=function(){this.computeCanvasSize(this.resolutionWidth,
this.resolutionHeight);this.createRenderingCanvas()};
LayerDrawing.prototype.createRenderingCanvas=function(){this.offscreenCanvas=new OffscreenCanvas(
this.canvasWidth,this.canvasHeight);try{this.layerRenderer=new SlideShow.LayerRendererGl(
this.offscreenCanvas)}catch(error){app.console.log(
"LayerDrawing: WebGl offscreen rendering not supported");
this.layerRenderer=new SlideShow.LayerRenderer2d(this.offscreenCanvas)}};
LayerDrawing.prototype.requestSlideImpl=function(slideHash,prefetch,compressedLayers){var _this=this
if(prefetch===void 0){prefetch=false}if(compressedLayers===void 0){compressedLayers=false}if(
this.isDisposed())return;app.console.debug(
"LayerDrawing.requestSlideImpl: slide hash: "+slideHash+", prefetching: "+prefetch);
var slideInfo=this.getSlideInfo(slideHash);if(!slideInfo){window.app.console.log(
"LayerDrawing.requestSlideImpl: No info for requested slide: hash: "+slideHash);return}if(
slideHash===this.requestedSlideHash||slideHash===this.prefetchedSlideHash||slideHash===this.nextRequestedSlideHash||slideHash===this.nextPrefetchedSlideHash
){app.console.debug("LayerDrawing.requestSlideImpl: no need to fetch slide again");return}if(
this.requestedSlideHash||this.prefetchedSlideHash||this.slideRequestTimeout){if(
!prefetch||!this.slideRequestTimeout){if(!prefetch){clearTimeout(this.slideRequestTimeout);
this.nextRequestedSlideHash=slideHash;this.nextPrefetchedSlideHash=null}else{
this.nextPrefetchedSlideHash=slideHash}this.slideRequestTimeout=setTimeout(function(){if(
!_this.helper.isSlideShowPlaying())return;_this.slideRequestTimeout=null;
_this.nextRequestedSlideHash=null;_this.nextPrefetchedSlideHash=null;_this.requestSlideImpl(
slideHash,prefetch)},500)}return}if(prefetch){this.prefetchedSlideHash=slideHash;
this.requestedSlideHash=null}else{this.requestedSlideHash=slideHash;this.prefetchedSlideHash=null}
if(this.slideCache.has(slideHash)){this.onSlideRenderingComplete({success:true});return}if(
this.compressedSlideCache.has(slideHash)){app.console.log(
"CompressedCache: fetching slides from CompressedCache, SlideHash :",slideHash);
SlideBitmapManager.renderCachedCompressSlide(this.compressedSlideCache.get(slideHash));return}
this.requestSlideFromServer(slideInfo,prefetch,compressedLayers)};
LayerDrawing.prototype.requestSlideFromServer=function(slideInfo,prefetch,compressedLayers){if(
prefetch===void 0){prefetch=false}if(compressedLayers===void 0){compressedLayers=false}
var slideHash=slideInfo.hash;var backgroundRendered=this.drawBackground(slideHash);
var masterPageRendered=this.drawMasterPage(slideHash);if(backgroundRendered&&masterPageRendered){if(
this.drawDrawPage(slideHash)){this.onSlideRenderingComplete({success:true});return}}if(!prefetch
)this.map.fire("handleslideshowprogressbar",{isVisible:true});app.socket.sendMessage(
"getslide hash="+slideInfo.hash+" part="+slideInfo.index+" width="+this.canvasWidth+" height="+this.canvasHeight+" "+(
"renderBackground="+(backgroundRendered?0:1)+" renderMasterPage="+(masterPageRendered?0:1
)+" devicePixelRatio="+window.devicePixelRatio+" compressedLayers="+(compressedLayers?1:0)))};
LayerDrawing.prototype.onSlideLayerMsg=function(e){if(this.isDisposed())return;if(
this.isTransitionActive){this.queuedLayers.push(e);return}var info=e.message;if(!info){
window.app.console.log("LayerDrawing.onSlideLayerMsg: no json data available.");return}if(
!this.getSlideInfo(info.slideHash)){window.app.console.log(
"LayerDrawing.onSlideLayerMsg: no slide info available for "+info.slideHash+".");return}if(
!info.content){window.app.console.log("LayerDrawing.onSlideLayerMsg: no layer content available.");
return}switch(info.group){case"Background":this.handleBackgroundMsg(info,e.image);break;
case"MasterPage":this.handleMasterPageLayerMsg(info,e.image);break;case"DrawPage":
this.handleDrawPageLayerMsg(info,e.image);break;case"TextFields":this.handleTextFieldMsg(info,
e.image)}};LayerDrawing.prototype.handleTextFieldMsg=function(info,img){
var textFieldInfo=info.content;var imageInfo=textFieldInfo.content;if(!this.checkAndAttachImageData(
imageInfo,img))return;var textFields=this.slideTextFieldsMap.get(info.slideHash);if(!textFields){
textFields=new Map;this.slideTextFieldsMap.set(info.slideHash,textFields)}textFields.set(
textFieldInfo.hash,imageInfo.checksum);this.cachedTextFields.set(imageInfo.checksum,textFieldInfo)};
LayerDrawing.prototype.handleBackgroundMsg=function(info,img){var slideInfo=this.getSlideInfo(
info.slideHash);if(!slideInfo.background){return}if(info.type==="bitmap"){var imageInfo=info.content
if(!this.checkAndAttachImageData(imageInfo,img))return;
var pageHash=slideInfo.background.isCustom?info.slideHash:slideInfo.masterPage;
this.backgroundChecksums.set(pageHash,imageInfo.checksum);this.cachedBackgrounds.set(
imageInfo.checksum,imageInfo);this.clearCanvas();this.drawBitmap(imageInfo)}};
LayerDrawing.prototype.handleMasterPageLayerMsg=function(info,img){var slideInfo=this.getSlideInfo(
info.slideHash);if(!slideInfo.masterPageObjectsVisibility){return}if(
info.index===0||!this.cachedMasterPages.get(slideInfo.masterPage))this.cachedMasterPages.set(
slideInfo.masterPage,new Array);var layers=this.cachedMasterPages.get(slideInfo.masterPage);if(
layers.length!==info.index){window.app.console.log(
"LayerDrawing.handleMasterPageLayerMsg: missed any layers ?")}var layerEntry={type:info.type,
content:info.content,isField:info.isField};if(info.type==="bitmap"){if(
!this.checkAndAttachImageData(layerEntry.content,img))return}layers.push(layerEntry);
this.drawMasterPageLayer(layerEntry,info.slideHash)};
LayerDrawing.prototype.handleDrawPageLayerMsg=function(info,img){if(
info.index===0||!this.cachedDrawPages.get(info.slideHash)){this.cachedDrawPages.set(info.slideHash,
new Array)}var layers=this.cachedDrawPages.get(info.slideHash);if(layers.length!==info.index){
window.app.console.log("LayerDrawing.handleDrawPageLayerMsg: missed any layers ?")}var layerEntry={
type:info.type,content:info.content};if(info.type==="bitmap"){if(!this.checkAndAttachImageData(
layerEntry.content,img))return}else if(info.type==="animated"){var content=layerEntry.content;if(
content.type==="bitmap"){if(!this.checkAndAttachImageData(content.content,img))return;
var animatedElement=this.helper.getAnimatedElement(info.slideHash,content.hash);if(animatedElement){
animatedElement.updateAnimationInfo(content)}}}layers.push(layerEntry);this.drawDrawPageLayer(
info.slideHash,layerEntry)};LayerDrawing.prototype.clearCanvas=function(){
this.layerRenderer.clearCanvas()};LayerDrawing.prototype.drawBackground=function(slideHash){
this.clearCanvas();var slideInfo=this.getSlideInfo(slideHash);if(this.layerRenderer.fillColor(
slideInfo))return true;var pageHash=slideInfo.background.isCustom?slideHash:slideInfo.masterPage;
var checksum=this.backgroundChecksums.get(pageHash);if(!checksum)return false;
var imageInfo=this.cachedBackgrounds.get(checksum);if(!imageInfo){window.app.console.log(
"LayerDrawing: no cached background for slide: "+slideHash);return false}this.drawBitmap(imageInfo);
return true};LayerDrawing.prototype.drawMasterPage=function(slideHash){var e_6,_a;
var slideInfo=this.getSlideInfo(slideHash);if(!slideInfo.masterPageObjectsVisibility)return true;
var layers=this.cachedMasterPages.get(slideInfo.masterPage);if(!layers||layers.length===0){
window.app.console.log("LayerDrawing: No layer cached for master page: "+slideInfo.masterPage);
return false}try{for(var layers_1=__values(layers),layers_1_1=layers_1.next(
);!layers_1_1.done;layers_1_1=layers_1.next()){var layer=layers_1_1.value;this.drawMasterPageLayer(
layer,slideHash)}}catch(e_6_1){e_6={error:e_6_1}}finally{try{if(layers_1_1&&!layers_1_1.done&&(
_a=layers_1.return))_a.call(layers_1)}finally{if(e_6)throw e_6.error}}return true};
LayerDrawing.prototype.drawMasterPageLayer=function(layer,slideHash){if(layer.type==="bitmap"){
this.drawBitmap(layer.content)}else if(layer.type==="placeholder"){var placeholder=layer.content;
var slideTextFields=this.slideTextFieldsMap.get(slideHash);
var checksum=slideTextFields?slideTextFields.get(placeholder.hash):null;if(!checksum){
window.app.console.log(
"LayerDrawing: No content found for text field placeholder, type: "+placeholder.type);return}
var imageInfo=this.cachedTextFields.get(checksum).content;this.drawBitmap(imageInfo)}};
LayerDrawing.prototype.drawDrawPage=function(slideHash){var e_7,_a;var slideInfo=this.getSlideInfo(
slideHash);if(slideInfo.empty){return true}var layers=this.cachedDrawPages.get(slideHash);if(
!layers||layers.length===0){window.app.console.log(
"LayerDrawing: No layer cached for draw page: "+slideHash);return false}try{for(
var layers_2=__values(layers),layers_2_1=layers_2.next();!layers_2_1.done;layers_2_1=layers_2.next()
){var layer=layers_2_1.value;this.drawDrawPageLayer(slideHash,layer)}}catch(e_7_1){e_7={error:e_7_1}
}finally{try{if(layers_2_1&&!layers_2_1.done&&(_a=layers_2.return))_a.call(layers_2)}finally{if(e_7
)throw e_7.error}}return true};LayerDrawing.prototype.drawTextField=function(slideHash){var e_8,_a;
var slideInfo=this.getSlideInfo(slideHash);if(slideInfo.empty){return true}
var fields=this.slideTextFieldsMap.get(slideHash);if(!fields){window.app.console.log(
"LayerDrawing: No layer cached text field for draw page: "+slideHash);return false}try{for(
var fields_1=__values(fields),fields_1_1=fields_1.next();!fields_1_1.done;fields_1_1=fields_1.next()
){var field=fields_1_1.value;var imageInfo=this.cachedTextFields.get(field[1]).content;
this.drawBitmap(imageInfo)}}catch(e_8_1){e_8={error:e_8_1}}finally{try{if(
fields_1_1&&!fields_1_1.done&&(_a=fields_1.return))_a.call(fields_1)}finally{if(e_8)throw e_8.error}
}return true};LayerDrawing.prototype.drawDrawPageLayer=function(slideHash,layer){if(
layer.type==="bitmap"){this.drawBitmap(layer.content)}else if(layer.type==="animated"){
var content=layer.content;if(content.type==="bitmap"){
var animatedElement=this.helper.getAnimatedElement(slideHash,content.hash);if(animatedElement){
app.console.debug("LayerDrawing.drawDrawPageLayer: retrieved animatedElement");if(
animatedElement.isValid()){animatedElement.renderLayer(this.layerRenderer);return}}this.drawBitmap(
content.content)}}};LayerDrawing.prototype.drawBitmap=function(imageInfo){
this.layerRenderer.drawBitmap(imageInfo)};LayerDrawing.prototype.onSlideRenderingComplete=function(e
){if(this.isDisposed())return;this.map.fire("handleslideshowprogressbar",{isVisible:false});if(
!e.success){var slideHash=this.requestedSlideHash||this.prefetchedSlideHash;
var slideInfo=this.getSlideInfo(slideHash);var index=slideInfo?slideInfo.index:undefined;
this.requestedSlideHash=null;this.prefetchedSlideHash=null;app.console.debug(
"LayerDrawing.onSlideRenderingComplete: rendering failed for slide: "+index);return}if(
e.compressedLayers){this.prefetchNextCompressedSlide();return}if(this.prefetchedSlideHash){
var currSlideHash=this.prefetchedSlideHash;this.prefetchedSlideHash=null;if(app.isExperimentalMode()
){this.compressedPrefetchSlideHash=currSlideHash;this.prefetchNextCompressedSlide()}return}
var reqSlideInfo=this.getSlideInfo(this.requestedSlideHash);this.cacheAndNotify();if(
reqSlideInfo.next&&!this.slideCache.has(reqSlideInfo.next)){this.requestSlideImpl(reqSlideInfo.next,
true)}};LayerDrawing.prototype.cacheAndNotify=function(){if(!this.offscreenCanvas){
window.app.console.log("LayerDrawing.onSlideRenderingComplete: no offscreen canvas available.");
return}if(!this.slideCache.has(this.requestedSlideHash)){
var renderedSlide=this.offscreenCanvas.transferToImageBitmap();this.slideCache.set(
this.requestedSlideHash,renderedSlide)}this.compressedSlideCache.delete(this.requestedSlideHash);
this.requestedSlideHash=null;var oldCallback=this.onSlideRenderingCompleteCallback;
this.onSlideRenderingCompleteCallback=null;if(oldCallback)oldCallback.call(this.helper)};
LayerDrawing.prototype.prefetchNextCompressedSlide=function(){if(this.compressedPrefetchSlideHash){
var slideInfo=this.getSlideInfo(this.compressedPrefetchSlideHash);
this.compressedPrefetchSlideHash=null;if(slideInfo===null||slideInfo===void 0?void 0:slideInfo.next
){this.prefetchCompressedSlide(slideInfo.next)}}};
LayerDrawing.prototype.prefetchCompressedSlide=function(slideHash){var slideInfo=this.getSlideInfo(
slideHash);if(!slideInfo){app.console.warn("SlideInfo not found for hash: "+slideHash);return}if(
this.isSlideAlreadyCached(slideHash)){this.prefetchNextSlide(slideInfo);return}
this.compressedPrefetchSlideHash=slideHash;this.requestSlideFromServer(slideInfo,true,true);return};
LayerDrawing.prototype.isSlideAlreadyCached=function(slideHash){return this.slideCache.has(slideHash
)||this.compressedSlideCache.has(slideHash)};LayerDrawing.prototype.prefetchNextSlide=function(
slideInfo){if(slideInfo.next){this.prefetchCompressedSlide(slideInfo.next)}};
LayerDrawing.prototype.checkAndAttachImageData=function(imageInfo,img){if(
!img||imageInfo.type==="png"&&!img.src){window.app.console.log(
"LayerDrawing.checkAndAttachImageData: no bitmap available.");return false}imageInfo.data=img;
return true};LayerDrawing.prototype.computeInitialResolution=function(){
var viewWidth=window.screen.width;var viewHeight=window.screen.height;this.computeResolution(
viewWidth,viewHeight)};LayerDrawing.prototype.computeResolution=function(viewWidth,viewHeight){
var _a;_a=__read(this.helper.computeLayerResolution(viewWidth,viewHeight),2),
this.resolutionWidth=_a[0],this.resolutionHeight=_a[1]};
LayerDrawing.prototype.computeCanvasSize=function(resWidth,resHeight){var _a;_a=__read(
this.helper.computeLayerSize(resWidth,resHeight),2),this.canvasWidth=_a[0],this.canvasHeight=_a[1]};
LayerDrawing.prototype.getLayerRendererContext=function(){
return this.layerRenderer.getRenderContext()};LayerDrawing.prototype.notifyTransitionStart=function(
){this.isTransitionActive=true;this.queuedLayers=[]};
LayerDrawing.prototype.notifyTransitionEnd=function(slideHash){this.isTransitionActive=false;while(
this.queuedLayers.length>0){var layer=this.queuedLayers.shift();this.onSlideLayerMsg(layer)}
this.handleVideos(slideHash);if(this.videoRenderers.has(slideHash)){this.loadVideos(slideHash)}};
return LayerDrawing}();SlideShow.LayerDrawing=LayerDrawing;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var LayersCompositor=function(_super){__extends(
LayersCompositor,_super);function LayersCompositor(slideShowPresenter,metaPres){
var _this=_super.call(this,slideShowPresenter)||this;_this.metaPresentation=metaPres;return _this}
LayersCompositor.prototype._addHooks=function(){this.layerDrawing=new SlideShow.LayerDrawing(app.map
,this);this.layerDrawing.addHooks()};LayersCompositor.prototype.removeHooks=function(){
this.layerDrawing.removeHooks()};LayersCompositor.prototype.fetchAndRun=function(slideNumber,
callback){var _this=this;_super.prototype.fetchAndRun.call(this,slideNumber,callback);
this.layerDrawing.requestSlide(this._initialSlideNumber,function(){
var oldCallback=_this._onGotSlideCallback;_this._onGotSlideCallback=null;oldCallback()})};
LayersCompositor.prototype.getSlideInfo=function(slideHash){
return this.metaPresentation.getSlideInfo(slideHash)};
LayersCompositor.prototype.onUpdatePresentationInfo=function(){
this.layerDrawing.onUpdatePresentationInfo();this.layerDrawing.invalidateAll()};
LayersCompositor.prototype.getSlideHash=function(slideIndex){
return this.metaPresentation.getSlideHash(slideIndex)};
LayersCompositor.prototype.getAnimatedElement=function(slideHash,animatedElementHash){
var metaSlide=this.metaPresentation.getMetaSlide(slideHash);if(!metaSlide){window.app.console.log(
"LayersCompositor.getAnimatedElement: failed to retrieve meta slide for hash: "+slideHash);return}
if(metaSlide.animationsHandler){var animElemMap=metaSlide.animationsHandler.getAnimatedElementMap();
return animElemMap.get(animatedElementHash)}};LayersCompositor.prototype.getSlideSizePixel=function(
){return[app.twipsToPixels*this.metaPresentation.slideWidth,
app.twipsToPixels*this.metaPresentation.slideHeight]};
LayersCompositor.prototype.computeLayerResolution=function(width,height){width*=1.2;height*=1.2;
var resolutionWidth=960;var resolutionHeight=540;if(width>3840||height>2160){resolutionWidth=3840;
resolutionHeight=2160}else if(width>2560||height>1440){resolutionWidth=2560;resolutionHeight=1440
}else if(width>1920||height>1080){resolutionWidth=1920;resolutionHeight=1080}else if(
width>1280||height>720){resolutionWidth=1280;resolutionHeight=720}return[resolutionWidth,
resolutionHeight]};LayersCompositor.prototype.computeLayerSize=function(width,height){
var slideWidth=this.metaPresentation.slideWidth;var slideHeight=this.metaPresentation.slideHeight;
var slideRatio=slideWidth/slideHeight;var resolutionRatio=width/height;if(slideRatio>resolutionRatio
){height=Math.trunc(width*slideHeight/slideWidth)}else if(slideRatio<resolutionRatio){
width=Math.trunc(height*slideWidth/slideHeight)}return[width,height]};
LayersCompositor.prototype.getCanvasSize=function(){return this.layerDrawing.getCanvasSize()};
LayersCompositor.prototype.getSlide=function(slideNumber){return this.layerDrawing.getSlide(
slideNumber)};LayersCompositor.prototype.getLayerRendererContext=function(){
return this.layerDrawing.getLayerRendererContext()};
LayersCompositor.prototype.getVideoRenderer=function(slideHash,videoInfo){
return this.layerDrawing.getVideoRenderer(slideHash,videoInfo)};
LayersCompositor.prototype.getAnimatedSlide=function(slideIndex){
return this.layerDrawing.getAnimatedSlide(slideIndex)};
LayersCompositor.prototype.getAnimatedLayerInfo=function(slideHash,targetElement){
return this.layerDrawing.getAnimatedLayerInfo(slideHash,targetElement)};
LayersCompositor.prototype.getLayerImage=function(slideHash,targetElement){
return this.layerDrawing.getLayerImage(slideHash,targetElement)};
LayersCompositor.prototype.getLayerBounds=function(slideHash,targetElement){
return this.layerDrawing.getLayerBounds(slideHash,targetElement)};
LayersCompositor.prototype.isSlideShowPlaying=function(){
return this._slideShowPresenter._checkAlreadyPresenting()};
LayersCompositor.prototype.deleteResources=function(){this.layerDrawing.deleteResources()};
LayersCompositor.prototype.pauseVideos=function(slideHash){this.layerDrawing.pauseVideos(slideHash)}
LayersCompositor.prototype.notifyTransitionStart=function(){this.layerDrawing.notifyTransitionStart(
)};LayersCompositor.prototype.notifyTransitionEnd=function(slideHash){
this.layerDrawing.notifyTransitionEnd(slideHash)};return LayersCompositor}(SlideCompositor);
SlideShow.LayersCompositor=LayersCompositor;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var RenderContext=function(){function RenderContext(canvas){this.disposed=false;this.canvas=canvas}
RenderContext.prototype.getGl=function(){return this.gl};RenderContext.prototype.get2dGl=function(){
var _a;return this.gl&&(this.gl instanceof CanvasRenderingContext2D||((_a=this.gl.constructor
)===null||_a===void 0?void 0:_a.name)==="CanvasRenderingContext2D")?this.gl:null};
RenderContext.prototype.get2dOffscreen=function(){
return this.gl instanceof OffscreenCanvasRenderingContext2D?this.gl:null};
RenderContext.prototype.isDisposed=function(){return this.disposed};
RenderContext.prototype.createTextureWithColor=function(color){return null};
RenderContext.prototype.createEmptySlide=function(){return null};
RenderContext.prototype.createTransparentTexture=function(){return null};return RenderContext}();
var RenderContextGl=function(_super){__extends(RenderContextGl,_super);function RenderContextGl(
canvas){var _this=_super.call(this,canvas)||this;_this.gl=_this.canvas.getContext("webgl2",{
failIfMajorPerformanceCaveat:true});if(!_this.gl){app.console.error("WebGL2 not supported");
throw new Error("WebGL2 not supported")}return _this}RenderContextGl.prototype.is2dGl=function(){
return false};RenderContextGl.prototype.clear=function(){this.disposed=true;this.gl=null};
RenderContextGl.prototype.loadTexture=function(image,isMipMapEnable){if(isMipMapEnable===void 0){
isMipMapEnable=false}if(this.isDisposed())return null;var gl=this.getGl();
var texture=gl.createTexture();if(!texture){throw new Error("Failed to create texture")}
gl.bindTexture(gl.TEXTURE_2D,texture);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE
,image);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(
gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);if(isMipMapEnable){gl.generateMipmap(gl.TEXTURE_2D
);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR_MIPMAP_LINEAR)}else{
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR)}gl.texParameteri(gl.TEXTURE_2D,
gl.TEXTURE_MAG_FILTER,gl.LINEAR);if(image instanceof HTMLImageElement)app.console.debug(
"Texture loaded successfully");return texture};RenderContextGl.prototype.deleteTexture=function(
texture){if(this.isDisposed())return;var gl=this.getGl();gl.deleteTexture(texture)};
RenderContextGl.prototype.deleteVertexArray=function(vao){if(this.isDisposed())return;
var gl=this.getGl();gl.deleteVertexArray(vao)};
RenderContextGl.prototype.createTextureWithColor=function(color){if(this.isDisposed())return null;
var gl=this.getGl();var texture=gl.createTexture();if(!texture){throw new Error(
"Failed to create texture")}gl.bindTexture(gl.TEXTURE_2D,texture);var colorPixel=new Uint8Array(
color);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,1,1,0,gl.RGBA,gl.UNSIGNED_BYTE,colorPixel);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,
gl.TEXTURE_MAG_FILTER,gl.LINEAR);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);return texture};
RenderContextGl.prototype.createEmptySlide=function(){return this.createTextureWithColor([0,0,0,255]
)};RenderContextGl.prototype.createTransparentTexture=function(){return this.createTextureWithColor(
[0,0,0,0])};RenderContextGl.prototype.createVertexShader=function(source){return this.createShader(
this.getGl().VERTEX_SHADER,source)};RenderContextGl.prototype.createFragmentShader=function(source){
return this.createShader(this.getGl().FRAGMENT_SHADER,source)};
RenderContextGl.prototype.createShader=function(type,source){if(this.isDisposed())return null;
var gl=this.getGl();var shader=gl.createShader(type);if(!shader){throw new Error(
"Failed to create shader")}gl.shaderSource(shader,source);gl.compileShader(shader);if(
!gl.getShaderParameter(shader,gl.COMPILE_STATUS)){var info=gl.getShaderInfoLog(shader);
gl.deleteShader(shader);throw new Error("Could not compile shader: "+info)}app.console.log(
"Shader compiled successfully:",type===gl.VERTEX_SHADER?"VERTEX":"FRAGMENT");return shader};
RenderContextGl.prototype.createProgram=function(vertexShader,fragmentShader){if(this.isDisposed()
)return null;var gl=this.getGl();var program=gl.createProgram();if(!program){throw new Error(
"Failed to create program")}gl.attachShader(program,vertexShader);gl.attachShader(program,
fragmentShader);gl.linkProgram(program);if(!gl.getProgramParameter(program,gl.LINK_STATUS)){
var info=gl.getProgramInfoLog(program);gl.deleteProgram(program);throw new Error(
"Could not link program: "+info)}app.console.log("Program linked successfully");return program};
return RenderContextGl}(RenderContext);var RenderContext2d=function(_super){__extends(
RenderContext2d,_super);function RenderContext2d(canvas){var _this=_super.call(this,canvas)||this;
_this.gl=_this.canvas.getContext("2d");if(!_this.gl){app.console.error(
"Canvas rendering not supported");throw new Error("Canvas rendering not supported")}return _this}
RenderContext2d.prototype.is2dGl=function(){return true};RenderContext2d.prototype.clear=function(){
this.disposed=true;this.gl=null};RenderContext2d.prototype.loadTexture=function(image,isMipMapEnable
){if(isMipMapEnable===void 0){isMipMapEnable=false}return image};
RenderContext2d.prototype.createVertexShader=function(source){return null};
RenderContext2d.prototype.createFragmentShader=function(source){return null};
RenderContext2d.prototype.createShader=function(type,source){return null};
RenderContext2d.prototype.deleteTexture=function(texture){return};
RenderContext2d.prototype.deleteVertexArray=function(vao){return};
RenderContext2d.prototype.createProgram=function(vertexShader,fragmentShader){return null};
return RenderContext2d}(RenderContext);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __spreadArray=this&&this.__spreadArray||function(to,from,pack){if(pack||arguments.length===2
)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar)ar=Array.prototype.slice.call(
from,0,i);ar[i]=from[i]}}return to.concat(ar||Array.prototype.slice.call(from))};
var VideoRenderInfo=function(){function VideoRenderInfo(){this.texture=null;this.vao=null}
VideoRenderInfo.prototype.getTexture=function(){return this.texture};
VideoRenderInfo.prototype.replaceTexture=function(context,newtexture){context.deleteTexture(
this.texture);this.texture=newtexture};VideoRenderInfo.prototype.getVao=function(){return this.vao};
VideoRenderInfo.prototype.replaceVao=function(context,newVao){context.deleteVertexArray(this.vao);
this.vao=newVao};VideoRenderInfo.prototype.deleteResources=function(context){this.replaceTexture(
context,null);this.replaceVao(context,null)};return VideoRenderInfo}();var VideoRenderer=function(){
function VideoRenderer(sId,context,slideRenderer){this.sId=sId;this._context=context;
this._slideRenderer=slideRenderer}VideoRenderer.prototype.isDisposed=function(){
return this._context&&this._context.isDisposed()};VideoRenderer.prototype.loadVideo=function(){if(
!this.videoRenderInfo)return;this.videoRenderInfo.videoElement.load()};
VideoRenderer.prototype.playVideo=function(reset){if(reset===void 0){reset=true}if(
!this.videoRenderInfo)return;if(reset)this.videoRenderInfo.videoElement.currentTime=0;
this.videoRenderInfo.videoElement.play()};VideoRenderer.prototype.pauseVideo=function(){if(
!this.videoRenderInfo)return;app.console.debug("VideoRenderer.pauseVideo");
this.videoRenderInfo.videoElement.pause()};VideoRenderer.prototype.deleteResources=function(){if(
this.isDisposed())return;this.pauseVideo();this.videoRenderInfo.deleteResources(this._context)};
VideoRenderer.prototype.handleClick=function(){if(this.videoRenderInfo.playing){this.pauseVideo()
}else if(this.videoRenderInfo.ended){this.playVideo(true)}else{this.playVideo(false)}};
VideoRenderer.prototype.setupVideo=function(videoRenderInfo,url){var _this=this;
var video=document.createElement("video");video.playsInline=true;video.crossOrigin="anonymous";
video.addEventListener("playing",function(){videoRenderInfo.playing=true;videoRenderInfo.ended=false
_this._slideRenderer.notifyVideoStarted(_this.sId)},true);video.addEventListener("pause",function(){
videoRenderInfo.playing=false;_this._slideRenderer.notifyVideoEnded(_this.sId)},true);
video.addEventListener("ended",function(){videoRenderInfo.playing=false;videoRenderInfo.ended=true;
_this._slideRenderer.notifyVideoEnded(_this.sId)},true);video.src=url;return video};
VideoRenderer.prototype.getDocumentPositions=function(x,y,width,height,docWidth,docHeight){
var xMin=x/docWidth;var xMax=(x+width)/docWidth;var yMin=y/docHeight;var yMax=(y+height)/docHeight;
return[xMin,xMax,yMin,yMax]};return VideoRenderer}();var VideoRenderer2d=function(_super){__extends(
VideoRenderer2d,_super);function VideoRenderer2d(){return _super!==null&&_super.apply(this,arguments
)||this}VideoRenderer2d.prototype.prepareVideo=function(videoInfo,docWidth,docHeight){
this.pauseVideo();var video=new VideoRenderInfo;video.videoElement=this.setupVideo(video,
videoInfo.url);video.pos2d=this.getDocumentPositions(videoInfo.x,videoInfo.y,videoInfo.width,
videoInfo.height,docWidth,docHeight);this.videoRenderInfo=video;this.videoInfoId=videoInfo.id};
VideoRenderer2d.prototype.render=function(){if(this.isDisposed())return;
var ctx=this._context.get2dGl();if(!ctx){app.console.error("Canvas 2D context not available");return
}var video=this.videoRenderInfo;var width=ctx.canvas.width;var height=ctx.canvas.height;
ctx.drawImage(video.videoElement,video.pos2d[0]*width,video.pos2d[2]*height,video.pos2d[1
]*width-video.pos2d[0]*width,video.pos2d[3]*height-video.pos2d[2]*height)};return VideoRenderer2d}(
VideoRenderer);var VideoRendererGl=function(_super){__extends(VideoRendererGl,_super);
function VideoRendererGl(){return _super!==null&&_super.apply(this,arguments)||this}
VideoRendererGl.getVertexShader=function(){
return"#version 300 es\n\t\t\t\tin vec4 a_position;\n\t\t\t\tin vec2 a_texCoord;\n\t\t\t\tout vec2 v_texCoord;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_Position = a_position;\n\t\t\t\t\tv_texCoord = a_texCoord;\n\t\t\t\t}\n\t\t\t\t"
};VideoRendererGl.getFragmentShader=function(){
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\tuniform sampler2D slideTexture;\n\n\t\t\t\tin vec2 v_texCoord;\n\t\t\t\tout vec4 outColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\toutColor = texture(slideTexture, v_texCoord);\n\t\t\t\t}\n\t\t\t\t"
};VideoRendererGl.createProgram=function(context){if(context.is2dGl()||context.isDisposed())return;
var vertexShader=context.createVertexShader(VideoRendererGl.getVertexShader());
var fragmentShader=context.createFragmentShader(VideoRendererGl.getFragmentShader());
VideoRendererGl._program=context.createProgram(vertexShader,fragmentShader);
VideoRendererGl.videoProgramInitialized=true};VideoRendererGl.deleteProgram=function(context){if(
context.is2dGl()||context.isDisposed())return;var gl=context.getGl();gl.deleteProgram(
VideoRendererGl._program);VideoRendererGl._program=null;
VideoRendererGl.videoProgramInitialized=false};VideoRendererGl.prototype.prepareVideo=function(
videoInfo,docWidth,docHeight){this.pauseVideo();var video=new VideoRenderInfo;
video.videoElement=this.setupVideo(video,videoInfo.url);video.replaceTexture(this._context,
this.initTexture());video.replaceVao(this._context,this.setupRectangleInDocumentPositions(
videoInfo.x,videoInfo.y,videoInfo.width,videoInfo.height,docWidth,docHeight));
this.videoRenderInfo=video;this.videoInfoId=videoInfo.id};
VideoRendererGl.prototype.initTexture=function(){var gl=this._context.getGl();
var texture=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,texture);var pixel=new Uint8Array([0,0,
255,255]);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,1,1,0,gl.RGBA,gl.UNSIGNED_BYTE,pixel);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_WRAP_S,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,
gl.TEXTURE_WRAP_T,gl.CLAMP_TO_EDGE);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR);
return texture};VideoRendererGl.prototype.setupPositions=function(xMin,xMax,yMin,yMax){if(
this.isDisposed())return null;if(this._context.is2dGl())return;var gl=this._context.getGl();
var positions=new Float32Array(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],[xMin,
-yMin,0,0,1],false),[xMax,-yMin,0,1,1],false),[xMin,-yMax,0,0,0],false),[xMax,-yMax,0,1,0],false));
var buffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,
positions,gl.STATIC_DRAW);var vao=gl.createVertexArray();gl.bindVertexArray(vao);
var program=VideoRendererGl._program;if(!program){app.console.log(
"VideoRenderer: program is not valid");return}var positionLocation=gl.getAttribLocation(program,
"a_position");gl.enableVertexAttribArray(positionLocation);gl.vertexAttribPointer(positionLocation,3
,gl.FLOAT,false,5*4,0);var texCoordLocation=gl.getAttribLocation(program,"a_texCoord");
gl.enableVertexAttribArray(texCoordLocation);gl.vertexAttribPointer(texCoordLocation,2,gl.FLOAT,
false,5*4,3*4);return vao};VideoRendererGl.prototype.setupRectangleInDocumentPositions=function(x,y,
width,height,docWidth,docHeight){var positions=this.getDocumentPositions(x,y,width,height,docWidth,
docHeight);return this.setupPositions(positions[0]*2-1,positions[1]*2-1,positions[2]*2-1,positions[3
]*2-1)};VideoRendererGl.prototype.updateTexture=function(texture,video){var gl=this._context.getGl()
gl.bindTexture(gl.TEXTURE_2D,texture);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE
,video)};VideoRendererGl.prototype.render=function(){if(this.isDisposed())return;app.console.debug(
"SlideRendererGl.render");var gl=this._context.getGl();if(!VideoRendererGl._program){
app.console.log("VideoRendererGl: program is not valid");return}gl.useProgram(
VideoRendererGl._program);gl.activeTexture(gl.TEXTURE0);var video=this.videoRenderInfo;if(
!video.ended&&video.videoElement.currentTime>0){gl.bindVertexArray(video.getVao());gl.pixelStorei(
gl.UNPACK_FLIP_Y_WEBGL,true);this.updateTexture(video.getTexture(),video.videoElement);
gl.drawArrays(gl.TRIANGLE_STRIP,0,4);gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL,false)}};
VideoRendererGl.videoProgramInitialized=false;return VideoRendererGl}(VideoRenderer);
function makeVideoRenderer(sId,context,slideRenderer){return context.is2dGl()?new VideoRenderer2d(
sId,context,slideRenderer):new VideoRendererGl(sId,context,slideRenderer)}
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __spreadArray=this&&this.__spreadArray||function(to,from,
pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(
!ar)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var SlideRenderer=function(){function SlideRenderer(canvas){
this._context=null;this._renderedSlideIndex=undefined;this._requestAnimationFrameId=null;
this._activeLayers=new Set;this._playingVideos=new Set;this._canvas=canvas}
SlideRenderer.prototype.isDisposed=function(){return this._context&&this._context.isDisposed()};
Object.defineProperty(SlideRenderer.prototype,"lastRenderedSlideIndex",{get:function(){
return this._renderedSlideIndex},enumerable:false,configurable:true});
SlideRenderer.prototype.getSlideTexture=function(){return this._slideTexture};
SlideRenderer.prototype.getAnimatedSlideImage=function(){var presenter=app.map.slideShowPresenter;
return presenter._slideCompositor.getAnimatedSlide(this._renderedSlideIndex)};
SlideRenderer.prototype.renderSlide=function(currentSlideTexture,slideInfo){
this.deleteCurrentSlideTexture();this._activeLayers.clear();
this._renderedSlideIndex=slideInfo.indexInSlideShow;this._slideTexture=currentSlideTexture;
requestAnimationFrame(this.render.bind(this))};SlideRenderer.prototype.createEmptyTexture=function(
){return null};SlideRenderer.prototype.notifyAnimationStarted=function(sId){
var isAnyLayerActive=this.isAnyLayerActive();this._activeLayers.add(sId);if(!isAnyLayerActive){
this._requestAnimationFrameId=requestAnimationFrame(this.render.bind(this))}};
SlideRenderer.prototype.notifyAnimationEnded=function(sId){this._activeLayers.delete(sId)};
SlideRenderer.prototype.isAnyLayerActive=function(){return this._activeLayers.size>0};
SlideRenderer.prototype.notifyVideoStarted=function(sId){
var isAnyVideoAlreadyPlaying=this.isAnyVideoPlaying;this._playingVideos.add(sId);if(
!isAnyVideoAlreadyPlaying){this._requestAnimationFrameId=requestAnimationFrame(this.render.bind(this
))}};SlideRenderer.prototype.notifyVideoEnded=function(sId){this._playingVideos.delete(sId)};
Object.defineProperty(SlideRenderer.prototype,"isAnyVideoPlaying",{get:function(){
return this._playingVideos.size>0},enumerable:false,configurable:true});return SlideRenderer}();
var SlideRenderer2d=function(_super){__extends(SlideRenderer2d,_super);function SlideRenderer2d(
canvas){var _this=_super.call(this,canvas)||this;_this._context=new RenderContext2d(canvas);
return _this}SlideRenderer2d.prototype.createTexture=function(image,_isMipMapsEnable){return image};
SlideRenderer2d.prototype.deleteCurrentSlideTexture=function(){return};
SlideRenderer2d.prototype.deleteResources=function(){return};
SlideRenderer2d.prototype.render=function(){if(this.isDisposed())return;
var canvas2dCtx=this._context.get2dGl();if(!canvas2dCtx){console.error(
"Canvas 2D context not available");return}canvas2dCtx.clearRect(0,0,canvas2dCtx.canvas.width,
canvas2dCtx.canvas.height);var slideImage=this.getAnimatedSlideImage();app.map.fire(
"newslideshowframe",{frame:slideImage});canvas2dCtx.drawImage(slideImage,0,0);slideImage.close();
canvas2dCtx.setTransform(1,0,0,1,0,0);if(this.isAnyLayerActive()||this.isAnyVideoPlaying){
this._requestAnimationFrameId=requestAnimationFrame(this.render.bind(this))}};return SlideRenderer2d
}(SlideRenderer);var SlideRendererGl=function(_super){__extends(SlideRendererGl,_super);
function SlideRendererGl(canvas){var _this=_super.call(this,canvas)||this;_this._program=null;
_this._vao=null;_this._context=new RenderContextGl(canvas);
var vertexShader=_this._context.createVertexShader(_this.getVertexShader());
var fragmentShader=_this._context.createFragmentShader(_this.getFragmentShader());
_this._program=_this._context.createProgram(vertexShader,fragmentShader);
_this._vao=_this.setupPositions(-1,1,1,-1);_this._context.getGl().useProgram(_this._program);
return _this}SlideRendererGl.prototype.getVertexShader=function(){
return"#version 300 es\n\t\t\t\tin vec4 a_position;\n\t\t\t\tin vec2 a_texCoord;\n\t\t\t\tout vec2 v_texCoord;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_Position = a_position;\n\t\t\t\t\tv_texCoord = a_texCoord;\n\t\t\t\t}\n\t\t\t\t"
};SlideRendererGl.prototype.getFragmentShader=function(){
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\tuniform sampler2D slideTexture;\n\n\t\t\t\tin vec2 v_texCoord;\n\t\t\t\tout vec4 outColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\toutColor = texture(slideTexture, v_texCoord);\n\t\t\t\t}\n\t\t\t\t"
};SlideRendererGl.prototype.updateTexture=function(texture,video){var gl=this._context.getGl();
gl.bindTexture(gl.TEXTURE_2D,texture);gl.texImage2D(gl.TEXTURE_2D,0,gl.RGBA,gl.RGBA,gl.UNSIGNED_BYTE
,video)};SlideRendererGl.prototype.setupPositions=function(xMin,xMax,yMin,yMax){if(this.isDisposed()
)return null;if(this._context.is2dGl())return;var gl=this._context.getGl();
var positions=new Float32Array(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],[xMin,
-yMin,0,0,1],false),[xMax,-yMin,0,1,1],false),[xMin,-yMax,0,0,0],false),[xMax,-yMax,0,1,0],false));
var buffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,buffer);gl.bufferData(gl.ARRAY_BUFFER,
positions,gl.STATIC_DRAW);var vao=gl.createVertexArray();gl.bindVertexArray(vao);
var positionLocation=gl.getAttribLocation(this._program,"a_position");gl.enableVertexAttribArray(
positionLocation);gl.vertexAttribPointer(positionLocation,3,gl.FLOAT,false,5*4,0);
var texCoordLocation=gl.getAttribLocation(this._program,"a_texCoord");gl.enableVertexAttribArray(
texCoordLocation);gl.vertexAttribPointer(texCoordLocation,2,gl.FLOAT,false,5*4,3*4);return vao};
SlideRendererGl.prototype.getNextTexture=function(){var slideImage=this.getAnimatedSlideImage();
app.map.fire("newslideshowframe",{frame:slideImage});this.updateTexture(this._slideTexture,
slideImage);slideImage.close();return this._slideTexture};
SlideRendererGl.prototype.createTexture=function(image,isMipMapsEnable){if(isMipMapsEnable===void 0
){isMipMapsEnable=false}return this._context.loadTexture(image,isMipMapsEnable)};
SlideRendererGl.prototype.createEmptyTexture=function(){return this._context.createEmptySlide()};
SlideRendererGl.prototype.deleteCurrentSlideTexture=function(){this._context.deleteTexture(
this._slideTexture);this._slideTexture=null};SlideRendererGl.prototype.deleteResources=function(){
if(this.isDisposed())return;this.deleteCurrentSlideTexture();if(this._context)this._context.clear()}
SlideRendererGl.prototype.render=function(){if(this.isDisposed())return;var gl=this._context.getGl()
gl.viewport(0,0,this._canvas.width,this._canvas.height);gl.clearColor(0,0,0,1);gl.clear(
gl.COLOR_BUFFER_BIT);gl.useProgram(this._program);gl.activeTexture(gl.TEXTURE0);gl.bindTexture(
gl.TEXTURE_2D,this.getNextTexture());gl.uniform1i(gl.getUniformLocation(this._program,"slideTexture"
),0);gl.bindVertexArray(this._vao);gl.drawArrays(gl.TRIANGLE_STRIP,0,4);if(this.isAnyLayerActive(
)||this.isAnyVideoPlaying)this._requestAnimationFrameId=requestAnimationFrame(this.render.bind(this)
)};return SlideRendererGl}(SlideRenderer);var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
function hitTest(bounds,x,y){
return x>=bounds.x&&x<=bounds.x+bounds.width&&y>=bounds.y&&y<=bounds.y+bounds.height}
var SlideShowPresenter=function(){function SlideShowPresenter(map,enableA11y){var _this=this;
this._map=null;this._presentationInfo=null;this._slideCompositor=null;this._fullscreen=null;
this._presenterContainer=null;this._slideShowCanvas=null;this._slideShowWindowProxy=null;
this._windowCloseInterval=null;this._slideRenderer=null;this._canvasLoader=null;
this._progressBarContainer=null;this._slideNavContainer=null;this._enableA11y=false;
this._slideControlsTimer=null;this._presentationInfoChanged=false;this._navigateSkipTransition=false
this._skipNextSlideShowInfoChangedMsg=false;this._cypressSVGPresentationTest=false;
this._onImpressModeChanged=null;this._startingPresentation=false;this._wasInDarkMode=false;
this._isLeader=false;this._isFollower=false;this._isFollowing=false;this._onPrevSlide=function(e){
e.stopPropagation();_this._slideShowNavigator.rewindEffect()};this._onNextSlide=function(e){
e.stopPropagation();if(_this._navigateSkipTransition)_this._slideShowNavigator.skipEffect(
);else _this._slideShowNavigator.dispatchEffect()};this._onQuit=function(e){e.stopPropagation();
_this.endPresentation(true)};this.slideshowWindowCleanUp=function(){clearInterval(
_this._windowCloseInterval);_this._slideShowNavigator.quit();_this._map.uiManager.closeSnackbar();
_this._slideShowCanvas=null;_this._presenterContainer=null;_this._slideShowWindowProxy=null;
window.removeEventListener("resize",_this.onSlideWindowResize);window.removeEventListener(
"beforeunload",_this.slideshowWindowCleanUp)};this.onSlideWindowResize=function(){
_this.centerCanvas()};
this._cypressSVGPresentationTest=window.L.Browser.cypressTest||"Cypress"in window;this._map=map;
this._enableA11y=enableA11y;this._init();this.addHooks()}
SlideShowPresenter.prototype.addHooks=function(){this._map.on("presentationinfo",
this.onSlideShowInfo,this);this._map.on("newfullscreen",this._onStart,this);this._map.on(
"newpresentinwindow",this._onStartInWindow,this);window.L.DomEvent.on(document,"fullscreenchange",
this._onFullScreenChange,this);this._map.on("updateparts",this.onUpdateParts,this);this._map.on(
"handleslideshowprogressbar",this.handleSlideShowProgressBar,this);this._map.on(
"presentercanvasclick",this._handlePresenterCanvasClick,this);this._map.on(
"newfollowmepresentation dispatcheffect rewindeffect followvideo endpresentation displayslide effect skipalleffect"
,this.handleFollowMeEvents,this)};SlideShowPresenter.prototype.removeHooks=function(){this._map.off(
"presentationinfo",this.onSlideShowInfo,this);this._map.off("newfullscreen",this._onStart,this);
this._map.off("newpresentinwindow",this._onStartInWindow,this);window.L.DomEvent.off(document,
"fullscreenchange",this._onFullScreenChange,this);this._map.off("updateparts",this.onUpdateParts,
this);this._map.off("handleslideshowprogressbar",this.handleSlideShowProgressBar,this);
this._map.off("presentercanvasclick",this._handlePresenterCanvasClick,this);this._map.off(
"newfollowmepresentation dispatcheffect rewindeffect followvideo endpresentation displayslide effect skipalleffect"
,this.handleFollowMeEvents,this)};SlideShowPresenter.prototype.handleFollowMeEvents=function(info){
this.setFollower(true);switch(info.type){case"newfollowmepresentation":this.setFollowing(true);
this._onStartInWindow(0);break;case"dispatcheffect":if(this.isFollowing()
)this._slideShowNavigator.dispatchEffect();break;case"rewindeffect":if(this.isFollowing()
)this._slideShowNavigator.rewindEffect();break;case"followvideo":if(this.isFollowing()
)this._slideShowNavigator.followVideo(info);break;case"displayslide":info.currentEffect=-1;
this._slideShowNavigator.setLeaderSlide(info);this._slideShowNavigator.setLeaderEffect(info);break;
case"effect":this._slideShowNavigator.setLeaderEffect(info);break;case"skipalleffect":
info.currentEffect=Number.POSITIVE_INFINITY;this._slideShowNavigator.setLeaderEffect(info);break;
case"endpresentation":if(!this.isFollowing())return;this.setLeader(false);this.setFollowing(false);
this.setFollower(false);this.endPresentation(true);break}};
SlideShowPresenter.prototype._handlePresenterCanvasClick=function(event){var _this=this;
var navigator=this._slideShowNavigator;if(!navigator)return;
var currentSlideIndex=navigator.currentSlideIndex;if(currentSlideIndex===undefined)return;
var slideInfo=this._metaPresentation.getSlideInfoByIndex(currentSlideIndex);if(
!slideInfo||!slideInfo.videos||slideInfo.videos.length===0){return}if(
event.relativeX!==undefined&&event.relativeY!==undefined){
var x_1=event.relativeX*this._metaPresentation.slideWidth;
var y_1=event.relativeY*this._metaPresentation.slideHeight;var clickedVideo=slideInfo.videos.find(
function(videoInfo){return _this.isPointInVideoArea(videoInfo,x_1,y_1)});if(clickedVideo){
var videoRenderer=this.getVideoRenderer(slideInfo.hash,clickedVideo);if(videoRenderer){
videoRenderer.handleClick();return}}}};SlideShowPresenter.prototype.isPointInVideoArea=function(
bounds,x,y){return x>=bounds.x&&x<=bounds.x+bounds.width&&y>=bounds.y&&y<=bounds.y+bounds.height};
SlideShowPresenter.prototype._init=function(){this._slideShowHandler=new SlideShowHandler(this);
this._slideShowNavigator=new SlideShowNavigator(this._slideShowHandler);
this._slideShowNavigator.disable();this._slideShowHandler.setNavigator(this._slideShowNavigator);
this._slideShowNavigator.setPresenter(this);
this._onKeyDownHandler=this._slideShowNavigator.onKeyDown.bind(this._slideShowNavigator)};
SlideShowPresenter.prototype.onUpdateParts=function(){if(this._checkAlreadyPresenting(
)&&!this._startingPresentation)this.onSlideShowInfoChanged()};
SlideShowPresenter.prototype.getNavigator=function(){return this._slideShowNavigator};
SlideShowPresenter.prototype.getSlideInfo=function(slideNumber){
return this._presentationInfo?this._presentationInfo.slides[slideNumber]:null};
SlideShowPresenter.prototype._getSlidesCount=function(){
return this._presentationInfo?this._presentationInfo.slides.length:0};
SlideShowPresenter.prototype._getRepeatDuration=function(){
return this._presentationInfo?this._presentationInfo.loopAndRepeatDuration:0};
SlideShowPresenter.prototype.isSlideHidden=function(slideNumber){var slideInfo=this.getSlideInfo(
slideNumber);return slideInfo?slideInfo.hidden:true};
SlideShowPresenter.prototype.getVisibleSlidesCount=function(){var count=0;
var slideCount=this._getSlidesCount();for(var i=0;i<slideCount;++i){if(this.isSlideHidden(i)
)continue;++count}return count};SlideShowPresenter.prototype.getNextVisibleSlide=function(
slideNumber){var next=slideNumber;while(next<this._getSlidesCount()){++next;if(!this.isSlideHidden(
next))break}return next};SlideShowPresenter.prototype.getVisibleIndex=function(slideNumber){
var index=slideNumber;for(var i=0;i<slideNumber;++i){if(this.isSlideHidden(i))--index}return index};
SlideShowPresenter.prototype.isFullscreen=function(){if(this._cypressSVGPresentationTest
)return false;return!!this._fullscreen};SlideShowPresenter.prototype.getCanvas=function(){
return this._slideShowCanvas};SlideShowPresenter.prototype.getNotes=function(slide){
var info=this.getSlideInfo(slide);return info?info.notes:null};
SlideShowPresenter.prototype.getVideoRenderer=function(slideHash,videoInfo){
return this._slideCompositor.getVideoRenderer(slideHash,videoInfo)};
SlideShowPresenter.prototype._onFullScreenChange=function(){
this._fullscreen=document.fullscreenElement;if(this._fullscreen){window.addEventListener("keydown",
this._onKeyDownHandler);this.centerCanvas()}else{this._slideShowNavigator.quit()}};
SlideShowPresenter.prototype._stopFullScreen=function(){if(!this._slideShowCanvas)return;if(
this._slideCompositor)this._slideCompositor.deleteResources();this._slideRenderer.deleteResources();
window.removeEventListener("keydown",this._onKeyDownHandler);window.L.DomUtil.remove(
this._slideShowCanvas);this._slideShowCanvas=null;if(this._presenterContainer){
window.L.DomUtil.remove(this._presenterContainer);this._presenterContainer=null}this._map.focus()};
SlideShowPresenter.prototype.centerCanvas=function(){if(!this._slideShowCanvas)return;var winWidth=0
var winHeight=0;if(this._slideShowWindowProxy){winWidth=this._slideShowWindowProxy.clientWidth;
winHeight=this._slideShowWindowProxy.clientHeight}else if(this.isFullscreen()){
winWidth=window.screen.width;winHeight=window.screen.height}if(
winWidth*this._slideShowCanvas.height<winHeight*this._slideShowCanvas.width){
this._slideShowCanvas.style.height="";this._slideShowCanvas.style.left="";
this._slideShowCanvas.style.width="100%";this._slideShowCanvas.style.top="50%";
this._slideShowCanvas.style.transform="translateY(-50%)"}else{this._slideShowCanvas.style.width="";
this._slideShowCanvas.style.top="";this._slideShowCanvas.style.height="100%";
this._slideShowCanvas.style.left="50%";this._slideShowCanvas.style.transform="translateX(-50%)"}};
SlideShowPresenter.prototype._createPresenterHTML=function(parent,width,height){
var presenterContainer=window.L.DomUtil.create("div","leaflet-slideshow2",parent);
presenterContainer.id="presenter-container";var slideshowContainer=window.L.DomUtil.create("div",
"leaflet-slideshow2",presenterContainer);slideshowContainer.id="slideshow-container";
this._slideShowCanvas=this._createCanvas(slideshowContainer,width,height);return presenterContainer}
SlideShowPresenter.prototype._createCanvas=function(parent,width,height){
var canvas=window.L.DomUtil.create("canvas","leaflet-slideshow2",parent);
canvas.id="slideshow-canvas";canvas.style.margin=0;canvas.style.position="absolute";if(
this._enableA11y){canvas.setAttribute("aria-live","assertive")}
this._progressBarContainer=this._createProgressBar(parent);
this._slideNavContainer=this._createSlideNav(parent);canvas.addEventListener("click",
this._slideShowNavigator.onClick.bind(this._slideShowNavigator));canvas.addEventListener("mousemove"
,this._slideShowNavigator.onMouseMove.bind(this._slideShowNavigator));canvas.addEventListener(
"mousemove",this._showSlideControls.bind(this));if(this._hammer){this._hammer.off("swipe")}
this._hammer=new Hammer(canvas);this._hammer.get("swipe").set({direction:Hammer.DIRECTION_ALL});
this._hammer.on("swipe",window.touch.touchOnly(this._slideShowNavigator.onSwipe).bind(
this._slideShowNavigator));this._slideShowHandler.getContext()._canvas=canvas;try{
this._slideRenderer=new SlideRendererGl(canvas)}catch(error){
this._slideRenderer=new SlideRenderer2d(canvas)}return canvas};
SlideShowPresenter.prototype.exitSlideshowWithWarning=function(){if(
this._slideRenderer._context.is2dGl())return false;new SlideShow.StaticTextRenderer(
this._slideRenderer._context).display(_("Click to exit presentation..."));return true};
SlideShowPresenter.prototype._createProgressBar=function(parent){
var progressContainer=window.L.DomUtil.create("div","slideshow-progress-container",parent);
this._configureProgressBarStyles(progressContainer);this._initializeProgressBarWidget(
progressContainer);return progressContainer};
SlideShowPresenter.prototype._configureProgressBarStyles=function(container){
container.style.position="absolute";container.style.bottom="0";container.style.left="0";
container.style.width="100%";container.style.zIndex="1000000000000";container.style.display="none";
container.style.height="6px"};SlideShowPresenter.prototype._initializeProgressBarWidget=function(
container){var progressData={id:"slideshow-progress-bar",type:"progressbar",value:0,maxValue:100,
infinite:true};var builderOptions={options:{cssClass:"slideshow-progress"}};JSDialog.progressbar(
container,progressData,builderOptions)};SlideShowPresenter.prototype._createSlideNav=function(parent
){var slideNavContainer=window.L.DomUtil.create("div","slideshow-nav-container",parent);
slideNavContainer.tabIndex=-1;this._configureSlideNavStyles(slideNavContainer);
this._initializeSlideNavWidget(slideNavContainer);return slideNavContainer};
SlideShowPresenter.prototype._configureSlideNavStyles=function(container){
container.style.backgroundColor="rgba(0, 0, 0, 0.25)";container.style.position="absolute";
container.style.bottom="8px";container.style.left="8px";container.style.zIndex="1000000000000";
container.style.display="flex";container.style.padding="2px";container.style.borderRadius="25px"};
SlideShowPresenter.prototype._onA11yString=function(target){if(!target){return}
this._slideShowHandler.addA11yString(target.getAttribute("aria-label"))};
SlideShowPresenter.prototype._hideSlideControls=function(){
this._slideNavContainer.style.visibility="hidden";this._slideNavContainer.style.opacity="0";
this._slideNavContainer.style.transition="visibility 0s 0.5s, opacity 0.5s ease-in-out"};
SlideShowPresenter.prototype._showSlideControls=function(){
this._slideNavContainer.style.visibility="visible";this._slideNavContainer.style.opacity="1";
this._slideNavContainer.style.transition="opacity 1s linear";clearTimeout(this._slideControlsTimer);
this._slideControlsTimer=setTimeout(this._hideSlideControls.bind(this),3e3)};
SlideShowPresenter.prototype._initializeSlideNavWidget=function(container){var _this=this;
var closeImg=window.L.DomUtil.create("img","left-img",container);var slideshowCloseText=_("End Show"
);app.LOUtil.setImage(closeImg,"slideshow-exit.svg",this._map);closeImg.setAttribute("aria-label",
slideshowCloseText);closeImg.setAttribute("data-cooltip",slideshowCloseText);
window.L.control.attachTooltipEventListener(closeImg,this._map);closeImg.addEventListener("click",
this._onQuit);var leftImg=window.L.DomUtil.create("img","left-img",container);
var slideshowPrevText=_("Previous");leftImg.setAttribute("aria-label",slideshowPrevText);
leftImg.setAttribute("data-cooltip",slideshowPrevText);window.L.control.attachTooltipEventListener(
leftImg,this._map);app.LOUtil.setImage(leftImg,"slideshow-slidePrevious.svg",this._map);
leftImg.addEventListener("click",this._onPrevSlide);var rightImg=window.L.DomUtil.create("img",
"right-img",container);var slideshowNextText=_("Next");window.L.control.attachTooltipEventListener(
rightImg,this._map);rightImg.setAttribute("aria-label",slideshowNextText);rightImg.setAttribute(
"data-cooltip",slideshowNextText);app.LOUtil.setImage(rightImg,"slideshow-slideNext.svg",this._map);
rightImg.addEventListener("click",this._onNextSlide);var animationsImage=window.L.DomUtil.create(
"img","animations-img skipTransition-false",container);var slideshowAnimIniText=_(
"Disable Animations");animationsImage.setAttribute("aria-label",slideshowAnimIniText);
animationsImage.setAttribute("data-cooltip",slideshowAnimIniText);
window.L.control.attachTooltipEventListener(animationsImage,this._map);app.LOUtil.setImage(
animationsImage,"slideshow-transition.svg",this._map);animationsImage.addEventListener("click",
function(e){this._onA11yString(e.target);this._navigateSkipTransition=!this._navigateSkipTransition;
var slideshowAnimToggleText=this._navigateSkipTransition?_("Enable Animations"):_(
"Disable Animations");animationsImage.setAttribute("aria-label",slideshowAnimToggleText);
animationsImage.setAttribute("data-cooltip",slideshowAnimToggleText);
animationsImage.className="animations-img skipTransition-"+this._navigateSkipTransition}.bind(this))
if(this.isFollower()){var FollowImg=window.L.DomUtil.create("img","right-img",container);
var followText=_("Follow Presentation");window.L.control.attachTooltipEventListener(FollowImg,
this._map);FollowImg.setAttribute("aria-label",followText);FollowImg.setAttribute("data-cooltip",
followText);app.LOUtil.setImage(FollowImg,"slideshow-slideNext.svg",this._map);
FollowImg.addEventListener("click",function(e){e.stopPropagation();_this._onA11yString(e.target);
_this._slideShowNavigator.followLeaderSlide()})}container.addEventListener("mouseenter",function(){
clearTimeout(this._slideControlsTimer)}.bind(this));container.addEventListener("click",function(){
_this.setFollowing(false)})};SlideShowPresenter.prototype.startTimer=function(loopAndRepeatDuration
){app.console.debug("SlideShowPresenter.startTimer");var renderContext=this._slideRenderer._context;
var onTimeoutHandler=this._slideShowNavigator.goToFirstSlide.bind(this._slideShowNavigator);
var PauseTimerType=renderContext instanceof RenderContextGl?PauseTimerGl:PauseTimer2d;
this._pauseTimer=new PauseTimerType(renderContext,loopAndRepeatDuration,onTimeoutHandler);
this._pauseTimer.startTimer()};SlideShowPresenter.prototype.endPresentation=function(force){
this.sendSlideShowFollowMessage("endpresentation");this.checkDarkMode(false);app.console.debug(
"SlideShowPresenter.endPresentation");if(this._pauseTimer)this._pauseTimer.stopTimer();
var settings=this._presentationInfo;if(force||!settings.isEndless){if(
!force&&this.exitSlideshowWithWarning()){return}this._stopFullScreen();this._closeSlideShowWindow();
return}this.startTimer(settings.loopAndRepeatDuration)};
SlideShowPresenter.prototype.handleSlideShowProgressBar=function(event){try{if(
!this._progressBarContainer)return;this._progressBarContainer.style.display=(
event===null||event===void 0?void 0:event.isVisible)?"block":"none"}catch(error){app.console.error(
"Not able to Slideshow progress bar",error)}};SlideShowPresenter.prototype.startLoader=function(){
try{this._canvasLoader=new CanvasLoaderGl(this._slideRenderer._context)}catch(error){
this._canvasLoader=new CanvasLoader2d(this._slideRenderer._context)}this._canvasLoader.startLoader()
this._startingPresentation=false};SlideShowPresenter.prototype.stopLoader=function(){if(
!this._canvasLoader)return;this._canvasLoader.stopLoader();this._canvasLoader=null};
SlideShowPresenter.prototype._generateSlideWindowHtml=function(title){
var sanitizer=document.createElement("div");sanitizer.innerText=title;
var sanitizedTitle=sanitizer.innerHTML;
return'\n\t\t\t<!DOCTYPE html>\n\t\t\t<html lang="en">\n\t\t\t<head>\n\t\t\t\t<meta charset="UTF-8">\n\t\t\t\t<meta name="viewport" content="width=device-width, initial-scale=1">\n\t\t\t\t<title>'+sanitizedTitle+'</title>\n\t\t\t\t<link rel="stylesheet" href="progressbar.css" />\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<div id="root-in-window"></div>\n\t\t\t</body>\n\t\t\t</html>\n\t\t\t'
};SlideShowPresenter.prototype._closeSlideShowWindow=function(){if(this._slideShowWindowProxy){
this._slideShowWindowProxy.parentElement.removeChild(this._slideShowWindowProxy);this._map.fire(
"presentinwindowclose");this._slideShowWindowProxy=null}this._enablePresenterConsole(false);
this._map.uiManager.closeSnackbar();this._map.focus()};
SlideShowPresenter.prototype._doFallbackPresentation=function(){this._stopFullScreen();
this._doInWindowPresentation()};SlideShowPresenter.prototype._getProxyDocumentNode=function(){
return this._slideShowWindowProxy.contentWindow.document};
SlideShowPresenter.prototype._doInWindowPresentation=function(){var popupTitle=_(
"Windowed Presentation: ")+this._map["wopi"].BaseFileName;
var htmlContent=this._generateSlideWindowHtml(popupTitle);
this._slideShowWindowProxy=window.L.DomUtil.createWithId("iframe","slideshow-cypress-iframe",
document.body);this._getProxyDocumentNode().open();this._getProxyDocumentNode().write(htmlContent);
if(!this._slideShowWindowProxy){this._notifyBlockedPresenting();return}
this._slideShowWindowProxy.focus();this._getProxyDocumentNode().body.style.margin="0";
this._getProxyDocumentNode().body.style.padding="0";this._getProxyDocumentNode(
).body.style.height="100%";this._getProxyDocumentNode().body.style.overflow="hidden";
var body=this._getProxyDocumentNode().querySelector("#root-in-window");
this._presenterContainer=this._createPresenterHTML(body,window.screen.width,window.screen.height);
window.addEventListener("resize",this.onSlideWindowResize);this._getProxyDocumentNode(
).addEventListener("keydown",this._onKeyDownHandler);this._slideShowWindowProxy.addEventListener(
"unload",window.L.bind(this._closeSlideShowWindow,this));
var slideShowWindow=this._slideShowWindowProxy;this._map.uiManager.showSnackbar(_(
"Presenting in window"),_("Close Presentation"),window.L.bind(this._closeSlideShowWindow,this),-1,
false,true);this._windowCloseInterval=setInterval(function(){if(!slideShowWindow.isConnected
)this.slideshowWindowCleanUp()}.bind(this),500);window.addEventListener("beforeunload",
this.slideshowWindowCleanUp.bind(this));this._slideShowCanvas.focus()};
SlideShowPresenter.prototype._onImpressModeChangedImpl=function(e,inWindow){if(
this._onImpressModeChanged&&e.mode===0){this._map.off("impressmodechanged",
this._onImpressModeChanged,this);this._onImpressModeChanged=null;var startSlide={
startSlideNumber:this._startSlide};var startSlideshow=inWindow?this._onStartInWindow:this._onStart;
setTimeout(startSlideshow.bind(this,startSlide),500)}};
SlideShowPresenter.prototype._onPrepareScreen=function(inWindow){var e_1,_a;var _this=this;if(
this._checkPresentationDisabled()){this._notifyPresentationDisabled();return false}if(
this._checkAlreadyPresenting()){this._notifyAlreadyPresenting();return false}if(
app.impress.notesMode){app.console.debug(
"SlideShowPresenter._onPrepareScreen: notes mode is enabled, exiting");
this._skipNextSlideShowInfoChangedMsg=true;this._onImpressModeChanged=function(e){
this._onImpressModeChangedImpl(e,inWindow)};this._map.on("impressmodechanged",
this._onImpressModeChanged,this);app.map.sendUnoCommand(".uno:NormalMultiPaneGUI");return false}if(
app.impress.areAllSlidesHidden()){this._notifyAllSlidesHidden();return false}
var videos=document.getElementsByTagName("video");try{for(var _b=__values(Array.from(videos)),
_c=_b.next();!_c.done;_c=_b.next()){var video=_c.value;video.pause()}}catch(e_1_1){e_1={error:e_1_1}
}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}}if(
!this._map["wopi"].DownloadAsPostMessage){if(inWindow){this._doInWindowPresentation();return true}
this._presenterContainer=this._createPresenterHTML(this._map._container,window.screen.width,
window.screen.height);if(this._presenterContainer.requestFullscreen){
this._presenterContainer.requestFullscreen().then(function(){}).catch(function(){
_this._doFallbackPresentation()});return true}}this._doFallbackPresentation();return true};
SlideShowPresenter.prototype._checkAlreadyPresenting=function(){if(this._slideShowCanvas)return true
return false};SlideShowPresenter.prototype._notifyAllSlidesHidden=function(){
this._map.uiManager.showInfoModal("allslidehidden-modal",_("Empty Slide Show"),
"All slides are hidden!","",_("OK"),function(){},false,"allslidehidden-modal-response")};
SlideShowPresenter.prototype._notifyAlreadyPresenting=function(){this._map.uiManager.showInfoModal(
"already-presenting-modal",_("Already presenting"),_("You are already presenting this document"),"",
_("OK"),null,false)};SlideShowPresenter.prototype._notifyBlockedPresenting=function(){
this._enablePresenterConsole(false);this._map.uiManager.showInfoModal("popup-blocked-modal",_(
"Windowed Presentation Blocked"),_(
"Presentation was blocked. Please allow pop-ups in your browser. This lets slide shows to be displayed in separated windows, allowing for easy screen sharing."
),"",_("OK"),null,false)};SlideShowPresenter.prototype._enablePresenterConsole=function(state){
this._map.fire("commandstatechanged",{commandName:"presenterconsole",disabled:state})};
SlideShowPresenter.prototype._checkPresentationDisabled=function(){return this._map["wopi"
].DisablePresentation};SlideShowPresenter.prototype._notifyPresentationDisabled=function(){
this._map.uiManager.showInfoModal("presentation-disabled-modal",_("Presentation disabled"),_(
"Presentation mode has been disabled for this document"),"",_("OK"),null,false)};
SlideShowPresenter.prototype.checkDarkMode=function(starting){if(starting){
var isDarkMode=window.prefs.getBoolean("darkTheme");if(isDarkMode){this._wasInDarkMode=true;
app.map.uiManager.toggleDarkMode()}}else if(this._wasInDarkMode){app.map.uiManager.toggleDarkMode();
this._wasInDarkMode=false}};SlideShowPresenter.prototype._onStart=function(that){var _a;
this._startSlide=(_a=that===null||that===void 0?void 0:that.startSlideNumber
)!==null&&_a!==void 0?_a:0;if(!this._onPrepareScreen(false))return;this.checkDarkMode(true);
this._map._docLayer._preview.partsFocused=false;this._startingPresentation=true;
app.socket.sendMessage("getpresentationinfo")};
SlideShowPresenter.prototype._onStartInWindow=function(that){var _a;this.sendSlideShowFollowMessage(
"newfollowmepresentation");this._startSlide=(
_a=that===null||that===void 0?void 0:that.startSlideNumber)!==null&&_a!==void 0?_a:0;if(
!this._onPrepareScreen(true))return;this.checkDarkMode(true);this._enablePresenterConsole(true);
this._startingPresentation=true;app.socket.sendMessage("getpresentationinfo")};
SlideShowPresenter.prototype.onSlideShowInfo=function(data){app.console.debug(
"SlideShow: received information about presentation");this._presentationInfo=data;
var numberOfSlides=this._getSlidesCount();if(numberOfSlides===0)return;if(!this.getCanvas()){
app.console.debug("onSlideShowInfo: no canvas available");return}var skipTransition=false;if(
!this._metaPresentation){this._metaPresentation=new MetaPresentation(data,this._slideShowHandler,
this._slideShowNavigator);this._slideShowHandler.setMetaPresentation(this._metaPresentation);
this._slideShowNavigator.setMetaPresentation(this._metaPresentation)}else{
this._slideShowNavigator.disable();var currentSlideHash=this._metaPresentation.getCurrentSlideHash()
if(this._presentationInfoChanged||currentSlideHash){this._presentationInfoChanged=false;if(
currentSlideHash)this._slideCompositor.pauseVideos(currentSlideHash);
this._slideShowHandler.skipAllEffects();this._slideShowHandler.cleanLeavingSlideStatus(
this._slideShowNavigator.currentSlideIndex,true);this._metaPresentation.update(data);
var slideInfo=this._metaPresentation.getSlideInfo(currentSlideHash);
this._startSlide=slideInfo?slideInfo.indexInSlideShow:0;skipTransition=true}else{
this._metaPresentation.update(data)}}if(!this._slideCompositor){
this._slideCompositor=new SlideShow.LayersCompositor(this,this._metaPresentation)}
this._slideCompositor.onUpdatePresentationInfo();var canvasSize=this._slideCompositor.getCanvasSize(
);this._slideShowCanvas.width=canvasSize[0];this._slideShowCanvas.height=canvasSize[1];
this.centerCanvas();this._metaPresentation.getMetaSlides().forEach(function(metaSlide){if(
metaSlide.animationsHandler){var animElemMap=metaSlide.animationsHandler.getAnimatedElementMap();
animElemMap.forEach(function(animatedElement){animatedElement.updateCanvasSize(canvasSize)})}});
this.startLoader();this._slideShowNavigator.enable();this._slideShowNavigator.startPresentation(
this._startSlide,skipTransition)};SlideShowPresenter.prototype.onSlideShowInfoChanged=function(){if(
this._presentationInfoChanged)return;if(this._skipNextSlideShowInfoChangedMsg){
this._skipNextSlideShowInfoChangedMsg=false;return}this._presentationInfoChanged=true;
app.socket.sendMessage("getpresentationinfo")};SlideShowPresenter.prototype.isLeader=function(){
return this._isLeader};SlideShowPresenter.prototype.setLeader=function(leader){this._isLeader=leader
};SlideShowPresenter.prototype.setFollower=function(follower){this._isFollower=follower};
SlideShowPresenter.prototype.isFollower=function(){return this._isFollower};
SlideShowPresenter.prototype.setFollowing=function(follow){this._isFollowing=follow};
SlideShowPresenter.prototype.isFollowing=function(){return this._isFollowing};
SlideShowPresenter.prototype.sendSlideShowFollowMessage=function(msg){if(this.isLeader()
)app.socket.sendMessage("slideshowfollow "+msg)};return SlideShowPresenter}();
SlideShow.SlideShowPresenter=SlideShowPresenter;class PresenterConsole{constructor(map,presenter){
this._map=map;this._presenter=presenter;this._map.on("presentationinfo",this._onPresentationInfo,
this);this._map.on("newpresentinconsole",this._onPresentInConsole,this)}_generateHtml(title){
this.labels={currentSlide:_("Current Slide"),nextSlide:_("Next Slide"),previous:_("Previous"),
next:_("Next"),notes:_("Notes"),slides:_("Slides"),pause:_("Pause"),restart:_("Restart"),resume:_(
"Resume"),goBack:_("Go Back"),zoomIn:_("Zoom In"),zoomOut:_("Zoom Out")};
let sanitizer=document.createElement("div");sanitizer.innerText=title;
let sanitizedTitle=sanitizer.innerHTML;
return`
			<!DOCTYPE html>
			<html lang="en">
			<head>
				<meta charset="UTF-8">
				<meta name="viewport" content="width=device-width, initial-scale=1">
				<title>${sanitizedTitle}</title>
			</head>
			<body>
                                <header>
                                </header>
                                <main id="main-content">
								  <div id="toolbar">
									<button type="button" id="close-slides" data-cooltip="${this.labels.goBack}" aria-label="${this.labels.goBack}">
										<img src="${LOUtil.getImageURL("presenterscreen-ArrowBack.svg"
)}">
									</button>
                                  </div>
                                  <div id="presentation-content">
                                    <div id="first-presentation">
										<div id="timer-container">
											<div id="timer"></div>
											 <div id="timer-controls">
												<button type="button" id="pause" data-cooltip="${this.labels.pause}" aria-label="${this.labels.pause}">
													<img src="${LOUtil.getImageURL("presenterscreen-ButtonPauseTimerNormal.svg"
)}">
												</button>
												<button type="button" id="restart" data-cooltip="${this.labels.restart}" aria-label="${this.labels.restart}">
													<img src="${LOUtil.getImageURL("presenterscreen-ButtonRestartTimerNormal.svg"
)}">
												</button>
											 </div>
											<div id="today"></div>
										</div>
                                        <div id='current-slide-container'>
                                            <canvas id="current-presentation"></canvas>
											<div id="slideshow-control-container">
											<div id="navigation-container">
												<button type="button" id="prev" data-cooltip="${this.labels.previous}" aria-label="${this.labels.previous}">
													<img src="${LOUtil.getImageURL("presenterscreen-ButtonSlidePreviousSelected.svg"
)}">
												</button>
												<div id="title-current">${this.labels.currentSlide}</div>
												<button type="button" id="next" data-cooltip="${this.labels.next}" aria-label="${this.labels.next}">
													<img src="${LOUtil.getImageURL("presenterscreen-ButtonEffectNextSelected.svg"
)}">
												</button>
											</div>
											<div id="action-buttons-container">
												<button type="button" id="notes" data-cooltip="${this.labels.notes}" aria-label=${this.labels.notes}">
													<img src="${LOUtil.getImageURL("presenterscreen-ButtonNotesNormal.svg"
)}">
												</button>
												<button type="button" id="slides" data-cooltip="${this.labels.slides}" aria-label="${this.labels.slides}">
													<img src="${LOUtil.getImageURL("presenterscreen-ButtonSlideSorterNormal.svg")}">
												</button>
											</div>
										</div>
                                        </div>
									</div>
									<div id="notes-separator"></div>
                                     <div id="second-presentation">
                                         <div id="title-next">${this.labels.nextSlide}</div>
                                         <div id='next-slide-container'>
                                            <img id="next-presentation"></img>
                                         </div>
                                    </div>
                                  </div>
                                </main>
                                <footer>
                                </footer>
			</body>
			</html>
			`}_getSlidesCount(){return this._presenter._getSlidesCount()}_getRepeatDuration(){
return this._presenter._getRepeatDuration()}_isSlideHidden(slideNumber){
return this._presenter.isSlideHidden(slideNumber)}_getNextVisibleSlide(slideNumber){
return this._presenter.getNextVisibleSlide(slideNumber)}_getVisibleIndex(slideNumber){
return this._presenter.getVisibleIndex(slideNumber)}_onPresentationInfo(){if(!this._proxyPresenter){
return}this._map.on("newslideshowframe",this._onNextFrame,this);this._map.on("transitionstart",
this._onTransitionStart,this);this._map.on("transitionend",this._onTransitionEnd,this);this._map.on(
"tilepreview",this._onTilePreview,this);this._boundOnWindowClose=this._onWindowClose.bind(this);
this._map.on("presentinwindowclose",this._boundOnWindowClose,this);
const currentPresentationCanvas=this._proxyPresenter.document.querySelector("#current-presentation")
if(!currentPresentationCanvas)return;this._computeCanvas(currentPresentationCanvas);
currentPresentationCanvas.addEventListener("click",this._onPresenterCanvasClick.bind(this));
this._timer=this._proxyPresenter.setInterval(window.L.bind(this._onTimer,this),1e3);this._ticks=0;
this._pause=false;this._visibleSlidesCount=this._presenter.getVisibleSlidesCount();
this._previews=new Array(this._getSlidesCount());this._disableButton(this._prevButton);if(
this._slides){let img;let elem=this._slides.querySelector("#slides-preview");for(
let index=0;index<this._getSlidesCount();index++){if(this._isSlideHidden(index))continue;
img=this._proxyPresenter.document.createElement("img");img.id=`preview-slide-${index}`;
img.src=document.querySelector('meta[name="previewImg"]').content;img.alt=_("Preview Slide {1}"
).replace("{1}",index+1);img.style.marginLeft="10px";img.style.marginRight="10px";
img.style.marginTop="10px";img.style.marginBottom="10px";img.style.border="3px solid transparent";
img.style.padding="1px";img.style.borderRadius="3px";img.width=100;img.height=100;img._index=index;
img.tabIndex=0;elem.append(img)}}}_onPresenterCanvasClick(event){const canvas=event.target;
const rect=canvas.getBoundingClientRect();const relativeX=(event.clientX-rect.left
)/canvas.clientWidth;const relativeY=(event.clientY-rect.top)/canvas.clientHeight;this._map.fire(
"presentercanvasclick",{relativeX:relativeX,relativeY:relativeY,originalEvent:event})}
_onImpressModeChanged(e){if(this._waitForExitingNotesMode&&e.mode===0){
this._waitForExitingNotesMode=false;this._map.off("impressmodechanged",this._onImpressModeChanged,
this);setTimeout(this._onPresentInConsole.bind(this),500)}}_onPresentInConsole(){if(
app.impress.notesMode){app.console.debug(
"PresenterConsole._onPresentInConsole: notes mode is enabled, exiting");
this._presenter._skipNextSlideShowInfoChangedMsg=true;this._waitForExitingNotesMode=true;
this._map.on("impressmodechanged",this._onImpressModeChanged,this);app.map.sendUnoCommand(
".uno:NormalMultiPaneGUI");return}this._map.fire("newpresentinwindow");if(
!this._presenter._slideShowWindowProxy){return}this._proxyPresenter=window.open("","_blank",
"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,popup=true");if(
!this._proxyPresenter){this._presenter._notifyBlockedPresenting();return}
this._proxyPresenter.document.open();this._proxyPresenter.document.write(this._generateHtml(_(
"Presenter Console")));this._proxyPresenter.document.close();
this._currentSlideCanvas=this._proxyPresenter.document.querySelector("#current-presentation");
this._currentSlideContext=this._currentSlideCanvas.getContext("bitmaprenderer");
this._boundOnResize=this._onResize.bind(this);this._proxyPresenter.addEventListener("resize",
this._boundOnResize);if(this._presenter._slideShowWindowProxy){
this._presenter._slideShowWindowProxy.addEventListener("unload",this._boundOnWindowClose);
window.addEventListener("beforeunload",this._boundOnWindowClose)}
this._proxyPresenter.addEventListener("unload",window.L.bind(this._onConsoleClose,this));
this._boundOnKeyDown=this._onKeyDown.bind(this);this._proxyPresenter.addEventListener("keydown",
this._boundOnKeyDown);this._prevButton=this._proxyPresenter.document.querySelector("#prev");
this._nextButton=this._proxyPresenter.document.querySelector("#next");
this._proxyPresenter.document.body.style.margin="0";
this._proxyPresenter.document.body.style.padding="0";
this._proxyPresenter.document.body.style.overflowX="hidden";
this._proxyPresenter.document.body.style.display="flex";
this._proxyPresenter.document.body.style.flexDirection="column";
this._proxyPresenter.document.body.style.minHeight="100vh";
this._proxyPresenter.document.body.style.minWidth="100vw";let elem;
let mainContentContainer=this._proxyPresenter.document.querySelector("#main-content");
let slideShowBGColor=window.getComputedStyle(document.documentElement).getPropertyValue(
"--color-background-slideshow");this.slideShowColor=window.getComputedStyle(document.documentElement
).getPropertyValue("--color-slideshow");let slideShowFontFamily=window.getComputedStyle(
document.documentElement).getPropertyValue("--cool-font");
this.slideSelectionColor=window.getComputedStyle(document.documentElement).getPropertyValue(
"--orange1-txt-primary-color");this.PresenterConsoleBtnHoverColor=window.getComputedStyle(
document.documentElement).getPropertyValue("--color-presenter-console-btn-hover");
this.PresenterConsoleBtnRadius=window.getComputedStyle(document.documentElement).getPropertyValue(
"--border-radius");mainContentContainer.style.backgroundColor=slideShowBGColor;
mainContentContainer.style.color=this.slideShowColor;
mainContentContainer.style.fontFamily=slideShowFontFamily;mainContentContainer.style.display="flex";
mainContentContainer.style.flexDirection="column";mainContentContainer.style.minWidth="100vw";
mainContentContainer.style.minHeight="100vh";mainContentContainer.style.userSelect="none";
this._proxyPresenter.document.body.style.backgroundColor=slideShowBGColor;
elem=this._proxyPresenter.document.querySelector("#presentation-content");elem.style.display="flex";
elem.style.flexWrap="wrap";elem.style.gap="3vw";elem.style.marginBottom="10px";
this._first=elem=this._proxyPresenter.document.querySelector("#first-presentation");
elem.style.display="flex";elem.style.flexDirection="column";elem.style.flex="1";elem.style.gap="1vh"
elem.style.marginTop="4vh";elem.style.marginLeft="2vw";
let currentSlideActionButtons=this._first.querySelectorAll("button");
currentSlideActionButtons.forEach(button=>{button.style.display="flex";
button.style.flexDirection="column";button.style.alignItems="center";
button.style.backgroundColor="transparent";button.style.color=this.slideShowColor;
button.style.border="none";button.style.borderRadius=this.PresenterConsoleBtnRadius});
elem=this._proxyPresenter.document.querySelector("#title-current");elem.style.display="flex";
elem.style.flexDirection="column";elem.style.justifyContent="center";elem.style.alignItems="center";
elem.style.backgroundColor="transparent";elem.style.color=this.slideShowColor;
elem.style.fontSize="22px";elem=this._proxyPresenter.document.querySelector(
"#current-slide-container");elem.style.width="56vw";elem.style.height="67vh";
let slideshowControlContainer=this._proxyPresenter.document.querySelector(
"#slideshow-control-container");slideshowControlContainer.style.display="flex";
slideshowControlContainer.style.gap="2vw";slideshowControlContainer.style.alignItems="center";
slideshowControlContainer.style.marginTop="1vh";
let navigationContainer=this._proxyPresenter.document.getElementById("navigation-container");
navigationContainer.style.display="flex";navigationContainer.style.width="max-content";
navigationContainer.style.alignItems="center";navigationContainer.style.gap="0.5vw";
let navigationButtons=this._proxyPresenter.document.querySelectorAll("#navigation-container button")
navigationButtons.forEach(button=>{button.style.border="none";button.style.justifyContent="center"})
let actionBtnContainer=this._proxyPresenter.document.querySelector("#action-buttons-container");
actionBtnContainer.style.display="flex";actionBtnContainer.style.gap="1vw";
this._first.addEventListener("click",window.L.bind(this._onToolbarClick,this));
let notesSeparator=this._proxyPresenter.document.querySelector("#notes-separator");
notesSeparator.style.backgroundColor="transparent";notesSeparator.style.color="transparent";
notesSeparator.style.border="1px solid";notesSeparator.style.margin="2vh 0vw";
notesSeparator.style.height="85vh";this._second=elem=this._proxyPresenter.document.querySelector(
"#second-presentation");elem.style.display="flex";elem.style.flexDirection="column";
elem.style.flex="1";elem.style.gap="1vh";elem.style.marginTop="4vh";
elem=this._proxyPresenter.document.querySelector("#title-next");elem.style.display="flex";
elem.style.flexDirection="column";elem.style.backgroundColor="transparent";
elem.style.color=this.slideShowColor;elem.style.height="35px";elem.style.fontSize="22px";
elem.style.justifyContent="center";
let nextSlideContainer=this._proxyPresenter.document.querySelector("#next-slide-container");
nextSlideContainer.style.width="25vw";nextSlideContainer.style.height="80vh";
nextSlideContainer.style.display="flex";nextSlideContainer.style.flexDirection="column";
nextSlideContainer.style.gap="2vw";elem=this._proxyPresenter.document.querySelector(
"#next-presentation");elem.addEventListener("click",window.L.bind(this._onClickPreview,this));
this._notes=this._proxyPresenter.document.createElement("div");this._notes.style.height="45vh";
this._notes.style.width="25vw";this._notes.style.paddingTop="10px";
this._notes.style.borderTop="2px solid transparent";this._notes.style.fontSize="24px";
this._notes.style.overflowX="hidden";elem=this._proxyPresenter.document.createElement("div");
elem.id="notes";elem.style.height="100%";elem.style.width="100%";elem.style.userSelect="text";
this._notes.appendChild(elem);nextSlideContainer.appendChild(this._createTextScalerContainer());
this._slides=this._proxyPresenter.document.createElement("div");this._slides.style.height="100%";
this._slides.style.width="100%";this._slides.style.display="flex";
this._slides.style.flexDirection="column";this._slides.style.gap="2vh";
elem=this._proxyPresenter.document.createElement("div");elem.id="slides-preview";
elem.style.overflow="auto";elem.style.height="90vh";elem.style.width="100%";
elem.style.display="flex";elem.style.flexWrap="wrap";elem.style.justifyContent="center";
elem.style.columnGap="5vw";this._slides.appendChild(elem);this._slides.addEventListener("click",
window.L.bind(this._onClickSlides,this));this._slides.addEventListener("keydown",function(event){if(
event.code!=="Enter")return;this._onClickSlides(event)}.bind(this));
elem=this._proxyPresenter.document.querySelector("#toolbar");elem.style.display="flex";
elem.style.alignItems="center";elem.style.backgroundColor=slideShowBGColor;
elem.style.overflow="hidden";elem.style.width="100%";elem.style.gap="1vw";
elem.style.margin="1vh 0vw";elem.style.height="6vh";elem.addEventListener("click",window.L.bind(
this._onToolbarClick,this));let list=this._proxyPresenter.document.querySelectorAll(
"#toolbar button");for(elem=0;elem<list.length;elem++){list[elem].style.display="flex";list[elem
].style.flexDirection="column";list[elem].style.justifyContent="center";list[elem
].style.alignItems="center";list[elem].style.backgroundColor="transparent";list[elem
].style.color=this.slideShowColor;list[elem].style.padding="10px";list[elem].style.height="6vh";
list[elem].style.border="none"}let closeSlideButton=this._proxyPresenter.document.querySelector(
"#close-slides");closeSlideButton.style.display="none";closeSlideButton.style.marginLeft="10px";
elem=this._proxyPresenter.document.querySelector("#timer-container");elem.style.display="flex";
elem.style.alignItems="center";elem.style.gap="15px";
elem=this._proxyPresenter.document.querySelector("#timer");elem.style.fontSize="22px";
elem.style.width="85px";elem.style.color=this.slideShowColor;
let timeControlElem=this._proxyPresenter.document.querySelector("#timer-controls");
timeControlElem.style.display="flex";timeControlElem.style.alignItems="center";
timeControlElem.style.gap="5px";timeControlElem.addEventListener("click",window.L.bind(
this._onToolbarClick,this));const buttons=timeControlElem.querySelectorAll("button");
buttons.forEach(function(button){button.style.display="flex";button.style.flexDirection="column";
button.style.alignItems="center";button.style.justifyContent="center";
button.style.backgroundColor="transparent";button.style.borderColor="none"}.bind(this));
elem=this._proxyPresenter.document.querySelector("#today");elem.style.textAlign="right";
elem.style.fontSize="22px";elem.style.marginLeft="auto";elem.style.color=this.slideShowColor;
this._ticks=0;this._onTimer();this.tooltip=this._proxyPresenter.document.createElement("div");
this.tooltip.style.position="absolute";this.tooltip.style.backgroundColor="#262626";
this.tooltip.style.color="#e8e8e8";this.tooltip.style.padding="7px 9px";
this.tooltip.style.borderRadius="6px";this.tooltip.style.fontSize="14px";
this.tooltip.style.fontFamily=slideShowFontFamily;this.tooltip.style.whiteSpace="nowrap";
this.tooltip.style.pointerEvents="none";this.tooltip.style.zIndex="2147483647";
this.tooltip.style.boxShadow="rgba(77, 77, 77, 0.5) 0px 0px 4px 0px";
this.tooltip.style.display="none";mainContentContainer.append(this.tooltip);
this._tooltip=window.L.control.tooltip({window:this._proxyPresenter,container:this.tooltip});
let allPresenterConsoleButtons=this._proxyPresenter.document.querySelectorAll("button");
this._attachTooltips(allPresenterConsoleButtons);this._onShowNotes();this._onResize();
this._proxyPresenter.addEventListener("load",()=>{
const pauseButton=this._proxyPresenter.document.querySelector("#pause");if(pauseButton){
pauseButton.focus()}})}_showTooltip(button,text){this.tooltip.style.display="block";
this.tooltip.textContent=text;const rect=button.getBoundingClientRect();
const tooltipRect=this.tooltip.getBoundingClientRect();
let left=rect.left+this._proxyPresenter.scrollX;let top=rect.bottom+this._proxyPresenter.scrollY+5;
if(left+tooltipRect.width>this._proxyPresenter.innerWidth){
left=this._proxyPresenter.innerWidth-tooltipRect.width-10}if(left<0){left=10}if(
top+tooltipRect.height>this._proxyPresenter.innerHeight){
top=rect.top+this._proxyPresenter.scrollY-tooltipRect.height-5}if(top<0){
top=rect.bottom+this._proxyPresenter.scrollY+5}this.tooltip.style.left=`${left}px`;
this.tooltip.style.top=`${top}px`}_hideTooltip(){this.tooltip.style.display="none"}_attachTooltips(
buttons){buttons.forEach(function(button){button.addEventListener("mouseenter",function(){if(
!button.disable)button.style.backgroundColor=this.PresenterConsoleBtnHoverColor;
button.style.borderRadius=this.PresenterConsoleBtnRadius;const tooltipText=button.getAttribute(
"data-cooltip")||"Button";this._showTooltip(button,tooltipText)}.bind(this));
const hideTooltip=this._hideTooltip.bind(this);button.addEventListener("mouseleave",function(){if(
!button.disable)button.style.backgroundColor="transparent";this._hideTooltip()}.bind(this));if(
button.getAttribute("data-cooltip")===this.labels.slides)button.addEventListener("click",hideTooltip
)}.bind(this))}_adjustFontSize(increment){const MIN_FONT_SIZE=12;const MAX_FONT_SIZE=64;
let currentFontSize=parseInt(this._notes.style.fontSize);let newFontSize=currentFontSize+increment;
let zoomInBtn=this._proxyPresenter.document.querySelector("#increase");
let zoomOutBtn=this._proxyPresenter.document.querySelector("#decrease");if(
newFontSize>=MIN_FONT_SIZE&&newFontSize<=MAX_FONT_SIZE){
this._notes.style.fontSize=`${newFontSize}px`;this._enableButton(zoomInBtn);this._enableButton(
zoomOutBtn)}if(newFontSize<=MIN_FONT_SIZE){this._disableButton(zoomOutBtn)}else if(
newFontSize>=MAX_FONT_SIZE){this._disableButton(zoomInBtn)}}_createTextScalerContainer(){
let fontChangeContainer=this._proxyPresenter.document.createElement("div");
fontChangeContainer.id="textScaler";fontChangeContainer.style.display="none";
let plusButton=this._proxyPresenter.document.createElement("button");plusButton.id="increase";
plusButton.setAttribute("data-cooltip",this.labels.zoomIn);
let plusImage=this._proxyPresenter.document.createElement("img");plusImage.src=LOUtil.getImageURL(
"presenterscreen-ButtonPlusNormal.svg");plusImage.alt="Increase Font";plusButton.appendChild(
plusImage);let minusButton=this._proxyPresenter.document.createElement("button");
minusButton.id="decrease";minusButton.setAttribute("data-cooltip",this.labels.zoomOut);
let minusImage=this._proxyPresenter.document.createElement("img");minusImage.src=LOUtil.getImageURL(
"presenterscreen-ButtonMinusNormal.svg");minusImage.alt="Decrease Font";minusButton.appendChild(
minusImage);fontChangeContainer.appendChild(plusButton);fontChangeContainer.appendChild(minusButton)
let fontScalerButtons=fontChangeContainer.querySelectorAll("button");fontScalerButtons.forEach(
function(button){button.style.display="flex";button.style.flexDirection="column";
button.style.alignItems="center";button.style.backgroundColor="transparent";
button.style.border="none";button.style.margin="0 5px"}.bind(this));
fontChangeContainer.addEventListener("click",window.L.bind(this._onToolbarClick,this));
return fontChangeContainer}_pauseButton(){let pauseBtn=this._proxyPresenter.document.querySelector(
"#pause");let imgElem=this._proxyPresenter.document.querySelector("#pause>img");if(this._pause){
imgElem.src="images/presenterscreen-ButtonResumeTimerNormal.svg";pauseBtn.setAttribute(
"data-cooltip",this.labels.resume)}else{
imgElem.src="images/presenterscreen-ButtonPauseTimerNormal.svg";pauseBtn.setAttribute("data-cooltip"
,this.labels.pause)}if(!this._timerReset){this._showTooltip(pauseBtn,pauseBtn.getAttribute(
"data-cooltip"));return}this._timerReset=false}_onKeyDown(e){this._presenter.getNavigator(
).onKeyDown(e)}_onClickPreview(e){this._presenter.getNavigator().onClick(e)}_onToolbarClick(e){
let target=e.target;if(!target){return}if(target.localName!=="button"){target=target.parentElement}
if(target.localName!=="button"){return}
const isLastSlide=this._currentIndex+1==this._visibleSlidesCount;switch(target.id){case"prev":{
this._presenter.getNavigator().rewindEffect();break}case"next":{this._presenter.getNavigator(
).dispatchEffect();if(isLastSlide&&!this._presenter._presentationInfo.isEndless){
this._onWindowClose();break}break}case"pause":this._pause=!this._pause;this._pauseButton();break;
case"restart":this._pause=false;this._ticks=0;this._drawClock();this._timerReset=true;
this._pauseButton();this._proxyPresenter.clearInterval(this._timer);
this._timer=this._proxyPresenter.setInterval(window.L.bind(this._onTimer,this),1e3);break;
case"help":break;case"notes":if(
this._proxyPresenter.document.contains(this._notes)){this._onHideNotes()}else{this._onShowNotes()}
break;case"slides":this._onShowSlides();break;case"close-slides":this._onHideSlides();break;
case"increase":this._adjustFontSize(2);break;case"decrease":this._adjustFontSize(-2);break}
e.stopPropagation()}_resizePreviews(width,height){let preview;
let previews=this._slides.querySelector("#slides-preview");let size=this._map.getPreview(2e3,0,width
,height,{fetchThumbnail:false,autoUpdate:false});for(
let index=0;index<this._visibleSlidesCount;index++){preview=previews.children.item(index);if(
preview.width!==size.width||preview.height!==size.height||width!==size.width||height!==size.height){
this._map.getPreview(2e3,preview._index,size.width,size.height,{autoUpdate:false,slideshow:true})}}}
_onShowSlides(){let elem=this._proxyPresenter.document.querySelector("#slides");
this.toggleButtonState(elem,true);let closeSlideButton=this._proxyPresenter.document.querySelector(
"#close-slides");closeSlideButton.style.display="block";
elem=this._proxyPresenter.document.querySelector("#next-presentation");
let rect=elem.getBoundingClientRect();
let notesSeparator=this._proxyPresenter.document.querySelector("#notes-separator");
notesSeparator.style.display="none";this._first.style.display="none";
this._second.style.display="none";elem=this._proxyPresenter.document.querySelector(
"#presentation-content");elem.appendChild(this._slides);if(this._selectedImg){
this._selectedImg.scrollIntoView()}this._proxyPresenter.setTimeout(window.L.bind(
this._resizePreviews,this,rect.width,rect.height),0)}_onHideSlides(){
let elem=this._proxyPresenter.document.querySelector("#presentation-content");this._slides.remove();
let notesSeparator=this._proxyPresenter.document.querySelector("#notes-separator");
notesSeparator.style.display="block";this._first.style.display="flex";
this._second.style.display="flex";elem=this._proxyPresenter.document.querySelector("#slides");
this.toggleButtonState(elem,false);let closeSlideButton=this._proxyPresenter.document.querySelector(
"#close-slides");closeSlideButton.style.display="none";this._onResize()}_selectImg(img){if(
this._selectedImg){this._selectedImg.style.border="3px solid transparent";this._selectedImg=null}if(
img){this._selectedImg=img;
this._selectedImg.style.border="3px solid rgb("+this.slideSelectionColor+")"}}_onClickSlides(e){if(
e.target&&e.target.localName==="img"){this._selectImg(e.target);if(
this._selectedImg&&this._proxyPresenter){this._proxyPresenter.requestAnimationFrame(function(
navigator,index){navigator.displaySlide(index,true)}.bind(null,this._presenter.getNavigator(),
this._selectedImg._index))}}e.stopPropagation()}_onShowNotes(){
let elem=this._proxyPresenter.document.querySelector("#notes");this.toggleButtonState(elem,true);
let container=this._proxyPresenter.document.querySelector("#next-slide-container");
this._notes.style.borderTopColor=this.slideShowColor;
let notesSeparator=this._proxyPresenter.document.querySelector("#notes-separator");
notesSeparator.style.color=this.slideShowColor;
let textScaler=this._proxyPresenter.document.querySelector("#textScaler");
textScaler.style.display="flex";container.insertBefore(this._notes,textScaler)}_onHideNotes(e){
let notesSeparator=this._proxyPresenter.document.querySelector("#notes-separator");
notesSeparator.style.color="transparent";let textScaler=this._proxyPresenter.document.querySelector(
"#textScaler");textScaler.style.display="none";this._notes.style.borderTopColor="transparent";
this._notes.remove();let elem=this._proxyPresenter.document.querySelector("#notes");
this.toggleButtonState(elem,false);if(e){e.stopPropagation()}}_disableButton(elem){
elem.disabled=true;elem.style.opacity="0.5"}_enableButton(elem){elem.disabled=false;
elem.style.opacity="1"}toggleButtonState(elem,toggleOn){if(toggleOn){
elem.style.filter="brightness(1.4)";elem.style.backgroundColor="black";elem.disable=true}else{
elem.style.filter="";elem.style.backgroundColor="transparent";elem.disable=false}}_onTimer(){if(
!this._proxyPresenter){return}if(!this._pause){++this._ticks}
this._proxyPresenter.requestAnimationFrame(this._drawClock.bind(this))}_drawClock(){if(
!this._proxyPresenter||!this._proxyPresenter.document){return}let sec,min,hour,elem;if(!this._pause
){sec=this._ticks%60;min=Math.floor(this._ticks/60);hour=Math.floor(min/60);min=min%60;
elem=this._proxyPresenter.document.querySelector("#timer");if(elem){elem.innerText=String(hour
).padStart(2,"0")+":"+String(min).padStart(2,"0")+":"+String(sec).padStart(2,"0")}}
let dateTime=new Date;elem=this._proxyPresenter.document.querySelector("#today");if(elem){
elem.innerText=dateTime.toLocaleTimeString(String.Locale,{hour:"2-digit",minute:"2-digit",
second:"2-digit"})}let next=this._proxyPresenter.document.querySelector("#next-presentation");if(
this._ticks%2===0&&typeof this._lastIndex!=="undefined"&&next){
const nextIndex=this._getNextVisibleSlide(this._lastIndex);this._proxyPresenter.setTimeout(
window.L.bind(this._fetchPreview,this,nextIndex,next),0)}}_fetchPreview(index,elem){if(
index>=this._getSlidesCount()){return}let rect=elem.getBoundingClientRect();if(
rect.width===0&&rect.height===0){return}let preview=this._previews[index];if(preview){
this._lastIndex=index;return}let size=this._map.getPreview(2e3,0,rect.width,rect.height,{
fetchThumbnail:false,autoUpdate:false});this._map.getPreview(2e3,index,size.width,size.height,{
autoUpdate:false,slideshow:true})}_onWindowClose(){if(
this._proxyPresenter&&!this._proxyPresenter.closed)this._proxyPresenter.close();
window.removeEventListener("beforeunload",this._boundOnWindowClose);this._presenter._stopFullScreen(
)}_onConsoleClose(){if(
this._presenter._slideShowWindowProxy&&!this._presenter._slideShowWindowProxy.closed
)this._presenter.slideshowWindowCleanUp();this._proxyPresenter.removeEventListener("resize",
this._boundOnResize);this._proxyPresenter.removeEventListener("keydown",this._boundOnKeyDown);
this._proxyPresenter.clearInterval(this._timer);this._proxyPresenter.close();
delete this._proxyPresenter;delete this._currentIndex;delete this._lastIndex;delete this._previews;
this._map.off("newslideshowframe",this._onNextFrame,this);this._map.off("transitionstart",
this._onTransitionStart,this);this._map.off("transitionend",this._onTransitionEnd,this);
this._map.off("tilepreview",this._onTilePreview,this)}_resizeSlideView(viewContainerId,slideViewId){
let container=this._proxyPresenter.document.querySelector("#"+viewContainerId);if(!container){return
}let rect=container.getBoundingClientRect();let size=this._map.getPreview(2e3,0,rect.width,
rect.height,{fetchThumbnail:false,autoUpdate:false});
let slideView=this._proxyPresenter.document.querySelector("#"+slideViewId);if(slideView){
slideView.style.width=size.width+"px";slideView.style.height=size.height+"px"}}_onResize(){if(
!this._proxyPresenter){return}this._proxyPresenter.clearTimeout(this._resizeTimeout);
this._resizeSlideView("current-slide-container","current-presentation");this._resizeSlideView(
"next-slide-container","next-presentation");
let timeControlContainer=this._proxyPresenter.document.querySelector("#timer-container");if(
timeControlContainer){timeControlContainer.style.width=this._currentSlideCanvas.style.width}
this._resizeTimeout=this._proxyPresenter.setTimeout(function(){
let previews=this._proxyPresenter.document.querySelector("#slides-preview");if(
previews&&typeof this._currentIndex!=="undefined"){
let preview=this._proxyPresenter.document.querySelector(`#preview-slide-${this._currentIndex}`);
let height=this._proxyPresenter.innerHeight*.8;let width=this._proxyPresenter.innerWidth*.25;if(
preview.width>=this._proxyPresenter.innerWidth||preview.height>=this._proxyPresenter.innerHeight||preview.width<width
){this._resizePreviews(width,height)}}}.bind(this),800)}_onTransitionStart(e){if(
!this._proxyPresenter){return}this._currentIndex=e.slide;const isFirstSlide=this._currentIndex==0;
let elem=this._proxyPresenter.document.querySelector("#title-current");if(elem){elem.innerText=_(
"Slide {0} of {1}").replace("{0}",this._getVisibleIndex(e.slide)+1).replace("{1}",
this._visibleSlidesCount)}if(isFirstSlide)this._disableButton(this._prevButton
);else this._enableButton(this._prevButton);elem=this._proxyPresenter.document.querySelector(
"#next-presentation");if(elem){const nextIndex=this._getNextVisibleSlide(this._currentIndex);
this._fetchPreview(nextIndex,elem)}}_onTransitionEnd(e){if(!this._proxyPresenter){return}
this._currentIndex=e.slide;if(this._notes){let notes=this._presenter.getNotes(e.slide);
let notesContentElem=this._notes.querySelector("#notes");notesContentElem.innerText=_("No Notes");
if(notes&&notes.toLowerCase()!=="click to add notes".toLowerCase())notesContentElem.innerText=notes}
let img=this._slides.querySelector(`#preview-slide-${this._currentIndex}`);if(img){this._selectImg(
img)}let next=this._proxyPresenter.document.querySelector("#next-presentation");this.drawNext(next)}
drawNext(elem){if(!this._proxyPresenter){return}if(!elem){return}if(this._currentIndex===undefined){
return}let rect=elem.getBoundingClientRect();if(rect.width===0&&rect.height===0){
this._proxyPresenter.requestAnimationFrame(this.drawNext.bind(this,elem));return}
let size=this._map.getPreview(2e3,0,rect.width,rect.height,{fetchThumbnail:false,autoUpdate:false});
const nextSlideIndex=this._getNextVisibleSlide(this._currentIndex);if(
nextSlideIndex>=this._getSlidesCount()){this.drawEnd(size,this._getRepeatDuration()).then(function(
blob){var reader=new FileReader;reader.onload=function(e){elem.src=e.target.result};
reader.readAsDataURL(blob)});return}let preview=this._previews[nextSlideIndex];if(!preview){
elem.src=document.querySelector('meta[name="previewImg"]').content}else{elem.src=preview}if(
!preview||rect.width!==size.width||rect.height!==size.height){this._map.getPreview(2e3,
nextSlideIndex,size.width,size.height,{autoUpdate:false,slideshow:true});
elem.style.width=size.width+"px";elem.style.height=size.height+"px"}}drawEnd(size,repeat){
const width=size.width;const height=size.height;const offscreen=new OffscreenCanvas(width,height);
const ctx=offscreen.getContext("2d");ctx.fillStyle="black";ctx.fillRect(0,0,width,height);
ctx.fillStyle="white";ctx.font="20px sans-serif";ctx.textAlign="center";ctx.textBaseline="middle";
if(repeat>0){ctx.fillText(_("Repeat in {0} seconds").replace("{0}",repeat),width/2,height/2)}else{
ctx.fillText(_("Click to exit presentation..."),width/2,height/2)}return offscreen.convertToBlob({
type:"image/png"})}_onNextFrame(e){const bitmap=e.frame;if(!bitmap){return}createImageBitmap(bitmap,
{resizeWidth:this._currentSlideCanvas.width,resizeHeight:this._currentSlideCanvas.height}).then(
function(image){if(this._proxyPresenter){this._proxyPresenter.requestAnimationFrame(function(context
,image){context.transferFromImageBitmap(image)}.bind(null,this._currentSlideContext,image))}}.bind(
this))}_onTilePreview(e){if(!this._proxyPresenter){return}if(this._currentIndex===undefined){return}
if(e.id!=="2000"){return}const nextSlideIndex=this._getNextVisibleSlide(this._currentIndex);if(
nextSlideIndex===e.part){let next=this._proxyPresenter.document.querySelector("#next-presentation");
if(next){next.src=e.tile.src}}this._previews[e.part]=e.tile.src;this._lastIndex=e.part;
let img=this._slides.querySelector(`#preview-slide-${e.part}`);if(img){img.src=e.tile.src;
img.width=e.width;img.height=e.height}}_computeCanvas(canvas){let rect=canvas.getBoundingClientRect(
);let size=this._presenter._slideCompositor.computeLayerResolution(rect.width,rect.height);
size=this._presenter._slideCompositor.computeLayerSize(size[0],size[1]);canvas.width=size[0];
canvas.height=size[1]}}SlideShow.PresenterConsole=PresenterConsole;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __spreadArray=this&&this.__spreadArray||function(to,from,
pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(
!ar)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var SimpleTextureRenderer=function(){
function SimpleTextureRenderer(canvasContext,createProgram){if(createProgram===void 0){
createProgram=true}this.context=canvasContext;this.gl=this.context.getGl();if(createProgram
)this.createProgram()}SimpleTextureRenderer.prototype.initProgramTemplateParams=function(){};
SimpleTextureRenderer.prototype.createProgram=function(){if(this.context.isDisposed())return;
this.initProgramTemplateParams();var vertexShaderSource=this.getVertexShader();
var fragmentShaderSource=this.getFragmentShader();var vertexShader=this.context.createVertexShader(
vertexShaderSource);var fragmentShader=this.context.createFragmentShader(fragmentShaderSource);
this.program=this.context.createProgram(vertexShader,fragmentShader)};
SimpleTextureRenderer.prototype.getVertexShader=function(){
return"#version 300 es\n\t\t\t\tin vec4 a_position;\n\t\t\t\tin vec2 a_texCoord;\n\t\t\t\tout vec2 v_texCoord;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_Position = a_position;\n\t\t\t\t\tv_texCoord = a_texCoord;\n\t\t\t\t}\n\t\t\t\t"
};SimpleTextureRenderer.prototype.prepareTransition=function(){if(this.context.isDisposed())return;
this.initBuffers();this.initUniforms()};SimpleTextureRenderer.prototype.initUniforms=function(){if(
this.context.isDisposed())return;this.gl.useProgram(this.program)};
SimpleTextureRenderer.prototype.initBuffers=function(){var positions=new Float32Array(__spreadArray(
__spreadArray(__spreadArray(__spreadArray([],[-1,-1,0,0,1],false),[1,-1,0,1,1],false),[-1,1,0,0,0],
false),[1,1,0,1,0],false));this.positionBuffer=this.gl.createBuffer();this.gl.bindBuffer(
this.gl.ARRAY_BUFFER,this.positionBuffer);this.gl.bufferData(this.gl.ARRAY_BUFFER,positions,
this.gl.STATIC_DRAW);this.vao=this.gl.createVertexArray();this.gl.bindVertexArray(this.vao);
var positionLocation=this.gl.getAttribLocation(this.program,"a_position");
var texCoordLocation=this.gl.getAttribLocation(this.program,"a_texCoord");if(positionLocation!==-1){
this.gl.enableVertexAttribArray(positionLocation);this.gl.vertexAttribPointer(positionLocation,3,
this.gl.FLOAT,false,5*4,0)}if(texCoordLocation!==-1){this.gl.enableVertexAttribArray(
texCoordLocation);this.gl.vertexAttribPointer(texCoordLocation,2,this.gl.FLOAT,false,5*4,3*4)}};
return SimpleTextureRenderer}();var TextureAnimationBase=function(_super){__extends(
TextureAnimationBase,_super);function TextureAnimationBase(canvasContext){var _this=_super.call(this
,canvasContext)||this;_this.time=0;_this.startTime=null;return _this}return TextureAnimationBase}(
SimpleTextureRenderer);var __extends=this&&this.__extends||function(){var extendStatics=function(d,b
){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var StaticTextRenderer=function(_super){__extends(
StaticTextRenderer,_super);function StaticTextRenderer(canvasContext){return _super.call(this,
canvasContext)||this}StaticTextRenderer.prototype.display=function(displayText){if(
this.context.isDisposed())return;this.textTexture=this.createTextTexture(displayText);
this.prepareTransition();requestAnimationFrame(this.animate.bind(this))};
StaticTextRenderer.prototype.animate=function(){requestAnimationFrame(this.render.bind(this))};
StaticTextRenderer.prototype.createTextTexture=function(displayText){
var textCanvas=this.create2DCanvasWithText(displayText);return this.load2dCanvasToGlCanvas(
textCanvas)};StaticTextRenderer.prototype.create2DCanvasWithText=function(displayText){if(
this.context.isDisposed())return null;var canvas=document.createElement("canvas");
canvas.width=this.context.canvas.width;canvas.height=this.context.canvas.height;
var ctx=canvas.getContext("2d");ctx.fillStyle="black";ctx.fillRect(0,0,canvas.width,canvas.height);
ctx.fillStyle="white";ctx.font="20px sans-serif";ctx.textAlign="center";ctx.textBaseline="middle";
ctx.fillText(displayText,canvas.width/2,canvas.height/2);return canvas};
StaticTextRenderer.prototype.load2dCanvasToGlCanvas=function(canvas){if(this.context.isDisposed()
)return null;var texture=this.gl.createTexture();if(!texture){throw new Error(
"Failed to create texture")}this.gl.bindTexture(this.gl.TEXTURE_2D,texture);this.gl.texImage2D(
this.gl.TEXTURE_2D,0,this.gl.RGBA,this.gl.RGBA,this.gl.UNSIGNED_BYTE,canvas);this.gl.texParameteri(
this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE);this.gl.texParameteri(
this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE);this.gl.texParameteri(
this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR);this.gl.texParameteri(
this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR);return texture};
StaticTextRenderer.prototype.render=function(){if(this.context.isDisposed())return;this.gl.viewport(
0,0,this.context.canvas.width,this.context.canvas.height);this.gl.clearColor(0,0,0,1);this.gl.clear(
this.gl.COLOR_BUFFER_BIT);this.gl.useProgram(this.program);this.gl.activeTexture(this.gl.TEXTURE0);
this.gl.bindTexture(this.gl.TEXTURE_2D,this.textTexture);
var textureLocation=this.gl.getUniformLocation(this.program,"u_texture");this.gl.uniform1i(
textureLocation,0);this.gl.bindVertexArray(this.vao);this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)}
StaticTextRenderer.prototype.getFragmentShader=function(){
return"#version 300 es\n\t\t\tprecision highp float;\n\t\t\tin vec2 v_texCoord;\n\t\t\tuniform sampler2D u_texture;\n\t\t\tout vec4 outColor;\n\n\t\t\tvoid main() {\n\t\t\t\toutColor = texture(u_texture, v_texCoord);\n\t\t\t}"
};return StaticTextRenderer}(TextureAnimationBase);SlideShow.StaticTextRenderer=StaticTextRenderer;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var PauseTimer=function(){function PauseTimer(){}
return PauseTimer}();var PauseTimer2d=function(){function PauseTimer2d(canvasContext,pauseDuration,
onComplete){this.onComplete=onComplete}PauseTimer2d.prototype.startTimer=function(){this.onComplete(
)};PauseTimer2d.prototype.stopTimer=function(){};return PauseTimer2d}();var PauseTimerGl=function(
_super){__extends(PauseTimerGl,_super);function PauseTimerGl(canvasContext,pauseDuration,onComplete
){var _this=_super.call(this,canvasContext)||this;_this.pauseDuration=pauseDuration;
_this.pauseTimeRemaining=pauseDuration;_this.onComplete=onComplete;if(_this.context.isDisposed()
)return _this;_this.textCanvas=document.createElement("canvas");
_this.textCanvas.width=_this.context.canvas.width;
_this.textCanvas.height=_this.context.canvas.height;_this.ctx=_this.textCanvas.getContext("2d");
_this.textTexture=_this.createTextTexture(_this.getPauseTextContent());_this.prepareTransition();
return _this}PauseTimerGl.prototype.startTimer=function(){if(this.context.isDisposed())return;
this.startTime=performance.now();requestAnimationFrame(this.animate.bind(this))};
PauseTimerGl.prototype.stopTimer=function(){this.pauseTimeRemaining=0;this.delete2dTextCanvas()};
PauseTimerGl.prototype.animate=function(){if(this.context.isDisposed())return;if(
!this.textCanvas||!this.ctx)return;var currentTime=performance.now();var elapsedTime=(
currentTime-this.startTime)/1e3;this.pauseTimeRemaining=Math.max(0,this.pauseDuration-elapsedTime);
this.textTexture=this.createTextTexture(this.getPauseTextContent());this.render();
requestAnimationFrame(this.animate.bind(this));if(this.pauseTimeRemaining<=0){this.onComplete();
this.delete2dTextCanvas();return}};PauseTimerGl.prototype.createTextTexture=function(displayText){
if(this.context.isDisposed())return null;this.clearCanvas();this.drawText(displayText);
return this.load2dCanvasToGlCanvas(this.textCanvas)};PauseTimerGl.prototype.clearCanvas=function(){
this.ctx.clearRect(0,0,this.textCanvas.width,this.textCanvas.height);this.ctx.fillStyle="black";
this.ctx.fillRect(0,0,this.textCanvas.width,this.textCanvas.height)};
PauseTimerGl.prototype.drawText=function(displayText){if(this.context.isDisposed())return;
this.ctx.fillStyle="white";this.ctx.font="20px sans-serif";this.ctx.textAlign="center";
this.ctx.textBaseline="middle";this.ctx.fillText(displayText,this.textCanvas.width/2,
this.textCanvas.height/2)};PauseTimerGl.prototype.delete2dTextCanvas=function(){if(this.textCanvas){
this.textCanvas.remove();this.textCanvas=null;this.ctx=null}};
PauseTimerGl.prototype.getPauseTextContent=function(){return _("Pause... ( %SECONDS% )").replace(
"%SECONDS%",Math.ceil(this.pauseTimeRemaining).toString())};return PauseTimerGl}(StaticTextRenderer)
SlideShow.PauseTimer=PauseTimer;SlideShow.PauseTimer2d=PauseTimer2d;
SlideShow.PauseTimerGl=PauseTimerGl;var TransitionType;(function(TransitionType){TransitionType[
TransitionType["INVALID"]=0]="INVALID";TransitionType[TransitionType["BARWIPE"]=1]="BARWIPE";
TransitionType[TransitionType["PINWHEELWIPE"]=2]="PINWHEELWIPE";TransitionType[TransitionType[
"SLIDEWIPE"]=3]="SLIDEWIPE";TransitionType[TransitionType["RANDOMBARWIPE"]=4]="RANDOMBARWIPE";
TransitionType[TransitionType["CHECKERBOARDWIPE"]=5]="CHECKERBOARDWIPE";TransitionType[
TransitionType["FOURBOXWIPE"]=6]="FOURBOXWIPE";TransitionType[TransitionType["IRISWIPE"]=7
]="IRISWIPE";TransitionType[TransitionType["FANWIPE"]=8]="FANWIPE";TransitionType[TransitionType[
"BLINDSWIPE"]=9]="BLINDSWIPE";TransitionType[TransitionType["FADE"]=10]="FADE";TransitionType[
TransitionType["DISSOLVE"]=11]="DISSOLVE";TransitionType[TransitionType["PUSHWIPE"]=12]="PUSHWIPE";
TransitionType[TransitionType["ELLIPSEWIPE"]=13]="ELLIPSEWIPE";TransitionType[TransitionType[
"BARNDOORWIPE"]=14]="BARNDOORWIPE";TransitionType[TransitionType["WATERFALLWIPE"]=15
]="WATERFALLWIPE";TransitionType[TransitionType["MISCSHAPEWIPE"]=16]="MISCSHAPEWIPE";TransitionType[
TransitionType["ZOOM"]=17]="ZOOM"})(TransitionType||(TransitionType={}));var TransitionSubType;(
function(TransitionSubType){TransitionSubType[TransitionSubType["DEFAULT"]=0]="DEFAULT";
TransitionSubType[TransitionSubType["LEFTTORIGHT"]=1]="LEFTTORIGHT";TransitionSubType[
TransitionSubType["TOPTOBOTTOM"]=2]="TOPTOBOTTOM";TransitionSubType[TransitionSubType["EIGHTBLADE"
]=3]="EIGHTBLADE";TransitionSubType[TransitionSubType["FOURBLADE"]=4]="FOURBLADE";TransitionSubType[
TransitionSubType["THREEBLADE"]=5]="THREEBLADE";TransitionSubType[TransitionSubType[
"TWOBLADEVERTICAL"]=6]="TWOBLADEVERTICAL";TransitionSubType[TransitionSubType["ONEBLADE"]=7
]="ONEBLADE";TransitionSubType[TransitionSubType["FROMTOPLEFT"]=8]="FROMTOPLEFT";TransitionSubType[
TransitionSubType["FROMTOPRIGHT"]=9]="FROMTOPRIGHT";TransitionSubType[TransitionSubType[
"FROMBOTTOMLEFT"]=10]="FROMBOTTOMLEFT";TransitionSubType[TransitionSubType["FROMBOTTOMRIGHT"]=11
]="FROMBOTTOMRIGHT";TransitionSubType[TransitionSubType["VERTICAL"]=12]="VERTICAL";
TransitionSubType[TransitionSubType["HORIZONTAL"]=13]="HORIZONTAL";TransitionSubType[
TransitionSubType["DOWN"]=14]="DOWN";TransitionSubType[TransitionSubType["ACROSS"]=15]="ACROSS";
TransitionSubType[TransitionSubType["CORNERSOUT"]=16]="CORNERSOUT";TransitionSubType[
TransitionSubType["DIAMOND"]=17]="DIAMOND";TransitionSubType[TransitionSubType["CIRCLE"]=18
]="CIRCLE";TransitionSubType[TransitionSubType["RECTANGLE"]=19]="RECTANGLE";TransitionSubType[
TransitionSubType["CENTERTOP"]=20]="CENTERTOP";TransitionSubType[TransitionSubType["CROSSFADE"]=21
]="CROSSFADE";TransitionSubType[TransitionSubType["FADEOVERCOLOR"]=22]="FADEOVERCOLOR";
TransitionSubType[TransitionSubType["FROMLEFT"]=23]="FROMLEFT";TransitionSubType[TransitionSubType[
"FROMRIGHT"]=24]="FROMRIGHT";TransitionSubType[TransitionSubType["FROMTOP"]=25]="FROMTOP";
TransitionSubType[TransitionSubType["FROMBOTTOM"]=26]="FROMBOTTOM";TransitionSubType[
TransitionSubType["HORIZONTALLEFT"]=27]="HORIZONTALLEFT";TransitionSubType[TransitionSubType[
"HORIZONTALRIGHT"]=28]="HORIZONTALRIGHT";TransitionSubType[TransitionSubType["COMBVERTICAL"]=29
]="COMBVERTICAL";TransitionSubType[TransitionSubType["COMBHORIZONTAL"]=30]="COMBHORIZONTAL";
TransitionSubType[TransitionSubType["TOPLEFT"]=31]="TOPLEFT";TransitionSubType[TransitionSubType[
"TOPRIGHT"]=32]="TOPRIGHT";TransitionSubType[TransitionSubType["BOTTOMRIGHT"]=33]="BOTTOMRIGHT";
TransitionSubType[TransitionSubType["BOTTOMLEFT"]=34]="BOTTOMLEFT";TransitionSubType[
TransitionSubType["TOPCENTER"]=35]="TOPCENTER";TransitionSubType[TransitionSubType["RIGHTCENTER"]=36
]="RIGHTCENTER";TransitionSubType[TransitionSubType["BOTTOMCENTER"]=37]="BOTTOMCENTER";
TransitionSubType[TransitionSubType["HEARTCORNERSIN"]=38]="HEARTCORNERSIN";TransitionSubType[
TransitionSubType["FANOUTHORIZONTAL"]=39]="FANOUTHORIZONTAL";TransitionSubType[TransitionSubType[
"CORNERSIN"]=40]="CORNERSIN";TransitionSubType[TransitionSubType["HEART"]=41]="HEART";
TransitionSubType[TransitionSubType["ROTATEIN"]=42]="ROTATEIN"})(TransitionSubType||(
TransitionSubType={}));var stringToTransitionTypeMap={Invalid:TransitionType.INVALID,
BarWipe:TransitionType.BARWIPE,PineWheelWipe:TransitionType.PINWHEELWIPE,
SlideWipe:TransitionType.SLIDEWIPE,RandomBarWipe:TransitionType.RANDOMBARWIPE,
CheckerBoardWipe:TransitionType.CHECKERBOARDWIPE,FourBoxWipe:TransitionType.FOURBOXWIPE,
IrisWipe:TransitionType.IRISWIPE,FanWipe:TransitionType.FANWIPE,BlindWipe:TransitionType.BLINDSWIPE,
Fade:TransitionType.FADE,Dissolve:TransitionType.DISSOLVE,PushWipe:TransitionType.PUSHWIPE,
EllipseWipe:TransitionType.ELLIPSEWIPE,BarnDoorWipe:TransitionType.BARNDOORWIPE,
WaterfallWipe:TransitionType.WATERFALLWIPE,MiscShapeWipe:TransitionType.MISCSHAPEWIPE,
Zoom:TransitionType.ZOOM};var stringToTransitionSubTypeMap={Default:TransitionSubType.DEFAULT,
LeftToRight:TransitionSubType.LEFTTORIGHT,TopToBottom:TransitionSubType.TOPTOBOTTOM,
"8Blade":TransitionSubType.EIGHTBLADE,"4Blade":TransitionSubType.FOURBLADE,
"3Blade":TransitionSubType.THREEBLADE,"2BladeVertical":TransitionSubType.TWOBLADEVERTICAL,
"1Blade":TransitionSubType.ONEBLADE,FromTopLeft:TransitionSubType.FROMTOPLEFT,
FromTopRight:TransitionSubType.FROMTOPRIGHT,FromBottomLeft:TransitionSubType.FROMBOTTOMLEFT,
FromBottomRight:TransitionSubType.FROMBOTTOMRIGHT,Vertical:TransitionSubType.VERTICAL,
Horizontal:TransitionSubType.HORIZONTAL,Down:TransitionSubType.DOWN,Across:TransitionSubType.ACROSS,
CornersOut:TransitionSubType.CORNERSOUT,Diamond:TransitionSubType.DIAMOND,
Circle:TransitionSubType.CIRCLE,Rectangle:TransitionSubType.RECTANGLE,
CenterTop:TransitionSubType.CENTERTOP,CrossFade:TransitionSubType.CROSSFADE,
FadeOverColor:TransitionSubType.FADEOVERCOLOR,FromLeft:TransitionSubType.FROMLEFT,
FromRight:TransitionSubType.FROMRIGHT,FromTop:TransitionSubType.FROMTOP,
FromBottom:TransitionSubType.FROMBOTTOM,HorizontalLeft:TransitionSubType.HORIZONTALLEFT,
HorizontalRight:TransitionSubType.HORIZONTALRIGHT,CombVertical:TransitionSubType.COMBVERTICAL,
CombHorizontal:TransitionSubType.COMBHORIZONTAL,TopLeft:TransitionSubType.TOPLEFT,
TopRight:TransitionSubType.TOPRIGHT,BottomRight:TransitionSubType.BOTTOMRIGHT,
BottomLeft:TransitionSubType.BOTTOMLEFT,TopCenter:TransitionSubType.TOPCENTER,
RightCenter:TransitionSubType.RIGHTCENTER,BottomCenter:TransitionSubType.BOTTOMCENTER,
CornersIn:TransitionSubType.CORNERSIN,FanOutHorizontal:TransitionSubType.FANOUTHORIZONTAL,
Heart:TransitionSubType.HEART,RotateIn:TransitionSubType.ROTATEIN};function createTransition(
transitionParameters,isSlideTransition){
var type=transitionParameters.transitionFilterInfo.transitionType;switch(type){
case TransitionType.BARWIPE:return BarWipeTransition(transitionParameters);
case TransitionType.PINWHEELWIPE:return new SlideShow.WheelTransition(transitionParameters);
case TransitionType.RANDOMBARWIPE:return new SlideShow.BarsTransition(transitionParameters);
case TransitionType.CHECKERBOARDWIPE:return new SlideShow.CheckersTransition(transitionParameters);
case TransitionType.FOURBOXWIPE:return new SlideShow.PlusTransition(transitionParameters);
case TransitionType.IRISWIPE:return SlideShow.IrisWipeTransition(transitionParameters);
case TransitionType.ELLIPSEWIPE:return SlideShow.EllipseWipeTransition(transitionParameters);
case TransitionType.FANWIPE:return new SlideShow.WedgeTransition(transitionParameters);
case TransitionType.BLINDSWIPE:return new SlideShow.VenetianTransition(transitionParameters);
case TransitionType.DISSOLVE:return new SlideShow.SimpleDissolveTransition(transitionParameters);
case TransitionType.BARNDOORWIPE:return new SlideShow.SplitTransition(transitionParameters);
case TransitionType.WATERFALLWIPE:return new SlideShow.DiagonalTransition(transitionParameters)}if(
isSlideTransition){switch(type){case TransitionType.FADE:return new SlideShow.FadeTransition(
transitionParameters);case TransitionType.SLIDEWIPE:return SlideWipeTransition(transitionParameters)
case TransitionType.PUSHWIPE:return SlideShow.PushWipeTransition(transitionParameters);
case TransitionType.MISCSHAPEWIPE:return SlideShow.MicsShapeWipeTransition(transitionParameters);
case TransitionType.ZOOM:return SlideShow.NewsFlashTransition(transitionParameters)}}
app.console.log("Unknown transition type",transitionParameters.transitionFilterInfo.transitionType);
return new SlideShow.NoTransition(transitionParameters)}
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CanvasLoader=function(){function CanvasLoader(){}
return CanvasLoader}();var CanvasLoader2d=function(){function CanvasLoader2d(canvasContext){}
CanvasLoader2d.prototype.startLoader=function(){};CanvasLoader2d.prototype.stopLoader=function(){};
return CanvasLoader2d}();var CanvasLoaderGl=function(_super){__extends(CanvasLoaderGl,_super);
function CanvasLoaderGl(canvasContext){var _this=_super.call(this,canvasContext)||this;
_this.animationId=null;_this.animate=function(){if(!_this.startTime)_this.startTime=performance.now(
);_this.time=(performance.now()-_this.startTime)/1e3;_this.render();
_this.animationId=requestAnimationFrame(_this.animate)};_this.prepareTransition();
_this.uResolutionLoc=_this.gl.getUniformLocation(_this.program,"u_resolution");
_this.uTimeLoc=_this.gl.getUniformLocation(_this.program,"u_time");return _this}
CanvasLoaderGl.prototype.renderUniformValue=function(){if(this.context.isDisposed())return;
this.gl.uniform2f(this.uResolutionLoc,this.context.canvas.width,this.context.canvas.height);
this.gl.uniform1f(this.uTimeLoc,this.time)};CanvasLoaderGl.prototype.startLoader=function(){if(
this.context.isDisposed())return;if(this.animationId===null){this.startTime=performance.now();
this.animate()}};CanvasLoaderGl.prototype.stopLoader=function(){if(this.context.isDisposed())return;
if(this.animationId!==null){cancelAnimationFrame(this.animationId);this.animationId=null;
this.startTime=null;this.gl.clear(this.gl.COLOR_BUFFER_BIT);if(this.vao){this.gl.deleteVertexArray(
this.vao);this.vao=null}if(this.program){this.gl.deleteProgram(this.program);this.program=null}
this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null);this.gl.bindVertexArray(null);this.gl.useProgram(null)
this.gl.flush()}};CanvasLoaderGl.prototype.render=function(){if(this.context.isDisposed())return;
this.gl.viewport(0,0,this.context.canvas.width,this.context.canvas.height);this.gl.clearColor(0,0,0,
1);this.gl.clear(this.gl.COLOR_BUFFER_BIT);this.gl.useProgram(this.program);this.renderUniformValue(
);this.gl.bindVertexArray(this.vao);this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4)};
CanvasLoaderGl.prototype.getVertexShader=function(){
return"#version 300 es\n                in vec4 a_position;\n                void main() {\n                    gl_Position = a_position;\n                }"
};CanvasLoaderGl.prototype.getFragmentShader=function(){
return"#version 300 es\n                precision highp float;\n                uniform vec2 u_resolution;\n                uniform float u_time;\n                out vec4 outColor;\n\n                // Directly defined constants\n                const float LOADER_SIZE = 0.04;\n                const float LOADER_THICKNESS = 0.2;\n                const vec3 LOADER_COLOR = vec3(0.8, 0.8, 0.8);\n                const float ROTATION_SPEED = 5.0;\n\n                void main() {\n                    vec2 center = vec2(0.5, 0.5);\n                    vec2 aspect = vec2(u_resolution.x / u_resolution.y, 1.0);\n                    vec2 position = (gl_FragCoord.xy / u_resolution - center) * aspect;\n                    float radius = length(position);\n                    float angle = atan(position.y, position.x) + u_time * ROTATION_SPEED;\n\n                    float outerRadius = LOADER_SIZE;\n                    float innerRadius = outerRadius - LOADER_SIZE * LOADER_THICKNESS;\n\n                    if (radius > outerRadius || radius < innerRadius) {\n                        discard;\n                    }\n\n                    float segmentAngle = 3.14159 * 0.5; // Quarter circle\n\n                    if (mod(angle, 6.28318) > segmentAngle) {\n                        discard;\n                    }\n\n                    outColor = vec4(LOADER_COLOR, 1.0);\n                }"
};return CanvasLoaderGl}(TextureAnimationBase);SlideShow.CanvasLoaderGl=CanvasLoaderGl;
SlideShow.CanvasLoader2d=CanvasLoader2d;var vec2=glMatrix.vec2,vec3=glMatrix.vec3,mat4=glMatrix.mat4
var Operation=function(){function Operation(){}Operation.prototype.interpolate=function(matrix,t,
SlideWidthScale,SlideHeightScale){return matrix};return Operation}();SlideShow.Operation=Operation;
var OpsHelper=function(){function OpsHelper(){}OpsHelper.intervalInter=function(t,T0,T1){return(t-T0
)/(T1-T0)};OpsHelper.deg2rad=function(v,degMultiple){if(degMultiple===void 0){degMultiple=1}
return v/(90*degMultiple)*Math.PI/2};return OpsHelper}();SlideShow.OpsHelper=OpsHelper;
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var __spreadArray=this&&this.__spreadArray||function(to,from,pack){
if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar
)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var Primitive=function(){function Primitive(){this.vertices=[
];this.operations=[]}Primitive.cloneDeep=function(oldPrimitive){var newPrimitive=new Primitive;
newPrimitive.vertices=__spreadArray([],__read(oldPrimitive.vertices),false);
newPrimitive.operations=oldPrimitive.operations.map(function(operation){return operation});
return newPrimitive};Primitive.prototype.pushTriangle=function(slideLocation0,slideLocation1,
slideLocation2){var verts=[];var texs=[];verts.push([2*slideLocation0[0]-1,-2*slideLocation0[1]+1,0]
);verts.push([2*slideLocation1[0]-1,-2*slideLocation1[1]+1,0]);verts.push([2*slideLocation2[0]-1,
-2*slideLocation2[1]+1,0]);var normal=this.cross(this.subtract(verts[0],verts[1]),this.subtract(
verts[1],verts[2]));var isFacingUs=normal[2]>=0;if(isFacingUs){texs.push(slideLocation0);texs.push(
slideLocation1);texs.push(slideLocation2)}else{texs.push(slideLocation0);texs.push(slideLocation2);
texs.push(slideLocation1);verts=[];verts.push([2*slideLocation0[0]-1,-2*slideLocation0[1]+1,0]);
verts.push([2*slideLocation2[0]-1,-2*slideLocation2[1]+1,0]);verts.push([2*slideLocation1[0]-1,
-2*slideLocation1[1]+1,0])}this.vertices.push({position:verts[0],normal:[0,0,1],texCoord:texs[0]},{
position:verts[1],normal:[0,0,1],texCoord:texs[1]},{position:verts[2],normal:[0,0,1],texCoord:texs[2
]})};Primitive.prototype.getVertex=function(n){return this.vertices[n].position};
Primitive.prototype.subtract=function(a,b){return[a[0]-b[0],a[1]-b[1],a[2]-b[2]]};
Primitive.prototype.cross=function(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1
]*b[0]]};Primitive.prototype.clear=function(){this.operations=[]};return Primitive}();
SlideShow.Primitive=Primitive;function createActivity(aActivityParamSet,aAnimationNode,aAnimation,
aInterpolator){var eCalcMode=aAnimationNode.getCalcMode();
var sAttributeName=aAnimationNode.getAttributeName();var sKey=sAttributeName;
var aAttributeProp=aPropertyGetterSetterMap[sKey];var eValueType=aAttributeProp["type"];if(
!aInterpolator){aInterpolator=PropertyInterpolator.getInterpolator(eValueType)}
var bAccumulate=aAnimationNode.getAccumulate()===AccumulateMode.Sum&&!(
eValueType===PropertyValueType.Bool||eValueType===PropertyValueType.String||eValueType===PropertyValueType.Enum
);if(aAnimationNode.getFormula()){var sFormula_1=aAnimationNode.getFormula();
var reMath=/abs|sqrt|asin|acos|atan|sin|cos|tan|exp|log|min|max/g;sFormula_1=sFormula_1.replace(
reMath,"Math.$&");sFormula_1=sFormula_1.replace(/pi(?!\w)/g,"Math.PI");
sFormula_1=sFormula_1.replace(/e(?!\w)/g,"Math.E");sFormula_1=sFormula_1.replace(/\$/g,"__PARAM0__")
var aAnimatedElement=aAnimationNode.getAnimatedElement();var aBBox=aAnimatedElement.getBaseBBox();
var width=aBBox.width/aActivityParamSet.nSlideWidth;
var height=aBBox.height/aActivityParamSet.nSlideHeight;var x=(aBBox.x+aBBox.width/2
)/aActivityParamSet.nSlideWidth;var y=(aBBox.y+aBBox.height/2)/aActivityParamSet.nSlideHeight;
aActivityParamSet.aFormula=function(__PARAM0__){return eval(sFormula_1)}}
aActivityParamSet.aDiscreteTimes=aAnimationNode.getKeyTimes();
var aValueSet=aAnimationNode.getValues();var nValueSetSize=aValueSet.length;if(nValueSetSize!=0){if(
aActivityParamSet.aDiscreteTimes.length==0){for(var i=0;i<nValueSetSize;++i
)aActivityParamSet.aDiscreteTimes.push(i/nValueSetSize)}switch(eCalcMode){case CalcMode.Discrete:
aActivityParamSet.aWakeupEvent=new WakeupEvent(aActivityParamSet.aTimerEventQueue.getTimer(),
aActivityParamSet.aActivityQueue);return createValueListActivity(aActivityParamSet,aAnimationNode,
aAnimation,aInterpolator,DiscreteValueListActivity,bAccumulate,eValueType);default:
window.app.console.log("createActivity: unexpected calculation mode: "+CalcMode[eCalcMode]);
case CalcMode.Paced:case CalcMode.Spline:case CalcMode.Linear:return createValueListActivity(
aActivityParamSet,aAnimationNode,aAnimation,aInterpolator,LinearValueListActivity,bAccumulate,
eValueType)}}else{switch(eCalcMode){case CalcMode.Discrete:
aActivityParamSet.aWakeupEvent=new WakeupEvent(aActivityParamSet.aTimerEventQueue.getTimer(),
aActivityParamSet.aActivityQueue);return createFromToByActivity(aActivityParamSet,aAnimationNode,
aAnimation,aInterpolator,DiscreteFromToByActivity,bAccumulate,eValueType);default:
window.app.console.log("createActivity: unexpected calculation mode: "+CalcMode[eCalcMode]);
case CalcMode.Paced:case CalcMode.Spline:case CalcMode.Linear:return createFromToByActivity(
aActivityParamSet,aAnimationNode,aAnimation,aInterpolator,LinearFromToByActivity,bAccumulate,
eValueType)}}}function createValueListActivity(aActivityParamSet,aAnimationNode,aAnimation,
aInterpolator,ValueListActivityCtor,bAccumulate,eValueType){
var aAnimatedElement=aAnimationNode.getAnimatedElement();var aOperatorSet=aOperatorSetMap.get(
eValueType);assert(aOperatorSet,"createValueListActivity: no operator set found");
var aValueSet=aAnimationNode.getValues();var aValueList=[];extractAttributeValues(eValueType,
aValueList,aValueSet,aAnimatedElement.getBaseBBox(),aActivityParamSet.nSlideWidth,
aActivityParamSet.nSlideHeight);for(var i=0;i<aValueList.length;++i){ANIMDBG.print(
"createValueListActivity: value["+i+"] = "+aValueList[i])}return new ValueListActivityCtor(
aValueList,aActivityParamSet,aAnimation,aInterpolator,aOperatorSet,bAccumulate)}
function createFromToByActivity(aActivityParamSet,aAnimationNode,aAnimation,aInterpolator,
ClassTemplateInstance,bAccumulate,eValueType){
var aAnimatedElement=aAnimationNode.getAnimatedElement();var aOperatorSet=aOperatorSetMap.get(
eValueType);assert(aOperatorSet,"createFromToByActivity: no operator set found");var aValueSet=[];
aValueSet[0]=aAnimationNode.getFromValue();aValueSet[1]=aAnimationNode.getToValue();aValueSet[2
]=aAnimationNode.getByValue();ANIMDBG.print(
"createFromToByActivity: value type: "+PropertyValueType[eValueType]+", aFrom = "+aValueSet[0
]+", aTo = "+aValueSet[1]+", aBy = "+aValueSet[2]);var aValueList=[];extractAttributeValues(
eValueType,aValueList,aValueSet,aAnimatedElement.getBaseBBox(),aActivityParamSet.nSlideWidth,
aActivityParamSet.nSlideHeight);ANIMDBG.print("createFromToByActivity: "+", aFrom = "+aValueList[0
]+", aTo = "+aValueList[1]+", aBy = "+aValueList[2]);return new ClassTemplateInstance(aValueList[0],
aValueList[1],aValueList[2],aActivityParamSet,aAnimation,aInterpolator,aOperatorSet,bAccumulate)}
function extractAttributeValues(eValueType,aValueList,aValueSet,aBBox,nSlideWidth,nSlideHeight){
var i;switch(eValueType){case PropertyValueType.Number:evalValuesAttribute(aValueList,aValueSet,
aBBox,nSlideWidth,nSlideHeight);break;case PropertyValueType.Bool:for(i=0;i<aValueSet.length;++i){
var aValue=booleanParser(aValueSet[i]);aValueList.push(aValue)}break;case PropertyValueType.String:
for(i=0;i<aValueSet.length;++i){aValueList.push(aValueSet[i])}break;case PropertyValueType.Enum:for(
i=0;i<aValueSet.length;++i){aValueList.push(aValueSet[i])}break;case PropertyValueType.Color:for(
i=0;i<aValueSet.length;++i){var aValue=colorParser(aValueSet[i]);aValueList.push(aValue)}break;
case PropertyValueType.TupleNumber:for(i=0;i<aValueSet.length;++i){if(typeof aValueSet[i]==="string"
){var aTuple=aValueSet[i].split(",");var aValue=[];evalValuesAttribute(aValue,aTuple,aBBox,
nSlideWidth,nSlideHeight);aValueList.push(aValue)}else{aValueList.push(undefined)}}break;default:
window.app.console.log("createValueListActivity: unexpected value type: "+eValueType)}}
function evalValuesAttribute(aValueList,aValueSet,aBBox,nSlideWidth,nSlideHeight){
var width=aBBox.width/nSlideWidth;var height=aBBox.height/nSlideHeight;var x=(aBBox.x+aBBox.width/2
)/nSlideWidth;var y=(aBBox.y+aBBox.height/2)/nSlideHeight;
var reMath=/abs|sqrt|asin|acos|atan|sin|cos|tan|exp|log|min|max/g;for(var i=0;i<aValueSet.length;++i
){var sValue=aValueSet[i];if(sValue){sValue=sValue.replace(reMath,"Math.$&");sValue=sValue.replace(
/pi(?!\w)/g,"Math.PI");sValue=sValue.replace(/e(?!\w)/g,"Math.E")}var aValue=eval(sValue);
aValueList.push(aValue)}}var ActivityQueue=function(){function ActivityQueue(aTimer){
this.aTimer=aTimer;this.aCurrentActivityWaitingSet=[];this.aCurrentActivityReinsertSet=[];
this.aDequeuedActivitySet=[]}ActivityQueue.prototype.addActivity=function(aActivity){if(!aActivity){
window.app.console.log("ActivityQueue.addActivity: activity is not valid");return false}
this.aCurrentActivityWaitingSet.push(aActivity);aActivityQueueDebugPrinter.print(
"ActivityQueue.addActivity: activity appended");return true};
ActivityQueue.prototype.process=function(){var nSize=this.aCurrentActivityWaitingSet.length;
var nLag=0;for(var i=0;i<nSize;++i){nLag=Math.max(nLag,this.aCurrentActivityWaitingSet[i
].calcTimeLag())}if(nLag>0)this.aTimer.adjustTimer(-nLag);while(
this.aCurrentActivityWaitingSet.length!=0){var aActivity=this.aCurrentActivityWaitingSet.shift();
var bReinsert=false;bReinsert=aActivity.perform();if(bReinsert){
this.aCurrentActivityReinsertSet.push(aActivity)}else{this.aDequeuedActivitySet.push(aActivity)}}if(
this.aCurrentActivityReinsertSet.length!=0){
this.aCurrentActivityWaitingSet=this.aCurrentActivityReinsertSet;this.aCurrentActivityReinsertSet=[]
}};ActivityQueue.prototype.processDequeued=function(){var nSize=this.aDequeuedActivitySet.length;
for(var i=0;i<nSize;++i)this.aDequeuedActivitySet[i].dequeued();this.aDequeuedActivitySet=[]};
ActivityQueue.prototype.isEmpty=function(){
return this.aCurrentActivityWaitingSet.length==0&&this.aCurrentActivityReinsertSet.length==0};
ActivityQueue.prototype.clear=function(){aActivityQueueDebugPrinter.print(
"ActivityQueue.clear invoked");var nSize=this.aCurrentActivityWaitingSet.length;for(
var i=0;i<nSize;++i)this.aCurrentActivityWaitingSet[i].dequeued();this.aCurrentActivityWaitingSet=[]
nSize=this.aCurrentActivityReinsertSet.length;for(var i=0;i<nSize;++i
)this.aCurrentActivityReinsertSet[i].dequeued();this.aCurrentActivityReinsertSet=[]};
ActivityQueue.prototype.endAll=function(){aActivityQueueDebugPrinter.print(
"ActivityQueue.endAll invoked");var nSize=this.aCurrentActivityWaitingSet.length;for(
var i=0;i<nSize;++i)this.aCurrentActivityWaitingSet[i].end();this.aCurrentActivityWaitingSet=[];
nSize=this.aCurrentActivityReinsertSet.length;for(var i=0;i<nSize;++i
)this.aCurrentActivityReinsertSet[i].end();this.aCurrentActivityReinsertSet=[]};
ActivityQueue.prototype.getTimer=function(){return this.aTimer};
ActivityQueue.prototype.size=function(){
return this.aCurrentActivityWaitingSet.length+this.aCurrentActivityReinsertSet.length+this.aDequeuedActivitySet.length
};return ActivityQueue}();var __extends=this&&this.__extends||function(){var extendStatics=function(
d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){
d.__proto__=b}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]}
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var AnimationBase=function(){function AnimationBase(){}
return AnimationBase}();var GenericAnimation=function(_super){__extends(GenericAnimation,_super);
function GenericAnimation(aGetValueFunc,aSetValueFunc,aGetModifier,aSetModifier){
var _this=_super.call(this)||this;assert(aGetValueFunc&&aSetValueFunc,
"GenericAnimation constructor: get value functor and/or set value functor are not valid");
_this.aGetValueFunc=aGetValueFunc;_this.aSetValueFunc=aSetValueFunc;_this.aGetModifier=aGetModifier;
_this.aSetModifier=aSetModifier;_this.aAnimatableElement=null;_this.bAnimationStarted=false;
return _this}GenericAnimation.prototype.start=function(aAnimatableElement){assert(aAnimatableElement
,"GenericAnimation.start: animatable element is not valid");
this.aAnimatableElement=aAnimatableElement;this.aAnimatableElement.notifyAnimationStart();if(
!this.bAnimationStarted)this.bAnimationStarted=true};GenericAnimation.prototype.end=function(){if(
this.bAnimationStarted){this.bAnimationStarted=false;this.aAnimatableElement.notifyAnimationEnd()}};
GenericAnimation.prototype.perform=function(aValue){if(this.aSetModifier)aValue=this.aSetModifier(
aValue);this.aSetValueFunc(aValue)};GenericAnimation.prototype.getUnderlyingValue=function(){
var aValue=this.aGetValueFunc();if(this.aGetModifier)aValue=this.aGetModifier(aValue);return aValue}
return GenericAnimation}(AnimationBase);var TupleAnimation=function(_super){__extends(TupleAnimation
,_super);function TupleAnimation(aGetValueFunc,aSetValueFunc,aDefaultValue,aReferenceSize){
var _this=_super.call(this,aGetValueFunc,aSetValueFunc)||this;assert(aDefaultValue&&aReferenceSize,
"TupleAnimation constructor: default value functor and/or reference size are not valid");
_this.aDefaultValue=aDefaultValue;_this.aReferenceSize=aReferenceSize;return _this}
TupleAnimation.prototype.perform=function(aNormValue){assert(
aNormValue.length===this.aReferenceSize.length,
"TupleAnimation.perform: aNormValue array param has wrong length");var aValue=[];for(
var i=0;i<aNormValue.length;++i){aValue.push(aNormValue[i]*this.aReferenceSize[i])}
this.aSetValueFunc(aValue)};TupleAnimation.prototype.getUnderlyingValue=function(){
var aValue=this.aGetValueFunc();assert(aValue.length===this.aReferenceSize.length,
"TupleAnimation.perform: array param has wrong length");var aNormValue=[];for(
var i=0;i<aValue.length;++i){aNormValue.push(aValue[i]/this.aReferenceSize[i])}return aNormValue};
return TupleAnimation}(GenericAnimation);var HSLAnimationWrapper=function(){
function HSLAnimationWrapper(aColorAnimation){this.aAnimation=aColorAnimation}
HSLAnimationWrapper.prototype.start=function(aAnimatableElement){this.aAnimation.start(
aAnimatableElement)};HSLAnimationWrapper.prototype.end=function(){this.aAnimation.end()};
HSLAnimationWrapper.prototype.perform=function(aHSLValue){this.aAnimation.perform(
aHSLValue.convertToRGB())};HSLAnimationWrapper.prototype.getUnderlyingValue=function(){
return this.aAnimation.getUnderlyingValue().convertToHSL()};return HSLAnimationWrapper}();
function createPropertyAnimation(sAttrName,aAnimatedElement,nWidth,nHeight){
var sPropNameAsKey=sAttrName;if(!aPropertyGetterSetterMap[sPropNameAsKey]){window.app.console.log(
"createPropertyAnimation: attribute is unknown: "+sAttrName);return null}
var aFunctorSet=aPropertyGetterSetterMap[sPropNameAsKey];var sGetValueMethod=aFunctorSet.get;
var sSetValueMethod=aFunctorSet.set;if(!sGetValueMethod||!sSetValueMethod){window.app.console.log(
"createPropertyAnimation: attribute is not handled");return null}var aGetModifier=eval(
aFunctorSet.getmod);var aSetModifier=eval(aFunctorSet.setmod);var aGetValueMethod=aAnimatedElement[
sGetValueMethod];var aSetValueMethod=aAnimatedElement[sSetValueMethod];return new GenericAnimation(
aGetValueMethod.bind(aAnimatedElement),aSetValueMethod.bind(aAnimatedElement),aGetModifier,
aSetModifier)}function createPairPropertyAnimation(sTransformType,aAnimatedElement,nWidth,nHeight){
var sTransformTypeAsKey=sTransformType;var aFunctorSet=aPropertyGetterSetterMap[sTransformTypeAsKey]
var sGetValueMethod=aFunctorSet.get;var sSetValueMethod=aFunctorSet.set;var aDefaultValue=[];
var aSizeReference=[];if(sTransformType==="scale"){aDefaultValue[0]=aSizeReference[0
]=aAnimatedElement.getBaseBBox().width;aDefaultValue[1]=aSizeReference[1
]=aAnimatedElement.getBaseBBox().height}else if(sTransformType==="translate"){aDefaultValue[0
]=aAnimatedElement.getBaseCenterX();aDefaultValue[1]=aAnimatedElement.getBaseCenterY();
aSizeReference[0]=nWidth;aSizeReference[1]=nHeight}else{window.app.console.log(
"createPairPropertyAnimation: transform type is not handled");return null}
var aGetValueMethod=aAnimatedElement[sGetValueMethod];var aSetValueMethod=aAnimatedElement[
sSetValueMethod];return new TupleAnimation(aGetValueMethod.bind(aAnimatedElement),
aSetValueMethod.bind(aAnimatedElement),aDefaultValue,aSizeReference)}
var TransitionFilterAnimation=function(_super){__extends(TransitionFilterAnimation,_super);
function TransitionFilterAnimation(nNodeId,transitionFilterInfo,aAnimatableElement){var _this=this;
assert(aAnimatableElement,"TransitionFilterAnimation: animatable element is not valid");
ANIMDBG.print("TransitionFilterAnimation: Animated Element Id: "+aAnimatableElement.getId());
_this=_super.call(this)||this;_this.nNodeId=nNodeId;_this.aTransitionFilterInfo=transitionFilterInfo
_this.aAnimatableElement=aAnimatableElement;_this.bAnimationStarted=false;_this.aTransition=null;
return _this}TransitionFilterAnimation.prototype.getNodeId=function(){return this.nNodeId};
TransitionFilterAnimation.prototype.start=function(aAnimatableElement){assert(
this.aAnimatableElement.getId()===aAnimatableElement.getId(),
"TransitionFilterAnimation: animatable element mismatch");if(!this.aTransition){
var transitionParameters=this.createTransitionParameters(this.aAnimatableElement,
this.aTransitionFilterInfo);this.aTransition=this.createShapeTransition(transitionParameters)}
this.aAnimatableElement.notifyAnimationStart();if(!this.bAnimationStarted
)this.bAnimationStarted=true};TransitionFilterAnimation.prototype.end=function(){if(
this.bAnimationStarted){this.bAnimationStarted=false;this.aAnimatableElement.notifyAnimationEnd()}};
TransitionFilterAnimation.prototype.perform=function(nT){
this.aAnimatableElement.setTransitionFilterFrame(this,nT)};
TransitionFilterAnimation.prototype.renderFrame=function(nT,properties){if(this.aTransition){
this.aTransition.renderFrame(nT,properties)}};
TransitionFilterAnimation.prototype.notifySlideEnd=function(){if(this.aTransition){
this.aTransition.end();this.aTransition=null}};
TransitionFilterAnimation.prototype.getUnderlyingValue=function(){return 0};
TransitionFilterAnimation.prototype.createTransitionParameters=function(aAnimatedElement,
transitionFilterInfo){var transitionParameters=new TransitionParameters;
aAnimatedElement.setTransitionParameters(transitionParameters);
transitionParameters.transitionFilterInfo=transitionFilterInfo;return transitionParameters};
TransitionFilterAnimation.prototype.createShapeTransition=function(transitionParameters){
return createTransition(transitionParameters,false)};return TransitionFilterAnimation}(AnimationBase
);var PathAnimation=function(_super){__extends(PathAnimation,_super);function PathAnimation(path,
eAdditive,slideWidth,slideHeight){var _this=_super.call(this)||this;_this.path=path;
_this.eAdditive=eAdditive;_this.slideWidth=slideWidth;_this.slideHeight=slideHeight;
_this.svgPath=_this.createSvgPath(path);_this.pathLength=_this.svgPath.getTotalLength();return _this
}PathAnimation.prototype.start=function(aAnimatableElement){assert(aAnimatableElement,
"GenericAnimation.start: animatable element is not valid");
this.aAnimatableElement=aAnimatableElement;this.centerX=this.aAnimatableElement.getBaseCenterX();
this.centerY=this.aAnimatableElement.getBaseCenterY();this.aAnimatableElement.notifyAnimationStart()
if(!this.bAnimationStarted)this.bAnimationStarted=true};PathAnimation.prototype.end=function(){if(
this.bAnimationStarted){this.bAnimationStarted=false;this.aAnimatableElement.notifyAnimationEnd()}};
PathAnimation.prototype.perform=function(nT){var aOutPos=this.parametricPath(nT);aOutPos=[aOutPos[0
]*this.slideWidth,aOutPos[1]*this.slideHeight];aOutPos=[aOutPos[0]+this.centerX,aOutPos[1
]+this.centerY];this.aAnimatableElement.setPos(aOutPos)};
PathAnimation.prototype.getUnderlyingValue=function(){return 0};
PathAnimation.prototype.createSvgPath=function(path){var svgPath=document.createElementNS(
"http://www.w3.org/2000/svg","path");svgPath.setAttribute("d",path);return svgPath};
PathAnimation.prototype.parametricPath=function(nT){var distance=this.pathLength*nT;
var point=this.svgPath.getPointAtLength(distance);return[point.x,point.y]};return PathAnimation}(
AnimationBase);function createShapeTransition(aActivityParamSet,aAnimatedElement,nSlideWidth,
nSlideHeight,aAnimatedTransitionFilterNode){if(!aAnimatedTransitionFilterNode){
window.app.console.log("createShapeTransition: the animated transition filter node is not valid.");
return null}var eTransitionType=aAnimatedTransitionFilterNode.getTransitionType();
var eTransitionSubType=aAnimatedTransitionFilterNode.getTransitionSubtype();
var bDirectionForward=!aAnimatedTransitionFilterNode.getReverseDirection();
var bModeIn=aAnimatedTransitionFilterNode.getTransitionMode()==TransitionMode.in;
var transitionFilterInfo=new TransitionFilterInfo(eTransitionType,eTransitionSubType,
bDirectionForward,bModeIn);var aTransitionInfo=null;if(aTransitionInfoTable[eTransitionType]
)aTransitionInfo=aTransitionInfoTable[eTransitionType][eTransitionSubType];
var eTransitionClass=aTransitionInfo?aTransitionInfo["class"]:TransitionClass.Invalid;switch(
eTransitionClass){default:case TransitionClass.Invalid:window.app.console.log(
"createShapeTransition: transition class: TRANSITION_INVALID");return null;
case TransitionClass.ClipPoligon:{var aClippingAnimation=new TransitionFilterAnimation(
aAnimatedTransitionFilterNode.getId(),transitionFilterInfo,aAnimatedElement);
return new SimpleActivity(aActivityParamSet,aClippingAnimation,DirectionType.Forward)}
case TransitionClass.Special:switch(eTransitionType){case TransitionType.SLIDEWIPE:{
var subtype=TransitionSubType.DEFAULT;var isForwardDirection=true;switch(eTransitionSubType){
case TransitionSubType.FROMLEFT:subtype=TransitionSubType.LEFTTORIGHT;isForwardDirection=true;break;
case TransitionSubType.FROMRIGHT:subtype=TransitionSubType.LEFTTORIGHT;isForwardDirection=false;
break;case TransitionSubType.FROMTOP:subtype=TransitionSubType.TOPTOBOTTOM;isForwardDirection=true;
break;case TransitionSubType.FROMBOTTOM:subtype=TransitionSubType.TOPTOBOTTOM;
isForwardDirection=false;break;default:window.app.console.log(
"createShapeTransition: unexpected subtype for SLIDEWIPE");break}
transitionFilterInfo.transitionType=TransitionType.BARWIPE;
transitionFilterInfo.transitionSubtype=subtype;
transitionFilterInfo.isDirectionForward=isForwardDirection;
var aClippingAnimation=new TransitionFilterAnimation(aAnimatedTransitionFilterNode.getId(),
transitionFilterInfo,aAnimatedElement);return new SimpleActivity(aActivityParamSet,
aClippingAnimation,DirectionType.Forward)}default:{return createCrossFadeTransition(
aActivityParamSet,aAnimatedElement,nSlideWidth,nSlideHeight,bModeIn)}}}}
function createCrossFadeTransition(aActivityParamSet,aAnimatedElement,nSlideWidth,nSlideHeight,
bModeIn){var aAnimation=createPropertyAnimation("opacity",aAnimatedElement,nSlideWidth,nSlideHeight)
var eDirection=bModeIn?DirectionType.Forward:DirectionType.Backward;return new SimpleActivity(
aActivityParamSet,aAnimation,eDirection)}var Duration=function(){function Duration(sDuration){
this.bIndefinite=false;this.bMedia=false;this.nValue=undefined;this.bDefined=false;if(!sDuration
)return;if(sDuration==="indefinite")this.bIndefinite=true;else if(sDuration==="media"
)this.bMedia=true;else{this.nValue=Timing.parseClockValue(sDuration);if(this.nValue<=0
)this.nValue=.001}this.bDefined=true}Duration.prototype.isSet=function(){return this.bDefined};
Duration.prototype.isIndefinite=function(){return this.bIndefinite};
Duration.prototype.isMedia=function(){return this.bMedia};Duration.prototype.isValue=function(){
return this.nValue!=undefined};Duration.prototype.getValue=function(){return this.nValue};
Duration.prototype.info=function(){var sInfo;if(this.isIndefinite())sInfo="indefinite";else if(
this.isMedia())sInfo="media";else if(this.getValue())sInfo=this.getValue();return sInfo};
return Duration}();var EffectState;(function(EffectState){EffectState[EffectState["NotStarted"]=0
]="NotStarted";EffectState[EffectState["Playing"]=1]="Playing";EffectState[EffectState["Ended"]=2
]="Ended"})(EffectState||(EffectState={}));var Effect=function(){function Effect(nId){if(
nId===void 0){nId=-1}this.nId=nId;this.eState=EffectState.NotStarted}
Effect.prototype.getId=function(){return this.nId};Effect.prototype.isMainEffect=function(){
return this.nId===-1};Effect.prototype.isPlaying=function(){return this.eState===EffectState.Playing
};Effect.prototype.isEnded=function(){return this.eState===EffectState.Ended};
Effect.prototype.start=function(){assert(this.eState===EffectState.NotStarted,
"Effect.start: wrong state.");this.eState=EffectState.Playing};Effect.prototype.end=function(){
assert(this.eState===EffectState.Playing,"Effect.end: wrong state.");this.eState=EffectState.Ended};
return Effect}();var ElapsedTime=function(){function ElapsedTime(aTimeBase){this.aTimeBase=null;
this.aTimeBase=aTimeBase;this.reset()}ElapsedTime.prototype.getTimeBase=function(){
return this.aTimeBase};ElapsedTime.prototype.reset=function(){this.nLastQueriedTime=0;
this.nStartTime=this.getCurrentTime();this.nFrozenTime=0;this.bInPauseMode=false;
this.bInHoldMode=false};ElapsedTime.prototype.getElapsedTime=function(){
this.nLastQueriedTime=this.getElapsedTimeImpl();return this.nLastQueriedTime};
ElapsedTime.prototype.pauseTimer=function(){this.nFrozenTime=this.getElapsedTimeImpl();
this.bInPauseMode=true};ElapsedTime.prototype.continueTimer=function(){this.bInPauseMode=false;
var nPauseDuration=this.getElapsedTimeImpl()-this.nFrozenTime;this.nStartTime+=nPauseDuration};
ElapsedTime.prototype.adjustTimer=function(nOffset){this.nStartTime-=nOffset;if(
this.bInHoldMode||this.bInPauseMode)this.nFrozenTime+=nOffset};
ElapsedTime.prototype.holdTimer=function(){this.nFrozenTime=this.getElapsedTimeImpl();
this.bInHoldMode=true};ElapsedTime.prototype.releaseTimer=function(){this.bInHoldMode=false};
ElapsedTime.prototype.getSystemTime=function(){return getCurrentSystemTime()/1e3};
ElapsedTime.prototype.getCurrentTime=function(){var nCurrentTime;if(!this.aTimeBase){
nCurrentTime=this.getSystemTime()}else{nCurrentTime=this.aTimeBase.getElapsedTimeImpl()}assert(
typeof nCurrentTime===typeof 0&&isFinite(nCurrentTime),
"ElapsedTime.getCurrentTime: assertion failed: nCurrentTime == "+nCurrentTime);return nCurrentTime};
ElapsedTime.prototype.getElapsedTimeImpl=function(){if(this.bInHoldMode||this.bInPauseMode){
return this.nFrozenTime}var nCurTime=this.getCurrentTime();return nCurTime-this.nStartTime};
return ElapsedTime}();var EventMultiplexer=function(){function EventMultiplexer(aTimerEventQueue){
this.aEventMap=new Map;this.aAnimationsEndHandler=null;this.aSkipEffectEndHandlerSet=[];
this.aMouseClickHandlerSet=null;this.aSkipEffectEvent=null;this.aRewindCurrentEffectEvent=null;
this.aRewindLastEffectEvent=null;this.aSkipInteractiveEffectEventSet=new Map;
this.aRewindRunningInteractiveEffectEventSet=new Map;
this.aRewindEndedInteractiveEffectEventSet=new Map;this.aRewindedEffectHandlerSet=new Map;
this.aElementChangedHandlerSet=new Map;this.nId=EventMultiplexer.getUniqueId();
this.aTimerEventQueue=aTimerEventQueue;this.aMouseClickHandlerSet=new PriorityQueue(
PriorityEntry.compare)}EventMultiplexer.getUniqueId=function(){++EventMultiplexer.CURR_UNIQUE_ID;
return EventMultiplexer.CURR_UNIQUE_ID};EventMultiplexer.prototype.clear=function(){
this.aEventMap.clear();this.aEventMap=null;this.aSkipEffectEndHandlerSet=null;
this.aMouseClickHandlerSet.clear();this.aMouseClickHandlerSet=null;
this.aSkipInteractiveEffectEventSet.clear();this.aSkipInteractiveEffectEventSet=null;
this.aRewindRunningInteractiveEffectEventSet.clear();
this.aRewindRunningInteractiveEffectEventSet=null;this.aRewindEndedInteractiveEffectEventSet.clear()
this.aRewindEndedInteractiveEffectEventSet=null;this.aRewindedEffectHandlerSet.clear();
this.aRewindedEffectHandlerSet=null;this.aElementChangedHandlerSet.clear();
this.aElementChangedHandlerSet=null};EventMultiplexer.prototype.getId=function(){return this.nId};
EventMultiplexer.prototype.hasRegisteredMouseClickHandlers=function(){
return!this.aMouseClickHandlerSet.isEmpty()};
EventMultiplexer.prototype.registerMouseClickHandler=function(aHandler,nPriority){
var aHandlerEntry=new PriorityEntry(aHandler,nPriority);this.aMouseClickHandlerSet.push(
aHandlerEntry)};EventMultiplexer.prototype.notifyMouseClick=function(aMouseEvent){
var aMouseClickHandlerSet=this.aMouseClickHandlerSet.clone();while(!aMouseClickHandlerSet.isEmpty()
){var aHandlerEntry=aMouseClickHandlerSet.top();aMouseClickHandlerSet.pop();if(
aHandlerEntry.aValue&&aHandlerEntry.aValue.handleClick){if(aHandlerEntry.aValue.handleClick(
aMouseEvent))break}}};EventMultiplexer.prototype.notifyMouseMove=function(aMouseEvent){
var aMouseClickHandlerSet=this.aMouseClickHandlerSet.clone();while(!aMouseClickHandlerSet.isEmpty()
){var aHandlerEntry=aMouseClickHandlerSet.top();aMouseClickHandlerSet.pop();if(
aHandlerEntry.aValue&&aHandlerEntry.aValue.onMouseMove){if(aHandlerEntry.aValue.onMouseMove(
aMouseEvent.x,aMouseEvent.y))break}}};EventMultiplexer.prototype.registerEvent=function(eEventType,
aNotifierId,aEvent){var sNotifierId=""+aNotifierId;this.DBG("registerEvent",eEventType,sNotifierId);
if(!this.aEventMap.has(eEventType)){this.aEventMap.set(eEventType,new Map)}if(!this.aEventMap.get(
eEventType).has(sNotifierId)){this.aEventMap.get(eEventType).set(sNotifierId,[])}this.aEventMap.get(
eEventType).get(sNotifierId).push(aEvent)};EventMultiplexer.prototype.notifyEvent=function(
eEventType,aNotifierId){var sNotifierId=""+aNotifierId;this.DBG("notifyEvent",eEventType,sNotifierId
);if(this.aEventMap.has(eEventType)){if(this.aEventMap.get(eEventType).has(sNotifierId)){
var aEventArray=this.aEventMap.get(eEventType).get(sNotifierId);var nSize=aEventArray.length;for(
var i=0;i<nSize;++i){this.aTimerEventQueue.addEvent(aEventArray[i])}}}};
EventMultiplexer.prototype.registerAnimationsEndHandler=function(aHandler){
this.aAnimationsEndHandler=aHandler};EventMultiplexer.prototype.notifyAnimationsEndEvent=function(){
if(this.aAnimationsEndHandler)this.aAnimationsEndHandler()};
EventMultiplexer.prototype.registerNextEffectEndHandler=function(aHandler){
this.aSkipEffectEndHandlerSet.push(aHandler)};
EventMultiplexer.prototype.notifyNextEffectEndEvent=function(){
var nSize=this.aSkipEffectEndHandlerSet.length;for(var i=0;i<nSize;++i){
this.aSkipEffectEndHandlerSet[i]()}this.aSkipEffectEndHandlerSet=[]};
EventMultiplexer.prototype.registerSkipEffectEvent=function(aEvent){this.aSkipEffectEvent=aEvent};
EventMultiplexer.prototype.notifySkipEffectEvent=function(){if(this.aSkipEffectEvent){
this.aTimerEventQueue.addEvent(this.aSkipEffectEvent);this.aSkipEffectEvent=null}};
EventMultiplexer.prototype.registerRewindCurrentEffectEvent=function(aEvent){
this.aRewindCurrentEffectEvent=aEvent};
EventMultiplexer.prototype.notifyRewindCurrentEffectEvent=function(){if(
this.aRewindCurrentEffectEvent){this.aTimerEventQueue.addEvent(this.aRewindCurrentEffectEvent);
this.aRewindCurrentEffectEvent=null}};
EventMultiplexer.prototype.registerRewindLastEffectEvent=function(aEvent){
this.aRewindLastEffectEvent=aEvent};EventMultiplexer.prototype.notifyRewindLastEffectEvent=function(
){if(this.aRewindLastEffectEvent){this.aTimerEventQueue.addEvent(this.aRewindLastEffectEvent);
this.aRewindLastEffectEvent=null}};
EventMultiplexer.prototype.registerSkipInteractiveEffectEvent=function(nNotifierId,aEvent){
this.aSkipInteractiveEffectEventSet.set(nNotifierId,aEvent)};
EventMultiplexer.prototype.notifySkipInteractiveEffectEvent=function(nNotifierId){if(
this.aSkipInteractiveEffectEventSet.has(nNotifierId)){this.aTimerEventQueue.addEvent(
this.aSkipInteractiveEffectEventSet.get(nNotifierId))}};
EventMultiplexer.prototype.registerRewindRunningInteractiveEffectEvent=function(nNotifierId,aEvent){
this.aRewindRunningInteractiveEffectEventSet.set(nNotifierId,aEvent)};
EventMultiplexer.prototype.notifyRewindRunningInteractiveEffectEvent=function(nNotifierId){if(
this.aRewindRunningInteractiveEffectEventSet.has(nNotifierId)){this.aTimerEventQueue.addEvent(
this.aRewindRunningInteractiveEffectEventSet.get(nNotifierId))}};
EventMultiplexer.prototype.registerRewindEndedInteractiveEffectEvent=function(nNotifierId,aEvent){
this.aRewindEndedInteractiveEffectEventSet.set(nNotifierId,aEvent)};
EventMultiplexer.prototype.notifyRewindEndedInteractiveEffectEvent=function(nNotifierId){if(
this.aRewindEndedInteractiveEffectEventSet.has(nNotifierId)){this.aTimerEventQueue.addEvent(
this.aRewindEndedInteractiveEffectEventSet.get(nNotifierId))}};
EventMultiplexer.prototype.registerRewindedEffectHandler=function(aNotifierId,aHandler){
var sNotifierId=""+aNotifierId;this.aRewindedEffectHandlerSet.set(sNotifierId,aHandler)};
EventMultiplexer.prototype.notifyRewindedEffectEvent=function(aNotifierId){
var sNotifierId=""+aNotifierId;if(this.aRewindedEffectHandlerSet.has(sNotifierId)){
this.aRewindedEffectHandlerSet.get(sNotifierId)()}};
EventMultiplexer.prototype.registerElementChangedHandler=function(aNotifierId,aHandler){
this.aElementChangedHandlerSet.set(aNotifierId,aHandler)};
EventMultiplexer.prototype.notifyElementChangedEvent=function(aNotifierId,aElement){if(
this.aElementChangedHandlerSet.has(aNotifierId)){this.aElementChangedHandlerSet.get(aNotifierId)(
aElement)}};EventMultiplexer.prototype.DBG=function(sMethodName,eEventType,nNotifierId,nTime){if(
aEventMultiplexerDebugPrinter.isEnabled()){var sInfo="EventMultiplexer."+sMethodName;
sInfo+="( type: "+EventTrigger[eEventType];sInfo+=", notifier: "+nNotifierId+" )";
aEventMultiplexerDebugPrinter.print(sInfo,nTime)}};EventMultiplexer.CURR_UNIQUE_ID=0;
return EventMultiplexer}();var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var EventBase=function(
){function EventBase(){this.nId=EventBase.getUniqueId()}EventBase.getUniqueId=function(){
++EventBase.CURR_UNIQUE_ID;return EventBase.CURR_UNIQUE_ID};EventBase.prototype.getId=function(){
return this.nId};EventBase.CURR_UNIQUE_ID=0;return EventBase}();var DelayEvent=function(_super){
__extends(DelayEvent,_super);function DelayEvent(aFunctor,nTimeout){var _this=_super.call(this
)||this;_this.bWasFired=false;_this.aFunctor=aFunctor;_this.nTimeout=nTimeout;return _this}
DelayEvent.prototype.fire=function(){assert(this.isCharged(),
"DelayEvent.fire: assertion isCharged failed");this.bWasFired=true;this.aFunctor();return true};
DelayEvent.prototype.isCharged=function(){return!this.bWasFired};
DelayEvent.prototype.getActivationTime=function(nCurrentTime){return this.nTimeout+nCurrentTime};
DelayEvent.prototype.dispose=function(){if(this.isCharged())this.bWasFired=true};
DelayEvent.prototype.charge=function(){if(!this.isCharged())this.bWasFired=false};return DelayEvent
}(EventBase);var WakeupEvent=function(_super){__extends(WakeupEvent,_super);function WakeupEvent(
aTimer,aActivityQueue){var _this=_super.call(this)||this;_this.nNextTime=0;_this.aActivity=null;
_this.aTimer=new ElapsedTime(aTimer);_this.aActivityQueue=aActivityQueue;return _this}
WakeupEvent.prototype.clone=function(){var aWakeupEvent=new WakeupEvent(this.aTimer.getTimeBase(),
this.aActivityQueue);aWakeupEvent.nNextTime=this.nNextTime;aWakeupEvent.aActivity=this.aActivity;
return aWakeupEvent};WakeupEvent.prototype.dispose=function(){this.aActivity=null};
WakeupEvent.prototype.fire=function(){if(!this.aActivity)return false;
return this.aActivityQueue.addActivity(this.aActivity)};WakeupEvent.prototype.isCharged=function(){
return true};WakeupEvent.prototype.getActivationTime=function(nCurrentTime){
var nElapsedTime=this.aTimer.getElapsedTime();return Math.max(nCurrentTime,
nCurrentTime-nElapsedTime+this.nNextTime)};WakeupEvent.prototype.start=function(){this.aTimer.reset(
)};WakeupEvent.prototype.setNextTimeout=function(nNextTime){this.nNextTime=nNextTime};
WakeupEvent.prototype.setActivity=function(aActivity){this.aActivity=aActivity};return WakeupEvent}(
EventBase);function makeEvent(aFunctor){return new DelayEvent(aFunctor,0)}function makeDelay(
aFunctor,nTimeout){return new DelayEvent(aFunctor,nTimeout)}function registerEvent(nNodeId,
aSlideShow,aTiming,aEvent,aNodeContext){var aSlideShowContext=aNodeContext._context;
var eTimingType=aTiming.getType();aRegisterEventDebugPrinter.print(
"registerEvent( node id: "+nNodeId+", timing: "+aTiming.info()+" )");if(
eTimingType==TimingType.Offset){aSlideShowContext.aTimerEventQueue.addEvent(aEvent)}else if(
aNodeContext.bFirstRun){var aEventMultiplexer=aSlideShowContext.aEventMultiplexer;if(
!aEventMultiplexer){window.app.console.log("registerEvent: event multiplexer not initialized");
return}var aNextEffectEventArray=aSlideShowContext.aNextEffectEventArray;if(!aNextEffectEventArray){
window.app.console.log("registerEvent: next effect event array not initialized");return}
var aInteractiveAnimationSequenceMap=aSlideShowContext.aInteractiveAnimationSequenceMap;if(
!aInteractiveAnimationSequenceMap){window.app.console.log(
"registerEvent: interactive animation sequence map not initialized");return}switch(eTimingType){
case TimingType.Event:{var eEventType=aTiming.getEventType();
var sEventBaseElemId=aTiming.getEventBaseElementId();if(sEventBaseElemId){
var aSourceEventElement=aNodeContext.makeSourceEventElement(sEventBaseElemId,aSlideShow);if(
!aInteractiveAnimationSequenceMap.has(nNodeId)){aInteractiveAnimationSequenceMap.set(nNodeId,
new InteractiveAnimationSequence(nNodeId,aSlideShow))}var bEventRegistered=false;switch(eEventType){
case EventTrigger.OnClick:aEventMultiplexer.registerEvent(eEventType,aSourceEventElement.getId(),
aEvent);aEventMultiplexer.registerRewindedEffectHandler(aSourceEventElement.getId(),
aSourceEventElement.charge.bind(aSourceEventElement));bEventRegistered=true;break;default:
window.app.console.log("generateEvent: not handled event type: "+eEventType)}if(bEventRegistered){
var aStartEvent=aInteractiveAnimationSequenceMap.get(nNodeId).getStartEvent();
var aEndEvent=aInteractiveAnimationSequenceMap.get(nNodeId).getEndEvent();
aEventMultiplexer.registerEvent(eEventType,aSourceEventElement.getId(),aStartEvent);
aEventMultiplexer.registerEvent(EventTrigger.EndEvent,nNodeId,aEndEvent);
aEventMultiplexer.registerRewindedEffectHandler(nNodeId,aInteractiveAnimationSequenceMap.get(nNodeId
).chargeEvents.bind(aInteractiveAnimationSequenceMap.get(nNodeId)))}}else{switch(eEventType){
case EventTrigger.OnNext:aNextEffectEventArray.appendEvent(aEvent);break;default:
window.app.console.log("registerEvent: not handled event type: "+eEventType)}}}break;
case TimingType.SyncBase:{var eEventType=aTiming.getEventType();
var sEventBaseElemId=aTiming.getEventBaseElementId();if(sEventBaseElemId){
var aAnimationNode=aNodeContext.aAnimationNodeMap.get(sEventBaseElemId);if(!aAnimationNode){
window.app.console.log(
"registerEvent: TimingType.SyncBase: event base element not found: "+sEventBaseElemId);return}
aEventMultiplexer.registerEvent(eEventType,aAnimationNode.getId(),aEvent)}else{
window.app.console.log("registerEvent: TimingType.SyncBase: event base element not specified")}}
break;default:window.app.console.log("registerEvent: not handled timing type: "+eTimingType)}}}
var FrameSynchronization=function(){function FrameSynchronization(nFrameDuration){
this.aTimer=new ElapsedTime;this.nNextFrameTargetTime=0;this.bIsActive=false;
this.nFrameDuration=nFrameDuration;this.markCurrentFrame()}
FrameSynchronization.prototype.markCurrentFrame=function(){
this.nNextFrameTargetTime=this.aTimer.getElapsedTime()+this.nFrameDuration};
FrameSynchronization.prototype.synchronize=function(){if(this.bIsActive){while(
this.aTimer.getElapsedTime()<this.nNextFrameTargetTime);}this.markCurrentFrame()};
FrameSynchronization.prototype.activate=function(){this.bIsActive=true};
FrameSynchronization.prototype.deactivate=function(){this.bIsActive=false};
return FrameSynchronization}();var InteractiveAnimationSequence=function(){
function InteractiveAnimationSequence(nNodeId,aSlideShow){this.bIsRunning=false;
this.aStartEvent=null;this.aEndEvent=null;this.nId=nNodeId;this.aSlideShow=aSlideShow;if(
!this.aSlideShow){window.app.console.log(
"InteractiveAnimationSequence.constructor: invalid slide show handler")}}
InteractiveAnimationSequence.prototype.getId=function(){return this.nId};
InteractiveAnimationSequence.prototype.getStartEvent=function(){if(!this.aStartEvent){
this.aStartEvent=makeEvent(this.start.bind(this))}return this.aStartEvent};
InteractiveAnimationSequence.prototype.getEndEvent=function(){if(!this.aEndEvent){
this.aEndEvent=makeEvent(this.end.bind(this))}return this.aEndEvent};
InteractiveAnimationSequence.prototype.chargeEvents=function(){if(this.aStartEvent
)this.aStartEvent.charge();if(this.aEndEvent)this.aEndEvent.charge()};
InteractiveAnimationSequence.prototype.isRunning=function(){return this.bIsRunning};
InteractiveAnimationSequence.prototype.start=function(){
this.aSlideShow.notifyInteractiveAnimationSequenceStart(this.getId());this.bIsRunning=true};
InteractiveAnimationSequence.prototype.end=function(){
this.aSlideShow.notifyInteractiveAnimationSequenceEnd(this.getId());this.bIsRunning=false};
return InteractiveAnimationSequence}();var MetaPresentation=function(){function MetaPresentation(
info,aSlideShowHandler,aSlideShowNavigator){this.aSlideShowHandler=aSlideShowHandler;this.update(
info);this.setNavigator(aSlideShowNavigator)}MetaPresentation.prototype.setNavigator=function(nav){
var _this=this;this.slideShowNavigator=nav;this.metaSlides.forEach(function(metaSlide){if(
metaSlide.animationsHandler){var eventMultiplexer=metaSlide.animationsHandler.eventMultiplexer;if(
eventMultiplexer)eventMultiplexer.registerMouseClickHandler(
_this.slideShowNavigator.canvasClickHandler,100)}})};Object.defineProperty(
MetaPresentation.prototype,"slideShowHandler",{get:function(){return this.aSlideShowHandler},
enumerable:false,configurable:true});Object.defineProperty(MetaPresentation.prototype,
"startSlideIndex",{get:function(){return this._startSlideIndex},enumerable:false,configurable:true})
MetaPresentation.prototype.update=function(info){this.docWidth=info.docWidth;
this.docHeight=info.docHeight;var aContext=this.aSlideShowHandler.getContext();
aContext.nSlideWidth=this.docWidth;aContext.nSlideHeight=this.docHeight;
this._numberOfSlides=info.slides.length;if(this._numberOfSlides===0)return;
this.firstSlideHash=info.slides[0].hash;this.lastSlideHash=info.slides[this._numberOfSlides-1].hash;
this.metaSlides=new Map;this.partHashes=new Map;var prevSlideHash=null;for(
var i=0;i<this._numberOfSlides;++i){var slide=info.slides[i];slide.indexInSlideShow=i;
slide.prev=prevSlideHash;slide.next=i+1<this._numberOfSlides?info.slides[i+1].hash:null;
var metaSlide=new MetaSlide(slide,this);this.metaSlides.set(slide.hash,metaSlide);
this.partHashes.set(slide.index,slide.hash);prevSlideHash=slide.hash}};
MetaPresentation.prototype.isEmpty=function(){return this._numberOfSlides===0};
Object.defineProperty(MetaPresentation.prototype,"numberOfSlides",{get:function(){
return this._numberOfSlides},enumerable:false,configurable:true});Object.defineProperty(
MetaPresentation.prototype,"slideWidth",{get:function(){return this.docWidth},enumerable:false,
configurable:true});Object.defineProperty(MetaPresentation.prototype,"slideHeight",{get:function(){
return this.docHeight},enumerable:false,configurable:true});
MetaPresentation.prototype.getCurrentSlideIndex=function(){
return this.slideShowNavigator.currentSlideIndex};
MetaPresentation.prototype.getCurrentSlideHash=function(){return this.getSlideHash(
this.getCurrentSlideIndex())};MetaPresentation.prototype.getSlideHash=function(slideIndex){
return this.partHashes.get(slideIndex)};MetaPresentation.prototype.isFirstSlide=function(hash){
return hash===this.firstSlideHash};MetaPresentation.prototype.isLastSlide=function(hash){
return hash===this.lastSlideHash};MetaPresentation.prototype.getMetaSlide=function(slideHash){
return this.metaSlides.get(slideHash)};MetaPresentation.prototype.getMetaSlideByIndex=function(
slideIndex){return this.getMetaSlide(this.getSlideHash(slideIndex))};
MetaPresentation.prototype.getSlideInfo=function(slideHash){var metaSlide=this.getMetaSlide(
slideHash);return metaSlide?metaSlide.info:null};
MetaPresentation.prototype.getSlideInfoByIndex=function(slideIndex){var slideHash=this.getSlideHash(
slideIndex);return slideHash?this.getSlideInfo(slideHash):null};
MetaPresentation.prototype.getMetaSlides=function(){return this.metaSlides};
MetaPresentation.prototype.setCurrentSlide=function(nSlideIndex){if(
nSlideIndex>=0&&nSlideIndex<this.numberOfSlides){var nCurSlide=this.getCurrentSlideIndex();if(
nCurSlide!==undefined)this.getMetaSlideByIndex(nCurSlide).hide();this.getMetaSlideByIndex(nCurSlide
).show()}else{window.app.console.log(
"MetaPresentation.setCurrentSlide: slide index out of range: "+nSlideIndex)}};
return MetaPresentation}();var MetaSlide=function(){function MetaSlide(slideInfo,metaPres){
this._info=slideInfo;this._metaPres=metaPres;this._slideShowHandler=metaPres.slideShowHandler;if(
this.hasTransition())this._transitionHandler=new SlideTransition(slideInfo);if(slideInfo.animations
){this._animationsHandler=new SlideAnimations(this._slideShowHandler.getContext(),this);
this._animationsHandler.importAnimations(slideInfo.animations.root);
this._animationsHandler.parseInfo();app.console.debug(
"[1mSlide "+this._info.index+" Animation Tree[m\n"+this._animationsHandler.info(true))}}
MetaSlide.prototype.hasTransition=function(){return stringToTransitionTypeMap[
this._info.transitionType]!==undefined};Object.defineProperty(MetaSlide.prototype,"info",{
get:function(){return this._info},enumerable:false,configurable:true});Object.defineProperty(
MetaSlide.prototype,"hidden",{get:function(){return this._info.hidden},enumerable:false,
configurable:true});Object.defineProperty(MetaSlide.prototype,"next",{get:function(){
return this.info.next?this._metaPres.getMetaSlide(this.info.next):null},enumerable:false,
configurable:true});Object.defineProperty(MetaSlide.prototype,"prev",{get:function(){
return this.info.prev?this._metaPres.getMetaSlide(this.info.prev):null},enumerable:false,
configurable:true});Object.defineProperty(MetaSlide.prototype,"transitionHandler",{get:function(){
return this._transitionHandler},enumerable:false,configurable:true});Object.defineProperty(
MetaSlide.prototype,"animationsHandler",{get:function(){return this._animationsHandler},
enumerable:false,configurable:true});MetaSlide.prototype.getTriggerInfo=function(hash){
var triggers=this._info.triggers;if(triggers){var index=triggers.findIndex(function(value){
return value.hash===hash});if(index!==-1){return{bounds:triggers[index].bounds,index:index}}}
return null};MetaSlide.prototype.show=function(){};MetaSlide.prototype.hide=function(){};
return MetaSlide}();var NextEffectEventArray=function(){function NextEffectEventArray(){
this.aEventArray=[]}NextEffectEventArray.prototype.size=function(){return this.aEventArray.length};
NextEffectEventArray.prototype.at=function(nIndex){return this.aEventArray[nIndex]};
NextEffectEventArray.prototype.appendEvent=function(aEvent){var nSize=this.size();for(
var i=0;i<nSize;++i){if(this.aEventArray[i].getId()==aEvent.getId()){
aNextEffectEventArrayDebugPrinter.print("NextEffectEventArray.appendEvent: event("+aEvent.getId(
)+") already present");return false}}this.aEventArray.push(aEvent);
aNextEffectEventArrayDebugPrinter.print("NextEffectEventArray.appendEvent: event("+aEvent.getId(
)+") appended");return true};NextEffectEventArray.prototype.clear=function(){this.aEventArray=[]};
return NextEffectEventArray}();var AnimationNodeType;(function(AnimationNodeType){AnimationNodeType[
AnimationNodeType["Custom"]=0]="Custom";AnimationNodeType[AnimationNodeType["Par"]=1]="Par";
AnimationNodeType[AnimationNodeType["Seq"]=2]="Seq";AnimationNodeType[AnimationNodeType["Iterate"]=3
]="Iterate";AnimationNodeType[AnimationNodeType["Animate"]=4]="Animate";AnimationNodeType[
AnimationNodeType["Set"]=5]="Set";AnimationNodeType[AnimationNodeType["AnimateMotion"]=6
]="AnimateMotion";AnimationNodeType[AnimationNodeType["AnimateColor"]=7]="AnimateColor";
AnimationNodeType[AnimationNodeType["AnimateTransform"]=8]="AnimateTransform";AnimationNodeType[
AnimationNodeType["TransitionFilter"]=9]="TransitionFilter";AnimationNodeType[AnimationNodeType[
"Audio"]=10]="Audio";AnimationNodeType[AnimationNodeType["Command"]=11]="Command"})(
AnimationNodeType||(AnimationNodeType={}));function getAnimationNodeType(aNodeInfo){
var typeStr=aNodeInfo.nodeName;return AnimationNodeType[typeStr]}function getNodeChildren(aNode){
return aNode.children||[]}function isAttributeSupported(aNodeInfo){if(!aNodeInfo.attributeName){
console.error("slideshow: missing attributeName");return false}
return AnimatedElement.SupportedProperties.has(aNodeInfo.attributeName.toLowerCase())}
function isTransformSupported(aNodeInfo){if(!aNodeInfo.transformType){console.error(
"slideshow: missing transformType");return false}
return AnimatedElement.SupportedTransformations.has(aNodeInfo.transformType.toLowerCase())}
function createAnimationTree(aAnimationRoot,aNodeContext){return createAnimationNode(aAnimationRoot,
null,aNodeContext)}function createAnimationNode(aNodeInfo,aParentNode,aNodeContext){assert(aNodeInfo
,"createAnimationNode: invalid animation node");var eAnimationNodeType=getAnimationNodeType(
aNodeInfo);var aCreatedNode=null;var aCreatedContainer=null;switch(eAnimationNodeType){
case AnimationNodeType.Par:aCreatedNode=aCreatedContainer=new ParallelTimeContainer(aNodeInfo,
aParentNode,aNodeContext);break;case AnimationNodeType.Iterate:window.app.console.log(
"createAnimationNode: Iterate not implemented");return null;case AnimationNodeType.Seq:
aCreatedNode=aCreatedContainer=new SequentialTimeContainer(aNodeInfo,aParentNode,aNodeContext);break
case AnimationNodeType.Animate:if(isAttributeSupported(aNodeInfo)){
aCreatedNode=new PropertyAnimationNode(aNodeInfo,aParentNode,aNodeContext);break}else{
var attrName=aNodeInfo.attributeName;window.app.console.log(
"createAnimationNode: PropertyAnimationNode: attribute '"+attrName+"' not supported");return null}
case AnimationNodeType.Set:if(isAttributeSupported(aNodeInfo)){aCreatedNode=new AnimationSetNode(
aNodeInfo,aParentNode,aNodeContext);break}else{var attrName=aNodeInfo.attributeName;
window.app.console.log(
"createAnimationNode: AnimationSetNode: attribute '"+attrName+"' not supported");return null}
case AnimationNodeType.AnimateMotion:aCreatedNode=new AnimationPathMotionNode(aNodeInfo,aParentNode,
aNodeContext);break;case AnimationNodeType.AnimateColor:aCreatedNode=new AnimationColorNode(
aNodeInfo,aParentNode,aNodeContext);break;case AnimationNodeType.AnimateTransform:if(
isTransformSupported(aNodeInfo)){aCreatedNode=new AnimationTransformNode(aNodeInfo,aParentNode,
aNodeContext);break}else{var transfType=aNodeInfo.transformType;window.app.console.log(
"createAnimationNode: AnimationTransformNode: transform '"+transfType+"' not supported");return null
}case AnimationNodeType.TransitionFilter:{aCreatedNode=new AnimationTransitionFilterNode(aNodeInfo,
aParentNode,aNodeContext);break}case AnimationNodeType.Audio:window.app.console.log(
"createAnimationNode: Audio not implemented");return null;case AnimationNodeType.Command:
window.app.console.log("createAnimationNode: Command not implemented");return null;default:
window.app.console.log("createAnimationNode: invalid Animation Node Type: "+eAnimationNodeType);
return null}if(aCreatedContainer){var aChildrenArray=getNodeChildren(aNodeInfo);for(
var i=0;i<aChildrenArray.length;++i){if(!createChildNode(aChildrenArray[i],aCreatedContainer,
aNodeContext)){if(!(aChildrenArray.length!==1&&getAnimationNodeType(aChildrenArray[i]
)===AnimationNodeType.Set)){aCreatedContainer.removeAllChildrenNodes();break}}}}return aCreatedNode}
function createChildNode(aNodeInfo,aParentNode,aNodeContext){var aChildNode=createAnimationNode(
aNodeInfo,aParentNode,aNodeContext);if(!aChildNode){window.app.console.log(
"createChildNode: child node creation failed");return false}else{if(aChildNode.isContainer(
)&&!aChildNode.isMainSequenceRootNode()){var aContainer=aChildNode;if(aContainer.isEmpty()){
window.app.console.log("createChildNode: child-node("+aContainer.getId()+") is empty");return true}}
aParentNode.appendChildNode(aChildNode);return true}}var SlideAnimations=function(){
function SlideAnimations(aSlideShowContext,metaSlide){this.aContext=new NodeContext(
aSlideShowContext);this.aSlideShowHandler=aSlideShowContext.aSlideShowHandler;
this.aAnimationNodeMap=new Map;this.aAnimatedElementMap=new Map;this.aSourceEventElementMap=new Map;
this.aNextEffectEventArray=new NextEffectEventArray;this.aInteractiveAnimationSequenceMap=new Map;
this.aEventMultiplexer=new EventMultiplexer(aSlideShowContext.aTimerEventQueue);this.aRootNode=null;
this.bElementsParsed=false;this.aContext.metaSlide=metaSlide;
this.aContext.aAnimationNodeMap=this.aAnimationNodeMap;
this.aContext.aAnimatedElementMap=this.aAnimatedElementMap;
this.aContext.aSourceEventElementMap=this.aSourceEventElementMap}
SlideAnimations.prototype.importAnimations=function(aAnimationRoot){if(!aAnimationRoot)return false;
this.aRootNode=createAnimationTree(aAnimationRoot,this.aContext);return!!this.aRootNode};
SlideAnimations.prototype.parseInfo=function(){if(!this.aRootNode)return false;
this.aRootNode.parseNodeInfo();this.bElementsParsed=true};
SlideAnimations.prototype.elementsParsed=function(){return this.bElementsParsed};
SlideAnimations.prototype.info=function(verbose){if(this.aRootNode)return this.aRootNode.info(
verbose)};SlideAnimations.prototype.isFirstRun=function(){return this.aContext.bFirstRun};
SlideAnimations.prototype.isAnimated=function(){if(!this.bElementsParsed)return false;
return this.aRootNode.hasPendingAnimation()};SlideAnimations.prototype.start=function(){if(
!this.bElementsParsed)return false;this.chargeSourceEvents();this.chargeInterAnimEvents();
this.aSlideShowHandler.setSlideEvents(this.aNextEffectEventArray,
this.aInteractiveAnimationSequenceMap,this.aEventMultiplexer);if(this.aContext.bFirstRun===undefined
)this.aContext.bFirstRun=true;else if(this.aContext.bFirstRun)this.aContext.bFirstRun=false;
this.aContext.bIsInvalid=!this.aRootNode.init();if(this.aContext.bIsInvalid){ANIMDBG.print(
"SlideAnimationsthis.start: aContext.bIsInvalid");return false}return this.aRootNode.resolve()};
SlideAnimations.prototype.end=function(bLeftEffectsSkipped){if(!this.bElementsParsed)return;
this.aRootNode.deactivate();this.aRootNode.end();if(bLeftEffectsSkipped&&this.isFirstRun()){
this.aContext.bFirstRun=undefined}else if(this.isFirstRun()){this.aContext.bFirstRun=false}
this.aContext.bIsInvalid=false};SlideAnimations.prototype.dispose=function(){if(this.aRootNode){
this.aRootNode.dispose()}if(this.aEventMultiplexer){this.aEventMultiplexer.clear()}};
SlideAnimations.prototype.clearNextEffectEvents=function(){ANIMDBG.print(
"SlideAnimations.clearNextEffectEvents");this.aNextEffectEventArray.clear();
this.aContext.bFirstRun=undefined};SlideAnimations.prototype.chargeSourceEvents=function(){
this.aSourceEventElementMap.forEach(function(aSourceEventElement){aSourceEventElement.charge()})};
SlideAnimations.prototype.chargeInterAnimEvents=function(){
this.aInteractiveAnimationSequenceMap.forEach(function(aInteractiveAnimationSequence){
aInteractiveAnimationSequence.chargeEvents()})};
SlideAnimations.prototype.getAnimationsTree=function(){return this.aRootNode};
SlideAnimations.prototype.getAnimatedElementMap=function(){return this.aAnimatedElementMap};
Object.defineProperty(SlideAnimations.prototype,"eventMultiplexer",{get:function(){
return this.aEventMultiplexer},enumerable:false,configurable:true});return SlideAnimations}();
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ISlideChangeBase=function(){function ISlideChangeBase(){}
return ISlideChangeBase}();function SlideChangeTemplate(BaseType){var SlideChangeBase=function(
_super){__extends(SlideChangeBase,_super);function SlideChangeBase(){var args=[];for(
var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}var _this=this;assert(args.length===1,
"SlideChangeBase, constructor args length is wrong");var transitionParameters=args[0];
_this=_super.call(this,transitionParameters)||this;_this.transitionParameters=transitionParameters;
_this.leavingSlide=transitionParameters.current;_this.enteringSlide=transitionParameters.next;
_this.isFinished=false;_this.requestAnimationFrameId=null;_this.time=null;_this.isLastFrame=false;
return _this}SlideChangeBase.prototype.end=function(){if(this.isFinished)return;if(
this.requestAnimationFrameId!==null){app.console.debug(
"SlideChangeBase.end: render() not yet executed");this.requestAnimationFrameId=null;setTimeout(
this.end.bind(this),100);return}this.isFinished=true;this.endTransition()};
SlideChangeBase.prototype.perform=function(nT,last){if(last===void 0){last=false}if(this.isFinished
)return;this.time=nT;this.isLastFrame=last};SlideChangeBase.prototype.renderFrame=function(nT,
properties){if(nT!==null&&nT>=0){this.render(nT,properties)}};
SlideChangeBase.prototype.animate=function(){if(this.time!==null&&this.time>0){this.render(this.time
)}if(!this.isLastFrame)this.requestAnimationFrameId=requestAnimationFrame(this.animate.bind(this))};
SlideChangeBase.prototype.getUnderlyingValue=function(){return 0};return SlideChangeBase}(BaseType);
return SlideChangeBase}var TextureRendererCtorForSlideChangeBase=function(_super){__extends(
TextureRendererCtorForSlideChangeBase,_super);function TextureRendererCtorForSlideChangeBase(
transitionParameters){return _super.call(this,transitionParameters.context,false)||this}
return TextureRendererCtorForSlideChangeBase}(SimpleTextureRenderer);
var SlideChangeGl=SlideChangeTemplate(TextureRendererCtorForSlideChangeBase);
var SlideShowContext=function(){function SlideShowContext(aSlideShowHandler,aTimerEventQueue,
aEventMultiplexer,aNextEffectEventArray,aInteractiveAnimationSequenceMap,aActivityQueue){
this.aSlideShowHandler=aSlideShowHandler;this.aTimerEventQueue=aTimerEventQueue;
this.aEventMultiplexer=aEventMultiplexer;this.aNextEffectEventArray=aNextEffectEventArray;
this.aInteractiveAnimationSequenceMap=aInteractiveAnimationSequenceMap;
this.aActivityQueue=aActivityQueue;this.bIsSkipping=false}return SlideShowContext}();
var SlideShowHandler=function(){function SlideShowHandler(presenter){
this.bIsFirstAutoEffectRunning=false;this.transitionsWithMipMapEnabled=new Set([
TransitionSubType.CORNERSOUT,TransitionSubType.TOPTOBOTTOM,TransitionSubType.LEFTTORIGHT,
TransitionSubType.BOTTOMRIGHT,TransitionSubType.BOTTOMLEFT,TransitionSubType.TOPCENTER,
TransitionSubType.CORNERSIN,TransitionSubType.TOPLEFT,TransitionSubType.CIRCLE,
TransitionSubType.FANOUTHORIZONTAL,TransitionSubType.ACROSS,TransitionSubType.DIAMOND,
TransitionSubType.HEART]);this._labelMap={rewind:_("Previous"),dispatch:_("Next"),skip:_("Skip"),
rewindAll:_("First"),skipAll:_("Skip All"),firstPage:_("First Slide"),nextPage:_("Next Slide"),
prevPage:_("Previous Slide"),lastPage:_("Last Slide"),quit:_("End Show")};this.presenter=presenter;
this.aTimer=new ElapsedTime;this.aFrameSynchronization=new FrameSynchronization(
SlideShowHandler.PREFERRED_FRAME_RATE);this.aTimerEventQueue=new TimerEventQueue(this.aTimer);
this.aActivityQueue=new ActivityQueue(this.aTimer);this.aNextEffectEventArray=null;
this.aInteractiveAnimationSequenceMap=null;this.aEventMultiplexer=null;
this._context=new SlideShowContext(this,this.aTimerEventQueue,this.aEventMultiplexer,
this.aNextEffectEventArray,this.aInteractiveAnimationSequenceMap,this.aActivityQueue);
this.bIsIdle=true;this.bIsEnabled=true;this.bNoSlideTransition=false;this.bIsTransitionRunning=false
this.nCurrentEffect=0;this.bIsNextEffectRunning=false;this.bIsRewinding=false;this.bIsSkipping=false
this.bIsSkippingAll=false;this.nTotalInteractivePlayingEffects=0;this.aStartedEffectList=[];
this.aStartedEffectIndexMap=new Map;this.aStartedEffectIndexMap.set(-1,undefined);
this.automaticAdvanceTimeout=null}Object.defineProperty(SlideShowHandler.prototype,
"automaticAdvanceTimeoutRewindedEffect",{get:function(){
var automaticAdvanceTimeout=this.automaticAdvanceTimeout;
return automaticAdvanceTimeout.rewindedEffect},enumerable:false,configurable:true});
SlideShowHandler.prototype.setMetaPresentation=function(metaPres){this.theMetaPres=metaPres};
SlideShowHandler.prototype.setNavigator=function(slideShowNavigator){
this.slideShowNavigator=slideShowNavigator};SlideShowHandler.prototype.isGlSupported=function(){
return!this.presenter._slideRenderer._context.is2dGl()};
SlideShowHandler.prototype.setSlideEvents=function(aNextEffectEventArray,
aInteractiveAnimationSequenceMap,aEventMultiplexer){if(!aNextEffectEventArray
)window.app.console.log("SlideShow.setSlideEvents: aNextEffectEventArray is not valid");if(
!aInteractiveAnimationSequenceMap)window.app.console.log(
"SlideShow.setSlideEvents:aInteractiveAnimationSequenceMap  is not valid");if(!aEventMultiplexer
)window.app.console.log("SlideShow.setSlideEvents: aEventMultiplexer is not valid");
this._context.aNextEffectEventArray=aNextEffectEventArray;
this.aNextEffectEventArray=aNextEffectEventArray;
this._context.aInteractiveAnimationSequenceMap=aInteractiveAnimationSequenceMap;
this.aInteractiveAnimationSequenceMap=aInteractiveAnimationSequenceMap;
this._context.aEventMultiplexer=aEventMultiplexer;this.aEventMultiplexer=aEventMultiplexer;
this.nCurrentEffect=0};SlideShowHandler.prototype.createSlideTransition=function(
aSlideTransitionHandler,transitionParameters,aTransitionEndEvent){if(this.bNoSlideTransition
)return null;var aSlideTransition=aSlideTransitionHandler.createSlideTransition(transitionParameters
);if(!aSlideTransition)return null;var nDuration=.001;if(aSlideTransitionHandler.getDuration(
).isValue()){nDuration=aSlideTransitionHandler.getDuration().getValue()}else{window.app.console.log(
"SlideShow.createSlideTransition: duration is not a number")}
var aCommonParameterSet=new ActivityParamSet;aCommonParameterSet.aEndEvent=aTransitionEndEvent;
aCommonParameterSet.aTimerEventQueue=this.aTimerEventQueue;
aCommonParameterSet.aActivityQueue=this.aActivityQueue;aCommonParameterSet.nMinDuration=nDuration;
aCommonParameterSet.nMinNumberOfFrames=aSlideTransitionHandler.getMinFrameCount();
aCommonParameterSet.nSlideWidth=this.theMetaPres.slideWidth;
aCommonParameterSet.nSlideHeight=this.theMetaPres.slideHeight;return new SimpleActivity(
aCommonParameterSet,aSlideTransition,DirectionType.Forward)};
SlideShowHandler.prototype.addA11yString=function(a11yString){if(this.presenter._enableA11y){
var canvas=this.getContext()._canvas;if(canvas){var a11yContainer=window.L.DomUtil.create("div","");
a11yContainer.tabIndex=-1;canvas.innerHTML="";a11yContainer.innerHTML=app.LOUtil.sanitize(a11yString
);canvas.appendChild(a11yContainer)}}};SlideShowHandler.prototype.isEnabled=function(){
return this.bIsEnabled};SlideShowHandler.prototype.disable=function(){this.bIsEnabled=false;
this.dispose()};SlideShowHandler.prototype.isRunning=function(){return!this.bIsIdle};
SlideShowHandler.prototype.isTransitionPlaying=function(){return this.bIsTransitionRunning};
SlideShowHandler.prototype.isMainEffectPlaying=function(){return this.bIsNextEffectRunning};
SlideShowHandler.prototype.isInteractiveEffectPlaying=function(){
return this.nTotalInteractivePlayingEffects>0};
SlideShowHandler.prototype.isAnyEffectPlaying=function(){return this.isMainEffectPlaying(
)||this.isInteractiveEffectPlaying()};SlideShowHandler.prototype.hasAnyEffectStarted=function(){
return this.aStartedEffectList.length>0};SlideShowHandler.prototype.notifyNextEffectStart=function(
){var _this=this;assert(!this.bIsNextEffectRunning,
"SlideShowHandler.notifyNextEffectStart: an effect is already started.");ANIMDBG.print(
"SlideShowHandler.notifyNextEffectStart invoked.");this.bIsNextEffectRunning=true;
this.aEventMultiplexer.registerNextEffectEndHandler(this.notifyNextEffectEnd.bind(this));
var aEffect=new Effect;aEffect.start();this.aStartedEffectIndexMap.set(-1,
this.aStartedEffectList.length);this.aStartedEffectList.push(aEffect);
var sCurSlideHash=this.theMetaPres.getCurrentSlideHash();
var curMetaSlide=this.theMetaPres.getMetaSlide(sCurSlideHash);if(curMetaSlide.animationsHandler){
var aAnimatedElementMap=curMetaSlide.animationsHandler.getAnimatedElementMap();var effect_1=0;
var currentEffect_1=this.nCurrentEffect;aAnimatedElementMap.forEach(function(aAnimatedElement){
aAnimatedElement.notifyNextEffectStart(currentEffect_1);if(effect_1===currentEffect_1){setTimeout(
_this.addA11yString.bind(_this,_("Animation Start: ")+aAnimatedElement.getTitle()),500)}effect_1++})
}};SlideShowHandler.prototype.notifyNextEffectEnd=function(){assert(this.bIsNextEffectRunning,
"SlideShow.notifyNextEffectEnd: effect already ended.");ANIMDBG.print(
"SlideShowHandler.notifyNextEffectEnd invoked.");this.bIsNextEffectRunning=false;
this.aStartedEffectList[this.aStartedEffectIndexMap.get(-1)].end();if(
this.automaticAdvanceTimeout!==null){if(
this.automaticAdvanceTimeoutRewindedEffect===this.nCurrentEffect){this.automaticAdvanceTimeout=null;
this.notifyAnimationsEnd()}}};SlideShowHandler.prototype.notifyAnimationsEnd=function(){
ANIMDBG.print(
"SlideShowHandler.notifyAnimationsEnd: current slide index: "+this.slideShowNavigator.currentSlideIndex
);var sCurrSlideHash=this.theMetaPres.getCurrentSlideHash();if(this.theMetaPres.isLastSlide(
sCurrSlideHash))return;assert(this.automaticAdvanceTimeout===null,
"SlideShow.notifyAnimationsEnd: Timeout already set.");var slideInfo=this.theMetaPres.getSlideInfo(
sCurrSlideHash);if((slideInfo===null||slideInfo===void 0?void 0:slideInfo.nextSlideDuration
)&&slideInfo.nextSlideDuration>0){this.automaticAdvanceTimeout=window.setTimeout(
this.slideShowNavigator.switchSlide.bind(this.slideShowNavigator,1,false),
slideInfo.nextSlideDuration)}};SlideShowHandler.prototype.notifySlideStart=function(nNewSlideIndex,
nOldSlideIndex){var _this=this;this.nCurrentEffect=0;this.bIsRewinding=false;this.bIsSkipping=false;
this.bIsSkippingAll=false;this.nTotalInteractivePlayingEffects=0;this.aStartedEffectList=[];
this.aStartedEffectIndexMap=new Map;this.aStartedEffectIndexMap.set(-1,undefined);if(
nOldSlideIndex!==undefined){var metaOldSlide=this.theMetaPres.getMetaSlideByIndex(nOldSlideIndex);
if(metaOldSlide.animationsHandler){
var aAnimatedElementMap=metaOldSlide.animationsHandler.getAnimatedElementMap();
aAnimatedElementMap.forEach(function(aAnimatedElement){aAnimatedElement.notifySlideEnd()})}}
var metaNewSlide=this.theMetaPres.getMetaSlideByIndex(nNewSlideIndex);if(
metaNewSlide.animationsHandler){
var aAnimatedElementMap=metaNewSlide.animationsHandler.getAnimatedElementMap();
aAnimatedElementMap.forEach(function(aAnimatedElement){aAnimatedElement.notifySlideStart(
_this._context)})}this.slideCompositor.notifyTransitionStart();this.presenter._map.fire(
"transitionstart",{slide:nNewSlideIndex});var slideInfo=this.getSlideInfo(nNewSlideIndex);if(
slideInfo.transitionLabel){setTimeout(this.addA11yString.bind(this,_("Transition Start: "
)+slideInfo.transitionLabel),500)}};SlideShowHandler.prototype.notifyTransitionEnd=function(
nNewSlide,nOldSlide){NAVDBG.print(
"SlideShowHandler.notifyTransitionEnd: nNewSlide: "+nNewSlide+", nOldSlide: "+nOldSlide+", this.bIsRewinding: "+this.bIsRewinding
);var slideInfo=this.getSlideInfo(nNewSlide);if(slideInfo.transitionLabel){this.addA11yString(_(
"Transition End: "))}this.bIsTransitionRunning=false;if(!this.presenter._checkAlreadyPresenting()
)return;if(this.bIsRewinding){this.theMetaPres.getMetaSlideByIndex(nNewSlide).hide();
this.slideShowNavigator.rewindToPreviousSlide();this.bIsRewinding=false;return}
var sCurSlideHash=this.theMetaPres.getCurrentSlideHash();this.slideCompositor.notifyTransitionEnd(
sCurSlideHash);try{this.presentSlide(nNewSlide)}catch(message){app.console.error(
"notifyTransitionEnd: "+message)}this.presenter._map.fire("transitionend",{slide:nNewSlide});
this.enteringSlideTexture=null;this.isStarting=false;if(this.isEnabled()){this.dispose();
var aCurrentSlide=this.theMetaPres.getMetaSlide(sCurSlideHash);if(
aCurrentSlide&&aCurrentSlide.animationsHandler&&aCurrentSlide.animationsHandler.elementsParsed()){
aCurrentSlide.animationsHandler.start();this.aEventMultiplexer.registerAnimationsEndHandler(
this.notifyAnimationsEnd.bind(this))}else this.notifyAnimationsEnd();this.update()
}else this.notifyAnimationsEnd()};
SlideShowHandler.prototype.notifyInteractiveAnimationSequenceStart=function(nNodeId){
++this.nTotalInteractivePlayingEffects;var aEffect=new Effect(nNodeId);aEffect.start();
this.aStartedEffectIndexMap.set(nNodeId,this.aStartedEffectList.length);
this.aStartedEffectList.push(aEffect)};
SlideShowHandler.prototype.notifyInteractiveAnimationSequenceEnd=function(nNodeId){assert(
this.isInteractiveEffectPlaying(),
"SlideShow.notifyInteractiveAnimationSequenceEnd: no interactive effect playing.");
this.aStartedEffectList[this.aStartedEffectIndexMap.get(nNodeId)].end();
--this.nTotalInteractivePlayingEffects};SlideShowHandler.prototype.nextEffect=function(){if(
!this.isEnabled())return false;this.addA11yString(this._labelMap["dispatch"]);if(
this.isTransitionPlaying()){this.skipTransition();return true}if(this.isFirstAutoEffectRunning()){
this.skipFirstAutoEffect();return true}ANIMDBG.print(
"SlideShowHandler.nextEffect: current effect: "+this.nCurrentEffect);if(this.isAnyEffectPlaying()){
this.skipAllPlayingEffects();return true}if(!this.aNextEffectEventArray)return false;if(
this.nCurrentEffect>=this.aNextEffectEventArray.size())return false;
this.presenter.sendSlideShowFollowMessage("effect "+JSON.stringify({
currentEffect:this.nCurrentEffect}));this.notifyNextEffectStart();this.aNextEffectEventArray.at(
this.nCurrentEffect).fire();++this.nCurrentEffect;this.update();return true};
SlideShowHandler.prototype.skipTransition=function(){if(this.bIsSkipping||this.bIsRewinding)return;
this.bIsSkipping=true;this.aActivityQueue.endAll();this.aTimerEventQueue.forceEmpty();
this.aActivityQueue.endAll();this.update();this.bIsSkipping=false};
SlideShowHandler.prototype.skipAllPlayingEffects=function(){this.addA11yString(this._labelMap[
"skipAll"]);if(this.bIsSkipping||this.bIsRewinding)return true;this.bIsSkipping=true;for(
var i=0;i<this.aStartedEffectList.length;++i){var aEffect=this.aStartedEffectList[i];if(
aEffect.isPlaying()){if(aEffect.isMainEffect())this.aEventMultiplexer.notifySkipEffectEvent(
);else this.aEventMultiplexer.notifySkipInteractiveEffectEvent(aEffect.getId())}}this.update();
this.bIsSkipping=false;return true};SlideShowHandler.prototype.skipNextEffect=function(){if(
this.bIsSkipping||this.bIsRewinding)return true;ANIMDBG.print(
"SlideShowHandler.skipNextEffect: current effect: "+this.nCurrentEffect);assert(
!this.isAnyEffectPlaying(),"SlideShowHandler.skipNextEffect");if(!this.aNextEffectEventArray
)return false;if(this.nCurrentEffect>=this.aNextEffectEventArray.size())return false;
this.notifyNextEffectStart();this.bIsSkipping=true;this.aNextEffectEventArray.at(this.nCurrentEffect
).fire();this.aEventMultiplexer.notifySkipEffectEvent();++this.nCurrentEffect;this.update();
this.bIsSkipping=false;return true};SlideShowHandler.prototype.skipPlayingOrNextEffect=function(){
this.addA11yString(this._labelMap["skip"]);if(this.isTransitionPlaying()){this.skipTransition();
return true}if(this.isFirstAutoEffectRunning()){this.skipFirstAutoEffect();return true}if(
this.isAnyEffectPlaying())return this.skipAllPlayingEffects();else return this.skipNextEffect()};
SlideShowHandler.prototype.skipAllEffects=function(){if(this.bIsSkippingAll)return true;
this.bIsSkippingAll=true;if(this.isTransitionPlaying()){this.skipTransition()}if(
this.isFirstAutoEffectRunning()){this.skipFirstAutoEffect()}if(this.isAnyEffectPlaying()){
this.skipAllPlayingEffects()}else if(
!this.aNextEffectEventArray||this.nCurrentEffect>=this.aNextEffectEventArray.size()){
this.bIsSkippingAll=false;return false}while(this.nCurrentEffect<this.aNextEffectEventArray.size()){
this.skipNextEffect()}this.bIsSkippingAll=false;return true};
SlideShowHandler.prototype.rewindTransition=function(){if(this.bIsSkipping||this.bIsRewinding)return
this.bIsRewinding=true;this.aActivityQueue.endAll();this.update();this.bIsRewinding=false};
SlideShowHandler.prototype.rewindEffect=function(){if(this.bIsSkipping||this.bIsRewinding)return;if(
this.automaticAdvanceTimeout!==null&&!this.automaticAdvanceTimeoutRewindedEffect){clearTimeout(
this.automaticAdvanceTimeout);this.automaticAdvanceTimeout={rewindedEffect:this.nCurrentEffect}}
this.addA11yString(this._labelMap["rewind"]);if(!this.hasAnyEffectStarted()){
this.rewindToPreviousSlide();return}this.bIsRewinding=true;var nFirstPlayingEffectIndex=undefined;
var i=0;for(;i<this.aStartedEffectList.length;++i){var aEffect=this.aStartedEffectList[i];if(
aEffect.isPlaying()){nFirstPlayingEffectIndex=i;break}}if(nFirstPlayingEffectIndex!==undefined){
i=this.aStartedEffectList.length-1;for(;i>=nFirstPlayingEffectIndex;--i){
var aEffect=this.aStartedEffectList[i];if(aEffect.isPlaying()){if(aEffect.isMainEffect()){
this.aEventMultiplexer.notifyRewindCurrentEffectEvent();if(this.nCurrentEffect>0
)--this.nCurrentEffect}else{this.aEventMultiplexer.notifyRewindRunningInteractiveEffectEvent(
aEffect.getId())}}else if(aEffect.isEnded()){if(aEffect.isMainEffect()){
this.aEventMultiplexer.notifyRewindLastEffectEvent();if(this.nCurrentEffect>0)--this.nCurrentEffect
}else{this.aEventMultiplexer.notifyRewindEndedInteractiveEffectEvent(aEffect.getId())}}}this.update(
);i=this.aStartedEffectList.length-1;for(;i>=nFirstPlayingEffectIndex;--i){
var aEffect=this.aStartedEffectList.pop();if(!aEffect.isMainEffect()
)this.aStartedEffectIndexMap.delete(aEffect.getId())}}else{var aEffect=this.aStartedEffectList.pop()
if(!aEffect.isMainEffect())this.aStartedEffectIndexMap.delete(aEffect.getId());if(aEffect.isEnded()
){if(aEffect.isMainEffect()){this.aEventMultiplexer.notifyRewindLastEffectEvent();if(
this.nCurrentEffect>0)--this.nCurrentEffect}else{
this.aEventMultiplexer.notifyRewindEndedInteractiveEffectEvent(aEffect.getId())}}this.update()}
this.bIsRewinding=false;this.presenter.sendSlideShowFollowMessage("effect "+JSON.stringify({
currentEffect:this.nCurrentEffect-1}))};SlideShowHandler.prototype.rewindToPreviousSlide=function(){
NAVDBG.print("SlideShowHandler.rewindToPreviousSlide");if(this.isFirstAutoEffectRunning()){
this.rewindFirstAutoEffect()}if(this.isTransitionPlaying()){this.rewindTransition();return}if(
this.isAnyEffectPlaying())return;this.slideShowNavigator.rewindToPreviousSlide()};
SlideShowHandler.prototype.rewindAllEffects=function(){this.addA11yString(this._labelMap["rewindAll"
]);if(!this.hasAnyEffectStarted()){this.rewindToPreviousSlide();return}while(
this.hasAnyEffectStarted()){this.rewindEffect()}};
SlideShowHandler.prototype.cleanLeavingSlideStatus=function(nOldSlide,bSkipSlideTransition){
var aMetaDoc=this.theMetaPres;if(nOldSlide!==undefined){this.slideCompositor.pauseVideos(
aMetaDoc.getSlideHash(nOldSlide));var oldMetaSlide=aMetaDoc.getMetaSlideByIndex(nOldSlide);if(
this.isEnabled()){if(oldMetaSlide.animationsHandler&&oldMetaSlide.animationsHandler.isAnimated()){
oldMetaSlide.animationsHandler.end(bSkipSlideTransition);this.dispose()}}if(
this.automaticAdvanceTimeout!==null){clearTimeout(this.automaticAdvanceTimeout);
this.automaticAdvanceTimeout=null}}};SlideShowHandler.prototype.displaySlide=function(nNewSlide,
nOldSlide,bSkipSlideTransition){NAVDBG.print(
"SlideShowHandler.displaySlide: nNewSlide: "+nNewSlide+", nOldSlide: "+nOldSlide);
var aMetaDoc=this.theMetaPres;if(nNewSlide>=aMetaDoc.numberOfSlides){this.exitSlideShow()}if(
this.theMetaPres.numberOfSlides-1==nNewSlide){this.addA11yString(this._labelMap["lastPage"])
}else if(nNewSlide==0){this.addA11yString(this._labelMap["firstPage"])}else if(
nNewSlide==nOldSlide+1){this.addA11yString(this._labelMap["nextPage"])}else if(
nNewSlide==nOldSlide-1){this.addA11yString(this._labelMap["prevPage"])}if(this.isTransitionPlaying()
){this.skipTransition()}if(this.isFirstAutoEffectRunning()){this.skipFirstAutoEffect()}if(
nOldSlide!==undefined){this.cleanLeavingSlideStatus(nOldSlide,bSkipSlideTransition)}
this.notifySlideStart(nNewSlide,nOldSlide);if(this.isEnabled()&&this.isGlSupported(
)&&!bSkipSlideTransition){if(
nOldSlide===undefined&&this.isStarting||nOldSlide!==undefined&&nNewSlide>nOldSlide){
var aNewMetaSlide=aMetaDoc.getMetaSlideByIndex(nNewSlide);
var aSlideTransitionHandler=aNewMetaSlide.transitionHandler;if(
aSlideTransitionHandler&&aSlideTransitionHandler.isValid()){var aTransitionEndEvent=makeEvent(
this.notifyTransitionEnd.bind(this,nNewSlide,nOldSlide));try{
var transitionParameters=this.createTransitionParameters(nNewSlide,nOldSlide);
this.enteringSlideTexture=transitionParameters.next;
var aTransitionActivity=this.createSlideTransition(aSlideTransitionHandler,transitionParameters,
aTransitionEndEvent);if(aTransitionActivity){this.bIsTransitionRunning=true;
this.aActivityQueue.addActivity(aTransitionActivity);this.update();this.presenter.stopLoader();
return}}catch(message){app.console.error("displaySlide failed: "+message)}}}}
this.notifyTransitionEnd(nNewSlide,nOldSlide)};SlideShowHandler.prototype.exitSlideShow=function(){
this.addA11yString(this._labelMap["quit"]);this.automaticAdvanceTimeout=null};
SlideShowHandler.prototype.update=function(){this.aTimer.holdTimer();this.aTimerEventQueue.process()
this.aActivityQueue.process();if(!this.bIsTransitionRunning)this.aFrameSynchronization.synchronize()
this.aActivityQueue.processDequeued();this.aTimer.releaseTimer();
var bActivitiesLeft=!this.aActivityQueue.isEmpty();
var bTimerEventsLeft=!this.aTimerEventQueue.isEmpty();
var bEventsLeft=bActivitiesLeft||bTimerEventsLeft;if(bEventsLeft){var nNextTimeout=void 0;if(
bActivitiesLeft){nNextTimeout=SlideShowHandler.MINIMUM_TIMEOUT;this.aFrameSynchronization.activate()
}else{nNextTimeout=this.aTimerEventQueue.nextTimeout();if(
nNextTimeout<SlideShowHandler.MINIMUM_TIMEOUT)nNextTimeout=SlideShowHandler.MINIMUM_TIMEOUT;else if(
nNextTimeout>SlideShowHandler.MAXIMUM_TIMEOUT)nNextTimeout=SlideShowHandler.MAXIMUM_TIMEOUT;
this.aFrameSynchronization.deactivate()}this.bIsIdle=false;setTimeout(this.update.bind(this),
nNextTimeout*1e3)}else{this.bIsIdle=true}};SlideShowHandler.prototype.dispose=function(){
this.aTimerEventQueue.clear();this.aActivityQueue.clear();this.aNextEffectEventArray=null;
this.aEventMultiplexer=null;this.automaticAdvanceTimeout=null};
SlideShowHandler.prototype.getContext=function(){return this._context};Object.defineProperty(
SlideShowHandler.prototype,"slideRenderer",{get:function(){return this.presenter._slideRenderer},
enumerable:false,configurable:true});Object.defineProperty(SlideShowHandler.prototype,
"slideCompositor",{get:function(){return this.presenter._slideCompositor},enumerable:false,
configurable:true});SlideShowHandler.prototype.getSlideInfo=function(nSlideIndex){
return this.theMetaPres.getSlideInfoByIndex(nSlideIndex)};
SlideShowHandler.prototype.getAnimatedLayerInfo=function(slideHash,targetElement){
return this.slideCompositor.getAnimatedLayerInfo(slideHash,targetElement)};
SlideShowHandler.prototype.isMipMapsEnable=function(transitionFilterInfo){
return transitionFilterInfo.transitionType===TransitionType.MISCSHAPEWIPE&&this.transitionsWithMipMapEnabled.has(
transitionFilterInfo.transitionSubtype)};SlideShowHandler.prototype.getTexture=function(nSlideIndex,
transitionFilterInfo){var slideImage=this.slideCompositor.getSlide(nSlideIndex);if(!slideImage){
app.console.error("SlideShowHandler: cannot get texture");return null}var isMipMapEnable=false;if(
transitionFilterInfo&&transitionFilterInfo.transitionType&&transitionFilterInfo.transitionSubtype){
isMipMapEnable=this.isMipMapsEnable(transitionFilterInfo)}return this.slideRenderer.createTexture(
slideImage,isMipMapEnable)};SlideShowHandler.prototype.presentSlide=function(nSlideIndex){
var slideInfo=this.getSlideInfo(nSlideIndex);if(slideInfo.a11y){setTimeout(this.addA11yString.bind(
this,slideInfo.a11y),500)}var slideTexture=this.enteringSlideTexture;if(!slideTexture
)slideTexture=this.getTexture(nSlideIndex);this.slideRenderer.renderSlide(slideTexture,
this.getSlideInfo(nSlideIndex));this.presenter.stopLoader()};
SlideShowHandler.prototype.createTransitionParameters=function(nNewSlide,nOldSlide){
var leavingSlideTexture=null;var transitionFilterInfo=TransitionFilterInfo.fromSlideInfo(
this.getSlideInfo(nNewSlide));if(this.isStarting){
leavingSlideTexture=this.slideRenderer.createEmptyTexture()}else{
leavingSlideTexture=nOldSlide!==undefined&&this.slideRenderer.lastRenderedSlideIndex===nOldSlide?this.slideRenderer.getSlideTexture(
):this.getTexture(nOldSlide,transitionFilterInfo)}var enteringSlideTexture=this.getTexture(nNewSlide
,transitionFilterInfo);var transitionParameters=new TransitionParameters;
transitionParameters.context=this.slideRenderer._context;
transitionParameters.current=leavingSlideTexture;transitionParameters.next=enteringSlideTexture;
transitionParameters.transitionFilterInfo=transitionFilterInfo;return transitionParameters};
SlideShowHandler.prototype.notifyFirstAutoEffectStarted=function(){app.console.debug(
"SlideShowHandler.notifyFirstAutoEffectStarted");this.bIsFirstAutoEffectRunning=true};
SlideShowHandler.prototype.notifyFirstAutoEffectEnded=function(){app.console.debug(
"SlideShowHandler.notifyFirstAutoEffectEnded");this.bIsFirstAutoEffectRunning=false};
SlideShowHandler.prototype.isFirstAutoEffectRunning=function(){return this.bIsFirstAutoEffectRunning
};SlideShowHandler.prototype.skipFirstAutoEffect=function(){app.console.debug(
"SlideShowHandler.skipFirstAutoEffect");this.bIsSkipping=true;
this.aEventMultiplexer.notifySkipEffectEvent();this.update();this.bIsSkipping=false};
SlideShowHandler.prototype.rewindFirstAutoEffect=function(){this.bIsRewinding=true;
this.aEventMultiplexer.notifyRewindCurrentEffectEvent();this.update();this.bIsRewinding=false};
SlideShowHandler.MAXIMUM_FRAME_COUNT=120;
SlideShowHandler.MINIMUM_TIMEOUT=1/SlideShowHandler.MAXIMUM_FRAME_COUNT;
SlideShowHandler.MAXIMUM_TIMEOUT=4;SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS=10;
SlideShowHandler.PREFERRED_FRAMES_PER_SECONDS=60;
SlideShowHandler.PREFERRED_FRAME_RATE=1/SlideShowHandler.PREFERRED_FRAMES_PER_SECONDS;
return SlideShowHandler}();var SlideShowNavigator=function(){function SlideShowNavigator(
slideShowHandler){this.theMetaPres=null;this.lastClickTime=0;this.RAPID_CLICK_THRESHOLD=500;
this.currentLeaderSlide=-1;this.currentLeaderEffect=-1;this.slideShowHandler=slideShowHandler;
this.currentSlide=undefined;this.prevSlide=undefined;this.isRewindingToPrevSlide=false;
this.initKeyMap();this.addHandlers()}SlideShowNavigator.prototype.initKeyMap=function(){var _a;
this.keyHandlerMap={ArrowLeft:this.rewindEffect.bind(this),ArrowRight:this.dispatchEffect.bind(this
),ArrowUp:this.rewindEffect.bind(this),ArrowDown:this.skipEffect.bind(this),
PageUp:this.rewindAllEffects.bind(this),PageDown:this.skipAllEffects.bind(this),
Home:this.goToFirstSlide.bind(this),End:this.goToLastSlide.bind(this),
Space:this.dispatchEffect.bind(this),Backspace:this.rewindEffect.bind(this),Escape:this.quit.bind(
this)};this.swipeHandlerMap=(_a={},_a[Hammer.DIRECTION_RIGHT]=this.rewindEffect.bind(this),_a[
Hammer.DIRECTION_LEFT]=this.dispatchEffect.bind(this),_a[Hammer.DIRECTION_UP]=this.quit.bind(this),
_a[Hammer.DIRECTION_DOWN]=this.quit.bind(this),_a)};
SlideShowNavigator.prototype.addHandlers=function(){this._canvasClickHandler={
handleClick:this.clickHandler.bind(this)}};SlideShowNavigator.prototype.removeHandlers=function(){
this._canvasClickHandler.handleClick=null};
SlideShowNavigator.prototype.setMetaPresentation=function(metaPres){this.theMetaPres=metaPres};
Object.defineProperty(SlideShowNavigator.prototype,"currentSlideIndex",{get:function(){
return this.currentSlide},enumerable:false,configurable:true});Object.defineProperty(
SlideShowNavigator.prototype,"canvasClickHandler",{get:function(){return this._canvasClickHandler},
enumerable:false,configurable:true});SlideShowNavigator.prototype.dispatchEffect=function(){
this.presenter.sendSlideShowFollowMessage("dispatcheffect");var currentTime=Date.now();
var timeDiff=currentTime-this.lastClickTime;NAVDBG.print(
"SlideShowNavigator.dispatchEffect: current index: "+this.currentSlide+", time diff: "+timeDiff+"ms"
);this.lastClickTime=currentTime;if(timeDiff<this.RAPID_CLICK_THRESHOLD&&timeDiff>0){
var bRet_1=this.slideShowHandler.skipPlayingOrNextEffect();if(!bRet_1){this.switchSlide(1,true)}
return}var bRet=this.slideShowHandler.nextEffect();if(!bRet){this.switchSlide(1,false)}};
SlideShowNavigator.prototype.skipEffect=function(){NAVDBG.print(
"SlideShowNavigator.skipEffect: current index: "+this.currentSlide);
var bRet=this.slideShowHandler.skipPlayingOrNextEffect();if(!bRet){this.switchSlide(1,true)}};
SlideShowNavigator.prototype.skipAllEffects=function(){NAVDBG.print(
"SlideShowNavigator.skipAllEffects: current index: "+this.currentSlide);
var bRet=this.slideShowHandler.skipAllEffects();if(!bRet){this.switchSlide(1,true)}};
SlideShowNavigator.prototype.rewindEffect=function(){this.presenter.sendSlideShowFollowMessage(
"rewindeffect");NAVDBG.print("SlideShowNavigator.rewindEffect: current index: "+this.currentSlide);
if(this.backToLastSlide())return;this.slideShowHandler.rewindEffect()};
SlideShowNavigator.prototype.rewindAllEffects=function(){NAVDBG.print(
"SlideShowNavigator.rewindAllEffects: current index: "+this.currentSlide);if(this.backToLastSlide()
)return;this.slideShowHandler.rewindAllEffects()};
SlideShowNavigator.prototype.goToFirstSlide=function(){NAVDBG.print(
"SlideShowNavigator.goToFirstSlide: current index: "+this.currentSlide);this.startPresentation(0,
false)};SlideShowNavigator.prototype.goToLastSlide=function(){NAVDBG.print(
"SlideShowNavigator.goToLastSlide: current index: "+this.currentSlide);this.displaySlide(
this.theMetaPres.numberOfSlides-1,true)};SlideShowNavigator.prototype.goToSlideAtBookmark=function(
bookmark){NAVDBG.print(
"SlideShowNavigator.goToSlideAtBookmark: "+bookmark+" current index: "+this.currentSlide);for(
var i=0;i<this.theMetaPres.numberOfSlides;i++){var slideInfo=this.theMetaPres.getSlideInfo(
this.theMetaPres.getSlideHash(i));if(slideInfo.name==bookmark){this.displaySlide(i,true);break}}};
SlideShowNavigator.prototype.backToLastSlide=function(){if(
this.currentSlide>=this.theMetaPres.numberOfSlides){this.goToLastSlide();return true}return false};
SlideShowNavigator.prototype.quit=function(){NAVDBG.print(
"SlideShowNavigator.quit: current index: "+this.currentSlide);this.slideShowHandler.exitSlideShow();
setTimeout(function(){this.endPresentation(true);this.currentSlide=undefined;
this.prevSlide=undefined;this.removeHandlers()}.bind(this),500)};
SlideShowNavigator.prototype.switchSlide=function(nOffset,bSkipTransition){NAVDBG.print(
"SlideShowNavigator.switchSlide: nOffset: "+nOffset);this.displaySlide(this.currentSlide+nOffset,
bSkipTransition)};SlideShowNavigator.prototype.rewindToPreviousSlide=function(){if(
this.currentSlide===0)this.goToFirstSlide();var prevSlide=0;if(
this.currentSlide!==undefined&&this.currentSlide>0){prevSlide=this.currentSlide-1}NAVDBG.print(
"SlideShowNavigator.rewindToPreviousSlide: slide to display: "+prevSlide);
this.isRewindingToPrevSlide=true;this.displaySlide(prevSlide,true);this.isRewindingToPrevSlide=false
this.presenter.sendSlideShowFollowMessage("skipalleffect")};
SlideShowNavigator.prototype.setLeaderSlide=function(info){this.currentLeaderSlide=info.currentSlide
};SlideShowNavigator.prototype.setLeaderEffect=function(info){
this.currentLeaderEffect=info.currentEffect};
SlideShowNavigator.prototype.followLeaderSlide=function(){this.presenter.setFollowing(true);if(
this.currentLeaderSlide===this.currentSlide)this.slideShowHandler.rewindAllEffects(
);else this.displaySlide(this.currentLeaderSlide,true);for(var i=0;i<=this.currentLeaderEffect;i++
)if(!this.slideShowHandler.skipNextEffect())break};
SlideShowNavigator.prototype.displaySlide=function(nNewSlide,bSkipTransition){var _this=this;
this.presenter.sendSlideShowFollowMessage("displayslide "+JSON.stringify({currentSlide:nNewSlide}));
NAVDBG.print(
"SlideShowNavigator.displaySlide: current index: "+this.currentSlide+", nNewSlide: "+nNewSlide+", bSkipTransition: "+bSkipTransition
);if(this.presenter&&!this.presenter._checkAlreadyPresenting()){NAVDBG.print(
"SlideShowNavigator.displaySlide: no more presenting");this.quit();return}if(
nNewSlide===undefined||nNewSlide<0){NAVDBG.print(
"SlideShowNavigator.displaySlide: unexpected nNewSlide");return}if(
nNewSlide>=this.theMetaPres.numberOfSlides){this.currentSlide=nNewSlide;
var force=nNewSlide>this.theMetaPres.numberOfSlides;if(force)this.quit();else this.endPresentation(
false);return}var slideAvailable=true;var aNewMetaSlide=this.theMetaPres.getMetaSlideByIndex(
nNewSlide);if(!aNewMetaSlide){window.app.console.log(
"SlideShowNavigator.displaySlide: no meta slide for index: "+nNewSlide);slideAvailable=false
}else if(aNewMetaSlide.hidden){NAVDBG.print(
"SlideShowNavigator.displaySlide: hidden slide: "+nNewSlide);slideAvailable=false}if(!slideAvailable
){var offset=1;if(this.currentSlide!==undefined)offset=Math.sign(nNewSlide-this.currentSlide);if(
offset===0){NAVDBG.print("SlideShowNavigator.displaySlide: offset === 0");return}this.displaySlide(
nNewSlide+offset,bSkipTransition);return}this.slideCompositor.fetchAndRun(nNewSlide,function(){
assert(_this instanceof SlideShowNavigator,
"SlideShowNavigator.displaySlide: slideCompositor.fetchAndRun: "+"callback: this is not a SlideShowNavigator instance"
);_this.prevSlide=_this.currentSlide;if(_this.prevSlide>=_this.theMetaPres.numberOfSlides
)_this.prevSlide=undefined;_this.currentSlide=nNewSlide;if(_this.currentSlide===_this.prevSlide){
NAVDBG.print(
"SlideShowNavigator.displaySlide: slideCompositor.fetchAndRun: this.currentSlide === this.prevSlide"
);return}_this.slideShowHandler.displaySlide(_this.currentSlide,_this.prevSlide,bSkipTransition);if(
_this.isRewindingToPrevSlide){_this.slideShowHandler.skipAllEffects();
_this.isRewindingToPrevSlide=false}})};SlideShowNavigator.prototype.startPresentation=function(
nStartSlide,bSkipTransition){NAVDBG.print(
"SlideShowNavigator.startPresentation: current index: "+this.currentSlide+", nStartSlide: "+nStartSlide
);this.slideShowHandler.isStarting=true;this.isRewindingToPrevSlide=false;
this.currentSlide=undefined;this.prevSlide=undefined;this.displaySlide(nStartSlide,bSkipTransition)}
SlideShowNavigator.prototype.endPresentation=function(force){if(force===void 0){force=false}
this.presenter.endPresentation(force)};SlideShowNavigator.prototype.onClick=function(aEvent){
aEvent.preventDefault();aEvent.stopPropagation();if(!this.isEnabled)return;
var metaSlide=this.theMetaPres.getMetaSlideByIndex(this.currentSlide);if(!metaSlide
)window.app.console.log(
"SlideShowNavigator.onClick: no meta slide available for index: "+this.currentSlide);if(
metaSlide&&metaSlide.animationsHandler){
var aEventMultiplexer=metaSlide.animationsHandler.eventMultiplexer;if(aEventMultiplexer){if(
aEventMultiplexer.hasRegisteredMouseClickHandlers()){aEventMultiplexer.notifyMouseClick(aEvent);
return}}}this.clickHandler(aEvent)};SlideShowNavigator.prototype.clickHandler=function(aEvent){if(
this.presenter.isFollower())this.presenter.setFollowing(false);if(aEvent.button===0){
var slideInfo=this.theMetaPres.getSlideInfoByIndex(this.currentSlide);
var slideHasInteractions=slideInfo&&slideInfo.interactions&&slideInfo.interactions.length>0;
var slideHasVideos=slideInfo&&slideInfo.videos&&slideInfo.videos.length>0;if(
!slideHasInteractions&&!slideHasVideos){this.dispatchEffect();return}
var canvas=this.presenter.getCanvas();var width=canvas.clientWidth;var height=canvas.clientHeight;
var x_1=aEvent.offsetX/width*this.theMetaPres.slideWidth;
var y_1=aEvent.offsetY/height*this.theMetaPres.slideHeight;var shape=slideInfo.interactions.find(
function(shape){return hitTest(shape.bounds,x_1,y_1)});var videoInfo=slideInfo.videos.find(function(
videoInfo){return hitTest(videoInfo,x_1,y_1)});if(shape){this._onExecuteInteraction(
shape.clickAction)}else if(videoInfo){this.presenter.sendSlideShowFollowMessage(
"followvideo "+JSON.stringify({currentSlide:this.currentSlide,videoInfoId:videoInfo.id}));
var video=this.presenter.getVideoRenderer(slideInfo.hash,videoInfo);video.handleClick()}else{
this.dispatchEffect()}}else if(aEvent.button===2){this.switchSlide(-1,false)}};
SlideShowNavigator.prototype.followVideo=function(info){
var slideInfo=this.theMetaPres.getSlideInfoByIndex(info.currentSlide);
var videoInfo=slideInfo.videos.find(function(videoInfo){return info.videoInfoId===videoInfo.id});
var video=this.presenter.getVideoRenderer(slideInfo.hash,videoInfo);video.handleClick()};
SlideShowNavigator.prototype.onMouseMove=function(aEvent){if(!this.isEnabled)return;
var metaSlide=this.theMetaPres.getMetaSlideByIndex(this.currentSlide);if(!metaSlide
)window.app.console.log(
"SlideShowNavigator.onMouseMove: no meta slide available for index: "+this.currentSlide);if(
metaSlide&&metaSlide.animationsHandler){
var aEventMultiplexer=metaSlide.animationsHandler.eventMultiplexer;if(aEventMultiplexer){if(
aEventMultiplexer.hasRegisteredMouseClickHandlers()){var canvas=this.presenter.getCanvas();
var width=canvas.clientWidth;var height=canvas.clientHeight;
var x=aEvent.offsetX/width*this.theMetaPres.slideWidth;
var y=aEvent.offsetY/height*this.theMetaPres.slideHeight;aEventMultiplexer.notifyMouseMove({x:x,y:y}
);return}}}};SlideShowNavigator.prototype._onExecuteInteraction=function(action){if(action){switch(
action.action){case"prevpage":this.switchSlide(-1,true);break;case"nextpage":this.switchSlide(1,true
);break;case"firstpage":this.goToFirstSlide();break;case"lastpage":this.goToLastSlide();break;
case"bookmark":this.goToSlideAtBookmark(action.bookmark);break;case"stoppresentation":this.quit();
break}}else{this.dispatchEffect()}};SlideShowNavigator.prototype.onKeyDown=function(aEvent){if(
!this.isEnabled&&aEvent.code!=="Escape")return;var handler=this.keyHandlerMap[aEvent.code];if(
handler){aEvent.preventDefault();aEvent.stopPropagation();handler()}};
SlideShowNavigator.prototype.onSwipe=function(event){event.preventDefault();if(
!this.isEnabled&&event.direction!==Hammer.DIRECTION_DOWN&&event.direction!==Hammer.DIRECTION_UP
)return;var handler=this.swipeHandlerMap[event.direction];if(handler)handler()};
SlideShowNavigator.prototype.setPresenter=function(presenter){this.presenter=presenter};
Object.defineProperty(SlideShowNavigator.prototype,"slideCompositor",{get:function(){
return this.presenter._slideCompositor},enumerable:false,configurable:true});
SlideShowNavigator.prototype.enable=function(){this.isEnabled=true};
SlideShowNavigator.prototype.disable=function(){this.isEnabled=false};return SlideShowNavigator}();
var SlideTransition=function(){function SlideTransition(slideInfo){this.slideInfo=slideInfo;
this.bIsValid=this.getType()!==undefined&&this.getType()!==TransitionType.INVALID;if(
this.slideInfo.transitionSubtype===undefined)this.slideInfo.transitionSubtype="Default";
this.aDuration=new Duration(this.slideInfo.transitionDuration+"ms");if(!this.aDuration.isSet()){
this.aDuration=new Duration(null)}this.nMinFrameCount=this.getDuration().isValue()?this.getDuration(
).getValue()*SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS:SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS
if(this.nMinFrameCount<1)this.nMinFrameCount=1;else if(
this.nMinFrameCount>SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS
)this.nMinFrameCount=SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS}
SlideTransition.prototype.isValid=function(){return this.bIsValid};
SlideTransition.prototype.createSlideTransition=function(transitionParameters){if(!this.isValid()
)return null;return createTransition(transitionParameters,true)};
SlideTransition.prototype.getType=function(){return stringToTransitionTypeMap[
this.slideInfo.transitionType]};SlideTransition.prototype.getSubType=function(){
return stringToTransitionSubTypeMap[this.slideInfo.transitionSubtype]};
SlideTransition.prototype.getFadeColor=function(){
return this.slideInfo.transitionFadeColor||"#000000"};
SlideTransition.prototype.isDirectionForward=function(){return this.slideInfo.transitionDirection};
SlideTransition.prototype.getDuration=function(){return this.aDuration};
SlideTransition.prototype.getMinFrameCount=function(){return this.nMinFrameCount};
return SlideTransition}();var SourceEventElement=function(){function SourceEventElement(sId,aCanvas,
bounds,priority,aSlideShow,aEventMultiplexer){this.aSlideShow=null;this.bClickHandled=false;
this.bIsPointerOver=false;this.sId=sId;this._canvas=aCanvas;this.bounds=bounds;
this.aSlideShow=aSlideShow;this.aEventMultiplexer=aEventMultiplexer;
this.aEventMultiplexer.registerMouseClickHandler(this,1e3+priority)}
SourceEventElement.prototype.getId=function(){return this.sId};
SourceEventElement.prototype.onMouseMove=function(cursorX,cursorY){var bIsOver=this.isOver(cursorX,
cursorY);if(bIsOver!==this.bIsPointerOver){if(bIsOver)this.onMouseEnter();else this.onMouseLeave()}
return bIsOver};SourceEventElement.prototype.isOver=function(x,y){var bounds=this.bounds;
return x>=bounds.x&&x<=bounds.x+bounds.width&&y>=bounds.y&&y<=bounds.y+bounds.height};
SourceEventElement.prototype.onMouseEnter=function(){this.bIsPointerOver=true;this.setPointerCursor(
)};SourceEventElement.prototype.onMouseLeave=function(){this.bIsPointerOver=false;
this.setDefaultCursor()};SourceEventElement.prototype.charge=function(){this.bClickHandled=false;
this.setPointerCursor()};SourceEventElement.prototype.handleClick=function(){if(!this.bIsPointerOver
)return false;if(this.bClickHandled)return false;this.aEventMultiplexer.notifyEvent(
EventTrigger.OnClick,this.getId());this.aSlideShow.update();this.bClickHandled=true;
this.setDefaultCursor();return true};SourceEventElement.prototype.setPointerCursor=function(){if(
this.bClickHandled)return;this._canvas.style.cursor="pointer"};
SourceEventElement.prototype.setDefaultCursor=function(){this._canvas.style.cursor="default"};
return SourceEventElement}();var TimerEventQueue=function(){function TimerEventQueue(aTimer){
this.aTimer=aTimer;this.aEventSet=new PriorityQueue(EventEntry.compare)}
TimerEventQueue.prototype.addEvent=function(aEvent){this.DBG(
"TimerEventQueue.addEvent event("+aEvent.getId()+") appended.");if(!aEvent){window.app.console.log(
"TimerEventQueue.addEvent: null event");return false}var nTime=aEvent.getActivationTime(
this.aTimer.getElapsedTime());var aEventEntry=new EventEntry(aEvent,nTime);this.aEventSet.push(
aEventEntry);return true};TimerEventQueue.prototype.forceEmpty=function(){this.process_(true)};
TimerEventQueue.prototype.process=function(){this.process_(false)};
TimerEventQueue.prototype.process_=function(bFireAllEvents){
var nCurrentTime=this.aTimer.getElapsedTime();while(!this.isEmpty()&&(
bFireAllEvents||this.aEventSet.top().nActivationTime<=nCurrentTime)){
var aEventEntry=this.aEventSet.top();this.aEventSet.pop();var aEvent=aEventEntry.aEvent;if(
aEvent.isCharged())aEvent.fire()}};TimerEventQueue.prototype.isEmpty=function(){
return this.aEventSet.isEmpty()};TimerEventQueue.prototype.nextTimeout=function(){
var nTimeout=Number.MAX_VALUE;var nCurrentTime=this.aTimer.getElapsedTime();if(!this.isEmpty()
)nTimeout=this.aEventSet.top().nActivationTime-nCurrentTime;return nTimeout};
TimerEventQueue.prototype.clear=function(){this.DBG("TimerEventQueue.clear invoked");
this.aEventSet.clear()};TimerEventQueue.prototype.getTimer=function(){return this.aTimer};
TimerEventQueue.prototype.DBG=function(sMessage,nTime){aTimerEventQueueDebugPrinter.print(sMessage,
nTime)};return TimerEventQueue}();var EventEntry=function(){function EventEntry(aEvent,nTime){
this.aEvent=aEvent;this.nActivationTime=nTime}EventEntry.compare=function(aLhsEventEntry,
aRhsEventEntry){if(aLhsEventEntry.nActivationTime>aRhsEventEntry.nActivationTime){return-1}else if(
aLhsEventEntry.nActivationTime<aRhsEventEntry.nActivationTime){return 1}else{return 0}};
return EventEntry}();var TimingType;(function(TimingType){TimingType[TimingType["Unknown"]=0
]="Unknown";TimingType[TimingType["Offset"]=1]="Offset";TimingType[TimingType["WallClock"]=2
]="WallClock";TimingType[TimingType["Indefinite"]=3]="Indefinite";TimingType[TimingType["Event"]=4
]="Event";TimingType[TimingType["SyncBase"]=5]="SyncBase";TimingType[TimingType["Media"]=6]="Media"}
)(TimingType||(TimingType={}));var EventTrigger;(function(EventTrigger){EventTrigger[EventTrigger[
"Unknown"]=0]="Unknown";EventTrigger[EventTrigger["OnBegin"]=1]="OnBegin";EventTrigger[EventTrigger[
"OnEnd"]=2]="OnEnd";EventTrigger[EventTrigger["BeginEvent"]=3]="BeginEvent";EventTrigger[
EventTrigger["EndEvent"]=4]="EndEvent";EventTrigger[EventTrigger["OnClick"]=5]="OnClick";
EventTrigger[EventTrigger["OnDblClick"]=6]="OnDblClick";EventTrigger[EventTrigger["OnMouseEnter"]=7
]="OnMouseEnter";EventTrigger[EventTrigger["OnMouseLeave"]=8]="OnMouseLeave";EventTrigger[
EventTrigger["OnNext"]=9]="OnNext";EventTrigger[EventTrigger["OnPrev"]=10]="OnPrev";EventTrigger[
EventTrigger["Repeat"]=11]="Repeat"})(EventTrigger||(EventTrigger={}));function getEventTriggerType(
sEventTrigger){if(sEventTrigger=="BeginEvent")return EventTrigger.BeginEvent;else if(
sEventTrigger=="EndEvent")return EventTrigger.EndEvent;else if(sEventTrigger=="OnNext"
)return EventTrigger.OnNext;else if(sEventTrigger=="OnPrev")return EventTrigger.OnPrev;else if(
sEventTrigger=="OnClick")return EventTrigger.OnClick;else return EventTrigger.Unknown}
var Timing=function(){function Timing(aAnimationNode,sTimingAttribute){
this.eTimingType=TimingType.Unknown;this.nOffset=0;this.sEventBaseElementId="";
this.eEventType=EventTrigger.Unknown;this.aAnimationNode=aAnimationNode;
this.sTimingDescription=removeWhiteSpaces(sTimingAttribute);this.nOffset=0;
this.sEventBaseElementId=""}Timing.prototype.getAnimationNode=function(){return this.aAnimationNode}
Timing.prototype.getType=function(){return this.eTimingType};Timing.prototype.getOffset=function(){
return this.nOffset};Timing.prototype.getEventBaseElementId=function(){
return this.sEventBaseElementId};Timing.prototype.getEventType=function(){return this.eEventType};
Timing.prototype.parse=function(){if(!this.sTimingDescription){this.eTimingType=TimingType.Offset;
return}if(this.sTimingDescription=="indefinite")this.eTimingType=TimingType.Indefinite;else{
var nFirstCharCode=this.sTimingDescription.charCodeAt(0);var bPositiveOffset=!(
nFirstCharCode==Timing.CHARCODE_MINUS);if(
nFirstCharCode==Timing.CHARCODE_PLUS||nFirstCharCode==Timing.CHARCODE_MINUS||nFirstCharCode>=Timing.CHARCODE_0&&nFirstCharCode<=Timing.CHARCODE_9
){
var sClockValue=nFirstCharCode==Timing.CHARCODE_PLUS||nFirstCharCode==Timing.CHARCODE_MINUS?this.sTimingDescription.substring(
1):this.sTimingDescription;var TimeInSec=Timing.parseClockValue(sClockValue);if(TimeInSec!=undefined
){this.eTimingType=TimingType.Offset;this.nOffset=bPositiveOffset?TimeInSec:-TimeInSec}}else{
var aTimingSplit=[];bPositiveOffset=true;if(this.sTimingDescription.indexOf("+")!=-1){
aTimingSplit=this.sTimingDescription.split("+")}else if(this.sTimingDescription.indexOf("-")!=-1){
aTimingSplit=this.sTimingDescription.split("-");bPositiveOffset=false}else{aTimingSplit[0
]=this.sTimingDescription;aTimingSplit[1]=""}if(aTimingSplit[0].indexOf(".")!=-1){
var aEventSplit=aTimingSplit[0].split(".");this.sEventBaseElementId=aEventSplit[0];
this.eEventType=getEventTriggerType(aEventSplit[1])}else{this.eEventType=getEventTriggerType(
aTimingSplit[0])}if(this.eEventType==EventTrigger.Unknown)return;if(
this.eEventType==EventTrigger.BeginEvent||this.eEventType==EventTrigger.EndEvent){
this.eTimingType=TimingType.SyncBase}else{this.eTimingType=TimingType.Event}if(aTimingSplit[1]){
var sClockValue=aTimingSplit[1];var TimeInSec=Timing.parseClockValue(sClockValue);if(
TimeInSec!=undefined){this.nOffset=bPositiveOffset?TimeInSec:-TimeInSec}else{
this.eTimingType=TimingType.Unknown}}}}};Timing.parseClockValue=function(sClockValue){if(
!sClockValue)return 0;var nTimeInSec=undefined;
var reFullClockValue=/^([0-9]+):([0-5][0-9]):([0-5][0-9])(.[0-9]+)?$/;
var rePartialClockValue=/^([0-5][0-9]):([0-5][0-9])(.[0-9]+)?$/;
var reTimeCountValue=/^([0-9]+)(.[0-9]+)?(h|min|s|ms)?$/;if(reFullClockValue.test(sClockValue)){
var aClockTimeParts=reFullClockValue.exec(sClockValue);var nHours=parseInt(aClockTimeParts[1]);
var nMinutes=parseInt(aClockTimeParts[2]);var nSeconds=parseInt(aClockTimeParts[3]);if(
aClockTimeParts[4])nSeconds+=parseFloat(aClockTimeParts[4]);nTimeInSec=(nHours*60+nMinutes
)*60+nSeconds}else if(rePartialClockValue.test(sClockValue)){
var aClockTimeParts=rePartialClockValue.exec(sClockValue);var nMinutes=parseInt(aClockTimeParts[1]);
var nSeconds=parseInt(aClockTimeParts[2]);if(aClockTimeParts[3])nSeconds+=parseFloat(
aClockTimeParts[3]);nTimeInSec=nMinutes*60+nSeconds}else if(reTimeCountValue.test(sClockValue)){
var aClockTimeParts=reTimeCountValue.exec(sClockValue);var nTimeCount=parseInt(aClockTimeParts[1]);
if(aClockTimeParts[2])nTimeCount+=parseFloat(aClockTimeParts[2]);if(aClockTimeParts[3]){if(
aClockTimeParts[3]=="h"){nTimeInSec=nTimeCount*3600}else if(aClockTimeParts[3]=="min"){
nTimeInSec=nTimeCount*60}else if(aClockTimeParts[3]=="s"){nTimeInSec=nTimeCount}else if(
aClockTimeParts[3]=="ms"){nTimeInSec=nTimeCount/1e3}}else{nTimeInSec=nTimeCount}}if(nTimeInSec
)nTimeInSec=parseFloat(nTimeInSec.toFixed(3));return nTimeInSec};Timing.prototype.info=function(
bVerbose){if(bVerbose===void 0){bVerbose=false}var sInfo="";if(bVerbose){
sInfo="description: "+this.sTimingDescription+", ";sInfo+=", type: "+TimingType[this.getType()];
sInfo+=", offset: "+this.getOffset();sInfo+=", event base element id: "+this.getEventBaseElementId()
sInfo+=", timing event type: "+EventTrigger[this.getEventType()]}else{switch(this.getType()){
case TimingType.Indefinite:sInfo+="indefinite";break;case TimingType.Offset:sInfo+=this.getOffset();
break;case TimingType.Event:case TimingType.SyncBase:if(this.getEventBaseElementId()
)sInfo+=this.getEventBaseElementId()+".";sInfo+=EventTrigger[this.getEventType()];if(this.getOffset(
)){if(this.getOffset()>0)sInfo+="+";sInfo+=this.getOffset()}break}}return sInfo};
Timing.CHARCODE_PLUS="+".charCodeAt(0);Timing.CHARCODE_MINUS="-".charCodeAt(0);
Timing.CHARCODE_0="0".charCodeAt(0);Timing.CHARCODE_9="9".charCodeAt(0);return Timing}();
function assert(object,message){if(!object){window.app.console.trace();throw new Error(message)}}
function getCurrentSystemTime(){return performance.now()}function removeWhiteSpaces(str){if(!str
)return"";var re=/ */;var aSplitString=str.split(re);return aSplitString.join("")}function clampN(
nValue,nMinimum,nMaximum){return Math.min(Math.max(nValue,nMinimum),nMaximum)}function hasValue(x){
return x!==undefined&&x!==null}function booleanParser(sValue){sValue=sValue.toLowerCase();
return sValue==="true"}function colorParser(sValue){function hsl(nHue,nSaturation,nLuminance){
return new HSLColor(nHue,nSaturation/100,nLuminance/100)}function rgb(nRed,nGreen,nBlue){
return new RGBColor(nRed/255,nGreen/255,nBlue/255)}function prgb(nRed,nGreen,nBlue){
return new RGBColor(nRed/100,nGreen/100,nBlue/100)}var sCommaPattern=" *[,] *";
var sNumberPattern="[+-]?[0-9]+[.]?[0-9]*";var sHexDigitPattern="[0-9A-Fa-f]";
var sHexColorPattern="#("+sHexDigitPattern+"{2})("+sHexDigitPattern+"{2})("+sHexDigitPattern+"{2})";
var sRGBIntegerPattern="rgb[(] *"+sNumberPattern+sCommaPattern+sNumberPattern+sCommaPattern+sNumberPattern+" *[)]"
var sRGBPercentPattern="rgb[(] *"+sNumberPattern+"%"+sCommaPattern+sNumberPattern+"%"+sCommaPattern+sNumberPattern+"%"+" *[)]"
var sHSLPercentPattern="hsl[(] *"+sNumberPattern+sCommaPattern+sNumberPattern+"%"+sCommaPattern+sNumberPattern+"%"+" *[)]"
var reHexColor=new RegExp(sHexColorPattern);var reRGBInteger=new RegExp(sRGBIntegerPattern);
var reRGBPercent=new RegExp(sRGBPercentPattern);var reHSLPercent=new RegExp(sHSLPercentPattern);if(
reHexColor.test(sValue)){var aRGBTriple=reHexColor.exec(sValue);var nRed=parseInt(aRGBTriple[1],16
)/255;var nGreen=parseInt(aRGBTriple[2],16)/255;var nBlue=parseInt(aRGBTriple[3],16)/255;
return new RGBColor(nRed,nGreen,nBlue)}else if(reHSLPercent.test(sValue)){sValue=sValue.replace(/%/g
,"");return eval(sValue)}else if(reRGBInteger.test(sValue)){return eval(sValue)}else if(
reRGBPercent.test(sValue)){sValue="p"+sValue.replace(/%/g,"");return eval(sValue)}else{return null}}
var RGBColor=function(){function RGBColor(nRed,nGreen,nBlue){this.eColorSpace=ColorSpace.rgb;
this.nRed=nRed;this.nGreen=nGreen;this.nBlue=nBlue}RGBColor.prototype.clone=function(){
return new RGBColor(this.nRed,this.nGreen,this.nBlue)};RGBColor.prototype.equal=function(aRGBColor){
return this.nRed==aRGBColor.nRed&&this.nGreen==aRGBColor.nGreen&&this.nBlue==aRGBColor.nBlue};
RGBColor.prototype.add=function(aRGBColor){this.nRed+=aRGBColor.nRed;this.nGreen+=aRGBColor.nGreen;
this.nBlue+=aRGBColor.nBlue;return this};RGBColor.prototype.scale=function(aT){this.nRed*=aT;
this.nGreen*=aT;this.nBlue*=aT;return this};RGBColor.clamp=function(aRGBColor){
var aClampedRGBColor=new RGBColor(0,0,0);aClampedRGBColor.nRed=clampN(aRGBColor.nRed,0,1);
aClampedRGBColor.nGreen=clampN(aRGBColor.nGreen,0,1);aClampedRGBColor.nBlue=clampN(aRGBColor.nBlue,0
,1);return aClampedRGBColor};RGBColor.prototype.convertToHSL=function(){var nRed=clampN(this.nRed,0,
1);var nGreen=clampN(this.nGreen,0,1);var nBlue=clampN(this.nBlue,0,1);var nMax=Math.max(nRed,nGreen
,nBlue);var nMin=Math.min(nRed,nGreen,nBlue);var nDelta=nMax-nMin;var nLuminance=(nMax+nMin)/2;
var nSaturation=0;var nHue=0;if(nDelta!==0){nSaturation=nLuminance>.5?nDelta/(2-nMax-nMin):nDelta/(
nMax+nMin);if(nRed==nMax)nHue=(nGreen-nBlue)/nDelta;else if(nGreen==nMax)nHue=2+(nBlue-nRed
)/nDelta;else if(nBlue==nMax)nHue=4+(nRed-nGreen)/nDelta;nHue*=60;if(nHue<0)nHue+=360}
return new HSLColor(nHue,nSaturation,nLuminance)};RGBColor.prototype.toFloat32Array=function(){
var aRGBColor=RGBColor.clamp(this);return new Float32Array([aRGBColor.nRed,aRGBColor.nGreen,
aRGBColor.nBlue,1])};RGBColor.prototype.toString=function(bClamped){if(bClamped===void 0){
bClamped=false}var aRGBColor;if(bClamped){aRGBColor=RGBColor.clamp(this)}else{aRGBColor=this}
var nRed=Math.round(aRGBColor.nRed*255);var nGreen=Math.round(aRGBColor.nGreen*255);
var nBlue=Math.round(aRGBColor.nBlue*255);return"rgb("+nRed+","+nGreen+","+nBlue+")"};
RGBColor.interpolate=function(aStartRGB,aEndRGB,nT){var aResult=aStartRGB.clone();
var aTEndRGB=aEndRGB.clone();aResult.scale(1-nT);aTEndRGB.scale(nT);aResult.add(aTEndRGB);
return aResult};return RGBColor}();var HSLColor=function(){function HSLColor(nHue,nSaturation,
nLuminance){this.eColorSpace=ColorSpace.hsl;this.nHue=nHue;this.nSaturation=nSaturation;
this.nLuminance=nLuminance;this.normalizeHue()}HSLColor.prototype.clone=function(){
return new HSLColor(this.nHue,this.nSaturation,this.nLuminance)};HSLColor.prototype.equal=function(
aHSLColor){
return this.nHue==aHSLColor.nHue&&this.nSaturation==aHSLColor.nSaturation&&this.nLuminance==aHSLColor.nLuminance
};HSLColor.prototype.add=function(aHSLColor){this.nHue+=aHSLColor.nHue;
this.nSaturation+=aHSLColor.nSaturation;this.nLuminance+=aHSLColor.nLuminance;this.normalizeHue();
return this};HSLColor.prototype.scale=function(aT){this.nHue*=aT;this.nSaturation*=aT;
this.nLuminance*=aT;this.normalizeHue();return this};HSLColor.clamp=function(aHSLColor){
var aClampedHSLColor=new HSLColor(0,0,0);aClampedHSLColor.nHue=aHSLColor.nHue%360;if(
aClampedHSLColor.nHue<0)aClampedHSLColor.nHue+=360;aClampedHSLColor.nSaturation=clampN(
aHSLColor.nSaturation,0,1);aClampedHSLColor.nLuminance=clampN(aHSLColor.nLuminance,0,1);
return aClampedHSLColor};HSLColor.prototype.normalizeHue=function(){this.nHue=this.nHue%360;if(
this.nHue<0)this.nHue+=360};HSLColor.prototype.toString=function(){return"hsl("+this.nHue.toFixed(3
)+","+this.nSaturation.toFixed(3)+","+this.nLuminance.toFixed(3)+")"};
HSLColor.prototype.convertToRGB=function(){var nHue=this.nHue%360;if(nHue<0)nHue+=360;
var nSaturation=clampN(this.nSaturation,0,1);var nLuminance=clampN(this.nLuminance,0,1);if(
nSaturation===0){return new RGBColor(nLuminance,nLuminance,nLuminance)}
var nVal1=nLuminance<=.5?nLuminance*(1+nSaturation):nLuminance+nSaturation-nLuminance*nSaturation;
var nVal2=2*nLuminance-nVal1;var nRed=HSLColor.hsl2rgbHelper(nVal2,nVal1,nHue+120);
var nGreen=HSLColor.hsl2rgbHelper(nVal2,nVal1,nHue);var nBlue=HSLColor.hsl2rgbHelper(nVal2,nVal1,
nHue-120);return new RGBColor(nRed,nGreen,nBlue)};HSLColor.hsl2rgbHelper=function(nValue1,nValue2,
nHue){nHue=nHue%360;if(nHue<0)nHue+=360;if(nHue<60)return nValue1+(nValue2-nValue1)*nHue/60;else if(
nHue<180)return nValue2;else if(nHue<240)return nValue1+(nValue2-nValue1)*(240-nHue
)/60;else return nValue1};HSLColor.interpolate=function(aFrom,aTo,nT,bCCW){var nS=1-nT;var nHue=0;
if(aFrom.nHue<=aTo.nHue&&!bCCW){nHue=nS*(aFrom.nHue+360)+nT*aTo.nHue}else if(
aFrom.nHue>aTo.nHue&&bCCW){nHue=nS*aFrom.nHue+nT*(aTo.nHue+360)}else{nHue=nS*aFrom.nHue+nT*aTo.nHue}
var nSaturation=nS*aFrom.nSaturation+nT*aTo.nSaturation;
var nLuminance=nS*aFrom.nLuminance+nT*aTo.nLuminance;return new HSLColor(nHue,nSaturation,nLuminance
)};return HSLColor}();function makeScaler(nScale){if(typeof nScale!==typeof 0||!isFinite(nScale)){
window.app.console.log("makeScaler: not valid param passed: "+nScale);return null}return function(
nValue){return nScale*nValue}}function getRectCenter(rect){var cx=rect.x+rect.width/2;
var cy=rect.y+rect.height/2;return{x:cx,y:cy}}function convert(convFactor,rect){var x1=Math.floor(
rect.x*convFactor.x);var y1=Math.floor(rect.y*convFactor.y);var x2=Math.ceil((rect.x+rect.width
)*convFactor.x);var y2=Math.ceil((rect.y+rect.height)*convFactor.y);return new DOMRect(x1,y1,x2-x1+1
,y2-y1+1)}var PriorityQueue=function(){function PriorityQueue(aCompareFunc){this.aSequence=[];
this.aCompareFunc=aCompareFunc}PriorityQueue.prototype.clone=function(){var aCopy=new PriorityQueue(
this.aCompareFunc);var src=this.aSequence;var dest=[];for(var i=0,l=src.length;i<l;++i){if(i in src
){dest.push(src[i])}}aCopy.aSequence=dest;return aCopy};PriorityQueue.prototype.top=function(){
return this.aSequence[this.aSequence.length-1]};PriorityQueue.prototype.isEmpty=function(){
return this.aSequence.length===0};PriorityQueue.prototype.push=function(aValue){
this.aSequence.unshift(aValue);this.aSequence.sort(this.aCompareFunc)};
PriorityQueue.prototype.clear=function(){this.aSequence=[]};PriorityQueue.prototype.pop=function(){
return this.aSequence.pop()};return PriorityQueue}();var GlHelpers;(function(GlHelpers){
GlHelpers.nearestPointOnSegment="\n\t\tfloat nearestPointOnSegment(vec4 CF, vec4 CT, vec4 C) {\n\n\t\t\t// Compute the vector along the segment (CT - CF)\n\t\t\tvec4 segment = CT - CF;\n\n\t\t\t// Compute the vector from the endpoint CF to the point C\n\t\t\tvec4 toC = C - CF;\n\n\t\t\tfloat length2 = dot(segment, segment);\n\n\t\t\t// Project C onto the segment, finding the scalar 't'\n\t\t\tfloat t = dot(toC, segment) / length2;\n\n\t\t\t// Clamp 't' to [0, 1] range to ensure the nearest point lies on the segment\n\t\t\tt = clamp(t, 0.0, 1.0);\n\t\t\treturn t;\n\t\t}\n"
GlHelpers.computeColor="\n\t\tvec4 computeColor(vec4 color) {\n\t\t\tif (fromLineColor != toLineColor || fromFillColor != toFillColor) {\n\t\t\t\tvec4 colorSegment = fromFillColor - fromLineColor;\n\t\t\t\tfloat length2 = dot(colorSegment, colorSegment);\n\t\t\t\tif (length2 < 1e-6) {\n\t\t\t\t \treturn toFillColor;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfloat t = nearestPointOnSegment(fromLineColor, fromFillColor, color);\n\t\t\t\t\tvec4 fromColor = fromLineColor + t * colorSegment;\n\t\t\t\t\tvec4 toColor = toLineColor + t * (toFillColor - toLineColor);\n\t\t\t\t\treturn mix(color, toColor, float(distance(color, fromColor) < 0.01));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn color;\n\t\t}\n"
})(GlHelpers||(GlHelpers={}));var PriorityEntry=function(){function PriorityEntry(aValue,nPriority){
this.aValue=aValue;this.nPriority=nPriority}PriorityEntry.compare=function(aLhsEntry,aRhsEntry){if(
aLhsEntry.nPriority<aRhsEntry.nPriority){return-1}else if(aLhsEntry.nPriority>aRhsEntry.nPriority){
return 1}else{return 0}};return PriorityEntry}();var DebugPrinter=function(){function DebugPrinter(
){this.bEnabled=false}DebugPrinter.prototype.on=function(){this.bEnabled=true};
DebugPrinter.prototype.off=function(){this.bEnabled=false};
DebugPrinter.prototype.isEnabled=function(){return this.bEnabled};
DebugPrinter.prototype.print=function(sMessage,nTime){if(this.isEnabled()){
var sInfo="DBG: "+sMessage;if(nTime)sInfo+=" (at: "+String(nTime/1e3)+"s)";window.app.console.log(
sInfo)}};return DebugPrinter}();var aGenericDebugPrinter=new DebugPrinter;aGenericDebugPrinter.on();
var NAVDBG=new DebugPrinter;NAVDBG.on();var ANIMDBG=new DebugPrinter;ANIMDBG.on();
var aRegisterEventDebugPrinter=new DebugPrinter;aRegisterEventDebugPrinter.on();
var aTimerEventQueueDebugPrinter=new DebugPrinter;aTimerEventQueueDebugPrinter.on();
var aEventMultiplexerDebugPrinter=new DebugPrinter;aEventMultiplexerDebugPrinter.on();
var aNextEffectEventArrayDebugPrinter=new DebugPrinter;aNextEffectEventArrayDebugPrinter.on();
var aActivityQueueDebugPrinter=new DebugPrinter;aActivityQueueDebugPrinter.on();
var aAnimatedElementDebugPrinter=new DebugPrinter;aAnimatedElementDebugPrinter.on();
var ActivityParamSet=function(){function ActivityParamSet(){
this.nMinNumberOfFrames=SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS;this.bAutoReverse=false;
this.nRepeatCount=1;this.nAccelerationFraction=0;this.nDecelerationFraction=0;this.aDiscreteTimes=[]
}return ActivityParamSet}();var AnimationActivity=function(){function AnimationActivity(){
this.nId=AnimationActivity.getUniqueId()}AnimationActivity.getUniqueId=function(){
++AnimationActivity.CURR_UNIQUE_ID;return AnimationActivity.CURR_UNIQUE_ID};
AnimationActivity.prototype.getId=function(){return this.nId};AnimationActivity.CURR_UNIQUE_ID=0;
return AnimationActivity}();var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var ActivityBase=function(_super){__extends(ActivityBase,_super);function ActivityBase(
aCommonParamSet){var _this=_super.call(this)||this;_this.aTargetElement=null;
_this.aEndEvent=aCommonParamSet.aEndEvent;_this.aTimerEventQueue=aCommonParamSet.aTimerEventQueue;
_this.nRepeats=aCommonParamSet.nRepeatCount;
_this.nAccelerationFraction=aCommonParamSet.nAccelerationFraction;
_this.nDecelerationFraction=aCommonParamSet.nDecelerationFraction;
_this.bAutoReverse=aCommonParamSet.bAutoReverse;_this.bFirstPerformCall=true;_this.bIsActive=true;
return _this}ActivityBase.prototype.activate=function(aEndEvent){this.aEndEvent=aEndEvent;
this.bFirstPerformCall=true;this.bIsActive=true};ActivityBase.prototype.dispose=function(){
this.bIsActive=false;if(this.aEndEvent)this.aEndEvent.dispose();this.aEndEvent=null};
ActivityBase.prototype.perform=function(){if(!this.isActive())return false;assert(
!this.bFirstPerformCall,"ActivityBase.perform: assertion (!this.FirstPerformCall) failed");
return true};ActivityBase.prototype.calcTimeLag=function(){if(this.isActive(
)&&this.bFirstPerformCall){this.bFirstPerformCall=false;this.startAnimation()}return 0};
ActivityBase.prototype.isActive=function(){return this.bIsActive};
ActivityBase.prototype.isDisposed=function(){return!this.bIsActive&&!this.aEndEvent};
ActivityBase.prototype.dequeued=function(){if(!this.isActive())this.endAnimation()};
ActivityBase.prototype.setTargets=function(aTargetElement){assert(aTargetElement,
"ActivityBase.setTargets: target element is not valid");this.aTargetElement=aTargetElement};
ActivityBase.prototype.startAnimation=function(){
throw"ActivityBase.startAnimation: abstract method invoked"};
ActivityBase.prototype.endActivity=function(){this.bIsActive=false;if(this.aEndEvent
)this.aTimerEventQueue.addEvent(this.aEndEvent);this.aEndEvent=null};
ActivityBase.prototype.calcAcceleratedTime=function(nT){nT=clampN(nT,0,1);if((
this.nAccelerationFraction>0||this.nDecelerationFraction>0
)&&this.nAccelerationFraction+this.nDecelerationFraction<=1){
var nC=1-.5*this.nAccelerationFraction-.5*this.nDecelerationFraction;var nTPrime=0;if(
nT<this.nAccelerationFraction){nTPrime+=.5*nT*nT/this.nAccelerationFraction}else{
nTPrime+=.5*this.nAccelerationFraction;if(nT<=1-this.nDecelerationFraction){
nTPrime+=nT-this.nAccelerationFraction}else{
nTPrime+=1-this.nAccelerationFraction-this.nDecelerationFraction;
var nTRelative=nT-1+this.nDecelerationFraction;
nTPrime+=nTRelative-.5*nTRelative*nTRelative/this.nDecelerationFraction}}nT=nTPrime/nC}return nT};
ActivityBase.prototype.getEventQueue=function(){return this.aTimerEventQueue};
ActivityBase.prototype.getTargetElement=function(){return this.aTargetElement};
ActivityBase.prototype.isRepeatCountValid=function(){return!!this.nRepeats};
ActivityBase.prototype.getRepeatCount=function(){return this.nRepeats};
ActivityBase.prototype.isAutoReverse=function(){return this.bAutoReverse};
ActivityBase.prototype.end=function(){if(!this.isActive()||this.isDisposed())return;if(
this.bFirstPerformCall){this.bFirstPerformCall=false;this.startAnimation()}this.performEnd();
this.endAnimation();this.endActivity()};return ActivityBase}(AnimationActivity);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var SimpleContinuousActivityBase=function(_super){__extends(
SimpleContinuousActivityBase,_super);function SimpleContinuousActivityBase(aCommonParamSet){
var _this=_super.call(this,aCommonParamSet)||this;_this.aTimer=new ElapsedTime(
aCommonParamSet.aActivityQueue.getTimer());_this.nMinSimpleDuration=aCommonParamSet.nMinDuration;
_this.nMinNumberOfFrames=aCommonParamSet.nMinNumberOfFrames;_this.nCurrPerformCalls=0;return _this}
SimpleContinuousActivityBase.prototype.startAnimation=function(){this.aTimer.reset()};
SimpleContinuousActivityBase.prototype.calcTimeLag=function(){_super.prototype.calcTimeLag.call(this
);if(!this.isActive())return 0;var nCurrElapsedTime=this.aTimer.getElapsedTime();
var nFractionElapsedTime=nCurrElapsedTime/this.nMinSimpleDuration;
var nFractionRequiredCalls=this.nCurrPerformCalls/this.nMinNumberOfFrames;if(
nFractionElapsedTime<nFractionRequiredCalls){return 0}else{return(
nFractionElapsedTime-nFractionRequiredCalls)*this.nMinSimpleDuration}};
SimpleContinuousActivityBase.prototype.perform=function(){if(!_super.prototype.perform.call(this)
)return false;var nCurrElapsedTime=this.aTimer.getElapsedTime();
var nT=nCurrElapsedTime/this.nMinSimpleDuration;var bActivityEnding=false;if(
this.isRepeatCountValid()){var nRepeatCount=this.getRepeatCount();
var nEffectiveRepeat=this.isAutoReverse()?2*nRepeatCount:nRepeatCount;if(nEffectiveRepeat<=nT){
bActivityEnding=true;nT=nEffectiveRepeat}}var nRepeats;var nRelativeSimpleTime;if(
this.isAutoReverse()){nRepeats=Math.floor(nT);var nFractionalActiveDuration=nT-nRepeats;if(
nRepeats%2){nRelativeSimpleTime=1-nFractionalActiveDuration}else{
nRelativeSimpleTime=nFractionalActiveDuration}nRepeats/=2}else{nRepeats=Math.floor(nT);
nRelativeSimpleTime=nT-nRepeats;if(this.isRepeatCountValid()&&nRepeats>=this.getRepeatCount()){
nRelativeSimpleTime=1;nRepeats-=1}}this.simplePerform(nRelativeSimpleTime,nRepeats);if(
bActivityEnding)this.endActivity();++this.nCurrPerformCalls;return this.isActive()};
SimpleContinuousActivityBase.prototype.simplePerform=function(nSimpleTime,nRepeatCount){};
return SimpleContinuousActivityBase}(ActivityBase);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var ContinuousActivityBase=function(_super){__extends(ContinuousActivityBase,_super);
function ContinuousActivityBase(aCommonParamSet){return _super.call(this,aCommonParamSet)||this}
ContinuousActivityBase.prototype.simplePerform=function(nSimpleTime,nRepeatCount){
this.performContinuousHook(this.calcAcceleratedTime(nSimpleTime),nRepeatCount)};
return ContinuousActivityBase}(SimpleContinuousActivityBase);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var KeyStopLerp=function(){function KeyStopLerp(aValueList){
KeyStopLerp.validateInput(aValueList);this.aKeyStopList=[];this.nLastIndex=0;
this.nKeyStopDistance=aValueList[1]-aValueList[0];if(this.nKeyStopDistance<=0
)this.nKeyStopDistance=.001;for(var i=0;i<aValueList.length;++i)this.aKeyStopList.push(aValueList[i]
);this.nUpperBoundIndex=this.aKeyStopList.length-2}KeyStopLerp.validateInput=function(aValueList){
var nSize=aValueList.length;assert(nSize>1,
"KeyStopLerp.validateInput: key stop vector must have two entries or more");for(var i=1;i<nSize;++i
){if(aValueList[i-1]>aValueList[i])window.app.console.log(
"KeyStopLerp.validateInput: time vector is not sorted in ascending order!")}};
KeyStopLerp.prototype.reset=function(){KeyStopLerp.validateInput(this.aKeyStopList);
this.nLastIndex=0;this.nKeyStopDistance=this.aKeyStopList[1]-this.aKeyStopList[0];if(
this.nKeyStopDistance<=0)this.nKeyStopDistance=.001};KeyStopLerp.prototype.lerp=function(nAlpha){if(
nAlpha>this.aKeyStopList[this.nLastIndex+1]){do{var nIndex=this.nLastIndex+1;this.nLastIndex=clampN(
nIndex,0,this.nUpperBoundIndex);this.nKeyStopDistance=this.aKeyStopList[this.nLastIndex+1
]-this.aKeyStopList[this.nLastIndex]}while(
this.nKeyStopDistance<=0&&this.nLastIndex<this.nUpperBoundIndex)}var nRawLerp=(
nAlpha-this.aKeyStopList[this.nLastIndex])/this.nKeyStopDistance;nRawLerp=clampN(nRawLerp,0,1);
return{nIndex:this.nLastIndex,nLerp:nRawLerp}};return KeyStopLerp}();
var ContinuousKeyTimeActivityBase=function(_super){__extends(ContinuousKeyTimeActivityBase,_super);
function ContinuousKeyTimeActivityBase(aCommonParamSet){var _this=_super.call(this,aCommonParamSet
)||this;var nSize=aCommonParamSet.aDiscreteTimes.length;assert(nSize>1,
"ContinuousKeyTimeActivityBase constructor: assertion (aDiscreteTimes.length > 1) failed");assert(
aCommonParamSet.aDiscreteTimes[0]==0,
"ContinuousKeyTimeActivityBase constructor: assertion (aDiscreteTimes.front() == 0.0) failed");
assert(aCommonParamSet.aDiscreteTimes[nSize-1]<=1,
"ContinuousKeyTimeActivityBase constructor: assertion (aDiscreteTimes.back() <= 1.0) failed");
_this.aLerper=new KeyStopLerp(aCommonParamSet.aDiscreteTimes);return _this}
ContinuousKeyTimeActivityBase.prototype.activate=function(aEndElement){
_super.prototype.activate.call(this,aEndElement);this.aLerper.reset()};
ContinuousKeyTimeActivityBase.prototype.simplePerform=function(nSimpleTime,nRepeatCount){
var nAlpha=this.calcAcceleratedTime(nSimpleTime);var aLerpResult=this.aLerper.lerp(nAlpha);
this.performContinuousHook(aLerpResult.nIndex,aLerpResult.nLerp,nRepeatCount)};
return ContinuousKeyTimeActivityBase}(SimpleContinuousActivityBase);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var DiscreteActivityBase=function(_super){__extends(
DiscreteActivityBase,_super);function DiscreteActivityBase(aCommonParamSet){var _this=_super.call(
this,aCommonParamSet)||this;_this.aOriginalWakeupEvent=aCommonParamSet.aWakeupEvent;
_this.aOriginalWakeupEvent.setActivity(_this);_this.aWakeupEvent=_this.aOriginalWakeupEvent;
_this.aWakeupEvent=aCommonParamSet.aWakeupEvent;_this.aDiscreteTimes=aCommonParamSet.aDiscreteTimes;
_this.nMinSimpleDuration=aCommonParamSet.nMinDuration;_this.nCurrPerformCalls=0;return _this}
DiscreteActivityBase.prototype.activate=function(aEndElement){_super.prototype.activate.call(this,
aEndElement);this.aWakeupEvent=this.aOriginalWakeupEvent;this.aWakeupEvent.setNextTimeout(0);
this.nCurrPerformCalls=0};DiscreteActivityBase.prototype.startAnimation=function(){
this.aWakeupEvent.start()};DiscreteActivityBase.prototype.calcFrameIndex=function(nCurrCalls,
nVectorSize){if(this.isAutoReverse()){var nFrameIndex=nCurrCalls%(2*nVectorSize);if(
nFrameIndex>=nVectorSize)nFrameIndex=2*nVectorSize-nFrameIndex;return nFrameIndex}else{
return nCurrCalls%nVectorSize}};DiscreteActivityBase.prototype.calcRepeatCount=function(nCurrCalls,
nVectorSize){if(this.isAutoReverse()){return Math.floor(nCurrCalls/(2*nVectorSize))}else{
return Math.floor(nCurrCalls/nVectorSize)}};DiscreteActivityBase.prototype.perform=function(){if(
!_super.prototype.perform.call(this))return false;var nVectorSize=this.aDiscreteTimes.length;
var nFrameIndex=this.calcFrameIndex(this.nCurrPerformCalls,nVectorSize);
var nRepeatCount=this.calcRepeatCount(this.nCurrPerformCalls,nVectorSize);this.performDiscreteHook(
nFrameIndex,nRepeatCount);++this.nCurrPerformCalls;
var nCurrRepeat=this.nCurrPerformCalls/nVectorSize;if(this.isAutoReverse())nCurrRepeat/=2;if(
!this.isRepeatCountValid()||nCurrRepeat<this.getRepeatCount()){
var nFrameIndex_1=this.calcFrameIndex(this.nCurrPerformCalls,nVectorSize);
var nCurrentRepeatTime=this.aDiscreteTimes[nFrameIndex_1];var nRepeatCount_1=this.calcRepeatCount(
this.nCurrPerformCalls,nVectorSize);var nNextTimeout=this.nMinSimpleDuration*(
nRepeatCount_1+this.calcAcceleratedTime(nCurrentRepeatTime));this.aWakeupEvent.setNextTimeout(
nNextTimeout);this.getEventQueue().addEvent(this.aWakeupEvent)}else{this.aWakeupEvent=null;
this.endActivity()}return false};DiscreteActivityBase.prototype.dispose=function(){if(
this.aWakeupEvent)this.aWakeupEvent.dispose();this.aWakeupEvent=null;_super.prototype.dispose.call(
this)};return DiscreteActivityBase}(ActivityBase);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
function FromToByActivityTemplate(BaseType){var FromToByActivity=function(_super){__extends(
FromToByActivity,_super);function FromToByActivity(){var args=[];for(
var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}var _this=this;assert(args.length===8,
"FromToByActivity, constructor args length is wrong");var aFromValue=args[0];var aToValue=args[1];
var aByValue=args[2];var aActivityParamSet=args[3];var aAnimation=args[4];var aInterpolator=args[5];
var aOperatorSet=args[6];var bAccumulate=args[7];_this=_super.call(this,aFromValue,aToValue,aByValue
,aActivityParamSet,aAnimation,aInterpolator,aOperatorSet,bAccumulate)||this;_this.aFrom=aFromValue;
_this.aTo=aToValue;_this.aBy=aByValue;_this.aStartValue=null;_this.aEndValue=null;
_this.aPreviousValue=null;_this.aStartInterpolationValue=null;_this.aAnimation=aAnimation;
_this.aInterpolator=aInterpolator;_this.equal=aOperatorSet.equal;_this.add=aOperatorSet.add;
_this.scale=aOperatorSet.scale;_this.bDynamicStartValue=false;_this.nIteration=0;
_this.bCumulative=bAccumulate;_this.aFormula=aActivityParamSet.aFormula;return _this}
FromToByActivity.prototype.initAnimatedElement=function(){if(this.aAnimation&&hasValue(this.aFrom)){
var aValue=this.aFormula?this.aFormula(this.aFrom):this.aFrom;this.aAnimation.perform(aValue)}};
FromToByActivity.prototype.startAnimation=function(){if(this.isDisposed()||!this.aAnimation){
window.app.console.log("FromToByActivity.startAnimation: activity disposed or not valid animation");
return}_super.prototype.startAnimation.call(this);this.aAnimation.start(this.getTargetElement());
var aAnimationStartValue=this.aAnimation.getUnderlyingValue();if(hasValue(this.aFrom)){if(hasValue(
this.aTo)){this.aStartValue=this.aFrom;this.aEndValue=this.aTo}else if(hasValue(this.aBy)){
this.aStartValue=this.aFrom;this.aEndValue=this.add(this.aStartValue,this.aBy)}
this.aStartInterpolationValue=this.aStartValue}else{this.aStartValue=aAnimationStartValue;
this.aStartInterpolationValue=this.aStartValue;if(hasValue(this.aTo)){this.bDynamicStartValue=true;
this.aPreviousValue=this.aStartValue;this.aEndValue=this.aTo}else if(hasValue(this.aBy)){
this.aStartValue=aAnimationStartValue;this.aEndValue=this.add(this.aStartValue,this.aBy)}}
ANIMDBG.print(
"FromToByActivity.startAnimation: aStartValue = "+this.aStartValue+", aEndValue = "+this.aEndValue)}
FromToByActivity.prototype.endAnimation=function(){if(this.aAnimation)this.aAnimation.end()};
FromToByActivity.prototype.performContinuousHook=function(nModifiedTime,nRepeatCount){if(
this.isDisposed()||!this.aAnimation){window.app.console.log(
"FromToByActivity.performContinuousHook: activity disposed or not valid animation");return}if(
this.bDynamicStartValue){if(this.nIteration!=nRepeatCount){this.nIteration=nRepeatCount;
this.aStartInterpolationValue=this.aStartValue}else{
var aActualValue=this.aAnimation.getUnderlyingValue();if(!this.equal(aActualValue,
this.aPreviousValue))this.aStartInterpolationValue=aActualValue}}var aValue=this.aInterpolator(
this.aStartInterpolationValue,this.aEndValue,nModifiedTime);if(
this.bCumulative&&!this.bDynamicStartValue){aValue=this.add(this.scale(nRepeatCount,this.aEndValue),
aValue)}aValue=this.aFormula?this.aFormula(aValue):aValue;this.aAnimation.perform(aValue);if(
this.bDynamicStartValue){this.aPreviousValue=this.aAnimation.getUnderlyingValue()}};
FromToByActivity.prototype.performDiscreteHook=function(){if(this.isDisposed()||!this.aAnimation){
window.app.console.log(
"FromToByActivity.performDiscreteHook: activity disposed or not valid animation");return}};
FromToByActivity.prototype.performEnd=function(){if(this.aAnimation){var aValue=this.isAutoReverse(
)?this.aStartValue:this.aEndValue;aValue=this.aFormula?this.aFormula(aValue):aValue;
this.aAnimation.perform(aValue)}};FromToByActivity.prototype.dispose=function(){
_super.prototype.dispose.call(this)};return FromToByActivity}(BaseType);return FromToByActivity}
var ContinuousActivityBaserFromToByCtor=function(_super){__extends(
ContinuousActivityBaserFromToByCtor,_super);function ContinuousActivityBaserFromToByCtor(aFromValue,
aToValue,aByValue,aActivityParamSet,aAnimation,aInterpolator,aOperatorSet,bAccumulate){
return _super.call(this,aActivityParamSet)||this}return ContinuousActivityBaserFromToByCtor}(
ContinuousActivityBase);var AbstractLinearFromToByActivity=FromToByActivityTemplate(
ContinuousActivityBaserFromToByCtor);var LinearFromToByActivity=function(_super){__extends(
LinearFromToByActivity,_super);function LinearFromToByActivity(){return _super!==null&&_super.apply(
this,arguments)||this}return LinearFromToByActivity}(AbstractLinearFromToByActivity);
var DiscreteActivityBaserFromToByCtor=function(_super){__extends(DiscreteActivityBaserFromToByCtor,
_super);function DiscreteActivityBaserFromToByCtor(aFromValue,aToValue,aByValue,aActivityParamSet,
aAnimation,aInterpolator,aOperatorSet,bAccumulate){return _super.call(this,aActivityParamSet)||this}
return DiscreteActivityBaserFromToByCtor}(DiscreteActivityBase);
var AbstractDiscreteFromToByActivity=FromToByActivityTemplate(DiscreteActivityBaserFromToByCtor);
var DiscreteFromToByActivity=function(_super){__extends(DiscreteFromToByActivity,_super);
function DiscreteFromToByActivity(){return _super!==null&&_super.apply(this,arguments)||this}
return DiscreteFromToByActivity}(AbstractDiscreteFromToByActivity);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var SetActivity=function(_super){__extends(SetActivity,_super);
function SetActivity(aCommonParamSet,aAnimationNode,aAnimation){var _this=_super.call(this)||this;
_this.aAnimation=aAnimation;_this.aTargetElement=null;_this.aEndEvent=aCommonParamSet.aEndEvent;
_this.aTimerEventQueue=aCommonParamSet.aTimerEventQueue;_this.bIsActive=true;
var aAnimatedElement=aAnimationNode.getAnimatedElement();
var sAttributeName=aAnimationNode.getAttributeName();var sKey=sAttributeName;
var aAttributeProp=aPropertyGetterSetterMap[sKey];var eValueType=aAttributeProp["type"];
var aValueSet=[aAnimationNode.getToValue()];ANIMDBG.print(
"SetActivity: value type: "+PropertyValueType[eValueType]+", aTo = "+aValueSet[0]);var aValueList=[]
extractAttributeValues(eValueType,aValueList,aValueSet,aAnimatedElement.getBaseBBox(),
aCommonParamSet.nSlideWidth,aCommonParamSet.nSlideHeight);ANIMDBG.print(
"SetActivity ctor: aTo = "+aValueList[0]);_this.aToAttr=aValueList[0];return _this}
SetActivity.prototype.activate=function(aEndEvent){this.aEndEvent=aEndEvent;this.bIsActive=true};
SetActivity.prototype.dispose=function(){this.bIsActive=false;if(
this.aEndEvent&&this.aEndEvent.isCharged())this.aEndEvent.dispose()};
SetActivity.prototype.calcTimeLag=function(){return 0};SetActivity.prototype.perform=function(){if(
!this.isActive())return false;this.bIsActive=false;if(this.aAnimation&&this.aTargetElement){
this.aAnimation.start(this.aTargetElement);this.aAnimation.perform(this.aToAttr);
this.aAnimation.end()}if(this.aEndEvent)this.aTimerEventQueue.addEvent(this.aEndEvent)};
SetActivity.prototype.isActive=function(){return this.bIsActive};
SetActivity.prototype.dequeued=function(){};SetActivity.prototype.end=function(){this.perform()};
SetActivity.prototype.setTargets=function(aTargetElement){assert(aTargetElement,
"SetActivity.setTargets: target element is not valid");this.aTargetElement=aTargetElement};
return SetActivity}(AnimationActivity);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var DirectionType;(
function(DirectionType){DirectionType[DirectionType["Backward"]=0]="Backward";DirectionType[
DirectionType["Forward"]=1]="Forward"})(DirectionType||(DirectionType={}));
var SimpleActivity=function(_super){__extends(SimpleActivity,_super);function SimpleActivity(
aCommonParamSet,aNumberAnimation,eDirection){var _this=_super.call(this,aCommonParamSet)||this;
assert(eDirection==DirectionType.Backward||eDirection==DirectionType.Forward,
"SimpleActivity constructor: animation direction is not valid");assert(aNumberAnimation,
"SimpleActivity constructor: animation object is not valid");_this.aAnimation=aNumberAnimation;
_this.nDirection=eDirection==DirectionType.Forward?1:0;return _this}
SimpleActivity.prototype.startAnimation=function(){if(this.isDisposed()||!this.aAnimation)return;
ANIMDBG.print("SimpleActivity.startAnimation invoked");_super.prototype.startAnimation.call(this);
this.aAnimation.start(this.getTargetElement())};SimpleActivity.prototype.endAnimation=function(){if(
this.aAnimation)this.aAnimation.end()};SimpleActivity.prototype.performContinuousHook=function(
nModifiedTime,nRepeatCount){if(this.isDisposed()||!this.aAnimation)return;
var nT=1-this.nDirection+nModifiedTime*(2*this.nDirection-1);this.aAnimation.perform(nT,
nT===this.nDirection)};SimpleActivity.prototype.performEnd=function(){if(this.aAnimation){
app.console.debug("SimpleActivity.performEnd");this.aAnimation.perform(this.nDirection,true)}};
return SimpleActivity}(ContinuousActivityBase);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
function ValueListActivityTemplate(BaseType){var ValueListActivity=function(_super){__extends(
ValueListActivity,_super);function ValueListActivity(){var args=[];for(
var _i=0;_i<arguments.length;_i++){args[_i]=arguments[_i]}var _this=this;assert(args.length===6,
"ValueListActivity, constructor args length is wrong");var aValueList=args[0];
var aActivityParamSet=args[1];var aAnimation=args[2];var aInterpolator=args[3];
var aOperatorSet=args[4];var bAccumulate=args[5];assert(aAnimation,
"ValueListActivity constructor: invalid animation object");assert(aValueList.length!=0,
"ValueListActivity: value list is empty");_this=_super.call(this,aValueList,aActivityParamSet,
aAnimation,aInterpolator,aOperatorSet,bAccumulate)||this;_this.aValueList=aValueList;
_this.aAnimation=aAnimation;_this.aInterpolator=aInterpolator;_this.add=aOperatorSet.add;
_this.scale=aOperatorSet.scale;_this.bCumulative=bAccumulate;_this.aLastValue=_this.aValueList[
_this.aValueList.length-1];_this.aFormula=aActivityParamSet.aFormula;return _this}
ValueListActivity.prototype.activate=function(aEndEvent){_super.prototype.activate.call(this,
aEndEvent);for(var i=0;i<this.aValueList.length;++i){ANIMDBG.print(
"ValueListActivity.activate: value["+i+"] = "+this.aValueList[i])}};
ValueListActivity.prototype.initAnimatedElement=function(){if(this.aAnimation){
var aValue=this.aValueList[0];aValue=this.aFormula?this.aFormula(aValue):aValue;
this.aAnimation.perform(aValue)}};ValueListActivity.prototype.startAnimation=function(){if(
this.isDisposed()||!this.aAnimation){window.app.console.log(
"ValueListActivity.startAnimation: activity disposed or not valid animation");return}
_super.prototype.startAnimation.call(this);this.aAnimation.start(this.getTargetElement())};
ValueListActivity.prototype.endAnimation=function(){if(this.aAnimation)this.aAnimation.end()};
ValueListActivity.prototype.performContinuousHook=function(nIndex,nFractionalIndex,nRepeatCount){if(
this.isDisposed()||!this.aAnimation){window.app.console.log(
"ValueListActivity.performContinuousHook: activity disposed or not valid animation");return}assert(
nIndex+1<this.aValueList.length,
"ValueListActivity.performContinuousHook: assertion (nIndex + 1 < this.aValueList.length) failed");
var aValue=this.aInterpolator(this.aValueList[nIndex],this.aValueList[nIndex+1],nFractionalIndex);
if(this.bCumulative){aValue=this.add(aValue,this.scale(nRepeatCount,this.aLastValue))}
aValue=this.aFormula?this.aFormula(aValue):aValue;this.aAnimation.perform(aValue)};
ValueListActivity.prototype.performDiscreteHook=function(nFrame,nRepeatCount){if(this.isDisposed(
)||!this.aAnimation){window.app.console.log(
"ValueListActivity.performDiscreteHook: activity disposed or not valid animation");return}assert(
nFrame<this.aValueList.length,
"ValueListActivity.performDiscreteHook: assertion ( nFrame < this.aValueList.length) failed");
var aValue=this.aValueList[nFrame];if(this.bCumulative){aValue=this.add(aValue,this.scale(
nRepeatCount,this.aLastValue))}aValue=this.aFormula?this.aFormula(aValue):aValue;
this.aAnimation.perform(aValue)};ValueListActivity.prototype.performEnd=function(){if(
this.aAnimation){var aValue=this.aFormula?this.aFormula(this.aLastValue):this.aLastValue;
this.aAnimation.perform(aValue)}};ValueListActivity.prototype.dispose=function(){
_super.prototype.dispose.call(this)};return ValueListActivity}(BaseType);return ValueListActivity}
var ContinuousKeyTimeActivityBaseValueListCtor=function(_super){__extends(
ContinuousKeyTimeActivityBaseValueListCtor,_super);
function ContinuousKeyTimeActivityBaseValueListCtor(aValueList,aActivityParamSet,aAnimation,
aInterpolator,aOperatorSet,bAccumulate){return _super.call(this,aActivityParamSet)||this}
return ContinuousKeyTimeActivityBaseValueListCtor}(ContinuousKeyTimeActivityBase);
var AbstractLinearValueListActivity=ValueListActivityTemplate(
ContinuousKeyTimeActivityBaseValueListCtor);var LinearValueListActivity=function(_super){__extends(
LinearValueListActivity,_super);function LinearValueListActivity(){
return _super!==null&&_super.apply(this,arguments)||this}return LinearValueListActivity}(
AbstractLinearValueListActivity);var DiscreteActivityBaserValueListCtor=function(_super){__extends(
DiscreteActivityBaserValueListCtor,_super);function DiscreteActivityBaserValueListCtor(aValueList,
aActivityParamSet,aAnimation,aInterpolator,aOperatorSet,bAccumulate){return _super.call(this,
aActivityParamSet)||this}return DiscreteActivityBaserValueListCtor}(DiscreteActivityBase);
var AbstractDiscreteValueListActivity=ValueListActivityTemplate(DiscreteActivityBaserValueListCtor);
var DiscreteValueListActivity=function(_super){__extends(DiscreteValueListActivity,_super);
function DiscreteValueListActivity(){return _super!==null&&_super.apply(this,arguments)||this}
return DiscreteValueListActivity}(AbstractDiscreteValueListActivity);var NodeState;(function(
NodeState){NodeState[NodeState["Invalid"]=0]="Invalid";NodeState[NodeState["Unresolved"]=1
]="Unresolved";NodeState[NodeState["Resolved"]=2]="Resolved";NodeState[NodeState["Active"]=4
]="Active";NodeState[NodeState["Frozen"]=8]="Frozen";NodeState[NodeState["Ended"]=16]="Ended"})(
NodeState||(NodeState={}));var FillModes;(function(FillModes){FillModes[FillModes["Default"]=0
]="Default";FillModes[FillModes["Inherit"]=0]="Inherit";FillModes[FillModes["Remove"]=1]="Remove";
FillModes[FillModes["Freeze"]=2]="Freeze";FillModes[FillModes["Hold"]=3]="Hold";FillModes[FillModes[
"Transition"]=4]="Transition";FillModes[FillModes["Auto"]=5]="Auto"})(FillModes||(FillModes={}));
var RestartMode;(function(RestartMode){RestartMode[RestartMode["Default"]=0]="Default";RestartMode[
RestartMode["Inherit"]=0]="Inherit";RestartMode[RestartMode["Always"]=1]="Always";RestartMode[
RestartMode["WhenNotActive"]=2]="WhenNotActive";RestartMode[RestartMode["Never"]=3]="Never"})(
RestartMode||(RestartMode={}));var ImpressNodeType;(function(ImpressNodeType){ImpressNodeType[
ImpressNodeType["Default"]=0]="Default";ImpressNodeType[ImpressNodeType["OnClick"]=1]="OnClick";
ImpressNodeType[ImpressNodeType["WithPrevious"]=2]="WithPrevious";ImpressNodeType[ImpressNodeType[
"AfterPrevious"]=3]="AfterPrevious";ImpressNodeType[ImpressNodeType["MainSequence"]=4
]="MainSequence";ImpressNodeType[ImpressNodeType["TimingRoot"]=5]="TimingRoot";ImpressNodeType[
ImpressNodeType["InteractiveSequence"]=6]="InteractiveSequence"})(ImpressNodeType||(
ImpressNodeType={}));var TransitionMode;(function(TransitionMode){TransitionMode[TransitionMode[
"out"]=0]="out";TransitionMode[TransitionMode["in"]=1]="in"})(TransitionMode||(TransitionMode={}));
var AdditiveMode;(function(AdditiveMode){AdditiveMode[AdditiveMode["Unknown"]=0]="Unknown";
AdditiveMode[AdditiveMode["Base"]=1]="Base";AdditiveMode[AdditiveMode["Replace"]=2]="Replace";
AdditiveMode[AdditiveMode["Multiply"]=3]="Multiply";AdditiveMode[AdditiveMode["None"]=4]="None"})(
AdditiveMode||(AdditiveMode={}));var AccumulateMode;(function(AccumulateMode){AccumulateMode[
AccumulateMode["None"]=0]="None";AccumulateMode[AccumulateMode["Sum"]=1]="Sum"})(AccumulateMode||(
AccumulateMode={}));var CalcMode;(function(CalcMode){CalcMode[CalcMode["Discrete"]=1]="Discrete";
CalcMode[CalcMode["Linear"]=2]="Linear";CalcMode[CalcMode["Paced"]=3]="Paced";CalcMode[CalcMode[
"Spline"]=4]="Spline"})(CalcMode||(CalcMode={}));function createStateTransitionTable(){
var aSTT=new Map;aSTT.set(RestartMode.Never,new Map);aSTT.set(RestartMode.WhenNotActive,new Map);
aSTT.set(RestartMode.Always,new Map);var aTable0=new Map([[NodeState.Invalid,NodeState.Invalid],[
NodeState.Unresolved,NodeState.Resolved|NodeState.Ended],[NodeState.Resolved,
NodeState.Active|NodeState.Ended],[NodeState.Active,NodeState.Ended],[NodeState.Frozen,
NodeState.Invalid],[NodeState.Ended,NodeState.Ended]]);aSTT.get(RestartMode.Never).set(
FillModes.Remove,aTable0);var aTable1=new Map([[NodeState.Invalid,NodeState.Invalid],[
NodeState.Unresolved,NodeState.Resolved|NodeState.Ended],[NodeState.Resolved,
NodeState.Active|NodeState.Ended],[NodeState.Active,NodeState.Frozen|NodeState.Ended],[
NodeState.Frozen,NodeState.Ended],[NodeState.Ended,NodeState.Ended]]);aSTT.get(RestartMode.Never
).set(FillModes.Freeze,aTable1);aSTT.get(RestartMode.Never).set(FillModes.Hold,aTable1);aSTT.get(
RestartMode.Never).set(FillModes.Transition,aTable1);var aTable2=new Map([[NodeState.Invalid,
NodeState.Invalid],[NodeState.Unresolved,NodeState.Resolved|NodeState.Ended],[NodeState.Resolved,
NodeState.Active|NodeState.Ended],[NodeState.Active,NodeState.Ended],[NodeState.Frozen,
NodeState.Invalid],[NodeState.Ended,NodeState.Resolved|NodeState.Active|NodeState.Ended]]);aSTT.get(
RestartMode.WhenNotActive).set(FillModes.Remove,aTable2);var aTable3=new Map([[NodeState.Invalid,
NodeState.Invalid],[NodeState.Unresolved,NodeState.Resolved|NodeState.Ended],[NodeState.Resolved,
NodeState.Active|NodeState.Ended],[NodeState.Active,NodeState.Frozen|NodeState.Ended],[
NodeState.Frozen,NodeState.Resolved|NodeState.Active|NodeState.Ended],[NodeState.Ended,
NodeState.Resolved|NodeState.Active|NodeState.Ended]]);aSTT.get(RestartMode.WhenNotActive).set(
FillModes.Freeze,aTable3);aSTT.get(RestartMode.WhenNotActive).set(FillModes.Hold,aTable3);aSTT.get(
RestartMode.WhenNotActive).set(FillModes.Transition,aTable3);var aTable4=new Map([[NodeState.Invalid
,NodeState.Invalid],[NodeState.Unresolved,NodeState.Resolved|NodeState.Ended],[NodeState.Resolved,
NodeState.Active|NodeState.Ended],[NodeState.Active,
NodeState.Resolved|NodeState.Active|NodeState.Ended],[NodeState.Frozen,NodeState.Invalid],[
NodeState.Ended,NodeState.Resolved|NodeState.Active|NodeState.Ended]]);aSTT.get(RestartMode.Always
).set(FillModes.Remove,aTable4);var aTable5=new Map([[NodeState.Invalid,NodeState.Invalid],[
NodeState.Unresolved,NodeState.Resolved|NodeState.Ended],[NodeState.Resolved,
NodeState.Active|NodeState.Ended],[NodeState.Active,
NodeState.Resolved|NodeState.Active|NodeState.Frozen|NodeState.Ended],[NodeState.Frozen,
NodeState.Resolved|NodeState.Active|NodeState.Ended],[NodeState.Ended,
NodeState.Resolved|NodeState.Active|NodeState.Ended]]);aSTT.get(RestartMode.Always).set(
FillModes.Freeze,aTable5);aSTT.get(RestartMode.Always).set(FillModes.Hold,aTable5);aSTT.get(
RestartMode.Always).set(FillModes.Transition,aTable5);return aSTT}
var aStateTransitionTable=createStateTransitionTable();function getTransitionTable(eRestartMode,
eFillMode){if(eRestartMode==RestartMode.Default){window.app.console.log(
"getTransitionTable: unexpected restart mode: "+eRestartMode+". Used NEVER instead.");
eRestartMode=RestartMode.Never}if(eFillMode==FillModes.Default||eFillMode==FillModes.Auto){
eFillMode=FillModes.Remove}return aStateTransitionTable.get(eRestartMode).get(eFillMode)}
var StateTransition=function(){function StateTransition(aBaseNode){this.aNode=aBaseNode;
this.eToState=NodeState.Invalid}StateTransition.prototype.enter=function(eNodeState,bForce){if(
!bForce)bForce=false;if(this.eToState!=NodeState.Invalid){window.app.console.log(
"StateTransition.enter: commit() before enter()ing again!");return false}if(
!bForce&&!this.aNode.isTransition(this.aNode.getState(),eNodeState))return false;if((
this.aNode.nCurrentStateTransition&eNodeState)!=0)return false;
this.aNode.nCurrentStateTransition|=eNodeState;this.eToState=eNodeState;return true};
StateTransition.prototype.commit=function(){if(this.eToState!=NodeState.Invalid){
this.aNode.setState(this.eToState);this.clear()}};StateTransition.prototype.clear=function(){if(
this.eToState!=NodeState.Invalid){this.aNode.nCurrentStateTransition&=~this.eToState;
this.eToState=NodeState.Invalid}};return StateTransition}();var BaseNode=function(){
function BaseNode(aNodeInfo,aParentNode,aNodeContext){this.sClassName="BaseNode";
this.bIsFirstAutoEffect=false;this.bIsMainSequenceRootNode=false;
this.bIsInteractiveSequenceRootNode=false;this.nId=BaseNode.getUniqueId();if(!aNodeInfo
)window.app.console.log("BaseNode(id:"+this.nId+") constructor: aNodeInfo is not valid");if(
!aNodeContext)window.app.console.log(
"BaseNode(id:"+this.nId+") constructor: aNodeContext is not valid");if(!aNodeContext._context
)window.app.console.log("BaseNode(id:"+this.nId+") constructor: aNodeContext.aContext is not valid")
this.eAnimationNodeType=getAnimationNodeType(aNodeInfo);this.bIsContainer=false;
this.aNodeInfo=aNodeInfo;this.aParentNode=aParentNode;this.aNodeContext=aNodeContext;
this._context=aNodeContext._context;this.nStartDelay=aNodeContext.nStartDelay;
this.eCurrentState=NodeState.Unresolved;this.nCurrentStateTransition=0;
this.aDeactivatingListenerArray=[];this.aActivationEvent=null;this.aDeactivationEvent=null;
this.aBegin=null;this.aDuration=null;this.aEnd=null;this.eFillMode=FillModes.Freeze;
this.eRestartMode=RestartMode.Never;this.nRepeatCount=undefined;this.nAccelerate=0;
this.nDecelerate=0;this.bAutoReverse=false}BaseNode.getUniqueId=function(){++BaseNode.CURR_UNIQUE_ID
return BaseNode.CURR_UNIQUE_ID};BaseNode.prototype.getId=function(){return this.nId};
BaseNode.prototype.parseNodeInfo=function(){if(this.aNodeInfo.id
)this.aNodeContext.aAnimationNodeMap.set(this.aNodeInfo.id,this);this.aBegin=new Timing(this,
this.aNodeInfo.begin);this.aBegin.parse();this.aEnd=null;if(this.aNodeInfo.end){
this.aEnd=new Timing(this,this.aNodeInfo.end);this.aEnd.parse()}this.aDuration=new Duration(
this.aNodeInfo.dur);if(!this.aDuration.isSet()){if(this.isContainer()
)this.aDuration=null;else this.aDuration=new Duration("indefinite")}if(
this.aNodeInfo.fill&&this.aNodeInfo.fill in FillModes){var sFill=this.aNodeInfo.fill;
this.eFillMode=FillModes[sFill]}else{this.eFillMode=FillModes.Default}if(
this.aNodeInfo.restart&&this.aNodeInfo.restart in RestartMode){var sRestart=this.aNodeInfo.restart;
this.eRestartMode=RestartMode[sRestart]}else{this.eRestartMode=RestartMode.Default}
this.nRepeatCount=1;if(this.aNodeInfo.repeatCount)this.nRepeatCount=parseFloat(
this.aNodeInfo.repeatCount);if(isNaN(this.nRepeatCount)&&this.aNodeInfo.repeatCount!=="indefinite"
)this.nRepeatCount=1;this.nAccelerate=0;var sAccelerate=this.aNodeInfo.accelerate;if(sAccelerate
)this.nAccelerate=parseFloat(sAccelerate);if(isNaN(this.nAccelerate))this.nAccelerate=0;
this.nDecelerate=0;var sDecelerate=this.aNodeInfo.decelerate;if(sDecelerate
)this.nDecelerate=parseFloat(sDecelerate);if(isNaN(this.nDecelerate))this.nDecelerate=0;
this.bAutoReverse=false;var sAutoReverse=this.aNodeInfo.autoreverse;if(sAutoReverse=="true"
)this.bAutoReverse=true;if(this.eFillMode===FillModes.Default){if(this.getParentNode()
)this.eFillMode=this.getParentNode().getFillMode();else this.eFillMode=FillModes.Auto}if(
this.eFillMode===FillModes.Auto){
this.eFillMode=this.aEnd||this.nRepeatCount!=1||this.aDuration&&!this.aDuration.isIndefinite(
)?FillModes.Remove:FillModes.Freeze}if(this.eRestartMode===RestartMode.Default){if(
this.getParentNode())this.eRestartMode=this.getParentNode().getRestartMode(
);else this.eRestartMode=RestartMode.Always}if(this.nAccelerate+this.nDecelerate>1){
this.nAccelerate=0;this.nDecelerate=0}this.aStateTransTable=getTransitionTable(this.getRestartMode()
,this.getFillMode())};BaseNode.prototype.getParentNode=function(){return this.aParentNode};
BaseNode.prototype.init=function(){this.DBG(this.callInfo("init"));if(!this.checkValidNode()
)return false;if(this.aActivationEvent)this.aActivationEvent.dispose();if(this.aDeactivationEvent
)this.aDeactivationEvent.dispose();this.eCurrentState=NodeState.Unresolved;return this.init_st()};
BaseNode.prototype.resolve=function(){if(this.aNodeContext.bIsInvalid||!this.checkValidNode()
)return false;this.DBG(this.callInfo("resolve"));if(this.eCurrentState==NodeState.Resolved
)window.app.console.log("BaseNode.resolve: already in RESOLVED state");
var aStateTrans=new StateTransition(this);if(aStateTrans.enter(NodeState.Resolved
)&&this.isTransition(NodeState.Resolved,NodeState.Active)&&this.resolve_st()){aStateTrans.commit();
if(this.aActivationEvent){this.aActivationEvent.charge()}else{this.aActivationEvent=makeDelay(
this.activate.bind(this),this.getBegin().getOffset()+this.nStartDelay)}registerEvent(this.getId(),
this.aNodeContext._context.aSlideShowHandler,this.getBegin(),this.aActivationEvent,this.aNodeContext
);return true}return false};BaseNode.prototype.activate=function(){if(!this.checkValidNode()
)return false;if(this.eCurrentState===NodeState.Active)window.app.console.log(
"BaseNode.activate: already in ACTIVE state");this.DBG(this.callInfo("activate"),
getCurrentSystemTime());var aStateTrans=new StateTransition(this);if(aStateTrans.enter(
NodeState.Active)){this.activate_st();aStateTrans.commit();if(this.bIsFirstAutoEffect
)this.aNodeContext._context.aSlideShowHandler.notifyFirstAutoEffectStarted();if(
!this._context.aEventMultiplexer)window.app.console.log(
"BaseNode.activate: this.aContext.aEventMultiplexer is not valid");
this._context.aEventMultiplexer.notifyEvent(EventTrigger.BeginEvent,this.getId());return true}
return false};BaseNode.prototype.deactivate=function(){if(this.inStateOrTransition(
NodeState.Ended|NodeState.Frozen)||!this.checkValidNode())return;if(this.isTransition(
this.eCurrentState,NodeState.Frozen)){this.DBG(this.callInfo("deactivate"),getCurrentSystemTime());
var aStateTrans=new StateTransition(this);if(aStateTrans.enter(NodeState.Frozen,true)){
this.deactivate_st(NodeState.Frozen);aStateTrans.commit();this.notifyEndListeners();if(
this.bIsFirstAutoEffect)this.aNodeContext._context.aSlideShowHandler.notifyFirstAutoEffectEnded();
if(this.aActivationEvent)this.aActivationEvent.dispose();if(this.aDeactivationEvent
)this.aDeactivationEvent.dispose()}}else{this.end()}};BaseNode.prototype.end=function(){
var bIsFrozenOrInTransitionToFrozen=this.inStateOrTransition(NodeState.Frozen);if(
this.inStateOrTransition(NodeState.Ended)||!this.checkValidNode())return;if(!this.isTransition(
this.eCurrentState,NodeState.Ended))window.app.console.log(
"BaseNode.end: end state not reachable in transition table");this.DBG(this.callInfo("end"),
getCurrentSystemTime());var aStateTrans=new StateTransition(this);if(aStateTrans.enter(
NodeState.Ended,true)){this.deactivate_st(NodeState.Ended);aStateTrans.commit();if(
!bIsFrozenOrInTransitionToFrozen)this.notifyEndListeners();if(this.bIsFirstAutoEffect
)this.aNodeContext._context.aSlideShowHandler.notifyFirstAutoEffectEnded();if(this.aActivationEvent
)this.aActivationEvent.dispose();if(this.aDeactivationEvent)this.aDeactivationEvent.dispose()}};
BaseNode.prototype.dispose=function(){if(this.aActivationEvent)this.aActivationEvent.dispose();if(
this.aDeactivationEvent)this.aDeactivationEvent.dispose();this.aDeactivatingListenerArray=[]};
BaseNode.prototype.getState=function(){return this.eCurrentState};
BaseNode.prototype.setState=function(nodeState){this.eCurrentState=nodeState};
BaseNode.prototype.registerDeactivatingListener=function(aNotifiee){if(!this.checkValidNode()
)return false;if(!aNotifiee){window.app.console.log(
"BaseNode.registerDeactivatingListener(): invalid notifiee");return false}
this.aDeactivatingListenerArray.push(aNotifiee);return true};
BaseNode.prototype.notifyDeactivating=function(aNotifier){assert(aNotifier.getState(
)===NodeState.Frozen||aNotifier.getState()===NodeState.Ended,
"BaseNode.notifyDeactivating: Notifier node is neither in FROZEN nor in ENDED state")};
BaseNode.prototype.isContainer=function(){return this.bIsContainer};
BaseNode.prototype.isMainSequenceRootNode=function(){return this.bIsMainSequenceRootNode};
BaseNode.prototype.isInteractiveSequenceRootNode=function(){
return this.bIsInteractiveSequenceRootNode};BaseNode.prototype.makeDeactivationEvent=function(nDelay
){if(this.aDeactivationEvent){this.aDeactivationEvent.charge()}else if(typeof nDelay==typeof 0){
this.aDeactivationEvent=makeDelay(this.deactivate.bind(this),nDelay)}else{
this.aDeactivationEvent=null}return this.aDeactivationEvent};
BaseNode.prototype.scheduleDeactivationEvent=function(aEvent){this.DBG(this.callInfo(
"scheduleDeactivationEvent"));if(!aEvent){if(this.getDuration()&&this.getDuration().isValue()
)aEvent=this.makeDeactivationEvent(this.getDuration().getValue())}if(aEvent){
this._context.aTimerEventQueue.addEvent(aEvent)}};BaseNode.prototype.checkValidNode=function(){
return this.eCurrentState!==NodeState.Invalid};BaseNode.prototype.init_st=function(){return true};
BaseNode.prototype.resolve_st=function(){return true};BaseNode.prototype.activate_st=function(){
this.scheduleDeactivationEvent()};BaseNode.prototype.deactivate_st=function(aNodeState){};
BaseNode.prototype.notifyEndListeners=function(){
var nDeactivatingListenerCount=this.aDeactivatingListenerArray.length;for(
var i=0;i<nDeactivatingListenerCount;++i){this.aDeactivatingListenerArray[i].notifyDeactivating(this
)}this._context.aEventMultiplexer.notifyEvent(EventTrigger.EndEvent,this.getId());if(
this.getParentNode()&&this.getParentNode().isMainSequenceRootNode()
)this._context.aEventMultiplexer.notifyNextEffectEndEvent();if(this.isMainSequenceRootNode()
)this._context.aEventMultiplexer.notifyAnimationsEndEvent()};BaseNode.prototype.getContext=function(
){return this._context};BaseNode.prototype.isTransition=function(eFromState,eToState){return(
this.aStateTransTable.get(eFromState)&eToState)!==0};
BaseNode.prototype.inStateOrTransition=function(nMask){return(this.eCurrentState&nMask)!=0||(
this.nCurrentStateTransition&nMask)!=0};BaseNode.prototype.getBegin=function(){return this.aBegin};
BaseNode.prototype.getEnd=function(){return this.aEnd};BaseNode.prototype.getDuration=function(){
return this.aDuration};BaseNode.prototype.getFillMode=function(){return this.eFillMode};
BaseNode.prototype.getRestartMode=function(){return this.eRestartMode};
BaseNode.prototype.getRepeatCount=function(){return this.nRepeatCount};
BaseNode.prototype.getAccelerateValue=function(){return this.nAccelerate};
BaseNode.prototype.getDecelerateValue=function(){return this.nDecelerate};
BaseNode.prototype.isAutoReverseEnabled=function(){return this.bAutoReverse};
BaseNode.prototype.info=function(bVerbose){if(bVerbose===void 0){bVerbose=false}
var sInfo=this.sClassName+"("+this.aNodeInfo.nodeName+", "+this.getId()+", "+NodeState[
this.getState()]+")";if(bVerbose){sInfo+=";  is container: "+this.isContainer();if(this.getBegin()){
if(this.getBegin().getEventType()===EventTrigger.OnNext)sInfo+=";  [31mbegin: "+this.getBegin(
).info()+"[m";else sInfo+=";  begin: "+this.getBegin().info()}if(this.getDuration()
)sInfo+=";  dur: "+this.getDuration().info();if(this.getEnd())sInfo+=";  end: "+this.getEnd().info()
if(this.getFillMode())sInfo+=";  fill: "+FillModes[this.getFillMode()];if(this.getRestartMode()
)sInfo+=";  restart: "+RestartMode[this.getRestartMode()];if(this.getRepeatCount(
)&&this.getRepeatCount()!=1)sInfo+=";  repeatCount: "+this.getRepeatCount();if(
this.aNodeInfo.presetId)sInfo+="; [31mpresetId: "+this.aNodeInfo.presetId+"[m";if(
this.aNodeInfo.presetSubType)sInfo+="; presetSubType: "+this.aNodeInfo.presetSubType;if(
this.getAccelerateValue())sInfo+=";  accelerate: "+this.getAccelerateValue();if(
this.getDecelerateValue())sInfo+=";  decelerate: "+this.getDecelerateValue();if(
this.isAutoReverseEnabled())sInfo+=";  autoReverse: true"}return sInfo};
BaseNode.prototype.callInfo=function(sMethodName){var sInfo=this.sClassName+"( "+this.getId(
)+", "+NodeState[this.getState()]+" )."+sMethodName;return sInfo};BaseNode.prototype.DBG=function(
sMessage,nTime){ANIMDBG.print(sMessage,nTime)};BaseNode.CURR_UNIQUE_ID=0;return BaseNode}();
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var AnimationBaseNode=function(_super){__extends(
AnimationBaseNode,_super);function AnimationBaseNode(aNodeInfo,aParentNode,aNodeContext){
var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;
_this.sClassName="AnimationBaseNode";_this.bIsTargetTextElement=false;_this.aAnimatedElement=null;
_this.aActivity=null;return _this}AnimationBaseNode.prototype.parseNodeInfo=function(){
_super.prototype.parseNodeInfo.call(this);var aNodeInfo=this.aNodeInfo;
this.aTargetHash=aNodeInfo.targetElement;if(!this.aTargetHash){this.eCurrentState=NodeState.Invalid;
window.app.console.log(
"AnimationBaseNode.parseElement: target element not found: "+aNodeInfo.targetElement)}
this.bIsTargetTextElement=aNodeInfo.subItem&&aNodeInfo.subItem==="OnlyText";if(
aNodeInfo.additive&&aNodeInfo.additive in AdditiveMode){var sAdditive=aNodeInfo.additive;
this.eAdditiveMode=AdditiveMode[sAdditive]}else{this.eAdditiveMode=AdditiveMode.Replace}
this.nMinFrameCount=this.getDuration().isValue()?this.getDuration().getValue(
)*SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS:SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS;if(
this.nMinFrameCount<1)this.nMinFrameCount=1;else if(
this.nMinFrameCount>SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS
)this.nMinFrameCount=SlideShowHandler.MINIMUM_FRAMES_PER_SECONDS;if(this.aTargetHash){if(
!this.aNodeContext.aAnimatedElementMap.has(this.aTargetHash)){
var slideHash=this.aNodeContext.metaSlide.info.hash;
var slideWidth=this.aNodeContext._context.nSlideWidth;
var slideHeight=this.aNodeContext._context.nSlideHeight;
var aAnimatedElement=this.bIsTargetTextElement?new AnimatedTextElement(this.aTargetHash,slideHash,
aNodeInfo.title,slideWidth,slideHeight):new AnimatedElement(this.aTargetHash,slideHash,
aNodeInfo.title,slideWidth,slideHeight);this.aNodeContext.aAnimatedElementMap.set(this.aTargetHash,
aAnimatedElement)}this.aAnimatedElement=this.aNodeContext.aAnimatedElementMap.get(this.aTargetHash);
this.aAnimatedElement.setAdditiveMode(this.eAdditiveMode)}};
AnimationBaseNode.prototype.init_st=function(){if(this.aActivity)this.aActivity.activate(makeEvent(
this.deactivate.bind(this)));else this.aActivity=this.createActivity();return true};
AnimationBaseNode.prototype.resolve_st=function(){return true};
AnimationBaseNode.prototype.activate_st=function(){if(this.aActivity){
this.saveStateOfAnimatedElement();this.aActivity.setTargets(this.getAnimatedElement());if(
this.getContext().bIsSkipping){this.aActivity.end()}else{this.getContext(
).aActivityQueue.addActivity(this.aActivity)}}else{_super.prototype.scheduleDeactivationEvent.call(
this)}};AnimationBaseNode.prototype.deactivate_st=function(eDestState){if(
eDestState===NodeState.Frozen){if(this.aActivity)this.aActivity.end()}if(
eDestState===NodeState.Ended){if(this.aActivity)this.aActivity.dispose();if(this.getFillMode(
)===FillModes.Remove&&this.getAnimatedElement())this.removeEffect()}};
AnimationBaseNode.prototype.fillActivityParams=function(){var nDuration=.001;if(this.getDuration(
).isValue()){nDuration=this.getDuration().getValue()}else{window.app.console.log(
"AnimationBaseNode.fillActivityParams: duration is not a number")}
var aActivityParamSet=new ActivityParamSet;aActivityParamSet.aEndEvent=makeEvent(
this.deactivate.bind(this));aActivityParamSet.aTimerEventQueue=this._context.aTimerEventQueue;
aActivityParamSet.aActivityQueue=this._context.aActivityQueue;
aActivityParamSet.nMinDuration=nDuration;aActivityParamSet.nMinNumberOfFrames=this.getMinFrameCount(
);aActivityParamSet.bAutoReverse=this.isAutoReverseEnabled();
aActivityParamSet.nRepeatCount=this.getRepeatCount();
aActivityParamSet.nAccelerationFraction=this.getAccelerateValue();
aActivityParamSet.nDecelerationFraction=this.getDecelerateValue();
aActivityParamSet.nSlideWidth=this.aNodeContext._context.nSlideWidth;
aActivityParamSet.nSlideHeight=this.aNodeContext._context.nSlideHeight;return aActivityParamSet};
AnimationBaseNode.prototype.hasPendingAnimation=function(){return true};
AnimationBaseNode.prototype.saveStateOfAnimatedElement=function(){this.getAnimatedElement(
).saveState(this.getId())};AnimationBaseNode.prototype.removeEffect=function(){
this.getAnimatedElement().restoreState(this.getId())};
AnimationBaseNode.prototype.getTargetHash=function(){return this.aTargetHash};
AnimationBaseNode.prototype.getAnimatedElement=function(){return this.aAnimatedElement};
AnimationBaseNode.prototype.dispose=function(){if(this.aActivity)this.aActivity.dispose();
_super.prototype.dispose.call(this)};AnimationBaseNode.prototype.getMinFrameCount=function(){
return this.nMinFrameCount};AnimationBaseNode.prototype.getAdditiveMode=function(){
return this.eAdditiveMode};AnimationBaseNode.prototype.info=function(bVerbose){if(bVerbose===void 0
){bVerbose=false}var sInfo=_super.prototype.info.call(this,bVerbose);if(bVerbose){if(
this.getMinFrameCount())sInfo+=";  min frame count: "+this.getMinFrameCount();
sInfo+=";  additive: "+AdditiveMode[this.getAdditiveMode()];if(this.getTargetHash()){
var sElemId=this.getTargetHash();sInfo+=";  targetElement: "+sElemId}}return sInfo};
return AnimationBaseNode}(BaseNode);var AnimationBaseNode2=function(_super){__extends(
AnimationBaseNode2,_super);function AnimationBaseNode2(aNodeInfo,aParentNode,aNodeContext){
var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;_this.attributeName="";
_this.aToValue=null;return _this}AnimationBaseNode2.prototype.parseNodeInfo=function(){
_super.prototype.parseNodeInfo.call(this);var aNodeInfo=this.aNodeInfo;
this.attributeName=aNodeInfo.attributeName;if(!this.attributeName){
this.eCurrentState=NodeState.Invalid;window.app.console.log(
this.sClassName+".parseElement: target attribute name not found")}else{
this.attributeName=this.attributeName.toLowerCase()}this.aToValue=aNodeInfo.to};
AnimationBaseNode2.prototype.getAttributeName=function(){return this.attributeName};
AnimationBaseNode2.prototype.getToValue=function(){return this.aToValue};
AnimationBaseNode2.prototype.info=function(verbose){var sInfo=_super.prototype.info.call(this,
verbose);if(verbose){if(this.getAttributeName()
)sInfo+=";  [31mattributeName: "+this.getAttributeName()+"[m";if(this.getToValue()
)sInfo+=";  to: "+this.getToValue()}return sInfo};return AnimationBaseNode2}(AnimationBaseNode);
var AnimationBaseNode3=function(_super){__extends(AnimationBaseNode3,_super);
function AnimationBaseNode3(aNodeInfo,aParentNode,aNodeContext){var _this=_super.call(this,aNodeInfo
,aParentNode,aNodeContext)||this;_this.eAccumulate=undefined;_this.eCalcMode=undefined;
_this.aFromValue=null;_this.aByValue=null;_this.aKeyTimes=null;_this.aValues=null;
_this.aFormula=null;return _this}AnimationBaseNode3.prototype.parseNodeInfo=function(){
_super.prototype.parseNodeInfo.call(this);var aNodeInfo=this.aNodeInfo;
this.eAccumulate=AccumulateMode.None;var sAccumulateAttr=aNodeInfo.accumulate;if(
sAccumulateAttr==="sum")this.eAccumulate=AccumulateMode.Sum;this.eCalcMode=CalcMode.Linear;if(
aNodeInfo.calcMode&&aNodeInfo.calcMode in CalcMode){var sCalcMode=aNodeInfo.calcMode;
this.eCalcMode=CalcMode[sCalcMode]}this.aFromValue=aNodeInfo.from;this.aByValue=aNodeInfo.by;
this.aKeyTimes=[];var sKeyTimesAttr=aNodeInfo.keyTimes;sKeyTimesAttr=removeWhiteSpaces(sKeyTimesAttr
);if(sKeyTimesAttr){var aKeyTimes=sKeyTimesAttr.split(";");for(var i=0;i<aKeyTimes.length;++i
)this.aKeyTimes.push(parseFloat(aKeyTimes[i]))}this.aValues=aNodeInfo.values?aNodeInfo.values.split(
";"):[];this.aFormula=aNodeInfo.formula};AnimationBaseNode3.prototype.getAccumulate=function(){
return this.eAccumulate};AnimationBaseNode3.prototype.getCalcMode=function(){return this.eCalcMode};
AnimationBaseNode3.prototype.getFromValue=function(){return this.aFromValue};
AnimationBaseNode3.prototype.getByValue=function(){return this.aByValue};
AnimationBaseNode3.prototype.getKeyTimes=function(){return this.aKeyTimes};
AnimationBaseNode3.prototype.getValues=function(){return this.aValues};
AnimationBaseNode3.prototype.getFormula=function(){return this.aFormula};
AnimationBaseNode3.prototype.info=function(verbose){var sInfo=_super.prototype.info.call(this,
verbose);if(verbose){if(this.getAccumulate())sInfo+=";  accumulate: "+AccumulateMode[
this.getAccumulate()];sInfo+=";  calcMode: "+CalcMode[this.getCalcMode()];if(this.getFromValue()
)sInfo+=";  from: "+this.getFromValue();if(this.getByValue())sInfo+=";  by: "+this.getByValue();if(
this.getKeyTimes().length)sInfo+=";  keyTimes: "+this.getKeyTimes().join(",");if(this.getValues(
).length)sInfo+=";  values: "+this.getValues().join(",");if(this.getFormula()
)sInfo+=";  formula: "+this.getFormula()}return sInfo};return AnimationBaseNode3}(AnimationBaseNode2
);var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ColorSpace;(function(ColorSpace){ColorSpace[ColorSpace[
"rgb"]=0]="rgb";ColorSpace[ColorSpace["hsl"]=1]="hsl"})(ColorSpace||(ColorSpace={}));
var ClockDirection;(function(ClockDirection){ClockDirection[ClockDirection["clockwise"]=0
]="clockwise";ClockDirection[ClockDirection["counterClockwise"]=1]="counterClockwise"})(
ClockDirection||(ClockDirection={}));var AnimationColorNode=function(_super){__extends(
AnimationColorNode,_super);function AnimationColorNode(aNodeInfo,aParentNode,aNodeContext){
var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;
_this.sClassName="AnimationColorNode";return _this}
AnimationColorNode.prototype.parseNodeInfo=function(){_super.prototype.parseNodeInfo.call(this);
var aNodeInfo=this.aNodeInfo;this.eColorInterpolation=ColorSpace.rgb;if(
aNodeInfo.colorInterpolation&&aNodeInfo.colorInterpolation in ColorSpace){
var sColorInterpolation=aNodeInfo.colorInterpolation;this.eColorInterpolation=ColorSpace[
sColorInterpolation]}this.eColorInterpolationDirection=ClockDirection.clockwise;if(
aNodeInfo.colorInterpolationDirection&&aNodeInfo.colorInterpolationDirection in ClockDirection){
var sColorInterpolationDir=aNodeInfo.colorInterpolationDirection;
this.eColorInterpolationDirection=ClockDirection[sColorInterpolationDir]}};
AnimationColorNode.prototype.createActivity=function(){
var aActivityParamSet=this.fillActivityParams();if(this.getAnimatedElement()&&this.getToValue(
)&&this.getAttributeName()==="dimcolor"){this.getAnimatedElement().setDefaultDimColor(colorParser(
this.getToValue()))}var aAnimation=createPropertyAnimation(this.getAttributeName(),
this.getAnimatedElement(),this.aNodeContext._context.nSlideWidth,
this.aNodeContext._context.nSlideHeight);var aColorAnimation;var aInterpolator;if(
this.getColorInterpolation()===ColorSpace.hsl){ANIMDBG.print(
"AnimationColorNode.createActivity: color space hsl");aColorAnimation=new HSLAnimationWrapper(
aAnimation);aInterpolator=PropertyInterpolator.getInterpolator(PropertyValueType.Color,
ColorSpace.hsl,this.getColorInterpolationDirection())}else{ANIMDBG.print(
"AnimationColorNode.createActivity: color space rgb");aColorAnimation=aAnimation;
aInterpolator=PropertyInterpolator.getInterpolator(PropertyValueType.Color,ColorSpace.rgb)}
return createActivity(aActivityParamSet,this,aColorAnimation,aInterpolator)};
AnimationColorNode.prototype.getColorInterpolation=function(){return this.eColorInterpolation};
AnimationColorNode.prototype.getColorInterpolationDirection=function(){
return this.eColorInterpolationDirection};AnimationColorNode.prototype.info=function(bVerbose){if(
bVerbose===void 0){bVerbose=false}var sInfo=_super.prototype.info.call(this,bVerbose);if(bVerbose){
sInfo+=";  color-interpolation: "+ColorSpace[this.getColorInterpolation()];
sInfo+=";  color-interpolation-direction: "+ClockDirection[this.getColorInterpolationDirection()]}
return sInfo};return AnimationColorNode}(AnimationBaseNode3);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var AnimationPathMotionNode=function(_super){__extends(
AnimationPathMotionNode,_super);function AnimationPathMotionNode(aNodeInfo,aParentNode,aNodeContext
){var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;
_this.sClassName="AnimationPathMotionNode";return _this}
AnimationPathMotionNode.prototype.parseNodeInfo=function(){_super.prototype.parseNodeInfo.call(this)
var aNodeInfo=this.aNodeInfo;if(!aNodeInfo.path){this.eCurrentState=NodeState.Invalid;
window.app.console.log("AnimationPathMotionNode.parseElement: path is not valid")}
this.path=aNodeInfo.path};AnimationPathMotionNode.prototype.createActivity=function(){
var aActivityParamSet=this.fillActivityParams();var aAnimation=new PathAnimation(this.path,
this.getAdditiveMode(),aActivityParamSet.nSlideWidth,aActivityParamSet.nSlideHeight);
return new SimpleActivity(aActivityParamSet,aAnimation,DirectionType.Forward)};
AnimationPathMotionNode.prototype.getPath=function(){return this.path};
AnimationPathMotionNode.prototype.info=function(bVerbose){if(bVerbose===void 0){bVerbose=false}
var sInfo=_super.prototype.info.call(this,bVerbose);if(bVerbose){sInfo+=";  path: "+this.getPath()}
return sInfo};return AnimationPathMotionNode}(AnimationBaseNode);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var AnimationSetNode=function(_super){__extends(
AnimationSetNode,_super);function AnimationSetNode(aNodeInfo,aParentNode,aNodeContext){
var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;
_this.sClassName="AnimationSetNode";return _this}AnimationSetNode.prototype.createActivity=function(
){var aAnimation=createPropertyAnimation(this.getAttributeName(),this.getAnimatedElement(),
this.aNodeContext._context.nSlideWidth,this.aNodeContext._context.nSlideHeight);
var aActivityParamSet=this.fillActivityParams();return new SetActivity(aActivityParamSet,this,
aAnimation)};return AnimationSetNode}(AnimationBaseNode2);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var AnimationTransformNode=function(_super){__extends(
AnimationTransformNode,_super);function AnimationTransformNode(aNodeInfo,aParentNode,aNodeContext){
var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;
_this.sClassName="AnimationTransformNode";return _this}
AnimationTransformNode.isValidTransformation=function(sType){
return sType==="translate"||sType==="scale"||sType==="rotate"||sType==="skewX"||sType==="skewY"};
AnimationTransformNode.prototype.parseNodeInfo=function(){_super.prototype.parseNodeInfo.call(this);
var aNodeInfo=this.aNodeInfo;if(!AnimationTransformNode.isValidTransformation(this.getTransformType(
))){this.eCurrentState=NodeState.Invalid;window.app.console.log(
"AnimationTransformNode.parseElement: transformation type not found: "+this.getTransformType())
}else{this.attributeName=this.getTransformType()}};
AnimationTransformNode.prototype.createActivity=function(){
var aActivityParamSet=this.fillActivityParams();var aAnimation=null;if(this.getAttributeName(
)==="scale"||this.getAttributeName()==="translate"){aAnimation=createPairPropertyAnimation(
this.getAttributeName(),this.getAnimatedElement(),this.aNodeContext._context.nSlideWidth,
this.aNodeContext._context.nSlideHeight)}else{aAnimation=createPropertyAnimation(
this.getAttributeName(),this.getAnimatedElement(),this.aNodeContext._context.nSlideWidth,
this.aNodeContext._context.nSlideHeight)}if(!aAnimation){window.app.console.log(
"AnimationTransformNode.createActivity: failed to create animation.");return null}
var aInterpolator=null;return createActivity(aActivityParamSet,this,aAnimation,aInterpolator)};
AnimationTransformNode.prototype.getTransformType=function(){
return this.aNodeInfo.transformType.toLowerCase()};return AnimationTransformNode}(AnimationBaseNode3
);var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var TransitionFilterInfo=function(){
function TransitionFilterInfo(type,subtype,isDirectionForward,isModeIn,fadeColor){if(
isDirectionForward===void 0){isDirectionForward=true}if(isModeIn===void 0){isModeIn=true}
this.transitionType=null;this.transitionSubtype=null;this.isDirectionForward=true;this.isModeIn=true
this.fadeColor=null;this.transitionType=type;this.transitionSubtype=subtype;
this.isDirectionForward=isDirectionForward;this.isModeIn=isModeIn;this.fadeColor=fadeColor}
TransitionFilterInfo.fromSlideInfo=function(slideInfo){
var transitionFilterInfo=new TransitionFilterInfo;if(!slideInfo)return null;if(
slideInfo.transitionType)transitionFilterInfo.transitionType=stringToTransitionTypeMap[
slideInfo.transitionType];if(slideInfo.transitionSubtype
)transitionFilterInfo.transitionSubtype=stringToTransitionSubTypeMap[slideInfo.transitionSubtype];
if(typeof slideInfo.transitionDirection==="boolean"
)transitionFilterInfo.isDirectionForward=slideInfo.transitionDirection;if(
slideInfo.transitionFadeColor)transitionFilterInfo.fadeColor=slideInfo.transitionFadeColor;
return transitionFilterInfo};return TransitionFilterInfo}();
var AnimationTransitionFilterNode=function(_super){__extends(AnimationTransitionFilterNode,_super);
function AnimationTransitionFilterNode(aNodeInfo,aParentNode,aNodeContext){var _this=_super.call(
this,aNodeInfo,aParentNode,aNodeContext)||this;_this.bIsReverseDirection=false;
_this.sClassName="AnimationTransitionFilterNode";return _this}
AnimationTransitionFilterNode.prototype.parseNodeInfo=function(){
_super.prototype.parseNodeInfo.call(this);var bIsValidTransition=true;var aNodeInfo=this.aNodeInfo;
this.eTransitionType=undefined;if(aNodeInfo.transitionType&&stringToTransitionTypeMap[
aNodeInfo.transitionType]in TransitionType){this.eTransitionType=stringToTransitionTypeMap[
aNodeInfo.transitionType]}else{bIsValidTransition=false;window.app.console.log(
"AnimationTransitionFilterNode.parseElement: transition type not valid: "+aNodeInfo.transitionType)}
this.eTransitionSubType=undefined;if(!aNodeInfo.transitionSubType
)aNodeInfo.transitionSubType="Default";if(stringToTransitionSubTypeMap[aNodeInfo.transitionSubType
]in TransitionSubType){this.eTransitionSubType=stringToTransitionSubTypeMap[
aNodeInfo.transitionSubType]}else{bIsValidTransition=false;window.app.console.log(
"AnimationTransitionFilterNode.parseElement: transition subtype not valid: "+aNodeInfo.transitionSubType
)}if(!bIsValidTransition){this.eTransitionType=TransitionType.FADE;
this.eTransitionSubType=TransitionSubType.CROSSFADE;window.app.console.log(
"AnimationTransitionFilterNode.parseElement: in place of the invalid transition a crossfade transition is used"
)}this.bIsReverseDirection=aNodeInfo.transitionDirection==="reverse";
this.eTransitionMode=TransitionMode.in;if(
aNodeInfo.transitionMode&&aNodeInfo.transitionMode in TransitionMode){
var sMode=aNodeInfo.transitionMode;this.eTransitionMode=TransitionMode[sMode]}};
AnimationTransitionFilterNode.prototype.createActivity=function(){
var aActivityParamSet=this.fillActivityParams();if(
!this.aNodeContext._context.aSlideShowHandler.isGlSupported()){var bModeIn=this.getTransitionMode(
)==TransitionMode.in;return createCrossFadeTransition(aActivityParamSet,this.getAnimatedElement(),
this.aNodeContext._context.nSlideWidth,this.aNodeContext._context.nSlideHeight,bModeIn)}
return createShapeTransition(aActivityParamSet,this.getAnimatedElement(),
this.aNodeContext._context.nSlideWidth,this.aNodeContext._context.nSlideHeight,this)};
AnimationTransitionFilterNode.prototype.getTransitionType=function(){return this.eTransitionType};
AnimationTransitionFilterNode.prototype.getTransitionSubtype=function(){
return this.eTransitionSubType};AnimationTransitionFilterNode.prototype.getTransitionMode=function(
){return this.eTransitionMode};AnimationTransitionFilterNode.prototype.getReverseDirection=function(
){return this.bIsReverseDirection};AnimationTransitionFilterNode.prototype.info=function(verbose){
if(verbose===void 0){verbose=false}var sInfo=_super.prototype.info.call(this,verbose);if(verbose){
if(this.getTransitionType())sInfo+="; type: "+TransitionType[this.getTransitionType()];if(
this.getTransitionSubtype())sInfo+="; subtype: "+TransitionSubType[this.getTransitionSubtype()];
sInfo+="; is reverse direction: "+this.getReverseDirection();sInfo+="; mode: "+TransitionMode[
this.getTransitionMode()]}return sInfo};return AnimationTransitionFilterNode}(AnimationBaseNode);
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var BaseContainerNode=function(_super){__extends(BaseContainerNode,_super);
function BaseContainerNode(aNodeInfo,aParentNode,aNodeContext){var _this=_super.call(this,aNodeInfo,
aParentNode,aNodeContext)||this;_this.bIsEffect=false;_this.sClassName="BaseContainerNode";
_this.bIsContainer=true;_this.aChildrenArray=[];_this.nFinishedChildren=0;
_this.bDurationIndefinite=false;_this.nLeftIterations=1;_this.eImpressNodeType=undefined;
return _this}BaseContainerNode.prototype.parseNodeInfo=function(){var e_1,_a;
_super.prototype.parseNodeInfo.call(this);var aNodeInfo=this.aNodeInfo;if(this.getParentNode(
)&&this.getParentNode().isMainSequenceRootNode()){if(this.getBegin().getEventType(
)!==EventTrigger.OnNext){this.bIsFirstAutoEffect=true}}this.eImpressNodeType=ImpressNodeType.Default
if(aNodeInfo.nodeType&&aNodeInfo.nodeType in ImpressNodeType){
var sImpressNodeType=aNodeInfo.nodeType;this.eImpressNodeType=ImpressNodeType[sImpressNodeType]}
this.bIsMainSequenceRootNode=this.eImpressNodeType===ImpressNodeType.MainSequence;
this.bIsInteractiveSequenceRootNode=this.eImpressNodeType===ImpressNodeType.InteractiveSequence;
this.bIsEffect=!!this.aNodeInfo.presetId;try{for(var _b=__values(this.aChildrenArray),_c=_b.next(
);!_c.done;_c=_b.next()){var childNode=_c.value;childNode.parseNodeInfo()}}catch(e_1_1){e_1={
error:e_1_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}
}this.bDurationIndefinite=(!this.getDuration()||this.getDuration().isIndefinite())&&(!this.getEnd(
)||this.getEnd().getType()!=TimingType.Offset)};
BaseContainerNode.prototype.appendChildNode=function(aAnimationNode){if(!this.checkValidNode()
)return;if(aAnimationNode.registerDeactivatingListener(this))this.aChildrenArray.push(aAnimationNode
)};BaseContainerNode.prototype.removeAllChildrenNodes=function(){this.aChildrenArray=[]};
BaseContainerNode.prototype.init_st=function(){this.nLeftIterations=this.getRepeatCount();
return this.init_children()};BaseContainerNode.prototype.init_children=function(){
this.nFinishedChildren=0;var nChildrenCount=this.aChildrenArray.length;var nInitChildren=0;for(
var i=0;i<nChildrenCount;++i){if(this.aChildrenArray[i].init()){++nInitChildren}}
return nChildrenCount===nInitChildren};BaseContainerNode.prototype.deactivate_st=function(eDestState
){this.nLeftIterations=0;if(eDestState===NodeState.Frozen){this.forEachChildNode(
BaseNode.prototype.deactivate,~(NodeState.Frozen|NodeState.Ended))}else{this.forEachChildNode(
BaseNode.prototype.end,~NodeState.Ended);if(this.getFillMode()===FillModes.Remove)this.removeEffect(
)}};BaseContainerNode.prototype.hasPendingAnimation=function(){
var nChildrenCount=this.aChildrenArray.length;for(var i=0;i<nChildrenCount;++i){if(
this.aChildrenArray[i].hasPendingAnimation())return true}return false};
BaseContainerNode.prototype.isDurationIndefinite=function(){return this.bDurationIndefinite};
BaseContainerNode.prototype.isChildNode=function(aAnimationNode){
var nChildrenCount=this.aChildrenArray.length;for(var i=0;i<nChildrenCount;++i){if(
this.aChildrenArray[i].getId()==aAnimationNode.getId())return true}return false};
BaseContainerNode.prototype.notifyDeactivatedChild=function(aChildNode){assert(aChildNode.getState(
)==NodeState.Frozen||aChildNode.getState()==NodeState.Ended,
"BaseContainerNode.notifyDeactivatedChild: passed child node is neither in FROZEN nor in ENDED state"
);assert(this.getState()!==NodeState.Invalid,
"BaseContainerNode.notifyDeactivatedChild: this node is invalid");if(!this.isChildNode(aChildNode)){
window.app.console.log("BaseContainerNode.notifyDeactivatedChild: unknown child notifier!");
return false}var nChildrenCount=this.aChildrenArray.length;assert(
this.nFinishedChildren<nChildrenCount,
"BaseContainerNode.notifyDeactivatedChild: assert(this.nFinishedChildren < nChildrenCount) failed");
++this.nFinishedChildren;var bFinished=this.nFinishedChildren>=nChildrenCount;if(
bFinished&&this.isDurationIndefinite()){if(this.nLeftIterations>=1){this.nLeftIterations-=1}if(
this.nLeftIterations>=1){bFinished=false;var aRepetitionEvent=makeDelay(this.repeat.bind(this),0);
this._context.aTimerEventQueue.addEvent(aRepetitionEvent)}else{this.deactivate()}}return bFinished};
BaseContainerNode.prototype.repeat=function(){this.forEachChildNode(BaseNode.prototype.end,
~NodeState.Ended);this.removeEffect();var bInitialized=this.init_children();if(bInitialized
)this.activate_st();return bInitialized};BaseContainerNode.prototype.removeEffect=function(){
var nChildrenCount=this.aChildrenArray.length;if(nChildrenCount==0)return;for(
var i=nChildrenCount-1;i>=0;--i){if((this.aChildrenArray[i].getState()&(
NodeState.Frozen|NodeState.Ended))==0){window.app.console.log(
"BaseContainerNode.removeEffect: child(id:"+this.aChildrenArray[i].getId(
)+") is neither frozen nor ended;"+" state: "+NodeState[this.aChildrenArray[i].getState()]);continue
}this.aChildrenArray[i].removeEffect()}};
BaseContainerNode.prototype.saveStateOfAnimatedElement=function(){
var nChildrenCount=this.aChildrenArray.length;for(var i=0;i<nChildrenCount;++i){this.aChildrenArray[
i].saveStateOfAnimatedElement()}};BaseContainerNode.prototype.forEachChildNode=function(aFunction,
eNodeStateMask){var e_2,_a;if(!eNodeStateMask)eNodeStateMask=-1;try{for(var _b=__values(
this.aChildrenArray),_c=_b.next();!_c.done;_c=_b.next()){var childNode=_c.value;if(
eNodeStateMask!=-1&&(childNode.getState()&eNodeStateMask)==0)continue;aFunction.call(childNode)}
}catch(e_2_1){e_2={error:e_2_1}}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(
e_2)throw e_2.error}}};BaseContainerNode.prototype.getImpressNodeType=function(){
return this.eImpressNodeType};BaseContainerNode.prototype.dispose=function(){
var nChildrenCount=this.aChildrenArray.length;for(var i=0;i<nChildrenCount;++i){this.aChildrenArray[
i].dispose()}_super.prototype.dispose.call(this)};BaseContainerNode.prototype.info=function(verbose
){var e_3,_a;var sInfo=_super.prototype.info.call(this,verbose);if(verbose){if(
this.getImpressNodeType())sInfo+="; [31mnodeType: "+ImpressNodeType[this.getImpressNodeType()
]+"[m"}try{for(var _b=__values(this.aChildrenArray),_c=_b.next();!_c.done;_c=_b.next()){
var child=_c.value;sInfo+="\n";sInfo+=child.info(verbose)}}catch(e_3_1){e_3={error:e_3_1}}finally{
try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_3)throw e_3.error}}return sInfo};
BaseContainerNode.prototype.isEmpty=function(){return this.aChildrenArray.length===0};
return BaseContainerNode}(BaseNode);var ParallelTimeContainer=function(_super){__extends(
ParallelTimeContainer,_super);function ParallelTimeContainer(aNodeInfo,aParentNode,aNodeContext){
var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;
_this.sClassName="ParallelTimeContainer";return _this}
ParallelTimeContainer.prototype.activate_st=function(){var nChildrenCount=this.aChildrenArray.length
var nResolvedChildren=0;for(var i=0;i<nChildrenCount;++i){if(this.aChildrenArray[i].resolve()){
++nResolvedChildren}}if(nChildrenCount!=nResolvedChildren){window.app.console.log(
"ParallelTimeContainer.activate_st: resolving all children failed");return}if(
this.isDurationIndefinite()&&nChildrenCount==0){this.scheduleDeactivationEvent(
this.makeDeactivationEvent(0))}else{this.scheduleDeactivationEvent()}};
ParallelTimeContainer.prototype.notifyDeactivating=function(aAnimationNode){
this.notifyDeactivatedChild(aAnimationNode)};return ParallelTimeContainer}(BaseContainerNode);
var SequentialTimeContainer=function(_super){__extends(SequentialTimeContainer,_super);
function SequentialTimeContainer(aNodeInfo,aParentNode,aNodeContext){var _this=_super.call(this,
aNodeInfo,aParentNode,aNodeContext)||this;_this.sClassName="SequentialTimeContainer";
_this.bIsRewinding=false;_this.aCurrentSkipEvent=null;_this.aRewindCurrentEffectEvent=null;
_this.aRewindLastEffectEvent=null;return _this}
SequentialTimeContainer.prototype.activate_st=function(){
var nChildrenCount=this.aChildrenArray.length;for(
;this.nFinishedChildren<nChildrenCount;++this.nFinishedChildren){if(this.resolveChild(
this.aChildrenArray[this.nFinishedChildren]))break;else window.app.console.log(
"SequentialTimeContainer("+this.getId(
)+").activate_st: resolving child("+this.nFinishedChildren+") failed!")}if(
this.isDurationIndefinite()&&(nChildrenCount==0||this.nFinishedChildren>=nChildrenCount)){
this.scheduleDeactivationEvent(this.makeDeactivationEvent(0))}else{this.scheduleDeactivationEvent()}
};SequentialTimeContainer.prototype.notifyDeactivating=function(aNotifier){if(this.bIsRewinding
)return;if(this.notifyDeactivatedChild(aNotifier))return;assert(
this.nFinishedChildren<this.aChildrenArray.length,
"SequentialTimeContainer.notifyDeactivating: assertion (this.nFinishedChildren < this.aChildrenArray.length) failed"
);var aNextChild=this.aChildrenArray[this.nFinishedChildren];assert(aNextChild.getState(
)===NodeState.Unresolved,
"SequentialTimeContainer.notifyDeactivating: assertion (aNextChild.getState == UNRESOLVED_NODE) failed"
);if(!this.resolveChild(aNextChild)){this.deactivate()}};
SequentialTimeContainer.prototype.skipEffect=function(aChildNode){if(this.isChildNode(aChildNode)){
this.getContext().aActivityQueue.endAll();this.getContext().bIsSkipping=true;this.getContext(
).aTimerEventQueue.forceEmpty();this.getContext().bIsSkipping=false;var aEvent=makeEvent(
aChildNode.deactivate.bind(aChildNode));this.getContext().aTimerEventQueue.addEvent(aEvent)}else{
window.app.console.log("SequentialTimeContainer.skipEffect: unknown child: "+aChildNode.getId())}};
SequentialTimeContainer.prototype.rewindCurrentEffect=function(aChildNode){if(this.isChildNode(
aChildNode)){assert(!this.bIsRewinding,
"SequentialTimeContainer.rewindCurrentEffect: is already rewinding.");this.bIsRewinding=true;
this.getContext().aActivityQueue.endAll();this.getContext().bIsSkipping=true;this.getContext(
).aTimerEventQueue.forceEmpty();this.getContext().bIsSkipping=false;this.getContext(
).aActivityQueue.endAll();aChildNode.end();aChildNode.removeEffect();aChildNode.init();
this.resolveChild(aChildNode);this.notifyRewindedEvent(aChildNode);this.bIsRewinding=false}else{
window.app.console.log(
"SequentialTimeContainer.rewindCurrentEffect: unknown child: "+aChildNode.getId())}};
SequentialTimeContainer.prototype.rewindLastEffect=function(aChildNode){if(this.isChildNode(
aChildNode)){assert(!this.bIsRewinding,
"SequentialTimeContainer.rewindLastEffect: is already rewinding.");this.bIsRewinding=true;
this.getContext().aTimerEventQueue.forceEmpty();this.getContext().aActivityQueue.clear();
aChildNode.end();--this.nFinishedChildren;var aPreviousChildNode=this.aChildrenArray[
this.nFinishedChildren];aPreviousChildNode.removeEffect();aPreviousChildNode.init();aChildNode.init(
);this.resolveChild(aPreviousChildNode);this.notifyRewindedEvent(aChildNode);this.bIsRewinding=false
}else{window.app.console.log(
"SequentialTimeContainer.rewindLastEffect: unknown child: "+aChildNode.getId())}};
SequentialTimeContainer.prototype.resolveChild=function(aChildNode){
var bResolved=aChildNode.resolve();if(bResolved&&(this.isMainSequenceRootNode(
)||this.isInteractiveSequenceRootNode())){if(this.aCurrentSkipEvent)this.aCurrentSkipEvent.dispose()
this.aCurrentSkipEvent=makeEvent(this.skipEffect.bind(this,aChildNode));if(
this.aRewindCurrentEffectEvent)this.aRewindCurrentEffectEvent.dispose();
this.aRewindCurrentEffectEvent=makeEvent(this.rewindCurrentEffect.bind(this,aChildNode));if(
this.aRewindLastEffectEvent)this.aRewindLastEffectEvent.dispose();
this.aRewindLastEffectEvent=makeEvent(this.rewindLastEffect.bind(this,aChildNode));if(
this.isMainSequenceRootNode()){this._context.aEventMultiplexer.registerSkipEffectEvent(
this.aCurrentSkipEvent);this._context.aEventMultiplexer.registerRewindCurrentEffectEvent(
this.aRewindCurrentEffectEvent);this._context.aEventMultiplexer.registerRewindLastEffectEvent(
this.aRewindLastEffectEvent)}else if(this.isInteractiveSequenceRootNode()){
this._context.aEventMultiplexer.registerSkipInteractiveEffectEvent(aChildNode.getId(),
this.aCurrentSkipEvent);this._context.aEventMultiplexer.registerRewindRunningInteractiveEffectEvent(
aChildNode.getId(),this.aRewindCurrentEffectEvent);
this._context.aEventMultiplexer.registerRewindEndedInteractiveEffectEvent(aChildNode.getId(),
this.aRewindLastEffectEvent)}}return bResolved};
SequentialTimeContainer.prototype.notifyRewindedEvent=function(aChildNode){if(
this.isInteractiveSequenceRootNode()){this._context.aEventMultiplexer.notifyRewindedEffectEvent(
aChildNode.getId());var sId=aChildNode.getBegin().getEventBaseElementId();if(sId){
this._context.aEventMultiplexer.notifyRewindedEffectEvent(sId)}}};
SequentialTimeContainer.prototype.dispose=function(){if(this.aCurrentSkipEvent
)this.aCurrentSkipEvent.dispose();_super.prototype.dispose.call(this)};
return SequentialTimeContainer}(BaseContainerNode);var NodeContext=function(){function NodeContext(
aSlideShowContext){this._context=null;this.aAnimationNodeMap=null;this.aAnimatedElementMap=null;
this.aSourceEventElementMap=null;this.metaSlide=null;this.nStartDelay=0;this.bFirstRun=undefined;
this.bIsInvalid=false;this._context=aSlideShowContext}
NodeContext.prototype.makeSourceEventElement=function(sId,aSlideShow){if(
!this._context.aEventMultiplexer){window.app.console.log(
"NodeContext.makeSourceEventElement: event multiplexer not initialized");return null}if(
!this.aSourceEventElementMap.has(sId)){var triggerInfo=this.metaSlide.getTriggerInfo(sId);if(
!triggerInfo){window.app.console.log(
"NodeContext.makeSourceEventElement: no bounds found for event trigger: "+sId);return null}
this.aSourceEventElementMap.set(sId,new SourceEventElement(sId,this._context._canvas,
triggerInfo.bounds,triggerInfo.index,aSlideShow,this._context.aEventMultiplexer))}
return this.aSourceEventElementMap.get(sId)};return NodeContext}();
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var PropertyAnimationNode=function(_super){__extends(
PropertyAnimationNode,_super);function PropertyAnimationNode(aNodeInfo,aParentNode,aNodeContext){
var _this=_super.call(this,aNodeInfo,aParentNode,aNodeContext)||this;
_this.sClassName="PropertyAnimationNode";return _this}
PropertyAnimationNode.prototype.createActivity=function(){
var aActivityParamSet=this.fillActivityParams();var aAnimation=createPropertyAnimation(
this.getAttributeName(),this.getAnimatedElement(),this.aNodeContext._context.nSlideWidth,
this.aNodeContext._context.nSlideHeight);if(!aAnimation){window.app.console.log(
"PropertyAnimationNode.createActivity: failed to create animation.");return null}
var aInterpolator=null;return createActivity(aActivityParamSet,this,aAnimation,aInterpolator)};
return PropertyAnimationNode}(AnimationBaseNode3);var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var NSS_SVG="http://www.w3.org/2000/svg";var PropertyValueType;(function(PropertyValueType){
PropertyValueType[PropertyValueType["Unknown"]=0]="Unknown";PropertyValueType[PropertyValueType[
"Number"]=1]="Number";PropertyValueType[PropertyValueType["Enum"]=2]="Enum";PropertyValueType[
PropertyValueType["Color"]=3]="Color";PropertyValueType[PropertyValueType["String"]=4]="String";
PropertyValueType[PropertyValueType["Bool"]=5]="Bool";PropertyValueType[PropertyValueType[
"TupleNumber"]=6]="TupleNumber"})(PropertyValueType||(PropertyValueType={}));var PropertyOperators;(
function(PropertyOperators){var GenericPropOpSet={equal:function(a,b){return a===b},add:function(a,b
){return a},scale:function(k,v){return v}};var NumberPropOpSet={equal:function(a,b){return a===b},
add:function(a,b){return a+b},scale:function(k,v){return k*v}};var TupleNumberPropOpSet={
equal:function(a,b){assert(a.length===b.length,"Tuples length mismatch.");return a.toString(
)===b.toString()},add:function(a,b){assert(a.length===b.length,"Tuples length mismatch.");var r=[];
for(var i=0;i<a.length;++i){r.push(a[i]+b[i])}return r},scale:function(k,v){var r=[];for(
var i=0;i<v.length;++i){r.push(k*v[i])}return r}};var ColorPropOpSet={equal:function(a,b){
return a.equal(b)},add:function(a,b){var c=a.clone();c.add(b);return c},scale:function(k,v){
var c=v.clone();c.scale(k);return c}};PropertyOperators.aOperatorSetMap=new Map;
PropertyOperators.aOperatorSetMap.set(PropertyValueType.Number,NumberPropOpSet);
PropertyOperators.aOperatorSetMap.set(PropertyValueType.Enum,GenericPropOpSet);
PropertyOperators.aOperatorSetMap.set(PropertyValueType.String,GenericPropOpSet);
PropertyOperators.aOperatorSetMap.set(PropertyValueType.Bool,GenericPropOpSet);
PropertyOperators.aOperatorSetMap.set(PropertyValueType.TupleNumber,TupleNumberPropOpSet);
PropertyOperators.aOperatorSetMap.set(PropertyValueType.Color,ColorPropOpSet)})(PropertyOperators||(
PropertyOperators={}));var aOperatorSetMap=PropertyOperators.aOperatorSetMap;
var PropertyInterpolator;(function(PropertyInterpolator){function getInterpolator(eValueType,
eValueSubType,eClockDirection){switch(eValueType){case PropertyValueType.Number:return function(
nFrom,nTo,nT){return(1-nT)*nFrom+nT*nTo};case PropertyValueType.TupleNumber:return function(aFrom,
aTo,nT){var aRes=[];for(var i=0;i<aFrom.length;++i){aRes.push((1-nT)*aFrom[i]+nT*aTo[i])}return aRes
};case PropertyValueType.Color:if(eValueSubType!==undefined){switch(eValueSubType){
case ColorSpace.rgb:return function(nFrom,nTo,nT){return RGBColor.interpolate(nFrom,nTo,nT)};
case ColorSpace.hsl:{var bCCW_1=eClockDirection==ClockDirection.counterClockwise;return function(
nFrom,nTo,nT){return HSLColor.interpolate(nFrom,nTo,nT,bCCW_1)}}}}else{window.app.console.log(
"PropertyInterpolator.getInterpolator: color space not defined.")}break;default:
window.app.console.log(
"PropertyInterpolator.getInterpolator: not found any valid interpolator for value type "+PropertyValueType[
eValueType])}return null}PropertyInterpolator.getInterpolator=getInterpolator})(
PropertyInterpolator||(PropertyInterpolator={}));var aPropertyGetterSetterMap={height:{
type:PropertyValueType.Number,get:"getHeight",set:"setHeight",getmod:"makeScaler( 1/nHeight )",
setmod:"makeScaler( nHeight)"},opacity:{type:PropertyValueType.Number,get:"getOpacity",
set:"setOpacity"},scale:{type:PropertyValueType.TupleNumber,get:"getSize",set:"setSize"},translate:{
type:PropertyValueType.TupleNumber,get:"getPos",set:"setPos"},rotate:{type:PropertyValueType.Number,
get:"getRotationAngle",set:"setRotationAngle"},skewx:{type:PropertyValueType.Number,get:"getSkewX",
set:"setSkewX"},skewy:{type:PropertyValueType.Number,get:"getSkewY",set:"setSkewY"},width:{
type:PropertyValueType.Number,get:"getWidth",set:"setWidth",getmod:"makeScaler( 1/nWidth )",
setmod:"makeScaler( nWidth)"},x:{type:PropertyValueType.Number,get:"getX",set:"setX",
getmod:"makeScaler( 1/nWidth )",setmod:"makeScaler( nWidth)"},y:{type:PropertyValueType.Number,
get:"getY",set:"setY",getmod:"makeScaler( 1/nHeight )",setmod:"makeScaler( nHeight)"},visibility:{
type:PropertyValueType.Enum,get:"getVisibility",set:"setVisibility"},fillstyle:{
type:PropertyValueType.String,get:"getFillStyle",set:"setFillStyle"},linestyle:{
type:PropertyValueType.String,get:"getLineStyle",set:"setLineStyle"},fillcolor:{
type:PropertyValueType.Color,get:"getFillColor",set:"setFillColor"},linecolor:{
type:PropertyValueType.Color,get:"getStrokeColor",set:"setStrokeColor"},charcolor:{
type:PropertyValueType.Color,get:"getFontColor",set:"setFontColor"},dimcolor:{
type:PropertyValueType.Color,get:"getDimColor",set:"setDimColor"}};
var TransitionFiltersManager=function(){function TransitionFiltersManager(){
this.filterQueue=new Array;this.frameInfoMap=new Map}
TransitionFiltersManager.prototype.isEmpty=function(){return this.filterQueue.length===0};
TransitionFiltersManager.prototype.add=function(animation,time){this.frameInfoMap.set(
animation.getNodeId(),{animation:animation,time:time});this.updateQueue(animation.getNodeId())};
TransitionFiltersManager.prototype.updateQueue=function(nodeId){var length=this.filterQueue.length;
var last=this.filterQueue[length];if(nodeId===last)return;var index=this.filterQueue.indexOf(nodeId)
if(index>-1){this.filterQueue.splice(index,1)}this.filterQueue.push(nodeId)};
TransitionFiltersManager.prototype.apply=function(properties){var _this=this;var applied=false;
this.filterQueue.forEach(function(nodeId){var frameInfo=_this.frameInfoMap.get(nodeId);if(frameInfo
){applied=true;ANIMDBG.print("TransitionFiltersManager.apply: node: "+nodeId);
frameInfo.animation.renderFrame(frameInfo.time,properties)}});return applied};
TransitionFiltersManager.prototype.clear=function(){this.frameInfoMap.forEach(function(frameInfo){
frameInfo.animation.notifySlideEnd()});this.filterQueue=[];this.frameInfoMap.clear()};
TransitionFiltersManager.prototype.getState=function(){return{filterQueue:structuredClone(
this.filterQueue),frameInfoMap:new Map(this.frameInfoMap)}};
TransitionFiltersManager.prototype.setState=function(state){this.filterQueue=structuredClone(
state.filterQueue);this.frameInfoMap=new Map(state.frameInfoMap)};return TransitionFiltersManager}()
function BBoxToString(aBB){
return"{ x: "+aBB.x+", y: "+aBB.y+", width: "+aBB.width+", height: "+aBB.height+" }"}
var AnimatedElement=function(){function AnimatedElement(sId,slideHash,title,slideWidth,slideHeight){
this.animatedLayerInfo=null;this.aLayer=null;this.aBaseBBox=null;this.nBaseCenterX=0;
this.nBaseCenterY=0;this.eAdditiveMode=AdditiveMode.Replace;this.aStateSet=new Map;
this.aStateOnNextEffectSet=new Map;this.nScaleFactorX=1;this.nScaleFactorY=1;this.nRotationAngle=0;
this.nSkewX=0;this.nSkewY=0;this.aBaseFillColor=AnimatedElement.DefaultColor;
this.aFillColor=AnimatedElement.DefaultColor;this.aBaseLineColor=AnimatedElement.DefaultColor;
this.aLineColor=AnimatedElement.DefaultColor;this.aBaseFontColor=AnimatedElement.DefaultColor;
this.aFontColor=AnimatedElement.DefaultColor;this.aDimColor=AnimatedElement.DefaultColor;
this.aClipPath=null;this.runningAnimations=0;this.activeAnimationNodes=new Map;ANIMDBG.print(
"AnimatedElement("+sId+", "+slideHash+")");this.sId=sId;this.slideHash=slideHash;this._title=title;
this.slideWidth=slideWidth;this.slideHeight=slideHeight;this.bIsValid=false;
this.transitionFiltersManager=new TransitionFiltersManager;var presenter=app.map.slideShowPresenter;
this.slideRenderer=presenter._slideRenderer}AnimatedElement.prototype.getId=function(){
return this.sId};AnimatedElement.prototype.isValid=function(){return this.bIsValid};
AnimatedElement.prototype.getTitle=function(){return this._title};
AnimatedElement.prototype.isGlSupported=function(){return!this.tfContext.is2dGl()};
AnimatedElement.prototype.isTextElement=function(){return false};
AnimatedElement.prototype.cloneBBox=function(aBBox){if(!aBBox)return null;return new DOMRect(aBBox.x
,aBBox.y,aBBox.width,aBBox.height)};AnimatedElement.prototype.createBaseElement=function(layer,
bounds){var canvas=new OffscreenCanvas(bounds.width,bounds.height);var context=canvas.getContext(
"2d");context.drawImage(layer,bounds.x,bounds.y,bounds.width,bounds.height,0,0,bounds.width,
bounds.height);return canvas.transferToImageBitmap()};AnimatedElement.prototype.clone=function(
aElement){if(!aElement)return null;var canvas=new OffscreenCanvas(aElement.width,aElement.height);
var context=canvas.getContext("2d");context.drawImage(aElement,0,0,canvas.width,canvas.height);
return canvas.transferToImageBitmap()};AnimatedElement.prototype.updateCanvasSize=function(size){
this.canvasWidth=size[0];this.canvasHeight=size[1];this.canvasScaleFactor={
x:this.canvasWidth/this.slideWidth,y:this.canvasHeight/this.slideHeight};app.console.debug(
"AnimatedElement.updateCanvasSize: ("+this.canvasWidth+"x"+this.canvasHeight+"), scale factor: "+this.canvasScaleFactor
)};AnimatedElement.prototype.updateAnimationInfo=function(animatedLayerInfo){var _a;if(
!animatedLayerInfo){this.aBaseBBox=new DOMRect(0,0,1920,1080);window.app.console.log(
"AnimatedElement.updateAnimationInfo: passed info is not valid");return}
this.animatedLayerInfo=animatedLayerInfo;this.aLayer=this.animatedLayerInfo.content.data;if(
!this.aLayer){window.app.console.log("AnimatedElement.updateAnimationInfo: layer not valid")}
this.aBaseBBox=this.cloneBBox(this.animatedLayerInfo.bounds);_a=getRectCenter(this.aBaseBBox),
this.nBaseCenterX=_a.x,this.nBaseCenterY=_a.y;this.aBBoxInCanvas=convert(this.canvasScaleFactor,
this.aBaseBBox);this.aBaseElement=this.createBaseElement(this.aLayer,this.aBBoxInCanvas);if(
this.animatedLayerInfo.fillColor){this.aBaseFillColor=colorParser(this.animatedLayerInfo.fillColor)}
if(this.animatedLayerInfo.lineColor){this.aBaseLineColor=colorParser(
this.animatedLayerInfo.lineColor)}if(this.animatedLayerInfo.fontColor){
this.aBaseFontColor=colorParser(this.animatedLayerInfo.fontColor)}this.DBG(
".updateAnimationInfo: "+("\n  aBaseBBox: "+BBoxToString(this.aBaseBBox))+(
"\n  aBBoxInCanvas: "+BBoxToString(this.aBBoxInCanvas))+(
"\n  base center: x: "+this.nBaseCenterX+" y: "+this.nBaseCenterY));this.bIsValid=true};
AnimatedElement.prototype.getTextureFromElement=function(element){return this.tfContext.loadTexture(
element)};AnimatedElement.prototype.setTransitionParameters=function(transitionParameters){if(
!this.tfContext){var layerCompositor=this.getLayerCompositor();if(!layerCompositor){
window.app.console.error("AnimatedElement.setTransitionParameters: layer compositor is undefined");
return}this.tfContext=layerCompositor.getLayerRendererContext();if(!this.tfContext){
window.app.console.error(
"AnimatedElement.setTransitionParameters: layer renderer context is undefined");return}}
transitionParameters.context=this.tfContext;transitionParameters.current=null;
transitionParameters.next=this.getTextureFromElement(this.aBaseElement)};
AnimatedElement.prototype.resetProperties=function(){this.nCenterX=this.nBaseCenterX;
this.nCenterY=this.nBaseCenterY;this.nScaleFactorX=1;this.nScaleFactorY=1;this.nRotationAngle=0;
this.nSkewX=0;this.nSkewY=0;this.aTMatrix=new DOMMatrix([1,0,0,1,0,0]);this.nOpacity=1;
this.aFillColor=this.aBaseFillColor;this.aLineColor=this.aBaseLineColor;
this.aFontColor=this.aBaseFontColor;
this.bVisible=this.animatedLayerInfo?this.animatedLayerInfo.initVisible:false;
this.transitionFiltersManager.clear()};AnimatedElement.prototype.initClipPath=function(){
this.aClipPath=document.createElementNS(NSS_SVG,"path");var nWidth=this.aActiveBBox.width;
var nHeight=this.aActiveBBox.height;
var sPathData="M "+this.aActiveBBox.x+" "+this.aActiveBBox.y+" h "+nWidth+" v "+nHeight+" h -"+nWidth+" z"
this.aClipPath.setAttribute("d",sPathData)};AnimatedElement.prototype.cleanClipPath=function(){
this.aClipPath=null};AnimatedElement.prototype.getLayerCompositor=function(){
var presenter=app.map.slideShowPresenter;if(presenter){return presenter._slideCompositor}return null
};AnimatedElement.prototype.applyTransitionFilters=function(properties){if(
this.transitionFiltersManager.isEmpty()||!this.isGlSupported()){return false}
return this.transitionFiltersManager.apply(properties)};
AnimatedElement.prototype.renderLayer=function(renderer){if(!this.bVisible)return;if(
renderer instanceof LayerRendererGl)this.renderLayerGl(renderer);else if(
renderer instanceof LayerRenderer2d)this.renderLayer2d(renderer)};
AnimatedElement.prototype.renderLayer2d=function(renderer){if(renderer.isDisposed())return;
var renderContext=renderer.getRenderContext();var renderingContext=renderContext.get2dOffscreen();
renderingContext.save();var sf=this.canvasScaleFactor;renderingContext.globalAlpha=this.nOpacity;
var T=this.aTMatrix;var transform=new DOMMatrix([T.a,T.b,T.c,T.d,T.e*sf.x,T.f*sf.y]);
renderingContext.setTransform(transform);var aElement=this.aBaseElement;app.console.debug(
"AnimatedElement("+this.sId+").renderLayer2d:\n\t\t\t\telement width: "+aElement.width+"\n\t\t\t\telement height: "+aElement.height+"\n\t\t\t\tbase center: ("+this.nBaseCenterX+", "+this.nBaseCenterY+")\n\t\t\t\tactual center: ("+this.nCenterX+", "+this.nCenterY+")\n\t\t\t\ttransform: "+transform.toString(
));renderingContext.drawImage(aElement,0,0,aElement.width,aElement.height,this.aBBoxInCanvas.x,
this.aBBoxInCanvas.y,aElement.width,aElement.height);renderingContext.restore()};
AnimatedElement.prototype.renderLayerGl=function(renderer){var e_1,_a;if(renderer.isDisposed()
)return;var T=this.aTMatrix;app.console.debug(
"AnimatedElement("+this.sId+").renderLayerGl:\n\t\t\t\telement width: "+this.aBaseElement.width+"\n\t\t\t\telement height: "+this.aBaseElement.height+"\n\t\t\t\tbase center: ("+this.nBaseCenterX+", "+this.nBaseCenterY+")\n\t\t\t\tactual center: ("+this.nCenterX+", "+this.nCenterY+")\n\t\t\t\ttransform: "+T.toString(
));var tl=new DOMPoint(this.aBaseBBox.x,this.aBaseBBox.y);var br=new DOMPoint(
tl.x+this.aBaseBBox.width,tl.y+this.aBaseBBox.height);var bl=new DOMPoint(tl.x,br.y);
var tr=new DOMPoint(br.x,tl.y);var unitBounds=[];try{for(var _b=__values([bl,br,tl,tr]),_c=_b.next(
);!_c.done;_c=_b.next()){var v=_c.value;var u=v.matrixTransform(T);u.x=u.x/this.slideWidth;
u.y=u.y/this.slideHeight;unitBounds.push(u)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}}var colorMap={};if(
this.isTextElement()){if(!this.aFontColor.equal(this.aBaseFontColor)){
colorMap.fromFillColor=this.aBaseFontColor;colorMap.toFillColor=this.aFontColor}}else if(
!this.aFillColor.equal(this.aBaseFillColor)||!this.aLineColor.equal(this.aBaseLineColor)){
colorMap.fromFillColor=this.aBaseFillColor;colorMap.toFillColor=this.aFillColor;
colorMap.fromLineColor=this.aBaseLineColor;colorMap.toLineColor=this.aLineColor}var properties={
bounds:unitBounds,alpha:this.nOpacity,colorMap:colorMap};if(this.applyTransitionFilters(properties)
)return;renderer.drawBitmap(this.aBaseElement,properties)};
AnimatedElement.prototype.notifySlideStart=function(aSlideShowContext){if(!aSlideShowContext){
window.app.console.log("AnimatedElement.notifySlideStart: slideshow context is not valid")}
this.aSlideShowContext=aSlideShowContext;this.runningAnimations=0;this.activeAnimationNodes.clear();
this.nCurrentEffect=undefined;this.aStateOnNextEffectSet.clear();
var aAnimatedLayerInfo=this.aSlideShowContext.aSlideShowHandler.getAnimatedLayerInfo(this.slideHash,
this.sId);this.updateAnimationInfo(aAnimatedLayerInfo);this.resetProperties();this.DBG(
".notifySlideStart invoked")};AnimatedElement.prototype.notifySlideEnd=function(){
this.transitionFiltersManager.clear()};AnimatedElement.prototype.notifyAnimationStart=function(){if(
!this.isActive()){this.slideRenderer.notifyAnimationStarted(this.sId)}++this.runningAnimations};
AnimatedElement.prototype.isActive=function(){return this.runningAnimations>0};
AnimatedElement.prototype.notifyAnimationEnd=function(){if(this.runningAnimations<=0){
window.app.console.log("AnimatedElement.notifyAnimationEnd: running animations <= 0");return}
--this.runningAnimations;if(!this.isActive()){this.slideRenderer.notifyAnimationEnded(this.sId)}};
AnimatedElement.prototype.notifyNextEffectStart=function(nEffectIndex){
this.nCurrentEffect=nEffectIndex;this.activeAnimationNodes.set(this.nCurrentEffect,new Set)};
AnimatedElement.prototype.setToElement=function(aElement){if(!aElement){window.app.console.log(
"AnimatedElement("+this.getId()+").setToElement: element is not valid");return false}
this.aActiveElement=this.clone(aElement);return true};AnimatedElement.prototype.saveState=function(
nAnimationNodeId){ANIMDBG.print("AnimatedElement("+this.getId()+").saveState("+nAnimationNodeId+")")
var aState={nCenterX:this.nCenterX,nCenterY:this.nCenterY,nScaleFactorX:this.nScaleFactorX,
nScaleFactorY:this.nScaleFactorY,nRotationAngle:this.nRotationAngle,nSkewX:this.nSkewX,
nSkewY:this.nSkewY,aTMatrix:DOMMatrix.fromMatrix(this.aTMatrix),nOpacity:this.nOpacity,
aFillColor:this.aFillColor,aLineColor:this.aLineColor,aFontColor:this.aFontColor,
bVisible:this.bVisible,transitionFiltersState:this.transitionFiltersManager.getState()};
this.aStateSet.set(nAnimationNodeId,aState);var currentEffectNodes=this.activeAnimationNodes.get(
this.nCurrentEffect);if(currentEffectNodes){currentEffectNodes.add(nAnimationNodeId);if(
currentEffectNodes.size===1)this.aStateOnNextEffectSet.set(this.nCurrentEffect,aState)}else{
window.app.console.log("AnimatedElement("+this.getId()+").saveState("+nAnimationNodeId+"): "+(
"current effect not found: "+this.nCurrentEffect))}};
AnimatedElement.prototype.restoreState=function(nAnimationNodeId){var _this=this;if(
!this.aStateSet.has(nAnimationNodeId)){window.app.console.log("AnimatedElement("+this.getId(
)+").restoreState: state "+nAnimationNodeId+" is not valid");return false}ANIMDBG.print(
"AnimatedElement("+this.getId()+").restoreState("+nAnimationNodeId+")");
var aState=this.aStateSet.get(nAnimationNodeId);this.activeAnimationNodes.forEach(function(nodes,
effect,map){if(nodes.has(nAnimationNodeId)){nodes.delete(nAnimationNodeId);if(nodes.size===0){
map.delete(effect);var state=_this.aStateOnNextEffectSet.get(effect);if(state)aState=state;
_this.aStateOnNextEffectSet.delete(effect)}return}});var bRet=true;if(bRet){
this.nCenterX=aState.nCenterX;this.nCenterY=aState.nCenterY;this.nScaleFactorX=aState.nScaleFactorX;
this.nScaleFactorY=aState.nScaleFactorY;this.nRotationAngle=aState.nRotationAngle;
this.nSkewX=aState.nSkewX;this.nSkewY=aState.nSkewY;this.aTMatrix=DOMMatrix.fromMatrix(
aState.aTMatrix);this.nOpacity=aState.nOpacity;this.aFillColor=aState.aFillColor;
this.aLineColor=aState.aLineColor;this.aFontColor=aState.aFontColor;this.bVisible=aState.bVisible;
this.transitionFiltersManager.setState(aState.transitionFiltersState)}this.aStateSet.delete(
nAnimationNodeId);this.notifyAnimationStart();this.notifyAnimationEnd();return bRet};
AnimatedElement.prototype.getBaseBBox=function(){return this.aBaseBBox};
AnimatedElement.prototype.getBaseCenterX=function(){return this.nBaseCenterX};
AnimatedElement.prototype.getBaseCenterY=function(){return this.nBaseCenterY};
AnimatedElement.prototype.applyTransform=function(){};
AnimatedElement.prototype.getAdditiveMode=function(){return this.eAdditiveMode};
AnimatedElement.prototype.setAdditiveMode=function(eAdditiveMode){this.eAdditiveMode=eAdditiveMode};
AnimatedElement.prototype.updateTransformationMatrix=function(){var aTMatrix=new DOMMatrix([1,0,0,1,
0,0]);var skewXAngle=180*Math.atan(this.nSkewX)/Math.PI;var skewYAngle=180*Math.atan(this.nSkewY
)/Math.PI;aTMatrix.translateSelf(this.nCenterX,this.nCenterY).rotateSelf(this.nRotationAngle
).scaleSelf(this.nScaleFactorX,this.nScaleFactorY).skewXSelf(skewYAngle).skewXSelf(skewXAngle
).translateSelf(-this.nBaseCenterX,-this.nBaseCenterY);this.aTMatrix=aTMatrix};
AnimatedElement.prototype.getX=function(){return this.nCenterX};
AnimatedElement.prototype.getY=function(){return this.nCenterY};
AnimatedElement.prototype.getPos=function(){return[this.getX(),this.getY()]};
AnimatedElement.prototype.getWidth=function(){return this.nScaleFactorX*this.getBaseBBox().width};
AnimatedElement.prototype.getHeight=function(){return this.nScaleFactorY*this.getBaseBBox().height};
AnimatedElement.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]};
AnimatedElement.prototype.setX=function(nNewCenterX){ANIMDBG.print(
"AnimatedElement.setX("+nNewCenterX+")");if(nNewCenterX===this.nCenterX)return;
this.nCenterX=nNewCenterX;this.updateTransformationMatrix()};
AnimatedElement.prototype.setY=function(nNewCenterY){ANIMDBG.print(
"AnimatedElement.setY("+nNewCenterY+")");if(nNewCenterY===this.nCenterY)return;
this.nCenterY=nNewCenterY;this.updateTransformationMatrix()};
AnimatedElement.prototype.setPos=function(aNewPos){var nNewCenterX=aNewPos[0];
var nNewCenterY=aNewPos[1];ANIMDBG.print("AnimatedElement.setPos("+nNewCenterX+", "+nNewCenterY+")")
if(nNewCenterX===this.nCenterX&&nNewCenterY===this.nCenterY)return;this.nCenterX=nNewCenterX;
this.nCenterY=nNewCenterY;this.updateTransformationMatrix()};
AnimatedElement.prototype.setWidth=function(nNewWidth){ANIMDBG.print(
"AnimatedElement.setWidth("+nNewWidth+")");var nBaseWidth=this.getBaseBBox().width;
var nScaleFactorX=nNewWidth/nBaseWidth;if(Math.abs(nScaleFactorX)<1e-5)nScaleFactorX=Math.sign(
nScaleFactorX)*1e-5;if(nScaleFactorX==this.nScaleFactorX)return;this.nScaleFactorX=nScaleFactorX;
this.updateTransformationMatrix()};AnimatedElement.prototype.setHeight=function(nNewHeight){
ANIMDBG.print("AnimatedElement.setHeight("+nNewHeight+")");var nBaseHeight=this.getBaseBBox().height
var nScaleFactorY=nNewHeight/nBaseHeight;if(Math.abs(nScaleFactorY)<1e-5)nScaleFactorY=Math.sign(
nScaleFactorY)*1e-5;if(nScaleFactorY==this.nScaleFactorY)return;this.nScaleFactorY=nScaleFactorY;
this.updateTransformationMatrix()};AnimatedElement.prototype.setSize=function(aNewSize){
var nNewWidth=aNewSize[0];var nNewHeight=aNewSize[1];ANIMDBG.print(
"AnimatedElement.setSize("+nNewWidth+", "+nNewHeight+")");var nBaseWidth=this.getBaseBBox().width;
var nScaleFactorX=nNewWidth/nBaseWidth;if(Math.abs(nScaleFactorX)<1e-5)nScaleFactorX=Math.sign(
nScaleFactorX)*1e-5;var nBaseHeight=this.getBaseBBox().height;
var nScaleFactorY=nNewHeight/nBaseHeight;if(Math.abs(nScaleFactorY)<1e-5)nScaleFactorY=Math.sign(
nScaleFactorY)*1e-5;if(nScaleFactorX==this.nScaleFactorX&&nScaleFactorY==this.nScaleFactorY)return;
this.nScaleFactorX=nScaleFactorX;this.nScaleFactorY=nScaleFactorY;this.updateTransformationMatrix()}
AnimatedElement.prototype.getOpacity=function(){return this.nOpacity};
AnimatedElement.prototype.setOpacity=function(nValue){this.nOpacity=clampN(nValue,0,1);
ANIMDBG.print("AnimatedElement.setOpacity("+nValue+")")};
AnimatedElement.prototype.getRotationAngle=function(){return this.nRotationAngle};
AnimatedElement.prototype.setRotationAngle=function(nNewRotAngle){this.nRotationAngle=nNewRotAngle;
this.updateTransformationMatrix();ANIMDBG.print("AnimatedElement.setRotationAngle("+nNewRotAngle+")"
)};AnimatedElement.prototype.getSkewX=function(){return this.nSkewX};
AnimatedElement.prototype.setSkewX=function(nSkewValue){this.nSkewX=nSkewValue;
this.updateTransformationMatrix();ANIMDBG.print("AnimatedElement.setSkewX("+nSkewValue+")")};
AnimatedElement.prototype.getSkewY=function(){return this.nSkewY};
AnimatedElement.prototype.setSkewY=function(nSkewValue){this.nSkewY=nSkewValue;
this.updateTransformationMatrix();ANIMDBG.print("AnimatedElement.setSkewY("+nSkewValue+")")};
AnimatedElement.prototype.getVisibility=function(){return this.bVisible};
AnimatedElement.prototype.setVisibility=function(sValue){this.bVisible=sValue==="visible";
app.console.debug("AnimatedElement.setVisibility("+sValue+")")};
AnimatedElement.prototype.getFillColor=function(){return this.aFillColor};
AnimatedElement.prototype.setFillColor=function(aRGBValue){window.app.console.log(
"AnimatedElement.setFillColor("+aRGBValue.toString()+")");this.aFillColor=aRGBValue};
AnimatedElement.prototype.getStrokeColor=function(){return this.aLineColor};
AnimatedElement.prototype.setStrokeColor=function(aRGBValue){window.app.console.log(
"AnimatedElement.setStrokeColor("+aRGBValue.toString()+")");this.aLineColor=aRGBValue};
AnimatedElement.prototype.getFontColor=function(){return this.aFontColor};
AnimatedElement.prototype.setFontColor=function(aRGBValue){window.app.console.log(
"AnimatedElement.setFontColor("+aRGBValue.toString()+")");this.aFontColor=aRGBValue};
AnimatedElement.prototype.setDefaultDimColor=function(aRGBValue){window.app.console.log(
"AnimatedElement.setDefaultDimColor("+aRGBValue.toString()+")");this.aDimColor=aRGBValue};
AnimatedElement.prototype.getDimColor=function(){return this.aDimColor};
AnimatedElement.prototype.setDimColor=function(aRGBValue){window.app.console.log(
"AnimatedElement.setDimColor("+aRGBValue.toString()+")");this.aDimColor=aRGBValue;
this.aLineColor=aRGBValue;this.aFillColor=aRGBValue;this.aFontColor=aRGBValue};
AnimatedElement.prototype.getFillStyle=function(){return"solid"};
AnimatedElement.prototype.setFillStyle=function(sValue){window.app.console.log(
"AnimatedElement.setFillStyle("+sValue+") not implemented")};
AnimatedElement.prototype.getLineStyle=function(){return"solid"};
AnimatedElement.prototype.setLineStyle=function(sValue){window.app.console.log(
"AnimatedElement.setLineStyle("+sValue+") not implemented")};
AnimatedElement.prototype.setClipPath=function(aClipPath){if(this.aClipPath){
var sPathData=aClipPath.getAttribute("d");this.aClipPath.setAttribute("d",sPathData)}};
AnimatedElement.prototype.setTransitionFilterFrame=function(aTransitionFilterAnimation,nT){
this.transitionFiltersManager.add(aTransitionFilterAnimation,nT)};
AnimatedElement.prototype.DBG=function(sMessage,nTime){aAnimatedElementDebugPrinter.print(
"AnimatedElement("+this.getId()+")"+sMessage,nTime)};AnimatedElement.DefaultColor=new RGBColor(0,0,0
);AnimatedElement.SupportedProperties=new Set(["x","y","width","height","opacity","visibility",
"rotate","skewx","skewy","fillstyle","linestyle","fillcolor","linecolor","charcolor","dimcolor"]);
AnimatedElement.SupportedTransformations=new Set(["translate","scale","rotate"]);
return AnimatedElement}();var AnimatedTextElement=function(_super){__extends(AnimatedTextElement,
_super);function AnimatedTextElement(){return _super!==null&&_super.apply(this,arguments)||this}
AnimatedTextElement.prototype.isTextElement=function(){return true};return AnimatedTextElement}(
AnimatedElement);var TransitionClass;(function(TransitionClass){TransitionClass[TransitionClass[
"Invalid"]=0]="Invalid";TransitionClass[TransitionClass["ClipPoligon"]=1]="ClipPoligon";
TransitionClass[TransitionClass["Special"]=2]="Special"})(TransitionClass||(TransitionClass={}));
var TransitionReverseMethod;(function(TransitionReverseMethod){TransitionReverseMethod[
TransitionReverseMethod["Ignore"]=0]="Ignore";TransitionReverseMethod[TransitionReverseMethod[
"SubtractAndInvert"]=1]="SubtractAndInvert";TransitionReverseMethod[TransitionReverseMethod[
"Rotate180"]=2]="Rotate180";TransitionReverseMethod[TransitionReverseMethod["FlipX"]=3]="FlipX";
TransitionReverseMethod[TransitionReverseMethod["FlipY"]=4]="FlipY"})(TransitionReverseMethod||(
TransitionReverseMethod={}));var aTransitionInfoTable={};aTransitionInfoTable[TransitionType.INVALID
]={};aTransitionInfoTable[TransitionType.INVALID][TransitionSubType.DEFAULT]={
class:TransitionClass.Invalid,rotationAngle:0,scaleX:0,scaleY:0,
reverseMethod:TransitionReverseMethod.Ignore,outInvertsSweep:false,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.BARNDOORWIPE]={};aTransitionInfoTable[
TransitionType.BARNDOORWIPE][TransitionSubType.VERTICAL]={class:TransitionClass.ClipPoligon,
rotationAngle:0,scaleX:1,scaleY:1,reverseMethod:TransitionReverseMethod.SubtractAndInvert,
outInvertsSweep:true,scaleIsotropically:false};aTransitionInfoTable[TransitionType.BARNDOORWIPE][
TransitionSubType.HORIZONTAL]={class:TransitionClass.ClipPoligon,rotationAngle:90,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.SubtractAndInvert,outInvertsSweep:true,
scaleIsotropically:false};aTransitionInfoTable[TransitionType.BARWIPE]={};aTransitionInfoTable[
TransitionType.BARWIPE][TransitionSubType.LEFTTORIGHT]={class:TransitionClass.ClipPoligon,
rotationAngle:0,scaleX:1,scaleY:1,reverseMethod:TransitionReverseMethod.FlipX,outInvertsSweep:false,
scaleIsotropically:false};aTransitionInfoTable[TransitionType.BARWIPE][TransitionSubType.TOPTOBOTTOM
]={class:TransitionClass.ClipPoligon,rotationAngle:90,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.FlipY,outInvertsSweep:false,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.BLINDSWIPE]={};aTransitionInfoTable[TransitionType.BLINDSWIPE][
TransitionSubType.HORIZONTAL]={class:TransitionClass.ClipPoligon,rotationAngle:90,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.FlipX,outInvertsSweep:true,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.BLINDSWIPE][TransitionSubType.VERTICAL]={
class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.FlipY,outInvertsSweep:true,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.CHECKERBOARDWIPE]={};aTransitionInfoTable[
TransitionType.CHECKERBOARDWIPE][TransitionSubType.DOWN]={class:TransitionClass.ClipPoligon,
rotationAngle:90,scaleX:1,scaleY:1,reverseMethod:TransitionReverseMethod.FlipY,outInvertsSweep:true,
scaleIsotropically:false};aTransitionInfoTable[TransitionType.CHECKERBOARDWIPE][
TransitionSubType.ACROSS]={class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.FlipX,outInvertsSweep:true,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.DISSOLVE]={};aTransitionInfoTable[TransitionType.DISSOLVE][
TransitionSubType.DEFAULT]={class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.Ignore,outInvertsSweep:true,scaleIsotropically:true};
aTransitionInfoTable[TransitionType.ELLIPSEWIPE]={};aTransitionInfoTable[TransitionType.ELLIPSEWIPE
][TransitionSubType.CIRCLE]={class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.SubtractAndInvert,outInvertsSweep:true,scaleIsotropically:true
};aTransitionInfoTable[TransitionType.ELLIPSEWIPE][TransitionSubType.HORIZONTAL]={
class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.SubtractAndInvert,outInvertsSweep:true,
scaleIsotropically:false};aTransitionInfoTable[TransitionType.ELLIPSEWIPE][
TransitionSubType.VERTICAL]={class:TransitionClass.ClipPoligon,rotationAngle:90,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.SubtractAndInvert,outInvertsSweep:true,scaleIsotropically:true
};aTransitionInfoTable[TransitionType.FADE]={};aTransitionInfoTable[TransitionType.FADE][
TransitionSubType.CROSSFADE]=aTransitionInfoTable[TransitionType.FADE][
TransitionSubType.FADEOVERCOLOR]={class:TransitionClass.Special,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.Ignore,outInvertsSweep:true,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.FANWIPE]={};aTransitionInfoTable[TransitionType.FANWIPE][
TransitionSubType.CENTERTOP]={class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.FlipY,outInvertsSweep:true,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.FOURBOXWIPE]={};aTransitionInfoTable[TransitionType.FOURBOXWIPE
][TransitionSubType.CORNERSIN]=aTransitionInfoTable[TransitionType.FOURBOXWIPE][
TransitionSubType.CORNERSOUT]={class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.SubtractAndInvert,outInvertsSweep:true,
scaleIsotropically:false};aTransitionInfoTable[TransitionType.IRISWIPE]={};aTransitionInfoTable[
TransitionType.IRISWIPE][TransitionSubType.RECTANGLE]={class:TransitionClass.ClipPoligon,
rotationAngle:0,scaleX:1,scaleY:1,reverseMethod:TransitionReverseMethod.SubtractAndInvert,
outInvertsSweep:true,scaleIsotropically:false};aTransitionInfoTable[TransitionType.IRISWIPE][
TransitionSubType.DIAMOND]={class:TransitionClass.ClipPoligon,rotationAngle:45,scaleX:Math.SQRT2,
scaleY:Math.SQRT2,reverseMethod:TransitionReverseMethod.SubtractAndInvert,outInvertsSweep:true,
scaleIsotropically:false};aTransitionInfoTable[TransitionType.PINWHEELWIPE]={};aTransitionInfoTable[
TransitionType.PINWHEELWIPE][TransitionSubType.ONEBLADE]=aTransitionInfoTable[
TransitionType.PINWHEELWIPE][TransitionSubType.TWOBLADEVERTICAL]=aTransitionInfoTable[
TransitionType.PINWHEELWIPE][TransitionSubType.THREEBLADE]=aTransitionInfoTable[
TransitionType.PINWHEELWIPE][TransitionSubType.FOURBLADE]=aTransitionInfoTable[
TransitionType.PINWHEELWIPE][TransitionSubType.EIGHTBLADE]={class:TransitionClass.ClipPoligon,
rotationAngle:0,scaleX:1,scaleY:1,reverseMethod:TransitionReverseMethod.FlipX,outInvertsSweep:true,
scaleIsotropically:true};aTransitionInfoTable[TransitionType.RANDOMBARWIPE]={};aTransitionInfoTable[
TransitionType.RANDOMBARWIPE][TransitionSubType.HORIZONTAL]={class:TransitionClass.ClipPoligon,
rotationAngle:90,scaleX:1,scaleY:1,reverseMethod:TransitionReverseMethod.Ignore,
outInvertsSweep:true,scaleIsotropically:false};aTransitionInfoTable[TransitionType.RANDOMBARWIPE][
TransitionSubType.VERTICAL]={class:TransitionClass.ClipPoligon,rotationAngle:0,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.Ignore,outInvertsSweep:true,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.SLIDEWIPE]={};aTransitionInfoTable[TransitionType.SLIDEWIPE][
TransitionSubType.FROMLEFT]=aTransitionInfoTable[TransitionType.SLIDEWIPE][TransitionSubType.FROMTOP
]=aTransitionInfoTable[TransitionType.SLIDEWIPE][TransitionSubType.FROMRIGHT]=aTransitionInfoTable[
TransitionType.SLIDEWIPE][TransitionSubType.FROMBOTTOM]={class:TransitionClass.Special,
rotationAngle:0,scaleX:1,scaleY:1,reverseMethod:TransitionReverseMethod.Ignore,outInvertsSweep:true,
scaleIsotropically:false};aTransitionInfoTable[TransitionType.WATERFALLWIPE]={};
aTransitionInfoTable[TransitionType.WATERFALLWIPE][TransitionSubType.HORIZONTALLEFT]={
class:TransitionClass.ClipPoligon,rotationAngle:-90,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.Rotate180,outInvertsSweep:true,scaleIsotropically:false};
aTransitionInfoTable[TransitionType.WATERFALLWIPE][TransitionSubType.HORIZONTALRIGHT]={
class:TransitionClass.ClipPoligon,rotationAngle:90,scaleX:1,scaleY:1,
reverseMethod:TransitionReverseMethod.Rotate180,outInvertsSweep:true,scaleIsotropically:false};
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __spreadArray=this&&this.__spreadArray||function(to,from,
pack){if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(
!ar)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var TransitionParameters=function(){
function TransitionParameters(){this.context=null;this.current=null;this.next=null;
this.transitionFilterInfo=null;this.callback=null}return TransitionParameters}();
var TransitionBase=function(_super){__extends(TransitionBase,_super);function TransitionBase(
transitionParameters){var _this=_super.call(this,transitionParameters)||this;
_this.transitionFilterInfo=null;_this.transitionFilterInfo=transitionParameters.transitionFilterInfo
_this.createProgram();_this.prepareTransition();return _this}
TransitionBase.prototype.startTransition=function(){this.time=null;this.isLastFrame=false;
this.requestAnimationFrameId=requestAnimationFrame(this.animate.bind(this))};
TransitionBase.prototype.start=function(){this.startTransition()};
TransitionBase.prototype.endTransition=function(){this.releaseResources();app.console.debug(
"Transition completed")};TransitionBase.prototype.releaseResources=function(){var _this=this;if(
this.context.isDisposed())return;this.gl.bindVertexArray(null);if(this.vao){
this.gl.deleteVertexArray(this.vao);this.vao=null}this.gl.activeTexture(this.gl.TEXTURE0);
this.gl.bindTexture(this.gl.TEXTURE_2D,null);var attachedShaders=this.gl.getAttachedShaders(
this.program);if(attachedShaders){attachedShaders.forEach(function(shader){_this.gl.detachShader(
_this.program,shader);_this.gl.deleteShader(shader)})}this.gl.deleteProgram(this.program);
this.program=null};TransitionBase.prototype.renderUniformValue=function(){};return TransitionBase}(
SlideChangeGl);var Transition2d=function(_super){__extends(Transition2d,_super);
function Transition2d(transitionParameters){var _this=_super.call(this,transitionParameters)||this;
_this._uniformCache=new Map;return _this}Transition2d.prototype.getFragmentShader=function(){
var isSlideTransition=!!this.leavingSlide;
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\t"+(
isSlideTransition?"uniform sampler2D leavingSlideTexture;":""
)+"\n\t\t\t\tuniform sampler2D enteringSlideTexture;\n\t\t\t\tuniform float time;\n\t\t\t\t"+(
!isSlideTransition?"uniform float alpha;":""
)+"\n\n\t\t\t\tin vec2 v_texCoord;\n\t\t\t\tout vec4 outColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 color0 = "+(
isSlideTransition?"texture(leavingSlideTexture, v_texCoord)":"vec4(0, 0, 0, 0)"
)+";\n\t\t\t\t\tvec4 color1 = texture(enteringSlideTexture, v_texCoord);\n\t\t\t\t\t"+(
!isSlideTransition?"color1 *= alpha;":""
)+"\n\t\t\t\t\toutColor = mix(color0, color1, time);\n\t\t\t\t}\n\t\t\t\t"};
Transition2d.prototype.setPositionBuffer=function(bounds){if(!bounds)return;var v=[];for(
var i=0;i<bounds.length;++i){var x=2*bounds[i].x-1;v.push(x);var y=-(2*bounds[i].y-1);v.push(y)}
var positions=new Float32Array(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],[v[0],v[1]
,0,0,1],false),[v[2],v[3],0,1,1],false),[v[4],v[5],0,0,0],false),[v[6],v[7],0,1,0],false));
var gl=this.gl;gl.bindBuffer(gl.ARRAY_BUFFER,this.positionBuffer);gl.bufferData(gl.ARRAY_BUFFER,
positions,gl.STATIC_DRAW)};Transition2d.prototype.getUniformLocation=function(name){if(!this.program
)return null;if(this._uniformCache.has(name)){return this._uniformCache.get(name)}
var loc=this.gl.getUniformLocation(this.program,name);this._uniformCache.set(name,loc);return loc};
Transition2d.prototype.render=function(nT,properties){if(this.context.isDisposed())return;
var isSlideTransition=!!this.leavingSlide;app.console.debug("Transition2d.render: nT: "+nT);
var gl=this.gl;if(isSlideTransition){gl.viewport(0,0,this.gl.canvas.width,this.gl.canvas.height);
gl.clearColor(0,0,0,1);gl.clear(gl.COLOR_BUFFER_BIT)}if(!this.program){app.console.error(
"Transition2d.render: this.program is missing");return}gl.useProgram(this.program);
gl.bindVertexArray(this.vao);gl.uniform1f(gl.getUniformLocation(this.program,"time"),nT);if(
isSlideTransition){gl.activeTexture(gl.TEXTURE0);gl.bindTexture(gl.TEXTURE_2D,this.leavingSlide);
gl.uniform1i(gl.getUniformLocation(this.program,"leavingSlideTexture"),0)}else{
var _a=LayerRendererGl.computeColor(properties),bounds=_a.bounds,alpha=_a.alpha,
fromFillColor=_a.fromFillColor,toFillColor=_a.toFillColor,fromLineColor=_a.fromLineColor,
toLineColor=_a.toLineColor;app.console.debug("Transition2d.render: alpha: "+alpha);
this.setPositionBuffer(bounds);this.gl.uniform1f(this.getUniformLocation("alpha"),alpha);
this.gl.uniform4fv(this.getUniformLocation("fromFillColor"),fromFillColor);this.gl.uniform4fv(
this.getUniformLocation("toFillColor"),toFillColor);this.gl.uniform4fv(this.getUniformLocation(
"fromLineColor"),fromLineColor);this.gl.uniform4fv(this.getUniformLocation("toLineColor"),
toLineColor)}gl.activeTexture(gl.TEXTURE1);gl.bindTexture(gl.TEXTURE_2D,this.enteringSlide);
gl.uniform1i(gl.getUniformLocation(this.program,"enteringSlideTexture"),1);this.renderUniformValue()
gl.bindVertexArray(this.vao);gl.drawArrays(gl.TRIANGLE_STRIP,0,4);if(isSlideTransition){
app.map.fire("newslideshowframe",{frame:gl.canvas})}};
Transition2d.DefaultFromColor=new Float32Array([0,0,0,0]);
Transition2d.DefaultToColor=new Float32Array([0,0,0,0]);return Transition2d}(TransitionBase);
SlideShow.Transition2d=Transition2d;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var TransitionParameters3D=function(_super){__extends(TransitionParameters3D,_super);
function TransitionParameters3D(){var _this=_super!==null&&_super.apply(this,arguments)||this;
_this.leavingPrimitives=[];_this.enteringPrimitives=[];_this.allOperations=[];return _this}
return TransitionParameters3D}(TransitionParameters);var Transition3d=function(_super){__extends(
Transition3d,_super);function Transition3d(transitionParameters){var _this=_super.call(this,
transitionParameters)||this;if(_this.context.isDisposed())return _this;_this.gl.enable(
_this.gl.BLEND);_this.gl.blendFunc(_this.gl.SRC_ALPHA,_this.gl.ONE_MINUS_SRC_ALPHA);return _this}
Transition3d.prototype.getVertexShader=function(){
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\tin vec4 a_position;\n\t\t\t\tin vec3 a_normal;\n\t\t\t\tin vec2 a_texCoord;\n\n\t\t\t\tuniform mat4 u_projectionMatrix;\n\t\t\t\tuniform mat4 u_modelViewMatrix;\n\t\t\t\tuniform mat4 u_sceneTransformMatrix;\n\t\t\t\tuniform mat4 u_primitiveTransformMatrix;\n\t\t\t\tuniform mat4 u_operationsTransformMatrix;\n\n\t\t\t\tout vec2 v_texturePosition;\n\t\t\t\tout vec3 v_normal;\n\n\t\t\t\tmat4 customTranspose(mat4 m) {\n\t\t\t\t\treturn mat4(\n\t\t\t\t\t\tm[0][0], m[1][0], m[2][0], m[3][0],\n\t\t\t\t\t\tm[0][1], m[1][1], m[2][1], m[3][1],\n\t\t\t\t\t\tm[0][2], m[1][2], m[2][2], m[3][2],\n\t\t\t\t\t\tm[0][3], m[1][3], m[2][3], m[3][3]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tmat4 customInverse(mat4 m) {\n\t\t\t\t\tfloat a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3];\n\t\t\t\t\tfloat a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3];\n\t\t\t\t\tfloat a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3];\n\t\t\t\t\tfloat a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n\t\t\t\t\tfloat b00 = a00 * a11 - a01 * a10;\n\t\t\t\t\tfloat b01 = a00 * a12 - a02 * a10;\n\t\t\t\t\tfloat b02 = a00 * a13 - a03 * a10;\n\t\t\t\t\tfloat b03 = a01 * a12 - a02 * a11;\n\t\t\t\t\tfloat b04 = a01 * a13 - a03 * a11;\n\t\t\t\t\tfloat b05 = a02 * a13 - a03 * a12;\n\t\t\t\t\tfloat b06 = a20 * a31 - a21 * a30;\n\t\t\t\t\tfloat b07 = a20 * a32 - a22 * a30;\n\t\t\t\t\tfloat b08 = a20 * a33 - a23 * a30;\n\t\t\t\t\tfloat b09 = a21 * a32 - a22 * a31;\n\t\t\t\t\tfloat b10 = a21 * a33 - a23 * a31;\n\t\t\t\t\tfloat b11 = a22 * a33 - a23 * a32;\n\n\t\t\t\t\tfloat det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n\t\t\t\t\treturn mat4(\n\t\t\t\t\t\ta11 * b11 - a12 * b10 + a13 * b09,\n\t\t\t\t\t\ta02 * b10 - a01 * b11 - a03 * b09,\n\t\t\t\t\t\ta31 * b05 - a32 * b04 + a33 * b03,\n\t\t\t\t\t\ta22 * b04 - a21 * b05 - a23 * b03,\n\t\t\t\t\t\ta12 * b08 - a10 * b11 - a13 * b07,\n\t\t\t\t\t\ta00 * b11 - a02 * b08 + a03 * b07,\n\t\t\t\t\t\ta32 * b02 - a30 * b05 - a33 * b01,\n\t\t\t\t\t\ta20 * b05 - a22 * b02 + a23 * b01,\n\t\t\t\t\t\ta10 * b10 - a11 * b08 + a13 * b06,\n\t\t\t\t\t\ta01 * b08 - a00 * b10 - a03 * b06,\n\t\t\t\t\t\ta30 * b04 - a31 * b02 + a33 * b00,\n\t\t\t\t\t\ta21 * b02 - a20 * b04 - a23 * b00,\n\t\t\t\t\t\ta11 * b07 - a10 * b09 - a12 * b06,\n\t\t\t\t\t\ta00 * b09 - a01 * b07 + a02 * b06,\n\t\t\t\t\t\ta31 * b01 - a30 * b03 - a32 * b00,\n\t\t\t\t\t\ta20 * b03 - a21 * b01 + a22 * b00) / det;\n\t\t\t\t}\n\n\t\t\t\tvoid main(void) {\n\t\t\t\t\tmat4 modelViewMatrix = u_modelViewMatrix * u_operationsTransformMatrix * u_sceneTransformMatrix * u_primitiveTransformMatrix;\n\t\t\t\t\tmat3 normalMatrix = mat3(customTranspose(customInverse(modelViewMatrix)));\n\t\t\t\t\tgl_Position = u_projectionMatrix * modelViewMatrix * a_position;\n\t\t\t\t\tv_texturePosition = a_texCoord;\n\t\t\t\t\tv_normal = normalize(normalMatrix * a_normal);\n\t\t\t\t}\n\t\t\t\t"
};Transition3d.prototype.getFragmentShader=function(){
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\tuniform sampler2D slideTexture;\n\t\t\t\tin vec2 v_texturePosition;\n\t\t\t\tin vec3 v_normal;\n\n\t\t\t\tout vec4 outColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec3 lightVector = vec3(0.0, 0.0, 1.0);\n\t\t\t\t\tfloat light = max(dot(lightVector, v_normal), 0.0);\n\t\t\t\t\tvec4 fragment = texture(slideTexture, v_texturePosition);\n\t\t\t\t\tvec4 black = vec4(0.0, 0.0, 0.0, fragment.a);\n\t\t\t\t\toutColor = mix(black, fragment, light);\n\t\t\t\t}\n\t\t\t\t"
};Transition3d.prototype.calculateModelViewMatrix=function(){var EyePos=10;
var modelView=glMatrix.mat4.create();glMatrix.mat4.translate(modelView,modelView,new Float32Array([0
,0,-EyePos]));return modelView};Transition3d.prototype.calculateProjectionMatrix=function(){
var EyePos=10;var RealN=-1,RealF=1;var RealL=-1,RealR=1,RealB=-1,RealT=1;var ClipN=EyePos+5*RealN;
var ClipF=EyePos+15*RealF;var ClipL=RealL*8;var ClipR=RealR*8;var ClipB=RealB*8;var ClipT=RealT*8;
var projection=glMatrix.mat4.create();glMatrix.mat4.frustum(projection,ClipL,ClipR,ClipB,ClipT,ClipN
,ClipF);var scale=new Float32Array([1/(RealR*2*ClipN/(EyePos*(ClipR-ClipL))-(ClipR+ClipL)/(
ClipR-ClipL)),1/(RealT*2*ClipN/(EyePos*(ClipT-ClipB))-(ClipT+ClipB)/(ClipT-ClipB)),1]);
glMatrix.mat4.scale(projection,projection,scale);return projection};
Transition3d.prototype.initUniforms=function(){if(this.context.isDisposed())return;
this.gl.useProgram(this.program);var modelViewMatrix=this.calculateModelViewMatrix();
this.gl.uniformMatrix4fv(this.gl.getUniformLocation(this.program,"u_modelViewMatrix"),false,
modelViewMatrix);var projectionMatrix=this.calculateProjectionMatrix();this.gl.uniformMatrix4fv(
this.gl.getUniformLocation(this.program,"u_projectionMatrix"),false,projectionMatrix);
var sceneTransformMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);
this.gl.uniformMatrix4fv(this.gl.getUniformLocation(this.program,"u_sceneTransformMatrix"),false,
sceneTransformMatrix);var primitiveTransformMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1
]);this.gl.uniformMatrix4fv(this.gl.getUniformLocation(this.program,"u_primitiveTransformMatrix"),
false,primitiveTransformMatrix);var operationsTransformMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,
1,0,0,0,0,1]);this.gl.uniformMatrix4fv(this.gl.getUniformLocation(this.program,
"u_operationsTransformMatrix"),false,operationsTransformMatrix);this.otherUniformsInitialization();
app.console.log("Uniforms initialized")};
Transition3d.prototype.otherUniformsInitialization=function(){};
Transition3d.prototype.render=function(nT){if(this.context.isDisposed())return;this.gl.viewport(0,0,
this.context.canvas.width,this.context.canvas.height);this.gl.clearColor(0,0,0,1);this.gl.clear(
this.gl.COLOR_BUFFER_BIT);this.gl.useProgram(this.program);this.gl.uniform1f(
this.gl.getUniformLocation(this.program,"time"),nT);this.gl.activeTexture(this.gl.TEXTURE0);
this.gl.bindTexture(this.gl.TEXTURE_2D,this.leavingSlide);this.gl.uniform1i(
this.gl.getUniformLocation(this.program,"leavingSlideTexture"),0);this.gl.activeTexture(
this.gl.TEXTURE1);this.gl.bindTexture(this.gl.TEXTURE_2D,this.enteringSlide);this.gl.uniform1i(
this.gl.getUniformLocation(this.program,"enteringSlideTexture"),1);this.renderUniformValue();
this.gl.bindVertexArray(this.vao);this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,4);app.map.fire(
"newslideshowframe",{frame:this.gl.canvas})};Transition3d.prototype.renderUniformValue=function(){};
return Transition3d}(TransitionBase);SlideShow.Transition3d=Transition3d;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var ClippingTransition=function(_super){__extends(
ClippingTransition,_super);function ClippingTransition(transitionParameters){return _super.call(this
,transitionParameters)||this}ClippingTransition.prototype.initProgramTemplateParams=function(){
this.forwardParameterSweep=true;this.invertMask=false;this.scaleIsotropically=false;
var transitionType=this.transitionFilterInfo.transitionType;
var transitionSubtype=this.transitionFilterInfo.transitionSubtype;
var isDirectionForward=this.transitionFilterInfo.isDirectionForward;
var isModeIn=this.transitionFilterInfo.isModeIn;var transitionInfo=aTransitionInfoTable[
transitionType][transitionSubtype];if(!transitionInfo){window.app.console.log(
"ClippingTransition: no transition info found for type: "+(
transitionType+" and subtype: "+transitionSubtype));return}
this.scaleIsotropically=transitionInfo.scaleIsotropically;if(!isDirectionForward){switch(
transitionInfo.reverseMethod){default:window.app.console.log(
"ClippingTransition: unexpected reverse method for type: "+(
transitionType+" and subtype: "+transitionSubtype));return;case TransitionReverseMethod.Ignore:break
case TransitionReverseMethod.SubtractAndInvert:
this.forwardParameterSweep=!this.forwardParameterSweep;this.invertMask=!this.invertMask;break;
case TransitionReverseMethod.Rotate180:break;case TransitionReverseMethod.FlipX:break;
case TransitionReverseMethod.FlipY:break}}if(!isModeIn){if(transitionInfo.outInvertsSweep
)this.forwardParameterSweep=!this.forwardParameterSweep;else this.invertMask=!this.invertMask}
console.debug(
"ClippingTransition: \n\t\t\ttype: "+transitionType+" \n\t\t\tsubtype: "+transitionSubtype+" \n\t\t\tdirection forward: "+isDirectionForward+"\n\t\t\tmode in: "+isModeIn+"\n\t\t\treverse method: "+TransitionReverseMethod[
transitionInfo.reverseMethod
]+"\n\t\t\toutInvertsSweep: "+transitionInfo.outInvertsSweep+"\n\t\t\tforwardParameterSweep: "+this.forwardParameterSweep+"\n\t\t\tinvertMask: "+this.invertMask+"\n\t\t\t"
);this.initMaskFunctionParams()};ClippingTransition.prototype.initMaskFunctionParams=function(){};
ClippingTransition.prototype.getMaskFunction=function(){return""};
ClippingTransition.prototype.getFragmentShader=function(){var isSlideTransition=!!this.leavingSlide;
var scaleFactor=1;var isLandscape;if(this.scaleIsotropically){
var ctx=this.transitionParameters.context;var width=ctx.canvas.width;var height=ctx.canvas.height;
isLandscape=width>height;scaleFactor=isLandscape?height/width:width/height}
var needScaling=scaleFactor!=1;var comp=isLandscape?"y":"x";
return"#version 300 es\n                precision mediump float;\n\n                "+(
isSlideTransition?"uniform sampler2D leavingSlideTexture;":""
)+"\n                uniform sampler2D enteringSlideTexture;\n                uniform float time;\n                "+(
!isSlideTransition?"\n                          uniform float alpha;\n                          uniform vec4 fromFillColor;\n                          uniform vec4 toFillColor;\n                          uniform vec4 fromLineColor;\n                          uniform vec4 toLineColor;\n                          ":""
)+"\n\n                in vec2 v_texCoord;\n                out vec4 outColor;\n\n                "+this.getMaskFunction(

)+"\n\n\t\t            float scaleCompWrtCenter(float c, float s) {\n\t\t                return (c - 0.5) * s + 0.5;\n\t\t            }\n\n                "+(
!isSlideTransition?"\n                          "+GlHelpers.nearestPointOnSegment+"\n                          "+GlHelpers.computeColor+"\n                          ":""
)+"\n\n                void main() {\n                    // reverse direction / mode out ?\n                    float progress = "+(
this.forwardParameterSweep?"time":"1.0 - time"
)+";\n\n\n                    vec2 uv = v_texCoord;\n                    // isotropic scale case ?\n                    "+(
needScaling?"uv."+comp+" = scaleCompWrtCenter(uv."+comp+", "+scaleFactor+")":""
)+";\n\n                    float mask = getMaskValue(uv, progress);\n                    // reverse direction / mode out ?\n                    "+(
this.invertMask?"mask = 1.0 - mask;":"")+"\n\n                    vec4 color1 = "+(
isSlideTransition?"texture(leavingSlideTexture, v_texCoord)":"vec4(0, 0, 0, 0)"
)+";\n                    vec4 color2 = texture(enteringSlideTexture, v_texCoord);\n                    "+(
!isSlideTransition?"\n                              color2 = computeColor(color2);\n                              color2 *= alpha;\n                              ":""
)+"\n\n                    outColor = mix(color1, color2, mask);\n                }\n                "
};return ClippingTransition}(Transition2d);SlideShow.ClippingTransition=ClippingTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var FadeSubType;(function(FadeSubType){FadeSubType[FadeSubType[
"FADEOVERBLACK"]=0]="FADEOVERBLACK";FadeSubType[FadeSubType["FADEOVERWHITE"]=1]="FADEOVERWHITE";
FadeSubType[FadeSubType["SMOOTHLY"]=2]="SMOOTHLY"})(FadeSubType||(FadeSubType={}));
var FadeTransition=function(_super){__extends(FadeTransition,_super);function FadeTransition(
transitionParameters){var _this=_super.call(this,transitionParameters)||this;
_this.effectTransition=0;return _this}FadeTransition.prototype.start=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;
this.effectTransition=FadeSubType.FADEOVERBLACK;if(transitionSubType==TransitionSubType.CROSSFADE){
this.effectTransition=FadeSubType.SMOOTHLY}else if(
transitionSubType==TransitionSubType.FADEOVERCOLOR&&this.transitionFilterInfo.fadeColor&&this.transitionFilterInfo.fadeColor.toUpperCase(
)==="#FFFFFF"){this.effectTransition=FadeSubType.FADEOVERWHITE}this.startTransition()};
FadeTransition.prototype.renderUniformValue=function(){this.gl.uniform1i(this.gl.getUniformLocation(
this.program,"effectType"),this.effectTransition)};
FadeTransition.prototype.getFragmentShader=function(){
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\tuniform sampler2D leavingSlideTexture;\n\t\t\t\tuniform sampler2D enteringSlideTexture;\n\t\t\t\tuniform float time;\n\t\t\t\tuniform int effectType; // 0: Fade through black, 1: Fade through white, 2: Smooth fade\n\n\t\t\t\tin vec2 v_texCoord;\n\t\t\t\tout vec4 outColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 color0 = texture(leavingSlideTexture, v_texCoord);\n\t\t\t\t\tvec4 color1 = texture(enteringSlideTexture, v_texCoord);\n\t\t\t\t\tvec4 transitionColor;\n\n\t\t\t\t\tif (effectType == 0) {\n\t\t\t\t\t\t// Fade through black\n\t\t\t\t\t\ttransitionColor = vec4(0.0, 0.0, 0.0, 1.0);\n\t\t\t\t\t} else if (effectType == 1) {\n\t\t\t\t\t\t// Fade through white\n\t\t\t\t\t\ttransitionColor = vec4(1.0, 1.0, 1.0, 1.0);\n\t\t\t\t\t}\n\t\t\t\t\tif (effectType == 2) {\n\t\t\t\t\t\t// Smooth fade\n\t\t\t\t\t\tfloat smoothTime = smoothstep(0.0, 1.0, time);\n\t\t\t\t\t\toutColor = mix(color0, color1, smoothTime);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (time < 0.5) {\n\t\t\t\t\t\t\toutColor = mix(color0, transitionColor, time * 2.0);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutColor = mix(transitionColor, color1, (time - 0.5) * 2.0);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t"
};return FadeTransition}(SlideShow.Transition2d);SlideShow.FadeTransition=FadeTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var PlusTransition=function(_super){__extends(PlusTransition,
_super);function PlusTransition(transitionParameters){return _super.call(this,transitionParameters
)||this}PlusTransition.prototype.getMaskFunction=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType===TransitionSubType.CORNERSOUT
)return"\n                  float getMaskValue(vec2 uv, float time) {\n                      vec2 center = vec2(0.5, 0.5);\n\n                      vec2 dist = abs(uv - center);\n\n                      float innerBound = 0.25 - time / 4.0;\n                      float outerBound = 0.25 + time / 4.0;\n\n                      // dist >= innerBound && dist <= outerBound\n                      float mask =\n                          step(innerBound, dist.x) * step(-outerBound, -dist.x) *\n                          step(innerBound, dist.y) * step(-outerBound, -dist.y);\n\n                      return mask;\n                  }\n          ";else if(
transitionSubType===TransitionSubType.CORNERSIN
)return"\n                  float getMaskValue(vec2 uv, float time) {\n                      vec2 center = vec2(0.5, 0.5);\n\n                      vec2 dist = abs(uv - center);\n\n                      float size = 1.01 * (1.0 - time) / 2.0;\n\n                      float mask = step(size, dist.x) * step(size, dist.y);\n\n                      return mask;\n                  }\n          "
};return PlusTransition}(ClippingTransition);SlideShow.PlusTransition=PlusTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CircleTransition=function(_super){__extends(
CircleTransition,_super);function CircleTransition(transitionParameters){return _super.call(this,
transitionParameters)||this}CircleTransition.prototype.getMaskFunction=function(){
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    vec2 center = vec2(0.5, 0.5);\n\n                    float dist = distance(uv, center);\n\n                    float size = progress * 1.5;\n\n                    float mask = step(dist, size);\n\n                    mask = min(mask, 1.0);\n\n                    return mask;\n                }\n\t\t"
};return CircleTransition}(ClippingTransition);SlideShow.CircleTransition=CircleTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var VenetianSubType;(function(VenetianSubType){VenetianSubType[
VenetianSubType["HORIZONTAL"]=0]="HORIZONTAL";VenetianSubType[VenetianSubType["VERTICAL"]=1
]="VERTICAL"})(VenetianSubType||(VenetianSubType={}));var VenetianTransition=function(_super){
__extends(VenetianTransition,_super);function VenetianTransition(transitionParameters){
return _super.call(this,transitionParameters)||this}
VenetianTransition.prototype.initMaskFunctionParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.HORIZONTAL){this.direction=VenetianSubType.HORIZONTAL}else{
this.direction=VenetianSubType.VERTICAL}};VenetianTransition.prototype.getMaskFunction=function(){
var numBlinds=6;var blindWidth=this.gl.canvas.width/numBlinds;
var blindHeight=this.gl.canvas.height/numBlinds;
var blindSize=this.direction==VenetianSubType.VERTICAL?blindWidth:blindHeight;
var comp=this.direction==VenetianSubType.VERTICAL?"x":"y";
return"\n                #define CANVAS_WIDTH "+this.gl.canvas.width+"\n                #define CANVAS_HEIGHT "+this.gl.canvas.height+"\n\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    vec2 resolution = vec2(CANVAS_WIDTH, CANVAS_HEIGHT);\n                    float blindSize = float("+blindSize+");\n\n                    float position = mod(uv."+comp+" * resolution."+comp+", blindSize);\n\n                    float mask = step(position / blindSize, progress);\n\n                    return mask;\n                }\n\t\t"
};return VenetianTransition}(ClippingTransition);SlideShow.VenetianTransition=VenetianTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var WedgeTransition=function(_super){__extends(WedgeTransition,
_super);function WedgeTransition(transitionParameters){return _super.call(this,transitionParameters
)||this}WedgeTransition.prototype.getMaskFunction=function(){
return"\n\t\t            #define M_PI "+Math.PI+"\n\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    vec2 center = vec2(0.5, 0.5);\n\n                    vec2 dist = uv - center;\n                    float angle = atan(dist.x, dist.y);\n\n                    if (angle < 0.0) {\n                        angle += 2.0 * M_PI;\n                    }\n\n                    float wedgeAngle = M_PI * progress;\n\n                    float mask = step(angle, wedgeAngle) + step(2.0 * M_PI - wedgeAngle, angle);\n\t\t\t\t\t\t\t\t\t\tmask = min(mask, 1.0);\n\n                    return mask;\n                }\n\t\t"
};return WedgeTransition}(ClippingTransition);SlideShow.WedgeTransition=WedgeTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var OvalSubType;(function(OvalSubType){OvalSubType[OvalSubType[
"HORIZONTAL"]=0]="HORIZONTAL";OvalSubType[OvalSubType["VERTICAL"]=1]="VERTICAL"})(OvalSubType||(
OvalSubType={}));var OvalTransition=function(_super){__extends(OvalTransition,_super);
function OvalTransition(transitionParameters){return _super.call(this,transitionParameters)||this}
OvalTransition.prototype.initMaskFunctionParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.HORIZONTAL){this.direction=OvalSubType.HORIZONTAL}else if(
transitionSubType==TransitionSubType.VERTICAL){this.direction=OvalSubType.VERTICAL}};
OvalTransition.prototype.getMaskFunction=function(){
var isHorizontalDir=this.direction==OvalSubType.HORIZONTAL;
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    vec2 center = vec2(0.5, 0.5);\n\n                    vec2 dist = abs(uv - center);\n\n                    "+(
isHorizontalDir?"dist.y":"dist.x"
)+" *= 2.0;\n\n                    float size = progress * 1.2;\n\n                    float mask = step(length(dist), size);\n\n                    mask = min(mask, 1.0);\n\n                    return mask;\n                }\n\t\t"
};return OvalTransition}(ClippingTransition);SlideShow.OvalTransition=OvalTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var BoxTransition=function(_super){__extends(BoxTransition,
_super);function BoxTransition(transitionParameters){return _super.call(this,transitionParameters
)||this}BoxTransition.prototype.getMaskFunction=function(){
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    vec2 center = vec2(0.5, 0.5);\n\n                    vec2 dist = abs(uv - center);\n\n                    float size = progress * 1.5;\n\n                    float mask = step(dist.x, size / 2.0) * step(dist.y, size / 2.0);\n\n                    return mask;\n                }\n\t\t"
};return BoxTransition}(ClippingTransition);SlideShow.BoxTransition=BoxTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var DiamondTransition=function(_super){__extends(
DiamondTransition,_super);function DiamondTransition(transitionParameters){return _super.call(this,
transitionParameters)||this}DiamondTransition.prototype.getMaskFunction=function(){
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    vec2 center = vec2(0.5, 0.5);\n\n                    vec2 dist = abs(uv - center);\n\n                    float size = progress * 1.5;\n\n                    float mask = step(dist.x + dist.y, size);\n\n                    return mask;\n                }\n\t\t"
};return DiamondTransition}(ClippingTransition);SlideShow.DiamondTransition=DiamondTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CheckersSubType;(function(CheckersSubType){CheckersSubType[
CheckersSubType["ACROSS"]=0]="ACROSS";CheckersSubType[CheckersSubType["DOWN"]=1]="DOWN"})(
CheckersSubType||(CheckersSubType={}));var CheckersTransition=function(_super){__extends(
CheckersTransition,_super);function CheckersTransition(transitionParameters){return _super.call(this
,transitionParameters)||this}CheckersTransition.prototype.initMaskFunctionParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.DOWN){this.direction=CheckersSubType.DOWN}else if(
transitionSubType==TransitionSubType.ACROSS){this.direction=CheckersSubType.ACROSS}};
CheckersTransition.prototype.getMaskFunction=function(){var numSquares=8;var edgeSize=1/numSquares;
var isAcrossDir=this.direction==CheckersSubType.ACROSS;
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time * 2.0;\n\n                    vec2 squareSize = vec2("+edgeSize+", "+edgeSize+");\n                    vec2 checkerCoord = floor(uv / squareSize);\n\n                    bool isWhiteSquare = mod(checkerCoord.x + checkerCoord.y, 2.0) == 0.0;\n                    vec2 localUV = fract(uv / squareSize);\n\n                    float adjustedProgress = isWhiteSquare ? progress : progress - 1.0;\n                    adjustedProgress = clamp(adjustedProgress, 0.0, 1.0);\n\n                    float localCoord = "+(
isAcrossDir?"localUV.x":"localUV.y"
)+";\n                    bool showEntering = localCoord < adjustedProgress;\n\n                    return float(showEntering);\n                }\n\t\t"
};return CheckersTransition}(ClippingTransition);SlideShow.CheckersTransition=CheckersTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var PushSubType;(function(PushSubType){PushSubType[PushSubType[
"FROMBOTTOM"]=0]="FROMBOTTOM";PushSubType[PushSubType["FROMLEFT"]=1]="FROMLEFT";PushSubType[
PushSubType["FROMRIGHT"]=2]="FROMRIGHT";PushSubType[PushSubType["FROMTOP"]=3]="FROMTOP"})(
PushSubType||(PushSubType={}));var PushTransition=function(_super){__extends(PushTransition,_super);
function PushTransition(transitionParameters){var _this=_super.call(this,transitionParameters)||this
_this.direction=0;return _this}PushTransition.prototype.start=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.FROMTOP){this.direction=PushSubType.FROMTOP}else if(
transitionSubType==TransitionSubType.FROMRIGHT){this.direction=PushSubType.FROMRIGHT}else if(
transitionSubType==TransitionSubType.FROMLEFT){this.direction=PushSubType.FROMLEFT}else{
this.direction=PushSubType.FROMBOTTOM}this.startTransition()};
PushTransition.prototype.renderUniformValue=function(){this.gl.uniform1i(this.gl.getUniformLocation(
this.program,"direction"),this.direction)};PushTransition.prototype.getFragmentShader=function(){
return"#version 300 es\n                precision mediump float;\n\n                uniform sampler2D leavingSlideTexture;\n                uniform sampler2D enteringSlideTexture;\n                uniform float time;\n                uniform int direction;\n\n                in vec2 v_texCoord;\n                out vec4 outColor;\n\n                void main() {\n                    vec2 uv = v_texCoord;\n                    float progress = time;\n\n                    vec2 leavingUV = uv;\n                    vec2 enteringUV = uv;\n\n                    if (direction == 0) {\n                        // bottom to top\n                        leavingUV = uv + vec2(0.0, progress);\n                        enteringUV = uv + vec2(0.0, -1.0 + progress);\n                    } else if (direction == 1) {\n                        // left to right\n                        leavingUV = uv + vec2(-progress, 0.0);\n                        enteringUV = uv + vec2(1.0 - progress, 0.0);\n                    } else if (direction == 2) {\n                        // right to left\n                        leavingUV = uv + vec2(progress, 0.0);\n                        enteringUV = uv + vec2(-1.0 + progress, 0.0);\n                    } else if (direction == 3) {\n                        // top to bottom\n                        leavingUV = uv + vec2(0.0, -progress);\n                        enteringUV = uv + vec2(0.0, 1.0 - progress);\n                    }\n\n                    if ((direction == 0 && uv.y > 1.0 - progress) ||\n                        (direction == 1 && uv.x < progress) ||\n                        (direction == 2 && uv.x > 1.0 - progress) ||\n                        (direction == 3 && uv.y < progress)) {\n                        outColor = texture(enteringSlideTexture, enteringUV);\n                    } else {\n                        outColor = texture(leavingSlideTexture, leavingUV);\n                    }\n                }\n                "
};return PushTransition}(Transition2d);SlideShow.PushTransition=PushTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var SimpleDissolveTransition=function(_super){__extends(
SimpleDissolveTransition,_super);function SimpleDissolveTransition(transitionParameters){
return _super.call(this,transitionParameters)||this}
SimpleDissolveTransition.prototype.getMaskFunction=function(){var numSquares=16;
var edgeSize=1/numSquares;
return"\n\t\t\t\t// generate a pseudo-random value based on coordinates\n\t\t\t\tfloat random(vec2 co) {\n\t\t\t\t\treturn fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n\t\t\t\t}\n\n\t\t\t\tfloat getMaskValue(vec2 uv, float time) {\n\t\t\t\t\tfloat progress = time;\n\n\t\t\t\t\tvec2 squareSize = vec2("+edgeSize+", "+edgeSize+");\n\n\t\t\t\t\tvec2 checkerCoord = floor(uv / squareSize);\n\n\t\t\t\t\tfloat randValue = random(checkerCoord);\n\n\t\t\t\t\tbool showEntering = progress > randValue;\n\n\t\t\t\t\treturn float(showEntering);\n\t\t\t\t}\n\t\t"
};return SimpleDissolveTransition}(ClippingTransition);
SlideShow.SimpleDissolveTransition=SimpleDissolveTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var BarsSubType;(function(BarsSubType){BarsSubType[BarsSubType[
"VERTICAL"]=0]="VERTICAL";BarsSubType[BarsSubType["HORIZONTAL"]=1]="HORIZONTAL"})(BarsSubType||(
BarsSubType={}));var BarsTransition=function(_super){__extends(BarsTransition,_super);
function BarsTransition(transitionParameters){return _super.call(this,transitionParameters)||this}
BarsTransition.prototype.initMaskFunctionParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.VERTICAL){this.direction=BarsSubType.VERTICAL}else if(
transitionSubType==TransitionSubType.HORIZONTAL){this.direction=BarsSubType.HORIZONTAL}};
BarsTransition.prototype.getMaskFunction=function(){
var isVerticalDir=this.direction==BarsSubType.VERTICAL;
return"\n                float random(vec2 co) {\n                    return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n                }\n\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    float numBars = 128.0;\n                    float coord = "+(
isVerticalDir?"uv.x":"uv.y"
)+";\n                    float randValue = random(vec2(floor(coord * numBars), 0.0));\n\n                    bool showEntering = (randValue < progress);\n                    return float(showEntering);\n                }\n\t\t"
};return BarsTransition}(ClippingTransition);SlideShow.BarsTransition=BarsTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CutTransition=function(_super){__extends(CutTransition,
_super);function CutTransition(transitionParameters){return _super.call(this,transitionParameters
)||this}CutTransition.prototype.getFragmentShader=function(){
return"#version 300 es\n                precision mediump float;\n\n                uniform sampler2D leavingSlideTexture;\n                uniform sampler2D enteringSlideTexture;\n                uniform float time;\n\n                in vec2 v_texCoord;\n                out vec4 outColor;\n\n                void main() {\n                    if (time < 1.0) {\n                        outColor =  vec4(0.0f, 0.0f, 0.0f, 1.0f);\n                    } else {\n                        outColor = texture(enteringSlideTexture, v_texCoord);\n                    }\n                }\n                "
};return CutTransition}(SlideShow.Transition2d);SlideShow.CutTransition=CutTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var WheelSubType;(function(WheelSubType){WheelSubType[
WheelSubType["ONEWHEEL"]=1]="ONEWHEEL";WheelSubType[WheelSubType["TWOWHEEL"]=2]="TWOWHEEL";
WheelSubType[WheelSubType["THREEWHEEL"]=3]="THREEWHEEL";WheelSubType[WheelSubType["FOURWHEEL"]=4
]="FOURWHEEL";WheelSubType[WheelSubType["EIGHTWHEEL"]=8]="EIGHTWHEEL"})(WheelSubType||(
WheelSubType={}));var WheelTransition=function(_super){__extends(WheelTransition,_super);
function WheelTransition(transitionParameters){return _super.call(this,transitionParameters)||this}
WheelTransition.prototype.initMaskFunctionParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.TWOBLADEVERTICAL){this.stocks=WheelSubType.TWOWHEEL}else if(
transitionSubType==TransitionSubType.THREEBLADE){this.stocks=WheelSubType.THREEWHEEL}else if(
transitionSubType==TransitionSubType.FOURBLADE){this.stocks=WheelSubType.FOURWHEEL}else if(
transitionSubType==TransitionSubType.EIGHTBLADE){this.stocks=WheelSubType.EIGHTWHEEL}else{
this.stocks=WheelSubType.ONEWHEEL}};WheelTransition.prototype.getMaskFunction=function(){
var slice=2*Math.PI/this.stocks;
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    float angle = atan(uv.y - 0.5, uv.x - 0.5) + "+Math.PI/2+";\n                    float mask = step(mod(angle, "+slice+"), "+slice+" * progress);\n\n                    return mask;\n                }\n\t\t"
};return WheelTransition}(ClippingTransition);SlideShow.WheelTransition=WheelTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var UncoverSubType;(function(UncoverSubType){UncoverSubType[
UncoverSubType["FROMTOP"]=0]="FROMTOP";UncoverSubType[UncoverSubType["FROMRIGHT"]=1]="FROMRIGHT";
UncoverSubType[UncoverSubType["FROMLEFT"]=2]="FROMLEFT";UncoverSubType[UncoverSubType["FROMBOTTOM"
]=3]="FROMBOTTOM"})(UncoverSubType||(UncoverSubType={}));var UncoverTransition=function(_super){
__extends(UncoverTransition,_super);function UncoverTransition(transitionParameters){
var _this=_super.call(this,transitionParameters)||this;_this.direction=0;return _this}
UncoverTransition.prototype.start=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.FROMTOP){this.direction=UncoverSubType.FROMTOP}else if(
transitionSubType==TransitionSubType.FROMLEFT){this.direction=UncoverSubType.FROMLEFT}else if(
transitionSubType==TransitionSubType.FROMRIGHT){this.direction=UncoverSubType.FROMRIGHT}else{
this.direction=UncoverSubType.FROMBOTTOM}this.startTransition()};
UncoverTransition.prototype.renderUniformValue=function(){this.gl.uniform1i(
this.gl.getUniformLocation(this.program,"direction"),this.direction)};
UncoverTransition.prototype.getFragmentShader=function(){
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\tuniform sampler2D leavingSlideTexture;\n\t\t\t\tuniform sampler2D enteringSlideTexture;\n\t\t\t\tuniform float time;\n\t\t\t\tuniform int direction;\n\n\t\t\t\tin vec2 v_texCoord;\n\t\t\t\tout vec4 outColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = v_texCoord;\n\t\t\t\t\tfloat progress = time;\n\n\t\t\t\t\tvec2 leavingUV = uv;\n\t\t\t\t\tvec2 enteringUV = uv;\n\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tleavingUV = uv + vec2(0.0, -progress);\n\t\t\t\t\t} else if (direction == 1) {\n\t\t\t\t\t\tleavingUV = uv + vec2(progress, 0.0);\n\t\t\t\t\t} else if (direction == 2) {\n\t\t\t\t\t\tleavingUV = uv + vec2(-progress, 0.0);\n\t\t\t\t\t} else if (direction == 3) {\n\t\t\t\t\t\tleavingUV = uv + vec2(0.0, progress);\n\t\t\t\t\t}\n\t\t\t\t\telse if (direction == 4) {\n\t\t\t\t\t\t// TODO: Meed to fix this bug, top right to bottom left\n\t\t\t\t\t\tleavingUV = uv + vec2(progress, -progress);\n\t\t\t\t\t}\n\n\t\t\t\t\tbool showEntering = false;\n\t\t\t\t\tif (direction == 0) {\n\t\t\t\t\t\tshowEntering = uv.y < progress;\n\t\t\t\t\t} else if (direction == 1) {\n\t\t\t\t\t\tshowEntering = uv.x > 1.0 - progress;\n\t\t\t\t\t} else if (direction == 2) {\n\t\t\t\t\t\tshowEntering = uv.x < progress;\n\t\t\t\t\t} else if (direction == 3) {\n\t\t\t\t\t\tshowEntering = uv.y > 1.0 - progress;\n\t\t\t\t\t} else if (direction == 4) {\n\t\t\t\t\t\tshowEntering = uv.x > 1.0 - progress && uv.y < progress;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (showEntering) {\n\t\t\t\t\t\toutColor = texture(enteringSlideTexture, enteringUV);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutColor = texture(leavingSlideTexture, leavingUV);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t"
};return UncoverTransition}(Transition2d);SlideShow.UncoverTransition=UncoverTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var CoverSubType;(function(CoverSubType){CoverSubType[
CoverSubType["FROMBOTTOM"]=0]="FROMBOTTOM";CoverSubType[CoverSubType["FROMLEFT"]=1]="FROMLEFT";
CoverSubType[CoverSubType["FROMRIGHT"]=2]="FROMRIGHT";CoverSubType[CoverSubType["FROMTOP"]=3
]="FROMTOP"})(CoverSubType||(CoverSubType={}));var CoverTransition=function(_super){__extends(
CoverTransition,_super);function CoverTransition(transitionParameters){var _this=_super.call(this,
transitionParameters)||this;_this.direction=0;return _this}CoverTransition.prototype.start=function(
){var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.FROMTOP){this.direction=CoverSubType.FROMTOP}else if(
transitionSubType==TransitionSubType.FROMLEFT){this.direction=CoverSubType.FROMLEFT}else if(
transitionSubType==TransitionSubType.FROMRIGHT){this.direction=CoverSubType.FROMRIGHT}else{
this.direction=CoverSubType.FROMBOTTOM}this.startTransition()};
CoverTransition.prototype.renderUniformValue=function(){this.gl.uniform1i(
this.gl.getUniformLocation(this.program,"direction"),this.direction)};
CoverTransition.prototype.getFragmentShader=function(){
return"#version 300 es\n                precision mediump float;\n\n                uniform sampler2D leavingSlideTexture;\n                uniform sampler2D enteringSlideTexture;\n                uniform float time;\n                uniform int direction;\n\n                in vec2 v_texCoord;\n                out vec4 outColor;\n\n                void main() {\n                    vec2 uv = v_texCoord;\n                    float progress = time;\n\n                    vec2 leavingUV = uv;\n                    vec2 enteringUV = uv;\n\n                    if (direction == 0) {\n                        enteringUV = uv + vec2(0.0, -1.0 + progress);\n                    } else if (direction == 1) {\n                        enteringUV = uv + vec2(1.0 - progress, 0.0);\n                    } else if (direction == 2) {\n                        enteringUV = uv + vec2(-1.0 + progress, 0.0);\n                    } else if (direction == 3) {\n                        enteringUV = uv + vec2(0.0, 1.0 - progress);\n                    } else if (direction == 4) {\n                        // bottom left to top right\n                        enteringUV = uv + vec2(1.0 - progress, -1.0 + progress);\n                    } else if (direction == 5) {\n                        // top right to bottom left\n                        enteringUV = uv + vec2(-1.0 + progress, 1.0 - progress);\n                    } else if (direction == 6) {\n                        // top left to bottom right\n                        enteringUV = uv + vec2(1.0 - progress, 1.0 - progress);\n                    } else if (direction == 7) {\n                        // bottom right to top left\n                        enteringUV = uv + vec2(-1.0 + progress, -1.0 + progress);\n                    }\n\n                    bool showEntering = false;\n                    if (direction == 0) {\n                        showEntering = uv.y > 1.0 - progress;\n                    } else if (direction == 1) {\n                        showEntering = uv.x < progress;\n                    } else if (direction == 2) {\n                        showEntering = uv.x > 1.0 - progress;\n                    } else if (direction == 3) {\n                        showEntering = uv.y < progress;\n                    } else if (direction == 4) {\n                        showEntering = uv.x < progress && uv.y > 1.0 - progress;\n                    } else if (direction == 5) {\n                        showEntering = uv.x > 1.0 - progress && uv.y < progress;\n                    } else if (direction == 6) {\n                        showEntering = uv.x < progress && uv.y < progress;\n                    } else if (direction == 7) {\n                        showEntering = uv.x > 1.0 - progress && uv.y > 1.0 - progress;\n                    }\n\n                    if (showEntering) {\n                        outColor = texture(enteringSlideTexture, enteringUV);\n                    } else {\n                        outColor = texture(leavingSlideTexture, leavingUV);\n                    }\n                }\n                "
};return CoverTransition}(Transition2d);SlideShow.CoverTransition=CoverTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var SplitTransition=function(_super){__extends(SplitTransition,
_super);function SplitTransition(transitionParameters){return _super.call(this,transitionParameters
)||this}SplitTransition.prototype.getMaskFunction=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;
var isHorizontalDir=transitionSubType==TransitionSubType.HORIZONTAL;
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float progress = time;\n\n                    vec2 center = vec2(0.5, 0.5);\n\n                    vec2 dist = abs(uv - center);\n\n                    float size = progress * 1.5;\n\n                    float distCoord = "+(
isHorizontalDir?"dist.y":"dist.x"
)+";\n\n                    float mask = step(size / 2.0, distCoord);\n\n                    mask = 1.0 - mask;\n\n                    return mask;\n                }\n\t\t"
};return SplitTransition}(ClippingTransition);SlideShow.SplitTransition=SplitTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var WipeSubType;(function(WipeSubType){WipeSubType[WipeSubType[
"LEFTTORIGHT"]=0]="LEFTTORIGHT";WipeSubType[WipeSubType["RIGHTTOLEFT"]=1]="RIGHTTOLEFT";WipeSubType[
WipeSubType["TOPTOBOTTOM"]=2]="TOPTOBOTTOM";WipeSubType[WipeSubType["BOTTOMTOTOP"]=3]="BOTTOMTOTOP"}
)(WipeSubType||(WipeSubType={}));var WipeTransition=function(_super){__extends(WipeTransition,_super
);function WipeTransition(transitionParameters){return _super.call(this,transitionParameters)||this}
WipeTransition.prototype.initMaskFunctionParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.TOPTOBOTTOM&&this.transitionFilterInfo.isDirectionForward){
this.direction=WipeSubType.TOPTOBOTTOM}else if(
transitionSubType==TransitionSubType.TOPTOBOTTOM&&!this.transitionFilterInfo.isDirectionForward){
this.direction=WipeSubType.BOTTOMTOTOP}else if(
transitionSubType==TransitionSubType.LEFTTORIGHT&&this.transitionFilterInfo.isDirectionForward){
this.direction=WipeSubType.LEFTTORIGHT}else{this.direction=WipeSubType.RIGHTTOLEFT}};
WipeTransition.prototype.getMaskFunction=function(){
var isHorizontalDir=this.direction==WipeSubType.LEFTTORIGHT||this.direction==WipeSubType.RIGHTTOLEFT
var isBackwardDir=this.direction==WipeSubType.RIGHTTOLEFT||this.direction==WipeSubType.BOTTOMTOTOP;
return"\n        float getMaskValue(vec2 uv, float time) {\n            float progress = time;\n\n            float coord = "+(
isHorizontalDir?"uv.x":"uv.y")+";\n            "+(isBackwardDir?"coord = 1.0 - coord;":""
)+"\n            float mask = step(coord, progress);\n            return mask;\n        }\n\t\t"};
return WipeTransition}(ClippingTransition);SlideShow.WipeTransition=WipeTransition;
function IrisWipeTransition(transitionParameters){
var transitionSubType=transitionParameters.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.DIAMOND){return new SlideShow.DiamondTransition(
transitionParameters)}else{return new SlideShow.BoxTransition(transitionParameters)}}
SlideShow.IrisWipeTransition=IrisWipeTransition;function EllipseWipeTransition(transitionParameters
){var transitionSubType=transitionParameters.transitionFilterInfo.transitionSubtype;if(
transitionSubType!=TransitionSubType.VERTICAL){return new SlideShow.CircleTransition(
transitionParameters)}else{return new SlideShow.OvalTransition(transitionParameters)}}
SlideShow.EllipseWipeTransition=EllipseWipeTransition;function SlideWipeTransition(
transitionParameters){if(transitionParameters.transitionFilterInfo.isDirectionForward){
return new SlideShow.CoverTransition(transitionParameters)}else{
return new SlideShow.UncoverTransition(transitionParameters)}}
SlideShow.SlideWipeTransition=SlideWipeTransition;function BarWipeTransition(transitionParameters){
var transitionSubType=transitionParameters.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.FADEOVERCOLOR){return new SlideShow.CutTransition(
transitionParameters)}else{return new SlideShow.WipeTransition(transitionParameters)}}
SlideShow.BarWipeTransition=BarWipeTransition;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var DiagonalSubType;(
function(DiagonalSubType){DiagonalSubType[DiagonalSubType["BOTTOMLEFT"]=0]="BOTTOMLEFT";
DiagonalSubType[DiagonalSubType["TOPLEFT"]=1]="TOPLEFT";DiagonalSubType[DiagonalSubType["TOPRIGHT"
]=2]="TOPRIGHT";DiagonalSubType[DiagonalSubType["BOTTOMRIGHT"]=3]="BOTTOMRIGHT"})(DiagonalSubType||(
DiagonalSubType={}));var DiagonalTransition=function(_super){__extends(DiagonalTransition,_super);
function DiagonalTransition(transitionParameters){return _super.call(this,transitionParameters
)||this}DiagonalTransition.prototype.initMaskFunctionParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.HORIZONTALRIGHT&&!this.transitionFilterInfo.isDirectionForward
){this.direction=DiagonalSubType.BOTTOMLEFT}else if(
transitionSubType==TransitionSubType.HORIZONTALLEFT&&!this.transitionFilterInfo.isDirectionForward){
this.direction=DiagonalSubType.BOTTOMRIGHT}else if(
transitionSubType==TransitionSubType.HORIZONTALRIGHT){this.direction=DiagonalSubType.TOPRIGHT}else{
this.direction=DiagonalSubType.TOPLEFT}};DiagonalTransition.prototype.getMaskFunction=function(){
var startsFromRight=this.direction==DiagonalSubType.TOPRIGHT||this.direction==DiagonalSubType.BOTTOMRIGHT
var startsFromBottom=this.direction==DiagonalSubType.BOTTOMLEFT||this.direction==DiagonalSubType.BOTTOMRIGHT
return"\n                float getMaskValue(vec2 uv, float time) {\n                    float u_steps = 10.0f;\n\n                    float xCoord = "+(
startsFromRight?"1.0f - uv.x":"uv.x"
)+";\n                    float yCoord = floor(uv.y * u_steps) / u_steps;\n                    float yStep = "+(
startsFromBottom?"1.0f - yCoord":"yCoord"
)+";\n\n                    float stepDelay = 1.0f;\n                    float adjustedTime = time * 2.0f - yStep * stepDelay;\n\n                    float stepWidth = 1.0f;\n                    float mask = step(xCoord * stepWidth, adjustedTime);\n\n                    return mask;\n                }\n\t\t"
};return DiagonalTransition}(ClippingTransition);SlideShow.DiagonalTransition=DiagonalTransition;
function PushWipeTransition(transitionParameters){
var transitionSubType=transitionParameters.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.COMBHORIZONTAL||transitionSubType==TransitionSubType.COMBVERTICAL
){return new SlideShow.CombTransition(transitionParameters)}else{
return new SlideShow.PushTransition(transitionParameters)}}
SlideShow.PushWipeTransition=PushWipeTransition;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var CombSubType;(
function(CombSubType){CombSubType[CombSubType["COMBHORIZONTAL"]=0]="COMBHORIZONTAL";CombSubType[
CombSubType["COMBVERTICAL"]=1]="COMBVERTICAL"})(CombSubType||(CombSubType={}));
var CombTransition=function(_super){__extends(CombTransition,_super);function CombTransition(
transitionParameters){var _this=_super.call(this,transitionParameters)||this;_this.direction=0;
return _this}CombTransition.prototype.initProgramTemplateParams=function(){
var transitionSubType=this.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.COMBVERTICAL){this.direction=CombSubType.COMBVERTICAL}else{
this.direction=CombSubType.COMBHORIZONTAL}};CombTransition.prototype.getFragmentShader=function(){
var isVertical=this.direction==CombSubType.COMBVERTICAL;
return"#version 300 es\n                precision mediump float;\n\n                uniform sampler2D leavingSlideTexture;\n                uniform sampler2D enteringSlideTexture;\n                uniform float time;\n\n                in vec2 v_texCoord;\n                out vec4 outColor;\n\n                void main() {\n                    const float numTeeth = 20.0;\n\n                    float progress = smoothstep(0.0, 1.0, time);\n\n                    float coord = "+(
isVertical?"v_texCoord.x":"v_texCoord.y"
)+";\n\n                    float toothIndex = floor(coord * numTeeth);\n\n                    float moveDirection = mod(toothIndex, 2.0) == 0.0 ? 1.0 : -1.0;\n\n                    float offset = moveDirection * (1.0 - progress);\n\n                    float threshold = moveDirection > 0.0 ?\n                        "+(
isVertical?"v_texCoord.y":"v_texCoord.x")+" :\n                        "+(
isVertical?"1.0 - v_texCoord.y":"1.0 - v_texCoord.x"
)+";\n\n                    if (threshold < progress) {\n                       vec2 enteringCoord = "+(
isVertical?"vec2(v_texCoord.x, fract(v_texCoord.y + offset))":"vec2(fract(v_texCoord.x + offset), v_texCoord.y)"
)+";\n                       outColor = texture(enteringSlideTexture, enteringCoord);\n                    } else {\n                        vec2 leavingCoord = "+(
isVertical?"vec2(v_texCoord.x, fract(v_texCoord.y + offset))":"vec2(fract(v_texCoord.x + offset), v_texCoord.y)"
)+";\n                        outColor = texture(leavingSlideTexture, leavingCoord);\n                    }\n                }"
};return CombTransition}(Transition2d);SlideShow.CombTransition=CombTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var NoTransition=function(_super){__extends(NoTransition,_super
);function NoTransition(transitionParameters){return _super.call(this,transitionParameters)||this}
return NoTransition}(Transition2d);SlideShow.NoTransition=NoTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __values=this&&this.__values||function(o){
var s=typeof Symbol==="function"&&Symbol.iterator,m=s&&o[s],i=0;if(m)return m.call(o);if(
o&&typeof o.length==="number")return{next:function(){if(o&&i>=o.length)o=void 0;return{value:o&&o[
i++],done:!o}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")};
var __read=this&&this.__read||function(o,n){var m=typeof Symbol==="function"&&o[Symbol.iterator];if(
!m)return o;var i=m.call(o),r,ar=[],e;try{while((n===void 0||n-- >0)&&!(r=i.next()).done)ar.push(
r.value)}catch(error){e={error:error}}finally{try{if(r&&!r.done&&(m=i["return"]))m.call(i)}finally{
if(e)throw e.error}}return ar};var __spreadArray=this&&this.__spreadArray||function(to,from,pack){
if(pack||arguments.length===2)for(var i=0,l=from.length,ar;i<l;i++){if(ar||!(i in from)){if(!ar
)ar=Array.prototype.slice.call(from,0,i);ar[i]=from[i]}}return to.concat(
ar||Array.prototype.slice.call(from))};var SimpleTransition=function(_super){__extends(
SimpleTransition,_super);function SimpleTransition(transitionParameters){var _this=_super.call(this,
transitionParameters)||this;_this.leavingPrimitives=[];_this.enteringPrimitives=[];
_this.allOperations=[];_this.textures=[];
_this.leavingPrimitives=transitionParameters.leavingPrimitives;
_this.enteringPrimitives=transitionParameters.enteringPrimitives;
_this.allOperations=transitionParameters.allOperations;_this.textures=[transitionParameters.current,
transitionParameters.next];_this.initWebglFlags();_this.prepareTransition();return _this}
SimpleTransition.prototype.initWebglFlags=function(){if(this.context.isDisposed())return;
this.gl.disable(this.gl.DEPTH_TEST);this.gl.disable(this.gl.CULL_FACE);this.gl.enable(this.gl.BLEND)
this.gl.blendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA)};
SimpleTransition.prototype.initBuffers=function(){this.vao=this.gl.createVertexArray();
this.gl.bindVertexArray(this.vao);this.buffer=this.gl.createBuffer();if(!this.buffer){
throw new Error("Failed to create buffer")}this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer);
var initialPositions=new Float32Array([-1,-1,0,0,1,1,-1,0,1,1,-1,1,0,0,0,1,1,0,1,0]);
this.gl.bufferData(this.gl.ARRAY_BUFFER,initialPositions,this.gl.STATIC_DRAW);
var positionLocation=this.gl.getAttribLocation(this.program,"a_position");
var normalLocation=this.gl.getAttribLocation(this.program,"a_normal");
var texCoordLocation=this.gl.getAttribLocation(this.program,"a_texCoord");if(positionLocation!==-1){
this.gl.enableVertexAttribArray(positionLocation);this.gl.vertexAttribPointer(positionLocation,3,
this.gl.FLOAT,false,8*4,0)}if(normalLocation!==-1){this.gl.enableVertexAttribArray(normalLocation);
this.gl.vertexAttribPointer(normalLocation,3,this.gl.FLOAT,false,8*4,3*4)}if(texCoordLocation!==-1){
this.gl.enableVertexAttribArray(texCoordLocation);this.gl.vertexAttribPointer(texCoordLocation,2,
this.gl.FLOAT,false,8*4,6*4)}this.gl.bindBuffer(this.gl.ARRAY_BUFFER,null);this.gl.bindVertexArray(
null);console.debug("Simple Transition buffer initialized.")};
SimpleTransition.prototype.applyAllOperation=function(t){var e_1,_a;var matrix=mat4.create();try{
for(var _b=__values(this.allOperations),_c=_b.next();!_c.done;_c=_b.next()){var operation=_c.value;
matrix=operation.interpolate(matrix,t,1,1)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
_c&&!_c.done&&(_a=_b.return))_a.call(_b)}finally{if(e_1)throw e_1.error}}this.gl.uniformMatrix4fv(
this.gl.getUniformLocation(this.program,"u_operationsTransformMatrix"),false,matrix)};
SimpleTransition.prototype.applyLeavingOperations=function(t,operations){var e_2,_a;
var matrix=mat4.create();try{for(var operations_1=__values(operations),
operations_1_1=operations_1.next();!operations_1_1.done;operations_1_1=operations_1.next()){
var operation=operations_1_1.value;matrix=operation.interpolate(matrix,t,1,1)}}catch(e_2_1){e_2={
error:e_2_1}}finally{try{if(operations_1_1&&!operations_1_1.done&&(_a=operations_1.return))_a.call(
operations_1)}finally{if(e_2)throw e_2.error}}this.gl.uniformMatrix4fv(this.gl.getUniformLocation(
this.program,"u_primitiveTransformMatrix"),false,matrix)};
SimpleTransition.prototype.applyEnteringOperations=function(t,operations){var e_3,_a;
var matrix=mat4.create();try{for(var operations_2=__values(operations),
operations_2_1=operations_2.next();!operations_2_1.done;operations_2_1=operations_2.next()){
var operation=operations_2_1.value;matrix=operation.interpolate(matrix,t,1,1)}}catch(e_3_1){e_3={
error:e_3_1}}finally{try{if(operations_2_1&&!operations_2_1.done&&(_a=operations_2.return))_a.call(
operations_2)}finally{if(e_3)throw e_3.error}}this.gl.uniformMatrix4fv(this.gl.getUniformLocation(
this.program,"u_primitiveTransformMatrix"),false,matrix)};
SimpleTransition.prototype.displayPrimitive=function(t,textureType,textureNum,texturePrimitive,
textureName){var e_4,_a;this.gl.activeTexture(textureType);this.gl.bindTexture(this.gl.TEXTURE_2D,
this.textures[textureNum]);this.gl.uniform1i(this.gl.getUniformLocation(this.program,textureName),0)
try{for(var texturePrimitive_1=__values(texturePrimitive),
texturePrimitive_1_1=texturePrimitive_1.next(
);!texturePrimitive_1_1.done;texturePrimitive_1_1=texturePrimitive_1.next()){
var primitive=texturePrimitive_1_1.value;this.setBufferData(primitive.vertices);
this.applyLeavingOperations(t,primitive.operations);this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,
primitive.vertices.length)}}catch(e_4_1){e_4={error:e_4_1}}finally{try{if(
texturePrimitive_1_1&&!texturePrimitive_1_1.done&&(_a=texturePrimitive_1.return))_a.call(
texturePrimitive_1)}finally{if(e_4)throw e_4.error}}};
SimpleTransition.prototype.displaySlides_=function(t){this.applyAllOperation(t);
this.displayPrimitive(t,this.gl.TEXTURE0,0,this.leavingPrimitives,"slideTexture");
this.displayPrimitive(t,this.gl.TEXTURE0,1,this.enteringPrimitives,"slideTexture")};
SimpleTransition.prototype.render=function(nT){if(this.context.isDisposed())return;this.gl.viewport(
0,0,this.context.canvas.width,this.context.canvas.height);this.gl.clearColor(0,0,0,1);this.gl.clear(
this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT);this.gl.useProgram(this.program);
this.gl.uniform1f(this.gl.getUniformLocation(this.program,"time"),nT);this.gl.bindVertexArray(
this.vao);this.displaySlides_(nT);this.gl.bindVertexArray(null);app.map.fire("newslideshowframe",{
frame:this.gl.canvas})};SimpleTransition.prototype.setBufferData=function(vertices){var e_5,_a;
var positionData=[];try{for(var vertices_1=__values(vertices),vertices_1_1=vertices_1.next(
);!vertices_1_1.done;vertices_1_1=vertices_1.next()){var vertex=vertices_1_1.value;
positionData.push.apply(positionData,__spreadArray(__spreadArray(__spreadArray([],__read(
vertex.position),false),__read(vertex.normal),false),__read(vertex.texCoord),false))}}catch(e_5_1){
e_5={error:e_5_1}}finally{try{if(vertices_1_1&&!vertices_1_1.done&&(_a=vertices_1.return))_a.call(
vertices_1)}finally{if(e_5)throw e_5.error}}var positions=new Float32Array(positionData);
this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this.buffer);this.gl.bufferData(this.gl.ARRAY_BUFFER,
positions,this.gl.STATIC_DRAW)};return SimpleTransition}(SlideShow.Transition3d);
SlideShow.SimpleTransition=SimpleTransition;var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};function CubeTransition(transitionParameters,isOutside){if(isOutside===void 0){
isOutside=true}var slide=new Primitive;slide.pushTriangle([0,0],[1,0],[0,1]);slide.pushTriangle([1,0
],[0,1],[1,1]);var aLeavingPrimitives=[];aLeavingPrimitives.push(Primitive.cloneDeep(slide));if(
isOutside){slide.operations.push(makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),
vec3.fromValues(0,0,-1),90,false,false,0,1))}else{slide.operations.push(
makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),vec3.fromValues(0,0,1),-90,false,false,0,1))}
var aEnteringPrimitives=[];aEnteringPrimitives.push(slide);var aOperations=[];aOperations.push(
makeSScale(vec3.fromValues(.9,.9,.9),vec3.fromValues(0,0,0),true,0,.5));aOperations.push(makeSScale(
vec3.fromValues(1.1,1.1,1.1),vec3.fromValues(0,0,0),true,.5,1));if(isOutside){aOperations.push(
makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),vec3.fromValues(0,0,-1),-90,false,true,0,1))
}else{aOperations.push(makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),vec3.fromValues(0,0,1),
90,false,true,0,1))}var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:aOperations});return new SimpleTransition(newTransitionParameters)}
SlideShow.CubeTransition=CubeTransition;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};var HelixTransition=function(_super){
__extends(HelixTransition,_super);function HelixTransition(transitionParameters){return _super.call(
this,transitionParameters)||this}HelixTransition.prototype.displaySlides_=function(t){
this.applyAllOperation(t);if(t<.5)this.displayPrimitive(t,this.gl.TEXTURE0,0,this.leavingPrimitives,
"slideTexture");else this.displayPrimitive(t,this.gl.TEXTURE0,1,this.enteringPrimitives,
"slideTexture")};return HelixTransition}(SimpleTransition);function makeHelixTransition(
transitionParameters,nRows){if(nRows===void 0){nRows=20}var invN=1/nRows;var delayFactor=.2;
var iDn=0;var iPDn=invN;var aLeavingPrimitives=[];var aEnteringPrimitives=[];var aOperations=[];for(
var i=0;i<nRows;i++){var Tile_1=new Primitive;Tile_1.pushTriangle([1,iDn],[0,iDn],[0,iPDn]);
Tile_1.pushTriangle([1,iPDn],[1,iDn],[0,iPDn]);var leaveStartTime=Math.min(Math.max((i-nRows/2
)*invN/2,0),1);var leaveEndTime=Math.min(Math.max((i+nRows/2)*invN/2,0),1);Tile_1.operations.push(
makeSRotate(vec3.fromValues(0,1,0),vec3.fromValues(0,1,0),180,true,leaveStartTime,leaveEndTime));
aLeavingPrimitives.push(Primitive.cloneDeep(Tile_1));
var enterStartTime=leaveEndTime+delayFactor*invN;var enterEndTime=enterStartTime+(1-leaveEndTime);
Tile_1.operations.push(makeSRotate(vec3.fromValues(0,1,0),vec3.fromValues(0,1,0),-180,true,
enterStartTime,enterEndTime));aEnteringPrimitives.push(Tile_1);iDn+=invN;iPDn+=invN}
var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:aOperations});return new HelixTransition(newTransitionParameters)}
SlideShow.makeHelixTransition=makeHelixTransition;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};var FallTransition=function(_super){
__extends(FallTransition,_super);function FallTransition(transitionParameters){return _super.call(
this,transitionParameters)||this}FallTransition.prototype.displaySlides_=function(t){
this.applyAllOperation(t);this.displayPrimitive(t,this.gl.TEXTURE0,1,this.enteringPrimitives,
"slideTexture");this.displayPrimitive(t,this.gl.TEXTURE0,0,this.leavingPrimitives,"slideTexture")};
return FallTransition}(SimpleTransition);function makeFallTransition(transitionParameters){
var slide=new Primitive;slide.pushTriangle([0,0],[1,0],[0,1]);slide.pushTriangle([1,0],[0,1],[1,1]);
var aEnteringPrimitives=[];aEnteringPrimitives.push(Primitive.cloneDeep(slide));
slide.operations.push(makeRotateAndScaleDepthByWidth(vec3.fromValues(1,0,0),vec3.fromValues(0,-1,0),
90,true,true,0,1));var aLeavingPrimitives=[];aLeavingPrimitives.push(Primitive.cloneDeep(slide));
var aOperations=[];var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:aOperations});return new FallTransition(newTransitionParameters)}
SlideShow.makeFallTransition=makeFallTransition;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var ReflectionTransition=function(_super){__extends(ReflectionTransition,_super);
function ReflectionTransition(transitionParameters){return _super.call(this,transitionParameters
)||this}ReflectionTransition.prototype.displaySlides_=function(t){this.applyAllOperation(t);if(t<.5
){this.displayPrimitive(t,this.gl.TEXTURE0,0,this.leavingPrimitives,"slideTexture")}else{
this.displayPrimitive(t,this.gl.TEXTURE0,1,this.enteringPrimitives,"slideTexture")}};
return ReflectionTransition}(SimpleTransition);SlideShow.ReflectionTransition=ReflectionTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};var RochadeTransitionImp=function(_super){__extends(RochadeTransitionImp,_super);
function RochadeTransitionImp(transitionParameters){return _super.call(this,transitionParameters
)||this}RochadeTransitionImp.prototype.displaySlides_=function(t){this.applyAllOperation(t);if(t<.5
){this.displayPrimitive(t,this.gl.TEXTURE0,1,this.enteringPrimitives,"slideTexture");
this.displayPrimitive(t,this.gl.TEXTURE0,0,this.leavingPrimitives,"slideTexture")}else{
this.displayPrimitive(t,this.gl.TEXTURE0,0,this.leavingPrimitives,"slideTexture");
this.displayPrimitive(t,this.gl.TEXTURE0,1,this.enteringPrimitives,"slideTexture")}};
return RochadeTransitionImp}(SimpleTransition);function RochadeTransition(transitionParameters){
var slide=new Primitive;var w=2.2;var h=10;slide.pushTriangle([0,0],[1,0],[0,1]);slide.pushTriangle(
[1,0],[0,1],[1,1]);slide.operations.push(makeSEllipseTranslate(w,h,.25,-.25,true,0,1));
slide.operations.push(makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),vec3.fromValues(0,0,0),
-45,true,true,0,1));var aLeavingPrimitives=[];aLeavingPrimitives.push(Primitive.cloneDeep(slide));
slide.operations.push(makeSScale(vec3.fromValues(1,-1,1),vec3.fromValues(0,-1.02,0),false,-1,0));
aLeavingPrimitives.push(Primitive.cloneDeep(slide));slide.clear();slide.operations.push(
makeSEllipseTranslate(w,h,.75,.25,true,0,1));slide.operations.push(makeSTranslate(vec3.fromValues(0,
0,-h),false,-1,0));slide.operations.push(makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),
vec3.fromValues(0,0,0),-45,true,true,0,1));slide.operations.push(makeRotateAndScaleDepthByWidth(
vec3.fromValues(0,1,0),vec3.fromValues(0,0,0),45,true,false,-1,0));var aEnteringPrimitives=[
Primitive.cloneDeep(slide)];slide.operations.push(makeSScale(vec3.fromValues(1,-1,1),
vec3.fromValues(0,-1.02,0),false,-1,0));aEnteringPrimitives.push(Primitive.cloneDeep(slide));
var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,allOperations:[]});
return new RochadeTransitionImp(newTransitionParameters)}
SlideShow.RochadeTransition=RochadeTransition;var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};function TurnDownTransition(transitionParameters){var slide=new Primitive;
slide.pushTriangle([0,0],[1,0],[0,1]);slide.pushTriangle([1,0],[0,1],[1,1]);var aLeavingPrimitives=[
];aLeavingPrimitives.push(Primitive.cloneDeep(slide));slide.operations.push(makeSTranslate(
vec3.fromValues(0,0,1e-4),false,-1,0));slide.operations.push(makeSRotate(vec3.fromValues(0,0,1),
vec3.fromValues(-1,1,0),-90,true,0,1));slide.operations.push(makeSRotate(vec3.fromValues(0,0,1),
vec3.fromValues(-1,1,0),90,false,-1,0));var aEnteringPrimitives=[];aEnteringPrimitives.push(slide);
var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,allOperations:[]});
return new SimpleTransition(newTransitionParameters)}SlideShow.TurnDownTransition=TurnDownTransition
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};function Venetian3dTransition(
transitionParameters,vertical,parts){var t30=Math.tan(Math.PI/6);var ln=0;var p=1/parts;
var aLeavingPrimitives=[];var aEnteringPrimitives=[];for(var i=0;i<parts;i++){
var Slide=new Primitive;var n=(i+1)/parts;if(!vertical){Slide.pushTriangle([0,ln],[1,ln],[0,n]);
Slide.pushTriangle([1,ln],[0,n],[1,n]);Slide.operations.push(makeRotateAndScaleDepthByHeight(
vec3.fromValues(1,0,0),vec3.fromValues(0,1-n-ln,-t30*p),-120,true,true,0,1))}else{
Slide.pushTriangle([ln,0],[n,0],[ln,1]);Slide.pushTriangle([n,0],[ln,1],[n,1]);
Slide.operations.push(makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),vec3.fromValues(n+ln-1,0
,-t30*p),-120,true,true,0,1))}aLeavingPrimitives.push(Primitive.cloneDeep(Slide));if(!vertical){
Slide.operations.push(makeSRotate(vec3.fromValues(1,0,0),vec3.fromValues(0,1-2*n,0),-60,false,-1,0))
Slide.operations.push(makeSRotate(vec3.fromValues(1,0,0),vec3.fromValues(0,1-n-ln,0),180,false,-1,0)
)}else{Slide.operations.push(makeSRotate(vec3.fromValues(0,1,0),vec3.fromValues(2*n-1,0,0),-60,false
,-1,0));Slide.operations.push(makeSRotate(vec3.fromValues(0,1,0),vec3.fromValues(n+ln-1,0,0),180,
false,-1,0))}aEnteringPrimitives.push(Slide);ln=n}var newTransitionParameters=__assign(__assign({},
transitionParameters),{leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:[]});return new SimpleTransition(newTransitionParameters)}
SlideShow.Venetian3dTransition=Venetian3dTransition;var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};function TurnAroundTransition(transitionParameters){var slide=new Primitive;
slide.pushTriangle([0,0],[1,0],[0,1]);slide.pushTriangle([1,0],[0,1],[1,1]);var aLeavingPrimitives=[
];aLeavingPrimitives.push(Primitive.cloneDeep(slide));slide.operations.push(makeSScale(
vec3.fromValues(1,-1,1),vec3.fromValues(0,-1.02,0),false,-1,0));aLeavingPrimitives.push(
Primitive.cloneDeep(slide));slide.clear();slide.operations.push(makeRotateAndScaleDepthByWidth(
vec3.fromValues(0,1,0),vec3.fromValues(0,0,0),-180,true,false,0,1));var aEnteringPrimitives=[
Primitive.cloneDeep(slide)];slide.operations.push(makeSScale(vec3.fromValues(1,-1,1),
vec3.fromValues(0,-1.02,0),false,-1,0));aEnteringPrimitives.push(Primitive.cloneDeep(slide));
var aOperations=[];aOperations.push(makeSTranslate(vec3.fromValues(0,0,-1.5),true,0,.5));
aOperations.push(makeSTranslate(vec3.fromValues(0,0,1.5),true,.5,1));aOperations.push(
makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1,0),vec3.fromValues(0,0,0),-180,true,true,0,1));
var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:aOperations});return new ReflectionTransition(newTransitionParameters)}
SlideShow.TurnAroundTransition=TurnAroundTransition;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var PermTextureTransition=function(_super){__extends(PermTextureTransition,_super);
function PermTextureTransition(transitionParameters){var _this=_super.call(this,transitionParameters
)||this;_this.permutation256=[215,100,200,204,233,50,85,196,71,141,122,160,93,131,243,234,162,183,36
,155,4,62,35,205,40,102,33,27,255,55,214,156,75,163,134,126,249,74,197,228,72,90,206,235,17,22,49,
169,227,89,16,5,117,60,248,230,217,68,138,96,194,170,136,10,112,238,184,189,176,42,225,212,84,58,175
,244,150,168,219,236,101,208,123,37,164,110,158,201,78,114,57,48,70,142,106,43,232,26,32,252,239,98,
191,94,59,149,39,187,203,190,19,13,133,45,61,247,23,34,20,52,118,209,146,193,222,18,1,152,46,41,91,
148,115,25,135,77,254,147,224,161,9,213,223,250,231,251,127,166,63,179,81,130,139,28,120,151,241,86,
111,0,88,153,172,182,159,105,178,47,51,167,65,66,92,73,198,211,245,195,31,220,140,76,221,186,154,185
,56,83,38,165,109,67,124,226,132,53,229,29,12,181,121,24,207,199,177,113,30,80,3,97,188,79,216,173,8
,145,87,128,180,237,240,137,125,104,15,242,119,246,103,143,95,144,2,44,69,157,192,174,14,54,218,82,
64,210,11,6,129,21,116,171,99,202,7,107,253,108];_this.permTexture=_this.createPermTexture();
return _this}PermTextureTransition.prototype.createPermTexture=function(){var gl=this.gl;
var permTex=gl.createTexture();gl.bindTexture(gl.TEXTURE_2D,permTex);gl.texStorage2D(gl.TEXTURE_2D,1
,gl.RGBA8,256,256);var data=this.generatePermutationData();gl.texSubImage2D(gl.TEXTURE_2D,0,0,0,256,
256,gl.RGBA,gl.UNSIGNED_BYTE,data);gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.NEAREST);
gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.NEAREST);if(!permTex){throw new Error(
"Invalid extra texture object")}return permTex};
PermTextureTransition.prototype.generatePermutationData=function(){var a=new Uint8Array(256*256*4);
for(var y=0;y<256;y++){for(var x=0;x<256;x++){var base=(x+y*256)*4;var value=this.permutation256[(
y+this.permutation256[x])%256];a[base]=value;a[base+1]=value;a[base+2]=value;a[base+3]=255}}return a
};PermTextureTransition.prototype.displayPermSlide_=function(){this.gl.activeTexture(
this.gl.TEXTURE2);this.gl.bindTexture(this.gl.TEXTURE_2D,this.permTexture);this.gl.uniform1i(
this.gl.getUniformLocation(this.program,"permTexture"),2)};
PermTextureTransition.prototype.displaySlides_=function(t){this.gl.uniform1f(
this.gl.getUniformLocation(this.program,"time"),t);this.setBufferData(this.leavingPrimitives[0
].vertices);this.gl.activeTexture(this.gl.TEXTURE0);this.gl.bindTexture(this.gl.TEXTURE_2D,
this.textures[0]);this.gl.uniform1i(this.gl.getUniformLocation(this.program,"leavingSlideTexture"),0
);this.gl.activeTexture(this.gl.TEXTURE1);this.gl.bindTexture(this.gl.TEXTURE_2D,this.textures[1]);
this.gl.uniform1i(this.gl.getUniformLocation(this.program,"enteringSlideTexture"),1);
this.gl.drawArrays(this.gl.TRIANGLE_STRIP,0,this.leavingPrimitives[0].vertices.length);
this.displayPermSlide_()};return PermTextureTransition}(SimpleTransition);
SlideShow.PermTextureTransition=PermTextureTransition;var __extends=this&&this.__extends||function(
){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};var RippleTransitionImp=function(
_super){__extends(RippleTransitionImp,_super);function RippleTransitionImp(transitionParameters){
return _super.call(this,transitionParameters)||this}
RippleTransitionImp.prototype.displayPermSlide_=function(){
var centerUniform=this.gl.getUniformLocation(this.program,"center");this.gl.uniform2fv(centerUniform
,[.5,.5]);var slideRation=this.gl.getUniformLocation(this.program,"slideRatio");this.gl.uniform1f(
slideRation,1)};RippleTransitionImp.prototype.getFragmentShader=function(){
return"#version 300 es\n                precision mediump float;\n\n                #define M_PI 3.1415926535897932384626433832795\n\n\n                uniform sampler2D leavingSlideTexture;\n                uniform sampler2D enteringSlideTexture;\n                uniform float time;\n                uniform vec2 center;\n                uniform float slideRatio;\n\n                in vec2 v_texturePosition;\n                in vec3 v_normal;\n                out vec4 outColor;\n\n                float betterDistance(vec2 p1, vec2 p2)\n                {\n                    p1.x *= slideRatio;\n                    p2.x *= slideRatio;\n                    return distance(p1, p2);\n                }\n\n                void main() {\n                    const float w = 0.7;\n                    const float v = 0.1;\n\n                    float dist = betterDistance(center, v_texturePosition);\n\n                    float t = time * (sqrt(2.0) * (slideRatio < 1.0 ? 1.0 / slideRatio : slideRatio));\n\n                    float mixed = smoothstep(t*w-v, t*w+v, dist);\n\n                    vec2 offset = (v_texturePosition - center) * (sin(dist * 64.0 - time * 16.0) + 0.5) / 32.0;\n                    vec2 wavyTexCoord = mix(v_texturePosition + offset, v_texturePosition, time);\n\n                    vec2 pos = mix(wavyTexCoord, v_texturePosition, mixed);\n\n                    vec4 leaving = texture(leavingSlideTexture, pos);\n                    vec4 entering = texture(enteringSlideTexture, pos);\n                    outColor = mix(entering, leaving, mixed);\n                    \n                }\n"
};return RippleTransitionImp}(PermTextureTransition);function RippleTransition(transitionParameters
){var slide=new Primitive;slide.pushTriangle([0,0],[1,0],[0,1]);slide.pushTriangle([1,0],[0,1],[1,1]
);var aLeavingPrimitives=[];aLeavingPrimitives.push(Primitive.cloneDeep(slide));
var aEnteringPrimitives=[Primitive.cloneDeep(slide)];var newTransitionParameters=__assign(__assign(
{},transitionParameters),{leavingPrimitives:aLeavingPrimitives,
enteringPrimitives:aEnteringPrimitives,allOperations:[]});return new RippleTransitionImp(
newTransitionParameters)}SlideShow.RippleTransition=RippleTransition;
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};function NewsFlashTransition(
transitionParameters){var lSlide=new Primitive;var eSlide=new Primitive;lSlide.pushTriangle([0,0],[1
,0],[0,1]);lSlide.pushTriangle([1,0],[0,1],[1,1]);eSlide.pushTriangle([0,0],[1,0],[0,1]);
eSlide.pushTriangle([1,0],[0,1],[1,1]);lSlide.operations.push(makeSRotate(vec3.fromValues(0,0,1),
vec3.fromValues(0,0,0),3e3,true,0,.5));lSlide.operations.push(makeSScale(vec3.fromValues(.01,.01,.01
),vec3.fromValues(0,0,0),true,0,.5));lSlide.operations.push(makeSTranslate(vec3.fromValues(-1e4,0,0)
,false,.5,2));var aLeavingPrimitives=[lSlide];eSlide.operations.push(makeSRotate(vec3.fromValues(0,0
,1),vec3.fromValues(0,0,0),-3e3,true,.5,1));eSlide.operations.push(makeSTranslate(vec3.fromValues(
-100,0,0),false,-1,1));eSlide.operations.push(makeSTranslate(vec3.fromValues(100,0,0),false,.5,1));
eSlide.operations.push(makeSScale(vec3.fromValues(.01,.01,.01),vec3.fromValues(0,0,0),false,-1,1));
eSlide.operations.push(makeSScale(vec3.fromValues(100,100,100),vec3.fromValues(0,0,0),true,.5,1));
var aEnteringPrimitives=[eSlide];var aOperations=[];aOperations.push(makeSRotate(vec3.fromValues(0,0
,1),vec3.fromValues(.2,.2,0),1080,true,0,1));var newTransitionParameters=__assign(__assign({},
transitionParameters),{leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:aOperations});return new SimpleTransition(newTransitionParameters)}
SlideShow.NewsFlashTransition=NewsFlashTransition;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};var DissolveTransition3dImp=function(
_super){__extends(DissolveTransition3dImp,_super);function DissolveTransition3dImp(
transitionParameters){return _super.call(this,transitionParameters)||this}
DissolveTransition3dImp.prototype.getFragmentShader=function(){
return"#version 300 es\n                precision mediump float;\n\n                uniform sampler2D leavingSlideTexture;\n                uniform sampler2D enteringSlideTexture;\n                uniform sampler2D permTexture;\n                uniform float time;\n\n                in vec2 v_texturePosition;\n                in vec3 v_normal;\n                out vec4 outColor;\n\n                float snoise(vec2 P) {\n                    return texture(permTexture, P).r;\n                }\n\n                void main() {\n                    float sn = snoise(10.0*v_texturePosition);\n                    if( sn < time)\n                        outColor = texture(enteringSlideTexture, v_texturePosition);\n                    else\n                        outColor = texture(leavingSlideTexture, v_texturePosition);\n                }\n                "
};return DissolveTransition3dImp}(PermTextureTransition);function DissolveTransition3d(
transitionParameters){var slide=new Primitive;slide.pushTriangle([0,0],[1,0],[0,1]);
slide.pushTriangle([1,0],[0,1],[1,1]);var aLeavingPrimitives=[];aLeavingPrimitives.push(
Primitive.cloneDeep(slide));var aEnteringPrimitives=[Primitive.cloneDeep(slide)];
var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,allOperations:[]});
return new DissolveTransition3dImp(newTransitionParameters)}
SlideShow.DissolveTransition3d=DissolveTransition3d;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var s,i=1,
n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,
p))t[p]=s[p]}return t};return __assign.apply(this,arguments)};
var __values=this&&this.__values||function(o){var s=typeof Symbol==="function"&&Symbol.iterator,
m=s&&o[s],i=0;if(m)return m.call(o);if(o&&typeof o.length==="number")return{next:function(){if(
o&&i>=o.length)o=void 0;return{value:o&&o[i++],done:!o}}};throw new TypeError(
s?"Object is not iterable.":"Symbol.iterator is not defined.")};var FlipTilesTransition=function(
_super){__extends(FlipTilesTransition,_super);function FlipTilesTransition(transitionParameters){
return _super.call(this,transitionParameters)||this}
FlipTilesTransition.prototype.initWebglFlags=function(){this.gl.enable(this.gl.DEPTH_TEST);
this.gl.depthFunc(this.gl.LEQUAL);this.gl.enable(this.gl.CULL_FACE);this.gl.cullFace(this.gl.BACK);
this.gl.disable(this.gl.BLEND)};FlipTilesTransition.prototype.processPrimitives=function(t,
texturePrimitive,applyOperations){var e_1,_a;try{for(var texturePrimitive_1=__values(
texturePrimitive),texturePrimitive_1_1=texturePrimitive_1.next(
);!texturePrimitive_1_1.done;texturePrimitive_1_1=texturePrimitive_1.next()){
var primitive=texturePrimitive_1_1.value;this.setBufferData(primitive.vertices);
applyOperations.call(this,t,primitive.operations);this.gl.drawArrays(this.gl.TRIANGLES,0,
primitive.vertices.length)}}catch(e_1_1){e_1={error:e_1_1}}finally{try{if(
texturePrimitive_1_1&&!texturePrimitive_1_1.done&&(_a=texturePrimitive_1.return))_a.call(
texturePrimitive_1)}finally{if(e_1)throw e_1.error}}};
FlipTilesTransition.prototype.displaySlides_=function(t){this.applyAllOperation(t);
this.gl.activeTexture(this.gl.TEXTURE0);this.gl.bindTexture(this.gl.TEXTURE_2D,this.textures[1]);
this.gl.uniform1i(this.gl.getUniformLocation(this.program,"slideTexture"),0);this.processPrimitives(
t,this.enteringPrimitives,this.applyEnteringOperations);this.gl.activeTexture(this.gl.TEXTURE0);
this.gl.bindTexture(this.gl.TEXTURE_2D,this.textures[0]);this.gl.uniform1i(
this.gl.getUniformLocation(this.program,"slideTexture"),0);this.processPrimitives(t,
this.leavingPrimitives,this.applyLeavingOperations)};return FlipTilesTransition}(SimpleTransition);
function vec(x,y,nx,ny){x=x<0?0:x;x=Math.min(x,nx);y=y<0?0:y;y=Math.min(y,ny);return[x/nx,y/ny]}
function calculateMidpoint(vec1,vec2){return[(vec1[0]+vec2[0])/2,(vec1[1]+vec2[1])/2,(vec1[2]+vec2[2
])/2]}function makeFlipTilesTransition(transitionParameters,n,m){if(n===void 0){n=8}if(m===void 0){
m=6}var aLeavingPrimitives=[];var aEnteringPrimitives=[];for(var x=0;x<n;x++){for(var y=0;y<n;y++){
var aTile=new Primitive;var x11=vec(x,y,n,m);var x12=vec(x,y+1,n,m);var x21=vec(x+1,y,n,m);
var x22=vec(x+1,y+1,n,m);aTile.pushTriangle(x21,x11,x12);aTile.pushTriangle(x22,x21,x12);
aTile.operations.push(makeSRotate(vec3.fromValues(0,1,0),calculateMidpoint(aTile.getVertex(1),
aTile.getVertex(3)),180,true,x11[0]*x11[1]/2,(x22[0]*x22[1]+1)/2));aLeavingPrimitives.push(
Primitive.cloneDeep(aTile));aTile.operations.push(makeSRotate(vec3.fromValues(0,1,0),
calculateMidpoint(aTile.getVertex(1),aTile.getVertex(3)),-180,false,x11[0]*x11[1]/2,(x22[0]*x22[1]+1
)/2));aEnteringPrimitives.push(aTile)}}var newTransitionParameters=__assign(__assign({},
transitionParameters),{leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:[]});return new FlipTilesTransition(newTransitionParameters)}
SlideShow.makeFlipTilesTransition=makeFlipTilesTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var __assign=this&&this.__assign||function(){
__assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(
var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign.apply(
this,arguments)};var StaticNoiseTransitionImp=function(_super){__extends(StaticNoiseTransitionImp,
_super);function StaticNoiseTransitionImp(transitionParameters){return _super.call(this,
transitionParameters)||this}StaticNoiseTransitionImp.prototype.getFragmentShader=function(){
return"#version 300 es\n\t\t\t\tprecision mediump float;\n\n\t\t\t\tuniform sampler2D leavingSlideTexture;\n\t\t\t\tuniform sampler2D enteringSlideTexture;\n\t\t\t\tuniform sampler2D permTexture;\n\t\t\t\tuniform float time;\n\n\t\t\t\tin vec2 v_texturePosition;\n\t\t\t\tin vec3 v_normal;\n\t\t\t\tout vec4 outColor;\n\n\t\t\t\tfloat snoise(vec2 P) {\n\t\t\t\t\treturn texture(permTexture, P).r;\n\t\t\t\t}\n\n\t\t\t\t#define PART 0.5\n\t\t\t\t#define START 0.4\n\t\t\t\t#define END 0.9\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tfloat sn = snoise(10.0 * v_texturePosition + time * 0.07);\n\t\t\t\t\t\n\t\t\t\t\tif (time < PART) {\n\t\t\t\t\t\tfloat sn1 = snoise(vec2(time * 15.0, 20.0 * v_texturePosition.y));\n\t\t\t\t\t\tfloat sn2 = snoise(v_texturePosition);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (sn1 > 1.0 - time * time && sn2 < 2.0 * time + 0.1)\n\t\t\t\t\t\t\toutColor = vec4(sn, sn, sn, 1.0);\n\t\t\t\t\t\telse if (time > START)\n\t\t\t\t\t\t\toutColor = mix(texture(leavingSlideTexture, v_texturePosition), vec4(sn, sn, sn, 1.0), (time - START) / (PART - START));\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\toutColor = texture(leavingSlideTexture, v_texturePosition);\n\t\t\t\t\t} else if (time > END) {\n\t\t\t\t\t\toutColor = mix(vec4(sn, sn, sn, 1.0), texture(enteringSlideTexture, v_texturePosition), (time - END) / (1.0 - END));\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutColor = vec4(sn, sn, sn, 1.0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t"
};return StaticNoiseTransitionImp}(PermTextureTransition);function StaticNoiseTransition(
transitionParameters){var slide=new Primitive;slide.pushTriangle([0,0],[1,0],[0,1]);
slide.pushTriangle([1,0],[0,1],[1,1]);var aLeavingPrimitives=[];aLeavingPrimitives.push(
Primitive.cloneDeep(slide));slide.operations.push(makeRotateAndScaleDepthByWidth(vec3.fromValues(0,1
,0),vec3.fromValues(0,0,-1),90,false,false,0,1));var aEnteringPrimitives=[];
aEnteringPrimitives.push(slide);var aOperations=[];aOperations.push(makeRotateAndScaleDepthByWidth(
vec3.fromValues(0,1,0),vec3.fromValues(0,0,-1),-90,false,true,0,1));
var newTransitionParameters=__assign(__assign({},transitionParameters),{
leavingPrimitives:aLeavingPrimitives,enteringPrimitives:aEnteringPrimitives,
allOperations:aOperations});return new StaticNoiseTransitionImp(newTransitionParameters)}
SlideShow.StaticNoiseTransition=StaticNoiseTransition;function MicsShapeWipeTransition(
transitionParameters){
var transitionSubType=transitionParameters.transitionFilterInfo.transitionSubtype;if(
transitionSubType==TransitionSubType.CORNERSOUT){return SlideShow.CubeTransition(
transitionParameters,true)}else if(transitionSubType==TransitionSubType.LEFTTORIGHT){
return SlideShow.makeFallTransition(transitionParameters)}else if(
transitionSubType==TransitionSubType.TOPTOBOTTOM){return SlideShow.TurnAroundTransition(
transitionParameters)}else if(transitionSubType==TransitionSubType.TOPLEFT){
return new SlideShow.NoTransition(transitionParameters)}else if(
transitionSubType==TransitionSubType.TOPRIGHT){return SlideShow.TurnDownTransition(
transitionParameters)}else if(transitionSubType==TransitionSubType.BOTTOMRIGHT){
return SlideShow.RochadeTransition(transitionParameters)}else if(
transitionSubType==TransitionSubType.BOTTOMLEFT){return SlideShow.Venetian3dTransition(
transitionParameters,true,8)}else if(transitionSubType==TransitionSubType.TOPCENTER){
return SlideShow.Venetian3dTransition(transitionParameters,false,6)}else if(
transitionSubType==TransitionSubType.RIGHTCENTER){return SlideShow.StaticNoiseTransition(
transitionParameters)}else if(transitionSubType==TransitionSubType.BOTTOMCENTER){
return SlideShow.DissolveTransition3d(transitionParameters)}else if(
transitionSubType==TransitionSubType.CORNERSIN){return SlideShow.CubeTransition(transitionParameters
,false)}else if(transitionSubType==TransitionSubType.VERTICAL){return new SlideShow.NoTransition(
transitionParameters)}else if(transitionSubType==TransitionSubType.HORIZONTAL){
return SlideShow.RippleTransition(transitionParameters,false)}else if(
transitionSubType==TransitionSubType.CIRCLE){return new SlideShow.NoTransition(transitionParameters)
}else if(transitionSubType==TransitionSubType.FANOUTHORIZONTAL){
return SlideShow.makeHelixTransition(transitionParameters,20)}else if(
transitionSubType==TransitionSubType.ACROSS){return SlideShow.makeFlipTilesTransition(
transitionParameters,8,6)}else if(transitionSubType==TransitionSubType.DIAMOND){
return new SlideShow.NoTransition(transitionParameters)}else if(
transitionSubType==TransitionSubType.HEART){return new SlideShow.NoTransition(transitionParameters)}
}SlideShow.MicsShapeWipeTransition=MicsShapeWipeTransition;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var vec3=glMatrix.vec3,mat4=glMatrix.mat4;
var RotateAndScaleDepth=function(_super){__extends(RotateAndScaleDepth,_super);
function RotateAndScaleDepth(axis,origin,angle,scale,mbInterpolate,mnT0,mnT1,isDepthByWidth){
var _this=_super.call(this)||this;_this.axis=vec3.create();_this.origin=vec3.create();_this.angle=0;
_this.scale=false;_this.mbInterpolate=false;_this.mnT0=0;_this.mnT1=0;_this.isDepthByWidth=true;
_this.axis=axis;_this.origin=origin;_this.angle=OpsHelper.deg2rad(angle);_this.scale=scale;
_this.mbInterpolate=mbInterpolate;_this.mnT0=mnT0;_this.mnT1=mnT1;
_this.isDepthByWidth=isDepthByWidth;return _this}RotateAndScaleDepth.prototype.interpolate=function(
matrix,t,SlideWidthScale,SlideHeightScale){if(t<=this.mnT0){return matrix}if(
!this.mbInterpolate||t>this.mnT1){t=this.mnT1}t=OpsHelper.intervalInter(t,this.mnT0,this.mnT1);
var translationVector=vec3.fromValues(SlideWidthScale*this.origin[0],SlideHeightScale*this.origin[1]
,(this.isDepthByWidth?SlideWidthScale:SlideHeightScale)*this.origin[2]);
var scaleVector=vec3.fromValues(SlideWidthScale*SlideWidthScale,SlideHeightScale*SlideHeightScale,1)
mat4.translate(matrix,matrix,translationVector);if(this.scale){mat4.scale(matrix,matrix,scaleVector)
}mat4.rotate(matrix,matrix,this.angle*t,this.axis);if(this.scale){mat4.scale(matrix,matrix,
vec3.fromValues(1/scaleVector[0],1/scaleVector[1],1/scaleVector[2]))}mat4.translate(matrix,matrix,
vec3.negate(vec3.create(),translationVector));return matrix};return RotateAndScaleDepth}(Operation);
function makeRotateAndScaleDepthByWidth(axis,origin,angle,scale,mbInterpolate,mnT0,mnT1){
return new RotateAndScaleDepth(axis,origin,angle,scale,mbInterpolate,mnT0,mnT1,true)}
function makeRotateAndScaleDepthByHeight(axis,origin,angle,scale,mbInterpolate,mnT0,mnT1){
return new RotateAndScaleDepth(axis,origin,angle,scale,mbInterpolate,mnT0,mnT1,false)}
SlideShow.makeRotateAndScaleDepthByWidth=makeRotateAndScaleDepthByWidth;
SlideShow.makeRotateAndScaleDepthByHeight=makeRotateAndScaleDepthByHeight;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var vec3=glMatrix.vec3,mat4=glMatrix.mat4;
var SEllipseTranslate=function(_super){__extends(SEllipseTranslate,_super);
function SEllipseTranslate(dWidth,dHeight,dStartPosition,dEndPosition,bInter,T0,T1){
var _this=_super.call(this)||this;_this.width=0;_this.height=0;_this.startPosition=0;
_this.endPosition=0;_this.mbInterpolate=false;_this.mnT0=0;_this.mnT1=0;_this.width=dWidth;
_this.height=dHeight;_this.startPosition=dStartPosition;_this.endPosition=dEndPosition;
_this.mbInterpolate=bInter;_this.mnT0=T0;_this.mnT1=T1;return _this}
SEllipseTranslate.prototype.interpolate=function(matrix,t,SlideWidthScale,SlideHeightScale){if(
t<=this.mnT0)return matrix;if(!this.mbInterpolate||t>this.mnT1)t=this.mnT1;
t=OpsHelper.intervalInter(t,this.mnT0,this.mnT1);var a1=this.startPosition*2*Math.PI;var a2=(
this.startPosition+t*(this.endPosition-this.startPosition))*2*Math.PI;var x=this.width*(Math.cos(a2
)-Math.cos(a1))/2;var y=this.height*(Math.sin(a2)-Math.sin(a1))/2;mat4.translate(matrix,matrix,
vec3.fromValues(x,0,y));return matrix};return SEllipseTranslate}(Operation);
function makeSEllipseTranslate(dWidth,dHeight,dStartPosition,dEndPosition,bInter,T0,T1){
return new SEllipseTranslate(dWidth,dHeight,dStartPosition,dEndPosition,bInter,T0,T1)}
SlideShow.makeSEllipseTranslate=makeSEllipseTranslate;var __extends=this&&this.__extends||function(
){var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var vec3=glMatrix.vec3,
mat4=glMatrix.mat4;var SRotate=function(_super){__extends(SRotate,_super);function SRotate(axis,
origin,angle,mbInterpolate,mnT0,mnT1){var _this=_super.call(this)||this;_this.axis=vec3.create();
_this.origin=vec3.create();_this.angle=0;_this.mbInterpolate=false;_this.mnT0=0;_this.mnT1=0;
_this.axis=axis;_this.origin=origin;_this.angle=OpsHelper.deg2rad(angle);
_this.mbInterpolate=mbInterpolate;_this.mnT0=mnT0;_this.mnT1=mnT1;return _this}
SRotate.prototype.interpolate=function(matrix,t,SlideWidthScale,SlideHeightScale){if(t<=this.mnT0
)return matrix;if(!this.mbInterpolate||t>this.mnT1)t=this.mnT1;t=OpsHelper.intervalInter(t,this.mnT0
,this.mnT1);var translationVector=vec3.fromValues(SlideWidthScale*this.origin[0],
SlideHeightScale*this.origin[1],this.origin[2]);var scaleVector=vec3.fromValues(
SlideWidthScale*SlideWidthScale,SlideHeightScale*SlideHeightScale,1);mat4.translate(matrix,matrix,
translationVector);mat4.scale(matrix,matrix,scaleVector);mat4.rotate(matrix,matrix,this.angle*t,
this.axis);mat4.scale(matrix,matrix,vec3.fromValues(1/scaleVector[0],1/scaleVector[1],1/scaleVector[
2]));mat4.translate(matrix,matrix,vec3.negate(vec3.create(),translationVector));return matrix};
return SRotate}(Operation);function makeSRotate(axis,origin,angle,mbInterpolate,mnT0,mnT1){
return new SRotate(axis,origin,angle,mbInterpolate,mnT0,mnT1)}SlideShow.makeSRotate=makeSRotate;
var __extends=this&&this.__extends||function(){var extendStatics=function(d,b){
extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b
}||function(d,b){for(var p in b)if(Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};
return extendStatics(d,b)};return function(d,b){if(typeof b!=="function"&&b!==null
)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");
extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(
__.prototype=b.prototype,new __)}}();var vec3=glMatrix.vec3,mat4=glMatrix.mat4;var SScale=function(
_super){__extends(SScale,_super);function SScale(scale,origin,mbInterpolate,mnT0,mnT1){
var _this=_super.call(this)||this;_this.scale=vec3.create();_this.origin=vec3.create();
_this.mbInterpolate=false;_this.mnT0=0;_this.mnT1=0;_this.scale=scale;_this.origin=origin;
_this.mbInterpolate=mbInterpolate;_this.mnT0=mnT0;_this.mnT1=mnT1;return _this}
SScale.prototype.scaleMatrix=function(matrix,t,scale){var scaleFactor=vec3.create();vec3.scale(
scaleFactor,scale,t);vec3.add(scaleFactor,scaleFactor,[1-t,1-t,1-t]);var scaledMatrix=mat4.clone(
matrix);mat4.scale(scaledMatrix,scaledMatrix,scaleFactor);return scaledMatrix};
SScale.prototype.interpolate=function(matrix,t,SlideWidthScale,SlideHeightScale){if(t<=this.mnT0
)return matrix;if(!this.mbInterpolate||t>this.mnT1)t=this.mnT1;t=OpsHelper.intervalInter(t,this.mnT0
,this.mnT1);var translationVector=vec3.fromValues(SlideWidthScale*this.origin[0],
SlideHeightScale*this.origin[1],this.origin[2]);mat4.translate(matrix,matrix,translationVector);
matrix=this.scaleMatrix(matrix,t,this.scale);mat4.translate(matrix,matrix,vec3.negate(vec3.create(),
translationVector));return matrix};return SScale}(Operation);function makeSScale(scale,origin,
mbInterpolate,mnT0,mnT1){return new SScale(scale,origin,mbInterpolate,mnT0,mnT1)}
SlideShow.makeSScale=makeSScale;var __extends=this&&this.__extends||function(){
var extendStatics=function(d,b){extendStatics=Object.setPrototypeOf||{__proto__:[]
}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)if(
Object.prototype.hasOwnProperty.call(b,p))d[p]=b[p]};return extendStatics(d,b)};return function(d,b
){if(typeof b!=="function"&&b!==null)throw new TypeError("Class extends value "+String(b
)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}
d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}}();var vec3=glMatrix.vec3,
mat4=glMatrix.mat4;var STranslate=function(_super){__extends(STranslate,_super);function STranslate(
vector,mbInterpolate,mnT0,mnT1){var _this=_super.call(this)||this;_this.mbInterpolate=false;
_this.mnT0=0;_this.mnT1=0;_this.vector=vector;_this.mbInterpolate=mbInterpolate;_this.mnT0=mnT0;
_this.mnT1=mnT1;return _this}STranslate.prototype.interpolate=function(matrix,t,SlideWidthScale,
SlideHeightScale){if(t<=this.mnT0)return matrix;if(!this.mbInterpolate||t>this.mnT1)t=this.mnT1;
t=OpsHelper.intervalInter(t,this.mnT0,this.mnT1);mat4.translate(matrix,matrix,vec3.fromValues(
SlideWidthScale*t*this.vector[0],SlideHeightScale*t*this.vector[1],t*this.vector[2]));return matrix}
return STranslate}(Operation);function makeSTranslate(vector,mbInterpolate,mnT0,mnT1){
return new STranslate(vector,mbInterpolate,mnT0,mnT1)}SlideShow.makeSTranslate=makeSTranslate;
window.L.PosAnimation=window.L.Class.extend({includes:window.L.Mixin.Events,run:function(el,newPos,
duration,easeLinearity){this.stop();this._el=el;this._el.dataset.transitioning=true;
this._inProgress=true;this._newPos=newPos;this.fire("start");if(duration<=0){el.style[
window.L.DomUtil.TRANSITION]="";window.L.DomUtil.setPosition(el,newPos);this._el._leaflet_pos=newPos
this._inProgress=false;this.fire("step").fire("end");this._el.dataset.transitioning=false;return}
el.style[window.L.DomUtil.TRANSITION]="all "+(isNaN(duration)?.25:0)+"s cubic-bezier(0,0,"+(
easeLinearity||.5)+",1)";window.L.DomEvent.on(el,window.L.DomUtil.TRANSITION_END,
this._onTransitionEnd,this);window.L.DomUtil.setPosition(el,newPos);app.util.falseFn(el.offsetWidth)
this._stepTimer=setInterval(window.L.bind(this._onStep,this),50)},stop:function(){if(
!this._inProgress){return}window.L.DomUtil.setPosition(this._el,this._getPos());
this._onTransitionEnd();app.util.falseFn(this._el.offsetWidth)},_onStep:function(){
var stepPos=this._getPos();if(
!stepPos||this._el._leaflet_pos.x==stepPos.x&&this._el._leaflet_pos.y==stepPos.y){
this._onTransitionEnd();return}this._el._leaflet_pos=stepPos;this.fire("step")},
_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var left,top,
matches,el=this._el,style=window.getComputedStyle(el);if(window.L.Browser.any3d){matches=style[
window.L.DomUtil.TRANSFORM].match(this._transformRe);if(!matches){return}left=parseFloat(matches[1])
top=parseFloat(matches[2])}else{left=parseFloat(style.left);top=parseFloat(style.top)}
return new cool.Point(left,top,true)},_onTransitionEnd:function(){window.L.DomEvent.off(this._el,
window.L.DomUtil.TRANSITION_END,this._onTransitionEnd,this);if(!this._inProgress){return}
this._inProgress=false;this._el.style[window.L.DomUtil.TRANSITION]="";
this._el._leaflet_pos=this._newPos;clearInterval(this._stepTimer);this.fire("step").fire("end");
this._el.dataset.transitioning=false}});
window.L.PosAnimation=window.L.DomUtil.TRANSITION?window.L.PosAnimation:window.L.PosAnimation.extend(
{run:function(el,newPos,duration,easeLinearity){this.stop();this._el=el;this._inProgress=true;
this._duration=duration||.25;this._easeOutPower=1/Math.max(easeLinearity||.5,.2);
this._startPos=window.L.DomUtil.getPosition(el);this._offset=newPos.subtract(this._startPos);
this._startTime=+new Date;this.fire("start");this._animate()},stop:function(){if(!this._inProgress){
return}this._step();this._complete()},_animate:function(){this._animId=app.util.requestAnimFrame(
this._animate,this);this._step()},_step:function(){var elapsed=+new Date-this._startTime,
duration=this._duration*1e3;if(elapsed<duration){this._runFrame(this._easeOut(elapsed/duration))
}else{this._runFrame(1);this._complete()}},_runFrame:function(progress){var pos=this._startPos.add(
this._offset.multiplyBy(progress));window.L.DomUtil.setPosition(this._el,pos);this.fire("step")},
_complete:function(){app.util.cancelAnimFrame(this._animId);this._inProgress=false;this.fire("end")
},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}});
window.L.Control.ScrollAnnotation=window.L.Control.extend({options:{position:"topright",
arrowUp:"0x25b2",arrowUpTitle:_("Scroll up annotations"),arrowDown:"0x25bc",arrowDownTitle:_(
"Scroll down annotations")},onAdd:function(map){var scrollName="leaflet-control-scroll",
container=window.L.DomUtil.create("div","cool-bar");this._map=map;this._buttonUp=this._createButton(
this.options.arrowUp,this.options.arrowUpTitle,scrollName+"-up",container,this._onScrollUp,this);
this._buttonDown=this._createButton(this.options.arrowDown,this.options.arrowDownTitle,
scrollName+"-down",container,this._onScrollDown,this);return container},_onScrollUp:function(){
this._map.fire("AnnotationScrollUp")},_onScrollDown:function(){this._map.fire("AnnotationScrollDown"
)},_createButton:function(html,title,className,container,fn,context){
var link=window.L.DomUtil.create("a",className,container);link.innerHTML=String.fromCharCode(html);
link.href="#";link.title=title;var stop=window.L.DomEvent.stopPropagation;window.L.DomEvent.on(link,
"click",stop).on(link,"mousedown",stop).on(link,"dblclick",stop).on(link,"click",
window.L.DomEvent.preventDefault).on(link,"click",fn,context);return link}});
window.L.control.scrollannotation=function(options){return new window.L.Control.ScrollAnnotation(
options)};(function(global){var wopiParams={};var wopiSrc=global.coolParams.get("WOPISrc");if(
wopiSrc!==""&&accessToken!==""){wopiParams={access_token:accessToken,access_token_ttl:accessTokenTTL
};if(noAuthHeader=="1"||noAuthHeader=="true"){wopiParams.no_auth_header=noAuthHeader}}else if(
wopiSrc!==""&&accessHeader!==""){wopiParams={access_header:accessHeader}}
var filePath=global.coolParams.get("file_path");app.localeService=new LocaleService;
app.setPermission(global.coolParams.get("permission")||"edit");
app.serverConnectionService=new ServerConnectionService;app.layoutingService=new LayoutingService;
var timestamp=global.coolParams.get("timestamp");var target=global.coolParams.get("target")||"";
var alwaysActive=global.coolParams.get("alwaysactive");var debugMode=global.coolParams.get("debug");
var docURL,docParams;var isWopi=false;if(wopiSrc!=""){docURL=decodeURIComponent(wopiSrc);
docParams=wopiParams;isWopi=true}else{docURL=filePath;docParams={}}
var notWopiButIframe=global.coolParams.get("NotWOPIButIframe")!="";var map=window.L.map("map",{
server:host,doc:docURL,docParams:docParams,timestamp:timestamp,docTarget:target,
documentContainer:"document-container",debug:debugMode,wopi:isWopi,wopiSrc:wopiSrc,
notWopiButIframe:notWopiButIframe,alwaysActive:alwaysActive,idleTimeoutSecs:idleTimeoutSecs,
outOfFocusTimeoutSecs:outOfFocusTimeoutSecs});map.uiManager=new UIManager;map.addControl(
map.uiManager);if(!window.L.Browser.cypressTest)map.tooltip=window.L.control.tooltip();
map.uiManager.initializeBasicUI();if(wopiSrc===""&&filePath===""&&!window.ThisIsAMobileApp){
map.uiManager.showInfoModal("wrong-wopi-src-modal","",errorMessages.wrongwopisrc,"",_("OK"),null,
false)}if(host===""&&!window.ThisIsAMobileApp){map.uiManager.showInfoModal("empty-host-url-modal",""
,errorMessages.emptyhosturl,"",_("OK"),null,false)}window.L.Map.THIS=map;app.map=map;
app.idleHandler.map=map;if(window.ThisIsTheEmscriptenApp){var docParamsString=$.param(docParams);
var docParamsPart=docParamsString?(docURL.includes("?")?"&":"?")+docParamsString:"";
var encodedWOPI=encodeURIComponent(docURL+docParamsPart);globalThis.Module=createEmscriptenModule(
docURL,encodedWOPI,isWopi);globalThis.Module.onRuntimeInitialized=function(){map.loadDocument(
global.socket)};createOnlineModule(globalThis.Module)}else{map.loadDocument(global.socket)}
window.addEventListener("beforeunload",function(){if(map&&app.socket){if(app.socket.setUnloading
)app.socket.setUnloading();app.socket.close()}});window.bundlejsLoaded=true;
var uaLowerCase=navigator.userAgent.toLowerCase();if(uaLowerCase.indexOf("msie"
)!=-1||uaLowerCase.indexOf("trident")!=-1){map.uiManager.showInfoModal("browser-not-supported-modal"
,"",_("Warning! The browser you are using is not supported."),"",_("OK"),null,false)}})(window)})(
window);(function () {
    function patchFindReplaceTabs() {
        // Кнопка "Найти"
        var f = document.querySelector('#find_tab_btn button[aria-label="Find"]');
        if (f) {
            f.innerHTML = 'На<u class="access-key">й</u>ти';
            f.setAttribute('aria-label', 'Найти');
            f.accessKey = 'й';
        }

        // Кнопка "Заменить"
        var r = document.querySelector('#replace_tab_btn button[aria-label="Replace"]');
        if (r) {
            r.innerHTML = 'За<u class="access-key">м</u>енить';
            r.setAttribute('aria-label', 'Заменить');
            r.accessKey = 'м';
        }
    }

    function patchSizeMenus() {
        // Ширина
        var w0 = document.querySelector('#Data-ColumnMenuWidth-entry-0 span');
        if (w0 && w0.textContent === 'Width...') {
            w0.textContent = 'Ширина...';
        }

        // Оптимальная ширина
        var w1 = document.querySelector('#Data-ColumnMenuWidth-entry-1 span');
        if (w1 && w1.textContent === 'Optimal Width...') {
            w1.textContent = 'Оптимальная ширина...';
        }

        // Высота
        var h0 = document.querySelector('#Data-RowMenuHeight-entry-0 span');
        if (h0 && h0.textContent === 'Height...') {
            h0.textContent = 'Высота...';
        }

        // Оптимальная высота
        var h1 = document.querySelector('#Data-RowMenuHeight-entry-1 span');
        if (h1 && h1.textContent === 'Optimal Height...') {
            h1.textContent = 'Оптимальная высота...';
        }
    }

    // Список сортировки: дни недели / месяцы / Nissan…
    function patchSortUserList() {
        var select = document.getElementById('sortuserlb-input');
        if (!select) {
            return;
        }

        for (var i = 0; i < select.options.length; i++) {
            var opt = select.options[i];
            var text = opt.text.trim();

            if (text === 'Sun,Mon,Tue,Wed,Thu,Fri,Sat') {
                opt.text = 'Вс,Пн,Вт,Ср,Чт,Пт,Сб';
            }

            if (text === 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday') {
                opt.text = 'Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота';
            }

            if (text === 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec') {
                opt.text = 'Янв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек';
            }

            if (text === 'January,February,March,April,May,June,July,August,September,October,November,December') {
                opt.text = 'Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь';
            }

            if (text === 'Nissan,Iyar,Sivan,Tammuz,Av,Elul,Tishri,Heshvan,Kislev,Tevet,Shevat,Adar,Adar B') {
                opt.text = 'Нисан,Ияр,Сиван,Таммуз,Ав,Элул,Тишри,Хешван,Кислев,Тевет,Шеват,Адар,Адар II';
            }
        }
    }

    // Of-Pie, 3D Scheme, Size of composite wedge
    function patchChartWizard() {
        var wizard = document.querySelector('form.lokdialog_container');
        if (!wizard) {
            return;
        }
        if (wizard.getAttribute('data-chart-ru-patched') === '1') {
            return;
        }
        var allReady = true;

        // --- Of-Pie ---
        var typeLabels = wizard.querySelectorAll('span.jsdialog.ui-treeview-cell-text-content');
        if (typeLabels && typeLabels.length) {
            for (var i = 0; i < typeLabels.length; i++) {
                var span = typeLabels[i];
                if (span.textContent.trim() === 'Of-Pie') {
                    span.textContent = 'Часть круговой';
                    break;
                }
            }
        } else {
            allReady = false;
        }

        // --- 3D Scheme: ---
        var schemeLabel = wizard.querySelector('[id="3dschemeft"]');
        if (schemeLabel) {
            var schemeText = (schemeLabel.textContent || '').trim();
            if (!schemeText) {
                allReady = false;
            } else if (schemeText.indexOf('3D') !== -1 || schemeText.indexOf('Scheme') !== -1) {
                schemeLabel.innerHTML = '3D <u class="access-key">С</u>хема:';
            }
        } else {
            allReady = false;
        }

        var compositeLabel = wizard.querySelector('[id="compositesizeft"]');
        if (compositeLabel) {
            var compositeText = (compositeLabel.textContent || '').trim();
            if (!compositeText) {
                allReady = false;
            } else if (compositeText.indexOf('Size of composite wedge') !== -1) {
                compositeLabel.innerHTML = '<u class="access-key">Р</u>азмер составного сектора';
            }
        } else {
            allReady = false;
        }

        if (allReady) {
            wizard.setAttribute('data-chart-ru-patched', '1');
        }
    }

    function patchAutoSumDropdownPosition() {
        var anchor = window.__homeAutoSumAnchorEl;
        if (!anchor) return;

        var dd = document.getElementById('Formula-AutoSumMenu-dropdown');
        if (!dd) return;

        if (dd.getAttribute('data-home-autosum-positioned') === '1') return;

        requestAnimationFrame(function () {
            try {
                var r = anchor.getBoundingClientRect();

                dd.style.position = 'fixed';
                dd.style.marginInlineStart = '0px';
                dd.style.marginTop = '0px';

                var left = r.left;
                var top = r.bottom + 4;

                var w = dd.offsetWidth || 0;
                var maxLeft = (window.innerWidth || document.documentElement.clientWidth) - w - 8;
                if (maxLeft > 0) left = Math.min(left, maxLeft);
                if (left < 8) left = 8;

                var h = dd.offsetHeight || 0;
                var maxTop = (window.innerHeight || document.documentElement.clientHeight) - h - 8;
                if (maxTop > 0) top = Math.min(top, maxTop);
                if (top < 8) top = 8;

                dd.style.left = left + 'px';
                dd.style.top = top + 'px';

                dd.setAttribute('data-home-autosum-positioned', '1');
            } catch (e) {}
        });
    }

    function patchAutoSumToHome() {
        var home = document.getElementById('Home-container');
        if (!home) return;

        if (home.querySelector('[data-home-autosum-clone="1"]')) return;

        var src = document.getElementById('Formula-AutoSumMenu');
        var srcBtn = document.getElementById('Formula-AutoSumMenu-button');
        if (!src || !srcBtn) return;

        var clone = src.cloneNode(true);
        clone.setAttribute('data-home-autosum-clone', '1');

        clone.removeAttribute('id');
        var ids = clone.querySelectorAll('[id]');
        for (var i = 0; i < ids.length; i++) ids[i].removeAttribute('id');

        clone.addEventListener('click', function (e) {
            e.preventDefault();
            e.stopPropagation();

            window.__homeAutoSumAnchorEl = clone.querySelector('button') || clone;

            var dd = document.getElementById('Formula-AutoSumMenu-dropdown');
            if (dd) dd.removeAttribute('data-home-autosum-positioned');

            try { srcBtn.click(); } catch (err) {}

            patchAutoSumDropdownPosition();
            setTimeout(patchAutoSumDropdownPosition, 0);
        }, true);

        var toolboxes = home.querySelectorAll('.notebookbar.horizontal.toolbox.level-0');
        var target = (toolboxes && toolboxes.length) ? toolboxes[toolboxes.length - 1] : home;
        target.appendChild(clone);
    }



    function patchAll() {
        patchFindReplaceTabs();
        patchSizeMenus();
        patchSortUserList();
        patchChartWizard();
        patchAutoSumToHome();
        patchAutoSumDropdownPosition();
    }

    if (typeof MutationObserver !== 'undefined') {
        var mo = new MutationObserver(patchAll);
        if (document && document.body) {
            mo.observe(document.body, { childList: true, subtree: true });
            patchAll();
        }
    } else {
        if (document && document.body) {
            document.addEventListener('DOMContentLoaded', patchAll);
        }
    }
})();
