// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See http://js.arcgis.com/3.23/esri/copyright.txt for details.
//>>built
define("esri/dijit/geoenrichment/ReportPlayer/core/reportContainers/containerUtils/SerializationManager","dojo/_base/declare dojo/_base/lang dojo/dom-style ./QueryUtil ../../supportClasses/DocumentOptions esri/dijit/geoenrichment/utils/DomUtil esri/dijit/geoenrichment/ReportPlayer/core/sections/SectionTypes esri/dijit/geoenrichment/ReportPlayer/core/supportClasses/ReportTemplateTypes".split(" "),function(h,e,f,k,l,m,g,n){return h(null,{_wizard:null,_pendingJsonObj:null,constructor:function(a){this._wizard=
a},notifyShown:function(){if(this._canApplyJson()&&this._pendingJsonObj&&this._pendingJsonObj.sections&&this._pendingJsonObj.sections.length){var a=this._pendingJsonObj;this._pendingJsonObj=null;f.set(this._wizard.domNode,"visibility","visible");this.fromJson(a);!this._pendingJsonObj&&this._wizard.onPendingDataApplied()}},_canApplyJson:function(){return m.isNodeInLayout(this._wizard.domNode)},fromJson:function(a){a=a||{sections:[]};if(this._canApplyJson()){this._pendingJsonObj=null;f.set(this._wizard.domNode,
"visibility","visible");this._wizard.clear();this._wizard.documentOptions=e.mixin(l.getDefaultDocumentOptions(),a.documentOptions);f.set(this._wizard.stackContainer,"backgroundColor",this._wizard.documentOptions.backgroundColor||this._wizard.viewModel.getDocumentDefaultStyles(this._wizard.theme||this._wizard.themeContext).backgroundColor);this._wizard.updateLayout();var c=this._wizard.viewModel.dynamicReportInfo;if(c&&1<c.features.length){var d={documentOptions:a.documentOptions,sections:[]};if(c.reportType===
n.MULTICOLUMN)a.sections.forEach(function(a){if(function(a){return a.type===g.DETAILS&&a.stack&&a.stack.some(function(a){return"table"===a.id&&(!a.attributes||!a.attributes.dynamicColumns&&!a.attributes.dynamicRows)})}(a))for(var b=0;b<c.features.length;b++)0!==b&&(a=e.clone(a)),a.previewFeatureIndex=b,d.sections.push(a);else d.sections.push(a)});else{a=a.sections;for(var b=0;b<c.features.length;b++)0!==b&&(a=e.clone(a)),a.forEach(function(a){a.previewFeatureIndex=b}),d.sections=d.sections.concat(a)}a=
d}var p=this;a.sections.forEach(function(a){p.addSectionFromJson(a)})}else this._pendingJsonObj=a,f.set(this._wizard.domNode,"visibility","hidden")},addSectionFromJson:function(a,c,d,b){var e=this._isPageBreakSection(a)?"pageBreak":a.type===g.EMPTY?"empty":"custom";return this._wizard.addSection(e,{json:a},c,d,b)},_isPageBreakSection:function(a){return a.stack&&1===a.stack.length&&"pageBreak"===a.stack[0].id},toJson:function(a){var c={};c.documentOptions=e.clone(this._wizard.documentOptions||{});
c.sections=[];var d=this;k.getReportElements(this._wizard).forEach(function(b){b=d._wizard.getElementSection(b);!b||!a&&b.isEmpty()||c.sections.push(b.toJson())});return c}})});