/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):(t="undefined"!=typeof globalThis?globalThis:t||self,n(t.exontrol={}))}(this,function(t){"use strict";function n(t){return null!=t}function i(t){return void 0===t}function e(t){return null==t}function r(t){try{t=JSON.parse(t)}catch(t){}return t}function s(t){return t&&D(t.x,t[0])||0}function o(t){return t&&D(t.y,t[1])||0}function h(t){return t instanceof Array}function a(t){return"string"==typeof t}function u(t){return V.N.IsN(t)}function c(t){return V.N.IsInt(t)}function l(t){return t instanceof Map}function f(t){return t instanceof V.Arr}function g(t){return t instanceof Function}function d(t){return t instanceof Date}function v(t){return t instanceof Object}function p(t){return t instanceof HTMLCanvasElement}function C(t){return t instanceof HTMLInputElement}function m(t){return t instanceof HTMLSelectElement}function S(){var t=Date.Now();return t.setUTCHours(0,0,0,0),t}function E(t){return t.toLowerCase()}function A(t){return t.toLocaleLowerCase()}function w(t){return t.toUpperCase()}function R(t){return t.toLocaleUpperCase()}function b(t,n,i){return t.substr(n,i)}function T(t,n,i){return t.indexOf(n,i)}function y(t){return t.trim()}function O(t,n){return V.ToS(t,n)}function D(t,n){return V.ToN(t,n)}function P(t,n){return V.ToI(t,n)}function W(t,n){return V.ToB(t,n)}function I(t,n,i){return e(t)?~~i:V.s2F(t,n)}function L(t,n){return t.measureText(n).width}function M(t,n,i){return V.bin(n.length,function(e){return L(t,b(n,0,e))=r)for(;e&&sthis.length)&&(n=this.length),i(b(this,n-t.length,n))==i(t)}function F(t){return t.exontrol=t.exontrol||{}}function N(t){return t.exontrol=t.exontrol||{}}function B(t){return t&&t.exontrol||null}function z(t,n,i){var e,r;return n&&(e={callback:null,thisArg:null,lock:0,name:null,equal:function(t){return t&&this.callback==t.callback&&this.thisArg==t.thisArg}},g(n)||(e.thisArg=n,e.name=a(i)&&i||t,n=g(i)&&i||n[e.name]),g(n)&&((r=e).callback=n)),r}function U(t){var n,i=1;return t?~(n=T("[]*?#",t))&&(i=n+2):i=7,i}var V=V||{version:"4.4"},K=new Date(2018,0,1,6,0,0),Q=new Date(2018,0,1,18,0,0),q=(new Date).getTimezoneOffset(),_=!0,Z="",Y=",",j=" ",J="#",$="/",tt=":",nt=";",it="=",et="<",rt=">",st=".",ot="...",ht="0123456789ABCDEF",at="0",ut="\\",ct="'",lt="\t",ft="\r\n",gt=Math.PI,dt=2*gt-gt/3600,vt=32768,pt="bold",Ct="italic",mt="on",St=Math.max,Et=Math.min,At=Math.abs,wt=Math.round,Rt=Date.prototype,bt=String.prototype,Tt=Array.prototype,yt=CanvasRenderingContext2D.prototype;Object.addPrototypeOf=function(t,n){for(var i=t,e=this.getPrototypeOf(i);e!==Object.prototype;e=this.getPrototypeOf(i))i=e;return this.setPrototypeOf(i,n),t},Math.trunc||(Math.trunc=function(t){return t=+t,isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t}),Math.sign||(Math.sign=function(t){return(t>0)-(t<0)||+t}),bt.sWith=bt.startsWith=function(t,n){return H.call(this,t,n)},bt.sWithI=function(t,n){return H.call(this,t,n,A)},bt.eWith=bt.endsWith=function(t,n){return X.call(this,t,n)},bt.eWithI=function(t,n){return X.call(this,t,n,A)},bt.expTab=function(){return this.replace(/\t/g,_?" ":Z)},bt.countOf=function(t){var n=t.length,i=0,e=-n;if(n)for(;-1!=(e=T(this,t,e+n));)i++;return i},bt.repAll=function(t,n){var i=Z,e=0,r=-1,s=t.length;if(s)for(;~(r=T(this,t,e));)i+=b(this,e,r-e)+n,e=r+s;return i+=b(this,e)},bt.toProper=function(){return R(this.charAt(0))+A(b(this,1))},bt.toReverse=function(){for(var t=Z,n=this.length-1;n>=0;n--)t+=this.charAt(n);return t},bt.ltrim=function(){for(var t=this.length,n=0;n=0;)n++;return b(this,n)},bt.rtrim=function(){for(var t=this.length-1;t>=0&&-1!=T("\t ",this.charAt(t));)t--;return b(this,0,t+1)},bt.splitP=function(t,n,i){function r(t){return e(n)||t.length=0&&(g+=d0?-1:0),u+=a}return r(s)&&s.push(h?u:this),s},bt.splitQ=function(t,i,e){function r(t){var n=t.trim();if((s=n.length)>1&&i==n.charAt(0)&&i==n.charAt(s-1)){t="";for(var e,r=0,s=(n=n.substr(1,s-2)).length;r=r});!u;){if(m&&(p=this.indexOf(i,g),v&&~p))for(var S=g;S1&&!(i=6==t)&&n>2&&(i=t>V.days-n),i},Date.Conv=function(){var t=function(){var t=new Map,n=31536e3;return t.set(0,n),t.set(1,n/2),t.set(2,7884e3),t.set(16,2628e3),t.set(17,876e3),t.set(256,604800),t.set(4096,86400),t.set(65536,3600),t.set(1048576,60),t.set(16777216,1),t}();return function(n,i,e){return n&&i!=e&&(n*=t.get(i)/t.get(e)),n}}(),Rt.gH2=function(){return this.getTime()+nt+V.Loc.Get().language},Rt.isValid=function(){return!isNaN(this.valueOf())},Rt.toString=function(){return this.toUTCString()},Rt.toFormat=function(){var t=J;return t+=this.GetMonth(),t+=$,t+=this.GetDay(),t+=$,t+=this.GetYear(),(this.GetHour()||this.GetMinute()||this.GetSecond())&&(t+=j,t+=V.Pad0(this.GetHour(),2),t+=tt,t+=V.Pad0(this.GetMinute(),2),t+=tt,t+=V.Pad0(this.GetSecond(),2)),t+=J},Rt.toLocDS=function(t,n){return this.toLocaleDateString(t,n)},Rt.toLocTS=function(t,n){return this.toLocaleTimeString(t,n)},Rt.copy=function(){return new Date(this.getTime())},Rt.yDay=function(){return wt((Date.Date(this)-Date.Create(this.GetYear()))/V.msday)},Rt.add=function(t){return t&&this.setTime(this.getTime()+t),this},Rt.addD=function(t){return this.add((t||0)*V.msday)},Rt.SetDate=function(t,n,i,e,r,s){return this.setTime(Date.Create(t,n,i,e,r,s).getTime()),this},Rt.GetYear=function(){return this.getUTCFullYear()},Rt.SetYear=function(t){return this.setUTCFullYear(t),this},Rt.GetHalfYear=function(){return Math.trunc((this.GetMonth()-1)/6)},Rt.GetQuarterYear=function(){return Math.trunc((this.GetMonth()-1)/3)},Rt.GetMonth=function(){return this.getUTCMonth()+1},Rt.SetMonth=function(t){return this.setUTCMonth(t-1),this},Rt.GetThirdMonth=function(){return Et(2,Math.trunc(St(0,this.GetDay()-1)/10))},Rt.GetDay=function(){return this.getUTCDate()},Rt.SetDay=function(t){return this.setUTCDate(t),this},Rt.GetWeekDay=function(){return this.getUTCDay()},Rt.GetYearDay=function(){return 1+this.yDay()},Rt.GetHour=function(){return this.getUTCHours()},Rt.SetHour=function(t){return this.setUTCHours(t),this},Rt.IsAM=function(){return this.GetHour()<12},Rt.GetHourAM=function(){var t=this.GetHour();return 0==(t=t<12?t:t-12)?12:t},Rt.GetMinute=function(){return this.getUTCMinutes()},Rt.SetMinute=function(t){return this.setUTCMinutes(t),this},Rt.GetSecond=function(){return this.getUTCSeconds()},Rt.SetSecond=function(t){return this.setUTCSeconds(t),this},Date.U2N=function(t){return V.f2S(t,V.UnitEnum)},Date.S2I=function(t){return P(t,1)},Rt.CbkN=function(t){return this[Date.U2N(t).replace("ex","Next")]},Rt.Next=function(t,n){var i=this.CbkN(t);return i&&i.call(this,n)||this},Rt.CbkP=function(t){return this[Date.U2N(t).replace("ex","Prev")]},Rt.Prev=function(t,n){var i=this.CbkP(t);return i&&i.call(this,n)||this},Rt.GetUnit=function(t){var n=Date.U2N(t).replace("ex","Get");return this[n]&&this[n]()},Rt.Reset=function(t){var n=this.GetYear();switch(t){case 0:this.SetDate(n,1,1,0,0,0,0);break;case 1:this.SetDate(n,1+6*this.GetHalfYear(),1,0,0,0,0);break;case 2:this.SetDate(n,1+3*this.GetQuarterYear(),1,0,0,0,0);break;case 16:this.SetDate(n,this.GetMonth(),1,0,0,0,0);break;case 17:this.SetDate(n,this.GetMonth(),10*this.GetThirdMonth()+1,0,0,0,0);break;case 256:this.SetDate(n,this.GetMonth(),this.GetDay(),0,0,0,0),this.PrevDay(this.WeekOff());break;case 4096:this.setUTCHours(0,0,0,0);break;case 65536:this.setUTCMinutes(0,0,0);break;case 1048576:this.setUTCSeconds(0,0);break;case 16777216:this.setUTCMilliseconds(0)}return this},Rt.NextYear=function(t){return(t=Date.S2I(t))&&this.SetYear(this.GetYear()+t),this},Rt.PrevYear=function(t){return this.NextYear(-Date.S2I(t))},Rt.NextHalfYear=function(t){return(t=Date.S2I(t))?this.NextMonth(t*V.months/2):this},Rt.PrevHalfYear=function(t){return this.NextHalfYear(-Date.S2I(t))},Rt.NextQuarterYear=function(t){return(t=Date.S2I(t))?this.NextMonth(t*V.months/4):this},Rt.PrevQuarterYear=function(t){return this.NextQuarterYear(-Date.S2I(t))},Rt.NextMonth=function(t){return(t=Date.S2I(t))&&this.SetMonth(this.GetMonth()+t),this},Rt.PrevMonth=function(t){return this.NextMonth(-Date.S2I(t))},Rt.NextThirdMonth=function(t){return(t=Date.S2I(t))&&(this.NextDay(10*t),31==this.GetDay()&&this.NextDay(Math.sign(t))),this},Rt.PrevThirdMonth=function(t){return this.NextThirdMonth(-Date.S2I(t))},Rt.NextWeek=function(t){return(t=Date.S2I(t))&&this.NextDay(t*V.days),this},Rt.PrevWeek=function(t){return this.NextWeek(-Date.S2I(t))},Rt.NextDay=function(t){return(t=Date.S2I(t))&&this.SetDay(this.GetDay()+t),this},Rt.PrevDay=function(t){return this.NextDay(-Date.S2I(t))},Rt.NextHour=function(t){return(t=Date.S2I(t))&&this.SetHour(this.GetHour()+t),this},Rt.PrevHour=function(t){return this.NextHour(-Date.S2I(t))},Rt.NextMinute=function(t){return(t=Date.S2I(t))&&this.SetMinute(this.GetMinute()+t),this},Rt.PrevMinute=function(t){return this.NextMinute(-Date.S2I(t))},Rt.NextSecond=function(t){return(t=Date.S2I(t))&&this.SetSecond(this.GetSecond()+t),this},Rt.PrevSecond=function(t){return this.NextSecond(-Date.S2I(t))},Rt.Compare=function(t){return Math.trunc((this.getTime()-t.getTime())/1e3)},Rt.WeekOff=function(){var t=this.GetWeekDay()-V.Loc.Get().firstWeekDay;return t<0&&(t+=V.days),t},Rt.WeekColDay=function(){var t=this.copy().Reset(16),n=this.GetWeekDay()-t.GetWeekDay();return n&&(n<0&&(n=V.days+n),t.NextDay(n)),t},Rt.IsWknd=function(){return Date.IsWknd(this.GetWeekDay(),V.Loc.Get().weekend)},Rt.Min=function(t){return this-t<0?this:t},Rt.Max=function(t){return this-t>0?this:t};var Ot=0;Rt.GetWeekNo=Rt.GetWeek=function(t){var n,i=(t=t||V.Loc.Get()||{}).firstWeekDay||0,e=this.GetYear(),r=Date.Date(this),s=V.days;if(t.weekNumberAs){var o=Date.Create(e).GetWeekDay();if((n=1+Math.trunc((this.GetYearDay()+(o>=i?o-i:s-(i-o))-1)/s))>52){var h=Date.Create(e+1);o=h.GetWeekDay();var a=h.copy();a.addD(-(o>=i?o-i:s-(i-o))),r>=a&&(n=1)}}else{var u,c=Date.Create(e,1,4),l=c.GetWeekDay()-i;if(l<0&&(l+=s),u=wt((r.getTime()-c.getTime())/V.msday)+l,n=u<0?Date.Create(e-1,12,31).GetWeekNo():1+Math.trunc(u/s),!Ot&&n>52){Ot++;var f=1,g=r.copy();for(g.addD(-1);n==g.GetWeekNo();g.addD(-1))f++;for((g=r.copy()).addD(1);n==g.GetWeekNo();g.addD(1))f++;f=0,t.bDisplayAMPM=n),n?this.GetHourAM():this.GetHour()},Rt.QHH=function(t){return V.Pad0(this.QH(t),2)},Rt.QH12=function(){return this.GetHourAM()},Rt.QHH12=function(){return V.Pad0(this.GetHourAM(),2)},Rt.QN=function(){return this.GetMinute()},Rt.QNN=function(){return V.Pad0(this.GetMinute(),2)},Rt.QS=function(){return this.GetSecond()},Rt.QSS=function(){return V.Pad0(this.GetSecond(),2)},Rt.QAMPM=function(){return V.Loc.Get().ampm[this.IsAM()?0:1]},Rt.QL_AMPM=function(){return this.IsAM()?V.GetAM():V.GetPM()},Rt.QL_AP=function(){return b(this.QL_AMPM(),0,1)},Rt.QL_TIME=function(){return this.toLocTS()},Rt.QL_TIME24=function(){return this.toLocTS(void 0,{hour12:!1})},Rt.QL_TSEP=function(){return Date.Today().toLocTS(void 0,{hour12:!1,hour:"numeric",minute:"numeric"}).repAll(at,Z)},Rt.QL_Y=function(){return this.QL_YY().toString().slice(-1)},Rt.QL_YY=function(){return this.toLocDS(void 0,{year:"2-digit"})},Rt.QL_YYYY=function(){return this.toLocDS(void 0,{year:"numeric"})},Rt.QFMT=function(t){for(var n,i,e,r,s=Z,o=0,h=t.length;o=2*gt)!function(r){var s=.5522847498*i,o=.5522847498*e,h=(t-=i)+2*i,a=(n-=e)+2*e,u=t+i,c=n+e;r.moveTo(t,c),r.bezierCurveTo(t,c-o,u-s,n,u,n),r.bezierCurveTo(u+s,n,h,c-o,h,c),r.bezierCurveTo(h,c+o,u+s,a,u,a),r.bezierCurveTo(u-s,a,t,c+o,t,c)}(this);else{var c,l=o-s;l<0&&(s+=l,l=-l),c=a(s),this.moveTo(c.x,c.y);do{var f=Et(gt/2,l);u(this,s,f),s+=f,l-=f}while(l>0)}this.closePath()}),yt.selClip=function(t,n,i){V.Clip.Select(this,t,n,i)},yt.locClip=function(t){V.Clip.Local(this,t)},yt.resClip=function(){V.Clip.Restore(this)},yt.onReleaseClip=function(t,n){V.Clip.OnReleaseClip(this,t,n)},yt.gAO=function(){return this.exontrol&&this.exontrol.oAO},yt.drawArr=function(t,n,i){V.DrawArr(this,t,n,i)},yt.drawDir=function(t,n,i,e){V.DrawDir(this,t,n,i,e)},Tt.forEach||(Tt.forEach=function(t,n){n=n||this;for(var i=0,e=this.length;i>1)?r=e:s=e;return r},V.bfn=function(t,n,i,e,r){r=r||0;for(var s=(t+n)/2,o=tr;)(h=o*i.call(e,s=(t+n)/2))&&(h>0?t=s:n=s);return s},V.expO=function(t,n,i,e,r){i=i||n;for(var s in t){var o,h=(r||V).setM(s),a=(r||V).getM(s);h in i&&!(h in n)&&(n[h]=i[h].bind(i)),a in i&&!(a in n)&&(n[a]=i[a].bind(i)),(n[a]||n[h])&&(o=(r||V).getP(s))&&(e||!(o in n))&&Object.defineProperty(n,o,{get:n[a],set:n[h],configurable:!0})}},V.expOL=function(t,n,i,e){V.expO(t,n,i,e,V.expL())},V.expL=function(t,n){return{getM:function(n){return(t||"get")+V.getP(n)},setM:function(t){return(n||"set")+V.getP(t)},getP:function(t){return t}}},V.toU=function(t,n){return 0==t?t:t+(n||"px")},V.f2S=function(){var t=new Map;return function(n,i){var e=function(n,i){var e=t.get(i);if(!e){t.set(i,e=new Map);for(var r in i)e.set(i[r],r)}return e.get(n)||Z}(n,i);if(!e&&i){var r=n,s=[],o=[];for(var h in i)o.push({f:h,v:i[h]});o.sort(function(t,n){return n.v-t.v}),o.forEach(function(t){var i=t.v;i&&i==(i&n)&&(s.push(t.f),n&=~i)}),e=s.reverse().join(),n&&(e&&(e+=" | "),e+="0x"+V.ToH(n)),t.get(i).set(r,e)}return e}}(),V.s2F=function(){var t=new Map;return function(n,i){var r,s=~~n;return!s&&a(n)&&i&&(!(r=t.get(i))&&t.set(i,r=new Map),e(s=r.get(n))&&r.set(n,s=function(t){var n=0;return E(t).split(Y).forEach(function(t){if(t){if(c(t))t=P(t);else{var e,r=[];for(var s in i)~(e=E(s).indexOf(t))&&r.push({p:e,v:i[s]});r.length>1&&r.sort(function(t,n){return t.p-n.p}),t=r.length&&r[0].v||0}n|=t}}),n}(n))),s}}(),V.sCSS=function(t){try{if(t){var n=V.doc.styleSheets;if(n)for(var i,e,r=0,s=n.length;r1&&((n=y(e[1]))&&(i.width=~~n),r>2&&(n=y(e[2]))&&(i.offset=~~e[2]))),i},V.ToGRA=function(t){var n,i={color:"black",mode:1,blend:0,vRT:null},e=O(t).split(nt),r=e.length;return r&&((n=y(e[0]))&&(i.color=V.ToCLR(n)),r>1&&((n=y(e[1]))&&(i.mode=~~n),r>2&&(n=y(e[2]))&&(i.blend=~~e[2]))),i},V.ToCLR=function(t,n,i){return t=O(t)?function(t,n){var i=!0;n=E(n);for(var e=0,r=t.length;i&&e=0&&(f=b(i,0,d),g=b(i,d+1)),h){for(var v=Z,p=f.length;p>h;p-=h)v+=a,v+=b(f,p-h,h);f=b(f,0,p)+v}if(i=f,c||i!==at||(i=Z),g&&(i+=o,i+=g),i.length||(i=at),t<0)switch(u){case 0:i="("+i+")";break;case 2:i="- "+i;break;case 3:i+="-";break;case 4:i+=" -";break;default:i="-"+i}}else i=V.Def.Intl.formatNumber.format(t);else i=t.toLocaleString();return i},V.Currency=function(t){return t=parseFloat(t)||0,V.Def.Intl.formatCurrency?V.Def.Intl.formatCurrency.format(t):t.toLocaleString()},V.IsDigitCode=function(t){return t>47&&t<58},V.IsDigitChar=function(t){return t&&1==t.length&&V.IsDigitCode(t.charCodeAt(0))},V.IsDigit=function(t,n){return V.IsDigitCode(t.charCodeAt(n))},V.Pad0=function(t,n){var i=t+Z;n=D(n,2);for(var e=i.length;e64&&t<91||t>96&&t<123},V.IsAlphaChar=function(t){return t&&1==t.length&&V.IsAlphaCode(t.charCodeAt(0))},V.IsAlpha=function(t,n){return V.IsAlphaCode(t.charCodeAt(n))},V.IsAlphaNumCode=function(t){return V.IsDigitCode(t)||V.IsAlphaCode(t)},V.IsAlphaNum=function(t,n){return V.IsAlphaNumCode(t.charCodeAt(n))},V.IsPlusCode=function(t){return 43==t},V.IsPlus=function(t,n){return V.IsPlusCode(t.charCodeAt(n))},V.IsMinusCode=function(t){return 45==t},V.IsMinus=function(t,n){return V.IsMinusCode(t.charCodeAt(n))},V.IsPlusChar=function(t){return t&&1==t.length&&V.IsPlusCode(t.charCodeAt(0))},V.IsHexaCode=function(t){return V.IsDigitCode(t)||t>64&&t<71||t>96&&t<103},V.IsHC=function(t){return t&&1==t.length&&V.IsHexaCode(t.charCodeAt(0))},V.parseHex=function(t){t=y(t||Z);for(var n=Z,i=Z,e=0,r=t.length;e=0}).call(i.t,t)?function(t){try{var n=new XMLHttpRequest;i.s=e(t),n.oO=i,i.e&&(n.onerror=i.e.bind(i.t)),n.onreadystatechange=function(){this.readyState==(XMLHttpRequest.DONE||4)&&this.oO.i.call(this.oO.t,n.responseText,this.oO.s)},n.open("GET",t),n.send(null)}catch(t){i.e&&i.e.call(i.t,t)}}(t):t.files instanceof FileList?function(t){try{if(t.files.length){var n=t.files[0],r=new FileReader,s=r.readAsBinaryString||r.readAsText;i.s=e(n.name),r.oO=i,r.onloadend=function(t){t.target.readyState==(FileReader.DONE||2)&&t.target.oO.i.call(t.target.oO.t,t.target.result,t.target.oO.s)},s.call(r,n.slice())}}catch(t){i.e&&i.e.call(i.t,t)}}(t):i.i.call(i.t,t))},V.SEP=function(t){if(t)try{t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation()}catch(t){}},V.tchEv=function(t){return 2&V.rurPE&&t instanceof TouchEvent},V.V2T=function(t){if(null===t)return 2;if(i(t))return 1;switch(typeof t){case"string":return 4;case"number":return t===~~t?8:16;case"boolean":return 32;case"object":return h(t)?256:d(t)?512:64;case"function":return 128}return 1},V.GetFont=function(t){var n=new Map;return function(t){var i=t?"string"==typeof t?t:t.font:V.defCanvasFont,e=i,r=n.get(i);if(!r){var s=V.fPX,o=i.search(s);if(-1==o&&(o=(i=V.defCanvasFont).search(V.fPX)),-1!=o){var h,a,u,c=y(b(i,0,o));i=b(i,o),h=parseInt(i),(i=i.replace(s,Z)).length&&("/"==i.charAt(0)&&(i=b(i,1),a=parseInt(i),i=b(i,i.search(/\s/))),u=y(i)),r={style:c,size:h,line:a,family:u},n.set(e,r)}}return r}}(),V.GetFontSize=function(t){return V.GetFont(t).size},V.GetFontHeight=function(t){return V.GetFontSize(t)*V.fR},V.SetFont=function(t,n,i,e){var r=Z;return n&&e&&(t&&(r+=j+t),r+=j+V.toU(n),i&&(r+=$+i),r+=j+e),r=y(r||V.defCanvasFont)},V.WhelInc=function(t){var n=0;if(t)switch(t.type){case"wheel":n=wt(t.wheelDelta?t.wheelDelta/120:-t.deltaY/3);break;case"mousewheel":n=wt(t.wheelDelta/120);break;case"DOMMouseScroll":n=wt(-t.detail/3)}return n},V.setTimeout=function(t,n){var i=this,e=[].slice.call(arguments,2);return setTimeout(function(){t.apply(i,e)},n)},V.setInterval=function(t,n){var i=this,e=[].slice.call(arguments,2);return setInterval(function(){t.apply(i,e)},n)},V.fix="FFX(1812,webkitUserSelect,disableAOSnapshot,1px),EDG(L2RMark,disableAOSnapshot,msUserSelect,1px),IE(L2RMark,disableAOSnapshot,msUserSelect,1px),OPR(1812,2011,textIndentHTMLSelect4,1px),OPM(),CHR(1812,2011,textIndentHTMLSelect4,1px),SAF(webkitUserSelect,1px)",V.ToString={Quote:function(t,n){function i(t){var n,h=String(t),a=e++0)if(n===i||1==r)for(a=0;a0&&((n=function(t){if(t=y(t))for(var n=0,e=i.length;n1)&&(e={t:St(0,n),rgC:r.slice(n<0?0:1)}),e}function n(n,i,r,s){var o,h=y(O(r));return h&&(!(o=e.get(h))&&e.set(h,o=t(r)),o&&(i=function(t,n,i,e){var r=null;if(e&&n){switch(n.t){case 0:r=t.createLinearGradient(0,e[1],0,V.BOf(e));break;case 1:r=t.createLinearGradient(e[0],0,V.ROf(e),0);break;case 2:r=t.createLinearGradient(e[0],e[1],V.ROf(e),V.BOf(e));break;case 3:var s=e[0],o=V.ROf(e),h=e[1],a=V.BOf(e),u=St(e[2],e[2])/2;r=t.createRadialGradient((s+o)/2,(h+a)/2,0,(s+o)/2,(h+a)/2,u)}if(r)try{r.addColorStop(0,i);var c=n.rgC.length;n.rgC.forEach(function(t,n){r.addColorStop((1+n)/c,t)})}catch(t){}}return r||i}(n,o,i,s))),i}var i=["vertical","horizontal","diagonal","radial"],e=new Map;return{Create:n,XC:function(){e.clear()}}}(),V.Pattern=function(t,n){function i(t,n,i,e,r,s,o){var h=4*(n+i*t.width);t.data[h+0]=e,t.data[h+1]=r,t.data[h+2]=s,t.data[h+3]=o}function e(t,n,e,r,s){for(var o=n;o0;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);for(var l=4,c=8;l<8;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);break;case 7:for(l=0;l<8;l++)i(h,l,l,a.r,a.g,a.b,a.a);for(var l=4,c=0;l<8;l++,c++)i(h,l,c,a.r,a.g,a.b,a.a);for(var l=0,c=4;c<8;l++,c++)i(h,l,c,a.r,a.g,a.b,a.a);for(var l=0,c=8;l<8;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);for(var l=0,c=4;c>0;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);for(var l=4,c=8;l<8;l++,c--)i(h,l,c-1,a.r,a.g,a.b,a.a);break;case 8:for(var f=0,g=4,c=0;c<8;c++)i(h,f,c,a.r,a.g,a.b,a.a),i(h,g,c,a.r,a.g,a.b,a.a);break;case 9:for(var d=0,v=4,l=0;l<8;l++)i(h,l,d,a.r,a.g,a.b,a.a),i(h,l,v,a.r,a.g,a.b,a.a);break;case 10:for(var f=0,g=4,c=0;c<8;c++)i(h,f,c,a.r,a.g,a.b,a.a),i(h,g,c,a.r,a.g,a.b,a.a);for(var d=0,v=4,l=0;l<8;l++)i(h,l,d,a.r,a.g,a.b,a.a),i(h,l,v,a.r,a.g,a.b,a.a);break;case 11:e(h,0,8,0,a),r(h,0,0,4,a),e(h,0,8,4,a),r(h,4,4,8,a);break;case 12:for(l=0;l<8;l++)i(h,l,l,a.r,a.g,a.b,a.a),i(h,l,7-l,a.r,a.g,a.b,a.a);break;case 13:for(l=0;l<8;l++)i(h,l,l,a.r,a.g,a.b,a.a);break;case 14:for(l=0;l<8;l++)i(h,l,7-l,a.r,a.g,a.b,a.a)}return t>1&&o.putImageData(h,0,0),s},V.Pattern.Get=function(){var t=new Map;return function(n,i){return function(n,i){var e,r=t.get(n);return!r&&t.set(n,r=new Map),!(e=r.get(i))&&r.set(i,e=new V.Pattern(n,i)),e}(n,i)}}(),V.DrawEdge=function(t,i,e,r){function s(n,i,e,r){o&&o[0]==n&&o[1]==i||t.moveTo(n,i),t.lineTo(e,r),o=[e,r]}e=D(e,15);var o,h=i[0],a=i[1],u=i[2],c=i[3],l=t.strokeStyle;t.beginPath(),n(r)&&(t.strokeStyle=r),-1==e?s(h,a,h+u,a+c):(1&e&&s(h,a,h,a+c),8&e&&s(h,a+c,h+u,a+c),4&e&&s(h+u,a+c,h+u,a),2&e&&s(h+u,a,h,a),15==(15&e)&&t.closePath()),t.stroke(),t.strokeStyle=l},V.DrawArr=function(t,n,i,e){var r,h,a=V.G,u=a.cArr(n,i,D(e&&e.arrowSize,t.lineWidth));u&&(e&&e.arrowShape?(r=a.CC(u[0],u[1],u[2]),h=a.Dist(r,u[0]),t.save(),t.translate(s(r),o(r)),t.rotate(Math.atan((o(i)-o(n))/(s(i)-s(n)))),t.drawShape([-h,-h,2*h,2*h],V.Mrg({fillColor:t.fillStyle},e.arrowShape)),t.restore()):(t.beginPath(),t.moveTo(u[0][0],u[0][1]),t.lineTo(u[1][0],u[1][1]),t.lineTo(u[2][0],u[2][1]),t.closePath(),t.fill()))},V.DrawDir=function(t,n,i,e,r){if(n){var s,o,h,a,u=n.length,c=V.G;if(u>1){switch(i=D(i,2),e=2==u?0:e,a=D(r&&r.arrowSize,t.lineWidth),s=0,o=n[s],h=n[u-1],i&&a&&(1&i&&(o=c.cArrExcl(n[s+1],o,a)),2&i&&(h=c.cArrExcl(n[u-2],h,a))),t.beginPath(),t.moveTo(o[0],o[1]),e){case-1:var l=o,f=o,g=0;for(s;s=0&&t=0&&++n=0)return this.item(n)},u.at=function(t){if(t>=0&&t=0;e--)t.call(n,i[e],e)},u.rforEachU=function(t,n){n=n||this;for(var i,e=this.byO(),r=e.length-1;!i&&r>=0;r--)i=t.call(n,e[r],r);return i},u.forEachI=function(t,n){n=n||this;for(var i=this.byI(),e=0,r=i.length;e=0&&t=0){this.onRemove(t);var e=this.rgE,r=this.mE2I;e.splice(i,1),r.delete(t);for(var s=i,o=r.size;s0){if(1==e)return this.remove(t[0]);i=n.call(this,t,this.rgE,this.mE2I,!0),this.hasOrd()&&n.call(this,t,this.rgOE,this.mOE2P,!1)}return i},u.removeRange=function(t){return this.removeArr(this.include.apply(this,arguments))},u.toRange=function(t,n){return(t=~~t)<0&&(t=this.len()+t),t=St(0,Et(this.len(),t)),n=Et(this.len()-t,St(0,P(n,1))),{s:t,c:n,r:function(t,n){var i;if(n>1){i=[];for(var e=0;e=0&&(n=St(0,Et(~~n,this.len()-1)),i!=n&&n0)if(i>1)for(var e=0;e0)if(e>1)for(var r=0;r0)if(e>1)for(var r=0;r1)(e=new t).push.apply(e,arguments);else if(f(n))e=n;else{var r=h(n)?n:[n];(e=new t).push.apply(e,r)}return this.forEach(function(t){e&&e.has(t)||i.push(t)},this),i},u.join=function(t){return this.byO().join(t)},u.map=function(n,i){var e=new t;return this.forEach(function(t,r){e.add(n.call(i,t,r,this))},this),e},u.filter=function(n,i){var e=new t;return this.forEach(function(t,r){n.call(i,t,r,this)&&e.add(t)},this),e},u.reduce=function(t,i){if(!this.isEmpty()){for(var e=this.byO(),r=n(i),s=r?i:e[0],o=r?0:1,h=e.length;o=0;r--)t.call(n,this.get(i=e[r]),i)},d.forEachU=function(t,n){n=n||this;for(var i,e,r=this.toA(),s=0,o=r.length;!i&&s=0;s--)i=t.call(n,this.get(e=r[s]),e);return i},d.at=function(t){return this.rgO.at(t)},d.len=function(){return this.rgO.len()};var v=a.prototype;return Object.addPrototypeOf(v,d),v.set=function(t){return function(n,i,e){var r=this.get(n);!r&&t.call(this,n,r=new Map),r.set(i,e)}}(v.set),v.get=function(t){return function(n,e){var r=t.call(this,n);return!i(e)&&r&&(r=r.get(e)),r}}(v.get),v.remove=function(t){return function(n,e){if(i(e))t.call(this,n);else{var r=this.get(n);r&&r.delete(e)}}}(v.remove),{Arr:t,KAr:r,BiM:s,M1:o,M2:a}}()),V.F=function(t){this.mD=new Map,this.biF=new V.BiM,this.biA=new V.BiM,this.build(t)};var kt=V.F.prototype;kt.build=function(t){V.B.split(t).forEach(function(t){var e,r,s=t.caption,o=t.subText;this.biF.set(E(s),V.F.u1st(o||s)),n(t.flags)&&(i(e=t.flags.get("def"))||(e=V.P(e).getValue(),this.mD.set(o,e),!0!==e&&!1!==e||i(r=t.flags.get("alt"))||this.biA.set(s,r)))},this)},kt.def=function(t){var n=this.mD.get(t);return i(n)&&(n=null),n},V.F.u1st=function(t){return w(t.charAt(0))+b(t,1)},V.F.l1st=function(t){return E(t.charAt(0))+b(t,1)},V.F.toString=function(t){return n(t)&&(!0===t?t=1:!1===t&&(t=0),t=V.IsO(t)?"json:"+JSON.stringify(t):t.toString()),t},V.F.alt=function(t,n){return t+V.B.options.eq+V.F.toString(n)},kt.Save=function(t){var n=null;return this.biF.mK.forEach(function(e,r){var s=t[function(t){return"Get"+t}(e)].call(t);if(!i(s)&&s!=this.def(e)){var o=this.biA.get(r);i(o)||(r=o,s=null),(n=n||new Map).set(r,V.F.toString(s))}},this),n},kt.toN=function(t){return this.biF.get(this.biA.getKey(t)||t)||t},kt.toV=function(t,s){var o,h=this.def(this.toN(s)),u=!0===h||!1===h;return n(t)&&(i(o=t.get(s))||(h=e(o)&&!i(this.biA.getKey(s))?!h:o)),u&&(h=0!=h),a(h)&&h.startsWith("json:")&&(h=r(h.substr("json:".length))),h},kt.isF=function(t){return!!t&&(this.biF.get(t)||this.biA.getKey(t))},kt.f2o=function(t,n,i){t&&n&&(i=i||this,t.forEach(function(e,r){n.call(i,V.F.l1st(this.toN(r)),this.toV(t,r),r)},this))},kt.Load=function(t,n){this.f2o(n,function(n,e,r){i(this.biF.mV.get(V.F.u1st(n)))||t["Set"+V.F.u1st(n)].call(t,e)},this)},V.Ptr=function(){function t(t){return wt(t)}function n(n,r){r=r||"page";var s=n,o=null,h=i||n.target;return V.tchEv(n)&&(s=n.changedTouches[0],"offset"==r&&(o=function(n){var i=V.Ert(n.target);return{x:t(n.clientX-i[0]),y:t(n.clientY-i[1])}}(s))),e(o)&&(o={x:t(s[r+"X"]),y:t(s[r+"Y"])}),function(t,n){if(t){var i=V.CSSzom(t);i&&(n.x/=i,n.y/=i)}}(h,o),function(t,n){if(t){var i=V.IBox([0,0,0,0],t,-1,4);n.x-=i[0],n.y-=i[1]}}(h,o),o}var i=null;return{Get:n,SetTargExclPad:function(t){i=V.ToO(t)},ResTargExclPad:function(){i=null}}}(),V.e2B=function(t,i){if(t){if(!i)switch(t.which){case 1:return 1;case 2:return 4;case 3:return 2}if(n(t.buttons))return t.buttons;if(n(t.button))return t.button}return 0},V.eA2P=function(t,n){return V.Ptr.Get(t,n)},V.e2PO=function(t){return V.eA2P(t,"offset")},V.e2PP=function(t){return V.eA2P(t,"page")},V.e2E=function(t){return t||V.win.event},V.e2P=function(t){if(t=V.e2E(t)){var n=V.e2PO(t);if(function(t){return t&&u(t.x)&&u(t.y)}(n))return n.buttons=V.e2B(t),n}return null},V.pS2T=function(t,n,i){if(n&&i&&n!=i){var e=V.Ert(n),r=V.Ert(i);t.x+=e[0]-r[0],t.y+=e[1]-r[1]}return t},V.Key=function(t){return(t=V.e2E(t))&&(t.which||t.keyCode)||0},V.IsModK=function(t){return t&&(t.ctrlKey||t.shiftKey||t.altKey||t.metaKey)},V.ModK=function(t){var n=0;return t&&(t.shiftKey&&(n|=1),t.ctrlKey&&(n|=2),t.altKey&&(n|=4),t.metaKey&&(n|=16)),n},V.IsEsc=function(t){return 27==V.Key(t)},V.Rand=function(){return Math.random()},V.Tick=function(){return Date.now()},V.Lts=function(){this.mTL=new Map};var Dt=V.Lts.prototype;V.Lts.Onf=function(t){t.on=function(){return Dt.add.apply(this.oLts,arguments)},t.off=function(){return Dt.remove.apply(this.oLts,arguments)}},Dt.getOf=function(t,n){var i=this.mTL.get(t);return!i&&W(n,!0)&&(i=function(t){var n=new V.Arr;return n.type=t,n.do=function(t){var n=!1;return this.forEachU(function(i){return i&&(i.lock++||(n=i.callback.call(i.thisArg,t)),--i.lock),n}),n},n}.call(this,t),this.mTL.set(t,i),t&&(this[t]=i)),i},Dt.forEach=function(t,n){n=n||this,this.mTL.forEach(function(i,e){t.call(n,e)})},Dt.t2N=function(t,n){return t=E(O(t)),n&&!this.mTL.has(t)&&this.mTL.has(mt+t)&&(t=mt+t),t},Dt.add=Dt.Add=function(t,n,i){t=this.t2N(t,n);var e,r=this.getOf(t);return n&&(e=z(t,n,i))&&r.add(e),r},Dt.remove=Dt.Remove=function(t,n,i){if(t=this.t2N(t,!0)){var e=this.getOf(t,!1);e&&(n||i?e.remove(function(t,n,i){var e=z(t.type,n,i);return e&&t.forEachU(function(t){return t.equal(e)&&t})}(e,n,i)):e.clear())}else this.clear()},Dt.removeAnyOf=function(t){this.mTL.forEach(function(n){var i=[];n.forEach(function(n){n.thisArg===t&&i.push(n)},this),n.removeRange(i)},this)},Dt.clear=Dt.Clear=function(){this.mTL.forEach(function(t,n){this.remove(n)},this)},Dt.lock=function(){this.mTL.forEach(function(t){t.forEach(function(t){t.lock++})})},Dt.unlock=function(){this.mTL.forEach(function(t){t.forEach(function(t){t.lock--})})},V.RAF=function(t){var n,i,e,r={ID:null};if(t&&(i=V.win,e=i.requestAnimationFrame||i.webkitRequestAnimationFrame||i.mozRequestAnimationFrame||i.oRequestAnimationFrame||i.msRequestAnimationFrame)){n=t;function s(){n(),null!==r.ID&&(r.ID=e(s))}return r.ID=e(s),r}},V.XAF=function(t){if(t&&t.ID){var n=V.win,i=n.cancelAnimationFrame||n.webkitCancelAnimationFrame||n.mozCancelAnimationFrame||n.oCancelAnimationFrame||n.msCancelAnimationFrame;i&&(i(t.ID),t.ID=null)}},V.pgXOff=function(){return wt(V.win.pageXOffset)},V.pgYOff=function(){return wt(V.win.pageYOffset)},V.pgrt=function(t){var n=V.doc,i=[0,0,n.documentElement.clientWidth||V.win.innerWidth,n.documentElement.clientHeight||V.win.innerHeight];return W(t,!0)&&(i[0]+=V.pgXOff(),i[1]+=V.pgYOff()),i},V.Ert=function(t){return t&&t.getBoundingClientRect?function(t){return[wt(t.left),wt(t.top),wt(t.right-t.left),wt(t.bottom-t.top)]}(t.getBoundingClientRect()):[0,0,0,0]},V.EArt=function(t){var n=V.Ert(t);return n[0]+=V.pgXOff(),n[1]+=V.pgYOff(),n},V.EArtC=function(t){return V.IBox(V.EArt(t),t,-1,6)},V.IBox=function(t,n,i,e){function r(t){if(t)for(var n=0,i=t.length;n=o&&t=s&&n=Et(r,a)-e&&c<=St(r,a)+e&&l>=Et(h,u)-e&&l<=St(h,u)+e){var f=r-a,g=h-u;return At(At(f)1)for(var s=1,o=n[0],h=null;!e&&sV.ROf(s)?4:2,o|=nV.BOf(s)?64:32),o},V.EyR=function(t){return!t||t[2]<1||t[3]<1},V.EqR=function(t,n){return t===n||t&&n&&t[0]==n[0]&&t[1]==n[1]&&t[2]==n[2]&&t[3]==n[3]},V.EqS=function(t,n){return t===n||t&&n&&t[2]==n[2]&&t[3]==n[3]},V.NRt=function(t,n){var i,e,r,s,o,h,a,u;return t&&n?(e=V.ROf(t))>=n[0]&&(r=V.ROf(n))>=t[0]&&(s=V.BOf(t))>=n[1]&&(o=V.BOf(n))>=t[1]&&(i=[h=St(t[0],n[0]),a=St(t[1],n[1]),Et(e,r)-h,Et(s,o)-a]):(u=t||n)&&(i=u&&u.slice()),i},V.URt=function(t,n){var i,e,r;return t&&n?i=[e=Et(t[0],n[0]),r=Et(t[1],n[1]),St(t[0]+t[2],n[0]+n[2])-e,St(t[1]+t[3],n[1]+n[3])-r]:(i=t||n)&&(i=i.slice()),i},V.URts=function(t){function n(t,n){return V.EyR(n)?t:V.EyR(t)?n:V.URt(t,n)}var i=null,e=arguments.length;if(e>0)if(e>1)for(var r=0;r1){var e,r,s,o,h;if(t&&(e=t.length)>2){for(r=[],s=0,o=e;h=~~((o-s)/n);)r.push(t[i?o-1-s:s]),s+=h;for(;sc[0]+c[2]?4:2,r|=nc[1]+c[3]?64:32}return r},Cursor:{Rect:function(t,n){var i=n||"auto";if(256==(256&t))i="pointer";else switch(t){case 17:i="nw-resize";break;case 18:case 16:i="n-resize";break;case 20:i="ne-resize";break;case 33:case 1:i="w-resize";break;case 34:case 2:case 32:i="move";break;case 36:case 4:i="e-resize";break;case 65:i="sw-resize";break;case 66:case 64:i="s-resize";break;case 68:i="se-resize"}return i}},Resize:function(t,n,i,e,r){function s(t,n){var i=n[0]||0,e=n[2]||0;t[2]=St(i,t[2]),e>i&&(t[2]=Et(e,t[2]))}function o(t,n){var i=n[1]||0,e=n[3]||0;t[3]=St(i,t[3]),e>i&&(t[3]=Et(e,t[3]))}var h;if(e){switch(h=e.slice(),t){case 34:case 2:case 32:h[0]+=n,h[1]+=i;break;default:switch(80&t){case 16:h[1]+=i,h[3]-=i,r&&(o(h,r),h[1]=Et(h[1],e[1]+e[3]-h[3]));break;case 64:h[3]+=i,r&&o(h,r)}switch(5&t){case 1:h[0]+=n,h[2]-=n,r&&(s(h,r),h[0]=Et(h[0],e[0]+e[2]-h[2]));break;case 4:h[2]+=n,r&&s(h,r)}}r||(h[2]<0&&(h[2]=-h[2],h[0]-=h[2]),h[3]<0&&(h[3]=-h[3],h[1]-=h[3]))}return h}},V.Mrg(V,function(){function t(t){this.bold=this.italic=this.underline=this.strikeout=!1,this.fgColor=this.bgColor=this.fontSize=this.fontName=this.shaColor=this.outColor=this.graColor=null,this.Set(t),this._rgStk=[]}function i(n){function i(n){n=E(n);var i=new t,e=function(t){var n,i,e=t.split(j),r=e.findIndex(function(t){return t.includes("px")||t.includes("em")||t.includes("rem")||t.includes("%")||t.includes("pt")||t.includes("vw")||t.includes("vh")});if(~r){i={},n=e[r].split($),i.size=n[0],n[1]&&(i.height=n[1]),i.family=e.slice(r+1).join(j).replace(/['"]+/g,"");for(var s,o=0;o=100&&parseInt(s)<=900)&&(i.weight=s)}return i}(n);return e?(i.fontSize=V.ToF(e.size),i.fontName=e.family,i.bold=700==e.weight||e.weight==pt,i.italic=e.style==Ct):n.splitP(j,null,s).forEach(function(t){if(t=y(t)){var n,e,r;t.startsWith(et)&&((t=b(t,1)).endsWith(rt)&&(t=b(t,0,t.length-1)),(t=y(t))&&~(e=T(t,j))&&(n=b(t,e+1),t=b(t,0,e))),(r=function(n){if(t)for(var i=0,e=n.length;i1&&(this.eW=b(t,n+1)))}}function n(n){var e=i.get(n);return!e&&i.set(n,e=new t(n)),e}t.prototype.Match=function(t,n){var i,e,r=n=n||0,s=0;if(this.sW){if(!t.sWith(this.sW,n))return null;r+=s+=this.sW.length}if(i=t.length,this.eW){if((i=T(t,this.eW,n))<0)return null;s+=this.eW.length}return this.bF&&(s+=(e=b(t,r,i-r)).length),{eat:s,field:e}};var i=new Map;return{Match:function(t,i,e){return n(t).Match(i,e)},Tag:function(t){return n(t)}}}(),V.H=function(){function t(t,n){this.text=t,this.start=n||0,this.length=this.text.length}function r(t){this.nMMC=3,this.mMSW=new Map,this.mMEW=new Map,this.oHTags=t;for(var n=0,i=t.rgHTag2,e=i.length;ns||f.height>o))&&(t.save(),t.locClip(i)),u.Draw(t,i,e),c&&t.restore()),r&&r.eCTX(t)))),f}function A(t){var n=S(t);return n?n.GetCaption():t}function w(t){ht.clear(),t||(at.clear(),ft={})}function R(t){return function(t){var n,e=t?"v":"u";return i(ft[e])&&(ft[e]=null,(n=V.Def.H[(t?Z:"un")+"visitAnchorFormat"])&&new l(n).Elements(function(t){return!(t.oTFI&&(ft[e]=t.oTFI))})),ft[e]}(function(){function n(n){var i=lt.get(n);return i&&i.Has(t)}var i=n(P);return!i&&ct.forEach(function(t,e){i||(i=n(e))}),i}())}function k(t,n){w(!0),function(t){var n=lt.get(t);n||lt.set(t,n=new p);return n}(t).AddVA(n)}var P,W=t.prototype;W.continue=function(){return this.start",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("
"),this.Add("\r"),this.Add("\n"),this.Add("",""),this.Add("",""),this.Add(""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("&"),this.Add(""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("",""),this.Add("<%","%>"),this.lHTag2=this.rgHTag2.length},H.Add=function(t,n){this.rgHTag2.push(new function(t,n,i){this.nIndex=t,this.oSHTag=n?V.HTag.Tag(n):null,this.oEHTag=i?V.HTag.Tag(i):null}(this.rgHTag2.length,t,n))},H.Refresh=function(){this.oHTagsP=new r(this)},H.GetHTMLTagPair=function(t){return t>=0&&t=0){n.name=V.HP.IsValid(b(t,t,i));var e=b(t,i+1),r=e,s=Z,o=T(e,tt);o>=0&&(r=y(b(e,t,o)),s=y(b(e,o+1))),n.width=parseInt(r)||0,n.height=parseInt(s)||0}}return n}(e));break;case 14:if(e=t.field){var o=e,h=0,a=T(e,nt);a>=0&&(o=b(e,0,a),h=parseFloat(b(e,a+1))||0),(o=y(o))&&(this.getTFI().fontName=o),h>0&&(this.getTFI().fontSize=h)}break;case 15:e=t.field,this.oA=function(t){var n,i={id:y(t||Z),options:null};return t&&(n=T(t,nt))>=0&&(i.id=y(b(t,0,n)),i.options=y(b(t,n+1))),i}(e);break;case 18:this.getTFI().graColor=V.ToGRA(t.field);break;case 19:(e=t.field)&&(V.IsHC(e.charAt(0))||(e=b(e,1)),e&&(e=n(e,"#000000"))),e||(e="#000000"),this.getTFI().outColor=e;break;case 20:this.getTFI().shaColor=V.ToSHA(t.field);break;case 21:var u=0;(e=y(O(t.field)))&&(u=parseFloat(e)),this.off+=u}},K.ApplyTag=function(t){22==t.tag?(this.cap=y(O(t.field)),this.bEF=!!this.cap):this.applyTag(t)};var Q=a.prototype;Q.Align=function(t){function n(){return this.oAE||(this.oAE={center:-1,right:-1}),this.oAE}11==t?function(){var t=n.call(this);t.right<0&&(t.right=this.rgHE.length)}.call(this):17==t&&function(){var t=n.call(this);t.center<0&&t.right<0&&(t.center=this.rgHE.length)}.call(this)},Q.Add=function(t){return this.Elements().push(t),this},Q.Elements=function(){return this.rgHE};var q=c.prototype;q.array=function(){return this.rgHTMLLines},q.Add=function(t){return this.array().push(t),this};var Y=l.prototype;Y.parse=function(){function n(t){return t.forEach(function(t){l.ApplyTag(t)}),l}function i(){!l.isEmpty()&&u.Add(n(m)),C.Add(u)}function e(){return new h(Z,u)}function r(){return new a(C)}function s(t,n){for(var i=t.length-1;i>=0;i--)if(t[i].tag==n)return i;return-1}var u,l,f,g,d,v,p,C=this.oHLs,m=[];if(!C){for(C=this.oHLs=new c(this),u=r(),l=e(),f=new t(this.fll);f.continue();)(g=U.MatchTagPair(f))?(v=o(d=g.tag))==X?l.cap+=g.field:v==F?(l.isEmpty()||(u.Add(n(m)),l=e()),n(m),l.ApplyTag(g),u.Add(l),l=e()):v==N?(l.isEmpty()||(u.Add(n(m)),l=e()),u.Align(d)):v==B?(i(),u=r(),l=e()):g.start?(l.isEmpty()||(u.Add(n(m)),l=e()),m.push(g)):(p=s(m,d))>=0&&(l.isEmpty()||(u.Add(n(m)),l=e()),m.splice(p,1)):(l.cap+=f.current(),f.next());i()}},Y.Elements=function(t){if(this.oHLs)for(var n=!0,i=this.oHLs.array(),e=0,r=i.length;n&&e0||r>0)&&(e>0&&r>0?(n.width=e,n.height=r):(e>0&&(n.height*=e/n.width,n.width=e),r>0&&(n.width*=r/n.height,n.height=r)))):(e>0||r>0)&&(n.width=e,n.height=r,n.width=n.width||n.height,n.height=n.height||n.width),n.width=t.scaleOnFont(n.width),n.height=t.scaleOnFont(n.height),n},$.Draw=function(t,n,i,e,r){this.bCTX(t,e);var s=this.getHTMLPicture();s?s.Draw(t,[n,i,this.size.width,this.size.height]):this.drawImageHolder(t,n,i,e),r&&r.call(this),this.oHE.oA&&et.AddA(P,n,i,this),this.eCTX(t)},$.drawImageHolder=function(t,n,i,e){this.bCTX(t),V.HP.DrawPH(this.oImg.name,t,[n,i,this.size.width,this.size.height]),this.eCTX(t)};var it=d.prototype;it.mEsW=function(t,n){var i,r,s=0;if((t=t||0)>=0&&(i=this.len(),t0))for(var o=0,h=t;o=0&&t=t.getCaption().length&&(this.index++,this.offset=0)}},Prev:function(){if(this.offset)this.offset--;else{this.index--;var t=this.Element();if(t)switch(t.type){case 1:this.offset=0;break;default:this.offset=t.getCaption().length}}},IsBreak:function(){var t=this.Element();if(t)switch(t.type){case 1:break;default:return V.dtWB.test(t.getCaption().charAt(this.offset))}return!0},IsZero:function(){return 0==this.index&&0==this.offset},Copy:function(){return i.getIterator(this.index,this.offset)}}},it.indexOf=function(t){for(var n=0,i=this.rgLE.length;n=0)return this.getIterator(n,r)}}return null},it.lastIndexOf=function(t){for(var n,i,e=null,r=this.rgLE.length-1;!e&&r>=0;r--)(n=this.rgLE[r]).type||(i=n.getCaption().lastIndexOf(t))>=0&&(e=this.getIterator(r,i));return e},it.draw=function(t,n,i,e,r){function s(t,n,i,e){function s(t){return t.nRT?t.strokeStyle:t.fillStyle}t.save(),t.beginPath();var o,h=St(1,wt(V.GetFontSize(t)/V.defScaleFontSize)),a=n[0],u=a+n[2],c=n[1]+(i.position<0?0:n[3]);t.lineWidth=h,t.setLineDash(1==i.type?[]:[h,h]),r?((o=i.color)||(o=e)||(o=s(t)),t.strokeStyle=o):o=s(t),t.strokeStyle=o,t.moveTo(a,c),t.lineTo(u,c),t.stroke(),t.restore()}function o(t){return t.color+"-"+t.type+"-"+t.position}function h(){var t=this.oL;return t&&t.type&&t||null}var a,u=this.size.heightE,c=e,l=this.size.height,f=-1,g=n,d=-1,v=i;this.bT||this.oAE&&((d=this.oAE.right)>=0&&(v-=this.mEsW(d),v=St(n+this.mEsW(0,d),v)),(f=this.oAE.center)>=0&&(g+=this.mEsW(0,f),g+=St(0,(v-g-this.mEsW(f,d))/2),g=Et(g,v))),e+=this.off;for(var p,C,m,S=0,E=this.rgLE.length;S0){switch(n.type){case 1:e=-1,t>0?e=t-1:t+1=0&&(r=this.rgLE[e].size.height)>s&&(o-=St(0,(r-s)/2))}h=o}return h},it.measure=function(t){this.off=0;var n,i,e,r,s,o=0,h=0,a=!1;if(t=t||0,this.rgLE.length&&(t=0,this.rgLE.forEach(function(i){n=i.size,o+=n.width,t=St(n.height,t),a|=0!=i.off}),h=t),a){i=0,e=t;for(var u=0,c=this.rgLE.length;u0?e=St(e,t+s):i=Et(i,this.yAlign(u,r,t)+s));this.off=-i,t=e-i}return this.size={width:o,height:t,heightE:h}},it.removeAt=function(t,n){var i,e=n.Element(),r=n.index;e&&(e.type||(i=b(i=e.getCaption(),0,n.offset)+b(i,n.offset+1))&&(e.setCaption(t,i),r=-1),r>=0&&this.rgLE.splice(r,1),this.measure(t.fontHeight()),n.Prev())},it.getCaption=function(){var t=Z;return this.rgLE.forEach(function(n){var i=n.getCaption();i&&(t+=i)},this),t};var et=v.prototype;et.doL=function(t,n,i,e){function r(t,n){if(n&&!n.IsZero()){var i,e=n.Element(),r=n.index;return n.offset&&(i=e.getCaption(),e.setCaption(t,b(i,0,n.offset)),r++),r&&(this.rgLE.splice(r),0==n.offset&&(e=this.rgLE[r-1])),this.measure(S),e}}function s(t,n){if(n>0){for(var i,e,r=this.rgLE,s=0,o=0,h=r.length;s<=n&&on&&(o--,i=this.getIterator(o,0),e=i.Element())){switch(e.type){case 1:i.index++,i.offset=0;break;default:e.bCTX(t,!1),i.offset=St(o?0:1,M(t,e.getCaption(),n-(s-e.size.width))),e.eCTX(t)}if(i.IsValid())return i}}}function o(t,n){if(function(){function t(t){return t.search(V.dtWB)>=0}for(var n,i=0,e=this.rgLE.length;i=0&&(n.center=0&&(n.right=0||e>=0)&&(this.oAE={center:i,right:e})}return this.oAE}.call(t,this.iCLL,n),t.measure(S),this.rgLL.push(t),i==this.oCLL&&(this.iCLL+=t.len())}this.rgLL=[],this.oCLL=null,this.iCLL=0;var a,u=this,c=1024&e||256&e,l=32&e,f=16&e,g=262144&e,v=32768&e,p=16384&e,C=i[2],m=i[3],S=n.fontHeight(),E={x:0,y:0,line:new d,newElement:function(t,n){return this.line.newElement(t,n)},newLine:function(){return h.call(u,this.line),this.y+=this.line.size.height,this.x=0,this.line=new d},breakLine:function(t){var n,i,e,r,s,h,a,u,l=this.line;do{n=!1,(i=o.call(l,t,C))&&!i.IsZero()&&(e=[],r=i.Element(),s=i.index,i.offset&&(a=r.getCaption(),r.setCaption(t,b(a,0,i.offset)),(u=this.newElement(t,r.oHE)).setCaption(t,b(a,i.offset)),e.push(u),s++),h=this.newLine(),s&&(Tt.push.apply(e,l.rgLE.splice(s)),l.measure(S)),Tt.push.apply(h.rgLE,e),h.measure(S),this.x=h.size.width,n=this.x>C&&(c||this.yC&&E.breakLine(n)):(c||p||(o.setCaption(n,Z),(s=C+8-E.x)>0&&o.setCaption(n,function(t,n,i){this.bCTX(n);var e=b(t,0,1+M(n,t,i));return this.eCTX(n),e}.call(o,r,n,s))),E.line.rgLE.push(o),E.x+=o.size.width))}else!l&&E.newLine();return a}),h.call(u,E.line),function(t,i,e,o,h){if(!i||e||o||h){var a=L(n,ot),u=e&&at){var g,d,v,p,C,m=null;if(h&&(m=e.lastIndexOf(ut))){for(g=(C=m.Element()).getCaption(),C.setCaption(n,b(g,0,m.offset)+ot+b(g,m.offset)),e.measure(S),m.Prev();m.IsValid()&&e.size.width>t;)e.removeAt(n,m);i||e.size.width>t&&r.call(e,n,s.call(e,n,t))}else d=l,(v=c&&o+1==f)&&(d=t-a),(p=s.call(e,n,d))&&(C=r.call(e,n,p),(u||v)&&C&&0==C.type&&(C.setCaption(n,C.getCaption()+ot),e.measure(S)))}})}}.call(this,C,c,g,a&&v,p),this.size=this.measure()},et.Draw=function(t,n,i){var e,r,s,o=n[0],h=n[2],a=o+h,u=n[1],c=n[3],l=0==(512&i),f=!(256&i),g=1&i?2:2&i?1:0,d=4&i?2:8&i?1:0;return d&&((s=this.size.height)0;s--){(c=t.sizeHTMLDate("<%mmmm%>",r,0)).width>i&&(e=s,i=c.width),r.PrevMonth()}var o=Date.Create(n,e,1);o.NextMonth(),o.PrevDay();for(var h=0,a=o.GetDay(),s=a,u=0;u",o,0);c.width>h&&(a=s,h=c.width),o.PrevDay()}return Date.Create(n,e,a)}return null}var r=new Map;t(0,"yyyy,yy,loc_g,loc_gg,loc_y,loc_yy,loc_yyyy"),t(1,"hy"),t(2,"q"),t(16,"m,mr,mm,m1,m2,m3,mmm,mmmm,loc_m1,loc_m2,loc_m3,loc_mmm,loc_mmmm"),t(17,""),t(256,"w,ww"),t(4096,"y,d,dd,d1,d2,d3,ddd,dddd,i,loc_sdate,loc_ldate,loc_d1,loc_d2,loc_d3,loc_ddd,loc_dddd,loc_dsep"),t(65536,"h,h12,hh,hh12,AM/PM,loc_time,loc_time24,loc_AM/PM,loc_A/P,loc_tsep"),t(1048576,"n,nn"),t(16777216,"s,ss");return{Evaluate:function(t,n,i){if(d(t)){var e=t.toQ(n.repAll($,Z));if(e)return String(e.call(t,i)+Z)}return n},Unit:function(t){var n=0;return t&&t.forEach(function(t){n=St(n,i(t))}),n},UnitOf:i,Fields:function(){var t=[];return r.forEach(function(n,i){t.push(i)}),t},MeasureLabel:function(t,n,i,r){var s={width:0,height:0};if(t){r=r||1971;for(var o=Date.Create(r,12,31,23,59,59),h=0;h=0&&t<1?t:1},o.applyAlpha=function(t,n){if(1!=(n=this.getAlpha(n)))for(var i=t.data,e=3,r=i.length;e0?(clearTimeout(this.hTC),this.hTC=setTimeout(function(){n.onchange(t)},i)):n.onchange(t)},o.onchange=function(t){this.oLts.onchange.do(t)},o.addEventListener=function(t,n,i){this.oLts.add(t,n,i)},o.removeEventListener=function(t,n,i){clearTimeout(this.hTC),this.oLts.remove(t,n,i)},o.Item=o.item=function(n){return n instanceof e?n:(n=t(n))?this.mP.get(n):null},o.Add=o.add=function(n,i){var r=null;return(n=t(n))&&((r=this.item(n))?r.SetSource(i):(this.mP.set(n,r=new e(this,i)),this.onChange(r))),r},o.Remove=o.remove=function(n){if(n=t(n)){var i=this.item(n);i&&(this.mP.delete(n),this.onChange(i))}},o.Clear=o.clear=function(){this.mP.size&&(this.mP.clear(),this.onChange(null))},o.Draw=o.draw=function(n,i,e){if(n=t(n)){var r=this.item(n);if(r)return r.Draw(i,e)}},o.GetSize=o.getSize=function(t){var n=this.item(t);return n?n.GetSize():{width:0,height:0}},o.Count=o.len=function(){return this.mP.size},o.Measure=o.measure=function(t,e,r){var s,o,h,a,c,l,f,g,d,v,p=null;return(t=V.HP.IsValid(t))&&(a=this.item(t),u(e)?(h=(c=D(e))<0,s=o=At(c)):(f=(l=e||[null,null])[0],g=l[1],0!=f&&0!=g&&(d=a?a.GetSize():{width:16,height:16},h=g<0||f<0,s=At(f||d.width),o=At(g||d.height),!h&&n(e)&&(v=i(d,f,g))&&(s=v.width,o=v.height))),s&&o&&(r&&(s=r.scaleOnFont(s),o=r.scaleOnFont(o)),p={width:s,height:o,stretch:h,picture:a})),p},o.DrawS2=o.drawS2=function(t,e,r,s,o){var a,u,c,l,f,g;return e&&r&&(o=o||34,(u=this.measure(e,s))&&(a=r.slice(),c=256&o,n(s)&&(l=(c?null:i(u,r[2],r[3]))||u,(f=u.picture)&&!u.stretch&&(g=i(f.GetSize(),l.width,l.height))&&(l=g),a[2]=l.width,a[3]=l.height,17!=(o&=255)&&(a=V.G.C2R(V.G.R2C(r,o),a[2],a[3],o))),u.picture&&u.picture.Draw(t,a)||h.DrawPH(e,t,r))),a},o.forEachU=function(t,n){var i;return n=n||this,this.mP.forEach(function(e,r){!i&&(i=t.call(n,e,r))}),i};var h=new r;return h.IsValid=t,h.DrawPH=function(t,n,i){n.drawShape(i,{frameColor:"#D0D0D0",pattern:6,patternColor:"#F0F0F0"}),n.noFD(function(){n.drawHTMLText(t,i,2085)})},h.Scale=i,h.TTC=750,h.Proto=s,h}(),V.B=function(){function t(t,i){function r(t){function r(){p&&(e(C)&&(C=p),p=Z)}function s(){m=m||new Map;var t=function(t){var n=null;if(t){var e=T(t,i.eq),r=t,s=null;e>=0&&(r=b(t,0,e),s=b(t,e+i.eq.length));var o=r.split(i.sep),a=o.length;n=[];for(var u=0;u=0?(v=!0,f+t+f):null}function h(t){return v&&t?t.repAll(f,Z):t}for(var a=0,u=0,c=0,l=t.length,g=0,d=0,v=!1,p=Z,C=null,m=null,S=null;e(S)&&c=0&&(a=a?0:i.str[w],A=Z)}}A&&(p+=A),g=E}r();return{caption:h(C||Z),flags:m,subText:h(S||Z)}}function s(){var t=!1;return(t=!a&&!u&&!c)&&(o.push(r(g+v+p)),g=Z,v=Z,p=Z),t}var o=[];if(t=O(t)){i=i||d.options||{};for(var h=t.length,a=0,u=0,c=0,l=0,g=Z,v=Z,p=Z,C=0;C=0&&(a=a?0:i.str[E])}}S&&(u?p+=S:c?v+=S:g+=S),l=m}s()}return o}function i(){if(e(c)){c={escC:Z,escFN:Z,escFV:Z};var t=d.options;t.esc&&([t.esc,t.sP,t.eP,t.sO,t.eO,t.sep,t.str].forEach(function(t){c.escC+=t}),[t.esc,t.sO,t.eO,t.eq,t.str,t.escWS].forEach(function(t){c.escFN+=t}),[t.esc,t.sO,t.eO,t.str,t.escWS].forEach(function(t){c.escFV+=t}))}return c}function r(t,i){var e=Z;if(n(t)&&(t=t.toString(),e=t,i)){e=Z;for(var r=0,s=t.length;r=0&&(o=d.options.esc+o),e+=o}}return e}function s(t){return r(t,i().escC)}function o(t,s,o){function h(t,e){var s=Z;return s+=d.options.sO,s+=function(t){return r(t,i().escFN)}(t),n(e)&&(s+=d.options.eq,s+=function(t){return r(t,i().escFV)}(e)),s+=d.options.eO}var a=Z;if(l(t)&&t.size){var u=[];t.forEach(function(t,n){(function(t,n){return!g(s)||s.call(o,t,n)})(n,t)&&(e(t)?u.push(n):a+=h(n,t))}),u.length&&(a=h(u.join(d.options.sep))+a)}return a}function a(t,n){var i=Z;return n&&(i+=d.options.sP),h(t)&&(i+=t.join(d.options.sep)),n&&(i+=d.options.eP),i}function u(t){var n=[];return t.forEach(function(t){var i=s(t.caption);if(i+=o(t.flags),t.subText){var e=[];V.B.split(t.subText).forEach(function(t){e.push(u([t]))}),i+=a(e,!0)}n.push(i)}),a(n)}var c=null,f=String.fromCharCode(0),d={options:{sep:",",sP:"(",eP:")",sO:"[",eO:"]",esc:ut,str:"\"'",eq:it,escWS:" \t",fn:function(t){return E(y(t))},fv:function(t){return y(t)}},split:t,quoteC:s,quoteF:o,quoteS:a,quote:u};return d}(),V.P=function(t,n){function i(t,n,i){return t&&n in t?t[n]:i}var r=i(n,"hexa","0x"),s=i(n,"string","`'\""),o=i(n,"date",J),h=i(n,"arrays","["),a=i(n,"arraye","]"),u=i(n,"arraysep",",");return{expression:t+Z,position:0,result:null,continue:function(){return this.position=0;)this.result=16*this.result+t,this.position++,n++;return n>0&&n<9}},isNumber:function(){return this.isInt()||st==this.expression.charAt(this.position+this.countSigns())?1:0},getNumber:function(){if(this.result=null,this.isNumber()){var t=1;this.getSign()&&(t=this.result),this.getInt();var n=this.result||0;if(n<0&&(n=-n,t=-1),st==this.currentChar()&&(this.position++,this.isInt(!1))){var i=this.eatZero();this.getInt();for(var e=0,r=this.result||0;r>0;)e=e/10+r%10/10,r=Math.trunc(r/10);for(var s=0;s=0?1:0},getString:function(){this.result=null;var t=this.isString();if(t){var n=this.currentChar();for(this.position+=t,this.result=Z;this.continue();){var i=this.currentChar();if("\\"==i){var e=this.nextChar();if(e==n||"\\"==e)this.position++,i=this.currentChar();else switch(e){case"r":i="\r",this.position++;break;case"n":i="\n",this.position++}}else if(i==n)break;this.result+=i,this.position++}if(this.continue())return this.position++,!0}},isDate:function(){return this.expression.sWithI(o,this.position)?o.length:0},getDate:function(){this.result=null;var t=this.isDate();if(t){var n=this.currentChar();this.position+=t;for(var i=Date.Today(),e=[i.GetMonth(),i.GetDay(),i.GetYear(),0,0,0],r=e.length,s=0;this.continue()&&s=0){var e=n-this.position;return this.result=b(this.expression,this.position,e),1+e}n++}return 0},searchAnyOf:function(t){function n(t,n,i){for(var e=0,r=!1,s=i.length;!r&&e=0){var s=i-this.position;return this.result=b(this.expression,this.position,s),t[r].length+s}i++}return 0}}},V.PF=function(t,n,i){function e(n){return a.forEachU(function(i){return t.sWith(i.key,n)?i:null})}function r(t,n){return n.l=t.length,T(this,t,n.i)}function s(t,n){var i=-1,e=c=n.i,r=this.length,s=0;if(c=0&&nV.ToV(n)},GREATE:function(t,n){return V.ToV(t)>=V.ToV(n)},SWITH:function(n,i){return t(n).sWith(t(i))},EWITH:function(n,i){return t(n).eWith(t(i))},CONTAINS:function(n,i){return-1!=t(n).search(t(i))},LFIND:function(n,i){return T(t(n),t(i))},RFIND:function(n,i){return t(n).lastIndexOf(t(i))},COUNT:function(n,i){return t(n).countOf(t(i))},LEFT:function(n,i){return b(t(n),0,i)},RIGHT:function(n,i){var e=t(n);return b(e,St(0,e.length-i))},LPAD:function(n,i){var e=t(n),r=t(i),s=r.length-e.length;return s>0?b(r,0,s)+e:n},RPAD:function(n,i){var e=t(n),r=t(i),s=r.length-e.length;return s>0?e+r.slice(-s):n},CONCAT:function(n,e){var r,s=Z,o=St(0,i(e));if(o>0){r=t(n);for(var h=0;h=i[n].toString()})]:i)),e},ARRAY:function(t,i){var e=Z;return n(t)&&h(i)&&(t=wt(parseFloat(t||0)),isNaN(t)||t>=0&&t=i[n].toString()})])&&(r=e)):r=t==i?t:0,r},SPLIT:function(n,i){return t(n).split(t(i))},CASE:function(t,n){return n instanceof V.E.Case?n.Evaluate(t):t},REPLACE:function(n,i){var e=t(i);return e.length?t(n).repAll(e,"\b"):n},WITH:function(n,i){return t(n).repAll("\b",t(i))},LEN:function(n,i){return h(n)?n.length:t(n).length},TYPE:function(t,n){return V.V2T(t)},LOWER:function(n,i){return A(t(n))},UPPER:function(n,i){return R(t(n))},PROPER:function(n,i){return t(n).toProper()},LTRIM:function(n,i){return t(n).ltrim()},RTRIM:function(n,i){return t(n).rtrim()},TRIM:function(n,i){return y(t(n))},INT:function(t,n){return Math.trunc(e(t))},ROUND:function(t,n){return wt(e(t))},FLOOR:function(t,n){return Math.floor(e(t))},ABS:function(t,n){return At(e(t))},STR:function(n,i){return t(n)},CHR:function(t,n){return String.fromCharCode(t)},ASC:function(n,i){return t(n).codePointAt(0)},CURRENCY:function(t,n){return V.Currency(e(t))},TIME:function(t,n){return r(t).toLocTS()},TIMEF:function(t,n){var i=r(t);return s(i.GetHour())+tt+s(i.GetMinute())+tt+s(i.GetSecond())},SHORTDATE:function(t,n){return r(t).toLocDS()},SHORTDATEF:function(t,n){var i=r(t);return s(i.GetMonth())+$+s(i.GetDay())+$+s(i.GetYear(),4)},LONGDATE:function(t,n){return r(t).toDateString()},DBL:function(t,n){return e(t)},DATE:function(t,n){return r(t)},DATES:function(n,i){for(var e,r=Date.Today(),s=t(n),h=[r.GetMonth(),r.GetDay(),r.GetYear(),0,0,0],a=h.length,u=0,l=0,f=s.length;lu&&(h[l]=parseInt(b(s,u,g-u))),u=g+1}return(e=Date.Create(h[2],h[0],h[1],h[3],h[4],h[5],0)).isValid()||(e=S),e},DATEF:function(t,n){return V.EO.SHORTDATEF(t)+j+V.EO.TIMEF(t)},YEAR:function(t,n){return r(t).GetYear()},MONTH:function(t,n){return r(t).GetMonth()},DAY:function(t,n){return r(t).GetDay()},YEARDAY:function(t,n){return r(t).yDay()},WEEKDAY:function(t,n){return r(t).GetWeekDay()},WEEK:function(t,n){return r(t).GetWeekNo()},HOUR:function(t,n){return r(t).GetHour()},MINUTE:function(t,n){return r(t).GetMinute()},SECOND:function(t,n){return r(t).GetSecond()},REVERSE:function(n,i){return t(n).toReverse()},MIN:function(t,n){return V.EO.LESS(t,n)?n:t},MAX:function(t,n){return V.EO.LESS(t,n)?t:n},SQRT:function(t,n){return Math.sqrt(e(t))},SIN:function(t,n){return Math.sin(e(t))},COS:function(t,n){return Math.cos(e(t))},ASIN:function(t,n){return Math.asin(e(t))},ACOS:function(t,n){return Math.acos(e(t))},store:[],STORE:function(t,n){var e=St(0,i(t))%10;return V.EO.store[e]=n},RESTORE:function(t,n){var e=St(0,i(t))%10;return V.EO.store[e]},IIF:function(t,n){return t?n:null},ELSE:function(t,n){return null===t?n:t},MOD:function(t,n){return e(t)%e(n)},LIKE:function(n,i){return V.Like.Match(t(n),t(i))},BITAND:function(t,n){return t&n},BITOR:function(t,n){return t|n},BITXOR:function(t,n){return t^n},BITSHIFT:function(t,n){var e=i(n);return 0===e?t:e<0?i(t)<<-e:i(t)>>e},BITNOT:function(t,n){return~t},HEX:function(t,n){return V.ToH(i(t))}}}}()),V.E=function(){function t(t){var n=s.get(t);return!n&&s.set(t,n=function(t){var n=new V.E.Ops(t);return n.AddType(t),n.Build(),n}(t)),n}function n(t){return O(t)}function i(i,r,s,o){var h=function(t,n,i){return i+tt+t+tt+n}(i=n(i),r=function(t){return O(t)}(r),s=function(t){return P(t,7)}(s)),a=e.get(h);return!a&&e.set(h,a=new V.Expr(i,r,t(s),o)),a}var e=new Map,r=new Map,s=new Map;return{Create:i,EvalCE:function(t,i){if(i){var e=n(i),s=r.get(e);!s&&r.set(e,s=new V.CExpr(e)),t=s.Evaluate(t)}return t},XC:function(){s.clear(),r.clear(),e.clear()}}}(),V.E.Const=function(t){this.type=17,this.const=t},V.E.Var=function(t){this.type=18,this.var=t};var xt=V.E.Var.prototype;xt.getVar=function(t){var n={index:t,subName:Z},i=t>>24&127;return i?127!=i&&(n.index=16777215&n.index,n.subName=String.fromCharCode(i)):2147483648&t&&(n.index=16777215&n.index,n.subName=j),n},V.E.Oper=function(t){this.type=32,this.callback=t};V.E.Oper.prototype.isO=function(t){var n=t.getOp(this.callback);return n&&n.Type||0},V.E.Case=function(){this.type=20,this.cbkVar=null,this.oDefE=null,this.mCE=new Map};var Pt=V.E.Case.prototype;Pt.addCase=function(t,n,i){var e=!1,r=t.GetKeywords(),s=new V.Expr(i,r,t.oOps,t.cNVar);return s.IsValid()&&("default"==E(n)?(this.oDefE=s,e=!0):n.split(",").forEach(function(n){var i=new V.Expr(n,r,t.oOps,t.cNVar);i.IsValid()&&(e=!0,this.mCE.set(V.ToV(i.Evaluate(this.cbkVar)),s))},this)),e},Pt.Evaluate=function(t){var n=this.mCE.get(V.ToV(t));return n?n.Evaluate(this.cbkVar):this.oDefE?this.oDefE.Evaluate(this.cbkVar):t},V.E.M1=function(t){this.oOps=t,this.rgStk=[]};var Wt=V.E.M1.prototype;Wt.pushC=function(t){this.rgStk.push(new V.E.Const(t))},Wt.pushV=function(t){this.rgStk.push(new V.E.Var(t))},Wt.pushO=function(t){this.rgStk.push(new V.E.Oper(t))},Wt.pushCase=function(t){this.rgStk.push(t)},Wt.IsEmpty=function(){return!this.rgStk.length},Wt.popE=function(){return this.rgStk.pop()},Wt.getE=function(){return this.IsEmpty()?null:this.rgStk[this.rgStk.length-1]},Wt.isO=function(t){return 32==t.type?t.isO(this.oOps):0},Wt.isC=function(t){return 17==t.type},Wt.isCase=function(t){return 20==t.type},Wt.IsValid=function(){var t=0;return this.rgStk.forEach(function(n){var i=this.isO(n);t++,i&&(t-=i)},this),1==t},Wt.optimize=function(){function t(t){return!this.mUnopt.get(t)}V.debug&&this.Debug&&(this.sUnoptimizedDebug=this.Debug());for(var n=this.rgStk,i=!0;i;){i=!1;for(var e=!0,r=0;e&&r0;a--){var u=r-a;u>=0&&(h&=this.isC(n[u]))}if(h&&r>=o){var c=s.callback;if(t.call(this.oOps,c)){var l,f=1==o,g=Lt.val(n[r-1]);f||(l=g,g=Lt.val(n[r-2]));var d=c(g,l);n.splice(r,1),r--,f||(n.splice(r,1),r--),n[r].const=d,e=!1,i=!0}}}}}},V.E.Op=function(t,n,i,e){this.Name=t,this.Callback=n,this.Priority=i||0,this.Type=D(e,2)},V.E.Ops=function(t){this.type=t,this.rgOp=[],this.mMch=new Map,this.mN=new Map,this.mCBK=new Map,this.mUnopt=new Map};var It=V.E.Ops.prototype;It.len=function(){return this.rgOp.length},It.Add=function(t,n,i,e){t&&n&&this.rgOp.push(new V.E.Op(t,n,i,e))},It.AddType=function(t){function n(t){var n=V.EO;switch(t){case 1:this.Add("+",n.ADD,10),this.Add("-",n.SUBTRACT,10),this.Add("*",n.MULTIPLY,20),this.Add($,n.DIVIDE,20);break;case 2:this.Add("or",n.OR,0),this.Add("and",n.AND,1),this.Add("not",n.NOT,2,1),this.Add(et,n.LESS,5),this.Add(et+it,n.LESSE,5),this.Add(it,n.EQUAL,5),this.Add("!"+it,n.NEQUAL,5),this.Add(rt,n.GREAT,5),this.Add(rt+it,n.GREATE,5);break;case 4:this.Add("startwith",n.SWITH,5),this.Add("endwith",n.EWITH,5),this.Add("contains",n.CONTAINS,5),this.Add("lfind",n.LFIND,5),this.Add("rfind",n.RFIND,5),this.Add("count",n.COUNT,5),this.Add("left",n.LEFT,5),this.Add("right",n.RIGHT,5),this.Add("lpad",n.LPAD,5),this.Add("rpad",n.RPAD,5),this.Add("concat",n.CONCAT,5),this.Add("mid",n.MID,5),this.Add("format",n.FORMAT,5),this.Add("in",n.INSET,5),this.Add("array",n.ARRAY,5),this.Add("switch",n.SWITCH,5),this.Add("split",n.SPLIT,10),this.Add("case",n.CASE,5),this.Add("replace",n.REPLACE,0),this.Add("with",n.WITH,0),this.Add("len",n.LEN,30,1),this.Add("type",n.TYPE,30,1),this.Add("lower",n.LOWER,30,1),this.Add("upper",n.UPPER,30,1),this.Add("proper",n.PROPER,30,1),this.Add("ltrim",n.LTRIM,30,1),this.Add("rtrim",n.RTRIM,30,1),this.Add("trim",n.TRIM,30,1),this.Add("int",n.INT,30,1),this.Add("round",n.ROUND,30,1),this.Add("floor",n.FLOOR,30,1),this.Add("abs",n.ABS,30,1),this.Add("str",n.STR,30,1),this.Add("chr",n.CHR,30,1),this.Add("asc",n.ASC,30,1),this.Add("currency",n.CURRENCY,30,1),this.Add("time",n.TIME,30,1),this.Add("timeF",n.TIMEF,30,1),this.Add("shortdate",n.SHORTDATE,30,1),this.Add("shortdateF",n.SHORTDATEF,30,1),this.Add("longdate",n.LONGDATE,30,1),this.Add("dbl",n.DBL,30,1),this.Add("date",n.DATE,30,1),this.UOAble(n.DATE),this.Add("dateS",n.DATES,30,1),this.Add("dateF",n.DATEF,30,1),this.Add("year",n.YEAR,30,1),this.Add("month",n.MONTH,30,1),this.Add("day",n.DAY,30,1),this.Add("yearday",n.YEARDAY,30,1),this.Add("weekday",n.WEEKDAY,30,1),this.Add("week",n.WEEK,30,1),this.Add("hour",n.HOUR,30,1),this.Add("min",n.MINUTE,30,1),this.Add("sec",n.SECOND,30,1),this.Add("reverse",n.REVERSE,30,1),this.Add("MIN",n.MIN,5),this.Add("MAX",n.MAX,5),this.Add("sqrt",n.SQRT,30,1),this.Add("sin",n.SIN,30,1),this.Add("cos",n.COS,30,1),this.Add("asin",n.ASIN,30,1),this.Add("acos",n.ACOS,30,1),this.Add(":=",n.STORE,0),this.UOAble(n.STORE),this.Add("=:",n.RESTORE,40,1),this.UOAble(n.RESTORE),this.Add("?",n.IIF,0),this.Add(tt,n.ELSE,0),this.Add("mod",n.MOD,20),this.Add("like",n.LIKE,20),this.Add("bitand",n.BITAND,20),this.Add("bitor",n.BITOR,20),this.Add("bitxor",n.BITXOR,20),this.Add("bitshift",n.BITSHIFT,20),this.Add("bitnot",n.BITNOT,30,1),this.Add("hex",n.HEX,30,1)}}for(var i=1;i<=t;)t&i&&n.call(this,i),i*=2},It.Build=function(){this.mMch.clear(),this.mN.clear(),this.mCBK.clear(),this.rgOp.forEach(function(t){this.mN.set(t.Name,t),this.mCBK.set(t.Callback,t);for(var n=t.Name,i=t.Callback;n.length;)this.addMatch(n,i),n=b(n,0,n.length-1)},this)},It.addMatch=function(t,n){var i=this.mMch.get(t);!i&&this.mMch.set(t,i=[]),i.push(n)},It.getOp=function(t){return this.mCBK.get(t)},It.cmpPriority=function(t,n){function i(t){var n=this.getOp(t);return n&&n.Priority||0}if(e(t))return 1;if(e(n))return-1;var r=i.call(this,t),s=i.call(this,n);return r==s?0:r=0;h--){var u=o[h],c=this.f2S(u);if(this.OpMatch(c,t,n))return{callback:u,fetched:c.length}}return null},It.OpMatch=function(t,n,i){for(var e=!1,r=0,s=t.length,o=i,h=n.length;r1&&!this.stkOp[t-1]){var n=this.stkOp[t-2];return n==V.EO.INSET||n==V.EO.ARRAY||n==V.EO.SWITCH||n==V.EO.CASE}}.call(this))return!1;for(var e=[],r=0;r0))return;n=s[r-1],s[r-1]=this.exOp(e,n,n);break;case 2:if(!((r=s.length)>1))return;i=s.pop(),n=s[--r-1],s[r-1]=this.exOp(e,n,i)}if(1==s.length)return s[0]}},Lt.exOp=function(t,n,i){return t.callback(n,i)},Lt.createCase=function(t){for(;t.currentChar()==j;)t.position++;if("("==t.currentChar()){t.position++;for(var n=new Map,i=!1,e=0,r=Z,s=Z,o=t.position;t.continue()&&!i;){var h=t.currentChar();switch(h){case"'":case"`":case'"':for(t.position++;t.continue();){if("\\"==t.currentChar())t.nextChar()==h&&t.position++;else if(t.currentChar()==h)break;t.position++}}switch(h){case":":0==e&&(s=Z,r=b(t.expression,o,t.position-o),o=t.position+1);break;case";":0==e&&(s=b(t.expression,o,t.position-o),o=t.position+1,n.set(r,s),r=Z,s=Z);break;case"(":e++;break;case")":e>0?e--:(n.set(r,b(t.expression,o,t.position-o)),i=!0)}t.position++}if(i){var a=new V.E.Case,u=!0;if(n.forEach(function(t,n){u&&(u=a.addCase(this,y(n),y(t)))},this),u)return a}}return null},V.CExpr=function(t){this.sCE=y(O(t)),this.bP=!1,this.bV=!1,this.rgoE=[null,null,null,null]};var Mt=V.CExpr.prototype;Mt.parse=function(){function t(){this.reset();var t,n=this.sCE;if(n.sWith("[")&&n.eWith("]")){n=b(n,1,n.length-2);var i=this.rgoE.length;n.splitP(",",i).forEach(function(n,i){var e=function(t){var n=V.E.Create(t,"x,y,width,height");return n.parse()?n:null}(n);(this.rgoE[i]=e)&&(t=!0)},this)}return t}return this.bP||(this.bP=!0,this.bV=t.call(this)),this.bV},Mt.reset=function(){this.rgoE=[null,null,null,null]},Mt.Evaluate=function(t){return this.parse(),this.bV&&(t=V.C2R(t),this.rgoE.forEach(function(n,i){n&&(t[i]=n.Evaluate(function(n){return t[-n-1]}))})),t},V.Like=function(){function t(t){var n=i.get(t);return!n&&i.set(t,n=new V.MW(t)),n}var i=new Map;return{Match:function(i,e){return n(t(e).Match(i))},Mask:function(n){return t(n)},XC:function(){i.clear()}}}(),V.MW=function(t,n,i){this.bCS=i,this.cPS=e(n)?j:n.toString(),this.rgPn=[],this.Set(this.sM=t)};var Gt=V.MW.prototype;Gt.Set=function(t){function n(t){if(t){var n=new V.MW.PN(t,this.matchWord);switch(n.len()){case 1:switch(n.at(0).nElT){case 16:n.Match=this.is,n.Mask=n.at(0).E;break;case 1:n.Match=this.endWith,n.Mask=n.at(0).E;break;case 4:n.Match=this.anything,n.Mask=n.at(0).E}break;case 2:if(4==n.at(1).nElT)switch(n.at(0).nElT){case 16:n.Match=this.startWith,n.Mask=n.at(0).E;break;case 1:n.Match=this.has,n.Mask=n.at(0).E}}this.rgPn.push(n)}}t=e(t)?Z:t.toString(),this.sM=t,this.rgPn=[];for(var i=Z,r=ut,s=0,o=t.length,h="\0",a="\0";s=0&&s>=0;o--,s--)if(r(t[o])!=r(e[s]))return!1;if(s<0)return i.FAt=t.length-e.length,i.FLen=e.length,!0},Gt.has=function(t,n){for(var i=n.at(0),e=i.E,r=this.cbkCS(),s=t.length,o=e.length,h=0;hanchor",visitAnchorFormat:"anchor"}}}();var Ft="rgba(0,0,0,.1)",Nt="rgba(0,0,0,.15)",Bt="rgba(0,0,0,.3)",zt="rgba(0,0,0,.5)",Ut="[x+(width-8)/2,y+(height-8)/2,8,8]";V.Shapes={ScrollBar:{background:{tRange:{normal:{fillColor:"rgba(0,0,0,.25)",pad:-2},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,0.375)"},click:{fillColor:zt}},range:{normal:{fillColor:"#F0F0F0",frameColor:"#C0C0C0",opacity:.25},hover:{opacity:1}},button:{normal:{frameColor:Ft,fillColor:Ft},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.2)"},click:{fillColor:zt}},buttonCircle:{normal:{frameColor:Ft,fillColor:Ft,primitive:"Circle",client:"[x+(width-16)/2, y+(height-16)/2,16,16]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.2)"},click:{fillColor:zt}},thumb:{normal:{fillColor:Bt,client:"[x+1,y+1,width-2,height-2]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:zt}},hThumb:{normal:{fillColor:Bt,client:"[x,y+2,width,height-4]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:zt}},vThumb:{normal:{fillColor:Bt,client:"[x+2,y,width-4,height]"},disabled:{opacity:.5},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:zt}},hThumbLite:{normal:{fillColor:Bt,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x,y+(height-6)/2,width,6]"},disabled:{fillColor:Nt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:zt}},vThumbLite:{normal:{fillColor:Bt,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x+(width-6)/2,y,6,height]"},disabled:{fillColor:Nt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:zt}},circle:{normal:{fillColor:"#A0A0A0",shadow:{blur:8,color:"black"},primitive:"Circle",client:"[x+(width-16)/2,y+(height-16)/2,16,16]"},disabled:{fillColor:"#C0C0C0",shadow:{blur:0}},hover:{pad:4},click:{fillColor:"#C0C0C0"}},hThumbCircle:{normal:{fillColor:Bt,primitive:"RoundRect",pArg:{x:-8,y:8},client:"[x,y+(height-16)/2,width,16]"},disabled:{fillColor:Nt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:zt}},vThumbCircle:{normal:{fillColor:Bt,primitive:"RoundRect",pArg:{x:8,y:-8},client:"[x+(width-16)/2,y,16,height]"},disabled:{fillColor:Nt},hover:{fillColor:"rgba(0,0,0,.4)"},click:{fillColor:zt}},back:{},vBackCircle:{normal:{fillColor:Ft,primitive:"RoundRect",pArg:{x:8,y:-8},client:"[x+(width-16)/2,y,16,height]"},hover:{fillColor:"rgba(0,0,0,.2)"}},hBackCircle:{normal:{fillColor:Ft,primitive:"RoundRect",pArg:{x:-8,y:8},client:"[x,y+(height-16)/2,width,16]"},hover:{fillColor:"rgba(0,0,0,.2)"}},hProgress:{normal:{fillColor:Ft,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x+16,y+(height-6)/2,width-32,6]"}},vProgress:{normal:{fillColor:Ft,primitive:"RoundRect",pArg:{x:3,y:3},client:"[x+(width-6)/2,y+16,6,height-32]"}}},foreground:{button:{},thumb:{},back:{}},overlay:{left:{normal:{client:Ut,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3,startAngle:-gt/2}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},right:{normal:{client:Ut,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3,startAngle:gt/2}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},up:{normal:{client:Ut,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},down:{normal:{client:Ut,fillColor:"black",primitive:"EllipticPolygon",pArg:{edges:3,startAngle:+gt}},disabled:{fillColor:"#C0C0C0"},click:{fillColor:"white"}},leftLite:{normal:{client:"[x+(width-6)/2,y+(height-10)/2,6,10]",fillColor:Bt,primitive:"EllipticPolygon",pArg:{edges:3,startAngle:-gt/2}},disabled:{fillColor:Nt},hover:{pad:1},click:{fillColor:zt}},rightLite:{normal:{client:"[x+(width-6)/2,y+(height-10)/2,6,10]",fillColor:Bt,primitive:"EllipticPolygon",pArg:{edges:3,startAngle:gt/2}},disabled:{fillColor:Nt},hover:{pad:1},click:{fillColor:zt}},upLite:{normal:{client:"[x+(width-10)/2,y+(height-6)/2,10,6]",fillColor:Bt,primitive:"EllipticPolygon",pArg:{edges:3}},disabled:{fillColor:Nt},hover:{pad:1},click:{fillColor:zt}},downLite:{normal:{client:"[x+(width-10)/2,y+(height-6)/2,10,6]",fillColor:Bt,primitive:"EllipticPolygon",pArg:{edges:3,startAngle:+gt}},disabled:{fillColor:Nt},hover:{pad:1},click:{fillColor:zt}}}},Empty:{},FrameSel:{normal:{frameColor:"rgba(64,128,255,.5)",fillColor:"rgba(64,128,255,.25)",primitive:"RoundRect"},disabled:{opacity:.5}},FrameFit:{normal:{frameColor:"gray",fillColor:"white",primitive:"RoundRect",pArg:{x:4,y:4},frameDash:2,opacity:.5}},CheckBox:{normal:{pad:-1,fillColor:"white",frameColor:"gray",primitive:"Rect",draw:function(t,n,i,e){e&&e.state&&V.D.P.fill(t,V.IRt(i.slice(),.2*-i[2],.2*-i[2]),"#666666",this.primitive,this.primitiveArg)}},disabled:{opacity:.5}},Radio:{normal:{pad:-1,fillColor:"white",frameColor:"gray",primitive:"Circle",draw:function(t,n,i,e){e&&e.state&&V.D.P.fill(t,V.IRt(i.slice(),.2*-i[2],.2*-i[2]),"#666666",this.primitive,this.primitiveArg)}},disabled:{opacity:.5}},Button:{normal:{fillColor:"#C0C0C0",frameColor:"gray"},disabled:{opacity:.5},click:{fillColor:"rgb(164,164,164)",frameColor:"rgb(80,80,80)"}},Expand:{normal:{pad:-4,fillColor:"white",frameColor:"rgba(0,0,0,.25)",draw:function(t,n,i,e){var r=V.IRt(i.slice(),.2*-i[2],.2*-i[2]);t.drawHLine([r[0],r[1]+r[3]/2],r[2],"black"),!(e&&e.state)&&t.drawVLine([r[0]+r[2]/2,r[1]],r[3],"black")}},disabled:{opacity:.5}},Border:{normal:{pad:-.5,frameColor:zt},disabled:{opacity:.5}},No:{normal:{pattern:6,patternColor:"rgba(0,0,0,.25)"}}},V.Intl=function(){function t(){var t,i,e,s=String(V.Def.Intl.firstWeekDay),o=V.WeekDayEnum;s&&s.splitP(",").forEach(function(s){(s=y(s))&&(t=T(s,"("))>=0&&(e=b(s,0,t))&&(e="ex"+e.toProper())in o&&(s=b(s,t+1),(i=T(s,")"))>=0&&(s=b(s,0,i)),s&&function(t,i){n(i)&&(i=E(String(i)))&&i.split(",").forEach(function(n){(n=y(n))&&r.set(n,t)})}(o[e],s))})}function i(){var t,i,e,r=String(V.Def.Intl.weekNumberAs),o=V.WeekNumberAsEnum;r&&r.splitP(",").forEach(function(r){(r=y(r))&&(t=T(r,"("))>=0&&(e=b(r,0,t))&&(e="ex"+e.toProper()+"WeekNumber")in o&&(r=b(r,t+1),(i=T(r,")"))>=0&&(r=b(r,0,i)),r&&function(t,i){n(i)&&(i=E(String(i)))&&i.split(",").forEach(function(n){(n=y(n))&&s.set(n,t)})}(o[e],r))})}function e(){o=function(){var t=!1;try{(new Date).toLocaleDateString("'i'")}catch(n){t="RangeError"==n.name}return t}(),r.clear(),s.clear(),t(),i()}var r=new Map,s=new Map,o=!0;return e(),{Init:e(),GetFirstWeekDay:function(t){var n,i=(t=t||null)||E(V.Def.Locale.language||V.lang()),e=r.get(i);return void 0==e&&(n=T(i,"-"))>=0&&(i=b(i,0,n))&&(e=r.get(i)),e||0},GetWeekNoAs:function(t){var n,i=(t=t||null)||E(V.Def.Locale.language||V.lang()),e=s.get(i);return void 0==e&&(n=T(i,"-"))>=0&&(i=b(i,0,n))&&(e=s.get(i)),e||0},SupportLocales:o}}(),V.Loc=function(){function t(){o.clear(),u=[],s()}function r(t){t=t||null;var n,r,s,u=o.get(t);if(i(u)){var c=V.Intl.SupportLocales?t||(V.Def.Locale.language||V.lang()):"en-us";u=V.Cpy(V.Def.Locale);try{u.language=O(c),n=function(t){var n=[];if(V.Intl.SupportLocales)for(var i=0;i=0)return{group:y(b(t,0,n++)),parts:y(b(t,n,i-n))}}}(t);if(i){var e=i.group;e&&i.parts.split(",").forEach(function(t){if(t=y(t)){var i=n.get(t);i?i.indexOf(e)<0&&i.push(e):n.set(t,[e])}})}}),n}function n(n,e){var r=i.get(e=O(e));return!r&&i.set(e,r=t(e)),r.get(n)}var i=new Map;return{Get:function(t,i){var e=n(t,i);if(e)return e[e.length-1]},GetAll:n,XC:function(){i.clear()}}}(),V.S=function(){function t(t,n,e){function r(t){for(var n=V.Shapes,i=y(String(t)).split(st),e=0,r=i.length;n&&e0&&V.IRt(u,l/2,l/2),!V.EyR(u)||r.draw){t.save(),n(r.opacity)&&(t.globalAlpha=D(r.opacity,1)),l>1&&(t.lineWidth=l),r.frameDash&&t.setLineDash(h(r.frameDash)?r.frameDash:[r.frameDash]),r.frameJoin&&(t.lineJoin=r.frameJoin),r.frameCap&&(t.lineCap=r.frameCap);var g=r.shadow;if(!l&&n(f)&&(n(g)&&e(g.color)&&((g=V.Cpy(g)).color=f),f=null),V.D.P.fillS(t,u,r.fillGradientColor?V.Grad.Create(t,r.fillColor,r.fillGradientColor,u):r.fillColor,f,g,r.primitive,r.pArg||s),r.pattern&&V.D.P.fillP(t,u,I(r.pattern,V.PatternEnum),r.patternColor,r.primitive,r.pArg||s),a=o(s&&s.text,r.text),n(a)){var d=I(o(s&&s.formatText,r.formatText),V.DrawTextFormatEnum,262181),v=o(s&&s.clipText,r.clipText),p=o(s&&s.padText,r.padText),C=o(s&&s.clientText,r.clientText),m=c.slice(),S=r.tfi?V.TFI.bCTX(t,r.tfi):null;v&&t.selClip(u,r.primitive,r.pArg),p&&V.PRt(m,p),C&&(m=V.E.EvalCE(m,C)),t.drawHTMLText(a,m,d),v&&t.resClip(),S&&V.TFI.eCTX(t,S)}r.draw&&r.draw.call(r,t,i,u,s),t.restore()}}return u},Get:t,GetOf:function(n,e,r){var s=n;if(a(n)){var h=Z+r+e+n;if(i(s=o.get(h))){var u,c,l=[];if(n.split(",").forEach(function(n){n&&((c=V.GP.GetAll(n,e))?c.forEach(function(n){(f=t(n,r))&&l.push(f)}):(f=t(n,r,!0))&&l.push(f))}),u=l.length){var f=l[0];if(1==u)s=f;else{s=V.Cpy(f);for(var g=1;g=0&&e>=0?V.Cmp.N(i,e):i<0&&e<0?V.Cmp.N(t,n):i<0?1:-1}return 0}),i.forEach(function(t){n=function(t,n){return n&&(t&&(t+=m),t+=n),t}(n,r(t))})}return n}function u(t){var e=w;return t&&i(e=A.get(t))&&A.set(t,e=function(t){var i=new V.Arr,e=V.Cpy(v);return t.split(m).forEach(function(t){var e=s(t);n(e)&&i.add(e)}),i.forEach(function(t){switch(t){case p.ALT:e.alt=!0;break;case p.CTRL:e.ctrl=!0;break;case p.SHIFT:e.shift=!0;break;case p.META:e.meta=!0;break;default:e.keyCode=t}}),e}(t)),e}function l(t){var i=new V.Arr;return n(t.shift)&&t.shift&&i.add(p.SHIFT),n(t.meta)&&t.meta&&i.add(p.META),n(t.ctrl)&&t.ctrl&&i.add(p.CTRL),n(t.alt)&&t.alt&&i.add(p.ALT),n(t.keyCode)&&0!=t.keyCode&&i.add(t.keyCode),i}function f(t){var i=t;return n(t)&&(a(t)||c(t))&&(i=u(t+Z)),i}function g(t){var n=f(t);return n&&(l(n).len()||(n=null)),n}function d(t,n,i){if(t){var e=o(n,i);if(e)return function(t,n){return t===n||(t&&n?l(f(t)).equal(l(f(n))):void 0)}(e,f(t))}}var v={alt:!1,ctrl:!1,meta:!1,shift:!1,keyCode:0},p={LButton:1,RButton:2,Cancel:3,MButton:4,XButton1:5,XButton2:6,Backspace:8,Tab:9,Clear:12,Enter:13,Return:13,SHIFT:16,CTRL:17,Control:17,ALT:18,Menu:18,Pause:19,CapsLock:20,Capital:20,Kana:21,Hangeul:21,Hangul:21,Junja:23,Final:24,Hanja:25,Kanji:25,Escape:27,Esc:27,Convert:28,NonConvert:29,Accept:30,ModeChange:31,Space:32,PageUp:33,Prior:33,PageDown:34,Next:34,End:35,Home:36,ArrowLeft:37,Left:37,ArrowUp:38,Up:38,ArrowRight:39,Right:39,ArrowDown:40,Down:40,Select:41,Print:42,Execute:43,PrintScreen:44,PrintScr:44,Snapshot:44,Insert:45,Delete:46,Help:47,META:91,WIN:91,LWin:91,RWin:92,ContextMenu:93,Apps:93,Sleep:95,NumPad0:96,NumPad1:97,NumPad2:98,NumPad3:99,NumPad4:100,NumPad5:101,NumPad6:102,NumPad7:103,NumPad8:104,NumPad9:105,Multiply:106,Add:107,Separator:108,Subtract:109,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,F13:124,F14:125,F15:126,F16:127,F17:128,F18:129,F19:130,F20:131,F21:132,F22:133,F23:134,F24:135,NumLock:144,ScrollLock:145,Scroll:145,OEM_NEC_EQUAL:146,OEM_FJ_JISHO:146,OEM_FJ_MASSHOU:147,OEM_FJ_TOUROKU:148,OEM_FJ_LOYA:149,OEM_FJ_ROYA:150,LSHIFT:160,RSHIFT:161,LCONTROL:162,RCONTROL:163,LMENU:164,RMENU:165,BrowserBack:166,BrowserForward:167,BrowserRefresh:168,BrowserStop:169,BrowserSearch:170,BrowserFavorites:171,BrowserHome:172,VolumeMute:173,VolumeDown:174,VolumeUp:175,MediaNextTrack:176,MediaPrevTrack:177,MediaStop:178,MediaPlayPause:179,LaunchMail:180,LaunchMediaSelect:181,LaunchApplication1:182,LaunchApplication2:183,OEM_1:186,Plus:187,OEM_PLUS:187,Comma:188,OEM_COMMA:188,Minus:189,OEM_MINUS:189,Period:190,OEM_PERIOD:190,Slash:191,OEM_2:191,OEM_3:192,OEM_4:219,Backslash:220,OEM_5:220,OEM_6:221,OEM_7:222,OEM_8:223,OEM_AX:225,OEM_102:226,ICO_HELP:227,ICO_00:228,PROCESSKEY:229,ICO_CLEAR:230,PACKET:231,OEM_RESET:233,OEM_JUMP:234,OEM_PA1:235,OEM_PA2:236,OEM_PA3:237,OEM_WSCTRL:238,OEM_CUSEL:239,OEM_ATTN:240,OEM_FINISH:241,OEM_COPY:242,OEM_AUTO:243,OEM_ENLW:244,OEM_BACKTAB:245,ATTN:246,CRSEL:247,EXSEL:248,EREOF:249,PLAY:250,ZOOM:251,NONAME:252,PA1:253,OEM_CLEAR:254},C=t.prototype;C.add=function(t,n){i(this.rgK2N[t])&&(this.rgK2N[t]=n),this.mN2K.set(E(n),t)},C.f2S=function(t){return t>=0&&t<256&&this.rgK2N[t]||null},C.n2C=function(t){return this.mN2K.get(E(y(t)))||null};var m="+",S=new t,A=new Map,w=V.Cpy(v),R=new V.Arr(p.ALT,p.CTRL,p.SHIFT,p.META);return{StEy:g,IsStEv:d,ToSt:o,St2Str:h,Str2St:u,GetSt:f,ModK:function(t){var n=0,i=g(t);return i&&(i.shift&&(n|=1),i.ctrl&&(n|=2),i.alt&&(n|=4),i.meta&&(n|=16)),n},IsModK:function(t){var n=!1,i=g(t);return i&&(n=i.shift||i.meta||i.ctrl||i.alt),n},f2S:r,n2C:s}}(),V.Sts=function(){this.mS=new Map};var Vt=V.Sts.prototype;Vt.toS=function(t){return V.K.StEy(t)},Vt.Has=function(t,n){r=this.toS(t);if(r){var i=this.mS.get(V.K.St2Str(r));if(i){if(!n){var e=[];return i.forEach(function(t){e.push(t)}),e}var r;if(r=i.get(n))return[r]}}},Vt.Add=function(t,i,e,r,s){var o=!1,h=this.toS(t);if(o=!!h){e=e||null;var a=V.K.St2Str(h),u=this.mS.get(a);!u&&this.mS.set(a,u=new Map),u.set(e,{shortcut:a,description:r,callback:i||null,thisArg:e,keyState:n(s)?s:-1})}return o},Vt.Remove=function(t,n){var i=this.toS(t);if(i){var e=V.K.St2Str(i);if(n){var r=this.mS.get(e);r&&(r.delete(n),0==r.size&&this.mS.delete(e))}else this.mS.delete(e)}},Vt.Clear=function(){this.mS.clear()},Vt.RemoveOf=function(t){if(e(t))this.Clear();else{var n=[];this.forEach(function(i){i.thisArg==t&&n.push(i)}),n.forEach(function(t){this.Remove(t.shortcut,t.thisArg)},this)}},Vt.forEach=function(t,n){g(t)&&this.mS.forEach(function(i){i.forEach(function(i){t.call(n,i)})})},Vt.isLocked=function(t,n){var i,e=V.RUR.Rng();return e||(i=this.Has(t))&&i.length>1&&i.forEach(function(t){t.thisArg&&t.thisArg.nAXChg&&(e=t.thisArg!=n)}),e},Vt.onkey=function(t,n){var i=V.K.ToSt(t,n);if(i){if(V.RUR.ModKeys.value)return void(V.IsModK(t)||(V.RUR.ModKeys.value=0));var e=!1,r=V.K.St2Str(i),s=this.mS.get(r);s&&s.forEach(function(t){t.keyState==n&&g(t.callback)&&(this.isLocked(t.shortcut,t.thisArg)||(e=!0,t.callback.call(t.thisArg,t)))},this),e&&V.SEP(t)}},V.D=function(){function t(){var t=V.Cpy(V.Def.Shape);return t.fillColor="white",t.frameColor="black",t.primitive="BevelRect",t}function i(){var t=V.Cpy(V.Def.Shape);return t.fillColor="white",t.frameColor="#808080",t.primitive=Z,t}function e(){var t=V.Cpy(V.Def.Shape);return t.pad=2,t.fillColor=null,t.frameColor="#808080",t.pattern=6,t.patternColor="rgba(128,128,128,0.5)",t}var r=[2,8,1,4];return{WindowSplitColor:"#E0E0E0",WindowSplit:function(t,n,i){G(t,n,V.D.WindowSplitColor)},WindowSplitSize:2,WindowSplitByFrames:!1,AnchorXChgInflate:8,AnchorXChgRect:function(t,n,i){i=Z+i;var e=t.sizeHTMLText(i),r=e.width+V.D.AnchorXChgInflate,s=e.height+V.D.AnchorXChgInflate/2;return[n[0]+n[2]-r-4,n[1]+4,r,s]},AnchorXChgShape:t(),AnchorXChgShapeMin:function(){var n=V.Cpy(t());return n.opacity=.5,n}(),AnchorXChgShapeClick:function(){var n=V.Cpy(t());return n.pad=2,n.fillColor="black",n.tfi={fgColor:"white"},n}(),AnchorXChgDockBorderColor:"#444444",AnchorXChgShapeDock:i(),AnchorXChgShapeParentDock:function(){var t=V.Cpy(V.Def.Shape);return t.fillColor="white",t.frameColor="black",t.shadow.blur=8,t}(),AnchorXChgShapeDockHover:function(){var t=V.Cpy(i());return t.fillColor=t.frameColor,t.tfi={fgColor:"white"},t}(),AnchorXChgDockTimeout:750,AnchorXChg:function(t,n,i,e){t.drawShape(n,i,{text:e})},TargetAnchorXChgShape:e(),TargetAnchorXChgSourceShape:function(){var t=V.Cpy(e());return t.opacity=.5,t.pattern=7,t}(),TargetAnchorXChg:function(t,n,i){t.drawShape(n,i)},AnchorXChgByAlpha:!1,WindowFrameColor:"#E0E0E0",WindowFrame:function(t,i,e,s){s=n(s)?s:V.D.WindowFrameColor,e?5!=e&&V.DrawEdge(t,i,r[e-1],s):V.D.P.fillS(t,i,null,s)},Background:null,Foreground:null,Opacity:null,HoverBackground:null,HoverForeground:null,HoverOpacity:null,HoverDuration:250,HoverOnClient:!1,HoverOverride:!1}}(),V.G=function(){function t(t){this.client=t.slice(),this.x=t[0],this.y=t[1],this.w=t[2],this.h=t[3],this.radiusX=this.w/2,this.radiusY=this.h/2,this.xm=this.x+this.radiusX,this.ym=this.y+this.radiusY}function i(){this.p1={x:0,y:0},this.p2={x:1,y:1},arguments.length&&this.Set.apply(this,arguments)}function r(t,n,i){return((u(n,i)*t+c(n,i))*t+l(n))*t}function u(t,n){return 1-3*n+3*t}function c(t,n){return 3*n-6*t}function l(t){return 3*t}function f(t,n){var i=s(n)-s(t),e=o(n)-o(t);return Math.sqrt(i*i+e*e)}function g(t){return At(Math.sin(gt/t))}function d(){return.5}function v(t,n,i){var e=[],r=s(t),h=o(t),a=s(n),u=o(n),c=At(a-r),l=At(u-h);if(c||l){i=St(1,i||1);for(var f=a-r<0?-1:1,g=u-h<0?-1:1,d=Et(c,l),v=St(c,l),p=v,C=2*d-v,m=d<<1,S=d-v<<1,E=1-(A=c>=l?1:0),A=f*A,w=f*(w=1),E=g*E,R=g*(R=1),b=r,T=h,y=0;y=f?1:0,A=1-E,w=1,R=1;E*=g,w*=g,A*=d,R*=d;for(var b=0,T=u,y=c;r.call(h,T,y);b++)a.x=T,a.y=y,C<0?(C+=m,T+=E,y+=A):(C+=S,T+=w,y+=R);if(n(a.x)&&n(a.y))return a}}function C(t,n,i,e,r){var h=[];if(e&&(n||i)){r=St(1,r||1);for(var a=s(t),u=o(t),c=At(n),l=At(i),f=n<0?-1:1,g=i<0?-1:1,d=Et(c,l),v=St(c,l),p=2*d-v,C=d<<1,m=d-v<<1,S=1-(E=c>=l?1:0),E=f*E,A=f*(A=1),S=g*S,w=g*(w=1),R=a,b=u,T=null,y=0;e(R,b);y++)T=[R,b],y%r==0&&(h.push(T),T=null),p<0?(p+=C,R+=E,b+=S):(p+=m,R+=A,b+=w);T&&h.push(T)}return h}function m(t,n,i,e){var r,h,a=[0,0,0,0];if(t)switch(n=n||0,i=i||0,r=s(t),h=o(t),I(e,V.CT)){case 17:a=[r,h,n,i];break;case 18:a=[r-n/2,h,n,i];break;case 20:a=[r-n,h,n,i];break;case 33:a=[r,h-i/2,n,i];break;case 36:a=[r-n,h-i/2,n,i];break;case 65:a=[r,h-i,n,i];break;case 66:a=[r-n/2,h-i,n,i];break;case 68:a=[r-n,h-i,n,i];break;default:a=[r-n/2,h-i/2,n,i]}return a}function S(t,n,i){return[s(t)+(s(n)-s(t))*i,o(t)+(o(n)-o(t))*i]}function E(t,n){var i,e,r=[0,0];if(t)switch(i=t[0],e=t[1],I(n,V.CT)){case 17:r=[i,e];break;case 18:r=[i+t[2]/2,e];break;case 20:r=[i+t[2],e];break;case 33:r=[i,e+t[3]/2];break;case 36:r=[i+t[2],e+t[3]/2];break;case 65:r=[i,e+t[3]];break;case 66:r=[i+t[2]/2,e+t[3]];break;case 68:r=[i+t[2],e+t[3]];break;default:r=[i+t[2]/2,e+t[3]/2]}return r}function A(t,n,i){var e=[];if(t&&n)if(V.EqR(t,n))e.push(t.slice());else{i=St(1,i||1);var r=function(t,n){function i(t,n,i){return f(E(t,i),E(n,i))}for(var e=[17,20,65,68],r=e[0],s=i(t,n,r),o=1,h=e.length;os&&(s=u,r=a)}return r}(t,n),s=E(t,r),o=E(n,r),h=t[2],a=t[3],u=n[2]-h,c=n[3]-a,l=f(o,s),g=u/l,d=c/l,p=v(s,o,i);e.push(t.slice());for(var C=1,S=p.length-1;Cv||np)}function h(t){return t>=0||At(t)<1e-6?1:-1}var a=null,u=s(i),c=o(i),l=s(e),f=o(e),g=t[0],d=t[1],v=V.ROf(t),p=V.BOf(t),C=r(u,c),m=C?1:-1,S=l-u,E=f-c,A=2147483647;if(S||E){var w=null,R=null,b=function(){var t=m*(l-u);return 0==t?A:m*(c-f)*(t<0?u-g:v-u)/t}();if(S<0?(w=C?g:v,R=c+m*b):(w=C?v:g,R=c+-m*b),!r(w,R)){var T=function(){var t=m*(f-c);return 0==t?A:m*(u-l)*(t<0?c-d:p-c)/t}();E<0?(w=u+m*T,R=C?d:p):(w=u+-m*T,R=C?p:d)}if(n(w)&&n(R)&&r(w,R)){var y=h(S),O=h(E),k=h(w-u),D=h(R-c);(w-u||R-c)&&(y!=k||O!=D)||(a=[w,R])}}return a}var k=t.prototype,x=360,P=180;k.a2P=function(t){return t=V.Def.G.getAngle(t),[this.xm+Math.cos(t)*this.radiusX,this.ym+Math.sin(t)*this.radiusY]},k.p2A=function(t){var n=s(t)-this.xm,i=o(t)-this.ym,e=-Math.atan(n*this.radiusY/(i*this.radiusX));return i>=0&&(e+=gt),e<0&&(e+=2*gt),e-V.Def.G.getAngle(gt/2)||0};var W=i.prototype;W.Set=function(){function t(t){return V.Def.G.Transitions[t]}var n,i,e=arguments,r=e.length;return 4==r?(this.SetP1({x:e[0],y:e[1]}),this.SetP2({x:e[2],y:e[3]})):2==r?(this.SetP1(e[0]),this.SetP2(e[1])):(h(i=h(n=e[0])?n:t(n))&&4==i.length||(i=t("linear")),i&&(this.SetP1({x:i[0],y:i[1]}),this.SetP2({x:i[2],y:i[3]}))),this},W.Get=function(t){function n(t){return function(t,n,i){return 3*u(n,i)*t*t+2*c(n,i)*t+l(n)}(t,this.p1.x,this.p2.x)}function s(t){return r(t,this.p1.x,this.p2.x)}return e(t)?t=this.GetP12():(t=i.adjustX(t),this.isL()||t&&t<1&&(t=function(t){return r(t,this.p1.y,this.p2.y)}.call(this,function(t,i){for(var e=0;e<4;e++){var r=n.call(this,i);if(0===r)return i;i-=(s.call(this,i)-t)/r}return i}.call(this,t,function(t){if(t>0&&t<1){for(var n=0,i=0,e=i;n<2&&t>(e=s.call(this,n));)i=e,n+=1/21;return i==e?t<.5?0:1:n-1/21+1/21*(t-i)/(e-i)}return t}.call(this,t))))),t},i.adjustX=function(t){return St(0,Et(1,t))},W.onChange=function(t){this.p1.x=i.adjustX(this.p1.x),this.p2.x=i.adjustX(this.p2.x),this.onchange&&this.onchange.callback.call(this.onchange.thisArg||this,t,this)},W.isL=function(){return this.p1.x==this.p1.y&&this.p2.x==this.p2.y},W.SetP1=function(t){this.p1={x:D(s(t)),y:D(o(t))},this.onChange(1)},W.GetP1=function(){return{x:this.p1.x,y:this.p1.y}},W.SetP2=function(t){this.p2={x:D(s(t)),y:D(o(t))},this.onChange(2)},W.GetP2=function(){return{x:this.p2.x,y:this.p2.y}},W.GetP12=function(){return[this.p1.x,this.p1.y,this.p2.x,this.p2.y]},W.SetP12=function(){return this.Set.apply(this,arguments)},W.GetName=function(){function t(t,n){for(var i=0;i<4;i++)if(At(t[i]-n[i])>5e-4)return!1;return!0}if(this.isL())return"linear";var n=V.Def.G.Transitions,i=this.GetP12();if(n)for(var e in n)if(t(n[e],i))return e},W.Trans=function(t){var n,e,r,s,o=t;if(h(t)&&!this.isL()&&(n=t.length)>1){o=[],s=1/(n-1),e=t[0],r=t[n-1];for(var a,u=0,c=0;u=n?r:t[a])}return o};var L={t:.8284271242805504,w:function(t){return 2*St(1,t||1)+4},h:function(t){return this.w(t)/this.t}},M=function(){function t(t){var n,i=v.get(t);return i||(i=[],t&&34!=t&&(a(t)?t.split(","):[t]).forEach(function(e){if(n=g[e])34!=n&&i.push(n);else for(var r in g)(n=g[r])==(n&t)&&34!=n&&i.push(n)}),!i.length&&(i=d),v.set(t,i)),i}function n(n,i,e,r){var s,o=t(e),h=t(r);return 1==o.length&&1==h.length?s={cS:o[0],cE:h[0]}:o.forEach(function(t){var e=function(t,n,i){var e,r;return(i||d).forEach(function(i){r=~~V.G.Dist(t,V.G.R2C(n,i)),(!e||r=V.BOf(e))&&(!(St(n,i)<=e[0])&&!(Et(n,i)>=V.ROf(e)))}function e(t){return 16&t?-17&t|64|15&t:64&t?-65&t|16|15&t:t}function r(t){return 16&t}function h(t){return 64&t}function u(t){return 4&t}function c(t){var n=!1;switch(t){case 17:case 18:case 33:n=!0}return n}function l(t){return D(t,12)}function f(t,n,s,o,a,g,d,v){function C(){var t=function(){var t=X==E;return t&&F==A?0:t?1:2}();if(t){if(t==O){var n=w.length-1;w[n][0]=E=X,w[n][1]=A=F}else w.push([E=X,A=F]);O=t}}function m(){F=y;var u=g,c=v;switch(b>0&&(u=e(g),c=-c),u){case 18:case 20:k&&20==u||(F-=c);break;case 66:case 68:F+=c;break;case 36:if(!k){var l=Et(t[1]-o,a[1]-v),f=St(V.BOf(t)+o,V.BOf(a)+v);if(33==n)F=b<0?l:f;else{var d=i(s[1],s[0],s[0]+R,V.IRt(a.slice(),v+.5,v+.5));r(n)?F=d?l:V.BOf(a)+v:h(n)?F=d?f:a[1]-v:d&&(F=b<0?V.BOf(a)+v:a[1]-v)}}}}function S(){X=T,36==g&&(X+=v)}o=l(o),v=l(v);var E,A,w=[],R=~~(d[0]-s[0]),b=~~(d[1]-s[1]),T=d[0],y=d[1],O=0,k=!1;if(R>=0||p){X=s[0],F=s[1],w.push([E=X,A=F]);var D=!0;switch(n){case 33:X-=o,C();break;case 36:!function(){X+=o;var t=g;if(b>0&&(t=e(g)),!c(t)&&(b>0?a[1]-F:F-V.BOf(a))>v)switch(X=T,t){case 20:case 36:k=!0,X+=v}}(),C();break;default:(D=!function(){var i=!1;switch(n){case 68:i=r(g)&&b>v||u(g)&&a[1]-V.BOf(t)>v;break;case 20:i=h(g)&&-b>v||u(g)&&t[1]-V.BOf(a)>v}return i&&(k=36==g||g==n,S(),C(),m(),C()),i}())&&V.EyR(V.NRt(V.IRt(t.slice(),o-.5,o-.5),V.IRt(a.slice(),v-.5,v-.5)))&&function(){var e=o,s=!1,u=!1,l=!1,f=!1,d=!1,p=0,m=36==g;if(h(n)?(s=b<0)&&(s=!function(t){var n=!1;switch(g){case 68:case 66:case 36:n=!0}return n}()||Math.sign(b)!=Math.sign(e))&&(p=St(V.BOf(t)+o,V.BOf(a)+v),u=68!=n,l=18==g,f=36==g||20==g,(d=c(g)||-b0)&&(s=!function(t){var n=!1;switch(g){case 20:case 18:case 36:n=!0}return n}()||Math.sign(b)!=Math.sign(e))&&(p=Et(t[1]-o,a[1]-v),u=20!=n,l=66==g,f=36==g||68==g,(d=function(t){var n=!1;switch(g){case 65:case 66:case 33:n=!0}return n}()||ba[0]-v)&&(F=p),C()),d){if(X=V.ROf(t)+o,l){var S=a[0]-v;X>S&&(X=St(X,V.ROf(a)+v))}C()}else k=!0,X=T,f&&(X+=v),C()}()}D&&(m(),C(),S(),C(),F=y,C()),X=T,F=y,C()}else p++,(w=f(a,g,d,v,t,n,s,o)).reverse(),p--;var x=w.length;if(x>2){var P=0,W=w[P][0],I=W,L=W,M=w[P][1],G=M,H=M;for(++P;P1&&!function(t){for(var n,i={m:[s(t[0]),o(t[0])],M:[s(t[0]),o(t[0])]},e=1;!n&&evt;return n}(t)){for(var E,A,w=0;w0||C(l(E)-l(A))>0)&&m.push(A),E=A;if((u=m.length)>1){i=1-(i||0),e=D(e,.5),r?(m.push(m[0]),m.push(m[1]),m.splice(0,0,m[u-1])):(m.push([2*c(m[u-1])-c(m[u-2]),2*l(m[u-1])-l(m[u-2])]),m.splice(0,0,[2*c(m[0])-c(m[1]),2*l(m[0])-l(m[1])])),n&&n.splice(0),a.push([c(m[1]),l(m[1])]);for(var w=1,R=m.length-2;w1){var h=n(r)-1,a=h+2,u=e[h],c=e[a]/(s+1),l=0,f=0;t.sort(function(t,n){var e=t.oL,r=n.oL,s=w(i(t.io)),o=w(i(n.io));return l=St(S.cRut.defW(e["w"+s]),S.cRut.defW(r["w"+o])),e.c["p"+s][h]-r.c["p"+o][h]}),f=(l/=2)/(s-1),t.forEach(function(t,n){var i=t.oL;i.c["p"+w(t.io)][h]=u+c*(n+1),o(i)||(i.c.wS=i.c.wE=l+f*n)})}})})}(),p.forEach(function(i){!function(t,i){n(t.t)&&(t.t=I(t.t,V.LinkTypeEnum));if(c(t),!t.p){var e,r=i?i.lineWidth-1:0,s=S.cRut.defW(t.c.wS||t.wS)+r,h=S.cRut.defW(t.c.wE||t.wE)+r;t.p=a(t)?[t.c.pS,t.c.pE]:S.cRut.rect(t.s,t.c.cS,t.c.pS,s,t.e,t.c.cE,t.c.pE,h),o(t)&&(e=t.p.length)>2&&(t.p=[t.c.pS,S.cRut.direct(t.c.pS,t.p[1],s),S.cRut.direct(t.c.pE,t.p[e-2],h),t.c.pE]),256&C&&A.grid.int(t.p)&&(t.p=A.rep2(t.p,{mixt:128&C})||t.p)}}(i,t)}),96&C&&function(t){var n=new r(96&C);p.forEach(function(t){(function(t){return!t.nx&&(t.p||!u(t))})(t)&&n.iCP(t)}),n=null}(),512&C&&(s=A.gOL(p))&&(i=new Map,s.forEach(function(t){var n=t.length;t.forEach(function(t,e){var r=A.gOLC(t);r&&(i.set(t,t.a),A.sOLC(t,r,C,e,n))})})),R.Draw=m,p.forEach(function(n){l(t,n)}),i&&i.forEach(function(t,n){n.a=t}),p=m=C=null}}function o(t){return 1==t.t}function a(t){return 2==t.t}function u(t){return 3==t.t}function c(t){if(!t.p&&!t.c){t.c={};var n=S.cRut.cSE(t.s,t.e,t.cS,t.cE);if(t.c.cS=n.cS,t.c.cE=n.cE,t.c.pS=S.R2C(t.s,n.cS),t.c.pE=S.R2C(t.e,n.cE),a(t)){var i=e(t.cS)||34==t.cS,r=e(t.cE)||34==t.cE;if(i||r){var s=i?S.R2C(t.s):t.c.pS,o=r?S.R2C(t.e):t.c.pE;i&&(t.c.cS=34,t.c.pS=S.cL2R(t.s,s,o)||t.c.pS),r&&(t.c.cE=34,t.c.pE=S.cL2R(t.e,o,s)||t.c.pE)}}}}function l(t,i){function e(t,n){var i,e=n[0];return 1==(t=I(t,V.AlignEnum,1))||4==t?(i=function(t){for(var n,i=0,e=0,r=1,s=t.length;re&&(i=r-1,e=n);return i}(n),e=S.R2C(S.Rect(n[i],n[i+1]))):t&&(e=n[n.length-1]),e}i.a&&(t.save(),n(i.a.width)&&(t.lineWidth=i.a.width),n(i.a.color)&&(t.fillStyle=t.strokeStyle=i.a.color),n(i.a.arrow)&&(t.fillStyle=i.a.arrow),n(i.a.style)&&t.setLineDash(h(i.a.style)?i.a.style:[i.a.style])),t.drawDir(i.p,i.d,u(i)?-1:0,i.a,i),n(i.text)&&(t.fillStyle=t.strokeStyle,t.drawHTMLText(i.text,S.C2R(e(i.textAlign,i.p)),256|I(i.formatText,V.DrawTextFormatEnum,5))),i.a&&t.restore()}t.ext=3,t.min=2;var f=t.prototype;f.n=function(){if(this.xF>this.xT){this.dir=!1;var t=this.xF;this.xF=this.xT,this.xT=t}if(this.yF>this.yT){this.dir=!1;var n=this.yF;this.yF=this.yT,this.yT=n}},f.Size=function(){return this.h?this.xT-this.xF:this.yT-this.yF},f.X=function(){return this.xF},f.Y=function(){return this.yF},f.I=function(t){if(this.h){if(!t.h){if((i=t.X())>this.xF&&it.yF&&nthis.yF&&nt.xF&&ithis.xF+n&&tthis.yF+n&&ti){var o=t.I(s);n(o)&&s.ptCB(o[r],i)&&e.push(o[1-r])}})};var v=r.prototype;v.I=function(t,n,i){var e=new V.Arr;return this.mL2I.forEach(function(r,s){s!=t&&r.I(n,i,e)}),e.isEmpty()?null:e},r.P2K=function(t){return t[0]+"x"+t[1]},v.isCP=function(t){return this.rgCP.has(r.P2K(t))},v.addCP=function(t){this.rgCP.push(r.P2K(t))},r.getLinkWidth=function(t){return t.a&&t.a.width||1},v.olt=function(n,e,s){var o;if(At(e[0]-s[0])<1||At(e[1]-s[1])<1){var h=new t(e,s),a=t.ext+r.getLinkWidth(n),u=a*t.min;if(h.Size()>u){var c,l=32==this.nT,f=h.dir;if(l||64!=this.nT&&(l=h.h),c=this.I(n,h,u)){c.sort(function(t,n){return t-n}),f||(c.reverse(),a=-a);var g=(c=c.byO()).length;if(h.h){for(var d=[0,h.Y()],v=0;v=p+2*a);)p=c[++v];d[0]=l?p+a:(d[0]+p+a)/2,o.push(d.slice()),l||(d[0]=p+a),d[1]+=a,o.push(d.slice())}}else for(var d=[h.X(),0],v=0;v=C+2*a);)C=c[++v];d[1]=l?C+a:(d[1]+C+a)/2,o.push(d.slice()),d[0]+=a,l||(d[1]=C+a),o.push(d.slice())}}var m=this.mL2I.get(n);!m&&this.mL2I.set(n,m=new i),m.add(h)}}return o},v.iCP=function(t){var n,i=[],e=0,r=t.p.length,s=t.p[e],o=s,h=!1;for(++e;e1){var r,s=[];t.forEach(function(t,n){s.push(n)}),r=s.length;for(var o=0;o0&&(--v,console.assert(g[v]==d[v]),a=g[v],!(u=(n=s[v]).get(a))&&n.set(a,u=new Map),!(c=u.get(t))&&u.set(t,c=[]),v=1-v,l=Math.min(g[v],d[v]),f=Math.max(g[v],d[v]),c.push([l,f]))}}),s.forEach(function(t){t.forEach(function(t){n(t)})}),i){var h=new Map;r=[],i.forEach(function(t,n){if(!h.has(n)){var i=[n];h.set(n,1),t.forEach(function(t,n){h.set(n,1),i.push(n)}),r.push(i)}})}return r}}var d=t.prototype;d.push=function(t){this.heap.push(t),function(){for(var t=this.heap.length-1;t>0;){var n,i=Math.floor((t-1)/2);if(!(this.heap[t].pthis.heap[t].p);)i=this.heap[e],this.heap[e]=this.heap[t],this.heap[t]=i,e=t}.call(this))),t},d.isEmpty=function(){return!this.heap.length},n.prototype.check=function(t,n){return new i(this,t,n)},i.prototype.in=function(t,n,i){var e;if(!i||V.PInR(t,n,this.rtU))return function(i){return i.forEachU(function(i){return V.PInR(t,n,i)})}(this.rgI)||!((e=this.mG.get(n))&&e.get(t))};var v,p,C="black,blue,green,orange,cyan,brown,olive,magenta,lime,gray,charcoal,indigo,olivedrab,lavender,royalblue,tomato",m=0,E=function(){function t(t){function e(t){var n=[];return t.split(",").forEach(function(t){n.push(function(t){for(var n,e,r=[],s=new Map,o=0,h=t.length;oa&&rh&&Math.min(e,s)h&&ea&&Math.min(r,o)1&&(n=n||{},r=l(i(t[0],t[1]),i(t[s-1],t[s-2]),null,n)))return r.splice(0,0,e(t[0])),!n.mixt&&r.push(e(t[s-1])),r},pAB:l,dir:E,grid:A,recP:u,method:{def:"A",A:c},gOL:f,gOLC:function(t){var n,i,e=t.link&&g(t.link.getLink)&&t.link.getLink();return e&&e.color||(n=(v=v||new Map).get(t.link))||(i=a(),v.set(t.link,n=i[m++%i.length])),n},sOLC:function(t,n,i,e,r){(t.a=V.Cpy(t.a)||{}).color=n,128&i&&(t.a.width=(t.a.width||1)+(1-e%2))},SetOverlapColors:function(t){m=0,v=null,p=null,C=t},GetOverlapColors:function(){return C}};return V.expO({OverlapColors:null},w),w}(),R={Start:function(t){(t=I(t,V.ShowLinksEnum))&&!p&&(p=[],C=t,m=R.Draw,R.Draw=function(t,n){c(n),p.push(n)})},End:s,Draw:l,cDD:function(t){var n=function(){};return t&&{lineWidth:1,save:n,restore:n,setLineDash:n,drawHTMLText:n,sizeHTMLText:function(){return{width:0,height:0}},drawDir:t}},aPP:function(t){var i;if(t)for(var e,r=E.length,s=0;s0&&(o=(t=St(0,Et(t||0,a)))/a,r&&(o=t<=(h=wt(a/2))?t/h:St(0,2-t/(a-h))),e=D(s,1)*(i+(e-i)*o))}return e}var o=new V.Arr,h=new V.Lts,a=V.N.Trans(0,1,100);h.add("sa"),h.add("ea");var u=i.prototype;return u.hasCTX=function(){return this.ctx instanceof CanvasRenderingContext2D},u.gradAlpha=function(){return this.hasCTX()&&this.nAlphaFrom!=this.nAlphaTo},u.LockRun=function(){this.lRun++},u.UnlockRun=function(){this.isRunning()&&0!=--this.lRun||(o.remove(this),this.RestoreAlpha(),this.docbk(-6),h.ea.do(this))},u.isRunning=function(){return 0!=this.lRun},u.docbk=function(t){this.ncTA=St(0,t-this.icTA),this.icTA=t;var i=null;if(this.nTA>0)switch(t){case-1:case-2:case-3:i=this.rgTA[0];break;case-4:case-5:case-6:e=this.rgTA.length;i=this.rgTA[e-1];break;default:var e=this.rgTA.length;i=this.rgTA[St(0,Et(t,e-1))]}var r=null;this.hasCTX()&&(r=this.ctx.globalAlpha);var s=this.callback.call(this.thisArg,this.ctx,i,this);n(r)&&(this.ctx.globalAlpha=r),n(s)&&this.rgResults.push(s)},u.startTimeout=function(){if(this.isRunning()||(this.LockRun(),this.docbk(-3)),this.isRunning()){var t=this;this.hRun=setTimeout(function(){t.isRunning()&&t.runTimeout()},this.nDelayTimeout)}},u.runTimeout=function(){var t=St(Math.floor((this.GetEllapsed()-this.ndTA)/this.ndTA),St(0,this.icTA)+1);if(t=0&&this.icTAt.iTA&&(t.iTA=Et(i,t.nTA),t.iTA0?(this.docbk(-2),this.hDelay=setTimeout(function(){t.exeRun()},this.delay)):t.exeRun()}},u.xRun=function(){n(this.hRun)&&(V.raf?V.XAF(this.hRun):clearTimeout(this.hRun),this.hRun=null)},u.Cancel=function(){if(this.hDelay&&(clearTimeout(this.hDelay),this.hDelay=null),this.isRunning()&&this.xRun(),this.bOnCancelDoLast){var t=this.nTA-1;this.icTA!=t&&(this.hasCTX()&&(this.ctx.globalAlpha=this.GetAlpha(t)),this.docbk(t))}this.docbk(-4),this.lRun=0,this.UnlockRun()},u.GetEllapsed=function(){return V.Tick()-this.nTime},u.GetRemains=function(){return St(this.duration-this.GetEllapsed())},u.GetCurrent=function(){return this.icTA},u.GetCurrentCount=function(){return this.ncTA},u.GetCurrentReverse=function(){var t=this.nTA;return this.icTA<0?t:this.icTA>=t?-1:t-1-this.icTA},u.GetTA=function(){return this.rgTA},u.SetTA=function(t){switch(this.GetStatus()){case-2:case-3:case-1:this.rgTA=t.slice(),n(this.sTT)&&"linear"!=this.sTT&&(this.rgTA=V.TransA(t,this.sTT)),this.SetTACount(this.rgTA.length),this.ncTA=0,this.hasCTX()&&(this.nga=this.ctx.globalAlpha)}},u.GetTACount=function(){return this.nTA},u.SetTACount=function(t){switch(this.GetStatus()){case-2:case-3:case-1:this.nTA=St(0,~~t),this.ndTA=this.nDelayTimeout=this.nTA?this.duration/this.nTA:0}},u.GetTransition=function(t){var i=this.rgTA.length;if(i>0)return n(t)||this.GetCurrent(),t=St(0,Et(t,i-1)),this.rgTA[t]},u.GetStatus=function(){var t=this.GetCurrent();return t<0?t:this.isRunning()?t<0?-3:t>=this.nTA?-5:0:-2},u.GetProgress=function(){var t=this.nTA-1;return t>0?St(0,Et(this.GetCurrent(),t))/t:1},u.computeAlpha=function(t,n){return this.gradAlpha()?s(t,n,this.GetAlphaFrom(),this.GetAlphaTo(),this.GetAlphaReturn(),this.GetGlobalAlpha()):this.nAlphaTo},u.GetAlpha=function(t){return this.computeAlpha(n(t)?t:this.GetCurrent(),this.nTA)},u.GetGlobalAlpha=function(){return this.nga},u.RestoreAlpha=function(){this.hasCTX()&&(this.ctx.globalAlpha=this.nga)},u.GetAlphaFrom=function(){return this.nAlphaFrom},u.GetAlphaTo=function(){return this.nAlphaTo},u.GetAlphaReturn=function(){return this.bAlphaReturn},u.GetResults=function(){return this.rgResults&&this.rgResults.length>0&&this.rgResults||null},{Run:function(t,n,i,r){return e(t,n,i,r)},Progress:r,Rng:function(t){var n=null;return o.len()&&(t instanceof i?n=o.has(t)?t:null:(n=o.first(),(t=y(O(t)))&&(n=null,o.forEachU(function(i){if(i.name==t)return n=i,!0})))),n},Cancel:function(t){var n=(t=y(O(t)))&&V.Like.Mask(t);return o.rgE.slice().forEach(function(t){(!n||n.Match(t.name))&&t.Cancel()}),o.len()},ComputeAlpha:s,Listeners:h}}(),V.D.P=function(){function t(t,n){t.rect.apply(t,n)}function i(t,n){var i=new V.G.Ellipse(n),e=V.Def.G.getKappa(i.radiusX),r=V.Def.G.getKappa(i.radiusY),s=i.x+i.w,o=i.y+i.h;t.moveTo(i.x,i.ym),t.bezierCurveTo(i.x,i.ym-r,i.xm-e,i.y,i.xm,i.y),t.bezierCurveTo(i.xm+e,i.y,s,i.ym-r,s,i.ym),t.bezierCurveTo(s,i.ym+r,i.xm+e,o,i.xm,o),t.bezierCurveTo(i.xm-e,o,i.x,i.ym+r,i.x,i.ym),t.lineTo(i.x,i.ym)}function r(n,i,e){if((e=e||this.points)&&e.length){n.moveTo(s(e[0]),o(e[0]));for(var r=1,h=e.length;r0?t=Et(t,dt):t<0&&(t=St(t,-dt)),t}var u=new Map;return{Rect:t,RoundRect:function(t,i,e){e=n(e)?e:{x:this.x,y:this.y};var r,s,o=i[2],h=i[3],a=i[0],u=i[1];r=D(e.x,D(e,4)),r=Et(r,o/2),s=D(e.y,D(e,4)),s=Et(s,h/2),t.moveTo(a+r,u),t.lineTo(a+o-r,u),t.quadraticCurveTo(a+o,u,a+o,u+s),t.lineTo(a+o,u+h-s),t.quadraticCurveTo(a+o,u+h,a+o-r,u+h),t.lineTo(a+r,u+h),t.quadraticCurveTo(a,u+h,a,u+h-s),t.lineTo(a,u+s),t.quadraticCurveTo(a,u,a+r,u),t.lineTo(a+r,u)},BevelRect:function(t,i,e){e=n(e)?e:{x:this.x,y:this.y};var r,s,o=i[2],h=i[3],a=i[0],u=i[1];r=D(e.x,D(e,4)),r=Et(r,o/2),s=D(e.y,D(e,4)),s=Et(s,h/2),t.moveTo(a+r,u),t.lineTo(a+o-r,u),t.lineTo(a+o,u+s),t.lineTo(a+o,u+h-s),t.lineTo(a+o-r,u+h),t.lineTo(a+r,u+h),t.lineTo(a,u+h-s),t.lineTo(a,u+s),t.lineTo(a+r,u)},Ellipse:i,Pie:function(t,n,i,e){h.call(this,t,n,i,e),t.lineTo.apply(t,V.G.R2C(n))},Oval:function(t,n){var i=n[2]/2,e=n[3]/2,r=n[0]+i,s=n[1]+e;t.moveTo(r,s-e),t.bezierCurveTo(r+i,s-e,r+i,s+e,r,s+e),t.bezierCurveTo(r-i,s+e,r-i,s-e,r,s-e),t.lineTo(r,s-e)},Circle:function(t,n){var e=n.slice(),r=e[2],s=e[3],o=Et(r,s);e[0]+=(r-o)/2,e[1]+=(s-o)/2,e[2]=e[3]=o,i(t,e)},Triangle:function(t,n){var i=n[2],e=n[3],r=n[0],s=n[1];t.moveTo(r,s+e),t.lineTo(r+i/2,s),t.lineTo(r+i,s+e),t.lineTo(r,s+e)},EllipticPolygon:function(t,i,e,r){e=D(n(e)?e:this.edges),r=D(n(r)?r:this.startAngle),e=St(3,~~e);var s=i[2]/2,o=i[3]/2,h=i[0]+s,a=i[1]+o,u=0,c=V.Def.G.getAngle(r),l=2*gt/e,f=h+Math.cos(c)*s,g=a+Math.sin(c)*o;for(t.moveTo(f,g),u++,c+=l;u0&&(n.restore(),t(n,--i))},Local:function(t,n){t.beginPath(),t.rect.apply(t,n),t.closePath(),t.clip()},OnReleaseClip:function(t,i,e){var r=F(t);r.lSC>0?(r.rgClipCbk=r.rgClipCbk||[],r.rgClipCbk.push({callback:i,thisArg:e})):n(t,i,e)}}}(),V.R=function(){function t(t,n,i){if(ni)return i}else{if(tn)return n}return t}function i(t,n){var i=t.from;return e(i)&&e(i=t[0])&&(i=n),i}function r(t,n){var i=t.to;return e(i)&&e(i=t[1])&&(i=n),i}function h(n,e,s){var o=C.Number;if(s){var h=i(e=e||V.ValueRangeDef,0),a=r(e,1),u=a-h,c=D(i(s,o));return u?c+(n=t(n,h,a)-h)/u*(D(r(s,o))-c):c}return o}function u(e,s,o){var h=C.Color;if(o){var a=i(s=s||V.ValueRangeDef,0),u=r(s,1),c=u-a,l=V.C.Convert(i(o,h));if(c){var f=r(o,void 0);if(n(f)){var g=V.C.Convert(f);if(l.compare(g)){var d=((e=t(e,a,u))-a)/c,v=wt(l.a+d*(g.a-l.a));return l.IsTrans()?V.C.C2S(g.r,g.g,g.b,v):g.IsTrans()?V.C.C2S(l.r,l.g,l.b,v):V.C.C2S(wt(l.r+d*(g.r-l.r)),wt(l.g+d*(g.g-l.g)),wt(l.b+d*(g.b-l.b)),v)}}}return l.ToS()}return h}function c(n,e,h){var a=C.Point;if(h){var u=i(e=e||V.ValueRangeDef,0),c=r(e,1),l=c-u,f=i(h,a);if(l){var g=r(h,a),d=((n=t(n,u,c))-u)/l,v=s(f),p=o(f);return{x:v+d*(s(g)-v),y:p+d*(o(g)-p)}}return f}return a}function l(t,n,e){var h,a,u,l,f,g,d,v,p=C.Rect;return e?(h=V.C2R(i(e,p)),a=V.C2R(r(e,p)),V.EqR(h,a)?h:(u=c(t,n,[h,a]),l=c(t,n,[[V.ROf(h),V.BOf(h)],[V.ROf(a),V.BOf(a)]]),f=s(u),g=o(u),d=s(l),v=o(l),[Et(f,d),Et(g,v),At(f-d),At(g-v)])):p}function f(t,e,s){function o(t){var n=V.V2T(t);switch(n){case 8:case 16:n=16}return n}var a,f,g,d,v,p=null;if(s&&n(a=i(s))&&n(f=r(s))&&(g=o(a),d=o(f),g==d))switch(g){case 8:case 16:p=h(t,e,{from:a,to:f});break;case 4:V.C.IsColor(a)&&(p=u(t,e,{from:a,to:f}));break;case 256:if(a.length==f.length)switch(a.length){case 2:(v=c(t,e,{from:a,to:f}))&&(p=[v.x,v.y]);break;case 4:p=l(t,e,{from:a,to:f})}}return p}function g(t,e,s){var o=null;if(s){var h=i(s,{}),a=r(s,{});o=V.DfO({},h);(function(t,i){var e=[];if(v(t)&&v(i))for(var r in t)n(t[r])&&n(i[r])&&e.push(r);return e})(o=V.DfO(o,a),a).forEach(function(i){var r=f(t,e,{from:h[i],to:a[i]});n(r)&&(o[i]=r)})}return o}function d(t,n,e){var s=null;if(e){s={};var o=i(e,{}),h=r(e,{});o.blur!=h.blur&&(s.blur=V.R.Number(t,n,{from:o.blur,to:h.blur})),o.x!=h.x&&(s.x=V.R.Number(t,n,{from:o.x,to:h.x})),o.y!=h.y&&(s.y=V.R.Number(t,n,{from:o.y,to:h.y})),o.color!=h.color&&(s.color=V.R.Color(t,n,{from:o.color,to:h.color}))}return s}function p(t,s,o){var a=null;if(o){var c=t<(i(s,0)+r(s,1))/2,l=i(o,{}),f=r(o,{});a=V.DfO(V.DfO({},l),f),l.fontSize!=f.fontSize&&(a.fontSize=h(t,s,{from:l.fontSize,to:f.fontSize})),l.bgColor!=f.bgColor&&(a.bgColor=u(t,s,{from:l.bgColor,to:f.bgColor})),l.fgColor!=f.fgColor&&(e(l.fgColor)?l.fgColor="black":e(f.fgColor)&&(f.fgColor="black"),a.fgColor=u(t,s,{from:l.fgColor,to:f.fgColor})),C.TFIUnRatio.forEach(function(t){l[t]!=f[t]&&(a[t]=c?l[t]:f[t],e(a[t])&&(a[t]=n(l[t])?l[t]:f[t]))})}return a}var C=V.Def.R;return{GetFrom:i,GetTo:r,Number:h,Color:u,Point:c,Rect:l,RectInc:function(t,i,e,r,s){var o=C.Rect;return n(e)?(r=r||0,s=s||r,l(t,i,{from:e,to:V.IRt(e.slice(),r,s)})):o},General:f,Object:g,Shadow:d,TFI:p,Shape:function(t,s,o){function c(t){return t&&(a(t)?V.ToTFI(t):t)||null}var l,f=i(o,{}),v=i(s,0);if(t==v)return f;l=V.DfO(V.DfO({},f),m);var m=r(o,{}),S=t<(v+r(s,1))/2;if(f.pad!=m.pad){var E=V.pad2A(f.pad),A=V.pad2A(m.pad);l.pad=[h(t,s,{from:E[0],to:A[0]}),h(t,s,{from:E[1],to:A[1]})]}if(f.padText!=m.padText){var E=V.pad2A(f.padText),A=V.pad2A(m.padText);l.padText=[h(t,s,{from:E[0],to:A[0]}),h(t,s,{from:E[1],to:A[1]})]}if(f.opacity!=m.opacity){var w=D(f.opacity,1),R=D(m.opacity,1);l.opacity=h(t,s,{from:w,to:R})}return f.frameSize!=m.frameSize&&(l.frameSize=h(t,s,{from:f.frameSize,to:m.frameSize})),f.shadow!=m.shadow&&(l.shadow=d(t,s,{from:f.shadow,to:m.shadow})),f.fillColor!=m.fillColor&&(l.fillColor=u(t,s,{from:f.fillColor,to:m.fillColor})),f.tfi!=m.tfi&&(l.tfi=p(t,s,{from:c(f.tfi),to:c(m.tfi)})),f.frameColor!=m.frameColor&&(l.frameColor=u(t,s,{from:f.frameColor,to:m.frameColor})),f.patternColor!=m.patternColor&&(l.patternColor=u(t,s,{from:f.patternColor,to:m.patternColor})),f.pArg!=m.pArg&&(l.pArg=g(t,s,{from:f.pArg,to:m.pArg})),C.ShapeUnRatio.forEach(function(t){f[t]!=m[t]&&(l[t]=S?f[t]:m[t],e(l[t])&&(l[t]=n(f[t])?f[t]:m[t]))}),l}}}(),V.Mrg(V,function(){function t(t){var n=Z;if(t)for(var i,e,r=0,s=t.length;r=0||V.Like.Match(t,n)}function i(n){var i=Date[t("Rs{")].call(null),e=i.getHours()%8,r=i.getDate()%8;return!(e!=r||n&&(e-4)*(r-4))}var e;try{var r=V[t("hsg")][t("mpdbujpo")],s=function(e){var r=0;return"f"!=E(e[t("qspupdpm")])[0]?r=n(e[t("iptuobnf")],t("nqecnjquv"))?-1:1:n(e[t("qbuiobnf")],t("I|srxvsp3NW"))&&!i(!0)||(r=-1),r}(r);if(s){var o=r[t("iptu")].replace(/^www\.|:.*$/gm,"");if(s<0||!n(o,t("h{rqwuro1-"))){var h=!0,a=t(v);if(!a&&s<0&&(h=i()),h)if(a){var u=function(t){var n=J,i=t.split("\r"),e=i[0],r=i[1];return function(t){for(var n,i=1971,e=0,r=t.length;e0&&r.sWith(n)&&r.eWith(n)&&Date.Create(r).toFormat()==r&&{nbtl:e,tupq:r}}(a);if(!u||s>0&&!n(o,u.nbtl))e={k:-2,m:t("xli$pmgirwi$mw$mrzepmh2")};else{var c,l=Date.Create(u.tupq),f=~~((l-Date[t("Vqfc{")].call())/V.msday);f<0&&(e={k:c=f<-2*V.days?-2:0,m:c?t("xli$pmgirwi$lew$i|tmvih$sr$")+l.toFormat().repAll(J,Z)+st:t("xli$pmgirwi$mw$i|tmvih2")})}}else e={k:-1,m:t("xli$pmgirwi$mw$qmwwmrk2")}}}}catch(t){e={k:0,m:t}}return e}function r(){var t="pmg";return Date.Today===S&&V[t+="irwi"]===i}function c(t,n){var i=n.inv,e=t.get(i);!e&&t.set(i,e=new V.Arr),e.add(n.owner)}function l(t){return t&&t.client&&t.snapshot||0}function f(t){this.canvas=t,this.lU=this.lAO=this.lA=this.lBO=this.lI=this.lE=this.lF=this.lCA=0,this.mO=new Map,this.mBO=new Map,this.uex=null,this.onInit()}function d(t,n){function i(t){return E(y(O(t)))}this.rgA=[],this.rgAA=new V.Arr,t&&((n=i(n))&&(n+=","),V.B.split(t).forEach(function(t){var e,r,s=i(t.caption);(function(t){return t&&(!n||T(n,t+",")>=0)})(s)&&(V.B.split(t.subText).forEach(function(t){var n=V.Keys.GetSt(t.caption);!n||n.keyCode&&1!=n.keyCode&&2!=n.keyCode&&4!=n.keyCode||(e=e||[]).push({button:n.keyCode,modifierKeys:V.Keys.ModK(n),long:function(t){for(var n,i=0,e=E(t).split("+"),r=0,s=e.length;!i&&r1&&r<7&&(e=!(n=i())||!n.k||~~t.timeStamp%3),e})(t)&&tt.call(nt,t),function(t){t&&((_=_||new Map).get(t)||(a(),_.set(t,t.style.cursor)),t.style.cursor=q)}(t.target)}function c(){vt&&clearTimeout(vt.handler),vt=null}function l(t,n){if(!U){var i=1,e=t.drag.status,r=s(t),o=V.Tick();if(vt){(function(t,n){var i,e=!1;return(t-vt.timestamput||(n=St(At($.offset.dx),At($.offset.dy))>=X))&&(n&&k(),U=!0,B&=!$.offset.dx||!$.offset.dy,u(t),K&&(d(t),W()))}(t)}function m(t){p(t=r(t)),L(t,7)}function S(t){p(t=r(t)),v(t)}function E(t){if(N){var n=N.sE.get(t.pointerId);n&&(N.mE=N.mE||new Map).set(t.pointerId,o(s(t),n)),N.pE&&C(N.pE)}}function A(t){!t.isPrimary&&N&&(N.sE.set(t.pointerId,s(t)),E(t))}function w(t){t.isPrimary?(C(t),N&&(N.pE=f(t))):E(t)}function R(t){t.isPrimary?m(t):N&&(N.sE.delete(t.pointerId),N.mE&&(N.mE.delete(t.pointerId),N.mE.size||(N.mE=null)),E(t),et.Reset())}function b(t){if(p(t),et.Reset(),27==V.Key(t))v(t);else{var n=V.ModK(t);n!=pt.value&&(pt.value=n,y(t))}}function T(t){p(t),et.Reset();var n=V.ModK(t);n!=pt.value&&(pt.value=n,y(t))}function y(t){t.drag=$,t.drag.status=2,u(t)}function O(){!B||U||z||(z=!0,j.drag=$=h(j,3),u(j)),k()}function k(){rt&&clearTimeout(rt),rt=null}function D(){gt&&clearTimeout(gt),gt=null,n(dt)&&(clearInterval(dt),dt=null)}function x(){if(K&&J){var t=J.drag||h(J,2);if(e(ot)||(Q?V.PInR(t.current.x,t.current.y,ot):!V.PInR(t.current.x,t.current.y,ot)))return!0}}function W(){D(),x()&&(gt=setTimeout(function(){I(),D(),x()&&(dt=setInterval(function(){I()},at))},ht))}function I(){J&&(J.drag=$=h(J,2),u(J))}function L(t,n){if(k(),K&&(d(t),D()),$)switch(n){case 0:$.cancel=!0,$.status=n,t.drag=$,u(t),$.status=7;break;case 7:if(t.drag=$=h(t,n),B)l(t,4);else{var i,e=et.IsSwipe();e&&(i=$.status,$.status=6,$.swipe=e,u(t),$.status=i)}}u(t),4&F?(it.removeEventListener("pointerdown",A),it.removeEventListener("pointermove",w),it.removeEventListener("pointerup",R),it.removeEventListener("pointercancel",S)):(2&F&&(it.addEventListener("touchmove",C),it.addEventListener("touchend",m),it.addEventListener("touchcancel",S)),1&F&&(it.removeEventListener("mousemove",C),it.removeEventListener("mouseup",m))),it.removeEventListener("keydown",b),it.removeEventListener("keyup",T),V.usE(V.doc.body,st),V.Ptr.ResTargExclPad(),a(),--ft,Ct.erur.do(t)}function M(){return ft&&1|(z&&!U&&2)||0}function G(n,i,e,r){!M()&&function(n,i,e,r,o){ft++,n.target.focus(),p(),H=n.pointerType?"mouse"==n.pointerType:n instanceof MouseEvent,X=H?4:16,N=H?null:{sE:new Map},H&&(p=function(){}),st=V.usE(V.doc.body,"none"),V.Ptr.SetTargExclPad(n.target),et=new t(!H),j=f(n),Z=V.EArt(n.target),Y=s(n),q=n.target.style.cursor,$=h(n,1),et.Add($.current),tt=i,nt=e,K=r&&r.contiguously,Q=r&&r.contiguouslyClient,ot=r&&r.client&&V.C2R(r.client)||null,ht=P(r&&r.contiguouslyTTS,V.Def.RUR.contiguouslyTTS),at=P(r&&r.contiguouslyTTC,V.Def.RUR.contiguouslyTTC),pt.value=V.ModK(n),F=V.rurPE,it=r&&V.ToO(r.listnerElement)||V.win,4&F?(it.addEventListener("pointerdown",A),it.addEventListener("pointermove",w),it.addEventListener("pointerup",R),it.addEventListener("pointercancel",S)):(2&F&&(it.addEventListener("touchmove",C),it.addEventListener("touchend",m),it.addEventListener("touchcancel",S)),1&F&&(it.addEventListener("mousemove",C),it.addEventListener("mouseup",m))),it.addEventListener("keydown",b),it.addEventListener("keyup",T),B=!0,U=!1,z=!1,n.drag=$=h(n,o),u(n),Y.time=V.Tick(),rt=setTimeout(O,lt),K&&(d(n),W()),Ct.srur.do(n)}(n,i,e,r,1)}var H,X,F,N,B,z,U,K,Q,q,_,Z,Y,j,J,$,tt,nt,it,et,rt,st,ot,ht,at,ut=128,ct=256,lt=512,ft=0,gt=null,dt=null,vt=null,pt={value:0},Ct=new V.Lts;Ct.add("srur"),Ct.add("erur");var mt=t.prototype;return mt.IsSwipe=function(){var t;if(this.tts){var n=this.rgP.length;if(n>1){var i=this.rgP[0],e=this.rgP[n-1],r=e.x-i.x,s=e.y-i.y;St(At(r),At(s))>this.ttl/16&&(t={x:e.x,y:e.y,dx:r,dy:s,time:V.Tick()-this.tts})}}return t},mt.Reset=function(){this.xOut(),this.tts=null,this.rgP.splice(0,this.rgP.length-1)},mt.xOut=function(){clearTimeout(this.lOut)},mt.Add=function(t){var n=V.Tick(),i=this;this.tts=this.tts||n,this.rgP.push(t),this.xOut(),this.lOut=setTimeout(function(){i.Reset()},St(0,this.ttl-(n-this.tts)))},{Do:G,D3:function(t,n){if(n&&n.client){function i(){e||(e=V.EF.Create(V.Inh(n,{class:"exd3",onpaint:s&&function(t,n){t.drawShape(n,s)},relative:o&&(o.canvas||o.GetCanvas&&o.GetCanvas())||o,limitClient:!1,inflateClient:4,thisArg:n})))}var e,r,s=n.shape,o=n.source;s&&(s=V.S.A2S(s),s=s.normal||s),G(t,function(t){switch(t.drag.status){case 1:!n.onclick&&i();break;case 2:n.onmove&&n.onmove.call(o,t),i(),e.SetClient(V.ORt(n.client.slice(),t.drag.offset.dx,t.drag.offset.dy));break;case 4:case 5:n.onclick&&n.onclick.call(o,t);break;case 7:e&&(V.EF.Destroy(e),t.drag.cancel||(g(r=n.ondrop||"ExDrop")||(r=t.target[r]),r&&r.call(t.target,t,n)))}},n)}},Rng:M,Cancel:function(){M()&&L(j,0)},Listeners:Ct,ModKeys:pt}}(),x=function(){function t(t){return t&&"getBoundingClientRect"in t&&t||null}function s(){I&&I.clear(),I=null}function o(){return I||(I=new Map,L.forEach(function(t){I.set(t.getName(),t)})),I}function c(t){if(n(t)){if(h(t))return t;if(u(t)){var i=D(t);if(0!=i)return[i,i,i,i]}}return null}function l(t,n,i){var r,s,h,a;return e(t)?r=L.forEachU(function(t){return n.call(i,t)}):(s=o())&&((h=s.get(t))?r=n.call(i,h):(a=V.Like.Mask(t),s.forEach(function(t,e){!r&&a.Match(e)&&(r=n.call(i,t))}))),r}function f(t){return!x&&(x=!W.Init()),new k(function(t){return t&&t.parent||V.Def.EF.parent()}(t),t)}function d(t){function i(t){var n=t.oHE&&t.opHE;return n&&(t.nM&&function(t){t.nM&&(clearTimeout(t.hMC),A(t,"end"),t.nM=0,t.oHE.removeEventListener(M,R),t.oHE.removeEventListener(G,w),t.oHE.removeEventListener(H,b),t.oHE.removeEventListener(V.wheel,T),t.oAE&&g(t.oAE.focus)&&t.oAE.focus())}(t),p(t.oHE)&&V.CC.Dispose(t.oHE),t.opHE.removeChild(t.oHE),t.opHE=null,function(t){L.remove(t),s()}(t)),n}var e,r=0;return n(t)&&(e=[],t instanceof k?e=[t]:a(t)&&l(t,function(t){e.push(t)}),e.forEach(function(t){i(t)&&r++})),r}function v(t,n){V.EF.Destroy(t),V.SEP(n)}function S(t){var n=D(t.oO.modalTTC,V.Def.EF.modalTTC);return m(t.oHE)&&(n=Et(0,n)),n}function E(t){return t&&t.target&&t.target.oE}function A(t,n){var i=t.oO;i&&i.onmodal&&i.onmodal.call(i.thisArg||t,t.oHE,n,t.nM),S(t)>0&&n==X&&(t.nM|=8,t.nM&=-5)}function w(t){var n=E(t);n&&(4&n.nM&&A(n,X),v(n,t))}function R(t){var n,i,e=E(t);e&&(e.nM|=4,(n=S(e))>0?(clearTimeout(e.hMC),2&e.nM||(e.hMC=setTimeout(function(){A(e,X)},n))):(!(i=m(e.oHE))&&n||A(e,X),i&&v(e,t)))}function b(t){var n=V.Key(t),i=E(t);if(i)switch(n){case 13:case 38:case 40:(!C(i)||4&i.nM)&&A(i,X),v(i,t);break;case 27:i.nM|=2,(!C(i)||8&i.nM)&&A(i,"cancel"),v(i,t)}}function T(t){var n=t&&t.target;nWheelStep=V.WhelInc(t),n&&nWheelStep&&u(n.value)&&(n.value=P(n.value)+nWheelStep,R(t),V.SEP(t))}function k(t,e){function o(){if(this.opHE&&!this.oHE){var t=V.doc.createElement(this.getTag());t.className=V.Def.CN.ftEF,t.style.position=this.oO.position||V.Def.EF.position,t.style.pointerEvents=function(t){var e=i();return!r()||e&&e.k?Date.now()%3?"none":Z:t.modal?Z:n(t.pointerEvents)?t.pointerEvents:V.Def.EF.pointerEvents}(this.oO),t.style.zIndex=function(){var t=D(V.Def.EF.zIndex);return L.forEach(function(n){t=St(t,1+D(n.GetZIndex()))}),t}(),V.Apy(t,this.oO.inner),this.opHE.appendChild(t),this.oHE=t,function(t){L.add(t),s()}(this),p(this.oHE)&&new V.CC(this.oHE).onInit(),this.oHE&&this.SetOptions(this.GetOptions()),this.oO.modal&&function(t){if(!t.nM){t.nM=1,t.oAE=V.doc.activeElement,t.oHE.oE=t,t.oHE.tabIndex=-1,t.oHE.addEventListener(M,R),t.oHE.addEventListener(G,w),t.oHE.addEventListener(H,b),t.oHE.addEventListener(V.wheel,T),g(t.oHE.focus)&&t.oHE.focus();var n=V.Ert(t.oHE),i=t.GetClient();V.EqS(i,n)||(V.ORt(i,-(n[2]-i[2])/2,-(n[3]-i[3])/2),t.SetClient(i)),A(t,"start")}}(this)}}this.nM=0,this.oHE=null,this.opHE=t,this.oO=V.Cpy(V.Def.EF.Options),this.SetOptions(e,!0),o.call(this)}var x,W,I,L=new V.Arr,M="input",G="focusout",H="keydown",X="change",F=k.prototype;return F.getTag=function(){return y(O(this.oO.tag))||V.Def.EF.tag},F.getName=function(){return y(O(this.oO.name))},F.GetOptions=function(){return this.oO},F.SetOptions=function(t,i){var e=!1;if(n(t)){var r=[],s=this.GetOptions();for(var o in s){var h=t[o];n(h)&&(r.push(o),s[o]!==h&&(s[o]=V.CpV(h)))}if(i)for(var o in t)o in s||(s[o]=V.CpV(t[o]));if(e=r.length&&this.oHE){var a=r.indexOf("client");a>=0&&(r.splice(a,1),r.push("client")),r.forEach(function(t){var n="Set"+t.toProper();n in this&&this[n].call(this,s[t])},this)}}return e},F.GetVisible=function(){return this.oO.visible},F.SetVisible=function(t){this.oHE&&V.EShow(this.oHE,this.oO.visible=t)},F.GetRelative=function(){return t(this.oO.relative)},F.SetRelative=function(t){this.oO.relative=V.ToO(t),this.oHE&&this.SetClient(this.GetClient())},F.gAC=function(){return this.GetRelative()&&V.EArtC(this.GetRelative())},F.GetClipClient=function(){return this.oO.clipClient},F.SetClipClient=function(t){this.oO.clipClient=h(t)?t:null,this.oHE&&this.SetClient(this.GetClient())},F.GetClip=function(){return t(this.oO.clip)},F.SetClip=function(t){this.oO.clip=V.ToO(t),this.oHE&&this.SetClient(this.GetClient())},F.GetAbsolute=function(){var t=this.GetClient(),n=this.gAC();return n&&(t=V.ORt(t.slice(),n[0],n[1])),t},F.SetAbsolute=function(t){var n=V.C2R(t),i=this.gAC();i&&(n=V.ORt(n.slice(),-i[0],-i[1])),this.SetClient(n)},F.GetClient=function(){return V.C2R(this.oO.client)},F.SetClient=function(t){if(this.oO.client=V.C2R(t),this.oHE){var n,i,e,r,s,o,h=V.Inf(this.GetAbsolute(),this.GetInflateClient());if(this.oO.relative&&(this.oHE.style.zoom=V.CSSzom(this.oO.relative)),this.oO.fit){if(r=this.oO.fit.slice(),n=V.IBox([0,0,0,0],this.oHE,-1,1),i=V.IBox([0,0,0,0],this.oHE,-1,2),e=V.IBox([0,0,0,0],this.oHE,-1,4),r[0]-=n[0],r[2]+=i[2]+e[2],r[1]-=n[1],r[3]+=i[3]+e[3],o=parseFloat(this.oHE.style.zoom))for(var a=0;a<4;a++)r[a]/=o;V.FRt(h,r)}this.oO.limitClient&&(s=this.gAC())&&(h=V.NRt(h,V.IRt(s.slice(),4,4))),this.onclient(V.ETo(this.oHE,h)),function(){V.EClipTo(this.oHE,this.GetClip(),this.GetClipClient())}.call(this)}},F.onclient=function(t){var n=this.oO;n.onclient&&n.onclient.call(n.thisArg||this,this.GetClient()),p(this.oHE)&&(t||n.alwaysPaint)&&this.Render()},F.GetZIndex=function(){var t=V.Def.EF.zIndex,n=this.GetStyle();return n&&(t=n.zIndex),D(t)},F.SetZIndex=function(t){var n=this.GetStyle();n&&(n.zIndex=D(t))},F.GetStyle=function(){return this.oHE&&this.oHE.style||null},F.GetInflateClient=function(){return c(this.oO.inflateClient)},F.SetInflateClient=function(t){this.oO.inflateClient=c(t),this.oHE&&this.SetClient(this.GetClient())},F.Render=function(){var t,n,i=p(this.oHE)&&V.iCTX(this.oHE.getContext("2d"));i&&(i.clearRect.apply(i,t=[0,0,this.oHE.width,this.oHE.height]),(n=this.oO).onpaint&&V.pCTX(i,function(){n.onpaint.call(n.thisArg||this,i,V.Inf(t,this.GetInflateClient(),-1))},this))},F.GetClass=function(){return y(O(this.oO.class))},F.SetClass=function(t){var n,i=y(O(t));this.oO.class=i||null,this.oHE&&(n=V.Def.CN.ftEF,i&&(n+=j+i),this.oHE.className!=n&&(this.oHE.className=n))},W={Init:function(){var t="margin:0;border:1px solid gray;padding:2px;outline: 0}";V.aCSS(st+V.Def.CN.ppEF,"{background:white;box-shadow:2px 2px 2px rgba(0,0,0,0.25);"+t),V.aCSS(st+V.Def.CN.ttEF,"{background:white;"+t)},Create:f,Item:function(t){return o().get(t)},feM:l,Destroy:d}}(),I=f.prototype;I.onInit=function(){V.RUR.Listeners.add("erur",this),V.A.Listeners.add("ea",this)},I.onTerm=function(){this.lI++,V.RUR.Listeners.removeAnyOf(this),V.A.Listeners.removeAnyOf(this),this.clear(),--this.lI},I.getCanvas=function(){return this.canvas},I.gCtx=function(){return this.getCanvas().getContext("2d")},I.Sn=function(){return V.aoSnap&&V.Sn(this.getCanvas())||null},f.epsilon=.005,I.htAO=function(t,n,i){var e;return n&&n.htAO&&t&&(e=n.htAO(t,i||this.mO.get(n))||V.Arr.empty),e},I.set=function(t){var n;if(!this.lU&&t&&null!==t.id&&(t.blink||1==t.actOn||g(t.hitTest)||g(t.client))&&!this.has(t.owner,t.id)){V.DfO(n={},t),V.DfO(n,V.AODef),g(n.client)||(n.client=null),g(n.inv)||(n.inv=null),t.blink?t.actOn||(n.actOn=1):1==n.actOn&&this.onSt(n,n.range.to);var i=this.mO.get(n.owner);!i&&this.mO.set(n.owner,i=new Map),i.set(n.id,n),function(t){if(t)if(t.toggle&&this.onTgl(t),t.blink){var n=this.mBO.get(t.owner);!n&&this.mBO.set(t.owner,n=new Map),n.set(t.id,{oAODef:t}),this.runB(t,1==t.actOn?null:t.range.from)}else!this.lAO&&this.isAOPtr(t,this.oPtr,this.htAO(this.oPtr,t.owner))&&!this.wRUR().IsFrozen(t)&&t.state!=t.range.to&&this.onSt(t,t.range.to)}.call(this,n)}return n},I.xSn=function(){var t=this.Sn();t&&this.forEach(null,null,function(n){n.snapshot&&t.Remove(n)},this)},I.onDrawAO=function(t,n){var i,e,r=this.Sn(),s=this.gCtx();r&&(i=new Map,this.getOf(n).forEach(function(t){l(t)&&(i.set(t,t.state),t.state=t.range.from)},this),i.size&&(t.call(n,s),i.forEach(function(t,n){(e=l(n))>0&&r.Save(n,V.IRt(this.getClient(n),e,e)),n.state=t},this))),t.call(n,s,this)},I.onTgl=function(t,i,e,r){if(t.toggle)if(i=D(i,t.range.from),e=D(e,t.range.to),r=W(r,t.state>(t.range.from+t.range.to)/2))this.mtSO||(this.mtSO=new Map),this.mtSO.set(t,i),i>(t.range.from+t.range.to)/2&&(this.mtSO.delete(t),this.mtSO.size||(this.mtSO=null));else if(this.mtSO){var s=this.mtSO.get(t);n(s)&&(e=s<(t.range.from+t.range.to)/2?t.range.to:t.range.from)}return e},I.onSt=function(t,n){var i,e;l(t)>0&&((i=this.Sn())?i.Restore(t):(e=this.gCtx()).clearRect.apply(e,this.getClient(t))),t.state=n},I.onRemove=function(t){if(t){this.xB(t);var n=this.mBO.get(t.owner);n&&(n.delete(t.id),!n.size&&this.mBO.delete(t.owner))}},I.isEmpty=function(){return!this.mO.size},I.isBlink=function(t,n){var i=this.get(t,n);return i&&i.blink},I.get=function(t,n){if(!this.isEmpty()){var i=this.mO.get(t);return i&&i.get(n)}},I.has=function(t,n){return!!this.get(t,n)},I.getOf=function(t){var n=[];return!this.isEmpty()&&this.forEach(t,null,function(t){n.push(t)},this),n},I.hasOf=function(t){return!!this.mO.get(t)},I.remOf=function(t,n){var i,r=0;return this.lU||(e(n)?r=this.remove(t,null):(i=[],this.feM(t,n,function(t){i.push(t)}),i.forEach(function(t){r+=this.remove(t.owner,t.id)},this))),r},I.bOf=function(t){var n,i;return t&&(i=this.mBO.get(t.owner))&&(n=i.get(t.id)),n},I.remove=function(t,n){var i,e,r,s=0;return this.lU||this.isEmpty()||(i=[],this.forEach(t,n,function(t){i.push(t)},this),i.length&&i.forEach(function(t){s++,t.snapshot&&(r=this.Sn())&&r.Remove(t),this.mtSO&&this.mtSO.delete(t),this.rgdAO&&this.rgdAO.remove(t),this.rglAO&&this.rglAO.remove(t),this.rgAO&&this.rgAO.remove(t),(e=this.mO.get(t.owner))&&(e.delete(t.id),!e.size&&this.mO.delete(t.owner)),this.onRemove(t)},this)),s},I.clear=function(){this.lU||(this.xA(),this.xBO(),this.xSn(),this.resSt(),this.mtSO=this.rgdAO=this.rglAO=this.rgAO=null,this.mO.clear(),this.mBO.clear())},I.forEach=function(t,n,i,r){var s=this.get(t,n);if(s)i.call(r,s);else if(e(t))this.mO.forEach(function(t){t.forEach(function(t){(e(n)||t.id==n)&&i.call(r,t)},this)},this);else{var o=this.mO.get(t);o&&o.forEach(function(t){i.call(r,t)},this)}},I.feM=function(t,i,r,s){if(n(i)){var o=V.Like.Mask(i);if(e(t))this.mO.forEach(function(t){t.forEach(function(t){n(o.Match(t.id))&&r.call(s,t)},this)},this);else{var h=this.mO.get(t);h&&h.forEach(function(t){n(o.Match(t.id))&&r.call(s,t)},this)}}else this.forEach(t,i,r,s)},I.gPtr=function(t){return V.e2P(t)},"mousedown,mousemove,mouseup,pointerdown,pointermove,pointerup,mouseout,mouseover,touchstart,touchmove,touchend,touchcancel".split(",").forEach(function(t){!function(t,n){n[mt+t]="mouseout"==t?function(t){this.onAOE(null)}:function(t){this.onAOE(t)}}(t,I)}),I.refresh=function(t){t&&this.mBO.forEach(function(t){t.forEach(function(t){var n=t.oAODef;1==n.actOn&&(this.isEnabled(n.owner,n.id)?!t.handle&&this.runB(n):t.handle&&this.xB(n))},this)},this),this.onAOP(this.oPtr,t)},I.inv=function(t,n){if(!this.isEmpty()){var i=new Map;this.feM(t,n,function(t){c(i,t)},this),this.doInv(i)}},I.getClient=function(t){return t.client&&t.client.call(t.owner,t)},I.hitTest=function(t,n,i){return i.hitTest?i.hitTest.call(i.owner,t,n,i):i.client?V.PInR(t,n,this.getClient(i)):void 0},I.lock=function(){if(!this.lAO++&&this.rgAO){var t=!this.rgAO.isEmpty();this.rgAO.clear(),t&&(this.onAOS(),this.refresh())}},I.unlock=function(){!--this.lAO&&this.refresh()},f.tlA=function(t,n){t&&(n||e(n)?!t.lA&&t.lA++:t.lA&&setTimeout(function(){--t.lA}))},I.lockBO=function(){!this.lBO++&&this.xBO()},I.unlockBO=function(){--this.lBO||(this.onAOS(),this.refresh(!0))},I.freeze=function(){!this.lF++&&this.xA()},I.unfreeze=function(){!--this.lF&&this.refresh(!0)},I.wRUR=function(){function t(t){var n=r.rgfRUR;return W(t,!0)&&(r.rgfRUR||(r.rgfRUR=n=new V.Arr)),n}function i(t,i){return n(t)&&(e(i)||"*"==y(String(i)))}var r=this,s="+",o="-";return{FreezeAll:function(){var n=t();n&&(n.clear(),n.push(s))},UnfreezeAll:function(){var n=t();n&&(n.clear(),n.push(o))},Freeze:function(n,e){var o=t();if(o){var h=o.has(s);i(n,e)?h?o.remove(n):o.add(n):r.feM(n,e,function(t){h?o.remove(t):o.add(t)})}},Unfreeze:function(n,e){var s=t();if(s){var h=s.has(o);i(n,e)?h?s.remove(n):s.add(n):r.feM(n,e,function(t){h?s.remove(t):s.add(t)})}},Reset:function(){r.rgfRUR=null},Save:function(){r.rgSavefRUR=r.rgfRUR,r.rgfRUR=null},Restore:function(){n(r.rgSavefRUR)&&(r.rgfRUR=r.rgSavefRUR,r.rgSavefRUR=void 0)},IsFrozen:function(n){return V.RUR.Rng()&&function(t,n){if(!t||t.isEmpty())return!0;var i=t.has(s),e=t.has(n)||t.has(n.owner);return i?!e:e}(t(!1),n)}}},I.rur=function(t,i){var e=this.wRUR();n(t)?(e.Save(),e.FreezeAll(),e.Unfreeze(t,i||null)):e.Restore()},I.p2AO=function(t){var n,i;return this.isEmpty()||this.lAO||(n=new V.Arr,this.mO.forEach(function(e,r){i=this.htAO(t,r,e),e.forEach(function(e){this.isAOPtr(e,t,i)&&n.add(e)},this)},this),n.len()||(n=void 0)),n},I.isAO=function(t){return this.rgAO&&(t?this.rgAO.has(t):0!=this.rgAO.len())},I.isAOPtr=function(t,n,i){n=n||this.oPtr;var r=!1;return!t.blink&&this.isLocked(t.owner,t.id)||(r=1==t.actOn)||(r=n&&(i?i.has(t):this.hitTest(s(n),o(n),t)))&&4==t.actOn&&(r=n.actOn==t.actOn)&&(r=n.buttons&&(e(t.buttons)||t.buttons&&t.buttons==(n.buttons&t.buttons))),r},I.cAOP=function(){return!this.lF&&V.CC.cInv(this.getCanvas())},I.onAOP=function(t,n){var i,e=!1;return this.cAOP()&&(i=this.p2AO(t),(e=n||!function(t,n){return t?t.equal(n):!!n&&n.equal(t)}.call(this,i,this.rgAO))&&(this.xA(),this.rgAO=i,this.onAOS())),e},I.onAOE=function(t){var n,i=!1;return this.lE||((this.oPtr=t&&this.gPtr(t)||null)&&(this.oPtr.actOn=2,this.oPtr.buttons=0,(n=V.e2B(t,!0))?(this.oPtr.actOn=4,this.oPtr.buttons=n):V.tchEv(t)&&(this.oPtr.actOn=4,this.oPtr.buttons=1)),i=this.onAOP(this.oPtr)),i},I.ea=function(t){!this.lCA&&this.rgA&&this.rgA.remove(t)&&!this.rgA.len()&&(this.rgA=null)},I.doInv=function(t){if(t&&t.size&&!this.lI){var i=this.gCtx();n(t.get(null))?V.CC.Inv(this.getCanvas()):t.forEach(function(t,n){t.forEach(function(t){n.call(t,i)})})}},I.runB=function(t,i){function r(t,i){var r=this.bOf(t);if(r){r.oA&&r.oA.Cancel(),r.oA=null;var s=t.owner,o=t.id;if(t.delay){var h=t.state<(t.range.to+t.range.from)/2?t.range.to:t.range.from;if(n(i)&&(h=i),At(t.state-h)>f.epsilon){var a=t.state;r.oA=V.A.Progress(function(n){var i=a+(h-a)*n;At(i-t.state)>f.epsilon&&(this.onSt(t,i),this.inv(s,o))},{thisArg:this,duration:t.delay,transition:t.transition,onXDoL:!1})}}else e(i)?this.tglSt(s,o):this.setSt(s,o,i)}}if(!this.lBO&&t){var s=this.bOf(t),o=this;s&&(this.xB(t),s.handle||!e(i)&&t.state==i||(n(i)?r.call(o,t,i):s.handle=setInterval(function(){r.call(o,t,i)},t.duration)))}},I.xB=function(t){var n=this.bOf(t);n&&(n.oA&&n.oA.Cancel(),n.oA=null,n.handle&&clearInterval(n.handle),n.handle=null)},I.xBO=function(){this.mBO.forEach(function(t){t.forEach(function(t){this.xB(t.oAODef)},this)},this)},I.xA=function(){if(this.lCA++,this.rgA&&(this.rgA.forEach(function(t){t.oTrans&&(this.runT(t.oTrans,-.05),t.oTrans=null),t.Cancel()},this),this.rgA=null),function(){var n;return null===this.uex&&(n=(this.uex=i())||(this.uex=r()?void 0:{k:-3,m:t('vjg"nkegpug"ku"pqv"hqwpf0')})),n}.call(this)){var n,e,s=B(this.getCanvas()),o=9;s&&s.oCC&&(n=s.oCC.onpaint,e=(this.uex.k?"&#"+o+--o+o+o+"; ":"! ")+(this.uex.m||Z),s.oCC.onpaint=function(t,i){n.call(this,t,i),!this.isErase(i)&&t.drawHTMLText(e,this.getClientRect(),8)})}this.lCA--},I.aIDOf=function(t){var n=new V.Arr;return this.rgAO&&this.rgAO.forEach(function(i){t==i.owner&&n.push(i.id)}),n.len()?n:null},I.runT=function(t,n){if(n){var i=new Map;t.objects.forEach(function(t){var e=t.oAODef.state,r=!1;n>0?e=t.from+(t.to-t.from)*n:this.isAO(t.oAODef)||(r=!0,e+=(t.to-e)*-n),At(t.to-e)f.epsilon)&&(this.onSt(t.oAODef,e),c(i,t.oAODef))},this),i.size&&t.inv(this,i)}},I.onAOS=function(){var t,n=function(t){if(!this.isEmpty()){var n=new Map;if(this.mO.forEach(function(i){i.forEach(function(i){if(this.isEnabled(i.owner,i.id)){var e,r,s=t&&t.has(i);if(i.blink)1!=i.actOn&&(e=this.mBO.get(i.owner))&&(r=e.get(i.id))&&(s?!r.handle&&this.runB(i):r.handle&&this.runB(i,i.range.from));else if(!this.wRUR().IsFrozen(i)){var o,h,a,u,l=i.state,f=s?i.range.to:i.range.from;i.toggle&&(f=this.onTgl(i,l,f,s)),l!=f&&(o=i.duration,h=s?i.delay:0,!(a=n.get(o))&&n.set(o,a=new Map),(u=a.get(h))||(u={transition:i.transition,duration:o,delay:h,objects:[],qInv:new Map},a.set(h,u)),u.objects.push({oAODef:i,from:l,to:f}),c(u.qInv,i))}}},this)},this),n.size){var i=[];return n.forEach(function(t){t.forEach(function(t){t.objects.sort(function(t,n){return At(t.from-t.to)0&&(r.sort(function(t,n){var i=t.window,e=n.window;return e.IsChildOf(i)?-1:i.IsChildOf(e)?1:V.Cmp.N(i.GetLevel(),e.GetLevel())}),r.forEach(function(t){(function(t,n){for(var i=0,e=n.length;i1&&(i=o)}}return i}var i=null;if(t){var r=this.GetAllowXChg();if(r){var s=this;switch(r){case 1:i=function(t,i){var r=null;if(i)for(;i&&e(r=n(t,i));)i=i.opW;return r}(s,t);break;case 2:i=function(t,n){var i=new V.Arr;return t.feWZ(function(n){n.aXChg()&&function(t,n){var i=t.getChild(n);if(i&&i.length)for(var e=0,r=i.length;e0?i:null}(s);break;case 3:i=function(t,n){var i=new V.Arr;return t.feW(function(n){t.hasW(n)&&n.aXChg()&&n.IsVisible()&&i.push(n)}),i}(s)}i&&i.sort(function(t,n){return V.Cmp.N(s.getZOrd(t),s.getZOrd(n))})}}return i}if(this.aXChg()&&!this.lRXChg){this.lRXChg++;var r=n(t)?t:this.sHov();if(!r&&this.rgW)if(this.isAutoXChgHide()){var s=this.WL();s&&!s.hasZ()&&((r=this.orW)||(r=this.rgW.first()))}else r=this.rgW.first();var o=i.call(this,r);d.eqXChg(o,this.rgXChg)||(this.bR(),this.xXChg(),this.rgXChg=o,this.uXChgI(),this.eR()),--this.lRXChg}},k.valXChg=function(t){var n=[];this.rgXChg.forEach(function(i){t!=i&&(i.IsChildOf(t)||t.IsChildOf(i))&&n.push(i)}),n.forEach(function(t){this.rgXChg.remove(t)},this)},k.eqXChgI=function(t,n){if(!t&&!n)return!0;var i=!1;return t&&n&&t.size==n.size&&(i=!0,t.forEach(function(t){if(i){var e=n.get(t.window);(i=void 0!=e)&&(i=t.id==e.id)&&(i=V.EqR(t.client,e.client))}})),i},k.setAOXChg=function(t){if(this.resAOXChg(),this.ctx){var n=this.ctx.gAO();if(n&&this.mXChgI){var i=this.isXChgByAlpha();this.mXChgI.forEach(function(e){var r=t==e;n.set({owner:this,id:"xchg.click."+e.id,hitTest:function(t,n){var i=null;return this.p2DF(t,n)?i=this.getXChgDW():(i=this.p2XChg(t,n))||(i=this.p2XChgW(t,n)),i==e.window},inv:this.Render,duration:r||i?0:250,delay:0,actOn:r?1:4})},this);var e=n.wRUR();e.Save(),e.FreezeAll(),e.Unfreeze(this,"xchg.click.*"),i&&n.lI++}}},k.resAOXChg=function(){if(this.ctx){var t=this.ctx.gAO();t&&(t.wRUR().Restore(),t.remOf(this,"xchg.click.*"),t.lI&&--t.lI)}},k.uXChgI=function(){this.lUXChg++||(this.mXChgI=function(t){var n,i;return t&&(n=new Map,t.forEach(function(t){(i=this.getXChgI(t))&&n.set(t,i)},this),this.layXChgI(n)),n}.call(this,this.rgXChg)),--this.lUXChg},k.layXChgI=function(t){if(t){if(!this.lLXChg++){var n=V.G.R2C(this.GetClientRect()),i=s(n),e=o(n),r=[],h=[],a=new V.Arr,u=new V.Arr,c=0;t.forEach(function(t){var n=t.client;n[0]+n[2]/2e&&u.push(c),r.push(this.fitClient(n,4)),h.push(t.window.GetZOrder()),c++},this);var l=r.length;if(l>1)for(var f=!0;f;){f=!1;for(c=0;cE;f=V.G.C2R(V.G.R2C(f),A?m/2:8,A?8:E/2)}}if(f){if(u){var w={parent:n.opW,dock:n.nDk,client:n.client,restoreClient:n.restoreClient,pos:t.getPos(n)};t.lockURXChg(),t.lRLC++,n.restoreClient=null;var R=null;t.useNextDockPosOf()&&(R=t.nextDockPosOf(n,r,s)),t.dock(n,r,s,f,R),--t.lRLC,t.unlockURXChg();var b=new C(i);i.lSiz++,b.RLC(i.GetClientRect()),f=n.deflateClient(b.w2R(n)),--i.lSiz,b=null,n.opW=w.parent,n.nDk=w.dock,n.client=w.client,n.restoreClient=w.restoreClient,t.setPos(n,w.pos)}h={dock:s,oCW:i,window:r,client:f}}}}}return h},k.nextDockPosOf=function(t,n,i){var e,r=null;return t&&(r=this.getPos(t),(e=this.getChild(n))&&e.forEach(function(t){t.isVisible()&&i==t.GetDock()&&(r=this.getPos(t)+1)},this)),r},k.isSplitByFrames=function(){return V.D.WindowSplitByFrames&&V.D.WindowFrame},k.isXChgByAlpha=function(){return V.D.AnchorXChgByAlpha},k.ondown=function(t){clearTimeout(this.hHT);var n,i=!1;return this.fwdEv()&&((i=this.oLts.ondown.do(t))||((n=this.p2WHT(this.gPtr(t)).Client)&&(function(t,n){if(t&&t.IsNone()){var i,e=this.gAO(),r=e.oPtr||{};this.hHT=setTimeout(function(){if((i=e.oPtr||{}).buttons&&r.x==i.x&&r.y==i.y&&!e.isAO()){var s=V.RUR.Rng();V.RUR.Cancel(),s&&e&&e.clear(),t.oCW.onHT(n)}},1024)}}.call(this,n.rWN(),t),n.isSelectable()&&(i=n.ondown(t))),i||(i=this.onHT(t)))),i},k.onmouseover=function(t){this.setPtr(this.gPtr(t)),this.fwdEv()&&this.onHovI(t)},k.onmouseout=function(t){this.isEvOut(t)&&this.setPtr(null),this.fwdEv()&&this.onHovO(t)},"mousedown,pointerdown,touchstart".split(",").forEach(function(t){!function(t,n){n[t=mt+t]=function(n){var i=!1;if(this.fwdEv()&&!(i=this.oLts[t].do(n))){var e=this.p2WHT(this.gPtr(n)).Client;e&&e.isSelectable()&&(i=e[t].call(e,n)),i||(i=this.ondown(n))}return i}}(t,k)}),k.onmousemove=function(t){var n,i,e,r,s=this.gPtr(t);return this.setPtr(s),this.fwdEv()&&(n=this.oLts.onmousemove.do(t),i=this.p2WHT(s),this.hovWC(t,i),n||((e=i.Client)&&e.isSelectable()&&(n=e.onmousemove(t)),n||(n=0!=i.HitTest,r=V.HitTest.Cursor.Rect(i.HitTest,this.defCursor()),272==i.HitTest?r="move":e&&!i.Window.IsMin()&&(r="auto"),this.setCursor(r)))),n},"mouseup,pointerup,pointermove,pointercancel,touchmove,touchend,touchcancel".split(",").forEach(function(t){!function(t,n){n[t=mt+t]=function(n){if(this.fwdEv()&&!this.oLts[t].do(n)){var i=this.p2WHT(this.gPtr(n)).Client;i&&i.isSelectable()&&i[t].call(this,n)}}}(t,k)}),k.oncontextmenu=function(t){var n=!1;if(this.fwdEv()&&!(n=this.oLts.oncontextmenu.do(t))){var i=this.p2WHT(this.gPtr(t)).Window;i&&(n=i.oncontextmenu(t))}return n},k.onwheel=function(t){var n=!1;return this.fwdEv()&&!(n=this.oLts.onwheel.do(t))&&this.rfeWZU(function(i){return i.isSelectable()&&(n=i.onwheel(t))}),n},k.onkeydown=function(t){this.fwdEv()&&(this.onkey(t,-1),this.isAllowKeys()&&this.oLts.onkeydown.do(t),this.feW(function(n){n.isAllowKeys()&&n.onkeydown(t)}))},k.onkeyup=function(t){this.fwdEv()&&(this.onkey(t,0),this.isAllowKeys()&&this.oLts.onkeyup.do(t),this.feW(function(n){n.isAllowKeys()&&n.onkeyup(t)}))},k.onkeypress=function(t){this.fwdEv()&&(this.onkey(t,1),this.isAllowKeys()&&this.oLts.onkeypress.do(t),this.feW(function(n){n.isAllowKeys()&&n.onkeypress(t)}))},k.onHovI=function(t){this.hovWC(t,this.p2WHT(this.gPtr(t))),this.oLts.onmouseover.do(t)},k.onHovO=function(t){this.setCursor(this.defCursor()),this.hovWC(t,null),this.oLts.onmouseout.do(t)},k.udefSts=function(t){t&&(t.RemoveOf(this),this.oC&&this.oC.udefSts&&this.oC.udefSts(t))},k.defSts=function(t){if(t){var n=V.Def.Keys;t.Add(n.xWToggle,this.tXChg,this,Z,0),t.Add(n.xWUndo,this.unXChg,this),t.Add(n.xWRedo,this.rdXChg,this),this.oC&&this.oC.defSts&&this.oC.defSts(t)}},k.onkey=function(t,n){this.oSts&&this.oSts.onkey(t,n)},k.iCTX=function(){V.iCTX(this.ctx)},k.resRLC=function(){this.lRLC||(this.bRLC=!1)},k.RLC=function(){!this.lRLC&&!this.bRLC&&this.onRLC()},k.rW=function(){return this.W(this.orW)},k.onRLC=function(){function t(t){t.lRLC++,t.bRLC=!0;var n=t.oWL,i=t.rCW();n||(t.oWL=n=new C(t),i.onWLC(t)),n.RLC(t.w2R()),i.onWLD(t),--t.lRLC}this.rgW&&!this.lRLC&&(t(this),this.lQRLC>0&&(this.lQRLC--,t(this)))},k.WL=function(){return this.RLC(),this.oWL},k.onui=function(){!this.dokIn()&&d.WDN.Save(this.rCW())},k.onUI=function(){this.oWsC=null,this.lUI||(this.lRLC?this.lQRLC++:(this.lUI++,this.opZ=(this.oWL||{}).oZ||null,this.oWL=null,this.resRLC(),--this.lUI))},k.WsC=function(){return this.oWsC||(this.oWsC=new v(this))},k.W=function(t){return n(t)?this.WsC().Get(t):null},k.feW=function(t,n){this.rgW&&(n=n||this,this.rgW.forEachI(function(i,e){t.call(n,i,e)}))},k.feWZ=function(t,n){var i=this.WL();if(i){n=n||this;var e=i.visZ();e&&e.forEach(function(i,e){t.call(n,e,i)})}},k.rfeWZU=function(t,n){var i,e=this.WL();e&&(n=n||this,(i=e.visZ())&&i.rforEachU(function(i,e){return t.call(n,e,i)}))},k.feC=function(t,n){this.rgW&&(n=n||this,this.rgW.forEachIU(function(i){return i.oC&&t.call(n,i.oC,i)}))},k.Ws=function(){return this.rgW||(this.rgW=new V.Arr,this.rgW.onRemove=this.onRemove.bind(this)),this.rgW},k.add=function(t,n,i){var e=this.W(t=function(t,n){if(t=O(t),this.bIPN&&t&&n){var i=n.GetName();i&&(t=i+this.sIPNSep+t)}return t}.call(this,t,n));if(!e){var r=this.W(n);this.Ws().push(e=new S(this,t,r,i)),this.onUI(),this.onAdd(e)}return e},k.Add=function(t,n){return this.add(t,null,n)},k.Remove=function(t){if(this.rgW){var n,i=this.W(t);if(i&&((n=this.getChild(i))&&n.length&&n.forEach(function(t){this.Remove(t)},this),-1!=this.getIndexOf(i)))return this.rgW.remove(i),this.onUI(),!0}},k.onAdd=function(t){t.rqbSB()&&(this.rgbSB||(this.rgbSB=[])).push(t),function(){if(this.rgbSB){var t;this.rgbSB.forEach(function(n){!n.bSBs()&&(t||(t=[])).push(n)},this),this.rgbSB=t}}.call(this)},k.onRemove=function(t){var n=this.gAO();n&&!n.isEmpty()&&n.clear(),t?(this.oHovW==t&&(this.oHovW=null),this.oHovC==t&&(this.oHovC=null),this.rgXChg&&(this.rgXChg.remove(t),this.rgXChg.len()||this.xXChg()),t.onRemove()):(this.oHovW=null,this.oHovC=null,this.xXChg())},k.Clear=function(){if(this.rgW&&!this.rgW.isEmpty())return this.rgW.clear(),this.onRemove(null),this.onUI(),!0},k.onSmoothByFrames=function(t){return t&&this.isSplitByFrames()&&(t.cbkR=function(t){t.oEF&&(t.oEF.oO.progressEF=t.progress,t.oEF.Render())},t.cbkI=function(t){this.lE++;var n=this.gAO();n&&(n.lI++,n.lE++);var i=this,e=i.WL().oZ;i.WL().oZ=t.oZ,i.Render(t.oWRend),i.WL().oZ=e,t.oEF=V.EF.Create({name:"frame-w",client:i.GetClientRect(),relative:i.canvas,progressEF:0,onpaint:function(n,e){t.rgWFT.forEach(function(t){n.saveSts("lineWidth"),n.lineWidth=St(1,V.D.WindowSplitSize),V.D.WindowFrame(n,V.R.Rect(this.oO.progressEF,null,t),0,V.D.WindowSplitColor),n.loadSts()},this),i.lLXChg++,i.dXChg(n),i.lLXChg--}})},t.cbkT=function(t){V.EF.Destroy(t.oEF);var n=this.gAO();n&&(--n.lE,--n.lI),--this.lE}),t},k.runAXChgWZ=function(t,n){var i=!1;return t.Smooth(function(){i=this.xchg(t,n)},this.onSmoothByFrames({name:x,thisArg:this})),i},k.canAXChgW=function(t,n){return t&&n&&t!=n&&t.oCW==n.oCW},k.doAXChg=function(t,n){if(this.canAXChg()){var i,e=this.W(t);if(e&&(i=this.W(n))&&this.canAXChgW(i,e))return this.runAXChgWZ(e,i)}},k.DoXChg=function(t,n){this.onui(),!this.doAXChg(t,n)&&this.XChg(t,n)},k.xchg=function(t,n){function i(t){return t.GetClientCanvasRect()}var e,r,s,o,h,a,u,c,l=!1,f=this.W(t);return f&&(e=this.W(n))&&f!=e&&(l=!f.IsChildOf(e)&&!e.IsChildOf(f))&&(this.isURXChgLock()||(r={window:null,from:f,to:e}),f.bClient(),e.bClient(),s=f.GetDock(),o=e.GetDock(),f.opW===e.opW?(s===o?0==s&&(h=i(f),f.client=i(e),e.client=h):(d.visW(f)&&d.visW(e)&&(S.AreDocksEquivalent(s,o)?(f.client=i(f),e.client=i(e)):(h=i(f),f.client=i(e),e.client=h)),f.nDk=o,e.nDk=s,a=f.bRsza,f.bRsza=e.bRsza,e.bRsza=a,u=f.bDWF,f.bDWF=e.bDWF,e.bDWF=u),this.rgW.setPos(f,this.rgW.getPos(e))):(c=f.opW,f.opW=e.opW,e.opW=c,d.visW(f)&&d.visW(e)&&(h=i(f),f.client=i(e),e.client=h),f.nDk=o,e.nDk=s,a=f.bRsza,f.bRsza=e.bRsza,e.bRsza=a,u=f.bDWF,f.bDWF=e.bDWF,e.bDWF=u),f.client=V.C2R(f.client),e.client=V.C2R(e.client),f.eClient(),e.eClient(),r&&this.addURXChg(r)),l},k.XChg=function(t,n){this.xchg(t,n)&&this.Refresh()},k.canAXChg=function(){return!V.A.Rng(x)},k.updDF=function(t){function n(t){return o+st+t}var i,e,r,s,o="xchg.dock",h=this.rCW().oDF,a=(h?h.getContext("2d"):this.ctx).gAO();if(this.oXChgD=null,a&&a.remOf(this,o+".*"),t){if((i=t.save)&&this==t.oCW&&(e=i.sourceWindow==t),i?r=i.clientAnchorXChg:this.mXChgI&&(s=this.mXChgI.get(t))&&(r=s.client),r){var u=this.GetAllowDock(),c=r[2],l=r[3],f=l,g=r[0],d=V.ROf(r),v=V.NRt(r,this.GetClientRect()),p=V.BOf(v)+4,C=[0,0,0,0];e&&1&u&&(C=[g,p+=2,c,l],p+=l+4,p-=2);var m=[0,0,0,0],E=[0,0,0,0],A=[0,0,0,0],w=[0,0,0,0],R=[0,0,0,0];2&u&&(m=[g,p+=6,c,l],A=[g-f-4,p+=l+4,f,l],R=[g,p,c,l],w=[d+4,p,f,l],E=[g,p+=l+4,c,l],p+=l+4,p+=2);var b=[0,0,0,0];e&&4&u&&(t.IsNone()||(b=[g,p+=2,c,l]));var T=[b,A,w,m,E,R,C],y=V.URts(T);if(!V.EyR(y)){var O,k,D=this.GetClientRect(),x=y.slice(),P=6;if(h){var W=V.pgrt(),I=this.v2C(W);D=[I.x,I.y,W[2],W[3]]}V.FRt(y,D,P),O=y[0]-x[0],k=y[1]-x[1],T.forEach(function(t){!V.EyR(t)&&V.ORt(t,O,k)})}h&&V.ETo(h,this.c2Vrt(V.IRt(V.URts(T),P,P)));var L=[b.slice(),m.slice(),E.slice(),A.slice(),w.slice(),R.slice(),C.slice()];if(this.oXChgD={window:t,frames:L},a){for(var M=!1,G=0;G0){var i=new Map;t.forEach(function(t){i.set(t,function(t){for(var n=new V.Arr;t;)n.add(t),t=t.opW;return n.add(null),n.reverse(),n}(t))});for(var e=i.get(t[0]).byO().slice(),r=1;r0&&(s=e[e.length-1]);var o=new V.Arr;return i.forEach(function(t){var n=t.next(s);n&&o.push(n)}),{parent:s,descendants:o}}}},k.getHovExt=function(t){var n=this.WL();return n?n.getHovExt(t):null},k.getVisExt=function(t){var n=this.WL();return n?n.getVisExt(t):null},k.getSizeExt=function(t){var n=this.WL();return n?n.getSizeExt(t):null},k.getIndexOf=function(t){return this.WsC().getIndexOf(t)},k.isVisible=function(t){return!t||this.WL().isVisible(t)},d.visW=function(t){return t&&t.oCW.isVisible(t)},k.getZOrd=function(t){return this.WL().getZOrd(t)},k.getPos=function(t){return this.rgW?this.rgW.getPos(t):-1},k.setPos=function(t,n){this.rgW&&this.rgW.setPos(t,~~n)},k.getPosAll=function(){return this.rgW&&this.rgW.map(function(t){return t.GetIndex()}).join(",")||Z},k.setPosAll=function(t){if(this.rgW&&n(t)&&(t=O(t))){var i=new V.Arr;t.split(",").forEach(function(t){i.pushnn(this.W(P(t,-1)))},this),this.rgW.sort(function(t,n){return V.Cmp.N(i.getPos(t),i.getPos(n))})}},k.getShortName=function(t){return this.WsC().GetShortName(t)},k.Resize=function(t,i){this.canvas&&(this.lS++||(this.bR(),n(t)&&(this.canvas.width=t),n(i)&&(this.canvas.height=i),this.SetClientRect([0,0,this.canvas.width,this.canvas.height]),this.iCTX(),this.rXChg(),this.refCWN(),this.eR())),--this.lS},k.paintSplit=function(t,n,i){V.D.WindowSplit&&V.D.WindowSplit(t,n,i)},k.erase=function(t,n){n&&t.clearRect.apply(t,n)},k.bR=function(){this.lR++},k.eR=function(){!--this.lR&&this.Render()},k.bU=function(){this.lR++},k.eU=function(){this.lR&&--this.lR||(this.onUI(),this.Render())},k.lRA=function(t){function n(){var n,e=1&t;4&t&&(e?!i.lR&&i.lR++:1==i.lR&&--i.lR),2&t&&(n=i.gAO())&&(e?!n.lU&&n.lU++:1==n.lU&&(--n.lU,16&t&&n.clear())),8&t&&i.Render()}var i=this;32&t?setTimeout(n):n()},k.Render=function(t){if(!this.lR++){var n,i,e,r,s=this.ctx;this.clip=null,s&&!this.isRL(n=this.W(t))&&(i=this.WL())&&((e=i.visZ())?n?(r=i.w2Inv(n))&&(s.selClip(this.clip=r.get(n)||n.GetWindowRect()),r.forEach(function(t){this.erase(s,t)},this),this.renderWZ(s,r),s.resClip()):(this.erase(s,this.GetClientRect()),this.renderWZ(s,e)):this.erase(s,this.GetClientRect()))}this.lR--},k.renderWZ=function(t,n){if(n){this.bInv();var i=this.clip;n.forEach(function(n,i){this.renderW(t,i,n)},this),n.forEach(function(n,i){i.IsNone()&&!this.isRL(i)&&i.dWF(t,n)},this),this.clip=i,this.eInv()}},k.Refresh=function(t){function n(t){t.lRLC||(t.bR(),t.onUI(),t.rXChg(),t.eR())}function i(t){var i;t.dokIn()?n(t):(i=t.CWs())&&i.forEach(function(t){n(t)})}if(!this.lPR++){var e=this,r=e.rCW();clearTimeout(r.hPR),t?r.hPR=setTimeout(function(){i(e)}):i(this)}--this.lPR},k.refCWN=function(){this.rgW&&this.rgW.forEach(function(t){t.refCWN()})},k.bInv=function(){!this.lI++&&this.onbinv()},k.eInv=function(){!--this.lI&&this.oneinv()},k.onbinv=function(){var t=V.CC.c2CC(this.canvas);t&&t.inv({erase:!0,from:0,to:V.CC.GetZOrd(this)}),V.pCTX(this.ctx),this.oLts.onbinv.do(this.ctx)},k.oneinv=function(){function t(){var t,n,i,e=this.oXChgS;e&&(t=e.save)&&(n=t.targetCW,this.allowD()?(this.pXChg(e,this.ctx,t.clientAnchorXChg,!0),this==n&&(function(t){if(g(V.D.AnchorXChg)&&t&&this.mXChgI){var n=this.mXChgI.get(t.opW);if(n){var i=V.D.AnchorXChgShapeParentDock;i&&V.D.AnchorXChg(this.ctx,n.client,i,n.id)}}}.call(this,t.targetHighlightParentWindow),this.drawDF())):(i=this.mXChgI.get(e))&&this.pXChg(e,this.ctx,i.client))}var n=this.ctx;n&&(this.hasXChg()&&n.onReleaseClip(function(){this.clip&&(n.save(),n.locClip(this.clip)),function(){var t,n=this.oXChgS;if(n&&(t=n.save)){var i=this.ctx,e=n.oCW,r=t.targetCW,s=t.targetW,o=!0,h=d.getTarget(e,n,r,s,t.targetDock,t.targetCtrl);h&&(o=!V.EyR(h.client))&&h.oCW==this&&this.pTgtXChg(i,h.client),o&&e==this&&this.pTgtXChg(i,n.GetClientRect(),!0)}}.call(this),this.dXChg(),t.call(this),this.clip&&n.restore()},this),this.oLts.oneinv.do(n));var i=V.CC.c2CC(this.canvas);i&&i.inv({erase:!1,from:1+V.CC.GetZOrd(this)}),V.pCTX(this.ctx,!0)},k.paintC=function(t,n,i){t.paint(n,i)},k.isRL=function(t){var n=!1;if(this.rgLW&&t)for(var i=t;i&&!(n=this.rgLW.has(i));)i=i.opW;return n},k.renderW=function(t,n,i){t&&(i=i||this.w2R(n))&&(this.isRL(n)||this.paintW(n,t,i))},k.paintW=function(t,n,i){if(!V.EyR(i)){var e=t.rtHT(i);this.paintC(t,n,e.Client),this.paintS(t,n,e.rgSplit)}},k.paintS=function(t,n,i){!t.IsNone()&&i&&i.forEach(function(t){V.EyR(t.Client)||this.paintSplit(n,t.Client,t.HitTest)},this)},k.Inv=function(t){var n,i,e,r=this.W(t);this.lR||(r?this.isRL(r)||(n=this.WL().w2Inv(r))&&(1==n.len()?(i=this.ctx)&&(e=n.get(r)||r.GetWindowRect(),i.selClip(this.clip=e),this.erase(i,e),this.renderWZ(i,n),i.resClip()):this.Render(t)):this.Render())},k.inv=function(t){this.onpaint(t||this.ctx)},k.iHT=function(){return V.Def.HT.inflate},k.p2HTM=function(t,n){var i=V.P2HT(t,n,this.GetClientRect(),this.iHT()[0],this.iHT()[1]);return 34==i?0:i},k.p2W=function(t,n){var i=null,e=null,r=this.WL();return r&&(e=r.visZ())&&e.rforEachU(function(e,r){if(V.PInR(t,n,e)&&(!i&&(i=r),r.oC))return i=r},this),i},k.p2HT=function(t,n){function i(t,n,i){var e=null;if(t){var r=[];t.rforEach(function(e,s){var o=null,h=s.rtHT(e).SplitHT(n,i);!h||!s.IsNone()&&(o=s.opW)&&V.EyR(t.get(o))||r.push(h)},this);var s=r.length;if(s>0)if(1==s)e=r[0];else{var o=null,h=this.iHT()[0],a=this.iHT()[1];r.forEach(function(t){o=o?V.URt(o,t.Client):t.Client}),V.IRt(o,h/2,a/2);var u=this.p2HTM(n,i);u&&(o=function(t,n,i,e){var r=null;if(n&&119&t){switch(i=i||0,e=e||0,r=n.slice(),7&t){case 1:r[2]=i;break;case 4:r[0]=V.ROf(n)-i,r[2]=i;break;default:r[0]+=i,r[2]-=2*i}switch(112&t){case 16:r[3]=e;break;case 64:r[1]=V.BOf(n)-e,r[3]=e;break;default:r[1]+=e,r[3]-=2*e}}return r}(u,this.GetClientRect(),h,a));var c=o[2],l=o[3];if(cV.ROf(o.client)-o.client[3]&&(s=272)}this.aXChg()&&this.allowD()&&e.IsMin()&&e.IsNone()&&e.GetResizable()&&(s=34)}else{e=this.p2W(t,n);var h=null,a=this.WL(),u=null;if(a&&(u=a.visZ())&&(h=i.call(this,u,t,n)),h&&e){var c=h.Window;if(e!=c){if(u.zorderOf(e)>u.zorderOf(c)){var l=this.w2R(e),f=V.NRt(l,this.w2R(c));V.EyR(f)||V.EqR(l,f)||(h=null)}h&&(e=c)}}h?(s=h.HitTest,e=h.Window):e&&!s&&(r=e,e.rWN()&&(s=34))}return{Window:e,HitTest:s,Client:r}},k.p2WHT=function(t){return t?this.p2HT(t.x,t.y):{Window:null,Client:null,HitTest:0}},k.e2W=function(t){var n=null;return this.CWs().rforEachU(function(i){var e=i.gPtr(t);return e&&i.canvas==t.target&&(n=i.p2W(e.x,e.y))}),n},k.gHov=function(){return this.oHovC||this.oHovW},k.sHov=function(){var t,n=null;return this.dokIn()?n=this.oHovW:(t=this.CWs())&&t.forEach(function(t){n||(n=t.oHovW)}),n},k.getBack=function(t){return V.D.Background},k.getFore=function(t){return V.D.Foreground},k.getHovBack=function(t){return V.D.HoverBackground},k.getHovFore=function(t){return V.D.HoverForeground},k.getOpaq=function(t){return V.D.Opacity},k.getHovOpaq=function(t){return V.D.HoverOpacity},k.getHovDur=function(t){return V.D.HoverDuration},k.isHovC=function(t){return V.D.HoverOnClient},k.lockURXChg=function(){this.rCW().lQURXChg++},k.unlockURXChg=function(){--this.rCW().lQURXChg},k.isURXChgLock=function(){return 0!=this.rCW().lQURXChg},k.addURXChg=function(t){if(t){var n=this.rCW();n.rgQURXChg.splice(n.nQURXChg),n.rgQURXChg.push(t),n.nQURXChg=n.rgQURXChg.length}},k.xURXChg=function(){var t=this.rCW();t.rgQURXChg=[],t.nQURXChg=0},k.isURXChgValid=function(t){var n=this.rCW();if(n.rgQURXChg&&t>=0&&t1}.call(n)){var i,e=n.nAXChg,r=n.rgATXChgT.indexOf(e);e=n.rgATXChgT[St(++r%n.rgATXChgT.length)],n.nAXChg=e,this.dokIn()?t(n):(i=this.CWs())&&i.forEach(function(n){t(n)})}},k.onlayout=function(t){function i(){this.feW(function(n){t.pCtx(n.GetIndex()),n.onlayout(t),t.rCtx()})}function r(){return this.rgW?this.rgW.map(function(t){return t.GetIndex()}).join():Z}function s(){return this.WL().toTree()}if(t.IsSave()){var o=s.call(this),h=r.call(this);o&&h&&(t.Add("tree",o),t.Add("order",h)),i.call(this)}else this.bU(),this.dokIn()||(d.WDN.ResetChanges(this.rCW()),this.oWD=null),function(t,i){function o(t){if(n(t))return"null"==(t=y(t))?null:P(t,-1)}if(t&&i&&(t+=Z,i+=Z,t!=s.call(this)||i!=r.call(this))){for(var h=!0,a=new V.Arr,u=i.split(","),c=0,l=u.length;h&&c=0&&tn}});return e.len()>1?e:null}(n,s))&&(o.push(r),r.forEach(function(t){i.set(t,r)}))})}return i&&i.size?i:null},M.doExt=function(t,n){if(t){var i=new Map;if(t.forEach(function(t){var e=n.call(t);e&&i.set(t,new V.Arr(e))}),i.size)return i}return null},M.doWHovExt=function(t){return this.doExtRec(t,X.getHoverExtends)},M.getHovExt=function(t){return this.mWHovExt?this.mWHovExt.get(t):null},M.doWVisExt=function(t){return this.doExt(t,X.getVisibleExtends)},M.getVisExt=function(t){var n=null;return this.mWVisExt&&(n=this.mWVisExt.get(t)),n},M.isVisExt=function(t){function n(t){return t.isVisible()&&!t.IsMinRec()}var i=t.isVisible();if(i){var e=this.getVisExt(t);e&&(e.has(t)?(i=!1,e.forEachU(function(e){if(e!=t)return i|=n(e)})):e.forEachU(function(t){if(!(i=n(t)))return!0}))}return i},M.isVisibleRL=function(t){return this.isVisExt(t)||t.IsMinRec()},M.doWSizeExt=function(t){return this.doExtRec(t,X.getSizeExtends)},M.getSizeExt=function(t){return(this.mWSizeExt?this.mWSizeExt.get(t):null)||null},M.shareWSizeExt=function(t,n){if(n){t.lRLC++;var i=new V.Arr;n.forEach(function(t,n){if(!i.has(n)){var e=n.GetSize();t.forEach(function(t){n!==t&&n.onSizeExtTo(t,e)}),i.push(n,t)}}),--t.lRLC}},M.reqMinSize=function(){for(var t={width:0,height:0},n=this.root(),i=[n],e=this.mWP,r=0;r=n&&V.BOf(r)<=l)&&(s&&((r=V.NRt(r,p))||((r=p.slice())[3]=0)),e.set(t,r),p[1]+=n,p[3]-=n);break;case 2:var n;(r=p.slice())[3]=t.GetSize(),r[1]=p[1]+p[3]-r[3],n=(r=t.inflateClient(r))[3],(s||!o||p[3]>=n)&&(s&&((r=V.NRt(r,p))||((r=p.slice())[1]=V.BOf(p),r[3]=0)),e.set(t,r),p[3]-=r[3]);break;case 3:(r=p.slice())[2]=t.GetSize(),i=(r=t.inflateClient(r))[2],(s||!o||p[2]>=i&&V.ROf(r)<=f)&&(s&&((r=V.NRt(r,p))||((r=p.slice())[2]=0)),e.set(t,r),p[0]+=i,p[2]-=i);break;case 4:var i,r=p.slice();r[2]=t.GetSize(),r[0]=p[0]+p[2]-r[2],i=(r=t.inflateClient(r))[2],(s||!o||p[2]>=i)&&(s&&((r=V.NRt(r,p))||((r=p.slice())[0]=V.ROf(p),r[2]=0)),e.set(t,r),p[2]-=i);break;default:e.set(t,t.GetClient().slice())}p[2]=St(0,p[2]),p[3]=St(0,p[3]),e.get(t)&&c.get(t)&&u.push(t)}},this),r.set(d,p)}}switch(this.nRLCType){case 2:var C=new Map,S=new Map;e.forEach(function(t,n){t[2]>0&&t[3]>0&&V.NRt(i,t)&&C.set(n,t)},this),r.forEach(function(t,n){t[2]>0&&t[3]>0&&S.set(n,t)},this),e=C,r=S;break;case 3:var E=new Map;e.forEach(function(t,n){V.NRt(i,t)&&E.set(n,t)},this),e=E}this.oZ=function(t){var n,i;return this.rgWZOrd&&t.size&&(n=new m,this.rgWZOrd.forEach(function(e){e&&(i=t.get(e))&&n.push(e,i)},this)),n}.call(this,e),n.call(this,this.oZ),function(t){t&&t.forEach(function(n,i){n&&i.onZ(t.rgWData)})}.call(this,this.oZ),this.oPWA=function(t){var n;return t.size&&(n=new m,t.forEach(function(t,i){n.push(i,t)})),n}.call(this,r),this.mInv=null,this.onsize(this.oCW.opZ,this.oZ)}},M.w2Inv=function(t){this.mInv=this.mInv||new Map;var n=this.mInv.get(t);return i(n)&&this.mInv.set(t,n=function(t){var n,i,e=this.oZ;return e&&!V.EyR(i=e.get(t))&&((n=new m).cbkget=e.cbkget,e.forEach(function(t,e){!V.EyR(V.NRt(i,t))&&n.push(e,t)})),n&&n.len()&&n||null}.call(this,t)),n},M.visZ=function(){return this.oZ},M.hasZ=function(){return this.oZ&&this.oZ.forEachU(function(t){return!V.EyR(t)})},M.sZ=function(){this.osZ=null,this.oZ&&(this.osZ=this.oZ.copy(function(t){return t.slice()},this))},M.lZ=function(){this.onsize(this.osZ,this.oZ),this.osZ=null},M.onsize=function(t,n,i){if(function(t){return!t.lSiz||V.A.Rng(x)}(this.oCW)||i){this.oCW.lR++;var e=[],r=[],s=[];t&&t.forEach(function(t,i){n&&n.has(i)||e.push(i)}),n&&n.forEach(function(n,i){t&&t.has(i)||r.push(i)}),t&&n&&n.forEach(function(n,i){var e=t.get(i);e&&!V.EqR(n,e)&&s.push(i)}),e.forEach(function(n){n.onsize({old:t.get(n)})}),r.forEach(function(t){t.onsize({new:n.get(t)})}),s.forEach(function(i){i.onsize({old:t.get(i),new:n.get(i)})}),--this.oCW.lR}},M.toTree=function(){function t(n,i){var e,r,s=function(t){return t?t.GetIndex():null}(i);return n&&(e=n.get(i))&&(s+="(",r=!0,e.forEach(function(i){r||(s+=","),s+=t(n,i),r=!1}),s+=")"),s}return t(this.mWP,null)};var H=m.prototype;H.clear=function(){this.rgW.splice(0),this.rgWZOrd.clear(),this.rgWData.clear()},H.copy=function(t,n){var i=new m;return i.rgW=V.CpA(this.rgW),i.rgWZOrd=V.CpM(this.rgWZOrd),i.rgWData=V.CpM(this.rgWData,t,n||this),i},H.push=function(t,n){this.has(t)||(this.rgWZOrd.set(t,this.rgW.length),this.rgW.push(t)),this.rgWData.set(t,n)},H.set=function(t,n){this.has(t)&&this.rgWData.set(t,n)},H.indexOf=function(t){var n=this.rgWZOrd.get(t);return void 0!=n?n:-1},H.zorderOf=function(t){return this.indexOf(t)},H.has=function(t){return~this.indexOf(t)},H.get=function(t){var n=this.rgWData.get(t);return this.cbkget&&(n=this.cbkget.call(this,t,n)),n},H.forEach=function(t,n){for(var i,e=0,r=this.rgW.length;e=0;e--)t.call(n,this.get(i=this.rgW[e]),i,this)},H.rforEachU=function(t,n){for(var i,e=this.rgW.length-1;e>=0&&!t.call(n,this.get(i=this.rgW[e]),i,this);e--);},H.W=function(t){return t>=0&&t=0&&r>=0){for(var a,u=[],c=new V.Arr(e,s),o=0;o0&&this.isSplitable()},X.isLocked=function(){for(var t=this.GetLocked(),n=this;!t&&(n=n.opW);)t=n.GetLocked();return t},X.isSelectable=function(){return this.isEnabled()&&!this.isLocked()},X.isEnabled=function(){if(this.oCW.isEnabled()){for(var t=this.GetEnabled(),n=this;t&&(n=n.opW);)t=n.GetEnabled();return t}},X.isAP=function(t,n){return this.isEnabled()&&this==this.oCW.p2W(t,n)&&this.oCW.isAP(t,n)},X.isDisabled=function(){return!this.isEnabled()},X.GetVisible=function(){return this.bVis},X.SetVisible=function(t){this.bVis!=t&&(this.bVis=t,this.onUI())},X.getVisibleExtends=function(){return this.splitExtends(this.GetVisibleExtends(),!1)},X.getVisExt=function(){return this.oCW.getVisExt(this)},X.GetVisibleExtends=function(){return this.sVisExt},X.SetVisibleExtends=function(t){this.GetVisibleExtends()!=t&&(this.sVisExt=t,this.onUI())},X.GetEnabled=function(){return this.bE},X.SetEnabled=function(t){this.bE!=t&&(this.cTB=null,this.cTF=null,this.nTOq=null,this.bE=t)},X.isAllowKeys=function(){return this.isSelectable()&&this.GetAllowKeys()},X.GetAllowKeys=function(){return this.bAK},X.SetAllowKeys=function(t){this.bAK=t},X.GetResizable=function(){return this.bRsza},X.SetResizable=function(t){this.bRsza!=t&&(this.bRsza=t,this.onRLC())},X.GetLocked=function(){return this.bLkd},X.SetLocked=function(t){this.bLkd!=t&&(this.bLkd=t,this.onRLC())},X.GetDrawWindowFrame=function(){return this.bDWF},X.SetDrawWindowFrame=function(t){this.bDWF!=t&&(this.bDWF=t,this.onRLC())},X.GetBackground=function(){return this.cB},X.SetBackground=function(t){this.cTB=null,this.cB=t},X.GetForeground=function(){return this.cF},X.SetForeground=function(t){this.cTF=null,this.cF=t},X.GetHoverBackground=function(){return this.cHB},X.SetHoverBackground=function(t){this.cTB=null,this.cHB=t},X.GetHoverForeground=function(){return this.cHF},X.SetHoverForeground=function(t){this.cTF=null,this.cHF=t},X.isEmpty=function(){return!this.aXChg()&&!this.isResizable()&&(this.IsDockable()?this.getDockSize()<=0:this.client[2]<=0||this.client[3]<=0)},X.GetChildren=function(){return this.oCW.getChild(this)},X.IsMin=function(){return this.restoreClient&&V.EyR(this.client)&&this||null},X.IsMinRec=function(){return this.IsMin()||this.IsChildOfMin()},X.IsChildOfMin=function(){for(var t=null,n=this;!t&&(n=n.opW)&&!n.IsNone();)t=n.IsMin();return t},X.IsVisible=function(){return this.oCW.isVisible(this)},X.IsNone=function(){return!this.GetDock()},X.IsFill=function(){return 5==this.GetDock()},X.IsDockable=function(){return!this.IsNone()&&!this.IsFill()},S.AreDocksEquivalent=function(t,n){if(t!=n){if(0==t||0==n)return!1;if(5!=t&&5!=n)switch(t){case 3:case 4:switch(n){case 1:case 2:return!1}break;case 1:case 2:switch(n){case 3:case 4:return!1}}}return!0},X.rWN=function(){for(var t=this;t&&!t.IsNone();)t=t.opW;return t},X.isCWN=function(){return this.IsNone()&&this.oCW.opCW},S.GetXChgDockToggle=function(){return 6},X.GetDock=function(){return this.nDk},X.SetDock=function(t){if(this.GetDock()!=t){var n=this.GetSize();this.nDk=t,this.SetSize(n),this.onUI()}},X.ensCMin=function(t){if(t){var n=this.getMinSize(),i=St(n.width,t[2]);t[0]=V.ROf(t)-i,t[2]=i,t[3]=St(n.height,t[3])}return t},X.updCWN=function(t){var n,i=!1;return this.isCWN()&&(n=this.oCW.rCW().GetViewRect(),i=function(t,n){this.IsMin()&&(t=this.ensCMin(t));var i=V.ETo(this.oCW.canvas,t);return(i||n)&&this.oCW.Resize(),this.oCW.feC(function(t){t.SetCanvasRect&&t.SetCanvasRect.call(t)}),i}.call(this,V.ORt(this.GetClient(),n[0],n[1]),t)),i},X.refCWN=function(){return this.updCWN(!0)},X.SetClient=function(t){this.setClient(t),this.updCWN()},X.v2WC=function(t){var n,i,e,r,s=this.GetDock(),o=this.GetClient();if(u(t))r=St(0,D(t)),(n=1==s||2==s)?o[3]=r:(n=3==s||4==s)&&(o[2]=r);else if(n=h(t)&&(r=Et(4,t.length))){for(var a=0;a=64;e<64&&p!=e&&(p=e,s&&(d.cTB=s[e]),o&&(d.cTF=o[e]),l&&(d.nTOq=l[e]),d.nHov=e/63,r||d.onHovAttr()),r&&(d.nHov=null,d.xHov(),d.onHovAttr())}):this.hHov=setInterval(function(){var n=V.Tick(),i=Math.floor(St(0,n-v)/(t/64)),e=St(0,Et(i,63)),r=i>=64;e<64&&p!=e&&(p=e,s&&(d.cTB=s[e]),o&&(d.cTF=o[e]),l&&(d.nTOq=l[e]),d.nHov=e/63,r||d.onHovAttr()),r&&(d.nHov=null,d.xHov(),d.onHovAttr())},t/64)}},X.onHovI=function(){if(this.xHov(),this.hasHov()){var t=this.oCW.rCW().getHovDur(this);t?this.setHov(t,{Background:this.getHovBack(),Foreground:this.getHovFore(),Opacity:this.getHovOpaq(),ClearTransitionColors:!1}):(this.cTB=this.getHovBack(),this.cTF=this.getHovFore(),this.nTOq=this.getHovOpaq(),this.onHovAttr())}},X.onHovO=function(){if(this.xHov(),this.hasHov()){var t=this.oCW.rCW().getHovDur(this);t?this.setHov(t,{Background:this.isHovOver()?this.getBack():null,Foreground:this.getFore(),Opacity:this.getOpaq(),ClearTransitionColors:!0}):(this.cTB=null,this.cTF=null,this.nTOq=null,this.onHovAttr())}},X.GetCanvas=function(){return this.oCW.canvas},X.iLts=function(){var t=new V.Lts;t.add("onerase"),t.add("onpaint"),t.add("ondown"),t.add("onsize"),t.add("onexchange"),t.add("onexchangepos"),t.add("ondock"),t.add("ontoggle"),t.add("oncw"),t.add("onio"),t.add("onmousemove"),t.add("onmousedown"),t.add("onmouseup"),t.add("onmouseout"),t.add("onmouseover"),t.add("onpointermove"),t.add("onpointerdown"),t.add("onpointerup"),t.add("onpointercancel"),t.add("ontouchstart"),t.add("ontouchmove"),t.add("ontouchend"),t.add("ontouchcancel"),t.add("onwheel"),t.add("oncontextmenu"),t.add("onkeydown"),t.add("onkeyup"),t.add("onkeypress"),t.add("onhscroll"),t.add("onhclick"),t.add("onvscroll"),t.add("onvclick"),this.oLts=t},X.SetC=function(t){this.oC!=t&&(this.oC&&(this.oC._setcontrol_&&(this.oC.oW=this.oC._setcontrol_.oW,this.oC.oninv=this.oC._setcontrol_.oninv,this.oC.GetClientRect=this.oC._setcontrol_.GetClientRect,this.oC.GetCanvas=this.oC._setcontrol_.GetCanvas,this.oC._setcontrol_=null),this.oCW.oSts&&this.oC.udefSts&&this.oC.udefSts(this.oCW.oSts),this.oLts.removeAnyOf(this.oC),this.oC.dettach&&this.oC.dettach()),this.oC=t,this.oC&&(this.oC._setcontrol_={oW:this.oC.oW,oninv:this.oC.oninv,GetCanvas:this.oC.GetCanvas,GetClientRect:this.oC.GetClientRect},this.oC.oW=this,this.oC.oninv=function(t){this.oW.Inv()},this.oC.GetCanvas=function(){return this.oW.GetCanvas()},this.oC.GetClientRect=function(){var t=this.oW.GetClientRect();return t||(t=V.C2R(t)),t},this.oCW.oSts&&this.oC.defSts&&this.oC.defSts(this.oCW.oSts),this.oLts.add("onerase",this.oC),this.oLts.add("onpaint",this.oC),this.oLts.add("onsize",this.oC),this.oLts.add("onexchange",this.oC),this.oLts.add("onexchangepos",this.oC),this.oLts.add("ondock",this.oC),this.oLts.add("ontoggle",this.oC),this.oLts.add("oncw",this.oC),this.oLts.add("onio",this.oC),this.oLts.add("ondown",this.oC),this.oLts.add("onmousemove",this.oC),this.oLts.add("onmousedown",this.oC),this.oLts.add("onmouseup",this.oC),this.oLts.add("onmouseout",this.oC),this.oLts.add("onmouseover",this.oC),this.oLts.add("onpointerstart",this.oC),this.oLts.add("onpointermove",this.oC),this.oLts.add("onpointerend",this.oC),this.oLts.add("onpointercancel",this.oC),this.oLts.add("ontouchstart",this.oC),this.oLts.add("ontouchmove",this.oC),this.oLts.add("ontouchend",this.oC),this.oLts.add("ontouchcancel",this.oC),this.oLts.add("onwheel",this.oC),this.oLts.add("oncontextmenu",this.oC),this.oLts.add("onkeydown",this.oC),this.oLts.add("onkeyup",this.oC),this.oLts.add("onkeypress",this.oC),this.oLts.add("onhscroll",this.oC),this.oLts.add("onhclick",this.oC),this.oLts.add("onvscroll",this.oC),this.oLts.add("onvclick",this.oC),this.oC.attach&&this.oC.attach()))},X.GetC=function(){return this.oC},X.onRemove=function(){this.SetSBs(null,null),this.SetC(null)},X.gPtr=function(t){return this.oCW.gPtr(t)},X.onmouseover=function(t){return this.onHovI(),this.oLts.onmouseover.do(t)},X.onmouseout=function(t){return this.onHovO(),this.oLts.onmouseout.do(t)},X.onwheel=function(t){var n=this.oLts.onwheel.do(t);if(!n){var i=this.gPtr(t);if(i&&V.PInR(i.x,i.y,this.GetClientRect())){var e=this.vSBs(),r=e.length;if(r){var s=0;return V.IsModK(t)&&r>1&&s++,e[s].dowheel(t)}}}return n},"contextmenu,down,mousedown,mousemove,mouseup,pointerdown,pointermove,pointerup,pointercancel,touchstart,touchmove,touchend,touchcancel,keydown,keyup,keypress".split(",").forEach(function(t){!function(t,n){n[t=mt+t]=function(n){return this.oLts[t].do(n)}}(t,X)}),X.onsize=function(t){this.oLts.onsize.do(t)},X.onexchange=function(t){return!this.oLts.onexchange.do(t)},X.onexchangepos=function(t){return!this.oLts.onexchangepos.do(t)},X.ondock=function(t,n){return!this.oLts.ondock.do({parent:t,dock:n})},X.ontoggle=function(){return!this.oLts.ontoggle.do()},X.oncw=function(t){this.oLts.oncw.do(t),this.oCW=t},X.onio=function(t){this.oLts.onio.do(!!t)},X.onlayout=function(t){var n;!t.IsSave()&&(this.restoreClient=null),t.Layout(this,S.Options.Layout),(n=this.oC)&&n.onlayout&&(t.pCtx("c"),n.onlayout.call(n,t),t.rCtx())},X.toSB=function(t){if(t){if(!(t instanceof V.SB)){var n=this.oCW.W(t);n&&(t=n.oC)}t=t instanceof V.SB&&t||null}return t},X.GetHS=function(){return this.oHS},X.SetHS=function(t){t=this.toSB(t),this.oHS!=t&&(this.oHS&&(this.oHS.oLts.removeAnyOf(this),this.oHS=null),t&&(this.oHS=t,this.oHS.ResetRange(),this.oHS.oLts.add("onchange",this,"onhscroll"),this.oHS.oLts.add("onclickingpart",this,"onhclick")),this.oCW.onASBs(this))},X.GetVS=function(){return this.oVS},X.SetVS=function(t){t=this.toSB(t),this.oVS!=t&&(this.oVS&&(this.oVS.oLts.removeAnyOf(this),this.oVS=null),t&&(this.oVS=t,this.oVS.ResetRange(),this.oVS.oLts.add("onchange",this,"onvscroll"),this.oVS.oLts.add("onclickingpart",this,"onvclick")),this.oCW.onASBs(this))},X.onExtSBs=function(t){var i=this.sExtSBS;if(n(i)){var e=this.splitExtends(i);e&&e.forEach(function(n){n.SetOpacity(t?0:null),n.SetHoverOpacity(t?1:null)},this),this.SetExtends(t?i:null)}},X.onMinSBs=function(t){this.GetSBs().forEach(function(n){var i,e;t?(i=V.Def.ScrollBar.min,n.oMinSBS||(n.oMinSBS=V.Cpy(n.oO),(e=A(n.oW))&&(n.oMinSBS.size=e.GetSize(),e.SetSize(8)))):n.oMinSBS&&(i=n.oMinSBS,(e=A(n.oW))&&e.SetSize(n.oMinSBS.size),n.oMinSBS=null,n.nHideSBS=null),n.SetOptions(i)})},X.onHidSBs=function(t){this.GetSBs().forEach(function(i){var r;t?e(i.nHideSBS)&&(r=A(i.oW))&&(i.nHideSBS=r.GetSize(),r.SetSize(0)):n(i.nHideSBS)&&((r=A(i.oW))&&r.SetSize(i.nHideSBS),i.oMinSBS=null,i.nHideSBS=null)})},X.rqbSB=function(){return this.sHS||this.sVS},X.bSBs=function(){return this.sHS&&(this.SetHS(this.sHS),this.oHS&&(this.sHS=null)),this.sVS&&(this.SetVS(this.sVS),this.oVS&&(this.sVS=null)),!this.rqbSB()},X.SetSBs=function(t,n){this.SetHS(t),this.SetVS(n)},X.SetSB=function(t,n){this[t?"SetHS":"SetVS"].call(this,n)},X.GetSB=function(t){return t?this.GetHS():this.GetVS()},X.GetSBs=function(){var t,n=[];return(t=this.GetSB(!1))&&n.push(t),(t=this.GetSB(!0))&&n.push(t),n},X.vSBs=function(){function t(t){t&&t.isPsbl()&&t.visW()&&t.isSelectable()&&n.push(t)}var n=[];return t(this.GetSB(!1)),t(this.GetSB(!0)),n},X.GetSP=function(t){var n=this.GetSB(t);return n&&n.visW()&&n.GetPos()||0},X.SetSP=function(t,n){var i=this.GetSB(t);i&&i.SetPos(n)},X.GetScroll=function(){return{x:this.GetSP(!0),y:this.GetSP(!1)}},X.SetScroll=function(t){t&&("x"in t&&this.SetSP(!0,t.x),"y"in t&&this.SetSP(!1,t.y))},X.GetSI=function(t){var n=this.GetSB(t),i=null;return n&&(i=n.GetInfo())&&(i.pos=this.GetSP(t)),i},X.SetSI=function(t,n){function i(t,n){var i=0;return t&&t.isSP()&&(i+=1),n&&n.isSP()&&(i+=2),i}var e,r=this.GetHS(),s=r&&t,o=this.GetVS(),h=o&&n;(s||h)&&(e=i(r,o),s&&r.SetInfo(t),h&&o.SetInfo(n),e!=i(r,o)&&this.oCW.Refresh((s||h)&&!(s&&h)))},X.Scroll=function(t,n){var i,e=V.SB.K2A.get(E(y(O(t))));e&&(1==(i=P(e.m))?[this.oHS]:2==i?[this.oVS]:[this.oHS,this.oVS]).forEach(function(t){t&&t.Scroll(e.a,n)})},X.toEVP=function(t,n,i){var e=null;if(t){n=n||0;var r=V.IRt(this.GetClientRect(),-n,-n),a=h(t),u=0,c=0;if("x"in t||a){var l=s(t),f=r[0];if(lg&&(u=l-g)}}if("y"in t||a){var d=o(t),v=r[1];if(dp&&(c=d-p)}}(u||c)&&(i=i||1,e={},u&&(e.x=this.GetSP(!0)+u/i),c&&(e.y=this.GetSP(!1)+c/i))}return e},X.EVP=function(t,i,e){var r=this.toEVP(t,i,e);return r&&this.SetScroll(r),n(r)},X.toEVR=function(t,n,i,e){var r=null;if(t){var s=n||this.GetClientRect(),o=t[0]-s[0],h=V.ROf(t)-V.ROf(s),a=t[1]-s[1],u=V.BOf(t)-V.BOf(s);e&&t[2]>s[2]&&At(h)0&&(o=h>0?Et(o,h):0),e&&t[3]>s[3]&&At(u)0&&(a=u>0?Et(a,u):0),(o||a)&&(i=i||1,r={},o&&(r.x=this.GetSP(!0)+o/i),a&&(r.y=this.GetSP(!1)+a/i))}return r},X.SSw=function(t){var n=this.oCW;this.GetSBs().forEach(function(i){i.Swipe(t,!0,n?function(t,i){n.bR(),t.SetPos(i),n.eR()}:null,i)})},X.onhscroll=function(t){this.oLts.onhscroll.do(this.GetSP(!0)),this.Inv()},X.onhclick=function(t){return this.oLts.onhclick.do(t)},X.onvscroll=function(t){this.oLts.onvscroll.do(this.GetSP(!1)),this.Inv()},X.onvclick=function(t){return this.oLts.onvclick.do(t)},X.Smooth=function(t,n){function i(t){s.Render(t.oWRend)}function e(t){o.forEach(function(n){n.lR+=t})}if(t){(n=n||{}).name=n.name||"smth-w"+V.Rand(),n.onXDoL=n.onXDoL||!1,n.thisArg=n.thisArg||this,n.size=W(n.size,!0),n.cbkR=n.cbkR||i;var r,s=this.oCW,o=s.CWs(),h={oW:this,oZ:s.WL().oZ||null,oNewZ:null,rgWFT:new V.M1,oWRend:null,progress:0};s.lR++,s.lRLC++,e(1),t.call(n.thisArg),e(-1),--s.lRLC,s.lPR++,s.onUI(),setTimeout(function(){--s.lPR}),h.oNewZ=s.WL().oZ||null,h.rgWFT=V.M1.prototype.smooth.call(h.oZ,h.oNewZ);var a,u=!(!h.oNewZ||!h.rgWFT.len()),c=u&&n.size;h.oWRend=!u&&this||null,V.A.Cancel(n.name),V.A.Progress(function(t){h.progress=t,(a=1==t)&&u&&(s.onUI(),s.rXChg(),h.oNewZ=s.WL().oZ,c=!0),s.lPR++,c&&s.WL().onsize(h.oZ,h.oNewZ,!0),s.CWs().forEach(function(t){t!=s&&t.Render()}),n.cbkR.call(n.thisArg,h),a&&n.cbkR!=i&&i.call(n.thisArg,h),--s.lPR},n,function(t,i){switch(i){case-1:s.lHovWC(),n.onXDoL&&s.lE++,n.cbkI&&n.cbkI.call(n.thisArg,h),u&&(h.oNewZ.cbkget=function(t,n){var i=h.rgWFT.get(t);return i&&V.R.Rect(h.progress,null,i)||n}),--s.lR;break;case-6:n.cbkT&&n.cbkT.call(n.thisArg,h),n.onXDoL&&--s.lE,s.uHovWC(),(r=s.gAO())&&r.refresh()}})}},{CC:t,CW:d,WS:m,W:S}}()),V.Mrg(V,function(){function t(t){return t?0:1}function i(t){return t?2:3}function r(t){return t?"horizonalOverlayShapes":"verticalOverlayShapes"}function h(t){return t?"horizonalShapes":"verticalShapes"}function a(t,n){return"sb"+(n?"c":"h")+t}function u(t,n){this.lI=this.nV=this.nmV=0,this.nMV=100,this.iLts(),this.oO=V.Cpy(u.Options),this.SetClientRect(t),this.SetOptions(n||l,!0),V.CC.GetCanvas(t)&&this.SetCanvas(t),V.DPR.Reg(this)}var c,l=V.Def.ScrollBar;return c=u.prototype,u.version="3.0",u.type="ScrollBar",u.ModeEnum={exAuto:-1,exVertical:0,exHorizontal:1},u.PartEnum={exLeftB1Part:32768,exLeftB2Part:16384,exLeftB3Part:8192,exLeftB4Part:4096,exLeftB5Part:2048,exLeftBPart:1024,exLowerBackPart:512,exThumbPart:256,exUpperBackPart:128,exBackgroundPart:640,exRightBPart:64,exRightB1Part:32,exRightB2Part:16,exRightB3Part:8,exRightB4Part:4,exRightB5Part:2,exRightB6Part:1,exPartNone:0},u.ActionEnum={exLineUp:0,exLineLeft:0,exLineDown:1,exLineRight:1,exPageUp:2,exPageLeft:2,exPageDown:3,exPageRight:3,exThumbPos:4,exThumbTrack:5,exScrollTop:6,exScrollLeft:6,exScrollHome:6,exScrollBottom:7,exScrollRight:7,exScrollEnd:7},u.K2A=function(){var t=new Map;return V.B.split("home[v](6),end[v](7),prior[v](2),pageup[v](2),next[v](3),pagedown[v](3),up[v](0),arrowup[v](0),down[v](1),arrowdown[v](1),left[h](0),arrowleft[h](0),right[h](1),arrowright[h](1)").forEach(function(n){t.set(n.caption,{a:~~n.subText,m:n.flags?n.flags.has("h")?1:n.flags.has("v")?2:0:0})}),t}(),u.DisableNoScrollEnum={exHideNoScroll:0,exDisableNoScroll:1,exShowNoScroll:2},u.Options={tfi:null,locked:null,readOnly:null,mode:-1,adjustThumbPos:!1,allowKeys:null,allowScrollDirect:null,buttonSize:null,thumbSize:null,ignoreLargeChange:null,disableNoScroll:null,orderParts:null,visibleParts:null,enableParts:null,horizonalShapes:null,verticalShapes:null,horizonalOverlayShapes:null,verticalOverlayShapes:null,cursors:null,smallChange:null,largeChange:null,wheelChange:null,value:0,min:0,max:100},u.Parts=function(){function t(t){var i;return n(t)&&(i=o.get(E(y(t.toString())))),i}function i(r,s){function o(t,i){var e=!1;return n(t)&&(i?e=!0:t&&0==(640&t)&&(e=!0)),e}var h,a=new V.Arr,c=e(s),l=u.PartEnum;if((r||Z).split(",").forEach(function(n){o(h=t(n),c)&&a.add(h)}),!c){i(s).forEach(function(n){o(h=t(n),c)&&a.add(bDefaultPart)});for(var f in l)o(h=l[f],c)&&a.add(h)}return a}function r(t){return o.getKey(t)||Z}function s(t){var n,e=new Map;return(t=y(t||Z))&&t.splitP(",").forEach(function(t){if(n=function(t){var n=null;if(t=y(t)){var i=T(t,"(");if(i>=0){var e=t.length-(i+1);")"==t.charAt(t.length-1)&&e--,n={shape:b(t,0,i),parts:b(t,i+1,e)}}}return n}(t)){var r=n.shape;i(n.parts).forEach(function(t){e.set(t,r)})}}),e}for(var o=new V.BiM,h=u.PartEnum,a=1;a<=5;a++)o.set("l"+a,h["exLeftB"+a+"Part"]);o.set("l",1024),o.set("t",256),o.set("r",64);for(a=1;a<=6;a++)o.set("r"+a,h["exRightB"+a+"Part"]);o.set("lo",512),o.set("b",640),o.set("up",128);return{Str2Part:t,Part2Str:r,ToOrder:i,ToFlags:function(t){var n=0;return i(t).forEach(function(t){n|=t}),n},Flags2Str:function(t){var n=Z;return t&&o.forEach(function(i,e){i==(t&i)&&(n+=(n?",":Z)+e)}),n},Parts2Str:function(t){var n=Z;return t&&t.forEach(function(t){t&&(n&&(n+=","),n+=r(t))}),n},Str2Shp:s}}(),u.addProto=function(t,n,i){n=n||c,O(i,"onsize,onpaint,oninv,oncw,W,gCW,inv,gCtx,gPtr,visW,isVisible,isSelectable,isEnabled,isLocked,isAP,invAO,rfhAO,setAO,resAO,drawAO,visAO,gAO").split(",").forEach(function(i){t[i]=n[i]})},c.Refresh=function(){this.inv()},c.GetOptions=function(){return this.oO},c.SetOptions=function(t,i){var e=!1;if(t){var r=[],s=this.GetOptions();if(s){for(var o in s){var h=t[o];n(h)&&(r.push(o),s[o]!==h&&(s[o]=V.CpV(h)))}if(i)for(var o in t)o in s||(s[o]=V.CpV(t[o]));(e=r.length)&&(this.bU(),r.forEach(function(t){var n=V.setM(t);n in this&&this[n].call(this,s[t])},this),this.eU())}}return e},c.GetCanvas=function(){return this.canvas},c.SetCanvas=function(){function t(t,n){this.udefSts(this.oSts),this.oSts=null,this.resAO(),t=V.CC.GetCanvas(t),!n&&V.CC.SetCanvas(this,t),this.canvas=t,V.CC.GetCanvas(this.canvas)&&this.defSts(this.Shortcuts=this.oSts=new V.Sts),this.rfhAO()}(V.ComboBox?V.ComboBox.implExHost(t,"onchange"):t).apply(this,arguments)},c.dCBl=function(t,n,i){i.oO.label=this.GetValue()},c.cCB=function(t){return this.isLocked()||this.GetCanvas()!=t.target},c.sCB=function(t){return t&&this.SetValue(this.GetMin()),this.GetValue()},c.SetClientRect=function(t){var n=V.CC.GetCanvas(t);n&&(t=[0,0,n.width,n.height]),this.client=V.C2R(t),!this.visAO()&&this.resAO(),this.onRL(!1)},c.GetClientRect=function(){return this.client.slice()},c.inv=function(t){V.CC.invC(this,t)},c.BeginUpdate=function(){this.lI++||(this.oInfoI=this.GetInfo())},c.bU=c.BeginUpdate,c.EndUpdate=function(){if(!--this.lI){var t,n=this.oInfoI,i=!n;if(i||(t=this.GetInfo(),i=n.pos!=t.pos||n.page!=t.page||n.range!=t.range),i)if(this.oW&&this.oW.oCW.lI){var e=this;clearTimeout(this.hRAO),this.hRAO=setTimeout(function(){e.rfhAO()})}else this.rfhAO();this.oInfoI=null}},c.eU=c.EndUpdate,c.Update=function(t,n){this.bU(),t&&t.call(n||this),this.eU()},c.invAO=function(t){this.resAO(),this.inv(t)},c.rfhAO=function(t){this.inv(t);var n=this.gAO();n&&n.refresh()},c.onpaint=function(t){!this.lI&&V.H.StoreA(this,function(){V.pCTX(t,function(){var n=V.TFI.bCTX(t,this.getTfi()),i=this.isSelectable();!i&&V.H.lA++,this.setAO(t),this.draw(t,this.GetClientRect()),!i&&--V.H.lA,V.TFI.eCTX(t,n)},this)})},c.oninv=function(t){t&&this.onpaint(t)},c.gCtx=function(){var t=this.GetCanvas();return t&&t.getContext("2d")},c.gAO=function(){var t=this.gCtx();return t&&t.gAO()},c.visAO=function(){return this.isVisible()},c.isSelectable=function(){return this.isEnabled()&&!this.isLocked()},c.setAO=function(t){if(this.visAO()){var n,i=!0;this.oEF?n=this.oEF.oAO:(n=t.gAO())&&(i=!1,!n.lU&&this.onSetAO(n),n.hasOf(this)&&n.onDrawAO(this.drawAO,this)),i&&this.drawAO(t,n)}else this.resAO()},c.drawAO=function(t,n){},c.resAO=function(){var t=this.gAO();t&&t.remove(this,null)},c.W=function(){return this.oW||this.oCW},c.gCW=function(){var t=this.W();return t&&t.oCW||t},c.visW=function(){return!this.W()||this.W().isVisible()},c.isVisible=function(){return this.visW()&&!V.EyR(this.GetClientRect())},c.isEnabled=function(){return!this.W()||this.W().isEnabled()},c.isLocked=function(){var t=this.W();return this.getLocked&&this.getLocked()||t&&t.isLocked()},c.isAP=function(t,n){return this.isEnabled()&&!this.W()||this.W().isAP(t,n)},c.gPtr=function(t){return V.e2P(t)},c.onmousemove=function(t){var n,i=this.hitTest(this.gPtr(t));return i&&i.cursor&&(n=this.GetCanvas())&&(n.style.cursor=i.cursor),i},c.onwheel=function(t){if(this.isSelectable()){var n=this.gPtr(t);if(n&&V.PInR(n.x,n.y,this.GetClientRect()))return this.dowheel(t)}},c.dowheel=function(t){var n,i,e=this.getWheelChange();return e>0&&(n=V.WhelInc(t))&&(V.AO.tlA(this.gAO(),!0),i=this.SetValue(this.GetValue()-n*e),V.AO.tlA(this.gAO(),!1)),i},c.ondown=function(t){var n=this.hitTest(this.gPtr(t));if(n)return n.callback&&n.callback.call(n.thisArg,t,n),!0},c.onkeydown=function(t){this.onkey(t,-1)},c.onkeyup=function(t){this.onkey(t,0)},c.onkeypress=function(t){this.onkey(t,1)},c.onkey=function(t,n){this.oSts&&this.oSts.onkey(t,n),function(t,n){if(this.getAllowKeys())switch(n){case-1:var i,e,r=u.ActionEnum,s=V.K.ToSt(t);s&&!V.K.IsModK(s)&&V.Like.Match(e=V.K.St2Str(s),"Arrow* Page* Home End")&&(i="ex"+(i=(i=(i=(i=e).replace("Arrow","Line")).replace("Home","ScrollHome")).replace("End","ScrollEnd")))in r&&this.Scroll(r[i])}}.call(this,t,n)},c.onsize=function(t){this.SetClientRect(t.new)},c.oncw=function(t){this.resAO()},c.udefSts=function(t){t&&t.RemoveOf(this)},c.defSts=function(t){},c.p2Val=function(n){var e,r,h,a=this.cltBk,u=this.GetMinValue();return a&&(e=this.isH(),r=this.getThumbRect(),h=e?s(n):o(n),r&&(h-=r[i(e)]/2),h-=a[t(e)],u=this.off2V(h)),u},c.p2P=function(t){var n=this.getPartsRect();return n&&n.p2O(s(t),o(t))||null},c.hitTest=function(t){var n,i;return t&&this.isSelectable()&&(i=this.p2P(t))&&this.isEnablePart(i)&&(n={cursor:this.getCursorPart(i),code:i,callback:function(t,n){this.onHTDown(n.code,t)},thisArg:this}),n},c.onHTDown=function(t,n){this.onPartDown(t,n)},c.onPartDown=function(n,e){function r(n,e){V.RUC(e,function(e,r){if(this.isEnablePart(n)){if(!this.onClickingPart(n)){switch(n){case 1024:this.Scroll(0);break;case 64:this.Scroll(1);break;case 512:case 128:var s=!0,o=512==n,h=this.getThumbRect(),a=this.gPtr(e);if(a&&h){var u=this.isH(),c=i(u),l=t(u),f=u?a.x:a.y;s=o?h[l]>f:h[l]+h[c]0?St(0,Et(t,this.GetRange()-s)):-Et(-t,s)),(o=0!=t)&&(e=e||this,!i&&(i=function(t,n){t.SetPos(n)}),(n=n||l.Swipe).duration?V.A.Progress(function(n){i.call(e,this,s+~~(n*t))},{thisArg:this,name:r,duration:n.duration,transition:n.transition,onXDoL:!1}):i.call(e,this,s+t))),o},c.smthTo=function(t,n){return this.smthBy(t-this.GetValue(),n)},c.onClickingPart=function(t){return this.onclickingpart(t)},c.onclickingpart=function(t){return this.oLts.onclickingpart.do(t)},c.onClickPart=function(t){this.onclickpart(t)},c.onclickpart=function(t){this.oLts.onclickpart.do(t)},c.onSetAO=function(t){var n,i=this.getPartsRect();i&&i.forEach(function(i,e){!t.has(this,n=a(e))&&t.set({owner:this,id:n,inv:this.inv,hitTest:function(t,n,i){return this.isAP(t,n)&&this.isEnablePart(i.part)&&V.PInR(t,n,i.owner.p2rt(i.part))},duration:V.Def.A.duration,part:e}),!t.has(this,n=a(e,!0))&&t.set({owner:this,id:n,inv:this.inv,hitTest:function(t,n,i){return this.isAP(t,n)&&this.isEnablePart(i.part)&&V.PInR(t,n,i.owner.p2rt(i.part))},actOn:4,duration:0,part:e})},this)},c.onRL=function(t){(t||e(t))&&this.resAO(),this.cltBk=null,this.rgVisP=null},c.draw=function(t,n,i){var e=this.getPartsRect(),r=t.gAO();e&&e.forEach(function(n,i){this.drawP(t,i,n,r)},this)},c.getShapePart=function(t){var n,i=this.getShapeParts(this.isH());return i&&(n=i.get(t)),n},c.getOverlayShapePart=function(t){var n,i=this.getOverlayShapeParts(this.isH());return i&&(n=i.get(t)),n},c.getStateShapes=function(t,i){var e,r={normal:{},disabled:{},hover:{},click:{}};if(n(t)&&(e=V.S.Get(i,"ScrollBar"))){for(var s in r){var o,h,a,u=r[s];t&&t in e&&(h=e[t])&&s in h&&(a=h[s])&&(o=a),o&&V.DfO(u,o)}V.DfO(r.disabled,r.normal),V.DfO(r.hover,r.normal),V.DfO(r.click,r.hover)}return r},c.drawP=function(t,n,i,e){function r(r,s,h,u){var c,l=s.normal;o?l=s.disabled||l:e&&(V.EyO(s.hover)||(c=e.get(r,a(n)))&&(l=V.R.Shape(c.state,c.range,{from:l,to:s.hover})),V.EyO(s.click)||(c=e.get(r,a(n,!0)))&&(l=V.R.Shape(c.state,c.range,{from:l,to:s.click}))),t.drawShape(i,l,{text:h,formatText:u})}var s,o=!(this.isSelectable()&&this.isEnablePart(n));V.EyR(i)||(s=this.getShapePart(n),r(this,this.getStateShapes(s,"background"),this.GetCaptionPart(n),262149),r(this,this.getStateShapes(s,"foreground")),r(this,this.getStateShapes(this.getOverlayShapePart(n),"overlay")))},c.GetOrderParts=function(){return u.Parts.Parts2Str(this.getOrderParts())},c.SetOrderParts=function(t){this.oO.orderParts=t,this.rgOrdP=null,this.onRL()},c.getOrderParts=function(){if(!this.rgOrdP){var t=this.oO.orderParts,i=l.orderParts;this.rgOrdP=u.Parts.ToOrder(n(t)?t:i,i)}return this.rgOrdP},c.GetShapeParts=function(t){return this.oO[h(t)]},c.GetShapePart=function(t,n){var i=Z,e=this.getShapeParts(t);return e&&(i=e.get(n)),i||Z},c.SetShapeParts=function(t,n){this.oO[h(t)]=n,this.setShapeParts(t,null),this.onRL()},c.SetHorizonalShapes=function(t){this.SetShapeParts(!0,t)},c.SetVerticalShapes=function(t){this.SetShapeParts(!1,t)},c.SetShapePart=function(t,n,i){if(n){var e=this.getShapeParts(t)||new Map;e.set(n,i),this.setShapeParts(t,e),this.onRL()}},c.getShapeParts=function(t){var i,e,r=t?this.mHShpP:this.mVShpP;return r||(r=u.Parts.Str2Shp(l[h(t)]),n(i=this.GetShapeParts(t))&&(e=u.Parts.Str2Shp(i),r?e&&e.forEach(function(t,n){r.set(n,t)},this):r=e),this.setShapeParts(t,r)),r},c.setShapeParts=function(t,n){this[t?"mHShpP":"mVShpP"]=n},c.GetOverlayShapeParts=function(t){return this.oO[r(t)]},c.GetOverlayShapePart=function(t,n){var i=Z,e=this.getOverlayShapeParts(t);return e&&(i=e.get(n)),i||Z},c.SetOverlayShapeParts=function(t,n){this.oO[r(t)]=n,this.setOverlayShapeParts(t,null),this.onRL()},c.SetHorizonalOverlayShapes=function(t){this.SetOverlayShapeParts(!0,t)},c.SetVerticalOverlayShapes=function(t){this.SetOverlayShapeParts(!1,t)},c.SetOverlayShapePart=function(t,n,i){if(n){var e=this.getOverlayShapeParts(t)||new Map;e.set(n,i),this.setOverlayShapeParts(t,e),this.onRL()}},c.getOverlayShapeParts=function(t){var i,e,s=t?this.mHOShpP:this.mVOShpP;return s||(s=u.Parts.Str2Shp(l[r(t)]),n(i=this.GetOverlayShapeParts(t))&&(e=u.Parts.Str2Shp(i),s?e&&e.forEach(function(t,n){s.set(n,t)},this):s=e),this.setOverlayShapeParts(t,s)),s},c.setOverlayShapeParts=function(t,n){t?this.mHOShpP=n:this.mVOShpP=n},c.GetVisibleParts=function(){return u.Parts.Flags2Str(this.getVisibleParts())},c.GetVisiblePart=function(t){return(this.getVisibleParts()&t)==t},c.SetVisibleParts=function(t){this.oO.visibleParts=t,this.nVisP=null,this.onRL()},c.SetVisiblePart=function(t,n){if(t){var i=this.getVisibleParts();n?i|=t:i&=~t,this.nVisP=i,this.onRL()}},c.getVisibleParts=function(){if(e(this.nVisP)){var t=this.oO.visibleParts;this.nVisP=u.Parts.ToFlags(n(t)?t:l.visibleParts)}return this.nVisP},c.isVisPart=function(t){var n,i=this.GetVisiblePart(t);if(i){if(1&(n=this.getDisableNoScroll()))switch(t){case 256:i=this.isEnablePart(1024)||this.isEnablePart(64)}if(2&n)switch(t){case 512:case 128:case 640:case 256:i=this.isPsbl()}}return i},c.GetEnableParts=function(){return u.Parts.Flags2Str(this.getEnableParts())},c.GetEnablePart=function(t){return(this.getEnableParts()&t)==t},c.SetEnableParts=function(t){this.oO.enableParts=t,this.nEnbP=null,this.onRL()},c.SetEnablePart=function(t,n){if(t){var i=this.getEnableParts();n?i|=t:i&=~t,this.nEnbP=i,this.onRL()}},c.getEnableParts=function(){if(e(this.nEnbP)){var t=this.oO.enableParts;this.nEnbP=u.Parts.ToFlags(n(t)?t:l.enableParts)}return this.nEnbP},c.isEnablePart=function(t){var n=this.isEnabled()&&this.GetEnablePart(t);if(n&&1&this.getDisableNoScroll())switch(t){case 512:case 128:case 640:return this.isEnablePart(1024)||this.isEnablePart(64);case 1024:n=this.GetValue()>this.GetMinValue();break;case 64:n=this.GetValue()0},c.isSP=function(){return 2&this.getDisableNoScroll()||this.isPsbl()},c.GetRange=function(){return this.GetMaxValue()-this.GetMinValue()},c.SetRange=function(t){this.SetMaxValue(this.GetMinValue()+D(t))},c.ResetRange=function(){this.SetRange(0)},c.GetTfi=function(){return this.oO.tfi},c.SetTfi=function(t){this.bU(),this.oO.tfi=t||null,this.onRL(),this.eU()},c.getTfi=function(){return this.GetTfi()||l.tfi},c.GetLocked=function(){return this.oO.locked},c.SetLocked=function(t){this.GetLocked()!=t&&(this.bU(),this.oO.locked=t,this.onRL(),this.oInfoI=null,this.eU())},c.getLocked=function(){return W(this.GetLocked(),l.locked)},c.GetReadOnly=function(){return this.oO.readOnly},c.SetReadOnly=function(t){this.GetReadOnly()!=t&&(this.bU(),this.oO.readOnly=t,this.onRL(),this.oInfoI=null,this.eU())},c.isReadOnly=function(){return W(this.GetReadOnly(),l.readOnly)},c.adjV=function(t){return Et(this.GetMaxRange(),St(this.GetMinValue(),D(t)))},c.updateLargeChange=function(t){return this.getIgnoreLargeChange()?St(0,t):St(0,Et(this.GetRange(),t))},c.onChanging=function(t,n){var i={old:t,new:n};return this.onchanging(i),i.new},c.onchanging=function(t){this.oLts.onchanging.do(t)},c.onChange=function(){this.updBk(),this.onchange(this.GetValue())},c.onchange=function(t){this.oLts.onchange.do(t)},c.updBk=function(){var e=this.isH(),r=this.cltBk;if(r){var s=i(e),o=t(e),h=r.slice(),a=this.GetScrollRange();if(a>0){var u=this.GetRange(),c=St(1,Et(u,this.GetLargeChange()))/(u+1),l=this.getThumbSize(),f=h[s],g=Et(f,l<0?St(8,c*f):l),d=(this.GetValue()-this.GetMinValue())/a,v=this.getThumbPos();n(v)?d=St(0,Et(f-g,v)):d*=f-g,h[o]+=d,h[s]=g}if(this.isVisPart(512)){var p=this.cltBk.slice();p[s]=h[o]-this.cltBk[o],this.rgVisP.push(512,p)}if(this.isVisPart(128)){var C=h.slice();C[o]+=h[s],C[s]=this.cltBk[o]+this.cltBk[s]-(h[o]+h[s]),this.rgVisP.push(128,C)}this.isVisPart(256)&&this.rgVisP.push(256,h)}},c.getPartsRect=function(){var n,e,r,s,o,h,a,u,c,l,f=this.rgVisP,g=0;if(!f){if((n=this.getOrderParts())&&(e=this.GetClientRect(),n.forEach(function(t){this.isVisPart(t)&&g++},this),g>0)){f=new V.M1,s=this.isH(),r=this.getButtonSize(),s?(o=e[2],g*rc;v--)if(this.isVisPart(p=n.item(v))){var C=e.slice();e[a]-=r,C[u]=e[u]+e[a],C[a]=r,f.push(p,C)}this.cltBk=e,this.isVisPart(640)&&f.push(640,e)}this.rgVisP=f,this.updBk()}return this.rgVisP},c.p2rt=function(t){var n,i=this.getPartsRect();return i&&(n=i.get(t))&&(n=n.slice()),n},c.Scroll=function(t,n){var i,e=l.SmoothScroll,r=P(n,1);switch(t){case 0:i=this.SetValue(this.GetValue()-r*this.GetSmallChange());break;case 1:i=this.SetValue(this.GetValue()+r*this.GetSmallChange());break;case 2:i=this.smthBy(-this.GetLargeChange(),e);break;case 3:i=this.smthBy(+this.GetLargeChange(),e);break;case 4:i=this.getScrollOnThumbRelease()?this.SetValue(n):this.smthTo(n,e);break;case 5:this.getScrollOnThumbRelease()||(i=this.SetValue(n));break;case 6:i=this.smthTo(this.GetMinValue(),e);break;case 7:i=this.smthTo(this.GetMaxValue(),e)}return!!i},c.GetAllowKeys=function(){return this.oO.allowKeys},c.SetAllowKeys=function(t){this.oO.allowKeys=t,this.bAK=null},c.getAllowKeys=function(){if(this.isSelectable()){if(e(this.bAK)){var t=this.GetAllowKeys();e(t)&&(t=l.allowKeys),this.bAK=W(t)}return this.bAK}},c.GetAllowScrollDirect=function(){return this.oO.allowScrollDirect},c.SetAllowScrollDirect=function(t){this.oO.allowScrollDirect=t,this.nAlwSD=null},c.getAllowScrollDirect=function(){if(e(this.nAlwSD)){var t=this.GetAllowScrollDirect();e(t)&&(t=l.allowScrollDirect),this.nAlwSD=~~t}return this.nAlwSD},c.getThumbRect=function(){return this.p2rt(256)},c.off2V=function(t){var n=this.GetMinValue(),e=n;if(this.cltBk){var r,s=i(this.isH()),o=this.cltBk[s],h=this.GetMaxRange();o&&t>0&&((r=this.getThumbRect())&&(o-=r[s]),e=t0&&(o=setTimeout(function(){t()},c.ttP)),i=V.CC.c2CC(r.GetRelative()))){e={onwheel:i.onwheel,ondown:i.ondown};for(var s in e)i[s]=function(){return t(),e&&e[s].apply(this,arguments)}}}if(u&&c&&c.ttP){var f=n(c.ttO)&&c.ttO==h;f&&a++,t(),f&&a--,h=c.ttO,c.ttD?s=setTimeout(function(){l()},c.ttD):l()}},Hide:t}}(),V.UR=function(){function t(t){return t instanceof Array}function i(t){return t instanceof Function}function e(n){if(t(n))return n.feU=function(t,n,i){i=i||this;var e;if(t)for(r=this.length-1;!e&&r>=0;r--)e=n.call(i,this[r],r);else for(var r=0,s=this.length;!e&&r0&&this.x(this.lQ),this.nC=this.length,this.onundoredo(32))}this.oB=null}},a.cB=function(){this.oB&&(this.oB.c=!0)},a.x=function(t){this.length&&((t=~~t)>0?(t=St(0,this.length-t))&&this.splice(0,t):t<0?(t=this.length-Et(-t,this.length))&&this.splice(this.length-t,t):this.splice(0))},a.toCbk=function(t,n){var e,r,s=n||function(){};return this.oH&&(r=this.oH.oC,i(e=this.oH[t])?s=e:r&&i(e=r[e])&&(s=e),r&&(s=s.bind(r))),s},a.cU=function(t,n){this.toCbk("cU",function(t,n){t&&t.call(n)})(t,n)},a.aC=function(){this.nC=St(0,Et(this.nC,this.length))},a.onundoredo=function(t){this.toCbk("onUR")(t)},a.Block=function(t,n){this.gUR()&&(this.sB(),t.call(n||this,this),this.eB())},a.New=function(t){var n;return this.oB&&this.oB.rgO.push(n=new s(t)),n},a.GetAllowUndoRedo=function(){return!!this.gUR()},a.SetAllowUndoRedo=function(t){this.aUR=t,this.nC=0,this.x()},a.GetUndoRedoQueueLength=function(){return this.lQ},a.SetUndoRedoQueueLength=function(t){this.lQ=~~t,this.lQ>=0&&this.x(this.lQ),this.aC()},a.CanUndo=function(){return this.gUR()&&this.length&&this.nC>0},a.CanRedo=function(){return this.gUR()&&this.length&&this.nC=0&&o=0&&(n<0||o0&&(t<0||o