/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,e(t.exontrol||{}))}(this,function(t){"use strict";function e(t,e){return"fb"+(e?"c":"h")+t}function i(t){return t instanceof Function}function o(t){return t instanceof Array}function r(t){return t instanceof g.Arr}function n(t){return t instanceof g.Tree.Item}function s(t){return t instanceof g.Tree.Cell}function l(t){return t instanceof g.Tree.Column}function h(t){return o(t)?t:function(t){return"string"==typeof t}(t)?t.split(","):[t]}function a(t,e){return t.style+" "+t.size*C(e,1)+"px "+t.family}function u(t){return t.toLowerCase()}function c(t){return null!=t}function p(t){return null==t}function f(t,e,i){return p(t)?~~i:g.s2F(t,e)}var g=g||window.exontrol,d=g.G,C=g.ToN,y=g.ToI,S=g.ToS,v=g.IsO,T=Math.max,m=Math.min,I=/^\s*\w+\(.+,.+,.+\)\s*$/g;g.Def.Tree={},g.Shapes.Tree={},g.Mrg(g,function(){function t(t,e){this.init(t,e)}return t.version="4.3",t.type="Tree",t.efCellEdit="cell-edit",t.XML=function(){function t(t){return c(t)?u(t):t}function e(i){var o,r,n="^"==i.charAt(0);n&&(i=i.substr(1)),~(o=i.indexOf("/"))&&(r=i.substr(o+1),i=i.substr(0,o));for(var s,l=function(e){e=t(e);for(var i,o=[],r=0,n=this.getElementsByTagName("*"),s=n.length;r>=8))+",",o+=(255&(t>>=8))+")"),o||e}}}(),t.Filter={wordBreak:/\W/,separator:"|",defFilterType:240,limit:2048,maxWidth:256,truncLimit:"...",bold:"(All),(Blanks),(NonBlanks),(Checked),(Unchecked)",exclude:"Exclude",description:{label:g.E.Create("column + (exclude ? ` # ` : ` = `) + `'` + value + `'` ","column,value,exclude"),append:g.E.Create("A + (len(A) ? ` ` : ``) + B","A,B"),and:g.E.Create("A + ` and ` + B","A,B"),or:g.E.Create("A + ` or ` + B","A,B"),not:g.E.Create("`not ` + A","A"),isBlank:g.E.Create("`IsBlank(` + A + `)`","A"),isChecked:g.E.Create("`IsChecked(` + A + `)`","A"),to:"to",filterFor:"filter for...",titleAny:"Sample: Cell A|Cell B|Cell C includes only Cell A, Cell B and Cell C items",titlePattern:"Sample: A* B* C* includes only items that starts with A, B or C",titleDate:"Sample: >11/01/2001 | <=12/31/1971 includes only items greater than 11/01/2001 or less(or equal) than 12/31/1971",titleNumeric:"Sample: 1 | >=100 <=1000 includes any item 1 or items between 100 and 1000"},Op:{"<":g.EO.LESS,"=":g.EO.EQUAL,">":g.EO.GREAT,"<=":g.EO.LESSE,"<>":g.EO.NEQUAL,"!=":g.EO.NEQUAL,">=":g.EO.GREATE}},t.Filter.Parser=function(){function e(e){e=e||t.Filter.Op;var i=new Map,o=[];for(var r in e)o.push(r);return o.sort().reverse().forEach(function(t){i.set(t,e[t])}),i}var i=e();return{Get:function(t,e,o){function r(e){var o;return i.forEach(function(i,r){!o&&t.sWith(r,e)&&(o=r)}),o}function n(){(s=s.trim())&&h.push({cbk:i.get(l||"="),v:e?e.call(o||this,s):s})}for(var s,l,h=[],a=0,u=0,c=t.length;u=0&&(!function(t){return t.split(",").forEachU(function(t){return this.has(t)},this)}.call(i,e)||i.has(t))},t.HeaderVisibleEnum={exHeaderHidden:0,exHeaderVisible:-1,exHeaderVisibleExtendLevels:1},t.SortTypeEnum={exSortString:0,exSortNumeric:1,exSortDate:2,exSortByValue:16,exSortByState:32,exSortByImage:48},t.GridLinesEnum={exNoLines:0,exAllLines:-1,exRowLines:-2,exHLines:1,exVLines:2},t.FilterListEnum={exAllItems:0,exVisibleItems:1,exNoItems:2,exLeafItems:3,exRootItems:4,exSortItemsDesc:16,exSortItemsAsc:32,exShowCheckBox:256,exShowExclude:8192,exShowBlanks:16384},t.FilterTypeEnum={exAll:0,exBlanks:1,exNonBlanks:2,exPattern:3,exDate:4,exNumeric:5,exCheck:6,exImage:10,exFilter:240,exFilterDoCaseSensitive:256,exFilterExclude:512},t.FilterPromptEnum={exFilterPromptContainsAll:1,exFilterPromptContainsAny:2,exFilterPromptStartWith:3,exFilterPromptEndWith:4,exFilterPromptPattern:16,exFilterPromptCaseSensitive:256,exFilterPromptStartWords:4608,exFilterPromptEndWords:8704,exFilterPromptWords:12800},t.FilterBarVisibleEnum={exFilterBarHidden:0,exFilterBarPromptVisible:1,exFilterBarVisible:2,exFilterBarCaptionVisible:4,exFilterBarSingleLine:16,exFilterBarToggle:256,exFilterBarShowCloseIfRequired:512,exFilterBarShowCloseOnRight:1024,exFilterBarCompact:2048,exFilterBarShort:4096},t.FilterIncludeEnum={exItemsWithoutChilds:0,exItemsWithChilds:1,exRootsWithoutChilds:2,exRootsWithChilds:3,exMatchingItemsOnly:4,exMatchIncludeParent:240},t.ColumnsFloatBarVisibleEnum={exColumnsFloatBarHidden:0,exColumnsFloatBarVisible:1,exColumnsFloatBarVisibleIncludeGroupByColumns:1,exColumnsFloatBarVisibleIncludeCheckColumns:2,exColumnsFloatBarVisibleIncludeHiddenColumns:4,exColumnsFloatBarFloat:256},t.SortOrderEnum={exSortNone:0,exSortAscending:1,exSortDescending:2},t.SortOnClickEnum={exNoSort:0,exDefaultSort:-1,exUserSort:1},t.SingleSelEnum={exDisableSel:0,exEnableSel:1,exSingleSel:2,exToggleSel:4,exDisableCtrlSel:8,exDisableShiftSel:16,exDisableDrag:32},t.LinesAtRootEnum={exNoLinesAtRoot:0,exLinesAtRoot:-1,exGroupLinesAtRoot:1,exGroupLines:2,exGroupLinesInside:3,exGroupLinesInsideLeaf:4,exGroupLinesOutside:5},t.Options={scrollBars:null,tfi:null,locked:null,readOnly:!1,wheelChange:null,smooth:null,margins:null,shapes:null,cursors:null,singleSel:null,zoom:null,zoomLevels:null,formatText:null,pad:null,imageSize:null,imageAlign:null,allowActions:null,expandGlyphSize:null,crSize:null,headerHeight:null,headerVisible:null,headerEnabled:null,countLockedColumns:null,columnAutoResize:null,sortBarVisible:null,sortBarCaption:null,singleSort:null,sortOnClick:null,allowGroupBy:null,groupByFormatCell:null,columnsFloatBarVisible:null,columnsFloatBarSortOrder:null,columnsFloatBarCaption:null,filterInclude:null,filterBarHeight:null,filterBarVisible:null,filterBarCaption:null,filterBarPrompt:null,filterBarPromptPattern:null,filterBarPromptType:null,filterBarPromptColumns:null,drawGridLines:null,gridLines:null,defaultItemHeight:null,treeColumnIndex:void 0,expandOnDblClick:null,itemAllowSizing:null,ensureOnSort:null,showLockedItems:null,allowDrop:null,onErrorChooseFile:null,scrollPos:null,toolTipDelay:null,toolTipPopDelay:null,toolTipWidth:null,data:null,hasLines:{width:void 0,color:"rgb(128,128,128)",style:null,cap:null,join:null},hasButtons:null,linesAtRoot:null,selection:null,background:null,conditional:null},t.sCnt=function(t,e,i){function o(t){return!g.EyR(t)&&t||null}var r=this.getPad(),n=g.HP.Measure(this.getImage(),this.getImageSize(),e),s=g.PRt(t.slice(),r,-1),l=null,h=null;if(c(n)){switch(i&&(h=s.slice()),this.getImageAlign()){case 3:l=[s[0]+(s[2]-n.width)/2,g.BOf(s)-n.height,n.width,n.height],s[3]-=n.height+r[1];break;case 2:l=[s[0]+(s[2]-n.width)/2,s[1],n.width,n.height],s[1]+=n.height+r[1],s[3]-=n.height+r[1];break;case 1:l=[g.ROf(s)-n.width,s[1]+(s[3]-n.height)/2,n.width,n.height],s[2]-=n.width+r[0];break;default:l=[s[0],s[1]+(s[3]-n.height)/2,n.width,n.height],s[0]+=n.width+r[0],s[2]-=n.width+r[0]}i&&(l=g.NRt(l,h))}return{rtCaption:o(s),rtImage:o(l)}},t.bSCTX=function(t,e,i,o){var r;return e&&(t.drawShape(i,e,o),r=g.TFI.bCTX(t,e.tfi),c(e.opacity)&&((r=r||{}).opacity=t.globalAlpha,t.globalAlpha=e.opacity)),r},t.eSCTX=function(t,e){c(e.opacity)&&(t.globalAlpha=e.opacity),e instanceof g.TFI&&g.TFI.eCTX(t,e)},t.prototype.init=function(e,i){this.lnt=this.lnt||0,this.lnt++,this.oC=new t.Columns(this),this.oS=this.oC.oS,this.oI=new t.Items(this),this.oIT=new t.Items(this),this.oIB=new t.Items(this),this.rgoI=[this.oIT,this.oI,this.oIB],this.oCF=new t.ConditionalFormats(this),this.nLIReq=0,this.lES=0,this.lAI=0,this.oTV=null,this.rgTV=[],this.sSA="smth-"+g.Rand(),this.nHLC=1,this.iLts(),this.oCW=new g.CW(e,{AllowXChg:0,ScrollBars:g.Def.Tree.scrollBars}),this.oCW.oT=this,this.Shortcuts=this.oCW.oSts,this.initCW(),this.import(),this.onSCR(),g.expO(t.Options,this,this.oTV),g.RUR.Listeners.add("srur",this),this.cwbU(),this.SetOptions(i,!0),this.cweU(),g.DPR.Reg(this),--this.lnt},t.prototype.GetCanvas=function(){return this.oCW.GetCanvas()},t.prototype.defAA=function(){return"fit(Shift+MButton,Ctrl+MButton,Alt+MButton),zoom(MButton),select(Shift,Ctrl),column-resize[header],column-drag,scroll"},t.prototype.roAA=function(){return"scroll,zoom,fit,select"},t.prototype.allP=function(){return"view(Tree.TV),header(Tree.TV.Header),sortbar(Tree.TV.SortBar),floatbar(Tree.TV.FloatBar),filterbar(Tree.TV.FilterBar)"},t.prototype.LIOf=function(t){return t?this.oIB:this.oIT},t.prototype.srur=function(t){var e=this.oCW.W("floatbar");e&&(e.bR2d=!0)},t.prototype.aSizeW=function(t){t&&t.GetC().gSize&&(t.aClient=function(t){return function(){if(!this.IsMinRec()){var e,i=this.GetC(),o=i.gSize(),r=o.width,n=o.height;this.GetResizable()&&(e=i.aSize&&i.aSize())&&(c(e.height)&&(n=T(n||0,e.height)),c(e.width)&&(r=T(r||0,e.width))),(c(n)&&(n=i.unscaled(n))!=this.client[3]||c(r)&&(r=i.unscaled(r))!=this.client[2])&&(c(n)&&(this.client[3]=n),c(r)&&(this.client[2]=r),this.updCWN())}return t.apply(this,arguments)}}(t.aClient),t.setClient=function(t){return function(){var e=t.apply(this,arguments);if(!this.IsMinRec()&&this.GetResizable()){var i=g.C2R(this.client),o=this.GetC();o.aSize&&o.aSize({width:o.scaled(i[2]),height:o.scaled(i[3])})}return e}}(t.setClient))},t.prototype.aHideW=function(t){t&&t.GetC().isAutoHide&&(t.autoSH=function(t){this.Smooth(function(){t?(this.SetSize(this._autoS),this._autoS=null):(p(this._autoS)&&(this._autoS=this.GetSize()),this.SetSize(0))})},t.onHovI=function(t){return function(){return this.GetC().isAutoHide()&&this.autoSH(!0),t.apply(this,arguments)}}(t.onHovI),t.onHovO=function(t){return function(){return this.GetC().isAutoHide()&&this.autoSH(!1),t.apply(this,arguments)}}(t.onHovO))},t.prototype.lRA=function(t){this.oCW.lRA(t)},t.prototype.p2I=function(t){return this.feTVU(function(e){return e.oW&&e.p2I(t)})},t.prototype.onAddItem=function(t){this.lAI||(this.onRL(),this.onadditem(t))},t.prototype.onadditem=function(t){this.oLts.onadditem.do(t)},t.prototype.onDelItem=function(t){this.removeSel(t),this.onRL(),this.onremoveitem(t)},t.prototype.onremoveitem=function(t){this.oLts.onremoveitem.do(t)},t.prototype.onAddCol=function(e){this.feI(function(i){i.rgC.push(new t.Cell(i,e))}),this.onRL(),this.onaddcolumn(e)},t.prototype.onaddcolumn=function(t){this.oLts.onaddcolumn.do(t)},t.prototype.onDelCol=function(t){this.resTC();var e=t.GetIndex();this.feI(function(t){t.rgC.splice(e,1)}),this.onRL(),this.onremovecolumn(t)},t.prototype.onremovecolumn=function(t){this.oLts.onremovecolumn.do(t)},t.prototype.feTV=function(t,e){g.Tree.TV.prototype[t]?this.rgTV.forEach(function(e){e[t].call(e)},this):this.rgTV.forEach(t,e)},t.prototype.feTVU=function(t,e){return g.Tree.TV.prototype[t]?this.rgTV.forEachU(function(e){e[t].call(e)},this):this.rgTV.forEachU(t,e)},t.prototype.feI=function(t,e){e=e||this,this.rgoI.forEach(function(i){i.forEach(function(i){t.call(e,i)})})},t.prototype.feIU=function(t,e){var i;e=e||this;for(var o=0,r=this.rgoI.length;!i&&oe.new[3]?2:4),t.call(this,e)}}(n.onsize),n},t.prototype.onbE=function(t,e){},t.prototype.oneE=function(t,e){},t.prototype.addTV=function(t,e){function i(e){return e.repAll("name",t)}var o=null;if(!p(t)&&t.trim().length||(t="tree"+this.rgTV.length),!this.oCW.W(t)){var r=!this.rgTV.length,n=(this.oCW.W("main")||this.oCW).Add(t,g.Mrg({Dock:r?5:4,Size:256},e));o=new g.Tree.TV(this),this.rgTV.push(o),this.oTV=this.oTV||o,!(n.GetDock()%2)&&n.SetPosition(this.oCW.W("tree").GetPosition()+1),n.Add("client",{Dock:5,HoverExtends:i("control,top,bottom,main.header,main.footer,vertical,vscroll,grip,name,name.header,name.filter,name.hscroll"),Extends:i("name.hscroll,vertical"),HScroll:i("name.hscroll"),VScroll:"vscroll",Control:o});var s=n.Add("header",{Dock:1,Resizable:!1,Size:24,HScroll:i("name.hscroll"),Extends:"vertical",Control:o.oHB,VisibleExtends:r?null:"tree.header"});s.GetVisible=o.getHeaderVisible.bind(o),this.aSizeW(s),n.Add("hscroll",{Dock:2,Resizable:!1,Size:16,VisibleExtends:i("name.client"),Opacity:0,HoverOpacity:1,Control:new g.ScrollBar});var l=n.Add("filter",{Dock:2,Resizable:!1,Size:24,VisibleExtends:r?null:"tree.filter",Control:o.oFB});l.GetVisible=o.showFB.bind(o),this.aSizeW(l),this.oTV==o&&(l.onZ=function(t){return function(e){this.GetC().onZ(e),t.call(this,e)}}(l.onZ))}return o},t.prototype.AddTreeView=function(t,e){this.bU();var i=this.addTV(t,e);return this.eU(),i},t.prototype.delTV=function(t){!p(t)&&t.trim().length||(t=this.rgTV[this.rgTV.length-1].oW.opW.GetName());var e=!1,i=this.oCW.W(t);if(i){var o=null,r=this.oCW.W(i.GetName()+".client");if(r&&(o=r.GetC())instanceof g.Tree.TV&&o!=this.oTV){var n=this.rgTV.indexOf(o);(e=n>=0)&&(this.rgTV.splice(n,1),this.oCW.Remove(i))}}return e},t.prototype.RemoveTreeView=function(t){this.bU(),this.delTV(t),this.eU()},t.prototype.TreeView=function(t){var e=this.oCW.W(t+".client");return e&&e.oC&&~this.rgTV.indexOf(e.oC)&&e.oC||null},t.prototype.initCW=function(){function t(){var t="grip",e="",i=null,o=this.oCW.W(t);this.rgTV.forEach(function(o){o.oW&&o.oW.opW&&(t+=","+(e=o.oW.opW.GetShortName()+".hscroll"),i=i||this.oCW.W(e))},this),i&&i.SetSizeExtends(t),o&&o.SetVisibleExtends(t)}var e,i,o,r=this,n=this.oCW;this.oCW.canvas.addEventListener("dragover",this.localdragover=function(t){return r.ondragover(t)}),this.oCW.canvas.addEventListener("drop",this.localdrop=function(t){return r.ondrop(t)}),this.oCW.onAdd=function(e){return function(){return t.call(r),e.apply(this,arguments)}}(this.oCW.onAdd),this.oCW.onRemove=function(e){return function(){return t.call(r),e.apply(this,arguments)}}(this.oCW.onRemove),this.oCW.SetClientRect=function(t){return function(){t.apply(this,arguments),this.oT.onSCR.apply(this.oT,arguments)}}(this.oCW.SetClientRect),o=(e=(n=n.Add("control",{Dock:5})).Add("main",{Dock:5})).Add("header",{Dock:1,Resizable:!1,Size:24}),(i=e.Add("vertical",{Dock:4,Resizable:!1,Size:16,VisibleExtends:"tree.client,vscroll",Opacity:0,HoverOpacity:1})).Add("grip",{Dock:2,AllowXChg:!1,Size:16,Resizable:!1}),i.Add("vscroll",{Dock:5,AllowXChg:!1,Resizable:!1,Control:new g.ScrollBar}),this.addTV("tree"),o.SetC(this.oSB=new g.Tree.TV.SortBar(this.oTV)),o.GetVisible=this.oTV.showSB.bind(this.oTV),this.aSizeW(o),this.addCFB("floatbar",this.oCFB=new g.Tree.TV.FloatBar(this.oTV),"showCFB",{Dock:4})},t.prototype.w2P=function(t){function e(){function t(t){var e=[];return g.B.split(t).forEach(function(t){t.caption&&t.subText&&e.push({n:t.caption,p:function(t){var e=g;return t.split(".").forEach(function(t){e=e[t]}),e.prototype}(t.subText)})}),e}return this._allP||(this._allP=t.call(this,this.allP()))}var i,o=t&&t.oC&&Object.getPrototypeOf(t.oC);if(o)for(var r,n=e.call(this),s=0,l=n.length;!i&&s0;n--)for(var t=i[n],s=0;!r&&s=0&&a>=0)for(var u=m(a,s),f=T(a,s);u<=f;u++){var d=n.rgVI.at(u);!this.rgSel.has(d)&&d.isSelectable()&&(e=!0,this.rgSel.push(d))}}else h&&i?(e=i,this.removeSel(t)):(h||(e=c(this.rgSel)&&(!i||this.rgSel.len()>1),this.rgSel=null),o&&(this.rgSel=this.rgSel||new g.Arr).push(t)),e|=i!=this.isSelected(t);return e}var s=!1,l=1==(i=i||{}).selType,h=2&i.selType,a=function(e){var i=null;if(c(e)){var n=this.oI,s=n.Item;e instanceof t.Items?e==this.oI&&(i=this.oI.rgI):o(e)||r(e)?(i=new g.Arr,e.forEach(function(t){i.ann(s.call(n,t))})):i=s.call(n,e)}return i}.call(this,e);return r(a)?l?s|=n.call(this,a.last()):h?a.forEach(function(t){s|=n.call(this,t)},this):(s=!a.equal(this.rgSel))&&(this.isSingleSel()?n.call(this,a.last()):(this.rgSel=new g.Arr,a.forEach(function(t){t.isSelectable()&&this.rgSel.push(t)},this))):s=n.call(this,a),s&&(r(this.rgSel)&&(this.rgSel.len()||(this.rgSel=null)),(p(i.selChange)||i.selChange)&&(this.feTV("invAO"),this.onSel())),s},t.prototype.onSel=function(){this.onselchange(this.GetSelection())},t.prototype.onselchange=function(t){this.oLts.onselchange.do(t)},t.prototype.Select=function(t){function e(){var t,e=this.oTV,o=e.flVI();return o&&(t=e.getVI(),(o[0]=i(o[0],!0,t))?o[1]=i(o[1],!1,t):o=null),o}function i(t,e,i){i=(i||l).rgO;for(var o=e?i.next:i.prev;t&&!t.isSelectable();)t=o.call(i,t);return t}var o,r,n,s,l=this.getLIV().rgVI,h=l.rgO,a=function(){return this.getSel().first()||l.first()}.call(this);if(h.len()){switch(u(String(t).trim())){case"home":o=r=i(h.first(),!0);break;case"up":case"arrowup":o=r=h.has(a)&&i(h.prev(a));break;case"prior":case"pageup":s=-1;break;case"end":o=r=i(h.last());break;case"down":case"arrowdown":o=r=h.has(a)&&i(h.next(a),!0);break;case"next":case"pagedown":s=1}if(s){var c,p=s<0?0:1;(c=e.call(this))&&(a!=c[p]?o=r=i(c[p],p):(o=function(t,e){if(t)for(var i,o=e?h.next:h.prev,r=this.oTV.GetPageSize()[1],n=l.get(t).h||0;(i=o.call(h,t))&&n/i.test(t)}(t)&&"XML"!=e?(this.bU(),n.clear&&this.Clear(),r.call(this,t),this.onLoad(),this.eU()):this.LoadXML(t)}c(e)&&(this.oImp=g.Mrg(g.Mrg({},t.ImportOptions),i),this.oImp.oExCC=g.E.Create(S(this.oImp.columnCaption),"index"),g.Ld(e,{u:r,i:n,e:this.onError,t:this}))},t.prototype.GetData=function(){return this.Export()},t.prototype.SetData=function(t){this.Import(t)},t.prototype.objL=function(t){function e(t,e){function i(e,i){!function(t){return t instanceof g.Tree.Columns}(t)?h(t).forEach(e,i):t.forEach(function(t){e.call(i,t.GetOptions())})}c(t)&&i(function(t){this.objLC(this.oC.Add(t),t)},this),!this.oC.GetCount()&&c(e)&&this.objLC(this.oC.Add())}function i(t,e){function o(e,i){!function(t){return t instanceof g.Tree.Items}(t)?h(t).forEach(e,i):t.forEach(function(t){e.call(i,g.Mrg({value:t.GetValue()},t.GetOptions()))})}c(t)&&o(function(t){e&&((t=v(t)?t:{value:t}).parent=e);var o=this.oI.Add(t);this.objLI(o,t),t&&t.items&&i.call(this,t.items,o)},this)}var o;return(o=v(t))&&(e.call(this,t.columns,t.items),i.call(this,t.items)),o},t.prototype.objLC=function(t,e){},t.prototype.objLI=function(t,e){},t.prototype.LoadXML=function(e){g.Ld(e,{u:function(t){return g.IsS(t)&&t&&t.indexOf("<")<0&&t.indexOf(">")<0},i:function(e,i){var o=t.XML,r=o.to(e);this.bU(),this.Clear(),r&&this.xmlL(o.tag.call(r,"Content")),this.onLoad(),this.eU()},e:this.onError,t:this})},t.prototype.xmlLC=function(t,e){},t.prototype.xmlLI=function(t,e){},t.prototype.xmlL=function(e){function i(t){return g.IsN(t)?C(t)+4:null}function o(t){function e(t,o){t&&l.call(t,function(t){var r=function(t,e){this.lAI++;var o,r=e.Add({expanded:~~h.call(t,"Expanded"),height:i(h.call(t,"Height"))});return l.call(t,function(t,e){(o=r.Cell(e))&&o.SetOptions({value:h.call(t,"Value"),image:h.call(t,"Image"),state:h.call(t,"State")})},this,"Cell"),this.xmlLI(r,t),!--this.lAI&&this.onAddItem(r),r}.call(this,t,o),n=s.call(t,"Items");n&&e.call(this,n,r)},this,"Item")}return e.call(this,t,this.oI),t}if(e){var r,n=t.XML,s=n.tag,l=n.feU,h=n.vOf,a=n.v2N;(function(t){if(t){var e,i,o,r=this.oC;if(l.call(t,function(t){o=r.Add({caption:h.call(t,"HTMLCaption")||h.call(t,"Caption"),width:a(h.call(t,"Width")),image:h.call(t,"Image"),visible:a(h.call(t,"Visible")),sortType:a(h.call(t,"SortType")),partialCheck:a(h.call(t,"PartialCheck")),format:h.call(t,"FormatColumn"),filterType:a(h.call(t,"FilterType")),filterList:a(h.call(t,"FilterList")),filterOnType:a(h.call(t,"FilterOnType")),displayFilterButton:a(h.call(t,"DisplayFilterButton")),cellHasCheck:h.call(t,"CheckBox")?1:0}),c(i=h.call(t,"Position"))&&(e=e||new Map).set(o,~~i),this.xmlLC(o,t)},this,"Column"),e){var n,s=[],u=r.rgC.byO().slice(),p=u.length,f=new g.Arr(u);s.length=p,e.forEach(function(t,e){t>=0&&t=0&&!c(o(s));s--,n--);for(var s=0;s=0||i>=0)&&(t=t.replace(C,d+d),t=d+t+d)}return t}:S;l.forEach(function(t,e){e>0&&(a+=p);for(var i=0,o=t.length;i0&&(a+=f),a+=y(t[i])}),l=a}return l}}(),t.prototype.Clear=function(){this.bU(),this.Columns.Clear(),this.ClearFilter(),this.eU()},t.prototype.ChooseFile=function(t){function e(t,e){var i=g.doc.createElement(t);return i.style.position="absolute",i.style.opacity=0,i.style.zIndex=e,i}if(!this.oIF){var i,o,r,n,s,l=g.doc.body,h=this,a=this.oCW,u=a.zIndex();this.Clear(),s=this.getLIV(),c(t)&&function(i){(n=e("span",i)).oT=h,n.className="error",n.style.color="#f44336",n.innerText=g.IsS(t)?t:t instanceof DOMException||t instanceof ReferenceError?t:"Error: Access is denied (blocked by CORS policy)",l.appendChild(n)}(++u),function(t){(r=e("input",t)).oT=h,r.className="choose",r.type="file",r.title="choose a CSV or XML file",r.onchange=function(t){t.target.oT.Import(t.target)},l.appendChild(r)}(++u),this.oIF={i:r,s:n},i=setInterval(function(){if(s==h.getLIV()){var t=g.Ert(a.canvas);if(!g.EqR(t,o)){if(o=t,r){var e=g.Ert(r);r.style.left=g.toU(t[0]+(t[2]-e[2])/2),r.style.top=g.toU(t[1]+(t[3]-e[3])/2),r.style.opacity=g.EyR(t)?0:1,t=g.ORt(t.slice(),0,e[3])}if(n){var u=g.Ert(n);n.style.left=g.toU(t[0]+(t[2]-u[2])/2),n.style.top=g.toU(t[1]+(t[3]-u[3])/2),n.style.opacity=g.EyR(t)?0:1}}}else try{h.oIF=null,clearInterval(i),r&&l.removeChild(r),n&&l.removeChild(n)}catch(t){}},16)}return this.oIF},t.prototype.onError=function(t){this.oTV.getOnErrorChooseFile()&&this.ChooseFile(t),this.onerror(t)},t.prototype.onerror=function(t){this.oLts.onerror.do(t)},t.prototype.onLoad=function(){this.updSPR(),this.onload()},t.prototype.onload=function(){this.oLts.onload.do()},t.prototype.onZoom=function(){},t.prototype.onAddGroupItem=function(t){this.onaddgroupitem(t)},t.prototype.onaddgroupitem=function(t){this.oLts.onaddgroupitem.do(t)},t.prototype.onSort=function(t){var e,i=function(){var t=[],e=this.getSel();if(e.len()){var i=!1;e.forEachU(function(t){return i=t.isGI()<0}),i&&(t=e.byO())}return!t.length&&this.oTV.getVI().forEachU(function(e,i){return e[1]>=0&&i.isGI()<0&&(t.push(i)||!0)}),t}.call(this);e=this.nLIReq|=2|(t&&this.getAllowGroupBy()&&1),this.onRL(),!this.lES&&function(t){this.getEnsureOnSort()&&this.EnsureVisibleSelection({expandParents:3,selection:t})}.call(this.oTV,i),this.onsort(e)},t.prototype.onsort=function(t){this.oLts.onsort.do(t)},t.prototype.onFilter=function(){this.nLIReq|=4,this.onRL(),this.onfilter()},t.prototype.onfilter=function(){this.oLts.onfilter.do()},t.prototype.onmFI=function(){this.resFB(!0),t.CellF.XC(this,1)},t.prototype.resFB=function(t){this.rgTV.forEach(function(e){e.resFB(t)})},t.prototype.getLIV=function(){function e(){if(!this.oS.isEmpty()){i.call(this),this.nLIReq&=-3;var t=[],e=function(t){var e=[];return t.forEach(function(t){e.push(t.GetIndex())}),e}(this.oS),r=this.oI,n=r.oG={rgRI:new g.Arr,rgGI:new g.M1};e.length&&r.forEach(function(i){if(!i.oP){n.rgRI.add(i);var o=function(i){var o=null,s=t.length;return function(t){var i=[];return e.forEach(function(e){i.push(t.rgC[e].pc())}),i}(i).forEach(function(i,l){if(l=0&&i)for(;o>=0;){var r=1&i&&(!o||n(t,o-1)),s=2&i&&n(t,o+e.length);switch(i){case 1:if(r)return!0;break;case 2:if(s)return!0;break;case 3:if(r&&s)return!0}o=t.indexOf(e,o+1)}return-1!=o}function h(t){for(var e=r.call(this,t),i=0,o=this.rgW.length;i=0;){if(t.sWith(e,o)&&(!i||n(t,o+e.length)))return!0;(o=t.indexOf(l,o))>=0&&(o+=l.length)}}for(var i=r.call(this,t),o=0,s=this.rgW.length;o=0)&&(s=t.substr(o,h-o),o=h+l.length),s.eWith(e)){var a=!i;if(!a){var u=e.length;a=s.length==u||n(s,s.length-(u+1))}if(a)return!0}}}for(var i=r.call(this,t),o=0,s=this.rgW.length;o>12,e.rgW=function(t,e,i){var o=new g.Arr;return c(t)&&t.split(" ").forEach(function(t){(t=t.trim())&&o.add(e&&t.toLocaleLowerCase()||t)}),o.byO()}(i,!e.bCS),d){case t.FilterPromptEnum.exFilterPromptContainsAll:e.cbkII=h;break;case t.FilterPromptEnum.exFilterPromptContainsAny:e.cbkII=a;break;case t.FilterPromptEnum.exFilterPromptStartWith:e.cbkII=u;break;case t.FilterPromptEnum.exFilterPromptEndWith:e.cbkII=p}}return e}if(this.oI.mFI=null,this.hasFilter()){var n,s,l="\r",h=function(){return this.oC.getIFC()}.call(this),a=r.call(this),u=h&&a&&function(t){return e(t)&&i(t)}||h&&e||a&&i,p=this.getFilterInclude(),f=15&p,d=2==f||3==f,C=1==f||3==f||240&p,y=4&p?0:2;u&&(n=[],s=new Map,this.oI.forEach(function(t){(!d||!t.oP)&&t.isVisible(!0)&&u(t)&&n.push(t)}),n.forEach(function(t){s.set(t,1);for(var e=t.oP;e;e=e.oP)void 0==s.get(e)&&s.set(e,y)}),C&&n.forEach(function(t){t.rgI&&t.dscn().forEach(function(t){void 0==s.get(t)&&s.set(t,3)})}),this.oI.mFI=s)}this.onmFI()}function r(){return this.nLIReq&&(1&this.nLIReq&&function(){this.bU(),function(){var t=this.oI.oG;if(t){t.rgRI&&t.rgRI.forEach(function(t){t.oP=null});var e=t.rgGI&&t.rgGI.rgO||null;if(e&&!e.isEmpty()){var i=this.oI.rgI;i.removeRange(e),i.forEach(function(t){t.oP&&e.has(t.oP)&&(t.oP=null)}),e.forEach(function(t){t.oP&&i.has(t.oP)&&t.oP.rgI.remove(t)})}this.oI.oG=null}}.call(this),e.call(this),this.eU()}.call(this),2&this.nLIReq&&i.call(this),4&this.nLIReq&&o.call(this),this.nLIReq=0),this.oLIV=this.newLIV()}return this.oLIV||r.call(this)},t.prototype.newLIV=function(){return new t.LIV(this.oI)},t.prototype.getLIVT=function(){return this.oLIVT||(this.oLIVT=new t.LIV(this.oIT))},t.prototype.getLIVB=function(){return this.oLIVB||(this.oLIVB=new t.LIV(this.oIB))},t.prototype.onChk=function(t){},t.prototype.FindItem=function(t,e,i){e=(e=this.Column(e))&&e.GetIndex()||0;for(var o=i=(i=this.Item(i))&&i.GetIndex()||0,r=this.oI.len();o=0&&(r=u-a)&&(n=r)&&Array.prototype.unshift.apply(r<0?h:l,Array(Math.abs(r)))}}for(var c=[],s=e-1;s>=0;s--){for(var p=[],f=0;f0&&(y.clear(),d=f,o.unlock.head.forEach(function(t){g.Tree.LCV.push.call(i.unlock,e,t,d,p,s,h,n),d+=p}),i.unlock.len()&&i.lock.len()&&l-h>0&&(i.clip=[h,0,l-h,C])),u){var S=C+1;[i.lock,i.unlock].forEach(function(t){t.forEach(function(t){t[1]=S-t[3]-t[1]})})}if(t.isHeader()&&r.getHeaderVisible()==g.Tree.HeaderVisibleEnum.exHeaderVisibleExtendLevels){var v=1==a,T=new g.Arr;r.oC.forEach(function(t){var e=t.getParent();e&&T.push(t,e)}),[i.lock,i.unlock].forEach(function(t){t.forEach(function(t,e){!v&&T.has(e.c)||(t[1]=0,t[3]=C)})})}return i},O.prototype.doL=function(t,e){function i(t){return t.getWidth()}function o(t,e,i){var o=0,r=0;return i&&(o=u.get(e),r=u.get(e+i)-o,this.push({c:t,i:t.GetIndex(),x:o,w:r})),r}this.wT=0,this.w=null,this.lock={head:[],cell:[],vc:new g.Arr,w:0},this.unlock={head:[],cell:[],vc:new g.Arr,w:0};var r=0,n=t.vc,s=T(0,m(t.oT.oTV.getCountLockedColumns(),n.len()));if(c(e)){e=T(0,C(e,0));var l=0,h=0;if(n.forEach(function(t){var e=i(t);l+=e,t.getAllowSizing()&&(h+=e)}),h>0){var a=T(0,(e-(l-h))/h);i=function(t){var e=t.getWidth();return t.getAllowSizing()&&(e*=a),e},this.w=l-h}}var u=function(){for(var t=new Map,e=0,o=0,r=n.len();o=0?this.unlock.cell[e]:(e=this.lock.vc.indexOf(t))>=0?this.lock.cell[e]:null},O.prototype.getNL=function(){return this.unlock.head.length},O.prototype.getCVO=function(t){var e=g.Tree.VO(),i=t.GetPageSize(),o=i[0],r=i[1],n=this.lock.w;return O.push.call(e.lock,null,this.lock.cell,0,r,o),O.push.call(e.unlock,null,this.unlock.cell,0,r,o,n,t.GetScroll().x),e.unlock.len()&&e.lock.len()&&(e.clip=[n,0,T(0,o-n),t.scaled(t.GetWindowRect()[3])]),e},O.push=function(t,e,i,o,r,n,s){n=n||0,s=s||0,r=r||0;var l=null,h=0,a=e.length;if(s>0)for(;h"+t+""),2&e&&(t=""+t+""),4&e&&(t=""+t+""),8&e&&(t=""+t+""),"["+t+"]"}(t.getKey(),e?1:8);return(e=e||function(t){return""+t+""}).call(i||this,o)}function i(t){s=g.Tree.Filter.description.append.Evaluate(function(e){return-1==e?s:t})}function o(t){return t.getDisplayFilterButton()&&!h.has(t)}function r(t){return t.getDisplayFilterButton()}function n(t){return!0}var s,l=this.getIFC();switch(t){case-1:case-2:s="",l&&l.rgFC.forEach(function(t){i(e.call(this,this.Item(t.col),t.cbkL,t))},this);break;case-8:case-9:case-10:s="";var h=new Map;l&&l.rgFC.forEach(function(t){h.set(this.Item(t.col),t)},this);var a=o;switch(t){case-9:a=r;break;case-10:a=n}a&&this.forEach(function(t){if(a(t)){var o=h.get(t);i(e.call(this,t,o&&o.cbkL||void 0,o))}},this)}return s},E.prototype.getIFC=function(){if(void 0===this.oIFC){var t;this.forEach(function(e){var i=e.bldIFC();i&&(t=t||[]).push(i)},this),this.oIFC=function(t){var e=null;return t&&t.length&&(e={rgFC:t,cbkII:function(t){for(var e=!0,i=0,o=this.rgFC.length;e&&i=0?function(){var t=o();return t.cbkL=function(t){var e=S(this.val).trim(),i=this.not;return g.Tree.Filter.description.label.Evaluate(function(o){return-1==o?t:-2==o?e:i})},t.rgFT=[],t.rgV.forEach(function(e){var i=e.split(g.Tree.Filter.description.to),o=Date.Parse(i[0]),r=Date.Parse(i[1]);if(1==i.length&&(r=o),o&&r&&g.Cmp.D(o,r)>0){var n=o;o=r,r=n}t.rgFT.push([o,r])}),t.cbkII=function(t){for(var e=!1,o=Date.Parse(i(t,this.col)),r=0,n=this.rgFT.length;!e&&r=0)&&(!s[1]||g.Cmp.D(s[1],o)>=0)}return this.not&&(e=!e),e},t}():function(){var t=o();return t.cbkL=function(t){var e=S(this.val).trim(),i=this.not;return g.Tree.Filter.description.label.Evaluate(function(o){return-1==o?t:-2==o?e:i})},t.rgR=[],t.rgV.forEach(function(e){t.rgR.push(g.Tree.Filter.Parser.Get(e,Date.Parse))}),t.cbkII=function(t){for(var e,o=!1,r=Date.Parse(i(t,this.col)),n=0,s=this.rgR.length;!o&&n"+t+":14":"")}),g.Tree.Filter.description.label.Evaluate(function(o){return-1==o?t:-2==o?e:i})},t.cbkII=function(t){var e=function(t,e){return t.rgC[e].i()}(t,this.col);this.bCS||(e=e.toLocaleLowerCase());var i=this.rgV.has(e);return this.not&&(i=!i),i},t}())}}return s},b.prototype.GetFormatImage=function(){return this.oO.formatImage},b.prototype.SetFormatImage=function(t){this.bU(),this.oExFI=void 0,this.oO.formatImage=t,this.eU()},b.prototype.getFormatImage=function(){if(void 0===this.oExFI){this.oExFI=null;var t=S(this.opt("formatImage",null));t&&!(this.oExFI=g.Tree.CellF.Create(t)).IsValid()&&(this.oExFI=null)}return this.oExFI},b.prototype.tt=function(t,e){var i,o,r=this.getToolTip(),n=c(r);return t&&e&&(o=this.gCnt(e,t).rtCaption)&&(n?S(r):c(i=this.getCaption())&&t.ctxTfi(function(t){var e=t.drawHTMLText(i,o.slice(),65535&(1024|this.getFormatText()));return e.width>o[2]||~~e.height>o[3]},this))&&{t:n?r:i,rtT:g.ORt(t.rtCA(o,!1),-3,-3)}||null},b.prototype.GetTotal=function(){return this.oO.total},b.prototype.SetTotal=function(t){this.bU(),function(t){if(t.getTotal()){var e=t.GetIndex();this.feI(function(t){var i=t.Cell(e);i&&i.bTC&&(i.SetFormat(null),i.bTC=!1)})}}.call(this.oC.oT,this),this.oO.total=t,this.oC.oT.resTC(),this.eU()},b.prototype.getTotal=function(){return S(this.opt("total"))},b.prototype.GetShowIdem=function(){return this.oO.showIdem},b.prototype.SetShowIdem=function(t){this.bU(),this.oO.showIdem=t,this.eU()},b.prototype.getShowIdem=function(){return S(this.opt("showIdem"))},w.prototype.initS=function(){this.rgS=new g.Arr,this.rgS.oS=this,this.rgS.onRemove=function(){this.oS.bMS=1,this.oS.onChange()},this.rgS.add=function(t){return function(e){var i=null,o=!1;return(e=this.oS.toColumn(e))&&(this.oS.lC++,o=!0,this.oS.isSingleSort()&&(o=!this.has(e))&&this.clear(),o&&(o=!!(i=t.call(this,e)))&&i==this.oS.oSS&&(this.oS.oSS=null),--this.oS.lC,this.oS.bMS|=o,o&&this.oS.onChange()),i}}(this.rgS.add),this.rgS.setPos=function(t){return function(e,i){var o=t.call(this,e,i),r=o>=0;return this.oS.bMS|=r,r&&this.oS.onChange(),o}}(this.rgS.setPos),this.rgS.clear=function(t){return function(){this.oS.lC++;var e=t.call(this);return--this.oS.lC,e&&this.oS.onChange(),e}}(this.rgS.clear),this.export(this)},w.prototype.export=function(t){["isEmpty","len","forEach","has","first","next","last","setPos","getPos"].forEach(function(e){t[e]=this.rgS[e].bind(this.rgS)},this)},w.prototype.toColumn=function(t){return this.oC.Item(t)},w.prototype.dTV=function(){return this.oT.oTV},w.prototype.isSingleSort=function(){return this.dTV().isSingleSort()},w.prototype.onSingleSort=function(){var t=!1;this.lC++,(t=this.isSingleSort()&&this.len()>0)&&(this.oSS=this.last(),this.rgS.clear()),--this.lC,t&&this.onChange()},w.prototype.onDelCol=function(t){var e=this.isSort(t);this.lC++,this.remove(t),--this.lC,e&&this.onChange()},w.prototype.onChange=function(){this.lC||(this.oT.getAllowGroupBy()&&(this.oC.resLC(),this.oC.ensoTC(),this.oT.onHLC()),this.onSort(),this.bMS=0)},w.prototype.onSort=function(){this.oT.onSort(this.bMS)},w.prototype.add=function(t,e){return this.lC++,p(e)||e?this.oSS=!this.rgS.has(t)&&t||null:this.rgS.add(t),--this.lC,this.getSortLen()},w.prototype.remove=function(t){this.lC++,this.rgS.remove(t),this.oSS==t&&(this.oSS=null),--this.lC},w.prototype.clear=function(){var t=this.oSS||!this.rgS.isEmpty();this.lC++,this.oSS=null,this.rgS.clear(),--this.lC,t&&this.onChange()},w.prototype.isSort=function(t){return t&&(t==this.oSS||this.has(t))&&t.getSortOrder()||0},w.prototype.getSortPos=function(t){var e=this.rgS.indexOf(t);return e<0&&t==this.oSS&&(e=this.rgS.len()),e},w.prototype.getSortLen=function(){return this.rgS.len()+(this.oSS&&1||0)},w.prototype.sort=function(t,e,i){this.lC++;var o=!1,r=this.toColumn(t);if(r&&r.getAllowSort()){(o=(e=p(e)&&function(t){var e=this.isSort(t);return!e&&t.getDefaultSortOrder()||1+(2-e)%2}.call(this,r)||1==e&&1||2==e&&2||0)!=this.isSort(r)||!i)&&(e&&this.add(r,i)||this.remove(r),function(t,e){t.oO.sortOrder=e}(r,e))}return this.lC--,o&&this.onChange(),o},w.prototype.getSorts=function(){function t(t){return t&&t.GetIndex()+":"+i.charAt(this.isSort(t))||""}var e="",i="UAD";return this.forEach(function(i){e+=function(t){return t&&e&&(t=" "+t),t}(t.call(this,i))},this),this.oSS&&(e+=",",e+=t.call(this,this.oSS)),e},w.prototype.setSorts=function(t){function e(){function e(t){return(!(t=(t&&t.charAt(0).toUpperCase()||"").trim())||"A"==t)&&1||2}t=t.ltrim();var i=null,o=function(t){if(t)for(var e=0,i=this.length;e=0)return e;return-1}.call(t,":,");if(o<0)i={id:t,sortOrder:e()},t="";else{var r=","==t.charAt(o);r&&!o?(i=",",t=t.substr(1)):(i={id:t.substr(0,o),sortOrder:e(!r&&t.substr(o+1,1)||void 0)},t=t.substr(o+(r?0:2)))}return i}t=S(t),this.lC++,this.clear();for(var i=0;t;){var o=e();i|=","==o,this.sort(o.id,o.sortOrder,i)}--this.lC,this.onChange()},x.prototype.init=function(t){this.oT=t,this.oS=t.oS,this.rgI=new g.Arr,this.rgI.onRemove=t.onDelItem.bind(t),this.import()},x.prototype.import=function(){var t=this.oT;["bU","eU"].forEach(function(e){this[e]=t[e].bind(t)},this),["at","has","len","forEach","forEachU","add","indexOf","getPos","setPos"].forEach(function(t){this[t]=this.rgI[t].bind(this.rgI)},this)},x.prototype.onRL=function(){this.oT.onRL()},x.prototype.getHeight=function(t,e){var i=t.GetHeight();return p(i)&&p(i=e)&&(i=this.oT.getDefaultItemHeight()),T(0,i)},x.prototype.setHeight=function(t,e){t.oO.height=e},x.prototype.rurIH=function(){},x.prototype.resKI=function(){this.mKI=null},x.prototype.Add=function(t){function e(t,e){v(e)?t.SetOptions(e):t.SetValue(e)}this.bU(),this.resKI();for(var i,o,r=this.add(new g.Tree.Item(this,t)),n=r.rgC,s=this.oT.oC.rgC.rgE,l=0,h=s.length;l1&&d.set(t,v),v=t),e}()?o=i(-1):(o=z.Evaluate.call(this,i),v=d.get(t),d.delete(t)),T--,o}function a(t,e){var i=y.get(t);return!e&&!i&&y.set(t,i={TG:new Map,TL:new Map,TE:new Map}),i}var c=new Map,f=new Map,d=new Map,y=new Map,v=null,T=0,I=function(e){function i(t){return(t=S(t))&&u(t.trim())||""}var o=g.B.split(e)[0];if(o){var r=i(o.caption);if(r in I.Agg){var n=o.subText.splitP(","),s=function(t){var e="all";return(t=i(t))&&(g.IsI(t)||I.List.Enum.has(t))&&(e=t),e}(n[0]),l=function(t){var e="all";return(t=i(t))&&I.Dir.Enum.has(t)&&(e=t),e}(n[1]);this.cbk=I.Agg[r],this.oEx=function(e){var i=t(e);return i.IsValid()?i:t(1)}(n[2]),this.lix=~~s,this.lst=I.List.cbk[(g.IsI(s)?"index":s)+"."+l]}}};I.prototype.nEC=function(){var t=s();return t&&t.oC.GetIndex()||0},I.prototype.Evaluate=function(){var t,e,i,o=s();return o&&(!(e=(t=a(o.dTV().oT)).TE.get(o))&&t.TE.set(o,e=new Map),i=e.get(this),!e.has(this)&&e.set(this,i=function(){var t=l();return t&&this.cbk&&this.cbk.call(this,this.lst.call(this,t))||0}.call(this))),i},I.List=function(){function t(e,i,o){if(e)switch(i){case"dir":e.hasChild()&&e.rgI.forEach(function(t){t.isAI()&&o.push(t)});break;case"rec":e.hasChild()?e.rgI.forEach(function(e){t(e,i,o)}):e.isAI()&&o.push(e);break;case"all":e.hasChild()&&e.rgI.forEach(function(e){e.isAI()&&o.push(e),t(e,i,o)})}return o}function e(t){return t?t.GetIndex():-1}var i={Enum:new g.Arr("current","all","parent","root"),cbk:{"all.dir":function(t){var e=a(t.t()),i=e.TL.get("all.dir");return!i&&e.TL.set("all.dir",i=function(){var e=[];return t.t().oI.forEach(function(t){!t.oP&&t.isAI()&&e.push(t)}),e}()),i},"all.rec":function(t){var e=a(t.t()),i=e.TL.get("all.rec");return!i&&e.TL.set("all.rec",i=function(){var e=[];return t.t().oI.forEach(function(t){!t.hasChild()&&t.isAI()&&e.push(t)}),e}()),i},"all.all":function(t){var e=a(t.t()),i=e.TL.get("all.all");return!i&&e.TL.set("all.all",i=function(){var e=[];return t.t().oI.forEach(function(t){t.isAI()&&e.push(t)}),e}()),i},"current.dir":function(i){var o=a(i.t()),r=e(i)+".cd",n=o.TL.get(r);return!n&&o.TL.set(r,t(i,"dir",n=[])),n},"current.rec":function(i){var o=a(i.t()),r=e(i)+".cr",n=o.TL.get(r);return!n&&o.TL.set(r,i.hasChild()?t(i,"rec",n=[]):n=[]),n},"current.all":function(i){var o=a(i.t()),r=e(i)+".ca",n=o.TL.get(r);return!n&&o.TL.set(r,t(i,"all",n=[])),n},"parent.dir":function(t){return i.cbk["current.dir"](t.oP||t)},"parent.rec":function(t){return i.cbk["current.rec"](t.oP||t)},"parent.all":function(t){return i.cbk["current.all"](t.oP||t)},"root.dir":function(t){return i.cbk["current.dir"](t.getRoot())},"root.rec":function(t){return i.cbk["current.rec"](t.getRoot())},"root.all":function(t){return i.cbk["current.all"](t.getRoot())},"index.dir":function(t){return i.cbk["current.dir"](t.oI.Item(this.lix))},"index.rec":function(t){return i.cbk["current.rec"](t.oI.Item(this.lix))},"index.all":function(t){return i.cbk["current.all"](t.oI.Item(this.lix))}}};return i}(),I.Dir={Enum:new g.Arr("dir","rec","all")},I.Agg={count:function(t){return t.length},sum:function(t){var e=0,i=this.nEC();return t.forEach(function(t){e+=C(this.oEx.Evaluate(t.rgC[i]))},this),e},avg:function(t){return t.length?I.Agg.sum.call(this,t)/t.length:0},std:function(t){var e,i=0,o=N.Total.Agg.avg.call(this,t),r=this.nEC();return t.forEach(function(t){e=Math.abs(C(this.oEx.Evaluate(t.rgC[r]))-o),i+=e*e},this),t.length?Math.sqrt(i/t.length):0},min:function(t){var e,i=this.nEC();return t.forEach(function(t){var o=C(this.oEx.Evaluate(t.rgC[i]));(void 0===e||oe)&&(e=o)},this),e},unique:function(t){var e=this.nEC(),i=new Map;return t.forEach(function(t){i.set(S(this.oEx.Evaluate(t.rgC[e])),"")},this),i.size}};return{Create:t,Evaluate:h,AggEval:function(t,e,o){var r=i(t)?t:I.Agg[t];return r&&r.call({oEx:{Evaluate:function(t){return t}},nEC:function(){return o}},e)},Op1:{get:function(t,e){var i,o,r,n=s();return n&&(!(o=(i=a(n.dTV().oT)).TG.get(t))&&i.TG.set(t,o=new I(t)),r=o.Evaluate()),r},exp:function(){var t=l();return!(!t.hasChild()||!t.isExpanded())},parent:function(t){return t},root:function(t){return t}},Op2:{index:function(t,e){return o(l(),0,t,e)},rindex:function(t,e){return r(l(),0,t,e)},pos:function(t,e){return o(l(),1,t,e)},rpos:function(t,e){return r(l(),1,t,e)},opos:function(t,e){return o(l(),2,t,e)},ropos:function(t,e){return r(l(),2,t,e)},apos:function(t,e){return o(l(),3,t,e)},rapos:function(t,e){return r(l(),3,t,e)}},OpCell:function(){return s()},XC:function(t,e){var i=a(t,!0);i&&((e=e||0)<1&&i.TG.clear(),e<2&&i.TL.clear(),e<3&&i.TE.clear())},Total:I}}();return A.prototype.init=function(t){this.oT=t,this.mCF=null,this.mKI=null,this.rgCF=new g.Arr,this.rgCF.onRemove=this.onDelCF.bind(this),this.import()},A.prototype.import=function(){var t=this.oT;["bU","eU"].forEach(function(e){this[e]=t[e].bind(t)},this),["forEach","add","indexOf","getPos","setPos","include","exclude","join","sort"].forEach(function(t){this[t]=this.rgCF[t].bind(this.rgCF)},this)},A.prototype.onDelCF=function(t){this.resKI(),this.resCF()},A.prototype.resKI=function(){this.mKI=null},A.prototype.resCF=function(){this.mCF=null},A.prototype.bSCTX=function(t,e,i){var o,r=s(e),n=r?e:e.rgC[0],l=function(t){return(this.mCF||(this.mCF=function(){function t(t,i){var o=e.get(i);o||e.set(i,o=[]),o.push(t)}var e=new Map;return this.forEach(function(e){if(e.isEnabled()&&e.isValid()&&e.getShape()){var i=e.getApplyTo();i&&(-1==i?t(e,-1):i.forEach(function(i){t(e,i)}))}}),e}.call(this))).get(t)}.call(this,r?e.oC:-1);return l&&l.forEach(function(e){if(e.getExC().Evaluate(n)){var r=g.Tree.bSCTX(t,e.getShape(),i);r&&(o=o||[]).push(r)}}),o},A.prototype.eSCTX=function(t,e){if(e)for(var i=e.length-1;i>=0;i--)g.Tree.eSCTX(t,e[i])},A.prototype.Add=function(t){this.bU(),this.resKI(),this.resCF();var e=new g.Tree.ConditionalFormat(this,t);return this.eU(),e},A.prototype.GetCount=function(){return this.rgCF.len()},A.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgCF.at(t)||null:t instanceof g.Tree.ConditionalFormat?e=this.rgCF.has(t)?t:null:p(e=function(t){var e=t.mKI;return p(e)&&(t.mKI=e=new Map,t.forEach(function(t){var i=t.getKey();!e.has(i)&&e.set(i,t)})),e}(this).get(t))&&(e=this.rgCF.at(t)||null),e},A.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},A.prototype.RemoveRange=function(t){this.bU(),this.resKI(),this.resCF(),this.rgCF.removeRange(t),this.eU()},A.prototype.Clear=function(){this.bU(),this.resKI(),this.resCF(),this.rgCF.clear(),this.eU()},R.prototype.bU=function(){this.oCF.bU()},R.prototype.eU=function(){this.oCF.eU()},R.prototype.dTV=function(){return this.oCF.oT.oTV},R.prototype.resCF=function(){return this.oCF.resCF()},R.prototype.getExC=function(){return this.oExC||(this.oExC=g.Tree.CellF.Create(S(this.GetExpression())))},R.prototype.Remove=function(){return this.oCF.Remove(this)},R.prototype.GetOptions=function(){return this.oO},R.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},R.prototype.setOpts=function(t){if(c(t)){var e=v(t)?t:{expression:t+""};for(var i in e){var o=this[g.setM(i)];o&&o.call(this,e[i])}}},R.prototype.GetApplyTo=function(){return this.oO.applyTo},R.prototype.SetApplyTo=function(t){this.bU(),this.resCF(),this.oO.applyTo=t,this.eU()},R.prototype.getApplyTo=function(){var t=this.GetApplyTo();if(t<0||p(t))t=-1;else{var e=this.oCF.oT.oC.Items(t);t=e.len()?e:null}return t||null},R.prototype.GetExpression=function(){return this.oO.expression},R.prototype.SetExpression=function(t){this.bU(),this.resCF(),this.oExC=null,this.oO.expression=t,this.eU()},R.prototype.GetEnabled=function(){return this.oO.enabled},R.prototype.SetEnabled=function(t){this.bU(),this.resCF(),this.oO.enabled=t,this.eU()},R.prototype.isEnabled=function(){return p(this.GetEnabled())||this.GetEnabled()},R.prototype.GetKey=function(){return this.oO.key},R.prototype.SetKey=function(t){this.bU(),this.oCF.resKI(),this.oO.key=t,this.eU()},R.prototype.getKey=function(){return S(this.GetKey())},R.prototype.GetShape=function(){return this.oO.shape},R.prototype.SetShape=function(t){this.bU(),this.resCF(),this.oO.shape=g.S.A2S(t),this.eU()},R.prototype.getShape=function(){return this.dTV().toShape(this.GetShape())},R.prototype.GetValid=function(){return this.isValid()},R.prototype.isValid=function(){return this.getExC().IsValid()},G.prototype.getType=function(){return"cell"},G.prototype.bU=function(){this.oI.bU()},G.prototype.eU=function(t){this.oI.eU(t)},G.prototype.dTV=function(){return this.oI.dTV()},G.prototype.toShape=function(t,e){return this.dTV().toShape(t,e)},G.prototype.gCnt=function(t){var e,i,o,r,n,s=this.dTV(),l=s.getIndent(this.oI);return t=g.IRt(t.slice(),-this.getPad()[0],0),this.showExpand()&&((e=s.getExpandGlyphSize())&&this.oI.hasChild()?l>=s.getIndent()&&(r=[t[0]+T(0,l-e),t[1],e,t[3]],t=[g.ROf(r),t[1],g.ROf(t)-g.ROf(r),t[3]],r=!s.getHasButtons()||this.oI.showExpand()<0?null:d.C2R(d.R2C(r),e,e)):(t[0]+=l,t[2]-=l)),(i=this.showCheck()&&s.getCrSize())&&(o=[t[0],t[1],i,t[3]],t=[g.ROf(o),t[1],g.ROf(t)-g.ROf(o),t[3]],o=d.C2R(d.R2C(o),i,i)),n=g.Tree.sCnt.call(this,t,s.gCtx()),r&&(n.rtExpand=r),o&&(n.rtCheck=o),n},G.prototype.p2HT=function(t,e){var i=d.X(t),o=d.Y(t),r=this.gCnt(e);for(var n in r)if(g.PInR(i,o,r[n]))return u(n.replace("rt",""))},G.prototype.autoWidth=function(){var t=this.dTV(),e=this.getPad()[0],i=t.gCtx(),o=g.H.Measure(i,this.c())||{width:0,height:i.fontHeight()},r=this.gCnt([0,0,o.width,o.height]),n=e;return o.width&&(n+=o.width+e),r.rtImage&&(n+=r.rtImage[2]+e),r.rtCheck&&(n+=r.rtCheck[2]+e),r.rtExpand&&(n+=r.rtExpand[2]+e),this.showExpand()&&(n+=t.getIndent(this.oI),r.rtExpand||(n+=t.getExpandGlyphSize()+e)),1+~~n},G.prototype.drawC=function(t,e){function i(){var i,h,a,u,p,f=this.isEnabled(),C=n.getCellShape(f),y=this.getShape(f),S=this.gCnt(e),v=this.c();C&&(i=g.Tree.bSCTX(t,C,e,this)),y&&(h=g.Tree.bSCTX(t,y,e,this)),a=r.bSCTX(t,this,e),t.selClip(e),!f&&g.H.lA++,n.isTC()&&function(e){function i(){c(k.width)&&(t.lineWidth=k.width),c(k.color)&&(t.strokeStyle=k.color),c(k.style)&&t.setLineDash(g.IsA(k.style)?k.style:[k.style]),c(k.cap)&&(t.lineCap=k.cap),c(k.join)&&(t.lineJoin=k.join)}function r(t,e,i,o){L.push({f:[t,e],t:[i,o]})}function n(t,e,i){r(t,i,e,i)}function l(t,e,i){r(i,t,i,e)}function h(t){return t==a?null:t.oP||a}var a,u,p,f,C,y,S,v,I,O,E,b,w,x,F,V,A,R,G,k=o.getHasLines(),L=[];if(k&&(u=o.getIndent())&&s.isNZ()&&!s.isLocked()&&(p=o.getIndent(s))>=u){if(f=!0,C=o.getExpandGlyphSize()-8,a=o.oT.oI,S=s.oP,e=g.IRt(e.slice(),-this.getPad()[0],0),y=e.slice(),f?(y[0]+=p-(y[2]=u),e[2]=g.ROf(e)-(e[0]=g.ROf(y))):(y[0]=g.ROf(y)-p,y[2]=u,e[2]-=p),v=d.R2C(y),I=v[0],O=v[1],E=o.getLinesAtRoot(),b=-1==E,w=0==E,x=1==E,F=2==E,V=3==E||4==E,A=5==E,R=V||A,G=function(){return o.getHasButtons()&&s.hasChild()&&(S||E&&!S)&&this.showExpand()}.call(this)&&o.getExpandGlyphSize(),S||E){if(!R&&!F&&s.isExpanded()&&s.hasNZ()){var B,P,U,H=u;F&&(H=0),P=I+H,B=this.gCnt(e),U=g.BOf(B.rtCheck||B.rtImage||B.rtCaption||e),f||(P=I-H),l(T(U,O+C),g.BOf(y),P)}if((S||!o.getHasButtons()||!S&&b)&&(!F||F&&!G&&s.hasNZ()&&s.isExpanded())){A&&o.isIndent(s)&&(f?I-=u:I+=u);var D=O,W=I,z=T(I,g.ROf(y)-2);f||(W=m(I,g.LOf(y)+2),z=I);var M=!0;if(R&&(M=!1,S)){var N=S.gfNZ(),X=S.glNZ();if(M=N!=X){var Z=g.TOf(y),K=g.BOf(y);A||4==E?(M=N==s)?Z=O:(M=X==s)&&(K=O):N==s?Z=O:X==s&&(K=O),M&&(W=I,z=T(I,I+u/2-2),f||(W=m(I,I-u/2+2),z=I)),l(Z,K,I)}}M&&n(W,z,D)}if(!R)if(S)switch(E){case 0:j=S.gpNZ(s);l((Y=S.gnNZ(s))?g.BOf(y):O,(S.oP||S.gfNZ()!=s)&&(S.isNZ()||j)?g.TOf(y):O,I);break;case 2:s.hasNZ()&&s.isExpanded()&&l(O,g.BOf(y),I);break;default:j=S.gpNZ(s);l((Y=S.gnNZ(s))?g.BOf(y):O,j||S.isNZ()?g.TOf(y):O,I)}else if(!F||F&&s.hasNZ()&&s.isExpanded()){var Y=a.gnNZ(s),j=a.gpNZ(s)&&b;x&&(Y=s.isExpanded()&&s.hasChild()),(Y||j)&&l(Y&&j?g.TOf(y):Y?g.BOf(y):g.TOf(y),Y&&j?g.BOf(y):O,I)}}for(var q=s;S=h(q);){switch(f?(g.ORt(y,-u,0),I-=u):(g.ORt(y,u,0),I+=u),E){case 2:var Q,J=S.gnNZ(q);(!J||J&&h(J)==S)&&(K=g.BOf(y),S.isNZ()&&((Q=!J&&s==S.glNZ())&&(K=O,f?n(I,I+u/2,K):n(I-u/2,I,K)),(Q||J)&&l(g.TOf(y),K,I)));break;case 3:case 4:case 5:(tt=S.oP)&&S.isNZ()&&tt.gnNZ(S)&&l(g.TOf(y),g.BOf(y),I);break;default:var _,$,tt=h(S);tt&&(tt.gnNZ(S)||x)&&((_=!h(tt))?($=!w)&&(x?$=S.isNZ():S.isNZ()||($=tt.gpNZ(S))):$=x?tt.gnNZ(S)&&S.isNZ():S.isNZ()||tt.isNZ(),$&&(x&&_&&S.glNZ()==s&&(f?n(I,I+u/2,g.BOf(y)):n(I-u/2,I,g.BOf(y))),l(g.TOf(y),g.BOf(y),I)))}q=S}!function(e,i){function o(t,e){return Math.abs(t[0]-e[0])<.5&&Math.abs(t[1]-e[1])<.5}function r(t,e){if(t){if(o(t,e.f))return e.t;if(o(t,e.t))return e.f}}var n=e.length;if(n){t.save(),i(t),t.beginPath();for(var s,l,h,a=0;al&&p&&v==p.rgC[n.GetIndex()].c()&&(v=u)),t.drawHTMLText(v,S.rtCaption,this.getFormatText())),!f&&--g.H.lA,t.resClip(),a&&r.eSCTX(t,a),h&&g.Tree.eSCTX(t,h),i&&g.Tree.eSCTX(t,i)}var o=this.dTV(),r=o.oCF,n=this.oC,s=this.oI,l=3*t.fontHeight()/4;i.call(this)},G.prototype.GetOptions=function(){return this.oO||(this.oO={})},G.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},G.prototype.o=G.prototype.GetOptions,G.prototype.setOpts=function(t){if(v(t))for(var e in t){var i=this[g.setM(e)];i&&i.call(this,t[e])}},G.prototype.GetColumn=function(){return this.oC},G.prototype.GetItem=function(){return this.oI},G.prototype.GetValue=function(){return this.o().value},G.prototype.SetValue=function(t){this.bU(),this.o().value=t,g.Tree.CellF.XC(this.oI.t(),2),this.eU()},G.prototype.getValue=G.prototype.v=function(){return this.GetValue()},G.prototype.getCaption=G.prototype.c=function(){var t=this.getFormat()||this.oC.getFormat(),e=t?t.Evaluate(this):this.v(),i=this.oC.getValues();return i?i.get(e):e},G.prototype.pc=G.prototype.toString=function(){return g.H.TextNoHTML(this.c()).trim()},G.asAll="cvsi",G.as=function(t){return G.asAll[T(0,~~t)%G.asAll.length]},G.prototype.GetFormatText=function(){return this.o().formatText},G.prototype.SetFormatText=function(t){this.bU(),this.o().formatText=t,this.eU()},G.prototype.getFormatText=function(){var t=this.GetFormatText();return t=c(t)?~~t:this.oC.getFormatText(),this.showExpand()&&(t&=~g.DrawTextFormatEnum.exTextAlignCenter),t},G.prototype.GetPad=function(){return this.o().pad},G.prototype.SetPad=function(t){this.bU(),this.o().pad=t,this.eU()},G.prototype.getPad=function(){var t=this.GetPad();return c(t)?g.pad2A(t):this.oC.getPad()},G.prototype.GetImage=function(){return this.o().image},G.prototype.SetImage=function(t){this.bU(),this.o().image=t,this.eU()},G.prototype.getImage=G.prototype.i=function(){var t=this.oC.getFormatImage();return t?t.Evaluate(this):S(this.GetImage())},G.prototype.GetImageSize=function(){return this.o().imageSize},G.prototype.SetImageSize=function(t){this.bU(),this.o().imageSize=t,this.eU()},G.prototype.getImageSize=function(){var t=this.GetImageSize();return void 0!==t?t:this.oC.getImageSize()},G.prototype.GetImageAlign=function(){return this.o().imageAlign},G.prototype.SetImageAlign=function(t){this.bU(),this.o().imageAlign=t,this.eU()},G.prototype.getImageAlign=function(){var t=this.GetImageAlign();return c(t)?y(t,0):this.oC.getImageAlign()},G.prototype.GetEnabled=function(){return this.o().enabled},G.prototype.SetEnabled=function(t){this.bU(),this.o().enabled=t,this.eU()},G.prototype.isEnabled=function(){return(p(this.GetEnabled())||this.GetEnabled())&&this.oI.isEnabled()&&this.oC.isEnabled()},G.prototype.GetShape=function(){return this.o().shape},G.prototype.SetShape=function(t){this.bU(),this.o().shape=g.S.A2S(t),this.eU()},G.prototype.getShape=function(t){return this.toShape(this.GetShape()||this.getType(),!(p(t)?this.isEnabled():t))},G.prototype.GetCursor=function(){return this.o().cursor},G.prototype.SetCursor=function(t){this.bU(),this.o().cursor=t,this.eU()},G.prototype.GetState=function(){return this.o().state},G.prototype.SetState=function(t){function e(t){this.o().state=t}function i(t){(function(){var t=[];return this.oI.dscn().forEach(function(e){t.push(e.rgC[o])}),t}).call(this).forEach(function(i){e.call(i,t)}),this.oI.oP&&this.oI.oP.uPCK(o)}var o,r,n=this.showCheck();(o=this.oC.GetIndex())>=0&&((r=1==n)||t)&&(t=t?1:0,this.bU(),r?this.oC.getPartialCheck()?i.call(this,t):e.call(this,t):this.oC.isColumnRadio()?function(){e.call(this,1),this.dTV().oI.rgI.forEach(function(t){var i=t.rgC[o];i!=this&&2==i.showCheck()&&e.call(i,0)},this)}.call(this):function(){e.call(this,1);var t=this.oI.oP;(t&&t.rgI||this.dTV().oI.roots()).forEach(function(t){var i=t.rgC[o];i!=this&&2==i.showCheck()&&e.call(i,0)},this)}.call(this),this.oI.t().onChk(this),this.eU())},G.prototype.getState=G.prototype.s=function(){return~~this.GetState()},G.prototype.GetHasCheck=function(){return this.o().hasCheck},G.prototype.SetHasCheck=function(t){this.bU(),this.o().hasCheck=t,this.eU()},G.prototype.showCheck=function(){var t=this.GetHasCheck();return(t=p(t)?this.oC.showCellCheck():t)&&this.oI.isLocked()&&(t=0),t},G.prototype.ToggleCheck=function(){this.SetState(this.getState()?0:1)},G.prototype.showExpand=function(){return this.oI.showExpand()&&(this.oC.isTC()||this.oC.oC.oTC&&this.oI.getDivider()&&this.oI.isGI()>=0)},G.prototype.GetFormat=function(){return this.o().format},G.prototype.SetFormat=function(t){this.bU(),this.oExF=void 0,this.o().format=t,this.eU()},G.prototype.getFormat=function(){if(void 0===this.oExF){this.oExF=null;var t=S(this.GetFormat());t&&((this.oExF=g.Tree.CellF.Create(t)).IsValid()||(this.oExF=null))}return this.oExF},G.prototype.toFormat=function(t,e){if(t<0)return this.v();if(ti[2]||~~o.height>i[3]},this))&&{t:r?o:e,rtT:g.ORt(t.o2rt(this,"client",function(t){return this.gCnt(t).rtCaption},this),-3,-3)}||null},k.prototype.doL=function(t){var e=t.oT;this.rgVI=new g.M1,((U?0:U=1+g.Tick()%3321)||function(){var t="pmgi",e=g[t+="rwi"].call(g);return!(g.iL()&&(!e||!e.k))}()&&(U+=U>>2)%4)&&(this.add=function(){return this.rgVI.len()<16+(U+=U>>2)%48&&k.prototype.add.apply(this,arguments)||0}),this.h=function(){function i(t){var e=null,s=t.getHeight(n);r&&!r.get(t)&&(s=0),(s||t.getAllowSizing())&&(o+=this.add(t,o,s)),(e=t.getVisibleChild())&&e.forEach(function(t){i.call(this,t)},this)}var o=0,r=t.mFI,n=e.getDefaultItemHeight();return t.forEach(function(t){!t.oP&&t.isVisible()&&i.call(this,t)},this),o}.call(this)},k.prototype.add=function(t,e,i){return this.rgVI.push(t,{y:e,h:i}),i},k.prototype.scroll=function(t,e){var i=new g.M1,o=this.rgVI,r=o.len();if(r&&!g.EyR(t)){for(var n=d.X(e),s=d.Y(e),l=t[0]+n,h=t[2],a=0,u=r-1,c=g.TOf(t),p=g.BOf(t);a+1=0){for(var r=0,n=o;r+1=h.y&&t<=h.y+h.h&&(e=l)}return e},k.prototype.y2Is=function(t,e){var i=[];if(this.rgVI.len()){var o=m(t,e),r=T(t,e),n=o<0?0:this.rgVI.indexOf(this.y2I(o));if(n>=0)for(var s=this.rgVI.at(n);s&&this.rgVI.get(s).y=0;s--)(i=n[s]).getAllowSizing()&&(o=this.rgVI.get(i))&&t>=o.y+o.h-r&&t0&&(e[1]=g.BOf(e)-n,e[3]=n):(e[1]+=r,e[3]=T(0,e[3]-(r+n)))}return e},B.prototype.GetPageSize=function(){var t=this.GetClientRect();return t&&[this.scaled(t[2]),this.scaled(t[3])]||[0,0]},B.prototype.GetScrollRect=function(){var t=this.origin(),e=this.GetPageSize();return[-t[0],-t[1],e[0],e[1]]},B.prototype.GetCanvasRect=function(){var t=this.GetClientRect(),e=this.GetCanvas();return e&&(t=[0,0,e.width,e.height]),t},B.prototype.GetVisibleRect=function(){return g.NRt(this.GetClientRect(),this.GetCanvasRect())},B.prototype.GetViewRect=function(t){var e=g.EArtC((t||this.gCW()).GetCanvas());return g.ORt(this.GetClientRect(),e[0],e[1])},B.prototype.c2V=function(t,e){var i=this.GetViewRect();return p(e)&&(e=d.Y(t),t=d.X(t)),{x:t+i[0],y:e+i[1]}},B.prototype.v2C=function(t,e){var i=this.GetViewRect();return p(e)&&(e=d.Y(t),t=d.X(t)),{x:t-i[0],y:e-i[1]}},B.prototype.c2Vrt=function(t){var e=this.c2V(t);return[e.x,e.y,t[2],t[3]]},B.prototype.v2Crt=function(t){var e=this.v2C(t);return[e.x,e.y,t[2],t[3]]},B.prototype.onpaint=function(t){this.lI||(!this.sRng()&&this.updSPR(),g.SB.prototype.onpaint.call(this,t))},B.prototype.isClkAble=function(){return this.isSelectable()&&!this.isReadOnly()},B.prototype.htAO=function(t,e){function i(t){var i=e.get(t);i&&(o=o||new g.Arr).push(i)}var o,r=this.oT.p2I(t),n=this.p2ICl&&this.p2ICl(t);return n&&(i(n.idAOH),i(n.idAOC)),r&&(i(r.idAOH),i(r.idAOC)),o},B.prototype.e2W=function(t){return this.gCW().e2W(t)},B.prototype.e2V=function(t){return(this.e2W(t)||{}).oC||null},B.prototype.wCH=function(){return this._wCH||(this._wCH=[this.oHB,this.oSB,this.oCFB])},B.prototype.fewCHU=function(t,e){e=e||this;for(var i,o=this.wCH(),r=o.length,n=0;!i&&no?0:(i[3]-s.height)/2),~~(s.width+1),s.height]})}.call(this),onpaint:function(t,i){this.ctxTfi(function(t){t.drawHTMLText(e.t,i,r)},this,t)},thisArg:this}},{thisArg:this,ttO:o&&o.c,ttD:this.getToolTipDelay(),ttP:this.getToolTipPopDelay()})},B.prototype.xA=function(){g.A.Cancel("ss*"),g.A.Cancel(this.sEvcA)},B.prototype.ondown=function(t){return this.isSelectable()&&(this.xA(),this.gAA().Do(this,t),!g.RUR.Rng()&&this.doRUR(t,function(t){switch(t.drag.status){case 4:case 5:this.rurActionClick(null,t)}},this)),!0},B.toClick=function(t){return{dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:g.e2B(t),modifiers:g.ModK(t)}},B.prototype.toClick=function(t,e){e.cell=this.e2ICl(t),e.item=e.cell&&e.cell.oI||null},B.prototype.onA=function(t,e){t&&(g.H.VisitA(this,t),this.inv(),this.onanchorclick(t))},B.prototype.onClick=function(t){var e=B.toClick(t),i=this.e2V(t),o=this.gPtr(t);i&&(e.view=i,i.toClick&&i.toClick(t,e)),this.onA(this.p2A(o),e),this.onclick(e)},B.prototype.onclick=function(t){this.oLts.onclick.do(t)},B.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},B.prototype.onDblClk=function(t){var e=this.rurI(t);if(e&&this.getExpandOnDblClick())return this.onClickIE(e),e.hasChild()},B.prototype.e2RUR=function(t){var e=this.gPtr(t),i=this.e2W(t)||this.oW,o=i.GetClientRect();return{w:i,c:i.oC,x:d.X(e)-o[0],y:d.Y(e)-o[1],r:i.GetClientRect()}},B.prototype.doRUR=function(t,e,i,o){var r,n,s=this.gAA(),l=this.oT.lRA.bind(this.oT);return g.RUR.Do(t,function(t){switch(n=t.drag.status){case 1:l(7),r=this.oT.oRUR=this.e2RUR(t),this.lRURLong&&t.drag.setCursor(g.GP.Get("long",this.getCursors()));break;case 3:s.CanDo(t,1)&&(g.RUR.Cancel(),this.norurAction(t,1)||(this.lRURLong=(this.lRURLong||0)+1,s.Do(this,t,1),--this.lRURLong));break;case 5:this.norurAction(t,2);break;case 2:case 6:l(4)}!(r&&r.c&&r.c.bRUR&&r.c.bRUR(t))&&e.call(i,t),r&&r.c&&r.c.eRUR&&r.c.eRUR(t),7==n&&(r&&(r=this.oT.oRUR=null),l(t.drag.click||t.drag.long?46:62))},this,o)},B.prototype.bRUR=function(t){return this.gAA().Has("zoom")&&this.exZ(t),t.drag.extra},B.prototype.exZ=function(t){var e;t.drag.extra&&(e=t.drag.extra[0])&&this.oT.oRUR&&this.zBy(e.offset,this.oT.oRUR.oZI=this.oT.oRUR.oZI||this.p2ZI(e.start))},B.prototype.rurScroll=function(t,e){if(t){var i={oH:this.GetSI(!0),oV:this.GetSI(!1)};this.doRUR(t,function(t){var o=this.oT.oRUR||{};switch(t.drag.status){case 1:o.ao=e&&e.rurOnlyAO,this.rAO(),function(t){e&&e.rurScrollS&&e.rurScrollS(t)}(t);break;case 7:o.ao=null,t.drag.cancel?(o.cancel=!0,this.Smooth(function(){this.rurScrollD(0,0,i)})):!t.drag.swipe&&this.rAO(),function(t){e&&e.rurScrollE&&e.rurScrollE(t)}(t);break;case 2:!o.dRSD&&this.rurScrollD(-t.drag.offset.dx,-t.drag.offset.dy,i);break;case 6:var r=o.w,n=t.drag.swipe;if(n.dx&&n.dy){var s=Math.abs(n.dx),l=Math.abs(n.dy);T(s,l)-m(s,l)>32&&(s>l?n.dy=0:n.dx=0)}r.SSw.call(r,n);break;case 4:case 5:e&&e.rurStatus&&e.rurStatus.call(e.thisArg||this,t)}},this)}},B.prototype.onRurScrollD=function(t){var e=this.oT.oRUR;e&&e.c&&e.c!=this&&e.c.onRurScrollD&&e.c.onRurScrollD.call(e.c,t)},B.prototype.rurScrollD=function(t,e,i){var o,r=c(i);(i=i||{oH:this.GetSI(!0),oV:this.GetSI(!1)}).oH=i.oH||{pos:0,page:0},i.oV=i.oV||{pos:0,page:0},o={dx:t,dy:e},this.onRurScrollD(o),(r||o.dx||o.dy)&&this.SetScroll({x:i.oH.pos+this.scaled(o.dx),y:i.oV.pos+this.scaled(o.dy)})},B.prototype.rurDrag=function(t,e){function i(t){return!e||p(e.rurAllow)||t==(e.rurAllow&t)}function o(){h.frame=d.Rect(h.from,h.to),e&&e.rurDrag&&e.rurDrag.call(y,h),h.frame=function(t,e){return r().rtCA(t,e)}(h.frame,!1),c.onRurDragD&&c.onRurDragD.call(c,e,h),e&&e.rurDragD&&e.rurDragD(h),a&&a.SetClient(h.frame)}function r(){return s||(s=function(){var t=u;return a&&a.oO.relative!=u.GetCanvas()&&(t=c),t}())}function n(t,e){return r().ptCA(t,e)}if(t){var s,l,h,a,u=this,c=this.e2V(t)||u,f=c.getRurDragScrollOut?c.getRurDragScrollOut():c.GetClientRect(),C=[{oTV:this,oH:this.GetSI(!0),oV:this.GetSI(!1)}],y=this,S=0,v=0;this.oT.feTV(function(t){t!=this&&C.push({oTV:t,oH:t.GetSI(!0),oV:t.GetSI(!1)})},this),this.doRUR(t,function(t){switch((h=h||function(t){s=null;var e=n(u.gPtr(t));return{from:e,to:e,event:t,frame:d.Rect(e,e)}}(t)).event=t,t.drag.status){case 1:(function(){c.onRurDragS&&(e=c.onRurDragS.call(c,e,h)),e&&e.rurDragS&&e.rurDragS(h)}).call(this),y=e&&e.thisArg||y,e&&(this.onRURDragStart(e.rurName,t),e.rurDragStart&&e.rurDragStart.call(y,h));if((m=this.oT.oRUR)&&(m.ao=e&&e.rurOnlyAO),this.rAO(),e&&e.rurEFPaint){o();var r={name:"frame",client:h.frame,relative:u.GetCanvas(),clip:u.GetCanvas(),inflateClient:8,onpaint:function(t,i){e.rurEFPaint.call(y,h,t,i,this)}};e.rurEFOpts&&e.rurEFOpts.call(y,h,r),a=g.EF.Create(r)}break;case 7:var p=t.drag.cancel?this.oT:this,m=this.oT.oRUR;clearTimeout(l),m&&(m.ao=null),p.bU(),t.drag.cancel?(m&&(m.cancel=!0),this.Smooth(function(){C.forEach(function(t){t.oTV.rurScrollD(0,0,t)}),e&&e.rurCancel&&e.rurCancel.call(y,h)})):!t.drag.click&&e&&e.rurDrop&&e.rurDrop.call(y,h),!this.sRng()&&p.onRL(),this.rAO(),p.eU(),g.EF.Destroy(a),e&&(e.rurDragEnd&&e.rurDragEnd.call(y,h),t.drag.click&&e.rurStatus&&e.rurStatus.call(y,t),this.onRURDragEnd(e.rurName,t)),function(){c.onRurDragE&&c.onRurDragE.call(c,e,h),e&&e.rurDragE&&e.rurDragE(h)}.call(this);break;case 2:var I=!1,O=S!=t.drag.offset.dx||v!=t.drag.offset.dy;if(O&&(S=t.drag.offset.dx,v=t.drag.offset.dy),!g.EyR(f)&&function(t){var e=this.e2W(t);return e!=this.oCFB.oW&&e!=this.oSB.oW}.call(this,t)){var E=t.drag.current.x,b=t.drag.current.y,w=i(1)&&E-g.LOf(f)||0;w>0&&(w=T(0,E-g.ROf(f)));var x=i(2)&&b-g.TOf(f)||0;x>0&&(x=T(0,b-g.BOf(f))),(I=w||x)&&this.rurScrollD(w,x)}if(O&&!I){clearTimeout(l);var F=i(4)&&this.e2IE(t)||i(8)&&this.e2CE(t);F&&!F.isExpanded()&&(l=this.setTimeout(function(){this.Smooth(function(){F.SetExpanded(!0),o()})},512))}(I||O)&&(h.to=n(t.drag.current),h.dx=h.to.x-h.from.x,h.dy=h.to.y-h.from.y,o())}},this,{contiguously:!0,client:f})}},B.prototype.onRURDragStart=function(t,e){},B.prototype.onRURDragEnd=function(t,e){},B.prototype.onChange=function(t,e){this.onchange({object:e,action:t})},B.prototype.onchange=function(t){this.oLts.onchange.do(t)},B.prototype.rtSelAbs=function(t){var e=d.Rect(t.from,t.to);if(!g.EyR(e)){var i=this.getLIV(),o=this.ar2I(e);o&&o.length&&o.forEach(function(t){e=g.URt(e,i.i2R(t))})}return e},B.prototype.rurAO=function(t){return this.rurI(t)||this.rurC(t)||{}},B.prototype.rurI=function(t){return this.e2I(t)},B.prototype.rurC=function(t){return this.fewCHU(function(e){return e.e2C(t)})},B.prototype.allowRur=function(t,e){var i=c(t);if(i)switch(e.rurName){case"scroll":i=function(t){return g.Tree.allowRurPart(this.oT.w2P(e.rurOnlyW),t||"view,header",e.rurFlags)}.call(this);break;case"fit":case"select":case"item-resize":case"item-drag":i=this.e2W(t)==this.oW}return i},B.prototype.rurAction=function(t,e,i){var o={rurName:t,rurFlags:e,rurOnlyW:this.e2W(i),rurOnlyAO:this.rurAO(i),rurStatus:function(e){this.rurActionClick(t,e)}};if(this.allowRur(i,o)){var r="rur"+g.getP(function(t){for(var e,i="",o=0,r=t.length;oy})):d.forEach(function(t){v(t)&&S.add(m.call(t.rgC[o]))}),(i.s||p&(u.exSortItemsAsc|u.exSortItemsDesc))&&S.sort(t.cmp(i.s||(p&u.exSortItemsAsc?1:2)).c),c(y)&&S.len()>y&&(S.remove(S.last()),S.add(g.Tree.Filter.truncLimit)),e.v=S.byO()}return e}function v(t,e,o,r){return(r=r||i).cbkF?r.cbkF.call(t,e,o):t.ChangeFilter(e,o)}function I(){var e=d(E),o=this.gCW(),r=this.getFont(),n=t.o.gCW().canvas,s=function(){var e=t.rtC.slice();return t.o instanceof B.Header&&t.o.isHeader()&&g.ORt(e,-this.unscaled(this.GetScroll().x-b.x),0),e}.call(this);g.ORt(s,0,s[3]),g.EF.Create({name:"filter.column-edit",class:"exontype "+g.Def.CN.ppEF,client:s,relative:n,tag:"input",inner:{value:S(e),placeholder:g.Tree.Filter.description.filterFor,title:function(){var t=g.Tree.Filter.description.titleAny;switch(15&E.getFilterType()){case g.Tree.FilterTypeEnum.exPattern:t=g.Tree.Filter.description.titlePattern;break;case g.Tree.FilterTypeEnum.exDate:t=g.Tree.Filter.description.titleDate;break;case g.Tree.FilterTypeEnum.exNumeric:t=g.Tree.Filter.description.titleNumeric}return t}.call(this),style:{font:a(r,this.getScale())}},modal:!0,modalTTC:i.cbkF?-1:null,onmodal:function(t,i){switch(i){case"start":o.lE++;break;case"end":o.lE--;break;case"cancel":v(E,void 0,c(e)?e:null);break;case"change":v(E,void 0,t.value||null)}},thisArg:this})}function O(){function e(t,e,i){function n(t,e){t&&(s&&(s+=","),c(e)&&(l?t+="[chk="+e+"][show=-1]":e&&(t+="[shapes=shitem.checked(item)]")),s+=t)}var s="",h=B.cbkEsc(),a=g.Tree.Filter.bold.split(","),u=g.Tree.Filter.exclude;if(u&&c(t.e)&&n(h(u)+"[chk="+(t.e?1:0)+"][id=exclude]"),t.b.length&&s&&n("[sep]"),t.b.forEach(function(t){n(""+h(a[t])+"[id="+t+"]")}),t.v.length&&s&&n("[sep]"),r()==g.Tree.FilterTypeEnum.exImage){var p=function(){var t=0,e=E.getImageSize();return c(e)&&(g.IsN(e)?t=e:o(e)&&(t=m(Math.abs(e[0]),Math.abs(e[1])))),t}.call(this);t.v.forEach(function(o,r){var s;e&&(s=e.has(i?o:o.toLocaleLowerCase())?1:0),n(""+o+":"+p+"[id="+(r+10)+"]",s),s&&(t.i=r+10)})}else{var f=function(){var e="";if(c(g.Tree.Filter.maxWidth)){var i=null;if(t.v.forEach(function(t){(!i||t.length>i.l)&&(i={l:t.length,t:t})}),i){var o=this.gCtx(),r=~~E.getWidth(),n=g.TFI.bCTX(o,this.getTfi()),s=g.H.Measure(o,i.t)||{width:0,height:o.fontHeight()};g.TFI.eCTX(o,n),s.width>r&&(e="[cw="+~~m(8+s.width,g.Tree.Filter.maxWidth)+"]")}}return e}.call(this);t.v.forEach(function(o,r){var s;e&&(s=e.has(i?o:o.toLocaleLowerCase())?1:0),n(h(S(o)||" ")+f+"[id="+(r+10)+"]",s),s&&(t.i=r+10)})}return s}var n=t.o.gCW(),s=y.call(this,E),l=256&E.getFilterList(),h=function(t){var e=null;if(c(i.f))e=t.splFilter(i.f);else if(o=this.oC.getIFC())for(var o,r=t.GetIndex(),n=o.rgFC,s=0,l=n.length;!e&&s=0&&i=0&&s=0&&(r=o.rgC[c],i=[a[0],i[1],a[2],i[3]])}}if(s(r)){var p=r.p2HT([l,h],i);this.isReadOnly()&&"expand"!=p||(e={c:r,ht:p,rtC:this.rtHTl(i)})}}return e},B.prototype.r2I=function(t){return this.ar2I(this.rtCA(t))},B.prototype.ar2I=function(t){var e=!0;if(this.clip2VC()&&this.getCVO){var i=this.getCVO(),o=this.GetScroll();e=g.NRt(g.URt(i.lock.union(),g.ORt(i.unlock.union(),o.x,o.y)),t)}return e&&this.getLIV().y2Is(g.TOf(t),g.BOf(t))||[]},B.prototype.rurOnlyAO=function(){var t=this.oT.oRUR;return t&&t.w==this.oW&&t.ao||null},B.prototype.onSetAO=function(t){function e(e){if(e.isSelectable()){var i=o.toShapes(e);i&&(!g.EyO(i.hover)&&t.set({owner:o,id:e.idAOH||(e.idAOH={}),inv:o.inv,hitTest:function(t,i){return r?r===e:e==o.p2I([t,i])&&o.isAP(t,i)},duration:s}),!g.EyO(i.click)&&t.set({owner:o,id:e.idAOC||(e.idAOC={}),inv:o.inv,hitTest:function(t,i){return r?r==e:e==o.p2I([t,i])&&o.isAP(t,i)},actOn:r==e?1:4,duration:s}))}}var i=null;if(this.isSelectable()&&!t.hasOf(this)&&(i=this.getVI())){var o=this,r=this.rurOnlyAO(),s=o.getSmooth();n(r)?e(r):(i.forEach(function(t,i){e(i)}),this.onExtAO(t,i))}},B.prototype.onExtAO=function(t,e){},B.prototype.onRL=function(){this.oFB.isVisible()&&this.resFB(),this.resVI()},B.prototype.resVI=function(){this.rgVI=null,this.rgVIT=null,this.rgVIB=null,this.resAO()},B.prototype.resLCV=function(){this.oLCV=null,this.oHB.resHVO(),this.resCVO(),this.resVI()},B.prototype.getLCV=function(){return this.oLCV||(this.oLCV=new g.Tree.LCV(this))},B.prototype.resCVO=function(){this.oCVO=null},B.prototype.getCVO=function(){return this.oCVO||(this.oCVO=this.getLCV().getCVO(this))},B.prototype.bU=function(){this.lI++},B.prototype.eU=function(){--this.lI||this.invAO()},B.prototype.wAO=function(){return this._wAO||(this._wAO=[this.oHB,this.oSB,this.oFB,this.oCFB])},B.prototype.rAO=function(){this.bU();var t=this.wAO();t&&t.forEach(function(t){t&&t.isVisible()&&t.invAO()}),this.eU()},B.prototype.onimg=function(){return this.cwbU(),this.onRL(),this.cweU(),!0},B.prototype.islow=function(){return this.getScale()<.5},B.prototype.Smooth=function(t,e,o){function r(t,e,i){if(n(e)){var o=(i?S.getLIV():I.get(S).oLIV).i2R(e,S.origin(),S);if(o){var r,s,l,h=g.TOf(o),a=o[3],u=m[1];return h+a<0||h>u||((s=(r=S.getLIV().rgVI).get(e))&&(l=r.get(this.first()))&&s.y=0&&g.BOf(t)<=e}var e,i=this.getVI();if(i.len())return e=this.GetPageSize()[1],[i.forEachU(function(e,i){return t(e)&&i})||i.first(),i.rforEachU(function(e,i){return t(e)&&i})||i.first()]},B.prototype.origin=function(t){return t=t||this.GetScroll(),[-t.x,-t.y]},B.prototype.ptCA=function(t,e){var i={x:d.X(t),y:d.Y(t)},o=this.GetScroll(),r=this.GetClientRect();return p(e)||e?(i.x-=r[0],i.y-=r[1],i.x=this.scaled(i.x),i.y=this.scaled(i.y),i.x+=o.x,i.y+=o.y):(i.x-=o.x,i.y-=o.y,i.x=this.unscaled(i.x),i.y=this.unscaled(i.y),i.x+=r[0],i.y+=r[1]),i},B.prototype.rtCA=function(t,e){return d.Rect(this.ptCA(d.R2C(t,17),e),this.ptCA(d.R2C(t,68),e))},B.prototype.isExtSBS=function(){var t=this.gCW();return t&&12288==(12288&t.gSBs())},B.prototype.updSPR=function(){if(this.oW){var t=!1,e=this.oW.GetSI(!0),i=this.oW.GetSI(!1),o=this.GetPageSize(),r=[this.getLCV().w,this.getLIV().h];e||(r[0]=o[0]),i||(r[1]=o[1]),[e,i].forEach(function(e,i){e&&(o[i]!=e.page&&(t=!0,e.page=o[i]),r[i]!=e.range&&(t=!0,e.range=r[i]))},this),t&&(this.resVI(),this.oW.SetSI(e,i),!this.lI&&this.invAO())}},B.prototype.getScale=function(){return p(this.scale)&&(this.scale=this.getZoom()/100),this.scale},B.prototype.scaled=function(t){return t/this.getScale()},B.prototype.unscaled=function(t){return t*this.getScale()},B.prototype.ctxScale=function(t,e,i,o){t.translate(e[0],e[1]),t.save(),t.scale(this.getScale(),this.getScale()),i.call(o||this,[0,0,this.scaled(e[2]),this.scaled(e[3])]),t.restore(),t.translate(-e[0],-e[1])},B.prototype.onZoom=function(){this.scale=null,this.oT.resLCV(),this.updSPR(),this.oT.onZoom()},B.prototype.GetZoom=function(){return this.oO.zoom},B.prototype.SetZoom=function(t){this.cwbU(),this.oO.zoom=t,this.onZoom(),this.cweU()},B.prototype.getZoom=function(){var t=this.GetZoom(),e=this.getZoomLevels();return p(t)&&(t=100),T(e[0],m(e[e.length-1],t))},B.prototype.GetZoomLevels=function(){return this.oO.zoomLevels},B.prototype.SetZoomLevels=function(t){this.cwbU(),this.oO.zoomLevels=t,this.onZoom(),this.cweU()},B.prototype.getZoomLevels=function(){var t=[100],e=new g.Arr;return S(this.GetZoomLevels(),"50,65,75,80,90,100,110,125,150,175,200,250,300,400,500").split(",").forEach(function(t){e.push(T(10,m(1e3,C(t,100))))}),e.isEmpty()||(t=e.byO()).sort(function(t,e){return t-e}),t},B.zoomToLevel=function(t,e){var i=0,o=e.length;if(t>=e[i])for(;t>=e[i+1]&&iMath.abs(r)?o:r)),i=this.ptCA(e.ptA,!1),this.rurScrollD(i.x-d.X(e.pt)-o,i.y-d.Y(e.pt)-r),this.onRurScrollD({dx:-o,dy:-r}),this.cweU()},B.prototype.cbkEFPaint=function(t){var e=this.toShapes(t);return e&&function(t,i,o,r){i.drawShape(o,e.normal||e)}},B.prototype.fitEFPaint=function(){return this.cbkEFPaint("frameFit")},B.prototype.selEFPaint=function(){return this.cbkEFPaint("frameSel")},B.prototype.rurFit=function(t,e){e.rurOnlyAO={},e.rurEFPaint=this.fitEFPaint(),e.rurDrop=function(t){this.FitToClient(this.rtSelAbs(t))},this.rurDrag(t,e)},B.prototype.rurSelect=function(t,e){if(this.allowSelect()&&this.allowSelectByDrag()){var i=this,o=this.e2V(t)||i;if(o.ap2I&&o.ar2I){var r=!1,n=this.getSel();e.rurEFPaint=this.selEFPaint(),e.rurEFOpts=function(t,e){e.clipClient=o.GetClientRect()},e.rurDrag=function(t){!r&&(r=2==t.event.drag.status)&&(this.oT.oRUR&&(this.oT.oRUR.ao={}),this.invAO()),r&&this.select(this.isSingleSel()?o.ap2I(t.to):o.ar2I(d.Rect(t.from,t.to)),{selChange:!1})&&((this.isToggleSel()||this.isToggleCtrlSel()&&2&g.ModK(t.event))&&(this.oT.rgSel=new g.Arr(n).toggle(this.oT.rgSel)).isEmpty()&&(this.oT.rgSel=null),this.oT.feTV("invAO"),this.oT.onSel())},e.rurCancel=function(t){this.oT.SetSelection(n)},this.rurDrag(t,e)}}},B.prototype.rurItemDrag=function(t,e){function i(){a=this.getMoveI(l,!0),u=this.oI.dscn(a),(v=function(){var t=x;if(t&&(t=u.len()1)switch(x){case 1:for(var e=a[0].oP,i=1,o=a.length;t&&i=0;h--)i.at(h).isSortable()||(n=h);for(h=r+1;l>s&&hs||(t[0]=i.at(n),t[1]=i.at(l))}return e}.call(this,h=[]))&&(c=function(){var t=new g.Arr,e=this.getLIV().rgVI,i=e.indexOf(l);if(i>=0){var o=l.getHeight(),r=3*this.GetPageSize()[1]/4,n=[],s=[];if(r)for(var h,a,c=i-1,p=i+1,f=e.len(),d=!0;d;c--,p++)d=!1,c>=0&&(h=e.at(c))&&u.has(h)&&o+h.getHeight()1)for(var e=this.getLIV().rgVI,i=u.first();i&&!t;i=u.next(i))t=!c.has(i)&&e.has(i);return t}.call(this),f=this.isItemAlt(c.first())?1:0,p=g.URt(this.getLIV().i2R(c.first(),0,this),this.getLIV().i2R(c.last(),0,this)),C=function(){var t=l.getLevel();return c.forEach(function(e){t=m(t,e.getLevel())}),t}.call(this)-this.gbL(),y=l.getLevel()),v&&this.Smoothless(function(){this.oT.newLIV=function(){return new g.Tree.LHIV(this,u,{i:l,h:p[3]})},this.getIndent=function(t){var e=b.call(this,t);return u.has(t)&&(e=b.call(this)*(t.getLevel()-C+y)),e},this.oT.onRL()}),I&&(I.oTV=this,I.oDI={i:c,g:S,a:f},a&&this.rurItemDragS(I))}function o(t){var e=!t&&v&&F;v&&this.Smoothless(function(){e&&function(){var t=s.call(this,n.call(this),y),e=t.i,i=t.insA,o=[],r=new g.Arr(e);this.cwbU(),a.slice().reverse().forEach(function(t){r.push(t.oP,t),t.SetParent(e);var o=0;i&&(o=i.GetPosition())n[1]+n[3]/2}),e||null}function n(){var t=null,e=this.getLIV(),i=e.rgVI,o=e.oRep;if(o){var r=o.i,n=o.b,s=i.indexOf(r);s>=0&&(t={a:n?r:i.at(s-1),b:n?i.at(s+1):r})}return t}function s(t,e){var i={i:null,insA:null};if(t&&t.a){i.i=t.a;for(var o=0,r=t.a.getLevel()-e;i.i&&o<=r;o++)i.insA=i.i,i.i=i.i.oP}return i}var l=this.rurI(t);if(l&&l.isSelectable()&&l.isSortable()){var h,a,u,c,p,f,C,y,S,v,I,O=this.GetScroll(),E=this.oT.newLIV,b=this.getIndent,w=this.getIndent(),x=function(){var t=3;return e.rurFlags&&(e.rurFlags.has("position")?t=1:e.rurFlags.has("keepindent")&&(t=2)),t}.call(this),F=!0;e.rurAllow=-10,e.rurDragEnd=function(t){a&&this.rurItemDragE(I),o.call(this,t.event.drag.cancel)},e.rurEFOpts=function(t,e){e.clip=null,e.visible=!1,e.limitClient=!1},e.rurEFPaint=function(t,e,i,o){I=I||o,this.drawDI(e,i,I.oDI),S&&this.drawCS(e,i,u.len())},e.rurDrag=function(t){if(t.from!=t.to){if(!a&&i.call(this),F=v){I&&!I.GetVisible()&&I.SetVisible(!0),t.frame=g.ORt(p.slice(),O.x,t.to.y-t.from.y),t.frame[1]<0&&g.ORt(t.frame,0,-t.frame[1]);var e=this.rtCA(t.frame,!1),o=d.X(t.event.drag.current),u=r.call(this,[o,g.TOf(e)]),c=r.call(this,[o,g.BOf(e)]),f=u||c,C=this.getLIV(),S=n.call(this),E=function(t){var e=null;if(t)if(t.a)if(t.b){var i=t.a.getLevel(),o=t.b.getLevel();e=i=E[0]&&y<=E[1],1==x&&(F&=s.call(this,S,y).i==l.oP);break;default:b=E[0],w&&(b+=~~(t.event.drag.offset.dx/w)),b=T(E[0],m(b,E[1]))}if(b!=y&&(y=b,I&&I.Render()),F&&h.length){var V=C.rgVI.indexOf(h[0]),A=(C.rgVI.indexOf(h[1])+1||C.rgVI.len()+1)-1;[C.rgVI.indexOf(S.a),C.rgVI.indexOf(S.b)].forEach(function(t){t>=0&&(F&=t>=V&&t<=A)})}}f&&C.oRep&&(f.i!=C.oRep.i||f.b!=C.oRep.b)&&this.Smooth(function(){C.replace(f),this.rurItemDragD(t)})}t.event.drag.setCursor(g.GP.Get(F?"item-drag":"no",this.getCursors()))}},this.rurDrag(t,e)}},B.prototype.rurItemDragS=function(t){t.rgTVEF||(this.oT.feTV(function(e){if(e!=this){var i=g.EF.Create({relative:e.GetCanvas(),onpaint:function(e,i){this.oTV&&this.oTV.drawDI(e,i,t.oDI)}});i.oTV=e,(t.rgTVEF=t.rgTVEF||[]).push(i)}},this),t.rgTVEF&&(t.SetClient=function(e){return function(i){e.apply(this,arguments);var o=this.oTV.GetClientRect();t.rgTVEF&&t.rgTVEF.forEach(function(t){var e=i.slice(),r=t.oTV.GetClientRect();g.ORt(e,-o[0]+r[0],-o[1]+r[1]),e[2]=r[2],t.SetClient(e)})}}(t.SetClient)))},B.prototype.rurItemDragE=function(t){t&&t.rgTVEF&&(t.rgTVEF.forEach(function(t){g.EF.Destroy(t)}),t.rgTVEF=null)},B.prototype.rurItemDragD=function(t){this.oT.feTV("resVI")},B.prototype.rurItemResize=function(t,e){function i(t){return c(y)&&(t=m(y,t)),c(d)&&(t=T(d,t)),t}function o(t){this.SetScroll({y:g.BOf(this.getLIV().i2R(s))-g.BOf(v)+I.y-this.scaled(T(0,t))})}function r(t){this.cwbU(),l&&l.forEach(function(e,o){p(e)&&l.set(o,e=o.getHeight(u)),o.SetHeight(i(e+t))}),o.call(this,t),this.cweU()}function n(t){this.cwbU(),this.SetDefaultItemHeight(i(u+t)),!l&&this.oI.forEach(function(t){t.getAllowSizing()&&t.getHeight(u)!=u&&(l=l||new Map).set(t,t.GetHeight())}),l&&r.call(this,t),o.call(this,t),this.cweU()}if(t){var s=(this.e2IR(t)||{}).i;if(s){var l,h=!1,a=e.rurFlags,u=this.getDefaultItemHeight(),f=this.oI.rurIH()||[null,null],d=f[0],y=f[1],S=r,v=this.getLIV().i2R(s),I=this.GetScroll();a&&a.has("all")?(d=T(C(d),8),S=n):((l=new Map).set(s,s.GetHeight()),this.isSelected(s)&&this.getSel().forEach(function(t){t.getAllowSizing()&&l.set(t,t.GetHeight())}),l.size>128&&(d=8)),this.doRUR(t,function(t){switch(t.drag.status){case 1:e&&this.oT.oRUR&&(this.oT.oRUR.ao=s),this.rAO();break;case 7:this.oT.oRUR&&(this.oT.oRUR.ao=null),this.rAO(),h&&this.onChange("resize-item",s);break;case 2:h=!0,S.call(this,t.drag.offset.dy);break;case 0:h=!1,S.call(this,0);break;case 6:var i=this.getDefaultItemHeight()-u,o=t.drag.swipe.dy;if(l){var r=l.get(s);p(r)&&(r=u),i=s.getHeight()-r}o&&g.A.Progress(function(t){S.call(this,i+o*t)},{name:"swipe",thisArg:this});break;case 4:case 5:e&&e.rurStatus&&e.rurStatus.call(e.thisArg||this,t)}},this)}}},B.prototype.rurColumnResize=function(t,e){function i(t){t=function(t){return c(a)&&(t=m(a,t)),c(h)&&(t=T(h,t)),t}(t||0),this.cwbU(),s.forEach(function(e,i){i.SetWidth(e+t),t=i==o?-t:t-(i.getWidth()-e)},this),this.cweU()}if(t){var o=(this.e2CR(t)||{}).c;if(o){var r=!1,n=1/this.getScale(),s=new Map,h=null,a=null;if(this.oT.oTV.isCAR()&&l(o)){var u=0,p=this.GetClientRect()[2];this.getLC().vc.forEach(function(t){var e=t.getWidth();t.getAllowSizing()?(u+=e,(s.size||o==t)&&s.set(t,e)):p-=this.unscaled(e)},this),n=T(0,u/p)}else s.set(o,o.getWidth());n&&(s.forEach(function(t,e){e==o?h=-t:a+=t}),this.doRUR(t,function(t){switch(t.drag.status){case 1:e&&this.oT.oRUR&&(this.oT.oRUR.ao=o),this.rAO();break;case 7:this.oT.oRUR&&(this.oT.oRUR.ao=null),this.rAO(),r&&this.onChange("resize-column",o);break;case 2:r=!0,i.call(this,t.drag.offset.dx*n);break;case 0:r=!1,i.call(this,0);break;case 6:var l=o.getWidth()-s.get(o),h=t.drag.swipe.dx*n;h&&g.A.Progress(function(t){i.call(this,l+h*t)},{name:"swipe",thisArg:this});break;case 4:case 5:e&&e.rurStatus&&e.rurStatus.call(e.thisArg||this,t)}},this))}}},B.rurColEF=function(){return g.EF.Item("drop")},B.rurSrc=function(){var t=B.rurColEF();return t&&t.oO.rurSrc||null},B.prototype.rurColumnDrag=function(t,e){var i=this.e2CH(t);if(this.rurCol(i)){var o=!1,r=null,n=null;e.rurDragStart=function(t){r=g.EF.Create({name:"drop",visible:!1,limitClient:!1,relative:this.GetCanvas(),rurSrc:i,onpaint:function(t,e){this.ctxScale(t,e,function(e){this.dCP(t,e)},this)},thisArg:this})},e.rurDragEnd=function(t){o&&this.oCFB.oW.onHovO(),g.EF.Destroy(r)},e.rurEFOpts=function(t,e){e.clip=null,e.visible=!1,e.limitClient=!1},e.rurEFPaint=function(t,e,o,r){n=n||r,this.ctxScale(e,o,function(t){this.rurColDraw(i,e,t)},this)},e.rurDrag=function(t){var e=t.from!=t.to;n&&!n.GetVisible()&&n.SetVisible(e),e&&t.event.drag.setCursor(g.GP.Get("column-drag",this.getCursors())),!o&&e&&this.oCFB.isVisible()&&(o=!0,this.oCFB.oW.onHovI()),t.frame=g.ORt(i.rtC.slice(),t.to.x-t.from.x,t.to.y-t.from.y);var s=this.e2CD(t.event),l=s&&s.rtD;r.SetVisible(l),l&&r.SetClient(this.rtCA(s.rtD,!1))},e.rurDrop=function(t){this.onColDrop(t.event,i,this.e2CD(t.event))},this.rurDrag(t,e)}},B.prototype.rurCol=function(t){return t&&t.c&&t.c.getAllowDrag()},B.prototype.rurColDraw=function(t,e,i){t&&t.h&&t.h.drawCH(e,i,t.c)},B.prototype.onColDrop=function(t,e,i){this.rurColDrop(t,e,i),this.onChange("drag-column",e.c)},B.prototype.rurColDrop=function(t,e,i){this.Smooth(function(){function o(t){return t&&t.h&&t.h.rurColDrop&&t.h||null}var r=o(i)||o(e);if(r)r.rurColDrop(t,e,i);else if(i){var n=this.oS;i.a.split(",").forEach(function(t){switch(t){case"sort":n.lC++,n.sort(i.c,i.c.getSortOrder()||null,!1),c(i.p)&&n.setPos(i.c,i.p),--n.lC,n.onChange();break;case"unsort":n.sort(i.c,0),c(i.p)&&i.c.SetPosition(i.p),!this.getEnsureOnSort()&&this.EnsureVisibleClient(i.c);break;case"sort-pos":n.setPos(i.c,i.p);break;case"pos":i.c.SetPosition(i.p);break;case"hide":i.c.SetVisible(!1);break;case"show":i.c.SetVisible(!0),this.EnsureVisibleClient(i.c)}},this)}})},B.prototype.rurDragDrop=function(t,e){var i,o,r,n=e.rurOnlyW==this.oW&&this.p2I(this.gPtr(t));n&&this.isSable(n)&&g.RUR.D3(t,{inflateClient:0,object:n,shape:(i=this.iaShape(n))&&i.normal||i,client:function(t){var e=this.o2rt(t,"client");return this.oT.oTV.isCAR()||(e[2]=m(e[2],this.unscaled(this.getLCV().wT))),e}.call(this,n),source:r=this,onpaint:function(t,e){(o=new g.M1).set(n,[0,0,r.scaled(e[2]),r.scaled(e[3])]),r.drawVI(t,e,o),o=null},onclick:function(t){e.rurStatus&&(this.oT.oRUR=this.e2RUR(t),e.rurStatus&&e.rurStatus.call(this,t),this.oT.oRUR=null)},onmove:function(t){t.drag.setCursor(g.GP.Get(e.rurName,this.getCursors()))}})},B.prototype.Soom=function(t,e){function i(){var t=this.GetClientRect();n=this.ptCA(e,!1),s={x:t[0],y:t[1]}}var o=c(t),r=c(e);if(o||r){var n,s,l=100*this.getScale();i.call(this),((o&=l!=t)||(r&=n.x!=s.x||n.y!=s.y))&&(g.A.Cancel("soom"),g.A.Progress(function(e){this.cwbU(),o&&this.SetZoom(l+(t-l)*e),r&&(i.call(this),this.rurScrollD((n.x-s.x)*e,(n.y-s.y)*e)),this.cweU()},{name:"soom",thisArg:this,duration:this.getSmooth(),onXDoL:!1,transition:"swipe"}))}},B.prototype.Home=function(){this.Soom(100,[0,0])},B.prototype.FitToClient=function(t){function e(t){return{x:t[0],y:t[1]}}var i=p(t);if(t=t||this.getLIV().rtLyt,p(t))this.Home();else if(!g.EyR(t)){var o=this.GetClientRect(),r=this.getScale(),n=m(o[2]/t[2],o[3]/t[3]),s=e(t);i&&n>r?n=null:n=0},B.prototype.toEVC=function(t,e){e=e||0;var i,o,r,n=this.getLIV(),s=2&e;if(e&&(t.forEach(function(t){t.getParents().forEach(function(e){t!=e&&e.SetExpanded(!0)})}),n=this.getLIV()),t.forEach(function(t){i=g.URt(i,o=n.i2R(t)),s&&o&&(!r||o[1]0&&o.push([e[0],n-.5,e[2],i+1])}var o=[],r=!1,n=e[1];return i.forEach(function(e,i){i.getDivider()&&(r=!0,t(e[1]),n=g.BOf(e))}),r&&t(g.BOf(e)),o.length&&o||(r?[[e[0],e[1],e[2],0]]:null)}();t.save(),this.pGL(t),l&&t.selClip(e,function(){l.forEach(function(e){g.D.P.Rect(t,e)})}),function(e){t.beginPath(),e&&e.call(this),t.stroke()}.call(this,function(){(!n||!0===f)&&this.vGL(t,o,r&&[0,T,0,m]),this.hGL(t,i,r&&[S,0,v,0],d,s,s||C?null:e)}),l&&t.resClip(),t.restore()}function h(){var r=i.last(),n=i.get(r),s=n&&g.BOf(n)||g.TOf(e),l=g.BOf(e);s=0&&t.set(o,e)}),t}();n&&((u=o.union())&&(S=g.LOf(u),v=v&&g.WOf(u)||0),(c=i.union())&&(T=g.TOf(c),m=m&&g.HOf(c)||0)),a=function(){var i=null,o=this.luShape(p);if(o){var r=s.clip||e;p&&((r=e.slice())[2]=v),i=g.Tree.bSCTX(t,o,r)}return i}.call(this),function(){i.vforEach(function(e,i){C&&((e=e.slice())[0]=S,e[2]=v),this.drawI(t,e,i,I,r)},this)}.call(this),f&&(!C&&h.call(this),l.call(this)),a&&function(e){g.Tree.eSCTX(t,e)}.call(this,a)}var r=this.isSelectable()&&t.gAO()||null,n=this.sRng(),s=this.getCVO();g.Tree.VO.drawP(s,t,o,this)})},B.prototype.drawEI=function(t,e,i,o){if((o=o||this.getDefaultItemHeight())>0){var r,n=this.toShapes(g.Tree.Item.prototype.getType()),s=n&&(n.normal||n),l=this.oT.oTV.oSAlt,h=l&&(l.normal||l);if(s||h)for(i=i||0,r=g.BOf(e),(e=e.slice())[3]=o;e[1]1){var r,n,s=this.toShape("multiSel");s&&(i=g.Format(i,0),r=t.sizeHTMLText(i),n=d.C2R(d.R2C(e,o),r.width+8,r.height+8,o),t.drawShape(n,s,{text:i}))}},B.prototype.draw=function(t,e,i){var o=this.getShowLockedItems();o&&(this.drawVI(t,this.getItemsRect(-1),this.getVIT()),this.drawVI(t,this.getItemsRect(1),this.getVIB()),t.selClip(e)),this.drawVI(t,e,this.getVI()),o&&t.resClip()},B.prototype.isDef=function(){return this==this.oT.oTV},B.prototype.GetTfi=function(){return this.oO.tfi},B.prototype.SetTfi=function(t){this.cwbU(),this.oO.tfi=t||null,this.nFH=0,this.onRL(),this.cweU()},B.prototype.getTfi=function(){return this.opt("tfi")},B.prototype.getFH=function(){return this.nFH||(this.nFH=function(){return this.ctxTfi(function(t){return t.fontHeight()})}.call(this))},B.prototype.ctxTfi=function(t,e,i){var o,r;return(i=i||this.gCtx())&&(o=g.TFI.bCTX(i,this.getTfi()),r=t.call(e||this,i),g.TFI.eCTX(i,o)),r},B.prototype.getFont=function(){return this.ctxTfi(function(t){return g.GetFont(t)})},B.prototype.GetLocked=function(){return this.oO.locked},B.prototype.SetLocked=function(t){this.cwbU(),this.oO.locked=t,this.onRL(),this.cweU()},B.prototype.getLocked=function(){return this.opt("locked",!1)},B.prototype.GetReadOnly=function(){return this.oO.readOnly},B.prototype.SetReadOnly=function(t){this.cwbU(),this.oAA=null,this.oO.readOnly=t,this.onRL(),this.cweU()},B.prototype.isReadOnly=function(){return this.opt("readOnly",!1)},B.prototype.GetWheelChange=function(){return this.oO.wheelChange},B.prototype.SetWheelChange=function(t){this.cwbU(),this.oO.wheelChange=t,this.onRL(),this.cweU()},B.prototype.getWheelChange=function(){return this.opt("wheelChange",18)},B.prototype.GetSmooth=function(){return this.oO.smooth},B.prototype.SetSmooth=function(t){this.oO.smooth=t,!this.lI&&this.rAO()},B.prototype.getSmooth=function(){return this.islow()?0:T(0,C(this.opt("smooth",125)))},B.prototype.GetMargins=function(){return this.oO.margins},B.prototype.SetMargins=function(t){this.cwbU(),this.oM=null,this.oO.margins=t||null,this.onRL(),this.cweU()},B.prototype.getMargins=function(){if(p(this.oM)){var t=this.opt("margins",null);v(t)||(t={}),this.oM=g.Inh(t,g.Def.Tree.margins||{indent:16})}return this.oM},B.prototype.GetHasLines=function(){return this.oO.hasLines},B.prototype.SetHasLines=function(t){this.cwbU(),this.oO.hasLines=t,this.ohL=void 0,this.cweU()},B.prototype.getHasLines=function(){return void 0===this.ohL&&(this.ohL=function(){var t=this.GetHasLines();return v(t)&&("color"in t||"style"in t||"width"in t||"cap"in t||"join"in t)&&{color:t.color,style:t.style,width:t.width,cap:t.cap,join:t.join}||null}.call(this)),this.ohL},B.prototype.GetHasButtons=function(){return this.oO.hasButtons},B.prototype.SetHasButtons=function(t){this.cwbU(),this.oO.hasButtons=t,this.cweU()},B.prototype.getHasButtons=function(){return this.opt("hasButtons",!0)},B.prototype.GetLinesAtRoot=function(){return this.oO.linesAtRoot},B.prototype.SetLinesAtRoot=function(t){this.cwbU(),this.oO.linesAtRoot=t,this.cweU()},B.prototype.getLinesAtRoot=function(){return f(this.opt("linesAtRoot"),g.Tree.LinesAtRootEnum,0)},B.prototype.isIndent=function(t){var e,i,o=!0;if(5==this.getLinesAtRoot()&&(e=t.oP)){for(i=e.gfNZ();o&&i;i=e.gnNZ(i))o=!i.hasChild();o=!o}return o},B.prototype.gbL=function(){return(this.getHasLines()||this.getHasButtons())&&this.getLinesAtRoot()?1:0},B.prototype.getIndent=function(t){var e,i=T(0,C(this.getMargins().indent,16));return t&&(e=t.getLevel()+this.gbL(),this.isIndent(t)||(e=T(0,e-1)),i*=e),i},B.prototype.GetExpandGlyphSize=function(){return this.oO.expandGlyphSize},B.prototype.SetExpandGlyphSize=function(t){this.cwbU(),this.oO.expandGlyphSize=t,this.onRL(),this.cweU()},B.prototype.getExpandGlyphSize=function(){return T(0,C(this.opt("expandGlyphSize",16)))},B.prototype.GetCrSize=function(){return this.oO.crSize},B.prototype.SetCrSize=function(t){this.cwbU(),this.oO.crSize=t,this.oCFB.resHVO(),this.cweU()},B.prototype.getCrSize=function(){return T(0,C(this.opt("crSize",16)))},B.prototype.GetHeaderHeight=function(){return this.oO.headerHeight},B.prototype.SetHeaderHeight=function(t){this.cwbU(),this.oO.headerHeight=t,this.oT.resLCV(),this.onRL(),this.cweU()},B.prototype.getHeaderHeight=function(){return T(0,C(this.opt("headerHeight",24)))},B.prototype.GetHeaderVisible=function(){return this.oO.headerVisible},B.prototype.SetHeaderVisible=function(t){this.cwbU(),this.oO.headerVisible=t,this.oT.resLCV(),this.onRL(),this.cweU()},B.prototype.getHeaderVisible=function(){return f(this.opt("headerVisible"),g.Tree.HeaderVisibleEnum,g.Tree.HeaderVisibleEnum.exHeaderVisible)},B.prototype.GetHeaderEnabled=function(){return this.oO.headerEnabled},B.prototype.SetHeaderEnabled=function(t){this.cwbU(),this.oO.headerEnabled=t,this.cweU()},B.prototype.getHeaderEnabled=function(){return this.opt("headerEnabled",!0)},B.prototype.getAllowChangeParent=function(){return!0},B.prototype.GetShapes=function(){return this.oO.shapes},B.prototype.SetShapes=function(t){this.cwbU(),this.sShs=null,this.oSAlt=void 0,this.oSDiv=void 0,this.oO.shapes=t,this.onRL(),this.cweU()},B.prototype.defShp=function(){return"Button(column,sortBar-caption,filterBar-close),Expand(expand),FrameFit(frameFit),FrameSel(select,frameSel),CheckBox(check),Radio(radio)"},B.prototype.getShapes=function(){var t=this.sShs;return p(t)&&(p(t=this.GetShapes())&&(t=g.Def.Tree.shapes),t=S(t,this.defShp()),this.sShs=t),t},B.prototype.toShapes=function(t){return t&&g.S.GetOf(t.GetShape&&t.GetShape()||B.typeOf(t),this.getShapes(),"Tree")||null},B.prototype.toShape=function(t,e){var i=this.toShapes(t),o=i&&i.normal||i;return o&&e&&i&&i.disabled&&(o=g.Inh(i.disabled,o)),o},B.prototype.luShape=function(t){return this.toShape(t?"lock":"unlock")},B.prototype.isItemAlt=function(t){var e=this.getLIV().rgVI.indexOf(t);return e>=0&&e%2},B.prototype.iaShape=function(t){var e=this.toShapes(t);return p(t.GetShape())&&(void 0===this.oSAlt&&(this.oSAlt=this.toShapes("itemAlt")||null),void 0===this.oSDiv&&(this.oSDiv=this.toShapes("itemDiv")||null),this.oSDiv&&t.getDivider()?e=this.oSDiv:this.oSAlt&&this.isItemAlt(t)&&(e=this.oSAlt)),e},B.prototype.GetCursors=function(){return this.oO.cursors},B.prototype.SetCursors=function(t){this.cwbU(),this.sCrs=null,this.oO.cursors=t,this.onRL(),this.cweU()},B.prototype.defCrs=function(){return"not-allowed(no),grab(long),pointer(expand,check,radio,filterBar-close,filterBar-caption-column,column-filter,column-drag,item-drag,drag-drop,anchor),text(filterBar-prompt)"},B.prototype.getCursors=function(){var t=this.sCrs;return p(t)&&(p(t=this.GetCursors())&&(t=g.Def.Tree.cursors),t=S(t,this.defCrs()),this.sCrs=t),t},B.prototype.GetFormatText=function(){return this.oO.formatText},B.prototype.SetFormatText=function(t){this.cwbU(),this.nFT=null,this.oO.formatText=t,this.onRL(),this.cweU()},B.prototype.getFormatText=function(){return p(this.nFT)&&(this.nFT=f(this.opt("formatText"),g.DrawTextFormatEnum,g.DrawTextFormatEnum.exTextAlignLeft|g.DrawTextFormatEnum.exTextAlignVCenter|g.DrawTextFormatEnum.exTextWordBreak|g.DrawTextFormatEnum.exTextWordEllipsis)),this.nFT},B.prototype.GetPad=function(){return this.oO.pad},B.prototype.SetPad=function(t){this.cwbU(),this.rgPad=null,this.oO.pad=t,this.onRL(),this.cweU()},B.prototype.getPad=function(){return p(this.rgPad)&&(this.rgPad=g.pad2A(this.opt("pad",[4,4]))),this.rgPad},B.prototype.GetImageSize=function(){return this.oO.imageSize},B.prototype.SetImageSize=function(t){this.cwbU(),this.aIS=void 0,this.oO.imageSize=t,this.onRL(),this.cweU()},B.prototype.getImageSize=function(){return void 0===this.aIS&&(this.aIS=this.opt("imageSize",18)),this.aIS},B.prototype.GetImageAlign=function(){return this.oO.imageAlign},B.prototype.SetImageAlign=function(t){this.cwbU(),this.nIA=null,this.oO.imageAlign=t,this.onRL(),this.cweU()},B.prototype.getImageAlign=function(){return p(this.nIA)&&(this.nIA=~~this.opt("imageAlign",0)),this.nIA},B.prototype.GetAllowActions=function(){return this.oO.allowActions},B.prototype.SetAllowActions=function(t){this.cwbU(),this.oAA=null,this.oO.allowActions=t,this.cweU()},B.prototype.gAA=function(){return this.oAA||(this.oAA=new g.AA(this.opt("allowActions",this.oT.defAA()),this.isReadOnly()?this.oT.roAA():"")),this.oAA},B.prototype.GetCountLockedColumns=function(){return this.oO.countLockedColumns},B.prototype.SetCountLockedColumns=function(t){this.cwbU(),this.oO.countLockedColumns=t,this.oT.resLCV(),this.onRL(),this.cweU()},B.prototype.getCountLockedColumns=function(){return T(0,~~this.opt("countLockedColumns",0))},B.prototype.GetColumnAutoResize=function(){return this.oO.columnAutoResize},B.prototype.SetColumnAutoResize=function(t){this.cwbU(),this.oO.columnAutoResize=t,this.oT.resLCV(),this.onRL(),this.cweU()},B.prototype.isCAR=function(){return!!this.opt("columnAutoResize",!1)},B.prototype.GetSortBarVisible=function(){return this.oO.sortBarVisible},B.prototype.SetSortBarVisible=function(t){this.cwbU(),this.oO.sortBarVisible=t,this.cweU()},B.prototype.showSB=function(){return!!this.opt("sortBarVisible",!1)},B.prototype.GetSortBarCaption=function(){return this.oO.sortBarCaption},B.prototype.SetSortBarCaption=function(t){this.cwbU(),this.oO.sortBarCaption=t,this.cweU()},B.prototype.getSortBarCaption=function(){return this.opt("sortBarCaption","Drag a column header here to sort by that column.")},B.prototype.GetSingleSort=function(){return this.oO.singleSort},B.prototype.SetSingleSort=function(t){this.cwbU(),this.oO.singleSort=t,this.oS.onSingleSort(),this.cweU()},B.prototype.isSingleSort=function(){return!!this.opt("singleSort",!1)},B.prototype.GetSortOnClick=function(){return this.oO.sortOnClick},B.prototype.SetSortOnClick=function(t){this.oO.sortOnClick=t},B.prototype.getSortOnClick=function(){return f(this.opt("sortOnClick"),g.Tree.SortOnClickEnum,g.Tree.SortOnClickEnum.exDefaultSort)},B.prototype.isSortOnClick=function(){return this.getSortOnClick()==g.Tree.SortOnClickEnum.exDefaultSort},B.prototype.GetAllowGroupBy=function(){return this.oO.allowGroupBy},B.prototype.SetAllowGroupBy=function(t){this.cwbU(),this.oO.allowGroupBy=t,this.oC.resLC(),this.cweU()},B.prototype.getAllowGroupBy=function(){return this.opt("allowGroupBy",!1)},B.prototype.GetGroupByFormatCell=function(){return this.oO.groupByFormatCell},B.prototype.SetGroupByFormatCell=function(t){this.bU(),this.oO.groupByFormatCell=t,function(t){if(t.oG&&t.oG.rgGI){var e=t.oT.oC,i=new g.Arr;t.oT.oC.forEach(function(t){null==t.GetGroupByFormatCell()&&i.add(t.GetIndex())}),t.oG.rgGI.forEach(function(t,o){i.has(t)&&o.Cell(t).SetFormat(e.Item(t).getGroupByFormatCell())})}}(this.oI),this.eU()},B.prototype.getGroupByFormatCell=function(){return S(this.GetGroupByFormatCell(),"(exp(``) ? `` : ``) + value + (0:=get(`count(current,rec,1)`) ? (` (` + =:0 + `)`) : ``)")},B.prototype.GetColumnsFloatBarVisible=function(){return this.oO.columnsFloatBarVisible},B.prototype.SetColumnsFloatBarVisible=function(t){this.cwbU(),this.oO.columnsFloatBarVisible=t;var e=this.oT.oCW,i=e.W("control"),o=e.W("floatbar");o&&e.Dock(o,i,256&this.showCFB()?0:4,o.oCW.w2R(o)),this.oCFB.resHVO(),this.cweU()},B.prototype.showCFB=function(){return f(this.opt("columnsFloatBarVisible"),g.Tree.ColumnsFloatBarVisibleEnum,0)},B.prototype.GetColumnsFloatBarSortOrder=function(){return this.oO.columnsFloatBarSortOrder},B.prototype.SetColumnsFloatBarSortOrder=function(t){this.cwbU(),this.oO.columnsFloatBarSortOrder=t,this.cweU()},B.prototype.getColumnsFloatBarSortOrder=function(){return this.opt("columnsFloatBarSortOrder",0)},B.prototype.GetColumnsFloatBarCaption=function(){return this.oO.columnsFloatBarCaption},B.prototype.SetColumnsFloatBarCaption=function(t){this.cwbU(),this.oO.columnsFloatBarCaption=t,this.oCFB.resHVO(),this.cweU()},B.prototype.getColumnsFloatBarCaption=function(){return this.opt("columnsFloatBarCaption","Columns")},B.prototype.GetDrawGridLines=function(){return this.oO.drawGridLines},B.prototype.SetDrawGridLines=function(t){this.cwbU(),this.oO.drawGridLines=t,this.cweU()},B.prototype.getDrawGridLines=function(){return this.islow()?0:f(this.opt("drawGridLines"),g.Tree.GridLinesEnum,0)},B.prototype.clip2VC=function(){var t=this.getDrawGridLines();return!t||-2==t||2==t},B.prototype.GetGridLines=function(){return this.oO.gridLines},B.prototype.SetGridLines=function(t){this.cwbU(),this.oO.gridLines=g.Mrg(this.getGridLines()||{},t),this.cweU()},B.prototype.getGridLines=function(){return this.opt("gridLines",{color:"gray",style:1})},B.prototype.GetDefaultItemHeight=function(){return this.oO.defaultItemHeight},B.prototype.SetDefaultItemHeight=function(t){this.cwbU();var e=this.getDefaultItemHeight();if(this.oO.defaultItemHeight=t,e){var i=this.getDefaultItemHeight()/e;1!=i&&this.oI.forEach(function(t){var e=t.GetHeight();c(e)&&t.getAllowSizing()&&t.SetHeight(e*i)})}this.oT.onRL(),this.cweU()},B.prototype.getDefaultItemHeight=function(){return T(0,C(this.opt("defaultItemHeight",24)))},B.prototype.GetTreeColumnIndex=function(){return this.oO.treeColumnIndex},B.prototype.SetTreeColumnIndex=function(t){t!=this.getTreeColumnIndex()&&(this.cwbU(),this.oC.resKI(),this.oO.treeColumnIndex=t,this.cweU())},B.prototype.getTreeColumnIndex=function(){var t=this.GetTreeColumnIndex();return void 0===t&&(t=g.Def.Tree.treeColumnIndex||0),t},B.prototype.GetExpandOnDblClick=function(){return this.oO.expandOnDblClick},B.prototype.SetExpandOnDblClick=function(t){this.oO.expandOnDblClick=t},B.prototype.getExpandOnDblClick=function(){return this.opt("expandOnDblClick",!0)},B.prototype.GetItemAllowSizing=function(){return this.oO.itemAllowSizing},B.prototype.SetItemAllowSizing=function(t){this.oO.itemAllowSizing=t},B.prototype.getItemAllowSizing=function(){return this.opt("itemAllowSizing",!1)},B.prototype.GetEnsureOnSort=function(){return this.oO.ensureOnSort},B.prototype.SetEnsureOnSort=function(t){this.oO.ensureOnSort=t},B.prototype.getEnsureOnSort=function(){return this.opt("ensureOnSort",!0)},B.prototype.GetShowLockedItems=function(){return this.oO.showLockedItems},B.prototype.SetShowLockedItems=function(t){this.cwbU(),this.oO.showLockedItems=t,this.oT.onRL(),this.oT.resLCV(),this.cweU()},B.prototype.getShowLockedItems=function(){return this.opt("showLockedItems",!0)&&(this.oIT.len()||this.oIB.len())},B.prototype.LIOf=function(t){return this.oT.LIOf(t)},B.prototype.GetLockedItemsCount=function(t){return this.LIOf(t).GetCount()},B.prototype.SetLockedItemsCount=function(t,e){e=T(0,m(16,~~y(e,1)));var i=this.LIOf(t);if(i.GetCount()!=e){this.cwbU();for(var o=[],r=e,n=i.GetCount();rStart Filter...")},B.prototype.GetFilterBarPromptPattern=function(){return this.oO.filterBarPromptPattern},B.prototype.SetFilterBarPromptPattern=function(t){this.cwbU(),this.oO.filterBarPromptPattern=c(t)&&t.toString()||null,this.oT.onFilter(),this.cweU()},B.prototype.getFilterBarPromptPattern=function(){return S(this.GetFilterBarPromptPattern())},B.prototype.GetFilterBarPromptType=function(){return this.oO.filterBarPromptType},B.prototype.SetFilterBarPromptType=function(t){this.cwbU(),this.oO.filterBarPromptType=t,this.oT.onFilter(),this.cweU()},B.prototype.getFilterBarPromptType=function(){return f(this.opt("filterBarPromptType"),g.Tree.FilterPromptEnum,g.Tree.FilterPromptEnum.exFilterPromptContainsAll)},B.prototype.GetFilterBarPromptColumns=function(){return this.oO.filterBarPromptColumns},B.prototype.SetFilterBarPromptColumns=function(t){this.cwbU(),this.oO.filterBarPromptColumns=t,this.oT.onFilter(),this.cweU()},B.prototype.getFilterBarPromptColumns=function(){var t=this.opt("filterBarPromptColumns",-1);if(-1==t)t=null;else{var e=this.oC.Items(t);t=[],e.forEach(function(e){t.push(e.GetIndex())})}return t},B.prototype.GetAllowDrop=function(){return this.oO.allowDrop},B.prototype.SetAllowDrop=function(t){this.oO.allowDrop=t},B.prototype.getAllowDrop=function(){return this.opt("allowDrop",!1)},B.prototype.GetOnErrorChooseFile=function(){return this.oO.onErrorChooseFile},B.prototype.SetOnErrorChooseFile=function(t){this.oO.onErrorChooseFile=t},B.prototype.getOnErrorChooseFile=function(){return this.opt("onErrorChooseFile",!0)},B.prototype.GetScrollPos=function(){return this.GetScroll()},B.prototype.SetScrollPos=function(t){this.SetScroll(t)},B.prototype.getScrollPos=function(){return this.GetScrollPos()},B.prototype.GetToolTipDelay=function(){return this.oO.toolTipDelay},B.prototype.SetToolTipDelay=function(t){this.oO.toolTipDelay=t},B.prototype.getToolTipDelay=function(){return this.opt("toolTipDelay",500)},B.prototype.GetToolTipPopDelay=function(){return this.oO.toolTipPopDelay},B.prototype.SetToolTipPopDelay=function(t){this.oO.toolTipPopDelay=t},B.prototype.getToolTipPopDelay=function(){return this.opt("toolTipPopDelay",5e3)},B.prototype.GetToolTipWidth=function(){return this.oO.toolTipWidth},B.prototype.SetToolTipWidth=function(t){this.oO.toolTipWidth=t},B.prototype.getToolTipWidth=function(){return this.opt("toolTipWidth",-1)},B.prototype.allowTT=function(){return g.TT&&this.getToolTipWidth()&&this.getToolTipPopDelay()},B.prototype.GetBackground=function(){return this.oO.background},B.prototype.SetBackground=function(t){this.cwbU(),this.oO.background=t,this.cweU()},B.prototype.getBackground=function(){return this.opt("background",D)},B.prototype.back=function(t,e){var i,o=this.getBackground(),r=o&&o[t];return p(r)&&(e&&t in o||p(r=(i=g.Def.Tree.background)&&i[t])&&(r=D[t])),r},B.prototype.GetConditional=function(){return this.oO.conditional},B.prototype.SetConditional=function(t){this.cwbU(),this.oO.conditional=t;var e=this.oT.oCF;e.Clear(),c(t)&&(o(t)?t:[t]).forEach(function(t){e.Add(t)}),this.cweU()},B.prototype.getConditional=B.prototype.GetConditional,g.expO({Count:null,Sorts:null},E.prototype),g.expO(g.Mrg({Options:null,Index:null},g.Tree.ColumnOptions),b.prototype),g.expO({Count:null,VisibleCount:null,MatchCount:null,LeafCount:null,HasChildren:null},x.prototype),g.expO(g.Mrg({Options:null,Index:null,Position:null,GroupItem:null},g.Tree.ItemOptions),F.prototype),g.expO({Locked:null},F.prototype,null,!1,g.expL("is")),g.expO(g.Mrg({Column:null,Item:null,Options:null},g.Tree.CellOptions),G.prototype),g.expO({Count:null},A.prototype),g.expO(g.Mrg({Options:null,Valid:null},g.Tree.ConditionalFormatOptions),R.prototype),{VO:t,EC:e,LC:h,LCV:O,Columns:E,Column:b,Sorter:w,Items:x,Item:F,CellF:N,ConditionalFormats:A,ConditionalFormat:R,Cell:G,LIV:k,LHIV:L,TV:B,BackgroundOptions:D}}()),g.Mrg(g.Tree.TV,function(){function t(t){this.init(t)}function o(t){t.oSB=this,this.init(t)}function r(t){t.oCFB=this,this.ctxRot=!0,this.huSPR=null,this.init(t)}function n(t){this.init(t)}var s,h="exprompt";return t.prototype.init=function(t){this.oTV=t,this.oS=t.oS,this.rgHVO=null,this.import()},g.SB.addProto(t.prototype),t.prototype.import=function(){this.oTV.export(this),["getLC"].forEach(function(t){this[t]=this.oTV.oC[t].bind(this.oTV.oC)},this),["isSort","getSortPos","getSortLen"].forEach(function(t){this[t]=this.oS[t].bind(this.oS)},this),["getLCV","getLocked","dowheel","toShape","getSmooth","e2W","drawExp","drawChk","drawRad","drawSort","xA","ctxTfi","getToolTipDelay","getToolTipPopDelay","getToolTipWidth","allowTT"].forEach(function(t){this[t]=this.oTV[t].bind(this.oTV)},this),["cvo2CR","onwheel","GetPageSize","gPtr","ptCA","rtCA"].forEach(function(t){this[t]=this.oTV[t].bind(this)},this)},t.prototype.attach=function(){this.oW.GetEnabled=this.oTV.getHeaderEnabled.bind(this.oTV)},t.prototype.defSts=function(t){},t.prototype.toShapes=function(t){return this.oTV.toShapes(t)},t.prototype.getCursors=function(){return this.oTV.getCursors()},t.prototype.gAA=function(){return this.oTV.gAA()},t.prototype.getPad=function(){return this.oTV.getPad()},t.prototype.getCrSize=function(){return this.oTV.getCrSize()},t.prototype.isReadOnly=function(){return this.oTV.isReadOnly()},t.prototype.onhscroll=function(t){this.resHVO()},t.prototype.onsize=function(t){!this.visAO()&&this.resAO(),this.resHVO()},t.prototype.ondown=function(t){return this.oTV.ondown(t)},t.prototype.onRurScrollD=function(t){t.dy=0},t.prototype.draw=function(t,e){this.ctxScale(t,e,function(e){this.drawH(t,e)},this)},t.prototype.rtDraw=function(t){return t},t.prototype.isHeader=function(){return this.getHVO==t.prototype.getHVO},t.prototype.luShape=function(t){return this.toShape(t?"lock-header":"unlock-header")},t.prototype.drawH=function(t,e){var i=null,o=this.isSelectable()?t.gAO():null,r=this.isHeader(),n=this.getHVO();g.Tree.VO.drawP(n,t,function(s){r&&(i=function(i){var o=null,r=this.luShape(i);if(r){var s=n.clip||e;i&&((s=e.slice())[2]=n.lock.union()[2]),o=g.Tree.bSCTX(t,r,s)}return o}.call(this,n.lock==s)),s.vforEach(function(e,i){this.drawCH(t,this.rtDraw(e),i,o)},this),i&&function(e){g.Tree.eSCTX(t,e)}.call(this,i)},this)},t.funnel=function(){var t=new Image;return t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAuElEQVQ4jc3QIW4CARSE4W8XNgRICGmqEQgMBlFBMGgkh+EUdT1ADZuKQgLBcAxOQE+ABkVAAMlm2y27wTDuzbz58/ICBBijpJiOWASoYYH3goAJxmXssUWEdc7yCD843IwQnxjmKA8wRTkdRPjC2z/lHr5RyVqoYo7uH1nH5Vf1eyc2sEQ74bWwQvNe+aZXxIk5vnq/FGYAdjgl5tPVyw3IrecGBI8CtvjAS5GL0upihs0jEOhnBWfwwBhwkjKm3AAAAABJRU5ErkJggg==",t}(),t.hfunnel=function(){var t=new Image;return t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAkklEQVQ4jeXRMQoCMRBG4S+uIiqIhXfwCJ7D48kewE4bG61srCw8yLZaiWjjQhCzbrD0QSBk8v7MkICABQp53LEJGOKaKdeM6k2JR+Yq46QCqwx5je57Oz1sW8h79FMzDXBokI/x3CnGOH2Qz5h8k2umuETy5XWWRRUFVKlLndzUPwtY4vbrAzPsNPxCGwLmqeITwJM9xqbla4gAAAAASUVORK5CYII=",t}(),t.prototype.drawCH=function(e,i,o,r){function n(i){var o=this.toShapes(l.getType("filter"))||{},r=o.normal||o;!this.isEnabled()&&(g.EyO(o.disabled)||(r=g.Inh(o.disabled,r))),e.drawShape(i,r),r.text||r.draw||function(i,o){var r=o?t.hfunnel:t.funnel;r&&r.width&&r.height&&e.drawImage(r,0,0,r.width,r.height,i[0],i[1],i[2],i[3])}(i,l.hasFilter())}var s,l=o.c||o,h=this.toShapes(l)||{},a=h.normal||h;!l.isEnabled()?g.EyO(h.disabled)||(a=g.Inh(h.disabled,a)):r&&(g.EyO(h.hover)||(s=r.get(this,l.idAOH))&&(a=g.R.Shape(s.state,s.range,{from:a,to:h.hover})),g.EyO(h.click)||(s=r.get(this,l.idAOC))&&(a=g.R.Shape(s.state,s.range,{from:a,to:h.click})));var u=g.Tree.bSCTX(e,a,i),c=l.gCnt(i,this);e.selClip(i),e.drawHTMLPicture(l.getImage(),c.rtImage,l.getImageSize()),e.drawHTMLText(l.getCaption(),c.rtCaption,l.getFormatText()||a.formatText,a.tfi&&g.ToTFI(a.tfi)),c.rtSort&&function(t){var i=e.globalAlpha;e.globalAlpha=e.globalAlpha/2,this.drawSort(l.isSort(),e,t),function(){return this.isHeader()&&!this.oTV.oT.oSB.isVisible()&&!this.oTV.getAllowGroupBy()&&this.getSortLen()>1}.call(this)&&e.drawHTMLText(""+(1+this.getSortPos(l)),g.ORt(t.slice(),.5*t[2],-2.15*t[3]),g.DrawTextFormatEnum.exTextNoClip),e.globalAlpha=i}.call(this,c.rtSort),c.rtExpand&&this.drawExp(e,c.rtExpand,l.isExpanded(),!l.isEnabled()),c.rtFilter&&n.call(this,c.rtFilter),e.resClip(),u&&g.Tree.eSCTX(e,u)},t.prototype.getTfi=function(){return this.oTV.getTfi()},t.prototype.getType=function(){return"header"},t.prototype.invHVO=function(){this.resHVO(),this.invAO()},t.prototype.isSelectable=function(){return this.oTV.isSelectable()&&this.isEnabled()&&!this.isLocked()},t.prototype.getCursor=function(t){var e,i,o,r=this.p2CR(t);return r&&34!=r.ht?i=g.HitTest.Cursor.Rect(r.ht):this.isSelectable()&&(o=this.p2C(t))&&(e=this.getCursors(),this.p2CF(t)&&o.canFilter()?i=g.GP.Get("column-filter",e):this.p2CE(t)&&o.canExpand()&&(i=g.GP.Get("expand",e)),i||(i=o.GetCursor())||(i=g.GP.Get(g.Tree.TV.typeOf(o),e))),i||null},t.prototype.onio=function(t){this.allowTT()&&this.hideTT()},t.prototype.onmousemove=function(t){var e,i=this.gPtr(t),o=this.getCursor(i);return o&&(e=this.GetCanvas())&&(e.style.cursor=o),this.allowTT()&&this.showTT(t),o},t.prototype.rurOnlyAO=function(){var t=this.oTV.oT.oRUR;return t&&(t.w==this.oW||t.w==this.oTV.oW)&&t.ao||null},t.prototype.onSetAO=function(t){function e(t){return(this.p2CR(t)||{}).c||this.p2C(t)}function i(i){var o=this.toShapes(i);o&&(!g.EyO(o.hover)&&t.set({owner:this,id:i.idAOH||(i.idAOH={}),inv:this.inv,hitTest:function(t,o){return r?r==i:i==e.call(this,[t,o])&&this.isAP(t,o)},duration:n}),!g.EyO(o.click)&&t.set({owner:this,id:i.idAOC||(i.idAOC={}),inv:this.inv,hitTest:function(t,o,n){return r?r==i:i==e.call(this,[t,o])&&this.isAP(t,o)},actOn:r==i?1:4,duration:n}))}var o;if(this.isSelectable()&&!t.hasOf(this)&&(o=this.getHVO())){var r=this.rurOnlyAO(),n=this.getSmooth();l(r)?i.call(this,r):[o.lock,o.unlock].forEach(function(e){e.forEach(function(e,o){i.call(this,o.c),!o.c&&this.onAObj(t,o)},this)},this)}},t.prototype.onAObj=function(t,e){},t.prototype.resHVO=function(){this.rgHVO=null,this.resAO()},t.prototype.p2C=function(t,e){var i=this.ptCA(t),o=this.GetScroll(),r=g.Tree.VO.p2O(this.getHVO(),d.X(i)-o.x,d.Y(i)-o.y,e);return e&&r&&g.ORt(e,o.x,o.y),(r||{}).c||null},t.prototype.e2C=function(t){return this.e2W(t)==this.oW&&this.p2C(this.gPtr(t))||null},t.prototype.isReverse=function(){return this.gCW()==this.oTV.gCW()&&d.R2C(this.GetClientRect())[1]>d.R2C(this.oTV.GetClientRect())[1]},t.prototype.gSize=function(){return{height:this.oTV.oT.nHLC*this.oTV.getHeaderHeight()}},t.prototype.getHVO=function(){return this.rgHVO||(this.rgHVO=this.getLC().getHVO(this))},t.prototype.GetScroll=function(){var t=this.oTV.GetScroll();return t.y=0,t},t.prototype.p2CR=function(t){return this.isSelectable()&&!this.isReadOnly()&&this.gAA().Has("column-resize","header")&&this.cvo2CR(this.getHVO(),t)||null},t.prototype.p2CE=function(t){var e=[],i=this.isSelectable()&&this.p2C(t,e);if(i=this.showGlyphs(i).e&&i||null){var o=i.gCnt(e,this);if(o.rtExpand){var r=this.ptCA(t);i=g.PInR(d.X(r),d.Y(r),o.rtExpand)&&i||null}}return i},t.prototype.p2CF=function(t,e){var i=[],o=this.isSelectable()&&this.p2C(t,i);if(o=this.showGlyphs(o).f&&o||null){var r=o.gCnt(i,this);if(r.rtFilter){var n=this.ptCA(t);(o=g.PInR(d.X(n),d.Y(n),r.rtFilter)&&o||null)&&e&&(e.c=o,e.o=this,e.rtC=this.rtCA(i,!1))}}return o},t.prototype.showGlyphs=function(t){return t&&{e:t.showExpand(),s:t.isSort(),f:t.showFilterButton()}||{}},t.prototype.getRurDragScrollOut=function(){var t,e=this.oTV.oHB;return e.isVisible()&&(t=this.gCW().v2Crt(e.gCW().c2Vrt(e.GetClientRect()))),t},t.prototype.toClick=function(t,e){e.column=this.e2C(t)},t.prototype.hideTT=function(){g.TT.Hide()},t.prototype.showTT=function(t){var e,i=this.gPtr(t),o=[],r=this.p2C(i,o),n=16;g.TT.Show(function(){return r&&(e=r.tt(this,o))&&{relative:t.target,client:function(){return this.ctxTfi(function(t){var i=g.NRt(e.rtT,this.GetWindowRect())||e.rtT,o=t.fontHeight(),r=[0,0,this.getToolTipWidth(),o],s=t.drawHTMLText(e.t,r,1024|n);return[i[0],i[1]+(s.height>o?0:(i[3]-s.height)/2),~~(s.width+1),s.height]})}.call(this),onpaint:function(t,i){this.ctxTfi(function(t){t.drawHTMLText(e.t,i,n)},this,t)},thisArg:this}},{thisArg:this,ttO:r,ttD:this.getToolTipDelay(),ttP:this.getToolTipPopDelay()})},Object.addPrototypeOf(o.prototype,t.prototype),o.prototype.init=function(t){return function(e){t.call(this,e);var i=this,o=this.oTV.oS;o.onSort=function(t){return function(){t.call(this),i.resHVO()}}(o.onSort)}}(o.prototype.init),o.prototype.import=function(t){return function(){t.call(this),this.oTV.oS.export(this)}}(o.prototype.import),o.prototype.gSize=function(){return{height:2*this.getPad()[1]+1*this.oTV.getHeaderHeight()}},o.prototype.getType=function(){return"sortBar"},o.prototype.showGlyphs=function(t){return function(){var e=t.apply(this,arguments);return e.e=!1,e}}(o.prototype.showGlyphs),o.prototype.getHVO=function(){return this.rgHVO||(this.rgHVO=function(){var t=g.Tree.VO();if(!this.isEmpty()){var e=this.getPad(),i=[e[0],e[1],0,this.oTV.getHeaderHeight()],o=null,r=null,n=0,s=1,l=new Map,h=this.scaled(this.GetClientRect()[2])-e[0]*(this.len()+1),a=0;if(this.forEach(function(t){l.set(t,{auto:o=t.autoWidth(),width:r=T(o,t.getWidth())}),n+=r}),(a=n-h)>0){for(var u=!0,c=this.len();u&&(a=~~(n-h))>0;){var p=a;l.forEach(function(t){if(a>0){var e=m(a/c,T(0,t.width-t.auto));t.width-=e,n-=e,a-=e}}),u=p-a}a>0&&(s=m(1,h/n))}this.forEach(function(o){i[2]=s*l.get(o).width,t.lock.set(o.IDHVO(),i.slice()),g.ORt(i,i[2]+e[0],0)},this)}return t}.call(this))},o.prototype.rurOnlyAO=function(){var t=this.oTV.oT.oRUR;return t&&t.w==this.oW&&t.ao||null},o.prototype.p2CR=function(t){return null},o.prototype.drawHE=function(t,e){var i=this.toShape("sortBar-caption");i&&t.drawShape(e=g.PRt(e,this.getPad(),-1),i),t.drawHTMLText(this.oTV.getSortBarCaption(),e=g.PRt(e,this.getPad(),-1),g.DrawTextFormatEnum.exTextAlignVCenter|g.DrawTextFormatEnum.exTextWordEllipsis)},o.prototype.drawH=function(t){return function(e,i){this.isEmpty()&&this.drawHE(e,i),t.call(this,e,i)}}(o.prototype.drawH),Object.addPrototypeOf(r.prototype,t.prototype),r.prototype.colsT=function(){return 255&this.oTV.showCFB()},r.prototype.showCheck=function(){return 2&this.colsT()},r.prototype.showVisible=function(){switch(this.colsT()){case 2:case 4:case 255:return!0}return!1},r.prototype.colsC=function(){return this.oTV.getColumnsFloatBarCaption()+""},r.prototype.capH=function(){var t=this.gCtx(),e=this.colsC();return e.length&&t&&t.sizeHTMLText(e).height||0},r.prototype.colsO=function(){var t=this.oTV.getColumnsFloatBarSortOrder();return 2==t&&2||1==t&&1||0},r.prototype.colsD=function(){return this.oTV.oC},r.prototype.cols=function(t,e){var i=[],o=this.oTV.getAllowGroupBy(),r=this.oTV.oS,n=this.colsO(),s=this.colsT(),l=function(t){return!t.getVisible()};return 1&s?l=function(t){return(!o||t.getAllowGroupBy())&&!r.has(t)}:4&s||(l=function(t){return!0}),e=e||this,this.colsD().forEach(function(o){o.getAllowDrag()&&l(o)&&(!t||t.call(e,o))&&i.push(o)}),n&&i.sort(1==n&&g.Cmp.S||g.Cmp.R(g.Cmp.S)),i},r.prototype.onvscroll=function(t){this.resHVO(!0)},r.prototype.resHVO=function(t){return function(e){if(t.call(this),!e){var i=this;clearTimeout(this.huSPR),this.isVisible()&&(this.huSPR=setTimeout(function(){i.updSPR()}))}}}(r.prototype.resHVO),r.prototype.GetScroll=function(){return this.oW.GetScroll()},r.prototype.rurOnlyAO=function(){var t=this.oTV.oT.oRUR;return t&&t.w==this.oW&&t.ao||null},r.prototype.p2Y=function(t){if(this.ctxRot&&!this.isVert()){var e=this.GetClientRect(),i=2*e[1]+(e[3]-d.Y(t));"y"in t?t.y=i:t[1]=i}return t},r.prototype.p2C=function(t){return function(e,i){return t.call(this,this.p2Y(e),i)}}(r.prototype.p2C),r.prototype.p2CK=function(t){t=this.p2Y(t);var e=this.GetClientRect(),i=this.scaled(d.X(t)-e[0]),o=this.scaled(d.Y(t)-e[1]);return this.getHVO().check.p2O(i,o)},r.prototype.p2CR=function(t){return null},r.prototype.getType=function(){return"floatBar"},r.prototype.showGlyphs=function(t){return function(){var e=t.apply(this,arguments);return e.e=!1,e}}(r.prototype.showGlyphs),r.prototype.isVert=function(){var t=this.GetClientRect();return t[3]>=t[2]},r.prototype.updSPR=function(){var t=this.isVert(),e=this.GetClientRect(),i=this.getPad();this.oW&&this.oW.SetSI(null,{page:this.scaled(e[t?g.h:g.w])-2*i[t?g.y:g.x]-this.capH(),range:this.cols().length*this.oTV.getHeaderHeight()})},r.prototype.getHVO=function(){return this.rgHVO||(this.rgHVO=function(){var t=g.Tree.VO(),e=this.cols(),i=e.length;if(t.check=new g.M1,i){var o=this.getPad(),r=this.GetClientRect(),n=this.GetScroll().y,s=this.oTV.getHeaderHeight(),l=o[0],h=o[1],a=this.scaled(r[2]),u=a-2*o[0],c=this.scaled(r[3]),p=c-2*o[1],f=this.capH(),d=~~(n/s),C=this.showCheck()&&this.getCrSize();if(this.isVert())for(v=1+~~((f+o[1])/s),C&&(l+=C+=o[0],u-=C,C-=o[0]),h+=f-(m(d,v)*s+n%s),I=T(0,d-v);h1)for(var r,s=!0,l=t.get(this.oW);s;)s=!1,o.forEach(function(e){r=t.get(e.oW),l!=r&&!g.EyR(r)&&l[1]==r[1]&&l[3]==r[3]&&(l[0]0&&(h[0]=g.ROf(t)-n),h[1]+=(h[3]-n)/2,h[3]=n,n+=o,s<0&&(t[0]+=n),t[2]-=n),this.showPat())if(a=t.slice(),a[3]=this.getFilterBarHeight()-2*r,l){a[2]=t[2]/2,a[1]+=(t[3]-a[3])/2;var c=a[2]+o;t[0]+=c,t[2]-=c}else{var p=a[3]+r;t[1]+=p,t[3]-=p}return this.showCap()&&(u=t),{rtClose:e(h),rtPrompt:e(a),rtCaption:e(u)}},n.prototype.GetScroll=function(){return{x:0,y:0}},n.prototype.p2F=function(t,e){var i=null,o=this.ptCA(t),r=this.gCnt();for(var n in r)if(g.PInR(o.x,o.y,r[n])){i=u(n.repAll("rt","")),e&&e.push.apply(e,r[n]);break}return i},n.prototype.p2C=function(t,e){var i=null,o=this.gCnt().rtCaption;if(o){var r=this.ptCA(t),n=d.X(r),s=d.Y(r);if(g.PInR(n,s,o)){var l=this.gCtx(),h=null,a=null,u=l.renderText,c=g.TFI.bCTX(l,this.getTfi());l.renderText=function(t,e,i){if(!h){var o=[e,i,this.measureText(t).width,this.fontHeight()];g.PInR(n,s,o)&&(a=o,h=t)}},this.ctxScale(l,this.GetClientRect(),function(t){l.drawHTMLText(this.cap(),o,g.DrawTextFormatEnum.exTextAlignLeft|(this.isSingle()?g.DrawTextFormatEnum.exTextAlignVCenter|g.DrawTextFormatEnum.exTextSingleLine:0))},this),l.renderText=u,g.TFI.eCTX(l,c),h&&(i=this.oTV.oC.Item(h.trim()))&&e&&e.push.apply(e,a)}}return i},n.prototype.toShapes=function(t){return this.oTV.toShapes(t)},n.prototype.getCursors=function(){return this.oTV.getCursors()},n.prototype.getCursor=function(t){var e,i,o;return this.isSelectable()&&(i=this.p2F(t))&&(i=this.getType()+"-"+i,e=g.GP.Get(i,this.getCursors()),(o=this.p2C(t))&&o.canFilter()&&(e=g.GP.Get(i+"-column",this.getCursors())||e)),e||null},n.prototype.onmousemove=function(t){var e,i=this.getCursor(this.gPtr(t));return i&&(e=this.GetCanvas())&&(e.style.cursor=i),i},n.prototype.ondown=function(t){if(this.isSelectable()){var e=[];this.p2F(this.gPtr(t),e)&&g.RUC(t,function(t){this.onClick(t)},this,{client:this.rtCA(e,!1),activeObjects:{oAO:this.gAO(),owner:this,unfreezemask:"fb*"}})}return!0},n.prototype.onClick=function(t){var e=this.p2F(this.gPtr(t));e&&i(this[e="on"+g.getP(e)])&&this[e].call(this,t)},n.prototype.onClose=function(t){this.hasFilter()?this.oTV.Smooth(function(){this.clearFilter()},this):this.isToggle()?this.toggleFilterBar():this.onPrompt(t)},n.prototype.onFBV=function(){var t=this.gCW().oSts;t&&(t.Remove(this.stglFB),this.isToggle()&&t.Add(this.stglFB,this.toggleFilterBar,this,"toggles(shows/hides/resets) the control's filter-bar"))},n.prototype.defSts=function(t){this.oSts=t,this.oTV.isDef()&&(t.Add("Alt + Down",this.onPrompt,this,"focuses the filter-prompt"),t.Add("Alt + Up",this.onPrompt,this,"focuses the filter-prompt"))},n.prototype.toggleFilterBar=function(){this.isToggle()&&(this.bU(),(this.oTV.ntglFB=!this.oTV.ntglFB)||this.clearFilter(),this.eU(),this.onPrompt())},n.prototype.onPrompt=function(t){function e(t,e){var i=this.oTV;i.getFilterBarPromptPattern()!=t&&i.Smooth(function(){i.SetFilterBarPromptPattern(t)},this,{cbkR:e,cbkT:e})}var i,o=null,r=this.gCnt().rtPrompt,n=this.getFont(),l=2&this.hasFilter()&&this.patt()||"";r&&(!s&&(s=!void g.aCSS("."+h,"{background:rgba(0, 0, 0, 0);border:0;padding:0;margin:0;outline:0;")),(o=g.EF.Create({name:"filter.prompt-edit",class:h,client:this.rtCA(r,!1),relative:this.GetCanvas(),clip:this.GetCanvas(),tag:"input",inner:{value:l,style:{font:a(n,this.oTV.getScale())}},modal:!0,onmodal:function(t,o){switch(o){case"start":case"end":this.inv();break;case"cancel":e.call(this,l);break;case"change":e.call(this,t.value,function(e){clearTimeout(i),i=g.setTimeout.call(this,function(){t.oE.SetClient(this.rtCA(this.gCnt().rtPrompt,!1))},16)})}},thisArg:this}))&&this.isToggle()&&(o.oHE.onkeydown=function(t){var e=o.oO.thisArg;g.Keys.IsStEv(e.stglFB,t)&&(e.toggleFilterBar(),g.EF.Destroy(o),g.SEP(t))}))},n.prototype.onCaption=function(t){if(this.isSelectable()){var e=[],i=this.p2C(this.gPtr(t),e);i&&this.oTV.onClickCF({c:i,o:this,rtC:this.rtCA(e,!1)},t)}},{Header:t,SortBar:o,FloatBar:r,FilterBar:n}}()),t.Tree=g.Tree});