text: /**
   * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
   * The Universal Permissive License (UPL), Version 1.0
   */
  "use strict";
  define(["ojs/ojcore","jquery","ojs/ojdatasource-common","ojs/ojrowexpander"],function(a){a.yj=function(g,c,b,d,e){a.C.hM(b);this.Td=g;this.Uh=c;this.LW=b;this.Wc=d;this.Da=e};o_("FlattenedTreeHeaderSet",a.yj,a);a.yj.prototype.getData=function(g,c){var b;a.C.assert(g<=this.Uh&&g>=this.Td,"index out of bounds");a.C.assert(null==c||0==c,"level out of bounds");return null!=this.Da&&null!=this.Wc?(b=this.Wc.getData(g-this.Td+this.Wc.getStart()),null!=b?b.get?b.get(this.Da):b[this.Da]:null):this.LW[g]};
  a.f.j("FlattenedTreeHeaderSet.prototype.getData",{getData:a.yj.prototype.getData});a.yj.prototype.getMetadata=function(g,c){a.C.assert(g<=this.Uh&&g>=this.Td,"index out of bounds");a.C.assert(null==c||0==c,"level out of bounds");return null!=this.Da&&null!=this.Wc?this.Wc.getMetadata(g-this.Td+this.Wc.getStart()):{key:this.getData(g)}};a.f.j("FlattenedTreeHeaderSet.prototype.getMetadata",{getMetadata:a.yj.prototype.getMetadata});a.yj.prototype.getCount=function(){return null!=this.Da&&null!=this.Wc?
  Math.min(this.Wc.getCount(),this.Uh-this.Td):Math.max(0,this.Uh-this.Td)};a.f.j("FlattenedTreeHeaderSet.prototype.getCount",{getCount:a.yj.prototype.getCount});a.yj.prototype.getLevelCount=function(){return 0<this.getCount()?1:0};a.f.j("FlattenedTreeHeaderSet.prototype.getLevelCount",{getLevelCount:a.yj.prototype.getLevelCount});a.yj.prototype.getExtent=function(g,c){a.C.assert(g<=this.Uh&&g>=this.Td,"index out of bounds");a.C.assert(null==c||0==c,"level out of bounds");return{extent:1,more:{before:!1,
  after:!1}}};a.f.j("FlattenedTreeHeaderSet.prototype.getExtent",{getExtent:a.yj.prototype.getExtent});a.yj.prototype.getDepth=function(g,c){a.C.assert(g<=this.Uh&&g>=this.Td,"index out of bounds");a.C.assert(null==c||0==c,"level out of bounds");return 1};a.f.j("FlattenedTreeHeaderSet.prototype.getDepth",{getDepth:a.yj.prototype.getDepth});a.yl=function(g,c,b,d,e,f){a.C.hM(f);this.Za=g;this.Qa=c;this.Is=b;this.KB=d;this.Wc=e;this.qh=f};o_("FlattenedTreeCellSet",a.yl,a);a.yl.prototype.getData=function(g){var c,
  b,d,e;c=this.Hla(g);if(null==c)return null;g=c[0];c=c[1];a.C.assert(g<this.Wc.getStart()+this.Wc.getCount()&&c<this.qh.length);b=this.qh[c];d=this.Wc.getData(g);return null!=d?(g={},c=d.get?function(){return d.get(b)}:function(){return d[b]},e=d.set?function(a){return d.set(b,a)}:function(a){d[b]=a},Object.defineProperty(g,"data",{enumerable:!0,get:c,set:e}),g):null};a.f.j("FlattenedTreeCellSet.prototype.getData",{getData:a.yl.prototype.getData});a.yl.prototype.getMetadata=function(g){var c;c=this.Hla(g);
  if(null==c)return null;g=c[0];c=c[1];a.C.assert(g<this.Wc.getStart()+this.Wc.getCount()&&c<this.qh.length);c=this.qh[c];g=this.Wc.getMetadata(g);g.keys={row:g.key,column:c};return g};a.f.j("FlattenedTreeCellSet.prototype.getMetadata",{getMetadata:a.yl.prototype.getMetadata});a.yl.prototype.Hla=function(g){var c;a.C.dk(g);if(null==this.Wc||0==this.Wc.length)return null;c=g.row-this.Za+this.Wc.getStart();g=g.column;a.C.Gu(c,null);a.C.Gu(g,null);a.C.assert(0<=c&&0<=g);return[c,g]};a.yl.prototype.getStart=
  function(a){return"row"===a?this.Za:"column"===a?this.Is:0};a.f.j("FlattenedTreeCellSet.prototype.getStart",{getStart:a.yl.prototype.getStart});a.yl.prototype.getCount=function(a){return"row"===a?Math.min(this.Qa-this.Za,this.Wc.getCount()):"column"===a?this.KB-this.Is:0};a.f.j("FlattenedTreeCellSet.prototype.getCount",{getCount:a.yl.prototype.getCount});a.yl.prototype.getExtent=function(){return{row:{extent:1,more:{before:!1,after:!1}},column:{extent:1,more:{before:!1,after:!1}}}};a.f.j("FlattenedTreeCellSet.prototype.getExtent",
  {getExtent:a.yl.prototype.getExtent});a.Yb=function(g,c){a.Yb.N.constructor.call(this,g,c)};o_("FlattenedTreeDataGridDataSource",a.Yb,a);a.f.va(a.Yb,a.Fa,"oj.FlattenedTreeDataGridDataSource");a.Yb.prototype.Init=function(){a.Yb.N.Init.call(this);this.qh=a.Yb.N.DM.call(this,"columns");this.Da=a.Yb.N.DM.call(this,"rowHeader")};a.f.j("FlattenedTreeDataGridDataSource.prototype.Init",{Init:a.Yb.prototype.Init});a.Yb.prototype.getCountPrecision=function(a){return"row"===a?"estimate":"actual"};a.f.j("FlattenedTreeDataGridDataSource.prototype.getCountPrecision",
  {getCountPrecision:a.Yb.prototype.getCountPrecision});a.Yb.prototype.getCount=function(a){return"row"===a?-1:"column"===a?this.qh.length:0};a.f.j("FlattenedTreeDataGridDataSource.prototype.getCount",{getCount:a.Yb.prototype.getCount});a.Yb.prototype.fetchHeaders=function(g,c,b){var d,e;d=g.axis;if("column"===d)d=g.start+g.count,d>this.getCount("column")&&(d=this.getCount("column")-g.start),e=new a.yj(g.start,d,this.qh);else if("row"===d&&null!=this.Da){this.Fs={range:g,callbacks:c,callbackObjects:b};
  return}null!=c&&null!=c.success&&(null==b&&(b={}),c.success.call(b.success,e,g,null))};a.f.j("FlattenedTreeDataGridDataSource.prototype.fetchHeaders",{fetchHeaders:a.Yb.prototype.fetchHeaders});a.Yb.prototype.fetchCells=function(g,c,b){var d,e,f,h;for(d=0;d<g.length;d++)if(e=g[d],"row"==e.axis){f=e.start;h=e.count;break}a.Yb.N.Su.call(this,{start:f,count:h},{success:function(a){this.Z3(a,g,c,b,0)}.bind(this),error:function(a){this.IPa(a,{start:f,count:h},c,b)}.bind(this)})};a.f.j("FlattenedTreeDataGridDataSource.prototype.fetchCells",
  {fetchCells:a.Yb.prototype.fetchCells});a.Yb.prototype.keys=function(g){var c,b;c=g.row;b=g.column;return new Promise(function(d){c>a.Yb.N.D1a.call(this).end||b>this.qh.length?d(null):d({row:a.Yb.N.getKey.call(this,c),column:this.qh[b]})}.bind(this))};a.f.j("FlattenedTreeDataGridDataSource.prototype.keys",{keys:a.Yb.prototype.keys});a.Yb.prototype.indexes=function(g){var c,b,d,e,f;d=g.row;e=g.column;return new Promise(function(g){c=a.Yb.N.Bn.call(this,d);for(f=0;f<this.qh.length;f++)if(this.qh[f]===
  e){b=f;break}0<=c||0<=b?g({row:c,column:b}):g(null)}.bind(this))};a.f.j("FlattenedTreeDataGridDataSource.prototype.indexes",{indexes:a.Yb.prototype.indexes});a.Yb.prototype.sort=function(g,c,b){return a.Yb.N.getWrappedDataSource.call(this).sort(g,{success:function(){this.m4(c,b)}.bind(this),error:c.error})};a.f.j("FlattenedTreeDataGridDataSource.prototype.sort",{sort:a.Yb.prototype.sort});a.Yb.prototype.m4=function(a,c){this.refresh();a.success&&(null==c&&(c={}),a.success.call(c.success))};a.Yb.prototype.move=
  function(g,c,b,d){a.Yb.N.getWrappedDataSource.call(this).move(g,c,b,d)};a.f.j("FlattenedTreeDataGridDataSource.prototype.move",{move:a.Yb.prototype.move});a.Yb.prototype.getCapability=function(g){return"default"===a.Yb.N.getWrappedDataSource.call(this).getCapability(g)?"column":"none"};a.f.j("FlattenedTreeDataGridDataSource.prototype.getCapability",{getCapability:a.Yb.prototype.getCapability});a.Yb.prototype.DB=function(g,c){a.Yb.N.DB.call(this,g,c)};a.Yb.prototype.Z3=function(g,c,b,d){var e,f,h,
  k,l,m;for(e=0;e<c.length;e++)f=c[e],"row"==f.axis?(h=f.start,k=f.count):"column"==f.axis&&(l=f.start,m=f.count,l+m>this.getCount("column")&&(m=this.getCount("column")-l));this.Fs&&(e=this.Fs.range,e.start==h&&e.count==k&&(this.h4(g,e,this.Fs.callbacks,this.Fs.callbackObjects),this.Fs=null));g=new a.yl(h,h+k,l,l+m,g,this.qh);b.success&&(null==d&&(d={}),b.success.call(d.success,g,c))};a.Yb.prototype.IPa=function(a,c,b,d){var e;this.Fs&&(e=this.Fs.range,e.start==c.start&&e.count==c.count&&(c=this.Fs.callbacks,
  e=this.Fs.callbackObjects,c.error&&(null==e&&(e={}),c.error.call(e.error,a))),this.Fs=null);b.error&&(null==d&&(d={}),b.success.call(d.error,a))};a.Yb.prototype.h4=function(g,c,b,d){g=new a.yj(c.start,c.start+c.count,this.qh,g,this.Da);b.success&&(null==d&&(d={}),b.success.call(d.success,g,c,null))};a.Yb.prototype.kW=function(g,c,b){var d,e,f,h;d=null;this.Da&&(d=new a.yj(g,g+b.getCount(),this.qh,b,this.Da));c=new a.yl(g,g+b.getCount(),0,this.qh.length,b,this.qh);f=[];h=[];for(e=0;e<b.getCount();e++)f.push({row:this.Nl(g+
  e).key}),h.push({row:g+e,column:-1});g={source:this,operation:"insert"};g.result=c;d&&(g.header=d);g.keys=f;g.indexes=h;a.Yb.N.handleEvent.call(this,"change",g)};a.Yb.prototype.lX=function(g){var c,b,d;c=[];d=[];for(b=0;b<g.length;b++)c.push({row:g[b].key}),d.push({row:g[b].index,column:-1});g={source:this,operation:"delete"};g.keys=c;g.indexes=d;a.Yb.N.handleEvent.call(this,"change",g)};a.Yb.prototype.R9=function(g,c){c.success.call(null,new a.xj(null,g.start))}});