/* @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,e){return t.style+" "+t.size*l(e,1)+"px "+t.family}function n(t,e,i){return null==t?~~i:c.s2F(t,e)}function s(t,e){return c.ToS(t,e)}function l(t,e){return c.ToN(t,e)}function h(t,e){return c.ToI(t,e)}function u(){return Math.max.apply(0,arguments)}function a(){return Math.min.apply(null,arguments)}var c=c||window.exontrol,p=c.G;c.Def.Tree={},c.Shapes.Tree={},c.Mrg(c,function(){function t(t,e){this.init(t,e)}return t.version="3.0",t.type="Tree",t.efCellEdit="cell-edit",t.XML=function(){function t(t){return null!=t?t.toLowerCase():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:c.E.Create("column + (exclude ? ` # ` : ` = `) + `'` + value + `'` ","column,value,exclude"),append:c.E.Create("A + (len(A) ? ` ` : ``) + B","A,B"),and:c.E.Create("A + ` and ` + B","A,B"),or:c.E.Create("A + ` or ` + B","A,B"),not:c.E.Create("`not ` + A","A"),isBlank:c.E.Create("`IsBlank(` + A + `)`","A"),isChecked:c.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:{"<":c.EO.LESS,"=":c.EO.EQUAL,">":c.EO.GREAT,"<=":c.EO.LESSE,"<>":c.EO.NEQUAL,"!=":c.EO.NEQUAL,">=":c.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=[],u=0,a=0,c=t.length;a=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},t.sCnt=function(t,e,i){function o(t){return!c.EyR(t)&&t||null}var r=this.getPad(),n=c.HP.Measure(this.getImage(),this.getImageSize(),e),s=c.PRt(t.slice(),r,-1),l=null,h=null;if(null!=n){switch(i&&(h=s.slice()),this.getImageAlign()){case 3:l=[s[0]+(s[2]-n.width)/2,c.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=[c.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=c.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=c.TFI.bCTX(t,e.tfi),null!=e.opacity&&((r=r||{}).opacity=t.globalAlpha,t.globalAlpha=e.opacity)),r},t.eSCTX=function(t,e){null!=e.opacity&&(t.globalAlpha=e.opacity),e instanceof c.TFI&&c.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-"+c.Rand(),this.nHLC=1,this.iLts(),this.oCW=new c.CW(e,{AllowXChg:0,ScrollBars:c.Def.Tree.scrollBars}),this.oCW.oT=this,this.Shortcuts=this.oCW.oSts,this.initCW(),this.import(),this.onSCR(),c.expO(t.Options,this,this.oTV),c.RUR.Listeners.add("srur",this),this.cwbU(),this.SetOptions(i,!0),this.cweU(),c.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())&&(null!=e.height&&(n=u(n||0,e.height)),null!=e.width&&(r=u(r||0,e.width))),(null!=n&&(n=i.unscaled(n))!=this.client[3]||null!=r&&(r=i.unscaled(r))!=this.client[2])&&(null!=n&&(this.client[3]=n),null!=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=c.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):(null==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){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){c.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 c.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(null!=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,c.Mrg({Dock:r?5:4,Size:256},e));o=new c.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.showHB.bind(o),this.aSizeW(s),n.Add("hscroll",{Dock:2,Resizable:!1,Size:16,VisibleExtends:i("name.client"),Opacity:0,HoverOpacity:1,Control:new c.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){null!=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 c.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 c.ScrollBar}),this.addTV("tree"),o.SetC(this.oSB=new c.Tree.TV.SortBar(this.oTV)),o.GetVisible=this.oTV.showSB.bind(this.oTV),this.aSizeW(o),this.addCFB("floatbar",this.oCFB=new c.Tree.TV.FloatBar(this.oTV),"showCFB",{Dock:4})},t.prototype.w2P=function(t){function e(){function t(t){var e=[];return c.B.split(t).forEach(function(t){t.caption&&t.subText&&e.push({n:t.caption,p:function(t){var e=c;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&&p>=0)for(var f=a(p,h),g=u(p,h);f<=g;f++){var d=n.rgVI.at(f);!this.rgSel.has(d)&&d.isSelectable()&&(e=!0,this.rgSel.push(d))}}else l&&i?(e=i,this.removeSel(t)):(l||(e=null!=this.rgSel&&(!i||this.rgSel.len()>1),this.rgSel=null),o&&(this.rgSel=this.rgSel||new c.Arr).push(t)),e|=i!=this.isSelected(t);return e}var n=!1,s=1==(i=i||{}).selType,l=2&i.selType,h=function(e){var i=null;if(null!=e){var r=this.oI,n=r.Item;e instanceof t.Items?e==this.oI&&(i=this.oI.rgI):o(e)||e instanceof c.Arr?(i=new c.Arr,e.forEach(function(t){i.ann(n.call(r,t))})):i=n.call(r,e)}return i}.call(this,e);return h instanceof c.Arr?s?n|=r.call(this,h.last()):l?h.forEach(function(t){n|=r.call(this,t)},this):(n=!h.equal(this.rgSel))&&(this.isSingleSel()?r.call(this,h.last()):(this.rgSel=new c.Arr,h.forEach(function(t){t.isSelectable()&&this.rgSel.push(t)},this))):n=r.call(this,h),n&&(this.rgSel instanceof c.Arr&&(this.rgSel.len()||(this.rgSel=null)),(null==i.selChange||i.selChange)&&(this.feTV("invAO"),this.onSel())),n},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,u=function(){return this.getSel().first()||l.first()}.call(this);if(h.len()){switch(String(t).trim().toLowerCase()){case"home":o=r=i(h.first(),!0);break;case"up":case"arrowup":o=r=h.has(u)&&i(h.prev(u));break;case"prior":case"pageup":s=-1;break;case"end":o=r=i(h.last());break;case"down":case"arrowdown":o=r=h.has(u)&&i(h.next(u),!0);break;case"next":case"pagedown":s=1}if(s){var a,c=s<0?0:1;(a=e.call(this))&&(u!=a[c]?o=r=i(a[c],c):(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))&&n1&&c==e.charAt(0)&&c==e.charAt(r-1)){t="";for(var i,o=0,r=(e=e.substr(1,r-2)).length;o/i.test(t)}(t)&&"XML"!=e?(this.bU(),l.clear&&this.Clear(),n.call(this,t),this.onLoad(),this.eU()):this.LoadXML(t)}e&&(this.oImp=c.Mrg(c.Mrg({},t.ImportOptions),i),this.oImp.oExCC=c.E.Create(s(this.oImp.columnCaption),"index"),c.Ld(e,{u:function(t){return c.IsS(t)&&t&&t.indexOf(this.oImp.eor)<0&&t.indexOf(this.oImp.eof)<0&&t.indexOf(this.oImp.str)<0},i:r,e:this.onError,t:this}))},t.prototype.GetData=function(){return this.Export()},t.prototype.SetData=function(t){this.Import(t)},t.prototype.LoadXML=function(e){c.Ld(e,{u:function(t){return c.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 c.IsN(t)?l(t)+4:null}function o(t){function e(t,o){t&&h.call(t,function(t){var r=function(t,e){this.lAI++;var o,r=e.Add({expanded:~~u.call(t,"Expanded"),height:i(u.call(t,"Height"))});return h.call(t,function(t,e){(o=r.Cell(e))&&o.SetOptions({value:u.call(t,"Value"),image:u.call(t,"Image"),state:u.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,h=n.feU,u=n.vOf,a=n.v2N;(function(t){if(t){var e,i,o,r=this.oC;if(h.call(t,function(t){o=r.Add({caption:u.call(t,"HTMLCaption")||u.call(t,"Caption"),width:a(u.call(t,"Width")),image:u.call(t,"Image"),visible:a(u.call(t,"Visible")),sortType:a(u.call(t,"SortType")),partialCheck:a(u.call(t,"PartialCheck")),format:u.call(t,"FormatColumn"),filterType:a(u.call(t,"FilterType")),filterList:a(u.call(t,"FilterList")),filterOnType:a(u.call(t,"FilterOnType")),displayFilterButton:a(u.call(t,"DisplayFilterButton")),cellHasCheck:u.call(t,"CheckBox")?1:0}),null!=(i=u.call(t,"Position"))&&(e=e||new Map).set(o,~~i),this.xmlLC(o,t)},this,"Column"),e){var n,s=[],l=r.rgC.byO().slice(),p=l.length,f=new c.Arr(l);s.length=p,e.forEach(function(t,e){t>=0&&t=0&&null==t.rgC[i[s]].GetValue();s--,r--);for(var s=0;s=0||i>=0)&&(t=t.replace(p,a+a),t=a+t+a)}return t}:s;r.forEach(function(t,e){e>0&&(l+=h);for(var i=0,o=t.length;i0&&(l+=u),l+=f(t[i])}),r=l}return r}}(),t.prototype.Clear=function(){this.bU(),this.Columns.Clear(),this.ClearFilter(),this.eU()},t.prototype.ChooseFile=function(t){function e(t,e){var i=c.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=c.doc.body,h=this,u=this.oCW,a=u.zIndex();this.Clear(),s=this.getLIV(),null!=t&&function(i){(n=e("span",i)).oT=h,n.className="error",n.style.color="#f44336",n.innerText=c.IsS(t)?t:t instanceof DOMException||t instanceof ReferenceError?t:"Error: Access is denied (blocked by CORS policy)",l.appendChild(n)}(++a),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)}(++a),this.oIF={i:r,s:n},i=setInterval(function(){if(s==h.getLIV()){var t=c.Ert(u.canvas);if(!c.EqR(t,o)){if(o=t,r){var e=c.Ert(r);r.style.left=c.toU(t[0]+(t[2]-e[2])/2),r.style.top=c.toU(t[1]+(t[3]-e[3])/2),r.style.opacity=c.EyR(t)?0:1,t=c.ORt(t.slice(),0,e[3])}if(n){var a=c.Ert(n);n.style.left=c.toU(t[0]+(t[2]-a[2])/2),n.style.top=c.toU(t[1]+(t[3]-a[3])/2),n.style.opacity=c.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 c.Arr,rgGI:new c.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||s(t,o-1)),n=2&i&&s(t,o+e.length);switch(i){case 1:if(r)return!0;break;case 2:if(n)return!0;break;case 3:if(r&&n)return!0}o=t.indexOf(e,o+1)}return-1!=o}var h=this.getFilterBarPromptType(),u=255&h;if(e={cbkII:function(){},nC:this.oC.GetCount(),rgC:this.getFilterBarPromptColumns(),bCS:h&t.FilterPromptEnum.exFilterPromptCaseSensitive},u==t.FilterPromptEnum.exFilterPromptPattern)e.oMW=c.Like.Mask(i),e.oMW.bCS=e.bCS,e.cbkII=!e.rgC&&function(t){for(var e=0,i=this.nC;e>12,e.rgW=function(t,e,i){var o=new c.Arr;return null!=t&&t.split(" ").forEach(function(t){(t=t.trim())&&o.add(e&&t.toLocaleLowerCase()||t)}),o.byO()}(i,!e.bCS),u){case t.FilterPromptEnum.exFilterPromptContainsAll:e.cbkII=function(t){for(var e=r.call(this,t),i=0,o=this.rgW.length;i=0;){if(t.sWith(e,o)&&(!i||s(t,o+e.length)))return!0;(o=t.indexOf(n,o))>=0&&(o+=n.length)}}for(var i=r.call(this,t),o=0,l=this.rgW.length;o=0)&&(l=t.substr(o,h-o),o=h+n.length),l.eWith(e)){var u=!i;if(!u){var a=e.length;u=l.length==a||s(l,l.length-(a+1))}if(u)return!0}}}for(var i=r.call(this,t),o=0,l=this.rgW.length;o=0&&(r=c-a)&&(n=r)&&Array.prototype.unshift.apply(r<0?h:l,Array(Math.abs(r)))}}for(var p=[],s=e-1;s>=0;s--){for(var f=[],g=0;g0&&(y.clear(),d=g,o.unlock.head.forEach(function(t){c.Tree.LCV.push.call(i.unlock,e,t,d,f,s,h,n),d+=f}),i.unlock.len()&&i.lock.len()&&l-h>0&&(i.clip=[h,0,l-h,C])),a){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.showHB()==c.Tree.HeaderVisibleEnum.exHeaderVisibleExtendLevels){var v=1==u,T=new c.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},g.prototype.doL=function(t,e){function i(t){return t.getWidth()}function o(t,e,i){var o=0,r=0;return i&&(o=g.get(e),r=g.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 c.Arr,w:0},this.unlock={head:[],cell:[],vc:new c.Arr,w:0};var r=0,n=t.vc,s=u(0,a(t.oT.oTV.getCountLockedColumns(),n.len()));if(null!=e){e=u(0,l(e,0));var h=0,p=0;if(n.forEach(function(t){var e=i(t);h+=e,t.getAllowSizing()&&(p+=e)}),p>0){var f=u(0,(e-(h-p))/p);i=function(t){var e=t.getWidth();return t.getAllowSizing()&&(e*=f),e},this.w=h-p}}var g=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},g.prototype.getNL=function(){return this.unlock.head.length},g.prototype.getCVO=function(t){var e=c.Tree.VO(),i=t.GetPageSize(),o=i[0],r=i[1],n=this.lock.w;return g.push.call(e.lock,null,this.lock.cell,0,r,o),g.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,u(0,o-n),t.scaled(t.GetWindowRect()[3])]),e},g.push=function(t,e,i,o,r,n,s){n=n||0,s=s||0,r=r||0;var l=null,h=0,u=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){o=c.Tree.Filter.description.append.Evaluate(function(e){return-1==e?o:t})}var o,r=this.getIFC();switch(t){case-1:case-2:o="",r&&r.rgFC.forEach(function(t){i(e.call(this,this.Item(t.col),t.cbkL,t))},this);break;case-8:case-9:case-10:o="";var n=new Map;r&&r.rgFC.forEach(function(t){n.set(this.Item(t.col),t)},this);var s=function(t){return t.getDisplayFilterButton()&&!n.has(t)};switch(t){case-9:s=function(t){return t.getDisplayFilterButton()};break;case-10:s=function(t){return!0}}s&&this.forEach(function(t){if(s(t)){var o=n.get(t);i(e.call(this,t,o&&o.cbkL||void 0,o))}},this)}return o},d.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 c.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(c.Tree.Filter.description.to),o=Date.Parse(i[0]),r=Date.Parse(i[1]);if(1==i.length&&(r=o),o&&r&&c.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]||c.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 c.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(c.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":"")}),c.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 l},C.prototype.GetFormatImage=function(){return this.oO.formatImage},C.prototype.SetFormatImage=function(t){this.bU(),this.oExFI=void 0,this.oO.formatImage=t,this.eU()},C.prototype.getFormatImage=function(){if(void 0===this.oExFI){this.oExFI=null;var t=s(s(this.GetFormatImage(),s(c.Tree.ColumnOptions.formatImage,null)));t&&!(this.oExFI=c.Tree.CellF.Create(t)).IsValid()&&(this.oExFI=null)}return this.oExFI},C.prototype.tt=function(t,e){var i,o,r=this.getToolTip(),n=null!=r;return t&&e&&(o=this.gCnt(e,t).rtCaption)&&(n?s(r):null!=(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:c.ORt(t.rtCA(o,!1),-3,-3)}||null},y.prototype.initS=function(){this.rgS=new c.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)},y.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)},y.prototype.toColumn=function(t){return this.oC.Item(t)},y.prototype.dTV=function(){return this.oT.oTV},y.prototype.isSingleSort=function(){return this.dTV().isSingleSort()},y.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()},y.prototype.onDelCol=function(t){var e=this.isSort(t);this.lC++,this.remove(t),--this.lC,e&&this.onChange()},y.prototype.onChange=function(){this.lC||(this.oT.getAllowGroupBy()&&(this.oC.resLC(),this.oC.ensoTC(),this.oT.onHLC()),this.onSort(),this.bMS=0)},y.prototype.onSort=function(){this.oT.onSort(this.bMS)},y.prototype.add=function(t,e){return this.lC++,null==e||e?this.oSS=!this.rgS.has(t)&&t||null:this.rgS.add(t),--this.lC,this.getSortLen()},y.prototype.remove=function(t){this.lC++,this.rgS.remove(t),this.oSS==t&&(this.oSS=null),--this.lC},y.prototype.clear=function(){var t=this.oSS||!this.rgS.isEmpty();this.lC++,this.oSS=null,this.rgS.clear(),--this.lC,t&&this.onChange()},y.prototype.isSort=function(t){return t&&(t==this.oSS||this.has(t))&&t.getSortOrder()||0},y.prototype.getSortPos=function(t){var e=this.rgS.indexOf(t);return e<0&&t==this.oSS&&(e=this.rgS.len()),e},y.prototype.getSortLen=function(){return this.rgS.len()+(this.oSS&&1||0)},y.prototype.sort=function(t,e,i){this.lC++;var o=!1,r=this.toColumn(t);if(r&&r.getAllowSort()){(o=(e=null==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},y.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},y.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()},S.prototype.init=function(t){this.oT=t,this.oS=t.oS,this.rgI=new c.Arr,this.rgI.onRemove=t.onDelItem.bind(t),this.import()},S.prototype.import=function(){var t=this.oT;["bU","eU"].forEach(function(e){this[e]=t[e].bind(t)},this),["has","len","forEach","forEachU","add","indexOf","getPos","setPos"].forEach(function(t){this[t]=this.rgI[t].bind(this.rgI)},this)},S.prototype.onRL=function(){this.oT.onRL()},S.prototype.getHeight=function(t,e){var i=t.GetHeight();return null==i&&null==(i=e)&&(i=this.oT.getDefaultItemHeight()),u(0,i)},S.prototype.setHeight=function(t,e){t.oO.height=e},S.prototype.rurIH=function(){},S.prototype.resKI=function(){this.mKI=null},S.prototype.Add=function(t){this.bU(),this.resKI();for(var e,i,o=this.add(new c.Tree.Item(this,t)),r=o.rgC,n=this.oT.oC.rgC.rgE,s=0,l=n.length;s1&&p.set(t,g),g=t),e}()?o=i(-1):(o=c.Expr.prototype.Evaluate.call(this,i),g=p.get(t),p.delete(t)),d--,o}function n(t,e){var i=f.get(t);return!e&&!i&&f.set(t,i={TG:new Map,TL:new Map,TE:new Map}),i}var h=new Map,u=new Map,p=new Map,f=new Map,g=null,d=0,C=function(e){function i(t){return(t=s(t))&&t.trim().toLowerCase()||""}var o=c.B.split(e)[0];if(o){var r=i(o.caption);if(r in C.Agg){var n=o.subText.splitP(","),l=function(t){var e="all";return(t=i(t))&&(c.IsI(t)||C.List.Enum.has(t))&&(e=t),e}(n[0]),h=function(t){var e="all";return(t=i(t))&&C.Dir.Enum.has(t)&&(e=t),e}(n[1]);this.cbk=C.Agg[r],this.oEx=function(e){var i=t(e);return i.IsValid()?i:t(1)}(n[2]),this.lix=~~l,this.lst=C.List.cbk[(c.IsI(l)?"index":l)+"."+h]}}};C.prototype.nEC=function(){return g&&g.oC.GetIndex()||0},C.prototype.Evaluate=function(){var t=n(g.dTV().oT),e=t.TE.get(g);!e&&t.TE.set(g,e=new Map);var i=e.get(this);return!e.has(this)&&e.set(this,i=function(){return this.cbk&&this.cbk.call(this,this.lst.call(this,g.oI))||0}.call(this)),i},C.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 c.Arr("current","all","parent","root"),cbk:{"all.dir":function(t){var e=n(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=n(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=n(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=n(i.t()),r=e(i)+".cd",s=o.TL.get(r);return!s&&o.TL.set(r,t(i,"dir",s=[])),s},"current.rec":function(i){var o=n(i.t()),r=e(i)+".cr",s=o.TL.get(r);return!s&&o.TL.set(r,i.hasChild()?t(i,"rec",s=[]):s=[]),s},"current.all":function(i){var o=n(i.t()),r=e(i)+".ca",s=o.TL.get(r);return!s&&o.TL.set(r,t(i,"all",s=[])),s},"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}(),C.Dir={Enum:new c.Arr("dir","rec","all")},C.Agg={count:function(t){return t.length},sum:function(t){var e=0,i=this.nEC();return t.forEach(function(t){e+=l(this.oEx.Evaluate(t.rgC[i]))},this),e},avg:function(t){return t.length?C.Agg.sum.call(this,t)/t.length:0},std:function(t){var e,i=0,o=A.Total.Agg.avg.call(this,t),r=this.nEC();return t.forEach(function(t){e=Math.abs(l(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=l(this.oEx.Evaluate(t.rgC[i]));(void 0===e||oe)&&(e=o)},this),e}};return{Create:t,Evaluate:r,AggEval:function(t,e,o){var r=i(t)?t:C.Agg[t];return r&&r.call({oEx:{Evaluate:function(t){return t}},nEC:function(){return o}},e)},Op1:{get:function(t,e){var i=n(g.dTV().oT),o=i.TG.get(t);return!o&&i.TG.set(t,o=new C(t)),o.Evaluate()},exp:function(){var t=g.oI;return!(!t.hasChild()||!t.isExpanded())}},Op2:{index:function(t,i){return e(g.oI,0,t,i)},rindex:function(t,e){return o(g.oI,0,t,e)},pos:function(t,i){return e(g.oI,1,t,i)},rpos:function(t,e){return o(g.oI,1,t,e)},opos:function(t,i){return e(g.oI,2,t,i)},ropos:function(t,e){return o(g.oI,2,t,e)},apos:function(t,i){return e(g.oI,3,t,i)},rapos:function(t,e){return o(g.oI,3,t,e)}},OpCell:function(){return g},XC:function(t,e){var i=n(t,!0);i&&((e=e||0)<1&&i.TG.clear(),e<2&&i.TL.clear(),e<3&&i.TE.clear())},Total:C}}();return T.prototype.init=function(t){this.oT=t,this.mCF=null,this.mKI=null,this.rgCF=new c.Arr,this.rgCF.onRemove=this.onDelCF.bind(this),this.import()},T.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)},T.prototype.onDelCF=function(t){this.resKI(),this.resCF()},T.prototype.resKI=function(){this.mKI=null},T.prototype.resCF=function(){this.mCF=null},T.prototype.bSCTX=function(t,e,i){var o,r=e instanceof c.Tree.Cell,n=r?e:e.rgC[0],s=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 s&&s.forEach(function(e){if(e.getExC().Evaluate(n)){var r=c.Tree.bSCTX(t,e.getShape(),i);r&&(o=o||[]).push(r)}}),o},T.prototype.eSCTX=function(t,e){if(e)for(var i=e.length-1;i>=0;i--)c.Tree.eSCTX(t,e[i])},T.prototype.Add=function(t){this.bU(),this.resKI(),this.resCF();var e=new c.Tree.ConditionalFormat(this,t);return this.eU(),e},T.prototype.GetCount=function(){return this.rgCF.len()},T.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgCF.at(t)||null:t instanceof c.Tree.ConditionalFormat?e=this.rgCF.has(t)?t:null:null==(e=function(t){var e=t.mKI;return null==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},T.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},T.prototype.RemoveRange=function(t){this.bU(),this.resKI(),this.resCF(),this.rgCF.removeRange(t),this.eU()},T.prototype.Clear=function(){this.bU(),this.resKI(),this.resCF(),this.rgCF.clear(),this.eU()},m.prototype.bU=function(){this.oCF.bU()},m.prototype.eU=function(){this.oCF.eU()},m.prototype.dTV=function(){return this.oCF.oT.oTV},m.prototype.resCF=function(){return this.oCF.resCF()},m.prototype.getExC=function(){return this.oExC||(this.oExC=c.Tree.CellF.Create(s(this.GetExpression())))},m.prototype.Remove=function(){return this.oCF.Remove(this)},m.prototype.GetOptions=function(){return this.oO},m.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},m.prototype.setOpts=function(t){if(null!=t){var e=c.IsO(t)?t:{expression:t+""};for(var i in e){var o=this[c.setM(i)];o&&o.call(this,e[i])}}},m.prototype.GetApplyTo=function(){return this.oO.applyTo},m.prototype.SetApplyTo=function(t){this.bU(),this.resCF(),this.oO.applyTo=t,this.eU()},m.prototype.getApplyTo=function(){var t=this.GetApplyTo();if(t<0||null==t)t=-1;else{var e=this.oCF.oT.oC.Items(t);t=e.len()?e:null}return t||null},m.prototype.GetExpression=function(){return this.oO.expression},m.prototype.SetExpression=function(t){this.bU(),this.resCF(),this.oExC=null,this.oO.expression=t,this.eU()},m.prototype.GetEnabled=function(){return this.oO.enabled},m.prototype.SetEnabled=function(t){this.bU(),this.resCF(),this.oO.enabled=t,this.eU()},m.prototype.isEnabled=function(){return null==this.GetEnabled()||this.GetEnabled()},m.prototype.GetKey=function(){return this.oO.key},m.prototype.SetKey=function(t){this.bU(),this.oCF.resKI(),this.oO.key=t,this.eU()},m.prototype.getKey=function(){return s(this.GetKey())},m.prototype.GetShape=function(){return this.oO.shape},m.prototype.SetShape=function(t){this.bU(),this.resCF(),this.oO.shape=c.S.A2S(t),this.eU()},m.prototype.getShape=function(){return this.dTV().toShape(this.GetShape())},m.prototype.GetValid=function(){return this.isValid()},m.prototype.isValid=function(){return this.getExC().IsValid()},I.prototype.getType=function(){return"cell"},I.prototype.bU=function(){this.oI.bU()},I.prototype.eU=function(t){this.oI.eU(t)},I.prototype.dTV=function(){return this.oI.dTV()},I.prototype.toShape=function(t,e){return this.dTV().toShape(t,e)},I.prototype.gCnt=function(t){var e,i,o,r,n,s=this.dTV(),l=s.getIndent(this.oI);return t=c.IRt(t.slice(),-this.getPad()[0],0),this.showExpand()&&((e=s.getExpandGlyphSize())&&this.oI.hasChild()?l>=s.getIndent()&&(r=[t[0]+u(0,l-e),t[1],e,t[3]],t=[c.ROf(r),t[1],c.ROf(t)-c.ROf(r),t[3]],r=!s.getHasButtons()||this.oI.showExpand()<0?null:p.C2R(p.R2C(r),e,e)):(t[0]+=l,t[2]-=l)),(i=this.showCheck()&&s.getCrSize())&&(o=[t[0],t[1],i,t[3]],t=[c.ROf(o),t[1],c.ROf(t)-c.ROf(o),t[3]],o=p.C2R(p.R2C(o),i,i)),n=c.Tree.sCnt.call(this,t,s.gCtx()),r&&(n.rtExpand=r),o&&(n.rtCheck=o),n},I.prototype.p2HT=function(t,e){var i=p.X(t),o=p.Y(t),r=this.gCnt(e);for(var n in r)if(c.PInR(i,o,r[n]))return n.replace("rt","").toLowerCase()},I.prototype.autoWidth=function(){var t=this.dTV(),e=this.getPad()[0],i=t.gCtx(),o=c.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},I.prototype.drawC=function(t,e){function i(){var i,l,h,f=this.isEnabled(),g=n.getCellShape(f),d=this.getShape(f),C=this.gCnt(e);g&&(i=c.Tree.bSCTX(t,g,e,this)),d&&(l=c.Tree.bSCTX(t,d,e,this)),h=r.bSCTX(t,this,e),t.selClip(e),!f&&c.H.lA++,n.isTC()&&function(e){function i(t,e,i,o){G.push({f:[t,e],t:[i,o]})}function r(t,e,o){i(t,o,e,o)}function n(t,e,o){i(o,t,o,e)}function l(t){return t==h?null:t.oP||h}var h,f,g,d,C,y,S,v,T,m,I,O,E,b,w,x,F,V,A,R=o.getHasLines(),G=[];if(R&&(f=o.getIndent())&&s.isNZ()&&!s.isLocked()&&(g=o.getIndent(s))>=f){if(d=!0,C=o.getExpandGlyphSize()-8,h=o.oT.oI,S=s.oP,e=c.IRt(e.slice(),-this.getPad()[0],0),y=e.slice(),d?(y[0]+=g-(y[2]=f),e[2]=c.ROf(e)-(e[0]=c.ROf(y))):(y[0]=c.ROf(y)-g,y[2]=f,e[2]-=g),v=p.R2C(y),T=v[0],m=v[1],I=o.getLinesAtRoot(),O=-1==I,E=0==I,b=1==I,w=2==I,x=3==I||4==I,F=5==I,V=x||F,A=function(){return o.getHasButtons()&&s.hasChild()&&(S||I&&!S)&&this.showExpand()}.call(this)&&o.getExpandGlyphSize(),S||I){if(!V&&!w&&s.isExpanded()&&s.hasNZ()){var k,L,B,P=f;w&&(P=0),L=T+P,k=this.gCnt(e),B=c.BOf(k.rtCheck||k.rtImage||k.rtCaption||e),d||(L=T-P),n(u(B,m+C),c.BOf(y),L)}if((S||!o.getHasButtons()||!S&&O)&&(!w||w&&!A&&s.hasNZ()&&s.isExpanded())){F&&o.isIndent(s)&&(d?T-=f:T+=f);var U=m,H=T,D=u(T,c.ROf(y)-2);d||(H=a(T,c.LOf(y)+2),D=T);var W=!0;if(V&&(W=!1,S)){var z=S.gfNZ(),M=S.glNZ();if(W=z!=M){var N=c.TOf(y),X=c.BOf(y);F||4==I?(W=z==s)?N=m:(W=M==s)&&(X=m):z==s?N=m:M==s&&(X=m),W&&(H=T,D=u(T,T+f/2-2),d||(H=a(T,T-f/2+2),D=T)),n(N,X,T)}}W&&r(H,D,U)}if(!V)if(S)switch(I){case 0:K=S.gpNZ(s);n((Z=S.gnNZ(s))?c.BOf(y):m,(S.oP||S.gfNZ()!=s)&&(S.isNZ()||K)?c.TOf(y):m,T);break;case 2:s.hasNZ()&&s.isExpanded()&&n(m,c.BOf(y),T);break;default:K=S.gpNZ(s);n((Z=S.gnNZ(s))?c.BOf(y):m,K||S.isNZ()?c.TOf(y):m,T)}else if(!w||w&&s.hasNZ()&&s.isExpanded()){var Z=h.gnNZ(s),K=h.gpNZ(s)&&O;b&&(Z=s.isExpanded()&&s.hasChild()),(Z||K)&&n(Z&&K?c.TOf(y):Z?c.BOf(y):c.TOf(y),Z&&K?c.BOf(y):m,T)}}for(var Y=s;S=l(Y);){switch(d?(c.ORt(y,-f,0),T-=f):(c.ORt(y,f,0),T+=f),I){case 2:var j,q=S.gnNZ(Y);(!q||q&&l(q)==S)&&(X=c.BOf(y),S.isNZ()&&((j=!q&&s==S.glNZ())&&(X=m,d?r(T,T+f/2,X):r(T-f/2,T,X)),(j||q)&&n(c.TOf(y),X,T)));break;case 3:case 4:case 5:(_=S.oP)&&S.isNZ()&&_.gnNZ(S)&&n(c.TOf(y),c.BOf(y),T);break;default:var Q,J,_=l(S);_&&(_.gnNZ(S)||b)&&((Q=!l(_))?(J=!E)&&(b?J=S.isNZ():S.isNZ()||(J=_.gpNZ(S))):J=b?_.gnNZ(S)&&S.isNZ():S.isNZ()||_.isNZ(),J&&(b&&Q&&S.glNZ()==s&&(d?r(T,T+f/2,c.BOf(y)):r(T-f/2,T,c.BOf(y))),n(c.TOf(y),c.BOf(y),T)))}Y=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,u=0;u=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())},I.prototype.getState=I.prototype.s=function(){return~~this.GetState()},I.prototype.GetHasCheck=function(){return this.o().hasCheck},I.prototype.SetHasCheck=function(t){this.bU(),this.o().hasCheck=t,this.eU()},I.prototype.showCheck=function(){var t=this.GetHasCheck();return(t=null==t?this.oC.showCellCheck():t)&&this.oI.isLocked()&&(t=0),t},I.prototype.ToggleCheck=function(){this.SetState(this.getState()?0:1)},I.prototype.showExpand=function(){return this.oI.showExpand()&&(this.oC.isTC()||this.oC.oC.oTC&&this.oI.getDivider()&&this.oI.isGI()>=0)},I.prototype.GetFormat=function(){return this.o().format},I.prototype.SetFormat=function(t){this.bU(),this.oExF=void 0,this.o().format=t,this.eU()},I.prototype.getFormat=function(){if(void 0===this.oExF){this.oExF=null;var t=s(this.GetFormat());t&&((this.oExF=c.Tree.CellF.Create(t)).IsValid()||(this.oExF=null))}return this.oExF},I.prototype.toFormat=function(t,e){if(t<0)return this.v();if(ti[2]||~~o.height>i[3]},this))&&{t:r?o:e,rtT:c.ORt(t.o2rt(this,"client",function(t){return this.gCnt(t).rtCaption},this),-3,-3)}||null},O.prototype.doL=function(t){var e=t.oT;this.rgVI=new c.M1,((x?0:x=1+c.Tick()%3321)||function(){var t="pmgi",e=c[t+="rwi"].call(c);return!(c.iL()&&(!e||!e.k))}()&&(x+=x>>2)%4)&&(this.add=function(){return this.rgVI.len()<16+(x+=x>>2)%48&&O.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)},O.prototype.add=function(t,e,i){return this.rgVI.push(t,{y:e,h:i}),i},O.prototype.scroll=function(t,e){var i=new c.M1,o=this.rgVI,r=o.len();if(r&&!c.EyR(t)){for(var n=p.X(e),s=p.Y(e),l=t[0]+n,h=t[2],u=0,a=r-1,f=c.TOf(t),g=c.BOf(t);u+1=0){for(var r=0,n=o;r+1=h.y&&t<=h.y+h.h&&(e=l)}return e},O.prototype.y2Is=function(t,e){var i=[];if(this.rgVI.len()){var o=a(t,e),r=u(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]=c.BOf(e)-r,e[3]=r):(e[1]+=o,e[3]=u(0,e[3]-(o+r)))}return e},b.prototype.getItemsRect=function(t,e,i){if(e=e||this.GetWindowRect()){e=e.slice();var o=this.getShowLockedItems(),r=o&&this.getLIVT().h||0,n=o&&this.getLIVB().h||0;i||(r=this.unscaled(r),n=this.unscaled(n)),t?t<0?e[3]=r:t>0&&(e[1]=c.BOf(e)-n,e[3]=n):(e[1]+=r,e[3]=u(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 c.NRt(this.GetClientRect(),this.GetCanvasRect())},b.prototype.GetViewRect=function(t){return c.EArtC((t||this.gCW()).GetCanvas())},b.prototype.c2V=function(t,e){var i=t,o=e,r=this.GetViewRect();if(1==arguments.length){var n=arguments[0];i=p.X(n),o=p.Y(n)}return{x:i+r[0],y:o+r[1]}},b.prototype.v2C=function(t,e){var i=t,o=e,r=this.GetViewRect();if(1==arguments.length){var n=arguments[0];i=p.X(n),o=p.Y(n)}return{x:i-r[0],y:o-r[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(),c.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 c.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(){c.A.Cancel("ss*"),c.A.Cancel(this.sEvcA)},b.prototype.ondown=function(t){return this.isSelectable()&&(this.xA(),this.gAA().Do(this,t),!c.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:c.e2B(t),modifiers:c.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&&(c.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:p.X(e)-o[0],y:p.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 c.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(c.GP.Get("long",this.getCursors()));break;case 3:s.CanDo(t,1)&&(c.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);u(s,l)-a(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=null!=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||null==e.rurAllow||t==(e.rurAllow&t)}function o(){h.frame=p.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),g.onRurDragD&&g.onRurDragD.call(g,e,h),e&&e.rurDragD&&e.rurDragD(h),a&&a.SetClient(h.frame)}function r(){return s||(s=function(){var t=f;return a&&a.oO.relative!=f.GetCanvas()&&(t=g),t}())}function n(t,e){return r().ptCA(t,e)}if(t){var s,l,h,a,f=this,g=this.e2V(t)||f,d=g.getRurDragScrollOut?g.getRurDragScrollOut():g.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(f.gPtr(t));return{from:e,to:e,event:t,frame:p.Rect(e,e)}}(t)).event=t,t.drag.status){case 1:(function(){g.onRurDragS&&(e=g.onRurDragS.call(g,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:f.GetCanvas(),clip:f.GetCanvas(),inflateClient:8,onpaint:function(t,i){e.rurEFPaint.call(y,h,t,i,this)}};e.rurEFOpts&&e.rurEFOpts.call(y,h,r),a=c.EF.Create(r)}break;case 7:var T=t.drag.cancel?this.oT:this,m=this.oT.oRUR;clearTimeout(l),m&&(m.ao=null),T.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()&&T.onRL(),this.rAO(),T.eU(),c.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(){g.onRurDragE&&g.onRurDragE.call(g,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),!c.EyR(d)&&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-c.LOf(d)||0;w>0&&(w=u(0,E-c.ROf(d)));var x=i(2)&&b-c.TOf(d)||0;x>0&&(x=u(0,b-c.BOf(d))),(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:d})}},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=p.Rect(t.from,t.to);if(!c.EyR(e)){var i=this.getLIV(),o=this.ar2I(e);o&&o.length&&o.forEach(function(t){e=c.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=null!=t;if(i)switch(e.rurName){case"scroll":i=function(t){return c.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"+c.getP(function(t){for(var e,i="",o=0,r=t.length;oy})):d.forEach(function(t){v(t)&&S.add(T.call(t.rgC[o]))}),(i.s||a&(s.exSortItemsAsc|s.exSortItemsDesc))&&S.sort(t.cmp(i.s||(a&s.exSortItemsAsc?1:2)).c),null!=y&&S.len()>y&&(S.remove(S.last()),S.add(c.Tree.Filter.truncLimit)),e.v=S.byO()}return e}function S(t,e,o,r){return(r=r||i).cbkF?r.cbkF.call(t,e,o):t.ChangeFilter(e,o)}function v(){var e=d(m),o=this.gCW(),n=this.getFont(),l=t.o.gCW().canvas,h=function(){var e=t.rtC.slice();return t.o instanceof b.Header&&t.o.isHeader()&&c.ORt(e,-this.unscaled(this.GetScroll().x-I.x),0),e}.call(this);c.ORt(h,0,h[3]),c.EF.Create({name:"filter.column-edit",class:"exontype "+c.Def.CN.ppEF,client:h,relative:l,tag:"input",inner:{value:s(e),placeholder:c.Tree.Filter.description.filterFor,title:function(){var t=c.Tree.Filter.description.titleAny;switch(15&m.getFilterType()){case c.Tree.FilterTypeEnum.exPattern:t=c.Tree.Filter.description.titlePattern;break;case c.Tree.FilterTypeEnum.exDate:t=c.Tree.Filter.description.titleDate;break;case c.Tree.FilterTypeEnum.exNumeric:t=c.Tree.Filter.description.titleNumeric}return t}.call(this),style:{font:r(n,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":S(m,void 0,null!=e?e:null);break;case"change":S(m,void 0,t.value||null)}},thisArg:this})}function T(){function e(t,e,i){function r(t,e){t&&(l&&(l+=","),null!=e&&(h?t+="[chk="+e+"][show=-1]":e&&(t+="[shapes=shitem.checked(item)]")),l+=t)}var l="",u=b.cbkEsc(),p=c.Tree.Filter.bold.split(","),f=c.Tree.Filter.exclude;if(f&&null!=t.e&&r(u(f)+"[chk="+(t.e?1:0)+"][id=exclude]"),t.b.length&&l&&r("[sep]"),t.b.forEach(function(t){r(""+u(p[t])+"[id="+t+"]")}),t.v.length&&l&&r("[sep]"),n()==c.Tree.FilterTypeEnum.exImage){var g=function(){var t=0,e=m.getImageSize();return null!=e&&(c.IsN(e)?t=e:o(e)&&(t=a(Math.abs(e[0]),Math.abs(e[1])))),t}.call(this);t.v.forEach(function(o,n){var s;e&&(s=e.has(i?o:o.toLocaleLowerCase())?1:0),r(""+o+":"+g+"[id="+(n+10)+"]",s),s&&(t.i=n+10)})}else{var d=function(){var e="";if(null!=c.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=~~m.getWidth(),n=c.TFI.bCTX(o,this.getTfi()),s=c.H.Measure(o,i.t)||{width:0,height:o.fontHeight()};c.TFI.eCTX(o,n),s.width>r&&(e="[cw="+~~a(8+s.width,c.Tree.Filter.maxWidth)+"]")}}return e}.call(this);t.v.forEach(function(o,n){var l;e&&(l=e.has(i?o:o.toLocaleLowerCase())?1:0),r(u(s(o)||" ")+d+"[id="+(n+10)+"]",l),l&&(t.i=n+10)})}return l}var r=t.o.gCW(),l=y.call(this,m),h=m.getFilterList()&c.Tree.FilterListEnum.exShowCheckBox,u=function(t){var e=null;if(null!=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[a],i=[h[0],i[1],h[2],i[3]])}}if(r instanceof c.Tree.Cell){var f=r.p2HT([s,l],i);this.isReadOnly()&&"expand"!=f||(e={c:r,ht:f,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=c.NRt(c.URt(i.lock.union(),c.ORt(i.unlock.union(),o.x,o.y)),t)}return e&&this.getLIV().y2Is(c.TOf(t),c.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&&(!c.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:n}),!c.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:n}))}}var i=null;if(this.isSelectable()&&!t.hasOf(this)&&(i=this.getVI())){var o=this,r=this.rurOnlyAO(),n=o.getSmooth();r instanceof c.Tree.Item?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 c.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(e instanceof c.Tree.Item){var o=(i?f.getLIV():y.get(f).oLIV).i2R(e,f.origin(),f);if(o){var r,n,s,l=c.TOf(o),h=o[3],u=C[1];return l+h<0||l>u||((n=(r=f.getLIV().rgVI).get(e))&&(s=r.get(this.first()))&&n.y=0&&c.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:p.X(t),y:p.Y(t)},o=this.GetScroll(),r=this.GetClientRect();return null==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 p.Rect(this.ptCA(p.R2C(t,17),e),this.ptCA(p.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 null==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 null==t&&(t=100),u(e[0],a(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 c.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(u(10,a(1e3,l(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-p.X(e.pt)-o,i.y-p.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.e2V(t)||this;if(i.ap2I&&i.ar2I){var o=!1,r=this.getSel();e.rurEFPaint=this.selEFPaint(),e.rurEFOpts=function(t,e){e.clipClient=i.GetClientRect()},e.rurDrag=function(t){!o&&(o=2==t.event.drag.status)&&(this.oT.oRUR&&(this.oT.oRUR.ao={}),this.invAO()),o&&this.select(this.isSingleSel()?i.ap2I(t.to):i.ar2I(p.Rect(t.from,t.to)),{selChange:!1})&&((this.isToggleSel()||this.isToggleCtrlSel()&&2&c.ModK(t.event))&&(this.oT.rgSel=new c.Arr(r).toggle(this.oT.rgSel)).isEmpty()&&(this.oT.rgSel=null),this.oT.feTV("invAO"),this.oT.onSel())},e.rurCancel=function(t){this.oT.SetSelection(r)},this.rurDrag(t,e)}}},b.prototype.rurItemDrag=function(t,e){function i(t){var e=!t&&T&&x;T&&this.Smoothless(function(){e&&function(){var t=n.call(this,r.call(this),S),e=t.i,i=t.insA,o=[],s=new c.Arr(e);this.cwbU(),h.slice().reverse().forEach(function(t){s.push(t.oP,t),t.SetParent(e);var o=0;i&&(o=i.GetPosition())n[1]+n[3]/2}),e||null}function r(){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 n(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 s=this.rurI(t);if(s&&s.isSelectable()&&s.isSortable()){var l,h,f,g,d,C,y,S,v,T,m,I=this.GetScroll(),O=this.oT.newLIV,E=this.getIndent,b=this.getIndent(),w=function(){var t=3;return e.rurFlags&&(e.rurFlags.has("position")?t=1:e.rurFlags.has("keepindent")&&(t=2)),t}.call(this),x=!0;e.rurAllow=-10,e.rurDragEnd=function(t){h&&this.rurItemDragE(m),i.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){m=m||o,this.drawDI(e,i,m.oDI),v&&this.drawCS(e,i,f.len())},e.rurDrag=function(t){if(t.from!=t.to){if(!h&&function(){h=this.getMoveI(s,!0),f=this.oI.dscn(h),(T=function(){var t=w;if(t&&(t=f.len()1)switch(w){case 1:for(var e=h[0].oP,i=1,o=h.length;t&&i=0;c--)i.at(c).isSortable()||(n=c);for(c=r+1;l>s&&cs||(t[0]=i.at(n),t[1]=i.at(l))}return e}.call(this,l=[]))&&(g=function(){var t=new c.Arr,e=this.getLIV().rgVI,i=e.indexOf(s);if(i>=0){var o=s.getHeight(),r=3*this.GetPageSize()[1]/4,n=[],l=[];if(r)for(var h,u,a=i-1,p=i+1,g=e.len(),d=!0;d;a--,p++)d=!1,a>=0&&(h=e.at(a))&&f.has(h)&&o+h.getHeight()1)for(var e=this.getLIV().rgVI,i=f.first();i&&!t;i=f.next(i))t=!g.has(i)&&e.has(i);return t}.call(this),C=this.isItemAlt(g.first())?1:0,d=c.URt(this.getLIV().i2R(g.first(),0,this),this.getLIV().i2R(g.last(),0,this)),y=function(){var t=s.getLevel();return g.forEach(function(e){t=a(t,e.getLevel())}),t}.call(this)-this.gbL(),S=s.getLevel()),T&&this.Smoothless(function(){this.oT.newLIV=function(){return new c.Tree.LHIV(this,f,{i:s,h:d[3]})},this.getIndent=function(t){var e=E.call(this,t);return f.has(t)&&(e=E.call(this)*(t.getLevel()-y+S)),e},this.oT.onRL()}),m&&(m.oTV=this,m.oDI={i:g,g:v,a:C},h&&this.rurItemDragS(m))}.call(this),x=T){m&&!m.GetVisible()&&m.SetVisible(!0),t.frame=c.ORt(d.slice(),I.x,t.to.y-t.from.y),t.frame[1]<0&&c.ORt(t.frame,0,-t.frame[1]);var e=this.rtCA(t.frame,!1),i=p.X(t.event.drag.current),O=o.call(this,[i,c.TOf(e)]),F=o.call(this,[i,c.BOf(e)]),V=O||F,A=this.getLIV(),R=r.call(this),G=function(t){var e=null;if(t)if(t.a)if(t.b){var i=t.a.getLevel(),o=t.b.getLevel();e=i=G[0]&&S<=G[1],1==w&&(x&=n.call(this,R,S).i==s.oP);break;default:k=G[0],b&&(k+=~~(t.event.drag.offset.dx/b)),k=u(G[0],a(k,G[1]))}if(k!=S&&(S=k,m&&m.Render()),x&&l.length){var L=A.rgVI.indexOf(l[0]),B=(A.rgVI.indexOf(l[1])+1||A.rgVI.len()+1)-1;[A.rgVI.indexOf(R.a),A.rgVI.indexOf(R.b)].forEach(function(t){t>=0&&(x&=t>=L&&t<=B)})}}V&&A.oRep&&(V.i!=A.oRep.i||V.b!=A.oRep.b)&&this.Smooth(function(){A.replace(V),this.rurItemDragD(t)})}t.event.drag.setCursor(c.GP.Get(x?"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=c.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();c.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){c.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 null!=C&&(t=a(C,t)),null!=d&&(t=u(d,t)),t}function o(t){this.SetScroll({y:c.BOf(this.getLIV().i2R(n))-c.BOf(S)+v.y-this.scaled(u(0,t))})}function r(t){this.cwbU(),s&&s.forEach(function(e,o){null==e&&s.set(o,e=o.getHeight(f)),o.SetHeight(i(e+t))}),o.call(this,t),this.cweU()}if(t){var n=(this.e2IR(t)||{}).i;if(n){var s,h=!1,p=e.rurFlags,f=this.getDefaultItemHeight(),g=this.oI.rurIH()||[null,null],d=g[0],C=g[1],y=r,S=this.getLIV().i2R(n),v=this.GetScroll();p&&p.has("all")?(d=u(l(d),8),y=function(t){this.cwbU(),this.SetDefaultItemHeight(i(f+t)),!s&&this.oI.forEach(function(t){t.getAllowSizing()&&t.getHeight(f)!=f&&(s=s||new Map).set(t,t.GetHeight())}),s&&r.call(this,t),o.call(this,t),this.cweU()}):((s=new Map).set(n,n.GetHeight()),this.isSelected(n)&&this.getSel().forEach(function(t){t.getAllowSizing()&&s.set(t,t.GetHeight())}),s.size>128&&(d=8)),this.doRUR(t,function(t){switch(t.drag.status){case 1:e&&this.oT.oRUR&&(this.oT.oRUR.ao=n),this.rAO();break;case 7:this.oT.oRUR&&(this.oT.oRUR.ao=null),this.rAO(),h&&this.onChange("resize-item",n);break;case 2:h=!0,y.call(this,t.drag.offset.dy);break;case 0:h=!1,y.call(this,0);break;case 6:var i=this.getDefaultItemHeight()-f,o=t.drag.swipe.dy;if(s){var r=s.get(n);null==r&&(r=f),i=n.getHeight()-r}o&&c.A.Progress(function(t){y.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 null!=h&&(t=a(h,t)),null!=l&&(t=u(l,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,l=null,h=null;if(this.oT.oTV.isCAR()&&o instanceof c.Tree.Column){var p=0,f=this.GetClientRect()[2];this.getLC().vc.forEach(function(t){var e=t.getWidth();t.getAllowSizing()?(p+=e,(s.size||o==t)&&s.set(t,e)):f-=this.unscaled(e)},this),n=u(0,p/f)}else s.set(o,o.getWidth());n&&(s.forEach(function(t,e){e==o?l=-t:h+=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&&c.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 c.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=c.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(),c.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(c.GP.Get("column-drag",this.getCursors())),!o&&e&&this.oCFB.isVisible()&&(o=!0,this.oCFB.oW.onHovI()),t.frame=c.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),null!=i.p&&n.setPos(i.c,i.p),--n.lC,n.onChange();break;case"unsort":n.sort(i.c,0),null!=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)&&c.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]=a(e[2],this.unscaled(this.getLCV().wT))),e}.call(this,n),source:r=this,onpaint:function(t,e){(o=new c.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(c.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=null!=t,r=null!=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))&&(c.A.Cancel("soom"),c.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=null==t;if(null==(t=t||this.getLIV().rtLayout))this.Home();else if(!c.EyR(t)){var o=this.GetClientRect(),r=this.getScale(),n=a(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=c.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=c.BOf(e))}),r&&t(c.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){c.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,v,0,T]),this.hGL(t,i,r&&[y,0,S,0],g,s,s||d?null:e)}),l&&t.resClip(),t.restore()}var h,u,a,p=o==s.lock,f=this.getDrawGridLines(),g=this.getVI()==i?0:this.getVIT()==i?-1:1,d=g||this.clip2VC(),C=this.getDefaultItemHeight(),y=c.LOf(o.len()?o.get(o.first()):e),S=c.ROf(o.len()?o.get(o.last()):e)-y,v=c.TOf(i.len()?i.get(i.first()):e),T=d&&!i.len()?0:c.BOf(i.len()?i.get(i.last()):e)-v,m=function(){var t=new c.M1;return o.forEach(function(e,i){var o=i.GetIndex();o>=0&&t.set(o,e)}),t}();n&&((u=o.union())&&(y=c.LOf(u),S=S&&c.WOf(u)||0),(a=i.union())&&(v=c.TOf(a),T=T&&c.HOf(a)||0)),h=function(){var i=null,o=this.luShape(p);if(o){var r=s.clip||e;p&&((r=e.slice())[2]=S),i=c.Tree.bSCTX(t,o,r)}return i}.call(this),function(){i.vforEach(function(e,i){d&&((e=e.slice())[0]=y,e[2]=S),this.drawI(t,e,i,m,r)},this)}.call(this),f&&(!d&&function(){var r=i.last(),n=i.get(r),s=n&&c.BOf(n)||c.TOf(e),l=c.BOf(e);s0){var r,n=this.toShapes(c.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=c.BOf(e),(e=e.slice())[3]=o;e[1]1){var r,n,s=this.toShape("multiSel");s&&(i=c.Format(i,0),r=t.sizeHTMLText(i),n=p.C2R(p.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=c.TFI.bCTX(i,this.getTfi()),r=t.call(e||this,i),c.TFI.eCTX(i,o)),r},b.prototype.getFont=function(){return this.ctxTfi(function(t){return c.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:u(0,l(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(null==this.oM){var t=this.opt("margins",null);c.IsO(t)||(t={}),this.oM=c.Inh(t,c.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 c.IsO(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 n(this.opt("linesAtRoot"),c.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=u(0,l(this.getMargins().indent,16));return t&&(e=t.getLevel()+this.gbL(),this.isIndent(t)||(e=u(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 u(0,l(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 u(0,l(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 u(0,l(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.showHB=function(){return n(this.opt("headerVisible"),c.Tree.HeaderVisibleEnum,c.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 null==t&&(null==(t=this.GetShapes())&&(t=c.Def.Tree.shapes),t=s(t,this.defShp()),this.sShs=t),t},b.prototype.toShapes=function(t){return t&&c.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=c.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 null==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 null==t&&(null==(t=this.GetCursors())&&(t=c.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 null==this.nFT&&(this.nFT=n(this.opt("formatText"),c.DrawTextFormatEnum,c.DrawTextFormatEnum.exTextAlignLeft|c.DrawTextFormatEnum.exTextAlignVCenter|c.DrawTextFormatEnum.exTextWordBreak|c.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 null==this.rgPad&&(this.rgPad=c.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 null==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 c.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 u(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 n(this.opt("sortOnClick"),c.Tree.SortOnClickEnum,c.Tree.SortOnClickEnum.exDefaultSort)},b.prototype.isSortOnClick=function(){return this.getSortOnClick()==c.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 c.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 n(this.opt("columnsFloatBarVisible"),c.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:n(this.opt("drawGridLines"),c.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=c.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();null!=e&&t.getAllowSizing()&&t.SetHeight(e*i)})}this.oT.onRL(),this.cweU()},b.prototype.getDefaultItemHeight=function(){return u(0,l(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=c.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=u(0,a(16,~~h(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=null!=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 n(this.opt("filterBarPromptType"),c.Tree.FilterPromptEnum,c.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",!0)},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 c.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",V)},b.prototype.back=function(t,e){var i,o=this.getBackground(),r=o&&o[t];return null==r&&(e&&t in o||null==(r=(i=c.Def.Tree.background)&&i[t])&&(r=V[t])),r},c.expO({Count:null,Sorts:null},d.prototype),c.expO(c.Mrg({Options:null,Index:null},c.Tree.ColumnOptions),C.prototype),c.expO({Count:null,VisibleCount:null,MatchCount:null,LeafCount:null,HasChildren:null},S.prototype),c.expO(c.Mrg({Options:null,Index:null,Position:null,GroupItem:null},c.Tree.ItemOptions),v.prototype),c.expO({Locked:null},v.prototype,null,!1,c.expL("is")),c.expO(c.Mrg({Column:null,Item:null,Options:null},c.Tree.CellOptions),I.prototype),c.expO({Count:null},T.prototype),c.expO(c.Mrg({Options:null,Valid:null},c.Tree.ConditionalFormatOptions),m.prototype),{VO:t,EC:e,LC:f,LCV:g,Columns:d,Column:C,Sorter:y,Items:S,Item:v,CellF:A,ConditionalFormats:T,ConditionalFormat:m,Cell:I,LIV:O,LHIV:E,TV:b,BackgroundOptions:V}}()),c.Mrg(c.Tree.TV,function(){function t(t){this.init(t)}function o(t){t.oSB=this,this.init(t)}function n(t){t.oCFB=this,this.ctxRot=!0,this.huSPR=null,this.init(t)}function s(t){this.init(t)}var l,h="exprompt";return t.prototype.init=function(t){this.oTV=t,this.oS=t.oS,this.rgHVO=null,this.import()},c.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();c.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=c.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){c.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){var n,s=o.c||o,l=this.toShapes(s)||{},h=l.normal||l;!s.isEnabled()?c.EyO(l.disabled)||(h=c.Inh(l.disabled,h)):r&&(c.EyO(l.hover)||(n=r.get(this,s.idAOH))&&(h=c.R.Shape(n.state,n.range,{from:h,to:l.hover})),c.EyO(l.click)||(n=r.get(this,s.idAOC))&&(h=c.R.Shape(n.state,n.range,{from:h,to:l.click})));var u=c.Tree.bSCTX(e,h,i),a=s.gCnt(i,this);e.selClip(i),e.drawHTMLPicture(s.getImage(),a.rtImage,s.getImageSize()),e.drawHTMLText(s.getCaption(),a.rtCaption,s.getFormatText()||h.formatText,h.tfi&&c.ToTFI(h.tfi)),a.rtSort&&function(t){var i=e.globalAlpha;e.globalAlpha=e.globalAlpha/2,this.drawSort(s.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(s)),c.ORt(t.slice(),.5*t[2],-2.15*t[3]),c.DrawTextFormatEnum.exTextNoClip),e.globalAlpha=i}.call(this,a.rtSort),a.rtExpand&&this.drawExp(e,a.rtExpand,s.isExpanded(),!s.isEnabled()),a.rtFilter&&function(i){var o=this.toShapes(s.getType("filter"))||{},r=o.normal||o;!this.isEnabled()&&(c.EyO(o.disabled)||(r=c.Inh(o.disabled,r))),e.drawShape(i,r),r.text||r.draw||function(i,o){var r=s.hasFilter()?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)}.call(this,a.rtFilter),e.resClip(),u&&c.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=c.HitTest.Cursor.Rect(r.ht):this.isSelectable()&&(o=this.p2C(t))&&(e=this.getCursors(),this.p2CF(t)&&o.canFilter()?i=c.GP.Get("column-filter",e):this.p2CE(t)&&o.canExpand()&&(i=c.GP.Get("expand",e)),i||(i=o.GetCursor())||(i=c.GP.Get(c.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&&(!c.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}),!c.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();r instanceof c.Tree.Column?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=c.Tree.VO.p2O(this.getHVO(),p.X(i)-o.x,p.Y(i)-o.y,e);return e&&r&&c.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()&&p.R2C(this.GetClientRect())[1]>p.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=c.PInR(p.X(r),p.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=c.PInR(p.X(n),p.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(){c.TT.Hide()},t.prototype.showTT=function(t){var e,i=this.gPtr(t),o=[],r=this.p2C(i,o),n=16;c.TT.Show(function(){return r&&(e=r.tt(this,o))&&{relative:t.target,client:function(){return this.ctxTfi(function(t){var i=c.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=c.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),p=0;if(this.forEach(function(t){l.set(t,{auto:o=t.autoWidth(),width:r=u(o,t.getWidth())}),n+=r}),(p=n-h)>0){for(var f=!0,g=this.len();f&&(p=~~(n-h))>0;){var d=p;l.forEach(function(t){if(p>0){var e=a(p/g,u(0,t.width-t.auto));t.width-=e,n-=e,p-=e}}),f=d-p}p>0&&(s=a(1,h/n))}this.forEach(function(o){i[2]=s*l.get(o).width,t.lock.set(o.IDHVO(),i.slice()),c.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=c.PRt(e,this.getPad(),-1),i),t.drawHTMLText(this.oTV.getSortBarCaption(),e=c.PRt(e,this.getPad(),-1),c.DrawTextFormatEnum.exTextAlignVCenter|c.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(n.prototype,t.prototype),n.prototype.colsT=function(){return 255&this.oTV.showCFB()},n.prototype.showCheck=function(){return 2&this.colsT()},n.prototype.showVisible=function(){switch(this.colsT()){case 2:case 4:case 255:return!0}return!1},n.prototype.colsC=function(){return this.oTV.getColumnsFloatBarCaption()+""},n.prototype.capH=function(){var t=this.gCtx(),e=this.colsC();return e.length&&t&&t.sizeHTMLText(e).height||0},n.prototype.colsO=function(){var t=this.oTV.getColumnsFloatBarSortOrder();return 2==t&&2||1==t&&1||0},n.prototype.colsD=function(){return this.oTV.oC},n.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&&c.Cmp.S||c.Cmp.R(c.Cmp.S)),i},n.prototype.onvscroll=function(t){this.resHVO(!0)},n.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()}))}}}(n.prototype.resHVO),n.prototype.GetScroll=function(){return this.oW.GetScroll()},n.prototype.rurOnlyAO=function(){var t=this.oTV.oT.oRUR;return t&&t.w==this.oW&&t.ao||null},n.prototype.p2Y=function(t){if(this.ctxRot&&!this.isVert()){var e=this.GetClientRect(),i=2*e[1]+(e[3]-p.Y(t));"y"in t?t.y=i:t[1]=i}return t},n.prototype.p2C=function(t){return function(e,i){return t.call(this,this.p2Y(e),i)}}(n.prototype.p2C),n.prototype.p2CK=function(t){t=this.p2Y(t);var e=this.GetClientRect(),i=this.scaled(p.X(t)-e[0]),o=this.scaled(p.Y(t)-e[1]);return this.getHVO().check.p2O(i,o)},n.prototype.p2CR=function(t){return null},n.prototype.getType=function(){return"floatBar"},n.prototype.showGlyphs=function(t){return function(){var e=t.apply(this,arguments);return e.e=!1,e}}(n.prototype.showGlyphs),n.prototype.isVert=function(){var t=this.GetClientRect();return t[3]>=t[2]},n.prototype.updSPR=function(){var t=this.isVert(),e=this.GetClientRect(),i=this.getPad();this.oW&&this.oW.SetSI(null,{page:this.scaled(e[t?c.h:c.w])-2*i[t?c.y:c.x]-this.capH(),range:this.cols().length*this.oTV.getHeaderHeight()})},n.prototype.getHVO=function(){return this.rgHVO||(this.rgHVO=function(){var t=c.Tree.VO(),e=this.cols(),i=e.length;if(t.check=new c.M1,i){var o=this.getPad(),r=this.GetClientRect(),n=this.GetScroll().y,s=this.oTV.getHeaderHeight(),l=o[0],h=o[1],p=this.scaled(r[2]),f=p-2*o[0],g=this.scaled(r[3]),d=g-2*o[1],C=this.capH(),y=~~(n/s),S=this.showCheck()&&this.getCrSize();if(this.isVert())for(m=1+~~((C+o[1])/s),S&&(l+=S+=o[0],f-=S,S-=o[0]),h+=C-(a(y,m)*s+n%s),I=u(0,y-m);h1)for(var r,n=!0,l=t.get(this.oW);n;)n=!1,o.forEach(function(e){r=t.get(e.oW),l!=r&&!c.EyR(r)&&l[1]==r[1]&&l[3]==r[3]&&(l[0]0&&(h[0]=c.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(u=t.slice(),u[3]=this.getFilterBarHeight()-2*r,l){u[2]=t[2]/2,u[1]+=(t[3]-u[3])/2;var p=u[2]+o;t[0]+=p,t[2]-=p}else{var f=u[3]+r;t[1]+=f,t[3]-=f}return this.showCap()&&(a=t),{rtClose:e(h),rtPrompt:e(u),rtCaption:e(a)}},s.prototype.GetScroll=function(){return{x:0,y:0}},s.prototype.p2F=function(t,e){var i=null,o=this.ptCA(t),r=this.gCnt();for(var n in r)if(c.PInR(o.x,o.y,r[n])){i=n.repAll("rt","").toLowerCase(),e&&e.push.apply(e,r[n]);break}return i},s.prototype.p2C=function(t,e){var i=null,o=this.gCnt().rtCaption;if(o){var r=this.ptCA(t),n=p.X(r),s=p.Y(r);if(c.PInR(n,s,o)){var l=this.gCtx(),h=null,u=null,a=l.renderText,f=c.TFI.bCTX(l,this.getTfi());l.renderText=function(t,e,i){if(!h){var o=[e,i,this.measureText(t).width,this.fontHeight()];c.PInR(n,s,o)&&(u=o,h=t)}},this.ctxScale(l,this.GetClientRect(),function(t){l.drawHTMLText(this.cap(),o,c.DrawTextFormatEnum.exTextAlignLeft|(this.isSingle()?c.DrawTextFormatEnum.exTextAlignVCenter|c.DrawTextFormatEnum.exTextSingleLine:0))},this),l.renderText=a,c.TFI.eCTX(l,f),h&&(i=this.oTV.oC.Item(h.trim()))&&e&&e.push.apply(e,u)}}return i},s.prototype.toShapes=function(t){return this.oTV.toShapes(t)},s.prototype.getCursors=function(){return this.oTV.getCursors()},s.prototype.getCursor=function(t){var e,i,o;return this.isSelectable()&&(i=this.p2F(t))&&(i=this.getType()+"-"+i,e=c.GP.Get(i,this.getCursors()),(o=this.p2C(t))&&o.canFilter()&&(e=c.GP.Get(i+"-column",this.getCursors())||e)),e||null},s.prototype.onmousemove=function(t){var e,i=this.getCursor(this.gPtr(t));return i&&(e=this.GetCanvas())&&(e.style.cursor=i),i},s.prototype.ondown=function(t){if(this.isSelectable()){var e=[];this.p2F(this.gPtr(t),e)&&c.RUC(t,function(t){this.onClick(t)},this,{client:this.rtCA(e,!1),activeObjects:{oAO:this.gAO(),owner:this,unfreezemask:"fb*"}})}return!0},s.prototype.onClick=function(t){var e=this.p2F(this.gPtr(t));e&&i(this[e="on"+c.getP(e)])&&this[e].call(this,t)},s.prototype.onClose=function(t){this.hasFilter()?this.oTV.Smooth(function(){this.clearFilter()},this):this.isToggle()?this.toggleFilterBar():this.onPrompt(t)},s.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"))},s.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"))},s.prototype.toggleFilterBar=function(){this.isToggle()&&(this.bU(),(this.oTV.ntglFB=!this.oTV.ntglFB)||this.clearFilter(),this.eU(),this.onPrompt())},s.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,n=this.gCnt().rtPrompt,s=this.getFont(),u=2&this.hasFilter()&&this.patt()||"";n&&(!l&&(l=!void c.aCSS("."+h,"{background:rgba(0, 0, 0, 0);border:0;padding:0;margin:0;outline:0;")),(o=c.EF.Create({name:"filter.prompt-edit",class:h,client:this.rtCA(n,!1),relative:this.GetCanvas(),clip:this.GetCanvas(),tag:"input",inner:{value:u,style:{font:r(s,this.oTV.getScale())}},modal:!0,onmodal:function(t,o){switch(o){case"start":case"end":this.inv();break;case"cancel":e.call(this,u);break;case"change":e.call(this,t.value,function(e){clearTimeout(i),i=c.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;c.Keys.IsStEv(e.stglFB,t)&&(e.toggleFilterBar(),c.EF.Destroy(o),c.SEP(t))}))},s.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:n,FilterBar:s}}()),t.Tree=c.Tree});