// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://@sbaseurl@/jsapi/jsapi/esri/copyright.txt and http://www.arcgis.com/apps/webappbuilder/copyright.txt for details.

//>>built
require({cache:{"url:widgets/CostAnalysis/advance-item-list.html":'\x3cdiv\x3e\r\n  \x3cdiv class \x3d "esriCTItemListContainer" data-dojo-attach-point\x3d"itemListContainer"\x3e\x3c/div\x3e\r\n\x3c/div\x3e'}});
define("dojo/_base/declare jimu/BaseWidget dojo/Evented dijit/_WidgetsInTemplateMixin dojo/text!./advance-item-list.html dojo/_base/array dojo/_base/lang dojo/dom-attr dojo/dom-class dojo/dom-style dojo/on dojo/query dojo/dom-construct dojo/keys dojo/_base/event".split(" "),function(y,z,A,B,C,t,k,d,e,n,p,g,l,q,r){return y([z,A,B],{templateString:C,baseClass:"jimu-widget-cost-analysis-advance-item-list",activeIndex:0,currentActivePanel:null,highlighterColor:"#000",setAutoHeight:!1,postCreate:function(){this.inherited(arguments)},
startup:function(){this.inherited(arguments);this.itemList&&0<this.itemList.length&&setTimeout(k.hitch(this,function(){this._loadItemList()}),0)},_loadItemList:function(){t.forEach(this.itemList,k.hitch(this,function(a,b){this.addItem(a,b)}));this.emit("onLoad")},addItem:function(a,b){a.content=a.content||"";var c=l.create("div",{"class":"esriCTItem"},null);d.set(c,"index",b);this._createItemTitle(a,c);a.content&&this._createItemContent(a,c);this.itemListContainer.appendChild(c);a.isOpen&&this._togglePanel(c,
!0);a.isHidden&&this.hide(b)},_createImageLogo:function(a,b,c){b=l.create("div",{"class":"esriCTItemListImageLogo"},b);"icon"===c?e.add(b,a.icon):"actionIcon"===c?(d.set(b,"tabindex","0"),e.add(b,"esriCTWorkBenchDOM"),d.set(b,"role","button"),d.set(b,"aria-label",a.actionIconTitle),e.add(b,a.actionIcon)):(e.add(b,"esriCTArrow"),this.togglePanels&&e.add(b,"esriCTArrowDown"));return b},_createItemTitle:function(a,b){var c=l.create("div",{"class":"esriCTItemTitleContainer",tabindex:"0","aria-label":a.title,
role:"button"},b);a.title===this.nls.projectOverview.projectSummaryTitle&&e.add(c,"esriCTProjectSummary");a.title===this.nls.projectOverview.assetItemsTitle?e.add(c,"esriCTAssetItems"):d.set(c,"aria-expanded","false");this.fromProjectOverview&&(e.add(c,"esriCTProjectOverview"),e.add(c,"esriCTWorkBenchDOM"));var h=l.create("div",{"class":"esriCTItemHighlighter"},c);this.highlighter||e.add(h,"esriCTHidden");a.icon&&this._createImageLogo(a,c,"icon");h=l.create("div",{"class":"esriCTItemTitle esriCTFloatLeft esriCTEllipsis",
innerHTML:a.title,title:a.title},c);if(a.actionIcon){var m=this._createImageLogo(a,c,"actionIcon");a.actionIconTitle&&d.set(m,"title",a.actionIconTitle);this.own(p(m,"click",k.hitch(this,function(f){r.stop(f);this.emit("onActionButtonClicked",d.get(b,"index"))})));this.own(p(m,"keydown",k.hitch(this,function(f){if(f.keyCode===q.ENTER||f.keyCode===q.SPACE)r.stop(f),this.emit("onActionButtonClicked",d.get(b,"index"))})))}this.showArrow&&this._createImageLogo(a,c,"arrow");this._setItemTitleWidth(a,h);
this.own(p(c,"click",k.hitch(this,function(){this.togglePanels&&this._togglePanel(b,!1);this.emit("onTitleClicked",d.get(b,"index"))})));this.own(p(c,"keydown",k.hitch(this,function(f){if(f.keyCode===q.ENTER||f.keyCode===q.SPACE)r.stop(f),this.togglePanels&&this._togglePanel(b,!1),this.emit("onTitleClicked",d.get(b,"index"))})))},_setItemTitleWidth:function(a,b){var c=0;a.icon&&(c+=32);a.actionIcon&&(c+=32);this.showArrow&&(c+=32);this.highlighter&&(c+=10);n.set(b,"width","calc(100% - "+c+"px)")},
_createItemContent:function(a,b){b=l.create("div",{"class":"esriCTItemContent"},b);this.setAutoHeight||e.add(b,"esriCTItemAnimation");"string"===typeof a.content?d.set(b,"innerHTML",a.content):l.place(a.content,b)},_togglePanel:function(a,b){var c=0;b||(c=30);b=g(".esriCTItemTitle",a)[0];var h=g(".esriCTItemContent",a)[0];var m=g(".esriCTArrow",a)[0];var f=g(".esriCTItemHighlighter",a)[0];var u=g(".esriCTToggleIcon",a);var v=g(".esriCTEditEquationIcon",a);var w=g(".esriCTSelectableRow",a);var x=g(".esriCTGroupSummaryTotalRow",
a);b&&h&&(e.contains(h,"esriCTItemContentActive")?(h.style.height=0,this.currentActivePanel&&d.get(this.currentActivePanel,"index")===d.get(a,"index")&&(this.currentActivePanel=null),n.set(f,"backgroundColor","transparent"),this.showArrow&&this.togglePanels&&(e.replace(m,"esriCTArrowDown","esriCTArrowUp"),d.set(b.parentNode,"aria-expanded","false"),this._setTabIndexToNodes(u,"-1"),this._setTabIndexToNodes(v,"-1"),this._setTabIndexToNodes(w,"-1"),this._setTabIndexToNodes(x,"-1"))):(h.style.height=
this.togglePanels&&!this.setAutoHeight?h.scrollHeight+c+"px":"auto",this.currentActivePanel&&!this.openMultiple&&this._togglePanel(this.currentActivePanel,!0),this.currentActivePanel=a,n.set(f,"backgroundColor",this.highlighterColor),this.showArrow&&this.togglePanels&&(e.replace(m,"esriCTArrowUp","esriCTArrowDown"),d.set(b.parentNode,"aria-expanded","true"),this._setTabIndexToNodes(u,"0"),this._setTabIndexToNodes(v,"0"),this._setTabIndexToNodes(w,"0"),this._setTabIndexToNodes(x,"0"))),e.toggle(h,
"esriCTItemContentActive"))},onTitleClicked:function(){},onAnalysisButtonClicked:function(){},show:function(a){a=g(".esriCTItem[index \x3d "+a+"]",this.itemListContainer);1===a.length&&(n.set(a[0],"display",""),a.isHidden=!1)},hide:function(a){a=g(".esriCTItem[index \x3d "+a+"]",this.itemListContainer);1===a.length&&(n.set(a[0],"display","none"),a.isHidden=!0)},_setTabIndexToNodes:function(a,b){a&&0<a.length&&t.forEach(a,k.hitch(this,function(c){d.set(c,"tabindex",b)}))}})});