// 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/conversion/PortalToEditorConverter","dojo/_base/declare dojo/promise/all dojo/when ./portalToEditorUtils/LayoutParser ./portalToEditorUtils/MetadataParser ./portalToEditorUtils/ImageCollector ./portalToEditorUtils/parsers/Parsers ./portalToEditorUtils/variables/DummyVariableProvider ../supportClasses/DefaultStyles ../supportClasses/images/ImageDataHolder ../themes/conversion/CssParser esri/dijit/geoenrichment/utils/async/AsyncQueue esri/dijit/geoenrichment/utils/DelayUtil".split(" "),
function(F,G,f,t,u,v,l,w,x,m,y,z,A){return{provideEditorJson:function(e,a){function B(){function d(b,n,d){return f(a.preProcessFile&&a.preProcessFile(b,n,c),function(e){if(!1!==e)return f(d&&d(),function(){return a.postProcessFile&&a.postProcessFile(b,n,c)})})}if(g&&g.files&&g.files){var e=a.filesToProcess||["theme.css.txt","metadata.xml","report.xml"],q={"theme.css.txt":function(b){return d(b,"theme.css.txt",function(){c.theme=y.fromCssText(b.data,a)})},"metadata.xml":function(b){return d(b,"metadata.xml",
function(){return u.parseMetadataXML(b,c,a)})},"report.xml":function(b){return d(b,"report.xml",function(){return t.parseReportXML({isGraphicReport:p,parsers:l,file:b,templateJson:c,variableProvider:C,tableDefaultStyles:D,processFileName:k,putImageData:function(a,b){a=k(a);m.putImageData(a,b||h[a])},log:E,queryMetaDataFunc:function(b){return a.queryMetaDataFunc&&a.queryMetaDataFunc(b,c)}})})},generic:function(a,c){return d(a,c)}},r=new z;e.forEach(function(b){var d=g.files.filter(function(a){return a.name===
b})[0],c=d&&(q[b]||q.generic);c&&r.add(function(){return f(A.delay(50),function(){return c(d,b)}).otherwise(function(b){a.parseErrors.push(b)})})});return r.getPromise()}}a=a||{};var p=e.isGraphicReport,C=a.variableProvider=a.variableProvider||new w,D=a.tableDefaultStyles||new x;a.parseErrors=[];var c={documentOptions:{},metadata:{mapImageInfosHash:{},comparisonCalculatorsHash:{}},theme:{}};p?c.sectionsTables=[]:c.sections=[];var g=e.portalJson,h={},k=function(a){return a?a.toLowerCase():""},E=a.log||
function(a){};return f(l.initialize(),function(){return f(v.collectImageResources(g,h,k),function(){for(var d in h)m.putImageData(d,h[d]);return f(B(),function(){delete c.metadata;a.parseErrors.length||(e.templateJson=c)})})})}}});