/* @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*s(e,1)+"px "+t.family}function n(t,e){return f.ToS(t,e)}function s(t,e){return f.ToN(t,e)}function l(t,e){return f.ToI(t,e)}function h(){return Math.max.apply(0,arguments)}function a(){return Math.min.apply(null,arguments)}function u(t){return null!=t}function c(t){return null==t}function p(t,e,i){return c(t)?~~i:f.s2F(t,e)}var f=f||window.exontrol,g=f.G;f.Def.Tree={},f.Shapes.Tree={},f.Mrg(f,function(){function t(t,e){this.init(t,e)}return t.version="3.2",t.type="Tree",t.efCellEdit="cell-edit",t.XML=function(){function t(t){return u(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:f.E.Create("column + (exclude ? ` # ` : ` = `) + `'` + value + `'` ","column,value,exclude"),append:f.E.Create("A + (len(A) ? ` ` : ``) + B","A,B"),and:f.E.Create("A + ` and ` + B","A,B"),or:f.E.Create("A + ` or ` + B","A,B"),not:f.E.Create("`not ` + A","A"),isBlank:f.E.Create("`IsBlank(` + A + `)`","A"),isChecked:f.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:{"<":f.EO.LESS,"=":f.EO.EQUAL,">":f.EO.GREAT,"<=":f.EO.LESSE,"<>":f.EO.NEQUAL,"!=":f.EO.NEQUAL,">=":f.EO.GREATE}},t.Filter.Parser=function(){function e(e){e=e||t.Filter.Op;var i=new Map,o=[];for(var r in e)o.push(r);return o.sort().reverse().forEach(function(t){i.set(t,e[t])}),i}var i=e();return{Get:function(t,e,o){function r(e){var o;return i.forEach(function(i,r){!o&&t.sWith(r,e)&&(o=r)}),o}function n(){(s=s.trim())&&h.push({cbk:i.get(l||"="),v:e?e.call(o||this,s):s})}for(var s,l,h=[],a=0,u=0,c=t.length;u=0&&(!function(t){return t.split(",").forEachU(function(t){return this.has(t)},this)}.call(i,e)||i.has(t))},t.HeaderVisibleEnum={exHeaderHidden:0,exHeaderVisible:-1,exHeaderVisibleExtendLevels:1},t.SortTypeEnum={exSortString:0,exSortNumeric:1,exSortDate:2,exSortByValue:16,exSortByState:32,exSortByImage:48},t.GridLinesEnum={exNoLines:0,exAllLines:-1,exRowLines:-2,exHLines:1,exVLines:2},t.FilterListEnum={exAllItems:0,exVisibleItems:1,exNoItems:2,exLeafItems:3,exRootItems:4,exSortItemsDesc:16,exSortItemsAsc:32,exShowCheckBox:256,exShowExclude:8192,exShowBlanks:16384},t.FilterTypeEnum={exAll:0,exBlanks:1,exNonBlanks:2,exPattern:3,exDate:4,exNumeric:5,exCheck:6,exImage:10,exFilter:240,exFilterDoCaseSensitive:256,exFilterExclude:512},t.FilterPromptEnum={exFilterPromptContainsAll:1,exFilterPromptContainsAny:2,exFilterPromptStartWith:3,exFilterPromptEndWith:4,exFilterPromptPattern:16,exFilterPromptCaseSensitive:256,exFilterPromptStartWords:4608,exFilterPromptEndWords:8704,exFilterPromptWords:12800},t.FilterBarVisibleEnum={exFilterBarHidden:0,exFilterBarPromptVisible:1,exFilterBarVisible:2,exFilterBarCaptionVisible:4,exFilterBarSingleLine:16,exFilterBarToggle:256,exFilterBarShowCloseIfRequired:512,exFilterBarShowCloseOnRight:1024,exFilterBarCompact:2048,exFilterBarShort:4096},t.FilterIncludeEnum={exItemsWithoutChilds:0,exItemsWithChilds:1,exRootsWithoutChilds:2,exRootsWithChilds:3,exMatchingItemsOnly:4,exMatchIncludeParent:240},t.ColumnsFloatBarVisibleEnum={exColumnsFloatBarHidden:0,exColumnsFloatBarVisible:1,exColumnsFloatBarVisibleIncludeGroupByColumns:1,exColumnsFloatBarVisibleIncludeCheckColumns:2,exColumnsFloatBarVisibleIncludeHiddenColumns:4,exColumnsFloatBarFloat:256},t.SortOrderEnum={exSortNone:0,exSortAscending:1,exSortDescending:2},t.SortOnClickEnum={exNoSort:0,exDefaultSort:-1,exUserSort:1},t.SingleSelEnum={exDisableSel:0,exEnableSel:1,exSingleSel:2,exToggleSel:4,exDisableCtrlSel:8,exDisableShiftSel:16,exDisableDrag:32},t.LinesAtRootEnum={exNoLinesAtRoot:0,exLinesAtRoot:-1,exGroupLinesAtRoot:1,exGroupLines:2,exGroupLinesInside:3,exGroupLinesInsideLeaf:4,exGroupLinesOutside:5},t.Options={scrollBars:null,tfi:null,locked:null,readOnly:!1,wheelChange:null,smooth:null,margins:null,shapes:null,cursors:null,singleSel:null,zoom:null,zoomLevels:null,formatText:null,pad:null,imageSize:null,imageAlign:null,allowActions:null,expandGlyphSize:null,crSize:null,headerHeight:null,headerVisible:null,headerEnabled:null,countLockedColumns:null,columnAutoResize:null,sortBarVisible:null,sortBarCaption:null,singleSort:null,sortOnClick:null,allowGroupBy:null,groupByFormatCell:null,columnsFloatBarVisible:null,columnsFloatBarSortOrder:null,columnsFloatBarCaption:null,filterInclude:null,filterBarHeight:null,filterBarVisible:null,filterBarCaption:null,filterBarPrompt:null,filterBarPromptPattern:null,filterBarPromptType:null,filterBarPromptColumns:null,drawGridLines:null,gridLines:null,defaultItemHeight:null,treeColumnIndex:void 0,expandOnDblClick:null,itemAllowSizing:null,ensureOnSort:null,showLockedItems:null,allowDrop:null,onErrorChooseFile:null,scrollPos:null,toolTipDelay:null,toolTipPopDelay:null,toolTipWidth:null,data:null,hasLines:{width:void 0,color:"rgb(128,128,128)",style:null,cap:null,join:null},hasButtons:null,linesAtRoot:null,selection:null,background:null},t.sCnt=function(t,e,i){function o(t){return!f.EyR(t)&&t||null}var r=this.getPad(),n=f.HP.Measure(this.getImage(),this.getImageSize(),e),s=f.PRt(t.slice(),r,-1),l=null,h=null;if(u(n)){switch(i&&(h=s.slice()),this.getImageAlign()){case 3:l=[s[0]+(s[2]-n.width)/2,f.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=[f.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=f.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=f.TFI.bCTX(t,e.tfi),u(e.opacity)&&((r=r||{}).opacity=t.globalAlpha,t.globalAlpha=e.opacity)),r},t.eSCTX=function(t,e){u(e.opacity)&&(t.globalAlpha=e.opacity),e instanceof f.TFI&&f.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-"+f.Rand(),this.nHLC=1,this.iLts(),this.oCW=new f.CW(e,{AllowXChg:0,ScrollBars:f.Def.Tree.scrollBars}),this.oCW.oT=this,this.Shortcuts=this.oCW.oSts,this.initCW(),this.import(),this.onSCR(),f.expO(t.Options,this,this.oTV),f.RUR.Listeners.add("srur",this),this.cwbU(),this.SetOptions(i,!0),this.cweU(),f.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())&&(u(e.height)&&(n=h(n||0,e.height)),u(e.width)&&(r=h(r||0,e.width))),(u(n)&&(n=i.unscaled(n))!=this.client[3]||u(r)&&(r=i.unscaled(r))!=this.client[2])&&(u(n)&&(this.client[3]=n),u(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=f.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):(c(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){f.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 f.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(!c(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,f.Mrg({Dock:r?5:4,Size:256},e));o=new f.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 f.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){!c(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 f.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 f.ScrollBar}),this.addTV("tree"),o.SetC(this.oSB=new f.Tree.TV.SortBar(this.oTV)),o.GetVisible=this.oTV.showSB.bind(this.oTV),this.aSizeW(o),this.addCFB("floatbar",this.oCFB=new f.Tree.TV.FloatBar(this.oTV),"showCFB",{Dock:4})},t.prototype.w2P=function(t){function e(){function t(t){var e=[];return f.B.split(t).forEach(function(t){t.caption&&t.subText&&e.push({n:t.caption,p:function(t){var e=f;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&&g>=0)for(var d=a(g,p),C=h(g,p);d<=C;d++){var y=n.rgVI.at(d);!this.rgSel.has(y)&&y.isSelectable()&&(e=!0,this.rgSel.push(y))}}else l&&i?(e=i,this.removeSel(t)):(l||(e=u(this.rgSel)&&(!i||this.rgSel.len()>1),this.rgSel=null),o&&(this.rgSel=this.rgSel||new f.Arr).push(t)),e|=i!=this.isSelected(t);return e}var n=!1,s=1==(i=i||{}).selType,l=2&i.selType,p=function(e){var i=null;if(u(e)){var r=this.oI,n=r.Item;e instanceof t.Items?e==this.oI&&(i=this.oI.rgI):o(e)||e instanceof f.Arr?(i=new f.Arr,e.forEach(function(t){i.ann(n.call(r,t))})):i=n.call(r,e)}return i}.call(this,e);return p instanceof f.Arr?s?n|=r.call(this,p.last()):l?p.forEach(function(t){n|=r.call(this,t)},this):(n=!p.equal(this.rgSel))&&(this.isSingleSel()?r.call(this,p.last()):(this.rgSel=new f.Arr,p.forEach(function(t){t.isSelectable()&&this.rgSel.push(t)},this))):n=r.call(this,p),n&&(this.rgSel instanceof f.Arr&&(this.rgSel.len()||(this.rgSel=null)),(c(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,a=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(a)&&i(h.prev(a));break;case"prior":case"pageup":s=-1;break;case"end":o=r=i(h.last());break;case"down":case"arrowdown":o=r=h.has(a)&&i(h.next(a),!0);break;case"next":case"pagedown":s=1}if(s){var u,c=s<0?0:1;(u=e.call(this))&&(a!=u[c]?o=r=i(u[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&&f==e.charAt(0)&&f==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(),s.call(this,t),this.onLoad(),this.eU()):this.LoadXML(t)}e&&(this.oImp=f.Mrg(f.Mrg({},t.ImportOptions),i),this.oImp.oExCC=f.E.Create(n(this.oImp.columnCaption),"index"),f.Ld(e,{u:function(t){return f.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){f.Ld(e,{u:function(t){return f.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 f.IsN(t)?s(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:~~a.call(t,"Expanded"),height:i(a.call(t,"Height"))});return h.call(t,function(t,e){(o=r.Cell(e))&&o.SetOptions({value:a.call(t,"Value"),image:a.call(t,"Image"),state:a.call(t,"State")})},this,"Cell"),this.xmlLI(r,t),!--this.lAI&&this.onAddItem(r),r}.call(this,t,o),n=l.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,l=n.tag,h=n.feU,a=n.vOf,c=n.v2N;(function(t){if(t){var e,i,o,r=this.oC;if(h.call(t,function(t){o=r.Add({caption:a.call(t,"HTMLCaption")||a.call(t,"Caption"),width:c(a.call(t,"Width")),image:a.call(t,"Image"),visible:c(a.call(t,"Visible")),sortType:c(a.call(t,"SortType")),partialCheck:c(a.call(t,"PartialCheck")),format:a.call(t,"FormatColumn"),filterType:c(a.call(t,"FilterType")),filterList:c(a.call(t,"FilterList")),filterOnType:c(a.call(t,"FilterOnType")),displayFilterButton:c(a.call(t,"DisplayFilterButton")),cellHasCheck:a.call(t,"CheckBox")?1:0}),u(i=a.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,g=new f.Arr(l);s.length=p,e.forEach(function(t,e){t>=0&&t=0&&!u(t.rgC[i[n]].GetValue());n--,r--);for(var n=0;n=0||i>=0)&&(t=t.replace(p,c+c),t=c+t+c)}return t}:n;r.forEach(function(t,e){e>0&&(l+=h);for(var i=0,o=t.length;i0&&(l+=a),l+=g(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=f.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=f.doc.body,h=this,a=this.oCW,c=a.zIndex();this.Clear(),s=this.getLIV(),u(t)&&function(i){(n=e("span",i)).oT=h,n.className="error",n.style.color="#f44336",n.innerText=f.IsS(t)?t:t instanceof DOMException||t instanceof ReferenceError?t:"Error: Access is denied (blocked by CORS policy)",l.appendChild(n)}(++c),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)}(++c),this.oIF={i:r,s:n},i=setInterval(function(){if(s==h.getLIV()){var t=f.Ert(a.canvas);if(!f.EqR(t,o)){if(o=t,r){var e=f.Ert(r);r.style.left=f.toU(t[0]+(t[2]-e[2])/2),r.style.top=f.toU(t[1]+(t[3]-e[3])/2),r.style.opacity=f.EyR(t)?0:1,t=f.ORt(t.slice(),0,e[3])}if(n){var u=f.Ert(n);n.style.left=f.toU(t[0]+(t[2]-u[2])/2),n.style.top=f.toU(t[1]+(t[3]-u[3])/2),n.style.opacity=f.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 f.Arr,rgGI:new f.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(),a=255&h;if(e={cbkII:function(){},nC:this.oC.GetCount(),rgC:this.getFilterBarPromptColumns(),bCS:h&t.FilterPromptEnum.exFilterPromptCaseSensitive},a==t.FilterPromptEnum.exFilterPromptPattern)e.oMW=f.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 f.Arr;return u(t)&&t.split(" ").forEach(function(t){(t=t.trim())&&o.add(e&&t.toLocaleLowerCase()||t)}),o.byO()}(i,!e.bCS),a){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 a=!i;if(!a){var u=e.length;a=l.length==u||s(l,l.length-(u+1))}if(a)return!0}}}for(var i=r.call(this,t),o=0,l=this.rgW.length;o=0&&(r=c-u)&&(n=r)&&Array.prototype.unshift.apply(r<0?a: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){f.Tree.LCV.push.call(i.unlock,e,t,d,p,s,h,n),d+=p}),i.unlock.len()&&i.lock.len()&&l-h>0&&(i.clip=[h,0,l-h,C])),u){var S=C+1;[i.lock,i.unlock].forEach(function(t){t.forEach(function(t){t[1]=S-t[3]-t[1]})})}if(t.isHeader()&&r.showHB()==f.Tree.HeaderVisibleEnum.exHeaderVisibleExtendLevels){var v=1==a,T=new f.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},C.prototype.doL=function(t,e){function i(t){return t.getWidth()}function o(t,e,i){var o=0,r=0;return i&&(o=C.get(e),r=C.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 f.Arr,w:0},this.unlock={head:[],cell:[],vc:new f.Arr,w:0};var r=0,n=t.vc,l=h(0,a(t.oT.oTV.getCountLockedColumns(),n.len()));if(u(e)){e=h(0,s(e,0));var p=0,g=0;if(n.forEach(function(t){var e=i(t);p+=e,t.getAllowSizing()&&(g+=e)}),g>0){var d=h(0,(e-(p-g))/g);i=function(t){var e=t.getWidth();return t.getAllowSizing()&&(e*=d),e},this.w=p-g}}var C=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},C.prototype.getNL=function(){return this.unlock.head.length},C.prototype.getCVO=function(t){var e=f.Tree.VO(),i=t.GetPageSize(),o=i[0],r=i[1],n=this.lock.w;return C.push.call(e.lock,null,this.lock.cell,0,r,o),C.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,h(0,o-n),t.scaled(t.GetWindowRect()[3])]),e},C.push=function(t,e,i,o,r,n,s){n=n||0,s=s||0,r=r||0;var l=null,h=0,a=e.length;if(s>0)for(;h"+t+""),2&e&&(t=""+t+""),4&e&&(t=""+t+""),8&e&&(t=""+t+""),"["+t+"]"}(t.getKey(),e?1:8);return(e=e||function(t){return""+t+""}).call(i||this,o)}function i(t){o=f.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},y.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=n(this.val).trim(),i=this.not;return f.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(f.Tree.Filter.description.to),o=Date.Parse(i[0]),r=Date.Parse(i[1]);if(1==i.length&&(r=o),o&&r&&f.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]||f.Cmp.D(s[1],o)>=0)}return this.not&&(e=!e),e},t}():function(){var t=o();return t.cbkL=function(t){var e=n(this.val).trim(),i=this.not;return f.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(f.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":"")}),f.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},S.prototype.GetFormatImage=function(){return this.oO.formatImage},S.prototype.SetFormatImage=function(t){this.bU(),this.oExFI=void 0,this.oO.formatImage=t,this.eU()},S.prototype.getFormatImage=function(){if(void 0===this.oExFI){this.oExFI=null;var t=n(n(this.GetFormatImage(),n(f.Tree.ColumnOptions.formatImage,null)));t&&!(this.oExFI=f.Tree.CellF.Create(t)).IsValid()&&(this.oExFI=null)}return this.oExFI},S.prototype.tt=function(t,e){var i,o,r=this.getToolTip(),s=u(r);return t&&e&&(o=this.gCnt(e,t).rtCaption)&&(s?n(r):u(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:s?r:i,rtT:f.ORt(t.rtCA(o,!1),-3,-3)}||null},v.prototype.initS=function(){this.rgS=new f.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)},v.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)},v.prototype.toColumn=function(t){return this.oC.Item(t)},v.prototype.dTV=function(){return this.oT.oTV},v.prototype.isSingleSort=function(){return this.dTV().isSingleSort()},v.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()},v.prototype.onDelCol=function(t){var e=this.isSort(t);this.lC++,this.remove(t),--this.lC,e&&this.onChange()},v.prototype.onChange=function(){this.lC||(this.oT.getAllowGroupBy()&&(this.oC.resLC(),this.oC.ensoTC(),this.oT.onHLC()),this.onSort(),this.bMS=0)},v.prototype.onSort=function(){this.oT.onSort(this.bMS)},v.prototype.add=function(t,e){return this.lC++,c(e)||e?this.oSS=!this.rgS.has(t)&&t||null:this.rgS.add(t),--this.lC,this.getSortLen()},v.prototype.remove=function(t){this.lC++,this.rgS.remove(t),this.oSS==t&&(this.oSS=null),--this.lC},v.prototype.clear=function(){var t=this.oSS||!this.rgS.isEmpty();this.lC++,this.oSS=null,this.rgS.clear(),--this.lC,t&&this.onChange()},v.prototype.isSort=function(t){return t&&(t==this.oSS||this.has(t))&&t.getSortOrder()||0},v.prototype.getSortPos=function(t){var e=this.rgS.indexOf(t);return e<0&&t==this.oSS&&(e=this.rgS.len()),e},v.prototype.getSortLen=function(){return this.rgS.len()+(this.oSS&&1||0)},v.prototype.sort=function(t,e,i){this.lC++;var o=!1,r=this.toColumn(t);if(r&&r.getAllowSort()){(o=(e=c(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},v.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},v.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=n(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()},T.prototype.init=function(t){this.oT=t,this.oS=t.oS,this.rgI=new f.Arr,this.rgI.onRemove=t.onDelItem.bind(t),this.import()},T.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)},T.prototype.onRL=function(){this.oT.onRL()},T.prototype.getHeight=function(t,e){var i=t.GetHeight();return c(i)&&c(i=e)&&(i=this.oT.getDefaultItemHeight()),h(0,i)},T.prototype.setHeight=function(t,e){t.oO.height=e},T.prototype.rurIH=function(){},T.prototype.resKI=function(){this.mKI=null},T.prototype.Add=function(t){this.bU(),this.resKI();for(var e,i,o=this.add(new f.Tree.Item(this,t)),r=o.rgC,n=this.oT.oC.rgC.rgE,s=0,l=n.length;s1&&p.set(t,d),d=t),e}()?o=i(-1):(o=f.Expr.prototype.Evaluate.call(this,i),d=p.get(t),p.delete(t)),C--,o}function l(t,e){var i=g.get(t);return!e&&!i&&g.set(t,i={TG:new Map,TL:new Map,TE:new Map}),i}var h=new Map,u=new Map,p=new Map,g=new Map,d=null,C=0,y=function(e){function i(t){return(t=n(t))&&t.trim().toLowerCase()||""}var o=f.B.split(e)[0];if(o){var r=i(o.caption);if(r in y.Agg){var s=o.subText.splitP(","),l=function(t){var e="all";return(t=i(t))&&(f.IsI(t)||y.List.Enum.has(t))&&(e=t),e}(s[0]),h=function(t){var e="all";return(t=i(t))&&y.Dir.Enum.has(t)&&(e=t),e}(s[1]);this.cbk=y.Agg[r],this.oEx=function(e){var i=t(e);return i.IsValid()?i:t(1)}(s[2]),this.lix=~~l,this.lst=y.List.cbk[(f.IsI(l)?"index":l)+"."+h]}}};y.prototype.nEC=function(){return d&&d.oC.GetIndex()||0},y.prototype.Evaluate=function(){var t=l(d.dTV().oT),e=t.TE.get(d);!e&&t.TE.set(d,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,d.oI))||0}.call(this)),i},y.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 f.Arr("current","all","parent","root"),cbk:{"all.dir":function(t){var e=l(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=l(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=l(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=l(i.t()),r=e(i)+".cd",n=o.TL.get(r);return!n&&o.TL.set(r,t(i,"dir",n=[])),n},"current.rec":function(i){var o=l(i.t()),r=e(i)+".cr",n=o.TL.get(r);return!n&&o.TL.set(r,i.hasChild()?t(i,"rec",n=[]):n=[]),n},"current.all":function(i){var o=l(i.t()),r=e(i)+".ca",n=o.TL.get(r);return!n&&o.TL.set(r,t(i,"all",n=[])),n},"parent.dir":function(t){return i.cbk["current.dir"](t.oP||t)},"parent.rec":function(t){return i.cbk["current.rec"](t.oP||t)},"parent.all":function(t){return i.cbk["current.all"](t.oP||t)},"root.dir":function(t){return i.cbk["current.dir"](t.getRoot())},"root.rec":function(t){return i.cbk["current.rec"](t.getRoot())},"root.all":function(t){return i.cbk["current.all"](t.getRoot())},"index.dir":function(t){return i.cbk["current.dir"](t.oI.Item(this.lix))},"index.rec":function(t){return i.cbk["current.rec"](t.oI.Item(this.lix))},"index.all":function(t){return i.cbk["current.all"](t.oI.Item(this.lix))}}};return i}(),y.Dir={Enum:new f.Arr("dir","rec","all")},y.Agg={count:function(t){return t.length},sum:function(t){var e=0,i=this.nEC();return t.forEach(function(t){e+=s(this.oEx.Evaluate(t.rgC[i]))},this),e},avg:function(t){return t.length?y.Agg.sum.call(this,t)/t.length:0},std:function(t){var e,i=0,o=G.Total.Agg.avg.call(this,t),r=this.nEC();return t.forEach(function(t){e=Math.abs(s(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=s(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:y.Agg[t];return r&&r.call({oEx:{Evaluate:function(t){return t}},nEC:function(){return o}},e)},Op1:{get:function(t,e){var i=l(d.dTV().oT),o=i.TG.get(t);return!o&&i.TG.set(t,o=new y(t)),o.Evaluate()},exp:function(){var t=d.oI;return!(!t.hasChild()||!t.isExpanded())}},Op2:{index:function(t,i){return e(d.oI,0,t,i)},rindex:function(t,e){return o(d.oI,0,t,e)},pos:function(t,i){return e(d.oI,1,t,i)},rpos:function(t,e){return o(d.oI,1,t,e)},opos:function(t,i){return e(d.oI,2,t,i)},ropos:function(t,e){return o(d.oI,2,t,e)},apos:function(t,i){return e(d.oI,3,t,i)},rapos:function(t,e){return o(d.oI,3,t,e)}},OpCell:function(){return d},XC:function(t,e){var i=l(t,!0);i&&((e=e||0)<1&&i.TG.clear(),e<2&&i.TL.clear(),e<3&&i.TE.clear())},Total:y}}();return I.prototype.init=function(t){this.oT=t,this.mCF=null,this.mKI=null,this.rgCF=new f.Arr,this.rgCF.onRemove=this.onDelCF.bind(this),this.import()},I.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)},I.prototype.onDelCF=function(t){this.resKI(),this.resCF()},I.prototype.resKI=function(){this.mKI=null},I.prototype.resCF=function(){this.mCF=null},I.prototype.bSCTX=function(t,e,i){var o,r=e instanceof f.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=f.Tree.bSCTX(t,e.getShape(),i);r&&(o=o||[]).push(r)}}),o},I.prototype.eSCTX=function(t,e){if(e)for(var i=e.length-1;i>=0;i--)f.Tree.eSCTX(t,e[i])},I.prototype.Add=function(t){this.bU(),this.resKI(),this.resCF();var e=new f.Tree.ConditionalFormat(this,t);return this.eU(),e},I.prototype.GetCount=function(){return this.rgCF.len()},I.prototype.Item=function(t){var e=null;return~~t===t?e=this.rgCF.at(t)||null:t instanceof f.Tree.ConditionalFormat?e=this.rgCF.has(t)?t:null:c(e=function(t){var e=t.mKI;return c(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},I.prototype.Remove=function(t){this.RemoveRange(this.Item(t))},I.prototype.RemoveRange=function(t){this.bU(),this.resKI(),this.resCF(),this.rgCF.removeRange(t),this.eU()},I.prototype.Clear=function(){this.bU(),this.resKI(),this.resCF(),this.rgCF.clear(),this.eU()},O.prototype.bU=function(){this.oCF.bU()},O.prototype.eU=function(){this.oCF.eU()},O.prototype.dTV=function(){return this.oCF.oT.oTV},O.prototype.resCF=function(){return this.oCF.resCF()},O.prototype.getExC=function(){return this.oExC||(this.oExC=f.Tree.CellF.Create(n(this.GetExpression())))},O.prototype.Remove=function(){return this.oCF.Remove(this)},O.prototype.GetOptions=function(){return this.oO},O.prototype.SetOptions=function(t){this.bU(),this.setOpts(t),this.eU()},O.prototype.setOpts=function(t){if(u(t)){var e=f.IsO(t)?t:{expression:t+""};for(var i in e){var o=this[f.setM(i)];o&&o.call(this,e[i])}}},O.prototype.GetApplyTo=function(){return this.oO.applyTo},O.prototype.SetApplyTo=function(t){this.bU(),this.resCF(),this.oO.applyTo=t,this.eU()},O.prototype.getApplyTo=function(){var t=this.GetApplyTo();if(t<0||c(t))t=-1;else{var e=this.oCF.oT.oC.Items(t);t=e.len()?e:null}return t||null},O.prototype.GetExpression=function(){return this.oO.expression},O.prototype.SetExpression=function(t){this.bU(),this.resCF(),this.oExC=null,this.oO.expression=t,this.eU()},O.prototype.GetEnabled=function(){return this.oO.enabled},O.prototype.SetEnabled=function(t){this.bU(),this.resCF(),this.oO.enabled=t,this.eU()},O.prototype.isEnabled=function(){return c(this.GetEnabled())||this.GetEnabled()},O.prototype.GetKey=function(){return this.oO.key},O.prototype.SetKey=function(t){this.bU(),this.oCF.resKI(),this.oO.key=t,this.eU()},O.prototype.getKey=function(){return n(this.GetKey())},O.prototype.GetShape=function(){return this.oO.shape},O.prototype.SetShape=function(t){this.bU(),this.resCF(),this.oO.shape=f.S.A2S(t),this.eU()},O.prototype.getShape=function(){return this.dTV().toShape(this.GetShape())},O.prototype.GetValid=function(){return this.isValid()},O.prototype.isValid=function(){return this.getExC().IsValid()},E.prototype.getType=function(){return"cell"},E.prototype.bU=function(){this.oI.bU()},E.prototype.eU=function(t){this.oI.eU(t)},E.prototype.dTV=function(){return this.oI.dTV()},E.prototype.toShape=function(t,e){return this.dTV().toShape(t,e)},E.prototype.gCnt=function(t){var e,i,o,r,n,s=this.dTV(),l=s.getIndent(this.oI);return t=f.IRt(t.slice(),-this.getPad()[0],0),this.showExpand()&&((e=s.getExpandGlyphSize())&&this.oI.hasChild()?l>=s.getIndent()&&(r=[t[0]+h(0,l-e),t[1],e,t[3]],t=[f.ROf(r),t[1],f.ROf(t)-f.ROf(r),t[3]],r=!s.getHasButtons()||this.oI.showExpand()<0?null:g.C2R(g.R2C(r),e,e)):(t[0]+=l,t[2]-=l)),(i=this.showCheck()&&s.getCrSize())&&(o=[t[0],t[1],i,t[3]],t=[f.ROf(o),t[1],f.ROf(t)-f.ROf(o),t[3]],o=g.C2R(g.R2C(o),i,i)),n=f.Tree.sCnt.call(this,t,s.gCtx()),r&&(n.rtExpand=r),o&&(n.rtCheck=o),n},E.prototype.p2HT=function(t,e){var i=g.X(t),o=g.Y(t),r=this.gCnt(e);for(var n in r)if(f.PInR(i,o,r[n]))return n.replace("rt","").toLowerCase()},E.prototype.autoWidth=function(){var t=this.dTV(),e=this.getPad()[0],i=t.gCtx(),o=f.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},E.prototype.drawC=function(t,e){function i(){var i,l,c,p=this.isEnabled(),d=n.getCellShape(p),C=this.getShape(p),y=this.gCnt(e);d&&(i=f.Tree.bSCTX(t,d,e,this)),C&&(l=f.Tree.bSCTX(t,C,e,this)),c=r.bSCTX(t,this,e),t.selClip(e),!p&&f.H.lA++,n.isTC()&&function(e){function i(t,e,i,o){k.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==c?null:t.oP||c}var c,p,d,C,y,S,v,T,m,I,O,E,b,w,x,F,V,A,R,G=o.getHasLines(),k=[];if(G&&(p=o.getIndent())&&s.isNZ()&&!s.isLocked()&&(d=o.getIndent(s))>=p){if(C=!0,y=o.getExpandGlyphSize()-8,c=o.oT.oI,v=s.oP,e=f.IRt(e.slice(),-this.getPad()[0],0),S=e.slice(),C?(S[0]+=d-(S[2]=p),e[2]=f.ROf(e)-(e[0]=f.ROf(S))):(S[0]=f.ROf(S)-d,S[2]=p,e[2]-=d),T=g.R2C(S),m=T[0],I=T[1],O=o.getLinesAtRoot(),E=-1==O,b=0==O,w=1==O,x=2==O,F=3==O||4==O,V=5==O,A=F||V,R=function(){return o.getHasButtons()&&s.hasChild()&&(v||O&&!v)&&this.showExpand()}.call(this)&&o.getExpandGlyphSize(),v||O){if(!A&&!x&&s.isExpanded()&&s.hasNZ()){var L,B,P,U=p;x&&(U=0),B=m+U,L=this.gCnt(e),P=f.BOf(L.rtCheck||L.rtImage||L.rtCaption||e),C||(B=m-U),n(h(P,I+y),f.BOf(S),B)}if((v||!o.getHasButtons()||!v&&E)&&(!x||x&&!R&&s.hasNZ()&&s.isExpanded())){V&&o.isIndent(s)&&(C?m-=p:m+=p);var H=I,D=m,W=h(m,f.ROf(S)-2);C||(D=a(m,f.LOf(S)+2),W=m);var z=!0;if(A&&(z=!1,v)){var M=v.gfNZ(),N=v.glNZ();if(z=M!=N){var X=f.TOf(S),Z=f.BOf(S);V||4==O?(z=M==s)?X=I:(z=N==s)&&(Z=I):M==s?X=I:N==s&&(Z=I),z&&(D=m,W=h(m,m+p/2-2),C||(D=a(m,m-p/2+2),W=m)),n(X,Z,m)}}z&&r(D,W,H)}if(!A)if(v)switch(O){case 0:Y=v.gpNZ(s);n((K=v.gnNZ(s))?f.BOf(S):I,(v.oP||v.gfNZ()!=s)&&(v.isNZ()||Y)?f.TOf(S):I,m);break;case 2:s.hasNZ()&&s.isExpanded()&&n(I,f.BOf(S),m);break;default:Y=v.gpNZ(s);n((K=v.gnNZ(s))?f.BOf(S):I,Y||v.isNZ()?f.TOf(S):I,m)}else if(!x||x&&s.hasNZ()&&s.isExpanded()){var K=c.gnNZ(s),Y=c.gpNZ(s)&&E;w&&(K=s.isExpanded()&&s.hasChild()),(K||Y)&&n(K&&Y?f.TOf(S):K?f.BOf(S):f.TOf(S),K&&Y?f.BOf(S):I,m)}}for(var j=s;v=l(j);){switch(C?(f.ORt(S,-p,0),m-=p):(f.ORt(S,p,0),m+=p),O){case 2:var q,Q=v.gnNZ(j);(!Q||Q&&l(Q)==v)&&(Z=f.BOf(S),v.isNZ()&&((q=!Q&&s==v.glNZ())&&(Z=I,C?r(m,m+p/2,Z):r(m-p/2,m,Z)),(q||Q)&&n(f.TOf(S),Z,m)));break;case 3:case 4:case 5:($=v.oP)&&v.isNZ()&&$.gnNZ(v)&&n(f.TOf(S),f.BOf(S),m);break;default:var J,_,$=l(v);$&&($.gnNZ(v)||w)&&((J=!l($))?(_=!b)&&(w?_=v.isNZ():v.isNZ()||(_=$.gpNZ(v))):_=w?$.gnNZ(v)&&v.isNZ():v.isNZ()||$.isNZ(),_&&(w&&J&&v.glNZ()==s&&(C?r(m,m+p/2,f.BOf(S)):r(m-p/2,m,f.BOf(S))),n(f.TOf(S),f.BOf(S),m)))}j=v}!function(e,i){function o(t,e){return Math.abs(t[0]-e[0])<.5&&Math.abs(t[1]-e[1])<.5}function r(t,e){if(t){if(o(t,e.f))return e.t;if(o(t,e.t))return e.f}}var n=e.length;if(n){t.save(),i(t),t.beginPath();for(var s,l,h,a=0;a=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())},E.prototype.getState=E.prototype.s=function(){return~~this.GetState()},E.prototype.GetHasCheck=function(){return this.o().hasCheck},E.prototype.SetHasCheck=function(t){this.bU(),this.o().hasCheck=t,this.eU()},E.prototype.showCheck=function(){var t=this.GetHasCheck();return(t=c(t)?this.oC.showCellCheck():t)&&this.oI.isLocked()&&(t=0),t},E.prototype.ToggleCheck=function(){this.SetState(this.getState()?0:1)},E.prototype.showExpand=function(){return this.oI.showExpand()&&(this.oC.isTC()||this.oC.oC.oTC&&this.oI.getDivider()&&this.oI.isGI()>=0)},E.prototype.GetFormat=function(){return this.o().format},E.prototype.SetFormat=function(t){this.bU(),this.oExF=void 0,this.o().format=t,this.eU()},E.prototype.getFormat=function(){if(void 0===this.oExF){this.oExF=null;var t=n(this.GetFormat());t&&((this.oExF=f.Tree.CellF.Create(t)).IsValid()||(this.oExF=null))}return this.oExF},E.prototype.toFormat=function(t,e){if(t<0)return this.v();if(ti[2]||~~o.height>i[3]},this))&&{t:r?o:e,rtT:f.ORt(t.o2rt(this,"client",function(t){return this.gCnt(t).rtCaption},this),-3,-3)}||null},b.prototype.doL=function(t){var e=t.oT;this.rgVI=new f.M1,((V?0:V=1+f.Tick()%3321)||function(){var t="pmgi",e=f[t+="rwi"].call(f);return!(f.iL()&&(!e||!e.k))}()&&(V+=V>>2)%4)&&(this.add=function(){return this.rgVI.len()<16+(V+=V>>2)%48&&b.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)},b.prototype.add=function(t,e,i){return this.rgVI.push(t,{y:e,h:i}),i},b.prototype.scroll=function(t,e){var i=new f.M1,o=this.rgVI,r=o.len();if(r&&!f.EyR(t)){for(var n=g.X(e),s=g.Y(e),l=t[0]+n,h=t[2],a=0,u=r-1,c=f.TOf(t),p=f.BOf(t);a+1=0){for(var r=0,n=o;r+1=h.y&&t<=h.y+h.h&&(e=l)}return e},b.prototype.y2Is=function(t,e){var i=[];if(this.rgVI.len()){var o=a(t,e),r=h(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]=f.BOf(e)-r,e[3]=r):(e[1]+=o,e[3]=h(0,e[3]-(o+r)))}return e},x.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]=f.BOf(e)-n,e[3]=n):(e[1]+=r,e[3]=h(0,e[3]-(r+n)))}return e},x.prototype.GetPageSize=function(){var t=this.GetClientRect();return t&&[this.scaled(t[2]),this.scaled(t[3])]||[0,0]},x.prototype.GetScrollRect=function(){var t=this.origin(),e=this.GetPageSize();return[-t[0],-t[1],e[0],e[1]]},x.prototype.GetCanvasRect=function(){var t=this.GetClientRect(),e=this.GetCanvas();return e&&(t=[0,0,e.width,e.height]),t},x.prototype.GetVisibleRect=function(){return f.NRt(this.GetClientRect(),this.GetCanvasRect())},x.prototype.GetViewRect=function(t){return f.EArtC((t||this.gCW()).GetCanvas())},x.prototype.c2V=function(t,e){var i=this.GetViewRect();return c(e)&&(e=g.Y(t),t=g.X(t)),{x:t+i[0],y:e+i[1]}},x.prototype.v2C=function(t,e){var i=this.GetViewRect();return c(e)&&(e=g.Y(t),t=g.X(t)),{x:t-i[0],y:e-i[1]}},x.prototype.c2Vrt=function(t){var e=this.c2V(t);return[e.x,e.y,t[2],t[3]]},x.prototype.v2Crt=function(t){var e=this.v2C(t);return[e.x,e.y,t[2],t[3]]},x.prototype.onpaint=function(t){this.lI||(!this.sRng()&&this.updSPR(),f.SB.prototype.onpaint.call(this,t))},x.prototype.isClkAble=function(){return this.isSelectable()&&!this.isReadOnly()},x.prototype.htAO=function(t,e){function i(t){var i=e.get(t);i&&(o=o||new f.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},x.prototype.e2W=function(t){return this.gCW().e2W(t)},x.prototype.e2V=function(t){return(this.e2W(t)||{}).oC||null},x.prototype.wCH=function(){return this._wCH||(this._wCH=[this.oHB,this.oSB,this.oCFB])},x.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()})},x.prototype.xA=function(){f.A.Cancel("ss*"),f.A.Cancel(this.sEvcA)},x.prototype.ondown=function(t){return this.isSelectable()&&(this.xA(),this.gAA().Do(this,t),!f.RUR.Rng()&&this.doRUR(t,function(t){switch(t.drag.status){case 4:case 5:this.rurActionClick(null,t)}},this)),!0},x.toClick=function(t){return{dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:f.e2B(t),modifiers:f.ModK(t)}},x.prototype.toClick=function(t,e){e.cell=this.e2ICl(t),e.item=e.cell&&e.cell.oI||null},x.prototype.onA=function(t,e){t&&(f.H.VisitA(this,t),this.inv(),this.onanchorclick(t))},x.prototype.onClick=function(t){var e=x.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)},x.prototype.onclick=function(t){this.oLts.onclick.do(t)},x.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},x.prototype.onDblClk=function(t){var e=this.rurI(t);if(e&&this.getExpandOnDblClick())return this.onClickIE(e),e.hasChild()},x.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:g.X(e)-o[0],y:g.Y(e)-o[1],r:i.GetClientRect()}},x.prototype.doRUR=function(t,e,i,o){var r,n,s=this.gAA(),l=this.oT.lRA.bind(this.oT);return f.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(f.GP.Get("long",this.getCursors()));break;case 3:s.CanDo(t,1)&&(f.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)},x.prototype.bRUR=function(t){return this.gAA().Has("zoom")&&this.exZ(t),t.drag.extra},x.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))},x.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);h(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)}},x.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)},x.prototype.rurScrollD=function(t,e,i){var o,r=u(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)})},x.prototype.rurDrag=function(t,e){function i(t){return!e||c(e.rurAllow)||t==(e.rurAllow&t)}function o(){a.frame=g.Rect(a.from,a.to),e&&e.rurDrag&&e.rurDrag.call(S,a),a.frame=function(t,e){return r().rtCA(t,e)}(a.frame,!1),d.onRurDragD&&d.onRurDragD.call(d,e,a),e&&e.rurDragD&&e.rurDragD(a),u&&u.SetClient(a.frame)}function r(){return s||(s=function(){var t=p;return u&&u.oO.relative!=p.GetCanvas()&&(t=d),t}())}function n(t,e){return r().ptCA(t,e)}if(t){var s,l,a,u,p=this,d=this.e2V(t)||p,C=d.getRurDragScrollOut?d.getRurDragScrollOut():d.GetClientRect(),y=[{oTV:this,oH:this.GetSI(!0),oV:this.GetSI(!1)}],S=this,v=0,T=0;this.oT.feTV(function(t){t!=this&&y.push({oTV:t,oH:t.GetSI(!0),oV:t.GetSI(!1)})},this),this.doRUR(t,function(t){switch((a=a||function(t){s=null;var e=n(p.gPtr(t));return{from:e,to:e,event:t,frame:g.Rect(e,e)}}(t)).event=t,t.drag.status){case 1:(function(){d.onRurDragS&&(e=d.onRurDragS.call(d,e,a)),e&&e.rurDragS&&e.rurDragS(a)}).call(this),S=e&&e.thisArg||S,e&&(this.onRURDragStart(e.rurName,t),e.rurDragStart&&e.rurDragStart.call(S,a));if((m=this.oT.oRUR)&&(m.ao=e&&e.rurOnlyAO),this.rAO(),e&&e.rurEFPaint){o();var r={name:"frame",client:a.frame,relative:p.GetCanvas(),clip:p.GetCanvas(),inflateClient:8,onpaint:function(t,i){e.rurEFPaint.call(S,a,t,i,this)}};e.rurEFOpts&&e.rurEFOpts.call(S,a,r),u=f.EF.Create(r)}break;case 7:var c=t.drag.cancel?this.oT:this,m=this.oT.oRUR;clearTimeout(l),m&&(m.ao=null),c.bU(),t.drag.cancel?(m&&(m.cancel=!0),this.Smooth(function(){y.forEach(function(t){t.oTV.rurScrollD(0,0,t)}),e&&e.rurCancel&&e.rurCancel.call(S,a)})):!t.drag.click&&e&&e.rurDrop&&e.rurDrop.call(S,a),!this.sRng()&&c.onRL(),this.rAO(),c.eU(),f.EF.Destroy(u),e&&(e.rurDragEnd&&e.rurDragEnd.call(S,a),t.drag.click&&e.rurStatus&&e.rurStatus.call(S,t),this.onRURDragEnd(e.rurName,t)),function(){d.onRurDragE&&d.onRurDragE.call(d,e,a),e&&e.rurDragE&&e.rurDragE(a)}.call(this);break;case 2:var I=!1,O=v!=t.drag.offset.dx||T!=t.drag.offset.dy;if(O&&(v=t.drag.offset.dx,T=t.drag.offset.dy),!f.EyR(C)&&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-f.LOf(C)||0;w>0&&(w=h(0,E-f.ROf(C)));var x=i(2)&&b-f.TOf(C)||0;x>0&&(x=h(0,b-f.BOf(C))),(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)&&(a.to=n(t.drag.current),a.dx=a.to.x-a.from.x,a.dy=a.to.y-a.from.y,o())}},this,{contiguously:!0,client:C})}},x.prototype.onRURDragStart=function(t,e){},x.prototype.onRURDragEnd=function(t,e){},x.prototype.onChange=function(t,e){this.onchange({object:e,action:t})},x.prototype.onchange=function(t){this.oLts.onchange.do(t)},x.prototype.rtSelAbs=function(t){var e=g.Rect(t.from,t.to);if(!f.EyR(e)){var i=this.getLIV(),o=this.ar2I(e);o&&o.length&&o.forEach(function(t){e=f.URt(e,i.i2R(t))})}return e},x.prototype.rurAO=function(t){return this.rurI(t)||this.rurC(t)||{}},x.prototype.rurI=function(t){return this.e2I(t)},x.prototype.rurC=function(t){return this.fewCHU(function(e){return e.e2C(t)})},x.prototype.allowRur=function(t,e){var i=u(t);if(i)switch(e.rurName){case"scroll":i=function(t){return f.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},x.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"+f.getP(function(t){for(var e,i="",o=0,r=t.length;oy})):c.forEach(function(t){T(t)&&v.add(m.call(t.rgC[o]))}),(i.s||a&(s.exSortItemsAsc|s.exSortItemsDesc))&&v.sort(t.cmp(i.s||(a&s.exSortItemsAsc?1:2)).c),u(y)&&v.len()>y&&(v.remove(v.last()),v.add(f.Tree.Filter.truncLimit)),e.v=v.byO()}return e}function T(t,e,o,r){return(r=r||i).cbkF?r.cbkF.call(t,e,o):t.ChangeFilter(e,o)}function m(){var e=y(O),o=this.gCW(),s=this.getFont(),l=t.o.gCW().canvas,h=function(){var e=t.rtC.slice();return t.o instanceof x.Header&&t.o.isHeader()&&f.ORt(e,-this.unscaled(this.GetScroll().x-E.x),0),e}.call(this);f.ORt(h,0,h[3]),f.EF.Create({name:"filter.column-edit",class:"exontype "+f.Def.CN.ppEF,client:h,relative:l,tag:"input",inner:{value:n(e),placeholder:f.Tree.Filter.description.filterFor,title:function(){var t=f.Tree.Filter.description.titleAny;switch(15&O.getFilterType()){case f.Tree.FilterTypeEnum.exPattern:t=f.Tree.Filter.description.titlePattern;break;case f.Tree.FilterTypeEnum.exDate:t=f.Tree.Filter.description.titleDate;break;case f.Tree.FilterTypeEnum.exNumeric:t=f.Tree.Filter.description.titleNumeric}return t}.call(this),style:{font:r(s,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":T(O,void 0,u(e)?e:null);break;case"change":T(O,void 0,t.value||null)}},thisArg:this})}function I(){function e(t,e,i){function r(t,e){t&&(l&&(l+=","),u(e)&&(h?t+="[chk="+e+"][show=-1]":e&&(t+="[shapes=shitem.checked(item)]")),l+=t)}var l="",c=x.cbkEsc(),p=f.Tree.Filter.bold.split(","),g=f.Tree.Filter.exclude;if(g&&u(t.e)&&r(c(g)+"[chk="+(t.e?1:0)+"][id=exclude]"),t.b.length&&l&&r("[sep]"),t.b.forEach(function(t){r(""+c(p[t])+"[id="+t+"]")}),t.v.length&&l&&r("[sep]"),s()==f.Tree.FilterTypeEnum.exImage){var d=function(){var t=0,e=O.getImageSize();return u(e)&&(f.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+":"+d+"[id="+(n+10)+"]",s),s&&(t.i=n+10)})}else{var C=function(){var e="";if(u(f.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=~~O.getWidth(),n=f.TFI.bCTX(o,this.getTfi()),s=f.H.Measure(o,i.t)||{width:0,height:o.fontHeight()};f.TFI.eCTX(o,n),s.width>r&&(e="[cw="+~~a(8+s.width,f.Tree.Filter.maxWidth)+"]")}}return e}.call(this);t.v.forEach(function(o,s){var l;e&&(l=e.has(i?o:o.toLocaleLowerCase())?1:0),r(c(n(o)||" ")+C+"[id="+(s+10)+"]",l),l&&(t.i=s+10)})}return l}var r=t.o.gCW(),l=v.call(this,O),h=O.getFilterList()&f.Tree.FilterListEnum.exShowCheckBox,p=function(t){var e=null;if(u(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[u],i=[h[0],i[1],h[2],i[3]])}}if(r instanceof f.Tree.Cell){var c=r.p2HT([s,l],i);this.isReadOnly()&&"expand"!=c||(e={c:r,ht:c,rtC:this.rtHTl(i)})}}return e},x.prototype.r2I=function(t){return this.ar2I(this.rtCA(t))},x.prototype.ar2I=function(t){var e=!0;if(this.clip2VC()&&this.getCVO){var i=this.getCVO(),o=this.GetScroll();e=f.NRt(f.URt(i.lock.union(),f.ORt(i.unlock.union(),o.x,o.y)),t)}return e&&this.getLIV().y2Is(f.TOf(t),f.BOf(t))||[]},x.prototype.rurOnlyAO=function(){var t=this.oT.oRUR;return t&&t.w==this.oW&&t.ao||null},x.prototype.onSetAO=function(t){function e(e){if(e.isSelectable()){var i=o.toShapes(e);i&&(!f.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}),!f.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 f.Tree.Item?e(r):(i.forEach(function(t,i){e(i)}),this.onExtAO(t,i))}},x.prototype.onExtAO=function(t,e){},x.prototype.onRL=function(){this.oFB.isVisible()&&this.resFB(),this.resVI()},x.prototype.resVI=function(){this.rgVI=null,this.rgVIT=null,this.rgVIB=null,this.resAO()},x.prototype.resLCV=function(){this.oLCV=null,this.oHB.resHVO(),this.resCVO(),this.resVI()},x.prototype.getLCV=function(){return this.oLCV||(this.oLCV=new f.Tree.LCV(this))},x.prototype.resCVO=function(){this.oCVO=null},x.prototype.getCVO=function(){return this.oCVO||(this.oCVO=this.getLCV().getCVO(this))},x.prototype.bU=function(){this.lI++},x.prototype.eU=function(){--this.lI||this.invAO()},x.prototype.wAO=function(){return this._wAO||(this._wAO=[this.oHB,this.oSB,this.oFB,this.oCFB])},x.prototype.rAO=function(){this.bU();var t=this.wAO();t&&t.forEach(function(t){t&&t.isVisible()&&t.invAO()}),this.eU()},x.prototype.onimg=function(){return this.cwbU(),this.onRL(),this.cweU(),!0},x.prototype.islow=function(){return this.getScale()<.5},x.prototype.Smooth=function(t,e,o){function r(t,e,i){if(e instanceof f.Tree.Item){var o=(i?c.getLIV():y.get(c).oLIV).i2R(e,c.origin(),c);if(o){var r,n,s,l=f.TOf(o),h=o[3],a=C[1];return l+h<0||l>a||((n=(r=c.getLIV().rgVI).get(e))&&(s=r.get(this.first()))&&n.y=0&&f.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()]},x.prototype.origin=function(t){return t=t||this.GetScroll(),[-t.x,-t.y]},x.prototype.ptCA=function(t,e){var i={x:g.X(t),y:g.Y(t)},o=this.GetScroll(),r=this.GetClientRect();return c(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},x.prototype.rtCA=function(t,e){return g.Rect(this.ptCA(g.R2C(t,17),e),this.ptCA(g.R2C(t,68),e))},x.prototype.isExtSBS=function(){var t=this.gCW();return t&&12288==(12288&t.gSBs())},x.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())}},x.prototype.getScale=function(){return c(this.scale)&&(this.scale=this.getZoom()/100),this.scale},x.prototype.scaled=function(t){return t/this.getScale()},x.prototype.unscaled=function(t){return t*this.getScale()},x.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])},x.prototype.onZoom=function(){this.scale=null,this.oT.resLCV(),this.updSPR(),this.oT.onZoom()},x.prototype.GetZoom=function(){return this.oO.zoom},x.prototype.SetZoom=function(t){this.cwbU(),this.oO.zoom=t,this.onZoom(),this.cweU()},x.prototype.getZoom=function(){var t=this.GetZoom(),e=this.getZoomLevels();return c(t)&&(t=100),h(e[0],a(e[e.length-1],t))},x.prototype.GetZoomLevels=function(){return this.oO.zoomLevels},x.prototype.SetZoomLevels=function(t){this.cwbU(),this.oO.zoomLevels=t,this.onZoom(),this.cweU()},x.prototype.getZoomLevels=function(){var t=[100],e=new f.Arr;return n(this.GetZoomLevels(),"50,65,75,80,90,100,110,125,150,175,200,250,300,400,500").split(",").forEach(function(t){e.push(h(10,a(1e3,s(t,100))))}),e.isEmpty()||(t=e.byO()).sort(function(t,e){return t-e}),t},x.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-g.X(e.pt)-o,i.y-g.Y(e.pt)-r),this.onRurScrollD({dx:-o,dy:-r}),this.cweU()},x.prototype.cbkEFPaint=function(t){var e=this.toShapes(t);return e&&function(t,i,o,r){i.drawShape(o,e.normal||e)}},x.prototype.fitEFPaint=function(){return this.cbkEFPaint("frameFit")},x.prototype.selEFPaint=function(){return this.cbkEFPaint("frameSel")},x.prototype.rurFit=function(t,e){e.rurOnlyAO={},e.rurEFPaint=this.fitEFPaint(),e.rurDrop=function(t){this.FitToClient(this.rtSelAbs(t))},this.rurDrag(t,e)},x.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(g.Rect(t.from,t.to)),{selChange:!1})&&((this.isToggleSel()||this.isToggleCtrlSel()&&2&f.ModK(t.event))&&(this.oT.rgSel=new f.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)}}},x.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 f.Arr(e);this.cwbU(),u.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,u,c,p,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){u&&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,c.len())},e.rurDrag=function(t){if(t.from!=t.to){if(!u&&function(){u=this.getMoveI(s,!0),c=this.oI.dscn(u),(T=function(){var t=w;if(t&&(t=c.len()1)switch(w){case 1:for(var e=u[0].oP,i=1,o=u.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=[]))&&(p=function(){var t=new f.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,a,u=i-1,p=i+1,g=e.len(),d=!0;d;u--,p++)d=!1,u>=0&&(h=e.at(u))&&c.has(h)&&o+h.getHeight()1)for(var e=this.getLIV().rgVI,i=c.first();i&&!t;i=c.next(i))t=!p.has(i)&&e.has(i);return t}.call(this),C=this.isItemAlt(p.first())?1:0,d=f.URt(this.getLIV().i2R(p.first(),0,this),this.getLIV().i2R(p.last(),0,this)),y=function(){var t=s.getLevel();return p.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 f.Tree.LHIV(this,c,{i:s,h:d[3]})},this.getIndent=function(t){var e=E.call(this,t);return c.has(t)&&(e=E.call(this)*(t.getLevel()-y+S)),e},this.oT.onRL()}),m&&(m.oTV=this,m.oDI={i:p,g:v,a:C},u&&this.rurItemDragS(m))}.call(this),x=T){m&&!m.GetVisible()&&m.SetVisible(!0),t.frame=f.ORt(d.slice(),I.x,t.to.y-t.from.y),t.frame[1]<0&&f.ORt(t.frame,0,-t.frame[1]);var e=this.rtCA(t.frame,!1),i=g.X(t.event.drag.current),O=o.call(this,[i,f.TOf(e)]),F=o.call(this,[i,f.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=h(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(f.GP.Get(x?"item-drag":"no",this.getCursors()))}},this.rurDrag(t,e)}},x.prototype.rurItemDragS=function(t){t.rgTVEF||(this.oT.feTV(function(e){if(e!=this){var i=f.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();f.ORt(e,-o[0]+r[0],-o[1]+r[1]),e[2]=r[2],t.SetClient(e)})}}(t.SetClient)))},x.prototype.rurItemDragE=function(t){t&&t.rgTVEF&&(t.rgTVEF.forEach(function(t){f.EF.Destroy(t)}),t.rgTVEF=null)},x.prototype.rurItemDragD=function(t){this.oT.feTV("resVI")},x.prototype.rurItemResize=function(t,e){function i(t){return u(S)&&(t=a(S,t)),u(y)&&(t=h(y,t)),t}function o(t){this.SetScroll({y:f.BOf(this.getLIV().i2R(n))-f.BOf(T)+m.y-this.scaled(h(0,t))})}function r(t){this.cwbU(),l&&l.forEach(function(e,o){c(e)&&l.set(o,e=o.getHeight(d)),o.SetHeight(i(e+t))}),o.call(this,t),this.cweU()}if(t){var n=(this.e2IR(t)||{}).i;if(n){var l,p=!1,g=e.rurFlags,d=this.getDefaultItemHeight(),C=this.oI.rurIH()||[null,null],y=C[0],S=C[1],v=r,T=this.getLIV().i2R(n),m=this.GetScroll();g&&g.has("all")?(y=h(s(y),8),v=function(t){this.cwbU(),this.SetDefaultItemHeight(i(d+t)),!l&&this.oI.forEach(function(t){t.getAllowSizing()&&t.getHeight(d)!=d&&(l=l||new Map).set(t,t.GetHeight())}),l&&r.call(this,t),o.call(this,t),this.cweU()}):((l=new Map).set(n,n.GetHeight()),this.isSelected(n)&&this.getSel().forEach(function(t){t.getAllowSizing()&&l.set(t,t.GetHeight())}),l.size>128&&(y=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(),p&&this.onChange("resize-item",n);break;case 2:p=!0,v.call(this,t.drag.offset.dy);break;case 0:p=!1,v.call(this,0);break;case 6:var i=this.getDefaultItemHeight()-d,o=t.drag.swipe.dy;if(l){var r=l.get(n);c(r)&&(r=d),i=n.getHeight()-r}o&&f.A.Progress(function(t){v.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)}}},x.prototype.rurColumnResize=function(t,e){function i(t){t=function(t){return u(c)&&(t=a(c,t)),u(l)&&(t=h(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,c=null;if(this.oT.oTV.isCAR()&&o instanceof f.Tree.Column){var p=0,g=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)):g-=this.unscaled(e)},this),n=h(0,p/g)}else s.set(o,o.getWidth());n&&(s.forEach(function(t,e){e==o?l=-t:c+=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&&f.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))}}},x.rurColEF=function(){return f.EF.Item("drop")},x.rurSrc=function(){var t=x.rurColEF();return t&&t.oO.rurSrc||null},x.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=f.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(),f.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(f.GP.Get("column-drag",this.getCursors())),!o&&e&&this.oCFB.isVisible()&&(o=!0,this.oCFB.oW.onHovI()),t.frame=f.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)}},x.prototype.rurCol=function(t){return t&&t.c&&t.c.getAllowDrag()},x.prototype.rurColDraw=function(t,e,i){t&&t.h&&t.h.drawCH(e,i,t.c)},x.prototype.onColDrop=function(t,e,i){this.rurColDrop(t,e,i),this.onChange("drag-column",e.c)},x.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),u(i.p)&&n.setPos(i.c,i.p),--n.lC,n.onChange();break;case"unsort":n.sort(i.c,0),u(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)}})},x.prototype.rurDragDrop=function(t,e){var i,o,r,n=e.rurOnlyW==this.oW&&this.p2I(this.gPtr(t));n&&this.isSable(n)&&f.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 f.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(f.GP.Get(e.rurName,this.getCursors()))}})},x.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=u(t),r=u(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))&&(f.A.Cancel("soom"),f.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"}))}},x.prototype.Home=function(){this.Soom(100,[0,0])},x.prototype.FitToClient=function(t){function e(t){return{x:t[0],y:t[1]}}var i=c(t);if(t=t||this.getLIV().rtLayout,c(t))this.Home();else if(!f.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},x.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=f.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=f.BOf(e))}),r&&t(f.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){f.D.P.Rect(t,e)})}),function(e){t.beginPath(),e&&e.call(this),t.stroke()}.call(this,function(){(!n||!0===p)&&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,a,u,c=o==s.lock,p=this.getDrawGridLines(),g=this.getVI()==i?0:this.getVIT()==i?-1:1,d=g||this.clip2VC(),C=this.getDefaultItemHeight(),y=f.LOf(o.len()?o.get(o.first()):e),S=f.ROf(o.len()?o.get(o.last()):e)-y,v=f.TOf(i.len()?i.get(i.first()):e),T=d&&!i.len()?0:f.BOf(i.len()?i.get(i.last()):e)-v,m=function(){var t=new f.M1;return o.forEach(function(e,i){var o=i.GetIndex();o>=0&&t.set(o,e)}),t}();n&&((a=o.union())&&(y=f.LOf(a),S=S&&f.WOf(a)||0),(u=i.union())&&(v=f.TOf(u),T=T&&f.HOf(u)||0)),h=function(){var i=null,o=this.luShape(c);if(o){var r=s.clip||e;c&&((r=e.slice())[2]=S),i=f.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),p&&(!d&&function(){var r=i.last(),n=i.get(r),s=n&&f.BOf(n)||f.TOf(e),l=f.BOf(e);s0){var r,n=this.toShapes(f.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=f.BOf(e),(e=e.slice())[3]=o;e[1]1){var r,n,s=this.toShape("multiSel");s&&(i=f.Format(i,0),r=t.sizeHTMLText(i),n=g.C2R(g.R2C(e,o),r.width+8,r.height+8,o),t.drawShape(n,s,{text:i}))}},x.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()},x.prototype.isDef=function(){return this==this.oT.oTV},x.prototype.GetTfi=function(){return this.oO.tfi},x.prototype.SetTfi=function(t){this.cwbU(),this.oO.tfi=t||null,this.nFH=0,this.onRL(),this.cweU()},x.prototype.getTfi=function(){return this.opt("tfi")},x.prototype.getFH=function(){return this.nFH||(this.nFH=function(){return this.ctxTfi(function(t){return t.fontHeight()})}.call(this))},x.prototype.ctxTfi=function(t,e,i){var o,r;return(i=i||this.gCtx())&&(o=f.TFI.bCTX(i,this.getTfi()),r=t.call(e||this,i),f.TFI.eCTX(i,o)),r},x.prototype.getFont=function(){return this.ctxTfi(function(t){return f.GetFont(t)})},x.prototype.GetLocked=function(){return this.oO.locked},x.prototype.SetLocked=function(t){this.cwbU(),this.oO.locked=t,this.onRL(),this.cweU()},x.prototype.getLocked=function(){return this.opt("locked",!1)},x.prototype.GetReadOnly=function(){return this.oO.readOnly},x.prototype.SetReadOnly=function(t){this.cwbU(),this.oAA=null,this.oO.readOnly=t,this.onRL(),this.cweU()},x.prototype.isReadOnly=function(){return this.opt("readOnly",!1)},x.prototype.GetWheelChange=function(){return this.oO.wheelChange},x.prototype.SetWheelChange=function(t){this.cwbU(),this.oO.wheelChange=t,this.onRL(),this.cweU()},x.prototype.getWheelChange=function(){return this.opt("wheelChange",18)},x.prototype.GetSmooth=function(){return this.oO.smooth},x.prototype.SetSmooth=function(t){this.oO.smooth=t,!this.lI&&this.rAO()},x.prototype.getSmooth=function(){return this.islow()?0:h(0,s(this.opt("smooth",125)))},x.prototype.GetMargins=function(){return this.oO.margins},x.prototype.SetMargins=function(t){this.cwbU(),this.oM=null,this.oO.margins=t||null,this.onRL(),this.cweU()},x.prototype.getMargins=function(){if(c(this.oM)){var t=this.opt("margins",null);f.IsO(t)||(t={}),this.oM=f.Inh(t,f.Def.Tree.margins||{indent:16})}return this.oM},x.prototype.GetHasLines=function(){return this.oO.hasLines},x.prototype.SetHasLines=function(t){this.cwbU(),this.oO.hasLines=t,this.ohL=void 0,this.cweU()},x.prototype.getHasLines=function(){return void 0===this.ohL&&(this.ohL=function(){var t=this.GetHasLines();return f.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},x.prototype.GetHasButtons=function(){return this.oO.hasButtons},x.prototype.SetHasButtons=function(t){this.cwbU(),this.oO.hasButtons=t,this.cweU()},x.prototype.getHasButtons=function(){return this.opt("hasButtons",!0)},x.prototype.GetLinesAtRoot=function(){return this.oO.linesAtRoot},x.prototype.SetLinesAtRoot=function(t){this.cwbU(),this.oO.linesAtRoot=t,this.cweU()},x.prototype.getLinesAtRoot=function(){return p(this.opt("linesAtRoot"),f.Tree.LinesAtRootEnum,0)},x.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},x.prototype.gbL=function(){return(this.getHasLines()||this.getHasButtons())&&this.getLinesAtRoot()?1:0},x.prototype.getIndent=function(t){var e,i=h(0,s(this.getMargins().indent,16));return t&&(e=t.getLevel()+this.gbL(),this.isIndent(t)||(e=h(0,e-1)),i*=e),i},x.prototype.GetExpandGlyphSize=function(){return this.oO.expandGlyphSize},x.prototype.SetExpandGlyphSize=function(t){this.cwbU(),this.oO.expandGlyphSize=t,this.onRL(),this.cweU()},x.prototype.getExpandGlyphSize=function(){return h(0,s(this.opt("expandGlyphSize",16)))},x.prototype.GetCrSize=function(){return this.oO.crSize},x.prototype.SetCrSize=function(t){this.cwbU(),this.oO.crSize=t,this.oCFB.resHVO(),this.cweU()},x.prototype.getCrSize=function(){return h(0,s(this.opt("crSize",16)))},x.prototype.GetHeaderHeight=function(){return this.oO.headerHeight},x.prototype.SetHeaderHeight=function(t){this.cwbU(),this.oO.headerHeight=t,this.oT.resLCV(),this.onRL(),this.cweU()},x.prototype.getHeaderHeight=function(){return h(0,s(this.opt("headerHeight",24)))},x.prototype.GetHeaderVisible=function(){return this.oO.headerVisible},x.prototype.SetHeaderVisible=function(t){this.cwbU(),this.oO.headerVisible=t,this.oT.resLCV(),this.onRL(),this.cweU()},x.prototype.showHB=function(){return p(this.opt("headerVisible"),f.Tree.HeaderVisibleEnum,f.Tree.HeaderVisibleEnum.exHeaderVisible)},x.prototype.GetHeaderEnabled=function(){return this.oO.headerEnabled},x.prototype.SetHeaderEnabled=function(t){this.cwbU(),this.oO.headerEnabled=t,this.cweU()},x.prototype.getHeaderEnabled=function(){return this.opt("headerEnabled",!0)},x.prototype.getAllowChangeParent=function(){return!0},x.prototype.GetShapes=function(){return this.oO.shapes},x.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()},x.prototype.defShp=function(){return"Button(column,sortBar-caption,filterBar-close),Expand(expand),FrameFit(frameFit),FrameSel(select,frameSel),CheckBox(check),Radio(radio)"},x.prototype.getShapes=function(){var t=this.sShs;return c(t)&&(c(t=this.GetShapes())&&(t=f.Def.Tree.shapes),t=n(t,this.defShp()),this.sShs=t),t},x.prototype.toShapes=function(t){return t&&f.S.GetOf(t.GetShape&&t.GetShape()||x.typeOf(t),this.getShapes(),"Tree")||null},x.prototype.toShape=function(t,e){var i=this.toShapes(t),o=i&&i.normal||i;return o&&e&&i&&i.disabled&&(o=f.Inh(i.disabled,o)),o},x.prototype.luShape=function(t){return this.toShape(t?"lock":"unlock")},x.prototype.isItemAlt=function(t){var e=this.getLIV().rgVI.indexOf(t);return e>=0&&e%2},x.prototype.iaShape=function(t){var e=this.toShapes(t);return c(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},x.prototype.GetCursors=function(){return this.oO.cursors},x.prototype.SetCursors=function(t){this.cwbU(),this.sCrs=null,this.oO.cursors=t,this.onRL(),this.cweU()},x.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)"},x.prototype.getCursors=function(){var t=this.sCrs;return c(t)&&(c(t=this.GetCursors())&&(t=f.Def.Tree.cursors),t=n(t,this.defCrs()),this.sCrs=t),t},x.prototype.GetFormatText=function(){return this.oO.formatText},x.prototype.SetFormatText=function(t){this.cwbU(),this.nFT=null,this.oO.formatText=t,this.onRL(),this.cweU()},x.prototype.getFormatText=function(){return c(this.nFT)&&(this.nFT=p(this.opt("formatText"),f.DrawTextFormatEnum,f.DrawTextFormatEnum.exTextAlignLeft|f.DrawTextFormatEnum.exTextAlignVCenter|f.DrawTextFormatEnum.exTextWordBreak|f.DrawTextFormatEnum.exTextWordEllipsis)),this.nFT},x.prototype.GetPad=function(){return this.oO.pad},x.prototype.SetPad=function(t){this.cwbU(),this.rgPad=null,this.oO.pad=t,this.onRL(),this.cweU()},x.prototype.getPad=function(){return c(this.rgPad)&&(this.rgPad=f.pad2A(this.opt("pad",[4,4]))),this.rgPad},x.prototype.GetImageSize=function(){return this.oO.imageSize},x.prototype.SetImageSize=function(t){this.cwbU(),this.aIS=void 0,this.oO.imageSize=t,this.onRL(),this.cweU()},x.prototype.getImageSize=function(){return void 0===this.aIS&&(this.aIS=this.opt("imageSize",18)),this.aIS},x.prototype.GetImageAlign=function(){return this.oO.imageAlign},x.prototype.SetImageAlign=function(t){this.cwbU(),this.nIA=null,this.oO.imageAlign=t,this.onRL(),this.cweU()},x.prototype.getImageAlign=function(){return c(this.nIA)&&(this.nIA=~~this.opt("imageAlign",0)),this.nIA},x.prototype.GetAllowActions=function(){return this.oO.allowActions},x.prototype.SetAllowActions=function(t){this.cwbU(),this.oAA=null,this.oO.allowActions=t,this.cweU()},x.prototype.gAA=function(){return this.oAA||(this.oAA=new f.AA(this.opt("allowActions",this.oT.defAA()),this.isReadOnly()?this.oT.roAA():"")),this.oAA},x.prototype.GetCountLockedColumns=function(){return this.oO.countLockedColumns},x.prototype.SetCountLockedColumns=function(t){this.cwbU(),this.oO.countLockedColumns=t,this.oT.resLCV(),this.onRL(),this.cweU()},x.prototype.getCountLockedColumns=function(){return h(0,~~this.opt("countLockedColumns",0))},x.prototype.GetColumnAutoResize=function(){return this.oO.columnAutoResize},x.prototype.SetColumnAutoResize=function(t){this.cwbU(),this.oO.columnAutoResize=t,this.oT.resLCV(),this.onRL(),this.cweU()},x.prototype.isCAR=function(){return!!this.opt("columnAutoResize",!1)},x.prototype.GetSortBarVisible=function(){return this.oO.sortBarVisible},x.prototype.SetSortBarVisible=function(t){this.cwbU(),this.oO.sortBarVisible=t,this.cweU()},x.prototype.showSB=function(){return!!this.opt("sortBarVisible",!1)},x.prototype.GetSortBarCaption=function(){return this.oO.sortBarCaption},x.prototype.SetSortBarCaption=function(t){this.cwbU(),this.oO.sortBarCaption=t,this.cweU()},x.prototype.getSortBarCaption=function(){return this.opt("sortBarCaption","Drag a column header here to sort by that column.")},x.prototype.GetSingleSort=function(){return this.oO.singleSort},x.prototype.SetSingleSort=function(t){this.cwbU(),this.oO.singleSort=t,this.oS.onSingleSort(),this.cweU()},x.prototype.isSingleSort=function(){return!!this.opt("singleSort",!1)},x.prototype.GetSortOnClick=function(){return this.oO.sortOnClick},x.prototype.SetSortOnClick=function(t){this.oO.sortOnClick=t},x.prototype.getSortOnClick=function(){return p(this.opt("sortOnClick"),f.Tree.SortOnClickEnum,f.Tree.SortOnClickEnum.exDefaultSort)},x.prototype.isSortOnClick=function(){return this.getSortOnClick()==f.Tree.SortOnClickEnum.exDefaultSort},x.prototype.GetAllowGroupBy=function(){return this.oO.allowGroupBy},x.prototype.SetAllowGroupBy=function(t){this.cwbU(),this.oO.allowGroupBy=t,this.oC.resLC(),this.cweU()},x.prototype.getAllowGroupBy=function(){return this.opt("allowGroupBy",!1)},x.prototype.GetGroupByFormatCell=function(){return this.oO.groupByFormatCell},x.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 f.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()},x.prototype.getGroupByFormatCell=function(){return n(this.GetGroupByFormatCell(),"(exp(``) ? `` : ``) + value + (0:=get(`count(current,rec,1)`) ? (` (` + =:0 + `)`) : ``)")},x.prototype.GetColumnsFloatBarVisible=function(){return this.oO.columnsFloatBarVisible},x.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()},x.prototype.showCFB=function(){return p(this.opt("columnsFloatBarVisible"),f.Tree.ColumnsFloatBarVisibleEnum,0)},x.prototype.GetColumnsFloatBarSortOrder=function(){return this.oO.columnsFloatBarSortOrder},x.prototype.SetColumnsFloatBarSortOrder=function(t){this.cwbU(),this.oO.columnsFloatBarSortOrder=t,this.cweU()},x.prototype.getColumnsFloatBarSortOrder=function(){return this.opt("columnsFloatBarSortOrder",0)},x.prototype.GetColumnsFloatBarCaption=function(){return this.oO.columnsFloatBarCaption},x.prototype.SetColumnsFloatBarCaption=function(t){this.cwbU(),this.oO.columnsFloatBarCaption=t,this.oCFB.resHVO(),this.cweU()},x.prototype.getColumnsFloatBarCaption=function(){return this.opt("columnsFloatBarCaption","Columns")},x.prototype.GetDrawGridLines=function(){return this.oO.drawGridLines},x.prototype.SetDrawGridLines=function(t){this.cwbU(),this.oO.drawGridLines=t,this.cweU()},x.prototype.getDrawGridLines=function(){return this.islow()?0:p(this.opt("drawGridLines"),f.Tree.GridLinesEnum,0)},x.prototype.clip2VC=function(){var t=this.getDrawGridLines();return!t||-2==t||2==t},x.prototype.GetGridLines=function(){return this.oO.gridLines},x.prototype.SetGridLines=function(t){this.cwbU(),this.oO.gridLines=f.Mrg(this.getGridLines()||{},t),this.cweU()},x.prototype.getGridLines=function(){return this.opt("gridLines",{color:"gray",style:1})},x.prototype.GetDefaultItemHeight=function(){return this.oO.defaultItemHeight},x.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();u(e)&&t.getAllowSizing()&&t.SetHeight(e*i)})}this.oT.onRL(),this.cweU()},x.prototype.getDefaultItemHeight=function(){return h(0,s(this.opt("defaultItemHeight",24)))},x.prototype.GetTreeColumnIndex=function(){return this.oO.treeColumnIndex},x.prototype.SetTreeColumnIndex=function(t){t!=this.getTreeColumnIndex()&&(this.cwbU(),this.oC.resKI(),this.oO.treeColumnIndex=t,this.cweU())},x.prototype.getTreeColumnIndex=function(){var t=this.GetTreeColumnIndex();return void 0===t&&(t=f.Def.Tree.treeColumnIndex||0),t},x.prototype.GetExpandOnDblClick=function(){return this.oO.expandOnDblClick},x.prototype.SetExpandOnDblClick=function(t){this.oO.expandOnDblClick=t},x.prototype.getExpandOnDblClick=function(){return this.opt("expandOnDblClick",!0)},x.prototype.GetItemAllowSizing=function(){return this.oO.itemAllowSizing},x.prototype.SetItemAllowSizing=function(t){this.oO.itemAllowSizing=t},x.prototype.getItemAllowSizing=function(){return this.opt("itemAllowSizing",!1)},x.prototype.GetEnsureOnSort=function(){return this.oO.ensureOnSort},x.prototype.SetEnsureOnSort=function(t){this.oO.ensureOnSort=t},x.prototype.getEnsureOnSort=function(){return this.opt("ensureOnSort",!0)},x.prototype.GetShowLockedItems=function(){return this.oO.showLockedItems},x.prototype.SetShowLockedItems=function(t){this.cwbU(),this.oO.showLockedItems=t,this.oT.onRL(),this.oT.resLCV(),this.cweU()},x.prototype.getShowLockedItems=function(){return this.opt("showLockedItems",!0)&&(this.oIT.len()||this.oIB.len())},x.prototype.LIOf=function(t){return this.oT.LIOf(t)},x.prototype.GetLockedItemsCount=function(t){return this.LIOf(t).GetCount()},x.prototype.SetLockedItemsCount=function(t,e){e=h(0,a(16,~~l(e,1)));var i=this.LIOf(t);if(i.GetCount()!=e){this.cwbU();for(var o=[],r=e,n=i.GetCount();rStart Filter...")},x.prototype.GetFilterBarPromptPattern=function(){return this.oO.filterBarPromptPattern},x.prototype.SetFilterBarPromptPattern=function(t){this.cwbU(),this.oO.filterBarPromptPattern=u(t)&&t.toString()||null,this.oT.onFilter(),this.cweU()},x.prototype.getFilterBarPromptPattern=function(){return n(this.GetFilterBarPromptPattern())},x.prototype.GetFilterBarPromptType=function(){return this.oO.filterBarPromptType},x.prototype.SetFilterBarPromptType=function(t){this.cwbU(),this.oO.filterBarPromptType=t,this.oT.onFilter(),this.cweU()},x.prototype.getFilterBarPromptType=function(){return p(this.opt("filterBarPromptType"),f.Tree.FilterPromptEnum,f.Tree.FilterPromptEnum.exFilterPromptContainsAll)},x.prototype.GetFilterBarPromptColumns=function(){return this.oO.filterBarPromptColumns},x.prototype.SetFilterBarPromptColumns=function(t){this.cwbU(),this.oO.filterBarPromptColumns=t,this.oT.onFilter(),this.cweU()},x.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},x.prototype.GetAllowDrop=function(){return this.oO.allowDrop},x.prototype.SetAllowDrop=function(t){this.oO.allowDrop=t},x.prototype.getAllowDrop=function(){return this.opt("allowDrop",!0)},x.prototype.GetOnErrorChooseFile=function(){return this.oO.onErrorChooseFile},x.prototype.SetOnErrorChooseFile=function(t){this.oO.onErrorChooseFile=t},x.prototype.getOnErrorChooseFile=function(){return this.opt("onErrorChooseFile",!0)},x.prototype.GetScrollPos=function(){return this.GetScroll()},x.prototype.SetScrollPos=function(t){this.SetScroll(t)},x.prototype.getScrollPos=function(){return this.GetScrollPos()},x.prototype.GetToolTipDelay=function(){return this.oO.toolTipDelay},x.prototype.SetToolTipDelay=function(t){this.oO.toolTipDelay=t},x.prototype.getToolTipDelay=function(){return this.opt("toolTipDelay",500)},x.prototype.GetToolTipPopDelay=function(){return this.oO.toolTipPopDelay},x.prototype.SetToolTipPopDelay=function(t){this.oO.toolTipPopDelay=t},x.prototype.getToolTipPopDelay=function(){return this.opt("toolTipPopDelay",5e3)},x.prototype.GetToolTipWidth=function(){return this.oO.toolTipWidth},x.prototype.SetToolTipWidth=function(t){this.oO.toolTipWidth=t},x.prototype.getToolTipWidth=function(){return this.opt("toolTipWidth",-1)},x.prototype.allowTT=function(){return f.TT&&this.getToolTipWidth()&&this.getToolTipPopDelay()},x.prototype.GetBackground=function(){return this.oO.background},x.prototype.SetBackground=function(t){this.cwbU(),this.oO.background=t,this.cweU()},x.prototype.getBackground=function(){return this.opt("background",R)},x.prototype.back=function(t,e){var i,o=this.getBackground(),r=o&&o[t];return c(r)&&(e&&t in o||c(r=(i=f.Def.Tree.background)&&i[t])&&(r=R[t])),r},f.expO({Count:null,Sorts:null},y.prototype),f.expO(f.Mrg({Options:null,Index:null},f.Tree.ColumnOptions),S.prototype),f.expO({Count:null,VisibleCount:null,MatchCount:null,LeafCount:null,HasChildren:null},T.prototype),f.expO(f.Mrg({Options:null,Index:null,Position:null,GroupItem:null},f.Tree.ItemOptions),m.prototype),f.expO({Locked:null},m.prototype,null,!1,f.expL("is")),f.expO(f.Mrg({Column:null,Item:null,Options:null},f.Tree.CellOptions),E.prototype),f.expO({Count:null},I.prototype),f.expO(f.Mrg({Options:null,Valid:null},f.Tree.ConditionalFormatOptions),O.prototype),{VO:t,EC:e,LC:d,LCV:C,Columns:y,Column:S,Sorter:v,Items:T,Item:m,CellF:G,ConditionalFormats:I,ConditionalFormat:O,Cell:E,LIV:b,LHIV:w,TV:x,BackgroundOptions:R}}()),f.Mrg(f.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,c="exprompt";return t.prototype.init=function(t){this.oTV=t,this.oS=t.oS,this.rgHVO=null,this.import()},f.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();f.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=f.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){f.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()?f.EyO(l.disabled)||(h=f.Inh(l.disabled,h)):r&&(f.EyO(l.hover)||(n=r.get(this,s.idAOH))&&(h=f.R.Shape(n.state,n.range,{from:h,to:l.hover})),f.EyO(l.click)||(n=r.get(this,s.idAOC))&&(h=f.R.Shape(n.state,n.range,{from:h,to:l.click})));var a=f.Tree.bSCTX(e,h,i),u=s.gCnt(i,this);e.selClip(i),e.drawHTMLPicture(s.getImage(),u.rtImage,s.getImageSize()),e.drawHTMLText(s.getCaption(),u.rtCaption,s.getFormatText()||h.formatText,h.tfi&&f.ToTFI(h.tfi)),u.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)),f.ORt(t.slice(),.5*t[2],-2.15*t[3]),f.DrawTextFormatEnum.exTextNoClip),e.globalAlpha=i}.call(this,u.rtSort),u.rtExpand&&this.drawExp(e,u.rtExpand,s.isExpanded(),!s.isEnabled()),u.rtFilter&&function(i){var o=this.toShapes(s.getType("filter"))||{},r=o.normal||o;!this.isEnabled()&&(f.EyO(o.disabled)||(r=f.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,u.rtFilter),e.resClip(),a&&f.Tree.eSCTX(e,a)},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=f.HitTest.Cursor.Rect(r.ht):this.isSelectable()&&(o=this.p2C(t))&&(e=this.getCursors(),this.p2CF(t)&&o.canFilter()?i=f.GP.Get("column-filter",e):this.p2CE(t)&&o.canExpand()&&(i=f.GP.Get("expand",e)),i||(i=o.GetCursor())||(i=f.GP.Get(f.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&&(!f.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}),!f.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 f.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=f.Tree.VO.p2O(this.getHVO(),g.X(i)-o.x,g.Y(i)-o.y,e);return e&&r&&f.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()&&g.R2C(this.GetClientRect())[1]>g.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=f.PInR(g.X(r),g.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=f.PInR(g.X(n),g.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(){f.TT.Hide()},t.prototype.showTT=function(t){var e,i=this.gPtr(t),o=[],r=this.p2C(i,o),n=16;f.TT.Show(function(){return r&&(e=r.tt(this,o))&&{relative:t.target,client:function(){return this.ctxTfi(function(t){var i=f.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=f.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,u=this.scaled(this.GetClientRect()[2])-e[0]*(this.len()+1),c=0;if(this.forEach(function(t){l.set(t,{auto:o=t.autoWidth(),width:r=h(o,t.getWidth())}),n+=r}),(c=n-u)>0){for(var p=!0,g=this.len();p&&(c=~~(n-u))>0;){var d=c;l.forEach(function(t){if(c>0){var e=a(c/g,h(0,t.width-t.auto));t.width-=e,n-=e,c-=e}}),p=d-c}c>0&&(s=a(1,u/n))}this.forEach(function(o){i[2]=s*l.get(o).width,t.lock.set(o.IDHVO(),i.slice()),f.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=f.PRt(e,this.getPad(),-1),i),t.drawHTMLText(this.oTV.getSortBarCaption(),e=f.PRt(e,this.getPad(),-1),f.DrawTextFormatEnum.exTextAlignVCenter|f.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&&f.Cmp.S||f.Cmp.R(f.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]-g.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(g.X(t)-e[0]),o=this.scaled(g.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?f.h:f.w])-2*i[t?f.y:f.x]-this.capH(),range:this.cols().length*this.oTV.getHeaderHeight()})},n.prototype.getHVO=function(){return this.rgHVO||(this.rgHVO=function(){var t=f.Tree.VO(),e=this.cols(),i=e.length;if(t.check=new f.M1,i){var o=this.getPad(),r=this.GetClientRect(),n=this.GetScroll().y,s=this.oTV.getHeaderHeight(),l=o[0],u=o[1],c=this.scaled(r[2]),p=c-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],p-=S,S-=o[0]),u+=C-(a(y,m)*s+n%s),I=h(0,y-m);u1)for(var r,n=!0,l=t.get(this.oW);n;)n=!1,o.forEach(function(e){r=t.get(e.oW),l!=r&&!f.EyR(r)&&l[1]==r[1]&&l[3]==r[3]&&(l[0]0&&(h[0]=f.ROf(t)-n),h[1]+=(h[3]-n)/2,h[3]=n,n+=o,s<0&&(t[0]+=n),t[2]-=n),this.showPat())if(a=t.slice(),a[3]=this.getFilterBarHeight()-2*r,l){a[2]=t[2]/2,a[1]+=(t[3]-a[3])/2;var c=a[2]+o;t[0]+=c,t[2]-=c}else{var p=a[3]+r;t[1]+=p,t[3]-=p}return this.showCap()&&(u=t),{rtClose:e(h),rtPrompt:e(a),rtCaption:e(u)}},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(f.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=g.X(r),s=g.Y(r);if(f.PInR(n,s,o)){var l=this.gCtx(),h=null,a=null,u=l.renderText,c=f.TFI.bCTX(l,this.getTfi());l.renderText=function(t,e,i){if(!h){var o=[e,i,this.measureText(t).width,this.fontHeight()];f.PInR(n,s,o)&&(a=o,h=t)}},this.ctxScale(l,this.GetClientRect(),function(t){l.drawHTMLText(this.cap(),o,f.DrawTextFormatEnum.exTextAlignLeft|(this.isSingle()?f.DrawTextFormatEnum.exTextAlignVCenter|f.DrawTextFormatEnum.exTextSingleLine:0))},this),l.renderText=u,f.TFI.eCTX(l,c),h&&(i=this.oTV.oC.Item(h.trim()))&&e&&e.push.apply(e,a)}}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=f.GP.Get(i,this.getCursors()),(o=this.p2C(t))&&o.canFilter()&&(e=f.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)&&f.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"+f.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(),h=2&this.hasFilter()&&this.patt()||"";n&&(!l&&(l=!void f.aCSS("."+c,"{background:rgba(0, 0, 0, 0);border:0;padding:0;margin:0;outline:0;")),(o=f.EF.Create({name:"filter.prompt-edit",class:c,client:this.rtCA(n,!1),relative:this.GetCanvas(),clip:this.GetCanvas(),tag:"input",inner:{value:h,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,h);break;case"change":e.call(this,t.value,function(e){clearTimeout(i),i=f.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;f.Keys.IsStEv(e.stglFB,t)&&(e.toggleFilterBar(),f.EF.Destroy(o),f.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=f.Tree});